@typescape-ai/mcp 1.9.31 → 1.9.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +0 -2
  2. package/dist/mcp.js +145 -121
  3. package/package.json +1 -1
package/dist/mcp.js CHANGED
@@ -1,145 +1,145 @@
1
- import{createRequire as En}from"node:module";var fn=Object.create;var{getPrototypeOf:An,defineProperty:yU,getOwnPropertyNames:Mn}=Object;var zn=Object.prototype.hasOwnProperty;function Sn($){return this[$]}var un,Tn,sG=($,v,w)=>{var g=$!=null&&typeof $==="object";if(g){var _=v?un??=new WeakMap:Tn??=new WeakMap,b=_.get($);if(b)return b}w=$!=null?fn(An($)):{};let J=v||!$||!$.__esModule?yU(w,"default",{value:$,enumerable:!0}):w;for(let D of Mn($))if(!zn.call(J,D))yU(J,D,{get:Sn.bind($,D),enumerable:!0});if(g)_.set($,J);return J};var E=($,v)=>()=>(v||$((v={exports:{}}).exports,v),v.exports);var Rn=($)=>$;function Cn($,v){this[$]=Rn.bind(null,v)}var $v=($,v)=>{for(var w in v)yU($,w,{get:v[w],enumerable:!0,configurable:!0,set:Cn.bind(v,w)})};var Qw=En(import.meta.url);var mU=E((fT,Zn)=>{Zn.exports={name:"@typescape-ai/mcp",version:"1.9.30",description:"Typescape MCP server for review, finding, and rules workflows in external agent harnesses",type:"module",bin:{"typescape-mcp":"./bin/typescape-mcp"},files:["bin","dist","README.md"],exports:{".":"./dist/mcp.js"},publishConfig:{access:"public"},scripts:{build:"bun build src/index.ts --outfile=dist/mcp.js --target=node --bundle --minify",dev:"bun run --watch src/index.ts",test:"bun test",typecheck:"tsc --noEmit",lint:"eslint src",prepublishOnly:"bun run build"},dependencies:{},devDependencies:{"@modelcontextprotocol/sdk":"1.0.4","@types/bun":"1.3.8","@typescape/schemas":"workspace:*",zod:"4.3.0"},engines:{node:">=18.17.0",bun:">=1.0.0"},keywords:["typescape","mcp","mcp-server","model-context-protocol","agent","automation","review","finding","rules","cursor","windsurf","bun"],repository:{type:"git",url:"https://github.com/voidserf/typescape-docs.git",directory:"apps/mcp"},license:"MIT"}});var _$=E((FL)=>{var uD=Symbol.for("yaml.alias"),U5=Symbol.for("yaml.document"),G0=Symbol.for("yaml.map"),J5=Symbol.for("yaml.pair"),TD=Symbol.for("yaml.scalar"),Y0=Symbol.for("yaml.seq"),uv=Symbol.for("yaml.node.type"),nL=($)=>!!$&&typeof $==="object"&&$[uv]===uD,qL=($)=>!!$&&typeof $==="object"&&$[uv]===U5,IL=($)=>!!$&&typeof $==="object"&&$[uv]===G0,BL=($)=>!!$&&typeof $==="object"&&$[uv]===J5,D5=($)=>!!$&&typeof $==="object"&&$[uv]===TD,LL=($)=>!!$&&typeof $==="object"&&$[uv]===Y0;function X5($){if($&&typeof $==="object")switch($[uv]){case G0:case Y0:return!0}return!1}function VL($){if($&&typeof $==="object")switch($[uv]){case uD:case G0:case TD:case Y0:return!0}return!1}var jL=($)=>(D5($)||X5($))&&!!$.anchor;FL.ALIAS=uD;FL.DOC=U5;FL.MAP=G0;FL.NODE_TYPE=uv;FL.PAIR=J5;FL.SCALAR=TD;FL.SEQ=Y0;FL.hasAnchor=jL;FL.isAlias=nL;FL.isCollection=X5;FL.isDocument=qL;FL.isMap=IL;FL.isNode=VL;FL.isPair=BL;FL.isScalar=D5;FL.isSeq=LL});var Wg=E((ZL)=>{var F$=_$(),Z$=Symbol("break visit"),G5=Symbol("skip children"),Vv=Symbol("remove node");function Q0($,v){let w=Y5(v);if(F$.isDocument($)){if(X6(null,$.contents,w,Object.freeze([$]))===Vv)$.contents=null}else X6(null,$,w,Object.freeze([]))}Q0.BREAK=Z$;Q0.SKIP=G5;Q0.REMOVE=Vv;function X6($,v,w,g){let _=Q5($,v,w,g);if(F$.isNode(_)||F$.isPair(_))return W5($,g,_),X6($,_,w,g);if(typeof _!=="symbol"){if(F$.isCollection(v)){g=Object.freeze(g.concat(v));for(let b=0;b<v.items.length;++b){let J=X6(b,v.items[b],w,g);if(typeof J==="number")b=J-1;else if(J===Z$)return Z$;else if(J===Vv)v.items.splice(b,1),b-=1}}else if(F$.isPair(v)){g=Object.freeze(g.concat(v));let b=X6("key",v.key,w,g);if(b===Z$)return Z$;else if(b===Vv)v.key=null;let J=X6("value",v.value,w,g);if(J===Z$)return Z$;else if(J===Vv)v.value=null}}return _}async function W0($,v){let w=Y5(v);if(F$.isDocument($)){if(await G6(null,$.contents,w,Object.freeze([$]))===Vv)$.contents=null}else await G6(null,$,w,Object.freeze([]))}W0.BREAK=Z$;W0.SKIP=G5;W0.REMOVE=Vv;async function G6($,v,w,g){let _=await Q5($,v,w,g);if(F$.isNode(_)||F$.isPair(_))return W5($,g,_),G6($,_,w,g);if(typeof _!=="symbol"){if(F$.isCollection(v)){g=Object.freeze(g.concat(v));for(let b=0;b<v.items.length;++b){let J=await G6(b,v.items[b],w,g);if(typeof J==="number")b=J-1;else if(J===Z$)return Z$;else if(J===Vv)v.items.splice(b,1),b-=1}}else if(F$.isPair(v)){g=Object.freeze(g.concat(v));let b=await G6("key",v.key,w,g);if(b===Z$)return Z$;else if(b===Vv)v.key=null;let J=await G6("value",v.value,w,g);if(J===Z$)return Z$;else if(J===Vv)v.value=null}}return _}function Y5($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function Q5($,v,w,g){if(typeof w==="function")return w($,v,g);if(F$.isMap(v))return w.Map?.($,v,g);if(F$.isSeq(v))return w.Seq?.($,v,g);if(F$.isPair(v))return w.Pair?.($,v,g);if(F$.isScalar(v))return w.Scalar?.($,v,g);if(F$.isAlias(v))return w.Alias?.($,v,g);return}function W5($,v,w){let g=v[v.length-1];if(F$.isCollection(g))g.items[$]=w;else if(F$.isPair(g))if($==="key")g.key=w;else g.value=w;else if(F$.isDocument(g))g.contents=w;else{let _=F$.isAlias(g)?"alias":"scalar";throw Error(`Cannot replace node with ${_} parent`)}}ZL.visit=Q0;ZL.visitAsync=W0});var RD=E((mL)=>{var H5=_$(),hL=Wg(),cL={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},yL=($)=>$.replace(/[!,[\]{}]/g,(v)=>cL[v]);class p${constructor($,v){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},p$.defaultYaml,$),this.tags=Object.assign({},p$.defaultTags,v)}clone(){let $=new p$(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new p$(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:p$.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},p$.defaultTags);break}return $}add($,v){if(this.atNextDocument)this.yaml={explicit:p$.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},p$.defaultTags),this.atNextDocument=!1;let w=$.trim().split(/[ \t]+/),g=w.shift();switch(g){case"%TAG":{if(w.length!==2){if(v(0,"%TAG directive should contain exactly two parts"),w.length<2)return!1}let[_,b]=w;return this.tags[_]=b,!0}case"%YAML":{if(this.yaml.explicit=!0,w.length!==1)return v(0,"%YAML directive should contain exactly one part"),!1;let[_]=w;if(_==="1.1"||_==="1.2")return this.yaml.version=_,!0;else{let b=/^\d+\.\d+$/.test(_);return v(6,`Unsupported YAML version ${_}`,b),!1}}default:return v(0,`Unknown directive ${g}`,!0),!1}}tagName($,v){if($==="!")return"!";if($[0]!=="!")return v(`Not a valid tag: ${$}`),null;if($[1]==="<"){let b=$.slice(2,-1);if(b==="!"||b==="!!")return v(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")v("Verbatim tags must end with a >");return b}let[,w,g]=$.match(/^(.*!)([^!]*)$/s);if(!g)v(`The ${$} tag has no suffix`);let _=this.tags[w];if(_)try{return _+decodeURIComponent(g)}catch(b){return v(String(b)),null}if(w==="!")return $;return v(`Could not resolve tag: ${$}`),null}tagString($){for(let[v,w]of Object.entries(this.tags))if($.startsWith(w))return v+yL($.substring(w.length));return $[0]==="!"?$:`!<${$}>`}toString($){let v=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],w=Object.entries(this.tags),g;if($&&w.length>0&&H5.isNode($.contents)){let _={};hL.visit($.contents,(b,J)=>{if(H5.isNode(J)&&J.tag)_[J.tag]=!0}),g=Object.keys(_)}else g=[];for(let[_,b]of w){if(_==="!!"&&b==="tag:yaml.org,2002:")continue;if(!$||g.some((J)=>J.startsWith(b)))v.push(`%TAG ${_} ${b}`)}return v.join(`
2
- `)}}p$.defaultYaml={explicit:!1,version:"1.2"};p$.defaultTags={"!!":"tag:yaml.org,2002:"};mL.Directives=p$});var H0=E((pL)=>{var n5=_$(),oL=Wg();function tL($){if(/[\x00-\x19\s,[\]{}]/.test($)){let w=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(w)}return!0}function q5($){let v=new Set;return oL.visit($,{Value(w,g){if(g.anchor)v.add(g.anchor)}}),v}function I5($,v){for(let w=1;;++w){let g=`${$}${w}`;if(!v.has(g))return g}}function dL($,v){let w=[],g=new Map,_=null;return{onAnchor:(b)=>{w.push(b),_??(_=q5($));let J=I5(v,_);return _.add(J),J},setAnchors:()=>{for(let b of w){let J=g.get(b);if(typeof J==="object"&&J.anchor&&(n5.isScalar(J.node)||n5.isCollection(J.node)))J.node.anchor=J.anchor;else{let D=Error("Failed to resolve repeated object (this should not happen)");throw D.source=b,D}}},sourceObjects:g}}pL.anchorIsValid=tL;pL.anchorNames=q5;pL.createNodeAnchors=dL;pL.findNewAnchor=I5});var CD=E((vV)=>{function Hg($,v,w,g){if(g&&typeof g==="object")if(Array.isArray(g))for(let _=0,b=g.length;_<b;++_){let J=g[_],D=Hg($,g,String(_),J);if(D===void 0)delete g[_];else if(D!==J)g[_]=D}else if(g instanceof Map)for(let _ of Array.from(g.keys())){let b=g.get(_),J=Hg($,g,_,b);if(J===void 0)g.delete(_);else if(J!==b)g.set(_,J)}else if(g instanceof Set)for(let _ of Array.from(g)){let b=Hg($,g,_,_);if(b===void 0)g.delete(_);else if(b!==_)g.delete(_),g.add(b)}else for(let[_,b]of Object.entries(g)){let J=Hg($,g,_,b);if(J===void 0)delete g[_];else if(J!==b)g[_]=J}return $.call(v,w,g)}vV.applyReviver=Hg});var L_=E((gV)=>{var wV=_$();function B5($,v,w){if(Array.isArray($))return $.map((g,_)=>B5(g,String(_),w));if($&&typeof $.toJSON==="function"){if(!w||!wV.hasAnchor($))return $.toJSON(v,w);let g={aliasCount:0,count:1,res:void 0};w.anchors.set($,g),w.onCreate=(b)=>{g.res=b,delete w.onCreate};let _=$.toJSON(v,w);if(w.onCreate)w.onCreate(_);return _}if(typeof $==="bigint"&&!w?.keep)return Number($);return $}gV.toJS=B5});var n0=E((DV)=>{var UV=CD(),L5=_$(),JV=L_();class V5{constructor($){Object.defineProperty(this,L5.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:v,maxAliasCount:w,onAnchor:g,reviver:_}={}){if(!L5.isDocument($))throw TypeError("A document argument is required");let b={anchors:new Map,doc:$,keep:!0,mapAsMap:v===!0,mapKeyWarned:!1,maxAliasCount:typeof w==="number"?w:100},J=JV.toJS(this,"",b);if(typeof g==="function")for(let{count:D,res:X}of b.anchors.values())g(X,D);return typeof _==="function"?UV.applyReviver(_,{"":J},"",J):J}}DV.NodeBase=V5});var ng=E((HV)=>{var GV=H0(),YV=Wg(),Y6=_$(),QV=n0(),WV=L_();class j5 extends QV.NodeBase{constructor($){super(Y6.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,v){let w;if(v?.aliasResolveCache)w=v.aliasResolveCache;else if(w=[],YV.visit($,{Node:(_,b)=>{if(Y6.isAlias(b)||Y6.hasAnchor(b))w.push(b)}}),v)v.aliasResolveCache=w;let g=void 0;for(let _ of w){if(_===this)break;if(_.anchor===this.source)g=_}return g}toJSON($,v){if(!v)return{source:this.source};let{anchors:w,doc:g,maxAliasCount:_}=v,b=this.resolve(g,v);if(!b){let D=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(D)}let J=w.get(b);if(!J)WV.toJS(b,null,v),J=w.get(b);if(J?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(_>=0){if(J.count+=1,J.aliasCount===0)J.aliasCount=q0(g,b,w);if(J.count*J.aliasCount>_)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return J.res}toString($,v,w){let g=`*${this.source}`;if($){if(GV.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let _=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(_)}if($.implicitKey)return`${g} `}return g}}function q0($,v,w){if(Y6.isAlias(v)){let g=v.resolve($),_=w&&g&&w.get(g);return _?_.count*_.aliasCount:0}else if(Y6.isCollection(v)){let g=0;for(let _ of v.items){let b=q0($,_,w);if(b>g)g=b}return g}else if(Y6.isPair(v)){let g=q0($,v.key,w),_=q0($,v.value,w);return Math.max(g,_)}return 1}HV.Alias=j5});var L$=E((VV)=>{var qV=_$(),IV=n0(),BV=L_(),LV=($)=>!$||typeof $!=="function"&&typeof $!=="object";class p_ extends IV.NodeBase{constructor($){super(qV.SCALAR);this.value=$}toJSON($,v){return v?.keep?this.value:BV.toJS(this.value,$,v)}toString(){return String(this.value)}}p_.BLOCK_FOLDED="BLOCK_FOLDED";p_.BLOCK_LITERAL="BLOCK_LITERAL";p_.PLAIN="PLAIN";p_.QUOTE_DOUBLE="QUOTE_DOUBLE";p_.QUOTE_SINGLE="QUOTE_SINGLE";VV.Scalar=p_;VV.isScalarValue=LV});var qg=E((NV)=>{var KV=ng(),e_=_$(),F5=L$(),OV="tag:yaml.org,2002:";function iV($,v,w){if(v){let g=w.filter((b)=>b.tag===v),_=g.find((b)=>!b.format)??g[0];if(!_)throw Error(`Tag ${v} not found`);return _}return w.find((g)=>g.identify?.($)&&!g.format)}function kV($,v,w){if(e_.isDocument($))$=$.contents;if(e_.isNode($))return $;if(e_.isPair($)){let Q=w.schema[e_.MAP].createNode?.(w.schema,null,w);return Q.items.push($),Q}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:g,onAnchor:_,onTagObj:b,schema:J,sourceObjects:D}=w,X=void 0;if(g&&$&&typeof $==="object")if(X=D.get($),X)return X.anchor??(X.anchor=_($)),new KV.Alias(X.anchor);else X={anchor:null,node:null},D.set($,X);if(v?.startsWith("!!"))v=OV+v.slice(2);let G=iV($,v,J.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let Q=new F5.Scalar($);if(X)X.node=Q;return Q}G=$ instanceof Map?J[e_.MAP]:(Symbol.iterator in Object($))?J[e_.SEQ]:J[e_.MAP]}if(b)b(G),delete w.onTagObj;let Y=G?.createNode?G.createNode(w.schema,$,w):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(w.schema,$,w):new F5.Scalar($);if(v)Y.tag=v;else if(!G.default)Y.tag=G.tag;if(X)X.node=Y;return Y}NV.createNode=kV});var I0=E((MV)=>{var fV=qg(),jv=_$(),AV=n0();function ED($,v,w){let g=w;for(let _=v.length-1;_>=0;--_){let b=v[_];if(typeof b==="number"&&Number.isInteger(b)&&b>=0){let J=[];J[b]=g,g=J}else g=new Map([[b,g]])}return fV.createNode(g,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var K5=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class O5 extends AV.NodeBase{constructor($,v){super($);Object.defineProperty(this,"schema",{value:v,configurable:!0,enumerable:!1,writable:!0})}clone($){let v=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)v.schema=$;if(v.items=v.items.map((w)=>jv.isNode(w)||jv.isPair(w)?w.clone($):w),this.range)v.range=this.range.slice();return v}addIn($,v){if(K5($))this.add(v);else{let[w,...g]=$,_=this.get(w,!0);if(jv.isCollection(_))_.addIn(g,v);else if(_===void 0&&this.schema)this.set(w,ED(this.schema,g,v));else throw Error(`Expected YAML collection at ${w}. Remaining path: ${g}`)}}deleteIn($){let[v,...w]=$;if(w.length===0)return this.delete(v);let g=this.get(v,!0);if(jv.isCollection(g))return g.deleteIn(w);else throw Error(`Expected YAML collection at ${v}. Remaining path: ${w}`)}getIn($,v){let[w,...g]=$,_=this.get(w,!0);if(g.length===0)return!v&&jv.isScalar(_)?_.value:_;else return jv.isCollection(_)?_.getIn(g,v):void 0}hasAllNullValues($){return this.items.every((v)=>{if(!jv.isPair(v))return!1;let w=v.value;return w==null||$&&jv.isScalar(w)&&w.value==null&&!w.commentBefore&&!w.comment&&!w.tag})}hasIn($){let[v,...w]=$;if(w.length===0)return this.has(v);let g=this.get(v,!0);return jv.isCollection(g)?g.hasIn(w):!1}setIn($,v){let[w,...g]=$;if(g.length===0)this.set(w,v);else{let _=this.get(w,!0);if(jv.isCollection(_))_.setIn(g,v);else if(_===void 0&&this.schema)this.set(w,ED(this.schema,g,v));else throw Error(`Expected YAML collection at ${w}. Remaining path: ${g}`)}}}MV.Collection=O5;MV.collectionFromPath=ED;MV.isEmptyPath=K5});var Ig=E((CV)=>{var TV=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function ZD($,v){if(/^\n+$/.test($))return $.substring(1);return v?$.replace(/^(?! *$)/gm,v):$}var RV=($,v,w)=>$.endsWith(`
3
- `)?ZD(w,v):w.includes(`
1
+ import{createRequire as Aq}from"node:module";var Fq=Object.create;var{getPrototypeOf:Kq,defineProperty:mU,getOwnPropertyNames:Oq}=Object;var Nq=Object.prototype.hasOwnProperty;function kq($){return this[$]}var zq,iq,gG=($,v,w)=>{var g=$!=null&&typeof $==="object";if(g){var _=v?zq??=new WeakMap:iq??=new WeakMap,b=_.get($);if(b)return b}w=$!=null?Fq(Kq($)):{};let J=v||!$||!$.__esModule?mU(w,"default",{value:$,enumerable:!0}):w;for(let D of Oq($))if(!Nq.call(J,D))mU(J,D,{get:kq.bind($,D),enumerable:!0});if(g)_.set($,J);return J};var E=($,v)=>()=>(v||$((v={exports:{}}).exports,v),v.exports);var nq=($)=>$;function Pq($,v){this[$]=nq.bind(null,v)}var $v=($,v)=>{for(var w in v)mU($,w,{get:v[w],enumerable:!0,configurable:!0,set:Pq.bind(v,w)})};var Ww=Aq(import.meta.url);var rU=E((ku,Mq)=>{Mq.exports={name:"@typescape-ai/mcp",version:"1.9.33",description:"Typescape MCP server for review, finding, and rules workflows in external agent harnesses",type:"module",bin:{"typescape-mcp":"./bin/typescape-mcp"},files:["bin","dist","README.md"],exports:{".":"./dist/mcp.js"},publishConfig:{access:"public"},scripts:{build:"bun build src/index.ts --outfile=dist/mcp.js --target=node --bundle --minify",dev:"bun run --watch src/index.ts",test:"bun test",typecheck:"tsc --noEmit",lint:"eslint src",prepublishOnly:"bun run build"},dependencies:{},devDependencies:{"@modelcontextprotocol/sdk":"1.0.4","@types/bun":"1.3.8","@typescape/schemas":"workspace:*",zod:"4.3.0"},engines:{node:">=18.17.0",bun:">=1.0.0"},keywords:["typescape","mcp","mcp-server","model-context-protocol","agent","automation","review","finding","rules","cursor","windsurf","bun"],repository:{type:"git",url:"https://github.com/voidserf/typescape-docs.git",directory:"apps/mcp"},license:"MIT"}});var _$=E((HV)=>{var uD=Symbol.for("yaml.alias"),Y5=Symbol.for("yaml.document"),Q0=Symbol.for("yaml.map"),Q5=Symbol.for("yaml.pair"),RD=Symbol.for("yaml.scalar"),W0=Symbol.for("yaml.seq"),Tv=Symbol.for("yaml.node.type"),JV=($)=>!!$&&typeof $==="object"&&$[Tv]===uD,DV=($)=>!!$&&typeof $==="object"&&$[Tv]===Y5,XV=($)=>!!$&&typeof $==="object"&&$[Tv]===Q0,GV=($)=>!!$&&typeof $==="object"&&$[Tv]===Q5,W5=($)=>!!$&&typeof $==="object"&&$[Tv]===RD,YV=($)=>!!$&&typeof $==="object"&&$[Tv]===W0;function H5($){if($&&typeof $==="object")switch($[Tv]){case Q0:case W0:return!0}return!1}function QV($){if($&&typeof $==="object")switch($[Tv]){case uD:case Q0:case RD:case W0:return!0}return!1}var WV=($)=>(W5($)||H5($))&&!!$.anchor;HV.ALIAS=uD;HV.DOC=Y5;HV.MAP=Q0;HV.NODE_TYPE=Tv;HV.PAIR=Q5;HV.SCALAR=RD;HV.SEQ=W0;HV.hasAnchor=WV;HV.isAlias=JV;HV.isCollection=H5;HV.isDocument=DV;HV.isMap=XV;HV.isNode=QV;HV.isPair=GV;HV.isScalar=W5;HV.isSeq=YV});var Hg=E((MV)=>{var K$=_$(),Z$=Symbol("break visit"),q5=Symbol("skip children"),jv=Symbol("remove node");function H0($,v){let w=I5(v);if(K$.isDocument($)){if(G6(null,$.contents,w,Object.freeze([$]))===jv)$.contents=null}else G6(null,$,w,Object.freeze([]))}H0.BREAK=Z$;H0.SKIP=q5;H0.REMOVE=jv;function G6($,v,w,g){let _=B5($,v,w,g);if(K$.isNode(_)||K$.isPair(_))return L5($,g,_),G6($,_,w,g);if(typeof _!=="symbol"){if(K$.isCollection(v)){g=Object.freeze(g.concat(v));for(let b=0;b<v.items.length;++b){let J=G6(b,v.items[b],w,g);if(typeof J==="number")b=J-1;else if(J===Z$)return Z$;else if(J===jv)v.items.splice(b,1),b-=1}}else if(K$.isPair(v)){g=Object.freeze(g.concat(v));let b=G6("key",v.key,w,g);if(b===Z$)return Z$;else if(b===jv)v.key=null;let J=G6("value",v.value,w,g);if(J===Z$)return Z$;else if(J===jv)v.value=null}}return _}async function q0($,v){let w=I5(v);if(K$.isDocument($)){if(await Y6(null,$.contents,w,Object.freeze([$]))===jv)$.contents=null}else await Y6(null,$,w,Object.freeze([]))}q0.BREAK=Z$;q0.SKIP=q5;q0.REMOVE=jv;async function Y6($,v,w,g){let _=await B5($,v,w,g);if(K$.isNode(_)||K$.isPair(_))return L5($,g,_),Y6($,_,w,g);if(typeof _!=="symbol"){if(K$.isCollection(v)){g=Object.freeze(g.concat(v));for(let b=0;b<v.items.length;++b){let J=await Y6(b,v.items[b],w,g);if(typeof J==="number")b=J-1;else if(J===Z$)return Z$;else if(J===jv)v.items.splice(b,1),b-=1}}else if(K$.isPair(v)){g=Object.freeze(g.concat(v));let b=await Y6("key",v.key,w,g);if(b===Z$)return Z$;else if(b===jv)v.key=null;let J=await Y6("value",v.value,w,g);if(J===Z$)return Z$;else if(J===jv)v.value=null}}return _}function I5($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function B5($,v,w,g){if(typeof w==="function")return w($,v,g);if(K$.isMap(v))return w.Map?.($,v,g);if(K$.isSeq(v))return w.Seq?.($,v,g);if(K$.isPair(v))return w.Pair?.($,v,g);if(K$.isScalar(v))return w.Scalar?.($,v,g);if(K$.isAlias(v))return w.Alias?.($,v,g);return}function L5($,v,w){let g=v[v.length-1];if(K$.isCollection(g))g.items[$]=w;else if(K$.isPair(g))if($==="key")g.key=w;else g.value=w;else if(K$.isDocument(g))g.contents=w;else{let _=K$.isAlias(g)?"alias":"scalar";throw Error(`Cannot replace node with ${_} parent`)}}MV.visit=H0;MV.visitAsync=q0});var CD=E((CV)=>{var V5=_$(),TV=Hg(),uV={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},RV=($)=>$.replace(/[!,[\]{}]/g,(v)=>uV[v]);class p${constructor($,v){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},p$.defaultYaml,$),this.tags=Object.assign({},p$.defaultTags,v)}clone(){let $=new p$(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new p$(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:p$.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},p$.defaultTags);break}return $}add($,v){if(this.atNextDocument)this.yaml={explicit:p$.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},p$.defaultTags),this.atNextDocument=!1;let w=$.trim().split(/[ \t]+/),g=w.shift();switch(g){case"%TAG":{if(w.length!==2){if(v(0,"%TAG directive should contain exactly two parts"),w.length<2)return!1}let[_,b]=w;return this.tags[_]=b,!0}case"%YAML":{if(this.yaml.explicit=!0,w.length!==1)return v(0,"%YAML directive should contain exactly one part"),!1;let[_]=w;if(_==="1.1"||_==="1.2")return this.yaml.version=_,!0;else{let b=/^\d+\.\d+$/.test(_);return v(6,`Unsupported YAML version ${_}`,b),!1}}default:return v(0,`Unknown directive ${g}`,!0),!1}}tagName($,v){if($==="!")return"!";if($[0]!=="!")return v(`Not a valid tag: ${$}`),null;if($[1]==="<"){let b=$.slice(2,-1);if(b==="!"||b==="!!")return v(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")v("Verbatim tags must end with a >");return b}let[,w,g]=$.match(/^(.*!)([^!]*)$/s);if(!g)v(`The ${$} tag has no suffix`);let _=this.tags[w];if(_)try{return _+decodeURIComponent(g)}catch(b){return v(String(b)),null}if(w==="!")return $;return v(`Could not resolve tag: ${$}`),null}tagString($){for(let[v,w]of Object.entries(this.tags))if($.startsWith(w))return v+RV($.substring(w.length));return $[0]==="!"?$:`!<${$}>`}toString($){let v=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],w=Object.entries(this.tags),g;if($&&w.length>0&&V5.isNode($.contents)){let _={};TV.visit($.contents,(b,J)=>{if(V5.isNode(J)&&J.tag)_[J.tag]=!0}),g=Object.keys(_)}else g=[];for(let[_,b]of w){if(_==="!!"&&b==="tag:yaml.org,2002:")continue;if(!$||g.some((J)=>J.startsWith(b)))v.push(`%TAG ${_} ${b}`)}return v.join(`
2
+ `)}}p$.defaultYaml={explicit:!1,version:"1.2"};p$.defaultTags={"!!":"tag:yaml.org,2002:"};CV.Directives=p$});var I0=E((lV)=>{var j5=_$(),ZV=Hg();function hV($){if(/[\x00-\x19\s,[\]{}]/.test($)){let w=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(w)}return!0}function F5($){let v=new Set;return ZV.visit($,{Value(w,g){if(g.anchor)v.add(g.anchor)}}),v}function K5($,v){for(let w=1;;++w){let g=`${$}${w}`;if(!v.has(g))return g}}function xV($,v){let w=[],g=new Map,_=null;return{onAnchor:(b)=>{w.push(b),_??(_=F5($));let J=K5(v,_);return _.add(J),J},setAnchors:()=>{for(let b of w){let J=g.get(b);if(typeof J==="object"&&J.anchor&&(j5.isScalar(J.node)||j5.isCollection(J.node)))J.node.anchor=J.anchor;else{let D=Error("Failed to resolve repeated object (this should not happen)");throw D.source=b,D}}},sourceObjects:g}}lV.anchorIsValid=hV;lV.anchorNames=F5;lV.createNodeAnchors=xV;lV.findNewAnchor=K5});var ED=E((oV)=>{function qg($,v,w,g){if(g&&typeof g==="object")if(Array.isArray(g))for(let _=0,b=g.length;_<b;++_){let J=g[_],D=qg($,g,String(_),J);if(D===void 0)delete g[_];else if(D!==J)g[_]=D}else if(g instanceof Map)for(let _ of Array.from(g.keys())){let b=g.get(_),J=qg($,g,_,b);if(J===void 0)g.delete(_);else if(J!==b)g.set(_,J)}else if(g instanceof Set)for(let _ of Array.from(g)){let b=qg($,g,_,_);if(b===void 0)g.delete(_);else if(b!==_)g.delete(_),g.add(b)}else for(let[_,b]of Object.entries(g)){let J=qg($,g,_,b);if(J===void 0)delete g[_];else if(J!==b)g[_]=J}return $.call(v,w,g)}oV.applyReviver=qg});var V_=E((pV)=>{var tV=_$();function O5($,v,w){if(Array.isArray($))return $.map((g,_)=>O5(g,String(_),w));if($&&typeof $.toJSON==="function"){if(!w||!tV.hasAnchor($))return $.toJSON(v,w);let g={aliasCount:0,count:1,res:void 0};w.anchors.set($,g),w.onCreate=(b)=>{g.res=b,delete w.onCreate};let _=$.toJSON(v,w);if(w.onCreate)w.onCreate(_);return _}if(typeof $==="bigint"&&!w?.keep)return Number($);return $}pV.toJS=O5});var B0=E(($j)=>{var aV=ED(),N5=_$(),sV=V_();class k5{constructor($){Object.defineProperty(this,N5.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:v,maxAliasCount:w,onAnchor:g,reviver:_}={}){if(!N5.isDocument($))throw TypeError("A document argument is required");let b={anchors:new Map,doc:$,keep:!0,mapAsMap:v===!0,mapKeyWarned:!1,maxAliasCount:typeof w==="number"?w:100},J=sV.toJS(this,"",b);if(typeof g==="function")for(let{count:D,res:X}of b.anchors.values())g(X,D);return typeof _==="function"?aV.applyReviver(_,{"":J},"",J):J}}$j.NodeBase=k5});var Ig=E((Uj)=>{var _j=I0(),wj=Hg(),Q6=_$(),gj=B0(),bj=V_();class z5 extends gj.NodeBase{constructor($){super(Q6.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,v){let w;if(v?.aliasResolveCache)w=v.aliasResolveCache;else if(w=[],wj.visit($,{Node:(_,b)=>{if(Q6.isAlias(b)||Q6.hasAnchor(b))w.push(b)}}),v)v.aliasResolveCache=w;let g=void 0;for(let _ of w){if(_===this)break;if(_.anchor===this.source)g=_}return g}toJSON($,v){if(!v)return{source:this.source};let{anchors:w,doc:g,maxAliasCount:_}=v,b=this.resolve(g,v);if(!b){let D=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(D)}let J=w.get(b);if(!J)bj.toJS(b,null,v),J=w.get(b);if(J?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(_>=0){if(J.count+=1,J.aliasCount===0)J.aliasCount=L0(g,b,w);if(J.count*J.aliasCount>_)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return J.res}toString($,v,w){let g=`*${this.source}`;if($){if(_j.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let _=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(_)}if($.implicitKey)return`${g} `}return g}}function L0($,v,w){if(Q6.isAlias(v)){let g=v.resolve($),_=w&&g&&w.get(g);return _?_.count*_.aliasCount:0}else if(Q6.isCollection(v)){let g=0;for(let _ of v.items){let b=L0($,_,w);if(b>g)g=b}return g}else if(Q6.isPair(v)){let g=L0($,v.key,w),_=L0($,v.value,w);return Math.max(g,_)}return 1}Uj.Alias=z5});var V$=E((Qj)=>{var Dj=_$(),Xj=B0(),Gj=V_(),Yj=($)=>!$||typeof $!=="function"&&typeof $!=="object";class p_ extends Xj.NodeBase{constructor($){super(Dj.SCALAR);this.value=$}toJSON($,v){return v?.keep?this.value:Gj.toJS(this.value,$,v)}toString(){return String(this.value)}}p_.BLOCK_FOLDED="BLOCK_FOLDED";p_.BLOCK_LITERAL="BLOCK_LITERAL";p_.PLAIN="PLAIN";p_.QUOTE_DOUBLE="QUOTE_DOUBLE";p_.QUOTE_SINGLE="QUOTE_SINGLE";Qj.Scalar=p_;Qj.isScalarValue=Yj});var Bg=E((Vj)=>{var qj=Ig(),e_=_$(),i5=V$(),Ij="tag:yaml.org,2002:";function Bj($,v,w){if(v){let g=w.filter((b)=>b.tag===v),_=g.find((b)=>!b.format)??g[0];if(!_)throw Error(`Tag ${v} not found`);return _}return w.find((g)=>g.identify?.($)&&!g.format)}function Lj($,v,w){if(e_.isDocument($))$=$.contents;if(e_.isNode($))return $;if(e_.isPair($)){let Q=w.schema[e_.MAP].createNode?.(w.schema,null,w);return Q.items.push($),Q}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:g,onAnchor:_,onTagObj:b,schema:J,sourceObjects:D}=w,X=void 0;if(g&&$&&typeof $==="object")if(X=D.get($),X)return X.anchor??(X.anchor=_($)),new qj.Alias(X.anchor);else X={anchor:null,node:null},D.set($,X);if(v?.startsWith("!!"))v=Ij+v.slice(2);let G=Bj($,v,J.tags);if(!G){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let Q=new i5.Scalar($);if(X)X.node=Q;return Q}G=$ instanceof Map?J[e_.MAP]:(Symbol.iterator in Object($))?J[e_.SEQ]:J[e_.MAP]}if(b)b(G),delete w.onTagObj;let Y=G?.createNode?G.createNode(w.schema,$,w):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(w.schema,$,w):new i5.Scalar($);if(v)Y.tag=v;else if(!G.default)Y.tag=G.tag;if(X)X.node=Y;return Y}Vj.createNode=Lj});var V0=E((Oj)=>{var Fj=Bg(),Fv=_$(),Kj=B0();function ZD($,v,w){let g=w;for(let _=v.length-1;_>=0;--_){let b=v[_];if(typeof b==="number"&&Number.isInteger(b)&&b>=0){let J=[];J[b]=g,g=J}else g=new Map([[b,g]])}return Fj.createNode(g,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var n5=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class P5 extends Kj.NodeBase{constructor($,v){super($);Object.defineProperty(this,"schema",{value:v,configurable:!0,enumerable:!1,writable:!0})}clone($){let v=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)v.schema=$;if(v.items=v.items.map((w)=>Fv.isNode(w)||Fv.isPair(w)?w.clone($):w),this.range)v.range=this.range.slice();return v}addIn($,v){if(n5($))this.add(v);else{let[w,...g]=$,_=this.get(w,!0);if(Fv.isCollection(_))_.addIn(g,v);else if(_===void 0&&this.schema)this.set(w,ZD(this.schema,g,v));else throw Error(`Expected YAML collection at ${w}. Remaining path: ${g}`)}}deleteIn($){let[v,...w]=$;if(w.length===0)return this.delete(v);let g=this.get(v,!0);if(Fv.isCollection(g))return g.deleteIn(w);else throw Error(`Expected YAML collection at ${v}. Remaining path: ${w}`)}getIn($,v){let[w,...g]=$,_=this.get(w,!0);if(g.length===0)return!v&&Fv.isScalar(_)?_.value:_;else return Fv.isCollection(_)?_.getIn(g,v):void 0}hasAllNullValues($){return this.items.every((v)=>{if(!Fv.isPair(v))return!1;let w=v.value;return w==null||$&&Fv.isScalar(w)&&w.value==null&&!w.commentBefore&&!w.comment&&!w.tag})}hasIn($){let[v,...w]=$;if(w.length===0)return this.has(v);let g=this.get(v,!0);return Fv.isCollection(g)?g.hasIn(w):!1}setIn($,v){let[w,...g]=$;if(g.length===0)this.set(w,v);else{let _=this.get(w,!0);if(Fv.isCollection(_))_.setIn(g,v);else if(_===void 0&&this.schema)this.set(w,ZD(this.schema,g,v));else throw Error(`Expected YAML collection at ${w}. Remaining path: ${g}`)}}}Oj.Collection=P5;Oj.collectionFromPath=ZD;Oj.isEmptyPath=n5});var Lg=E((Pj)=>{var ij=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function hD($,v){if(/^\n+$/.test($))return $.substring(1);return v?$.replace(/^(?! *$)/gm,v):$}var nj=($,v,w)=>$.endsWith(`
3
+ `)?hD(w,v):w.includes(`
4
4
  `)?`
5
- `+ZD(w,v):($.endsWith(" ")?"":" ")+w;CV.indentComment=ZD;CV.lineComment=RV;CV.stringifyComment=TV});var k5=E((hV)=>{function lV($,v,w="flow",{indentAtStart:g,lineWidth:_=80,minContentWidth:b=20,onFold:J,onOverflow:D}={}){if(!_||_<0)return $;if(_<b)b=0;let X=Math.max(1+b,1+_-v.length);if($.length<=X)return $;let G=[],Y={},Q=_-v.length;if(typeof g==="number")if(g>_-Math.max(2,b))G.push(0);else Q=_-g;let H=void 0,I=void 0,q=!1,W=-1,B=-1,j=-1;if(w==="block"){if(W=i5($,W,v.length),W!==-1)Q=W+X}for(let z;z=$[W+=1];){if(w==="quoted"&&z==="\\"){switch(B=W,$[W+1]){case"x":W+=3;break;case"u":W+=5;break;case"U":W+=9;break;default:W+=1}j=W}if(z===`
6
- `){if(w==="block")W=i5($,W,v.length);Q=W+v.length+X,H=void 0}else{if(z===" "&&I&&I!==" "&&I!==`
7
- `&&I!=="\t"){let C=$[W+1];if(C&&C!==" "&&C!==`
8
- `&&C!=="\t")H=W}if(W>=Q)if(H)G.push(H),Q=H+X,H=void 0;else if(w==="quoted"){while(I===" "||I==="\t")I=z,z=$[W+=1],q=!0;let C=W>j+1?W-2:B-1;if(Y[C])return $;G.push(C),Y[C]=!0,Q=C+X,H=void 0}else q=!0}I=z}if(q&&D)D();if(G.length===0)return $;if(J)J();let A=$.slice(0,G[0]);for(let z=0;z<G.length;++z){let C=G[z],Z=G[z+1]||$.length;if(C===0)A=`
9
- ${v}${$.slice(0,Z)}`;else{if(w==="quoted"&&Y[C])A+=`${$[C]}\\`;A+=`
10
- ${v}${$.slice(C+1,Z)}`}}return A}function i5($,v,w){let g=v,_=v+1,b=$[_];while(b===" "||b==="\t")if(v<_+w)b=$[++v];else{do b=$[++v];while(b&&b!==`
11
- `);g=v,_=v+1,b=$[_]}return g}hV.FOLD_BLOCK="block";hV.FOLD_FLOW="flow";hV.FOLD_QUOTED="quoted";hV.foldFlowLines=lV});var Lg=E((pV)=>{var bv=L$(),V_=k5(),L0=($,v)=>({indentAtStart:v?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),V0=($)=>/^(%|---|\.\.\.)/m.test($);function oV($,v,w){if(!v||v<0)return!1;let g=v-w,_=$.length;if(_<=g)return!1;for(let b=0,J=0;b<_;++b)if($[b]===`
12
- `){if(b-J>g)return!0;if(J=b+1,_-J<=g)return!1}return!0}function Bg($,v){let w=JSON.stringify($);if(v.options.doubleQuotedAsJSON)return w;let{implicitKey:g}=v,_=v.options.doubleQuotedMinMultiLineLength,b=v.indent||(V0($)?" ":""),J="",D=0;for(let X=0,G=w[X];G;G=w[++X]){if(G===" "&&w[X+1]==="\\"&&w[X+2]==="n")J+=w.slice(D,X)+"\\ ",X+=1,D=X,G="\\";if(G==="\\")switch(w[X+1]){case"u":{J+=w.slice(D,X);let Y=w.substr(X+2,4);switch(Y){case"0000":J+="\\0";break;case"0007":J+="\\a";break;case"000b":J+="\\v";break;case"001b":J+="\\e";break;case"0085":J+="\\N";break;case"00a0":J+="\\_";break;case"2028":J+="\\L";break;case"2029":J+="\\P";break;default:if(Y.substr(0,2)==="00")J+="\\x"+Y.substr(2);else J+=w.substr(X,6)}X+=5,D=X+1}break;case"n":if(g||w[X+2]==='"'||w.length<_)X+=1;else{J+=w.slice(D,X)+`
5
+ `+hD(w,v):($.endsWith(" ")?"":" ")+w;Pj.indentComment=hD;Pj.lineComment=nj;Pj.stringifyComment=ij});var M5=E((Tj)=>{function Sj($,v,w="flow",{indentAtStart:g,lineWidth:_=80,minContentWidth:b=20,onFold:J,onOverflow:D}={}){if(!_||_<0)return $;if(_<b)b=0;let X=Math.max(1+b,1+_-v.length);if($.length<=X)return $;let G=[],Y={},Q=_-v.length;if(typeof g==="number")if(g>_-Math.max(2,b))G.push(0);else Q=_-g;let W=void 0,I=void 0,H=!1,q=-1,j=-1,F=-1;if(w==="block"){if(q=A5($,q,v.length),q!==-1)Q=q+X}for(let T;T=$[q+=1];){if(w==="quoted"&&T==="\\"){switch(j=q,$[q+1]){case"x":q+=3;break;case"u":q+=5;break;case"U":q+=9;break;default:q+=1}F=q}if(T===`
6
+ `){if(w==="block")q=A5($,q,v.length);Q=q+v.length+X,W=void 0}else{if(T===" "&&I&&I!==" "&&I!==`
7
+ `&&I!=="\t"){let C=$[q+1];if(C&&C!==" "&&C!==`
8
+ `&&C!=="\t")W=q}if(q>=Q)if(W)G.push(W),Q=W+X,W=void 0;else if(w==="quoted"){while(I===" "||I==="\t")I=T,T=$[q+=1],H=!0;let C=q>F+1?q-2:j-1;if(Y[C])return $;G.push(C),Y[C]=!0,Q=C+X,W=void 0}else H=!0}I=T}if(H&&D)D();if(G.length===0)return $;if(J)J();let M=$.slice(0,G[0]);for(let T=0;T<G.length;++T){let C=G[T],Z=G[T+1]||$.length;if(C===0)M=`
9
+ ${v}${$.slice(0,Z)}`;else{if(w==="quoted"&&Y[C])M+=`${$[C]}\\`;M+=`
10
+ ${v}${$.slice(C+1,Z)}`}}return M}function A5($,v,w){let g=v,_=v+1,b=$[_];while(b===" "||b==="\t")if(v<_+w)b=$[++v];else{do b=$[++v];while(b&&b!==`
11
+ `);g=v,_=v+1,b=$[_]}return g}Tj.FOLD_BLOCK="block";Tj.FOLD_FLOW="flow";Tj.FOLD_QUOTED="quoted";Tj.foldFlowLines=Sj});var jg=E((lj)=>{var bv=V$(),j_=M5(),F0=($,v)=>({indentAtStart:v?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),K0=($)=>/^(%|---|\.\.\.)/m.test($);function Zj($,v,w){if(!v||v<0)return!1;let g=v-w,_=$.length;if(_<=g)return!1;for(let b=0,J=0;b<_;++b)if($[b]===`
12
+ `){if(b-J>g)return!0;if(J=b+1,_-J<=g)return!1}return!0}function Vg($,v){let w=JSON.stringify($);if(v.options.doubleQuotedAsJSON)return w;let{implicitKey:g}=v,_=v.options.doubleQuotedMinMultiLineLength,b=v.indent||(K0($)?" ":""),J="",D=0;for(let X=0,G=w[X];G;G=w[++X]){if(G===" "&&w[X+1]==="\\"&&w[X+2]==="n")J+=w.slice(D,X)+"\\ ",X+=1,D=X,G="\\";if(G==="\\")switch(w[X+1]){case"u":{J+=w.slice(D,X);let Y=w.substr(X+2,4);switch(Y){case"0000":J+="\\0";break;case"0007":J+="\\a";break;case"000b":J+="\\v";break;case"001b":J+="\\e";break;case"0085":J+="\\N";break;case"00a0":J+="\\_";break;case"2028":J+="\\L";break;case"2029":J+="\\P";break;default:if(Y.substr(0,2)==="00")J+="\\x"+Y.substr(2);else J+=w.substr(X,6)}X+=5,D=X+1}break;case"n":if(g||w[X+2]==='"'||w.length<_)X+=1;else{J+=w.slice(D,X)+`
13
13
 
14
14
  `;while(w[X+2]==="\\"&&w[X+3]==="n"&&w[X+4]!=='"')J+=`
15
- `,X+=2;if(J+=b,w[X+2]===" ")J+="\\";X+=1,D=X+1}break;default:X+=1}}return J=D?J+w.slice(D):w,g?J:V_.foldFlowLines(J,b,V_.FOLD_QUOTED,L0(v,!1))}function xD($,v){if(v.options.singleQuote===!1||v.implicitKey&&$.includes(`
16
- `)||/[ \t]\n|\n[ \t]/.test($))return Bg($,v);let w=v.indent||(V0($)?" ":""),g="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
17
- ${w}`)+"'";return v.implicitKey?g:V_.foldFlowLines(g,w,V_.FOLD_FLOW,L0(v,!1))}function Q6($,v){let{singleQuote:w}=v.options,g;if(w===!1)g=Bg;else{let _=$.includes('"'),b=$.includes("'");if(_&&!b)g=xD;else if(b&&!_)g=Bg;else g=w?xD:Bg}return g($,v)}var lD;try{lD=new RegExp(`(^|(?<!
15
+ `,X+=2;if(J+=b,w[X+2]===" ")J+="\\";X+=1,D=X+1}break;default:X+=1}}return J=D?J+w.slice(D):w,g?J:j_.foldFlowLines(J,b,j_.FOLD_QUOTED,F0(v,!1))}function xD($,v){if(v.options.singleQuote===!1||v.implicitKey&&$.includes(`
16
+ `)||/[ \t]\n|\n[ \t]/.test($))return Vg($,v);let w=v.indent||(K0($)?" ":""),g="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
17
+ ${w}`)+"'";return v.implicitKey?g:j_.foldFlowLines(g,w,j_.FOLD_FLOW,F0(v,!1))}function W6($,v){let{singleQuote:w}=v.options,g;if(w===!1)g=Vg;else{let _=$.includes('"'),b=$.includes("'");if(_&&!b)g=xD;else if(b&&!_)g=Vg;else g=w?xD:Vg}return g($,v)}var lD;try{lD=new RegExp(`(^|(?<!
18
18
  ))
19
19
  +(?!
20
- |$)`,"g")}catch{lD=/\n+(?!\n|$)/g}function B0({comment:$,type:v,value:w},g,_,b){let{blockQuote:J,commentString:D,lineWidth:X}=g.options;if(!J||/\n[\t ]+$/.test(w))return Q6(w,g);let G=g.indent||(g.forceBlockIndent||V0(w)?" ":""),Y=J==="literal"?!0:J==="folded"||v===bv.Scalar.BLOCK_FOLDED?!1:v===bv.Scalar.BLOCK_LITERAL?!0:!oV(w,X,G.length);if(!w)return Y?`|
20
+ |$)`,"g")}catch{lD=/\n+(?!\n|$)/g}function j0({comment:$,type:v,value:w},g,_,b){let{blockQuote:J,commentString:D,lineWidth:X}=g.options;if(!J||/\n[\t ]+$/.test(w))return W6(w,g);let G=g.indent||(g.forceBlockIndent||K0(w)?" ":""),Y=J==="literal"?!0:J==="folded"||v===bv.Scalar.BLOCK_FOLDED?!1:v===bv.Scalar.BLOCK_LITERAL?!0:!Zj(w,X,G.length);if(!w)return Y?`|
21
21
  `:`>
22
- `;let Q,H;for(H=w.length;H>0;--H){let Z=w[H-1];if(Z!==`
23
- `&&Z!=="\t"&&Z!==" ")break}let I=w.substring(H),q=I.indexOf(`
24
- `);if(q===-1)Q="-";else if(w===I||q!==I.length-1){if(Q="+",b)b()}else Q="";if(I){if(w=w.slice(0,-I.length),I[I.length-1]===`
25
- `)I=I.slice(0,-1);I=I.replace(lD,`$&${G}`)}let W=!1,B,j=-1;for(B=0;B<w.length;++B){let Z=w[B];if(Z===" ")W=!0;else if(Z===`
26
- `)j=B;else break}let A=w.substring(0,j<B?j+1:B);if(A)w=w.substring(A.length),A=A.replace(/\n+/g,`$&${G}`);let C=(W?G?"2":"1":"")+Q;if($){if(C+=" "+D($.replace(/ ?[\r\n]+/g," ")),_)_()}if(!Y){let Z=w.replace(/\n+/g,`
27
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),S=!1,y=L0(g,!0);if(J!=="folded"&&v!==bv.Scalar.BLOCK_FOLDED)y.onOverflow=()=>{S=!0};let x=V_.foldFlowLines(`${A}${Z}${I}`,G,V_.FOLD_BLOCK,y);if(!S)return`>${C}
22
+ `;let Q,W;for(W=w.length;W>0;--W){let Z=w[W-1];if(Z!==`
23
+ `&&Z!=="\t"&&Z!==" ")break}let I=w.substring(W),H=I.indexOf(`
24
+ `);if(H===-1)Q="-";else if(w===I||H!==I.length-1){if(Q="+",b)b()}else Q="";if(I){if(w=w.slice(0,-I.length),I[I.length-1]===`
25
+ `)I=I.slice(0,-1);I=I.replace(lD,`$&${G}`)}let q=!1,j,F=-1;for(j=0;j<w.length;++j){let Z=w[j];if(Z===" ")q=!0;else if(Z===`
26
+ `)F=j;else break}let M=w.substring(0,F<j?F+1:j);if(M)w=w.substring(M.length),M=M.replace(/\n+/g,`$&${G}`);let C=(q?G?"2":"1":"")+Q;if($){if(C+=" "+D($.replace(/ ?[\r\n]+/g," ")),_)_()}if(!Y){let Z=w.replace(/\n+/g,`
27
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),S=!1,c=F0(g,!0);if(J!=="folded"&&v!==bv.Scalar.BLOCK_FOLDED)c.onOverflow=()=>{S=!0};let x=j_.foldFlowLines(`${M}${Z}${I}`,G,j_.FOLD_BLOCK,c);if(!S)return`>${C}
28
28
  ${G}${x}`}return w=w.replace(/\n+/g,`$&${G}`),`|${C}
29
- ${G}${A}${w}${I}`}function tV($,v,w,g){let{type:_,value:b}=$,{actualString:J,implicitKey:D,indent:X,indentStep:G,inFlow:Y}=v;if(D&&b.includes(`
30
- `)||Y&&/[[\]{},]/.test(b))return Q6(b,v);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(b))return D||Y||!b.includes(`
31
- `)?Q6(b,v):B0($,v,w,g);if(!D&&!Y&&_!==bv.Scalar.PLAIN&&b.includes(`
32
- `))return B0($,v,w,g);if(V0(b)){if(X==="")return v.forceBlockIndent=!0,B0($,v,w,g);else if(D&&X===G)return Q6(b,v)}let Q=b.replace(/\n+/g,`$&
33
- ${X}`);if(J){let H=(W)=>W.default&&W.tag!=="tag:yaml.org,2002:str"&&W.test?.test(Q),{compat:I,tags:q}=v.doc.schema;if(q.some(H)||I?.some(H))return Q6(b,v)}return D?Q:V_.foldFlowLines(Q,X,V_.FOLD_FLOW,L0(v,!1))}function dV($,v,w,g){let{implicitKey:_,inFlow:b}=v,J=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:D}=$;if(D!==bv.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(J.value))D=bv.Scalar.QUOTE_DOUBLE}let X=(Y)=>{switch(Y){case bv.Scalar.BLOCK_FOLDED:case bv.Scalar.BLOCK_LITERAL:return _||b?Q6(J.value,v):B0(J,v,w,g);case bv.Scalar.QUOTE_DOUBLE:return Bg(J.value,v);case bv.Scalar.QUOTE_SINGLE:return xD(J.value,v);case bv.Scalar.PLAIN:return tV(J,v,w,g);default:return null}},G=X(D);if(G===null){let{defaultKeyType:Y,defaultStringType:Q}=v.options,H=_&&Y||Q;if(G=X(H),G===null)throw Error(`Unsupported default string type ${H}`)}return G}pV.stringifyString=dV});var Vg=E((bj)=>{var aV=H0(),j_=_$(),sV=Ig(),$j=Lg();function vj($,v){let w=Object.assign({blockQuote:!0,commentString:sV.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,v),g;switch(w.collectionStyle){case"block":g=!1;break;case"flow":g=!0;break;default:g=null}return{anchors:new Set,doc:$,flowCollectionPadding:w.flowCollectionPadding?" ":"",indent:"",indentStep:typeof w.indent==="number"?" ".repeat(w.indent):" ",inFlow:g,options:w}}function _j($,v){if(v.tag){let _=$.filter((b)=>b.tag===v.tag);if(_.length>0)return _.find((b)=>b.format===v.format)??_[0]}let w=void 0,g;if(j_.isScalar(v)){g=v.value;let _=$.filter((b)=>b.identify?.(g));if(_.length>1){let b=_.filter((J)=>J.test);if(b.length>0)_=b}w=_.find((b)=>b.format===v.format)??_.find((b)=>!b.format)}else g=v,w=$.find((_)=>_.nodeClass&&g instanceof _.nodeClass);if(!w){let _=g?.constructor?.name??(g===null?"null":typeof g);throw Error(`Tag not resolved for ${_} value`)}return w}function wj($,v,{anchors:w,doc:g}){if(!g.directives)return"";let _=[],b=(j_.isScalar($)||j_.isCollection($))&&$.anchor;if(b&&aV.anchorIsValid(b))w.add(b),_.push(`&${b}`);let J=$.tag??(v.default?null:v.tag);if(J)_.push(g.directives.tagString(J));return _.join(" ")}function gj($,v,w,g){if(j_.isPair($))return $.toString(v,w,g);if(j_.isAlias($)){if(v.doc.directives)return $.toString(v);if(v.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(v.resolvedAliases)v.resolvedAliases.add($);else v.resolvedAliases=new Set([$]);$=$.resolve(v.doc)}}let _=void 0,b=j_.isNode($)?$:v.doc.createNode($,{onTagObj:(X)=>_=X});_??(_=_j(v.doc.schema.tags,b));let J=wj(b,_,v);if(J.length>0)v.indentAtStart=(v.indentAtStart??0)+J.length+1;let D=typeof _.stringify==="function"?_.stringify(b,v,w,g):j_.isScalar(b)?$j.stringifyString(b,v,w,g):b.toString(v,w,g);if(!J)return D;return j_.isScalar(b)||D[0]==="{"||D[0]==="["?`${J} ${D}`:`${J}
34
- ${v.indent}${D}`}bj.createStringifyContext=vj;bj.stringify=gj});var f5=E((Xj)=>{var Tv=_$(),N5=L$(),P5=Vg(),jg=Ig();function Dj({key:$,value:v},w,g,_){let{allNullValues:b,doc:J,indent:D,indentStep:X,options:{commentString:G,indentSeq:Y,simpleKeys:Q}}=w,H=Tv.isNode($)&&$.comment||null;if(Q){if(H)throw Error("With simple keys, key nodes cannot have comments");if(Tv.isCollection($)||!Tv.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let I=!Q&&(!$||H&&v==null&&!w.inFlow||Tv.isCollection($)||(Tv.isScalar($)?$.type===N5.Scalar.BLOCK_FOLDED||$.type===N5.Scalar.BLOCK_LITERAL:typeof $==="object"));w=Object.assign({},w,{allNullValues:!1,implicitKey:!I&&(Q||!b),indent:D+X});let q=!1,W=!1,B=P5.stringify($,w,()=>q=!0,()=>W=!0);if(!I&&!w.inFlow&&B.length>1024){if(Q)throw Error("With simple keys, single line scalar must not span more than 1024 characters");I=!0}if(w.inFlow){if(b||v==null){if(q&&g)g();return B===""?"?":I?`? ${B}`:B}}else if(b&&!Q||v==null&&I){if(B=`? ${B}`,H&&!q)B+=jg.lineComment(B,w.indent,G(H));else if(W&&_)_();return B}if(q)H=null;if(I){if(H)B+=jg.lineComment(B,w.indent,G(H));B=`? ${B}
35
- ${D}:`}else if(B=`${B}:`,H)B+=jg.lineComment(B,w.indent,G(H));let j,A,z;if(Tv.isNode(v))j=!!v.spaceBefore,A=v.commentBefore,z=v.comment;else if(j=!1,A=null,z=null,v&&typeof v==="object")v=J.createNode(v);if(w.implicitKey=!1,!I&&!H&&Tv.isScalar(v))w.indentAtStart=B.length+1;if(W=!1,!Y&&X.length>=2&&!w.inFlow&&!I&&Tv.isSeq(v)&&!v.flow&&!v.tag&&!v.anchor)w.indent=w.indent.substring(2);let C=!1,Z=P5.stringify(v,w,()=>C=!0,()=>W=!0),S=" ";if(H||j||A){if(S=j?`
36
- `:"",A){let y=G(A);S+=`
37
- ${jg.indentComment(y,w.indent)}`}if(Z===""&&!w.inFlow){if(S===`
38
- `&&z)S=`
29
+ ${G}${M}${w}${I}`}function hj($,v,w,g){let{type:_,value:b}=$,{actualString:J,implicitKey:D,indent:X,indentStep:G,inFlow:Y}=v;if(D&&b.includes(`
30
+ `)||Y&&/[[\]{},]/.test(b))return W6(b,v);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(b))return D||Y||!b.includes(`
31
+ `)?W6(b,v):j0($,v,w,g);if(!D&&!Y&&_!==bv.Scalar.PLAIN&&b.includes(`
32
+ `))return j0($,v,w,g);if(K0(b)){if(X==="")return v.forceBlockIndent=!0,j0($,v,w,g);else if(D&&X===G)return W6(b,v)}let Q=b.replace(/\n+/g,`$&
33
+ ${X}`);if(J){let W=(q)=>q.default&&q.tag!=="tag:yaml.org,2002:str"&&q.test?.test(Q),{compat:I,tags:H}=v.doc.schema;if(H.some(W)||I?.some(W))return W6(b,v)}return D?Q:j_.foldFlowLines(Q,X,j_.FOLD_FLOW,F0(v,!1))}function xj($,v,w,g){let{implicitKey:_,inFlow:b}=v,J=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:D}=$;if(D!==bv.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(J.value))D=bv.Scalar.QUOTE_DOUBLE}let X=(Y)=>{switch(Y){case bv.Scalar.BLOCK_FOLDED:case bv.Scalar.BLOCK_LITERAL:return _||b?W6(J.value,v):j0(J,v,w,g);case bv.Scalar.QUOTE_DOUBLE:return Vg(J.value,v);case bv.Scalar.QUOTE_SINGLE:return xD(J.value,v);case bv.Scalar.PLAIN:return hj(J,v,w,g);default:return null}},G=X(D);if(G===null){let{defaultKeyType:Y,defaultStringType:Q}=v.options,W=_&&Y||Q;if(G=X(W),G===null)throw Error(`Unsupported default string type ${W}`)}return G}lj.stringifyString=xj});var Fg=E((ej)=>{var yj=I0(),F_=_$(),mj=Lg(),rj=jg();function oj($,v){let w=Object.assign({blockQuote:!0,commentString:mj.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,v),g;switch(w.collectionStyle){case"block":g=!1;break;case"flow":g=!0;break;default:g=null}return{anchors:new Set,doc:$,flowCollectionPadding:w.flowCollectionPadding?" ":"",indent:"",indentStep:typeof w.indent==="number"?" ".repeat(w.indent):" ",inFlow:g,options:w}}function dj($,v){if(v.tag){let _=$.filter((b)=>b.tag===v.tag);if(_.length>0)return _.find((b)=>b.format===v.format)??_[0]}let w=void 0,g;if(F_.isScalar(v)){g=v.value;let _=$.filter((b)=>b.identify?.(g));if(_.length>1){let b=_.filter((J)=>J.test);if(b.length>0)_=b}w=_.find((b)=>b.format===v.format)??_.find((b)=>!b.format)}else g=v,w=$.find((_)=>_.nodeClass&&g instanceof _.nodeClass);if(!w){let _=g?.constructor?.name??(g===null?"null":typeof g);throw Error(`Tag not resolved for ${_} value`)}return w}function tj($,v,{anchors:w,doc:g}){if(!g.directives)return"";let _=[],b=(F_.isScalar($)||F_.isCollection($))&&$.anchor;if(b&&yj.anchorIsValid(b))w.add(b),_.push(`&${b}`);let J=$.tag??(v.default?null:v.tag);if(J)_.push(g.directives.tagString(J));return _.join(" ")}function pj($,v,w,g){if(F_.isPair($))return $.toString(v,w,g);if(F_.isAlias($)){if(v.doc.directives)return $.toString(v);if(v.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(v.resolvedAliases)v.resolvedAliases.add($);else v.resolvedAliases=new Set([$]);$=$.resolve(v.doc)}}let _=void 0,b=F_.isNode($)?$:v.doc.createNode($,{onTagObj:(X)=>_=X});_??(_=dj(v.doc.schema.tags,b));let J=tj(b,_,v);if(J.length>0)v.indentAtStart=(v.indentAtStart??0)+J.length+1;let D=typeof _.stringify==="function"?_.stringify(b,v,w,g):F_.isScalar(b)?rj.stringifyString(b,v,w,g):b.toString(v,w,g);if(!J)return D;return F_.isScalar(b)||D[0]==="{"||D[0]==="["?`${J} ${D}`:`${J}
34
+ ${v.indent}${D}`}ej.createStringifyContext=oj;ej.stringify=pj});var T5=E((vF)=>{var uv=_$(),f5=V$(),S5=Fg(),Kg=Lg();function $F({key:$,value:v},w,g,_){let{allNullValues:b,doc:J,indent:D,indentStep:X,options:{commentString:G,indentSeq:Y,simpleKeys:Q}}=w,W=uv.isNode($)&&$.comment||null;if(Q){if(W)throw Error("With simple keys, key nodes cannot have comments");if(uv.isCollection($)||!uv.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let I=!Q&&(!$||W&&v==null&&!w.inFlow||uv.isCollection($)||(uv.isScalar($)?$.type===f5.Scalar.BLOCK_FOLDED||$.type===f5.Scalar.BLOCK_LITERAL:typeof $==="object"));w=Object.assign({},w,{allNullValues:!1,implicitKey:!I&&(Q||!b),indent:D+X});let H=!1,q=!1,j=S5.stringify($,w,()=>H=!0,()=>q=!0);if(!I&&!w.inFlow&&j.length>1024){if(Q)throw Error("With simple keys, single line scalar must not span more than 1024 characters");I=!0}if(w.inFlow){if(b||v==null){if(H&&g)g();return j===""?"?":I?`? ${j}`:j}}else if(b&&!Q||v==null&&I){if(j=`? ${j}`,W&&!H)j+=Kg.lineComment(j,w.indent,G(W));else if(q&&_)_();return j}if(H)W=null;if(I){if(W)j+=Kg.lineComment(j,w.indent,G(W));j=`? ${j}
35
+ ${D}:`}else if(j=`${j}:`,W)j+=Kg.lineComment(j,w.indent,G(W));let F,M,T;if(uv.isNode(v))F=!!v.spaceBefore,M=v.commentBefore,T=v.comment;else if(F=!1,M=null,T=null,v&&typeof v==="object")v=J.createNode(v);if(w.implicitKey=!1,!I&&!W&&uv.isScalar(v))w.indentAtStart=j.length+1;if(q=!1,!Y&&X.length>=2&&!w.inFlow&&!I&&uv.isSeq(v)&&!v.flow&&!v.tag&&!v.anchor)w.indent=w.indent.substring(2);let C=!1,Z=S5.stringify(v,w,()=>C=!0,()=>q=!0),S=" ";if(W||F||M){if(S=F?`
36
+ `:"",M){let c=G(M);S+=`
37
+ ${Kg.indentComment(c,w.indent)}`}if(Z===""&&!w.inFlow){if(S===`
38
+ `&&T)S=`
39
39
 
40
40
  `}else S+=`
41
- ${w.indent}`}else if(!I&&Tv.isCollection(v)){let y=Z[0],x=Z.indexOf(`
42
- `),Y$=x!==-1,s$=w.inFlow??v.flow??v.items.length===0;if(Y$||!s$){let Yw=!1;if(Y$&&(y==="&"||y==="!")){let V$=Z.indexOf(" ");if(y==="&"&&V$!==-1&&V$<x&&Z[V$+1]==="!")V$=Z.indexOf(" ",V$+1);if(V$===-1||x<V$)Yw=!0}if(!Yw)S=`
41
+ ${w.indent}`}else if(!I&&uv.isCollection(v)){let c=Z[0],x=Z.indexOf(`
42
+ `),X$=x!==-1,s$=w.inFlow??v.flow??v.items.length===0;if(X$||!s$){let Qw=!1;if(X$&&(c==="&"||c==="!")){let j$=Z.indexOf(" ");if(c==="&"&&j$!==-1&&j$<x&&Z[j$+1]==="!")j$=Z.indexOf(" ",j$+1);if(j$===-1||x<j$)Qw=!0}if(!Qw)S=`
43
43
  ${w.indent}`}}else if(Z===""||Z[0]===`
44
- `)S="";if(B+=S+Z,w.inFlow){if(C&&g)g()}else if(z&&!C)B+=jg.lineComment(B,w.indent,G(z));else if(W&&_)_();return B}Xj.stringifyPair=Dj});var hD=E((Wj)=>{var A5=Qw("process");function Yj($,...v){if($==="debug")console.log(...v)}function Qj($,v){if($==="debug"||$==="warn")if(typeof A5.emitWarning==="function")A5.emitWarning(v);else console.warn(v)}Wj.debug=Yj;Wj.warn=Qj});var K0=E((Ij)=>{var Fg=_$(),M5=L$(),j0="<<",F0={identify:($)=>$===j0||typeof $==="symbol"&&$.description===j0,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new M5.Scalar(Symbol(j0)),{addToJSMap:z5}),stringify:()=>j0},qj=($,v)=>(F0.identify(v)||Fg.isScalar(v)&&(!v.type||v.type===M5.Scalar.PLAIN)&&F0.identify(v.value))&&$?.doc.schema.tags.some((w)=>w.tag===F0.tag&&w.default);function z5($,v,w){if(w=$&&Fg.isAlias(w)?w.resolve($.doc):w,Fg.isSeq(w))for(let g of w.items)cD($,v,g);else if(Array.isArray(w))for(let g of w)cD($,v,g);else cD($,v,w)}function cD($,v,w){let g=$&&Fg.isAlias(w)?w.resolve($.doc):w;if(!Fg.isMap(g))throw Error("Merge sources must be maps or map aliases");let _=g.toJSON(null,$,Map);for(let[b,J]of _)if(v instanceof Map){if(!v.has(b))v.set(b,J)}else if(v instanceof Set)v.add(b);else if(!Object.prototype.hasOwnProperty.call(v,b))Object.defineProperty(v,b,{value:J,writable:!0,enumerable:!0,configurable:!0});return v}Ij.addMergeToJSMap=z5;Ij.isMergeKey=qj;Ij.merge=F0});var mD=E((ij)=>{var jj=hD(),S5=K0(),Fj=Vg(),u5=_$(),yD=L_();function Kj($,v,{key:w,value:g}){if(u5.isNode(w)&&w.addToJSMap)w.addToJSMap($,v,g);else if(S5.isMergeKey($,w))S5.addMergeToJSMap($,v,g);else{let _=yD.toJS(w,"",$);if(v instanceof Map)v.set(_,yD.toJS(g,_,$));else if(v instanceof Set)v.add(_);else{let b=Oj(w,_,$),J=yD.toJS(g,b,$);if(b in v)Object.defineProperty(v,b,{value:J,writable:!0,enumerable:!0,configurable:!0});else v[b]=J}}return v}function Oj($,v,w){if(v===null)return"";if(typeof v!=="object")return String(v);if(u5.isNode($)&&w?.doc){let g=Fj.createStringifyContext(w.doc,{});g.anchors=new Set;for(let b of w.anchors.keys())g.anchors.add(b.anchor);g.inFlow=!0,g.inStringifyKey=!0;let _=$.toString(g);if(!w.mapKeyWarned){let b=JSON.stringify(_);if(b.length>40)b=b.substring(0,36)+'..."';jj.warn(w.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${b}. Set mapAsMap: true to use object keys.`),w.mapKeyWarned=!0}return _}return JSON.stringify(v)}ij.addPairToJSMap=Kj});var F_=E((Aj)=>{var T5=qg(),Nj=f5(),Pj=mD(),O0=_$();function fj($,v,w){let g=T5.createNode($,void 0,w),_=T5.createNode(v,void 0,w);return new i0(g,_)}class i0{constructor($,v=null){Object.defineProperty(this,O0.NODE_TYPE,{value:O0.PAIR}),this.key=$,this.value=v}clone($){let{key:v,value:w}=this;if(O0.isNode(v))v=v.clone($);if(O0.isNode(w))w=w.clone($);return new i0(v,w)}toJSON($,v){let w=v?.mapAsMap?new Map:{};return Pj.addPairToJSMap(v,w,this)}toString($,v,w){return $?.doc?Nj.stringifyPair(this,$,v,w):JSON.stringify(this)}}Aj.Pair=i0;Aj.createPair=fj});var rD=E((Rj)=>{var a_=_$(),R5=Vg(),k0=Ig();function Sj($,v,w){return(v.inFlow??$.flow?Tj:uj)($,v,w)}function uj({comment:$,items:v},w,{blockItemPrefix:g,flowChars:_,itemIndent:b,onChompKeep:J,onComment:D}){let{indent:X,options:{commentString:G}}=w,Y=Object.assign({},w,{indent:b,type:null}),Q=!1,H=[];for(let q=0;q<v.length;++q){let W=v[q],B=null;if(a_.isNode(W)){if(!Q&&W.spaceBefore)H.push("");if(N0(w,H,W.commentBefore,Q),W.comment)B=W.comment}else if(a_.isPair(W)){let A=a_.isNode(W.key)?W.key:null;if(A){if(!Q&&A.spaceBefore)H.push("");N0(w,H,A.commentBefore,Q)}}Q=!1;let j=R5.stringify(W,Y,()=>B=null,()=>Q=!0);if(B)j+=k0.lineComment(j,b,G(B));if(Q&&B)Q=!1;H.push(g+j)}let I;if(H.length===0)I=_.start+_.end;else{I=H[0];for(let q=1;q<H.length;++q){let W=H[q];I+=W?`
45
- ${X}${W}`:`
44
+ `)S="";if(j+=S+Z,w.inFlow){if(C&&g)g()}else if(T&&!C)j+=Kg.lineComment(j,w.indent,G(T));else if(q&&_)_();return j}vF.stringifyPair=$F});var cD=E((bF)=>{var u5=Ww("process");function wF($,...v){if($==="debug")console.log(...v)}function gF($,v){if($==="debug"||$==="warn")if(typeof u5.emitWarning==="function")u5.emitWarning(v);else console.warn(v)}bF.debug=wF;bF.warn=gF});var k0=E((XF)=>{var Og=_$(),R5=V$(),O0="<<",N0={identify:($)=>$===O0||typeof $==="symbol"&&$.description===O0,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new R5.Scalar(Symbol(O0)),{addToJSMap:C5}),stringify:()=>O0},DF=($,v)=>(N0.identify(v)||Og.isScalar(v)&&(!v.type||v.type===R5.Scalar.PLAIN)&&N0.identify(v.value))&&$?.doc.schema.tags.some((w)=>w.tag===N0.tag&&w.default);function C5($,v,w){if(w=$&&Og.isAlias(w)?w.resolve($.doc):w,Og.isSeq(w))for(let g of w.items)yD($,v,g);else if(Array.isArray(w))for(let g of w)yD($,v,g);else yD($,v,w)}function yD($,v,w){let g=$&&Og.isAlias(w)?w.resolve($.doc):w;if(!Og.isMap(g))throw Error("Merge sources must be maps or map aliases");let _=g.toJSON(null,$,Map);for(let[b,J]of _)if(v instanceof Map){if(!v.has(b))v.set(b,J)}else if(v instanceof Set)v.add(b);else if(!Object.prototype.hasOwnProperty.call(v,b))Object.defineProperty(v,b,{value:J,writable:!0,enumerable:!0,configurable:!0});return v}XF.addMergeToJSMap=C5;XF.isMergeKey=DF;XF.merge=N0});var rD=E((BF)=>{var WF=cD(),E5=k0(),HF=Fg(),Z5=_$(),mD=V_();function qF($,v,{key:w,value:g}){if(Z5.isNode(w)&&w.addToJSMap)w.addToJSMap($,v,g);else if(E5.isMergeKey($,w))E5.addMergeToJSMap($,v,g);else{let _=mD.toJS(w,"",$);if(v instanceof Map)v.set(_,mD.toJS(g,_,$));else if(v instanceof Set)v.add(_);else{let b=IF(w,_,$),J=mD.toJS(g,b,$);if(b in v)Object.defineProperty(v,b,{value:J,writable:!0,enumerable:!0,configurable:!0});else v[b]=J}}return v}function IF($,v,w){if(v===null)return"";if(typeof v!=="object")return String(v);if(Z5.isNode($)&&w?.doc){let g=HF.createStringifyContext(w.doc,{});g.anchors=new Set;for(let b of w.anchors.keys())g.anchors.add(b.anchor);g.inFlow=!0,g.inStringifyKey=!0;let _=$.toString(g);if(!w.mapKeyWarned){let b=JSON.stringify(_);if(b.length>40)b=b.substring(0,36)+'..."';WF.warn(w.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${b}. Set mapAsMap: true to use object keys.`),w.mapKeyWarned=!0}return _}return JSON.stringify(v)}BF.addPairToJSMap=qF});var K_=E((KF)=>{var h5=Bg(),VF=T5(),jF=rD(),z0=_$();function FF($,v,w){let g=h5.createNode($,void 0,w),_=h5.createNode(v,void 0,w);return new i0(g,_)}class i0{constructor($,v=null){Object.defineProperty(this,z0.NODE_TYPE,{value:z0.PAIR}),this.key=$,this.value=v}clone($){let{key:v,value:w}=this;if(z0.isNode(v))v=v.clone($);if(z0.isNode(w))w=w.clone($);return new i0(v,w)}toJSON($,v){let w=v?.mapAsMap?new Map:{};return jF.addPairToJSMap(v,w,this)}toString($,v,w){return $?.doc?VF.stringifyPair(this,$,v,w):JSON.stringify(this)}}KF.Pair=i0;KF.createPair=FF});var oD=E((nF)=>{var a_=_$(),x5=Fg(),n0=Lg();function kF($,v,w){return(v.inFlow??$.flow?iF:zF)($,v,w)}function zF({comment:$,items:v},w,{blockItemPrefix:g,flowChars:_,itemIndent:b,onChompKeep:J,onComment:D}){let{indent:X,options:{commentString:G}}=w,Y=Object.assign({},w,{indent:b,type:null}),Q=!1,W=[];for(let H=0;H<v.length;++H){let q=v[H],j=null;if(a_.isNode(q)){if(!Q&&q.spaceBefore)W.push("");if(P0(w,W,q.commentBefore,Q),q.comment)j=q.comment}else if(a_.isPair(q)){let M=a_.isNode(q.key)?q.key:null;if(M){if(!Q&&M.spaceBefore)W.push("");P0(w,W,M.commentBefore,Q)}}Q=!1;let F=x5.stringify(q,Y,()=>j=null,()=>Q=!0);if(j)F+=n0.lineComment(F,b,G(j));if(Q&&j)Q=!1;W.push(g+F)}let I;if(W.length===0)I=_.start+_.end;else{I=W[0];for(let H=1;H<W.length;++H){let q=W[H];I+=q?`
45
+ ${X}${q}`:`
46
46
  `}}if($){if(I+=`
47
- `+k0.indentComment(G($),X),D)D()}else if(Q&&J)J();return I}function Tj({items:$},v,{flowChars:w,itemIndent:g}){let{indent:_,indentStep:b,flowCollectionPadding:J,options:{commentString:D}}=v;g+=b;let X=Object.assign({},v,{indent:g,inFlow:!0,type:null}),G=!1,Y=0,Q=[];for(let q=0;q<$.length;++q){let W=$[q],B=null;if(a_.isNode(W)){if(W.spaceBefore)Q.push("");if(N0(v,Q,W.commentBefore,!1),W.comment)B=W.comment}else if(a_.isPair(W)){let A=a_.isNode(W.key)?W.key:null;if(A){if(A.spaceBefore)Q.push("");if(N0(v,Q,A.commentBefore,!1),A.comment)G=!0}let z=a_.isNode(W.value)?W.value:null;if(z){if(z.comment)B=z.comment;if(z.commentBefore)G=!0}else if(W.value==null&&A?.comment)B=A.comment}if(B)G=!0;let j=R5.stringify(W,X,()=>B=null);if(q<$.length-1)j+=",";if(B)j+=k0.lineComment(j,g,D(B));if(!G&&(Q.length>Y||j.includes(`
48
- `)))G=!0;Q.push(j),Y=Q.length}let{start:H,end:I}=w;if(Q.length===0)return H+I;else{if(!G){let q=Q.reduce((W,B)=>W+B.length+2,2);G=v.options.lineWidth>0&&q>v.options.lineWidth}if(G){let q=H;for(let W of Q)q+=W?`
49
- ${b}${_}${W}`:`
50
- `;return`${q}
51
- ${_}${I}`}else return`${H}${J}${Q.join(" ")}${J}${I}`}}function N0({indent:$,options:{commentString:v}},w,g,_){if(g&&_)g=g.replace(/^\n+/,"");if(g){let b=k0.indentComment(v(g),$);w.push(b.trimStart())}}Rj.stringifyCollection=Sj});var O_=E((hj)=>{var Ej=rD(),Zj=mD(),xj=I0(),K_=_$(),P0=F_(),lj=L$();function Kg($,v){let w=K_.isScalar(v)?v.value:v;for(let g of $)if(K_.isPair(g)){if(g.key===v||g.key===w)return g;if(K_.isScalar(g.key)&&g.key.value===w)return g}return}class C5 extends xj.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(K_.MAP,$);this.items=[]}static from($,v,w){let{keepUndefined:g,replacer:_}=w,b=new this($),J=(D,X)=>{if(typeof _==="function")X=_.call(v,D,X);else if(Array.isArray(_)&&!_.includes(D))return;if(X!==void 0||g)b.items.push(P0.createPair(D,X,w))};if(v instanceof Map)for(let[D,X]of v)J(D,X);else if(v&&typeof v==="object")for(let D of Object.keys(v))J(D,v[D]);if(typeof $.sortMapEntries==="function")b.items.sort($.sortMapEntries);return b}add($,v){let w;if(K_.isPair($))w=$;else if(!$||typeof $!=="object"||!("key"in $))w=new P0.Pair($,$?.value);else w=new P0.Pair($.key,$.value);let g=Kg(this.items,w.key),_=this.schema?.sortMapEntries;if(g){if(!v)throw Error(`Key ${w.key} already set`);if(K_.isScalar(g.value)&&lj.isScalarValue(w.value))g.value.value=w.value;else g.value=w.value}else if(_){let b=this.items.findIndex((J)=>_(w,J)<0);if(b===-1)this.items.push(w);else this.items.splice(b,0,w)}else this.items.push(w)}delete($){let v=Kg(this.items,$);if(!v)return!1;return this.items.splice(this.items.indexOf(v),1).length>0}get($,v){let g=Kg(this.items,$)?.value;return(!v&&K_.isScalar(g)?g.value:g)??void 0}has($){return!!Kg(this.items,$)}set($,v){this.add(new P0.Pair($,v),!0)}toJSON($,v,w){let g=w?new w:v?.mapAsMap?new Map:{};if(v?.onCreate)v.onCreate(g);for(let _ of this.items)Zj.addPairToJSMap(v,g,_);return g}toString($,v,w){if(!$)return JSON.stringify(this);for(let g of this.items)if(!K_.isPair(g))throw Error(`Map items must all be pairs; found ${JSON.stringify(g)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return Ej.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:w,onComment:v})}}hj.YAMLMap=C5;hj.findPair=Kg});var W6=E((oj)=>{var mj=_$(),E5=O_(),rj={collection:"map",default:!0,nodeClass:E5.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,v){if(!mj.isMap($))v("Expected a mapping for this tag");return $},createNode:($,v,w)=>E5.YAMLMap.from($,v,w)};oj.map=rj});var i_=E(($F)=>{var dj=qg(),pj=rD(),ej=I0(),A0=_$(),aj=L$(),sj=L_();class Z5 extends ej.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(A0.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let v=f0($);if(typeof v!=="number")return!1;return this.items.splice(v,1).length>0}get($,v){let w=f0($);if(typeof w!=="number")return;let g=this.items[w];return!v&&A0.isScalar(g)?g.value:g}has($){let v=f0($);return typeof v==="number"&&v<this.items.length}set($,v){let w=f0($);if(typeof w!=="number")throw Error(`Expected a valid index, not ${$}.`);let g=this.items[w];if(A0.isScalar(g)&&aj.isScalarValue(v))g.value=v;else this.items[w]=v}toJSON($,v){let w=[];if(v?.onCreate)v.onCreate(w);let g=0;for(let _ of this.items)w.push(sj.toJS(_,String(g++),v));return w}toString($,v,w){if(!$)return JSON.stringify(this);return pj.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:w,onComment:v})}static from($,v,w){let{replacer:g}=w,_=new this($);if(v&&Symbol.iterator in Object(v)){let b=0;for(let J of v){if(typeof g==="function"){let D=v instanceof Set?J:String(b++);J=g.call(v,D,J)}_.items.push(dj.createNode(J,void 0,w))}}return _}}function f0($){let v=A0.isScalar($)?$.value:$;if(v&&typeof v==="string")v=Number(v);return typeof v==="number"&&Number.isInteger(v)&&v>=0?v:null}$F.YAMLSeq=Z5});var H6=E((gF)=>{var _F=_$(),x5=i_(),wF={collection:"seq",default:!0,nodeClass:x5.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,v){if(!_F.isSeq($))v("Expected a sequence for this tag");return $},createNode:($,v,w)=>x5.YAMLSeq.from($,v,w)};gF.seq=wF});var Og=E((DF)=>{var UF=Lg(),JF={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,v,w,g){return v=Object.assign({actualString:!0},v),UF.stringifyString($,v,w,g)}};DF.string=JF});var M0=E((GF)=>{var l5=L$(),h5={identify:($)=>$==null,createNode:()=>new l5.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new l5.Scalar(null),stringify:({source:$},v)=>typeof $==="string"&&h5.test.test($)?$:v.options.nullStr};GF.nullTag=h5});var oD=E((WF)=>{var QF=L$(),c5={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new QF.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:v},w){if($&&c5.test.test($)){let g=$[0]==="t"||$[0]==="T";if(v===g)return $}return v?w.options.trueStr:w.options.falseStr}};WF.boolTag=c5});var n6=E((qF)=>{function nF({format:$,minFractionDigits:v,tag:w,value:g}){if(typeof g==="bigint")return String(g);let _=typeof g==="number"?g:Number(g);if(!isFinite(_))return isNaN(_)?".nan":_<0?"-.inf":".inf";let b=Object.is(g,-0)?"-0":JSON.stringify(g);if(!$&&v&&(!w||w==="tag:yaml.org,2002:float")&&/^\d/.test(b)){let J=b.indexOf(".");if(J<0)J=b.length,b+=".";let D=v-(b.length-J-1);while(D-- >0)b+="0"}return b}qF.stringifyNumber=nF});var dD=E((FF)=>{var BF=L$(),tD=n6(),LF={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:tD.stringifyNumber},VF={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let v=Number($.value);return isFinite(v)?v.toExponential():tD.stringifyNumber($)}},jF={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let v=new BF.Scalar(parseFloat($)),w=$.indexOf(".");if(w!==-1&&$[$.length-1]==="0")v.minFractionDigits=$.length-w-1;return v},stringify:tD.stringifyNumber};FF.float=jF;FF.floatExp=VF;FF.floatNaN=LF});var eD=E((fF)=>{var y5=n6(),z0=($)=>typeof $==="bigint"||Number.isInteger($),pD=($,v,w,{intAsBigInt:g})=>g?BigInt($):parseInt($.substring(v),w);function m5($,v,w){let{value:g}=$;if(z0(g)&&g>=0)return w+g.toString(v);return y5.stringifyNumber($)}var kF={identify:($)=>z0($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,v,w)=>pD($,2,8,w),stringify:($)=>m5($,8,"0o")},NF={identify:z0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,v,w)=>pD($,0,10,w),stringify:y5.stringifyNumber},PF={identify:($)=>z0($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,v,w)=>pD($,2,16,w),stringify:($)=>m5($,16,"0x")};fF.int=NF;fF.intHex=PF;fF.intOct=kF});var r5=E((ZF)=>{var SF=W6(),uF=M0(),TF=H6(),RF=Og(),CF=oD(),aD=dD(),sD=eD(),EF=[SF.map,TF.seq,RF.string,uF.nullTag,CF.boolTag,sD.intOct,sD.int,sD.intHex,aD.floatNaN,aD.floatExp,aD.float];ZF.schema=EF});var t5=E((oF)=>{var lF=L$(),hF=W6(),cF=H6();function o5($){return typeof $==="bigint"||Number.isInteger($)}var S0=({value:$})=>JSON.stringify($),yF=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:S0},{identify:($)=>$==null,createNode:()=>new lF.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:S0},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:S0},{identify:o5,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,v,{intAsBigInt:w})=>w?BigInt($):parseInt($,10),stringify:({value:$})=>o5($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:S0}],mF={default:!0,tag:"",test:/^/,resolve($,v){return v(`Unresolved plain scalar ${JSON.stringify($)}`),$}},rF=[hF.map,cF.seq].concat(yF,mF);oF.schema=rF});var vX=E((eF)=>{var ig=Qw("buffer"),$X=L$(),dF=Lg(),pF={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,v){if(typeof ig.Buffer==="function")return ig.Buffer.from($,"base64");else if(typeof atob==="function"){let w=atob($.replace(/[\n\r]/g,"")),g=new Uint8Array(w.length);for(let _=0;_<w.length;++_)g[_]=w.charCodeAt(_);return g}else return v("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:v,value:w},g,_,b){if(!w)return"";let J=w,D;if(typeof ig.Buffer==="function")D=J instanceof ig.Buffer?J.toString("base64"):ig.Buffer.from(J.buffer).toString("base64");else if(typeof btoa==="function"){let X="";for(let G=0;G<J.length;++G)X+=String.fromCharCode(J[G]);D=btoa(X)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(v??(v=$X.Scalar.BLOCK_LITERAL),v!==$X.Scalar.QUOTE_DOUBLE){let X=Math.max(g.options.lineWidth-g.indent.length,g.options.minContentWidth),G=Math.ceil(D.length/X),Y=Array(G);for(let Q=0,H=0;Q<G;++Q,H+=X)Y[Q]=D.substr(H,X);D=Y.join(v===$X.Scalar.BLOCK_LITERAL?`
52
- `:" ")}return dF.stringifyString({comment:$,type:v,value:D},g,_,b)}};eF.binary=pF});var T0=E((_K)=>{var u0=_$(),_X=F_(),sF=L$(),$K=i_();function d5($,v){if(u0.isSeq($))for(let w=0;w<$.items.length;++w){let g=$.items[w];if(u0.isPair(g))continue;else if(u0.isMap(g)){if(g.items.length>1)v("Each pair must have its own sequence indicator");let _=g.items[0]||new _X.Pair(new sF.Scalar(null));if(g.commentBefore)_.key.commentBefore=_.key.commentBefore?`${g.commentBefore}
47
+ `+n0.indentComment(G($),X),D)D()}else if(Q&&J)J();return I}function iF({items:$},v,{flowChars:w,itemIndent:g}){let{indent:_,indentStep:b,flowCollectionPadding:J,options:{commentString:D}}=v;g+=b;let X=Object.assign({},v,{indent:g,inFlow:!0,type:null}),G=!1,Y=0,Q=[];for(let H=0;H<$.length;++H){let q=$[H],j=null;if(a_.isNode(q)){if(q.spaceBefore)Q.push("");if(P0(v,Q,q.commentBefore,!1),q.comment)j=q.comment}else if(a_.isPair(q)){let M=a_.isNode(q.key)?q.key:null;if(M){if(M.spaceBefore)Q.push("");if(P0(v,Q,M.commentBefore,!1),M.comment)G=!0}let T=a_.isNode(q.value)?q.value:null;if(T){if(T.comment)j=T.comment;if(T.commentBefore)G=!0}else if(q.value==null&&M?.comment)j=M.comment}if(j)G=!0;let F=x5.stringify(q,X,()=>j=null);if(H<$.length-1)F+=",";if(j)F+=n0.lineComment(F,g,D(j));if(!G&&(Q.length>Y||F.includes(`
48
+ `)))G=!0;Q.push(F),Y=Q.length}let{start:W,end:I}=w;if(Q.length===0)return W+I;else{if(!G){let H=Q.reduce((q,j)=>q+j.length+2,2);G=v.options.lineWidth>0&&H>v.options.lineWidth}if(G){let H=W;for(let q of Q)H+=q?`
49
+ ${b}${_}${q}`:`
50
+ `;return`${H}
51
+ ${_}${I}`}else return`${W}${J}${Q.join(" ")}${J}${I}`}}function P0({indent:$,options:{commentString:v}},w,g,_){if(g&&_)g=g.replace(/^\n+/,"");if(g){let b=n0.indentComment(v(g),$);w.push(b.trimStart())}}nF.stringifyCollection=kF});var N_=E((TF)=>{var AF=oD(),MF=rD(),fF=V0(),O_=_$(),A0=K_(),SF=V$();function Ng($,v){let w=O_.isScalar(v)?v.value:v;for(let g of $)if(O_.isPair(g)){if(g.key===v||g.key===w)return g;if(O_.isScalar(g.key)&&g.key.value===w)return g}return}class l5 extends fF.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(O_.MAP,$);this.items=[]}static from($,v,w){let{keepUndefined:g,replacer:_}=w,b=new this($),J=(D,X)=>{if(typeof _==="function")X=_.call(v,D,X);else if(Array.isArray(_)&&!_.includes(D))return;if(X!==void 0||g)b.items.push(A0.createPair(D,X,w))};if(v instanceof Map)for(let[D,X]of v)J(D,X);else if(v&&typeof v==="object")for(let D of Object.keys(v))J(D,v[D]);if(typeof $.sortMapEntries==="function")b.items.sort($.sortMapEntries);return b}add($,v){let w;if(O_.isPair($))w=$;else if(!$||typeof $!=="object"||!("key"in $))w=new A0.Pair($,$?.value);else w=new A0.Pair($.key,$.value);let g=Ng(this.items,w.key),_=this.schema?.sortMapEntries;if(g){if(!v)throw Error(`Key ${w.key} already set`);if(O_.isScalar(g.value)&&SF.isScalarValue(w.value))g.value.value=w.value;else g.value=w.value}else if(_){let b=this.items.findIndex((J)=>_(w,J)<0);if(b===-1)this.items.push(w);else this.items.splice(b,0,w)}else this.items.push(w)}delete($){let v=Ng(this.items,$);if(!v)return!1;return this.items.splice(this.items.indexOf(v),1).length>0}get($,v){let g=Ng(this.items,$)?.value;return(!v&&O_.isScalar(g)?g.value:g)??void 0}has($){return!!Ng(this.items,$)}set($,v){this.add(new A0.Pair($,v),!0)}toJSON($,v,w){let g=w?new w:v?.mapAsMap?new Map:{};if(v?.onCreate)v.onCreate(g);for(let _ of this.items)MF.addPairToJSMap(v,g,_);return g}toString($,v,w){if(!$)return JSON.stringify(this);for(let g of this.items)if(!O_.isPair(g))throw Error(`Map items must all be pairs; found ${JSON.stringify(g)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return AF.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:w,onComment:v})}}TF.YAMLMap=l5;TF.findPair=Ng});var H6=E((ZF)=>{var CF=_$(),c5=N_(),EF={collection:"map",default:!0,nodeClass:c5.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,v){if(!CF.isMap($))v("Expected a mapping for this tag");return $},createNode:($,v,w)=>c5.YAMLMap.from($,v,w)};ZF.map=EF});var k_=E((rF)=>{var xF=Bg(),lF=oD(),cF=V0(),f0=_$(),yF=V$(),mF=V_();class y5 extends cF.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(f0.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let v=M0($);if(typeof v!=="number")return!1;return this.items.splice(v,1).length>0}get($,v){let w=M0($);if(typeof w!=="number")return;let g=this.items[w];return!v&&f0.isScalar(g)?g.value:g}has($){let v=M0($);return typeof v==="number"&&v<this.items.length}set($,v){let w=M0($);if(typeof w!=="number")throw Error(`Expected a valid index, not ${$}.`);let g=this.items[w];if(f0.isScalar(g)&&yF.isScalarValue(v))g.value=v;else this.items[w]=v}toJSON($,v){let w=[];if(v?.onCreate)v.onCreate(w);let g=0;for(let _ of this.items)w.push(mF.toJS(_,String(g++),v));return w}toString($,v,w){if(!$)return JSON.stringify(this);return lF.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:w,onComment:v})}static from($,v,w){let{replacer:g}=w,_=new this($);if(v&&Symbol.iterator in Object(v)){let b=0;for(let J of v){if(typeof g==="function"){let D=v instanceof Set?J:String(b++);J=g.call(v,D,J)}_.items.push(xF.createNode(J,void 0,w))}}return _}}function M0($){let v=f0.isScalar($)?$.value:$;if(v&&typeof v==="string")v=Number(v);return typeof v==="number"&&Number.isInteger(v)&&v>=0?v:null}rF.YAMLSeq=y5});var q6=E((pF)=>{var dF=_$(),m5=k_(),tF={collection:"seq",default:!0,nodeClass:m5.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,v){if(!dF.isSeq($))v("Expected a sequence for this tag");return $},createNode:($,v,w)=>m5.YAMLSeq.from($,v,w)};pF.seq=tF});var kg=E(($K)=>{var aF=jg(),sF={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,v,w,g){return v=Object.assign({actualString:!0},v),aF.stringifyString($,v,w,g)}};$K.string=sF});var S0=E((_K)=>{var r5=V$(),o5={identify:($)=>$==null,createNode:()=>new r5.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new r5.Scalar(null),stringify:({source:$},v)=>typeof $==="string"&&o5.test.test($)?$:v.options.nullStr};_K.nullTag=o5});var dD=E((bK)=>{var gK=V$(),d5={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new gK.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:v},w){if($&&d5.test.test($)){let g=$[0]==="t"||$[0]==="T";if(v===g)return $}return v?w.options.trueStr:w.options.falseStr}};bK.boolTag=d5});var I6=E((DK)=>{function JK({format:$,minFractionDigits:v,tag:w,value:g}){if(typeof g==="bigint")return String(g);let _=typeof g==="number"?g:Number(g);if(!isFinite(_))return isNaN(_)?".nan":_<0?"-.inf":".inf";let b=Object.is(g,-0)?"-0":JSON.stringify(g);if(!$&&v&&(!w||w==="tag:yaml.org,2002:float")&&/^\d/.test(b)){let J=b.indexOf(".");if(J<0)J=b.length,b+=".";let D=v-(b.length-J-1);while(D-- >0)b+="0"}return b}DK.stringifyNumber=JK});var pD=E((HK)=>{var GK=V$(),tD=I6(),YK={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:tD.stringifyNumber},QK={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let v=Number($.value);return isFinite(v)?v.toExponential():tD.stringifyNumber($)}},WK={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let v=new GK.Scalar(parseFloat($)),w=$.indexOf(".");if(w!==-1&&$[$.length-1]==="0")v.minFractionDigits=$.length-w-1;return v},stringify:tD.stringifyNumber};HK.float=WK;HK.floatExp=QK;HK.floatNaN=YK});var aD=E((FK)=>{var t5=I6(),T0=($)=>typeof $==="bigint"||Number.isInteger($),eD=($,v,w,{intAsBigInt:g})=>g?BigInt($):parseInt($.substring(v),w);function p5($,v,w){let{value:g}=$;if(T0(g)&&g>=0)return w+g.toString(v);return t5.stringifyNumber($)}var LK={identify:($)=>T0($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,v,w)=>eD($,2,8,w),stringify:($)=>p5($,8,"0o")},VK={identify:T0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,v,w)=>eD($,0,10,w),stringify:t5.stringifyNumber},jK={identify:($)=>T0($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,v,w)=>eD($,2,16,w),stringify:($)=>p5($,16,"0x")};FK.int=VK;FK.intHex=jK;FK.intOct=LK});var e5=E((MK)=>{var kK=H6(),zK=S0(),iK=q6(),nK=kg(),PK=dD(),sD=pD(),$X=aD(),AK=[kK.map,iK.seq,nK.string,zK.nullTag,PK.boolTag,$X.intOct,$X.int,$X.intHex,sD.floatNaN,sD.floatExp,sD.float];MK.schema=AK});var s5=E((ZK)=>{var SK=V$(),TK=H6(),uK=q6();function a5($){return typeof $==="bigint"||Number.isInteger($)}var u0=({value:$})=>JSON.stringify($),RK=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:u0},{identify:($)=>$==null,createNode:()=>new SK.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:u0},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:u0},{identify:a5,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,v,{intAsBigInt:w})=>w?BigInt($):parseInt($,10),stringify:({value:$})=>a5($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:u0}],CK={default:!0,tag:"",test:/^/,resolve($,v){return v(`Unresolved plain scalar ${JSON.stringify($)}`),$}},EK=[TK.map,uK.seq].concat(RK,CK);ZK.schema=EK});var _X=E((cK)=>{var zg=Ww("buffer"),vX=V$(),xK=jg(),lK={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,v){if(typeof zg.Buffer==="function")return zg.Buffer.from($,"base64");else if(typeof atob==="function"){let w=atob($.replace(/[\n\r]/g,"")),g=new Uint8Array(w.length);for(let _=0;_<w.length;++_)g[_]=w.charCodeAt(_);return g}else return v("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:v,value:w},g,_,b){if(!w)return"";let J=w,D;if(typeof zg.Buffer==="function")D=J instanceof zg.Buffer?J.toString("base64"):zg.Buffer.from(J.buffer).toString("base64");else if(typeof btoa==="function"){let X="";for(let G=0;G<J.length;++G)X+=String.fromCharCode(J[G]);D=btoa(X)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(v??(v=vX.Scalar.BLOCK_LITERAL),v!==vX.Scalar.QUOTE_DOUBLE){let X=Math.max(g.options.lineWidth-g.indent.length,g.options.minContentWidth),G=Math.ceil(D.length/X),Y=Array(G);for(let Q=0,W=0;Q<G;++Q,W+=X)Y[Q]=D.substr(W,X);D=Y.join(v===vX.Scalar.BLOCK_LITERAL?`
52
+ `:" ")}return xK.stringifyString({comment:$,type:v,value:D},g,_,b)}};cK.binary=lK});var C0=E((dK)=>{var R0=_$(),wX=K_(),mK=V$(),rK=k_();function $Y($,v){if(R0.isSeq($))for(let w=0;w<$.items.length;++w){let g=$.items[w];if(R0.isPair(g))continue;else if(R0.isMap(g)){if(g.items.length>1)v("Each pair must have its own sequence indicator");let _=g.items[0]||new wX.Pair(new mK.Scalar(null));if(g.commentBefore)_.key.commentBefore=_.key.commentBefore?`${g.commentBefore}
53
53
  ${_.key.commentBefore}`:g.commentBefore;if(g.comment){let b=_.value??_.key;b.comment=b.comment?`${g.comment}
54
- ${b.comment}`:g.comment}g=_}$.items[w]=u0.isPair(g)?g:new _X.Pair(g)}else v("Expected a sequence for this tag");return $}function p5($,v,w){let{replacer:g}=w,_=new $K.YAMLSeq($);_.tag="tag:yaml.org,2002:pairs";let b=0;if(v&&Symbol.iterator in Object(v))for(let J of v){if(typeof g==="function")J=g.call(v,String(b++),J);let D,X;if(Array.isArray(J))if(J.length===2)D=J[0],X=J[1];else throw TypeError(`Expected [key, value] tuple: ${J}`);else if(J&&J instanceof Object){let G=Object.keys(J);if(G.length===1)D=G[0],X=J[D];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else D=J;_.items.push(_X.createPair(D,X,w))}return _}var vK={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:d5,createNode:p5};_K.createPairs=p5;_K.pairs=vK;_K.resolvePairs=d5});var gX=E((DK)=>{var e5=_$(),wX=L_(),kg=O_(),UK=i_(),a5=T0();class s_ extends UK.YAMLSeq{constructor(){super();this.add=kg.YAMLMap.prototype.add.bind(this),this.delete=kg.YAMLMap.prototype.delete.bind(this),this.get=kg.YAMLMap.prototype.get.bind(this),this.has=kg.YAMLMap.prototype.has.bind(this),this.set=kg.YAMLMap.prototype.set.bind(this),this.tag=s_.tag}toJSON($,v){if(!v)return super.toJSON($);let w=new Map;if(v?.onCreate)v.onCreate(w);for(let g of this.items){let _,b;if(e5.isPair(g))_=wX.toJS(g.key,"",v),b=wX.toJS(g.value,_,v);else _=wX.toJS(g,"",v);if(w.has(_))throw Error("Ordered maps must not include duplicate keys");w.set(_,b)}return w}static from($,v,w){let g=a5.createPairs($,v,w),_=new this;return _.items=g.items,_}}s_.tag="tag:yaml.org,2002:omap";var JK={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:s_,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,v){let w=a5.resolvePairs($,v),g=[];for(let{key:_}of w.items)if(e5.isScalar(_))if(g.includes(_.value))v(`Ordered maps must not include duplicate keys: ${_.value}`);else g.push(_.value);return Object.assign(new s_,w)},createNode:($,v,w)=>s_.from($,v,w)};DK.YAMLOMap=s_;DK.omap=JK});var w7=E((YK)=>{var s5=L$();function $7({value:$,source:v},w){if(v&&($?v7:_7).test.test(v))return v;return $?w.options.trueStr:w.options.falseStr}var v7={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new s5.Scalar(!0),stringify:$7},_7={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new s5.Scalar(!1),stringify:$7};YK.falseTag=_7;YK.trueTag=v7});var g7=E((BK)=>{var HK=L$(),bX=n6(),nK={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:bX.stringifyNumber},qK={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let v=Number($.value);return isFinite(v)?v.toExponential():bX.stringifyNumber($)}},IK={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let v=new HK.Scalar(parseFloat($.replace(/_/g,""))),w=$.indexOf(".");if(w!==-1){let g=$.substring(w+1).replace(/_/g,"");if(g[g.length-1]==="0")v.minFractionDigits=g.length}return v},stringify:bX.stringifyNumber};BK.float=IK;BK.floatExp=qK;BK.floatNaN=nK});var U7=E((kK)=>{var b7=n6(),Ng=($)=>typeof $==="bigint"||Number.isInteger($);function R0($,v,w,{intAsBigInt:g}){let _=$[0];if(_==="-"||_==="+")v+=1;if($=$.substring(v).replace(/_/g,""),g){switch(w){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let J=BigInt($);return _==="-"?BigInt(-1)*J:J}let b=parseInt($,w);return _==="-"?-1*b:b}function UX($,v,w){let{value:g}=$;if(Ng(g)){let _=g.toString(v);return g<0?"-"+w+_.substr(1):w+_}return b7.stringifyNumber($)}var FK={identify:Ng,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,v,w)=>R0($,2,2,w),stringify:($)=>UX($,2,"0b")},KK={identify:Ng,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,v,w)=>R0($,1,8,w),stringify:($)=>UX($,8,"0")},OK={identify:Ng,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,v,w)=>R0($,0,10,w),stringify:b7.stringifyNumber},iK={identify:Ng,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,v,w)=>R0($,2,16,w),stringify:($)=>UX($,16,"0x")};kK.int=OK;kK.intBin=FK;kK.intHex=iK;kK.intOct=KK});var JX=E((zK)=>{var Z0=_$(),C0=F_(),E0=O_();class $w extends E0.YAMLMap{constructor($){super($);this.tag=$w.tag}add($){let v;if(Z0.isPair($))v=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)v=new C0.Pair($.key,null);else v=new C0.Pair($,null);if(!E0.findPair(this.items,v.key))this.items.push(v)}get($,v){let w=E0.findPair(this.items,$);return!v&&Z0.isPair(w)?Z0.isScalar(w.key)?w.key.value:w.key:w}set($,v){if(typeof v!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof v}`);let w=E0.findPair(this.items,$);if(w&&!v)this.items.splice(this.items.indexOf(w),1);else if(!w&&v)this.items.push(new C0.Pair($))}toJSON($,v){return super.toJSON($,v,Set)}toString($,v,w){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),v,w);else throw Error("Set items must all have null values")}static from($,v,w){let{replacer:g}=w,_=new this($);if(v&&Symbol.iterator in Object(v))for(let b of v){if(typeof g==="function")b=g.call(v,b,b);_.items.push(C0.createPair(b,null,w))}return _}}$w.tag="tag:yaml.org,2002:set";var MK={collection:"map",identify:($)=>$ instanceof Set,nodeClass:$w,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,v,w)=>$w.from($,v,w),resolve($,v){if(Z0.isMap($))if($.hasAllNullValues(!0))return Object.assign(new $w,$);else v("Set items must all have null values");else v("Expected a mapping for this tag");return $}};zK.YAMLSet=$w;zK.set=MK});var XX=E((EK)=>{var TK=n6();function DX($,v){let w=$[0],g=w==="-"||w==="+"?$.substring(1):$,_=(J)=>v?BigInt(J):Number(J),b=g.replace(/_/g,"").split(":").reduce((J,D)=>J*_(60)+_(D),_(0));return w==="-"?_(-1)*b:b}function J7($){let{value:v}=$,w=(J)=>J;if(typeof v==="bigint")w=(J)=>BigInt(J);else if(isNaN(v)||!isFinite(v))return TK.stringifyNumber($);let g="";if(v<0)g="-",v*=w(-1);let _=w(60),b=[v%_];if(v<60)b.unshift(0);else if(v=(v-b[0])/_,b.unshift(v%_),v>=60)v=(v-b[0])/_,b.unshift(v);return g+b.map((J)=>String(J).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var RK={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,v,{intAsBigInt:w})=>DX($,w),stringify:J7},CK={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>DX($,!1),stringify:J7},D7={identify:($)=>$ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve($){let v=$.match(D7.test);if(!v)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,w,g,_,b,J,D]=v.map(Number),X=v[7]?Number((v[7]+"00").substr(1,3)):0,G=Date.UTC(w,g-1,_,b||0,J||0,D||0,X),Y=v[8];if(Y&&Y!=="Z"){let Q=DX(Y,!1);if(Math.abs(Q)<30)Q*=60;G-=60000*Q}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};EK.floatTime=CK;EK.intTime=RK;EK.timestamp=D7});var G7=E((aK)=>{var hK=W6(),cK=M0(),yK=H6(),mK=Og(),rK=vX(),X7=w7(),GX=g7(),x0=U7(),oK=K0(),tK=gX(),dK=T0(),pK=JX(),YX=XX(),eK=[hK.map,yK.seq,mK.string,cK.nullTag,X7.trueTag,X7.falseTag,x0.intBin,x0.intOct,x0.int,x0.intHex,GX.floatNaN,GX.floatExp,GX.float,rK.binary,oK.merge,tK.omap,dK.pairs,pK.set,YX.intTime,YX.floatTime,YX.timestamp];aK.schema=eK});var V7=E((JO)=>{var H7=W6(),$O=M0(),n7=H6(),vO=Og(),_O=oD(),QX=dD(),WX=eD(),wO=r5(),gO=t5(),q7=vX(),Pg=K0(),I7=gX(),B7=T0(),Y7=G7(),L7=JX(),l0=XX(),Q7=new Map([["core",wO.schema],["failsafe",[H7.map,n7.seq,vO.string]],["json",gO.schema],["yaml11",Y7.schema],["yaml-1.1",Y7.schema]]),W7={binary:q7.binary,bool:_O.boolTag,float:QX.float,floatExp:QX.floatExp,floatNaN:QX.floatNaN,floatTime:l0.floatTime,int:WX.int,intHex:WX.intHex,intOct:WX.intOct,intTime:l0.intTime,map:H7.map,merge:Pg.merge,null:$O.nullTag,omap:I7.omap,pairs:B7.pairs,seq:n7.seq,set:L7.set,timestamp:l0.timestamp},bO={"tag:yaml.org,2002:binary":q7.binary,"tag:yaml.org,2002:merge":Pg.merge,"tag:yaml.org,2002:omap":I7.omap,"tag:yaml.org,2002:pairs":B7.pairs,"tag:yaml.org,2002:set":L7.set,"tag:yaml.org,2002:timestamp":l0.timestamp};function UO($,v,w){let g=Q7.get(v);if(g&&!$)return w&&!g.includes(Pg.merge)?g.concat(Pg.merge):g.slice();let _=g;if(!_)if(Array.isArray($))_=[];else{let b=Array.from(Q7.keys()).filter((J)=>J!=="yaml11").map((J)=>JSON.stringify(J)).join(", ");throw Error(`Unknown schema "${v}"; use one of ${b} or define customTags array`)}if(Array.isArray($))for(let b of $)_=_.concat(b);else if(typeof $==="function")_=$(_.slice());if(w)_=_.concat(Pg.merge);return _.reduce((b,J)=>{let D=typeof J==="string"?W7[J]:J;if(!D){let X=JSON.stringify(J),G=Object.keys(W7).map((Y)=>JSON.stringify(Y)).join(", ");throw Error(`Unknown custom tag ${X}; use one of ${G}`)}if(!b.includes(D))b.push(D);return b},[])}JO.coreKnownTags=bO;JO.getTags=UO});var qX=E((HO)=>{var HX=_$(),GO=W6(),YO=H6(),QO=Og(),h0=V7(),WO=($,v)=>$.key<v.key?-1:$.key>v.key?1:0;class nX{constructor({compat:$,customTags:v,merge:w,resolveKnownTags:g,schema:_,sortMapEntries:b,toStringDefaults:J}){this.compat=Array.isArray($)?h0.getTags($,"compat"):$?h0.getTags(null,$):null,this.name=typeof _==="string"&&_||"core",this.knownTags=g?h0.coreKnownTags:{},this.tags=h0.getTags(v,this.name,w),this.toStringOptions=J??null,Object.defineProperty(this,HX.MAP,{value:GO.map}),Object.defineProperty(this,HX.SCALAR,{value:QO.string}),Object.defineProperty(this,HX.SEQ,{value:YO.seq}),this.sortMapEntries=typeof b==="function"?b:b===!0?WO:null}clone(){let $=Object.create(nX.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}HO.Schema=nX});var j7=E((BO)=>{var qO=_$(),IX=Vg(),fg=Ig();function IO($,v){let w=[],g=v.directives===!0;if(v.directives!==!1&&$.directives){let X=$.directives.toString($);if(X)w.push(X),g=!0;else if($.directives.docStart)g=!0}if(g)w.push("---");let _=IX.createStringifyContext($,v),{commentString:b}=_.options;if($.commentBefore){if(w.length!==1)w.unshift("");let X=b($.commentBefore);w.unshift(fg.indentComment(X,""))}let J=!1,D=null;if($.contents){if(qO.isNode($.contents)){if($.contents.spaceBefore&&g)w.push("");if($.contents.commentBefore){let Y=b($.contents.commentBefore);w.push(fg.indentComment(Y,""))}_.forceBlockIndent=!!$.comment,D=$.contents.comment}let X=D?void 0:()=>J=!0,G=IX.stringify($.contents,_,()=>D=null,X);if(D)G+=fg.lineComment(G,"",b(D));if((G[0]==="|"||G[0]===">")&&w[w.length-1]==="---")w[w.length-1]=`--- ${G}`;else w.push(G)}else w.push(IX.stringify($.contents,_));if($.directives?.docEnd)if($.comment){let X=b($.comment);if(X.includes(`
55
- `))w.push("..."),w.push(fg.indentComment(X,""));else w.push(`... ${X}`)}else w.push("...");else{let X=$.comment;if(X&&J)X=X.replace(/^\n+/,"");if(X){if((!J||D)&&w[w.length-1]!=="")w.push("");w.push(fg.indentComment(b(X),""))}}return w.join(`
54
+ ${b.comment}`:g.comment}g=_}$.items[w]=R0.isPair(g)?g:new wX.Pair(g)}else v("Expected a sequence for this tag");return $}function vY($,v,w){let{replacer:g}=w,_=new rK.YAMLSeq($);_.tag="tag:yaml.org,2002:pairs";let b=0;if(v&&Symbol.iterator in Object(v))for(let J of v){if(typeof g==="function")J=g.call(v,String(b++),J);let D,X;if(Array.isArray(J))if(J.length===2)D=J[0],X=J[1];else throw TypeError(`Expected [key, value] tuple: ${J}`);else if(J&&J instanceof Object){let G=Object.keys(J);if(G.length===1)D=G[0],X=J[D];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else D=J;_.items.push(wX.createPair(D,X,w))}return _}var oK={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:$Y,createNode:vY};dK.createPairs=vY;dK.pairs=oK;dK.resolvePairs=$Y});var bX=E(($O)=>{var _Y=_$(),gX=V_(),ig=N_(),aK=k_(),wY=C0();class s_ extends aK.YAMLSeq{constructor(){super();this.add=ig.YAMLMap.prototype.add.bind(this),this.delete=ig.YAMLMap.prototype.delete.bind(this),this.get=ig.YAMLMap.prototype.get.bind(this),this.has=ig.YAMLMap.prototype.has.bind(this),this.set=ig.YAMLMap.prototype.set.bind(this),this.tag=s_.tag}toJSON($,v){if(!v)return super.toJSON($);let w=new Map;if(v?.onCreate)v.onCreate(w);for(let g of this.items){let _,b;if(_Y.isPair(g))_=gX.toJS(g.key,"",v),b=gX.toJS(g.value,_,v);else _=gX.toJS(g,"",v);if(w.has(_))throw Error("Ordered maps must not include duplicate keys");w.set(_,b)}return w}static from($,v,w){let g=wY.createPairs($,v,w),_=new this;return _.items=g.items,_}}s_.tag="tag:yaml.org,2002:omap";var sK={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:s_,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,v){let w=wY.resolvePairs($,v),g=[];for(let{key:_}of w.items)if(_Y.isScalar(_))if(g.includes(_.value))v(`Ordered maps must not include duplicate keys: ${_.value}`);else g.push(_.value);return Object.assign(new s_,w)},createNode:($,v,w)=>s_.from($,v,w)};$O.YAMLOMap=s_;$O.omap=sK});var DY=E((wO)=>{var gY=V$();function bY({value:$,source:v},w){if(v&&($?UY:JY).test.test(v))return v;return $?w.options.trueStr:w.options.falseStr}var UY={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new gY.Scalar(!0),stringify:bY},JY={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new gY.Scalar(!1),stringify:bY};wO.falseTag=JY;wO.trueTag=UY});var XY=E((GO)=>{var UO=V$(),UX=I6(),JO={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:UX.stringifyNumber},DO={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let v=Number($.value);return isFinite(v)?v.toExponential():UX.stringifyNumber($)}},XO={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let v=new UO.Scalar(parseFloat($.replace(/_/g,""))),w=$.indexOf(".");if(w!==-1){let g=$.substring(w+1).replace(/_/g,"");if(g[g.length-1]==="0")v.minFractionDigits=g.length}return v},stringify:UX.stringifyNumber};GO.float=XO;GO.floatExp=DO;GO.floatNaN=JO});var YY=E((LO)=>{var GY=I6(),ng=($)=>typeof $==="bigint"||Number.isInteger($);function E0($,v,w,{intAsBigInt:g}){let _=$[0];if(_==="-"||_==="+")v+=1;if($=$.substring(v).replace(/_/g,""),g){switch(w){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let J=BigInt($);return _==="-"?BigInt(-1)*J:J}let b=parseInt($,w);return _==="-"?-1*b:b}function JX($,v,w){let{value:g}=$;if(ng(g)){let _=g.toString(v);return g<0?"-"+w+_.substr(1):w+_}return GY.stringifyNumber($)}var HO={identify:ng,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,v,w)=>E0($,2,2,w),stringify:($)=>JX($,2,"0b")},qO={identify:ng,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,v,w)=>E0($,1,8,w),stringify:($)=>JX($,8,"0")},IO={identify:ng,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,v,w)=>E0($,0,10,w),stringify:GY.stringifyNumber},BO={identify:ng,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,v,w)=>E0($,2,16,w),stringify:($)=>JX($,16,"0x")};LO.int=IO;LO.intBin=HO;LO.intHex=BO;LO.intOct=qO});var DX=E((NO)=>{var x0=_$(),Z0=K_(),h0=N_();class $w extends h0.YAMLMap{constructor($){super($);this.tag=$w.tag}add($){let v;if(x0.isPair($))v=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)v=new Z0.Pair($.key,null);else v=new Z0.Pair($,null);if(!h0.findPair(this.items,v.key))this.items.push(v)}get($,v){let w=h0.findPair(this.items,$);return!v&&x0.isPair(w)?x0.isScalar(w.key)?w.key.value:w.key:w}set($,v){if(typeof v!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof v}`);let w=h0.findPair(this.items,$);if(w&&!v)this.items.splice(this.items.indexOf(w),1);else if(!w&&v)this.items.push(new Z0.Pair($))}toJSON($,v){return super.toJSON($,v,Set)}toString($,v,w){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),v,w);else throw Error("Set items must all have null values")}static from($,v,w){let{replacer:g}=w,_=new this($);if(v&&Symbol.iterator in Object(v))for(let b of v){if(typeof g==="function")b=g.call(v,b,b);_.items.push(Z0.createPair(b,null,w))}return _}}$w.tag="tag:yaml.org,2002:set";var OO={collection:"map",identify:($)=>$ instanceof Set,nodeClass:$w,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,v,w)=>$w.from($,v,w),resolve($,v){if(x0.isMap($))if($.hasAllNullValues(!0))return Object.assign(new $w,$);else v("Set items must all have null values");else v("Expected a mapping for this tag");return $}};NO.YAMLSet=$w;NO.set=OO});var GX=E((AO)=>{var iO=I6();function XX($,v){let w=$[0],g=w==="-"||w==="+"?$.substring(1):$,_=(J)=>v?BigInt(J):Number(J),b=g.replace(/_/g,"").split(":").reduce((J,D)=>J*_(60)+_(D),_(0));return w==="-"?_(-1)*b:b}function QY($){let{value:v}=$,w=(J)=>J;if(typeof v==="bigint")w=(J)=>BigInt(J);else if(isNaN(v)||!isFinite(v))return iO.stringifyNumber($);let g="";if(v<0)g="-",v*=w(-1);let _=w(60),b=[v%_];if(v<60)b.unshift(0);else if(v=(v-b[0])/_,b.unshift(v%_),v>=60)v=(v-b[0])/_,b.unshift(v);return g+b.map((J)=>String(J).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var nO={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,v,{intAsBigInt:w})=>XX($,w),stringify:QY},PO={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>XX($,!1),stringify:QY},WY={identify:($)=>$ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve($){let v=$.match(WY.test);if(!v)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,w,g,_,b,J,D]=v.map(Number),X=v[7]?Number((v[7]+"00").substr(1,3)):0,G=Date.UTC(w,g-1,_,b||0,J||0,D||0,X),Y=v[8];if(Y&&Y!=="Z"){let Q=XX(Y,!1);if(Math.abs(Q)<30)Q*=60;G-=60000*Q}return new Date(G)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};AO.floatTime=PO;AO.intTime=nO;AO.timestamp=WY});var qY=E((yO)=>{var TO=H6(),uO=S0(),RO=q6(),CO=kg(),EO=_X(),HY=DY(),YX=XY(),l0=YY(),ZO=k0(),hO=bX(),xO=C0(),lO=DX(),QX=GX(),cO=[TO.map,RO.seq,CO.string,uO.nullTag,HY.trueTag,HY.falseTag,l0.intBin,l0.intOct,l0.int,l0.intHex,YX.floatNaN,YX.floatExp,YX.float,EO.binary,ZO.merge,hO.omap,xO.pairs,lO.set,QX.intTime,QX.floatTime,QX.timestamp];yO.schema=cO});var kY=E((sO)=>{var VY=H6(),rO=S0(),jY=q6(),oO=kg(),dO=dD(),WX=pD(),HX=aD(),tO=e5(),pO=s5(),FY=_X(),Pg=k0(),KY=bX(),OY=C0(),IY=qY(),NY=DX(),c0=GX(),BY=new Map([["core",tO.schema],["failsafe",[VY.map,jY.seq,oO.string]],["json",pO.schema],["yaml11",IY.schema],["yaml-1.1",IY.schema]]),LY={binary:FY.binary,bool:dO.boolTag,float:WX.float,floatExp:WX.floatExp,floatNaN:WX.floatNaN,floatTime:c0.floatTime,int:HX.int,intHex:HX.intHex,intOct:HX.intOct,intTime:c0.intTime,map:VY.map,merge:Pg.merge,null:rO.nullTag,omap:KY.omap,pairs:OY.pairs,seq:jY.seq,set:NY.set,timestamp:c0.timestamp},eO={"tag:yaml.org,2002:binary":FY.binary,"tag:yaml.org,2002:merge":Pg.merge,"tag:yaml.org,2002:omap":KY.omap,"tag:yaml.org,2002:pairs":OY.pairs,"tag:yaml.org,2002:set":NY.set,"tag:yaml.org,2002:timestamp":c0.timestamp};function aO($,v,w){let g=BY.get(v);if(g&&!$)return w&&!g.includes(Pg.merge)?g.concat(Pg.merge):g.slice();let _=g;if(!_)if(Array.isArray($))_=[];else{let b=Array.from(BY.keys()).filter((J)=>J!=="yaml11").map((J)=>JSON.stringify(J)).join(", ");throw Error(`Unknown schema "${v}"; use one of ${b} or define customTags array`)}if(Array.isArray($))for(let b of $)_=_.concat(b);else if(typeof $==="function")_=$(_.slice());if(w)_=_.concat(Pg.merge);return _.reduce((b,J)=>{let D=typeof J==="string"?LY[J]:J;if(!D){let X=JSON.stringify(J),G=Object.keys(LY).map((Y)=>JSON.stringify(Y)).join(", ");throw Error(`Unknown custom tag ${X}; use one of ${G}`)}if(!b.includes(D))b.push(D);return b},[])}sO.coreKnownTags=eO;sO.getTags=aO});var BX=E((UN)=>{var qX=_$(),_N=H6(),wN=q6(),gN=kg(),y0=kY(),bN=($,v)=>$.key<v.key?-1:$.key>v.key?1:0;class IX{constructor({compat:$,customTags:v,merge:w,resolveKnownTags:g,schema:_,sortMapEntries:b,toStringDefaults:J}){this.compat=Array.isArray($)?y0.getTags($,"compat"):$?y0.getTags(null,$):null,this.name=typeof _==="string"&&_||"core",this.knownTags=g?y0.coreKnownTags:{},this.tags=y0.getTags(v,this.name,w),this.toStringOptions=J??null,Object.defineProperty(this,qX.MAP,{value:_N.map}),Object.defineProperty(this,qX.SCALAR,{value:gN.string}),Object.defineProperty(this,qX.SEQ,{value:wN.seq}),this.sortMapEntries=typeof b==="function"?b:b===!0?bN:null}clone(){let $=Object.create(IX.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}UN.Schema=IX});var zY=E((GN)=>{var DN=_$(),LX=Fg(),Ag=Lg();function XN($,v){let w=[],g=v.directives===!0;if(v.directives!==!1&&$.directives){let X=$.directives.toString($);if(X)w.push(X),g=!0;else if($.directives.docStart)g=!0}if(g)w.push("---");let _=LX.createStringifyContext($,v),{commentString:b}=_.options;if($.commentBefore){if(w.length!==1)w.unshift("");let X=b($.commentBefore);w.unshift(Ag.indentComment(X,""))}let J=!1,D=null;if($.contents){if(DN.isNode($.contents)){if($.contents.spaceBefore&&g)w.push("");if($.contents.commentBefore){let Y=b($.contents.commentBefore);w.push(Ag.indentComment(Y,""))}_.forceBlockIndent=!!$.comment,D=$.contents.comment}let X=D?void 0:()=>J=!0,G=LX.stringify($.contents,_,()=>D=null,X);if(D)G+=Ag.lineComment(G,"",b(D));if((G[0]==="|"||G[0]===">")&&w[w.length-1]==="---")w[w.length-1]=`--- ${G}`;else w.push(G)}else w.push(LX.stringify($.contents,_));if($.directives?.docEnd)if($.comment){let X=b($.comment);if(X.includes(`
55
+ `))w.push("..."),w.push(Ag.indentComment(X,""));else w.push(`... ${X}`)}else w.push("...");else{let X=$.comment;if(X&&J)X=X.replace(/^\n+/,"");if(X){if((!J||D)&&w[w.length-1]!=="")w.push("");w.push(Ag.indentComment(b(X),""))}}return w.join(`
56
56
  `)+`
57
- `}BO.stringifyDocument=IO});var Ag=E((NO)=>{var VO=ng(),q6=I0(),e$=_$(),jO=F_(),FO=L_(),KO=qX(),OO=j7(),BX=H0(),iO=CD(),kO=qg(),LX=RD();class VX{constructor($,v,w){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,e$.NODE_TYPE,{value:e$.DOC});let g=null;if(typeof v==="function"||Array.isArray(v))g=v;else if(w===void 0&&v)w=v,v=void 0;let _=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},w);this.options=_;let{version:b}=_;if(w?._directives){if(this.directives=w._directives.atDocument(),this.directives.yaml.explicit)b=this.directives.yaml.version}else this.directives=new LX.Directives({version:b});this.setSchema(b,w),this.contents=$===void 0?null:this.createNode($,g,w)}clone(){let $=Object.create(VX.prototype,{[e$.NODE_TYPE]:{value:e$.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=e$.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(I6(this.contents))this.contents.add($)}addIn($,v){if(I6(this.contents))this.contents.addIn($,v)}createAlias($,v){if(!$.anchor){let w=BX.anchorNames(this);$.anchor=!v||w.has(v)?BX.findNewAnchor(v||"a",w):v}return new VO.Alias($.anchor)}createNode($,v,w){let g=void 0;if(typeof v==="function")$=v.call({"":$},"",$),g=v;else if(Array.isArray(v)){let W=(j)=>typeof j==="number"||j instanceof String||j instanceof Number,B=v.filter(W).map(String);if(B.length>0)v=v.concat(B);g=v}else if(w===void 0&&v)w=v,v=void 0;let{aliasDuplicateObjects:_,anchorPrefix:b,flow:J,keepUndefined:D,onTagObj:X,tag:G}=w??{},{onAnchor:Y,setAnchors:Q,sourceObjects:H}=BX.createNodeAnchors(this,b||"a"),I={aliasDuplicateObjects:_??!0,keepUndefined:D??!1,onAnchor:Y,onTagObj:X,replacer:g,schema:this.schema,sourceObjects:H},q=kO.createNode($,G,I);if(J&&e$.isCollection(q))q.flow=!0;return Q(),q}createPair($,v,w={}){let g=this.createNode($,null,w),_=this.createNode(v,null,w);return new jO.Pair(g,_)}delete($){return I6(this.contents)?this.contents.delete($):!1}deleteIn($){if(q6.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return I6(this.contents)?this.contents.deleteIn($):!1}get($,v){return e$.isCollection(this.contents)?this.contents.get($,v):void 0}getIn($,v){if(q6.isEmptyPath($))return!v&&e$.isScalar(this.contents)?this.contents.value:this.contents;return e$.isCollection(this.contents)?this.contents.getIn($,v):void 0}has($){return e$.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(q6.isEmptyPath($))return this.contents!==void 0;return e$.isCollection(this.contents)?this.contents.hasIn($):!1}set($,v){if(this.contents==null)this.contents=q6.collectionFromPath(this.schema,[$],v);else if(I6(this.contents))this.contents.set($,v)}setIn($,v){if(q6.isEmptyPath($))this.contents=v;else if(this.contents==null)this.contents=q6.collectionFromPath(this.schema,Array.from($),v);else if(I6(this.contents))this.contents.setIn($,v)}setSchema($,v={}){if(typeof $==="number")$=String($);let w;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new LX.Directives({version:"1.1"});w={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new LX.Directives({version:$});w={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;w=null;break;default:{let g=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${g}`)}}if(v.schema instanceof Object)this.schema=v.schema;else if(w)this.schema=new KO.Schema(Object.assign(w,v));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:v,mapAsMap:w,maxAliasCount:g,onAnchor:_,reviver:b}={}){let J={anchors:new Map,doc:this,keep:!$,mapAsMap:w===!0,mapKeyWarned:!1,maxAliasCount:typeof g==="number"?g:100},D=FO.toJS(this.contents,v??"",J);if(typeof _==="function")for(let{count:X,res:G}of J.anchors.values())_(G,X);return typeof b==="function"?iO.applyReviver(b,{"":D},"",D):D}toJSON($,v){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:v})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let v=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${v}`)}return OO.stringifyDocument(this,$)}}function I6($){if(e$.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}NO.Document=VX});var Mg=E((AO)=>{class c0 extends Error{constructor($,v,w,g){super();this.name=$,this.code=w,this.message=g,this.pos=v}}class F7 extends c0{constructor($,v,w){super("YAMLParseError",$,v,w)}}class K7 extends c0{constructor($,v,w){super("YAMLWarning",$,v,w)}}var fO=($,v)=>(w)=>{if(w.pos[0]===-1)return;w.linePos=w.pos.map((D)=>v.linePos(D));let{line:g,col:_}=w.linePos[0];w.message+=` at line ${g}, column ${_}`;let b=_-1,J=$.substring(v.lineStarts[g-1],v.lineStarts[g]).replace(/[\n\r]+$/,"");if(b>=60&&J.length>80){let D=Math.min(b-39,J.length-79);J="…"+J.substring(D),b-=D-1}if(J.length>80)J=J.substring(0,79)+"…";if(g>1&&/^ *$/.test(J.substring(0,b))){let D=$.substring(v.lineStarts[g-2],v.lineStarts[g-1]);if(D.length>80)D=D.substring(0,79)+`…
57
+ `}GN.stringifyDocument=XN});var Mg=E((VN)=>{var QN=Ig(),B6=V0(),e$=_$(),WN=K_(),HN=V_(),qN=BX(),IN=zY(),VX=I0(),BN=ED(),LN=Bg(),jX=CD();class FX{constructor($,v,w){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,e$.NODE_TYPE,{value:e$.DOC});let g=null;if(typeof v==="function"||Array.isArray(v))g=v;else if(w===void 0&&v)w=v,v=void 0;let _=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},w);this.options=_;let{version:b}=_;if(w?._directives){if(this.directives=w._directives.atDocument(),this.directives.yaml.explicit)b=this.directives.yaml.version}else this.directives=new jX.Directives({version:b});this.setSchema(b,w),this.contents=$===void 0?null:this.createNode($,g,w)}clone(){let $=Object.create(FX.prototype,{[e$.NODE_TYPE]:{value:e$.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=e$.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(L6(this.contents))this.contents.add($)}addIn($,v){if(L6(this.contents))this.contents.addIn($,v)}createAlias($,v){if(!$.anchor){let w=VX.anchorNames(this);$.anchor=!v||w.has(v)?VX.findNewAnchor(v||"a",w):v}return new QN.Alias($.anchor)}createNode($,v,w){let g=void 0;if(typeof v==="function")$=v.call({"":$},"",$),g=v;else if(Array.isArray(v)){let q=(F)=>typeof F==="number"||F instanceof String||F instanceof Number,j=v.filter(q).map(String);if(j.length>0)v=v.concat(j);g=v}else if(w===void 0&&v)w=v,v=void 0;let{aliasDuplicateObjects:_,anchorPrefix:b,flow:J,keepUndefined:D,onTagObj:X,tag:G}=w??{},{onAnchor:Y,setAnchors:Q,sourceObjects:W}=VX.createNodeAnchors(this,b||"a"),I={aliasDuplicateObjects:_??!0,keepUndefined:D??!1,onAnchor:Y,onTagObj:X,replacer:g,schema:this.schema,sourceObjects:W},H=LN.createNode($,G,I);if(J&&e$.isCollection(H))H.flow=!0;return Q(),H}createPair($,v,w={}){let g=this.createNode($,null,w),_=this.createNode(v,null,w);return new WN.Pair(g,_)}delete($){return L6(this.contents)?this.contents.delete($):!1}deleteIn($){if(B6.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return L6(this.contents)?this.contents.deleteIn($):!1}get($,v){return e$.isCollection(this.contents)?this.contents.get($,v):void 0}getIn($,v){if(B6.isEmptyPath($))return!v&&e$.isScalar(this.contents)?this.contents.value:this.contents;return e$.isCollection(this.contents)?this.contents.getIn($,v):void 0}has($){return e$.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(B6.isEmptyPath($))return this.contents!==void 0;return e$.isCollection(this.contents)?this.contents.hasIn($):!1}set($,v){if(this.contents==null)this.contents=B6.collectionFromPath(this.schema,[$],v);else if(L6(this.contents))this.contents.set($,v)}setIn($,v){if(B6.isEmptyPath($))this.contents=v;else if(this.contents==null)this.contents=B6.collectionFromPath(this.schema,Array.from($),v);else if(L6(this.contents))this.contents.setIn($,v)}setSchema($,v={}){if(typeof $==="number")$=String($);let w;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new jX.Directives({version:"1.1"});w={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new jX.Directives({version:$});w={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;w=null;break;default:{let g=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${g}`)}}if(v.schema instanceof Object)this.schema=v.schema;else if(w)this.schema=new qN.Schema(Object.assign(w,v));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:v,mapAsMap:w,maxAliasCount:g,onAnchor:_,reviver:b}={}){let J={anchors:new Map,doc:this,keep:!$,mapAsMap:w===!0,mapKeyWarned:!1,maxAliasCount:typeof g==="number"?g:100},D=HN.toJS(this.contents,v??"",J);if(typeof _==="function")for(let{count:X,res:G}of J.anchors.values())_(G,X);return typeof b==="function"?BN.applyReviver(b,{"":D},"",D):D}toJSON($,v){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:v})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let v=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${v}`)}return IN.stringifyDocument(this,$)}}function L6($){if(e$.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}VN.Document=FX});var fg=E((KN)=>{class m0 extends Error{constructor($,v,w,g){super();this.name=$,this.code=w,this.message=g,this.pos=v}}class iY extends m0{constructor($,v,w){super("YAMLParseError",$,v,w)}}class nY extends m0{constructor($,v,w){super("YAMLWarning",$,v,w)}}var FN=($,v)=>(w)=>{if(w.pos[0]===-1)return;w.linePos=w.pos.map((D)=>v.linePos(D));let{line:g,col:_}=w.linePos[0];w.message+=` at line ${g}, column ${_}`;let b=_-1,J=$.substring(v.lineStarts[g-1],v.lineStarts[g]).replace(/[\n\r]+$/,"");if(b>=60&&J.length>80){let D=Math.min(b-39,J.length-79);J="…"+J.substring(D),b-=D-1}if(J.length>80)J=J.substring(0,79)+"…";if(g>1&&/^ *$/.test(J.substring(0,b))){let D=$.substring(v.lineStarts[g-2],v.lineStarts[g-1]);if(D.length>80)D=D.substring(0,79)+`…
58
58
  `;J=D+J}if(/[^ ]/.test(J)){let D=1,X=w.linePos[1];if(X?.line===g&&X.col>_)D=Math.max(1,Math.min(X.col-_,80-b));let G=" ".repeat(b)+"^".repeat(D);w.message+=`:
59
59
 
60
60
  ${J}
61
61
  ${G}
62
- `}};AO.YAMLError=c0;AO.YAMLParseError=F7;AO.YAMLWarning=K7;AO.prettifyError=fO});var zg=E((RO)=>{function TO($,{flow:v,indicator:w,next:g,offset:_,onError:b,parentIndent:J,startOnNewline:D}){let X=!1,G=D,Y=D,Q="",H="",I=!1,q=!1,W=null,B=null,j=null,A=null,z=null,C=null,Z=null;for(let x of $){if(q){if(x.type!=="space"&&x.type!=="newline"&&x.type!=="comma")b(x.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");q=!1}if(W){if(G&&x.type!=="comment"&&x.type!=="newline")b(W,"TAB_AS_INDENT","Tabs are not allowed as indentation");W=null}switch(x.type){case"space":if(!v&&(w!=="doc-start"||g?.type!=="flow-collection")&&x.source.includes("\t"))W=x;Y=!0;break;case"comment":{if(!Y)b(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Y$=x.source.substring(1)||" ";if(!Q)Q=Y$;else Q+=H+Y$;H="",G=!1;break}case"newline":if(G){if(Q)Q+=x.source;else if(!C||w!=="seq-item-ind")X=!0}else H+=x.source;if(G=!0,I=!0,B||j)A=x;Y=!0;break;case"anchor":if(B)b(x,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(x.source.endsWith(":"))b(x.offset+x.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);B=x,Z??(Z=x.offset),G=!1,Y=!1,q=!0;break;case"tag":{if(j)b(x,"MULTIPLE_TAGS","A node can have at most one tag");j=x,Z??(Z=x.offset),G=!1,Y=!1,q=!0;break}case w:if(B||j)b(x,"BAD_PROP_ORDER",`Anchors and tags must be after the ${x.source} indicator`);if(C)b(x,"UNEXPECTED_TOKEN",`Unexpected ${x.source} in ${v??"collection"}`);C=x,G=w==="seq-item-ind"||w==="explicit-key-ind",Y=!1;break;case"comma":if(v){if(z)b(x,"UNEXPECTED_TOKEN",`Unexpected , in ${v}`);z=x,G=!1,Y=!1;break}default:b(x,"UNEXPECTED_TOKEN",`Unexpected ${x.type} token`),G=!1,Y=!1}}let S=$[$.length-1],y=S?S.offset+S.source.length:_;if(q&&g&&g.type!=="space"&&g.type!=="newline"&&g.type!=="comma"&&(g.type!=="scalar"||g.source!==""))b(g.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(W&&(G&&W.indent<=J||g?.type==="block-map"||g?.type==="block-seq"))b(W,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:z,found:C,spaceBefore:X,comment:Q,hasNewline:I,anchor:B,tag:j,newlineAfterProp:A,end:y,start:Z??y}}RO.resolveProps=TO});var y0=E((EO)=>{function jX($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
63
- `))return!0;if($.end){for(let v of $.end)if(v.type==="newline")return!0}return!1;case"flow-collection":for(let v of $.items){for(let w of v.start)if(w.type==="newline")return!0;if(v.sep){for(let w of v.sep)if(w.type==="newline")return!0}if(jX(v.key)||jX(v.value))return!0}return!1;default:return!0}}EO.containsNewline=jX});var FX=E((hO)=>{var xO=y0();function lO($,v,w){if(v?.type==="flow-collection"){let g=v.end[0];if(g.indent===$&&(g.source==="]"||g.source==="}")&&xO.containsNewline(v))w(g,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}hO.flowIndentCheck=lO});var KX=E((mO)=>{var O7=_$();function yO($,v,w){let{uniqueKeys:g}=$.options;if(g===!1)return!1;let _=typeof g==="function"?g:(b,J)=>b===J||O7.isScalar(b)&&O7.isScalar(J)&&b.value===J.value;return v.some((b)=>_(b.key,w))}mO.mapIncludes=yO});var f7=E((eO)=>{var i7=F_(),oO=O_(),k7=zg(),tO=y0(),N7=FX(),dO=KX(),P7="All mapping items must start at the same column";function pO({composeNode:$,composeEmptyNode:v},w,g,_,b){let D=new(b?.nodeClass??oO.YAMLMap)(w.schema);if(w.atRoot)w.atRoot=!1;let X=g.offset,G=null;for(let Y of g.items){let{start:Q,key:H,sep:I,value:q}=Y,W=k7.resolveProps(Q,{indicator:"explicit-key-ind",next:H??I?.[0],offset:X,onError:_,parentIndent:g.indent,startOnNewline:!0}),B=!W.found;if(B){if(H){if(H.type==="block-seq")_(X,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in H&&H.indent!==g.indent)_(X,"BAD_INDENT",P7)}if(!W.anchor&&!W.tag&&!I){if(G=W.end,W.comment)if(D.comment)D.comment+=`
64
- `+W.comment;else D.comment=W.comment;continue}if(W.newlineAfterProp||tO.containsNewline(H))_(H??Q[Q.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(W.found?.indent!==g.indent)_(X,"BAD_INDENT",P7);w.atKey=!0;let j=W.end,A=H?$(w,H,W,_):v(w,j,Q,null,W,_);if(w.schema.compat)N7.flowIndentCheck(g.indent,H,_);if(w.atKey=!1,dO.mapIncludes(w,D.items,A))_(j,"DUPLICATE_KEY","Map keys must be unique");let z=k7.resolveProps(I??[],{indicator:"map-value-ind",next:q,offset:A.range[2],onError:_,parentIndent:g.indent,startOnNewline:!H||H.type==="block-scalar"});if(X=z.end,z.found){if(B){if(q?.type==="block-map"&&!z.hasNewline)_(X,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(w.options.strict&&W.start<z.found.offset-1024)_(A.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let C=q?$(w,q,z,_):v(w,X,I,null,z,_);if(w.schema.compat)N7.flowIndentCheck(g.indent,q,_);X=C.range[2];let Z=new i7.Pair(A,C);if(w.options.keepSourceTokens)Z.srcToken=Y;D.items.push(Z)}else{if(B)_(A.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(z.comment)if(A.comment)A.comment+=`
65
- `+z.comment;else A.comment=z.comment;let C=new i7.Pair(A);if(w.options.keepSourceTokens)C.srcToken=Y;D.items.push(C)}}if(G&&G<X)_(G,"IMPOSSIBLE","Map comment with trailing content");return D.range=[g.offset,X,G??X],D}eO.resolveBlockMap=pO});var A7=E((wi)=>{var sO=i_(),$i=zg(),vi=FX();function _i({composeNode:$,composeEmptyNode:v},w,g,_,b){let D=new(b?.nodeClass??sO.YAMLSeq)(w.schema);if(w.atRoot)w.atRoot=!1;if(w.atKey)w.atKey=!1;let X=g.offset,G=null;for(let{start:Y,value:Q}of g.items){let H=$i.resolveProps(Y,{indicator:"seq-item-ind",next:Q,offset:X,onError:_,parentIndent:g.indent,startOnNewline:!0});if(!H.found)if(H.anchor||H.tag||Q)if(Q?.type==="block-seq")_(H.end,"BAD_INDENT","All sequence items must start at the same column");else _(X,"MISSING_CHAR","Sequence item without - indicator");else{if(G=H.end,H.comment)D.comment=H.comment;continue}let I=Q?$(w,Q,H,_):v(w,H.end,Y,null,H,_);if(w.schema.compat)vi.flowIndentCheck(g.indent,Q,_);X=I.range[2],D.items.push(I)}return D.range=[g.offset,X,G??X],D}wi.resolveBlockSeq=_i});var B6=E((Ui)=>{function bi($,v,w,g){let _="";if($){let b=!1,J="";for(let D of $){let{source:X,type:G}=D;switch(G){case"space":b=!0;break;case"comment":{if(w&&!b)g(D,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Y=X.substring(1)||" ";if(!_)_=Y;else _+=J+Y;J="";break}case"newline":if(_)J+=X;b=!0;break;default:g(D,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}v+=X.length}}return{comment:_,offset:v}}Ui.resolveEnd=bi});var S7=E((ni)=>{var Di=_$(),Xi=F_(),M7=O_(),Gi=i_(),Yi=B6(),z7=zg(),Qi=y0(),Wi=KX(),OX="Block collections are not allowed within flow collections",iX=($)=>$&&($.type==="block-map"||$.type==="block-seq");function Hi({composeNode:$,composeEmptyNode:v},w,g,_,b){let J=g.start.source==="{",D=J?"flow map":"flow sequence",G=new(b?.nodeClass??(J?M7.YAMLMap:Gi.YAMLSeq))(w.schema);G.flow=!0;let Y=w.atRoot;if(Y)w.atRoot=!1;if(w.atKey)w.atKey=!1;let Q=g.offset+g.start.source.length;for(let B=0;B<g.items.length;++B){let j=g.items[B],{start:A,key:z,sep:C,value:Z}=j,S=z7.resolveProps(A,{flow:D,indicator:"explicit-key-ind",next:z??C?.[0],offset:Q,onError:_,parentIndent:g.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!C&&!Z){if(B===0&&S.comma)_(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${D}`);else if(B<g.items.length-1)_(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${D}`);if(S.comment)if(G.comment)G.comment+=`
66
- `+S.comment;else G.comment=S.comment;Q=S.end;continue}if(!J&&w.options.strict&&Qi.containsNewline(z))_(z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(B===0){if(S.comma)_(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${D}`)}else{if(!S.comma)_(S.start,"MISSING_CHAR",`Missing , between ${D} items`);if(S.comment){let y="";$:for(let x of A)switch(x.type){case"comma":case"space":break;case"comment":y=x.source.substring(1);break $;default:break $}if(y){let x=G.items[G.items.length-1];if(Di.isPair(x))x=x.value??x.key;if(x.comment)x.comment+=`
67
- `+y;else x.comment=y;S.comment=S.comment.substring(y.length+1)}}}if(!J&&!C&&!S.found){let y=Z?$(w,Z,S,_):v(w,S.end,C,null,S,_);if(G.items.push(y),Q=y.range[2],iX(Z))_(y.range,"BLOCK_IN_FLOW",OX)}else{w.atKey=!0;let y=S.end,x=z?$(w,z,S,_):v(w,y,A,null,S,_);if(iX(z))_(x.range,"BLOCK_IN_FLOW",OX);w.atKey=!1;let Y$=z7.resolveProps(C??[],{flow:D,indicator:"map-value-ind",next:Z,offset:x.range[2],onError:_,parentIndent:g.indent,startOnNewline:!1});if(Y$.found){if(!J&&!S.found&&w.options.strict){if(C)for(let V$ of C){if(V$===Y$.found)break;if(V$.type==="newline"){_(V$,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(S.start<Y$.found.offset-1024)_(Y$.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(Z)if("source"in Z&&Z.source?.[0]===":")_(Z,"MISSING_CHAR",`Missing space after : in ${D}`);else _(Y$.start,"MISSING_CHAR",`Missing , or : between ${D} items`);let s$=Z?$(w,Z,Y$,_):Y$.found?v(w,Y$.end,C,null,Y$,_):null;if(s$){if(iX(Z))_(s$.range,"BLOCK_IN_FLOW",OX)}else if(Y$.comment)if(x.comment)x.comment+=`
68
- `+Y$.comment;else x.comment=Y$.comment;let Yw=new Xi.Pair(x,s$);if(w.options.keepSourceTokens)Yw.srcToken=j;if(J){let V$=G;if(Wi.mapIncludes(w,V$.items,x))_(y,"DUPLICATE_KEY","Map keys must be unique");V$.items.push(Yw)}else{let V$=new M7.YAMLMap(w.schema);V$.flow=!0,V$.items.push(Yw);let aG=(s$??x).range;V$.range=[x.range[0],aG[1],aG[2]],G.items.push(V$)}Q=s$?s$.range[2]:Y$.end}}let H=J?"}":"]",[I,...q]=g.end,W=Q;if(I?.source===H)W=I.offset+I.source.length;else{let B=D[0].toUpperCase()+D.substring(1),j=Y?`${B} must end with a ${H}`:`${B} in block collection must be sufficiently indented and end with a ${H}`;if(_(Q,Y?"MISSING_CHAR":"BAD_INDENT",j),I&&I.source.length!==1)q.unshift(I)}if(q.length>0){let B=Yi.resolveEnd(q,W,w.options.strict,_);if(B.comment)if(G.comment)G.comment+=`
69
- `+B.comment;else G.comment=B.comment;G.range=[g.offset,W,B.offset]}else G.range=[g.offset,W,W];return G}ni.resolveFlowCollection=Hi});var u7=E((ii)=>{var Ii=_$(),Bi=L$(),Li=O_(),Vi=i_(),ji=f7(),Fi=A7(),Ki=S7();function kX($,v,w,g,_,b){let J=w.type==="block-map"?ji.resolveBlockMap($,v,w,g,b):w.type==="block-seq"?Fi.resolveBlockSeq($,v,w,g,b):Ki.resolveFlowCollection($,v,w,g,b),D=J.constructor;if(_==="!"||_===D.tagName)return J.tag=D.tagName,J;if(_)J.tag=_;return J}function Oi($,v,w,g,_){let b=g.tag,J=!b?null:v.directives.tagName(b.source,(H)=>_(b,"TAG_RESOLVE_FAILED",H));if(w.type==="block-seq"){let{anchor:H,newlineAfterProp:I}=g,q=H&&b?H.offset>b.offset?H:b:H??b;if(q&&(!I||I.offset<q.offset))_(q,"MISSING_CHAR","Missing newline after block sequence props")}let D=w.type==="block-map"?"map":w.type==="block-seq"?"seq":w.start.source==="{"?"map":"seq";if(!b||!J||J==="!"||J===Li.YAMLMap.tagName&&D==="map"||J===Vi.YAMLSeq.tagName&&D==="seq")return kX($,v,w,_,J);let X=v.schema.tags.find((H)=>H.tag===J&&H.collection===D);if(!X){let H=v.schema.knownTags[J];if(H?.collection===D)v.schema.tags.push(Object.assign({},H,{default:!1})),X=H;else{if(H)_(b,"BAD_COLLECTION_TYPE",`${H.tag} used for ${D} collection, but expects ${H.collection??"scalar"}`,!0);else _(b,"TAG_RESOLVE_FAILED",`Unresolved tag: ${J}`,!0);return kX($,v,w,_,J)}}let G=kX($,v,w,_,J,X),Y=X.resolve?.(G,(H)=>_(b,"TAG_RESOLVE_FAILED",H),v.options)??G,Q=Ii.isNode(Y)?Y:new Bi.Scalar(Y);if(Q.range=G.range,Q.tag=J,X?.format)Q.format=X.format;return Q}ii.composeCollection=Oi});var PX=E((Ai)=>{var NX=L$();function Ni($,v,w){let g=v.offset,_=Pi(v,$.options.strict,w);if(!_)return{value:"",type:null,comment:"",range:[g,g,g]};let b=_.mode===">"?NX.Scalar.BLOCK_FOLDED:NX.Scalar.BLOCK_LITERAL,J=v.source?fi(v.source):[],D=J.length;for(let W=J.length-1;W>=0;--W){let B=J[W][1];if(B===""||B==="\r")D=W;else break}if(D===0){let W=_.chomp==="+"&&J.length>0?`
70
- `.repeat(Math.max(1,J.length-1)):"",B=g+_.length;if(v.source)B+=v.source.length;return{value:W,type:b,comment:_.comment,range:[g,B,B]}}let X=v.indent+_.indent,G=v.offset+_.length,Y=0;for(let W=0;W<D;++W){let[B,j]=J[W];if(j===""||j==="\r"){if(_.indent===0&&B.length>X)X=B.length}else{if(B.length<X)w(G+B.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(_.indent===0)X=B.length;if(Y=W,X===0&&!$.atRoot)w(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=B.length+j.length+1}for(let W=J.length-1;W>=D;--W)if(J[W][0].length>X)D=W+1;let Q="",H="",I=!1;for(let W=0;W<Y;++W)Q+=J[W][0].slice(X)+`
71
- `;for(let W=Y;W<D;++W){let[B,j]=J[W];G+=B.length+j.length+1;let A=j[j.length-1]==="\r";if(A)j=j.slice(0,-1);if(j&&B.length<X){let C=`Block scalar lines must not be less indented than their ${_.indent?"explicit indentation indicator":"first line"}`;w(G-j.length-(A?2:1),"BAD_INDENT",C),B=""}if(b===NX.Scalar.BLOCK_LITERAL)Q+=H+B.slice(X)+j,H=`
72
- `;else if(B.length>X||j[0]==="\t"){if(H===" ")H=`
73
- `;else if(!I&&H===`
74
- `)H=`
75
-
76
- `;Q+=H+B.slice(X)+j,H=`
77
- `,I=!0}else if(j==="")if(H===`
62
+ `}};KN.YAMLError=m0;KN.YAMLParseError=iY;KN.YAMLWarning=nY;KN.prettifyError=FN});var Sg=E((nN)=>{function iN($,{flow:v,indicator:w,next:g,offset:_,onError:b,parentIndent:J,startOnNewline:D}){let X=!1,G=D,Y=D,Q="",W="",I=!1,H=!1,q=null,j=null,F=null,M=null,T=null,C=null,Z=null;for(let x of $){if(H){if(x.type!=="space"&&x.type!=="newline"&&x.type!=="comma")b(x.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");H=!1}if(q){if(G&&x.type!=="comment"&&x.type!=="newline")b(q,"TAB_AS_INDENT","Tabs are not allowed as indentation");q=null}switch(x.type){case"space":if(!v&&(w!=="doc-start"||g?.type!=="flow-collection")&&x.source.includes("\t"))q=x;Y=!0;break;case"comment":{if(!Y)b(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let X$=x.source.substring(1)||" ";if(!Q)Q=X$;else Q+=W+X$;W="",G=!1;break}case"newline":if(G){if(Q)Q+=x.source;else if(!C||w!=="seq-item-ind")X=!0}else W+=x.source;if(G=!0,I=!0,j||F)M=x;Y=!0;break;case"anchor":if(j)b(x,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(x.source.endsWith(":"))b(x.offset+x.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);j=x,Z??(Z=x.offset),G=!1,Y=!1,H=!0;break;case"tag":{if(F)b(x,"MULTIPLE_TAGS","A node can have at most one tag");F=x,Z??(Z=x.offset),G=!1,Y=!1,H=!0;break}case w:if(j||F)b(x,"BAD_PROP_ORDER",`Anchors and tags must be after the ${x.source} indicator`);if(C)b(x,"UNEXPECTED_TOKEN",`Unexpected ${x.source} in ${v??"collection"}`);C=x,G=w==="seq-item-ind"||w==="explicit-key-ind",Y=!1;break;case"comma":if(v){if(T)b(x,"UNEXPECTED_TOKEN",`Unexpected , in ${v}`);T=x,G=!1,Y=!1;break}default:b(x,"UNEXPECTED_TOKEN",`Unexpected ${x.type} token`),G=!1,Y=!1}}let S=$[$.length-1],c=S?S.offset+S.source.length:_;if(H&&g&&g.type!=="space"&&g.type!=="newline"&&g.type!=="comma"&&(g.type!=="scalar"||g.source!==""))b(g.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(q&&(G&&q.indent<=J||g?.type==="block-map"||g?.type==="block-seq"))b(q,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:T,found:C,spaceBefore:X,comment:Q,hasNewline:I,anchor:j,tag:F,newlineAfterProp:M,end:c,start:Z??c}}nN.resolveProps=iN});var r0=E((AN)=>{function KX($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
63
+ `))return!0;if($.end){for(let v of $.end)if(v.type==="newline")return!0}return!1;case"flow-collection":for(let v of $.items){for(let w of v.start)if(w.type==="newline")return!0;if(v.sep){for(let w of v.sep)if(w.type==="newline")return!0}if(KX(v.key)||KX(v.value))return!0}return!1;default:return!0}}AN.containsNewline=KX});var OX=E((TN)=>{var fN=r0();function SN($,v,w){if(v?.type==="flow-collection"){let g=v.end[0];if(g.indent===$&&(g.source==="]"||g.source==="}")&&fN.containsNewline(v))w(g,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}TN.flowIndentCheck=SN});var NX=E((CN)=>{var PY=_$();function RN($,v,w){let{uniqueKeys:g}=$.options;if(g===!1)return!1;let _=typeof g==="function"?g:(b,J)=>b===J||PY.isScalar(b)&&PY.isScalar(J)&&b.value===J.value;return v.some((b)=>_(b.key,w))}CN.mapIncludes=RN});var TY=E((cN)=>{var AY=K_(),ZN=N_(),MY=Sg(),hN=r0(),fY=OX(),xN=NX(),SY="All mapping items must start at the same column";function lN({composeNode:$,composeEmptyNode:v},w,g,_,b){let D=new(b?.nodeClass??ZN.YAMLMap)(w.schema);if(w.atRoot)w.atRoot=!1;let X=g.offset,G=null;for(let Y of g.items){let{start:Q,key:W,sep:I,value:H}=Y,q=MY.resolveProps(Q,{indicator:"explicit-key-ind",next:W??I?.[0],offset:X,onError:_,parentIndent:g.indent,startOnNewline:!0}),j=!q.found;if(j){if(W){if(W.type==="block-seq")_(X,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in W&&W.indent!==g.indent)_(X,"BAD_INDENT",SY)}if(!q.anchor&&!q.tag&&!I){if(G=q.end,q.comment)if(D.comment)D.comment+=`
64
+ `+q.comment;else D.comment=q.comment;continue}if(q.newlineAfterProp||hN.containsNewline(W))_(W??Q[Q.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(q.found?.indent!==g.indent)_(X,"BAD_INDENT",SY);w.atKey=!0;let F=q.end,M=W?$(w,W,q,_):v(w,F,Q,null,q,_);if(w.schema.compat)fY.flowIndentCheck(g.indent,W,_);if(w.atKey=!1,xN.mapIncludes(w,D.items,M))_(F,"DUPLICATE_KEY","Map keys must be unique");let T=MY.resolveProps(I??[],{indicator:"map-value-ind",next:H,offset:M.range[2],onError:_,parentIndent:g.indent,startOnNewline:!W||W.type==="block-scalar"});if(X=T.end,T.found){if(j){if(H?.type==="block-map"&&!T.hasNewline)_(X,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(w.options.strict&&q.start<T.found.offset-1024)_(M.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let C=H?$(w,H,T,_):v(w,X,I,null,T,_);if(w.schema.compat)fY.flowIndentCheck(g.indent,H,_);X=C.range[2];let Z=new AY.Pair(M,C);if(w.options.keepSourceTokens)Z.srcToken=Y;D.items.push(Z)}else{if(j)_(M.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(T.comment)if(M.comment)M.comment+=`
65
+ `+T.comment;else M.comment=T.comment;let C=new AY.Pair(M);if(w.options.keepSourceTokens)C.srcToken=Y;D.items.push(C)}}if(G&&G<X)_(G,"IMPOSSIBLE","Map comment with trailing content");return D.range=[g.offset,X,G??X],D}cN.resolveBlockMap=lN});var uY=E((tN)=>{var mN=k_(),rN=Sg(),oN=OX();function dN({composeNode:$,composeEmptyNode:v},w,g,_,b){let D=new(b?.nodeClass??mN.YAMLSeq)(w.schema);if(w.atRoot)w.atRoot=!1;if(w.atKey)w.atKey=!1;let X=g.offset,G=null;for(let{start:Y,value:Q}of g.items){let W=rN.resolveProps(Y,{indicator:"seq-item-ind",next:Q,offset:X,onError:_,parentIndent:g.indent,startOnNewline:!0});if(!W.found)if(W.anchor||W.tag||Q)if(Q?.type==="block-seq")_(W.end,"BAD_INDENT","All sequence items must start at the same column");else _(X,"MISSING_CHAR","Sequence item without - indicator");else{if(G=W.end,W.comment)D.comment=W.comment;continue}let I=Q?$(w,Q,W,_):v(w,W.end,Y,null,W,_);if(w.schema.compat)oN.flowIndentCheck(g.indent,Q,_);X=I.range[2],D.items.push(I)}return D.range=[g.offset,X,G??X],D}tN.resolveBlockSeq=dN});var V6=E((aN)=>{function eN($,v,w,g){let _="";if($){let b=!1,J="";for(let D of $){let{source:X,type:G}=D;switch(G){case"space":b=!0;break;case"comment":{if(w&&!b)g(D,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Y=X.substring(1)||" ";if(!_)_=Y;else _+=J+Y;J="";break}case"newline":if(_)J+=X;b=!0;break;default:g(D,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}v+=X.length}}return{comment:_,offset:v}}aN.resolveEnd=eN});var EY=E((Jk)=>{var $k=_$(),vk=K_(),RY=N_(),_k=k_(),wk=V6(),CY=Sg(),gk=r0(),bk=NX(),kX="Block collections are not allowed within flow collections",zX=($)=>$&&($.type==="block-map"||$.type==="block-seq");function Uk({composeNode:$,composeEmptyNode:v},w,g,_,b){let J=g.start.source==="{",D=J?"flow map":"flow sequence",G=new(b?.nodeClass??(J?RY.YAMLMap:_k.YAMLSeq))(w.schema);G.flow=!0;let Y=w.atRoot;if(Y)w.atRoot=!1;if(w.atKey)w.atKey=!1;let Q=g.offset+g.start.source.length;for(let j=0;j<g.items.length;++j){let F=g.items[j],{start:M,key:T,sep:C,value:Z}=F,S=CY.resolveProps(M,{flow:D,indicator:"explicit-key-ind",next:T??C?.[0],offset:Q,onError:_,parentIndent:g.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!C&&!Z){if(j===0&&S.comma)_(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${D}`);else if(j<g.items.length-1)_(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${D}`);if(S.comment)if(G.comment)G.comment+=`
66
+ `+S.comment;else G.comment=S.comment;Q=S.end;continue}if(!J&&w.options.strict&&gk.containsNewline(T))_(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===0){if(S.comma)_(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${D}`)}else{if(!S.comma)_(S.start,"MISSING_CHAR",`Missing , between ${D} items`);if(S.comment){let c="";$:for(let x of M)switch(x.type){case"comma":case"space":break;case"comment":c=x.source.substring(1);break $;default:break $}if(c){let x=G.items[G.items.length-1];if($k.isPair(x))x=x.value??x.key;if(x.comment)x.comment+=`
67
+ `+c;else x.comment=c;S.comment=S.comment.substring(c.length+1)}}}if(!J&&!C&&!S.found){let c=Z?$(w,Z,S,_):v(w,S.end,C,null,S,_);if(G.items.push(c),Q=c.range[2],zX(Z))_(c.range,"BLOCK_IN_FLOW",kX)}else{w.atKey=!0;let c=S.end,x=T?$(w,T,S,_):v(w,c,M,null,S,_);if(zX(T))_(x.range,"BLOCK_IN_FLOW",kX);w.atKey=!1;let X$=CY.resolveProps(C??[],{flow:D,indicator:"map-value-ind",next:Z,offset:x.range[2],onError:_,parentIndent:g.indent,startOnNewline:!1});if(X$.found){if(!J&&!S.found&&w.options.strict){if(C)for(let j$ of C){if(j$===X$.found)break;if(j$.type==="newline"){_(j$,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(S.start<X$.found.offset-1024)_(X$.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(Z)if("source"in Z&&Z.source?.[0]===":")_(Z,"MISSING_CHAR",`Missing space after : in ${D}`);else _(X$.start,"MISSING_CHAR",`Missing , or : between ${D} items`);let s$=Z?$(w,Z,X$,_):X$.found?v(w,X$.end,C,null,X$,_):null;if(s$){if(zX(Z))_(s$.range,"BLOCK_IN_FLOW",kX)}else if(X$.comment)if(x.comment)x.comment+=`
68
+ `+X$.comment;else x.comment=X$.comment;let Qw=new vk.Pair(x,s$);if(w.options.keepSourceTokens)Qw.srcToken=F;if(J){let j$=G;if(bk.mapIncludes(w,j$.items,x))_(c,"DUPLICATE_KEY","Map keys must be unique");j$.items.push(Qw)}else{let j$=new RY.YAMLMap(w.schema);j$.flow=!0,j$.items.push(Qw);let wG=(s$??x).range;j$.range=[x.range[0],wG[1],wG[2]],G.items.push(j$)}Q=s$?s$.range[2]:X$.end}}let W=J?"}":"]",[I,...H]=g.end,q=Q;if(I?.source===W)q=I.offset+I.source.length;else{let j=D[0].toUpperCase()+D.substring(1),F=Y?`${j} must end with a ${W}`:`${j} in block collection must be sufficiently indented and end with a ${W}`;if(_(Q,Y?"MISSING_CHAR":"BAD_INDENT",F),I&&I.source.length!==1)H.unshift(I)}if(H.length>0){let j=wk.resolveEnd(H,q,w.options.strict,_);if(j.comment)if(G.comment)G.comment+=`
69
+ `+j.comment;else G.comment=j.comment;G.range=[g.offset,q,j.offset]}else G.range=[g.offset,q,q];return G}Jk.resolveFlowCollection=Uk});var ZY=E((Bk)=>{var Xk=_$(),Gk=V$(),Yk=N_(),Qk=k_(),Wk=TY(),Hk=uY(),qk=EY();function iX($,v,w,g,_,b){let J=w.type==="block-map"?Wk.resolveBlockMap($,v,w,g,b):w.type==="block-seq"?Hk.resolveBlockSeq($,v,w,g,b):qk.resolveFlowCollection($,v,w,g,b),D=J.constructor;if(_==="!"||_===D.tagName)return J.tag=D.tagName,J;if(_)J.tag=_;return J}function Ik($,v,w,g,_){let b=g.tag,J=!b?null:v.directives.tagName(b.source,(W)=>_(b,"TAG_RESOLVE_FAILED",W));if(w.type==="block-seq"){let{anchor:W,newlineAfterProp:I}=g,H=W&&b?W.offset>b.offset?W:b:W??b;if(H&&(!I||I.offset<H.offset))_(H,"MISSING_CHAR","Missing newline after block sequence props")}let D=w.type==="block-map"?"map":w.type==="block-seq"?"seq":w.start.source==="{"?"map":"seq";if(!b||!J||J==="!"||J===Yk.YAMLMap.tagName&&D==="map"||J===Qk.YAMLSeq.tagName&&D==="seq")return iX($,v,w,_,J);let X=v.schema.tags.find((W)=>W.tag===J&&W.collection===D);if(!X){let W=v.schema.knownTags[J];if(W?.collection===D)v.schema.tags.push(Object.assign({},W,{default:!1})),X=W;else{if(W)_(b,"BAD_COLLECTION_TYPE",`${W.tag} used for ${D} collection, but expects ${W.collection??"scalar"}`,!0);else _(b,"TAG_RESOLVE_FAILED",`Unresolved tag: ${J}`,!0);return iX($,v,w,_,J)}}let G=iX($,v,w,_,J,X),Y=X.resolve?.(G,(W)=>_(b,"TAG_RESOLVE_FAILED",W),v.options)??G,Q=Xk.isNode(Y)?Y:new Gk.Scalar(Y);if(Q.range=G.range,Q.tag=J,X?.format)Q.format=X.format;return Q}Bk.composeCollection=Ik});var PX=E((Kk)=>{var nX=V$();function Vk($,v,w){let g=v.offset,_=jk(v,$.options.strict,w);if(!_)return{value:"",type:null,comment:"",range:[g,g,g]};let b=_.mode===">"?nX.Scalar.BLOCK_FOLDED:nX.Scalar.BLOCK_LITERAL,J=v.source?Fk(v.source):[],D=J.length;for(let q=J.length-1;q>=0;--q){let j=J[q][1];if(j===""||j==="\r")D=q;else break}if(D===0){let q=_.chomp==="+"&&J.length>0?`
70
+ `.repeat(Math.max(1,J.length-1)):"",j=g+_.length;if(v.source)j+=v.source.length;return{value:q,type:b,comment:_.comment,range:[g,j,j]}}let X=v.indent+_.indent,G=v.offset+_.length,Y=0;for(let q=0;q<D;++q){let[j,F]=J[q];if(F===""||F==="\r"){if(_.indent===0&&j.length>X)X=j.length}else{if(j.length<X)w(G+j.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(_.indent===0)X=j.length;if(Y=q,X===0&&!$.atRoot)w(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=j.length+F.length+1}for(let q=J.length-1;q>=D;--q)if(J[q][0].length>X)D=q+1;let Q="",W="",I=!1;for(let q=0;q<Y;++q)Q+=J[q][0].slice(X)+`
71
+ `;for(let q=Y;q<D;++q){let[j,F]=J[q];G+=j.length+F.length+1;let M=F[F.length-1]==="\r";if(M)F=F.slice(0,-1);if(F&&j.length<X){let C=`Block scalar lines must not be less indented than their ${_.indent?"explicit indentation indicator":"first line"}`;w(G-F.length-(M?2:1),"BAD_INDENT",C),j=""}if(b===nX.Scalar.BLOCK_LITERAL)Q+=W+j.slice(X)+F,W=`
72
+ `;else if(j.length>X||F[0]==="\t"){if(W===" ")W=`
73
+ `;else if(!I&&W===`
74
+ `)W=`
75
+
76
+ `;Q+=W+j.slice(X)+F,W=`
77
+ `,I=!0}else if(F==="")if(W===`
78
78
  `)Q+=`
79
- `;else H=`
80
- `;else Q+=H+j,H=" ",I=!1}switch(_.chomp){case"-":break;case"+":for(let W=D;W<J.length;++W)Q+=`
81
- `+J[W][0].slice(X);if(Q[Q.length-1]!==`
79
+ `;else W=`
80
+ `;else Q+=W+F,W=" ",I=!1}switch(_.chomp){case"-":break;case"+":for(let q=D;q<J.length;++q)Q+=`
81
+ `+J[q][0].slice(X);if(Q[Q.length-1]!==`
82
82
  `)Q+=`
83
83
  `;break;default:Q+=`
84
- `}let q=g+_.length+v.source.length;return{value:Q,type:b,comment:_.comment,range:[g,q,q]}}function Pi({offset:$,props:v},w,g){if(v[0].type!=="block-scalar-header")return g(v[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:_}=v[0],b=_[0],J=0,D="",X=-1;for(let H=1;H<_.length;++H){let I=_[H];if(!D&&(I==="-"||I==="+"))D=I;else{let q=Number(I);if(!J&&q)J=q;else if(X===-1)X=$+H}}if(X!==-1)g(X,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${_}`);let G=!1,Y="",Q=_.length;for(let H=1;H<v.length;++H){let I=v[H];switch(I.type){case"space":G=!0;case"newline":Q+=I.source.length;break;case"comment":if(w&&!G)g(I,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");Q+=I.source.length,Y=I.source.substring(1);break;case"error":g(I,"UNEXPECTED_TOKEN",I.message),Q+=I.source.length;break;default:{let q=`Unexpected token in block scalar header: ${I.type}`;g(I,"UNEXPECTED_TOKEN",q);let W=I.source;if(W&&typeof W==="string")Q+=W.length}}}return{mode:b,indent:J,chomp:D,comment:Y,length:Q}}function fi($){let v=$.split(/\n( *)/),w=v[0],g=w.match(/^( *)/),b=[g?.[1]?[g[1],w.slice(g[1].length)]:["",w]];for(let J=1;J<v.length;J+=2)b.push([v[J],v[J+1]]);return b}Ai.resolveBlockScalar=Ni});var AX=E((xi)=>{var fX=L$(),zi=B6();function Si($,v,w){let{offset:g,type:_,source:b,end:J}=$,D,X,G=(H,I,q)=>w(g+H,I,q);switch(_){case"scalar":D=fX.Scalar.PLAIN,X=ui(b,G);break;case"single-quoted-scalar":D=fX.Scalar.QUOTE_SINGLE,X=Ti(b,G);break;case"double-quoted-scalar":D=fX.Scalar.QUOTE_DOUBLE,X=Ri(b,G);break;default:return w($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${_}`),{value:"",type:null,comment:"",range:[g,g+b.length,g+b.length]}}let Y=g+b.length,Q=zi.resolveEnd(J,Y,v,w);return{value:X,type:D,comment:Q.comment,range:[g,Y,Q.offset]}}function ui($,v){let w="";switch($[0]){case"\t":w="a tab character";break;case",":w="flow indicator character ,";break;case"%":w="directive indicator character %";break;case"|":case">":{w=`block scalar indicator ${$[0]}`;break}case"@":case"`":{w=`reserved character ${$[0]}`;break}}if(w)v(0,"BAD_SCALAR_START",`Plain value cannot start with ${w}`);return T7($)}function Ti($,v){if($[$.length-1]!=="'"||$.length===1)v($.length,"MISSING_CHAR","Missing closing 'quote");return T7($.slice(1,-1)).replace(/''/g,"'")}function T7($){let v,w;try{v=new RegExp(`(.*?)(?<![ ])[ ]*\r?
84
+ `}let H=g+_.length+v.source.length;return{value:Q,type:b,comment:_.comment,range:[g,H,H]}}function jk({offset:$,props:v},w,g){if(v[0].type!=="block-scalar-header")return g(v[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:_}=v[0],b=_[0],J=0,D="",X=-1;for(let W=1;W<_.length;++W){let I=_[W];if(!D&&(I==="-"||I==="+"))D=I;else{let H=Number(I);if(!J&&H)J=H;else if(X===-1)X=$+W}}if(X!==-1)g(X,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${_}`);let G=!1,Y="",Q=_.length;for(let W=1;W<v.length;++W){let I=v[W];switch(I.type){case"space":G=!0;case"newline":Q+=I.source.length;break;case"comment":if(w&&!G)g(I,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");Q+=I.source.length,Y=I.source.substring(1);break;case"error":g(I,"UNEXPECTED_TOKEN",I.message),Q+=I.source.length;break;default:{let H=`Unexpected token in block scalar header: ${I.type}`;g(I,"UNEXPECTED_TOKEN",H);let q=I.source;if(q&&typeof q==="string")Q+=q.length}}}return{mode:b,indent:J,chomp:D,comment:Y,length:Q}}function Fk($){let v=$.split(/\n( *)/),w=v[0],g=w.match(/^( *)/),b=[g?.[1]?[g[1],w.slice(g[1].length)]:["",w]];for(let J=1;J<v.length;J+=2)b.push([v[J],v[J+1]]);return b}Kk.resolveBlockScalar=Vk});var MX=E((fk)=>{var AX=V$(),Nk=V6();function kk($,v,w){let{offset:g,type:_,source:b,end:J}=$,D,X,G=(W,I,H)=>w(g+W,I,H);switch(_){case"scalar":D=AX.Scalar.PLAIN,X=zk(b,G);break;case"single-quoted-scalar":D=AX.Scalar.QUOTE_SINGLE,X=ik(b,G);break;case"double-quoted-scalar":D=AX.Scalar.QUOTE_DOUBLE,X=nk(b,G);break;default:return w($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${_}`),{value:"",type:null,comment:"",range:[g,g+b.length,g+b.length]}}let Y=g+b.length,Q=Nk.resolveEnd(J,Y,v,w);return{value:X,type:D,comment:Q.comment,range:[g,Y,Q.offset]}}function zk($,v){let w="";switch($[0]){case"\t":w="a tab character";break;case",":w="flow indicator character ,";break;case"%":w="directive indicator character %";break;case"|":case">":{w=`block scalar indicator ${$[0]}`;break}case"@":case"`":{w=`reserved character ${$[0]}`;break}}if(w)v(0,"BAD_SCALAR_START",`Plain value cannot start with ${w}`);return hY($)}function ik($,v){if($[$.length-1]!=="'"||$.length===1)v($.length,"MISSING_CHAR","Missing closing 'quote");return hY($.slice(1,-1)).replace(/''/g,"'")}function hY($){let v,w;try{v=new RegExp(`(.*?)(?<![ ])[ ]*\r?
85
85
  `,"sy"),w=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
86
86
  `,"sy")}catch{v=/(.*?)[ \t]*\r?\n/sy,w=/[ \t]*(.*?)[ \t]*\r?\n/sy}let g=v.exec($);if(!g)return $;let _=g[1],b=" ",J=v.lastIndex;w.lastIndex=J;while(g=w.exec($)){if(g[1]==="")if(b===`
87
87
  `)_+=b;else b=`
88
- `;else _+=b+g[1],b=" ";J=w.lastIndex}let D=/[ \t]*(.*)/sy;return D.lastIndex=J,g=D.exec($),_+b+(g?.[1]??"")}function Ri($,v){let w="";for(let g=1;g<$.length-1;++g){let _=$[g];if(_==="\r"&&$[g+1]===`
88
+ `;else _+=b+g[1],b=" ";J=w.lastIndex}let D=/[ \t]*(.*)/sy;return D.lastIndex=J,g=D.exec($),_+b+(g?.[1]??"")}function nk($,v){let w="";for(let g=1;g<$.length-1;++g){let _=$[g];if(_==="\r"&&$[g+1]===`
89
89
  `)continue;if(_===`
90
- `){let{fold:b,offset:J}=Ci($,g);w+=b,g=J}else if(_==="\\"){let b=$[++g],J=Ei[b];if(J)w+=J;else if(b===`
90
+ `){let{fold:b,offset:J}=Pk($,g);w+=b,g=J}else if(_==="\\"){let b=$[++g],J=Ak[b];if(J)w+=J;else if(b===`
91
91
  `){b=$[g+1];while(b===" "||b==="\t")b=$[++g+1]}else if(b==="\r"&&$[g+1]===`
92
- `){b=$[++g+1];while(b===" "||b==="\t")b=$[++g+1]}else if(b==="x"||b==="u"||b==="U"){let D={x:2,u:4,U:8}[b];w+=Zi($,g+1,D,v),g+=D}else{let D=$.substr(g-1,2);v(g-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${D}`),w+=D}}else if(_===" "||_==="\t"){let b=g,J=$[g+1];while(J===" "||J==="\t")J=$[++g+1];if(J!==`
92
+ `){b=$[++g+1];while(b===" "||b==="\t")b=$[++g+1]}else if(b==="x"||b==="u"||b==="U"){let D={x:2,u:4,U:8}[b];w+=Mk($,g+1,D,v),g+=D}else{let D=$.substr(g-1,2);v(g-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${D}`),w+=D}}else if(_===" "||_==="\t"){let b=g,J=$[g+1];while(J===" "||J==="\t")J=$[++g+1];if(J!==`
93
93
  `&&!(J==="\r"&&$[g+2]===`
94
- `))w+=g>b?$.slice(b,g+1):_}else w+=_}if($[$.length-1]!=='"'||$.length===1)v($.length,"MISSING_CHAR",'Missing closing "quote');return w}function Ci($,v){let w="",g=$[v+1];while(g===" "||g==="\t"||g===`
94
+ `))w+=g>b?$.slice(b,g+1):_}else w+=_}if($[$.length-1]!=='"'||$.length===1)v($.length,"MISSING_CHAR",'Missing closing "quote');return w}function Pk($,v){let w="",g=$[v+1];while(g===" "||g==="\t"||g===`
95
95
  `||g==="\r"){if(g==="\r"&&$[v+2]!==`
96
96
  `)break;if(g===`
97
97
  `)w+=`
98
- `;v+=1,g=$[v+1]}if(!w)w=" ";return{fold:w,offset:v}}var Ei={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
99
- `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Zi($,v,w,g){let _=$.substr(v,w),J=_.length===w&&/^[0-9a-fA-F]+$/.test(_)?parseInt(_,16):NaN;if(isNaN(J)){let D=$.substr(v-2,w+2);return g(v-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${D}`),D}return String.fromCodePoint(J)}xi.resolveFlowScalar=Si});var C7=E((oi)=>{var vw=_$(),R7=L$(),hi=PX(),ci=AX();function yi($,v,w,g){let{value:_,type:b,comment:J,range:D}=v.type==="block-scalar"?hi.resolveBlockScalar($,v,g):ci.resolveFlowScalar(v,$.options.strict,g),X=w?$.directives.tagName(w.source,(Q)=>g(w,"TAG_RESOLVE_FAILED",Q)):null,G;if($.options.stringKeys&&$.atKey)G=$.schema[vw.SCALAR];else if(X)G=mi($.schema,_,X,w,g);else if(v.type==="scalar")G=ri($,_,v,g);else G=$.schema[vw.SCALAR];let Y;try{let Q=G.resolve(_,(H)=>g(w??v,"TAG_RESOLVE_FAILED",H),$.options);Y=vw.isScalar(Q)?Q:new R7.Scalar(Q)}catch(Q){let H=Q instanceof Error?Q.message:String(Q);g(w??v,"TAG_RESOLVE_FAILED",H),Y=new R7.Scalar(_)}if(Y.range=D,Y.source=_,b)Y.type=b;if(X)Y.tag=X;if(G.format)Y.format=G.format;if(J)Y.comment=J;return Y}function mi($,v,w,g,_){if(w==="!")return $[vw.SCALAR];let b=[];for(let D of $.tags)if(!D.collection&&D.tag===w)if(D.default&&D.test)b.push(D);else return D;for(let D of b)if(D.test?.test(v))return D;let J=$.knownTags[w];if(J&&!J.collection)return $.tags.push(Object.assign({},J,{default:!1,test:void 0})),J;return _(g,"TAG_RESOLVE_FAILED",`Unresolved tag: ${w}`,w!=="tag:yaml.org,2002:str"),$[vw.SCALAR]}function ri({atKey:$,directives:v,schema:w},g,_,b){let J=w.tags.find((D)=>(D.default===!0||$&&D.default==="key")&&D.test?.test(g))||w[vw.SCALAR];if(w.compat){let D=w.compat.find((X)=>X.default&&X.test?.test(g))??w[vw.SCALAR];if(J.tag!==D.tag){let X=v.tagString(J.tag),G=v.tagString(D.tag),Y=`Value may be parsed as either ${X} or ${G}`;b(_,"TAG_RESOLVE_FAILED",Y,!0)}}return J}oi.composeScalar=yi});var E7=E((pi)=>{function di($,v,w){if(v){w??(w=v.length);for(let g=w-1;g>=0;--g){let _=v[g];switch(_.type){case"space":case"comment":case"newline":$-=_.source.length;continue}_=v[++g];while(_?.type==="space")$+=_.source.length,_=v[++g];break}}return $}pi.emptyScalarPosition=di});var l7=E((bk)=>{var ai=ng(),si=_$(),$k=u7(),Z7=C7(),vk=B6(),_k=E7(),wk={composeNode:x7,composeEmptyNode:MX};function x7($,v,w,g){let _=$.atKey,{spaceBefore:b,comment:J,anchor:D,tag:X}=w,G,Y=!0;switch(v.type){case"alias":if(G=gk($,v,g),D||X)g(v,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(G=Z7.composeScalar($,v,X,g),D)G.anchor=D.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=$k.composeCollection(wk,$,v,w,g),D)G.anchor=D.source.substring(1);break;default:{let Q=v.type==="error"?v.message:`Unsupported token (type: ${v.type})`;g(v,"UNEXPECTED_TOKEN",Q),G=MX($,v.offset,void 0,null,w,g),Y=!1}}if(D&&G.anchor==="")g(D,"BAD_ALIAS","Anchor cannot be an empty string");if(_&&$.options.stringKeys&&(!si.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))g(X??v,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(b)G.spaceBefore=!0;if(J)if(v.type==="scalar"&&v.source==="")G.comment=J;else G.commentBefore=J;if($.options.keepSourceTokens&&Y)G.srcToken=v;return G}function MX($,v,w,g,{spaceBefore:_,comment:b,anchor:J,tag:D,end:X},G){let Y={type:"scalar",offset:_k.emptyScalarPosition(v,w,g),indent:-1,source:""},Q=Z7.composeScalar($,Y,D,G);if(J){if(Q.anchor=J.source.substring(1),Q.anchor==="")G(J,"BAD_ALIAS","Anchor cannot be an empty string")}if(_)Q.spaceBefore=!0;if(b)Q.comment=b,Q.range[2]=X;return Q}function gk({options:$},{offset:v,source:w,end:g},_){let b=new ai.Alias(w.substring(1));if(b.source==="")_(v,"BAD_ALIAS","Alias cannot be an empty string");if(b.source.endsWith(":"))_(v+w.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let J=v+w.length,D=vk.resolveEnd(g,J,$.strict,_);if(b.range=[v,J,D.offset],D.comment)b.comment=D.comment;return b}bk.composeEmptyNode=MX;bk.composeNode=x7});var c7=E((Qk)=>{var Dk=Ag(),h7=l7(),Xk=B6(),Gk=zg();function Yk($,v,{offset:w,start:g,value:_,end:b},J){let D=Object.assign({_directives:v},$),X=new Dk.Document(void 0,D),G={atKey:!1,atRoot:!0,directives:X.directives,options:X.options,schema:X.schema},Y=Gk.resolveProps(g,{indicator:"doc-start",next:_??b?.[0],offset:w,onError:J,parentIndent:0,startOnNewline:!0});if(Y.found){if(X.directives.docStart=!0,_&&(_.type==="block-map"||_.type==="block-seq")&&!Y.hasNewline)J(Y.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}X.contents=_?h7.composeNode(G,_,Y,J):h7.composeEmptyNode(G,Y.end,g,null,Y,J);let Q=X.contents.range[2],H=Xk.resolveEnd(b,Q,!1,J);if(H.comment)X.comment=H.comment;return X.range=[w,Q,H.offset],X}Qk.composeDoc=Yk});var zX=E((Lk)=>{var Hk=Qw("process"),nk=RD(),qk=Ag(),Sg=Mg(),y7=_$(),Ik=c7(),Bk=B6();function ug($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:v,source:w}=$;return[v,v+(typeof w==="string"?w.length:1)]}function m7($){let v="",w=!1,g=!1;for(let _=0;_<$.length;++_){let b=$[_];switch(b[0]){case"#":v+=(v===""?"":g?`
98
+ `;v+=1,g=$[v+1]}if(!w)w=" ";return{fold:w,offset:v}}var Ak={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
99
+ `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Mk($,v,w,g){let _=$.substr(v,w),J=_.length===w&&/^[0-9a-fA-F]+$/.test(_)?parseInt(_,16):NaN;if(isNaN(J)){let D=$.substr(v-2,w+2);return g(v-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${D}`),D}return String.fromCodePoint(J)}fk.resolveFlowScalar=kk});var lY=E((Zk)=>{var vw=_$(),xY=V$(),Tk=PX(),uk=MX();function Rk($,v,w,g){let{value:_,type:b,comment:J,range:D}=v.type==="block-scalar"?Tk.resolveBlockScalar($,v,g):uk.resolveFlowScalar(v,$.options.strict,g),X=w?$.directives.tagName(w.source,(Q)=>g(w,"TAG_RESOLVE_FAILED",Q)):null,G;if($.options.stringKeys&&$.atKey)G=$.schema[vw.SCALAR];else if(X)G=Ck($.schema,_,X,w,g);else if(v.type==="scalar")G=Ek($,_,v,g);else G=$.schema[vw.SCALAR];let Y;try{let Q=G.resolve(_,(W)=>g(w??v,"TAG_RESOLVE_FAILED",W),$.options);Y=vw.isScalar(Q)?Q:new xY.Scalar(Q)}catch(Q){let W=Q instanceof Error?Q.message:String(Q);g(w??v,"TAG_RESOLVE_FAILED",W),Y=new xY.Scalar(_)}if(Y.range=D,Y.source=_,b)Y.type=b;if(X)Y.tag=X;if(G.format)Y.format=G.format;if(J)Y.comment=J;return Y}function Ck($,v,w,g,_){if(w==="!")return $[vw.SCALAR];let b=[];for(let D of $.tags)if(!D.collection&&D.tag===w)if(D.default&&D.test)b.push(D);else return D;for(let D of b)if(D.test?.test(v))return D;let J=$.knownTags[w];if(J&&!J.collection)return $.tags.push(Object.assign({},J,{default:!1,test:void 0})),J;return _(g,"TAG_RESOLVE_FAILED",`Unresolved tag: ${w}`,w!=="tag:yaml.org,2002:str"),$[vw.SCALAR]}function Ek({atKey:$,directives:v,schema:w},g,_,b){let J=w.tags.find((D)=>(D.default===!0||$&&D.default==="key")&&D.test?.test(g))||w[vw.SCALAR];if(w.compat){let D=w.compat.find((X)=>X.default&&X.test?.test(g))??w[vw.SCALAR];if(J.tag!==D.tag){let X=v.tagString(J.tag),G=v.tagString(D.tag),Y=`Value may be parsed as either ${X} or ${G}`;b(_,"TAG_RESOLVE_FAILED",Y,!0)}}return J}Zk.composeScalar=Rk});var cY=E((lk)=>{function xk($,v,w){if(v){w??(w=v.length);for(let g=w-1;g>=0;--g){let _=v[g];switch(_.type){case"space":case"comment":case"newline":$-=_.source.length;continue}_=v[++g];while(_?.type==="space")$+=_.source.length,_=v[++g];break}}return $}lk.emptyScalarPosition=xk});var rY=E((ek)=>{var yk=Ig(),mk=_$(),rk=ZY(),yY=lY(),ok=V6(),dk=cY(),tk={composeNode:mY,composeEmptyNode:fX};function mY($,v,w,g){let _=$.atKey,{spaceBefore:b,comment:J,anchor:D,tag:X}=w,G,Y=!0;switch(v.type){case"alias":if(G=pk($,v,g),D||X)g(v,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(G=yY.composeScalar($,v,X,g),D)G.anchor=D.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=rk.composeCollection(tk,$,v,w,g),D)G.anchor=D.source.substring(1);break;default:{let Q=v.type==="error"?v.message:`Unsupported token (type: ${v.type})`;g(v,"UNEXPECTED_TOKEN",Q),G=fX($,v.offset,void 0,null,w,g),Y=!1}}if(D&&G.anchor==="")g(D,"BAD_ALIAS","Anchor cannot be an empty string");if(_&&$.options.stringKeys&&(!mk.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))g(X??v,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(b)G.spaceBefore=!0;if(J)if(v.type==="scalar"&&v.source==="")G.comment=J;else G.commentBefore=J;if($.options.keepSourceTokens&&Y)G.srcToken=v;return G}function fX($,v,w,g,{spaceBefore:_,comment:b,anchor:J,tag:D,end:X},G){let Y={type:"scalar",offset:dk.emptyScalarPosition(v,w,g),indent:-1,source:""},Q=yY.composeScalar($,Y,D,G);if(J){if(Q.anchor=J.source.substring(1),Q.anchor==="")G(J,"BAD_ALIAS","Anchor cannot be an empty string")}if(_)Q.spaceBefore=!0;if(b)Q.comment=b,Q.range[2]=X;return Q}function pk({options:$},{offset:v,source:w,end:g},_){let b=new yk.Alias(w.substring(1));if(b.source==="")_(v,"BAD_ALIAS","Alias cannot be an empty string");if(b.source.endsWith(":"))_(v+w.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let J=v+w.length,D=ok.resolveEnd(g,J,$.strict,_);if(b.range=[v,J,D.offset],D.comment)b.comment=D.comment;return b}ek.composeEmptyNode=fX;ek.composeNode=mY});var dY=E((gz)=>{var $z=Mg(),oY=rY(),vz=V6(),_z=Sg();function wz($,v,{offset:w,start:g,value:_,end:b},J){let D=Object.assign({_directives:v},$),X=new $z.Document(void 0,D),G={atKey:!1,atRoot:!0,directives:X.directives,options:X.options,schema:X.schema},Y=_z.resolveProps(g,{indicator:"doc-start",next:_??b?.[0],offset:w,onError:J,parentIndent:0,startOnNewline:!0});if(Y.found){if(X.directives.docStart=!0,_&&(_.type==="block-map"||_.type==="block-seq")&&!Y.hasNewline)J(Y.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}X.contents=_?oY.composeNode(G,_,Y,J):oY.composeEmptyNode(G,Y.end,g,null,Y,J);let Q=X.contents.range[2],W=vz.resolveEnd(b,Q,!1,J);if(W.comment)X.comment=W.comment;return X.range=[w,Q,W.offset],X}gz.composeDoc=wz});var SX=E((Yz)=>{var Uz=Ww("process"),Jz=CD(),Dz=Mg(),Tg=fg(),tY=_$(),Xz=dY(),Gz=V6();function ug($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:v,source:w}=$;return[v,v+(typeof w==="string"?w.length:1)]}function pY($){let v="",w=!1,g=!1;for(let _=0;_<$.length;++_){let b=$[_];switch(b[0]){case"#":v+=(v===""?"":g?`
100
100
 
101
101
  `:`
102
- `)+(b.substring(1)||" "),w=!0,g=!1;break;case"%":if($[_+1]?.[0]!=="#")_+=1;w=!1;break;default:if(!w)g=!0;w=!1}}return{comment:v,afterEmptyLine:g}}class r7{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(v,w,g,_)=>{let b=ug(v);if(_)this.warnings.push(new Sg.YAMLWarning(b,w,g));else this.errors.push(new Sg.YAMLParseError(b,w,g))},this.directives=new nk.Directives({version:$.version||"1.2"}),this.options=$}decorate($,v){let{comment:w,afterEmptyLine:g}=m7(this.prelude);if(w){let _=$.contents;if(v)$.comment=$.comment?`${$.comment}
103
- ${w}`:w;else if(g||$.directives.docStart||!_)$.commentBefore=w;else if(y7.isCollection(_)&&!_.flow&&_.items.length>0){let b=_.items[0];if(y7.isPair(b))b=b.key;let J=b.commentBefore;b.commentBefore=J?`${w}
102
+ `)+(b.substring(1)||" "),w=!0,g=!1;break;case"%":if($[_+1]?.[0]!=="#")_+=1;w=!1;break;default:if(!w)g=!0;w=!1}}return{comment:v,afterEmptyLine:g}}class eY{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(v,w,g,_)=>{let b=ug(v);if(_)this.warnings.push(new Tg.YAMLWarning(b,w,g));else this.errors.push(new Tg.YAMLParseError(b,w,g))},this.directives=new Jz.Directives({version:$.version||"1.2"}),this.options=$}decorate($,v){let{comment:w,afterEmptyLine:g}=pY(this.prelude);if(w){let _=$.contents;if(v)$.comment=$.comment?`${$.comment}
103
+ ${w}`:w;else if(g||$.directives.docStart||!_)$.commentBefore=w;else if(tY.isCollection(_)&&!_.flow&&_.items.length>0){let b=_.items[0];if(tY.isPair(b))b=b.key;let J=b.commentBefore;b.commentBefore=J?`${w}
104
104
  ${J}`:w}else{let b=_.commentBefore;_.commentBefore=b?`${w}
105
- ${b}`:w}}if(v)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:m7(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,v=!1,w=-1){for(let g of $)yield*this.next(g);yield*this.end(v,w)}*next($){if(Hk.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(v,w,g)=>{let _=ug($);_[0]+=v,this.onError(_,"BAD_DIRECTIVE",w,g)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let v=Ik.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!v.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(v,!1),this.doc)yield this.doc;this.doc=v,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let v=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,w=new Sg.YAMLParseError(ug($),"UNEXPECTED_TOKEN",v);if(this.atDirectives||!this.doc)this.errors.push(w);else this.doc.errors.push(w);break}case"doc-end":{if(!this.doc){this.errors.push(new Sg.YAMLParseError(ug($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let v=Bk.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),v.comment){let w=this.doc.comment;this.doc.comment=w?`${w}
106
- ${v.comment}`:v.comment}this.doc.range[2]=v.offset;break}default:this.errors.push(new Sg.YAMLParseError(ug($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,v=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let w=Object.assign({_directives:this.directives},this.options),g=new qk.Document(void 0,w);if(this.atDirectives)this.onError(v,"MISSING_CHAR","Missing directives-end indicator line");g.range=[0,v,v],this.decorate(g,!1),yield g}}}Lk.Composer=r7});var d7=E((Pk)=>{var jk=PX(),Fk=AX(),Kk=Mg(),o7=Lg();function Ok($,v=!0,w){if($){let g=(_,b,J)=>{let D=typeof _==="number"?_:Array.isArray(_)?_[0]:_.offset;if(w)w(D,b,J);else throw new Kk.YAMLParseError([D,D+1],b,J)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Fk.resolveFlowScalar($,v,g);case"block-scalar":return jk.resolveBlockScalar({options:{strict:v}},$,g)}}return null}function ik($,v){let{implicitKey:w=!1,indent:g,inFlow:_=!1,offset:b=-1,type:J="PLAIN"}=v,D=o7.stringifyString({type:J,value:$},{implicitKey:w,indent:g>0?" ".repeat(g):"",inFlow:_,options:{blockQuote:!0,lineWidth:-1}}),X=v.end??[{type:"newline",offset:-1,indent:g,source:`
105
+ ${b}`:w}}if(v)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:pY(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,v=!1,w=-1){for(let g of $)yield*this.next(g);yield*this.end(v,w)}*next($){if(Uz.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(v,w,g)=>{let _=ug($);_[0]+=v,this.onError(_,"BAD_DIRECTIVE",w,g)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let v=Xz.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!v.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(v,!1),this.doc)yield this.doc;this.doc=v,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let v=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,w=new Tg.YAMLParseError(ug($),"UNEXPECTED_TOKEN",v);if(this.atDirectives||!this.doc)this.errors.push(w);else this.doc.errors.push(w);break}case"doc-end":{if(!this.doc){this.errors.push(new Tg.YAMLParseError(ug($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let v=Gz.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),v.comment){let w=this.doc.comment;this.doc.comment=w?`${w}
106
+ ${v.comment}`:v.comment}this.doc.range[2]=v.offset;break}default:this.errors.push(new Tg.YAMLParseError(ug($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,v=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let w=Object.assign({_directives:this.directives},this.options),g=new Dz.Document(void 0,w);if(this.atDirectives)this.onError(v,"MISSING_CHAR","Missing directives-end indicator line");g.range=[0,v,v],this.decorate(g,!1),yield g}}}Yz.Composer=eY});var $7=E((jz)=>{var Wz=PX(),Hz=MX(),qz=fg(),aY=jg();function Iz($,v=!0,w){if($){let g=(_,b,J)=>{let D=typeof _==="number"?_:Array.isArray(_)?_[0]:_.offset;if(w)w(D,b,J);else throw new qz.YAMLParseError([D,D+1],b,J)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Hz.resolveFlowScalar($,v,g);case"block-scalar":return Wz.resolveBlockScalar({options:{strict:v}},$,g)}}return null}function Bz($,v){let{implicitKey:w=!1,indent:g,inFlow:_=!1,offset:b=-1,type:J="PLAIN"}=v,D=aY.stringifyString({type:J,value:$},{implicitKey:w,indent:g>0?" ".repeat(g):"",inFlow:_,options:{blockQuote:!0,lineWidth:-1}}),X=v.end??[{type:"newline",offset:-1,indent:g,source:`
107
107
  `}];switch(D[0]){case"|":case">":{let G=D.indexOf(`
108
108
  `),Y=D.substring(0,G),Q=D.substring(G+1)+`
109
- `,H=[{type:"block-scalar-header",offset:b,indent:g,source:Y}];if(!t7(H,X))H.push({type:"newline",offset:-1,indent:g,source:`
110
- `});return{type:"block-scalar",offset:b,indent:g,props:H,source:Q}}case'"':return{type:"double-quoted-scalar",offset:b,indent:g,source:D,end:X};case"'":return{type:"single-quoted-scalar",offset:b,indent:g,source:D,end:X};default:return{type:"scalar",offset:b,indent:g,source:D,end:X}}}function kk($,v,w={}){let{afterKey:g=!1,implicitKey:_=!1,inFlow:b=!1,type:J}=w,D="indent"in $?$.indent:null;if(g&&typeof D==="number")D+=2;if(!J)switch($.type){case"single-quoted-scalar":J="QUOTE_SINGLE";break;case"double-quoted-scalar":J="QUOTE_DOUBLE";break;case"block-scalar":{let G=$.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");J=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:J="PLAIN"}let X=o7.stringifyString({type:J,value:v},{implicitKey:_||D===null,indent:D!==null&&D>0?" ".repeat(D):"",inFlow:b,options:{blockQuote:!0,lineWidth:-1}});switch(X[0]){case"|":case">":Nk($,X);break;case'"':SX($,X,"double-quoted-scalar");break;case"'":SX($,X,"single-quoted-scalar");break;default:SX($,X,"scalar")}}function Nk($,v){let w=v.indexOf(`
109
+ `,W=[{type:"block-scalar-header",offset:b,indent:g,source:Y}];if(!sY(W,X))W.push({type:"newline",offset:-1,indent:g,source:`
110
+ `});return{type:"block-scalar",offset:b,indent:g,props:W,source:Q}}case'"':return{type:"double-quoted-scalar",offset:b,indent:g,source:D,end:X};case"'":return{type:"single-quoted-scalar",offset:b,indent:g,source:D,end:X};default:return{type:"scalar",offset:b,indent:g,source:D,end:X}}}function Lz($,v,w={}){let{afterKey:g=!1,implicitKey:_=!1,inFlow:b=!1,type:J}=w,D="indent"in $?$.indent:null;if(g&&typeof D==="number")D+=2;if(!J)switch($.type){case"single-quoted-scalar":J="QUOTE_SINGLE";break;case"double-quoted-scalar":J="QUOTE_DOUBLE";break;case"block-scalar":{let G=$.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");J=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:J="PLAIN"}let X=aY.stringifyString({type:J,value:v},{implicitKey:_||D===null,indent:D!==null&&D>0?" ".repeat(D):"",inFlow:b,options:{blockQuote:!0,lineWidth:-1}});switch(X[0]){case"|":case">":Vz($,X);break;case'"':TX($,X,"double-quoted-scalar");break;case"'":TX($,X,"single-quoted-scalar");break;default:TX($,X,"scalar")}}function Vz($,v){let w=v.indexOf(`
111
111
  `),g=v.substring(0,w),_=v.substring(w+1)+`
112
- `;if($.type==="block-scalar"){let b=$.props[0];if(b.type!=="block-scalar-header")throw Error("Invalid block scalar header");b.source=g,$.source=_}else{let{offset:b}=$,J="indent"in $?$.indent:-1,D=[{type:"block-scalar-header",offset:b,indent:J,source:g}];if(!t7(D,"end"in $?$.end:void 0))D.push({type:"newline",offset:-1,indent:J,source:`
113
- `});for(let X of Object.keys($))if(X!=="type"&&X!=="offset")delete $[X];Object.assign($,{type:"block-scalar",indent:J,props:D,source:_})}}function t7($,v){if(v)for(let w of v)switch(w.type){case"space":case"comment":$.push(w);break;case"newline":return $.push(w),!0}return!1}function SX($,v,w){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=w,$.source=v;break;case"block-scalar":{let g=$.props.slice(1),_=v.length;if($.props[0].type==="block-scalar-header")_-=$.props[0].source.length;for(let b of g)b.offset+=_;delete $.props,Object.assign($,{type:w,source:v,end:g});break}case"block-map":case"block-seq":{let _={type:"newline",offset:$.offset+v.length,indent:$.indent,source:`
114
- `};delete $.items,Object.assign($,{type:w,source:v,end:[_]});break}default:{let g="indent"in $?$.indent:-1,_="end"in $&&Array.isArray($.end)?$.end.filter((b)=>b.type==="space"||b.type==="comment"||b.type==="newline"):[];for(let b of Object.keys($))if(b!=="type"&&b!=="offset")delete $[b];Object.assign($,{type:w,indent:g,source:v,end:_})}}}Pk.createScalarToken=ik;Pk.resolveAsScalar=Ok;Pk.setScalarValue=kk});var p7=E((Sk)=>{var zk=($)=>("type"in $)?r0($):m0($);function r0($){switch($.type){case"block-scalar":{let v="";for(let w of $.props)v+=r0(w);return v+$.source}case"block-map":case"block-seq":{let v="";for(let w of $.items)v+=m0(w);return v}case"flow-collection":{let v=$.start.source;for(let w of $.items)v+=m0(w);for(let w of $.end)v+=w.source;return v}case"document":{let v=m0($);if($.end)for(let w of $.end)v+=w.source;return v}default:{let v=$.source;if("end"in $&&$.end)for(let w of $.end)v+=w.source;return v}}}function m0({start:$,key:v,sep:w,value:g}){let _="";for(let b of $)_+=b.source;if(v)_+=r0(v);if(w)for(let b of w)_+=b.source;if(g)_+=r0(g);return _}Sk.stringify=zk});var s7=E((Rk)=>{var uX=Symbol("break visit"),Tk=Symbol("skip children"),e7=Symbol("remove item");function _w($,v){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};a7(Object.freeze([]),$,v)}_w.BREAK=uX;_w.SKIP=Tk;_w.REMOVE=e7;_w.itemAtPath=($,v)=>{let w=$;for(let[g,_]of v){let b=w?.[g];if(b&&"items"in b)w=b.items[_];else return}return w};_w.parentCollection=($,v)=>{let w=_w.itemAtPath($,v.slice(0,-1)),g=v[v.length-1][0],_=w?.[g];if(_&&"items"in _)return _;throw Error("Parent collection not found")};function a7($,v,w){let g=w(v,$);if(typeof g==="symbol")return g;for(let _ of["key","value"]){let b=v[_];if(b&&"items"in b){for(let J=0;J<b.items.length;++J){let D=a7(Object.freeze($.concat([[_,J]])),b.items[J],w);if(typeof D==="number")J=D-1;else if(D===uX)return uX;else if(D===e7)b.items.splice(J,1),J-=1}if(typeof g==="function"&&_==="key")g=g(v,$)}}return typeof g==="function"?g(v,$):g}Rk.visit=_w});var o0=E((yk)=>{var TX=d7(),Ek=p7(),Zk=s7(),RX="\uFEFF",CX="\x02",EX="\x18",ZX="\x1F",xk=($)=>!!$&&("items"in $),lk=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function hk($){switch($){case RX:return"<BOM>";case CX:return"<DOC>";case EX:return"<FLOW_END>";case ZX:return"<SCALAR>";default:return JSON.stringify($)}}function ck($){switch($){case RX:return"byte-order-mark";case CX:return"doc-mode";case EX:return"flow-error-end";case ZX:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
112
+ `;if($.type==="block-scalar"){let b=$.props[0];if(b.type!=="block-scalar-header")throw Error("Invalid block scalar header");b.source=g,$.source=_}else{let{offset:b}=$,J="indent"in $?$.indent:-1,D=[{type:"block-scalar-header",offset:b,indent:J,source:g}];if(!sY(D,"end"in $?$.end:void 0))D.push({type:"newline",offset:-1,indent:J,source:`
113
+ `});for(let X of Object.keys($))if(X!=="type"&&X!=="offset")delete $[X];Object.assign($,{type:"block-scalar",indent:J,props:D,source:_})}}function sY($,v){if(v)for(let w of v)switch(w.type){case"space":case"comment":$.push(w);break;case"newline":return $.push(w),!0}return!1}function TX($,v,w){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=w,$.source=v;break;case"block-scalar":{let g=$.props.slice(1),_=v.length;if($.props[0].type==="block-scalar-header")_-=$.props[0].source.length;for(let b of g)b.offset+=_;delete $.props,Object.assign($,{type:w,source:v,end:g});break}case"block-map":case"block-seq":{let _={type:"newline",offset:$.offset+v.length,indent:$.indent,source:`
114
+ `};delete $.items,Object.assign($,{type:w,source:v,end:[_]});break}default:{let g="indent"in $?$.indent:-1,_="end"in $&&Array.isArray($.end)?$.end.filter((b)=>b.type==="space"||b.type==="comment"||b.type==="newline"):[];for(let b of Object.keys($))if(b!=="type"&&b!=="offset")delete $[b];Object.assign($,{type:w,indent:g,source:v,end:_})}}}jz.createScalarToken=Bz;jz.resolveAsScalar=Iz;jz.setScalarValue=Lz});var v7=E((kz)=>{var Nz=($)=>("type"in $)?d0($):o0($);function d0($){switch($.type){case"block-scalar":{let v="";for(let w of $.props)v+=d0(w);return v+$.source}case"block-map":case"block-seq":{let v="";for(let w of $.items)v+=o0(w);return v}case"flow-collection":{let v=$.start.source;for(let w of $.items)v+=o0(w);for(let w of $.end)v+=w.source;return v}case"document":{let v=o0($);if($.end)for(let w of $.end)v+=w.source;return v}default:{let v=$.source;if("end"in $&&$.end)for(let w of $.end)v+=w.source;return v}}}function o0({start:$,key:v,sep:w,value:g}){let _="";for(let b of $)_+=b.source;if(v)_+=d0(v);if(w)for(let b of w)_+=b.source;if(g)_+=d0(g);return _}kz.stringify=Nz});var g7=E((nz)=>{var uX=Symbol("break visit"),iz=Symbol("skip children"),_7=Symbol("remove item");function _w($,v){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};w7(Object.freeze([]),$,v)}_w.BREAK=uX;_w.SKIP=iz;_w.REMOVE=_7;_w.itemAtPath=($,v)=>{let w=$;for(let[g,_]of v){let b=w?.[g];if(b&&"items"in b)w=b.items[_];else return}return w};_w.parentCollection=($,v)=>{let w=_w.itemAtPath($,v.slice(0,-1)),g=v[v.length-1][0],_=w?.[g];if(_&&"items"in _)return _;throw Error("Parent collection not found")};function w7($,v,w){let g=w(v,$);if(typeof g==="symbol")return g;for(let _ of["key","value"]){let b=v[_];if(b&&"items"in b){for(let J=0;J<b.items.length;++J){let D=w7(Object.freeze($.concat([[_,J]])),b.items[J],w);if(typeof D==="number")J=D-1;else if(D===uX)return uX;else if(D===_7)b.items.splice(J,1),J-=1}if(typeof g==="function"&&_==="key")g=g(v,$)}}return typeof g==="function"?g(v,$):g}nz.visit=_w});var t0=E((Rz)=>{var RX=$7(),Az=v7(),Mz=g7(),CX="\uFEFF",EX="\x02",ZX="\x18",hX="\x1F",fz=($)=>!!$&&("items"in $),Sz=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function Tz($){switch($){case CX:return"<BOM>";case EX:return"<DOC>";case ZX:return"<FLOW_END>";case hX:return"<SCALAR>";default:return JSON.stringify($)}}function uz($){switch($){case CX:return"byte-order-mark";case EX:return"doc-mode";case ZX:return"flow-error-end";case hX:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
115
115
  `:case`\r
116
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}yk.createScalarToken=TX.createScalarToken;yk.resolveAsScalar=TX.resolveAsScalar;yk.setScalarValue=TX.setScalarValue;yk.stringify=Ek.stringify;yk.visit=Zk.visit;yk.BOM=RX;yk.DOCUMENT=CX;yk.FLOW_END=EX;yk.SCALAR=ZX;yk.isCollection=xk;yk.isScalar=lk;yk.prettyToken=hk;yk.tokenType=ck});var lX=E((UN)=>{var Tg=o0();function Uv($){switch($){case void 0:case" ":case`
117
- `:case"\r":case"\t":return!0;default:return!1}}var $Y=new Set("0123456789ABCDEFabcdef"),gN=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),t0=new Set(",[]{}"),bN=new Set(` ,[]{}
118
- \r `),xX=($)=>!$||bN.has($);class vY{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,v=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!v;let w=this.next??"stream";while(w&&(v||this.hasChars(1)))w=yield*this.parseNext(w)}atLineEnd(){let $=this.pos,v=this.buffer[$];while(v===" "||v==="\t")v=this.buffer[++$];if(!v||v==="#"||v===`
116
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Rz.createScalarToken=RX.createScalarToken;Rz.resolveAsScalar=RX.resolveAsScalar;Rz.setScalarValue=RX.setScalarValue;Rz.stringify=Az.stringify;Rz.visit=Mz.visit;Rz.BOM=CX;Rz.DOCUMENT=EX;Rz.FLOW_END=ZX;Rz.SCALAR=hX;Rz.isCollection=fz;Rz.isScalar=Sz;Rz.prettyToken=Tz;Rz.tokenType=uz});var lX=E((az)=>{var Rg=t0();function Uv($){switch($){case void 0:case" ":case`
117
+ `:case"\r":case"\t":return!0;default:return!1}}var b7=new Set("0123456789ABCDEFabcdef"),pz=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),p0=new Set(",[]{}"),ez=new Set(` ,[]{}
118
+ \r `),xX=($)=>!$||ez.has($);class U7{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,v=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!v;let w=this.next??"stream";while(w&&(v||this.hasChars(1)))w=yield*this.parseNext(w)}atLineEnd(){let $=this.pos,v=this.buffer[$];while(v===" "||v==="\t")v=this.buffer[++$];if(!v||v==="#"||v===`
119
119
  `)return!0;if(v==="\r")return this.buffer[$+1]===`
120
120
  `;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let v=this.buffer[$];if(this.indentNext>0){let w=0;while(v===" ")v=this.buffer[++w+$];if(v==="\r"){let g=this.buffer[w+$+1];if(g===`
121
121
  `||!g&&!this.atEnd)return $+w+1}return v===`
122
122
  `||w>=this.indentNext||!v&&!this.atEnd?$+w:-1}if(v==="-"||v==="."){let w=this.buffer.substr($,3);if((w==="---"||w==="...")&&Uv(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
123
- `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===Tg.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let v=$.length,w=$.indexOf("#");while(w!==-1){let _=$[w-1];if(_===" "||_==="\t"){v=w-1;break}else w=$.indexOf("#",w+1)}while(!0){let _=$[v-1];if(_===" "||_==="\t")v-=1;else break}let g=(yield*this.pushCount(v))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-g),this.pushNewline(),"stream"}if(this.atLineEnd()){let v=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-v),yield*this.pushNewline(),"stream"}return yield Tg.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let v=this.peek(3);if((v==="---"||v==="...")&&Uv(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,v==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Uv(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,v]=this.peek(2);if(!v&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&Uv(v)){let w=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=w,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let v=yield*this.pushIndicators();switch($[v]){case"#":yield*this.pushCount($.length-v);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(xX),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return v+=yield*this.parseBlockScalarHeader(),v+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-v),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,v,w=-1;do{if($=yield*this.pushNewline(),$>0)v=yield*this.pushSpaces(!1),this.indentValue=w=v;else v=0;v+=yield*this.pushSpaces(!0)}while($+v>0);let g=this.getLine();if(g===null)return this.setNext("flow");if(w!==-1&&w<this.indentNext&&g[0]!=="#"||w===0&&(g.startsWith("---")||g.startsWith("..."))&&Uv(g[3])){if(!(w===this.indentNext-1&&this.flowLevel===1&&(g[0]==="]"||g[0]==="}")))return this.flowLevel=0,yield Tg.FLOW_END,yield*this.parseLineStart()}let _=0;while(g[_]===",")_+=yield*this.pushCount(1),_+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(_+=yield*this.pushIndicators(),g[_]){case void 0:return"flow";case"#":return yield*this.pushCount(g.length-_),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(xX),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let b=this.charAt(1);if(this.flowKey||Uv(b)||b===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),v=this.buffer.indexOf($,this.pos+1);if($==="'")while(v!==-1&&this.buffer[v+1]==="'")v=this.buffer.indexOf("'",v+2);else while(v!==-1){let _=0;while(this.buffer[v-1-_]==="\\")_+=1;if(_%2===0)break;v=this.buffer.indexOf('"',v+1)}let w=this.buffer.substring(0,v),g=w.indexOf(`
123
+ `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===Rg.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let v=$.length,w=$.indexOf("#");while(w!==-1){let _=$[w-1];if(_===" "||_==="\t"){v=w-1;break}else w=$.indexOf("#",w+1)}while(!0){let _=$[v-1];if(_===" "||_==="\t")v-=1;else break}let g=(yield*this.pushCount(v))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-g),this.pushNewline(),"stream"}if(this.atLineEnd()){let v=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-v),yield*this.pushNewline(),"stream"}return yield Rg.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let v=this.peek(3);if((v==="---"||v==="...")&&Uv(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,v==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Uv(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,v]=this.peek(2);if(!v&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&Uv(v)){let w=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=w,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let v=yield*this.pushIndicators();switch($[v]){case"#":yield*this.pushCount($.length-v);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(xX),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return v+=yield*this.parseBlockScalarHeader(),v+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-v),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,v,w=-1;do{if($=yield*this.pushNewline(),$>0)v=yield*this.pushSpaces(!1),this.indentValue=w=v;else v=0;v+=yield*this.pushSpaces(!0)}while($+v>0);let g=this.getLine();if(g===null)return this.setNext("flow");if(w!==-1&&w<this.indentNext&&g[0]!=="#"||w===0&&(g.startsWith("---")||g.startsWith("..."))&&Uv(g[3])){if(!(w===this.indentNext-1&&this.flowLevel===1&&(g[0]==="]"||g[0]==="}")))return this.flowLevel=0,yield Rg.FLOW_END,yield*this.parseLineStart()}let _=0;while(g[_]===",")_+=yield*this.pushCount(1),_+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(_+=yield*this.pushIndicators(),g[_]){case void 0:return"flow";case"#":return yield*this.pushCount(g.length-_),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(xX),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let b=this.charAt(1);if(this.flowKey||Uv(b)||b===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),v=this.buffer.indexOf($,this.pos+1);if($==="'")while(v!==-1&&this.buffer[v+1]==="'")v=this.buffer.indexOf("'",v+2);else while(v!==-1){let _=0;while(this.buffer[v-1-_]==="\\")_+=1;if(_%2===0)break;v=this.buffer.indexOf('"',v+1)}let w=this.buffer.substring(0,v),g=w.indexOf(`
124
124
  `,this.pos);if(g!==-1){while(g!==-1){let _=this.continueScalar(g+1);if(_===-1)break;g=w.indexOf(`
125
125
  `,_)}if(g!==-1)v=g-(w[g-1]==="\r"?2:1)}if(v===-1){if(!this.atEnd)return this.setNext("quoted-scalar");v=this.buffer.length}return yield*this.pushToIndex(v+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let v=this.buffer[++$];if(v==="+")this.blockScalarKeep=!0;else if(v>"0"&&v<="9")this.blockScalarIndent=Number(v)-1;else if(v!=="-")break}return yield*this.pushUntil((v)=>Uv(v)||v==="#")}*parseBlockScalar(){let $=this.pos-1,v=0,w;$:for(let _=this.pos;w=this.buffer[_];++_)switch(w){case" ":v+=1;break;case`
126
126
  `:$=_,v=0;break;case"\r":{let b=this.buffer[_+1];if(!b&&!this.atEnd)return this.setNext("block-scalar");if(b===`
127
127
  `)break}default:break $}if(!w&&!this.atEnd)return this.setNext("block-scalar");if(v>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=v;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let _=this.continueScalar($+1);if(_===-1)break;$=this.buffer.indexOf(`
128
128
  `,_)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let g=$+1;w=this.buffer[g];while(w===" ")w=this.buffer[++g];if(w==="\t"){while(w==="\t"||w===" "||w==="\r"||w===`
129
129
  `)w=this.buffer[++g];$=g-1}else if(!this.blockScalarKeep)do{let _=$-1,b=this.buffer[_];if(b==="\r")b=this.buffer[--_];let J=_;while(b===" ")b=this.buffer[--_];if(b===`
130
- `&&_>=this.pos&&_+1+v>J)$=_;else break}while(!0);return yield Tg.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,v=this.pos-1,w=this.pos-1,g;while(g=this.buffer[++w])if(g===":"){let _=this.buffer[w+1];if(Uv(_)||$&&t0.has(_))break;v=w}else if(Uv(g)){let _=this.buffer[w+1];if(g==="\r")if(_===`
130
+ `&&_>=this.pos&&_+1+v>J)$=_;else break}while(!0);return yield Rg.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,v=this.pos-1,w=this.pos-1,g;while(g=this.buffer[++w])if(g===":"){let _=this.buffer[w+1];if(Uv(_)||$&&p0.has(_))break;v=w}else if(Uv(g)){let _=this.buffer[w+1];if(g==="\r")if(_===`
131
131
  `)w+=1,g=`
132
- `,_=this.buffer[w+1];else v=w;if(_==="#"||$&&t0.has(_))break;if(g===`
133
- `){let b=this.continueScalar(w+1);if(b===-1)break;w=Math.max(w,b-2)}}else{if($&&t0.has(g))break;v=w}if(!g&&!this.atEnd)return this.setNext("plain-scalar");return yield Tg.SCALAR,yield*this.pushToIndex(v+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,v){let w=this.buffer.slice(this.pos,$);if(w)return yield w,this.pos+=w.length,w.length;else if(v)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(xX))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,v=this.charAt(1);if(Uv(v)||$&&t0.has(v)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,v=this.buffer[$];while(!Uv(v)&&v!==">")v=this.buffer[++$];return yield*this.pushToIndex(v===">"?$+1:$,!1)}else{let $=this.pos+1,v=this.buffer[$];while(v)if(gN.has(v))v=this.buffer[++$];else if(v==="%"&&$Y.has(this.buffer[$+1])&&$Y.has(this.buffer[$+2]))v=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
132
+ `,_=this.buffer[w+1];else v=w;if(_==="#"||$&&p0.has(_))break;if(g===`
133
+ `){let b=this.continueScalar(w+1);if(b===-1)break;w=Math.max(w,b-2)}}else{if($&&p0.has(g))break;v=w}if(!g&&!this.atEnd)return this.setNext("plain-scalar");return yield Rg.SCALAR,yield*this.pushToIndex(v+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,v){let w=this.buffer.slice(this.pos,$);if(w)return yield w,this.pos+=w.length,w.length;else if(v)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(xX))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,v=this.charAt(1);if(Uv(v)||$&&p0.has(v)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,v=this.buffer[$];while(!Uv(v)&&v!==">")v=this.buffer[++$];return yield*this.pushToIndex(v===">"?$+1:$,!1)}else{let $=this.pos+1,v=this.buffer[$];while(v)if(pz.has(v))v=this.buffer[++$];else if(v==="%"&&b7.has(this.buffer[$+1])&&b7.has(this.buffer[$+2]))v=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
134
134
  `)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
135
- `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let v=this.pos-1,w;do w=this.buffer[++v];while(w===" "||$&&w==="\t");let g=v-this.pos;if(g>0)yield this.buffer.substr(this.pos,g),this.pos=v;return g}*pushUntil($){let v=this.pos,w=this.buffer[v];while(!$(w))w=this.buffer[++v];return yield*this.pushToIndex(v,!1)}}UN.Lexer=vY});var hX=E((DN)=>{class _Y{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let v=0,w=this.lineStarts.length;while(v<w){let _=v+w>>1;if(this.lineStarts[_]<$)v=_+1;else w=_}if(this.lineStarts[v]===$)return{line:v+1,col:1};if(v===0)return{line:0,col:$};let g=this.lineStarts[v-1];return{line:v,col:$-g+1}}}}DN.LineCounter=_Y});var cX=E((QN)=>{var GN=Qw("process"),wY=o0(),YN=lX();function k_($,v){for(let w=0;w<$.length;++w)if($[w].type===v)return!0;return!1}function gY($){for(let v=0;v<$.length;++v)switch($[v].type){case"space":case"comment":case"newline":break;default:return v}return-1}function UY($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function d0($){switch($.type){case"document":return $.start;case"block-map":{let v=$.items[$.items.length-1];return v.sep??v.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function L6($){if($.length===0)return[];let v=$.length;$:while(--v>=0)switch($[v].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++v]?.type==="space");return $.splice(v,$.length)}function bY($){if($.start.type==="flow-seq-start"){for(let v of $.items)if(v.sep&&!v.value&&!k_(v.start,"explicit-key-ind")&&!k_(v.sep,"map-value-ind")){if(v.key)v.value=v.key;if(delete v.key,UY(v.value))if(v.value.end)Array.prototype.push.apply(v.value.end,v.sep);else v.value.end=v.sep;else Array.prototype.push.apply(v.start,v.sep);delete v.sep}}}class JY{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new YN.Lexer,this.onNewLine=$}*parse($,v=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let w of this.lexer.lex($,v))yield*this.next(w);if(!v)yield*this.end()}*next($){if(this.source=$,GN.env.LOG_TOKENS)console.log("|",wY.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let v=wY.tokenType($);if(!v){let w=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:w,source:$}),this.offset+=$.length}else if(v==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=v,yield*this.step(),v){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let v=$??this.stack.pop();if(!v)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield v;else{let w=this.peek(1);if(v.type==="block-scalar")v.indent="indent"in w?w.indent:0;else if(v.type==="flow-collection"&&w.type==="document")v.indent=0;if(v.type==="flow-collection")bY(v);switch(w.type){case"document":w.value=v;break;case"block-scalar":w.props.push(v);break;case"block-map":{let g=w.items[w.items.length-1];if(g.value){w.items.push({start:[],key:v,sep:[]}),this.onKeyLine=!0;return}else if(g.sep)g.value=v;else{Object.assign(g,{key:v,sep:[]}),this.onKeyLine=!g.explicitKey;return}break}case"block-seq":{let g=w.items[w.items.length-1];if(g.value)w.items.push({start:[],value:v});else g.value=v;break}case"flow-collection":{let g=w.items[w.items.length-1];if(!g||g.value)w.items.push({start:[],key:v,sep:[]});else if(g.sep)g.value=v;else Object.assign(g,{key:v,sep:[]});return}default:yield*this.pop(),yield*this.pop(v)}if((w.type==="document"||w.type==="block-map"||w.type==="block-seq")&&(v.type==="block-map"||v.type==="block-seq")){let g=v.items[v.items.length-1];if(g&&!g.sep&&!g.value&&g.start.length>0&&gY(g.start)===-1&&(v.indent===0||g.start.every((_)=>_.type!=="comment"||_.indent<v.indent))){if(w.type==="document")w.end=g.start;else w.items.push({start:g.start});v.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(gY($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let v=this.startBlockValue($);if(v)this.stack.push(v);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let v=d0(this.peek(2)),w=L6(v),g;if($.end)g=$.end,g.push(this.sourceToken),delete $.end;else g=[this.sourceToken];let _={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:w,key:$,sep:g}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=_}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let v=this.source.indexOf(`
135
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let v=this.pos-1,w;do w=this.buffer[++v];while(w===" "||$&&w==="\t");let g=v-this.pos;if(g>0)yield this.buffer.substr(this.pos,g),this.pos=v;return g}*pushUntil($){let v=this.pos,w=this.buffer[v];while(!$(w))w=this.buffer[++v];return yield*this.pushToIndex(v,!1)}}az.Lexer=U7});var cX=E(($i)=>{class J7{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let v=0,w=this.lineStarts.length;while(v<w){let _=v+w>>1;if(this.lineStarts[_]<$)v=_+1;else w=_}if(this.lineStarts[v]===$)return{line:v+1,col:1};if(v===0)return{line:0,col:$};let g=this.lineStarts[v-1];return{line:v,col:$-g+1}}}}$i.LineCounter=J7});var yX=E((gi)=>{var _i=Ww("process"),D7=t0(),wi=lX();function z_($,v){for(let w=0;w<$.length;++w)if($[w].type===v)return!0;return!1}function X7($){for(let v=0;v<$.length;++v)switch($[v].type){case"space":case"comment":case"newline":break;default:return v}return-1}function Y7($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function e0($){switch($.type){case"document":return $.start;case"block-map":{let v=$.items[$.items.length-1];return v.sep??v.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function j6($){if($.length===0)return[];let v=$.length;$:while(--v>=0)switch($[v].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++v]?.type==="space");return $.splice(v,$.length)}function G7($){if($.start.type==="flow-seq-start"){for(let v of $.items)if(v.sep&&!v.value&&!z_(v.start,"explicit-key-ind")&&!z_(v.sep,"map-value-ind")){if(v.key)v.value=v.key;if(delete v.key,Y7(v.value))if(v.value.end)Array.prototype.push.apply(v.value.end,v.sep);else v.value.end=v.sep;else Array.prototype.push.apply(v.start,v.sep);delete v.sep}}}class Q7{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new wi.Lexer,this.onNewLine=$}*parse($,v=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let w of this.lexer.lex($,v))yield*this.next(w);if(!v)yield*this.end()}*next($){if(this.source=$,_i.env.LOG_TOKENS)console.log("|",D7.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let v=D7.tokenType($);if(!v){let w=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:w,source:$}),this.offset+=$.length}else if(v==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=v,yield*this.step(),v){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let v=$??this.stack.pop();if(!v)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield v;else{let w=this.peek(1);if(v.type==="block-scalar")v.indent="indent"in w?w.indent:0;else if(v.type==="flow-collection"&&w.type==="document")v.indent=0;if(v.type==="flow-collection")G7(v);switch(w.type){case"document":w.value=v;break;case"block-scalar":w.props.push(v);break;case"block-map":{let g=w.items[w.items.length-1];if(g.value){w.items.push({start:[],key:v,sep:[]}),this.onKeyLine=!0;return}else if(g.sep)g.value=v;else{Object.assign(g,{key:v,sep:[]}),this.onKeyLine=!g.explicitKey;return}break}case"block-seq":{let g=w.items[w.items.length-1];if(g.value)w.items.push({start:[],value:v});else g.value=v;break}case"flow-collection":{let g=w.items[w.items.length-1];if(!g||g.value)w.items.push({start:[],key:v,sep:[]});else if(g.sep)g.value=v;else Object.assign(g,{key:v,sep:[]});return}default:yield*this.pop(),yield*this.pop(v)}if((w.type==="document"||w.type==="block-map"||w.type==="block-seq")&&(v.type==="block-map"||v.type==="block-seq")){let g=v.items[v.items.length-1];if(g&&!g.sep&&!g.value&&g.start.length>0&&X7(g.start)===-1&&(v.indent===0||g.start.every((_)=>_.type!=="comment"||_.indent<v.indent))){if(w.type==="document")w.end=g.start;else w.items.push({start:g.start});v.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(X7($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let v=this.startBlockValue($);if(v)this.stack.push(v);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let v=e0(this.peek(2)),w=j6(v),g;if($.end)g=$.end,g.push(this.sourceToken),delete $.end;else g=[this.sourceToken];let _={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:w,key:$,sep:g}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=_}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let v=this.source.indexOf(`
136
136
  `)+1;while(v!==0)this.onNewLine(this.offset+v),v=this.source.indexOf(`
137
- `,v)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let v=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,v.value){let w="end"in v.value?v.value.end:void 0;if((Array.isArray(w)?w[w.length-1]:void 0)?.type==="comment")w?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(v.sep)v.sep.push(this.sourceToken);else v.start.push(this.sourceToken);return;case"space":case"comment":if(v.value)$.items.push({start:[this.sourceToken]});else if(v.sep)v.sep.push(this.sourceToken);else{if(this.atIndentedComment(v.start,$.indent)){let g=$.items[$.items.length-2]?.value?.end;if(Array.isArray(g)){Array.prototype.push.apply(g,v.start),g.push(this.sourceToken),$.items.pop();return}}v.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let w=!this.onKeyLine&&this.indent===$.indent,g=w&&(v.sep||v.explicitKey)&&this.type!=="seq-item-ind",_=[];if(g&&v.sep&&!v.value){let b=[];for(let J=0;J<v.sep.length;++J){let D=v.sep[J];switch(D.type){case"newline":b.push(J);break;case"space":break;case"comment":if(D.indent>$.indent)b.length=0;break;default:b.length=0}}if(b.length>=2)_=v.sep.splice(b[1])}switch(this.type){case"anchor":case"tag":if(g||v.value)_.push(this.sourceToken),$.items.push({start:_}),this.onKeyLine=!0;else if(v.sep)v.sep.push(this.sourceToken);else v.start.push(this.sourceToken);return;case"explicit-key-ind":if(!v.sep&&!v.explicitKey)v.start.push(this.sourceToken),v.explicitKey=!0;else if(g||v.value)_.push(this.sourceToken),$.items.push({start:_,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(v.explicitKey)if(!v.sep)if(k_(v.start,"newline"))Object.assign(v,{key:null,sep:[this.sourceToken]});else{let b=L6(v.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:b,key:null,sep:[this.sourceToken]}]})}else if(v.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(k_(v.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_,key:null,sep:[this.sourceToken]}]});else if(UY(v.key)&&!k_(v.sep,"newline")){let b=L6(v.start),J=v.key,D=v.sep;D.push(this.sourceToken),delete v.key,delete v.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:b,key:J,sep:D}]})}else if(_.length>0)v.sep=v.sep.concat(_,this.sourceToken);else v.sep.push(this.sourceToken);else if(!v.sep)Object.assign(v,{key:null,sep:[this.sourceToken]});else if(v.value||g)$.items.push({start:_,key:null,sep:[this.sourceToken]});else if(k_(v.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else v.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let b=this.flowScalar(this.type);if(g||v.value)$.items.push({start:_,key:b,sep:[]}),this.onKeyLine=!0;else if(v.sep)this.stack.push(b);else Object.assign(v,{key:b,sep:[]}),this.onKeyLine=!0;return}default:{let b=this.startBlockValue($);if(b){if(b.type==="block-seq"){if(!v.explicitKey&&v.sep&&!k_(v.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(w)$.items.push({start:_});this.stack.push(b);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let v=$.items[$.items.length-1];switch(this.type){case"newline":if(v.value){let w="end"in v.value?v.value.end:void 0;if((Array.isArray(w)?w[w.length-1]:void 0)?.type==="comment")w?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else v.start.push(this.sourceToken);return;case"space":case"comment":if(v.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(v.start,$.indent)){let g=$.items[$.items.length-2]?.value?.end;if(Array.isArray(g)){Array.prototype.push.apply(g,v.start),g.push(this.sourceToken),$.items.pop();return}}v.start.push(this.sourceToken)}return;case"anchor":case"tag":if(v.value||this.indent<=$.indent)break;v.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(v.value||k_(v.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else v.start.push(this.sourceToken);return}if(this.indent>$.indent){let w=this.startBlockValue($);if(w){this.stack.push(w);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let v=$.items[$.items.length-1];if(this.type==="flow-error-end"){let w;do yield*this.pop(),w=this.peek(1);while(w?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!v||v.sep)$.items.push({start:[this.sourceToken]});else v.start.push(this.sourceToken);return;case"map-value-ind":if(!v||v.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(v.sep)v.sep.push(this.sourceToken);else Object.assign(v,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!v||v.value)$.items.push({start:[this.sourceToken]});else if(v.sep)v.sep.push(this.sourceToken);else v.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let g=this.flowScalar(this.type);if(!v||v.value)$.items.push({start:[],key:g,sep:[]});else if(v.sep)this.stack.push(g);else Object.assign(v,{key:g,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let w=this.startBlockValue($);if(w)this.stack.push(w);else yield*this.pop(),yield*this.step()}else{let w=this.peek(2);if(w.type==="block-map"&&(this.type==="map-value-ind"&&w.indent===$.indent||this.type==="newline"&&!w.items[w.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&w.type!=="flow-collection"){let g=d0(w),_=L6(g);bY($);let b=$.end.splice(1,$.end.length);b.push(this.sourceToken);let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:_,key:$,sep:b}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let v=this.source.indexOf(`
137
+ `,v)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let v=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,v.value){let w="end"in v.value?v.value.end:void 0;if((Array.isArray(w)?w[w.length-1]:void 0)?.type==="comment")w?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(v.sep)v.sep.push(this.sourceToken);else v.start.push(this.sourceToken);return;case"space":case"comment":if(v.value)$.items.push({start:[this.sourceToken]});else if(v.sep)v.sep.push(this.sourceToken);else{if(this.atIndentedComment(v.start,$.indent)){let g=$.items[$.items.length-2]?.value?.end;if(Array.isArray(g)){Array.prototype.push.apply(g,v.start),g.push(this.sourceToken),$.items.pop();return}}v.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let w=!this.onKeyLine&&this.indent===$.indent,g=w&&(v.sep||v.explicitKey)&&this.type!=="seq-item-ind",_=[];if(g&&v.sep&&!v.value){let b=[];for(let J=0;J<v.sep.length;++J){let D=v.sep[J];switch(D.type){case"newline":b.push(J);break;case"space":break;case"comment":if(D.indent>$.indent)b.length=0;break;default:b.length=0}}if(b.length>=2)_=v.sep.splice(b[1])}switch(this.type){case"anchor":case"tag":if(g||v.value)_.push(this.sourceToken),$.items.push({start:_}),this.onKeyLine=!0;else if(v.sep)v.sep.push(this.sourceToken);else v.start.push(this.sourceToken);return;case"explicit-key-ind":if(!v.sep&&!v.explicitKey)v.start.push(this.sourceToken),v.explicitKey=!0;else if(g||v.value)_.push(this.sourceToken),$.items.push({start:_,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(v.explicitKey)if(!v.sep)if(z_(v.start,"newline"))Object.assign(v,{key:null,sep:[this.sourceToken]});else{let b=j6(v.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:b,key:null,sep:[this.sourceToken]}]})}else if(v.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(z_(v.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_,key:null,sep:[this.sourceToken]}]});else if(Y7(v.key)&&!z_(v.sep,"newline")){let b=j6(v.start),J=v.key,D=v.sep;D.push(this.sourceToken),delete v.key,delete v.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:b,key:J,sep:D}]})}else if(_.length>0)v.sep=v.sep.concat(_,this.sourceToken);else v.sep.push(this.sourceToken);else if(!v.sep)Object.assign(v,{key:null,sep:[this.sourceToken]});else if(v.value||g)$.items.push({start:_,key:null,sep:[this.sourceToken]});else if(z_(v.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else v.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let b=this.flowScalar(this.type);if(g||v.value)$.items.push({start:_,key:b,sep:[]}),this.onKeyLine=!0;else if(v.sep)this.stack.push(b);else Object.assign(v,{key:b,sep:[]}),this.onKeyLine=!0;return}default:{let b=this.startBlockValue($);if(b){if(b.type==="block-seq"){if(!v.explicitKey&&v.sep&&!z_(v.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(w)$.items.push({start:_});this.stack.push(b);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let v=$.items[$.items.length-1];switch(this.type){case"newline":if(v.value){let w="end"in v.value?v.value.end:void 0;if((Array.isArray(w)?w[w.length-1]:void 0)?.type==="comment")w?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else v.start.push(this.sourceToken);return;case"space":case"comment":if(v.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(v.start,$.indent)){let g=$.items[$.items.length-2]?.value?.end;if(Array.isArray(g)){Array.prototype.push.apply(g,v.start),g.push(this.sourceToken),$.items.pop();return}}v.start.push(this.sourceToken)}return;case"anchor":case"tag":if(v.value||this.indent<=$.indent)break;v.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(v.value||z_(v.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else v.start.push(this.sourceToken);return}if(this.indent>$.indent){let w=this.startBlockValue($);if(w){this.stack.push(w);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let v=$.items[$.items.length-1];if(this.type==="flow-error-end"){let w;do yield*this.pop(),w=this.peek(1);while(w?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!v||v.sep)$.items.push({start:[this.sourceToken]});else v.start.push(this.sourceToken);return;case"map-value-ind":if(!v||v.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(v.sep)v.sep.push(this.sourceToken);else Object.assign(v,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!v||v.value)$.items.push({start:[this.sourceToken]});else if(v.sep)v.sep.push(this.sourceToken);else v.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let g=this.flowScalar(this.type);if(!v||v.value)$.items.push({start:[],key:g,sep:[]});else if(v.sep)this.stack.push(g);else Object.assign(v,{key:g,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let w=this.startBlockValue($);if(w)this.stack.push(w);else yield*this.pop(),yield*this.step()}else{let w=this.peek(2);if(w.type==="block-map"&&(this.type==="map-value-ind"&&w.indent===$.indent||this.type==="newline"&&!w.items[w.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&w.type!=="flow-collection"){let g=e0(w),_=j6(g);G7($);let b=$.end.splice(1,$.end.length);b.push(this.sourceToken);let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:_,key:$,sep:b}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let v=this.source.indexOf(`
138
138
  `)+1;while(v!==0)this.onNewLine(this.offset+v),v=this.source.indexOf(`
139
- `,v)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let v=d0($),w=L6(v);return w.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:w,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let v=d0($),w=L6(v);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:w,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,v){if(this.type!=="comment")return!1;if(this.indent<=v)return!1;return $.every((w)=>w.type==="newline"||w.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}QN.Parser=JY});var QY=E((jN)=>{var DY=zX(),HN=Ag(),Rg=Mg(),nN=hD(),qN=_$(),IN=hX(),XY=cX();function GY($){let v=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||v&&new IN.LineCounter||null,prettyErrors:v}}function BN($,v={}){let{lineCounter:w,prettyErrors:g}=GY(v),_=new XY.Parser(w?.addNewLine),b=new DY.Composer(v),J=Array.from(b.compose(_.parse($)));if(g&&w)for(let D of J)D.errors.forEach(Rg.prettifyError($,w)),D.warnings.forEach(Rg.prettifyError($,w));if(J.length>0)return J;return Object.assign([],{empty:!0},b.streamInfo())}function YY($,v={}){let{lineCounter:w,prettyErrors:g}=GY(v),_=new XY.Parser(w?.addNewLine),b=new DY.Composer(v),J=null;for(let D of b.compose(_.parse($),!0,$.length))if(!J)J=D;else if(J.options.logLevel!=="silent"){J.errors.push(new Rg.YAMLParseError(D.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(g&&w)J.errors.forEach(Rg.prettifyError($,w)),J.warnings.forEach(Rg.prettifyError($,w));return J}function LN($,v,w){let g=void 0;if(typeof v==="function")g=v;else if(w===void 0&&v&&typeof v==="object")w=v;let _=YY($,w);if(!_)return null;if(_.warnings.forEach((b)=>nN.warn(_.options.logLevel,b)),_.errors.length>0)if(_.options.logLevel!=="silent")throw _.errors[0];else _.errors=[];return _.toJS(Object.assign({reviver:g},w))}function VN($,v,w){let g=null;if(typeof v==="function"||Array.isArray(v))g=v;else if(w===void 0&&v)w=v;if(typeof w==="string")w=w.length;if(typeof w==="number"){let _=Math.round(w);w=_<1?void 0:_>8?{indent:8}:{indent:_}}if($===void 0){let{keepUndefined:_}=w??v??{};if(!_)return}if(qN.isDocument($)&&!g)return $.toString(w);return new HN.Document($,g,w).toString(w)}jN.parse=LN;jN.parseAllDocuments=BN;jN.parseDocument=YY;jN.stringify=VN});function $8(){let $=new Map;return{register(v,w){$.set(v.name,{definition:v,handler:w})},getTools(){return Array.from($.values()).map((v)=>v.definition)},getHandler(v){return $.get(v)?.handler}}}var sX=sG(mU(),1);var U={};$v(U,{z:()=>a,xor:()=>lb,xid:()=>Yb,void:()=>Rb,uuidv7:()=>wb,uuidv6:()=>_b,uuidv4:()=>vb,uuid:()=>$b,util:()=>N,url:()=>gb,uppercase:()=>sv,unknown:()=>N$,union:()=>zv,undefined:()=>ub,ulid:()=>Gb,uint64:()=>zb,uint32:()=>fb,tuple:()=>o_,trim:()=>b_,treeifyError:()=>d6,transform:()=>_6,toUpperCase:()=>J_,toLowerCase:()=>U_,toJSONSchema:()=>Mw,templateLiteral:()=>ab,symbol:()=>Sb,superRefine:()=>Yg,success:()=>db,stringbool:()=>U0,stringFormat:()=>Fb,string:()=>F,strictObject:()=>Zb,startsWith:()=>v_,slugify:()=>D_,size:()=>Pv,setErrorMap:()=>ND,set:()=>mb,safeParseAsync:()=>q4,safeParse:()=>n4,safeEncodeAsync:()=>K4,safeEncode:()=>j4,safeDecodeAsync:()=>O4,safeDecode:()=>F4,registry:()=>Kw,regexes:()=>E$,regex:()=>ev,refine:()=>Gg,record:()=>Bv,readonly:()=>gg,property:()=>Pw,promise:()=>sb,prettifyError:()=>p6,preprocess:()=>D0,prefault:()=>e4,positive:()=>Ow,pipe:()=>h_,partialRecord:()=>hb,parseAsync:()=>H4,parse:()=>W4,overwrite:()=>h$,optional:()=>x_,object:()=>u,number:()=>H$,nullish:()=>tb,nullable:()=>l_,null:()=>f4,normalize:()=>g_,nonpositive:()=>kw,nonoptional:()=>a4,nonnegative:()=>Nw,never:()=>v6,negative:()=>iw,nativeEnum:()=>rb,nanoid:()=>Jb,nan:()=>pb,multipleOf:()=>qv,minSize:()=>t$,minLength:()=>vv,mime:()=>w_,meta:()=>g0,maxSize:()=>Iv,maxLength:()=>fv,map:()=>yb,mac:()=>Hb,lte:()=>z$,lt:()=>r$,lowercase:()=>av,looseRecord:()=>cb,looseObject:()=>xb,locales:()=>E_,literal:()=>q$,length:()=>Av,lazy:()=>Jg,ksuid:()=>Qb,keyof:()=>Eb,jwt:()=>jb,json:()=>J0,iso:()=>Q_,ipv6:()=>nb,ipv4:()=>Wb,intersection:()=>E4,int64:()=>Mb,int32:()=>Pb,int:()=>Rw,instanceof:()=>b0,includes:()=>$_,httpUrl:()=>bb,hostname:()=>Kb,hex:()=>Ob,hash:()=>ib,guid:()=>s1,gte:()=>k$,gt:()=>o$,globalRegistry:()=>j$,getErrorMap:()=>PD,function:()=>$0,fromJSONSchema:()=>X0,formatError:()=>T_,float64:()=>Nb,float32:()=>kb,flattenError:()=>u_,file:()=>ob,exactOptional:()=>r4,enum:()=>v$,endsWith:()=>__,encodeAsync:()=>L4,encode:()=>I4,emoji:()=>Ub,email:()=>a1,e164:()=>Vb,discriminatedUnion:()=>Sv,describe:()=>w0,decodeAsync:()=>V4,decode:()=>B4,date:()=>Cb,custom:()=>_0,cuid2:()=>Xb,cuid:()=>Db,core:()=>_v,config:()=>n$,coerce:()=>wv,codec:()=>eb,clone:()=>i$,cidrv6:()=>Ib,cidrv4:()=>qb,check:()=>v0,catch:()=>vg,boolean:()=>W$,bigint:()=>Ab,base64url:()=>Lb,base64:()=>Bb,array:()=>g$,any:()=>Tb,_function:()=>$0,_default:()=>d4,_ZodString:()=>Cw,ZodXor:()=>T4,ZodXID:()=>yw,ZodVoid:()=>S4,ZodUnknown:()=>M4,ZodUnion:()=>r_,ZodUndefined:()=>N4,ZodUUID:()=>d$,ZodURL:()=>c_,ZodULID:()=>cw,ZodType:()=>t,ZodTuple:()=>Z4,ZodTransform:()=>y4,ZodTemplateLiteral:()=>bg,ZodSymbol:()=>k4,ZodSuccess:()=>s4,ZodStringFormat:()=>b$,ZodString:()=>H_,ZodSet:()=>l4,ZodRecord:()=>t_,ZodRealError:()=>P$,ZodReadonly:()=>wg,ZodPromise:()=>Dg,ZodPrefault:()=>p4,ZodPipe:()=>b6,ZodOptional:()=>w6,ZodObject:()=>m_,ZodNumberFormat:()=>Mv,ZodNumber:()=>q_,ZodNullable:()=>o4,ZodNull:()=>P4,ZodNonOptional:()=>g6,ZodNever:()=>z4,ZodNanoID:()=>xw,ZodNaN:()=>_g,ZodMap:()=>x4,ZodMAC:()=>i4,ZodLiteral:()=>h4,ZodLazy:()=>Ug,ZodKSUID:()=>mw,ZodJWT:()=>sw,ZodIssueCode:()=>u$,ZodIntersection:()=>C4,ZodISOTime:()=>uw,ZodISODuration:()=>Tw,ZodISODateTime:()=>zw,ZodISODate:()=>Sw,ZodIPv6:()=>ow,ZodIPv4:()=>rw,ZodGUID:()=>Z_,ZodFunction:()=>Xg,ZodFirstPartyTypeKind:()=>Qg,ZodFile:()=>c4,ZodExactOptional:()=>m4,ZodError:()=>kD,ZodEnum:()=>W_,ZodEmoji:()=>Zw,ZodEmail:()=>Ew,ZodE164:()=>aw,ZodDiscriminatedUnion:()=>R4,ZodDefault:()=>t4,ZodDate:()=>y_,ZodCustomStringFormat:()=>n_,ZodCustom:()=>d_,ZodCodec:()=>U6,ZodCatch:()=>$g,ZodCUID2:()=>hw,ZodCUID:()=>lw,ZodCIDRv6:()=>dw,ZodCIDRv4:()=>tw,ZodBoolean:()=>I_,ZodBigIntFormat:()=>$6,ZodBigInt:()=>B_,ZodBase64URL:()=>ew,ZodBase64:()=>pw,ZodArray:()=>u4,ZodAny:()=>A4,TimePrecision:()=>Y4,NEVER:()=>l6,$output:()=>J4,$input:()=>D4,$brand:()=>h6});var fD={};$v(fD,{z:()=>J6,xor:()=>lb,xid:()=>Yb,void:()=>Rb,uuidv7:()=>wb,uuidv6:()=>_b,uuidv4:()=>vb,uuid:()=>$b,util:()=>N,url:()=>gb,uppercase:()=>sv,unknown:()=>N$,union:()=>zv,undefined:()=>ub,ulid:()=>Gb,uint64:()=>zb,uint32:()=>fb,tuple:()=>o_,trim:()=>b_,treeifyError:()=>d6,transform:()=>_6,toUpperCase:()=>J_,toLowerCase:()=>U_,toJSONSchema:()=>Mw,templateLiteral:()=>ab,symbol:()=>Sb,superRefine:()=>Yg,success:()=>db,stringbool:()=>U0,stringFormat:()=>Fb,string:()=>F,strictObject:()=>Zb,startsWith:()=>v_,slugify:()=>D_,size:()=>Pv,setErrorMap:()=>ND,set:()=>mb,safeParseAsync:()=>q4,safeParse:()=>n4,safeEncodeAsync:()=>K4,safeEncode:()=>j4,safeDecodeAsync:()=>O4,safeDecode:()=>F4,registry:()=>Kw,regexes:()=>E$,regex:()=>ev,refine:()=>Gg,record:()=>Bv,readonly:()=>gg,property:()=>Pw,promise:()=>sb,prettifyError:()=>p6,preprocess:()=>D0,prefault:()=>e4,positive:()=>Ow,pipe:()=>h_,partialRecord:()=>hb,parseAsync:()=>H4,parse:()=>W4,overwrite:()=>h$,optional:()=>x_,object:()=>u,number:()=>H$,nullish:()=>tb,nullable:()=>l_,null:()=>f4,normalize:()=>g_,nonpositive:()=>kw,nonoptional:()=>a4,nonnegative:()=>Nw,never:()=>v6,negative:()=>iw,nativeEnum:()=>rb,nanoid:()=>Jb,nan:()=>pb,multipleOf:()=>qv,minSize:()=>t$,minLength:()=>vv,mime:()=>w_,meta:()=>g0,maxSize:()=>Iv,maxLength:()=>fv,map:()=>yb,mac:()=>Hb,lte:()=>z$,lt:()=>r$,lowercase:()=>av,looseRecord:()=>cb,looseObject:()=>xb,locales:()=>E_,literal:()=>q$,length:()=>Av,lazy:()=>Jg,ksuid:()=>Qb,keyof:()=>Eb,jwt:()=>jb,json:()=>J0,iso:()=>Q_,ipv6:()=>nb,ipv4:()=>Wb,intersection:()=>E4,int64:()=>Mb,int32:()=>Pb,int:()=>Rw,instanceof:()=>b0,includes:()=>$_,httpUrl:()=>bb,hostname:()=>Kb,hex:()=>Ob,hash:()=>ib,guid:()=>s1,gte:()=>k$,gt:()=>o$,globalRegistry:()=>j$,getErrorMap:()=>PD,function:()=>$0,fromJSONSchema:()=>X0,formatError:()=>T_,float64:()=>Nb,float32:()=>kb,flattenError:()=>u_,file:()=>ob,exactOptional:()=>r4,enum:()=>v$,endsWith:()=>__,encodeAsync:()=>L4,encode:()=>I4,emoji:()=>Ub,email:()=>a1,e164:()=>Vb,discriminatedUnion:()=>Sv,describe:()=>w0,default:()=>FB,decodeAsync:()=>V4,decode:()=>B4,date:()=>Cb,custom:()=>_0,cuid2:()=>Xb,cuid:()=>Db,core:()=>_v,config:()=>n$,coerce:()=>wv,codec:()=>eb,clone:()=>i$,cidrv6:()=>Ib,cidrv4:()=>qb,check:()=>v0,catch:()=>vg,boolean:()=>W$,bigint:()=>Ab,base64url:()=>Lb,base64:()=>Bb,array:()=>g$,any:()=>Tb,_function:()=>$0,_default:()=>d4,_ZodString:()=>Cw,ZodXor:()=>T4,ZodXID:()=>yw,ZodVoid:()=>S4,ZodUnknown:()=>M4,ZodUnion:()=>r_,ZodUndefined:()=>N4,ZodUUID:()=>d$,ZodURL:()=>c_,ZodULID:()=>cw,ZodType:()=>t,ZodTuple:()=>Z4,ZodTransform:()=>y4,ZodTemplateLiteral:()=>bg,ZodSymbol:()=>k4,ZodSuccess:()=>s4,ZodStringFormat:()=>b$,ZodString:()=>H_,ZodSet:()=>l4,ZodRecord:()=>t_,ZodRealError:()=>P$,ZodReadonly:()=>wg,ZodPromise:()=>Dg,ZodPrefault:()=>p4,ZodPipe:()=>b6,ZodOptional:()=>w6,ZodObject:()=>m_,ZodNumberFormat:()=>Mv,ZodNumber:()=>q_,ZodNullable:()=>o4,ZodNull:()=>P4,ZodNonOptional:()=>g6,ZodNever:()=>z4,ZodNanoID:()=>xw,ZodNaN:()=>_g,ZodMap:()=>x4,ZodMAC:()=>i4,ZodLiteral:()=>h4,ZodLazy:()=>Ug,ZodKSUID:()=>mw,ZodJWT:()=>sw,ZodIssueCode:()=>u$,ZodIntersection:()=>C4,ZodISOTime:()=>uw,ZodISODuration:()=>Tw,ZodISODateTime:()=>zw,ZodISODate:()=>Sw,ZodIPv6:()=>ow,ZodIPv4:()=>rw,ZodGUID:()=>Z_,ZodFunction:()=>Xg,ZodFirstPartyTypeKind:()=>Qg,ZodFile:()=>c4,ZodExactOptional:()=>m4,ZodError:()=>kD,ZodEnum:()=>W_,ZodEmoji:()=>Zw,ZodEmail:()=>Ew,ZodE164:()=>aw,ZodDiscriminatedUnion:()=>R4,ZodDefault:()=>t4,ZodDate:()=>y_,ZodCustomStringFormat:()=>n_,ZodCustom:()=>d_,ZodCodec:()=>U6,ZodCatch:()=>$g,ZodCUID2:()=>hw,ZodCUID:()=>lw,ZodCIDRv6:()=>dw,ZodCIDRv4:()=>tw,ZodBoolean:()=>I_,ZodBigIntFormat:()=>$6,ZodBigInt:()=>B_,ZodBase64URL:()=>ew,ZodBase64:()=>pw,ZodArray:()=>u4,ZodAny:()=>A4,TimePrecision:()=>Y4,NEVER:()=>l6,$output:()=>J4,$input:()=>D4,$brand:()=>h6});var J6={};$v(J6,{xor:()=>lb,xid:()=>Yb,void:()=>Rb,uuidv7:()=>wb,uuidv6:()=>_b,uuidv4:()=>vb,uuid:()=>$b,util:()=>N,url:()=>gb,uppercase:()=>sv,unknown:()=>N$,union:()=>zv,undefined:()=>ub,ulid:()=>Gb,uint64:()=>zb,uint32:()=>fb,tuple:()=>o_,trim:()=>b_,treeifyError:()=>d6,transform:()=>_6,toUpperCase:()=>J_,toLowerCase:()=>U_,toJSONSchema:()=>Mw,templateLiteral:()=>ab,symbol:()=>Sb,superRefine:()=>Yg,success:()=>db,stringbool:()=>U0,stringFormat:()=>Fb,string:()=>F,strictObject:()=>Zb,startsWith:()=>v_,slugify:()=>D_,size:()=>Pv,setErrorMap:()=>ND,set:()=>mb,safeParseAsync:()=>q4,safeParse:()=>n4,safeEncodeAsync:()=>K4,safeEncode:()=>j4,safeDecodeAsync:()=>O4,safeDecode:()=>F4,registry:()=>Kw,regexes:()=>E$,regex:()=>ev,refine:()=>Gg,record:()=>Bv,readonly:()=>gg,property:()=>Pw,promise:()=>sb,prettifyError:()=>p6,preprocess:()=>D0,prefault:()=>e4,positive:()=>Ow,pipe:()=>h_,partialRecord:()=>hb,parseAsync:()=>H4,parse:()=>W4,overwrite:()=>h$,optional:()=>x_,object:()=>u,number:()=>H$,nullish:()=>tb,nullable:()=>l_,null:()=>f4,normalize:()=>g_,nonpositive:()=>kw,nonoptional:()=>a4,nonnegative:()=>Nw,never:()=>v6,negative:()=>iw,nativeEnum:()=>rb,nanoid:()=>Jb,nan:()=>pb,multipleOf:()=>qv,minSize:()=>t$,minLength:()=>vv,mime:()=>w_,meta:()=>g0,maxSize:()=>Iv,maxLength:()=>fv,map:()=>yb,mac:()=>Hb,lte:()=>z$,lt:()=>r$,lowercase:()=>av,looseRecord:()=>cb,looseObject:()=>xb,locales:()=>E_,literal:()=>q$,length:()=>Av,lazy:()=>Jg,ksuid:()=>Qb,keyof:()=>Eb,jwt:()=>jb,json:()=>J0,iso:()=>Q_,ipv6:()=>nb,ipv4:()=>Wb,intersection:()=>E4,int64:()=>Mb,int32:()=>Pb,int:()=>Rw,instanceof:()=>b0,includes:()=>$_,httpUrl:()=>bb,hostname:()=>Kb,hex:()=>Ob,hash:()=>ib,guid:()=>s1,gte:()=>k$,gt:()=>o$,globalRegistry:()=>j$,getErrorMap:()=>PD,function:()=>$0,fromJSONSchema:()=>X0,formatError:()=>T_,float64:()=>Nb,float32:()=>kb,flattenError:()=>u_,file:()=>ob,exactOptional:()=>r4,enum:()=>v$,endsWith:()=>__,encodeAsync:()=>L4,encode:()=>I4,emoji:()=>Ub,email:()=>a1,e164:()=>Vb,discriminatedUnion:()=>Sv,describe:()=>w0,decodeAsync:()=>V4,decode:()=>B4,date:()=>Cb,custom:()=>_0,cuid2:()=>Xb,cuid:()=>Db,core:()=>_v,config:()=>n$,coerce:()=>wv,codec:()=>eb,clone:()=>i$,cidrv6:()=>Ib,cidrv4:()=>qb,check:()=>v0,catch:()=>vg,boolean:()=>W$,bigint:()=>Ab,base64url:()=>Lb,base64:()=>Bb,array:()=>g$,any:()=>Tb,_function:()=>$0,_default:()=>d4,_ZodString:()=>Cw,ZodXor:()=>T4,ZodXID:()=>yw,ZodVoid:()=>S4,ZodUnknown:()=>M4,ZodUnion:()=>r_,ZodUndefined:()=>N4,ZodUUID:()=>d$,ZodURL:()=>c_,ZodULID:()=>cw,ZodType:()=>t,ZodTuple:()=>Z4,ZodTransform:()=>y4,ZodTemplateLiteral:()=>bg,ZodSymbol:()=>k4,ZodSuccess:()=>s4,ZodStringFormat:()=>b$,ZodString:()=>H_,ZodSet:()=>l4,ZodRecord:()=>t_,ZodRealError:()=>P$,ZodReadonly:()=>wg,ZodPromise:()=>Dg,ZodPrefault:()=>p4,ZodPipe:()=>b6,ZodOptional:()=>w6,ZodObject:()=>m_,ZodNumberFormat:()=>Mv,ZodNumber:()=>q_,ZodNullable:()=>o4,ZodNull:()=>P4,ZodNonOptional:()=>g6,ZodNever:()=>z4,ZodNanoID:()=>xw,ZodNaN:()=>_g,ZodMap:()=>x4,ZodMAC:()=>i4,ZodLiteral:()=>h4,ZodLazy:()=>Ug,ZodKSUID:()=>mw,ZodJWT:()=>sw,ZodIssueCode:()=>u$,ZodIntersection:()=>C4,ZodISOTime:()=>uw,ZodISODuration:()=>Tw,ZodISODateTime:()=>zw,ZodISODate:()=>Sw,ZodIPv6:()=>ow,ZodIPv4:()=>rw,ZodGUID:()=>Z_,ZodFunction:()=>Xg,ZodFirstPartyTypeKind:()=>Qg,ZodFile:()=>c4,ZodExactOptional:()=>m4,ZodError:()=>kD,ZodEnum:()=>W_,ZodEmoji:()=>Zw,ZodEmail:()=>Ew,ZodE164:()=>aw,ZodDiscriminatedUnion:()=>R4,ZodDefault:()=>t4,ZodDate:()=>y_,ZodCustomStringFormat:()=>n_,ZodCustom:()=>d_,ZodCodec:()=>U6,ZodCatch:()=>$g,ZodCUID2:()=>hw,ZodCUID:()=>lw,ZodCIDRv6:()=>dw,ZodCIDRv4:()=>tw,ZodBoolean:()=>I_,ZodBigIntFormat:()=>$6,ZodBigInt:()=>B_,ZodBase64URL:()=>ew,ZodBase64:()=>pw,ZodArray:()=>u4,ZodAny:()=>A4,TimePrecision:()=>Y4,NEVER:()=>l6,$output:()=>J4,$input:()=>D4,$brand:()=>h6});var _v={};$v(_v,{version:()=>d2,util:()=>N,treeifyError:()=>d6,toJSONSchema:()=>Mw,toDotPath:()=>U8,safeParseAsync:()=>_2,safeParse:()=>v2,safeEncodeAsync:()=>Bq,safeEncode:()=>qq,safeDecodeAsync:()=>Lq,safeDecode:()=>Iq,registry:()=>Kw,regexes:()=>E$,process:()=>J$,prettifyError:()=>p6,parseAsync:()=>U1,parse:()=>b1,meta:()=>TJ,locales:()=>E_,isValidJWT:()=>i8,isValidBase64URL:()=>O8,isValidBase64:()=>I3,initializeContext:()=>X_,globalRegistry:()=>j$,globalConfig:()=>x6,formatError:()=>T_,flattenError:()=>u_,finalize:()=>Y_,extractDefs:()=>G_,encodeAsync:()=>Hq,encode:()=>Qq,describe:()=>uJ,decodeAsync:()=>nq,decode:()=>Wq,createToJSONSchemaMethod:()=>CJ,createStandardJSONSchemaMethod:()=>Aw,config:()=>n$,clone:()=>i$,_xor:()=>cI,_xid:()=>E1,_void:()=>iJ,_uuidv7:()=>z1,_uuidv6:()=>M1,_uuidv4:()=>A1,_uuid:()=>f1,_url:()=>G4,_uppercase:()=>sv,_unknown:()=>KJ,_union:()=>hI,_undefined:()=>VJ,_ulid:()=>C1,_uint64:()=>BJ,_uint32:()=>QJ,_tuple:()=>rI,_trim:()=>b_,_transform:()=>sI,_toUpperCase:()=>J_,_toLowerCase:()=>U_,_templateLiteral:()=>DB,_symbol:()=>LJ,_superRefine:()=>SJ,_success:()=>gB,_stringbool:()=>RJ,_stringFormat:()=>fw,_string:()=>s9,_startsWith:()=>v_,_slugify:()=>D_,_size:()=>Pv,_set:()=>dI,_safeParseAsync:()=>Vw,_safeParse:()=>Lw,_safeEncodeAsync:()=>W1,_safeEncode:()=>Y1,_safeDecodeAsync:()=>H1,_safeDecode:()=>Q1,_regex:()=>ev,_refine:()=>zJ,_record:()=>oI,_readonly:()=>JB,_property:()=>Pw,_promise:()=>GB,_positive:()=>Ow,_pipe:()=>UB,_parseAsync:()=>Bw,_parse:()=>Iw,_overwrite:()=>h$,_optional:()=>$B,_number:()=>UJ,_nullable:()=>vB,_null:()=>jJ,_normalize:()=>g_,_nonpositive:()=>kw,_nonoptional:()=>wB,_nonnegative:()=>Nw,_never:()=>OJ,_negative:()=>iw,_nativeEnum:()=>eI,_nanoid:()=>u1,_nan:()=>PJ,_multipleOf:()=>qv,_minSize:()=>t$,_minLength:()=>vv,_min:()=>k$,_mime:()=>w_,_maxSize:()=>Iv,_maxLength:()=>fv,_max:()=>z$,_map:()=>tI,_mac:()=>vJ,_lte:()=>z$,_lt:()=>r$,_lowercase:()=>av,_literal:()=>aI,_length:()=>Av,_lazy:()=>XB,_ksuid:()=>Z1,_jwt:()=>o1,_isoTime:()=>gJ,_isoDuration:()=>bJ,_isoDateTime:()=>_J,_isoDate:()=>wJ,_ipv6:()=>l1,_ipv4:()=>x1,_intersection:()=>mI,_int64:()=>IJ,_int32:()=>YJ,_int:()=>DJ,_includes:()=>$_,_guid:()=>X4,_gte:()=>k$,_gt:()=>o$,_float64:()=>GJ,_float32:()=>XJ,_file:()=>AJ,_enum:()=>pI,_endsWith:()=>__,_encodeAsync:()=>X1,_encode:()=>J1,_emoji:()=>S1,_email:()=>P1,_e164:()=>r1,_discriminatedUnion:()=>yI,_default:()=>_B,_decodeAsync:()=>G1,_decode:()=>D1,_date:()=>kJ,_custom:()=>MJ,_cuid2:()=>R1,_cuid:()=>T1,_coercedString:()=>$J,_coercedNumber:()=>JJ,_coercedDate:()=>NJ,_coercedBoolean:()=>HJ,_coercedBigint:()=>qJ,_cidrv6:()=>c1,_cidrv4:()=>h1,_check:()=>u8,_catch:()=>bB,_boolean:()=>WJ,_bigint:()=>nJ,_base64url:()=>m1,_base64:()=>y1,_array:()=>fJ,_any:()=>FJ,TimePrecision:()=>Y4,NEVER:()=>l6,JSONSchemaGenerator:()=>jD,JSONSchema:()=>T8,Doc:()=>B1,$output:()=>J4,$input:()=>D4,$constructor:()=>V,$brand:()=>h6,$ZodXor:()=>T3,$ZodXID:()=>U3,$ZodVoid:()=>M3,$ZodUnknown:()=>f3,$ZodUnion:()=>v4,$ZodUndefined:()=>k3,$ZodUUID:()=>a2,$ZodURL:()=>$3,$ZodULID:()=>b3,$ZodType:()=>o,$ZodTuple:()=>k1,$ZodTransform:()=>y3,$ZodTemplateLiteral:()=>v9,$ZodSymbol:()=>i3,$ZodSuccess:()=>p3,$ZodStringFormat:()=>X$,$ZodString:()=>C_,$ZodSet:()=>x3,$ZodRegistry:()=>a9,$ZodRecord:()=>E3,$ZodRealError:()=>C$,$ZodReadonly:()=>$9,$ZodPromise:()=>w9,$ZodPrefault:()=>t3,$ZodPipe:()=>s3,$ZodOptional:()=>N1,$ZodObjectJIT:()=>u3,$ZodObject:()=>P8,$ZodNumberFormat:()=>K3,$ZodNumber:()=>O1,$ZodNullable:()=>r3,$ZodNull:()=>N3,$ZodNonOptional:()=>d3,$ZodNever:()=>A3,$ZodNanoID:()=>_3,$ZodNaN:()=>a3,$ZodMap:()=>Z3,$ZodMAC:()=>H3,$ZodLiteral:()=>h3,$ZodLazy:()=>g9,$ZodKSUID:()=>J3,$ZodJWT:()=>j3,$ZodIntersection:()=>C3,$ZodISOTime:()=>G3,$ZodISODuration:()=>Y3,$ZodISODateTime:()=>D3,$ZodISODate:()=>X3,$ZodIPv6:()=>W3,$ZodIPv4:()=>Q3,$ZodGUID:()=>e2,$ZodFunction:()=>_9,$ZodFile:()=>c3,$ZodExactOptional:()=>m3,$ZodError:()=>t6,$ZodEnum:()=>l3,$ZodEncodeError:()=>z_,$ZodEmoji:()=>v3,$ZodEmail:()=>s2,$ZodE164:()=>V3,$ZodDiscriminatedUnion:()=>R3,$ZodDefault:()=>o3,$ZodDate:()=>z3,$ZodCustomStringFormat:()=>F3,$ZodCustom:()=>b9,$ZodCodec:()=>_4,$ZodCheckUpperCase:()=>h2,$ZodCheckStringFormat:()=>jw,$ZodCheckStartsWith:()=>y2,$ZodCheckSizeEquals:()=>R2,$ZodCheckRegex:()=>x2,$ZodCheckProperty:()=>r2,$ZodCheckOverwrite:()=>t2,$ZodCheckNumberFormat:()=>z2,$ZodCheckMultipleOf:()=>M2,$ZodCheckMinSize:()=>T2,$ZodCheckMinLength:()=>E2,$ZodCheckMimeType:()=>o2,$ZodCheckMaxSize:()=>u2,$ZodCheckMaxLength:()=>C2,$ZodCheckLowerCase:()=>l2,$ZodCheckLessThan:()=>q1,$ZodCheckLengthEquals:()=>Z2,$ZodCheckIncludes:()=>c2,$ZodCheckGreaterThan:()=>I1,$ZodCheckEndsWith:()=>m2,$ZodCheckBigIntFormat:()=>S2,$ZodCheck:()=>Q$,$ZodCatch:()=>e3,$ZodCUID2:()=>g3,$ZodCUID:()=>w3,$ZodCIDRv6:()=>q3,$ZodCIDRv4:()=>n3,$ZodBoolean:()=>$4,$ZodBigIntFormat:()=>O3,$ZodBigInt:()=>i1,$ZodBase64URL:()=>L3,$ZodBase64:()=>B3,$ZodAsyncError:()=>nv,$ZodArray:()=>S3,$ZodAny:()=>P3});var l6=Object.freeze({status:"aborted"});function V($,v,w){function g(D,X){if(!D._zod)Object.defineProperty(D,"_zod",{value:{def:X,constr:J,traits:new Set},enumerable:!1});if(D._zod.traits.has($))return;D._zod.traits.add($),v(D,X);let G=J.prototype,Y=Object.keys(G);for(let Q=0;Q<Y.length;Q++){let H=Y[Q];if(!(H in D))D[H]=G[H].bind(D)}}let _=w?.Parent??Object;class b extends _{}Object.defineProperty(b,"name",{value:$});function J(D){var X;let G=w?.Parent?new b:this;g(G,D),(X=G._zod).deferred??(X.deferred=[]);for(let Y of G._zod.deferred)Y();return G}return Object.defineProperty(J,"init",{value:g}),Object.defineProperty(J,Symbol.hasInstance,{value:(D)=>{if(w?.Parent&&D instanceof w.Parent)return!0;return D?._zod?.traits?.has($)}}),Object.defineProperty(J,"name",{value:$}),J}var h6=Symbol("zod_brand");class nv extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class z_ extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var x6={};function n$($){if($)Object.assign(x6,$);return x6}var N={};$v(N,{unwrapMessage:()=>c6,uint8ArrayToHex:()=>Gq,uint8ArrayToBase64url:()=>Dq,uint8ArrayToBase64:()=>w8,stringifyPrimitive:()=>k,slugify:()=>tU,shallowClone:()=>pU,safeExtend:()=>_q,required:()=>bq,randomString:()=>dn,propertyKeyTypes:()=>m6,promiseAllObject:()=>tn,primitiveTypes:()=>eU,prefixIssues:()=>l$,pick:()=>sn,partial:()=>gq,parsedType:()=>P,optionalKeys:()=>aU,omit:()=>$q,objectClone:()=>mn,numKeys:()=>pn,nullish:()=>ov,normalizeParams:()=>M,mergeDefs:()=>Nv,merge:()=>wq,jsonStringifyReplacer:()=>Hw,joinValues:()=>K,issue:()=>qw,isPlainObject:()=>dv,isObject:()=>S_,hexToUint8Array:()=>Xq,getSizableOrigin:()=>r6,getParsedType:()=>en,getLengthableOrigin:()=>o6,getEnumValues:()=>Ww,getElementAtPath:()=>on,floatSafeRemainder:()=>oU,finalizeIssue:()=>R$,extend:()=>vq,escapeRegex:()=>m$,esc:()=>w1,defineLazy:()=>$$,createTransparentProxy:()=>an,cloneDef:()=>rn,clone:()=>i$,cleanRegex:()=>y6,cleanEnum:()=>Uq,captureStackTrace:()=>g1,cached:()=>nw,base64urlToUint8Array:()=>Jq,base64ToUint8Array:()=>_8,assignProp:()=>tv,assertNotEqual:()=>ln,assertNever:()=>cn,assertIs:()=>hn,assertEqual:()=>xn,assert:()=>yn,allowsEval:()=>dU,aborted:()=>pv,NUMBER_FORMAT_RANGES:()=>sU,Class:()=>g8,BIGINT_FORMAT_RANGES:()=>$2});function xn($){return $}function ln($){return $}function hn($){}function cn($){throw Error("Unexpected value in exhaustive check")}function yn($){}function Ww($){let v=Object.values($).filter((g)=>typeof g==="number");return Object.entries($).filter(([g,_])=>v.indexOf(+g)===-1).map(([g,_])=>_)}function K($,v="|"){return $.map((w)=>k(w)).join(v)}function Hw($,v){if(typeof v==="bigint")return v.toString();return v}function nw($){return{get value(){{let w=$();return Object.defineProperty(this,"value",{value:w}),w}throw Error("cached value already set")}}}function ov($){return $===null||$===void 0}function y6($){let v=$.startsWith("^")?1:0,w=$.endsWith("$")?$.length-1:$.length;return $.slice(v,w)}function oU($,v){let w=($.toString().split(".")[1]||"").length,g=v.toString(),_=(g.split(".")[1]||"").length;if(_===0&&/\d?e-\d?/.test(g)){let X=g.match(/\d?e-(\d?)/);if(X?.[1])_=Number.parseInt(X[1])}let b=w>_?w:_,J=Number.parseInt($.toFixed(b).replace(".","")),D=Number.parseInt(v.toFixed(b).replace(".",""));return J%D/10**b}var v8=Symbol("evaluating");function $$($,v,w){let g=void 0;Object.defineProperty($,v,{get(){if(g===v8)return;if(g===void 0)g=v8,g=w();return g},set(_){Object.defineProperty($,v,{value:_})},configurable:!0})}function mn($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function tv($,v,w){Object.defineProperty($,v,{value:w,writable:!0,enumerable:!0,configurable:!0})}function Nv(...$){let v={};for(let w of $){let g=Object.getOwnPropertyDescriptors(w);Object.assign(v,g)}return Object.defineProperties({},v)}function rn($){return Nv($._zod.def)}function on($,v){if(!v)return $;return v.reduce((w,g)=>w?.[g],$)}function tn($){let v=Object.keys($),w=v.map((g)=>$[g]);return Promise.all(w).then((g)=>{let _={};for(let b=0;b<v.length;b++)_[v[b]]=g[b];return _})}function dn($=10){let w="";for(let g=0;g<$;g++)w+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return w}function w1($){return JSON.stringify($)}function tU($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var g1="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function S_($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var dU=nw(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function dv($){if(S_($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let w=v.prototype;if(S_(w)===!1)return!1;if(Object.prototype.hasOwnProperty.call(w,"isPrototypeOf")===!1)return!1;return!0}function pU($){if(dv($))return{...$};if(Array.isArray($))return[...$];return $}function pn($){let v=0;for(let w in $)if(Object.prototype.hasOwnProperty.call($,w))v++;return v}var en=($)=>{let v=typeof $;switch(v){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},m6=new Set(["string","number","symbol"]),eU=new Set(["string","number","bigint","boolean","symbol","undefined"]);function m$($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function i$($,v,w){let g=new $._zod.constr(v??$._zod.def);if(!v||w?.parent)g._zod.parent=$;return g}function M($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function an($){let v;return new Proxy({},{get(w,g,_){return v??(v=$()),Reflect.get(v,g,_)},set(w,g,_,b){return v??(v=$()),Reflect.set(v,g,_,b)},has(w,g){return v??(v=$()),Reflect.has(v,g)},deleteProperty(w,g){return v??(v=$()),Reflect.deleteProperty(v,g)},ownKeys(w){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(w,g){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,g)},defineProperty(w,g,_){return v??(v=$()),Reflect.defineProperty(v,g,_)}})}function k($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function aU($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var sU={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},$2={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function sn($,v){let w=$._zod.def,g=w.checks;if(g&&g.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let b=Nv($._zod.def,{get shape(){let J={};for(let D in v){if(!(D in w.shape))throw Error(`Unrecognized key: "${D}"`);if(!v[D])continue;J[D]=w.shape[D]}return tv(this,"shape",J),J},checks:[]});return i$($,b)}function $q($,v){let w=$._zod.def,g=w.checks;if(g&&g.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let b=Nv($._zod.def,{get shape(){let J={...$._zod.def.shape};for(let D in v){if(!(D in w.shape))throw Error(`Unrecognized key: "${D}"`);if(!v[D])continue;delete J[D]}return tv(this,"shape",J),J},checks:[]});return i$($,b)}function vq($,v){if(!dv(v))throw Error("Invalid input to extend: expected a plain object");let w=$._zod.def.checks;if(w&&w.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let _=Nv($._zod.def,{get shape(){let b={...$._zod.def.shape,...v};return tv(this,"shape",b),b},checks:[]});return i$($,_)}function _q($,v){if(!dv(v))throw Error("Invalid input to safeExtend: expected a plain object");let w=Nv($._zod.def,{get shape(){let g={...$._zod.def.shape,...v};return tv(this,"shape",g),g}});return i$($,w)}function wq($,v){let w=Nv($._zod.def,{get shape(){let g={...$._zod.def.shape,...v._zod.def.shape};return tv(this,"shape",g),g},get catchall(){return v._zod.def.catchall},checks:[]});return i$($,w)}function gq($,v,w){let _=v._zod.def.checks;if(_&&_.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let J=Nv(v._zod.def,{get shape(){let D=v._zod.def.shape,X={...D};if(w)for(let G in w){if(!(G in D))throw Error(`Unrecognized key: "${G}"`);if(!w[G])continue;X[G]=$?new $({type:"optional",innerType:D[G]}):D[G]}else for(let G in D)X[G]=$?new $({type:"optional",innerType:D[G]}):D[G];return tv(this,"shape",X),X},checks:[]});return i$(v,J)}function bq($,v,w){let g=Nv(v._zod.def,{get shape(){let _=v._zod.def.shape,b={..._};if(w)for(let J in w){if(!(J in b))throw Error(`Unrecognized key: "${J}"`);if(!w[J])continue;b[J]=new $({type:"nonoptional",innerType:_[J]})}else for(let J in _)b[J]=new $({type:"nonoptional",innerType:_[J]});return tv(this,"shape",b),b}});return i$(v,g)}function pv($,v=0){if($.aborted===!0)return!0;for(let w=v;w<$.issues.length;w++)if($.issues[w]?.continue!==!0)return!0;return!1}function l$($,v){return v.map((w)=>{var g;return(g=w).path??(g.path=[]),w.path.unshift($),w})}function c6($){return typeof $==="string"?$:$?.message}function R$($,v,w){let g={...$,path:$.path??[]};if(!$.message){let _=c6($.inst?._zod.def?.error?.($))??c6(v?.error?.($))??c6(w.customError?.($))??c6(w.localeError?.($))??"Invalid input";g.message=_}if(delete g.inst,delete g.continue,!v?.reportInput)delete g.input;return g}function r6($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function o6($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function P($){let v=typeof $;switch(v){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let w=$;if(w&&Object.getPrototypeOf(w)!==Object.prototype&&"constructor"in w&&w.constructor)return w.constructor.name}}return v}function qw(...$){let[v,w,g]=$;if(typeof v==="string")return{message:v,code:"custom",input:w,inst:g};return{...v}}function Uq($){return Object.entries($).filter(([v,w])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function _8($){let v=atob($),w=new Uint8Array(v.length);for(let g=0;g<v.length;g++)w[g]=v.charCodeAt(g);return w}function w8($){let v="";for(let w=0;w<$.length;w++)v+=String.fromCharCode($[w]);return btoa(v)}function Jq($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),w="=".repeat((4-v.length%4)%4);return _8(v+w)}function Dq($){return w8($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Xq($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let w=new Uint8Array(v.length/2);for(let g=0;g<v.length;g+=2)w[g/2]=Number.parseInt(v.slice(g,g+2),16);return w}function Gq($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class g8{constructor(...$){}}var b8=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,Hw,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},t6=V("$ZodError",b8),C$=V("$ZodError",b8,{Parent:Error});function u_($,v=(w)=>w.message){let w={},g=[];for(let _ of $.issues)if(_.path.length>0)w[_.path[0]]=w[_.path[0]]||[],w[_.path[0]].push(v(_));else g.push(v(_));return{formErrors:g,fieldErrors:w}}function T_($,v=(w)=>w.message){let w={_errors:[]},g=(_)=>{for(let b of _.issues)if(b.code==="invalid_union"&&b.errors.length)b.errors.map((J)=>g({issues:J}));else if(b.code==="invalid_key")g({issues:b.issues});else if(b.code==="invalid_element")g({issues:b.issues});else if(b.path.length===0)w._errors.push(v(b));else{let J=w,D=0;while(D<b.path.length){let X=b.path[D];if(D!==b.path.length-1)J[X]=J[X]||{_errors:[]};else J[X]=J[X]||{_errors:[]},J[X]._errors.push(v(b));J=J[X],D++}}};return g($),w}function d6($,v=(w)=>w.message){let w={errors:[]},g=(_,b=[])=>{var J,D;for(let X of _.issues)if(X.code==="invalid_union"&&X.errors.length)X.errors.map((G)=>g({issues:G},X.path));else if(X.code==="invalid_key")g({issues:X.issues},X.path);else if(X.code==="invalid_element")g({issues:X.issues},X.path);else{let G=[...b,...X.path];if(G.length===0){w.errors.push(v(X));continue}let Y=w,Q=0;while(Q<G.length){let H=G[Q],I=Q===G.length-1;if(typeof H==="string")Y.properties??(Y.properties={}),(J=Y.properties)[H]??(J[H]={errors:[]}),Y=Y.properties[H];else Y.items??(Y.items=[]),(D=Y.items)[H]??(D[H]={errors:[]}),Y=Y.items[H];if(I)Y.errors.push(v(X));Q++}}};return g($),w}function U8($){let v=[],w=$.map((g)=>typeof g==="object"?g.key:g);for(let g of w)if(typeof g==="number")v.push(`[${g}]`);else if(typeof g==="symbol")v.push(`[${JSON.stringify(String(g))}]`);else if(/[^\w$]/.test(g))v.push(`[${JSON.stringify(g)}]`);else{if(v.length)v.push(".");v.push(g)}return v.join("")}function p6($){let v=[],w=[...$.issues].sort((g,_)=>(g.path??[]).length-(_.path??[]).length);for(let g of w)if(v.push(`✖ ${g.message}`),g.path?.length)v.push(` → at ${U8(g.path)}`);return v.join(`
140
- `)}var Iw=($)=>(v,w,g,_)=>{let b=g?Object.assign(g,{async:!1}):{async:!1},J=v._zod.run({value:w,issues:[]},b);if(J instanceof Promise)throw new nv;if(J.issues.length){let D=new(_?.Err??$)(J.issues.map((X)=>R$(X,b,n$())));throw g1(D,_?.callee),D}return J.value},b1=Iw(C$),Bw=($)=>async(v,w,g,_)=>{let b=g?Object.assign(g,{async:!0}):{async:!0},J=v._zod.run({value:w,issues:[]},b);if(J instanceof Promise)J=await J;if(J.issues.length){let D=new(_?.Err??$)(J.issues.map((X)=>R$(X,b,n$())));throw g1(D,_?.callee),D}return J.value},U1=Bw(C$),Lw=($)=>(v,w,g)=>{let _=g?{...g,async:!1}:{async:!1},b=v._zod.run({value:w,issues:[]},_);if(b instanceof Promise)throw new nv;return b.issues.length?{success:!1,error:new($??t6)(b.issues.map((J)=>R$(J,_,n$())))}:{success:!0,data:b.value}},v2=Lw(C$),Vw=($)=>async(v,w,g)=>{let _=g?Object.assign(g,{async:!0}):{async:!0},b=v._zod.run({value:w,issues:[]},_);if(b instanceof Promise)b=await b;return b.issues.length?{success:!1,error:new $(b.issues.map((J)=>R$(J,_,n$())))}:{success:!0,data:b.value}},_2=Vw(C$),J1=($)=>(v,w,g)=>{let _=g?Object.assign(g,{direction:"backward"}):{direction:"backward"};return Iw($)(v,w,_)},Qq=J1(C$),D1=($)=>(v,w,g)=>{return Iw($)(v,w,g)},Wq=D1(C$),X1=($)=>async(v,w,g)=>{let _=g?Object.assign(g,{direction:"backward"}):{direction:"backward"};return Bw($)(v,w,_)},Hq=X1(C$),G1=($)=>async(v,w,g)=>{return Bw($)(v,w,g)},nq=G1(C$),Y1=($)=>(v,w,g)=>{let _=g?Object.assign(g,{direction:"backward"}):{direction:"backward"};return Lw($)(v,w,_)},qq=Y1(C$),Q1=($)=>(v,w,g)=>{return Lw($)(v,w,g)},Iq=Q1(C$),W1=($)=>async(v,w,g)=>{let _=g?Object.assign(g,{direction:"backward"}):{direction:"backward"};return Vw($)(v,w,_)},Bq=W1(C$),H1=($)=>async(v,w,g)=>{return Vw($)(v,w,g)},Lq=H1(C$);var E$={};$v(E$,{xid:()=>U2,uuid7:()=>Kq,uuid6:()=>Fq,uuid4:()=>jq,uuid:()=>R_,uppercase:()=>A2,unicodeEmail:()=>J8,undefined:()=>P2,ulid:()=>b2,time:()=>j2,string:()=>K2,sha512_hex:()=>yq,sha512_base64url:()=>rq,sha512_base64:()=>mq,sha384_hex:()=>lq,sha384_base64url:()=>cq,sha384_base64:()=>hq,sha256_hex:()=>Eq,sha256_base64url:()=>xq,sha256_base64:()=>Zq,sha1_hex:()=>Tq,sha1_base64url:()=>Cq,sha1_base64:()=>Rq,rfc5322Email:()=>iq,number:()=>e6,null:()=>N2,nanoid:()=>D2,md5_hex:()=>zq,md5_base64url:()=>uq,md5_base64:()=>Sq,mac:()=>n2,lowercase:()=>f2,ksuid:()=>J2,ipv6:()=>H2,ipv4:()=>W2,integer:()=>i2,idnEmail:()=>kq,html5Email:()=>Oq,hostname:()=>fq,hex:()=>Mq,guid:()=>G2,extendedDuration:()=>Vq,emoji:()=>Q2,email:()=>Y2,e164:()=>L2,duration:()=>X2,domain:()=>Aq,datetime:()=>F2,date:()=>V2,cuid2:()=>g2,cuid:()=>w2,cidrv6:()=>I2,cidrv4:()=>q2,browserEmail:()=>Nq,boolean:()=>k2,bigint:()=>O2,base64url:()=>n1,base64:()=>B2});var w2=/^[cC][^\s-]{8,}$/,g2=/^[0-9a-z]+$/,b2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,U2=/^[0-9a-vA-V]{20}$/,J2=/^[A-Za-z0-9]{27}$/,D2=/^[a-zA-Z0-9_-]{21}$/,X2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Vq=/^[-+]?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)?)??$/,G2=/^([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})$/,R_=($)=>{if(!$)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},jq=R_(4),Fq=R_(6),Kq=R_(7),Y2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Oq=/^[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])?)*$/,iq=/^(([^<>()\[\]\\.,;:\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,}))$/,J8=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,kq=J8,Nq=/^[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])?)*$/,Pq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Q2(){return new RegExp(Pq,"u")}var W2=/^(?:(?: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])$/,H2=/^(([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}|:))$/,n2=($)=>{let v=m$($??":");return new RegExp(`^(?:[0-9A-F]{2}${v}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${v}){5}[0-9a-f]{2}$`)},q2=/^((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])$/,I2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,B2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,n1=/^[A-Za-z0-9_-]*$/,fq=/^(?=.{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])?)*\.?$/,Aq=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,L2=/^\+[1-9]\d{6,14}$/,D8="(?:(?:\\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])))",V2=new RegExp(`^${D8}$`);function X8($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function j2($){return new RegExp(`^${X8($)}$`)}function F2($){let v=X8({precision:$.precision}),w=["Z"];if($.local)w.push("");if($.offset)w.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let g=`${v}(?:${w.join("|")})`;return new RegExp(`^${D8}T(?:${g})$`)}var K2=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},O2=/^-?\d+n?$/,i2=/^-?\d+$/,e6=/^-?\d+(?:\.\d+)?$/,k2=/^(?:true|false)$/i,N2=/^null$/i;var P2=/^undefined$/i;var f2=/^[^A-Z]*$/,A2=/^[^a-z]*$/,Mq=/^[0-9a-fA-F]*$/;function a6($,v){return new RegExp(`^[A-Za-z0-9+/]{${$}}${v}$`)}function s6($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var zq=/^[0-9a-fA-F]{32}$/,Sq=a6(22,"=="),uq=s6(22),Tq=/^[0-9a-fA-F]{40}$/,Rq=a6(27,"="),Cq=s6(27),Eq=/^[0-9a-fA-F]{64}$/,Zq=a6(43,"="),xq=s6(43),lq=/^[0-9a-fA-F]{96}$/,hq=a6(64,""),cq=s6(64),yq=/^[0-9a-fA-F]{128}$/,mq=a6(86,"=="),rq=s6(86);var Q$=V("$ZodCheck",($,v)=>{var w;$._zod??($._zod={}),$._zod.def=v,(w=$._zod).onattach??(w.onattach=[])}),Y8={number:"number",bigint:"bigint",object:"date"},q1=V("$ZodCheckLessThan",($,v)=>{Q$.init($,v);let w=Y8[typeof v.value];$._zod.onattach.push((g)=>{let _=g._zod.bag,b=(v.inclusive?_.maximum:_.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(v.value<b)if(v.inclusive)_.maximum=v.value;else _.exclusiveMaximum=v.value}),$._zod.check=(g)=>{if(v.inclusive?g.value<=v.value:g.value<v.value)return;g.issues.push({origin:w,code:"too_big",maximum:typeof v.value==="object"?v.value.getTime():v.value,input:g.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),I1=V("$ZodCheckGreaterThan",($,v)=>{Q$.init($,v);let w=Y8[typeof v.value];$._zod.onattach.push((g)=>{let _=g._zod.bag,b=(v.inclusive?_.minimum:_.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(v.value>b)if(v.inclusive)_.minimum=v.value;else _.exclusiveMinimum=v.value}),$._zod.check=(g)=>{if(v.inclusive?g.value>=v.value:g.value>v.value)return;g.issues.push({origin:w,code:"too_small",minimum:typeof v.value==="object"?v.value.getTime():v.value,input:g.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),M2=V("$ZodCheckMultipleOf",($,v)=>{Q$.init($,v),$._zod.onattach.push((w)=>{var g;(g=w._zod.bag).multipleOf??(g.multipleOf=v.value)}),$._zod.check=(w)=>{if(typeof w.value!==typeof v.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof w.value==="bigint"?w.value%v.value===BigInt(0):oU(w.value,v.value)===0)return;w.issues.push({origin:typeof w.value,code:"not_multiple_of",divisor:v.value,input:w.value,inst:$,continue:!v.abort})}}),z2=V("$ZodCheckNumberFormat",($,v)=>{Q$.init($,v),v.format=v.format||"float64";let w=v.format?.includes("int"),g=w?"int":"number",[_,b]=sU[v.format];$._zod.onattach.push((J)=>{let D=J._zod.bag;if(D.format=v.format,D.minimum=_,D.maximum=b,w)D.pattern=i2}),$._zod.check=(J)=>{let D=J.value;if(w){if(!Number.isInteger(D)){J.issues.push({expected:g,format:v.format,code:"invalid_type",continue:!1,input:D,inst:$});return}if(!Number.isSafeInteger(D)){if(D>0)J.issues.push({input:D,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:g,inclusive:!0,continue:!v.abort});else J.issues.push({input:D,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:g,inclusive:!0,continue:!v.abort});return}}if(D<_)J.issues.push({origin:"number",input:D,code:"too_small",minimum:_,inclusive:!0,inst:$,continue:!v.abort});if(D>b)J.issues.push({origin:"number",input:D,code:"too_big",maximum:b,inclusive:!0,inst:$,continue:!v.abort})}}),S2=V("$ZodCheckBigIntFormat",($,v)=>{Q$.init($,v);let[w,g]=$2[v.format];$._zod.onattach.push((_)=>{let b=_._zod.bag;b.format=v.format,b.minimum=w,b.maximum=g}),$._zod.check=(_)=>{let b=_.value;if(b<w)_.issues.push({origin:"bigint",input:b,code:"too_small",minimum:w,inclusive:!0,inst:$,continue:!v.abort});if(b>g)_.issues.push({origin:"bigint",input:b,code:"too_big",maximum:g,inclusive:!0,inst:$,continue:!v.abort})}}),u2=V("$ZodCheckMaxSize",($,v)=>{var w;Q$.init($,v),(w=$._zod.def).when??(w.when=(g)=>{let _=g.value;return!ov(_)&&_.size!==void 0}),$._zod.onattach.push((g)=>{let _=g._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<_)g._zod.bag.maximum=v.maximum}),$._zod.check=(g)=>{let _=g.value;if(_.size<=v.maximum)return;g.issues.push({origin:r6(_),code:"too_big",maximum:v.maximum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),T2=V("$ZodCheckMinSize",($,v)=>{var w;Q$.init($,v),(w=$._zod.def).when??(w.when=(g)=>{let _=g.value;return!ov(_)&&_.size!==void 0}),$._zod.onattach.push((g)=>{let _=g._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>_)g._zod.bag.minimum=v.minimum}),$._zod.check=(g)=>{let _=g.value;if(_.size>=v.minimum)return;g.issues.push({origin:r6(_),code:"too_small",minimum:v.minimum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),R2=V("$ZodCheckSizeEquals",($,v)=>{var w;Q$.init($,v),(w=$._zod.def).when??(w.when=(g)=>{let _=g.value;return!ov(_)&&_.size!==void 0}),$._zod.onattach.push((g)=>{let _=g._zod.bag;_.minimum=v.size,_.maximum=v.size,_.size=v.size}),$._zod.check=(g)=>{let _=g.value,b=_.size;if(b===v.size)return;let J=b>v.size;g.issues.push({origin:r6(_),...J?{code:"too_big",maximum:v.size}:{code:"too_small",minimum:v.size},inclusive:!0,exact:!0,input:g.value,inst:$,continue:!v.abort})}}),C2=V("$ZodCheckMaxLength",($,v)=>{var w;Q$.init($,v),(w=$._zod.def).when??(w.when=(g)=>{let _=g.value;return!ov(_)&&_.length!==void 0}),$._zod.onattach.push((g)=>{let _=g._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<_)g._zod.bag.maximum=v.maximum}),$._zod.check=(g)=>{let _=g.value;if(_.length<=v.maximum)return;let J=o6(_);g.issues.push({origin:J,code:"too_big",maximum:v.maximum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),E2=V("$ZodCheckMinLength",($,v)=>{var w;Q$.init($,v),(w=$._zod.def).when??(w.when=(g)=>{let _=g.value;return!ov(_)&&_.length!==void 0}),$._zod.onattach.push((g)=>{let _=g._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>_)g._zod.bag.minimum=v.minimum}),$._zod.check=(g)=>{let _=g.value;if(_.length>=v.minimum)return;let J=o6(_);g.issues.push({origin:J,code:"too_small",minimum:v.minimum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),Z2=V("$ZodCheckLengthEquals",($,v)=>{var w;Q$.init($,v),(w=$._zod.def).when??(w.when=(g)=>{let _=g.value;return!ov(_)&&_.length!==void 0}),$._zod.onattach.push((g)=>{let _=g._zod.bag;_.minimum=v.length,_.maximum=v.length,_.length=v.length}),$._zod.check=(g)=>{let _=g.value,b=_.length;if(b===v.length)return;let J=o6(_),D=b>v.length;g.issues.push({origin:J,...D?{code:"too_big",maximum:v.length}:{code:"too_small",minimum:v.length},inclusive:!0,exact:!0,input:g.value,inst:$,continue:!v.abort})}}),jw=V("$ZodCheckStringFormat",($,v)=>{var w,g;if(Q$.init($,v),$._zod.onattach.push((_)=>{let b=_._zod.bag;if(b.format=v.format,v.pattern)b.patterns??(b.patterns=new Set),b.patterns.add(v.pattern)}),v.pattern)(w=$._zod).check??(w.check=(_)=>{if(v.pattern.lastIndex=0,v.pattern.test(_.value))return;_.issues.push({origin:"string",code:"invalid_format",format:v.format,input:_.value,...v.pattern?{pattern:v.pattern.toString()}:{},inst:$,continue:!v.abort})});else(g=$._zod).check??(g.check=()=>{})}),x2=V("$ZodCheckRegex",($,v)=>{jw.init($,v),$._zod.check=(w)=>{if(v.pattern.lastIndex=0,v.pattern.test(w.value))return;w.issues.push({origin:"string",code:"invalid_format",format:"regex",input:w.value,pattern:v.pattern.toString(),inst:$,continue:!v.abort})}}),l2=V("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=f2),jw.init($,v)}),h2=V("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=A2),jw.init($,v)}),c2=V("$ZodCheckIncludes",($,v)=>{Q$.init($,v);let w=m$(v.includes),g=new RegExp(typeof v.position==="number"?`^.{${v.position}}${w}`:w);v.pattern=g,$._zod.onattach.push((_)=>{let b=_._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(g)}),$._zod.check=(_)=>{if(_.value.includes(v.includes,v.position))return;_.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:v.includes,input:_.value,inst:$,continue:!v.abort})}}),y2=V("$ZodCheckStartsWith",($,v)=>{Q$.init($,v);let w=new RegExp(`^${m$(v.prefix)}.*`);v.pattern??(v.pattern=w),$._zod.onattach.push((g)=>{let _=g._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(w)}),$._zod.check=(g)=>{if(g.value.startsWith(v.prefix))return;g.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:v.prefix,input:g.value,inst:$,continue:!v.abort})}}),m2=V("$ZodCheckEndsWith",($,v)=>{Q$.init($,v);let w=new RegExp(`.*${m$(v.suffix)}$`);v.pattern??(v.pattern=w),$._zod.onattach.push((g)=>{let _=g._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(w)}),$._zod.check=(g)=>{if(g.value.endsWith(v.suffix))return;g.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:v.suffix,input:g.value,inst:$,continue:!v.abort})}});function G8($,v,w){if($.issues.length)v.issues.push(...l$(w,$.issues))}var r2=V("$ZodCheckProperty",($,v)=>{Q$.init($,v),$._zod.check=(w)=>{let g=v.schema._zod.run({value:w.value[v.property],issues:[]},{});if(g instanceof Promise)return g.then((_)=>G8(_,w,v.property));G8(g,w,v.property);return}}),o2=V("$ZodCheckMimeType",($,v)=>{Q$.init($,v);let w=new Set(v.mime);$._zod.onattach.push((g)=>{g._zod.bag.mime=v.mime}),$._zod.check=(g)=>{if(w.has(g.value.type))return;g.issues.push({code:"invalid_value",values:v.mime,input:g.value.type,inst:$,continue:!v.abort})}}),t2=V("$ZodCheckOverwrite",($,v)=>{Q$.init($,v),$._zod.check=(w)=>{w.value=v.tx(w.value)}});class B1{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let w=$.split(`
139
+ `,v)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let v=e0($),w=j6(v);return w.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:w,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let v=e0($),w=j6(v);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:w,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,v){if(this.type!=="comment")return!1;if(this.indent<=v)return!1;return $.every((w)=>w.type==="newline"||w.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}gi.Parser=Q7});var B7=E((Wi)=>{var W7=SX(),Ui=Mg(),Cg=fg(),Ji=cD(),Di=_$(),Xi=cX(),H7=yX();function q7($){let v=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||v&&new Xi.LineCounter||null,prettyErrors:v}}function Gi($,v={}){let{lineCounter:w,prettyErrors:g}=q7(v),_=new H7.Parser(w?.addNewLine),b=new W7.Composer(v),J=Array.from(b.compose(_.parse($)));if(g&&w)for(let D of J)D.errors.forEach(Cg.prettifyError($,w)),D.warnings.forEach(Cg.prettifyError($,w));if(J.length>0)return J;return Object.assign([],{empty:!0},b.streamInfo())}function I7($,v={}){let{lineCounter:w,prettyErrors:g}=q7(v),_=new H7.Parser(w?.addNewLine),b=new W7.Composer(v),J=null;for(let D of b.compose(_.parse($),!0,$.length))if(!J)J=D;else if(J.options.logLevel!=="silent"){J.errors.push(new Cg.YAMLParseError(D.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(g&&w)J.errors.forEach(Cg.prettifyError($,w)),J.warnings.forEach(Cg.prettifyError($,w));return J}function Yi($,v,w){let g=void 0;if(typeof v==="function")g=v;else if(w===void 0&&v&&typeof v==="object")w=v;let _=I7($,w);if(!_)return null;if(_.warnings.forEach((b)=>Ji.warn(_.options.logLevel,b)),_.errors.length>0)if(_.options.logLevel!=="silent")throw _.errors[0];else _.errors=[];return _.toJS(Object.assign({reviver:g},w))}function Qi($,v,w){let g=null;if(typeof v==="function"||Array.isArray(v))g=v;else if(w===void 0&&v)w=v;if(typeof w==="string")w=w.length;if(typeof w==="number"){let _=Math.round(w);w=_<1?void 0:_>8?{indent:8}:{indent:_}}if($===void 0){let{keepUndefined:_}=w??v??{};if(!_)return}if(Di.isDocument($)&&!g)return $.toString(w);return new Ui.Document($,g,w).toString(w)}Wi.parse=Yi;Wi.parseAllDocuments=Gi;Wi.parseDocument=I7;Wi.stringify=Qi});function bG(){let $=new Map;return{register(v,w){$.set(v.name,{definition:v,handler:w})},getTools(){return Array.from($.values()).map((v)=>v.definition)},getHandler(v){return $.get(v)?.handler}}}var $8=gG(rU(),1);var U={};$v(U,{z:()=>d,xor:()=>c1,xid:()=>W1,void:()=>E1,uuidv7:()=>b1,uuidv6:()=>g1,uuidv4:()=>w1,uuid:()=>_1,util:()=>i,url:()=>U1,uppercase:()=>sv,unknown:()=>z$,union:()=>fv,undefined:()=>R1,ulid:()=>Q1,uint64:()=>T1,uint32:()=>M1,tuple:()=>o_,trim:()=>b_,treeifyError:()=>p6,transform:()=>w6,toUpperCase:()=>J_,toLowerCase:()=>U_,toJSONSchema:()=>fw,templateLiteral:()=>$0,symbol:()=>u1,superRefine:()=>Qg,success:()=>e1,stringbool:()=>D0,stringFormat:()=>N1,string:()=>K,strictObject:()=>x1,startsWith:()=>v_,slugify:()=>D_,size:()=>nv,setErrorMap:()=>nD,set:()=>o1,safeParseAsync:()=>B4,safeParse:()=>I4,safeEncodeAsync:()=>N4,safeEncode:()=>K4,safeDecodeAsync:()=>k4,safeDecode:()=>O4,registry:()=>Nw,regexes:()=>E$,regex:()=>ev,refine:()=>Yg,record:()=>Lv,readonly:()=>bg,property:()=>Pw,promise:()=>v0,prettifyError:()=>e6,preprocess:()=>G0,prefault:()=>a4,positive:()=>kw,pipe:()=>l_,partialRecord:()=>y1,parseAsync:()=>q4,parse:()=>H4,overwrite:()=>l$,optional:()=>h_,object:()=>f,number:()=>W$,nullish:()=>p1,nullable:()=>x_,null:()=>A4,normalize:()=>g_,nonpositive:()=>iw,nonoptional:()=>s4,nonnegative:()=>nw,never:()=>_6,negative:()=>zw,nativeEnum:()=>d1,nanoid:()=>X1,nan:()=>a1,multipleOf:()=>Iv,minSize:()=>d$,minLength:()=>vv,mime:()=>w_,meta:()=>U0,maxSize:()=>Bv,maxLength:()=>Pv,map:()=>r1,mac:()=>I1,lte:()=>M$,lt:()=>r$,lowercase:()=>av,looseRecord:()=>m1,looseObject:()=>l1,locales:()=>E_,literal:()=>q$,length:()=>Av,lazy:()=>Dg,ksuid:()=>H1,keyof:()=>h1,jwt:()=>O1,json:()=>X0,iso:()=>Q_,ipv6:()=>B1,ipv4:()=>q1,intersection:()=>Z4,int64:()=>S1,int32:()=>A1,int:()=>Cw,instanceof:()=>J0,includes:()=>$_,httpUrl:()=>J1,hostname:()=>k1,hex:()=>z1,hash:()=>i1,guid:()=>v1,gte:()=>k$,gt:()=>o$,globalRegistry:()=>F$,getErrorMap:()=>PD,function:()=>_0,fromJSONSchema:()=>Y0,formatError:()=>u_,float64:()=>P1,float32:()=>n1,flattenError:()=>T_,file:()=>t1,exactOptional:()=>o4,enum:()=>v$,endsWith:()=>__,encodeAsync:()=>j4,encode:()=>L4,emoji:()=>D1,email:()=>$1,e164:()=>K1,discriminatedUnion:()=>Sv,describe:()=>b0,decodeAsync:()=>F4,decode:()=>V4,date:()=>Z1,custom:()=>g0,cuid2:()=>Y1,cuid:()=>G1,core:()=>_v,config:()=>H$,coerce:()=>wv,codec:()=>s1,clone:()=>N$,cidrv6:()=>V1,cidrv4:()=>L1,check:()=>w0,catch:()=>_g,boolean:()=>Y$,bigint:()=>f1,base64url:()=>F1,base64:()=>j1,array:()=>g$,any:()=>C1,_function:()=>_0,_default:()=>p4,_ZodString:()=>Ew,ZodXor:()=>R4,ZodXID:()=>mw,ZodVoid:()=>T4,ZodUnknown:()=>f4,ZodUnion:()=>r_,ZodUndefined:()=>n4,ZodUUID:()=>t$,ZodURL:()=>c_,ZodULID:()=>yw,ZodType:()=>t,ZodTuple:()=>h4,ZodTransform:()=>m4,ZodTemplateLiteral:()=>Ug,ZodSymbol:()=>i4,ZodSuccess:()=>$g,ZodStringFormat:()=>b$,ZodString:()=>H_,ZodSet:()=>l4,ZodRecord:()=>d_,ZodRealError:()=>i$,ZodReadonly:()=>gg,ZodPromise:()=>Xg,ZodPrefault:()=>e4,ZodPipe:()=>U6,ZodOptional:()=>g6,ZodObject:()=>m_,ZodNumberFormat:()=>Mv,ZodNumber:()=>I_,ZodNullable:()=>d4,ZodNull:()=>P4,ZodNonOptional:()=>b6,ZodNever:()=>S4,ZodNanoID:()=>xw,ZodNaN:()=>wg,ZodMap:()=>x4,ZodMAC:()=>z4,ZodLiteral:()=>c4,ZodLazy:()=>Jg,ZodKSUID:()=>rw,ZodJWT:()=>$6,ZodIssueCode:()=>S$,ZodIntersection:()=>E4,ZodISOTime:()=>uw,ZodISODuration:()=>Rw,ZodISODateTime:()=>Sw,ZodISODate:()=>Tw,ZodIPv6:()=>dw,ZodIPv4:()=>ow,ZodGUID:()=>Z_,ZodFunction:()=>Gg,ZodFirstPartyTypeKind:()=>Wg,ZodFile:()=>y4,ZodExactOptional:()=>r4,ZodError:()=>iD,ZodEnum:()=>W_,ZodEmoji:()=>hw,ZodEmail:()=>Zw,ZodE164:()=>sw,ZodDiscriminatedUnion:()=>C4,ZodDefault:()=>t4,ZodDate:()=>y_,ZodCustomStringFormat:()=>q_,ZodCustom:()=>t_,ZodCodec:()=>J6,ZodCatch:()=>vg,ZodCUID2:()=>cw,ZodCUID:()=>lw,ZodCIDRv6:()=>pw,ZodCIDRv4:()=>tw,ZodBoolean:()=>B_,ZodBigIntFormat:()=>v6,ZodBigInt:()=>L_,ZodBase64URL:()=>aw,ZodBase64:()=>ew,ZodArray:()=>u4,ZodAny:()=>M4,TimePrecision:()=>Q4,NEVER:()=>l6,$output:()=>D4,$input:()=>X4,$brand:()=>c6});var AD={};$v(AD,{z:()=>D6,xor:()=>c1,xid:()=>W1,void:()=>E1,uuidv7:()=>b1,uuidv6:()=>g1,uuidv4:()=>w1,uuid:()=>_1,util:()=>i,url:()=>U1,uppercase:()=>sv,unknown:()=>z$,union:()=>fv,undefined:()=>R1,ulid:()=>Q1,uint64:()=>T1,uint32:()=>M1,tuple:()=>o_,trim:()=>b_,treeifyError:()=>p6,transform:()=>w6,toUpperCase:()=>J_,toLowerCase:()=>U_,toJSONSchema:()=>fw,templateLiteral:()=>$0,symbol:()=>u1,superRefine:()=>Qg,success:()=>e1,stringbool:()=>D0,stringFormat:()=>N1,string:()=>K,strictObject:()=>x1,startsWith:()=>v_,slugify:()=>D_,size:()=>nv,setErrorMap:()=>nD,set:()=>o1,safeParseAsync:()=>B4,safeParse:()=>I4,safeEncodeAsync:()=>N4,safeEncode:()=>K4,safeDecodeAsync:()=>k4,safeDecode:()=>O4,registry:()=>Nw,regexes:()=>E$,regex:()=>ev,refine:()=>Yg,record:()=>Lv,readonly:()=>bg,property:()=>Pw,promise:()=>v0,prettifyError:()=>e6,preprocess:()=>G0,prefault:()=>a4,positive:()=>kw,pipe:()=>l_,partialRecord:()=>y1,parseAsync:()=>q4,parse:()=>H4,overwrite:()=>l$,optional:()=>h_,object:()=>f,number:()=>W$,nullish:()=>p1,nullable:()=>x_,null:()=>A4,normalize:()=>g_,nonpositive:()=>iw,nonoptional:()=>s4,nonnegative:()=>nw,never:()=>_6,negative:()=>zw,nativeEnum:()=>d1,nanoid:()=>X1,nan:()=>a1,multipleOf:()=>Iv,minSize:()=>d$,minLength:()=>vv,mime:()=>w_,meta:()=>U0,maxSize:()=>Bv,maxLength:()=>Pv,map:()=>r1,mac:()=>I1,lte:()=>M$,lt:()=>r$,lowercase:()=>av,looseRecord:()=>m1,looseObject:()=>l1,locales:()=>E_,literal:()=>q$,length:()=>Av,lazy:()=>Dg,ksuid:()=>H1,keyof:()=>h1,jwt:()=>O1,json:()=>X0,iso:()=>Q_,ipv6:()=>B1,ipv4:()=>q1,intersection:()=>Z4,int64:()=>S1,int32:()=>A1,int:()=>Cw,instanceof:()=>J0,includes:()=>$_,httpUrl:()=>J1,hostname:()=>k1,hex:()=>z1,hash:()=>i1,guid:()=>v1,gte:()=>k$,gt:()=>o$,globalRegistry:()=>F$,getErrorMap:()=>PD,function:()=>_0,fromJSONSchema:()=>Y0,formatError:()=>u_,float64:()=>P1,float32:()=>n1,flattenError:()=>T_,file:()=>t1,exactOptional:()=>o4,enum:()=>v$,endsWith:()=>__,encodeAsync:()=>j4,encode:()=>L4,emoji:()=>D1,email:()=>$1,e164:()=>K1,discriminatedUnion:()=>Sv,describe:()=>b0,default:()=>HL,decodeAsync:()=>F4,decode:()=>V4,date:()=>Z1,custom:()=>g0,cuid2:()=>Y1,cuid:()=>G1,core:()=>_v,config:()=>H$,coerce:()=>wv,codec:()=>s1,clone:()=>N$,cidrv6:()=>V1,cidrv4:()=>L1,check:()=>w0,catch:()=>_g,boolean:()=>Y$,bigint:()=>f1,base64url:()=>F1,base64:()=>j1,array:()=>g$,any:()=>C1,_function:()=>_0,_default:()=>p4,_ZodString:()=>Ew,ZodXor:()=>R4,ZodXID:()=>mw,ZodVoid:()=>T4,ZodUnknown:()=>f4,ZodUnion:()=>r_,ZodUndefined:()=>n4,ZodUUID:()=>t$,ZodURL:()=>c_,ZodULID:()=>yw,ZodType:()=>t,ZodTuple:()=>h4,ZodTransform:()=>m4,ZodTemplateLiteral:()=>Ug,ZodSymbol:()=>i4,ZodSuccess:()=>$g,ZodStringFormat:()=>b$,ZodString:()=>H_,ZodSet:()=>l4,ZodRecord:()=>d_,ZodRealError:()=>i$,ZodReadonly:()=>gg,ZodPromise:()=>Xg,ZodPrefault:()=>e4,ZodPipe:()=>U6,ZodOptional:()=>g6,ZodObject:()=>m_,ZodNumberFormat:()=>Mv,ZodNumber:()=>I_,ZodNullable:()=>d4,ZodNull:()=>P4,ZodNonOptional:()=>b6,ZodNever:()=>S4,ZodNanoID:()=>xw,ZodNaN:()=>wg,ZodMap:()=>x4,ZodMAC:()=>z4,ZodLiteral:()=>c4,ZodLazy:()=>Jg,ZodKSUID:()=>rw,ZodJWT:()=>$6,ZodIssueCode:()=>S$,ZodIntersection:()=>E4,ZodISOTime:()=>uw,ZodISODuration:()=>Rw,ZodISODateTime:()=>Sw,ZodISODate:()=>Tw,ZodIPv6:()=>dw,ZodIPv4:()=>ow,ZodGUID:()=>Z_,ZodFunction:()=>Gg,ZodFirstPartyTypeKind:()=>Wg,ZodFile:()=>y4,ZodExactOptional:()=>r4,ZodError:()=>iD,ZodEnum:()=>W_,ZodEmoji:()=>hw,ZodEmail:()=>Zw,ZodE164:()=>sw,ZodDiscriminatedUnion:()=>C4,ZodDefault:()=>t4,ZodDate:()=>y_,ZodCustomStringFormat:()=>q_,ZodCustom:()=>t_,ZodCodec:()=>J6,ZodCatch:()=>vg,ZodCUID2:()=>cw,ZodCUID:()=>lw,ZodCIDRv6:()=>pw,ZodCIDRv4:()=>tw,ZodBoolean:()=>B_,ZodBigIntFormat:()=>v6,ZodBigInt:()=>L_,ZodBase64URL:()=>aw,ZodBase64:()=>ew,ZodArray:()=>u4,ZodAny:()=>M4,TimePrecision:()=>Q4,NEVER:()=>l6,$output:()=>D4,$input:()=>X4,$brand:()=>c6});var D6={};$v(D6,{xor:()=>c1,xid:()=>W1,void:()=>E1,uuidv7:()=>b1,uuidv6:()=>g1,uuidv4:()=>w1,uuid:()=>_1,util:()=>i,url:()=>U1,uppercase:()=>sv,unknown:()=>z$,union:()=>fv,undefined:()=>R1,ulid:()=>Q1,uint64:()=>T1,uint32:()=>M1,tuple:()=>o_,trim:()=>b_,treeifyError:()=>p6,transform:()=>w6,toUpperCase:()=>J_,toLowerCase:()=>U_,toJSONSchema:()=>fw,templateLiteral:()=>$0,symbol:()=>u1,superRefine:()=>Qg,success:()=>e1,stringbool:()=>D0,stringFormat:()=>N1,string:()=>K,strictObject:()=>x1,startsWith:()=>v_,slugify:()=>D_,size:()=>nv,setErrorMap:()=>nD,set:()=>o1,safeParseAsync:()=>B4,safeParse:()=>I4,safeEncodeAsync:()=>N4,safeEncode:()=>K4,safeDecodeAsync:()=>k4,safeDecode:()=>O4,registry:()=>Nw,regexes:()=>E$,regex:()=>ev,refine:()=>Yg,record:()=>Lv,readonly:()=>bg,property:()=>Pw,promise:()=>v0,prettifyError:()=>e6,preprocess:()=>G0,prefault:()=>a4,positive:()=>kw,pipe:()=>l_,partialRecord:()=>y1,parseAsync:()=>q4,parse:()=>H4,overwrite:()=>l$,optional:()=>h_,object:()=>f,number:()=>W$,nullish:()=>p1,nullable:()=>x_,null:()=>A4,normalize:()=>g_,nonpositive:()=>iw,nonoptional:()=>s4,nonnegative:()=>nw,never:()=>_6,negative:()=>zw,nativeEnum:()=>d1,nanoid:()=>X1,nan:()=>a1,multipleOf:()=>Iv,minSize:()=>d$,minLength:()=>vv,mime:()=>w_,meta:()=>U0,maxSize:()=>Bv,maxLength:()=>Pv,map:()=>r1,mac:()=>I1,lte:()=>M$,lt:()=>r$,lowercase:()=>av,looseRecord:()=>m1,looseObject:()=>l1,locales:()=>E_,literal:()=>q$,length:()=>Av,lazy:()=>Dg,ksuid:()=>H1,keyof:()=>h1,jwt:()=>O1,json:()=>X0,iso:()=>Q_,ipv6:()=>B1,ipv4:()=>q1,intersection:()=>Z4,int64:()=>S1,int32:()=>A1,int:()=>Cw,instanceof:()=>J0,includes:()=>$_,httpUrl:()=>J1,hostname:()=>k1,hex:()=>z1,hash:()=>i1,guid:()=>v1,gte:()=>k$,gt:()=>o$,globalRegistry:()=>F$,getErrorMap:()=>PD,function:()=>_0,fromJSONSchema:()=>Y0,formatError:()=>u_,float64:()=>P1,float32:()=>n1,flattenError:()=>T_,file:()=>t1,exactOptional:()=>o4,enum:()=>v$,endsWith:()=>__,encodeAsync:()=>j4,encode:()=>L4,emoji:()=>D1,email:()=>$1,e164:()=>K1,discriminatedUnion:()=>Sv,describe:()=>b0,decodeAsync:()=>F4,decode:()=>V4,date:()=>Z1,custom:()=>g0,cuid2:()=>Y1,cuid:()=>G1,core:()=>_v,config:()=>H$,coerce:()=>wv,codec:()=>s1,clone:()=>N$,cidrv6:()=>V1,cidrv4:()=>L1,check:()=>w0,catch:()=>_g,boolean:()=>Y$,bigint:()=>f1,base64url:()=>F1,base64:()=>j1,array:()=>g$,any:()=>C1,_function:()=>_0,_default:()=>p4,_ZodString:()=>Ew,ZodXor:()=>R4,ZodXID:()=>mw,ZodVoid:()=>T4,ZodUnknown:()=>f4,ZodUnion:()=>r_,ZodUndefined:()=>n4,ZodUUID:()=>t$,ZodURL:()=>c_,ZodULID:()=>yw,ZodType:()=>t,ZodTuple:()=>h4,ZodTransform:()=>m4,ZodTemplateLiteral:()=>Ug,ZodSymbol:()=>i4,ZodSuccess:()=>$g,ZodStringFormat:()=>b$,ZodString:()=>H_,ZodSet:()=>l4,ZodRecord:()=>d_,ZodRealError:()=>i$,ZodReadonly:()=>gg,ZodPromise:()=>Xg,ZodPrefault:()=>e4,ZodPipe:()=>U6,ZodOptional:()=>g6,ZodObject:()=>m_,ZodNumberFormat:()=>Mv,ZodNumber:()=>I_,ZodNullable:()=>d4,ZodNull:()=>P4,ZodNonOptional:()=>b6,ZodNever:()=>S4,ZodNanoID:()=>xw,ZodNaN:()=>wg,ZodMap:()=>x4,ZodMAC:()=>z4,ZodLiteral:()=>c4,ZodLazy:()=>Jg,ZodKSUID:()=>rw,ZodJWT:()=>$6,ZodIssueCode:()=>S$,ZodIntersection:()=>E4,ZodISOTime:()=>uw,ZodISODuration:()=>Rw,ZodISODateTime:()=>Sw,ZodISODate:()=>Tw,ZodIPv6:()=>dw,ZodIPv4:()=>ow,ZodGUID:()=>Z_,ZodFunction:()=>Gg,ZodFirstPartyTypeKind:()=>Wg,ZodFile:()=>y4,ZodExactOptional:()=>r4,ZodError:()=>iD,ZodEnum:()=>W_,ZodEmoji:()=>hw,ZodEmail:()=>Zw,ZodE164:()=>sw,ZodDiscriminatedUnion:()=>C4,ZodDefault:()=>t4,ZodDate:()=>y_,ZodCustomStringFormat:()=>q_,ZodCustom:()=>t_,ZodCodec:()=>J6,ZodCatch:()=>vg,ZodCUID2:()=>cw,ZodCUID:()=>lw,ZodCIDRv6:()=>pw,ZodCIDRv4:()=>tw,ZodBoolean:()=>B_,ZodBigIntFormat:()=>v6,ZodBigInt:()=>L_,ZodBase64URL:()=>aw,ZodBase64:()=>ew,ZodArray:()=>u4,ZodAny:()=>M4,TimePrecision:()=>Q4,NEVER:()=>l6,$output:()=>D4,$input:()=>X4,$brand:()=>c6});var _v={};$v(_v,{version:()=>p2,util:()=>i,treeifyError:()=>p6,toJSONSchema:()=>fw,toDotPath:()=>YG,safeParseAsync:()=>w2,safeParse:()=>_2,safeEncodeAsync:()=>GI,safeEncode:()=>DI,safeDecodeAsync:()=>YI,safeDecode:()=>XI,registry:()=>Nw,regexes:()=>E$,process:()=>U$,prettifyError:()=>e6,parseAsync:()=>Db,parse:()=>Jb,meta:()=>RJ,locales:()=>E_,isValidJWT:()=>AG,isValidBase64URL:()=>PG,isValidBase64:()=>L3,initializeContext:()=>X_,globalRegistry:()=>F$,globalConfig:()=>x6,formatError:()=>u_,flattenError:()=>T_,finalize:()=>Y_,extractDefs:()=>G_,encodeAsync:()=>UI,encode:()=>gI,describe:()=>uJ,decodeAsync:()=>JI,decode:()=>bI,createToJSONSchemaMethod:()=>EJ,createStandardJSONSchemaMethod:()=>Mw,config:()=>H$,clone:()=>N$,_xor:()=>uB,_xid:()=>hb,_void:()=>zJ,_uuidv7:()=>Tb,_uuidv6:()=>Sb,_uuidv4:()=>fb,_uuid:()=>Mb,_url:()=>Y4,_uppercase:()=>sv,_unknown:()=>NJ,_union:()=>TB,_undefined:()=>FJ,_ulid:()=>Zb,_uint64:()=>VJ,_uint32:()=>WJ,_tuple:()=>EB,_trim:()=>b_,_transform:()=>mB,_toUpperCase:()=>J_,_toLowerCase:()=>U_,_templateLiteral:()=>$L,_symbol:()=>jJ,_superRefine:()=>TJ,_success:()=>pB,_stringbool:()=>CJ,_stringFormat:()=>Aw,_string:()=>$J,_startsWith:()=>v_,_slugify:()=>D_,_size:()=>nv,_set:()=>xB,_safeParseAsync:()=>Fw,_safeParse:()=>jw,_safeEncodeAsync:()=>qb,_safeEncode:()=>Wb,_safeDecodeAsync:()=>Ib,_safeDecode:()=>Hb,_regex:()=>ev,_refine:()=>SJ,_record:()=>ZB,_readonly:()=>sB,_property:()=>Pw,_promise:()=>_L,_positive:()=>kw,_pipe:()=>aB,_parseAsync:()=>Vw,_parse:()=>Lw,_overwrite:()=>l$,_optional:()=>rB,_number:()=>JJ,_nullable:()=>oB,_null:()=>KJ,_normalize:()=>g_,_nonpositive:()=>iw,_nonoptional:()=>tB,_nonnegative:()=>nw,_never:()=>kJ,_negative:()=>zw,_nativeEnum:()=>cB,_nanoid:()=>Rb,_nan:()=>PJ,_multipleOf:()=>Iv,_minSize:()=>d$,_minLength:()=>vv,_min:()=>k$,_mime:()=>w_,_maxSize:()=>Bv,_maxLength:()=>Pv,_max:()=>M$,_map:()=>hB,_mac:()=>_J,_lte:()=>M$,_lt:()=>r$,_lowercase:()=>av,_literal:()=>yB,_length:()=>Av,_lazy:()=>vL,_ksuid:()=>xb,_jwt:()=>tb,_isoTime:()=>bJ,_isoDuration:()=>UJ,_isoDateTime:()=>wJ,_isoDate:()=>gJ,_ipv6:()=>cb,_ipv4:()=>lb,_intersection:()=>CB,_int64:()=>LJ,_int32:()=>QJ,_int:()=>XJ,_includes:()=>$_,_guid:()=>G4,_gte:()=>k$,_gt:()=>o$,_float64:()=>YJ,_float32:()=>GJ,_file:()=>MJ,_enum:()=>lB,_endsWith:()=>__,_encodeAsync:()=>Yb,_encode:()=>Xb,_emoji:()=>ub,_email:()=>Ab,_e164:()=>db,_discriminatedUnion:()=>RB,_default:()=>dB,_decodeAsync:()=>Qb,_decode:()=>Gb,_date:()=>iJ,_custom:()=>fJ,_cuid2:()=>Eb,_cuid:()=>Cb,_coercedString:()=>vJ,_coercedNumber:()=>DJ,_coercedDate:()=>nJ,_coercedBoolean:()=>qJ,_coercedBigint:()=>BJ,_cidrv6:()=>mb,_cidrv4:()=>yb,_check:()=>ZG,_catch:()=>eB,_boolean:()=>HJ,_bigint:()=>IJ,_base64url:()=>ob,_base64:()=>rb,_array:()=>AJ,_any:()=>OJ,TimePrecision:()=>Q4,NEVER:()=>l6,JSONSchemaGenerator:()=>KD,JSONSchema:()=>hG,Doc:()=>jb,$output:()=>D4,$input:()=>X4,$constructor:()=>V,$brand:()=>c6,$ZodXor:()=>R3,$ZodXID:()=>J3,$ZodVoid:()=>f3,$ZodUnknown:()=>A3,$ZodUnion:()=>_4,$ZodUndefined:()=>i3,$ZodUUID:()=>s2,$ZodURL:()=>v3,$ZodULID:()=>U3,$ZodType:()=>o,$ZodTuple:()=>nb,$ZodTransform:()=>m3,$ZodTemplateLiteral:()=>_9,$ZodSymbol:()=>z3,$ZodSuccess:()=>e3,$ZodStringFormat:()=>D$,$ZodString:()=>C_,$ZodSet:()=>x3,$ZodRegistry:()=>s9,$ZodRecord:()=>Z3,$ZodRealError:()=>C$,$ZodReadonly:()=>v9,$ZodPromise:()=>g9,$ZodPrefault:()=>t3,$ZodPipe:()=>$9,$ZodOptional:()=>Pb,$ZodObjectJIT:()=>u3,$ZodObject:()=>SG,$ZodNumberFormat:()=>N3,$ZodNumber:()=>zb,$ZodNullable:()=>o3,$ZodNull:()=>n3,$ZodNonOptional:()=>p3,$ZodNever:()=>M3,$ZodNanoID:()=>w3,$ZodNaN:()=>s3,$ZodMap:()=>h3,$ZodMAC:()=>q3,$ZodLiteral:()=>c3,$ZodLazy:()=>b9,$ZodKSUID:()=>D3,$ZodJWT:()=>K3,$ZodIntersection:()=>E3,$ZodISOTime:()=>Y3,$ZodISODuration:()=>Q3,$ZodISODateTime:()=>X3,$ZodISODate:()=>G3,$ZodIPv6:()=>H3,$ZodIPv4:()=>W3,$ZodGUID:()=>a2,$ZodFunction:()=>w9,$ZodFile:()=>y3,$ZodExactOptional:()=>r3,$ZodError:()=>t6,$ZodEnum:()=>l3,$ZodEncodeError:()=>f_,$ZodEmoji:()=>_3,$ZodEmail:()=>$3,$ZodE164:()=>F3,$ZodDiscriminatedUnion:()=>C3,$ZodDefault:()=>d3,$ZodDate:()=>S3,$ZodCustomStringFormat:()=>O3,$ZodCustom:()=>U9,$ZodCodec:()=>w4,$ZodCheckUpperCase:()=>c2,$ZodCheckStringFormat:()=>Kw,$ZodCheckStartsWith:()=>m2,$ZodCheckSizeEquals:()=>C2,$ZodCheckRegex:()=>x2,$ZodCheckProperty:()=>o2,$ZodCheckOverwrite:()=>t2,$ZodCheckNumberFormat:()=>S2,$ZodCheckMultipleOf:()=>f2,$ZodCheckMinSize:()=>R2,$ZodCheckMinLength:()=>Z2,$ZodCheckMimeType:()=>d2,$ZodCheckMaxSize:()=>u2,$ZodCheckMaxLength:()=>E2,$ZodCheckLowerCase:()=>l2,$ZodCheckLessThan:()=>Lb,$ZodCheckLengthEquals:()=>h2,$ZodCheckIncludes:()=>y2,$ZodCheckGreaterThan:()=>Vb,$ZodCheckEndsWith:()=>r2,$ZodCheckBigIntFormat:()=>T2,$ZodCheck:()=>G$,$ZodCatch:()=>a3,$ZodCUID2:()=>b3,$ZodCUID:()=>g3,$ZodCIDRv6:()=>B3,$ZodCIDRv4:()=>I3,$ZodBoolean:()=>v4,$ZodBigIntFormat:()=>k3,$ZodBigInt:()=>ib,$ZodBase64URL:()=>j3,$ZodBase64:()=>V3,$ZodAsyncError:()=>qv,$ZodArray:()=>T3,$ZodAny:()=>P3});var l6=Object.freeze({status:"aborted"});function V($,v,w){function g(D,X){if(!D._zod)Object.defineProperty(D,"_zod",{value:{def:X,constr:J,traits:new Set},enumerable:!1});if(D._zod.traits.has($))return;D._zod.traits.add($),v(D,X);let G=J.prototype,Y=Object.keys(G);for(let Q=0;Q<Y.length;Q++){let W=Y[Q];if(!(W in D))D[W]=G[W].bind(D)}}let _=w?.Parent??Object;class b extends _{}Object.defineProperty(b,"name",{value:$});function J(D){var X;let G=w?.Parent?new b:this;g(G,D),(X=G._zod).deferred??(X.deferred=[]);for(let Y of G._zod.deferred)Y();return G}return Object.defineProperty(J,"init",{value:g}),Object.defineProperty(J,Symbol.hasInstance,{value:(D)=>{if(w?.Parent&&D instanceof w.Parent)return!0;return D?._zod?.traits?.has($)}}),Object.defineProperty(J,"name",{value:$}),J}var c6=Symbol("zod_brand");class qv extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class f_ extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var x6={};function H$($){if($)Object.assign(x6,$);return x6}var i={};$v(i,{unwrapMessage:()=>y6,uint8ArrayToHex:()=>_I,uint8ArrayToBase64url:()=>$I,uint8ArrayToBase64:()=>DG,stringifyPrimitive:()=>z,slugify:()=>tU,shallowClone:()=>eU,safeExtend:()=>dq,required:()=>eq,randomString:()=>xq,propertyKeyTypes:()=>r6,promiseAllObject:()=>hq,primitiveTypes:()=>aU,prefixIssues:()=>x$,pick:()=>mq,partial:()=>pq,parsedType:()=>n,optionalKeys:()=>sU,omit:()=>rq,objectClone:()=>Cq,numKeys:()=>lq,nullish:()=>ov,normalizeParams:()=>A,mergeDefs:()=>iv,merge:()=>tq,jsonStringifyReplacer:()=>qw,joinValues:()=>O,issue:()=>Bw,isPlainObject:()=>tv,isObject:()=>S_,hexToUint8Array:()=>vI,getSizableOrigin:()=>o6,getParsedType:()=>cq,getLengthableOrigin:()=>d6,getEnumValues:()=>Hw,getElementAtPath:()=>Zq,floatSafeRemainder:()=>dU,finalizeIssue:()=>R$,extend:()=>oq,escapeRegex:()=>m$,esc:()=>bb,defineLazy:()=>$$,createTransparentProxy:()=>yq,cloneDef:()=>Eq,clone:()=>N$,cleanRegex:()=>m6,cleanEnum:()=>aq,captureStackTrace:()=>Ub,cached:()=>Iw,base64urlToUint8Array:()=>sq,base64ToUint8Array:()=>JG,assignProp:()=>dv,assertNotEqual:()=>Sq,assertNever:()=>uq,assertIs:()=>Tq,assertEqual:()=>fq,assert:()=>Rq,allowsEval:()=>pU,aborted:()=>pv,NUMBER_FORMAT_RANGES:()=>$2,Class:()=>XG,BIGINT_FORMAT_RANGES:()=>v2});function fq($){return $}function Sq($){return $}function Tq($){}function uq($){throw Error("Unexpected value in exhaustive check")}function Rq($){}function Hw($){let v=Object.values($).filter((g)=>typeof g==="number");return Object.entries($).filter(([g,_])=>v.indexOf(+g)===-1).map(([g,_])=>_)}function O($,v="|"){return $.map((w)=>z(w)).join(v)}function qw($,v){if(typeof v==="bigint")return v.toString();return v}function Iw($){return{get value(){{let w=$();return Object.defineProperty(this,"value",{value:w}),w}throw Error("cached value already set")}}}function ov($){return $===null||$===void 0}function m6($){let v=$.startsWith("^")?1:0,w=$.endsWith("$")?$.length-1:$.length;return $.slice(v,w)}function dU($,v){let w=($.toString().split(".")[1]||"").length,g=v.toString(),_=(g.split(".")[1]||"").length;if(_===0&&/\d?e-\d?/.test(g)){let X=g.match(/\d?e-(\d?)/);if(X?.[1])_=Number.parseInt(X[1])}let b=w>_?w:_,J=Number.parseInt($.toFixed(b).replace(".","")),D=Number.parseInt(v.toFixed(b).replace(".",""));return J%D/10**b}var UG=Symbol("evaluating");function $$($,v,w){let g=void 0;Object.defineProperty($,v,{get(){if(g===UG)return;if(g===void 0)g=UG,g=w();return g},set(_){Object.defineProperty($,v,{value:_})},configurable:!0})}function Cq($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function dv($,v,w){Object.defineProperty($,v,{value:w,writable:!0,enumerable:!0,configurable:!0})}function iv(...$){let v={};for(let w of $){let g=Object.getOwnPropertyDescriptors(w);Object.assign(v,g)}return Object.defineProperties({},v)}function Eq($){return iv($._zod.def)}function Zq($,v){if(!v)return $;return v.reduce((w,g)=>w?.[g],$)}function hq($){let v=Object.keys($),w=v.map((g)=>$[g]);return Promise.all(w).then((g)=>{let _={};for(let b=0;b<v.length;b++)_[v[b]]=g[b];return _})}function xq($=10){let w="";for(let g=0;g<$;g++)w+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return w}function bb($){return JSON.stringify($)}function tU($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ub="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function S_($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var pU=Iw(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function tv($){if(S_($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let w=v.prototype;if(S_(w)===!1)return!1;if(Object.prototype.hasOwnProperty.call(w,"isPrototypeOf")===!1)return!1;return!0}function eU($){if(tv($))return{...$};if(Array.isArray($))return[...$];return $}function lq($){let v=0;for(let w in $)if(Object.prototype.hasOwnProperty.call($,w))v++;return v}var cq=($)=>{let v=typeof $;switch(v){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},r6=new Set(["string","number","symbol"]),aU=new Set(["string","number","bigint","boolean","symbol","undefined"]);function m$($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function N$($,v,w){let g=new $._zod.constr(v??$._zod.def);if(!v||w?.parent)g._zod.parent=$;return g}function A($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function yq($){let v;return new Proxy({},{get(w,g,_){return v??(v=$()),Reflect.get(v,g,_)},set(w,g,_,b){return v??(v=$()),Reflect.set(v,g,_,b)},has(w,g){return v??(v=$()),Reflect.has(v,g)},deleteProperty(w,g){return v??(v=$()),Reflect.deleteProperty(v,g)},ownKeys(w){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(w,g){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,g)},defineProperty(w,g,_){return v??(v=$()),Reflect.defineProperty(v,g,_)}})}function z($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function sU($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var $2={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},v2={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function mq($,v){let w=$._zod.def,g=w.checks;if(g&&g.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let b=iv($._zod.def,{get shape(){let J={};for(let D in v){if(!(D in w.shape))throw Error(`Unrecognized key: "${D}"`);if(!v[D])continue;J[D]=w.shape[D]}return dv(this,"shape",J),J},checks:[]});return N$($,b)}function rq($,v){let w=$._zod.def,g=w.checks;if(g&&g.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let b=iv($._zod.def,{get shape(){let J={...$._zod.def.shape};for(let D in v){if(!(D in w.shape))throw Error(`Unrecognized key: "${D}"`);if(!v[D])continue;delete J[D]}return dv(this,"shape",J),J},checks:[]});return N$($,b)}function oq($,v){if(!tv(v))throw Error("Invalid input to extend: expected a plain object");let w=$._zod.def.checks;if(w&&w.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let _=iv($._zod.def,{get shape(){let b={...$._zod.def.shape,...v};return dv(this,"shape",b),b},checks:[]});return N$($,_)}function dq($,v){if(!tv(v))throw Error("Invalid input to safeExtend: expected a plain object");let w=iv($._zod.def,{get shape(){let g={...$._zod.def.shape,...v};return dv(this,"shape",g),g}});return N$($,w)}function tq($,v){let w=iv($._zod.def,{get shape(){let g={...$._zod.def.shape,...v._zod.def.shape};return dv(this,"shape",g),g},get catchall(){return v._zod.def.catchall},checks:[]});return N$($,w)}function pq($,v,w){let _=v._zod.def.checks;if(_&&_.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let J=iv(v._zod.def,{get shape(){let D=v._zod.def.shape,X={...D};if(w)for(let G in w){if(!(G in D))throw Error(`Unrecognized key: "${G}"`);if(!w[G])continue;X[G]=$?new $({type:"optional",innerType:D[G]}):D[G]}else for(let G in D)X[G]=$?new $({type:"optional",innerType:D[G]}):D[G];return dv(this,"shape",X),X},checks:[]});return N$(v,J)}function eq($,v,w){let g=iv(v._zod.def,{get shape(){let _=v._zod.def.shape,b={..._};if(w)for(let J in w){if(!(J in b))throw Error(`Unrecognized key: "${J}"`);if(!w[J])continue;b[J]=new $({type:"nonoptional",innerType:_[J]})}else for(let J in _)b[J]=new $({type:"nonoptional",innerType:_[J]});return dv(this,"shape",b),b}});return N$(v,g)}function pv($,v=0){if($.aborted===!0)return!0;for(let w=v;w<$.issues.length;w++)if($.issues[w]?.continue!==!0)return!0;return!1}function x$($,v){return v.map((w)=>{var g;return(g=w).path??(g.path=[]),w.path.unshift($),w})}function y6($){return typeof $==="string"?$:$?.message}function R$($,v,w){let g={...$,path:$.path??[]};if(!$.message){let _=y6($.inst?._zod.def?.error?.($))??y6(v?.error?.($))??y6(w.customError?.($))??y6(w.localeError?.($))??"Invalid input";g.message=_}if(delete g.inst,delete g.continue,!v?.reportInput)delete g.input;return g}function o6($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function d6($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function n($){let v=typeof $;switch(v){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let w=$;if(w&&Object.getPrototypeOf(w)!==Object.prototype&&"constructor"in w&&w.constructor)return w.constructor.name}}return v}function Bw(...$){let[v,w,g]=$;if(typeof v==="string")return{message:v,code:"custom",input:w,inst:g};return{...v}}function aq($){return Object.entries($).filter(([v,w])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function JG($){let v=atob($),w=new Uint8Array(v.length);for(let g=0;g<v.length;g++)w[g]=v.charCodeAt(g);return w}function DG($){let v="";for(let w=0;w<$.length;w++)v+=String.fromCharCode($[w]);return btoa(v)}function sq($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),w="=".repeat((4-v.length%4)%4);return JG(v+w)}function $I($){return DG($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function vI($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let w=new Uint8Array(v.length/2);for(let g=0;g<v.length;g+=2)w[g/2]=Number.parseInt(v.slice(g,g+2),16);return w}function _I($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class XG{constructor(...$){}}var GG=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,qw,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},t6=V("$ZodError",GG),C$=V("$ZodError",GG,{Parent:Error});function T_($,v=(w)=>w.message){let w={},g=[];for(let _ of $.issues)if(_.path.length>0)w[_.path[0]]=w[_.path[0]]||[],w[_.path[0]].push(v(_));else g.push(v(_));return{formErrors:g,fieldErrors:w}}function u_($,v=(w)=>w.message){let w={_errors:[]},g=(_)=>{for(let b of _.issues)if(b.code==="invalid_union"&&b.errors.length)b.errors.map((J)=>g({issues:J}));else if(b.code==="invalid_key")g({issues:b.issues});else if(b.code==="invalid_element")g({issues:b.issues});else if(b.path.length===0)w._errors.push(v(b));else{let J=w,D=0;while(D<b.path.length){let X=b.path[D];if(D!==b.path.length-1)J[X]=J[X]||{_errors:[]};else J[X]=J[X]||{_errors:[]},J[X]._errors.push(v(b));J=J[X],D++}}};return g($),w}function p6($,v=(w)=>w.message){let w={errors:[]},g=(_,b=[])=>{var J,D;for(let X of _.issues)if(X.code==="invalid_union"&&X.errors.length)X.errors.map((G)=>g({issues:G},X.path));else if(X.code==="invalid_key")g({issues:X.issues},X.path);else if(X.code==="invalid_element")g({issues:X.issues},X.path);else{let G=[...b,...X.path];if(G.length===0){w.errors.push(v(X));continue}let Y=w,Q=0;while(Q<G.length){let W=G[Q],I=Q===G.length-1;if(typeof W==="string")Y.properties??(Y.properties={}),(J=Y.properties)[W]??(J[W]={errors:[]}),Y=Y.properties[W];else Y.items??(Y.items=[]),(D=Y.items)[W]??(D[W]={errors:[]}),Y=Y.items[W];if(I)Y.errors.push(v(X));Q++}}};return g($),w}function YG($){let v=[],w=$.map((g)=>typeof g==="object"?g.key:g);for(let g of w)if(typeof g==="number")v.push(`[${g}]`);else if(typeof g==="symbol")v.push(`[${JSON.stringify(String(g))}]`);else if(/[^\w$]/.test(g))v.push(`[${JSON.stringify(g)}]`);else{if(v.length)v.push(".");v.push(g)}return v.join("")}function e6($){let v=[],w=[...$.issues].sort((g,_)=>(g.path??[]).length-(_.path??[]).length);for(let g of w)if(v.push(`✖ ${g.message}`),g.path?.length)v.push(` → at ${YG(g.path)}`);return v.join(`
140
+ `)}var Lw=($)=>(v,w,g,_)=>{let b=g?Object.assign(g,{async:!1}):{async:!1},J=v._zod.run({value:w,issues:[]},b);if(J instanceof Promise)throw new qv;if(J.issues.length){let D=new(_?.Err??$)(J.issues.map((X)=>R$(X,b,H$())));throw Ub(D,_?.callee),D}return J.value},Jb=Lw(C$),Vw=($)=>async(v,w,g,_)=>{let b=g?Object.assign(g,{async:!0}):{async:!0},J=v._zod.run({value:w,issues:[]},b);if(J instanceof Promise)J=await J;if(J.issues.length){let D=new(_?.Err??$)(J.issues.map((X)=>R$(X,b,H$())));throw Ub(D,_?.callee),D}return J.value},Db=Vw(C$),jw=($)=>(v,w,g)=>{let _=g?{...g,async:!1}:{async:!1},b=v._zod.run({value:w,issues:[]},_);if(b instanceof Promise)throw new qv;return b.issues.length?{success:!1,error:new($??t6)(b.issues.map((J)=>R$(J,_,H$())))}:{success:!0,data:b.value}},_2=jw(C$),Fw=($)=>async(v,w,g)=>{let _=g?Object.assign(g,{async:!0}):{async:!0},b=v._zod.run({value:w,issues:[]},_);if(b instanceof Promise)b=await b;return b.issues.length?{success:!1,error:new $(b.issues.map((J)=>R$(J,_,H$())))}:{success:!0,data:b.value}},w2=Fw(C$),Xb=($)=>(v,w,g)=>{let _=g?Object.assign(g,{direction:"backward"}):{direction:"backward"};return Lw($)(v,w,_)},gI=Xb(C$),Gb=($)=>(v,w,g)=>{return Lw($)(v,w,g)},bI=Gb(C$),Yb=($)=>async(v,w,g)=>{let _=g?Object.assign(g,{direction:"backward"}):{direction:"backward"};return Vw($)(v,w,_)},UI=Yb(C$),Qb=($)=>async(v,w,g)=>{return Vw($)(v,w,g)},JI=Qb(C$),Wb=($)=>(v,w,g)=>{let _=g?Object.assign(g,{direction:"backward"}):{direction:"backward"};return jw($)(v,w,_)},DI=Wb(C$),Hb=($)=>(v,w,g)=>{return jw($)(v,w,g)},XI=Hb(C$),qb=($)=>async(v,w,g)=>{let _=g?Object.assign(g,{direction:"backward"}):{direction:"backward"};return Fw($)(v,w,_)},GI=qb(C$),Ib=($)=>async(v,w,g)=>{return Fw($)(v,w,g)},YI=Ib(C$);var E$={};$v(E$,{xid:()=>J2,uuid7:()=>qI,uuid6:()=>HI,uuid4:()=>WI,uuid:()=>R_,uppercase:()=>M2,unicodeEmail:()=>QG,undefined:()=>P2,ulid:()=>U2,time:()=>K2,string:()=>N2,sha512_hex:()=>RI,sha512_base64url:()=>EI,sha512_base64:()=>CI,sha384_hex:()=>SI,sha384_base64url:()=>uI,sha384_base64:()=>TI,sha256_hex:()=>AI,sha256_base64url:()=>fI,sha256_base64:()=>MI,sha1_hex:()=>iI,sha1_base64url:()=>PI,sha1_base64:()=>nI,rfc5322Email:()=>BI,number:()=>a6,null:()=>n2,nanoid:()=>X2,md5_hex:()=>NI,md5_base64url:()=>zI,md5_base64:()=>kI,mac:()=>I2,lowercase:()=>A2,ksuid:()=>D2,ipv6:()=>q2,ipv4:()=>H2,integer:()=>z2,idnEmail:()=>LI,html5Email:()=>II,hostname:()=>FI,hex:()=>OI,guid:()=>Y2,extendedDuration:()=>QI,emoji:()=>W2,email:()=>Q2,e164:()=>j2,duration:()=>G2,domain:()=>KI,datetime:()=>O2,date:()=>F2,cuid2:()=>b2,cuid:()=>g2,cidrv6:()=>L2,cidrv4:()=>B2,browserEmail:()=>VI,boolean:()=>i2,bigint:()=>k2,base64url:()=>Bb,base64:()=>V2});var g2=/^[cC][^\s-]{8,}$/,b2=/^[0-9a-z]+$/,U2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,J2=/^[0-9a-vA-V]{20}$/,D2=/^[A-Za-z0-9]{27}$/,X2=/^[a-zA-Z0-9_-]{21}$/,G2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,QI=/^[-+]?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)?)??$/,Y2=/^([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})$/,R_=($)=>{if(!$)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},WI=R_(4),HI=R_(6),qI=R_(7),Q2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,II=/^[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])?)*$/,BI=/^(([^<>()\[\]\\.,;:\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,}))$/,QG=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,LI=QG,VI=/^[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])?)*$/,jI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function W2(){return new RegExp(jI,"u")}var H2=/^(?:(?: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])$/,q2=/^(([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}|:))$/,I2=($)=>{let v=m$($??":");return new RegExp(`^(?:[0-9A-F]{2}${v}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${v}){5}[0-9a-f]{2}$`)},B2=/^((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])$/,L2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,V2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Bb=/^[A-Za-z0-9_-]*$/,FI=/^(?=.{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])?)*\.?$/,KI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,j2=/^\+[1-9]\d{6,14}$/,WG="(?:(?:\\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])))",F2=new RegExp(`^${WG}$`);function HG($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function K2($){return new RegExp(`^${HG($)}$`)}function O2($){let v=HG({precision:$.precision}),w=["Z"];if($.local)w.push("");if($.offset)w.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let g=`${v}(?:${w.join("|")})`;return new RegExp(`^${WG}T(?:${g})$`)}var N2=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},k2=/^-?\d+n?$/,z2=/^-?\d+$/,a6=/^-?\d+(?:\.\d+)?$/,i2=/^(?:true|false)$/i,n2=/^null$/i;var P2=/^undefined$/i;var A2=/^[^A-Z]*$/,M2=/^[^a-z]*$/,OI=/^[0-9a-fA-F]*$/;function s6($,v){return new RegExp(`^[A-Za-z0-9+/]{${$}}${v}$`)}function $4($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var NI=/^[0-9a-fA-F]{32}$/,kI=s6(22,"=="),zI=$4(22),iI=/^[0-9a-fA-F]{40}$/,nI=s6(27,"="),PI=$4(27),AI=/^[0-9a-fA-F]{64}$/,MI=s6(43,"="),fI=$4(43),SI=/^[0-9a-fA-F]{96}$/,TI=s6(64,""),uI=$4(64),RI=/^[0-9a-fA-F]{128}$/,CI=s6(86,"=="),EI=$4(86);var G$=V("$ZodCheck",($,v)=>{var w;$._zod??($._zod={}),$._zod.def=v,(w=$._zod).onattach??(w.onattach=[])}),IG={number:"number",bigint:"bigint",object:"date"},Lb=V("$ZodCheckLessThan",($,v)=>{G$.init($,v);let w=IG[typeof v.value];$._zod.onattach.push((g)=>{let _=g._zod.bag,b=(v.inclusive?_.maximum:_.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(v.value<b)if(v.inclusive)_.maximum=v.value;else _.exclusiveMaximum=v.value}),$._zod.check=(g)=>{if(v.inclusive?g.value<=v.value:g.value<v.value)return;g.issues.push({origin:w,code:"too_big",maximum:typeof v.value==="object"?v.value.getTime():v.value,input:g.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),Vb=V("$ZodCheckGreaterThan",($,v)=>{G$.init($,v);let w=IG[typeof v.value];$._zod.onattach.push((g)=>{let _=g._zod.bag,b=(v.inclusive?_.minimum:_.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(v.value>b)if(v.inclusive)_.minimum=v.value;else _.exclusiveMinimum=v.value}),$._zod.check=(g)=>{if(v.inclusive?g.value>=v.value:g.value>v.value)return;g.issues.push({origin:w,code:"too_small",minimum:typeof v.value==="object"?v.value.getTime():v.value,input:g.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),f2=V("$ZodCheckMultipleOf",($,v)=>{G$.init($,v),$._zod.onattach.push((w)=>{var g;(g=w._zod.bag).multipleOf??(g.multipleOf=v.value)}),$._zod.check=(w)=>{if(typeof w.value!==typeof v.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof w.value==="bigint"?w.value%v.value===BigInt(0):dU(w.value,v.value)===0)return;w.issues.push({origin:typeof w.value,code:"not_multiple_of",divisor:v.value,input:w.value,inst:$,continue:!v.abort})}}),S2=V("$ZodCheckNumberFormat",($,v)=>{G$.init($,v),v.format=v.format||"float64";let w=v.format?.includes("int"),g=w?"int":"number",[_,b]=$2[v.format];$._zod.onattach.push((J)=>{let D=J._zod.bag;if(D.format=v.format,D.minimum=_,D.maximum=b,w)D.pattern=z2}),$._zod.check=(J)=>{let D=J.value;if(w){if(!Number.isInteger(D)){J.issues.push({expected:g,format:v.format,code:"invalid_type",continue:!1,input:D,inst:$});return}if(!Number.isSafeInteger(D)){if(D>0)J.issues.push({input:D,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:g,inclusive:!0,continue:!v.abort});else J.issues.push({input:D,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:g,inclusive:!0,continue:!v.abort});return}}if(D<_)J.issues.push({origin:"number",input:D,code:"too_small",minimum:_,inclusive:!0,inst:$,continue:!v.abort});if(D>b)J.issues.push({origin:"number",input:D,code:"too_big",maximum:b,inclusive:!0,inst:$,continue:!v.abort})}}),T2=V("$ZodCheckBigIntFormat",($,v)=>{G$.init($,v);let[w,g]=v2[v.format];$._zod.onattach.push((_)=>{let b=_._zod.bag;b.format=v.format,b.minimum=w,b.maximum=g}),$._zod.check=(_)=>{let b=_.value;if(b<w)_.issues.push({origin:"bigint",input:b,code:"too_small",minimum:w,inclusive:!0,inst:$,continue:!v.abort});if(b>g)_.issues.push({origin:"bigint",input:b,code:"too_big",maximum:g,inclusive:!0,inst:$,continue:!v.abort})}}),u2=V("$ZodCheckMaxSize",($,v)=>{var w;G$.init($,v),(w=$._zod.def).when??(w.when=(g)=>{let _=g.value;return!ov(_)&&_.size!==void 0}),$._zod.onattach.push((g)=>{let _=g._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<_)g._zod.bag.maximum=v.maximum}),$._zod.check=(g)=>{let _=g.value;if(_.size<=v.maximum)return;g.issues.push({origin:o6(_),code:"too_big",maximum:v.maximum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),R2=V("$ZodCheckMinSize",($,v)=>{var w;G$.init($,v),(w=$._zod.def).when??(w.when=(g)=>{let _=g.value;return!ov(_)&&_.size!==void 0}),$._zod.onattach.push((g)=>{let _=g._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>_)g._zod.bag.minimum=v.minimum}),$._zod.check=(g)=>{let _=g.value;if(_.size>=v.minimum)return;g.issues.push({origin:o6(_),code:"too_small",minimum:v.minimum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),C2=V("$ZodCheckSizeEquals",($,v)=>{var w;G$.init($,v),(w=$._zod.def).when??(w.when=(g)=>{let _=g.value;return!ov(_)&&_.size!==void 0}),$._zod.onattach.push((g)=>{let _=g._zod.bag;_.minimum=v.size,_.maximum=v.size,_.size=v.size}),$._zod.check=(g)=>{let _=g.value,b=_.size;if(b===v.size)return;let J=b>v.size;g.issues.push({origin:o6(_),...J?{code:"too_big",maximum:v.size}:{code:"too_small",minimum:v.size},inclusive:!0,exact:!0,input:g.value,inst:$,continue:!v.abort})}}),E2=V("$ZodCheckMaxLength",($,v)=>{var w;G$.init($,v),(w=$._zod.def).when??(w.when=(g)=>{let _=g.value;return!ov(_)&&_.length!==void 0}),$._zod.onattach.push((g)=>{let _=g._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<_)g._zod.bag.maximum=v.maximum}),$._zod.check=(g)=>{let _=g.value;if(_.length<=v.maximum)return;let J=d6(_);g.issues.push({origin:J,code:"too_big",maximum:v.maximum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),Z2=V("$ZodCheckMinLength",($,v)=>{var w;G$.init($,v),(w=$._zod.def).when??(w.when=(g)=>{let _=g.value;return!ov(_)&&_.length!==void 0}),$._zod.onattach.push((g)=>{let _=g._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>_)g._zod.bag.minimum=v.minimum}),$._zod.check=(g)=>{let _=g.value;if(_.length>=v.minimum)return;let J=d6(_);g.issues.push({origin:J,code:"too_small",minimum:v.minimum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),h2=V("$ZodCheckLengthEquals",($,v)=>{var w;G$.init($,v),(w=$._zod.def).when??(w.when=(g)=>{let _=g.value;return!ov(_)&&_.length!==void 0}),$._zod.onattach.push((g)=>{let _=g._zod.bag;_.minimum=v.length,_.maximum=v.length,_.length=v.length}),$._zod.check=(g)=>{let _=g.value,b=_.length;if(b===v.length)return;let J=d6(_),D=b>v.length;g.issues.push({origin:J,...D?{code:"too_big",maximum:v.length}:{code:"too_small",minimum:v.length},inclusive:!0,exact:!0,input:g.value,inst:$,continue:!v.abort})}}),Kw=V("$ZodCheckStringFormat",($,v)=>{var w,g;if(G$.init($,v),$._zod.onattach.push((_)=>{let b=_._zod.bag;if(b.format=v.format,v.pattern)b.patterns??(b.patterns=new Set),b.patterns.add(v.pattern)}),v.pattern)(w=$._zod).check??(w.check=(_)=>{if(v.pattern.lastIndex=0,v.pattern.test(_.value))return;_.issues.push({origin:"string",code:"invalid_format",format:v.format,input:_.value,...v.pattern?{pattern:v.pattern.toString()}:{},inst:$,continue:!v.abort})});else(g=$._zod).check??(g.check=()=>{})}),x2=V("$ZodCheckRegex",($,v)=>{Kw.init($,v),$._zod.check=(w)=>{if(v.pattern.lastIndex=0,v.pattern.test(w.value))return;w.issues.push({origin:"string",code:"invalid_format",format:"regex",input:w.value,pattern:v.pattern.toString(),inst:$,continue:!v.abort})}}),l2=V("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=A2),Kw.init($,v)}),c2=V("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=M2),Kw.init($,v)}),y2=V("$ZodCheckIncludes",($,v)=>{G$.init($,v);let w=m$(v.includes),g=new RegExp(typeof v.position==="number"?`^.{${v.position}}${w}`:w);v.pattern=g,$._zod.onattach.push((_)=>{let b=_._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(g)}),$._zod.check=(_)=>{if(_.value.includes(v.includes,v.position))return;_.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:v.includes,input:_.value,inst:$,continue:!v.abort})}}),m2=V("$ZodCheckStartsWith",($,v)=>{G$.init($,v);let w=new RegExp(`^${m$(v.prefix)}.*`);v.pattern??(v.pattern=w),$._zod.onattach.push((g)=>{let _=g._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(w)}),$._zod.check=(g)=>{if(g.value.startsWith(v.prefix))return;g.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:v.prefix,input:g.value,inst:$,continue:!v.abort})}}),r2=V("$ZodCheckEndsWith",($,v)=>{G$.init($,v);let w=new RegExp(`.*${m$(v.suffix)}$`);v.pattern??(v.pattern=w),$._zod.onattach.push((g)=>{let _=g._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(w)}),$._zod.check=(g)=>{if(g.value.endsWith(v.suffix))return;g.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:v.suffix,input:g.value,inst:$,continue:!v.abort})}});function qG($,v,w){if($.issues.length)v.issues.push(...x$(w,$.issues))}var o2=V("$ZodCheckProperty",($,v)=>{G$.init($,v),$._zod.check=(w)=>{let g=v.schema._zod.run({value:w.value[v.property],issues:[]},{});if(g instanceof Promise)return g.then((_)=>qG(_,w,v.property));qG(g,w,v.property);return}}),d2=V("$ZodCheckMimeType",($,v)=>{G$.init($,v);let w=new Set(v.mime);$._zod.onattach.push((g)=>{g._zod.bag.mime=v.mime}),$._zod.check=(g)=>{if(w.has(g.value.type))return;g.issues.push({code:"invalid_value",values:v.mime,input:g.value.type,inst:$,continue:!v.abort})}}),t2=V("$ZodCheckOverwrite",($,v)=>{G$.init($,v),$._zod.check=(w)=>{w.value=v.tx(w.value)}});class jb{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let w=$.split(`
141
141
  `).filter((b)=>b),g=Math.min(...w.map((b)=>b.length-b.trimStart().length)),_=w.map((b)=>b.slice(g)).map((b)=>" ".repeat(this.indent*2)+b);for(let b of _)this.content.push(b)}compile(){let $=Function,v=this?.args,g=[...(this?.content??[""]).map((_)=>` ${_}`)];return new $(...v,g.join(`
142
- `))}}var d2={major:4,minor:3,patch:0};var o=V("$ZodType",($,v)=>{var w;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=d2;let g=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))g.unshift($);for(let _ of g)for(let b of _._zod.onattach)b($);if(g.length===0)(w=$._zod).deferred??(w.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let _=(J,D,X)=>{let G=pv(J),Y;for(let Q of D){if(Q._zod.def.when){if(!Q._zod.def.when(J))continue}else if(G)continue;let H=J.issues.length,I=Q._zod.check(J);if(I instanceof Promise&&X?.async===!1)throw new nv;if(Y||I instanceof Promise)Y=(Y??Promise.resolve()).then(async()=>{if(await I,J.issues.length===H)return;if(!G)G=pv(J,H)});else{if(J.issues.length===H)continue;if(!G)G=pv(J,H)}}if(Y)return Y.then(()=>{return J});return J},b=(J,D,X)=>{if(pv(J))return J.aborted=!0,J;let G=_(D,g,X);if(G instanceof Promise){if(X.async===!1)throw new nv;return G.then((Y)=>$._zod.parse(Y,X))}return $._zod.parse(G,X)};$._zod.run=(J,D)=>{if(D.skipChecks)return $._zod.parse(J,D);if(D.direction==="backward"){let G=$._zod.parse({value:J.value,issues:[]},{...D,skipChecks:!0});if(G instanceof Promise)return G.then((Y)=>{return b(Y,J,D)});return b(G,J,D)}let X=$._zod.parse(J,D);if(X instanceof Promise){if(D.async===!1)throw new nv;return X.then((G)=>_(G,g,D))}return _(X,g,D)}}$$($,"~standard",()=>({validate:(_)=>{try{let b=v2($,_);return b.success?{value:b.data}:{issues:b.error?.issues}}catch(b){return _2($,_).then((J)=>J.success?{value:J.data}:{issues:J.error?.issues})}},vendor:"zod",version:1}))}),C_=V("$ZodString",($,v)=>{o.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??K2($._zod.bag),$._zod.parse=(w,g)=>{if(v.coerce)try{w.value=String(w.value)}catch(_){}if(typeof w.value==="string")return w;return w.issues.push({expected:"string",code:"invalid_type",input:w.value,inst:$}),w}}),X$=V("$ZodStringFormat",($,v)=>{jw.init($,v),C_.init($,v)}),e2=V("$ZodGUID",($,v)=>{v.pattern??(v.pattern=G2),X$.init($,v)}),a2=V("$ZodUUID",($,v)=>{if(v.version){let g={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[v.version];if(g===void 0)throw Error(`Invalid UUID version: "${v.version}"`);v.pattern??(v.pattern=R_(g))}else v.pattern??(v.pattern=R_());X$.init($,v)}),s2=V("$ZodEmail",($,v)=>{v.pattern??(v.pattern=Y2),X$.init($,v)}),$3=V("$ZodURL",($,v)=>{X$.init($,v),$._zod.check=(w)=>{try{let g=w.value.trim(),_=new URL(g);if(v.hostname){if(v.hostname.lastIndex=0,!v.hostname.test(_.hostname))w.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:v.hostname.source,input:w.value,inst:$,continue:!v.abort})}if(v.protocol){if(v.protocol.lastIndex=0,!v.protocol.test(_.protocol.endsWith(":")?_.protocol.slice(0,-1):_.protocol))w.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:v.protocol.source,input:w.value,inst:$,continue:!v.abort})}if(v.normalize)w.value=_.href;else w.value=g;return}catch(g){w.issues.push({code:"invalid_format",format:"url",input:w.value,inst:$,continue:!v.abort})}}}),v3=V("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=Q2()),X$.init($,v)}),_3=V("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=D2),X$.init($,v)}),w3=V("$ZodCUID",($,v)=>{v.pattern??(v.pattern=w2),X$.init($,v)}),g3=V("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=g2),X$.init($,v)}),b3=V("$ZodULID",($,v)=>{v.pattern??(v.pattern=b2),X$.init($,v)}),U3=V("$ZodXID",($,v)=>{v.pattern??(v.pattern=U2),X$.init($,v)}),J3=V("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=J2),X$.init($,v)}),D3=V("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=F2(v)),X$.init($,v)}),X3=V("$ZodISODate",($,v)=>{v.pattern??(v.pattern=V2),X$.init($,v)}),G3=V("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=j2(v)),X$.init($,v)}),Y3=V("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=X2),X$.init($,v)}),Q3=V("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=W2),X$.init($,v),$._zod.bag.format="ipv4"}),W3=V("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=H2),X$.init($,v),$._zod.bag.format="ipv6",$._zod.check=(w)=>{try{new URL(`http://[${w.value}]`)}catch{w.issues.push({code:"invalid_format",format:"ipv6",input:w.value,inst:$,continue:!v.abort})}}}),H3=V("$ZodMAC",($,v)=>{v.pattern??(v.pattern=n2(v.delimiter)),X$.init($,v),$._zod.bag.format="mac"}),n3=V("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=q2),X$.init($,v)}),q3=V("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=I2),X$.init($,v),$._zod.check=(w)=>{let g=w.value.split("/");try{if(g.length!==2)throw Error();let[_,b]=g;if(!b)throw Error();let J=Number(b);if(`${J}`!==b)throw Error();if(J<0||J>128)throw Error();new URL(`http://[${_}]`)}catch{w.issues.push({code:"invalid_format",format:"cidrv6",input:w.value,inst:$,continue:!v.abort})}}});function I3($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var B3=V("$ZodBase64",($,v)=>{v.pattern??(v.pattern=B2),X$.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(w)=>{if(I3(w.value))return;w.issues.push({code:"invalid_format",format:"base64",input:w.value,inst:$,continue:!v.abort})}});function O8($){if(!n1.test($))return!1;let v=$.replace(/[-_]/g,(g)=>g==="-"?"+":"/"),w=v.padEnd(Math.ceil(v.length/4)*4,"=");return I3(w)}var L3=V("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=n1),X$.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(w)=>{if(O8(w.value))return;w.issues.push({code:"invalid_format",format:"base64url",input:w.value,inst:$,continue:!v.abort})}}),V3=V("$ZodE164",($,v)=>{v.pattern??(v.pattern=L2),X$.init($,v)});function i8($,v=null){try{let w=$.split(".");if(w.length!==3)return!1;let[g]=w;if(!g)return!1;let _=JSON.parse(atob(g));if("typ"in _&&_?.typ!=="JWT")return!1;if(!_.alg)return!1;if(v&&(!("alg"in _)||_.alg!==v))return!1;return!0}catch{return!1}}var j3=V("$ZodJWT",($,v)=>{X$.init($,v),$._zod.check=(w)=>{if(i8(w.value,v.alg))return;w.issues.push({code:"invalid_format",format:"jwt",input:w.value,inst:$,continue:!v.abort})}}),F3=V("$ZodCustomStringFormat",($,v)=>{X$.init($,v),$._zod.check=(w)=>{if(v.fn(w.value))return;w.issues.push({code:"invalid_format",format:v.format,input:w.value,inst:$,continue:!v.abort})}}),O1=V("$ZodNumber",($,v)=>{o.init($,v),$._zod.pattern=$._zod.bag.pattern??e6,$._zod.parse=(w,g)=>{if(v.coerce)try{w.value=Number(w.value)}catch(J){}let _=w.value;if(typeof _==="number"&&!Number.isNaN(_)&&Number.isFinite(_))return w;let b=typeof _==="number"?Number.isNaN(_)?"NaN":!Number.isFinite(_)?"Infinity":void 0:void 0;return w.issues.push({expected:"number",code:"invalid_type",input:_,inst:$,...b?{received:b}:{}}),w}}),K3=V("$ZodNumberFormat",($,v)=>{z2.init($,v),O1.init($,v)}),$4=V("$ZodBoolean",($,v)=>{o.init($,v),$._zod.pattern=k2,$._zod.parse=(w,g)=>{if(v.coerce)try{w.value=Boolean(w.value)}catch(b){}let _=w.value;if(typeof _==="boolean")return w;return w.issues.push({expected:"boolean",code:"invalid_type",input:_,inst:$}),w}}),i1=V("$ZodBigInt",($,v)=>{o.init($,v),$._zod.pattern=O2,$._zod.parse=(w,g)=>{if(v.coerce)try{w.value=BigInt(w.value)}catch(_){}if(typeof w.value==="bigint")return w;return w.issues.push({expected:"bigint",code:"invalid_type",input:w.value,inst:$}),w}}),O3=V("$ZodBigIntFormat",($,v)=>{S2.init($,v),i1.init($,v)}),i3=V("$ZodSymbol",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(typeof _==="symbol")return w;return w.issues.push({expected:"symbol",code:"invalid_type",input:_,inst:$}),w}}),k3=V("$ZodUndefined",($,v)=>{o.init($,v),$._zod.pattern=P2,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(w,g)=>{let _=w.value;if(typeof _>"u")return w;return w.issues.push({expected:"undefined",code:"invalid_type",input:_,inst:$}),w}}),N3=V("$ZodNull",($,v)=>{o.init($,v),$._zod.pattern=N2,$._zod.values=new Set([null]),$._zod.parse=(w,g)=>{let _=w.value;if(_===null)return w;return w.issues.push({expected:"null",code:"invalid_type",input:_,inst:$}),w}}),P3=V("$ZodAny",($,v)=>{o.init($,v),$._zod.parse=(w)=>w}),f3=V("$ZodUnknown",($,v)=>{o.init($,v),$._zod.parse=(w)=>w}),A3=V("$ZodNever",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{return w.issues.push({expected:"never",code:"invalid_type",input:w.value,inst:$}),w}}),M3=V("$ZodVoid",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(typeof _>"u")return w;return w.issues.push({expected:"void",code:"invalid_type",input:_,inst:$}),w}}),z3=V("$ZodDate",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{if(v.coerce)try{w.value=new Date(w.value)}catch(D){}let _=w.value,b=_ instanceof Date;if(b&&!Number.isNaN(_.getTime()))return w;return w.issues.push({expected:"date",code:"invalid_type",input:_,...b?{received:"Invalid Date"}:{},inst:$}),w}});function W8($,v,w){if($.issues.length)v.issues.push(...l$(w,$.issues));v.value[w]=$.value}var S3=V("$ZodArray",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(!Array.isArray(_))return w.issues.push({expected:"array",code:"invalid_type",input:_,inst:$}),w;w.value=Array(_.length);let b=[];for(let J=0;J<_.length;J++){let D=_[J],X=v.element._zod.run({value:D,issues:[]},g);if(X instanceof Promise)b.push(X.then((G)=>W8(G,w,J)));else W8(X,w,J)}if(b.length)return Promise.all(b).then(()=>w);return w}});function K1($,v,w,g,_){if($.issues.length){if(_&&!(w in g))return;v.issues.push(...l$(w,$.issues))}if($.value===void 0){if(w in g)v.value[w]=void 0}else v.value[w]=$.value}function k8($){let v=Object.keys($.shape);for(let g of v)if(!$.shape?.[g]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${g}": expected a Zod schema`);let w=aU($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(w)}}function N8($,v,w,g,_,b){let J=[],D=_.keySet,X=_.catchall._zod,G=X.def.type,Y=X.optout==="optional";for(let Q in v){if(D.has(Q))continue;if(G==="never"){J.push(Q);continue}let H=X.run({value:v[Q],issues:[]},g);if(H instanceof Promise)$.push(H.then((I)=>K1(I,w,Q,v,Y)));else K1(H,w,Q,v,Y)}if(J.length)w.issues.push({code:"unrecognized_keys",keys:J,input:v,inst:b});if(!$.length)return w;return Promise.all($).then(()=>{return w})}var P8=V("$ZodObject",($,v)=>{if(o.init($,v),!Object.getOwnPropertyDescriptor(v,"shape")?.get){let D=v.shape;Object.defineProperty(v,"shape",{get:()=>{let X={...D};return Object.defineProperty(v,"shape",{value:X}),X}})}let g=nw(()=>k8(v));$$($._zod,"propValues",()=>{let D=v.shape,X={};for(let G in D){let Y=D[G]._zod;if(Y.values){X[G]??(X[G]=new Set);for(let Q of Y.values)X[G].add(Q)}}return X});let _=S_,b=v.catchall,J;$._zod.parse=(D,X)=>{J??(J=g.value);let G=D.value;if(!_(G))return D.issues.push({expected:"object",code:"invalid_type",input:G,inst:$}),D;D.value={};let Y=[],Q=J.shape;for(let H of J.keys){let I=Q[H],q=I._zod.optout==="optional",W=I._zod.run({value:G[H],issues:[]},X);if(W instanceof Promise)Y.push(W.then((B)=>K1(B,D,H,G,q)));else K1(W,D,H,G,q)}if(!b)return Y.length?Promise.all(Y).then(()=>D):D;return N8(Y,G,D,X,g.value,$)}}),u3=V("$ZodObjectJIT",($,v)=>{P8.init($,v);let w=$._zod.parse,g=nw(()=>k8(v)),_=(H)=>{let I=new B1(["shape","payload","ctx"]),q=g.value,W=(z)=>{let C=w1(z);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};I.write("const input = payload.value;");let B=Object.create(null),j=0;for(let z of q.keys)B[z]=`key_${j++}`;I.write("const newResult = {};");for(let z of q.keys){let C=B[z],Z=w1(z),y=H[z]?._zod?.optout==="optional";if(I.write(`const ${C} = ${W(z)};`),y)I.write(`
142
+ `))}}var p2={major:4,minor:3,patch:0};var o=V("$ZodType",($,v)=>{var w;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=p2;let g=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))g.unshift($);for(let _ of g)for(let b of _._zod.onattach)b($);if(g.length===0)(w=$._zod).deferred??(w.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let _=(J,D,X)=>{let G=pv(J),Y;for(let Q of D){if(Q._zod.def.when){if(!Q._zod.def.when(J))continue}else if(G)continue;let W=J.issues.length,I=Q._zod.check(J);if(I instanceof Promise&&X?.async===!1)throw new qv;if(Y||I instanceof Promise)Y=(Y??Promise.resolve()).then(async()=>{if(await I,J.issues.length===W)return;if(!G)G=pv(J,W)});else{if(J.issues.length===W)continue;if(!G)G=pv(J,W)}}if(Y)return Y.then(()=>{return J});return J},b=(J,D,X)=>{if(pv(J))return J.aborted=!0,J;let G=_(D,g,X);if(G instanceof Promise){if(X.async===!1)throw new qv;return G.then((Y)=>$._zod.parse(Y,X))}return $._zod.parse(G,X)};$._zod.run=(J,D)=>{if(D.skipChecks)return $._zod.parse(J,D);if(D.direction==="backward"){let G=$._zod.parse({value:J.value,issues:[]},{...D,skipChecks:!0});if(G instanceof Promise)return G.then((Y)=>{return b(Y,J,D)});return b(G,J,D)}let X=$._zod.parse(J,D);if(X instanceof Promise){if(D.async===!1)throw new qv;return X.then((G)=>_(G,g,D))}return _(X,g,D)}}$$($,"~standard",()=>({validate:(_)=>{try{let b=_2($,_);return b.success?{value:b.data}:{issues:b.error?.issues}}catch(b){return w2($,_).then((J)=>J.success?{value:J.data}:{issues:J.error?.issues})}},vendor:"zod",version:1}))}),C_=V("$ZodString",($,v)=>{o.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??N2($._zod.bag),$._zod.parse=(w,g)=>{if(v.coerce)try{w.value=String(w.value)}catch(_){}if(typeof w.value==="string")return w;return w.issues.push({expected:"string",code:"invalid_type",input:w.value,inst:$}),w}}),D$=V("$ZodStringFormat",($,v)=>{Kw.init($,v),C_.init($,v)}),a2=V("$ZodGUID",($,v)=>{v.pattern??(v.pattern=Y2),D$.init($,v)}),s2=V("$ZodUUID",($,v)=>{if(v.version){let g={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[v.version];if(g===void 0)throw Error(`Invalid UUID version: "${v.version}"`);v.pattern??(v.pattern=R_(g))}else v.pattern??(v.pattern=R_());D$.init($,v)}),$3=V("$ZodEmail",($,v)=>{v.pattern??(v.pattern=Q2),D$.init($,v)}),v3=V("$ZodURL",($,v)=>{D$.init($,v),$._zod.check=(w)=>{try{let g=w.value.trim(),_=new URL(g);if(v.hostname){if(v.hostname.lastIndex=0,!v.hostname.test(_.hostname))w.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:v.hostname.source,input:w.value,inst:$,continue:!v.abort})}if(v.protocol){if(v.protocol.lastIndex=0,!v.protocol.test(_.protocol.endsWith(":")?_.protocol.slice(0,-1):_.protocol))w.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:v.protocol.source,input:w.value,inst:$,continue:!v.abort})}if(v.normalize)w.value=_.href;else w.value=g;return}catch(g){w.issues.push({code:"invalid_format",format:"url",input:w.value,inst:$,continue:!v.abort})}}}),_3=V("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=W2()),D$.init($,v)}),w3=V("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=X2),D$.init($,v)}),g3=V("$ZodCUID",($,v)=>{v.pattern??(v.pattern=g2),D$.init($,v)}),b3=V("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=b2),D$.init($,v)}),U3=V("$ZodULID",($,v)=>{v.pattern??(v.pattern=U2),D$.init($,v)}),J3=V("$ZodXID",($,v)=>{v.pattern??(v.pattern=J2),D$.init($,v)}),D3=V("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=D2),D$.init($,v)}),X3=V("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=O2(v)),D$.init($,v)}),G3=V("$ZodISODate",($,v)=>{v.pattern??(v.pattern=F2),D$.init($,v)}),Y3=V("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=K2(v)),D$.init($,v)}),Q3=V("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=G2),D$.init($,v)}),W3=V("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=H2),D$.init($,v),$._zod.bag.format="ipv4"}),H3=V("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=q2),D$.init($,v),$._zod.bag.format="ipv6",$._zod.check=(w)=>{try{new URL(`http://[${w.value}]`)}catch{w.issues.push({code:"invalid_format",format:"ipv6",input:w.value,inst:$,continue:!v.abort})}}}),q3=V("$ZodMAC",($,v)=>{v.pattern??(v.pattern=I2(v.delimiter)),D$.init($,v),$._zod.bag.format="mac"}),I3=V("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=B2),D$.init($,v)}),B3=V("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=L2),D$.init($,v),$._zod.check=(w)=>{let g=w.value.split("/");try{if(g.length!==2)throw Error();let[_,b]=g;if(!b)throw Error();let J=Number(b);if(`${J}`!==b)throw Error();if(J<0||J>128)throw Error();new URL(`http://[${_}]`)}catch{w.issues.push({code:"invalid_format",format:"cidrv6",input:w.value,inst:$,continue:!v.abort})}}});function L3($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var V3=V("$ZodBase64",($,v)=>{v.pattern??(v.pattern=V2),D$.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(w)=>{if(L3(w.value))return;w.issues.push({code:"invalid_format",format:"base64",input:w.value,inst:$,continue:!v.abort})}});function PG($){if(!Bb.test($))return!1;let v=$.replace(/[-_]/g,(g)=>g==="-"?"+":"/"),w=v.padEnd(Math.ceil(v.length/4)*4,"=");return L3(w)}var j3=V("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=Bb),D$.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(w)=>{if(PG(w.value))return;w.issues.push({code:"invalid_format",format:"base64url",input:w.value,inst:$,continue:!v.abort})}}),F3=V("$ZodE164",($,v)=>{v.pattern??(v.pattern=j2),D$.init($,v)});function AG($,v=null){try{let w=$.split(".");if(w.length!==3)return!1;let[g]=w;if(!g)return!1;let _=JSON.parse(atob(g));if("typ"in _&&_?.typ!=="JWT")return!1;if(!_.alg)return!1;if(v&&(!("alg"in _)||_.alg!==v))return!1;return!0}catch{return!1}}var K3=V("$ZodJWT",($,v)=>{D$.init($,v),$._zod.check=(w)=>{if(AG(w.value,v.alg))return;w.issues.push({code:"invalid_format",format:"jwt",input:w.value,inst:$,continue:!v.abort})}}),O3=V("$ZodCustomStringFormat",($,v)=>{D$.init($,v),$._zod.check=(w)=>{if(v.fn(w.value))return;w.issues.push({code:"invalid_format",format:v.format,input:w.value,inst:$,continue:!v.abort})}}),zb=V("$ZodNumber",($,v)=>{o.init($,v),$._zod.pattern=$._zod.bag.pattern??a6,$._zod.parse=(w,g)=>{if(v.coerce)try{w.value=Number(w.value)}catch(J){}let _=w.value;if(typeof _==="number"&&!Number.isNaN(_)&&Number.isFinite(_))return w;let b=typeof _==="number"?Number.isNaN(_)?"NaN":!Number.isFinite(_)?"Infinity":void 0:void 0;return w.issues.push({expected:"number",code:"invalid_type",input:_,inst:$,...b?{received:b}:{}}),w}}),N3=V("$ZodNumberFormat",($,v)=>{S2.init($,v),zb.init($,v)}),v4=V("$ZodBoolean",($,v)=>{o.init($,v),$._zod.pattern=i2,$._zod.parse=(w,g)=>{if(v.coerce)try{w.value=Boolean(w.value)}catch(b){}let _=w.value;if(typeof _==="boolean")return w;return w.issues.push({expected:"boolean",code:"invalid_type",input:_,inst:$}),w}}),ib=V("$ZodBigInt",($,v)=>{o.init($,v),$._zod.pattern=k2,$._zod.parse=(w,g)=>{if(v.coerce)try{w.value=BigInt(w.value)}catch(_){}if(typeof w.value==="bigint")return w;return w.issues.push({expected:"bigint",code:"invalid_type",input:w.value,inst:$}),w}}),k3=V("$ZodBigIntFormat",($,v)=>{T2.init($,v),ib.init($,v)}),z3=V("$ZodSymbol",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(typeof _==="symbol")return w;return w.issues.push({expected:"symbol",code:"invalid_type",input:_,inst:$}),w}}),i3=V("$ZodUndefined",($,v)=>{o.init($,v),$._zod.pattern=P2,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(w,g)=>{let _=w.value;if(typeof _>"u")return w;return w.issues.push({expected:"undefined",code:"invalid_type",input:_,inst:$}),w}}),n3=V("$ZodNull",($,v)=>{o.init($,v),$._zod.pattern=n2,$._zod.values=new Set([null]),$._zod.parse=(w,g)=>{let _=w.value;if(_===null)return w;return w.issues.push({expected:"null",code:"invalid_type",input:_,inst:$}),w}}),P3=V("$ZodAny",($,v)=>{o.init($,v),$._zod.parse=(w)=>w}),A3=V("$ZodUnknown",($,v)=>{o.init($,v),$._zod.parse=(w)=>w}),M3=V("$ZodNever",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{return w.issues.push({expected:"never",code:"invalid_type",input:w.value,inst:$}),w}}),f3=V("$ZodVoid",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(typeof _>"u")return w;return w.issues.push({expected:"void",code:"invalid_type",input:_,inst:$}),w}}),S3=V("$ZodDate",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{if(v.coerce)try{w.value=new Date(w.value)}catch(D){}let _=w.value,b=_ instanceof Date;if(b&&!Number.isNaN(_.getTime()))return w;return w.issues.push({expected:"date",code:"invalid_type",input:_,...b?{received:"Invalid Date"}:{},inst:$}),w}});function LG($,v,w){if($.issues.length)v.issues.push(...x$(w,$.issues));v.value[w]=$.value}var T3=V("$ZodArray",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(!Array.isArray(_))return w.issues.push({expected:"array",code:"invalid_type",input:_,inst:$}),w;w.value=Array(_.length);let b=[];for(let J=0;J<_.length;J++){let D=_[J],X=v.element._zod.run({value:D,issues:[]},g);if(X instanceof Promise)b.push(X.then((G)=>LG(G,w,J)));else LG(X,w,J)}if(b.length)return Promise.all(b).then(()=>w);return w}});function kb($,v,w,g,_){if($.issues.length){if(_&&!(w in g))return;v.issues.push(...x$(w,$.issues))}if($.value===void 0){if(w in g)v.value[w]=void 0}else v.value[w]=$.value}function MG($){let v=Object.keys($.shape);for(let g of v)if(!$.shape?.[g]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${g}": expected a Zod schema`);let w=sU($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(w)}}function fG($,v,w,g,_,b){let J=[],D=_.keySet,X=_.catchall._zod,G=X.def.type,Y=X.optout==="optional";for(let Q in v){if(D.has(Q))continue;if(G==="never"){J.push(Q);continue}let W=X.run({value:v[Q],issues:[]},g);if(W instanceof Promise)$.push(W.then((I)=>kb(I,w,Q,v,Y)));else kb(W,w,Q,v,Y)}if(J.length)w.issues.push({code:"unrecognized_keys",keys:J,input:v,inst:b});if(!$.length)return w;return Promise.all($).then(()=>{return w})}var SG=V("$ZodObject",($,v)=>{if(o.init($,v),!Object.getOwnPropertyDescriptor(v,"shape")?.get){let D=v.shape;Object.defineProperty(v,"shape",{get:()=>{let X={...D};return Object.defineProperty(v,"shape",{value:X}),X}})}let g=Iw(()=>MG(v));$$($._zod,"propValues",()=>{let D=v.shape,X={};for(let G in D){let Y=D[G]._zod;if(Y.values){X[G]??(X[G]=new Set);for(let Q of Y.values)X[G].add(Q)}}return X});let _=S_,b=v.catchall,J;$._zod.parse=(D,X)=>{J??(J=g.value);let G=D.value;if(!_(G))return D.issues.push({expected:"object",code:"invalid_type",input:G,inst:$}),D;D.value={};let Y=[],Q=J.shape;for(let W of J.keys){let I=Q[W],H=I._zod.optout==="optional",q=I._zod.run({value:G[W],issues:[]},X);if(q instanceof Promise)Y.push(q.then((j)=>kb(j,D,W,G,H)));else kb(q,D,W,G,H)}if(!b)return Y.length?Promise.all(Y).then(()=>D):D;return fG(Y,G,D,X,g.value,$)}}),u3=V("$ZodObjectJIT",($,v)=>{SG.init($,v);let w=$._zod.parse,g=Iw(()=>MG(v)),_=(W)=>{let I=new jb(["shape","payload","ctx"]),H=g.value,q=(T)=>{let C=bb(T);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};I.write("const input = payload.value;");let j=Object.create(null),F=0;for(let T of H.keys)j[T]=`key_${F++}`;I.write("const newResult = {};");for(let T of H.keys){let C=j[T],Z=bb(T),c=W[T]?._zod?.optout==="optional";if(I.write(`const ${C} = ${q(T)};`),c)I.write(`
143
143
  if (${C}.issues.length) {
144
144
  if (${Z} in input) {
145
145
  payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
@@ -173,12 +173,12 @@ ${v.comment}`:v.comment}this.doc.range[2]=v.offset;break}default:this.errors.pus
173
173
  newResult[${Z}] = ${C}.value;
174
174
  }
175
175
 
176
- `)}I.write("payload.value = newResult;"),I.write("return payload;");let A=I.compile();return(z,C)=>A(H,z,C)},b,J=S_,D=!x6.jitless,G=D&&dU.value,Y=v.catchall,Q;$._zod.parse=(H,I)=>{Q??(Q=g.value);let q=H.value;if(!J(q))return H.issues.push({expected:"object",code:"invalid_type",input:q,inst:$}),H;if(D&&G&&I?.async===!1&&I.jitless!==!0){if(!b)b=_(v.shape);if(H=b(H,I),!Y)return H;return N8([],q,H,I,Q,$)}return w(H,I)}});function H8($,v,w,g){for(let b of $)if(b.issues.length===0)return v.value=b.value,v;let _=$.filter((b)=>!pv(b));if(_.length===1)return v.value=_[0].value,_[0];return v.issues.push({code:"invalid_union",input:v.value,inst:w,errors:$.map((b)=>b.issues.map((J)=>R$(J,g,n$())))}),v}var v4=V("$ZodUnion",($,v)=>{o.init($,v),$$($._zod,"optin",()=>v.options.some((_)=>_._zod.optin==="optional")?"optional":void 0),$$($._zod,"optout",()=>v.options.some((_)=>_._zod.optout==="optional")?"optional":void 0),$$($._zod,"values",()=>{if(v.options.every((_)=>_._zod.values))return new Set(v.options.flatMap((_)=>Array.from(_._zod.values)));return}),$$($._zod,"pattern",()=>{if(v.options.every((_)=>_._zod.pattern)){let _=v.options.map((b)=>b._zod.pattern);return new RegExp(`^(${_.map((b)=>y6(b.source)).join("|")})$`)}return});let w=v.options.length===1,g=v.options[0]._zod.run;$._zod.parse=(_,b)=>{if(w)return g(_,b);let J=!1,D=[];for(let X of v.options){let G=X._zod.run({value:_.value,issues:[]},b);if(G instanceof Promise)D.push(G),J=!0;else{if(G.issues.length===0)return G;D.push(G)}}if(!J)return H8(D,_,$,b);return Promise.all(D).then((X)=>{return H8(X,_,$,b)})}});function n8($,v,w,g){let _=$.filter((b)=>b.issues.length===0);if(_.length===1)return v.value=_[0].value,v;if(_.length===0)v.issues.push({code:"invalid_union",input:v.value,inst:w,errors:$.map((b)=>b.issues.map((J)=>R$(J,g,n$())))});else v.issues.push({code:"invalid_union",input:v.value,inst:w,errors:[],inclusive:!1});return v}var T3=V("$ZodXor",($,v)=>{v4.init($,v),v.inclusive=!1;let w=v.options.length===1,g=v.options[0]._zod.run;$._zod.parse=(_,b)=>{if(w)return g(_,b);let J=!1,D=[];for(let X of v.options){let G=X._zod.run({value:_.value,issues:[]},b);if(G instanceof Promise)D.push(G),J=!0;else D.push(G)}if(!J)return n8(D,_,$,b);return Promise.all(D).then((X)=>{return n8(X,_,$,b)})}}),R3=V("$ZodDiscriminatedUnion",($,v)=>{v.inclusive=!1,v4.init($,v);let w=$._zod.parse;$$($._zod,"propValues",()=>{let _={};for(let b of v.options){let J=b._zod.propValues;if(!J||Object.keys(J).length===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(b)}"`);for(let[D,X]of Object.entries(J)){if(!_[D])_[D]=new Set;for(let G of X)_[D].add(G)}}return _});let g=nw(()=>{let _=v.options,b=new Map;for(let J of _){let D=J._zod.propValues?.[v.discriminator];if(!D||D.size===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(J)}"`);for(let X of D){if(b.has(X))throw Error(`Duplicate discriminator value "${String(X)}"`);b.set(X,J)}}return b});$._zod.parse=(_,b)=>{let J=_.value;if(!S_(J))return _.issues.push({code:"invalid_type",expected:"object",input:J,inst:$}),_;let D=g.value.get(J?.[v.discriminator]);if(D)return D._zod.run(_,b);if(v.unionFallback)return w(_,b);return _.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:v.discriminator,input:J,path:[v.discriminator],inst:$}),_}}),C3=V("$ZodIntersection",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value,b=v.left._zod.run({value:_,issues:[]},g),J=v.right._zod.run({value:_,issues:[]},g);if(b instanceof Promise||J instanceof Promise)return Promise.all([b,J]).then(([X,G])=>{return q8(w,X,G)});return q8(w,b,J)}});function p2($,v){if($===v)return{valid:!0,data:$};if($ instanceof Date&&v instanceof Date&&+$===+v)return{valid:!0,data:$};if(dv($)&&dv(v)){let w=Object.keys(v),g=Object.keys($).filter((b)=>w.indexOf(b)!==-1),_={...$,...v};for(let b of g){let J=p2($[b],v[b]);if(!J.valid)return{valid:!1,mergeErrorPath:[b,...J.mergeErrorPath]};_[b]=J.data}return{valid:!0,data:_}}if(Array.isArray($)&&Array.isArray(v)){if($.length!==v.length)return{valid:!1,mergeErrorPath:[]};let w=[];for(let g=0;g<$.length;g++){let _=$[g],b=v[g],J=p2(_,b);if(!J.valid)return{valid:!1,mergeErrorPath:[g,...J.mergeErrorPath]};w.push(J.data)}return{valid:!0,data:w}}return{valid:!1,mergeErrorPath:[]}}function q8($,v,w){if(v.issues.length)$.issues.push(...v.issues);if(w.issues.length)$.issues.push(...w.issues);if(pv($))return $;let g=p2(v.value,w.value);if(!g.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(g.mergeErrorPath)}`);return $.value=g.data,$}var k1=V("$ZodTuple",($,v)=>{o.init($,v);let w=v.items;$._zod.parse=(g,_)=>{let b=g.value;if(!Array.isArray(b))return g.issues.push({input:b,inst:$,expected:"tuple",code:"invalid_type"}),g;g.value=[];let J=[],D=[...w].reverse().findIndex((Y)=>Y._zod.optin!=="optional"),X=D===-1?0:w.length-D;if(!v.rest){let Y=b.length>w.length,Q=b.length<X-1;if(Y||Q)return g.issues.push({...Y?{code:"too_big",maximum:w.length,inclusive:!0}:{code:"too_small",minimum:w.length},input:b,inst:$,origin:"array"}),g}let G=-1;for(let Y of w){if(G++,G>=b.length){if(G>=X)continue}let Q=Y._zod.run({value:b[G],issues:[]},_);if(Q instanceof Promise)J.push(Q.then((H)=>L1(H,g,G)));else L1(Q,g,G)}if(v.rest){let Y=b.slice(w.length);for(let Q of Y){G++;let H=v.rest._zod.run({value:Q,issues:[]},_);if(H instanceof Promise)J.push(H.then((I)=>L1(I,g,G)));else L1(H,g,G)}}if(J.length)return Promise.all(J).then(()=>g);return g}});function L1($,v,w){if($.issues.length)v.issues.push(...l$(w,$.issues));v.value[w]=$.value}var E3=V("$ZodRecord",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(!dv(_))return w.issues.push({expected:"record",code:"invalid_type",input:_,inst:$}),w;let b=[],J=v.keyType._zod.values;if(J){w.value={};let D=new Set;for(let G of J)if(typeof G==="string"||typeof G==="number"||typeof G==="symbol"){D.add(typeof G==="number"?G.toString():G);let Y=v.valueType._zod.run({value:_[G],issues:[]},g);if(Y instanceof Promise)b.push(Y.then((Q)=>{if(Q.issues.length)w.issues.push(...l$(G,Q.issues));w.value[G]=Q.value}));else{if(Y.issues.length)w.issues.push(...l$(G,Y.issues));w.value[G]=Y.value}}let X;for(let G in _)if(!D.has(G))X=X??[],X.push(G);if(X&&X.length>0)w.issues.push({code:"unrecognized_keys",input:_,inst:$,keys:X})}else{w.value={};for(let D of Reflect.ownKeys(_)){if(D==="__proto__")continue;let X=v.keyType._zod.run({value:D,issues:[]},g);if(X instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof D==="string"&&e6.test(D)&&X.issues.length&&X.issues.some((Q)=>Q.code==="invalid_type"&&Q.expected==="number")){let Q=v.keyType._zod.run({value:Number(D),issues:[]},g);if(Q instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(Q.issues.length===0)X=Q}if(X.issues.length){if(v.mode==="loose")w.value[D]=_[D];else w.issues.push({code:"invalid_key",origin:"record",issues:X.issues.map((Q)=>R$(Q,g,n$())),input:D,path:[D],inst:$});continue}let Y=v.valueType._zod.run({value:_[D],issues:[]},g);if(Y instanceof Promise)b.push(Y.then((Q)=>{if(Q.issues.length)w.issues.push(...l$(D,Q.issues));w.value[X.value]=Q.value}));else{if(Y.issues.length)w.issues.push(...l$(D,Y.issues));w.value[X.value]=Y.value}}}if(b.length)return Promise.all(b).then(()=>w);return w}}),Z3=V("$ZodMap",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(!(_ instanceof Map))return w.issues.push({expected:"map",code:"invalid_type",input:_,inst:$}),w;let b=[];w.value=new Map;for(let[J,D]of _){let X=v.keyType._zod.run({value:J,issues:[]},g),G=v.valueType._zod.run({value:D,issues:[]},g);if(X instanceof Promise||G instanceof Promise)b.push(Promise.all([X,G]).then(([Y,Q])=>{I8(Y,Q,w,J,_,$,g)}));else I8(X,G,w,J,_,$,g)}if(b.length)return Promise.all(b).then(()=>w);return w}});function I8($,v,w,g,_,b,J){if($.issues.length)if(m6.has(typeof g))w.issues.push(...l$(g,$.issues));else w.issues.push({code:"invalid_key",origin:"map",input:_,inst:b,issues:$.issues.map((D)=>R$(D,J,n$()))});if(v.issues.length)if(m6.has(typeof g))w.issues.push(...l$(g,v.issues));else w.issues.push({origin:"map",code:"invalid_element",input:_,inst:b,key:g,issues:v.issues.map((D)=>R$(D,J,n$()))});w.value.set($.value,v.value)}var x3=V("$ZodSet",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(!(_ instanceof Set))return w.issues.push({input:_,inst:$,expected:"set",code:"invalid_type"}),w;let b=[];w.value=new Set;for(let J of _){let D=v.valueType._zod.run({value:J,issues:[]},g);if(D instanceof Promise)b.push(D.then((X)=>B8(X,w)));else B8(D,w)}if(b.length)return Promise.all(b).then(()=>w);return w}});function B8($,v){if($.issues.length)v.issues.push(...$.issues);v.value.add($.value)}var l3=V("$ZodEnum",($,v)=>{o.init($,v);let w=Ww(v.entries),g=new Set(w);$._zod.values=g,$._zod.pattern=new RegExp(`^(${w.filter((_)=>m6.has(typeof _)).map((_)=>typeof _==="string"?m$(_):_.toString()).join("|")})$`),$._zod.parse=(_,b)=>{let J=_.value;if(g.has(J))return _;return _.issues.push({code:"invalid_value",values:w,input:J,inst:$}),_}}),h3=V("$ZodLiteral",($,v)=>{if(o.init($,v),v.values.length===0)throw Error("Cannot create literal schema with no valid values");let w=new Set(v.values);$._zod.values=w,$._zod.pattern=new RegExp(`^(${v.values.map((g)=>typeof g==="string"?m$(g):g?m$(g.toString()):String(g)).join("|")})$`),$._zod.parse=(g,_)=>{let b=g.value;if(w.has(b))return g;return g.issues.push({code:"invalid_value",values:v.values,input:b,inst:$}),g}}),c3=V("$ZodFile",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(_ instanceof File)return w;return w.issues.push({expected:"file",code:"invalid_type",input:_,inst:$}),w}}),y3=V("$ZodTransform",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{if(g.direction==="backward")throw new z_($.constructor.name);let _=v.transform(w.value,w);if(g.async)return(_ instanceof Promise?_:Promise.resolve(_)).then((J)=>{return w.value=J,w});if(_ instanceof Promise)throw new nv;return w.value=_,w}});function L8($,v){if($.issues.length&&v===void 0)return{issues:[],value:void 0};return $}var N1=V("$ZodOptional",($,v)=>{o.init($,v),$._zod.optin="optional",$._zod.optout="optional",$$($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,void 0]):void 0}),$$($._zod,"pattern",()=>{let w=v.innerType._zod.pattern;return w?new RegExp(`^(${y6(w.source)})?$`):void 0}),$._zod.parse=(w,g)=>{if(v.innerType._zod.optin==="optional"){let _=v.innerType._zod.run(w,g);if(_ instanceof Promise)return _.then((b)=>L8(b,w.value));return L8(_,w.value)}if(w.value===void 0)return w;return v.innerType._zod.run(w,g)}}),m3=V("$ZodExactOptional",($,v)=>{N1.init($,v),$$($._zod,"values",()=>v.innerType._zod.values),$$($._zod,"pattern",()=>v.innerType._zod.pattern),$._zod.parse=(w,g)=>{return v.innerType._zod.run(w,g)}}),r3=V("$ZodNullable",($,v)=>{o.init($,v),$$($._zod,"optin",()=>v.innerType._zod.optin),$$($._zod,"optout",()=>v.innerType._zod.optout),$$($._zod,"pattern",()=>{let w=v.innerType._zod.pattern;return w?new RegExp(`^(${y6(w.source)}|null)$`):void 0}),$$($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,null]):void 0}),$._zod.parse=(w,g)=>{if(w.value===null)return w;return v.innerType._zod.run(w,g)}}),o3=V("$ZodDefault",($,v)=>{o.init($,v),$._zod.optin="optional",$$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(w,g)=>{if(g.direction==="backward")return v.innerType._zod.run(w,g);if(w.value===void 0)return w.value=v.defaultValue,w;let _=v.innerType._zod.run(w,g);if(_ instanceof Promise)return _.then((b)=>V8(b,v));return V8(_,v)}});function V8($,v){if($.value===void 0)$.value=v.defaultValue;return $}var t3=V("$ZodPrefault",($,v)=>{o.init($,v),$._zod.optin="optional",$$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(w,g)=>{if(g.direction==="backward")return v.innerType._zod.run(w,g);if(w.value===void 0)w.value=v.defaultValue;return v.innerType._zod.run(w,g)}}),d3=V("$ZodNonOptional",($,v)=>{o.init($,v),$$($._zod,"values",()=>{let w=v.innerType._zod.values;return w?new Set([...w].filter((g)=>g!==void 0)):void 0}),$._zod.parse=(w,g)=>{let _=v.innerType._zod.run(w,g);if(_ instanceof Promise)return _.then((b)=>j8(b,$));return j8(_,$)}});function j8($,v){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:v});return $}var p3=V("$ZodSuccess",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{if(g.direction==="backward")throw new z_("ZodSuccess");let _=v.innerType._zod.run(w,g);if(_ instanceof Promise)return _.then((b)=>{return w.value=b.issues.length===0,w});return w.value=_.issues.length===0,w}}),e3=V("$ZodCatch",($,v)=>{o.init($,v),$$($._zod,"optin",()=>v.innerType._zod.optin),$$($._zod,"optout",()=>v.innerType._zod.optout),$$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(w,g)=>{if(g.direction==="backward")return v.innerType._zod.run(w,g);let _=v.innerType._zod.run(w,g);if(_ instanceof Promise)return _.then((b)=>{if(w.value=b.value,b.issues.length)w.value=v.catchValue({...w,error:{issues:b.issues.map((J)=>R$(J,g,n$()))},input:w.value}),w.issues=[];return w});if(w.value=_.value,_.issues.length)w.value=v.catchValue({...w,error:{issues:_.issues.map((b)=>R$(b,g,n$()))},input:w.value}),w.issues=[];return w}}),a3=V("$ZodNaN",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{if(typeof w.value!=="number"||!Number.isNaN(w.value))return w.issues.push({input:w.value,inst:$,expected:"nan",code:"invalid_type"}),w;return w}}),s3=V("$ZodPipe",($,v)=>{o.init($,v),$$($._zod,"values",()=>v.in._zod.values),$$($._zod,"optin",()=>v.in._zod.optin),$$($._zod,"optout",()=>v.out._zod.optout),$$($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(w,g)=>{if(g.direction==="backward"){let b=v.out._zod.run(w,g);if(b instanceof Promise)return b.then((J)=>V1(J,v.in,g));return V1(b,v.in,g)}let _=v.in._zod.run(w,g);if(_ instanceof Promise)return _.then((b)=>V1(b,v.out,g));return V1(_,v.out,g)}});function V1($,v,w){if($.issues.length)return $.aborted=!0,$;return v._zod.run({value:$.value,issues:$.issues},w)}var _4=V("$ZodCodec",($,v)=>{o.init($,v),$$($._zod,"values",()=>v.in._zod.values),$$($._zod,"optin",()=>v.in._zod.optin),$$($._zod,"optout",()=>v.out._zod.optout),$$($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(w,g)=>{if((g.direction||"forward")==="forward"){let b=v.in._zod.run(w,g);if(b instanceof Promise)return b.then((J)=>j1(J,v,g));return j1(b,v,g)}else{let b=v.out._zod.run(w,g);if(b instanceof Promise)return b.then((J)=>j1(J,v,g));return j1(b,v,g)}}});function j1($,v,w){if($.issues.length)return $.aborted=!0,$;if((w.direction||"forward")==="forward"){let _=v.transform($.value,$);if(_ instanceof Promise)return _.then((b)=>F1($,b,v.out,w));return F1($,_,v.out,w)}else{let _=v.reverseTransform($.value,$);if(_ instanceof Promise)return _.then((b)=>F1($,b,v.in,w));return F1($,_,v.in,w)}}function F1($,v,w,g){if($.issues.length)return $.aborted=!0,$;return w._zod.run({value:v,issues:$.issues},g)}var $9=V("$ZodReadonly",($,v)=>{o.init($,v),$$($._zod,"propValues",()=>v.innerType._zod.propValues),$$($._zod,"values",()=>v.innerType._zod.values),$$($._zod,"optin",()=>v.innerType?._zod?.optin),$$($._zod,"optout",()=>v.innerType?._zod?.optout),$._zod.parse=(w,g)=>{if(g.direction==="backward")return v.innerType._zod.run(w,g);let _=v.innerType._zod.run(w,g);if(_ instanceof Promise)return _.then(F8);return F8(_)}});function F8($){return $.value=Object.freeze($.value),$}var v9=V("$ZodTemplateLiteral",($,v)=>{o.init($,v);let w=[];for(let g of v.parts)if(typeof g==="object"&&g!==null){if(!g._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...g._zod.traits].shift()}`);let _=g._zod.pattern instanceof RegExp?g._zod.pattern.source:g._zod.pattern;if(!_)throw Error(`Invalid template literal part: ${g._zod.traits}`);let b=_.startsWith("^")?1:0,J=_.endsWith("$")?_.length-1:_.length;w.push(_.slice(b,J))}else if(g===null||eU.has(typeof g))w.push(m$(`${g}`));else throw Error(`Invalid template literal part: ${g}`);$._zod.pattern=new RegExp(`^${w.join("")}$`),$._zod.parse=(g,_)=>{if(typeof g.value!=="string")return g.issues.push({input:g.value,inst:$,expected:"string",code:"invalid_type"}),g;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(g.value))return g.issues.push({input:g.value,inst:$,code:"invalid_format",format:v.format??"template_literal",pattern:$._zod.pattern.source}),g;return g}}),_9=V("$ZodFunction",($,v)=>{return o.init($,v),$._def=v,$._zod.def=v,$.implement=(w)=>{if(typeof w!=="function")throw Error("implement() must be called with a function");return function(...g){let _=$._def.input?b1($._def.input,g):g,b=Reflect.apply(w,this,_);if($._def.output)return b1($._def.output,b);return b}},$.implementAsync=(w)=>{if(typeof w!=="function")throw Error("implementAsync() must be called with a function");return async function(...g){let _=$._def.input?await U1($._def.input,g):g,b=await Reflect.apply(w,this,_);if($._def.output)return await U1($._def.output,b);return b}},$._zod.parse=(w,g)=>{if(typeof w.value!=="function")return w.issues.push({code:"invalid_type",expected:"function",input:w.value,inst:$}),w;if($._def.output&&$._def.output._zod.def.type==="promise")w.value=$.implementAsync(w.value);else w.value=$.implement(w.value);return w},$.input=(...w)=>{let g=$.constructor;if(Array.isArray(w[0]))return new g({type:"function",input:new k1({type:"tuple",items:w[0],rest:w[1]}),output:$._def.output});return new g({type:"function",input:w[0],output:$._def.output})},$.output=(w)=>{return new $.constructor({type:"function",input:$._def.input,output:w})},$}),w9=V("$ZodPromise",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{return Promise.resolve(w.value).then((_)=>v.innerType._zod.run({value:_,issues:[]},g))}}),g9=V("$ZodLazy",($,v)=>{o.init($,v),$$($._zod,"innerType",()=>v.getter()),$$($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),$$($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),$$($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),$$($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(w,g)=>{return $._zod.innerType._zod.run(w,g)}}),b9=V("$ZodCustom",($,v)=>{Q$.init($,v),o.init($,v),$._zod.parse=(w,g)=>{return w},$._zod.check=(w)=>{let g=w.value,_=v.fn(g);if(_ instanceof Promise)return _.then((b)=>K8(b,w,g,$));K8(_,w,g,$);return}});function K8($,v,w,g){if(!$){let _={code:"custom",input:w,inst:g,path:[...g._zod.def.path??[]],continue:!g._zod.def.abort};if(g._zod.def.params)_.params=g._zod.def.params;v.issues.push(qw(_))}}var E_={};$v(E_,{zhTW:()=>p9,zhCN:()=>d9,yo:()=>e9,vi:()=>t9,uz:()=>o9,ur:()=>r9,uk:()=>U4,ua:()=>m9,tr:()=>y9,th:()=>c9,ta:()=>h9,sv:()=>l9,sl:()=>x9,ru:()=>Z9,pt:()=>E9,ps:()=>R9,pl:()=>C9,ota:()=>T9,no:()=>u9,nl:()=>S9,ms:()=>z9,mk:()=>M9,lt:()=>A9,ko:()=>f9,km:()=>g4,kh:()=>P9,ka:()=>N9,ja:()=>k9,it:()=>i9,is:()=>O9,id:()=>K9,hy:()=>F9,hu:()=>j9,he:()=>V9,frCA:()=>L9,fr:()=>B9,fi:()=>I9,fa:()=>q9,es:()=>n9,eo:()=>H9,en:()=>w4,de:()=>W9,da:()=>Q9,cs:()=>Y9,ca:()=>G9,bg:()=>X9,be:()=>D9,az:()=>J9,ar:()=>U9});var tq=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function v(_){return $[_]??null}let w={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${_.expected}، ولكن تم إدخال ${D}`;return`مدخلات غير مقبولة: يفترض إدخال ${b}، ولكن تم إدخال ${D}`}case"invalid_value":if(_.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${k(_.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return` أكبر من اللازم: يفترض أن تكون ${_.origin??"القيمة"} ${b} ${_.maximum.toString()} ${J.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${_.origin??"القيمة"} ${b} ${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`أصغر من اللازم: يفترض لـ ${_.origin} أن يكون ${b} ${_.minimum.toString()} ${J.unit}`;return`أصغر من اللازم: يفترض لـ ${_.origin} أن يكون ${b} ${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${_.prefix}"`;if(b.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${b.suffix}"`;if(b.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${b.includes}"`;if(b.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${b.pattern}`;return`${w[b.format]??_.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${_.divisor}`;case"unrecognized_keys":return`معرف${_.keys.length>1?"ات":""} غريب${_.keys.length>1?"ة":""}: ${K(_.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${_.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${_.origin}`;default:return"مدخل غير مقبول"}}};function U9(){return{localeError:tq()}}var dq=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function v(_){return $[_]??null}let w={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Yanlış dəyər: gözlənilən instanceof ${_.expected}, daxil olan ${D}`;return`Yanlış dəyər: gözlənilən ${b}, daxil olan ${D}`}case"invalid_value":if(_.values.length===1)return`Yanlış dəyər: gözlənilən ${k(_.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Çox böyük: gözlənilən ${_.origin??"dəyər"} ${b}${_.maximum.toString()} ${J.unit??"element"}`;return`Çox böyük: gözlənilən ${_.origin??"dəyər"} ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Çox kiçik: gözlənilən ${_.origin} ${b}${_.minimum.toString()} ${J.unit}`;return`Çox kiçik: gözlənilən ${_.origin} ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Yanlış mətn: "${b.prefix}" ilə başlamalıdır`;if(b.format==="ends_with")return`Yanlış mətn: "${b.suffix}" ilə bitməlidir`;if(b.format==="includes")return`Yanlış mətn: "${b.includes}" daxil olmalıdır`;if(b.format==="regex")return`Yanlış mətn: ${b.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${w[b.format]??_.format}`}case"not_multiple_of":return`Yanlış ədəd: ${_.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${_.keys.length>1?"lar":""}: ${K(_.keys,", ")}`;case"invalid_key":return`${_.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${_.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function J9(){return{localeError:dq()}}function f8($,v,w,g){let _=Math.abs($),b=_%10,J=_%100;if(J>=11&&J<=19)return g;if(b===1)return v;if(b>=2&&b<=4)return w;return g}var pq=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function v(_){return $[_]??null}let w={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},g={nan:"NaN",number:"лік",array:"масіў"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Няправільны ўвод: чакаўся instanceof ${_.expected}, атрымана ${D}`;return`Няправільны ўвод: чакаўся ${b}, атрымана ${D}`}case"invalid_value":if(_.values.length===1)return`Няправільны ўвод: чакалася ${k(_.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J){let D=Number(_.maximum),X=f8(D,J.unit.one,J.unit.few,J.unit.many);return`Занадта вялікі: чакалася, што ${_.origin??"значэнне"} павінна ${J.verb} ${b}${_.maximum.toString()} ${X}`}return`Занадта вялікі: чакалася, што ${_.origin??"значэнне"} павінна быць ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J){let D=Number(_.minimum),X=f8(D,J.unit.one,J.unit.few,J.unit.many);return`Занадта малы: чакалася, што ${_.origin} павінна ${J.verb} ${b}${_.minimum.toString()} ${X}`}return`Занадта малы: чакалася, што ${_.origin} павінна быць ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${b.prefix}"`;if(b.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${b.suffix}"`;if(b.format==="includes")return`Няправільны радок: павінен змяшчаць "${b.includes}"`;if(b.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${b.pattern}`;return`Няправільны ${w[b.format]??_.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${_.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${_.keys.length>1?"ключы":"ключ"}: ${K(_.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${_.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${_.origin}`;default:return"Няправільны ўвод"}}};function D9(){return{localeError:pq()}}var eq=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function v(_){return $[_]??null}let w={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},g={nan:"NaN",number:"число",array:"масив"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Невалиден вход: очакван instanceof ${_.expected}, получен ${D}`;return`Невалиден вход: очакван ${b}, получен ${D}`}case"invalid_value":if(_.values.length===1)return`Невалиден вход: очакван ${k(_.values[0])}`;return`Невалидна опция: очаквано едно от ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Твърде голямо: очаква се ${_.origin??"стойност"} да съдържа ${b}${_.maximum.toString()} ${J.unit??"елемента"}`;return`Твърде голямо: очаква се ${_.origin??"стойност"} да бъде ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Твърде малко: очаква се ${_.origin} да съдържа ${b}${_.minimum.toString()} ${J.unit}`;return`Твърде малко: очаква се ${_.origin} да бъде ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Невалиден низ: трябва да започва с "${b.prefix}"`;if(b.format==="ends_with")return`Невалиден низ: трябва да завършва с "${b.suffix}"`;if(b.format==="includes")return`Невалиден низ: трябва да включва "${b.includes}"`;if(b.format==="regex")return`Невалиден низ: трябва да съвпада с ${b.pattern}`;let J="Невалиден";if(b.format==="emoji")J="Невалидно";if(b.format==="datetime")J="Невалидно";if(b.format==="date")J="Невалидна";if(b.format==="time")J="Невалидно";if(b.format==="duration")J="Невалидна";return`${J} ${w[b.format]??_.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${_.divisor}`;case"unrecognized_keys":return`Неразпознат${_.keys.length>1?"и":""} ключ${_.keys.length>1?"ове":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${_.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${_.origin}`;default:return"Невалиден вход"}}};function X9(){return{localeError:eq()}}var aq=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function v(_){return $[_]??null}let w={regex:"entrada",email:"adreça electrònica",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ça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Tipus invàlid: s'esperava instanceof ${_.expected}, s'ha rebut ${D}`;return`Tipus invàlid: s'esperava ${b}, s'ha rebut ${D}`}case"invalid_value":if(_.values.length===1)return`Valor invàlid: s'esperava ${k(_.values[0])}`;return`Opció invàlida: s'esperava una de ${K(_.values," o ")}`;case"too_big":{let b=_.inclusive?"com a màxim":"menys de",J=v(_.origin);if(J)return`Massa gran: s'esperava que ${_.origin??"el valor"} contingués ${b} ${_.maximum.toString()} ${J.unit??"elements"}`;return`Massa gran: s'esperava que ${_.origin??"el valor"} fos ${b} ${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?"com a mínim":"més de",J=v(_.origin);if(J)return`Massa petit: s'esperava que ${_.origin} contingués ${b} ${_.minimum.toString()} ${J.unit}`;return`Massa petit: s'esperava que ${_.origin} fos ${b} ${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Format invàlid: ha de començar amb "${b.prefix}"`;if(b.format==="ends_with")return`Format invàlid: ha d'acabar amb "${b.suffix}"`;if(b.format==="includes")return`Format invàlid: ha d'incloure "${b.includes}"`;if(b.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${b.pattern}`;return`Format invàlid per a ${w[b.format]??_.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${_.divisor}`;case"unrecognized_keys":return`Clau${_.keys.length>1?"s":""} no reconeguda${_.keys.length>1?"s":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${_.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${_.origin}`;default:return"Entrada invàlida"}}};function G9(){return{localeError:aq()}}var sq=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function v(_){return $[_]??null}let w={regex:"regulární výraz",email:"e-mailová 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 čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},g={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Neplatný vstup: očekáváno instanceof ${_.expected}, obdrženo ${D}`;return`Neplatný vstup: očekáváno ${b}, obdrženo ${D}`}case"invalid_value":if(_.values.length===1)return`Neplatný vstup: očekáváno ${k(_.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Hodnota je příliš velká: ${_.origin??"hodnota"} musí mít ${b}${_.maximum.toString()} ${J.unit??"prvků"}`;return`Hodnota je příliš velká: ${_.origin??"hodnota"} musí být ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Hodnota je příliš malá: ${_.origin??"hodnota"} musí mít ${b}${_.minimum.toString()} ${J.unit??"prvků"}`;return`Hodnota je příliš malá: ${_.origin??"hodnota"} musí být ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Neplatný řetězec: musí začínat na "${b.prefix}"`;if(b.format==="ends_with")return`Neplatný řetězec: musí končit na "${b.suffix}"`;if(b.format==="includes")return`Neplatný řetězec: musí obsahovat "${b.includes}"`;if(b.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${b.pattern}`;return`Neplatný formát ${w[b.format]??_.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${_.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${K(_.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${_.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${_.origin}`;default:return"Neplatný vstup"}}};function Y9(){return{localeError:sq()}}var $I=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function v(_){return $[_]??null}let w={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æt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},g={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Ugyldigt input: forventede instanceof ${_.expected}, fik ${D}`;return`Ugyldigt input: forventede ${b}, fik ${D}`}case"invalid_value":if(_.values.length===1)return`Ugyldig værdi: forventede ${k(_.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin),D=g[_.origin]??_.origin;if(J)return`For stor: forventede ${D??"value"} ${J.verb} ${b} ${_.maximum.toString()} ${J.unit??"elementer"}`;return`For stor: forventede ${D??"value"} havde ${b} ${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin),D=g[_.origin]??_.origin;if(J)return`For lille: forventede ${D} ${J.verb} ${b} ${_.minimum.toString()} ${J.unit}`;return`For lille: forventede ${D} havde ${b} ${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ugyldig streng: skal starte med "${b.prefix}"`;if(b.format==="ends_with")return`Ugyldig streng: skal ende med "${b.suffix}"`;if(b.format==="includes")return`Ugyldig streng: skal indeholde "${b.includes}"`;if(b.format==="regex")return`Ugyldig streng: skal matche mønsteret ${b.pattern}`;return`Ugyldig ${w[b.format]??_.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${K(_.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${_.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${_.origin}`;default:return"Ugyldigt input"}}};function Q9(){return{localeError:$I()}}var vI=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function v(_){return $[_]??null}let w={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},g={nan:"NaN",number:"Zahl",array:"Array"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Ungültige Eingabe: erwartet instanceof ${_.expected}, erhalten ${D}`;return`Ungültige Eingabe: erwartet ${b}, erhalten ${D}`}case"invalid_value":if(_.values.length===1)return`Ungültige Eingabe: erwartet ${k(_.values[0])}`;return`Ungültige Option: erwartet eine von ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Zu groß: erwartet, dass ${_.origin??"Wert"} ${b}${_.maximum.toString()} ${J.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${_.origin??"Wert"} ${b}${_.maximum.toString()} ist`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Zu klein: erwartet, dass ${_.origin} ${b}${_.minimum.toString()} ${J.unit} hat`;return`Zu klein: erwartet, dass ${_.origin} ${b}${_.minimum.toString()} ist`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ungültiger String: muss mit "${b.prefix}" beginnen`;if(b.format==="ends_with")return`Ungültiger String: muss mit "${b.suffix}" enden`;if(b.format==="includes")return`Ungültiger String: muss "${b.includes}" enthalten`;if(b.format==="regex")return`Ungültiger String: muss dem Muster ${b.pattern} entsprechen`;return`Ungültig: ${w[b.format]??_.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${_.divisor} sein`;case"unrecognized_keys":return`${_.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${K(_.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${_.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${_.origin}`;default:return"Ungültige Eingabe"}}};function W9(){return{localeError:vI()}}var _I=()=>{let $={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 v(_){return $[_]??null}let w={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;return`Invalid input: expected ${b}, received ${D}`}case"invalid_value":if(_.values.length===1)return`Invalid input: expected ${k(_.values[0])}`;return`Invalid option: expected one of ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Too big: expected ${_.origin??"value"} to have ${b}${_.maximum.toString()} ${J.unit??"elements"}`;return`Too big: expected ${_.origin??"value"} to be ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Too small: expected ${_.origin} to have ${b}${_.minimum.toString()} ${J.unit}`;return`Too small: expected ${_.origin} to be ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Invalid string: must start with "${b.prefix}"`;if(b.format==="ends_with")return`Invalid string: must end with "${b.suffix}"`;if(b.format==="includes")return`Invalid string: must include "${b.includes}"`;if(b.format==="regex")return`Invalid string: must match pattern ${b.pattern}`;return`Invalid ${w[b.format]??_.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${_.divisor}`;case"unrecognized_keys":return`Unrecognized key${_.keys.length>1?"s":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Invalid key in ${_.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${_.origin}`;default:return"Invalid input"}}};function w4(){return{localeError:_I()}}var wI=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function v(_){return $[_]??null}let w={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",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ŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},g={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Nevalida enigo: atendiĝis instanceof ${_.expected}, riceviĝis ${D}`;return`Nevalida enigo: atendiĝis ${b}, riceviĝis ${D}`}case"invalid_value":if(_.values.length===1)return`Nevalida enigo: atendiĝis ${k(_.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Tro granda: atendiĝis ke ${_.origin??"valoro"} havu ${b}${_.maximum.toString()} ${J.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${_.origin??"valoro"} havu ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Tro malgranda: atendiĝis ke ${_.origin} havu ${b}${_.minimum.toString()} ${J.unit}`;return`Tro malgranda: atendiĝis ke ${_.origin} estu ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${b.prefix}"`;if(b.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${b.suffix}"`;if(b.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${b.includes}"`;if(b.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${b.pattern}`;return`Nevalida ${w[b.format]??_.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${_.divisor}`;case"unrecognized_keys":return`Nekonata${_.keys.length>1?"j":""} ŝlosilo${_.keys.length>1?"j":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${_.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${_.origin}`;default:return"Nevalida enigo"}}};function H9(){return{localeError:wI()}}var gI=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function v(_){return $[_]??null}let w={regex:"entrada",email:"dirección de correo electrónico",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ón ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},g={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Entrada inválida: se esperaba instanceof ${_.expected}, recibido ${D}`;return`Entrada inválida: se esperaba ${b}, recibido ${D}`}case"invalid_value":if(_.values.length===1)return`Entrada inválida: se esperaba ${k(_.values[0])}`;return`Opción inválida: se esperaba una de ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin),D=g[_.origin]??_.origin;if(J)return`Demasiado grande: se esperaba que ${D??"valor"} tuviera ${b}${_.maximum.toString()} ${J.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${D??"valor"} fuera ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin),D=g[_.origin]??_.origin;if(J)return`Demasiado pequeño: se esperaba que ${D} tuviera ${b}${_.minimum.toString()} ${J.unit}`;return`Demasiado pequeño: se esperaba que ${D} fuera ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Cadena inválida: debe comenzar con "${b.prefix}"`;if(b.format==="ends_with")return`Cadena inválida: debe terminar en "${b.suffix}"`;if(b.format==="includes")return`Cadena inválida: debe incluir "${b.includes}"`;if(b.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${b.pattern}`;return`Inválido ${w[b.format]??_.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${_.divisor}`;case"unrecognized_keys":return`Llave${_.keys.length>1?"s":""} desconocida${_.keys.length>1?"s":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Llave inválida en ${g[_.origin]??_.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${g[_.origin]??_.origin}`;default:return"Entrada inválida"}}};function n9(){return{localeError:gI()}}var bI=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function v(_){return $[_]??null}let w={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},g={nan:"NaN",number:"عدد",array:"آرایه"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`ورودی نامعتبر: می‌بایست instanceof ${_.expected} می‌بود، ${D} دریافت شد`;return`ورودی نامعتبر: می‌بایست ${b} می‌بود، ${D} دریافت شد`}case"invalid_value":if(_.values.length===1)return`ورودی نامعتبر: می‌بایست ${k(_.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${K(_.values,"|")} می‌بود`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`خیلی بزرگ: ${_.origin??"مقدار"} باید ${b}${_.maximum.toString()} ${J.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${_.origin??"مقدار"} باید ${b}${_.maximum.toString()} باشد`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`خیلی کوچک: ${_.origin} باید ${b}${_.minimum.toString()} ${J.unit} باشد`;return`خیلی کوچک: ${_.origin} باید ${b}${_.minimum.toString()} باشد`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`رشته نامعتبر: باید با "${b.prefix}" شروع شود`;if(b.format==="ends_with")return`رشته نامعتبر: باید با "${b.suffix}" تمام شود`;if(b.format==="includes")return`رشته نامعتبر: باید شامل "${b.includes}" باشد`;if(b.format==="regex")return`رشته نامعتبر: باید با الگوی ${b.pattern} مطابقت داشته باشد`;return`${w[b.format]??_.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${_.divisor} باشد`;case"unrecognized_keys":return`کلید${_.keys.length>1?"های":""} ناشناس: ${K(_.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${_.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${_.origin}`;default:return"ورودی نامعتبر"}}};function q9(){return{localeError:bI()}}var UI=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function v(_){return $[_]??null}let w={regex:"säännöllinen lauseke",email:"sähköpostiosoite",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äivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Virheellinen tyyppi: odotettiin instanceof ${_.expected}, oli ${D}`;return`Virheellinen tyyppi: odotettiin ${b}, oli ${D}`}case"invalid_value":if(_.values.length===1)return`Virheellinen syöte: täytyy olla ${k(_.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Liian suuri: ${J.subject} täytyy olla ${b}${_.maximum.toString()} ${J.unit}`.trim();return`Liian suuri: arvon täytyy olla ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Liian pieni: ${J.subject} täytyy olla ${b}${_.minimum.toString()} ${J.unit}`.trim();return`Liian pieni: arvon täytyy olla ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${b.prefix}"`;if(b.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${b.suffix}"`;if(b.format==="includes")return`Virheellinen syöte: täytyy sisältää "${b.includes}"`;if(b.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${b.pattern}`;return`Virheellinen ${w[b.format]??_.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${_.divisor} monikerta`;case"unrecognized_keys":return`${_.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${K(_.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öte"}}};function I9(){return{localeError:UI()}}var JI=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function v(_){return $[_]??null}let w={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},g={nan:"NaN",number:"nombre",array:"tableau"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Entrée invalide : instanceof ${_.expected} attendu, ${D} reçu`;return`Entrée invalide : ${b} attendu, ${D} reçu`}case"invalid_value":if(_.values.length===1)return`Entrée invalide : ${k(_.values[0])} attendu`;return`Option invalide : une valeur parmi ${K(_.values,"|")} attendue`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Trop grand : ${_.origin??"valeur"} doit ${J.verb} ${b}${_.maximum.toString()} ${J.unit??"élément(s)"}`;return`Trop grand : ${_.origin??"valeur"} doit être ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Trop petit : ${_.origin} doit ${J.verb} ${b}${_.minimum.toString()} ${J.unit}`;return`Trop petit : ${_.origin} doit être ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Chaîne invalide : doit commencer par "${b.prefix}"`;if(b.format==="ends_with")return`Chaîne invalide : doit se terminer par "${b.suffix}"`;if(b.format==="includes")return`Chaîne invalide : doit inclure "${b.includes}"`;if(b.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${b.pattern}`;return`${w[b.format]??_.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${_.divisor}`;case"unrecognized_keys":return`Clé${_.keys.length>1?"s":""} non reconnue${_.keys.length>1?"s":""} : ${K(_.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${_.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${_.origin}`;default:return"Entrée invalide"}}};function B9(){return{localeError:JI()}}var DI=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function v(_){return $[_]??null}let w={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Entrée invalide : attendu instanceof ${_.expected}, reçu ${D}`;return`Entrée invalide : attendu ${b}, reçu ${D}`}case"invalid_value":if(_.values.length===1)return`Entrée invalide : attendu ${k(_.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"≤":"<",J=v(_.origin);if(J)return`Trop grand : attendu que ${_.origin??"la valeur"} ait ${b}${_.maximum.toString()} ${J.unit}`;return`Trop grand : attendu que ${_.origin??"la valeur"} soit ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?"≥":">",J=v(_.origin);if(J)return`Trop petit : attendu que ${_.origin} ait ${b}${_.minimum.toString()} ${J.unit}`;return`Trop petit : attendu que ${_.origin} soit ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Chaîne invalide : doit commencer par "${b.prefix}"`;if(b.format==="ends_with")return`Chaîne invalide : doit se terminer par "${b.suffix}"`;if(b.format==="includes")return`Chaîne invalide : doit inclure "${b.includes}"`;if(b.format==="regex")return`Chaîne invalide : doit correspondre au motif ${b.pattern}`;return`${w[b.format]??_.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${_.divisor}`;case"unrecognized_keys":return`Clé${_.keys.length>1?"s":""} non reconnue${_.keys.length>1?"s":""} : ${K(_.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${_.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${_.origin}`;default:return"Entrée invalide"}}};function L9(){return{localeError:DI()}}var XI=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},v={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},w=(G)=>G?$[G]:void 0,g=(G)=>{let Y=w(G);if(Y)return Y.label;return G??$.unknown.label},_=(G)=>`ה${g(G)}`,b=(G)=>{return(w(G)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},J=(G)=>{if(!G)return null;return v[G]??null},D={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},X={nan:"NaN"};return(G)=>{switch(G.code){case"invalid_type":{let Y=G.expected,Q=X[Y??""]??g(Y),H=P(G.input),I=X[H]??$[H]?.label??H;if(/^[A-Z]/.test(G.expected))return`קלט לא תקין: צריך להיות instanceof ${G.expected}, התקבל ${I}`;return`קלט לא תקין: צריך להיות ${Q}, התקבל ${I}`}case"invalid_value":{if(G.values.length===1)return`ערך לא תקין: הערך חייב להיות ${k(G.values[0])}`;let Y=G.values.map((I)=>k(I));if(G.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${Y[0]} או ${Y[1]}`;let Q=Y[Y.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${Y.slice(0,-1).join(", ")} או ${Q}`}case"too_big":{let Y=J(G.origin),Q=_(G.origin??"value");if(G.origin==="string")return`${Y?.longLabel??"ארוך"} מדי: ${Q} צריכה להכיל ${G.maximum.toString()} ${Y?.unit??""} ${G.inclusive?"או פחות":"לכל היותר"}`.trim();if(G.origin==="number"){let q=G.inclusive?`קטן או שווה ל-${G.maximum}`:`קטן מ-${G.maximum}`;return`גדול מדי: ${Q} צריך להיות ${q}`}if(G.origin==="array"||G.origin==="set"){let q=G.origin==="set"?"צריכה":"צריך",W=G.inclusive?`${G.maximum} ${Y?.unit??""} או פחות`:`פחות מ-${G.maximum} ${Y?.unit??""}`;return`גדול מדי: ${Q} ${q} להכיל ${W}`.trim()}let H=G.inclusive?"<=":"<",I=b(G.origin??"value");if(Y?.unit)return`${Y.longLabel} מדי: ${Q} ${I} ${H}${G.maximum.toString()} ${Y.unit}`;return`${Y?.longLabel??"גדול"} מדי: ${Q} ${I} ${H}${G.maximum.toString()}`}case"too_small":{let Y=J(G.origin),Q=_(G.origin??"value");if(G.origin==="string")return`${Y?.shortLabel??"קצר"} מדי: ${Q} צריכה להכיל ${G.minimum.toString()} ${Y?.unit??""} ${G.inclusive?"או יותר":"לפחות"}`.trim();if(G.origin==="number"){let q=G.inclusive?`גדול או שווה ל-${G.minimum}`:`גדול מ-${G.minimum}`;return`קטן מדי: ${Q} צריך להיות ${q}`}if(G.origin==="array"||G.origin==="set"){let q=G.origin==="set"?"צריכה":"צריך";if(G.minimum===1&&G.inclusive){let B=G.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${Q} ${q} להכיל ${B}`}let W=G.inclusive?`${G.minimum} ${Y?.unit??""} או יותר`:`יותר מ-${G.minimum} ${Y?.unit??""}`;return`קטן מדי: ${Q} ${q} להכיל ${W}`.trim()}let H=G.inclusive?">=":">",I=b(G.origin??"value");if(Y?.unit)return`${Y.shortLabel} מדי: ${Q} ${I} ${H}${G.minimum.toString()} ${Y.unit}`;return`${Y?.shortLabel??"קטן"} מדי: ${Q} ${I} ${H}${G.minimum.toString()}`}case"invalid_format":{let Y=G;if(Y.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${Y.prefix}"`;if(Y.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${Y.suffix}"`;if(Y.format==="includes")return`המחרוזת חייבת לכלול "${Y.includes}"`;if(Y.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${Y.pattern}`;let Q=D[Y.format],H=Q?.label??Y.format,q=(Q?.gender??"m")==="f"?"תקינה":"תקין";return`${H} לא ${q}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${G.divisor}`;case"unrecognized_keys":return`מפתח${G.keys.length>1?"ות":""} לא מזוה${G.keys.length>1?"ים":"ה"}: ${K(G.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${_(G.origin??"array")}`;default:return"קלט לא תקין"}}};function V9(){return{localeError:XI()}}var GI=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function v(_){return $[_]??null}let w={regex:"bemenet",email:"email cím",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őbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},g={nan:"NaN",number:"szám",array:"tömb"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Érvénytelen bemenet: a várt érték instanceof ${_.expected}, a kapott érték ${D}`;return`Érvénytelen bemenet: a várt érték ${b}, a kapott érték ${D}`}case"invalid_value":if(_.values.length===1)return`Érvénytelen bemenet: a várt érték ${k(_.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Túl nagy: ${_.origin??"érték"} mérete túl nagy ${b}${_.maximum.toString()} ${J.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${_.origin??"érték"} túl nagy: ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Túl kicsi: a bemeneti érték ${_.origin} mérete túl kicsi ${b}${_.minimum.toString()} ${J.unit}`;return`Túl kicsi: a bemeneti érték ${_.origin} túl kicsi ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Érvénytelen string: "${b.prefix}" értékkel kell kezdődnie`;if(b.format==="ends_with")return`Érvénytelen string: "${b.suffix}" értékkel kell végződnie`;if(b.format==="includes")return`Érvénytelen string: "${b.includes}" értéket kell tartalmaznia`;if(b.format==="regex")return`Érvénytelen string: ${b.pattern} mintának kell megfelelnie`;return`Érvénytelen ${w[b.format]??_.format}`}case"not_multiple_of":return`Érvénytelen szám: ${_.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${_.keys.length>1?"s":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${_.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${_.origin}`;default:return"Érvénytelen bemenet"}}};function j9(){return{localeError:GI()}}function A8($,v,w){return Math.abs($)===1?v:w}function Fw($){if(!$)return"";let v=["ա","ե","ը","ի","ո","ու","օ"],w=$[$.length-1];return $+(v.includes(w)?"ն":"ը")}var YI=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function v(_){return $[_]??null}let w={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},g={nan:"NaN",number:"թիվ",array:"զանգված"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${_.expected}, ստացվել է ${D}`;return`Սխալ մուտքագրում․ սպասվում էր ${b}, ստացվել է ${D}`}case"invalid_value":if(_.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${k(_.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J){let D=Number(_.maximum),X=A8(D,J.unit.one,J.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Fw(_.origin??"արժեք")} կունենա ${b}${_.maximum.toString()} ${X}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Fw(_.origin??"արժեք")} լինի ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J){let D=Number(_.minimum),X=A8(D,J.unit.one,J.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Fw(_.origin)} կունենա ${b}${_.minimum.toString()} ${X}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Fw(_.origin)} լինի ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${b.prefix}"-ով`;if(b.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${b.suffix}"-ով`;if(b.format==="includes")return`Սխալ տող․ պետք է պարունակի "${b.includes}"`;if(b.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${b.pattern} ձևաչափին`;return`Սխալ ${w[b.format]??_.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${_.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${_.keys.length>1?"ներ":""}. ${K(_.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${Fw(_.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${Fw(_.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function F9(){return{localeError:YI()}}var QI=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function v(_){return $[_]??null}let w={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Input tidak valid: diharapkan instanceof ${_.expected}, diterima ${D}`;return`Input tidak valid: diharapkan ${b}, diterima ${D}`}case"invalid_value":if(_.values.length===1)return`Input tidak valid: diharapkan ${k(_.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Terlalu besar: diharapkan ${_.origin??"value"} memiliki ${b}${_.maximum.toString()} ${J.unit??"elemen"}`;return`Terlalu besar: diharapkan ${_.origin??"value"} menjadi ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Terlalu kecil: diharapkan ${_.origin} memiliki ${b}${_.minimum.toString()} ${J.unit}`;return`Terlalu kecil: diharapkan ${_.origin} menjadi ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`String tidak valid: harus dimulai dengan "${b.prefix}"`;if(b.format==="ends_with")return`String tidak valid: harus berakhir dengan "${b.suffix}"`;if(b.format==="includes")return`String tidak valid: harus menyertakan "${b.includes}"`;if(b.format==="regex")return`String tidak valid: harus sesuai pola ${b.pattern}`;return`${w[b.format]??_.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${_.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${_.keys.length>1?"s":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${_.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${_.origin}`;default:return"Input tidak valid"}}};function K9(){return{localeError:QI()}}var WI=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function v(_){return $[_]??null}let w={regex:"gildi",email:"netfang",url:"vefslóð",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ími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},g={nan:"NaN",number:"númer",array:"fylki"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Rangt gildi: Þú slóst inn ${D} þar sem á að vera instanceof ${_.expected}`;return`Rangt gildi: Þú slóst inn ${D} þar sem á að vera ${b}`}case"invalid_value":if(_.values.length===1)return`Rangt gildi: gert ráð fyrir ${k(_.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Of stórt: gert er ráð fyrir að ${_.origin??"gildi"} hafi ${b}${_.maximum.toString()} ${J.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${_.origin??"gildi"} sé ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Of lítið: gert er ráð fyrir að ${_.origin} hafi ${b}${_.minimum.toString()} ${J.unit}`;return`Of lítið: gert er ráð fyrir að ${_.origin} sé ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ógildur strengur: verður að byrja á "${b.prefix}"`;if(b.format==="ends_with")return`Ógildur strengur: verður að enda á "${b.suffix}"`;if(b.format==="includes")return`Ógildur strengur: verður að innihalda "${b.includes}"`;if(b.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${b.pattern}`;return`Rangt ${w[b.format]??_.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${_.divisor}`;case"unrecognized_keys":return`Óþekkt ${_.keys.length>1?"ir lyklar":"ur lykill"}: ${K(_.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${_.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${_.origin}`;default:return"Rangt gildi"}}};function O9(){return{localeError:WI()}}var HI=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function v(_){return $[_]??null}let w={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"numero",array:"vettore"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Input non valido: atteso instanceof ${_.expected}, ricevuto ${D}`;return`Input non valido: atteso ${b}, ricevuto ${D}`}case"invalid_value":if(_.values.length===1)return`Input non valido: atteso ${k(_.values[0])}`;return`Opzione non valida: atteso uno tra ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Troppo grande: ${_.origin??"valore"} deve avere ${b}${_.maximum.toString()} ${J.unit??"elementi"}`;return`Troppo grande: ${_.origin??"valore"} deve essere ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Troppo piccolo: ${_.origin} deve avere ${b}${_.minimum.toString()} ${J.unit}`;return`Troppo piccolo: ${_.origin} deve essere ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Stringa non valida: deve iniziare con "${b.prefix}"`;if(b.format==="ends_with")return`Stringa non valida: deve terminare con "${b.suffix}"`;if(b.format==="includes")return`Stringa non valida: deve includere "${b.includes}"`;if(b.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${b.pattern}`;return`Invalid ${w[b.format]??_.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${_.divisor}`;case"unrecognized_keys":return`Chiav${_.keys.length>1?"i":"e"} non riconosciut${_.keys.length>1?"e":"a"}: ${K(_.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${_.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${_.origin}`;default:return"Input non valido"}}};function i9(){return{localeError:HI()}}var nI=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function v(_){return $[_]??null}let w={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},g={nan:"NaN",number:"数値",array:"配列"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`無効な入力: instanceof ${_.expected}が期待されましたが、${D}が入力されました`;return`無効な入力: ${b}が期待されましたが、${D}が入力されました`}case"invalid_value":if(_.values.length===1)return`無効な入力: ${k(_.values[0])}が期待されました`;return`無効な選択: ${K(_.values,"、")}のいずれかである必要があります`;case"too_big":{let b=_.inclusive?"以下である":"より小さい",J=v(_.origin);if(J)return`大きすぎる値: ${_.origin??"値"}は${_.maximum.toString()}${J.unit??"要素"}${b}必要があります`;return`大きすぎる値: ${_.origin??"値"}は${_.maximum.toString()}${b}必要があります`}case"too_small":{let b=_.inclusive?"以上である":"より大きい",J=v(_.origin);if(J)return`小さすぎる値: ${_.origin}は${_.minimum.toString()}${J.unit}${b}必要があります`;return`小さすぎる値: ${_.origin}は${_.minimum.toString()}${b}必要があります`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`無効な文字列: "${b.prefix}"で始まる必要があります`;if(b.format==="ends_with")return`無効な文字列: "${b.suffix}"で終わる必要があります`;if(b.format==="includes")return`無効な文字列: "${b.includes}"を含む必要があります`;if(b.format==="regex")return`無効な文字列: パターン${b.pattern}に一致する必要があります`;return`無効な${w[b.format]??_.format}`}case"not_multiple_of":return`無効な数値: ${_.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${_.keys.length>1?"群":""}: ${K(_.keys,"、")}`;case"invalid_key":return`${_.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${_.origin}内の無効な値`;default:return"無効な入力"}}};function k9(){return{localeError:nI()}}var qI=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function v(_){return $[_]??null}let w={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},g={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${_.expected}, მიღებული ${D}`;return`არასწორი შეყვანა: მოსალოდნელი ${b}, მიღებული ${D}`}case"invalid_value":if(_.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${k(_.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${K(_.values,"|")}-დან`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`ზედმეტად დიდი: მოსალოდნელი ${_.origin??"მნიშვნელობა"} ${J.verb} ${b}${_.maximum.toString()} ${J.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${_.origin??"მნიშვნელობა"} იყოს ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`ზედმეტად პატარა: მოსალოდნელი ${_.origin} ${J.verb} ${b}${_.minimum.toString()} ${J.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${_.origin} იყოს ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${b.prefix}"-ით`;if(b.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${b.suffix}"-ით`;if(b.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${b.includes}"-ს`;if(b.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${b.pattern}`;return`არასწორი ${w[b.format]??_.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${_.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${_.keys.length>1?"ები":"ი"}: ${K(_.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${_.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${_.origin}-ში`;default:return"არასწორი შეყვანა"}}};function N9(){return{localeError:qI()}}var II=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function v(_){return $[_]??null}let w={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},g={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${_.expected} ប៉ុន្តែទទួលបាន ${D}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${b} ប៉ុន្តែទទួលបាន ${D}`}case"invalid_value":if(_.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${k(_.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`ធំពេក៖ ត្រូវការ ${_.origin??"តម្លៃ"} ${b} ${_.maximum.toString()} ${J.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${_.origin??"តម្លៃ"} ${b} ${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`តូចពេក៖ ត្រូវការ ${_.origin} ${b} ${_.minimum.toString()} ${J.unit}`;return`តូចពេក៖ ត្រូវការ ${_.origin} ${b} ${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${b.prefix}"`;if(b.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${b.suffix}"`;if(b.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${b.includes}"`;if(b.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${b.pattern}`;return`មិនត្រឹមត្រូវ៖ ${w[b.format]??_.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${_.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${K(_.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${_.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${_.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function g4(){return{localeError:II()}}function P9(){return g4()}var BI=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function v(_){return $[_]??null}let w={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`잘못된 입력: 예상 타입은 instanceof ${_.expected}, 받은 타입은 ${D}입니다`;return`잘못된 입력: 예상 타입은 ${b}, 받은 타입은 ${D}입니다`}case"invalid_value":if(_.values.length===1)return`잘못된 입력: 값은 ${k(_.values[0])} 이어야 합니다`;return`잘못된 옵션: ${K(_.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let b=_.inclusive?"이하":"미만",J=b==="미만"?"이어야 합니다":"여야 합니다",D=v(_.origin),X=D?.unit??"요소";if(D)return`${_.origin??"값"}이 너무 큽니다: ${_.maximum.toString()}${X} ${b}${J}`;return`${_.origin??"값"}이 너무 큽니다: ${_.maximum.toString()} ${b}${J}`}case"too_small":{let b=_.inclusive?"이상":"초과",J=b==="이상"?"이어야 합니다":"여야 합니다",D=v(_.origin),X=D?.unit??"요소";if(D)return`${_.origin??"값"}이 너무 작습니다: ${_.minimum.toString()}${X} ${b}${J}`;return`${_.origin??"값"}이 너무 작습니다: ${_.minimum.toString()} ${b}${J}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`잘못된 문자열: "${b.prefix}"(으)로 시작해야 합니다`;if(b.format==="ends_with")return`잘못된 문자열: "${b.suffix}"(으)로 끝나야 합니다`;if(b.format==="includes")return`잘못된 문자열: "${b.includes}"을(를) 포함해야 합니다`;if(b.format==="regex")return`잘못된 문자열: 정규식 ${b.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${w[b.format]??_.format}`}case"not_multiple_of":return`잘못된 숫자: ${_.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${K(_.keys,", ")}`;case"invalid_key":return`잘못된 키: ${_.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${_.origin}`;default:return"잘못된 입력"}}};function f9(){return{localeError:BI()}}var b4=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function M8($){let v=Math.abs($),w=v%10,g=v%100;if(g>=11&&g<=19||w===0)return"many";if(w===1)return"one";return"few"}var LI=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function v(_,b,J,D){let X=$[_]??null;if(X===null)return X;return{unit:X.unit[b],verb:X.verb[D][J?"inclusive":"notInclusive"]}}let w={regex:"įvestis",email:"el. pašto 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ė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},g={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Gautas tipas ${D}, o tikėtasi - instanceof ${_.expected}`;return`Gautas tipas ${D}, o tikėtasi - ${b}`}case"invalid_value":if(_.values.length===1)return`Privalo būti ${k(_.values[0])}`;return`Privalo būti vienas iš ${K(_.values,"|")} pasirinkimų`;case"too_big":{let b=g[_.origin]??_.origin,J=v(_.origin,M8(Number(_.maximum)),_.inclusive??!1,"smaller");if(J?.verb)return`${b4(b??_.origin??"reikšmė")} ${J.verb} ${_.maximum.toString()} ${J.unit??"elementų"}`;let D=_.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${b4(b??_.origin??"reikšmė")} turi būti ${D} ${_.maximum.toString()} ${J?.unit}`}case"too_small":{let b=g[_.origin]??_.origin,J=v(_.origin,M8(Number(_.minimum)),_.inclusive??!1,"bigger");if(J?.verb)return`${b4(b??_.origin??"reikšmė")} ${J.verb} ${_.minimum.toString()} ${J.unit??"elementų"}`;let D=_.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${b4(b??_.origin??"reikšmė")} turi būti ${D} ${_.minimum.toString()} ${J?.unit}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Eilutė privalo prasidėti "${b.prefix}"`;if(b.format==="ends_with")return`Eilutė privalo pasibaigti "${b.suffix}"`;if(b.format==="includes")return`Eilutė privalo įtraukti "${b.includes}"`;if(b.format==="regex")return`Eilutė privalo atitikti ${b.pattern}`;return`Neteisingas ${w[b.format]??_.format}`}case"not_multiple_of":return`Skaičius privalo būti ${_.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${_.keys.length>1?"i":"as"} rakt${_.keys.length>1?"ai":"as"}: ${K(_.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let b=g[_.origin]??_.origin;return`${b4(b??_.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function A9(){return{localeError:LI()}}var VI=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function v(_){return $[_]??null}let w={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},g={nan:"NaN",number:"број",array:"низа"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Грешен внес: се очекува instanceof ${_.expected}, примено ${D}`;return`Грешен внес: се очекува ${b}, примено ${D}`}case"invalid_value":if(_.values.length===1)return`Invalid input: expected ${k(_.values[0])}`;return`Грешана опција: се очекува една ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Премногу голем: се очекува ${_.origin??"вредноста"} да има ${b}${_.maximum.toString()} ${J.unit??"елементи"}`;return`Премногу голем: се очекува ${_.origin??"вредноста"} да биде ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Премногу мал: се очекува ${_.origin} да има ${b}${_.minimum.toString()} ${J.unit}`;return`Премногу мал: се очекува ${_.origin} да биде ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Неважечка низа: мора да започнува со "${b.prefix}"`;if(b.format==="ends_with")return`Неважечка низа: мора да завршува со "${b.suffix}"`;if(b.format==="includes")return`Неважечка низа: мора да вклучува "${b.includes}"`;if(b.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${b.pattern}`;return`Invalid ${w[b.format]??_.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${K(_.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${_.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${_.origin}`;default:return"Грешен внес"}}};function M9(){return{localeError:VI()}}var jI=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function v(_){return $[_]??null}let w={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"nombor"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Input tidak sah: dijangka instanceof ${_.expected}, diterima ${D}`;return`Input tidak sah: dijangka ${b}, diterima ${D}`}case"invalid_value":if(_.values.length===1)return`Input tidak sah: dijangka ${k(_.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Terlalu besar: dijangka ${_.origin??"nilai"} ${J.verb} ${b}${_.maximum.toString()} ${J.unit??"elemen"}`;return`Terlalu besar: dijangka ${_.origin??"nilai"} adalah ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Terlalu kecil: dijangka ${_.origin} ${J.verb} ${b}${_.minimum.toString()} ${J.unit}`;return`Terlalu kecil: dijangka ${_.origin} adalah ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`String tidak sah: mesti bermula dengan "${b.prefix}"`;if(b.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${b.suffix}"`;if(b.format==="includes")return`String tidak sah: mesti mengandungi "${b.includes}"`;if(b.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${b.pattern}`;return`${w[b.format]??_.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${_.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${K(_.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${_.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${_.origin}`;default:return"Input tidak sah"}}};function z9(){return{localeError:jI()}}var FI=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function v(_){return $[_]??null}let w={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},g={nan:"NaN",number:"getal"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Ongeldige invoer: verwacht instanceof ${_.expected}, ontving ${D}`;return`Ongeldige invoer: verwacht ${b}, ontving ${D}`}case"invalid_value":if(_.values.length===1)return`Ongeldige invoer: verwacht ${k(_.values[0])}`;return`Ongeldige optie: verwacht één van ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin),D=_.origin==="date"?"laat":_.origin==="string"?"lang":"groot";if(J)return`Te ${D}: verwacht dat ${_.origin??"waarde"} ${b}${_.maximum.toString()} ${J.unit??"elementen"} ${J.verb}`;return`Te ${D}: verwacht dat ${_.origin??"waarde"} ${b}${_.maximum.toString()} is`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin),D=_.origin==="date"?"vroeg":_.origin==="string"?"kort":"klein";if(J)return`Te ${D}: verwacht dat ${_.origin} ${b}${_.minimum.toString()} ${J.unit} ${J.verb}`;return`Te ${D}: verwacht dat ${_.origin} ${b}${_.minimum.toString()} is`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ongeldige tekst: moet met "${b.prefix}" beginnen`;if(b.format==="ends_with")return`Ongeldige tekst: moet op "${b.suffix}" eindigen`;if(b.format==="includes")return`Ongeldige tekst: moet "${b.includes}" bevatten`;if(b.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${b.pattern}`;return`Ongeldig: ${w[b.format]??_.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${_.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${_.keys.length>1?"s":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${_.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${_.origin}`;default:return"Ongeldige invoer"}}};function S9(){return{localeError:FI()}}var KI=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function v(_){return $[_]??null}let w={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"tall",array:"liste"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Ugyldig input: forventet instanceof ${_.expected}, fikk ${D}`;return`Ugyldig input: forventet ${b}, fikk ${D}`}case"invalid_value":if(_.values.length===1)return`Ugyldig verdi: forventet ${k(_.values[0])}`;return`Ugyldig valg: forventet en av ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`For stor(t): forventet ${_.origin??"value"} til å ha ${b}${_.maximum.toString()} ${J.unit??"elementer"}`;return`For stor(t): forventet ${_.origin??"value"} til å ha ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`For lite(n): forventet ${_.origin} til å ha ${b}${_.minimum.toString()} ${J.unit}`;return`For lite(n): forventet ${_.origin} til å ha ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ugyldig streng: må starte med "${b.prefix}"`;if(b.format==="ends_with")return`Ugyldig streng: må ende med "${b.suffix}"`;if(b.format==="includes")return`Ugyldig streng: må inneholde "${b.includes}"`;if(b.format==="regex")return`Ugyldig streng: må matche mønsteret ${b.pattern}`;return`Ugyldig ${w[b.format]??_.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${K(_.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${_.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${_.origin}`;default:return"Ugyldig input"}}};function u9(){return{localeError:KI()}}var OI=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function v(_){return $[_]??null}let w={regex:"giren",email:"epostagâh",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âmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},g={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Fâsit giren: umulan instanceof ${_.expected}, alınan ${D}`;return`Fâsit giren: umulan ${b}, alınan ${D}`}case"invalid_value":if(_.values.length===1)return`Fâsit giren: umulan ${k(_.values[0])}`;return`Fâsit tercih: mûteberler ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Fazla büyük: ${_.origin??"value"}, ${b}${_.maximum.toString()} ${J.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${_.origin??"value"}, ${b}${_.maximum.toString()} olmalıydı.`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Fazla küçük: ${_.origin}, ${b}${_.minimum.toString()} ${J.unit} sahip olmalıydı.`;return`Fazla küçük: ${_.origin}, ${b}${_.minimum.toString()} olmalıydı.`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Fâsit metin: "${b.prefix}" ile başlamalı.`;if(b.format==="ends_with")return`Fâsit metin: "${b.suffix}" ile bitmeli.`;if(b.format==="includes")return`Fâsit metin: "${b.includes}" ihtivâ etmeli.`;if(b.format==="regex")return`Fâsit metin: ${b.pattern} nakşına uymalı.`;return`Fâsit ${w[b.format]??_.format}`}case"not_multiple_of":return`Fâsit sayı: ${_.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${_.keys.length>1?"s":""}: ${K(_.keys,", ")}`;case"invalid_key":return`${_.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${_.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function T9(){return{localeError:OI()}}var iI=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function v(_){return $[_]??null}let w={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},g={nan:"NaN",number:"عدد",array:"ارې"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`ناسم ورودي: باید instanceof ${_.expected} وای, مګر ${D} ترلاسه شو`;return`ناسم ورودي: باید ${b} وای, مګر ${D} ترلاسه شو`}case"invalid_value":if(_.values.length===1)return`ناسم ورودي: باید ${k(_.values[0])} وای`;return`ناسم انتخاب: باید یو له ${K(_.values,"|")} څخه وای`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`ډیر لوی: ${_.origin??"ارزښت"} باید ${b}${_.maximum.toString()} ${J.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${_.origin??"ارزښت"} باید ${b}${_.maximum.toString()} وي`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`ډیر کوچنی: ${_.origin} باید ${b}${_.minimum.toString()} ${J.unit} ولري`;return`ډیر کوچنی: ${_.origin} باید ${b}${_.minimum.toString()} وي`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`ناسم متن: باید د "${b.prefix}" سره پیل شي`;if(b.format==="ends_with")return`ناسم متن: باید د "${b.suffix}" سره پای ته ورسيږي`;if(b.format==="includes")return`ناسم متن: باید "${b.includes}" ولري`;if(b.format==="regex")return`ناسم متن: باید د ${b.pattern} سره مطابقت ولري`;return`${w[b.format]??_.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${_.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${_.keys.length>1?"کلیډونه":"کلیډ"}: ${K(_.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${_.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${_.origin} کې`;default:return"ناسمه ورودي"}}};function R9(){return{localeError:iI()}}var kI=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function v(_){return $[_]??null}let w={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},g={nan:"NaN",number:"liczba",array:"tablica"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${_.expected}, otrzymano ${D}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${b}, otrzymano ${D}`}case"invalid_value":if(_.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${k(_.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Za duża wartość: oczekiwano, że ${_.origin??"wartość"} będzie mieć ${b}${_.maximum.toString()} ${J.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${_.origin??"wartość"} będzie wynosić ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Za mała wartość: oczekiwano, że ${_.origin??"wartość"} będzie mieć ${b}${_.minimum.toString()} ${J.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${_.origin??"wartość"} będzie wynosić ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${b.prefix}"`;if(b.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${b.suffix}"`;if(b.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${b.includes}"`;if(b.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${b.pattern}`;return`Nieprawidłow(y/a/e) ${w[b.format]??_.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${_.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${_.keys.length>1?"s":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${_.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${_.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function C9(){return{localeError:kI()}}var NI=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function v(_){return $[_]??null}let w={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},g={nan:"NaN",number:"número",null:"nulo"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Tipo inválido: esperado instanceof ${_.expected}, recebido ${D}`;return`Tipo inválido: esperado ${b}, recebido ${D}`}case"invalid_value":if(_.values.length===1)return`Entrada inválida: esperado ${k(_.values[0])}`;return`Opção inválida: esperada uma das ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Muito grande: esperado que ${_.origin??"valor"} tivesse ${b}${_.maximum.toString()} ${J.unit??"elementos"}`;return`Muito grande: esperado que ${_.origin??"valor"} fosse ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Muito pequeno: esperado que ${_.origin} tivesse ${b}${_.minimum.toString()} ${J.unit}`;return`Muito pequeno: esperado que ${_.origin} fosse ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Texto inválido: deve começar com "${b.prefix}"`;if(b.format==="ends_with")return`Texto inválido: deve terminar com "${b.suffix}"`;if(b.format==="includes")return`Texto inválido: deve incluir "${b.includes}"`;if(b.format==="regex")return`Texto inválido: deve corresponder ao padrão ${b.pattern}`;return`${w[b.format]??_.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${_.divisor}`;case"unrecognized_keys":return`Chave${_.keys.length>1?"s":""} desconhecida${_.keys.length>1?"s":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Chave inválida em ${_.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${_.origin}`;default:return"Campo inválido"}}};function E9(){return{localeError:NI()}}function z8($,v,w,g){let _=Math.abs($),b=_%10,J=_%100;if(J>=11&&J<=19)return g;if(b===1)return v;if(b>=2&&b<=4)return w;return g}var PI=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function v(_){return $[_]??null}let w={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},g={nan:"NaN",number:"число",array:"массив"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Неверный ввод: ожидалось instanceof ${_.expected}, получено ${D}`;return`Неверный ввод: ожидалось ${b}, получено ${D}`}case"invalid_value":if(_.values.length===1)return`Неверный ввод: ожидалось ${k(_.values[0])}`;return`Неверный вариант: ожидалось одно из ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J){let D=Number(_.maximum),X=z8(D,J.unit.one,J.unit.few,J.unit.many);return`Слишком большое значение: ожидалось, что ${_.origin??"значение"} будет иметь ${b}${_.maximum.toString()} ${X}`}return`Слишком большое значение: ожидалось, что ${_.origin??"значение"} будет ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J){let D=Number(_.minimum),X=z8(D,J.unit.one,J.unit.few,J.unit.many);return`Слишком маленькое значение: ожидалось, что ${_.origin} будет иметь ${b}${_.minimum.toString()} ${X}`}return`Слишком маленькое значение: ожидалось, что ${_.origin} будет ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Неверная строка: должна начинаться с "${b.prefix}"`;if(b.format==="ends_with")return`Неверная строка: должна заканчиваться на "${b.suffix}"`;if(b.format==="includes")return`Неверная строка: должна содержать "${b.includes}"`;if(b.format==="regex")return`Неверная строка: должна соответствовать шаблону ${b.pattern}`;return`Неверный ${w[b.format]??_.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${_.divisor}`;case"unrecognized_keys":return`Нераспознанн${_.keys.length>1?"ые":"ый"} ключ${_.keys.length>1?"и":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${_.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${_.origin}`;default:return"Неверные входные данные"}}};function Z9(){return{localeError:PI()}}var fI=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function v(_){return $[_]??null}let w={regex:"vnos",email:"e-poštni 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 čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},g={nan:"NaN",number:"število",array:"tabela"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Neveljaven vnos: pričakovano instanceof ${_.expected}, prejeto ${D}`;return`Neveljaven vnos: pričakovano ${b}, prejeto ${D}`}case"invalid_value":if(_.values.length===1)return`Neveljaven vnos: pričakovano ${k(_.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Preveliko: pričakovano, da bo ${_.origin??"vrednost"} imelo ${b}${_.maximum.toString()} ${J.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${_.origin??"vrednost"} ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Premajhno: pričakovano, da bo ${_.origin} imelo ${b}${_.minimum.toString()} ${J.unit}`;return`Premajhno: pričakovano, da bo ${_.origin} ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Neveljaven niz: mora se začeti z "${b.prefix}"`;if(b.format==="ends_with")return`Neveljaven niz: mora se končati z "${b.suffix}"`;if(b.format==="includes")return`Neveljaven niz: mora vsebovati "${b.includes}"`;if(b.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${b.pattern}`;return`Neveljaven ${w[b.format]??_.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${_.divisor}`;case"unrecognized_keys":return`Neprepoznan${_.keys.length>1?"i ključi":" ključ"}: ${K(_.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${_.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${_.origin}`;default:return"Neveljaven vnos"}}};function x9(){return{localeError:fI()}}var AI=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function v(_){return $[_]??null}let w={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},g={nan:"NaN",number:"antal",array:"lista"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Ogiltig inmatning: förväntat instanceof ${_.expected}, fick ${D}`;return`Ogiltig inmatning: förväntat ${b}, fick ${D}`}case"invalid_value":if(_.values.length===1)return`Ogiltig inmatning: förväntat ${k(_.values[0])}`;return`Ogiltigt val: förväntade en av ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`För stor(t): förväntade ${_.origin??"värdet"} att ha ${b}${_.maximum.toString()} ${J.unit??"element"}`;return`För stor(t): förväntat ${_.origin??"värdet"} att ha ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`För lite(t): förväntade ${_.origin??"värdet"} att ha ${b}${_.minimum.toString()} ${J.unit}`;return`För lite(t): förväntade ${_.origin??"värdet"} att ha ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ogiltig sträng: måste börja med "${b.prefix}"`;if(b.format==="ends_with")return`Ogiltig sträng: måste sluta med "${b.suffix}"`;if(b.format==="includes")return`Ogiltig sträng: måste innehålla "${b.includes}"`;if(b.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${b.pattern}"`;return`Ogiltig(t) ${w[b.format]??_.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${K(_.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${_.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${_.origin??"värdet"}`;default:return"Ogiltig input"}}};function l9(){return{localeError:AI()}}var MI=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function v(_){return $[_]??null}let w={regex:"உள்ளீடு",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 தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${_.expected}, பெறப்பட்டது ${D}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${b}, பெறப்பட்டது ${D}`}case"invalid_value":if(_.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${k(_.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${K(_.values,"|")} இல் ஒன்று`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${_.origin??"மதிப்பு"} ${b}${_.maximum.toString()} ${J.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${_.origin??"மதிப்பு"} ${b}${_.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${_.origin} ${b}${_.minimum.toString()} ${J.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${_.origin} ${b}${_.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`தவறான சரம்: "${b.prefix}" இல் தொடங்க வேண்டும்`;if(b.format==="ends_with")return`தவறான சரம்: "${b.suffix}" இல் முடிவடைய வேண்டும்`;if(b.format==="includes")return`தவறான சரம்: "${b.includes}" ஐ உள்ளடக்க வேண்டும்`;if(b.format==="regex")return`தவறான சரம்: ${b.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${w[b.format]??_.format}`}case"not_multiple_of":return`தவறான எண்: ${_.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${_.keys.length>1?"கள்":""}: ${K(_.keys,", ")}`;case"invalid_key":return`${_.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${_.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function h9(){return{localeError:MI()}}var zI=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function v(_){return $[_]??null}let w={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},g={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${_.expected} แต่ได้รับ ${D}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${b} แต่ได้รับ ${D}`}case"invalid_value":if(_.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${k(_.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"ไม่เกิน":"น้อยกว่า",J=v(_.origin);if(J)return`เกินกำหนด: ${_.origin??"ค่า"} ควรมี${b} ${_.maximum.toString()} ${J.unit??"รายการ"}`;return`เกินกำหนด: ${_.origin??"ค่า"} ควรมี${b} ${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?"อย่างน้อย":"มากกว่า",J=v(_.origin);if(J)return`น้อยกว่ากำหนด: ${_.origin} ควรมี${b} ${_.minimum.toString()} ${J.unit}`;return`น้อยกว่ากำหนด: ${_.origin} ควรมี${b} ${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${b.prefix}"`;if(b.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${b.suffix}"`;if(b.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${b.includes}" อยู่ในข้อความ`;if(b.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${b.pattern}`;return`รูปแบบไม่ถูกต้อง: ${w[b.format]??_.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${_.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${K(_.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${_.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${_.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function c9(){return{localeError:zI()}}var SI=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function v(_){return $[_]??null}let w={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üre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Geçersiz değer: beklenen instanceof ${_.expected}, alınan ${D}`;return`Geçersiz değer: beklenen ${b}, alınan ${D}`}case"invalid_value":if(_.values.length===1)return`Geçersiz değer: beklenen ${k(_.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Çok büyük: beklenen ${_.origin??"değer"} ${b}${_.maximum.toString()} ${J.unit??"öğe"}`;return`Çok büyük: beklenen ${_.origin??"değer"} ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Çok küçük: beklenen ${_.origin} ${b}${_.minimum.toString()} ${J.unit}`;return`Çok küçük: beklenen ${_.origin} ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Geçersiz metin: "${b.prefix}" ile başlamalı`;if(b.format==="ends_with")return`Geçersiz metin: "${b.suffix}" ile bitmeli`;if(b.format==="includes")return`Geçersiz metin: "${b.includes}" içermeli`;if(b.format==="regex")return`Geçersiz metin: ${b.pattern} desenine uymalı`;return`Geçersiz ${w[b.format]??_.format}`}case"not_multiple_of":return`Geçersiz sayı: ${_.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${_.keys.length>1?"lar":""}: ${K(_.keys,", ")}`;case"invalid_key":return`${_.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${_.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function y9(){return{localeError:SI()}}var uI=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function v(_){return $[_]??null}let w={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},g={nan:"NaN",number:"число",array:"масив"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Неправильні вхідні дані: очікується instanceof ${_.expected}, отримано ${D}`;return`Неправильні вхідні дані: очікується ${b}, отримано ${D}`}case"invalid_value":if(_.values.length===1)return`Неправильні вхідні дані: очікується ${k(_.values[0])}`;return`Неправильна опція: очікується одне з ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Занадто велике: очікується, що ${_.origin??"значення"} ${J.verb} ${b}${_.maximum.toString()} ${J.unit??"елементів"}`;return`Занадто велике: очікується, що ${_.origin??"значення"} буде ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Занадто мале: очікується, що ${_.origin} ${J.verb} ${b}${_.minimum.toString()} ${J.unit}`;return`Занадто мале: очікується, що ${_.origin} буде ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Неправильний рядок: повинен починатися з "${b.prefix}"`;if(b.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${b.suffix}"`;if(b.format==="includes")return`Неправильний рядок: повинен містити "${b.includes}"`;if(b.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${b.pattern}`;return`Неправильний ${w[b.format]??_.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${_.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${_.keys.length>1?"і":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${_.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${_.origin}`;default:return"Неправильні вхідні дані"}}};function U4(){return{localeError:uI()}}function m9(){return U4()}var TI=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function v(_){return $[_]??null}let w={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},g={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`غلط ان پٹ: instanceof ${_.expected} متوقع تھا، ${D} موصول ہوا`;return`غلط ان پٹ: ${b} متوقع تھا، ${D} موصول ہوا`}case"invalid_value":if(_.values.length===1)return`غلط ان پٹ: ${k(_.values[0])} متوقع تھا`;return`غلط آپشن: ${K(_.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`بہت بڑا: ${_.origin??"ویلیو"} کے ${b}${_.maximum.toString()} ${J.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${_.origin??"ویلیو"} کا ${b}${_.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`بہت چھوٹا: ${_.origin} کے ${b}${_.minimum.toString()} ${J.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${_.origin} کا ${b}${_.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`غلط سٹرنگ: "${b.prefix}" سے شروع ہونا چاہیے`;if(b.format==="ends_with")return`غلط سٹرنگ: "${b.suffix}" پر ختم ہونا چاہیے`;if(b.format==="includes")return`غلط سٹرنگ: "${b.includes}" شامل ہونا چاہیے`;if(b.format==="regex")return`غلط سٹرنگ: پیٹرن ${b.pattern} سے میچ ہونا چاہیے`;return`غلط ${w[b.format]??_.format}`}case"not_multiple_of":return`غلط نمبر: ${_.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${_.keys.length>1?"ز":""}: ${K(_.keys,"، ")}`;case"invalid_key":return`${_.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${_.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function r9(){return{localeError:TI()}}var RI=()=>{let $={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function v(_){return $[_]??null}let w={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},g={nan:"NaN",number:"raqam",array:"massiv"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${_.expected}, qabul qilingan ${D}`;return`Noto‘g‘ri kirish: kutilgan ${b}, qabul qilingan ${D}`}case"invalid_value":if(_.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${k(_.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Juda katta: kutilgan ${_.origin??"qiymat"} ${b}${_.maximum.toString()} ${J.unit} ${J.verb}`;return`Juda katta: kutilgan ${_.origin??"qiymat"} ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Juda kichik: kutilgan ${_.origin} ${b}${_.minimum.toString()} ${J.unit} ${J.verb}`;return`Juda kichik: kutilgan ${_.origin} ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Noto‘g‘ri satr: "${b.prefix}" bilan boshlanishi kerak`;if(b.format==="ends_with")return`Noto‘g‘ri satr: "${b.suffix}" bilan tugashi kerak`;if(b.format==="includes")return`Noto‘g‘ri satr: "${b.includes}" ni o‘z ichiga olishi kerak`;if(b.format==="regex")return`Noto‘g‘ri satr: ${b.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${w[b.format]??_.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${_.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${_.keys.length>1?"lar":""}: ${K(_.keys,", ")}`;case"invalid_key":return`${_.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${_.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function o9(){return{localeError:RI()}}var CI=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function v(_){return $[_]??null}let w={regex:"đầu vào",email:"địa chỉ 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ày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},g={nan:"NaN",number:"số",array:"mảng"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${_.expected}, nhận được ${D}`;return`Đầu vào không hợp lệ: mong đợi ${b}, nhận được ${D}`}case"invalid_value":if(_.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${k(_.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Quá lớn: mong đợi ${_.origin??"giá trị"} ${J.verb} ${b}${_.maximum.toString()} ${J.unit??"phần tử"}`;return`Quá lớn: mong đợi ${_.origin??"giá trị"} ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Quá nhỏ: mong đợi ${_.origin} ${J.verb} ${b}${_.minimum.toString()} ${J.unit}`;return`Quá nhỏ: mong đợi ${_.origin} ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${b.prefix}"`;if(b.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${b.suffix}"`;if(b.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${b.includes}"`;if(b.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${b.pattern}`;return`${w[b.format]??_.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${_.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${K(_.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${_.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${_.origin}`;default:return"Đầu vào không hợp lệ"}}};function t9(){return{localeError:CI()}}var EI=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function v(_){return $[_]??null}let w={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},g={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`无效输入:期望 instanceof ${_.expected},实际接收 ${D}`;return`无效输入:期望 ${b},实际接收 ${D}`}case"invalid_value":if(_.values.length===1)return`无效输入:期望 ${k(_.values[0])}`;return`无效选项:期望以下之一 ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`数值过大:期望 ${_.origin??"值"} ${b}${_.maximum.toString()} ${J.unit??"个元素"}`;return`数值过大:期望 ${_.origin??"值"} ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`数值过小:期望 ${_.origin} ${b}${_.minimum.toString()} ${J.unit}`;return`数值过小:期望 ${_.origin} ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`无效字符串:必须以 "${b.prefix}" 开头`;if(b.format==="ends_with")return`无效字符串:必须以 "${b.suffix}" 结尾`;if(b.format==="includes")return`无效字符串:必须包含 "${b.includes}"`;if(b.format==="regex")return`无效字符串:必须满足正则表达式 ${b.pattern}`;return`无效${w[b.format]??_.format}`}case"not_multiple_of":return`无效数字:必须是 ${_.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${K(_.keys,", ")}`;case"invalid_key":return`${_.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${_.origin} 中包含无效值(value)`;default:return"无效输入"}}};function d9(){return{localeError:EI()}}var ZI=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function v(_){return $[_]??null}let w={regex:"輸入",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 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`無效的輸入值:預期為 instanceof ${_.expected},但收到 ${D}`;return`無效的輸入值:預期為 ${b},但收到 ${D}`}case"invalid_value":if(_.values.length===1)return`無效的輸入值:預期為 ${k(_.values[0])}`;return`無效的選項:預期為以下其中之一 ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`數值過大:預期 ${_.origin??"值"} 應為 ${b}${_.maximum.toString()} ${J.unit??"個元素"}`;return`數值過大:預期 ${_.origin??"值"} 應為 ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`數值過小:預期 ${_.origin} 應為 ${b}${_.minimum.toString()} ${J.unit}`;return`數值過小:預期 ${_.origin} 應為 ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`無效的字串:必須以 "${b.prefix}" 開頭`;if(b.format==="ends_with")return`無效的字串:必須以 "${b.suffix}" 結尾`;if(b.format==="includes")return`無效的字串:必須包含 "${b.includes}"`;if(b.format==="regex")return`無效的字串:必須符合格式 ${b.pattern}`;return`無效的 ${w[b.format]??_.format}`}case"not_multiple_of":return`無效的數字:必須為 ${_.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${_.keys.length>1?"們":""}:${K(_.keys,"、")}`;case"invalid_key":return`${_.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${_.origin} 中有無效的值`;default:return"無效的輸入值"}}};function p9(){return{localeError:ZI()}}var xI=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function v(_){return $[_]??null}let w={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},g={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=P(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${_.expected}, àmọ̀ a rí ${D}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${b}, àmọ̀ a rí ${D}`}case"invalid_value":if(_.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${k(_.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${K(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${_.origin??"iye"} ${J.verb} ${b}${_.maximum} ${J.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${b}${_.maximum}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Kéré ju: a ní láti jẹ́ pé ${_.origin} ${J.verb} ${b}${_.minimum} ${J.unit}`;return`Kéré ju: a ní láti jẹ́ ${b}${_.minimum}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${b.prefix}"`;if(b.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${b.suffix}"`;if(b.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${b.includes}"`;if(b.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${b.pattern}`;return`Aṣìṣe: ${w[b.format]??_.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${_.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${K(_.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${_.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${_.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function e9(){return{localeError:xI()}}var S8,J4=Symbol("ZodOutput"),D4=Symbol("ZodInput");class a9{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...v){let w=v[0];if(this._map.set($,w),w&&typeof w==="object"&&"id"in w)this._idmap.set(w.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let v=this._map.get($);if(v&&typeof v==="object"&&"id"in v)this._idmap.delete(v.id);return this._map.delete($),this}get($){let v=$._zod.parent;if(v){let w={...this.get(v)??{}};delete w.id;let g={...w,...this._map.get($)};return Object.keys(g).length?g:void 0}return this._map.get($)}has($){return this._map.has($)}}function Kw(){return new a9}(S8=globalThis).__zod_globalRegistry??(S8.__zod_globalRegistry=Kw());var j$=globalThis.__zod_globalRegistry;function s9($,v){return new $({type:"string",...M(v)})}function $J($,v){return new $({type:"string",coerce:!0,...M(v)})}function P1($,v){return new $({type:"string",format:"email",check:"string_format",abort:!1,...M(v)})}function X4($,v){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...M(v)})}function f1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...M(v)})}function A1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...M(v)})}function M1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...M(v)})}function z1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...M(v)})}function G4($,v){return new $({type:"string",format:"url",check:"string_format",abort:!1,...M(v)})}function S1($,v){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...M(v)})}function u1($,v){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...M(v)})}function T1($,v){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...M(v)})}function R1($,v){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...M(v)})}function C1($,v){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...M(v)})}function E1($,v){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...M(v)})}function Z1($,v){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...M(v)})}function x1($,v){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...M(v)})}function l1($,v){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...M(v)})}function vJ($,v){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...M(v)})}function h1($,v){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...M(v)})}function c1($,v){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...M(v)})}function y1($,v){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...M(v)})}function m1($,v){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...M(v)})}function r1($,v){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...M(v)})}function o1($,v){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...M(v)})}var Y4={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function _J($,v){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...M(v)})}function wJ($,v){return new $({type:"string",format:"date",check:"string_format",...M(v)})}function gJ($,v){return new $({type:"string",format:"time",check:"string_format",precision:null,...M(v)})}function bJ($,v){return new $({type:"string",format:"duration",check:"string_format",...M(v)})}function UJ($,v){return new $({type:"number",checks:[],...M(v)})}function JJ($,v){return new $({type:"number",coerce:!0,checks:[],...M(v)})}function DJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...M(v)})}function XJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...M(v)})}function GJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...M(v)})}function YJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...M(v)})}function QJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...M(v)})}function WJ($,v){return new $({type:"boolean",...M(v)})}function HJ($,v){return new $({type:"boolean",coerce:!0,...M(v)})}function nJ($,v){return new $({type:"bigint",...M(v)})}function qJ($,v){return new $({type:"bigint",coerce:!0,...M(v)})}function IJ($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...M(v)})}function BJ($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...M(v)})}function LJ($,v){return new $({type:"symbol",...M(v)})}function VJ($,v){return new $({type:"undefined",...M(v)})}function jJ($,v){return new $({type:"null",...M(v)})}function FJ($){return new $({type:"any"})}function KJ($){return new $({type:"unknown"})}function OJ($,v){return new $({type:"never",...M(v)})}function iJ($,v){return new $({type:"void",...M(v)})}function kJ($,v){return new $({type:"date",...M(v)})}function NJ($,v){return new $({type:"date",coerce:!0,...M(v)})}function PJ($,v){return new $({type:"nan",...M(v)})}function r$($,v){return new q1({check:"less_than",...M(v),value:$,inclusive:!1})}function z$($,v){return new q1({check:"less_than",...M(v),value:$,inclusive:!0})}function o$($,v){return new I1({check:"greater_than",...M(v),value:$,inclusive:!1})}function k$($,v){return new I1({check:"greater_than",...M(v),value:$,inclusive:!0})}function Ow($){return o$(0,$)}function iw($){return r$(0,$)}function kw($){return z$(0,$)}function Nw($){return k$(0,$)}function qv($,v){return new M2({check:"multiple_of",...M(v),value:$})}function Iv($,v){return new u2({check:"max_size",...M(v),maximum:$})}function t$($,v){return new T2({check:"min_size",...M(v),minimum:$})}function Pv($,v){return new R2({check:"size_equals",...M(v),size:$})}function fv($,v){return new C2({check:"max_length",...M(v),maximum:$})}function vv($,v){return new E2({check:"min_length",...M(v),minimum:$})}function Av($,v){return new Z2({check:"length_equals",...M(v),length:$})}function ev($,v){return new x2({check:"string_format",format:"regex",...M(v),pattern:$})}function av($){return new l2({check:"string_format",format:"lowercase",...M($)})}function sv($){return new h2({check:"string_format",format:"uppercase",...M($)})}function $_($,v){return new c2({check:"string_format",format:"includes",...M(v),includes:$})}function v_($,v){return new y2({check:"string_format",format:"starts_with",...M(v),prefix:$})}function __($,v){return new m2({check:"string_format",format:"ends_with",...M(v),suffix:$})}function Pw($,v,w){return new r2({check:"property",property:$,schema:v,...M(w)})}function w_($,v){return new o2({check:"mime_type",mime:$,...M(v)})}function h$($){return new t2({check:"overwrite",tx:$})}function g_($){return h$((v)=>v.normalize($))}function b_(){return h$(($)=>$.trim())}function U_(){return h$(($)=>$.toLowerCase())}function J_(){return h$(($)=>$.toUpperCase())}function D_(){return h$(($)=>tU($))}function fJ($,v,w){return new $({type:"array",element:v,...M(w)})}function hI($,v,w){return new $({type:"union",options:v,...M(w)})}function cI($,v,w){return new $({type:"union",options:v,inclusive:!1,...M(w)})}function yI($,v,w,g){return new $({type:"union",options:w,discriminator:v,...M(g)})}function mI($,v,w){return new $({type:"intersection",left:v,right:w})}function rI($,v,w,g){let _=w instanceof o;return new $({type:"tuple",items:v,rest:_?w:null,...M(_?g:w)})}function oI($,v,w,g){return new $({type:"record",keyType:v,valueType:w,...M(g)})}function tI($,v,w,g){return new $({type:"map",keyType:v,valueType:w,...M(g)})}function dI($,v,w){return new $({type:"set",valueType:v,...M(w)})}function pI($,v,w){let g=Array.isArray(v)?Object.fromEntries(v.map((_)=>[_,_])):v;return new $({type:"enum",entries:g,...M(w)})}function eI($,v,w){return new $({type:"enum",entries:v,...M(w)})}function aI($,v,w){return new $({type:"literal",values:Array.isArray(v)?v:[v],...M(w)})}function AJ($,v){return new $({type:"file",...M(v)})}function sI($,v){return new $({type:"transform",transform:v})}function $B($,v){return new $({type:"optional",innerType:v})}function vB($,v){return new $({type:"nullable",innerType:v})}function _B($,v,w){return new $({type:"default",innerType:v,get defaultValue(){return typeof w==="function"?w():pU(w)}})}function wB($,v,w){return new $({type:"nonoptional",innerType:v,...M(w)})}function gB($,v){return new $({type:"success",innerType:v})}function bB($,v,w){return new $({type:"catch",innerType:v,catchValue:typeof w==="function"?w:()=>w})}function UB($,v,w){return new $({type:"pipe",in:v,out:w})}function JB($,v){return new $({type:"readonly",innerType:v})}function DB($,v,w){return new $({type:"template_literal",parts:v,...M(w)})}function XB($,v){return new $({type:"lazy",getter:v})}function GB($,v){return new $({type:"promise",innerType:v})}function MJ($,v,w){let g=M(w);return g.abort??(g.abort=!0),new $({type:"custom",check:"custom",fn:v,...g})}function zJ($,v,w){return new $({type:"custom",check:"custom",fn:v,...M(w)})}function SJ($){let v=u8((w)=>{return w.addIssue=(g)=>{if(typeof g==="string")w.issues.push(qw(g,w.value,v._zod.def));else{let _=g;if(_.fatal)_.continue=!1;_.code??(_.code="custom"),_.input??(_.input=w.value),_.inst??(_.inst=v),_.continue??(_.continue=!v._zod.def.abort),w.issues.push(qw(_))}},$(w.value,w)});return v}function u8($,v){let w=new Q$({check:"custom",...M(v)});return w._zod.check=$,w}function uJ($){let v=new Q$({check:"describe"});return v._zod.onattach=[(w)=>{let g=j$.get(w)??{};j$.add(w,{...g,description:$})}],v._zod.check=()=>{},v}function TJ($){let v=new Q$({check:"meta"});return v._zod.onattach=[(w)=>{let g=j$.get(w)??{};j$.add(w,{...g,...$})}],v._zod.check=()=>{},v}function RJ($,v){let w=M(v),g=w.truthy??["true","1","yes","on","y","enabled"],_=w.falsy??["false","0","no","off","n","disabled"];if(w.case!=="sensitive")g=g.map((I)=>typeof I==="string"?I.toLowerCase():I),_=_.map((I)=>typeof I==="string"?I.toLowerCase():I);let b=new Set(g),J=new Set(_),D=$.Codec??_4,X=$.Boolean??$4,Y=new($.String??C_)({type:"string",error:w.error}),Q=new X({type:"boolean",error:w.error}),H=new D({type:"pipe",in:Y,out:Q,transform:(I,q)=>{let W=I;if(w.case!=="sensitive")W=W.toLowerCase();if(b.has(W))return!0;else if(J.has(W))return!1;else return q.issues.push({code:"invalid_value",expected:"stringbool",values:[...b,...J],input:q.value,inst:H,continue:!1}),{}},reverseTransform:(I,q)=>{if(I===!0)return g[0]||"true";else return _[0]||"false"},error:w.error});return H}function fw($,v,w,g={}){let _=M(g),b={...M(g),check:"string_format",type:"string",format:v,fn:typeof w==="function"?w:(D)=>w.test(D),..._};if(w instanceof RegExp)b.pattern=w;return new $(b)}function X_($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??j$,target:v,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function J$($,v,w={path:[],schemaPath:[]}){var g;let _=$._zod.def,b=v.seen.get($);if(b){if(b.count++,w.schemaPath.includes($))b.cycle=w.path;return b.schema}let J={schema:{},count:1,cycle:void 0,path:w.path};v.seen.set($,J);let D=$._zod.toJSONSchema?.();if(D)J.schema=D;else{let Y={...w,schemaPath:[...w.schemaPath,$],path:w.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(v,J.schema,Y);else{let H=J.schema,I=v.processors[_.type];if(!I)throw Error(`[toJSONSchema]: Non-representable type encountered: ${_.type}`);I($,v,H,Y)}let Q=$._zod.parent;if(Q){if(!J.ref)J.ref=Q;J$(Q,v,Y),v.seen.get(Q).isParent=!0}}let X=v.metadataRegistry.get($);if(X)Object.assign(J.schema,X);if(v.io==="input"&&S$($))delete J.schema.examples,delete J.schema.default;if(v.io==="input"&&J.schema._prefault)(g=J.schema).default??(g.default=J.schema._prefault);return delete J.schema._prefault,v.seen.get($).schema}function G_($,v){let w=$.seen.get(v);if(!w)throw Error("Unprocessed schema. This is a bug in Zod.");let g=new Map;for(let J of $.seen.entries()){let D=$.metadataRegistry.get(J[0])?.id;if(D){let X=g.get(D);if(X&&X!==J[0])throw Error(`Duplicate schema id "${D}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);g.set(D,J[0])}}let _=(J)=>{let D=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let Q=$.external.registry.get(J[0])?.id,H=$.external.uri??((q)=>q);if(Q)return{ref:H(Q)};let I=J[1].defId??J[1].schema.id??`schema${$.counter++}`;return J[1].defId=I,{defId:I,ref:`${H("__shared")}#/${D}/${I}`}}if(J[1]===w)return{ref:"#"};let G=`${"#"}/${D}/`,Y=J[1].schema.id??`__schema${$.counter++}`;return{defId:Y,ref:G+Y}},b=(J)=>{if(J[1].schema.$ref)return;let D=J[1],{ref:X,defId:G}=_(J);if(D.def={...D.schema},G)D.defId=G;let Y=D.schema;for(let Q in Y)delete Y[Q];Y.$ref=X};if($.cycles==="throw")for(let J of $.seen.entries()){let D=J[1];if(D.cycle)throw Error(`Cycle detected: #/${D.cycle?.join("/")}/<root>
176
+ `)}I.write("payload.value = newResult;"),I.write("return payload;");let M=I.compile();return(T,C)=>M(W,T,C)},b,J=S_,D=!x6.jitless,G=D&&pU.value,Y=v.catchall,Q;$._zod.parse=(W,I)=>{Q??(Q=g.value);let H=W.value;if(!J(H))return W.issues.push({expected:"object",code:"invalid_type",input:H,inst:$}),W;if(D&&G&&I?.async===!1&&I.jitless!==!0){if(!b)b=_(v.shape);if(W=b(W,I),!Y)return W;return fG([],H,W,I,Q,$)}return w(W,I)}});function VG($,v,w,g){for(let b of $)if(b.issues.length===0)return v.value=b.value,v;let _=$.filter((b)=>!pv(b));if(_.length===1)return v.value=_[0].value,_[0];return v.issues.push({code:"invalid_union",input:v.value,inst:w,errors:$.map((b)=>b.issues.map((J)=>R$(J,g,H$())))}),v}var _4=V("$ZodUnion",($,v)=>{o.init($,v),$$($._zod,"optin",()=>v.options.some((_)=>_._zod.optin==="optional")?"optional":void 0),$$($._zod,"optout",()=>v.options.some((_)=>_._zod.optout==="optional")?"optional":void 0),$$($._zod,"values",()=>{if(v.options.every((_)=>_._zod.values))return new Set(v.options.flatMap((_)=>Array.from(_._zod.values)));return}),$$($._zod,"pattern",()=>{if(v.options.every((_)=>_._zod.pattern)){let _=v.options.map((b)=>b._zod.pattern);return new RegExp(`^(${_.map((b)=>m6(b.source)).join("|")})$`)}return});let w=v.options.length===1,g=v.options[0]._zod.run;$._zod.parse=(_,b)=>{if(w)return g(_,b);let J=!1,D=[];for(let X of v.options){let G=X._zod.run({value:_.value,issues:[]},b);if(G instanceof Promise)D.push(G),J=!0;else{if(G.issues.length===0)return G;D.push(G)}}if(!J)return VG(D,_,$,b);return Promise.all(D).then((X)=>{return VG(X,_,$,b)})}});function jG($,v,w,g){let _=$.filter((b)=>b.issues.length===0);if(_.length===1)return v.value=_[0].value,v;if(_.length===0)v.issues.push({code:"invalid_union",input:v.value,inst:w,errors:$.map((b)=>b.issues.map((J)=>R$(J,g,H$())))});else v.issues.push({code:"invalid_union",input:v.value,inst:w,errors:[],inclusive:!1});return v}var R3=V("$ZodXor",($,v)=>{_4.init($,v),v.inclusive=!1;let w=v.options.length===1,g=v.options[0]._zod.run;$._zod.parse=(_,b)=>{if(w)return g(_,b);let J=!1,D=[];for(let X of v.options){let G=X._zod.run({value:_.value,issues:[]},b);if(G instanceof Promise)D.push(G),J=!0;else D.push(G)}if(!J)return jG(D,_,$,b);return Promise.all(D).then((X)=>{return jG(X,_,$,b)})}}),C3=V("$ZodDiscriminatedUnion",($,v)=>{v.inclusive=!1,_4.init($,v);let w=$._zod.parse;$$($._zod,"propValues",()=>{let _={};for(let b of v.options){let J=b._zod.propValues;if(!J||Object.keys(J).length===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(b)}"`);for(let[D,X]of Object.entries(J)){if(!_[D])_[D]=new Set;for(let G of X)_[D].add(G)}}return _});let g=Iw(()=>{let _=v.options,b=new Map;for(let J of _){let D=J._zod.propValues?.[v.discriminator];if(!D||D.size===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(J)}"`);for(let X of D){if(b.has(X))throw Error(`Duplicate discriminator value "${String(X)}"`);b.set(X,J)}}return b});$._zod.parse=(_,b)=>{let J=_.value;if(!S_(J))return _.issues.push({code:"invalid_type",expected:"object",input:J,inst:$}),_;let D=g.value.get(J?.[v.discriminator]);if(D)return D._zod.run(_,b);if(v.unionFallback)return w(_,b);return _.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:v.discriminator,input:J,path:[v.discriminator],inst:$}),_}}),E3=V("$ZodIntersection",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value,b=v.left._zod.run({value:_,issues:[]},g),J=v.right._zod.run({value:_,issues:[]},g);if(b instanceof Promise||J instanceof Promise)return Promise.all([b,J]).then(([X,G])=>{return FG(w,X,G)});return FG(w,b,J)}});function e2($,v){if($===v)return{valid:!0,data:$};if($ instanceof Date&&v instanceof Date&&+$===+v)return{valid:!0,data:$};if(tv($)&&tv(v)){let w=Object.keys(v),g=Object.keys($).filter((b)=>w.indexOf(b)!==-1),_={...$,...v};for(let b of g){let J=e2($[b],v[b]);if(!J.valid)return{valid:!1,mergeErrorPath:[b,...J.mergeErrorPath]};_[b]=J.data}return{valid:!0,data:_}}if(Array.isArray($)&&Array.isArray(v)){if($.length!==v.length)return{valid:!1,mergeErrorPath:[]};let w=[];for(let g=0;g<$.length;g++){let _=$[g],b=v[g],J=e2(_,b);if(!J.valid)return{valid:!1,mergeErrorPath:[g,...J.mergeErrorPath]};w.push(J.data)}return{valid:!0,data:w}}return{valid:!1,mergeErrorPath:[]}}function FG($,v,w){if(v.issues.length)$.issues.push(...v.issues);if(w.issues.length)$.issues.push(...w.issues);if(pv($))return $;let g=e2(v.value,w.value);if(!g.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(g.mergeErrorPath)}`);return $.value=g.data,$}var nb=V("$ZodTuple",($,v)=>{o.init($,v);let w=v.items;$._zod.parse=(g,_)=>{let b=g.value;if(!Array.isArray(b))return g.issues.push({input:b,inst:$,expected:"tuple",code:"invalid_type"}),g;g.value=[];let J=[],D=[...w].reverse().findIndex((Y)=>Y._zod.optin!=="optional"),X=D===-1?0:w.length-D;if(!v.rest){let Y=b.length>w.length,Q=b.length<X-1;if(Y||Q)return g.issues.push({...Y?{code:"too_big",maximum:w.length,inclusive:!0}:{code:"too_small",minimum:w.length},input:b,inst:$,origin:"array"}),g}let G=-1;for(let Y of w){if(G++,G>=b.length){if(G>=X)continue}let Q=Y._zod.run({value:b[G],issues:[]},_);if(Q instanceof Promise)J.push(Q.then((W)=>Fb(W,g,G)));else Fb(Q,g,G)}if(v.rest){let Y=b.slice(w.length);for(let Q of Y){G++;let W=v.rest._zod.run({value:Q,issues:[]},_);if(W instanceof Promise)J.push(W.then((I)=>Fb(I,g,G)));else Fb(W,g,G)}}if(J.length)return Promise.all(J).then(()=>g);return g}});function Fb($,v,w){if($.issues.length)v.issues.push(...x$(w,$.issues));v.value[w]=$.value}var Z3=V("$ZodRecord",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(!tv(_))return w.issues.push({expected:"record",code:"invalid_type",input:_,inst:$}),w;let b=[],J=v.keyType._zod.values;if(J){w.value={};let D=new Set;for(let G of J)if(typeof G==="string"||typeof G==="number"||typeof G==="symbol"){D.add(typeof G==="number"?G.toString():G);let Y=v.valueType._zod.run({value:_[G],issues:[]},g);if(Y instanceof Promise)b.push(Y.then((Q)=>{if(Q.issues.length)w.issues.push(...x$(G,Q.issues));w.value[G]=Q.value}));else{if(Y.issues.length)w.issues.push(...x$(G,Y.issues));w.value[G]=Y.value}}let X;for(let G in _)if(!D.has(G))X=X??[],X.push(G);if(X&&X.length>0)w.issues.push({code:"unrecognized_keys",input:_,inst:$,keys:X})}else{w.value={};for(let D of Reflect.ownKeys(_)){if(D==="__proto__")continue;let X=v.keyType._zod.run({value:D,issues:[]},g);if(X instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof D==="string"&&a6.test(D)&&X.issues.length&&X.issues.some((Q)=>Q.code==="invalid_type"&&Q.expected==="number")){let Q=v.keyType._zod.run({value:Number(D),issues:[]},g);if(Q instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(Q.issues.length===0)X=Q}if(X.issues.length){if(v.mode==="loose")w.value[D]=_[D];else w.issues.push({code:"invalid_key",origin:"record",issues:X.issues.map((Q)=>R$(Q,g,H$())),input:D,path:[D],inst:$});continue}let Y=v.valueType._zod.run({value:_[D],issues:[]},g);if(Y instanceof Promise)b.push(Y.then((Q)=>{if(Q.issues.length)w.issues.push(...x$(D,Q.issues));w.value[X.value]=Q.value}));else{if(Y.issues.length)w.issues.push(...x$(D,Y.issues));w.value[X.value]=Y.value}}}if(b.length)return Promise.all(b).then(()=>w);return w}}),h3=V("$ZodMap",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(!(_ instanceof Map))return w.issues.push({expected:"map",code:"invalid_type",input:_,inst:$}),w;let b=[];w.value=new Map;for(let[J,D]of _){let X=v.keyType._zod.run({value:J,issues:[]},g),G=v.valueType._zod.run({value:D,issues:[]},g);if(X instanceof Promise||G instanceof Promise)b.push(Promise.all([X,G]).then(([Y,Q])=>{KG(Y,Q,w,J,_,$,g)}));else KG(X,G,w,J,_,$,g)}if(b.length)return Promise.all(b).then(()=>w);return w}});function KG($,v,w,g,_,b,J){if($.issues.length)if(r6.has(typeof g))w.issues.push(...x$(g,$.issues));else w.issues.push({code:"invalid_key",origin:"map",input:_,inst:b,issues:$.issues.map((D)=>R$(D,J,H$()))});if(v.issues.length)if(r6.has(typeof g))w.issues.push(...x$(g,v.issues));else w.issues.push({origin:"map",code:"invalid_element",input:_,inst:b,key:g,issues:v.issues.map((D)=>R$(D,J,H$()))});w.value.set($.value,v.value)}var x3=V("$ZodSet",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(!(_ instanceof Set))return w.issues.push({input:_,inst:$,expected:"set",code:"invalid_type"}),w;let b=[];w.value=new Set;for(let J of _){let D=v.valueType._zod.run({value:J,issues:[]},g);if(D instanceof Promise)b.push(D.then((X)=>OG(X,w)));else OG(D,w)}if(b.length)return Promise.all(b).then(()=>w);return w}});function OG($,v){if($.issues.length)v.issues.push(...$.issues);v.value.add($.value)}var l3=V("$ZodEnum",($,v)=>{o.init($,v);let w=Hw(v.entries),g=new Set(w);$._zod.values=g,$._zod.pattern=new RegExp(`^(${w.filter((_)=>r6.has(typeof _)).map((_)=>typeof _==="string"?m$(_):_.toString()).join("|")})$`),$._zod.parse=(_,b)=>{let J=_.value;if(g.has(J))return _;return _.issues.push({code:"invalid_value",values:w,input:J,inst:$}),_}}),c3=V("$ZodLiteral",($,v)=>{if(o.init($,v),v.values.length===0)throw Error("Cannot create literal schema with no valid values");let w=new Set(v.values);$._zod.values=w,$._zod.pattern=new RegExp(`^(${v.values.map((g)=>typeof g==="string"?m$(g):g?m$(g.toString()):String(g)).join("|")})$`),$._zod.parse=(g,_)=>{let b=g.value;if(w.has(b))return g;return g.issues.push({code:"invalid_value",values:v.values,input:b,inst:$}),g}}),y3=V("$ZodFile",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{let _=w.value;if(_ instanceof File)return w;return w.issues.push({expected:"file",code:"invalid_type",input:_,inst:$}),w}}),m3=V("$ZodTransform",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{if(g.direction==="backward")throw new f_($.constructor.name);let _=v.transform(w.value,w);if(g.async)return(_ instanceof Promise?_:Promise.resolve(_)).then((J)=>{return w.value=J,w});if(_ instanceof Promise)throw new qv;return w.value=_,w}});function NG($,v){if($.issues.length&&v===void 0)return{issues:[],value:void 0};return $}var Pb=V("$ZodOptional",($,v)=>{o.init($,v),$._zod.optin="optional",$._zod.optout="optional",$$($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,void 0]):void 0}),$$($._zod,"pattern",()=>{let w=v.innerType._zod.pattern;return w?new RegExp(`^(${m6(w.source)})?$`):void 0}),$._zod.parse=(w,g)=>{if(v.innerType._zod.optin==="optional"){let _=v.innerType._zod.run(w,g);if(_ instanceof Promise)return _.then((b)=>NG(b,w.value));return NG(_,w.value)}if(w.value===void 0)return w;return v.innerType._zod.run(w,g)}}),r3=V("$ZodExactOptional",($,v)=>{Pb.init($,v),$$($._zod,"values",()=>v.innerType._zod.values),$$($._zod,"pattern",()=>v.innerType._zod.pattern),$._zod.parse=(w,g)=>{return v.innerType._zod.run(w,g)}}),o3=V("$ZodNullable",($,v)=>{o.init($,v),$$($._zod,"optin",()=>v.innerType._zod.optin),$$($._zod,"optout",()=>v.innerType._zod.optout),$$($._zod,"pattern",()=>{let w=v.innerType._zod.pattern;return w?new RegExp(`^(${m6(w.source)}|null)$`):void 0}),$$($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,null]):void 0}),$._zod.parse=(w,g)=>{if(w.value===null)return w;return v.innerType._zod.run(w,g)}}),d3=V("$ZodDefault",($,v)=>{o.init($,v),$._zod.optin="optional",$$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(w,g)=>{if(g.direction==="backward")return v.innerType._zod.run(w,g);if(w.value===void 0)return w.value=v.defaultValue,w;let _=v.innerType._zod.run(w,g);if(_ instanceof Promise)return _.then((b)=>kG(b,v));return kG(_,v)}});function kG($,v){if($.value===void 0)$.value=v.defaultValue;return $}var t3=V("$ZodPrefault",($,v)=>{o.init($,v),$._zod.optin="optional",$$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(w,g)=>{if(g.direction==="backward")return v.innerType._zod.run(w,g);if(w.value===void 0)w.value=v.defaultValue;return v.innerType._zod.run(w,g)}}),p3=V("$ZodNonOptional",($,v)=>{o.init($,v),$$($._zod,"values",()=>{let w=v.innerType._zod.values;return w?new Set([...w].filter((g)=>g!==void 0)):void 0}),$._zod.parse=(w,g)=>{let _=v.innerType._zod.run(w,g);if(_ instanceof Promise)return _.then((b)=>zG(b,$));return zG(_,$)}});function zG($,v){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:v});return $}var e3=V("$ZodSuccess",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{if(g.direction==="backward")throw new f_("ZodSuccess");let _=v.innerType._zod.run(w,g);if(_ instanceof Promise)return _.then((b)=>{return w.value=b.issues.length===0,w});return w.value=_.issues.length===0,w}}),a3=V("$ZodCatch",($,v)=>{o.init($,v),$$($._zod,"optin",()=>v.innerType._zod.optin),$$($._zod,"optout",()=>v.innerType._zod.optout),$$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(w,g)=>{if(g.direction==="backward")return v.innerType._zod.run(w,g);let _=v.innerType._zod.run(w,g);if(_ instanceof Promise)return _.then((b)=>{if(w.value=b.value,b.issues.length)w.value=v.catchValue({...w,error:{issues:b.issues.map((J)=>R$(J,g,H$()))},input:w.value}),w.issues=[];return w});if(w.value=_.value,_.issues.length)w.value=v.catchValue({...w,error:{issues:_.issues.map((b)=>R$(b,g,H$()))},input:w.value}),w.issues=[];return w}}),s3=V("$ZodNaN",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{if(typeof w.value!=="number"||!Number.isNaN(w.value))return w.issues.push({input:w.value,inst:$,expected:"nan",code:"invalid_type"}),w;return w}}),$9=V("$ZodPipe",($,v)=>{o.init($,v),$$($._zod,"values",()=>v.in._zod.values),$$($._zod,"optin",()=>v.in._zod.optin),$$($._zod,"optout",()=>v.out._zod.optout),$$($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(w,g)=>{if(g.direction==="backward"){let b=v.out._zod.run(w,g);if(b instanceof Promise)return b.then((J)=>Kb(J,v.in,g));return Kb(b,v.in,g)}let _=v.in._zod.run(w,g);if(_ instanceof Promise)return _.then((b)=>Kb(b,v.out,g));return Kb(_,v.out,g)}});function Kb($,v,w){if($.issues.length)return $.aborted=!0,$;return v._zod.run({value:$.value,issues:$.issues},w)}var w4=V("$ZodCodec",($,v)=>{o.init($,v),$$($._zod,"values",()=>v.in._zod.values),$$($._zod,"optin",()=>v.in._zod.optin),$$($._zod,"optout",()=>v.out._zod.optout),$$($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(w,g)=>{if((g.direction||"forward")==="forward"){let b=v.in._zod.run(w,g);if(b instanceof Promise)return b.then((J)=>Ob(J,v,g));return Ob(b,v,g)}else{let b=v.out._zod.run(w,g);if(b instanceof Promise)return b.then((J)=>Ob(J,v,g));return Ob(b,v,g)}}});function Ob($,v,w){if($.issues.length)return $.aborted=!0,$;if((w.direction||"forward")==="forward"){let _=v.transform($.value,$);if(_ instanceof Promise)return _.then((b)=>Nb($,b,v.out,w));return Nb($,_,v.out,w)}else{let _=v.reverseTransform($.value,$);if(_ instanceof Promise)return _.then((b)=>Nb($,b,v.in,w));return Nb($,_,v.in,w)}}function Nb($,v,w,g){if($.issues.length)return $.aborted=!0,$;return w._zod.run({value:v,issues:$.issues},g)}var v9=V("$ZodReadonly",($,v)=>{o.init($,v),$$($._zod,"propValues",()=>v.innerType._zod.propValues),$$($._zod,"values",()=>v.innerType._zod.values),$$($._zod,"optin",()=>v.innerType?._zod?.optin),$$($._zod,"optout",()=>v.innerType?._zod?.optout),$._zod.parse=(w,g)=>{if(g.direction==="backward")return v.innerType._zod.run(w,g);let _=v.innerType._zod.run(w,g);if(_ instanceof Promise)return _.then(iG);return iG(_)}});function iG($){return $.value=Object.freeze($.value),$}var _9=V("$ZodTemplateLiteral",($,v)=>{o.init($,v);let w=[];for(let g of v.parts)if(typeof g==="object"&&g!==null){if(!g._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...g._zod.traits].shift()}`);let _=g._zod.pattern instanceof RegExp?g._zod.pattern.source:g._zod.pattern;if(!_)throw Error(`Invalid template literal part: ${g._zod.traits}`);let b=_.startsWith("^")?1:0,J=_.endsWith("$")?_.length-1:_.length;w.push(_.slice(b,J))}else if(g===null||aU.has(typeof g))w.push(m$(`${g}`));else throw Error(`Invalid template literal part: ${g}`);$._zod.pattern=new RegExp(`^${w.join("")}$`),$._zod.parse=(g,_)=>{if(typeof g.value!=="string")return g.issues.push({input:g.value,inst:$,expected:"string",code:"invalid_type"}),g;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(g.value))return g.issues.push({input:g.value,inst:$,code:"invalid_format",format:v.format??"template_literal",pattern:$._zod.pattern.source}),g;return g}}),w9=V("$ZodFunction",($,v)=>{return o.init($,v),$._def=v,$._zod.def=v,$.implement=(w)=>{if(typeof w!=="function")throw Error("implement() must be called with a function");return function(...g){let _=$._def.input?Jb($._def.input,g):g,b=Reflect.apply(w,this,_);if($._def.output)return Jb($._def.output,b);return b}},$.implementAsync=(w)=>{if(typeof w!=="function")throw Error("implementAsync() must be called with a function");return async function(...g){let _=$._def.input?await Db($._def.input,g):g,b=await Reflect.apply(w,this,_);if($._def.output)return await Db($._def.output,b);return b}},$._zod.parse=(w,g)=>{if(typeof w.value!=="function")return w.issues.push({code:"invalid_type",expected:"function",input:w.value,inst:$}),w;if($._def.output&&$._def.output._zod.def.type==="promise")w.value=$.implementAsync(w.value);else w.value=$.implement(w.value);return w},$.input=(...w)=>{let g=$.constructor;if(Array.isArray(w[0]))return new g({type:"function",input:new nb({type:"tuple",items:w[0],rest:w[1]}),output:$._def.output});return new g({type:"function",input:w[0],output:$._def.output})},$.output=(w)=>{return new $.constructor({type:"function",input:$._def.input,output:w})},$}),g9=V("$ZodPromise",($,v)=>{o.init($,v),$._zod.parse=(w,g)=>{return Promise.resolve(w.value).then((_)=>v.innerType._zod.run({value:_,issues:[]},g))}}),b9=V("$ZodLazy",($,v)=>{o.init($,v),$$($._zod,"innerType",()=>v.getter()),$$($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),$$($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),$$($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),$$($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(w,g)=>{return $._zod.innerType._zod.run(w,g)}}),U9=V("$ZodCustom",($,v)=>{G$.init($,v),o.init($,v),$._zod.parse=(w,g)=>{return w},$._zod.check=(w)=>{let g=w.value,_=v.fn(g);if(_ instanceof Promise)return _.then((b)=>nG(b,w,g,$));nG(_,w,g,$);return}});function nG($,v,w,g){if(!$){let _={code:"custom",input:w,inst:g,path:[...g._zod.def.path??[]],continue:!g._zod.def.abort};if(g._zod.def.params)_.params=g._zod.def.params;v.issues.push(Bw(_))}}var E_={};$v(E_,{zhTW:()=>e9,zhCN:()=>p9,yo:()=>a9,vi:()=>t9,uz:()=>d9,ur:()=>o9,uk:()=>J4,ua:()=>r9,tr:()=>m9,th:()=>y9,ta:()=>c9,sv:()=>l9,sl:()=>x9,ru:()=>h9,pt:()=>Z9,ps:()=>C9,pl:()=>E9,ota:()=>R9,no:()=>u9,nl:()=>T9,ms:()=>S9,mk:()=>f9,lt:()=>M9,ko:()=>A9,km:()=>b4,kh:()=>P9,ka:()=>n9,ja:()=>i9,it:()=>z9,is:()=>k9,id:()=>N9,hy:()=>O9,hu:()=>K9,he:()=>F9,frCA:()=>j9,fr:()=>V9,fi:()=>L9,fa:()=>B9,es:()=>I9,eo:()=>q9,en:()=>g4,de:()=>H9,da:()=>W9,cs:()=>Q9,ca:()=>Y9,bg:()=>G9,be:()=>X9,az:()=>D9,ar:()=>J9});var hI=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function v(_){return $[_]??null}let w={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${_.expected}، ولكن تم إدخال ${D}`;return`مدخلات غير مقبولة: يفترض إدخال ${b}، ولكن تم إدخال ${D}`}case"invalid_value":if(_.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${z(_.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return` أكبر من اللازم: يفترض أن تكون ${_.origin??"القيمة"} ${b} ${_.maximum.toString()} ${J.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${_.origin??"القيمة"} ${b} ${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`أصغر من اللازم: يفترض لـ ${_.origin} أن يكون ${b} ${_.minimum.toString()} ${J.unit}`;return`أصغر من اللازم: يفترض لـ ${_.origin} أن يكون ${b} ${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${_.prefix}"`;if(b.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${b.suffix}"`;if(b.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${b.includes}"`;if(b.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${b.pattern}`;return`${w[b.format]??_.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${_.divisor}`;case"unrecognized_keys":return`معرف${_.keys.length>1?"ات":""} غريب${_.keys.length>1?"ة":""}: ${O(_.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${_.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${_.origin}`;default:return"مدخل غير مقبول"}}};function J9(){return{localeError:hI()}}var xI=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function v(_){return $[_]??null}let w={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Yanlış dəyər: gözlənilən instanceof ${_.expected}, daxil olan ${D}`;return`Yanlış dəyər: gözlənilən ${b}, daxil olan ${D}`}case"invalid_value":if(_.values.length===1)return`Yanlış dəyər: gözlənilən ${z(_.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Çox böyük: gözlənilən ${_.origin??"dəyər"} ${b}${_.maximum.toString()} ${J.unit??"element"}`;return`Çox böyük: gözlənilən ${_.origin??"dəyər"} ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Çox kiçik: gözlənilən ${_.origin} ${b}${_.minimum.toString()} ${J.unit}`;return`Çox kiçik: gözlənilən ${_.origin} ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Yanlış mətn: "${b.prefix}" ilə başlamalıdır`;if(b.format==="ends_with")return`Yanlış mətn: "${b.suffix}" ilə bitməlidir`;if(b.format==="includes")return`Yanlış mətn: "${b.includes}" daxil olmalıdır`;if(b.format==="regex")return`Yanlış mətn: ${b.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${w[b.format]??_.format}`}case"not_multiple_of":return`Yanlış ədəd: ${_.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${_.keys.length>1?"lar":""}: ${O(_.keys,", ")}`;case"invalid_key":return`${_.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${_.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function D9(){return{localeError:xI()}}function TG($,v,w,g){let _=Math.abs($),b=_%10,J=_%100;if(J>=11&&J<=19)return g;if(b===1)return v;if(b>=2&&b<=4)return w;return g}var lI=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function v(_){return $[_]??null}let w={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},g={nan:"NaN",number:"лік",array:"масіў"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Няправільны ўвод: чакаўся instanceof ${_.expected}, атрымана ${D}`;return`Няправільны ўвод: чакаўся ${b}, атрымана ${D}`}case"invalid_value":if(_.values.length===1)return`Няправільны ўвод: чакалася ${z(_.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J){let D=Number(_.maximum),X=TG(D,J.unit.one,J.unit.few,J.unit.many);return`Занадта вялікі: чакалася, што ${_.origin??"значэнне"} павінна ${J.verb} ${b}${_.maximum.toString()} ${X}`}return`Занадта вялікі: чакалася, што ${_.origin??"значэнне"} павінна быць ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J){let D=Number(_.minimum),X=TG(D,J.unit.one,J.unit.few,J.unit.many);return`Занадта малы: чакалася, што ${_.origin} павінна ${J.verb} ${b}${_.minimum.toString()} ${X}`}return`Занадта малы: чакалася, што ${_.origin} павінна быць ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${b.prefix}"`;if(b.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${b.suffix}"`;if(b.format==="includes")return`Няправільны радок: павінен змяшчаць "${b.includes}"`;if(b.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${b.pattern}`;return`Няправільны ${w[b.format]??_.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${_.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${_.keys.length>1?"ключы":"ключ"}: ${O(_.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${_.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${_.origin}`;default:return"Няправільны ўвод"}}};function X9(){return{localeError:lI()}}var cI=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function v(_){return $[_]??null}let w={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},g={nan:"NaN",number:"число",array:"масив"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Невалиден вход: очакван instanceof ${_.expected}, получен ${D}`;return`Невалиден вход: очакван ${b}, получен ${D}`}case"invalid_value":if(_.values.length===1)return`Невалиден вход: очакван ${z(_.values[0])}`;return`Невалидна опция: очаквано едно от ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Твърде голямо: очаква се ${_.origin??"стойност"} да съдържа ${b}${_.maximum.toString()} ${J.unit??"елемента"}`;return`Твърде голямо: очаква се ${_.origin??"стойност"} да бъде ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Твърде малко: очаква се ${_.origin} да съдържа ${b}${_.minimum.toString()} ${J.unit}`;return`Твърде малко: очаква се ${_.origin} да бъде ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Невалиден низ: трябва да започва с "${b.prefix}"`;if(b.format==="ends_with")return`Невалиден низ: трябва да завършва с "${b.suffix}"`;if(b.format==="includes")return`Невалиден низ: трябва да включва "${b.includes}"`;if(b.format==="regex")return`Невалиден низ: трябва да съвпада с ${b.pattern}`;let J="Невалиден";if(b.format==="emoji")J="Невалидно";if(b.format==="datetime")J="Невалидно";if(b.format==="date")J="Невалидна";if(b.format==="time")J="Невалидно";if(b.format==="duration")J="Невалидна";return`${J} ${w[b.format]??_.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${_.divisor}`;case"unrecognized_keys":return`Неразпознат${_.keys.length>1?"и":""} ключ${_.keys.length>1?"ове":""}: ${O(_.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${_.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${_.origin}`;default:return"Невалиден вход"}}};function G9(){return{localeError:cI()}}var yI=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function v(_){return $[_]??null}let w={regex:"entrada",email:"adreça electrònica",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ça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Tipus invàlid: s'esperava instanceof ${_.expected}, s'ha rebut ${D}`;return`Tipus invàlid: s'esperava ${b}, s'ha rebut ${D}`}case"invalid_value":if(_.values.length===1)return`Valor invàlid: s'esperava ${z(_.values[0])}`;return`Opció invàlida: s'esperava una de ${O(_.values," o ")}`;case"too_big":{let b=_.inclusive?"com a màxim":"menys de",J=v(_.origin);if(J)return`Massa gran: s'esperava que ${_.origin??"el valor"} contingués ${b} ${_.maximum.toString()} ${J.unit??"elements"}`;return`Massa gran: s'esperava que ${_.origin??"el valor"} fos ${b} ${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?"com a mínim":"més de",J=v(_.origin);if(J)return`Massa petit: s'esperava que ${_.origin} contingués ${b} ${_.minimum.toString()} ${J.unit}`;return`Massa petit: s'esperava que ${_.origin} fos ${b} ${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Format invàlid: ha de començar amb "${b.prefix}"`;if(b.format==="ends_with")return`Format invàlid: ha d'acabar amb "${b.suffix}"`;if(b.format==="includes")return`Format invàlid: ha d'incloure "${b.includes}"`;if(b.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${b.pattern}`;return`Format invàlid per a ${w[b.format]??_.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${_.divisor}`;case"unrecognized_keys":return`Clau${_.keys.length>1?"s":""} no reconeguda${_.keys.length>1?"s":""}: ${O(_.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${_.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${_.origin}`;default:return"Entrada invàlida"}}};function Y9(){return{localeError:yI()}}var mI=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function v(_){return $[_]??null}let w={regex:"regulární výraz",email:"e-mailová 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 čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},g={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Neplatný vstup: očekáváno instanceof ${_.expected}, obdrženo ${D}`;return`Neplatný vstup: očekáváno ${b}, obdrženo ${D}`}case"invalid_value":if(_.values.length===1)return`Neplatný vstup: očekáváno ${z(_.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Hodnota je příliš velká: ${_.origin??"hodnota"} musí mít ${b}${_.maximum.toString()} ${J.unit??"prvků"}`;return`Hodnota je příliš velká: ${_.origin??"hodnota"} musí být ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Hodnota je příliš malá: ${_.origin??"hodnota"} musí mít ${b}${_.minimum.toString()} ${J.unit??"prvků"}`;return`Hodnota je příliš malá: ${_.origin??"hodnota"} musí být ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Neplatný řetězec: musí začínat na "${b.prefix}"`;if(b.format==="ends_with")return`Neplatný řetězec: musí končit na "${b.suffix}"`;if(b.format==="includes")return`Neplatný řetězec: musí obsahovat "${b.includes}"`;if(b.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${b.pattern}`;return`Neplatný formát ${w[b.format]??_.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${_.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${O(_.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${_.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${_.origin}`;default:return"Neplatný vstup"}}};function Q9(){return{localeError:mI()}}var rI=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function v(_){return $[_]??null}let w={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æt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},g={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Ugyldigt input: forventede instanceof ${_.expected}, fik ${D}`;return`Ugyldigt input: forventede ${b}, fik ${D}`}case"invalid_value":if(_.values.length===1)return`Ugyldig værdi: forventede ${z(_.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin),D=g[_.origin]??_.origin;if(J)return`For stor: forventede ${D??"value"} ${J.verb} ${b} ${_.maximum.toString()} ${J.unit??"elementer"}`;return`For stor: forventede ${D??"value"} havde ${b} ${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin),D=g[_.origin]??_.origin;if(J)return`For lille: forventede ${D} ${J.verb} ${b} ${_.minimum.toString()} ${J.unit}`;return`For lille: forventede ${D} havde ${b} ${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ugyldig streng: skal starte med "${b.prefix}"`;if(b.format==="ends_with")return`Ugyldig streng: skal ende med "${b.suffix}"`;if(b.format==="includes")return`Ugyldig streng: skal indeholde "${b.includes}"`;if(b.format==="regex")return`Ugyldig streng: skal matche mønsteret ${b.pattern}`;return`Ugyldig ${w[b.format]??_.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${O(_.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${_.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${_.origin}`;default:return"Ugyldigt input"}}};function W9(){return{localeError:rI()}}var oI=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function v(_){return $[_]??null}let w={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},g={nan:"NaN",number:"Zahl",array:"Array"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Ungültige Eingabe: erwartet instanceof ${_.expected}, erhalten ${D}`;return`Ungültige Eingabe: erwartet ${b}, erhalten ${D}`}case"invalid_value":if(_.values.length===1)return`Ungültige Eingabe: erwartet ${z(_.values[0])}`;return`Ungültige Option: erwartet eine von ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Zu groß: erwartet, dass ${_.origin??"Wert"} ${b}${_.maximum.toString()} ${J.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${_.origin??"Wert"} ${b}${_.maximum.toString()} ist`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Zu klein: erwartet, dass ${_.origin} ${b}${_.minimum.toString()} ${J.unit} hat`;return`Zu klein: erwartet, dass ${_.origin} ${b}${_.minimum.toString()} ist`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ungültiger String: muss mit "${b.prefix}" beginnen`;if(b.format==="ends_with")return`Ungültiger String: muss mit "${b.suffix}" enden`;if(b.format==="includes")return`Ungültiger String: muss "${b.includes}" enthalten`;if(b.format==="regex")return`Ungültiger String: muss dem Muster ${b.pattern} entsprechen`;return`Ungültig: ${w[b.format]??_.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${_.divisor} sein`;case"unrecognized_keys":return`${_.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${O(_.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${_.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${_.origin}`;default:return"Ungültige Eingabe"}}};function H9(){return{localeError:oI()}}var dI=()=>{let $={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 v(_){return $[_]??null}let w={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;return`Invalid input: expected ${b}, received ${D}`}case"invalid_value":if(_.values.length===1)return`Invalid input: expected ${z(_.values[0])}`;return`Invalid option: expected one of ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Too big: expected ${_.origin??"value"} to have ${b}${_.maximum.toString()} ${J.unit??"elements"}`;return`Too big: expected ${_.origin??"value"} to be ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Too small: expected ${_.origin} to have ${b}${_.minimum.toString()} ${J.unit}`;return`Too small: expected ${_.origin} to be ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Invalid string: must start with "${b.prefix}"`;if(b.format==="ends_with")return`Invalid string: must end with "${b.suffix}"`;if(b.format==="includes")return`Invalid string: must include "${b.includes}"`;if(b.format==="regex")return`Invalid string: must match pattern ${b.pattern}`;return`Invalid ${w[b.format]??_.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${_.divisor}`;case"unrecognized_keys":return`Unrecognized key${_.keys.length>1?"s":""}: ${O(_.keys,", ")}`;case"invalid_key":return`Invalid key in ${_.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${_.origin}`;default:return"Invalid input"}}};function g4(){return{localeError:dI()}}var tI=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function v(_){return $[_]??null}let w={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",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ŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},g={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Nevalida enigo: atendiĝis instanceof ${_.expected}, riceviĝis ${D}`;return`Nevalida enigo: atendiĝis ${b}, riceviĝis ${D}`}case"invalid_value":if(_.values.length===1)return`Nevalida enigo: atendiĝis ${z(_.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Tro granda: atendiĝis ke ${_.origin??"valoro"} havu ${b}${_.maximum.toString()} ${J.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${_.origin??"valoro"} havu ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Tro malgranda: atendiĝis ke ${_.origin} havu ${b}${_.minimum.toString()} ${J.unit}`;return`Tro malgranda: atendiĝis ke ${_.origin} estu ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${b.prefix}"`;if(b.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${b.suffix}"`;if(b.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${b.includes}"`;if(b.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${b.pattern}`;return`Nevalida ${w[b.format]??_.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${_.divisor}`;case"unrecognized_keys":return`Nekonata${_.keys.length>1?"j":""} ŝlosilo${_.keys.length>1?"j":""}: ${O(_.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${_.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${_.origin}`;default:return"Nevalida enigo"}}};function q9(){return{localeError:tI()}}var pI=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function v(_){return $[_]??null}let w={regex:"entrada",email:"dirección de correo electrónico",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ón ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},g={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Entrada inválida: se esperaba instanceof ${_.expected}, recibido ${D}`;return`Entrada inválida: se esperaba ${b}, recibido ${D}`}case"invalid_value":if(_.values.length===1)return`Entrada inválida: se esperaba ${z(_.values[0])}`;return`Opción inválida: se esperaba una de ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin),D=g[_.origin]??_.origin;if(J)return`Demasiado grande: se esperaba que ${D??"valor"} tuviera ${b}${_.maximum.toString()} ${J.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${D??"valor"} fuera ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin),D=g[_.origin]??_.origin;if(J)return`Demasiado pequeño: se esperaba que ${D} tuviera ${b}${_.minimum.toString()} ${J.unit}`;return`Demasiado pequeño: se esperaba que ${D} fuera ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Cadena inválida: debe comenzar con "${b.prefix}"`;if(b.format==="ends_with")return`Cadena inválida: debe terminar en "${b.suffix}"`;if(b.format==="includes")return`Cadena inválida: debe incluir "${b.includes}"`;if(b.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${b.pattern}`;return`Inválido ${w[b.format]??_.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${_.divisor}`;case"unrecognized_keys":return`Llave${_.keys.length>1?"s":""} desconocida${_.keys.length>1?"s":""}: ${O(_.keys,", ")}`;case"invalid_key":return`Llave inválida en ${g[_.origin]??_.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${g[_.origin]??_.origin}`;default:return"Entrada inválida"}}};function I9(){return{localeError:pI()}}var eI=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function v(_){return $[_]??null}let w={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},g={nan:"NaN",number:"عدد",array:"آرایه"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`ورودی نامعتبر: می‌بایست instanceof ${_.expected} می‌بود، ${D} دریافت شد`;return`ورودی نامعتبر: می‌بایست ${b} می‌بود، ${D} دریافت شد`}case"invalid_value":if(_.values.length===1)return`ورودی نامعتبر: می‌بایست ${z(_.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${O(_.values,"|")} می‌بود`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`خیلی بزرگ: ${_.origin??"مقدار"} باید ${b}${_.maximum.toString()} ${J.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${_.origin??"مقدار"} باید ${b}${_.maximum.toString()} باشد`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`خیلی کوچک: ${_.origin} باید ${b}${_.minimum.toString()} ${J.unit} باشد`;return`خیلی کوچک: ${_.origin} باید ${b}${_.minimum.toString()} باشد`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`رشته نامعتبر: باید با "${b.prefix}" شروع شود`;if(b.format==="ends_with")return`رشته نامعتبر: باید با "${b.suffix}" تمام شود`;if(b.format==="includes")return`رشته نامعتبر: باید شامل "${b.includes}" باشد`;if(b.format==="regex")return`رشته نامعتبر: باید با الگوی ${b.pattern} مطابقت داشته باشد`;return`${w[b.format]??_.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${_.divisor} باشد`;case"unrecognized_keys":return`کلید${_.keys.length>1?"های":""} ناشناس: ${O(_.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${_.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${_.origin}`;default:return"ورودی نامعتبر"}}};function B9(){return{localeError:eI()}}var aI=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function v(_){return $[_]??null}let w={regex:"säännöllinen lauseke",email:"sähköpostiosoite",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äivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Virheellinen tyyppi: odotettiin instanceof ${_.expected}, oli ${D}`;return`Virheellinen tyyppi: odotettiin ${b}, oli ${D}`}case"invalid_value":if(_.values.length===1)return`Virheellinen syöte: täytyy olla ${z(_.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Liian suuri: ${J.subject} täytyy olla ${b}${_.maximum.toString()} ${J.unit}`.trim();return`Liian suuri: arvon täytyy olla ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Liian pieni: ${J.subject} täytyy olla ${b}${_.minimum.toString()} ${J.unit}`.trim();return`Liian pieni: arvon täytyy olla ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${b.prefix}"`;if(b.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${b.suffix}"`;if(b.format==="includes")return`Virheellinen syöte: täytyy sisältää "${b.includes}"`;if(b.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${b.pattern}`;return`Virheellinen ${w[b.format]??_.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${_.divisor} monikerta`;case"unrecognized_keys":return`${_.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${O(_.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öte"}}};function L9(){return{localeError:aI()}}var sI=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function v(_){return $[_]??null}let w={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},g={nan:"NaN",number:"nombre",array:"tableau"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Entrée invalide : instanceof ${_.expected} attendu, ${D} reçu`;return`Entrée invalide : ${b} attendu, ${D} reçu`}case"invalid_value":if(_.values.length===1)return`Entrée invalide : ${z(_.values[0])} attendu`;return`Option invalide : une valeur parmi ${O(_.values,"|")} attendue`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Trop grand : ${_.origin??"valeur"} doit ${J.verb} ${b}${_.maximum.toString()} ${J.unit??"élément(s)"}`;return`Trop grand : ${_.origin??"valeur"} doit être ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Trop petit : ${_.origin} doit ${J.verb} ${b}${_.minimum.toString()} ${J.unit}`;return`Trop petit : ${_.origin} doit être ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Chaîne invalide : doit commencer par "${b.prefix}"`;if(b.format==="ends_with")return`Chaîne invalide : doit se terminer par "${b.suffix}"`;if(b.format==="includes")return`Chaîne invalide : doit inclure "${b.includes}"`;if(b.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${b.pattern}`;return`${w[b.format]??_.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${_.divisor}`;case"unrecognized_keys":return`Clé${_.keys.length>1?"s":""} non reconnue${_.keys.length>1?"s":""} : ${O(_.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${_.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${_.origin}`;default:return"Entrée invalide"}}};function V9(){return{localeError:sI()}}var $B=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function v(_){return $[_]??null}let w={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Entrée invalide : attendu instanceof ${_.expected}, reçu ${D}`;return`Entrée invalide : attendu ${b}, reçu ${D}`}case"invalid_value":if(_.values.length===1)return`Entrée invalide : attendu ${z(_.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"≤":"<",J=v(_.origin);if(J)return`Trop grand : attendu que ${_.origin??"la valeur"} ait ${b}${_.maximum.toString()} ${J.unit}`;return`Trop grand : attendu que ${_.origin??"la valeur"} soit ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?"≥":">",J=v(_.origin);if(J)return`Trop petit : attendu que ${_.origin} ait ${b}${_.minimum.toString()} ${J.unit}`;return`Trop petit : attendu que ${_.origin} soit ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Chaîne invalide : doit commencer par "${b.prefix}"`;if(b.format==="ends_with")return`Chaîne invalide : doit se terminer par "${b.suffix}"`;if(b.format==="includes")return`Chaîne invalide : doit inclure "${b.includes}"`;if(b.format==="regex")return`Chaîne invalide : doit correspondre au motif ${b.pattern}`;return`${w[b.format]??_.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${_.divisor}`;case"unrecognized_keys":return`Clé${_.keys.length>1?"s":""} non reconnue${_.keys.length>1?"s":""} : ${O(_.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${_.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${_.origin}`;default:return"Entrée invalide"}}};function j9(){return{localeError:$B()}}var vB=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},v={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},w=(G)=>G?$[G]:void 0,g=(G)=>{let Y=w(G);if(Y)return Y.label;return G??$.unknown.label},_=(G)=>`ה${g(G)}`,b=(G)=>{return(w(G)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},J=(G)=>{if(!G)return null;return v[G]??null},D={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},X={nan:"NaN"};return(G)=>{switch(G.code){case"invalid_type":{let Y=G.expected,Q=X[Y??""]??g(Y),W=n(G.input),I=X[W]??$[W]?.label??W;if(/^[A-Z]/.test(G.expected))return`קלט לא תקין: צריך להיות instanceof ${G.expected}, התקבל ${I}`;return`קלט לא תקין: צריך להיות ${Q}, התקבל ${I}`}case"invalid_value":{if(G.values.length===1)return`ערך לא תקין: הערך חייב להיות ${z(G.values[0])}`;let Y=G.values.map((I)=>z(I));if(G.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${Y[0]} או ${Y[1]}`;let Q=Y[Y.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${Y.slice(0,-1).join(", ")} או ${Q}`}case"too_big":{let Y=J(G.origin),Q=_(G.origin??"value");if(G.origin==="string")return`${Y?.longLabel??"ארוך"} מדי: ${Q} צריכה להכיל ${G.maximum.toString()} ${Y?.unit??""} ${G.inclusive?"או פחות":"לכל היותר"}`.trim();if(G.origin==="number"){let H=G.inclusive?`קטן או שווה ל-${G.maximum}`:`קטן מ-${G.maximum}`;return`גדול מדי: ${Q} צריך להיות ${H}`}if(G.origin==="array"||G.origin==="set"){let H=G.origin==="set"?"צריכה":"צריך",q=G.inclusive?`${G.maximum} ${Y?.unit??""} או פחות`:`פחות מ-${G.maximum} ${Y?.unit??""}`;return`גדול מדי: ${Q} ${H} להכיל ${q}`.trim()}let W=G.inclusive?"<=":"<",I=b(G.origin??"value");if(Y?.unit)return`${Y.longLabel} מדי: ${Q} ${I} ${W}${G.maximum.toString()} ${Y.unit}`;return`${Y?.longLabel??"גדול"} מדי: ${Q} ${I} ${W}${G.maximum.toString()}`}case"too_small":{let Y=J(G.origin),Q=_(G.origin??"value");if(G.origin==="string")return`${Y?.shortLabel??"קצר"} מדי: ${Q} צריכה להכיל ${G.minimum.toString()} ${Y?.unit??""} ${G.inclusive?"או יותר":"לפחות"}`.trim();if(G.origin==="number"){let H=G.inclusive?`גדול או שווה ל-${G.minimum}`:`גדול מ-${G.minimum}`;return`קטן מדי: ${Q} צריך להיות ${H}`}if(G.origin==="array"||G.origin==="set"){let H=G.origin==="set"?"צריכה":"צריך";if(G.minimum===1&&G.inclusive){let j=G.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${Q} ${H} להכיל ${j}`}let q=G.inclusive?`${G.minimum} ${Y?.unit??""} או יותר`:`יותר מ-${G.minimum} ${Y?.unit??""}`;return`קטן מדי: ${Q} ${H} להכיל ${q}`.trim()}let W=G.inclusive?">=":">",I=b(G.origin??"value");if(Y?.unit)return`${Y.shortLabel} מדי: ${Q} ${I} ${W}${G.minimum.toString()} ${Y.unit}`;return`${Y?.shortLabel??"קטן"} מדי: ${Q} ${I} ${W}${G.minimum.toString()}`}case"invalid_format":{let Y=G;if(Y.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${Y.prefix}"`;if(Y.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${Y.suffix}"`;if(Y.format==="includes")return`המחרוזת חייבת לכלול "${Y.includes}"`;if(Y.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${Y.pattern}`;let Q=D[Y.format],W=Q?.label??Y.format,H=(Q?.gender??"m")==="f"?"תקינה":"תקין";return`${W} לא ${H}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${G.divisor}`;case"unrecognized_keys":return`מפתח${G.keys.length>1?"ות":""} לא מזוה${G.keys.length>1?"ים":"ה"}: ${O(G.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${_(G.origin??"array")}`;default:return"קלט לא תקין"}}};function F9(){return{localeError:vB()}}var _B=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function v(_){return $[_]??null}let w={regex:"bemenet",email:"email cím",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őbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},g={nan:"NaN",number:"szám",array:"tömb"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Érvénytelen bemenet: a várt érték instanceof ${_.expected}, a kapott érték ${D}`;return`Érvénytelen bemenet: a várt érték ${b}, a kapott érték ${D}`}case"invalid_value":if(_.values.length===1)return`Érvénytelen bemenet: a várt érték ${z(_.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Túl nagy: ${_.origin??"érték"} mérete túl nagy ${b}${_.maximum.toString()} ${J.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${_.origin??"érték"} túl nagy: ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Túl kicsi: a bemeneti érték ${_.origin} mérete túl kicsi ${b}${_.minimum.toString()} ${J.unit}`;return`Túl kicsi: a bemeneti érték ${_.origin} túl kicsi ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Érvénytelen string: "${b.prefix}" értékkel kell kezdődnie`;if(b.format==="ends_with")return`Érvénytelen string: "${b.suffix}" értékkel kell végződnie`;if(b.format==="includes")return`Érvénytelen string: "${b.includes}" értéket kell tartalmaznia`;if(b.format==="regex")return`Érvénytelen string: ${b.pattern} mintának kell megfelelnie`;return`Érvénytelen ${w[b.format]??_.format}`}case"not_multiple_of":return`Érvénytelen szám: ${_.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${_.keys.length>1?"s":""}: ${O(_.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${_.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${_.origin}`;default:return"Érvénytelen bemenet"}}};function K9(){return{localeError:_B()}}function uG($,v,w){return Math.abs($)===1?v:w}function Ow($){if(!$)return"";let v=["ա","ե","ը","ի","ո","ու","օ"],w=$[$.length-1];return $+(v.includes(w)?"ն":"ը")}var wB=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function v(_){return $[_]??null}let w={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},g={nan:"NaN",number:"թիվ",array:"զանգված"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${_.expected}, ստացվել է ${D}`;return`Սխալ մուտքագրում․ սպասվում էր ${b}, ստացվել է ${D}`}case"invalid_value":if(_.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${z(_.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J){let D=Number(_.maximum),X=uG(D,J.unit.one,J.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Ow(_.origin??"արժեք")} կունենա ${b}${_.maximum.toString()} ${X}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Ow(_.origin??"արժեք")} լինի ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J){let D=Number(_.minimum),X=uG(D,J.unit.one,J.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Ow(_.origin)} կունենա ${b}${_.minimum.toString()} ${X}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Ow(_.origin)} լինի ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${b.prefix}"-ով`;if(b.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${b.suffix}"-ով`;if(b.format==="includes")return`Սխալ տող․ պետք է պարունակի "${b.includes}"`;if(b.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${b.pattern} ձևաչափին`;return`Սխալ ${w[b.format]??_.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${_.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${_.keys.length>1?"ներ":""}. ${O(_.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${Ow(_.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${Ow(_.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function O9(){return{localeError:wB()}}var gB=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function v(_){return $[_]??null}let w={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Input tidak valid: diharapkan instanceof ${_.expected}, diterima ${D}`;return`Input tidak valid: diharapkan ${b}, diterima ${D}`}case"invalid_value":if(_.values.length===1)return`Input tidak valid: diharapkan ${z(_.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Terlalu besar: diharapkan ${_.origin??"value"} memiliki ${b}${_.maximum.toString()} ${J.unit??"elemen"}`;return`Terlalu besar: diharapkan ${_.origin??"value"} menjadi ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Terlalu kecil: diharapkan ${_.origin} memiliki ${b}${_.minimum.toString()} ${J.unit}`;return`Terlalu kecil: diharapkan ${_.origin} menjadi ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`String tidak valid: harus dimulai dengan "${b.prefix}"`;if(b.format==="ends_with")return`String tidak valid: harus berakhir dengan "${b.suffix}"`;if(b.format==="includes")return`String tidak valid: harus menyertakan "${b.includes}"`;if(b.format==="regex")return`String tidak valid: harus sesuai pola ${b.pattern}`;return`${w[b.format]??_.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${_.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${_.keys.length>1?"s":""}: ${O(_.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${_.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${_.origin}`;default:return"Input tidak valid"}}};function N9(){return{localeError:gB()}}var bB=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function v(_){return $[_]??null}let w={regex:"gildi",email:"netfang",url:"vefslóð",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ími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},g={nan:"NaN",number:"númer",array:"fylki"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Rangt gildi: Þú slóst inn ${D} þar sem á að vera instanceof ${_.expected}`;return`Rangt gildi: Þú slóst inn ${D} þar sem á að vera ${b}`}case"invalid_value":if(_.values.length===1)return`Rangt gildi: gert ráð fyrir ${z(_.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Of stórt: gert er ráð fyrir að ${_.origin??"gildi"} hafi ${b}${_.maximum.toString()} ${J.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${_.origin??"gildi"} sé ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Of lítið: gert er ráð fyrir að ${_.origin} hafi ${b}${_.minimum.toString()} ${J.unit}`;return`Of lítið: gert er ráð fyrir að ${_.origin} sé ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ógildur strengur: verður að byrja á "${b.prefix}"`;if(b.format==="ends_with")return`Ógildur strengur: verður að enda á "${b.suffix}"`;if(b.format==="includes")return`Ógildur strengur: verður að innihalda "${b.includes}"`;if(b.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${b.pattern}`;return`Rangt ${w[b.format]??_.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${_.divisor}`;case"unrecognized_keys":return`Óþekkt ${_.keys.length>1?"ir lyklar":"ur lykill"}: ${O(_.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${_.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${_.origin}`;default:return"Rangt gildi"}}};function k9(){return{localeError:bB()}}var UB=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function v(_){return $[_]??null}let w={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"numero",array:"vettore"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Input non valido: atteso instanceof ${_.expected}, ricevuto ${D}`;return`Input non valido: atteso ${b}, ricevuto ${D}`}case"invalid_value":if(_.values.length===1)return`Input non valido: atteso ${z(_.values[0])}`;return`Opzione non valida: atteso uno tra ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Troppo grande: ${_.origin??"valore"} deve avere ${b}${_.maximum.toString()} ${J.unit??"elementi"}`;return`Troppo grande: ${_.origin??"valore"} deve essere ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Troppo piccolo: ${_.origin} deve avere ${b}${_.minimum.toString()} ${J.unit}`;return`Troppo piccolo: ${_.origin} deve essere ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Stringa non valida: deve iniziare con "${b.prefix}"`;if(b.format==="ends_with")return`Stringa non valida: deve terminare con "${b.suffix}"`;if(b.format==="includes")return`Stringa non valida: deve includere "${b.includes}"`;if(b.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${b.pattern}`;return`Invalid ${w[b.format]??_.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${_.divisor}`;case"unrecognized_keys":return`Chiav${_.keys.length>1?"i":"e"} non riconosciut${_.keys.length>1?"e":"a"}: ${O(_.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${_.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${_.origin}`;default:return"Input non valido"}}};function z9(){return{localeError:UB()}}var JB=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function v(_){return $[_]??null}let w={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},g={nan:"NaN",number:"数値",array:"配列"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`無効な入力: instanceof ${_.expected}が期待されましたが、${D}が入力されました`;return`無効な入力: ${b}が期待されましたが、${D}が入力されました`}case"invalid_value":if(_.values.length===1)return`無効な入力: ${z(_.values[0])}が期待されました`;return`無効な選択: ${O(_.values,"、")}のいずれかである必要があります`;case"too_big":{let b=_.inclusive?"以下である":"より小さい",J=v(_.origin);if(J)return`大きすぎる値: ${_.origin??"値"}は${_.maximum.toString()}${J.unit??"要素"}${b}必要があります`;return`大きすぎる値: ${_.origin??"値"}は${_.maximum.toString()}${b}必要があります`}case"too_small":{let b=_.inclusive?"以上である":"より大きい",J=v(_.origin);if(J)return`小さすぎる値: ${_.origin}は${_.minimum.toString()}${J.unit}${b}必要があります`;return`小さすぎる値: ${_.origin}は${_.minimum.toString()}${b}必要があります`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`無効な文字列: "${b.prefix}"で始まる必要があります`;if(b.format==="ends_with")return`無効な文字列: "${b.suffix}"で終わる必要があります`;if(b.format==="includes")return`無効な文字列: "${b.includes}"を含む必要があります`;if(b.format==="regex")return`無効な文字列: パターン${b.pattern}に一致する必要があります`;return`無効な${w[b.format]??_.format}`}case"not_multiple_of":return`無効な数値: ${_.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${_.keys.length>1?"群":""}: ${O(_.keys,"、")}`;case"invalid_key":return`${_.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${_.origin}内の無効な値`;default:return"無効な入力"}}};function i9(){return{localeError:JB()}}var DB=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function v(_){return $[_]??null}let w={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},g={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${_.expected}, მიღებული ${D}`;return`არასწორი შეყვანა: მოსალოდნელი ${b}, მიღებული ${D}`}case"invalid_value":if(_.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${z(_.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${O(_.values,"|")}-დან`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`ზედმეტად დიდი: მოსალოდნელი ${_.origin??"მნიშვნელობა"} ${J.verb} ${b}${_.maximum.toString()} ${J.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${_.origin??"მნიშვნელობა"} იყოს ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`ზედმეტად პატარა: მოსალოდნელი ${_.origin} ${J.verb} ${b}${_.minimum.toString()} ${J.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${_.origin} იყოს ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${b.prefix}"-ით`;if(b.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${b.suffix}"-ით`;if(b.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${b.includes}"-ს`;if(b.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${b.pattern}`;return`არასწორი ${w[b.format]??_.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${_.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${_.keys.length>1?"ები":"ი"}: ${O(_.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${_.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${_.origin}-ში`;default:return"არასწორი შეყვანა"}}};function n9(){return{localeError:DB()}}var XB=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function v(_){return $[_]??null}let w={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},g={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${_.expected} ប៉ុន្តែទទួលបាន ${D}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${b} ប៉ុន្តែទទួលបាន ${D}`}case"invalid_value":if(_.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${z(_.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`ធំពេក៖ ត្រូវការ ${_.origin??"តម្លៃ"} ${b} ${_.maximum.toString()} ${J.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${_.origin??"តម្លៃ"} ${b} ${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`តូចពេក៖ ត្រូវការ ${_.origin} ${b} ${_.minimum.toString()} ${J.unit}`;return`តូចពេក៖ ត្រូវការ ${_.origin} ${b} ${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${b.prefix}"`;if(b.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${b.suffix}"`;if(b.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${b.includes}"`;if(b.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${b.pattern}`;return`មិនត្រឹមត្រូវ៖ ${w[b.format]??_.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${_.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${O(_.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${_.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${_.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function b4(){return{localeError:XB()}}function P9(){return b4()}var GB=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function v(_){return $[_]??null}let w={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`잘못된 입력: 예상 타입은 instanceof ${_.expected}, 받은 타입은 ${D}입니다`;return`잘못된 입력: 예상 타입은 ${b}, 받은 타입은 ${D}입니다`}case"invalid_value":if(_.values.length===1)return`잘못된 입력: 값은 ${z(_.values[0])} 이어야 합니다`;return`잘못된 옵션: ${O(_.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let b=_.inclusive?"이하":"미만",J=b==="미만"?"이어야 합니다":"여야 합니다",D=v(_.origin),X=D?.unit??"요소";if(D)return`${_.origin??"값"}이 너무 큽니다: ${_.maximum.toString()}${X} ${b}${J}`;return`${_.origin??"값"}이 너무 큽니다: ${_.maximum.toString()} ${b}${J}`}case"too_small":{let b=_.inclusive?"이상":"초과",J=b==="이상"?"이어야 합니다":"여야 합니다",D=v(_.origin),X=D?.unit??"요소";if(D)return`${_.origin??"값"}이 너무 작습니다: ${_.minimum.toString()}${X} ${b}${J}`;return`${_.origin??"값"}이 너무 작습니다: ${_.minimum.toString()} ${b}${J}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`잘못된 문자열: "${b.prefix}"(으)로 시작해야 합니다`;if(b.format==="ends_with")return`잘못된 문자열: "${b.suffix}"(으)로 끝나야 합니다`;if(b.format==="includes")return`잘못된 문자열: "${b.includes}"을(를) 포함해야 합니다`;if(b.format==="regex")return`잘못된 문자열: 정규식 ${b.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${w[b.format]??_.format}`}case"not_multiple_of":return`잘못된 숫자: ${_.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${O(_.keys,", ")}`;case"invalid_key":return`잘못된 키: ${_.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${_.origin}`;default:return"잘못된 입력"}}};function A9(){return{localeError:GB()}}var U4=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function RG($){let v=Math.abs($),w=v%10,g=v%100;if(g>=11&&g<=19||w===0)return"many";if(w===1)return"one";return"few"}var YB=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function v(_,b,J,D){let X=$[_]??null;if(X===null)return X;return{unit:X.unit[b],verb:X.verb[D][J?"inclusive":"notInclusive"]}}let w={regex:"įvestis",email:"el. pašto 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ė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},g={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Gautas tipas ${D}, o tikėtasi - instanceof ${_.expected}`;return`Gautas tipas ${D}, o tikėtasi - ${b}`}case"invalid_value":if(_.values.length===1)return`Privalo būti ${z(_.values[0])}`;return`Privalo būti vienas iš ${O(_.values,"|")} pasirinkimų`;case"too_big":{let b=g[_.origin]??_.origin,J=v(_.origin,RG(Number(_.maximum)),_.inclusive??!1,"smaller");if(J?.verb)return`${U4(b??_.origin??"reikšmė")} ${J.verb} ${_.maximum.toString()} ${J.unit??"elementų"}`;let D=_.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${U4(b??_.origin??"reikšmė")} turi būti ${D} ${_.maximum.toString()} ${J?.unit}`}case"too_small":{let b=g[_.origin]??_.origin,J=v(_.origin,RG(Number(_.minimum)),_.inclusive??!1,"bigger");if(J?.verb)return`${U4(b??_.origin??"reikšmė")} ${J.verb} ${_.minimum.toString()} ${J.unit??"elementų"}`;let D=_.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${U4(b??_.origin??"reikšmė")} turi būti ${D} ${_.minimum.toString()} ${J?.unit}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Eilutė privalo prasidėti "${b.prefix}"`;if(b.format==="ends_with")return`Eilutė privalo pasibaigti "${b.suffix}"`;if(b.format==="includes")return`Eilutė privalo įtraukti "${b.includes}"`;if(b.format==="regex")return`Eilutė privalo atitikti ${b.pattern}`;return`Neteisingas ${w[b.format]??_.format}`}case"not_multiple_of":return`Skaičius privalo būti ${_.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${_.keys.length>1?"i":"as"} rakt${_.keys.length>1?"ai":"as"}: ${O(_.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let b=g[_.origin]??_.origin;return`${U4(b??_.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function M9(){return{localeError:YB()}}var QB=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function v(_){return $[_]??null}let w={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},g={nan:"NaN",number:"број",array:"низа"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Грешен внес: се очекува instanceof ${_.expected}, примено ${D}`;return`Грешен внес: се очекува ${b}, примено ${D}`}case"invalid_value":if(_.values.length===1)return`Invalid input: expected ${z(_.values[0])}`;return`Грешана опција: се очекува една ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Премногу голем: се очекува ${_.origin??"вредноста"} да има ${b}${_.maximum.toString()} ${J.unit??"елементи"}`;return`Премногу голем: се очекува ${_.origin??"вредноста"} да биде ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Премногу мал: се очекува ${_.origin} да има ${b}${_.minimum.toString()} ${J.unit}`;return`Премногу мал: се очекува ${_.origin} да биде ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Неважечка низа: мора да започнува со "${b.prefix}"`;if(b.format==="ends_with")return`Неважечка низа: мора да завршува со "${b.suffix}"`;if(b.format==="includes")return`Неважечка низа: мора да вклучува "${b.includes}"`;if(b.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${b.pattern}`;return`Invalid ${w[b.format]??_.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${O(_.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${_.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${_.origin}`;default:return"Грешен внес"}}};function f9(){return{localeError:QB()}}var WB=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function v(_){return $[_]??null}let w={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"nombor"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Input tidak sah: dijangka instanceof ${_.expected}, diterima ${D}`;return`Input tidak sah: dijangka ${b}, diterima ${D}`}case"invalid_value":if(_.values.length===1)return`Input tidak sah: dijangka ${z(_.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Terlalu besar: dijangka ${_.origin??"nilai"} ${J.verb} ${b}${_.maximum.toString()} ${J.unit??"elemen"}`;return`Terlalu besar: dijangka ${_.origin??"nilai"} adalah ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Terlalu kecil: dijangka ${_.origin} ${J.verb} ${b}${_.minimum.toString()} ${J.unit}`;return`Terlalu kecil: dijangka ${_.origin} adalah ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`String tidak sah: mesti bermula dengan "${b.prefix}"`;if(b.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${b.suffix}"`;if(b.format==="includes")return`String tidak sah: mesti mengandungi "${b.includes}"`;if(b.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${b.pattern}`;return`${w[b.format]??_.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${_.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${O(_.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${_.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${_.origin}`;default:return"Input tidak sah"}}};function S9(){return{localeError:WB()}}var HB=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function v(_){return $[_]??null}let w={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},g={nan:"NaN",number:"getal"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Ongeldige invoer: verwacht instanceof ${_.expected}, ontving ${D}`;return`Ongeldige invoer: verwacht ${b}, ontving ${D}`}case"invalid_value":if(_.values.length===1)return`Ongeldige invoer: verwacht ${z(_.values[0])}`;return`Ongeldige optie: verwacht één van ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin),D=_.origin==="date"?"laat":_.origin==="string"?"lang":"groot";if(J)return`Te ${D}: verwacht dat ${_.origin??"waarde"} ${b}${_.maximum.toString()} ${J.unit??"elementen"} ${J.verb}`;return`Te ${D}: verwacht dat ${_.origin??"waarde"} ${b}${_.maximum.toString()} is`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin),D=_.origin==="date"?"vroeg":_.origin==="string"?"kort":"klein";if(J)return`Te ${D}: verwacht dat ${_.origin} ${b}${_.minimum.toString()} ${J.unit} ${J.verb}`;return`Te ${D}: verwacht dat ${_.origin} ${b}${_.minimum.toString()} is`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ongeldige tekst: moet met "${b.prefix}" beginnen`;if(b.format==="ends_with")return`Ongeldige tekst: moet op "${b.suffix}" eindigen`;if(b.format==="includes")return`Ongeldige tekst: moet "${b.includes}" bevatten`;if(b.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${b.pattern}`;return`Ongeldig: ${w[b.format]??_.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${_.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${_.keys.length>1?"s":""}: ${O(_.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${_.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${_.origin}`;default:return"Ongeldige invoer"}}};function T9(){return{localeError:HB()}}var qB=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function v(_){return $[_]??null}let w={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"tall",array:"liste"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Ugyldig input: forventet instanceof ${_.expected}, fikk ${D}`;return`Ugyldig input: forventet ${b}, fikk ${D}`}case"invalid_value":if(_.values.length===1)return`Ugyldig verdi: forventet ${z(_.values[0])}`;return`Ugyldig valg: forventet en av ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`For stor(t): forventet ${_.origin??"value"} til å ha ${b}${_.maximum.toString()} ${J.unit??"elementer"}`;return`For stor(t): forventet ${_.origin??"value"} til å ha ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`For lite(n): forventet ${_.origin} til å ha ${b}${_.minimum.toString()} ${J.unit}`;return`For lite(n): forventet ${_.origin} til å ha ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ugyldig streng: må starte med "${b.prefix}"`;if(b.format==="ends_with")return`Ugyldig streng: må ende med "${b.suffix}"`;if(b.format==="includes")return`Ugyldig streng: må inneholde "${b.includes}"`;if(b.format==="regex")return`Ugyldig streng: må matche mønsteret ${b.pattern}`;return`Ugyldig ${w[b.format]??_.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${O(_.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${_.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${_.origin}`;default:return"Ugyldig input"}}};function u9(){return{localeError:qB()}}var IB=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function v(_){return $[_]??null}let w={regex:"giren",email:"epostagâh",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âmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},g={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Fâsit giren: umulan instanceof ${_.expected}, alınan ${D}`;return`Fâsit giren: umulan ${b}, alınan ${D}`}case"invalid_value":if(_.values.length===1)return`Fâsit giren: umulan ${z(_.values[0])}`;return`Fâsit tercih: mûteberler ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Fazla büyük: ${_.origin??"value"}, ${b}${_.maximum.toString()} ${J.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${_.origin??"value"}, ${b}${_.maximum.toString()} olmalıydı.`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Fazla küçük: ${_.origin}, ${b}${_.minimum.toString()} ${J.unit} sahip olmalıydı.`;return`Fazla küçük: ${_.origin}, ${b}${_.minimum.toString()} olmalıydı.`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Fâsit metin: "${b.prefix}" ile başlamalı.`;if(b.format==="ends_with")return`Fâsit metin: "${b.suffix}" ile bitmeli.`;if(b.format==="includes")return`Fâsit metin: "${b.includes}" ihtivâ etmeli.`;if(b.format==="regex")return`Fâsit metin: ${b.pattern} nakşına uymalı.`;return`Fâsit ${w[b.format]??_.format}`}case"not_multiple_of":return`Fâsit sayı: ${_.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${_.keys.length>1?"s":""}: ${O(_.keys,", ")}`;case"invalid_key":return`${_.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${_.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function R9(){return{localeError:IB()}}var BB=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function v(_){return $[_]??null}let w={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},g={nan:"NaN",number:"عدد",array:"ارې"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`ناسم ورودي: باید instanceof ${_.expected} وای, مګر ${D} ترلاسه شو`;return`ناسم ورودي: باید ${b} وای, مګر ${D} ترلاسه شو`}case"invalid_value":if(_.values.length===1)return`ناسم ورودي: باید ${z(_.values[0])} وای`;return`ناسم انتخاب: باید یو له ${O(_.values,"|")} څخه وای`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`ډیر لوی: ${_.origin??"ارزښت"} باید ${b}${_.maximum.toString()} ${J.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${_.origin??"ارزښت"} باید ${b}${_.maximum.toString()} وي`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`ډیر کوچنی: ${_.origin} باید ${b}${_.minimum.toString()} ${J.unit} ولري`;return`ډیر کوچنی: ${_.origin} باید ${b}${_.minimum.toString()} وي`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`ناسم متن: باید د "${b.prefix}" سره پیل شي`;if(b.format==="ends_with")return`ناسم متن: باید د "${b.suffix}" سره پای ته ورسيږي`;if(b.format==="includes")return`ناسم متن: باید "${b.includes}" ولري`;if(b.format==="regex")return`ناسم متن: باید د ${b.pattern} سره مطابقت ولري`;return`${w[b.format]??_.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${_.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${_.keys.length>1?"کلیډونه":"کلیډ"}: ${O(_.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${_.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${_.origin} کې`;default:return"ناسمه ورودي"}}};function C9(){return{localeError:BB()}}var LB=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function v(_){return $[_]??null}let w={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},g={nan:"NaN",number:"liczba",array:"tablica"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${_.expected}, otrzymano ${D}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${b}, otrzymano ${D}`}case"invalid_value":if(_.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${z(_.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Za duża wartość: oczekiwano, że ${_.origin??"wartość"} będzie mieć ${b}${_.maximum.toString()} ${J.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${_.origin??"wartość"} będzie wynosić ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Za mała wartość: oczekiwano, że ${_.origin??"wartość"} będzie mieć ${b}${_.minimum.toString()} ${J.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${_.origin??"wartość"} będzie wynosić ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${b.prefix}"`;if(b.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${b.suffix}"`;if(b.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${b.includes}"`;if(b.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${b.pattern}`;return`Nieprawidłow(y/a/e) ${w[b.format]??_.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${_.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${_.keys.length>1?"s":""}: ${O(_.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${_.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${_.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function E9(){return{localeError:LB()}}var VB=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function v(_){return $[_]??null}let w={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},g={nan:"NaN",number:"número",null:"nulo"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Tipo inválido: esperado instanceof ${_.expected}, recebido ${D}`;return`Tipo inválido: esperado ${b}, recebido ${D}`}case"invalid_value":if(_.values.length===1)return`Entrada inválida: esperado ${z(_.values[0])}`;return`Opção inválida: esperada uma das ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Muito grande: esperado que ${_.origin??"valor"} tivesse ${b}${_.maximum.toString()} ${J.unit??"elementos"}`;return`Muito grande: esperado que ${_.origin??"valor"} fosse ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Muito pequeno: esperado que ${_.origin} tivesse ${b}${_.minimum.toString()} ${J.unit}`;return`Muito pequeno: esperado que ${_.origin} fosse ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Texto inválido: deve começar com "${b.prefix}"`;if(b.format==="ends_with")return`Texto inválido: deve terminar com "${b.suffix}"`;if(b.format==="includes")return`Texto inválido: deve incluir "${b.includes}"`;if(b.format==="regex")return`Texto inválido: deve corresponder ao padrão ${b.pattern}`;return`${w[b.format]??_.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${_.divisor}`;case"unrecognized_keys":return`Chave${_.keys.length>1?"s":""} desconhecida${_.keys.length>1?"s":""}: ${O(_.keys,", ")}`;case"invalid_key":return`Chave inválida em ${_.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${_.origin}`;default:return"Campo inválido"}}};function Z9(){return{localeError:VB()}}function CG($,v,w,g){let _=Math.abs($),b=_%10,J=_%100;if(J>=11&&J<=19)return g;if(b===1)return v;if(b>=2&&b<=4)return w;return g}var jB=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function v(_){return $[_]??null}let w={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},g={nan:"NaN",number:"число",array:"массив"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Неверный ввод: ожидалось instanceof ${_.expected}, получено ${D}`;return`Неверный ввод: ожидалось ${b}, получено ${D}`}case"invalid_value":if(_.values.length===1)return`Неверный ввод: ожидалось ${z(_.values[0])}`;return`Неверный вариант: ожидалось одно из ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J){let D=Number(_.maximum),X=CG(D,J.unit.one,J.unit.few,J.unit.many);return`Слишком большое значение: ожидалось, что ${_.origin??"значение"} будет иметь ${b}${_.maximum.toString()} ${X}`}return`Слишком большое значение: ожидалось, что ${_.origin??"значение"} будет ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J){let D=Number(_.minimum),X=CG(D,J.unit.one,J.unit.few,J.unit.many);return`Слишком маленькое значение: ожидалось, что ${_.origin} будет иметь ${b}${_.minimum.toString()} ${X}`}return`Слишком маленькое значение: ожидалось, что ${_.origin} будет ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Неверная строка: должна начинаться с "${b.prefix}"`;if(b.format==="ends_with")return`Неверная строка: должна заканчиваться на "${b.suffix}"`;if(b.format==="includes")return`Неверная строка: должна содержать "${b.includes}"`;if(b.format==="regex")return`Неверная строка: должна соответствовать шаблону ${b.pattern}`;return`Неверный ${w[b.format]??_.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${_.divisor}`;case"unrecognized_keys":return`Нераспознанн${_.keys.length>1?"ые":"ый"} ключ${_.keys.length>1?"и":""}: ${O(_.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${_.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${_.origin}`;default:return"Неверные входные данные"}}};function h9(){return{localeError:jB()}}var FB=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function v(_){return $[_]??null}let w={regex:"vnos",email:"e-poštni 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 čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},g={nan:"NaN",number:"število",array:"tabela"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Neveljaven vnos: pričakovano instanceof ${_.expected}, prejeto ${D}`;return`Neveljaven vnos: pričakovano ${b}, prejeto ${D}`}case"invalid_value":if(_.values.length===1)return`Neveljaven vnos: pričakovano ${z(_.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Preveliko: pričakovano, da bo ${_.origin??"vrednost"} imelo ${b}${_.maximum.toString()} ${J.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${_.origin??"vrednost"} ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Premajhno: pričakovano, da bo ${_.origin} imelo ${b}${_.minimum.toString()} ${J.unit}`;return`Premajhno: pričakovano, da bo ${_.origin} ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Neveljaven niz: mora se začeti z "${b.prefix}"`;if(b.format==="ends_with")return`Neveljaven niz: mora se končati z "${b.suffix}"`;if(b.format==="includes")return`Neveljaven niz: mora vsebovati "${b.includes}"`;if(b.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${b.pattern}`;return`Neveljaven ${w[b.format]??_.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${_.divisor}`;case"unrecognized_keys":return`Neprepoznan${_.keys.length>1?"i ključi":" ključ"}: ${O(_.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${_.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${_.origin}`;default:return"Neveljaven vnos"}}};function x9(){return{localeError:FB()}}var KB=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function v(_){return $[_]??null}let w={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},g={nan:"NaN",number:"antal",array:"lista"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Ogiltig inmatning: förväntat instanceof ${_.expected}, fick ${D}`;return`Ogiltig inmatning: förväntat ${b}, fick ${D}`}case"invalid_value":if(_.values.length===1)return`Ogiltig inmatning: förväntat ${z(_.values[0])}`;return`Ogiltigt val: förväntade en av ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`För stor(t): förväntade ${_.origin??"värdet"} att ha ${b}${_.maximum.toString()} ${J.unit??"element"}`;return`För stor(t): förväntat ${_.origin??"värdet"} att ha ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`För lite(t): förväntade ${_.origin??"värdet"} att ha ${b}${_.minimum.toString()} ${J.unit}`;return`För lite(t): förväntade ${_.origin??"värdet"} att ha ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ogiltig sträng: måste börja med "${b.prefix}"`;if(b.format==="ends_with")return`Ogiltig sträng: måste sluta med "${b.suffix}"`;if(b.format==="includes")return`Ogiltig sträng: måste innehålla "${b.includes}"`;if(b.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${b.pattern}"`;return`Ogiltig(t) ${w[b.format]??_.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${O(_.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${_.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${_.origin??"värdet"}`;default:return"Ogiltig input"}}};function l9(){return{localeError:KB()}}var OB=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function v(_){return $[_]??null}let w={regex:"உள்ளீடு",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 தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},g={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${_.expected}, பெறப்பட்டது ${D}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${b}, பெறப்பட்டது ${D}`}case"invalid_value":if(_.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${z(_.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${O(_.values,"|")} இல் ஒன்று`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${_.origin??"மதிப்பு"} ${b}${_.maximum.toString()} ${J.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${_.origin??"மதிப்பு"} ${b}${_.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${_.origin} ${b}${_.minimum.toString()} ${J.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${_.origin} ${b}${_.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`தவறான சரம்: "${b.prefix}" இல் தொடங்க வேண்டும்`;if(b.format==="ends_with")return`தவறான சரம்: "${b.suffix}" இல் முடிவடைய வேண்டும்`;if(b.format==="includes")return`தவறான சரம்: "${b.includes}" ஐ உள்ளடக்க வேண்டும்`;if(b.format==="regex")return`தவறான சரம்: ${b.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${w[b.format]??_.format}`}case"not_multiple_of":return`தவறான எண்: ${_.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${_.keys.length>1?"கள்":""}: ${O(_.keys,", ")}`;case"invalid_key":return`${_.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${_.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function c9(){return{localeError:OB()}}var NB=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function v(_){return $[_]??null}let w={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},g={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${_.expected} แต่ได้รับ ${D}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${b} แต่ได้รับ ${D}`}case"invalid_value":if(_.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${z(_.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"ไม่เกิน":"น้อยกว่า",J=v(_.origin);if(J)return`เกินกำหนด: ${_.origin??"ค่า"} ควรมี${b} ${_.maximum.toString()} ${J.unit??"รายการ"}`;return`เกินกำหนด: ${_.origin??"ค่า"} ควรมี${b} ${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?"อย่างน้อย":"มากกว่า",J=v(_.origin);if(J)return`น้อยกว่ากำหนด: ${_.origin} ควรมี${b} ${_.minimum.toString()} ${J.unit}`;return`น้อยกว่ากำหนด: ${_.origin} ควรมี${b} ${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${b.prefix}"`;if(b.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${b.suffix}"`;if(b.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${b.includes}" อยู่ในข้อความ`;if(b.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${b.pattern}`;return`รูปแบบไม่ถูกต้อง: ${w[b.format]??_.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${_.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${O(_.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${_.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${_.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function y9(){return{localeError:NB()}}var kB=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function v(_){return $[_]??null}let w={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üre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Geçersiz değer: beklenen instanceof ${_.expected}, alınan ${D}`;return`Geçersiz değer: beklenen ${b}, alınan ${D}`}case"invalid_value":if(_.values.length===1)return`Geçersiz değer: beklenen ${z(_.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Çok büyük: beklenen ${_.origin??"değer"} ${b}${_.maximum.toString()} ${J.unit??"öğe"}`;return`Çok büyük: beklenen ${_.origin??"değer"} ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Çok küçük: beklenen ${_.origin} ${b}${_.minimum.toString()} ${J.unit}`;return`Çok küçük: beklenen ${_.origin} ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Geçersiz metin: "${b.prefix}" ile başlamalı`;if(b.format==="ends_with")return`Geçersiz metin: "${b.suffix}" ile bitmeli`;if(b.format==="includes")return`Geçersiz metin: "${b.includes}" içermeli`;if(b.format==="regex")return`Geçersiz metin: ${b.pattern} desenine uymalı`;return`Geçersiz ${w[b.format]??_.format}`}case"not_multiple_of":return`Geçersiz sayı: ${_.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${_.keys.length>1?"lar":""}: ${O(_.keys,", ")}`;case"invalid_key":return`${_.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${_.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function m9(){return{localeError:kB()}}var zB=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function v(_){return $[_]??null}let w={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},g={nan:"NaN",number:"число",array:"масив"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Неправильні вхідні дані: очікується instanceof ${_.expected}, отримано ${D}`;return`Неправильні вхідні дані: очікується ${b}, отримано ${D}`}case"invalid_value":if(_.values.length===1)return`Неправильні вхідні дані: очікується ${z(_.values[0])}`;return`Неправильна опція: очікується одне з ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Занадто велике: очікується, що ${_.origin??"значення"} ${J.verb} ${b}${_.maximum.toString()} ${J.unit??"елементів"}`;return`Занадто велике: очікується, що ${_.origin??"значення"} буде ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Занадто мале: очікується, що ${_.origin} ${J.verb} ${b}${_.minimum.toString()} ${J.unit}`;return`Занадто мале: очікується, що ${_.origin} буде ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Неправильний рядок: повинен починатися з "${b.prefix}"`;if(b.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${b.suffix}"`;if(b.format==="includes")return`Неправильний рядок: повинен містити "${b.includes}"`;if(b.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${b.pattern}`;return`Неправильний ${w[b.format]??_.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${_.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${_.keys.length>1?"і":""}: ${O(_.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${_.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${_.origin}`;default:return"Неправильні вхідні дані"}}};function J4(){return{localeError:zB()}}function r9(){return J4()}var iB=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function v(_){return $[_]??null}let w={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},g={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`غلط ان پٹ: instanceof ${_.expected} متوقع تھا، ${D} موصول ہوا`;return`غلط ان پٹ: ${b} متوقع تھا، ${D} موصول ہوا`}case"invalid_value":if(_.values.length===1)return`غلط ان پٹ: ${z(_.values[0])} متوقع تھا`;return`غلط آپشن: ${O(_.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`بہت بڑا: ${_.origin??"ویلیو"} کے ${b}${_.maximum.toString()} ${J.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${_.origin??"ویلیو"} کا ${b}${_.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`بہت چھوٹا: ${_.origin} کے ${b}${_.minimum.toString()} ${J.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${_.origin} کا ${b}${_.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`غلط سٹرنگ: "${b.prefix}" سے شروع ہونا چاہیے`;if(b.format==="ends_with")return`غلط سٹرنگ: "${b.suffix}" پر ختم ہونا چاہیے`;if(b.format==="includes")return`غلط سٹرنگ: "${b.includes}" شامل ہونا چاہیے`;if(b.format==="regex")return`غلط سٹرنگ: پیٹرن ${b.pattern} سے میچ ہونا چاہیے`;return`غلط ${w[b.format]??_.format}`}case"not_multiple_of":return`غلط نمبر: ${_.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${_.keys.length>1?"ز":""}: ${O(_.keys,"، ")}`;case"invalid_key":return`${_.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${_.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function o9(){return{localeError:iB()}}var nB=()=>{let $={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function v(_){return $[_]??null}let w={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},g={nan:"NaN",number:"raqam",array:"massiv"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${_.expected}, qabul qilingan ${D}`;return`Noto‘g‘ri kirish: kutilgan ${b}, qabul qilingan ${D}`}case"invalid_value":if(_.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${z(_.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Juda katta: kutilgan ${_.origin??"qiymat"} ${b}${_.maximum.toString()} ${J.unit} ${J.verb}`;return`Juda katta: kutilgan ${_.origin??"qiymat"} ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Juda kichik: kutilgan ${_.origin} ${b}${_.minimum.toString()} ${J.unit} ${J.verb}`;return`Juda kichik: kutilgan ${_.origin} ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Noto‘g‘ri satr: "${b.prefix}" bilan boshlanishi kerak`;if(b.format==="ends_with")return`Noto‘g‘ri satr: "${b.suffix}" bilan tugashi kerak`;if(b.format==="includes")return`Noto‘g‘ri satr: "${b.includes}" ni o‘z ichiga olishi kerak`;if(b.format==="regex")return`Noto‘g‘ri satr: ${b.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${w[b.format]??_.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${_.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${_.keys.length>1?"lar":""}: ${O(_.keys,", ")}`;case"invalid_key":return`${_.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${_.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function d9(){return{localeError:nB()}}var PB=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function v(_){return $[_]??null}let w={regex:"đầu vào",email:"địa chỉ 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ày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},g={nan:"NaN",number:"số",array:"mảng"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${_.expected}, nhận được ${D}`;return`Đầu vào không hợp lệ: mong đợi ${b}, nhận được ${D}`}case"invalid_value":if(_.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${z(_.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Quá lớn: mong đợi ${_.origin??"giá trị"} ${J.verb} ${b}${_.maximum.toString()} ${J.unit??"phần tử"}`;return`Quá lớn: mong đợi ${_.origin??"giá trị"} ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Quá nhỏ: mong đợi ${_.origin} ${J.verb} ${b}${_.minimum.toString()} ${J.unit}`;return`Quá nhỏ: mong đợi ${_.origin} ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${b.prefix}"`;if(b.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${b.suffix}"`;if(b.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${b.includes}"`;if(b.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${b.pattern}`;return`${w[b.format]??_.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${_.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${O(_.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${_.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${_.origin}`;default:return"Đầu vào không hợp lệ"}}};function t9(){return{localeError:PB()}}var AB=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function v(_){return $[_]??null}let w={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},g={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`无效输入:期望 instanceof ${_.expected},实际接收 ${D}`;return`无效输入:期望 ${b},实际接收 ${D}`}case"invalid_value":if(_.values.length===1)return`无效输入:期望 ${z(_.values[0])}`;return`无效选项:期望以下之一 ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`数值过大:期望 ${_.origin??"值"} ${b}${_.maximum.toString()} ${J.unit??"个元素"}`;return`数值过大:期望 ${_.origin??"值"} ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`数值过小:期望 ${_.origin} ${b}${_.minimum.toString()} ${J.unit}`;return`数值过小:期望 ${_.origin} ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`无效字符串:必须以 "${b.prefix}" 开头`;if(b.format==="ends_with")return`无效字符串:必须以 "${b.suffix}" 结尾`;if(b.format==="includes")return`无效字符串:必须包含 "${b.includes}"`;if(b.format==="regex")return`无效字符串:必须满足正则表达式 ${b.pattern}`;return`无效${w[b.format]??_.format}`}case"not_multiple_of":return`无效数字:必须是 ${_.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${O(_.keys,", ")}`;case"invalid_key":return`${_.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${_.origin} 中包含无效值(value)`;default:return"无效输入"}}};function p9(){return{localeError:AB()}}var MB=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function v(_){return $[_]??null}let w={regex:"輸入",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 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},g={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`無效的輸入值:預期為 instanceof ${_.expected},但收到 ${D}`;return`無效的輸入值:預期為 ${b},但收到 ${D}`}case"invalid_value":if(_.values.length===1)return`無效的輸入值:預期為 ${z(_.values[0])}`;return`無效的選項:預期為以下其中之一 ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`數值過大:預期 ${_.origin??"值"} 應為 ${b}${_.maximum.toString()} ${J.unit??"個元素"}`;return`數值過大:預期 ${_.origin??"值"} 應為 ${b}${_.maximum.toString()}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`數值過小:預期 ${_.origin} 應為 ${b}${_.minimum.toString()} ${J.unit}`;return`數值過小:預期 ${_.origin} 應為 ${b}${_.minimum.toString()}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`無效的字串:必須以 "${b.prefix}" 開頭`;if(b.format==="ends_with")return`無效的字串:必須以 "${b.suffix}" 結尾`;if(b.format==="includes")return`無效的字串:必須包含 "${b.includes}"`;if(b.format==="regex")return`無效的字串:必須符合格式 ${b.pattern}`;return`無效的 ${w[b.format]??_.format}`}case"not_multiple_of":return`無效的數字:必須為 ${_.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${_.keys.length>1?"們":""}:${O(_.keys,"、")}`;case"invalid_key":return`${_.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${_.origin} 中有無效的值`;default:return"無效的輸入值"}}};function e9(){return{localeError:MB()}}var fB=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function v(_){return $[_]??null}let w={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},g={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(_)=>{switch(_.code){case"invalid_type":{let b=g[_.expected]??_.expected,J=n(_.input),D=g[J]??J;if(/^[A-Z]/.test(_.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${_.expected}, àmọ̀ a rí ${D}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${b}, àmọ̀ a rí ${D}`}case"invalid_value":if(_.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${z(_.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${O(_.values,"|")}`;case"too_big":{let b=_.inclusive?"<=":"<",J=v(_.origin);if(J)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${_.origin??"iye"} ${J.verb} ${b}${_.maximum} ${J.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${b}${_.maximum}`}case"too_small":{let b=_.inclusive?">=":">",J=v(_.origin);if(J)return`Kéré ju: a ní láti jẹ́ pé ${_.origin} ${J.verb} ${b}${_.minimum} ${J.unit}`;return`Kéré ju: a ní láti jẹ́ ${b}${_.minimum}`}case"invalid_format":{let b=_;if(b.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${b.prefix}"`;if(b.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${b.suffix}"`;if(b.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${b.includes}"`;if(b.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${b.pattern}`;return`Aṣìṣe: ${w[b.format]??_.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${_.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${O(_.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${_.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${_.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function a9(){return{localeError:fB()}}var EG,D4=Symbol("ZodOutput"),X4=Symbol("ZodInput");class s9{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...v){let w=v[0];if(this._map.set($,w),w&&typeof w==="object"&&"id"in w)this._idmap.set(w.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let v=this._map.get($);if(v&&typeof v==="object"&&"id"in v)this._idmap.delete(v.id);return this._map.delete($),this}get($){let v=$._zod.parent;if(v){let w={...this.get(v)??{}};delete w.id;let g={...w,...this._map.get($)};return Object.keys(g).length?g:void 0}return this._map.get($)}has($){return this._map.has($)}}function Nw(){return new s9}(EG=globalThis).__zod_globalRegistry??(EG.__zod_globalRegistry=Nw());var F$=globalThis.__zod_globalRegistry;function $J($,v){return new $({type:"string",...A(v)})}function vJ($,v){return new $({type:"string",coerce:!0,...A(v)})}function Ab($,v){return new $({type:"string",format:"email",check:"string_format",abort:!1,...A(v)})}function G4($,v){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...A(v)})}function Mb($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...A(v)})}function fb($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...A(v)})}function Sb($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...A(v)})}function Tb($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...A(v)})}function Y4($,v){return new $({type:"string",format:"url",check:"string_format",abort:!1,...A(v)})}function ub($,v){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...A(v)})}function Rb($,v){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...A(v)})}function Cb($,v){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...A(v)})}function Eb($,v){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...A(v)})}function Zb($,v){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...A(v)})}function hb($,v){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...A(v)})}function xb($,v){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...A(v)})}function lb($,v){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...A(v)})}function cb($,v){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...A(v)})}function _J($,v){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...A(v)})}function yb($,v){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...A(v)})}function mb($,v){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...A(v)})}function rb($,v){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...A(v)})}function ob($,v){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...A(v)})}function db($,v){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...A(v)})}function tb($,v){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...A(v)})}var Q4={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function wJ($,v){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...A(v)})}function gJ($,v){return new $({type:"string",format:"date",check:"string_format",...A(v)})}function bJ($,v){return new $({type:"string",format:"time",check:"string_format",precision:null,...A(v)})}function UJ($,v){return new $({type:"string",format:"duration",check:"string_format",...A(v)})}function JJ($,v){return new $({type:"number",checks:[],...A(v)})}function DJ($,v){return new $({type:"number",coerce:!0,checks:[],...A(v)})}function XJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...A(v)})}function GJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...A(v)})}function YJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...A(v)})}function QJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...A(v)})}function WJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...A(v)})}function HJ($,v){return new $({type:"boolean",...A(v)})}function qJ($,v){return new $({type:"boolean",coerce:!0,...A(v)})}function IJ($,v){return new $({type:"bigint",...A(v)})}function BJ($,v){return new $({type:"bigint",coerce:!0,...A(v)})}function LJ($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...A(v)})}function VJ($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...A(v)})}function jJ($,v){return new $({type:"symbol",...A(v)})}function FJ($,v){return new $({type:"undefined",...A(v)})}function KJ($,v){return new $({type:"null",...A(v)})}function OJ($){return new $({type:"any"})}function NJ($){return new $({type:"unknown"})}function kJ($,v){return new $({type:"never",...A(v)})}function zJ($,v){return new $({type:"void",...A(v)})}function iJ($,v){return new $({type:"date",...A(v)})}function nJ($,v){return new $({type:"date",coerce:!0,...A(v)})}function PJ($,v){return new $({type:"nan",...A(v)})}function r$($,v){return new Lb({check:"less_than",...A(v),value:$,inclusive:!1})}function M$($,v){return new Lb({check:"less_than",...A(v),value:$,inclusive:!0})}function o$($,v){return new Vb({check:"greater_than",...A(v),value:$,inclusive:!1})}function k$($,v){return new Vb({check:"greater_than",...A(v),value:$,inclusive:!0})}function kw($){return o$(0,$)}function zw($){return r$(0,$)}function iw($){return M$(0,$)}function nw($){return k$(0,$)}function Iv($,v){return new f2({check:"multiple_of",...A(v),value:$})}function Bv($,v){return new u2({check:"max_size",...A(v),maximum:$})}function d$($,v){return new R2({check:"min_size",...A(v),minimum:$})}function nv($,v){return new C2({check:"size_equals",...A(v),size:$})}function Pv($,v){return new E2({check:"max_length",...A(v),maximum:$})}function vv($,v){return new Z2({check:"min_length",...A(v),minimum:$})}function Av($,v){return new h2({check:"length_equals",...A(v),length:$})}function ev($,v){return new x2({check:"string_format",format:"regex",...A(v),pattern:$})}function av($){return new l2({check:"string_format",format:"lowercase",...A($)})}function sv($){return new c2({check:"string_format",format:"uppercase",...A($)})}function $_($,v){return new y2({check:"string_format",format:"includes",...A(v),includes:$})}function v_($,v){return new m2({check:"string_format",format:"starts_with",...A(v),prefix:$})}function __($,v){return new r2({check:"string_format",format:"ends_with",...A(v),suffix:$})}function Pw($,v,w){return new o2({check:"property",property:$,schema:v,...A(w)})}function w_($,v){return new d2({check:"mime_type",mime:$,...A(v)})}function l$($){return new t2({check:"overwrite",tx:$})}function g_($){return l$((v)=>v.normalize($))}function b_(){return l$(($)=>$.trim())}function U_(){return l$(($)=>$.toLowerCase())}function J_(){return l$(($)=>$.toUpperCase())}function D_(){return l$(($)=>tU($))}function AJ($,v,w){return new $({type:"array",element:v,...A(w)})}function TB($,v,w){return new $({type:"union",options:v,...A(w)})}function uB($,v,w){return new $({type:"union",options:v,inclusive:!1,...A(w)})}function RB($,v,w,g){return new $({type:"union",options:w,discriminator:v,...A(g)})}function CB($,v,w){return new $({type:"intersection",left:v,right:w})}function EB($,v,w,g){let _=w instanceof o;return new $({type:"tuple",items:v,rest:_?w:null,...A(_?g:w)})}function ZB($,v,w,g){return new $({type:"record",keyType:v,valueType:w,...A(g)})}function hB($,v,w,g){return new $({type:"map",keyType:v,valueType:w,...A(g)})}function xB($,v,w){return new $({type:"set",valueType:v,...A(w)})}function lB($,v,w){let g=Array.isArray(v)?Object.fromEntries(v.map((_)=>[_,_])):v;return new $({type:"enum",entries:g,...A(w)})}function cB($,v,w){return new $({type:"enum",entries:v,...A(w)})}function yB($,v,w){return new $({type:"literal",values:Array.isArray(v)?v:[v],...A(w)})}function MJ($,v){return new $({type:"file",...A(v)})}function mB($,v){return new $({type:"transform",transform:v})}function rB($,v){return new $({type:"optional",innerType:v})}function oB($,v){return new $({type:"nullable",innerType:v})}function dB($,v,w){return new $({type:"default",innerType:v,get defaultValue(){return typeof w==="function"?w():eU(w)}})}function tB($,v,w){return new $({type:"nonoptional",innerType:v,...A(w)})}function pB($,v){return new $({type:"success",innerType:v})}function eB($,v,w){return new $({type:"catch",innerType:v,catchValue:typeof w==="function"?w:()=>w})}function aB($,v,w){return new $({type:"pipe",in:v,out:w})}function sB($,v){return new $({type:"readonly",innerType:v})}function $L($,v,w){return new $({type:"template_literal",parts:v,...A(w)})}function vL($,v){return new $({type:"lazy",getter:v})}function _L($,v){return new $({type:"promise",innerType:v})}function fJ($,v,w){let g=A(w);return g.abort??(g.abort=!0),new $({type:"custom",check:"custom",fn:v,...g})}function SJ($,v,w){return new $({type:"custom",check:"custom",fn:v,...A(w)})}function TJ($){let v=ZG((w)=>{return w.addIssue=(g)=>{if(typeof g==="string")w.issues.push(Bw(g,w.value,v._zod.def));else{let _=g;if(_.fatal)_.continue=!1;_.code??(_.code="custom"),_.input??(_.input=w.value),_.inst??(_.inst=v),_.continue??(_.continue=!v._zod.def.abort),w.issues.push(Bw(_))}},$(w.value,w)});return v}function ZG($,v){let w=new G$({check:"custom",...A(v)});return w._zod.check=$,w}function uJ($){let v=new G$({check:"describe"});return v._zod.onattach=[(w)=>{let g=F$.get(w)??{};F$.add(w,{...g,description:$})}],v._zod.check=()=>{},v}function RJ($){let v=new G$({check:"meta"});return v._zod.onattach=[(w)=>{let g=F$.get(w)??{};F$.add(w,{...g,...$})}],v._zod.check=()=>{},v}function CJ($,v){let w=A(v),g=w.truthy??["true","1","yes","on","y","enabled"],_=w.falsy??["false","0","no","off","n","disabled"];if(w.case!=="sensitive")g=g.map((I)=>typeof I==="string"?I.toLowerCase():I),_=_.map((I)=>typeof I==="string"?I.toLowerCase():I);let b=new Set(g),J=new Set(_),D=$.Codec??w4,X=$.Boolean??v4,Y=new($.String??C_)({type:"string",error:w.error}),Q=new X({type:"boolean",error:w.error}),W=new D({type:"pipe",in:Y,out:Q,transform:(I,H)=>{let q=I;if(w.case!=="sensitive")q=q.toLowerCase();if(b.has(q))return!0;else if(J.has(q))return!1;else return H.issues.push({code:"invalid_value",expected:"stringbool",values:[...b,...J],input:H.value,inst:W,continue:!1}),{}},reverseTransform:(I,H)=>{if(I===!0)return g[0]||"true";else return _[0]||"false"},error:w.error});return W}function Aw($,v,w,g={}){let _=A(g),b={...A(g),check:"string_format",type:"string",format:v,fn:typeof w==="function"?w:(D)=>w.test(D),..._};if(w instanceof RegExp)b.pattern=w;return new $(b)}function X_($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??F$,target:v,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function U$($,v,w={path:[],schemaPath:[]}){var g;let _=$._zod.def,b=v.seen.get($);if(b){if(b.count++,w.schemaPath.includes($))b.cycle=w.path;return b.schema}let J={schema:{},count:1,cycle:void 0,path:w.path};v.seen.set($,J);let D=$._zod.toJSONSchema?.();if(D)J.schema=D;else{let Y={...w,schemaPath:[...w.schemaPath,$],path:w.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(v,J.schema,Y);else{let W=J.schema,I=v.processors[_.type];if(!I)throw Error(`[toJSONSchema]: Non-representable type encountered: ${_.type}`);I($,v,W,Y)}let Q=$._zod.parent;if(Q){if(!J.ref)J.ref=Q;U$(Q,v,Y),v.seen.get(Q).isParent=!0}}let X=v.metadataRegistry.get($);if(X)Object.assign(J.schema,X);if(v.io==="input"&&f$($))delete J.schema.examples,delete J.schema.default;if(v.io==="input"&&J.schema._prefault)(g=J.schema).default??(g.default=J.schema._prefault);return delete J.schema._prefault,v.seen.get($).schema}function G_($,v){let w=$.seen.get(v);if(!w)throw Error("Unprocessed schema. This is a bug in Zod.");let g=new Map;for(let J of $.seen.entries()){let D=$.metadataRegistry.get(J[0])?.id;if(D){let X=g.get(D);if(X&&X!==J[0])throw Error(`Duplicate schema id "${D}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);g.set(D,J[0])}}let _=(J)=>{let D=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let Q=$.external.registry.get(J[0])?.id,W=$.external.uri??((H)=>H);if(Q)return{ref:W(Q)};let I=J[1].defId??J[1].schema.id??`schema${$.counter++}`;return J[1].defId=I,{defId:I,ref:`${W("__shared")}#/${D}/${I}`}}if(J[1]===w)return{ref:"#"};let G=`${"#"}/${D}/`,Y=J[1].schema.id??`__schema${$.counter++}`;return{defId:Y,ref:G+Y}},b=(J)=>{if(J[1].schema.$ref)return;let D=J[1],{ref:X,defId:G}=_(J);if(D.def={...D.schema},G)D.defId=G;let Y=D.schema;for(let Q in Y)delete Y[Q];Y.$ref=X};if($.cycles==="throw")for(let J of $.seen.entries()){let D=J[1];if(D.cycle)throw Error(`Cycle detected: #/${D.cycle?.join("/")}/<root>
177
177
 
178
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let J of $.seen.entries()){let D=J[1];if(v===J[0]){b(J);continue}if($.external){let G=$.external.registry.get(J[0])?.id;if(v!==J[0]&&G){b(J);continue}}if($.metadataRegistry.get(J[0])?.id){b(J);continue}if(D.cycle){b(J);continue}if(D.count>1){if($.reused==="ref"){b(J);continue}}}}function Y_($,v){let w=$.seen.get(v);if(!w)throw Error("Unprocessed schema. This is a bug in Zod.");let g=(J)=>{let D=$.seen.get(J);if(D.ref===null)return;let X=D.def??D.schema,G={...X},Y=D.ref;if(D.ref=null,Y){g(Y);let H=$.seen.get(Y),I=H.schema;if(I.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))X.allOf=X.allOf??[],X.allOf.push(I);else Object.assign(X,I);if(Object.assign(X,G),J._zod.parent===Y)for(let W in X){if(W==="$ref"||W==="allOf")continue;if(!(W in G))delete X[W]}if(I.$ref)for(let W in X){if(W==="$ref"||W==="allOf")continue;if(W in H.def&&JSON.stringify(X[W])===JSON.stringify(H.def[W]))delete X[W]}}let Q=J._zod.parent;if(Q&&Q!==Y){g(Q);let H=$.seen.get(Q);if(H?.schema.$ref){if(X.$ref=H.schema.$ref,H.def)for(let I in X){if(I==="$ref"||I==="allOf")continue;if(I in H.def&&JSON.stringify(X[I])===JSON.stringify(H.def[I]))delete X[I]}}}$.override({zodSchema:J,jsonSchema:X,path:D.path??[]})};for(let J of[...$.seen.entries()].reverse())g(J[0]);let _={};if($.target==="draft-2020-12")_.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")_.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")_.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let J=$.external.registry.get(v)?.id;if(!J)throw Error("Schema is missing an `id` property");_.$id=$.external.uri(J)}Object.assign(_,w.def??w.schema);let b=$.external?.defs??{};for(let J of $.seen.entries()){let D=J[1];if(D.def&&D.defId)b[D.defId]=D.def}if($.external);else if(Object.keys(b).length>0)if($.target==="draft-2020-12")_.$defs=b;else _.definitions=b;try{let J=JSON.parse(JSON.stringify(_));return Object.defineProperty(J,"~standard",{value:{...v["~standard"],jsonSchema:{input:Aw(v,"input",$.processors),output:Aw(v,"output",$.processors)}},enumerable:!1,writable:!1}),J}catch(J){throw Error("Error converting schema to JSON.")}}function S$($,v){let w=v??{seen:new Set};if(w.seen.has($))return!1;w.seen.add($);let g=$._zod.def;if(g.type==="transform")return!0;if(g.type==="array")return S$(g.element,w);if(g.type==="set")return S$(g.valueType,w);if(g.type==="lazy")return S$(g.getter(),w);if(g.type==="promise"||g.type==="optional"||g.type==="nonoptional"||g.type==="nullable"||g.type==="readonly"||g.type==="default"||g.type==="prefault")return S$(g.innerType,w);if(g.type==="intersection")return S$(g.left,w)||S$(g.right,w);if(g.type==="record"||g.type==="map")return S$(g.keyType,w)||S$(g.valueType,w);if(g.type==="pipe")return S$(g.in,w)||S$(g.out,w);if(g.type==="object"){for(let _ in g.shape)if(S$(g.shape[_],w))return!0;return!1}if(g.type==="union"){for(let _ of g.options)if(S$(_,w))return!0;return!1}if(g.type==="tuple"){for(let _ of g.items)if(S$(_,w))return!0;if(g.rest&&S$(g.rest,w))return!0;return!1}return!1}var CJ=($,v={})=>(w)=>{let g=X_({...w,processors:v});return J$($,g),G_(g,$),Y_(g,$)},Aw=($,v,w={})=>(g)=>{let{libraryOptions:_,target:b}=g??{},J=X_({..._??{},target:b,io:v,processors:w});return J$($,J),G_(J,$),Y_(J,$)};var YB={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},EJ=($,v,w,g)=>{let _=w;_.type="string";let{minimum:b,maximum:J,format:D,patterns:X,contentEncoding:G}=$._zod.bag;if(typeof b==="number")_.minLength=b;if(typeof J==="number")_.maxLength=J;if(D){if(_.format=YB[D]??D,_.format==="")delete _.format;if(D==="time")delete _.format}if(G)_.contentEncoding=G;if(X&&X.size>0){let Y=[...X];if(Y.length===1)_.pattern=Y[0].source;else if(Y.length>1)_.allOf=[...Y.map((Q)=>({...v.target==="draft-07"||v.target==="draft-04"||v.target==="openapi-3.0"?{type:"string"}:{},pattern:Q.source}))]}},ZJ=($,v,w,g)=>{let _=w,{minimum:b,maximum:J,format:D,multipleOf:X,exclusiveMaximum:G,exclusiveMinimum:Y}=$._zod.bag;if(typeof D==="string"&&D.includes("int"))_.type="integer";else _.type="number";if(typeof Y==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")_.minimum=Y,_.exclusiveMinimum=!0;else _.exclusiveMinimum=Y;if(typeof b==="number"){if(_.minimum=b,typeof Y==="number"&&v.target!=="draft-04")if(Y>=b)delete _.minimum;else delete _.exclusiveMinimum}if(typeof G==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")_.maximum=G,_.exclusiveMaximum=!0;else _.exclusiveMaximum=G;if(typeof J==="number"){if(_.maximum=J,typeof G==="number"&&v.target!=="draft-04")if(G<=J)delete _.maximum;else delete _.exclusiveMaximum}if(typeof X==="number")_.multipleOf=X},xJ=($,v,w,g)=>{w.type="boolean"},lJ=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},hJ=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},cJ=($,v,w,g)=>{if(v.target==="openapi-3.0")w.type="string",w.nullable=!0,w.enum=[null];else w.type="null"},yJ=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},mJ=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},rJ=($,v,w,g)=>{w.not={}},oJ=($,v,w,g)=>{},tJ=($,v,w,g)=>{},dJ=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},pJ=($,v,w,g)=>{let _=$._zod.def,b=Ww(_.entries);if(b.every((J)=>typeof J==="number"))w.type="number";if(b.every((J)=>typeof J==="string"))w.type="string";w.enum=b},eJ=($,v,w,g)=>{let _=$._zod.def,b=[];for(let J of _.values)if(J===void 0){if(v.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof J==="bigint")if(v.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else b.push(Number(J));else b.push(J);if(b.length===0);else if(b.length===1){let J=b[0];if(w.type=J===null?"null":typeof J,v.target==="draft-04"||v.target==="openapi-3.0")w.enum=[J];else w.const=J}else{if(b.every((J)=>typeof J==="number"))w.type="number";if(b.every((J)=>typeof J==="string"))w.type="string";if(b.every((J)=>typeof J==="boolean"))w.type="boolean";if(b.every((J)=>J===null))w.type="null";w.enum=b}},aJ=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},sJ=($,v,w,g)=>{let _=w,b=$._zod.pattern;if(!b)throw Error("Pattern not found in template literal");_.type="string",_.pattern=b.source},$D=($,v,w,g)=>{let _=w,b={type:"string",format:"binary",contentEncoding:"binary"},{minimum:J,maximum:D,mime:X}=$._zod.bag;if(J!==void 0)b.minLength=J;if(D!==void 0)b.maxLength=D;if(X)if(X.length===1)b.contentMediaType=X[0],Object.assign(_,b);else Object.assign(_,b),_.anyOf=X.map((G)=>({contentMediaType:G}));else Object.assign(_,b)},vD=($,v,w,g)=>{w.type="boolean"},_D=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},wD=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},gD=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},bD=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},UD=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},JD=($,v,w,g)=>{let _=w,b=$._zod.def,{minimum:J,maximum:D}=$._zod.bag;if(typeof J==="number")_.minItems=J;if(typeof D==="number")_.maxItems=D;_.type="array",_.items=J$(b.element,v,{...g,path:[...g.path,"items"]})},DD=($,v,w,g)=>{let _=w,b=$._zod.def;_.type="object",_.properties={};let J=b.shape;for(let G in J)_.properties[G]=J$(J[G],v,{...g,path:[...g.path,"properties",G]});let D=new Set(Object.keys(J)),X=new Set([...D].filter((G)=>{let Y=b.shape[G]._zod;if(v.io==="input")return Y.optin===void 0;else return Y.optout===void 0}));if(X.size>0)_.required=Array.from(X);if(b.catchall?._zod.def.type==="never")_.additionalProperties=!1;else if(!b.catchall){if(v.io==="output")_.additionalProperties=!1}else if(b.catchall)_.additionalProperties=J$(b.catchall,v,{...g,path:[...g.path,"additionalProperties"]})},d1=($,v,w,g)=>{let _=$._zod.def,b=_.inclusive===!1,J=_.options.map((D,X)=>J$(D,v,{...g,path:[...g.path,b?"oneOf":"anyOf",X]}));if(b)w.oneOf=J;else w.anyOf=J},XD=($,v,w,g)=>{let _=$._zod.def,b=J$(_.left,v,{...g,path:[...g.path,"allOf",0]}),J=J$(_.right,v,{...g,path:[...g.path,"allOf",1]}),D=(G)=>("allOf"in G)&&Object.keys(G).length===1,X=[...D(b)?b.allOf:[b],...D(J)?J.allOf:[J]];w.allOf=X},GD=($,v,w,g)=>{let _=w,b=$._zod.def;_.type="array";let J=v.target==="draft-2020-12"?"prefixItems":"items",D=v.target==="draft-2020-12"?"items":v.target==="openapi-3.0"?"items":"additionalItems",X=b.items.map((H,I)=>J$(H,v,{...g,path:[...g.path,J,I]})),G=b.rest?J$(b.rest,v,{...g,path:[...g.path,D,...v.target==="openapi-3.0"?[b.items.length]:[]]}):null;if(v.target==="draft-2020-12"){if(_.prefixItems=X,G)_.items=G}else if(v.target==="openapi-3.0"){if(_.items={anyOf:X},G)_.items.anyOf.push(G);if(_.minItems=X.length,!G)_.maxItems=X.length}else if(_.items=X,G)_.additionalItems=G;let{minimum:Y,maximum:Q}=$._zod.bag;if(typeof Y==="number")_.minItems=Y;if(typeof Q==="number")_.maxItems=Q},YD=($,v,w,g)=>{let _=w,b=$._zod.def;if(_.type="object",v.target==="draft-07"||v.target==="draft-2020-12")_.propertyNames=J$(b.keyType,v,{...g,path:[...g.path,"propertyNames"]});_.additionalProperties=J$(b.valueType,v,{...g,path:[...g.path,"additionalProperties"]});let J=b.keyType._zod.def;if(J.type==="enum"){let X=Ww(J.entries).filter((G)=>typeof G==="string"||typeof G==="number");if(X.length>0)_.required=X}},QD=($,v,w,g)=>{let _=$._zod.def,b=J$(_.innerType,v,g),J=v.seen.get($);if(v.target==="openapi-3.0")J.ref=_.innerType,w.nullable=!0;else w.anyOf=[b,{type:"null"}]},WD=($,v,w,g)=>{let _=$._zod.def;J$(_.innerType,v,g);let b=v.seen.get($);b.ref=_.innerType},HD=($,v,w,g)=>{let _=$._zod.def;J$(_.innerType,v,g);let b=v.seen.get($);b.ref=_.innerType,w.default=JSON.parse(JSON.stringify(_.defaultValue))},nD=($,v,w,g)=>{let _=$._zod.def;J$(_.innerType,v,g);let b=v.seen.get($);if(b.ref=_.innerType,v.io==="input")w._prefault=JSON.parse(JSON.stringify(_.defaultValue))},qD=($,v,w,g)=>{let _=$._zod.def;J$(_.innerType,v,g);let b=v.seen.get($);b.ref=_.innerType;let J;try{J=_.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}w.default=J},ID=($,v,w,g)=>{let _=$._zod.def,b=v.io==="input"?_.in._zod.def.type==="transform"?_.out:_.in:_.out;J$(b,v,g);let J=v.seen.get($);J.ref=b},BD=($,v,w,g)=>{let _=$._zod.def;J$(_.innerType,v,g);let b=v.seen.get($);b.ref=_.innerType,w.readOnly=!0},LD=($,v,w,g)=>{let _=$._zod.def;J$(_.innerType,v,g);let b=v.seen.get($);b.ref=_.innerType},p1=($,v,w,g)=>{let _=$._zod.def;J$(_.innerType,v,g);let b=v.seen.get($);b.ref=_.innerType},VD=($,v,w,g)=>{let _=$._zod.innerType;J$(_,v,g);let b=v.seen.get($);b.ref=_},t1={string:EJ,number:ZJ,boolean:xJ,bigint:lJ,symbol:hJ,null:cJ,undefined:yJ,void:mJ,never:rJ,any:oJ,unknown:tJ,date:dJ,enum:pJ,literal:eJ,nan:aJ,template_literal:sJ,file:$D,success:vD,custom:_D,function:wD,transform:gD,map:bD,set:UD,array:JD,object:DD,union:d1,intersection:XD,tuple:GD,record:YD,nullable:QD,nonoptional:WD,default:HD,prefault:nD,catch:qD,pipe:ID,readonly:BD,promise:LD,optional:p1,lazy:VD};function Mw($,v){if("_idmap"in $){let g=$,_=X_({...v,processors:t1}),b={};for(let X of g._idmap.entries()){let[G,Y]=X;J$(Y,_)}let J={},D={registry:g,uri:v?.uri,defs:b};_.external=D;for(let X of g._idmap.entries()){let[G,Y]=X;G_(_,Y),J[G]=Y_(_,Y)}if(Object.keys(b).length>0){let X=_.target==="draft-2020-12"?"$defs":"definitions";J.__shared={[X]:b}}return{schemas:J}}let w=X_({...v,processors:t1});return J$($,w),G_(w,$),Y_(w,$)}class jD{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($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";this.ctx=X_({processors:t1,target:v,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,v={path:[],schemaPath:[]}){return J$($,this.ctx,v)}emit($,v){if(v){if(v.cycles)this.ctx.cycles=v.cycles;if(v.reused)this.ctx.reused=v.reused;if(v.external)this.ctx.external=v.external}G_(this.ctx,$);let w=Y_(this.ctx,$),{"~standard":g,..._}=w;return _}}var T8={};var Q4={};$v(Q4,{xor:()=>lb,xid:()=>Yb,void:()=>Rb,uuidv7:()=>wb,uuidv6:()=>_b,uuidv4:()=>vb,uuid:()=>$b,url:()=>gb,unknown:()=>N$,union:()=>zv,undefined:()=>ub,ulid:()=>Gb,uint64:()=>zb,uint32:()=>fb,tuple:()=>o_,transform:()=>_6,templateLiteral:()=>ab,symbol:()=>Sb,superRefine:()=>Yg,success:()=>db,stringbool:()=>U0,stringFormat:()=>Fb,string:()=>F,strictObject:()=>Zb,set:()=>mb,refine:()=>Gg,record:()=>Bv,readonly:()=>gg,promise:()=>sb,preprocess:()=>D0,prefault:()=>e4,pipe:()=>h_,partialRecord:()=>hb,optional:()=>x_,object:()=>u,number:()=>H$,nullish:()=>tb,nullable:()=>l_,null:()=>f4,nonoptional:()=>a4,never:()=>v6,nativeEnum:()=>rb,nanoid:()=>Jb,nan:()=>pb,meta:()=>g0,map:()=>yb,mac:()=>Hb,looseRecord:()=>cb,looseObject:()=>xb,literal:()=>q$,lazy:()=>Jg,ksuid:()=>Qb,keyof:()=>Eb,jwt:()=>jb,json:()=>J0,ipv6:()=>nb,ipv4:()=>Wb,intersection:()=>E4,int64:()=>Mb,int32:()=>Pb,int:()=>Rw,instanceof:()=>b0,httpUrl:()=>bb,hostname:()=>Kb,hex:()=>Ob,hash:()=>ib,guid:()=>s1,function:()=>$0,float64:()=>Nb,float32:()=>kb,file:()=>ob,exactOptional:()=>r4,enum:()=>v$,emoji:()=>Ub,email:()=>a1,e164:()=>Vb,discriminatedUnion:()=>Sv,describe:()=>w0,date:()=>Cb,custom:()=>_0,cuid2:()=>Xb,cuid:()=>Db,codec:()=>eb,cidrv6:()=>Ib,cidrv4:()=>qb,check:()=>v0,catch:()=>vg,boolean:()=>W$,bigint:()=>Ab,base64url:()=>Lb,base64:()=>Bb,array:()=>g$,any:()=>Tb,_function:()=>$0,_default:()=>d4,_ZodString:()=>Cw,ZodXor:()=>T4,ZodXID:()=>yw,ZodVoid:()=>S4,ZodUnknown:()=>M4,ZodUnion:()=>r_,ZodUndefined:()=>N4,ZodUUID:()=>d$,ZodURL:()=>c_,ZodULID:()=>cw,ZodType:()=>t,ZodTuple:()=>Z4,ZodTransform:()=>y4,ZodTemplateLiteral:()=>bg,ZodSymbol:()=>k4,ZodSuccess:()=>s4,ZodStringFormat:()=>b$,ZodString:()=>H_,ZodSet:()=>l4,ZodRecord:()=>t_,ZodReadonly:()=>wg,ZodPromise:()=>Dg,ZodPrefault:()=>p4,ZodPipe:()=>b6,ZodOptional:()=>w6,ZodObject:()=>m_,ZodNumberFormat:()=>Mv,ZodNumber:()=>q_,ZodNullable:()=>o4,ZodNull:()=>P4,ZodNonOptional:()=>g6,ZodNever:()=>z4,ZodNanoID:()=>xw,ZodNaN:()=>_g,ZodMap:()=>x4,ZodMAC:()=>i4,ZodLiteral:()=>h4,ZodLazy:()=>Ug,ZodKSUID:()=>mw,ZodJWT:()=>sw,ZodIntersection:()=>C4,ZodIPv6:()=>ow,ZodIPv4:()=>rw,ZodGUID:()=>Z_,ZodFunction:()=>Xg,ZodFile:()=>c4,ZodExactOptional:()=>m4,ZodEnum:()=>W_,ZodEmoji:()=>Zw,ZodEmail:()=>Ew,ZodE164:()=>aw,ZodDiscriminatedUnion:()=>R4,ZodDefault:()=>t4,ZodDate:()=>y_,ZodCustomStringFormat:()=>n_,ZodCustom:()=>d_,ZodCodec:()=>U6,ZodCatch:()=>$g,ZodCUID2:()=>hw,ZodCUID:()=>lw,ZodCIDRv6:()=>dw,ZodCIDRv4:()=>tw,ZodBoolean:()=>I_,ZodBigIntFormat:()=>$6,ZodBigInt:()=>B_,ZodBase64URL:()=>ew,ZodBase64:()=>pw,ZodArray:()=>u4,ZodAny:()=>A4});var e1={};$v(e1,{uppercase:()=>sv,trim:()=>b_,toUpperCase:()=>J_,toLowerCase:()=>U_,startsWith:()=>v_,slugify:()=>D_,size:()=>Pv,regex:()=>ev,property:()=>Pw,positive:()=>Ow,overwrite:()=>h$,normalize:()=>g_,nonpositive:()=>kw,nonnegative:()=>Nw,negative:()=>iw,multipleOf:()=>qv,minSize:()=>t$,minLength:()=>vv,mime:()=>w_,maxSize:()=>Iv,maxLength:()=>fv,lte:()=>z$,lt:()=>r$,lowercase:()=>av,length:()=>Av,includes:()=>$_,gte:()=>k$,gt:()=>o$,endsWith:()=>__});var Q_={};$v(Q_,{time:()=>OD,duration:()=>iD,datetime:()=>FD,date:()=>KD,ZodISOTime:()=>uw,ZodISODuration:()=>Tw,ZodISODateTime:()=>zw,ZodISODate:()=>Sw});var zw=V("ZodISODateTime",($,v)=>{D3.init($,v),b$.init($,v)});function FD($){return _J(zw,$)}var Sw=V("ZodISODate",($,v)=>{X3.init($,v),b$.init($,v)});function KD($){return wJ(Sw,$)}var uw=V("ZodISOTime",($,v)=>{G3.init($,v),b$.init($,v)});function OD($){return gJ(uw,$)}var Tw=V("ZodISODuration",($,v)=>{Y3.init($,v),b$.init($,v)});function iD($){return bJ(Tw,$)}var R8=($,v)=>{t6.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(w)=>T_($,w)},flatten:{value:(w)=>u_($,w)},addIssue:{value:(w)=>{$.issues.push(w),$.message=JSON.stringify($.issues,Hw,2)}},addIssues:{value:(w)=>{$.issues.push(...w),$.message=JSON.stringify($.issues,Hw,2)}},isEmpty:{get(){return $.issues.length===0}}})},kD=V("ZodError",R8),P$=V("ZodError",R8,{Parent:Error});var W4=Iw(P$),H4=Bw(P$),n4=Lw(P$),q4=Vw(P$),I4=J1(P$),B4=D1(P$),L4=X1(P$),V4=G1(P$),j4=Y1(P$),F4=Q1(P$),K4=W1(P$),O4=H1(P$);var t=V("ZodType",($,v)=>{return o.init($,v),Object.assign($["~standard"],{jsonSchema:{input:Aw($,"input"),output:Aw($,"output")}}),$.toJSONSchema=CJ($,{}),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.check=(...w)=>{return $.clone(N.mergeDefs(v,{checks:[...v.checks??[],...w.map((g)=>typeof g==="function"?{_zod:{check:g,def:{check:"custom"},onattach:[]}}:g)]}),{parent:!0})},$.with=$.check,$.clone=(w,g)=>i$($,w,g),$.brand=()=>$,$.register=(w,g)=>{return w.add($,g),$},$.parse=(w,g)=>W4($,w,g,{callee:$.parse}),$.safeParse=(w,g)=>n4($,w,g),$.parseAsync=async(w,g)=>H4($,w,g,{callee:$.parseAsync}),$.safeParseAsync=async(w,g)=>q4($,w,g),$.spa=$.safeParseAsync,$.encode=(w,g)=>I4($,w,g),$.decode=(w,g)=>B4($,w,g),$.encodeAsync=async(w,g)=>L4($,w,g),$.decodeAsync=async(w,g)=>V4($,w,g),$.safeEncode=(w,g)=>j4($,w,g),$.safeDecode=(w,g)=>F4($,w,g),$.safeEncodeAsync=async(w,g)=>K4($,w,g),$.safeDecodeAsync=async(w,g)=>O4($,w,g),$.refine=(w,g)=>$.check(Gg(w,g)),$.superRefine=(w)=>$.check(Yg(w)),$.overwrite=(w)=>$.check(h$(w)),$.optional=()=>x_($),$.exactOptional=()=>r4($),$.nullable=()=>l_($),$.nullish=()=>x_(l_($)),$.nonoptional=(w)=>a4($,w),$.array=()=>g$($),$.or=(w)=>zv([$,w]),$.and=(w)=>E4($,w),$.transform=(w)=>h_($,_6(w)),$.default=(w)=>d4($,w),$.prefault=(w)=>e4($,w),$.catch=(w)=>vg($,w),$.pipe=(w)=>h_($,w),$.readonly=()=>gg($),$.describe=(w)=>{let g=$.clone();return j$.add(g,{description:w}),g},Object.defineProperty($,"description",{get(){return j$.get($)?.description},configurable:!0}),$.meta=(...w)=>{if(w.length===0)return j$.get($);let g=$.clone();return j$.add(g,w[0]),g},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(w)=>w($),$}),Cw=V("_ZodString",($,v)=>{C_.init($,v),t.init($,v),$._zod.processJSONSchema=(g,_,b)=>EJ($,g,_,b);let w=$._zod.bag;$.format=w.format??null,$.minLength=w.minimum??null,$.maxLength=w.maximum??null,$.regex=(...g)=>$.check(ev(...g)),$.includes=(...g)=>$.check($_(...g)),$.startsWith=(...g)=>$.check(v_(...g)),$.endsWith=(...g)=>$.check(__(...g)),$.min=(...g)=>$.check(vv(...g)),$.max=(...g)=>$.check(fv(...g)),$.length=(...g)=>$.check(Av(...g)),$.nonempty=(...g)=>$.check(vv(1,...g)),$.lowercase=(g)=>$.check(av(g)),$.uppercase=(g)=>$.check(sv(g)),$.trim=()=>$.check(b_()),$.normalize=(...g)=>$.check(g_(...g)),$.toLowerCase=()=>$.check(U_()),$.toUpperCase=()=>$.check(J_()),$.slugify=()=>$.check(D_())}),H_=V("ZodString",($,v)=>{C_.init($,v),Cw.init($,v),$.email=(w)=>$.check(P1(Ew,w)),$.url=(w)=>$.check(G4(c_,w)),$.jwt=(w)=>$.check(o1(sw,w)),$.emoji=(w)=>$.check(S1(Zw,w)),$.guid=(w)=>$.check(X4(Z_,w)),$.uuid=(w)=>$.check(f1(d$,w)),$.uuidv4=(w)=>$.check(A1(d$,w)),$.uuidv6=(w)=>$.check(M1(d$,w)),$.uuidv7=(w)=>$.check(z1(d$,w)),$.nanoid=(w)=>$.check(u1(xw,w)),$.guid=(w)=>$.check(X4(Z_,w)),$.cuid=(w)=>$.check(T1(lw,w)),$.cuid2=(w)=>$.check(R1(hw,w)),$.ulid=(w)=>$.check(C1(cw,w)),$.base64=(w)=>$.check(y1(pw,w)),$.base64url=(w)=>$.check(m1(ew,w)),$.xid=(w)=>$.check(E1(yw,w)),$.ksuid=(w)=>$.check(Z1(mw,w)),$.ipv4=(w)=>$.check(x1(rw,w)),$.ipv6=(w)=>$.check(l1(ow,w)),$.cidrv4=(w)=>$.check(h1(tw,w)),$.cidrv6=(w)=>$.check(c1(dw,w)),$.e164=(w)=>$.check(r1(aw,w)),$.datetime=(w)=>$.check(FD(w)),$.date=(w)=>$.check(KD(w)),$.time=(w)=>$.check(OD(w)),$.duration=(w)=>$.check(iD(w))});function F($){return s9(H_,$)}var b$=V("ZodStringFormat",($,v)=>{X$.init($,v),Cw.init($,v)}),Ew=V("ZodEmail",($,v)=>{s2.init($,v),b$.init($,v)});function a1($){return P1(Ew,$)}var Z_=V("ZodGUID",($,v)=>{e2.init($,v),b$.init($,v)});function s1($){return X4(Z_,$)}var d$=V("ZodUUID",($,v)=>{a2.init($,v),b$.init($,v)});function $b($){return f1(d$,$)}function vb($){return A1(d$,$)}function _b($){return M1(d$,$)}function wb($){return z1(d$,$)}var c_=V("ZodURL",($,v)=>{$3.init($,v),b$.init($,v)});function gb($){return G4(c_,$)}function bb($){return G4(c_,{protocol:/^https?$/,hostname:E$.domain,...N.normalizeParams($)})}var Zw=V("ZodEmoji",($,v)=>{v3.init($,v),b$.init($,v)});function Ub($){return S1(Zw,$)}var xw=V("ZodNanoID",($,v)=>{_3.init($,v),b$.init($,v)});function Jb($){return u1(xw,$)}var lw=V("ZodCUID",($,v)=>{w3.init($,v),b$.init($,v)});function Db($){return T1(lw,$)}var hw=V("ZodCUID2",($,v)=>{g3.init($,v),b$.init($,v)});function Xb($){return R1(hw,$)}var cw=V("ZodULID",($,v)=>{b3.init($,v),b$.init($,v)});function Gb($){return C1(cw,$)}var yw=V("ZodXID",($,v)=>{U3.init($,v),b$.init($,v)});function Yb($){return E1(yw,$)}var mw=V("ZodKSUID",($,v)=>{J3.init($,v),b$.init($,v)});function Qb($){return Z1(mw,$)}var rw=V("ZodIPv4",($,v)=>{Q3.init($,v),b$.init($,v)});function Wb($){return x1(rw,$)}var i4=V("ZodMAC",($,v)=>{H3.init($,v),b$.init($,v)});function Hb($){return vJ(i4,$)}var ow=V("ZodIPv6",($,v)=>{W3.init($,v),b$.init($,v)});function nb($){return l1(ow,$)}var tw=V("ZodCIDRv4",($,v)=>{n3.init($,v),b$.init($,v)});function qb($){return h1(tw,$)}var dw=V("ZodCIDRv6",($,v)=>{q3.init($,v),b$.init($,v)});function Ib($){return c1(dw,$)}var pw=V("ZodBase64",($,v)=>{B3.init($,v),b$.init($,v)});function Bb($){return y1(pw,$)}var ew=V("ZodBase64URL",($,v)=>{L3.init($,v),b$.init($,v)});function Lb($){return m1(ew,$)}var aw=V("ZodE164",($,v)=>{V3.init($,v),b$.init($,v)});function Vb($){return r1(aw,$)}var sw=V("ZodJWT",($,v)=>{j3.init($,v),b$.init($,v)});function jb($){return o1(sw,$)}var n_=V("ZodCustomStringFormat",($,v)=>{F3.init($,v),b$.init($,v)});function Fb($,v,w={}){return fw(n_,$,v,w)}function Kb($){return fw(n_,"hostname",E$.hostname,$)}function Ob($){return fw(n_,"hex",E$.hex,$)}function ib($,v){let w=v?.enc??"hex",g=`${$}_${w}`,_=E$[g];if(!_)throw Error(`Unrecognized hash format: ${g}`);return fw(n_,g,_,v)}var q_=V("ZodNumber",($,v)=>{O1.init($,v),t.init($,v),$._zod.processJSONSchema=(g,_,b)=>ZJ($,g,_,b),$.gt=(g,_)=>$.check(o$(g,_)),$.gte=(g,_)=>$.check(k$(g,_)),$.min=(g,_)=>$.check(k$(g,_)),$.lt=(g,_)=>$.check(r$(g,_)),$.lte=(g,_)=>$.check(z$(g,_)),$.max=(g,_)=>$.check(z$(g,_)),$.int=(g)=>$.check(Rw(g)),$.safe=(g)=>$.check(Rw(g)),$.positive=(g)=>$.check(o$(0,g)),$.nonnegative=(g)=>$.check(k$(0,g)),$.negative=(g)=>$.check(r$(0,g)),$.nonpositive=(g)=>$.check(z$(0,g)),$.multipleOf=(g,_)=>$.check(qv(g,_)),$.step=(g,_)=>$.check(qv(g,_)),$.finite=()=>$;let w=$._zod.bag;$.minValue=Math.max(w.minimum??Number.NEGATIVE_INFINITY,w.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(w.maximum??Number.POSITIVE_INFINITY,w.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(w.format??"").includes("int")||Number.isSafeInteger(w.multipleOf??0.5),$.isFinite=!0,$.format=w.format??null});function H$($){return UJ(q_,$)}var Mv=V("ZodNumberFormat",($,v)=>{K3.init($,v),q_.init($,v)});function Rw($){return DJ(Mv,$)}function kb($){return XJ(Mv,$)}function Nb($){return GJ(Mv,$)}function Pb($){return YJ(Mv,$)}function fb($){return QJ(Mv,$)}var I_=V("ZodBoolean",($,v)=>{$4.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>xJ($,w,g,_)});function W$($){return WJ(I_,$)}var B_=V("ZodBigInt",($,v)=>{i1.init($,v),t.init($,v),$._zod.processJSONSchema=(g,_,b)=>lJ($,g,_,b),$.gte=(g,_)=>$.check(k$(g,_)),$.min=(g,_)=>$.check(k$(g,_)),$.gt=(g,_)=>$.check(o$(g,_)),$.gte=(g,_)=>$.check(k$(g,_)),$.min=(g,_)=>$.check(k$(g,_)),$.lt=(g,_)=>$.check(r$(g,_)),$.lte=(g,_)=>$.check(z$(g,_)),$.max=(g,_)=>$.check(z$(g,_)),$.positive=(g)=>$.check(o$(BigInt(0),g)),$.negative=(g)=>$.check(r$(BigInt(0),g)),$.nonpositive=(g)=>$.check(z$(BigInt(0),g)),$.nonnegative=(g)=>$.check(k$(BigInt(0),g)),$.multipleOf=(g,_)=>$.check(qv(g,_));let w=$._zod.bag;$.minValue=w.minimum??null,$.maxValue=w.maximum??null,$.format=w.format??null});function Ab($){return nJ(B_,$)}var $6=V("ZodBigIntFormat",($,v)=>{O3.init($,v),B_.init($,v)});function Mb($){return IJ($6,$)}function zb($){return BJ($6,$)}var k4=V("ZodSymbol",($,v)=>{i3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>hJ($,w,g,_)});function Sb($){return LJ(k4,$)}var N4=V("ZodUndefined",($,v)=>{k3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>yJ($,w,g,_)});function ub($){return VJ(N4,$)}var P4=V("ZodNull",($,v)=>{N3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>cJ($,w,g,_)});function f4($){return jJ(P4,$)}var A4=V("ZodAny",($,v)=>{P3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>oJ($,w,g,_)});function Tb(){return FJ(A4)}var M4=V("ZodUnknown",($,v)=>{f3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>tJ($,w,g,_)});function N$(){return KJ(M4)}var z4=V("ZodNever",($,v)=>{A3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>rJ($,w,g,_)});function v6($){return OJ(z4,$)}var S4=V("ZodVoid",($,v)=>{M3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>mJ($,w,g,_)});function Rb($){return iJ(S4,$)}var y_=V("ZodDate",($,v)=>{z3.init($,v),t.init($,v),$._zod.processJSONSchema=(g,_,b)=>dJ($,g,_,b),$.min=(g,_)=>$.check(k$(g,_)),$.max=(g,_)=>$.check(z$(g,_));let w=$._zod.bag;$.minDate=w.minimum?new Date(w.minimum):null,$.maxDate=w.maximum?new Date(w.maximum):null});function Cb($){return kJ(y_,$)}var u4=V("ZodArray",($,v)=>{S3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>JD($,w,g,_),$.element=v.element,$.min=(w,g)=>$.check(vv(w,g)),$.nonempty=(w)=>$.check(vv(1,w)),$.max=(w,g)=>$.check(fv(w,g)),$.length=(w,g)=>$.check(Av(w,g)),$.unwrap=()=>$.element});function g$($,v){return fJ(u4,$,v)}function Eb($){let v=$._zod.def.shape;return v$(Object.keys(v))}var m_=V("ZodObject",($,v)=>{u3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>DD($,w,g,_),N.defineLazy($,"shape",()=>{return v.shape}),$.keyof=()=>v$(Object.keys($._zod.def.shape)),$.catchall=(w)=>$.clone({...$._zod.def,catchall:w}),$.passthrough=()=>$.clone({...$._zod.def,catchall:N$()}),$.loose=()=>$.clone({...$._zod.def,catchall:N$()}),$.strict=()=>$.clone({...$._zod.def,catchall:v6()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(w)=>{return N.extend($,w)},$.safeExtend=(w)=>{return N.safeExtend($,w)},$.merge=(w)=>N.merge($,w),$.pick=(w)=>N.pick($,w),$.omit=(w)=>N.omit($,w),$.partial=(...w)=>N.partial(w6,$,w[0]),$.required=(...w)=>N.required(g6,$,w[0])});function u($,v){let w={type:"object",shape:$??{},...N.normalizeParams(v)};return new m_(w)}function Zb($,v){return new m_({type:"object",shape:$,catchall:v6(),...N.normalizeParams(v)})}function xb($,v){return new m_({type:"object",shape:$,catchall:N$(),...N.normalizeParams(v)})}var r_=V("ZodUnion",($,v)=>{v4.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>d1($,w,g,_),$.options=v.options});function zv($,v){return new r_({type:"union",options:$,...N.normalizeParams(v)})}var T4=V("ZodXor",($,v)=>{r_.init($,v),T3.init($,v),$._zod.processJSONSchema=(w,g,_)=>d1($,w,g,_),$.options=v.options});function lb($,v){return new T4({type:"union",options:$,inclusive:!1,...N.normalizeParams(v)})}var R4=V("ZodDiscriminatedUnion",($,v)=>{r_.init($,v),R3.init($,v)});function Sv($,v,w){return new R4({type:"union",options:v,discriminator:$,...N.normalizeParams(w)})}var C4=V("ZodIntersection",($,v)=>{C3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>XD($,w,g,_)});function E4($,v){return new C4({type:"intersection",left:$,right:v})}var Z4=V("ZodTuple",($,v)=>{k1.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>GD($,w,g,_),$.rest=(w)=>$.clone({...$._zod.def,rest:w})});function o_($,v,w){let g=v instanceof o,_=g?w:v;return new Z4({type:"tuple",items:$,rest:g?v:null,...N.normalizeParams(_)})}var t_=V("ZodRecord",($,v)=>{E3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>YD($,w,g,_),$.keyType=v.keyType,$.valueType=v.valueType});function Bv($,v,w){return new t_({type:"record",keyType:$,valueType:v,...N.normalizeParams(w)})}function hb($,v,w){let g=i$($);return g._zod.values=void 0,new t_({type:"record",keyType:g,valueType:v,...N.normalizeParams(w)})}function cb($,v,w){return new t_({type:"record",keyType:$,valueType:v,mode:"loose",...N.normalizeParams(w)})}var x4=V("ZodMap",($,v)=>{Z3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>bD($,w,g,_),$.keyType=v.keyType,$.valueType=v.valueType,$.min=(...w)=>$.check(t$(...w)),$.nonempty=(w)=>$.check(t$(1,w)),$.max=(...w)=>$.check(Iv(...w)),$.size=(...w)=>$.check(Pv(...w))});function yb($,v,w){return new x4({type:"map",keyType:$,valueType:v,...N.normalizeParams(w)})}var l4=V("ZodSet",($,v)=>{x3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>UD($,w,g,_),$.min=(...w)=>$.check(t$(...w)),$.nonempty=(w)=>$.check(t$(1,w)),$.max=(...w)=>$.check(Iv(...w)),$.size=(...w)=>$.check(Pv(...w))});function mb($,v){return new l4({type:"set",valueType:$,...N.normalizeParams(v)})}var W_=V("ZodEnum",($,v)=>{l3.init($,v),t.init($,v),$._zod.processJSONSchema=(g,_,b)=>pJ($,g,_,b),$.enum=v.entries,$.options=Object.values(v.entries);let w=new Set(Object.keys(v.entries));$.extract=(g,_)=>{let b={};for(let J of g)if(w.has(J))b[J]=v.entries[J];else throw Error(`Key ${J} not found in enum`);return new W_({...v,checks:[],...N.normalizeParams(_),entries:b})},$.exclude=(g,_)=>{let b={...v.entries};for(let J of g)if(w.has(J))delete b[J];else throw Error(`Key ${J} not found in enum`);return new W_({...v,checks:[],...N.normalizeParams(_),entries:b})}});function v$($,v){let w=Array.isArray($)?Object.fromEntries($.map((g)=>[g,g])):$;return new W_({type:"enum",entries:w,...N.normalizeParams(v)})}function rb($,v){return new W_({type:"enum",entries:$,...N.normalizeParams(v)})}var h4=V("ZodLiteral",($,v)=>{h3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>eJ($,w,g,_),$.values=new Set(v.values),Object.defineProperty($,"value",{get(){if(v.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return v.values[0]}})});function q$($,v){return new h4({type:"literal",values:Array.isArray($)?$:[$],...N.normalizeParams(v)})}var c4=V("ZodFile",($,v)=>{c3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>$D($,w,g,_),$.min=(w,g)=>$.check(t$(w,g)),$.max=(w,g)=>$.check(Iv(w,g)),$.mime=(w,g)=>$.check(w_(Array.isArray(w)?w:[w],g))});function ob($){return AJ(c4,$)}var y4=V("ZodTransform",($,v)=>{y3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>gD($,w,g,_),$._zod.parse=(w,g)=>{if(g.direction==="backward")throw new z_($.constructor.name);w.addIssue=(b)=>{if(typeof b==="string")w.issues.push(N.issue(b,w.value,v));else{let J=b;if(J.fatal)J.continue=!1;J.code??(J.code="custom"),J.input??(J.input=w.value),J.inst??(J.inst=$),w.issues.push(N.issue(J))}};let _=v.transform(w.value,w);if(_ instanceof Promise)return _.then((b)=>{return w.value=b,w});return w.value=_,w}});function _6($){return new y4({type:"transform",transform:$})}var w6=V("ZodOptional",($,v)=>{N1.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>p1($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function x_($){return new w6({type:"optional",innerType:$})}var m4=V("ZodExactOptional",($,v)=>{m3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>p1($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function r4($){return new m4({type:"optional",innerType:$})}var o4=V("ZodNullable",($,v)=>{r3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>QD($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function l_($){return new o4({type:"nullable",innerType:$})}function tb($){return x_(l_($))}var t4=V("ZodDefault",($,v)=>{o3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>HD($,w,g,_),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function d4($,v){return new t4({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():N.shallowClone(v)}})}var p4=V("ZodPrefault",($,v)=>{t3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>nD($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function e4($,v){return new p4({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():N.shallowClone(v)}})}var g6=V("ZodNonOptional",($,v)=>{d3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>WD($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function a4($,v){return new g6({type:"nonoptional",innerType:$,...N.normalizeParams(v)})}var s4=V("ZodSuccess",($,v)=>{p3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>vD($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function db($){return new s4({type:"success",innerType:$})}var $g=V("ZodCatch",($,v)=>{e3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>qD($,w,g,_),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function vg($,v){return new $g({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}var _g=V("ZodNaN",($,v)=>{a3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>aJ($,w,g,_)});function pb($){return PJ(_g,$)}var b6=V("ZodPipe",($,v)=>{s3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>ID($,w,g,_),$.in=v.in,$.out=v.out});function h_($,v){return new b6({type:"pipe",in:$,out:v})}var U6=V("ZodCodec",($,v)=>{b6.init($,v),_4.init($,v)});function eb($,v,w){return new U6({type:"pipe",in:$,out:v,transform:w.decode,reverseTransform:w.encode})}var wg=V("ZodReadonly",($,v)=>{$9.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>BD($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function gg($){return new wg({type:"readonly",innerType:$})}var bg=V("ZodTemplateLiteral",($,v)=>{v9.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>sJ($,w,g,_)});function ab($,v){return new bg({type:"template_literal",parts:$,...N.normalizeParams(v)})}var Ug=V("ZodLazy",($,v)=>{g9.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>VD($,w,g,_),$.unwrap=()=>$._zod.def.getter()});function Jg($){return new Ug({type:"lazy",getter:$})}var Dg=V("ZodPromise",($,v)=>{w9.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>LD($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function sb($){return new Dg({type:"promise",innerType:$})}var Xg=V("ZodFunction",($,v)=>{_9.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>wD($,w,g,_)});function $0($){return new Xg({type:"function",input:Array.isArray($?.input)?o_($?.input):$?.input??g$(N$()),output:$?.output??N$()})}var d_=V("ZodCustom",($,v)=>{b9.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>_D($,w,g,_)});function v0($){let v=new Q$({check:"custom"});return v._zod.check=$,v}function _0($,v){return MJ(d_,$??(()=>!0),v)}function Gg($,v={}){return zJ(d_,$,v)}function Yg($){return SJ($)}var w0=uJ,g0=TJ;function b0($,v={}){let w=new d_({type:"custom",check:"custom",fn:(g)=>g instanceof $,abort:!0,...N.normalizeParams(v)});return w._zod.bag.Class=$,w._zod.check=(g)=>{if(!(g.value instanceof $))g.issues.push({code:"invalid_type",expected:$.name,input:g.value,inst:w,path:[...w._zod.def.path??[]]})},w}var U0=(...$)=>RJ({Codec:U6,Boolean:I_,String:H_},...$);function J0($){let v=Jg(()=>{return zv([F($),H$(),W$(),f4(),g$(v),Bv(F(),v)])});return v}function D0($,v){return h_(_6($),v)}var u$={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"};function ND($){n$({customError:$})}function PD(){return n$().customError}var Qg;(function($){})(Qg||(Qg={}));var T={...Q4,...e1,iso:Q_},HB=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"]);function nB($,v){let w=$.$schema;if(w==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(w==="http://json-schema.org/draft-07/schema#")return"draft-7";if(w==="http://json-schema.org/draft-04/schema#")return"draft-4";return v??"draft-2020-12"}function qB($,v){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let w=$.slice(1).split("/").filter(Boolean);if(w.length===0)return v.rootSchema;let g=v.version==="draft-2020-12"?"$defs":"definitions";if(w[0]===g){let _=w[1];if(!_||!v.defs[_])throw Error(`Reference not found: ${$}`);return v.defs[_]}throw Error(`Reference not found: ${$}`)}function C8($,v){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return T.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let _=$.$ref;if(v.refs.has(_))return v.refs.get(_);if(v.processing.has(_))return T.lazy(()=>{if(!v.refs.has(_))throw Error(`Circular reference not resolved: ${_}`);return v.refs.get(_)});v.processing.add(_);let b=qB(_,v),J=f$(b,v);return v.refs.set(_,J),v.processing.delete(_),J}if($.enum!==void 0){let _=$.enum;if(v.version==="openapi-3.0"&&$.nullable===!0&&_.length===1&&_[0]===null)return T.null();if(_.length===0)return T.never();if(_.length===1)return T.literal(_[0]);if(_.every((J)=>typeof J==="string"))return T.enum(_);let b=_.map((J)=>T.literal(J));if(b.length<2)return b[0];return T.union([b[0],b[1],...b.slice(2)])}if($.const!==void 0)return T.literal($.const);let w=$.type;if(Array.isArray(w)){let _=w.map((b)=>{let J={...$,type:b};return C8(J,v)});if(_.length===0)return T.never();if(_.length===1)return _[0];return T.union(_)}if(!w)return T.any();let g;switch(w){case"string":{let _=T.string();if($.format){let b=$.format;if(b==="email")_=_.check(T.email());else if(b==="uri"||b==="uri-reference")_=_.check(T.url());else if(b==="uuid"||b==="guid")_=_.check(T.uuid());else if(b==="date-time")_=_.check(T.iso.datetime());else if(b==="date")_=_.check(T.iso.date());else if(b==="time")_=_.check(T.iso.time());else if(b==="duration")_=_.check(T.iso.duration());else if(b==="ipv4")_=_.check(T.ipv4());else if(b==="ipv6")_=_.check(T.ipv6());else if(b==="mac")_=_.check(T.mac());else if(b==="cidr")_=_.check(T.cidrv4());else if(b==="cidr-v6")_=_.check(T.cidrv6());else if(b==="base64")_=_.check(T.base64());else if(b==="base64url")_=_.check(T.base64url());else if(b==="e164")_=_.check(T.e164());else if(b==="jwt")_=_.check(T.jwt());else if(b==="emoji")_=_.check(T.emoji());else if(b==="nanoid")_=_.check(T.nanoid());else if(b==="cuid")_=_.check(T.cuid());else if(b==="cuid2")_=_.check(T.cuid2());else if(b==="ulid")_=_.check(T.ulid());else if(b==="xid")_=_.check(T.xid());else if(b==="ksuid")_=_.check(T.ksuid())}if(typeof $.minLength==="number")_=_.min($.minLength);if(typeof $.maxLength==="number")_=_.max($.maxLength);if($.pattern)_=_.regex(new RegExp($.pattern));g=_;break}case"number":case"integer":{let _=w==="integer"?T.number().int():T.number();if(typeof $.minimum==="number")_=_.min($.minimum);if(typeof $.maximum==="number")_=_.max($.maximum);if(typeof $.exclusiveMinimum==="number")_=_.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")_=_.gt($.minimum);if(typeof $.exclusiveMaximum==="number")_=_.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")_=_.lt($.maximum);if(typeof $.multipleOf==="number")_=_.multipleOf($.multipleOf);g=_;break}case"boolean":{g=T.boolean();break}case"null":{g=T.null();break}case"object":{let _={},b=$.properties||{},J=new Set($.required||[]);for(let[X,G]of Object.entries(b)){let Y=f$(G,v);_[X]=J.has(X)?Y:Y.optional()}if($.propertyNames){let X=f$($.propertyNames,v),G=$.additionalProperties&&typeof $.additionalProperties==="object"?f$($.additionalProperties,v):T.any();if(Object.keys(_).length===0){g=T.record(X,G);break}let Y=T.object(_).passthrough(),Q=T.looseRecord(X,G);g=T.intersection(Y,Q);break}if($.patternProperties){let X=$.patternProperties,G=Object.keys(X),Y=[];for(let H of G){let I=f$(X[H],v),q=T.string().regex(new RegExp(H));Y.push(T.looseRecord(q,I))}let Q=[];if(Object.keys(_).length>0)Q.push(T.object(_).passthrough());if(Q.push(...Y),Q.length===0)g=T.object({}).passthrough();else if(Q.length===1)g=Q[0];else{let H=T.intersection(Q[0],Q[1]);for(let I=2;I<Q.length;I++)H=T.intersection(H,Q[I]);g=H}break}let D=T.object(_);if($.additionalProperties===!1)g=D.strict();else if(typeof $.additionalProperties==="object")g=D.catchall(f$($.additionalProperties,v));else g=D.passthrough();break}case"array":{let{prefixItems:_,items:b}=$;if(_&&Array.isArray(_)){let J=_.map((X)=>f$(X,v)),D=b&&typeof b==="object"&&!Array.isArray(b)?f$(b,v):void 0;if(D)g=T.tuple(J).rest(D);else g=T.tuple(J);if(typeof $.minItems==="number")g=g.check(T.minLength($.minItems));if(typeof $.maxItems==="number")g=g.check(T.maxLength($.maxItems))}else if(Array.isArray(b)){let J=b.map((X)=>f$(X,v)),D=$.additionalItems&&typeof $.additionalItems==="object"?f$($.additionalItems,v):void 0;if(D)g=T.tuple(J).rest(D);else g=T.tuple(J);if(typeof $.minItems==="number")g=g.check(T.minLength($.minItems));if(typeof $.maxItems==="number")g=g.check(T.maxLength($.maxItems))}else if(b!==void 0){let J=f$(b,v),D=T.array(J);if(typeof $.minItems==="number")D=D.min($.minItems);if(typeof $.maxItems==="number")D=D.max($.maxItems);g=D}else g=T.array(T.any());break}default:throw Error(`Unsupported type: ${w}`)}if($.description)g=g.describe($.description);if($.default!==void 0)g=g.default($.default);return g}function f$($,v){if(typeof $==="boolean")return $?T.any():T.never();let w=C8($,v),g=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let D=$.anyOf.map((G)=>f$(G,v)),X=T.union(D);w=g?T.intersection(w,X):X}if($.oneOf&&Array.isArray($.oneOf)){let D=$.oneOf.map((G)=>f$(G,v)),X=T.xor(D);w=g?T.intersection(w,X):X}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)w=g?w:T.any();else{let D=g?w:f$($.allOf[0],v),X=g?0:1;for(let G=X;G<$.allOf.length;G++)D=T.intersection(D,f$($.allOf[G],v));w=D}if($.nullable===!0&&v.version==="openapi-3.0")w=T.nullable(w);if($.readOnly===!0)w=T.readonly(w);let _={},b=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let D of b)if(D in $)_[D]=$[D];let J=["contentEncoding","contentMediaType","contentSchema"];for(let D of J)if(D in $)_[D]=$[D];for(let D of Object.keys($))if(!HB.has(D))_[D]=$[D];if(Object.keys(_).length>0)v.registry.add(w,_);return w}function X0($,v){if(typeof $==="boolean")return $?T.any():T.never();let w=nB($,v?.defaultTarget),g=$.$defs||$.definitions||{},_={version:w,defs:g,refs:new Map,processing:new Set,rootSchema:$,registry:v?.registry??j$};return f$($,_)}var wv={};$v(wv,{string:()=>IB,number:()=>BB,date:()=>jB,boolean:()=>LB,bigint:()=>VB});function IB($){return $J(H_,$)}function BB($){return JJ(q_,$)}function LB($){return HJ(I_,$)}function VB($){return qJ(B_,$)}function jB($){return NJ(y_,$)}n$(w4());var FB=J6;var E8=J6??fD;if(typeof E8.object!=="function")throw Error("Failed to resolve Zod namespace");var a=E8;var Z8=u({code:F(),message:F(),retryable:W$(),details:Bv(F(),N$()).optional(),fix_hint:F().optional()}),KB=u({error:Z8,trace_id:F().optional(),request_id:F()}),x8=u({code:F(),message:F().optional(),details:Bv(F(),N$()).optional()}),OB=u({data:N$().optional(),warnings:g$(x8).optional(),request_id:F()}),d={BAD_REQUEST:"bad_request",INVALID_BODY:"invalid_body",UNAUTHORIZED:"unauthorized",TOKEN_EXPIRED:"token_expired",TOKEN_INVALID:"token_invalid",FORBIDDEN:"forbidden",STEP_UP_REQUIRED:"step_up_required",EXPORT_NOT_ALLOWED:"export_not_allowed",SESSION_READ_ONLY:"session_read_only",NOT_FOUND:"not_found",SESSION_NOT_FOUND:"session_not_found",THREAD_NOT_FOUND:"thread_not_found",COMMENT_NOT_FOUND:"comment_not_found",BLOCK_NOT_FOUND:"block_not_found",SOURCE_FILE_NOT_FOUND:"source_file_not_found",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotency_key_in_flight",VERSION_CONFLICT:"version_conflict",SOURCE_MISMATCH:"source_mismatch",TRANSITION_NOT_ALLOWED:"transition_not_allowed",PAYLOAD_TOO_LARGE:"payload_too_large",INVALID_ARGUMENT:"invalid_argument",INVALID_BLOCK_ID:"invalid_block_id",INVALID_ANCHOR:"invalid_anchor",INVALID_SHA:"invalid_sha",INVALID_PATH:"invalid_path",UNKNOWN_SCHEMA:"unknown_schema",VALIDATION_FAILED:"validation_failed",RATE_LIMITED:"rate_limited",DB_ERROR:"db_error",RENDER_ERROR:"render_error",STORAGE_ERROR:"storage_error",INTERNAL_ERROR:"internal_error",SOURCE_UNAVAILABLE:"source_unavailable",SOURCE_TIMEOUT:"source_timeout",SERVICE_UNAVAILABLE:"service_unavailable"};function D6($){return[d.IDEMPOTENCY_KEY_IN_FLIGHT,d.RATE_LIMITED,d.DB_ERROR,d.SOURCE_UNAVAILABLE,d.SOURCE_TIMEOUT,d.SERVICE_UNAVAILABLE].includes($)}import{Buffer as iB}from"node:buffer";var kB=/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/,NB=/^[a-f0-9]{64}$/,h8=/^(?:[A-Za-z0-9+/]+={0,2})$/,PB=24;var c8="gitstate.v1",y8="xchacha20poly1305",AD=["session.created","session.state_changed","thread.created","comment.created","comment.edited","approval.requested","approval.decided","disposition.created","participant.added","participant.removed","participant.redacted"],fB=new Set(AD),AB=v$(AD),m8=u({ciphertext:F().min(1).regex(h8,"ciphertext must be base64"),nonce:F().min(1).regex(h8,"nonce must be base64").refine(($)=>{try{return wL($).byteLength===PB}catch{return!1}},"nonce must decode to 24 bytes"),key_id:F().min(1)}).strict(),Lv=zv([F(),m8]),MB=v$(["operator","reviewer","system","automation","unknown"]),MD=u({actor_type:MB,user_id:F().optional(),participant_id:F().optional(),verification_level:H$().int().min(0).optional(),email:Lv.optional(),display_name:Lv.optional()}).strict(),r8=F().regex(/^ev_/,"event_id must start with ev_"),o8=H$().int().min(1),zB=u({title:F().nullable(),state:F(),block_id_scheme:F(),render_profile:F().nullable(),config_hash:F()}).strict(),SB=u({from_state:F(),to_state:F()}).strict(),uB=u({type:v$(["block","session"]),block_id:F().optional(),start_offset:H$().int().min(0).optional(),end_offset:H$().int().min(0).optional()}).strict().superRefine(($,v)=>{if($.type==="block"&&!$.block_id)v.addIssue({code:u$.custom,message:"anchor.block_id is required for block anchors",path:["block_id"]})}),TB=u({thread_id:F(),anchor:uB,body_md:Lv,body_html:Lv.optional(),severity:F(),tags:g$(F())}).strict(),RB=u({thread_id:F(),comment_id:F(),body_md:Lv,body_html:Lv.optional()}).strict(),CB=u({thread_id:F(),comment_id:F(),version:H$().int().min(1),body_md:Lv,body_html:Lv.optional()}).strict(),EB=u({approval_request_id:F(),requested_by_id:F().optional(),approver_participant_ids:g$(F()).optional()}).strict(),ZB=u({approval_request_id:F(),decision:v$(["approved","rejected","conditional"]),verification_level:H$().int().min(0),decided_by_id:F().optional()}).strict(),xB=u({evidence_id:F().optional(),type:F(),uri:F().optional(),notes:F().optional()}).strict(),lB=u({thread_id:F(),disposition_id:F(),state:F(),reason_code:F().optional(),evidence:g$(xB).optional()}).strict(),hB=u({participant_id:F(),roles:g$(F()),email:Lv.optional(),display_name:Lv.optional()}).strict(),cB=u({participant_id:F()}).strict(),yB=u({participant_id:F(),redacted_at:F().datetime(),reason:F().optional()}).strict();function gv($,v){return u({event_id:r8,event_seq:o8,type:q$($),occurred_at:F().datetime(),actor:MD,data:v}).strict()}var mB=gv("session.created",zB),rB=gv("session.state_changed",SB),oB=gv("thread.created",TB),tB=gv("comment.created",RB),dB=gv("comment.edited",CB),pB=gv("approval.requested",EB),eB=gv("approval.decided",ZB),aB=gv("disposition.created",lB),sB=gv("participant.added",hB),$L=gv("participant.removed",cB),vL=gv("participant.redacted",yB),t8=Sv("type",[mB,rB,oB,tB,dB,pB,eB,aB,sB,$L,vL]),d8=u({event_id:r8,event_seq:o8,type:F().min(1),occurred_at:F().datetime(),actor:MD,data:N$()}).strict().refine(($)=>!fB.has($.type),{message:"unknown event type expected",path:["type"]}),p8=zv([t8,d8]),e8=u({alg:q$(y8),key_id:F().min(1)}).strict(),_L=u({schema_version:q$(c8),session_id:F().min(1),repo_id:F().min(1),git_sha:F().regex(kB,"git_sha must be 40 or 64 hex"),file_path:F().min(1),source_content_sha256:F().regex(NB,"source_content_sha256 must be sha256 hex"),tenant_id:F().min(1),encrypted_bodies:W$(),include_emails:W$(),encryption:e8.optional(),flushed_at:F().datetime(),flushed_through_event_seq:H$().int().min(0),events:g$(p8)}).strict().superRefine(($,v)=>{if($.encrypted_bodies&&!$.encryption)v.addIssue({code:u$.custom,path:["encryption"],message:"encryption is required when encrypted_bodies=true"});if(!$.encrypted_bodies&&$.encryption)v.addIssue({code:u$.custom,path:["encryption"],message:"encryption must be omitted when encrypted_bodies=false"});let w=0;for(let g=0;g<$.events.length;g+=1){let _=$.events[g];if(_.event_seq<=w)v.addIssue({code:u$.custom,path:["events",g,"event_seq"],message:"events must be sorted by event_seq ascending"});w=_.event_seq}if($.flushed_through_event_seq<w)v.addIssue({code:u$.custom,path:["flushed_through_event_seq"],message:"flushed_through_event_seq must be >= highest event_seq in events"})});function wL($){return new Uint8Array(iB.from($,"base64"))}var zD="1";var gL=v$(["email"]),SD=v$(["session.created","thread.created","thread.escalated","thread.assigned","comment.created","decision.recorded","approval.requested","approval.escalated","approval.decided","participant.invited","reminder_sent","rule.challenged","rule.published_impact","rule.superseded_impact","rule.deprecated_impact"]),bL=v$(["invite","reminder","mention","approval_request","approval_decided","digest"]),UL=v$(["pending","delivered","failed","bounced"]),a8=v$(["email","none"]),s8=v$(["immediate","hourly","daily"]);var kE=u({new_thread:W$().optional(),reply_to_mine:W$().optional(),mention:W$().optional(),approval_request:W$().optional()}).strict(),JL=u({new_thread:W$(),reply_to_mine:W$(),mention:W$(),approval_request:W$()}).strict(),DL="email",XL="immediate",GL=Object.freeze({new_thread:!1,reply_to_mine:!0,mention:!0,approval_request:!0});var NE=u({channel_preference:a8,digest_mode:s8,notify_on:JL}).strict(),PE=Object.freeze({channel_preference:DL,digest_mode:XL,notify_on:{...GL}});var YL=u({review_link_id:F().min(1),recipient_participant_id:F().min(1),session_id:F().min(1),event_type:SD,event_id:F().min(1),channel:q$("email"),custom_message:F().trim().min(1).max(2000).nullable().optional(),response_redaction_version:q$(zD).optional()}).strict();var $5=v$(["fixed","wont_fix","needs_clarification"]),v5=u({line_range:o_([H$().int().positive(),H$().int().positive()])}),_5=u({thread_id:F().regex(/^thrd_/),disposition:$5,evidence:F().min(1).max(2000),changes_ref:v5.optional()}),QL=u({version:q$("1"),session_id:F().regex(/^sess_/),resolutions:g$(_5).min(1),changes_summary:F().max(1000).optional()});var w5=["session.created","comment.created","approval.requested","approval.decided","thread.resolved","thread.reopened"],g5=v$(w5),WL=v$(["active","paused","revoked"]),b5=g$(g5),HL=u({url:F().url().startsWith("https://"),events_json:b5,secret_key_id:F().min(1)});var kN=zX(),NN=Ag(),PN=qX(),yX=Mg(),fN=ng(),N_=_$(),AN=F_(),MN=L$(),zN=O_(),SN=i_(),vx=o0(),uN=lX(),TN=hX(),RN=cX(),p0=QY(),WY=Wg();var CN=kN.Composer,EN=NN.Document,ZN=PN.Schema,xN=yX.YAMLError,lN=yX.YAMLParseError,hN=yX.YAMLWarning,cN=fN.Alias,yN=N_.isAlias,mN=N_.isCollection,rN=N_.isDocument,oN=N_.isMap,tN=N_.isNode,dN=N_.isPair,pN=N_.isScalar,eN=N_.isSeq,aN=AN.Pair,sN=MN.Scalar,$P=zN.YAMLMap,vP=SN.YAMLSeq;var _P=uN.Lexer,wP=TN.LineCounter,gP=RN.Parser,mX=p0.parse,bP=p0.parseAllDocuments,UP=p0.parseDocument,JP=p0.stringify,DP=WY.visit,XP=WY.visitAsync;var GP=["string","string[]","number","boolean","enum","date"],nY=v$(GP),YP=/^[a-zA-Z0-9_-]+$/,rX=u({field:F().min(1),type:nY,values:g$(F().min(1)).optional()}).refine(($)=>{if($.type==="enum")return $.values!==void 0&&$.values.length>0;return $.values===void 0},{message:"enum fields must provide non-empty 'values' array; non-enum fields must not"}),qY=u({name:F().min(1).regex(YP,"doc_type name must be alphanumeric, hyphens, or underscores"),description:F().optional(),required_fields:g$(rX).default([]),optional_fields:g$(rX).default([])}),IY=u({allowed:g$(F().min(1)).default([]),enforce:W$().default(!1)}),BY=u({allowed:g$(F().min(1)).default([]),enforce:W$().default(!1)}),LY=u({default:F().min(1),allowed:g$(F().min(1)).default([]),enforce:W$().default(!1)}),HY=["taxonomy.v1"],QP=u({schema_version:F().refine(($)=>HY.includes($),`schema_version must be one of: ${HY.join(", ")}`),doc_types:g$(qY).default([]),tags:IY.optional(),categories:BY.optional(),locale:LY.optional()}).passthrough().refine(($)=>{let v=$.doc_types.map((w)=>w.name);return new Set(v).size===v.length},{message:"Duplicate doc_type names are not allowed"}).refine(($)=>{let v=$.tags?.allowed??[];return new Set(v).size===v.length},{message:"Duplicate tag names are not allowed"}).refine(($)=>{let v=$.categories?.allowed??[];return new Set(v).size===v.length},{message:"Duplicate category names are not allowed"});var VY="v1",jY=["terminology","style","tone","claim_evidence","citation","structure","constraint","formatting","accuracy","clarity","completeness","other"],FY=v$(jY),KY=v$(["rules","llm","hybrid","human_override"]),WP=u({taxonomy_version:q$(VY),primary_type:FY,subtype:F().min(1).optional(),confidence:H$().min(0).max(1),source:KY,classifier_version:F().min(1),non_authoritative:q$(!0)});var HP=/^freshness\.v\d+$/,OY=v$(["glob","doc_type"]),Cg=v$(["info","warning","blocking"]),iY=u({name:F().min(1),match_mode:OY,match_pattern:F().min(1),max_days_since_approval:H$().int().positive(),severity:Cg,never_reviewed_severity:Cg}).strict(),kY=u({max_days_since_approval:H$().int().positive(),severity:Cg,never_reviewed_severity:Cg}).strict(),nP=u({schema_version:F().regex(HP,"schema_version must match format freshness.v{major} (e.g., freshness.v1)"),rules:g$(iY).default([]),defaults:kY}).strict().superRefine(($,v)=>{let w=new Set;$.rules.forEach((g,_)=>{if(w.has(g.name))v.addIssue({code:"custom",message:`Duplicate rule name: "${g.name}"`,path:["rules",_,"name"]});w.add(g.name)})});var Jx=u({freshness:u({rules_file:F().min(1).optional()}).passthrough().optional()}).passthrough();var IP=u({DATABASE_URL:F().min(1,"DATABASE_URL is required"),DATABASE_URL_DIRECT:F().optional()}),BP=u({GIT_PROVIDER:v$(["github","gitlab","local"]).default("github"),GITHUB_TOKEN:F().optional(),GITLAB_TOKEN:F().optional(),TYPESCAPE_GIT_ROOT:F().optional()}),LP=u({ARTIFACT_STORE_TYPE:v$(["s3","filesystem"]).default("s3"),R2_ACCOUNT_ID:F().optional(),R2_ACCESS_KEY_ID:F().optional(),R2_SECRET_ACCESS_KEY:F().optional(),R2_BUCKET_NAME:F().optional(),R2_ENDPOINT:F().url().optional(),TYPESCAPE_ARTIFACTS_PATH:F().optional()}),VP=u({TYPESCAPE_SERVER_SECRET:F().min(32,"TYPESCAPE_SERVER_SECRET must be at least 32 characters"),SESSION_SECRET:F().min(32,"SESSION_SECRET must be at least 32 characters"),CRON_SECRET:F().optional()}),jP=u({TYPESCAPE_PORTAL_ORIGIN:F().url().default("http://localhost:5173"),TYPESCAPE_BASE_URL:F().url().default("http://localhost:3000")}),FP=u({SMTP_HOST:F().optional(),SMTP_PORT:wv.number().int().positive().optional(),SMTP_USER:F().optional(),SMTP_PASS:F().optional(),SMTP_FROM:F().optional()}),KP=u({PORT:wv.number().int().positive().default(3000),METRICS_PORT:wv.number().int().positive().default(9090),NODE_ENV:v$(["development","staging","production"]).default("development"),LOG_LEVEL:v$(["trace","debug","info","warn","error"]).default("info"),TYPESCAPE_ROLE:v$(["api","worker","ingest","combined"]).default("combined")}),OP=u({OTEL_EXPORTER_OTLP_ENDPOINT:F().url().optional(),OTEL_SERVICE_NAME:F().optional(),FEATURE_FLAGS:F().optional()}),iP=IP.merge(BP).merge(LP).merge(VP).merge(jP).merge(FP).merge(KP).merge(OP);var x$={free:{sessions_per_month:15,active_repos:1},pro:{sessions_per_month:100,active_repos:10},scale:{sessions_per_month:500,active_repos:50}},NY={free:{plan_id:"free",sessions_used:1,sessions_limit:x$.free.sessions_per_month,sessions_remaining:x$.free.sessions_per_month-1,active_repos:1,active_repos_limit:x$.free.active_repos,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",resets_at:"2026-03-01T00:00:00.000Z",upgrade_url:"https://example.com/billing",request_id:"req_usage"},pro:{plan_id:"pro",sessions_used:7,sessions_limit:15,sessions_remaining:8,active_repos:2,active_repos_limit:5,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",resets_at:"2026-03-01T00:00:00.000Z",upgrade_url:"https://example.com/billing",request_id:"req_usage"},scale:{plan_id:"scale",sessions_used:120,sessions_limit:x$.scale.sessions_per_month,sessions_remaining:x$.scale.sessions_per_month-120,active_repos:12,active_repos_limit:x$.scale.active_repos,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",resets_at:"2026-03-01T00:00:00.000Z",upgrade_url:"https://example.com/billing",request_id:"req_usage"}},PY={free:{plan_id:"free",plan_name:"Free",status:"trialing",trial_ends_at:"2026-03-05T00:00:00.000Z",cancel_at_period_end:!1,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",limits:x$.free,upgrade_url:"https://example.com/billing",request_id:"req_plan"},pro:{plan_id:"pro",plan_name:"Pro",status:"active",trial_ends_at:null,cancel_at_period_end:!1,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",limits:x$.pro,upgrade_url:"https://example.com/billing",request_id:"req_plan"},scale:{plan_id:"scale",plan_name:"Scale",status:"active",trial_ends_at:null,cancel_at_period_end:!1,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",limits:x$.scale,upgrade_url:"https://example.com/billing",request_id:"req_plan"}};function oX($){let v=PY[$],w=NY[$];return{plan:{id:v.plan_id,name:v.plan_name,status:v.status,trial_ends_at:v.trial_ends_at,cancel_at_period_end:v.cancel_at_period_end},usage:{sessions_used:w.sessions_used,sessions_limit:w.sessions_limit,sessions_remaining:w.sessions_remaining,active_repos:w.active_repos,active_repos_limit:w.active_repos_limit},billing_period:{start:v.current_period_start,end:v.current_period_end,resets_at:w.resets_at},upgrade_url:v.upgrade_url,request_id:"req_summary"}}var kP={free:oX("free"),pro:oX("pro"),scale:oX("scale")},NP={free:{plan_id:"free",plan_name:"Free",status:"trialing",current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",trial_ends_at:"2026-03-05T00:00:00.000Z",cancel_at_period_end:!1,usage:{sessions_used:1,sessions_limit:10,active_repos:1,active_repos_limit:3},polar_customer_id:"cus_123",polar_subscription_id:null,request_id:"req_subscription"},pro:{plan_id:"pro",plan_name:"Pro",status:"active",current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",trial_ends_at:null,cancel_at_period_end:!1,usage:{sessions_used:8,sessions_limit:x$.pro.sessions_per_month,active_repos:3,active_repos_limit:x$.pro.active_repos},polar_customer_id:"cus_123",polar_subscription_id:"sub_123",request_id:"req_subscription"},scale:{plan_id:"scale",plan_name:"Scale",status:"active",current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",trial_ends_at:null,cancel_at_period_end:!1,usage:{sessions_used:1,sessions_limit:x$.scale.sessions_per_month,active_repos:1,active_repos_limit:x$.scale.active_repos},polar_customer_id:"cus_123",polar_subscription_id:"sub_live",request_id:"req_subscription"}};var PP=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Fv($,v){return $>>>v|$<<32-v}function AY($){let v=new TextEncoder().encode($),w=v.length+9+63>>6<<6>>>0,g=new Uint8Array(w);g.set(v),g[v.length]=128;let _=v.length*8,b=new DataView(g.buffer);b.setUint32(w-8,Math.floor(_/4294967296),!1),b.setUint32(w-4,_>>>0,!1);let J=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],D=new Uint32Array(64);for(let X=0;X<w;X+=64){for(let j=0;j<16;j++)D[j]=b.getUint32(X+j*4,!1);for(let j=16;j<64;j++){let A=Fv(D[j-15],7)^Fv(D[j-15],18)^D[j-15]>>>3,z=Fv(D[j-2],17)^Fv(D[j-2],19)^D[j-2]>>>10;D[j]=(D[j-16]+A|0)+(D[j-7]+z|0)>>>0}let[G,Y,Q,H,I,q,W,B]=J;for(let j=0;j<64;j++){let A=Fv(I,6)^Fv(I,11)^Fv(I,25),z=I&q^~I&W,C=B+A+z+PP[j]+D[j]>>>0,Z=Fv(G,2)^Fv(G,13)^Fv(G,22),S=G&Y^G&Q^Y&Q,y=Z+S>>>0;B=W,W=q,q=I,I=H+C>>>0,H=Q,Q=Y,Y=G,G=C+y>>>0}J[0]=J[0]+G>>>0,J[1]=J[1]+Y>>>0,J[2]=J[2]+Q>>>0,J[3]=J[3]+H>>>0,J[4]=J[4]+I>>>0,J[5]=J[5]+q>>>0,J[6]=J[6]+W>>>0,J[7]=J[7]+B>>>0}return J.map((X)=>X.toString(16).padStart(8,"0")).join("")}var e0=a.object({rule_session_id:a.string(),rule_block_id:a.string(),rule_block_key:a.string().optional(),strength:a.enum(["must","should","may","must_not"]),category:a.string(),rule_content:a.string(),rule_session_name:a.string(),applicability_match_reason:a.string().optional()}),fP=3600000,fY=86400000,AP=a.object({repo_id:a.string().nullable(),file_path:a.string().nullable(),review_id:a.string().nullable()}),MP=a.object({fetched_at:a.string(),server_etag:a.string(),latest_rule_session_updated_at:a.string().nullable(),contributing_session_count:a.number().int().nonnegative(),total_rule_count:a.number().int().nonnegative()}),zP=a.object({text:a.string(),json_payload:a.unknown().optional(),structured_payload:a.unknown().optional()}),SP=a.object({scope:AP,compiled_hash:a.string(),rules:a.array(a.object({source_review_id:a.string(),block_id:a.string(),block_index:a.number().int().nonnegative(),strength:a.enum(["must","should","may","must_not"]),category:a.string().nullable(),rule_text:a.string(),specificity:a.number().int().nonnegative(),applicability:a.record(a.string(),a.string())})),plain_text_bundle:a.string(),freshness:MP,rulepack_schema_version:a.literal("rulepack.v1"),renderings:zP.optional()});function uP($,v){return AY(JSON.stringify({plain_text_bundle:$,rules:v}))}function a0($){return AY(JSON.stringify({repo_id:$.repo_id,file_path:$.file_path,review_id:$.review_id}))}function tX($){let v=typeof $.compiled_hash==="string"&&$.compiled_hash.length>0?$.compiled_hash:uP($.plain_text_bundle,$.rules),w={scope:$.scope,compiled_hash:v,rules:$.rules,plain_text_bundle:$.plain_text_bundle,freshness:{fetched_at:$.fetched_at,server_etag:$.server_etag??`"rules:${v}"`,latest_rule_session_updated_at:$.freshness.latest_rule_session_updated_at,contributing_session_count:$.freshness.contributing_session_count,total_rule_count:$.freshness.total_rule_count},rulepack_schema_version:"rulepack.v1",...$.renderings?{renderings:$.renderings}:{}};return SP.parse(w),w}function TP($){let v=Math.max(0,Math.floor($/1000));if(v<60)return`${v}s`;let w=Math.floor(v/60);if(w<60)return`${w}m`;let g=Math.floor(w/60);if(g<48)return`${g}h`;return`${Math.floor(g/24)}d`}function MY($,v=new Date){let w=Date.parse($);if(!Number.isFinite(w))return{status:"confirmed_stale",age_ms:Number.POSITIVE_INFINITY,age_seconds:Number.POSITIVE_INFINITY,warning:"Using cached rules with an invalid fetched_at timestamp. Rules may have changed."};let g=Math.max(0,v.getTime()-w),_=Math.floor(g/1000);if(g<=fP)return{status:"fresh",age_ms:g,age_seconds:_,warning:null};let b=TP(g),J=g>fY?`Cached rules are over ${b} old. Strongly recommend reconnecting to verify rules are current.`:`Using cached rules (fetched ${b} ago). Rules may have changed.`;return{status:g>fY?"confirmed_stale":"presumed_stale",age_ms:g,age_seconds:_,warning:J}}class L extends Error{status;code;requestId;details;fixHint;requestUrl;name="ApiError";constructor($,v,w,g,_,b,J){super(w);this.status=$;this.code=v;this.requestId=g;this.details=_;this.fixHint=b;this.requestUrl=J}}var K$=2,Jv=3,Rv=4,zY=5,ol={network_error:{exitCode:Jv,mcpRetry:"transient"},request_timeout:{exitCode:Jv,mcpRetry:"transient"},invalid_response:{exitCode:Rv,mcpRetry:"transient"},quota_exceeded:{exitCode:K$,mcpRetry:"manual"},[d.UNAUTHORIZED]:{exitCode:Jv,mcpRetry:"manual"},[d.TOKEN_EXPIRED]:{exitCode:Jv,mcpRetry:"manual"},[d.TOKEN_INVALID]:{exitCode:Jv,mcpRetry:"manual"},[d.FORBIDDEN]:{exitCode:Jv,mcpRetry:"manual"},[d.STEP_UP_REQUIRED]:{exitCode:Jv,mcpRetry:"manual"},[d.EXPORT_NOT_ALLOWED]:{exitCode:Jv,mcpRetry:"manual"},[d.SESSION_READ_ONLY]:{exitCode:Jv,mcpRetry:"manual"},[d.NOT_FOUND]:{exitCode:K$,mcpRetry:"manual"},[d.SESSION_NOT_FOUND]:{exitCode:K$,mcpRetry:"manual"},[d.THREAD_NOT_FOUND]:{exitCode:K$,mcpRetry:"manual"},[d.COMMENT_NOT_FOUND]:{exitCode:K$,mcpRetry:"manual"},[d.BLOCK_NOT_FOUND]:{exitCode:K$,mcpRetry:"manual"},[d.SOURCE_FILE_NOT_FOUND]:{exitCode:K$,mcpRetry:"manual"},[d.IDEMPOTENCY_KEY_IN_FLIGHT]:{exitCode:zY,mcpRetry:"transient"},[d.VERSION_CONFLICT]:{exitCode:K$,mcpRetry:"manual"},[d.SOURCE_MISMATCH]:{exitCode:K$,mcpRetry:"manual"},[d.PAYLOAD_TOO_LARGE]:{exitCode:K$,mcpRetry:"manual"},[d.INVALID_ARGUMENT]:{exitCode:K$,mcpRetry:"manual"},[d.INVALID_BLOCK_ID]:{exitCode:K$,mcpRetry:"manual"},[d.INVALID_ANCHOR]:{exitCode:K$,mcpRetry:"manual"},[d.INVALID_SHA]:{exitCode:K$,mcpRetry:"manual"},[d.INVALID_PATH]:{exitCode:K$,mcpRetry:"manual"},[d.UNKNOWN_SCHEMA]:{exitCode:K$,mcpRetry:"manual"},[d.VALIDATION_FAILED]:{exitCode:K$,mcpRetry:"manual"},[d.RATE_LIMITED]:{exitCode:Jv,mcpRetry:"transient"},[d.DB_ERROR]:{exitCode:Rv,mcpRetry:"transient"},[d.RENDER_ERROR]:{exitCode:Rv,mcpRetry:"transient"},[d.STORAGE_ERROR]:{exitCode:Rv,mcpRetry:"transient"},[d.INTERNAL_ERROR]:{exitCode:Rv,mcpRetry:"transient"},[d.SOURCE_UNAVAILABLE]:{exitCode:Rv,mcpRetry:"transient"},[d.SOURCE_TIMEOUT]:{exitCode:Rv,mcpRetry:"transient"},[d.SERVICE_UNAVAILABLE]:{exitCode:Rv,mcpRetry:"transient"}};var s0={maxAttempts:3,baseDelayMs:200,maxDelayMs:1000,jitterFactor:0.25,retryableStatusCodes:[429,502,503]};function dX($,v){let w=Math.min(v.baseDelayMs*Math.pow(2,$),v.maxDelayMs),g=w*v.jitterFactor*(Math.random()*2-1);return Math.max(0,Math.round(w+g))}function SY($,v,w){let g=$.headers.get("Retry-After");if(g){let _=parseInt(g,10);if(!Number.isNaN(_)&&_>0)return _*1000;let b=new Date(g);if(!Number.isNaN(b.getTime())){let J=b.getTime()-Date.now();if(J>0)return J}}return dX(v,w)}function uY($,v,w,g){if(!g.retryableStatusCodes.includes(v))return!1;if($==="GET"||$==="PUT")return!0;return w}function TY($,v){if($==="GET"||$==="PUT")return!0;return v}async function $U($,v,w=!1,g=s0){let _=null,b=null,J=0,D=!1;for(let X=0;X<g.maxAttempts;X++){J=X+1;try{let G=await $();if(_=G,D=!1,G.ok||!uY(v,G.status,w,g))return{response:G,error:null,attempts:X+1,wasNetworkError:!1,exhaustedRetries:!1,lastStatus:G.status};if(X<g.maxAttempts-1){let Y=SY(G,X,g);await new Promise((Q)=>setTimeout(Q,Y))}}catch(G){if(b=G instanceof Error?G:Error(String(G)),D=!0,_=null,X<g.maxAttempts-1&&TY(v,w)){let Y=dX(X,g);await new Promise((Q)=>setTimeout(Q,Y));continue}break}}if(b)return{response:null,error:b,attempts:J,wasNetworkError:!0,exhaustedRetries:!0,lastStatus:0};if(!_)throw Error("Retry invariant violated: missing final response");return{response:_,error:b,attempts:J,wasNetworkError:D,exhaustedRetries:!0,lastStatus:_.status}}var ww=30000,RP="/v1",CP="typescape-api-client/0.0.1";function RY($){return typeof FormData<"u"&&$ instanceof FormData}function pX($,v,w,g){let _=`${$}${v}${w}`;if(g&&Object.keys(g).length>0)_+=`?${new URLSearchParams(g).toString()}`;return _}function eX($,v,w){return{Authorization:`Bearer ${$}`,Accept:"application/json","User-Agent":v,...w}}function EY($){let v=Object.entries($).find(([w])=>w.toLowerCase()==="idempotency-key")?.[1];return typeof v==="string"&&v.trim().length>0}function vU($,v){let w=v;if(w&&typeof w.request_id==="string"&&w.request_id.trim().length>0)return w.request_id;let g=$.headers.get("X-Request-Id");if(typeof g==="string"&&g.trim().length>0)return g;return"unknown_request_id"}function ZY($,v){let w=$.error?.code;if(typeof w!=="string"||w.trim().length===0)throw new L(0,"invalid_response","Error response missing error.code",v);let g=$.error?.message;if(w!=="quota_exceeded"&&(typeof g!=="string"||g.trim().length===0))throw new L(0,"invalid_response","Error response missing error.message",v);return new L(0,w,typeof g==="string"?g:"",v,$.error?.details,$.error?.fix_hint)}async function CY($,v,w,g,_,b){let J=EY(b),D=`${g} ${$}`,X=await $U(()=>fetch($,{...v,signal:AbortSignal.timeout(w)}),g,J,_);if(X.error){if(X.error instanceof DOMException&&(X.error.name==="TimeoutError"||X.error.name==="AbortError")){let q=Math.round(w/1000);throw new L(0,"request_timeout",`Request timed out after ${q}s. Check your network connection and server URL.`,"unknown",void 0,void 0,D)}throw new L(0,"network_error",`Network error: ${X.error.message} (${X.attempts} attempt${X.attempts===1?"":"s"})`,"unknown",void 0,void 0,D)}let G=X.response;if(!G)throw new L(0,"network_error",`Network error: request failed (${X.attempts} attempt${X.attempts===1?"":"s"})`,"unknown",void 0,void 0,D);let Y=G.headers.get("Content-Type");if(!Y)throw new L(G.status,"invalid_response","Response missing Content-Type header","unknown",void 0,void 0,D);if(!Y.toLowerCase().includes("application/json"))throw new L(G.status,"invalid_response",`Expected JSON response but received Content-Type: ${Y}`,"unknown",void 0,void 0,D);let Q;try{Q=await G.json()}catch(I){throw new L(G.status,"invalid_response",`Failed to parse JSON response: ${I instanceof Error?I.message:String(I)}`,"unknown",void 0,void 0,D)}let H=vU(G,Q);if(!G.ok){let q=ZY(Q,H);throw new L(G.status,q.code,q.message+(X.exhaustedRetries&&X.attempts>1?` (${X.attempts} attempts, retries exhausted)`:""),H,q.details,q.fixHint,D)}return{status:G.status,body:Q,requestId:H}}async function EP($,v,w,g,_,b){let J=EY(b),D=`${g} ${$}`,X=await $U(()=>fetch($,{...v,signal:AbortSignal.timeout(w)}),g,J,_);if(X.error){if(X.error instanceof DOMException&&(X.error.name==="TimeoutError"||X.error.name==="AbortError")){let I=Math.round(w/1000);throw new L(0,"request_timeout",`Request timed out after ${I}s. Check your network connection and server URL.`,"unknown",void 0,void 0,D)}throw new L(0,"network_error",`Network error: ${X.error.message} (${X.attempts} attempt${X.attempts===1?"":"s"})`,"unknown",void 0,void 0,D)}let G=X.response;if(!G)throw new L(0,"network_error","Request failed","unknown",void 0,void 0,D);let Y=G.headers.get("Content-Type");if(!Y)throw new L(G.status,"invalid_response","Response missing Content-Type header","unknown",void 0,void 0,D);if(Y.toLowerCase().includes("application/json")){let H;try{H=await G.json()}catch(q){throw new L(G.status,"invalid_response",`Failed to parse JSON response: ${q instanceof Error?q.message:String(q)}`,"unknown",void 0,void 0,D)}let I=vU(G,H);if(!G.ok){let q=ZY(H,I);throw new L(G.status,q.code,q.message,I,q.details,q.fixHint,D)}throw new L(G.status,"invalid_response","Expected text response but received JSON payload",I,void 0,void 0,D)}let Q;try{Q=await G.text()}catch(H){throw new L(G.status,"invalid_response",`Failed to read text response: ${H instanceof Error?H.message:String(H)}`,vU(G,null),void 0,void 0,D)}return{status:G.status,body:Q,requestId:vU(G,null)}}function aX($){let v=$.baseUrl.replace(/\/$/,""),w=$.apiPrefix??RP,g=$.timeoutMs??ww,_=$.userAgent??CP,b=$.retryPolicy??s0;function J(D,X,G={}){let Y=pX(v,w,X,G.query),Q=eX($.apiKey,_,G.headers);if(G.body!==void 0&&!RY(G.body))Q["Content-Type"]="application/json";let H=G.body!==void 0?RY(G.body)?G.body:JSON.stringify(G.body):void 0;return CY(Y,{method:D,headers:Q,body:H},g,D,b,Q)}return{get(D,X){return J("GET",D,X)},getText(D,X){let G=pX(v,w,D,X?.query),Y=eX($.apiKey,_,{Accept:"text/plain, application/json",...X?.headers});return EP(G,{method:"GET",headers:Y},g,"GET",b,Y)},post(D,X){return J("POST",D,X)},postFormData(D,X,G){let Y=pX(v,w,D,G?.query),Q=eX($.apiKey,_,G?.headers);return CY(Y,{method:"POST",headers:Q,body:X},g,"POST",b,Q)},put(D,X){return J("PUT",D,X)},patch(D,X){return J("PATCH",D,X)},delete(D,X){return J("DELETE",D,X)},request:J}}var ZP=typeof sX.default.version==="string"?sX.default.version:"0.0.0",xP=`typescape-mcp/${ZP}`;function xY($,v,w=ww){return aX({baseUrl:$,apiKey:v,timeoutMs:w,userAgent:xP})}var w$;(function($){$.assertEqual=(_)=>_;function v(_){}$.assertIs=v;function w(_){throw Error()}$.assertNever=w,$.arrayToEnum=(_)=>{let b={};for(let J of _)b[J]=J;return b},$.getValidEnumValues=(_)=>{let b=$.objectKeys(_).filter((D)=>typeof _[_[D]]!=="number"),J={};for(let D of b)J[D]=_[D];return $.objectValues(J)},$.objectValues=(_)=>{return $.objectKeys(_).map(function(b){return _[b]})},$.objectKeys=typeof Object.keys==="function"?(_)=>Object.keys(_):(_)=>{let b=[];for(let J in _)if(Object.prototype.hasOwnProperty.call(_,J))b.push(J);return b},$.find=(_,b)=>{for(let J of _)if(b(J))return J;return},$.isInteger=typeof Number.isInteger==="function"?(_)=>Number.isInteger(_):(_)=>typeof _==="number"&&isFinite(_)&&Math.floor(_)===_;function g(_,b=" | "){return _.map((J)=>typeof J==="string"?`'${J}'`:J).join(b)}$.joinValues=g,$.jsonStringifyReplacer=(_,b)=>{if(typeof b==="bigint")return b.toString();return b}})(w$||(w$={}));var vG;(function($){$.mergeShapes=(v,w)=>{return{...v,...w}}})(vG||(vG={}));var l=w$.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ev=($)=>{switch(typeof $){case"undefined":return l.undefined;case"string":return l.string;case"number":return isNaN($)?l.nan:l.number;case"boolean":return l.boolean;case"function":return l.function;case"bigint":return l.bigint;case"symbol":return l.symbol;case"object":if(Array.isArray($))return l.array;if($===null)return l.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return l.promise;if(typeof Map<"u"&&$ instanceof Map)return l.map;if(typeof Set<"u"&&$ instanceof Set)return l.set;if(typeof Date<"u"&&$ instanceof Date)return l.date;return l.object;default:return l.unknown}},f=w$.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"]),lP=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class c$ extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(w)=>{this.issues=[...this.issues,w]},this.addIssues=(w=[])=>{this.issues=[...this.issues,...w]};let v=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,v);else this.__proto__=v;this.name="ZodError",this.issues=$}format($){let v=$||function(_){return _.message},w={_errors:[]},g=(_)=>{for(let b of _.issues)if(b.code==="invalid_union")b.unionErrors.map(g);else if(b.code==="invalid_return_type")g(b.returnTypeError);else if(b.code==="invalid_arguments")g(b.argumentsError);else if(b.path.length===0)w._errors.push(v(b));else{let J=w,D=0;while(D<b.path.length){let X=b.path[D];if(D!==b.path.length-1)J[X]=J[X]||{_errors:[]};else J[X]=J[X]||{_errors:[]},J[X]._errors.push(v(b));J=J[X],D++}}};return g(this),w}static assert($){if(!($ instanceof c$))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,w$.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(v)=>v.message){let v={},w=[];for(let g of this.issues)if(g.path.length>0)v[g.path[0]]=v[g.path[0]]||[],v[g.path[0]].push($(g));else w.push($(g));return{formErrors:w,fieldErrors:v}}get formErrors(){return this.flatten()}}c$.create=($)=>{return new c$($)};var K6=($,v)=>{let w;switch($.code){case f.invalid_type:if($.received===l.undefined)w="Required";else w=`Expected ${$.expected}, received ${$.received}`;break;case f.invalid_literal:w=`Invalid literal value, expected ${JSON.stringify($.expected,w$.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:w=`Unrecognized key(s) in object: ${w$.joinValues($.keys,", ")}`;break;case f.invalid_union:w="Invalid input";break;case f.invalid_union_discriminator:w=`Invalid discriminator value. Expected ${w$.joinValues($.options)}`;break;case f.invalid_enum_value:w=`Invalid enum value. Expected ${w$.joinValues($.options)}, received '${$.received}'`;break;case f.invalid_arguments:w="Invalid function arguments";break;case f.invalid_return_type:w="Invalid function return type";break;case f.invalid_date:w="Invalid date";break;case f.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(w=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")w=`${w} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)w=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)w=`Invalid input: must end with "${$.validation.endsWith}"`;else w$.assertNever($.validation);else if($.validation!=="regex")w=`Invalid ${$.validation}`;else w="Invalid";break;case f.too_small:if($.type==="array")w=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")w=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")w=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")w=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else w="Invalid input";break;case f.too_big:if($.type==="array")w=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")w=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")w=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")w=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")w=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else w="Invalid input";break;case f.custom:w="Invalid input";break;case f.invalid_intersection_types:w="Intersection results could not be merged";break;case f.not_multiple_of:w=`Number must be a multiple of ${$.multipleOf}`;break;case f.not_finite:w="Number must be finite";break;default:w=v.defaultError,w$.assertNever($)}return{message:w}},cY=K6;function hP($){cY=$}function _U(){return cY}var wU=($)=>{let{data:v,path:w,errorMaps:g,issueData:_}=$,b=[...w,..._.path||[]],J={..._,path:b};if(_.message!==void 0)return{..._,path:b,message:_.message};let D="",X=g.filter((G)=>!!G).slice().reverse();for(let G of X)D=G(J,{data:v,defaultError:D}).message;return{..._,path:b,message:D}},cP=[];function R($,v){let w=_U(),g=wU({issueData:v,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,w,w===K6?void 0:K6].filter((_)=>!!_)});$.common.issues.push(g)}class A${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,v){let w=[];for(let g of v){if(g.status==="aborted")return r;if(g.status==="dirty")$.dirty();w.push(g.value)}return{status:$.value,value:w}}static async mergeObjectAsync($,v){let w=[];for(let g of v){let _=await g.key,b=await g.value;w.push({key:_,value:b})}return A$.mergeObjectSync($,w)}static mergeObjectSync($,v){let w={};for(let g of v){let{key:_,value:b}=g;if(_.status==="aborted")return r;if(b.status==="aborted")return r;if(_.status==="dirty")$.dirty();if(b.status==="dirty")$.dirty();if(_.value!=="__proto__"&&(typeof b.value<"u"||g.alwaysSet))w[_.value]=b.value}return{status:$.value,value:w}}}var r=Object.freeze({status:"aborted"}),j6=($)=>({status:"dirty",value:$}),T$=($)=>({status:"valid",value:$}),_G=($)=>$.status==="aborted",wG=($)=>$.status==="dirty",gw=($)=>$.status==="valid",xg=($)=>typeof Promise<"u"&&$ instanceof Promise;function gU($,v,w,g){if(w==="a"&&!g)throw TypeError("Private accessor was defined without a getter");if(typeof v==="function"?$!==v||!g:!v.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return w==="m"?g:w==="a"?g.call($):g?g.value:v.get($)}function yY($,v,w,g,_){if(g==="m")throw TypeError("Private method is not writable");if(g==="a"&&!_)throw TypeError("Private accessor was defined without a setter");if(typeof v==="function"?$!==v||!_:!v.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return g==="a"?_.call($,w):_?_.value=w:v.set($,w),w}var h;(function($){$.errToObj=(v)=>typeof v==="string"?{message:v}:v||{},$.toString=(v)=>typeof v==="string"?v:v===null||v===void 0?void 0:v.message})(h||(h={}));var Eg,Zg;class Yv{constructor($,v,w,g){this._cachedPath=[],this.parent=$,this.data=v,this._path=w,this._key=g}get path(){if(!this._cachedPath.length)if(this._key instanceof Array)this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var lY=($,v)=>{if(gw(v))return{success:!0,data:v.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let w=new c$($.common.issues);return this._error=w,this._error}}}};function p($){if(!$)return{};let{errorMap:v,invalid_type_error:w,required_error:g,description:_}=$;if(v&&(w||g))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(v)return{errorMap:v,description:_};return{errorMap:(J,D)=>{var X,G;let{message:Y}=$;if(J.code==="invalid_enum_value")return{message:Y!==null&&Y!==void 0?Y:D.defaultError};if(typeof D.data>"u")return{message:(X=Y!==null&&Y!==void 0?Y:g)!==null&&X!==void 0?X:D.defaultError};if(J.code!=="invalid_type")return{message:D.defaultError};return{message:(G=Y!==null&&Y!==void 0?Y:w)!==null&&G!==void 0?G:D.defaultError}},description:_}}class s{get description(){return this._def.description}_getType($){return Ev($.data)}_getOrReturnCtx($,v){return v||{common:$.parent.common,data:$.data,parsedType:Ev($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new A$,ctx:{common:$.parent.common,data:$.data,parsedType:Ev($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let v=this._parse($);if(xg(v))throw Error("Synchronous parse encountered promise.");return v}_parseAsync($){let v=this._parse($);return Promise.resolve(v)}parse($,v){let w=this.safeParse($,v);if(w.success)return w.data;throw w.error}safeParse($,v){var w;let g={common:{issues:[],async:(w=v===null||v===void 0?void 0:v.async)!==null&&w!==void 0?w:!1,contextualErrorMap:v===null||v===void 0?void 0:v.errorMap},path:(v===null||v===void 0?void 0:v.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Ev($)},_=this._parseSync({data:$,path:g.path,parent:g});return lY(g,_)}"~validate"($){var v,w;let g={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Ev($)};if(!this["~standard"].async)try{let _=this._parseSync({data:$,path:[],parent:g});return gw(_)?{value:_.value}:{issues:g.common.issues}}catch(_){if((w=(v=_===null||_===void 0?void 0:_.message)===null||v===void 0?void 0:v.toLowerCase())===null||w===void 0?void 0:w.includes("encountered"))this["~standard"].async=!0;g.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:g}).then((_)=>gw(_)?{value:_.value}:{issues:g.common.issues})}async parseAsync($,v){let w=await this.safeParseAsync($,v);if(w.success)return w.data;throw w.error}async safeParseAsync($,v){let w={common:{issues:[],contextualErrorMap:v===null||v===void 0?void 0:v.errorMap,async:!0},path:(v===null||v===void 0?void 0:v.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Ev($)},g=this._parse({data:$,path:w.path,parent:w}),_=await(xg(g)?g:Promise.resolve(g));return lY(w,_)}refine($,v){let w=(g)=>{if(typeof v==="string"||typeof v>"u")return{message:v};else if(typeof v==="function")return v(g);else return v};return this._refinement((g,_)=>{let b=$(g),J=()=>_.addIssue({code:f.custom,...w(g)});if(typeof Promise<"u"&&b instanceof Promise)return b.then((D)=>{if(!D)return J(),!1;else return!0});if(!b)return J(),!1;else return!0})}refinement($,v){return this._refinement((w,g)=>{if(!$(w))return g.addIssue(typeof v==="function"?v(w,g):v),!1;else return!0})}_refinement($){return new a$({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(v)=>this["~validate"](v)}}optional(){return Gv.create(this,this._def)}nullable(){return Zv.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xv.create(this)}promise(){return Dw.create(this,this._def)}or($){return N6.create([this,$],this._def)}and($){return P6.create(this,$,this._def)}transform($){return new a$({...p(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:$}})}default($){let v=typeof $==="function"?$:()=>$;return new z6({...p(this._def),innerType:this,defaultValue:v,typeName:m.ZodDefault})}brand(){return new UU({typeName:m.ZodBranded,type:this,...p(this._def)})}catch($){let v=typeof $==="function"?$:()=>$;return new S6({...p(this._def),innerType:this,catchValue:v,typeName:m.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return rg.create(this,$)}readonly(){return u6.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var yP=/^c[^\s-]{8,}$/i,mP=/^[0-9a-z]+$/,rP=/^[0-9A-HJKMNP-TV-Z]{26}$/i,oP=/^[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,tP=/^[a-z0-9_-]{21}$/i,dP=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pP=/^[-+]?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)?)??$/,eP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,aP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",$G,sP=/^(?:(?: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])$/,$f=/^(?:(?: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])$/,vf=/^(([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]))$/,_f=/^(([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])$/,wf=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,gf=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mY="((\\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])))",bf=new RegExp(`^${mY}$`);function rY($){let v="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if($.precision)v=`${v}\\.\\d{${$.precision}}`;else if($.precision==null)v=`${v}(\\.\\d+)?`;return v}function Uf($){return new RegExp(`^${rY($)}$`)}function oY($){let v=`${mY}T${rY($)}`,w=[];if(w.push($.local?"Z?":"Z"),$.offset)w.push("([+-]\\d{2}:?\\d{2})");return v=`${v}(${w.join("|")})`,new RegExp(`^${v}$`)}function Jf($,v){if((v==="v4"||!v)&&sP.test($))return!0;if((v==="v6"||!v)&&vf.test($))return!0;return!1}function Df($,v){if(!dP.test($))return!1;try{let[w]=$.split("."),g=w.replace(/-/g,"+").replace(/_/g,"/").padEnd(w.length+(4-w.length%4)%4,"="),_=JSON.parse(atob(g));if(typeof _!=="object"||_===null)return!1;if(!_.typ||!_.alg)return!1;if(v&&_.alg!==v)return!1;return!0}catch(w){return!1}}function Xf($,v){if((v==="v4"||!v)&&$f.test($))return!0;if((v==="v6"||!v)&&_f.test($))return!0;return!1}class Dv extends s{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==l.string){let _=this._getOrReturnCtx($);return R(_,{code:f.invalid_type,expected:l.string,received:_.parsedType}),r}let w=new A$,g=void 0;for(let _ of this._def.checks)if(_.kind==="min"){if($.data.length<_.value)g=this._getOrReturnCtx($,g),R(g,{code:f.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),w.dirty()}else if(_.kind==="max"){if($.data.length>_.value)g=this._getOrReturnCtx($,g),R(g,{code:f.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),w.dirty()}else if(_.kind==="length"){let b=$.data.length>_.value,J=$.data.length<_.value;if(b||J){if(g=this._getOrReturnCtx($,g),b)R(g,{code:f.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});else if(J)R(g,{code:f.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});w.dirty()}}else if(_.kind==="email"){if(!eP.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"email",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="emoji"){if(!$G)$G=new RegExp(aP,"u");if(!$G.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"emoji",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="uuid"){if(!oP.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"uuid",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="nanoid"){if(!tP.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"nanoid",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="cuid"){if(!yP.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"cuid",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="cuid2"){if(!mP.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"cuid2",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="ulid"){if(!rP.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"ulid",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="url")try{new URL($.data)}catch(b){g=this._getOrReturnCtx($,g),R(g,{validation:"url",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="regex"){if(_.regex.lastIndex=0,!_.regex.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"regex",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="trim")$.data=$.data.trim();else if(_.kind==="includes"){if(!$.data.includes(_.value,_.position))g=this._getOrReturnCtx($,g),R(g,{code:f.invalid_string,validation:{includes:_.value,position:_.position},message:_.message}),w.dirty()}else if(_.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(_.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(_.kind==="startsWith"){if(!$.data.startsWith(_.value))g=this._getOrReturnCtx($,g),R(g,{code:f.invalid_string,validation:{startsWith:_.value},message:_.message}),w.dirty()}else if(_.kind==="endsWith"){if(!$.data.endsWith(_.value))g=this._getOrReturnCtx($,g),R(g,{code:f.invalid_string,validation:{endsWith:_.value},message:_.message}),w.dirty()}else if(_.kind==="datetime"){if(!oY(_).test($.data))g=this._getOrReturnCtx($,g),R(g,{code:f.invalid_string,validation:"datetime",message:_.message}),w.dirty()}else if(_.kind==="date"){if(!bf.test($.data))g=this._getOrReturnCtx($,g),R(g,{code:f.invalid_string,validation:"date",message:_.message}),w.dirty()}else if(_.kind==="time"){if(!Uf(_).test($.data))g=this._getOrReturnCtx($,g),R(g,{code:f.invalid_string,validation:"time",message:_.message}),w.dirty()}else if(_.kind==="duration"){if(!pP.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"duration",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="ip"){if(!Jf($.data,_.version))g=this._getOrReturnCtx($,g),R(g,{validation:"ip",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="jwt"){if(!Df($.data,_.alg))g=this._getOrReturnCtx($,g),R(g,{validation:"jwt",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="cidr"){if(!Xf($.data,_.version))g=this._getOrReturnCtx($,g),R(g,{validation:"cidr",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="base64"){if(!wf.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"base64",code:f.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="base64url"){if(!gf.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"base64url",code:f.invalid_string,message:_.message}),w.dirty()}else w$.assertNever(_);return{status:w.value,value:$.data}}_regex($,v,w){return this.refinement((g)=>$.test(g),{validation:v,code:f.invalid_string,...h.errToObj(w)})}_addCheck($){return new Dv({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...h.errToObj($)})}url($){return this._addCheck({kind:"url",...h.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...h.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...h.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...h.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...h.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...h.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...h.errToObj($)})}base64($){return this._addCheck({kind:"base64",...h.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...h.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...h.errToObj($)})}ip($){return this._addCheck({kind:"ip",...h.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...h.errToObj($)})}datetime($){var v,w;if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof($===null||$===void 0?void 0:$.precision)>"u"?null:$===null||$===void 0?void 0:$.precision,offset:(v=$===null||$===void 0?void 0:$.offset)!==null&&v!==void 0?v:!1,local:(w=$===null||$===void 0?void 0:$.local)!==null&&w!==void 0?w:!1,...h.errToObj($===null||$===void 0?void 0:$.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof($===null||$===void 0?void 0:$.precision)>"u"?null:$===null||$===void 0?void 0:$.precision,...h.errToObj($===null||$===void 0?void 0:$.message)})}duration($){return this._addCheck({kind:"duration",...h.errToObj($)})}regex($,v){return this._addCheck({kind:"regex",regex:$,...h.errToObj(v)})}includes($,v){return this._addCheck({kind:"includes",value:$,position:v===null||v===void 0?void 0:v.position,...h.errToObj(v===null||v===void 0?void 0:v.message)})}startsWith($,v){return this._addCheck({kind:"startsWith",value:$,...h.errToObj(v)})}endsWith($,v){return this._addCheck({kind:"endsWith",value:$,...h.errToObj(v)})}min($,v){return this._addCheck({kind:"min",value:$,...h.errToObj(v)})}max($,v){return this._addCheck({kind:"max",value:$,...h.errToObj(v)})}length($,v){return this._addCheck({kind:"length",value:$,...h.errToObj(v)})}nonempty($){return this.min(1,h.errToObj($))}trim(){return new Dv({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Dv({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Dv({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let v of this._def.checks)if(v.kind==="min"){if($===null||v.value>$)$=v.value}return $}get maxLength(){let $=null;for(let v of this._def.checks)if(v.kind==="max"){if($===null||v.value<$)$=v.value}return $}}Dv.create=($)=>{var v;return new Dv({checks:[],typeName:m.ZodString,coerce:(v=$===null||$===void 0?void 0:$.coerce)!==null&&v!==void 0?v:!1,...p($)})};function Gf($,v){let w=($.toString().split(".")[1]||"").length,g=(v.toString().split(".")[1]||"").length,_=w>g?w:g,b=parseInt($.toFixed(_).replace(".","")),J=parseInt(v.toFixed(_).replace(".",""));return b%J/Math.pow(10,_)}class f_ extends s{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==l.number){let _=this._getOrReturnCtx($);return R(_,{code:f.invalid_type,expected:l.number,received:_.parsedType}),r}let w=void 0,g=new A$;for(let _ of this._def.checks)if(_.kind==="int"){if(!w$.isInteger($.data))w=this._getOrReturnCtx($,w),R(w,{code:f.invalid_type,expected:"integer",received:"float",message:_.message}),g.dirty()}else if(_.kind==="min"){if(_.inclusive?$.data<_.value:$.data<=_.value)w=this._getOrReturnCtx($,w),R(w,{code:f.too_small,minimum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),g.dirty()}else if(_.kind==="max"){if(_.inclusive?$.data>_.value:$.data>=_.value)w=this._getOrReturnCtx($,w),R(w,{code:f.too_big,maximum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),g.dirty()}else if(_.kind==="multipleOf"){if(Gf($.data,_.value)!==0)w=this._getOrReturnCtx($,w),R(w,{code:f.not_multiple_of,multipleOf:_.value,message:_.message}),g.dirty()}else if(_.kind==="finite"){if(!Number.isFinite($.data))w=this._getOrReturnCtx($,w),R(w,{code:f.not_finite,message:_.message}),g.dirty()}else w$.assertNever(_);return{status:g.value,value:$.data}}gte($,v){return this.setLimit("min",$,!0,h.toString(v))}gt($,v){return this.setLimit("min",$,!1,h.toString(v))}lte($,v){return this.setLimit("max",$,!0,h.toString(v))}lt($,v){return this.setLimit("max",$,!1,h.toString(v))}setLimit($,v,w,g){return new f_({...this._def,checks:[...this._def.checks,{kind:$,value:v,inclusive:w,message:h.toString(g)}]})}_addCheck($){return new f_({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:h.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString($)})}multipleOf($,v){return this._addCheck({kind:"multipleOf",value:$,message:h.toString(v)})}finite($){return this._addCheck({kind:"finite",message:h.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString($)})}get minValue(){let $=null;for(let v of this._def.checks)if(v.kind==="min"){if($===null||v.value>$)$=v.value}return $}get maxValue(){let $=null;for(let v of this._def.checks)if(v.kind==="max"){if($===null||v.value<$)$=v.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&w$.isInteger($.value))}get isFinite(){let $=null,v=null;for(let w of this._def.checks)if(w.kind==="finite"||w.kind==="int"||w.kind==="multipleOf")return!0;else if(w.kind==="min"){if(v===null||w.value>v)v=w.value}else if(w.kind==="max"){if($===null||w.value<$)$=w.value}return Number.isFinite(v)&&Number.isFinite($)}}f_.create=($)=>{return new f_({checks:[],typeName:m.ZodNumber,coerce:($===null||$===void 0?void 0:$.coerce)||!1,...p($)})};class A_ extends s{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch(_){return this._getInvalidInput($)}if(this._getType($)!==l.bigint)return this._getInvalidInput($);let w=void 0,g=new A$;for(let _ of this._def.checks)if(_.kind==="min"){if(_.inclusive?$.data<_.value:$.data<=_.value)w=this._getOrReturnCtx($,w),R(w,{code:f.too_small,type:"bigint",minimum:_.value,inclusive:_.inclusive,message:_.message}),g.dirty()}else if(_.kind==="max"){if(_.inclusive?$.data>_.value:$.data>=_.value)w=this._getOrReturnCtx($,w),R(w,{code:f.too_big,type:"bigint",maximum:_.value,inclusive:_.inclusive,message:_.message}),g.dirty()}else if(_.kind==="multipleOf"){if($.data%_.value!==BigInt(0))w=this._getOrReturnCtx($,w),R(w,{code:f.not_multiple_of,multipleOf:_.value,message:_.message}),g.dirty()}else w$.assertNever(_);return{status:g.value,value:$.data}}_getInvalidInput($){let v=this._getOrReturnCtx($);return R(v,{code:f.invalid_type,expected:l.bigint,received:v.parsedType}),r}gte($,v){return this.setLimit("min",$,!0,h.toString(v))}gt($,v){return this.setLimit("min",$,!1,h.toString(v))}lte($,v){return this.setLimit("max",$,!0,h.toString(v))}lt($,v){return this.setLimit("max",$,!1,h.toString(v))}setLimit($,v,w,g){return new A_({...this._def,checks:[...this._def.checks,{kind:$,value:v,inclusive:w,message:h.toString(g)}]})}_addCheck($){return new A_({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString($)})}multipleOf($,v){return this._addCheck({kind:"multipleOf",value:$,message:h.toString(v)})}get minValue(){let $=null;for(let v of this._def.checks)if(v.kind==="min"){if($===null||v.value>$)$=v.value}return $}get maxValue(){let $=null;for(let v of this._def.checks)if(v.kind==="max"){if($===null||v.value<$)$=v.value}return $}}A_.create=($)=>{var v;return new A_({checks:[],typeName:m.ZodBigInt,coerce:(v=$===null||$===void 0?void 0:$.coerce)!==null&&v!==void 0?v:!1,...p($)})};class O6 extends s{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==l.boolean){let w=this._getOrReturnCtx($);return R(w,{code:f.invalid_type,expected:l.boolean,received:w.parsedType}),r}return T$($.data)}}O6.create=($)=>{return new O6({typeName:m.ZodBoolean,coerce:($===null||$===void 0?void 0:$.coerce)||!1,...p($)})};class bw extends s{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==l.date){let _=this._getOrReturnCtx($);return R(_,{code:f.invalid_type,expected:l.date,received:_.parsedType}),r}if(isNaN($.data.getTime())){let _=this._getOrReturnCtx($);return R(_,{code:f.invalid_date}),r}let w=new A$,g=void 0;for(let _ of this._def.checks)if(_.kind==="min"){if($.data.getTime()<_.value)g=this._getOrReturnCtx($,g),R(g,{code:f.too_small,message:_.message,inclusive:!0,exact:!1,minimum:_.value,type:"date"}),w.dirty()}else if(_.kind==="max"){if($.data.getTime()>_.value)g=this._getOrReturnCtx($,g),R(g,{code:f.too_big,message:_.message,inclusive:!0,exact:!1,maximum:_.value,type:"date"}),w.dirty()}else w$.assertNever(_);return{status:w.value,value:new Date($.data.getTime())}}_addCheck($){return new bw({...this._def,checks:[...this._def.checks,$]})}min($,v){return this._addCheck({kind:"min",value:$.getTime(),message:h.toString(v)})}max($,v){return this._addCheck({kind:"max",value:$.getTime(),message:h.toString(v)})}get minDate(){let $=null;for(let v of this._def.checks)if(v.kind==="min"){if($===null||v.value>$)$=v.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let v of this._def.checks)if(v.kind==="max"){if($===null||v.value<$)$=v.value}return $!=null?new Date($):null}}bw.create=($)=>{return new bw({checks:[],coerce:($===null||$===void 0?void 0:$.coerce)||!1,typeName:m.ZodDate,...p($)})};class lg extends s{_parse($){if(this._getType($)!==l.symbol){let w=this._getOrReturnCtx($);return R(w,{code:f.invalid_type,expected:l.symbol,received:w.parsedType}),r}return T$($.data)}}lg.create=($)=>{return new lg({typeName:m.ZodSymbol,...p($)})};class i6 extends s{_parse($){if(this._getType($)!==l.undefined){let w=this._getOrReturnCtx($);return R(w,{code:f.invalid_type,expected:l.undefined,received:w.parsedType}),r}return T$($.data)}}i6.create=($)=>{return new i6({typeName:m.ZodUndefined,...p($)})};class k6 extends s{_parse($){if(this._getType($)!==l.null){let w=this._getOrReturnCtx($);return R(w,{code:f.invalid_type,expected:l.null,received:w.parsedType}),r}return T$($.data)}}k6.create=($)=>{return new k6({typeName:m.ZodNull,...p($)})};class Uw extends s{constructor(){super(...arguments);this._any=!0}_parse($){return T$($.data)}}Uw.create=($)=>{return new Uw({typeName:m.ZodAny,...p($)})};class P_ extends s{constructor(){super(...arguments);this._unknown=!0}_parse($){return T$($.data)}}P_.create=($)=>{return new P_({typeName:m.ZodUnknown,...p($)})};class Kv extends s{_parse($){let v=this._getOrReturnCtx($);return R(v,{code:f.invalid_type,expected:l.never,received:v.parsedType}),r}}Kv.create=($)=>{return new Kv({typeName:m.ZodNever,...p($)})};class hg extends s{_parse($){if(this._getType($)!==l.undefined){let w=this._getOrReturnCtx($);return R(w,{code:f.invalid_type,expected:l.void,received:w.parsedType}),r}return T$($.data)}}hg.create=($)=>{return new hg({typeName:m.ZodVoid,...p($)})};class Xv extends s{_parse($){let{ctx:v,status:w}=this._processInputParams($),g=this._def;if(v.parsedType!==l.array)return R(v,{code:f.invalid_type,expected:l.array,received:v.parsedType}),r;if(g.exactLength!==null){let b=v.data.length>g.exactLength.value,J=v.data.length<g.exactLength.value;if(b||J)R(v,{code:b?f.too_big:f.too_small,minimum:J?g.exactLength.value:void 0,maximum:b?g.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:g.exactLength.message}),w.dirty()}if(g.minLength!==null){if(v.data.length<g.minLength.value)R(v,{code:f.too_small,minimum:g.minLength.value,type:"array",inclusive:!0,exact:!1,message:g.minLength.message}),w.dirty()}if(g.maxLength!==null){if(v.data.length>g.maxLength.value)R(v,{code:f.too_big,maximum:g.maxLength.value,type:"array",inclusive:!0,exact:!1,message:g.maxLength.message}),w.dirty()}if(v.common.async)return Promise.all([...v.data].map((b,J)=>{return g.type._parseAsync(new Yv(v,b,v.path,J))})).then((b)=>{return A$.mergeArray(w,b)});let _=[...v.data].map((b,J)=>{return g.type._parseSync(new Yv(v,b,v.path,J))});return A$.mergeArray(w,_)}get element(){return this._def.type}min($,v){return new Xv({...this._def,minLength:{value:$,message:h.toString(v)}})}max($,v){return new Xv({...this._def,maxLength:{value:$,message:h.toString(v)}})}length($,v){return new Xv({...this._def,exactLength:{value:$,message:h.toString(v)}})}nonempty($){return this.min(1,$)}}Xv.create=($,v)=>{return new Xv({type:$,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,...p(v)})};function V6($){if($ instanceof I$){let v={};for(let w in $.shape){let g=$.shape[w];v[w]=Gv.create(V6(g))}return new I$({...$._def,shape:()=>v})}else if($ instanceof Xv)return new Xv({...$._def,type:V6($.element)});else if($ instanceof Gv)return Gv.create(V6($.unwrap()));else if($ instanceof Zv)return Zv.create(V6($.unwrap()));else if($ instanceof Ov)return Ov.create($.items.map((v)=>V6(v)));else return $}class I$ extends s{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),v=w$.objectKeys($);return this._cached={shape:$,keys:v}}_parse($){if(this._getType($)!==l.object){let X=this._getOrReturnCtx($);return R(X,{code:f.invalid_type,expected:l.object,received:X.parsedType}),r}let{status:w,ctx:g}=this._processInputParams($),{shape:_,keys:b}=this._getCached(),J=[];if(!(this._def.catchall instanceof Kv&&this._def.unknownKeys==="strip")){for(let X in g.data)if(!b.includes(X))J.push(X)}let D=[];for(let X of b){let G=_[X],Y=g.data[X];D.push({key:{status:"valid",value:X},value:G._parse(new Yv(g,Y,g.path,X)),alwaysSet:X in g.data})}if(this._def.catchall instanceof Kv){let X=this._def.unknownKeys;if(X==="passthrough")for(let G of J)D.push({key:{status:"valid",value:G},value:{status:"valid",value:g.data[G]}});else if(X==="strict"){if(J.length>0)R(g,{code:f.unrecognized_keys,keys:J}),w.dirty()}else if(X==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let X=this._def.catchall;for(let G of J){let Y=g.data[G];D.push({key:{status:"valid",value:G},value:X._parse(new Yv(g,Y,g.path,G)),alwaysSet:G in g.data})}}if(g.common.async)return Promise.resolve().then(async()=>{let X=[];for(let G of D){let Y=await G.key,Q=await G.value;X.push({key:Y,value:Q,alwaysSet:G.alwaysSet})}return X}).then((X)=>{return A$.mergeObjectSync(w,X)});else return A$.mergeObjectSync(w,D)}get shape(){return this._def.shape()}strict($){return h.errToObj,new I$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(v,w)=>{var g,_,b,J;let D=(b=(_=(g=this._def).errorMap)===null||_===void 0?void 0:_.call(g,v,w).message)!==null&&b!==void 0?b:w.defaultError;if(v.code==="unrecognized_keys")return{message:(J=h.errToObj($).message)!==null&&J!==void 0?J:D};return{message:D}}}:{}})}strip(){return new I$({...this._def,unknownKeys:"strip"})}passthrough(){return new I$({...this._def,unknownKeys:"passthrough"})}extend($){return new I$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new I$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:m.ZodObject})}setKey($,v){return this.augment({[$]:v})}catchall($){return new I$({...this._def,catchall:$})}pick($){let v={};return w$.objectKeys($).forEach((w)=>{if($[w]&&this.shape[w])v[w]=this.shape[w]}),new I$({...this._def,shape:()=>v})}omit($){let v={};return w$.objectKeys(this.shape).forEach((w)=>{if(!$[w])v[w]=this.shape[w]}),new I$({...this._def,shape:()=>v})}deepPartial(){return V6(this)}partial($){let v={};return w$.objectKeys(this.shape).forEach((w)=>{let g=this.shape[w];if($&&!$[w])v[w]=g;else v[w]=g.optional()}),new I$({...this._def,shape:()=>v})}required($){let v={};return w$.objectKeys(this.shape).forEach((w)=>{if($&&!$[w])v[w]=this.shape[w];else{let _=this.shape[w];while(_ instanceof Gv)_=_._def.innerType;v[w]=_}}),new I$({...this._def,shape:()=>v})}keyof(){return tY(w$.objectKeys(this.shape))}}I$.create=($,v)=>{return new I$({shape:()=>$,unknownKeys:"strip",catchall:Kv.create(),typeName:m.ZodObject,...p(v)})};I$.strictCreate=($,v)=>{return new I$({shape:()=>$,unknownKeys:"strict",catchall:Kv.create(),typeName:m.ZodObject,...p(v)})};I$.lazycreate=($,v)=>{return new I$({shape:$,unknownKeys:"strip",catchall:Kv.create(),typeName:m.ZodObject,...p(v)})};class N6 extends s{_parse($){let{ctx:v}=this._processInputParams($),w=this._def.options;function g(_){for(let J of _)if(J.result.status==="valid")return J.result;for(let J of _)if(J.result.status==="dirty")return v.common.issues.push(...J.ctx.common.issues),J.result;let b=_.map((J)=>new c$(J.ctx.common.issues));return R(v,{code:f.invalid_union,unionErrors:b}),r}if(v.common.async)return Promise.all(w.map(async(_)=>{let b={...v,common:{...v.common,issues:[]},parent:null};return{result:await _._parseAsync({data:v.data,path:v.path,parent:b}),ctx:b}})).then(g);else{let _=void 0,b=[];for(let D of w){let X={...v,common:{...v.common,issues:[]},parent:null},G=D._parseSync({data:v.data,path:v.path,parent:X});if(G.status==="valid")return G;else if(G.status==="dirty"&&!_)_={result:G,ctx:X};if(X.common.issues.length)b.push(X.common.issues)}if(_)return v.common.issues.push(..._.ctx.common.issues),_.result;let J=b.map((D)=>new c$(D));return R(v,{code:f.invalid_union,unionErrors:J}),r}}get options(){return this._def.options}}N6.create=($,v)=>{return new N6({options:$,typeName:m.ZodUnion,...p(v)})};var Cv=($)=>{if($ instanceof f6)return Cv($.schema);else if($ instanceof a$)return Cv($.innerType());else if($ instanceof A6)return[$.value];else if($ instanceof M_)return $.options;else if($ instanceof M6)return w$.objectValues($.enum);else if($ instanceof z6)return Cv($._def.innerType);else if($ instanceof i6)return[void 0];else if($ instanceof k6)return[null];else if($ instanceof Gv)return[void 0,...Cv($.unwrap())];else if($ instanceof Zv)return[null,...Cv($.unwrap())];else if($ instanceof UU)return Cv($.unwrap());else if($ instanceof u6)return Cv($.unwrap());else if($ instanceof S6)return Cv($._def.innerType);else return[]};class bU extends s{_parse($){let{ctx:v}=this._processInputParams($);if(v.parsedType!==l.object)return R(v,{code:f.invalid_type,expected:l.object,received:v.parsedType}),r;let w=this.discriminator,g=v.data[w],_=this.optionsMap.get(g);if(!_)return R(v,{code:f.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[w]}),r;if(v.common.async)return _._parseAsync({data:v.data,path:v.path,parent:v});else return _._parseSync({data:v.data,path:v.path,parent:v})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,v,w){let g=new Map;for(let _ of v){let b=Cv(_.shape[$]);if(!b.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let J of b){if(g.has(J))throw Error(`Discriminator property ${String($)} has duplicate value ${String(J)}`);g.set(J,_)}}return new bU({typeName:m.ZodDiscriminatedUnion,discriminator:$,options:v,optionsMap:g,...p(w)})}}function gG($,v){let w=Ev($),g=Ev(v);if($===v)return{valid:!0,data:$};else if(w===l.object&&g===l.object){let _=w$.objectKeys(v),b=w$.objectKeys($).filter((D)=>_.indexOf(D)!==-1),J={...$,...v};for(let D of b){let X=gG($[D],v[D]);if(!X.valid)return{valid:!1};J[D]=X.data}return{valid:!0,data:J}}else if(w===l.array&&g===l.array){if($.length!==v.length)return{valid:!1};let _=[];for(let b=0;b<$.length;b++){let J=$[b],D=v[b],X=gG(J,D);if(!X.valid)return{valid:!1};_.push(X.data)}return{valid:!0,data:_}}else if(w===l.date&&g===l.date&&+$===+v)return{valid:!0,data:$};else return{valid:!1}}class P6 extends s{_parse($){let{status:v,ctx:w}=this._processInputParams($),g=(_,b)=>{if(_G(_)||_G(b))return r;let J=gG(_.value,b.value);if(!J.valid)return R(w,{code:f.invalid_intersection_types}),r;if(wG(_)||wG(b))v.dirty();return{status:v.value,value:J.data}};if(w.common.async)return Promise.all([this._def.left._parseAsync({data:w.data,path:w.path,parent:w}),this._def.right._parseAsync({data:w.data,path:w.path,parent:w})]).then(([_,b])=>g(_,b));else return g(this._def.left._parseSync({data:w.data,path:w.path,parent:w}),this._def.right._parseSync({data:w.data,path:w.path,parent:w}))}}P6.create=($,v,w)=>{return new P6({left:$,right:v,typeName:m.ZodIntersection,...p(w)})};class Ov extends s{_parse($){let{status:v,ctx:w}=this._processInputParams($);if(w.parsedType!==l.array)return R(w,{code:f.invalid_type,expected:l.array,received:w.parsedType}),r;if(w.data.length<this._def.items.length)return R(w,{code:f.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r;if(!this._def.rest&&w.data.length>this._def.items.length)R(w,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v.dirty();let _=[...w.data].map((b,J)=>{let D=this._def.items[J]||this._def.rest;if(!D)return null;return D._parse(new Yv(w,b,w.path,J))}).filter((b)=>!!b);if(w.common.async)return Promise.all(_).then((b)=>{return A$.mergeArray(v,b)});else return A$.mergeArray(v,_)}get items(){return this._def.items}rest($){return new Ov({...this._def,rest:$})}}Ov.create=($,v)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ov({items:$,typeName:m.ZodTuple,rest:null,...p(v)})};class cg extends s{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:v,ctx:w}=this._processInputParams($);if(w.parsedType!==l.object)return R(w,{code:f.invalid_type,expected:l.object,received:w.parsedType}),r;let g=[],_=this._def.keyType,b=this._def.valueType;for(let J in w.data)g.push({key:_._parse(new Yv(w,J,w.path,J)),value:b._parse(new Yv(w,w.data[J],w.path,J)),alwaysSet:J in w.data});if(w.common.async)return A$.mergeObjectAsync(v,g);else return A$.mergeObjectSync(v,g)}get element(){return this._def.valueType}static create($,v,w){if(v instanceof s)return new cg({keyType:$,valueType:v,typeName:m.ZodRecord,...p(w)});return new cg({keyType:Dv.create(),valueType:$,typeName:m.ZodRecord,...p(v)})}}class yg extends s{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:v,ctx:w}=this._processInputParams($);if(w.parsedType!==l.map)return R(w,{code:f.invalid_type,expected:l.map,received:w.parsedType}),r;let g=this._def.keyType,_=this._def.valueType,b=[...w.data.entries()].map(([J,D],X)=>{return{key:g._parse(new Yv(w,J,w.path,[X,"key"])),value:_._parse(new Yv(w,D,w.path,[X,"value"]))}});if(w.common.async){let J=new Map;return Promise.resolve().then(async()=>{for(let D of b){let X=await D.key,G=await D.value;if(X.status==="aborted"||G.status==="aborted")return r;if(X.status==="dirty"||G.status==="dirty")v.dirty();J.set(X.value,G.value)}return{status:v.value,value:J}})}else{let J=new Map;for(let D of b){let{key:X,value:G}=D;if(X.status==="aborted"||G.status==="aborted")return r;if(X.status==="dirty"||G.status==="dirty")v.dirty();J.set(X.value,G.value)}return{status:v.value,value:J}}}}yg.create=($,v,w)=>{return new yg({valueType:v,keyType:$,typeName:m.ZodMap,...p(w)})};class Jw extends s{_parse($){let{status:v,ctx:w}=this._processInputParams($);if(w.parsedType!==l.set)return R(w,{code:f.invalid_type,expected:l.set,received:w.parsedType}),r;let g=this._def;if(g.minSize!==null){if(w.data.size<g.minSize.value)R(w,{code:f.too_small,minimum:g.minSize.value,type:"set",inclusive:!0,exact:!1,message:g.minSize.message}),v.dirty()}if(g.maxSize!==null){if(w.data.size>g.maxSize.value)R(w,{code:f.too_big,maximum:g.maxSize.value,type:"set",inclusive:!0,exact:!1,message:g.maxSize.message}),v.dirty()}let _=this._def.valueType;function b(D){let X=new Set;for(let G of D){if(G.status==="aborted")return r;if(G.status==="dirty")v.dirty();X.add(G.value)}return{status:v.value,value:X}}let J=[...w.data.values()].map((D,X)=>_._parse(new Yv(w,D,w.path,X)));if(w.common.async)return Promise.all(J).then((D)=>b(D));else return b(J)}min($,v){return new Jw({...this._def,minSize:{value:$,message:h.toString(v)}})}max($,v){return new Jw({...this._def,maxSize:{value:$,message:h.toString(v)}})}size($,v){return this.min($,v).max($,v)}nonempty($){return this.min(1,$)}}Jw.create=($,v)=>{return new Jw({valueType:$,minSize:null,maxSize:null,typeName:m.ZodSet,...p(v)})};class F6 extends s{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:v}=this._processInputParams($);if(v.parsedType!==l.function)return R(v,{code:f.invalid_type,expected:l.function,received:v.parsedType}),r;function w(J,D){return wU({data:J,path:v.path,errorMaps:[v.common.contextualErrorMap,v.schemaErrorMap,_U(),K6].filter((X)=>!!X),issueData:{code:f.invalid_arguments,argumentsError:D}})}function g(J,D){return wU({data:J,path:v.path,errorMaps:[v.common.contextualErrorMap,v.schemaErrorMap,_U(),K6].filter((X)=>!!X),issueData:{code:f.invalid_return_type,returnTypeError:D}})}let _={errorMap:v.common.contextualErrorMap},b=v.data;if(this._def.returns instanceof Dw){let J=this;return T$(async function(...D){let X=new c$([]),G=await J._def.args.parseAsync(D,_).catch((H)=>{throw X.addIssue(w(D,H)),X}),Y=await Reflect.apply(b,this,G);return await J._def.returns._def.type.parseAsync(Y,_).catch((H)=>{throw X.addIssue(g(Y,H)),X})})}else{let J=this;return T$(function(...D){let X=J._def.args.safeParse(D,_);if(!X.success)throw new c$([w(D,X.error)]);let G=Reflect.apply(b,this,X.data),Y=J._def.returns.safeParse(G,_);if(!Y.success)throw new c$([g(G,Y.error)]);return Y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new F6({...this._def,args:Ov.create($).rest(P_.create())})}returns($){return new F6({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,v,w){return new F6({args:$?$:Ov.create([]).rest(P_.create()),returns:v||P_.create(),typeName:m.ZodFunction,...p(w)})}}class f6 extends s{get schema(){return this._def.getter()}_parse($){let{ctx:v}=this._processInputParams($);return this._def.getter()._parse({data:v.data,path:v.path,parent:v})}}f6.create=($,v)=>{return new f6({getter:$,typeName:m.ZodLazy,...p(v)})};class A6 extends s{_parse($){if($.data!==this._def.value){let v=this._getOrReturnCtx($);return R(v,{received:v.data,code:f.invalid_literal,expected:this._def.value}),r}return{status:"valid",value:$.data}}get value(){return this._def.value}}A6.create=($,v)=>{return new A6({value:$,typeName:m.ZodLiteral,...p(v)})};function tY($,v){return new M_({values:$,typeName:m.ZodEnum,...p(v)})}class M_ extends s{constructor(){super(...arguments);Eg.set(this,void 0)}_parse($){if(typeof $.data!=="string"){let v=this._getOrReturnCtx($),w=this._def.values;return R(v,{expected:w$.joinValues(w),received:v.parsedType,code:f.invalid_type}),r}if(!gU(this,Eg,"f"))yY(this,Eg,new Set(this._def.values),"f");if(!gU(this,Eg,"f").has($.data)){let v=this._getOrReturnCtx($),w=this._def.values;return R(v,{received:v.data,code:f.invalid_enum_value,options:w}),r}return T$($.data)}get options(){return this._def.values}get enum(){let $={};for(let v of this._def.values)$[v]=v;return $}get Values(){let $={};for(let v of this._def.values)$[v]=v;return $}get Enum(){let $={};for(let v of this._def.values)$[v]=v;return $}extract($,v=this._def){return M_.create($,{...this._def,...v})}exclude($,v=this._def){return M_.create(this.options.filter((w)=>!$.includes(w)),{...this._def,...v})}}Eg=new WeakMap;M_.create=tY;class M6 extends s{constructor(){super(...arguments);Zg.set(this,void 0)}_parse($){let v=w$.getValidEnumValues(this._def.values),w=this._getOrReturnCtx($);if(w.parsedType!==l.string&&w.parsedType!==l.number){let g=w$.objectValues(v);return R(w,{expected:w$.joinValues(g),received:w.parsedType,code:f.invalid_type}),r}if(!gU(this,Zg,"f"))yY(this,Zg,new Set(w$.getValidEnumValues(this._def.values)),"f");if(!gU(this,Zg,"f").has($.data)){let g=w$.objectValues(v);return R(w,{received:w.data,code:f.invalid_enum_value,options:g}),r}return T$($.data)}get enum(){return this._def.values}}Zg=new WeakMap;M6.create=($,v)=>{return new M6({values:$,typeName:m.ZodNativeEnum,...p(v)})};class Dw extends s{unwrap(){return this._def.type}_parse($){let{ctx:v}=this._processInputParams($);if(v.parsedType!==l.promise&&v.common.async===!1)return R(v,{code:f.invalid_type,expected:l.promise,received:v.parsedType}),r;let w=v.parsedType===l.promise?v.data:Promise.resolve(v.data);return T$(w.then((g)=>{return this._def.type.parseAsync(g,{path:v.path,errorMap:v.common.contextualErrorMap})}))}}Dw.create=($,v)=>{return new Dw({type:$,typeName:m.ZodPromise,...p(v)})};class a$ extends s{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:v,ctx:w}=this._processInputParams($),g=this._def.effect||null,_={addIssue:(b)=>{if(R(w,b),b.fatal)v.abort();else v.dirty()},get path(){return w.path}};if(_.addIssue=_.addIssue.bind(_),g.type==="preprocess"){let b=g.transform(w.data,_);if(w.common.async)return Promise.resolve(b).then(async(J)=>{if(v.value==="aborted")return r;let D=await this._def.schema._parseAsync({data:J,path:w.path,parent:w});if(D.status==="aborted")return r;if(D.status==="dirty")return j6(D.value);if(v.value==="dirty")return j6(D.value);return D});else{if(v.value==="aborted")return r;let J=this._def.schema._parseSync({data:b,path:w.path,parent:w});if(J.status==="aborted")return r;if(J.status==="dirty")return j6(J.value);if(v.value==="dirty")return j6(J.value);return J}}if(g.type==="refinement"){let b=(J)=>{let D=g.refinement(J,_);if(w.common.async)return Promise.resolve(D);if(D instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return J};if(w.common.async===!1){let J=this._def.schema._parseSync({data:w.data,path:w.path,parent:w});if(J.status==="aborted")return r;if(J.status==="dirty")v.dirty();return b(J.value),{status:v.value,value:J.value}}else return this._def.schema._parseAsync({data:w.data,path:w.path,parent:w}).then((J)=>{if(J.status==="aborted")return r;if(J.status==="dirty")v.dirty();return b(J.value).then(()=>{return{status:v.value,value:J.value}})})}if(g.type==="transform")if(w.common.async===!1){let b=this._def.schema._parseSync({data:w.data,path:w.path,parent:w});if(!gw(b))return b;let J=g.transform(b.value,_);if(J instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:v.value,value:J}}else return this._def.schema._parseAsync({data:w.data,path:w.path,parent:w}).then((b)=>{if(!gw(b))return b;return Promise.resolve(g.transform(b.value,_)).then((J)=>({status:v.value,value:J}))});w$.assertNever(g)}}a$.create=($,v,w)=>{return new a$({schema:$,typeName:m.ZodEffects,effect:v,...p(w)})};a$.createWithPreprocess=($,v,w)=>{return new a$({schema:v,effect:{type:"preprocess",transform:$},typeName:m.ZodEffects,...p(w)})};class Gv extends s{_parse($){if(this._getType($)===l.undefined)return T$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Gv.create=($,v)=>{return new Gv({innerType:$,typeName:m.ZodOptional,...p(v)})};class Zv extends s{_parse($){if(this._getType($)===l.null)return T$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Zv.create=($,v)=>{return new Zv({innerType:$,typeName:m.ZodNullable,...p(v)})};class z6 extends s{_parse($){let{ctx:v}=this._processInputParams($),w=v.data;if(v.parsedType===l.undefined)w=this._def.defaultValue();return this._def.innerType._parse({data:w,path:v.path,parent:v})}removeDefault(){return this._def.innerType}}z6.create=($,v)=>{return new z6({innerType:$,typeName:m.ZodDefault,defaultValue:typeof v.default==="function"?v.default:()=>v.default,...p(v)})};class S6 extends s{_parse($){let{ctx:v}=this._processInputParams($),w={...v,common:{...v.common,issues:[]}},g=this._def.innerType._parse({data:w.data,path:w.path,parent:{...w}});if(xg(g))return g.then((_)=>{return{status:"valid",value:_.status==="valid"?_.value:this._def.catchValue({get error(){return new c$(w.common.issues)},input:w.data})}});else return{status:"valid",value:g.status==="valid"?g.value:this._def.catchValue({get error(){return new c$(w.common.issues)},input:w.data})}}removeCatch(){return this._def.innerType}}S6.create=($,v)=>{return new S6({innerType:$,typeName:m.ZodCatch,catchValue:typeof v.catch==="function"?v.catch:()=>v.catch,...p(v)})};class mg extends s{_parse($){if(this._getType($)!==l.nan){let w=this._getOrReturnCtx($);return R(w,{code:f.invalid_type,expected:l.nan,received:w.parsedType}),r}return{status:"valid",value:$.data}}}mg.create=($)=>{return new mg({typeName:m.ZodNaN,...p($)})};var Yf=Symbol("zod_brand");class UU extends s{_parse($){let{ctx:v}=this._processInputParams($),w=v.data;return this._def.type._parse({data:w,path:v.path,parent:v})}unwrap(){return this._def.type}}class rg extends s{_parse($){let{status:v,ctx:w}=this._processInputParams($);if(w.common.async)return(async()=>{let _=await this._def.in._parseAsync({data:w.data,path:w.path,parent:w});if(_.status==="aborted")return r;if(_.status==="dirty")return v.dirty(),j6(_.value);else return this._def.out._parseAsync({data:_.value,path:w.path,parent:w})})();else{let g=this._def.in._parseSync({data:w.data,path:w.path,parent:w});if(g.status==="aborted")return r;if(g.status==="dirty")return v.dirty(),{status:"dirty",value:g.value};else return this._def.out._parseSync({data:g.value,path:w.path,parent:w})}}static create($,v){return new rg({in:$,out:v,typeName:m.ZodPipeline})}}class u6 extends s{_parse($){let v=this._def.innerType._parse($),w=(g)=>{if(gw(g))g.value=Object.freeze(g.value);return g};return xg(v)?v.then((g)=>w(g)):w(v)}unwrap(){return this._def.innerType}}u6.create=($,v)=>{return new u6({innerType:$,typeName:m.ZodReadonly,...p(v)})};function dY($,v={},w){if($)return Uw.create().superRefine((g,_)=>{var b,J;if(!$(g)){let D=typeof v==="function"?v(g):typeof v==="string"?{message:v}:v,X=(J=(b=D.fatal)!==null&&b!==void 0?b:w)!==null&&J!==void 0?J:!0,G=typeof D==="string"?{message:D}:D;_.addIssue({code:"custom",...G,fatal:X})}});return Uw.create()}var Qf={object:I$.lazycreate},m;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(m||(m={}));var Wf=($,v={message:`Input not instance of ${$.name}`})=>dY((w)=>w instanceof $,v),pY=Dv.create,eY=f_.create,Hf=mg.create,nf=A_.create,aY=O6.create,qf=bw.create,If=lg.create,Bf=i6.create,Lf=k6.create,Vf=Uw.create,jf=P_.create,Ff=Kv.create,Kf=hg.create,Of=Xv.create,kf=I$.create,Nf=I$.strictCreate,Pf=N6.create,ff=bU.create,Af=P6.create,Mf=Ov.create,zf=cg.create,Sf=yg.create,uf=Jw.create,Tf=F6.create,Rf=f6.create,Cf=A6.create,Ef=M_.create,Zf=M6.create,xf=Dw.create,hY=a$.create,lf=Gv.create,hf=Zv.create,cf=a$.createWithPreprocess,yf=rg.create,mf=()=>pY().optional(),rf=()=>eY().optional(),of=()=>aY().optional(),tf={string:($)=>Dv.create({...$,coerce:!0}),number:($)=>f_.create({...$,coerce:!0}),boolean:($)=>O6.create({...$,coerce:!0}),bigint:($)=>A_.create({...$,coerce:!0}),date:($)=>bw.create({...$,coerce:!0})},df=r,n=Object.freeze({__proto__:null,defaultErrorMap:K6,setErrorMap:hP,getErrorMap:_U,makeIssue:wU,EMPTY_PATH:cP,addIssueToContext:R,ParseStatus:A$,INVALID:r,DIRTY:j6,OK:T$,isAborted:_G,isDirty:wG,isValid:gw,isAsync:xg,get util(){return w$},get objectUtil(){return vG},ZodParsedType:l,getParsedType:Ev,ZodType:s,datetimeRegex:oY,ZodString:Dv,ZodNumber:f_,ZodBigInt:A_,ZodBoolean:O6,ZodDate:bw,ZodSymbol:lg,ZodUndefined:i6,ZodNull:k6,ZodAny:Uw,ZodUnknown:P_,ZodNever:Kv,ZodVoid:hg,ZodArray:Xv,ZodObject:I$,ZodUnion:N6,ZodDiscriminatedUnion:bU,ZodIntersection:P6,ZodTuple:Ov,ZodRecord:cg,ZodMap:yg,ZodSet:Jw,ZodFunction:F6,ZodLazy:f6,ZodLiteral:A6,ZodEnum:M_,ZodNativeEnum:M6,ZodPromise:Dw,ZodEffects:a$,ZodTransformer:a$,ZodOptional:Gv,ZodNullable:Zv,ZodDefault:z6,ZodCatch:S6,ZodNaN:mg,BRAND:Yf,ZodBranded:UU,ZodPipeline:rg,ZodReadonly:u6,custom:dY,Schema:s,ZodSchema:s,late:Qf,get ZodFirstPartyTypeKind(){return m},coerce:tf,any:Vf,array:Of,bigint:nf,boolean:aY,date:qf,discriminatedUnion:ff,effect:hY,enum:Ef,function:Tf,instanceof:Wf,intersection:Af,lazy:Rf,literal:Cf,map:Sf,nan:Hf,nativeEnum:Zf,never:Ff,null:Lf,nullable:hf,number:eY,object:kf,oboolean:of,onumber:rf,optional:lf,ostring:mf,pipeline:yf,preprocess:cf,promise:xf,record:zf,set:uf,strictObject:Nf,string:pY,symbol:If,transformer:hY,tuple:Mf,undefined:Bf,union:Pf,unknown:jf,void:Kf,NEVER:df,ZodIssueCode:f,quotelessJson:lP,ZodError:c$});var bG="2024-11-05",sY=[bG,"2024-10-07"],JU="2.0",$Q=n.union([n.string(),n.number().int()]),vQ=n.string(),Qv=n.object({_meta:n.optional(n.object({progressToken:n.optional($Q)}).passthrough())}).passthrough(),y$=n.object({method:n.string(),params:n.optional(Qv)}),og=n.object({_meta:n.optional(n.object({}).passthrough())}).passthrough(),iv=n.object({method:n.string(),params:n.optional(og)}),Wv=n.object({_meta:n.optional(n.object({}).passthrough())}).passthrough(),DU=n.union([n.string(),n.number().int()]),pf=n.object({jsonrpc:n.literal(JU),id:DU}).merge(y$).strict(),ef=n.object({jsonrpc:n.literal(JU)}).merge(iv).strict(),af=n.object({jsonrpc:n.literal(JU),id:DU,result:Wv}).strict(),Xw;(function($){$[$.ConnectionClosed=-1]="ConnectionClosed",$[$.RequestTimeout=-2]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError"})(Xw||(Xw={}));var sf=n.object({jsonrpc:n.literal(JU),id:DU,error:n.object({code:n.number().int(),message:n.string(),data:n.optional(n.unknown())})}).strict(),_Q=n.union([pf,ef,af,sf]),XU=Wv.strict(),GU=iv.extend({method:n.literal("notifications/cancelled"),params:og.extend({requestId:DU,reason:n.string().optional()})}),wQ=n.object({name:n.string(),version:n.string()}).passthrough(),$A=n.object({experimental:n.optional(n.object({}).passthrough()),sampling:n.optional(n.object({}).passthrough()),roots:n.optional(n.object({listChanged:n.optional(n.boolean())}).passthrough())}).passthrough(),UG=y$.extend({method:n.literal("initialize"),params:Qv.extend({protocolVersion:n.string(),capabilities:$A,clientInfo:wQ})}),vA=n.object({experimental:n.optional(n.object({}).passthrough()),logging:n.optional(n.object({}).passthrough()),prompts:n.optional(n.object({listChanged:n.optional(n.boolean())}).passthrough()),resources:n.optional(n.object({subscribe:n.optional(n.boolean()),listChanged:n.optional(n.boolean())}).passthrough()),tools:n.optional(n.object({listChanged:n.optional(n.boolean())}).passthrough())}).passthrough(),_A=Wv.extend({protocolVersion:n.string(),capabilities:vA,serverInfo:wQ}),JG=iv.extend({method:n.literal("notifications/initialized")}),YU=y$.extend({method:n.literal("ping")}),wA=n.object({progress:n.number(),total:n.optional(n.number())}).passthrough(),QU=iv.extend({method:n.literal("notifications/progress"),params:og.merge(wA).extend({progressToken:$Q})}),WU=y$.extend({params:Qv.extend({cursor:n.optional(vQ)}).optional()}),HU=Wv.extend({nextCursor:n.optional(vQ)}),gQ=n.object({uri:n.string(),mimeType:n.optional(n.string())}).passthrough(),bQ=gQ.extend({text:n.string()}),UQ=gQ.extend({blob:n.string().base64()}),gA=n.object({uri:n.string(),name:n.string(),description:n.optional(n.string()),mimeType:n.optional(n.string())}).passthrough(),bA=n.object({uriTemplate:n.string(),name:n.string(),description:n.optional(n.string()),mimeType:n.optional(n.string())}).passthrough(),UA=WU.extend({method:n.literal("resources/list")}),JA=HU.extend({resources:n.array(gA)}),DA=WU.extend({method:n.literal("resources/templates/list")}),XA=HU.extend({resourceTemplates:n.array(bA)}),GA=y$.extend({method:n.literal("resources/read"),params:Qv.extend({uri:n.string()})}),YA=Wv.extend({contents:n.array(n.union([bQ,UQ]))}),QA=iv.extend({method:n.literal("notifications/resources/list_changed")}),WA=y$.extend({method:n.literal("resources/subscribe"),params:Qv.extend({uri:n.string()})}),HA=y$.extend({method:n.literal("resources/unsubscribe"),params:Qv.extend({uri:n.string()})}),nA=iv.extend({method:n.literal("notifications/resources/updated"),params:og.extend({uri:n.string()})}),qA=n.object({name:n.string(),description:n.optional(n.string()),required:n.optional(n.boolean())}).passthrough(),IA=n.object({name:n.string(),description:n.optional(n.string()),arguments:n.optional(n.array(qA))}).passthrough(),BA=WU.extend({method:n.literal("prompts/list")}),LA=HU.extend({prompts:n.array(IA)}),VA=y$.extend({method:n.literal("prompts/get"),params:Qv.extend({name:n.string(),arguments:n.optional(n.record(n.string()))})}),nU=n.object({type:n.literal("text"),text:n.string()}).passthrough(),qU=n.object({type:n.literal("image"),data:n.string().base64(),mimeType:n.string()}).passthrough(),JQ=n.object({type:n.literal("resource"),resource:n.union([bQ,UQ])}).passthrough(),jA=n.object({role:n.enum(["user","assistant"]),content:n.union([nU,qU,JQ])}).passthrough(),FA=Wv.extend({description:n.optional(n.string()),messages:n.array(jA)}),KA=iv.extend({method:n.literal("notifications/prompts/list_changed")}),OA=n.object({name:n.string(),description:n.optional(n.string()),inputSchema:n.object({type:n.literal("object"),properties:n.optional(n.object({}).passthrough())}).passthrough()}).passthrough(),DG=WU.extend({method:n.literal("tools/list")}),iA=HU.extend({tools:n.array(OA)}),DQ=Wv.extend({content:n.array(n.union([nU,qU,JQ])),isError:n.boolean().default(!1).optional()}),Bh=DQ.or(Wv.extend({toolResult:n.unknown()})),XG=y$.extend({method:n.literal("tools/call"),params:Qv.extend({name:n.string(),arguments:n.optional(n.record(n.unknown()))})}),kA=iv.extend({method:n.literal("notifications/tools/list_changed")}),XQ=n.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),NA=y$.extend({method:n.literal("logging/setLevel"),params:Qv.extend({level:XQ})}),PA=iv.extend({method:n.literal("notifications/message"),params:og.extend({level:XQ,logger:n.optional(n.string()),data:n.unknown()})}),fA=n.object({name:n.string().optional()}).passthrough(),AA=n.object({hints:n.optional(n.array(fA)),costPriority:n.optional(n.number().min(0).max(1)),speedPriority:n.optional(n.number().min(0).max(1)),intelligencePriority:n.optional(n.number().min(0).max(1))}).passthrough(),MA=n.object({role:n.enum(["user","assistant"]),content:n.union([nU,qU])}).passthrough(),zA=y$.extend({method:n.literal("sampling/createMessage"),params:Qv.extend({messages:n.array(MA),systemPrompt:n.optional(n.string()),includeContext:n.optional(n.enum(["none","thisServer","allServers"])),temperature:n.optional(n.number()),maxTokens:n.number().int(),stopSequences:n.optional(n.array(n.string())),metadata:n.optional(n.object({}).passthrough()),modelPreferences:n.optional(AA)})}),GG=Wv.extend({model:n.string(),stopReason:n.optional(n.enum(["endTurn","stopSequence","maxTokens"]).or(n.string())),role:n.enum(["user","assistant"]),content:n.discriminatedUnion("type",[nU,qU])}),SA=n.object({type:n.literal("ref/resource"),uri:n.string()}).passthrough(),uA=n.object({type:n.literal("ref/prompt"),name:n.string()}).passthrough(),TA=y$.extend({method:n.literal("completion/complete"),params:Qv.extend({ref:n.union([uA,SA]),argument:n.object({name:n.string(),value:n.string()}).passthrough()})}),RA=Wv.extend({completion:n.object({values:n.array(n.string()).max(100),total:n.optional(n.number().int()),hasMore:n.optional(n.boolean())}).passthrough()}),CA=n.object({uri:n.string().startsWith("file://"),name:n.optional(n.string())}).passthrough(),EA=y$.extend({method:n.literal("roots/list")}),YG=Wv.extend({roots:n.array(CA)}),ZA=iv.extend({method:n.literal("notifications/roots/list_changed")}),Lh=n.union([YU,UG,TA,NA,VA,BA,UA,DA,GA,WA,HA,XG,DG]),Vh=n.union([GU,QU,JG,ZA]),jh=n.union([XU,GG,YG]),Fh=n.union([YU,zA,EA]),Kh=n.union([GU,QU,PA,nA,QA,kA,KA]),Oh=n.union([XU,_A,RA,FA,LA,JA,XA,YA,DQ,iA]);class tg extends Error{constructor($,v,w){super(`MCP error ${$}: ${v}`);this.code=$,this.data=w}}var xA=60000;class QG{constructor($){this._options=$,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this.setNotificationHandler(GU,(v)=>{let w=this._requestHandlerAbortControllers.get(v.params.requestId);w===null||w===void 0||w.abort(v.params.reason)}),this.setNotificationHandler(QU,(v)=>{this._onprogress(v)}),this.setRequestHandler(YU,(v)=>({}))}async connect($){this._transport=$,this._transport.onclose=()=>{this._onclose()},this._transport.onerror=(v)=>{this._onerror(v)},this._transport.onmessage=(v)=>{if(!("method"in v))this._onresponse(v);else if("id"in v)this._onrequest(v);else this._onnotification(v)},await this._transport.start()}_onclose(){var $;let v=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._transport=void 0,($=this.onclose)===null||$===void 0||$.call(this);let w=new tg(Xw.ConnectionClosed,"Connection closed");for(let g of v.values())g(w)}_onerror($){var v;(v=this.onerror)===null||v===void 0||v.call(this,$)}_onnotification($){var v;let w=(v=this._notificationHandlers.get($.method))!==null&&v!==void 0?v:this.fallbackNotificationHandler;if(w===void 0)return;Promise.resolve().then(()=>w($)).catch((g)=>this._onerror(Error(`Uncaught error in notification handler: ${g}`)))}_onrequest($){var v,w;let g=(v=this._requestHandlers.get($.method))!==null&&v!==void 0?v:this.fallbackRequestHandler;if(g===void 0){(w=this._transport)===null||w===void 0||w.send({jsonrpc:"2.0",id:$.id,error:{code:Xw.MethodNotFound,message:"Method not found"}}).catch((b)=>this._onerror(Error(`Failed to send an error response: ${b}`)));return}let _=new AbortController;this._requestHandlerAbortControllers.set($.id,_),Promise.resolve().then(()=>g($,{signal:_.signal})).then((b)=>{var J;if(_.signal.aborted)return;return(J=this._transport)===null||J===void 0?void 0:J.send({result:b,jsonrpc:"2.0",id:$.id})},(b)=>{var J,D;if(_.signal.aborted)return;return(J=this._transport)===null||J===void 0?void 0:J.send({jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(b.code)?b.code:Xw.InternalError,message:(D=b.message)!==null&&D!==void 0?D:"Internal error"}})}).catch((b)=>this._onerror(Error(`Failed to send response: ${b}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:v,...w}=$.params,g=this._progressHandlers.get(Number(v));if(g===void 0){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}g(w)}_onresponse($){let v=$.id,w=this._responseHandlers.get(Number(v));if(w===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}if(this._responseHandlers.delete(Number(v)),this._progressHandlers.delete(Number(v)),"result"in $)w($);else{let g=new tg($.error.code,$.error.message,$.error.data);w(g)}}get transport(){return this._transport}async close(){var $;await(($=this._transport)===null||$===void 0?void 0:$.close())}request($,v,w){return new Promise((g,_)=>{var b,J,D,X;if(!this._transport){_(Error("Not connected"));return}if(((b=this._options)===null||b===void 0?void 0:b.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod($.method);(J=w===null||w===void 0?void 0:w.signal)===null||J===void 0||J.throwIfAborted();let G=this._requestMessageId++,Y={...$,jsonrpc:"2.0",id:G};if(w===null||w===void 0?void 0:w.onprogress)this._progressHandlers.set(G,w.onprogress),Y.params={...$.params,_meta:{progressToken:G}};let Q=void 0;this._responseHandlers.set(G,(q)=>{var W;if(Q!==void 0)clearTimeout(Q);if((W=w===null||w===void 0?void 0:w.signal)===null||W===void 0?void 0:W.aborted)return;if(q instanceof Error)return _(q);try{let B=v.parse(q.result);g(B)}catch(B){_(B)}});let H=(q)=>{var W;this._responseHandlers.delete(G),this._progressHandlers.delete(G),(W=this._transport)===null||W===void 0||W.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:G,reason:String(q)}}).catch((B)=>this._onerror(Error(`Failed to send cancellation: ${B}`))),_(q)};(D=w===null||w===void 0?void 0:w.signal)===null||D===void 0||D.addEventListener("abort",()=>{var q;if(Q!==void 0)clearTimeout(Q);H((q=w===null||w===void 0?void 0:w.signal)===null||q===void 0?void 0:q.reason)});let I=(X=w===null||w===void 0?void 0:w.timeout)!==null&&X!==void 0?X:xA;Q=setTimeout(()=>H(new tg(Xw.RequestTimeout,"Request timed out",{timeout:I})),I),this._transport.send(Y).catch((q)=>{if(Q!==void 0)clearTimeout(Q);_(q)})})}async notification($){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability($.method);let v={...$,jsonrpc:"2.0"};await this._transport.send(v)}setRequestHandler($,v){let w=$.shape.method.value;this.assertRequestHandlerCapability(w),this._requestHandlers.set(w,(g,_)=>Promise.resolve(v($.parse(g),_)))}removeRequestHandler($){this._requestHandlers.delete($)}setNotificationHandler($,v){this._notificationHandlers.set($.shape.method.value,(w)=>Promise.resolve(v($.parse(w))))}removeNotificationHandler($){this._notificationHandlers.delete($)}}class WG extends QG{constructor($,v){super(v);this._serverInfo=$,this._capabilities=v.capabilities,this.setRequestHandler(UG,(w)=>this._oninitialize(w)),this.setNotificationHandler(JG,()=>{var w;return(w=this.oninitialized)===null||w===void 0?void 0:w.call(this)})}assertCapabilityForMethod($){var v,w;switch($){case"sampling/createMessage":if(!((v=this._clientCapabilities)===null||v===void 0?void 0:v.sampling))throw Error(`Client does not support sampling (required for ${$})`);break;case"roots/list":if(!((w=this._clientCapabilities)===null||w===void 0?void 0:w.roots))throw Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){switch($){case"sampling/createMessage":if(!this._capabilities.sampling)throw Error(`Server does not support sampling (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${$})`);break;case"ping":case"initialize":break}}async _oninitialize($){let v=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:sY.includes(v)?v:bG,capabilities:this.getCapabilities(),serverInfo:this._serverInfo}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},XU)}async createMessage($,v){return this.request({method:"sampling/createMessage",params:$},GG,v)}async listRoots($,v){return this.request({method:"roots/list",params:$},YG,v)}async sendLoggingMessage($){return this.notification({method:"notifications/message",params:$})}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}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"})}}import YQ from"node:process";class HG{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
179
- `);if($===-1)return null;let v=this._buffer.toString("utf8",0,$);return this._buffer=this._buffer.subarray($+1),lA(v)}clear(){this._buffer=void 0}}function lA($){return _Q.parse(JSON.parse($))}function GQ($){return JSON.stringify($)+`
180
- `}class nG{constructor($=YQ.stdin,v=YQ.stdout){this._stdin=$,this._stdout=v,this._readBuffer=new HG,this._started=!1,this._ondata=(w)=>{this._readBuffer.append(w),this.processReadBuffer()},this._onerror=(w)=>{var g;(g=this.onerror)===null||g===void 0||g.call(this,w)}}async start(){if(this._started)throw 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(){var $,v;while(!0)try{let w=this._readBuffer.readMessage();if(w===null)break;($=this.onmessage)===null||$===void 0||$.call(this,w)}catch(w){(v=this.onerror)===null||v===void 0||v.call(this,w)}}async close(){var $;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._readBuffer.clear(),($=this.onclose)===null||$===void 0||$.call(this)}send($){return new Promise((v)=>{let w=GQ($);if(this._stdout.write(w))v();else this._stdout.once("drain",v)})}}function R6($,v){var w={};for(var g in $)if(Object.prototype.hasOwnProperty.call($,g)&&v.indexOf(g)<0)w[g]=$[g];if($!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var _=0,g=Object.getOwnPropertySymbols($);_<g.length;_++)if(v.indexOf(g[_])<0&&Object.prototype.propertyIsEnumerable.call($,g[_]))w[g[_]]=$[g[_]]}return w}var hA={ZodAny:"any",ZodArray:"array",ZodBigInt:"bigint",ZodBoolean:"boolean",ZodDefault:"default",ZodPrefault:"prefault",ZodTransform:"transform",ZodEnum:"enum",ZodIntersection:"intersection",ZodLazy:"lazy",ZodLiteral:"literal",ZodNever:"never",ZodNull:"null",ZodNullable:"nullable",ZodNumber:"number",ZodNonOptional:"nonoptional",ZodObject:"object",ZodOptional:"optional",ZodPipe:"pipe",ZodReadonly:"readonly",ZodRecord:"record",ZodString:"string",ZodTuple:"tuple",ZodType:"type",ZodUnion:"union",ZodDiscriminatedUnion:"union",ZodUnknown:"unknown",ZodVoid:"void",ZodDate:"date",ZodTemplateLiteral:"template_literal"};function lv($,v){return(Array.isArray(v)?v:[v]).some((g)=>{var _;let b=((_=$===null||$===void 0?void 0:$.def)===null||_===void 0?void 0:_.type)===hA[g];if(g==="ZodDiscriminatedUnion")return b&&"discriminator"in $.def;return b})}function T6($){return $&&"def"in $}class WQ{constructor(){this._map=new Map,this._idmap=new Map}add($,...v){let w=v[0];if(this._map.set($,w),w&&typeof w==="object"&&"id"in w){if(this._idmap.has(w.id))throw Error(`ID ${w.id} already exists in the registry`);this._idmap.set(w.id,$)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove($){let v=this._map.get($);if(v&&typeof v==="object"&&"id"in v)this._idmap.delete(v.id);return this._map.delete($),this}get($){let v=$._zod.parent;if(v){let w={...this.get(v)??{}};return delete w.id,{...w,...this._map.get($)}}return this._map.get($)}has($){return this._map.has($)}}function cA(){return new WQ}function qG($){return $===void 0}function yA($,v){let w={};return Object.entries($).forEach(([g,_])=>{if(!v.some((b)=>b===g))w[g]=_}),w}function IG($,v){let w={};return Object.entries($).forEach(([g,_])=>{if(!v(_,g))w[g]=_}),w}var QQ=cA();class hv{static collectMetadata($,v){let w=this.getMetadataFromRegistry($),g=Object.assign(Object.assign({},w===null||w===void 0?void 0:w._internal),v===null||v===void 0?void 0:v._internal),_=Object.assign(Object.assign({},w===null||w===void 0?void 0:w.param),v===null||v===void 0?void 0:v.param),b=Object.assign(Object.assign(Object.assign(Object.assign({},Object.keys(g).length>0?{_internal:g}:{}),w),v),Object.keys(_).length>0?{param:_}:{});if(lv($,["ZodOptional","ZodNullable","ZodDefault","ZodPrefault","ZodReadonly","ZodNonOptional"])&&T6($._zod.def.innerType))return this.collectMetadata($._zod.def.innerType,b);if(lv($,"ZodPipe")){let J=$._zod.def.in,D=$._zod.def.out;if(lv(J,"ZodTransform")&&T6(D))return this.collectMetadata(D,b);if(T6(J))return this.collectMetadata(J,b)}return b}static getMetadata($){return this.collectMetadata($)}static getOpenApiMetadata($){let v=this.collectMetadata($);return R6(v!==null&&v!==void 0?v:{},["_internal"])}static getInternalMetadata($){var v;return(v=this.collectMetadata($))===null||v===void 0?void 0:v._internal}static getParamMetadata($){let v=this.collectMetadata($);return Object.assign(Object.assign({},v),{param:Object.assign(Object.assign({},(v===null||v===void 0?void 0:v.description)?{description:v.description}:{}),v===null||v===void 0?void 0:v.param)})}static buildSchemaMetadata($){return IG(yA($,["param","_internal"]),qG)}static buildParameterMetadata($){return IG($,qG)}static applySchemaMetadata($,v){return IG(Object.assign(Object.assign({},$),this.buildSchemaMetadata(v)),qG)}static getRefId($){var v;return(v=this.getInternalMetadata($))===null||v===void 0?void 0:v.refId}static unwrapChained($){return this.unwrapUntil($)}static getDefaultValue($){var v;let w=(v=this.unwrapUntil($,"ZodDefault"))!==null&&v!==void 0?v:this.unwrapUntil($,"ZodPrefault");return w===null||w===void 0?void 0:w._zod.def.defaultValue}static unwrapUntil($,v){if(v&&lv($,v))return $;if(lv($,["ZodOptional","ZodNullable","ZodDefault","ZodPrefault","ZodReadonly","ZodNonOptional"])&&T6($._zod.def.innerType))return this.unwrapUntil($._zod.def.innerType,v);if(lv($,"ZodPipe")){let w=$._zod.def.in,g=$._zod.def.out;if(lv(w,"ZodTransform")&&T6(g))return this.unwrapUntil(g,v);if(T6(w))return this.unwrapUntil(w,v)}return v?void 0:$}static getMetadataFromInternalRegistry($){return QQ.get($)}static getMetadataFromRegistry($){let v=this.getMetadataFromInternalRegistry($),w=$.meta();if(!v)return w;let{_internal:g}=v,_=R6(v,["_internal"]),b=w!==null&&w!==void 0?w:{},{id:J,title:D}=b,X=R6(b,["id","title"]);return Object.assign(Object.assign(Object.assign({_internal:Object.assign(Object.assign({},J?{refId:J}:{}),g)},_),D?{description:D}:{}),X)}static setMetadataInRegistry($,v){QQ.add($,v)}}function xv($,v){let w=$[v];if(typeof w!=="function")return;$[v]=function(...g){let _=w.apply(this,g),b=hv.getMetadataFromRegistry(this);if(b)hv.setMetadataInRegistry(_,b);return _}}function mA($){if(typeof $.ZodType.prototype.openapi<"u")return;$.ZodType.prototype.openapi=function(...v){let{refId:w,metadata:g,options:_}=rA(...v),b=g!==null&&g!==void 0?g:{},{param:J}=b,D=R6(b,["param"]),X=hv.getMetadataFromRegistry(this),G=X!==null&&X!==void 0?X:{},{_internal:Y}=G,Q=R6(G,["_internal"]),H=Object.assign(Object.assign(Object.assign({},Y),_),w?{refId:w}:void 0),I=Object.assign(Object.assign(Object.assign({},Q),D),(Q===null||Q===void 0?void 0:Q.param)||J?{param:Object.assign(Object.assign({},Q===null||Q===void 0?void 0:Q.param),J)}:void 0),q=new this.constructor(this._def);function W(j){hv.setMetadataInRegistry(j,Object.assign(Object.assign({},Object.keys(H).length>0?{_internal:H}:void 0),I))}if(W(q),lv(q,"ZodLazy"))W(this);if(lv(q,"ZodObject")){let j=hv.getMetadataFromRegistry(q),A=q.extend;q.extend=function(...z){let C=A.apply(q,z),Z=j!==null&&j!==void 0?j:{},{_internal:S}=Z,y=R6(Z,["_internal"]);return hv.setMetadataInRegistry(C,{_internal:{extendedFrom:(S===null||S===void 0?void 0:S.refId)?{refId:S.refId,schema:q}:S===null||S===void 0?void 0:S.extendedFrom}}),C.openapi(y)},xv(q,"catchall")}xv(q,"optional"),xv(q,"nullable"),xv(q,"default"),xv(q,"transform"),xv(q,"refine"),xv(q,"length"),xv(q,"min"),xv(q,"max");let B=q.meta;return q.meta=function(...j){let A=B.apply(this,j);if(j[0]){let z=hv.getMetadataFromInternalRegistry(this);if(z)hv.setMetadataInRegistry(A,Object.assign(Object.assign({},z),j[0]))}return A},q}}function rA($,v,w){if(typeof $==="string")return{refId:$,metadata:v,options:w};return{refId:void 0,metadata:$,options:v}}var BG=mA;BG(U);var IQ=u({}).passthrough().openapi({description:"Structured context for the error (varies by error code)"}),LG=u({code:F().openapi({description:"Machine-stable error code from the error catalog",example:"session_not_found"}),message:F().openapi({description:"Human-readable error description",example:"The requested session does not exist."}),retryable:W$().openapi({description:"Whether clients SHOULD retry this request",example:!1}),details:IQ.optional(),fix_hint:F().optional().openapi({description:"Actionable guidance for humans to resolve the error",example:"Verify the session ID is correct."})}).openapi("ErrorObject"),IU=u({code:F().openapi({description:"Machine-stable warning code",example:"partial_data"}),message:F().openapi({description:"Human-readable warning description",example:"Some optional fields were unavailable."}),details:IQ.optional()}).openapi("ErrorWarning"),Eh=u({error:LG,trace_id:F().optional().openapi({description:"Distributed tracing correlation ID",example:"trace_abc123"}),request_id:F().openapi({description:"Unique request identifier",example:"req_xyz789"}),warnings:g$(IU).optional().openapi({description:"Non-fatal warnings returned alongside the error"})}).openapi("ErrorResponse"),cv=F().min(1).max(64).regex(/^(?:[a-zA-Z0-9_-]+|[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)$/,'repo_id must be a configured repo id or an "owner/repo" identifier').openapi({description:'Repository identifier or canonical "owner/repo" handle',example:"acme/docs"}),Hv=F().regex(/^[0-9a-f]{40}$|^[0-9a-f]{64}$/,"git_sha must be 40 or 64 lowercase hex characters").openapi({description:"Full Git SHA (40 chars for SHA-1, 64 for SHA-256)",example:"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b"}),D$=F().min(1).max(512).refine(($)=>!$.startsWith("/"),"file_path must be relative (no leading /)").refine(($)=>!$.includes(".."),"file_path must not contain path traversal (..)").refine(($)=>!$.includes("\x00"),"file_path must not contain NUL bytes").openapi({description:"Relative file path with no leading slash, traversal, or NUL bytes",example:"docs/guide.md"}),oA=u({source_type:q$("git"),repo_id:cv,git_sha:Hv,file_path:D$}).openapi("GitContentRef"),tA=u({source_type:q$("upload"),project_id:F().openapi({description:"Project identifier",example:"proj_docs"}),upload_batch_id:F().openapi({description:"Upload batch identifier",example:"upload_20260208"}),file_path:D$.openapi({description:"Path to file in upload batch",example:"spec.md"})}).openapi("UploadContentRef"),Gw=Sv("source_type",[oA,tA]).openapi("ContentRef"),dA=u({type:q$("session")}).openapi("SessionAnchor"),pA=u({type:q$("review")}).openapi("ReviewAnchor"),BU=F().regex(/^[a-z2-7]{16}$/,"block_id must be 16 lowercase base32 characters").openapi({description:"16-character lowercase base32 block identifier (truncated SHA-256)",example:"abcdefgh234567ab"}),eA=u({type:q$("block"),block_id:BU}).openapi("BlockAnchor"),aA=u({type:q$("range"),block_id:BU,start_offset:H$().int().min(0).openapi({description:"Start byte offset within the block"}),end_offset:H$().int().min(0).openapi({description:"End byte offset within the block"})}).openapi("RangeAnchor"),yv=Sv("type",[dA,pA,eA,aA]).openapi("Anchor"),Zh=F().optional().openapi({description:"Client-generated idempotency key for safe retries",example:"scope:install_abc:op_123"}),BQ=u({limit:wv.number().int().min(1).max(100).default(50).optional(),cursor:F().optional()}),xh=u({next_cursor:F().nullable(),has_more:W$()}),HQ=20,nQ=64,qQ=256,sA=/^[a-zA-Z][a-zA-Z0-9_-]*$/,mv=Bv(F(),N$()).superRefine(($,v)=>{let w=Object.keys($);if(w.length>HQ){v.addIssue({code:u$.custom,message:`Too many keys: ${w.length} exceeds maximum of ${HQ}`});return}for(let g of w){if(g.length<1||g.length>nQ){v.addIssue({code:u$.custom,message:`Key "${g}" length ${g.length} is outside range 1-${nQ}`,path:[g]});continue}if(!sA.test(g))v.addIssue({code:u$.custom,message:`Key "${g}" must start with a letter and contain only letters, digits, underscores, and hyphens`,path:[g]});let _=$[g];if(typeof _!=="string"){v.addIssue({code:u$.custom,message:`Value for key "${g}" must be a string, got ${typeof _}`,path:[g]});continue}if(_.length>qQ)v.addIssue({code:u$.custom,message:`Value for key "${g}" length ${_.length} exceeds maximum of ${qQ}`,path:[g]})}}).openapi("FlatJsonbMap"),lh=mv.optional().default({});var jQ=U.object({idempotency:U.enum(["always","keyed","none"]).optional(),retry_classification:U.enum(["safe","transient","manual"]).optional()}).openapi("AgentSurfaceRetrySemantics"),$M=U.object({next_cursor:U.string().nullable().optional(),has_more:U.boolean().optional(),total:U.number().int().nonnegative().optional(),limit:U.number().int().positive().optional(),offset:U.number().int().nonnegative().optional()}).openapi("AgentSurfacePagination"),vM=U.object({artifact_kind:U.string().optional(),non_authoritative:U.boolean().optional(),status:U.string().optional(),target_type:U.string().optional(),target_id:U.string().optional(),provenance:U.object({source_type:U.string().optional(),source_label:U.string().optional(),source_model:U.string().optional()}).optional()}).openapi("AdvisorySurfaceSummary"),_M=U.object({ok:U.literal(!0),request_id:U.string(),result:U.unknown(),warnings:U.array(IU).optional(),pagination:$M.optional(),advisory:vM.optional(),retry:jQ.optional()}).openapi("AgentSurfaceSuccessEnvelope"),wM=U.object({ok:U.literal(!1),error:LG,request_id:U.string(),warnings:U.array(IU).optional(),retry:jQ.optional()}).openapi("AgentSurfaceErrorEnvelope");function kv($){if(typeof $!=="object"||$===null||Array.isArray($))return null;return $}function rv($,v){let w=$[v];return typeof w==="string"&&w.trim().length>0?w:void 0}function FQ($,v){let w=$[v];return typeof w==="boolean"?w:void 0}function VG($,v){let w=$[v];if(typeof w!=="number"||!Number.isInteger(w)||w<0)return;return w}function KQ($){if(!Array.isArray($))return[];return $.flatMap((v)=>{if(typeof v==="string"&&v.trim().length>0)return[{code:"warning",message:v}];let w=kv(v);if(!w)return[];let g=rv(w,"message");if(!g)return[];let _=rv(w,"code")??"warning",b=kv(w.details)??void 0;return[{code:_,message:g,...b?{details:b}:{}}]})}function LQ($){let v=kv($);if(!v)return;let w={},g=v.next_cursor;if(typeof g==="string"||g===null)w.next_cursor=g;if(w.next_cursor===void 0&&(typeof v.cursor==="string"||v.cursor===null))w.next_cursor=v.cursor;let _=FQ(v,"has_more");if(_!==void 0)w.has_more=_;let b=VG(v,"total");if(b!==void 0)w.total=b;let J=VG(v,"limit");if(J!==void 0&&J>0)w.limit=J;let D=VG(v,"offset");if(D!==void 0)w.offset=D;return Object.keys(w).length>0?w:void 0}function VQ($){let v=kv($);if(!v)return;let w=kv(v.advisory_artifact)??kv(v.advisory)??v,g=rv(w,"artifact_kind"),_=FQ(w,"non_authoritative"),b=rv(w,"status"),J=kv(w.target),D=kv(w.provenance);if(g===void 0&&_===void 0&&J===null&&D===null)return;let X={};if(g!==void 0)X.artifact_kind=g;if(_!==void 0)X.non_authoritative=_;if(b!==void 0)X.status=b;if(J){let G=rv(J,"target_type"),Y=rv(J,"target_id");if(G!==void 0)X.target_type=G;if(Y!==void 0)X.target_id=Y}if(D){let G={},Y=rv(D,"source_type"),Q=rv(D,"source_label"),H=rv(D,"source_model");if(Y!==void 0)G.source_type=Y;if(Q!==void 0)G.source_label=Q;if(H!==void 0)G.source_model=H;if(Object.keys(G).length>0)X.provenance=G}return X}function OQ($){if($.operation==="read")return"always";return $.hasIdempotencyKey?"keyed":"none"}function gM($){if(typeof $.retryable==="boolean")return $.retryable;if(typeof $.errorCode==="string"&&D6($.errorCode))return!0;if($.statusCode===0||$.statusCode===429)return!0;return typeof $.statusCode==="number"&&$.statusCode>=500}function jG($){let v=OQ($);return{idempotency:v,retry_classification:v==="none"?"manual":"safe"}}function iQ($){let v=OQ($);if(!gM($))return{idempotency:v,retry_classification:"manual"};return{idempotency:v,retry_classification:v==="none"?"transient":"safe"}}function kQ($,v,w){let g=KQ(kv($)?.warnings),_={ok:!0,request_id:v,result:$,...g.length>0?{warnings:g}:{},...LQ($)?{pagination:LQ($)}:{},...VQ($)?{advisory:VQ($)}:{},...w?.retry?{retry:w.retry}:{}};return _M.parse(_),_}function NQ($){let v=kv($.error.details)??void 0,w=KQ($.warnings),g={ok:!1,request_id:$.requestId,error:{code:$.error.code,message:$.error.message,retryable:$.error.retryable,request_id:$.requestId,...v?{details:v}:{},...$.error.fix_hint?{fix_hint:$.error.fix_hint}:{}},...w.length>0?{warnings:w}:{},...$.retry?{retry:$.retry}:{}};return wM.parse(g),g}var LU=U.enum(["content","rules"]).openapi("ReviewRole"),VU=U.enum(["draft","created","active","closed","expired","superseded","archived","deleted"]).openapi("ReviewState"),PQ=U.enum(["draft","published","deprecated"]).openapi("ReviewPublicationStatus"),bM=U.enum(["git","upload"]).openapi("ReviewSourceType"),FG=U.enum(["reviewer","approver","observer","owner"]).openapi("ReviewParticipantRole"),fQ=U.enum(["read","comment","approve","admin"]).openapi("ReviewParticipantScope"),AQ=U.enum(["pending","invited","active","failed","bounced"]).openapi("ReviewParticipantInviteStatus"),MQ=U.enum(["pending","delivered","failed","bounced"]).openapi("ReviewParticipantDeliveryState"),UM=U.enum(["not_started","in_progress","complete"]).openapi("ReviewParticipantReviewStatus"),JM=U.object({email:U.string().email(),name:U.string().max(256).optional(),role:FG,scopes:U.array(fQ).min(1)}).openapi("ReviewParticipantInput"),DM=U.object({participant_id:U.string(),email:U.string().email(),roles:U.array(FG),display_name:U.string().nullable(),joined_at:U.string().datetime().nullable(),last_seen_at:U.string().datetime().nullable(),invite_status:AQ,review_status:UM,review_completed_at:U.string().datetime().nullable(),magic_link_opened_at:U.string().datetime().nullable(),delivery_state:MQ.nullable()}).openapi("ReviewParticipantSummary"),XM=U.object({participant_id:U.string(),email:U.string().email(),roles:U.array(FG),review_link_id:U.string(),scope:fQ,expires_at:U.string().datetime().nullable(),revoked_at:U.string().datetime().nullable(),invite_status:AQ,delivery_state:MQ.nullable()}).openapi("ReviewInvitationSummary"),oh=U.object({repo_id:cv.optional(),git_sha:Hv.optional(),file_path:D$,document_type:U.enum(["markdown","pdf","image_set"]).default("markdown"),title:U.string().max(512).optional(),source_context:U.record(U.string(),U.unknown()).optional(),extra:U.record(U.string(),U.unknown()).optional(),role:LU.default("content"),applicability:mv.optional(),properties:mv.optional(),identity_restriction:U.enum(["open","participants_only","domain"]).default("open"),allowed_email_domains:U.array(U.string().min(1).max(253)).max(50).optional(),participants:U.array(JM).max(100).optional(),idempotency_key:U.string().max(256).optional(),supersedes_review_id:U.string().optional(),carry_forward_threads:U.boolean().optional(),carry_forward_filter:U.enum(["all","blocking","needs_changes"]).optional(),project_id:U.string().optional(),upload_batch_id:U.string().optional(),content_body:U.string().max(1048576).optional(),focus_areas:U.array(U.string().max(100)).max(10).optional(),framing:U.string().max(1000).optional(),operator_name:U.string().max(200).optional()}).superRefine(($,v)=>{if($.role!=="rules"&&$.applicability!==void 0&&Object.keys($.applicability).length>0)v.addIssue({code:U.ZodIssueCode.custom,message:"applicability is only valid when role is 'rules'. Content reviews must not specify applicability.",path:["applicability"]});if($.identity_restriction==="domain"&&(!Array.isArray($.allowed_email_domains)||$.allowed_email_domains.length===0))v.addIssue({code:U.ZodIssueCode.custom,message:'allowed_email_domains is required and must be non-empty when identity_restriction is "domain"',path:["allowed_email_domains"]})}).openapi("CreateReviewRequest"),GM=U.object({review_id:U.string(),role:LU,state:VU,publication_status:PQ.nullable().optional(),title:U.string().nullable(),file_path:U.string(),block_count:U.number().int().nonnegative(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).openapi("ReviewSummary"),th=U.object({review_id:U.string(),role:LU,state:VU,publication_status:PQ.nullable().optional(),source_type:bM,document_type:U.enum(["markdown","pdf","image_set"]),repo_id:U.string().nullable(),git_sha:U.string().nullable(),file_path:U.string(),title:U.string().nullable(),source_context:U.record(U.string(),U.unknown()).nullable(),extra:U.record(U.string(),U.unknown()).nullable(),identity_restriction:U.enum(["open","participants_only","domain"]),allowed_email_domains:U.array(U.string()).nullable(),applicability:U.record(U.string(),U.unknown()),properties:U.record(U.string(),U.unknown()),block_count:U.number().int().nonnegative(),root_review_id:U.string(),supersedes_review_id:U.string().nullable(),superseded_by_review_id:U.string().nullable(),created_at:U.string().datetime(),updated_at:U.string().datetime(),participants:U.array(DM),invitations:U.array(XM),summary:U.object({total_threads:U.number().int().nonnegative(),open_threads:U.number().int().nonnegative(),blocking_threads:U.number().int().nonnegative(),resolved_threads:U.number().int().nonnegative(),total_findings:U.number().int().nonnegative().optional(),open_findings:U.number().int().nonnegative().optional(),blocking_findings:U.number().int().nonnegative().optional(),resolved_findings:U.number().int().nonnegative().optional()}),request_id:U.string()}).openapi("ReviewDetailResponse"),dh=U.object({role:LU.optional(),state:VU.optional(),cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).default(25)}).openapi("ListReviewsQuery"),ph=U.object({reviews:U.array(GM),next_cursor:U.string().nullable(),has_more:U.boolean(),request_id:U.string()}).openapi("ListReviewsResponse"),eh=U.object({state:VU}).openapi("PatchReviewRequest"),ah=U.object({git_sha:U.string().optional(),file_path:U.string().optional(),title:U.string().max(512).optional(),applicability:mv.optional(),properties:mv.optional(),idempotency_key:U.string().max(256).optional(),changes_summary:U.string().max(5000).optional(),carry_forward_threads:U.boolean().optional(),carry_forward_filter:U.enum(["all","blocking","needs_changes"]).optional()}).openapi("ReviseReviewRequest");var zQ=U.enum(["suggestion","needs_changes","blocking"]).openapi({description:"Thread severity level"}),SQ=U.enum(["inline","append","hero"]).openapi("CommentAttachmentPlacement"),uQ=U.enum(["before","after"]).openapi("CommentAttachmentAnchorPosition"),YM=U.object({mime_type:U.string().min(1),width:U.number().int().nullable(),height:U.number().int().nullable(),blurhash:U.string().nullable()}).openapi("CommentAttachmentAsset"),KG=U.object({asset_id:U.string().min(1),sort_order:U.number().int().nonnegative(),placement:SQ,alt_text:U.string().max(500).nullable().optional(),caption:U.string().max(2000).nullable().optional(),anchor_block_id:U.string().nullable().optional(),anchor_position:uQ.nullable().optional(),spatial_x:U.number().min(0).max(100).nullable().optional(),spatial_y:U.number().min(0).max(100).nullable().optional()}).openapi("CommentAttachmentRequest"),jU=U.object({asset_id:U.string().min(1),sort_order:U.number().int().nonnegative(),placement:SQ,alt_text:U.string().nullable(),caption:U.string().nullable(),anchor_block_id:U.string().nullable(),anchor_position:uQ.nullable(),spatial_x:U.number().nullable(),spatial_y:U.number().nullable(),asset:YM}).openapi("CommentAttachmentResponse"),TQ=U.object({id:U.string().openapi({description:"Unique comment identifier",example:"cmt_xyz789"}),thread_id:U.string(),author_email:U.string().email(),author_name:U.string().nullable(),body_md:U.string().openapi({description:"Comment body in Markdown"}),body_html:U.string().openapi({description:"Rendered HTML of the comment body"}),created_at:U.string().datetime(),updated_at:U.string().datetime().nullable(),version:U.number().int().min(1).openapi({description:"Edit version (starts at 1)"})}).openapi("Comment"),vc=U.object({anchor:yv.openapi({description:"Where this thread is anchored in the document"}),body_md:U.string().min(1).max(65536).openapi({description:"Initial comment body in Markdown (UTF-8, max 64KB)"}),severity:zQ.optional().default("suggestion")}).openapi("CreateThreadRequest"),RQ=U.object({id:U.string().openapi({description:"Unique thread identifier",example:"thr_abc123"}),session_id:U.string(),anchor:yv,status:U.enum(["open","resolved"]).openapi({description:"Thread status"}),severity:zQ,created_at:U.string().datetime(),updated_at:U.string().datetime(),comment_count:U.number().int().min(1),comments:U.array(TQ).optional().openapi({description:"Comments in this thread (included on creation)"})}).openapi("Thread"),_c=RQ.openapi("CreateThreadResponse"),wc=U.object({body_md:U.string().min(1).max(65536).openapi({description:"Comment body in Markdown (UTF-8, max 64KB)"})}).openapi("CreateCommentRequest"),gc=TQ.openapi("CreateCommentResponse"),bc=U.object({status:U.enum(["open","resolved"])}).openapi("UpdateThreadStatusRequest"),Uc=RQ.openapi("UpdateThreadStatusResponse"),Jc=U.object({session_id:U.string(),thread_id:U.string()}),Dc=U.object({session_id:U.string(),thread_id:U.string(),comment_id:U.string()});var dg=U.enum(["open","resolved","withdrawn","wont_fix"]).openapi("FindingStatus"),C6=U.enum(["suggestion","needs_changes","blocking"]).openapi("FindingSeverity"),QM=["undecided","accepted","rejected","deferred","duplicate","needs_more_info","dismissed","waived"],OG=U.enum(QM).openapi("FindingDecisionState"),WM=U.object({source_rule_release_id:U.string(),compiled_hash:U.string().nullable().optional(),source_rule_revision_id:U.string().nullable().optional(),source_clause_id:U.string().nullable().optional(),source_clause_lineage_id:U.string().nullable().optional(),matched_selectors:U.record(U.string(),U.string()).nullable().optional()}).openapi("RuleBasis"),Qc=U.object({anchor:yv,body_md:U.string().min(1).max(65536),severity:C6.optional(),attachments:U.array(KG).max(50).optional(),idempotency_key:U.string().max(256).optional(),source_review_id:U.string().optional(),source_finding_id:U.string().optional(),rule_basis:WM.optional()}).openapi("CreateFindingRequest"),Wc=U.object({finding_id:U.string(),comment_id:U.string(),attachments:U.array(jU),request_id:U.string()}).openapi("CreateFindingResponse"),Hc=U.object({status:dg.optional(),severity:C6.optional(),block_id:U.string().optional(),q:U.string().max(200).optional(),cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).default(50)}).openapi("ListFindingsQuery"),HM=U.object({finding_id:U.string(),status:dg,severity:C6.nullable(),anchor:yv,comment_count:U.number().int().nonnegative(),body_preview:U.string().nullable().optional(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).openapi("FindingSummary"),nc=U.object({findings:U.array(HM),next_cursor:U.string().nullable(),has_more:U.boolean(),request_id:U.string()}).openapi("ListFindingsResponse"),nM=U.object({comment_id:U.string(),body_md:U.string(),author_name:U.string().nullable(),author_email:U.string().nullable(),attachments:U.array(jU),created_at:U.string().datetime()}).openapi("FindingComment"),qM=U.object({block_id:U.string(),block_key:U.string().nullable(),block_type:U.string(),properties:U.record(U.string(),U.unknown())}).openapi("FindingBlockContext"),IM=U.object({outcome:OG,decided_at:U.string().datetime(),decided_by:U.string().nullable()}).openapi("FindingDecision"),qc=U.object({finding_id:U.string(),review_id:U.string(),status:dg,severity:C6.nullable(),anchor:yv,block_context:qM.nullable(),comments:U.array(nM),decision:IM.nullable(),created_at:U.string().datetime(),updated_at:U.string().datetime(),request_id:U.string()}).openapi("FindingDetailResponse"),Ic=U.object({status:dg.optional(),severity:C6.optional(),expected_version:U.number().int().positive().optional()}).openapi("PatchFindingRequest"),Bc=U.object({finding_id:U.string(),review_id:U.string(),status:dg,severity:C6.nullable(),version:U.number().int().positive(),updated_at:U.string().datetime(),request_id:U.string()}).openapi("PatchFindingResponse"),Lc=U.object({body_md:U.string().min(1).max(65536),attachments:U.array(KG).max(50).optional(),idempotency_key:U.string().max(256).optional()}).openapi("CreateFindingCommentRequest"),Vc=U.object({comment_id:U.string(),attachments:U.array(jU),request_id:U.string()}).openapi("CreateFindingCommentResponse"),jc=U.object({state:OG,rationale_md:U.string().min(1).max(65536).optional(),expected_version:U.number().int().positive().optional()}).openapi("CreateFindingDecisionRequest"),Fc=U.object({decision_id:U.string(),finding_id:U.string(),state:OG,request_id:U.string()}).openapi("CreateFindingDecisionResponse"),Kc=U.object({evidence_type:U.string().min(1),evidence_json:U.record(U.string(),U.unknown()),dedupe_key:U.string().max(256).optional()}).openapi("CreateFindingEvidenceRequest"),Oc=U.object({evidence_id:U.string(),finding_id:U.string(),type:U.string(),request_id:U.string()}).openapi("CreateFindingEvidenceResponse");var BM=["pattern","canon_disagreement","rule_gap","drafting_recommendation"],iG=U.enum(BM).openapi("GovernanceSignalKind"),LM=["new","triaged","accepted_for_drafting","dismissed","converted","snoozed"],pg=U.enum(LM).openapi("GovernanceSignalState");var CQ=U.object({target_type:U.string().trim().min(1).max(64),target_id:U.string().trim().min(1).max(256),target_context:U.object({review_id:U.string().trim().min(1).max(256).optional(),block_id:U.string().trim().min(1).max(256).optional()}).strict().optional()}).strict().openapi("GovernanceSignalTarget"),EQ=U.object({source_type:U.enum(["human","agent"]),source_label:U.string().trim().min(1).max(256),source_model:U.string().trim().min(1).max(256).optional(),source_harness:U.string().trim().min(1).max(256).optional(),submitted_by:U.string().trim().min(1).max(256),submitted_at:U.string().datetime()}).strict().openapi("GovernanceSignalProvenance"),ZQ=U.object({export_sha256:U.string().regex(/^[0-9a-f]{64}$/).optional(),rulepack_sha256:U.string().regex(/^[0-9a-f]{64}$/).optional(),source_content_sha256:U.string().regex(/^[0-9a-f]{64}$/).optional(),basis_review_ids:U.array(U.string().trim().min(1).max(256)).optional(),basis_finding_ids:U.array(U.string().trim().min(1).max(256)).optional(),source_rule_refs:U.array(U.string().trim().min(1).max(256)).optional(),rationale:U.string().trim().min(1).max(8000),custom:U.record(U.string(),U.string()).optional()}).strict().openapi("GovernanceSignalBasis"),xQ=U.object({body_md:U.string().min(1).max(65536),structured_data:U.record(U.string(),U.unknown()).optional(),evidence_refs:U.array(U.string().trim().min(1).max(512)).optional(),confidence:U.number().min(0).max(1).optional(),severity_hint:U.string().trim().min(1).max(32).optional()}).strict().openapi("GovernanceSignalPayload"),FU=U.object({severity:U.string().trim().min(1).max(64).nullable(),affected_rule_document_ids:U.array(U.string().trim().min(1).max(256)),grouping_id:U.string().trim().min(1).max(256).nullable()}).strict().openapi("GovernanceSignalTriageMetadata"),VM=U.string().trim().min(1).max(256).openapi("GovernanceSignalId"),Nc=U.object({signal_id:VM,kind:iG,state:pg,workspace_id:U.string().trim().min(1).max(256),target:CQ,review_id:U.string().trim().min(1).max(256).nullable(),provenance:EQ,basis:ZQ.nullable(),payload:xQ,triage_metadata:FU.nullable(),dismissal_reason:U.string().trim().min(1).max(8000).nullable(),snooze_reason:U.string().trim().min(1).max(8000).nullable(),re_triage_date:U.string().datetime().nullable(),converted_working_draft_ids:U.array(U.string().trim().min(1).max(256)).nullable(),version:U.number().int().positive(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).openapi("GovernanceSignal"),Pc=U.object({kind:iG,workspace_id:U.string().trim().min(1).max(256),target:CQ,provenance:EQ,basis:ZQ.optional(),payload:xQ,review_id:U.string().trim().min(1).max(256).optional(),idempotency_key:U.string().trim().min(1).max(256).optional()}).strict().openapi("CreateGovernanceSignalRequest"),fc=U.object({workspace_id:U.string().trim().min(1).max(256).optional(),review_id:U.string().trim().min(1).max(256).optional(),kind:iG.optional(),state:pg.optional(),submitted_by:U.string().trim().min(1).max(256).optional(),limit:U.coerce.number().int().min(1).max(200).default(50),offset:U.coerce.number().int().min(0).default(0)}).strict().openapi("GovernanceSignalListQuery"),Ac=U.object({target_state:pg,expected_version:U.number().int().positive().optional(),reason:U.string().trim().min(1).max(8000).optional(),triage_metadata:FU.optional(),re_triage_date:U.string().datetime().optional(),converted_working_draft_ids:U.array(U.string().trim().min(1).max(256)).optional(),idempotency_key:U.string().trim().min(1).max(256).optional()}).strict().openapi("TransitionGovernanceSignalRequest");var kG=U.enum(["rule","exception","definition","example","rationale","procedure","heading","metadata"]).openapi("ClauseKind"),NG=U.enum(["introduced","carried_forward","changed","retired","replaced"]).openapi("DerivationOutcome"),Sc=U.object({source_rule_revision_id:U.string(),clause_id:U.string(),clause_lineage_id:U.string(),carried_forward_from_clause_id:U.string().nullable(),block_id:U.string(),block_key:U.string().nullable(),block_index:U.number().int().nonnegative(),kind:kG,strength:U.enum(["must","should","may","must_not"]).nullable(),category:U.string().nullable(),canonical_plaintext:U.string(),selectors:U.record(U.string(),U.string()).default({}),parser_version:U.string(),extractor_version:U.string(),selector_schema_version:U.string(),source_map:U.object({start_offset:U.number().int().nonnegative(),end_offset:U.number().int().nonnegative(),source_line:U.number().int().positive().nullable()}).nullable().default(null),derivation_receipt_hash:U.string()}).openapi("DerivedRuleClause"),uc=U.object({clause_id:U.string(),outcome:NG,source_clause_id:U.string().nullable(),source_revision_id:U.string().nullable(),derivation_method:U.enum(["explicit","algorithmic"]),derived_at:U.string().datetime(),derived_by:U.string()}).openapi("DerivationReceipt");var jM={clause_count:8,selector_count:3,precedence_clause_count:4,exception_change_count:1,required_approvals:1},lQ=U.object({clause_count:U.number().int().min(1).default(8),selector_count:U.number().int().min(1).default(3),precedence_clause_count:U.number().int().min(1).default(4),exception_change_count:U.number().int().min(1).default(1),required_approvals:U.number().int().min(1).default(1)}).openapi("ReleaseVerificationThresholds"),FM=U.enum(["active","superseded","rolled_back"]).openapi("RuleReleaseStatus"),eg=U.object({rule_release_id:U.string(),release_version:U.number().int().positive(),workspace_id:U.string(),included_rule_revision_ids:U.array(U.string()),compiled_hash:U.string(),status:FM,effective_at:U.string().datetime(),activated_at:U.string().datetime(),activated_by:U.string(),supersedes_release_id:U.string().nullable(),rollback_of_release_id:U.string().nullable(),change_note:U.string().nullable().default(null),source_candidate_id:U.string(),created_at:U.string().datetime()}).openapi("RuleRelease"),Cc=U.enum(["unapproved_candidate","stale_candidate","workspace_frozen","no_prior_release","concurrent_activation","verification_required"]);var Ec=U.object({release_candidate_id:U.string(),idempotency_key:U.string().max(256).optional()}).strict().openapi("ActivateReleaseRequest"),Zc=U.object({target_release_id:U.string().optional(),reason:U.string().min(1).max(1024),idempotency_key:U.string().max(256).optional()}).strict().openapi("RollbackReleaseRequest"),xc=U.object({rule_release_id:U.string(),release_version:U.number().int().positive(),status:U.literal("active"),supersedes_release_id:U.string().nullable(),effective_at:U.string().datetime(),request_id:U.string()}).openapi("ActivateReleaseResponse"),lc=U.object({rule_release_id:U.string(),release_version:U.number().int().positive(),status:U.literal("active"),rollback_of_release_id:U.string(),change_note:U.string().nullable().default(null),effective_at:U.string().datetime(),request_id:U.string()}).openapi("RollbackReleaseResponse"),hQ=U.object({workspace_id:U.string(),active_rule_release_id:U.string().nullable(),activation_frozen:U.boolean(),last_freeze_change_reason:U.string().nullable().default(null),last_freeze_change_actor_id:U.string().nullable().default(null),last_freeze_change_at:U.string().datetime().nullable().default(null),require_publisher_activator_separation:U.boolean().default(!1),updated_at:U.string().datetime().nullable(),verification_thresholds:lQ.default(jM)}).openapi("ReleaseControlState"),hc=U.object({verification_thresholds:lQ.optional(),require_publisher_activator_separation:U.boolean().optional()}).refine(($)=>$.verification_thresholds!==void 0||$.require_publisher_activator_separation!==void 0,{message:"At least one release control field must be provided for update",path:[]}).strict().openapi("UpdateReleaseControlRequest"),cc=U.object({limit:U.coerce.number().int().min(1).max(100).default(25)}).strict().openapi("ListRuleReleasesQuery"),yc=U.object({items:U.array(eg),control:hQ,request_id:U.string()}).openapi("ListRuleReleasesResponse"),cQ=U.object({reason:U.string().min(1).max(1024).optional(),idempotency_key:U.string().max(256).optional()}).strict(),mc=cQ.openapi("FreezeReleaseRequest"),rc=cQ.openapi("UnfreezeReleaseRequest"),PG=U.object({control:hQ,request_id:U.string()}),oc=PG.openapi("FreezeReleaseResponse"),tc=PG.openapi("UnfreezeReleaseResponse"),dc=PG.openapi("UpdateReleaseControlResponse");var fG=["open","claimed","in_progress","blocked","done","canceled","expired"];var E6=U.enum(fG).openapi("WorkItemState"),KU=["review_task","verification_task","triage_task","approval_task","manual_task"],AG=U.enum(KU).openapi("WorkItemKind"),OU=["assigned","reviewer_pool","watchers","external_invite"],ag=U.enum(OU).openapi("WorkItemAudienceMode"),iU=["review_requested","verification_needed","challenge_received","draft_feedback","signal_triage","activation_approval","manual_assignment"],MG=U.enum(iU).openapi("WorkItemReasonCode"),zG=["my_work","team_queue","activity","external_entrypoint"],yQ=U.enum(zG).openapi("WorkItemQueueSurface");var SG=["claim","release","start","block","unblock","complete","cancel","expire"],KM=U.enum(SG).openapi("WorkItemTransitionAction"),uG=["completed","approved","rejected","needs_changes"],OM=U.enum(uG).openapi("WorkItemCompletionOutcome"),kU=U.string().regex(/^wi_[0-9A-HJKMNP-TV-Z]{26}$/).openapi("WorkItemId"),mQ=U.object({target_type:U.string().min(1).max(64),target_id:U.string().min(1).max(128)}).strict().openapi("WorkItemTarget");var rQ=U.object({title:U.string().min(1).max(256),kind:AG,reason_code:MG,audience_mode:ag,blocking:U.boolean().default(!0),priority:U.number().int().min(0).max(9).default(5),target:mQ,assignee_id:U.string().min(1).max(128).optional(),steward_group:U.string().min(1).max(128).optional(),due_at:U.string().datetime().optional(),metadata:U.record(U.string(),U.unknown()).optional(),idempotency_key:U.string().max(256).optional()}).strict().superRefine(($,v)=>{if($.audience_mode==="assigned"&&!$.assignee_id)v.addIssue({code:U.ZodIssueCode.custom,message:'assignee_id is required when audience_mode is "assigned"',path:["assignee_id"]});if($.audience_mode!=="assigned"&&$.assignee_id)v.addIssue({code:U.ZodIssueCode.custom,message:'assignee_id is only valid when audience_mode is "assigned"',path:["assignee_id"]});if($.audience_mode==="watchers"&&$.blocking)v.addIssue({code:U.ZodIssueCode.custom,message:"watchers work items must be non-blocking",path:["blocking"]})}).openapi("CreateWorkItemRequest"),oQ=U.object({work_item_id:kU,workspace_id:U.string().min(1).max(128),title:U.string().min(1).max(256),description:U.string().max(4000).optional(),kind:AG,reason_code:MG,state:E6,audience_mode:ag,blocking:U.boolean(),target:mQ,priority:U.number().int().min(0).max(9),assignee_id:U.string().nullable(),claimant_id:U.string().nullable(),claimed_at:U.string().datetime().nullable(),due_at:U.string().datetime().nullable(),expires_at:U.string().datetime().nullable(),steward_group:U.string().nullable(),metadata:U.record(U.string(),U.unknown()),version:U.number().int().positive(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).strict(),ac=oQ.superRefine(($,v)=>{if($.audience_mode==="assigned"&&!$.assignee_id)v.addIssue({code:U.ZodIssueCode.custom,message:'assignee_id is required when audience_mode is "assigned"',path:["assignee_id"]});if($.audience_mode!=="assigned"&&$.assignee_id)v.addIssue({code:U.ZodIssueCode.custom,message:'assignee_id is only valid when audience_mode is "assigned"',path:["assignee_id"]});if($.audience_mode==="watchers"&&$.blocking)v.addIssue({code:U.ZodIssueCode.custom,message:"watchers work items must be non-blocking",path:["blocking"]});if($.state==="open"&&$.claimant_id)v.addIssue({code:U.ZodIssueCode.custom,message:"open work items must not have a claimant_id",path:["claimant_id"]});if($.state==="open"&&$.claimed_at)v.addIssue({code:U.ZodIssueCode.custom,message:"open work items must not have a claimed_at timestamp",path:["claimed_at"]});if(["claimed","in_progress","blocked"].includes($.state)&&!$.claimant_id)v.addIssue({code:U.ZodIssueCode.custom,message:`${$.state} work items require a claimant_id`,path:["claimant_id"]});if($.claimant_id&&!$.claimed_at)v.addIssue({code:U.ZodIssueCode.custom,message:"claimed_at is required when claimant_id is present",path:["claimed_at"]});if(!$.claimant_id&&$.claimed_at)v.addIssue({code:U.ZodIssueCode.custom,message:"claimant_id is required when claimed_at is present",path:["claimant_id"]})}).openapi("WorkItem"),iM=oQ.pick({work_item_id:!0,title:!0,kind:!0,reason_code:!0,state:!0,audience_mode:!0,blocking:!0,target:!0,priority:!0,assignee_id:!0,claimant_id:!0,due_at:!0,version:!0,created_at:!0,updated_at:!0}).extend({queue_surface:yQ,why_in_queue:U.string().min(1).max(256)}).openapi("WorkItemSummary"),tQ=U.object({state:E6.optional(),kind:AG.optional(),reason_code:MG.optional(),audience_mode:ag.optional(),queue_surface:yQ.optional(),assignee_id:U.string().max(128).optional(),claimant_id:U.string().max(128).optional(),cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).default(25)}).openapi("ListWorkItemsQuery"),sc=U.object({items:U.array(iM),next_cursor:U.string().nullable(),has_more:U.boolean(),request_id:U.string()}).openapi("ListWorkItemsResponse"),dQ=U.object({action:KM,expected_version:U.number().int().positive().optional(),idempotency_key:U.string().max(256).optional(),blocking_reason:U.string().min(1).max(256).optional(),cancellation_reason:U.string().min(1).max(256).optional(),completion_outcome:OM.optional(),comment:U.string().max(4000).optional()}).strict().superRefine(($,v)=>{if($.action==="block"&&!$.blocking_reason)v.addIssue({code:U.ZodIssueCode.custom,message:"blocking_reason is required when action is block",path:["blocking_reason"]});if($.action==="cancel"&&!$.cancellation_reason)v.addIssue({code:U.ZodIssueCode.custom,message:"cancellation_reason is required when action is cancel",path:["cancellation_reason"]});if($.action==="complete"&&!$.completion_outcome)v.addIssue({code:U.ZodIssueCode.custom,message:"completion_outcome is required when action is complete",path:["completion_outcome"]})}).openapi("TransitionWorkItemRequest"),$y=U.object({work_item_id:U.string(),from_state:E6,to_state:E6,claimant_id:U.string().nullable(),version:U.number().int().positive(),updated_at:U.string().datetime(),request_id:U.string()}).openapi("TransitionWorkItemResponse");var aQ=U.enum(["must","should","may","must_not"]).openapi("RuleStrength"),kM=U.enum(["error","warning","info"]).openapi("RuleCheckFindingSeverity"),NM=U.enum(["document"]).openapi("RuleCheckAnchorMode"),PM=U.object({rule_text:U.string(),strength:aQ,category:U.string().nullable(),source_review_id:U.string(),block_id:U.string(),block_index:U.number().int().nonnegative(),specificity:U.number().int().nonnegative(),applicability:U.record(U.string(),U.string())}).openapi("MatchedRuleResponse"),sQ=U.object({latest_rule_session_updated_at:U.string().datetime().nullable(),contributing_session_count:U.number().int().nonnegative(),total_rule_count:U.number().int().nonnegative()}).openapi("RuleBundleFreshness"),Dy=U.object({format:U.enum(["json","text","prompt"]).default("json"),limit:U.coerce.number().int().min(1).max(200).default(50),offset:U.coerce.number().int().nonnegative().default(0),collection_id:U.string().optional()}).openapi("ListRulesQuery"),Xy=U.object({rules:U.array(PM),total:U.number().int().nonnegative(),limit:U.number().int().positive(),offset:U.number().int().nonnegative(),freshness:sQ,compiled_hash:U.string(),request_id:U.string()}).openapi("ListRulesResponse"),Gy=U.object({content:U.string().min(1).max(1048576),properties:mv.optional().default({}),collection_id:U.string().optional(),idempotency_key:U.string().max(256).optional()}).strict().openapi("RuleCheckRequest"),fM=U.object({block_index:U.number().int().nonnegative(),severity:kM,message:U.string(),rule_ref:e0.optional()}).openapi("RuleCheckFinding"),AM=U.object({total:U.number().int().nonnegative(),blocking:U.number().int().nonnegative(),warnings:U.number().int().nonnegative(),suggestions:U.number().int().nonnegative()}).openapi("RuleCheckSummary"),Yy=U.object({findings:U.array(fM),summary:AM,anchor_mode:NM.optional(),rules_evaluated:U.number().int().nonnegative(),freshness:sQ,compiled_hash:U.string(),request_id:U.string()}).openapi("RuleCheckResponse"),MM=U.object({source:U.enum(["manual","findings","external"]),source_review_id:U.string().optional(),source_label:U.string().max(256).optional()}).openapi("RuleImportProvenance"),Qy=U.object({content:U.string().min(1).max(524288),title:U.string().max(512).optional(),applicability:mv.optional(),provenance:MM.optional(),preview:U.boolean().default(!1),idempotency_key:U.string().max(256).optional()}).strict().openapi("RuleImportRequest"),$W=U.object({source:U.enum(["manual","findings","external"]),source_review_id:U.string().optional(),source_label:U.string().max(256).optional(),content_bytes:U.number().int().positive(),review_title:U.string().nullable()}).openapi("RuleImportMetadata"),vW=U.object({block_index:U.number().int().nonnegative(),strength:aQ,category:U.string().nullable(),plaintext:U.string()}).openapi("ParsedRuleBlock"),zM=U.object({preview:U.literal(!0),parsed_rules:U.array(vW),total_rules:U.number().int().nonnegative(),warnings:U.array(U.string()),import_metadata:$W,request_id:U.string()}).openapi("RuleImportPreviewResponse"),SM=U.object({preview:U.literal(!1),review_id:U.string(),state:U.literal("draft"),parsed_rules:U.array(vW),total_rules:U.number().int().nonnegative(),warnings:U.array(U.string()),import_metadata:$W,request_id:U.string()}).openapi("RuleImportCreateResponse"),Wy=U.discriminatedUnion("preview",[zM,SM]),_W=U.enum(["finding_seeded","curated_feedback","advisory_seeded","direct_authored","imported"]).openapi("RuleInspectionOriginType"),uM=U.object({finding_id:U.string(),review_id:U.string(),review_title:U.string().nullable(),block_id:U.string().nullable(),body_excerpt:U.string().nullable(),severity:U.string().nullable(),created_at:U.string().datetime()}).openapi("RuleInspectionSourceFinding"),TM=U.object({review_id:U.string(),title:U.string().nullable(),file_path:U.string().nullable(),finding_count:U.number().int().nonnegative(),created_at:U.string().datetime()}).openapi("RuleInspectionSourceReview"),RM=U.object({artifact_id:U.string(),artifact_kind:U.string(),source_label:U.string().nullable(),source_model:U.string().nullable(),confidence:U.number().nullable(),body_excerpt:U.string().nullable(),adopted_at:U.string().datetime(),adopted_by:U.string().nullable()}).openapi("RuleInspectionSourceAdvisory"),pQ=U.object({review_id:U.string(),title:U.string().nullable(),state:U.string(),published_at:U.string().datetime().nullable(),superseded_at:U.string().datetime().nullable()}).openapi("RuleInspectionLineageLink"),CM=U.object({root_review_id:U.string(),is_root:U.boolean(),predecessor:pQ.nullable(),successor:pQ.nullable(),revision_depth:U.number().int().positive()}).openapi("RuleInspectionLineage"),EM=U.object({adopted_review_count:U.number().int().nonnegative(),total_findings:U.number().int().nonnegative(),governance_signal_count:U.number().int().nonnegative(),challenges_received:U.number().int().nonnegative(),action_receipt_count:U.number().int().nonnegative()}).openapi("RuleInspectionDownstream"),ZM=U.object({total_signals:U.number().int().nonnegative(),open_signals:U.number().int().nonnegative(),dismissed_signals:U.number().int().nonnegative(),converted_signals:U.number().int().nonnegative(),last_signaled_at:U.string().datetime().nullable()}).openapi("RuleInspectionChallengeSummary"),xM=U.object({work_item_id:U.string(),state:E6,audience_mode:ag,assignee_id:U.string().nullable(),claimant_id:U.string().nullable(),steward_group:U.string().nullable(),updated_at:U.string().datetime()}).openapi("RuleInspectionOpenChallengeWorkItem"),lM=U.object({signal_id:U.string(),state:pg,submitted_by:U.string(),basis_rationale:U.string().nullable(),affected_rule_document_ids:U.array(U.string()),triage_metadata:FU.nullable(),created_at:U.string().datetime(),updated_at:U.string().datetime(),work_item:xM.nullable()}).openapi("RuleInspectionOpenChallenge"),Hy=U.object({review_id:U.string(),title:U.string().nullable(),state:U.string(),file_path:U.string().nullable(),block_count:U.number().int().nonnegative(),active_block_count:U.number().int().nonnegative(),origin_type:_W,source_findings:U.array(uM),source_reviews:U.array(TM),source_advisories:U.array(RM),seeded_by:U.string().nullable(),seeded_at:U.string().datetime().nullable(),evidence_summary:U.string().nullable(),first_live_release:eg.nullable(),current_release:eg.nullable(),release_membership:U.array(eg),lineage:CM,downstream:EM,challenge_summary:ZM,open_challenges:U.array(lM),request_id:U.string()}).openapi("RuleReviewInspectionResponse"),hM=U.object({introduced_clause_count:U.number().int().nonnegative(),carried_forward_clause_count:U.number().int().nonnegative(),changed_clause_count:U.number().int().nonnegative(),retired_clause_count:U.number().int().nonnegative(),replaced_clause_count:U.number().int().nonnegative(),selector_changed_clause_count:U.number().int().nonnegative()}).openapi("RuleReviewDiffSummary"),cM=U.object({outcome:NG,clause_lineage_id:U.string(),kind:kG,block_key:U.string().nullable(),current_clause_id:U.string().nullable(),previous_clause_id:U.string().nullable(),current_plaintext:U.string().nullable(),previous_plaintext:U.string().nullable(),selectors_changed:U.boolean()}).openapi("RuleReviewDiffClause"),ny=U.object({review_id:U.string(),predecessor_review_id:U.string().nullable(),summary:hM,clauses:U.array(cM),request_id:U.string()}).openapi("RuleReviewDiffResponse"),wW=U.enum(["7d","14d","30d","all"]).openapi("RuleEvidenceWindow"),eQ=U.object({finding_seeded:U.number().int().nonnegative(),curated_feedback:U.number().int().nonnegative(),advisory_seeded:U.number().int().nonnegative(),direct_authored:U.number().int().nonnegative(),imported:U.number().int().nonnegative()}).openapi("RuleProvenanceOriginBreakdown"),yM=U.object({rule_session_id:U.string(),rule_session_name:U.string().nullable(),origin_type:_W,published_at:U.string().datetime().nullable()}).openapi("RuleProvenanceLatestFeedbackRule"),gW=U.object({tenant_id:U.string(),by_origin:eQ,active_by_origin:eQ,feedback_originated_count:U.number().int().nonnegative(),feedback_originated_active_count:U.number().int().nonnegative(),feedback_origin_rate:U.number().min(0).max(1),latest_feedback_rule:yM.nullable(),computed_at:U.string().datetime()}).openapi("RuleProvenanceAggregate"),qy=U.object({provenance:gW,request_id:U.string()}).openapi("RuleProvenanceAggregateResponse"),mM=U.object({tenant_id:U.string(),window:wW,window_start:U.string().datetime(),window_end:U.string().datetime(),total_content_reviews:U.number().int().nonnegative(),adopted_reviews:U.number().int().nonnegative(),adoption_rate:U.number().min(0).max(1),active_rule_sessions:U.number().int().nonnegative(),active_rule_blocks:U.number().int().nonnegative(),adopted_rule_blocks:U.number().int().nonnegative(),prior_window_adoption_rate:U.number().min(0).max(1).nullable(),adoption_rate_delta:U.number().nullable(),computed_at:U.string().datetime()}).openapi("RuleEvidenceAdoptionRollup"),Iy=U.object({tenant_id:U.string(),window:wW,window_start:U.string().datetime(),window_end:U.string().datetime(),adoption:mM,total_active_rules:U.number().int().nonnegative(),zero_use_rules:U.number().int().nonnegative(),high_trigger_rules:U.number().int().nonnegative(),low_trigger_rules:U.number().int().nonnegative(),rules_published_in_window:U.number().int().nonnegative(),rules_superseded_in_window:U.number().int().nonnegative(),rules_deprecated_in_window:U.number().int().nonnegative(),total_findings_in_window:U.number().int().nonnegative(),resolved_findings_in_window:U.number().int().nonnegative(),unresolved_findings_in_window:U.number().int().nonnegative(),false_positive_findings_in_window:U.number().int().nonnegative(),provenance:gW,computed_at:U.string().datetime(),request_id:U.string()}).openapi("RuleEvidenceRollupResponse");var TG=U.enum(["draft","in_review","revising","ready_to_publish","withdrawn"]).openapi("WorkingDraftState");var Vy=U.object({target_state:TG,idempotency_key:U.string().max(256).optional()}).strict().openapi("WorkingDraftTransitionRequest"),jy=U.object({draft_id:U.string(),previous_state:TG,state:TG,version:U.number().int().positive(),updated_at:U.string().datetime(),request_id:U.string()}).openapi("WorkingDraftTransitionResponse"),Fy=U.enum(["created","active","closed","superseded","archived"]).openapi("RuleReviewState");var Ky=U.enum(["unpublished","published","superseded","deprecated"]).openapi("RuleRevisionState");var ky=U.object({require_approval_before_publish:U.boolean().default(!1),require_publisher_activator_separation:U.boolean().default(!1),scoped_publish_enabled:U.boolean().default(!1),emergency_freeze:U.boolean().default(!1)}).openapi("GovernanceControls");var Ny=U.object({identity:U.string(),workspace_id:U.string().default("*"),selector_domain:U.string().default("*")}).openapi("PublishPermissionEntry"),Py=U.object({allowed:U.boolean(),denial_reason:U.enum(["approval_required","publisher_activator_same_identity","publish_scope_denied","emergency_freeze_active"]).nullable(),denial_message:U.string().nullable()}).openapi("GovernanceAuthCheckResult");var NU=U.enum(["manifest","structured","text","diff","chunk"]).openapi("RuleRetrievalMode"),RG=U.enum(["workspace","collection","review","file"]).openapi("RuleRetrievalScope"),My=U.object({mode:NU,release_id:U.string().optional(),scope:RG.default("workspace"),collection_id:U.string().optional(),review_id:U.string().optional(),file_path:U.string().optional(),properties:U.record(U.string(),U.string()).optional(),token_budget:U.number().int().positive().optional()}).openapi("RuleRetrievalQuery"),rM=U.object({rule_document_id:U.string(),title:U.string().nullable(),revision_id:U.string(),clause_count:U.number().int().nonnegative(),strength_breakdown:U.object({must:U.number().int().nonnegative(),should:U.number().int().nonnegative(),may:U.number().int().nonnegative(),must_not:U.number().int().nonnegative()}),applicability:U.record(U.string(),U.string()),published_at:U.string().datetime().nullable()}),PU=U.object({mode:U.literal("manifest"),release_id:U.string(),documents:U.array(rM),total_documents:U.number().int().nonnegative(),total_clauses:U.number().int().nonnegative(),compiled_hash:U.string(),request_id:U.string()}).openapi("RuleManifestResponse"),oM=U.object({clause_id:U.string(),clause_lineage_id:U.string(),document_id:U.string(),block_id:U.string(),block_index:U.number().int().nonnegative(),kind:U.string(),strength:U.enum(["must","should","may","must_not"]).nullable(),category:U.string().nullable(),plaintext:U.string(),selectors:U.record(U.string(),U.string())}),fU=U.object({mode:U.literal("structured"),release_id:U.string(),clauses:U.array(oM),total_clauses:U.number().int().nonnegative(),compiled_hash:U.string(),request_id:U.string()}).openapi("RuleStructuredResponse"),AU=U.object({mode:U.literal("text"),release_id:U.string(),text:U.string(),total_clauses:U.number().int().nonnegative(),compiled_hash:U.string(),request_id:U.string()}).openapi("RuleTextResponse"),tM=U.object({clause_lineage_id:U.string(),outcome:U.enum(["introduced","carried_forward","changed","retired","replaced"]),before:U.string().nullable(),after:U.string().nullable(),strength_before:U.enum(["must","should","may","must_not"]).nullable(),strength_after:U.enum(["must","should","may","must_not"]).nullable()}),MU=U.object({mode:U.literal("diff"),from_release_id:U.string(),to_release_id:U.string(),changes:U.array(tM),total_changes:U.number().int().nonnegative(),request_id:U.string()}).openapi("RuleDiffResponse"),zU=U.object({mode:U.literal("chunk"),release_id:U.string(),chunks:U.array(U.object({chunk_index:U.number().int().nonnegative(),text:U.string(),clause_count:U.number().int().nonnegative(),token_estimate:U.number().int().nonnegative()})),total_chunks:U.number().int().nonnegative(),total_clauses:U.number().int().nonnegative(),compiled_hash:U.string(),request_id:U.string()}).openapi("RuleChunkResponse"),zy=U.discriminatedUnion("mode",[PU,fU,AU,MU,zU]),Sy=U.object({error:U.object({code:U.literal("invalid_retrieval_mode"),message:U.string(),retryable:U.boolean(),details:U.object({valid_modes:U.array(NU)})}),request_id:U.string()}).openapi("RuleRetrievalInvalidModeError");var dM=["must","should","may","must_not","exception_must","exception_should","definition","example","rationale","procedure"],pM=U.enum(dM).openapi("ClauseMarker");var eM=U.object({title:U.string().min(1).max(512),owner:U.string().min(1).max(256),selectors:U.record(U.string(),U.string()).optional(),review_cadence:U.string().max(64).optional(),version:U.string().max(64).optional(),status:U.enum(["draft","active","deprecated"]).optional(),steward_group:U.string().max(256).optional(),applicability:U.record(U.string(),U.string()).optional()}).openapi("RuleDocumentFrontmatter"),Ry=U.object({selectors:U.record(U.string(),U.string()),scope:U.enum(["section","clause"]).default("section")}).openapi("TsSelectorsDirective"),aM=U.object({marker:pM,kind:U.string(),strength:U.enum(["must","should","may","must_not"]).nullable(),plaintext:U.string(),block_index:U.number().int().nonnegative(),effective_selectors:U.record(U.string(),U.string()),owner:U.string().nullable().optional(),evidence_ref:U.string().nullable().optional()}).openapi("ParsedClause"),Cy=U.object({frontmatter:eM,clauses:U.array(aM),total_clauses:U.number().int().nonnegative(),warnings:U.array(U.string()),parser_version:U.string()}).openapi("RuleDocumentParseResult"),Ey=U.object({error:U.object({code:U.enum(["missing_frontmatter","invalid_frontmatter","missing_required_field","unknown_clause_marker","invalid_selector_namespace"]),message:U.string(),line:U.number().int().positive().nullable(),field:U.string().nullable()})}).openapi("RuleDocumentParseError");var sg=U.string().min(1).max(36).openapi("ReviewSetId"),Z6=U.enum(["git","upload"]).openapi("ReviewSetSourceType"),SU=U.enum(["review_set","release_bundle","packet"]).openapi("ReviewSetKind"),bW=U.enum(["active","closed","archived","deleted"]).openapi("ReviewSetState"),sM=U.enum(["topo","lex","lex_fallback"]).openapi("ReviewSetOrderingMethod"),$z=U.enum(["reviewer","approver"]).openapi("ReviewSetParticipantRole"),vz=U.object({email:U.string().email(),roles:U.array($z).min(1)}).openapi("ReviewSetParticipant"),_z=U.union([U.string(),U.object({review_id:U.string().optional(),session_id:U.string().optional(),required:U.boolean().optional()}).refine(($)=>typeof $.review_id==="string"||typeof $.session_id==="string",{message:"review_id is required for review entries",path:["review_id"]})]).openapi("ReviewSetSessionEntry"),wz=U.object({repo_id:cv,git_sha:Hv,file_path:D$,required:U.boolean().optional()}).openapi("ReviewSetGitFileEntry"),gz=U.object({project_id:U.string(),upload_batch_id:U.string(),file_path:D$,required:U.boolean().optional()}).openapi("ReviewSetUploadFileEntry"),bz=U.union([wz,gz]).openapi("ReviewSetFileEntry"),Uz=U.object({allow_mixed_shas:U.boolean().optional(),require_all_files_reviewed:U.boolean().optional()}).openapi("ReviewSetConfig"),ly=U.object({title:U.string().optional(),kind:SU.optional(),source_type:Z6,reviews:U.array(_z).max(200).optional(),files:U.array(bz).max(200).optional(),participants:U.array(vz).max(100).optional(),recipe_json:U.record(U.string(),U.unknown()).optional(),config:Uz.optional()}).openapi("CreateReviewSetRequest"),Jz=U.object({review_id:U.string(),file_path:D$,position:U.number().int().nonnegative(),required:U.boolean()}).openapi("ReviewSetItem"),Dz=U.object({email:U.string().email(),roles:U.array(U.string()),review_url:U.string().url(),delivery:U.object({channel:U.literal("email"),state:U.literal("pending")})}).openapi("ReviewSetInvitation"),Xz=U.object({review_id:U.string(),invitations:U.array(Dz)}).openapi("ReviewSetPerFileLinks"),hy=U.object({id:sg,title:U.string(),kind:SU,state:U.literal("active"),source_type:Z6,repo_id:U.string().nullable(),git_sha:U.string().nullable(),project_id:U.string().nullable(),upload_batch_id:U.string().nullable(),ordering_method:sM,items:U.array(Jz),links:U.object({set_link:U.string().url()}),per_file_links:U.array(Xz),event_id:U.string(),created_at:U.string().datetime(),request_id:U.string().nullable()}).openapi("CreateReviewSetResponse"),UW=U.object({id:sg,title:U.string().nullable(),kind:SU,state:bW,source_type:Z6,repo_id:U.string().nullable(),git_sha:U.string().nullable(),project_id:U.string().nullable(),upload_batch_id:U.string().nullable(),item_count:U.number().int().nonnegative(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).openapi("ReviewSetSummary"),cy=U.object({source_type:Z6.optional(),repo_id:cv.optional(),git_sha:Hv.optional(),project_id:U.string().optional(),upload_batch_id:U.string().optional(),kind:SU.optional(),state:bW.optional(),cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).default(20)}).openapi("ListReviewSetsQuery"),yy=U.object({items:U.array(UW),next_cursor:U.string().nullable(),request_id:U.string()}).openapi("ListReviewSetsResponse"),my=U.object({title:U.string().min(1).max(4096).optional(),state:U.enum(["active","closed","archived"]).optional()}).refine(($)=>$.title!==void 0||$.state!==void 0,"At least one field must be provided").openapi("UpdateReviewSetRequest"),ry=UW.extend({request_id:U.string()}).openapi("UpdateReviewSetResponse"),uU=U.enum(["pass","fail","warn"]).openapi("ReviewSetStatusVerdict"),TU=U.object({code:U.string(),message:U.string(),pointers:U.array(U.string())}).openapi("ReviewSetReasonCode"),CG=U.object({review_id:U.string(),file_path:D$,required:U.boolean(),verdict:uU,reason_codes:U.array(TU)}).openapi("ReviewSetStatusItem"),EG=U.object({action:U.string(),review_id:U.string(),finding_id:U.string().optional(),approver_email:U.string().email().optional(),reason_code:U.string(),message:U.string()}).openapi("ReviewSetActionRequired"),oy=U.object({review_set_id:sg,verdict:uU,reason_codes:U.array(TU),items:U.array(CG),policy_snapshot_id:U.string().nullable(),actions_required:U.array(EG).optional(),request_id:U.string()}).openapi("GetReviewSetStatusResponse"),Gz=U.enum(["blocked","needs_changes","suggestions","approved","not_started","in_progress"]).openapi("ReviewSetStatusIndicator"),Yz=U.object({requested:U.boolean(),decided:U.boolean(),decision:U.enum(["approved","rejected","conditional","pending"])}).openapi("ReviewSetApprovalState"),ZG=U.object({review_id:U.string(),role:U.enum(["content","rules"]),file_path:D$,position:U.number().int().nonnegative(),required:U.boolean(),status_summary:U.object({review_state:U.string(),thread_counts:U.object({total:U.number().int().nonnegative(),open:U.number().int().nonnegative(),resolved:U.number().int().nonnegative()}),severity_counts:U.object({blocking:U.number().int().nonnegative(),needs_changes:U.number().int().nonnegative(),suggestion:U.number().int().nonnegative()}),has_system_findings:U.boolean(),approval_state:Yz.nullable(),status_indicator:Gz})}).openapi("ReviewSetOverviewItem"),JW=U.object({total_items:U.number().int().nonnegative(),reviewed_items:U.number().int().nonnegative(),approved_items:U.number().int().nonnegative(),completion_pct:U.number().int().min(0).max(100)}).openapi("ReviewSetProgress"),ty=U.object({id:sg,title:U.string().nullable(),kind:U.string(),state:U.string(),source_type:Z6,repo_id:U.string().nullable(),git_sha:U.string().nullable(),project_id:U.string().nullable(),upload_batch_id:U.string().nullable(),snapshot_id:U.string().nullable(),ordering_method:U.string().nullable(),recipe_json:U.record(U.string(),U.unknown()).nullable(),created_at:U.string().datetime(),updated_at:U.string().datetime(),items:U.array(ZG),progress:JW,next_unresolved:U.object({review_id:U.string(),file_path:D$,block_id:U.string().nullable()}).nullable(),links:U.object({set_link:U.string().url().nullable()}),request_id:U.string()}).openapi("GetReviewSetResponse"),Qz=U.object({id:sg,title:U.string().nullable(),kind:U.string(),state:U.string(),source_type:Z6,repo_id:U.string().nullable(),git_sha:U.string().nullable(),project_id:U.string().nullable(),upload_batch_id:U.string().nullable(),snapshot_id:U.string().nullable(),ordering_method:U.string().nullable(),recipe_json:U.record(U.string(),U.unknown()).nullable(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).openapi("ReviewSetExportMetadata"),Wz=U.object({review_id:U.string(),file_path:D$,position:U.number().int().nonnegative(),required:U.boolean(),review_export:U.record(U.string(),U.unknown())}).openapi("ReviewSetExportItem"),Hz=U.object({canonicalization:U.literal("jcs"),export_sha256:U.string().regex(/^[0-9a-f]{64}$/).nullable()}).openapi("ReviewSetExportIntegrity"),dy=U.object({schema:U.literal("v2"),view_requested:U.string().nullable(),view_resolved:U.literal("review_set.v1"),set:Qz,items:U.array(Wz),progress:JW,integrity:Hz}).openapi("GetReviewSetExportResponse");var nz=["draft","ready","approved","activated","stale","rejected"];var xG=U.enum(nz).openapi("ReleaseCandidateState"),qz=["mark_ready","approve","reject","mark_stale","return_to_draft","activate","abandon"],lG=["mark_ready","reject","return_to_draft","activate","abandon"],Iz=U.enum(qz).openapi("ReleaseCandidateTransitionAction"),sy=U.enum(lG).openapi("PublicReleaseCandidateTransitionAction");var Bz=["release_diff","selector_coverage","precedence_check","casebank_replay"],Lz=U.enum(Bz).openapi("SimulationType"),Vz=U.object({type:Lz,result:U.unknown(),computed_at:U.string().datetime(),basis_hash:U.string().min(1)}).openapi("SimulationReceipt"),DW=U.object({approver_id:U.string().min(1),approved_at:U.string().datetime(),verification_notes:U.string(),approval_scope:U.string().min(1)}).openapi("ApprovalReceipt"),jz=["clause_count","selector_count","precedence_clause_count","exception_change_count"],Fz=U.enum(jz).openapi("ReleaseCandidateVerificationMetric"),Kz=U.object({clause_count:U.number().int().min(0),selector_count:U.number().int().min(0),precedence_clause_count:U.number().int().min(0),exception_change_count:U.number().int().min(0),high_impact:U.boolean(),triggered_thresholds:U.array(Fz),evaluated_at:U.string().datetime()}).openapi("ReleaseCandidateVerificationSummary"),Oz=U.enum(["not_required","pending","approved"]).openapi("ReleaseCandidateVerificationStatus"),iz=U.object({required_approvals:U.number().int().min(0).default(0),approval_receipts:U.array(DW),status:Oz,summary:Kz}).openapi("ReleaseCandidateVerification"),kz=["revision_superseded","new_revision_published","based_on_release_no_longer_active"],Nz=U.enum(kz).openapi("StalenessReason"),$m=U.object({is_stale:U.boolean(),reason:Nz.nullable(),detail:U.string().nullable(),checked_at:U.string().datetime()}).openapi("StalenessCheckResult");var vm=U.object({workspace_id:U.string().min(1).max(128),included_rule_revision_ids:U.array(U.string().min(1).max(128)).min(1),based_on_active_release_id:U.string().min(1).max(128).optional(),rollback_of_release_id:U.string().min(1).max(128).optional(),title:U.string().min(1).max(256).optional(),idempotency_key:U.string().max(256).optional()}).strict().openapi("CreateReleaseCandidateRequest"),XW=U.object({release_candidate_id:U.string(),workspace_id:U.string(),state:xG,title:U.string().nullable(),included_rule_revision_ids:U.array(U.string()),manifest_hash:U.string().nullable(),based_on_active_release_id:U.string().nullable(),rollback_of_release_id:U.string().nullable(),required_approvals:U.number().int().min(0).default(1),approval_receipts:U.array(DW),simulation_receipts:U.array(Vz),rejected_by:U.string().nullable(),rejection_reason:U.string().nullable(),stale_reason:U.string().nullable(),rule_release_id:U.string().nullable(),verification:iz.nullable().default(null),compiled_at:U.string().datetime().nullable(),compiled_by:U.string().nullable(),version:U.number().int().positive(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).openapi("ReleaseCandidateSummary"),_m=U.object({limit:U.coerce.number().int().min(1).max(25).default(6)}).strict().openapi("ListReleaseCandidatesQuery"),wm=U.object({items:U.array(XW),request_id:U.string()}).openapi("ListReleaseCandidatesResponse"),Pz=U.object({total_items:U.number().int().nonnegative(),reviewed_items:U.number().int().nonnegative(),approved_items:U.number().int().nonnegative(),completion_pct:U.number().int().min(0).max(100)}).openapi("ReleaseCandidateProgress"),fz=U.object({review_id:U.string(),file_path:U.string(),block_id:U.string().nullable()}).openapi("ReleaseCandidateNextUnresolved"),Az=U.object({set_link:U.string().url().nullable()}).openapi("ReleaseCandidateLinks"),Mz=XW.extend({source_type:U.enum(["git","upload"]),repo_id:U.string().nullable(),git_sha:U.string().nullable(),project_id:U.string().nullable(),upload_batch_id:U.string().nullable(),items:U.array(ZG),progress:Pz,next_unresolved:fz.nullable(),links:Az}).openapi("ReleaseCandidateDetail"),gm=Mz.extend({request_id:U.string()}).openapi("GetReleaseCandidateResponse"),bm=U.object({release_candidate_id:U.string(),verdict:uU,reason_codes:U.array(TU),items:U.array(CG),policy_snapshot_id:U.string().nullable(),actions_required:U.array(EG).optional(),request_id:U.string()}).openapi("GetReleaseCandidateStatusResponse"),Um=U.object({action:Iz,expected_version:U.number().int().positive().optional(),idempotency_key:U.string().max(256).optional(),rejection_reason:U.string().min(1).max(1024).optional(),stale_reason:U.string().min(1).max(1024).optional()}).strict().superRefine(($,v)=>{if($.action==="reject"&&!$.rejection_reason)v.addIssue({code:U.ZodIssueCode.custom,message:"rejection_reason is required when action is reject",path:["rejection_reason"]});if($.action==="abandon"&&!$.rejection_reason)v.addIssue({code:U.ZodIssueCode.custom,message:"rejection_reason is required when action is abandon",path:["rejection_reason"]});if($.action==="mark_stale"&&!$.stale_reason)v.addIssue({code:U.ZodIssueCode.custom,message:"stale_reason is required when action is mark_stale",path:["stale_reason"]})}).openapi("TransitionReleaseCandidateRequest"),Jm=U.object({release_candidate_id:U.string(),from_state:xG,to_state:xG,rule_release_id:U.string().nullable(),release_version:U.number().int().positive().nullable().optional(),version:U.number().int().positive(),updated_at:U.string().datetime(),request_id:U.string()}).openapi("TransitionReleaseCandidateResponse");var hG=U.record(U.string(),U.unknown()).openapi("ProjectConfig"),zz=U.enum(["active","deleting","deleted"]).openapi("ProjectState"),Gm=U.object({name:U.string().min(1).max(256),config:hG.optional()}).openapi("CreateProjectRequest"),Ym=U.object({name:U.string().min(1).max(256).optional(),config:hG.optional()}).openapi("UpdateProjectRequest"),Qm=U.object({cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).default(20)}).openapi("ListProjectsQuery"),Sz=U.object({id:U.string(),status:U.string(),file_count:U.number().int().nonnegative(),total_size_bytes:U.number().int().nonnegative(),created_at:U.string().datetime()}).openapi("ProjectLatestBatch"),uz=U.object({id:U.string(),name:U.string(),state:zz,tenant_id:U.string(),config_hash:U.string().nullable(),config:hG.nullable(),created_by_user_id:U.string().nullable(),created_at:U.string().datetime(),latest_batch:Sz.nullable().optional(),request_id:U.string()}).openapi("ProjectResponse"),Wm=U.object({items:U.array(uz.omit({request_id:!0})),next_cursor:U.string().nullable(),has_more:U.boolean(),request_id:U.string()}).openapi("ListProjectsResponse"),Hm=U.object({project_id:U.string(),state:U.literal("deleting"),deletion_job_id:U.string(),request_id:U.string()}).openapi("DeleteProjectResponse"),nm=U.object({from_path:D$,to_path:D$}).refine(($)=>$.from_path!==$.to_path,{message:"from_path and to_path must differ",path:["to_path"]}).openapi("CreateProjectMoveRequest"),qm=U.object({id:U.string(),project_id:U.string(),from_path:D$,to_path:D$,declared_at:U.string().datetime(),request_id:U.string()}).openapi("ProjectMoveResponse");var cG=U.enum(["git","upload"]).openapi("SessionTemplateSourceType"),Tz=U.object({participant_id:U.string().min(1).max(256),scope:U.enum(["read","comment","approve"])}).openapi("SessionTemplateParticipantConfig"),Rz=U.object({slack_channel:U.string().max(256).optional(),email_participants:U.boolean().optional()}).openapi("SessionTemplateNotificationConfig"),GW=U.object({participants:U.array(Tz).max(100).optional(),checks_enabled:U.boolean().optional(),policy_enabled:U.boolean().optional(),steering_enabled:U.boolean().optional(),extra_json:U.record(U.string(),U.unknown()).optional(),notification_config:Rz.optional()}).openapi("SessionTemplateConfig"),Lm=U.object({name:U.string().min(1).max(256),description:U.string().max(4000).optional(),source_type:cG,repo_id:U.string().max(256).optional(),project_id:U.string().max(256).optional(),config:GW}).openapi("CreateSessionTemplateRequest"),Vm=U.object({source_type:cG.optional(),repo_id:U.string().optional(),project_id:U.string().optional(),include_archived:U.boolean().optional(),cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).default(20)}).openapi("ListSessionTemplatesQuery"),Cz=U.object({id:U.string(),tenant_id:U.string(),name:U.string(),description:U.string().nullable(),source_type:cG,repo_id:U.string().nullable(),project_id:U.string().nullable(),config:GW,created_by_user_id:U.string().nullable(),created_at:U.string().datetime(),updated_at:U.string().datetime(),archived_at:U.string().datetime().nullable(),request_id:U.string()}).openapi("SessionTemplateResponse"),jm=U.object({items:U.array(Cz.omit({request_id:!0})),next_cursor:U.string().nullable(),request_id:U.string()}).openapi("ListSessionTemplatesResponse");var Ez=U.object({id:U.string(),tenant_id:U.string(),name:U.string(),description:U.string().nullable(),color:U.string().nullable(),created_by:U.string(),created_at:U.string().datetime().nullable(),updated_at:U.string().datetime().nullable(),archived_at:U.string().datetime().nullable(),request_id:U.string()}).openapi("CollectionResponse"),Om=U.object({name:U.string().min(1),description:U.string().nullable().optional(),color:U.string().nullable().optional()}).openapi("CreateCollectionRequest"),im=U.object({name:U.string().min(1).optional(),description:U.string().nullable().optional(),color:U.string().nullable().optional(),archived:U.boolean().optional()}).openapi("UpdateCollectionRequest"),km=U.object({cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).optional(),include_archived:U.boolean().optional()}).openapi("ListCollectionsQuery"),Zz=U.object({collection_id:U.string(),session_id:U.string(),added_at:U.string().datetime().nullable(),added_by:U.string(),request_id:U.string()}).openapi("CollectionSessionResponse"),Nm=U.object({session_id:U.string()}).openapi("AddCollectionSessionRequest"),xz=U.object({id:U.string(),collection_id:U.string(),url:U.string().url(),title:U.string(),link_type:U.string(),created_by:U.string(),created_at:U.string().datetime().nullable(),request_id:U.string()}).openapi("CollectionSourceLinkResponse"),Pm=U.object({url:U.string().url(),title:U.string(),link_type:U.string()}).openapi("CreateCollectionSourceLinkRequest"),fm=U.object({items:U.array(Ez.omit({request_id:!0})),cursor:U.string().nullable(),has_more:U.boolean(),request_id:U.string()}).openapi("ListCollectionsResponse"),Am=U.object({id:U.string(),tenant_id:U.string(),name:U.string(),description:U.string().nullable(),color:U.string().nullable(),created_by:U.string(),created_at:U.string().datetime().nullable(),updated_at:U.string().datetime().nullable(),archived_at:U.string().datetime().nullable(),source_links:U.array(xz.omit({request_id:!0})),sessions:U.array(Zz.omit({request_id:!0})),request_id:U.string()}).openapi("CollectionDetailResponse"),Mm=U.object({request_id:U.string()}).openapi("CollectionMutationAck");var YW=U.enum(["git","upload"]).openapi("CorpusSourceType"),lz=U.enum(["building","ready","failed"]).openapi("CorpusSnapshotStatus"),hz=U.enum(["frontmatter","marker","sidecar","auto"]).openapi("CorpusDocIdentityMode"),QW=U.object({in_scope_globs:U.array(U.string().min(1)).min(1).optional(),exclude_globs:U.array(U.string().min(1)).optional(),max_files:U.number().int().positive().optional(),max_total_bytes:U.number().int().positive().optional(),max_snapshot_build_seconds:U.number().int().positive().optional(),doc_identity_mode:hz.optional(),include_external_links:U.boolean().optional()}).openapi("CorpusConfig"),um=U.object({git_sha:Hv,corpus_config:QW.optional()}).openapi("RequestGitSnapshot"),Tm=U.object({upload_batch_id:U.string(),corpus_config:QW.optional()}).openapi("RequestUploadSnapshot"),Rm=U.object({snapshot_id:U.string(),status:lz,source_type:YW,repo_id:cv.optional(),git_sha:Hv.optional(),project_id:U.string().optional(),upload_batch_id:U.string().optional(),indexer_version:U.string(),config_hash:U.string(),snapshot_sha256:U.string().nullable().optional(),error_json:U.unknown().optional(),created_at:U.string().datetime(),request_id:U.string()}).openapi("CorpusSnapshotStatusResponse"),cz=U.object({source_path:D$,source_doc_key:U.string().nullable(),source_block_id:U.string().nullable(),link_kind:U.string(),context:U.null()}).openapi("CorpusBacklinkItem"),Cm=U.object({snapshot_id:U.string(),file_path:D$,anchor:U.string().nullable(),backlinks:U.array(cz),request_id:U.string()}).openapi("CorpusBacklinksResponse"),WW=U.object({file_path:D$,doc_key:U.string().nullable(),doc_type:U.string().nullable(),title:U.string().nullable()}).openapi("CorpusRepoMapItem"),Em=U.object({snapshot_id:U.string(),git_sha:Hv,files:U.array(WW),request_id:U.string()}).openapi("CorpusGitRepoMapResponse"),Zm=U.object({snapshot_id:U.string(),upload_batch_id:U.string(),files:U.array(WW),request_id:U.string()}).openapi("CorpusUploadRepoMapResponse"),yz=U.object({file_path:D$,doc_key:U.string().nullable(),distance:U.number().int().positive(),link_kind:U.string(),via_path:D$}).openapi("CorpusImpactRadiusItem"),xm=U.object({snapshot_id:U.string(),review_id:U.string(),file_path:D$,impacted_files:U.array(yz),request_id:U.string()}).openapi("CorpusImpactResponse"),lm=U.object({target_file:D$,anchor:U.string().nullable(),block_id:U.string(),plaintext:U.string(),html:U.string(),request_id:U.string()}).openapi("CorpusLinkPreviewResponse"),mz=U.object({file_path:D$,doc_key:U.string().nullable(),violation_type:U.enum(["unknown_doc_type","missing_required_field","invalid_field_type","unknown_tag","unknown_category","invalid_locale"]),field:U.string(),expected:U.string(),actual:U.string(),message:U.string()}).openapi("CorpusTaxonomyViolation"),rz=U.object({file_path:D$,doc_key:U.string().min(1).optional(),doc_type:U.string().min(1).optional(),title:U.string().optional(),source_content_sha256:U.string().regex(/^[0-9a-f]{64}$/),frontmatter:U.object({raw:U.record(U.string(),U.unknown()).nullable(),normalized:U.record(U.string(),U.unknown()).nullable()}).optional(),taxonomy_violations:U.array(mz).optional()}).openapi("CorpusSnapshotArtifactDoc"),oz=U.object({source_file_path:D$,target_file_path:D$.optional(),target_url:U.string().url().optional(),edge_type:U.enum(["link","image","include","xref"]),resolved:U.boolean()}).refine(($)=>$.target_file_path!==void 0!==($.target_url!==void 0),{message:"exactly one of target_file_path or target_url must be present"}).openapi("CorpusSnapshotArtifactEdge"),hm=U.object({schema_version:U.literal("corpus_snapshot.v1"),snapshot_id:U.string(),source_type:YW,repo_id:cv.optional(),git_sha:Hv.optional(),project_id:U.string().optional(),upload_batch_id:U.string().optional(),scope:U.object({include_globs:U.array(U.string().min(1)).min(1),exclude_globs:U.array(U.string().min(1)).optional()}),status:U.literal("ready"),docs:U.array(rz),edges:U.array(oz),indexer_version:U.string(),config_hash:U.string(),created_at:U.string().datetime(),completed_at:U.string().datetime()}).openapi("CorpusSnapshotArtifact");var mm=U.object({content_ref:Gw.openapi({description:"Reference to the content to review"}),participants:U.array(U.object({email:U.string().email(),name:U.string().optional(),role:U.enum(["reviewer","operator","observer"]).default("reviewer")})).optional().openapi({description:"Optional list of participants to invite"}),options:U.object({block_id_scheme:U.literal("v1").default("v1").optional(),render_profile:U.string().optional()}).optional(),operator_name:U.string().max(200).optional().openapi({description:"Name of the operator initiating the review"}),focus_areas:U.array(U.string().max(100)).max(10).optional().openapi({description:"Areas the reviewer should focus on"}),framing:U.string().max(1000).optional().openapi({description:"Context framing text shown to reviewers"}),carry_forward_threads:U.boolean().optional().openapi({description:"Whether to carry forward threads from the superseded session"}),carry_forward_filter:U.enum(["all","blocking","needs_changes"]).optional().openapi({description:"Filter for which threads to carry forward"})}).openapi("CreateSessionRequest"),tz=U.object({thread_id:U.string().openapi({description:"Thread ID to resolve"}),disposition:U.enum(["fixed","wont_fix","duplicate","by_design"]).openapi({description:"Resolution disposition"}),evidence:U.string().max(2000).optional().openapi({description:"Optional evidence or explanation"})}).openapi("ThreadResolution"),rm=U.object({git_sha:U.string().optional().openapi({description:"Git commit SHA for the new revision"}),file_path:U.string().optional().openapi({description:"File path (defaults to predecessor's)"}),title:U.string().max(512).optional().openapi({description:"Title for the new session"}),changes_summary:U.string().max(5000).optional().openapi({description:"Summary of changes for round-transition emails"}),resolutions:U.array(tz).optional().openapi({description:"Resolution manifest for predecessor threads"}),auto_read_only_on_supersede:U.boolean().default(!0).optional().openapi({description:"Whether to mark predecessor as read-only (default: true)"})}).openapi("SupersedeSessionRequest"),dz=U.object({block_id:U.string(),block_id_scheme:U.literal("v1"),block_index:U.number().int().min(0),block_type:U.string(),block_key:U.string().nullable(),block_key_source:U.enum(["marker","sidecar","auto"]).nullable(),start_line:U.number().int().min(1),end_line:U.number().int().min(1),start_offset:U.number().int().min(0),end_offset:U.number().int().min(0)}).openapi("BlockSummary"),HW=U.object({id:U.string().openapi({description:"Unique session identifier",example:"ses_abc123"}),created_at:U.string().datetime().openapi({description:"ISO 8601 timestamp of session creation"}),state:U.enum(["draft","created","active","closed","expired","superseded","archived","deleted"]).openapi({description:"Current session lifecycle state"}),content_ref:Gw,source_content_sha256:U.string().regex(/^[a-f0-9]{64}$/).openapi({description:"SHA-256 hash of canonical source content"}),block_count:U.number().int().min(0).openapi({description:"Number of blocks in the session"}),thread_count:U.number().int().min(0).openapi({description:"Total number of threads in the session"}),open_thread_count:U.number().int().min(0).openapi({description:"Number of open (unresolved) threads"})}).openapi("Session"),om=HW.extend({blocks:U.array(dz).optional().openapi({description:"Block summaries (included on creation)"})}).openapi("CreateSessionResponse"),tm=U.object({session_id:U.string().openapi({description:"Session identifier",example:"ses_abc123"})}),dm=HW.openapi("GetSessionResponse"),pm=BQ.openapi("GetSessionBlocksQueryParams"),pz=U.object({block_id:U.string(),block_key:U.string().nullable(),block_key_source:U.enum(["marker","sidecar","auto"]).nullable(),block_index:U.number().int().min(0),block_type:U.string(),start_line:U.number().int().min(1),end_line:U.number().int().min(1),start_offset:U.number().int().min(0),end_offset:U.number().int().min(0)}).openapi("SessionBlockListItem"),em=U.object({session_id:U.string(),block_id_scheme:U.literal("v1"),block_key_scheme:U.literal("v1"),total_blocks:U.number().int().min(0),blocks:U.array(pz),next_cursor:U.string().nullable(),has_more:U.boolean(),request_id:U.string()}).openapi("GetSessionBlocksResponse"),ez=U.object({block_id:U.string(),block_key:U.string().nullable().optional(),block_key_source:U.string().nullable().optional(),block_index:U.number().int(),block_type:U.string(),properties:U.record(U.string(),U.unknown()).nullable().optional(),html:U.string().openapi({description:"Rendered HTML for this block"}),start_line:U.number().int(),end_line:U.number().int(),start_offset:U.number().int().optional(),end_offset:U.number().int().optional()}).openapi("RenderBlock"),am=U.object({session_id:U.string(),source_content_sha256:U.string(),blocks:U.array(ez),render_profile:U.string().nullable(),etag:U.string().openapi({description:"ETag for cache validation"})}).openapi("GetSessionRenderResponse"),az=U.object({block_id:U.string(),thread_count:U.number().int().min(0),open_thread_count:U.number().int().min(0),has_unread:U.boolean().optional(),severity_max:U.enum(["suggestion","needs_changes","blocking"]).nullable()}).openapi("BlockAnnotation"),sm=U.object({session_id:U.string(),blocks:U.array(az),updated_at:U.string().datetime()}).openapi("GetSessionAnnotationsResponse");var _r=U.object({token:U.string().openapi({description:"URL token from magic link",example:"tok_abc123xyz..."})}).openapi("ExchangeTokenRequest"),wr=U.object({access_token:U.string().openapi({description:"Short-lived access token for API requests"}),token_type:U.literal("Bearer"),expires_in:U.number().int().openapi({description:"Token lifetime in seconds",example:3600}),refresh_grant:U.boolean().optional().openapi({description:"Whether a refresh cookie was set"})}).openapi("ExchangeTokenResponse"),gr=U.object({access_token:U.string(),token_type:U.literal("Bearer"),expires_in:U.number().int()}).openapi("RefreshTokenResponse"),br=U.object({email:U.string().email().openapi({description:"Email address to send OTP to"})}).openapi("SendOtpRequest"),Ur=U.object({code:U.string().length(6).regex(/^\d{6}$/).openapi({description:"6-digit OTP code",example:"123456"})}).openapi("VerifyOtpRequest"),Jr=U.object({access_token:U.string().openapi({description:"Access token with elevated verification tier"}),token_type:U.literal("Bearer"),expires_in:U.number().int(),verification_tier:U.enum(["step_up"]).openapi({description:"Verification tier achieved"})}).openapi("VerifyOtpResponse");var sz=["full","redacted","pseudonymous","block_window.v1","unresolved.v1","response_matrix.v1","delta_review.v1","corpus_context.v1"],$S=["repair_kit.v1"],vS={block_window:"block_window.v1",unresolved:"unresolved.v1",response_matrix:"response_matrix.v1",repair_kit:"repair_kit.v1",delta_review:"delta_review.v1",corpus_context:"corpus_context.v1"};function _S($){if(sz.includes($))return $;if($S.includes($))return $;let v=vS[$];if(v)return v;throw Error(`Unknown export view: ${$}`)}var wS=U.enum(["full","redacted","pseudonymous","block_window","block_window.v1","unresolved","unresolved.v1","response_matrix","response_matrix.v1","repair_kit","repair_kit.v1","delta_review","delta_review.v1","corpus_context","corpus_context.v1"]),gS=U.enum(["json","llm_prompt","llm_prompt.v1"]),Yr=U.object({schema:U.literal("v2").default("v2"),view:wS.default("full"),format:gS.default("json"),allow_partial:U.boolean().default(!1),anchors:U.string().optional(),window_before:U.coerce.number().int().min(0).default(2),window_after:U.coerce.number().int().min(0).default(2),severity:U.string().optional(),tags:U.string().optional(),assignee:U.string().optional(),signed:U.boolean().optional(),include_derived_keys:U.boolean().optional()}).superRefine(($,v)=>{if(_S($.view)==="block_window.v1"){if(!$.anchors||$.anchors.trim().length===0)v.addIssue({code:U.ZodIssueCode.custom,path:["anchors"],message:"anchors is required when view=block_window.v1"})}}),bS=U.object({block_id:U.string(),block_id_scheme:U.literal("v1"),block_index:U.number().int().min(0),block_type:U.string(),block_key:U.string().nullable(),block_key_source:U.enum(["marker","sidecar","auto"]).nullable(),start_line:U.number().int().min(1),end_line:U.number().int().min(1),start_offset:U.number().int().min(0),end_offset:U.number().int().min(0),plaintext_sha256:U.string().regex(/^[a-f0-9]{64}$/).nullable()}).openapi("ExportBlock"),US=U.object({id:U.string(),author_email:U.string().email().nullable().optional(),author_name:U.string().nullable(),author_source:U.string().nullable().optional(),body_md:U.string(),created_at:U.string().datetime(),updated_at:U.string().datetime().nullable(),version:U.number().int().min(1)}).openapi("ExportComment"),JS=U.object({id:U.string(),anchor:yv,block_id:U.string().nullable().optional(),status:U.enum(["open","resolved"]),severity:U.enum(["suggestion","needs_changes","blocking"]),created_at:U.string().datetime(),updated_at:U.string().datetime().nullable().optional(),finding_id:U.string().nullable().optional(),rule_id:U.string().nullable().optional(),rule_fingerprint:U.string().nullable().optional(),check_run_id:U.string().nullable().optional(),rule_ref:e0.optional(),comments:U.array(US)}).openapi("ExportThread"),DS=U.object({open_threads:U.number().int().nonnegative(),resolved_threads:U.number().int().nonnegative(),blocking_threads:U.number().int().nonnegative()}).openapi("ExportIssuePerAnchorStatus"),XS=U.object({anchor_id:U.string(),block_id:U.string().nullable(),anchor_type:U.enum(["session","block","range"]),linked_thread_ids:U.array(U.string()),per_anchor_status:DS}).openapi("ExportIssueAnchor"),GS=U.object({issue_id:U.string(),title:U.string(),status:U.string(),severity:U.string().nullable(),tags:U.array(U.string()),anchor_count:U.number().int().nonnegative(),thread_count:U.number().int().nonnegative(),anchors_in_this_session:U.array(XS)}).openapi("ExportIssue"),YS=U.object({disposition_id:U.string(),thread_id:U.string(),state:U.string(),rationale_md:U.string().nullable(),reason_code:U.string().nullable(),waiver_expires_at:U.string().datetime().nullable(),decided_by_participant_id:U.string().nullable(),decided_by_user_id:U.string().nullable(),decided_by_verification_level:U.string().nullable(),decided_by_display:U.string(),decided_at:U.string().datetime(),provenance_json:U.record(U.string(),U.unknown()).nullable(),created_at:U.string().datetime()}).openapi("ExportDisposition"),QS=U.object({evidence_id:U.string(),thread_id:U.string(),evidence_type:U.string(),evidence_json:U.record(U.string(),U.unknown()),verification_status:U.string(),verification_tier:U.number().int().nullable(),verified_at:U.string().datetime().nullable(),verifier_version:U.string().nullable(),dedupe_key:U.string().nullable(),created_by_participant_id:U.string().nullable(),created_by_user_id:U.string().nullable(),created_by_verification_level:U.string().nullable(),created_by_display:U.string(),created_at:U.string().datetime()}).openapi("ExportEvidence"),WS=U.string().regex(/^[a-z][a-z0-9_.-]*$/),HS=U.string().regex(/^[a-z][a-z0-9_.-]*\.v[0-9]+$/),nS=U.object({schema_version:HS,authoritative:U.boolean()}).passthrough().openapi("ExtensionEnvelope");var qS=U.object({canonicalization:U.string(),export_sha256:U.string().regex(/^[a-f0-9]{64}$/).nullable(),export_full_sha256:U.string().regex(/^[a-f0-9]{64}$/).nullable().optional()}).passthrough().openapi("ExportIntegrity"),IS=U.object({section:U.enum(["threads","comments","approvals","proposed_changes","extensions"]),reason:U.enum(["db_timeout","permission_denied","section_disabled","internal_error"]),count_missing:U.number().int().min(0).optional()}).openapi("ExportIncompleteSection"),Qr=U.object({schema_version:U.literal("export.v1"),exported_at:U.string().datetime(),view_requested:U.string().nullable().optional(),view_resolved:U.string().optional(),integrity:qS,partial:U.boolean().optional(),incomplete_sections:U.array(IS).optional(),session:U.object({id:U.string(),created_at:U.string().datetime(),status:U.enum(["active","closed","archived"]),content_ref:Gw,source_content_sha256:U.string().regex(/^[a-f0-9]{64}$/),root_session_id:U.string().nullable().optional(),supersedes_session_id:U.string().nullable().optional()}),blocks:U.array(bS),threads:U.array(JS),issues:U.array(GS).default([]).openapi({description:"Issue summaries with per-anchor status for anchors in this session"}),dispositions:U.array(YS).default([]).openapi({description:"Thread disposition log entries exported for audit/compliance workflows"}),evidence:U.array(QS).default([]).openapi({description:"Thread evidence records exported for audit/compliance workflows"}),approvals:U.object({}).passthrough().optional().openapi({description:"Approval state summary (M0.5+)"}),extensions:U.record(WS,nS).optional().openapi({description:"Optional extension envelopes keyed by namespace (extensions.{namespace})"}),metadata:U.object({export_view:U.string().optional(),integrity_hash:U.string().optional()}).optional()}).openapi("ExportResponse");var BS=U.object({code:U.string(),details:U.record(U.string(),U.unknown()).optional(),thread_ids:U.array(U.string()).optional(),approval_ids:U.array(U.string()).optional()}).openapi("PolicyReason"),LS=U.object({supersedes_session_id:U.string(),blocks_added:U.number().int().min(0),blocks_removed:U.number().int().min(0),blocks_changed:U.number().int().min(0),blocks_unchanged:U.number().int().min(0),orphaned_threads_count:U.number().int().min(0)}).openapi("BriefingDeltaSummary"),VS=U.object({verdict:U.enum(["pass","fail","warn"]),reasons:U.array(BS)}).openapi("BriefingPolicyStatus"),jS=U.object({thread_id:U.string(),block_id:U.string().nullable(),severity:U.string(),snippet:U.string().max(120),source:U.enum(["human","system","automation"]),has_disposition:U.boolean()}).openapi("BriefingBlockerItem"),FS=U.object({items:U.array(jS),total:U.number().int().min(0)}).openapi("BriefingBlockers"),KS=U.object({decision:U.enum(["approved","rejected","conditional"]),decided_by:U.string(),decided_at:U.string().datetime(),pending_conditions:U.number().int().min(0)}).openapi("BriefingApprovalDecision"),OS=U.object({requested:U.boolean(),decisions:U.array(KS),pending_count:U.number().int().min(0)}).openapi("BriefingApprovalsSummary"),iS=U.object({last_run_id:U.string(),status:U.enum(["completed","running","failed"]),total_findings:U.number().int().min(0),gating_findings:U.number().int().min(0),informational_findings:U.number().int().min(0)}).openapi("BriefingChecksSummary"),kS=U.object({total:U.number().int().min(0),unresolved:U.number().int().min(0),blocking:U.number().int().min(0),system_findings:U.number().int().min(0),human:U.number().int().min(0)}).openapi("BriefingThreadsSummary"),nr=U.object({schema_version:U.literal("briefing.v1"),session_id:U.string(),content_ref:Gw,title:U.string().nullable(),created_at:U.string().datetime(),delta:LS.optional(),policy_status:VS,blockers:FS,approvals:OS,checks:iS.optional(),threads:kS,computed_at:U.string().datetime(),annotations_version:U.number().int().min(1)}).openapi("BriefingBundle");var NS=U.enum(["review","repo","tenant"]).openapi("SearchScope"),nW=U.enum(["fts","semantic"]).openapi({description:"`fts` is the canonical public search mode. `semantic` remains compatibility-only, non-authoritative retrieval and must not be treated as required launch behavior."}).openapi("SearchMode"),PS=U.enum(["review","block","finding","comment"]).openapi("SearchKind"),RU=U.enum(["open","resolved","draft"]).openapi("SearchStatus"),qW=U.enum(["suggestion","needs_changes","blocking"]).openapi("SearchSeverity"),Br=U.object({q:U.string().trim().min(1),scope:NS.default("tenant").optional(),mode:nW.default("fts").optional().openapi({description:"Canonical public search uses `fts`. `semantic` is compatibility-only and may be disabled per tenant."}),review_id:U.string().trim().min(1).optional(),repo_id:U.string().trim().min(1).max(256).optional(),project_id:U.string().trim().min(1).max(256).optional(),model:U.string().trim().min(1).max(128).optional().openapi({description:"Compatibility-only semantic-search model hint. Canonical FTS callers should omit this field."}),min_score:U.coerce.number().min(0).max(1).optional().openapi({description:"Compatibility-only semantic-search threshold. Canonical FTS callers should omit this field."}),kind:U.string().trim().min(1).optional().openapi({description:"Single kind or comma-separated kinds"}),status:RU.optional(),severity:qW.optional(),assignee:U.string().trim().min(1).optional(),tags:U.string().trim().min(1).optional().openapi({description:"Comma-separated tag list"}),from:U.string().datetime().optional(),to:U.string().datetime().optional(),filters:U.string().trim().min(1).optional().openapi({description:"JSON-encoded or key=value,key=value filter expression"}),cursor:U.string().min(1).optional(),limit:U.coerce.number().int().min(1).max(100).optional()}).strict().openapi("SearchQueryParams"),fS=U.discriminatedUnion("type",[U.object({type:U.literal("review")}).strict(),U.object({type:U.literal("block"),block_id:BU}).strict()]).openapi("SearchAnchor"),AS=U.object({schema_version:U.literal("anchor_ref.v1"),source_type:U.enum(["git","upload"]),repo_id:U.string().nullable(),git_sha:U.string().nullable(),project_id:U.string().nullable(),upload_batch_id:U.string().nullable(),file_path:U.string().min(1),doc_key:U.string().nullable(),anchor:fS}).strict().openapi("SearchTarget"),MS=U.object({kind:PS,score:U.number(),entity_id:U.string().min(1),review_id:U.string().min(1),target:AS,snippet:U.string(),finding:U.object({finding_id:U.string().min(1),status:RU,severity:qW.nullable(),assignee:U.string().nullable(),updated_at:U.string().datetime().nullable()}).strict().nullable().optional(),highlight_ranges:U.array(U.object({start:U.number().int().nonnegative(),end:U.number().int().positive()}).strict()),non_authoritative:U.literal(!0).optional(),provenance:U.object({model_id:U.string().min(1),model_version:U.string().min(1),similarity_score:U.number().min(0).max(1)}).strict().openapi({description:"Compatibility-only semantic-search provenance for non-authoritative results."}).optional()}).strict().openapi("SearchResult"),Lr=U.object({results:U.array(MS),total_count:U.number().int().nonnegative(),cursor:U.string().nullable(),has_more:U.boolean(),metadata:U.object({search_mode:nW,model_id:U.string().min(1).optional(),model_version:U.string().min(1).optional()}).strict().openapi({description:"Canonical metadata reports `fts`. Semantic metadata fields are compatibility-only."}).optional(),request_id:U.string()}).strict().openapi("SearchResponse");var zS=["properties","applicability"],IW=["ts_"],SS="^[a-z][a-z0-9_]{0,63}$",uS=U.object({key:U.string(),targets:U.array(U.enum(zS)).min(1),value_format:U.enum(["slug","string"]),description:U.string(),examples:U.array(U.string()).min(1)}).openapi("PropertyVocabularyEntry"),Fr=U.object({naming:U.object({case:U.literal("snake_case"),key_pattern:U.string(),max_key_length:U.number().int().positive()}).openapi("PropertyVocabularyNaming"),reserved:U.object({canonical_keys:U.array(U.string()),internal_prefixes:U.array(U.string())}).openapi("PropertyVocabularyReserved"),tenant_extensions:U.object({allowed:U.boolean(),forbidden_prefixes:U.array(U.string()),discoverable:U.boolean(),notes:U.string()}).openapi("PropertyVocabularyTenantExtensions"),canonical_keys:U.array(uS)}).openapi("PropertyVocabulary"),Kr={naming:{case:"snake_case",key_pattern:SS,max_key_length:64},reserved:{canonical_keys:["client","content_type","source_kind","audience","market","surface"],internal_prefixes:[...IW]},tenant_extensions:{allowed:!0,forbidden_prefixes:[...IW],discoverable:!1,notes:"Tenant-defined keys are allowed but remain out-of-band until custom property-schema discovery lands."},canonical_keys:[{key:"client",targets:["properties","applicability"],value_format:"slug",description:"Brand, customer, product line, or account identifier used to scope rules and reviews.",examples:["acme","globex","internal_docs"]},{key:"content_type",targets:["properties","applicability"],value_format:"slug",description:"The kind of material under review, expressed as a stable slug rather than free-form prose.",examples:["landing_page","blog_post","ad_copy"]},{key:"source_kind",targets:["properties","applicability"],value_format:"slug",description:"The intake/source family for the reviewable artifact or the rule targeting it.",examples:["git","upload","paste"]},{key:"audience",targets:["properties","applicability"],value_format:"slug",description:"Intended reader or stakeholder audience segment for the reviewed content.",examples:["external","internal","partner"]},{key:"market",targets:["properties","applicability"],value_format:"slug",description:"Geographic, regulatory, or commercial market segment affected by the content or rule.",examples:["us","de","healthcare"]},{key:"surface",targets:["properties","applicability"],value_format:"slug",description:"Delivery surface or channel used for migration from legacy workstream language.",examples:["website","email","reddit"]}]};var yG=/^[A-Za-z0-9+/]*={0,2}$/,CU="local";function $1($){if(typeof $!=="object"||$===null||Array.isArray($))return null;return $}function TS($,v,w){let g=$1($);if(!g)return v;let _=g.ok===!0&&"result"in g,b=_?$1(g.result):g,J=b!==null?{...b}:{result:_?g.result:$};J.ok=!0,J.request_id=v.request_id;let D=_&&Array.isArray(g.warnings)?g.warnings:v.warnings;if(D!==void 0)J.warnings=D;let X=(_?$1(g.pagination):null)??v.pagination;if(X!==void 0)J.pagination=X;let G=(_?$1(g.advisory):null)??v.advisory;if(G!==void 0)J.advisory=G;let Y=w?.retry??(_?$1(g.retry):null);if(Y!==null&&Y!==void 0)J.retry=Y;else if(v.retry!==void 0)J.retry=v.retry;return J}function i($,v,w){let g=kQ($,v,w),_=TS($,g,w);return{content:[{type:"text",text:JSON.stringify(_,null,2)}]}}function O($,v){let w=$.status===0||$.status>=500||$.status===429,g=NQ({requestId:$.requestId,error:{code:$.code,message:$.message,retryable:w,details:$.details,fix_hint:$.fixHint},retry:v?.operation?iQ({operation:v.operation,hasIdempotencyKey:v.hasIdempotencyKey,retryable:w,statusCode:$.status,errorCode:$.code}):{retry_classification:w?"transient":"manual"}});return{content:[{type:"text",text:JSON.stringify(g,null,2)}],isError:!0}}function B$($,v,w,g){return new L($,v,w,g?.requestId??CU,g?.details,g?.fixHint)}function VW($,v){if($ instanceof L)return $;let w=v?.message??($ instanceof Error?$.message:String($));return B$(v?.status??500,v?.code??"internal_error",w,v)}function M$($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("Expected object payload from upstream API");let v=$,w=v.data;if(w&&typeof w==="object"&&!Array.isArray(w))return w;return v}var jW=1e7;function BW($){if(typeof $==="string"){let _=$.trim();return _.length>0?_:null}if(!$||typeof $!=="object"||Array.isArray($))return null;let v=$,w=v.base64??v.content_base64??v.content??v.data??v.bytes;if(typeof w!=="string")return null;let g=w.trim();return g.length>0?g:null}function LW($){if(typeof $==="string"){let g=$.trim();return g.length>0?g:null}if(!$||typeof $!=="object"||Array.isArray($))return null;let v=$,w=v.path??v.file_path??v.filename??v.file_name??v.name;if(typeof w==="string"&&w.trim().length>0)return w.trim();return null}function FW($){if($===void 0||$===null)return{assets:{}};let v={};if(Array.isArray($)){for(let[g,_]of $.entries()){let b=LW(_),J=BW(_);if(!b||!J)return{error:new L(422,"invalid_argument",`inline_assets[${g}] requires both a path and base64 payload`,"local")};v[b]=J}return{assets:v}}if(typeof $!=="object")return{error:new L(422,"invalid_argument","inline_assets must be an object map or array","local")};let w=Object.entries($);for(let[g,_]of w){let b=_&&typeof _==="object"&&!Array.isArray(_)?LW(_):g,J=BW(_);if(!b||!J)return{error:new L(422,"invalid_argument",`inline_assets entry '${g}' requires base64 content`,"local")};v[b]=J}return{assets:v}}function KW($){if(!$||$.length===0)return"Asset path is empty";if($.includes("\x00"))return"Asset path contains NUL byte";let v=$.replace(/\\/g,"/");if(v.startsWith("/"))return"Asset path must be relative (no leading /)";if(v.includes(".."))return"Asset path must not contain '..'";return null}function mG($){let v=$.replace(/\s+/g,"");if(v.length===0)return new Uint8Array;if(v.length%4!==0||!yG.test(v))return null;let w=Buffer.from(v,"base64"),g=v.replace(/=+$/,""),_=w.toString("base64").replace(/=+$/,"");if(g!==_)return null;return Uint8Array.from(w)}function e($){return O(new L(400,"missing_param",`Missing required parameter: ${$}`,"local"))}function U$($,v){if(!$)return e(v);return null}var G$=jG({operation:"read"});function O$($){return jG({operation:"write",hasIdempotencyKey:$})}function c($,v){return async(w)=>{try{return await $(w)}catch(g){if(g instanceof L)return O(g,v);throw g}}}var RS=await Promise.resolve().then(() => sG(mU(),1)),OW=RS.version,CS={Server:WG,StdioServerTransport:nG,CallToolRequestSchema:XG,ListToolsRequestSchema:DG};function EU($){return{content:$.content.map((v)=>({type:v.type,text:v.text})),...$.isError===void 0?{}:{isError:$.isError}}}async function iW($,v=CS){let w=new v.Server({name:"typescape",version:OW},{capabilities:{tools:{}}});w.setRequestHandler(v.ListToolsRequestSchema,async()=>{return{tools:$.getTools().map((b)=>({name:b.name,description:b.description,inputSchema:b.inputSchema}))}}),w.setRequestHandler(v.CallToolRequestSchema,async(_)=>{let{name:b,arguments:J}=_.params,D=$.getHandler(b);if(!D)return EU(O(B$(404,"not_found",`Unknown tool: ${b}`,{details:{tool:b},fixHint:"Use tools/list to inspect the registered Typescape tools."})));try{if(J===void 0)return EU(O(B$(400,"invalid_request",`Missing arguments payload for tool: ${b}`,{details:{tool:b},fixHint:"Provide an arguments object for the tool call, even if it is empty."})));let X=await D(J);return EU(X)}catch(X){return EU(O(VW(X)))}});let g=new v.StdioServerTransport;await w.connect(g),process.stderr.write(`Typescape MCP server v${OW} started
181
- `)}var ES=300000;function kW($){let v=null;return{async getCapabilities(){let w=Date.now();if(v&&w-v.fetchedAt<ES)return v.features;try{let g=await $.get("/me/capabilities");if(!g.body.features||typeof g.body.features!=="object")throw Error("Capabilities response missing features object");return v={features:g.body.features,fetchedAt:w},v.features}catch(g){if(g instanceof L)throw g;throw g}},featureDisabledResult(w){return O(B$(403,"feature_disabled",`Feature '${w}' is not enabled on this server`,{details:{feature:w}}))}}}var ZS=RU.options.filter(($)=>$!=="draft"),NW={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier (short slug, e.g. 'typescape'; not a GitHub path like 'org/repo')"},git_sha:{type:"string",description:"Concrete 40-hex Git commit SHA (agent must resolve; no symbolic refs)"},file_path:{type:"string",description:"Path to the source document (required)"},filename:{type:"string",description:'PDF filename when document_type is "pdf" (optional; defaults to the file_path basename)'},project_id:{type:"string",description:"Upload project ID for upload-backed reviews (requires upload_batch_id)"},upload_batch_id:{type:"string",description:"Upload batch ID for upload-backed reviews (requires project_id)"},title:{type:"string",description:"Review title (optional)"},participants:{type:"array",items:{type:"object",properties:{email:{type:"string"},name:{type:"string"},role:{type:"string",enum:["reviewer","approver","observer","owner"]},scopes:{type:"array",minItems:1,items:{type:"string",enum:["read","comment","approve","admin"]}}},required:["email","role"]},description:"Participants to invite (optional). Scopes are optional and default by role."},reviewer_emails:{type:"array",items:{type:"string"},description:"Legacy alias for participants. Each email is invited as a reviewer."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (If-Match header, optional)"},identity_restriction:{type:"string",enum:["open","participants_only","domain"],description:'Identity verification mode for OTP step-up. "open" (default) accepts any email. "participants_only": only invited participant emails. "domain": only emails from allowed_email_domains.'},allowed_email_domains:{type:"array",items:{type:"string"},description:'Allowed email domains when identity_restriction is "domain" (e.g., ["acme.com", "example.org"])'},operator_name:{type:"string",maxLength:200,description:"Name of the operator initiating the review (optional)"},focus_areas:{type:"array",items:{type:"string",maxLength:100},maxItems:10,description:"Areas the reviewer should focus on (optional)"},framing:{type:"string",maxLength:1000,description:"Context framing text shown to reviewers (optional)"},carry_forward_findings:{type:"boolean",description:"Whether to carry forward findings from the superseded review (optional)"},carry_forward_filter:{type:"string",enum:["all","blocking","needs_changes"],description:"Filter for which findings to carry forward (optional)"},content_body:{type:"string",maxLength:1048576,description:"Inline Markdown content (alternative to repo_id+git_sha). Creates an upload-backed review automatically."},inline_assets:{oneOf:[{type:"object",additionalProperties:{oneOf:[{type:"string"},{type:"object",properties:{base64:{type:"string"},content_base64:{type:"string"},content:{type:"string"},data:{type:"string"}},additionalProperties:!0}]}},{type:"array",items:{type:"object",properties:{path:{type:"string"},file_path:{type:"string"},filename:{type:"string"},file_name:{type:"string"},name:{type:"string"},base64:{type:"string"},content_base64:{type:"string"},content:{type:"string"},data:{type:"string"}},additionalProperties:!0}}],description:'Companion assets as either a map of relative path => base64 content, or a list of asset objects. Map example: { "images/fig.png": "iVBORw0KGgo..." }. Array example: [{ "path": "images/fig.png", "base64": "iVBORw0KGgo..." }]. Total decoded size must be <= 10MB.'},document_type:{type:"string",enum:["markdown","image_set","pdf"],description:'Document type (default: "markdown"). Use "image_set" for image-only reviews or "pdf" for PDF reviews.'},asset_resolution_mode:{type:"string",enum:["strict","warn"],description:'Asset resolution mode (default: "strict"). Use "warn" to create upload-backed reviews even if some referenced assets are missing.'},filenames:{type:"array",items:{type:"string"},minItems:1,maxItems:100,description:'Ordered list of image filenames (required when document_type is "image_set"). Each filename must be a relative path. Supported formats: PNG, JPEG, WebP, GIF, SVG.'},purpose:{type:"string",enum:["review","rules"],description:'Review purpose (default: "review"). Use "rules" to create a rule review that feeds the rules governance pipeline.'},properties:{type:"object",additionalProperties:{type:"string"},description:"Content properties for rule matching (flat key-value map). Used when purpose=rules or for rule-aware content reviews."}},required:["file_path"]},PW={type:"object",properties:{review_id:{type:"string",description:"ID of the review to revise (the predecessor, e.g., rev_01HXYZ...)"},git_sha:{type:"string",description:"Concrete 40-hex Git commit SHA for the new revision (agent must resolve; no symbolic refs)"},content_body:{type:"string",description:"Inline Markdown content for upload-backed revised reviews (alternative to git_sha/upload_batch_id)"},project_id:{type:"string",description:"Upload project ID for upload-backed revised reviews (required with upload_batch_id)"},upload_batch_id:{type:"string",description:"Upload batch ID for upload-backed revised reviews (alternative to git_sha/content_body)"},file_path:{type:"string",description:"Path to the source document (optional; defaults to predecessor's file_path)"},document_type:{type:"string",enum:["markdown","image_set","pdf"],description:"Document type for revision (optional; defaults to predecessor document_type)"},filename:{type:"string",description:"PDF filename for document_type=pdf revisions (optional; defaults to file_path)"},filenames:{type:"array",items:{type:"string"},minItems:1,description:"Ordered image filenames for document_type=image_set revisions"},title:{type:"string",description:"Title for the new review (optional; defaults to predecessor's title)"},changes_summary:{type:"string",maxLength:5000,description:"Summary of changes for round-transition emails and the superseded banner (optional)"},resolutions:{type:"array",items:{type:"object",properties:{finding_id:{type:"string",description:"Finding ID from the predecessor review"},disposition:{type:"string",enum:["fixed","wont_fix","duplicate","by_design"],description:"How the finding was resolved"},evidence:{type:"string",maxLength:2000,description:"Optional evidence or explanation for the resolution"}},required:["finding_id","disposition"]},description:"Resolution manifest for findings from the predecessor review (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id"]},fW={type:"object",properties:{review_id:{type:"string",description:"Review ID to export (e.g., rev_01HXYZ...)"},schema:{type:"string",default:"v2",description:"Export schema version (default: v2). Explicit retired or unknown schema values fail with machine-readable API errors."},view:{type:"string",description:"Export view variant (optional). Values: redacted, response_matrix.v1, delta_review.v1"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (If-Match header, optional)"},include_rule_context:{type:"boolean",description:"Include rule context metadata in the export (rule_context block with compiled_hash, policy_snapshot_id, and source rule refs). Default: false."}},required:["review_id"]},AW={type:"object",properties:{review_id:{type:"string",description:"Review ID to fetch the handoff bundle for"},include_rules:{type:"boolean",description:"Whether to include rule context (default: true)"},include_lineage:{type:"boolean",description:"Whether to include lineage summaries (default: true)"},include_advisory:{type:"boolean",description:"Whether to include advisory artifacts (default: true)"},include_blocks:{type:"boolean",description:"Whether to include block slices (default: true)"},max_rules:{type:"number",description:"Maximum number of structured rules to inline"}},required:["review_id"]},MW={type:"object",properties:{repo_id:{type:"string",description:"Filter reviews by repository identifier (short slug, e.g. 'typescape'; optional)"},state:{type:"string",description:"Filter by review state: active, closed, archived (optional)"},file_paths:{type:"string",description:"Comma-separated list of file paths to filter by (optional)"},cursor:{type:"string",description:"Pagination cursor from previous response (optional)"},limit:{type:"number",description:"Maximum number of reviews to return (optional, default: 20)"},root_review_id:{type:"string",description:"Filter by supersede chain root review ID (optional, e.g., rev_...)"},supersedes_review_id:{type:"string",description:"Filter by immediate predecessor review ID (optional, e.g., rev_...)"},has_successor:{type:"boolean",description:"If true, return only reviews that have been superseded; if false, only chain heads (optional)"},q:{type:"string",description:"Search query for title/file path (alias: search, optional)."},search:{type:"string",description:"Alias for q. Search query text (optional)."}},required:[]},zW={type:"object",properties:{review_id:{type:"string",description:"Review ID to retrieve (e.g., rev_01HXYZ...)"}},required:["review_id"]},SW={type:"object",properties:{review_id:{type:"string",description:"Review ID to render (e.g., rev_01HXYZ...)"},include_plaintext:{type:"boolean",description:"Include plaintext representation alongside HTML (optional, default: false)"}},required:["review_id"]},uW={type:"object",properties:{review_id:{type:"string",description:"Review ID to list findings for (e.g., rev_01HXYZ...)"},block_id:{type:"string",description:"Filter findings by block_id anchor (optional)"},status:{type:"string",description:"Filter findings by status: open, resolved, all (optional, default: all)"},cursor:{type:"string",description:"Pagination cursor from previous response (optional)"},limit:{type:"number",description:"Maximum number of findings to return (optional, default: 50)"},q:{type:"string",description:"Search query across finding id, block id, and comment text (optional; alias: search)."},search:{type:"string",description:"Alias for q. Search query text (optional)."}},required:["review_id"]},rG={type:"object",properties:{review_id:{type:"string",description:"Review ID (e.g., rev_01HXYZ...)"}},required:["review_id"]},TW={type:"object",properties:{query:{type:"string",description:"Search query text for reviews (title/file path)."},limit:{type:"number",description:"Maximum reviews to return (optional, default: 20)."},cursor:{type:"string",description:"Pagination cursor from previous response (optional)."}},required:["query"]},RW={type:"object",properties:{review_id:{type:"string",description:"Review ID to search within."},query:{type:"string",description:"Search query text for findings/comments."},block_id:{type:"string",description:"Optional block filter."},status:{type:"string",enum:ZS,description:"Optional status filter: open | resolved."},limit:{type:"number",description:"Maximum findings to return (optional, default: 50)."},cursor:{type:"string",description:"Pagination cursor from previous response (optional)."}},required:["review_id","query"]};var CW=["typescape_create_review","typescape_revise_review","typescape_export_review","typescape_get_handoff","typescape_list_reviews","typescape_get_review","typescape_get_render","typescape_list_findings","typescape_search_reviews","typescape_search_findings","typescape_close_review","typescape_reopen_review"],xS="markdown",lS="open",hS="strict";function cS($){if($==="approver")return["read","comment","approve"];if($==="observer")return["read"];if($==="owner")return["read","comment","approve","admin"];return["read","comment"]}function yS($){return $.map((v)=>{let w=v.scopes&&v.scopes.length>0?[...new Set(v.scopes)]:cS(v.role);return{email:v.email,...v.name?{name:v.name}:{},role:v.role,scopes:w}})}function mS($,v){let w=[];if(Array.isArray($))w.push(...$);if(Array.isArray(v))for(let b of v){if(typeof b!=="string")continue;let J=b.trim();if(J.length===0)continue;w.push({email:J,role:"reviewer"})}let g=new Set,_=[];for(let b of w){if(!b||typeof b.email!=="string")continue;let J=b.email.trim();if(J.length===0)continue;let D=J.toLowerCase();if(g.has(D))continue;g.add(D),_.push({...b,email:J})}return _}function rS($){if(!Array.isArray($))return[];let v=new Set,w=[];for(let g of $){if(typeof g!=="string")continue;let _=g.trim().toLowerCase();if(_.length===0)continue;if(v.has(_))continue;v.add(_),w.push(_)}return w}function oS($){if(!$||typeof $!=="object"||Array.isArray($))return null;let v=$.id;return typeof v==="string"&&v.length>0?v:null}function tS($){if(!$||typeof $!=="object"||Array.isArray($))return null;let v=$;if(typeof v.id==="string"&&v.id.length>0)return v.id;let w=v.project;if(w&&typeof w==="object"&&!Array.isArray(w)&&typeof w.id==="string")return w.id;return null}function dS($){if(!$||typeof $!=="object"||Array.isArray($))return null;let v=$;if(typeof v.upload_batch_id==="string"&&v.upload_batch_id.length>0)return v.upload_batch_id;let w=v.upload;if(w&&typeof w==="object"&&!Array.isArray(w)&&typeof w.upload_batch_id==="string")return w.upload_batch_id;return null}function pS($){let v=FW($.inline_assets);if("error"in v)return v.error;let w=v.assets;if(!$.file_path)return new L(400,"missing_param","Missing required parameter: file_path","local");let g=typeof $.repo_id==="string"&&$.repo_id.length>0,_=typeof $.git_sha==="string"&&$.git_sha.length>0,b=typeof $.project_id==="string"&&$.project_id.length>0,J=typeof $.upload_batch_id==="string"&&$.upload_batch_id.length>0,D=g&&_,X=b&&J,G=!!$.content_body,Y=Object.keys(w).length>0;if(g&&!_||!g&&_)return new L(422,"invalid_argument","Both repo_id and git_sha are required for git-backed reviews","local");if(b&&!J||!b&&J)return new L(422,"invalid_argument","Both project_id and upload_batch_id are required for upload-backed reviews","local");if($.document_type!==void 0&&$.document_type!=="markdown"&&$.document_type!=="image_set"&&$.document_type!=="pdf")return new L(422,"invalid_argument",`Unsupported document_type: ${$.document_type}. Supported values: "markdown", "image_set", "pdf".`,"local");if($.asset_resolution_mode!==void 0&&$.asset_resolution_mode!=="strict"&&$.asset_resolution_mode!=="warn")return new L(422,"invalid_argument",`Unsupported asset_resolution_mode: ${$.asset_resolution_mode}. Supported values: "strict", "warn".`,"local");let Q=$.document_type??xS,H=$.identity_restriction??lS,I=$.asset_resolution_mode??hS,q=Q==="image_set",W=Q==="pdf";if(q){if(!Y&&!X)return new L(400,"image_set_empty","image_set reviews require inline_assets or upload-batch input (project_id + upload_batch_id)","local");if(X&&(!$.filenames||$.filenames.length===0))return new L(400,"missing_param",'document_type "image_set" with upload-batch mode requires filenames.',"local");let S=new Set([".png",".jpg",".jpeg",".webp",".gif",".svg"]);if(Y){for(let y of Object.keys(w)){let x=y.slice(y.lastIndexOf(".")).toLowerCase();if(!S.has(x))return new L(422,"unsupported_media_type",`Unsupported image format for image_set: ${y}. Supported extensions: ${[...S].join(", ")}`,"local")}if(Object.keys(w).length>100)return new L(422,"image_set_limit_exceeded",`Image set has ${Object.keys(w).length} images, exceeding the maximum of 100`,"local")}}if(W){if(D)return new L(422,"invalid_argument",'document_type "pdf" is only supported with upload-backed sources (inline_assets or project_id+upload_batch_id).',"local");if(G)return new L(422,"invalid_argument",'document_type "pdf" does not support content_body; provide inline_assets with one .pdf file.',"local");if(!Y&&!X)return new L(400,"missing_param",'document_type "pdf" requires either inline_assets with one .pdf file, or upload-batch input (project_id + upload_batch_id).',"local");if(Y&&X)return new L(422,"invalid_argument",'document_type "pdf" cannot mix inline_assets and upload-batch inputs.',"local");if(Y&&Object.keys(w).length!==1)return new L(422,"invalid_argument",'document_type "pdf" requires exactly one inline asset.',"local");if(Y){let[S]=Object.keys(w);if(!S)return new L(400,"missing_param",'document_type "pdf" requires inline_assets with exactly one .pdf file.',"local");if(S.slice(S.lastIndexOf(".")).toLowerCase()!==".pdf")return new L(422,"unsupported_media_type",`Unsupported PDF format: ${S}. Supported extension: .pdf`,"local");if($.file_path!==S)return new L(422,"invalid_argument",`For document_type "pdf", file_path must match inline_assets key: ${S}`,"local")}}let B=[D,G,X].filter(Boolean).length;if(!q&&!W&&B===0)return new L(400,"missing_param","Provide one source mode: (repo_id + git_sha), (content_body), or (project_id + upload_batch_id)","local");if(B>1)return new L(422,"ambiguous_review_input","Cannot mix source modes: choose exactly one of git-backed, inline content_body, or upload-backed.","local");if(!q&&$.filenames&&$.filenames.length>0)return new L(422,"invalid_argument","filenames is only valid when document_type is image_set.","local");if(!W&&$.filename&&$.filename.trim().length>0)return new L(422,"invalid_argument",'filename is only valid when document_type is "pdf".',"local");if(H==="domain"&&(!$.allowed_email_domains||$.allowed_email_domains.length===0))return new L(422,"invalid_argument",'allowed_email_domains is required when identity_restriction is "domain"',"local");if(Object.keys(w).length>0){if(!G&&!q&&!W)return new L(422,"invalid_argument","inline_assets requires content_body (inline mode)","local");let S=0;for(let[y,x]of Object.entries(w)){let Y$=KW(y);if(Y$)return new L(422,"invalid_argument",`${Y$}: ${y}`,"local");let s$=mG(x);if(s$===null)return new L(422,"invalid_argument",`Invalid base64 content for asset: ${y}`,"local");S+=s$.byteLength}if(S>jW)return new L(413,"inline_payload_too_large",`Total decoded inline assets (${S} bytes) exceed 10MB limit. Use the Typescape CLI with upload batch for larger payloads.`,"local")}let j={file_path:$.file_path,document_type:Q,identity_restriction:H,asset_resolution_mode:I};if(D)j.repo_id=$.repo_id,j.git_sha=$.git_sha;if(X)j.project_id=$.project_id,j.upload_batch_id=$.upload_batch_id;if(G)j.content_body=$.content_body;if(Object.keys(w).length>0)j.inline_assets=w;let A=mS($.participants,$.reviewer_emails);if(A.length>0)j.participants=yS(A);if($.title!==void 0)j.title=$.title;if($.allowed_email_domains!==void 0&&$.allowed_email_domains.length>0)j.allowed_email_domains=$.allowed_email_domains;if($.operator_name!==void 0)j.operator_name=$.operator_name;if($.focus_areas!==void 0&&$.focus_areas.length>0)j.focus_areas=$.focus_areas;if($.framing!==void 0)j.framing=$.framing;if($.carry_forward_findings!==void 0)j.carry_forward_findings=$.carry_forward_findings;if($.carry_forward_filter!==void 0)j.carry_forward_filter=$.carry_forward_filter;if(W)j.filename=$.filename?.trim()||$.file_path.split("/").filter(Boolean).at(-1)||$.file_path;if(q)j.filenames=$.filenames&&$.filenames.length>0?$.filenames:Object.keys(w).sort();if($.purpose!==void 0)j.purpose=$.purpose;if($.properties!==void 0)j.properties=$.properties;let z={};if($.idempotency_key)z["Idempotency-Key"]=$.idempotency_key;if($.expected_version)z["If-Match"]=$.expected_version;let C=rS($.reviewer_emails),Z=W&&Y?(()=>{let S=Object.entries(w)[0];if(!S)return null;let[y,x]=S;return y&&x?{assetPath:y,base64Content:x}:null})():null;return{body:j,headers:z,reviewerEmails:C,pdfInlineFallback:Z}}async function eS($,v,w){let g=Array.isArray(w.invitations)?w.invitations:[];if(v.length===0||g.length>0)return g;let _=oS(w.review);if(!_)throw new L(500,"invalid_upstream_response","Review create response missing review.id; cannot invite reviewer_emails","local");let b=await $.post(`/reviews/${encodeURIComponent(_)}/participants`,{body:{participants:v.map((D)=>({email:D,role:"reviewer"}))}}),J=Array.isArray(b.body.invitations)?b.body.invitations:[];if(J.length>0)return J;throw new L(502,"invalid_upstream_response","Reviewer invitation follow-up returned no invitations",b.requestId)}async function EW($,v,w){return $.post("/reviews",{body:v,headers:w})}async function aS($,v){if(!v.pdfInlineFallback)throw new L(500,"invalid_local_state","PDF fallback requires exactly one inline asset","local");let w=mG(v.pdfInlineFallback.base64Content);if(w===null)throw new L(422,"invalid_argument",`Invalid base64 content for asset: ${v.pdfInlineFallback.assetPath}`,"local");let g=await $.post("/projects",{body:{name:`MCP Upload ${v.pdfInlineFallback.assetPath}`}}),_=tS(g.body);if(!_)throw new L(502,"invalid_upstream_response","Project create response missing project id",g.requestId);let b=new FormData;b.append(v.pdfInlineFallback.assetPath,new Blob([w],{type:"application/pdf"}),v.pdfInlineFallback.assetPath);let J=await $.postFormData(`/projects/${encodeURIComponent(_)}/upload`,b),D=dS(J.body);if(!D)throw new L(502,"invalid_upstream_response","Upload response missing upload_batch_id",J.requestId);let X={...v.body,project_id:_,upload_batch_id:D};return delete X.inline_assets,EW($,X,v.headers)}async function sS($,v){let w=(_)=>{let b=_.review??_.session??(typeof _.review_id==="string"&&_.review_id.length>0?{id:_.review_id}:null);if(!b)throw new L(502,"invalid_upstream_response","Review create response missing review/session payload","local");return{review:b,payload:{..._,review:b}}},g=async(_)=>{let b=w(_.body),J=await eS($,v.reviewerEmails,{review:b.review,invitations:_.body.invitations});return i({...b.payload,review:b.review,invitations:J},_.requestId)};try{let _=await EW($,v.body,v.headers);return await g(_)}catch(_){if(_ instanceof L&&v.pdfInlineFallback&&_.code==="feature_disabled"&&_.details?.feature==="inline_assets_enabled")try{let b=await aS($,v);return await g(b)}catch(b){if(b instanceof L)return O(b);throw b}if(_ instanceof L)return O(_);throw _}}function $u($){if(!$.review_id)return new L(400,"missing_param","Missing required parameter: review_id","local");let v=typeof $.git_sha==="string"&&$.git_sha.length>0,w=typeof $.content_body==="string"&&$.content_body.length>0,g=typeof $.upload_batch_id==="string"&&$.upload_batch_id.length>0,_=typeof $.project_id==="string"&&$.project_id.length>0;if(_&&!g||!_&&g)return new L(422,"invalid_argument","Both project_id and upload_batch_id are required for upload-backed revision","local");let b=[v,w,g].filter(Boolean).length;if(b===0)return new L(400,"missing_param","One of git_sha, content_body, or upload_batch_id is required","local");if(b>1)return new L(422,"invalid_argument","git_sha, content_body, and upload_batch_id are mutually exclusive","local");let J=v?$.git_sha:void 0;if(J&&!/^[a-f0-9]{40}$/i.test(J))return new L(400,"invalid_param",`Invalid git_sha format: must be a 40-character hex string, got "${$.git_sha}"`,"local");let D={};if(J)D.git_sha=J.toLowerCase();if(w)D.content_body=$.content_body;if(g)D.project_id=$.project_id,D.upload_batch_id=$.upload_batch_id;if($.file_path!==void 0)D.file_path=$.file_path;if($.document_type!==void 0)D.document_type=$.document_type;if($.filename!==void 0)D.filename=$.filename;else if($.document_type==="pdf"&&$.file_path!==void 0)D.filename=$.file_path;if($.filenames!==void 0&&$.filenames.length>0)D.filenames=$.filenames;if($.title!==void 0)D.title=$.title;if($.changes_summary!==void 0)D.changes_summary=$.changes_summary;if($.resolutions!==void 0&&$.resolutions.length>0)D.resolutions=$.resolutions;let X={};if($.idempotency_key)X["Idempotency-Key"]=$.idempotency_key;return{reviewId:$.review_id,body:D,headers:X}}async function vu($,v){try{let w=await $.post(`/reviews/${encodeURIComponent(v.reviewId)}/revise`,{body:v.body,headers:v.headers});return i(w.body,w.requestId)}catch(w){if(w instanceof L)return O(w);throw w}}function ZW($,v){let w=new Map;function g(q){let W=q.indexOf("#");if(W===-1)throw new L(500,"invalid_review_url","Review link URL is missing fragment token","local");return q.slice(W+1)}async function _(q){let W=w.get(q);if(W&&W.expiresAtMs>Date.now())return W.token;let B=await v.get(`/reviews/${q}/participants`,{query:{role:"reviewer"}}),j=B.body.items?.[0]?.participant_id;if(!j)j=(await v.get(`/reviews/${q}/participants`,{query:{limit:"1"}})).body.items?.[0]?.participant_id;if(!j)throw new L(422,"no_participants","No participants available to mint a render token",B.requestId);let A=await v.post(`/reviews/${q}/links`,{body:{participant_id:j,scope:"read",single_use:!0,url_token_ttl_minutes:60}}),z=A.body.url;if(!z||typeof z!=="string")throw new L(500,"invalid_link_response","Failed to mint review link for render",A.requestId);let C=await v.post("/auth/exchange",{body:{url_token:g(z)}}),Z=C.body.session_access_token,S=C.body.expires_in_seconds;if(!Z||typeof Z!=="string")throw new L(500,"token_exchange_failed","Failed to exchange review link for review access token",C.requestId);let y=typeof S==="number"&&Number.isFinite(S)?Math.max(0,Math.trunc(S)-30)*1000:300000;return w.set(q,{token:Z,expiresAtMs:Date.now()+y}),Z}let b={name:"typescape_create_review",description:"Create a new Typescape review for Markdown, image-set, or PDF content. Supports three source modes: (1) git-backed with repo_id+git_sha, (2) inline with content_body and optional inline_assets (base64), or (3) upload-backed with project_id+upload_batch_id. Returns the review ID and any invitations sent.",inputSchema:NW};$.register(b,async(q)=>{let W=pS(q);if(W instanceof L)return O(W);return sS(v,W)});let J={name:"typescape_revise_review",description:"Compatibility-only helper for product-owned revise flows. Preferred pattern: external agent revises content, then create a new Typescape review pinned to a newer revision, superseding an existing review. The predecessor becomes read-only and unresolved findings are carried forward to the new review. Supports git revision (git_sha) and upload revision (content_body or upload_batch_id+project_id). file_path must exactly match the original review's file_path (copy from the export's review.file_path field).",inputSchema:PW};$.register(J,async(q)=>{let W=$u(q);if(W instanceof L)return O(W);return vu(v,W)});let D={name:"typescape_export_review",description:"Export all feedback from a Typescape review as structured JSON (schema v2). Returns review metadata, blocks, findings, synthesis (severity summary), round_history, participants, and statistics. Optional params: schema (default 'v2'), view (e.g. 'response_matrix.v1', 'delta_review.v1'), include_rule_context (boolean).",inputSchema:fW};$.register(D,async(q)=>{let W=q;if(!W.review_id)return O(new L(400,"missing_param","Missing required parameter: review_id","local"));let j={schema:typeof W.schema==="string"&&W.schema.trim().length>0?W.schema.trim():"v2"};if(W.view)j.view=W.view;if(W.include_rule_context)j.include_rule_context="true";let A={};if(W.expected_version)A["If-Match"]=W.expected_version;try{let z=await v.get(`/reviews/${W.review_id}/export`,{query:j,headers:A});return i(z.body,z.requestId)}catch(z){if(z instanceof L)return O(z);throw z}});let X={name:"typescape_get_handoff",description:"Fetch the canonical agent handoff bundle for a Typescape review. Returns review state, findings, lineage, rules, artifacts, and next actions in one read-only package.",inputSchema:AW};$.register(X,async(q)=>{let W=q;if(!W.review_id)return O(new L(400,"missing_param","Missing required parameter: review_id","local"));let B={};if(typeof W.include_rules==="boolean")B.include_rules=W.include_rules?"true":"false";if(typeof W.include_lineage==="boolean")B.include_lineage=W.include_lineage?"true":"false";if(typeof W.include_advisory==="boolean")B.include_advisory=W.include_advisory?"true":"false";if(typeof W.include_blocks==="boolean")B.include_blocks=W.include_blocks?"true":"false";if(typeof W.max_rules==="number")B.max_rules=String(W.max_rules);try{let j=await v.get(`/reviews/${encodeURIComponent(W.review_id)}/handoff`,{query:B});return i(j.body,j.requestId)}catch(j){if(j instanceof L)return O(j);throw j}});let G={name:"typescape_list_reviews",description:"List Typescape reviews with optional filters. Returns paginated review summaries. Use cursor from previous response for pagination.",inputSchema:MW};$.register(G,async(q)=>{let W=q,B={};if(W.repo_id)B.repo_id=W.repo_id;if(W.state)B.state=W.state;if(W.file_paths)B.file_paths=W.file_paths;if(W.cursor)B.cursor=W.cursor;if(W.limit!==void 0)B.limit=String(W.limit);if(W.root_review_id)B.root_review_id=W.root_review_id;if(W.supersedes_review_id)B.supersedes_review_id=W.supersedes_review_id;if(W.has_successor!==void 0)B.has_successor=W.has_successor?"true":"false";let j=W.q??W.search;if(j)B.q=j;try{let A=await v.get("/reviews",{query:B});return i(A.body,A.requestId)}catch(A){if(A instanceof L)return O(A);throw A}});let Y={name:"typescape_get_review",description:"Get details of a specific Typescape review. Returns full review metadata including participants, stats, and provenance.",inputSchema:zW};$.register(Y,async(q)=>{let W=q;if(!W.review_id)return O(new L(400,"missing_param","Missing required parameter: review_id","local"));try{let B=await v.get(`/reviews/${encodeURIComponent(W.review_id)}`);return i(B.body,B.requestId)}catch(B){if(B instanceof L)return O(B);throw B}});let Q={name:"typescape_get_render",description:"Get the rendered content of a review. Returns immutable block-level HTML structure with block_ids for anchoring.",inputSchema:SW};$.register(Q,async(q)=>{let W=q;if(!W.review_id)return O(new L(400,"missing_param","Missing required parameter: review_id","local"));let B={};if(W.include_plaintext)B.include_plaintext="true";try{let j=await _(W.review_id),A=await v.get(`/reviews/${W.review_id}/render`,{query:B,headers:{Authorization:`Bearer ${j}`}});return i(A.body,A.requestId)}catch(j){if(j instanceof L)return O(j);throw j}});let H={name:"typescape_list_findings",description:"List findings (review comments) for a review in the same plain-language form the reviewer or agent wrote them. Optionally filter by block_id anchor or finding status. Returns paginated finding list with comments.",inputSchema:uW},I=async(q)=>{if(!q.review_id)return O(new L(400,"missing_param","Missing required parameter: review_id","local"));let W={};if(q.block_id)W.block_id=q.block_id;if(q.status)W.status=q.status;if(q.cursor)W.cursor=q.cursor;if(q.limit!==void 0)W.limit=String(q.limit);let B=q.q??q.search;if(B)W.q=B;try{let j=await v.get(`/reviews/${encodeURIComponent(q.review_id)}/findings`,{query:W});return i(j.body,j.requestId)}catch(j){if(j instanceof L)return O(j);throw j}};$.register(H,async(q)=>{return I(q)}),$.register({name:"typescape_search_reviews",description:"Search reviews by title/file path using server-side query matching.",inputSchema:TW},async(q)=>{let W=q,B=typeof W.query==="string"?W.query.trim():"";if(!B)return O(new L(400,"missing_param","Missing required parameter: query","local"));let j={q:B};if(W.limit!==void 0)j.limit=String(W.limit);if(W.cursor)j.cursor=W.cursor;try{let A=await v.get("/reviews",{query:j});return i(A.body,A.requestId)}catch(A){if(A instanceof L)return O(A);throw A}}),$.register({name:"typescape_search_findings",description:"Search findings/comments within a review using server-side query matching.",inputSchema:RW},async(q)=>{let W=q,B=typeof W.query==="string"?W.query.trim():"";if(!W.review_id)return O(new L(400,"missing_param","Missing required parameter: review_id","local"));if(!B)return O(new L(400,"missing_param","Missing required parameter: query","local"));return I({review_id:W.review_id,q:B,block_id:W.block_id,status:W.status,limit:W.limit,cursor:W.cursor})}),$.register({name:"typescape_close_review",description:"Close an active review, making it read-only for reviewers.",inputSchema:rG},async(q)=>{let W=q;if(!W.review_id)return O(new L(400,"missing_param","Missing required parameter: review_id","local"));try{let B=await v.post(`/reviews/${encodeURIComponent(W.review_id)}/close`,{body:{}});return i(B.body,B.requestId)}catch(B){if(B instanceof L)return O(B);throw B}}),$.register({name:"typescape_reopen_review",description:"Reopen a closed review and return it to active state.",inputSchema:rG},async(q)=>{let W=q;if(!W.review_id)return O(new L(400,"missing_param","Missing required parameter: review_id","local"));try{let B=await v.post(`/reviews/${encodeURIComponent(W.review_id)}/reopen`,{body:{}});return i(B.body,B.requestId)}catch(B){if(B instanceof L)return O(B);throw B}})}var xW={type:"object",properties:{review_id:{type:"string",description:"Review ID to export response matrix for (e.g., sess_01HXYZ...)"}},required:["review_id"]},lW={type:"object",properties:{review_id:{type:"string",description:"Review ID to attach the finding to (e.g., sess_01HXYZ...)"},body_md:{type:"string",description:"Plain-language finding body in Markdown. Say what is wrong, unclear, or missing."},body:{type:"string",description:"Compatibility alias for body_md."},block_id:{type:"string",description:"Block ID to anchor the finding to when feedback targets a specific passage (optional; omit for review-level)."},anchor:{type:"object",properties:{type:{type:"string",enum:["session","block","range"],description:"Anchor type (default: session if no block_id, block if block_id provided)"},block_id:{type:"string",description:"Block ID to anchor to (required when type is 'block')"},start_offset:{type:"number",description:"Start offset for range anchor"},end_offset:{type:"number",description:"End offset for range anchor"}},description:"Optional anchor details. Omit for review-level feedback or provide block/range details when you have them."},severity:{type:"string",enum:["suggestion","needs_changes","blocking"],description:"Optional severity hint. Omit unless the finding clearly blocks approval or needs explicit escalation. Note: 'blocking' from automation is coerced to 'needs_changes' per Ch 11 L6250."},tags:{type:"array",items:{type:"string"},description:"Optional machine tags for downstream automation. Most agent loops should omit this."},suggestion:{type:"object",properties:{type:{type:"string",enum:["replace","insert","delete"]}},description:"Optional structured edit payload when you want to carry an explicit replacement."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id","body_md"]},hW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to post comment to"},body_md:{type:"string",description:"Plain-language comment body in Markdown."},body:{type:"string",description:"Compatibility alias for body_md"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id","finding_id","body_md"]},cW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to resolve"},decision:{type:"object",properties:{state:{type:"string",enum:["accepted","rejected","deferred","duplicate","needs_more_info"],description:"Decision state"},rationale_md:{type:"string",description:"Rationale in Markdown (optional)"}},required:["state"],description:"Decision to record with resolution (optional)"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (thread ETag or integer version, optional)"},if_match:{type:"string",description:"Alias for expected_version (thread ETag or integer version, optional)"}},required:["review_id","finding_id"]},yW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to reopen"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (thread ETag or integer version, optional)"},if_match:{type:"string",description:"Alias for expected_version (thread ETag or integer version, optional)"}},required:["review_id","finding_id"]},mW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to record decision for"},state:{type:"string",enum:["undecided","accepted","rejected","deferred","duplicate","needs_more_info","dismissed","waived"],description:"Decision state"},rationale_md:{type:"string",description:"Rationale in Markdown (optional)"}},required:["review_id","finding_id","state"]},rW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to attach evidence to"},evidence_type:{type:"string",enum:["commit","proposed_change","pr","attestation","external_ticket","note"],description:"Evidence type (required). Determines which additional fields are relevant."},commit_sha:{type:"string",description:"Git commit SHA (for evidence_type=commit)"},repo_url:{type:"string",description:"Repository URL (for evidence_type=commit)"},message:{type:"string",description:"Commit message (for evidence_type=commit)"},proposed_change_id:{type:"string",description:"Proposed change ID (for evidence_type=proposed_change)"},patch_sha256:{type:"string",description:"Patch SHA256 (for evidence_type=proposed_change)"},pr_url:{type:"string",description:"PR URL (for evidence_type=pr)"},pr_number:{type:"number",description:"PR number (for evidence_type=pr)"},attestation_id:{type:"string",description:"Attestation ID (for evidence_type=attestation)"},attestor:{type:"string",description:"Attestor identity (optional, for attestation type)"},ticket_url:{type:"string",description:"Ticket URL (for evidence_type=external_ticket)"},ticket_id:{type:"string",description:"Ticket ID (for evidence_type=external_ticket)"},system:{type:"string",description:"Ticket system (for evidence_type=external_ticket)"},note_md:{type:"string",description:"Note text (for evidence_type=note)"},body_md:{type:"string",description:"Markdown evidence body (alias for note_md/text; useful for attestation/external_ticket notes)"},dedupe_key:{type:"string",description:"Optional idempotency/deduplication key for evidence attach"}},required:["review_id","finding_id","evidence_type"]},oW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding."},finding_id:{type:"string",description:"Finding ID to fetch latest decision for."}},required:["review_id","finding_id"]},tW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding."},finding_id:{type:"string",description:"Finding ID to list evidence for."},limit:{type:"number",description:"Maximum evidence entries to return (optional)."},cursor:{type:"string",description:"Pagination cursor from previous response (optional)."}},required:["review_id","finding_id"]};var dW=["typescape_export_response_matrix","typescape_create_finding","typescape_post_comment","typescape_resolve_finding","typescape_reopen_finding","typescape_record_decision","typescape_attach_evidence","typescape_get_decision","typescape_list_evidence"],_u="X-Typescape-If-Match";function pW($,v,w){if(!$)return;if(/^[1-9]\d*$/.test($)){v.expected_version=Number.parseInt($,10);return}w[_u]=$}async function wu($,v){let w=v,g=w.body_md??w.body,_=U$(w.review_id,"review_id");if(_)return _;let b=U$(g,"body_md");if(b)return b;let J={body_md:g,source:"automation"},D=typeof w.block_id==="string"?w.block_id.trim():void 0;if(D)J.block_id=D;if(w.anchor!==void 0)J.anchor=w.anchor;else if(D)J.anchor={type:"block"};if(w.severity!==void 0)J.severity=w.severity;if(w.tags!==void 0)J.tags=w.tags;if(w.suggestion!==void 0)J.suggestion=w.suggestion;let X={};if(w.idempotency_key)X["Idempotency-Key"]=w.idempotency_key;let G=await $.post(`/reviews/${encodeURIComponent(w.review_id)}/findings`,{body:J,headers:X});return i(G.body,G.requestId,{retry:O$(Boolean(w.idempotency_key))})}async function gu($,v){let w=v,g=w.body_md??w.body,_=U$(w.review_id,"review_id");if(_)return _;let b=U$(w.finding_id,"finding_id");if(b)return b;let J=U$(g,"body_md");if(J)return J;let D={};if(w.idempotency_key)D["Idempotency-Key"]=w.idempotency_key;let X=await $.post(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}/comments`,{body:{body_md:g,source:"automation"},headers:D});return i(X.body,X.requestId,{retry:O$(Boolean(w.idempotency_key))})}async function bu($,v){let w=v,g=U$(w.review_id,"review_id");if(g)return g;let _=U$(w.finding_id,"finding_id");if(_)return _;let b=w.decision===void 0?{status:"resolved"}:{disposition:w.decision},J={};pW(w.expected_version??w.if_match,b,J);let D=w.decision===void 0?await $.patch(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}`,{body:b,headers:J}):await $.post(`/reviews/${w.review_id}/threads/${w.finding_id}/resolve`,{body:b,headers:J});return i(D.body,D.requestId,{retry:O$(!1)})}async function Uu($,v){let w=v,g=U$(w.review_id,"review_id");if(g)return g;let _=U$(w.finding_id,"finding_id");if(_)return _;let b={},J={};pW(w.expected_version??w.if_match,b,J),b.status="open";let D=await $.patch(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}`,{body:b,headers:J});return i(D.body,D.requestId,{retry:O$(!1)})}async function Ju($,v){let w=v,g=U$(w.review_id,"review_id");if(g)return g;let _=U$(w.finding_id,"finding_id");if(_)return _;let b=U$(w.state,"state");if(b)return b;let J={state:w.state};if(w.rationale_md!==void 0)J.rationale_md=w.rationale_md;let D=await $.post(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}/decision`,{body:J});return i(D.body,D.requestId,{retry:O$(!1)})}function Du($){if($.evidence_type){let v={},w=["commit_sha","repo_url","message","proposed_change_id","patch_sha256","pr_url","pr_number","attestation_id","attestor","ticket_url","ticket_id","system","note_md","body_md"];for(let g of w)if($[g]!==void 0)v[g]=$[g];if($.body_md!==void 0)v.body=$.body_md,v.text=$.body_md;else if($.note_md!==void 0)v.body=$.note_md,v.text=$.note_md;return{evidenceType:$.evidence_type.trim(),evidenceJson:v}}if($.evidence){let v={...$.evidence},w=typeof $.evidence.type==="string"?$.evidence.type.trim():"";return delete v.type,{evidenceType:w,evidenceJson:v}}return e("evidence_type")}async function Xu($,v){let w=v,g=U$(w.review_id,"review_id");if(g)return g;let _=U$(w.finding_id,"finding_id");if(_)return _;let b=Du(w);if("content"in b)return b;let{evidenceType:J,evidenceJson:D}=b;if(!J)return O(new L(422,"invalid_argument","evidence_type is required","local"));let X={evidence_type:J,evidence_json:D};if(w.dedupe_key)X.dedupe_key=w.dedupe_key;let G=await $.post(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}/evidence`,{body:X});return i(G.body,G.requestId,{retry:O$(!1)})}async function Gu($,v){let w=v,g=U$(w.review_id,"review_id");if(g)return g;let _=U$(w.finding_id,"finding_id");if(_)return _;let b=await $.get(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}/decision`);return i(b.body,b.requestId,{retry:G$})}async function Yu($,v){let w=v,g=U$(w.review_id,"review_id");if(g)return g;let _=U$(w.finding_id,"finding_id");if(_)return _;let b={};if(w.limit!==void 0)b.limit=String(w.limit);if(w.cursor)b.cursor=w.cursor;let J=await $.get(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}/evidence`,{query:b});return i(J.body,J.requestId,{retry:G$})}function eW($,v){$.register({name:"typescape_export_response_matrix",description:"Export the response matrix for a review. Returns per-finding decision and evidence summary.",inputSchema:xW},c(async(w)=>{let g=w,_=U$(g.review_id,"review_id");if(_)return _;let b=await v.get(`/reviews/${g.review_id}/export`,{query:{view:"response_matrix.v1"}});return i(b.body,b.requestId,{retry:G$})},{operation:"read"})),$.register({name:"typescape_create_finding",description:"Create a new finding on a review. Use after the agent has read the content and formed its own judgment. Required: review_id and body_md (Markdown text). "+"Optional: severity (suggestion, needs_changes, or blocking — default suggestion), "+"anchor ({type: 'block', block_id: '...'} for block-level, omit for review-level), tags (string array). Agent-created findings are tagged source='automation'. Severity 'blocking' is coerced to 'needs_changes' for automation sources.",inputSchema:lW},c((w)=>wu(v,w),{operation:"write"})),$.register({name:"typescape_post_comment",description:"Post a comment (reply) to an existing finding. Returns the created comment with its ID.",inputSchema:hW},c((w)=>gu(v,w),{operation:"write"})),$.register({name:"typescape_resolve_finding",description:"Resolve (close) a finding. Optionally include a decision. Use expected_version or if_match for optimistic concurrency.",inputSchema:cW},c((w)=>bu(v,w),{operation:"write"})),$.register({name:"typescape_reopen_finding",description:"Reopen a previously resolved finding. Use expected_version or if_match for optimistic concurrency.",inputSchema:yW},c((w)=>Uu(v,w),{operation:"write"})),$.register({name:"typescape_record_decision",description:"Record a decision (decision) on a finding. Decisions track how feedback was addressed. Note: recording a resolving decision may automatically resolve the finding.",inputSchema:mW},c((w)=>Ju(v,w),{operation:"write"})),$.register({name:"typescape_attach_evidence",description:"Attach evidence to a finding. Evidence proves that feedback was addressed (e.g., commit SHA, proposed change, PR URL, or attestation).",inputSchema:rW},c((w)=>Xu(v,w),{operation:"write"})),$.register({name:"typescape_get_decision",description:"Get the latest decision for a specific finding.",inputSchema:oW},c((w)=>Gu(v,w),{operation:"read"})),$.register({name:"typescape_list_evidence",description:"List evidence entries attached to a finding.",inputSchema:tW},c((w)=>Yu(v,w),{operation:"read"}))}var ZU=["file","doc","pr","custom"],aW=new Set(ZU),sW={type:"object",properties:{source_type:{type:"string",enum:["git","upload"],description:"Source type for the review set"},title:{type:"string",description:"Review set title (optional)"},kind:{type:"string",enum:["review_set","release_bundle","packet"],description:"Kind of review set (optional, default: review_set)"},participants:{type:"array",items:{type:"object",properties:{email:{type:"string"},role:{type:"string",enum:["reviewer","approver"]},roles:{type:"array",items:{type:"string",enum:["reviewer","approver"]},minItems:1}},required:["email"]},description:"Participants to invite (optional). Supports role (single) or roles (array)."},reviews:{type:"array",items:{oneOf:[{type:"string"},{type:"object",properties:{review_id:{type:"string"},session_id:{type:"string"},required:{type:"boolean"}},anyOf:[{required:["review_id"]},{required:["session_id"]}],additionalProperties:!1}]},minItems:1,description:"Review IDs (or review entry objects) to include in this review set."},files:{type:"array",items:{type:"object",properties:{repo_id:{type:"string"},git_sha:{type:"string"},project_id:{type:"string"},upload_batch_id:{type:"string"},file_path:{type:"string"},required:{type:"boolean"}},required:["file_path"],additionalProperties:!1},minItems:1,description:"File entries for git or upload source types (must include file_path plus source identifiers)."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["source_type"]},$H={type:"object",properties:{review_set_id:{type:"string",description:"Review set ID to export"},schema:{type:"string",description:"Export schema version (optional, default: v2). Canonical first-party review-set export uses schema=v2."},view:{type:"string",description:"Export view variant (optional). Values: full, redacted, response_matrix.v1, etc."}},required:["review_set_id"]},vH={type:"object",properties:{limit:{type:"number",description:"Maximum number of review sets to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from a previous response"}}},_H={type:"object",properties:{review_set_id:{type:"string",description:"Review set ID to retrieve"}},required:["review_set_id"]},wH={type:"object",properties:{title:{type:"string",description:"Work item title"},kind:{type:"string",enum:KU,description:"Canonical work item kind"},reason_code:{type:"string",enum:iU,description:"Canonical reason code describing why the item exists"},audience_mode:{type:"string",enum:OU,description:"Queue routing mode for this work item"},blocking:{type:"boolean",description:"Whether the item is blocking"},priority:{type:"number",description:"Priority from 0-9"},target:{type:"object",properties:{target_type:{type:"string",description:"Canonical target type"},target_id:{type:"string",description:"Canonical target identifier"}},required:["target_type","target_id"],additionalProperties:!1},assignee_id:{type:"string",description:"Assignee user ID when audience_mode=assigned"},steward_group:{type:"string",description:"Optional steward group label"},due_at:{type:"string",description:"Optional ISO-8601 due timestamp"},metadata:{type:"object",description:"Optional metadata object",additionalProperties:!0},idempotency_key:{type:"string",description:"Optional idempotency key for safe retries"}},required:["title","kind","reason_code","audience_mode","target"],additionalProperties:!1},gH={type:"object",properties:{state:{type:"string",enum:fG,description:"Filter by work item state"},kind:{type:"string",enum:KU,description:"Filter by work item kind"},reason_code:{type:"string",enum:iU,description:"Filter by canonical reason code"},audience_mode:{type:"string",enum:OU,description:"Filter by audience mode"},queue_surface:{type:"string",enum:zG,description:"Filter by derived queue surface"},assignee_id:{type:"string",description:"Filter by assignee"},claimant_id:{type:"string",description:"Filter by claimant"},cursor:{type:"string",description:"Pagination cursor from a previous response"},limit:{type:"number",description:"Maximum number of work items to return (default: 25, max: 100)"}},additionalProperties:!1},bH={type:"object",properties:{work_item_id:{type:"string",description:"Work item ID to retrieve"}},required:["work_item_id"],additionalProperties:!1},UH={type:"object",properties:{work_item_id:{type:"string",description:"Work item ID to transition"},action:{type:"string",enum:SG,description:"Canonical transition action"},expected_version:{type:"number",description:"Optimistic concurrency version guard"},idempotency_key:{type:"string",description:"Optional idempotency key for safe retries"},blocking_reason:{type:"string",description:"Required when action=block"},cancellation_reason:{type:"string",description:"Required when action=cancel"},completion_outcome:{type:"string",enum:uG,description:"Required when action=complete"},comment:{type:"string",description:"Optional operator comment"}},required:["work_item_id","action"],additionalProperties:!1},JH={type:"object",properties:{source_type:{type:"string",enum:["git","upload"],description:"Source type for the review ref"},repo_id:{type:"string",description:"Repository identifier (required for git source_type; short slug, e.g. 'typescape')"},project_id:{type:"string",description:"Project identifier (required for upload source_type; omit for git)"},kind:{type:"string",enum:ZU,description:"Review ref kind"},key:{type:"string",description:"Review ref key (e.g., file path, doc slug, PR number, custom name)"},head_session_id:{type:"string",description:"Session ID to use as the initial head (required, e.g., sess_01HXYZ...)"}},required:["source_type","kind","key","head_session_id"]},DH={type:"object",properties:{review_ref_id:{type:"string",description:"Review ref ID to resolve"}},required:["review_ref_id"]},XH={type:"object",properties:{review_ref_id:{type:"string",description:"Review ref ID to advance"},head_session_id:{type:"string",description:"New head review ID to advance to"},expected_head_session_id:{type:"string",description:"Expected current head for optimistic concurrency (optional)"}},required:["review_ref_id","head_session_id"]},GH={type:"object",properties:{review_id:{type:"string",description:"Review ID to request approval for"},approver_emails:{type:"array",items:{type:"string"},description:"Email addresses of approvers"},message:{type:"string",description:"Message to include with the approval request (optional)"},notify:{type:"object",properties:{email:{type:"boolean"},slack:{type:"boolean"}},description:"Notification channels (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id","approver_emails"]},YH={type:"object",properties:{review_id:{type:"string",description:"Review ID to get status for"},simulate:{type:"boolean",description:"Run policy evaluation without side effects (optional)"},wait:{type:"number",description:"Long-poll timeout in seconds (optional)"}},required:["review_id"]},QH={type:"object",properties:{review_id:{type:"string",description:"Review ID to run deterministic product-owned checks against"}},required:["review_id"]},WH={type:"object",properties:{},additionalProperties:!1},HH={type:"object",properties:{},additionalProperties:!1},nH={type:"object",properties:{},additionalProperties:!1};var qH=["typescape_create_review_set","typescape_export_review_set","typescape_list_review_sets","typescape_get_review_set","typescape_create_work_item","typescape_list_work_items","typescape_get_work_item","typescape_transition_work_item","typescape_create_review_ref","typescape_resolve_review_ref","typescape_advance_review_ref","typescape_request_approval","typescape_get_status","typescape_run_checks","typescape_account_usage","typescape_account_plan","typescape_get_capabilities"];function Qu($){return $.replace(/\bSession\b/g,"Review").replace(/\bsession\b/g,"review").replace(/\bThread\b/g,"Finding").replace(/\bthread\b/g,"finding")}function oG($){if(Array.isArray($))return $.map((g)=>oG(g));if($===null||typeof $!=="object")return $;let v=new Map([["session_id","review_id"],["thread_id","finding_id"],["thread_ids","finding_ids"]]),w=Object.entries($).map(([g,_])=>{let b=v.get(g)??g,J=typeof _==="string"&&(g==="description"||g==="message")?Qu(_):oG(_);return[b,J]});return Object.fromEntries(w)}function v1($,v){let w=$[0];if(!w)return v;return`${w.path.length>0?`${w.path.map((_)=>String(_)).join(".")}: `:""}${w.message}`}function IH($,v,w){$.register({name:"typescape_create_review_set",description:"Create a new review set (multi-file review pack). Requires features.review_sets to be enabled.",inputSchema:sW},async(g)=>{let _=g;try{if(!(await w.getCapabilities()).review_sets)return w.featureDisabledResult("review_sets")}catch(Y){if(Y instanceof L)return O(Y);throw Y}if(!_.source_type)return O(new L(400,"missing_param","Missing required parameter: source_type","local"));if(_.source_type!=="git"&&_.source_type!=="upload")return O(new L(422,"invalid_argument","source_type must be one of: git, upload","local"));let b=Array.isArray(_.reviews)&&_.reviews.length>0?_.reviews:Array.isArray(_.sessions)&&_.sessions.length>0?_.sessions:void 0,J=Array.isArray(b)&&b.length>0,D=Array.isArray(_.files)&&_.files.length>0;if(!J&&!D)return O(new L(400,"missing_param","At least one of reviews[] or files[] is required","local"));let X={source_type:_.source_type};if(_.title!==void 0)X.title=_.title;if(_.kind!==void 0)X.kind=_.kind;if(J)X.reviews=b;if(D)X.files=_.files;if(_.participants!==void 0)X.participants=_.participants.map((Y)=>{if(Array.isArray(Y.roles)&&Y.roles.length>0)return{email:Y.email,roles:Y.roles};if(Y.role)return{email:Y.email,roles:[Y.role]};return Y});let G={};if(_.idempotency_key)G["Idempotency-Key"]=_.idempotency_key;try{let Y=await v.post("/review-sets",{body:X,headers:G});return i(Y.body,Y.requestId)}catch(Y){if(Y instanceof L)return O(Y);throw Y}}),$.register({name:"typescape_export_review_set",description:"Export feedback from a review set. Requires features.review_sets to be enabled.",inputSchema:$H},async(g)=>{let _=g;try{if(!(await w.getCapabilities()).review_sets)return w.featureDisabledResult("review_sets")}catch(D){if(D instanceof L)return O(D);throw D}if(!_.review_set_id)return O(new L(400,"missing_param","Missing required parameter: review_set_id","local"));let J={schema:typeof _.schema==="string"&&_.schema.trim().length>0?_.schema.trim():"v2"};if(_.view)J.view=_.view;try{let D=await v.get(`/review-sets/${encodeURIComponent(_.review_set_id)}/export`,{query:J});return i(D.body,D.requestId)}catch(D){if(D instanceof L)return O(D);throw D}}),$.register({name:"typescape_list_review_sets",description:"List review sets with optional cursor pagination. Requires features.review_sets to be enabled. Returns an array of review sets with pagination metadata.",inputSchema:vH},async(g)=>{let _=g;try{if(!(await w.getCapabilities()).review_sets)return w.featureDisabledResult("review_sets")}catch(J){if(J instanceof L)return O(J);throw J}let b={};if(_.limit!==void 0)b.limit=String(_.limit);if(_.cursor!==void 0)b.cursor=_.cursor;try{let J=await v.get("/review-sets",{query:b});return i(J.body,J.requestId)}catch(J){if(J instanceof L)return O(J);throw J}}),$.register({name:"typescape_get_review_set",description:"Get a review set by ID. Returns the review set details including status, review memberships, and configuration. Requires features.review_sets to be enabled.",inputSchema:_H},async(g)=>{let _=g;try{if(!(await w.getCapabilities()).review_sets)return w.featureDisabledResult("review_sets")}catch(b){if(b instanceof L)return O(b);throw b}if(!_.review_set_id)return O(new L(400,"missing_param","Missing required parameter: review_set_id","local"));try{let b=await v.get(`/review-sets/${encodeURIComponent(_.review_set_id)}`);return i(b.body,b.requestId)}catch(b){if(b instanceof L)return O(b);throw b}}),$.register({name:"typescape_create_work_item",description:"Create a canonical shared-queue work item for review, verification, triage, approval, or manual operator tasks.",inputSchema:wH},async(g)=>{let _=g;if(!_.title)return O(B$(400,"missing_param","Missing required parameter: title"));if(!_.kind)return O(B$(400,"missing_param","Missing required parameter: kind"));if(!_.reason_code)return O(B$(400,"missing_param","Missing required parameter: reason_code"));if(!_.audience_mode)return O(B$(400,"missing_param","Missing required parameter: audience_mode"));if(!_.target?.target_type)return O(B$(400,"missing_param","Missing required parameter: target.target_type"));if(!_.target?.target_id)return O(B$(400,"missing_param","Missing required parameter: target.target_id"));let b=rQ.safeParse(g);if(!b.success)return O(B$(422,"invalid_argument",v1(b.error.issues,"Invalid work-item create payload")));try{let J=await v.post("/work-items",{body:b.data});return i(J.body,J.requestId)}catch(J){if(J instanceof L)return O(J);throw J}}),$.register({name:"typescape_list_work_items",description:"List canonical shared-queue work items with optional queue, state, and ownership filters.",inputSchema:gH},async(g)=>{let _=g,b=tQ.safeParse(_);if(!b.success)return O(B$(422,"invalid_argument",v1(b.error.issues,"Invalid work-item query")));let J={limit:String(b.data.limit)};if(b.data.state)J.state=b.data.state;if(b.data.kind)J.kind=b.data.kind;if(b.data.reason_code)J.reason_code=b.data.reason_code;if(b.data.audience_mode)J.audience_mode=b.data.audience_mode;if(b.data.queue_surface)J.queue_surface=b.data.queue_surface;if(b.data.assignee_id)J.assignee_id=b.data.assignee_id;if(b.data.claimant_id)J.claimant_id=b.data.claimant_id;if(b.data.cursor)J.cursor=b.data.cursor;try{let D=await v.get("/work-items",{query:J});return i(D.body,D.requestId)}catch(D){if(D instanceof L)return O(D);throw D}}),$.register({name:"typescape_get_work_item",description:"Get canonical detail for a shared-queue work item by ID.",inputSchema:bH},async(g)=>{let _=g;if(!_.work_item_id)return O(B$(400,"missing_param","Missing required parameter: work_item_id"));let b=kU.safeParse(_.work_item_id);if(!b.success)return O(B$(422,"invalid_argument",v1(b.error.issues,"Invalid work item ID")));try{let J=await v.get(`/work-items/${encodeURIComponent(b.data)}`);return i(J.body,J.requestId)}catch(J){if(J instanceof L)return O(J);throw J}}),$.register({name:"typescape_transition_work_item",description:"Move a shared-queue work item through the canonical lifecycle using claim/start/block/complete and related actions.",inputSchema:UH},async(g)=>{let _=g;if(!_.work_item_id)return O(B$(400,"missing_param","Missing required parameter: work_item_id"));if(!_.action)return O(B$(400,"missing_param","Missing required parameter: action"));let b=kU.safeParse(_.work_item_id);if(!b.success)return O(B$(422,"invalid_argument",v1(b.error.issues,"Invalid work item ID")));let J=dQ.safeParse({action:_.action,..._.expected_version!==void 0?{expected_version:_.expected_version}:{},..._.idempotency_key?{idempotency_key:_.idempotency_key}:{},..._.blocking_reason?{blocking_reason:_.blocking_reason}:{},..._.cancellation_reason?{cancellation_reason:_.cancellation_reason}:{},..._.completion_outcome?{completion_outcome:_.completion_outcome}:{},..._.comment?{comment:_.comment}:{}});if(!J.success)return O(B$(422,"invalid_argument",v1(J.error.issues,"Invalid work-item transition payload")));try{let D=await v.post(`/work-items/${encodeURIComponent(b.data)}/transitions`,{body:J.data});return i(D.body,D.requestId)}catch(D){if(D instanceof L)return O(D);throw D}}),$.register({name:"typescape_create_review_ref",description:"Create a stable review reference that tracks HEAD review for doc/file/PR/custom keys. Always available (core primitive).",inputSchema:JH},async(g)=>{let _=g;if(!_.source_type)return O(new L(400,"missing_param","Missing required parameter: source_type","local"));if(!_.kind)return O(new L(400,"missing_param","Missing required parameter: kind","local"));if(!_.key)return O(new L(400,"missing_param","Missing required parameter: key","local"));if(!_.head_session_id)return O(new L(400,"missing_param","Missing required parameter: head_session_id","local"));let b=_.kind.trim().toLowerCase();if(!aW.has(b))return O(new L(400,"invalid_param",`Invalid parameter: kind must be one of ${ZU.join(", ")}`,"local"));let J={source_type:_.source_type,kind:b,key:_.key,head_session_id:_.head_session_id};if(_.repo_id!==void 0)J.repo_id=_.repo_id;if(_.project_id!==void 0)J.project_id=_.project_id;try{let D=await v.post("/review-refs",{body:J});return i(D.body,D.requestId)}catch(D){if(D instanceof L)return O(D);throw D}}),$.register({name:"typescape_resolve_review_ref",description:"Resolve a review ref to its current head review. Returns the head review ID and pinned content details.",inputSchema:DH},async(g)=>{let _=g;if(!_.review_ref_id)return O(new L(400,"missing_param","Missing required parameter: review_ref_id","local"));try{let b=await v.get(`/review-refs/${encodeURIComponent(_.review_ref_id)}/resolve`);return i(b.body,b.requestId)}catch(b){if(b instanceof L)return O(b);throw b}}),$.register({name:"typescape_advance_review_ref",description:"Advance a review ref to a new head review. Use expected_head_session_id for optimistic concurrency.",inputSchema:XH},async(g)=>{let _=g;if(!_.review_ref_id)return O(new L(400,"missing_param","Missing required parameter: review_ref_id","local"));if(!_.head_session_id)return O(new L(400,"missing_param","Missing required parameter: head_session_id","local"));let b={head_session_id:_.head_session_id};if(_.expected_head_session_id!==void 0)b.expected_head_session_id=_.expected_head_session_id;try{let J=await v.post(`/review-refs/${encodeURIComponent(_.review_ref_id)}/advance`,{body:b});return i(J.body,J.requestId)}catch(J){if(J instanceof L)return O(J);throw J}}),$.register({name:"typescape_request_approval",description:"Request approval for a review from specified approvers. Sends notifications via configured channels.",inputSchema:GH},async(g)=>{let _=g;if(!_.review_id)return O(new L(400,"missing_param","Missing required parameter: review_id","local"));if(!_.approver_emails||_.approver_emails.length===0)return O(new L(400,"missing_param","Missing required parameter: approver_emails","local"));let b={approver_emails:_.approver_emails};if(_.message!==void 0)b.message=_.message;if(_.notify!==void 0)b.notify=_.notify;let J={};if(_.idempotency_key)J["Idempotency-Key"]=_.idempotency_key;try{let D=await v.post(`/reviews/${encodeURIComponent(_.review_id)}/request-approval`,{body:b,headers:J});return i(D.body,D.requestId)}catch(D){if(D instanceof L)return O(D);throw D}}),$.register({name:"typescape_get_status",description:"Get the policy verdict for a review. Returns pass/fail/needs_review with reasons. Requires features.policy to be enabled.",inputSchema:YH},async(g)=>{let _=g;try{if(!(await w.getCapabilities()).policy)return w.featureDisabledResult("policy")}catch(J){if(J instanceof L)return O(J);throw J}if(!_.review_id)return O(new L(400,"missing_param","Missing required parameter: review_id","local"));let b={};if(_.simulate)b.simulate="true";if(_.wait!==void 0)b.wait=String(_.wait);try{let J=await v.get(`/reviews/${encodeURIComponent(_.review_id)}/status`,{query:b});return i(oG(J.body),J.requestId)}catch(J){if(J instanceof L)return O(J);throw J}}),$.register({name:"typescape_run_checks",description:"Trigger deterministic product checks (DocLint and related server-owned checks) for a review. This is separate from agent judgment against the rule bundle. Returns the check run ID. Requires features.checks to be enabled.",inputSchema:QH},async(g)=>{let _=g;try{if(!(await w.getCapabilities()).checks)return w.featureDisabledResult("checks")}catch(b){if(b instanceof L)return O(b);throw b}if(!_.review_id)return O(new L(400,"missing_param","Missing required parameter: review_id","local"));try{let b=await v.post(`/reviews/${encodeURIComponent(_.review_id)}/run-checks`,{body:{}});return i(b.body,b.requestId)}catch(b){if(b instanceof L)return O(b);throw b}}),$.register({name:"typescape_account_usage",description:"Get account usage and quota information (reviews used/limit, remaining, and billing period).",inputSchema:WH},async()=>{try{let g=await v.get("/account/usage");return i(g.body,g.requestId)}catch(g){if(g instanceof L)return O(g);throw g}}),$.register({name:"typescape_account_plan",description:"Get account plan details (plan name/id, status, and limits metadata).",inputSchema:HH},async()=>{try{let g=await v.get("/account/plan");return i(g.body,g.requestId)}catch(g){if(g instanceof L)return O(g);throw g}}),$.register({name:"typescape_get_capabilities",description:"Get authenticated capabilities and effective feature flags. Returns the same payload shape as GET /v1/me/capabilities.",inputSchema:nH},async()=>{try{let g=await v.get("/me/capabilities");return i(g.body,g.requestId)}catch(g){if(g instanceof L)return O(g);throw g}})}var BH=["typescape_request_snapshot","typescape_get_snapshot","typescape_list_backlinks","typescape_get_impact"],Wu={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier to build a corpus snapshot for"}},required:["repo_id"]},Hu={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier"},git_sha:{type:"string",description:"Git commit SHA for the snapshot"}},required:["repo_id","git_sha"]},nu={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier"},git_sha:{type:"string",description:"Git commit SHA for the snapshot"},path:{type:"string",description:"Target file path to query backlinks for"},anchor:{type:"string",description:"Optional anchor within the file to narrow backlinks"}},required:["repo_id","git_sha","path"]},qu={type:"object",properties:{review_id:{type:"string",description:"Review identifier to compute impact radius for"}},required:["review_id"]};async function xU($){try{if(!(await $.getCapabilities()).corpus_snapshots)return $.featureDisabledResult("corpus_snapshots");return null}catch(v){if(v instanceof L)return O(v);throw v}}async function Iu($,v,w){let g=await xU(v);if(g)return g;let _=w;if(!_.repo_id)return e("repo_id");let b=await $.post(`/repos/${encodeURIComponent(_.repo_id)}/snapshots`,{body:{}});return i(b.body,b.requestId)}async function Bu($,v,w){let g=await xU(v);if(g)return g;let _=w;if(!_.repo_id)return e("repo_id");if(!_.git_sha)return e("git_sha");let b=await $.get(`/repos/${encodeURIComponent(_.repo_id)}/snapshots/${encodeURIComponent(_.git_sha)}`);return i(b.body,b.requestId)}async function Lu($,v,w){let g=await xU(v);if(g)return g;let _=w;if(!_.repo_id)return e("repo_id");if(!_.git_sha)return e("git_sha");if(!_.path)return e("path");let b=new URLSearchParams({path:_.path});if(_.anchor)b.set("anchor",_.anchor);let J=await $.get(`/repos/${encodeURIComponent(_.repo_id)}/snapshots/${encodeURIComponent(_.git_sha)}/backlinks?${b}`);return i(J.body,J.requestId)}async function Vu($,v,w){let g=await xU(v);if(g)return g;let _=w;if(!_.review_id)return e("review_id");let b=await $.get(`/reviews/${encodeURIComponent(_.review_id)}/impact`);return i(b.body,b.requestId)}function LH($,v,w){$.register({name:"typescape_request_snapshot",description:"Request a corpus snapshot build for a repository. Returns the snapshot ID and build status. The snapshot builds "+"asynchronously — use typescape_get_snapshot to poll for completion. "+"Requires features.corpus_snapshots to be enabled.",inputSchema:Wu},c((g)=>Iu(v,w,g),{operation:"write"})),$.register({name:"typescape_get_snapshot",description:"Get corpus snapshot metadata for a Git repo at a specific commit. Returns snapshot status, config hash, and source type. Requires features.corpus_snapshots to be enabled.",inputSchema:Hu},c((g)=>Bu(v,w,g),{operation:"read"})),$.register({name:"typescape_list_backlinks",description:"List inbound backlinks for a target file (and optional anchor) within a corpus snapshot. Returns deterministic, authoritative data. Requires features.corpus_snapshots to be enabled.",inputSchema:nu},c((g)=>Lu(v,w,g),{operation:"read"})),$.register({name:"typescape_get_impact",description:"Compute the impact radius for a review: which other files are affected by changes to the review's target file (via backlinks). Returns deterministic, authoritative data. Requires features.corpus_snapshots to be enabled.",inputSchema:qu},c((g)=>Vu(v,w,g),{operation:"read"}))}var PH=["typescape_get_rules","typescape_rules_pack","typescape_check_content","typescape_import_rules","typescape_publish_rules","typescape_deprecate_rules","typescape_create_release_candidate","typescape_list_release_candidates","typescape_get_release_candidate","typescape_get_release_candidate_status","typescape_transition_release_candidate","typescape_rules_dashboard"],tG=new Map;function VH($){return $.status===0||$.status===429||$.status>=500}function jH($){return{repo_id:typeof $.repo_id==="string"&&$.repo_id.trim().length>0?$.repo_id.trim():null,review_id:typeof $.review_id==="string"&&$.review_id.trim().length>0?$.review_id.trim():null,file_path:typeof $.file_path==="string"&&$.file_path.trim().length>0?$.file_path.trim():null}}function lU($,v){let w=MY($.freshness.fetched_at);return{...v,cache_status:w.status,cache_age_seconds:w.age_seconds,cache_compiled_hash:$.compiled_hash,...w.warning?{warnings:[{code:"cached_rules",message:w.warning}],cache_warning:w.warning}:{}}}function fH($){if(!$||typeof $!=="object"||Array.isArray($))return;let v=$.request_id;return typeof v==="string"?v:void 0}function dG($){let v=$.compiledHash===void 0?null:$.compiledHash;return{rules:$.rules,compiled_hash:v,freshness:$.freshness,...$.requestId?{request_id:$.requestId}:{},...$.cacheMetadata??{}}}function AH($){if(!Array.isArray($))return[];return $.filter((v)=>typeof v==="object"&&v!==null&&!Array.isArray(v))}function ju($){if(!$||typeof $!=="object"||Array.isArray($))return{latest_rule_session_updated_at:null,contributing_session_count:0,total_rule_count:0};let v=$;return{latest_rule_session_updated_at:typeof v.latest_rule_session_updated_at==="string"?v.latest_rule_session_updated_at:null,contributing_session_count:typeof v.contributing_session_count==="number"&&Number.isFinite(v.contributing_session_count)?v.contributing_session_count:0,total_rule_count:typeof v.total_rule_count==="number"&&Number.isFinite(v.total_rule_count)?v.total_rule_count:0}}function MH($){if(!$||typeof $!=="object"||Array.isArray($))return{};let v={};for(let[w,g]of Object.entries($))if(typeof g==="string"&&g.length>0)v[w]=g;return v}function zH($,v,w){try{return M$($)}catch{throw new L(502,"invalid_upstream_response",w,v)}}function Fu($,v){let w=(()=>{switch(v){case"manifest":return PU.safeParse($);case"structured":return fU.safeParse($);case"text":return AU.safeParse($);case"diff":return MU.safeParse($);case"chunk":return zU.safeParse($)}})();if(w.success)return"unknown response mismatch";let g=w.error.issues[0];if(g===void 0)return"invalid response payload";return`${g.path.length===0?"(root)":g.path.join(".")}: ${g.message}`}function Ku($,v,w){let g=(()=>{switch(w){case"manifest":return PU.safeParse($);case"structured":return fU.safeParse($);case"text":return AU.safeParse($);case"diff":return MU.safeParse($);case"chunk":return zU.safeParse($)}})();if(!g.success)throw new L(502,"invalid_upstream_response",`Rules retrieval mode=${w} response was invalid (${Fu($,w)}).`,v);return g.data}function Ou($){if($.scope!==void 0)return $.scope;if($.review_id&&($.file_path||$.path))return"file";if($.review_id)return"review";if($.file_path||$.path)return"file";if($.collection_id)return"collection";return"workspace"}function iu($){let v=$.mode;if(v===void 0)throw Error("canonical retrieval mode is required");let w=typeof $.file_path==="string"&&$.file_path.trim().length>0?$.file_path.trim():typeof $.path==="string"&&$.path.trim().length>0?$.path.trim():null,g=MH($.properties);if(typeof $.repo_id==="string"&&$.repo_id.trim().length>0)g.repo_id=$.repo_id.trim();let _={mode:v,scope:Ou($)};if($.release_id)_.release_id=$.release_id;if($.collection_id)_.collection_id=$.collection_id;if($.review_id)_.review_id=$.review_id;if(w)_.file_path=w;if($.token_budget!==void 0&&$.token_budget!==null)_.token_budget=String($.token_budget);if(Object.keys(g).length>0)_.properties=JSON.stringify(g);return _}function FH($){let v=new URLSearchParams({format:$.format}),w=Object.entries($.contentProperties).sort(([g],[_])=>g.localeCompare(_));for(let[g,_]of w)v.set(g,_);return`/rules?${v.toString()}`}async function ku($){let v=await $.api.get(`/reviews/${encodeURIComponent($.reviewId)}`),w=zH(v.body,v.requestId,"Review detail response was not an object"),g=MH(w.properties),_=typeof w.repo_id==="string"&&w.repo_id.length>0?w.repo_id:null,b=typeof w.file_path==="string"&&w.file_path.length>0?w.file_path:null,J=$.filePath??b;if(_)g.repo_id=_;if(J)g.file_path=J;return{reviewId:$.reviewId,repoId:_,filePath:J,contentProperties:g}}async function KH($){let v={format:"json"},w={format:"text"};if($.scope.repo_id)v.repo_id=$.scope.repo_id,w.repo_id=$.scope.repo_id;if($.scope.review_id)v.review_id=$.scope.review_id,w.review_id=$.scope.review_id;if($.scope.file_path)v.file_path=$.scope.file_path,w.file_path=$.scope.file_path;if($.policySnapshotId)v.policy_snapshot_id=$.policySnapshotId,w.policy_snapshot_id=$.policySnapshotId;let[g,_]=await Promise.all([$.api.getText("/rules",{query:w}),$.api.get("/rules",{query:v})]),b=_.body,J=Array.isArray(b.rules)?b.rules:[],D=typeof b.compiled_hash==="string"?b.compiled_hash:null,X=b.freshness&&typeof b.freshness==="object"&&!Array.isArray(b.freshness)?b.freshness:{latest_rule_session_updated_at:null,contributing_session_count:0,total_rule_count:J.length},G=tX({scope:$.scope,rules:[],plain_text_bundle:g.body,freshness:X,compiled_hash:D??void 0,fetched_at:new Date().toISOString(),renderings:{text:g.body,json_payload:b,structured_payload:J}});tG.set(a0($.scope),G);let Y=typeof b.request_id==="string"?b.request_id:void 0;return{text:g.body,normalizedBody:b,structuredPayload:dG({rules:J,compiledHash:D,freshness:X,requestId:Y})}}async function OH($){let v=await ku({api:$.api,reviewId:$.reviewId,filePath:$.filePath}),[w,g]=await Promise.all([$.api.getText(FH({format:"text",contentProperties:v.contentProperties})),$.api.get(FH({format:"json",contentProperties:v.contentProperties}))]),_=zH(g.body,g.requestId,"Rules response payload was not an object"),b=AH(_.rules),J=ju(_.freshness),D=fH(_),X=D===void 0?g.requestId:D,G=typeof _.compiled_hash==="string"?_.compiled_hash:null,Y={..._,prompt_fragment:w.body,request_id:X},Q=dG({rules:b,compiledHash:G,freshness:J,requestId:X}),H=tX({scope:{repo_id:v.repoId,review_id:v.reviewId,file_path:v.filePath},rules:[],plain_text_bundle:w.body,freshness:J,compiled_hash:G??void 0,fetched_at:new Date().toISOString(),renderings:{text:w.body,json_payload:Y,structured_payload:b}});return tG.set(a0({repo_id:v.repoId,review_id:v.reviewId,file_path:v.filePath}),H),{text:w.body,normalizedBody:Y,structuredPayload:Q}}function iH($,v){let w=tG.get(a0($));if(!w)return null;if(v==="text")return lU(w,{text:w.plain_text_bundle,format:"text",cached:!0});if(v==="structured"){let _=AH(w.renderings?.structured_payload);return lU(w,{...dG({rules:_,compiledHash:w.compiled_hash,freshness:w.freshness,requestId:fH(w.renderings?.json_payload)}),cached:!0})}if(v==="prompt_fragment"){let _=w.renderings?.json_payload;if(_&&typeof _==="object"&&!Array.isArray(_))return lU(w,{..._,non_authoritative:!0,compatibility_only:!0,cached:!0});return null}let g=w.renderings?.json_payload;if(!g||typeof g!=="object"||Array.isArray(g))return null;return lU(w,{...g,cached:!0})}var Nu={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier"},review_id:{type:"string",description:"Review identifier. Use for upload-backed reviews or when repo_id is not known."},collection_id:{type:"string",description:"Optional collection scope for canonical retrieval."},properties:{type:"object",additionalProperties:{type:"string"},description:"Optional flat property map for canonical rule matching and retrieval."},release_id:{type:"string",description:"Optional exact immutable release ID for canonical retrieval."},mode:{type:"string",enum:["manifest","structured","text","diff","chunk"],description:"Optional canonical retrieval mode. When present, the tool returns the release-aware retrieval contract directly."},scope:{type:"string",enum:["workspace","collection","review","file"],description:"Optional canonical retrieval scope override. Default is inferred from review_id, file_path, and collection_id."},policy_snapshot_id:{type:"string",description:"Optional policy snapshot ID used to compile rules context"},file_path:{type:"string",description:"Optional file path to scope rules"},path:{type:"string",description:"Alias for file_path. If both are provided, file_path takes precedence."},format:{type:"string",enum:["text","structured","prompt_fragment"],description:'Output format: "text" returns the canonical plain-text rule bundle, "structured" returns governed JSON rules (authoritative), and "prompt_fragment" returns a compatibility prompt-shaped text view. Default: text.'},token_budget:{type:"number",description:"Maximum token count for prompt_fragment format (100-10000, default 2000)",minimum:100,maximum:1e4}}},Pu={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier for rules-pack lookup."},review_id:{type:"string",description:"Review identifier for rules-pack lookup when repo is unknown."},file_path:{type:"string",description:"Optional file path scope for rule selection."},path:{type:"string",description:"Alias for file_path."},format:{type:"string",enum:["text","prompt","structured","json"],description:'Output format. "text" returns the canonical plain-text rule bundle, "prompt" is a compatibility alias, "structured" returns normalized rules, and "json" returns the raw pack payload.'},token_budget:{type:"number",description:"Optional token budget for prompt_fragment generation."}}},fu={type:"object",properties:{content:{type:"string",description:"Markdown content for an optional server-side non-authoritative rules pass that can seed governance follow-up against applicable rules (max 1MB)."},properties:{type:"object",additionalProperties:{type:"string"},description:"Content properties for rule matching (flat key-value map, e.g. { doc_type: 'procedure' }). Use the same context the agent will reason against."},collection_id:{type:"string",description:"Optional collection ID to scope rule matching."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)."}},required:["content"]},Au={type:"object",properties:{content:{type:"string",description:"Rule markdown content to import (max 512KB). Each list item is a rule block."},title:{type:"string",description:"Human-readable title for the imported rule review (optional)."},applicability:{type:"object",additionalProperties:{type:"string"},description:"Applicability selector for rule matching (flat key-value map, optional)."},provenance:{type:"object",properties:{source:{type:"string",enum:["manual","findings","external"],description:"Import source classification."},source_review_id:{type:"string",description:"Source review ID when imported from findings."},source_label:{type:"string",description:"Human-readable source label."}},description:"Provenance metadata for finding-seeded imports (optional)."},preview:{type:"boolean",description:"If true, returns a preview without creating a review (dry run). Default: false."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)."}},required:["content"]},Mu={type:"object",properties:{include_degraded:{type:"boolean",default:!0,description:"Include derived degradation buckets based on canonical evidence rollups"}}},kH={type:"object",properties:{review_id:{type:"string",description:"Rule review ID to publish or deprecate. Must refer to a rules review."}}},zu={type:"object",properties:{workspace_id:{type:"string",description:"Workspace ID that owns the release candidate."},included_rule_revision_ids:{type:"array",items:{type:"string"},description:"Rule revision IDs to include. In the current substrate these are rules review IDs."},based_on_active_release_id:{type:"string",description:"Optional active release baseline ID."},rollback_of_release_id:{type:"string",description:"Optional release ID being rolled back."},title:{type:"string",description:"Optional human-readable release candidate title."},idempotency_key:{type:"string",description:"Optional idempotency key for safe retries."}},required:["workspace_id","included_rule_revision_ids"]},Su={type:"object",properties:{limit:{type:"number",description:"Maximum rows to return (default 6, max 25)."}}},NH={type:"object",properties:{release_candidate_id:{type:"string",description:"Canonical release candidate ID."}},required:["release_candidate_id"]},uu={type:"object",properties:{release_candidate_id:{type:"string",description:"Canonical release candidate ID."},action:{type:"string",enum:[...lG],description:"Public release candidate lifecycle action."},expected_version:{type:"number",description:"Optional optimistic concurrency version."},rejection_reason:{type:"string",description:"Required when action is reject or abandon."},stale_reason:{type:"string",description:"Required when action is mark_stale."},idempotency_key:{type:"string",description:"Optional idempotency key for safe retries."}},required:["release_candidate_id","action"]};function SH($,v,w){let g=async()=>{try{return(await w.getCapabilities()).rules?null:w.featureDisabledResult("rules")}catch(J){if(J instanceof L)return O(J);throw J}},_=async(J)=>{try{let D=await v.patch(`/reviews/${encodeURIComponent(J.reviewId)}`,{body:{state:J.targetState}});return i(D.body,D.requestId,{retry:O$(!1)})}catch(D){if(D instanceof L)return O(D,{operation:"write",hasIdempotencyKey:!1});throw D}},b=(J)=>{if(typeof J==="string"&&J.trim().length>0)return J.trim();return O(new L(400,"missing_param","Missing required parameter: release_candidate_id","local"),{operation:"read"})};$.register({name:"typescape_get_rules",description:'Canonical agent read path for repository or review context. Fetch this before reasoning about a draft or reconciling reviewer feedback. When mode is provided, the tool returns the canonical release-aware retrieval contract directly. format="text" returns the canonical plain-text rule bundle. format="structured" returns the deterministic rulepack with compiled hash and freshness metadata. format="prompt_fragment" returns a compatibility prompt-shaped text view. Requires rules to be enabled.',inputSchema:Nu},async(J)=>{let D=J,X=await g();if(X)return X;if(D.mode!==void 0){let W=NU.safeParse(D.mode);if(!W.success)return O(new L(400,"invalid_mode",`Invalid mode: ${String(D.mode)}`,"local"));let B=D.scope===void 0?null:RG.safeParse(D.scope);if(B&&!B.success)return O(new L(400,"invalid_scope",`Invalid scope: ${String(D.scope)}`,"local"));try{let j=await v.get("/rules",{query:iu({...D,mode:W.data,...B?{scope:B.data}:{}})}),A=Ku(j.body,j.requestId,W.data);return i(A,j.requestId,{retry:G$})}catch(j){if(j instanceof L)return O(j,{operation:"read"});throw j}}let G=typeof D.repo_id==="string"&&D.repo_id.length>0,Y=typeof D.review_id==="string"&&D.review_id.length>0;if(!G&&!Y)return O(new L(400,"missing_param","Missing required parameter: repo_id or review_id","local"));let Q=D.format==="structured"?"structured":D.format==="prompt_fragment"?"prompt_fragment":"text",H=typeof D.file_path==="string"&&D.file_path.trim().length>0?D.file_path.trim():typeof D.path==="string"&&D.path.trim().length>0?D.path.trim():null,I=(W)=>{let B=new URLSearchParams({format:W});if(H)B.set("file_path",H);if(D.policy_snapshot_id)B.set("policy_snapshot_id",D.policy_snapshot_id);if(D.token_budget!==void 0&&D.token_budget!==null)B.set("token_budget",String(D.token_budget));return B},q=jH({repo_id:G?D.repo_id:void 0,review_id:Y?D.review_id:void 0,file_path:H});try{let W=Y&&!G?await OH({api:v,reviewId:D.review_id,filePath:H}):await KH({api:v,scope:q,tokenBudget:D.token_budget,policySnapshotId:D.policy_snapshot_id});if(Q==="text")return i({text:W.text,format:"text"},W.normalizedBody.request_id??"missing_request_id",{retry:G$});let B={...W.normalizedBody};if(B.prompt_fragment&&Q==="prompt_fragment")B.non_authoritative=!0,B.compatibility_only=!0;if(Q==="structured")B.rules=W.structuredPayload.rules,B.compiled_hash=W.structuredPayload.compiled_hash,B.freshness=W.structuredPayload.freshness;return i(B,B.request_id??"missing_request_id",{retry:G$})}catch(W){if(W instanceof L){if(VH(W)){let B=iH(q,Q);if(B)return i(B,W.requestId,{retry:G$})}return O(W,{operation:"read"})}throw W}}),$.register({name:"typescape_rules_pack",description:"Compatibility-only alias for typescape_get_rules. Prefer typescape_get_rules in new harnesses and workflows.",inputSchema:Pu},async(J)=>{let D=J,X=await g();if(X)return X;let G=typeof D.repo_id==="string"?D.repo_id.trim():"",Y=typeof D.review_id==="string"?D.review_id.trim():"";if(!G&&!Y)return O(new L(400,"missing_param","Missing required parameter: repo_id or review_id","local"));let Q=D.format??"text",H=typeof D.file_path==="string"&&D.file_path.trim().length>0?D.file_path.trim():typeof D.path==="string"&&D.path.trim().length>0?D.path.trim():null,I=jH({repo_id:G,review_id:Y,file_path:H});try{let q=Y&&!G?await OH({api:v,reviewId:Y,filePath:H}):await KH({api:v,scope:I,tokenBudget:D.token_budget});if(Q==="text")return i({text:q.text,format:"text"},q.normalizedBody.request_id??"missing_request_id",{retry:G$});let W=q.normalizedBody;if(Q==="structured")return i(q.structuredPayload,W.request_id??"missing_request_id",{retry:G$});if(Q==="json")return i(W,W.request_id??"missing_request_id",{retry:G$});let B=typeof W.prompt==="string"?W.prompt:typeof W.prompt_fragment==="string"?W.prompt_fragment:null;if(!B)throw new L(502,"invalid_upstream_response","Rules pack response is missing prompt content",W.request_id??"missing_request_id");return i({prompt:B,prompt_fragment:B,compatibility_only:!0},W.request_id??"missing_request_id",{retry:G$})}catch(q){if(q instanceof L){let W=Q==="prompt"?"prompt_fragment":Q;if(VH(q)){let B=iH(I,W);if(B)return i(B,q.requestId,{retry:G$})}return O(q,{operation:"read"})}throw q}}),$.register({name:"typescape_check_content",description:"Optional server-side non-authoritative rules pass for markdown content. Treat the result as candidate governance/advisory input, not a complete review or substitute for agent reasoning. Canonical loop: typescape_get_rules -> read content -> typescape_create_finding. Requires rules to be enabled.",inputSchema:fu},async(J)=>{let D=J,X=await g();if(X)return X;if(!D.content||D.content.length===0)return O(new L(400,"missing_param","Missing required parameter: content","local"));let G={content:D.content};if(D.properties!==void 0)G.properties=D.properties;if(D.collection_id!==void 0)G.collection_id=D.collection_id;if(D.idempotency_key!==void 0)G.idempotency_key=D.idempotency_key;try{let Y=await v.post("/rules/check",{body:G});return i(Y.body,Y.requestId,{retry:G$})}catch(Y){if(Y instanceof L)return O(Y,{operation:"read"});throw Y}}),$.register({name:"typescape_import_rules",description:"Import rules from markdown content, creating a draft rule review. Each list item in the markdown becomes a rule block. Set preview=true for a dry run. Returns the review ID and parsed rules. Requires rules to be enabled.",inputSchema:Au},async(J)=>{let D=J,X=await g();if(X)return X;if(!D.content||D.content.length===0)return O(new L(400,"missing_param","Missing required parameter: content","local"));let G={content:D.content};if(D.title!==void 0)G.title=D.title;if(D.applicability!==void 0)G.applicability=D.applicability;if(D.provenance!==void 0)G.provenance=D.provenance;if(D.preview!==void 0)G.preview=D.preview;if(D.idempotency_key!==void 0)G.idempotency_key=D.idempotency_key;let Y={};if(D.idempotency_key)Y["Idempotency-Key"]=D.idempotency_key;try{let Q=await v.post("/rules/import",{body:G,headers:Y});return i(Q.body,Q.requestId,{retry:O$(Boolean(D.idempotency_key))})}catch(Q){if(Q instanceof L)return O(Q,{operation:"write",hasIdempotencyKey:Boolean(D.idempotency_key)});throw Q}}),$.register({name:"typescape_publish_rules",description:"Publish a draft rule review through the canonical review state transition. Returns the resulting review state and publication status. Requires rules to be enabled.",inputSchema:kH},async(J)=>{let D=J,X=await g();if(X)return X;if(!D.review_id)return O(new L(400,"missing_param","Missing required parameter: review_id","local"),{operation:"write"});return _({reviewId:D.review_id,targetState:"active"})}),$.register({name:"typescape_deprecate_rules",description:"Deprecate a published rule review through the canonical review state transition. Returns the resulting review state and publication status. Requires rules to be enabled.",inputSchema:kH},async(J)=>{let D=J,X=await g();if(X)return X;if(!D.review_id)return O(new L(400,"missing_param","Missing required parameter: review_id","local"),{operation:"write"});return _({reviewId:D.review_id,targetState:"archived"})}),$.register({name:"typescape_create_release_candidate",description:"Create a canonical release candidate from rule revisions. Use this instead of release_bundle-style review-set assembly in new workflows. Requires rules to be enabled.",inputSchema:zu},async(J)=>{let D=J,X=await g();if(X)return X;if(!D.workspace_id)return O(new L(400,"missing_param","Missing required parameter: workspace_id","local"),{operation:"write"});if(!Array.isArray(D.included_rule_revision_ids)||D.included_rule_revision_ids.length===0)return O(new L(400,"missing_param","Missing required parameter: included_rule_revision_ids","local"),{operation:"write"});let G={workspace_id:D.workspace_id,included_rule_revision_ids:D.included_rule_revision_ids,...D.based_on_active_release_id?{based_on_active_release_id:D.based_on_active_release_id}:{},...D.rollback_of_release_id?{rollback_of_release_id:D.rollback_of_release_id}:{},...D.title?{title:D.title}:{},...D.idempotency_key?{idempotency_key:D.idempotency_key}:{}},Y={};if(D.idempotency_key)Y["Idempotency-Key"]=D.idempotency_key;try{let Q=await v.post("/releases/candidates",{body:G,...D.idempotency_key?{headers:Y}:{}});return i(Q.body,Q.requestId,{retry:O$(Boolean(D.idempotency_key))})}catch(Q){if(Q instanceof L)return O(Q,{operation:"write",hasIdempotencyKey:Boolean(D.idempotency_key)});throw Q}}),$.register({name:"typescape_list_release_candidates",description:"List canonical release candidates for the authenticated workspace tenant. Requires rules to be enabled.",inputSchema:Su},async(J)=>{let D=J,X=await g();if(X)return X;let G={};if(typeof D.limit==="number"&&Number.isFinite(D.limit))G.limit=String(D.limit);try{let Y=await v.get("/releases/candidates",{query:G});return i(Y.body,Y.requestId,{retry:G$})}catch(Y){if(Y instanceof L)return O(Y,{operation:"read"});throw Y}}),$.register({name:"typescape_get_release_candidate",description:"Get canonical release candidate detail by ID. Requires rules to be enabled.",inputSchema:NH},async(J)=>{let D=J,X=await g();if(X)return X;let G=b(D.release_candidate_id);if(typeof G!=="string")return G;try{let Y=await v.get(`/releases/candidates/${encodeURIComponent(G)}`);return i(Y.body,Y.requestId,{retry:G$})}catch(Y){if(Y instanceof L)return O(Y,{operation:"read"});throw Y}}),$.register({name:"typescape_get_release_candidate_status",description:"Get canonical release candidate status and required actions by ID. Requires rules to be enabled.",inputSchema:NH},async(J)=>{let D=J,X=await g();if(X)return X;let G=b(D.release_candidate_id);if(typeof G!=="string")return G;try{let Y=await v.get(`/releases/candidates/${encodeURIComponent(G)}/status`);return i(Y.body,Y.requestId,{retry:G$})}catch(Y){if(Y instanceof L)return O(Y,{operation:"read"});throw Y}}),$.register({name:"typescape_transition_release_candidate",description:"Move a canonical release candidate through its lifecycle. Requires rules to be enabled.",inputSchema:uu},async(J)=>{let D=J,X=await g();if(X)return X;let G=b(D.release_candidate_id);if(typeof G!=="string")return G;if(!D.action)return O(new L(400,"missing_param","Missing required parameter: action","local"),{operation:"write"});let Y={action:D.action,...typeof D.expected_version==="number"?{expected_version:D.expected_version}:{},...D.rejection_reason?{rejection_reason:D.rejection_reason}:{},...D.stale_reason?{stale_reason:D.stale_reason}:{},...D.idempotency_key?{idempotency_key:D.idempotency_key}:{}},Q={};if(D.idempotency_key)Q["Idempotency-Key"]=D.idempotency_key;try{let H=await v.post(`/releases/candidates/${encodeURIComponent(G)}/transition`,{body:Y,...D.idempotency_key?{headers:Q}:{}});return i(H.body,H.requestId,{retry:O$(Boolean(D.idempotency_key))})}catch(H){if(H instanceof L)return O(H,{operation:"write",hasIdempotencyKey:Boolean(D.idempotency_key)});throw H}}),$.register({name:"typescape_rules_dashboard",description:"Get aggregate rules evidence, provenance, and degradation summary from canonical rules runtime surfaces. Requires features.rules.",inputSchema:Mu},async(J)=>{let D=J;try{if(!(await w.getCapabilities()).rules)return w.featureDisabledResult("rules")}catch(X){if(X instanceof L)return O(X);throw X}try{let X=D.include_degraded!==!1,[G,Y]=await Promise.all([v.get("/rules/evidence",{query:{window:"14d"}}),v.get("/rules/provenance/aggregate")]),Q=M$(G.body),H=(S)=>{let y=Q[S];if(typeof y==="number"&&Number.isInteger(y)&&y>=0)return y;throw new L(502,"invalid_upstream_response",`${S} must be a non-negative integer`,G.requestId)},I=(S,y,x)=>{let Y$=S[y];if(Y$&&typeof Y$==="object"&&!Array.isArray(Y$))return Y$;throw new L(502,"invalid_upstream_response",`${y} must be an object`,x)},q=H("total_active_rules"),W=H("zero_use_rules"),B=H("high_trigger_rules"),j=H("low_trigger_rules"),A=I(Q,"adoption",G.requestId);if(!Y.body||typeof Y.body!=="object"||Array.isArray(Y.body))throw new L(502,"invalid_upstream_response","Canonical provenance response must be an object",Y.requestId);let z=Y.body,C=I(z,"provenance",Y.requestId),Z={active_rules:q,rule_health:{total_rules:q,zero_use_rules:W,high_trigger_rules:B,low_trigger_rules:j},adoption:A,provenance:C,request_ids:{evidence:G.requestId,provenance:Y.requestId}};if(X)Z.degraded_rules=[{category:"zero_use",count:W,description:"Active rules with no observed adoption in the selected evidence window"},{category:"high_trigger",count:B,description:"Active rules with elevated trigger volume in the selected evidence window"},{category:"low_trigger",count:j,description:"Active rules with low trigger volume in the selected evidence window"}];return i(Z,G.requestId,{retry:G$})}catch(X){if(X instanceof L)return O(X,{operation:"read"});throw X}})}var uH=["typescape_list_repos","typescape_connect_repo","typescape_repo_branches","typescape_upload_reviewer_asset"];function Tu($){switch($){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/gif":return"gif";case"image/webp":return"webp";default:return"bin"}}var Ru=5242880,Cu=new Set(["image/png","image/jpeg","image/gif","image/webp"]);function TH($,v){let w={name:"typescape_list_repos",description:"List connected repositories in the workspace. Returns paginated list of repos with their origin URLs and metadata.",inputSchema:{type:"object",properties:{include_archived:{type:"boolean",description:"Include archived repositories (default: false)"},limit:{type:"number",description:"Maximum repos to return (1-100, default: 50)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}}};$.register(w,c(async(J)=>{let D=J,X={};if(D.include_archived)X.include_archived="true";if(D.limit!==void 0)X.limit=String(D.limit);if(D.cursor)X.cursor=D.cursor;let G=await v.get("/repos",{query:X});return i(G.body,G.requestId)},{operation:"read"}));let g={name:"typescape_connect_repo",description:"Connect a Git repository by its origin URL. If the URL is a GitHub repo and a GitHub App installation exists, it will be automatically linked for branch/file browsing.",inputSchema:{type:"object",properties:{origin_url:{type:"string",description:"Git remote URL (HTTPS or SSH), e.g. https://github.com/acme/docs"},display_name:{type:"string",description:"Human-readable display name (optional, auto-derived from URL)"}},required:["origin_url"]}};$.register(g,c(async(J)=>{let D=J;if(!D.origin_url)return e("origin_url");let X={origin_url:D.origin_url};if(D.display_name)X.display_name=D.display_name;let G=await v.post("/repos",{body:X});return i(G.body,G.requestId)},{operation:"write"}));let _={name:"typescape_repo_branches",description:"List branches for a connected repository. Requires a GitHub App installation to be linked to the repo. Returns branch names and their head SHAs.",inputSchema:{type:"object",properties:{repo_id:{type:"string",description:"Repository ID (e.g. repo_abc123)"}},required:["repo_id"]}};$.register(_,c(async(J)=>{let D=J;if(!D.repo_id)return e("repo_id");let X=await v.get(`/repos/${encodeURIComponent(D.repo_id)}/branches`);return i(X.body,X.requestId)},{operation:"read"}));let b={name:"typescape_upload_reviewer_asset",description:"Upload a reviewer asset (image) to a review. Accepts base64-encoded image data (PNG, JPEG, GIF, WebP). Maximum size: 5MB. For larger files, use the CLI or web UI.",inputSchema:{type:"object",properties:{review_id:{type:"string",description:"Review ID to upload the asset to"},base64_content:{type:"string",description:"Base64-encoded image data"},mime_type:{type:"string",enum:["image/png","image/jpeg","image/gif","image/webp"],description:"MIME type of the image"},alt_text:{type:"string",description:"Alt text for the image (optional)"},filename:{type:"string",description:"Original filename (optional)"}},required:["review_id","base64_content","mime_type"]}};$.register(b,c(async(J)=>{let D=J;if(!D.review_id)return e("review_id");if(!D.base64_content)return e("base64_content");if(!D.mime_type)return e("mime_type");if(!Cu.has(D.mime_type))return O(new L(415,"unsupported_media_type",`Unsupported MIME type "${D.mime_type}". Allowed: PNG, JPEG, GIF, WebP.`,"local"));if(!yG.test(D.base64_content))return O(new L(400,"invalid_base64","base64_content is not valid base64-encoded data","local"));let X;try{let H=Buffer.from(D.base64_content,"base64");X=new Uint8Array(H)}catch{return O(new L(400,"invalid_base64","Failed to decode base64_content","local"))}if(X.byteLength>Ru){let H=(X.byteLength/1048576).toFixed(1);return O(new L(413,"asset_too_large",`Image is ${H}MB, exceeding the 5MB MCP limit. Use the CLI ("typescape asset upload") or web UI for larger files.`,"local"))}let G=new Blob([X],{type:D.mime_type}),Y=new FormData;if(Y.append("file",G,D.filename||`upload.${Tu(D.mime_type)}`),Y.append("mime_type",D.mime_type),D.alt_text)Y.append("alt_text",D.alt_text);let Q=await v.postFormData(`/reviews/${encodeURIComponent(D.review_id)}/reviewer-assets`,Y);return i(Q.body,Q.requestId)},{operation:"write"}))}var RH=["typescape_create_collection","typescape_add_review_to_collection"],Eu={type:"object",properties:{name:{type:"string",description:"Collection name (1-100 characters, unique per tenant among non-archived collections)"},description:{type:"string",description:"Optional Markdown description (max 2000 characters)"},color:{type:"string",description:"Optional hex color (e.g., #12A594)"}},required:["name"]},Zu={type:"object",properties:{collection_id:{type:"string",description:"Collection ID (e.g., col_01HXYZ...)"},review_id:{type:"string",description:"Review ID to add (opaque identifier)"}},required:["collection_id","review_id"]};function CH($,v,w){$.register({name:"typescape_create_collection",description:"Create a new collection to group related reviews. Requires collections_enabled feature flag. Returns the created collection with its ID.",inputSchema:Eu},c(async(g)=>{let _=g;if(!_.name)return e("name");if(!(await w.getCapabilities()).collections_enabled)return w.featureDisabledResult("collections_enabled");let J={name:_.name};if(_.description!==void 0)J.description=_.description;if(_.color!==void 0)J.color=_.color;let D=await v.post("/collections",{body:J});return i(M$(D.body),D.requestId)})),$.register({name:"typescape_add_review_to_collection",description:"Add a review to an existing collection. Idempotent: re-adding an already-present review is a no-op. Requires collections_enabled feature flag.",inputSchema:Zu},c(async(g)=>{let _=g;if(!_.collection_id)return e("collection_id");if(!_.review_id)return e("review_id");if(!(await w.getCapabilities()).collections_enabled)return w.featureDisabledResult("collections_enabled");let J=await v.post(`/collections/${encodeURIComponent(_.collection_id)}/sessions`,{body:{session_id:_.review_id}});return i(M$(J.body),J.requestId)}))}var EH={type:"object",properties:{artifact_kind:{type:"string",description:"Advisory artifact kind: recommendation, classification, contradiction, synthesis, proposal, or challenge"},kind:{type:"string",description:"Compatibility alias for artifact_kind"},target_type:{type:"string",enum:["review","finding","rule_review","rule_block","review_set"],description:"Type of entity this advisory targets"},target_id:{type:"string",description:"ID of the target entity (e.g., sess_01HXYZ... or finding ID)"},review_id:{type:"string",description:"Review scope for this advisory (optional; enables review-scoped queries)"},body_md:{type:"string",description:"Advisory body in Markdown (required, max 64KB)"},body:{type:"string",description:"Compatibility alias for body_md"},source_type:{type:"string",enum:["human","agent"],description:"Provenance source type (default: agent)"},source_label:{type:"string",description:"Label identifying the source (e.g., agent name or tool)"},submitted_by:{type:"string",description:"Identity of the submitter (agent ID or user ID)"},confidence:{type:"number",description:"Confidence score between 0 and 1 (optional)"},severity_hint:{type:"string",description:"Severity hint: suggestion, needs_changes, blocking (optional)"},structured_data:{type:"object",description:"Machine-readable structured data payload (optional)"},evidence_refs:{type:"array",items:{type:"string"},description:"References to supporting evidence (optional)"},basis:{type:"object",properties:{export_sha256:{type:"string",description:"SHA256 of export used as basis"},rulepack_sha256:{type:"string",description:"SHA256 of rulepack used"},source_content_sha256:{type:"string",description:"SHA256 of source content"},basis_review_ids:{type:"array",items:{type:"string"},description:"Review IDs used as basis"},basis_finding_ids:{type:"array",items:{type:"string"},description:"Finding IDs used as basis"}},description:"Deterministic inputs the advisory was derived from (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["artifact_kind","target_type","target_id","body_md","source_label","submitted_by"]},ZH={type:"object",properties:{review_id:{type:"string",description:"Filter by review ID (optional)"},target_type:{type:"string",enum:["review","finding","rule_review","rule_block","review_set"],description:"Filter by target type (optional)"},target_id:{type:"string",description:"Filter by target ID (optional)"},artifact_kind:{type:"string",description:"Filter by artifact kind (optional)"},status:{type:"string",enum:["submitted","adopted","rejected","superseded"],description:"Filter by status (optional)"},submitted_by:{type:"string",description:"Filter by submitter identity (optional)"},limit:{type:"number",description:"Maximum items to return (1-200, default 50)"},offset:{type:"number",description:"Pagination offset (default 0)"}},required:[]},xH={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to retrieve"}},required:["artifact_id"]},lH={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to adopt"},rationale:{type:"string",description:"Rationale for adoption (optional)"},adoption_review_id:{type:"string",description:"Review ID associated with adoption (optional)"},adoption_proposed_change_id:{type:"string",description:"Proposed change ID associated with adoption (optional)"}},required:["artifact_id"]},hH={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to reject"},rejection_reason:{type:"string",description:"Reason for rejection (required)"}},required:["artifact_id","rejection_reason"]},cH={type:"object",properties:{workspace_id:{type:"string",description:"Workspace identifier for the governance signal"},kind:{type:"string",description:"Canonical governance signal kind: pattern, canon_disagreement, rule_gap, or drafting_recommendation"},target_type:{type:"string",description:"Type of entity this governance signal targets"},target_id:{type:"string",description:"ID of the target entity"},review_id:{type:"string",description:"Related review scope when applicable"},block_id:{type:"string",description:"Optional target-context block anchor within the review"},body_md:{type:"string",description:"Governance signal body in Markdown"},body:{type:"string",description:"Compatibility alias for body_md"},source_type:{type:"string",enum:["human","agent"],description:"Provenance source type (default: agent)"},source_label:{type:"string",description:"Label identifying the source (agent, tool, or reviewer)"},submitted_by:{type:"string",description:"Identity of the submitter"},confidence:{type:"number",description:"Confidence score between 0 and 1 (optional)"},severity_hint:{type:"string",description:"Optional severity hint carried in the payload"},structured_data:{type:"object",description:"Machine-readable structured data payload (optional)"},evidence_refs:{type:"array",items:{type:"string"},description:"References to supporting evidence (optional)"},basis:{type:"object",properties:{export_sha256:{type:"string",description:"SHA256 of export used as basis"},rulepack_sha256:{type:"string",description:"SHA256 of rulepack used"},source_content_sha256:{type:"string",description:"SHA256 of source content"},basis_review_ids:{type:"array",items:{type:"string"},description:"Review IDs used as basis"},basis_finding_ids:{type:"array",items:{type:"string"},description:"Finding IDs used as basis"}},description:"Deterministic inputs the governance signal was derived from (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["workspace_id","kind","target_type","target_id","body_md","source_label","submitted_by"]},yH={type:"object",properties:{workspace_id:{type:"string",description:"Filter by workspace ID (optional)"},review_id:{type:"string",description:"Filter by review ID (optional)"},target_type:{type:"string",description:"Optional client-side target type filter"},target_id:{type:"string",description:"Optional client-side target ID filter"},kind:{type:"string",description:"Filter by governance signal kind (optional)"},state:{type:"string",description:"Filter by governance signal state (optional)"},submitted_by:{type:"string",description:"Filter by submitter identity (optional)"},limit:{type:"number",description:"Maximum items to return (1-200, default 50)"},offset:{type:"number",description:"Pagination offset (default 0)"}},required:[]},mH={type:"object",properties:{signal_id:{type:"string",description:"Governance signal ID to retrieve"}},required:["signal_id"]},rH={type:"object",properties:{signal_id:{type:"string",description:"Governance signal ID to transition"},target_state:{type:"string",description:"Target lifecycle state"},expected_version:{type:"number",description:"Optional optimistic concurrency version"},reason:{type:"string",description:"Transition rationale (optional)"},severity:{type:"string",description:"Optional triage severity metadata"},grouping_id:{type:"string",description:"Optional triage grouping identifier"},affected_rule_document_ids:{type:"array",items:{type:"string"},description:"Affected rule documents for triage metadata"},re_triage_date:{type:"string",description:"Snooze wake-up date when applicable"},converted_working_draft_ids:{type:"array",items:{type:"string"},description:"Working drafts created from the signal when converting"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["signal_id","target_state"]};var oH=["typescape_submit_governance_signal","typescape_list_governance_signals","typescape_get_governance_signal","typescape_transition_governance_signal","typescape_submit_advisory","typescape_list_advisories","typescape_get_advisory","typescape_adopt_advisory","typescape_reject_advisory"];function tH($){if(!$)return;return{...$,export_sha256:$.export_sha256??$.export_hash,rulepack_sha256:$.rulepack_sha256??$.rulepack_hash,source_content_sha256:$.source_content_sha256??$.source_hash}}function xu($,v){if(!Array.isArray($))return $;return $.filter((w)=>{if(typeof w!=="object"||w===null)return!1;let g=w,_=typeof g.target==="object"&&g.target!==null?g.target:null;if(v.target_type&&_?.target_type!==v.target_type)return!1;if(v.target_id&&_?.target_id!==v.target_id)return!1;return!0})}async function lu($,v){let w=v,g=w.body_md??w.body,_=tH(w.basis);for(let[X,G]of[[w.workspace_id,"workspace_id"],[w.kind,"kind"],[w.target_type,"target_type"],[w.target_id,"target_id"],[g,"body_md"],[w.source_label,"source_label"],[w.submitted_by,"submitted_by"]]){let Y=U$(X,G);if(Y)return Y}let b={kind:w.kind,workspace_id:w.workspace_id,target:{target_type:w.target_type,target_id:w.target_id,...(w.review_id||w.block_id)&&{target_context:{...w.review_id?{review_id:w.review_id}:{},...w.block_id?{block_id:w.block_id}:{}}}},provenance:{source_type:w.source_type??"agent",source_label:w.source_label,submitted_by:w.submitted_by,submitted_at:new Date().toISOString()},payload:{body_md:g,...w.confidence!==void 0?{confidence:w.confidence}:{},...w.severity_hint!==void 0?{severity_hint:w.severity_hint}:{},...w.structured_data!==void 0?{structured_data:w.structured_data}:{},...w.evidence_refs!==void 0?{evidence_refs:w.evidence_refs}:{}}};if(w.review_id)b.review_id=w.review_id;if(_)b.basis=_;if(w.idempotency_key)b.idempotency_key=w.idempotency_key;let J={};if(w.idempotency_key)J["Idempotency-Key"]=w.idempotency_key;let D=await $.post("/governance-signals",{body:b,headers:J});return i(D.body,D.requestId,{retry:O$(Boolean(w.idempotency_key))})}async function hu($,v){let w=v,g={};if(w.workspace_id)g.workspace_id=w.workspace_id;if(w.review_id)g.review_id=w.review_id;if(w.kind)g.kind=w.kind;if(w.state)g.state=w.state;if(w.submitted_by)g.submitted_by=w.submitted_by;if(w.limit!==void 0)g.limit=String(w.limit);if(w.offset!==void 0)g.offset=String(w.offset);let _=await $.get("/governance-signals",{query:g}),b=xu(_.body.items,w);return i({..._.body,items:b,total:Array.isArray(b)?b.length:_.body.total},_.requestId,{retry:G$})}async function cu($,v){let w=v,g=U$(w.signal_id,"signal_id");if(g)return g;let _=U$(w.target_state,"target_state");if(_)return _;let b={target_state:w.target_state,...w.expected_version!==void 0?{expected_version:w.expected_version}:{},...w.reason?{reason:w.reason}:{},...w.re_triage_date?{re_triage_date:w.re_triage_date}:{},...w.converted_working_draft_ids!==void 0?{converted_working_draft_ids:w.converted_working_draft_ids}:{},...w.idempotency_key?{idempotency_key:w.idempotency_key}:{}};if(w.severity!==void 0||w.grouping_id!==void 0||w.affected_rule_document_ids!==void 0)b.triage_metadata={...w.severity!==void 0?{severity:w.severity}:{},...w.grouping_id!==void 0?{grouping_id:w.grouping_id}:{},...w.affected_rule_document_ids!==void 0?{affected_rule_document_ids:w.affected_rule_document_ids}:{}};let J={};if(w.idempotency_key)J["Idempotency-Key"]=w.idempotency_key;let D=await $.post(`/governance-signals/${encodeURIComponent(w.signal_id)}/transition`,{body:b,headers:J});return i(D.body,D.requestId,{retry:O$(Boolean(w.idempotency_key))})}async function yu($,v){let w=v,g=w.artifact_kind??w.kind,_=w.body_md??w.body,b=tH(w.basis);for(let[G,Y]of[[g,"artifact_kind"],[w.target_type,"target_type"],[w.target_id,"target_id"],[_,"body_md"],[w.source_label,"source_label"],[w.submitted_by,"submitted_by"]]){let Q=U$(G,Y);if(Q)return Q}let J={artifact_kind:g,target:{target_type:w.target_type,target_id:w.target_id},provenance:{source_type:w.source_type??"agent",source_label:w.source_label,submitted_by:w.submitted_by,submitted_at:new Date().toISOString()},payload:{body_md:_,...w.confidence!==void 0&&{confidence:w.confidence},...w.severity_hint!==void 0&&{severity_hint:w.severity_hint},...w.structured_data!==void 0&&{structured_data:w.structured_data},...w.evidence_refs!==void 0&&{evidence_refs:w.evidence_refs}}};if(w.review_id)J.review_id=w.review_id;if(b)J.basis=b;if(w.idempotency_key)J.idempotency_key=w.idempotency_key;let D={};if(w.idempotency_key)D["Idempotency-Key"]=w.idempotency_key;let X=await $.post("/advisory-artifacts",{body:J,headers:D});return i(X.body,X.requestId,{retry:O$(Boolean(w.idempotency_key))})}async function mu($,v){let w=v,g={};if(w.review_id)g.review_id=w.review_id;if(w.target_type)g.target_type=w.target_type;if(w.target_id)g.target_id=w.target_id;if(w.artifact_kind)g.artifact_kind=w.artifact_kind;if(w.status)g.status=w.status;if(w.submitted_by)g.submitted_by=w.submitted_by;if(w.limit!==void 0)g.limit=String(w.limit);if(w.offset!==void 0)g.offset=String(w.offset);let _=await $.get("/advisory-artifacts",{query:g});return i(_.body,_.requestId,{retry:G$})}async function ru($,v){let w=v,g=U$(w.artifact_id,"artifact_id");if(g)return g;let _=await $.get(`/advisory-artifacts/${encodeURIComponent(w.artifact_id)}`);return i(_.body,_.requestId,{retry:G$})}async function ou($,v){let w=v,g=U$(w.artifact_id,"artifact_id");if(g)return g;let _={};if(w.rationale)_.rationale=w.rationale;if(w.adoption_review_id)_.adoption_review_id=w.adoption_review_id;if(w.adoption_proposed_change_id)_.adoption_proposed_change_id=w.adoption_proposed_change_id;let b=await $.post(`/advisory-artifacts/${encodeURIComponent(w.artifact_id)}/adopt`,{body:_});return i(b.body,b.requestId,{retry:O$(!1)})}async function tu($,v){let w=v,g=U$(w.artifact_id,"artifact_id");if(g)return g;let _=U$(w.rejection_reason,"rejection_reason");if(_)return _;let b=await $.post(`/advisory-artifacts/${encodeURIComponent(w.artifact_id)}/reject`,{body:{rejection_reason:w.rejection_reason}});return i(b.body,b.requestId,{retry:O$(!1)})}function dH($,v){$.register({name:"typescape_submit_governance_signal",description:"Submit a canonical governance signal for operator triage. Use this for pattern, rule-gap, canon-disagreement, and drafting-recommendation intake.",inputSchema:cH},c((w)=>lu(v,w),{operation:"write"})),$.register({name:"typescape_list_governance_signals",description:"List canonical governance signals with optional workspace, review, kind, state, or submitter filters.",inputSchema:yH},c((w)=>hu(v,w),{operation:"read"})),$.register({name:"typescape_get_governance_signal",description:"Get a single governance signal by ID. Returns full signal detail with provenance, payload, and triage state.",inputSchema:mH},c(async(w)=>{let g=w,_=U$(g.signal_id,"signal_id");if(_)return _;let b=await v.get(`/governance-signals/${encodeURIComponent(g.signal_id)}`);return i(b.body,b.requestId,{retry:G$})},{operation:"read"})),$.register({name:"typescape_transition_governance_signal",description:"Transition a governance signal through the canonical triage lifecycle.",inputSchema:rH},c((w)=>cu(v,w),{operation:"write"})),$.register({name:"typescape_submit_advisory",description:"Compatibility-only alias for older advisory submission flows. Prefer typescape_submit_governance_signal for new RGV2 automation.",inputSchema:EH},c((w)=>yu(v,w),{operation:"write"})),$.register({name:"typescape_list_advisories",description:"Compatibility-only alias for older advisory listing flows.",inputSchema:ZH},c((w)=>mu(v,w),{operation:"read"})),$.register({name:"typescape_get_advisory",description:"Compatibility-only alias for older advisory detail lookups.",inputSchema:xH},c((w)=>ru(v,w),{operation:"read"})),$.register({name:"typescape_adopt_advisory",description:"Compatibility-only alias for legacy advisory adoption.",inputSchema:lH},c((w)=>ou(v,w),{operation:"write"})),$.register({name:"typescape_reject_advisory",description:"Compatibility-only alias for legacy advisory rejection.",inputSchema:hH},c((w)=>tu(v,w),{operation:"write"}))}var pH={type:"object",properties:{artifact_id:{type:"string",description:"Filter by advisory artifact ID (optional)"},action_type:{type:"string",enum:["advisory_submit","advisory_adopt","advisory_reject","advisory_supersede","revision_recommend"],description:"Filter by action type (optional)"},actor_id:{type:"string",description:"Filter by actor ID (optional)"},actor_type:{type:"string",enum:["agent","human","system"],description:"Filter by actor type (optional)"},review_id:{type:"string",description:"Filter by review scope (optional)"},limit:{type:"number",description:"Maximum items to return (1-200, default 50)"},offset:{type:"number",description:"Pagination offset (default 0)"}},required:[]},eH={type:"object",properties:{receipt_id:{type:"string",description:"Action receipt ID to retrieve"}},required:["receipt_id"]},aH={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to list receipts for"}},required:["artifact_id"]};var sH=["typescape_list_action_receipts","typescape_get_action_receipt","typescape_list_artifact_receipts"];function $n($,v){$.register({name:"typescape_list_action_receipts",description:"List action receipts with optional filters. Filter by artifact, action type, actor, or review scope. Receipts capture basis attestation and tool metadata for advisory operations.",inputSchema:pH},c(async(w)=>{let g=w,_={};if(g.artifact_id)_.artifact_id=g.artifact_id;if(g.action_type)_.action_type=g.action_type;if(g.actor_id)_.actor_id=g.actor_id;if(g.actor_type)_.actor_type=g.actor_type;if(g.review_id)_.review_id=g.review_id;if(g.limit!==void 0)_.limit=String(g.limit);if(g.offset!==void 0)_.offset=String(g.offset);let b=await v.get("/action-receipts",{query:_});return i(b.body,b.requestId,{retry:G$})},{operation:"read"})),$.register({name:"typescape_get_action_receipt",description:"Get a single action receipt by ID. Returns full receipt with basis snapshot, tool metadata, and result summary.",inputSchema:eH},c(async(w)=>{let g=w;if(!g.receipt_id)return e("receipt_id");let _=await v.get(`/action-receipts/${encodeURIComponent(g.receipt_id)}`);return i(_.body,_.requestId,{retry:G$})},{operation:"read"})),$.register({name:"typescape_list_artifact_receipts",description:"List all action receipts for a specific advisory artifact. Shows the full execution journal for an artifact's lifecycle.",inputSchema:aH},c(async(w)=>{let g=w;if(!g.artifact_id)return e("artifact_id");let _=await v.get(`/advisory-artifacts/${encodeURIComponent(g.artifact_id)}/receipts`);return i(_.body,_.requestId,{retry:G$})},{operation:"read"}))}var vn=["typescape_create_project","typescape_list_projects","typescape_get_project","typescape_update_project"],du={type:"object",properties:{name:{type:"string",description:"Project name (required, 1-200 characters)"},description:{type:"string",description:"Optional project description (Markdown, max 2000 characters)"}},required:["name"]},pu={type:"object",properties:{limit:{type:"number",description:"Maximum number of projects to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from a previous response"}}},eu={type:"object",properties:{project_id:{type:"string",description:"Project ID (e.g., prj_01HXYZ...)"}},required:["project_id"]},au={type:"object",properties:{project_id:{type:"string",description:"Project ID to update"},name:{type:"string",description:"New project name (1-200 characters)"},description:{type:"string",description:"New project description (Markdown, max 2000 characters)"}},required:["project_id"]};function _n($,v){$.register({name:"typescape_create_project",description:"Create a new project for organizing document-upload-based reviews. Returns the created project with its ID.",inputSchema:du},c(async(w)=>{let g=w;if(!g.name)return e("name");let _={name:g.name};if(g.description!==void 0)_.description=g.description;let b=await v.post("/projects",{body:_});return i(M$(b.body),b.requestId)},{operation:"write"})),$.register({name:"typescape_list_projects",description:"List projects with optional cursor pagination. Returns an array of projects with pagination metadata.",inputSchema:pu},c(async(w)=>{let g=w,_={};if(g.limit!==void 0)_.limit=String(g.limit);if(g.cursor!==void 0)_.cursor=g.cursor;let b=await v.get("/projects",{query:_});return i(b.body,b.requestId)},{operation:"read"})),$.register({name:"typescape_get_project",description:"Get a project by ID. Returns the project details including configuration.",inputSchema:eu},c(async(w)=>{let g=w;if(!g.project_id)return e("project_id");let _=await v.get(`/projects/${encodeURIComponent(g.project_id)}`);return i(M$(_.body),_.requestId)},{operation:"read"})),$.register({name:"typescape_update_project",description:"Update a project's name or description. Only provided fields are changed; omitted fields are left unchanged.",inputSchema:au},c(async(w)=>{let g=w;if(!g.project_id)return e("project_id");let _={};if(g.name!==void 0)_.name=g.name;if(g.description!==void 0)_.description=g.description;let b=await v.request("PATCH",`/projects/${encodeURIComponent(g.project_id)}`,{body:_});return i(M$(b.body),b.requestId)},{operation:"write"}))}var wn=["typescape_create_template","typescape_list_templates","typescape_get_template"],su={type:"object",properties:{name:{type:"string",description:"Template name (required, 1-200 characters)"},description:{type:"string",description:"Optional template description"},source_type:{type:"string",enum:["git","upload"],description:"Source type for reviews created from this template (default: git)"},repo_id:{type:"string",description:"Repository ID (required when source_type is git)"},project_id:{type:"string",description:"Project ID (required when source_type is upload)"},config:{type:"object",description:"Optional configuration object for the template (e.g., default participants, rules, settings)"}},required:["name"]},$T={type:"object",properties:{limit:{type:"number",description:"Maximum number of templates to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from a previous response"}}},vT={type:"object",properties:{template_id:{type:"string",description:"Template ID (e.g., tpl_01HXYZ...)"}},required:["template_id"]};function gn($,v){$.register({name:"typescape_create_template",description:"Create a review template for repeatable review creation. Templates capture default settings so operators don't re-specify parameters each time. Returns the created template with its ID.",inputSchema:su},c(async(w)=>{let g=w;if(!g.name)return e("name");let _={name:g.name};if(g.description!==void 0)_.description=g.description;if(g.source_type!==void 0)_.source_type=g.source_type;if(g.repo_id!==void 0)_.repo_id=g.repo_id;if(g.project_id!==void 0)_.project_id=g.project_id;if(g.config!==void 0)_.config=g.config;let b=await v.post("/session-templates",{body:_});return i(M$(b.body),b.requestId)},{operation:"write"})),$.register({name:"typescape_list_templates",description:"List review templates with optional cursor pagination. Returns an array of templates with pagination metadata.",inputSchema:$T},c(async(w)=>{let g=w,_={};if(g.limit!==void 0)_.limit=String(g.limit);if(g.cursor!==void 0)_.cursor=g.cursor;let b=await v.get("/session-templates",{query:_});return i(b.body,b.requestId)},{operation:"read"})),$.register({name:"typescape_get_template",description:"Get a review template by ID. Returns the template details including configuration.",inputSchema:vT},c(async(w)=>{let g=w;if(!g.template_id)return e("template_id");let _=await v.get(`/session-templates/${encodeURIComponent(g.template_id)}`);return i(M$(_.body),_.requestId)},{operation:"read"}))}var bn=["typescape_list_issues","typescape_get_issue","typescape_update_issue"],_T={type:"object",properties:{session_id:{type:"string",description:"Review ID to list issues for (required)"},status:{type:"string",enum:["open","closed","all"],description:"Filter by issue status (default: all)"},severity:{type:"string",enum:["critical","high","medium","low","info"],description:"Filter by severity level"},limit:{type:"number",description:"Maximum number of issues to return (default: 20, max: 100)"},offset:{type:"number",description:"Offset for pagination (default: 0)"}},required:["session_id"]},wT={type:"object",properties:{issue_id:{type:"string",description:"Issue ID (e.g., iss_01HXYZ...)"}},required:["issue_id"]},gT={type:"object",properties:{issue_id:{type:"string",description:"Issue ID to update"},status:{type:"string",enum:["open","closed"],description:"New status for the issue"},assignee:{type:"string",description:"User ID or email to assign the issue to (null to unassign)"},priority:{type:"string",enum:["critical","high","medium","low"],description:"New priority level"}},required:["issue_id"]};function Un($,v){$.register({name:"typescape_list_issues",description:"List issues for a review. Supports filtering by status and severity, with offset-based pagination. Returns issues ordered by creation time descending.",inputSchema:_T},c(async(w)=>{let g=w;if(!g.session_id)return e("session_id");let _={};if(g.status!==void 0)_.status=g.status;if(g.severity!==void 0)_.severity=g.severity;if(g.limit!==void 0)_.limit=String(g.limit);if(g.offset!==void 0)_.offset=String(g.offset);let b=await v.get("/issues",{query:{..._,session_id:g.session_id}});return i(b.body,b.requestId)},{operation:"read"})),$.register({name:"typescape_get_issue",description:"Get an issue by ID. Returns the full issue details including anchors, associated threads, and current status.",inputSchema:wT},c(async(w)=>{let g=w;if(!g.issue_id)return e("issue_id");let _=await v.get(`/issues/${encodeURIComponent(g.issue_id)}`);return i(M$(_.body),_.requestId)},{operation:"read"})),$.register({name:"typescape_update_issue",description:"Update an issue's status, assignee, or priority. Only provided fields are changed; omitted fields are left unchanged.",inputSchema:gT},c(async(w)=>{let g=w;if(!g.issue_id)return e("issue_id");let _={};if(g.status!==void 0)_.status=g.status;if(g.assignee!==void 0)_.assignee=g.assignee;if(g.priority!==void 0)_.priority=g.priority;let b=await v.request("PATCH",`/issues/${encodeURIComponent(g.issue_id)}`,{body:_});return i(M$(b.body),b.requestId)},{operation:"write"}))}var Jn=["typescape_list_webhooks","typescape_create_webhook","typescape_delete_webhook"],bT={type:"object",properties:{status:{type:"string",description:"Filter by webhook status. One of: active, paused, disabled."},limit:{type:"integer",description:"Maximum number of results to return (default 25)."}},required:[]},UT={type:"object",properties:{url:{type:"string",description:"The HTTPS URL to deliver webhook events to."},events:{type:"array",items:{type:"string"},description:'Array of event types to subscribe to (e.g., ["review.created", "thread.resolved"]).'},description:{type:"string",description:"Optional human-readable description of the webhook."}},required:["url","events"]},JT={type:"object",properties:{webhook_id:{type:"string",description:"The webhook subscription ID to delete."}},required:["webhook_id"]};function Dn($,v){$.register({name:"typescape_list_webhooks",description:"List webhook subscriptions for the current tenant. Use this to audit which external systems receive event notifications and verify delivery targets before creating new subscriptions. Returns subscription details including URL, events, and status.",inputSchema:bT},c(async(w)=>{let g=w,_=new URLSearchParams;if(g.status)_.set("status",g.status);if(g.limit)_.set("limit",String(g.limit));let b=_.toString(),J=b?`/webhooks?${b}`:"/webhooks",D=await v.get(J);return i(D.body,D.requestId)},{operation:"read"})),$.register({name:"typescape_create_webhook",description:"Create a new webhook subscription to receive event notifications at an HTTPS endpoint. Common events include review.created, thread.resolved, and check_run.completed. Use this to integrate Typescape with external CI/CD pipelines or notification systems.",inputSchema:UT},c(async(w)=>{let g=w;if(!g.url)return e("url");if(!g.events||g.events.length===0)return O(new L(400,"missing_param","Missing required parameter: events (must be a non-empty array)","local"));let _=await v.post("/webhooks",{body:{url:g.url,events:g.events,description:g.description}});return i(_.body,_.requestId)},{operation:"write"})),$.register({name:"typescape_delete_webhook",description:"Delete a webhook subscription by ID, permanently stopping all deliveries to the target URL. Use typescape_list_webhooks first to find the subscription ID. This action cannot be undone.",inputSchema:JT},c(async(w)=>{let g=w;if(!g.webhook_id)return e("webhook_id");let _=await v.request("DELETE",`/webhooks/${encodeURIComponent(g.webhook_id)}`,{});return i({deleted:!0,webhook_id:g.webhook_id},_.requestId)},{operation:"write"}))}var Xn=["typescape_list_events"],DT={type:"object",properties:{review_id:{type:"string",description:"Review ID to list events for."},cursor:{type:"string",description:"Pagination cursor from a previous response. Events after this cursor are returned."},limit:{type:"integer",description:"Maximum number of events to return (default 50)."}},required:["review_id"]};function Gn($,v){$.register({name:"typescape_list_events",description:"List timeline events for a review. Use this to monitor review activity without re-fetching full review data. Returns an ordered list of events (comments, thread changes, status changes, check completions) with cursor-based pagination. Pass the cursor from the previous response for efficient incremental polling.",inputSchema:DT},c(async(w)=>{let g=w;if(!g.review_id)return e("review_id");let _=new URLSearchParams;if(g.cursor)_.set("cursor",g.cursor);if(g.limit)_.set("limit",String(g.limit));let b=_.toString(),J=`/reviews/${encodeURIComponent(g.review_id)}/events${b?`?${b}`:""}`,D=await v.get(J);return i(D.body,D.requestId)},{operation:"read"}))}var Yn=`---
178
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let J of $.seen.entries()){let D=J[1];if(v===J[0]){b(J);continue}if($.external){let G=$.external.registry.get(J[0])?.id;if(v!==J[0]&&G){b(J);continue}}if($.metadataRegistry.get(J[0])?.id){b(J);continue}if(D.cycle){b(J);continue}if(D.count>1){if($.reused==="ref"){b(J);continue}}}}function Y_($,v){let w=$.seen.get(v);if(!w)throw Error("Unprocessed schema. This is a bug in Zod.");let g=(J)=>{let D=$.seen.get(J);if(D.ref===null)return;let X=D.def??D.schema,G={...X},Y=D.ref;if(D.ref=null,Y){g(Y);let W=$.seen.get(Y),I=W.schema;if(I.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))X.allOf=X.allOf??[],X.allOf.push(I);else Object.assign(X,I);if(Object.assign(X,G),J._zod.parent===Y)for(let q in X){if(q==="$ref"||q==="allOf")continue;if(!(q in G))delete X[q]}if(I.$ref)for(let q in X){if(q==="$ref"||q==="allOf")continue;if(q in W.def&&JSON.stringify(X[q])===JSON.stringify(W.def[q]))delete X[q]}}let Q=J._zod.parent;if(Q&&Q!==Y){g(Q);let W=$.seen.get(Q);if(W?.schema.$ref){if(X.$ref=W.schema.$ref,W.def)for(let I in X){if(I==="$ref"||I==="allOf")continue;if(I in W.def&&JSON.stringify(X[I])===JSON.stringify(W.def[I]))delete X[I]}}}$.override({zodSchema:J,jsonSchema:X,path:D.path??[]})};for(let J of[...$.seen.entries()].reverse())g(J[0]);let _={};if($.target==="draft-2020-12")_.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")_.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")_.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let J=$.external.registry.get(v)?.id;if(!J)throw Error("Schema is missing an `id` property");_.$id=$.external.uri(J)}Object.assign(_,w.def??w.schema);let b=$.external?.defs??{};for(let J of $.seen.entries()){let D=J[1];if(D.def&&D.defId)b[D.defId]=D.def}if($.external);else if(Object.keys(b).length>0)if($.target==="draft-2020-12")_.$defs=b;else _.definitions=b;try{let J=JSON.parse(JSON.stringify(_));return Object.defineProperty(J,"~standard",{value:{...v["~standard"],jsonSchema:{input:Mw(v,"input",$.processors),output:Mw(v,"output",$.processors)}},enumerable:!1,writable:!1}),J}catch(J){throw Error("Error converting schema to JSON.")}}function f$($,v){let w=v??{seen:new Set};if(w.seen.has($))return!1;w.seen.add($);let g=$._zod.def;if(g.type==="transform")return!0;if(g.type==="array")return f$(g.element,w);if(g.type==="set")return f$(g.valueType,w);if(g.type==="lazy")return f$(g.getter(),w);if(g.type==="promise"||g.type==="optional"||g.type==="nonoptional"||g.type==="nullable"||g.type==="readonly"||g.type==="default"||g.type==="prefault")return f$(g.innerType,w);if(g.type==="intersection")return f$(g.left,w)||f$(g.right,w);if(g.type==="record"||g.type==="map")return f$(g.keyType,w)||f$(g.valueType,w);if(g.type==="pipe")return f$(g.in,w)||f$(g.out,w);if(g.type==="object"){for(let _ in g.shape)if(f$(g.shape[_],w))return!0;return!1}if(g.type==="union"){for(let _ of g.options)if(f$(_,w))return!0;return!1}if(g.type==="tuple"){for(let _ of g.items)if(f$(_,w))return!0;if(g.rest&&f$(g.rest,w))return!0;return!1}return!1}var EJ=($,v={})=>(w)=>{let g=X_({...w,processors:v});return U$($,g),G_(g,$),Y_(g,$)},Mw=($,v,w={})=>(g)=>{let{libraryOptions:_,target:b}=g??{},J=X_({..._??{},target:b,io:v,processors:w});return U$($,J),G_(J,$),Y_(J,$)};var wL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ZJ=($,v,w,g)=>{let _=w;_.type="string";let{minimum:b,maximum:J,format:D,patterns:X,contentEncoding:G}=$._zod.bag;if(typeof b==="number")_.minLength=b;if(typeof J==="number")_.maxLength=J;if(D){if(_.format=wL[D]??D,_.format==="")delete _.format;if(D==="time")delete _.format}if(G)_.contentEncoding=G;if(X&&X.size>0){let Y=[...X];if(Y.length===1)_.pattern=Y[0].source;else if(Y.length>1)_.allOf=[...Y.map((Q)=>({...v.target==="draft-07"||v.target==="draft-04"||v.target==="openapi-3.0"?{type:"string"}:{},pattern:Q.source}))]}},hJ=($,v,w,g)=>{let _=w,{minimum:b,maximum:J,format:D,multipleOf:X,exclusiveMaximum:G,exclusiveMinimum:Y}=$._zod.bag;if(typeof D==="string"&&D.includes("int"))_.type="integer";else _.type="number";if(typeof Y==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")_.minimum=Y,_.exclusiveMinimum=!0;else _.exclusiveMinimum=Y;if(typeof b==="number"){if(_.minimum=b,typeof Y==="number"&&v.target!=="draft-04")if(Y>=b)delete _.minimum;else delete _.exclusiveMinimum}if(typeof G==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")_.maximum=G,_.exclusiveMaximum=!0;else _.exclusiveMaximum=G;if(typeof J==="number"){if(_.maximum=J,typeof G==="number"&&v.target!=="draft-04")if(G<=J)delete _.maximum;else delete _.exclusiveMaximum}if(typeof X==="number")_.multipleOf=X},xJ=($,v,w,g)=>{w.type="boolean"},lJ=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},cJ=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},yJ=($,v,w,g)=>{if(v.target==="openapi-3.0")w.type="string",w.nullable=!0,w.enum=[null];else w.type="null"},mJ=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},rJ=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},oJ=($,v,w,g)=>{w.not={}},dJ=($,v,w,g)=>{},tJ=($,v,w,g)=>{},pJ=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},eJ=($,v,w,g)=>{let _=$._zod.def,b=Hw(_.entries);if(b.every((J)=>typeof J==="number"))w.type="number";if(b.every((J)=>typeof J==="string"))w.type="string";w.enum=b},aJ=($,v,w,g)=>{let _=$._zod.def,b=[];for(let J of _.values)if(J===void 0){if(v.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof J==="bigint")if(v.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else b.push(Number(J));else b.push(J);if(b.length===0);else if(b.length===1){let J=b[0];if(w.type=J===null?"null":typeof J,v.target==="draft-04"||v.target==="openapi-3.0")w.enum=[J];else w.const=J}else{if(b.every((J)=>typeof J==="number"))w.type="number";if(b.every((J)=>typeof J==="string"))w.type="string";if(b.every((J)=>typeof J==="boolean"))w.type="boolean";if(b.every((J)=>J===null))w.type="null";w.enum=b}},sJ=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},$D=($,v,w,g)=>{let _=w,b=$._zod.pattern;if(!b)throw Error("Pattern not found in template literal");_.type="string",_.pattern=b.source},vD=($,v,w,g)=>{let _=w,b={type:"string",format:"binary",contentEncoding:"binary"},{minimum:J,maximum:D,mime:X}=$._zod.bag;if(J!==void 0)b.minLength=J;if(D!==void 0)b.maxLength=D;if(X)if(X.length===1)b.contentMediaType=X[0],Object.assign(_,b);else Object.assign(_,b),_.anyOf=X.map((G)=>({contentMediaType:G}));else Object.assign(_,b)},_D=($,v,w,g)=>{w.type="boolean"},wD=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},gD=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},bD=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},UD=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},JD=($,v,w,g)=>{if(v.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},DD=($,v,w,g)=>{let _=w,b=$._zod.def,{minimum:J,maximum:D}=$._zod.bag;if(typeof J==="number")_.minItems=J;if(typeof D==="number")_.maxItems=D;_.type="array",_.items=U$(b.element,v,{...g,path:[...g.path,"items"]})},XD=($,v,w,g)=>{let _=w,b=$._zod.def;_.type="object",_.properties={};let J=b.shape;for(let G in J)_.properties[G]=U$(J[G],v,{...g,path:[...g.path,"properties",G]});let D=new Set(Object.keys(J)),X=new Set([...D].filter((G)=>{let Y=b.shape[G]._zod;if(v.io==="input")return Y.optin===void 0;else return Y.optout===void 0}));if(X.size>0)_.required=Array.from(X);if(b.catchall?._zod.def.type==="never")_.additionalProperties=!1;else if(!b.catchall){if(v.io==="output")_.additionalProperties=!1}else if(b.catchall)_.additionalProperties=U$(b.catchall,v,{...g,path:[...g.path,"additionalProperties"]})},eb=($,v,w,g)=>{let _=$._zod.def,b=_.inclusive===!1,J=_.options.map((D,X)=>U$(D,v,{...g,path:[...g.path,b?"oneOf":"anyOf",X]}));if(b)w.oneOf=J;else w.anyOf=J},GD=($,v,w,g)=>{let _=$._zod.def,b=U$(_.left,v,{...g,path:[...g.path,"allOf",0]}),J=U$(_.right,v,{...g,path:[...g.path,"allOf",1]}),D=(G)=>("allOf"in G)&&Object.keys(G).length===1,X=[...D(b)?b.allOf:[b],...D(J)?J.allOf:[J]];w.allOf=X},YD=($,v,w,g)=>{let _=w,b=$._zod.def;_.type="array";let J=v.target==="draft-2020-12"?"prefixItems":"items",D=v.target==="draft-2020-12"?"items":v.target==="openapi-3.0"?"items":"additionalItems",X=b.items.map((W,I)=>U$(W,v,{...g,path:[...g.path,J,I]})),G=b.rest?U$(b.rest,v,{...g,path:[...g.path,D,...v.target==="openapi-3.0"?[b.items.length]:[]]}):null;if(v.target==="draft-2020-12"){if(_.prefixItems=X,G)_.items=G}else if(v.target==="openapi-3.0"){if(_.items={anyOf:X},G)_.items.anyOf.push(G);if(_.minItems=X.length,!G)_.maxItems=X.length}else if(_.items=X,G)_.additionalItems=G;let{minimum:Y,maximum:Q}=$._zod.bag;if(typeof Y==="number")_.minItems=Y;if(typeof Q==="number")_.maxItems=Q},QD=($,v,w,g)=>{let _=w,b=$._zod.def;if(_.type="object",v.target==="draft-07"||v.target==="draft-2020-12")_.propertyNames=U$(b.keyType,v,{...g,path:[...g.path,"propertyNames"]});_.additionalProperties=U$(b.valueType,v,{...g,path:[...g.path,"additionalProperties"]});let J=b.keyType._zod.def;if(J.type==="enum"){let X=Hw(J.entries).filter((G)=>typeof G==="string"||typeof G==="number");if(X.length>0)_.required=X}},WD=($,v,w,g)=>{let _=$._zod.def,b=U$(_.innerType,v,g),J=v.seen.get($);if(v.target==="openapi-3.0")J.ref=_.innerType,w.nullable=!0;else w.anyOf=[b,{type:"null"}]},HD=($,v,w,g)=>{let _=$._zod.def;U$(_.innerType,v,g);let b=v.seen.get($);b.ref=_.innerType},qD=($,v,w,g)=>{let _=$._zod.def;U$(_.innerType,v,g);let b=v.seen.get($);b.ref=_.innerType,w.default=JSON.parse(JSON.stringify(_.defaultValue))},ID=($,v,w,g)=>{let _=$._zod.def;U$(_.innerType,v,g);let b=v.seen.get($);if(b.ref=_.innerType,v.io==="input")w._prefault=JSON.parse(JSON.stringify(_.defaultValue))},BD=($,v,w,g)=>{let _=$._zod.def;U$(_.innerType,v,g);let b=v.seen.get($);b.ref=_.innerType;let J;try{J=_.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}w.default=J},LD=($,v,w,g)=>{let _=$._zod.def,b=v.io==="input"?_.in._zod.def.type==="transform"?_.out:_.in:_.out;U$(b,v,g);let J=v.seen.get($);J.ref=b},VD=($,v,w,g)=>{let _=$._zod.def;U$(_.innerType,v,g);let b=v.seen.get($);b.ref=_.innerType,w.readOnly=!0},jD=($,v,w,g)=>{let _=$._zod.def;U$(_.innerType,v,g);let b=v.seen.get($);b.ref=_.innerType},ab=($,v,w,g)=>{let _=$._zod.def;U$(_.innerType,v,g);let b=v.seen.get($);b.ref=_.innerType},FD=($,v,w,g)=>{let _=$._zod.innerType;U$(_,v,g);let b=v.seen.get($);b.ref=_},pb={string:ZJ,number:hJ,boolean:xJ,bigint:lJ,symbol:cJ,null:yJ,undefined:mJ,void:rJ,never:oJ,any:dJ,unknown:tJ,date:pJ,enum:eJ,literal:aJ,nan:sJ,template_literal:$D,file:vD,success:_D,custom:wD,function:gD,transform:bD,map:UD,set:JD,array:DD,object:XD,union:eb,intersection:GD,tuple:YD,record:QD,nullable:WD,nonoptional:HD,default:qD,prefault:ID,catch:BD,pipe:LD,readonly:VD,promise:jD,optional:ab,lazy:FD};function fw($,v){if("_idmap"in $){let g=$,_=X_({...v,processors:pb}),b={};for(let X of g._idmap.entries()){let[G,Y]=X;U$(Y,_)}let J={},D={registry:g,uri:v?.uri,defs:b};_.external=D;for(let X of g._idmap.entries()){let[G,Y]=X;G_(_,Y),J[G]=Y_(_,Y)}if(Object.keys(b).length>0){let X=_.target==="draft-2020-12"?"$defs":"definitions";J.__shared={[X]:b}}return{schemas:J}}let w=X_({...v,processors:pb});return U$($,w),G_(w,$),Y_(w,$)}class KD{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($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";this.ctx=X_({processors:pb,target:v,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,v={path:[],schemaPath:[]}){return U$($,this.ctx,v)}emit($,v){if(v){if(v.cycles)this.ctx.cycles=v.cycles;if(v.reused)this.ctx.reused=v.reused;if(v.external)this.ctx.external=v.external}G_(this.ctx,$);let w=Y_(this.ctx,$),{"~standard":g,..._}=w;return _}}var hG={};var W4={};$v(W4,{xor:()=>c1,xid:()=>W1,void:()=>E1,uuidv7:()=>b1,uuidv6:()=>g1,uuidv4:()=>w1,uuid:()=>_1,url:()=>U1,unknown:()=>z$,union:()=>fv,undefined:()=>R1,ulid:()=>Q1,uint64:()=>T1,uint32:()=>M1,tuple:()=>o_,transform:()=>w6,templateLiteral:()=>$0,symbol:()=>u1,superRefine:()=>Qg,success:()=>e1,stringbool:()=>D0,stringFormat:()=>N1,string:()=>K,strictObject:()=>x1,set:()=>o1,refine:()=>Yg,record:()=>Lv,readonly:()=>bg,promise:()=>v0,preprocess:()=>G0,prefault:()=>a4,pipe:()=>l_,partialRecord:()=>y1,optional:()=>h_,object:()=>f,number:()=>W$,nullish:()=>p1,nullable:()=>x_,null:()=>A4,nonoptional:()=>s4,never:()=>_6,nativeEnum:()=>d1,nanoid:()=>X1,nan:()=>a1,meta:()=>U0,map:()=>r1,mac:()=>I1,looseRecord:()=>m1,looseObject:()=>l1,literal:()=>q$,lazy:()=>Dg,ksuid:()=>H1,keyof:()=>h1,jwt:()=>O1,json:()=>X0,ipv6:()=>B1,ipv4:()=>q1,intersection:()=>Z4,int64:()=>S1,int32:()=>A1,int:()=>Cw,instanceof:()=>J0,httpUrl:()=>J1,hostname:()=>k1,hex:()=>z1,hash:()=>i1,guid:()=>v1,function:()=>_0,float64:()=>P1,float32:()=>n1,file:()=>t1,exactOptional:()=>o4,enum:()=>v$,emoji:()=>D1,email:()=>$1,e164:()=>K1,discriminatedUnion:()=>Sv,describe:()=>b0,date:()=>Z1,custom:()=>g0,cuid2:()=>Y1,cuid:()=>G1,codec:()=>s1,cidrv6:()=>V1,cidrv4:()=>L1,check:()=>w0,catch:()=>_g,boolean:()=>Y$,bigint:()=>f1,base64url:()=>F1,base64:()=>j1,array:()=>g$,any:()=>C1,_function:()=>_0,_default:()=>p4,_ZodString:()=>Ew,ZodXor:()=>R4,ZodXID:()=>mw,ZodVoid:()=>T4,ZodUnknown:()=>f4,ZodUnion:()=>r_,ZodUndefined:()=>n4,ZodUUID:()=>t$,ZodURL:()=>c_,ZodULID:()=>yw,ZodType:()=>t,ZodTuple:()=>h4,ZodTransform:()=>m4,ZodTemplateLiteral:()=>Ug,ZodSymbol:()=>i4,ZodSuccess:()=>$g,ZodStringFormat:()=>b$,ZodString:()=>H_,ZodSet:()=>l4,ZodRecord:()=>d_,ZodReadonly:()=>gg,ZodPromise:()=>Xg,ZodPrefault:()=>e4,ZodPipe:()=>U6,ZodOptional:()=>g6,ZodObject:()=>m_,ZodNumberFormat:()=>Mv,ZodNumber:()=>I_,ZodNullable:()=>d4,ZodNull:()=>P4,ZodNonOptional:()=>b6,ZodNever:()=>S4,ZodNanoID:()=>xw,ZodNaN:()=>wg,ZodMap:()=>x4,ZodMAC:()=>z4,ZodLiteral:()=>c4,ZodLazy:()=>Jg,ZodKSUID:()=>rw,ZodJWT:()=>$6,ZodIntersection:()=>E4,ZodIPv6:()=>dw,ZodIPv4:()=>ow,ZodGUID:()=>Z_,ZodFunction:()=>Gg,ZodFile:()=>y4,ZodExactOptional:()=>r4,ZodEnum:()=>W_,ZodEmoji:()=>hw,ZodEmail:()=>Zw,ZodE164:()=>sw,ZodDiscriminatedUnion:()=>C4,ZodDefault:()=>t4,ZodDate:()=>y_,ZodCustomStringFormat:()=>q_,ZodCustom:()=>t_,ZodCodec:()=>J6,ZodCatch:()=>vg,ZodCUID2:()=>cw,ZodCUID:()=>lw,ZodCIDRv6:()=>pw,ZodCIDRv4:()=>tw,ZodBoolean:()=>B_,ZodBigIntFormat:()=>v6,ZodBigInt:()=>L_,ZodBase64URL:()=>aw,ZodBase64:()=>ew,ZodArray:()=>u4,ZodAny:()=>M4});var sb={};$v(sb,{uppercase:()=>sv,trim:()=>b_,toUpperCase:()=>J_,toLowerCase:()=>U_,startsWith:()=>v_,slugify:()=>D_,size:()=>nv,regex:()=>ev,property:()=>Pw,positive:()=>kw,overwrite:()=>l$,normalize:()=>g_,nonpositive:()=>iw,nonnegative:()=>nw,negative:()=>zw,multipleOf:()=>Iv,minSize:()=>d$,minLength:()=>vv,mime:()=>w_,maxSize:()=>Bv,maxLength:()=>Pv,lte:()=>M$,lt:()=>r$,lowercase:()=>av,length:()=>Av,includes:()=>$_,gte:()=>k$,gt:()=>o$,endsWith:()=>__});var Q_={};$v(Q_,{time:()=>kD,duration:()=>zD,datetime:()=>OD,date:()=>ND,ZodISOTime:()=>uw,ZodISODuration:()=>Rw,ZodISODateTime:()=>Sw,ZodISODate:()=>Tw});var Sw=V("ZodISODateTime",($,v)=>{X3.init($,v),b$.init($,v)});function OD($){return wJ(Sw,$)}var Tw=V("ZodISODate",($,v)=>{G3.init($,v),b$.init($,v)});function ND($){return gJ(Tw,$)}var uw=V("ZodISOTime",($,v)=>{Y3.init($,v),b$.init($,v)});function kD($){return bJ(uw,$)}var Rw=V("ZodISODuration",($,v)=>{Q3.init($,v),b$.init($,v)});function zD($){return UJ(Rw,$)}var xG=($,v)=>{t6.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(w)=>u_($,w)},flatten:{value:(w)=>T_($,w)},addIssue:{value:(w)=>{$.issues.push(w),$.message=JSON.stringify($.issues,qw,2)}},addIssues:{value:(w)=>{$.issues.push(...w),$.message=JSON.stringify($.issues,qw,2)}},isEmpty:{get(){return $.issues.length===0}}})},iD=V("ZodError",xG),i$=V("ZodError",xG,{Parent:Error});var H4=Lw(i$),q4=Vw(i$),I4=jw(i$),B4=Fw(i$),L4=Xb(i$),V4=Gb(i$),j4=Yb(i$),F4=Qb(i$),K4=Wb(i$),O4=Hb(i$),N4=qb(i$),k4=Ib(i$);var t=V("ZodType",($,v)=>{return o.init($,v),Object.assign($["~standard"],{jsonSchema:{input:Mw($,"input"),output:Mw($,"output")}}),$.toJSONSchema=EJ($,{}),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.check=(...w)=>{return $.clone(i.mergeDefs(v,{checks:[...v.checks??[],...w.map((g)=>typeof g==="function"?{_zod:{check:g,def:{check:"custom"},onattach:[]}}:g)]}),{parent:!0})},$.with=$.check,$.clone=(w,g)=>N$($,w,g),$.brand=()=>$,$.register=(w,g)=>{return w.add($,g),$},$.parse=(w,g)=>H4($,w,g,{callee:$.parse}),$.safeParse=(w,g)=>I4($,w,g),$.parseAsync=async(w,g)=>q4($,w,g,{callee:$.parseAsync}),$.safeParseAsync=async(w,g)=>B4($,w,g),$.spa=$.safeParseAsync,$.encode=(w,g)=>L4($,w,g),$.decode=(w,g)=>V4($,w,g),$.encodeAsync=async(w,g)=>j4($,w,g),$.decodeAsync=async(w,g)=>F4($,w,g),$.safeEncode=(w,g)=>K4($,w,g),$.safeDecode=(w,g)=>O4($,w,g),$.safeEncodeAsync=async(w,g)=>N4($,w,g),$.safeDecodeAsync=async(w,g)=>k4($,w,g),$.refine=(w,g)=>$.check(Yg(w,g)),$.superRefine=(w)=>$.check(Qg(w)),$.overwrite=(w)=>$.check(l$(w)),$.optional=()=>h_($),$.exactOptional=()=>o4($),$.nullable=()=>x_($),$.nullish=()=>h_(x_($)),$.nonoptional=(w)=>s4($,w),$.array=()=>g$($),$.or=(w)=>fv([$,w]),$.and=(w)=>Z4($,w),$.transform=(w)=>l_($,w6(w)),$.default=(w)=>p4($,w),$.prefault=(w)=>a4($,w),$.catch=(w)=>_g($,w),$.pipe=(w)=>l_($,w),$.readonly=()=>bg($),$.describe=(w)=>{let g=$.clone();return F$.add(g,{description:w}),g},Object.defineProperty($,"description",{get(){return F$.get($)?.description},configurable:!0}),$.meta=(...w)=>{if(w.length===0)return F$.get($);let g=$.clone();return F$.add(g,w[0]),g},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(w)=>w($),$}),Ew=V("_ZodString",($,v)=>{C_.init($,v),t.init($,v),$._zod.processJSONSchema=(g,_,b)=>ZJ($,g,_,b);let w=$._zod.bag;$.format=w.format??null,$.minLength=w.minimum??null,$.maxLength=w.maximum??null,$.regex=(...g)=>$.check(ev(...g)),$.includes=(...g)=>$.check($_(...g)),$.startsWith=(...g)=>$.check(v_(...g)),$.endsWith=(...g)=>$.check(__(...g)),$.min=(...g)=>$.check(vv(...g)),$.max=(...g)=>$.check(Pv(...g)),$.length=(...g)=>$.check(Av(...g)),$.nonempty=(...g)=>$.check(vv(1,...g)),$.lowercase=(g)=>$.check(av(g)),$.uppercase=(g)=>$.check(sv(g)),$.trim=()=>$.check(b_()),$.normalize=(...g)=>$.check(g_(...g)),$.toLowerCase=()=>$.check(U_()),$.toUpperCase=()=>$.check(J_()),$.slugify=()=>$.check(D_())}),H_=V("ZodString",($,v)=>{C_.init($,v),Ew.init($,v),$.email=(w)=>$.check(Ab(Zw,w)),$.url=(w)=>$.check(Y4(c_,w)),$.jwt=(w)=>$.check(tb($6,w)),$.emoji=(w)=>$.check(ub(hw,w)),$.guid=(w)=>$.check(G4(Z_,w)),$.uuid=(w)=>$.check(Mb(t$,w)),$.uuidv4=(w)=>$.check(fb(t$,w)),$.uuidv6=(w)=>$.check(Sb(t$,w)),$.uuidv7=(w)=>$.check(Tb(t$,w)),$.nanoid=(w)=>$.check(Rb(xw,w)),$.guid=(w)=>$.check(G4(Z_,w)),$.cuid=(w)=>$.check(Cb(lw,w)),$.cuid2=(w)=>$.check(Eb(cw,w)),$.ulid=(w)=>$.check(Zb(yw,w)),$.base64=(w)=>$.check(rb(ew,w)),$.base64url=(w)=>$.check(ob(aw,w)),$.xid=(w)=>$.check(hb(mw,w)),$.ksuid=(w)=>$.check(xb(rw,w)),$.ipv4=(w)=>$.check(lb(ow,w)),$.ipv6=(w)=>$.check(cb(dw,w)),$.cidrv4=(w)=>$.check(yb(tw,w)),$.cidrv6=(w)=>$.check(mb(pw,w)),$.e164=(w)=>$.check(db(sw,w)),$.datetime=(w)=>$.check(OD(w)),$.date=(w)=>$.check(ND(w)),$.time=(w)=>$.check(kD(w)),$.duration=(w)=>$.check(zD(w))});function K($){return $J(H_,$)}var b$=V("ZodStringFormat",($,v)=>{D$.init($,v),Ew.init($,v)}),Zw=V("ZodEmail",($,v)=>{$3.init($,v),b$.init($,v)});function $1($){return Ab(Zw,$)}var Z_=V("ZodGUID",($,v)=>{a2.init($,v),b$.init($,v)});function v1($){return G4(Z_,$)}var t$=V("ZodUUID",($,v)=>{s2.init($,v),b$.init($,v)});function _1($){return Mb(t$,$)}function w1($){return fb(t$,$)}function g1($){return Sb(t$,$)}function b1($){return Tb(t$,$)}var c_=V("ZodURL",($,v)=>{v3.init($,v),b$.init($,v)});function U1($){return Y4(c_,$)}function J1($){return Y4(c_,{protocol:/^https?$/,hostname:E$.domain,...i.normalizeParams($)})}var hw=V("ZodEmoji",($,v)=>{_3.init($,v),b$.init($,v)});function D1($){return ub(hw,$)}var xw=V("ZodNanoID",($,v)=>{w3.init($,v),b$.init($,v)});function X1($){return Rb(xw,$)}var lw=V("ZodCUID",($,v)=>{g3.init($,v),b$.init($,v)});function G1($){return Cb(lw,$)}var cw=V("ZodCUID2",($,v)=>{b3.init($,v),b$.init($,v)});function Y1($){return Eb(cw,$)}var yw=V("ZodULID",($,v)=>{U3.init($,v),b$.init($,v)});function Q1($){return Zb(yw,$)}var mw=V("ZodXID",($,v)=>{J3.init($,v),b$.init($,v)});function W1($){return hb(mw,$)}var rw=V("ZodKSUID",($,v)=>{D3.init($,v),b$.init($,v)});function H1($){return xb(rw,$)}var ow=V("ZodIPv4",($,v)=>{W3.init($,v),b$.init($,v)});function q1($){return lb(ow,$)}var z4=V("ZodMAC",($,v)=>{q3.init($,v),b$.init($,v)});function I1($){return _J(z4,$)}var dw=V("ZodIPv6",($,v)=>{H3.init($,v),b$.init($,v)});function B1($){return cb(dw,$)}var tw=V("ZodCIDRv4",($,v)=>{I3.init($,v),b$.init($,v)});function L1($){return yb(tw,$)}var pw=V("ZodCIDRv6",($,v)=>{B3.init($,v),b$.init($,v)});function V1($){return mb(pw,$)}var ew=V("ZodBase64",($,v)=>{V3.init($,v),b$.init($,v)});function j1($){return rb(ew,$)}var aw=V("ZodBase64URL",($,v)=>{j3.init($,v),b$.init($,v)});function F1($){return ob(aw,$)}var sw=V("ZodE164",($,v)=>{F3.init($,v),b$.init($,v)});function K1($){return db(sw,$)}var $6=V("ZodJWT",($,v)=>{K3.init($,v),b$.init($,v)});function O1($){return tb($6,$)}var q_=V("ZodCustomStringFormat",($,v)=>{O3.init($,v),b$.init($,v)});function N1($,v,w={}){return Aw(q_,$,v,w)}function k1($){return Aw(q_,"hostname",E$.hostname,$)}function z1($){return Aw(q_,"hex",E$.hex,$)}function i1($,v){let w=v?.enc??"hex",g=`${$}_${w}`,_=E$[g];if(!_)throw Error(`Unrecognized hash format: ${g}`);return Aw(q_,g,_,v)}var I_=V("ZodNumber",($,v)=>{zb.init($,v),t.init($,v),$._zod.processJSONSchema=(g,_,b)=>hJ($,g,_,b),$.gt=(g,_)=>$.check(o$(g,_)),$.gte=(g,_)=>$.check(k$(g,_)),$.min=(g,_)=>$.check(k$(g,_)),$.lt=(g,_)=>$.check(r$(g,_)),$.lte=(g,_)=>$.check(M$(g,_)),$.max=(g,_)=>$.check(M$(g,_)),$.int=(g)=>$.check(Cw(g)),$.safe=(g)=>$.check(Cw(g)),$.positive=(g)=>$.check(o$(0,g)),$.nonnegative=(g)=>$.check(k$(0,g)),$.negative=(g)=>$.check(r$(0,g)),$.nonpositive=(g)=>$.check(M$(0,g)),$.multipleOf=(g,_)=>$.check(Iv(g,_)),$.step=(g,_)=>$.check(Iv(g,_)),$.finite=()=>$;let w=$._zod.bag;$.minValue=Math.max(w.minimum??Number.NEGATIVE_INFINITY,w.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(w.maximum??Number.POSITIVE_INFINITY,w.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(w.format??"").includes("int")||Number.isSafeInteger(w.multipleOf??0.5),$.isFinite=!0,$.format=w.format??null});function W$($){return JJ(I_,$)}var Mv=V("ZodNumberFormat",($,v)=>{N3.init($,v),I_.init($,v)});function Cw($){return XJ(Mv,$)}function n1($){return GJ(Mv,$)}function P1($){return YJ(Mv,$)}function A1($){return QJ(Mv,$)}function M1($){return WJ(Mv,$)}var B_=V("ZodBoolean",($,v)=>{v4.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>xJ($,w,g,_)});function Y$($){return HJ(B_,$)}var L_=V("ZodBigInt",($,v)=>{ib.init($,v),t.init($,v),$._zod.processJSONSchema=(g,_,b)=>lJ($,g,_,b),$.gte=(g,_)=>$.check(k$(g,_)),$.min=(g,_)=>$.check(k$(g,_)),$.gt=(g,_)=>$.check(o$(g,_)),$.gte=(g,_)=>$.check(k$(g,_)),$.min=(g,_)=>$.check(k$(g,_)),$.lt=(g,_)=>$.check(r$(g,_)),$.lte=(g,_)=>$.check(M$(g,_)),$.max=(g,_)=>$.check(M$(g,_)),$.positive=(g)=>$.check(o$(BigInt(0),g)),$.negative=(g)=>$.check(r$(BigInt(0),g)),$.nonpositive=(g)=>$.check(M$(BigInt(0),g)),$.nonnegative=(g)=>$.check(k$(BigInt(0),g)),$.multipleOf=(g,_)=>$.check(Iv(g,_));let w=$._zod.bag;$.minValue=w.minimum??null,$.maxValue=w.maximum??null,$.format=w.format??null});function f1($){return IJ(L_,$)}var v6=V("ZodBigIntFormat",($,v)=>{k3.init($,v),L_.init($,v)});function S1($){return LJ(v6,$)}function T1($){return VJ(v6,$)}var i4=V("ZodSymbol",($,v)=>{z3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>cJ($,w,g,_)});function u1($){return jJ(i4,$)}var n4=V("ZodUndefined",($,v)=>{i3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>mJ($,w,g,_)});function R1($){return FJ(n4,$)}var P4=V("ZodNull",($,v)=>{n3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>yJ($,w,g,_)});function A4($){return KJ(P4,$)}var M4=V("ZodAny",($,v)=>{P3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>dJ($,w,g,_)});function C1(){return OJ(M4)}var f4=V("ZodUnknown",($,v)=>{A3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>tJ($,w,g,_)});function z$(){return NJ(f4)}var S4=V("ZodNever",($,v)=>{M3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>oJ($,w,g,_)});function _6($){return kJ(S4,$)}var T4=V("ZodVoid",($,v)=>{f3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>rJ($,w,g,_)});function E1($){return zJ(T4,$)}var y_=V("ZodDate",($,v)=>{S3.init($,v),t.init($,v),$._zod.processJSONSchema=(g,_,b)=>pJ($,g,_,b),$.min=(g,_)=>$.check(k$(g,_)),$.max=(g,_)=>$.check(M$(g,_));let w=$._zod.bag;$.minDate=w.minimum?new Date(w.minimum):null,$.maxDate=w.maximum?new Date(w.maximum):null});function Z1($){return iJ(y_,$)}var u4=V("ZodArray",($,v)=>{T3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>DD($,w,g,_),$.element=v.element,$.min=(w,g)=>$.check(vv(w,g)),$.nonempty=(w)=>$.check(vv(1,w)),$.max=(w,g)=>$.check(Pv(w,g)),$.length=(w,g)=>$.check(Av(w,g)),$.unwrap=()=>$.element});function g$($,v){return AJ(u4,$,v)}function h1($){let v=$._zod.def.shape;return v$(Object.keys(v))}var m_=V("ZodObject",($,v)=>{u3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>XD($,w,g,_),i.defineLazy($,"shape",()=>{return v.shape}),$.keyof=()=>v$(Object.keys($._zod.def.shape)),$.catchall=(w)=>$.clone({...$._zod.def,catchall:w}),$.passthrough=()=>$.clone({...$._zod.def,catchall:z$()}),$.loose=()=>$.clone({...$._zod.def,catchall:z$()}),$.strict=()=>$.clone({...$._zod.def,catchall:_6()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(w)=>{return i.extend($,w)},$.safeExtend=(w)=>{return i.safeExtend($,w)},$.merge=(w)=>i.merge($,w),$.pick=(w)=>i.pick($,w),$.omit=(w)=>i.omit($,w),$.partial=(...w)=>i.partial(g6,$,w[0]),$.required=(...w)=>i.required(b6,$,w[0])});function f($,v){let w={type:"object",shape:$??{},...i.normalizeParams(v)};return new m_(w)}function x1($,v){return new m_({type:"object",shape:$,catchall:_6(),...i.normalizeParams(v)})}function l1($,v){return new m_({type:"object",shape:$,catchall:z$(),...i.normalizeParams(v)})}var r_=V("ZodUnion",($,v)=>{_4.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>eb($,w,g,_),$.options=v.options});function fv($,v){return new r_({type:"union",options:$,...i.normalizeParams(v)})}var R4=V("ZodXor",($,v)=>{r_.init($,v),R3.init($,v),$._zod.processJSONSchema=(w,g,_)=>eb($,w,g,_),$.options=v.options});function c1($,v){return new R4({type:"union",options:$,inclusive:!1,...i.normalizeParams(v)})}var C4=V("ZodDiscriminatedUnion",($,v)=>{r_.init($,v),C3.init($,v)});function Sv($,v,w){return new C4({type:"union",options:v,discriminator:$,...i.normalizeParams(w)})}var E4=V("ZodIntersection",($,v)=>{E3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>GD($,w,g,_)});function Z4($,v){return new E4({type:"intersection",left:$,right:v})}var h4=V("ZodTuple",($,v)=>{nb.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>YD($,w,g,_),$.rest=(w)=>$.clone({...$._zod.def,rest:w})});function o_($,v,w){let g=v instanceof o,_=g?w:v;return new h4({type:"tuple",items:$,rest:g?v:null,...i.normalizeParams(_)})}var d_=V("ZodRecord",($,v)=>{Z3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>QD($,w,g,_),$.keyType=v.keyType,$.valueType=v.valueType});function Lv($,v,w){return new d_({type:"record",keyType:$,valueType:v,...i.normalizeParams(w)})}function y1($,v,w){let g=N$($);return g._zod.values=void 0,new d_({type:"record",keyType:g,valueType:v,...i.normalizeParams(w)})}function m1($,v,w){return new d_({type:"record",keyType:$,valueType:v,mode:"loose",...i.normalizeParams(w)})}var x4=V("ZodMap",($,v)=>{h3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>UD($,w,g,_),$.keyType=v.keyType,$.valueType=v.valueType,$.min=(...w)=>$.check(d$(...w)),$.nonempty=(w)=>$.check(d$(1,w)),$.max=(...w)=>$.check(Bv(...w)),$.size=(...w)=>$.check(nv(...w))});function r1($,v,w){return new x4({type:"map",keyType:$,valueType:v,...i.normalizeParams(w)})}var l4=V("ZodSet",($,v)=>{x3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>JD($,w,g,_),$.min=(...w)=>$.check(d$(...w)),$.nonempty=(w)=>$.check(d$(1,w)),$.max=(...w)=>$.check(Bv(...w)),$.size=(...w)=>$.check(nv(...w))});function o1($,v){return new l4({type:"set",valueType:$,...i.normalizeParams(v)})}var W_=V("ZodEnum",($,v)=>{l3.init($,v),t.init($,v),$._zod.processJSONSchema=(g,_,b)=>eJ($,g,_,b),$.enum=v.entries,$.options=Object.values(v.entries);let w=new Set(Object.keys(v.entries));$.extract=(g,_)=>{let b={};for(let J of g)if(w.has(J))b[J]=v.entries[J];else throw Error(`Key ${J} not found in enum`);return new W_({...v,checks:[],...i.normalizeParams(_),entries:b})},$.exclude=(g,_)=>{let b={...v.entries};for(let J of g)if(w.has(J))delete b[J];else throw Error(`Key ${J} not found in enum`);return new W_({...v,checks:[],...i.normalizeParams(_),entries:b})}});function v$($,v){let w=Array.isArray($)?Object.fromEntries($.map((g)=>[g,g])):$;return new W_({type:"enum",entries:w,...i.normalizeParams(v)})}function d1($,v){return new W_({type:"enum",entries:$,...i.normalizeParams(v)})}var c4=V("ZodLiteral",($,v)=>{c3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>aJ($,w,g,_),$.values=new Set(v.values),Object.defineProperty($,"value",{get(){if(v.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return v.values[0]}})});function q$($,v){return new c4({type:"literal",values:Array.isArray($)?$:[$],...i.normalizeParams(v)})}var y4=V("ZodFile",($,v)=>{y3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>vD($,w,g,_),$.min=(w,g)=>$.check(d$(w,g)),$.max=(w,g)=>$.check(Bv(w,g)),$.mime=(w,g)=>$.check(w_(Array.isArray(w)?w:[w],g))});function t1($){return MJ(y4,$)}var m4=V("ZodTransform",($,v)=>{m3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>bD($,w,g,_),$._zod.parse=(w,g)=>{if(g.direction==="backward")throw new f_($.constructor.name);w.addIssue=(b)=>{if(typeof b==="string")w.issues.push(i.issue(b,w.value,v));else{let J=b;if(J.fatal)J.continue=!1;J.code??(J.code="custom"),J.input??(J.input=w.value),J.inst??(J.inst=$),w.issues.push(i.issue(J))}};let _=v.transform(w.value,w);if(_ instanceof Promise)return _.then((b)=>{return w.value=b,w});return w.value=_,w}});function w6($){return new m4({type:"transform",transform:$})}var g6=V("ZodOptional",($,v)=>{Pb.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>ab($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function h_($){return new g6({type:"optional",innerType:$})}var r4=V("ZodExactOptional",($,v)=>{r3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>ab($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function o4($){return new r4({type:"optional",innerType:$})}var d4=V("ZodNullable",($,v)=>{o3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>WD($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function x_($){return new d4({type:"nullable",innerType:$})}function p1($){return h_(x_($))}var t4=V("ZodDefault",($,v)=>{d3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>qD($,w,g,_),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function p4($,v){return new t4({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():i.shallowClone(v)}})}var e4=V("ZodPrefault",($,v)=>{t3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>ID($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function a4($,v){return new e4({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():i.shallowClone(v)}})}var b6=V("ZodNonOptional",($,v)=>{p3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>HD($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function s4($,v){return new b6({type:"nonoptional",innerType:$,...i.normalizeParams(v)})}var $g=V("ZodSuccess",($,v)=>{e3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>_D($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function e1($){return new $g({type:"success",innerType:$})}var vg=V("ZodCatch",($,v)=>{a3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>BD($,w,g,_),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function _g($,v){return new vg({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}var wg=V("ZodNaN",($,v)=>{s3.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>sJ($,w,g,_)});function a1($){return PJ(wg,$)}var U6=V("ZodPipe",($,v)=>{$9.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>LD($,w,g,_),$.in=v.in,$.out=v.out});function l_($,v){return new U6({type:"pipe",in:$,out:v})}var J6=V("ZodCodec",($,v)=>{U6.init($,v),w4.init($,v)});function s1($,v,w){return new J6({type:"pipe",in:$,out:v,transform:w.decode,reverseTransform:w.encode})}var gg=V("ZodReadonly",($,v)=>{v9.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>VD($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function bg($){return new gg({type:"readonly",innerType:$})}var Ug=V("ZodTemplateLiteral",($,v)=>{_9.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>$D($,w,g,_)});function $0($,v){return new Ug({type:"template_literal",parts:$,...i.normalizeParams(v)})}var Jg=V("ZodLazy",($,v)=>{b9.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>FD($,w,g,_),$.unwrap=()=>$._zod.def.getter()});function Dg($){return new Jg({type:"lazy",getter:$})}var Xg=V("ZodPromise",($,v)=>{g9.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>jD($,w,g,_),$.unwrap=()=>$._zod.def.innerType});function v0($){return new Xg({type:"promise",innerType:$})}var Gg=V("ZodFunction",($,v)=>{w9.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>gD($,w,g,_)});function _0($){return new Gg({type:"function",input:Array.isArray($?.input)?o_($?.input):$?.input??g$(z$()),output:$?.output??z$()})}var t_=V("ZodCustom",($,v)=>{U9.init($,v),t.init($,v),$._zod.processJSONSchema=(w,g,_)=>wD($,w,g,_)});function w0($){let v=new G$({check:"custom"});return v._zod.check=$,v}function g0($,v){return fJ(t_,$??(()=>!0),v)}function Yg($,v={}){return SJ(t_,$,v)}function Qg($){return TJ($)}var b0=uJ,U0=RJ;function J0($,v={}){let w=new t_({type:"custom",check:"custom",fn:(g)=>g instanceof $,abort:!0,...i.normalizeParams(v)});return w._zod.bag.Class=$,w._zod.check=(g)=>{if(!(g.value instanceof $))g.issues.push({code:"invalid_type",expected:$.name,input:g.value,inst:w,path:[...w._zod.def.path??[]]})},w}var D0=(...$)=>CJ({Codec:J6,Boolean:B_,String:H_},...$);function X0($){let v=Dg(()=>{return fv([K($),W$(),Y$(),A4(),g$(v),Lv(K(),v)])});return v}function G0($,v){return l_(w6($),v)}var S$={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"};function nD($){H$({customError:$})}function PD(){return H$().customError}var Wg;(function($){})(Wg||(Wg={}));var u={...W4,...sb,iso:Q_},UL=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"]);function JL($,v){let w=$.$schema;if(w==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(w==="http://json-schema.org/draft-07/schema#")return"draft-7";if(w==="http://json-schema.org/draft-04/schema#")return"draft-4";return v??"draft-2020-12"}function DL($,v){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let w=$.slice(1).split("/").filter(Boolean);if(w.length===0)return v.rootSchema;let g=v.version==="draft-2020-12"?"$defs":"definitions";if(w[0]===g){let _=w[1];if(!_||!v.defs[_])throw Error(`Reference not found: ${$}`);return v.defs[_]}throw Error(`Reference not found: ${$}`)}function lG($,v){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return u.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let _=$.$ref;if(v.refs.has(_))return v.refs.get(_);if(v.processing.has(_))return u.lazy(()=>{if(!v.refs.has(_))throw Error(`Circular reference not resolved: ${_}`);return v.refs.get(_)});v.processing.add(_);let b=DL(_,v),J=n$(b,v);return v.refs.set(_,J),v.processing.delete(_),J}if($.enum!==void 0){let _=$.enum;if(v.version==="openapi-3.0"&&$.nullable===!0&&_.length===1&&_[0]===null)return u.null();if(_.length===0)return u.never();if(_.length===1)return u.literal(_[0]);if(_.every((J)=>typeof J==="string"))return u.enum(_);let b=_.map((J)=>u.literal(J));if(b.length<2)return b[0];return u.union([b[0],b[1],...b.slice(2)])}if($.const!==void 0)return u.literal($.const);let w=$.type;if(Array.isArray(w)){let _=w.map((b)=>{let J={...$,type:b};return lG(J,v)});if(_.length===0)return u.never();if(_.length===1)return _[0];return u.union(_)}if(!w)return u.any();let g;switch(w){case"string":{let _=u.string();if($.format){let b=$.format;if(b==="email")_=_.check(u.email());else if(b==="uri"||b==="uri-reference")_=_.check(u.url());else if(b==="uuid"||b==="guid")_=_.check(u.uuid());else if(b==="date-time")_=_.check(u.iso.datetime());else if(b==="date")_=_.check(u.iso.date());else if(b==="time")_=_.check(u.iso.time());else if(b==="duration")_=_.check(u.iso.duration());else if(b==="ipv4")_=_.check(u.ipv4());else if(b==="ipv6")_=_.check(u.ipv6());else if(b==="mac")_=_.check(u.mac());else if(b==="cidr")_=_.check(u.cidrv4());else if(b==="cidr-v6")_=_.check(u.cidrv6());else if(b==="base64")_=_.check(u.base64());else if(b==="base64url")_=_.check(u.base64url());else if(b==="e164")_=_.check(u.e164());else if(b==="jwt")_=_.check(u.jwt());else if(b==="emoji")_=_.check(u.emoji());else if(b==="nanoid")_=_.check(u.nanoid());else if(b==="cuid")_=_.check(u.cuid());else if(b==="cuid2")_=_.check(u.cuid2());else if(b==="ulid")_=_.check(u.ulid());else if(b==="xid")_=_.check(u.xid());else if(b==="ksuid")_=_.check(u.ksuid())}if(typeof $.minLength==="number")_=_.min($.minLength);if(typeof $.maxLength==="number")_=_.max($.maxLength);if($.pattern)_=_.regex(new RegExp($.pattern));g=_;break}case"number":case"integer":{let _=w==="integer"?u.number().int():u.number();if(typeof $.minimum==="number")_=_.min($.minimum);if(typeof $.maximum==="number")_=_.max($.maximum);if(typeof $.exclusiveMinimum==="number")_=_.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")_=_.gt($.minimum);if(typeof $.exclusiveMaximum==="number")_=_.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")_=_.lt($.maximum);if(typeof $.multipleOf==="number")_=_.multipleOf($.multipleOf);g=_;break}case"boolean":{g=u.boolean();break}case"null":{g=u.null();break}case"object":{let _={},b=$.properties||{},J=new Set($.required||[]);for(let[X,G]of Object.entries(b)){let Y=n$(G,v);_[X]=J.has(X)?Y:Y.optional()}if($.propertyNames){let X=n$($.propertyNames,v),G=$.additionalProperties&&typeof $.additionalProperties==="object"?n$($.additionalProperties,v):u.any();if(Object.keys(_).length===0){g=u.record(X,G);break}let Y=u.object(_).passthrough(),Q=u.looseRecord(X,G);g=u.intersection(Y,Q);break}if($.patternProperties){let X=$.patternProperties,G=Object.keys(X),Y=[];for(let W of G){let I=n$(X[W],v),H=u.string().regex(new RegExp(W));Y.push(u.looseRecord(H,I))}let Q=[];if(Object.keys(_).length>0)Q.push(u.object(_).passthrough());if(Q.push(...Y),Q.length===0)g=u.object({}).passthrough();else if(Q.length===1)g=Q[0];else{let W=u.intersection(Q[0],Q[1]);for(let I=2;I<Q.length;I++)W=u.intersection(W,Q[I]);g=W}break}let D=u.object(_);if($.additionalProperties===!1)g=D.strict();else if(typeof $.additionalProperties==="object")g=D.catchall(n$($.additionalProperties,v));else g=D.passthrough();break}case"array":{let{prefixItems:_,items:b}=$;if(_&&Array.isArray(_)){let J=_.map((X)=>n$(X,v)),D=b&&typeof b==="object"&&!Array.isArray(b)?n$(b,v):void 0;if(D)g=u.tuple(J).rest(D);else g=u.tuple(J);if(typeof $.minItems==="number")g=g.check(u.minLength($.minItems));if(typeof $.maxItems==="number")g=g.check(u.maxLength($.maxItems))}else if(Array.isArray(b)){let J=b.map((X)=>n$(X,v)),D=$.additionalItems&&typeof $.additionalItems==="object"?n$($.additionalItems,v):void 0;if(D)g=u.tuple(J).rest(D);else g=u.tuple(J);if(typeof $.minItems==="number")g=g.check(u.minLength($.minItems));if(typeof $.maxItems==="number")g=g.check(u.maxLength($.maxItems))}else if(b!==void 0){let J=n$(b,v),D=u.array(J);if(typeof $.minItems==="number")D=D.min($.minItems);if(typeof $.maxItems==="number")D=D.max($.maxItems);g=D}else g=u.array(u.any());break}default:throw Error(`Unsupported type: ${w}`)}if($.description)g=g.describe($.description);if($.default!==void 0)g=g.default($.default);return g}function n$($,v){if(typeof $==="boolean")return $?u.any():u.never();let w=lG($,v),g=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let D=$.anyOf.map((G)=>n$(G,v)),X=u.union(D);w=g?u.intersection(w,X):X}if($.oneOf&&Array.isArray($.oneOf)){let D=$.oneOf.map((G)=>n$(G,v)),X=u.xor(D);w=g?u.intersection(w,X):X}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)w=g?w:u.any();else{let D=g?w:n$($.allOf[0],v),X=g?0:1;for(let G=X;G<$.allOf.length;G++)D=u.intersection(D,n$($.allOf[G],v));w=D}if($.nullable===!0&&v.version==="openapi-3.0")w=u.nullable(w);if($.readOnly===!0)w=u.readonly(w);let _={},b=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let D of b)if(D in $)_[D]=$[D];let J=["contentEncoding","contentMediaType","contentSchema"];for(let D of J)if(D in $)_[D]=$[D];for(let D of Object.keys($))if(!UL.has(D))_[D]=$[D];if(Object.keys(_).length>0)v.registry.add(w,_);return w}function Y0($,v){if(typeof $==="boolean")return $?u.any():u.never();let w=JL($,v?.defaultTarget),g=$.$defs||$.definitions||{},_={version:w,defs:g,refs:new Map,processing:new Set,rootSchema:$,registry:v?.registry??F$};return n$($,_)}var wv={};$v(wv,{string:()=>XL,number:()=>GL,date:()=>WL,boolean:()=>YL,bigint:()=>QL});function XL($){return vJ(H_,$)}function GL($){return DJ(I_,$)}function YL($){return qJ(B_,$)}function QL($){return BJ(L_,$)}function WL($){return nJ(y_,$)}H$(g4());var HL=D6;var cG=D6??AD;if(typeof cG.object!=="function")throw Error("Failed to resolve Zod namespace");var d=cG;var yG=f({code:K(),message:K(),retryable:Y$(),details:Lv(K(),z$()).optional(),fix_hint:K().optional()}),qL=f({error:yG,trace_id:K().optional(),request_id:K()}),mG=f({code:K(),message:K().optional(),details:Lv(K(),z$()).optional()}),IL=f({data:z$().optional(),warnings:g$(mG).optional(),request_id:K()}),p={BAD_REQUEST:"bad_request",INVALID_BODY:"invalid_body",UNAUTHORIZED:"unauthorized",TOKEN_EXPIRED:"token_expired",TOKEN_INVALID:"token_invalid",FORBIDDEN:"forbidden",STEP_UP_REQUIRED:"step_up_required",EXPORT_NOT_ALLOWED:"export_not_allowed",SESSION_READ_ONLY:"session_read_only",NOT_FOUND:"not_found",SESSION_NOT_FOUND:"session_not_found",THREAD_NOT_FOUND:"thread_not_found",COMMENT_NOT_FOUND:"comment_not_found",BLOCK_NOT_FOUND:"block_not_found",SOURCE_FILE_NOT_FOUND:"source_file_not_found",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotency_key_in_flight",VERSION_CONFLICT:"version_conflict",SOURCE_MISMATCH:"source_mismatch",TRANSITION_NOT_ALLOWED:"transition_not_allowed",PAYLOAD_TOO_LARGE:"payload_too_large",INVALID_ARGUMENT:"invalid_argument",INVALID_BLOCK_ID:"invalid_block_id",INVALID_ANCHOR:"invalid_anchor",INVALID_SHA:"invalid_sha",INVALID_PATH:"invalid_path",UNKNOWN_SCHEMA:"unknown_schema",VALIDATION_FAILED:"validation_failed",RATE_LIMITED:"rate_limited",DB_ERROR:"db_error",RENDER_ERROR:"render_error",STORAGE_ERROR:"storage_error",INTERNAL_ERROR:"internal_error",SOURCE_UNAVAILABLE:"source_unavailable",SOURCE_TIMEOUT:"source_timeout",SERVICE_UNAVAILABLE:"service_unavailable"};function X6($){return[p.IDEMPOTENCY_KEY_IN_FLIGHT,p.RATE_LIMITED,p.DB_ERROR,p.SOURCE_UNAVAILABLE,p.SOURCE_TIMEOUT,p.SERVICE_UNAVAILABLE].includes($)}import{Buffer as BL}from"node:buffer";var LL=/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/,VL=/^[a-f0-9]{64}$/,oG=/^(?:[A-Za-z0-9+/]+={0,2})$/,jL=24;var dG="gitstate.v1",tG="xchacha20poly1305",MD=["session.created","session.state_changed","thread.created","comment.created","comment.edited","approval.requested","approval.decided","disposition.created","participant.added","participant.removed","participant.redacted"],FL=new Set(MD),KL=v$(MD),pG=f({ciphertext:K().min(1).regex(oG,"ciphertext must be base64"),nonce:K().min(1).regex(oG,"nonce must be base64").refine(($)=>{try{return tL($).byteLength===jL}catch{return!1}},"nonce must decode to 24 bytes"),key_id:K().min(1)}).strict(),Vv=fv([K(),pG]),OL=v$(["operator","reviewer","system","automation","unknown"]),fD=f({actor_type:OL,user_id:K().optional(),participant_id:K().optional(),verification_level:W$().int().min(0).optional(),email:Vv.optional(),display_name:Vv.optional()}).strict(),eG=K().regex(/^ev_/,"event_id must start with ev_"),aG=W$().int().min(1),NL=f({title:K().nullable(),state:K(),block_id_scheme:K(),render_profile:K().nullable(),config_hash:K()}).strict(),kL=f({from_state:K(),to_state:K()}).strict(),zL=f({type:v$(["block","session"]),block_id:K().optional(),start_offset:W$().int().min(0).optional(),end_offset:W$().int().min(0).optional()}).strict().superRefine(($,v)=>{if($.type==="block"&&!$.block_id)v.addIssue({code:S$.custom,message:"anchor.block_id is required for block anchors",path:["block_id"]})}),iL=f({thread_id:K(),anchor:zL,body_md:Vv,body_html:Vv.optional(),severity:K(),tags:g$(K())}).strict(),nL=f({thread_id:K(),comment_id:K(),body_md:Vv,body_html:Vv.optional()}).strict(),PL=f({thread_id:K(),comment_id:K(),version:W$().int().min(1),body_md:Vv,body_html:Vv.optional()}).strict(),AL=f({approval_request_id:K(),requested_by_id:K().optional(),approver_participant_ids:g$(K()).optional()}).strict(),ML=f({approval_request_id:K(),decision:v$(["approved","rejected","conditional"]),verification_level:W$().int().min(0),decided_by_id:K().optional()}).strict(),fL=f({evidence_id:K().optional(),type:K(),uri:K().optional(),notes:K().optional()}).strict(),SL=f({thread_id:K(),disposition_id:K(),state:K(),reason_code:K().optional(),evidence:g$(fL).optional()}).strict(),TL=f({participant_id:K(),roles:g$(K()),email:Vv.optional(),display_name:Vv.optional()}).strict(),uL=f({participant_id:K()}).strict(),RL=f({participant_id:K(),redacted_at:K().datetime(),reason:K().optional()}).strict();function gv($,v){return f({event_id:eG,event_seq:aG,type:q$($),occurred_at:K().datetime(),actor:fD,data:v}).strict()}var CL=gv("session.created",NL),EL=gv("session.state_changed",kL),ZL=gv("thread.created",iL),hL=gv("comment.created",nL),xL=gv("comment.edited",PL),lL=gv("approval.requested",AL),cL=gv("approval.decided",ML),yL=gv("disposition.created",SL),mL=gv("participant.added",TL),rL=gv("participant.removed",uL),oL=gv("participant.redacted",RL),sG=Sv("type",[CL,EL,ZL,hL,xL,lL,cL,yL,mL,rL,oL]),$5=f({event_id:eG,event_seq:aG,type:K().min(1),occurred_at:K().datetime(),actor:fD,data:z$()}).strict().refine(($)=>!FL.has($.type),{message:"unknown event type expected",path:["type"]}),v5=fv([sG,$5]),_5=f({alg:q$(tG),key_id:K().min(1)}).strict(),dL=f({schema_version:q$(dG),session_id:K().min(1),repo_id:K().min(1),git_sha:K().regex(LL,"git_sha must be 40 or 64 hex"),file_path:K().min(1),source_content_sha256:K().regex(VL,"source_content_sha256 must be sha256 hex"),tenant_id:K().min(1),encrypted_bodies:Y$(),include_emails:Y$(),encryption:_5.optional(),flushed_at:K().datetime(),flushed_through_event_seq:W$().int().min(0),events:g$(v5)}).strict().superRefine(($,v)=>{if($.encrypted_bodies&&!$.encryption)v.addIssue({code:S$.custom,path:["encryption"],message:"encryption is required when encrypted_bodies=true"});if(!$.encrypted_bodies&&$.encryption)v.addIssue({code:S$.custom,path:["encryption"],message:"encryption must be omitted when encrypted_bodies=false"});let w=0;for(let g=0;g<$.events.length;g+=1){let _=$.events[g];if(_.event_seq<=w)v.addIssue({code:S$.custom,path:["events",g,"event_seq"],message:"events must be sorted by event_seq ascending"});w=_.event_seq}if($.flushed_through_event_seq<w)v.addIssue({code:S$.custom,path:["flushed_through_event_seq"],message:"flushed_through_event_seq must be >= highest event_seq in events"})});function tL($){return new Uint8Array(BL.from($,"base64"))}var SD="1";var pL=v$(["email"]),TD=v$(["session.created","thread.created","thread.escalated","thread.assigned","comment.created","decision.recorded","approval.requested","approval.escalated","approval.decided","participant.invited","reminder_sent","rule.challenged","rule.published_impact","rule.superseded_impact","rule.deprecated_impact"]),eL=v$(["invite","reminder","mention","approval_request","approval_decided","digest"]),aL=v$(["pending","delivered","failed","bounced"]),w5=v$(["email","none"]),g5=v$(["immediate","hourly","daily"]);var KE=f({new_thread:Y$().optional(),reply_to_mine:Y$().optional(),mention:Y$().optional(),approval_request:Y$().optional()}).strict(),sL=f({new_thread:Y$(),reply_to_mine:Y$(),mention:Y$(),approval_request:Y$()}).strict(),$V="email",vV="immediate",_V=Object.freeze({new_thread:!1,reply_to_mine:!0,mention:!0,approval_request:!0});var OE=f({channel_preference:w5,digest_mode:g5,notify_on:sL}).strict(),NE=Object.freeze({channel_preference:$V,digest_mode:vV,notify_on:{..._V}});var wV=f({review_link_id:K().min(1),recipient_participant_id:K().min(1),session_id:K().min(1),event_type:TD,event_id:K().min(1),channel:q$("email"),custom_message:K().trim().min(1).max(2000).nullable().optional(),response_redaction_version:q$(SD).optional()}).strict();var b5=v$(["fixed","wont_fix","needs_clarification"]),U5=f({line_range:o_([W$().int().positive(),W$().int().positive()])}),J5=f({thread_id:K().regex(/^thrd_/),disposition:b5,evidence:K().min(1).max(2000),changes_ref:U5.optional()}),gV=f({version:q$("1"),session_id:K().regex(/^sess_/),resolutions:g$(J5).min(1),changes_summary:K().max(1000).optional()});var D5=["session.created","comment.created","approval.requested","approval.decided","thread.resolved","thread.reopened"],X5=v$(D5),bV=v$(["active","paused","revoked"]),G5=g$(X5),UV=f({url:K().url().startsWith("https://"),events_json:G5,secret_key_id:K().min(1)});var Li=SX(),Vi=Mg(),ji=BX(),mX=fg(),Fi=Ig(),i_=_$(),Ki=K_(),Oi=V$(),Ni=N_(),ki=k_(),eZ=t0(),zi=lX(),ii=cX(),ni=yX(),a0=B7(),L7=Hg();var Pi=Li.Composer,Ai=Vi.Document,Mi=ji.Schema,fi=mX.YAMLError,Si=mX.YAMLParseError,Ti=mX.YAMLWarning,ui=Fi.Alias,Ri=i_.isAlias,Ci=i_.isCollection,Ei=i_.isDocument,Zi=i_.isMap,hi=i_.isNode,xi=i_.isPair,li=i_.isScalar,ci=i_.isSeq,yi=Ki.Pair,mi=Oi.Scalar,ri=Ni.YAMLMap,oi=ki.YAMLSeq;var di=zi.Lexer,ti=ii.LineCounter,pi=ni.Parser,rX=a0.parse,ei=a0.parseAllDocuments,ai=a0.parseDocument,si=a0.stringify,$n=L7.visit,vn=L7.visitAsync;var _n=["string","string[]","number","boolean","enum","date"],j7=v$(_n),wn=/^[a-zA-Z0-9_-]+$/,oX=f({field:K().min(1),type:j7,values:g$(K().min(1)).optional()}).refine(($)=>{if($.type==="enum")return $.values!==void 0&&$.values.length>0;return $.values===void 0},{message:"enum fields must provide non-empty 'values' array; non-enum fields must not"}),F7=f({name:K().min(1).regex(wn,"doc_type name must be alphanumeric, hyphens, or underscores"),description:K().optional(),required_fields:g$(oX).default([]),optional_fields:g$(oX).default([])}),K7=f({allowed:g$(K().min(1)).default([]),enforce:Y$().default(!1)}),O7=f({allowed:g$(K().min(1)).default([]),enforce:Y$().default(!1)}),N7=f({default:K().min(1),allowed:g$(K().min(1)).default([]),enforce:Y$().default(!1)}),V7=["taxonomy.v1"],gn=f({schema_version:K().refine(($)=>V7.includes($),`schema_version must be one of: ${V7.join(", ")}`),doc_types:g$(F7).default([]),tags:K7.optional(),categories:O7.optional(),locale:N7.optional()}).passthrough().refine(($)=>{let v=$.doc_types.map((w)=>w.name);return new Set(v).size===v.length},{message:"Duplicate doc_type names are not allowed"}).refine(($)=>{let v=$.tags?.allowed??[];return new Set(v).size===v.length},{message:"Duplicate tag names are not allowed"}).refine(($)=>{let v=$.categories?.allowed??[];return new Set(v).size===v.length},{message:"Duplicate category names are not allowed"});var k7="v1",z7=["terminology","style","tone","claim_evidence","citation","structure","constraint","formatting","accuracy","clarity","completeness","other"],i7=v$(z7),n7=v$(["rules","llm","hybrid","human_override"]),bn=f({taxonomy_version:q$(k7),primary_type:i7,subtype:K().min(1).optional(),confidence:W$().min(0).max(1),source:n7,classifier_version:K().min(1),non_authoritative:q$(!0)});var Un=/^freshness\.v\d+$/,P7=v$(["glob","doc_type"]),Eg=v$(["info","warning","blocking"]),A7=f({name:K().min(1),match_mode:P7,match_pattern:K().min(1),max_days_since_approval:W$().int().positive(),severity:Eg,never_reviewed_severity:Eg}).strict(),M7=f({max_days_since_approval:W$().int().positive(),severity:Eg,never_reviewed_severity:Eg}).strict(),Jn=f({schema_version:K().regex(Un,"schema_version must match format freshness.v{major} (e.g., freshness.v1)"),rules:g$(A7).default([]),defaults:M7}).strict().superRefine(($,v)=>{let w=new Set;$.rules.forEach((g,_)=>{if(w.has(g.name))v.addIssue({code:"custom",message:`Duplicate rule name: "${g.name}"`,path:["rules",_,"name"]});w.add(g.name)})});var wh=f({freshness:f({rules_file:K().min(1).optional()}).passthrough().optional()}).passthrough();var Xn=f({DATABASE_URL:K().min(1,"DATABASE_URL is required"),DATABASE_URL_DIRECT:K().optional()}),Gn=f({GIT_PROVIDER:v$(["github","gitlab","local"]).default("github"),GITHUB_TOKEN:K().optional(),GITLAB_TOKEN:K().optional(),TYPESCAPE_GIT_ROOT:K().optional()}),Yn=f({ARTIFACT_STORE_TYPE:v$(["s3","filesystem"]).default("s3"),R2_ACCOUNT_ID:K().optional(),R2_ACCESS_KEY_ID:K().optional(),R2_SECRET_ACCESS_KEY:K().optional(),R2_BUCKET_NAME:K().optional(),R2_ENDPOINT:K().url().optional(),TYPESCAPE_ARTIFACTS_PATH:K().optional()}),Qn=f({TYPESCAPE_SERVER_SECRET:K().min(32,"TYPESCAPE_SERVER_SECRET must be at least 32 characters"),SESSION_SECRET:K().min(32,"SESSION_SECRET must be at least 32 characters"),CRON_SECRET:K().optional()}),Wn=f({TYPESCAPE_PORTAL_ORIGIN:K().url().default("http://localhost:5173"),TYPESCAPE_BASE_URL:K().url().default("http://localhost:3000")}),Hn=f({SMTP_HOST:K().optional(),SMTP_PORT:wv.number().int().positive().optional(),SMTP_USER:K().optional(),SMTP_PASS:K().optional(),SMTP_FROM:K().optional()}),qn=f({PORT:wv.number().int().positive().default(3000),METRICS_PORT:wv.number().int().positive().default(9090),NODE_ENV:v$(["development","staging","production"]).default("development"),LOG_LEVEL:v$(["trace","debug","info","warn","error"]).default("info"),TYPESCAPE_ROLE:v$(["api","worker","ingest","combined"]).default("combined")}),In=f({OTEL_EXPORTER_OTLP_ENDPOINT:K().url().optional(),OTEL_SERVICE_NAME:K().optional(),FEATURE_FLAGS:K().optional()}),Bn=Xn.merge(Gn).merge(Yn).merge(Qn).merge(Wn).merge(Hn).merge(qn).merge(In);var h$={free:{sessions_per_month:15,active_repos:1},pro:{sessions_per_month:100,active_repos:10},scale:{sessions_per_month:500,active_repos:50}},f7={free:{plan_id:"free",sessions_used:1,sessions_limit:h$.free.sessions_per_month,sessions_remaining:h$.free.sessions_per_month-1,active_repos:1,active_repos_limit:h$.free.active_repos,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",resets_at:"2026-03-01T00:00:00.000Z",upgrade_url:"https://example.com/billing",request_id:"req_usage"},pro:{plan_id:"pro",sessions_used:7,sessions_limit:15,sessions_remaining:8,active_repos:2,active_repos_limit:5,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",resets_at:"2026-03-01T00:00:00.000Z",upgrade_url:"https://example.com/billing",request_id:"req_usage"},scale:{plan_id:"scale",sessions_used:120,sessions_limit:h$.scale.sessions_per_month,sessions_remaining:h$.scale.sessions_per_month-120,active_repos:12,active_repos_limit:h$.scale.active_repos,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",resets_at:"2026-03-01T00:00:00.000Z",upgrade_url:"https://example.com/billing",request_id:"req_usage"}},S7={free:{plan_id:"free",plan_name:"Free",status:"trialing",trial_ends_at:"2026-03-05T00:00:00.000Z",cancel_at_period_end:!1,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",limits:h$.free,upgrade_url:"https://example.com/billing",request_id:"req_plan"},pro:{plan_id:"pro",plan_name:"Pro",status:"active",trial_ends_at:null,cancel_at_period_end:!1,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",limits:h$.pro,upgrade_url:"https://example.com/billing",request_id:"req_plan"},scale:{plan_id:"scale",plan_name:"Scale",status:"active",trial_ends_at:null,cancel_at_period_end:!1,current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",limits:h$.scale,upgrade_url:"https://example.com/billing",request_id:"req_plan"}};function dX($){let v=S7[$],w=f7[$];return{plan:{id:v.plan_id,name:v.plan_name,status:v.status,trial_ends_at:v.trial_ends_at,cancel_at_period_end:v.cancel_at_period_end},usage:{sessions_used:w.sessions_used,sessions_limit:w.sessions_limit,sessions_remaining:w.sessions_remaining,active_repos:w.active_repos,active_repos_limit:w.active_repos_limit},billing_period:{start:v.current_period_start,end:v.current_period_end,resets_at:w.resets_at},upgrade_url:v.upgrade_url,request_id:"req_summary"}}var Ln={free:dX("free"),pro:dX("pro"),scale:dX("scale")},Vn={free:{plan_id:"free",plan_name:"Free",status:"trialing",current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",trial_ends_at:"2026-03-05T00:00:00.000Z",cancel_at_period_end:!1,usage:{sessions_used:1,sessions_limit:10,active_repos:1,active_repos_limit:3},polar_customer_id:"cus_123",polar_subscription_id:null,request_id:"req_subscription"},pro:{plan_id:"pro",plan_name:"Pro",status:"active",current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",trial_ends_at:null,cancel_at_period_end:!1,usage:{sessions_used:8,sessions_limit:h$.pro.sessions_per_month,active_repos:3,active_repos_limit:h$.pro.active_repos},polar_customer_id:"cus_123",polar_subscription_id:"sub_123",request_id:"req_subscription"},scale:{plan_id:"scale",plan_name:"Scale",status:"active",current_period_start:"2026-02-01T00:00:00.000Z",current_period_end:"2026-03-01T00:00:00.000Z",trial_ends_at:null,cancel_at_period_end:!1,usage:{sessions_used:1,sessions_limit:h$.scale.sessions_per_month,active_repos:1,active_repos_limit:h$.scale.active_repos},polar_customer_id:"cus_123",polar_subscription_id:"sub_live",request_id:"req_subscription"}};var jn=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Kv($,v){return $>>>v|$<<32-v}function u7($){let v=new TextEncoder().encode($),w=v.length+9+63>>6<<6>>>0,g=new Uint8Array(w);g.set(v),g[v.length]=128;let _=v.length*8,b=new DataView(g.buffer);b.setUint32(w-8,Math.floor(_/4294967296),!1),b.setUint32(w-4,_>>>0,!1);let J=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],D=new Uint32Array(64);for(let X=0;X<w;X+=64){for(let F=0;F<16;F++)D[F]=b.getUint32(X+F*4,!1);for(let F=16;F<64;F++){let M=Kv(D[F-15],7)^Kv(D[F-15],18)^D[F-15]>>>3,T=Kv(D[F-2],17)^Kv(D[F-2],19)^D[F-2]>>>10;D[F]=(D[F-16]+M|0)+(D[F-7]+T|0)>>>0}let[G,Y,Q,W,I,H,q,j]=J;for(let F=0;F<64;F++){let M=Kv(I,6)^Kv(I,11)^Kv(I,25),T=I&H^~I&q,C=j+M+T+jn[F]+D[F]>>>0,Z=Kv(G,2)^Kv(G,13)^Kv(G,22),S=G&Y^G&Q^Y&Q,c=Z+S>>>0;j=q,q=H,H=I,I=W+C>>>0,W=Q,Q=Y,Y=G,G=C+c>>>0}J[0]=J[0]+G>>>0,J[1]=J[1]+Y>>>0,J[2]=J[2]+Q>>>0,J[3]=J[3]+W>>>0,J[4]=J[4]+I>>>0,J[5]=J[5]+H>>>0,J[6]=J[6]+q>>>0,J[7]=J[7]+j>>>0}return J.map((X)=>X.toString(16).padStart(8,"0")).join("")}var s0=d.object({rule_session_id:d.string(),rule_block_id:d.string(),rule_block_key:d.string().optional(),strength:d.enum(["must","should","may","must_not"]),category:d.string(),rule_content:d.string(),rule_session_name:d.string(),applicability_match_reason:d.string().optional(),kind:d.string().optional(),clause_id:d.string().optional(),clause_lineage_id:d.string().optional(),target_clause_id:d.string().optional()}),Fn=3600000,T7=86400000,Kn=d.object({repo_id:d.string().nullable(),file_path:d.string().nullable(),review_id:d.string().nullable()}),On=d.object({fetched_at:d.string(),server_etag:d.string(),latest_rule_session_updated_at:d.string().nullable(),contributing_session_count:d.number().int().nonnegative(),total_rule_count:d.number().int().nonnegative()}),Nn=d.object({text:d.string(),json_payload:d.unknown().optional(),structured_payload:d.unknown().optional()}),kn=d.object({scope:Kn,compiled_hash:d.string(),rules:d.array(d.object({source_review_id:d.string(),block_id:d.string(),block_index:d.number().int().nonnegative(),strength:d.enum(["must","should","may","must_not"]),category:d.string().nullable(),rule_text:d.string(),specificity:d.number().int().nonnegative(),applicability:d.record(d.string(),d.string())})),plain_text_bundle:d.string(),freshness:On,rulepack_schema_version:d.literal("rulepack.v1"),renderings:Nn.optional()});function zn($,v){return u7(JSON.stringify({plain_text_bundle:$,rules:v}))}function $U($){return u7(JSON.stringify({repo_id:$.repo_id,file_path:$.file_path,review_id:$.review_id}))}function tX($){let v=typeof $.compiled_hash==="string"&&$.compiled_hash.length>0?$.compiled_hash:zn($.plain_text_bundle,$.rules),w={scope:$.scope,compiled_hash:v,rules:$.rules,plain_text_bundle:$.plain_text_bundle,freshness:{fetched_at:$.fetched_at,server_etag:$.server_etag??`"rules:${v}"`,latest_rule_session_updated_at:$.freshness.latest_rule_session_updated_at,contributing_session_count:$.freshness.contributing_session_count,total_rule_count:$.freshness.total_rule_count},rulepack_schema_version:"rulepack.v1",...$.renderings?{renderings:$.renderings}:{}};return kn.parse(w),w}function nn($){let v=Math.max(0,Math.floor($/1000));if(v<60)return`${v}s`;let w=Math.floor(v/60);if(w<60)return`${w}m`;let g=Math.floor(w/60);if(g<48)return`${g}h`;return`${Math.floor(g/24)}d`}function R7($,v=new Date){let w=Date.parse($);if(!Number.isFinite(w))return{status:"confirmed_stale",age_ms:Number.POSITIVE_INFINITY,age_seconds:Number.POSITIVE_INFINITY,warning:"Using cached rules with an invalid fetched_at timestamp. Rules may have changed."};let g=Math.max(0,v.getTime()-w),_=Math.floor(g/1000);if(g<=Fn)return{status:"fresh",age_ms:g,age_seconds:_,warning:null};let b=nn(g),J=g>T7?`Cached rules are over ${b} old. Strongly recommend reconnecting to verify rules are current.`:`Using cached rules (fetched ${b} ago). Rules may have changed.`;return{status:g>T7?"confirmed_stale":"presumed_stale",age_ms:g,age_seconds:_,warning:J}}class L extends Error{status;code;requestId;details;fixHint;requestUrl;name="ApiError";constructor($,v,w,g,_,b,J){super(w);this.status=$;this.code=v;this.requestId=g;this.details=_;this.fixHint=b;this.requestUrl=J}}var O$=2,Jv=3,Rv=4,C7=5,cx={network_error:{exitCode:Jv,mcpRetry:"transient"},request_timeout:{exitCode:Jv,mcpRetry:"transient"},invalid_response:{exitCode:Rv,mcpRetry:"transient"},quota_exceeded:{exitCode:O$,mcpRetry:"manual"},[p.UNAUTHORIZED]:{exitCode:Jv,mcpRetry:"manual"},[p.TOKEN_EXPIRED]:{exitCode:Jv,mcpRetry:"manual"},[p.TOKEN_INVALID]:{exitCode:Jv,mcpRetry:"manual"},[p.FORBIDDEN]:{exitCode:Jv,mcpRetry:"manual"},[p.STEP_UP_REQUIRED]:{exitCode:Jv,mcpRetry:"manual"},[p.EXPORT_NOT_ALLOWED]:{exitCode:Jv,mcpRetry:"manual"},[p.SESSION_READ_ONLY]:{exitCode:Jv,mcpRetry:"manual"},[p.NOT_FOUND]:{exitCode:O$,mcpRetry:"manual"},[p.SESSION_NOT_FOUND]:{exitCode:O$,mcpRetry:"manual"},[p.THREAD_NOT_FOUND]:{exitCode:O$,mcpRetry:"manual"},[p.COMMENT_NOT_FOUND]:{exitCode:O$,mcpRetry:"manual"},[p.BLOCK_NOT_FOUND]:{exitCode:O$,mcpRetry:"manual"},[p.SOURCE_FILE_NOT_FOUND]:{exitCode:O$,mcpRetry:"manual"},[p.IDEMPOTENCY_KEY_IN_FLIGHT]:{exitCode:C7,mcpRetry:"transient"},[p.VERSION_CONFLICT]:{exitCode:O$,mcpRetry:"manual"},[p.SOURCE_MISMATCH]:{exitCode:O$,mcpRetry:"manual"},[p.PAYLOAD_TOO_LARGE]:{exitCode:O$,mcpRetry:"manual"},[p.INVALID_ARGUMENT]:{exitCode:O$,mcpRetry:"manual"},[p.INVALID_BLOCK_ID]:{exitCode:O$,mcpRetry:"manual"},[p.INVALID_ANCHOR]:{exitCode:O$,mcpRetry:"manual"},[p.INVALID_SHA]:{exitCode:O$,mcpRetry:"manual"},[p.INVALID_PATH]:{exitCode:O$,mcpRetry:"manual"},[p.UNKNOWN_SCHEMA]:{exitCode:O$,mcpRetry:"manual"},[p.VALIDATION_FAILED]:{exitCode:O$,mcpRetry:"manual"},[p.RATE_LIMITED]:{exitCode:Jv,mcpRetry:"transient"},[p.DB_ERROR]:{exitCode:Rv,mcpRetry:"transient"},[p.RENDER_ERROR]:{exitCode:Rv,mcpRetry:"transient"},[p.STORAGE_ERROR]:{exitCode:Rv,mcpRetry:"transient"},[p.INTERNAL_ERROR]:{exitCode:Rv,mcpRetry:"transient"},[p.SOURCE_UNAVAILABLE]:{exitCode:Rv,mcpRetry:"transient"},[p.SOURCE_TIMEOUT]:{exitCode:Rv,mcpRetry:"transient"},[p.SERVICE_UNAVAILABLE]:{exitCode:Rv,mcpRetry:"transient"}};var vU={maxAttempts:3,baseDelayMs:200,maxDelayMs:1000,jitterFactor:0.25,retryableStatusCodes:[429,502,503]};function pX($,v){let w=Math.min(v.baseDelayMs*Math.pow(2,$),v.maxDelayMs),g=w*v.jitterFactor*(Math.random()*2-1);return Math.max(0,Math.round(w+g))}function E7($,v,w){let g=$.headers.get("Retry-After");if(g){let _=parseInt(g,10);if(!Number.isNaN(_)&&_>0)return _*1000;let b=new Date(g);if(!Number.isNaN(b.getTime())){let J=b.getTime()-Date.now();if(J>0)return J}}return pX(v,w)}function Z7($,v,w,g){if(!g.retryableStatusCodes.includes(v))return!1;if($==="GET"||$==="PUT")return!0;return w}function h7($,v){if($==="GET"||$==="PUT")return!0;return v}async function _U($,v,w=!1,g=vU){let _=null,b=null,J=0,D=!1;for(let X=0;X<g.maxAttempts;X++){J=X+1;try{let G=await $();if(_=G,D=!1,G.ok||!Z7(v,G.status,w,g))return{response:G,error:null,attempts:X+1,wasNetworkError:!1,exhaustedRetries:!1,lastStatus:G.status};if(X<g.maxAttempts-1){let Y=E7(G,X,g);await new Promise((Q)=>setTimeout(Q,Y))}}catch(G){if(b=G instanceof Error?G:Error(String(G)),D=!0,_=null,X<g.maxAttempts-1&&h7(v,w)){let Y=pX(X,g);await new Promise((Q)=>setTimeout(Q,Y));continue}break}}if(b)return{response:null,error:b,attempts:J,wasNetworkError:!0,exhaustedRetries:!0,lastStatus:0};if(!_)throw Error("Retry invariant violated: missing final response");return{response:_,error:b,attempts:J,wasNetworkError:D,exhaustedRetries:!0,lastStatus:_.status}}var ww=30000,Pn="/v1",An="typescape-api-client/0.0.1";function x7($){return typeof FormData<"u"&&$ instanceof FormData}function eX($,v,w,g){let _=`${$}${v}${w}`;if(g&&Object.keys(g).length>0)_+=`?${new URLSearchParams(g).toString()}`;return _}function aX($,v,w){return{Authorization:`Bearer ${$}`,Accept:"application/json","User-Agent":v,...w}}function c7($){let v=Object.entries($).find(([w])=>w.toLowerCase()==="idempotency-key")?.[1];return typeof v==="string"&&v.trim().length>0}function wU($,v){let w=v;if(w&&typeof w.request_id==="string"&&w.request_id.trim().length>0)return w.request_id;let g=$.headers.get("X-Request-Id");if(typeof g==="string"&&g.trim().length>0)return g;return"unknown_request_id"}function y7($,v){let w=$.error?.code;if(typeof w!=="string"||w.trim().length===0)throw new L(0,"invalid_response","Error response missing error.code",v);let g=$.error?.message;if(w!=="quota_exceeded"&&(typeof g!=="string"||g.trim().length===0))throw new L(0,"invalid_response","Error response missing error.message",v);return new L(0,w,typeof g==="string"?g:"",v,$.error?.details,$.error?.fix_hint)}async function l7($,v,w,g,_,b){let J=c7(b),D=`${g} ${$}`,X=await _U(()=>fetch($,{...v,signal:AbortSignal.timeout(w)}),g,J,_);if(X.error){if(X.error instanceof DOMException&&(X.error.name==="TimeoutError"||X.error.name==="AbortError")){let H=Math.round(w/1000);throw new L(0,"request_timeout",`Request timed out after ${H}s. Check your network connection and server URL.`,"unknown",void 0,void 0,D)}throw new L(0,"network_error",`Network error: ${X.error.message} (${X.attempts} attempt${X.attempts===1?"":"s"})`,"unknown",void 0,void 0,D)}let G=X.response;if(!G)throw new L(0,"network_error",`Network error: request failed (${X.attempts} attempt${X.attempts===1?"":"s"})`,"unknown",void 0,void 0,D);let Y=G.headers.get("Content-Type");if(!Y)throw new L(G.status,"invalid_response","Response missing Content-Type header","unknown",void 0,void 0,D);if(!Y.toLowerCase().includes("application/json"))throw new L(G.status,"invalid_response",`Expected JSON response but received Content-Type: ${Y}`,"unknown",void 0,void 0,D);let Q;try{Q=await G.json()}catch(I){throw new L(G.status,"invalid_response",`Failed to parse JSON response: ${I instanceof Error?I.message:String(I)}`,"unknown",void 0,void 0,D)}let W=wU(G,Q);if(!G.ok){let H=y7(Q,W);throw new L(G.status,H.code,H.message+(X.exhaustedRetries&&X.attempts>1?` (${X.attempts} attempts, retries exhausted)`:""),W,H.details,H.fixHint,D)}return{status:G.status,body:Q,requestId:W}}async function Mn($,v,w,g,_,b){let J=c7(b),D=`${g} ${$}`,X=await _U(()=>fetch($,{...v,signal:AbortSignal.timeout(w)}),g,J,_);if(X.error){if(X.error instanceof DOMException&&(X.error.name==="TimeoutError"||X.error.name==="AbortError")){let I=Math.round(w/1000);throw new L(0,"request_timeout",`Request timed out after ${I}s. Check your network connection and server URL.`,"unknown",void 0,void 0,D)}throw new L(0,"network_error",`Network error: ${X.error.message} (${X.attempts} attempt${X.attempts===1?"":"s"})`,"unknown",void 0,void 0,D)}let G=X.response;if(!G)throw new L(0,"network_error","Request failed","unknown",void 0,void 0,D);let Y=G.headers.get("Content-Type");if(!Y)throw new L(G.status,"invalid_response","Response missing Content-Type header","unknown",void 0,void 0,D);if(Y.toLowerCase().includes("application/json")){let W;try{W=await G.json()}catch(H){throw new L(G.status,"invalid_response",`Failed to parse JSON response: ${H instanceof Error?H.message:String(H)}`,"unknown",void 0,void 0,D)}let I=wU(G,W);if(!G.ok){let H=y7(W,I);throw new L(G.status,H.code,H.message,I,H.details,H.fixHint,D)}throw new L(G.status,"invalid_response","Expected text response but received JSON payload",I,void 0,void 0,D)}let Q;try{Q=await G.text()}catch(W){throw new L(G.status,"invalid_response",`Failed to read text response: ${W instanceof Error?W.message:String(W)}`,wU(G,null),void 0,void 0,D)}return{status:G.status,body:Q,requestId:wU(G,null)}}function sX($){let v=$.baseUrl.replace(/\/$/,""),w=$.apiPrefix??Pn,g=$.timeoutMs??ww,_=$.userAgent??An,b=$.retryPolicy??vU;function J(D,X,G={}){let Y=eX(v,w,X,G.query),Q=aX($.apiKey,_,G.headers);if(G.body!==void 0&&!x7(G.body))Q["Content-Type"]="application/json";let W=G.body!==void 0?x7(G.body)?G.body:JSON.stringify(G.body):void 0;return l7(Y,{method:D,headers:Q,body:W},g,D,b,Q)}return{get(D,X){return J("GET",D,X)},getText(D,X){let G=eX(v,w,D,X?.query),Y=aX($.apiKey,_,{Accept:"text/plain, application/json",...X?.headers});return Mn(G,{method:"GET",headers:Y},g,"GET",b,Y)},post(D,X){return J("POST",D,X)},postFormData(D,X,G){let Y=eX(v,w,D,G?.query),Q=aX($.apiKey,_,G?.headers);return l7(Y,{method:"POST",headers:Q,body:X},g,"POST",b,Q)},put(D,X){return J("PUT",D,X)},patch(D,X){return J("PATCH",D,X)},delete(D,X){return J("DELETE",D,X)},request:J}}var fn=typeof $8.default.version==="string"?$8.default.version:"0.0.0",Sn=`typescape-mcp/${fn}`;function m7($,v,w=ww){return sX({baseUrl:$,apiKey:v,timeoutMs:w,userAgent:Sn})}var w$;(function($){$.assertEqual=(_)=>_;function v(_){}$.assertIs=v;function w(_){throw Error()}$.assertNever=w,$.arrayToEnum=(_)=>{let b={};for(let J of _)b[J]=J;return b},$.getValidEnumValues=(_)=>{let b=$.objectKeys(_).filter((D)=>typeof _[_[D]]!=="number"),J={};for(let D of b)J[D]=_[D];return $.objectValues(J)},$.objectValues=(_)=>{return $.objectKeys(_).map(function(b){return _[b]})},$.objectKeys=typeof Object.keys==="function"?(_)=>Object.keys(_):(_)=>{let b=[];for(let J in _)if(Object.prototype.hasOwnProperty.call(_,J))b.push(J);return b},$.find=(_,b)=>{for(let J of _)if(b(J))return J;return},$.isInteger=typeof Number.isInteger==="function"?(_)=>Number.isInteger(_):(_)=>typeof _==="number"&&isFinite(_)&&Math.floor(_)===_;function g(_,b=" | "){return _.map((J)=>typeof J==="string"?`'${J}'`:J).join(b)}$.joinValues=g,$.jsonStringifyReplacer=(_,b)=>{if(typeof b==="bigint")return b.toString();return b}})(w$||(w$={}));var _8;(function($){$.mergeShapes=(v,w)=>{return{...v,...w}}})(_8||(_8={}));var h=w$.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ev=($)=>{switch(typeof $){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN($)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":if(Array.isArray($))return h.array;if($===null)return h.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return h.promise;if(typeof Map<"u"&&$ instanceof Map)return h.map;if(typeof Set<"u"&&$ instanceof Set)return h.set;if(typeof Date<"u"&&$ instanceof Date)return h.date;return h.object;default:return h.unknown}},P=w$.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"]),Tn=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class c$ extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(w)=>{this.issues=[...this.issues,w]},this.addIssues=(w=[])=>{this.issues=[...this.issues,...w]};let v=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,v);else this.__proto__=v;this.name="ZodError",this.issues=$}format($){let v=$||function(_){return _.message},w={_errors:[]},g=(_)=>{for(let b of _.issues)if(b.code==="invalid_union")b.unionErrors.map(g);else if(b.code==="invalid_return_type")g(b.returnTypeError);else if(b.code==="invalid_arguments")g(b.argumentsError);else if(b.path.length===0)w._errors.push(v(b));else{let J=w,D=0;while(D<b.path.length){let X=b.path[D];if(D!==b.path.length-1)J[X]=J[X]||{_errors:[]};else J[X]=J[X]||{_errors:[]},J[X]._errors.push(v(b));J=J[X],D++}}};return g(this),w}static assert($){if(!($ instanceof c$))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,w$.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(v)=>v.message){let v={},w=[];for(let g of this.issues)if(g.path.length>0)v[g.path[0]]=v[g.path[0]]||[],v[g.path[0]].push($(g));else w.push($(g));return{formErrors:w,fieldErrors:v}}get formErrors(){return this.flatten()}}c$.create=($)=>{return new c$($)};var N6=($,v)=>{let w;switch($.code){case P.invalid_type:if($.received===h.undefined)w="Required";else w=`Expected ${$.expected}, received ${$.received}`;break;case P.invalid_literal:w=`Invalid literal value, expected ${JSON.stringify($.expected,w$.jsonStringifyReplacer)}`;break;case P.unrecognized_keys:w=`Unrecognized key(s) in object: ${w$.joinValues($.keys,", ")}`;break;case P.invalid_union:w="Invalid input";break;case P.invalid_union_discriminator:w=`Invalid discriminator value. Expected ${w$.joinValues($.options)}`;break;case P.invalid_enum_value:w=`Invalid enum value. Expected ${w$.joinValues($.options)}, received '${$.received}'`;break;case P.invalid_arguments:w="Invalid function arguments";break;case P.invalid_return_type:w="Invalid function return type";break;case P.invalid_date:w="Invalid date";break;case P.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(w=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")w=`${w} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)w=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)w=`Invalid input: must end with "${$.validation.endsWith}"`;else w$.assertNever($.validation);else if($.validation!=="regex")w=`Invalid ${$.validation}`;else w="Invalid";break;case P.too_small:if($.type==="array")w=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")w=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")w=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")w=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else w="Invalid input";break;case P.too_big:if($.type==="array")w=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")w=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")w=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")w=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")w=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else w="Invalid input";break;case P.custom:w="Invalid input";break;case P.invalid_intersection_types:w="Intersection results could not be merged";break;case P.not_multiple_of:w=`Number must be a multiple of ${$.multipleOf}`;break;case P.not_finite:w="Number must be finite";break;default:w=v.defaultError,w$.assertNever($)}return{message:w}},d7=N6;function un($){d7=$}function gU(){return d7}var bU=($)=>{let{data:v,path:w,errorMaps:g,issueData:_}=$,b=[...w,..._.path||[]],J={..._,path:b};if(_.message!==void 0)return{..._,path:b,message:_.message};let D="",X=g.filter((G)=>!!G).slice().reverse();for(let G of X)D=G(J,{data:v,defaultError:D}).message;return{..._,path:b,message:D}},Rn=[];function R($,v){let w=gU(),g=bU({issueData:v,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,w,w===N6?void 0:N6].filter((_)=>!!_)});$.common.issues.push(g)}class P${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,v){let w=[];for(let g of v){if(g.status==="aborted")return r;if(g.status==="dirty")$.dirty();w.push(g.value)}return{status:$.value,value:w}}static async mergeObjectAsync($,v){let w=[];for(let g of v){let _=await g.key,b=await g.value;w.push({key:_,value:b})}return P$.mergeObjectSync($,w)}static mergeObjectSync($,v){let w={};for(let g of v){let{key:_,value:b}=g;if(_.status==="aborted")return r;if(b.status==="aborted")return r;if(_.status==="dirty")$.dirty();if(b.status==="dirty")$.dirty();if(_.value!=="__proto__"&&(typeof b.value<"u"||g.alwaysSet))w[_.value]=b.value}return{status:$.value,value:w}}}var r=Object.freeze({status:"aborted"}),K6=($)=>({status:"dirty",value:$}),T$=($)=>({status:"valid",value:$}),w8=($)=>$.status==="aborted",g8=($)=>$.status==="dirty",gw=($)=>$.status==="valid",xg=($)=>typeof Promise<"u"&&$ instanceof Promise;function UU($,v,w,g){if(w==="a"&&!g)throw TypeError("Private accessor was defined without a getter");if(typeof v==="function"?$!==v||!g:!v.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return w==="m"?g:w==="a"?g.call($):g?g.value:v.get($)}function t7($,v,w,g,_){if(g==="m")throw TypeError("Private method is not writable");if(g==="a"&&!_)throw TypeError("Private accessor was defined without a setter");if(typeof v==="function"?$!==v||!_:!v.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return g==="a"?_.call($,w):_?_.value=w:v.set($,w),w}var l;(function($){$.errToObj=(v)=>typeof v==="string"?{message:v}:v||{},$.toString=(v)=>typeof v==="string"?v:v===null||v===void 0?void 0:v.message})(l||(l={}));var Zg,hg;class Yv{constructor($,v,w,g){this._cachedPath=[],this.parent=$,this.data=v,this._path=w,this._key=g}get path(){if(!this._cachedPath.length)if(this._key instanceof Array)this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var r7=($,v)=>{if(gw(v))return{success:!0,data:v.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let w=new c$($.common.issues);return this._error=w,this._error}}}};function e($){if(!$)return{};let{errorMap:v,invalid_type_error:w,required_error:g,description:_}=$;if(v&&(w||g))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(v)return{errorMap:v,description:_};return{errorMap:(J,D)=>{var X,G;let{message:Y}=$;if(J.code==="invalid_enum_value")return{message:Y!==null&&Y!==void 0?Y:D.defaultError};if(typeof D.data>"u")return{message:(X=Y!==null&&Y!==void 0?Y:g)!==null&&X!==void 0?X:D.defaultError};if(J.code!=="invalid_type")return{message:D.defaultError};return{message:(G=Y!==null&&Y!==void 0?Y:w)!==null&&G!==void 0?G:D.defaultError}},description:_}}class s{get description(){return this._def.description}_getType($){return Ev($.data)}_getOrReturnCtx($,v){return v||{common:$.parent.common,data:$.data,parsedType:Ev($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new P$,ctx:{common:$.parent.common,data:$.data,parsedType:Ev($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let v=this._parse($);if(xg(v))throw Error("Synchronous parse encountered promise.");return v}_parseAsync($){let v=this._parse($);return Promise.resolve(v)}parse($,v){let w=this.safeParse($,v);if(w.success)return w.data;throw w.error}safeParse($,v){var w;let g={common:{issues:[],async:(w=v===null||v===void 0?void 0:v.async)!==null&&w!==void 0?w:!1,contextualErrorMap:v===null||v===void 0?void 0:v.errorMap},path:(v===null||v===void 0?void 0:v.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Ev($)},_=this._parseSync({data:$,path:g.path,parent:g});return r7(g,_)}"~validate"($){var v,w;let g={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Ev($)};if(!this["~standard"].async)try{let _=this._parseSync({data:$,path:[],parent:g});return gw(_)?{value:_.value}:{issues:g.common.issues}}catch(_){if((w=(v=_===null||_===void 0?void 0:_.message)===null||v===void 0?void 0:v.toLowerCase())===null||w===void 0?void 0:w.includes("encountered"))this["~standard"].async=!0;g.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:g}).then((_)=>gw(_)?{value:_.value}:{issues:g.common.issues})}async parseAsync($,v){let w=await this.safeParseAsync($,v);if(w.success)return w.data;throw w.error}async safeParseAsync($,v){let w={common:{issues:[],contextualErrorMap:v===null||v===void 0?void 0:v.errorMap,async:!0},path:(v===null||v===void 0?void 0:v.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Ev($)},g=this._parse({data:$,path:w.path,parent:w}),_=await(xg(g)?g:Promise.resolve(g));return r7(w,_)}refine($,v){let w=(g)=>{if(typeof v==="string"||typeof v>"u")return{message:v};else if(typeof v==="function")return v(g);else return v};return this._refinement((g,_)=>{let b=$(g),J=()=>_.addIssue({code:P.custom,...w(g)});if(typeof Promise<"u"&&b instanceof Promise)return b.then((D)=>{if(!D)return J(),!1;else return!0});if(!b)return J(),!1;else return!0})}refinement($,v){return this._refinement((w,g)=>{if(!$(w))return g.addIssue(typeof v==="function"?v(w,g):v),!1;else return!0})}_refinement($){return new a$({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(v)=>this["~validate"](v)}}optional(){return Gv.create(this,this._def)}nullable(){return Zv.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xv.create(this)}promise(){return Dw.create(this,this._def)}or($){return n6.create([this,$],this._def)}and($){return P6.create(this,$,this._def)}transform($){return new a$({...e(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:$}})}default($){let v=typeof $==="function"?$:()=>$;return new S6({...e(this._def),innerType:this,defaultValue:v,typeName:m.ZodDefault})}brand(){return new DU({typeName:m.ZodBranded,type:this,...e(this._def)})}catch($){let v=typeof $==="function"?$:()=>$;return new T6({...e(this._def),innerType:this,catchValue:v,typeName:m.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return og.create(this,$)}readonly(){return u6.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var Cn=/^c[^\s-]{8,}$/i,En=/^[0-9a-z]+$/,Zn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,hn=/^[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,xn=/^[a-z0-9_-]{21}$/i,ln=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,cn=/^[-+]?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)?)??$/,yn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",v8,rn=/^(?:(?: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])$/,on=/^(?:(?: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])$/,dn=/^(([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]))$/,tn=/^(([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])$/,pn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,en=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,p7="((\\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])))",an=new RegExp(`^${p7}$`);function e7($){let v="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if($.precision)v=`${v}\\.\\d{${$.precision}}`;else if($.precision==null)v=`${v}(\\.\\d+)?`;return v}function sn($){return new RegExp(`^${e7($)}$`)}function a7($){let v=`${p7}T${e7($)}`,w=[];if(w.push($.local?"Z?":"Z"),$.offset)w.push("([+-]\\d{2}:?\\d{2})");return v=`${v}(${w.join("|")})`,new RegExp(`^${v}$`)}function $P($,v){if((v==="v4"||!v)&&rn.test($))return!0;if((v==="v6"||!v)&&dn.test($))return!0;return!1}function vP($,v){if(!ln.test($))return!1;try{let[w]=$.split("."),g=w.replace(/-/g,"+").replace(/_/g,"/").padEnd(w.length+(4-w.length%4)%4,"="),_=JSON.parse(atob(g));if(typeof _!=="object"||_===null)return!1;if(!_.typ||!_.alg)return!1;if(v&&_.alg!==v)return!1;return!0}catch(w){return!1}}function _P($,v){if((v==="v4"||!v)&&on.test($))return!0;if((v==="v6"||!v)&&tn.test($))return!0;return!1}class Dv extends s{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==h.string){let _=this._getOrReturnCtx($);return R(_,{code:P.invalid_type,expected:h.string,received:_.parsedType}),r}let w=new P$,g=void 0;for(let _ of this._def.checks)if(_.kind==="min"){if($.data.length<_.value)g=this._getOrReturnCtx($,g),R(g,{code:P.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),w.dirty()}else if(_.kind==="max"){if($.data.length>_.value)g=this._getOrReturnCtx($,g),R(g,{code:P.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),w.dirty()}else if(_.kind==="length"){let b=$.data.length>_.value,J=$.data.length<_.value;if(b||J){if(g=this._getOrReturnCtx($,g),b)R(g,{code:P.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});else if(J)R(g,{code:P.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message});w.dirty()}}else if(_.kind==="email"){if(!yn.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"email",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="emoji"){if(!v8)v8=new RegExp(mn,"u");if(!v8.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"emoji",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="uuid"){if(!hn.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"uuid",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="nanoid"){if(!xn.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"nanoid",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="cuid"){if(!Cn.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"cuid",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="cuid2"){if(!En.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"cuid2",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="ulid"){if(!Zn.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"ulid",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="url")try{new URL($.data)}catch(b){g=this._getOrReturnCtx($,g),R(g,{validation:"url",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="regex"){if(_.regex.lastIndex=0,!_.regex.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"regex",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="trim")$.data=$.data.trim();else if(_.kind==="includes"){if(!$.data.includes(_.value,_.position))g=this._getOrReturnCtx($,g),R(g,{code:P.invalid_string,validation:{includes:_.value,position:_.position},message:_.message}),w.dirty()}else if(_.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(_.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(_.kind==="startsWith"){if(!$.data.startsWith(_.value))g=this._getOrReturnCtx($,g),R(g,{code:P.invalid_string,validation:{startsWith:_.value},message:_.message}),w.dirty()}else if(_.kind==="endsWith"){if(!$.data.endsWith(_.value))g=this._getOrReturnCtx($,g),R(g,{code:P.invalid_string,validation:{endsWith:_.value},message:_.message}),w.dirty()}else if(_.kind==="datetime"){if(!a7(_).test($.data))g=this._getOrReturnCtx($,g),R(g,{code:P.invalid_string,validation:"datetime",message:_.message}),w.dirty()}else if(_.kind==="date"){if(!an.test($.data))g=this._getOrReturnCtx($,g),R(g,{code:P.invalid_string,validation:"date",message:_.message}),w.dirty()}else if(_.kind==="time"){if(!sn(_).test($.data))g=this._getOrReturnCtx($,g),R(g,{code:P.invalid_string,validation:"time",message:_.message}),w.dirty()}else if(_.kind==="duration"){if(!cn.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"duration",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="ip"){if(!$P($.data,_.version))g=this._getOrReturnCtx($,g),R(g,{validation:"ip",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="jwt"){if(!vP($.data,_.alg))g=this._getOrReturnCtx($,g),R(g,{validation:"jwt",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="cidr"){if(!_P($.data,_.version))g=this._getOrReturnCtx($,g),R(g,{validation:"cidr",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="base64"){if(!pn.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"base64",code:P.invalid_string,message:_.message}),w.dirty()}else if(_.kind==="base64url"){if(!en.test($.data))g=this._getOrReturnCtx($,g),R(g,{validation:"base64url",code:P.invalid_string,message:_.message}),w.dirty()}else w$.assertNever(_);return{status:w.value,value:$.data}}_regex($,v,w){return this.refinement((g)=>$.test(g),{validation:v,code:P.invalid_string,...l.errToObj(w)})}_addCheck($){return new Dv({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...l.errToObj($)})}url($){return this._addCheck({kind:"url",...l.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...l.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...l.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...l.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...l.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...l.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...l.errToObj($)})}base64($){return this._addCheck({kind:"base64",...l.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...l.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...l.errToObj($)})}ip($){return this._addCheck({kind:"ip",...l.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...l.errToObj($)})}datetime($){var v,w;if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof($===null||$===void 0?void 0:$.precision)>"u"?null:$===null||$===void 0?void 0:$.precision,offset:(v=$===null||$===void 0?void 0:$.offset)!==null&&v!==void 0?v:!1,local:(w=$===null||$===void 0?void 0:$.local)!==null&&w!==void 0?w:!1,...l.errToObj($===null||$===void 0?void 0:$.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof($===null||$===void 0?void 0:$.precision)>"u"?null:$===null||$===void 0?void 0:$.precision,...l.errToObj($===null||$===void 0?void 0:$.message)})}duration($){return this._addCheck({kind:"duration",...l.errToObj($)})}regex($,v){return this._addCheck({kind:"regex",regex:$,...l.errToObj(v)})}includes($,v){return this._addCheck({kind:"includes",value:$,position:v===null||v===void 0?void 0:v.position,...l.errToObj(v===null||v===void 0?void 0:v.message)})}startsWith($,v){return this._addCheck({kind:"startsWith",value:$,...l.errToObj(v)})}endsWith($,v){return this._addCheck({kind:"endsWith",value:$,...l.errToObj(v)})}min($,v){return this._addCheck({kind:"min",value:$,...l.errToObj(v)})}max($,v){return this._addCheck({kind:"max",value:$,...l.errToObj(v)})}length($,v){return this._addCheck({kind:"length",value:$,...l.errToObj(v)})}nonempty($){return this.min(1,l.errToObj($))}trim(){return new Dv({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Dv({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Dv({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let v of this._def.checks)if(v.kind==="min"){if($===null||v.value>$)$=v.value}return $}get maxLength(){let $=null;for(let v of this._def.checks)if(v.kind==="max"){if($===null||v.value<$)$=v.value}return $}}Dv.create=($)=>{var v;return new Dv({checks:[],typeName:m.ZodString,coerce:(v=$===null||$===void 0?void 0:$.coerce)!==null&&v!==void 0?v:!1,...e($)})};function wP($,v){let w=($.toString().split(".")[1]||"").length,g=(v.toString().split(".")[1]||"").length,_=w>g?w:g,b=parseInt($.toFixed(_).replace(".","")),J=parseInt(v.toFixed(_).replace(".",""));return b%J/Math.pow(10,_)}class P_ extends s{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==h.number){let _=this._getOrReturnCtx($);return R(_,{code:P.invalid_type,expected:h.number,received:_.parsedType}),r}let w=void 0,g=new P$;for(let _ of this._def.checks)if(_.kind==="int"){if(!w$.isInteger($.data))w=this._getOrReturnCtx($,w),R(w,{code:P.invalid_type,expected:"integer",received:"float",message:_.message}),g.dirty()}else if(_.kind==="min"){if(_.inclusive?$.data<_.value:$.data<=_.value)w=this._getOrReturnCtx($,w),R(w,{code:P.too_small,minimum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),g.dirty()}else if(_.kind==="max"){if(_.inclusive?$.data>_.value:$.data>=_.value)w=this._getOrReturnCtx($,w),R(w,{code:P.too_big,maximum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),g.dirty()}else if(_.kind==="multipleOf"){if(wP($.data,_.value)!==0)w=this._getOrReturnCtx($,w),R(w,{code:P.not_multiple_of,multipleOf:_.value,message:_.message}),g.dirty()}else if(_.kind==="finite"){if(!Number.isFinite($.data))w=this._getOrReturnCtx($,w),R(w,{code:P.not_finite,message:_.message}),g.dirty()}else w$.assertNever(_);return{status:g.value,value:$.data}}gte($,v){return this.setLimit("min",$,!0,l.toString(v))}gt($,v){return this.setLimit("min",$,!1,l.toString(v))}lte($,v){return this.setLimit("max",$,!0,l.toString(v))}lt($,v){return this.setLimit("max",$,!1,l.toString(v))}setLimit($,v,w,g){return new P_({...this._def,checks:[...this._def.checks,{kind:$,value:v,inclusive:w,message:l.toString(g)}]})}_addCheck($){return new P_({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:l.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.toString($)})}multipleOf($,v){return this._addCheck({kind:"multipleOf",value:$,message:l.toString(v)})}finite($){return this._addCheck({kind:"finite",message:l.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.toString($)})}get minValue(){let $=null;for(let v of this._def.checks)if(v.kind==="min"){if($===null||v.value>$)$=v.value}return $}get maxValue(){let $=null;for(let v of this._def.checks)if(v.kind==="max"){if($===null||v.value<$)$=v.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&w$.isInteger($.value))}get isFinite(){let $=null,v=null;for(let w of this._def.checks)if(w.kind==="finite"||w.kind==="int"||w.kind==="multipleOf")return!0;else if(w.kind==="min"){if(v===null||w.value>v)v=w.value}else if(w.kind==="max"){if($===null||w.value<$)$=w.value}return Number.isFinite(v)&&Number.isFinite($)}}P_.create=($)=>{return new P_({checks:[],typeName:m.ZodNumber,coerce:($===null||$===void 0?void 0:$.coerce)||!1,...e($)})};class A_ extends s{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch(_){return this._getInvalidInput($)}if(this._getType($)!==h.bigint)return this._getInvalidInput($);let w=void 0,g=new P$;for(let _ of this._def.checks)if(_.kind==="min"){if(_.inclusive?$.data<_.value:$.data<=_.value)w=this._getOrReturnCtx($,w),R(w,{code:P.too_small,type:"bigint",minimum:_.value,inclusive:_.inclusive,message:_.message}),g.dirty()}else if(_.kind==="max"){if(_.inclusive?$.data>_.value:$.data>=_.value)w=this._getOrReturnCtx($,w),R(w,{code:P.too_big,type:"bigint",maximum:_.value,inclusive:_.inclusive,message:_.message}),g.dirty()}else if(_.kind==="multipleOf"){if($.data%_.value!==BigInt(0))w=this._getOrReturnCtx($,w),R(w,{code:P.not_multiple_of,multipleOf:_.value,message:_.message}),g.dirty()}else w$.assertNever(_);return{status:g.value,value:$.data}}_getInvalidInput($){let v=this._getOrReturnCtx($);return R(v,{code:P.invalid_type,expected:h.bigint,received:v.parsedType}),r}gte($,v){return this.setLimit("min",$,!0,l.toString(v))}gt($,v){return this.setLimit("min",$,!1,l.toString(v))}lte($,v){return this.setLimit("max",$,!0,l.toString(v))}lt($,v){return this.setLimit("max",$,!1,l.toString(v))}setLimit($,v,w,g){return new A_({...this._def,checks:[...this._def.checks,{kind:$,value:v,inclusive:w,message:l.toString(g)}]})}_addCheck($){return new A_({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.toString($)})}multipleOf($,v){return this._addCheck({kind:"multipleOf",value:$,message:l.toString(v)})}get minValue(){let $=null;for(let v of this._def.checks)if(v.kind==="min"){if($===null||v.value>$)$=v.value}return $}get maxValue(){let $=null;for(let v of this._def.checks)if(v.kind==="max"){if($===null||v.value<$)$=v.value}return $}}A_.create=($)=>{var v;return new A_({checks:[],typeName:m.ZodBigInt,coerce:(v=$===null||$===void 0?void 0:$.coerce)!==null&&v!==void 0?v:!1,...e($)})};class k6 extends s{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==h.boolean){let w=this._getOrReturnCtx($);return R(w,{code:P.invalid_type,expected:h.boolean,received:w.parsedType}),r}return T$($.data)}}k6.create=($)=>{return new k6({typeName:m.ZodBoolean,coerce:($===null||$===void 0?void 0:$.coerce)||!1,...e($)})};class bw extends s{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==h.date){let _=this._getOrReturnCtx($);return R(_,{code:P.invalid_type,expected:h.date,received:_.parsedType}),r}if(isNaN($.data.getTime())){let _=this._getOrReturnCtx($);return R(_,{code:P.invalid_date}),r}let w=new P$,g=void 0;for(let _ of this._def.checks)if(_.kind==="min"){if($.data.getTime()<_.value)g=this._getOrReturnCtx($,g),R(g,{code:P.too_small,message:_.message,inclusive:!0,exact:!1,minimum:_.value,type:"date"}),w.dirty()}else if(_.kind==="max"){if($.data.getTime()>_.value)g=this._getOrReturnCtx($,g),R(g,{code:P.too_big,message:_.message,inclusive:!0,exact:!1,maximum:_.value,type:"date"}),w.dirty()}else w$.assertNever(_);return{status:w.value,value:new Date($.data.getTime())}}_addCheck($){return new bw({...this._def,checks:[...this._def.checks,$]})}min($,v){return this._addCheck({kind:"min",value:$.getTime(),message:l.toString(v)})}max($,v){return this._addCheck({kind:"max",value:$.getTime(),message:l.toString(v)})}get minDate(){let $=null;for(let v of this._def.checks)if(v.kind==="min"){if($===null||v.value>$)$=v.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let v of this._def.checks)if(v.kind==="max"){if($===null||v.value<$)$=v.value}return $!=null?new Date($):null}}bw.create=($)=>{return new bw({checks:[],coerce:($===null||$===void 0?void 0:$.coerce)||!1,typeName:m.ZodDate,...e($)})};class lg extends s{_parse($){if(this._getType($)!==h.symbol){let w=this._getOrReturnCtx($);return R(w,{code:P.invalid_type,expected:h.symbol,received:w.parsedType}),r}return T$($.data)}}lg.create=($)=>{return new lg({typeName:m.ZodSymbol,...e($)})};class z6 extends s{_parse($){if(this._getType($)!==h.undefined){let w=this._getOrReturnCtx($);return R(w,{code:P.invalid_type,expected:h.undefined,received:w.parsedType}),r}return T$($.data)}}z6.create=($)=>{return new z6({typeName:m.ZodUndefined,...e($)})};class i6 extends s{_parse($){if(this._getType($)!==h.null){let w=this._getOrReturnCtx($);return R(w,{code:P.invalid_type,expected:h.null,received:w.parsedType}),r}return T$($.data)}}i6.create=($)=>{return new i6({typeName:m.ZodNull,...e($)})};class Uw extends s{constructor(){super(...arguments);this._any=!0}_parse($){return T$($.data)}}Uw.create=($)=>{return new Uw({typeName:m.ZodAny,...e($)})};class n_ extends s{constructor(){super(...arguments);this._unknown=!0}_parse($){return T$($.data)}}n_.create=($)=>{return new n_({typeName:m.ZodUnknown,...e($)})};class Ov extends s{_parse($){let v=this._getOrReturnCtx($);return R(v,{code:P.invalid_type,expected:h.never,received:v.parsedType}),r}}Ov.create=($)=>{return new Ov({typeName:m.ZodNever,...e($)})};class cg extends s{_parse($){if(this._getType($)!==h.undefined){let w=this._getOrReturnCtx($);return R(w,{code:P.invalid_type,expected:h.void,received:w.parsedType}),r}return T$($.data)}}cg.create=($)=>{return new cg({typeName:m.ZodVoid,...e($)})};class Xv extends s{_parse($){let{ctx:v,status:w}=this._processInputParams($),g=this._def;if(v.parsedType!==h.array)return R(v,{code:P.invalid_type,expected:h.array,received:v.parsedType}),r;if(g.exactLength!==null){let b=v.data.length>g.exactLength.value,J=v.data.length<g.exactLength.value;if(b||J)R(v,{code:b?P.too_big:P.too_small,minimum:J?g.exactLength.value:void 0,maximum:b?g.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:g.exactLength.message}),w.dirty()}if(g.minLength!==null){if(v.data.length<g.minLength.value)R(v,{code:P.too_small,minimum:g.minLength.value,type:"array",inclusive:!0,exact:!1,message:g.minLength.message}),w.dirty()}if(g.maxLength!==null){if(v.data.length>g.maxLength.value)R(v,{code:P.too_big,maximum:g.maxLength.value,type:"array",inclusive:!0,exact:!1,message:g.maxLength.message}),w.dirty()}if(v.common.async)return Promise.all([...v.data].map((b,J)=>{return g.type._parseAsync(new Yv(v,b,v.path,J))})).then((b)=>{return P$.mergeArray(w,b)});let _=[...v.data].map((b,J)=>{return g.type._parseSync(new Yv(v,b,v.path,J))});return P$.mergeArray(w,_)}get element(){return this._def.type}min($,v){return new Xv({...this._def,minLength:{value:$,message:l.toString(v)}})}max($,v){return new Xv({...this._def,maxLength:{value:$,message:l.toString(v)}})}length($,v){return new Xv({...this._def,exactLength:{value:$,message:l.toString(v)}})}nonempty($){return this.min(1,$)}}Xv.create=($,v)=>{return new Xv({type:$,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,...e(v)})};function F6($){if($ instanceof I$){let v={};for(let w in $.shape){let g=$.shape[w];v[w]=Gv.create(F6(g))}return new I$({...$._def,shape:()=>v})}else if($ instanceof Xv)return new Xv({...$._def,type:F6($.element)});else if($ instanceof Gv)return Gv.create(F6($.unwrap()));else if($ instanceof Zv)return Zv.create(F6($.unwrap()));else if($ instanceof Nv)return Nv.create($.items.map((v)=>F6(v)));else return $}class I$ extends s{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),v=w$.objectKeys($);return this._cached={shape:$,keys:v}}_parse($){if(this._getType($)!==h.object){let X=this._getOrReturnCtx($);return R(X,{code:P.invalid_type,expected:h.object,received:X.parsedType}),r}let{status:w,ctx:g}=this._processInputParams($),{shape:_,keys:b}=this._getCached(),J=[];if(!(this._def.catchall instanceof Ov&&this._def.unknownKeys==="strip")){for(let X in g.data)if(!b.includes(X))J.push(X)}let D=[];for(let X of b){let G=_[X],Y=g.data[X];D.push({key:{status:"valid",value:X},value:G._parse(new Yv(g,Y,g.path,X)),alwaysSet:X in g.data})}if(this._def.catchall instanceof Ov){let X=this._def.unknownKeys;if(X==="passthrough")for(let G of J)D.push({key:{status:"valid",value:G},value:{status:"valid",value:g.data[G]}});else if(X==="strict"){if(J.length>0)R(g,{code:P.unrecognized_keys,keys:J}),w.dirty()}else if(X==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let X=this._def.catchall;for(let G of J){let Y=g.data[G];D.push({key:{status:"valid",value:G},value:X._parse(new Yv(g,Y,g.path,G)),alwaysSet:G in g.data})}}if(g.common.async)return Promise.resolve().then(async()=>{let X=[];for(let G of D){let Y=await G.key,Q=await G.value;X.push({key:Y,value:Q,alwaysSet:G.alwaysSet})}return X}).then((X)=>{return P$.mergeObjectSync(w,X)});else return P$.mergeObjectSync(w,D)}get shape(){return this._def.shape()}strict($){return l.errToObj,new I$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(v,w)=>{var g,_,b,J;let D=(b=(_=(g=this._def).errorMap)===null||_===void 0?void 0:_.call(g,v,w).message)!==null&&b!==void 0?b:w.defaultError;if(v.code==="unrecognized_keys")return{message:(J=l.errToObj($).message)!==null&&J!==void 0?J:D};return{message:D}}}:{}})}strip(){return new I$({...this._def,unknownKeys:"strip"})}passthrough(){return new I$({...this._def,unknownKeys:"passthrough"})}extend($){return new I$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new I$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:m.ZodObject})}setKey($,v){return this.augment({[$]:v})}catchall($){return new I$({...this._def,catchall:$})}pick($){let v={};return w$.objectKeys($).forEach((w)=>{if($[w]&&this.shape[w])v[w]=this.shape[w]}),new I$({...this._def,shape:()=>v})}omit($){let v={};return w$.objectKeys(this.shape).forEach((w)=>{if(!$[w])v[w]=this.shape[w]}),new I$({...this._def,shape:()=>v})}deepPartial(){return F6(this)}partial($){let v={};return w$.objectKeys(this.shape).forEach((w)=>{let g=this.shape[w];if($&&!$[w])v[w]=g;else v[w]=g.optional()}),new I$({...this._def,shape:()=>v})}required($){let v={};return w$.objectKeys(this.shape).forEach((w)=>{if($&&!$[w])v[w]=this.shape[w];else{let _=this.shape[w];while(_ instanceof Gv)_=_._def.innerType;v[w]=_}}),new I$({...this._def,shape:()=>v})}keyof(){return s7(w$.objectKeys(this.shape))}}I$.create=($,v)=>{return new I$({shape:()=>$,unknownKeys:"strip",catchall:Ov.create(),typeName:m.ZodObject,...e(v)})};I$.strictCreate=($,v)=>{return new I$({shape:()=>$,unknownKeys:"strict",catchall:Ov.create(),typeName:m.ZodObject,...e(v)})};I$.lazycreate=($,v)=>{return new I$({shape:$,unknownKeys:"strip",catchall:Ov.create(),typeName:m.ZodObject,...e(v)})};class n6 extends s{_parse($){let{ctx:v}=this._processInputParams($),w=this._def.options;function g(_){for(let J of _)if(J.result.status==="valid")return J.result;for(let J of _)if(J.result.status==="dirty")return v.common.issues.push(...J.ctx.common.issues),J.result;let b=_.map((J)=>new c$(J.ctx.common.issues));return R(v,{code:P.invalid_union,unionErrors:b}),r}if(v.common.async)return Promise.all(w.map(async(_)=>{let b={...v,common:{...v.common,issues:[]},parent:null};return{result:await _._parseAsync({data:v.data,path:v.path,parent:b}),ctx:b}})).then(g);else{let _=void 0,b=[];for(let D of w){let X={...v,common:{...v.common,issues:[]},parent:null},G=D._parseSync({data:v.data,path:v.path,parent:X});if(G.status==="valid")return G;else if(G.status==="dirty"&&!_)_={result:G,ctx:X};if(X.common.issues.length)b.push(X.common.issues)}if(_)return v.common.issues.push(..._.ctx.common.issues),_.result;let J=b.map((D)=>new c$(D));return R(v,{code:P.invalid_union,unionErrors:J}),r}}get options(){return this._def.options}}n6.create=($,v)=>{return new n6({options:$,typeName:m.ZodUnion,...e(v)})};var Cv=($)=>{if($ instanceof A6)return Cv($.schema);else if($ instanceof a$)return Cv($.innerType());else if($ instanceof M6)return[$.value];else if($ instanceof M_)return $.options;else if($ instanceof f6)return w$.objectValues($.enum);else if($ instanceof S6)return Cv($._def.innerType);else if($ instanceof z6)return[void 0];else if($ instanceof i6)return[null];else if($ instanceof Gv)return[void 0,...Cv($.unwrap())];else if($ instanceof Zv)return[null,...Cv($.unwrap())];else if($ instanceof DU)return Cv($.unwrap());else if($ instanceof u6)return Cv($.unwrap());else if($ instanceof T6)return Cv($._def.innerType);else return[]};class JU extends s{_parse($){let{ctx:v}=this._processInputParams($);if(v.parsedType!==h.object)return R(v,{code:P.invalid_type,expected:h.object,received:v.parsedType}),r;let w=this.discriminator,g=v.data[w],_=this.optionsMap.get(g);if(!_)return R(v,{code:P.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[w]}),r;if(v.common.async)return _._parseAsync({data:v.data,path:v.path,parent:v});else return _._parseSync({data:v.data,path:v.path,parent:v})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,v,w){let g=new Map;for(let _ of v){let b=Cv(_.shape[$]);if(!b.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let J of b){if(g.has(J))throw Error(`Discriminator property ${String($)} has duplicate value ${String(J)}`);g.set(J,_)}}return new JU({typeName:m.ZodDiscriminatedUnion,discriminator:$,options:v,optionsMap:g,...e(w)})}}function b8($,v){let w=Ev($),g=Ev(v);if($===v)return{valid:!0,data:$};else if(w===h.object&&g===h.object){let _=w$.objectKeys(v),b=w$.objectKeys($).filter((D)=>_.indexOf(D)!==-1),J={...$,...v};for(let D of b){let X=b8($[D],v[D]);if(!X.valid)return{valid:!1};J[D]=X.data}return{valid:!0,data:J}}else if(w===h.array&&g===h.array){if($.length!==v.length)return{valid:!1};let _=[];for(let b=0;b<$.length;b++){let J=$[b],D=v[b],X=b8(J,D);if(!X.valid)return{valid:!1};_.push(X.data)}return{valid:!0,data:_}}else if(w===h.date&&g===h.date&&+$===+v)return{valid:!0,data:$};else return{valid:!1}}class P6 extends s{_parse($){let{status:v,ctx:w}=this._processInputParams($),g=(_,b)=>{if(w8(_)||w8(b))return r;let J=b8(_.value,b.value);if(!J.valid)return R(w,{code:P.invalid_intersection_types}),r;if(g8(_)||g8(b))v.dirty();return{status:v.value,value:J.data}};if(w.common.async)return Promise.all([this._def.left._parseAsync({data:w.data,path:w.path,parent:w}),this._def.right._parseAsync({data:w.data,path:w.path,parent:w})]).then(([_,b])=>g(_,b));else return g(this._def.left._parseSync({data:w.data,path:w.path,parent:w}),this._def.right._parseSync({data:w.data,path:w.path,parent:w}))}}P6.create=($,v,w)=>{return new P6({left:$,right:v,typeName:m.ZodIntersection,...e(w)})};class Nv extends s{_parse($){let{status:v,ctx:w}=this._processInputParams($);if(w.parsedType!==h.array)return R(w,{code:P.invalid_type,expected:h.array,received:w.parsedType}),r;if(w.data.length<this._def.items.length)return R(w,{code:P.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r;if(!this._def.rest&&w.data.length>this._def.items.length)R(w,{code:P.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v.dirty();let _=[...w.data].map((b,J)=>{let D=this._def.items[J]||this._def.rest;if(!D)return null;return D._parse(new Yv(w,b,w.path,J))}).filter((b)=>!!b);if(w.common.async)return Promise.all(_).then((b)=>{return P$.mergeArray(v,b)});else return P$.mergeArray(v,_)}get items(){return this._def.items}rest($){return new Nv({...this._def,rest:$})}}Nv.create=($,v)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Nv({items:$,typeName:m.ZodTuple,rest:null,...e(v)})};class yg extends s{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:v,ctx:w}=this._processInputParams($);if(w.parsedType!==h.object)return R(w,{code:P.invalid_type,expected:h.object,received:w.parsedType}),r;let g=[],_=this._def.keyType,b=this._def.valueType;for(let J in w.data)g.push({key:_._parse(new Yv(w,J,w.path,J)),value:b._parse(new Yv(w,w.data[J],w.path,J)),alwaysSet:J in w.data});if(w.common.async)return P$.mergeObjectAsync(v,g);else return P$.mergeObjectSync(v,g)}get element(){return this._def.valueType}static create($,v,w){if(v instanceof s)return new yg({keyType:$,valueType:v,typeName:m.ZodRecord,...e(w)});return new yg({keyType:Dv.create(),valueType:$,typeName:m.ZodRecord,...e(v)})}}class mg extends s{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:v,ctx:w}=this._processInputParams($);if(w.parsedType!==h.map)return R(w,{code:P.invalid_type,expected:h.map,received:w.parsedType}),r;let g=this._def.keyType,_=this._def.valueType,b=[...w.data.entries()].map(([J,D],X)=>{return{key:g._parse(new Yv(w,J,w.path,[X,"key"])),value:_._parse(new Yv(w,D,w.path,[X,"value"]))}});if(w.common.async){let J=new Map;return Promise.resolve().then(async()=>{for(let D of b){let X=await D.key,G=await D.value;if(X.status==="aborted"||G.status==="aborted")return r;if(X.status==="dirty"||G.status==="dirty")v.dirty();J.set(X.value,G.value)}return{status:v.value,value:J}})}else{let J=new Map;for(let D of b){let{key:X,value:G}=D;if(X.status==="aborted"||G.status==="aborted")return r;if(X.status==="dirty"||G.status==="dirty")v.dirty();J.set(X.value,G.value)}return{status:v.value,value:J}}}}mg.create=($,v,w)=>{return new mg({valueType:v,keyType:$,typeName:m.ZodMap,...e(w)})};class Jw extends s{_parse($){let{status:v,ctx:w}=this._processInputParams($);if(w.parsedType!==h.set)return R(w,{code:P.invalid_type,expected:h.set,received:w.parsedType}),r;let g=this._def;if(g.minSize!==null){if(w.data.size<g.minSize.value)R(w,{code:P.too_small,minimum:g.minSize.value,type:"set",inclusive:!0,exact:!1,message:g.minSize.message}),v.dirty()}if(g.maxSize!==null){if(w.data.size>g.maxSize.value)R(w,{code:P.too_big,maximum:g.maxSize.value,type:"set",inclusive:!0,exact:!1,message:g.maxSize.message}),v.dirty()}let _=this._def.valueType;function b(D){let X=new Set;for(let G of D){if(G.status==="aborted")return r;if(G.status==="dirty")v.dirty();X.add(G.value)}return{status:v.value,value:X}}let J=[...w.data.values()].map((D,X)=>_._parse(new Yv(w,D,w.path,X)));if(w.common.async)return Promise.all(J).then((D)=>b(D));else return b(J)}min($,v){return new Jw({...this._def,minSize:{value:$,message:l.toString(v)}})}max($,v){return new Jw({...this._def,maxSize:{value:$,message:l.toString(v)}})}size($,v){return this.min($,v).max($,v)}nonempty($){return this.min(1,$)}}Jw.create=($,v)=>{return new Jw({valueType:$,minSize:null,maxSize:null,typeName:m.ZodSet,...e(v)})};class O6 extends s{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:v}=this._processInputParams($);if(v.parsedType!==h.function)return R(v,{code:P.invalid_type,expected:h.function,received:v.parsedType}),r;function w(J,D){return bU({data:J,path:v.path,errorMaps:[v.common.contextualErrorMap,v.schemaErrorMap,gU(),N6].filter((X)=>!!X),issueData:{code:P.invalid_arguments,argumentsError:D}})}function g(J,D){return bU({data:J,path:v.path,errorMaps:[v.common.contextualErrorMap,v.schemaErrorMap,gU(),N6].filter((X)=>!!X),issueData:{code:P.invalid_return_type,returnTypeError:D}})}let _={errorMap:v.common.contextualErrorMap},b=v.data;if(this._def.returns instanceof Dw){let J=this;return T$(async function(...D){let X=new c$([]),G=await J._def.args.parseAsync(D,_).catch((W)=>{throw X.addIssue(w(D,W)),X}),Y=await Reflect.apply(b,this,G);return await J._def.returns._def.type.parseAsync(Y,_).catch((W)=>{throw X.addIssue(g(Y,W)),X})})}else{let J=this;return T$(function(...D){let X=J._def.args.safeParse(D,_);if(!X.success)throw new c$([w(D,X.error)]);let G=Reflect.apply(b,this,X.data),Y=J._def.returns.safeParse(G,_);if(!Y.success)throw new c$([g(G,Y.error)]);return Y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new O6({...this._def,args:Nv.create($).rest(n_.create())})}returns($){return new O6({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,v,w){return new O6({args:$?$:Nv.create([]).rest(n_.create()),returns:v||n_.create(),typeName:m.ZodFunction,...e(w)})}}class A6 extends s{get schema(){return this._def.getter()}_parse($){let{ctx:v}=this._processInputParams($);return this._def.getter()._parse({data:v.data,path:v.path,parent:v})}}A6.create=($,v)=>{return new A6({getter:$,typeName:m.ZodLazy,...e(v)})};class M6 extends s{_parse($){if($.data!==this._def.value){let v=this._getOrReturnCtx($);return R(v,{received:v.data,code:P.invalid_literal,expected:this._def.value}),r}return{status:"valid",value:$.data}}get value(){return this._def.value}}M6.create=($,v)=>{return new M6({value:$,typeName:m.ZodLiteral,...e(v)})};function s7($,v){return new M_({values:$,typeName:m.ZodEnum,...e(v)})}class M_ extends s{constructor(){super(...arguments);Zg.set(this,void 0)}_parse($){if(typeof $.data!=="string"){let v=this._getOrReturnCtx($),w=this._def.values;return R(v,{expected:w$.joinValues(w),received:v.parsedType,code:P.invalid_type}),r}if(!UU(this,Zg,"f"))t7(this,Zg,new Set(this._def.values),"f");if(!UU(this,Zg,"f").has($.data)){let v=this._getOrReturnCtx($),w=this._def.values;return R(v,{received:v.data,code:P.invalid_enum_value,options:w}),r}return T$($.data)}get options(){return this._def.values}get enum(){let $={};for(let v of this._def.values)$[v]=v;return $}get Values(){let $={};for(let v of this._def.values)$[v]=v;return $}get Enum(){let $={};for(let v of this._def.values)$[v]=v;return $}extract($,v=this._def){return M_.create($,{...this._def,...v})}exclude($,v=this._def){return M_.create(this.options.filter((w)=>!$.includes(w)),{...this._def,...v})}}Zg=new WeakMap;M_.create=s7;class f6 extends s{constructor(){super(...arguments);hg.set(this,void 0)}_parse($){let v=w$.getValidEnumValues(this._def.values),w=this._getOrReturnCtx($);if(w.parsedType!==h.string&&w.parsedType!==h.number){let g=w$.objectValues(v);return R(w,{expected:w$.joinValues(g),received:w.parsedType,code:P.invalid_type}),r}if(!UU(this,hg,"f"))t7(this,hg,new Set(w$.getValidEnumValues(this._def.values)),"f");if(!UU(this,hg,"f").has($.data)){let g=w$.objectValues(v);return R(w,{received:w.data,code:P.invalid_enum_value,options:g}),r}return T$($.data)}get enum(){return this._def.values}}hg=new WeakMap;f6.create=($,v)=>{return new f6({values:$,typeName:m.ZodNativeEnum,...e(v)})};class Dw extends s{unwrap(){return this._def.type}_parse($){let{ctx:v}=this._processInputParams($);if(v.parsedType!==h.promise&&v.common.async===!1)return R(v,{code:P.invalid_type,expected:h.promise,received:v.parsedType}),r;let w=v.parsedType===h.promise?v.data:Promise.resolve(v.data);return T$(w.then((g)=>{return this._def.type.parseAsync(g,{path:v.path,errorMap:v.common.contextualErrorMap})}))}}Dw.create=($,v)=>{return new Dw({type:$,typeName:m.ZodPromise,...e(v)})};class a$ extends s{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:v,ctx:w}=this._processInputParams($),g=this._def.effect||null,_={addIssue:(b)=>{if(R(w,b),b.fatal)v.abort();else v.dirty()},get path(){return w.path}};if(_.addIssue=_.addIssue.bind(_),g.type==="preprocess"){let b=g.transform(w.data,_);if(w.common.async)return Promise.resolve(b).then(async(J)=>{if(v.value==="aborted")return r;let D=await this._def.schema._parseAsync({data:J,path:w.path,parent:w});if(D.status==="aborted")return r;if(D.status==="dirty")return K6(D.value);if(v.value==="dirty")return K6(D.value);return D});else{if(v.value==="aborted")return r;let J=this._def.schema._parseSync({data:b,path:w.path,parent:w});if(J.status==="aborted")return r;if(J.status==="dirty")return K6(J.value);if(v.value==="dirty")return K6(J.value);return J}}if(g.type==="refinement"){let b=(J)=>{let D=g.refinement(J,_);if(w.common.async)return Promise.resolve(D);if(D instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return J};if(w.common.async===!1){let J=this._def.schema._parseSync({data:w.data,path:w.path,parent:w});if(J.status==="aborted")return r;if(J.status==="dirty")v.dirty();return b(J.value),{status:v.value,value:J.value}}else return this._def.schema._parseAsync({data:w.data,path:w.path,parent:w}).then((J)=>{if(J.status==="aborted")return r;if(J.status==="dirty")v.dirty();return b(J.value).then(()=>{return{status:v.value,value:J.value}})})}if(g.type==="transform")if(w.common.async===!1){let b=this._def.schema._parseSync({data:w.data,path:w.path,parent:w});if(!gw(b))return b;let J=g.transform(b.value,_);if(J instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:v.value,value:J}}else return this._def.schema._parseAsync({data:w.data,path:w.path,parent:w}).then((b)=>{if(!gw(b))return b;return Promise.resolve(g.transform(b.value,_)).then((J)=>({status:v.value,value:J}))});w$.assertNever(g)}}a$.create=($,v,w)=>{return new a$({schema:$,typeName:m.ZodEffects,effect:v,...e(w)})};a$.createWithPreprocess=($,v,w)=>{return new a$({schema:v,effect:{type:"preprocess",transform:$},typeName:m.ZodEffects,...e(w)})};class Gv extends s{_parse($){if(this._getType($)===h.undefined)return T$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Gv.create=($,v)=>{return new Gv({innerType:$,typeName:m.ZodOptional,...e(v)})};class Zv extends s{_parse($){if(this._getType($)===h.null)return T$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Zv.create=($,v)=>{return new Zv({innerType:$,typeName:m.ZodNullable,...e(v)})};class S6 extends s{_parse($){let{ctx:v}=this._processInputParams($),w=v.data;if(v.parsedType===h.undefined)w=this._def.defaultValue();return this._def.innerType._parse({data:w,path:v.path,parent:v})}removeDefault(){return this._def.innerType}}S6.create=($,v)=>{return new S6({innerType:$,typeName:m.ZodDefault,defaultValue:typeof v.default==="function"?v.default:()=>v.default,...e(v)})};class T6 extends s{_parse($){let{ctx:v}=this._processInputParams($),w={...v,common:{...v.common,issues:[]}},g=this._def.innerType._parse({data:w.data,path:w.path,parent:{...w}});if(xg(g))return g.then((_)=>{return{status:"valid",value:_.status==="valid"?_.value:this._def.catchValue({get error(){return new c$(w.common.issues)},input:w.data})}});else return{status:"valid",value:g.status==="valid"?g.value:this._def.catchValue({get error(){return new c$(w.common.issues)},input:w.data})}}removeCatch(){return this._def.innerType}}T6.create=($,v)=>{return new T6({innerType:$,typeName:m.ZodCatch,catchValue:typeof v.catch==="function"?v.catch:()=>v.catch,...e(v)})};class rg extends s{_parse($){if(this._getType($)!==h.nan){let w=this._getOrReturnCtx($);return R(w,{code:P.invalid_type,expected:h.nan,received:w.parsedType}),r}return{status:"valid",value:$.data}}}rg.create=($)=>{return new rg({typeName:m.ZodNaN,...e($)})};var gP=Symbol("zod_brand");class DU extends s{_parse($){let{ctx:v}=this._processInputParams($),w=v.data;return this._def.type._parse({data:w,path:v.path,parent:v})}unwrap(){return this._def.type}}class og extends s{_parse($){let{status:v,ctx:w}=this._processInputParams($);if(w.common.async)return(async()=>{let _=await this._def.in._parseAsync({data:w.data,path:w.path,parent:w});if(_.status==="aborted")return r;if(_.status==="dirty")return v.dirty(),K6(_.value);else return this._def.out._parseAsync({data:_.value,path:w.path,parent:w})})();else{let g=this._def.in._parseSync({data:w.data,path:w.path,parent:w});if(g.status==="aborted")return r;if(g.status==="dirty")return v.dirty(),{status:"dirty",value:g.value};else return this._def.out._parseSync({data:g.value,path:w.path,parent:w})}}static create($,v){return new og({in:$,out:v,typeName:m.ZodPipeline})}}class u6 extends s{_parse($){let v=this._def.innerType._parse($),w=(g)=>{if(gw(g))g.value=Object.freeze(g.value);return g};return xg(v)?v.then((g)=>w(g)):w(v)}unwrap(){return this._def.innerType}}u6.create=($,v)=>{return new u6({innerType:$,typeName:m.ZodReadonly,...e(v)})};function $Q($,v={},w){if($)return Uw.create().superRefine((g,_)=>{var b,J;if(!$(g)){let D=typeof v==="function"?v(g):typeof v==="string"?{message:v}:v,X=(J=(b=D.fatal)!==null&&b!==void 0?b:w)!==null&&J!==void 0?J:!0,G=typeof D==="string"?{message:D}:D;_.addIssue({code:"custom",...G,fatal:X})}});return Uw.create()}var bP={object:I$.lazycreate},m;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(m||(m={}));var UP=($,v={message:`Input not instance of ${$.name}`})=>$Q((w)=>w instanceof $,v),vQ=Dv.create,_Q=P_.create,JP=rg.create,DP=A_.create,wQ=k6.create,XP=bw.create,GP=lg.create,YP=z6.create,QP=i6.create,WP=Uw.create,HP=n_.create,qP=Ov.create,IP=cg.create,BP=Xv.create,LP=I$.create,VP=I$.strictCreate,jP=n6.create,FP=JU.create,KP=P6.create,OP=Nv.create,NP=yg.create,kP=mg.create,zP=Jw.create,iP=O6.create,nP=A6.create,PP=M6.create,AP=M_.create,MP=f6.create,fP=Dw.create,o7=a$.create,SP=Gv.create,TP=Zv.create,uP=a$.createWithPreprocess,RP=og.create,CP=()=>vQ().optional(),EP=()=>_Q().optional(),ZP=()=>wQ().optional(),hP={string:($)=>Dv.create({...$,coerce:!0}),number:($)=>P_.create({...$,coerce:!0}),boolean:($)=>k6.create({...$,coerce:!0}),bigint:($)=>A_.create({...$,coerce:!0}),date:($)=>bw.create({...$,coerce:!0})},xP=r,B=Object.freeze({__proto__:null,defaultErrorMap:N6,setErrorMap:un,getErrorMap:gU,makeIssue:bU,EMPTY_PATH:Rn,addIssueToContext:R,ParseStatus:P$,INVALID:r,DIRTY:K6,OK:T$,isAborted:w8,isDirty:g8,isValid:gw,isAsync:xg,get util(){return w$},get objectUtil(){return _8},ZodParsedType:h,getParsedType:Ev,ZodType:s,datetimeRegex:a7,ZodString:Dv,ZodNumber:P_,ZodBigInt:A_,ZodBoolean:k6,ZodDate:bw,ZodSymbol:lg,ZodUndefined:z6,ZodNull:i6,ZodAny:Uw,ZodUnknown:n_,ZodNever:Ov,ZodVoid:cg,ZodArray:Xv,ZodObject:I$,ZodUnion:n6,ZodDiscriminatedUnion:JU,ZodIntersection:P6,ZodTuple:Nv,ZodRecord:yg,ZodMap:mg,ZodSet:Jw,ZodFunction:O6,ZodLazy:A6,ZodLiteral:M6,ZodEnum:M_,ZodNativeEnum:f6,ZodPromise:Dw,ZodEffects:a$,ZodTransformer:a$,ZodOptional:Gv,ZodNullable:Zv,ZodDefault:S6,ZodCatch:T6,ZodNaN:rg,BRAND:gP,ZodBranded:DU,ZodPipeline:og,ZodReadonly:u6,custom:$Q,Schema:s,ZodSchema:s,late:bP,get ZodFirstPartyTypeKind(){return m},coerce:hP,any:WP,array:BP,bigint:DP,boolean:wQ,date:XP,discriminatedUnion:FP,effect:o7,enum:AP,function:iP,instanceof:UP,intersection:KP,lazy:nP,literal:PP,map:kP,nan:JP,nativeEnum:MP,never:qP,null:QP,nullable:TP,number:_Q,object:LP,oboolean:ZP,onumber:EP,optional:SP,ostring:CP,pipeline:RP,preprocess:uP,promise:fP,record:NP,set:zP,strictObject:VP,string:vQ,symbol:GP,transformer:o7,tuple:OP,undefined:YP,union:jP,unknown:HP,void:IP,NEVER:xP,ZodIssueCode:P,quotelessJson:Tn,ZodError:c$});var U8="2024-11-05",gQ=[U8,"2024-10-07"],XU="2.0",bQ=B.union([B.string(),B.number().int()]),UQ=B.string(),Qv=B.object({_meta:B.optional(B.object({progressToken:B.optional(bQ)}).passthrough())}).passthrough(),y$=B.object({method:B.string(),params:B.optional(Qv)}),dg=B.object({_meta:B.optional(B.object({}).passthrough())}).passthrough(),kv=B.object({method:B.string(),params:B.optional(dg)}),Wv=B.object({_meta:B.optional(B.object({}).passthrough())}).passthrough(),GU=B.union([B.string(),B.number().int()]),lP=B.object({jsonrpc:B.literal(XU),id:GU}).merge(y$).strict(),cP=B.object({jsonrpc:B.literal(XU)}).merge(kv).strict(),yP=B.object({jsonrpc:B.literal(XU),id:GU,result:Wv}).strict(),Xw;(function($){$[$.ConnectionClosed=-1]="ConnectionClosed",$[$.RequestTimeout=-2]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError"})(Xw||(Xw={}));var mP=B.object({jsonrpc:B.literal(XU),id:GU,error:B.object({code:B.number().int(),message:B.string(),data:B.optional(B.unknown())})}).strict(),JQ=B.union([lP,cP,yP,mP]),YU=Wv.strict(),QU=kv.extend({method:B.literal("notifications/cancelled"),params:dg.extend({requestId:GU,reason:B.string().optional()})}),DQ=B.object({name:B.string(),version:B.string()}).passthrough(),rP=B.object({experimental:B.optional(B.object({}).passthrough()),sampling:B.optional(B.object({}).passthrough()),roots:B.optional(B.object({listChanged:B.optional(B.boolean())}).passthrough())}).passthrough(),J8=y$.extend({method:B.literal("initialize"),params:Qv.extend({protocolVersion:B.string(),capabilities:rP,clientInfo:DQ})}),oP=B.object({experimental:B.optional(B.object({}).passthrough()),logging:B.optional(B.object({}).passthrough()),prompts:B.optional(B.object({listChanged:B.optional(B.boolean())}).passthrough()),resources:B.optional(B.object({subscribe:B.optional(B.boolean()),listChanged:B.optional(B.boolean())}).passthrough()),tools:B.optional(B.object({listChanged:B.optional(B.boolean())}).passthrough())}).passthrough(),dP=Wv.extend({protocolVersion:B.string(),capabilities:oP,serverInfo:DQ}),D8=kv.extend({method:B.literal("notifications/initialized")}),WU=y$.extend({method:B.literal("ping")}),tP=B.object({progress:B.number(),total:B.optional(B.number())}).passthrough(),HU=kv.extend({method:B.literal("notifications/progress"),params:dg.merge(tP).extend({progressToken:bQ})}),qU=y$.extend({params:Qv.extend({cursor:B.optional(UQ)}).optional()}),IU=Wv.extend({nextCursor:B.optional(UQ)}),XQ=B.object({uri:B.string(),mimeType:B.optional(B.string())}).passthrough(),GQ=XQ.extend({text:B.string()}),YQ=XQ.extend({blob:B.string().base64()}),pP=B.object({uri:B.string(),name:B.string(),description:B.optional(B.string()),mimeType:B.optional(B.string())}).passthrough(),eP=B.object({uriTemplate:B.string(),name:B.string(),description:B.optional(B.string()),mimeType:B.optional(B.string())}).passthrough(),aP=qU.extend({method:B.literal("resources/list")}),sP=IU.extend({resources:B.array(pP)}),$A=qU.extend({method:B.literal("resources/templates/list")}),vA=IU.extend({resourceTemplates:B.array(eP)}),_A=y$.extend({method:B.literal("resources/read"),params:Qv.extend({uri:B.string()})}),wA=Wv.extend({contents:B.array(B.union([GQ,YQ]))}),gA=kv.extend({method:B.literal("notifications/resources/list_changed")}),bA=y$.extend({method:B.literal("resources/subscribe"),params:Qv.extend({uri:B.string()})}),UA=y$.extend({method:B.literal("resources/unsubscribe"),params:Qv.extend({uri:B.string()})}),JA=kv.extend({method:B.literal("notifications/resources/updated"),params:dg.extend({uri:B.string()})}),DA=B.object({name:B.string(),description:B.optional(B.string()),required:B.optional(B.boolean())}).passthrough(),XA=B.object({name:B.string(),description:B.optional(B.string()),arguments:B.optional(B.array(DA))}).passthrough(),GA=qU.extend({method:B.literal("prompts/list")}),YA=IU.extend({prompts:B.array(XA)}),QA=y$.extend({method:B.literal("prompts/get"),params:Qv.extend({name:B.string(),arguments:B.optional(B.record(B.string()))})}),BU=B.object({type:B.literal("text"),text:B.string()}).passthrough(),LU=B.object({type:B.literal("image"),data:B.string().base64(),mimeType:B.string()}).passthrough(),QQ=B.object({type:B.literal("resource"),resource:B.union([GQ,YQ])}).passthrough(),WA=B.object({role:B.enum(["user","assistant"]),content:B.union([BU,LU,QQ])}).passthrough(),HA=Wv.extend({description:B.optional(B.string()),messages:B.array(WA)}),qA=kv.extend({method:B.literal("notifications/prompts/list_changed")}),IA=B.object({name:B.string(),description:B.optional(B.string()),inputSchema:B.object({type:B.literal("object"),properties:B.optional(B.object({}).passthrough())}).passthrough()}).passthrough(),X8=qU.extend({method:B.literal("tools/list")}),BA=IU.extend({tools:B.array(IA)}),WQ=Wv.extend({content:B.array(B.union([BU,LU,QQ])),isError:B.boolean().default(!1).optional()}),Hl=WQ.or(Wv.extend({toolResult:B.unknown()})),G8=y$.extend({method:B.literal("tools/call"),params:Qv.extend({name:B.string(),arguments:B.optional(B.record(B.unknown()))})}),LA=kv.extend({method:B.literal("notifications/tools/list_changed")}),HQ=B.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),VA=y$.extend({method:B.literal("logging/setLevel"),params:Qv.extend({level:HQ})}),jA=kv.extend({method:B.literal("notifications/message"),params:dg.extend({level:HQ,logger:B.optional(B.string()),data:B.unknown()})}),FA=B.object({name:B.string().optional()}).passthrough(),KA=B.object({hints:B.optional(B.array(FA)),costPriority:B.optional(B.number().min(0).max(1)),speedPriority:B.optional(B.number().min(0).max(1)),intelligencePriority:B.optional(B.number().min(0).max(1))}).passthrough(),OA=B.object({role:B.enum(["user","assistant"]),content:B.union([BU,LU])}).passthrough(),NA=y$.extend({method:B.literal("sampling/createMessage"),params:Qv.extend({messages:B.array(OA),systemPrompt:B.optional(B.string()),includeContext:B.optional(B.enum(["none","thisServer","allServers"])),temperature:B.optional(B.number()),maxTokens:B.number().int(),stopSequences:B.optional(B.array(B.string())),metadata:B.optional(B.object({}).passthrough()),modelPreferences:B.optional(KA)})}),Y8=Wv.extend({model:B.string(),stopReason:B.optional(B.enum(["endTurn","stopSequence","maxTokens"]).or(B.string())),role:B.enum(["user","assistant"]),content:B.discriminatedUnion("type",[BU,LU])}),kA=B.object({type:B.literal("ref/resource"),uri:B.string()}).passthrough(),zA=B.object({type:B.literal("ref/prompt"),name:B.string()}).passthrough(),iA=y$.extend({method:B.literal("completion/complete"),params:Qv.extend({ref:B.union([zA,kA]),argument:B.object({name:B.string(),value:B.string()}).passthrough()})}),nA=Wv.extend({completion:B.object({values:B.array(B.string()).max(100),total:B.optional(B.number().int()),hasMore:B.optional(B.boolean())}).passthrough()}),PA=B.object({uri:B.string().startsWith("file://"),name:B.optional(B.string())}).passthrough(),AA=y$.extend({method:B.literal("roots/list")}),Q8=Wv.extend({roots:B.array(PA)}),MA=kv.extend({method:B.literal("notifications/roots/list_changed")}),ql=B.union([WU,J8,iA,VA,QA,GA,aP,$A,_A,bA,UA,G8,X8]),Il=B.union([QU,HU,D8,MA]),Bl=B.union([YU,Y8,Q8]),Ll=B.union([WU,NA,AA]),Vl=B.union([QU,HU,jA,JA,gA,LA,qA]),jl=B.union([YU,dP,nA,HA,YA,sP,vA,wA,WQ,BA]);class tg extends Error{constructor($,v,w){super(`MCP error ${$}: ${v}`);this.code=$,this.data=w}}var fA=60000;class W8{constructor($){this._options=$,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this.setNotificationHandler(QU,(v)=>{let w=this._requestHandlerAbortControllers.get(v.params.requestId);w===null||w===void 0||w.abort(v.params.reason)}),this.setNotificationHandler(HU,(v)=>{this._onprogress(v)}),this.setRequestHandler(WU,(v)=>({}))}async connect($){this._transport=$,this._transport.onclose=()=>{this._onclose()},this._transport.onerror=(v)=>{this._onerror(v)},this._transport.onmessage=(v)=>{if(!("method"in v))this._onresponse(v);else if("id"in v)this._onrequest(v);else this._onnotification(v)},await this._transport.start()}_onclose(){var $;let v=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._transport=void 0,($=this.onclose)===null||$===void 0||$.call(this);let w=new tg(Xw.ConnectionClosed,"Connection closed");for(let g of v.values())g(w)}_onerror($){var v;(v=this.onerror)===null||v===void 0||v.call(this,$)}_onnotification($){var v;let w=(v=this._notificationHandlers.get($.method))!==null&&v!==void 0?v:this.fallbackNotificationHandler;if(w===void 0)return;Promise.resolve().then(()=>w($)).catch((g)=>this._onerror(Error(`Uncaught error in notification handler: ${g}`)))}_onrequest($){var v,w;let g=(v=this._requestHandlers.get($.method))!==null&&v!==void 0?v:this.fallbackRequestHandler;if(g===void 0){(w=this._transport)===null||w===void 0||w.send({jsonrpc:"2.0",id:$.id,error:{code:Xw.MethodNotFound,message:"Method not found"}}).catch((b)=>this._onerror(Error(`Failed to send an error response: ${b}`)));return}let _=new AbortController;this._requestHandlerAbortControllers.set($.id,_),Promise.resolve().then(()=>g($,{signal:_.signal})).then((b)=>{var J;if(_.signal.aborted)return;return(J=this._transport)===null||J===void 0?void 0:J.send({result:b,jsonrpc:"2.0",id:$.id})},(b)=>{var J,D;if(_.signal.aborted)return;return(J=this._transport)===null||J===void 0?void 0:J.send({jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(b.code)?b.code:Xw.InternalError,message:(D=b.message)!==null&&D!==void 0?D:"Internal error"}})}).catch((b)=>this._onerror(Error(`Failed to send response: ${b}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:v,...w}=$.params,g=this._progressHandlers.get(Number(v));if(g===void 0){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}g(w)}_onresponse($){let v=$.id,w=this._responseHandlers.get(Number(v));if(w===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}if(this._responseHandlers.delete(Number(v)),this._progressHandlers.delete(Number(v)),"result"in $)w($);else{let g=new tg($.error.code,$.error.message,$.error.data);w(g)}}get transport(){return this._transport}async close(){var $;await(($=this._transport)===null||$===void 0?void 0:$.close())}request($,v,w){return new Promise((g,_)=>{var b,J,D,X;if(!this._transport){_(Error("Not connected"));return}if(((b=this._options)===null||b===void 0?void 0:b.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod($.method);(J=w===null||w===void 0?void 0:w.signal)===null||J===void 0||J.throwIfAborted();let G=this._requestMessageId++,Y={...$,jsonrpc:"2.0",id:G};if(w===null||w===void 0?void 0:w.onprogress)this._progressHandlers.set(G,w.onprogress),Y.params={...$.params,_meta:{progressToken:G}};let Q=void 0;this._responseHandlers.set(G,(H)=>{var q;if(Q!==void 0)clearTimeout(Q);if((q=w===null||w===void 0?void 0:w.signal)===null||q===void 0?void 0:q.aborted)return;if(H instanceof Error)return _(H);try{let j=v.parse(H.result);g(j)}catch(j){_(j)}});let W=(H)=>{var q;this._responseHandlers.delete(G),this._progressHandlers.delete(G),(q=this._transport)===null||q===void 0||q.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:G,reason:String(H)}}).catch((j)=>this._onerror(Error(`Failed to send cancellation: ${j}`))),_(H)};(D=w===null||w===void 0?void 0:w.signal)===null||D===void 0||D.addEventListener("abort",()=>{var H;if(Q!==void 0)clearTimeout(Q);W((H=w===null||w===void 0?void 0:w.signal)===null||H===void 0?void 0:H.reason)});let I=(X=w===null||w===void 0?void 0:w.timeout)!==null&&X!==void 0?X:fA;Q=setTimeout(()=>W(new tg(Xw.RequestTimeout,"Request timed out",{timeout:I})),I),this._transport.send(Y).catch((H)=>{if(Q!==void 0)clearTimeout(Q);_(H)})})}async notification($){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability($.method);let v={...$,jsonrpc:"2.0"};await this._transport.send(v)}setRequestHandler($,v){let w=$.shape.method.value;this.assertRequestHandlerCapability(w),this._requestHandlers.set(w,(g,_)=>Promise.resolve(v($.parse(g),_)))}removeRequestHandler($){this._requestHandlers.delete($)}setNotificationHandler($,v){this._notificationHandlers.set($.shape.method.value,(w)=>Promise.resolve(v($.parse(w))))}removeNotificationHandler($){this._notificationHandlers.delete($)}}class H8 extends W8{constructor($,v){super(v);this._serverInfo=$,this._capabilities=v.capabilities,this.setRequestHandler(J8,(w)=>this._oninitialize(w)),this.setNotificationHandler(D8,()=>{var w;return(w=this.oninitialized)===null||w===void 0?void 0:w.call(this)})}assertCapabilityForMethod($){var v,w;switch($){case"sampling/createMessage":if(!((v=this._clientCapabilities)===null||v===void 0?void 0:v.sampling))throw Error(`Client does not support sampling (required for ${$})`);break;case"roots/list":if(!((w=this._clientCapabilities)===null||w===void 0?void 0:w.roots))throw Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){switch($){case"sampling/createMessage":if(!this._capabilities.sampling)throw Error(`Server does not support sampling (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${$})`);break;case"ping":case"initialize":break}}async _oninitialize($){let v=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:gQ.includes(v)?v:U8,capabilities:this.getCapabilities(),serverInfo:this._serverInfo}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},YU)}async createMessage($,v){return this.request({method:"sampling/createMessage",params:$},Y8,v)}async listRoots($,v){return this.request({method:"roots/list",params:$},Q8,v)}async sendLoggingMessage($){return this.notification({method:"notifications/message",params:$})}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}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"})}}import IQ from"node:process";class q8{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
179
+ `);if($===-1)return null;let v=this._buffer.toString("utf8",0,$);return this._buffer=this._buffer.subarray($+1),SA(v)}clear(){this._buffer=void 0}}function SA($){return JQ.parse(JSON.parse($))}function qQ($){return JSON.stringify($)+`
180
+ `}class I8{constructor($=IQ.stdin,v=IQ.stdout){this._stdin=$,this._stdout=v,this._readBuffer=new q8,this._started=!1,this._ondata=(w)=>{this._readBuffer.append(w),this.processReadBuffer()},this._onerror=(w)=>{var g;(g=this.onerror)===null||g===void 0||g.call(this,w)}}async start(){if(this._started)throw 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(){var $,v;while(!0)try{let w=this._readBuffer.readMessage();if(w===null)break;($=this.onmessage)===null||$===void 0||$.call(this,w)}catch(w){(v=this.onerror)===null||v===void 0||v.call(this,w)}}async close(){var $;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._readBuffer.clear(),($=this.onclose)===null||$===void 0||$.call(this)}send($){return new Promise((v)=>{let w=qQ($);if(this._stdout.write(w))v();else this._stdout.once("drain",v)})}}function C6($,v){var w={};for(var g in $)if(Object.prototype.hasOwnProperty.call($,g)&&v.indexOf(g)<0)w[g]=$[g];if($!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var _=0,g=Object.getOwnPropertySymbols($);_<g.length;_++)if(v.indexOf(g[_])<0&&Object.prototype.propertyIsEnumerable.call($,g[_]))w[g[_]]=$[g[_]]}return w}var TA={ZodAny:"any",ZodArray:"array",ZodBigInt:"bigint",ZodBoolean:"boolean",ZodDefault:"default",ZodPrefault:"prefault",ZodTransform:"transform",ZodEnum:"enum",ZodIntersection:"intersection",ZodLazy:"lazy",ZodLiteral:"literal",ZodNever:"never",ZodNull:"null",ZodNullable:"nullable",ZodNumber:"number",ZodNonOptional:"nonoptional",ZodObject:"object",ZodOptional:"optional",ZodPipe:"pipe",ZodReadonly:"readonly",ZodRecord:"record",ZodString:"string",ZodTuple:"tuple",ZodType:"type",ZodUnion:"union",ZodDiscriminatedUnion:"union",ZodUnknown:"unknown",ZodVoid:"void",ZodDate:"date",ZodTemplateLiteral:"template_literal"};function xv($,v){return(Array.isArray(v)?v:[v]).some((g)=>{var _;let b=((_=$===null||$===void 0?void 0:$.def)===null||_===void 0?void 0:_.type)===TA[g];if(g==="ZodDiscriminatedUnion")return b&&"discriminator"in $.def;return b})}function R6($){return $&&"def"in $}class LQ{constructor(){this._map=new Map,this._idmap=new Map}add($,...v){let w=v[0];if(this._map.set($,w),w&&typeof w==="object"&&"id"in w){if(this._idmap.has(w.id))throw Error(`ID ${w.id} already exists in the registry`);this._idmap.set(w.id,$)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove($){let v=this._map.get($);if(v&&typeof v==="object"&&"id"in v)this._idmap.delete(v.id);return this._map.delete($),this}get($){let v=$._zod.parent;if(v){let w={...this.get(v)??{}};return delete w.id,{...w,...this._map.get($)}}return this._map.get($)}has($){return this._map.has($)}}function uA(){return new LQ}function B8($){return $===void 0}function RA($,v){let w={};return Object.entries($).forEach(([g,_])=>{if(!v.some((b)=>b===g))w[g]=_}),w}function L8($,v){let w={};return Object.entries($).forEach(([g,_])=>{if(!v(_,g))w[g]=_}),w}var BQ=uA();class lv{static collectMetadata($,v){let w=this.getMetadataFromRegistry($),g=Object.assign(Object.assign({},w===null||w===void 0?void 0:w._internal),v===null||v===void 0?void 0:v._internal),_=Object.assign(Object.assign({},w===null||w===void 0?void 0:w.param),v===null||v===void 0?void 0:v.param),b=Object.assign(Object.assign(Object.assign(Object.assign({},Object.keys(g).length>0?{_internal:g}:{}),w),v),Object.keys(_).length>0?{param:_}:{});if(xv($,["ZodOptional","ZodNullable","ZodDefault","ZodPrefault","ZodReadonly","ZodNonOptional"])&&R6($._zod.def.innerType))return this.collectMetadata($._zod.def.innerType,b);if(xv($,"ZodPipe")){let J=$._zod.def.in,D=$._zod.def.out;if(xv(J,"ZodTransform")&&R6(D))return this.collectMetadata(D,b);if(R6(J))return this.collectMetadata(J,b)}return b}static getMetadata($){return this.collectMetadata($)}static getOpenApiMetadata($){let v=this.collectMetadata($);return C6(v!==null&&v!==void 0?v:{},["_internal"])}static getInternalMetadata($){var v;return(v=this.collectMetadata($))===null||v===void 0?void 0:v._internal}static getParamMetadata($){let v=this.collectMetadata($);return Object.assign(Object.assign({},v),{param:Object.assign(Object.assign({},(v===null||v===void 0?void 0:v.description)?{description:v.description}:{}),v===null||v===void 0?void 0:v.param)})}static buildSchemaMetadata($){return L8(RA($,["param","_internal"]),B8)}static buildParameterMetadata($){return L8($,B8)}static applySchemaMetadata($,v){return L8(Object.assign(Object.assign({},$),this.buildSchemaMetadata(v)),B8)}static getRefId($){var v;return(v=this.getInternalMetadata($))===null||v===void 0?void 0:v.refId}static unwrapChained($){return this.unwrapUntil($)}static getDefaultValue($){var v;let w=(v=this.unwrapUntil($,"ZodDefault"))!==null&&v!==void 0?v:this.unwrapUntil($,"ZodPrefault");return w===null||w===void 0?void 0:w._zod.def.defaultValue}static unwrapUntil($,v){if(v&&xv($,v))return $;if(xv($,["ZodOptional","ZodNullable","ZodDefault","ZodPrefault","ZodReadonly","ZodNonOptional"])&&R6($._zod.def.innerType))return this.unwrapUntil($._zod.def.innerType,v);if(xv($,"ZodPipe")){let w=$._zod.def.in,g=$._zod.def.out;if(xv(w,"ZodTransform")&&R6(g))return this.unwrapUntil(g,v);if(R6(w))return this.unwrapUntil(w,v)}return v?void 0:$}static getMetadataFromInternalRegistry($){return BQ.get($)}static getMetadataFromRegistry($){let v=this.getMetadataFromInternalRegistry($),w=$.meta();if(!v)return w;let{_internal:g}=v,_=C6(v,["_internal"]),b=w!==null&&w!==void 0?w:{},{id:J,title:D}=b,X=C6(b,["id","title"]);return Object.assign(Object.assign(Object.assign({_internal:Object.assign(Object.assign({},J?{refId:J}:{}),g)},_),D?{description:D}:{}),X)}static setMetadataInRegistry($,v){BQ.add($,v)}}function hv($,v){let w=$[v];if(typeof w!=="function")return;$[v]=function(...g){let _=w.apply(this,g),b=lv.getMetadataFromRegistry(this);if(b)lv.setMetadataInRegistry(_,b);return _}}function CA($){if(typeof $.ZodType.prototype.openapi<"u")return;$.ZodType.prototype.openapi=function(...v){let{refId:w,metadata:g,options:_}=EA(...v),b=g!==null&&g!==void 0?g:{},{param:J}=b,D=C6(b,["param"]),X=lv.getMetadataFromRegistry(this),G=X!==null&&X!==void 0?X:{},{_internal:Y}=G,Q=C6(G,["_internal"]),W=Object.assign(Object.assign(Object.assign({},Y),_),w?{refId:w}:void 0),I=Object.assign(Object.assign(Object.assign({},Q),D),(Q===null||Q===void 0?void 0:Q.param)||J?{param:Object.assign(Object.assign({},Q===null||Q===void 0?void 0:Q.param),J)}:void 0),H=new this.constructor(this._def);function q(F){lv.setMetadataInRegistry(F,Object.assign(Object.assign({},Object.keys(W).length>0?{_internal:W}:void 0),I))}if(q(H),xv(H,"ZodLazy"))q(this);if(xv(H,"ZodObject")){let F=lv.getMetadataFromRegistry(H),M=H.extend;H.extend=function(...T){let C=M.apply(H,T),Z=F!==null&&F!==void 0?F:{},{_internal:S}=Z,c=C6(Z,["_internal"]);return lv.setMetadataInRegistry(C,{_internal:{extendedFrom:(S===null||S===void 0?void 0:S.refId)?{refId:S.refId,schema:H}:S===null||S===void 0?void 0:S.extendedFrom}}),C.openapi(c)},hv(H,"catchall")}hv(H,"optional"),hv(H,"nullable"),hv(H,"default"),hv(H,"transform"),hv(H,"refine"),hv(H,"length"),hv(H,"min"),hv(H,"max");let j=H.meta;return H.meta=function(...F){let M=j.apply(this,F);if(F[0]){let T=lv.getMetadataFromInternalRegistry(this);if(T)lv.setMetadataInRegistry(M,Object.assign(Object.assign({},T),F[0]))}return M},H}}function EA($,v,w){if(typeof $==="string")return{refId:$,metadata:v,options:w};return{refId:void 0,metadata:$,options:v}}var V8=CA;V8(U);var KQ=f({}).passthrough().openapi({description:"Structured context for the error (varies by error code)"}),j8=f({code:K().openapi({description:"Machine-stable error code from the error catalog",example:"session_not_found"}),message:K().openapi({description:"Human-readable error description",example:"The requested session does not exist."}),retryable:Y$().openapi({description:"Whether clients SHOULD retry this request",example:!1}),details:KQ.optional(),fix_hint:K().optional().openapi({description:"Actionable guidance for humans to resolve the error",example:"Verify the session ID is correct."})}).openapi("ErrorObject"),VU=f({code:K().openapi({description:"Machine-stable warning code",example:"partial_data"}),message:K().openapi({description:"Human-readable warning description",example:"Some optional fields were unavailable."}),details:KQ.optional()}).openapi("ErrorWarning"),Tl=f({error:j8,trace_id:K().optional().openapi({description:"Distributed tracing correlation ID",example:"trace_abc123"}),request_id:K().openapi({description:"Unique request identifier",example:"req_xyz789"}),warnings:g$(VU).optional().openapi({description:"Non-fatal warnings returned alongside the error"})}).openapi("ErrorResponse"),cv=K().min(1).max(64).regex(/^(?:[a-zA-Z0-9_-]+|[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)$/,'repo_id must be a configured repo id or an "owner/repo" identifier').openapi({description:'Repository identifier or canonical "owner/repo" handle',example:"acme/docs"}),Hv=K().regex(/^[0-9a-f]{40}$|^[0-9a-f]{64}$/,"git_sha must be 40 or 64 lowercase hex characters").openapi({description:"Full Git SHA (40 chars for SHA-1, 64 for SHA-256)",example:"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b"}),J$=K().min(1).max(512).refine(($)=>!$.startsWith("/"),"file_path must be relative (no leading /)").refine(($)=>!$.includes(".."),"file_path must not contain path traversal (..)").refine(($)=>!$.includes("\x00"),"file_path must not contain NUL bytes").openapi({description:"Relative file path with no leading slash, traversal, or NUL bytes",example:"docs/guide.md"}),ZA=f({source_type:q$("git"),repo_id:cv,git_sha:Hv,file_path:J$}).openapi("GitContentRef"),hA=f({source_type:q$("upload"),project_id:K().openapi({description:"Project identifier",example:"proj_docs"}),upload_batch_id:K().openapi({description:"Upload batch identifier",example:"upload_20260208"}),file_path:J$.openapi({description:"Path to file in upload batch",example:"spec.md"})}).openapi("UploadContentRef"),Gw=Sv("source_type",[ZA,hA]).openapi("ContentRef"),xA=f({type:q$("session")}).openapi("SessionAnchor"),lA=f({type:q$("review")}).openapi("ReviewAnchor"),jU=K().regex(/^[a-z2-7]{16}$/,"block_id must be 16 lowercase base32 characters").openapi({description:"16-character lowercase base32 block identifier (truncated SHA-256)",example:"abcdefgh234567ab"}),cA=f({type:q$("block"),block_id:jU}).openapi("BlockAnchor"),yA=f({type:q$("range"),block_id:jU,start_offset:W$().int().min(0).openapi({description:"Start byte offset within the block"}),end_offset:W$().int().min(0).openapi({description:"End byte offset within the block"})}).openapi("RangeAnchor"),yv=Sv("type",[xA,lA,cA,yA]).openapi("Anchor"),ul=K().optional().openapi({description:"Client-generated idempotency key for safe retries",example:"scope:install_abc:op_123"}),OQ=f({limit:wv.number().int().min(1).max(100).default(50).optional(),cursor:K().optional()}),Rl=f({next_cursor:K().nullable(),has_more:Y$()}),VQ=20,jQ=64,FQ=256,mA=/^[a-zA-Z][a-zA-Z0-9_-]*$/,mv=Lv(K(),z$()).superRefine(($,v)=>{let w=Object.keys($);if(w.length>VQ){v.addIssue({code:S$.custom,message:`Too many keys: ${w.length} exceeds maximum of ${VQ}`});return}for(let g of w){if(g.length<1||g.length>jQ){v.addIssue({code:S$.custom,message:`Key "${g}" length ${g.length} is outside range 1-${jQ}`,path:[g]});continue}if(!mA.test(g))v.addIssue({code:S$.custom,message:`Key "${g}" must start with a letter and contain only letters, digits, underscores, and hyphens`,path:[g]});let _=$[g];if(typeof _!=="string"){v.addIssue({code:S$.custom,message:`Value for key "${g}" must be a string, got ${typeof _}`,path:[g]});continue}if(_.length>FQ)v.addIssue({code:S$.custom,message:`Value for key "${g}" length ${_.length} exceeds maximum of ${FQ}`,path:[g]})}}).openapi("FlatJsonbMap"),Cl=mv.optional().default({});var zQ=U.object({idempotency:U.enum(["always","keyed","none"]).optional(),retry_classification:U.enum(["safe","transient","manual"]).optional()}).openapi("AgentSurfaceRetrySemantics"),rA=U.object({next_cursor:U.string().nullable().optional(),has_more:U.boolean().optional(),total:U.number().int().nonnegative().optional(),limit:U.number().int().positive().optional(),offset:U.number().int().nonnegative().optional()}).openapi("AgentSurfacePagination"),oA=U.object({artifact_kind:U.string().optional(),non_authoritative:U.boolean().optional(),status:U.string().optional(),target_type:U.string().optional(),target_id:U.string().optional(),provenance:U.object({source_type:U.string().optional(),source_label:U.string().optional(),source_model:U.string().optional()}).optional()}).openapi("AdvisorySurfaceSummary"),dA=U.object({ok:U.literal(!0),request_id:U.string(),result:U.unknown(),warnings:U.array(VU).optional(),pagination:rA.optional(),advisory:oA.optional(),retry:zQ.optional()}).openapi("AgentSurfaceSuccessEnvelope"),tA=U.object({ok:U.literal(!1),error:j8,request_id:U.string(),warnings:U.array(VU).optional(),retry:zQ.optional()}).openapi("AgentSurfaceErrorEnvelope");function zv($){if(typeof $!=="object"||$===null||Array.isArray($))return null;return $}function rv($,v){let w=$[v];return typeof w==="string"&&w.trim().length>0?w:void 0}function iQ($,v){let w=$[v];return typeof w==="boolean"?w:void 0}function F8($,v){let w=$[v];if(typeof w!=="number"||!Number.isInteger(w)||w<0)return;return w}function nQ($){if(!Array.isArray($))return[];return $.flatMap((v)=>{if(typeof v==="string"&&v.trim().length>0)return[{code:"warning",message:v}];let w=zv(v);if(!w)return[];let g=rv(w,"message");if(!g)return[];let _=rv(w,"code")??"warning",b=zv(w.details)??void 0;return[{code:_,message:g,...b?{details:b}:{}}]})}function NQ($){let v=zv($);if(!v)return;let w={},g=v.next_cursor;if(typeof g==="string"||g===null)w.next_cursor=g;if(w.next_cursor===void 0&&(typeof v.cursor==="string"||v.cursor===null))w.next_cursor=v.cursor;let _=iQ(v,"has_more");if(_!==void 0)w.has_more=_;let b=F8(v,"total");if(b!==void 0)w.total=b;let J=F8(v,"limit");if(J!==void 0&&J>0)w.limit=J;let D=F8(v,"offset");if(D!==void 0)w.offset=D;return Object.keys(w).length>0?w:void 0}function kQ($){let v=zv($);if(!v)return;let w=zv(v.advisory_artifact)??zv(v.advisory)??v,g=rv(w,"artifact_kind"),_=iQ(w,"non_authoritative"),b=rv(w,"status"),J=zv(w.target),D=zv(w.provenance);if(g===void 0&&_===void 0&&J===null&&D===null)return;let X={};if(g!==void 0)X.artifact_kind=g;if(_!==void 0)X.non_authoritative=_;if(b!==void 0)X.status=b;if(J){let G=rv(J,"target_type"),Y=rv(J,"target_id");if(G!==void 0)X.target_type=G;if(Y!==void 0)X.target_id=Y}if(D){let G={},Y=rv(D,"source_type"),Q=rv(D,"source_label"),W=rv(D,"source_model");if(Y!==void 0)G.source_type=Y;if(Q!==void 0)G.source_label=Q;if(W!==void 0)G.source_model=W;if(Object.keys(G).length>0)X.provenance=G}return X}function PQ($){if($.operation==="read")return"always";return $.hasIdempotencyKey?"keyed":"none"}function pA($){if(typeof $.retryable==="boolean")return $.retryable;if(typeof $.errorCode==="string"&&X6($.errorCode))return!0;if($.statusCode===0||$.statusCode===429)return!0;return typeof $.statusCode==="number"&&$.statusCode>=500}function K8($){let v=PQ($);return{idempotency:v,retry_classification:v==="none"?"manual":"safe"}}function AQ($){let v=PQ($);if(!pA($))return{idempotency:v,retry_classification:"manual"};return{idempotency:v,retry_classification:v==="none"?"transient":"safe"}}function MQ($,v,w){let g=nQ(zv($)?.warnings),_={ok:!0,request_id:v,result:$,...g.length>0?{warnings:g}:{},...NQ($)?{pagination:NQ($)}:{},...kQ($)?{advisory:kQ($)}:{},...w?.retry?{retry:w.retry}:{}};return dA.parse(_),_}function fQ($){let v=zv($.error.details)??void 0,w=nQ($.warnings),g={ok:!1,request_id:$.requestId,error:{code:$.error.code,message:$.error.message,retryable:$.error.retryable,request_id:$.requestId,...v?{details:v}:{},...$.error.fix_hint?{fix_hint:$.error.fix_hint}:{}},...w.length>0?{warnings:w}:{},...$.retry?{retry:$.retry}:{}};return tA.parse(g),g}var FU=U.enum(["content","rules"]).openapi("ReviewRole"),pg=U.enum(["draft","created","active","closed","expired","superseded","archived","deleted"]).openapi("ReviewState"),O8=U.enum(["draft","published","deprecated"]).openapi("ReviewPublicationStatus"),eA=U.enum(["git","upload"]).openapi("ReviewSourceType"),N8=U.enum(["reviewer","approver","observer","owner"]).openapi("ReviewParticipantRole"),SQ=U.enum(["read","comment","approve","admin"]).openapi("ReviewParticipantScope"),TQ=U.enum(["pending","invited","active","failed","bounced"]).openapi("ReviewParticipantInviteStatus"),uQ=U.enum(["pending","delivered","failed","bounced"]).openapi("ReviewParticipantDeliveryState"),aA=U.enum(["not_started","in_progress","complete"]).openapi("ReviewParticipantReviewStatus"),sA=U.object({email:U.string().email(),name:U.string().max(256).optional(),role:N8,scopes:U.array(SQ).min(1)}).openapi("ReviewParticipantInput"),$M=U.object({participant_id:U.string(),email:U.string().email(),roles:U.array(N8),display_name:U.string().nullable(),joined_at:U.string().datetime().nullable(),last_seen_at:U.string().datetime().nullable(),invite_status:TQ,review_status:aA,review_completed_at:U.string().datetime().nullable(),magic_link_opened_at:U.string().datetime().nullable(),delivery_state:uQ.nullable()}).openapi("ReviewParticipantSummary"),vM=U.object({participant_id:U.string(),email:U.string().email(),roles:U.array(N8),review_link_id:U.string(),scope:SQ,expires_at:U.string().datetime().nullable(),revoked_at:U.string().datetime().nullable(),invite_status:TQ,delivery_state:uQ.nullable()}).openapi("ReviewInvitationSummary"),cl=U.object({repo_id:cv.optional(),git_sha:Hv.optional(),file_path:J$.optional(),document_type:U.enum(["markdown","pdf","image_set"]).default("markdown"),title:U.string().max(512).optional(),source_context:U.record(U.string(),U.unknown()).optional(),extra:U.record(U.string(),U.unknown()).optional(),role:FU.default("content"),applicability:mv.optional(),properties:mv.optional(),identity_restriction:U.enum(["open","participants_only","domain"]).default("open"),allowed_email_domains:U.array(U.string().min(1).max(253)).max(50).optional(),participants:U.array(sA).max(100).optional(),idempotency_key:U.string().max(256).optional(),supersedes_review_id:U.string().optional(),carry_forward_threads:U.boolean().optional(),carry_forward_filter:U.enum(["all","blocking","needs_changes"]).optional(),project_id:U.string().optional(),upload_batch_id:U.string().optional(),content_body:U.string().max(1048576).optional(),focus_areas:U.array(U.string().max(100)).max(10).optional(),framing:U.string().max(1000).optional(),operator_name:U.string().max(200).optional()}).superRefine(($,v)=>{if($.role!=="rules"&&$.applicability!==void 0&&Object.keys($.applicability).length>0)v.addIssue({code:U.ZodIssueCode.custom,message:"applicability is only valid when role is 'rules'. Content reviews must not specify applicability.",path:["applicability"]});if($.identity_restriction==="domain"&&(!Array.isArray($.allowed_email_domains)||$.allowed_email_domains.length===0))v.addIssue({code:U.ZodIssueCode.custom,message:'allowed_email_domains is required and must be non-empty when identity_restriction is "domain"',path:["allowed_email_domains"]})}).openapi("CreateReviewRequest"),_M=U.object({review_id:U.string(),role:FU,state:pg,publication_status:O8.nullable().optional(),title:U.string().nullable(),file_path:U.string(),block_count:U.number().int().nonnegative(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).openapi("ReviewSummary"),yl=U.object({review_id:U.string(),role:FU,state:pg,publication_status:O8.nullable().optional(),source_type:eA,document_type:U.enum(["markdown","pdf","image_set"]),repo_id:U.string().nullable(),git_sha:U.string().nullable(),file_path:U.string(),title:U.string().nullable(),source_context:U.record(U.string(),U.unknown()).nullable(),extra:U.record(U.string(),U.unknown()).nullable(),identity_restriction:U.enum(["open","participants_only","domain"]),allowed_email_domains:U.array(U.string()).nullable(),applicability:U.record(U.string(),U.unknown()),properties:U.record(U.string(),U.unknown()),block_count:U.number().int().nonnegative(),root_review_id:U.string(),supersedes_review_id:U.string().nullable(),superseded_by_review_id:U.string().nullable(),created_at:U.string().datetime(),updated_at:U.string().datetime(),participants:U.array($M),invitations:U.array(vM),summary:U.object({total_threads:U.number().int().nonnegative(),open_threads:U.number().int().nonnegative(),blocking_threads:U.number().int().nonnegative(),resolved_threads:U.number().int().nonnegative(),total_findings:U.number().int().nonnegative().optional(),open_findings:U.number().int().nonnegative().optional(),blocking_findings:U.number().int().nonnegative().optional(),resolved_findings:U.number().int().nonnegative().optional()}),request_id:U.string()}).openapi("ReviewDetailResponse"),ml=U.object({role:FU.optional(),state:pg.optional(),cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).default(25)}).openapi("ListReviewsQuery"),rl=U.object({reviews:U.array(_M),next_cursor:U.string().nullable(),has_more:U.boolean(),request_id:U.string()}).openapi("ListReviewsResponse"),ol=U.object({review_id:U.string(),state:pg,publication_status:O8.nullable().optional(),message:U.string().optional(),transitioned:U.boolean(),deadline:U.string().datetime().nullable().optional(),previous_deadline:U.string().datetime().nullable().optional(),request_id:U.string()}).openapi("PatchReviewResponse"),dl=U.object({state:pg}).openapi("PatchReviewRequest"),tl=U.object({git_sha:U.string().optional(),file_path:U.string().optional(),title:U.string().max(512).optional(),applicability:mv.optional(),properties:mv.optional(),idempotency_key:U.string().max(256).optional(),changes_summary:U.string().max(5000).optional(),carry_forward_threads:U.boolean().optional(),carry_forward_filter:U.enum(["all","blocking","needs_changes"]).optional()}).openapi("ReviseReviewRequest");var RQ=U.enum(["suggestion","needs_changes","blocking"]).openapi({description:"Thread severity level"}),CQ=U.enum(["inline","append","hero"]).openapi("CommentAttachmentPlacement"),EQ=U.enum(["before","after"]).openapi("CommentAttachmentAnchorPosition"),wM=U.object({mime_type:U.string().min(1),width:U.number().int().nullable(),height:U.number().int().nullable(),blurhash:U.string().nullable()}).openapi("CommentAttachmentAsset"),k8=U.object({asset_id:U.string().min(1),sort_order:U.number().int().nonnegative(),placement:CQ,alt_text:U.string().max(500).nullable().optional(),caption:U.string().max(2000).nullable().optional(),anchor_block_id:U.string().nullable().optional(),anchor_position:EQ.nullable().optional(),spatial_x:U.number().min(0).max(100).nullable().optional(),spatial_y:U.number().min(0).max(100).nullable().optional()}).openapi("CommentAttachmentRequest"),KU=U.object({asset_id:U.string().min(1),sort_order:U.number().int().nonnegative(),placement:CQ,alt_text:U.string().nullable(),caption:U.string().nullable(),anchor_block_id:U.string().nullable(),anchor_position:EQ.nullable(),spatial_x:U.number().nullable(),spatial_y:U.number().nullable(),asset:wM}).openapi("CommentAttachmentResponse"),ZQ=U.object({id:U.string().openapi({description:"Unique comment identifier",example:"cmt_xyz789"}),thread_id:U.string(),author_email:U.string().email(),author_name:U.string().nullable(),body_md:U.string().openapi({description:"Comment body in Markdown"}),body_html:U.string().openapi({description:"Rendered HTML of the comment body"}),created_at:U.string().datetime(),updated_at:U.string().datetime().nullable(),version:U.number().int().min(1).openapi({description:"Edit version (starts at 1)"})}).openapi("Comment"),al=U.object({anchor:yv.openapi({description:"Where this thread is anchored in the document"}),body_md:U.string().min(1).max(65536).openapi({description:"Initial comment body in Markdown (UTF-8, max 64KB)"}),severity:RQ.optional().default("suggestion")}).openapi("CreateThreadRequest"),hQ=U.object({id:U.string().openapi({description:"Unique thread identifier",example:"thr_abc123"}),session_id:U.string(),anchor:yv,status:U.enum(["open","resolved"]).openapi({description:"Thread status"}),severity:RQ,created_at:U.string().datetime(),updated_at:U.string().datetime(),comment_count:U.number().int().min(1),comments:U.array(ZQ).optional().openapi({description:"Comments in this thread (included on creation)"})}).openapi("Thread"),sl=hQ.openapi("CreateThreadResponse"),$c=U.object({body_md:U.string().min(1).max(65536).openapi({description:"Comment body in Markdown (UTF-8, max 64KB)"})}).openapi("CreateCommentRequest"),vc=ZQ.openapi("CreateCommentResponse"),_c=U.object({status:U.enum(["open","resolved"])}).openapi("UpdateThreadStatusRequest"),wc=hQ.openapi("UpdateThreadStatusResponse"),gc=U.object({session_id:U.string(),thread_id:U.string()}),bc=U.object({session_id:U.string(),thread_id:U.string(),comment_id:U.string()});var eg=U.enum(["open","resolved","withdrawn","wont_fix"]).openapi("FindingStatus"),E6=U.enum(["suggestion","needs_changes","blocking"]).openapi("FindingSeverity"),gM=["undecided","accepted","rejected","deferred","duplicate","needs_more_info","dismissed","waived"],z8=U.enum(gM).openapi("FindingDecisionState"),bM=U.object({source_rule_release_id:U.string(),compiled_hash:U.string().nullable().optional(),source_rule_revision_id:U.string().nullable().optional(),source_clause_id:U.string().nullable().optional(),source_clause_lineage_id:U.string().nullable().optional(),matched_selectors:U.record(U.string(),U.string()).nullable().optional()}).openapi("RuleBasis"),Xc=U.object({anchor:yv,body_md:U.string().min(1).max(65536),severity:E6.optional(),attachments:U.array(k8).max(50).optional(),idempotency_key:U.string().max(256).optional(),source_review_id:U.string().optional(),source_finding_id:U.string().optional(),rule_basis:bM.optional()}).openapi("CreateFindingRequest"),Gc=U.object({finding_id:U.string(),comment_id:U.string(),attachments:U.array(KU),request_id:U.string()}).openapi("CreateFindingResponse"),Yc=U.object({status:eg.optional(),severity:E6.optional(),block_id:U.string().optional(),q:U.string().max(200).optional(),cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).default(50)}).openapi("ListFindingsQuery"),UM=U.object({finding_id:U.string(),status:eg,severity:E6.nullable(),anchor:yv,comment_count:U.number().int().nonnegative(),body_preview:U.string().nullable().optional(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).openapi("FindingSummary"),Qc=U.object({findings:U.array(UM),next_cursor:U.string().nullable(),has_more:U.boolean(),request_id:U.string()}).openapi("ListFindingsResponse"),JM=U.object({comment_id:U.string(),body_md:U.string(),author_name:U.string().nullable(),author_email:U.string().nullable(),attachments:U.array(KU),created_at:U.string().datetime()}).openapi("FindingComment"),DM=U.object({block_id:U.string(),block_key:U.string().nullable(),block_type:U.string(),properties:U.record(U.string(),U.unknown())}).openapi("FindingBlockContext"),XM=U.object({outcome:z8,decided_at:U.string().datetime(),decided_by:U.string().nullable()}).openapi("FindingDecision"),Wc=U.object({finding_id:U.string(),review_id:U.string(),status:eg,severity:E6.nullable(),anchor:yv,block_context:DM.nullable(),comments:U.array(JM),decision:XM.nullable(),created_at:U.string().datetime(),updated_at:U.string().datetime(),request_id:U.string()}).openapi("FindingDetailResponse"),Hc=U.object({status:eg.optional(),severity:E6.optional(),expected_version:U.number().int().positive().optional()}).openapi("PatchFindingRequest"),qc=U.object({finding_id:U.string(),review_id:U.string(),status:eg,severity:E6.nullable(),version:U.number().int().positive(),updated_at:U.string().datetime(),request_id:U.string()}).openapi("PatchFindingResponse"),Ic=U.object({body_md:U.string().min(1).max(65536),attachments:U.array(k8).max(50).optional(),idempotency_key:U.string().max(256).optional()}).openapi("CreateFindingCommentRequest"),Bc=U.object({comment_id:U.string(),attachments:U.array(KU),request_id:U.string()}).openapi("CreateFindingCommentResponse"),Lc=U.object({state:z8,rationale_md:U.string().min(1).max(65536).optional(),expected_version:U.number().int().positive().optional()}).openapi("CreateFindingDecisionRequest"),Vc=U.object({decision_id:U.string(),finding_id:U.string(),state:z8,request_id:U.string()}).openapi("CreateFindingDecisionResponse"),jc=U.object({evidence_type:U.string().min(1),evidence_json:U.record(U.string(),U.unknown()),dedupe_key:U.string().max(256).optional()}).openapi("CreateFindingEvidenceRequest"),Fc=U.object({evidence_id:U.string(),finding_id:U.string(),type:U.string(),request_id:U.string()}).openapi("CreateFindingEvidenceResponse");var GM=["pattern","canon_disagreement","rule_gap","drafting_recommendation"],i8=U.enum(GM).openapi("GovernanceSignalKind"),YM=["new","triaged","accepted_for_drafting","dismissed","converted","snoozed"],ag=U.enum(YM).openapi("GovernanceSignalState");var xQ=U.object({target_type:U.string().trim().min(1).max(64),target_id:U.string().trim().min(1).max(256),target_context:U.object({review_id:U.string().trim().min(1).max(256).optional(),block_id:U.string().trim().min(1).max(256).optional()}).strict().optional()}).strict().openapi("GovernanceSignalTarget"),lQ=U.object({source_type:U.enum(["human","agent"]),source_label:U.string().trim().min(1).max(256),source_model:U.string().trim().min(1).max(256).optional(),source_harness:U.string().trim().min(1).max(256).optional(),submitted_by:U.string().trim().min(1).max(256),submitted_at:U.string().datetime()}).strict().openapi("GovernanceSignalProvenance"),cQ=U.object({export_sha256:U.string().regex(/^[0-9a-f]{64}$/).optional(),rulepack_sha256:U.string().regex(/^[0-9a-f]{64}$/).optional(),source_content_sha256:U.string().regex(/^[0-9a-f]{64}$/).optional(),basis_review_ids:U.array(U.string().trim().min(1).max(256)).optional(),basis_finding_ids:U.array(U.string().trim().min(1).max(256)).optional(),source_rule_refs:U.array(U.string().trim().min(1).max(256)).optional(),rationale:U.string().trim().min(1).max(8000),custom:U.record(U.string(),U.string()).optional()}).strict().openapi("GovernanceSignalBasis"),yQ=U.object({body_md:U.string().min(1).max(65536),structured_data:U.record(U.string(),U.unknown()).optional(),evidence_refs:U.array(U.string().trim().min(1).max(512)).optional(),confidence:U.number().min(0).max(1).optional(),severity_hint:U.string().trim().min(1).max(32).optional()}).strict().openapi("GovernanceSignalPayload"),OU=U.object({severity:U.string().trim().min(1).max(64).nullable(),affected_rule_document_ids:U.array(U.string().trim().min(1).max(256)),grouping_id:U.string().trim().min(1).max(256).nullable()}).strict().openapi("GovernanceSignalTriageMetadata"),QM=U.string().trim().min(1).max(256).openapi("GovernanceSignalId"),Nc=U.object({signal_id:QM,kind:i8,state:ag,workspace_id:U.string().trim().min(1).max(256),target:xQ,review_id:U.string().trim().min(1).max(256).nullable(),provenance:lQ,basis:cQ.nullable(),payload:yQ,triage_metadata:OU.nullable(),dismissal_reason:U.string().trim().min(1).max(8000).nullable(),snooze_reason:U.string().trim().min(1).max(8000).nullable(),re_triage_date:U.string().datetime().nullable(),converted_working_draft_ids:U.array(U.string().trim().min(1).max(256)).nullable(),version:U.number().int().positive(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).openapi("GovernanceSignal"),kc=U.object({kind:i8,workspace_id:U.string().trim().min(1).max(256),target:xQ,provenance:lQ,basis:cQ.optional(),payload:yQ,review_id:U.string().trim().min(1).max(256).optional(),idempotency_key:U.string().trim().min(1).max(256).optional()}).strict().openapi("CreateGovernanceSignalRequest"),zc=U.object({workspace_id:U.string().trim().min(1).max(256).optional(),review_id:U.string().trim().min(1).max(256).optional(),kind:i8.optional(),state:ag.optional(),submitted_by:U.string().trim().min(1).max(256).optional(),limit:U.coerce.number().int().min(1).max(200).default(50),offset:U.coerce.number().int().min(0).default(0)}).strict().openapi("GovernanceSignalListQuery"),ic=U.object({target_state:ag,expected_version:U.number().int().positive().optional(),reason:U.string().trim().min(1).max(8000).optional(),triage_metadata:OU.optional(),re_triage_date:U.string().datetime().optional(),converted_working_draft_ids:U.array(U.string().trim().min(1).max(256)).optional(),idempotency_key:U.string().trim().min(1).max(256).optional()}).strict().openapi("TransitionGovernanceSignalRequest");var n8=U.enum(["rule","exception","definition","example","rationale","procedure","heading","metadata"]).openapi("ClauseKind"),P8=U.enum(["introduced","carried_forward","changed","retired","replaced"]).openapi("DerivationOutcome"),Ac=U.object({source_rule_revision_id:U.string(),clause_id:U.string(),clause_lineage_id:U.string(),carried_forward_from_clause_id:U.string().nullable(),block_id:U.string(),block_key:U.string().nullable(),block_index:U.number().int().nonnegative(),kind:n8,strength:U.enum(["must","should","may","must_not"]).nullable(),category:U.string().nullable(),canonical_plaintext:U.string(),selectors:U.record(U.string(),U.string()).default({}),parser_version:U.string(),extractor_version:U.string(),selector_schema_version:U.string(),source_map:U.object({start_offset:U.number().int().nonnegative(),end_offset:U.number().int().nonnegative(),source_line:U.number().int().positive().nullable()}).nullable().default(null),derivation_receipt_hash:U.string()}).openapi("DerivedRuleClause"),Mc=U.object({clause_id:U.string(),outcome:P8,source_clause_id:U.string().nullable(),source_revision_id:U.string().nullable(),derivation_method:U.enum(["explicit","algorithmic"]),derived_at:U.string().datetime(),derived_by:U.string()}).openapi("DerivationReceipt");var NU=U.enum(["manifest","structured","text","diff","chunk"]).openapi("RuleRetrievalMode"),A8=U.enum(["workspace","collection","review","file"]).openapi("RuleRetrievalScope"),Tc=U.object({mode:NU,release_id:U.string().optional(),scope:A8.default("workspace"),collection_id:U.string().optional(),review_id:U.string().optional(),file_path:U.string().optional(),properties:U.record(U.string(),U.string()).optional(),token_budget:U.number().int().positive().optional()}).superRefine(($,v)=>{if($.token_budget!==void 0&&$.mode!=="chunk")v.addIssue({code:U.ZodIssueCode.custom,path:["token_budget"],message:"token_budget is only valid when mode=chunk"})}).openapi("RuleRetrievalQuery"),mQ=U.enum(["draft_only","published","deprecated"]).openapi("RuleDocumentPublicationState"),rQ=U.enum(["live","not_live"]).openapi("RuleDocumentLiveState"),uc=U.object({publication_state:mQ.optional(),live_state:rQ.optional(),owner:U.string().trim().min(1).optional(),q:U.string().trim().min(1).optional(),limit:U.number().int().positive().max(100).default(25),cursor:U.string().trim().min(1).optional()}).openapi("RuleDocumentListQuery"),WM=U.object({rule_document_id:U.string(),title:U.string(),owner:U.string().nullable(),steward_group:U.string().nullable(),review_cadence:U.string().nullable(),current_published_revision_id:U.string().nullable(),last_published_revision_id:U.string().nullable(),current_draft_revision_id:U.string().nullable(),live_revision_id:U.string().nullable(),live_release_id:U.string().nullable(),live_release_version:U.number().int().positive().nullable(),publication_state:mQ,live_state:rQ,has_draft_successor:U.boolean(),clause_count:U.number().int().nonnegative(),last_published_at:U.string().datetime().nullable(),updated_at:U.string().datetime()}).openapi("RuleDocumentListItem"),Rc=U.object({items:U.array(WM),next_cursor:U.string().nullable(),request_id:U.string()}).openapi("RuleDocumentListResponse"),Yw=U.object({active_release_id:U.string().nullable(),release_version:U.number().int().positive().nullable(),compiled_hash:U.string().nullable(),source_candidate_id:U.string().nullable()}).openapi("RuleReleaseProvenance"),HM=U.union([U.string(),U.array(U.string()).min(1)]),M8=U.record(U.string(),HM),qM=U.object({rule_document_id:U.string(),title:U.string().nullable(),revision_id:U.string(),clause_count:U.number().int().nonnegative(),strength_breakdown:U.object({must:U.number().int().nonnegative(),should:U.number().int().nonnegative(),may:U.number().int().nonnegative(),must_not:U.number().int().nonnegative()}),applicability:U.record(U.string(),U.string()),published_at:U.string().datetime().nullable()}),kU=U.object({mode:U.literal("manifest"),release_id:U.string(),provenance:Yw,documents:U.array(qM),total_documents:U.number().int().nonnegative(),total_clauses:U.number().int().nonnegative(),compiled_hash:U.string(),request_id:U.string()}).openapi("RuleManifestResponse"),IM=U.object({clause_id:U.string(),clause_lineage_id:U.string(),document_id:U.string(),block_id:U.string(),block_index:U.number().int().nonnegative(),kind:U.string(),strength:U.enum(["must","should","may","must_not"]).nullable(),category:U.string().nullable(),plaintext:U.string(),selectors:M8,target_clause_id:U.string().optional()}).superRefine(($,v)=>{if($.kind==="exception"&&!$.target_clause_id)v.addIssue({code:U.ZodIssueCode.custom,path:["target_clause_id"],message:"Exception clauses must include target_clause_id"})}),zU=U.object({mode:U.literal("structured"),release_id:U.string(),provenance:Yw,clauses:U.array(IM),total_clauses:U.number().int().nonnegative(),compiled_hash:U.string(),request_id:U.string()}).openapi("RuleStructuredResponse"),iU=U.object({mode:U.literal("text"),release_id:U.string(),provenance:Yw,text:U.string(),total_clauses:U.number().int().nonnegative(),compiled_hash:U.string(),request_id:U.string()}).openapi("RuleTextResponse"),BM=U.object({clause_lineage_id:U.string(),outcome:U.enum(["introduced","carried_forward","changed","retired","replaced"]),before:U.string().nullable(),after:U.string().nullable(),strength_before:U.enum(["must","should","may","must_not"]).nullable(),strength_after:U.enum(["must","should","may","must_not"]).nullable()}),nU=U.object({mode:U.literal("diff"),from_release_id:U.string(),to_release_id:U.string(),provenance:Yw,changes:U.array(BM),total_changes:U.number().int().nonnegative(),request_id:U.string()}).openapi("RuleDiffResponse"),PU=U.object({mode:U.literal("chunk"),release_id:U.string(),provenance:Yw,chunks:U.array(U.object({chunk_index:U.number().int().nonnegative(),text:U.string(),clause_count:U.number().int().nonnegative(),token_estimate:U.number().int().nonnegative()})),total_chunks:U.number().int().nonnegative(),total_clauses:U.number().int().nonnegative(),compiled_hash:U.string(),request_id:U.string()}).openapi("RuleChunkResponse"),Cc=U.discriminatedUnion("mode",[kU,zU,iU,nU,PU]),Ec=U.object({error:U.object({code:U.literal("invalid_retrieval_mode"),message:U.string(),retryable:U.boolean(),details:U.object({valid_modes:U.array(NU)})}),request_id:U.string()}).openapi("RuleRetrievalInvalidModeError");var LM={clause_count:8,selector_count:3,precedence_clause_count:4,exception_change_count:1,required_approvals:1},oQ=U.object({clause_count:U.number().int().min(1).default(8),selector_count:U.number().int().min(1).default(3),precedence_clause_count:U.number().int().min(1).default(4),exception_change_count:U.number().int().min(1).default(1),required_approvals:U.number().int().min(1).default(1)}).openapi("ReleaseVerificationThresholds"),VM=U.enum(["active","superseded","rolled_back"]).openapi("RuleReleaseStatus"),sg=U.object({rule_release_id:U.string(),release_version:U.number().int().positive(),workspace_id:U.string(),included_rule_revision_ids:U.array(U.string()),compiled_hash:U.string(),status:VM,effective_at:U.string().datetime(),activated_at:U.string().datetime(),activated_by:U.string(),supersedes_release_id:U.string().nullable(),rollback_of_release_id:U.string().nullable(),change_note:U.string().nullable().default(null),source_candidate_id:U.string(),created_at:U.string().datetime()}).openapi("RuleRelease"),xc=U.enum(["unapproved_candidate","stale_candidate","workspace_frozen","no_prior_release","concurrent_activation","verification_required"]);var lc=U.object({release_candidate_id:U.string(),idempotency_key:U.string().max(256).optional()}).strict().openapi("ActivateReleaseRequest"),cc=U.object({target_release_id:U.string().optional(),reason:U.string().min(1).max(1024),idempotency_key:U.string().max(256).optional()}).strict().openapi("RollbackReleaseRequest"),yc=U.object({rule_release_id:U.string(),release_version:U.number().int().positive(),status:U.literal("active"),supersedes_release_id:U.string().nullable(),effective_at:U.string().datetime(),request_id:U.string()}).openapi("ActivateReleaseResponse"),mc=U.object({rule_release_id:U.string(),release_version:U.number().int().positive(),status:U.literal("active"),rollback_of_release_id:U.string(),change_note:U.string().nullable().default(null),effective_at:U.string().datetime(),request_id:U.string()}).openapi("RollbackReleaseResponse"),dQ=U.object({workspace_id:U.string(),active_rule_release_id:U.string().nullable(),activation_frozen:U.boolean(),last_freeze_change_reason:U.string().nullable().default(null),last_freeze_change_actor_id:U.string().nullable().default(null),last_freeze_change_at:U.string().datetime().nullable().default(null),require_publisher_activator_separation:U.boolean().default(!1),updated_at:U.string().datetime().nullable(),verification_thresholds:oQ.default(LM)}).openapi("ReleaseControlState"),rc=U.object({verification_thresholds:oQ.optional(),require_publisher_activator_separation:U.boolean().optional()}).refine(($)=>$.verification_thresholds!==void 0||$.require_publisher_activator_separation!==void 0,{message:"At least one release control field must be provided for update",path:[]}).strict().openapi("UpdateReleaseControlRequest"),oc=U.object({limit:U.coerce.number().int().min(1).max(100).default(25)}).strict().openapi("ListRuleReleasesQuery"),dc=U.object({items:U.array(sg),control:dQ,request_id:U.string()}).openapi("ListRuleReleasesResponse"),tQ=U.object({reason:U.string().min(1).max(1024).optional(),idempotency_key:U.string().max(256).optional()}).strict(),tc=tQ.openapi("FreezeReleaseRequest"),pc=tQ.openapi("UnfreezeReleaseRequest"),f8=U.object({control:dQ,request_id:U.string()}),ec=f8.openapi("FreezeReleaseResponse"),ac=f8.openapi("UnfreezeReleaseResponse"),sc=f8.openapi("UpdateReleaseControlResponse");var S8=["open","claimed","in_progress","blocked","done","canceled","expired"];var Z6=U.enum(S8).openapi("WorkItemState"),AU=["review_task","verification_task","triage_task","approval_task","manual_task"],T8=U.enum(AU).openapi("WorkItemKind"),MU=["assigned","reviewer_pool","watchers","external_invite"],$b=U.enum(MU).openapi("WorkItemAudienceMode"),fU=["review_requested","verification_needed","challenge_received","draft_feedback","signal_triage","activation_approval","manual_assignment"],u8=U.enum(fU).openapi("WorkItemReasonCode"),R8=["my_work","team_queue","activity","external_entrypoint"],pQ=U.enum(R8).openapi("WorkItemQueueSurface");var C8=["claim","release","start","block","unblock","complete","cancel","expire"],jM=U.enum(C8).openapi("WorkItemTransitionAction"),E8=["completed","approved","rejected","needs_changes"],FM=U.enum(E8).openapi("WorkItemCompletionOutcome"),SU=U.string().regex(/^wi_[0-9A-HJKMNP-TV-Z]{26}$/).openapi("WorkItemId"),eQ=U.object({target_type:U.string().min(1).max(64),target_id:U.string().min(1).max(128)}).strict().openapi("WorkItemTarget");var aQ=U.object({title:U.string().min(1).max(256),kind:T8,reason_code:u8,audience_mode:$b,blocking:U.boolean().default(!0),priority:U.number().int().min(0).max(9).default(5),target:eQ,assignee_id:U.string().min(1).max(128).optional(),steward_group:U.string().min(1).max(128).optional(),due_at:U.string().datetime().optional(),metadata:U.record(U.string(),U.unknown()).optional(),idempotency_key:U.string().max(256).optional()}).strict().superRefine(($,v)=>{if($.audience_mode==="assigned"&&!$.assignee_id)v.addIssue({code:U.ZodIssueCode.custom,message:'assignee_id is required when audience_mode is "assigned"',path:["assignee_id"]});if($.audience_mode!=="assigned"&&$.assignee_id)v.addIssue({code:U.ZodIssueCode.custom,message:'assignee_id is only valid when audience_mode is "assigned"',path:["assignee_id"]});if($.audience_mode==="watchers"&&$.blocking)v.addIssue({code:U.ZodIssueCode.custom,message:"watchers work items must be non-blocking",path:["blocking"]})}).openapi("CreateWorkItemRequest"),sQ=U.object({work_item_id:SU,workspace_id:U.string().min(1).max(128),title:U.string().min(1).max(256),description:U.string().max(4000).optional(),kind:T8,reason_code:u8,state:Z6,audience_mode:$b,blocking:U.boolean(),target:eQ,priority:U.number().int().min(0).max(9),assignee_id:U.string().nullable(),claimant_id:U.string().nullable(),claimed_at:U.string().datetime().nullable(),due_at:U.string().datetime().nullable(),expires_at:U.string().datetime().nullable(),steward_group:U.string().nullable(),metadata:U.record(U.string(),U.unknown()),version:U.number().int().positive(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).strict(),_y=sQ.superRefine(($,v)=>{if($.audience_mode==="assigned"&&!$.assignee_id)v.addIssue({code:U.ZodIssueCode.custom,message:'assignee_id is required when audience_mode is "assigned"',path:["assignee_id"]});if($.audience_mode!=="assigned"&&$.assignee_id)v.addIssue({code:U.ZodIssueCode.custom,message:'assignee_id is only valid when audience_mode is "assigned"',path:["assignee_id"]});if($.audience_mode==="watchers"&&$.blocking)v.addIssue({code:U.ZodIssueCode.custom,message:"watchers work items must be non-blocking",path:["blocking"]});if($.state==="open"&&$.claimant_id)v.addIssue({code:U.ZodIssueCode.custom,message:"open work items must not have a claimant_id",path:["claimant_id"]});if($.state==="open"&&$.claimed_at)v.addIssue({code:U.ZodIssueCode.custom,message:"open work items must not have a claimed_at timestamp",path:["claimed_at"]});if(["claimed","in_progress","blocked"].includes($.state)&&!$.claimant_id)v.addIssue({code:U.ZodIssueCode.custom,message:`${$.state} work items require a claimant_id`,path:["claimant_id"]});if($.claimant_id&&!$.claimed_at)v.addIssue({code:U.ZodIssueCode.custom,message:"claimed_at is required when claimant_id is present",path:["claimed_at"]});if(!$.claimant_id&&$.claimed_at)v.addIssue({code:U.ZodIssueCode.custom,message:"claimant_id is required when claimed_at is present",path:["claimant_id"]})}).openapi("WorkItem"),KM=sQ.pick({work_item_id:!0,title:!0,kind:!0,reason_code:!0,state:!0,audience_mode:!0,blocking:!0,target:!0,priority:!0,assignee_id:!0,claimant_id:!0,due_at:!0,version:!0,created_at:!0,updated_at:!0}).extend({queue_surface:pQ,why_in_queue:U.string().min(1).max(256)}).openapi("WorkItemSummary"),$W=U.object({state:Z6.optional(),kind:T8.optional(),reason_code:u8.optional(),audience_mode:$b.optional(),queue_surface:pQ.optional(),assignee_id:U.string().max(128).optional(),claimant_id:U.string().max(128).optional(),cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).default(25)}).openapi("ListWorkItemsQuery"),wy=U.object({items:U.array(KM),next_cursor:U.string().nullable(),has_more:U.boolean(),request_id:U.string()}).openapi("ListWorkItemsResponse"),vW=U.object({action:jM,expected_version:U.number().int().positive().optional(),idempotency_key:U.string().max(256).optional(),blocking_reason:U.string().min(1).max(256).optional(),cancellation_reason:U.string().min(1).max(256).optional(),completion_outcome:FM.optional(),comment:U.string().max(4000).optional()}).strict().superRefine(($,v)=>{if($.action==="block"&&!$.blocking_reason)v.addIssue({code:U.ZodIssueCode.custom,message:"blocking_reason is required when action is block",path:["blocking_reason"]});if($.action==="cancel"&&!$.cancellation_reason)v.addIssue({code:U.ZodIssueCode.custom,message:"cancellation_reason is required when action is cancel",path:["cancellation_reason"]});if($.action==="complete"&&!$.completion_outcome)v.addIssue({code:U.ZodIssueCode.custom,message:"completion_outcome is required when action is complete",path:["completion_outcome"]})}).openapi("TransitionWorkItemRequest"),gy=U.object({work_item_id:U.string(),from_state:Z6,to_state:Z6,claimant_id:U.string().nullable(),version:U.number().int().positive(),updated_at:U.string().datetime(),request_id:U.string()}).openapi("TransitionWorkItemResponse");var Z8=U.enum(["must","should","may","must_not"]).openapi("RuleStrength"),OM=U.enum(["error","warning","info"]).openapi("RuleCheckFindingSeverity"),NM=U.enum(["document"]).openapi("RuleCheckAnchorMode"),kM=U.object({rule_text:U.string(),strength:Z8,category:U.string().nullable(),source_review_id:U.string(),block_id:U.string(),block_index:U.number().int().nonnegative(),specificity:U.number().int().nonnegative(),applicability:M8,kind:U.string().optional(),clause_id:U.string().optional(),clause_lineage_id:U.string().optional(),target_clause_id:U.string().optional()}).openapi("MatchedRuleResponse"),gW=U.object({latest_rule_session_updated_at:U.string().datetime().nullable(),contributing_session_count:U.number().int().nonnegative(),total_rule_count:U.number().int().nonnegative()}).openapi("RuleBundleFreshness"),Wy=U.object({format:U.enum(["json","text"]).default("json"),limit:U.coerce.number().int().min(1).max(200).default(50),offset:U.coerce.number().int().nonnegative().default(0),collection_id:U.string().optional(),release_id:U.string().optional()}).openapi("ListRulesQuery"),Hy=U.object({rules:U.array(kM),total:U.number().int().nonnegative(),limit:U.number().int().positive(),offset:U.number().int().nonnegative(),freshness:gW,provenance:Yw,compiled_hash:U.string(),request_id:U.string()}).openapi("ListRulesResponse"),qy=U.object({content:U.string().min(1).max(1048576),properties:mv.optional().default({}),collection_id:U.string().optional(),idempotency_key:U.string().max(256).optional()}).strict().openapi("RuleCheckRequest"),zM=U.object({rule_session_id:U.string(),rule_block_id:U.string(),rule_block_key:U.string().optional(),strength:Z8,category:U.string(),rule_content:U.string(),rule_session_name:U.string(),applicability_match_reason:U.string().optional(),kind:U.literal("exception"),clause_id:U.string(),clause_lineage_id:U.string(),target_clause_id:U.string()}).openapi("RuleCheckApplicableException"),iM=U.object({block_index:U.number().int().nonnegative(),severity:OM,message:U.string(),rule_ref:s0.optional(),applicable_exceptions:U.array(zM).optional()}).openapi("RuleCheckFinding"),nM=U.object({total:U.number().int().nonnegative(),blocking:U.number().int().nonnegative(),warnings:U.number().int().nonnegative(),suggestions:U.number().int().nonnegative()}).openapi("RuleCheckSummary"),Iy=U.object({findings:U.array(iM),summary:nM,anchor_mode:NM.optional(),rules_evaluated:U.number().int().nonnegative(),freshness:gW,compiled_hash:U.string(),request_id:U.string()}).openapi("RuleCheckResponse"),PM=U.object({source:U.enum(["manual","findings","external"]),source_review_id:U.string().optional(),source_label:U.string().max(256).optional()}).openapi("RuleImportProvenance"),By=U.object({content:U.string().min(1).max(524288),title:U.string().max(512).optional(),applicability:mv.optional(),provenance:PM.optional(),preview:U.boolean().default(!1),idempotency_key:U.string().max(256).optional()}).strict().openapi("RuleImportRequest"),bW=U.object({source:U.enum(["manual","findings","external"]),source_review_id:U.string().optional(),source_label:U.string().max(256).optional(),content_bytes:U.number().int().positive(),review_title:U.string().nullable()}).openapi("RuleImportMetadata"),UW=U.object({block_index:U.number().int().nonnegative(),strength:Z8,category:U.string().nullable(),plaintext:U.string()}).openapi("ParsedRuleBlock"),AM=U.object({preview:U.literal(!0),parsed_rules:U.array(UW),total_rules:U.number().int().nonnegative(),warnings:U.array(U.string()),import_metadata:bW,request_id:U.string()}).openapi("RuleImportPreviewResponse"),MM=U.object({preview:U.literal(!1),review_id:U.string(),state:U.literal("draft"),parsed_rules:U.array(UW),total_rules:U.number().int().nonnegative(),warnings:U.array(U.string()),import_metadata:bW,request_id:U.string()}).openapi("RuleImportCreateResponse"),Ly=U.discriminatedUnion("preview",[AM,MM]),JW=U.enum(["finding_seeded","curated_feedback","advisory_seeded","direct_authored","imported"]).openapi("RuleInspectionOriginType"),fM=U.object({finding_id:U.string(),review_id:U.string(),review_title:U.string().nullable(),block_id:U.string().nullable(),body_excerpt:U.string().nullable(),severity:U.string().nullable(),created_at:U.string().datetime()}).openapi("RuleInspectionSourceFinding"),SM=U.object({review_id:U.string(),title:U.string().nullable(),file_path:U.string().nullable(),finding_count:U.number().int().nonnegative(),created_at:U.string().datetime()}).openapi("RuleInspectionSourceReview"),TM=U.object({artifact_id:U.string(),artifact_kind:U.string(),source_label:U.string().nullable(),source_model:U.string().nullable(),confidence:U.number().nullable(),body_excerpt:U.string().nullable(),adopted_at:U.string().datetime(),adopted_by:U.string().nullable()}).openapi("RuleInspectionSourceAdvisory"),_W=U.object({review_id:U.string(),title:U.string().nullable(),state:U.string(),published_at:U.string().datetime().nullable(),superseded_at:U.string().datetime().nullable()}).openapi("RuleInspectionLineageLink"),uM=U.object({root_review_id:U.string(),is_root:U.boolean(),predecessor:_W.nullable(),successor:_W.nullable(),revision_depth:U.number().int().positive()}).openapi("RuleInspectionLineage"),RM=U.object({adopted_review_count:U.number().int().nonnegative(),total_findings:U.number().int().nonnegative(),governance_signal_count:U.number().int().nonnegative(),challenges_received:U.number().int().nonnegative(),action_receipt_count:U.number().int().nonnegative()}).openapi("RuleInspectionDownstream"),CM=U.object({total_signals:U.number().int().nonnegative(),open_signals:U.number().int().nonnegative(),dismissed_signals:U.number().int().nonnegative(),converted_signals:U.number().int().nonnegative(),last_signaled_at:U.string().datetime().nullable()}).openapi("RuleInspectionChallengeSummary"),EM=U.object({work_item_id:U.string(),state:Z6,audience_mode:$b,assignee_id:U.string().nullable(),claimant_id:U.string().nullable(),steward_group:U.string().nullable(),updated_at:U.string().datetime()}).openapi("RuleInspectionOpenChallengeWorkItem"),ZM=U.object({signal_id:U.string(),state:ag,submitted_by:U.string(),basis_rationale:U.string().nullable(),affected_rule_document_ids:U.array(U.string()),triage_metadata:OU.nullable(),created_at:U.string().datetime(),updated_at:U.string().datetime(),work_item:EM.nullable()}).openapi("RuleInspectionOpenChallenge"),Vy=U.object({review_id:U.string(),title:U.string().nullable(),state:U.string(),file_path:U.string().nullable(),block_count:U.number().int().nonnegative(),active_block_count:U.number().int().nonnegative(),origin_type:JW,source_findings:U.array(fM),source_reviews:U.array(SM),source_advisories:U.array(TM),seeded_by:U.string().nullable(),seeded_at:U.string().datetime().nullable(),evidence_summary:U.string().nullable(),first_live_release:sg.nullable(),current_release:sg.nullable(),release_membership:U.array(sg),lineage:uM,downstream:RM,challenge_summary:CM,open_challenges:U.array(ZM),request_id:U.string()}).openapi("RuleReviewInspectionResponse"),hM=U.object({introduced_clause_count:U.number().int().nonnegative(),carried_forward_clause_count:U.number().int().nonnegative(),changed_clause_count:U.number().int().nonnegative(),retired_clause_count:U.number().int().nonnegative(),replaced_clause_count:U.number().int().nonnegative(),selector_changed_clause_count:U.number().int().nonnegative()}).openapi("RuleReviewDiffSummary"),xM=U.object({outcome:P8,clause_lineage_id:U.string(),kind:n8,block_key:U.string().nullable(),current_clause_id:U.string().nullable(),previous_clause_id:U.string().nullable(),current_plaintext:U.string().nullable(),previous_plaintext:U.string().nullable(),selectors_changed:U.boolean()}).openapi("RuleReviewDiffClause"),jy=U.object({review_id:U.string(),predecessor_review_id:U.string().nullable(),summary:hM,clauses:U.array(xM),request_id:U.string()}).openapi("RuleReviewDiffResponse"),DW=U.enum(["7d","14d","30d","all"]).openapi("RuleEvidenceWindow"),wW=U.object({finding_seeded:U.number().int().nonnegative(),curated_feedback:U.number().int().nonnegative(),advisory_seeded:U.number().int().nonnegative(),direct_authored:U.number().int().nonnegative(),imported:U.number().int().nonnegative()}).openapi("RuleProvenanceOriginBreakdown"),lM=U.object({rule_session_id:U.string(),rule_session_name:U.string().nullable(),origin_type:JW,published_at:U.string().datetime().nullable()}).openapi("RuleProvenanceLatestFeedbackRule"),XW=U.object({tenant_id:U.string(),by_origin:wW,active_by_origin:wW,feedback_originated_count:U.number().int().nonnegative(),feedback_originated_active_count:U.number().int().nonnegative(),feedback_origin_rate:U.number().min(0).max(1),latest_feedback_rule:lM.nullable(),computed_at:U.string().datetime()}).openapi("RuleProvenanceAggregate"),Fy=U.object({provenance:XW,request_id:U.string()}).openapi("RuleProvenanceAggregateResponse"),cM=U.object({tenant_id:U.string(),window:DW,window_start:U.string().datetime(),window_end:U.string().datetime(),total_content_reviews:U.number().int().nonnegative(),adopted_reviews:U.number().int().nonnegative(),adoption_rate:U.number().min(0).max(1),active_rule_sessions:U.number().int().nonnegative(),active_rule_blocks:U.number().int().nonnegative(),adopted_rule_blocks:U.number().int().nonnegative(),prior_window_adoption_rate:U.number().min(0).max(1).nullable(),adoption_rate_delta:U.number().nullable(),computed_at:U.string().datetime()}).openapi("RuleEvidenceAdoptionRollup"),Ky=U.object({tenant_id:U.string(),window:DW,window_start:U.string().datetime(),window_end:U.string().datetime(),adoption:cM,total_active_rules:U.number().int().nonnegative(),zero_use_rules:U.number().int().nonnegative(),high_trigger_rules:U.number().int().nonnegative(),low_trigger_rules:U.number().int().nonnegative(),rules_published_in_window:U.number().int().nonnegative(),rules_superseded_in_window:U.number().int().nonnegative(),rules_deprecated_in_window:U.number().int().nonnegative(),total_findings_in_window:U.number().int().nonnegative(),resolved_findings_in_window:U.number().int().nonnegative(),unresolved_findings_in_window:U.number().int().nonnegative(),false_positive_findings_in_window:U.number().int().nonnegative(),provenance:XW,computed_at:U.string().datetime(),request_id:U.string()}).openapi("RuleEvidenceRollupResponse");var h8=U.enum(["draft","in_review","revising","ready_to_publish","withdrawn"]).openapi("WorkingDraftState");var ky=U.object({target_state:h8,idempotency_key:U.string().max(256).optional()}).strict().openapi("WorkingDraftTransitionRequest"),zy=U.object({draft_id:U.string(),previous_state:h8,state:h8,version:U.number().int().positive(),updated_at:U.string().datetime(),request_id:U.string()}).openapi("WorkingDraftTransitionResponse"),iy=U.enum(["created","active","closed","superseded","archived"]).openapi("RuleReviewState");var ny=U.enum(["unpublished","published","deprecated"]).openapi("RuleRevisionState");var My=U.object({require_approval_before_publish:U.boolean().default(!1),require_publisher_activator_separation:U.boolean().default(!1),scoped_publish_enabled:U.boolean().default(!1),emergency_freeze:U.boolean().default(!1)}).openapi("GovernanceControls");var fy=U.object({identity:U.string(),workspace_id:U.string().default("*"),selector_domain:U.string().default("*")}).openapi("PublishPermissionEntry"),Sy=U.object({allowed:U.boolean(),denial_reason:U.enum(["approval_required","publisher_activator_same_identity","publish_scope_denied","emergency_freeze_active"]).nullable(),denial_message:U.string().nullable()}).openapi("GovernanceAuthCheckResult");var yM=U.union([U.string().min(1),U.array(U.string().min(1)).nonempty()]),TU=U.record(U.string(),yM),mM=["must","should","may","must_not","exception_must","exception_should","definition","example","rationale","procedure"],rM=U.enum(mM).openapi("ClauseMarker");var oM=U.object({title:U.string().min(1).max(512),owner:U.string().min(1).max(256),id:U.string().max(128).optional(),selectors:TU.optional(),review_cadence:U.string().max(64).optional(),version:U.string().max(64).optional(),steward_group:U.string().max(256).optional(),applicability:TU.optional(),status:U.unknown().optional()}).strict().superRefine(($,v)=>{if(typeof $.status<"u")v.addIssue({code:U.ZodIssueCode.custom,path:["status"],message:"Frontmatter 'status' is not allowed in rules documents. Lifecycle state is system-derived."})}),dM=oM.transform(({status:$,...v})=>v).openapi("RuleDocumentFrontmatter"),Ry=U.object({selectors:TU,scope:U.enum(["section","clause"]).default("section")}).openapi("TsSelectorsDirective"),tM=U.object({marker:rM,kind:U.string(),strength:U.enum(["must","should","may","must_not"]).nullable(),plaintext:U.string(),block_index:U.number().int().nonnegative(),effective_selectors:TU,target_clause_id:U.string().nullable(),owner:U.string().nullable().optional(),evidence_ref:U.string().nullable().optional()}).superRefine(($,v)=>{if($.kind==="exception"&&$.target_clause_id===null)v.addIssue({code:U.ZodIssueCode.custom,path:["target_clause_id"],message:"Exception clauses must include target_clause_id"});if($.kind!=="exception"&&$.target_clause_id!==null)v.addIssue({code:U.ZodIssueCode.custom,path:["target_clause_id"],message:"Only exception clauses may include target_clause_id"})}).openapi("ParsedClause"),Cy=U.object({frontmatter:dM,clauses:U.array(tM),total_clauses:U.number().int().nonnegative(),warnings:U.array(U.string()),parser_version:U.string()}).openapi("RuleDocumentParseResult"),Ey=U.object({error:U.object({code:U.enum(["missing_frontmatter","invalid_frontmatter","missing_required_field","unknown_clause_marker","invalid_selector_namespace"]),message:U.string(),line:U.number().int().positive().nullable(),field:U.string().nullable()})}).openapi("RuleDocumentParseError");var vb=U.string().min(1).max(36).openapi("ReviewSetId"),h6=U.enum(["git","upload"]).openapi("ReviewSetSourceType"),uU=U.enum(["review_set","release_bundle","packet"]).openapi("ReviewSetKind"),GW=U.enum(["active","closed","archived","deleted"]).openapi("ReviewSetState"),pM=U.enum(["topo","lex","lex_fallback"]).openapi("ReviewSetOrderingMethod"),eM=U.enum(["reviewer","approver"]).openapi("ReviewSetParticipantRole"),aM=U.object({email:U.string().email(),roles:U.array(eM).min(1)}).openapi("ReviewSetParticipant"),sM=U.union([U.string(),U.object({review_id:U.string().optional(),session_id:U.string().optional(),required:U.boolean().optional()}).refine(($)=>typeof $.review_id==="string"||typeof $.session_id==="string",{message:"review_id is required for review entries",path:["review_id"]})]).openapi("ReviewSetSessionEntry"),$f=U.object({repo_id:cv,git_sha:Hv,file_path:J$,required:U.boolean().optional()}).openapi("ReviewSetGitFileEntry"),vf=U.object({project_id:U.string(),upload_batch_id:U.string(),file_path:J$,required:U.boolean().optional()}).openapi("ReviewSetUploadFileEntry"),_f=U.union([$f,vf]).openapi("ReviewSetFileEntry"),wf=U.object({allow_mixed_shas:U.boolean().optional(),require_all_files_reviewed:U.boolean().optional()}).openapi("ReviewSetConfig"),xy=U.object({title:U.string().optional(),kind:uU.optional(),source_type:h6,reviews:U.array(sM).max(200).optional(),files:U.array(_f).max(200).optional(),participants:U.array(aM).max(100).optional(),recipe_json:U.record(U.string(),U.unknown()).optional(),config:wf.optional()}).openapi("CreateReviewSetRequest"),gf=U.object({review_id:U.string(),file_path:J$,position:U.number().int().nonnegative(),required:U.boolean()}).openapi("ReviewSetItem"),bf=U.object({email:U.string().email(),roles:U.array(U.string()),review_url:U.string().url(),delivery:U.object({channel:U.literal("email"),state:U.literal("pending")})}).openapi("ReviewSetInvitation"),Uf=U.object({review_id:U.string(),invitations:U.array(bf)}).openapi("ReviewSetPerFileLinks"),ly=U.object({id:vb,title:U.string(),kind:uU,state:U.literal("active"),source_type:h6,repo_id:U.string().nullable(),git_sha:U.string().nullable(),project_id:U.string().nullable(),upload_batch_id:U.string().nullable(),ordering_method:pM,items:U.array(gf),links:U.object({set_link:U.string().url()}),per_file_links:U.array(Uf),event_id:U.string(),created_at:U.string().datetime(),request_id:U.string().nullable()}).openapi("CreateReviewSetResponse"),YW=U.object({id:vb,title:U.string().nullable(),kind:uU,state:GW,source_type:h6,repo_id:U.string().nullable(),git_sha:U.string().nullable(),project_id:U.string().nullable(),upload_batch_id:U.string().nullable(),item_count:U.number().int().nonnegative(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).openapi("ReviewSetSummary"),cy=U.object({source_type:h6.optional(),repo_id:cv.optional(),git_sha:Hv.optional(),project_id:U.string().optional(),upload_batch_id:U.string().optional(),kind:uU.optional(),state:GW.optional(),cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).default(20)}).openapi("ListReviewSetsQuery"),yy=U.object({items:U.array(YW),next_cursor:U.string().nullable(),request_id:U.string()}).openapi("ListReviewSetsResponse"),my=U.object({title:U.string().min(1).max(4096).optional(),state:U.enum(["active","closed","archived"]).optional()}).refine(($)=>$.title!==void 0||$.state!==void 0,"At least one field must be provided").openapi("UpdateReviewSetRequest"),ry=YW.extend({request_id:U.string()}).openapi("UpdateReviewSetResponse"),RU=U.enum(["pass","fail","warn"]).openapi("ReviewSetStatusVerdict"),CU=U.object({code:U.string(),message:U.string(),pointers:U.array(U.string())}).openapi("ReviewSetReasonCode"),x8=U.object({review_id:U.string(),file_path:J$,required:U.boolean(),verdict:RU,reason_codes:U.array(CU)}).openapi("ReviewSetStatusItem"),l8=U.object({action:U.string(),review_id:U.string(),finding_id:U.string().optional(),approver_email:U.string().email().optional(),reason_code:U.string(),message:U.string()}).openapi("ReviewSetActionRequired"),oy=U.object({review_set_id:vb,verdict:RU,reason_codes:U.array(CU),items:U.array(x8),policy_snapshot_id:U.string().nullable(),actions_required:U.array(l8).optional(),request_id:U.string()}).openapi("GetReviewSetStatusResponse"),Jf=U.enum(["blocked","needs_changes","suggestions","approved","not_started","in_progress"]).openapi("ReviewSetStatusIndicator"),Df=U.object({requested:U.boolean(),decided:U.boolean(),decision:U.enum(["approved","rejected","conditional","pending"])}).openapi("ReviewSetApprovalState"),c8=U.object({review_id:U.string(),role:U.enum(["content","rules"]),file_path:J$,position:U.number().int().nonnegative(),required:U.boolean(),status_summary:U.object({review_state:U.string(),thread_counts:U.object({total:U.number().int().nonnegative(),open:U.number().int().nonnegative(),resolved:U.number().int().nonnegative()}),severity_counts:U.object({blocking:U.number().int().nonnegative(),needs_changes:U.number().int().nonnegative(),suggestion:U.number().int().nonnegative()}),has_system_findings:U.boolean(),approval_state:Df.nullable(),status_indicator:Jf})}).openapi("ReviewSetOverviewItem"),QW=U.object({total_items:U.number().int().nonnegative(),reviewed_items:U.number().int().nonnegative(),approved_items:U.number().int().nonnegative(),completion_pct:U.number().int().min(0).max(100)}).openapi("ReviewSetProgress"),dy=U.object({id:vb,title:U.string().nullable(),kind:U.string(),state:U.string(),source_type:h6,repo_id:U.string().nullable(),git_sha:U.string().nullable(),project_id:U.string().nullable(),upload_batch_id:U.string().nullable(),snapshot_id:U.string().nullable(),ordering_method:U.string().nullable(),recipe_json:U.record(U.string(),U.unknown()).nullable(),created_at:U.string().datetime(),updated_at:U.string().datetime(),items:U.array(c8),progress:QW,next_unresolved:U.object({review_id:U.string(),file_path:J$,block_id:U.string().nullable()}).nullable(),links:U.object({set_link:U.string().url().nullable()}),request_id:U.string()}).openapi("GetReviewSetResponse"),Xf=U.object({id:vb,title:U.string().nullable(),kind:U.string(),state:U.string(),source_type:h6,repo_id:U.string().nullable(),git_sha:U.string().nullable(),project_id:U.string().nullable(),upload_batch_id:U.string().nullable(),snapshot_id:U.string().nullable(),ordering_method:U.string().nullable(),recipe_json:U.record(U.string(),U.unknown()).nullable(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).openapi("ReviewSetExportMetadata"),Gf=U.object({review_id:U.string(),file_path:J$,position:U.number().int().nonnegative(),required:U.boolean(),review_export:U.record(U.string(),U.unknown())}).openapi("ReviewSetExportItem"),Yf=U.object({canonicalization:U.literal("jcs"),export_sha256:U.string().regex(/^[0-9a-f]{64}$/).nullable()}).openapi("ReviewSetExportIntegrity"),ty=U.object({schema:U.literal("v2"),view_requested:U.string().nullable(),view_resolved:U.literal("review_set.v1"),set:Xf,items:U.array(Gf),progress:QW,integrity:Yf}).openapi("GetReviewSetExportResponse");var Qf=["draft","ready","approved","activated","stale","rejected"];var y8=U.enum(Qf).openapi("ReleaseCandidateState"),Wf=["mark_ready","approve","reject","mark_stale","return_to_draft","activate","abandon"],m8=["mark_ready","reject","return_to_draft","activate","abandon"],Hf=U.enum(Wf).openapi("ReleaseCandidateTransitionAction"),sy=U.enum(m8).openapi("PublicReleaseCandidateTransitionAction");var qf=["release_diff","selector_coverage","precedence_check","casebank_replay"],If=U.enum(qf).openapi("SimulationType"),Bf=U.object({type:If,result:U.unknown(),computed_at:U.string().datetime(),basis_hash:U.string().min(1)}).openapi("SimulationReceipt"),WW=U.object({approver_id:U.string().min(1),approved_at:U.string().datetime(),verification_notes:U.string(),approval_scope:U.string().min(1)}).openapi("ApprovalReceipt"),Lf=["clause_count","selector_count","precedence_clause_count","exception_change_count"],Vf=U.enum(Lf).openapi("ReleaseCandidateVerificationMetric"),jf=U.object({clause_count:U.number().int().min(0),selector_count:U.number().int().min(0),precedence_clause_count:U.number().int().min(0),exception_change_count:U.number().int().min(0),high_impact:U.boolean(),triggered_thresholds:U.array(Vf),evaluated_at:U.string().datetime()}).openapi("ReleaseCandidateVerificationSummary"),Ff=U.enum(["not_required","pending","approved"]).openapi("ReleaseCandidateVerificationStatus"),Kf=U.object({required_approvals:U.number().int().min(0).default(0),approval_receipts:U.array(WW),status:Ff,summary:jf}).openapi("ReleaseCandidateVerification"),Of=["revision_superseded","new_revision_published","based_on_release_no_longer_active"],Nf=U.enum(Of).openapi("StalenessReason"),$m=U.object({is_stale:U.boolean(),reason:Nf.nullable(),detail:U.string().nullable(),checked_at:U.string().datetime()}).openapi("StalenessCheckResult");var vm=U.object({workspace_id:U.string().min(1).max(128).optional(),included_rule_revision_ids:U.array(U.string().min(1).max(128)).min(1),based_on_active_release_id:U.string().min(1).max(128).optional(),rollback_of_release_id:U.string().min(1).max(128).optional(),title:U.string().min(1).max(256).optional(),idempotency_key:U.string().max(256).optional()}).strict().openapi("CreateReleaseCandidateRequest"),HW=U.object({release_candidate_id:U.string(),workspace_id:U.string(),state:y8,title:U.string().nullable(),included_rule_revision_ids:U.array(U.string()),manifest_hash:U.string().nullable(),based_on_active_release_id:U.string().nullable(),rollback_of_release_id:U.string().nullable(),required_approvals:U.number().int().min(0).default(1),approval_receipts:U.array(WW),simulation_receipts:U.array(Bf),rejected_by:U.string().nullable(),rejection_reason:U.string().nullable(),stale_reason:U.string().nullable(),rule_release_id:U.string().nullable(),verification:Kf.nullable().default(null),compiled_at:U.string().datetime().nullable(),compiled_by:U.string().nullable(),version:U.number().int().positive(),created_at:U.string().datetime(),updated_at:U.string().datetime()}).openapi("ReleaseCandidateSummary"),_m=U.object({limit:U.coerce.number().int().min(1).max(25).default(6)}).strict().openapi("ListReleaseCandidatesQuery"),wm=U.object({items:U.array(HW),request_id:U.string()}).openapi("ListReleaseCandidatesResponse"),kf=U.object({total_items:U.number().int().nonnegative(),reviewed_items:U.number().int().nonnegative(),approved_items:U.number().int().nonnegative(),completion_pct:U.number().int().min(0).max(100)}).openapi("ReleaseCandidateProgress"),zf=U.object({review_id:U.string(),file_path:U.string(),block_id:U.string().nullable()}).openapi("ReleaseCandidateNextUnresolved"),nf=U.object({set_link:U.string().url().nullable()}).openapi("ReleaseCandidateLinks"),Pf=HW.extend({source_type:U.enum(["git","upload"]),repo_id:U.string().nullable(),git_sha:U.string().nullable(),project_id:U.string().nullable(),upload_batch_id:U.string().nullable(),items:U.array(c8),progress:kf,next_unresolved:zf.nullable(),links:nf}).openapi("ReleaseCandidateDetail"),gm=Pf.extend({request_id:U.string()}).openapi("GetReleaseCandidateResponse"),bm=U.object({release_candidate_id:U.string(),verdict:RU,reason_codes:U.array(CU),items:U.array(x8),policy_snapshot_id:U.string().nullable(),actions_required:U.array(l8).optional(),request_id:U.string()}).openapi("GetReleaseCandidateStatusResponse"),Um=U.object({action:Hf,expected_version:U.number().int().positive().optional(),idempotency_key:U.string().max(256).optional(),rejection_reason:U.string().min(1).max(1024).optional(),stale_reason:U.string().min(1).max(1024).optional()}).strict().superRefine(($,v)=>{if($.action==="reject"&&!$.rejection_reason)v.addIssue({code:U.ZodIssueCode.custom,message:"rejection_reason is required when action is reject",path:["rejection_reason"]});if($.action==="abandon"&&!$.rejection_reason)v.addIssue({code:U.ZodIssueCode.custom,message:"rejection_reason is required when action is abandon",path:["rejection_reason"]});if($.action==="mark_stale"&&!$.stale_reason)v.addIssue({code:U.ZodIssueCode.custom,message:"stale_reason is required when action is mark_stale",path:["stale_reason"]})}).openapi("TransitionReleaseCandidateRequest"),Jm=U.object({release_candidate_id:U.string(),from_state:y8,to_state:y8,rule_release_id:U.string().nullable(),release_version:U.number().int().positive().nullable().optional(),version:U.number().int().positive(),updated_at:U.string().datetime(),request_id:U.string()}).openapi("TransitionReleaseCandidateResponse");var r8=U.record(U.string(),U.unknown()).openapi("ProjectConfig"),Af=U.enum(["active","deleting","deleted"]).openapi("ProjectState"),Gm=U.object({name:U.string().min(1).max(256),config:r8.optional()}).openapi("CreateProjectRequest"),Ym=U.object({name:U.string().min(1).max(256).optional(),config:r8.optional()}).openapi("UpdateProjectRequest"),Qm=U.object({cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).default(20)}).openapi("ListProjectsQuery"),Mf=U.object({id:U.string(),status:U.string(),file_count:U.number().int().nonnegative(),total_size_bytes:U.number().int().nonnegative(),created_at:U.string().datetime()}).openapi("ProjectLatestBatch"),ff=U.object({id:U.string(),name:U.string(),state:Af,tenant_id:U.string(),config_hash:U.string().nullable(),config:r8.nullable(),created_by_user_id:U.string().nullable(),created_at:U.string().datetime(),latest_batch:Mf.nullable().optional(),request_id:U.string()}).openapi("ProjectResponse"),Wm=U.object({items:U.array(ff.omit({request_id:!0})),next_cursor:U.string().nullable(),has_more:U.boolean(),request_id:U.string()}).openapi("ListProjectsResponse"),Hm=U.object({project_id:U.string(),state:U.literal("deleting"),deletion_job_id:U.string(),request_id:U.string()}).openapi("DeleteProjectResponse"),qm=U.object({from_path:J$,to_path:J$}).refine(($)=>$.from_path!==$.to_path,{message:"from_path and to_path must differ",path:["to_path"]}).openapi("CreateProjectMoveRequest"),Im=U.object({id:U.string(),project_id:U.string(),from_path:J$,to_path:J$,declared_at:U.string().datetime(),request_id:U.string()}).openapi("ProjectMoveResponse");var o8=U.enum(["git","upload"]).openapi("SessionTemplateSourceType"),Sf=U.object({participant_id:U.string().min(1).max(256),scope:U.enum(["read","comment","approve"])}).openapi("SessionTemplateParticipantConfig"),Tf=U.object({slack_channel:U.string().max(256).optional(),email_participants:U.boolean().optional()}).openapi("SessionTemplateNotificationConfig"),qW=U.object({participants:U.array(Sf).max(100).optional(),checks_enabled:U.boolean().optional(),policy_enabled:U.boolean().optional(),steering_enabled:U.boolean().optional(),extra_json:U.record(U.string(),U.unknown()).optional(),notification_config:Tf.optional()}).openapi("SessionTemplateConfig"),Vm=U.object({name:U.string().min(1).max(256),description:U.string().max(4000).optional(),source_type:o8,repo_id:U.string().max(256).optional(),project_id:U.string().max(256).optional(),config:qW}).openapi("CreateSessionTemplateRequest"),jm=U.object({source_type:o8.optional(),repo_id:U.string().optional(),project_id:U.string().optional(),include_archived:U.boolean().optional(),cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).default(20)}).openapi("ListSessionTemplatesQuery"),uf=U.object({id:U.string(),tenant_id:U.string(),name:U.string(),description:U.string().nullable(),source_type:o8,repo_id:U.string().nullable(),project_id:U.string().nullable(),config:qW,created_by_user_id:U.string().nullable(),created_at:U.string().datetime(),updated_at:U.string().datetime(),archived_at:U.string().datetime().nullable(),request_id:U.string()}).openapi("SessionTemplateResponse"),Fm=U.object({items:U.array(uf.omit({request_id:!0})),next_cursor:U.string().nullable(),request_id:U.string()}).openapi("ListSessionTemplatesResponse");var Rf=U.object({id:U.string(),tenant_id:U.string(),name:U.string(),description:U.string().nullable(),color:U.string().nullable(),created_by:U.string(),created_at:U.string().datetime().nullable(),updated_at:U.string().datetime().nullable(),archived_at:U.string().datetime().nullable(),request_id:U.string()}).openapi("CollectionResponse"),Nm=U.object({name:U.string().min(1),description:U.string().nullable().optional(),color:U.string().nullable().optional()}).openapi("CreateCollectionRequest"),km=U.object({name:U.string().min(1).optional(),description:U.string().nullable().optional(),color:U.string().nullable().optional(),archived:U.boolean().optional()}).openapi("UpdateCollectionRequest"),zm=U.object({cursor:U.string().optional(),limit:U.coerce.number().int().min(1).max(100).optional(),include_archived:U.boolean().optional()}).openapi("ListCollectionsQuery"),Cf=U.object({collection_id:U.string(),session_id:U.string(),added_at:U.string().datetime().nullable(),added_by:U.string(),request_id:U.string()}).openapi("CollectionSessionResponse"),im=U.object({session_id:U.string()}).openapi("AddCollectionSessionRequest"),Ef=U.object({id:U.string(),collection_id:U.string(),url:U.string().url(),title:U.string(),link_type:U.string(),created_by:U.string(),created_at:U.string().datetime().nullable(),request_id:U.string()}).openapi("CollectionSourceLinkResponse"),nm=U.object({url:U.string().url(),title:U.string(),link_type:U.string()}).openapi("CreateCollectionSourceLinkRequest"),Pm=U.object({items:U.array(Rf.omit({request_id:!0})),cursor:U.string().nullable(),has_more:U.boolean(),request_id:U.string()}).openapi("ListCollectionsResponse"),Am=U.object({id:U.string(),tenant_id:U.string(),name:U.string(),description:U.string().nullable(),color:U.string().nullable(),created_by:U.string(),created_at:U.string().datetime().nullable(),updated_at:U.string().datetime().nullable(),archived_at:U.string().datetime().nullable(),source_links:U.array(Ef.omit({request_id:!0})),sessions:U.array(Cf.omit({request_id:!0})),request_id:U.string()}).openapi("CollectionDetailResponse"),Mm=U.object({request_id:U.string()}).openapi("CollectionMutationAck");var IW=U.enum(["git","upload"]).openapi("CorpusSourceType"),Zf=U.enum(["building","ready","failed"]).openapi("CorpusSnapshotStatus"),hf=U.enum(["frontmatter","marker","sidecar","auto"]).openapi("CorpusDocIdentityMode"),BW=U.object({in_scope_globs:U.array(U.string().min(1)).min(1).optional(),exclude_globs:U.array(U.string().min(1)).optional(),max_files:U.number().int().positive().optional(),max_total_bytes:U.number().int().positive().optional(),max_snapshot_build_seconds:U.number().int().positive().optional(),doc_identity_mode:hf.optional(),include_external_links:U.boolean().optional()}).openapi("CorpusConfig"),Tm=U.object({git_sha:Hv,corpus_config:BW.optional()}).openapi("RequestGitSnapshot"),um=U.object({upload_batch_id:U.string(),corpus_config:BW.optional()}).openapi("RequestUploadSnapshot"),Rm=U.object({snapshot_id:U.string(),status:Zf,source_type:IW,repo_id:cv.optional(),git_sha:Hv.optional(),project_id:U.string().optional(),upload_batch_id:U.string().optional(),indexer_version:U.string(),config_hash:U.string(),snapshot_sha256:U.string().nullable().optional(),error_json:U.unknown().optional(),created_at:U.string().datetime(),request_id:U.string()}).openapi("CorpusSnapshotStatusResponse"),xf=U.object({source_path:J$,source_doc_key:U.string().nullable(),source_block_id:U.string().nullable(),link_kind:U.string(),context:U.null()}).openapi("CorpusBacklinkItem"),Cm=U.object({snapshot_id:U.string(),file_path:J$,anchor:U.string().nullable(),backlinks:U.array(xf),request_id:U.string()}).openapi("CorpusBacklinksResponse"),LW=U.object({file_path:J$,doc_key:U.string().nullable(),doc_type:U.string().nullable(),title:U.string().nullable()}).openapi("CorpusRepoMapItem"),Em=U.object({snapshot_id:U.string(),git_sha:Hv,files:U.array(LW),request_id:U.string()}).openapi("CorpusGitRepoMapResponse"),Zm=U.object({snapshot_id:U.string(),upload_batch_id:U.string(),files:U.array(LW),request_id:U.string()}).openapi("CorpusUploadRepoMapResponse"),lf=U.object({file_path:J$,doc_key:U.string().nullable(),distance:U.number().int().positive(),link_kind:U.string(),via_path:J$}).openapi("CorpusImpactRadiusItem"),hm=U.object({snapshot_id:U.string(),review_id:U.string(),file_path:J$,impacted_files:U.array(lf),request_id:U.string()}).openapi("CorpusImpactResponse"),xm=U.object({target_file:J$,anchor:U.string().nullable(),block_id:U.string(),plaintext:U.string(),html:U.string(),request_id:U.string()}).openapi("CorpusLinkPreviewResponse"),cf=U.object({file_path:J$,doc_key:U.string().nullable(),violation_type:U.enum(["unknown_doc_type","missing_required_field","invalid_field_type","unknown_tag","unknown_category","invalid_locale"]),field:U.string(),expected:U.string(),actual:U.string(),message:U.string()}).openapi("CorpusTaxonomyViolation"),yf=U.object({file_path:J$,doc_key:U.string().min(1).optional(),doc_type:U.string().min(1).optional(),title:U.string().optional(),source_content_sha256:U.string().regex(/^[0-9a-f]{64}$/),frontmatter:U.object({raw:U.record(U.string(),U.unknown()).nullable(),normalized:U.record(U.string(),U.unknown()).nullable()}).optional(),taxonomy_violations:U.array(cf).optional()}).openapi("CorpusSnapshotArtifactDoc"),mf=U.object({source_file_path:J$,target_file_path:J$.optional(),target_url:U.string().url().optional(),edge_type:U.enum(["link","image","include","xref"]),resolved:U.boolean()}).refine(($)=>$.target_file_path!==void 0!==($.target_url!==void 0),{message:"exactly one of target_file_path or target_url must be present"}).openapi("CorpusSnapshotArtifactEdge"),lm=U.object({schema_version:U.literal("corpus_snapshot.v1"),snapshot_id:U.string(),source_type:IW,repo_id:cv.optional(),git_sha:Hv.optional(),project_id:U.string().optional(),upload_batch_id:U.string().optional(),scope:U.object({include_globs:U.array(U.string().min(1)).min(1),exclude_globs:U.array(U.string().min(1)).optional()}),status:U.literal("ready"),docs:U.array(yf),edges:U.array(mf),indexer_version:U.string(),config_hash:U.string(),created_at:U.string().datetime(),completed_at:U.string().datetime()}).openapi("CorpusSnapshotArtifact");var mm=U.object({content_ref:Gw.openapi({description:"Reference to the content to review"}),participants:U.array(U.object({email:U.string().email(),name:U.string().optional(),role:U.enum(["reviewer","operator","observer"]).default("reviewer")})).optional().openapi({description:"Optional list of participants to invite"}),options:U.object({block_id_scheme:U.literal("v1").default("v1").optional(),render_profile:U.string().optional()}).optional(),operator_name:U.string().max(200).optional().openapi({description:"Name of the operator initiating the review"}),focus_areas:U.array(U.string().max(100)).max(10).optional().openapi({description:"Areas the reviewer should focus on"}),framing:U.string().max(1000).optional().openapi({description:"Context framing text shown to reviewers"}),carry_forward_threads:U.boolean().optional().openapi({description:"Whether to carry forward threads from the superseded session"}),carry_forward_filter:U.enum(["all","blocking","needs_changes"]).optional().openapi({description:"Filter for which threads to carry forward"})}).openapi("CreateSessionRequest"),rf=U.object({thread_id:U.string().openapi({description:"Thread ID to resolve"}),disposition:U.enum(["fixed","wont_fix","duplicate","by_design"]).openapi({description:"Resolution disposition"}),evidence:U.string().max(2000).optional().openapi({description:"Optional evidence or explanation"})}).openapi("ThreadResolution"),rm=U.object({git_sha:U.string().optional().openapi({description:"Git commit SHA for the new revision"}),file_path:U.string().optional().openapi({description:"File path (defaults to predecessor's)"}),title:U.string().max(512).optional().openapi({description:"Title for the new session"}),changes_summary:U.string().max(5000).optional().openapi({description:"Summary of changes for round-transition emails"}),resolutions:U.array(rf).optional().openapi({description:"Resolution manifest for predecessor threads"}),auto_read_only_on_supersede:U.boolean().default(!0).optional().openapi({description:"Whether to mark predecessor as read-only (default: true)"})}).openapi("SupersedeSessionRequest"),of=U.object({block_id:U.string(),block_id_scheme:U.literal("v1"),block_index:U.number().int().min(0),block_type:U.string(),block_key:U.string().nullable(),block_key_source:U.enum(["marker","sidecar","auto"]).nullable(),start_line:U.number().int().min(1),end_line:U.number().int().min(1),start_offset:U.number().int().min(0),end_offset:U.number().int().min(0)}).openapi("BlockSummary"),VW=U.object({id:U.string().openapi({description:"Unique session identifier",example:"ses_abc123"}),created_at:U.string().datetime().openapi({description:"ISO 8601 timestamp of session creation"}),state:U.enum(["draft","created","active","closed","expired","superseded","archived","deleted"]).openapi({description:"Current session lifecycle state"}),content_ref:Gw,source_content_sha256:U.string().regex(/^[a-f0-9]{64}$/).openapi({description:"SHA-256 hash of canonical source content"}),block_count:U.number().int().min(0).openapi({description:"Number of blocks in the session"}),thread_count:U.number().int().min(0).openapi({description:"Total number of threads in the session"}),open_thread_count:U.number().int().min(0).openapi({description:"Number of open (unresolved) threads"})}).openapi("Session"),om=VW.extend({blocks:U.array(of).optional().openapi({description:"Block summaries (included on creation)"})}).openapi("CreateSessionResponse"),dm=U.object({session_id:U.string().openapi({description:"Session identifier",example:"ses_abc123"})}),tm=VW.openapi("GetSessionResponse"),pm=OQ.openapi("GetSessionBlocksQueryParams"),df=U.object({block_id:U.string(),block_key:U.string().nullable(),block_key_source:U.enum(["marker","sidecar","auto"]).nullable(),block_index:U.number().int().min(0),block_type:U.string(),start_line:U.number().int().min(1),end_line:U.number().int().min(1),start_offset:U.number().int().min(0),end_offset:U.number().int().min(0)}).openapi("SessionBlockListItem"),em=U.object({session_id:U.string(),block_id_scheme:U.literal("v1"),block_key_scheme:U.literal("v1"),total_blocks:U.number().int().min(0),blocks:U.array(df),next_cursor:U.string().nullable(),has_more:U.boolean(),request_id:U.string()}).openapi("GetSessionBlocksResponse"),tf=U.object({block_id:U.string(),block_key:U.string().nullable().optional(),block_key_source:U.string().nullable().optional(),block_index:U.number().int(),block_type:U.string(),properties:U.record(U.string(),U.unknown()).nullable().optional(),html:U.string().openapi({description:"Rendered HTML for this block"}),start_line:U.number().int(),end_line:U.number().int(),start_offset:U.number().int().optional(),end_offset:U.number().int().optional()}).openapi("RenderBlock"),am=U.object({session_id:U.string(),source_content_sha256:U.string(),blocks:U.array(tf),render_profile:U.string().nullable(),etag:U.string().openapi({description:"ETag for cache validation"})}).openapi("GetSessionRenderResponse"),pf=U.object({block_id:U.string(),thread_count:U.number().int().min(0),open_thread_count:U.number().int().min(0),has_unread:U.boolean().optional(),severity_max:U.enum(["suggestion","needs_changes","blocking"]).nullable()}).openapi("BlockAnnotation"),sm=U.object({session_id:U.string(),blocks:U.array(pf),updated_at:U.string().datetime()}).openapi("GetSessionAnnotationsResponse");var _r=U.object({token:U.string().openapi({description:"URL token from magic link",example:"tok_abc123xyz..."})}).openapi("ExchangeTokenRequest"),wr=U.object({access_token:U.string().openapi({description:"Short-lived access token for API requests"}),token_type:U.literal("Bearer"),expires_in:U.number().int().openapi({description:"Token lifetime in seconds",example:3600}),refresh_grant:U.boolean().optional().openapi({description:"Whether a refresh cookie was set"})}).openapi("ExchangeTokenResponse"),gr=U.object({access_token:U.string(),token_type:U.literal("Bearer"),expires_in:U.number().int()}).openapi("RefreshTokenResponse"),br=U.object({email:U.string().email().openapi({description:"Email address to send OTP to"})}).openapi("SendOtpRequest"),Ur=U.object({code:U.string().length(6).regex(/^\d{6}$/).openapi({description:"6-digit OTP code",example:"123456"})}).openapi("VerifyOtpRequest"),Jr=U.object({access_token:U.string().openapi({description:"Access token with elevated verification tier"}),token_type:U.literal("Bearer"),expires_in:U.number().int(),verification_tier:U.enum(["step_up"]).openapi({description:"Verification tier achieved"})}).openapi("VerifyOtpResponse");var ef=["full","redacted","pseudonymous","block_window.v1","unresolved.v1","response_matrix.v1","delta_review.v1","corpus_context.v1"],af=["repair_kit.v1"],sf={block_window:"block_window.v1",unresolved:"unresolved.v1",response_matrix:"response_matrix.v1",repair_kit:"repair_kit.v1",delta_review:"delta_review.v1",corpus_context:"corpus_context.v1"};function $S($){if(ef.includes($))return $;if(af.includes($))return $;let v=sf[$];if(v)return v;throw Error(`Unknown export view: ${$}`)}var vS=U.enum(["full","redacted","pseudonymous","block_window","block_window.v1","unresolved","unresolved.v1","response_matrix","response_matrix.v1","repair_kit","repair_kit.v1","delta_review","delta_review.v1","corpus_context","corpus_context.v1"]),_S=U.enum(["json","llm_prompt","llm_prompt.v1"]),Yr=U.object({schema:U.literal("v2").default("v2"),view:vS.default("full"),format:_S.default("json"),allow_partial:U.boolean().default(!1),anchors:U.string().optional(),window_before:U.coerce.number().int().min(0).default(2),window_after:U.coerce.number().int().min(0).default(2),severity:U.string().optional(),tags:U.string().optional(),assignee:U.string().optional(),signed:U.boolean().optional(),include_derived_keys:U.boolean().optional()}).superRefine(($,v)=>{if($S($.view)==="block_window.v1"){if(!$.anchors||$.anchors.trim().length===0)v.addIssue({code:U.ZodIssueCode.custom,path:["anchors"],message:"anchors is required when view=block_window.v1"})}}),wS=U.object({block_id:U.string(),block_id_scheme:U.literal("v1"),block_index:U.number().int().min(0),block_type:U.string(),block_key:U.string().nullable(),block_key_source:U.enum(["marker","sidecar","auto"]).nullable(),start_line:U.number().int().min(1),end_line:U.number().int().min(1),start_offset:U.number().int().min(0),end_offset:U.number().int().min(0),plaintext_sha256:U.string().regex(/^[a-f0-9]{64}$/).nullable()}).openapi("ExportBlock"),gS=U.object({id:U.string(),author_email:U.string().email().nullable().optional(),author_name:U.string().nullable(),author_source:U.string().nullable().optional(),body_md:U.string(),created_at:U.string().datetime(),updated_at:U.string().datetime().nullable(),version:U.number().int().min(1)}).openapi("ExportComment"),bS=U.object({id:U.string(),anchor:yv,block_id:U.string().nullable().optional(),status:U.enum(["open","resolved"]),severity:U.enum(["suggestion","needs_changes","blocking"]),created_at:U.string().datetime(),updated_at:U.string().datetime().nullable().optional(),finding_id:U.string().nullable().optional(),rule_id:U.string().nullable().optional(),rule_fingerprint:U.string().nullable().optional(),check_run_id:U.string().nullable().optional(),rule_ref:s0.optional(),comments:U.array(gS)}).openapi("ExportThread"),US=U.object({open_threads:U.number().int().nonnegative(),resolved_threads:U.number().int().nonnegative(),blocking_threads:U.number().int().nonnegative()}).openapi("ExportIssuePerAnchorStatus"),JS=U.object({anchor_id:U.string(),block_id:U.string().nullable(),anchor_type:U.enum(["session","block","range"]),linked_thread_ids:U.array(U.string()),per_anchor_status:US}).openapi("ExportIssueAnchor"),DS=U.object({issue_id:U.string(),title:U.string(),status:U.string(),severity:U.string().nullable(),tags:U.array(U.string()),anchor_count:U.number().int().nonnegative(),thread_count:U.number().int().nonnegative(),anchors_in_this_session:U.array(JS)}).openapi("ExportIssue"),XS=U.object({disposition_id:U.string(),thread_id:U.string(),state:U.string(),rationale_md:U.string().nullable(),reason_code:U.string().nullable(),waiver_expires_at:U.string().datetime().nullable(),decided_by_participant_id:U.string().nullable(),decided_by_user_id:U.string().nullable(),decided_by_verification_level:U.string().nullable(),decided_by_display:U.string(),decided_at:U.string().datetime(),provenance_json:U.record(U.string(),U.unknown()).nullable(),created_at:U.string().datetime()}).openapi("ExportDisposition"),GS=U.object({evidence_id:U.string(),thread_id:U.string(),evidence_type:U.string(),evidence_json:U.record(U.string(),U.unknown()),verification_status:U.string(),verification_tier:U.number().int().nullable(),verified_at:U.string().datetime().nullable(),verifier_version:U.string().nullable(),dedupe_key:U.string().nullable(),created_by_participant_id:U.string().nullable(),created_by_user_id:U.string().nullable(),created_by_verification_level:U.string().nullable(),created_by_display:U.string(),created_at:U.string().datetime()}).openapi("ExportEvidence"),YS=U.string().regex(/^[a-z][a-z0-9_.-]*$/),QS=U.string().regex(/^[a-z][a-z0-9_.-]*\.v[0-9]+$/),WS=U.object({schema_version:QS,authoritative:U.boolean()}).passthrough().openapi("ExtensionEnvelope");var HS=U.object({canonicalization:U.string(),export_sha256:U.string().regex(/^[a-f0-9]{64}$/).nullable(),export_full_sha256:U.string().regex(/^[a-f0-9]{64}$/).nullable().optional()}).passthrough().openapi("ExportIntegrity"),qS=U.object({section:U.enum(["threads","comments","approvals","proposed_changes","extensions"]),reason:U.enum(["db_timeout","permission_denied","section_disabled","internal_error"]),count_missing:U.number().int().min(0).optional()}).openapi("ExportIncompleteSection"),Qr=U.object({schema_version:U.literal("export.v1"),exported_at:U.string().datetime(),view_requested:U.string().nullable().optional(),view_resolved:U.string().optional(),integrity:HS,partial:U.boolean().optional(),incomplete_sections:U.array(qS).optional(),session:U.object({id:U.string(),created_at:U.string().datetime(),status:U.enum(["active","closed","archived"]),content_ref:Gw,source_content_sha256:U.string().regex(/^[a-f0-9]{64}$/),root_session_id:U.string().nullable().optional(),supersedes_session_id:U.string().nullable().optional()}),blocks:U.array(wS),threads:U.array(bS),issues:U.array(DS).default([]).openapi({description:"Issue summaries with per-anchor status for anchors in this session"}),dispositions:U.array(XS).default([]).openapi({description:"Thread disposition log entries exported for audit/compliance workflows"}),evidence:U.array(GS).default([]).openapi({description:"Thread evidence records exported for audit/compliance workflows"}),approvals:U.object({}).passthrough().optional().openapi({description:"Approval state summary (M0.5+)"}),extensions:U.record(YS,WS).optional().openapi({description:"Optional extension envelopes keyed by namespace (extensions.{namespace})"}),metadata:U.object({export_view:U.string().optional(),integrity_hash:U.string().optional()}).optional()}).openapi("ExportResponse");var IS=U.object({code:U.string(),details:U.record(U.string(),U.unknown()).optional(),thread_ids:U.array(U.string()).optional(),approval_ids:U.array(U.string()).optional()}).openapi("PolicyReason"),BS=U.object({supersedes_session_id:U.string(),blocks_added:U.number().int().min(0),blocks_removed:U.number().int().min(0),blocks_changed:U.number().int().min(0),blocks_unchanged:U.number().int().min(0),orphaned_threads_count:U.number().int().min(0)}).openapi("BriefingDeltaSummary"),LS=U.object({verdict:U.enum(["pass","fail","warn"]),reasons:U.array(IS)}).openapi("BriefingPolicyStatus"),VS=U.object({thread_id:U.string(),block_id:U.string().nullable(),severity:U.string(),snippet:U.string().max(120),source:U.enum(["human","system","automation"]),has_disposition:U.boolean()}).openapi("BriefingBlockerItem"),jS=U.object({items:U.array(VS),total:U.number().int().min(0)}).openapi("BriefingBlockers"),FS=U.object({decision:U.enum(["approved","rejected","conditional"]),decided_by:U.string(),decided_at:U.string().datetime(),pending_conditions:U.number().int().min(0)}).openapi("BriefingApprovalDecision"),KS=U.object({requested:U.boolean(),decisions:U.array(FS),pending_count:U.number().int().min(0)}).openapi("BriefingApprovalsSummary"),OS=U.object({last_run_id:U.string(),status:U.enum(["completed","running","failed"]),total_findings:U.number().int().min(0),gating_findings:U.number().int().min(0),informational_findings:U.number().int().min(0)}).openapi("BriefingChecksSummary"),NS=U.object({total:U.number().int().min(0),unresolved:U.number().int().min(0),blocking:U.number().int().min(0),system_findings:U.number().int().min(0),human:U.number().int().min(0)}).openapi("BriefingThreadsSummary"),qr=U.object({schema_version:U.literal("briefing.v1"),session_id:U.string(),content_ref:Gw,title:U.string().nullable(),created_at:U.string().datetime(),delta:BS.optional(),policy_status:LS,blockers:jS,approvals:KS,checks:OS.optional(),threads:NS,computed_at:U.string().datetime(),annotations_version:U.number().int().min(1)}).openapi("BriefingBundle");var kS=U.enum(["review","repo","tenant"]).openapi("SearchScope"),jW=U.enum(["fts","semantic"]).openapi({description:"`fts` is the canonical public search mode. `semantic` remains compatibility-only, non-authoritative retrieval and must not be treated as required launch behavior."}).openapi("SearchMode"),zS=U.enum(["review","block","finding","comment"]).openapi("SearchKind"),EU=U.enum(["open","resolved","draft"]).openapi("SearchStatus"),FW=U.enum(["suggestion","needs_changes","blocking"]).openapi("SearchSeverity"),Lr=U.object({q:U.string().trim().min(1),scope:kS.default("tenant").optional(),mode:jW.default("fts").optional().openapi({description:"Canonical public search uses `fts`. `semantic` is compatibility-only and may be disabled per tenant."}),review_id:U.string().trim().min(1).optional(),repo_id:U.string().trim().min(1).max(256).optional(),project_id:U.string().trim().min(1).max(256).optional(),model:U.string().trim().min(1).max(128).optional().openapi({description:"Compatibility-only semantic-search model hint. Canonical FTS callers should omit this field."}),min_score:U.coerce.number().min(0).max(1).optional().openapi({description:"Compatibility-only semantic-search threshold. Canonical FTS callers should omit this field."}),kind:U.string().trim().min(1).optional().openapi({description:"Single kind or comma-separated kinds"}),status:EU.optional(),severity:FW.optional(),assignee:U.string().trim().min(1).optional(),tags:U.string().trim().min(1).optional().openapi({description:"Comma-separated tag list"}),from:U.string().datetime().optional(),to:U.string().datetime().optional(),filters:U.string().trim().min(1).optional().openapi({description:"JSON-encoded or key=value,key=value filter expression"}),cursor:U.string().min(1).optional(),limit:U.coerce.number().int().min(1).max(100).optional()}).strict().openapi("SearchQueryParams"),iS=U.discriminatedUnion("type",[U.object({type:U.literal("review")}).strict(),U.object({type:U.literal("block"),block_id:jU}).strict()]).openapi("SearchAnchor"),nS=U.object({schema_version:U.literal("anchor_ref.v1"),source_type:U.enum(["git","upload"]),repo_id:U.string().nullable(),git_sha:U.string().nullable(),project_id:U.string().nullable(),upload_batch_id:U.string().nullable(),file_path:U.string().min(1),doc_key:U.string().nullable(),anchor:iS}).strict().openapi("SearchTarget"),PS=U.object({kind:zS,score:U.number(),entity_id:U.string().min(1),review_id:U.string().min(1),target:nS,snippet:U.string(),finding:U.object({finding_id:U.string().min(1),status:EU,severity:FW.nullable(),assignee:U.string().nullable(),updated_at:U.string().datetime().nullable()}).strict().nullable().optional(),highlight_ranges:U.array(U.object({start:U.number().int().nonnegative(),end:U.number().int().positive()}).strict()),non_authoritative:U.literal(!0).optional(),provenance:U.object({model_id:U.string().min(1),model_version:U.string().min(1),similarity_score:U.number().min(0).max(1)}).strict().openapi({description:"Compatibility-only semantic-search provenance for non-authoritative results."}).optional()}).strict().openapi("SearchResult"),Vr=U.object({results:U.array(PS),total_count:U.number().int().nonnegative(),cursor:U.string().nullable(),has_more:U.boolean(),metadata:U.object({search_mode:jW,model_id:U.string().min(1).optional(),model_version:U.string().min(1).optional()}).strict().openapi({description:"Canonical metadata reports `fts`. Semantic metadata fields are compatibility-only."}).optional(),request_id:U.string()}).strict().openapi("SearchResponse");var AS=["properties","applicability"],KW=["ts_"],MS="^[a-z][a-z0-9_]{0,63}$",fS=U.object({key:U.string(),targets:U.array(U.enum(AS)).min(1),value_format:U.enum(["slug","string"]),description:U.string(),examples:U.array(U.string()).min(1)}).openapi("PropertyVocabularyEntry"),Kr=U.object({naming:U.object({case:U.literal("snake_case"),key_pattern:U.string(),max_key_length:U.number().int().positive()}).openapi("PropertyVocabularyNaming"),reserved:U.object({canonical_keys:U.array(U.string()),internal_prefixes:U.array(U.string())}).openapi("PropertyVocabularyReserved"),tenant_extensions:U.object({allowed:U.boolean(),forbidden_prefixes:U.array(U.string()),discoverable:U.boolean(),notes:U.string()}).openapi("PropertyVocabularyTenantExtensions"),canonical_keys:U.array(fS)}).openapi("PropertyVocabulary"),Or={naming:{case:"snake_case",key_pattern:MS,max_key_length:64},reserved:{canonical_keys:["client","content_type","source_kind","audience","market","surface"],internal_prefixes:[...KW]},tenant_extensions:{allowed:!0,forbidden_prefixes:[...KW],discoverable:!1,notes:"Tenant-defined keys are allowed but remain out-of-band until custom property-schema discovery lands."},canonical_keys:[{key:"client",targets:["properties","applicability"],value_format:"slug",description:"Brand, customer, product line, or account identifier used to scope rules and reviews.",examples:["acme","globex","internal_docs"]},{key:"content_type",targets:["properties","applicability"],value_format:"slug",description:"The kind of material under review, expressed as a stable slug rather than free-form prose.",examples:["landing_page","blog_post","ad_copy"]},{key:"source_kind",targets:["properties","applicability"],value_format:"slug",description:"The intake/source family for the reviewable artifact or the rule targeting it.",examples:["git","upload","paste"]},{key:"audience",targets:["properties","applicability"],value_format:"slug",description:"Intended reader or stakeholder audience segment for the reviewed content.",examples:["external","internal","partner"]},{key:"market",targets:["properties","applicability"],value_format:"slug",description:"Geographic, regulatory, or commercial market segment affected by the content or rule.",examples:["us","de","healthcare"]},{key:"surface",targets:["properties","applicability"],value_format:"slug",description:"Delivery surface or channel used for migration from legacy workstream language.",examples:["website","email","reddit"]}]};var d8=/^[A-Za-z0-9+/]*={0,2}$/,ZU="local";function _b($){if(typeof $!=="object"||$===null||Array.isArray($))return null;return $}function SS($,v,w){let g=_b($);if(!g)return v;let _=g.ok===!0&&"result"in g,b=_?_b(g.result):g,J=b!==null?{...b}:{result:_?g.result:$};J.ok=!0,J.request_id=v.request_id;let D=_&&Array.isArray(g.warnings)?g.warnings:v.warnings;if(D!==void 0)J.warnings=D;let X=(_?_b(g.pagination):null)??v.pagination;if(X!==void 0)J.pagination=X;let G=(_?_b(g.advisory):null)??v.advisory;if(G!==void 0)J.advisory=G;let Y=w?.retry??(_?_b(g.retry):null);if(Y!==null&&Y!==void 0)J.retry=Y;else if(v.retry!==void 0)J.retry=v.retry;return J}function k($,v,w){let g=MQ($,v,w),_=SS($,g,w);return{content:[{type:"text",text:JSON.stringify(_,null,2)}]}}function N($,v){let w=$.status===0||$.status>=500||$.status===429,g=fQ({requestId:$.requestId,error:{code:$.code,message:$.message,retryable:w,details:$.details,fix_hint:$.fixHint},retry:v?.operation?AQ({operation:v.operation,hasIdempotencyKey:v.hasIdempotencyKey,retryable:w,statusCode:$.status,errorCode:$.code}):{retry_classification:w?"transient":"manual"}});return{content:[{type:"text",text:JSON.stringify(g,null,2)}],isError:!0}}function B$($,v,w,g){return new L($,v,w,g?.requestId??ZU,g?.details,g?.fixHint)}function kW($,v){if($ instanceof L)return $;let w=v?.message??($ instanceof Error?$.message:String($));return B$(v?.status??500,v?.code??"internal_error",w,v)}function A$($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("Expected object payload from upstream API");let v=$,w=v.data;if(w&&typeof w==="object"&&!Array.isArray(w))return w;return v}var zW=1e7;function OW($){if(typeof $==="string"){let _=$.trim();return _.length>0?_:null}if(!$||typeof $!=="object"||Array.isArray($))return null;let v=$,w=v.base64??v.content_base64??v.content??v.data??v.bytes;if(typeof w!=="string")return null;let g=w.trim();return g.length>0?g:null}function NW($){if(typeof $==="string"){let g=$.trim();return g.length>0?g:null}if(!$||typeof $!=="object"||Array.isArray($))return null;let v=$,w=v.path??v.file_path??v.filename??v.file_name??v.name;if(typeof w==="string"&&w.trim().length>0)return w.trim();return null}function iW($){if($===void 0||$===null)return{assets:{}};let v={};if(Array.isArray($)){for(let[g,_]of $.entries()){let b=NW(_),J=OW(_);if(!b||!J)return{error:new L(422,"invalid_argument",`inline_assets[${g}] requires both a path and base64 payload`,"local")};v[b]=J}return{assets:v}}if(typeof $!=="object")return{error:new L(422,"invalid_argument","inline_assets must be an object map or array","local")};let w=Object.entries($);for(let[g,_]of w){let b=_&&typeof _==="object"&&!Array.isArray(_)?NW(_):g,J=OW(_);if(!b||!J)return{error:new L(422,"invalid_argument",`inline_assets entry '${g}' requires base64 content`,"local")};v[b]=J}return{assets:v}}function nW($){if(!$||$.length===0)return"Asset path is empty";if($.includes("\x00"))return"Asset path contains NUL byte";let v=$.replace(/\\/g,"/");if(v.startsWith("/"))return"Asset path must be relative (no leading /)";if(v.includes(".."))return"Asset path must not contain '..'";return null}function t8($){let v=$.replace(/\s+/g,"");if(v.length===0)return new Uint8Array;if(v.length%4!==0||!d8.test(v))return null;let w=Buffer.from(v,"base64"),g=v.replace(/=+$/,""),_=w.toString("base64").replace(/=+$/,"");if(g!==_)return null;return Uint8Array.from(w)}function a($){return N(new L(400,"missing_param",`Missing required parameter: ${$}`,"local"))}function Q$($,v){if(!$)return a(v);return null}var L$=K8({operation:"read"});function u$($){return K8({operation:"write",hasIdempotencyKey:$})}function y($,v){return async(w)=>{try{return await $(w)}catch(g){if(g instanceof L)return N(g,v);throw g}}}var TS=await Promise.resolve().then(() => gG(rU(),1)),PW=TS.version,uS={Server:H8,StdioServerTransport:I8,CallToolRequestSchema:G8,ListToolsRequestSchema:X8};function hU($){return{content:$.content.map((v)=>({type:v.type,text:v.text})),...$.isError===void 0?{}:{isError:$.isError}}}async function AW($,v=uS){let w=new v.Server({name:"typescape",version:PW},{capabilities:{tools:{}}});w.setRequestHandler(v.ListToolsRequestSchema,async()=>{return{tools:$.getTools().map((b)=>({name:b.name,description:b.description,inputSchema:b.inputSchema}))}}),w.setRequestHandler(v.CallToolRequestSchema,async(_)=>{let{name:b,arguments:J}=_.params,D=$.getHandler(b);if(!D)return hU(N(B$(404,"not_found",`Unknown tool: ${b}`,{details:{tool:b},fixHint:"Use tools/list to inspect the registered Typescape tools."})));try{if(J===void 0)return hU(N(B$(400,"invalid_request",`Missing arguments payload for tool: ${b}`,{details:{tool:b},fixHint:"Provide an arguments object for the tool call, even if it is empty."})));let X=await D(J);return hU(X)}catch(X){return hU(N(kW(X)))}});let g=new v.StdioServerTransport;await w.connect(g),process.stderr.write(`Typescape MCP server v${PW} started
181
+ `)}var RS=300000;function MW($){let v=null;return{async getCapabilities(){let w=Date.now();if(v&&w-v.fetchedAt<RS)return v.features;try{let g=await $.get("/me/capabilities");if(!g.body.features||typeof g.body.features!=="object")throw Error("Capabilities response missing features object");return v={features:g.body.features,fetchedAt:w},v.features}catch(g){if(g instanceof L)throw g;throw g}},featureDisabledResult(w){return N(B$(403,"feature_disabled",`Feature '${w}' is not enabled on this server`,{details:{feature:w}}))}}}var CS=EU.options.filter(($)=>$!=="draft"),fW={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier (short slug, e.g. 'typescape'; not a GitHub path like 'org/repo')"},git_sha:{type:"string",description:"Concrete 40-hex Git commit SHA (agent must resolve; no symbolic refs)"},file_path:{type:"string",description:"Path to the source document (required)"},filename:{type:"string",description:'PDF filename when document_type is "pdf" (optional; defaults to the file_path basename)'},project_id:{type:"string",description:"Upload project ID for upload-backed reviews (requires upload_batch_id)"},upload_batch_id:{type:"string",description:"Upload batch ID for upload-backed reviews (requires project_id)"},title:{type:"string",description:"Review title (optional)"},participants:{type:"array",items:{type:"object",properties:{email:{type:"string"},name:{type:"string"},role:{type:"string",enum:["reviewer","approver","observer","owner"]},scopes:{type:"array",minItems:1,items:{type:"string",enum:["read","comment","approve","admin"]}}},required:["email","role"]},description:"Participants to invite (optional). Scopes are optional and default by role."},reviewer_emails:{type:"array",items:{type:"string"},description:"Legacy alias for participants. Each email is invited as a reviewer."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (If-Match header, optional)"},identity_restriction:{type:"string",enum:["open","participants_only","domain"],description:'Identity verification mode for OTP step-up. "open" (default) accepts any email. "participants_only": only invited participant emails. "domain": only emails from allowed_email_domains.'},allowed_email_domains:{type:"array",items:{type:"string"},description:'Allowed email domains when identity_restriction is "domain" (e.g., ["acme.com", "example.org"])'},operator_name:{type:"string",maxLength:200,description:"Name of the operator initiating the review (optional)"},focus_areas:{type:"array",items:{type:"string",maxLength:100},maxItems:10,description:"Areas the reviewer should focus on (optional)"},framing:{type:"string",maxLength:1000,description:"Context framing text shown to reviewers (optional)"},carry_forward_findings:{type:"boolean",description:"Whether to carry forward findings from the superseded review (optional)"},carry_forward_filter:{type:"string",enum:["all","blocking","needs_changes"],description:"Filter for which findings to carry forward (optional)"},content_body:{type:"string",maxLength:1048576,description:"Inline Markdown content (alternative to repo_id+git_sha). Creates an upload-backed review automatically."},inline_assets:{oneOf:[{type:"object",additionalProperties:{oneOf:[{type:"string"},{type:"object",properties:{base64:{type:"string"},content_base64:{type:"string"},content:{type:"string"},data:{type:"string"}},additionalProperties:!0}]}},{type:"array",items:{type:"object",properties:{path:{type:"string"},file_path:{type:"string"},filename:{type:"string"},file_name:{type:"string"},name:{type:"string"},base64:{type:"string"},content_base64:{type:"string"},content:{type:"string"},data:{type:"string"}},additionalProperties:!0}}],description:'Companion assets as either a map of relative path => base64 content, or a list of asset objects. Map example: { "images/fig.png": "iVBORw0KGgo..." }. Array example: [{ "path": "images/fig.png", "base64": "iVBORw0KGgo..." }]. Total decoded size must be <= 10MB.'},document_type:{type:"string",enum:["markdown","image_set","pdf"],description:'Document type (default: "markdown"). Use "image_set" for image-only reviews or "pdf" for PDF reviews.'},asset_resolution_mode:{type:"string",enum:["strict","warn"],description:'Asset resolution mode (default: "strict"). Use "warn" to create upload-backed reviews even if some referenced assets are missing.'},filenames:{type:"array",items:{type:"string"},minItems:1,maxItems:100,description:'Ordered list of image filenames (required when document_type is "image_set"). Each filename must be a relative path. Supported formats: PNG, JPEG, WebP, GIF, SVG.'},purpose:{type:"string",enum:["review","rules"],description:'Review purpose (default: "review"). Use "rules" to create a rule review that feeds the rules governance pipeline.'},properties:{type:"object",additionalProperties:{type:"string"},description:"Content properties for rule matching (flat key-value map). Used when purpose=rules or for rule-aware content reviews."}},required:["file_path"]};var SW={type:"object",properties:{review_id:{type:"string",description:"Review ID to export (e.g., rev_01HXYZ...)"},schema:{type:"string",default:"v2",description:"Export schema version (default: v2). Explicit retired or unknown schema values fail with machine-readable API errors."},view:{type:"string",description:"Export view variant (optional). Values: redacted, response_matrix.v1, delta_review.v1"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (If-Match header, optional)"},include_rule_context:{type:"boolean",description:"Include rule context metadata in the export (rule_context block with compiled_hash, policy_snapshot_id, and source rule refs). Default: false."}},required:["review_id"]},TW={type:"object",properties:{review_id:{type:"string",description:"Review ID to fetch the handoff bundle for"},include_rules:{type:"boolean",description:"Whether to include rule context (default: true)"},include_lineage:{type:"boolean",description:"Whether to include lineage summaries (default: true)"},include_advisory:{type:"boolean",description:"Whether to include advisory artifacts (default: true)"},include_blocks:{type:"boolean",description:"Whether to include block slices (default: true)"},max_rules:{type:"number",description:"Maximum number of structured rules to inline"}},required:["review_id"]},uW={type:"object",properties:{repo_id:{type:"string",description:"Filter reviews by repository identifier (short slug, e.g. 'typescape'; optional)"},state:{type:"string",description:"Filter by review state: active, closed, archived (optional)"},file_paths:{type:"string",description:"Comma-separated list of file paths to filter by (optional)"},cursor:{type:"string",description:"Pagination cursor from previous response (optional)"},limit:{type:"number",description:"Maximum number of reviews to return (optional, default: 20)"},root_review_id:{type:"string",description:"Filter by supersede chain root review ID (optional, e.g., rev_...)"},supersedes_review_id:{type:"string",description:"Filter by immediate predecessor review ID (optional, e.g., rev_...)"},has_successor:{type:"boolean",description:"If true, return only reviews that have been superseded; if false, only chain heads (optional)"},q:{type:"string",description:"Search query for title/file path (alias: search, optional)."},search:{type:"string",description:"Alias for q. Search query text (optional)."}},required:[]},RW={type:"object",properties:{review_id:{type:"string",description:"Review ID to retrieve (e.g., rev_01HXYZ...)"}},required:["review_id"]},CW={type:"object",properties:{review_id:{type:"string",description:"Review ID to render (e.g., rev_01HXYZ...)"},include_plaintext:{type:"boolean",description:"Include plaintext representation alongside HTML (optional, default: false)"}},required:["review_id"]},EW={type:"object",properties:{review_id:{type:"string",description:"Review ID to list findings for (e.g., rev_01HXYZ...)"},block_id:{type:"string",description:"Filter findings by block_id anchor (optional)"},status:{type:"string",description:"Filter findings by status: open, resolved, all (optional, default: all)"},cursor:{type:"string",description:"Pagination cursor from previous response (optional)"},limit:{type:"number",description:"Maximum number of findings to return (optional, default: 50)"},q:{type:"string",description:"Search query across finding id, block id, and comment text (optional; alias: search)."},search:{type:"string",description:"Alias for q. Search query text (optional)."}},required:["review_id"]},p8={type:"object",properties:{review_id:{type:"string",description:"Review ID (e.g., rev_01HXYZ...)"}},required:["review_id"]},ZW={type:"object",properties:{query:{type:"string",description:"Search query text for reviews (title/file path)."},limit:{type:"number",description:"Maximum reviews to return (optional, default: 20)."},cursor:{type:"string",description:"Pagination cursor from previous response (optional)."}},required:["query"]},hW={type:"object",properties:{review_id:{type:"string",description:"Review ID to search within."},query:{type:"string",description:"Search query text for findings/comments."},block_id:{type:"string",description:"Optional block filter."},status:{type:"string",enum:CS,description:"Optional status filter: open | resolved."},limit:{type:"number",description:"Maximum findings to return (optional, default: 50)."},cursor:{type:"string",description:"Pagination cursor from previous response (optional)."}},required:["review_id","query"]};var xW=["typescape_create_review","typescape_export_review","typescape_get_handoff","typescape_list_reviews","typescape_get_review","typescape_get_render","typescape_list_findings","typescape_search_reviews","typescape_search_findings","typescape_close_review","typescape_reopen_review"],ES="markdown",ZS="open",hS="strict";function xS($){if($==="approver")return["read","comment","approve"];if($==="observer")return["read"];if($==="owner")return["read","comment","approve","admin"];return["read","comment"]}function lS($){return $.map((v)=>{let w=v.scopes&&v.scopes.length>0?[...new Set(v.scopes)]:xS(v.role);return{email:v.email,...v.name?{name:v.name}:{},role:v.role,scopes:w}})}function cS($,v){let w=[];if(Array.isArray($))w.push(...$);if(Array.isArray(v))for(let b of v){if(typeof b!=="string")continue;let J=b.trim();if(J.length===0)continue;w.push({email:J,role:"reviewer"})}let g=new Set,_=[];for(let b of w){if(!b||typeof b.email!=="string")continue;let J=b.email.trim();if(J.length===0)continue;let D=J.toLowerCase();if(g.has(D))continue;g.add(D),_.push({...b,email:J})}return _}function yS($){if(!Array.isArray($))return[];let v=new Set,w=[];for(let g of $){if(typeof g!=="string")continue;let _=g.trim().toLowerCase();if(_.length===0)continue;if(v.has(_))continue;v.add(_),w.push(_)}return w}function mS($){if(!$||typeof $!=="object"||Array.isArray($))return null;let v=$.id;return typeof v==="string"&&v.length>0?v:null}function rS($){if(!$||typeof $!=="object"||Array.isArray($))return null;let v=$;if(typeof v.id==="string"&&v.id.length>0)return v.id;let w=v.project;if(w&&typeof w==="object"&&!Array.isArray(w)&&typeof w.id==="string")return w.id;return null}function oS($){if(!$||typeof $!=="object"||Array.isArray($))return null;let v=$;if(typeof v.upload_batch_id==="string"&&v.upload_batch_id.length>0)return v.upload_batch_id;let w=v.upload;if(w&&typeof w==="object"&&!Array.isArray(w)&&typeof w.upload_batch_id==="string")return w.upload_batch_id;return null}function dS($){let v=iW($.inline_assets);if("error"in v)return v.error;let w=v.assets;if(!$.file_path)return new L(400,"missing_param","Missing required parameter: file_path","local");let g=typeof $.repo_id==="string"&&$.repo_id.length>0,_=typeof $.git_sha==="string"&&$.git_sha.length>0,b=typeof $.project_id==="string"&&$.project_id.length>0,J=typeof $.upload_batch_id==="string"&&$.upload_batch_id.length>0,D=g&&_,X=b&&J,G=!!$.content_body,Y=Object.keys(w).length>0;if(g&&!_||!g&&_)return new L(422,"invalid_argument","Both repo_id and git_sha are required for git-backed reviews","local");if(b&&!J||!b&&J)return new L(422,"invalid_argument","Both project_id and upload_batch_id are required for upload-backed reviews","local");if($.document_type!==void 0&&$.document_type!=="markdown"&&$.document_type!=="image_set"&&$.document_type!=="pdf")return new L(422,"invalid_argument",`Unsupported document_type: ${$.document_type}. Supported values: "markdown", "image_set", "pdf".`,"local");if($.asset_resolution_mode!==void 0&&$.asset_resolution_mode!=="strict"&&$.asset_resolution_mode!=="warn")return new L(422,"invalid_argument",`Unsupported asset_resolution_mode: ${$.asset_resolution_mode}. Supported values: "strict", "warn".`,"local");let Q=$.document_type??ES,W=$.identity_restriction??ZS,I=$.asset_resolution_mode??hS,H=Q==="image_set",q=Q==="pdf";if(H){if(!Y&&!X)return new L(400,"image_set_empty","image_set reviews require inline_assets or upload-batch input (project_id + upload_batch_id)","local");if(X&&(!$.filenames||$.filenames.length===0))return new L(400,"missing_param",'document_type "image_set" with upload-batch mode requires filenames.',"local");let S=new Set([".png",".jpg",".jpeg",".webp",".gif",".svg"]);if(Y){for(let c of Object.keys(w)){let x=c.slice(c.lastIndexOf(".")).toLowerCase();if(!S.has(x))return new L(422,"unsupported_media_type",`Unsupported image format for image_set: ${c}. Supported extensions: ${[...S].join(", ")}`,"local")}if(Object.keys(w).length>100)return new L(422,"image_set_limit_exceeded",`Image set has ${Object.keys(w).length} images, exceeding the maximum of 100`,"local")}}if(q){if(D)return new L(422,"invalid_argument",'document_type "pdf" is only supported with upload-backed sources (inline_assets or project_id+upload_batch_id).',"local");if(G)return new L(422,"invalid_argument",'document_type "pdf" does not support content_body; provide inline_assets with one .pdf file.',"local");if(!Y&&!X)return new L(400,"missing_param",'document_type "pdf" requires either inline_assets with one .pdf file, or upload-batch input (project_id + upload_batch_id).',"local");if(Y&&X)return new L(422,"invalid_argument",'document_type "pdf" cannot mix inline_assets and upload-batch inputs.',"local");if(Y&&Object.keys(w).length!==1)return new L(422,"invalid_argument",'document_type "pdf" requires exactly one inline asset.',"local");if(Y){let[S]=Object.keys(w);if(!S)return new L(400,"missing_param",'document_type "pdf" requires inline_assets with exactly one .pdf file.',"local");if(S.slice(S.lastIndexOf(".")).toLowerCase()!==".pdf")return new L(422,"unsupported_media_type",`Unsupported PDF format: ${S}. Supported extension: .pdf`,"local");if($.file_path!==S)return new L(422,"invalid_argument",`For document_type "pdf", file_path must match inline_assets key: ${S}`,"local")}}let j=[D,G,X].filter(Boolean).length;if(!H&&!q&&j===0)return new L(400,"missing_param","Provide one source mode: (repo_id + git_sha), (content_body), or (project_id + upload_batch_id)","local");if(j>1)return new L(422,"ambiguous_review_input","Cannot mix source modes: choose exactly one of git-backed, inline content_body, or upload-backed.","local");if(!H&&$.filenames&&$.filenames.length>0)return new L(422,"invalid_argument","filenames is only valid when document_type is image_set.","local");if(!q&&$.filename&&$.filename.trim().length>0)return new L(422,"invalid_argument",'filename is only valid when document_type is "pdf".',"local");if(W==="domain"&&(!$.allowed_email_domains||$.allowed_email_domains.length===0))return new L(422,"invalid_argument",'allowed_email_domains is required when identity_restriction is "domain"',"local");if(Object.keys(w).length>0){if(!G&&!H&&!q)return new L(422,"invalid_argument","inline_assets requires content_body (inline mode)","local");let S=0;for(let[c,x]of Object.entries(w)){let X$=nW(c);if(X$)return new L(422,"invalid_argument",`${X$}: ${c}`,"local");let s$=t8(x);if(s$===null)return new L(422,"invalid_argument",`Invalid base64 content for asset: ${c}`,"local");S+=s$.byteLength}if(S>zW)return new L(413,"inline_payload_too_large",`Total decoded inline assets (${S} bytes) exceed 10MB limit. Use the Typescape CLI with upload batch for larger payloads.`,"local")}let F={file_path:$.file_path,document_type:Q,identity_restriction:W,asset_resolution_mode:I};if(D)F.repo_id=$.repo_id,F.git_sha=$.git_sha;if(X)F.project_id=$.project_id,F.upload_batch_id=$.upload_batch_id;if(G)F.content_body=$.content_body;if(Object.keys(w).length>0)F.inline_assets=w;let M=cS($.participants,$.reviewer_emails);if(M.length>0)F.participants=lS(M);if($.title!==void 0)F.title=$.title;if($.allowed_email_domains!==void 0&&$.allowed_email_domains.length>0)F.allowed_email_domains=$.allowed_email_domains;if($.operator_name!==void 0)F.operator_name=$.operator_name;if($.focus_areas!==void 0&&$.focus_areas.length>0)F.focus_areas=$.focus_areas;if($.framing!==void 0)F.framing=$.framing;if($.carry_forward_findings!==void 0)F.carry_forward_findings=$.carry_forward_findings;if($.carry_forward_filter!==void 0)F.carry_forward_filter=$.carry_forward_filter;if(q)F.filename=$.filename?.trim()||$.file_path.split("/").filter(Boolean).at(-1)||$.file_path;if(H)F.filenames=$.filenames&&$.filenames.length>0?$.filenames:Object.keys(w).sort();if($.purpose!==void 0)F.purpose=$.purpose;if($.properties!==void 0)F.properties=$.properties;let T={};if($.idempotency_key)T["Idempotency-Key"]=$.idempotency_key;if($.expected_version)T["If-Match"]=$.expected_version;let C=yS($.reviewer_emails),Z=q&&Y?(()=>{let S=Object.entries(w)[0];if(!S)return null;let[c,x]=S;return c&&x?{assetPath:c,base64Content:x}:null})():null;return{body:F,headers:T,reviewerEmails:C,pdfInlineFallback:Z}}async function tS($,v,w){let g=Array.isArray(w.invitations)?w.invitations:[];if(v.length===0||g.length>0)return g;let _=mS(w.review);if(!_)throw new L(500,"invalid_upstream_response","Review create response missing review.id; cannot invite reviewer_emails","local");let b=await $.post(`/reviews/${encodeURIComponent(_)}/participants`,{body:{participants:v.map((D)=>({email:D,role:"reviewer"}))}}),J=Array.isArray(b.body.invitations)?b.body.invitations:[];if(J.length>0)return J;throw new L(502,"invalid_upstream_response","Reviewer invitation follow-up returned no invitations",b.requestId)}async function lW($,v,w){return $.post("/reviews",{body:v,headers:w})}async function pS($,v){if(!v.pdfInlineFallback)throw new L(500,"invalid_local_state","PDF fallback requires exactly one inline asset","local");let w=t8(v.pdfInlineFallback.base64Content);if(w===null)throw new L(422,"invalid_argument",`Invalid base64 content for asset: ${v.pdfInlineFallback.assetPath}`,"local");let g=await $.post("/projects",{body:{name:`MCP Upload ${v.pdfInlineFallback.assetPath}`}}),_=rS(g.body);if(!_)throw new L(502,"invalid_upstream_response","Project create response missing project id",g.requestId);let b=new FormData;b.append(v.pdfInlineFallback.assetPath,new Blob([w],{type:"application/pdf"}),v.pdfInlineFallback.assetPath);let J=await $.postFormData(`/projects/${encodeURIComponent(_)}/upload`,b),D=oS(J.body);if(!D)throw new L(502,"invalid_upstream_response","Upload response missing upload_batch_id",J.requestId);let X={...v.body,project_id:_,upload_batch_id:D};return delete X.inline_assets,lW($,X,v.headers)}async function eS($,v){let w=(_)=>{let b=_.review??_.session??(typeof _.review_id==="string"&&_.review_id.length>0?{id:_.review_id}:null);if(!b)throw new L(502,"invalid_upstream_response","Review create response missing review/session payload","local");return{review:b,payload:{..._,review:b}}},g=async(_)=>{let b=w(_.body),J=await tS($,v.reviewerEmails,{review:b.review,invitations:_.body.invitations});return k({...b.payload,review:b.review,invitations:J},_.requestId)};try{let _=await lW($,v.body,v.headers);return await g(_)}catch(_){if(_ instanceof L&&v.pdfInlineFallback&&_.code==="feature_disabled"&&_.details?.feature==="inline_assets_enabled")try{let b=await pS($,v);return await g(b)}catch(b){if(b instanceof L)return N(b);throw b}if(_ instanceof L)return N(_);throw _}}function cW($,v){let w=new Map;function g(I){let H=I.indexOf("#");if(H===-1)throw new L(500,"invalid_review_url","Review link URL is missing fragment token","local");return I.slice(H+1)}async function _(I){let H=w.get(I);if(H&&H.expiresAtMs>Date.now())return H.token;let q=await v.get(`/reviews/${I}/participants`,{query:{role:"reviewer"}}),j=q.body.items?.[0]?.participant_id;if(!j)j=(await v.get(`/reviews/${I}/participants`,{query:{limit:"1"}})).body.items?.[0]?.participant_id;if(!j)throw new L(422,"no_participants","No participants available to mint a render token",q.requestId);let F=await v.post(`/reviews/${I}/links`,{body:{participant_id:j,scope:"read",single_use:!0,url_token_ttl_minutes:60}}),M=F.body.url;if(!M||typeof M!=="string")throw new L(500,"invalid_link_response","Failed to mint review link for render",F.requestId);let T=await v.post("/auth/exchange",{body:{url_token:g(M)}}),C=T.body.session_access_token,Z=T.body.expires_in_seconds;if(!C||typeof C!=="string")throw new L(500,"token_exchange_failed","Failed to exchange review link for review access token",T.requestId);let S=typeof Z==="number"&&Number.isFinite(Z)?Math.max(0,Math.trunc(Z)-30)*1000:300000;return w.set(I,{token:C,expiresAtMs:Date.now()+S}),C}let b={name:"typescape_create_review",description:"Create a new Typescape review for Markdown, image-set, or PDF content. Supports three source modes: (1) git-backed with repo_id+git_sha, (2) inline with content_body and optional inline_assets (base64), or (3) upload-backed with project_id+upload_batch_id. Returns the review ID and any invitations sent.",inputSchema:fW};$.register(b,async(I)=>{let H=dS(I);if(H instanceof L)return N(H);return eS(v,H)});let J={name:"typescape_export_review",description:"Export all feedback from a Typescape review as structured JSON (schema v2). Returns review metadata, blocks, findings, synthesis (severity summary), round_history, participants, and statistics. Optional params: schema (default 'v2'), view (e.g. 'response_matrix.v1', 'delta_review.v1'), include_rule_context (boolean).",inputSchema:SW};$.register(J,async(I)=>{let H=I;if(!H.review_id)return N(new L(400,"missing_param","Missing required parameter: review_id","local"));let j={schema:typeof H.schema==="string"&&H.schema.trim().length>0?H.schema.trim():"v2"};if(H.view)j.view=H.view;if(H.include_rule_context)j.include_rule_context="true";let F={};if(H.expected_version)F["If-Match"]=H.expected_version;try{let M=await v.get(`/reviews/${H.review_id}/export`,{query:j,headers:F});return k(M.body,M.requestId)}catch(M){if(M instanceof L)return N(M);throw M}});let D={name:"typescape_get_handoff",description:"Fetch the canonical agent handoff bundle for a Typescape review. Returns review state, findings, lineage, rules, artifacts, and next actions in one read-only package.",inputSchema:TW};$.register(D,async(I)=>{let H=I;if(!H.review_id)return N(new L(400,"missing_param","Missing required parameter: review_id","local"));let q={};if(typeof H.include_rules==="boolean")q.include_rules=H.include_rules?"true":"false";if(typeof H.include_lineage==="boolean")q.include_lineage=H.include_lineage?"true":"false";if(typeof H.include_advisory==="boolean")q.include_advisory=H.include_advisory?"true":"false";if(typeof H.include_blocks==="boolean")q.include_blocks=H.include_blocks?"true":"false";if(typeof H.max_rules==="number")q.max_rules=String(H.max_rules);try{let j=await v.get(`/reviews/${encodeURIComponent(H.review_id)}/handoff`,{query:q});return k(j.body,j.requestId)}catch(j){if(j instanceof L)return N(j);throw j}});let X={name:"typescape_list_reviews",description:"List Typescape reviews with optional filters. Returns paginated review summaries. Use cursor from previous response for pagination.",inputSchema:uW};$.register(X,async(I)=>{let H=I,q={};if(H.repo_id)q.repo_id=H.repo_id;if(H.state)q.state=H.state;if(H.file_paths)q.file_paths=H.file_paths;if(H.cursor)q.cursor=H.cursor;if(H.limit!==void 0)q.limit=String(H.limit);if(H.root_review_id)q.root_review_id=H.root_review_id;if(H.supersedes_review_id)q.supersedes_review_id=H.supersedes_review_id;if(H.has_successor!==void 0)q.has_successor=H.has_successor?"true":"false";let j=H.q??H.search;if(j)q.q=j;try{let F=await v.get("/reviews",{query:q});return k(F.body,F.requestId)}catch(F){if(F instanceof L)return N(F);throw F}});let G={name:"typescape_get_review",description:"Get details of a specific Typescape review. Returns full review metadata including participants, stats, and provenance.",inputSchema:RW};$.register(G,async(I)=>{let H=I;if(!H.review_id)return N(new L(400,"missing_param","Missing required parameter: review_id","local"));try{let q=await v.get(`/reviews/${encodeURIComponent(H.review_id)}`);return k(q.body,q.requestId)}catch(q){if(q instanceof L)return N(q);throw q}});let Y={name:"typescape_get_render",description:"Get the rendered content of a review. Returns immutable block-level HTML structure with block_ids for anchoring.",inputSchema:CW};$.register(Y,async(I)=>{let H=I;if(!H.review_id)return N(new L(400,"missing_param","Missing required parameter: review_id","local"));let q={};if(H.include_plaintext)q.include_plaintext="true";try{let j=await _(H.review_id),F=await v.get(`/reviews/${H.review_id}/render`,{query:q,headers:{Authorization:`Bearer ${j}`}});return k(F.body,F.requestId)}catch(j){if(j instanceof L)return N(j);throw j}});let Q={name:"typescape_list_findings",description:"List findings (review comments) for a review in the same plain-language form the reviewer or agent wrote them. Optionally filter by block_id anchor or finding status. Returns paginated finding list with comments.",inputSchema:EW},W=async(I)=>{if(!I.review_id)return N(new L(400,"missing_param","Missing required parameter: review_id","local"));let H={};if(I.block_id)H.block_id=I.block_id;if(I.status)H.status=I.status;if(I.cursor)H.cursor=I.cursor;if(I.limit!==void 0)H.limit=String(I.limit);let q=I.q??I.search;if(q)H.q=q;try{let j=await v.get(`/reviews/${encodeURIComponent(I.review_id)}/findings`,{query:H});return k(j.body,j.requestId)}catch(j){if(j instanceof L)return N(j);throw j}};$.register(Q,async(I)=>{return W(I)}),$.register({name:"typescape_search_reviews",description:"Search reviews by title/file path using server-side query matching.",inputSchema:ZW},async(I)=>{let H=I,q=typeof H.query==="string"?H.query.trim():"";if(!q)return N(new L(400,"missing_param","Missing required parameter: query","local"));let j={q};if(H.limit!==void 0)j.limit=String(H.limit);if(H.cursor)j.cursor=H.cursor;try{let F=await v.get("/reviews",{query:j});return k(F.body,F.requestId)}catch(F){if(F instanceof L)return N(F);throw F}}),$.register({name:"typescape_search_findings",description:"Search findings/comments within a review using server-side query matching.",inputSchema:hW},async(I)=>{let H=I,q=typeof H.query==="string"?H.query.trim():"";if(!H.review_id)return N(new L(400,"missing_param","Missing required parameter: review_id","local"));if(!q)return N(new L(400,"missing_param","Missing required parameter: query","local"));return W({review_id:H.review_id,q,block_id:H.block_id,status:H.status,limit:H.limit,cursor:H.cursor})}),$.register({name:"typescape_close_review",description:"Close an active review, making it read-only for reviewers.",inputSchema:p8},async(I)=>{let H=I;if(!H.review_id)return N(new L(400,"missing_param","Missing required parameter: review_id","local"));try{let q=await v.post(`/reviews/${encodeURIComponent(H.review_id)}/close`,{body:{}});return k(q.body,q.requestId)}catch(q){if(q instanceof L)return N(q);throw q}}),$.register({name:"typescape_reopen_review",description:"Reopen a closed review and return it to active state.",inputSchema:p8},async(I)=>{let H=I;if(!H.review_id)return N(new L(400,"missing_param","Missing required parameter: review_id","local"));try{let q=await v.post(`/reviews/${encodeURIComponent(H.review_id)}/reopen`,{body:{}});return k(q.body,q.requestId)}catch(q){if(q instanceof L)return N(q);throw q}})}var yW={type:"object",properties:{review_id:{type:"string",description:"Review ID to export response matrix for (e.g., sess_01HXYZ...)"}},required:["review_id"]},mW={type:"object",properties:{review_id:{type:"string",description:"Review ID to attach the finding to (e.g., sess_01HXYZ...)"},body_md:{type:"string",description:"Plain-language finding body in Markdown. Say what is wrong, unclear, or missing."},body:{type:"string",description:"Compatibility alias for body_md."},block_id:{type:"string",description:"Block ID to anchor the finding to when feedback targets a specific passage (optional; omit for review-level)."},anchor:{type:"object",properties:{type:{type:"string",enum:["session","block","range"],description:"Anchor type (default: session if no block_id, block if block_id provided)"},block_id:{type:"string",description:"Block ID to anchor to (required when type is 'block')"},start_offset:{type:"number",description:"Start offset for range anchor"},end_offset:{type:"number",description:"End offset for range anchor"}},description:"Optional anchor details. Omit for review-level feedback or provide block/range details when you have them."},severity:{type:"string",enum:["suggestion","needs_changes","blocking"],description:"Optional severity hint. Omit unless the finding clearly blocks approval or needs explicit escalation. Note: 'blocking' from automation is coerced to 'needs_changes' per Ch 11 L6250."},tags:{type:"array",items:{type:"string"},description:"Optional machine tags for downstream automation. Most agent loops should omit this."},suggestion:{type:"object",properties:{type:{type:"string",enum:["replace","insert","delete"]}},description:"Optional structured edit payload when you want to carry an explicit replacement."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id","body_md"]},rW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to post comment to"},body_md:{type:"string",description:"Plain-language comment body in Markdown."},body:{type:"string",description:"Compatibility alias for body_md"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id","finding_id","body_md"]},oW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to resolve"},decision:{type:"object",properties:{state:{type:"string",enum:["accepted","rejected","deferred","duplicate","needs_more_info"],description:"Decision state"},rationale_md:{type:"string",description:"Rationale in Markdown (optional)"}},required:["state"],description:"Decision to record with resolution (optional)"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (thread ETag or integer version, optional)"},if_match:{type:"string",description:"Alias for expected_version (thread ETag or integer version, optional)"}},required:["review_id","finding_id"]},dW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to reopen"},expected_version:{type:"string",description:"Expected version for optimistic concurrency (thread ETag or integer version, optional)"},if_match:{type:"string",description:"Alias for expected_version (thread ETag or integer version, optional)"}},required:["review_id","finding_id"]},tW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to record decision for"},state:{type:"string",enum:["undecided","accepted","rejected","deferred","duplicate","needs_more_info","dismissed","waived"],description:"Decision state"},rationale_md:{type:"string",description:"Rationale in Markdown (optional)"}},required:["review_id","finding_id","state"]},pW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding"},finding_id:{type:"string",description:"Finding ID to attach evidence to"},evidence_type:{type:"string",enum:["commit","proposed_change","pr","attestation","external_ticket","note"],description:"Evidence type (required). Determines which additional fields are relevant."},commit_sha:{type:"string",description:"Git commit SHA (for evidence_type=commit)"},repo_url:{type:"string",description:"Repository URL (for evidence_type=commit)"},message:{type:"string",description:"Commit message (for evidence_type=commit)"},proposed_change_id:{type:"string",description:"Proposed change ID (for evidence_type=proposed_change)"},patch_sha256:{type:"string",description:"Patch SHA256 (for evidence_type=proposed_change)"},pr_url:{type:"string",description:"PR URL (for evidence_type=pr)"},pr_number:{type:"number",description:"PR number (for evidence_type=pr)"},attestation_id:{type:"string",description:"Attestation ID (for evidence_type=attestation)"},attestor:{type:"string",description:"Attestor identity (optional, for attestation type)"},ticket_url:{type:"string",description:"Ticket URL (for evidence_type=external_ticket)"},ticket_id:{type:"string",description:"Ticket ID (for evidence_type=external_ticket)"},system:{type:"string",description:"Ticket system (for evidence_type=external_ticket)"},note_md:{type:"string",description:"Note text (for evidence_type=note)"},body_md:{type:"string",description:"Markdown evidence body (alias for note_md/text; useful for attestation/external_ticket notes)"},dedupe_key:{type:"string",description:"Optional idempotency/deduplication key for evidence attach"}},required:["review_id","finding_id","evidence_type"]},eW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding."},finding_id:{type:"string",description:"Finding ID to fetch latest decision for."}},required:["review_id","finding_id"]},aW={type:"object",properties:{review_id:{type:"string",description:"Review ID containing the finding."},finding_id:{type:"string",description:"Finding ID to list evidence for."},limit:{type:"number",description:"Maximum evidence entries to return (optional)."},cursor:{type:"string",description:"Pagination cursor from previous response (optional)."}},required:["review_id","finding_id"]};var sW=["typescape_export_response_matrix","typescape_create_finding","typescape_post_comment","typescape_resolve_finding","typescape_reopen_finding","typescape_record_decision","typescape_attach_evidence","typescape_get_decision","typescape_list_evidence"],aS="X-Typescape-If-Match";function $H($,v,w){if(!$)return;if(/^[1-9]\d*$/.test($)){v.expected_version=Number.parseInt($,10);return}w[aS]=$}async function sS($,v){let w=v,g=w.body_md??w.body,_=Q$(w.review_id,"review_id");if(_)return _;let b=Q$(g,"body_md");if(b)return b;let J={body_md:g,source:"automation"},D=typeof w.block_id==="string"?w.block_id.trim():void 0;if(D)J.block_id=D;if(w.anchor!==void 0)J.anchor=w.anchor;else if(D)J.anchor={type:"block"};if(w.severity!==void 0)J.severity=w.severity;if(w.tags!==void 0)J.tags=w.tags;if(w.suggestion!==void 0)J.suggestion=w.suggestion;let X={};if(w.idempotency_key)X["Idempotency-Key"]=w.idempotency_key;let G=await $.post(`/reviews/${encodeURIComponent(w.review_id)}/findings`,{body:J,headers:X});return k(G.body,G.requestId,{retry:u$(Boolean(w.idempotency_key))})}async function $T($,v){let w=v,g=w.body_md??w.body,_=Q$(w.review_id,"review_id");if(_)return _;let b=Q$(w.finding_id,"finding_id");if(b)return b;let J=Q$(g,"body_md");if(J)return J;let D={};if(w.idempotency_key)D["Idempotency-Key"]=w.idempotency_key;let X=await $.post(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}/comments`,{body:{body_md:g,source:"automation"},headers:D});return k(X.body,X.requestId,{retry:u$(Boolean(w.idempotency_key))})}async function vT($,v){let w=v,g=Q$(w.review_id,"review_id");if(g)return g;let _=Q$(w.finding_id,"finding_id");if(_)return _;let b=w.decision===void 0?{status:"resolved"}:{disposition:w.decision},J={};$H(w.expected_version??w.if_match,b,J);let D=w.decision===void 0?await $.patch(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}`,{body:b,headers:J}):await $.post(`/reviews/${w.review_id}/threads/${w.finding_id}/resolve`,{body:b,headers:J});return k(D.body,D.requestId,{retry:u$(!1)})}async function _T($,v){let w=v,g=Q$(w.review_id,"review_id");if(g)return g;let _=Q$(w.finding_id,"finding_id");if(_)return _;let b={},J={};$H(w.expected_version??w.if_match,b,J),b.status="open";let D=await $.patch(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}`,{body:b,headers:J});return k(D.body,D.requestId,{retry:u$(!1)})}async function wT($,v){let w=v,g=Q$(w.review_id,"review_id");if(g)return g;let _=Q$(w.finding_id,"finding_id");if(_)return _;let b=Q$(w.state,"state");if(b)return b;let J={state:w.state};if(w.rationale_md!==void 0)J.rationale_md=w.rationale_md;let D=await $.post(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}/decision`,{body:J});return k(D.body,D.requestId,{retry:u$(!1)})}function gT($){if($.evidence_type){let v={},w=["commit_sha","repo_url","message","proposed_change_id","patch_sha256","pr_url","pr_number","attestation_id","attestor","ticket_url","ticket_id","system","note_md","body_md"];for(let g of w)if($[g]!==void 0)v[g]=$[g];if($.body_md!==void 0)v.body=$.body_md,v.text=$.body_md;else if($.note_md!==void 0)v.body=$.note_md,v.text=$.note_md;return{evidenceType:$.evidence_type.trim(),evidenceJson:v}}if($.evidence){let v={...$.evidence},w=typeof $.evidence.type==="string"?$.evidence.type.trim():"";return delete v.type,{evidenceType:w,evidenceJson:v}}return a("evidence_type")}async function bT($,v){let w=v,g=Q$(w.review_id,"review_id");if(g)return g;let _=Q$(w.finding_id,"finding_id");if(_)return _;let b=gT(w);if("content"in b)return b;let{evidenceType:J,evidenceJson:D}=b;if(!J)return N(new L(422,"invalid_argument","evidence_type is required","local"));let X={evidence_type:J,evidence_json:D};if(w.dedupe_key)X.dedupe_key=w.dedupe_key;let G=await $.post(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}/evidence`,{body:X});return k(G.body,G.requestId,{retry:u$(!1)})}async function UT($,v){let w=v,g=Q$(w.review_id,"review_id");if(g)return g;let _=Q$(w.finding_id,"finding_id");if(_)return _;let b=await $.get(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}/decision`);return k(b.body,b.requestId,{retry:L$})}async function JT($,v){let w=v,g=Q$(w.review_id,"review_id");if(g)return g;let _=Q$(w.finding_id,"finding_id");if(_)return _;let b={};if(w.limit!==void 0)b.limit=String(w.limit);if(w.cursor)b.cursor=w.cursor;let J=await $.get(`/reviews/${encodeURIComponent(w.review_id)}/findings/${encodeURIComponent(w.finding_id)}/evidence`,{query:b});return k(J.body,J.requestId,{retry:L$})}function vH($,v){$.register({name:"typescape_export_response_matrix",description:"Export the response matrix for a review. Returns per-finding decision and evidence summary.",inputSchema:yW},y(async(w)=>{let g=w,_=Q$(g.review_id,"review_id");if(_)return _;let b=await v.get(`/reviews/${g.review_id}/export`,{query:{view:"response_matrix.v1"}});return k(b.body,b.requestId,{retry:L$})},{operation:"read"})),$.register({name:"typescape_create_finding",description:"Create a new finding on a review. Use after the agent has read the content and formed its own judgment. Required: review_id and body_md (Markdown text). "+"Optional: severity (suggestion, needs_changes, or blocking — default suggestion), "+"anchor ({type: 'block', block_id: '...'} for block-level, omit for review-level), tags (string array). Agent-created findings are tagged source='automation'. Severity 'blocking' is coerced to 'needs_changes' for automation sources.",inputSchema:mW},y((w)=>sS(v,w),{operation:"write"})),$.register({name:"typescape_post_comment",description:"Post a comment (reply) to an existing finding. Returns the created comment with its ID.",inputSchema:rW},y((w)=>$T(v,w),{operation:"write"})),$.register({name:"typescape_resolve_finding",description:"Resolve (close) a finding. Optionally include a decision. Use expected_version or if_match for optimistic concurrency.",inputSchema:oW},y((w)=>vT(v,w),{operation:"write"})),$.register({name:"typescape_reopen_finding",description:"Reopen a previously resolved finding. Use expected_version or if_match for optimistic concurrency.",inputSchema:dW},y((w)=>_T(v,w),{operation:"write"})),$.register({name:"typescape_record_decision",description:"Record a decision (decision) on a finding. Decisions track how feedback was addressed. Note: recording a resolving decision may automatically resolve the finding.",inputSchema:tW},y((w)=>wT(v,w),{operation:"write"})),$.register({name:"typescape_attach_evidence",description:"Attach evidence to a finding. Evidence proves that feedback was addressed (e.g., commit SHA, proposed change, PR URL, or attestation).",inputSchema:pW},y((w)=>bT(v,w),{operation:"write"})),$.register({name:"typescape_get_decision",description:"Get the latest decision for a specific finding.",inputSchema:eW},y((w)=>UT(v,w),{operation:"read"})),$.register({name:"typescape_list_evidence",description:"List evidence entries attached to a finding.",inputSchema:aW},y((w)=>JT(v,w),{operation:"read"}))}var xU=["file","doc","pr","custom"],_H=new Set(xU),wH={type:"object",properties:{source_type:{type:"string",enum:["git","upload"],description:"Source type for the review set"},title:{type:"string",description:"Review set title (optional)"},kind:{type:"string",enum:["review_set","release_bundle","packet"],description:"Kind of review set (optional, default: review_set)"},participants:{type:"array",items:{type:"object",properties:{email:{type:"string"},role:{type:"string",enum:["reviewer","approver"]},roles:{type:"array",items:{type:"string",enum:["reviewer","approver"]},minItems:1}},required:["email"]},description:"Participants to invite (optional). Supports role (single) or roles (array)."},reviews:{type:"array",items:{oneOf:[{type:"string"},{type:"object",properties:{review_id:{type:"string"},session_id:{type:"string"},required:{type:"boolean"}},anyOf:[{required:["review_id"]},{required:["session_id"]}],additionalProperties:!1}]},minItems:1,description:"Review IDs (or review entry objects) to include in this review set."},files:{type:"array",items:{type:"object",properties:{repo_id:{type:"string"},git_sha:{type:"string"},project_id:{type:"string"},upload_batch_id:{type:"string"},file_path:{type:"string"},required:{type:"boolean"}},required:["file_path"],additionalProperties:!1},minItems:1,description:"File entries for git or upload source types (must include file_path plus source identifiers)."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["source_type"]},gH={type:"object",properties:{review_set_id:{type:"string",description:"Review set ID to export"},schema:{type:"string",description:"Export schema version (optional, default: v2). Canonical first-party review-set export uses schema=v2."},view:{type:"string",description:"Export view variant (optional). Values: full, redacted, response_matrix.v1, etc."}},required:["review_set_id"]},bH={type:"object",properties:{limit:{type:"number",description:"Maximum number of review sets to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from a previous response"}}},UH={type:"object",properties:{review_set_id:{type:"string",description:"Review set ID to retrieve"}},required:["review_set_id"]},JH={type:"object",properties:{title:{type:"string",description:"Work item title"},kind:{type:"string",enum:AU,description:"Canonical work item kind"},reason_code:{type:"string",enum:fU,description:"Canonical reason code describing why the item exists"},audience_mode:{type:"string",enum:MU,description:"Queue routing mode for this work item"},blocking:{type:"boolean",description:"Whether the item is blocking"},priority:{type:"number",description:"Priority from 0-9"},target:{type:"object",properties:{target_type:{type:"string",description:"Canonical target type"},target_id:{type:"string",description:"Canonical target identifier"}},required:["target_type","target_id"],additionalProperties:!1},assignee_id:{type:"string",description:"Assignee user ID when audience_mode=assigned"},steward_group:{type:"string",description:"Optional steward group label"},due_at:{type:"string",description:"Optional ISO-8601 due timestamp"},metadata:{type:"object",description:"Optional metadata object",additionalProperties:!0},idempotency_key:{type:"string",description:"Optional idempotency key for safe retries"}},required:["title","kind","reason_code","audience_mode","target"],additionalProperties:!1},DH={type:"object",properties:{state:{type:"string",enum:S8,description:"Filter by work item state"},kind:{type:"string",enum:AU,description:"Filter by work item kind"},reason_code:{type:"string",enum:fU,description:"Filter by canonical reason code"},audience_mode:{type:"string",enum:MU,description:"Filter by audience mode"},queue_surface:{type:"string",enum:R8,description:"Filter by derived queue surface"},assignee_id:{type:"string",description:"Filter by assignee"},claimant_id:{type:"string",description:"Filter by claimant"},cursor:{type:"string",description:"Pagination cursor from a previous response"},limit:{type:"number",description:"Maximum number of work items to return (default: 25, max: 100)"}},additionalProperties:!1},XH={type:"object",properties:{work_item_id:{type:"string",description:"Work item ID to retrieve"}},required:["work_item_id"],additionalProperties:!1},GH={type:"object",properties:{work_item_id:{type:"string",description:"Work item ID to transition"},action:{type:"string",enum:C8,description:"Canonical transition action"},expected_version:{type:"number",description:"Optimistic concurrency version guard"},idempotency_key:{type:"string",description:"Optional idempotency key for safe retries"},blocking_reason:{type:"string",description:"Required when action=block"},cancellation_reason:{type:"string",description:"Required when action=cancel"},completion_outcome:{type:"string",enum:E8,description:"Required when action=complete"},comment:{type:"string",description:"Optional operator comment"}},required:["work_item_id","action"],additionalProperties:!1},YH={type:"object",properties:{source_type:{type:"string",enum:["git","upload"],description:"Source type for the review ref"},repo_id:{type:"string",description:"Repository identifier (required for git source_type; short slug, e.g. 'typescape')"},project_id:{type:"string",description:"Project identifier (required for upload source_type; omit for git)"},kind:{type:"string",enum:xU,description:"Review ref kind"},key:{type:"string",description:"Review ref key (e.g., file path, doc slug, PR number, custom name)"},head_session_id:{type:"string",description:"Session ID to use as the initial head (required, e.g., sess_01HXYZ...)"}},required:["source_type","kind","key","head_session_id"]},QH={type:"object",properties:{review_ref_id:{type:"string",description:"Review ref ID to resolve"}},required:["review_ref_id"]},WH={type:"object",properties:{review_ref_id:{type:"string",description:"Review ref ID to advance"},head_session_id:{type:"string",description:"New head review ID to advance to"},expected_head_session_id:{type:"string",description:"Expected current head for optimistic concurrency (optional)"}},required:["review_ref_id","head_session_id"]},HH={type:"object",properties:{review_id:{type:"string",description:"Review ID to request approval for"},approver_emails:{type:"array",items:{type:"string"},description:"Email addresses of approvers"},message:{type:"string",description:"Message to include with the approval request (optional)"},notify:{type:"object",properties:{email:{type:"boolean"},slack:{type:"boolean"}},description:"Notification channels (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["review_id","approver_emails"]},qH={type:"object",properties:{review_id:{type:"string",description:"Review ID to get status for"},simulate:{type:"boolean",description:"Run policy evaluation without side effects (optional)"},wait:{type:"number",description:"Long-poll timeout in seconds (optional)"}},required:["review_id"]},IH={type:"object",properties:{review_id:{type:"string",description:"Review ID to run deterministic product-owned checks against"}},required:["review_id"]},BH={type:"object",properties:{},additionalProperties:!1},LH={type:"object",properties:{},additionalProperties:!1},VH={type:"object",properties:{},additionalProperties:!1};var jH=["typescape_create_review_set","typescape_export_review_set","typescape_list_review_sets","typescape_get_review_set","typescape_create_work_item","typescape_list_work_items","typescape_get_work_item","typescape_transition_work_item","typescape_create_review_ref","typescape_resolve_review_ref","typescape_advance_review_ref","typescape_request_approval","typescape_get_status","typescape_run_checks","typescape_account_usage","typescape_account_plan","typescape_get_capabilities"];function DT($){return $.replace(/\bSession\b/g,"Review").replace(/\bsession\b/g,"review").replace(/\bThread\b/g,"Finding").replace(/\bthread\b/g,"finding")}function e8($){if(Array.isArray($))return $.map((g)=>e8(g));if($===null||typeof $!=="object")return $;let v=new Map([["session_id","review_id"],["thread_id","finding_id"],["thread_ids","finding_ids"]]),w=Object.entries($).map(([g,_])=>{let b=v.get(g)??g,J=typeof _==="string"&&(g==="description"||g==="message")?DT(_):e8(_);return[b,J]});return Object.fromEntries(w)}function wb($,v){let w=$[0];if(!w)return v;return`${w.path.length>0?`${w.path.map((_)=>String(_)).join(".")}: `:""}${w.message}`}function FH($,v,w){$.register({name:"typescape_create_review_set",description:"Create a new review set (multi-file review pack). Requires features.review_sets to be enabled.",inputSchema:wH},async(g)=>{let _=g;try{if(!(await w.getCapabilities()).review_sets)return w.featureDisabledResult("review_sets")}catch(Y){if(Y instanceof L)return N(Y);throw Y}if(!_.source_type)return N(new L(400,"missing_param","Missing required parameter: source_type","local"));if(_.source_type!=="git"&&_.source_type!=="upload")return N(new L(422,"invalid_argument","source_type must be one of: git, upload","local"));let b=Array.isArray(_.reviews)&&_.reviews.length>0?_.reviews:Array.isArray(_.sessions)&&_.sessions.length>0?_.sessions:void 0,J=Array.isArray(b)&&b.length>0,D=Array.isArray(_.files)&&_.files.length>0;if(!J&&!D)return N(new L(400,"missing_param","At least one of reviews[] or files[] is required","local"));let X={source_type:_.source_type};if(_.title!==void 0)X.title=_.title;if(_.kind!==void 0)X.kind=_.kind;if(J)X.reviews=b;if(D)X.files=_.files;if(_.participants!==void 0)X.participants=_.participants.map((Y)=>{if(Array.isArray(Y.roles)&&Y.roles.length>0)return{email:Y.email,roles:Y.roles};if(Y.role)return{email:Y.email,roles:[Y.role]};return Y});let G={};if(_.idempotency_key)G["Idempotency-Key"]=_.idempotency_key;try{let Y=await v.post("/review-sets",{body:X,headers:G});return k(Y.body,Y.requestId)}catch(Y){if(Y instanceof L)return N(Y);throw Y}}),$.register({name:"typescape_export_review_set",description:"Export feedback from a review set. Requires features.review_sets to be enabled.",inputSchema:gH},async(g)=>{let _=g;try{if(!(await w.getCapabilities()).review_sets)return w.featureDisabledResult("review_sets")}catch(D){if(D instanceof L)return N(D);throw D}if(!_.review_set_id)return N(new L(400,"missing_param","Missing required parameter: review_set_id","local"));let J={schema:typeof _.schema==="string"&&_.schema.trim().length>0?_.schema.trim():"v2"};if(_.view)J.view=_.view;try{let D=await v.get(`/review-sets/${encodeURIComponent(_.review_set_id)}/export`,{query:J});return k(D.body,D.requestId)}catch(D){if(D instanceof L)return N(D);throw D}}),$.register({name:"typescape_list_review_sets",description:"List review sets with optional cursor pagination. Requires features.review_sets to be enabled. Returns an array of review sets with pagination metadata.",inputSchema:bH},async(g)=>{let _=g;try{if(!(await w.getCapabilities()).review_sets)return w.featureDisabledResult("review_sets")}catch(J){if(J instanceof L)return N(J);throw J}let b={};if(_.limit!==void 0)b.limit=String(_.limit);if(_.cursor!==void 0)b.cursor=_.cursor;try{let J=await v.get("/review-sets",{query:b});return k(J.body,J.requestId)}catch(J){if(J instanceof L)return N(J);throw J}}),$.register({name:"typescape_get_review_set",description:"Get a review set by ID. Returns the review set details including status, review memberships, and configuration. Requires features.review_sets to be enabled.",inputSchema:UH},async(g)=>{let _=g;try{if(!(await w.getCapabilities()).review_sets)return w.featureDisabledResult("review_sets")}catch(b){if(b instanceof L)return N(b);throw b}if(!_.review_set_id)return N(new L(400,"missing_param","Missing required parameter: review_set_id","local"));try{let b=await v.get(`/review-sets/${encodeURIComponent(_.review_set_id)}`);return k(b.body,b.requestId)}catch(b){if(b instanceof L)return N(b);throw b}}),$.register({name:"typescape_create_work_item",description:"Create a canonical shared-queue work item for review, verification, triage, approval, or manual operator tasks.",inputSchema:JH},async(g)=>{let _=g;if(!_.title)return N(B$(400,"missing_param","Missing required parameter: title"));if(!_.kind)return N(B$(400,"missing_param","Missing required parameter: kind"));if(!_.reason_code)return N(B$(400,"missing_param","Missing required parameter: reason_code"));if(!_.audience_mode)return N(B$(400,"missing_param","Missing required parameter: audience_mode"));if(!_.target?.target_type)return N(B$(400,"missing_param","Missing required parameter: target.target_type"));if(!_.target?.target_id)return N(B$(400,"missing_param","Missing required parameter: target.target_id"));let b=aQ.safeParse(g);if(!b.success)return N(B$(422,"invalid_argument",wb(b.error.issues,"Invalid work-item create payload")));try{let J=await v.post("/work-items",{body:b.data});return k(J.body,J.requestId)}catch(J){if(J instanceof L)return N(J);throw J}}),$.register({name:"typescape_list_work_items",description:"List canonical shared-queue work items with optional queue, state, and ownership filters.",inputSchema:DH},async(g)=>{let _=g,b=$W.safeParse(_);if(!b.success)return N(B$(422,"invalid_argument",wb(b.error.issues,"Invalid work-item query")));let J={limit:String(b.data.limit)};if(b.data.state)J.state=b.data.state;if(b.data.kind)J.kind=b.data.kind;if(b.data.reason_code)J.reason_code=b.data.reason_code;if(b.data.audience_mode)J.audience_mode=b.data.audience_mode;if(b.data.queue_surface)J.queue_surface=b.data.queue_surface;if(b.data.assignee_id)J.assignee_id=b.data.assignee_id;if(b.data.claimant_id)J.claimant_id=b.data.claimant_id;if(b.data.cursor)J.cursor=b.data.cursor;try{let D=await v.get("/work-items",{query:J});return k(D.body,D.requestId)}catch(D){if(D instanceof L)return N(D);throw D}}),$.register({name:"typescape_get_work_item",description:"Get canonical detail for a shared-queue work item by ID.",inputSchema:XH},async(g)=>{let _=g;if(!_.work_item_id)return N(B$(400,"missing_param","Missing required parameter: work_item_id"));let b=SU.safeParse(_.work_item_id);if(!b.success)return N(B$(422,"invalid_argument",wb(b.error.issues,"Invalid work item ID")));try{let J=await v.get(`/work-items/${encodeURIComponent(b.data)}`);return k(J.body,J.requestId)}catch(J){if(J instanceof L)return N(J);throw J}}),$.register({name:"typescape_transition_work_item",description:"Move a shared-queue work item through the canonical lifecycle using claim/start/block/complete and related actions.",inputSchema:GH},async(g)=>{let _=g;if(!_.work_item_id)return N(B$(400,"missing_param","Missing required parameter: work_item_id"));if(!_.action)return N(B$(400,"missing_param","Missing required parameter: action"));let b=SU.safeParse(_.work_item_id);if(!b.success)return N(B$(422,"invalid_argument",wb(b.error.issues,"Invalid work item ID")));let J=vW.safeParse({action:_.action,..._.expected_version!==void 0?{expected_version:_.expected_version}:{},..._.idempotency_key?{idempotency_key:_.idempotency_key}:{},..._.blocking_reason?{blocking_reason:_.blocking_reason}:{},..._.cancellation_reason?{cancellation_reason:_.cancellation_reason}:{},..._.completion_outcome?{completion_outcome:_.completion_outcome}:{},..._.comment?{comment:_.comment}:{}});if(!J.success)return N(B$(422,"invalid_argument",wb(J.error.issues,"Invalid work-item transition payload")));try{let D=await v.post(`/work-items/${encodeURIComponent(b.data)}/transitions`,{body:J.data});return k(D.body,D.requestId)}catch(D){if(D instanceof L)return N(D);throw D}}),$.register({name:"typescape_create_review_ref",description:"Create a stable review reference that tracks HEAD review for doc/file/PR/custom keys. Always available (core primitive).",inputSchema:YH},async(g)=>{let _=g;if(!_.source_type)return N(new L(400,"missing_param","Missing required parameter: source_type","local"));if(!_.kind)return N(new L(400,"missing_param","Missing required parameter: kind","local"));if(!_.key)return N(new L(400,"missing_param","Missing required parameter: key","local"));if(!_.head_session_id)return N(new L(400,"missing_param","Missing required parameter: head_session_id","local"));let b=_.kind.trim().toLowerCase();if(!_H.has(b))return N(new L(400,"invalid_param",`Invalid parameter: kind must be one of ${xU.join(", ")}`,"local"));let J={source_type:_.source_type,kind:b,key:_.key,head_session_id:_.head_session_id};if(_.repo_id!==void 0)J.repo_id=_.repo_id;if(_.project_id!==void 0)J.project_id=_.project_id;try{let D=await v.post("/review-refs",{body:J});return k(D.body,D.requestId)}catch(D){if(D instanceof L)return N(D);throw D}}),$.register({name:"typescape_resolve_review_ref",description:"Resolve a review ref to its current head review. Returns the head review ID and pinned content details.",inputSchema:QH},async(g)=>{let _=g;if(!_.review_ref_id)return N(new L(400,"missing_param","Missing required parameter: review_ref_id","local"));try{let b=await v.get(`/review-refs/${encodeURIComponent(_.review_ref_id)}/resolve`);return k(b.body,b.requestId)}catch(b){if(b instanceof L)return N(b);throw b}}),$.register({name:"typescape_advance_review_ref",description:"Advance a review ref to a new head review. Use expected_head_session_id for optimistic concurrency.",inputSchema:WH},async(g)=>{let _=g;if(!_.review_ref_id)return N(new L(400,"missing_param","Missing required parameter: review_ref_id","local"));if(!_.head_session_id)return N(new L(400,"missing_param","Missing required parameter: head_session_id","local"));let b={head_session_id:_.head_session_id};if(_.expected_head_session_id!==void 0)b.expected_head_session_id=_.expected_head_session_id;try{let J=await v.post(`/review-refs/${encodeURIComponent(_.review_ref_id)}/advance`,{body:b});return k(J.body,J.requestId)}catch(J){if(J instanceof L)return N(J);throw J}}),$.register({name:"typescape_request_approval",description:"Request approval for a review from specified approvers. Sends notifications via configured channels.",inputSchema:HH},async(g)=>{let _=g;if(!_.review_id)return N(new L(400,"missing_param","Missing required parameter: review_id","local"));if(!_.approver_emails||_.approver_emails.length===0)return N(new L(400,"missing_param","Missing required parameter: approver_emails","local"));let b={approver_emails:_.approver_emails};if(_.message!==void 0)b.message=_.message;if(_.notify!==void 0)b.notify=_.notify;let J={};if(_.idempotency_key)J["Idempotency-Key"]=_.idempotency_key;try{let D=await v.post(`/reviews/${encodeURIComponent(_.review_id)}/request-approval`,{body:b,headers:J});return k(D.body,D.requestId)}catch(D){if(D instanceof L)return N(D);throw D}}),$.register({name:"typescape_get_status",description:"Get the policy verdict for a review. Returns pass/fail/needs_review with reasons. Requires features.policy to be enabled.",inputSchema:qH},async(g)=>{let _=g;try{if(!(await w.getCapabilities()).policy)return w.featureDisabledResult("policy")}catch(J){if(J instanceof L)return N(J);throw J}if(!_.review_id)return N(new L(400,"missing_param","Missing required parameter: review_id","local"));let b={};if(_.simulate)b.simulate="true";if(_.wait!==void 0)b.wait=String(_.wait);try{let J=await v.get(`/reviews/${encodeURIComponent(_.review_id)}/status`,{query:b});return k(e8(J.body),J.requestId)}catch(J){if(J instanceof L)return N(J);throw J}}),$.register({name:"typescape_run_checks",description:"Trigger deterministic product checks (DocLint and related server-owned checks) for a review. This is separate from agent judgment against the rule bundle. Returns the check run ID. Requires features.checks to be enabled.",inputSchema:IH},async(g)=>{let _=g;try{if(!(await w.getCapabilities()).checks)return w.featureDisabledResult("checks")}catch(b){if(b instanceof L)return N(b);throw b}if(!_.review_id)return N(new L(400,"missing_param","Missing required parameter: review_id","local"));try{let b=await v.post(`/reviews/${encodeURIComponent(_.review_id)}/run-checks`,{body:{}});return k(b.body,b.requestId)}catch(b){if(b instanceof L)return N(b);throw b}}),$.register({name:"typescape_account_usage",description:"Get account usage and quota information (reviews used/limit, remaining, and billing period).",inputSchema:BH},async()=>{try{let g=await v.get("/account/usage");return k(g.body,g.requestId)}catch(g){if(g instanceof L)return N(g);throw g}}),$.register({name:"typescape_account_plan",description:"Get account plan details (plan name/id, status, and limits metadata).",inputSchema:LH},async()=>{try{let g=await v.get("/account/plan");return k(g.body,g.requestId)}catch(g){if(g instanceof L)return N(g);throw g}}),$.register({name:"typescape_get_capabilities",description:"Get authenticated capabilities and effective feature flags. Returns the same payload shape as GET /v1/me/capabilities.",inputSchema:VH},async()=>{try{let g=await v.get("/me/capabilities");return k(g.body,g.requestId)}catch(g){if(g instanceof L)return N(g);throw g}})}var KH=["typescape_request_snapshot","typescape_get_snapshot","typescape_list_backlinks","typescape_get_impact"],XT={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier to build a corpus snapshot for"}},required:["repo_id"]},GT={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier"},git_sha:{type:"string",description:"Git commit SHA for the snapshot"}},required:["repo_id","git_sha"]},YT={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier"},git_sha:{type:"string",description:"Git commit SHA for the snapshot"},path:{type:"string",description:"Target file path to query backlinks for"},anchor:{type:"string",description:"Optional anchor within the file to narrow backlinks"}},required:["repo_id","git_sha","path"]},QT={type:"object",properties:{review_id:{type:"string",description:"Review identifier to compute impact radius for"}},required:["review_id"]};async function lU($){try{if(!(await $.getCapabilities()).corpus_snapshots)return $.featureDisabledResult("corpus_snapshots");return null}catch(v){if(v instanceof L)return N(v);throw v}}async function WT($,v,w){let g=await lU(v);if(g)return g;let _=w;if(!_.repo_id)return a("repo_id");let b=await $.post(`/repos/${encodeURIComponent(_.repo_id)}/snapshots`,{body:{}});return k(b.body,b.requestId)}async function HT($,v,w){let g=await lU(v);if(g)return g;let _=w;if(!_.repo_id)return a("repo_id");if(!_.git_sha)return a("git_sha");let b=await $.get(`/repos/${encodeURIComponent(_.repo_id)}/snapshots/${encodeURIComponent(_.git_sha)}`);return k(b.body,b.requestId)}async function qT($,v,w){let g=await lU(v);if(g)return g;let _=w;if(!_.repo_id)return a("repo_id");if(!_.git_sha)return a("git_sha");if(!_.path)return a("path");let b=new URLSearchParams({path:_.path});if(_.anchor)b.set("anchor",_.anchor);let J=await $.get(`/repos/${encodeURIComponent(_.repo_id)}/snapshots/${encodeURIComponent(_.git_sha)}/backlinks?${b}`);return k(J.body,J.requestId)}async function IT($,v,w){let g=await lU(v);if(g)return g;let _=w;if(!_.review_id)return a("review_id");let b=await $.get(`/reviews/${encodeURIComponent(_.review_id)}/impact`);return k(b.body,b.requestId)}function OH($,v,w){$.register({name:"typescape_request_snapshot",description:"Request a corpus snapshot build for a repository. Returns the snapshot ID and build status. The snapshot builds "+"asynchronously — use typescape_get_snapshot to poll for completion. "+"Requires features.corpus_snapshots to be enabled.",inputSchema:XT},y((g)=>WT(v,w,g),{operation:"write"})),$.register({name:"typescape_get_snapshot",description:"Get corpus snapshot metadata for a Git repo at a specific commit. Returns snapshot status, config hash, and source type. Requires features.corpus_snapshots to be enabled.",inputSchema:GT},y((g)=>HT(v,w,g),{operation:"read"})),$.register({name:"typescape_list_backlinks",description:"List inbound backlinks for a target file (and optional anchor) within a corpus snapshot. Returns deterministic, authoritative data. Requires features.corpus_snapshots to be enabled.",inputSchema:YT},y((g)=>qT(v,w,g),{operation:"read"})),$.register({name:"typescape_get_impact",description:"Compute the impact radius for a review: which other files are affected by changes to the review's target file (via backlinks). Returns deterministic, authoritative data. Requires features.corpus_snapshots to be enabled.",inputSchema:QT},y((g)=>IT(v,w,g),{operation:"read"}))}var iH=["typescape_get_rules","typescape_check_content","typescape_import_rules","typescape_publish_rules","typescape_deprecate_rules","typescape_create_release_candidate","typescape_list_release_candidates","typescape_get_release_candidate","typescape_get_release_candidate_status","typescape_transition_release_candidate","typescape_rules_dashboard"],s8=new Map;function BT($){return $.status===0||$.status===429||$.status>=500}function LT($){return{repo_id:typeof $.repo_id==="string"&&$.repo_id.trim().length>0?$.repo_id.trim():null,review_id:typeof $.review_id==="string"&&$.review_id.trim().length>0?$.review_id.trim():null,file_path:typeof $.file_path==="string"&&$.file_path.trim().length>0?$.file_path.trim():null}}function a8($,v){let w=R7($.freshness.fetched_at);return{...v,cache_status:w.status,cache_age_seconds:w.age_seconds,cache_compiled_hash:$.compiled_hash,...w.warning?{warnings:[{code:"cached_rules",message:w.warning}],cache_warning:w.warning}:{}}}function nH($){if(!$||typeof $!=="object"||Array.isArray($))return;let v=$.request_id;return typeof v==="string"?v:void 0}function $G($){let v=$.compiledHash===void 0?null:$.compiledHash;return{rules:$.rules,compiled_hash:v,freshness:$.freshness,...$.requestId?{request_id:$.requestId}:{},...$.cacheMetadata??{}}}function PH($){if(!Array.isArray($))return[];return $.filter((v)=>typeof v==="object"&&v!==null&&!Array.isArray(v))}function VT($){if(!$||typeof $!=="object"||Array.isArray($))return{latest_rule_session_updated_at:null,contributing_session_count:0,total_rule_count:0};let v=$;return{latest_rule_session_updated_at:typeof v.latest_rule_session_updated_at==="string"?v.latest_rule_session_updated_at:null,contributing_session_count:typeof v.contributing_session_count==="number"&&Number.isFinite(v.contributing_session_count)?v.contributing_session_count:0,total_rule_count:typeof v.total_rule_count==="number"&&Number.isFinite(v.total_rule_count)?v.total_rule_count:0}}function AH($){if(!$||typeof $!=="object"||Array.isArray($))return{};let v={};for(let[w,g]of Object.entries($))if(typeof g==="string"&&g.length>0)v[w]=g;return v}function MH($,v,w){try{return A$($)}catch{throw new L(502,"invalid_upstream_response",w,v)}}function jT($,v){let w=(()=>{switch(v){case"manifest":return kU.safeParse($);case"structured":return zU.safeParse($);case"text":return iU.safeParse($);case"diff":return nU.safeParse($);case"chunk":return PU.safeParse($)}})();if(w.success)return"unknown response mismatch";let g=w.error.issues[0];if(g===void 0)return"invalid response payload";return`${g.path.length===0?"(root)":g.path.join(".")}: ${g.message}`}function FT($,v,w){let g=(()=>{switch(w){case"manifest":return kU.safeParse($);case"structured":return zU.safeParse($);case"text":return iU.safeParse($);case"diff":return nU.safeParse($);case"chunk":return PU.safeParse($)}})();if(!g.success)throw new L(502,"invalid_upstream_response",`Rules retrieval mode=${w} response was invalid (${jT($,w)}).`,v);return g.data}function KT($){if($.scope!==void 0)return $.scope;if($.review_id&&($.file_path||$.path))return"file";if($.review_id)return"review";if($.file_path||$.path)return"file";if($.collection_id)return"collection";return"workspace"}function OT($){let v=$.mode;if(v===void 0)throw Error("canonical retrieval mode is required");let w=typeof $.file_path==="string"&&$.file_path.trim().length>0?$.file_path.trim():typeof $.path==="string"&&$.path.trim().length>0?$.path.trim():null,g=AH($.properties);if(typeof $.repo_id==="string"&&$.repo_id.trim().length>0)g.repo_id=$.repo_id.trim();let _={mode:v,scope:KT($)};if($.release_id)_.release_id=$.release_id;if($.collection_id)_.collection_id=$.collection_id;if($.review_id)_.review_id=$.review_id;if(w)_.file_path=w;if($.token_budget!==void 0&&$.token_budget!==null)_.token_budget=String($.token_budget);if(Object.keys(g).length>0)_.properties=JSON.stringify(g);return _}function NH($){let v=new URLSearchParams({format:$.format}),w=Object.entries($.contentProperties).sort(([g],[_])=>g.localeCompare(_));for(let[g,_]of w)v.set(g,_);return`/rules?${v.toString()}`}async function NT($){let v=await $.api.get(`/reviews/${encodeURIComponent($.reviewId)}`),w=MH(v.body,v.requestId,"Review detail response was not an object"),g=AH(w.properties),_=typeof w.repo_id==="string"&&w.repo_id.length>0?w.repo_id:null,b=typeof w.file_path==="string"&&w.file_path.length>0?w.file_path:null,J=$.filePath??b;if(_)g.repo_id=_;if(J)g.file_path=J;return{reviewId:$.reviewId,repoId:_,filePath:J,contentProperties:g}}async function kT($){let v={format:"json"},w={format:"text"};if($.scope.repo_id)v.repo_id=$.scope.repo_id,w.repo_id=$.scope.repo_id;if($.scope.review_id)v.review_id=$.scope.review_id,w.review_id=$.scope.review_id;if($.scope.file_path)v.file_path=$.scope.file_path,w.file_path=$.scope.file_path;if($.policySnapshotId)v.policy_snapshot_id=$.policySnapshotId,w.policy_snapshot_id=$.policySnapshotId;let[g,_]=await Promise.all([$.api.getText("/rules",{query:w}),$.api.get("/rules",{query:v})]),b=_.body,J=Array.isArray(b.rules)?b.rules:[],D=typeof b.compiled_hash==="string"?b.compiled_hash:null,X=b.freshness&&typeof b.freshness==="object"&&!Array.isArray(b.freshness)?b.freshness:{latest_rule_session_updated_at:null,contributing_session_count:0,total_rule_count:J.length},G=tX({scope:$.scope,rules:[],plain_text_bundle:g.body,freshness:X,compiled_hash:D??void 0,fetched_at:new Date().toISOString(),renderings:{text:g.body,json_payload:b,structured_payload:J}});s8.set($U($.scope),G);let Y=typeof b.request_id==="string"?b.request_id:void 0;return{text:g.body,normalizedBody:b,structuredPayload:$G({rules:J,compiledHash:D,freshness:X,requestId:Y})}}async function zT($){let v=await NT({api:$.api,reviewId:$.reviewId,filePath:$.filePath}),[w,g]=await Promise.all([$.api.getText(NH({format:"text",contentProperties:v.contentProperties})),$.api.get(NH({format:"json",contentProperties:v.contentProperties}))]),_=MH(g.body,g.requestId,"Rules response payload was not an object"),b=PH(_.rules),J=VT(_.freshness),D=nH(_),X=D===void 0?g.requestId:D,G=typeof _.compiled_hash==="string"?_.compiled_hash:null,Y={..._,request_id:X},Q=$G({rules:b,compiledHash:G,freshness:J,requestId:X}),W=tX({scope:{repo_id:v.repoId,review_id:v.reviewId,file_path:v.filePath},rules:[],plain_text_bundle:w.body,freshness:J,compiled_hash:G??void 0,fetched_at:new Date().toISOString(),renderings:{text:w.body,json_payload:Y,structured_payload:b}});return s8.set($U({repo_id:v.repoId,review_id:v.reviewId,file_path:v.filePath}),W),{text:w.body,normalizedBody:Y,structuredPayload:Q}}function iT($,v){let w=s8.get($U($));if(!w)return null;if(v==="text")return a8(w,{text:w.plain_text_bundle,format:"text",cached:!0});if(v==="structured"){let _=PH(w.renderings?.structured_payload);return a8(w,{...$G({rules:_,compiledHash:w.compiled_hash,freshness:w.freshness,requestId:nH(w.renderings?.json_payload)}),cached:!0})}let g=w.renderings?.json_payload;if(!g||typeof g!=="object"||Array.isArray(g))return null;return a8(w,{...g,cached:!0})}var nT={type:"object",properties:{repo_id:{type:"string",description:"Repository identifier"},review_id:{type:"string",description:"Review identifier. Use for upload-backed reviews or when repo_id is not known."},collection_id:{type:"string",description:"Optional collection scope for canonical retrieval."},properties:{type:"object",additionalProperties:{type:"string"},description:"Optional flat property map for canonical rule matching and retrieval."},release_id:{type:"string",description:"Optional exact immutable release ID for canonical retrieval."},mode:{type:"string",enum:["manifest","structured","text","diff","chunk"],description:"Optional canonical retrieval mode. When present, the tool returns the release-aware retrieval contract directly."},scope:{type:"string",enum:["workspace","collection","review","file"],description:"Optional canonical retrieval scope override. Default is inferred from review_id, file_path, and collection_id."},policy_snapshot_id:{type:"string",description:"Optional policy snapshot ID used to compile rules context"},file_path:{type:"string",description:"Optional file path to scope rules"},path:{type:"string",description:"Alias for file_path. If both are provided, file_path takes precedence."},format:{type:"string",enum:["text","structured"],description:'Output format: "text" returns the canonical plain-text rule bundle, "structured" returns governed JSON rules (authoritative). Default: text.'},token_budget:{type:"number",description:"Maximum token count for canonical chunk retrieval (mode=chunk only, 100-10000).",minimum:100,maximum:1e4}}},PT={type:"object",properties:{content:{type:"string",description:"Markdown content for an optional server-side non-authoritative rules pass that can seed governance follow-up against applicable rules (max 1MB)."},properties:{type:"object",additionalProperties:{type:"string"},description:"Content properties for rule matching (flat key-value map, e.g. { doc_type: 'procedure' }). Use the same context the agent will reason against."},collection_id:{type:"string",description:"Optional collection ID to scope rule matching."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)."}},required:["content"]},AT={type:"object",properties:{content:{type:"string",description:"Rule markdown content to import (max 512KB). Each list item is a rule block."},title:{type:"string",description:"Human-readable title for the imported rule review (optional)."},applicability:{type:"object",additionalProperties:{type:"string"},description:"Applicability selector for rule matching (flat key-value map, optional)."},provenance:{type:"object",properties:{source:{type:"string",enum:["manual","findings","external"],description:"Import source classification."},source_review_id:{type:"string",description:"Source review ID when imported from findings."},source_label:{type:"string",description:"Human-readable source label."}},description:"Provenance metadata for finding-seeded imports (optional)."},preview:{type:"boolean",description:"If true, returns a preview without creating a review (dry run). Default: false."},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)."}},required:["content"]},MT={type:"object",properties:{include_degraded:{type:"boolean",default:!0,description:"Include derived degradation buckets based on canonical evidence rollups"}}},kH={type:"object",properties:{review_id:{type:"string",description:"Rule review ID to publish or deprecate. Must refer to a rules review."}}},fT={type:"object",properties:{workspace_id:{type:"string",description:"Workspace ID that owns the release candidate."},included_rule_revision_ids:{type:"array",items:{type:"string"},description:"Rule revision IDs to include. In the current substrate these are rules review IDs."},based_on_active_release_id:{type:"string",description:"Optional active release baseline ID."},rollback_of_release_id:{type:"string",description:"Optional release ID being rolled back."},title:{type:"string",description:"Optional human-readable release candidate title."},idempotency_key:{type:"string",description:"Optional idempotency key for safe retries."}},required:["workspace_id","included_rule_revision_ids"]},ST={type:"object",properties:{limit:{type:"number",description:"Maximum rows to return (default 6, max 25)."}}},zH={type:"object",properties:{release_candidate_id:{type:"string",description:"Canonical release candidate ID."}},required:["release_candidate_id"]},TT={type:"object",properties:{release_candidate_id:{type:"string",description:"Canonical release candidate ID."},action:{type:"string",enum:[...m8],description:"Public release candidate lifecycle action."},expected_version:{type:"number",description:"Optional optimistic concurrency version."},rejection_reason:{type:"string",description:"Required when action is reject or abandon."},stale_reason:{type:"string",description:"Required when action is mark_stale."},idempotency_key:{type:"string",description:"Optional idempotency key for safe retries."}},required:["release_candidate_id","action"]};function fH($,v,w){let g=async()=>{try{return(await w.getCapabilities()).rules?null:w.featureDisabledResult("rules")}catch(J){if(J instanceof L)return N(J);throw J}},_=async(J)=>{try{let D=await v.patch(`/reviews/${encodeURIComponent(J.reviewId)}`,{body:{state:J.targetState}});return k(D.body,D.requestId,{retry:u$(!1)})}catch(D){if(D instanceof L)return N(D,{operation:"write",hasIdempotencyKey:!1});throw D}},b=(J)=>{if(typeof J==="string"&&J.trim().length>0)return J.trim();return N(new L(400,"missing_param","Missing required parameter: release_candidate_id","local"),{operation:"read"})};$.register({name:"typescape_get_rules",description:'Canonical agent read path for live rules from the active release in repository or review context. Fetch this before reasoning about a draft or reconciling reviewer feedback. If no active release exists, the live ruleset is empty until operators publish revisions and activate a release. When mode is provided, the tool returns the canonical release-aware retrieval contract directly. format="text" returns the canonical plain-text rule bundle. format="structured" returns the deterministic rulepack with compiled hash and freshness metadata. Requires rules to be enabled.',inputSchema:nT},async(J)=>{let D=J;if(D.mode!==void 0){let H=NU.safeParse(D.mode);if(!H.success)return N(new L(400,"invalid_mode",`Invalid mode: ${String(D.mode)}`,"local"));let q=D.scope===void 0?null:A8.safeParse(D.scope);if(q&&!q.success)return N(new L(400,"invalid_scope",`Invalid scope: ${String(D.scope)}`,"local"));if(D.token_budget!==void 0&&H.data!=="chunk")return N(new L(400,"invalid_argument","token_budget requires mode=chunk","local"));let j=await g();if(j)return j;try{let F=await v.get("/rules",{query:OT({...D,mode:H.data,...q?{scope:q.data}:{}})}),M=FT(F.body,F.requestId,H.data);return k(M,F.requestId,{retry:L$})}catch(F){if(F instanceof L)return N(F,{operation:"read"});throw F}}if(D.token_budget!==void 0)return N(new L(400,"invalid_argument","token_budget requires mode=chunk","local"));let X=await g();if(X)return X;let G=typeof D.repo_id==="string"&&D.repo_id.length>0,Y=typeof D.review_id==="string"&&D.review_id.length>0;if(!G&&!Y)return N(new L(400,"missing_param","Missing required parameter: repo_id or review_id","local"));let Q=D.format==="structured"?"structured":"text",W=typeof D.file_path==="string"&&D.file_path.trim().length>0?D.file_path.trim():typeof D.path==="string"&&D.path.trim().length>0?D.path.trim():null,I=LT({repo_id:G?D.repo_id:void 0,review_id:Y?D.review_id:void 0,file_path:W});try{let H=Y&&!G?await zT({api:v,reviewId:D.review_id,filePath:W}):await kT({api:v,scope:I,tokenBudget:D.token_budget,policySnapshotId:D.policy_snapshot_id});if(Q==="text")return k({text:H.text,format:"text"},H.normalizedBody.request_id??"missing_request_id",{retry:L$});let q={...H.normalizedBody};if(Q==="structured")q.rules=H.structuredPayload.rules,q.compiled_hash=H.structuredPayload.compiled_hash,q.freshness=H.structuredPayload.freshness;return k(q,q.request_id??"missing_request_id",{retry:L$})}catch(H){if(H instanceof L){if(BT(H)){let q=iT(I,Q);if(q)return k(q,H.requestId,{retry:L$})}return N(H,{operation:"read"})}throw H}}),$.register({name:"typescape_check_content",description:"Optional server-side non-authoritative rules pass for markdown content against the live rules from the active release. If no active release exists, the live ruleset is empty and operators should publish revisions, then activate a release. Treat the result as candidate governance/advisory input, not a complete review or substitute for agent reasoning. Canonical loop: typescape_get_rules -> read content -> typescape_create_finding. Requires rules to be enabled.",inputSchema:PT},async(J)=>{let D=J,X=await g();if(X)return X;if(!D.content||D.content.length===0)return N(new L(400,"missing_param","Missing required parameter: content","local"));let G={content:D.content};if(D.properties!==void 0)G.properties=D.properties;if(D.collection_id!==void 0)G.collection_id=D.collection_id;if(D.idempotency_key!==void 0)G.idempotency_key=D.idempotency_key;try{let Y=await v.post("/rules/check",{body:G});return k(Y.body,Y.requestId,{retry:L$})}catch(Y){if(Y instanceof L)return N(Y,{operation:"read"});throw Y}}),$.register({name:"typescape_import_rules",description:"Import rules from markdown content, creating a draft rule review. Each list item in the markdown becomes a rule block. Set preview=true for a dry run. Publishing creates a published revision, but it does not become live until a release is activated. Returns the review ID and parsed rules. Requires rules to be enabled.",inputSchema:AT},async(J)=>{let D=J,X=await g();if(X)return X;if(!D.content||D.content.length===0)return N(new L(400,"missing_param","Missing required parameter: content","local"));let G={content:D.content};if(D.title!==void 0)G.title=D.title;if(D.applicability!==void 0)G.applicability=D.applicability;if(D.provenance!==void 0)G.provenance=D.provenance;if(D.preview!==void 0)G.preview=D.preview;if(D.idempotency_key!==void 0)G.idempotency_key=D.idempotency_key;let Y={};if(D.idempotency_key)Y["Idempotency-Key"]=D.idempotency_key;try{let Q=await v.post("/rules/import",{body:G,headers:Y});return k(Q.body,Q.requestId,{retry:u$(Boolean(D.idempotency_key))})}catch(Q){if(Q instanceof L)return N(Q,{operation:"write",hasIdempotencyKey:Boolean(D.idempotency_key)});throw Q}}),$.register({name:"typescape_publish_rules",description:"Publish a draft rule review through the canonical review state transition. This creates a published revision but does not make the rules live until a release is activated. Returns the resulting review state and publication status. Requires rules to be enabled.",inputSchema:kH},async(J)=>{let D=J,X=await g();if(X)return X;if(!D.review_id)return N(new L(400,"missing_param","Missing required parameter: review_id","local"),{operation:"write"});return _({reviewId:D.review_id,targetState:"active"})}),$.register({name:"typescape_deprecate_rules",description:"Deprecate a published rule review through the canonical review state transition. This affects future release composition and does not mutate the currently active release in place. Returns the resulting review state and publication status. Requires rules to be enabled.",inputSchema:kH},async(J)=>{let D=J,X=await g();if(X)return X;if(!D.review_id)return N(new L(400,"missing_param","Missing required parameter: review_id","local"),{operation:"write"});return _({reviewId:D.review_id,targetState:"archived"})}),$.register({name:"typescape_create_release_candidate",description:"Create a canonical release candidate from rule revisions. Use this instead of release_bundle-style review-set assembly in new workflows. Requires rules to be enabled.",inputSchema:fT},async(J)=>{let D=J,X=await g();if(X)return X;if(!D.workspace_id)return N(new L(400,"missing_param","Missing required parameter: workspace_id","local"),{operation:"write"});if(!Array.isArray(D.included_rule_revision_ids)||D.included_rule_revision_ids.length===0)return N(new L(400,"missing_param","Missing required parameter: included_rule_revision_ids","local"),{operation:"write"});let G={workspace_id:D.workspace_id,included_rule_revision_ids:D.included_rule_revision_ids,...D.based_on_active_release_id?{based_on_active_release_id:D.based_on_active_release_id}:{},...D.rollback_of_release_id?{rollback_of_release_id:D.rollback_of_release_id}:{},...D.title?{title:D.title}:{},...D.idempotency_key?{idempotency_key:D.idempotency_key}:{}},Y={};if(D.idempotency_key)Y["Idempotency-Key"]=D.idempotency_key;try{let Q=await v.post("/releases/candidates",{body:G,...D.idempotency_key?{headers:Y}:{}});return k(Q.body,Q.requestId,{retry:u$(Boolean(D.idempotency_key))})}catch(Q){if(Q instanceof L)return N(Q,{operation:"write",hasIdempotencyKey:Boolean(D.idempotency_key)});throw Q}}),$.register({name:"typescape_list_release_candidates",description:"List canonical release candidates for the authenticated workspace tenant. Requires rules to be enabled.",inputSchema:ST},async(J)=>{let D=J,X=await g();if(X)return X;let G={};if(typeof D.limit==="number"&&Number.isFinite(D.limit))G.limit=String(D.limit);try{let Y=await v.get("/releases/candidates",{query:G});return k(Y.body,Y.requestId,{retry:L$})}catch(Y){if(Y instanceof L)return N(Y,{operation:"read"});throw Y}}),$.register({name:"typescape_get_release_candidate",description:"Get canonical release candidate detail by ID. Requires rules to be enabled.",inputSchema:zH},async(J)=>{let D=J,X=await g();if(X)return X;let G=b(D.release_candidate_id);if(typeof G!=="string")return G;try{let Y=await v.get(`/releases/candidates/${encodeURIComponent(G)}`);return k(Y.body,Y.requestId,{retry:L$})}catch(Y){if(Y instanceof L)return N(Y,{operation:"read"});throw Y}}),$.register({name:"typescape_get_release_candidate_status",description:"Get canonical release candidate status and required actions by ID. Requires rules to be enabled.",inputSchema:zH},async(J)=>{let D=J,X=await g();if(X)return X;let G=b(D.release_candidate_id);if(typeof G!=="string")return G;try{let Y=await v.get(`/releases/candidates/${encodeURIComponent(G)}/status`);return k(Y.body,Y.requestId,{retry:L$})}catch(Y){if(Y instanceof L)return N(Y,{operation:"read"});throw Y}}),$.register({name:"typescape_transition_release_candidate",description:"Move a canonical release candidate through its lifecycle. Requires rules to be enabled.",inputSchema:TT},async(J)=>{let D=J,X=await g();if(X)return X;let G=b(D.release_candidate_id);if(typeof G!=="string")return G;if(!D.action)return N(new L(400,"missing_param","Missing required parameter: action","local"),{operation:"write"});let Y={action:D.action,...typeof D.expected_version==="number"?{expected_version:D.expected_version}:{},...D.rejection_reason?{rejection_reason:D.rejection_reason}:{},...D.stale_reason?{stale_reason:D.stale_reason}:{},...D.idempotency_key?{idempotency_key:D.idempotency_key}:{}},Q={};if(D.idempotency_key)Q["Idempotency-Key"]=D.idempotency_key;try{let W=await v.post(`/releases/candidates/${encodeURIComponent(G)}/transition`,{body:Y,...D.idempotency_key?{headers:Q}:{}});return k(W.body,W.requestId,{retry:u$(Boolean(D.idempotency_key))})}catch(W){if(W instanceof L)return N(W,{operation:"write",hasIdempotencyKey:Boolean(D.idempotency_key)});throw W}}),$.register({name:"typescape_rules_dashboard",description:"Get aggregate rules evidence, provenance, and degradation summary from canonical rules runtime surfaces. Requires features.rules.",inputSchema:MT},async(J)=>{let D=J;try{if(!(await w.getCapabilities()).rules)return w.featureDisabledResult("rules")}catch(X){if(X instanceof L)return N(X);throw X}try{let X=D.include_degraded!==!1,[G,Y]=await Promise.all([v.get("/rules/evidence",{query:{window:"14d"}}),v.get("/rules/provenance/aggregate")]),Q=A$(G.body),W=(S)=>{let c=Q[S];if(typeof c==="number"&&Number.isInteger(c)&&c>=0)return c;throw new L(502,"invalid_upstream_response",`${S} must be a non-negative integer`,G.requestId)},I=(S,c,x)=>{let X$=S[c];if(X$&&typeof X$==="object"&&!Array.isArray(X$))return X$;throw new L(502,"invalid_upstream_response",`${c} must be an object`,x)},H=W("total_active_rules"),q=W("zero_use_rules"),j=W("high_trigger_rules"),F=W("low_trigger_rules"),M=I(Q,"adoption",G.requestId);if(!Y.body||typeof Y.body!=="object"||Array.isArray(Y.body))throw new L(502,"invalid_upstream_response","Canonical provenance response must be an object",Y.requestId);let T=Y.body,C=I(T,"provenance",Y.requestId),Z={active_rules:H,rule_health:{total_rules:H,zero_use_rules:q,high_trigger_rules:j,low_trigger_rules:F},adoption:M,provenance:C,request_ids:{evidence:G.requestId,provenance:Y.requestId}};if(X)Z.degraded_rules=[{category:"zero_use",count:q,description:"Live rules with no observed adoption in the selected evidence window"},{category:"high_trigger",count:j,description:"Live rules with elevated trigger volume in the selected evidence window"},{category:"low_trigger",count:F,description:"Live rules with low trigger volume in the selected evidence window"}];return k(Z,G.requestId,{retry:L$})}catch(X){if(X instanceof L)return N(X,{operation:"read"});throw X}})}var SH=["typescape_list_repos","typescape_connect_repo","typescape_repo_branches","typescape_upload_reviewer_asset"];function uT($){switch($){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/gif":return"gif";case"image/webp":return"webp";default:return"bin"}}var RT=5242880,CT=new Set(["image/png","image/jpeg","image/gif","image/webp"]);function TH($,v){let w={name:"typescape_list_repos",description:"List connected repositories in the workspace. Returns paginated list of repos with their origin URLs and metadata.",inputSchema:{type:"object",properties:{include_archived:{type:"boolean",description:"Include archived repositories (default: false)"},limit:{type:"number",description:"Maximum repos to return (1-100, default: 50)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}}};$.register(w,y(async(J)=>{let D=J,X={};if(D.include_archived)X.include_archived="true";if(D.limit!==void 0)X.limit=String(D.limit);if(D.cursor)X.cursor=D.cursor;let G=await v.get("/repos",{query:X});return k(G.body,G.requestId)},{operation:"read"}));let g={name:"typescape_connect_repo",description:"Connect a Git repository by its origin URL. If the URL is a GitHub repo and a GitHub App installation exists, it will be automatically linked for branch/file browsing.",inputSchema:{type:"object",properties:{origin_url:{type:"string",description:"Git remote URL (HTTPS or SSH), e.g. https://github.com/acme/docs"},display_name:{type:"string",description:"Human-readable display name (optional, auto-derived from URL)"}},required:["origin_url"]}};$.register(g,y(async(J)=>{let D=J;if(!D.origin_url)return a("origin_url");let X={origin_url:D.origin_url};if(D.display_name)X.display_name=D.display_name;let G=await v.post("/repos",{body:X});return k(G.body,G.requestId)},{operation:"write"}));let _={name:"typescape_repo_branches",description:"List branches for a connected repository. Requires a GitHub App installation to be linked to the repo. Returns branch names and their head SHAs.",inputSchema:{type:"object",properties:{repo_id:{type:"string",description:"Repository ID (e.g. repo_abc123)"}},required:["repo_id"]}};$.register(_,y(async(J)=>{let D=J;if(!D.repo_id)return a("repo_id");let X=await v.get(`/repos/${encodeURIComponent(D.repo_id)}/branches`);return k(X.body,X.requestId)},{operation:"read"}));let b={name:"typescape_upload_reviewer_asset",description:"Upload a reviewer asset (image) to a review. Accepts base64-encoded image data (PNG, JPEG, GIF, WebP). Maximum size: 5MB. For larger files, use the CLI or web UI.",inputSchema:{type:"object",properties:{review_id:{type:"string",description:"Review ID to upload the asset to"},base64_content:{type:"string",description:"Base64-encoded image data"},mime_type:{type:"string",enum:["image/png","image/jpeg","image/gif","image/webp"],description:"MIME type of the image"},alt_text:{type:"string",description:"Alt text for the image (optional)"},filename:{type:"string",description:"Original filename (optional)"}},required:["review_id","base64_content","mime_type"]}};$.register(b,y(async(J)=>{let D=J;if(!D.review_id)return a("review_id");if(!D.base64_content)return a("base64_content");if(!D.mime_type)return a("mime_type");if(!CT.has(D.mime_type))return N(new L(415,"unsupported_media_type",`Unsupported MIME type "${D.mime_type}". Allowed: PNG, JPEG, GIF, WebP.`,"local"));if(!d8.test(D.base64_content))return N(new L(400,"invalid_base64","base64_content is not valid base64-encoded data","local"));let X;try{let W=Buffer.from(D.base64_content,"base64");X=new Uint8Array(W)}catch{return N(new L(400,"invalid_base64","Failed to decode base64_content","local"))}if(X.byteLength>RT){let W=(X.byteLength/1048576).toFixed(1);return N(new L(413,"asset_too_large",`Image is ${W}MB, exceeding the 5MB MCP limit. Use the CLI ("typescape asset upload") or web UI for larger files.`,"local"))}let G=new Blob([X],{type:D.mime_type}),Y=new FormData;if(Y.append("file",G,D.filename||`upload.${uT(D.mime_type)}`),Y.append("mime_type",D.mime_type),D.alt_text)Y.append("alt_text",D.alt_text);let Q=await v.postFormData(`/reviews/${encodeURIComponent(D.review_id)}/reviewer-assets`,Y);return k(Q.body,Q.requestId)},{operation:"write"}))}var uH=["typescape_create_collection","typescape_add_review_to_collection"],ET={type:"object",properties:{name:{type:"string",description:"Collection name (1-100 characters, unique per tenant among non-archived collections)"},description:{type:"string",description:"Optional Markdown description (max 2000 characters)"},color:{type:"string",description:"Optional hex color (e.g., #12A594)"}},required:["name"]},ZT={type:"object",properties:{collection_id:{type:"string",description:"Collection ID (e.g., col_01HXYZ...)"},review_id:{type:"string",description:"Review ID to add (opaque identifier)"}},required:["collection_id","review_id"]};function RH($,v,w){$.register({name:"typescape_create_collection",description:"Create a new collection to group related reviews. Requires collections_enabled feature flag. Returns the created collection with its ID.",inputSchema:ET},y(async(g)=>{let _=g;if(!_.name)return a("name");if(!(await w.getCapabilities()).collections_enabled)return w.featureDisabledResult("collections_enabled");let J={name:_.name};if(_.description!==void 0)J.description=_.description;if(_.color!==void 0)J.color=_.color;let D=await v.post("/collections",{body:J});return k(A$(D.body),D.requestId)})),$.register({name:"typescape_add_review_to_collection",description:"Add a review to an existing collection. Idempotent: re-adding an already-present review is a no-op. Requires collections_enabled feature flag.",inputSchema:ZT},y(async(g)=>{let _=g;if(!_.collection_id)return a("collection_id");if(!_.review_id)return a("review_id");if(!(await w.getCapabilities()).collections_enabled)return w.featureDisabledResult("collections_enabled");let J=await v.post(`/collections/${encodeURIComponent(_.collection_id)}/sessions`,{body:{session_id:_.review_id}});return k(A$(J.body),J.requestId)}))}var CH={type:"object",properties:{workspace_id:{type:"string",description:"Workspace identifier for the governance signal"},kind:{type:"string",description:"Canonical governance signal kind: pattern, canon_disagreement, rule_gap, or drafting_recommendation"},target_type:{type:"string",description:"Type of entity this governance signal targets"},target_id:{type:"string",description:"ID of the target entity"},review_id:{type:"string",description:"Related review scope when applicable"},block_id:{type:"string",description:"Optional target-context block anchor within the review"},body_md:{type:"string",description:"Governance signal body in Markdown"},body:{type:"string",description:"Compatibility alias for body_md"},source_type:{type:"string",enum:["human","agent"],description:"Provenance source type (default: agent)"},source_label:{type:"string",description:"Label identifying the source (agent, tool, or reviewer)"},submitted_by:{type:"string",description:"Identity of the submitter"},confidence:{type:"number",description:"Confidence score between 0 and 1 (optional)"},severity_hint:{type:"string",description:"Optional severity hint carried in the payload"},structured_data:{type:"object",description:"Machine-readable structured data payload (optional)"},evidence_refs:{type:"array",items:{type:"string"},description:"References to supporting evidence (optional)"},basis:{type:"object",properties:{export_sha256:{type:"string",description:"SHA256 of export used as basis"},rulepack_sha256:{type:"string",description:"SHA256 of rulepack used"},source_content_sha256:{type:"string",description:"SHA256 of source content"},basis_review_ids:{type:"array",items:{type:"string"},description:"Review IDs used as basis"},basis_finding_ids:{type:"array",items:{type:"string"},description:"Finding IDs used as basis"}},description:"Deterministic inputs the governance signal was derived from (optional)"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["workspace_id","kind","target_type","target_id","body_md","source_label","submitted_by"]},EH={type:"object",properties:{workspace_id:{type:"string",description:"Filter by workspace ID (optional)"},review_id:{type:"string",description:"Filter by review ID (optional)"},target_type:{type:"string",description:"Optional client-side target type filter"},target_id:{type:"string",description:"Optional client-side target ID filter"},kind:{type:"string",description:"Filter by governance signal kind (optional)"},state:{type:"string",description:"Filter by governance signal state (optional)"},submitted_by:{type:"string",description:"Filter by submitter identity (optional)"},limit:{type:"number",description:"Maximum items to return (1-200, default 50)"},offset:{type:"number",description:"Pagination offset (default 0)"}},required:[]},ZH={type:"object",properties:{signal_id:{type:"string",description:"Governance signal ID to retrieve"}},required:["signal_id"]},hH={type:"object",properties:{signal_id:{type:"string",description:"Governance signal ID to transition"},target_state:{type:"string",description:"Target lifecycle state"},expected_version:{type:"number",description:"Optional optimistic concurrency version"},reason:{type:"string",description:"Transition rationale (optional)"},severity:{type:"string",description:"Optional triage severity metadata"},grouping_id:{type:"string",description:"Optional triage grouping identifier"},affected_rule_document_ids:{type:"array",items:{type:"string"},description:"Affected rule documents for triage metadata"},re_triage_date:{type:"string",description:"Snooze wake-up date when applicable"},converted_working_draft_ids:{type:"array",items:{type:"string"},description:"Working drafts created from the signal when converting"},idempotency_key:{type:"string",description:"Idempotency key for safe retries (optional)"}},required:["signal_id","target_state"]};var xH=["typescape_submit_governance_signal","typescape_list_governance_signals","typescape_get_governance_signal","typescape_transition_governance_signal"];function hT($){if(!$)return;return{...$,export_sha256:$.export_sha256??$.export_hash,rulepack_sha256:$.rulepack_sha256??$.rulepack_hash,source_content_sha256:$.source_content_sha256??$.source_hash}}function xT($,v){if(!Array.isArray($))return $;return $.filter((w)=>{if(typeof w!=="object"||w===null)return!1;let g=w,_=typeof g.target==="object"&&g.target!==null?g.target:null;if(v.target_type&&_?.target_type!==v.target_type)return!1;if(v.target_id&&_?.target_id!==v.target_id)return!1;return!0})}async function lT($,v){let w=v,g=w.body_md??w.body,_=hT(w.basis);for(let[X,G]of[[w.workspace_id,"workspace_id"],[w.kind,"kind"],[w.target_type,"target_type"],[w.target_id,"target_id"],[g,"body_md"],[w.source_label,"source_label"],[w.submitted_by,"submitted_by"]]){let Y=Q$(X,G);if(Y)return Y}let b={kind:w.kind,workspace_id:w.workspace_id,target:{target_type:w.target_type,target_id:w.target_id,...(w.review_id||w.block_id)&&{target_context:{...w.review_id?{review_id:w.review_id}:{},...w.block_id?{block_id:w.block_id}:{}}}},provenance:{source_type:w.source_type??"agent",source_label:w.source_label,submitted_by:w.submitted_by,submitted_at:new Date().toISOString()},payload:{body_md:g,...w.confidence!==void 0?{confidence:w.confidence}:{},...w.severity_hint!==void 0?{severity_hint:w.severity_hint}:{},...w.structured_data!==void 0?{structured_data:w.structured_data}:{},...w.evidence_refs!==void 0?{evidence_refs:w.evidence_refs}:{}}};if(w.review_id)b.review_id=w.review_id;if(_)b.basis=_;if(w.idempotency_key)b.idempotency_key=w.idempotency_key;let J={};if(w.idempotency_key)J["Idempotency-Key"]=w.idempotency_key;let D=await $.post("/governance-signals",{body:b,headers:J});return k(D.body,D.requestId,{retry:u$(Boolean(w.idempotency_key))})}async function cT($,v){let w=v,g={};if(w.workspace_id)g.workspace_id=w.workspace_id;if(w.review_id)g.review_id=w.review_id;if(w.kind)g.kind=w.kind;if(w.state)g.state=w.state;if(w.submitted_by)g.submitted_by=w.submitted_by;if(w.limit!==void 0)g.limit=String(w.limit);if(w.offset!==void 0)g.offset=String(w.offset);let _=await $.get("/governance-signals",{query:g}),b=xT(_.body.items,w);return k({..._.body,items:b,total:Array.isArray(b)?b.length:_.body.total},_.requestId,{retry:L$})}async function yT($,v){let w=v,g=Q$(w.signal_id,"signal_id");if(g)return g;let _=Q$(w.target_state,"target_state");if(_)return _;let b={target_state:w.target_state,...w.expected_version!==void 0?{expected_version:w.expected_version}:{},...w.reason?{reason:w.reason}:{},...w.re_triage_date?{re_triage_date:w.re_triage_date}:{},...w.converted_working_draft_ids!==void 0?{converted_working_draft_ids:w.converted_working_draft_ids}:{},...w.idempotency_key?{idempotency_key:w.idempotency_key}:{}};if(w.severity!==void 0||w.grouping_id!==void 0||w.affected_rule_document_ids!==void 0)b.triage_metadata={...w.severity!==void 0?{severity:w.severity}:{},...w.grouping_id!==void 0?{grouping_id:w.grouping_id}:{},...w.affected_rule_document_ids!==void 0?{affected_rule_document_ids:w.affected_rule_document_ids}:{}};let J={};if(w.idempotency_key)J["Idempotency-Key"]=w.idempotency_key;let D=await $.post(`/governance-signals/${encodeURIComponent(w.signal_id)}/transition`,{body:b,headers:J});return k(D.body,D.requestId,{retry:u$(Boolean(w.idempotency_key))})}function lH($,v){$.register({name:"typescape_submit_governance_signal",description:"Submit a canonical governance signal for operator triage. Use this for pattern, rule-gap, canon-disagreement, and drafting-recommendation intake.",inputSchema:CH},y((w)=>lT(v,w),{operation:"write"})),$.register({name:"typescape_list_governance_signals",description:"List canonical governance signals with optional workspace, review, kind, state, or submitter filters.",inputSchema:EH},y((w)=>cT(v,w),{operation:"read"})),$.register({name:"typescape_get_governance_signal",description:"Get a single governance signal by ID. Returns full signal detail with provenance, payload, and triage state.",inputSchema:ZH},y(async(w)=>{let g=w,_=Q$(g.signal_id,"signal_id");if(_)return _;let b=await v.get(`/governance-signals/${encodeURIComponent(g.signal_id)}`);return k(b.body,b.requestId,{retry:L$})},{operation:"read"})),$.register({name:"typescape_transition_governance_signal",description:"Transition a governance signal through the canonical triage lifecycle.",inputSchema:hH},y((w)=>yT(v,w),{operation:"write"}))}var cH={type:"object",properties:{artifact_id:{type:"string",description:"Filter by advisory artifact ID (optional)"},action_type:{type:"string",enum:["advisory_submit","advisory_adopt","advisory_reject","advisory_supersede","revision_recommend"],description:"Filter by action type (optional)"},actor_id:{type:"string",description:"Filter by actor ID (optional)"},actor_type:{type:"string",enum:["agent","human","system"],description:"Filter by actor type (optional)"},review_id:{type:"string",description:"Filter by review scope (optional)"},limit:{type:"number",description:"Maximum items to return (1-200, default 50)"},offset:{type:"number",description:"Pagination offset (default 0)"}},required:[]},yH={type:"object",properties:{receipt_id:{type:"string",description:"Action receipt ID to retrieve"}},required:["receipt_id"]},mH={type:"object",properties:{artifact_id:{type:"string",description:"Advisory artifact ID to list receipts for"}},required:["artifact_id"]};var rH=["typescape_list_action_receipts","typescape_get_action_receipt","typescape_list_artifact_receipts"];function oH($,v){$.register({name:"typescape_list_action_receipts",description:"List action receipts with optional filters. Filter by artifact, action type, actor, or review scope. Receipts capture basis attestation and tool metadata for advisory operations.",inputSchema:cH},y(async(w)=>{let g=w,_={};if(g.artifact_id)_.artifact_id=g.artifact_id;if(g.action_type)_.action_type=g.action_type;if(g.actor_id)_.actor_id=g.actor_id;if(g.actor_type)_.actor_type=g.actor_type;if(g.review_id)_.review_id=g.review_id;if(g.limit!==void 0)_.limit=String(g.limit);if(g.offset!==void 0)_.offset=String(g.offset);let b=await v.get("/action-receipts",{query:_});return k(b.body,b.requestId,{retry:L$})},{operation:"read"})),$.register({name:"typescape_get_action_receipt",description:"Get a single action receipt by ID. Returns full receipt with basis snapshot, tool metadata, and result summary.",inputSchema:yH},y(async(w)=>{let g=w;if(!g.receipt_id)return a("receipt_id");let _=await v.get(`/action-receipts/${encodeURIComponent(g.receipt_id)}`);return k(_.body,_.requestId,{retry:L$})},{operation:"read"})),$.register({name:"typescape_list_artifact_receipts",description:"List all action receipts for a specific advisory artifact. Shows the full execution journal for an artifact's lifecycle.",inputSchema:mH},y(async(w)=>{let g=w;if(!g.artifact_id)return a("artifact_id");let _=await v.get(`/advisory-artifacts/${encodeURIComponent(g.artifact_id)}/receipts`);return k(_.body,_.requestId,{retry:L$})},{operation:"read"}))}var dH=["typescape_create_project","typescape_list_projects","typescape_get_project","typescape_update_project"],mT={type:"object",properties:{name:{type:"string",description:"Project name (required, 1-200 characters)"},description:{type:"string",description:"Optional project description (Markdown, max 2000 characters)"}},required:["name"]},rT={type:"object",properties:{limit:{type:"number",description:"Maximum number of projects to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from a previous response"}}},oT={type:"object",properties:{project_id:{type:"string",description:"Project ID (e.g., prj_01HXYZ...)"}},required:["project_id"]},dT={type:"object",properties:{project_id:{type:"string",description:"Project ID to update"},name:{type:"string",description:"New project name (1-200 characters)"},description:{type:"string",description:"New project description (Markdown, max 2000 characters)"}},required:["project_id"]};function tH($,v){$.register({name:"typescape_create_project",description:"Create a new project for organizing document-upload-based reviews. Returns the created project with its ID.",inputSchema:mT},y(async(w)=>{let g=w;if(!g.name)return a("name");let _={name:g.name};if(g.description!==void 0)_.description=g.description;let b=await v.post("/projects",{body:_});return k(A$(b.body),b.requestId)},{operation:"write"})),$.register({name:"typescape_list_projects",description:"List projects with optional cursor pagination. Returns an array of projects with pagination metadata.",inputSchema:rT},y(async(w)=>{let g=w,_={};if(g.limit!==void 0)_.limit=String(g.limit);if(g.cursor!==void 0)_.cursor=g.cursor;let b=await v.get("/projects",{query:_});return k(b.body,b.requestId)},{operation:"read"})),$.register({name:"typescape_get_project",description:"Get a project by ID. Returns the project details including configuration.",inputSchema:oT},y(async(w)=>{let g=w;if(!g.project_id)return a("project_id");let _=await v.get(`/projects/${encodeURIComponent(g.project_id)}`);return k(A$(_.body),_.requestId)},{operation:"read"})),$.register({name:"typescape_update_project",description:"Update a project's name or description. Only provided fields are changed; omitted fields are left unchanged.",inputSchema:dT},y(async(w)=>{let g=w;if(!g.project_id)return a("project_id");let _={};if(g.name!==void 0)_.name=g.name;if(g.description!==void 0)_.description=g.description;let b=await v.request("PATCH",`/projects/${encodeURIComponent(g.project_id)}`,{body:_});return k(A$(b.body),b.requestId)},{operation:"write"}))}var pH=["typescape_create_template","typescape_list_templates","typescape_get_template"],tT={type:"object",properties:{name:{type:"string",description:"Template name (required, 1-200 characters)"},description:{type:"string",description:"Optional template description"},source_type:{type:"string",enum:["git","upload"],description:"Source type for reviews created from this template (default: git)"},repo_id:{type:"string",description:"Repository ID (required when source_type is git)"},project_id:{type:"string",description:"Project ID (required when source_type is upload)"},config:{type:"object",description:"Optional configuration object for the template (e.g., default participants, rules, settings)"}},required:["name"]},pT={type:"object",properties:{limit:{type:"number",description:"Maximum number of templates to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from a previous response"}}},eT={type:"object",properties:{template_id:{type:"string",description:"Template ID (e.g., tpl_01HXYZ...)"}},required:["template_id"]};function eH($,v){$.register({name:"typescape_create_template",description:"Create a review template for repeatable review creation. Templates capture default settings so operators don't re-specify parameters each time. Returns the created template with its ID.",inputSchema:tT},y(async(w)=>{let g=w;if(!g.name)return a("name");let _={name:g.name};if(g.description!==void 0)_.description=g.description;if(g.source_type!==void 0)_.source_type=g.source_type;if(g.repo_id!==void 0)_.repo_id=g.repo_id;if(g.project_id!==void 0)_.project_id=g.project_id;if(g.config!==void 0)_.config=g.config;let b=await v.post("/session-templates",{body:_});return k(A$(b.body),b.requestId)},{operation:"write"})),$.register({name:"typescape_list_templates",description:"List review templates with optional cursor pagination. Returns an array of templates with pagination metadata.",inputSchema:pT},y(async(w)=>{let g=w,_={};if(g.limit!==void 0)_.limit=String(g.limit);if(g.cursor!==void 0)_.cursor=g.cursor;let b=await v.get("/session-templates",{query:_});return k(b.body,b.requestId)},{operation:"read"})),$.register({name:"typescape_get_template",description:"Get a review template by ID. Returns the template details including configuration.",inputSchema:eT},y(async(w)=>{let g=w;if(!g.template_id)return a("template_id");let _=await v.get(`/session-templates/${encodeURIComponent(g.template_id)}`);return k(A$(_.body),_.requestId)},{operation:"read"}))}var aH=["typescape_list_issues","typescape_get_issue","typescape_update_issue"],aT={type:"object",properties:{session_id:{type:"string",description:"Review ID to list issues for (required)"},status:{type:"string",enum:["open","closed","all"],description:"Filter by issue status (default: all)"},severity:{type:"string",enum:["critical","high","medium","low","info"],description:"Filter by severity level"},limit:{type:"number",description:"Maximum number of issues to return (default: 20, max: 100)"},offset:{type:"number",description:"Offset for pagination (default: 0)"}},required:["session_id"]},sT={type:"object",properties:{issue_id:{type:"string",description:"Issue ID (e.g., iss_01HXYZ...)"}},required:["issue_id"]},$u={type:"object",properties:{issue_id:{type:"string",description:"Issue ID to update"},status:{type:"string",enum:["open","closed"],description:"New status for the issue"},assignee:{type:"string",description:"User ID or email to assign the issue to (null to unassign)"},priority:{type:"string",enum:["critical","high","medium","low"],description:"New priority level"}},required:["issue_id"]};function sH($,v){$.register({name:"typescape_list_issues",description:"List issues for a review. Supports filtering by status and severity, with offset-based pagination. Returns issues ordered by creation time descending.",inputSchema:aT},y(async(w)=>{let g=w;if(!g.session_id)return a("session_id");let _={};if(g.status!==void 0)_.status=g.status;if(g.severity!==void 0)_.severity=g.severity;if(g.limit!==void 0)_.limit=String(g.limit);if(g.offset!==void 0)_.offset=String(g.offset);let b=await v.get("/issues",{query:{..._,session_id:g.session_id}});return k(b.body,b.requestId)},{operation:"read"})),$.register({name:"typescape_get_issue",description:"Get an issue by ID. Returns the full issue details including anchors, associated threads, and current status.",inputSchema:sT},y(async(w)=>{let g=w;if(!g.issue_id)return a("issue_id");let _=await v.get(`/issues/${encodeURIComponent(g.issue_id)}`);return k(A$(_.body),_.requestId)},{operation:"read"})),$.register({name:"typescape_update_issue",description:"Update an issue's status, assignee, or priority. Only provided fields are changed; omitted fields are left unchanged.",inputSchema:$u},y(async(w)=>{let g=w;if(!g.issue_id)return a("issue_id");let _={};if(g.status!==void 0)_.status=g.status;if(g.assignee!==void 0)_.assignee=g.assignee;if(g.priority!==void 0)_.priority=g.priority;let b=await v.request("PATCH",`/issues/${encodeURIComponent(g.issue_id)}`,{body:_});return k(A$(b.body),b.requestId)},{operation:"write"}))}var $q=["typescape_list_webhooks","typescape_create_webhook","typescape_delete_webhook"],vu={type:"object",properties:{status:{type:"string",description:"Filter by webhook status. One of: active, paused, disabled."},limit:{type:"integer",description:"Maximum number of results to return (default 25)."}},required:[]},_u={type:"object",properties:{url:{type:"string",description:"The HTTPS URL to deliver webhook events to."},events:{type:"array",items:{type:"string"},description:'Array of event types to subscribe to (e.g., ["review.created", "thread.resolved"]).'},description:{type:"string",description:"Optional human-readable description of the webhook."}},required:["url","events"]},wu={type:"object",properties:{webhook_id:{type:"string",description:"The webhook subscription ID to delete."}},required:["webhook_id"]};function vq($,v){$.register({name:"typescape_list_webhooks",description:"List webhook subscriptions for the current tenant. Use this to audit which external systems receive event notifications and verify delivery targets before creating new subscriptions. Returns subscription details including URL, events, and status.",inputSchema:vu},y(async(w)=>{let g=w,_=new URLSearchParams;if(g.status)_.set("status",g.status);if(g.limit)_.set("limit",String(g.limit));let b=_.toString(),J=b?`/webhooks?${b}`:"/webhooks",D=await v.get(J);return k(D.body,D.requestId)},{operation:"read"})),$.register({name:"typescape_create_webhook",description:"Create a new webhook subscription to receive event notifications at an HTTPS endpoint. Common events include review.created, thread.resolved, and check_run.completed. Use this to integrate Typescape with external CI/CD pipelines or notification systems.",inputSchema:_u},y(async(w)=>{let g=w;if(!g.url)return a("url");if(!g.events||g.events.length===0)return N(new L(400,"missing_param","Missing required parameter: events (must be a non-empty array)","local"));let _=await v.post("/webhooks",{body:{url:g.url,events:g.events,description:g.description}});return k(_.body,_.requestId)},{operation:"write"})),$.register({name:"typescape_delete_webhook",description:"Delete a webhook subscription by ID, permanently stopping all deliveries to the target URL. Use typescape_list_webhooks first to find the subscription ID. This action cannot be undone.",inputSchema:wu},y(async(w)=>{let g=w;if(!g.webhook_id)return a("webhook_id");let _=await v.request("DELETE",`/webhooks/${encodeURIComponent(g.webhook_id)}`,{});return k({deleted:!0,webhook_id:g.webhook_id},_.requestId)},{operation:"write"}))}var _q=["typescape_list_events"],gu={type:"object",properties:{review_id:{type:"string",description:"Review ID to list events for."},cursor:{type:"string",description:"Pagination cursor from a previous response. Events after this cursor are returned."},limit:{type:"integer",description:"Maximum number of events to return (default 50)."}},required:["review_id"]};function wq($,v){$.register({name:"typescape_list_events",description:"List timeline events for a review. Use this to monitor review activity without re-fetching full review data. Returns an ordered list of events (comments, thread changes, status changes, check completions) with cursor-based pagination. Pass the cursor from the previous response for efficient incremental polling.",inputSchema:gu},y(async(w)=>{let g=w;if(!g.review_id)return a("review_id");let _=new URLSearchParams;if(g.cursor)_.set("cursor",g.cursor);if(g.limit)_.set("limit",String(g.limit));let b=_.toString(),J=`/reviews/${encodeURIComponent(g.review_id)}/events${b?`?${b}`:""}`,D=await v.get(J);return k(D.body,D.requestId)},{operation:"read"}))}var gq=`---
182
182
  name: agent-review-loop
183
183
  version: "1.0.0"
184
184
  summary: "Run the end-to-end agent review loop while keeping user, reviewer, and operator decisions explicit."
@@ -695,7 +695,7 @@ existing rule is wrong or a new rule is needed.
695
695
  - \`revise-from-feedback\`
696
696
  - \`challenge-rule\`
697
697
  - \`propose-rule\`
698
- `;var Qn=`---
698
+ `;var bq=`---
699
699
  name: challenge-rule
700
700
  version: "1.0.0"
701
701
  summary: "Challenge an active rule with supporting evidence when a finding appears incorrect or overly broad."
@@ -908,7 +908,7 @@ If the operator rejects the challenge, the advisory status changes to
908
908
  - \`fetch-rules-and-check\` — Understand the rules before challenging
909
909
  - \`propose-rule\` — Propose a replacement rule if challenging successfully
910
910
  - \`revise-from-feedback\` — Revise content if the challenge is rejected
911
- `;var Wn=`---
911
+ `;var Uq=`---
912
912
  name: create-review
913
913
  version: "1.0.0"
914
914
  summary: "Create a content review from a Git repository file and share it with reviewers."
@@ -1333,7 +1333,7 @@ using an \`idempotency_key\`, so retries are safe.
1333
1333
  - \`fetch-rules-and-check\` — Fetch applicable rules and check content
1334
1334
  - \`challenge-rule\` — Challenge a rule that produced a questionable finding
1335
1335
  - \`propose-rule\` — Propose a new rule from repeated findings
1336
- `;var Hn=`---
1336
+ `;var Jq=`---
1337
1337
  name: fetch-rules-and-check
1338
1338
  version: "1.1.0"
1339
1339
  summary: "Fetch the applicable rule bundle, use checks as a signal, and then perform the real agent evaluation block by block."
@@ -1691,7 +1691,7 @@ Retry once before escalating.
1691
1691
  - \`agent-review-loop\`
1692
1692
  - \`reviewer-feedback-loop\`
1693
1693
  - \`revise-from-feedback\`
1694
- `;var nn=`---
1694
+ `;var Dq=`---
1695
1695
  name: operator-advisory-triage
1696
1696
  version: "1.0.0"
1697
1697
  summary: "Evaluate agent-submitted advisories and decide adopt vs reject with explicit basis checking."
@@ -1825,7 +1825,7 @@ That keeps the authoritative path auditable.
1825
1825
  - \`agent-review-loop\`
1826
1826
  - \`reviewer-feedback-loop\`
1827
1827
  - \`revise-from-feedback\`
1828
- `;var qn=`---
1828
+ `;var Xq=`---
1829
1829
  name: propose-rule
1830
1830
  version: "1.0.0"
1831
1831
  summary: "Create a draft rule review from repeated findings or reviewer feedback."
@@ -1918,21 +1918,20 @@ instead.
1918
1918
 
1919
1919
  ### 3. Draft the rule
1920
1920
 
1921
- Write the rule in Typescape's rule block format:
1921
+ Write the rule in Typescape's markdown import format. Each rule is a list
1922
+ item with a strength marker in brackets:
1922
1923
 
1923
1924
  \`\`\`
1924
- **<strength>** | <category>
1925
- <Rule text describing the standard.>
1925
+ - [<strength>] <Rule text describing the standard.>
1926
1926
  \`\`\`
1927
1927
 
1928
- **Choosing strength**:
1928
+ Group rules under markdown headings to provide category context.
1929
1929
 
1930
- - \`MUST\` / \`MUST NOT\` — for requirements that are always mandatory
1931
- - \`SHOULD\` — for recommended practices that permit justified exceptions
1932
- - \`MAY\` — for optional guidance
1930
+ **Choosing strength**:
1933
1931
 
1934
- **Choosing category**: \`tone\`, \`formatting\`, \`terminology\`, \`accuracy\`, or
1935
- \`compliance\`.
1932
+ - \`must\` / \`must not\` — for requirements that are always mandatory
1933
+ - \`should\` — for recommended practices that permit justified exceptions
1934
+ - \`may\` — for optional guidance
1936
1935
 
1937
1936
  **Rule text guidelines**:
1938
1937
 
@@ -1945,10 +1944,10 @@ Write the rule in Typescape's rule block format:
1945
1944
 
1946
1945
  **Example**:
1947
1946
 
1948
- \`\`\`
1949
- **should** | terminology
1950
- Use "select" instead of "click" when describing user interactions with UI
1951
- elements, to remain input-method neutral (keyboard, touch, assistive tech).
1947
+ \`\`\`markdown
1948
+ ## Terminology
1949
+
1950
+ - [should] Use "select" instead of "click" when describing user interactions with UI elements, to remain input-method neutral (keyboard, touch, assistive tech).
1952
1951
  \`\`\`
1953
1952
 
1954
1953
  ### 4. Set applicability
@@ -1974,7 +1973,7 @@ the rule proves valuable.
1974
1973
 
1975
1974
  \`\`\`json
1976
1975
  {
1977
- "content": "**should** | terminology\\nUse \\"select\\" instead of \\"click\\" when describing user interactions with UI elements, to remain input-method neutral.",
1976
+ "content": "## Terminology\\n\\n- [should] Use \\"select\\" instead of \\"click\\" when describing user interactions with UI elements, to remain input-method neutral.",
1978
1977
  "title": "<concise rule review title>",
1979
1978
  "applicability": {
1980
1979
  "content_type": "documentation"
@@ -1989,16 +1988,41 @@ the rule proves valuable.
1989
1988
  **Expected output**: A draft rule review payload with:
1990
1989
 
1991
1990
  - \`review_id\`
1992
- - \`state\` — typically \`draft\`
1991
+ - \`state\` — always \`draft\` (see step 5a for activation)
1993
1992
  - parsed rule metadata for the imported blocks
1994
1993
 
1995
1994
  **On error**:
1996
1995
 
1997
- - \`422\` (invalid rule format): Verify the strength marker is bold
1998
- (\`**must**\`, not \`must\`) and the category separator is \`|\`.
1996
+ - \`422\` (invalid rule format): Verify each rule is a list item starting
1997
+ with \`- [strength]\` where strength is \`must\`, \`should\`, or \`may\`.
1999
1998
  - Use \`preview: true\` first if you want to validate parsing before creating the
2000
1999
  draft review.
2001
2000
 
2001
+ ### 5a. Activate the rule review (operator action)
2002
+
2003
+ Rule imports always create the review in \`draft\` state. Rules in a draft
2004
+ review are **not** enforced until an operator activates the review.
2005
+
2006
+ To activate (typically done by an operator, or by an agent with operator
2007
+ credentials):
2008
+
2009
+ **API**: \`PATCH /v1/reviews/<review_id>\`
2010
+
2011
+ **Body**:
2012
+
2013
+ \`\`\`json
2014
+ {
2015
+ "state": "active"
2016
+ }
2017
+ \`\`\`
2018
+
2019
+ Once activated, the rules in the review become enforceable and will appear
2020
+ in \`GET /v1/rules\` responses for matching content reviews.
2021
+
2022
+ > **Note**: If you are an agent proposing a rule but do not have operator
2023
+ > privileges, stop after step 5 and notify the operator that a draft rule
2024
+ > review is ready for their review and activation.
2025
+
2002
2026
  ### 6. Submit supporting advisory (optional)
2003
2027
 
2004
2028
  For complex proposals, submit an advisory artifact with detailed rationale.
@@ -2081,7 +2105,7 @@ rule review as evidence.
2081
2105
  - \`fetch-rules-and-check\` — Check current rules before proposing new ones
2082
2106
  - \`create-review\` — Create reviews that generate the findings evidence
2083
2107
  - \`revise-from-feedback\` — Revise content using existing rules
2084
- `;var In=`---
2108
+ `;var Gq=`---
2085
2109
  name: revise-from-feedback
2086
2110
  version: "1.0.0"
2087
2111
  summary: "Consume a handoff bundle and produce a revision plan addressing review findings."
@@ -2290,7 +2314,7 @@ If still conflicting, flag for human resolution.
2290
2314
  - \`create-review\` — Create the initial review that produces findings
2291
2315
  - \`fetch-rules-and-check\` — Fetch rules and run checks before revising
2292
2316
  - \`propose-rule\` — Propose a new rule from patterns found during revision
2293
- `;var Bn=`---
2317
+ `;var Yq=`---
2294
2318
  name: reviewer-feedback-loop
2295
2319
  version: "1.0.0"
2296
2320
  summary: "Help a human reviewer turn live findings into a revision, escalation, or governance action without overwriting reviewer judgment."
@@ -2412,4 +2436,4 @@ bury that in one document revision. Escalate it:
2412
2436
  - \`revise-from-feedback\`
2413
2437
  - \`challenge-rule\`
2414
2438
  - \`propose-rule\`
2415
- `;var IT=[{filename:"agent-review-loop.md",content:Yn},{filename:"challenge-rule.md",content:Qn},{filename:"create-review.md",content:Wn},{filename:"fetch-rules-and-check.md",content:Hn},{filename:"operator-advisory-triage.md",content:nn},{filename:"propose-rule.md",content:qn},{filename:"revise-from-feedback.md",content:In},{filename:"reviewer-feedback-loop.md",content:Bn}];function hU($){let v=$.trim();if(v.startsWith('"')&&v.endsWith('"')||v.startsWith("'")&&v.endsWith("'"))return v.slice(1,-1);return v}function BT($){let v=$.trim();if(v.startsWith("[")&&v.endsWith("]"))return v.slice(1,-1).split(",").map((w)=>hU(w)).filter((w)=>w.length>0);return hU(v)}function LT($){let v=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec($);if(!v)return null;let w={},g=v[1].split(/\r?\n/);for(let _=0;_<g.length;){let J=g[_].trim();if(J.length===0||J.startsWith("#")){_+=1;continue}let D=/^([a-zA-Z0-9_]+):(?:\s*(.*))?$/.exec(J);if(!D){_+=1;continue}let X=D.at(1);if(typeof X!=="string"||X.length===0){_+=1;continue}let G=(D.at(2)??"").trim();if(G.length>0){w[X]=BT(G),_+=1;continue}_+=1;let Y=[],Q={};while(_<g.length){let H=g[_],I=H.trim(),q=/^\s*/.exec(H)?.[0].length??0;if(I.length===0){_+=1;continue}if(q<2)break;if(I.startsWith("- ")){Y.push(hU(I.slice(2))),_+=1;continue}let W=/^([a-zA-Z0-9_]+):(?:\s*(.*))?$/.exec(I);if(!W){_+=1;continue}let B=W.at(1);if(typeof B!=="string"||B.length===0){_+=1;continue}Q[B]=hU(W.at(2)??""),_+=1}if(Y.length>0)w[X]=Y;else if(Object.keys(Q).length>0)w[X]=Q;else w[X]=""}return w}function pG($){if(!Array.isArray($))return;return $.filter((v)=>typeof v==="string"&&v.length>0)}function VT($){if(typeof $!=="object"||$===null||Array.isArray($))return;let v=Object.entries($).filter((w)=>typeof w[1]==="string");if(v.length===0)return;return Object.fromEntries(v)}function jT($){let v=LT($.content);if(v===null)throw Error(`Bundled playbook ${$.filename} is missing required frontmatter`);let w=$.filename.replace(/\.md$/i,""),g=typeof v.name==="string"&&v.name.length>0?v.name:w,_=pG(v.workflows)??[];return{name:g,version:typeof v.version==="string"&&v.version.length>0?v.version:"0.0.0",summary:typeof v.summary==="string"?v.summary:"",workflows:_,trust_level:typeof v.trust_level==="string"&&v.trust_level.length>0?v.trust_level:"first_party",author:typeof v.author==="string"&&v.author.length>0?v.author:"Typescape",content:$.content,compatible_api_version:typeof v.compatible_api_version==="string"&&v.compatible_api_version.length>0?v.compatible_api_version:void 0,compatible_artifacts:VT(v.compatible_artifacts),tags:pG(v.tags),min_tools_required:pG(v.min_tools_required)}}var Ln=IT.map(jT).sort(($,v)=>$.name.localeCompare(v.name));function Vn($={}){return Ln.filter((v)=>{if($.workflow&&!v.workflows.includes($.workflow))return!1;if($.trustLevel&&v.trust_level.toLowerCase()!==$.trustLevel.toLowerCase())return!1;return!0}).map((v)=>({...v}))}function jn($){let v=$.trim().toLowerCase();if(v.length===0)return null;let w=Ln.find((g)=>g.name.toLowerCase()===v);return w===void 0?null:{...w}}var Kn=["typescape_list_playbooks","typescape_get_playbook"],FT={type:"object",properties:{workflow:{type:"string",description:"Filter by workflow category (e.g., 'review-creation', 'rule-governance'). Returns only playbooks that cover this workflow."},trust_level:{type:"string",description:"Filter by trust level: first_party, tenant_local, or third_party."}},required:[]},KT={type:"object",properties:{name:{type:"string",description:"Playbook name (e.g., 'create-review', 'revise-from-feedback'). Use typescape_list_playbooks to discover available names."}},required:["name"]};function Fn($){return $.status===0||$.status===404||$.code==="not_found"}function On($,v){$.register({name:"typescape_list_playbooks",description:"List available playbook packages for agent workflows. Playbooks are instruction sets that guide agents through canonical Typescape operations like creating reviews, revising from feedback, checking rules, challenging rules, and proposing new rules. Use this to discover which playbooks are available before starting a workflow. Returns name, version, summary, workflows, and trust level for each.",inputSchema:FT},async(w)=>{let g=w;try{let _=new URLSearchParams;if(g.workflow)_.set("workflow",g.workflow);if(g.trust_level)_.set("trust_level",g.trust_level);let b=_.toString(),J=b?`/playbooks?${b}`:"/playbooks",D=await v.get(J);return i(D.body,D.requestId)}catch(_){if(_ instanceof L&&Fn(_)){let b=Vn({workflow:g.workflow,trustLevel:g.trust_level});return i({items:b,source:"bundled_local"},CU)}if(_ instanceof L)return O(_);throw _}}),$.register({name:"typescape_get_playbook",description:"Get the full content of a playbook package by name. Returns the complete Markdown instruction set including frontmatter metadata, prerequisites, step-by-step workflow guidance with tool invocations, expected outputs, error handling, and completion criteria. Use typescape_list_playbooks first to discover available names.",inputSchema:KT},async(w)=>{let g=w;if(!g.name)return e("name");try{let _=`/playbooks/${encodeURIComponent(g.name)}`,b=await v.get(_);return i(b.body,b.requestId)}catch(_){if(_ instanceof L&&Fn(_)){let b=jn(g.name);if(b)return i(b,CU)}if(_ instanceof L)return O(_);throw _}})}var _d=[...CW,...dW,...qH,...BH,...PH,...uH,...RH,...oH,...sH,...vn,...wn,...bn,...Jn,...Xn,...Kn];function eG($,v){let w=kW(v);ZW($,v),eW($,v),IH($,v,w),LH($,v,w),SH($,v,w),TH($,v),CH($,v,w),dH($,v),$n($,v),_n($,v),gn($,v),Un($,v),Dn($,v),Gn($,v),On($,v)}var kn={TYPESCAPE_API_KEY:"Operator API token for authenticating with the Typescape API",TYPESCAPE_BASE_URL:"Base URL of the Typescape API server (e.g., https://review.example.com)"};class cU extends Error{missingEnvVars;constructor($){super("Missing required environment variables");this.missingEnvVars=$;this.name="McpConfigError"}}function _1($,v){let w=$[v];if(!w)return;let g=w.trim();return g.length>0?g:void 0}function OT($){let v=[];if(!_1($,"TYPESCAPE_API_KEY"))v.push(`TYPESCAPE_API_KEY: ${kn.TYPESCAPE_API_KEY}`);if(!_1($,"TYPESCAPE_BASE_URL"))v.push(`TYPESCAPE_BASE_URL: ${kn.TYPESCAPE_BASE_URL}`);return v}function Nn($,v=ww){if(!$||$.trim().length===0)return{timeoutMs:v,warning:null};let w=$.trim();if(/^\d+$/.test(w)){let g=Number(w);if(g>=1000)return{timeoutMs:g,warning:null}}return{timeoutMs:v,warning:`Warning: Invalid TYPESCAPE_TIMEOUT_MS='${$}'. Using default ${v}ms.`}}function Pn($=process.env,v=ww){let w=_1($,"TYPESCAPE_API_KEY"),g=_1($,"TYPESCAPE_BASE_URL");if(!w||!g)throw new cU(OT($));let _=_1($,"TYPESCAPE_TIMEOUT_MS"),b=Nn(_,v);return{apiKey:w,baseUrl:g,timeoutMs:b.timeoutMs,timeoutWarning:b.warning}}async function iT(){let $;try{$=Pn()}catch(g){if(g instanceof cU){console.error("Error: Missing required environment variables:");for(let _ of g.missingEnvVars)console.error(` - ${_}`);process.exit(1)}throw g}if($.timeoutWarning)console.warn($.timeoutWarning);let v=xY($.baseUrl,$.apiKey,$.timeoutMs),w=$8();eG(w,v),await iW(w)}if(Qw.main==Qw.module)iT().catch(($)=>{console.error("Fatal error:",$ instanceof Error?$.message:String($)),process.exit(1)});export{Nn as resolveTimeoutMs};
2439
+ `;var Wu=[{filename:"agent-review-loop.md",content:gq},{filename:"challenge-rule.md",content:bq},{filename:"create-review.md",content:Uq},{filename:"fetch-rules-and-check.md",content:Jq},{filename:"operator-advisory-triage.md",content:Dq},{filename:"propose-rule.md",content:Xq},{filename:"revise-from-feedback.md",content:Gq},{filename:"reviewer-feedback-loop.md",content:Yq}];function cU($){let v=$.trim();if(v.startsWith('"')&&v.endsWith('"')||v.startsWith("'")&&v.endsWith("'"))return v.slice(1,-1);return v}function Hu($){let v=$.trim();if(v.startsWith("[")&&v.endsWith("]"))return v.slice(1,-1).split(",").map((w)=>cU(w)).filter((w)=>w.length>0);return cU(v)}function qu($){let v=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec($);if(!v)return null;let w={},g=v[1].split(/\r?\n/);for(let _=0;_<g.length;){let J=g[_].trim();if(J.length===0||J.startsWith("#")){_+=1;continue}let D=/^([a-zA-Z0-9_]+):(?:\s*(.*))?$/.exec(J);if(!D){_+=1;continue}let X=D.at(1);if(typeof X!=="string"||X.length===0){_+=1;continue}let G=(D.at(2)??"").trim();if(G.length>0){w[X]=Hu(G),_+=1;continue}_+=1;let Y=[],Q={};while(_<g.length){let W=g[_],I=W.trim(),H=/^\s*/.exec(W)?.[0].length??0;if(I.length===0){_+=1;continue}if(H<2)break;if(I.startsWith("- ")){Y.push(cU(I.slice(2))),_+=1;continue}let q=/^([a-zA-Z0-9_]+):(?:\s*(.*))?$/.exec(I);if(!q){_+=1;continue}let j=q.at(1);if(typeof j!=="string"||j.length===0){_+=1;continue}Q[j]=cU(q.at(2)??""),_+=1}if(Y.length>0)w[X]=Y;else if(Object.keys(Q).length>0)w[X]=Q;else w[X]=""}return w}function vG($){if(!Array.isArray($))return;return $.filter((v)=>typeof v==="string"&&v.length>0)}function Iu($){if(typeof $!=="object"||$===null||Array.isArray($))return;let v=Object.entries($).filter((w)=>typeof w[1]==="string");if(v.length===0)return;return Object.fromEntries(v)}function Bu($){let v=qu($.content);if(v===null)throw Error(`Bundled playbook ${$.filename} is missing required frontmatter`);let w=$.filename.replace(/\.md$/i,""),g=typeof v.name==="string"&&v.name.length>0?v.name:w,_=vG(v.workflows)??[];return{name:g,version:typeof v.version==="string"&&v.version.length>0?v.version:"0.0.0",summary:typeof v.summary==="string"?v.summary:"",workflows:_,trust_level:typeof v.trust_level==="string"&&v.trust_level.length>0?v.trust_level:"first_party",author:typeof v.author==="string"&&v.author.length>0?v.author:"Typescape",content:$.content,compatible_api_version:typeof v.compatible_api_version==="string"&&v.compatible_api_version.length>0?v.compatible_api_version:void 0,compatible_artifacts:Iu(v.compatible_artifacts),tags:vG(v.tags),min_tools_required:vG(v.min_tools_required)}}var Qq=Wu.map(Bu).sort(($,v)=>$.name.localeCompare(v.name));function Wq($={}){return Qq.filter((v)=>{if($.workflow&&!v.workflows.includes($.workflow))return!1;if($.trustLevel&&v.trust_level.toLowerCase()!==$.trustLevel.toLowerCase())return!1;return!0}).map((v)=>({...v}))}function Hq($){let v=$.trim().toLowerCase();if(v.length===0)return null;let w=Qq.find((g)=>g.name.toLowerCase()===v);return w===void 0?null:{...w}}var Iq=["typescape_list_playbooks","typescape_get_playbook"],Lu={type:"object",properties:{workflow:{type:"string",description:"Filter by workflow category (e.g., 'review-creation', 'rule-governance'). Returns only playbooks that cover this workflow."},trust_level:{type:"string",description:"Filter by trust level: first_party, tenant_local, or third_party."}},required:[]},Vu={type:"object",properties:{name:{type:"string",description:"Playbook name (e.g., 'create-review', 'revise-from-feedback'). Use typescape_list_playbooks to discover available names."}},required:["name"]};function qq($){return $.status===0||$.status===404||$.code==="not_found"}function Bq($,v){$.register({name:"typescape_list_playbooks",description:"List available playbook packages for agent workflows. Playbooks are instruction sets that guide agents through canonical Typescape operations like creating reviews, revising from feedback, checking rules, challenging rules, and proposing new rules. Use this to discover which playbooks are available before starting a workflow. Returns name, version, summary, workflows, and trust level for each.",inputSchema:Lu},async(w)=>{let g=w;try{let _=new URLSearchParams;if(g.workflow)_.set("workflow",g.workflow);if(g.trust_level)_.set("trust_level",g.trust_level);let b=_.toString(),J=b?`/playbooks?${b}`:"/playbooks",D=await v.get(J);return k(D.body,D.requestId)}catch(_){if(_ instanceof L&&qq(_)){let b=Wq({workflow:g.workflow,trustLevel:g.trust_level});return k({items:b,source:"bundled_local"},ZU)}if(_ instanceof L)return N(_);throw _}}),$.register({name:"typescape_get_playbook",description:"Get the full content of a playbook package by name. Returns the complete Markdown instruction set including frontmatter metadata, prerequisites, step-by-step workflow guidance with tool invocations, expected outputs, error handling, and completion criteria. Use typescape_list_playbooks first to discover available names.",inputSchema:Vu},async(w)=>{let g=w;if(!g.name)return a("name");try{let _=`/playbooks/${encodeURIComponent(g.name)}`,b=await v.get(_);return k(b.body,b.requestId)}catch(_){if(_ instanceof L&&qq(_)){let b=Hq(g.name);if(b)return k(b,ZU)}if(_ instanceof L)return N(_);throw _}})}var ed=[...xW,...sW,...jH,...KH,...iH,...SH,...uH,...xH,...rH,...dH,...pH,...aH,...$q,..._q,...Iq];function _G($,v){let w=MW(v);cW($,v),vH($,v),FH($,v,w),OH($,v,w),fH($,v,w),TH($,v),RH($,v,w),lH($,v),oH($,v),tH($,v),eH($,v),sH($,v),vq($,v),wq($,v),Bq($,v)}var Lq={TYPESCAPE_API_KEY:"Operator API token for authenticating with the Typescape API",TYPESCAPE_BASE_URL:"Base URL of the Typescape API server (e.g., https://review.example.com)"};class yU extends Error{missingEnvVars;constructor($){super("Missing required environment variables");this.missingEnvVars=$;this.name="McpConfigError"}}function gb($,v){let w=$[v];if(!w)return;let g=w.trim();return g.length>0?g:void 0}function ju($){let v=[];if(!gb($,"TYPESCAPE_API_KEY"))v.push(`TYPESCAPE_API_KEY: ${Lq.TYPESCAPE_API_KEY}`);if(!gb($,"TYPESCAPE_BASE_URL"))v.push(`TYPESCAPE_BASE_URL: ${Lq.TYPESCAPE_BASE_URL}`);return v}function Vq($,v=ww){if(!$||$.trim().length===0)return{timeoutMs:v,warning:null};let w=$.trim();if(/^\d+$/.test(w)){let g=Number(w);if(g>=1000)return{timeoutMs:g,warning:null}}return{timeoutMs:v,warning:`Warning: Invalid TYPESCAPE_TIMEOUT_MS='${$}'. Using default ${v}ms.`}}function jq($=process.env,v=ww){let w=gb($,"TYPESCAPE_API_KEY"),g=gb($,"TYPESCAPE_BASE_URL");if(!w||!g)throw new yU(ju($));let _=gb($,"TYPESCAPE_TIMEOUT_MS"),b=Vq(_,v);return{apiKey:w,baseUrl:g,timeoutMs:b.timeoutMs,timeoutWarning:b.warning}}async function Fu(){let $;try{$=jq()}catch(g){if(g instanceof yU){console.error("Error: Missing required environment variables:");for(let _ of g.missingEnvVars)console.error(` - ${_}`);process.exit(1)}throw g}if($.timeoutWarning)console.warn($.timeoutWarning);let v=m7($.baseUrl,$.apiKey,$.timeoutMs),w=bG();_G(w,v),await AW(w)}if(Ww.main==Ww.module)Fu().catch(($)=>{console.error("Fatal error:",$ instanceof Error?$.message:String($)),process.exit(1)});export{Vq as resolveTimeoutMs};