@anthropic-ai/claude-agent-sdk 0.3.150 → 0.3.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assistant.mjs +90 -90
- package/bridge.mjs +62 -62
- package/browser-sdk.js +2 -2
- package/manifest.json +19 -19
- package/manifest.zst.json +23 -23
- package/package.json +10 -10
- package/sdk-tools.d.ts +8 -0
- package/sdk.d.ts +69 -5
- package/sdk.mjs +4 -4
package/browser-sdk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
|
|
2
2
|
|
|
3
|
-
// Version: 0.3.
|
|
3
|
+
// Version: 0.3.152
|
|
4
4
|
var $q=Object.create;var{getPrototypeOf:Xq,defineProperty:hQ,getOwnPropertyNames:Jq}=Object;var zq=Object.prototype.hasOwnProperty;function Qq($){return this[$]}var Yq,Wq,RU=($,X,J)=>{var Q=$!=null&&typeof $==="object";if(Q){var z=X?Yq??=new WeakMap:Wq??=new WeakMap,Y=z.get($);if(Y)return Y}J=$!=null?$q(Xq($)):{};let W=X||!$||!$.__esModule?hQ(J,"default",{value:$,enumerable:!0}):J;for(let G of Jq($))if(!zq.call(W,G))hQ(W,G,{get:Qq.bind($,G),enumerable:!0});if(Q)z.set($,W);return W};var x=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var Gq=($)=>$;function Uq($,X){this[$]=Gq.bind(null,X)}var H6=($,X)=>{for(var J in X)hQ($,J,{get:X[J],enumerable:!0,configurable:!0,set:Uq.bind(X,J)})};var Kq=($,X)=>()=>($&&(X=$($=0)),X);var c6=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(X,J)=>(typeof require<"u"?require:X)[J]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')}),wq=Symbol.dispose||Symbol.for("Symbol.dispose"),Vq=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),F$=($,X,J)=>{if(X!=null){if(typeof X!=="object"&&typeof X!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var Q;if(J)Q=X[Vq];if(Q===void 0)Q=X[wq];if(typeof Q!=="function")throw TypeError("Object not disposable");$.push([J,Q,X])}else if(J)$.push([J]);return X},M$=($,X,J)=>{var Q=typeof SuppressedError==="function"?SuppressedError:function(W,G,U,K){return K=Error(U),K.name="SuppressedError",K.error=W,K.suppressed=G,K},z=(W)=>X=J?new Q(W,X,"An error was suppressed during disposal"):(J=!0,W),Y=(W)=>{while(W=$.pop())try{var G=W[1]&&W[1].call(W[2]);if(W[0])return Promise.resolve(G).then(Y,(U)=>(z(U),Y()))}catch(U){z(U)}if(J)throw X};return Y()};var d6={};H6(d6,{sep:()=>dQ,resolve:()=>C1,relative:()=>wK,posix:()=>jK,parse:()=>OK,normalize:()=>iQ,join:()=>u4,isAbsolute:()=>nQ,format:()=>HK,extname:()=>NK,dirname:()=>p6,delimiter:()=>BK,default:()=>xL,basename:()=>pQ,_makeLong:()=>VK});function h4($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}function KK($,X){var J="",Q=0,z=-1,Y=0,W;for(var G=0;G<=$.length;++G){if(G<$.length)W=$.charCodeAt(G);else if(W===47)break;else W=47;if(W===47){if(z===G-1||Y===1);else if(z!==G-1&&Y===2){if(J.length<2||Q!==2||J.charCodeAt(J.length-1)!==46||J.charCodeAt(J.length-2)!==46){if(J.length>2){var U=J.lastIndexOf("/");if(U!==J.length-1){if(U===-1)J="",Q=0;else J=J.slice(0,U),Q=J.length-1-J.lastIndexOf("/");z=G,Y=0;continue}}else if(J.length===2||J.length===1){J="",Q=0,z=G,Y=0;continue}}if(X){if(J.length>0)J+="/..";else J="..";Q=2}}else{if(J.length>0)J+="/"+$.slice(z+1,G);else J=$.slice(z+1,G);Q=G-z-1}z=G,Y=0}else if(W===46&&Y!==-1)++Y;else Y=-1}return J}function _L($,X){var J=X.dir||X.root,Q=X.base||(X.name||"")+(X.ext||"");if(!J)return Q;if(J===X.root)return J+Q;return J+$+Q}function C1(){var $="",X=!1,J;for(var Q=arguments.length-1;Q>=-1&&!X;Q--){var z;if(Q>=0)z=arguments[Q];else{if(J===void 0)J=process.cwd();z=J}if(h4(z),z.length===0)continue;$=z+"/"+$,X=z.charCodeAt(0)===47}if($=KK($,!X),X)if($.length>0)return"/"+$;else return"/";else if($.length>0)return $;else return"."}function iQ($){if(h4($),$.length===0)return".";var X=$.charCodeAt(0)===47,J=$.charCodeAt($.length-1)===47;if($=KK($,!X),$.length===0&&!X)$=".";if($.length>0&&J)$+="/";if(X)return"/"+$;return $}function nQ($){return h4($),$.length>0&&$.charCodeAt(0)===47}function u4(){if(arguments.length===0)return".";var $;for(var X=0;X<arguments.length;++X){var J=arguments[X];if(h4(J),J.length>0)if($===void 0)$=J;else $+="/"+J}if($===void 0)return".";return iQ($)}function wK($,X){if(h4($),h4(X),$===X)return"";if($=C1($),X=C1(X),$===X)return"";var J=1;for(;J<$.length;++J)if($.charCodeAt(J)!==47)break;var Q=$.length,z=Q-J,Y=1;for(;Y<X.length;++Y)if(X.charCodeAt(Y)!==47)break;var W=X.length,G=W-Y,U=z<G?z:G,K=-1,w=0;for(;w<=U;++w){if(w===U){if(G>U){if(X.charCodeAt(Y+w)===47)return X.slice(Y+w+1);else if(w===0)return X.slice(Y+w)}else if(z>U){if($.charCodeAt(J+w)===47)K=w;else if(w===0)K=0}break}var V=$.charCodeAt(J+w),H=X.charCodeAt(Y+w);if(V!==H)break;else if(V===47)K=w}var N="";for(w=J+K+1;w<=Q;++w)if(w===Q||$.charCodeAt(w)===47)if(N.length===0)N+="..";else N+="/..";if(N.length>0)return N+X.slice(Y+K);else{if(Y+=K,X.charCodeAt(Y)===47)++Y;return X.slice(Y)}}function VK($){return $}function p6($){if(h4($),$.length===0)return".";var X=$.charCodeAt(0),J=X===47,Q=-1,z=!0;for(var Y=$.length-1;Y>=1;--Y)if(X=$.charCodeAt(Y),X===47){if(!z){Q=Y;break}}else z=!1;if(Q===-1)return J?"/":".";if(J&&Q===1)return"//";return $.slice(0,Q)}function pQ($,X){if(X!==void 0&&typeof X!=="string")throw TypeError('"ext" argument must be a string');h4($);var J=0,Q=-1,z=!0,Y;if(X!==void 0&&X.length>0&&X.length<=$.length){if(X.length===$.length&&X===$)return"";var W=X.length-1,G=-1;for(Y=$.length-1;Y>=0;--Y){var U=$.charCodeAt(Y);if(U===47){if(!z){J=Y+1;break}}else{if(G===-1)z=!1,G=Y+1;if(W>=0)if(U===X.charCodeAt(W)){if(--W===-1)Q=Y}else W=-1,Q=G}}if(J===Q)Q=G;else if(Q===-1)Q=$.length;return $.slice(J,Q)}else{for(Y=$.length-1;Y>=0;--Y)if($.charCodeAt(Y)===47){if(!z){J=Y+1;break}}else if(Q===-1)z=!1,Q=Y+1;if(Q===-1)return"";return $.slice(J,Q)}}function NK($){h4($);var X=-1,J=0,Q=-1,z=!0,Y=0;for(var W=$.length-1;W>=0;--W){var G=$.charCodeAt(W);if(G===47){if(!z){J=W+1;break}continue}if(Q===-1)z=!1,Q=W+1;if(G===46){if(X===-1)X=W;else if(Y!==1)Y=1}else if(X!==-1)Y=-1}if(X===-1||Q===-1||Y===0||Y===1&&X===Q-1&&X===J+1)return"";return $.slice(X,Q)}function HK($){if($===null||typeof $!=="object")throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof $);return _L("/",$)}function OK($){h4($);var X={root:"",dir:"",base:"",ext:"",name:""};if($.length===0)return X;var J=$.charCodeAt(0),Q=J===47,z;if(Q)X.root="/",z=1;else z=0;var Y=-1,W=0,G=-1,U=!0,K=$.length-1,w=0;for(;K>=z;--K){if(J=$.charCodeAt(K),J===47){if(!U){W=K+1;break}continue}if(G===-1)U=!1,G=K+1;if(J===46){if(Y===-1)Y=K;else if(w!==1)w=1}else if(Y!==-1)w=-1}if(Y===-1||G===-1||w===0||w===1&&Y===G-1&&Y===W+1){if(G!==-1)if(W===0&&Q)X.base=X.name=$.slice(1,G);else X.base=X.name=$.slice(W,G)}else{if(W===0&&Q)X.name=$.slice(1,Y),X.base=$.slice(1,G);else X.name=$.slice(W,Y),X.base=$.slice(W,G);X.ext=$.slice(Y,G)}if(W>0)X.dir=$.slice(0,W-1);else if(Q)X.dir="/";return X}var dQ="/",BK=":",jK,xL;var P4=Kq(()=>{jK=(($)=>($.posix=$,$))({resolve:C1,normalize:iQ,isAbsolute:nQ,join:u4,relative:wK,_makeLong:VK,dirname:p6,basename:pQ,extname:NK,format:HK,parse:OK,sep:dQ,delimiter:BK,win32:null,posix:null}),xL=jK});var K8=x((KH)=>{Object.defineProperty(KH,"__esModule",{value:!0});KH.regexpCode=KH.getEsmExportName=KH.getProperty=KH.safeStringify=KH.stringify=KH.strConcat=KH.addCodeArg=KH.str=KH._=KH.nil=KH._Code=KH.Name=KH.IDENTIFIER=KH._CodeOrName=void 0;class XQ{}KH._CodeOrName=XQ;KH.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class b0 extends XQ{constructor($){super();if(!KH.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}KH.Name=b0;class _4 extends XQ{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((X,J)=>`${X}${J}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((X,J)=>{if(J instanceof b0)X[J.str]=(X[J.str]||0)+1;return X},{})}}KH._Code=_4;KH.nil=new _4("");function GH($,...X){let J=[$[0]],Q=0;while(Q<X.length)B3(J,X[Q]),J.push($[++Q]);return new _4(J)}KH._=GH;var O3=new _4("+");function UH($,...X){let J=[U8($[0])],Q=0;while(Q<X.length)J.push(O3),B3(J,X[Q]),J.push(O3,U8($[++Q]));return AP(J),new _4(J)}KH.str=UH;function B3($,X){if(X instanceof _4)$.push(...X._items);else if(X instanceof b0)$.push(X);else $.push(ZP(X))}KH.addCodeArg=B3;function AP($){let X=1;while(X<$.length-1){if($[X]===O3){let J=bP($[X-1],$[X+1]);if(J!==void 0){$.splice(X-1,3,J);continue}$[X++]="+"}X++}}function bP($,X){if(X==='""')return $;if($==='""')return X;if(typeof $=="string"){if(X instanceof b0||$[$.length-1]!=='"')return;if(typeof X!="string")return`${$.slice(0,-1)}${X}"`;if(X[0]==='"')return $.slice(0,-1)+X.slice(1);return}if(typeof X=="string"&&X[0]==='"'&&!($ instanceof b0))return`"${$}${X.slice(1)}`;return}function PP($,X){return X.emptyStr()?$:$.emptyStr()?X:UH`${$}${X}`}KH.strConcat=PP;function ZP($){return typeof $=="number"||typeof $=="boolean"||$===null?$:U8(Array.isArray($)?$.join(","):$)}function SP($){return new _4(U8($))}KH.stringify=SP;function U8($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}KH.safeStringify=U8;function RP($){return typeof $=="string"&&KH.IDENTIFIER.test($)?new _4(`.${$}`):GH`[${$}]`}KH.getProperty=RP;function EP($){if(typeof $=="string"&&KH.IDENTIFIER.test($))return new _4(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}KH.getEsmExportName=EP;function vP($){return new _4($.toString())}KH.regexpCode=vP});var L3=x((HH)=>{Object.defineProperty(HH,"__esModule",{value:!0});HH.ValueScope=HH.ValueScopeName=HH.Scope=HH.varKinds=HH.UsedValueState=void 0;var X4=K8();class VH extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var zQ;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(zQ||(HH.UsedValueState=zQ={}));HH.varKinds={const:new X4.Name("const"),let:new X4.Name("let"),var:new X4.Name("var")};class D3{constructor({prefixes:$,parent:X}={}){this._names={},this._prefixes=$,this._parent=X}toName($){return $ instanceof X4.Name?$:this.name($)}name($){return new X4.Name(this._newName($))}_newName($){let X=this._names[$]||this._nameGroup($);return`${$}${X.index++}`}_nameGroup($){var X,J;if(((J=(X=this._parent)===null||X===void 0?void 0:X._prefixes)===null||J===void 0?void 0:J.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}HH.Scope=D3;class q3 extends X4.Name{constructor($,X){super(X);this.prefix=$}setValue($,{property:X,itemIndex:J}){this.value=$,this.scopePath=X4._`.${new X4.Name(X)}[${J}]`}}HH.ValueScopeName=q3;var cP=X4._`\n`;class NH extends D3{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?cP:X4.nil}}get(){return this._scope}name($){return new q3($,this._newName($))}value($,X){var J;if(X.ref===void 0)throw Error("CodeGen: ref must be passed in value");let Q=this.toName($),{prefix:z}=Q,Y=(J=X.key)!==null&&J!==void 0?J:X.ref,W=this._values[z];if(W){let K=W.get(Y);if(K)return K}else W=this._values[z]=new Map;W.set(Y,Q);let G=this._scope[z]||(this._scope[z]=[]),U=G.length;return G[U]=X.ref,Q.setValue(X,{property:z,itemIndex:U}),Q}getValue($,X){let J=this._values[$];if(!J)return;return J.get(X)}scopeRefs($,X=this._values){return this._reduceValues(X,(J)=>{if(J.scopePath===void 0)throw Error(`CodeGen: name "${J}" has no value`);return X4._`${$}${J.scopePath}`})}scopeCode($=this._values,X,J){return this._reduceValues($,(Q)=>{if(Q.value===void 0)throw Error(`CodeGen: name "${Q}" has no value`);return Q.value.code},X,J)}_reduceValues($,X,J={},Q){let z=X4.nil;for(let Y in $){let W=$[Y];if(!W)continue;let G=J[Y]=J[Y]||new Map;W.forEach((U)=>{if(G.has(U))return;G.set(U,zQ.Started);let K=X(U);if(K){let w=this.opts.es5?HH.varKinds.var:HH.varKinds.const;z=X4._`${z}${w} ${U} = ${K};${this.opts._n}`}else if(K=Q===null||Q===void 0?void 0:Q(U))z=X4._`${z}${K}${this.opts._n}`;else throw new VH(U);G.set(U,zQ.Completed)})}return z}}HH.ValueScope=NH});var s=x((J4)=>{Object.defineProperty(J4,"__esModule",{value:!0});J4.or=J4.and=J4.not=J4.CodeGen=J4.operators=J4.varKinds=J4.ValueScopeName=J4.ValueScope=J4.Scope=J4.Name=J4.regexpCode=J4.stringify=J4.getProperty=J4.nil=J4.strConcat=J4.str=J4._=void 0;var Q$=K8(),x4=L3(),T6=K8();Object.defineProperty(J4,"_",{enumerable:!0,get:function(){return T6._}});Object.defineProperty(J4,"str",{enumerable:!0,get:function(){return T6.str}});Object.defineProperty(J4,"strConcat",{enumerable:!0,get:function(){return T6.strConcat}});Object.defineProperty(J4,"nil",{enumerable:!0,get:function(){return T6.nil}});Object.defineProperty(J4,"getProperty",{enumerable:!0,get:function(){return T6.getProperty}});Object.defineProperty(J4,"stringify",{enumerable:!0,get:function(){return T6.stringify}});Object.defineProperty(J4,"regexpCode",{enumerable:!0,get:function(){return T6.regexpCode}});Object.defineProperty(J4,"Name",{enumerable:!0,get:function(){return T6.Name}});var KQ=L3();Object.defineProperty(J4,"Scope",{enumerable:!0,get:function(){return KQ.Scope}});Object.defineProperty(J4,"ValueScope",{enumerable:!0,get:function(){return KQ.ValueScope}});Object.defineProperty(J4,"ValueScopeName",{enumerable:!0,get:function(){return KQ.ValueScopeName}});Object.defineProperty(J4,"varKinds",{enumerable:!0,get:function(){return KQ.varKinds}});J4.operators={GT:new Q$._Code(">"),GTE:new Q$._Code(">="),LT:new Q$._Code("<"),LTE:new Q$._Code("<="),EQ:new Q$._Code("==="),NEQ:new Q$._Code("!=="),NOT:new Q$._Code("!"),OR:new Q$._Code("||"),AND:new Q$._Code("&&"),ADD:new Q$._Code("+")};class f6{optimizeNodes(){return this}optimizeNames($,X){return this}}class BH extends f6{constructor($,X,J){super();this.varKind=$,this.name=X,this.rhs=J}render({es5:$,_n:X}){let J=$?x4.varKinds.var:this.varKind,Q=this.rhs===void 0?"":` = ${this.rhs}`;return`${J} ${this.name}${Q};`+X}optimizeNames($,X){if(!$[this.name.str])return;if(this.rhs)this.rhs=Z0(this.rhs,$,X);return this}get names(){return this.rhs instanceof Q$._CodeOrName?this.rhs.names:{}}}class I3 extends f6{constructor($,X,J){super();this.lhs=$,this.rhs=X,this.sideEffects=J}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,X){if(this.lhs instanceof Q$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Z0(this.rhs,$,X),this}get names(){let $=this.lhs instanceof Q$.Name?{}:{...this.lhs.names};return UQ($,this.rhs)}}class jH extends I3{constructor($,X,J,Q){super($,J,Q);this.op=X}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class DH extends f6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class qH extends f6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class LH extends f6{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class FH extends f6{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,X){return this.code=Z0(this.code,$,X),this}get names(){return this.code instanceof Q$._CodeOrName?this.code.names:{}}}class wQ extends f6{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((X,J)=>X+J.render($),"")}optimizeNodes(){let{nodes:$}=this,X=$.length;while(X--){let J=$[X].optimizeNodes();if(Array.isArray(J))$.splice(X,1,...J);else if(J)$[X]=J;else $.splice(X,1)}return $.length>0?this:void 0}optimizeNames($,X){let{nodes:J}=this,Q=J.length;while(Q--){let z=J[Q];if(z.optimizeNames($,X))continue;dP($,z.names),J.splice(Q,1)}return J.length>0?this:void 0}get names(){return this.nodes.reduce(($,X)=>q1($,X.names),{})}}class g6 extends wQ{render($){return"{"+$._n+super.render($)+"}"+$._n}}class MH extends wQ{}class w8 extends g6{}w8.kind="else";class K6 extends g6{constructor($,X){super(X);this.condition=$}render($){let X=`if(${this.condition})`+super.render($);if(this.else)X+="else "+this.else.render($);return X}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let X=this.else;if(X){let J=X.optimizeNodes();X=this.else=Array.isArray(J)?new w8(J):J}if(X){if($===!1)return X instanceof K6?X:X.nodes;if(this.nodes.length)return this;return new K6(ZH($),X instanceof K6?[X]:X.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,X){var J;if(this.else=(J=this.else)===null||J===void 0?void 0:J.optimizeNames($,X),!(super.optimizeNames($,X)||this.else))return;return this.condition=Z0(this.condition,$,X),this}get names(){let $=super.names;if(UQ($,this.condition),this.else)q1($,this.else.names);return $}}K6.kind="if";class P0 extends g6{}P0.kind="for";class IH extends P0{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,X){if(!super.optimizeNames($,X))return;return this.iteration=Z0(this.iteration,$,X),this}get names(){return q1(super.names,this.iteration.names)}}class AH extends P0{constructor($,X,J,Q){super();this.varKind=$,this.name=X,this.from=J,this.to=Q}render($){let X=$.es5?x4.varKinds.var:this.varKind,{name:J,from:Q,to:z}=this;return`for(${X} ${J}=${Q}; ${J}<${z}; ${J}++)`+super.render($)}get names(){let $=UQ(super.names,this.from);return UQ($,this.to)}}class F3 extends P0{constructor($,X,J,Q){super();this.loop=$,this.varKind=X,this.name=J,this.iterable=Q}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,X){if(!super.optimizeNames($,X))return;return this.iterable=Z0(this.iterable,$,X),this}get names(){return q1(super.names,this.iterable.names)}}class QQ extends g6{constructor($,X,J){super();this.name=$,this.args=X,this.async=J}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}QQ.kind="func";class YQ extends wQ{render($){return"return "+super.render($)}}YQ.kind="return";class bH extends g6{render($){let X="try"+super.render($);if(this.catch)X+=this.catch.render($);if(this.finally)X+=this.finally.render($);return X}optimizeNodes(){var $,X;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(X=this.finally)===null||X===void 0||X.optimizeNodes(),this}optimizeNames($,X){var J,Q;return super.optimizeNames($,X),(J=this.catch)===null||J===void 0||J.optimizeNames($,X),(Q=this.finally)===null||Q===void 0||Q.optimizeNames($,X),this}get names(){let $=super.names;if(this.catch)q1($,this.catch.names);if(this.finally)q1($,this.finally.names);return $}}class WQ extends g6{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}WQ.kind="catch";class GQ extends g6{render($){return"finally"+super.render($)}}GQ.kind="finally";class PH{constructor($,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?`
|
|
5
5
|
`:""},this._extScope=$,this._scope=new x4.Scope({parent:$}),this._nodes=[new MH]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,X){let J=this._extScope.value($,X);return(this._values[J.prefix]||(this._values[J.prefix]=new Set)).add(J),J}getScopeValue($,X){return this._extScope.getValue($,X)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,X,J,Q){let z=this._scope.toName(X);if(J!==void 0&&Q)this._constants[z.str]=J;return this._leafNode(new BH($,z,J)),z}const($,X,J){return this._def(x4.varKinds.const,$,X,J)}let($,X,J){return this._def(x4.varKinds.let,$,X,J)}var($,X,J){return this._def(x4.varKinds.var,$,X,J)}assign($,X,J){return this._leafNode(new I3($,X,J))}add($,X){return this._leafNode(new jH($,J4.operators.ADD,X))}code($){if(typeof $=="function")$();else if($!==Q$.nil)this._leafNode(new FH($));return this}object(...$){let X=["{"];for(let[J,Q]of $){if(X.length>1)X.push(",");if(X.push(J),J!==Q||this.opts.es5)X.push(":"),(0,Q$.addCodeArg)(X,Q)}return X.push("}"),new Q$._Code(X)}if($,X,J){if(this._blockNode(new K6($)),X&&J)this.code(X).else().code(J).endIf();else if(X)this.code(X).endIf();else if(J)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new K6($))}else(){return this._elseNode(new w8)}endIf(){return this._endBlockNode(K6,w8)}_for($,X){if(this._blockNode($),X)this.code(X).endFor();return this}for($,X){return this._for(new IH($),X)}forRange($,X,J,Q,z=this.opts.es5?x4.varKinds.var:x4.varKinds.let){let Y=this._scope.toName($);return this._for(new AH(z,Y,X,J),()=>Q(Y))}forOf($,X,J,Q=x4.varKinds.const){let z=this._scope.toName($);if(this.opts.es5){let Y=X instanceof Q$.Name?X:this.var("_arr",X);return this.forRange("_i",0,Q$._`${Y}.length`,(W)=>{this.var(z,Q$._`${Y}[${W}]`),J(z)})}return this._for(new F3("of",Q,z,X),()=>J(z))}forIn($,X,J,Q=this.opts.es5?x4.varKinds.var:x4.varKinds.const){if(this.opts.ownProperties)return this.forOf($,Q$._`Object.keys(${X})`,J);let z=this._scope.toName($);return this._for(new F3("in",Q,z,X),()=>J(z))}endFor(){return this._endBlockNode(P0)}label($){return this._leafNode(new DH($))}break($){return this._leafNode(new qH($))}return($){let X=new YQ;if(this._blockNode(X),this.code($),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(YQ)}try($,X,J){if(!X&&!J)throw Error('CodeGen: "try" without "catch" and "finally"');let Q=new bH;if(this._blockNode(Q),this.code($),X){let z=this.name("e");this._currNode=Q.catch=new WQ(z),X(z)}if(J)this._currNode=Q.finally=new GQ,this.code(J);return this._endBlockNode(WQ,GQ)}throw($){return this._leafNode(new LH($))}block($,X){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(X);return this}endBlock($){let X=this._blockStarts.pop();if(X===void 0)throw Error("CodeGen: not in self-balancing block");let J=this._nodes.length-X;if(J<0||$!==void 0&&J!==$)throw Error(`CodeGen: wrong number of nodes: ${J} vs ${$} expected`);return this._nodes.length=X,this}func($,X=Q$.nil,J,Q){if(this._blockNode(new QQ($,X,J)),Q)this.code(Q).endFunc();return this}endFunc(){return this._endBlockNode(QQ)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,X){let J=this._currNode;if(J instanceof $||X&&J instanceof X)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${X?`${$.kind}/${X.kind}`:$.kind}"`)}_elseNode($){let X=this._currNode;if(!(X instanceof K6))throw Error('CodeGen: "else" without "if"');return this._currNode=X.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let X=this._nodes;X[X.length-1]=$}}J4.CodeGen=PH;function q1($,X){for(let J in X)$[J]=($[J]||0)+(X[J]||0);return $}function UQ($,X){return X instanceof Q$._CodeOrName?q1($,X.names):$}function Z0($,X,J){if($ instanceof Q$.Name)return Q($);if(!z($))return $;return new Q$._Code($._items.reduce((Y,W)=>{if(W instanceof Q$.Name)W=Q(W);if(W instanceof Q$._Code)Y.push(...W._items);else Y.push(W);return Y},[]));function Q(Y){let W=J[Y.str];if(W===void 0||X[Y.str]!==1)return Y;return delete X[Y.str],W}function z(Y){return Y instanceof Q$._Code&&Y._items.some((W)=>W instanceof Q$.Name&&X[W.str]===1&&J[W.str]!==void 0)}}function dP($,X){for(let J in X)$[J]=($[J]||0)-(X[J]||0)}function ZH($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:Q$._`!${M3($)}`}J4.not=ZH;var rP=SH(J4.operators.AND);function oP(...$){return $.reduce(rP)}J4.and=oP;var tP=SH(J4.operators.OR);function aP(...$){return $.reduce(tP)}J4.or=aP;function SH($){return(X,J)=>X===Q$.nil?J:J===Q$.nil?X:Q$._`${M3(X)} ${$} ${M3(J)}`}function M3($){return $ instanceof Q$.Name?$:Q$._`(${$})`}});var Y$=x((fH)=>{Object.defineProperty(fH,"__esModule",{value:!0});fH.checkStrictMode=fH.getErrorPath=fH.Type=fH.useFunc=fH.setEvaluated=fH.evaluatedPropsToName=fH.mergeEvaluated=fH.eachItem=fH.unescapeJsonPointer=fH.escapeJsonPointer=fH.escapeFragment=fH.unescapeFragment=fH.schemaRefOrVal=fH.schemaHasRulesButRef=fH.schemaHasRules=fH.checkUnknownRules=fH.alwaysValidSchema=fH.toHash=void 0;var B$=s(),XZ=K8();function JZ($){let X={};for(let J of $)X[J]=!0;return X}fH.toHash=JZ;function zZ($,X){if(typeof X=="boolean")return X;if(Object.keys(X).length===0)return!0;return CH($,X),!kH(X,$.self.RULES.all)}fH.alwaysValidSchema=zZ;function CH($,X=$.schema){let{opts:J,self:Q}=$;if(!J.strictSchema)return;if(typeof X==="boolean")return;let z=Q.RULES.keywords;for(let Y in X)if(!z[Y])TH($,`unknown keyword: "${Y}"`)}fH.checkUnknownRules=CH;function kH($,X){if(typeof $=="boolean")return!$;for(let J in $)if(X[J])return!0;return!1}fH.schemaHasRules=kH;function QZ($,X){if(typeof $=="boolean")return!$;for(let J in $)if(J!=="$ref"&&X.all[J])return!0;return!1}fH.schemaHasRulesButRef=QZ;function YZ({topSchemaRef:$,schemaPath:X},J,Q,z){if(!z){if(typeof J=="number"||typeof J=="boolean")return J;if(typeof J=="string")return B$._`${J}`}return B$._`${$}${X}${(0,B$.getProperty)(Q)}`}fH.schemaRefOrVal=YZ;function WZ($){return _H(decodeURIComponent($))}fH.unescapeFragment=WZ;function GZ($){return encodeURIComponent(b3($))}fH.escapeFragment=GZ;function b3($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}fH.escapeJsonPointer=b3;function _H($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}fH.unescapeJsonPointer=_H;function UZ($,X){if(Array.isArray($))for(let J of $)X(J);else X($)}fH.eachItem=UZ;function EH({mergeNames:$,mergeToName:X,mergeValues:J,resultToName:Q}){return(z,Y,W,G)=>{let U=W===void 0?Y:W instanceof B$.Name?(Y instanceof B$.Name?$(z,Y,W):X(z,Y,W),W):Y instanceof B$.Name?(X(z,W,Y),Y):J(Y,W);return G===B$.Name&&!(U instanceof B$.Name)?Q(z,U):U}}fH.mergeEvaluated={props:EH({mergeNames:($,X,J)=>$.if(B$._`${J} !== true && ${X} !== undefined`,()=>{$.if(B$._`${X} === true`,()=>$.assign(J,!0),()=>$.assign(J,B$._`${J} || {}`).code(B$._`Object.assign(${J}, ${X})`))}),mergeToName:($,X,J)=>$.if(B$._`${J} !== true`,()=>{if(X===!0)$.assign(J,!0);else $.assign(J,B$._`${J} || {}`),P3($,J,X)}),mergeValues:($,X)=>$===!0?!0:{...$,...X},resultToName:xH}),items:EH({mergeNames:($,X,J)=>$.if(B$._`${J} !== true && ${X} !== undefined`,()=>$.assign(J,B$._`${X} === true ? true : ${J} > ${X} ? ${J} : ${X}`)),mergeToName:($,X,J)=>$.if(B$._`${J} !== true`,()=>$.assign(J,X===!0?!0:B$._`${J} > ${X} ? ${J} : ${X}`)),mergeValues:($,X)=>$===!0?!0:Math.max($,X),resultToName:($,X)=>$.var("items",X)})};function xH($,X){if(X===!0)return $.var("props",!0);let J=$.var("props",B$._`{}`);if(X!==void 0)P3($,J,X);return J}fH.evaluatedPropsToName=xH;function P3($,X,J){Object.keys(J).forEach((Q)=>$.assign(B$._`${X}${(0,B$.getProperty)(Q)}`,!0))}fH.setEvaluated=P3;var vH={};function KZ($,X){return $.scopeValue("func",{ref:X,code:vH[X.code]||(vH[X.code]=new XZ._Code(X.code))})}fH.useFunc=KZ;var A3;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(A3||(fH.Type=A3={}));function wZ($,X,J){if($ instanceof B$.Name){let Q=X===A3.Num;return J?Q?B$._`"[" + ${$} + "]"`:B$._`"['" + ${$} + "']"`:Q?B$._`"/" + ${$}`:B$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return J?(0,B$.getProperty)($).toString():"/"+b3($)}fH.getErrorPath=wZ;function TH($,X,J=$.opts.strictSchema){if(!J)return;if(X=`strict mode: ${X}`,J===!0)throw Error(X);$.self.logger.warn(X)}fH.checkStrictMode=TH});var w6=x((yH)=>{Object.defineProperty(yH,"__esModule",{value:!0});var i$=s(),RZ={data:new i$.Name("data"),valCxt:new i$.Name("valCxt"),instancePath:new i$.Name("instancePath"),parentData:new i$.Name("parentData"),parentDataProperty:new i$.Name("parentDataProperty"),rootData:new i$.Name("rootData"),dynamicAnchors:new i$.Name("dynamicAnchors"),vErrors:new i$.Name("vErrors"),errors:new i$.Name("errors"),this:new i$.Name("this"),self:new i$.Name("self"),scope:new i$.Name("scope"),json:new i$.Name("json"),jsonPos:new i$.Name("jsonPos"),jsonLen:new i$.Name("jsonLen"),jsonPart:new i$.Name("jsonPart")};yH.default=RZ});var V8=x((mH)=>{Object.defineProperty(mH,"__esModule",{value:!0});mH.extendErrors=mH.resetErrorsCount=mH.reportExtraError=mH.reportError=mH.keyword$DataError=mH.keywordError=void 0;var W$=s(),NQ=Y$(),r$=w6();mH.keywordError={message:({keyword:$})=>W$.str`must pass "${$}" keyword validation`};mH.keyword$DataError={message:({keyword:$,schemaType:X})=>X?W$.str`"${$}" keyword must be ${X} ($data)`:W$.str`"${$}" keyword is invalid ($data)`};function vZ($,X=mH.keywordError,J,Q){let{it:z}=$,{gen:Y,compositeRule:W,allErrors:G}=z,U=lH($,X,J);if(Q!==null&&Q!==void 0?Q:W||G)hH(Y,U);else uH(z,W$._`[${U}]`)}mH.reportError=vZ;function CZ($,X=mH.keywordError,J){let{it:Q}=$,{gen:z,compositeRule:Y,allErrors:W}=Q,G=lH($,X,J);if(hH(z,G),!(Y||W))uH(Q,r$.default.vErrors)}mH.reportExtraError=CZ;function kZ($,X){$.assign(r$.default.errors,X),$.if(W$._`${r$.default.vErrors} !== null`,()=>$.if(X,()=>$.assign(W$._`${r$.default.vErrors}.length`,X),()=>$.assign(r$.default.vErrors,null)))}mH.resetErrorsCount=kZ;function _Z({gen:$,keyword:X,schemaValue:J,data:Q,errsCount:z,it:Y}){if(z===void 0)throw Error("ajv implementation error");let W=$.name("err");$.forRange("i",z,r$.default.errors,(G)=>{if($.const(W,W$._`${r$.default.vErrors}[${G}]`),$.if(W$._`${W}.instancePath === undefined`,()=>$.assign(W$._`${W}.instancePath`,(0,W$.strConcat)(r$.default.instancePath,Y.errorPath))),$.assign(W$._`${W}.schemaPath`,W$.str`${Y.errSchemaPath}/${X}`),Y.opts.verbose)$.assign(W$._`${W}.schema`,J),$.assign(W$._`${W}.data`,Q)})}mH.extendErrors=_Z;function hH($,X){let J=$.const("err",X);$.if(W$._`${r$.default.vErrors} === null`,()=>$.assign(r$.default.vErrors,W$._`[${J}]`),W$._`${r$.default.vErrors}.push(${J})`),$.code(W$._`${r$.default.errors}++`)}function uH($,X){let{gen:J,validateName:Q,schemaEnv:z}=$;if(z.$async)J.throw(W$._`new ${$.ValidationError}(${X})`);else J.assign(W$._`${Q}.errors`,X),J.return(!1)}var L1={keyword:new W$.Name("keyword"),schemaPath:new W$.Name("schemaPath"),params:new W$.Name("params"),propertyName:new W$.Name("propertyName"),message:new W$.Name("message"),schema:new W$.Name("schema"),parentSchema:new W$.Name("parentSchema")};function lH($,X,J){let{createErrors:Q}=$.it;if(Q===!1)return W$._`{}`;return xZ($,X,J)}function xZ($,X,J={}){let{gen:Q,it:z}=$,Y=[TZ(z,J),fZ($,J)];return gZ($,X,Y),Q.object(...Y)}function TZ({errorPath:$},{instancePath:X}){let J=X?W$.str`${$}${(0,NQ.getErrorPath)(X,NQ.Type.Str)}`:$;return[r$.default.instancePath,(0,W$.strConcat)(r$.default.instancePath,J)]}function fZ({keyword:$,it:{errSchemaPath:X}},{schemaPath:J,parentSchema:Q}){let z=Q?X:W$.str`${X}/${$}`;if(J)z=W$.str`${z}${(0,NQ.getErrorPath)(J,NQ.Type.Str)}`;return[L1.schemaPath,z]}function gZ($,{params:X,message:J},Q){let{keyword:z,data:Y,schemaValue:W,it:G}=$,{opts:U,propertyName:K,topSchemaRef:w,schemaPath:V}=G;if(Q.push([L1.keyword,z],[L1.params,typeof X=="function"?X($):X||W$._`{}`]),U.messages)Q.push([L1.message,typeof J=="function"?J($):J]);if(U.verbose)Q.push([L1.schema,W],[L1.parentSchema,W$._`${w}${V}`],[r$.default.data,Y]);if(K)Q.push([L1.propertyName,K])}});var dH=x((nH)=>{Object.defineProperty(nH,"__esModule",{value:!0});nH.boolOrEmptySchema=nH.topBoolOrEmptySchema=void 0;var mZ=V8(),cZ=s(),iZ=w6(),nZ={message:"boolean schema is false"};function pZ($){let{gen:X,schema:J,validateName:Q}=$;if(J===!1)iH($,!1);else if(typeof J=="object"&&J.$async===!0)X.return(iZ.default.data);else X.assign(cZ._`${Q}.errors`,null),X.return(!0)}nH.topBoolOrEmptySchema=pZ;function dZ($,X){let{gen:J,schema:Q}=$;if(Q===!1)J.var(X,!1),iH($);else J.var(X,!0)}nH.boolOrEmptySchema=dZ;function iH($,X){let{gen:J,data:Q}=$,z={gen:J,keyword:"false schema",data:Q,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,mZ.reportError)(z,nZ,void 0,X)}});var S3=x((rH)=>{Object.defineProperty(rH,"__esModule",{value:!0});rH.getRules=rH.isJSONType=void 0;var oZ=["string","number","integer","boolean","null","object","array"],tZ=new Set(oZ);function aZ($){return typeof $=="string"&&tZ.has($)}rH.isJSONType=aZ;function sZ(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}rH.getRules=sZ});var R3=x((sH)=>{Object.defineProperty(sH,"__esModule",{value:!0});sH.shouldUseRule=sH.shouldUseGroup=sH.schemaHasRulesForType=void 0;function $S({schema:$,self:X},J){let Q=X.RULES.types[J];return Q&&Q!==!0&&tH($,Q)}sH.schemaHasRulesForType=$S;function tH($,X){return X.rules.some((J)=>aH($,J))}sH.shouldUseGroup=tH;function aH($,X){var J;return $[X.keyword]!==void 0||((J=X.definition.implements)===null||J===void 0?void 0:J.some((Q)=>$[Q]!==void 0))}sH.shouldUseRule=aH});var N8=x((zO)=>{Object.defineProperty(zO,"__esModule",{value:!0});zO.reportTypeError=zO.checkDataTypes=zO.checkDataType=zO.coerceAndCheckDataType=zO.getJSONTypes=zO.getSchemaTypes=zO.DataType=void 0;var zS=S3(),QS=R3(),YS=V8(),a=s(),$O=Y$(),S0;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(S0||(zO.DataType=S0={}));function WS($){let X=XO($.type);if(X.includes("null")){if($.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!X.length&&$.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if($.nullable===!0)X.push("null")}return X}zO.getSchemaTypes=WS;function XO($){let X=Array.isArray($)?$:$?[$]:[];if(X.every(zS.isJSONType))return X;throw Error("type must be JSONType or JSONType[]: "+X.join(","))}zO.getJSONTypes=XO;function GS($,X){let{gen:J,data:Q,opts:z}=$,Y=US(X,z.coerceTypes),W=X.length>0&&!(Y.length===0&&X.length===1&&(0,QS.schemaHasRulesForType)($,X[0]));if(W){let G=v3(X,Q,z.strictNumbers,S0.Wrong);J.if(G,()=>{if(Y.length)KS($,X,Y);else C3($)})}return W}zO.coerceAndCheckDataType=GS;var JO=new Set(["string","number","integer","boolean","null"]);function US($,X){return X?$.filter((J)=>JO.has(J)||X==="array"&&J==="array"):[]}function KS($,X,J){let{gen:Q,data:z,opts:Y}=$,W=Q.let("dataType",a._`typeof ${z}`),G=Q.let("coerced",a._`undefined`);if(Y.coerceTypes==="array")Q.if(a._`${W} == 'object' && Array.isArray(${z}) && ${z}.length == 1`,()=>Q.assign(z,a._`${z}[0]`).assign(W,a._`typeof ${z}`).if(v3(X,z,Y.strictNumbers),()=>Q.assign(G,z)));Q.if(a._`${G} !== undefined`);for(let K of J)if(JO.has(K)||K==="array"&&Y.coerceTypes==="array")U(K);Q.else(),C3($),Q.endIf(),Q.if(a._`${G} !== undefined`,()=>{Q.assign(z,G),wS($,G)});function U(K){switch(K){case"string":Q.elseIf(a._`${W} == "number" || ${W} == "boolean"`).assign(G,a._`"" + ${z}`).elseIf(a._`${z} === null`).assign(G,a._`""`);return;case"number":Q.elseIf(a._`${W} == "boolean" || ${z} === null
|
|
6
6
|
|| (${W} == "string" && ${z} && ${z} == +${z})`).assign(G,a._`+${z}`);return;case"integer":Q.elseIf(a._`${W} === "boolean" || ${z} === null
|
|
@@ -8,7 +8,7 @@ var $q=Object.create;var{getPrototypeOf:Xq,defineProperty:hQ,getOwnPropertyNames
|
|
|
8
8
|
|| ${W} === "boolean" || ${z} === null`).assign(G,a._`[${z}]`)}}}function wS({gen:$,parentData:X,parentDataProperty:J},Q){$.if(a._`${X} !== undefined`,()=>$.assign(a._`${X}[${J}]`,Q))}function E3($,X,J,Q=S0.Correct){let z=Q===S0.Correct?a.operators.EQ:a.operators.NEQ,Y;switch($){case"null":return a._`${X} ${z} null`;case"array":Y=a._`Array.isArray(${X})`;break;case"object":Y=a._`${X} && typeof ${X} == "object" && !Array.isArray(${X})`;break;case"integer":Y=W(a._`!(${X} % 1) && !isNaN(${X})`);break;case"number":Y=W();break;default:return a._`typeof ${X} ${z} ${$}`}return Q===S0.Correct?Y:(0,a.not)(Y);function W(G=a.nil){return(0,a.and)(a._`typeof ${X} == "number"`,G,J?a._`isFinite(${X})`:a.nil)}}zO.checkDataType=E3;function v3($,X,J,Q){if($.length===1)return E3($[0],X,J,Q);let z,Y=(0,$O.toHash)($);if(Y.array&&Y.object){let W=a._`typeof ${X} != "object"`;z=Y.null?W:a._`!${X} || ${W}`,delete Y.null,delete Y.array,delete Y.object}else z=a.nil;if(Y.number)delete Y.integer;for(let W in Y)z=(0,a.and)(z,E3(W,X,J,Q));return z}zO.checkDataTypes=v3;var VS={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:X})=>typeof $=="string"?a._`{type: ${$}}`:a._`{type: ${X}}`};function C3($){let X=NS($);(0,YS.reportError)(X,VS)}zO.reportTypeError=C3;function NS($){let{gen:X,data:J,schema:Q}=$,z=(0,$O.schemaRefOrVal)($,Q,"type");return{gen:X,keyword:"type",data:J,schema:Q.type,schemaCode:z,schemaValue:z,parentSchema:Q,params:{},it:$}}});var UO=x((WO)=>{Object.defineProperty(WO,"__esModule",{value:!0});WO.assignDefaults=void 0;var R0=s(),LS=Y$();function FS($,X){let{properties:J,items:Q}=$.schema;if(X==="object"&&J)for(let z in J)YO($,z,J[z].default);else if(X==="array"&&Array.isArray(Q))Q.forEach((z,Y)=>YO($,Y,z.default))}WO.assignDefaults=FS;function YO($,X,J){let{gen:Q,compositeRule:z,data:Y,opts:W}=$;if(J===void 0)return;let G=R0._`${Y}${(0,R0.getProperty)(X)}`;if(z){(0,LS.checkStrictMode)($,`default is ignored for: ${G}`);return}let U=R0._`${G} === undefined`;if(W.useDefaults==="empty")U=R0._`${U} || ${G} === null || ${G} === ""`;Q.if(U,R0._`${G} = ${(0,R0.stringify)(J)}`)}});var A4=x((VO)=>{Object.defineProperty(VO,"__esModule",{value:!0});VO.validateUnion=VO.validateArray=VO.usePattern=VO.callValidateCode=VO.schemaProperties=VO.allSchemaProperties=VO.noPropertyInData=VO.propertyInData=VO.isOwnProperty=VO.hasPropFunc=VO.reportMissingProp=VO.checkMissingProp=VO.checkReportMissingProp=void 0;var L$=s(),k3=Y$(),y6=w6(),MS=Y$();function IS($,X){let{gen:J,data:Q,it:z}=$;J.if(x3(J,Q,X,z.opts.ownProperties),()=>{$.setParams({missingProperty:L$._`${X}`},!0),$.error()})}VO.checkReportMissingProp=IS;function AS({gen:$,data:X,it:{opts:J}},Q,z){return(0,L$.or)(...Q.map((Y)=>(0,L$.and)(x3($,X,Y,J.ownProperties),L$._`${z} = ${Y}`)))}VO.checkMissingProp=AS;function bS($,X){$.setParams({missingProperty:X},!0),$.error()}VO.reportMissingProp=bS;function KO($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:L$._`Object.prototype.hasOwnProperty`})}VO.hasPropFunc=KO;function _3($,X,J){return L$._`${KO($)}.call(${X}, ${J})`}VO.isOwnProperty=_3;function PS($,X,J,Q){let z=L$._`${X}${(0,L$.getProperty)(J)} !== undefined`;return Q?L$._`${z} && ${_3($,X,J)}`:z}VO.propertyInData=PS;function x3($,X,J,Q){let z=L$._`${X}${(0,L$.getProperty)(J)} === undefined`;return Q?(0,L$.or)(z,(0,L$.not)(_3($,X,J))):z}VO.noPropertyInData=x3;function wO($){return $?Object.keys($).filter((X)=>X!=="__proto__"):[]}VO.allSchemaProperties=wO;function ZS($,X){return wO(X).filter((J)=>!(0,k3.alwaysValidSchema)($,X[J]))}VO.schemaProperties=ZS;function SS({schemaCode:$,data:X,it:{gen:J,topSchemaRef:Q,schemaPath:z,errorPath:Y},it:W},G,U,K){let w=K?L$._`${$}, ${X}, ${Q}${z}`:X,V=[[y6.default.instancePath,(0,L$.strConcat)(y6.default.instancePath,Y)],[y6.default.parentData,W.parentData],[y6.default.parentDataProperty,W.parentDataProperty],[y6.default.rootData,y6.default.rootData]];if(W.opts.dynamicRef)V.push([y6.default.dynamicAnchors,y6.default.dynamicAnchors]);let H=L$._`${w}, ${J.object(...V)}`;return U!==L$.nil?L$._`${G}.call(${U}, ${H})`:L$._`${G}(${H})`}VO.callValidateCode=SS;var RS=L$._`new RegExp`;function ES({gen:$,it:{opts:X}},J){let Q=X.unicodeRegExp?"u":"",{regExp:z}=X.code,Y=z(J,Q);return $.scopeValue("pattern",{key:Y.toString(),ref:Y,code:L$._`${z.code==="new RegExp"?RS:(0,MS.useFunc)($,z)}(${J}, ${Q})`})}VO.usePattern=ES;function vS($){let{gen:X,data:J,keyword:Q,it:z}=$,Y=X.name("valid");if(z.allErrors){let G=X.let("valid",!0);return W(()=>X.assign(G,!1)),G}return X.var(Y,!0),W(()=>X.break()),Y;function W(G){let U=X.const("len",L$._`${J}.length`);X.forRange("i",0,U,(K)=>{$.subschema({keyword:Q,dataProp:K,dataPropType:k3.Type.Num},Y),X.if((0,L$.not)(Y),G)})}}VO.validateArray=vS;function CS($){let{gen:X,schema:J,keyword:Q,it:z}=$;if(!Array.isArray(J))throw Error("ajv implementation error");if(J.some((U)=>(0,k3.alwaysValidSchema)(z,U))&&!z.opts.unevaluated)return;let W=X.let("valid",!1),G=X.name("_valid");X.block(()=>J.forEach((U,K)=>{let w=$.subschema({keyword:Q,schemaProp:K,compositeRule:!0},G);if(X.assign(W,L$._`${W} || ${G}`),!$.mergeValidEvaluated(w,G))X.if((0,L$.not)(W))})),$.result(W,()=>$.reset(),()=>$.error(!0))}VO.validateUnion=CS});var DO=x((BO)=>{Object.defineProperty(BO,"__esModule",{value:!0});BO.validateKeywordUsage=BO.validSchemaType=BO.funcKeywordCode=BO.macroKeywordCode=void 0;var o$=s(),F1=w6(),iS=A4(),nS=V8();function pS($,X){let{gen:J,keyword:Q,schema:z,parentSchema:Y,it:W}=$,G=X.macro.call(W.self,z,Y,W),U=OO(J,Q,G);if(W.opts.validateSchema!==!1)W.self.validateSchema(G,!0);let K=J.name("valid");$.subschema({schema:G,schemaPath:o$.nil,errSchemaPath:`${W.errSchemaPath}/${Q}`,topSchemaRef:U,compositeRule:!0},K),$.pass(K,()=>$.error(!0))}BO.macroKeywordCode=pS;function dS($,X){var J;let{gen:Q,keyword:z,schema:Y,parentSchema:W,$data:G,it:U}=$;oS(U,X);let K=!G&&X.compile?X.compile.call(U.self,Y,W,U):X.validate,w=OO(Q,z,K),V=Q.let("valid");$.block$data(V,H),$.ok((J=X.valid)!==null&&J!==void 0?J:V);function H(){if(X.errors===!1){if(B(),X.modifying)HO($);L(()=>$.error())}else{let F=X.async?N():O();if(X.modifying)HO($);L(()=>rS($,F))}}function N(){let F=Q.let("ruleErrs",null);return Q.try(()=>B(o$._`await `),(Z)=>Q.assign(V,!1).if(o$._`${Z} instanceof ${U.ValidationError}`,()=>Q.assign(F,o$._`${Z}.errors`),()=>Q.throw(Z))),F}function O(){let F=o$._`${w}.errors`;return Q.assign(F,null),B(o$.nil),F}function B(F=X.async?o$._`await `:o$.nil){let Z=U.opts.passContext?F1.default.this:F1.default.self,C=!(("compile"in X)&&!G||X.schema===!1);Q.assign(V,o$._`${F}${(0,iS.callValidateCode)($,w,Z,C)}`,X.modifying)}function L(F){var Z;Q.if((0,o$.not)((Z=X.valid)!==null&&Z!==void 0?Z:V),F)}}BO.funcKeywordCode=dS;function HO($){let{gen:X,data:J,it:Q}=$;X.if(Q.parentData,()=>X.assign(J,o$._`${Q.parentData}[${Q.parentDataProperty}]`))}function rS($,X){let{gen:J}=$;J.if(o$._`Array.isArray(${X})`,()=>{J.assign(F1.default.vErrors,o$._`${F1.default.vErrors} === null ? ${X} : ${F1.default.vErrors}.concat(${X})`).assign(F1.default.errors,o$._`${F1.default.vErrors}.length`),(0,nS.extendErrors)($)},()=>$.error())}function oS({schemaEnv:$},X){if(X.async&&!$.$async)throw Error("async keyword in sync schema")}function OO($,X,J){if(J===void 0)throw Error(`keyword "${X}" failed to compile`);return $.scopeValue("keyword",typeof J=="function"?{ref:J}:{ref:J,code:(0,o$.stringify)(J)})}function tS($,X,J=!1){return!X.length||X.some((Q)=>Q==="array"?Array.isArray($):Q==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==Q||J&&typeof $>"u")}BO.validSchemaType=tS;function aS({schema:$,opts:X,self:J,errSchemaPath:Q},z,Y){if(Array.isArray(z.keyword)?!z.keyword.includes(Y):z.keyword!==Y)throw Error("ajv implementation error");let W=z.dependencies;if(W===null||W===void 0?void 0:W.some((G)=>!Object.prototype.hasOwnProperty.call($,G)))throw Error(`parent schema must have dependencies of ${Y}: ${W.join(",")}`);if(z.validateSchema){if(!z.validateSchema($[Y])){let U=`keyword "${Y}" value is invalid at path "${Q}": `+J.errorsText(z.validateSchema.errors);if(X.validateSchema==="log")J.logger.error(U);else throw Error(U)}}}BO.validateKeywordUsage=aS});var MO=x((LO)=>{Object.defineProperty(LO,"__esModule",{value:!0});LO.extendSubschemaMode=LO.extendSubschemaData=LO.getSubschema=void 0;var i4=s(),qO=Y$();function XR($,{keyword:X,schemaProp:J,schema:Q,schemaPath:z,errSchemaPath:Y,topSchemaRef:W}){if(X!==void 0&&Q!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(X!==void 0){let G=$.schema[X];return J===void 0?{schema:G,schemaPath:i4._`${$.schemaPath}${(0,i4.getProperty)(X)}`,errSchemaPath:`${$.errSchemaPath}/${X}`}:{schema:G[J],schemaPath:i4._`${$.schemaPath}${(0,i4.getProperty)(X)}${(0,i4.getProperty)(J)}`,errSchemaPath:`${$.errSchemaPath}/${X}/${(0,qO.escapeFragment)(J)}`}}if(Q!==void 0){if(z===void 0||Y===void 0||W===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:Q,schemaPath:z,topSchemaRef:W,errSchemaPath:Y}}throw Error('either "keyword" or "schema" must be passed')}LO.getSubschema=XR;function JR($,X,{dataProp:J,dataPropType:Q,data:z,dataTypes:Y,propertyName:W}){if(z!==void 0&&J!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:G}=X;if(J!==void 0){let{errorPath:K,dataPathArr:w,opts:V}=X,H=G.let("data",i4._`${X.data}${(0,i4.getProperty)(J)}`,!0);U(H),$.errorPath=i4.str`${K}${(0,qO.getErrorPath)(J,Q,V.jsPropertySyntax)}`,$.parentDataProperty=i4._`${J}`,$.dataPathArr=[...w,$.parentDataProperty]}if(z!==void 0){let K=z instanceof i4.Name?z:G.let("data",z,!0);if(U(K),W!==void 0)$.propertyName=W}if(Y)$.dataTypes=Y;function U(K){$.data=K,$.dataLevel=X.dataLevel+1,$.dataTypes=[],X.definedProperties=new Set,$.parentData=X.data,$.dataNames=[...X.dataNames,K]}}LO.extendSubschemaData=JR;function zR($,{jtdDiscriminator:X,jtdMetadata:J,compositeRule:Q,createErrors:z,allErrors:Y}){if(Q!==void 0)$.compositeRule=Q;if(z!==void 0)$.createErrors=z;if(Y!==void 0)$.allErrors=Y;$.jtdDiscriminator=X,$.jtdMetadata=J}LO.extendSubschemaMode=zR});var T3=x((ct,IO)=>{IO.exports=function $(X,J){if(X===J)return!0;if(X&&J&&typeof X=="object"&&typeof J=="object"){if(X.constructor!==J.constructor)return!1;var Q,z,Y;if(Array.isArray(X)){if(Q=X.length,Q!=J.length)return!1;for(z=Q;z--!==0;)if(!$(X[z],J[z]))return!1;return!0}if(X.constructor===RegExp)return X.source===J.source&&X.flags===J.flags;if(X.valueOf!==Object.prototype.valueOf)return X.valueOf()===J.valueOf();if(X.toString!==Object.prototype.toString)return X.toString()===J.toString();if(Y=Object.keys(X),Q=Y.length,Q!==Object.keys(J).length)return!1;for(z=Q;z--!==0;)if(!Object.prototype.hasOwnProperty.call(J,Y[z]))return!1;for(z=Q;z--!==0;){var W=Y[z];if(!$(X[W],J[W]))return!1}return!0}return X!==X&&J!==J}});var bO=x((it,AO)=>{var h6=AO.exports=function($,X,J){if(typeof X=="function")J=X,X={};J=X.cb||J;var Q=typeof J=="function"?J:J.pre||function(){},z=J.post||function(){};HQ(X,Q,z,$,"",$)};h6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};h6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};h6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};h6.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function HQ($,X,J,Q,z,Y,W,G,U,K){if(Q&&typeof Q=="object"&&!Array.isArray(Q)){X(Q,z,Y,W,G,U,K);for(var w in Q){var V=Q[w];if(Array.isArray(V)){if(w in h6.arrayKeywords)for(var H=0;H<V.length;H++)HQ($,X,J,V[H],z+"/"+w+"/"+H,Y,z,w,Q,H)}else if(w in h6.propsKeywords){if(V&&typeof V=="object")for(var N in V)HQ($,X,J,V[N],z+"/"+w+"/"+WR(N),Y,z,w,Q,N)}else if(w in h6.keywords||$.allKeys&&!(w in h6.skipKeywords))HQ($,X,J,V,z+"/"+w,Y,z,w,Q)}J(Q,z,Y,W,G,U,K)}}function WR($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var H8=x((RO)=>{Object.defineProperty(RO,"__esModule",{value:!0});RO.getSchemaRefs=RO.resolveUrl=RO.normalizeId=RO._getFullPath=RO.getFullPath=RO.inlineRef=void 0;var GR=Y$(),UR=T3(),KR=bO(),wR=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function VR($,X=!0){if(typeof $=="boolean")return!0;if(X===!0)return!f3($);if(!X)return!1;return PO($)<=X}RO.inlineRef=VR;var NR=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function f3($){for(let X in $){if(NR.has(X))return!0;let J=$[X];if(Array.isArray(J)&&J.some(f3))return!0;if(typeof J=="object"&&f3(J))return!0}return!1}function PO($){let X=0;for(let J in $){if(J==="$ref")return 1/0;if(X++,wR.has(J))continue;if(typeof $[J]=="object")(0,GR.eachItem)($[J],(Q)=>X+=PO(Q));if(X===1/0)return 1/0}return X}function ZO($,X="",J){if(J!==!1)X=E0(X);let Q=$.parse(X);return SO($,Q)}RO.getFullPath=ZO;function SO($,X){return $.serialize(X).split("#")[0]+"#"}RO._getFullPath=SO;var HR=/#\/?$/;function E0($){return $?$.replace(HR,""):""}RO.normalizeId=E0;function OR($,X,J){return J=E0(J),$.resolve(X,J)}RO.resolveUrl=OR;var BR=/^[a-z_][-a-z0-9._]*$/i;function jR($,X){if(typeof $=="boolean")return{};let{schemaId:J,uriResolver:Q}=this.opts,z=E0($[J]||X),Y={"":z},W=ZO(Q,z,!1),G={},U=new Set;return KR($,{allKeys:!0},(V,H,N,O)=>{if(O===void 0)return;let B=W+H,L=Y[O];if(typeof V[J]=="string")L=F.call(this,V[J]);Z.call(this,V.$anchor),Z.call(this,V.$dynamicAnchor),Y[H]=L;function F(C){let m=this.opts.uriResolver.resolve;if(C=E0(L?m(L,C):C),U.has(C))throw w(C);U.add(C);let c=this.refs[C];if(typeof c=="string")c=this.refs[c];if(typeof c=="object")K(V,c.schema,C);else if(C!==E0(B))if(C[0]==="#")K(V,G[C],C),G[C]=V;else this.refs[C]=B;return C}function Z(C){if(typeof C=="string"){if(!BR.test(C))throw Error(`invalid anchor "${C}"`);F.call(this,`#${C}`)}}}),G;function K(V,H,N){if(H!==void 0&&!UR(V,H))throw w(N)}function w(V){return Error(`reference "${V}" resolves to more than one schema`)}}RO.getSchemaRefs=jR});var j8=x((iO)=>{Object.defineProperty(iO,"__esModule",{value:!0});iO.getData=iO.KeywordCxt=iO.validateFunctionCode=void 0;var xO=dH(),vO=N8(),y3=R3(),OQ=N8(),IR=UO(),B8=DO(),g3=MO(),u=s(),r=w6(),AR=H8(),V6=Y$(),O8=V8();function bR($){if(gO($)){if(yO($),fO($)){SR($);return}}TO($,()=>(0,xO.topBoolOrEmptySchema)($))}iO.validateFunctionCode=bR;function TO({gen:$,validateName:X,schema:J,schemaEnv:Q,opts:z},Y){if(z.code.es5)$.func(X,u._`${r.default.data}, ${r.default.valCxt}`,Q.$async,()=>{$.code(u._`"use strict"; ${CO(J,z)}`),ZR($,z),$.code(Y)});else $.func(X,u._`${r.default.data}, ${PR(z)}`,Q.$async,()=>$.code(CO(J,z)).code(Y))}function PR($){return u._`{${r.default.instancePath}="", ${r.default.parentData}, ${r.default.parentDataProperty}, ${r.default.rootData}=${r.default.data}${$.dynamicRef?u._`, ${r.default.dynamicAnchors}={}`:u.nil}}={}`}function ZR($,X){$.if(r.default.valCxt,()=>{if($.var(r.default.instancePath,u._`${r.default.valCxt}.${r.default.instancePath}`),$.var(r.default.parentData,u._`${r.default.valCxt}.${r.default.parentData}`),$.var(r.default.parentDataProperty,u._`${r.default.valCxt}.${r.default.parentDataProperty}`),$.var(r.default.rootData,u._`${r.default.valCxt}.${r.default.rootData}`),X.dynamicRef)$.var(r.default.dynamicAnchors,u._`${r.default.valCxt}.${r.default.dynamicAnchors}`)},()=>{if($.var(r.default.instancePath,u._`""`),$.var(r.default.parentData,u._`undefined`),$.var(r.default.parentDataProperty,u._`undefined`),$.var(r.default.rootData,r.default.data),X.dynamicRef)$.var(r.default.dynamicAnchors,u._`{}`)})}function SR($){let{schema:X,opts:J,gen:Q}=$;TO($,()=>{if(J.$comment&&X.$comment)uO($);if(kR($),Q.let(r.default.vErrors,null),Q.let(r.default.errors,0),J.unevaluated)RR($);hO($),TR($)});return}function RR($){let{gen:X,validateName:J}=$;$.evaluated=X.const("evaluated",u._`${J}.evaluated`),X.if(u._`${$.evaluated}.dynamicProps`,()=>X.assign(u._`${$.evaluated}.props`,u._`undefined`)),X.if(u._`${$.evaluated}.dynamicItems`,()=>X.assign(u._`${$.evaluated}.items`,u._`undefined`))}function CO($,X){let J=typeof $=="object"&&$[X.schemaId];return J&&(X.code.source||X.code.process)?u._`/*# sourceURL=${J} */`:u.nil}function ER($,X){if(gO($)){if(yO($),fO($)){vR($,X);return}}(0,xO.boolOrEmptySchema)($,X)}function fO({schema:$,self:X}){if(typeof $=="boolean")return!$;for(let J in $)if(X.RULES.all[J])return!0;return!1}function gO($){return typeof $.schema!="boolean"}function vR($,X){let{schema:J,gen:Q,opts:z}=$;if(z.$comment&&J.$comment)uO($);_R($),xR($);let Y=Q.const("_errs",r.default.errors);hO($,Y),Q.var(X,u._`${Y} === ${r.default.errors}`)}function yO($){(0,V6.checkUnknownRules)($),CR($)}function hO($,X){if($.opts.jtd)return kO($,[],!1,X);let J=(0,vO.getSchemaTypes)($.schema),Q=(0,vO.coerceAndCheckDataType)($,J);kO($,J,!Q,X)}function CR($){let{schema:X,errSchemaPath:J,opts:Q,self:z}=$;if(X.$ref&&Q.ignoreKeywordsWithRef&&(0,V6.schemaHasRulesButRef)(X,z.RULES))z.logger.warn(`$ref: keywords ignored in schema at path "${J}"`)}function kR($){let{schema:X,opts:J}=$;if(X.default!==void 0&&J.useDefaults&&J.strictSchema)(0,V6.checkStrictMode)($,"default is ignored in the schema root")}function _R($){let X=$.schema[$.opts.schemaId];if(X)$.baseId=(0,AR.resolveUrl)($.opts.uriResolver,$.baseId,X)}function xR($){if($.schema.$async&&!$.schemaEnv.$async)throw Error("async schema in sync schema")}function uO({gen:$,schemaEnv:X,schema:J,errSchemaPath:Q,opts:z}){let Y=J.$comment;if(z.$comment===!0)$.code(u._`${r.default.self}.logger.log(${Y})`);else if(typeof z.$comment=="function"){let W=u.str`${Q}/$comment`,G=$.scopeValue("root",{ref:X.root});$.code(u._`${r.default.self}.opts.$comment(${Y}, ${W}, ${G}.schema)`)}}function TR($){let{gen:X,schemaEnv:J,validateName:Q,ValidationError:z,opts:Y}=$;if(J.$async)X.if(u._`${r.default.errors} === 0`,()=>X.return(r.default.data),()=>X.throw(u._`new ${z}(${r.default.vErrors})`));else{if(X.assign(u._`${Q}.errors`,r.default.vErrors),Y.unevaluated)fR($);X.return(u._`${r.default.errors} === 0`)}}function fR({gen:$,evaluated:X,props:J,items:Q}){if(J instanceof u.Name)$.assign(u._`${X}.props`,J);if(Q instanceof u.Name)$.assign(u._`${X}.items`,Q)}function kO($,X,J,Q){let{gen:z,schema:Y,data:W,allErrors:G,opts:U,self:K}=$,{RULES:w}=K;if(Y.$ref&&(U.ignoreKeywordsWithRef||!(0,V6.schemaHasRulesButRef)(Y,w))){z.block(()=>mO($,"$ref",w.all.$ref.definition));return}if(!U.jtd)gR($,X);z.block(()=>{for(let H of w.rules)V(H);V(w.post)});function V(H){if(!(0,y3.shouldUseGroup)(Y,H))return;if(H.type){if(z.if((0,OQ.checkDataType)(H.type,W,U.strictNumbers)),_O($,H),X.length===1&&X[0]===H.type&&J)z.else(),(0,OQ.reportTypeError)($);z.endIf()}else _O($,H);if(!G)z.if(u._`${r.default.errors} === ${Q||0}`)}}function _O($,X){let{gen:J,schema:Q,opts:{useDefaults:z}}=$;if(z)(0,IR.assignDefaults)($,X.type);J.block(()=>{for(let Y of X.rules)if((0,y3.shouldUseRule)(Q,Y))mO($,Y.keyword,Y.definition,X.type)})}function gR($,X){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(yR($,X),!$.opts.allowUnionTypes)hR($,X);uR($,$.dataTypes)}function yR($,X){if(!X.length)return;if(!$.dataTypes.length){$.dataTypes=X;return}X.forEach((J)=>{if(!lO($.dataTypes,J))h3($,`type "${J}" not allowed by context "${$.dataTypes.join(",")}"`)}),mR($,X)}function hR($,X){if(X.length>1&&!(X.length===2&&X.includes("null")))h3($,"use allowUnionTypes to allow union type keyword")}function uR($,X){let J=$.self.RULES.all;for(let Q in J){let z=J[Q];if(typeof z=="object"&&(0,y3.shouldUseRule)($.schema,z)){let{type:Y}=z.definition;if(Y.length&&!Y.some((W)=>lR(X,W)))h3($,`missing type "${Y.join(",")}" for keyword "${Q}"`)}}}function lR($,X){return $.includes(X)||X==="number"&&$.includes("integer")}function lO($,X){return $.includes(X)||X==="integer"&&$.includes("number")}function mR($,X){let J=[];for(let Q of $.dataTypes)if(lO(X,Q))J.push(Q);else if(X.includes("integer")&&Q==="number")J.push("integer");$.dataTypes=J}function h3($,X){let J=$.schemaEnv.baseId+$.errSchemaPath;X+=` at "${J}" (strictTypes)`,(0,V6.checkStrictMode)($,X,$.opts.strictTypes)}class u3{constructor($,X,J){if((0,B8.validateKeywordUsage)($,X,J),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=J,this.data=$.data,this.schema=$.schema[J],this.$data=X.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,V6.schemaRefOrVal)($,this.schema,J,this.$data),this.schemaType=X.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=X,this.$data)this.schemaCode=$.gen.const("vSchema",cO(this.$data,$));else if(this.schemaCode=this.schemaValue,!(0,B8.validSchemaType)(this.schema,X.schemaType,X.allowUndefined))throw Error(`${J} value must be ${JSON.stringify(X.schemaType)}`);if("code"in X?X.trackErrors:X.errors!==!1)this.errsCount=$.gen.const("_errs",r.default.errors)}result($,X,J){this.failResult((0,u.not)($),X,J)}failResult($,X,J){if(this.gen.if($),J)J();else this.error();if(X){if(this.gen.else(),X(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,X){this.failResult((0,u.not)($),void 0,X)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:X}=this;this.fail(u._`${X} !== undefined && (${(0,u.or)(this.invalid$data(),$)})`)}error($,X,J){if(X){this.setParams(X),this._error($,J),this.setParams({});return}this._error($,J)}_error($,X){($?O8.reportExtraError:O8.reportError)(this,this.def.error,X)}$dataError(){(0,O8.reportError)(this,this.def.$dataError||O8.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,O8.resetErrorsCount)(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,X){if(X)Object.assign(this.params,$);else this.params=$}block$data($,X,J=u.nil){this.gen.block(()=>{this.check$data($,J),X()})}check$data($=u.nil,X=u.nil){if(!this.$data)return;let{gen:J,schemaCode:Q,schemaType:z,def:Y}=this;if(J.if((0,u.or)(u._`${Q} === undefined`,X)),$!==u.nil)J.assign($,!0);if(z.length||Y.validateSchema){if(J.elseIf(this.invalid$data()),this.$dataError(),$!==u.nil)J.assign($,!1)}J.else()}invalid$data(){let{gen:$,schemaCode:X,schemaType:J,def:Q,it:z}=this;return(0,u.or)(Y(),W());function Y(){if(J.length){if(!(X instanceof u.Name))throw Error("ajv implementation error");let G=Array.isArray(J)?J:[J];return u._`${(0,OQ.checkDataTypes)(G,X,z.opts.strictNumbers,OQ.DataType.Wrong)}`}return u.nil}function W(){if(Q.validateSchema){let G=$.scopeValue("validate$data",{ref:Q.validateSchema});return u._`!${G}(${X})`}return u.nil}}subschema($,X){let J=(0,g3.getSubschema)(this.it,$);(0,g3.extendSubschemaData)(J,this.it,$),(0,g3.extendSubschemaMode)(J,$);let Q={...this.it,...J,items:void 0,props:void 0};return ER(Q,X),Q}mergeEvaluated($,X){let{it:J,gen:Q}=this;if(!J.opts.unevaluated)return;if(J.props!==!0&&$.props!==void 0)J.props=V6.mergeEvaluated.props(Q,$.props,J.props,X);if(J.items!==!0&&$.items!==void 0)J.items=V6.mergeEvaluated.items(Q,$.items,J.items,X)}mergeValidEvaluated($,X){let{it:J,gen:Q}=this;if(J.opts.unevaluated&&(J.props!==!0||J.items!==!0))return Q.if(X,()=>this.mergeEvaluated($,u.Name)),!0}}iO.KeywordCxt=u3;function mO($,X,J,Q){let z=new u3($,J,X);if("code"in J)J.code(z,Q);else if(z.$data&&J.validate)(0,B8.funcKeywordCode)(z,J);else if("macro"in J)(0,B8.macroKeywordCode)(z,J);else if(J.compile||J.validate)(0,B8.funcKeywordCode)(z,J)}var cR=/^\/(?:[^~]|~0|~1)*$/,iR=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function cO($,{dataLevel:X,dataNames:J,dataPathArr:Q}){let z,Y;if($==="")return r.default.rootData;if($[0]==="/"){if(!cR.test($))throw Error(`Invalid JSON-pointer: ${$}`);z=$,Y=r.default.rootData}else{let K=iR.exec($);if(!K)throw Error(`Invalid JSON-pointer: ${$}`);let w=+K[1];if(z=K[2],z==="#"){if(w>=X)throw Error(U("property/index",w));return Q[X-w]}if(w>X)throw Error(U("data",w));if(Y=J[X-w],!z)return Y}let W=Y,G=z.split("/");for(let K of G)if(K)Y=u._`${Y}${(0,u.getProperty)((0,V6.unescapeJsonPointer)(K))}`,W=u._`${W} && ${Y}`;return W;function U(K,w){return`Cannot access ${K} ${w} levels up, current level is ${X}`}}iO.getData=cO});var BQ=x((dO)=>{Object.defineProperty(dO,"__esModule",{value:!0});class pO extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}dO.default=pO});var D8=x((oO)=>{Object.defineProperty(oO,"__esModule",{value:!0});var l3=H8();class rO extends Error{constructor($,X,J,Q){super(Q||`can't resolve reference ${J} from id ${X}`);this.missingRef=(0,l3.resolveUrl)($,X,J),this.missingSchema=(0,l3.normalizeId)((0,l3.getFullPath)($,this.missingRef))}}oO.default=rO});var DQ=x((sO)=>{Object.defineProperty(sO,"__esModule",{value:!0});sO.resolveSchema=sO.getCompilingSchema=sO.resolveRef=sO.compileSchema=sO.SchemaEnv=void 0;var T4=s(),oR=BQ(),M1=w6(),f4=H8(),tO=Y$(),tR=j8();class q8{constructor($){var X;this.refs={},this.dynamicAnchors={};let J;if(typeof $.schema=="object")J=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(X=$.baseId)!==null&&X!==void 0?X:(0,f4.normalizeId)(J===null||J===void 0?void 0:J[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=J===null||J===void 0?void 0:J.$async,this.refs={}}}sO.SchemaEnv=q8;function c3($){let X=aO.call(this,$);if(X)return X;let J=(0,f4.getFullPath)(this.opts.uriResolver,$.root.baseId),{es5:Q,lines:z}=this.opts.code,{ownProperties:Y}=this.opts,W=new T4.CodeGen(this.scope,{es5:Q,lines:z,ownProperties:Y}),G;if($.$async)G=W.scopeValue("Error",{ref:oR.default,code:T4._`require("ajv/dist/runtime/validation_error").default`});let U=W.scopeName("validate");$.validateName=U;let K={gen:W,allErrors:this.opts.allErrors,data:M1.default.data,parentData:M1.default.parentData,parentDataProperty:M1.default.parentDataProperty,dataNames:[M1.default.data],dataPathArr:[T4.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:W.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:(0,T4.stringify)($.schema)}:{ref:$.schema}),validateName:U,ValidationError:G,schema:$.schema,schemaEnv:$,rootId:J,baseId:$.baseId||J,schemaPath:T4.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:T4._`""`,opts:this.opts,self:this},w;try{this._compilations.add($),(0,tR.validateFunctionCode)(K),W.optimize(this.opts.code.optimize);let V=W.toString();if(w=`${W.scopeRefs(M1.default.scope)}return ${V}`,this.opts.code.process)w=this.opts.code.process(w,$);let N=Function(`${M1.default.self}`,`${M1.default.scope}`,w)(this,this.scope.get());if(this.scope.value(U,{ref:N}),N.errors=null,N.schema=$.schema,N.schemaEnv=$,$.$async)N.$async=!0;if(this.opts.code.source===!0)N.source={validateName:U,validateCode:V,scopeValues:W._values};if(this.opts.unevaluated){let{props:O,items:B}=K;if(N.evaluated={props:O instanceof T4.Name?void 0:O,items:B instanceof T4.Name?void 0:B,dynamicProps:O instanceof T4.Name,dynamicItems:B instanceof T4.Name},N.source)N.source.evaluated=(0,T4.stringify)(N.evaluated)}return $.validate=N,$}catch(V){if(delete $.validate,delete $.validateName,w)this.logger.error("Error compiling schema, function code:",w);throw V}finally{this._compilations.delete($)}}sO.compileSchema=c3;function aR($,X,J){var Q;J=(0,f4.resolveUrl)(this.opts.uriResolver,X,J);let z=$.refs[J];if(z)return z;let Y=$E.call(this,$,J);if(Y===void 0){let W=(Q=$.localRefs)===null||Q===void 0?void 0:Q[J],{schemaId:G}=this.opts;if(W)Y=new q8({schema:W,schemaId:G,root:$,baseId:X})}if(Y===void 0)return;return $.refs[J]=sR.call(this,Y)}sO.resolveRef=aR;function sR($){if((0,f4.inlineRef)($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:c3.call(this,$)}function aO($){for(let X of this._compilations)if(eR(X,$))return X}sO.getCompilingSchema=aO;function eR($,X){return $.schema===X.schema&&$.root===X.root&&$.baseId===X.baseId}function $E($,X){let J;while(typeof(J=this.refs[X])=="string")X=J;return J||this.schemas[X]||jQ.call(this,$,X)}function jQ($,X){let J=this.opts.uriResolver.parse(X),Q=(0,f4._getFullPath)(this.opts.uriResolver,J),z=(0,f4.getFullPath)(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&Q===z)return m3.call(this,J,$);let Y=(0,f4.normalizeId)(Q),W=this.refs[Y]||this.schemas[Y];if(typeof W=="string"){let G=jQ.call(this,$,W);if(typeof(G===null||G===void 0?void 0:G.schema)!=="object")return;return m3.call(this,J,G)}if(typeof(W===null||W===void 0?void 0:W.schema)!=="object")return;if(!W.validate)c3.call(this,W);if(Y===(0,f4.normalizeId)(X)){let{schema:G}=W,{schemaId:U}=this.opts,K=G[U];if(K)z=(0,f4.resolveUrl)(this.opts.uriResolver,z,K);return new q8({schema:G,schemaId:U,root:$,baseId:z})}return m3.call(this,J,W)}sO.resolveSchema=jQ;var XE=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function m3($,{baseId:X,schema:J,root:Q}){var z;if(((z=$.fragment)===null||z===void 0?void 0:z[0])!=="/")return;for(let G of $.fragment.slice(1).split("/")){if(typeof J==="boolean")return;let U=J[(0,tO.unescapeFragment)(G)];if(U===void 0)return;J=U;let K=typeof J==="object"&&J[this.opts.schemaId];if(!XE.has(G)&&K)X=(0,f4.resolveUrl)(this.opts.uriResolver,X,K)}let Y;if(typeof J!="boolean"&&J.$ref&&!(0,tO.schemaHasRulesButRef)(J,this.RULES)){let G=(0,f4.resolveUrl)(this.opts.uriResolver,X,J.$ref);Y=jQ.call(this,Q,G)}let{schemaId:W}=this.opts;if(Y=Y||new q8({schema:J,schemaId:W,root:Q,baseId:X}),Y.schema!==Y.root.schema)return Y;return}});var $B=x((tt,WE)=>{WE.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var p3=x((at,WB)=>{var GE=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),JB=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),i3=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),zB=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),UE=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function n3($){let X="",J=0,Q=0;for(Q=0;Q<$.length;Q++){if(J=$[Q].charCodeAt(0),J===48)continue;if(!(J>=48&&J<=57||J>=65&&J<=70||J>=97&&J<=102))return"";X+=$[Q];break}for(Q+=1;Q<$.length;Q++){if(J=$[Q].charCodeAt(0),!(J>=48&&J<=57||J>=65&&J<=70||J>=97&&J<=102))return"";X+=$[Q]}return X}var KE=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function XB($){return $.length=0,!0}function wE($,X,J){if($.length){let Q=n3($);if(Q!=="")X.push(Q);else return J.error=!0,!1;$.length=0}return!0}function VE($){let X=0,J={error:!1,address:"",zone:""},Q=[],z=[],Y=!1,W=!1,G=wE;for(let U=0;U<$.length;U++){let K=$[U];if(K==="["||K==="]")continue;if(K===":"){if(Y===!0)W=!0;if(!G(z,Q,J))break;if(++X>7){J.error=!0;break}if(U>0&&$[U-1]===":")Y=!0;Q.push(":");continue}else if(K==="%"){if(!G(z,Q,J))break;G=XB}else{z.push(K);continue}}if(z.length)if(G===XB)J.zone=z.join("");else if(W)Q.push(z.join(""));else Q.push(n3(z));return J.address=Q.join(""),J}function QB($){if(NE($,":")<2)return{host:$,isIPV6:!1};let X=VE($);if(!X.error){let{address:J,address:Q}=X;if(X.zone)J+="%"+X.zone,Q+="%25"+X.zone;return{host:J,isIPV6:!0,escapedHost:Q}}else return{host:$,isIPV6:!1}}function NE($,X){let J=0;for(let Q=0;Q<$.length;Q++)if($[Q]===X)J++;return J}function HE($){let X=$,J=[],Q=-1,z=0;while(z=X.length){if(z===1)if(X===".")break;else if(X==="/"){J.push("/");break}else{J.push(X);break}else if(z===2){if(X[0]==="."){if(X[1]===".")break;else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."||X[1]==="/"){J.push("/");break}}}else if(z===3){if(X==="/.."){if(J.length!==0)J.pop();J.push("/");break}}if(X[0]==="."){if(X[1]==="."){if(X[2]==="/"){X=X.slice(3);continue}}else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."){if(X[2]==="/"){X=X.slice(2);continue}else if(X[2]==="."){if(X[3]==="/"){if(X=X.slice(3),J.length!==0)J.pop();continue}}}}if((Q=X.indexOf("/",1))===-1){J.push(X);break}else J.push(X.slice(0,Q)),X=X.slice(Q)}return J.join("")}var OE={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},BE=/[@/?#:]/g,jE=/[@/?#]/g;function YB($,X){let J=X?jE:BE;return J.lastIndex=0,$.replace(J,(Q)=>OE[Q])}function DE($,X=!1){if($.indexOf("%")===-1)return $;let J="";for(let Q=0;Q<$.length;Q++){if($[Q]==="%"&&Q+2<$.length){let z=$.slice(Q+1,Q+3);if(i3(z)){let Y=z.toUpperCase(),W=String.fromCharCode(parseInt(Y,16));if(X&&zB(W))J+=W;else J+="%"+Y;Q+=2;continue}}J+=$[Q]}return J}function qE($){let X="";for(let J=0;J<$.length;J++){if($[J]==="%"&&J+2<$.length){let Q=$.slice(J+1,J+3);if(i3(Q)){let z=Q.toUpperCase(),Y=String.fromCharCode(parseInt(z,16));if(Y!=="."&&zB(Y))X+=Y;else X+="%"+z;J+=2;continue}}if(UE($[J]))X+=$[J];else X+=escape($[J])}return X}function LE($){let X="";for(let J=0;J<$.length;J++){if($[J]==="%"&&J+2<$.length){let Q=$.slice(J+1,J+3);if(i3(Q)){X+="%"+Q.toUpperCase(),J+=2;continue}}X+=escape($[J])}return X}function FE($){let X=[];if($.userinfo!==void 0)X.push($.userinfo),X.push("@");if($.host!==void 0){let J=unescape($.host);if(!JB(J)){let Q=QB(J);if(Q.isIPV6===!0)J=`[${Q.escapedHost}]`;else J=YB(J,!1)}X.push(J)}if(typeof $.port==="number"||typeof $.port==="string")X.push(":"),X.push(String($.port));return X.length?X.join(""):void 0}WB.exports={nonSimpleDomain:KE,recomposeAuthority:FE,reescapeHostDelimiters:YB,normalizePercentEncoding:DE,normalizePathEncoding:qE,escapePreservingEscapes:LE,removeDotSegments:HE,isIPv4:JB,isUUID:GE,normalizeIPv6:QB,stringArrayToHexStripped:n3}});var VB=x((st,wB)=>{var{isUUID:ME}=p3(),IE=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,AE=["http","https","ws","wss","urn","urn:uuid"];function bE($){return AE.indexOf($)!==-1}function d3($){if($.secure===!0)return!0;else if($.secure===!1)return!1;else if($.scheme)return $.scheme.length===3&&($.scheme[0]==="w"||$.scheme[0]==="W")&&($.scheme[1]==="s"||$.scheme[1]==="S")&&($.scheme[2]==="s"||$.scheme[2]==="S");else return!1}function GB($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function UB($){let X=String($.scheme).toLowerCase()==="https";if($.port===(X?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function PE($){return $.secure=d3($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function ZE($){if($.port===(d3($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[X,J]=$.resourceName.split("?");$.path=X&&X!=="/"?X:void 0,$.query=J,$.resourceName=void 0}return $.fragment=void 0,$}function SE($,X){if(!$.path)return $.error="URN can not be parsed",$;let J=$.path.match(IE);if(J){let Q=X.scheme||$.scheme||"urn";$.nid=J[1].toLowerCase(),$.nss=J[2];let z=`${Q}:${X.nid||$.nid}`,Y=r3(z);if($.path=void 0,Y)$=Y.parse($,X)}else $.error=$.error||"URN can not be parsed.";return $}function RE($,X){if($.nid===void 0)throw Error("URN without nid cannot be serialized");let J=X.scheme||$.scheme||"urn",Q=$.nid.toLowerCase(),z=`${J}:${X.nid||Q}`,Y=r3(z);if(Y)$=Y.serialize($,X);let W=$,G=$.nss;return W.path=`${Q||X.nid}:${G}`,X.skipEscape=!0,W}function EE($,X){let J=$;if(J.uuid=J.nss,J.nss=void 0,!X.tolerant&&(!J.uuid||!ME(J.uuid)))J.error=J.error||"UUID is not valid.";return J}function vE($){let X=$;return X.nss=($.uuid||"").toLowerCase(),X}var KB={scheme:"http",domainHost:!0,parse:GB,serialize:UB},CE={scheme:"https",domainHost:KB.domainHost,parse:GB,serialize:UB},qQ={scheme:"ws",domainHost:!0,parse:PE,serialize:ZE},kE={scheme:"wss",domainHost:qQ.domainHost,parse:qQ.parse,serialize:qQ.serialize},_E={scheme:"urn",parse:SE,serialize:RE,skipNormalize:!0},xE={scheme:"urn:uuid",parse:EE,serialize:vE,skipNormalize:!0},LQ={http:KB,https:CE,ws:qQ,wss:kE,urn:_E,"urn:uuid":xE};Object.setPrototypeOf(LQ,null);function r3($){return $&&(LQ[$]||LQ[$.toLowerCase()])||void 0}wB.exports={wsIsSecure:d3,SCHEMES:LQ,isValidSchemeName:bE,getSchemeHandler:r3}});var DB=x((et,FQ)=>{var{normalizeIPv6:TE,removeDotSegments:L8,recomposeAuthority:fE,normalizePercentEncoding:gE,normalizePathEncoding:yE,escapePreservingEscapes:hE,reescapeHostDelimiters:uE,isIPv4:lE,nonSimpleDomain:mE}=p3(),{SCHEMES:cE,getSchemeHandler:HB}=VB();function iE($,X){if(typeof $==="string")$=oE($,X);else if(typeof $==="object")$=v0(I1($,X),X);return $}function nE($,X,J){let Q=J?Object.assign({scheme:"null"},J):{scheme:"null"},z=OB(v0($,Q),v0(X,Q),Q,!0);return Q.skipEscape=!0,I1(z,Q)}function OB($,X,J,Q){let z={};if(!Q)$=v0(I1($,J),J),X=v0(I1(X,J),J);if(J=J||{},!J.tolerant&&X.scheme)z.scheme=X.scheme,z.userinfo=X.userinfo,z.host=X.host,z.port=X.port,z.path=L8(X.path||""),z.query=X.query;else{if(X.userinfo!==void 0||X.host!==void 0||X.port!==void 0)z.userinfo=X.userinfo,z.host=X.host,z.port=X.port,z.path=L8(X.path||""),z.query=X.query;else{if(!X.path)if(z.path=$.path,X.query!==void 0)z.query=X.query;else z.query=$.query;else{if(X.path[0]==="/")z.path=L8(X.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)z.path="/"+X.path;else if(!$.path)z.path=X.path;else z.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+X.path;z.path=L8(z.path)}z.query=X.query}z.userinfo=$.userinfo,z.host=$.host,z.port=$.port}z.scheme=$.scheme}return z.fragment=X.fragment,z}function pE($,X,J){let Q=NB($,J),z=NB(X,J);return Q!==void 0&&z!==void 0&&Q.toLowerCase()===z.toLowerCase()}function I1($,X){let J={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},Q=Object.assign({},X),z=[],Y=HB(Q.scheme||J.scheme);if(Y&&Y.serialize)Y.serialize(J,Q);if(J.path!==void 0)if(!Q.skipEscape){if(J.path=hE(J.path),J.scheme!==void 0)J.path=J.path.split("%3A").join(":")}else J.path=gE(J.path);if(Q.reference!=="suffix"&&J.scheme)z.push(J.scheme,":");let W=fE(J);if(W!==void 0){if(Q.reference!=="suffix")z.push("//");if(z.push(W),J.path&&J.path[0]!=="/")z.push("/")}if(J.path!==void 0){let G=J.path;if(!Q.absolutePath&&(!Y||!Y.absolutePath))G=L8(G);if(W===void 0&&G[0]==="/"&&G[1]==="/")G="/%2F"+G.slice(2);z.push(G)}if(J.query!==void 0)z.push("?",J.query);if(J.fragment!==void 0)z.push("#",J.fragment);return z.join("")}var dE=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function rE($,X){if(X[2]!==void 0&&$.path&&$.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof $.port==="number"&&($.port<0||$.port>65535))return"URI port is malformed.";return}function BB($,X){let J=Object.assign({},X),Q={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},z=!1,Y=!1;if(J.reference==="suffix")if(J.scheme)$=J.scheme+":"+$;else $="//"+$;let W=$.match(dE);if(W){if(Q.scheme=W[1],Q.userinfo=W[3],Q.host=W[4],Q.port=parseInt(W[5],10),Q.path=W[6]||"",Q.query=W[7],Q.fragment=W[8],isNaN(Q.port))Q.port=W[5];let G=rE(Q,W);if(G!==void 0)Q.error=Q.error||G,z=!0;if(Q.host)if(lE(Q.host)===!1){let w=TE(Q.host);Q.host=w.host.toLowerCase(),Y=w.isIPV6}else Y=!0;if(Q.scheme===void 0&&Q.userinfo===void 0&&Q.host===void 0&&Q.port===void 0&&Q.query===void 0&&!Q.path)Q.reference="same-document";else if(Q.scheme===void 0)Q.reference="relative";else if(Q.fragment===void 0)Q.reference="absolute";else Q.reference="uri";if(J.reference&&J.reference!=="suffix"&&J.reference!==Q.reference)Q.error=Q.error||"URI is not a "+J.reference+" reference.";let U=HB(J.scheme||Q.scheme);if(!J.unicodeSupport&&(!U||!U.unicodeSupport)){if(Q.host&&(J.domainHost||U&&U.domainHost)&&Y===!1&&mE(Q.host))try{Q.host=URL.domainToASCII(Q.host.toLowerCase())}catch(K){Q.error=Q.error||"Host's domain name can not be converted to ASCII: "+K}}if(!U||U&&!U.skipNormalize){if($.indexOf("%")!==-1){if(Q.scheme!==void 0)Q.scheme=unescape(Q.scheme);if(Q.host!==void 0)Q.host=uE(unescape(Q.host),Y)}if(Q.path)Q.path=yE(Q.path);if(Q.fragment)try{Q.fragment=encodeURI(decodeURIComponent(Q.fragment))}catch{Q.error=Q.error||"URI malformed"}}if(U&&U.parse)U.parse(Q,J)}else Q.error=Q.error||"URI can not be parsed.";return{parsed:Q,malformedAuthorityOrPort:z}}function v0($,X){return BB($,X).parsed}function oE($,X){return jB($,X).normalized}function jB($,X){let{parsed:J,malformedAuthorityOrPort:Q}=BB($,X);return{normalized:Q?$:I1(J,X),malformedAuthorityOrPort:Q}}function NB($,X){if(typeof $==="string"){let{normalized:J,malformedAuthorityOrPort:Q}=jB($,X);return Q?void 0:J}if(typeof $==="object")return I1($,X)}var o3={SCHEMES:cE,normalize:iE,resolve:nE,resolveComponent:OB,equal:pE,serialize:I1,parse:v0};FQ.exports=o3;FQ.exports.default=o3;FQ.exports.fastUri=o3});var FB=x((LB)=>{Object.defineProperty(LB,"__esModule",{value:!0});var qB=DB();qB.code='require("ajv/dist/runtime/uri").default';LB.default=qB});var RB=x((N6)=>{Object.defineProperty(N6,"__esModule",{value:!0});N6.CodeGen=N6.Name=N6.nil=N6.stringify=N6.str=N6._=N6.KeywordCxt=void 0;var aE=j8();Object.defineProperty(N6,"KeywordCxt",{enumerable:!0,get:function(){return aE.KeywordCxt}});var C0=s();Object.defineProperty(N6,"_",{enumerable:!0,get:function(){return C0._}});Object.defineProperty(N6,"str",{enumerable:!0,get:function(){return C0.str}});Object.defineProperty(N6,"stringify",{enumerable:!0,get:function(){return C0.stringify}});Object.defineProperty(N6,"nil",{enumerable:!0,get:function(){return C0.nil}});Object.defineProperty(N6,"Name",{enumerable:!0,get:function(){return C0.Name}});Object.defineProperty(N6,"CodeGen",{enumerable:!0,get:function(){return C0.CodeGen}});var sE=BQ(),PB=D8(),eE=S3(),F8=DQ(),$v=s(),M8=H8(),MQ=N8(),a3=Y$(),MB=$B(),Xv=FB(),ZB=($,X)=>new RegExp($,X);ZB.code="new RegExp";var Jv=["removeAdditional","useDefaults","coerceTypes"],zv=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Qv={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Yv={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},IB=200;function Wv($){var X,J,Q,z,Y,W,G,U,K,w,V,H,N,O,B,L,F,Z,C,m,c,v$,H4,P1,gQ;let g0=$.strict,yQ=(X=$.code)===null||X===void 0?void 0:X.optimize,ZU=yQ===!0||yQ===void 0?1:yQ||0,SU=(Q=(J=$.code)===null||J===void 0?void 0:J.regExp)!==null&&Q!==void 0?Q:ZB,eD=(z=$.uriResolver)!==null&&z!==void 0?z:Xv.default;return{strictSchema:(W=(Y=$.strictSchema)!==null&&Y!==void 0?Y:g0)!==null&&W!==void 0?W:!0,strictNumbers:(U=(G=$.strictNumbers)!==null&&G!==void 0?G:g0)!==null&&U!==void 0?U:!0,strictTypes:(w=(K=$.strictTypes)!==null&&K!==void 0?K:g0)!==null&&w!==void 0?w:"log",strictTuples:(H=(V=$.strictTuples)!==null&&V!==void 0?V:g0)!==null&&H!==void 0?H:"log",strictRequired:(O=(N=$.strictRequired)!==null&&N!==void 0?N:g0)!==null&&O!==void 0?O:!1,code:$.code?{...$.code,optimize:ZU,regExp:SU}:{optimize:ZU,regExp:SU},loopRequired:(B=$.loopRequired)!==null&&B!==void 0?B:IB,loopEnum:(L=$.loopEnum)!==null&&L!==void 0?L:IB,meta:(F=$.meta)!==null&&F!==void 0?F:!0,messages:(Z=$.messages)!==null&&Z!==void 0?Z:!0,inlineRefs:(C=$.inlineRefs)!==null&&C!==void 0?C:!0,schemaId:(m=$.schemaId)!==null&&m!==void 0?m:"$id",addUsedSchema:(c=$.addUsedSchema)!==null&&c!==void 0?c:!0,validateSchema:(v$=$.validateSchema)!==null&&v$!==void 0?v$:!0,validateFormats:(H4=$.validateFormats)!==null&&H4!==void 0?H4:!0,unicodeRegExp:(P1=$.unicodeRegExp)!==null&&P1!==void 0?P1:!0,int32range:(gQ=$.int32range)!==null&&gQ!==void 0?gQ:!0,uriResolver:eD}}class IQ{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...Wv($)};let{es5:X,lines:J}=this.opts.code;this.scope=new $v.ValueScope({scope:{},prefixes:zv,es5:X,lines:J}),this.logger=Nv($.logger);let Q=$.validateFormats;if($.validateFormats=!1,this.RULES=(0,eE.getRules)(),AB.call(this,Qv,$,"NOT SUPPORTED"),AB.call(this,Yv,$,"DEPRECATED","warn"),this._metaOpts=wv.call(this),$.formats)Uv.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)Kv.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);Gv.call(this),$.validateFormats=Q}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:X,schemaId:J}=this.opts,Q=MB;if(J==="id")Q={...MB},Q.id=Q.$id,delete Q.$id;if(X&&$)this.addMetaSchema(Q,Q[J],!1)}defaultMeta(){let{meta:$,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[X]||$:void 0}validate($,X){let J;if(typeof $=="string"){if(J=this.getSchema($),!J)throw Error(`no schema with key or ref "${$}"`)}else J=this.compile($);let Q=J(X);if(!("$async"in J))this.errors=J.errors;return Q}compile($,X){let J=this._addSchema($,X);return J.validate||this._compileSchemaEnv(J)}compileAsync($,X){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:J}=this.opts;return Q.call(this,$,X);async function Q(K,w){await z.call(this,K.$schema);let V=this._addSchema(K,w);return V.validate||Y.call(this,V)}async function z(K){if(K&&!this.getSchema(K))await Q.call(this,{$ref:K},!0)}async function Y(K){try{return this._compileSchemaEnv(K)}catch(w){if(!(w instanceof PB.default))throw w;return W.call(this,w),await G.call(this,w.missingSchema),Y.call(this,K)}}function W({missingSchema:K,missingRef:w}){if(this.refs[K])throw Error(`AnySchema ${K} is loaded but ${w} cannot be resolved`)}async function G(K){let w=await U.call(this,K);if(!this.refs[K])await z.call(this,w.$schema);if(!this.refs[K])this.addSchema(w,K,X)}async function U(K){let w=this._loading[K];if(w)return w;try{return await(this._loading[K]=J(K))}finally{delete this._loading[K]}}}addSchema($,X,J,Q=this.opts.validateSchema){if(Array.isArray($)){for(let Y of $)this.addSchema(Y,void 0,J,Q);return this}let z;if(typeof $==="object"){let{schemaId:Y}=this.opts;if(z=$[Y],z!==void 0&&typeof z!="string")throw Error(`schema ${Y} must be string`)}return X=(0,M8.normalizeId)(X||z),this._checkUnique(X),this.schemas[X]=this._addSchema($,J,X,Q,!0),this}addMetaSchema($,X,J=this.opts.validateSchema){return this.addSchema($,X,!0,J),this}validateSchema($,X){if(typeof $=="boolean")return!0;let J;if(J=$.$schema,J!==void 0&&typeof J!="string")throw Error("$schema must be a string");if(J=J||this.opts.defaultMeta||this.defaultMeta(),!J)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let Q=this.validate(J,$);if(!Q&&X){let z="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(z);else throw Error(z)}return Q}getSchema($){let X;while(typeof(X=bB.call(this,$))=="string")$=X;if(X===void 0){let{schemaId:J}=this.opts,Q=new F8.SchemaEnv({schema:{},schemaId:J});if(X=F8.resolveSchema.call(this,Q,$),!X)return;this.refs[$]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let X=bB.call(this,$);if(typeof X=="object")this._cache.delete(X.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let X=$;this._cache.delete(X);let J=$[this.opts.schemaId];if(J)J=(0,M8.normalizeId)(J),delete this.schemas[J],delete this.refs[J];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let X of $)this.addKeyword(X);return this}addKeyword($,X){let J;if(typeof $=="string"){if(J=$,typeof X=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=J}else if(typeof $=="object"&&X===void 0){if(X=$,J=X.keyword,Array.isArray(J)&&!J.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Ov.call(this,J,X),!X)return(0,a3.eachItem)(J,(z)=>t3.call(this,z)),this;jv.call(this,X);let Q={...X,type:(0,MQ.getJSONTypes)(X.type),schemaType:(0,MQ.getJSONTypes)(X.schemaType)};return(0,a3.eachItem)(J,Q.type.length===0?(z)=>t3.call(this,z,Q):(z)=>Q.type.forEach((Y)=>t3.call(this,z,Q,Y))),this}getKeyword($){let X=this.RULES.all[$];return typeof X=="object"?X.definition:!!X}removeKeyword($){let{RULES:X}=this;delete X.keywords[$],delete X.all[$];for(let J of X.rules){let Q=J.rules.findIndex((z)=>z.keyword===$);if(Q>=0)J.rules.splice(Q,1)}return this}addFormat($,X){if(typeof X=="string")X=new RegExp(X);return this.formats[$]=X,this}errorsText($=this.errors,{separator:X=", ",dataVar:J="data"}={}){if(!$||$.length===0)return"No errors";return $.map((Q)=>`${J}${Q.instancePath} ${Q.message}`).reduce((Q,z)=>Q+X+z)}$dataMetaSchema($,X){let J=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let Q of X){let z=Q.split("/").slice(1),Y=$;for(let W of z)Y=Y[W];for(let W in J){let G=J[W];if(typeof G!="object")continue;let{$data:U}=G.definition,K=Y[W];if(U&&K)Y[W]=SB(K)}}return $}_removeAllSchemas($,X){for(let J in $){let Q=$[J];if(!X||X.test(J)){if(typeof Q=="string")delete $[J];else if(Q&&!Q.meta)this._cache.delete(Q.schema),delete $[J]}}}_addSchema($,X,J,Q=this.opts.validateSchema,z=this.opts.addUsedSchema){let Y,{schemaId:W}=this.opts;if(typeof $=="object")Y=$[W];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof $!="boolean")throw Error("schema must be object or boolean");let G=this._cache.get($);if(G!==void 0)return G;J=(0,M8.normalizeId)(Y||J);let U=M8.getSchemaRefs.call(this,$,J);if(G=new F8.SchemaEnv({schema:$,schemaId:W,meta:X,baseId:J,localRefs:U}),this._cache.set(G.schema,G),z&&!J.startsWith("#")){if(J)this._checkUnique(J);this.refs[J]=G}if(Q)this.validateSchema($,!0);return G}_checkUnique($){if(this.schemas[$]||this.refs[$])throw Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else F8.compileSchema.call(this,$);if(!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let X=this.opts;this.opts=this._metaOpts;try{F8.compileSchema.call(this,$)}finally{this.opts=X}}}IQ.ValidationError=sE.default;IQ.MissingRefError=PB.default;N6.default=IQ;function AB($,X,J,Q="error"){for(let z in $){let Y=z;if(Y in X)this.logger[Q](`${J}: option ${z}. ${$[Y]}`)}}function bB($){return $=(0,M8.normalizeId)($),this.schemas[$]||this.refs[$]}function Gv(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let X in $)this.addSchema($[X],X)}function Uv(){for(let $ in this.opts.formats){let X=this.opts.formats[$];if(X)this.addFormat($,X)}}function Kv($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let X in $){let J=$[X];if(!J.keyword)J.keyword=X;this.addKeyword(J)}}function wv(){let $={...this.opts};for(let X of Jv)delete $[X];return $}var Vv={log(){},warn(){},error(){}};function Nv($){if($===!1)return Vv;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}var Hv=/^[a-z_$][a-z0-9_$:-]*$/i;function Ov($,X){let{RULES:J}=this;if((0,a3.eachItem)($,(Q)=>{if(J.keywords[Q])throw Error(`Keyword ${Q} is already defined`);if(!Hv.test(Q))throw Error(`Keyword ${Q} has invalid name`)}),!X)return;if(X.$data&&!(("code"in X)||("validate"in X)))throw Error('$data keyword must have "code" or "validate" function')}function t3($,X,J){var Q;let z=X===null||X===void 0?void 0:X.post;if(J&&z)throw Error('keyword with "post" flag cannot have "type"');let{RULES:Y}=this,W=z?Y.post:Y.rules.find(({type:U})=>U===J);if(!W)W={type:J,rules:[]},Y.rules.push(W);if(Y.keywords[$]=!0,!X)return;let G={keyword:$,definition:{...X,type:(0,MQ.getJSONTypes)(X.type),schemaType:(0,MQ.getJSONTypes)(X.schemaType)}};if(X.before)Bv.call(this,W,G,X.before);else W.rules.push(G);Y.all[$]=G,(Q=X.implements)===null||Q===void 0||Q.forEach((U)=>this.addKeyword(U))}function Bv($,X,J){let Q=$.rules.findIndex((z)=>z.keyword===J);if(Q>=0)$.rules.splice(Q,0,X);else $.rules.push(X),this.logger.warn(`rule ${J} is not defined`)}function jv($){let{metaSchema:X}=$;if(X===void 0)return;if($.$data&&this.opts.$data)X=SB(X);$.validateSchema=this.compile(X,!0)}var Dv={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function SB($){return{anyOf:[$,Dv]}}});var vB=x((EB)=>{Object.defineProperty(EB,"__esModule",{value:!0});var Fv={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};EB.default=Fv});var fB=x((xB)=>{Object.defineProperty(xB,"__esModule",{value:!0});xB.callRef=xB.getValidate=void 0;var Iv=D8(),CB=A4(),z4=s(),k0=w6(),kB=DQ(),AQ=Y$(),Av={keyword:"$ref",schemaType:"string",code($){let{gen:X,schema:J,it:Q}=$,{baseId:z,schemaEnv:Y,validateName:W,opts:G,self:U}=Q,{root:K}=Y;if((J==="#"||J==="#/")&&z===K.baseId)return V();let w=kB.resolveRef.call(U,K,z,J);if(w===void 0)throw new Iv.default(Q.opts.uriResolver,z,J);if(w instanceof kB.SchemaEnv)return H(w);return N(w);function V(){if(Y===K)return bQ($,W,Y,Y.$async);let O=X.scopeValue("root",{ref:K});return bQ($,z4._`${O}.validate`,K,K.$async)}function H(O){let B=_B($,O);bQ($,B,O,O.$async)}function N(O){let B=X.scopeValue("schema",G.code.source===!0?{ref:O,code:(0,z4.stringify)(O)}:{ref:O}),L=X.name("valid"),F=$.subschema({schema:O,dataTypes:[],schemaPath:z4.nil,topSchemaRef:B,errSchemaPath:J},L);$.mergeEvaluated(F),$.ok(L)}}};function _B($,X){let{gen:J}=$;return X.validate?J.scopeValue("validate",{ref:X.validate}):z4._`${J.scopeValue("wrapper",{ref:X})}.validate`}xB.getValidate=_B;function bQ($,X,J,Q){let{gen:z,it:Y}=$,{allErrors:W,schemaEnv:G,opts:U}=Y,K=U.passContext?k0.default.this:z4.nil;if(Q)w();else V();function w(){if(!G.$async)throw Error("async schema referenced by sync schema");let O=z.let("valid");z.try(()=>{if(z.code(z4._`await ${(0,CB.callValidateCode)($,X,K)}`),N(X),!W)z.assign(O,!0)},(B)=>{if(z.if(z4._`!(${B} instanceof ${Y.ValidationError})`,()=>z.throw(B)),H(B),!W)z.assign(O,!1)}),$.ok(O)}function V(){$.result((0,CB.callValidateCode)($,X,K),()=>N(X),()=>H(X))}function H(O){let B=z4._`${O}.errors`;z.assign(k0.default.vErrors,z4._`${k0.default.vErrors} === null ? ${B} : ${k0.default.vErrors}.concat(${B})`),z.assign(k0.default.errors,z4._`${k0.default.vErrors}.length`)}function N(O){var B;if(!Y.opts.unevaluated)return;let L=(B=J===null||J===void 0?void 0:J.validate)===null||B===void 0?void 0:B.evaluated;if(Y.props!==!0)if(L&&!L.dynamicProps){if(L.props!==void 0)Y.props=AQ.mergeEvaluated.props(z,L.props,Y.props)}else{let F=z.var("props",z4._`${O}.evaluated.props`);Y.props=AQ.mergeEvaluated.props(z,F,Y.props,z4.Name)}if(Y.items!==!0)if(L&&!L.dynamicItems){if(L.items!==void 0)Y.items=AQ.mergeEvaluated.items(z,L.items,Y.items)}else{let F=z.var("items",z4._`${O}.evaluated.items`);Y.items=AQ.mergeEvaluated.items(z,F,Y.items,z4.Name)}}}xB.callRef=bQ;xB.default=Av});var yB=x((gB)=>{Object.defineProperty(gB,"__esModule",{value:!0});var Zv=vB(),Sv=fB(),Rv=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Zv.default,Sv.default];gB.default=Rv});var uB=x((hB)=>{Object.defineProperty(hB,"__esModule",{value:!0});var PQ=s(),u6=PQ.operators,ZQ={maximum:{okStr:"<=",ok:u6.LTE,fail:u6.GT},minimum:{okStr:">=",ok:u6.GTE,fail:u6.LT},exclusiveMaximum:{okStr:"<",ok:u6.LT,fail:u6.GTE},exclusiveMinimum:{okStr:">",ok:u6.GT,fail:u6.LTE}},vv={message:({keyword:$,schemaCode:X})=>PQ.str`must be ${ZQ[$].okStr} ${X}`,params:({keyword:$,schemaCode:X})=>PQ._`{comparison: ${ZQ[$].okStr}, limit: ${X}}`},Cv={keyword:Object.keys(ZQ),type:"number",schemaType:"number",$data:!0,error:vv,code($){let{keyword:X,data:J,schemaCode:Q}=$;$.fail$data(PQ._`${J} ${ZQ[X].fail} ${Q} || isNaN(${J})`)}};hB.default=Cv});var mB=x((lB)=>{Object.defineProperty(lB,"__esModule",{value:!0});var I8=s(),_v={message:({schemaCode:$})=>I8.str`must be multiple of ${$}`,params:({schemaCode:$})=>I8._`{multipleOf: ${$}}`},xv={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:_v,code($){let{gen:X,data:J,schemaCode:Q,it:z}=$,Y=z.opts.multipleOfPrecision,W=X.let("res"),G=Y?I8._`Math.abs(Math.round(${W}) - ${W}) > 1e-${Y}`:I8._`${W} !== parseInt(${W})`;$.fail$data(I8._`(${Q} === 0 || (${W} = ${J}/${Q}, ${G}))`)}};lB.default=xv});var nB=x((iB)=>{Object.defineProperty(iB,"__esModule",{value:!0});function cB($){let X=$.length,J=0,Q=0,z;while(Q<X)if(J++,z=$.charCodeAt(Q++),z>=55296&&z<=56319&&Q<X){if(z=$.charCodeAt(Q),(z&64512)===56320)Q++}return J}iB.default=cB;cB.code='require("ajv/dist/runtime/ucs2length").default'});var dB=x((pB)=>{Object.defineProperty(pB,"__esModule",{value:!0});var A1=s(),gv=Y$(),yv=nB(),hv={message({keyword:$,schemaCode:X}){let J=$==="maxLength"?"more":"fewer";return A1.str`must NOT have ${J} than ${X} characters`},params:({schemaCode:$})=>A1._`{limit: ${$}}`},uv={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:hv,code($){let{keyword:X,data:J,schemaCode:Q,it:z}=$,Y=X==="maxLength"?A1.operators.GT:A1.operators.LT,W=z.opts.unicode===!1?A1._`${J}.length`:A1._`${(0,gv.useFunc)($.gen,yv.default)}(${J})`;$.fail$data(A1._`${W} ${Y} ${Q}`)}};pB.default=uv});var oB=x((rB)=>{Object.defineProperty(rB,"__esModule",{value:!0});var mv=A4(),cv=Y$(),_0=s(),iv={message:({schemaCode:$})=>_0.str`must match pattern "${$}"`,params:({schemaCode:$})=>_0._`{pattern: ${$}}`},nv={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:iv,code($){let{gen:X,data:J,$data:Q,schema:z,schemaCode:Y,it:W}=$,G=W.opts.unicodeRegExp?"u":"";if(Q){let{regExp:U}=W.opts.code,K=U.code==="new RegExp"?_0._`new RegExp`:(0,cv.useFunc)(X,U),w=X.let("valid");X.try(()=>X.assign(w,_0._`${K}(${Y}, ${G}).test(${J})`),()=>X.assign(w,!1)),$.fail$data(_0._`!${w}`)}else{let U=(0,mv.usePattern)($,z);$.fail$data(_0._`!${U}.test(${J})`)}}};rB.default=nv});var aB=x((tB)=>{Object.defineProperty(tB,"__esModule",{value:!0});var A8=s(),dv={message({keyword:$,schemaCode:X}){let J=$==="maxProperties"?"more":"fewer";return A8.str`must NOT have ${J} than ${X} properties`},params:({schemaCode:$})=>A8._`{limit: ${$}}`},rv={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:dv,code($){let{keyword:X,data:J,schemaCode:Q}=$,z=X==="maxProperties"?A8.operators.GT:A8.operators.LT;$.fail$data(A8._`Object.keys(${J}).length ${z} ${Q}`)}};tB.default=rv});var eB=x((sB)=>{Object.defineProperty(sB,"__esModule",{value:!0});var b8=A4(),P8=s(),tv=Y$(),av={message:({params:{missingProperty:$}})=>P8.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>P8._`{missingProperty: ${$}}`},sv={keyword:"required",type:"object",schemaType:"array",$data:!0,error:av,code($){let{gen:X,schema:J,schemaCode:Q,data:z,$data:Y,it:W}=$,{opts:G}=W;if(!Y&&J.length===0)return;let U=J.length>=G.loopRequired;if(W.allErrors)K();else w();if(G.strictRequired){let N=$.parentSchema.properties,{definedProperties:O}=$.it;for(let B of J)if((N===null||N===void 0?void 0:N[B])===void 0&&!O.has(B)){let L=W.schemaEnv.baseId+W.errSchemaPath,F=`required property "${B}" is not defined at "${L}" (strictRequired)`;(0,tv.checkStrictMode)(W,F,W.opts.strictRequired)}}function K(){if(U||Y)$.block$data(P8.nil,V);else for(let N of J)(0,b8.checkReportMissingProp)($,N)}function w(){let N=X.let("missing");if(U||Y){let O=X.let("valid",!0);$.block$data(O,()=>H(N,O)),$.ok(O)}else X.if((0,b8.checkMissingProp)($,J,N)),(0,b8.reportMissingProp)($,N),X.else()}function V(){X.forOf("prop",Q,(N)=>{$.setParams({missingProperty:N}),X.if((0,b8.noPropertyInData)(X,z,N,G.ownProperties),()=>$.error())})}function H(N,O){$.setParams({missingProperty:N}),X.forOf(N,Q,()=>{X.assign(O,(0,b8.propertyInData)(X,z,N,G.ownProperties)),X.if((0,P8.not)(O),()=>{$.error(),X.break()})},P8.nil)}}};sB.default=sv});var Xj=x(($j)=>{Object.defineProperty($j,"__esModule",{value:!0});var Z8=s(),$C={message({keyword:$,schemaCode:X}){let J=$==="maxItems"?"more":"fewer";return Z8.str`must NOT have ${J} than ${X} items`},params:({schemaCode:$})=>Z8._`{limit: ${$}}`},XC={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:$C,code($){let{keyword:X,data:J,schemaCode:Q}=$,z=X==="maxItems"?Z8.operators.GT:Z8.operators.LT;$.fail$data(Z8._`${J}.length ${z} ${Q}`)}};$j.default=XC});var SQ=x((zj)=>{Object.defineProperty(zj,"__esModule",{value:!0});var Jj=T3();Jj.code='require("ajv/dist/runtime/equal").default';zj.default=Jj});var Yj=x((Qj)=>{Object.defineProperty(Qj,"__esModule",{value:!0});var s3=N8(),h$=s(),QC=Y$(),YC=SQ(),WC={message:({params:{i:$,j:X}})=>h$.str`must NOT have duplicate items (items ## ${X} and ${$} are identical)`,params:({params:{i:$,j:X}})=>h$._`{i: ${$}, j: ${X}}`},GC={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:WC,code($){let{gen:X,data:J,$data:Q,schema:z,parentSchema:Y,schemaCode:W,it:G}=$;if(!Q&&!z)return;let U=X.let("valid"),K=Y.items?(0,s3.getSchemaTypes)(Y.items):[];$.block$data(U,w,h$._`${W} === false`),$.ok(U);function w(){let O=X.let("i",h$._`${J}.length`),B=X.let("j");$.setParams({i:O,j:B}),X.assign(U,!0),X.if(h$._`${O} > 1`,()=>(V()?H:N)(O,B))}function V(){return K.length>0&&!K.some((O)=>O==="object"||O==="array")}function H(O,B){let L=X.name("item"),F=(0,s3.checkDataTypes)(K,L,G.opts.strictNumbers,s3.DataType.Wrong),Z=X.const("indices",h$._`{}`);X.for(h$._`;${O}--;`,()=>{if(X.let(L,h$._`${J}[${O}]`),X.if(F,h$._`continue`),K.length>1)X.if(h$._`typeof ${L} == "string"`,h$._`${L} += "_"`);X.if(h$._`typeof ${Z}[${L}] == "number"`,()=>{X.assign(B,h$._`${Z}[${L}]`),$.error(),X.assign(U,!1).break()}).code(h$._`${Z}[${L}] = ${O}`)})}function N(O,B){let L=(0,QC.useFunc)(X,YC.default),F=X.name("outer");X.label(F).for(h$._`;${O}--;`,()=>X.for(h$._`${B} = ${O}; ${B}--;`,()=>X.if(h$._`${L}(${J}[${O}], ${J}[${B}])`,()=>{$.error(),X.assign(U,!1).break(F)})))}}};Qj.default=GC});var Gj=x((Wj)=>{Object.defineProperty(Wj,"__esModule",{value:!0});var e3=s(),KC=Y$(),wC=SQ(),VC={message:"must be equal to constant",params:({schemaCode:$})=>e3._`{allowedValue: ${$}}`},NC={keyword:"const",$data:!0,error:VC,code($){let{gen:X,data:J,$data:Q,schemaCode:z,schema:Y}=$;if(Q||Y&&typeof Y=="object")$.fail$data(e3._`!${(0,KC.useFunc)(X,wC.default)}(${J}, ${z})`);else $.fail(e3._`${Y} !== ${J}`)}};Wj.default=NC});var Kj=x((Uj)=>{Object.defineProperty(Uj,"__esModule",{value:!0});var S8=s(),OC=Y$(),BC=SQ(),jC={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>S8._`{allowedValues: ${$}}`},DC={keyword:"enum",schemaType:"array",$data:!0,error:jC,code($){let{gen:X,data:J,$data:Q,schema:z,schemaCode:Y,it:W}=$;if(!Q&&z.length===0)throw Error("enum must have non-empty array");let G=z.length>=W.opts.loopEnum,U,K=()=>U!==null&&U!==void 0?U:U=(0,OC.useFunc)(X,BC.default),w;if(G||Q)w=X.let("valid"),$.block$data(w,V);else{if(!Array.isArray(z))throw Error("ajv implementation error");let N=X.const("vSchema",Y);w=(0,S8.or)(...z.map((O,B)=>H(N,B)))}$.pass(w);function V(){X.assign(w,!1),X.forOf("v",Y,(N)=>X.if(S8._`${K()}(${J}, ${N})`,()=>X.assign(w,!0).break()))}function H(N,O){let B=z[O];return typeof B==="object"&&B!==null?S8._`${K()}(${J}, ${N}[${O}])`:S8._`${J} === ${B}`}}};Uj.default=DC});var Vj=x((wj)=>{Object.defineProperty(wj,"__esModule",{value:!0});var LC=uB(),FC=mB(),MC=dB(),IC=oB(),AC=aB(),bC=eB(),PC=Xj(),ZC=Yj(),SC=Gj(),RC=Kj(),EC=[LC.default,FC.default,MC.default,IC.default,AC.default,bC.default,PC.default,ZC.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},SC.default,RC.default];wj.default=EC});var XU=x((Hj)=>{Object.defineProperty(Hj,"__esModule",{value:!0});Hj.validateAdditionalItems=void 0;var b1=s(),$U=Y$(),CC={message:({params:{len:$}})=>b1.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>b1._`{limit: ${$}}`},kC={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:CC,code($){let{parentSchema:X,it:J}=$,{items:Q}=X;if(!Array.isArray(Q)){(0,$U.checkStrictMode)(J,'"additionalItems" is ignored when "items" is not an array of schemas');return}Nj($,Q)}};function Nj($,X){let{gen:J,schema:Q,data:z,keyword:Y,it:W}=$;W.items=!0;let G=J.const("len",b1._`${z}.length`);if(Q===!1)$.setParams({len:X.length}),$.pass(b1._`${G} <= ${X.length}`);else if(typeof Q=="object"&&!(0,$U.alwaysValidSchema)(W,Q)){let K=J.var("valid",b1._`${G} <= ${X.length}`);J.if((0,b1.not)(K),()=>U(K)),$.ok(K)}function U(K){J.forRange("i",X.length,G,(w)=>{if($.subschema({keyword:Y,dataProp:w,dataPropType:$U.Type.Num},K),!W.allErrors)J.if((0,b1.not)(K),()=>J.break())})}}Hj.validateAdditionalItems=Nj;Hj.default=kC});var JU=x((Dj)=>{Object.defineProperty(Dj,"__esModule",{value:!0});Dj.validateTuple=void 0;var Bj=s(),RQ=Y$(),xC=A4(),TC={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:X,it:J}=$;if(Array.isArray(X))return jj($,"additionalItems",X);if(J.items=!0,(0,RQ.alwaysValidSchema)(J,X))return;$.ok((0,xC.validateArray)($))}};function jj($,X,J=$.schema){let{gen:Q,parentSchema:z,data:Y,keyword:W,it:G}=$;if(w(z),G.opts.unevaluated&&J.length&&G.items!==!0)G.items=RQ.mergeEvaluated.items(Q,J.length,G.items);let U=Q.name("valid"),K=Q.const("len",Bj._`${Y}.length`);J.forEach((V,H)=>{if((0,RQ.alwaysValidSchema)(G,V))return;Q.if(Bj._`${K} > ${H}`,()=>$.subschema({keyword:W,schemaProp:H,dataProp:H},U)),$.ok(U)});function w(V){let{opts:H,errSchemaPath:N}=G,O=J.length,B=O===V.minItems&&(O===V.maxItems||V[X]===!1);if(H.strictTuples&&!B){let L=`"${W}" is ${O}-tuple, but minItems or maxItems/${X} are not specified or different at path "${N}"`;(0,RQ.checkStrictMode)(G,L,H.strictTuples)}}}Dj.validateTuple=jj;Dj.default=TC});var Fj=x((Lj)=>{Object.defineProperty(Lj,"__esModule",{value:!0});var gC=JU(),yC={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>(0,gC.validateTuple)($,"items")};Lj.default=yC});var Aj=x((Ij)=>{Object.defineProperty(Ij,"__esModule",{value:!0});var Mj=s(),uC=Y$(),lC=A4(),mC=XU(),cC={message:({params:{len:$}})=>Mj.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>Mj._`{limit: ${$}}`},iC={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:cC,code($){let{schema:X,parentSchema:J,it:Q}=$,{prefixItems:z}=J;if(Q.items=!0,(0,uC.alwaysValidSchema)(Q,X))return;if(z)(0,mC.validateAdditionalItems)($,z);else $.ok((0,lC.validateArray)($))}};Ij.default=iC});var Pj=x((bj)=>{Object.defineProperty(bj,"__esModule",{value:!0});var b4=s(),EQ=Y$(),pC={message:({params:{min:$,max:X}})=>X===void 0?b4.str`must contain at least ${$} valid item(s)`:b4.str`must contain at least ${$} and no more than ${X} valid item(s)`,params:({params:{min:$,max:X}})=>X===void 0?b4._`{minContains: ${$}}`:b4._`{minContains: ${$}, maxContains: ${X}}`},dC={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:pC,code($){let{gen:X,schema:J,parentSchema:Q,data:z,it:Y}=$,W,G,{minContains:U,maxContains:K}=Q;if(Y.opts.next)W=U===void 0?1:U,G=K;else W=1;let w=X.const("len",b4._`${z}.length`);if($.setParams({min:W,max:G}),G===void 0&&W===0){(0,EQ.checkStrictMode)(Y,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(G!==void 0&&W>G){(0,EQ.checkStrictMode)(Y,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,EQ.alwaysValidSchema)(Y,J)){let B=b4._`${w} >= ${W}`;if(G!==void 0)B=b4._`${B} && ${w} <= ${G}`;$.pass(B);return}Y.items=!0;let V=X.name("valid");if(G===void 0&&W===1)N(V,()=>X.if(V,()=>X.break()));else if(W===0){if(X.let(V,!0),G!==void 0)X.if(b4._`${z}.length > 0`,H)}else X.let(V,!1),H();$.result(V,()=>$.reset());function H(){let B=X.name("_valid"),L=X.let("count",0);N(B,()=>X.if(B,()=>O(L)))}function N(B,L){X.forRange("i",0,w,(F)=>{$.subschema({keyword:"contains",dataProp:F,dataPropType:EQ.Type.Num,compositeRule:!0},B),L()})}function O(B){if(X.code(b4._`${B}++`),G===void 0)X.if(b4._`${B} >= ${W}`,()=>X.assign(V,!0).break());else if(X.if(b4._`${B} > ${G}`,()=>X.assign(V,!1).break()),W===1)X.assign(V,!0);else X.if(b4._`${B} >= ${W}`,()=>X.assign(V,!0))}}};bj.default=dC});var Cj=x((Rj)=>{Object.defineProperty(Rj,"__esModule",{value:!0});Rj.validateSchemaDeps=Rj.validatePropertyDeps=Rj.error=void 0;var zU=s(),oC=Y$(),R8=A4();Rj.error={message:({params:{property:$,depsCount:X,deps:J}})=>{let Q=X===1?"property":"properties";return zU.str`must have ${Q} ${J} when property ${$} is present`},params:({params:{property:$,depsCount:X,deps:J,missingProperty:Q}})=>zU._`{property: ${$},
|
|
9
9
|
missingProperty: ${Q},
|
|
10
10
|
depsCount: ${X},
|
|
11
|
-
deps: ${J}}`};var tC={keyword:"dependencies",type:"object",schemaType:"object",error:Rj.error,code($){let[X,J]=aC($);Zj($,X),Sj($,J)}};function aC({schema:$}){let X={},J={};for(let Q in $){if(Q==="__proto__")continue;let z=Array.isArray($[Q])?X:J;z[Q]=$[Q]}return[X,J]}function Zj($,X=$.schema){let{gen:J,data:Q,it:z}=$;if(Object.keys(X).length===0)return;let Y=J.let("missing");for(let W in X){let G=X[W];if(G.length===0)continue;let U=(0,R8.propertyInData)(J,Q,W,z.opts.ownProperties);if($.setParams({property:W,depsCount:G.length,deps:G.join(", ")}),z.allErrors)J.if(U,()=>{for(let K of G)(0,R8.checkReportMissingProp)($,K)});else J.if(zU._`${U} && (${(0,R8.checkMissingProp)($,G,Y)})`),(0,R8.reportMissingProp)($,Y),J.else()}}Rj.validatePropertyDeps=Zj;function Sj($,X=$.schema){let{gen:J,data:Q,keyword:z,it:Y}=$,W=J.name("valid");for(let G in X){if((0,oC.alwaysValidSchema)(Y,X[G]))continue;J.if((0,R8.propertyInData)(J,Q,G,Y.opts.ownProperties),()=>{let U=$.subschema({keyword:z,schemaProp:G},W);$.mergeValidEvaluated(U,W)},()=>J.var(W,!0)),$.ok(W)}}Rj.validateSchemaDeps=Sj;Rj.default=tC});var xj=x((_j)=>{Object.defineProperty(_j,"__esModule",{value:!0});var kj=s(),$k=Y$(),Xk={message:"property name must be valid",params:({params:$})=>kj._`{propertyName: ${$.propertyName}}`},Jk={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Xk,code($){let{gen:X,schema:J,data:Q,it:z}=$;if((0,$k.alwaysValidSchema)(z,J))return;let Y=X.name("valid");X.forIn("key",Q,(W)=>{$.setParams({propertyName:W}),$.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},Y),X.if((0,kj.not)(Y),()=>{if($.error(!0),!z.allErrors)X.break()})}),$.ok(Y)}};_j.default=Jk});var QU=x((Tj)=>{Object.defineProperty(Tj,"__esModule",{value:!0});var vQ=A4(),g4=s(),Qk=w6(),CQ=Y$(),Yk={message:"must NOT have additional properties",params:({params:$})=>g4._`{additionalProperty: ${$.additionalProperty}}`},Wk={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Yk,code($){let{gen:X,schema:J,parentSchema:Q,data:z,errsCount:Y,it:W}=$;if(!Y)throw Error("ajv implementation error");let{allErrors:G,opts:U}=W;if(W.props=!0,U.removeAdditional!=="all"&&(0,CQ.alwaysValidSchema)(W,J))return;let K=(0,vQ.allSchemaProperties)(Q.properties),w=(0,vQ.allSchemaProperties)(Q.patternProperties);V(),$.ok(g4._`${Y} === ${Qk.default.errors}`);function V(){X.forIn("key",z,(L)=>{if(!K.length&&!w.length)O(L);else X.if(H(L),()=>O(L))})}function H(L){let F;if(K.length>8){let Z=(0,CQ.schemaRefOrVal)(W,Q.properties,"properties");F=(0,vQ.isOwnProperty)(X,Z,L)}else if(K.length)F=(0,g4.or)(...K.map((Z)=>g4._`${L} === ${Z}`));else F=g4.nil;if(w.length)F=(0,g4.or)(F,...w.map((Z)=>g4._`${(0,vQ.usePattern)($,Z)}.test(${L})`));return(0,g4.not)(F)}function N(L){X.code(g4._`delete ${z}[${L}]`)}function O(L){if(U.removeAdditional==="all"||U.removeAdditional&&J===!1){N(L);return}if(J===!1){if($.setParams({additionalProperty:L}),$.error(),!G)X.break();return}if(typeof J=="object"&&!(0,CQ.alwaysValidSchema)(W,J)){let F=X.name("valid");if(U.removeAdditional==="failing")B(L,F,!1),X.if((0,g4.not)(F),()=>{$.reset(),N(L)});else if(B(L,F),!G)X.if((0,g4.not)(F),()=>X.break())}}function B(L,F,Z){let C={keyword:"additionalProperties",dataProp:L,dataPropType:CQ.Type.Str};if(Z===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(C,F)}}};Tj.default=Wk});var hj=x((yj)=>{Object.defineProperty(yj,"__esModule",{value:!0});var Uk=j8(),fj=A4(),YU=Y$(),gj=QU(),Kk={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:X,schema:J,parentSchema:Q,data:z,it:Y}=$;if(Y.opts.removeAdditional==="all"&&Q.additionalProperties===void 0)gj.default.code(new Uk.KeywordCxt(Y,gj.default,"additionalProperties"));let W=(0,fj.allSchemaProperties)(J);for(let V of W)Y.definedProperties.add(V);if(Y.opts.unevaluated&&W.length&&Y.props!==!0)Y.props=YU.mergeEvaluated.props(X,(0,YU.toHash)(W),Y.props);let G=W.filter((V)=>!(0,YU.alwaysValidSchema)(Y,J[V]));if(G.length===0)return;let U=X.name("valid");for(let V of G){if(K(V))w(V);else{if(X.if((0,fj.propertyInData)(X,z,V,Y.opts.ownProperties)),w(V),!Y.allErrors)X.else().var(U,!0);X.endIf()}$.it.definedProperties.add(V),$.ok(U)}function K(V){return Y.opts.useDefaults&&!Y.compositeRule&&J[V].default!==void 0}function w(V){$.subschema({keyword:"properties",schemaProp:V,dataProp:V},U)}}};yj.default=Kk});var ij=x((cj)=>{Object.defineProperty(cj,"__esModule",{value:!0});var uj=A4(),kQ=s(),lj=Y$(),mj=Y$(),Vk={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:X,schema:J,data:Q,parentSchema:z,it:Y}=$,{opts:W}=Y,G=(0,uj.allSchemaProperties)(J),U=G.filter((B)=>(0,lj.alwaysValidSchema)(Y,J[B]));if(G.length===0||U.length===G.length&&(!Y.opts.unevaluated||Y.props===!0))return;let K=W.strictSchema&&!W.allowMatchingProperties&&z.properties,w=X.name("valid");if(Y.props!==!0&&!(Y.props instanceof kQ.Name))Y.props=(0,mj.evaluatedPropsToName)(X,Y.props);let{props:V}=Y;H();function H(){for(let B of G){if(K)N(B);if(Y.allErrors)O(B);else X.var(w,!0),O(B),X.if(w)}}function N(B){for(let L in K)if(new RegExp(B).test(L))(0,lj.checkStrictMode)(Y,`property ${L} matches pattern ${B} (use allowMatchingProperties)`)}function O(B){X.forIn("key",Q,(L)=>{X.if(kQ._`${(0,uj.usePattern)($,B)}.test(${L})`,()=>{let F=U.includes(B);if(!F)$.subschema({keyword:"patternProperties",schemaProp:B,dataProp:L,dataPropType:mj.Type.Str},w);if(Y.opts.unevaluated&&V!==!0)X.assign(kQ._`${V}[${L}]`,!0);else if(!F&&!Y.allErrors)X.if((0,kQ.not)(w),()=>X.break())})})}}};cj.default=Vk});var pj=x((nj)=>{Object.defineProperty(nj,"__esModule",{value:!0});var Hk=Y$(),Ok={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:X,schema:J,it:Q}=$;if((0,Hk.alwaysValidSchema)(Q,J)){$.fail();return}let z=X.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},z),$.failResult(z,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};nj.default=Ok});var rj=x((dj)=>{Object.defineProperty(dj,"__esModule",{value:!0});var jk=A4(),Dk={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:jk.validateUnion,error:{message:"must match a schema in anyOf"}};dj.default=Dk});var tj=x((oj)=>{Object.defineProperty(oj,"__esModule",{value:!0});var _Q=s(),Lk=Y$(),Fk={message:"must match exactly one schema in oneOf",params:({params:$})=>_Q._`{passingSchemas: ${$.passing}}`},Mk={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Fk,code($){let{gen:X,schema:J,parentSchema:Q,it:z}=$;if(!Array.isArray(J))throw Error("ajv implementation error");if(z.opts.discriminator&&Q.discriminator)return;let Y=J,W=X.let("valid",!1),G=X.let("passing",null),U=X.name("_valid");$.setParams({passing:G}),X.block(K),$.result(W,()=>$.reset(),()=>$.error(!0));function K(){Y.forEach((w,V)=>{let H;if((0,Lk.alwaysValidSchema)(z,w))X.var(U,!0);else H=$.subschema({keyword:"oneOf",schemaProp:V,compositeRule:!0},U);if(V>0)X.if(_Q._`${U} && ${W}`).assign(W,!1).assign(G,_Q._`[${G}, ${V}]`).else();X.if(U,()=>{if(X.assign(W,!0),X.assign(G,V),H)$.mergeEvaluated(H,_Q.Name)})})}}};oj.default=Mk});var sj=x((aj)=>{Object.defineProperty(aj,"__esModule",{value:!0});var Ak=Y$(),bk={keyword:"allOf",schemaType:"array",code($){let{gen:X,schema:J,it:Q}=$;if(!Array.isArray(J))throw Error("ajv implementation error");let z=X.name("valid");J.forEach((Y,W)=>{if((0,Ak.alwaysValidSchema)(Q,Y))return;let G=$.subschema({keyword:"allOf",schemaProp:W},z);$.ok(z),$.mergeEvaluated(G)})}};aj.default=bk});var JD=x((XD)=>{Object.defineProperty(XD,"__esModule",{value:!0});var xQ=s(),$D=Y$(),Zk={message:({params:$})=>xQ.str`must match "${$.ifClause}" schema`,params:({params:$})=>xQ._`{failingKeyword: ${$.ifClause}}`},Sk={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Zk,code($){let{gen:X,parentSchema:J,it:Q}=$;if(J.then===void 0&&J.else===void 0)(0,$D.checkStrictMode)(Q,'"if" without "then" and "else" is ignored');let z=ej(Q,"then"),Y=ej(Q,"else");if(!z&&!Y)return;let W=X.let("valid",!0),G=X.name("_valid");if(U(),$.reset(),z&&Y){let w=X.let("ifClause");$.setParams({ifClause:w}),X.if(G,K("then",w),K("else",w))}else if(z)X.if(G,K("then"));else X.if((0,xQ.not)(G),K("else"));$.pass(W,()=>$.error(!0));function U(){let w=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},G);$.mergeEvaluated(w)}function K(w,V){return()=>{let H=$.subschema({keyword:w},G);if(X.assign(W,G),$.mergeValidEvaluated(H,W),V)X.assign(V,xQ._`${w}`);else $.setParams({ifClause:w})}}}};function ej($,X){let J=$.schema[X];return J!==void 0&&!(0,$D.alwaysValidSchema)($,J)}XD.default=Sk});var QD=x((zD)=>{Object.defineProperty(zD,"__esModule",{value:!0});var Ek=Y$(),vk={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:X,it:J}){if(X.if===void 0)(0,Ek.checkStrictMode)(J,`"${$}" without "if" is ignored`)}};zD.default=vk});var WD=x((YD)=>{Object.defineProperty(YD,"__esModule",{value:!0});var kk=XU(),_k=Fj(),xk=JU(),Tk=Aj(),fk=Pj(),gk=Cj(),yk=xj(),hk=QU(),uk=hj(),lk=ij(),mk=pj(),ck=rj(),ik=tj(),nk=sj(),pk=JD(),dk=QD();function rk($=!1){let X=[mk.default,ck.default,ik.default,nk.default,pk.default,dk.default,yk.default,hk.default,gk.default,uk.default,lk.default];if($)X.push(_k.default,Tk.default);else X.push(kk.default,xk.default);return X.push(fk.default),X}YD.default=rk});var UD=x((GD)=>{Object.defineProperty(GD,"__esModule",{value:!0});var E$=s(),tk={message:({schemaCode:$})=>E$.str`must match format "${$}"`,params:({schemaCode:$})=>E$._`{format: ${$}}`},ak={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:tk,code($,X){let{gen:J,data:Q,$data:z,schema:Y,schemaCode:W,it:G}=$,{opts:U,errSchemaPath:K,schemaEnv:w,self:V}=G;if(!U.validateFormats)return;if(z)H();else N();function H(){let O=J.scopeValue("formats",{ref:V.formats,code:U.code.formats}),B=J.const("fDef",E$._`${O}[${W}]`),L=J.let("fType"),F=J.let("format");J.if(E$._`typeof ${B} == "object" && !(${B} instanceof RegExp)`,()=>J.assign(L,E$._`${B}.type || "string"`).assign(F,E$._`${B}.validate`),()=>J.assign(L,E$._`"string"`).assign(F,B)),$.fail$data((0,E$.or)(Z(),C()));function Z(){if(U.strictSchema===!1)return E$.nil;return E$._`${W} && !${F}`}function C(){let m=w.$async?E$._`(${B}.async ? await ${F}(${Q}) : ${F}(${Q}))`:E$._`${F}(${Q})`,c=E$._`(typeof ${F} == "function" ? ${m} : ${F}.test(${Q}))`;return E$._`${F} && ${F} !== true && ${L} === ${X} && !${c}`}}function N(){let O=V.formats[Y];if(!O){Z();return}if(O===!0)return;let[B,L,F]=C(O);if(B===X)$.pass(m());function Z(){if(U.strictSchema===!1){V.logger.warn(c());return}throw Error(c());function c(){return`unknown format "${Y}" ignored in schema at path "${K}"`}}function C(c){let v$=c instanceof RegExp?(0,E$.regexpCode)(c):U.code.formats?E$._`${U.code.formats}${(0,E$.getProperty)(Y)}`:void 0,H4=J.scopeValue("formats",{key:Y,ref:c,code:v$});if(typeof c=="object"&&!(c instanceof RegExp))return[c.type||"string",c.validate,E$._`${H4}.validate`];return["string",c,H4]}function m(){if(typeof O=="object"&&!(O instanceof RegExp)&&O.async){if(!w.$async)throw Error("async format in sync schema");return E$._`await ${F}(${Q})`}return typeof L=="function"?E$._`${F}(${Q})`:E$._`${F}.test(${Q})`}}}};GD.default=ak});var wD=x((KD)=>{Object.defineProperty(KD,"__esModule",{value:!0});var ek=UD(),$_=[ek.default];KD.default=$_});var HD=x((VD)=>{Object.defineProperty(VD,"__esModule",{value:!0});VD.contentVocabulary=VD.metadataVocabulary=void 0;VD.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];VD.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var jD=x((BD)=>{Object.defineProperty(BD,"__esModule",{value:!0});var z_=yB(),Q_=Vj(),Y_=WD(),W_=wD(),OD=HD(),G_=[z_.default,Q_.default,(0,Y_.default)(),W_.default,OD.metadataVocabulary,OD.contentVocabulary];BD.default=G_});var FD=x((qD)=>{Object.defineProperty(qD,"__esModule",{value:!0});qD.DiscrError=void 0;var DD;(function($){$.Tag="tag",$.Mapping="mapping"})(DD||(qD.DiscrError=DD={}))});var AD=x((ID)=>{Object.defineProperty(ID,"__esModule",{value:!0});var x0=s(),WU=FD(),MD=DQ(),K_=D8(),w_=Y$(),V_={message:({params:{discrError:$,tagName:X}})=>$===WU.DiscrError.Tag?`tag "${X}" must be string`:`value of tag "${X}" must be in oneOf`,params:({params:{discrError:$,tag:X,tagName:J}})=>x0._`{error: ${$}, tag: ${J}, tagValue: ${X}}`},N_={keyword:"discriminator",type:"object",schemaType:"object",error:V_,code($){let{gen:X,data:J,schema:Q,parentSchema:z,it:Y}=$,{oneOf:W}=z;if(!Y.opts.discriminator)throw Error("discriminator: requires discriminator option");let G=Q.propertyName;if(typeof G!="string")throw Error("discriminator: requires propertyName");if(Q.mapping)throw Error("discriminator: mapping is not supported");if(!W)throw Error("discriminator: requires oneOf keyword");let U=X.let("valid",!1),K=X.const("tag",x0._`${J}${(0,x0.getProperty)(G)}`);X.if(x0._`typeof ${K} == "string"`,()=>w(),()=>$.error(!1,{discrError:WU.DiscrError.Tag,tag:K,tagName:G})),$.ok(U);function w(){let N=H();X.if(!1);for(let O in N)X.elseIf(x0._`${K} === ${O}`),X.assign(U,V(N[O]));X.else(),$.error(!1,{discrError:WU.DiscrError.Mapping,tag:K,tagName:G}),X.endIf()}function V(N){let O=X.name("valid"),B=$.subschema({keyword:"oneOf",schemaProp:N},O);return $.mergeEvaluated(B,x0.Name),O}function H(){var N;let O={},B=F(z),L=!0;for(let m=0;m<W.length;m++){let c=W[m];if((c===null||c===void 0?void 0:c.$ref)&&!(0,w_.schemaHasRulesButRef)(c,Y.self.RULES)){let H4=c.$ref;if(c=MD.resolveRef.call(Y.self,Y.schemaEnv.root,Y.baseId,H4),c instanceof MD.SchemaEnv)c=c.schema;if(c===void 0)throw new K_.default(Y.opts.uriResolver,Y.baseId,H4)}let v$=(N=c===null||c===void 0?void 0:c.properties)===null||N===void 0?void 0:N[G];if(typeof v$!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${G}"`);L=L&&(B||F(c)),Z(v$,m)}if(!L)throw Error(`discriminator: "${G}" must be required`);return O;function F({required:m}){return Array.isArray(m)&&m.includes(G)}function Z(m,c){if(m.const)C(m.const,c);else if(m.enum)for(let v$ of m.enum)C(v$,c);else throw Error(`discriminator: "properties/${G}" must have "const" or "enum"`)}function C(m,c){if(typeof m!="string"||m in O)throw Error(`discriminator: "${G}" values must be unique strings`);O[m]=c}}}};ID.default=N_});var bD=x((da,O_)=>{O_.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var UU=x((Q4,GU)=>{Object.defineProperty(Q4,"__esModule",{value:!0});Q4.MissingRefError=Q4.ValidationError=Q4.CodeGen=Q4.Name=Q4.nil=Q4.stringify=Q4.str=Q4._=Q4.KeywordCxt=Q4.Ajv=void 0;var B_=RB(),j_=jD(),D_=AD(),PD=bD(),q_=["/properties"],TQ="http://json-schema.org/draft-07/schema";class E8 extends B_.default{_addVocabularies(){if(super._addVocabularies(),j_.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(D_.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(PD,q_):PD;this.addMetaSchema($,TQ,!1),this.refs["http://json-schema.org/schema"]=TQ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(TQ)?TQ:void 0)}}Q4.Ajv=E8;GU.exports=Q4=E8;GU.exports.Ajv=E8;Object.defineProperty(Q4,"__esModule",{value:!0});Q4.default=E8;var L_=j8();Object.defineProperty(Q4,"KeywordCxt",{enumerable:!0,get:function(){return L_.KeywordCxt}});var T0=s();Object.defineProperty(Q4,"_",{enumerable:!0,get:function(){return T0._}});Object.defineProperty(Q4,"str",{enumerable:!0,get:function(){return T0.str}});Object.defineProperty(Q4,"stringify",{enumerable:!0,get:function(){return T0.stringify}});Object.defineProperty(Q4,"nil",{enumerable:!0,get:function(){return T0.nil}});Object.defineProperty(Q4,"Name",{enumerable:!0,get:function(){return T0.Name}});Object.defineProperty(Q4,"CodeGen",{enumerable:!0,get:function(){return T0.CodeGen}});var F_=BQ();Object.defineProperty(Q4,"ValidationError",{enumerable:!0,get:function(){return F_.default}});var M_=D8();Object.defineProperty(Q4,"MissingRefError",{enumerable:!0,get:function(){return M_.default}})});var TD=x((_D)=>{Object.defineProperty(_D,"__esModule",{value:!0});_D.formatNames=_D.fastFormats=_D.fullFormats=void 0;function n4($,X){return{validate:$,compare:X}}_D.fullFormats={date:n4(ED,NU),time:n4(wU(!0),HU),"date-time":n4(ZD(!0),CD),"iso-time":n4(wU(),vD),"iso-date-time":n4(ZD(),kD),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:E_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:f_,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:v_,int32:{type:"number",validate:__},int64:{type:"number",validate:x_},float:{type:"number",validate:RD},double:{type:"number",validate:RD},password:!0,binary:!0};_D.fastFormats={..._D.fullFormats,date:n4(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,NU),time:n4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,HU),"date-time":n4(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,CD),"iso-time":n4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,vD),"iso-date-time":n4(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,kD),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};_D.formatNames=Object.keys(_D.fullFormats);function b_($){return $%4===0&&($%100!==0||$%400===0)}var P_=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Z_=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ED($){let X=P_.exec($);if(!X)return!1;let J=+X[1],Q=+X[2],z=+X[3];return Q>=1&&Q<=12&&z>=1&&z<=(Q===2&&b_(J)?29:Z_[Q])}function NU($,X){if(!($&&X))return;if($>X)return 1;if($<X)return-1;return 0}var KU=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function wU($){return function(J){let Q=KU.exec(J);if(!Q)return!1;let z=+Q[1],Y=+Q[2],W=+Q[3],G=Q[4],U=Q[5]==="-"?-1:1,K=+(Q[6]||0),w=+(Q[7]||0);if(K>23||w>59||$&&!G)return!1;if(z<=23&&Y<=59&&W<60)return!0;let V=Y-w*U,H=z-K*U-(V<0?1:0);return(H===23||H===-1)&&(V===59||V===-1)&&W<61}}function HU($,X){if(!($&&X))return;let J=new Date("2020-01-01T"+$).valueOf(),Q=new Date("2020-01-01T"+X).valueOf();if(!(J&&Q))return;return J-Q}function vD($,X){if(!($&&X))return;let J=KU.exec($),Q=KU.exec(X);if(!(J&&Q))return;if($=J[1]+J[2]+J[3],X=Q[1]+Q[2]+Q[3],$>X)return 1;if($<X)return-1;return 0}var VU=/t|\s/i;function ZD($){let X=wU($);return function(Q){let z=Q.split(VU);return z.length===2&&ED(z[0])&&X(z[1])}}function CD($,X){if(!($&&X))return;let J=new Date($).valueOf(),Q=new Date(X).valueOf();if(!(J&&Q))return;return J-Q}function kD($,X){if(!($&&X))return;let[J,Q]=$.split(VU),[z,Y]=X.split(VU),W=NU(J,z);if(W===void 0)return;return W||HU(Q,Y)}var S_=/\/|:/,R_=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function E_($){return S_.test($)&&R_.test($)}var SD=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function v_($){return SD.lastIndex=0,SD.test($)}var C_=-2147483648,k_=2147483647;function __($){return Number.isInteger($)&&$<=k_&&$>=C_}function x_($){return Number.isInteger($)}function RD(){return!0}var T_=/[^\\]\\Z/;function f_($){if(T_.test($))return!1;try{return new RegExp($),!0}catch(X){return!1}}});var gD=x((fD)=>{Object.defineProperty(fD,"__esModule",{value:!0});fD.formatLimitDefinition=void 0;var y_=UU(),y4=s(),l6=y4.operators,fQ={formatMaximum:{okStr:"<=",ok:l6.LTE,fail:l6.GT},formatMinimum:{okStr:">=",ok:l6.GTE,fail:l6.LT},formatExclusiveMaximum:{okStr:"<",ok:l6.LT,fail:l6.GTE},formatExclusiveMinimum:{okStr:">",ok:l6.GT,fail:l6.LTE}},h_={message:({keyword:$,schemaCode:X})=>y4.str`should be ${fQ[$].okStr} ${X}`,params:({keyword:$,schemaCode:X})=>y4._`{comparison: ${fQ[$].okStr}, limit: ${X}}`};fD.formatLimitDefinition={keyword:Object.keys(fQ),type:"string",schemaType:"string",$data:!0,error:h_,code($){let{gen:X,data:J,schemaCode:Q,keyword:z,it:Y}=$,{opts:W,self:G}=Y;if(!W.validateFormats)return;let U=new y_.KeywordCxt(Y,G.RULES.all.format.definition,"format");if(U.$data)K();else w();function K(){let H=X.scopeValue("formats",{ref:G.formats,code:W.code.formats}),N=X.const("fmt",y4._`${H}[${U.schemaCode}]`);$.fail$data((0,y4.or)(y4._`typeof ${N} != "object"`,y4._`${N} instanceof RegExp`,y4._`typeof ${N}.compare != "function"`,V(N)))}function w(){let H=U.schema,N=G.formats[H];if(!N||N===!0)return;if(typeof N!="object"||N instanceof RegExp||typeof N.compare!="function")throw Error(`"${z}": format "${H}" does not define "compare" function`);let O=X.scopeValue("formats",{key:H,ref:N,code:W.code.formats?y4._`${W.code.formats}${(0,y4.getProperty)(H)}`:void 0});$.fail$data(V(O))}function V(H){return y4._`${H}.compare(${J}, ${Q}) ${fQ[z].fail} 0`}},dependencies:["format"]};var u_=($)=>{return $.addKeyword(fD.formatLimitDefinition),$};fD.default=u_});var lD=x((v8,uD)=>{Object.defineProperty(v8,"__esModule",{value:!0});var f0=TD(),m_=gD(),jU=s(),yD=new jU.Name("fullFormats"),c_=new jU.Name("fastFormats"),DU=($,X={keywords:!0})=>{if(Array.isArray(X))return hD($,X,f0.fullFormats,yD),$;let[J,Q]=X.mode==="fast"?[f0.fastFormats,c_]:[f0.fullFormats,yD],z=X.formats||f0.formatNames;if(hD($,z,J,Q),X.keywords)(0,m_.default)($);return $};DU.get=($,X="full")=>{let Q=(X==="fast"?f0.fastFormats:f0.fullFormats)[$];if(!Q)throw Error(`Unknown format "${$}"`);return Q};function hD($,X,J,Q){var z,Y;(z=(Y=$.opts.code).formats)!==null&&z!==void 0||(Y.formats=jU._`require("ajv-formats/dist/formats").${Q}`);for(let W of X)$.addFormat(W,J[W])}uD.exports=v8=DU;Object.defineProperty(v8,"__esModule",{value:!0});v8.default=DU});class i6 extends Error{}var{closeSync:$c,writeFileSync:Xc,fsyncSync:Jc,openSync:zc}=(()=>({}));function Hq(){this.__data__=[],this.size=0}var EU=Hq;function Oq($,X){return $===X||$!==$&&X!==X}var vU=Oq;function Bq($,X){var J=$.length;while(J--)if(vU($[J][0],X))return J;return-1}var O6=Bq;var jq=Array.prototype,Dq=jq.splice;function qq($){var X=this.__data__,J=O6(X,$);if(J<0)return!1;var Q=X.length-1;if(J==Q)X.pop();else Dq.call(X,J,1);return--this.size,!0}var CU=qq;function Lq($){var X=this.__data__,J=O6(X,$);return J<0?void 0:X[J][1]}var kU=Lq;function Fq($){return O6(this.__data__,$)>-1}var _U=Fq;function Mq($,X){var J=this.__data__,Q=O6(J,$);if(Q<0)++this.size,J.push([$,X]);else J[Q][1]=X;return this}var xU=Mq;function Z1($){var X=-1,J=$==null?0:$.length;this.clear();while(++X<J){var Q=$[X];this.set(Q[0],Q[1])}}Z1.prototype.clear=EU;Z1.prototype.delete=CU;Z1.prototype.get=kU;Z1.prototype.has=_U;Z1.prototype.set=xU;var TU=Z1;var Iq=typeof global=="object"&&global&&global.Object===Object&&global,fU=Iq;var Aq=typeof self=="object"&&self&&self.Object===Object&&self,bq=fU||Aq||Function("return this")(),S1=bq;var Pq=S1.Symbol,R1=Pq;var gU=Object.prototype,Zq=gU.hasOwnProperty,Sq=gU.toString,y0=R1?R1.toStringTag:void 0;function Rq($){var X=Zq.call($,y0),J=$[y0];try{$[y0]=void 0;var Q=!0}catch(Y){}var z=Sq.call($);if(Q)if(X)$[y0]=J;else delete $[y0];return z}var yU=Rq;var Eq=Object.prototype,vq=Eq.toString;function Cq($){return vq.call($)}var hU=Cq;var kq="[object Null]",_q="[object Undefined]",uU=R1?R1.toStringTag:void 0;function xq($){if($==null)return $===void 0?_q:kq;return uU&&uU in Object($)?yU($):hU($)}var lU=xq;function Tq($){var X=typeof $;return $!=null&&(X=="object"||X=="function")}var k8=Tq;var fq="[object AsyncFunction]",gq="[object Function]",yq="[object GeneratorFunction]",hq="[object Proxy]";function uq($){if(!k8($))return!1;var X=lU($);return X==gq||X==yq||X==fq||X==hq}var mU=uq;var lq=S1["__core-js_shared__"],_8=lq;var cU=function(){var $=/[^.]+$/.exec(_8&&_8.keys&&_8.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}();function mq($){return!!cU&&cU in $}var iU=mq;var cq=Function.prototype,iq=cq.toString;function nq($){if($!=null){try{return iq.call($)}catch(X){}try{return $+""}catch(X){}}return""}var nU=nq;var pq=/[\\^$.*+?()[\]{}|]/g,dq=/^\[object .+?Constructor\]$/,rq=Function.prototype,oq=Object.prototype,tq=rq.toString,aq=oq.hasOwnProperty,sq=RegExp("^"+tq.call(aq).replace(pq,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function eq($){if(!k8($)||iU($))return!1;var X=mU($)?sq:dq;return X.test(nU($))}var pU=eq;function $L($,X){return $==null?void 0:$[X]}var dU=$L;function XL($,X){var J=dU($,X);return pU(J)?J:void 0}var x8=XL;var JL=x8(S1,"Map"),rU=JL;var zL=x8(Object,"create"),p4=zL;function QL(){this.__data__=p4?p4(null):{},this.size=0}var oU=QL;function YL($){var X=this.has($)&&delete this.__data__[$];return this.size-=X?1:0,X}var tU=YL;var WL="__lodash_hash_undefined__",GL=Object.prototype,UL=GL.hasOwnProperty;function KL($){var X=this.__data__;if(p4){var J=X[$];return J===WL?void 0:J}return UL.call(X,$)?X[$]:void 0}var aU=KL;var wL=Object.prototype,VL=wL.hasOwnProperty;function NL($){var X=this.__data__;return p4?X[$]!==void 0:VL.call(X,$)}var sU=NL;var HL="__lodash_hash_undefined__";function OL($,X){var J=this.__data__;return this.size+=this.has($)?0:1,J[$]=p4&&X===void 0?HL:X,this}var eU=OL;function E1($){var X=-1,J=$==null?0:$.length;this.clear();while(++X<J){var Q=$[X];this.set(Q[0],Q[1])}}E1.prototype.clear=oU;E1.prototype.delete=tU;E1.prototype.get=aU;E1.prototype.has=sU;E1.prototype.set=eU;var uQ=E1;function BL(){this.size=0,this.__data__={hash:new uQ,map:new(rU||TU),string:new uQ}}var $K=BL;function jL($){var X=typeof $;return X=="string"||X=="number"||X=="symbol"||X=="boolean"?$!=="__proto__":$===null}var XK=jL;function DL($,X){var J=$.__data__;return XK(X)?J[typeof X=="string"?"string":"hash"]:J.map}var B6=DL;function qL($){var X=B6(this,$).delete($);return this.size-=X?1:0,X}var JK=qL;function LL($){return B6(this,$).get($)}var zK=LL;function FL($){return B6(this,$).has($)}var QK=FL;function ML($,X){var J=B6(this,$),Q=J.size;return J.set($,X),this.size+=J.size==Q?0:1,this}var YK=ML;function v1($){var X=-1,J=$==null?0:$.length;this.clear();while(++X<J){var Q=$[X];this.set(Q[0],Q[1])}}v1.prototype.clear=$K;v1.prototype.delete=JK;v1.prototype.get=zK;v1.prototype.has=QK;v1.prototype.set=YK;var lQ=v1;var{realpathSync:UK}=(()=>({}));var IL="Expected a function";function mQ($,X){if(typeof $!="function"||X!=null&&typeof X!="function")throw TypeError(IL);var J=function(){var Q=arguments,z=X?X.apply(this,Q):Q[0],Y=J.cache;if(Y.has(z))return Y.get(z);var W=$.apply(this,Q);return J.cache=Y.set(z,W)||Y,W};return J.cache=new(mQ.Cache||lQ),J}mQ.Cache=lQ;var O4=mQ;var WK=function(){return"/"};var h0=()=>globalThis.crypto.randomUUID();function n6($){if(!$)return!1;if(typeof $==="boolean")return $;let X=String($).toLowerCase().trim();return["1","true","yes","on"].includes(X)}function j6(){let $=new Set;return{subscribe(X){return $.add(X),()=>{$.delete(X)}},emit(...X){let J;for(let Q of $)try{Q(...X)}catch(z){(J??=[]).push(z)}if(J)throw J.length===1?J[0]:AggregateError(J,"Signal listener(s) threw")},clear(){$.clear()}}}function GK(){return{sent:new Set,rejected:new Set}}var bL={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};function PL(){let $="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof UK==="function"){let J=WK();try{$=UK(J).normalize("NFC")}catch{$=J.normalize("NFC")}}return{originalCwd:$,projectRoot:$,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:$,modelUsage:{},mainLoopModelOverride:void 0,refusalFallbackPreviousTurn:!1,replConfigArgv:[],initialMainLoopModel:void 0,modelStrings:null,isInteractive:!1,attacherCaps:null,hasStreamingInput:!1,modelOverrideOptOutForSession:!1,kairosActive:!1,rendererMode:void 0,strictToolResultPairing:!1,memoryToggledOff:!1,teamMemoryServerStatus:void 0,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,clientType:"cli",sessionSource:void 0,sessionStartType:"fresh",questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,oauthScopesFromFd:void 0,apiKeyFromFd:void 0,gatewayAuth:null,gatewayRefreshInFlight:null,flagSettingsPath:void 0,flagSettingsInline:null,parentManagedSettings:null,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:h0(),parentSessionId:void 0,loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,cachedTelemetryResource:null,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastCancelledAPIMessageId:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],inlinePluginUrls:[],chromeFlagOverride:void 0,useCoworkPlugins:!1,sessionBypassPermissionsMode:!1,scheduledTasksEnabled:!1,sessionPrResolved:!1,sessionCronTasks:[],loopChainStartedAt:Object.create(null),sessionCreatedTeams:new Set,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,sdkOAuthTokenRefreshCallback:null,hostAuthTokenRefreshCallback:null,mainThreadAgentType:void 0,mainThreadAgentHooks:void 0,sessionSkillAllowlist:void 0,caps:bL,replBridgeActive:!1,directConnectServerUrl:void 0,mcpConnectNonBlocking:!1,strictMcpConfig:!1,activeRoutine:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],allowedChannels:[],activeInputs:new Map,hasDevChannels:!1,sessionProjectDir:null,promptCache1hAllowlist:null,stickyBetas:GK(),thinkingTypeOverrides:new Map,inferenceProfileBackingModels:new Map,promptId:null,promptIndex:0,lastMainRequestId:void 0,lastMainThreadCacheTtlMs:null,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}var ZL=PL(),SL=()=>{return};function cQ(){return SL()?.sessionId??ZL.sessionId}var RL=j6(),Af=RL.subscribe;var EL=j6(),bf=EL.subscribe;var vL=j6(),Pf=vL.subscribe;var CL=j6();var Zf=CL.subscribe;var kL=j6();var Sf=kL.subscribe;var{appendFile:fw,mkdir:zM,rename:gw,stat:QM,symlink:YM,unlink:_Y}=(()=>({}));P4();function DK({writeFn:$,flushIntervalMs:X=1000,maxBufferSize:J=100,maxBufferBytes:Q=1/0,immediateMode:z=!1}){let Y=[],W=0,G=null,U=null;function K(){if(G)clearTimeout(G),G=null}function w(O){try{$(O)}catch{}}function V(){if(U)w(U.join("")),U=null;if(Y.length===0)return;w(Y.join("")),Y=[],W=0,K()}function H(){if(!G)G=setTimeout(V,X)}function N(){if(U){U.push(...Y),Y=[],W=0,K();return}let O=Y;Y=[],W=0,K(),U=O,setImmediate(()=>{let B=U;if(U=null,B)w(B.join(""))})}return{write(O){if(z){w(O);return}if(Y.push(O),W+=O.length,H(),Y.length>=J||W>=Q)N()},flush:V,dispose(){V()}}}function TL($){if(typeof $==="function")return $;if(Symbol.asyncDispose in $)return()=>$[Symbol.asyncDispose]();return()=>$[Symbol.dispose]()}class qK{#$=new Set;register($){let X=TL($);this.#$.add(X);let J=()=>{this.#$.delete(X)};return Object.assign(J,{[Symbol.dispose]:J})}async drain(){let $=Array.from(this.#$);this.#$.clear(),await Promise.all($.map(async(X)=>X()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#$.size}}var fL=new qK;function LK($){return fL.register($)}var FK=O4(($)=>{if(!$||$.trim()==="")return null;let X=$.split(",").map((Y)=>Y.trim()).filter(Boolean);if(X.length===0)return null;let J=X.some((Y)=>Y.startsWith("!")),Q=X.some((Y)=>!Y.startsWith("!"));if(J&&Q)return null;let z=X.map((Y)=>Y.replace(/^!/,"").toLowerCase());return{include:J?[]:z,exclude:J?z:[],isExclusive:J}});function gL($){let X=[],J=$.match(/^MCP server ["']([^"']+)["']/);if(J&&J[1])X.push("mcp"),X.push(J[1].toLowerCase());else{let Y=$.match(/^([^:[]+):/);if(Y&&Y[1])X.push(Y[1].trim().toLowerCase())}let Q=$.match(/^\[([^\]]+)]/);if(Q&&Q[1])X.push(Q[1].trim().toLowerCase());if($.toLowerCase().includes("1p event:"))X.push("1p");let z=$.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(z&&z[1]){let Y=z[1].trim().toLowerCase();if(Y.length<30&&!Y.includes(" "))X.push(Y)}return Array.from(new Set(X))}function yL($,X){if(!X)return!0;if($.length===0)return!1;if(X.isExclusive)return!$.some((J)=>X.exclude.includes(J));else return $.some((J)=>X.include.includes(J))}function MK($,X){if(!X)return!0;let J=gL($);return yL(J,X)}var rQ=function(){return"/"};P4();var IK=O4(()=>{return(process.env.CLAUDE_CONFIG_DIR??u4(rQ(),".claude")).normalize("NFC")},()=>process.env.CLAUDE_CONFIG_DIR);var yf=O4(()=>n6(process.env.CLAUDE_CODE_SUPERVISED));function k($,X,J,Q,z){if(Q==="m")throw TypeError("Private method is not writable");if(Q==="a"&&!z)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!z:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return Q==="a"?z.call($,J):z?z.value=J:X.set($,J),J}function D($,X,J,Q){if(J==="a"&&!Q)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!Q:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return J==="m"?Q:J==="a"?Q.call($):Q?Q.value:X.get($)}var oQ=function(){let{crypto:$}=globalThis;if($?.randomUUID)return oQ=$.randomUUID.bind($),$.randomUUID();let X=new Uint8Array(1),J=$?()=>$.getRandomValues(X)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(Q)=>(+Q^J()&15>>+Q/4).toString(16))};function d4($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var u0=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let X=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)X.stack=$.stack;if($.cause&&!X.cause)X.cause=$.cause;if($.name)X.name=$.name;return X}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};class T extends Error{}class k$ extends T{constructor($,X,J,Q,z){super(`${k$.makeMessage($,X,J)}`);this.status=$,this.headers=Q,this.requestID=Q?.get("request-id"),this.error=X,this.type=z??null}static makeMessage($,X,J){let Q=X?.message?typeof X.message==="string"?X.message:JSON.stringify(X.message):X?JSON.stringify(X):J;if($&&Q)return`${$} ${Q}`;if($)return`${$} status code (no body)`;if(Q)return Q;return"(no status code or body)"}static generate($,X,J,Q){if(!$||!Q)return new r6({message:J,cause:u0(X)});let z=X,Y=z?.error?.type;if($===400)return new m0($,z,J,Q,Y);if($===401)return new c0($,z,J,Q,Y);if($===403)return new i0($,z,J,Q,Y);if($===404)return new n0($,z,J,Q,Y);if($===409)return new p0($,z,J,Q,Y);if($===422)return new d0($,z,J,Q,Y);if($===429)return new r0($,z,J,Q,Y);if($>=500)return new o0($,z,J,Q,Y);return new k$($,z,J,Q,Y)}}class f$ extends k${constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}}class r6 extends k${constructor({message:$,cause:X}){super(void 0,void 0,$||"Connection error.",void 0);if(X)this.cause=X}}class l0 extends r6{constructor({message:$}={}){super({message:$??"Request timed out."})}}class m0 extends k${}class c0 extends k${}class i0 extends k${}class n0 extends k${}class p0 extends k${}class d0 extends k${}class r0 extends k${}class o0 extends k${}var uL=/^[a-z][a-z0-9+.-]*:/i,AK=($)=>{return uL.test($)},tQ=($)=>(tQ=Array.isArray,tQ($)),aQ=tQ;function T8($){if(typeof $!=="object")return{};return $??{}}function sQ($){if(!$)return!0;for(let X in $)return!1;return!0}function bK($,X){return Object.prototype.hasOwnProperty.call($,X)}var PK=($,X)=>{if(typeof X!=="number"||!Number.isInteger(X))throw new T(`${$} must be an integer`);if(X<0)throw new T(`${$} must be a positive integer`);return X};var f8=($)=>{try{return JSON.parse($)}catch(X){return}};var ZK=($)=>new Promise((X)=>setTimeout(X,$));var B4="0.94.0";var vK=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function lL(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var mL=()=>{let $=lL();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":RK(Deno.build.os),"X-Stainless-Arch":SK(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":RK(globalThis.process.platform??"unknown"),"X-Stainless-Arch":SK(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let X=cL();if(X)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${X.browser}`,"X-Stainless-Runtime-Version":X.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function cL(){if(typeof navigator>"u"||!navigator)return null;let $=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:X,pattern:J}of $){let Q=J.exec(navigator.userAgent);if(Q){let z=Q[1]||0,Y=Q[2]||0,W=Q[3]||0;return{browser:X,version:`${z}.${Y}.${W}`}}}return null}var SK=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},RK=($)=>{if($=$.toLowerCase(),$.includes("ios"))return"iOS";if($==="android")return"Android";if($==="darwin")return"MacOS";if($==="win32")return"Windows";if($==="freebsd")return"FreeBSD";if($==="openbsd")return"OpenBSD";if($==="linux")return"Linux";if($)return`Other:${$}`;return"Unknown"},EK,t0=()=>{return EK??(EK=mL())};function CK(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function eQ(...$){let X=globalThis.ReadableStream;if(typeof X>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new X(...$)}function g8($){let X=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return eQ({start(){},async pull(J){let{done:Q,value:z}=await X.next();if(Q)J.close();else J.enqueue(z)},async cancel(){await X.return?.()}})}function a0($){if($[Symbol.asyncIterator])return $;let X=$.getReader();return{async next(){try{let J=await X.read();if(J?.done)X.releaseLock();return J}catch(J){throw X.releaseLock(),J}},async return(){let J=X.cancel();return X.releaseLock(),await J,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function kK($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let X=$.getReader(),J=X.cancel();X.releaseLock(),await J}var _K=({headers:$,body:X})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(X)}};function xK($){return Object.entries($).filter(([X,J])=>typeof J<"u").map(([X,J])=>{if(typeof J==="string"||typeof J==="number"||typeof J==="boolean")return`${encodeURIComponent(X)}=${encodeURIComponent(J)}`;if(J===null)return`${encodeURIComponent(X)}=`;throw new T(`Cannot stringify type ${typeof J}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}var fK="urn:ietf:params:oauth:grant-type:jwt-bearer",gK="refresh_token",y8="/v1/oauth/token",o6="oauth-2025-04-20",yK="oidc-federation-2026-04-01",hK=120,k1=30,uK=5,TK=1048576;function h8($){if(!$)return;let X;try{X=new URL($)}catch(Q){throw new w$(`Invalid token endpoint base URL "${$}": ${Q}`)}if(X.protocol==="https:")return;let J=X.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(X.protocol==="http:"&&(J==="localhost"||J==="127.0.0.1"||J==="::1"))return;throw new w$(`Refusing to send credential over non-https token endpoint "${$}"`)}async function u8($,X){let J=await dL($),Q;try{Q=JSON.parse(J)}catch{throw new w$(`Token endpoint returned non-JSON response (status ${$.status})`,$.status,t$(J),X)}if(!Q.access_token)throw new w$(`Token endpoint response missing access_token: ${JSON.stringify(t$(Q))}`,$.status,t$(Q),X);if(Q.token_type&&Q.token_type.toLowerCase()!=="bearer")throw new w$(`Token endpoint response: unsupported token_type "${Q.token_type}" (want Bearer)`,$.status,t$(Q),X);return Q}var $Y=2000,pL=new Set(["error","error_description","error_uri"]);function t$($){if($==null)return $;if(typeof $==="string"){let X;try{X=JSON.parse($)}catch{if($.length<=$Y)return $;return $.slice(0,$Y)+`... <${$.length-$Y} more chars>`}return JSON.stringify(t$(X))}if(typeof $==="object"&&!Array.isArray($)){let X={};for(let[J,Q]of Object.entries($))if(pL.has(J))X[J]=Q;return X}return null}async function l8($,X=(J)=>console.warn(`anthropic-sdk: ${J}`)){if(typeof process>"u"||process.platform==="win32")return;let J=await import("node:fs"),Q=$,z;try{Q=await J.promises.realpath($),z=await J.promises.stat(Q)}catch{return}let Y=z.mode&511;if(Y&18)throw new w$(`Credentials file at ${Q} is group/world-writable (mode 0o${Y.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${Q}\`.`);if(Y&36)throw new w$(`Credentials file at ${Q} is group/world-readable (mode 0o${Y.toString(8)}); run \`chmod 600 ${Q}\` before retrying.`);if(typeof process.getuid==="function"&&z.uid!==process.getuid())X(`credentials file at ${Q} is owned by uid ${z.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function m8($,X){let J=await import("node:fs"),z=(await Promise.resolve().then(() => (P4(),d6))).dirname($);await J.promises.mkdir(z,{recursive:!0,mode:448});let Y=`${$}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let W=await J.promises.open(Y,"w",384);try{await W.writeFile(JSON.stringify(X,null,2)),await W.sync()}finally{await W.close()}await J.promises.rename(Y,$)}catch(W){throw await J.promises.unlink(Y).catch(()=>{}),W}try{let W=await J.promises.open(z,"r");try{await W.sync()}finally{await W.close()}}catch{}}async function dL($){if(!$.body)return"";let X=$.body.getReader(),J=[],Q=0;for(;;){let{done:Y,value:W}=await X.read();if(Y)break;if(Q+W.length>TK){let G=TK-Q;if(G>0)J.push(W.subarray(0,G));await X.cancel();break}J.push(W),Q+=W.length}let z;if(J.length===1)z=J[0];else{z=new Uint8Array(J.reduce((W,G)=>W+G.length,0));let Y=0;for(let W of J)z.set(W,Y),Y+=W.length}return new TextDecoder("utf-8").decode(z)}class w$ extends T{constructor($,X=null,J=null,Q=null){super($);this.statusCode=X,this.body=J,this.requestId=Q}}function Z4(){return Math.floor(Date.now()/1000)}class XY{constructor($,X){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=$,this.onAdvisoryRefreshError=X}async getToken(){let $=this.nextForce;this.nextForce=!1;let X=this.cached;if($||X==null)return(await this.refresh($)).token;if(X.expiresAt==null)return X.token;let J=X.expiresAt-Z4();if(J>hK)return X.token;if(J>k1)return this.backgroundRefresh(),X.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh($=!1){if(this.pendingRefresh&&!$)return this.pendingRefresh;return this.doRefresh($)}backgroundRefresh(){if(this.pendingRefresh)return;if(Z4()-this.lastAdvisoryError<uK)return;this.doRefresh().catch(($)=>{this.lastAdvisoryError=Z4(),this.onAdvisoryRefreshError?.($)})}doRefresh($=!1){return this.pendingRefresh=this.provider($?{forceRefresh:!0}:void 0).then((X)=>{return this.cached=X,this.pendingRefresh=null,X},(X)=>{throw this.pendingRefresh=null,X}),this.pendingRefresh}}var K$=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim()||void 0;return};function cK($){let X=0;for(let z of $)X+=z.length;let J=new Uint8Array(X),Q=0;for(let z of $)J.set(z,Q),Q+=z.length;return J}var lK;function _1($){let X;return(lK??(X=new globalThis.TextEncoder,lK=X.encode.bind(X)))($)}var mK;function JY($){let X;return(mK??(X=new globalThis.TextDecoder,mK=X.decode.bind(X)))($)}var i8={off:0,error:200,warn:300,info:400,debug:500},zY=($,X,J)=>{if(!$)return;if(bK(i8,$))return $;S$(J).warn(`${X} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(i8))}`);return};function s0(){}function c8($,X,J){if(!X||i8[$]>i8[J])return s0;else return X[$].bind(X)}var rL={error:s0,warn:s0,info:s0,debug:s0},iK=new WeakMap;function S$($){let X=$.logger,J=$.logLevel??"off";if(!X)return rL;let Q=iK.get(X);if(Q&&Q[0]===J)return Q[1];let z={error:c8("error",X,J),warn:c8("warn",X,J),info:c8("info",X,J),debug:c8("debug",X,J)};return iK.set(X,[J,z]),z}var r4=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([X,J])=>[X,X.toLowerCase()==="x-api-key"||X.toLowerCase()==="authorization"||X.toLowerCase()==="cookie"||X.toLowerCase()==="set-cookie"?"***":J]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var n8="1.0",oL=/^[A-Za-z0-9_.-]+$/;function nK($){if(!$)throw Error("profile name is empty");if($==="."||$==="..")throw Error(`profile name "${$}" is not allowed`);if($.includes("/")||$.includes("\\"))throw Error(`profile name "${$}" must not contain path separators`);if(!oL.test($))throw Error(`profile name "${$}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var pK=async($)=>{var X,J;let Q=await QY();if(Q===null)return null;let z=$??await rK();if(z===null)return null;nK(z);let Y=await import("node:fs"),G=(await Promise.resolve().then(() => (P4(),d6))).join(Q,"configs",`${z}.json`),U;try{U=await Y.promises.readFile(G,"utf-8")}catch(V){if(V?.code!=="ENOENT")throw Error(`failed to read config file ${G}: ${V}`);U=null}if(U===null){let V=K$("ANTHROPIC_ORGANIZATION_ID"),H=K$("ANTHROPIC_IDENTITY_TOKEN_FILE"),N=K$("ANTHROPIC_FEDERATION_RULE_ID");if(N&&V)return{fromFile:!1,config:{organization_id:V,workspace_id:K$("ANTHROPIC_WORKSPACE_ID"),base_url:K$("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:N,service_account_id:K$("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:H?{source:"file",path:H}:void 0,scope:K$("ANTHROPIC_SCOPE")}}};return null}let K;try{K=JSON.parse(U)}catch(V){throw Error(`failed to parse config file ${G}: ${V}`)}if(!K.authentication)throw Error(`config file ${G} is missing "authentication"`);let w=K.authentication.type;if(w!=="oidc_federation"&&w!=="user_oauth")throw Error(`authentication.type "${w}" is not a known authentication type`);if(K.organization_id??(K.organization_id=K$("ANTHROPIC_ORGANIZATION_ID")),K.workspace_id??(K.workspace_id=K$("ANTHROPIC_WORKSPACE_ID")),K.base_url??(K.base_url=K$("ANTHROPIC_BASE_URL")),(X=K.authentication).scope??(X.scope=K$("ANTHROPIC_SCOPE")),K.authentication.type==="oidc_federation"){if(!K.authentication.identity_token){let V=K$("ANTHROPIC_IDENTITY_TOKEN_FILE");if(V)K.authentication.identity_token={source:"file",path:V}}if(!K.authentication.federation_rule_id)K.authentication.federation_rule_id=K$("ANTHROPIC_FEDERATION_RULE_ID")??"";(J=K.authentication).service_account_id??(J.service_account_id=K$("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:K,fromFile:!0}};var dK=async($,X)=>{if($?.authentication.credentials_path)return $.authentication.credentials_path;let J=await QY();if(!J)return null;let Q=X??await rK();if(!Q)return null;return nK(Q),(await Promise.resolve().then(() => (P4(),d6))).join(J,"credentials",`${Q}.json`)},QY=async()=>{if(!tL())return null;let $=await Promise.resolve().then(() => (P4(),d6)),X=K$("ANTHROPIC_CONFIG_DIR");if(X)return X;if(t0()["X-Stainless-OS"]==="Windows"){let Y=K$("APPDATA");if(Y)return $.join(Y,"Anthropic");let W=K$("USERPROFILE");if(W)return $.join(W,"AppData","Roaming","Anthropic");return null}let Q=K$("XDG_CONFIG_HOME");if(Q)return $.join(Q,"anthropic");let z=K$("HOME");if(z)return $.join(z,".config","anthropic");return null},tL=()=>{let $=t0()["X-Stainless-Runtime"];return $==="node"||$==="deno"},rK=async()=>{let $=await QY();if(!$)return null;let X=K$("ANTHROPIC_PROFILE");if(X)return X;let J=await import("node:fs"),z=(await Promise.resolve().then(() => (P4(),d6))).join($,"active_config");try{return(await J.promises.readFile(z,"utf-8")).trim()||"default"}catch(Y){if(Y?.code!=="ENOENT")throw Error(`failed to read ${z}: ${Y}`);return"default"}};function YY($){if(!$)throw new T("Identity token file path is empty");return async()=>{let X=await import("node:fs"),J;try{J=await X.promises.readFile($,"utf-8")}catch(z){throw new T(`Failed to read identity token file at ${$}: ${z}`)}let Q=J.trim();if(!Q)throw new T(`Identity token file at ${$} is empty`);return Q}}function oK($){if(!$)throw new T("Identity token value is empty");return()=>$}function tK($){return async()=>{h8($.baseURL);let X=await $.identityTokenProvider();if(X.length>16384)throw new w$(`Identity token is ${Math.ceil(X.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let J={grant_type:fK,assertion:X,federation_rule_id:$.federationRuleId,organization_id:$.organizationId};if($.serviceAccountId)J.service_account_id=$.serviceAccountId;if($.workspaceId)J.workspace_id=$.workspaceId;let Q=`${$.baseURL}${y8}`,z;try{z=await $.fetch(Q,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${o6},${yK}`,"User-Agent":$.userAgent||`anthropic-sdk-typescript/${B4} oidcFederationProvider`},body:JSON.stringify(J)})}catch(U){throw new w$(`Failed to reach token endpoint ${Q}: ${U}`)}let Y=z.headers.get("Request-Id");if(!z.ok){let U=await z.text().catch(()=>""),K=t$(U),w="";if(z.status===401)w=` Ensure your federation rule matches your identity token. ${$.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`;throw new w$(`Token exchange failed with status ${z.status}${Y?` (request-id ${Y})`:""}: ${K}${w}`,z.status,K,Y)}let W=await u8(z,Y),G=Number(W.expires_in);if(!Number.isFinite(G))throw new w$(`Token endpoint response missing required fields: ${JSON.stringify(t$(W))}`,z.status,t$(W),Y);return{token:W.access_token,expiresAt:Z4()+G}}}function aK($){return async(X)=>{let J=await import("node:fs");await l8($.credentialsPath,$.onSafetyWarning);let Q;try{Q=await J.promises.readFile($.credentialsPath,"utf-8")}catch(L){throw new w$(`Credentials file not found at ${$.credentialsPath}: ${L}`)}let z;try{z=JSON.parse(Q)}catch(L){throw new w$(`Credentials file at ${$.credentialsPath} is not valid JSON: ${L}`)}let Y=z.access_token;if(!Y)throw new w$(`Credentials file at ${$.credentialsPath} must include 'access_token'`);let W=z.expires_at;if(!X?.forceRefresh&&(W==null||Z4()<W-k1))return{token:Y,expiresAt:W??null};let G=z.refresh_token;if(!$.clientId||!G)throw new w$(`Access token at ${$.credentialsPath} has expired and no refresh is available (client_id ${$.clientId?"set":"empty"}, refresh_token ${G?"set":"empty"})`);h8($.baseURL);let U={grant_type:gK,refresh_token:G,client_id:$.clientId},K=`${$.baseURL}${y8}`,w;try{w=await $.fetch(K,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":o6,"User-Agent":$.userAgent||`anthropic-sdk-typescript/${B4} userOAuthProvider`},body:JSON.stringify(U)})}catch(L){throw new w$(`User OAuth refresh failed to reach token endpoint: ${L}`)}let V=w.headers.get("Request-Id");if(!w.ok){let L=await w.text().catch(()=>"");throw new w$(`User OAuth refresh failed (HTTP ${w.status}): ${t$(L)}`,w.status,t$(L),V)}let H=await u8(w,V),N=Number(H.expires_in);if(!Number.isFinite(N))throw new w$(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(t$(H))}`,w.status,t$(H),V);let O=Z4()+N,B=H.refresh_token||G;return await m8($.credentialsPath,{...z,version:n8,type:"oauth_token",access_token:H.access_token,expires_at:O,refresh_token:B}),{token:H.access_token,expiresAt:O}}}function WY($,X){let J=$.authentication.credentials_path??null,Q=($.base_url||X.baseURL).replace(/\/+$/,""),z=aL($,J,Q,X),Y={};if($.workspace_id&&$.authentication.type==="user_oauth")Y["anthropic-workspace-id"]=$.workspace_id;return{provider:z,extraHeaders:Y,baseURL:$.base_url||void 0}}async function sK($,X){let J=await pK(X);if(!J)return null;let{config:Q,fromFile:z}=J,Y=Q.authentication.credentials_path||!z?Q:{...Q,authentication:{...Q.authentication,credentials_path:await dK(Q,X)??void 0}};return WY(Y,$)}function aL($,X,J,Q){switch($.authentication.type){case"oidc_federation":{let z=$.authentication,Y=sL(z);if(!Y)throw new w$("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!z.federation_rule_id)throw new w$("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!$.organization_id)throw new w$("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let W=tK({identityTokenProvider:Y,federationRuleId:z.federation_rule_id,organizationId:$.organization_id,serviceAccountId:z.service_account_id,workspaceId:$.workspace_id,baseURL:J,fetch:Q.fetch,userAgent:Q.userAgent});if(X)return eL(W,X,Q.onCacheWriteError,Q.onSafetyWarning);return W}case"user_oauth":{if(!X)throw new w$("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return aK({credentialsPath:X,clientId:$.authentication.client_id,baseURL:J,fetch:Q.fetch,userAgent:Q.userAgent,onSafetyWarning:Q.onSafetyWarning})}default:{let z=$.authentication.type;throw new w$(`authentication.type "${z}" is not a known authentication type`)}}}function sL($){if($.identity_token){let Q=$.identity_token.source;if(Q!=="file")throw new w$(`identity_token.source "${Q}" is not supported by this SDK version (only "file")`);if(!$.identity_token.path)throw new w$('identity_token.source "file" requires a non-empty path');return YY($.identity_token.path)}let X=K$("ANTHROPIC_IDENTITY_TOKEN_FILE");if(X)return YY(X);let J=K$("ANTHROPIC_IDENTITY_TOKEN");if(J)return oK(J);return null}function eL($,X,J,Q){return async(z)=>{let Y=await import("node:fs");await l8(X,Q);let W;try{let U=await Y.promises.readFile(X,"utf-8");W=JSON.parse(U);let K=W?.access_token;if(K&&!z?.forceRefresh){let w=W?.expires_at;if(w==null||Z4()<w-k1)return{token:K,expiresAt:w??null}}}catch(U){if(U?.code!=="ENOENT"&&!(U instanceof SyntaxError))J?.(U)}let G=await $(z);try{await m8(X,{...W??{},version:n8,type:"oauth_token",access_token:G.token,expires_at:G.expiresAt})}catch(U){J?.(U)}return G}}var Y4,W4;class D6{constructor(){Y4.set(this,void 0),W4.set(this,void 0),k(this,Y4,new Uint8Array,"f"),k(this,W4,null,"f")}decode($){if($==null)return[];let X=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?_1($):$;k(this,Y4,cK([D(this,Y4,"f"),X]),"f");let J=[],Q;while((Q=$F(D(this,Y4,"f"),D(this,W4,"f")))!=null){if(Q.carriage&&D(this,W4,"f")==null){k(this,W4,Q.index,"f");continue}if(D(this,W4,"f")!=null&&(Q.index!==D(this,W4,"f")+1||Q.carriage)){J.push(JY(D(this,Y4,"f").subarray(0,D(this,W4,"f")-1))),k(this,Y4,D(this,Y4,"f").subarray(D(this,W4,"f")),"f"),k(this,W4,null,"f");continue}let z=D(this,W4,"f")!==null?Q.preceding-1:Q.preceding,Y=JY(D(this,Y4,"f").subarray(0,z));J.push(Y),k(this,Y4,D(this,Y4,"f").subarray(Q.index),"f"),k(this,W4,null,"f")}return J}flush(){if(!D(this,Y4,"f").length)return[];return this.decode(`
|
|
11
|
+
deps: ${J}}`};var tC={keyword:"dependencies",type:"object",schemaType:"object",error:Rj.error,code($){let[X,J]=aC($);Zj($,X),Sj($,J)}};function aC({schema:$}){let X={},J={};for(let Q in $){if(Q==="__proto__")continue;let z=Array.isArray($[Q])?X:J;z[Q]=$[Q]}return[X,J]}function Zj($,X=$.schema){let{gen:J,data:Q,it:z}=$;if(Object.keys(X).length===0)return;let Y=J.let("missing");for(let W in X){let G=X[W];if(G.length===0)continue;let U=(0,R8.propertyInData)(J,Q,W,z.opts.ownProperties);if($.setParams({property:W,depsCount:G.length,deps:G.join(", ")}),z.allErrors)J.if(U,()=>{for(let K of G)(0,R8.checkReportMissingProp)($,K)});else J.if(zU._`${U} && (${(0,R8.checkMissingProp)($,G,Y)})`),(0,R8.reportMissingProp)($,Y),J.else()}}Rj.validatePropertyDeps=Zj;function Sj($,X=$.schema){let{gen:J,data:Q,keyword:z,it:Y}=$,W=J.name("valid");for(let G in X){if((0,oC.alwaysValidSchema)(Y,X[G]))continue;J.if((0,R8.propertyInData)(J,Q,G,Y.opts.ownProperties),()=>{let U=$.subschema({keyword:z,schemaProp:G},W);$.mergeValidEvaluated(U,W)},()=>J.var(W,!0)),$.ok(W)}}Rj.validateSchemaDeps=Sj;Rj.default=tC});var xj=x((_j)=>{Object.defineProperty(_j,"__esModule",{value:!0});var kj=s(),$k=Y$(),Xk={message:"property name must be valid",params:({params:$})=>kj._`{propertyName: ${$.propertyName}}`},Jk={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Xk,code($){let{gen:X,schema:J,data:Q,it:z}=$;if((0,$k.alwaysValidSchema)(z,J))return;let Y=X.name("valid");X.forIn("key",Q,(W)=>{$.setParams({propertyName:W}),$.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},Y),X.if((0,kj.not)(Y),()=>{if($.error(!0),!z.allErrors)X.break()})}),$.ok(Y)}};_j.default=Jk});var QU=x((Tj)=>{Object.defineProperty(Tj,"__esModule",{value:!0});var vQ=A4(),g4=s(),Qk=w6(),CQ=Y$(),Yk={message:"must NOT have additional properties",params:({params:$})=>g4._`{additionalProperty: ${$.additionalProperty}}`},Wk={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Yk,code($){let{gen:X,schema:J,parentSchema:Q,data:z,errsCount:Y,it:W}=$;if(!Y)throw Error("ajv implementation error");let{allErrors:G,opts:U}=W;if(W.props=!0,U.removeAdditional!=="all"&&(0,CQ.alwaysValidSchema)(W,J))return;let K=(0,vQ.allSchemaProperties)(Q.properties),w=(0,vQ.allSchemaProperties)(Q.patternProperties);V(),$.ok(g4._`${Y} === ${Qk.default.errors}`);function V(){X.forIn("key",z,(L)=>{if(!K.length&&!w.length)O(L);else X.if(H(L),()=>O(L))})}function H(L){let F;if(K.length>8){let Z=(0,CQ.schemaRefOrVal)(W,Q.properties,"properties");F=(0,vQ.isOwnProperty)(X,Z,L)}else if(K.length)F=(0,g4.or)(...K.map((Z)=>g4._`${L} === ${Z}`));else F=g4.nil;if(w.length)F=(0,g4.or)(F,...w.map((Z)=>g4._`${(0,vQ.usePattern)($,Z)}.test(${L})`));return(0,g4.not)(F)}function N(L){X.code(g4._`delete ${z}[${L}]`)}function O(L){if(U.removeAdditional==="all"||U.removeAdditional&&J===!1){N(L);return}if(J===!1){if($.setParams({additionalProperty:L}),$.error(),!G)X.break();return}if(typeof J=="object"&&!(0,CQ.alwaysValidSchema)(W,J)){let F=X.name("valid");if(U.removeAdditional==="failing")B(L,F,!1),X.if((0,g4.not)(F),()=>{$.reset(),N(L)});else if(B(L,F),!G)X.if((0,g4.not)(F),()=>X.break())}}function B(L,F,Z){let C={keyword:"additionalProperties",dataProp:L,dataPropType:CQ.Type.Str};if(Z===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(C,F)}}};Tj.default=Wk});var hj=x((yj)=>{Object.defineProperty(yj,"__esModule",{value:!0});var Uk=j8(),fj=A4(),YU=Y$(),gj=QU(),Kk={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:X,schema:J,parentSchema:Q,data:z,it:Y}=$;if(Y.opts.removeAdditional==="all"&&Q.additionalProperties===void 0)gj.default.code(new Uk.KeywordCxt(Y,gj.default,"additionalProperties"));let W=(0,fj.allSchemaProperties)(J);for(let V of W)Y.definedProperties.add(V);if(Y.opts.unevaluated&&W.length&&Y.props!==!0)Y.props=YU.mergeEvaluated.props(X,(0,YU.toHash)(W),Y.props);let G=W.filter((V)=>!(0,YU.alwaysValidSchema)(Y,J[V]));if(G.length===0)return;let U=X.name("valid");for(let V of G){if(K(V))w(V);else{if(X.if((0,fj.propertyInData)(X,z,V,Y.opts.ownProperties)),w(V),!Y.allErrors)X.else().var(U,!0);X.endIf()}$.it.definedProperties.add(V),$.ok(U)}function K(V){return Y.opts.useDefaults&&!Y.compositeRule&&J[V].default!==void 0}function w(V){$.subschema({keyword:"properties",schemaProp:V,dataProp:V},U)}}};yj.default=Kk});var ij=x((cj)=>{Object.defineProperty(cj,"__esModule",{value:!0});var uj=A4(),kQ=s(),lj=Y$(),mj=Y$(),Vk={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:X,schema:J,data:Q,parentSchema:z,it:Y}=$,{opts:W}=Y,G=(0,uj.allSchemaProperties)(J),U=G.filter((B)=>(0,lj.alwaysValidSchema)(Y,J[B]));if(G.length===0||U.length===G.length&&(!Y.opts.unevaluated||Y.props===!0))return;let K=W.strictSchema&&!W.allowMatchingProperties&&z.properties,w=X.name("valid");if(Y.props!==!0&&!(Y.props instanceof kQ.Name))Y.props=(0,mj.evaluatedPropsToName)(X,Y.props);let{props:V}=Y;H();function H(){for(let B of G){if(K)N(B);if(Y.allErrors)O(B);else X.var(w,!0),O(B),X.if(w)}}function N(B){for(let L in K)if(new RegExp(B).test(L))(0,lj.checkStrictMode)(Y,`property ${L} matches pattern ${B} (use allowMatchingProperties)`)}function O(B){X.forIn("key",Q,(L)=>{X.if(kQ._`${(0,uj.usePattern)($,B)}.test(${L})`,()=>{let F=U.includes(B);if(!F)$.subschema({keyword:"patternProperties",schemaProp:B,dataProp:L,dataPropType:mj.Type.Str},w);if(Y.opts.unevaluated&&V!==!0)X.assign(kQ._`${V}[${L}]`,!0);else if(!F&&!Y.allErrors)X.if((0,kQ.not)(w),()=>X.break())})})}}};cj.default=Vk});var pj=x((nj)=>{Object.defineProperty(nj,"__esModule",{value:!0});var Hk=Y$(),Ok={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:X,schema:J,it:Q}=$;if((0,Hk.alwaysValidSchema)(Q,J)){$.fail();return}let z=X.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},z),$.failResult(z,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};nj.default=Ok});var rj=x((dj)=>{Object.defineProperty(dj,"__esModule",{value:!0});var jk=A4(),Dk={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:jk.validateUnion,error:{message:"must match a schema in anyOf"}};dj.default=Dk});var tj=x((oj)=>{Object.defineProperty(oj,"__esModule",{value:!0});var _Q=s(),Lk=Y$(),Fk={message:"must match exactly one schema in oneOf",params:({params:$})=>_Q._`{passingSchemas: ${$.passing}}`},Mk={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Fk,code($){let{gen:X,schema:J,parentSchema:Q,it:z}=$;if(!Array.isArray(J))throw Error("ajv implementation error");if(z.opts.discriminator&&Q.discriminator)return;let Y=J,W=X.let("valid",!1),G=X.let("passing",null),U=X.name("_valid");$.setParams({passing:G}),X.block(K),$.result(W,()=>$.reset(),()=>$.error(!0));function K(){Y.forEach((w,V)=>{let H;if((0,Lk.alwaysValidSchema)(z,w))X.var(U,!0);else H=$.subschema({keyword:"oneOf",schemaProp:V,compositeRule:!0},U);if(V>0)X.if(_Q._`${U} && ${W}`).assign(W,!1).assign(G,_Q._`[${G}, ${V}]`).else();X.if(U,()=>{if(X.assign(W,!0),X.assign(G,V),H)$.mergeEvaluated(H,_Q.Name)})})}}};oj.default=Mk});var sj=x((aj)=>{Object.defineProperty(aj,"__esModule",{value:!0});var Ak=Y$(),bk={keyword:"allOf",schemaType:"array",code($){let{gen:X,schema:J,it:Q}=$;if(!Array.isArray(J))throw Error("ajv implementation error");let z=X.name("valid");J.forEach((Y,W)=>{if((0,Ak.alwaysValidSchema)(Q,Y))return;let G=$.subschema({keyword:"allOf",schemaProp:W},z);$.ok(z),$.mergeEvaluated(G)})}};aj.default=bk});var JD=x((XD)=>{Object.defineProperty(XD,"__esModule",{value:!0});var xQ=s(),$D=Y$(),Zk={message:({params:$})=>xQ.str`must match "${$.ifClause}" schema`,params:({params:$})=>xQ._`{failingKeyword: ${$.ifClause}}`},Sk={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Zk,code($){let{gen:X,parentSchema:J,it:Q}=$;if(J.then===void 0&&J.else===void 0)(0,$D.checkStrictMode)(Q,'"if" without "then" and "else" is ignored');let z=ej(Q,"then"),Y=ej(Q,"else");if(!z&&!Y)return;let W=X.let("valid",!0),G=X.name("_valid");if(U(),$.reset(),z&&Y){let w=X.let("ifClause");$.setParams({ifClause:w}),X.if(G,K("then",w),K("else",w))}else if(z)X.if(G,K("then"));else X.if((0,xQ.not)(G),K("else"));$.pass(W,()=>$.error(!0));function U(){let w=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},G);$.mergeEvaluated(w)}function K(w,V){return()=>{let H=$.subschema({keyword:w},G);if(X.assign(W,G),$.mergeValidEvaluated(H,W),V)X.assign(V,xQ._`${w}`);else $.setParams({ifClause:w})}}}};function ej($,X){let J=$.schema[X];return J!==void 0&&!(0,$D.alwaysValidSchema)($,J)}XD.default=Sk});var QD=x((zD)=>{Object.defineProperty(zD,"__esModule",{value:!0});var Ek=Y$(),vk={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:X,it:J}){if(X.if===void 0)(0,Ek.checkStrictMode)(J,`"${$}" without "if" is ignored`)}};zD.default=vk});var WD=x((YD)=>{Object.defineProperty(YD,"__esModule",{value:!0});var kk=XU(),_k=Fj(),xk=JU(),Tk=Aj(),fk=Pj(),gk=Cj(),yk=xj(),hk=QU(),uk=hj(),lk=ij(),mk=pj(),ck=rj(),ik=tj(),nk=sj(),pk=JD(),dk=QD();function rk($=!1){let X=[mk.default,ck.default,ik.default,nk.default,pk.default,dk.default,yk.default,hk.default,gk.default,uk.default,lk.default];if($)X.push(_k.default,Tk.default);else X.push(kk.default,xk.default);return X.push(fk.default),X}YD.default=rk});var UD=x((GD)=>{Object.defineProperty(GD,"__esModule",{value:!0});var E$=s(),tk={message:({schemaCode:$})=>E$.str`must match format "${$}"`,params:({schemaCode:$})=>E$._`{format: ${$}}`},ak={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:tk,code($,X){let{gen:J,data:Q,$data:z,schema:Y,schemaCode:W,it:G}=$,{opts:U,errSchemaPath:K,schemaEnv:w,self:V}=G;if(!U.validateFormats)return;if(z)H();else N();function H(){let O=J.scopeValue("formats",{ref:V.formats,code:U.code.formats}),B=J.const("fDef",E$._`${O}[${W}]`),L=J.let("fType"),F=J.let("format");J.if(E$._`typeof ${B} == "object" && !(${B} instanceof RegExp)`,()=>J.assign(L,E$._`${B}.type || "string"`).assign(F,E$._`${B}.validate`),()=>J.assign(L,E$._`"string"`).assign(F,B)),$.fail$data((0,E$.or)(Z(),C()));function Z(){if(U.strictSchema===!1)return E$.nil;return E$._`${W} && !${F}`}function C(){let m=w.$async?E$._`(${B}.async ? await ${F}(${Q}) : ${F}(${Q}))`:E$._`${F}(${Q})`,c=E$._`(typeof ${F} == "function" ? ${m} : ${F}.test(${Q}))`;return E$._`${F} && ${F} !== true && ${L} === ${X} && !${c}`}}function N(){let O=V.formats[Y];if(!O){Z();return}if(O===!0)return;let[B,L,F]=C(O);if(B===X)$.pass(m());function Z(){if(U.strictSchema===!1){V.logger.warn(c());return}throw Error(c());function c(){return`unknown format "${Y}" ignored in schema at path "${K}"`}}function C(c){let v$=c instanceof RegExp?(0,E$.regexpCode)(c):U.code.formats?E$._`${U.code.formats}${(0,E$.getProperty)(Y)}`:void 0,H4=J.scopeValue("formats",{key:Y,ref:c,code:v$});if(typeof c=="object"&&!(c instanceof RegExp))return[c.type||"string",c.validate,E$._`${H4}.validate`];return["string",c,H4]}function m(){if(typeof O=="object"&&!(O instanceof RegExp)&&O.async){if(!w.$async)throw Error("async format in sync schema");return E$._`await ${F}(${Q})`}return typeof L=="function"?E$._`${F}(${Q})`:E$._`${F}.test(${Q})`}}}};GD.default=ak});var wD=x((KD)=>{Object.defineProperty(KD,"__esModule",{value:!0});var ek=UD(),$_=[ek.default];KD.default=$_});var HD=x((VD)=>{Object.defineProperty(VD,"__esModule",{value:!0});VD.contentVocabulary=VD.metadataVocabulary=void 0;VD.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];VD.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var jD=x((BD)=>{Object.defineProperty(BD,"__esModule",{value:!0});var z_=yB(),Q_=Vj(),Y_=WD(),W_=wD(),OD=HD(),G_=[z_.default,Q_.default,(0,Y_.default)(),W_.default,OD.metadataVocabulary,OD.contentVocabulary];BD.default=G_});var FD=x((qD)=>{Object.defineProperty(qD,"__esModule",{value:!0});qD.DiscrError=void 0;var DD;(function($){$.Tag="tag",$.Mapping="mapping"})(DD||(qD.DiscrError=DD={}))});var AD=x((ID)=>{Object.defineProperty(ID,"__esModule",{value:!0});var x0=s(),WU=FD(),MD=DQ(),K_=D8(),w_=Y$(),V_={message:({params:{discrError:$,tagName:X}})=>$===WU.DiscrError.Tag?`tag "${X}" must be string`:`value of tag "${X}" must be in oneOf`,params:({params:{discrError:$,tag:X,tagName:J}})=>x0._`{error: ${$}, tag: ${J}, tagValue: ${X}}`},N_={keyword:"discriminator",type:"object",schemaType:"object",error:V_,code($){let{gen:X,data:J,schema:Q,parentSchema:z,it:Y}=$,{oneOf:W}=z;if(!Y.opts.discriminator)throw Error("discriminator: requires discriminator option");let G=Q.propertyName;if(typeof G!="string")throw Error("discriminator: requires propertyName");if(Q.mapping)throw Error("discriminator: mapping is not supported");if(!W)throw Error("discriminator: requires oneOf keyword");let U=X.let("valid",!1),K=X.const("tag",x0._`${J}${(0,x0.getProperty)(G)}`);X.if(x0._`typeof ${K} == "string"`,()=>w(),()=>$.error(!1,{discrError:WU.DiscrError.Tag,tag:K,tagName:G})),$.ok(U);function w(){let N=H();X.if(!1);for(let O in N)X.elseIf(x0._`${K} === ${O}`),X.assign(U,V(N[O]));X.else(),$.error(!1,{discrError:WU.DiscrError.Mapping,tag:K,tagName:G}),X.endIf()}function V(N){let O=X.name("valid"),B=$.subschema({keyword:"oneOf",schemaProp:N},O);return $.mergeEvaluated(B,x0.Name),O}function H(){var N;let O={},B=F(z),L=!0;for(let m=0;m<W.length;m++){let c=W[m];if((c===null||c===void 0?void 0:c.$ref)&&!(0,w_.schemaHasRulesButRef)(c,Y.self.RULES)){let H4=c.$ref;if(c=MD.resolveRef.call(Y.self,Y.schemaEnv.root,Y.baseId,H4),c instanceof MD.SchemaEnv)c=c.schema;if(c===void 0)throw new K_.default(Y.opts.uriResolver,Y.baseId,H4)}let v$=(N=c===null||c===void 0?void 0:c.properties)===null||N===void 0?void 0:N[G];if(typeof v$!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${G}"`);L=L&&(B||F(c)),Z(v$,m)}if(!L)throw Error(`discriminator: "${G}" must be required`);return O;function F({required:m}){return Array.isArray(m)&&m.includes(G)}function Z(m,c){if(m.const)C(m.const,c);else if(m.enum)for(let v$ of m.enum)C(v$,c);else throw Error(`discriminator: "properties/${G}" must have "const" or "enum"`)}function C(m,c){if(typeof m!="string"||m in O)throw Error(`discriminator: "${G}" values must be unique strings`);O[m]=c}}}};ID.default=N_});var bD=x((da,O_)=>{O_.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var UU=x((Q4,GU)=>{Object.defineProperty(Q4,"__esModule",{value:!0});Q4.MissingRefError=Q4.ValidationError=Q4.CodeGen=Q4.Name=Q4.nil=Q4.stringify=Q4.str=Q4._=Q4.KeywordCxt=Q4.Ajv=void 0;var B_=RB(),j_=jD(),D_=AD(),PD=bD(),q_=["/properties"],TQ="http://json-schema.org/draft-07/schema";class E8 extends B_.default{_addVocabularies(){if(super._addVocabularies(),j_.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(D_.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(PD,q_):PD;this.addMetaSchema($,TQ,!1),this.refs["http://json-schema.org/schema"]=TQ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(TQ)?TQ:void 0)}}Q4.Ajv=E8;GU.exports=Q4=E8;GU.exports.Ajv=E8;Object.defineProperty(Q4,"__esModule",{value:!0});Q4.default=E8;var L_=j8();Object.defineProperty(Q4,"KeywordCxt",{enumerable:!0,get:function(){return L_.KeywordCxt}});var T0=s();Object.defineProperty(Q4,"_",{enumerable:!0,get:function(){return T0._}});Object.defineProperty(Q4,"str",{enumerable:!0,get:function(){return T0.str}});Object.defineProperty(Q4,"stringify",{enumerable:!0,get:function(){return T0.stringify}});Object.defineProperty(Q4,"nil",{enumerable:!0,get:function(){return T0.nil}});Object.defineProperty(Q4,"Name",{enumerable:!0,get:function(){return T0.Name}});Object.defineProperty(Q4,"CodeGen",{enumerable:!0,get:function(){return T0.CodeGen}});var F_=BQ();Object.defineProperty(Q4,"ValidationError",{enumerable:!0,get:function(){return F_.default}});var M_=D8();Object.defineProperty(Q4,"MissingRefError",{enumerable:!0,get:function(){return M_.default}})});var TD=x((_D)=>{Object.defineProperty(_D,"__esModule",{value:!0});_D.formatNames=_D.fastFormats=_D.fullFormats=void 0;function n4($,X){return{validate:$,compare:X}}_D.fullFormats={date:n4(ED,NU),time:n4(wU(!0),HU),"date-time":n4(ZD(!0),CD),"iso-time":n4(wU(),vD),"iso-date-time":n4(ZD(),kD),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:E_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:f_,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:v_,int32:{type:"number",validate:__},int64:{type:"number",validate:x_},float:{type:"number",validate:RD},double:{type:"number",validate:RD},password:!0,binary:!0};_D.fastFormats={..._D.fullFormats,date:n4(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,NU),time:n4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,HU),"date-time":n4(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,CD),"iso-time":n4(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,vD),"iso-date-time":n4(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,kD),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};_D.formatNames=Object.keys(_D.fullFormats);function b_($){return $%4===0&&($%100!==0||$%400===0)}var P_=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Z_=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ED($){let X=P_.exec($);if(!X)return!1;let J=+X[1],Q=+X[2],z=+X[3];return Q>=1&&Q<=12&&z>=1&&z<=(Q===2&&b_(J)?29:Z_[Q])}function NU($,X){if(!($&&X))return;if($>X)return 1;if($<X)return-1;return 0}var KU=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function wU($){return function(J){let Q=KU.exec(J);if(!Q)return!1;let z=+Q[1],Y=+Q[2],W=+Q[3],G=Q[4],U=Q[5]==="-"?-1:1,K=+(Q[6]||0),w=+(Q[7]||0);if(K>23||w>59||$&&!G)return!1;if(z<=23&&Y<=59&&W<60)return!0;let V=Y-w*U,H=z-K*U-(V<0?1:0);return(H===23||H===-1)&&(V===59||V===-1)&&W<61}}function HU($,X){if(!($&&X))return;let J=new Date("2020-01-01T"+$).valueOf(),Q=new Date("2020-01-01T"+X).valueOf();if(!(J&&Q))return;return J-Q}function vD($,X){if(!($&&X))return;let J=KU.exec($),Q=KU.exec(X);if(!(J&&Q))return;if($=J[1]+J[2]+J[3],X=Q[1]+Q[2]+Q[3],$>X)return 1;if($<X)return-1;return 0}var VU=/t|\s/i;function ZD($){let X=wU($);return function(Q){let z=Q.split(VU);return z.length===2&&ED(z[0])&&X(z[1])}}function CD($,X){if(!($&&X))return;let J=new Date($).valueOf(),Q=new Date(X).valueOf();if(!(J&&Q))return;return J-Q}function kD($,X){if(!($&&X))return;let[J,Q]=$.split(VU),[z,Y]=X.split(VU),W=NU(J,z);if(W===void 0)return;return W||HU(Q,Y)}var S_=/\/|:/,R_=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function E_($){return S_.test($)&&R_.test($)}var SD=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function v_($){return SD.lastIndex=0,SD.test($)}var C_=-2147483648,k_=2147483647;function __($){return Number.isInteger($)&&$<=k_&&$>=C_}function x_($){return Number.isInteger($)}function RD(){return!0}var T_=/[^\\]\\Z/;function f_($){if(T_.test($))return!1;try{return new RegExp($),!0}catch(X){return!1}}});var gD=x((fD)=>{Object.defineProperty(fD,"__esModule",{value:!0});fD.formatLimitDefinition=void 0;var y_=UU(),y4=s(),l6=y4.operators,fQ={formatMaximum:{okStr:"<=",ok:l6.LTE,fail:l6.GT},formatMinimum:{okStr:">=",ok:l6.GTE,fail:l6.LT},formatExclusiveMaximum:{okStr:"<",ok:l6.LT,fail:l6.GTE},formatExclusiveMinimum:{okStr:">",ok:l6.GT,fail:l6.LTE}},h_={message:({keyword:$,schemaCode:X})=>y4.str`should be ${fQ[$].okStr} ${X}`,params:({keyword:$,schemaCode:X})=>y4._`{comparison: ${fQ[$].okStr}, limit: ${X}}`};fD.formatLimitDefinition={keyword:Object.keys(fQ),type:"string",schemaType:"string",$data:!0,error:h_,code($){let{gen:X,data:J,schemaCode:Q,keyword:z,it:Y}=$,{opts:W,self:G}=Y;if(!W.validateFormats)return;let U=new y_.KeywordCxt(Y,G.RULES.all.format.definition,"format");if(U.$data)K();else w();function K(){let H=X.scopeValue("formats",{ref:G.formats,code:W.code.formats}),N=X.const("fmt",y4._`${H}[${U.schemaCode}]`);$.fail$data((0,y4.or)(y4._`typeof ${N} != "object"`,y4._`${N} instanceof RegExp`,y4._`typeof ${N}.compare != "function"`,V(N)))}function w(){let H=U.schema,N=G.formats[H];if(!N||N===!0)return;if(typeof N!="object"||N instanceof RegExp||typeof N.compare!="function")throw Error(`"${z}": format "${H}" does not define "compare" function`);let O=X.scopeValue("formats",{key:H,ref:N,code:W.code.formats?y4._`${W.code.formats}${(0,y4.getProperty)(H)}`:void 0});$.fail$data(V(O))}function V(H){return y4._`${H}.compare(${J}, ${Q}) ${fQ[z].fail} 0`}},dependencies:["format"]};var u_=($)=>{return $.addKeyword(fD.formatLimitDefinition),$};fD.default=u_});var lD=x((v8,uD)=>{Object.defineProperty(v8,"__esModule",{value:!0});var f0=TD(),m_=gD(),jU=s(),yD=new jU.Name("fullFormats"),c_=new jU.Name("fastFormats"),DU=($,X={keywords:!0})=>{if(Array.isArray(X))return hD($,X,f0.fullFormats,yD),$;let[J,Q]=X.mode==="fast"?[f0.fastFormats,c_]:[f0.fullFormats,yD],z=X.formats||f0.formatNames;if(hD($,z,J,Q),X.keywords)(0,m_.default)($);return $};DU.get=($,X="full")=>{let Q=(X==="fast"?f0.fastFormats:f0.fullFormats)[$];if(!Q)throw Error(`Unknown format "${$}"`);return Q};function hD($,X,J,Q){var z,Y;(z=(Y=$.opts.code).formats)!==null&&z!==void 0||(Y.formats=jU._`require("ajv-formats/dist/formats").${Q}`);for(let W of X)$.addFormat(W,J[W])}uD.exports=v8=DU;Object.defineProperty(v8,"__esModule",{value:!0});v8.default=DU});class i6 extends Error{}var{closeSync:$c,writeFileSync:Xc,fsyncSync:Jc,openSync:zc}=(()=>({}));function Hq(){this.__data__=[],this.size=0}var EU=Hq;function Oq($,X){return $===X||$!==$&&X!==X}var vU=Oq;function Bq($,X){var J=$.length;while(J--)if(vU($[J][0],X))return J;return-1}var O6=Bq;var jq=Array.prototype,Dq=jq.splice;function qq($){var X=this.__data__,J=O6(X,$);if(J<0)return!1;var Q=X.length-1;if(J==Q)X.pop();else Dq.call(X,J,1);return--this.size,!0}var CU=qq;function Lq($){var X=this.__data__,J=O6(X,$);return J<0?void 0:X[J][1]}var kU=Lq;function Fq($){return O6(this.__data__,$)>-1}var _U=Fq;function Mq($,X){var J=this.__data__,Q=O6(J,$);if(Q<0)++this.size,J.push([$,X]);else J[Q][1]=X;return this}var xU=Mq;function Z1($){var X=-1,J=$==null?0:$.length;this.clear();while(++X<J){var Q=$[X];this.set(Q[0],Q[1])}}Z1.prototype.clear=EU;Z1.prototype.delete=CU;Z1.prototype.get=kU;Z1.prototype.has=_U;Z1.prototype.set=xU;var TU=Z1;var Iq=typeof global=="object"&&global&&global.Object===Object&&global,fU=Iq;var Aq=typeof self=="object"&&self&&self.Object===Object&&self,bq=fU||Aq||Function("return this")(),S1=bq;var Pq=S1.Symbol,R1=Pq;var gU=Object.prototype,Zq=gU.hasOwnProperty,Sq=gU.toString,y0=R1?R1.toStringTag:void 0;function Rq($){var X=Zq.call($,y0),J=$[y0];try{$[y0]=void 0;var Q=!0}catch(Y){}var z=Sq.call($);if(Q)if(X)$[y0]=J;else delete $[y0];return z}var yU=Rq;var Eq=Object.prototype,vq=Eq.toString;function Cq($){return vq.call($)}var hU=Cq;var kq="[object Null]",_q="[object Undefined]",uU=R1?R1.toStringTag:void 0;function xq($){if($==null)return $===void 0?_q:kq;return uU&&uU in Object($)?yU($):hU($)}var lU=xq;function Tq($){var X=typeof $;return $!=null&&(X=="object"||X=="function")}var k8=Tq;var fq="[object AsyncFunction]",gq="[object Function]",yq="[object GeneratorFunction]",hq="[object Proxy]";function uq($){if(!k8($))return!1;var X=lU($);return X==gq||X==yq||X==fq||X==hq}var mU=uq;var lq=S1["__core-js_shared__"],_8=lq;var cU=function(){var $=/[^.]+$/.exec(_8&&_8.keys&&_8.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}();function mq($){return!!cU&&cU in $}var iU=mq;var cq=Function.prototype,iq=cq.toString;function nq($){if($!=null){try{return iq.call($)}catch(X){}try{return $+""}catch(X){}}return""}var nU=nq;var pq=/[\\^$.*+?()[\]{}|]/g,dq=/^\[object .+?Constructor\]$/,rq=Function.prototype,oq=Object.prototype,tq=rq.toString,aq=oq.hasOwnProperty,sq=RegExp("^"+tq.call(aq).replace(pq,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function eq($){if(!k8($)||iU($))return!1;var X=mU($)?sq:dq;return X.test(nU($))}var pU=eq;function $L($,X){return $==null?void 0:$[X]}var dU=$L;function XL($,X){var J=dU($,X);return pU(J)?J:void 0}var x8=XL;var JL=x8(S1,"Map"),rU=JL;var zL=x8(Object,"create"),p4=zL;function QL(){this.__data__=p4?p4(null):{},this.size=0}var oU=QL;function YL($){var X=this.has($)&&delete this.__data__[$];return this.size-=X?1:0,X}var tU=YL;var WL="__lodash_hash_undefined__",GL=Object.prototype,UL=GL.hasOwnProperty;function KL($){var X=this.__data__;if(p4){var J=X[$];return J===WL?void 0:J}return UL.call(X,$)?X[$]:void 0}var aU=KL;var wL=Object.prototype,VL=wL.hasOwnProperty;function NL($){var X=this.__data__;return p4?X[$]!==void 0:VL.call(X,$)}var sU=NL;var HL="__lodash_hash_undefined__";function OL($,X){var J=this.__data__;return this.size+=this.has($)?0:1,J[$]=p4&&X===void 0?HL:X,this}var eU=OL;function E1($){var X=-1,J=$==null?0:$.length;this.clear();while(++X<J){var Q=$[X];this.set(Q[0],Q[1])}}E1.prototype.clear=oU;E1.prototype.delete=tU;E1.prototype.get=aU;E1.prototype.has=sU;E1.prototype.set=eU;var uQ=E1;function BL(){this.size=0,this.__data__={hash:new uQ,map:new(rU||TU),string:new uQ}}var $K=BL;function jL($){var X=typeof $;return X=="string"||X=="number"||X=="symbol"||X=="boolean"?$!=="__proto__":$===null}var XK=jL;function DL($,X){var J=$.__data__;return XK(X)?J[typeof X=="string"?"string":"hash"]:J.map}var B6=DL;function qL($){var X=B6(this,$).delete($);return this.size-=X?1:0,X}var JK=qL;function LL($){return B6(this,$).get($)}var zK=LL;function FL($){return B6(this,$).has($)}var QK=FL;function ML($,X){var J=B6(this,$),Q=J.size;return J.set($,X),this.size+=J.size==Q?0:1,this}var YK=ML;function v1($){var X=-1,J=$==null?0:$.length;this.clear();while(++X<J){var Q=$[X];this.set(Q[0],Q[1])}}v1.prototype.clear=$K;v1.prototype.delete=JK;v1.prototype.get=zK;v1.prototype.has=QK;v1.prototype.set=YK;var lQ=v1;var{realpathSync:UK}=(()=>({}));var IL="Expected a function";function mQ($,X){if(typeof $!="function"||X!=null&&typeof X!="function")throw TypeError(IL);var J=function(){var Q=arguments,z=X?X.apply(this,Q):Q[0],Y=J.cache;if(Y.has(z))return Y.get(z);var W=$.apply(this,Q);return J.cache=Y.set(z,W)||Y,W};return J.cache=new(mQ.Cache||lQ),J}mQ.Cache=lQ;var O4=mQ;var WK=function(){return"/"};var h0=()=>globalThis.crypto.randomUUID();function n6($){if(!$)return!1;if(typeof $==="boolean")return $;let X=String($).toLowerCase().trim();return["1","true","yes","on"].includes(X)}function j6(){let $=new Set;return{subscribe(X){return $.add(X),()=>{$.delete(X)}},emit(...X){let J;for(let Q of $)try{Q(...X)}catch(z){(J??=[]).push(z)}if(J)throw J.length===1?J[0]:AggregateError(J,"Signal listener(s) threw")},clear(){$.clear()}}}function GK(){return{sent:new Set,rejected:new Set}}var bL={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};function PL(){let $="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof UK==="function"){let J=WK();try{$=UK(J).normalize("NFC")}catch{$=J.normalize("NFC")}}return{originalCwd:$,projectRoot:$,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:$,modelUsage:{},mainLoopModelOverride:void 0,refusalFallbackPreviousTurn:!1,replConfigArgv:[],initialMainLoopModel:void 0,modelStrings:null,isInteractive:!1,attacherCaps:null,hasStreamingInput:!1,modelOverrideOptOutForSession:!1,kairosActive:!1,rendererMode:void 0,strictToolResultPairing:!1,memoryToggledOff:!1,teamMemoryServerStatus:void 0,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,clientType:"cli",sessionSource:void 0,sessionStartType:"fresh",questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,oauthScopesFromFd:void 0,apiKeyFromFd:void 0,gatewayAuth:null,gatewayRefreshInFlight:null,flagSettingsPath:void 0,flagSettingsExpectedContent:void 0,flagSettingsInline:null,parentManagedSettings:null,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:h0(),parentSessionId:void 0,loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,cachedTelemetryResource:null,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastCancelledAPIMessageId:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],inlinePluginUrls:[],chromeFlagOverride:void 0,useCoworkPlugins:!1,disableSlashCommands:!1,sessionBypassPermissionsMode:!1,scheduledTasksEnabled:!1,sessionPrResolved:!1,sessionCronTasks:[],loopChainStartedAt:Object.create(null),sessionCreatedTeams:new Set,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,sdkOAuthTokenRefreshCallback:null,hostAuthTokenRefreshCallback:null,mainThreadAgentType:void 0,mainThreadAgentHooks:void 0,sessionSkillAllowlist:void 0,caps:bL,replBridgeActive:!1,directConnectServerUrl:void 0,mcpConnectNonBlocking:!1,strictMcpConfig:!1,activeRoutine:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],allowedChannels:[],activeInputs:new Map,hasDevChannels:!1,sessionProjectDir:null,promptCache1hAllowlist:null,stickyBetas:GK(),thinkingTypeOverrides:new Map,inferenceProfileBackingModels:new Map,promptId:null,promptIndex:0,lastMainRequestId:void 0,lastMainThreadCacheTtlMs:null,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}var ZL=PL(),SL=()=>{return};function cQ(){return SL()?.sessionId??ZL.sessionId}var RL=j6(),Af=RL.subscribe;var EL=j6(),bf=EL.subscribe;var vL=j6(),Pf=vL.subscribe;var CL=j6();var Zf=CL.subscribe;var kL=j6();var Sf=kL.subscribe;var{appendFile:fw,mkdir:zM,rename:gw,stat:QM,symlink:YM,unlink:_Y}=(()=>({}));P4();function DK({writeFn:$,flushIntervalMs:X=1000,maxBufferSize:J=100,maxBufferBytes:Q=1/0,immediateMode:z=!1}){let Y=[],W=0,G=null,U=null;function K(){if(G)clearTimeout(G),G=null}function w(O){try{$(O)}catch{}}function V(){if(U)w(U.join("")),U=null;if(Y.length===0)return;w(Y.join("")),Y=[],W=0,K()}function H(){if(!G)G=setTimeout(V,X)}function N(){if(U){U.push(...Y),Y=[],W=0,K();return}let O=Y;Y=[],W=0,K(),U=O,setImmediate(()=>{let B=U;if(U=null,B)w(B.join(""))})}return{write(O){if(z){w(O);return}if(Y.push(O),W+=O.length,H(),Y.length>=J||W>=Q)N()},flush:V,dispose(){V()}}}function TL($){if(typeof $==="function")return $;if(Symbol.asyncDispose in $)return()=>$[Symbol.asyncDispose]();return()=>$[Symbol.dispose]()}class qK{#$=new Set;register($){let X=TL($);this.#$.add(X);let J=()=>{this.#$.delete(X)};return Object.assign(J,{[Symbol.dispose]:J})}async drain(){let $=Array.from(this.#$);this.#$.clear(),await Promise.all($.map(async(X)=>X()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#$.size}}var fL=new qK;function LK($){return fL.register($)}var FK=O4(($)=>{if(!$||$.trim()==="")return null;let X=$.split(",").map((Y)=>Y.trim()).filter(Boolean);if(X.length===0)return null;let J=X.some((Y)=>Y.startsWith("!")),Q=X.some((Y)=>!Y.startsWith("!"));if(J&&Q)return null;let z=X.map((Y)=>Y.replace(/^!/,"").toLowerCase());return{include:J?[]:z,exclude:J?z:[],isExclusive:J}});function gL($){let X=[],J=$.match(/^MCP server ["']([^"']+)["']/);if(J&&J[1])X.push("mcp"),X.push(J[1].toLowerCase());else{let Y=$.match(/^([^:[]+):/);if(Y&&Y[1])X.push(Y[1].trim().toLowerCase())}let Q=$.match(/^\[([^\]]+)]/);if(Q&&Q[1])X.push(Q[1].trim().toLowerCase());if($.toLowerCase().includes("1p event:"))X.push("1p");let z=$.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(z&&z[1]){let Y=z[1].trim().toLowerCase();if(Y.length<30&&!Y.includes(" "))X.push(Y)}return Array.from(new Set(X))}function yL($,X){if(!X)return!0;if($.length===0)return!1;if(X.isExclusive)return!$.some((J)=>X.exclude.includes(J));else return $.some((J)=>X.include.includes(J))}function MK($,X){if(!X)return!0;let J=gL($);return yL(J,X)}var rQ=function(){return"/"};P4();var IK=O4(()=>{return(process.env.CLAUDE_CONFIG_DIR??u4(rQ(),".claude")).normalize("NFC")},()=>process.env.CLAUDE_CONFIG_DIR);var yf=O4(()=>n6(process.env.CLAUDE_CODE_SUPERVISED));function k($,X,J,Q,z){if(Q==="m")throw TypeError("Private method is not writable");if(Q==="a"&&!z)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!z:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return Q==="a"?z.call($,J):z?z.value=J:X.set($,J),J}function D($,X,J,Q){if(J==="a"&&!Q)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!Q:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return J==="m"?Q:J==="a"?Q.call($):Q?Q.value:X.get($)}var oQ=function(){let{crypto:$}=globalThis;if($?.randomUUID)return oQ=$.randomUUID.bind($),$.randomUUID();let X=new Uint8Array(1),J=$?()=>$.getRandomValues(X)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(Q)=>(+Q^J()&15>>+Q/4).toString(16))};function d4($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var u0=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let X=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)X.stack=$.stack;if($.cause&&!X.cause)X.cause=$.cause;if($.name)X.name=$.name;return X}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};class T extends Error{}class k$ extends T{constructor($,X,J,Q,z){super(`${k$.makeMessage($,X,J)}`);this.status=$,this.headers=Q,this.requestID=Q?.get("request-id"),this.error=X,this.type=z??null}static makeMessage($,X,J){let Q=X?.message?typeof X.message==="string"?X.message:JSON.stringify(X.message):X?JSON.stringify(X):J;if($&&Q)return`${$} ${Q}`;if($)return`${$} status code (no body)`;if(Q)return Q;return"(no status code or body)"}static generate($,X,J,Q){if(!$||!Q)return new r6({message:J,cause:u0(X)});let z=X,Y=z?.error?.type;if($===400)return new m0($,z,J,Q,Y);if($===401)return new c0($,z,J,Q,Y);if($===403)return new i0($,z,J,Q,Y);if($===404)return new n0($,z,J,Q,Y);if($===409)return new p0($,z,J,Q,Y);if($===422)return new d0($,z,J,Q,Y);if($===429)return new r0($,z,J,Q,Y);if($>=500)return new o0($,z,J,Q,Y);return new k$($,z,J,Q,Y)}}class f$ extends k${constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}}class r6 extends k${constructor({message:$,cause:X}){super(void 0,void 0,$||"Connection error.",void 0);if(X)this.cause=X}}class l0 extends r6{constructor({message:$}={}){super({message:$??"Request timed out."})}}class m0 extends k${}class c0 extends k${}class i0 extends k${}class n0 extends k${}class p0 extends k${}class d0 extends k${}class r0 extends k${}class o0 extends k${}var uL=/^[a-z][a-z0-9+.-]*:/i,AK=($)=>{return uL.test($)},tQ=($)=>(tQ=Array.isArray,tQ($)),aQ=tQ;function T8($){if(typeof $!=="object")return{};return $??{}}function sQ($){if(!$)return!0;for(let X in $)return!1;return!0}function bK($,X){return Object.prototype.hasOwnProperty.call($,X)}var PK=($,X)=>{if(typeof X!=="number"||!Number.isInteger(X))throw new T(`${$} must be an integer`);if(X<0)throw new T(`${$} must be a positive integer`);return X};var f8=($)=>{try{return JSON.parse($)}catch(X){return}};var ZK=($)=>new Promise((X)=>setTimeout(X,$));var B4="0.94.0";var vK=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function lL(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var mL=()=>{let $=lL();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":RK(Deno.build.os),"X-Stainless-Arch":SK(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":RK(globalThis.process.platform??"unknown"),"X-Stainless-Arch":SK(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let X=cL();if(X)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${X.browser}`,"X-Stainless-Runtime-Version":X.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":B4,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function cL(){if(typeof navigator>"u"||!navigator)return null;let $=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:X,pattern:J}of $){let Q=J.exec(navigator.userAgent);if(Q){let z=Q[1]||0,Y=Q[2]||0,W=Q[3]||0;return{browser:X,version:`${z}.${Y}.${W}`}}}return null}var SK=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},RK=($)=>{if($=$.toLowerCase(),$.includes("ios"))return"iOS";if($==="android")return"Android";if($==="darwin")return"MacOS";if($==="win32")return"Windows";if($==="freebsd")return"FreeBSD";if($==="openbsd")return"OpenBSD";if($==="linux")return"Linux";if($)return`Other:${$}`;return"Unknown"},EK,t0=()=>{return EK??(EK=mL())};function CK(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function eQ(...$){let X=globalThis.ReadableStream;if(typeof X>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new X(...$)}function g8($){let X=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return eQ({start(){},async pull(J){let{done:Q,value:z}=await X.next();if(Q)J.close();else J.enqueue(z)},async cancel(){await X.return?.()}})}function a0($){if($[Symbol.asyncIterator])return $;let X=$.getReader();return{async next(){try{let J=await X.read();if(J?.done)X.releaseLock();return J}catch(J){throw X.releaseLock(),J}},async return(){let J=X.cancel();return X.releaseLock(),await J,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function kK($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let X=$.getReader(),J=X.cancel();X.releaseLock(),await J}var _K=({headers:$,body:X})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(X)}};function xK($){return Object.entries($).filter(([X,J])=>typeof J<"u").map(([X,J])=>{if(typeof J==="string"||typeof J==="number"||typeof J==="boolean")return`${encodeURIComponent(X)}=${encodeURIComponent(J)}`;if(J===null)return`${encodeURIComponent(X)}=`;throw new T(`Cannot stringify type ${typeof J}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}var fK="urn:ietf:params:oauth:grant-type:jwt-bearer",gK="refresh_token",y8="/v1/oauth/token",o6="oauth-2025-04-20",yK="oidc-federation-2026-04-01",hK=120,k1=30,uK=5,TK=1048576;function h8($){if(!$)return;let X;try{X=new URL($)}catch(Q){throw new w$(`Invalid token endpoint base URL "${$}": ${Q}`)}if(X.protocol==="https:")return;let J=X.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(X.protocol==="http:"&&(J==="localhost"||J==="127.0.0.1"||J==="::1"))return;throw new w$(`Refusing to send credential over non-https token endpoint "${$}"`)}async function u8($,X){let J=await dL($),Q;try{Q=JSON.parse(J)}catch{throw new w$(`Token endpoint returned non-JSON response (status ${$.status})`,$.status,t$(J),X)}if(!Q.access_token)throw new w$(`Token endpoint response missing access_token: ${JSON.stringify(t$(Q))}`,$.status,t$(Q),X);if(Q.token_type&&Q.token_type.toLowerCase()!=="bearer")throw new w$(`Token endpoint response: unsupported token_type "${Q.token_type}" (want Bearer)`,$.status,t$(Q),X);return Q}var $Y=2000,pL=new Set(["error","error_description","error_uri"]);function t$($){if($==null)return $;if(typeof $==="string"){let X;try{X=JSON.parse($)}catch{if($.length<=$Y)return $;return $.slice(0,$Y)+`... <${$.length-$Y} more chars>`}return JSON.stringify(t$(X))}if(typeof $==="object"&&!Array.isArray($)){let X={};for(let[J,Q]of Object.entries($))if(pL.has(J))X[J]=Q;return X}return null}async function l8($,X=(J)=>console.warn(`anthropic-sdk: ${J}`)){if(typeof process>"u"||process.platform==="win32")return;let J=await import("node:fs"),Q=$,z;try{Q=await J.promises.realpath($),z=await J.promises.stat(Q)}catch{return}let Y=z.mode&511;if(Y&18)throw new w$(`Credentials file at ${Q} is group/world-writable (mode 0o${Y.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${Q}\`.`);if(Y&36)throw new w$(`Credentials file at ${Q} is group/world-readable (mode 0o${Y.toString(8)}); run \`chmod 600 ${Q}\` before retrying.`);if(typeof process.getuid==="function"&&z.uid!==process.getuid())X(`credentials file at ${Q} is owned by uid ${z.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function m8($,X){let J=await import("node:fs"),z=(await Promise.resolve().then(() => (P4(),d6))).dirname($);await J.promises.mkdir(z,{recursive:!0,mode:448});let Y=`${$}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let W=await J.promises.open(Y,"w",384);try{await W.writeFile(JSON.stringify(X,null,2)),await W.sync()}finally{await W.close()}await J.promises.rename(Y,$)}catch(W){throw await J.promises.unlink(Y).catch(()=>{}),W}try{let W=await J.promises.open(z,"r");try{await W.sync()}finally{await W.close()}}catch{}}async function dL($){if(!$.body)return"";let X=$.body.getReader(),J=[],Q=0;for(;;){let{done:Y,value:W}=await X.read();if(Y)break;if(Q+W.length>TK){let G=TK-Q;if(G>0)J.push(W.subarray(0,G));await X.cancel();break}J.push(W),Q+=W.length}let z;if(J.length===1)z=J[0];else{z=new Uint8Array(J.reduce((W,G)=>W+G.length,0));let Y=0;for(let W of J)z.set(W,Y),Y+=W.length}return new TextDecoder("utf-8").decode(z)}class w$ extends T{constructor($,X=null,J=null,Q=null){super($);this.statusCode=X,this.body=J,this.requestId=Q}}function Z4(){return Math.floor(Date.now()/1000)}class XY{constructor($,X){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=$,this.onAdvisoryRefreshError=X}async getToken(){let $=this.nextForce;this.nextForce=!1;let X=this.cached;if($||X==null)return(await this.refresh($)).token;if(X.expiresAt==null)return X.token;let J=X.expiresAt-Z4();if(J>hK)return X.token;if(J>k1)return this.backgroundRefresh(),X.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh($=!1){if(this.pendingRefresh&&!$)return this.pendingRefresh;return this.doRefresh($)}backgroundRefresh(){if(this.pendingRefresh)return;if(Z4()-this.lastAdvisoryError<uK)return;this.doRefresh().catch(($)=>{this.lastAdvisoryError=Z4(),this.onAdvisoryRefreshError?.($)})}doRefresh($=!1){return this.pendingRefresh=this.provider($?{forceRefresh:!0}:void 0).then((X)=>{return this.cached=X,this.pendingRefresh=null,X},(X)=>{throw this.pendingRefresh=null,X}),this.pendingRefresh}}var K$=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim()||void 0;return};function cK($){let X=0;for(let z of $)X+=z.length;let J=new Uint8Array(X),Q=0;for(let z of $)J.set(z,Q),Q+=z.length;return J}var lK;function _1($){let X;return(lK??(X=new globalThis.TextEncoder,lK=X.encode.bind(X)))($)}var mK;function JY($){let X;return(mK??(X=new globalThis.TextDecoder,mK=X.decode.bind(X)))($)}var i8={off:0,error:200,warn:300,info:400,debug:500},zY=($,X,J)=>{if(!$)return;if(bK(i8,$))return $;S$(J).warn(`${X} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(i8))}`);return};function s0(){}function c8($,X,J){if(!X||i8[$]>i8[J])return s0;else return X[$].bind(X)}var rL={error:s0,warn:s0,info:s0,debug:s0},iK=new WeakMap;function S$($){let X=$.logger,J=$.logLevel??"off";if(!X)return rL;let Q=iK.get(X);if(Q&&Q[0]===J)return Q[1];let z={error:c8("error",X,J),warn:c8("warn",X,J),info:c8("info",X,J),debug:c8("debug",X,J)};return iK.set(X,[J,z]),z}var r4=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([X,J])=>[X,X.toLowerCase()==="x-api-key"||X.toLowerCase()==="authorization"||X.toLowerCase()==="cookie"||X.toLowerCase()==="set-cookie"?"***":J]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var n8="1.0",oL=/^[A-Za-z0-9_.-]+$/;function nK($){if(!$)throw Error("profile name is empty");if($==="."||$==="..")throw Error(`profile name "${$}" is not allowed`);if($.includes("/")||$.includes("\\"))throw Error(`profile name "${$}" must not contain path separators`);if(!oL.test($))throw Error(`profile name "${$}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var pK=async($)=>{var X,J;let Q=await QY();if(Q===null)return null;let z=$??await rK();if(z===null)return null;nK(z);let Y=await import("node:fs"),G=(await Promise.resolve().then(() => (P4(),d6))).join(Q,"configs",`${z}.json`),U;try{U=await Y.promises.readFile(G,"utf-8")}catch(V){if(V?.code!=="ENOENT")throw Error(`failed to read config file ${G}: ${V}`);U=null}if(U===null){let V=K$("ANTHROPIC_ORGANIZATION_ID"),H=K$("ANTHROPIC_IDENTITY_TOKEN_FILE"),N=K$("ANTHROPIC_FEDERATION_RULE_ID");if(N&&V)return{fromFile:!1,config:{organization_id:V,workspace_id:K$("ANTHROPIC_WORKSPACE_ID"),base_url:K$("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:N,service_account_id:K$("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:H?{source:"file",path:H}:void 0,scope:K$("ANTHROPIC_SCOPE")}}};return null}let K;try{K=JSON.parse(U)}catch(V){throw Error(`failed to parse config file ${G}: ${V}`)}if(!K.authentication)throw Error(`config file ${G} is missing "authentication"`);let w=K.authentication.type;if(w!=="oidc_federation"&&w!=="user_oauth")throw Error(`authentication.type "${w}" is not a known authentication type`);if(K.organization_id??(K.organization_id=K$("ANTHROPIC_ORGANIZATION_ID")),K.workspace_id??(K.workspace_id=K$("ANTHROPIC_WORKSPACE_ID")),K.base_url??(K.base_url=K$("ANTHROPIC_BASE_URL")),(X=K.authentication).scope??(X.scope=K$("ANTHROPIC_SCOPE")),K.authentication.type==="oidc_federation"){if(!K.authentication.identity_token){let V=K$("ANTHROPIC_IDENTITY_TOKEN_FILE");if(V)K.authentication.identity_token={source:"file",path:V}}if(!K.authentication.federation_rule_id)K.authentication.federation_rule_id=K$("ANTHROPIC_FEDERATION_RULE_ID")??"";(J=K.authentication).service_account_id??(J.service_account_id=K$("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:K,fromFile:!0}};var dK=async($,X)=>{if($?.authentication.credentials_path)return $.authentication.credentials_path;let J=await QY();if(!J)return null;let Q=X??await rK();if(!Q)return null;return nK(Q),(await Promise.resolve().then(() => (P4(),d6))).join(J,"credentials",`${Q}.json`)},QY=async()=>{if(!tL())return null;let $=await Promise.resolve().then(() => (P4(),d6)),X=K$("ANTHROPIC_CONFIG_DIR");if(X)return X;if(t0()["X-Stainless-OS"]==="Windows"){let Y=K$("APPDATA");if(Y)return $.join(Y,"Anthropic");let W=K$("USERPROFILE");if(W)return $.join(W,"AppData","Roaming","Anthropic");return null}let Q=K$("XDG_CONFIG_HOME");if(Q)return $.join(Q,"anthropic");let z=K$("HOME");if(z)return $.join(z,".config","anthropic");return null},tL=()=>{let $=t0()["X-Stainless-Runtime"];return $==="node"||$==="deno"},rK=async()=>{let $=await QY();if(!$)return null;let X=K$("ANTHROPIC_PROFILE");if(X)return X;let J=await import("node:fs"),z=(await Promise.resolve().then(() => (P4(),d6))).join($,"active_config");try{return(await J.promises.readFile(z,"utf-8")).trim()||"default"}catch(Y){if(Y?.code!=="ENOENT")throw Error(`failed to read ${z}: ${Y}`);return"default"}};function YY($){if(!$)throw new T("Identity token file path is empty");return async()=>{let X=await import("node:fs"),J;try{J=await X.promises.readFile($,"utf-8")}catch(z){throw new T(`Failed to read identity token file at ${$}: ${z}`)}let Q=J.trim();if(!Q)throw new T(`Identity token file at ${$} is empty`);return Q}}function oK($){if(!$)throw new T("Identity token value is empty");return()=>$}function tK($){return async()=>{h8($.baseURL);let X=await $.identityTokenProvider();if(X.length>16384)throw new w$(`Identity token is ${Math.ceil(X.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let J={grant_type:fK,assertion:X,federation_rule_id:$.federationRuleId,organization_id:$.organizationId};if($.serviceAccountId)J.service_account_id=$.serviceAccountId;if($.workspaceId)J.workspace_id=$.workspaceId;let Q=`${$.baseURL}${y8}`,z;try{z=await $.fetch(Q,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${o6},${yK}`,"User-Agent":$.userAgent||`anthropic-sdk-typescript/${B4} oidcFederationProvider`},body:JSON.stringify(J)})}catch(U){throw new w$(`Failed to reach token endpoint ${Q}: ${U}`)}let Y=z.headers.get("Request-Id");if(!z.ok){let U=await z.text().catch(()=>""),K=t$(U),w="";if(z.status===401)w=` Ensure your federation rule matches your identity token. ${$.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`;throw new w$(`Token exchange failed with status ${z.status}${Y?` (request-id ${Y})`:""}: ${K}${w}`,z.status,K,Y)}let W=await u8(z,Y),G=Number(W.expires_in);if(!Number.isFinite(G))throw new w$(`Token endpoint response missing required fields: ${JSON.stringify(t$(W))}`,z.status,t$(W),Y);return{token:W.access_token,expiresAt:Z4()+G}}}function aK($){return async(X)=>{let J=await import("node:fs");await l8($.credentialsPath,$.onSafetyWarning);let Q;try{Q=await J.promises.readFile($.credentialsPath,"utf-8")}catch(L){throw new w$(`Credentials file not found at ${$.credentialsPath}: ${L}`)}let z;try{z=JSON.parse(Q)}catch(L){throw new w$(`Credentials file at ${$.credentialsPath} is not valid JSON: ${L}`)}let Y=z.access_token;if(!Y)throw new w$(`Credentials file at ${$.credentialsPath} must include 'access_token'`);let W=z.expires_at;if(!X?.forceRefresh&&(W==null||Z4()<W-k1))return{token:Y,expiresAt:W??null};let G=z.refresh_token;if(!$.clientId||!G)throw new w$(`Access token at ${$.credentialsPath} has expired and no refresh is available (client_id ${$.clientId?"set":"empty"}, refresh_token ${G?"set":"empty"})`);h8($.baseURL);let U={grant_type:gK,refresh_token:G,client_id:$.clientId},K=`${$.baseURL}${y8}`,w;try{w=await $.fetch(K,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":o6,"User-Agent":$.userAgent||`anthropic-sdk-typescript/${B4} userOAuthProvider`},body:JSON.stringify(U)})}catch(L){throw new w$(`User OAuth refresh failed to reach token endpoint: ${L}`)}let V=w.headers.get("Request-Id");if(!w.ok){let L=await w.text().catch(()=>"");throw new w$(`User OAuth refresh failed (HTTP ${w.status}): ${t$(L)}`,w.status,t$(L),V)}let H=await u8(w,V),N=Number(H.expires_in);if(!Number.isFinite(N))throw new w$(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(t$(H))}`,w.status,t$(H),V);let O=Z4()+N,B=H.refresh_token||G;return await m8($.credentialsPath,{...z,version:n8,type:"oauth_token",access_token:H.access_token,expires_at:O,refresh_token:B}),{token:H.access_token,expiresAt:O}}}function WY($,X){let J=$.authentication.credentials_path??null,Q=($.base_url||X.baseURL).replace(/\/+$/,""),z=aL($,J,Q,X),Y={};if($.workspace_id&&$.authentication.type==="user_oauth")Y["anthropic-workspace-id"]=$.workspace_id;return{provider:z,extraHeaders:Y,baseURL:$.base_url||void 0}}async function sK($,X){let J=await pK(X);if(!J)return null;let{config:Q,fromFile:z}=J,Y=Q.authentication.credentials_path||!z?Q:{...Q,authentication:{...Q.authentication,credentials_path:await dK(Q,X)??void 0}};return WY(Y,$)}function aL($,X,J,Q){switch($.authentication.type){case"oidc_federation":{let z=$.authentication,Y=sL(z);if(!Y)throw new w$("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!z.federation_rule_id)throw new w$("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!$.organization_id)throw new w$("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let W=tK({identityTokenProvider:Y,federationRuleId:z.federation_rule_id,organizationId:$.organization_id,serviceAccountId:z.service_account_id,workspaceId:$.workspace_id,baseURL:J,fetch:Q.fetch,userAgent:Q.userAgent});if(X)return eL(W,X,Q.onCacheWriteError,Q.onSafetyWarning);return W}case"user_oauth":{if(!X)throw new w$("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return aK({credentialsPath:X,clientId:$.authentication.client_id,baseURL:J,fetch:Q.fetch,userAgent:Q.userAgent,onSafetyWarning:Q.onSafetyWarning})}default:{let z=$.authentication.type;throw new w$(`authentication.type "${z}" is not a known authentication type`)}}}function sL($){if($.identity_token){let Q=$.identity_token.source;if(Q!=="file")throw new w$(`identity_token.source "${Q}" is not supported by this SDK version (only "file")`);if(!$.identity_token.path)throw new w$('identity_token.source "file" requires a non-empty path');return YY($.identity_token.path)}let X=K$("ANTHROPIC_IDENTITY_TOKEN_FILE");if(X)return YY(X);let J=K$("ANTHROPIC_IDENTITY_TOKEN");if(J)return oK(J);return null}function eL($,X,J,Q){return async(z)=>{let Y=await import("node:fs");await l8(X,Q);let W;try{let U=await Y.promises.readFile(X,"utf-8");W=JSON.parse(U);let K=W?.access_token;if(K&&!z?.forceRefresh){let w=W?.expires_at;if(w==null||Z4()<w-k1)return{token:K,expiresAt:w??null}}}catch(U){if(U?.code!=="ENOENT"&&!(U instanceof SyntaxError))J?.(U)}let G=await $(z);try{await m8(X,{...W??{},version:n8,type:"oauth_token",access_token:G.token,expires_at:G.expiresAt})}catch(U){J?.(U)}return G}}var Y4,W4;class D6{constructor(){Y4.set(this,void 0),W4.set(this,void 0),k(this,Y4,new Uint8Array,"f"),k(this,W4,null,"f")}decode($){if($==null)return[];let X=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?_1($):$;k(this,Y4,cK([D(this,Y4,"f"),X]),"f");let J=[],Q;while((Q=$F(D(this,Y4,"f"),D(this,W4,"f")))!=null){if(Q.carriage&&D(this,W4,"f")==null){k(this,W4,Q.index,"f");continue}if(D(this,W4,"f")!=null&&(Q.index!==D(this,W4,"f")+1||Q.carriage)){J.push(JY(D(this,Y4,"f").subarray(0,D(this,W4,"f")-1))),k(this,Y4,D(this,Y4,"f").subarray(D(this,W4,"f")),"f"),k(this,W4,null,"f");continue}let z=D(this,W4,"f")!==null?Q.preceding-1:Q.preceding,Y=JY(D(this,Y4,"f").subarray(0,z));J.push(Y),k(this,Y4,D(this,Y4,"f").subarray(Q.index),"f"),k(this,W4,null,"f")}return J}flush(){if(!D(this,Y4,"f").length)return[];return this.decode(`
|
|
12
12
|
`)}}Y4=new WeakMap,W4=new WeakMap;D6.NEWLINE_CHARS=new Set([`
|
|
13
13
|
`,"\r"]);D6.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function $F($,X){for(let z=X??0;z<$.length;z++){if($[z]===10)return{preceding:z,index:z+1,carriage:!1};if($[z]===13)return{preceding:z,index:z+1,carriage:!0}}return null}function eK($){for(let Q=0;Q<$.length-1;Q++){if($[Q]===10&&$[Q+1]===10)return Q+2;if($[Q]===13&&$[Q+1]===13)return Q+2;if($[Q]===13&&$[Q+1]===10&&Q+3<$.length&&$[Q+2]===13&&$[Q+3]===10)return Q+4}return-1}var e0;class G4{constructor($,X,J){this.iterator=$,e0.set(this,void 0),this.controller=X,k(this,e0,J,"f")}static fromSSEResponse($,X,J){let Q=!1,z=J?S$(J):console;async function*Y(){if(Q)throw new T("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Q=!0;let W=!1;try{for await(let G of XF($,X)){if(G.event==="completion")try{yield JSON.parse(G.data)}catch(U){throw z.error("Could not parse message into JSON:",G.data),z.error("From chunk:",G.raw),U}if(G.event==="message_start"||G.event==="message_delta"||G.event==="message_stop"||G.event==="content_block_start"||G.event==="content_block_delta"||G.event==="content_block_stop"||G.event==="message"||G.event==="user.message"||G.event==="user.interrupt"||G.event==="user.tool_confirmation"||G.event==="user.custom_tool_result"||G.event==="agent.message"||G.event==="agent.thinking"||G.event==="agent.tool_use"||G.event==="agent.tool_result"||G.event==="agent.mcp_tool_use"||G.event==="agent.mcp_tool_result"||G.event==="agent.custom_tool_use"||G.event==="agent.thread_context_compacted"||G.event==="session.status_running"||G.event==="session.status_idle"||G.event==="session.status_rescheduled"||G.event==="session.status_terminated"||G.event==="session.error"||G.event==="session.deleted"||G.event==="span.model_request_start"||G.event==="span.model_request_end")try{yield JSON.parse(G.data)}catch(U){throw z.error("Could not parse message into JSON:",G.data),z.error("From chunk:",G.raw),U}if(G.event==="ping")continue;if(G.event==="error"){let U=f8(G.data)??G.data,K=U?.error?.type;throw new k$(void 0,U,void 0,$.headers,K)}}W=!0}catch(G){if(d4(G))return;throw G}finally{if(!W)X.abort()}}return new G4(Y,X,J)}static fromReadableStream($,X,J){let Q=!1;async function*z(){let W=new D6,G=a0($);for await(let U of G)for(let K of W.decode(U))yield K;for(let U of W.flush())yield U}async function*Y(){if(Q)throw new T("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Q=!0;let W=!1;try{for await(let G of z()){if(W)continue;if(G)yield JSON.parse(G)}W=!0}catch(G){if(d4(G))return;throw G}finally{if(!W)X.abort()}}return new G4(Y,X,J)}[(e0=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],X=[],J=this.iterator(),Q=(z)=>{return{next:()=>{if(z.length===0){let Y=J.next();$.push(Y),X.push(Y)}return z.shift()}}};return[new G4(()=>Q($),this.controller,D(this,e0,"f")),new G4(()=>Q(X),this.controller,D(this,e0,"f"))]}toReadableStream(){let $=this,X;return eQ({async start(){X=$[Symbol.asyncIterator]()},async pull(J){try{let{value:Q,done:z}=await X.next();if(z)return J.close();let Y=_1(JSON.stringify(Q)+`
|
|
14
14
|
`);J.enqueue(Y)}catch(Q){J.error(Q)}},async cancel(){await X.return?.()}})}}async function*XF($,X){if(!$.body){if(X.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new T("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new T("Attempted to iterate over a response with no body")}let J=new $w,Q=new D6,z=a0($.body);for await(let Y of JF(z))for(let W of Q.decode(Y)){let G=J.decode(W);if(G)yield G}for(let Y of Q.flush()){let W=J.decode(Y);if(W)yield W}}async function*JF($){let X=new Uint8Array;for await(let J of $){if(J==null)continue;let Q=J instanceof ArrayBuffer?new Uint8Array(J):typeof J==="string"?_1(J):J,z=new Uint8Array(X.length+Q.length);z.set(X),z.set(Q,X.length),X=z;let Y;while((Y=eK(X))!==-1)yield X.slice(0,Y),X=X.slice(Y)}if(X.length>0)yield X}class $w{constructor(){this.event=null,this.data=[],this.chunks=[]}decode($){if($.endsWith("\r"))$=$.substring(0,$.length-1);if(!$){if(!this.event&&!this.data.length)return null;let z={event:this.event,data:this.data.join(`
|