@http-forge/core 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +188 -188
- package/dist/index.mjs +187 -187
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,228 +1,228 @@
|
|
|
1
|
-
"use strict";var TN=Object.create;var _h=Object.defineProperty;var qN=Object.getOwnPropertyDescriptor;var $N=Object.getOwnPropertyNames;var MN=Object.getPrototypeOf,NN=Object.prototype.hasOwnProperty;var F=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),DN=(t,e)=>{for(var r in e)_h(t,r,{get:e[r],enumerable:!0})},GE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $N(e))!NN.call(t,i)&&i!==r&&_h(t,i,{get:()=>e[i],enumerable:!(n=qN(e,i))||n.enumerable});return t};var ve=(t,e,r)=>(r=t!=null?TN(MN(t)):{},GE(e||!t||!t.__esModule?_h(r,"default",{value:t,enumerable:!0}):r,t)),FN=t=>GE(_h({},"__esModule",{value:!0}),t);var fC=F((bl,Sc)=>{(function(){var t,e="4.17.21",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",h=1,g=2,m=4,S=1,_=2,C=1,x=2,A=4,T=8,j=16,Y=32,V=64,K=128,ee=256,k=512,E=30,P="...",N=800,D=16,L=1,z=2,Z=3,ie=1/0,fe=9007199254740991,wt=17976931348623157e292,Ee=NaN,he=4294967295,Xe=he-1,Et=he>>>1,Mt=[["ary",K],["bind",C],["bindKey",x],["curry",T],["curryRight",j],["flip",k],["partial",Y],["partialRight",V],["rearg",ee]],le="[object Arguments]",ei="[object Array]",$u="[object AsyncFunction]",ft="[object Boolean]",En="[object Date]",cs="[object DOMException]",jt="[object Error]",dt="[object Function]",ti="[object GeneratorFunction]",rr="[object Map]",Zr="[object Number]",cg="[object Null]",Cn="[object Object]",Gf="[object Promise]",fg="[object Proxy]",fs="[object RegExp]",yt="[object Set]",Ti="[object String]",Oa="[object Symbol]",dg="[object Undefined]",ds="[object WeakMap]",hr="[object WeakSet]",hs="[object ArrayBuffer]",ri="[object DataView]",ps="[object Float32Array]",et="[object Float64Array]",Pa="[object Int8Array]",ka="[object Int16Array]",ms="[object Int32Array]",bo="[object Uint8Array]",gs="[object Uint8ClampedArray]",ni="[object Uint16Array]",ys="[object Uint32Array]",hg=/\b__p \+= '';/g,Aa=/\b(__p \+=) '' \+/g,pg=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vs=/&(?:amp|lt|gt|quot|#39);/g,qi=/[&<>"']/g,Mu=RegExp(vs.source),Ta=RegExp(qi.source),oe=/<%-([\s\S]+?)%>/g,mg=/<%([\s\S]+?)%>/g,Qf=/<%=([\s\S]+?)%>/g,xn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_r=/^\w*$/,Me=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_o=/[\\^$.*+?()[\]{}|]/g,Ge=RegExp(_o.source),$i=/^\s+/,gg=/\s/,qa=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vt=/\{\n\/\* \[wrapped with (.+)\] \*/,Rn=/,? & /,Xr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,kt=/[()=,{}\[\]\/\s]/,jr=/\\(\\)?/g,In=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ii=/\w*$/,yg=/^[-+]0x[0-9a-f]+$/i,vg=/^0b[01]+$/i,wo=/^\[object .+?Constructor\]$/,Zf=/^0o[0-7]+$/i,Sg=/^(?:0|[1-9]\d*)$/,Ss=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,si=/($^)/,Xf=/['\n\r\u2028\u2029\\]/g,$a="\\ud800-\\udfff",bg="\\u0300-\\u036f",_g="\\ufe20-\\ufe2f",vt="\\u20d0-\\u20ff",Ma=bg+_g+vt,ed="\\u2700-\\u27bf",Nu="a-z\\xdf-\\xf6\\xf8-\\xff",td="\\xac\\xb1\\xd7\\xf7",wg="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Eg="\\u2000-\\u206f",Cg=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",rd="A-Z\\xc0-\\xd6\\xd8-\\xde",nd="\\ufe0e\\ufe0f",id=td+wg+Eg+Cg,Na="['\u2019]",sd="["+$a+"]",od="["+id+"]",Da="["+Ma+"]",ad="\\d+",ld="["+ed+"]",ud="["+Nu+"]",bs="[^"+$a+id+ad+ed+Nu+rd+"]",_s="\\ud83c[\\udffb-\\udfff]",cd="(?:"+Da+"|"+_s+")",ws="[^"+$a+"]",Ur="(?:\\ud83c[\\udde6-\\uddff]){2}",Du="[\\ud800-\\udbff][\\udc00-\\udfff]",Es="["+rd+"]",fd="\\u200d",dd="(?:"+ud+"|"+bs+")",xg="(?:"+Es+"|"+bs+")",hd="(?:"+Na+"(?:d|ll|m|re|s|t|ve))?",pd="(?:"+Na+"(?:D|LL|M|RE|S|T|VE))?",md=cd+"?",Fa="["+nd+"]?",Rg="(?:"+fd+"(?:"+[ws,Ur,Du].join("|")+")"+Fa+md+")*",gd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ig="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",yd=Fa+md+Rg,Og="(?:"+[ld,Ur,Du].join("|")+")"+yd,Pg="(?:"+[ws+Da+"?",Da,Ur,Du,sd].join("|")+")",kg=RegExp(Na,"g"),Ag=RegExp(Da,"g"),Fu=RegExp(_s+"(?="+_s+")|"+Pg+yd,"g"),Tg=RegExp([Es+"?"+ud+"+"+hd+"(?="+[od,Es,"$"].join("|")+")",xg+"+"+pd+"(?="+[od,Es+dd,"$"].join("|")+")",Es+"?"+dd+"+"+hd,Es+"+"+pd,Ig,gd,ad,Og].join("|"),"g"),qg=RegExp("["+fd+$a+Ma+nd+"]"),$g=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Mg=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ng=-1,lt={};lt[ps]=lt[et]=lt[Pa]=lt[ka]=lt[ms]=lt[bo]=lt[gs]=lt[ni]=lt[ys]=!0,lt[le]=lt[ei]=lt[hs]=lt[ft]=lt[ri]=lt[En]=lt[jt]=lt[dt]=lt[rr]=lt[Zr]=lt[Cn]=lt[fs]=lt[yt]=lt[Ti]=lt[ds]=!1;var it={};it[le]=it[ei]=it[hs]=it[ri]=it[ft]=it[En]=it[ps]=it[et]=it[Pa]=it[ka]=it[ms]=it[rr]=it[Zr]=it[Cn]=it[fs]=it[yt]=it[Ti]=it[Oa]=it[bo]=it[gs]=it[ni]=it[ys]=!0,it[jt]=it[dt]=it[ds]=!1;var Dg={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Lu={"&":"&","<":"<",">":">",'"':""","'":"'"},ju={"&":"&","<":"<",">":">",""":'"',"'":"'"},Fg={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},vd=parseFloat,Sd=parseInt,bd=typeof global=="object"&&global&&global.Object===Object&&global,Lg=typeof self=="object"&&self&&self.Object===Object&&self,Nt=bd||Lg||Function("return this")(),Uu=typeof bl=="object"&&bl&&!bl.nodeType&&bl,oi=Uu&&typeof Sc=="object"&&Sc&&!Sc.nodeType&&Sc,ut=oi&&oi.exports===Uu,Mi=ut&&bd.process,Wt=function(){try{var U=oi&&oi.require&&oi.require("util").types;return U||Mi&&Mi.binding&&Mi.binding("util")}catch{}}(),_d=Wt&&Wt.isArrayBuffer,Bu=Wt&&Wt.isDate,wd=Wt&&Wt.isMap,Ed=Wt&&Wt.isRegExp,Eo=Wt&&Wt.isSet,On=Wt&&Wt.isTypedArray;function zt(U,J,H){switch(H.length){case 0:return U.call(J);case 1:return U.call(J,H[0]);case 2:return U.call(J,H[0],H[1]);case 3:return U.call(J,H[0],H[1],H[2])}return U.apply(J,H)}function jg(U,J,H,ae){for(var Se=-1,Ye=U==null?0:U.length;++Se<Ye;){var At=U[Se];J(ae,At,H(At),U)}return ae}function Ct(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae&&J(U[H],H,U)!==!1;);return U}function Ug(U,J){for(var H=U==null?0:U.length;H--&&J(U[H],H,U)!==!1;);return U}function La(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae;)if(!J(U[H],H,U))return!1;return!0}function ai(U,J){for(var H=-1,ae=U==null?0:U.length,Se=0,Ye=[];++H<ae;){var At=U[H];J(At,H,U)&&(Ye[Se++]=At)}return Ye}function ja(U,J){var H=U==null?0:U.length;return!!H&&Cs(U,J,0)>-1}function Hu(U,J,H){for(var ae=-1,Se=U==null?0:U.length;++ae<Se;)if(H(J,U[ae]))return!0;return!1}function tt(U,J){for(var H=-1,ae=U==null?0:U.length,Se=Array(ae);++H<ae;)Se[H]=J(U[H],H,U);return Se}function en(U,J){for(var H=-1,ae=J.length,Se=U.length;++H<ae;)U[Se+H]=J[H];return U}function Vu(U,J,H,ae){var Se=-1,Ye=U==null?0:U.length;for(ae&&Ye&&(H=U[++Se]);++Se<Ye;)H=J(H,U[Se],Se,U);return H}function Bg(U,J,H,ae){var Se=U==null?0:U.length;for(ae&&Se&&(H=U[--Se]);Se--;)H=J(H,U[Se],Se,U);return H}function Wu(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae;)if(J(U[H],H,U))return!0;return!1}var Cd=Yu("length");function Hg(U){return U.split("")}function Vg(U){return U.match(Xr)||[]}function xd(U,J,H){var ae;return H(U,function(Se,Ye,At){if(J(Se,Ye,At))return ae=Ye,!1}),ae}function Ua(U,J,H,ae){for(var Se=U.length,Ye=H+(ae?1:-1);ae?Ye--:++Ye<Se;)if(J(U[Ye],Ye,U))return Ye;return-1}function Cs(U,J,H){return J===J?Td(U,J,H):Ua(U,Id,H)}function Rd(U,J,H,ae){for(var Se=H-1,Ye=U.length;++Se<Ye;)if(ae(U[Se],J))return Se;return-1}function Id(U){return U!==U}function Ni(U,J){var H=U==null?0:U.length;return H?zu(U,J)/H:Ee}function Yu(U){return function(J){return J==null?t:J[U]}}function Co(U){return function(J){return U==null?t:U[J]}}function Od(U,J,H,ae,Se){return Se(U,function(Ye,At,Te){H=ae?(ae=!1,Ye):J(H,Ye,At,Te)}),H}function Ju(U,J){var H=U.length;for(U.sort(J);H--;)U[H]=U[H].value;return U}function zu(U,J){for(var H,ae=-1,Se=U.length;++ae<Se;){var Ye=J(U[ae]);Ye!==t&&(H=H===t?Ye:H+Ye)}return H}function Ku(U,J){for(var H=-1,ae=Array(U);++H<U;)ae[H]=J(H);return ae}function Wg(U,J){return tt(J,function(H){return[H,U[H]]})}function Pd(U){return U&&U.slice(0,Ba(U)+1).replace($i,"")}function nr(U){return function(J){return U(J)}}function Gu(U,J){return tt(J,function(H){return U[H]})}function xs(U,J){return U.has(J)}function st(U,J){for(var H=-1,ae=U.length;++H<ae&&Cs(J,U[H],0)>-1;);return H}function kd(U,J){for(var H=U.length;H--&&Cs(J,U[H],0)>-1;);return H}function Yg(U,J){for(var H=U.length,ae=0;H--;)U[H]===J&&++ae;return ae}var Ad=Co(Dg),Jg=Co(Lu);function zg(U){return"\\"+Fg[U]}function Kg(U,J){return U==null?t:U[J]}function tn(U){return qg.test(U)}function Gg(U){return $g.test(U)}function Qg(U){for(var J,H=[];!(J=U.next()).done;)H.push(J.value);return H}function Qu(U){var J=-1,H=Array(U.size);return U.forEach(function(ae,Se){H[++J]=[Se,ae]}),H}function xo(U,J){return function(H){return U(J(H))}}function Br(U,J){for(var H=-1,ae=U.length,Se=0,Ye=[];++H<ae;){var At=U[H];(At===J||At===f)&&(U[H]=f,Ye[Se++]=H)}return Ye}function Rs(U){var J=-1,H=Array(U.size);return U.forEach(function(ae){H[++J]=ae}),H}function Zg(U){var J=-1,H=Array(U.size);return U.forEach(function(ae){H[++J]=[ae,ae]}),H}function Td(U,J,H){for(var ae=H-1,Se=U.length;++ae<Se;)if(U[ae]===J)return ae;return-1}function Xg(U,J,H){for(var ae=H+1;ae--;)if(U[ae]===J)return ae;return ae}function li(U){return tn(U)?ty(U):Cd(U)}function pr(U){return tn(U)?ry(U):Hg(U)}function Ba(U){for(var J=U.length;J--&&gg.test(U.charAt(J)););return J}var ey=Co(ju);function ty(U){for(var J=Fu.lastIndex=0;Fu.test(U);)++J;return J}function ry(U){return U.match(Fu)||[]}function ny(U){return U.match(Tg)||[]}var iy=function U(J){J=J==null?Nt:ui.defaults(Nt.Object(),J,ui.pick(Nt,Mg));var H=J.Array,ae=J.Date,Se=J.Error,Ye=J.Function,At=J.Math,Te=J.Object,Pn=J.RegExp,qd=J.String,wr=J.TypeError,Ro=H.prototype,$d=Ye.prototype,Is=Te.prototype,Ha=J["__core-js_shared__"],Io=$d.toString,Ke=Is.hasOwnProperty,sy=0,Md=function(){var o=/[^.]+$/.exec(Ha&&Ha.keys&&Ha.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Va=Is.toString,oy=Io.call(Te),ay=Nt._,ly=Pn("^"+Io.call(Ke).replace(_o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wa=ut?J.Buffer:t,ci=J.Symbol,Ya=J.Uint8Array,Nd=Wa?Wa.allocUnsafe:t,Ja=xo(Te.getPrototypeOf,Te),Dd=Te.create,Fd=Is.propertyIsEnumerable,Di=Ro.splice,Ld=ci?ci.isConcatSpreadable:t,Oo=ci?ci.iterator:t,Fi=ci?ci.toStringTag:t,za=function(){try{var o=Fo(Te,"defineProperty");return o({},"",{}),o}catch{}}(),uy=J.clearTimeout!==Nt.clearTimeout&&J.clearTimeout,cy=ae&&ae.now!==Nt.Date.now&&ae.now,fy=J.setTimeout!==Nt.setTimeout&&J.setTimeout,Ka=At.ceil,Po=At.floor,Ga=Te.getOwnPropertySymbols,jd=Wa?Wa.isBuffer:t,ko=J.isFinite,Os=Ro.join,Qa=xo(Te.keys,Te),xt=At.max,St=At.min,Ud=ae.now,Bd=J.parseInt,Hd=At.random,dy=Ro.reverse,Zu=Fo(J,"DataView"),Ao=Fo(J,"Map"),Xu=Fo(J,"Promise"),Ps=Fo(J,"Set"),To=Fo(J,"WeakMap"),qo=Fo(Te,"create"),Za=To&&new To,ks={},hy=Lo(Zu),py=Lo(Ao),my=Lo(Xu),gy=Lo(Ps),yy=Lo(To),Xa=ci?ci.prototype:t,$o=Xa?Xa.valueOf:t,Vd=Xa?Xa.toString:t;function I(o){if(Rt(o)&&!Ce(o)&&!(o instanceof Oe)){if(o instanceof Er)return o;if(Ke.call(o,"__wrapped__"))return mE(o)}return new Er(o)}var As=function(){function o(){}return function(l){if(!bt(l))return{};if(Dd)return Dd(l);o.prototype=l;var d=new o;return o.prototype=t,d}}();function el(){}function Er(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}I.templateSettings={escape:oe,evaluate:mg,interpolate:Qf,variable:"",imports:{_:I}},I.prototype=el.prototype,I.prototype.constructor=I,Er.prototype=As(el.prototype),Er.prototype.constructor=Er;function Oe(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=he,this.__views__=[]}function vy(){var o=new Oe(this.__wrapped__);return o.__actions__=xr(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=xr(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=xr(this.__views__),o}function Sy(){if(this.__filtered__){var o=new Oe(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function by(){var o=this.__wrapped__.value(),l=this.__dir__,d=Ce(o),v=l<0,w=d?o.length:0,O=sT(0,w,this.__views__),q=O.start,M=O.end,B=M-q,G=v?M:q-1,Q=this.__iteratees__,X=Q.length,re=0,ue=St(B,this.__takeCount__);if(!d||!v&&w==B&&ue==B)return Fw(o,this.__actions__);var me=[];e:for(;B--&&re<ue;){G+=l;for(var ke=-1,ge=o[G];++ke<X;){var Fe=Q[ke],Ue=Fe.iteratee,Yr=Fe.type,yr=Ue(ge);if(Yr==z)ge=yr;else if(!yr){if(Yr==L)continue e;break e}}me[re++]=ge}return me}Oe.prototype=As(el.prototype),Oe.prototype.constructor=Oe;function kn(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var v=o[l];this.set(v[0],v[1])}}function tl(){this.__data__=qo?qo(null):{},this.size=0}function _y(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function wy(o){var l=this.__data__;if(qo){var d=l[o];return d===a?t:d}return Ke.call(l,o)?l[o]:t}function Ey(o){var l=this.__data__;return qo?l[o]!==t:Ke.call(l,o)}function Cy(o,l){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=qo&&l===t?a:l,this}kn.prototype.clear=tl,kn.prototype.delete=_y,kn.prototype.get=wy,kn.prototype.has=Ey,kn.prototype.set=Cy;function An(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var v=o[l];this.set(v[0],v[1])}}function xy(){this.__data__=[],this.size=0}function Wd(o){var l=this.__data__,d=Cr(l,o);if(d<0)return!1;var v=l.length-1;return d==v?l.pop():Di.call(l,d,1),--this.size,!0}function Ry(o){var l=this.__data__,d=Cr(l,o);return d<0?t:l[d][1]}function Iy(o){return Cr(this.__data__,o)>-1}function Yd(o,l){var d=this.__data__,v=Cr(d,o);return v<0?(++this.size,d.push([o,l])):d[v][1]=l,this}An.prototype.clear=xy,An.prototype.delete=Wd,An.prototype.get=Ry,An.prototype.has=Iy,An.prototype.set=Yd;function Tn(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var v=o[l];this.set(v[0],v[1])}}function Oy(){this.size=0,this.__data__={hash:new kn,map:new(Ao||An),string:new kn}}function Py(o){var l=fh(this,o).delete(o);return this.size-=l?1:0,l}function fi(o){return fh(this,o).get(o)}function Jd(o){return fh(this,o).has(o)}function ky(o,l){var d=fh(this,o),v=d.size;return d.set(o,l),this.size+=d.size==v?0:1,this}Tn.prototype.clear=Oy,Tn.prototype.delete=Py,Tn.prototype.get=fi,Tn.prototype.has=Jd,Tn.prototype.set=ky;function Li(o){var l=-1,d=o==null?0:o.length;for(this.__data__=new Tn;++l<d;)this.add(o[l])}function Ay(o){return this.__data__.set(o,a),this}function te(o){return this.__data__.has(o)}Li.prototype.add=Li.prototype.push=Ay,Li.prototype.has=te;function Hr(o){var l=this.__data__=new An(o);this.size=l.size}function Ty(){this.__data__=new An,this.size=0}function zd(o){var l=this.__data__,d=l.delete(o);return this.size=l.size,d}function He(o){return this.__data__.get(o)}function rl(o){return this.__data__.has(o)}function Kd(o,l){var d=this.__data__;if(d instanceof An){var v=d.__data__;if(!Ao||v.length<r-1)return v.push([o,l]),this.size=++d.size,this;d=this.__data__=new Tn(v)}return d.set(o,l),this.size=d.size,this}Hr.prototype.clear=Ty,Hr.prototype.delete=zd,Hr.prototype.get=He,Hr.prototype.has=rl,Hr.prototype.set=Kd;function nl(o,l){var d=Ce(o),v=!d&&jo(o),w=!d&&!v&&Ns(o),O=!d&&!v&&!w&&ul(o),q=d||v||w||O,M=q?Ku(o.length,qd):[],B=M.length;for(var G in o)(l||Ke.call(o,G))&&!(q&&(G=="length"||w&&(G=="offset"||G=="parent")||O&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||Vi(G,B)))&&M.push(G);return M}function Gd(o){var l=o.length;return l?o[Yy(0,l-1)]:t}function qy(o,l){return dh(xr(o),ji(l,0,o.length))}function $y(o){return dh(xr(o))}function ec(o,l,d){(d!==t&&!Nn(o[l],d)||d===t&&!(l in o))&&qn(o,l,d)}function Mo(o,l,d){var v=o[l];(!(Ke.call(o,l)&&Nn(v,d))||d===t&&!(l in o))&&qn(o,l,d)}function Cr(o,l){for(var d=o.length;d--;)if(Nn(o[d][0],l))return d;return-1}function My(o,l,d,v){return di(o,function(w,O,q){l(v,w,d(w),q)}),v}function tc(o,l){return o&&pi(l,Yt(l),o)}function Ny(o,l){return o&&pi(l,Ir(l),o)}function qn(o,l,d){l=="__proto__"&&za?za(o,l,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[l]=d}function il(o,l){for(var d=-1,v=l.length,w=H(v),O=o==null;++d<v;)w[d]=O?t:yv(o,l[d]);return w}function ji(o,l,d){return o===o&&(d!==t&&(o=o<=d?o:d),l!==t&&(o=o>=l?o:l)),o}function mr(o,l,d,v,w,O){var q,M=l&h,B=l&g,G=l&m;if(d&&(q=w?d(o,v,w,O):d(o)),q!==t)return q;if(!bt(o))return o;var Q=Ce(o);if(Q){if(q=aT(o),!M)return xr(o,q)}else{var X=ir(o),re=X==dt||X==ti;if(Ns(o))return Uw(o,M);if(X==Cn||X==le||re&&!w){if(q=B||re?{}:oE(o),!M)return B?GA(o,Ny(q,o)):KA(o,tc(q,o))}else{if(!it[X])return w?o:{};q=lT(o,X,M)}}O||(O=new Hr);var ue=O.get(o);if(ue)return ue;O.set(o,q),ME(o)?o.forEach(function(ge){q.add(mr(ge,l,d,ge,o,O))}):qE(o)&&o.forEach(function(ge,Fe){q.set(Fe,mr(ge,l,d,Fe,o,O))});var me=G?B?nv:rv:B?Ir:Yt,ke=Q?t:me(o);return Ct(ke||o,function(ge,Fe){ke&&(Fe=ge,ge=o[Fe]),Mo(q,Fe,mr(ge,l,d,Fe,o,O))}),q}function rc(o){var l=Yt(o);return function(d){return Qd(d,o,l)}}function Qd(o,l,d){var v=d.length;if(o==null)return!v;for(o=Te(o);v--;){var w=d[v],O=l[w],q=o[w];if(q===t&&!(w in o)||!O(q))return!1}return!0}function rn(o,l,d){if(typeof o!="function")throw new wr(i);return fc(function(){o.apply(t,d)},l)}function Ts(o,l,d,v){var w=-1,O=ja,q=!0,M=o.length,B=[],G=l.length;if(!M)return B;d&&(l=tt(l,nr(d))),v?(O=Hu,q=!1):l.length>=r&&(O=xs,q=!1,l=new Li(l));e:for(;++w<M;){var Q=o[w],X=d==null?Q:d(Q);if(Q=v||Q!==0?Q:0,q&&X===X){for(var re=G;re--;)if(l[re]===X)continue e;B.push(Q)}else O(l,X,v)||B.push(Q)}return B}var di=Yw(nn),Zd=Yw(ic,!0);function Dy(o,l){var d=!0;return di(o,function(v,w,O){return d=!!l(v,w,O),d}),d}function sl(o,l,d){for(var v=-1,w=o.length;++v<w;){var O=o[v],q=l(O);if(q!=null&&(M===t?q===q&&!Wr(q):d(q,M)))var M=q,B=O}return B}function Fy(o,l,d,v){var w=o.length;for(d=xe(d),d<0&&(d=-d>w?0:w+d),v=v===t||v>w?w:xe(v),v<0&&(v+=w),v=d>v?0:DE(v);d<v;)o[d++]=l;return o}function Xd(o,l){var d=[];return di(o,function(v,w,O){l(v,w,O)&&d.push(v)}),d}function Ut(o,l,d,v,w){var O=-1,q=o.length;for(d||(d=cT),w||(w=[]);++O<q;){var M=o[O];l>0&&d(M)?l>1?Ut(M,l-1,d,v,w):en(w,M):v||(w[w.length]=M)}return w}var nc=Jw(),eh=Jw(!0);function nn(o,l){return o&&nc(o,l,Yt)}function ic(o,l){return o&&eh(o,l,Yt)}function sn(o,l){return ai(l,function(d){return Wi(o[d])})}function Ui(o,l){l=$s(l,o);for(var d=0,v=l.length;o!=null&&d<v;)o=o[mi(l[d++])];return d&&d==v?o:t}function th(o,l,d){var v=l(o);return Ce(o)?v:en(v,d(o))}function Kt(o){return o==null?o===t?dg:cg:Fi&&Fi in Te(o)?iT(o):yT(o)}function sc(o,l){return o>l}function Ly(o,l){return o!=null&&Ke.call(o,l)}function jy(o,l){return o!=null&&l in Te(o)}function Uy(o,l,d){return o>=St(l,d)&&o<xt(l,d)}function oc(o,l,d){for(var v=d?Hu:ja,w=o[0].length,O=o.length,q=O,M=H(O),B=1/0,G=[];q--;){var Q=o[q];q&&l&&(Q=tt(Q,nr(l))),B=St(Q.length,B),M[q]=!d&&(l||w>=120&&Q.length>=120)?new Li(q&&Q):t}Q=o[0];var X=-1,re=M[0];e:for(;++X<w&&G.length<B;){var ue=Q[X],me=l?l(ue):ue;if(ue=d||ue!==0?ue:0,!(re?xs(re,me):v(G,me,d))){for(q=O;--q;){var ke=M[q];if(!(ke?xs(ke,me):v(o[q],me,d)))continue e}re&&re.push(me),G.push(ue)}}return G}function $n(o,l,d,v){return nn(o,function(w,O,q){l(v,d(w),O,q)}),v}function on(o,l,d){l=$s(l,o),o=cE(o,l);var v=o==null?o:o[mi(un(l))];return v==null?t:zt(v,o,d)}function rh(o){return Rt(o)&&Kt(o)==le}function By(o){return Rt(o)&&Kt(o)==hs}function Hy(o){return Rt(o)&&Kt(o)==En}function No(o,l,d,v,w){return o===l?!0:o==null||l==null||!Rt(o)&&!Rt(l)?o!==o&&l!==l:Vy(o,l,d,v,No,w)}function Vy(o,l,d,v,w,O){var q=Ce(o),M=Ce(l),B=q?ei:ir(o),G=M?ei:ir(l);B=B==le?Cn:B,G=G==le?Cn:G;var Q=B==Cn,X=G==Cn,re=B==G;if(re&&Ns(o)){if(!Ns(l))return!1;q=!0,Q=!1}if(re&&!Q)return O||(O=new Hr),q||ul(o)?nE(o,l,d,v,w,O):rT(o,l,B,d,v,w,O);if(!(d&S)){var ue=Q&&Ke.call(o,"__wrapped__"),me=X&&Ke.call(l,"__wrapped__");if(ue||me){var ke=ue?o.value():o,ge=me?l.value():l;return O||(O=new Hr),w(ke,ge,d,v,O)}}return re?(O||(O=new Hr),nT(o,l,d,v,w,O)):!1}function ac(o){return Rt(o)&&ir(o)==rr}function hi(o,l,d,v){var w=d.length,O=w,q=!v;if(o==null)return!O;for(o=Te(o);w--;){var M=d[w];if(q&&M[2]?M[1]!==o[M[0]]:!(M[0]in o))return!1}for(;++w<O;){M=d[w];var B=M[0],G=o[B],Q=M[1];if(q&&M[2]){if(G===t&&!(B in o))return!1}else{var X=new Hr;if(v)var re=v(G,Q,B,o,l,X);if(!(re===t?No(Q,G,S|_,v,X):re))return!1}}return!0}function Do(o){if(!bt(o)||dT(o))return!1;var l=Wi(o)?ly:wo;return l.test(Lo(o))}function je(o){return Rt(o)&&Kt(o)==fs}function c(o){return Rt(o)&&ir(o)==yt}function p(o){return Rt(o)&&vh(o.length)&&!!lt[Kt(o)]}function y(o){return typeof o=="function"?o:o==null?Or:typeof o=="object"?Ce(o)?ye(o[0],o[1]):se(o):zE(o)}function b(o){if(!cc(o))return Qa(o);var l=[];for(var d in Te(o))Ke.call(o,d)&&d!="constructor"&&l.push(d);return l}function R(o){if(!bt(o))return gT(o);var l=cc(o),d=[];for(var v in o)v=="constructor"&&(l||!Ke.call(o,v))||d.push(v);return d}function $(o,l){return o<l}function W(o,l){var d=-1,v=Rr(o)?H(o.length):[];return di(o,function(w,O,q){v[++d]=l(w,O,q)}),v}function se(o){var l=sv(o);return l.length==1&&l[0][2]?lE(l[0][0],l[0][1]):function(d){return d===o||hi(d,o,l)}}function ye(o,l){return av(o)&&aE(l)?lE(mi(o),l):function(d){var v=yv(d,o);return v===t&&v===l?vv(d,o):No(l,v,S|_)}}function Pe(o,l,d,v,w){o!==l&&nc(l,function(O,q){if(w||(w=new Hr),bt(O))Gt(o,l,q,d,Pe,v,w);else{var M=v?v(uv(o,q),O,q+"",o,l,w):t;M===t&&(M=O),ec(o,q,M)}},Ir)}function Gt(o,l,d,v,w,O,q){var M=uv(o,d),B=uv(l,d),G=q.get(B);if(G){ec(o,d,G);return}var Q=O?O(M,B,d+"",o,l,q):t,X=Q===t;if(X){var re=Ce(B),ue=!re&&Ns(B),me=!re&&!ue&&ul(B);Q=B,re||ue||me?Ce(M)?Q=M:Tt(M)?Q=xr(M):ue?(X=!1,Q=Uw(B,!0)):me?(X=!1,Q=Bw(B,!0)):Q=[]:dc(B)||jo(B)?(Q=M,jo(M)?Q=FE(M):(!bt(M)||Wi(M))&&(Q=oE(B))):X=!1}X&&(q.set(B,Q),w(Q,B,v,O,q),q.delete(B)),ec(o,d,Q)}function an(o,l){var d=o.length;if(d)return l+=l<0?d:0,Vi(l,d)?o[l]:t}function Mn(o,l,d){l.length?l=tt(l,function(O){return Ce(O)?function(q){return Ui(q,O.length===1?O[0]:O)}:O}):l=[Or];var v=-1;l=tt(l,nr(pe()));var w=W(o,function(O,q,M){var B=tt(l,function(G){return G(O)});return{criteria:B,index:++v,value:O}});return Ju(w,function(O,q){return zA(O,q,d)})}function NA(o,l){return Tw(o,l,function(d,v){return vv(o,v)})}function Tw(o,l,d){for(var v=-1,w=l.length,O={};++v<w;){var q=l[v],M=Ui(o,q);d(M,q)&&lc(O,$s(q,o),M)}return O}function DA(o){return function(l){return Ui(l,o)}}function Wy(o,l,d,v){var w=v?Rd:Cs,O=-1,q=l.length,M=o;for(o===l&&(l=xr(l)),d&&(M=tt(o,nr(d)));++O<q;)for(var B=0,G=l[O],Q=d?d(G):G;(B=w(M,Q,B,v))>-1;)M!==o&&Di.call(M,B,1),Di.call(o,B,1);return o}function qw(o,l){for(var d=o?l.length:0,v=d-1;d--;){var w=l[d];if(d==v||w!==O){var O=w;Vi(w)?Di.call(o,w,1):Ky(o,w)}}return o}function Yy(o,l){return o+Po(Hd()*(l-o+1))}function FA(o,l,d,v){for(var w=-1,O=xt(Ka((l-o)/(d||1)),0),q=H(O);O--;)q[v?O:++w]=o,o+=d;return q}function Jy(o,l){var d="";if(!o||l<1||l>fe)return d;do l%2&&(d+=o),l=Po(l/2),l&&(o+=o);while(l);return d}function qe(o,l){return cv(uE(o,l,Or),o+"")}function LA(o){return Gd(cl(o))}function jA(o,l){var d=cl(o);return dh(d,ji(l,0,d.length))}function lc(o,l,d,v){if(!bt(o))return o;l=$s(l,o);for(var w=-1,O=l.length,q=O-1,M=o;M!=null&&++w<O;){var B=mi(l[w]),G=d;if(B==="__proto__"||B==="constructor"||B==="prototype")return o;if(w!=q){var Q=M[B];G=v?v(Q,B,M):t,G===t&&(G=bt(Q)?Q:Vi(l[w+1])?[]:{})}Mo(M,B,G),M=M[B]}return o}var $w=Za?function(o,l){return Za.set(o,l),o}:Or,UA=za?function(o,l){return za(o,"toString",{configurable:!0,enumerable:!1,value:bv(l),writable:!0})}:Or;function BA(o){return dh(cl(o))}function ln(o,l,d){var v=-1,w=o.length;l<0&&(l=-l>w?0:w+l),d=d>w?w:d,d<0&&(d+=w),w=l>d?0:d-l>>>0,l>>>=0;for(var O=H(w);++v<w;)O[v]=o[v+l];return O}function HA(o,l){var d;return di(o,function(v,w,O){return d=l(v,w,O),!d}),!!d}function nh(o,l,d){var v=0,w=o==null?v:o.length;if(typeof l=="number"&&l===l&&w<=Et){for(;v<w;){var O=v+w>>>1,q=o[O];q!==null&&!Wr(q)&&(d?q<=l:q<l)?v=O+1:w=O}return w}return zy(o,l,Or,d)}function zy(o,l,d,v){var w=0,O=o==null?0:o.length;if(O===0)return 0;l=d(l);for(var q=l!==l,M=l===null,B=Wr(l),G=l===t;w<O;){var Q=Po((w+O)/2),X=d(o[Q]),re=X!==t,ue=X===null,me=X===X,ke=Wr(X);if(q)var ge=v||me;else G?ge=me&&(v||re):M?ge=me&&re&&(v||!ue):B?ge=me&&re&&!ue&&(v||!ke):ue||ke?ge=!1:ge=v?X<=l:X<l;ge?w=Q+1:O=Q}return St(O,Xe)}function Mw(o,l){for(var d=-1,v=o.length,w=0,O=[];++d<v;){var q=o[d],M=l?l(q):q;if(!d||!Nn(M,B)){var B=M;O[w++]=q===0?0:q}}return O}function Nw(o){return typeof o=="number"?o:Wr(o)?Ee:+o}function Vr(o){if(typeof o=="string")return o;if(Ce(o))return tt(o,Vr)+"";if(Wr(o))return Vd?Vd.call(o):"";var l=o+"";return l=="0"&&1/o==-ie?"-0":l}function qs(o,l,d){var v=-1,w=ja,O=o.length,q=!0,M=[],B=M;if(d)q=!1,w=Hu;else if(O>=r){var G=l?null:eT(o);if(G)return Rs(G);q=!1,w=xs,B=new Li}else B=l?[]:M;e:for(;++v<O;){var Q=o[v],X=l?l(Q):Q;if(Q=d||Q!==0?Q:0,q&&X===X){for(var re=B.length;re--;)if(B[re]===X)continue e;l&&B.push(X),M.push(Q)}else w(B,X,d)||(B!==M&&B.push(X),M.push(Q))}return M}function Ky(o,l){return l=$s(l,o),o=cE(o,l),o==null||delete o[mi(un(l))]}function Dw(o,l,d,v){return lc(o,l,d(Ui(o,l)),v)}function ih(o,l,d,v){for(var w=o.length,O=v?w:-1;(v?O--:++O<w)&&l(o[O],O,o););return d?ln(o,v?0:O,v?O+1:w):ln(o,v?O+1:0,v?w:O)}function Fw(o,l){var d=o;return d instanceof Oe&&(d=d.value()),Vu(l,function(v,w){return w.func.apply(w.thisArg,en([v],w.args))},d)}function Gy(o,l,d){var v=o.length;if(v<2)return v?qs(o[0]):[];for(var w=-1,O=H(v);++w<v;)for(var q=o[w],M=-1;++M<v;)M!=w&&(O[w]=Ts(O[w]||q,o[M],l,d));return qs(Ut(O,1),l,d)}function Lw(o,l,d){for(var v=-1,w=o.length,O=l.length,q={};++v<w;){var M=v<O?l[v]:t;d(q,o[v],M)}return q}function Qy(o){return Tt(o)?o:[]}function Zy(o){return typeof o=="function"?o:Or}function $s(o,l){return Ce(o)?o:av(o,l)?[o]:pE(Qe(o))}var VA=qe;function Ms(o,l,d){var v=o.length;return d=d===t?v:d,!l&&d>=v?o:ln(o,l,d)}var jw=uy||function(o){return Nt.clearTimeout(o)};function Uw(o,l){if(l)return o.slice();var d=o.length,v=Nd?Nd(d):new o.constructor(d);return o.copy(v),v}function Xy(o){var l=new o.constructor(o.byteLength);return new Ya(l).set(new Ya(o)),l}function WA(o,l){var d=l?Xy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function YA(o){var l=new o.constructor(o.source,ii.exec(o));return l.lastIndex=o.lastIndex,l}function JA(o){return $o?Te($o.call(o)):{}}function Bw(o,l){var d=l?Xy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function Hw(o,l){if(o!==l){var d=o!==t,v=o===null,w=o===o,O=Wr(o),q=l!==t,M=l===null,B=l===l,G=Wr(l);if(!M&&!G&&!O&&o>l||O&&q&&B&&!M&&!G||v&&q&&B||!d&&B||!w)return 1;if(!v&&!O&&!G&&o<l||G&&d&&w&&!v&&!O||M&&d&&w||!q&&w||!B)return-1}return 0}function zA(o,l,d){for(var v=-1,w=o.criteria,O=l.criteria,q=w.length,M=d.length;++v<q;){var B=Hw(w[v],O[v]);if(B){if(v>=M)return B;var G=d[v];return B*(G=="desc"?-1:1)}}return o.index-l.index}function Vw(o,l,d,v){for(var w=-1,O=o.length,q=d.length,M=-1,B=l.length,G=xt(O-q,0),Q=H(B+G),X=!v;++M<B;)Q[M]=l[M];for(;++w<q;)(X||w<O)&&(Q[d[w]]=o[w]);for(;G--;)Q[M++]=o[w++];return Q}function Ww(o,l,d,v){for(var w=-1,O=o.length,q=-1,M=d.length,B=-1,G=l.length,Q=xt(O-M,0),X=H(Q+G),re=!v;++w<Q;)X[w]=o[w];for(var ue=w;++B<G;)X[ue+B]=l[B];for(;++q<M;)(re||w<O)&&(X[ue+d[q]]=o[w++]);return X}function xr(o,l){var d=-1,v=o.length;for(l||(l=H(v));++d<v;)l[d]=o[d];return l}function pi(o,l,d,v){var w=!d;d||(d={});for(var O=-1,q=l.length;++O<q;){var M=l[O],B=v?v(d[M],o[M],M,d,o):t;B===t&&(B=o[M]),w?qn(d,M,B):Mo(d,M,B)}return d}function KA(o,l){return pi(o,ov(o),l)}function GA(o,l){return pi(o,iE(o),l)}function sh(o,l){return function(d,v){var w=Ce(d)?jg:My,O=l?l():{};return w(d,o,pe(v,2),O)}}function ol(o){return qe(function(l,d){var v=-1,w=d.length,O=w>1?d[w-1]:t,q=w>2?d[2]:t;for(O=o.length>3&&typeof O=="function"?(w--,O):t,q&&gr(d[0],d[1],q)&&(O=w<3?t:O,w=1),l=Te(l);++v<w;){var M=d[v];M&&o(l,M,v,O)}return l})}function Yw(o,l){return function(d,v){if(d==null)return d;if(!Rr(d))return o(d,v);for(var w=d.length,O=l?w:-1,q=Te(d);(l?O--:++O<w)&&v(q[O],O,q)!==!1;);return d}}function Jw(o){return function(l,d,v){for(var w=-1,O=Te(l),q=v(l),M=q.length;M--;){var B=q[o?M:++w];if(d(O[B],B,O)===!1)break}return l}}function QA(o,l,d){var v=l&C,w=uc(o);function O(){var q=this&&this!==Nt&&this instanceof O?w:o;return q.apply(v?d:this,arguments)}return O}function zw(o){return function(l){l=Qe(l);var d=tn(l)?pr(l):t,v=d?d[0]:l.charAt(0),w=d?Ms(d,1).join(""):l.slice(1);return v[o]()+w}}function al(o){return function(l){return Vu(YE(WE(l).replace(kg,"")),o,"")}}function uc(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var d=As(o.prototype),v=o.apply(d,l);return bt(v)?v:d}}function ZA(o,l,d){var v=uc(o);function w(){for(var O=arguments.length,q=H(O),M=O,B=ll(w);M--;)q[M]=arguments[M];var G=O<3&&q[0]!==B&&q[O-1]!==B?[]:Br(q,B);if(O-=G.length,O<d)return Xw(o,l,oh,w.placeholder,t,q,G,t,t,d-O);var Q=this&&this!==Nt&&this instanceof w?v:o;return zt(Q,this,q)}return w}function Kw(o){return function(l,d,v){var w=Te(l);if(!Rr(l)){var O=pe(d,3);l=Yt(l),d=function(M){return O(w[M],M,w)}}var q=o(l,d,v);return q>-1?w[O?l[q]:q]:t}}function Gw(o){return Hi(function(l){var d=l.length,v=d,w=Er.prototype.thru;for(o&&l.reverse();v--;){var O=l[v];if(typeof O!="function")throw new wr(i);if(w&&!q&&ch(O)=="wrapper")var q=new Er([],!0)}for(v=q?v:d;++v<d;){O=l[v];var M=ch(O),B=M=="wrapper"?iv(O):t;B&&lv(B[0])&&B[1]==(K|T|Y|ee)&&!B[4].length&&B[9]==1?q=q[ch(B[0])].apply(q,B[3]):q=O.length==1&&lv(O)?q[M]():q.thru(O)}return function(){var G=arguments,Q=G[0];if(q&&G.length==1&&Ce(Q))return q.plant(Q).value();for(var X=0,re=d?l[X].apply(this,G):Q;++X<d;)re=l[X].call(this,re);return re}})}function oh(o,l,d,v,w,O,q,M,B,G){var Q=l&K,X=l&C,re=l&x,ue=l&(T|j),me=l&k,ke=re?t:uc(o);function ge(){for(var Fe=arguments.length,Ue=H(Fe),Yr=Fe;Yr--;)Ue[Yr]=arguments[Yr];if(ue)var yr=ll(ge),Jr=Yg(Ue,yr);if(v&&(Ue=Vw(Ue,v,w,ue)),O&&(Ue=Ww(Ue,O,q,ue)),Fe-=Jr,ue&&Fe<G){var qt=Br(Ue,yr);return Xw(o,l,oh,ge.placeholder,d,Ue,qt,M,B,G-Fe)}var Dn=X?d:this,Ji=re?Dn[o]:o;return Fe=Ue.length,M?Ue=vT(Ue,M):me&&Fe>1&&Ue.reverse(),Q&&B<Fe&&(Ue.length=B),this&&this!==Nt&&this instanceof ge&&(Ji=ke||uc(Ji)),Ji.apply(Dn,Ue)}return ge}function Qw(o,l){return function(d,v){return $n(d,o,l(v),{})}}function ah(o,l){return function(d,v){var w;if(d===t&&v===t)return l;if(d!==t&&(w=d),v!==t){if(w===t)return v;typeof d=="string"||typeof v=="string"?(d=Vr(d),v=Vr(v)):(d=Nw(d),v=Nw(v)),w=o(d,v)}return w}}function ev(o){return Hi(function(l){return l=tt(l,nr(pe())),qe(function(d){var v=this;return o(l,function(w){return zt(w,v,d)})})})}function lh(o,l){l=l===t?" ":Vr(l);var d=l.length;if(d<2)return d?Jy(l,o):l;var v=Jy(l,Ka(o/li(l)));return tn(l)?Ms(pr(v),0,o).join(""):v.slice(0,o)}function XA(o,l,d,v){var w=l&C,O=uc(o);function q(){for(var M=-1,B=arguments.length,G=-1,Q=v.length,X=H(Q+B),re=this&&this!==Nt&&this instanceof q?O:o;++G<Q;)X[G]=v[G];for(;B--;)X[G++]=arguments[++M];return zt(re,w?d:this,X)}return q}function Zw(o){return function(l,d,v){return v&&typeof v!="number"&&gr(l,d,v)&&(d=v=t),l=Yi(l),d===t?(d=l,l=0):d=Yi(d),v=v===t?l<d?1:-1:Yi(v),FA(l,d,v,o)}}function uh(o){return function(l,d){return typeof l=="string"&&typeof d=="string"||(l=cn(l),d=cn(d)),o(l,d)}}function Xw(o,l,d,v,w,O,q,M,B,G){var Q=l&T,X=Q?q:t,re=Q?t:q,ue=Q?O:t,me=Q?t:O;l|=Q?Y:V,l&=~(Q?V:Y),l&A||(l&=~(C|x));var ke=[o,l,w,ue,X,me,re,M,B,G],ge=d.apply(t,ke);return lv(o)&&fE(ge,ke),ge.placeholder=v,dE(ge,o,l)}function tv(o){var l=At[o];return function(d,v){if(d=cn(d),v=v==null?0:St(xe(v),292),v&&ko(d)){var w=(Qe(d)+"e").split("e"),O=l(w[0]+"e"+(+w[1]+v));return w=(Qe(O)+"e").split("e"),+(w[0]+"e"+(+w[1]-v))}return l(d)}}var eT=Ps&&1/Rs(new Ps([,-0]))[1]==ie?function(o){return new Ps(o)}:Ev;function eE(o){return function(l){var d=ir(l);return d==rr?Qu(l):d==yt?Zg(l):Wg(l,o(l))}}function Bi(o,l,d,v,w,O,q,M){var B=l&x;if(!B&&typeof o!="function")throw new wr(i);var G=v?v.length:0;if(G||(l&=~(Y|V),v=w=t),q=q===t?q:xt(xe(q),0),M=M===t?M:xe(M),G-=w?w.length:0,l&V){var Q=v,X=w;v=w=t}var re=B?t:iv(o),ue=[o,l,d,v,w,Q,X,O,q,M];if(re&&mT(ue,re),o=ue[0],l=ue[1],d=ue[2],v=ue[3],w=ue[4],M=ue[9]=ue[9]===t?B?0:o.length:xt(ue[9]-G,0),!M&&l&(T|j)&&(l&=~(T|j)),!l||l==C)var me=QA(o,l,d);else l==T||l==j?me=ZA(o,l,M):(l==Y||l==(C|Y))&&!w.length?me=XA(o,l,d,v):me=oh.apply(t,ue);var ke=re?$w:fE;return dE(ke(me,ue),o,l)}function tE(o,l,d,v){return o===t||Nn(o,Is[d])&&!Ke.call(v,d)?l:o}function rE(o,l,d,v,w,O){return bt(o)&&bt(l)&&(O.set(l,o),Pe(o,l,t,rE,O),O.delete(l)),o}function tT(o){return dc(o)?t:o}function nE(o,l,d,v,w,O){var q=d&S,M=o.length,B=l.length;if(M!=B&&!(q&&B>M))return!1;var G=O.get(o),Q=O.get(l);if(G&&Q)return G==l&&Q==o;var X=-1,re=!0,ue=d&_?new Li:t;for(O.set(o,l),O.set(l,o);++X<M;){var me=o[X],ke=l[X];if(v)var ge=q?v(ke,me,X,l,o,O):v(me,ke,X,o,l,O);if(ge!==t){if(ge)continue;re=!1;break}if(ue){if(!Wu(l,function(Fe,Ue){if(!xs(ue,Ue)&&(me===Fe||w(me,Fe,d,v,O)))return ue.push(Ue)})){re=!1;break}}else if(!(me===ke||w(me,ke,d,v,O))){re=!1;break}}return O.delete(o),O.delete(l),re}function rT(o,l,d,v,w,O,q){switch(d){case ri:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case hs:return!(o.byteLength!=l.byteLength||!O(new Ya(o),new Ya(l)));case ft:case En:case Zr:return Nn(+o,+l);case jt:return o.name==l.name&&o.message==l.message;case fs:case Ti:return o==l+"";case rr:var M=Qu;case yt:var B=v&S;if(M||(M=Rs),o.size!=l.size&&!B)return!1;var G=q.get(o);if(G)return G==l;v|=_,q.set(o,l);var Q=nE(M(o),M(l),v,w,O,q);return q.delete(o),Q;case Oa:if($o)return $o.call(o)==$o.call(l)}return!1}function nT(o,l,d,v,w,O){var q=d&S,M=rv(o),B=M.length,G=rv(l),Q=G.length;if(B!=Q&&!q)return!1;for(var X=B;X--;){var re=M[X];if(!(q?re in l:Ke.call(l,re)))return!1}var ue=O.get(o),me=O.get(l);if(ue&&me)return ue==l&&me==o;var ke=!0;O.set(o,l),O.set(l,o);for(var ge=q;++X<B;){re=M[X];var Fe=o[re],Ue=l[re];if(v)var Yr=q?v(Ue,Fe,re,l,o,O):v(Fe,Ue,re,o,l,O);if(!(Yr===t?Fe===Ue||w(Fe,Ue,d,v,O):Yr)){ke=!1;break}ge||(ge=re=="constructor")}if(ke&&!ge){var yr=o.constructor,Jr=l.constructor;yr!=Jr&&"constructor"in o&&"constructor"in l&&!(typeof yr=="function"&&yr instanceof yr&&typeof Jr=="function"&&Jr instanceof Jr)&&(ke=!1)}return O.delete(o),O.delete(l),ke}function Hi(o){return cv(uE(o,t,vE),o+"")}function rv(o){return th(o,Yt,ov)}function nv(o){return th(o,Ir,iE)}var iv=Za?function(o){return Za.get(o)}:Ev;function ch(o){for(var l=o.name+"",d=ks[l],v=Ke.call(ks,l)?d.length:0;v--;){var w=d[v],O=w.func;if(O==null||O==o)return w.name}return l}function ll(o){var l=Ke.call(I,"placeholder")?I:o;return l.placeholder}function pe(){var o=I.iteratee||_v;return o=o===_v?y:o,arguments.length?o(arguments[0],arguments[1]):o}function fh(o,l){var d=o.__data__;return fT(l)?d[typeof l=="string"?"string":"hash"]:d.map}function sv(o){for(var l=Yt(o),d=l.length;d--;){var v=l[d],w=o[v];l[d]=[v,w,aE(w)]}return l}function Fo(o,l){var d=Kg(o,l);return Do(d)?d:t}function iT(o){var l=Ke.call(o,Fi),d=o[Fi];try{o[Fi]=t;var v=!0}catch{}var w=Va.call(o);return v&&(l?o[Fi]=d:delete o[Fi]),w}var ov=Ga?function(o){return o==null?[]:(o=Te(o),ai(Ga(o),function(l){return Fd.call(o,l)}))}:Cv,iE=Ga?function(o){for(var l=[];o;)en(l,ov(o)),o=Ja(o);return l}:Cv,ir=Kt;(Zu&&ir(new Zu(new ArrayBuffer(1)))!=ri||Ao&&ir(new Ao)!=rr||Xu&&ir(Xu.resolve())!=Gf||Ps&&ir(new Ps)!=yt||To&&ir(new To)!=ds)&&(ir=function(o){var l=Kt(o),d=l==Cn?o.constructor:t,v=d?Lo(d):"";if(v)switch(v){case hy:return ri;case py:return rr;case my:return Gf;case gy:return yt;case yy:return ds}return l});function sT(o,l,d){for(var v=-1,w=d.length;++v<w;){var O=d[v],q=O.size;switch(O.type){case"drop":o+=q;break;case"dropRight":l-=q;break;case"take":l=St(l,o+q);break;case"takeRight":o=xt(o,l-q);break}}return{start:o,end:l}}function oT(o){var l=o.match(Vt);return l?l[1].split(Rn):[]}function sE(o,l,d){l=$s(l,o);for(var v=-1,w=l.length,O=!1;++v<w;){var q=mi(l[v]);if(!(O=o!=null&&d(o,q)))break;o=o[q]}return O||++v!=w?O:(w=o==null?0:o.length,!!w&&vh(w)&&Vi(q,w)&&(Ce(o)||jo(o)))}function aT(o){var l=o.length,d=new o.constructor(l);return l&&typeof o[0]=="string"&&Ke.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function oE(o){return typeof o.constructor=="function"&&!cc(o)?As(Ja(o)):{}}function lT(o,l,d){var v=o.constructor;switch(l){case hs:return Xy(o);case ft:case En:return new v(+o);case ri:return WA(o,d);case ps:case et:case Pa:case ka:case ms:case bo:case gs:case ni:case ys:return Bw(o,d);case rr:return new v;case Zr:case Ti:return new v(o);case fs:return YA(o);case yt:return new v;case Oa:return JA(o)}}function uT(o,l){var d=l.length;if(!d)return o;var v=d-1;return l[v]=(d>1?"& ":"")+l[v],l=l.join(d>2?", ":" "),o.replace(qa,`{
|
|
1
|
+
"use strict";var LN=Object.create;var wh=Object.defineProperty;var jN=Object.getOwnPropertyDescriptor;var UN=Object.getOwnPropertyNames;var BN=Object.getPrototypeOf,HN=Object.prototype.hasOwnProperty;var F=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},VN=(t,e)=>{for(var r in e)wh(t,r,{get:e[r],enumerable:!0})},QE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of UN(e))!HN.call(t,i)&&i!==r&&wh(t,i,{get:()=>e[i],enumerable:!(n=jN(e,i))||n.enumerable});return t};var Se=(t,e,r)=>(r=t!=null?LN(BN(t)):{},QE(e||!t||!t.__esModule?wh(r,"default",{value:t,enumerable:!0}):r,t)),WN=t=>QE(wh({},"__esModule",{value:!0}),t);var cx=F((Rl,kc)=>{(function(){var t,e="4.18.1",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",a="Invalid `imports` option passed into `_.template`",u="__lodash_hash_undefined__",f=500,h="__lodash_placeholder__",g=1,m=2,S=4,E=1,x=2,C=1,A=2,T=4,B=8,Y=16,H=32,K=64,X=128,k=256,w=512,P=30,N="...",D=800,L=16,z=1,Z=2,ae=3,de=1/0,nt=9007199254740991,Ie=17976931348623157e292,ge=NaN,Te=4294967295,wt=Te-1,Tt=Te>>>1,le=[["ary",X],["bind",C],["bindKey",A],["curry",B],["curryRight",Y],["flip",w],["partial",H],["partialRight",K],["rearg",k]],Xr="[object Arguments]",os="[object Array]",Et="[object AsyncFunction]",Cn="[object Boolean]",en="[object Date]",er="[object DOMException]",ht="[object Error]",tn="[object Function]",uo="[object GeneratorFunction]",Ht="[object Map]",co="[object Number]",ug="[object Null]",Rn="[object Object]",ad="[object Promise]",ld="[object Proxy]",Vt="[object RegExp]",dr="[object Set]",fo="[object String]",Oa="[object Symbol]",ud="[object Undefined]",Ft="[object WeakMap]",cd="[object WeakSet]",Oi="[object ArrayBuffer]",In="[object DataView]",it="[object Float32Array]",Pa="[object Float64Array]",ka="[object Int8Array]",as="[object Int16Array]",ho="[object Int32Array]",ls="[object Uint8Array]",ni="[object Uint8ClampedArray]",us="[object Uint16Array]",Bu="[object Uint32Array]",Aa=/\b__p \+= '';/g,cg=/\b(__p \+=) '' \+/g,po=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Pi=/&(?:amp|lt|gt|quot|#39);/g,Ta=/[&<>"']/g,qa=RegExp(Pi.source),oe=RegExp(Ta.source),fg=/<%-([\s\S]+?)%>/g,dg=/<%([\s\S]+?)%>/g,rn=/<%=([\s\S]+?)%>/g,xr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qe=/^\w*$/,Hu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ge=/[\\^$.*+?()[\]{}|]/g,mo=RegExp(Ge.source),Vu=/^\s+/,$a=/\s/,Wt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,On=/\{\n\/\* \[wrapped with (.+)\] \*/,nn=/,? & /,Ot=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Cr=/[()=,{}\[\]\/\s]/,Pn=/\\(\\)?/g,ki=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fd=/\w*$/,hg=/^[-+]0x[0-9a-f]+$/i,go=/^0b[01]+$/i,dd=/^\[object .+?Constructor\]$/,pg=/^0o[0-7]+$/i,cs=/^(?:0|[1-9]\d*)$/,yo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vo=/($^)/,mg=/['\n\r\u2028\u2029\\]/g,Ma="\\ud800-\\udfff",gg="\\u0300-\\u036f",St="\\ufe20-\\ufe2f",Wu="\\u20d0-\\u20ff",hd=gg+St+Wu,Yu="\\u2700-\\u27bf",Ju="a-z\\xdf-\\xf6\\xf8-\\xff",yg="\\xac\\xb1\\xd7\\xf7",vg="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Sg="\\u2000-\\u206f",bg=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pd="A-Z\\xc0-\\xd6\\xd8-\\xde",md="\\ufe0e\\ufe0f",zu=yg+vg+Sg+bg,Na="['\u2019]",_g="["+Ma+"]",gd="["+zu+"]",Da="["+hd+"]",Ku="\\d+",wg="["+Yu+"]",fs="["+Ju+"]",So="[^"+Ma+zu+Ku+Yu+Ju+pd+"]",Fa="\\ud83c[\\udffb-\\udfff]",bo="(?:"+Da+"|"+Fa+")",sn="[^"+Ma+"]",Gu="(?:\\ud83c[\\udde6-\\uddff]){2}",Qu="[\\ud800-\\udbff][\\udc00-\\udfff]",ds="["+pd+"]",yd="\\u200d",vd="(?:"+fs+"|"+So+")",Eg="(?:"+ds+"|"+So+")",Sd="(?:"+Na+"(?:d|ll|m|re|s|t|ve))?",bd="(?:"+Na+"(?:D|LL|M|RE|S|T|VE))?",La=bo+"?",_d="["+md+"]?",wd="(?:"+yd+"(?:"+[sn,Gu,Qu].join("|")+")"+_d+La+")*",xg="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Cg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ed=_d+La+wd,Rg="(?:"+[wg,Gu,Qu].join("|")+")"+Ed,Ig="(?:"+[sn+Da+"?",Da,Gu,Qu,_g].join("|")+")",Og=RegExp(Na,"g"),Pg=RegExp(Da,"g"),Zu=RegExp(Fa+"(?="+Fa+")|"+Ig+Ed,"g"),kg=RegExp([ds+"?"+fs+"+"+Sd+"(?="+[gd,ds,"$"].join("|")+")",Eg+"+"+bd+"(?="+[gd,ds+vd,"$"].join("|")+")",ds+"?"+vd+"+"+Sd,ds+"+"+bd,Cg,xg,Ku,Rg].join("|"),"g"),Ag=RegExp("["+yd+Ma+hd+md+"]"),Tg=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qg=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$g=-1,ft={};ft[it]=ft[Pa]=ft[ka]=ft[as]=ft[ho]=ft[ls]=ft[ni]=ft[us]=ft[Bu]=!0,ft[Xr]=ft[os]=ft[Oi]=ft[Cn]=ft[In]=ft[en]=ft[ht]=ft[tn]=ft[Ht]=ft[co]=ft[Rn]=ft[Vt]=ft[dr]=ft[fo]=ft[Ft]=!1;var ot={};ot[Xr]=ot[os]=ot[Oi]=ot[In]=ot[Cn]=ot[en]=ot[it]=ot[Pa]=ot[ka]=ot[as]=ot[ho]=ot[Ht]=ot[co]=ot[Rn]=ot[Vt]=ot[dr]=ot[fo]=ot[Oa]=ot[ls]=ot[ni]=ot[us]=ot[Bu]=!0,ot[ht]=ot[tn]=ot[Ft]=!1;var Xu={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},ec={"&":"&","<":"<",">":">",'"':""","'":"'"},Mg={"&":"&","<":"<",">":">",""":'"',"'":"'"},xd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cd=parseFloat,Ng=parseInt,Rd=typeof global=="object"&&global&&global.Object===Object&&global,Dg=typeof self=="object"&&self&&self.Object===Object&&self,qt=Rd||Dg||Function("return this")(),ja=typeof Rl=="object"&&Rl&&!Rl.nodeType&&Rl,Qe=ja&&typeof kc=="object"&&kc&&!kc.nodeType&&kc,hs=Qe&&Qe.exports===ja,Ai=hs&&Rd.process,Rr=(function(){try{var j=Qe&&Qe.require&&Qe.require("util").types;return j||Ai&&Ai.binding&&Ai.binding("util")}catch{}})(),tc=Rr&&Rr.isArrayBuffer,Id=Rr&&Rr.isDate,Od=Rr&&Rr.isMap,_o=Rr&&Rr.isRegExp,kn=Rr&&Rr.isSet,Ua=Rr&&Rr.isTypedArray;function hr(j,J,V){switch(V.length){case 0:return j.call(J);case 1:return j.call(J,V[0]);case 2:return j.call(J,V[0],V[1]);case 3:return j.call(J,V[0],V[1],V[2])}return j.apply(J,V)}function An(j,J,V,se){for(var ve=-1,ze=j==null?0:j.length;++ve<ze;){var et=j[ve];J(se,et,V(et),j)}return se}function pr(j,J){for(var V=-1,se=j==null?0:j.length;++V<se&&J(j[V],V,j)!==!1;);return j}function rc(j,J){for(var V=j==null?0:j.length;V--&&J(j[V],V,j)!==!1;);return j}function Pd(j,J){for(var V=-1,se=j==null?0:j.length;++V<se;)if(!J(j[V],V,j))return!1;return!0}function ii(j,J){for(var V=-1,se=j==null?0:j.length,ve=0,ze=[];++V<se;){var et=j[V];J(et,V,j)&&(ze[ve++]=et)}return ze}function Ba(j,J){var V=j==null?0:j.length;return!!V&&Ti(j,J,0)>-1}function ps(j,J,V){for(var se=-1,ve=j==null?0:j.length;++se<ve;)if(V(J,j[se]))return!0;return!1}function at(j,J){for(var V=-1,se=j==null?0:j.length,ve=Array(se);++V<se;)ve[V]=J(j[V],V,j);return ve}function si(j,J){for(var V=-1,se=J.length,ve=j.length;++V<se;)j[ve+V]=J[V];return j}function nc(j,J,V,se){var ve=-1,ze=j==null?0:j.length;for(se&&ze&&(V=j[++ve]);++ve<ze;)V=J(V,j[ve],ve,j);return V}function Fg(j,J,V,se){var ve=j==null?0:j.length;for(se&&ve&&(V=j[--ve]);ve--;)V=J(V,j[ve],ve,j);return V}function Ha(j,J){for(var V=-1,se=j==null?0:j.length;++V<se;)if(J(j[V],V,j))return!0;return!1}var Lg=wo("length");function jg(j){return j.split("")}function Ug(j){return j.match(Ot)||[]}function kd(j,J,V){var se;return V(j,function(ve,ze,et){if(J(ve,ze,et))return se=ze,!1}),se}function Va(j,J,V,se){for(var ve=j.length,ze=V+(se?1:-1);se?ze--:++ze<ve;)if(J(j[ze],ze,j))return ze;return-1}function Ti(j,J,V){return J===J?Gg(j,J,V):Va(j,qi,V)}function Bg(j,J,V,se){for(var ve=V-1,ze=j.length;++ve<ze;)if(se(j[ve],J))return ve;return-1}function qi(j){return j!==j}function Ad(j,J){var V=j==null?0:j.length;return V?sc(j,J)/V:ge}function wo(j){return function(J){return J==null?t:J[j]}}function ic(j){return function(J){return j==null?t:j[J]}}function Wa(j,J,V,se,ve){return ve(j,function(ze,et,Ue){V=se?(se=!1,ze):J(V,ze,et,Ue)}),V}function Hg(j,J){var V=j.length;for(j.sort(J);V--;)j[V]=j[V].value;return j}function sc(j,J){for(var V,se=-1,ve=j.length;++se<ve;){var ze=J(j[se]);ze!==t&&(V=V===t?ze:V+ze)}return V}function oc(j,J){for(var V=-1,se=Array(j);++V<j;)se[V]=J(V);return se}function Vg(j,J){return at(J,function(V){return[V,j[V]]})}function ac(j){return j&&j.slice(0,Nd(j)+1).replace(Vu,"")}function mr(j){return function(J){return j(J)}}function Ya(j,J){return at(J,function(V){return j[V]})}function Xe(j,J){return j.has(J)}function Td(j,J){for(var V=-1,se=j.length;++V<se&&Ti(J,j[V],0)>-1;);return V}function qd(j,J){for(var V=j.length;V--&&Ti(J,j[V],0)>-1;);return V}function $d(j,J){for(var V=j.length,se=0;V--;)j[V]===J&&++se;return se}var Wg=ic(Xu),Yg=ic(ec);function Jg(j){return"\\"+xd[j]}function Eo(j,J){return j==null?t:j[J]}function ms(j){return Ag.test(j)}function zg(j){return Tg.test(j)}function Kg(j){for(var J,V=[];!(J=j.next()).done;)V.push(J.value);return V}function gs(j){var J=-1,V=Array(j.size);return j.forEach(function(se,ve){V[++J]=[ve,se]}),V}function xo(j,J){return function(V){return j(J(V))}}function on(j,J){for(var V=-1,se=j.length,ve=0,ze=[];++V<se;){var et=j[V];(et===J||et===h)&&(j[V]=h,ze[ve++]=V)}return ze}function Ja(j){var J=-1,V=Array(j.size);return j.forEach(function(se){V[++J]=se}),V}function Md(j){var J=-1,V=Array(j.size);return j.forEach(function(se){V[++J]=[se,se]}),V}function Gg(j,J,V){for(var se=V-1,ve=j.length;++se<ve;)if(j[se]===J)return se;return-1}function lc(j,J,V){for(var se=V+1;se--;)if(j[se]===J)return se;return se}function oi(j){return ms(j)?Zg(j):Lg(j)}function gr(j){return ms(j)?Xg(j):jg(j)}function Nd(j){for(var J=j.length;J--&&$a.test(j.charAt(J)););return J}var Qg=ic(Mg);function Zg(j){for(var J=Zu.lastIndex=0;Zu.test(j);)++J;return J}function Xg(j){return j.match(Zu)||[]}function ey(j){return j.match(kg)||[]}var ty=(function j(J){J=J==null?qt:ai.defaults(qt.Object(),J,ai.pick(qt,qg));var V=J.Array,se=J.Date,ve=J.Error,ze=J.Function,et=J.Math,Ue=J.Object,za=J.RegExp,ry=J.String,yr=J.TypeError,Co=V.prototype,ny=ze.prototype,ys=Ue.prototype,Ro=J["__core-js_shared__"],Ka=ny.toString,Ze=ys.hasOwnProperty,iy=0,Dd=(function(){var o=/[^.]+$/.exec(Ro&&Ro.keys&&Ro.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Ga=ys.toString,sy=Ka.call(Ue),oy=qt._,ay=za("^"+Ka.call(Ze).replace(Ge,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qa=hs?J.Buffer:t,li=J.Symbol,Za=J.Uint8Array,Fd=Qa?Qa.allocUnsafe:t,Xa=xo(Ue.getPrototypeOf,Ue),Ld=Ue.create,Io=ys.propertyIsEnumerable,el=Co.splice,jd=li?li.isConcatSpreadable:t,Oo=li?li.iterator:t,$i=li?li.toStringTag:t,tl=(function(){try{var o=Fo(Ue,"defineProperty");return o({},"",{}),o}catch{}})(),ly=J.clearTimeout!==qt.clearTimeout&&J.clearTimeout,uy=se&&se.now!==qt.Date.now&&se.now,cy=J.setTimeout!==qt.setTimeout&&J.setTimeout,Po=et.ceil,ko=et.floor,rl=Ue.getOwnPropertySymbols,nl=Qa?Qa.isBuffer:t,Mi=J.isFinite,il=Co.join,Ud=xo(Ue.keys,Ue),pt=et.max,Lt=et.min,Bd=se.now,fy=J.parseInt,Hd=et.random,dy=Co.reverse,uc=Fo(J,"DataView"),Ao=Fo(J,"Map"),cc=Fo(J,"Promise"),vs=Fo(J,"Set"),To=Fo(J,"WeakMap"),qo=Fo(Ue,"create"),sl=To&&new To,Ss={},hy=Lo(uc),py=Lo(Ao),my=Lo(cc),gy=Lo(vs),yy=Lo(To),ol=li?li.prototype:t,$o=ol?ol.valueOf:t,Vd=ol?ol.toString:t;function I(o){if(xt(o)&&!Ee(o)&&!(o instanceof $e)){if(o instanceof tr)return o;if(Ze.call(o,"__wrapped__"))return mE(o)}return new tr(o)}var bs=(function(){function o(){}return function(l){if(!bt(l))return{};if(Ld)return Ld(l);o.prototype=l;var d=new o;return o.prototype=t,d}})();function al(){}function tr(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}I.templateSettings={escape:fg,evaluate:dg,interpolate:rn,variable:"",imports:{_:I}},I.prototype=al.prototype,I.prototype.constructor=I,tr.prototype=bs(al.prototype),tr.prototype.constructor=tr;function $e(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Te,this.__views__=[]}function vy(){var o=new $e(this.__wrapped__);return o.__actions__=Ir(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Ir(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Ir(this.__views__),o}function Sy(){if(this.__filtered__){var o=new $e(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function fc(){var o=this.__wrapped__.value(),l=this.__dir__,d=Ee(o),y=l<0,_=d?o.length:0,O=hT(0,_,this.__views__),q=O.start,M=O.end,U=M-q,G=y?M:q-1,Q=this.__iteratees__,ee=Q.length,re=0,ue=Lt(U,this.__takeCount__);if(!d||!y&&_==U&&ue==U)return Fw(o,this.__actions__);var me=[];e:for(;U--&&re<ue;){G+=l;for(var Oe=-1,he=o[G];++Oe<ee;){var Le=Q[Oe],Be=Le.iteratee,Jr=Le.type,br=Be(he);if(Jr==Z)he=br;else if(!br){if(Jr==z)continue e;break e}}me[re++]=he}return me}$e.prototype=bs(al.prototype),$e.prototype.constructor=$e;function an(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var y=o[l];this.set(y[0],y[1])}}function by(){this.__data__=qo?qo(null):{},this.size=0}function _y(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function wy(o){var l=this.__data__;if(qo){var d=l[o];return d===u?t:d}return Ze.call(l,o)?l[o]:t}function Ey(o){var l=this.__data__;return qo?l[o]!==t:Ze.call(l,o)}function xy(o,l){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=qo&&l===t?u:l,this}an.prototype.clear=by,an.prototype.delete=_y,an.prototype.get=wy,an.prototype.has=Ey,an.prototype.set=xy;function Tn(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var y=o[l];this.set(y[0],y[1])}}function Wd(){this.__data__=[],this.size=0}function Cy(o){var l=this.__data__,d=ul(l,o);if(d<0)return!1;var y=l.length-1;return d==y?l.pop():el.call(l,d,1),--this.size,!0}function Ry(o){var l=this.__data__,d=ul(l,o);return d<0?t:l[d][1]}function Yd(o){return ul(this.__data__,o)>-1}function Iy(o,l){var d=this.__data__,y=ul(d,o);return y<0?(++this.size,d.push([o,l])):d[y][1]=l,this}Tn.prototype.clear=Wd,Tn.prototype.delete=Cy,Tn.prototype.get=Ry,Tn.prototype.has=Yd,Tn.prototype.set=Iy;function qn(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var y=o[l];this.set(y[0],y[1])}}function Oy(){this.size=0,this.__data__={hash:new an,map:new(Ao||Tn),string:new an}}function ui(o){var l=hh(this,o).delete(o);return this.size-=l?1:0,l}function Jd(o){return hh(this,o).get(o)}function Py(o){return hh(this,o).has(o)}function ky(o,l){var d=hh(this,o),y=d.size;return d.set(o,l),this.size+=d.size==y?0:1,this}qn.prototype.clear=Oy,qn.prototype.delete=ui,qn.prototype.get=Jd,qn.prototype.has=Py,qn.prototype.set=ky;function Ni(o){var l=-1,d=o==null?0:o.length;for(this.__data__=new qn;++l<d;)this.add(o[l])}function te(o){return this.__data__.set(o,u),this}function Ay(o){return this.__data__.has(o)}Ni.prototype.add=Ni.prototype.push=te,Ni.prototype.has=Ay;function Br(o){var l=this.__data__=new Tn(o);this.size=l.size}function zd(){this.__data__=new Tn,this.size=0}function Ve(o){var l=this.__data__,d=l.delete(o);return this.size=l.size,d}function ll(o){return this.__data__.get(o)}function Kd(o){return this.__data__.has(o)}function dc(o,l){var d=this.__data__;if(d instanceof Tn){var y=d.__data__;if(!Ao||y.length<r-1)return y.push([o,l]),this.size=++d.size,this;d=this.__data__=new qn(y)}return d.set(o,l),this.size=d.size,this}Br.prototype.clear=zd,Br.prototype.delete=Ve,Br.prototype.get=ll,Br.prototype.has=Kd,Br.prototype.set=dc;function Gd(o,l){var d=Ee(o),y=!d&&jo(o),_=!d&&!y&&Is(o),O=!d&&!y&&!_&&ml(o),q=d||y||_||O,M=q?oc(o.length,ry):[],U=M.length;for(var G in o)(l||Ze.call(o,G))&&!(q&&(G=="length"||_&&(G=="offset"||G=="parent")||O&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||ji(G,U)))&&M.push(G);return M}function Qd(o){var l=o.length;return l?o[Vy(0,l-1)]:t}function Ty(o,l){return ph(Ir(o),ci(l,0,o.length))}function qy(o){return ph(Ir(o))}function hc(o,l,d){(d!==t&&!Fn(o[l],d)||d===t&&!(l in o))&&Hr(o,l,d)}function vr(o,l,d){var y=o[l];(!(Ze.call(o,l)&&Fn(y,d))||d===t&&!(l in o))&&Hr(o,l,d)}function ul(o,l){for(var d=o.length;d--;)if(Fn(o[d][0],l))return d;return-1}function Zd(o,l,d,y){return fi(o,function(_,O,q){l(y,_,d(_),q)}),y}function Xd(o,l){return o&&di(l,Yt(l),o)}function $y(o,l){return o&&di(l,Pr(l),o)}function Hr(o,l,d){l=="__proto__"&&tl?tl(o,l,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[l]=d}function pc(o,l){for(var d=-1,y=l.length,_=V(y),O=o==null;++d<y;)_[d]=O?t:gv(o,l[d]);return _}function ci(o,l,d){return o===o&&(d!==t&&(o=o<=d?o:d),l!==t&&(o=o>=l?o:l)),o}function rr(o,l,d,y,_,O){var q,M=l&g,U=l&m,G=l&S;if(d&&(q=_?d(o,y,_,O):d(o)),q!==t)return q;if(!bt(o))return o;var Q=Ee(o);if(Q){if(q=mT(o),!M)return Ir(o,q)}else{var ee=nr(o),re=ee==tn||ee==uo;if(Is(o))return Uw(o,M);if(ee==Rn||ee==Xr||re&&!_){if(q=U||re?{}:oE(o),!M)return U?iT(o,$y(q,o)):nT(o,Xd(q,o))}else{if(!ot[ee])return _?o:{};q=gT(o,ee,M)}}O||(O=new Br);var ue=O.get(o);if(ue)return ue;O.set(o,q),ME(o)?o.forEach(function(he){q.add(rr(he,l,d,he,o,O))}):qE(o)&&o.forEach(function(he,Le){q.set(Le,rr(he,l,d,Le,o,O))});var me=G?U?tv:ev:U?Pr:Yt,Oe=Q?t:me(o);return pr(Oe||o,function(he,Le){Oe&&(Le=he,he=o[Le]),vr(q,Le,rr(he,l,d,Le,o,O))}),q}function My(o){var l=Yt(o);return function(d){return ln(d,o,l)}}function ln(o,l,d){var y=d.length;if(o==null)return!y;for(o=Ue(o);y--;){var _=d[y],O=l[_],q=o[_];if(q===t&&!(_ in o)||!O(q))return!1}return!0}function mc(o,l,d){if(typeof o!="function")throw new yr(i);return wc(function(){o.apply(t,d)},l)}function Mo(o,l,d,y){var _=-1,O=Ba,q=!0,M=o.length,U=[],G=l.length;if(!M)return U;d&&(l=at(l,mr(d))),y?(O=ps,q=!1):l.length>=r&&(O=Xe,q=!1,l=new Ni(l));e:for(;++_<M;){var Q=o[_],ee=d==null?Q:d(Q);if(Q=y||Q!==0?Q:0,q&&ee===ee){for(var re=G;re--;)if(l[re]===ee)continue e;U.push(Q)}else O(l,ee,y)||U.push(Q)}return U}var fi=Yw(un),eh=Yw($n,!0);function Ny(o,l){var d=!0;return fi(o,function(y,_,O){return d=!!l(y,_,O),d}),d}function cl(o,l,d){for(var y=-1,_=o.length;++y<_;){var O=o[y],q=l(O);if(q!=null&&(M===t?q===q&&!Yr(q):d(q,M)))var M=q,U=O}return U}function Dy(o,l,d,y){var _=o.length;for(d=xe(d),d<0&&(d=-d>_?0:_+d),y=y===t||y>_?_:xe(y),y<0&&(y+=_),y=d>y?0:DE(y);d<y;)o[d++]=l;return o}function th(o,l){var d=[];return fi(o,function(y,_,O){l(y,_,O)&&d.push(y)}),d}function jt(o,l,d,y,_){var O=-1,q=o.length;for(d||(d=vT),_||(_=[]);++O<q;){var M=o[O];l>0&&d(M)?l>1?jt(M,l-1,d,y,_):si(_,M):y||(_[_.length]=M)}return _}var gc=Jw(),rh=Jw(!0);function un(o,l){return o&&gc(o,l,Yt)}function $n(o,l){return o&&rh(o,l,Yt)}function fl(o,l){return ii(l,function(d){return Ui(o[d])})}function Di(o,l){l=Cs(l,o);for(var d=0,y=l.length;o!=null&&d<y;)o=o[Dn(l[d++])];return d&&d==y?o:t}function nh(o,l,d){var y=l(o);return Ee(o)?y:si(y,d(o))}function zt(o){return o==null?o===t?ud:ug:$i&&$i in Ue(o)?dT(o):CT(o)}function yc(o,l){return o>l}function Fy(o,l){return o!=null&&Ze.call(o,l)}function Ly(o,l){return o!=null&&l in Ue(o)}function jy(o,l,d){return o>=Lt(l,d)&&o<pt(l,d)}function Vr(o,l,d){for(var y=d?ps:Ba,_=o[0].length,O=o.length,q=O,M=V(O),U=1/0,G=[];q--;){var Q=o[q];q&&l&&(Q=at(Q,mr(l))),U=Lt(Q.length,U),M[q]=!d&&(l||_>=120&&Q.length>=120)?new Ni(q&&Q):t}Q=o[0];var ee=-1,re=M[0];e:for(;++ee<_&&G.length<U;){var ue=Q[ee],me=l?l(ue):ue;if(ue=d||ue!==0?ue:0,!(re?Xe(re,me):y(G,me,d))){for(q=O;--q;){var Oe=M[q];if(!(Oe?Xe(Oe,me):y(o[q],me,d)))continue e}re&&re.push(me),G.push(ue)}}return G}function _s(o,l,d,y){return un(o,function(_,O,q){l(y,d(_),O,q)}),y}function No(o,l,d){l=Cs(l,o),o=cE(o,l);var y=o==null?o:o[Dn(fn(l))];return y==null?t:hr(y,o,d)}function ih(o){return xt(o)&&zt(o)==Xr}function Uy(o){return xt(o)&&zt(o)==Oi}function By(o){return xt(o)&&zt(o)==en}function Do(o,l,d,y,_){return o===l?!0:o==null||l==null||!xt(o)&&!xt(l)?o!==o&&l!==l:vc(o,l,d,y,Do,_)}function vc(o,l,d,y,_,O){var q=Ee(o),M=Ee(l),U=q?os:nr(o),G=M?os:nr(l);U=U==Xr?Rn:U,G=G==Xr?Rn:G;var Q=U==Rn,ee=G==Rn,re=U==G;if(re&&Is(o)){if(!Is(l))return!1;q=!0,Q=!1}if(re&&!Q)return O||(O=new Br),q||ml(o)?nE(o,l,d,y,_,O):cT(o,l,U,d,y,_,O);if(!(d&E)){var ue=Q&&Ze.call(o,"__wrapped__"),me=ee&&Ze.call(l,"__wrapped__");if(ue||me){var Oe=ue?o.value():o,he=me?l.value():l;return O||(O=new Br),_(Oe,he,d,y,O)}}return re?(O||(O=new Br),fT(o,l,d,y,_,O)):!1}function ws(o){return xt(o)&&nr(o)==Ht}function Es(o,l,d,y){var _=d.length,O=_,q=!y;if(o==null)return!O;for(o=Ue(o);_--;){var M=d[_];if(q&&M[2]?M[1]!==o[M[0]]:!(M[0]in o))return!1}for(;++_<O;){M=d[_];var U=M[0],G=o[U],Q=M[1];if(q&&M[2]){if(G===t&&!(U in o))return!1}else{var ee=new Br;if(y)var re=y(G,Q,U,o,l,ee);if(!(re===t?Do(Q,G,E|x,y,ee):re))return!1}}return!0}function Fe(o){if(!bt(o)||bT(o))return!1;var l=Ui(o)?ay:dd;return l.test(Lo(o))}function c(o){return xt(o)&&zt(o)==Vt}function p(o){return xt(o)&&nr(o)==dr}function v(o){return xt(o)&&bh(o.length)&&!!ft[zt(o)]}function b(o){return typeof o=="function"?o:o==null?kr:typeof o=="object"?Ee(o)?Me(o[0],o[1]):ye(o):KE(o)}function R(o){if(!_c(o))return Ud(o);var l=[];for(var d in Ue(o))Ze.call(o,d)&&d!="constructor"&&l.push(d);return l}function $(o){if(!bt(o))return xT(o);var l=_c(o),d=[];for(var y in o)y=="constructor"&&(l||!Ze.call(o,y))||d.push(y);return d}function W(o,l){return o<l}function ie(o,l){var d=-1,y=Or(o)?V(o.length):[];return fi(o,function(_,O,q){y[++d]=l(_,O,q)}),y}function ye(o){var l=nv(o);return l.length==1&&l[0][2]?lE(l[0][0],l[0][1]):function(d){return d===o||Es(d,o,l)}}function Me(o,l){return sv(o)&&aE(l)?lE(Dn(o),l):function(d){var y=gv(d,o);return y===t&&y===l?yv(d,o):Do(l,y,E|x)}}function $t(o,l,d,y,_){o!==l&&gc(l,function(O,q){if(_||(_=new Br),bt(O))Mn(o,l,q,d,$t,y,_);else{var M=y?y(av(o,q),O,q+"",o,l,_):t;M===t&&(M=O),hc(o,q,M)}},Pr)}function Mn(o,l,d,y,_,O,q){var M=av(o,d),U=av(l,d),G=q.get(U);if(G){hc(o,d,G);return}var Q=O?O(M,U,d+"",o,l,q):t,ee=Q===t;if(ee){var re=Ee(U),ue=!re&&Is(U),me=!re&&!ue&&ml(U);Q=U,re||ue||me?Ee(M)?Q=M:Pt(M)?Q=Ir(M):ue?(ee=!1,Q=Uw(U,!0)):me?(ee=!1,Q=Bw(U,!0)):Q=[]:Ec(U)||jo(U)?(Q=M,jo(M)?Q=FE(M):(!bt(M)||Ui(M))&&(Q=oE(U))):ee=!1}ee&&(q.set(U,Q),_(Q,U,y,O,q),q.delete(U)),hc(o,d,Q)}function Nn(o,l){var d=o.length;if(d)return l+=l<0?d:0,ji(l,d)?o[l]:t}function Aw(o,l,d){l.length?l=at(l,function(O){return Ee(O)?function(q){return Di(q,O.length===1?O[0]:O)}:O}):l=[kr];var y=-1;l=at(l,mr(pe()));var _=ie(o,function(O,q,M){var U=at(l,function(G){return G(O)});return{criteria:U,index:++y,value:O}});return Hg(_,function(O,q){return rT(O,q,d)})}function VA(o,l){return Tw(o,l,function(d,y){return yv(o,y)})}function Tw(o,l,d){for(var y=-1,_=l.length,O={};++y<_;){var q=l[y],M=Di(o,q);d(M,q)&&Sc(O,Cs(q,o),M)}return O}function WA(o){return function(l){return Di(l,o)}}function Hy(o,l,d,y){var _=y?Bg:Ti,O=-1,q=l.length,M=o;for(o===l&&(l=Ir(l)),d&&(M=at(o,mr(d)));++O<q;)for(var U=0,G=l[O],Q=d?d(G):G;(U=_(M,Q,U,y))>-1;)M!==o&&el.call(M,U,1),el.call(o,U,1);return o}function qw(o,l){for(var d=o?l.length:0,y=d-1;d--;){var _=l[d];if(d==y||_!==O){var O=_;ji(_)?el.call(o,_,1):Jy(o,_)}}return o}function Vy(o,l){return o+ko(Hd()*(l-o+1))}function YA(o,l,d,y){for(var _=-1,O=pt(Po((l-o)/(d||1)),0),q=V(O);O--;)q[y?O:++_]=o,o+=d;return q}function Wy(o,l){var d="";if(!o||l<1||l>nt)return d;do l%2&&(d+=o),l=ko(l/2),l&&(o+=o);while(l);return d}function ke(o,l){return lv(uE(o,l,kr),o+"")}function JA(o){return Qd(gl(o))}function zA(o,l){var d=gl(o);return ph(d,ci(l,0,d.length))}function Sc(o,l,d,y){if(!bt(o))return o;l=Cs(l,o);for(var _=-1,O=l.length,q=O-1,M=o;M!=null&&++_<O;){var U=Dn(l[_]),G=d;if(U==="__proto__"||U==="constructor"||U==="prototype")return o;if(_!=q){var Q=M[U];G=y?y(Q,U,M):t,G===t&&(G=bt(Q)?Q:ji(l[_+1])?[]:{})}vr(M,U,G),M=M[U]}return o}var $w=sl?function(o,l){return sl.set(o,l),o}:kr,KA=tl?function(o,l){return tl(o,"toString",{configurable:!0,enumerable:!1,value:Sv(l),writable:!0})}:kr;function GA(o){return ph(gl(o))}function cn(o,l,d){var y=-1,_=o.length;l<0&&(l=-l>_?0:_+l),d=d>_?_:d,d<0&&(d+=_),_=l>d?0:d-l>>>0,l>>>=0;for(var O=V(_);++y<_;)O[y]=o[y+l];return O}function QA(o,l){var d;return fi(o,function(y,_,O){return d=l(y,_,O),!d}),!!d}function sh(o,l,d){var y=0,_=o==null?y:o.length;if(typeof l=="number"&&l===l&&_<=Tt){for(;y<_;){var O=y+_>>>1,q=o[O];q!==null&&!Yr(q)&&(d?q<=l:q<l)?y=O+1:_=O}return _}return Yy(o,l,kr,d)}function Yy(o,l,d,y){var _=0,O=o==null?0:o.length;if(O===0)return 0;l=d(l);for(var q=l!==l,M=l===null,U=Yr(l),G=l===t;_<O;){var Q=ko((_+O)/2),ee=d(o[Q]),re=ee!==t,ue=ee===null,me=ee===ee,Oe=Yr(ee);if(q)var he=y||me;else G?he=me&&(y||re):M?he=me&&re&&(y||!ue):U?he=me&&re&&!ue&&(y||!Oe):ue||Oe?he=!1:he=y?ee<=l:ee<l;he?_=Q+1:O=Q}return Lt(O,wt)}function Mw(o,l){for(var d=-1,y=o.length,_=0,O=[];++d<y;){var q=o[d],M=l?l(q):q;if(!d||!Fn(M,U)){var U=M;O[_++]=q===0?0:q}}return O}function Nw(o){return typeof o=="number"?o:Yr(o)?ge:+o}function Wr(o){if(typeof o=="string")return o;if(Ee(o))return at(o,Wr)+"";if(Yr(o))return Vd?Vd.call(o):"";var l=o+"";return l=="0"&&1/o==-de?"-0":l}function xs(o,l,d){var y=-1,_=Ba,O=o.length,q=!0,M=[],U=M;if(d)q=!1,_=ps;else if(O>=r){var G=l?null:lT(o);if(G)return Ja(G);q=!1,_=Xe,U=new Ni}else U=l?[]:M;e:for(;++y<O;){var Q=o[y],ee=l?l(Q):Q;if(Q=d||Q!==0?Q:0,q&&ee===ee){for(var re=U.length;re--;)if(U[re]===ee)continue e;l&&U.push(ee),M.push(Q)}else _(U,ee,d)||(U!==M&&U.push(ee),M.push(Q))}return M}function Jy(o,l){l=Cs(l,o);var d=-1,y=l.length;if(!y)return!0;for(;++d<y;){var _=Dn(l[d]);if(_==="__proto__"&&!Ze.call(o,"__proto__")||(_==="constructor"||_==="prototype")&&d<y-1)return!1}var O=cE(o,l);return O==null||delete O[Dn(fn(l))]}function Dw(o,l,d,y){return Sc(o,l,d(Di(o,l)),y)}function oh(o,l,d,y){for(var _=o.length,O=y?_:-1;(y?O--:++O<_)&&l(o[O],O,o););return d?cn(o,y?0:O,y?O+1:_):cn(o,y?O+1:0,y?_:O)}function Fw(o,l){var d=o;return d instanceof $e&&(d=d.value()),nc(l,function(y,_){return _.func.apply(_.thisArg,si([y],_.args))},d)}function zy(o,l,d){var y=o.length;if(y<2)return y?xs(o[0]):[];for(var _=-1,O=V(y);++_<y;)for(var q=o[_],M=-1;++M<y;)M!=_&&(O[_]=Mo(O[_]||q,o[M],l,d));return xs(jt(O,1),l,d)}function Lw(o,l,d){for(var y=-1,_=o.length,O=l.length,q={};++y<_;){var M=y<O?l[y]:t;d(q,o[y],M)}return q}function Ky(o){return Pt(o)?o:[]}function Gy(o){return typeof o=="function"?o:kr}function Cs(o,l){return Ee(o)?o:sv(o,l)?[o]:pE(tt(o))}var ZA=ke;function Rs(o,l,d){var y=o.length;return d=d===t?y:d,!l&&d>=y?o:cn(o,l,d)}var jw=ly||function(o){return qt.clearTimeout(o)};function Uw(o,l){if(l)return o.slice();var d=o.length,y=Fd?Fd(d):new o.constructor(d);return o.copy(y),y}function Qy(o){var l=new o.constructor(o.byteLength);return new Za(l).set(new Za(o)),l}function XA(o,l){var d=l?Qy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function eT(o){var l=new o.constructor(o.source,fd.exec(o));return l.lastIndex=o.lastIndex,l}function tT(o){return $o?Ue($o.call(o)):{}}function Bw(o,l){var d=l?Qy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function Hw(o,l){if(o!==l){var d=o!==t,y=o===null,_=o===o,O=Yr(o),q=l!==t,M=l===null,U=l===l,G=Yr(l);if(!M&&!G&&!O&&o>l||O&&q&&U&&!M&&!G||y&&q&&U||!d&&U||!_)return 1;if(!y&&!O&&!G&&o<l||G&&d&&_&&!y&&!O||M&&d&&_||!q&&_||!U)return-1}return 0}function rT(o,l,d){for(var y=-1,_=o.criteria,O=l.criteria,q=_.length,M=d.length;++y<q;){var U=Hw(_[y],O[y]);if(U){if(y>=M)return U;var G=d[y];return U*(G=="desc"?-1:1)}}return o.index-l.index}function Vw(o,l,d,y){for(var _=-1,O=o.length,q=d.length,M=-1,U=l.length,G=pt(O-q,0),Q=V(U+G),ee=!y;++M<U;)Q[M]=l[M];for(;++_<q;)(ee||_<O)&&(Q[d[_]]=o[_]);for(;G--;)Q[M++]=o[_++];return Q}function Ww(o,l,d,y){for(var _=-1,O=o.length,q=-1,M=d.length,U=-1,G=l.length,Q=pt(O-M,0),ee=V(Q+G),re=!y;++_<Q;)ee[_]=o[_];for(var ue=_;++U<G;)ee[ue+U]=l[U];for(;++q<M;)(re||_<O)&&(ee[ue+d[q]]=o[_++]);return ee}function Ir(o,l){var d=-1,y=o.length;for(l||(l=V(y));++d<y;)l[d]=o[d];return l}function di(o,l,d,y){var _=!d;d||(d={});for(var O=-1,q=l.length;++O<q;){var M=l[O],U=y?y(d[M],o[M],M,d,o):t;U===t&&(U=o[M]),_?Hr(d,M,U):vr(d,M,U)}return d}function nT(o,l){return di(o,iv(o),l)}function iT(o,l){return di(o,iE(o),l)}function ah(o,l){return function(d,y){var _=Ee(d)?An:Zd,O=l?l():{};return _(d,o,pe(y,2),O)}}function dl(o){return ke(function(l,d){var y=-1,_=d.length,O=_>1?d[_-1]:t,q=_>2?d[2]:t;for(O=o.length>3&&typeof O=="function"?(_--,O):t,q&&Sr(d[0],d[1],q)&&(O=_<3?t:O,_=1),l=Ue(l);++y<_;){var M=d[y];M&&o(l,M,y,O)}return l})}function Yw(o,l){return function(d,y){if(d==null)return d;if(!Or(d))return o(d,y);for(var _=d.length,O=l?_:-1,q=Ue(d);(l?O--:++O<_)&&y(q[O],O,q)!==!1;);return d}}function Jw(o){return function(l,d,y){for(var _=-1,O=Ue(l),q=y(l),M=q.length;M--;){var U=q[o?M:++_];if(d(O[U],U,O)===!1)break}return l}}function sT(o,l,d){var y=l&C,_=bc(o);function O(){var q=this&&this!==qt&&this instanceof O?_:o;return q.apply(y?d:this,arguments)}return O}function zw(o){return function(l){l=tt(l);var d=ms(l)?gr(l):t,y=d?d[0]:l.charAt(0),_=d?Rs(d,1).join(""):l.slice(1);return y[o]()+_}}function hl(o){return function(l){return nc(JE(YE(l).replace(Og,"")),o,"")}}function bc(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var d=bs(o.prototype),y=o.apply(d,l);return bt(y)?y:d}}function oT(o,l,d){var y=bc(o);function _(){for(var O=arguments.length,q=V(O),M=O,U=pl(_);M--;)q[M]=arguments[M];var G=O<3&&q[0]!==U&&q[O-1]!==U?[]:on(q,U);if(O-=G.length,O<d)return Xw(o,l,lh,_.placeholder,t,q,G,t,t,d-O);var Q=this&&this!==qt&&this instanceof _?y:o;return hr(Q,this,q)}return _}function Kw(o){return function(l,d,y){var _=Ue(l);if(!Or(l)){var O=pe(d,3);l=Yt(l),d=function(M){return O(_[M],M,_)}}var q=o(l,d,y);return q>-1?_[O?l[q]:q]:t}}function Gw(o){return Li(function(l){var d=l.length,y=d,_=tr.prototype.thru;for(o&&l.reverse();y--;){var O=l[y];if(typeof O!="function")throw new yr(i);if(_&&!q&&dh(O)=="wrapper")var q=new tr([],!0)}for(y=q?y:d;++y<d;){O=l[y];var M=dh(O),U=M=="wrapper"?rv(O):t;U&&ov(U[0])&&U[1]==(X|B|H|k)&&!U[4].length&&U[9]==1?q=q[dh(U[0])].apply(q,U[3]):q=O.length==1&&ov(O)?q[M]():q.thru(O)}return function(){var G=arguments,Q=G[0];if(q&&G.length==1&&Ee(Q))return q.plant(Q).value();for(var ee=0,re=d?l[ee].apply(this,G):Q;++ee<d;)re=l[ee].call(this,re);return re}})}function lh(o,l,d,y,_,O,q,M,U,G){var Q=l&X,ee=l&C,re=l&A,ue=l&(B|Y),me=l&w,Oe=re?t:bc(o);function he(){for(var Le=arguments.length,Be=V(Le),Jr=Le;Jr--;)Be[Jr]=arguments[Jr];if(ue)var br=pl(he),zr=$d(Be,br);if(y&&(Be=Vw(Be,y,_,ue)),O&&(Be=Ww(Be,O,q,ue)),Le-=zr,ue&&Le<G){var kt=on(Be,br);return Xw(o,l,lh,he.placeholder,d,Be,kt,M,U,G-Le)}var Ln=ee?d:this,Hi=re?Ln[o]:o;return Le=Be.length,M?Be=RT(Be,M):me&&Le>1&&Be.reverse(),Q&&U<Le&&(Be.length=U),this&&this!==qt&&this instanceof he&&(Hi=Oe||bc(Hi)),Hi.apply(Ln,Be)}return he}function Qw(o,l){return function(d,y){return _s(d,o,l(y),{})}}function uh(o,l){return function(d,y){var _;if(d===t&&y===t)return l;if(d!==t&&(_=d),y!==t){if(_===t)return y;typeof d=="string"||typeof y=="string"?(d=Wr(d),y=Wr(y)):(d=Nw(d),y=Nw(y)),_=o(d,y)}return _}}function Zy(o){return Li(function(l){return l=at(l,mr(pe())),ke(function(d){var y=this;return o(l,function(_){return hr(_,y,d)})})})}function ch(o,l){l=l===t?" ":Wr(l);var d=l.length;if(d<2)return d?Wy(l,o):l;var y=Wy(l,Po(o/oi(l)));return ms(l)?Rs(gr(y),0,o).join(""):y.slice(0,o)}function aT(o,l,d,y){var _=l&C,O=bc(o);function q(){for(var M=-1,U=arguments.length,G=-1,Q=y.length,ee=V(Q+U),re=this&&this!==qt&&this instanceof q?O:o;++G<Q;)ee[G]=y[G];for(;U--;)ee[G++]=arguments[++M];return hr(re,_?d:this,ee)}return q}function Zw(o){return function(l,d,y){return y&&typeof y!="number"&&Sr(l,d,y)&&(d=y=t),l=Bi(l),d===t?(d=l,l=0):d=Bi(d),y=y===t?l<d?1:-1:Bi(y),YA(l,d,y,o)}}function fh(o){return function(l,d){return typeof l=="string"&&typeof d=="string"||(l=dn(l),d=dn(d)),o(l,d)}}function Xw(o,l,d,y,_,O,q,M,U,G){var Q=l&B,ee=Q?q:t,re=Q?t:q,ue=Q?O:t,me=Q?t:O;l|=Q?H:K,l&=~(Q?K:H),l&T||(l&=~(C|A));var Oe=[o,l,_,ue,ee,me,re,M,U,G],he=d.apply(t,Oe);return ov(o)&&fE(he,Oe),he.placeholder=y,dE(he,o,l)}function Xy(o){var l=et[o];return function(d,y){if(d=dn(d),y=y==null?0:Lt(xe(y),292),y&&Mi(d)){var _=(tt(d)+"e").split("e"),O=l(_[0]+"e"+(+_[1]+y));return _=(tt(O)+"e").split("e"),+(_[0]+"e"+(+_[1]-y))}return l(d)}}var lT=vs&&1/Ja(new vs([,-0]))[1]==de?function(o){return new vs(o)}:wv;function eE(o){return function(l){var d=nr(l);return d==Ht?gs(l):d==dr?Md(l):Vg(l,o(l))}}function Fi(o,l,d,y,_,O,q,M){var U=l&A;if(!U&&typeof o!="function")throw new yr(i);var G=y?y.length:0;if(G||(l&=~(H|K),y=_=t),q=q===t?q:pt(xe(q),0),M=M===t?M:xe(M),G-=_?_.length:0,l&K){var Q=y,ee=_;y=_=t}var re=U?t:rv(o),ue=[o,l,d,y,_,Q,ee,O,q,M];if(re&&ET(ue,re),o=ue[0],l=ue[1],d=ue[2],y=ue[3],_=ue[4],M=ue[9]=ue[9]===t?U?0:o.length:pt(ue[9]-G,0),!M&&l&(B|Y)&&(l&=~(B|Y)),!l||l==C)var me=sT(o,l,d);else l==B||l==Y?me=oT(o,l,M):(l==H||l==(C|H))&&!_.length?me=aT(o,l,d,y):me=lh.apply(t,ue);var Oe=re?$w:fE;return dE(Oe(me,ue),o,l)}function tE(o,l,d,y){return o===t||Fn(o,ys[d])&&!Ze.call(y,d)?l:o}function rE(o,l,d,y,_,O){return bt(o)&&bt(l)&&(O.set(l,o),$t(o,l,t,rE,O),O.delete(l)),o}function uT(o){return Ec(o)?t:o}function nE(o,l,d,y,_,O){var q=d&E,M=o.length,U=l.length;if(M!=U&&!(q&&U>M))return!1;var G=O.get(o),Q=O.get(l);if(G&&Q)return G==l&&Q==o;var ee=-1,re=!0,ue=d&x?new Ni:t;for(O.set(o,l),O.set(l,o);++ee<M;){var me=o[ee],Oe=l[ee];if(y)var he=q?y(Oe,me,ee,l,o,O):y(me,Oe,ee,o,l,O);if(he!==t){if(he)continue;re=!1;break}if(ue){if(!Ha(l,function(Le,Be){if(!Xe(ue,Be)&&(me===Le||_(me,Le,d,y,O)))return ue.push(Be)})){re=!1;break}}else if(!(me===Oe||_(me,Oe,d,y,O))){re=!1;break}}return O.delete(o),O.delete(l),re}function cT(o,l,d,y,_,O,q){switch(d){case In:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case Oi:return!(o.byteLength!=l.byteLength||!O(new Za(o),new Za(l)));case Cn:case en:case co:return Fn(+o,+l);case ht:return o.name==l.name&&o.message==l.message;case Vt:case fo:return o==l+"";case Ht:var M=gs;case dr:var U=y&E;if(M||(M=Ja),o.size!=l.size&&!U)return!1;var G=q.get(o);if(G)return G==l;y|=x,q.set(o,l);var Q=nE(M(o),M(l),y,_,O,q);return q.delete(o),Q;case Oa:if($o)return $o.call(o)==$o.call(l)}return!1}function fT(o,l,d,y,_,O){var q=d&E,M=ev(o),U=M.length,G=ev(l),Q=G.length;if(U!=Q&&!q)return!1;for(var ee=U;ee--;){var re=M[ee];if(!(q?re in l:Ze.call(l,re)))return!1}var ue=O.get(o),me=O.get(l);if(ue&&me)return ue==l&&me==o;var Oe=!0;O.set(o,l),O.set(l,o);for(var he=q;++ee<U;){re=M[ee];var Le=o[re],Be=l[re];if(y)var Jr=q?y(Be,Le,re,l,o,O):y(Le,Be,re,o,l,O);if(!(Jr===t?Le===Be||_(Le,Be,d,y,O):Jr)){Oe=!1;break}he||(he=re=="constructor")}if(Oe&&!he){var br=o.constructor,zr=l.constructor;br!=zr&&"constructor"in o&&"constructor"in l&&!(typeof br=="function"&&br instanceof br&&typeof zr=="function"&&zr instanceof zr)&&(Oe=!1)}return O.delete(o),O.delete(l),Oe}function Li(o){return lv(uE(o,t,vE),o+"")}function ev(o){return nh(o,Yt,iv)}function tv(o){return nh(o,Pr,iE)}var rv=sl?function(o){return sl.get(o)}:wv;function dh(o){for(var l=o.name+"",d=Ss[l],y=Ze.call(Ss,l)?d.length:0;y--;){var _=d[y],O=_.func;if(O==null||O==o)return _.name}return l}function pl(o){var l=Ze.call(I,"placeholder")?I:o;return l.placeholder}function pe(){var o=I.iteratee||bv;return o=o===bv?b:o,arguments.length?o(arguments[0],arguments[1]):o}function hh(o,l){var d=o.__data__;return ST(l)?d[typeof l=="string"?"string":"hash"]:d.map}function nv(o){for(var l=Yt(o),d=l.length;d--;){var y=l[d],_=o[y];l[d]=[y,_,aE(_)]}return l}function Fo(o,l){var d=Eo(o,l);return Fe(d)?d:t}function dT(o){var l=Ze.call(o,$i),d=o[$i];try{o[$i]=t;var y=!0}catch{}var _=Ga.call(o);return y&&(l?o[$i]=d:delete o[$i]),_}var iv=rl?function(o){return o==null?[]:(o=Ue(o),ii(rl(o),function(l){return Io.call(o,l)}))}:Ev,iE=rl?function(o){for(var l=[];o;)si(l,iv(o)),o=Xa(o);return l}:Ev,nr=zt;(uc&&nr(new uc(new ArrayBuffer(1)))!=In||Ao&&nr(new Ao)!=Ht||cc&&nr(cc.resolve())!=ad||vs&&nr(new vs)!=dr||To&&nr(new To)!=Ft)&&(nr=function(o){var l=zt(o),d=l==Rn?o.constructor:t,y=d?Lo(d):"";if(y)switch(y){case hy:return In;case py:return Ht;case my:return ad;case gy:return dr;case yy:return Ft}return l});function hT(o,l,d){for(var y=-1,_=d.length;++y<_;){var O=d[y],q=O.size;switch(O.type){case"drop":o+=q;break;case"dropRight":l-=q;break;case"take":l=Lt(l,o+q);break;case"takeRight":o=pt(o,l-q);break}}return{start:o,end:l}}function pT(o){var l=o.match(On);return l?l[1].split(nn):[]}function sE(o,l,d){l=Cs(l,o);for(var y=-1,_=l.length,O=!1;++y<_;){var q=Dn(l[y]);if(!(O=o!=null&&d(o,q)))break;o=o[q]}return O||++y!=_?O:(_=o==null?0:o.length,!!_&&bh(_)&&ji(q,_)&&(Ee(o)||jo(o)))}function mT(o){var l=o.length,d=new o.constructor(l);return l&&typeof o[0]=="string"&&Ze.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function oE(o){return typeof o.constructor=="function"&&!_c(o)?bs(Xa(o)):{}}function gT(o,l,d){var y=o.constructor;switch(l){case Oi:return Qy(o);case Cn:case en:return new y(+o);case In:return XA(o,d);case it:case Pa:case ka:case as:case ho:case ls:case ni:case us:case Bu:return Bw(o,d);case Ht:return new y;case co:case fo:return new y(o);case Vt:return eT(o);case dr:return new y;case Oa:return tT(o)}}function yT(o,l){var d=l.length;if(!d)return o;var y=d-1;return l[y]=(d>1?"& ":"")+l[y],l=l.join(d>2?", ":" "),o.replace(Wt,`{
|
|
2
2
|
/* [wrapped with `+l+`] */
|
|
3
|
-
`)}function cT(o){return Ce(o)||jo(o)||!!(Ld&&o&&o[Ld])}function Vi(o,l){var d=typeof o;return l=l??fe,!!l&&(d=="number"||d!="symbol"&&Sg.test(o))&&o>-1&&o%1==0&&o<l}function gr(o,l,d){if(!bt(d))return!1;var v=typeof l;return(v=="number"?Rr(d)&&Vi(l,d.length):v=="string"&&l in d)?Nn(d[l],o):!1}function av(o,l){if(Ce(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||Wr(o)?!0:_r.test(o)||!xn.test(o)||l!=null&&o in Te(l)}function fT(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function lv(o){var l=ch(o),d=I[l];if(typeof d!="function"||!(l in Oe.prototype))return!1;if(o===d)return!0;var v=iv(d);return!!v&&o===v[0]}function dT(o){return!!Md&&Md in o}var hT=Ha?Wi:xv;function cc(o){var l=o&&o.constructor,d=typeof l=="function"&&l.prototype||Is;return o===d}function aE(o){return o===o&&!bt(o)}function lE(o,l){return function(d){return d==null?!1:d[o]===l&&(l!==t||o in Te(d))}}function pT(o){var l=gh(o,function(v){return d.size===u&&d.clear(),v}),d=l.cache;return l}function mT(o,l){var d=o[1],v=l[1],w=d|v,O=w<(C|x|K),q=v==K&&d==T||v==K&&d==ee&&o[7].length<=l[8]||v==(K|ee)&&l[7].length<=l[8]&&d==T;if(!(O||q))return o;v&C&&(o[2]=l[2],w|=d&C?0:A);var M=l[3];if(M){var B=o[3];o[3]=B?Vw(B,M,l[4]):M,o[4]=B?Br(o[3],f):l[4]}return M=l[5],M&&(B=o[5],o[5]=B?Ww(B,M,l[6]):M,o[6]=B?Br(o[5],f):l[6]),M=l[7],M&&(o[7]=M),v&K&&(o[8]=o[8]==null?l[8]:St(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=w,o}function gT(o){var l=[];if(o!=null)for(var d in Te(o))l.push(d);return l}function yT(o){return Va.call(o)}function uE(o,l,d){return l=xt(l===t?o.length-1:l,0),function(){for(var v=arguments,w=-1,O=xt(v.length-l,0),q=H(O);++w<O;)q[w]=v[l+w];w=-1;for(var M=H(l+1);++w<l;)M[w]=v[w];return M[l]=d(q),zt(o,this,M)}}function cE(o,l){return l.length<2?o:Ui(o,ln(l,0,-1))}function vT(o,l){for(var d=o.length,v=St(l.length,d),w=xr(o);v--;){var O=l[v];o[v]=Vi(O,d)?w[O]:t}return o}function uv(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var fE=hE($w),fc=fy||function(o,l){return Nt.setTimeout(o,l)},cv=hE(UA);function dE(o,l,d){var v=l+"";return cv(o,uT(v,ST(oT(v),d)))}function hE(o){var l=0,d=0;return function(){var v=Ud(),w=D-(v-d);if(d=v,w>0){if(++l>=N)return arguments[0]}else l=0;return o.apply(t,arguments)}}function dh(o,l){var d=-1,v=o.length,w=v-1;for(l=l===t?v:l;++d<l;){var O=Yy(d,w),q=o[O];o[O]=o[d],o[d]=q}return o.length=l,o}var pE=pT(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(Me,function(d,v,w,O){l.push(w?O.replace(jr,"$1"):v||d)}),l});function mi(o){if(typeof o=="string"||Wr(o))return o;var l=o+"";return l=="0"&&1/o==-ie?"-0":l}function Lo(o){if(o!=null){try{return Io.call(o)}catch{}try{return o+""}catch{}}return""}function ST(o,l){return Ct(Mt,function(d){var v="_."+d[0];l&d[1]&&!ja(o,v)&&o.push(v)}),o.sort()}function mE(o){if(o instanceof Oe)return o.clone();var l=new Er(o.__wrapped__,o.__chain__);return l.__actions__=xr(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function bT(o,l,d){(d?gr(o,l,d):l===t)?l=1:l=xt(xe(l),0);var v=o==null?0:o.length;if(!v||l<1)return[];for(var w=0,O=0,q=H(Ka(v/l));w<v;)q[O++]=ln(o,w,w+=l);return q}function _T(o){for(var l=-1,d=o==null?0:o.length,v=0,w=[];++l<d;){var O=o[l];O&&(w[v++]=O)}return w}function wT(){var o=arguments.length;if(!o)return[];for(var l=H(o-1),d=arguments[0],v=o;v--;)l[v-1]=arguments[v];return en(Ce(d)?xr(d):[d],Ut(l,1))}var ET=qe(function(o,l){return Tt(o)?Ts(o,Ut(l,1,Tt,!0)):[]}),CT=qe(function(o,l){var d=un(l);return Tt(d)&&(d=t),Tt(o)?Ts(o,Ut(l,1,Tt,!0),pe(d,2)):[]}),xT=qe(function(o,l){var d=un(l);return Tt(d)&&(d=t),Tt(o)?Ts(o,Ut(l,1,Tt,!0),t,d):[]});function RT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===t?1:xe(l),ln(o,l<0?0:l,v)):[]}function IT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===t?1:xe(l),l=v-l,ln(o,0,l<0?0:l)):[]}function OT(o,l){return o&&o.length?ih(o,pe(l,3),!0,!0):[]}function PT(o,l){return o&&o.length?ih(o,pe(l,3),!0):[]}function kT(o,l,d,v){var w=o==null?0:o.length;return w?(d&&typeof d!="number"&&gr(o,l,d)&&(d=0,v=w),Fy(o,l,d,v)):[]}function gE(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var w=d==null?0:xe(d);return w<0&&(w=xt(v+w,0)),Ua(o,pe(l,3),w)}function yE(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var w=v-1;return d!==t&&(w=xe(d),w=d<0?xt(v+w,0):St(w,v-1)),Ua(o,pe(l,3),w,!0)}function vE(o){var l=o==null?0:o.length;return l?Ut(o,1):[]}function AT(o){var l=o==null?0:o.length;return l?Ut(o,ie):[]}function TT(o,l){var d=o==null?0:o.length;return d?(l=l===t?1:xe(l),Ut(o,l)):[]}function qT(o){for(var l=-1,d=o==null?0:o.length,v={};++l<d;){var w=o[l];v[w[0]]=w[1]}return v}function SE(o){return o&&o.length?o[0]:t}function $T(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var w=d==null?0:xe(d);return w<0&&(w=xt(v+w,0)),Cs(o,l,w)}function MT(o){var l=o==null?0:o.length;return l?ln(o,0,-1):[]}var NT=qe(function(o){var l=tt(o,Qy);return l.length&&l[0]===o[0]?oc(l):[]}),DT=qe(function(o){var l=un(o),d=tt(o,Qy);return l===un(d)?l=t:d.pop(),d.length&&d[0]===o[0]?oc(d,pe(l,2)):[]}),FT=qe(function(o){var l=un(o),d=tt(o,Qy);return l=typeof l=="function"?l:t,l&&d.pop(),d.length&&d[0]===o[0]?oc(d,t,l):[]});function LT(o,l){return o==null?"":Os.call(o,l)}function un(o){var l=o==null?0:o.length;return l?o[l-1]:t}function jT(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var w=v;return d!==t&&(w=xe(d),w=w<0?xt(v+w,0):St(w,v-1)),l===l?Xg(o,l,w):Ua(o,Id,w,!0)}function UT(o,l){return o&&o.length?an(o,xe(l)):t}var BT=qe(bE);function bE(o,l){return o&&o.length&&l&&l.length?Wy(o,l):o}function HT(o,l,d){return o&&o.length&&l&&l.length?Wy(o,l,pe(d,2)):o}function VT(o,l,d){return o&&o.length&&l&&l.length?Wy(o,l,t,d):o}var WT=Hi(function(o,l){var d=o==null?0:o.length,v=il(o,l);return qw(o,tt(l,function(w){return Vi(w,d)?+w:w}).sort(Hw)),v});function YT(o,l){var d=[];if(!(o&&o.length))return d;var v=-1,w=[],O=o.length;for(l=pe(l,3);++v<O;){var q=o[v];l(q,v,o)&&(d.push(q),w.push(v))}return qw(o,w),d}function fv(o){return o==null?o:dy.call(o)}function JT(o,l,d){var v=o==null?0:o.length;return v?(d&&typeof d!="number"&&gr(o,l,d)?(l=0,d=v):(l=l==null?0:xe(l),d=d===t?v:xe(d)),ln(o,l,d)):[]}function zT(o,l){return nh(o,l)}function KT(o,l,d){return zy(o,l,pe(d,2))}function GT(o,l){var d=o==null?0:o.length;if(d){var v=nh(o,l);if(v<d&&Nn(o[v],l))return v}return-1}function QT(o,l){return nh(o,l,!0)}function ZT(o,l,d){return zy(o,l,pe(d,2),!0)}function XT(o,l){var d=o==null?0:o.length;if(d){var v=nh(o,l,!0)-1;if(Nn(o[v],l))return v}return-1}function eq(o){return o&&o.length?Mw(o):[]}function tq(o,l){return o&&o.length?Mw(o,pe(l,2)):[]}function rq(o){var l=o==null?0:o.length;return l?ln(o,1,l):[]}function nq(o,l,d){return o&&o.length?(l=d||l===t?1:xe(l),ln(o,0,l<0?0:l)):[]}function iq(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===t?1:xe(l),l=v-l,ln(o,l<0?0:l,v)):[]}function sq(o,l){return o&&o.length?ih(o,pe(l,3),!1,!0):[]}function oq(o,l){return o&&o.length?ih(o,pe(l,3)):[]}var aq=qe(function(o){return qs(Ut(o,1,Tt,!0))}),lq=qe(function(o){var l=un(o);return Tt(l)&&(l=t),qs(Ut(o,1,Tt,!0),pe(l,2))}),uq=qe(function(o){var l=un(o);return l=typeof l=="function"?l:t,qs(Ut(o,1,Tt,!0),t,l)});function cq(o){return o&&o.length?qs(o):[]}function fq(o,l){return o&&o.length?qs(o,pe(l,2)):[]}function dq(o,l){return l=typeof l=="function"?l:t,o&&o.length?qs(o,t,l):[]}function dv(o){if(!(o&&o.length))return[];var l=0;return o=ai(o,function(d){if(Tt(d))return l=xt(d.length,l),!0}),Ku(l,function(d){return tt(o,Yu(d))})}function _E(o,l){if(!(o&&o.length))return[];var d=dv(o);return l==null?d:tt(d,function(v){return zt(l,t,v)})}var hq=qe(function(o,l){return Tt(o)?Ts(o,l):[]}),pq=qe(function(o){return Gy(ai(o,Tt))}),mq=qe(function(o){var l=un(o);return Tt(l)&&(l=t),Gy(ai(o,Tt),pe(l,2))}),gq=qe(function(o){var l=un(o);return l=typeof l=="function"?l:t,Gy(ai(o,Tt),t,l)}),yq=qe(dv);function vq(o,l){return Lw(o||[],l||[],Mo)}function Sq(o,l){return Lw(o||[],l||[],lc)}var bq=qe(function(o){var l=o.length,d=l>1?o[l-1]:t;return d=typeof d=="function"?(o.pop(),d):t,_E(o,d)});function wE(o){var l=I(o);return l.__chain__=!0,l}function _q(o,l){return l(o),o}function hh(o,l){return l(o)}var wq=Hi(function(o){var l=o.length,d=l?o[0]:0,v=this.__wrapped__,w=function(O){return il(O,o)};return l>1||this.__actions__.length||!(v instanceof Oe)||!Vi(d)?this.thru(w):(v=v.slice(d,+d+(l?1:0)),v.__actions__.push({func:hh,args:[w],thisArg:t}),new Er(v,this.__chain__).thru(function(O){return l&&!O.length&&O.push(t),O}))});function Eq(){return wE(this)}function Cq(){return new Er(this.value(),this.__chain__)}function xq(){this.__values__===t&&(this.__values__=NE(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function Rq(){return this}function Iq(o){for(var l,d=this;d instanceof el;){var v=mE(d);v.__index__=0,v.__values__=t,l?w.__wrapped__=v:l=v;var w=v;d=d.__wrapped__}return w.__wrapped__=o,l}function Oq(){var o=this.__wrapped__;if(o instanceof Oe){var l=o;return this.__actions__.length&&(l=new Oe(this)),l=l.reverse(),l.__actions__.push({func:hh,args:[fv],thisArg:t}),new Er(l,this.__chain__)}return this.thru(fv)}function Pq(){return Fw(this.__wrapped__,this.__actions__)}var kq=sh(function(o,l,d){Ke.call(o,d)?++o[d]:qn(o,d,1)});function Aq(o,l,d){var v=Ce(o)?La:Dy;return d&&gr(o,l,d)&&(l=t),v(o,pe(l,3))}function Tq(o,l){var d=Ce(o)?ai:Xd;return d(o,pe(l,3))}var qq=Kw(gE),$q=Kw(yE);function Mq(o,l){return Ut(ph(o,l),1)}function Nq(o,l){return Ut(ph(o,l),ie)}function Dq(o,l,d){return d=d===t?1:xe(d),Ut(ph(o,l),d)}function EE(o,l){var d=Ce(o)?Ct:di;return d(o,pe(l,3))}function CE(o,l){var d=Ce(o)?Ug:Zd;return d(o,pe(l,3))}var Fq=sh(function(o,l,d){Ke.call(o,d)?o[d].push(l):qn(o,d,[l])});function Lq(o,l,d,v){o=Rr(o)?o:cl(o),d=d&&!v?xe(d):0;var w=o.length;return d<0&&(d=xt(w+d,0)),Sh(o)?d<=w&&o.indexOf(l,d)>-1:!!w&&Cs(o,l,d)>-1}var jq=qe(function(o,l,d){var v=-1,w=typeof l=="function",O=Rr(o)?H(o.length):[];return di(o,function(q){O[++v]=w?zt(l,q,d):on(q,l,d)}),O}),Uq=sh(function(o,l,d){qn(o,d,l)});function ph(o,l){var d=Ce(o)?tt:W;return d(o,pe(l,3))}function Bq(o,l,d,v){return o==null?[]:(Ce(l)||(l=l==null?[]:[l]),d=v?t:d,Ce(d)||(d=d==null?[]:[d]),Mn(o,l,d))}var Hq=sh(function(o,l,d){o[d?0:1].push(l)},function(){return[[],[]]});function Vq(o,l,d){var v=Ce(o)?Vu:Od,w=arguments.length<3;return v(o,pe(l,4),d,w,di)}function Wq(o,l,d){var v=Ce(o)?Bg:Od,w=arguments.length<3;return v(o,pe(l,4),d,w,Zd)}function Yq(o,l){var d=Ce(o)?ai:Xd;return d(o,yh(pe(l,3)))}function Jq(o){var l=Ce(o)?Gd:LA;return l(o)}function zq(o,l,d){(d?gr(o,l,d):l===t)?l=1:l=xe(l);var v=Ce(o)?qy:jA;return v(o,l)}function Kq(o){var l=Ce(o)?$y:BA;return l(o)}function Gq(o){if(o==null)return 0;if(Rr(o))return Sh(o)?li(o):o.length;var l=ir(o);return l==rr||l==yt?o.size:b(o).length}function Qq(o,l,d){var v=Ce(o)?Wu:HA;return d&&gr(o,l,d)&&(l=t),v(o,pe(l,3))}var Zq=qe(function(o,l){if(o==null)return[];var d=l.length;return d>1&&gr(o,l[0],l[1])?l=[]:d>2&&gr(l[0],l[1],l[2])&&(l=[l[0]]),Mn(o,Ut(l,1),[])}),mh=cy||function(){return Nt.Date.now()};function Xq(o,l){if(typeof l!="function")throw new wr(i);return o=xe(o),function(){if(--o<1)return l.apply(this,arguments)}}function xE(o,l,d){return l=d?t:l,l=o&&l==null?o.length:l,Bi(o,K,t,t,t,t,l)}function RE(o,l){var d;if(typeof l!="function")throw new wr(i);return o=xe(o),function(){return--o>0&&(d=l.apply(this,arguments)),o<=1&&(l=t),d}}var hv=qe(function(o,l,d){var v=C;if(d.length){var w=Br(d,ll(hv));v|=Y}return Bi(o,v,l,d,w)}),IE=qe(function(o,l,d){var v=C|x;if(d.length){var w=Br(d,ll(IE));v|=Y}return Bi(l,v,o,d,w)});function OE(o,l,d){l=d?t:l;var v=Bi(o,T,t,t,t,t,t,l);return v.placeholder=OE.placeholder,v}function PE(o,l,d){l=d?t:l;var v=Bi(o,j,t,t,t,t,t,l);return v.placeholder=PE.placeholder,v}function kE(o,l,d){var v,w,O,q,M,B,G=0,Q=!1,X=!1,re=!0;if(typeof o!="function")throw new wr(i);l=cn(l)||0,bt(d)&&(Q=!!d.leading,X="maxWait"in d,O=X?xt(cn(d.maxWait)||0,l):O,re="trailing"in d?!!d.trailing:re);function ue(qt){var Dn=v,Ji=w;return v=w=t,G=qt,q=o.apply(Ji,Dn),q}function me(qt){return G=qt,M=fc(Fe,l),Q?ue(qt):q}function ke(qt){var Dn=qt-B,Ji=qt-G,KE=l-Dn;return X?St(KE,O-Ji):KE}function ge(qt){var Dn=qt-B,Ji=qt-G;return B===t||Dn>=l||Dn<0||X&&Ji>=O}function Fe(){var qt=mh();if(ge(qt))return Ue(qt);M=fc(Fe,ke(qt))}function Ue(qt){return M=t,re&&v?ue(qt):(v=w=t,q)}function Yr(){M!==t&&jw(M),G=0,v=B=w=M=t}function yr(){return M===t?q:Ue(mh())}function Jr(){var qt=mh(),Dn=ge(qt);if(v=arguments,w=this,B=qt,Dn){if(M===t)return me(B);if(X)return jw(M),M=fc(Fe,l),ue(B)}return M===t&&(M=fc(Fe,l)),q}return Jr.cancel=Yr,Jr.flush=yr,Jr}var e$=qe(function(o,l){return rn(o,1,l)}),t$=qe(function(o,l,d){return rn(o,cn(l)||0,d)});function r$(o){return Bi(o,k)}function gh(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new wr(i);var d=function(){var v=arguments,w=l?l.apply(this,v):v[0],O=d.cache;if(O.has(w))return O.get(w);var q=o.apply(this,v);return d.cache=O.set(w,q)||O,q};return d.cache=new(gh.Cache||Tn),d}gh.Cache=Tn;function yh(o){if(typeof o!="function")throw new wr(i);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function n$(o){return RE(2,o)}var i$=VA(function(o,l){l=l.length==1&&Ce(l[0])?tt(l[0],nr(pe())):tt(Ut(l,1),nr(pe()));var d=l.length;return qe(function(v){for(var w=-1,O=St(v.length,d);++w<O;)v[w]=l[w].call(this,v[w]);return zt(o,this,v)})}),pv=qe(function(o,l){var d=Br(l,ll(pv));return Bi(o,Y,t,l,d)}),AE=qe(function(o,l){var d=Br(l,ll(AE));return Bi(o,V,t,l,d)}),s$=Hi(function(o,l){return Bi(o,ee,t,t,t,l)});function o$(o,l){if(typeof o!="function")throw new wr(i);return l=l===t?l:xe(l),qe(o,l)}function a$(o,l){if(typeof o!="function")throw new wr(i);return l=l==null?0:xt(xe(l),0),qe(function(d){var v=d[l],w=Ms(d,0,l);return v&&en(w,v),zt(o,this,w)})}function l$(o,l,d){var v=!0,w=!0;if(typeof o!="function")throw new wr(i);return bt(d)&&(v="leading"in d?!!d.leading:v,w="trailing"in d?!!d.trailing:w),kE(o,l,{leading:v,maxWait:l,trailing:w})}function u$(o){return xE(o,1)}function c$(o,l){return pv(Zy(l),o)}function f$(){if(!arguments.length)return[];var o=arguments[0];return Ce(o)?o:[o]}function d$(o){return mr(o,m)}function h$(o,l){return l=typeof l=="function"?l:t,mr(o,m,l)}function p$(o){return mr(o,h|m)}function m$(o,l){return l=typeof l=="function"?l:t,mr(o,h|m,l)}function g$(o,l){return l==null||Qd(o,l,Yt(l))}function Nn(o,l){return o===l||o!==o&&l!==l}var y$=uh(sc),v$=uh(function(o,l){return o>=l}),jo=rh(function(){return arguments}())?rh:function(o){return Rt(o)&&Ke.call(o,"callee")&&!Fd.call(o,"callee")},Ce=H.isArray,S$=_d?nr(_d):By;function Rr(o){return o!=null&&vh(o.length)&&!Wi(o)}function Tt(o){return Rt(o)&&Rr(o)}function b$(o){return o===!0||o===!1||Rt(o)&&Kt(o)==ft}var Ns=jd||xv,_$=Bu?nr(Bu):Hy;function w$(o){return Rt(o)&&o.nodeType===1&&!dc(o)}function E$(o){if(o==null)return!0;if(Rr(o)&&(Ce(o)||typeof o=="string"||typeof o.splice=="function"||Ns(o)||ul(o)||jo(o)))return!o.length;var l=ir(o);if(l==rr||l==yt)return!o.size;if(cc(o))return!b(o).length;for(var d in o)if(Ke.call(o,d))return!1;return!0}function C$(o,l){return No(o,l)}function x$(o,l,d){d=typeof d=="function"?d:t;var v=d?d(o,l):t;return v===t?No(o,l,t,d):!!v}function mv(o){if(!Rt(o))return!1;var l=Kt(o);return l==jt||l==cs||typeof o.message=="string"&&typeof o.name=="string"&&!dc(o)}function R$(o){return typeof o=="number"&&ko(o)}function Wi(o){if(!bt(o))return!1;var l=Kt(o);return l==dt||l==ti||l==$u||l==fg}function TE(o){return typeof o=="number"&&o==xe(o)}function vh(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=fe}function bt(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function Rt(o){return o!=null&&typeof o=="object"}var qE=wd?nr(wd):ac;function I$(o,l){return o===l||hi(o,l,sv(l))}function O$(o,l,d){return d=typeof d=="function"?d:t,hi(o,l,sv(l),d)}function P$(o){return $E(o)&&o!=+o}function k$(o){if(hT(o))throw new Se(n);return Do(o)}function A$(o){return o===null}function T$(o){return o==null}function $E(o){return typeof o=="number"||Rt(o)&&Kt(o)==Zr}function dc(o){if(!Rt(o)||Kt(o)!=Cn)return!1;var l=Ja(o);if(l===null)return!0;var d=Ke.call(l,"constructor")&&l.constructor;return typeof d=="function"&&d instanceof d&&Io.call(d)==oy}var gv=Ed?nr(Ed):je;function q$(o){return TE(o)&&o>=-fe&&o<=fe}var ME=Eo?nr(Eo):c;function Sh(o){return typeof o=="string"||!Ce(o)&&Rt(o)&&Kt(o)==Ti}function Wr(o){return typeof o=="symbol"||Rt(o)&&Kt(o)==Oa}var ul=On?nr(On):p;function $$(o){return o===t}function M$(o){return Rt(o)&&ir(o)==ds}function N$(o){return Rt(o)&&Kt(o)==hr}var D$=uh($),F$=uh(function(o,l){return o<=l});function NE(o){if(!o)return[];if(Rr(o))return Sh(o)?pr(o):xr(o);if(Oo&&o[Oo])return Qg(o[Oo]());var l=ir(o),d=l==rr?Qu:l==yt?Rs:cl;return d(o)}function Yi(o){if(!o)return o===0?o:0;if(o=cn(o),o===ie||o===-ie){var l=o<0?-1:1;return l*wt}return o===o?o:0}function xe(o){var l=Yi(o),d=l%1;return l===l?d?l-d:l:0}function DE(o){return o?ji(xe(o),0,he):0}function cn(o){if(typeof o=="number")return o;if(Wr(o))return Ee;if(bt(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=bt(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=Pd(o);var d=vg.test(o);return d||Zf.test(o)?Sd(o.slice(2),d?2:8):yg.test(o)?Ee:+o}function FE(o){return pi(o,Ir(o))}function L$(o){return o?ji(xe(o),-fe,fe):o===0?o:0}function Qe(o){return o==null?"":Vr(o)}var j$=ol(function(o,l){if(cc(l)||Rr(l)){pi(l,Yt(l),o);return}for(var d in l)Ke.call(l,d)&&Mo(o,d,l[d])}),LE=ol(function(o,l){pi(l,Ir(l),o)}),bh=ol(function(o,l,d,v){pi(l,Ir(l),o,v)}),U$=ol(function(o,l,d,v){pi(l,Yt(l),o,v)}),B$=Hi(il);function H$(o,l){var d=As(o);return l==null?d:tc(d,l)}var V$=qe(function(o,l){o=Te(o);var d=-1,v=l.length,w=v>2?l[2]:t;for(w&&gr(l[0],l[1],w)&&(v=1);++d<v;)for(var O=l[d],q=Ir(O),M=-1,B=q.length;++M<B;){var G=q[M],Q=o[G];(Q===t||Nn(Q,Is[G])&&!Ke.call(o,G))&&(o[G]=O[G])}return o}),W$=qe(function(o){return o.push(t,rE),zt(jE,t,o)});function Y$(o,l){return xd(o,pe(l,3),nn)}function J$(o,l){return xd(o,pe(l,3),ic)}function z$(o,l){return o==null?o:nc(o,pe(l,3),Ir)}function K$(o,l){return o==null?o:eh(o,pe(l,3),Ir)}function G$(o,l){return o&&nn(o,pe(l,3))}function Q$(o,l){return o&&ic(o,pe(l,3))}function Z$(o){return o==null?[]:sn(o,Yt(o))}function X$(o){return o==null?[]:sn(o,Ir(o))}function yv(o,l,d){var v=o==null?t:Ui(o,l);return v===t?d:v}function eM(o,l){return o!=null&&sE(o,l,Ly)}function vv(o,l){return o!=null&&sE(o,l,jy)}var tM=Qw(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Va.call(l)),o[l]=d},bv(Or)),rM=Qw(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Va.call(l)),Ke.call(o,l)?o[l].push(d):o[l]=[d]},pe),nM=qe(on);function Yt(o){return Rr(o)?nl(o):b(o)}function Ir(o){return Rr(o)?nl(o,!0):R(o)}function iM(o,l){var d={};return l=pe(l,3),nn(o,function(v,w,O){qn(d,l(v,w,O),v)}),d}function sM(o,l){var d={};return l=pe(l,3),nn(o,function(v,w,O){qn(d,w,l(v,w,O))}),d}var oM=ol(function(o,l,d){Pe(o,l,d)}),jE=ol(function(o,l,d,v){Pe(o,l,d,v)}),aM=Hi(function(o,l){var d={};if(o==null)return d;var v=!1;l=tt(l,function(O){return O=$s(O,o),v||(v=O.length>1),O}),pi(o,nv(o),d),v&&(d=mr(d,h|g|m,tT));for(var w=l.length;w--;)Ky(d,l[w]);return d});function lM(o,l){return UE(o,yh(pe(l)))}var uM=Hi(function(o,l){return o==null?{}:NA(o,l)});function UE(o,l){if(o==null)return{};var d=tt(nv(o),function(v){return[v]});return l=pe(l),Tw(o,d,function(v,w){return l(v,w[0])})}function cM(o,l,d){l=$s(l,o);var v=-1,w=l.length;for(w||(w=1,o=t);++v<w;){var O=o==null?t:o[mi(l[v])];O===t&&(v=w,O=d),o=Wi(O)?O.call(o):O}return o}function fM(o,l,d){return o==null?o:lc(o,l,d)}function dM(o,l,d,v){return v=typeof v=="function"?v:t,o==null?o:lc(o,l,d,v)}var BE=eE(Yt),HE=eE(Ir);function hM(o,l,d){var v=Ce(o),w=v||Ns(o)||ul(o);if(l=pe(l,4),d==null){var O=o&&o.constructor;w?d=v?new O:[]:bt(o)?d=Wi(O)?As(Ja(o)):{}:d={}}return(w?Ct:nn)(o,function(q,M,B){return l(d,q,M,B)}),d}function pM(o,l){return o==null?!0:Ky(o,l)}function mM(o,l,d){return o==null?o:Dw(o,l,Zy(d))}function gM(o,l,d,v){return v=typeof v=="function"?v:t,o==null?o:Dw(o,l,Zy(d),v)}function cl(o){return o==null?[]:Gu(o,Yt(o))}function yM(o){return o==null?[]:Gu(o,Ir(o))}function vM(o,l,d){return d===t&&(d=l,l=t),d!==t&&(d=cn(d),d=d===d?d:0),l!==t&&(l=cn(l),l=l===l?l:0),ji(cn(o),l,d)}function SM(o,l,d){return l=Yi(l),d===t?(d=l,l=0):d=Yi(d),o=cn(o),Uy(o,l,d)}function bM(o,l,d){if(d&&typeof d!="boolean"&&gr(o,l,d)&&(l=d=t),d===t&&(typeof l=="boolean"?(d=l,l=t):typeof o=="boolean"&&(d=o,o=t)),o===t&&l===t?(o=0,l=1):(o=Yi(o),l===t?(l=o,o=0):l=Yi(l)),o>l){var v=o;o=l,l=v}if(d||o%1||l%1){var w=Hd();return St(o+w*(l-o+vd("1e-"+((w+"").length-1))),l)}return Yy(o,l)}var _M=al(function(o,l,d){return l=l.toLowerCase(),o+(d?VE(l):l)});function VE(o){return Sv(Qe(o).toLowerCase())}function WE(o){return o=Qe(o),o&&o.replace(Ss,Ad).replace(Ag,"")}function wM(o,l,d){o=Qe(o),l=Vr(l);var v=o.length;d=d===t?v:ji(xe(d),0,v);var w=d;return d-=l.length,d>=0&&o.slice(d,w)==l}function EM(o){return o=Qe(o),o&&Ta.test(o)?o.replace(qi,Jg):o}function CM(o){return o=Qe(o),o&&Ge.test(o)?o.replace(_o,"\\$&"):o}var xM=al(function(o,l,d){return o+(d?"-":"")+l.toLowerCase()}),RM=al(function(o,l,d){return o+(d?" ":"")+l.toLowerCase()}),IM=zw("toLowerCase");function OM(o,l,d){o=Qe(o),l=xe(l);var v=l?li(o):0;if(!l||v>=l)return o;var w=(l-v)/2;return lh(Po(w),d)+o+lh(Ka(w),d)}function PM(o,l,d){o=Qe(o),l=xe(l);var v=l?li(o):0;return l&&v<l?o+lh(l-v,d):o}function kM(o,l,d){o=Qe(o),l=xe(l);var v=l?li(o):0;return l&&v<l?lh(l-v,d)+o:o}function AM(o,l,d){return d||l==null?l=0:l&&(l=+l),Bd(Qe(o).replace($i,""),l||0)}function TM(o,l,d){return(d?gr(o,l,d):l===t)?l=1:l=xe(l),Jy(Qe(o),l)}function qM(){var o=arguments,l=Qe(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var $M=al(function(o,l,d){return o+(d?"_":"")+l.toLowerCase()});function MM(o,l,d){return d&&typeof d!="number"&&gr(o,l,d)&&(l=d=t),d=d===t?he:d>>>0,d?(o=Qe(o),o&&(typeof l=="string"||l!=null&&!gv(l))&&(l=Vr(l),!l&&tn(o))?Ms(pr(o),0,d):o.split(l,d)):[]}var NM=al(function(o,l,d){return o+(d?" ":"")+Sv(l)});function DM(o,l,d){return o=Qe(o),d=d==null?0:ji(xe(d),0,o.length),l=Vr(l),o.slice(d,d+l.length)==l}function FM(o,l,d){var v=I.templateSettings;d&&gr(o,l,d)&&(l=t),o=Qe(o),l=bh({},l,v,tE);var w=bh({},l.imports,v.imports,tE),O=Yt(w),q=Gu(w,O),M,B,G=0,Q=l.interpolate||si,X="__p += '",re=Pn((l.escape||si).source+"|"+Q.source+"|"+(Q===Qf?In:si).source+"|"+(l.evaluate||si).source+"|$","g"),ue="//# sourceURL="+(Ke.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ng+"]")+`
|
|
4
|
-
`;o.replace(re,function(
|
|
5
|
-
__e(`+
|
|
6
|
-
'`),
|
|
7
|
-
`+
|
|
8
|
-
__p += '`),
|
|
9
|
-
((__t = (`+
|
|
10
|
-
'`),G=
|
|
11
|
-
`;var me=
|
|
12
|
-
`+
|
|
3
|
+
`)}function vT(o){return Ee(o)||jo(o)||!!(jd&&o&&o[jd])}function ji(o,l){var d=typeof o;return l=l??nt,!!l&&(d=="number"||d!="symbol"&&cs.test(o))&&o>-1&&o%1==0&&o<l}function Sr(o,l,d){if(!bt(d))return!1;var y=typeof l;return(y=="number"?Or(d)&&ji(l,d.length):y=="string"&&l in d)?Fn(d[l],o):!1}function sv(o,l){if(Ee(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||Yr(o)?!0:qe.test(o)||!xr.test(o)||l!=null&&o in Ue(l)}function ST(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function ov(o){var l=dh(o),d=I[l];if(typeof d!="function"||!(l in $e.prototype))return!1;if(o===d)return!0;var y=rv(d);return!!y&&o===y[0]}function bT(o){return!!Dd&&Dd in o}var _T=Ro?Ui:xv;function _c(o){var l=o&&o.constructor,d=typeof l=="function"&&l.prototype||ys;return o===d}function aE(o){return o===o&&!bt(o)}function lE(o,l){return function(d){return d==null?!1:d[o]===l&&(l!==t||o in Ue(d))}}function wT(o){var l=vh(o,function(y){return d.size===f&&d.clear(),y}),d=l.cache;return l}function ET(o,l){var d=o[1],y=l[1],_=d|y,O=_<(C|A|X),q=y==X&&d==B||y==X&&d==k&&o[7].length<=l[8]||y==(X|k)&&l[7].length<=l[8]&&d==B;if(!(O||q))return o;y&C&&(o[2]=l[2],_|=d&C?0:T);var M=l[3];if(M){var U=o[3];o[3]=U?Vw(U,M,l[4]):M,o[4]=U?on(o[3],h):l[4]}return M=l[5],M&&(U=o[5],o[5]=U?Ww(U,M,l[6]):M,o[6]=U?on(o[5],h):l[6]),M=l[7],M&&(o[7]=M),y&X&&(o[8]=o[8]==null?l[8]:Lt(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=_,o}function xT(o){var l=[];if(o!=null)for(var d in Ue(o))l.push(d);return l}function CT(o){return Ga.call(o)}function uE(o,l,d){return l=pt(l===t?o.length-1:l,0),function(){for(var y=arguments,_=-1,O=pt(y.length-l,0),q=V(O);++_<O;)q[_]=y[l+_];_=-1;for(var M=V(l+1);++_<l;)M[_]=y[_];return M[l]=d(q),hr(o,this,M)}}function cE(o,l){return l.length<2?o:Di(o,cn(l,0,-1))}function RT(o,l){for(var d=o.length,y=Lt(l.length,d),_=Ir(o);y--;){var O=l[y];o[y]=ji(O,d)?_[O]:t}return o}function av(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var fE=hE($w),wc=cy||function(o,l){return qt.setTimeout(o,l)},lv=hE(KA);function dE(o,l,d){var y=l+"";return lv(o,yT(y,IT(pT(y),d)))}function hE(o){var l=0,d=0;return function(){var y=Bd(),_=L-(y-d);if(d=y,_>0){if(++l>=D)return arguments[0]}else l=0;return o.apply(t,arguments)}}function ph(o,l){var d=-1,y=o.length,_=y-1;for(l=l===t?y:l;++d<l;){var O=Vy(d,_),q=o[O];o[O]=o[d],o[d]=q}return o.length=l,o}var pE=wT(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(Hu,function(d,y,_,O){l.push(_?O.replace(Pn,"$1"):y||d)}),l});function Dn(o){if(typeof o=="string"||Yr(o))return o;var l=o+"";return l=="0"&&1/o==-de?"-0":l}function Lo(o){if(o!=null){try{return Ka.call(o)}catch{}try{return o+""}catch{}}return""}function IT(o,l){return pr(le,function(d){var y="_."+d[0];l&d[1]&&!Ba(o,y)&&o.push(y)}),o.sort()}function mE(o){if(o instanceof $e)return o.clone();var l=new tr(o.__wrapped__,o.__chain__);return l.__actions__=Ir(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function OT(o,l,d){(d?Sr(o,l,d):l===t)?l=1:l=pt(xe(l),0);var y=o==null?0:o.length;if(!y||l<1)return[];for(var _=0,O=0,q=V(Po(y/l));_<y;)q[O++]=cn(o,_,_+=l);return q}function PT(o){for(var l=-1,d=o==null?0:o.length,y=0,_=[];++l<d;){var O=o[l];O&&(_[y++]=O)}return _}function kT(){var o=arguments.length;if(!o)return[];for(var l=V(o-1),d=arguments[0],y=o;y--;)l[y-1]=arguments[y];return si(Ee(d)?Ir(d):[d],jt(l,1))}var AT=ke(function(o,l){return Pt(o)?Mo(o,jt(l,1,Pt,!0)):[]}),TT=ke(function(o,l){var d=fn(l);return Pt(d)&&(d=t),Pt(o)?Mo(o,jt(l,1,Pt,!0),pe(d,2)):[]}),qT=ke(function(o,l){var d=fn(l);return Pt(d)&&(d=t),Pt(o)?Mo(o,jt(l,1,Pt,!0),t,d):[]});function $T(o,l,d){var y=o==null?0:o.length;return y?(l=d||l===t?1:xe(l),cn(o,l<0?0:l,y)):[]}function MT(o,l,d){var y=o==null?0:o.length;return y?(l=d||l===t?1:xe(l),l=y-l,cn(o,0,l<0?0:l)):[]}function NT(o,l){return o&&o.length?oh(o,pe(l,3),!0,!0):[]}function DT(o,l){return o&&o.length?oh(o,pe(l,3),!0):[]}function FT(o,l,d,y){var _=o==null?0:o.length;return _?(d&&typeof d!="number"&&Sr(o,l,d)&&(d=0,y=_),Dy(o,l,d,y)):[]}function gE(o,l,d){var y=o==null?0:o.length;if(!y)return-1;var _=d==null?0:xe(d);return _<0&&(_=pt(y+_,0)),Va(o,pe(l,3),_)}function yE(o,l,d){var y=o==null?0:o.length;if(!y)return-1;var _=y-1;return d!==t&&(_=xe(d),_=d<0?pt(y+_,0):Lt(_,y-1)),Va(o,pe(l,3),_,!0)}function vE(o){var l=o==null?0:o.length;return l?jt(o,1):[]}function LT(o){var l=o==null?0:o.length;return l?jt(o,de):[]}function jT(o,l){var d=o==null?0:o.length;return d?(l=l===t?1:xe(l),jt(o,l)):[]}function UT(o){for(var l=-1,d=o==null?0:o.length,y={};++l<d;){var _=o[l];Hr(y,_[0],_[1])}return y}function SE(o){return o&&o.length?o[0]:t}function BT(o,l,d){var y=o==null?0:o.length;if(!y)return-1;var _=d==null?0:xe(d);return _<0&&(_=pt(y+_,0)),Ti(o,l,_)}function HT(o){var l=o==null?0:o.length;return l?cn(o,0,-1):[]}var VT=ke(function(o){var l=at(o,Ky);return l.length&&l[0]===o[0]?Vr(l):[]}),WT=ke(function(o){var l=fn(o),d=at(o,Ky);return l===fn(d)?l=t:d.pop(),d.length&&d[0]===o[0]?Vr(d,pe(l,2)):[]}),YT=ke(function(o){var l=fn(o),d=at(o,Ky);return l=typeof l=="function"?l:t,l&&d.pop(),d.length&&d[0]===o[0]?Vr(d,t,l):[]});function JT(o,l){return o==null?"":il.call(o,l)}function fn(o){var l=o==null?0:o.length;return l?o[l-1]:t}function zT(o,l,d){var y=o==null?0:o.length;if(!y)return-1;var _=y;return d!==t&&(_=xe(d),_=_<0?pt(y+_,0):Lt(_,y-1)),l===l?lc(o,l,_):Va(o,qi,_,!0)}function KT(o,l){return o&&o.length?Nn(o,xe(l)):t}var GT=ke(bE);function bE(o,l){return o&&o.length&&l&&l.length?Hy(o,l):o}function QT(o,l,d){return o&&o.length&&l&&l.length?Hy(o,l,pe(d,2)):o}function ZT(o,l,d){return o&&o.length&&l&&l.length?Hy(o,l,t,d):o}var XT=Li(function(o,l){var d=o==null?0:o.length,y=pc(o,l);return qw(o,at(l,function(_){return ji(_,d)?+_:_}).sort(Hw)),y});function eq(o,l){var d=[];if(!(o&&o.length))return d;var y=-1,_=[],O=o.length;for(l=pe(l,3);++y<O;){var q=o[y];l(q,y,o)&&(d.push(q),_.push(y))}return qw(o,_),d}function uv(o){return o==null?o:dy.call(o)}function tq(o,l,d){var y=o==null?0:o.length;return y?(d&&typeof d!="number"&&Sr(o,l,d)?(l=0,d=y):(l=l==null?0:xe(l),d=d===t?y:xe(d)),cn(o,l,d)):[]}function rq(o,l){return sh(o,l)}function nq(o,l,d){return Yy(o,l,pe(d,2))}function iq(o,l){var d=o==null?0:o.length;if(d){var y=sh(o,l);if(y<d&&Fn(o[y],l))return y}return-1}function sq(o,l){return sh(o,l,!0)}function oq(o,l,d){return Yy(o,l,pe(d,2),!0)}function aq(o,l){var d=o==null?0:o.length;if(d){var y=sh(o,l,!0)-1;if(Fn(o[y],l))return y}return-1}function lq(o){return o&&o.length?Mw(o):[]}function uq(o,l){return o&&o.length?Mw(o,pe(l,2)):[]}function cq(o){var l=o==null?0:o.length;return l?cn(o,1,l):[]}function fq(o,l,d){return o&&o.length?(l=d||l===t?1:xe(l),cn(o,0,l<0?0:l)):[]}function dq(o,l,d){var y=o==null?0:o.length;return y?(l=d||l===t?1:xe(l),l=y-l,cn(o,l<0?0:l,y)):[]}function hq(o,l){return o&&o.length?oh(o,pe(l,3),!1,!0):[]}function pq(o,l){return o&&o.length?oh(o,pe(l,3)):[]}var mq=ke(function(o){return xs(jt(o,1,Pt,!0))}),gq=ke(function(o){var l=fn(o);return Pt(l)&&(l=t),xs(jt(o,1,Pt,!0),pe(l,2))}),yq=ke(function(o){var l=fn(o);return l=typeof l=="function"?l:t,xs(jt(o,1,Pt,!0),t,l)});function vq(o){return o&&o.length?xs(o):[]}function Sq(o,l){return o&&o.length?xs(o,pe(l,2)):[]}function bq(o,l){return l=typeof l=="function"?l:t,o&&o.length?xs(o,t,l):[]}function cv(o){if(!(o&&o.length))return[];var l=0;return o=ii(o,function(d){if(Pt(d))return l=pt(d.length,l),!0}),oc(l,function(d){return at(o,wo(d))})}function _E(o,l){if(!(o&&o.length))return[];var d=cv(o);return l==null?d:at(d,function(y){return hr(l,t,y)})}var _q=ke(function(o,l){return Pt(o)?Mo(o,l):[]}),wq=ke(function(o){return zy(ii(o,Pt))}),Eq=ke(function(o){var l=fn(o);return Pt(l)&&(l=t),zy(ii(o,Pt),pe(l,2))}),xq=ke(function(o){var l=fn(o);return l=typeof l=="function"?l:t,zy(ii(o,Pt),t,l)}),Cq=ke(cv);function Rq(o,l){return Lw(o||[],l||[],vr)}function Iq(o,l){return Lw(o||[],l||[],Sc)}var Oq=ke(function(o){var l=o.length,d=l>1?o[l-1]:t;return d=typeof d=="function"?(o.pop(),d):t,_E(o,d)});function wE(o){var l=I(o);return l.__chain__=!0,l}function Pq(o,l){return l(o),o}function mh(o,l){return l(o)}var kq=Li(function(o){var l=o.length,d=l?o[0]:0,y=this.__wrapped__,_=function(O){return pc(O,o)};return l>1||this.__actions__.length||!(y instanceof $e)||!ji(d)?this.thru(_):(y=y.slice(d,+d+(l?1:0)),y.__actions__.push({func:mh,args:[_],thisArg:t}),new tr(y,this.__chain__).thru(function(O){return l&&!O.length&&O.push(t),O}))});function Aq(){return wE(this)}function Tq(){return new tr(this.value(),this.__chain__)}function qq(){this.__values__===t&&(this.__values__=NE(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function $q(){return this}function Mq(o){for(var l,d=this;d instanceof al;){var y=mE(d);y.__index__=0,y.__values__=t,l?_.__wrapped__=y:l=y;var _=y;d=d.__wrapped__}return _.__wrapped__=o,l}function Nq(){var o=this.__wrapped__;if(o instanceof $e){var l=o;return this.__actions__.length&&(l=new $e(this)),l=l.reverse(),l.__actions__.push({func:mh,args:[uv],thisArg:t}),new tr(l,this.__chain__)}return this.thru(uv)}function Dq(){return Fw(this.__wrapped__,this.__actions__)}var Fq=ah(function(o,l,d){Ze.call(o,d)?++o[d]:Hr(o,d,1)});function Lq(o,l,d){var y=Ee(o)?Pd:Ny;return d&&Sr(o,l,d)&&(l=t),y(o,pe(l,3))}function jq(o,l){var d=Ee(o)?ii:th;return d(o,pe(l,3))}var Uq=Kw(gE),Bq=Kw(yE);function Hq(o,l){return jt(gh(o,l),1)}function Vq(o,l){return jt(gh(o,l),de)}function Wq(o,l,d){return d=d===t?1:xe(d),jt(gh(o,l),d)}function EE(o,l){var d=Ee(o)?pr:fi;return d(o,pe(l,3))}function xE(o,l){var d=Ee(o)?rc:eh;return d(o,pe(l,3))}var Yq=ah(function(o,l,d){Ze.call(o,d)?o[d].push(l):Hr(o,d,[l])});function Jq(o,l,d,y){o=Or(o)?o:gl(o),d=d&&!y?xe(d):0;var _=o.length;return d<0&&(d=pt(_+d,0)),_h(o)?d<=_&&o.indexOf(l,d)>-1:!!_&&Ti(o,l,d)>-1}var zq=ke(function(o,l,d){var y=-1,_=typeof l=="function",O=Or(o)?V(o.length):[];return fi(o,function(q){O[++y]=_?hr(l,q,d):No(q,l,d)}),O}),Kq=ah(function(o,l,d){Hr(o,d,l)});function gh(o,l){var d=Ee(o)?at:ie;return d(o,pe(l,3))}function Gq(o,l,d,y){return o==null?[]:(Ee(l)||(l=l==null?[]:[l]),d=y?t:d,Ee(d)||(d=d==null?[]:[d]),Aw(o,l,d))}var Qq=ah(function(o,l,d){o[d?0:1].push(l)},function(){return[[],[]]});function Zq(o,l,d){var y=Ee(o)?nc:Wa,_=arguments.length<3;return y(o,pe(l,4),d,_,fi)}function Xq(o,l,d){var y=Ee(o)?Fg:Wa,_=arguments.length<3;return y(o,pe(l,4),d,_,eh)}function e$(o,l){var d=Ee(o)?ii:th;return d(o,Sh(pe(l,3)))}function t$(o){var l=Ee(o)?Qd:JA;return l(o)}function r$(o,l,d){(d?Sr(o,l,d):l===t)?l=1:l=xe(l);var y=Ee(o)?Ty:zA;return y(o,l)}function n$(o){var l=Ee(o)?qy:GA;return l(o)}function i$(o){if(o==null)return 0;if(Or(o))return _h(o)?oi(o):o.length;var l=nr(o);return l==Ht||l==dr?o.size:R(o).length}function s$(o,l,d){var y=Ee(o)?Ha:QA;return d&&Sr(o,l,d)&&(l=t),y(o,pe(l,3))}var o$=ke(function(o,l){if(o==null)return[];var d=l.length;return d>1&&Sr(o,l[0],l[1])?l=[]:d>2&&Sr(l[0],l[1],l[2])&&(l=[l[0]]),Aw(o,jt(l,1),[])}),yh=uy||function(){return qt.Date.now()};function a$(o,l){if(typeof l!="function")throw new yr(i);return o=xe(o),function(){if(--o<1)return l.apply(this,arguments)}}function CE(o,l,d){return l=d?t:l,l=o&&l==null?o.length:l,Fi(o,X,t,t,t,t,l)}function RE(o,l){var d;if(typeof l!="function")throw new yr(i);return o=xe(o),function(){return--o>0&&(d=l.apply(this,arguments)),o<=1&&(l=t),d}}var fv=ke(function(o,l,d){var y=C;if(d.length){var _=on(d,pl(fv));y|=H}return Fi(o,y,l,d,_)}),IE=ke(function(o,l,d){var y=C|A;if(d.length){var _=on(d,pl(IE));y|=H}return Fi(l,y,o,d,_)});function OE(o,l,d){l=d?t:l;var y=Fi(o,B,t,t,t,t,t,l);return y.placeholder=OE.placeholder,y}function PE(o,l,d){l=d?t:l;var y=Fi(o,Y,t,t,t,t,t,l);return y.placeholder=PE.placeholder,y}function kE(o,l,d){var y,_,O,q,M,U,G=0,Q=!1,ee=!1,re=!0;if(typeof o!="function")throw new yr(i);l=dn(l)||0,bt(d)&&(Q=!!d.leading,ee="maxWait"in d,O=ee?pt(dn(d.maxWait)||0,l):O,re="trailing"in d?!!d.trailing:re);function ue(kt){var Ln=y,Hi=_;return y=_=t,G=kt,q=o.apply(Hi,Ln),q}function me(kt){return G=kt,M=wc(Le,l),Q?ue(kt):q}function Oe(kt){var Ln=kt-U,Hi=kt-G,GE=l-Ln;return ee?Lt(GE,O-Hi):GE}function he(kt){var Ln=kt-U,Hi=kt-G;return U===t||Ln>=l||Ln<0||ee&&Hi>=O}function Le(){var kt=yh();if(he(kt))return Be(kt);M=wc(Le,Oe(kt))}function Be(kt){return M=t,re&&y?ue(kt):(y=_=t,q)}function Jr(){M!==t&&jw(M),G=0,y=U=_=M=t}function br(){return M===t?q:Be(yh())}function zr(){var kt=yh(),Ln=he(kt);if(y=arguments,_=this,U=kt,Ln){if(M===t)return me(U);if(ee)return jw(M),M=wc(Le,l),ue(U)}return M===t&&(M=wc(Le,l)),q}return zr.cancel=Jr,zr.flush=br,zr}var l$=ke(function(o,l){return mc(o,1,l)}),u$=ke(function(o,l,d){return mc(o,dn(l)||0,d)});function c$(o){return Fi(o,w)}function vh(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new yr(i);var d=function(){var y=arguments,_=l?l.apply(this,y):y[0],O=d.cache;if(O.has(_))return O.get(_);var q=o.apply(this,y);return d.cache=O.set(_,q)||O,q};return d.cache=new(vh.Cache||qn),d}vh.Cache=qn;function Sh(o){if(typeof o!="function")throw new yr(i);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function f$(o){return RE(2,o)}var d$=ZA(function(o,l){l=l.length==1&&Ee(l[0])?at(l[0],mr(pe())):at(jt(l,1),mr(pe()));var d=l.length;return ke(function(y){for(var _=-1,O=Lt(y.length,d);++_<O;)y[_]=l[_].call(this,y[_]);return hr(o,this,y)})}),dv=ke(function(o,l){var d=on(l,pl(dv));return Fi(o,H,t,l,d)}),AE=ke(function(o,l){var d=on(l,pl(AE));return Fi(o,K,t,l,d)}),h$=Li(function(o,l){return Fi(o,k,t,t,t,l)});function p$(o,l){if(typeof o!="function")throw new yr(i);return l=l===t?l:xe(l),ke(o,l)}function m$(o,l){if(typeof o!="function")throw new yr(i);return l=l==null?0:pt(xe(l),0),ke(function(d){var y=d[l],_=Rs(d,0,l);return y&&si(_,y),hr(o,this,_)})}function g$(o,l,d){var y=!0,_=!0;if(typeof o!="function")throw new yr(i);return bt(d)&&(y="leading"in d?!!d.leading:y,_="trailing"in d?!!d.trailing:_),kE(o,l,{leading:y,maxWait:l,trailing:_})}function y$(o){return CE(o,1)}function v$(o,l){return dv(Gy(l),o)}function S$(){if(!arguments.length)return[];var o=arguments[0];return Ee(o)?o:[o]}function b$(o){return rr(o,S)}function _$(o,l){return l=typeof l=="function"?l:t,rr(o,S,l)}function w$(o){return rr(o,g|S)}function E$(o,l){return l=typeof l=="function"?l:t,rr(o,g|S,l)}function x$(o,l){return l==null||ln(o,l,Yt(l))}function Fn(o,l){return o===l||o!==o&&l!==l}var C$=fh(yc),R$=fh(function(o,l){return o>=l}),jo=ih((function(){return arguments})())?ih:function(o){return xt(o)&&Ze.call(o,"callee")&&!Io.call(o,"callee")},Ee=V.isArray,I$=tc?mr(tc):Uy;function Or(o){return o!=null&&bh(o.length)&&!Ui(o)}function Pt(o){return xt(o)&&Or(o)}function O$(o){return o===!0||o===!1||xt(o)&&zt(o)==Cn}var Is=nl||xv,P$=Id?mr(Id):By;function k$(o){return xt(o)&&o.nodeType===1&&!Ec(o)}function A$(o){if(o==null)return!0;if(Or(o)&&(Ee(o)||typeof o=="string"||typeof o.splice=="function"||Is(o)||ml(o)||jo(o)))return!o.length;var l=nr(o);if(l==Ht||l==dr)return!o.size;if(_c(o))return!R(o).length;for(var d in o)if(Ze.call(o,d))return!1;return!0}function T$(o,l){return Do(o,l)}function q$(o,l,d){d=typeof d=="function"?d:t;var y=d?d(o,l):t;return y===t?Do(o,l,t,d):!!y}function hv(o){if(!xt(o))return!1;var l=zt(o);return l==ht||l==er||typeof o.message=="string"&&typeof o.name=="string"&&!Ec(o)}function $$(o){return typeof o=="number"&&Mi(o)}function Ui(o){if(!bt(o))return!1;var l=zt(o);return l==tn||l==uo||l==Et||l==ld}function TE(o){return typeof o=="number"&&o==xe(o)}function bh(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=nt}function bt(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function xt(o){return o!=null&&typeof o=="object"}var qE=Od?mr(Od):ws;function M$(o,l){return o===l||Es(o,l,nv(l))}function N$(o,l,d){return d=typeof d=="function"?d:t,Es(o,l,nv(l),d)}function D$(o){return $E(o)&&o!=+o}function F$(o){if(_T(o))throw new ve(n);return Fe(o)}function L$(o){return o===null}function j$(o){return o==null}function $E(o){return typeof o=="number"||xt(o)&&zt(o)==co}function Ec(o){if(!xt(o)||zt(o)!=Rn)return!1;var l=Xa(o);if(l===null)return!0;var d=Ze.call(l,"constructor")&&l.constructor;return typeof d=="function"&&d instanceof d&&Ka.call(d)==sy}var pv=_o?mr(_o):c;function U$(o){return TE(o)&&o>=-nt&&o<=nt}var ME=kn?mr(kn):p;function _h(o){return typeof o=="string"||!Ee(o)&&xt(o)&&zt(o)==fo}function Yr(o){return typeof o=="symbol"||xt(o)&&zt(o)==Oa}var ml=Ua?mr(Ua):v;function B$(o){return o===t}function H$(o){return xt(o)&&nr(o)==Ft}function V$(o){return xt(o)&&zt(o)==cd}var W$=fh(W),Y$=fh(function(o,l){return o<=l});function NE(o){if(!o)return[];if(Or(o))return _h(o)?gr(o):Ir(o);if(Oo&&o[Oo])return Kg(o[Oo]());var l=nr(o),d=l==Ht?gs:l==dr?Ja:gl;return d(o)}function Bi(o){if(!o)return o===0?o:0;if(o=dn(o),o===de||o===-de){var l=o<0?-1:1;return l*Ie}return o===o?o:0}function xe(o){var l=Bi(o),d=l%1;return l===l?d?l-d:l:0}function DE(o){return o?ci(xe(o),0,Te):0}function dn(o){if(typeof o=="number")return o;if(Yr(o))return ge;if(bt(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=bt(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=ac(o);var d=go.test(o);return d||pg.test(o)?Ng(o.slice(2),d?2:8):hg.test(o)?ge:+o}function FE(o){return di(o,Pr(o))}function J$(o){return o?ci(xe(o),-nt,nt):o===0?o:0}function tt(o){return o==null?"":Wr(o)}var z$=dl(function(o,l){if(_c(l)||Or(l)){di(l,Yt(l),o);return}for(var d in l)Ze.call(l,d)&&vr(o,d,l[d])}),LE=dl(function(o,l){di(l,Pr(l),o)}),jE=dl(function(o,l,d,y){di(l,Pr(l),o,y)}),mv=dl(function(o,l,d,y){di(l,Yt(l),o,y)}),K$=Li(pc);function G$(o,l){var d=bs(o);return l==null?d:Xd(d,l)}var Q$=ke(function(o,l){o=Ue(o);var d=-1,y=l.length,_=y>2?l[2]:t;for(_&&Sr(l[0],l[1],_)&&(y=1);++d<y;)for(var O=l[d],q=Pr(O),M=-1,U=q.length;++M<U;){var G=q[M],Q=o[G];(Q===t||Fn(Q,ys[G])&&!Ze.call(o,G))&&(o[G]=O[G])}return o}),Z$=ke(function(o){return o.push(t,rE),hr(UE,t,o)});function X$(o,l){return kd(o,pe(l,3),un)}function eM(o,l){return kd(o,pe(l,3),$n)}function tM(o,l){return o==null?o:gc(o,pe(l,3),Pr)}function rM(o,l){return o==null?o:rh(o,pe(l,3),Pr)}function nM(o,l){return o&&un(o,pe(l,3))}function iM(o,l){return o&&$n(o,pe(l,3))}function sM(o){return o==null?[]:fl(o,Yt(o))}function oM(o){return o==null?[]:fl(o,Pr(o))}function gv(o,l,d){var y=o==null?t:Di(o,l);return y===t?d:y}function aM(o,l){return o!=null&&sE(o,l,Fy)}function yv(o,l){return o!=null&&sE(o,l,Ly)}var lM=Qw(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Ga.call(l)),o[l]=d},Sv(kr)),uM=Qw(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Ga.call(l)),Ze.call(o,l)?o[l].push(d):o[l]=[d]},pe),cM=ke(No);function Yt(o){return Or(o)?Gd(o):R(o)}function Pr(o){return Or(o)?Gd(o,!0):$(o)}function fM(o,l){var d={};return l=pe(l,3),un(o,function(y,_,O){Hr(d,l(y,_,O),y)}),d}function dM(o,l){var d={};return l=pe(l,3),un(o,function(y,_,O){Hr(d,_,l(y,_,O))}),d}var hM=dl(function(o,l,d){$t(o,l,d)}),UE=dl(function(o,l,d,y){$t(o,l,d,y)}),pM=Li(function(o,l){var d={};if(o==null)return d;var y=!1;l=at(l,function(O){return O=Cs(O,o),y||(y=O.length>1),O}),di(o,tv(o),d),y&&(d=rr(d,g|m|S,uT));for(var _=l.length;_--;)Jy(d,l[_]);return d});function mM(o,l){return BE(o,Sh(pe(l)))}var gM=Li(function(o,l){return o==null?{}:VA(o,l)});function BE(o,l){if(o==null)return{};var d=at(tv(o),function(y){return[y]});return l=pe(l),Tw(o,d,function(y,_){return l(y,_[0])})}function yM(o,l,d){l=Cs(l,o);var y=-1,_=l.length;for(_||(_=1,o=t);++y<_;){var O=o==null?t:o[Dn(l[y])];O===t&&(y=_,O=d),o=Ui(O)?O.call(o):O}return o}function vM(o,l,d){return o==null?o:Sc(o,l,d)}function SM(o,l,d,y){return y=typeof y=="function"?y:t,o==null?o:Sc(o,l,d,y)}var HE=eE(Yt),VE=eE(Pr);function bM(o,l,d){var y=Ee(o),_=y||Is(o)||ml(o);if(l=pe(l,4),d==null){var O=o&&o.constructor;_?d=y?new O:[]:bt(o)?d=Ui(O)?bs(Xa(o)):{}:d={}}return(_?pr:un)(o,function(q,M,U){return l(d,q,M,U)}),d}function _M(o,l){return o==null?!0:Jy(o,l)}function wM(o,l,d){return o==null?o:Dw(o,l,Gy(d))}function EM(o,l,d,y){return y=typeof y=="function"?y:t,o==null?o:Dw(o,l,Gy(d),y)}function gl(o){return o==null?[]:Ya(o,Yt(o))}function xM(o){return o==null?[]:Ya(o,Pr(o))}function CM(o,l,d){return d===t&&(d=l,l=t),d!==t&&(d=dn(d),d=d===d?d:0),l!==t&&(l=dn(l),l=l===l?l:0),ci(dn(o),l,d)}function RM(o,l,d){return l=Bi(l),d===t?(d=l,l=0):d=Bi(d),o=dn(o),jy(o,l,d)}function IM(o,l,d){if(d&&typeof d!="boolean"&&Sr(o,l,d)&&(l=d=t),d===t&&(typeof l=="boolean"?(d=l,l=t):typeof o=="boolean"&&(d=o,o=t)),o===t&&l===t?(o=0,l=1):(o=Bi(o),l===t?(l=o,o=0):l=Bi(l)),o>l){var y=o;o=l,l=y}if(d||o%1||l%1){var _=Hd();return Lt(o+_*(l-o+Cd("1e-"+((_+"").length-1))),l)}return Vy(o,l)}var OM=hl(function(o,l,d){return l=l.toLowerCase(),o+(d?WE(l):l)});function WE(o){return vv(tt(o).toLowerCase())}function YE(o){return o=tt(o),o&&o.replace(yo,Wg).replace(Pg,"")}function PM(o,l,d){o=tt(o),l=Wr(l);var y=o.length;d=d===t?y:ci(xe(d),0,y);var _=d;return d-=l.length,d>=0&&o.slice(d,_)==l}function kM(o){return o=tt(o),o&&oe.test(o)?o.replace(Ta,Yg):o}function AM(o){return o=tt(o),o&&mo.test(o)?o.replace(Ge,"\\$&"):o}var TM=hl(function(o,l,d){return o+(d?"-":"")+l.toLowerCase()}),qM=hl(function(o,l,d){return o+(d?" ":"")+l.toLowerCase()}),$M=zw("toLowerCase");function MM(o,l,d){o=tt(o),l=xe(l);var y=l?oi(o):0;if(!l||y>=l)return o;var _=(l-y)/2;return ch(ko(_),d)+o+ch(Po(_),d)}function NM(o,l,d){o=tt(o),l=xe(l);var y=l?oi(o):0;return l&&y<l?o+ch(l-y,d):o}function DM(o,l,d){o=tt(o),l=xe(l);var y=l?oi(o):0;return l&&y<l?ch(l-y,d)+o:o}function FM(o,l,d){return d||l==null?l=0:l&&(l=+l),fy(tt(o).replace(Vu,""),l||0)}function LM(o,l,d){return(d?Sr(o,l,d):l===t)?l=1:l=xe(l),Wy(tt(o),l)}function jM(){var o=arguments,l=tt(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var UM=hl(function(o,l,d){return o+(d?"_":"")+l.toLowerCase()});function BM(o,l,d){return d&&typeof d!="number"&&Sr(o,l,d)&&(l=d=t),d=d===t?Te:d>>>0,d?(o=tt(o),o&&(typeof l=="string"||l!=null&&!pv(l))&&(l=Wr(l),!l&&ms(o))?Rs(gr(o),0,d):o.split(l,d)):[]}var HM=hl(function(o,l,d){return o+(d?" ":"")+vv(l)});function VM(o,l,d){return o=tt(o),d=d==null?0:ci(xe(d),0,o.length),l=Wr(l),o.slice(d,d+l.length)==l}function WM(o,l,d){var y=I.templateSettings;d&&Sr(o,l,d)&&(l=t),o=tt(o),l=mv({},l,y,tE);var _=mv({},l.imports,y.imports,tE),O=Yt(_),q=Ya(_,O);pr(O,function(he){if(Cr.test(he))throw new ve(a)});var M,U,G=0,Q=l.interpolate||vo,ee="__p += '",re=za((l.escape||vo).source+"|"+Q.source+"|"+(Q===rn?ki:vo).source+"|"+(l.evaluate||vo).source+"|$","g"),ue="//# sourceURL="+(Ze.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$g+"]")+`
|
|
4
|
+
`;o.replace(re,function(he,Le,Be,Jr,br,zr){return Be||(Be=Jr),ee+=o.slice(G,zr).replace(mg,Jg),Le&&(M=!0,ee+=`' +
|
|
5
|
+
__e(`+Le+`) +
|
|
6
|
+
'`),br&&(U=!0,ee+=`';
|
|
7
|
+
`+br+`;
|
|
8
|
+
__p += '`),Be&&(ee+=`' +
|
|
9
|
+
((__t = (`+Be+`)) == null ? '' : __t) +
|
|
10
|
+
'`),G=zr+he.length,he}),ee+=`';
|
|
11
|
+
`;var me=Ze.call(l,"variable")&&l.variable;if(!me)ee=`with (obj) {
|
|
12
|
+
`+ee+`
|
|
13
13
|
}
|
|
14
|
-
`;else if(
|
|
14
|
+
`;else if(Cr.test(me))throw new ve(s);ee=(U?ee.replace(Aa,""):ee).replace(cg,"$1").replace(po,"$1;"),ee="function("+(me||"obj")+`) {
|
|
15
15
|
`+(me?"":`obj || (obj = {});
|
|
16
|
-
`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(
|
|
16
|
+
`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(U?`, __j = Array.prototype.join;
|
|
17
17
|
function print() { __p += __j.call(arguments, '') }
|
|
18
18
|
`:`;
|
|
19
|
-
`)+
|
|
20
|
-
}`;var ke=JE(function(){return Ye(O,ue+"return "+X).apply(t,q)});if(ke.source=X,mv(ke))throw ke;return ke}function LM(o){return Qe(o).toLowerCase()}function jM(o){return Qe(o).toUpperCase()}function UM(o,l,d){if(o=Qe(o),o&&(d||l===t))return Pd(o);if(!o||!(l=Vr(l)))return o;var v=pr(o),w=pr(l),O=st(v,w),q=kd(v,w)+1;return Ms(v,O,q).join("")}function BM(o,l,d){if(o=Qe(o),o&&(d||l===t))return o.slice(0,Ba(o)+1);if(!o||!(l=Vr(l)))return o;var v=pr(o),w=kd(v,pr(l))+1;return Ms(v,0,w).join("")}function HM(o,l,d){if(o=Qe(o),o&&(d||l===t))return o.replace($i,"");if(!o||!(l=Vr(l)))return o;var v=pr(o),w=st(v,pr(l));return Ms(v,w).join("")}function VM(o,l){var d=E,v=P;if(bt(l)){var w="separator"in l?l.separator:w;d="length"in l?xe(l.length):d,v="omission"in l?Vr(l.omission):v}o=Qe(o);var O=o.length;if(tn(o)){var q=pr(o);O=q.length}if(d>=O)return o;var M=d-li(v);if(M<1)return v;var B=q?Ms(q,0,M).join(""):o.slice(0,M);if(w===t)return B+v;if(q&&(M+=B.length-M),gv(w)){if(o.slice(M).search(w)){var G,Q=B;for(w.global||(w=Pn(w.source,Qe(ii.exec(w))+"g")),w.lastIndex=0;G=w.exec(Q);)var X=G.index;B=B.slice(0,X===t?M:X)}}else if(o.indexOf(Vr(w),M)!=M){var re=B.lastIndexOf(w);re>-1&&(B=B.slice(0,re))}return B+v}function WM(o){return o=Qe(o),o&&Mu.test(o)?o.replace(vs,ey):o}var YM=al(function(o,l,d){return o+(d?" ":"")+l.toUpperCase()}),Sv=zw("toUpperCase");function YE(o,l,d){return o=Qe(o),l=d?t:l,l===t?Gg(o)?ny(o):Vg(o):o.match(l)||[]}var JE=qe(function(o,l){try{return zt(o,t,l)}catch(d){return mv(d)?d:new Se(d)}}),JM=Hi(function(o,l){return Ct(l,function(d){d=mi(d),qn(o,d,hv(o[d],o))}),o});function zM(o){var l=o==null?0:o.length,d=pe();return o=l?tt(o,function(v){if(typeof v[1]!="function")throw new wr(i);return[d(v[0]),v[1]]}):[],qe(function(v){for(var w=-1;++w<l;){var O=o[w];if(zt(O[0],this,v))return zt(O[1],this,v)}})}function KM(o){return rc(mr(o,h))}function bv(o){return function(){return o}}function GM(o,l){return o==null||o!==o?l:o}var QM=Gw(),ZM=Gw(!0);function Or(o){return o}function _v(o){return y(typeof o=="function"?o:mr(o,h))}function XM(o){return se(mr(o,h))}function eN(o,l){return ye(o,mr(l,h))}var tN=qe(function(o,l){return function(d){return on(d,o,l)}}),rN=qe(function(o,l){return function(d){return on(o,d,l)}});function wv(o,l,d){var v=Yt(l),w=sn(l,v);d==null&&!(bt(l)&&(w.length||!v.length))&&(d=l,l=o,o=this,w=sn(l,Yt(l)));var O=!(bt(d)&&"chain"in d)||!!d.chain,q=Wi(o);return Ct(w,function(M){var B=l[M];o[M]=B,q&&(o.prototype[M]=function(){var G=this.__chain__;if(O||G){var Q=o(this.__wrapped__),X=Q.__actions__=xr(this.__actions__);return X.push({func:B,args:arguments,thisArg:o}),Q.__chain__=G,Q}return B.apply(o,en([this.value()],arguments))})}),o}function nN(){return Nt._===this&&(Nt._=ay),this}function Ev(){}function iN(o){return o=xe(o),qe(function(l){return an(l,o)})}var sN=ev(tt),oN=ev(La),aN=ev(Wu);function zE(o){return av(o)?Yu(mi(o)):DA(o)}function lN(o){return function(l){return o==null?t:Ui(o,l)}}var uN=Zw(),cN=Zw(!0);function Cv(){return[]}function xv(){return!1}function fN(){return{}}function dN(){return""}function hN(){return!0}function pN(o,l){if(o=xe(o),o<1||o>fe)return[];var d=he,v=St(o,he);l=pe(l),o-=he;for(var w=Ku(v,l);++d<o;)l(d);return w}function mN(o){return Ce(o)?tt(o,mi):Wr(o)?[o]:xr(pE(Qe(o)))}function gN(o){var l=++sy;return Qe(o)+l}var yN=ah(function(o,l){return o+l},0),vN=tv("ceil"),SN=ah(function(o,l){return o/l},1),bN=tv("floor");function _N(o){return o&&o.length?sl(o,Or,sc):t}function wN(o,l){return o&&o.length?sl(o,pe(l,2),sc):t}function EN(o){return Ni(o,Or)}function CN(o,l){return Ni(o,pe(l,2))}function xN(o){return o&&o.length?sl(o,Or,$):t}function RN(o,l){return o&&o.length?sl(o,pe(l,2),$):t}var IN=ah(function(o,l){return o*l},1),ON=tv("round"),PN=ah(function(o,l){return o-l},0);function kN(o){return o&&o.length?zu(o,Or):0}function AN(o,l){return o&&o.length?zu(o,pe(l,2)):0}return I.after=Xq,I.ary=xE,I.assign=j$,I.assignIn=LE,I.assignInWith=bh,I.assignWith=U$,I.at=B$,I.before=RE,I.bind=hv,I.bindAll=JM,I.bindKey=IE,I.castArray=f$,I.chain=wE,I.chunk=bT,I.compact=_T,I.concat=wT,I.cond=zM,I.conforms=KM,I.constant=bv,I.countBy=kq,I.create=H$,I.curry=OE,I.curryRight=PE,I.debounce=kE,I.defaults=V$,I.defaultsDeep=W$,I.defer=e$,I.delay=t$,I.difference=ET,I.differenceBy=CT,I.differenceWith=xT,I.drop=RT,I.dropRight=IT,I.dropRightWhile=OT,I.dropWhile=PT,I.fill=kT,I.filter=Tq,I.flatMap=Mq,I.flatMapDeep=Nq,I.flatMapDepth=Dq,I.flatten=vE,I.flattenDeep=AT,I.flattenDepth=TT,I.flip=r$,I.flow=QM,I.flowRight=ZM,I.fromPairs=qT,I.functions=Z$,I.functionsIn=X$,I.groupBy=Fq,I.initial=MT,I.intersection=NT,I.intersectionBy=DT,I.intersectionWith=FT,I.invert=tM,I.invertBy=rM,I.invokeMap=jq,I.iteratee=_v,I.keyBy=Uq,I.keys=Yt,I.keysIn=Ir,I.map=ph,I.mapKeys=iM,I.mapValues=sM,I.matches=XM,I.matchesProperty=eN,I.memoize=gh,I.merge=oM,I.mergeWith=jE,I.method=tN,I.methodOf=rN,I.mixin=wv,I.negate=yh,I.nthArg=iN,I.omit=aM,I.omitBy=lM,I.once=n$,I.orderBy=Bq,I.over=sN,I.overArgs=i$,I.overEvery=oN,I.overSome=aN,I.partial=pv,I.partialRight=AE,I.partition=Hq,I.pick=uM,I.pickBy=UE,I.property=zE,I.propertyOf=lN,I.pull=BT,I.pullAll=bE,I.pullAllBy=HT,I.pullAllWith=VT,I.pullAt=WT,I.range=uN,I.rangeRight=cN,I.rearg=s$,I.reject=Yq,I.remove=YT,I.rest=o$,I.reverse=fv,I.sampleSize=zq,I.set=fM,I.setWith=dM,I.shuffle=Kq,I.slice=JT,I.sortBy=Zq,I.sortedUniq=eq,I.sortedUniqBy=tq,I.split=MM,I.spread=a$,I.tail=rq,I.take=nq,I.takeRight=iq,I.takeRightWhile=sq,I.takeWhile=oq,I.tap=_q,I.throttle=l$,I.thru=hh,I.toArray=NE,I.toPairs=BE,I.toPairsIn=HE,I.toPath=mN,I.toPlainObject=FE,I.transform=hM,I.unary=u$,I.union=aq,I.unionBy=lq,I.unionWith=uq,I.uniq=cq,I.uniqBy=fq,I.uniqWith=dq,I.unset=pM,I.unzip=dv,I.unzipWith=_E,I.update=mM,I.updateWith=gM,I.values=cl,I.valuesIn=yM,I.without=hq,I.words=YE,I.wrap=c$,I.xor=pq,I.xorBy=mq,I.xorWith=gq,I.zip=yq,I.zipObject=vq,I.zipObjectDeep=Sq,I.zipWith=bq,I.entries=BE,I.entriesIn=HE,I.extend=LE,I.extendWith=bh,wv(I,I),I.add=yN,I.attempt=JE,I.camelCase=_M,I.capitalize=VE,I.ceil=vN,I.clamp=vM,I.clone=d$,I.cloneDeep=p$,I.cloneDeepWith=m$,I.cloneWith=h$,I.conformsTo=g$,I.deburr=WE,I.defaultTo=GM,I.divide=SN,I.endsWith=wM,I.eq=Nn,I.escape=EM,I.escapeRegExp=CM,I.every=Aq,I.find=qq,I.findIndex=gE,I.findKey=Y$,I.findLast=$q,I.findLastIndex=yE,I.findLastKey=J$,I.floor=bN,I.forEach=EE,I.forEachRight=CE,I.forIn=z$,I.forInRight=K$,I.forOwn=G$,I.forOwnRight=Q$,I.get=yv,I.gt=y$,I.gte=v$,I.has=eM,I.hasIn=vv,I.head=SE,I.identity=Or,I.includes=Lq,I.indexOf=$T,I.inRange=SM,I.invoke=nM,I.isArguments=jo,I.isArray=Ce,I.isArrayBuffer=S$,I.isArrayLike=Rr,I.isArrayLikeObject=Tt,I.isBoolean=b$,I.isBuffer=Ns,I.isDate=_$,I.isElement=w$,I.isEmpty=E$,I.isEqual=C$,I.isEqualWith=x$,I.isError=mv,I.isFinite=R$,I.isFunction=Wi,I.isInteger=TE,I.isLength=vh,I.isMap=qE,I.isMatch=I$,I.isMatchWith=O$,I.isNaN=P$,I.isNative=k$,I.isNil=T$,I.isNull=A$,I.isNumber=$E,I.isObject=bt,I.isObjectLike=Rt,I.isPlainObject=dc,I.isRegExp=gv,I.isSafeInteger=q$,I.isSet=ME,I.isString=Sh,I.isSymbol=Wr,I.isTypedArray=ul,I.isUndefined=$$,I.isWeakMap=M$,I.isWeakSet=N$,I.join=LT,I.kebabCase=xM,I.last=un,I.lastIndexOf=jT,I.lowerCase=RM,I.lowerFirst=IM,I.lt=D$,I.lte=F$,I.max=_N,I.maxBy=wN,I.mean=EN,I.meanBy=CN,I.min=xN,I.minBy=RN,I.stubArray=Cv,I.stubFalse=xv,I.stubObject=fN,I.stubString=dN,I.stubTrue=hN,I.multiply=IN,I.nth=UT,I.noConflict=nN,I.noop=Ev,I.now=mh,I.pad=OM,I.padEnd=PM,I.padStart=kM,I.parseInt=AM,I.random=bM,I.reduce=Vq,I.reduceRight=Wq,I.repeat=TM,I.replace=qM,I.result=cM,I.round=ON,I.runInContext=U,I.sample=Jq,I.size=Gq,I.snakeCase=$M,I.some=Qq,I.sortedIndex=zT,I.sortedIndexBy=KT,I.sortedIndexOf=GT,I.sortedLastIndex=QT,I.sortedLastIndexBy=ZT,I.sortedLastIndexOf=XT,I.startCase=NM,I.startsWith=DM,I.subtract=PN,I.sum=kN,I.sumBy=AN,I.template=FM,I.times=pN,I.toFinite=Yi,I.toInteger=xe,I.toLength=DE,I.toLower=LM,I.toNumber=cn,I.toSafeInteger=L$,I.toString=Qe,I.toUpper=jM,I.trim=UM,I.trimEnd=BM,I.trimStart=HM,I.truncate=VM,I.unescape=WM,I.uniqueId=gN,I.upperCase=YM,I.upperFirst=Sv,I.each=EE,I.eachRight=CE,I.first=SE,wv(I,function(){var o={};return nn(I,function(l,d){Ke.call(I.prototype,d)||(o[d]=l)}),o}(),{chain:!1}),I.VERSION=e,Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){I[o].placeholder=I}),Ct(["drop","take"],function(o,l){Oe.prototype[o]=function(d){d=d===t?1:xt(xe(d),0);var v=this.__filtered__&&!l?new Oe(this):this.clone();return v.__filtered__?v.__takeCount__=St(d,v.__takeCount__):v.__views__.push({size:St(d,he),type:o+(v.__dir__<0?"Right":"")}),v},Oe.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),Ct(["filter","map","takeWhile"],function(o,l){var d=l+1,v=d==L||d==Z;Oe.prototype[o]=function(w){var O=this.clone();return O.__iteratees__.push({iteratee:pe(w,3),type:d}),O.__filtered__=O.__filtered__||v,O}}),Ct(["head","last"],function(o,l){var d="take"+(l?"Right":"");Oe.prototype[o]=function(){return this[d](1).value()[0]}}),Ct(["initial","tail"],function(o,l){var d="drop"+(l?"":"Right");Oe.prototype[o]=function(){return this.__filtered__?new Oe(this):this[d](1)}}),Oe.prototype.compact=function(){return this.filter(Or)},Oe.prototype.find=function(o){return this.filter(o).head()},Oe.prototype.findLast=function(o){return this.reverse().find(o)},Oe.prototype.invokeMap=qe(function(o,l){return typeof o=="function"?new Oe(this):this.map(function(d){return on(d,o,l)})}),Oe.prototype.reject=function(o){return this.filter(yh(pe(o)))},Oe.prototype.slice=function(o,l){o=xe(o);var d=this;return d.__filtered__&&(o>0||l<0)?new Oe(d):(o<0?d=d.takeRight(-o):o&&(d=d.drop(o)),l!==t&&(l=xe(l),d=l<0?d.dropRight(-l):d.take(l-o)),d)},Oe.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Oe.prototype.toArray=function(){return this.take(he)},nn(Oe.prototype,function(o,l){var d=/^(?:filter|find|map|reject)|While$/.test(l),v=/^(?:head|last)$/.test(l),w=I[v?"take"+(l=="last"?"Right":""):l],O=v||/^find/.test(l);w&&(I.prototype[l]=function(){var q=this.__wrapped__,M=v?[1]:arguments,B=q instanceof Oe,G=M[0],Q=B||Ce(q),X=function(Fe){var Ue=w.apply(I,en([Fe],M));return v&&re?Ue[0]:Ue};Q&&d&&typeof G=="function"&&G.length!=1&&(B=Q=!1);var re=this.__chain__,ue=!!this.__actions__.length,me=O&&!re,ke=B&&!ue;if(!O&&Q){q=ke?q:new Oe(this);var ge=o.apply(q,M);return ge.__actions__.push({func:hh,args:[X],thisArg:t}),new Er(ge,re)}return me&&ke?o.apply(this,M):(ge=this.thru(X),me?v?ge.value()[0]:ge.value():ge)})}),Ct(["pop","push","shift","sort","splice","unshift"],function(o){var l=Ro[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",v=/^(?:pop|shift)$/.test(o);I.prototype[o]=function(){var w=arguments;if(v&&!this.__chain__){var O=this.value();return l.apply(Ce(O)?O:[],w)}return this[d](function(q){return l.apply(Ce(q)?q:[],w)})}}),nn(Oe.prototype,function(o,l){var d=I[l];if(d){var v=d.name+"";Ke.call(ks,v)||(ks[v]=[]),ks[v].push({name:l,func:d})}}),ks[oh(t,x).name]=[{name:"wrapper",func:t}],Oe.prototype.clone=vy,Oe.prototype.reverse=Sy,Oe.prototype.value=by,I.prototype.at=wq,I.prototype.chain=Eq,I.prototype.commit=Cq,I.prototype.next=xq,I.prototype.plant=Iq,I.prototype.reverse=Oq,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=Pq,I.prototype.first=I.prototype.head,Oo&&(I.prototype[Oo]=Rq),I},ui=iy();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Nt._=ui,define(function(){return ui})):oi?((oi.exports=ui)._=ui,Uu._=ui):Nt._=ui}).call(bl)});var dC=F((Lv,_l)=>{(function(t,e){typeof Lv=="object"&&typeof _l<"u"?_l.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(Lv,function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(c){t=c}function n(c){return c instanceof Array||Object.prototype.toString.call(c)==="[object Array]"}function i(c){return c!=null&&Object.prototype.toString.call(c)==="[object Object]"}function s(c,p){return Object.prototype.hasOwnProperty.call(c,p)}function a(c){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(c).length===0;var p;for(p in c)if(s(c,p))return!1;return!0}function u(c){return c===void 0}function f(c){return typeof c=="number"||Object.prototype.toString.call(c)==="[object Number]"}function h(c){return c instanceof Date||Object.prototype.toString.call(c)==="[object Date]"}function g(c,p){var y=[],b,R=c.length;for(b=0;b<R;++b)y.push(p(c[b],b));return y}function m(c,p){for(var y in p)s(p,y)&&(c[y]=p[y]);return s(p,"toString")&&(c.toString=p.toString),s(p,"valueOf")&&(c.valueOf=p.valueOf),c}function S(c,p,y,b){return xs(c,p,y,b,!0).utc()}function _(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function C(c){return c._pf==null&&(c._pf=_()),c._pf}var x;Array.prototype.some?x=Array.prototype.some:x=function(c){var p=Object(this),y=p.length>>>0,b;for(b=0;b<y;b++)if(b in p&&c.call(this,p[b],b,p))return!0;return!1};function A(c){var p=null,y=!1,b=c._d&&!isNaN(c._d.getTime());if(b&&(p=C(c),y=x.call(p.parsedDateParts,function(R){return R!=null}),b=p.overflow<0&&!p.empty&&!p.invalidEra&&!p.invalidMonth&&!p.invalidWeekday&&!p.weekdayMismatch&&!p.nullInput&&!p.invalidFormat&&!p.userInvalidated&&(!p.meridiem||p.meridiem&&y),c._strict&&(b=b&&p.charsLeftOver===0&&p.unusedTokens.length===0&&p.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(c))c._isValid=b;else return b;return c._isValid}function T(c){var p=S(NaN);return c!=null?m(C(p),c):C(p).userInvalidated=!0,p}var j=e.momentProperties=[],Y=!1;function V(c,p){var y,b,R,$=j.length;if(u(p._isAMomentObject)||(c._isAMomentObject=p._isAMomentObject),u(p._i)||(c._i=p._i),u(p._f)||(c._f=p._f),u(p._l)||(c._l=p._l),u(p._strict)||(c._strict=p._strict),u(p._tzm)||(c._tzm=p._tzm),u(p._isUTC)||(c._isUTC=p._isUTC),u(p._offset)||(c._offset=p._offset),u(p._pf)||(c._pf=C(p)),u(p._locale)||(c._locale=p._locale),$>0)for(y=0;y<$;y++)b=j[y],R=p[b],u(R)||(c[b]=R);return c}function K(c){V(this,c),this._d=new Date(c._d!=null?c._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Y===!1&&(Y=!0,e.updateOffset(this),Y=!1)}function ee(c){return c instanceof K||c!=null&&c._isAMomentObject!=null}function k(c){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+c)}function E(c,p){var y=!0;return m(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,c),y){var b=[],R,$,W,se=arguments.length;for($=0;$<se;$++){if(R="",typeof arguments[$]=="object"){R+=`
|
|
19
|
+
`)+ee+`return __p
|
|
20
|
+
}`;var Oe=zE(function(){return ze(O,ue+"return "+ee).apply(t,q)});if(Oe.source=ee,hv(Oe))throw Oe;return Oe}function YM(o){return tt(o).toLowerCase()}function JM(o){return tt(o).toUpperCase()}function zM(o,l,d){if(o=tt(o),o&&(d||l===t))return ac(o);if(!o||!(l=Wr(l)))return o;var y=gr(o),_=gr(l),O=Td(y,_),q=qd(y,_)+1;return Rs(y,O,q).join("")}function KM(o,l,d){if(o=tt(o),o&&(d||l===t))return o.slice(0,Nd(o)+1);if(!o||!(l=Wr(l)))return o;var y=gr(o),_=qd(y,gr(l))+1;return Rs(y,0,_).join("")}function GM(o,l,d){if(o=tt(o),o&&(d||l===t))return o.replace(Vu,"");if(!o||!(l=Wr(l)))return o;var y=gr(o),_=Td(y,gr(l));return Rs(y,_).join("")}function QM(o,l){var d=P,y=N;if(bt(l)){var _="separator"in l?l.separator:_;d="length"in l?xe(l.length):d,y="omission"in l?Wr(l.omission):y}o=tt(o);var O=o.length;if(ms(o)){var q=gr(o);O=q.length}if(d>=O)return o;var M=d-oi(y);if(M<1)return y;var U=q?Rs(q,0,M).join(""):o.slice(0,M);if(_===t)return U+y;if(q&&(M+=U.length-M),pv(_)){if(o.slice(M).search(_)){var G,Q=U;for(_.global||(_=za(_.source,tt(fd.exec(_))+"g")),_.lastIndex=0;G=_.exec(Q);)var ee=G.index;U=U.slice(0,ee===t?M:ee)}}else if(o.indexOf(Wr(_),M)!=M){var re=U.lastIndexOf(_);re>-1&&(U=U.slice(0,re))}return U+y}function ZM(o){return o=tt(o),o&&qa.test(o)?o.replace(Pi,Qg):o}var XM=hl(function(o,l,d){return o+(d?" ":"")+l.toUpperCase()}),vv=zw("toUpperCase");function JE(o,l,d){return o=tt(o),l=d?t:l,l===t?zg(o)?ey(o):Ug(o):o.match(l)||[]}var zE=ke(function(o,l){try{return hr(o,t,l)}catch(d){return hv(d)?d:new ve(d)}}),eN=Li(function(o,l){return pr(l,function(d){d=Dn(d),Hr(o,d,fv(o[d],o))}),o});function tN(o){var l=o==null?0:o.length,d=pe();return o=l?at(o,function(y){if(typeof y[1]!="function")throw new yr(i);return[d(y[0]),y[1]]}):[],ke(function(y){for(var _=-1;++_<l;){var O=o[_];if(hr(O[0],this,y))return hr(O[1],this,y)}})}function rN(o){return My(rr(o,g))}function Sv(o){return function(){return o}}function nN(o,l){return o==null||o!==o?l:o}var iN=Gw(),sN=Gw(!0);function kr(o){return o}function bv(o){return b(typeof o=="function"?o:rr(o,g))}function oN(o){return ye(rr(o,g))}function aN(o,l){return Me(o,rr(l,g))}var lN=ke(function(o,l){return function(d){return No(d,o,l)}}),uN=ke(function(o,l){return function(d){return No(o,d,l)}});function _v(o,l,d){var y=Yt(l),_=fl(l,y);d==null&&!(bt(l)&&(_.length||!y.length))&&(d=l,l=o,o=this,_=fl(l,Yt(l)));var O=!(bt(d)&&"chain"in d)||!!d.chain,q=Ui(o);return pr(_,function(M){var U=l[M];o[M]=U,q&&(o.prototype[M]=function(){var G=this.__chain__;if(O||G){var Q=o(this.__wrapped__),ee=Q.__actions__=Ir(this.__actions__);return ee.push({func:U,args:arguments,thisArg:o}),Q.__chain__=G,Q}return U.apply(o,si([this.value()],arguments))})}),o}function cN(){return qt._===this&&(qt._=oy),this}function wv(){}function fN(o){return o=xe(o),ke(function(l){return Nn(l,o)})}var dN=Zy(at),hN=Zy(Pd),pN=Zy(Ha);function KE(o){return sv(o)?wo(Dn(o)):WA(o)}function mN(o){return function(l){return o==null?t:Di(o,l)}}var gN=Zw(),yN=Zw(!0);function Ev(){return[]}function xv(){return!1}function vN(){return{}}function SN(){return""}function bN(){return!0}function _N(o,l){if(o=xe(o),o<1||o>nt)return[];var d=Te,y=Lt(o,Te);l=pe(l),o-=Te;for(var _=oc(y,l);++d<o;)l(d);return _}function wN(o){return Ee(o)?at(o,Dn):Yr(o)?[o]:Ir(pE(tt(o)))}function EN(o){var l=++iy;return tt(o)+l}var xN=uh(function(o,l){return o+l},0),CN=Xy("ceil"),RN=uh(function(o,l){return o/l},1),IN=Xy("floor");function ON(o){return o&&o.length?cl(o,kr,yc):t}function PN(o,l){return o&&o.length?cl(o,pe(l,2),yc):t}function kN(o){return Ad(o,kr)}function AN(o,l){return Ad(o,pe(l,2))}function TN(o){return o&&o.length?cl(o,kr,W):t}function qN(o,l){return o&&o.length?cl(o,pe(l,2),W):t}var $N=uh(function(o,l){return o*l},1),MN=Xy("round"),NN=uh(function(o,l){return o-l},0);function DN(o){return o&&o.length?sc(o,kr):0}function FN(o,l){return o&&o.length?sc(o,pe(l,2)):0}return I.after=a$,I.ary=CE,I.assign=z$,I.assignIn=LE,I.assignInWith=jE,I.assignWith=mv,I.at=K$,I.before=RE,I.bind=fv,I.bindAll=eN,I.bindKey=IE,I.castArray=S$,I.chain=wE,I.chunk=OT,I.compact=PT,I.concat=kT,I.cond=tN,I.conforms=rN,I.constant=Sv,I.countBy=Fq,I.create=G$,I.curry=OE,I.curryRight=PE,I.debounce=kE,I.defaults=Q$,I.defaultsDeep=Z$,I.defer=l$,I.delay=u$,I.difference=AT,I.differenceBy=TT,I.differenceWith=qT,I.drop=$T,I.dropRight=MT,I.dropRightWhile=NT,I.dropWhile=DT,I.fill=FT,I.filter=jq,I.flatMap=Hq,I.flatMapDeep=Vq,I.flatMapDepth=Wq,I.flatten=vE,I.flattenDeep=LT,I.flattenDepth=jT,I.flip=c$,I.flow=iN,I.flowRight=sN,I.fromPairs=UT,I.functions=sM,I.functionsIn=oM,I.groupBy=Yq,I.initial=HT,I.intersection=VT,I.intersectionBy=WT,I.intersectionWith=YT,I.invert=lM,I.invertBy=uM,I.invokeMap=zq,I.iteratee=bv,I.keyBy=Kq,I.keys=Yt,I.keysIn=Pr,I.map=gh,I.mapKeys=fM,I.mapValues=dM,I.matches=oN,I.matchesProperty=aN,I.memoize=vh,I.merge=hM,I.mergeWith=UE,I.method=lN,I.methodOf=uN,I.mixin=_v,I.negate=Sh,I.nthArg=fN,I.omit=pM,I.omitBy=mM,I.once=f$,I.orderBy=Gq,I.over=dN,I.overArgs=d$,I.overEvery=hN,I.overSome=pN,I.partial=dv,I.partialRight=AE,I.partition=Qq,I.pick=gM,I.pickBy=BE,I.property=KE,I.propertyOf=mN,I.pull=GT,I.pullAll=bE,I.pullAllBy=QT,I.pullAllWith=ZT,I.pullAt=XT,I.range=gN,I.rangeRight=yN,I.rearg=h$,I.reject=e$,I.remove=eq,I.rest=p$,I.reverse=uv,I.sampleSize=r$,I.set=vM,I.setWith=SM,I.shuffle=n$,I.slice=tq,I.sortBy=o$,I.sortedUniq=lq,I.sortedUniqBy=uq,I.split=BM,I.spread=m$,I.tail=cq,I.take=fq,I.takeRight=dq,I.takeRightWhile=hq,I.takeWhile=pq,I.tap=Pq,I.throttle=g$,I.thru=mh,I.toArray=NE,I.toPairs=HE,I.toPairsIn=VE,I.toPath=wN,I.toPlainObject=FE,I.transform=bM,I.unary=y$,I.union=mq,I.unionBy=gq,I.unionWith=yq,I.uniq=vq,I.uniqBy=Sq,I.uniqWith=bq,I.unset=_M,I.unzip=cv,I.unzipWith=_E,I.update=wM,I.updateWith=EM,I.values=gl,I.valuesIn=xM,I.without=_q,I.words=JE,I.wrap=v$,I.xor=wq,I.xorBy=Eq,I.xorWith=xq,I.zip=Cq,I.zipObject=Rq,I.zipObjectDeep=Iq,I.zipWith=Oq,I.entries=HE,I.entriesIn=VE,I.extend=LE,I.extendWith=jE,_v(I,I),I.add=xN,I.attempt=zE,I.camelCase=OM,I.capitalize=WE,I.ceil=CN,I.clamp=CM,I.clone=b$,I.cloneDeep=w$,I.cloneDeepWith=E$,I.cloneWith=_$,I.conformsTo=x$,I.deburr=YE,I.defaultTo=nN,I.divide=RN,I.endsWith=PM,I.eq=Fn,I.escape=kM,I.escapeRegExp=AM,I.every=Lq,I.find=Uq,I.findIndex=gE,I.findKey=X$,I.findLast=Bq,I.findLastIndex=yE,I.findLastKey=eM,I.floor=IN,I.forEach=EE,I.forEachRight=xE,I.forIn=tM,I.forInRight=rM,I.forOwn=nM,I.forOwnRight=iM,I.get=gv,I.gt=C$,I.gte=R$,I.has=aM,I.hasIn=yv,I.head=SE,I.identity=kr,I.includes=Jq,I.indexOf=BT,I.inRange=RM,I.invoke=cM,I.isArguments=jo,I.isArray=Ee,I.isArrayBuffer=I$,I.isArrayLike=Or,I.isArrayLikeObject=Pt,I.isBoolean=O$,I.isBuffer=Is,I.isDate=P$,I.isElement=k$,I.isEmpty=A$,I.isEqual=T$,I.isEqualWith=q$,I.isError=hv,I.isFinite=$$,I.isFunction=Ui,I.isInteger=TE,I.isLength=bh,I.isMap=qE,I.isMatch=M$,I.isMatchWith=N$,I.isNaN=D$,I.isNative=F$,I.isNil=j$,I.isNull=L$,I.isNumber=$E,I.isObject=bt,I.isObjectLike=xt,I.isPlainObject=Ec,I.isRegExp=pv,I.isSafeInteger=U$,I.isSet=ME,I.isString=_h,I.isSymbol=Yr,I.isTypedArray=ml,I.isUndefined=B$,I.isWeakMap=H$,I.isWeakSet=V$,I.join=JT,I.kebabCase=TM,I.last=fn,I.lastIndexOf=zT,I.lowerCase=qM,I.lowerFirst=$M,I.lt=W$,I.lte=Y$,I.max=ON,I.maxBy=PN,I.mean=kN,I.meanBy=AN,I.min=TN,I.minBy=qN,I.stubArray=Ev,I.stubFalse=xv,I.stubObject=vN,I.stubString=SN,I.stubTrue=bN,I.multiply=$N,I.nth=KT,I.noConflict=cN,I.noop=wv,I.now=yh,I.pad=MM,I.padEnd=NM,I.padStart=DM,I.parseInt=FM,I.random=IM,I.reduce=Zq,I.reduceRight=Xq,I.repeat=LM,I.replace=jM,I.result=yM,I.round=MN,I.runInContext=j,I.sample=t$,I.size=i$,I.snakeCase=UM,I.some=s$,I.sortedIndex=rq,I.sortedIndexBy=nq,I.sortedIndexOf=iq,I.sortedLastIndex=sq,I.sortedLastIndexBy=oq,I.sortedLastIndexOf=aq,I.startCase=HM,I.startsWith=VM,I.subtract=NN,I.sum=DN,I.sumBy=FN,I.template=WM,I.times=_N,I.toFinite=Bi,I.toInteger=xe,I.toLength=DE,I.toLower=YM,I.toNumber=dn,I.toSafeInteger=J$,I.toString=tt,I.toUpper=JM,I.trim=zM,I.trimEnd=KM,I.trimStart=GM,I.truncate=QM,I.unescape=ZM,I.uniqueId=EN,I.upperCase=XM,I.upperFirst=vv,I.each=EE,I.eachRight=xE,I.first=SE,_v(I,(function(){var o={};return un(I,function(l,d){Ze.call(I.prototype,d)||(o[d]=l)}),o})(),{chain:!1}),I.VERSION=e,pr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){I[o].placeholder=I}),pr(["drop","take"],function(o,l){$e.prototype[o]=function(d){d=d===t?1:pt(xe(d),0);var y=this.__filtered__&&!l?new $e(this):this.clone();return y.__filtered__?y.__takeCount__=Lt(d,y.__takeCount__):y.__views__.push({size:Lt(d,Te),type:o+(y.__dir__<0?"Right":"")}),y},$e.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),pr(["filter","map","takeWhile"],function(o,l){var d=l+1,y=d==z||d==ae;$e.prototype[o]=function(_){var O=this.clone();return O.__iteratees__.push({iteratee:pe(_,3),type:d}),O.__filtered__=O.__filtered__||y,O}}),pr(["head","last"],function(o,l){var d="take"+(l?"Right":"");$e.prototype[o]=function(){return this[d](1).value()[0]}}),pr(["initial","tail"],function(o,l){var d="drop"+(l?"":"Right");$e.prototype[o]=function(){return this.__filtered__?new $e(this):this[d](1)}}),$e.prototype.compact=function(){return this.filter(kr)},$e.prototype.find=function(o){return this.filter(o).head()},$e.prototype.findLast=function(o){return this.reverse().find(o)},$e.prototype.invokeMap=ke(function(o,l){return typeof o=="function"?new $e(this):this.map(function(d){return No(d,o,l)})}),$e.prototype.reject=function(o){return this.filter(Sh(pe(o)))},$e.prototype.slice=function(o,l){o=xe(o);var d=this;return d.__filtered__&&(o>0||l<0)?new $e(d):(o<0?d=d.takeRight(-o):o&&(d=d.drop(o)),l!==t&&(l=xe(l),d=l<0?d.dropRight(-l):d.take(l-o)),d)},$e.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},$e.prototype.toArray=function(){return this.take(Te)},un($e.prototype,function(o,l){var d=/^(?:filter|find|map|reject)|While$/.test(l),y=/^(?:head|last)$/.test(l),_=I[y?"take"+(l=="last"?"Right":""):l],O=y||/^find/.test(l);_&&(I.prototype[l]=function(){var q=this.__wrapped__,M=y?[1]:arguments,U=q instanceof $e,G=M[0],Q=U||Ee(q),ee=function(Le){var Be=_.apply(I,si([Le],M));return y&&re?Be[0]:Be};Q&&d&&typeof G=="function"&&G.length!=1&&(U=Q=!1);var re=this.__chain__,ue=!!this.__actions__.length,me=O&&!re,Oe=U&&!ue;if(!O&&Q){q=Oe?q:new $e(this);var he=o.apply(q,M);return he.__actions__.push({func:mh,args:[ee],thisArg:t}),new tr(he,re)}return me&&Oe?o.apply(this,M):(he=this.thru(ee),me?y?he.value()[0]:he.value():he)})}),pr(["pop","push","shift","sort","splice","unshift"],function(o){var l=Co[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",y=/^(?:pop|shift)$/.test(o);I.prototype[o]=function(){var _=arguments;if(y&&!this.__chain__){var O=this.value();return l.apply(Ee(O)?O:[],_)}return this[d](function(q){return l.apply(Ee(q)?q:[],_)})}}),un($e.prototype,function(o,l){var d=I[l];if(d){var y=d.name+"";Ze.call(Ss,y)||(Ss[y]=[]),Ss[y].push({name:l,func:d})}}),Ss[lh(t,A).name]=[{name:"wrapper",func:t}],$e.prototype.clone=vy,$e.prototype.reverse=Sy,$e.prototype.value=fc,I.prototype.at=kq,I.prototype.chain=Aq,I.prototype.commit=Tq,I.prototype.next=qq,I.prototype.plant=Mq,I.prototype.reverse=Nq,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=Dq,I.prototype.first=I.prototype.head,Oo&&(I.prototype[Oo]=$q),I}),ai=ty();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(qt._=ai,define(function(){return ai})):Qe?((Qe.exports=ai)._=ai,ja._=ai):qt._=ai}).call(Rl)});var fx=F((Dv,Il)=>{(function(t,e){typeof Dv=="object"&&typeof Il<"u"?Il.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(Dv,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(c){t=c}function n(c){return c instanceof Array||Object.prototype.toString.call(c)==="[object Array]"}function i(c){return c!=null&&Object.prototype.toString.call(c)==="[object Object]"}function s(c,p){return Object.prototype.hasOwnProperty.call(c,p)}function a(c){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(c).length===0;var p;for(p in c)if(s(c,p))return!1;return!0}function u(c){return c===void 0}function f(c){return typeof c=="number"||Object.prototype.toString.call(c)==="[object Number]"}function h(c){return c instanceof Date||Object.prototype.toString.call(c)==="[object Date]"}function g(c,p){var v=[],b,R=c.length;for(b=0;b<R;++b)v.push(p(c[b],b));return v}function m(c,p){for(var v in p)s(p,v)&&(c[v]=p[v]);return s(p,"toString")&&(c.toString=p.toString),s(p,"valueOf")&&(c.valueOf=p.valueOf),c}function S(c,p,v,b){return Ya(c,p,v,b,!0).utc()}function E(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function x(c){return c._pf==null&&(c._pf=E()),c._pf}var C;Array.prototype.some?C=Array.prototype.some:C=function(c){var p=Object(this),v=p.length>>>0,b;for(b=0;b<v;b++)if(b in p&&c.call(this,p[b],b,p))return!0;return!1};function A(c){var p=null,v=!1,b=c._d&&!isNaN(c._d.getTime());if(b&&(p=x(c),v=C.call(p.parsedDateParts,function(R){return R!=null}),b=p.overflow<0&&!p.empty&&!p.invalidEra&&!p.invalidMonth&&!p.invalidWeekday&&!p.weekdayMismatch&&!p.nullInput&&!p.invalidFormat&&!p.userInvalidated&&(!p.meridiem||p.meridiem&&v),c._strict&&(b=b&&p.charsLeftOver===0&&p.unusedTokens.length===0&&p.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(c))c._isValid=b;else return b;return c._isValid}function T(c){var p=S(NaN);return c!=null?m(x(p),c):x(p).userInvalidated=!0,p}var B=e.momentProperties=[],Y=!1;function H(c,p){var v,b,R,$=B.length;if(u(p._isAMomentObject)||(c._isAMomentObject=p._isAMomentObject),u(p._i)||(c._i=p._i),u(p._f)||(c._f=p._f),u(p._l)||(c._l=p._l),u(p._strict)||(c._strict=p._strict),u(p._tzm)||(c._tzm=p._tzm),u(p._isUTC)||(c._isUTC=p._isUTC),u(p._offset)||(c._offset=p._offset),u(p._pf)||(c._pf=x(p)),u(p._locale)||(c._locale=p._locale),$>0)for(v=0;v<$;v++)b=B[v],R=p[b],u(R)||(c[b]=R);return c}function K(c){H(this,c),this._d=new Date(c._d!=null?c._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Y===!1&&(Y=!0,e.updateOffset(this),Y=!1)}function X(c){return c instanceof K||c!=null&&c._isAMomentObject!=null}function k(c){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+c)}function w(c,p){var v=!0;return m(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,c),v){var b=[],R,$,W,ie=arguments.length;for($=0;$<ie;$++){if(R="",typeof arguments[$]=="object"){R+=`
|
|
21
21
|
[`+$+"] ";for(W in arguments[0])s(arguments[0],W)&&(R+=W+": "+arguments[0][W]+", ");R=R.slice(0,-2)}else R=arguments[$];b.push(R)}k(c+`
|
|
22
22
|
Arguments: `+Array.prototype.slice.call(b).join("")+`
|
|
23
|
-
`+new Error().stack),y=!1}return p.apply(this,arguments)},p)}var P={};function N(c,p){e.deprecationHandler!=null&&e.deprecationHandler(c,p),P[c]||(k(p),P[c]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function D(c){return typeof Function<"u"&&c instanceof Function||Object.prototype.toString.call(c)==="[object Function]"}function L(c){var p,y;for(y in c)s(c,y)&&(p=c[y],D(p)?this[y]=p:this["_"+y]=p);this._config=c,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function z(c,p){var y=m({},c),b;for(b in p)s(p,b)&&(i(c[b])&&i(p[b])?(y[b]={},m(y[b],c[b]),m(y[b],p[b])):p[b]!=null?y[b]=p[b]:delete y[b]);for(b in c)s(c,b)&&!s(p,b)&&i(c[b])&&(y[b]=m({},y[b]));return y}function Z(c){c!=null&&this.set(c)}var ie;Object.keys?ie=Object.keys:ie=function(c){var p,y=[];for(p in c)s(c,p)&&y.push(p);return y};var fe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function wt(c,p,y){var b=this._calendar[c]||this._calendar.sameElse;return D(b)?b.call(p,y):b}function Ee(c,p,y){var b=""+Math.abs(c),R=p-b.length,$=c>=0;return($?y?"+":"":"-")+Math.pow(10,Math.max(0,R)).toString().substr(1)+b}var he=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Xe=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Et={},Mt={};function le(c,p,y,b){var R=b;typeof b=="string"&&(R=function(){return this[b]()}),c&&(Mt[c]=R),p&&(Mt[p[0]]=function(){return Ee(R.apply(this,arguments),p[1],p[2])}),y&&(Mt[y]=function(){return this.localeData().ordinal(R.apply(this,arguments),c)})}function ei(c){return c.match(/\[[\s\S]/)?c.replace(/^\[|\]$/g,""):c.replace(/\\/g,"")}function $u(c){var p=c.match(he),y,b;for(y=0,b=p.length;y<b;y++)Mt[p[y]]?p[y]=Mt[p[y]]:p[y]=ei(p[y]);return function(R){var $="",W;for(W=0;W<b;W++)$+=D(p[W])?p[W].call(R,c):p[W];return $}}function ft(c,p){return c.isValid()?(p=En(p,c.localeData()),Et[p]=Et[p]||$u(p),Et[p](c)):c.localeData().invalidDate()}function En(c,p){var y=5;function b(R){return p.longDateFormat(R)||R}for(Xe.lastIndex=0;y>=0&&Xe.test(c);)c=c.replace(Xe,b),Xe.lastIndex=0,y-=1;return c}var cs={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function jt(c){var p=this._longDateFormat[c],y=this._longDateFormat[c.toUpperCase()];return p||!y?p:(this._longDateFormat[c]=y.match(he).map(function(b){return b==="MMMM"||b==="MM"||b==="DD"||b==="dddd"?b.slice(1):b}).join(""),this._longDateFormat[c])}var dt="Invalid date";function ti(){return this._invalidDate}var rr="%d",Zr=/\d{1,2}/;function cg(c){return this._ordinal.replace("%d",c)}var Cn={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Gf(c,p,y,b){var R=this._relativeTime[y];return D(R)?R(c,p,y,b):R.replace(/%d/i,c)}function fg(c,p){var y=this._relativeTime[c>0?"future":"past"];return D(y)?y(p):y.replace(/%s/i,p)}var fs={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function yt(c){return typeof c=="string"?fs[c]||fs[c.toLowerCase()]:void 0}function Ti(c){var p={},y,b;for(b in c)s(c,b)&&(y=yt(b),y&&(p[y]=c[b]));return p}var Oa={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function dg(c){var p=[],y;for(y in c)s(c,y)&&p.push({unit:y,priority:Oa[y]});return p.sort(function(b,R){return b.priority-R.priority}),p}var ds=/\d/,hr=/\d\d/,hs=/\d{3}/,ri=/\d{4}/,ps=/[+-]?\d{6}/,et=/\d\d?/,Pa=/\d\d\d\d?/,ka=/\d\d\d\d\d\d?/,ms=/\d{1,3}/,bo=/\d{1,4}/,gs=/[+-]?\d{1,6}/,ni=/\d+/,ys=/[+-]?\d+/,hg=/Z|[+-]\d\d:?\d\d/gi,Aa=/Z|[+-]\d\d(?::?\d\d)?/gi,pg=/[+-]?\d+(\.\d{1,3})?/,vs=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,qi=/^[1-9]\d?/,Mu=/^([1-9]\d|\d)/,Ta;Ta={};function oe(c,p,y){Ta[c]=D(p)?p:function(b,R){return b&&y?y:p}}function mg(c,p){return s(Ta,c)?Ta[c](p._strict,p._locale):new RegExp(Qf(c))}function Qf(c){return xn(c.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(p,y,b,R,$){return y||b||R||$}))}function xn(c){return c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function _r(c){return c<0?Math.ceil(c)||0:Math.floor(c)}function Me(c){var p=+c,y=0;return p!==0&&isFinite(p)&&(y=_r(p)),y}var _o={};function Ge(c,p){var y,b=p,R;for(typeof c=="string"&&(c=[c]),f(p)&&(b=function($,W){W[p]=Me($)}),R=c.length,y=0;y<R;y++)_o[c[y]]=b}function $i(c,p){Ge(c,function(y,b,R,$){R._w=R._w||{},p(y,R._w,R,$)})}function gg(c,p,y){p!=null&&s(_o,c)&&_o[c](p,y._a,y,c)}function qa(c){return c%4===0&&c%100!==0||c%400===0}var Vt=0,Rn=1,Xr=2,kt=3,jr=4,In=5,ii=6,yg=7,vg=8;le("Y",0,0,function(){var c=this.year();return c<=9999?Ee(c,4):"+"+c}),le(0,["YY",2],0,function(){return this.year()%100}),le(0,["YYYY",4],0,"year"),le(0,["YYYYY",5],0,"year"),le(0,["YYYYYY",6,!0],0,"year"),oe("Y",ys),oe("YY",et,hr),oe("YYYY",bo,ri),oe("YYYYY",gs,ps),oe("YYYYYY",gs,ps),Ge(["YYYYY","YYYYYY"],Vt),Ge("YYYY",function(c,p){p[Vt]=c.length===2?e.parseTwoDigitYear(c):Me(c)}),Ge("YY",function(c,p){p[Vt]=e.parseTwoDigitYear(c)}),Ge("Y",function(c,p){p[Vt]=parseInt(c,10)});function wo(c){return qa(c)?366:365}e.parseTwoDigitYear=function(c){return Me(c)+(Me(c)>68?1900:2e3)};var Zf=Ss("FullYear",!0);function Sg(){return qa(this.year())}function Ss(c,p){return function(y){return y!=null?(Xf(this,c,y),e.updateOffset(this,p),this):si(this,c)}}function si(c,p){if(!c.isValid())return NaN;var y=c._d,b=c._isUTC;switch(p){case"Milliseconds":return b?y.getUTCMilliseconds():y.getMilliseconds();case"Seconds":return b?y.getUTCSeconds():y.getSeconds();case"Minutes":return b?y.getUTCMinutes():y.getMinutes();case"Hours":return b?y.getUTCHours():y.getHours();case"Date":return b?y.getUTCDate():y.getDate();case"Day":return b?y.getUTCDay():y.getDay();case"Month":return b?y.getUTCMonth():y.getMonth();case"FullYear":return b?y.getUTCFullYear():y.getFullYear();default:return NaN}}function Xf(c,p,y){var b,R,$,W,se;if(!(!c.isValid()||isNaN(y))){switch(b=c._d,R=c._isUTC,p){case"Milliseconds":return void(R?b.setUTCMilliseconds(y):b.setMilliseconds(y));case"Seconds":return void(R?b.setUTCSeconds(y):b.setSeconds(y));case"Minutes":return void(R?b.setUTCMinutes(y):b.setMinutes(y));case"Hours":return void(R?b.setUTCHours(y):b.setHours(y));case"Date":return void(R?b.setUTCDate(y):b.setDate(y));case"FullYear":break;default:return}$=y,W=c.month(),se=c.date(),se=se===29&&W===1&&!qa($)?28:se,R?b.setUTCFullYear($,W,se):b.setFullYear($,W,se)}}function $a(c){return c=yt(c),D(this[c])?this[c]():this}function bg(c,p){if(typeof c=="object"){c=Ti(c);var y=dg(c),b,R=y.length;for(b=0;b<R;b++)this[y[b].unit](c[y[b].unit])}else if(c=yt(c),D(this[c]))return this[c](p);return this}function _g(c,p){return(c%p+p)%p}var vt;Array.prototype.indexOf?vt=Array.prototype.indexOf:vt=function(c){var p;for(p=0;p<this.length;++p)if(this[p]===c)return p;return-1};function Ma(c,p){if(isNaN(c)||isNaN(p))return NaN;var y=_g(p,12);return c+=(p-y)/12,y===1?qa(c)?29:28:31-y%7%2}le("M",["MM",2],"Mo",function(){return this.month()+1}),le("MMM",0,0,function(c){return this.localeData().monthsShort(this,c)}),le("MMMM",0,0,function(c){return this.localeData().months(this,c)}),oe("M",et,qi),oe("MM",et,hr),oe("MMM",function(c,p){return p.monthsShortRegex(c)}),oe("MMMM",function(c,p){return p.monthsRegex(c)}),Ge(["M","MM"],function(c,p){p[Rn]=Me(c)-1}),Ge(["MMM","MMMM"],function(c,p,y,b){var R=y._locale.monthsParse(c,b,y._strict);R!=null?p[Rn]=R:C(y).invalidMonth=c});var ed="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Nu="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),td=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,wg=vs,Eg=vs;function Cg(c,p){return c?n(this._months)?this._months[c.month()]:this._months[(this._months.isFormat||td).test(p)?"format":"standalone"][c.month()]:n(this._months)?this._months:this._months.standalone}function rd(c,p){return c?n(this._monthsShort)?this._monthsShort[c.month()]:this._monthsShort[td.test(p)?"format":"standalone"][c.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function nd(c,p,y){var b,R,$,W=c.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],b=0;b<12;++b)$=S([2e3,b]),this._shortMonthsParse[b]=this.monthsShort($,"").toLocaleLowerCase(),this._longMonthsParse[b]=this.months($,"").toLocaleLowerCase();return y?p==="MMM"?(R=vt.call(this._shortMonthsParse,W),R!==-1?R:null):(R=vt.call(this._longMonthsParse,W),R!==-1?R:null):p==="MMM"?(R=vt.call(this._shortMonthsParse,W),R!==-1?R:(R=vt.call(this._longMonthsParse,W),R!==-1?R:null)):(R=vt.call(this._longMonthsParse,W),R!==-1?R:(R=vt.call(this._shortMonthsParse,W),R!==-1?R:null))}function id(c,p,y){var b,R,$;if(this._monthsParseExact)return nd.call(this,c,p,y);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),b=0;b<12;b++){if(R=S([2e3,b]),y&&!this._longMonthsParse[b]&&(this._longMonthsParse[b]=new RegExp("^"+this.months(R,"").replace(".","")+"$","i"),this._shortMonthsParse[b]=new RegExp("^"+this.monthsShort(R,"").replace(".","")+"$","i")),!y&&!this._monthsParse[b]&&($="^"+this.months(R,"")+"|^"+this.monthsShort(R,""),this._monthsParse[b]=new RegExp($.replace(".",""),"i")),y&&p==="MMMM"&&this._longMonthsParse[b].test(c))return b;if(y&&p==="MMM"&&this._shortMonthsParse[b].test(c))return b;if(!y&&this._monthsParse[b].test(c))return b}}function Na(c,p){if(!c.isValid())return c;if(typeof p=="string"){if(/^\d+$/.test(p))p=Me(p);else if(p=c.localeData().monthsParse(p),!f(p))return c}var y=p,b=c.date();return b=b<29?b:Math.min(b,Ma(c.year(),y)),c._isUTC?c._d.setUTCMonth(y,b):c._d.setMonth(y,b),c}function sd(c){return c!=null?(Na(this,c),e.updateOffset(this,!0),this):si(this,"Month")}function od(){return Ma(this.year(),this.month())}function Da(c){return this._monthsParseExact?(s(this,"_monthsRegex")||ld.call(this),c?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=wg),this._monthsShortStrictRegex&&c?this._monthsShortStrictRegex:this._monthsShortRegex)}function ad(c){return this._monthsParseExact?(s(this,"_monthsRegex")||ld.call(this),c?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Eg),this._monthsStrictRegex&&c?this._monthsStrictRegex:this._monthsRegex)}function ld(){function c(ye,Pe){return Pe.length-ye.length}var p=[],y=[],b=[],R,$,W,se;for(R=0;R<12;R++)$=S([2e3,R]),W=xn(this.monthsShort($,"")),se=xn(this.months($,"")),p.push(W),y.push(se),b.push(se),b.push(W);p.sort(c),y.sort(c),b.sort(c),this._monthsRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+y.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+p.join("|")+")","i")}function ud(c,p,y,b,R,$,W){var se;return c<100&&c>=0?(se=new Date(c+400,p,y,b,R,$,W),isFinite(se.getFullYear())&&se.setFullYear(c)):se=new Date(c,p,y,b,R,$,W),se}function bs(c){var p,y;return c<100&&c>=0?(y=Array.prototype.slice.call(arguments),y[0]=c+400,p=new Date(Date.UTC.apply(null,y)),isFinite(p.getUTCFullYear())&&p.setUTCFullYear(c)):p=new Date(Date.UTC.apply(null,arguments)),p}function _s(c,p,y){var b=7+p-y,R=(7+bs(c,0,b).getUTCDay()-p)%7;return-R+b-1}function cd(c,p,y,b,R){var $=(7+y-b)%7,W=_s(c,b,R),se=1+7*(p-1)+$+W,ye,Pe;return se<=0?(ye=c-1,Pe=wo(ye)+se):se>wo(c)?(ye=c+1,Pe=se-wo(c)):(ye=c,Pe=se),{year:ye,dayOfYear:Pe}}function ws(c,p,y){var b=_s(c.year(),p,y),R=Math.floor((c.dayOfYear()-b-1)/7)+1,$,W;return R<1?(W=c.year()-1,$=R+Ur(W,p,y)):R>Ur(c.year(),p,y)?($=R-Ur(c.year(),p,y),W=c.year()+1):(W=c.year(),$=R),{week:$,year:W}}function Ur(c,p,y){var b=_s(c,p,y),R=_s(c+1,p,y);return(wo(c)-b+R)/7}le("w",["ww",2],"wo","week"),le("W",["WW",2],"Wo","isoWeek"),oe("w",et,qi),oe("ww",et,hr),oe("W",et,qi),oe("WW",et,hr),$i(["w","ww","W","WW"],function(c,p,y,b){p[b.substr(0,1)]=Me(c)});function Du(c){return ws(c,this._week.dow,this._week.doy).week}var Es={dow:0,doy:6};function fd(){return this._week.dow}function dd(){return this._week.doy}function xg(c){var p=this.localeData().week(this);return c==null?p:this.add((c-p)*7,"d")}function hd(c){var p=ws(this,1,4).week;return c==null?p:this.add((c-p)*7,"d")}le("d",0,"do","day"),le("dd",0,0,function(c){return this.localeData().weekdaysMin(this,c)}),le("ddd",0,0,function(c){return this.localeData().weekdaysShort(this,c)}),le("dddd",0,0,function(c){return this.localeData().weekdays(this,c)}),le("e",0,0,"weekday"),le("E",0,0,"isoWeekday"),oe("d",et),oe("e",et),oe("E",et),oe("dd",function(c,p){return p.weekdaysMinRegex(c)}),oe("ddd",function(c,p){return p.weekdaysShortRegex(c)}),oe("dddd",function(c,p){return p.weekdaysRegex(c)}),$i(["dd","ddd","dddd"],function(c,p,y,b){var R=y._locale.weekdaysParse(c,b,y._strict);R!=null?p.d=R:C(y).invalidWeekday=c}),$i(["d","e","E"],function(c,p,y,b){p[b]=Me(c)});function pd(c,p){return typeof c!="string"?c:isNaN(c)?(c=p.weekdaysParse(c),typeof c=="number"?c:null):parseInt(c,10)}function md(c,p){return typeof c=="string"?p.weekdaysParse(c)%7||7:isNaN(c)?null:c}function Fa(c,p){return c.slice(p,7).concat(c.slice(0,p))}var Rg="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),gd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ig="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),yd=vs,Og=vs,Pg=vs;function kg(c,p){var y=n(this._weekdays)?this._weekdays:this._weekdays[c&&c!==!0&&this._weekdays.isFormat.test(p)?"format":"standalone"];return c===!0?Fa(y,this._week.dow):c?y[c.day()]:y}function Ag(c){return c===!0?Fa(this._weekdaysShort,this._week.dow):c?this._weekdaysShort[c.day()]:this._weekdaysShort}function Fu(c){return c===!0?Fa(this._weekdaysMin,this._week.dow):c?this._weekdaysMin[c.day()]:this._weekdaysMin}function Tg(c,p,y){var b,R,$,W=c.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],b=0;b<7;++b)$=S([2e3,1]).day(b),this._minWeekdaysParse[b]=this.weekdaysMin($,"").toLocaleLowerCase(),this._shortWeekdaysParse[b]=this.weekdaysShort($,"").toLocaleLowerCase(),this._weekdaysParse[b]=this.weekdays($,"").toLocaleLowerCase();return y?p==="dddd"?(R=vt.call(this._weekdaysParse,W),R!==-1?R:null):p==="ddd"?(R=vt.call(this._shortWeekdaysParse,W),R!==-1?R:null):(R=vt.call(this._minWeekdaysParse,W),R!==-1?R:null):p==="dddd"?(R=vt.call(this._weekdaysParse,W),R!==-1||(R=vt.call(this._shortWeekdaysParse,W),R!==-1)?R:(R=vt.call(this._minWeekdaysParse,W),R!==-1?R:null)):p==="ddd"?(R=vt.call(this._shortWeekdaysParse,W),R!==-1||(R=vt.call(this._weekdaysParse,W),R!==-1)?R:(R=vt.call(this._minWeekdaysParse,W),R!==-1?R:null)):(R=vt.call(this._minWeekdaysParse,W),R!==-1||(R=vt.call(this._weekdaysParse,W),R!==-1)?R:(R=vt.call(this._shortWeekdaysParse,W),R!==-1?R:null))}function qg(c,p,y){var b,R,$;if(this._weekdaysParseExact)return Tg.call(this,c,p,y);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),b=0;b<7;b++){if(R=S([2e3,1]).day(b),y&&!this._fullWeekdaysParse[b]&&(this._fullWeekdaysParse[b]=new RegExp("^"+this.weekdays(R,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[b]=new RegExp("^"+this.weekdaysShort(R,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[b]=new RegExp("^"+this.weekdaysMin(R,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[b]||($="^"+this.weekdays(R,"")+"|^"+this.weekdaysShort(R,"")+"|^"+this.weekdaysMin(R,""),this._weekdaysParse[b]=new RegExp($.replace(".",""),"i")),y&&p==="dddd"&&this._fullWeekdaysParse[b].test(c))return b;if(y&&p==="ddd"&&this._shortWeekdaysParse[b].test(c))return b;if(y&&p==="dd"&&this._minWeekdaysParse[b].test(c))return b;if(!y&&this._weekdaysParse[b].test(c))return b}}function $g(c){if(!this.isValid())return c!=null?this:NaN;var p=si(this,"Day");return c!=null?(c=pd(c,this.localeData()),this.add(c-p,"d")):p}function Mg(c){if(!this.isValid())return c!=null?this:NaN;var p=(this.day()+7-this.localeData()._week.dow)%7;return c==null?p:this.add(c-p,"d")}function Ng(c){if(!this.isValid())return c!=null?this:NaN;if(c!=null){var p=md(c,this.localeData());return this.day(this.day()%7?p:p-7)}else return this.day()||7}function lt(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Lu.call(this),c?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=yd),this._weekdaysStrictRegex&&c?this._weekdaysStrictRegex:this._weekdaysRegex)}function it(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Lu.call(this),c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Og),this._weekdaysShortStrictRegex&&c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Dg(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Lu.call(this),c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Pg),this._weekdaysMinStrictRegex&&c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Lu(){function c(Gt,an){return an.length-Gt.length}var p=[],y=[],b=[],R=[],$,W,se,ye,Pe;for($=0;$<7;$++)W=S([2e3,1]).day($),se=xn(this.weekdaysMin(W,"")),ye=xn(this.weekdaysShort(W,"")),Pe=xn(this.weekdays(W,"")),p.push(se),y.push(ye),b.push(Pe),R.push(se),R.push(ye),R.push(Pe);p.sort(c),y.sort(c),b.sort(c),R.sort(c),this._weekdaysRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+y.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+p.join("|")+")","i")}function ju(){return this.hours()%12||12}function Fg(){return this.hours()||24}le("H",["HH",2],0,"hour"),le("h",["hh",2],0,ju),le("k",["kk",2],0,Fg),le("hmm",0,0,function(){return""+ju.apply(this)+Ee(this.minutes(),2)}),le("hmmss",0,0,function(){return""+ju.apply(this)+Ee(this.minutes(),2)+Ee(this.seconds(),2)}),le("Hmm",0,0,function(){return""+this.hours()+Ee(this.minutes(),2)}),le("Hmmss",0,0,function(){return""+this.hours()+Ee(this.minutes(),2)+Ee(this.seconds(),2)});function vd(c,p){le(c,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),p)})}vd("a",!0),vd("A",!1);function Sd(c,p){return p._meridiemParse}oe("a",Sd),oe("A",Sd),oe("H",et,Mu),oe("h",et,qi),oe("k",et,qi),oe("HH",et,hr),oe("hh",et,hr),oe("kk",et,hr),oe("hmm",Pa),oe("hmmss",ka),oe("Hmm",Pa),oe("Hmmss",ka),Ge(["H","HH"],kt),Ge(["k","kk"],function(c,p,y){var b=Me(c);p[kt]=b===24?0:b}),Ge(["a","A"],function(c,p,y){y._isPm=y._locale.isPM(c),y._meridiem=c}),Ge(["h","hh"],function(c,p,y){p[kt]=Me(c),C(y).bigHour=!0}),Ge("hmm",function(c,p,y){var b=c.length-2;p[kt]=Me(c.substr(0,b)),p[jr]=Me(c.substr(b)),C(y).bigHour=!0}),Ge("hmmss",function(c,p,y){var b=c.length-4,R=c.length-2;p[kt]=Me(c.substr(0,b)),p[jr]=Me(c.substr(b,2)),p[In]=Me(c.substr(R)),C(y).bigHour=!0}),Ge("Hmm",function(c,p,y){var b=c.length-2;p[kt]=Me(c.substr(0,b)),p[jr]=Me(c.substr(b))}),Ge("Hmmss",function(c,p,y){var b=c.length-4,R=c.length-2;p[kt]=Me(c.substr(0,b)),p[jr]=Me(c.substr(b,2)),p[In]=Me(c.substr(R))});function bd(c){return(c+"").toLowerCase().charAt(0)==="p"}var Lg=/[ap]\.?m?\.?/i,Nt=Ss("Hours",!0);function Uu(c,p,y){return c>11?y?"pm":"PM":y?"am":"AM"}var oi={calendar:fe,longDateFormat:cs,invalidDate:dt,ordinal:rr,dayOfMonthOrdinalParse:Zr,relativeTime:Cn,months:ed,monthsShort:Nu,week:Es,weekdays:Rg,weekdaysMin:Ig,weekdaysShort:gd,meridiemParse:Lg},ut={},Mi={},Wt;function _d(c,p){var y,b=Math.min(c.length,p.length);for(y=0;y<b;y+=1)if(c[y]!==p[y])return y;return b}function Bu(c){return c&&c.toLowerCase().replace("_","-")}function wd(c){for(var p=0,y,b,R,$;p<c.length;){for($=Bu(c[p]).split("-"),y=$.length,b=Bu(c[p+1]),b=b?b.split("-"):null;y>0;){if(R=Eo($.slice(0,y).join("-")),R)return R;if(b&&b.length>=y&&_d($,b)>=y-1)break;y--}p++}return Wt}function Ed(c){return!!(c&&c.match("^[^/\\\\]*$"))}function Eo(c){var p=null,y;if(ut[c]===void 0&&typeof _l<"u"&&_l&&_l.exports&&Ed(c))try{p=Wt._abbr,y=require,y("./locale/"+c),On(p)}catch{ut[c]=null}return ut[c]}function On(c,p){var y;return c&&(u(p)?y=Ct(c):y=zt(c,p),y?Wt=y:typeof console<"u"&&console.warn&&console.warn("Locale "+c+" not found. Did you forget to load it?")),Wt._abbr}function zt(c,p){if(p!==null){var y,b=oi;if(p.abbr=c,ut[c]!=null)N("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),b=ut[c]._config;else if(p.parentLocale!=null)if(ut[p.parentLocale]!=null)b=ut[p.parentLocale]._config;else if(y=Eo(p.parentLocale),y!=null)b=y._config;else return Mi[p.parentLocale]||(Mi[p.parentLocale]=[]),Mi[p.parentLocale].push({name:c,config:p}),null;return ut[c]=new Z(z(b,p)),Mi[c]&&Mi[c].forEach(function(R){zt(R.name,R.config)}),On(c),ut[c]}else return delete ut[c],null}function jg(c,p){if(p!=null){var y,b,R=oi;ut[c]!=null&&ut[c].parentLocale!=null?ut[c].set(z(ut[c]._config,p)):(b=Eo(c),b!=null&&(R=b._config),p=z(R,p),b==null&&(p.abbr=c),y=new Z(p),y.parentLocale=ut[c],ut[c]=y),On(c)}else ut[c]!=null&&(ut[c].parentLocale!=null?(ut[c]=ut[c].parentLocale,c===On()&&On(c)):ut[c]!=null&&delete ut[c]);return ut[c]}function Ct(c){var p;if(c&&c._locale&&c._locale._abbr&&(c=c._locale._abbr),!c)return Wt;if(!n(c)){if(p=Eo(c),p)return p;c=[c]}return wd(c)}function Ug(){return ie(ut)}function La(c){var p,y=c._a;return y&&C(c).overflow===-2&&(p=y[Rn]<0||y[Rn]>11?Rn:y[Xr]<1||y[Xr]>Ma(y[Vt],y[Rn])?Xr:y[kt]<0||y[kt]>24||y[kt]===24&&(y[jr]!==0||y[In]!==0||y[ii]!==0)?kt:y[jr]<0||y[jr]>59?jr:y[In]<0||y[In]>59?In:y[ii]<0||y[ii]>999?ii:-1,C(c)._overflowDayOfYear&&(p<Vt||p>Xr)&&(p=Xr),C(c)._overflowWeeks&&p===-1&&(p=yg),C(c)._overflowWeekday&&p===-1&&(p=vg),C(c).overflow=p),c}var ai=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ja=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Hu=/Z|[+-]\d\d(?::?\d\d)?/,tt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],en=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Vu=/^\/?Date\((-?\d+)/i,Bg=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Wu={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Cd(c){var p,y,b=c._i,R=ai.exec(b)||ja.exec(b),$,W,se,ye,Pe=tt.length,Gt=en.length;if(R){for(C(c).iso=!0,p=0,y=Pe;p<y;p++)if(tt[p][1].exec(R[1])){W=tt[p][0],$=tt[p][2]!==!1;break}if(W==null){c._isValid=!1;return}if(R[3]){for(p=0,y=Gt;p<y;p++)if(en[p][1].exec(R[3])){se=(R[2]||" ")+en[p][0];break}if(se==null){c._isValid=!1;return}}if(!$&&se!=null){c._isValid=!1;return}if(R[4])if(Hu.exec(R[4]))ye="Z";else{c._isValid=!1;return}c._f=W+(se||"")+(ye||""),Ju(c)}else c._isValid=!1}function Hg(c,p,y,b,R,$){var W=[Vg(c),Nu.indexOf(p),parseInt(y,10),parseInt(b,10),parseInt(R,10)];return $&&W.push(parseInt($,10)),W}function Vg(c){var p=parseInt(c,10);return p<=49?2e3+p:p<=999?1900+p:p}function xd(c){return c.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ua(c,p,y){if(c){var b=gd.indexOf(c),R=new Date(p[0],p[1],p[2]).getDay();if(b!==R)return C(y).weekdayMismatch=!0,y._isValid=!1,!1}return!0}function Cs(c,p,y){if(c)return Wu[c];if(p)return 0;var b=parseInt(y,10),R=b%100,$=(b-R)/100;return $*60+R}function Rd(c){var p=Bg.exec(xd(c._i)),y;if(p){if(y=Hg(p[4],p[3],p[2],p[5],p[6],p[7]),!Ua(p[1],y,c))return;c._a=y,c._tzm=Cs(p[8],p[9],p[10]),c._d=bs.apply(null,c._a),c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),C(c).rfc2822=!0}else c._isValid=!1}function Id(c){var p=Vu.exec(c._i);if(p!==null){c._d=new Date(+p[1]);return}if(Cd(c),c._isValid===!1)delete c._isValid;else return;if(Rd(c),c._isValid===!1)delete c._isValid;else return;c._strict?c._isValid=!1:e.createFromInputFallback(c)}e.createFromInputFallback=E("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(c){c._d=new Date(c._i+(c._useUTC?" UTC":""))});function Ni(c,p,y){return c??p??y}function Yu(c){var p=new Date(e.now());return c._useUTC?[p.getUTCFullYear(),p.getUTCMonth(),p.getUTCDate()]:[p.getFullYear(),p.getMonth(),p.getDate()]}function Co(c){var p,y,b=[],R,$,W;if(!c._d){for(R=Yu(c),c._w&&c._a[Xr]==null&&c._a[Rn]==null&&Od(c),c._dayOfYear!=null&&(W=Ni(c._a[Vt],R[Vt]),(c._dayOfYear>wo(W)||c._dayOfYear===0)&&(C(c)._overflowDayOfYear=!0),y=bs(W,0,c._dayOfYear),c._a[Rn]=y.getUTCMonth(),c._a[Xr]=y.getUTCDate()),p=0;p<3&&c._a[p]==null;++p)c._a[p]=b[p]=R[p];for(;p<7;p++)c._a[p]=b[p]=c._a[p]==null?p===2?1:0:c._a[p];c._a[kt]===24&&c._a[jr]===0&&c._a[In]===0&&c._a[ii]===0&&(c._nextDay=!0,c._a[kt]=0),c._d=(c._useUTC?bs:ud).apply(null,b),$=c._useUTC?c._d.getUTCDay():c._d.getDay(),c._tzm!=null&&c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),c._nextDay&&(c._a[kt]=24),c._w&&typeof c._w.d<"u"&&c._w.d!==$&&(C(c).weekdayMismatch=!0)}}function Od(c){var p,y,b,R,$,W,se,ye,Pe;p=c._w,p.GG!=null||p.W!=null||p.E!=null?($=1,W=4,y=Ni(p.GG,c._a[Vt],ws(st(),1,4).year),b=Ni(p.W,1),R=Ni(p.E,1),(R<1||R>7)&&(ye=!0)):($=c._locale._week.dow,W=c._locale._week.doy,Pe=ws(st(),$,W),y=Ni(p.gg,c._a[Vt],Pe.year),b=Ni(p.w,Pe.week),p.d!=null?(R=p.d,(R<0||R>6)&&(ye=!0)):p.e!=null?(R=p.e+$,(p.e<0||p.e>6)&&(ye=!0)):R=$),b<1||b>Ur(y,$,W)?C(c)._overflowWeeks=!0:ye!=null?C(c)._overflowWeekday=!0:(se=cd(y,b,R,$,W),c._a[Vt]=se.year,c._dayOfYear=se.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Ju(c){if(c._f===e.ISO_8601){Cd(c);return}if(c._f===e.RFC_2822){Rd(c);return}c._a=[],C(c).empty=!0;var p=""+c._i,y,b,R,$,W,se=p.length,ye=0,Pe,Gt;for(R=En(c._f,c._locale).match(he)||[],Gt=R.length,y=0;y<Gt;y++)$=R[y],b=(p.match(mg($,c))||[])[0],b&&(W=p.substr(0,p.indexOf(b)),W.length>0&&C(c).unusedInput.push(W),p=p.slice(p.indexOf(b)+b.length),ye+=b.length),Mt[$]?(b?C(c).empty=!1:C(c).unusedTokens.push($),gg($,b,c)):c._strict&&!b&&C(c).unusedTokens.push($);C(c).charsLeftOver=se-ye,p.length>0&&C(c).unusedInput.push(p),c._a[kt]<=12&&C(c).bigHour===!0&&c._a[kt]>0&&(C(c).bigHour=void 0),C(c).parsedDateParts=c._a.slice(0),C(c).meridiem=c._meridiem,c._a[kt]=zu(c._locale,c._a[kt],c._meridiem),Pe=C(c).era,Pe!==null&&(c._a[Vt]=c._locale.erasConvertYear(Pe,c._a[Vt])),Co(c),La(c)}function zu(c,p,y){var b;return y==null?p:c.meridiemHour!=null?c.meridiemHour(p,y):(c.isPM!=null&&(b=c.isPM(y),b&&p<12&&(p+=12),!b&&p===12&&(p=0)),p)}function Ku(c){var p,y,b,R,$,W,se=!1,ye=c._f.length;if(ye===0){C(c).invalidFormat=!0,c._d=new Date(NaN);return}for(R=0;R<ye;R++)$=0,W=!1,p=V({},c),c._useUTC!=null&&(p._useUTC=c._useUTC),p._f=c._f[R],Ju(p),A(p)&&(W=!0),$+=C(p).charsLeftOver,$+=C(p).unusedTokens.length*10,C(p).score=$,se?$<b&&(b=$,y=p):(b==null||$<b||W)&&(b=$,y=p,W&&(se=!0));m(c,y||p)}function Wg(c){if(!c._d){var p=Ti(c._i),y=p.day===void 0?p.date:p.day;c._a=g([p.year,p.month,y,p.hour,p.minute,p.second,p.millisecond],function(b){return b&&parseInt(b,10)}),Co(c)}}function Pd(c){var p=new K(La(nr(c)));return p._nextDay&&(p.add(1,"d"),p._nextDay=void 0),p}function nr(c){var p=c._i,y=c._f;return c._locale=c._locale||Ct(c._l),p===null||y===void 0&&p===""?T({nullInput:!0}):(typeof p=="string"&&(c._i=p=c._locale.preparse(p)),ee(p)?new K(La(p)):(h(p)?c._d=p:n(y)?Ku(c):y?Ju(c):Gu(c),A(c)||(c._d=null),c))}function Gu(c){var p=c._i;u(p)?c._d=new Date(e.now()):h(p)?c._d=new Date(p.valueOf()):typeof p=="string"?Id(c):n(p)?(c._a=g(p.slice(0),function(y){return parseInt(y,10)}),Co(c)):i(p)?Wg(c):f(p)?c._d=new Date(p):e.createFromInputFallback(c)}function xs(c,p,y,b,R){var $={};return(p===!0||p===!1)&&(b=p,p=void 0),(y===!0||y===!1)&&(b=y,y=void 0),(i(c)&&a(c)||n(c)&&c.length===0)&&(c=void 0),$._isAMomentObject=!0,$._useUTC=$._isUTC=R,$._l=y,$._i=c,$._f=p,$._strict=b,Pd($)}function st(c,p,y,b){return xs(c,p,y,b,!1)}var kd=E("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=st.apply(null,arguments);return this.isValid()&&c.isValid()?c<this?this:c:T()}),Yg=E("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=st.apply(null,arguments);return this.isValid()&&c.isValid()?c>this?this:c:T()});function Ad(c,p){var y,b;if(p.length===1&&n(p[0])&&(p=p[0]),!p.length)return st();for(y=p[0],b=1;b<p.length;++b)(!p[b].isValid()||p[b][c](y))&&(y=p[b]);return y}function Jg(){var c=[].slice.call(arguments,0);return Ad("isBefore",c)}function zg(){var c=[].slice.call(arguments,0);return Ad("isAfter",c)}var Kg=function(){return Date.now?Date.now():+new Date},tn=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Gg(c){var p,y=!1,b,R=tn.length;for(p in c)if(s(c,p)&&!(vt.call(tn,p)!==-1&&(c[p]==null||!isNaN(c[p]))))return!1;for(b=0;b<R;++b)if(c[tn[b]]){if(y)return!1;parseFloat(c[tn[b]])!==Me(c[tn[b]])&&(y=!0)}return!0}function Qg(){return this._isValid}function Qu(){return Te(NaN)}function xo(c){var p=Ti(c),y=p.year||0,b=p.quarter||0,R=p.month||0,$=p.week||p.isoWeek||0,W=p.day||0,se=p.hour||0,ye=p.minute||0,Pe=p.second||0,Gt=p.millisecond||0;this._isValid=Gg(p),this._milliseconds=+Gt+Pe*1e3+ye*6e4+se*1e3*60*60,this._days=+W+$*7,this._months=+R+b*3+y*12,this._data={},this._locale=Ct(),this._bubble()}function Br(c){return c instanceof xo}function Rs(c){return c<0?Math.round(-1*c)*-1:Math.round(c)}function Zg(c,p,y){var b=Math.min(c.length,p.length),R=Math.abs(c.length-p.length),$=0,W;for(W=0;W<b;W++)(y&&c[W]!==p[W]||!y&&Me(c[W])!==Me(p[W]))&&$++;return $+R}function Td(c,p){le(c,0,0,function(){var y=this.utcOffset(),b="+";return y<0&&(y=-y,b="-"),b+Ee(~~(y/60),2)+p+Ee(~~y%60,2)})}Td("Z",":"),Td("ZZ",""),oe("Z",Aa),oe("ZZ",Aa),Ge(["Z","ZZ"],function(c,p,y){y._useUTC=!0,y._tzm=li(Aa,c)});var Xg=/([\+\-]|\d\d)/gi;function li(c,p){var y=(p||"").match(c),b,R,$;return y===null?null:(b=y[y.length-1]||[],R=(b+"").match(Xg)||["-",0,0],$=+(R[1]*60)+Me(R[2]),$===0?0:R[0]==="+"?$:-$)}function pr(c,p){var y,b;return p._isUTC?(y=p.clone(),b=(ee(c)||h(c)?c.valueOf():st(c).valueOf())-y.valueOf(),y._d.setTime(y._d.valueOf()+b),e.updateOffset(y,!1),y):st(c).local()}function Ba(c){return-Math.round(c._d.getTimezoneOffset())}e.updateOffset=function(){};function ey(c,p,y){var b=this._offset||0,R;if(!this.isValid())return c!=null?this:NaN;if(c!=null){if(typeof c=="string"){if(c=li(Aa,c),c===null)return this}else Math.abs(c)<16&&!y&&(c=c*60);return!this._isUTC&&p&&(R=Ba(this)),this._offset=c,this._isUTC=!0,R!=null&&this.add(R,"m"),b!==c&&(!p||this._changeInProgress?$d(this,Te(c-b,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?b:Ba(this)}function ty(c,p){return c!=null?(typeof c!="string"&&(c=-c),this.utcOffset(c,p),this):-this.utcOffset()}function ry(c){return this.utcOffset(0,c)}function ny(c){return this._isUTC&&(this.utcOffset(0,c),this._isUTC=!1,c&&this.subtract(Ba(this),"m")),this}function iy(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var c=li(hg,this._i);c!=null?this.utcOffset(c):this.utcOffset(0,!0)}return this}function ui(c){return this.isValid()?(c=c?st(c).utcOffset():0,(this.utcOffset()-c)%60===0):!1}function U(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function J(){if(!u(this._isDSTShifted))return this._isDSTShifted;var c={},p;return V(c,this),c=nr(c),c._a?(p=c._isUTC?S(c._a):st(c._a),this._isDSTShifted=this.isValid()&&Zg(c._a,p.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function H(){return this.isValid()?!this._isUTC:!1}function ae(){return this.isValid()?this._isUTC:!1}function Se(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Ye=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,At=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Te(c,p){var y=c,b=null,R,$,W;return Br(c)?y={ms:c._milliseconds,d:c._days,M:c._months}:f(c)||!isNaN(+c)?(y={},p?y[p]=+c:y.milliseconds=+c):(b=Ye.exec(c))?(R=b[1]==="-"?-1:1,y={y:0,d:Me(b[Xr])*R,h:Me(b[kt])*R,m:Me(b[jr])*R,s:Me(b[In])*R,ms:Me(Rs(b[ii]*1e3))*R}):(b=At.exec(c))?(R=b[1]==="-"?-1:1,y={y:Pn(b[2],R),M:Pn(b[3],R),w:Pn(b[4],R),d:Pn(b[5],R),h:Pn(b[6],R),m:Pn(b[7],R),s:Pn(b[8],R)}):y==null?y={}:typeof y=="object"&&("from"in y||"to"in y)&&(W=wr(st(y.from),st(y.to)),y={},y.ms=W.milliseconds,y.M=W.months),$=new xo(y),Br(c)&&s(c,"_locale")&&($._locale=c._locale),Br(c)&&s(c,"_isValid")&&($._isValid=c._isValid),$}Te.fn=xo.prototype,Te.invalid=Qu;function Pn(c,p){var y=c&&parseFloat(c.replace(",","."));return(isNaN(y)?0:y)*p}function qd(c,p){var y={};return y.months=p.month()-c.month()+(p.year()-c.year())*12,c.clone().add(y.months,"M").isAfter(p)&&--y.months,y.milliseconds=+p-+c.clone().add(y.months,"M"),y}function wr(c,p){var y;return c.isValid()&&p.isValid()?(p=pr(p,c),c.isBefore(p)?y=qd(c,p):(y=qd(p,c),y.milliseconds=-y.milliseconds,y.months=-y.months),y):{milliseconds:0,months:0}}function Ro(c,p){return function(y,b){var R,$;return b!==null&&!isNaN(+b)&&(N(p,"moment()."+p+"(period, number) is deprecated. Please use moment()."+p+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),$=y,y=b,b=$),R=Te(y,b),$d(this,R,c),this}}function $d(c,p,y,b){var R=p._milliseconds,$=Rs(p._days),W=Rs(p._months);c.isValid()&&(b=b??!0,W&&Na(c,si(c,"Month")+W*y),$&&Xf(c,"Date",si(c,"Date")+$*y),R&&c._d.setTime(c._d.valueOf()+R*y),b&&e.updateOffset(c,$||W))}var Is=Ro(1,"add"),Ha=Ro(-1,"subtract");function Io(c){return typeof c=="string"||c instanceof String}function Ke(c){return ee(c)||h(c)||Io(c)||f(c)||Md(c)||sy(c)||c===null||c===void 0}function sy(c){var p=i(c)&&!a(c),y=!1,b=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],R,$,W=b.length;for(R=0;R<W;R+=1)$=b[R],y=y||s(c,$);return p&&y}function Md(c){var p=n(c),y=!1;return p&&(y=c.filter(function(b){return!f(b)&&Io(c)}).length===0),p&&y}function Va(c){var p=i(c)&&!a(c),y=!1,b=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],R,$;for(R=0;R<b.length;R+=1)$=b[R],y=y||s(c,$);return p&&y}function oy(c,p){var y=c.diff(p,"days",!0);return y<-6?"sameElse":y<-1?"lastWeek":y<0?"lastDay":y<1?"sameDay":y<2?"nextDay":y<7?"nextWeek":"sameElse"}function ay(c,p){arguments.length===1&&(arguments[0]?Ke(arguments[0])?(c=arguments[0],p=void 0):Va(arguments[0])&&(p=arguments[0],c=void 0):(c=void 0,p=void 0));var y=c||st(),b=pr(y,this).startOf("day"),R=e.calendarFormat(this,b)||"sameElse",$=p&&(D(p[R])?p[R].call(this,y):p[R]);return this.format($||this.localeData().calendar(R,this,st(y)))}function ly(){return new K(this)}function Wa(c,p){var y=ee(c)?c:st(c);return this.isValid()&&y.isValid()?(p=yt(p)||"millisecond",p==="millisecond"?this.valueOf()>y.valueOf():y.valueOf()<this.clone().startOf(p).valueOf()):!1}function ci(c,p){var y=ee(c)?c:st(c);return this.isValid()&&y.isValid()?(p=yt(p)||"millisecond",p==="millisecond"?this.valueOf()<y.valueOf():this.clone().endOf(p).valueOf()<y.valueOf()):!1}function Ya(c,p,y,b){var R=ee(c)?c:st(c),$=ee(p)?p:st(p);return this.isValid()&&R.isValid()&&$.isValid()?(b=b||"()",(b[0]==="("?this.isAfter(R,y):!this.isBefore(R,y))&&(b[1]===")"?this.isBefore($,y):!this.isAfter($,y))):!1}function Nd(c,p){var y=ee(c)?c:st(c),b;return this.isValid()&&y.isValid()?(p=yt(p)||"millisecond",p==="millisecond"?this.valueOf()===y.valueOf():(b=y.valueOf(),this.clone().startOf(p).valueOf()<=b&&b<=this.clone().endOf(p).valueOf())):!1}function Ja(c,p){return this.isSame(c,p)||this.isAfter(c,p)}function Dd(c,p){return this.isSame(c,p)||this.isBefore(c,p)}function Fd(c,p,y){var b,R,$;if(!this.isValid())return NaN;if(b=pr(c,this),!b.isValid())return NaN;switch(R=(b.utcOffset()-this.utcOffset())*6e4,p=yt(p),p){case"year":$=Di(this,b)/12;break;case"month":$=Di(this,b);break;case"quarter":$=Di(this,b)/3;break;case"second":$=(this-b)/1e3;break;case"minute":$=(this-b)/6e4;break;case"hour":$=(this-b)/36e5;break;case"day":$=(this-b-R)/864e5;break;case"week":$=(this-b-R)/6048e5;break;default:$=this-b}return y?$:_r($)}function Di(c,p){if(c.date()<p.date())return-Di(p,c);var y=(p.year()-c.year())*12+(p.month()-c.month()),b=c.clone().add(y,"months"),R,$;return p-b<0?(R=c.clone().add(y-1,"months"),$=(p-b)/(b-R)):(R=c.clone().add(y+1,"months"),$=(p-b)/(R-b)),-(y+$)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Ld(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Oo(c){if(!this.isValid())return null;var p=c!==!0,y=p?this.clone().utc():this;return y.year()<0||y.year()>9999?ft(y,p?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):D(Date.prototype.toISOString)?p?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ft(y,"Z")):ft(y,p?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Fi(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var c="moment",p="",y,b,R,$;return this.isLocal()||(c=this.utcOffset()===0?"moment.utc":"moment.parseZone",p="Z"),y="["+c+'("]',b=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",R="-MM-DD[T]HH:mm:ss.SSS",$=p+'[")]',this.format(y+b+R+$)}function za(c){c||(c=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var p=ft(this,c);return this.localeData().postformat(p)}function uy(c,p){return this.isValid()&&(ee(c)&&c.isValid()||st(c).isValid())?Te({to:this,from:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function cy(c){return this.from(st(),c)}function fy(c,p){return this.isValid()&&(ee(c)&&c.isValid()||st(c).isValid())?Te({from:this,to:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function Ka(c){return this.to(st(),c)}function Po(c){var p;return c===void 0?this._locale._abbr:(p=Ct(c),p!=null&&(this._locale=p),this)}var Ga=E("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(c){return c===void 0?this.localeData():this.locale(c)});function jd(){return this._locale}var ko=1e3,Os=60*ko,Qa=60*Os,xt=(365*400+97)*24*Qa;function St(c,p){return(c%p+p)%p}function Ud(c,p,y){return c<100&&c>=0?new Date(c+400,p,y)-xt:new Date(c,p,y).valueOf()}function Bd(c,p,y){return c<100&&c>=0?Date.UTC(c+400,p,y)-xt:Date.UTC(c,p,y)}function Hd(c){var p,y;if(c=yt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(y=this._isUTC?Bd:Ud,c){case"year":p=y(this.year(),0,1);break;case"quarter":p=y(this.year(),this.month()-this.month()%3,1);break;case"month":p=y(this.year(),this.month(),1);break;case"week":p=y(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":p=y(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":p=y(this.year(),this.month(),this.date());break;case"hour":p=this._d.valueOf(),p-=St(p+(this._isUTC?0:this.utcOffset()*Os),Qa);break;case"minute":p=this._d.valueOf(),p-=St(p,Os);break;case"second":p=this._d.valueOf(),p-=St(p,ko);break}return this._d.setTime(p),e.updateOffset(this,!0),this}function dy(c){var p,y;if(c=yt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(y=this._isUTC?Bd:Ud,c){case"year":p=y(this.year()+1,0,1)-1;break;case"quarter":p=y(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":p=y(this.year(),this.month()+1,1)-1;break;case"week":p=y(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":p=y(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":p=y(this.year(),this.month(),this.date()+1)-1;break;case"hour":p=this._d.valueOf(),p+=Qa-St(p+(this._isUTC?0:this.utcOffset()*Os),Qa)-1;break;case"minute":p=this._d.valueOf(),p+=Os-St(p,Os)-1;break;case"second":p=this._d.valueOf(),p+=ko-St(p,ko)-1;break}return this._d.setTime(p),e.updateOffset(this,!0),this}function Zu(){return this._d.valueOf()-(this._offset||0)*6e4}function Ao(){return Math.floor(this.valueOf()/1e3)}function Xu(){return new Date(this.valueOf())}function Ps(){var c=this;return[c.year(),c.month(),c.date(),c.hour(),c.minute(),c.second(),c.millisecond()]}function To(){var c=this;return{years:c.year(),months:c.month(),date:c.date(),hours:c.hours(),minutes:c.minutes(),seconds:c.seconds(),milliseconds:c.milliseconds()}}function qo(){return this.isValid()?this.toISOString():null}function Za(){return A(this)}function ks(){return m({},C(this))}function hy(){return C(this).overflow}function py(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}le("N",0,0,"eraAbbr"),le("NN",0,0,"eraAbbr"),le("NNN",0,0,"eraAbbr"),le("NNNN",0,0,"eraName"),le("NNNNN",0,0,"eraNarrow"),le("y",["y",1],"yo","eraYear"),le("y",["yy",2],0,"eraYear"),le("y",["yyy",3],0,"eraYear"),le("y",["yyyy",4],0,"eraYear"),oe("N",Oe),oe("NN",Oe),oe("NNN",Oe),oe("NNNN",vy),oe("NNNNN",Sy),Ge(["N","NN","NNN","NNNN","NNNNN"],function(c,p,y,b){var R=y._locale.erasParse(c,b,y._strict);R?C(y).era=R:C(y).invalidEra=c}),oe("y",ni),oe("yy",ni),oe("yyy",ni),oe("yyyy",ni),oe("yo",by),Ge(["y","yy","yyy","yyyy"],Vt),Ge(["yo"],function(c,p,y,b){var R;y._locale._eraYearOrdinalRegex&&(R=c.match(y._locale._eraYearOrdinalRegex)),y._locale.eraYearOrdinalParse?p[Vt]=y._locale.eraYearOrdinalParse(c,R):p[Vt]=parseInt(c,10)});function my(c,p){var y,b,R,$=this._eras||Ct("en")._eras;for(y=0,b=$.length;y<b;++y){switch(typeof $[y].since){case"string":R=e($[y].since).startOf("day"),$[y].since=R.valueOf();break}switch(typeof $[y].until){case"undefined":$[y].until=1/0;break;case"string":R=e($[y].until).startOf("day").valueOf(),$[y].until=R.valueOf();break}}return $}function gy(c,p,y){var b,R,$=this.eras(),W,se,ye;for(c=c.toUpperCase(),b=0,R=$.length;b<R;++b)if(W=$[b].name.toUpperCase(),se=$[b].abbr.toUpperCase(),ye=$[b].narrow.toUpperCase(),y)switch(p){case"N":case"NN":case"NNN":if(se===c)return $[b];break;case"NNNN":if(W===c)return $[b];break;case"NNNNN":if(ye===c)return $[b];break}else if([W,se,ye].indexOf(c)>=0)return $[b]}function yy(c,p){var y=c.since<=c.until?1:-1;return p===void 0?e(c.since).year():e(c.since).year()+(p-c.offset)*y}function Xa(){var c,p,y,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(y=this.clone().startOf("day").valueOf(),b[c].since<=y&&y<=b[c].until||b[c].until<=y&&y<=b[c].since)return b[c].name;return""}function $o(){var c,p,y,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(y=this.clone().startOf("day").valueOf(),b[c].since<=y&&y<=b[c].until||b[c].until<=y&&y<=b[c].since)return b[c].narrow;return""}function Vd(){var c,p,y,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(y=this.clone().startOf("day").valueOf(),b[c].since<=y&&y<=b[c].until||b[c].until<=y&&y<=b[c].since)return b[c].abbr;return""}function I(){var c,p,y,b,R=this.localeData().eras();for(c=0,p=R.length;c<p;++c)if(y=R[c].since<=R[c].until?1:-1,b=this.clone().startOf("day").valueOf(),R[c].since<=b&&b<=R[c].until||R[c].until<=b&&b<=R[c].since)return(this.year()-e(R[c].since).year())*y+R[c].offset;return this.year()}function As(c){return s(this,"_erasNameRegex")||kn.call(this),c?this._erasNameRegex:this._erasRegex}function el(c){return s(this,"_erasAbbrRegex")||kn.call(this),c?this._erasAbbrRegex:this._erasRegex}function Er(c){return s(this,"_erasNarrowRegex")||kn.call(this),c?this._erasNarrowRegex:this._erasRegex}function Oe(c,p){return p.erasAbbrRegex(c)}function vy(c,p){return p.erasNameRegex(c)}function Sy(c,p){return p.erasNarrowRegex(c)}function by(c,p){return p._eraYearOrdinalRegex||ni}function kn(){var c=[],p=[],y=[],b=[],R,$,W,se,ye,Pe=this.eras();for(R=0,$=Pe.length;R<$;++R)W=xn(Pe[R].name),se=xn(Pe[R].abbr),ye=xn(Pe[R].narrow),p.push(W),c.push(se),y.push(ye),b.push(W),b.push(se),b.push(ye);this._erasRegex=new RegExp("^("+b.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+p.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+c.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+y.join("|")+")","i")}le(0,["gg",2],0,function(){return this.weekYear()%100}),le(0,["GG",2],0,function(){return this.isoWeekYear()%100});function tl(c,p){le(0,[c,c.length],0,p)}tl("gggg","weekYear"),tl("ggggg","weekYear"),tl("GGGG","isoWeekYear"),tl("GGGGG","isoWeekYear"),oe("G",ys),oe("g",ys),oe("GG",et,hr),oe("gg",et,hr),oe("GGGG",bo,ri),oe("gggg",bo,ri),oe("GGGGG",gs,ps),oe("ggggg",gs,ps),$i(["gggg","ggggg","GGGG","GGGGG"],function(c,p,y,b){p[b.substr(0,2)]=Me(c)}),$i(["gg","GG"],function(c,p,y,b){p[b]=e.parseTwoDigitYear(c)});function _y(c){return Wd.call(this,c,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function wy(c){return Wd.call(this,c,this.isoWeek(),this.isoWeekday(),1,4)}function Ey(){return Ur(this.year(),1,4)}function Cy(){return Ur(this.isoWeekYear(),1,4)}function An(){var c=this.localeData()._week;return Ur(this.year(),c.dow,c.doy)}function xy(){var c=this.localeData()._week;return Ur(this.weekYear(),c.dow,c.doy)}function Wd(c,p,y,b,R){var $;return c==null?ws(this,b,R).year:($=Ur(c,b,R),p>$&&(p=$),Ry.call(this,c,p,y,b,R))}function Ry(c,p,y,b,R){var $=cd(c,p,y,b,R),W=bs($.year,0,$.dayOfYear);return this.year(W.getUTCFullYear()),this.month(W.getUTCMonth()),this.date(W.getUTCDate()),this}le("Q",0,"Qo","quarter"),oe("Q",ds),Ge("Q",function(c,p){p[Rn]=(Me(c)-1)*3});function Iy(c){return c==null?Math.ceil((this.month()+1)/3):this.month((c-1)*3+this.month()%3)}le("D",["DD",2],"Do","date"),oe("D",et,qi),oe("DD",et,hr),oe("Do",function(c,p){return c?p._dayOfMonthOrdinalParse||p._ordinalParse:p._dayOfMonthOrdinalParseLenient}),Ge(["D","DD"],Xr),Ge("Do",function(c,p){p[Xr]=Me(c.match(et)[0])});var Yd=Ss("Date",!0);le("DDD",["DDDD",3],"DDDo","dayOfYear"),oe("DDD",ms),oe("DDDD",hs),Ge(["DDD","DDDD"],function(c,p,y){y._dayOfYear=Me(c)});function Tn(c){var p=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return c==null?p:this.add(c-p,"d")}le("m",["mm",2],0,"minute"),oe("m",et,Mu),oe("mm",et,hr),Ge(["m","mm"],jr);var Oy=Ss("Minutes",!1);le("s",["ss",2],0,"second"),oe("s",et,Mu),oe("ss",et,hr),Ge(["s","ss"],In);var Py=Ss("Seconds",!1);le("S",0,0,function(){return~~(this.millisecond()/100)}),le(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),le(0,["SSS",3],0,"millisecond"),le(0,["SSSS",4],0,function(){return this.millisecond()*10}),le(0,["SSSSS",5],0,function(){return this.millisecond()*100}),le(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),le(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),le(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),le(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),oe("S",ms,ds),oe("SS",ms,hr),oe("SSS",ms,hs);var fi,Jd;for(fi="SSSS";fi.length<=9;fi+="S")oe(fi,ni);function ky(c,p){p[ii]=Me(("0."+c)*1e3)}for(fi="S";fi.length<=9;fi+="S")Ge(fi,ky);Jd=Ss("Milliseconds",!1),le("z",0,0,"zoneAbbr"),le("zz",0,0,"zoneName");function Li(){return this._isUTC?"UTC":""}function Ay(){return this._isUTC?"Coordinated Universal Time":""}var te=K.prototype;te.add=Is,te.calendar=ay,te.clone=ly,te.diff=Fd,te.endOf=dy,te.format=za,te.from=uy,te.fromNow=cy,te.to=fy,te.toNow=Ka,te.get=$a,te.invalidAt=hy,te.isAfter=Wa,te.isBefore=ci,te.isBetween=Ya,te.isSame=Nd,te.isSameOrAfter=Ja,te.isSameOrBefore=Dd,te.isValid=Za,te.lang=Ga,te.locale=Po,te.localeData=jd,te.max=Yg,te.min=kd,te.parsingFlags=ks,te.set=bg,te.startOf=Hd,te.subtract=Ha,te.toArray=Ps,te.toObject=To,te.toDate=Xu,te.toISOString=Oo,te.inspect=Fi,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=qo,te.toString=Ld,te.unix=Ao,te.valueOf=Zu,te.creationData=py,te.eraName=Xa,te.eraNarrow=$o,te.eraAbbr=Vd,te.eraYear=I,te.year=Zf,te.isLeapYear=Sg,te.weekYear=_y,te.isoWeekYear=wy,te.quarter=te.quarters=Iy,te.month=sd,te.daysInMonth=od,te.week=te.weeks=xg,te.isoWeek=te.isoWeeks=hd,te.weeksInYear=An,te.weeksInWeekYear=xy,te.isoWeeksInYear=Ey,te.isoWeeksInISOWeekYear=Cy,te.date=Yd,te.day=te.days=$g,te.weekday=Mg,te.isoWeekday=Ng,te.dayOfYear=Tn,te.hour=te.hours=Nt,te.minute=te.minutes=Oy,te.second=te.seconds=Py,te.millisecond=te.milliseconds=Jd,te.utcOffset=ey,te.utc=ry,te.local=ny,te.parseZone=iy,te.hasAlignedHourOffset=ui,te.isDST=U,te.isLocal=H,te.isUtcOffset=ae,te.isUtc=Se,te.isUTC=Se,te.zoneAbbr=Li,te.zoneName=Ay,te.dates=E("dates accessor is deprecated. Use date instead.",Yd),te.months=E("months accessor is deprecated. Use month instead",sd),te.years=E("years accessor is deprecated. Use year instead",Zf),te.zone=E("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ty),te.isDSTShifted=E("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",J);function Hr(c){return st(c*1e3)}function Ty(){return st.apply(null,arguments).parseZone()}function zd(c){return c}var He=Z.prototype;He.calendar=wt,He.longDateFormat=jt,He.invalidDate=ti,He.ordinal=cg,He.preparse=zd,He.postformat=zd,He.relativeTime=Gf,He.pastFuture=fg,He.set=L,He.eras=my,He.erasParse=gy,He.erasConvertYear=yy,He.erasAbbrRegex=el,He.erasNameRegex=As,He.erasNarrowRegex=Er,He.months=Cg,He.monthsShort=rd,He.monthsParse=id,He.monthsRegex=ad,He.monthsShortRegex=Da,He.week=Du,He.firstDayOfYear=dd,He.firstDayOfWeek=fd,He.weekdays=kg,He.weekdaysMin=Fu,He.weekdaysShort=Ag,He.weekdaysParse=qg,He.weekdaysRegex=lt,He.weekdaysShortRegex=it,He.weekdaysMinRegex=Dg,He.isPM=bd,He.meridiem=Uu;function rl(c,p,y,b){var R=Ct(),$=S().set(b,p);return R[y]($,c)}function Kd(c,p,y){if(f(c)&&(p=c,c=void 0),c=c||"",p!=null)return rl(c,p,y,"month");var b,R=[];for(b=0;b<12;b++)R[b]=rl(c,b,y,"month");return R}function nl(c,p,y,b){typeof c=="boolean"?(f(p)&&(y=p,p=void 0),p=p||""):(p=c,y=p,c=!1,f(p)&&(y=p,p=void 0),p=p||"");var R=Ct(),$=c?R._week.dow:0,W,se=[];if(y!=null)return rl(p,(y+$)%7,b,"day");for(W=0;W<7;W++)se[W]=rl(p,(W+$)%7,b,"day");return se}function Gd(c,p){return Kd(c,p,"months")}function qy(c,p){return Kd(c,p,"monthsShort")}function $y(c,p,y){return nl(c,p,y,"weekdays")}function ec(c,p,y){return nl(c,p,y,"weekdaysShort")}function Mo(c,p,y){return nl(c,p,y,"weekdaysMin")}On("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(c){var p=c%10,y=Me(c%100/10)===1?"th":p===1?"st":p===2?"nd":p===3?"rd":"th";return c+y}}),e.lang=E("moment.lang is deprecated. Use moment.locale instead.",On),e.langData=E("moment.langData is deprecated. Use moment.localeData instead.",Ct);var Cr=Math.abs;function My(){var c=this._data;return this._milliseconds=Cr(this._milliseconds),this._days=Cr(this._days),this._months=Cr(this._months),c.milliseconds=Cr(c.milliseconds),c.seconds=Cr(c.seconds),c.minutes=Cr(c.minutes),c.hours=Cr(c.hours),c.months=Cr(c.months),c.years=Cr(c.years),this}function tc(c,p,y,b){var R=Te(p,y);return c._milliseconds+=b*R._milliseconds,c._days+=b*R._days,c._months+=b*R._months,c._bubble()}function Ny(c,p){return tc(this,c,p,1)}function qn(c,p){return tc(this,c,p,-1)}function il(c){return c<0?Math.floor(c):Math.ceil(c)}function ji(){var c=this._milliseconds,p=this._days,y=this._months,b=this._data,R,$,W,se,ye;return c>=0&&p>=0&&y>=0||c<=0&&p<=0&&y<=0||(c+=il(rc(y)+p)*864e5,p=0,y=0),b.milliseconds=c%1e3,R=_r(c/1e3),b.seconds=R%60,$=_r(R/60),b.minutes=$%60,W=_r($/60),b.hours=W%24,p+=_r(W/24),ye=_r(mr(p)),y+=ye,p-=il(rc(ye)),se=_r(y/12),y%=12,b.days=p,b.months=y,b.years=se,this}function mr(c){return c*4800/146097}function rc(c){return c*146097/4800}function Qd(c){if(!this.isValid())return NaN;var p,y,b=this._milliseconds;if(c=yt(c),c==="month"||c==="quarter"||c==="year")switch(p=this._days+b/864e5,y=this._months+mr(p),c){case"month":return y;case"quarter":return y/3;case"year":return y/12}else switch(p=this._days+Math.round(rc(this._months)),c){case"week":return p/7+b/6048e5;case"day":return p+b/864e5;case"hour":return p*24+b/36e5;case"minute":return p*1440+b/6e4;case"second":return p*86400+b/1e3;case"millisecond":return Math.floor(p*864e5)+b;default:throw new Error("Unknown unit "+c)}}function rn(c){return function(){return this.as(c)}}var Ts=rn("ms"),di=rn("s"),Zd=rn("m"),Dy=rn("h"),sl=rn("d"),Fy=rn("w"),Xd=rn("M"),Ut=rn("Q"),nc=rn("y"),eh=Ts;function nn(){return Te(this)}function ic(c){return c=yt(c),this.isValid()?this[c+"s"]():NaN}function sn(c){return function(){return this.isValid()?this._data[c]:NaN}}var Ui=sn("milliseconds"),th=sn("seconds"),Kt=sn("minutes"),sc=sn("hours"),Ly=sn("days"),jy=sn("months"),Uy=sn("years");function oc(){return _r(this.days()/7)}var $n=Math.round,on={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function rh(c,p,y,b,R){return R.relativeTime(p||1,!!y,c,b)}function By(c,p,y,b){var R=Te(c).abs(),$=$n(R.as("s")),W=$n(R.as("m")),se=$n(R.as("h")),ye=$n(R.as("d")),Pe=$n(R.as("M")),Gt=$n(R.as("w")),an=$n(R.as("y")),Mn=$<=y.ss&&["s",$]||$<y.s&&["ss",$]||W<=1&&["m"]||W<y.m&&["mm",W]||se<=1&&["h"]||se<y.h&&["hh",se]||ye<=1&&["d"]||ye<y.d&&["dd",ye];return y.w!=null&&(Mn=Mn||Gt<=1&&["w"]||Gt<y.w&&["ww",Gt]),Mn=Mn||Pe<=1&&["M"]||Pe<y.M&&["MM",Pe]||an<=1&&["y"]||["yy",an],Mn[2]=p,Mn[3]=+c>0,Mn[4]=b,rh.apply(null,Mn)}function Hy(c){return c===void 0?$n:typeof c=="function"?($n=c,!0):!1}function No(c,p){return on[c]===void 0?!1:p===void 0?on[c]:(on[c]=p,c==="s"&&(on.ss=p-1),!0)}function Vy(c,p){if(!this.isValid())return this.localeData().invalidDate();var y=!1,b=on,R,$;return typeof c=="object"&&(p=c,c=!1),typeof c=="boolean"&&(y=c),typeof p=="object"&&(b=Object.assign({},on,p),p.s!=null&&p.ss==null&&(b.ss=p.s-1)),R=this.localeData(),$=By(this,!y,b,R),y&&($=R.pastFuture(+this,$)),R.postformat($)}var ac=Math.abs;function hi(c){return(c>0)-(c<0)||+c}function Do(){if(!this.isValid())return this.localeData().invalidDate();var c=ac(this._milliseconds)/1e3,p=ac(this._days),y=ac(this._months),b,R,$,W,se=this.asSeconds(),ye,Pe,Gt,an;return se?(b=_r(c/60),R=_r(b/60),c%=60,b%=60,$=_r(y/12),y%=12,W=c?c.toFixed(3).replace(/\.?0+$/,""):"",ye=se<0?"-":"",Pe=hi(this._months)!==hi(se)?"-":"",Gt=hi(this._days)!==hi(se)?"-":"",an=hi(this._milliseconds)!==hi(se)?"-":"",ye+"P"+($?Pe+$+"Y":"")+(y?Pe+y+"M":"")+(p?Gt+p+"D":"")+(R||b||c?"T":"")+(R?an+R+"H":"")+(b?an+b+"M":"")+(c?an+W+"S":"")):"P0D"}var je=xo.prototype;je.isValid=Qg,je.abs=My,je.add=Ny,je.subtract=qn,je.as=Qd,je.asMilliseconds=Ts,je.asSeconds=di,je.asMinutes=Zd,je.asHours=Dy,je.asDays=sl,je.asWeeks=Fy,je.asMonths=Xd,je.asQuarters=Ut,je.asYears=nc,je.valueOf=eh,je._bubble=ji,je.clone=nn,je.get=ic,je.milliseconds=Ui,je.seconds=th,je.minutes=Kt,je.hours=sc,je.days=Ly,je.weeks=oc,je.months=jy,je.years=Uy,je.humanize=Vy,je.toISOString=Do,je.toString=Do,je.toJSON=Do,je.locale=Po,je.localeData=jd,je.toIsoString=E("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Do),je.lang=Ga,le("X",0,0,"unix"),le("x",0,0,"valueOf"),oe("x",ys),oe("X",pg),Ge("X",function(c,p,y){y._d=new Date(parseFloat(c)*1e3)}),Ge("x",function(c,p,y){y._d=new Date(Me(c))});return e.version="2.30.1",r(st),e.fn=te,e.min=Jg,e.max=zg,e.now=Kg,e.utc=S,e.unix=Hr,e.months=Gd,e.isDate=h,e.locale=On,e.invalid=T,e.duration=Te,e.isMoment=ee,e.weekdays=$y,e.parseZone=Ty,e.localeData=Ct,e.isDuration=Br,e.monthsShort=qy,e.weekdaysMin=Mo,e.defineLocale=zt,e.updateLocale=jg,e.locales=Ug,e.weekdaysShort=ec,e.normalizeUnits=yt,e.relativeTimeRounding=Hy,e.relativeTimeThreshold=No,e.calendarFormat=oy,e.prototype=te,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var pC=F((hC,Nh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Nh<"u"&&Nh.exports?Nh.exports=e():t.tv4=e()})(hC,function(){Object.keys||(Object.keys=function(){var k=Object.prototype.hasOwnProperty,E=!{toString:null}.propertyIsEnumerable("toString"),P=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],N=P.length;return function(D){if(typeof D!="object"&&typeof D!="function"||D===null)throw new TypeError("Object.keys called on non-object");var L=[];for(var z in D)k.call(D,z)&&L.push(z);if(E)for(var Z=0;Z<N;Z++)k.call(D,P[Z])&&L.push(P[Z]);return L}}()),Object.create||(Object.create=function(){function k(){}return function(E){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return k.prototype=E,new k}}()),Array.isArray||(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(k){if(this===null)throw new TypeError;var E=Object(this),P=E.length>>>0;if(P===0)return-1;var N=0;if(arguments.length>1&&(N=Number(arguments[1]),N!==N?N=0:N!==0&&N!==1/0&&N!==-1/0&&(N=(N>0||-1)*Math.floor(Math.abs(N)))),N>=P)return-1;for(var D=N>=0?N:Math.max(P-Math.abs(N),0);D<P;D++)if(D in E&&E[D]===k)return D;return-1}),Object.isFrozen||(Object.isFrozen=function(k){for(var E="tv4_test_frozen_key";k.hasOwnProperty(E);)E+=Math.random();try{return k[E]=!0,delete k[E],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(k){return encodeURI(k).replace(/%25[0-9][0-9]/g,function(E){return"%"+E.substring(3)})}function n(k){var E="";t[k.charAt(0)]&&(E=k.charAt(0),k=k.substring(1));var P="",N="",D=!0,L=!1,z=!1;E==="+"?D=!1:E==="."?(N=".",P="."):E==="/"?(N="/",P="/"):E==="#"?(N="#",D=!1):E===";"?(N=";",P=";",L=!0,z=!0):E==="?"?(N="?",P="&",L=!0):E==="&"&&(N="&",P="&",L=!0);for(var Z=[],ie=k.split(","),fe=[],wt={},Ee=0;Ee<ie.length;Ee++){var he=ie[Ee],Xe=null;if(he.indexOf(":")!==-1){var Et=he.split(":");he=Et[0],Xe=parseInt(Et[1],10)}for(var Mt={};e[he.charAt(he.length-1)];)Mt[he.charAt(he.length-1)]=!0,he=he.substring(0,he.length-1);var le={truncate:Xe,name:he,suffices:Mt};fe.push(le),wt[he]=le,Z.push(he)}var ei=function($u){for(var ft="",En=0,cs=0;cs<fe.length;cs++){var jt=fe[cs],dt=$u(jt.name);if(dt==null||Array.isArray(dt)&&dt.length===0||typeof dt=="object"&&Object.keys(dt).length===0){En++;continue}if(cs===En?ft+=N:ft+=P||",",Array.isArray(dt)){L&&(ft+=jt.name+"=");for(var ti=0;ti<dt.length;ti++)ti>0&&(ft+=jt.suffices["*"]&&P||",",jt.suffices["*"]&&L&&(ft+=jt.name+"=")),ft+=D?encodeURIComponent(dt[ti]).replace(/!/g,"%21"):r(dt[ti])}else if(typeof dt=="object"){L&&!jt.suffices["*"]&&(ft+=jt.name+"=");var rr=!0;for(var Zr in dt)rr||(ft+=jt.suffices["*"]&&P||","),rr=!1,ft+=D?encodeURIComponent(Zr).replace(/!/g,"%21"):r(Zr),ft+=jt.suffices["*"]?"=":",",ft+=D?encodeURIComponent(dt[Zr]).replace(/!/g,"%21"):r(dt[Zr])}else L&&(ft+=jt.name,(!z||dt!=="")&&(ft+="=")),jt.truncate!=null&&(dt=dt.substring(0,jt.truncate)),ft+=D?encodeURIComponent(dt).replace(/!/g,"%21"):r(dt)}return ft};return ei.varNames=Z,{prefix:N,substitution:ei}}function i(k){if(!(this instanceof i))return new i(k);for(var E=k.split("{"),P=[E.shift()],N=[],D=[],L=[];E.length>0;){var z=E.shift(),Z=z.split("}")[0],ie=z.substring(Z.length+1),fe=n(Z);D.push(fe.substitution),N.push(fe.prefix),P.push(ie),L=L.concat(fe.substitution.varNames)}this.fill=function(wt){for(var Ee=P[0],he=0;he<D.length;he++){var Xe=D[he];Ee+=Xe(wt),Ee+=P[he+1]}return Ee},this.varNames=L,this.template=k}i.prototype={toString:function(){return this.template},fillFromObject:function(k){return this.fill(function(E){return k[E]})}};var s=function(E,P,N,D,L){if(this.missing=[],this.missingMap={},this.formatValidators=E?Object.create(E.formatValidators):{},this.schemas=E?Object.create(E.schemas):{},this.collectMultiple=P,this.errors=[],this.handleError=P?this.collectError:this.returnError,D&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),L&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=N||_("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},E)for(var z in E.definedKeywords)this.definedKeywords[z]=E.definedKeywords[z].slice(0)};s.prototype.defineKeyword=function(k,E){this.definedKeywords[k]=this.definedKeywords[k]||[],this.definedKeywords[k].push(E)},s.prototype.createError=function(k,E,P,N,D,L,z){var Z=new j(k,E,P,N,D);return Z.message=this.errorReporter(Z,L,z),Z},s.prototype.returnError=function(k){return k},s.prototype.collectError=function(k){return k&&this.errors.push(k),null},s.prototype.prefixErrors=function(k,E,P){for(var N=k;N<this.errors.length;N++)this.errors[N]=this.errors[N].prefixWith(E,P);return this},s.prototype.banUnknownProperties=function(k,E){for(var P in this.unknownPropertyPaths){var N=this.createError(C.UNKNOWN_PROPERTY,{path:P},P,"",null,k,E),D=this.handleError(N);if(D)return D}return null},s.prototype.addFormat=function(k,E){if(typeof k=="object"){for(var P in k)this.addFormat(P,k[P]);return this}this.formatValidators[k]=E},s.prototype.resolveRefs=function(k,E){if(k.$ref!==void 0){if(E=E||{},E[k.$ref])return this.createError(C.CIRCULAR_REFERENCE,{urls:Object.keys(E).join(", ")},"","",null,void 0,k);E[k.$ref]=!0,k=this.getSchema(k.$ref,E)}return k},s.prototype.getSchema=function(k,E){var P;if(this.schemas[k]!==void 0)return P=this.schemas[k],this.resolveRefs(P,E);var N=k,D="";if(k.indexOf("#")!==-1&&(D=k.substring(k.indexOf("#")+1),N=k.substring(0,k.indexOf("#"))),typeof this.schemas[N]=="object"){P=this.schemas[N];var L=decodeURIComponent(D);if(L==="")return this.resolveRefs(P,E);if(L.charAt(0)!=="/")return;for(var z=L.split("/").slice(1),Z=0;Z<z.length;Z++){var ie=z[Z].replace(/~1/g,"/").replace(/~0/g,"~");if(P[ie]===void 0){P=void 0;break}P=P[ie]}if(P!==void 0)return this.resolveRefs(P,E)}this.missing[N]===void 0&&(this.missing.push(N),this.missing[N]=N,this.missingMap[N]=N)},s.prototype.searchSchemas=function(k,E){if(Array.isArray(k))for(var P=0;P<k.length;P++)this.searchSchemas(k[P],E);else if(k&&typeof k=="object"){typeof k.id=="string"&&Y(E,k.id)&&this.schemas[k.id]===void 0&&(this.schemas[k.id]=k);for(var N in k)if(N!=="enum"){if(typeof k[N]=="object")this.searchSchemas(k[N],E);else if(N==="$ref"){var D=m(k[N]);D&&this.schemas[D]===void 0&&this.missingMap[D]===void 0&&(this.missingMap[D]=D)}}}},s.prototype.addSchema=function(k,E){if(typeof k!="string"||typeof E>"u")if(typeof k=="object"&&typeof k.id=="string")E=k,k=E.id;else return;k===m(k)+"#"&&(k=m(k)),this.schemas[k]=E,delete this.missingMap[k],S(E,k),this.searchSchemas(E,k)},s.prototype.getSchemaMap=function(){var k={};for(var E in this.schemas)k[E]=this.schemas[E];return k},s.prototype.getSchemaUris=function(k){var E=[];for(var P in this.schemas)(!k||k.test(P))&&E.push(P);return E},s.prototype.getMissingUris=function(k){var E=[];for(var P in this.missingMap)(!k||k.test(P))&&E.push(P);return E},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(k,E,P,N,D){var L;if(E=this.resolveRefs(E),E){if(E instanceof j)return this.errors.push(E),E}else return null;var z=this.errors.length,Z,ie=null,fe=null;if(this.checkRecursive&&k&&typeof k=="object"){if(L=!this.scanned.length,k[this.validatedSchemasKey]){var wt=k[this.validatedSchemasKey].indexOf(E);if(wt!==-1)return this.errors=this.errors.concat(k[this.validationErrorsKey][wt]),null}if(Object.isFrozen(k)&&(Z=this.scannedFrozen.indexOf(k),Z!==-1)){var Ee=this.scannedFrozenSchemas[Z].indexOf(E);if(Ee!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[Z][Ee]),null}if(this.scanned.push(k),Object.isFrozen(k))Z===-1&&(Z=this.scannedFrozen.length,this.scannedFrozen.push(k),this.scannedFrozenSchemas.push([])),ie=this.scannedFrozenSchemas[Z].length,this.scannedFrozenSchemas[Z][ie]=E,this.scannedFrozenValidationErrors[Z][ie]=[];else{if(!k[this.validatedSchemasKey])try{Object.defineProperty(k,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(k,this.validationErrorsKey,{value:[],configurable:!0})}catch{k[this.validatedSchemasKey]=[],k[this.validationErrorsKey]=[]}fe=k[this.validatedSchemasKey].length,k[this.validatedSchemasKey][fe]=E,k[this.validationErrorsKey][fe]=[]}}var he=this.errors.length,Xe=this.validateBasic(k,E,D)||this.validateNumeric(k,E,D)||this.validateString(k,E,D)||this.validateArray(k,E,D)||this.validateObject(k,E,D)||this.validateCombinations(k,E,D)||this.validateHypermedia(k,E,D)||this.validateFormat(k,E,D)||this.validateDefinedKeywords(k,E,D)||null;if(L){for(;this.scanned.length;){var Et=this.scanned.pop();delete Et[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Xe||he!==this.errors.length)for(;P&&P.length||N&&N.length;){var Mt=P&&P.length?""+P.pop():null,le=N&&N.length?""+N.pop():null;Xe&&(Xe=Xe.prefixWith(Mt,le)),this.prefixErrors(he,Mt,le)}return ie!==null?this.scannedFrozenValidationErrors[Z][ie]=this.errors.slice(z):fe!==null&&(k[this.validationErrorsKey][fe]=this.errors.slice(z)),this.handleError(Xe)},s.prototype.validateFormat=function(k,E){if(typeof E.format!="string"||!this.formatValidators[E.format])return null;var P=this.formatValidators[E.format].call(null,k,E);return typeof P=="string"||typeof P=="number"?this.createError(C.FORMAT_CUSTOM,{message:P},"","/format",null,k,E):P&&typeof P=="object"?this.createError(C.FORMAT_CUSTOM,{message:P.message||"?"},P.dataPath||"",P.schemaPath||"/format",null,k,E):null},s.prototype.validateDefinedKeywords=function(k,E,P){for(var N in this.definedKeywords)if(!(typeof E[N]>"u"))for(var D=this.definedKeywords[N],L=0;L<D.length;L++){var z=D[L],Z=z(k,E[N],E,P);if(typeof Z=="string"||typeof Z=="number")return this.createError(C.KEYWORD_CUSTOM,{key:N,message:Z},"","",null,k,E).prefixWith(null,N);if(Z&&typeof Z=="object"){var ie=Z.code;if(typeof ie=="string"){if(!C[ie])throw new Error("Undefined error code (use defineError): "+ie);ie=C[ie]}else typeof ie!="number"&&(ie=C.KEYWORD_CUSTOM);var fe=typeof Z.message=="object"?Z.message:{key:N,message:Z.message||"?"},wt=Z.schemaPath||"/"+N.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ie,fe,Z.dataPath||null,wt,null,k,E)}}return null};function a(k,E){if(k===E)return!0;if(k&&E&&typeof k=="object"&&typeof E=="object"){if(Array.isArray(k)!==Array.isArray(E))return!1;if(Array.isArray(k)){if(k.length!==E.length)return!1;for(var P=0;P<k.length;P++)if(!a(k[P],E[P]))return!1}else{var N;for(N in k)if(E[N]===void 0&&k[N]!==void 0)return!1;for(N in E)if(k[N]===void 0&&E[N]!==void 0)return!1;for(N in k)if(!a(k[N],E[N]))return!1}return!0}return!1}s.prototype.validateBasic=function(E,P,N){var D;return(D=this.validateType(E,P,N))||(D=this.validateEnum(E,P,N))?D.prefixWith(null,"type"):null},s.prototype.validateType=function(E,P){if(P.type===void 0)return null;var N=typeof E;E===null?N="null":Array.isArray(E)&&(N="array");var D=P.type;Array.isArray(D)||(D=[D]);for(var L=0;L<D.length;L++){var z=D[L];if(z===N||z==="integer"&&N==="number"&&E%1===0)return null}return this.createError(C.INVALID_TYPE,{type:N,expected:D.join("/")},"","",null,E,P)},s.prototype.validateEnum=function(E,P){if(P.enum===void 0)return null;for(var N=0;N<P.enum.length;N++){var D=P.enum[N];if(a(E,D))return null}return this.createError(C.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(E):E},"","",null,E,P)},s.prototype.validateNumeric=function(E,P,N){return this.validateMultipleOf(E,P,N)||this.validateMinMax(E,P,N)||this.validateNaN(E,P,N)||null};var u=Math.pow(2,-51),f=1-u;s.prototype.validateMultipleOf=function(E,P){var N=P.multipleOf||P.divisibleBy;if(N===void 0)return null;if(typeof E=="number"){var D=E/N%1;if(D>=u&&D<f)return this.createError(C.NUMBER_MULTIPLE_OF,{value:E,multipleOf:N},"","",null,E,P)}return null},s.prototype.validateMinMax=function(E,P){if(typeof E!="number")return null;if(P.minimum!==void 0){if(E<P.minimum)return this.createError(C.NUMBER_MINIMUM,{value:E,minimum:P.minimum},"","/minimum",null,E,P);if(P.exclusiveMinimum&&E===P.minimum)return this.createError(C.NUMBER_MINIMUM_EXCLUSIVE,{value:E,minimum:P.minimum},"","/exclusiveMinimum",null,E,P)}if(P.maximum!==void 0){if(E>P.maximum)return this.createError(C.NUMBER_MAXIMUM,{value:E,maximum:P.maximum},"","/maximum",null,E,P);if(P.exclusiveMaximum&&E===P.maximum)return this.createError(C.NUMBER_MAXIMUM_EXCLUSIVE,{value:E,maximum:P.maximum},"","/exclusiveMaximum",null,E,P)}return null},s.prototype.validateNaN=function(E,P){return typeof E!="number"?null:isNaN(E)===!0||E===1/0||E===-1/0?this.createError(C.NUMBER_NOT_A_NUMBER,{value:E},"","/type",null,E,P):null},s.prototype.validateString=function(E,P,N){return this.validateStringLength(E,P,N)||this.validateStringPattern(E,P,N)||null},s.prototype.validateStringLength=function(E,P){return typeof E!="string"?null:P.minLength!==void 0&&E.length<P.minLength?this.createError(C.STRING_LENGTH_SHORT,{length:E.length,minimum:P.minLength},"","/minLength",null,E,P):P.maxLength!==void 0&&E.length>P.maxLength?this.createError(C.STRING_LENGTH_LONG,{length:E.length,maximum:P.maxLength},"","/maxLength",null,E,P):null},s.prototype.validateStringPattern=function(E,P){if(typeof E!="string"||typeof P.pattern!="string"&&!(P.pattern instanceof RegExp))return null;var N;if(P.pattern instanceof RegExp)N=P.pattern;else{var D,L="",z=P.pattern.match(/^\/(.+)\/([img]*)$/);z?(D=z[1],L=z[2]):D=P.pattern,N=new RegExp(D,L)}return N.test(E)?null:this.createError(C.STRING_PATTERN,{pattern:P.pattern},"","/pattern",null,E,P)},s.prototype.validateArray=function(E,P,N){return Array.isArray(E)&&(this.validateArrayLength(E,P,N)||this.validateArrayUniqueItems(E,P,N)||this.validateArrayItems(E,P,N))||null},s.prototype.validateArrayLength=function(E,P){var N;return P.minItems!==void 0&&E.length<P.minItems&&(N=this.createError(C.ARRAY_LENGTH_SHORT,{length:E.length,minimum:P.minItems},"","/minItems",null,E,P),this.handleError(N))||P.maxItems!==void 0&&E.length>P.maxItems&&(N=this.createError(C.ARRAY_LENGTH_LONG,{length:E.length,maximum:P.maxItems},"","/maxItems",null,E,P),this.handleError(N))?N:null},s.prototype.validateArrayUniqueItems=function(E,P){if(P.uniqueItems){for(var N=0;N<E.length;N++)for(var D=N+1;D<E.length;D++)if(a(E[N],E[D])){var L=this.createError(C.ARRAY_UNIQUE,{match1:N,match2:D},"","/uniqueItems",null,E,P);if(this.handleError(L))return L}}return null},s.prototype.validateArrayItems=function(E,P,N){if(P.items===void 0)return null;var D,L;if(Array.isArray(P.items)){for(L=0;L<E.length;L++)if(L<P.items.length){if(D=this.validateAll(E[L],P.items[L],[L],["items",L],N+"/"+L))return D}else if(P.additionalItems!==void 0){if(typeof P.additionalItems=="boolean"){if(!P.additionalItems&&(D=this.createError(C.ARRAY_ADDITIONAL_ITEMS,{},"/"+L,"/additionalItems",null,E,P),this.handleError(D)))return D}else if(D=this.validateAll(E[L],P.additionalItems,[L],["additionalItems"],N+"/"+L))return D}}else for(L=0;L<E.length;L++)if(D=this.validateAll(E[L],P.items,[L],["items"],N+"/"+L))return D;return null},s.prototype.validateObject=function(E,P,N){return typeof E!="object"||E===null||Array.isArray(E)?null:this.validateObjectMinMaxProperties(E,P,N)||this.validateObjectRequiredProperties(E,P,N)||this.validateObjectProperties(E,P,N)||this.validateObjectDependencies(E,P,N)||null},s.prototype.validateObjectMinMaxProperties=function(E,P){var N=Object.keys(E),D;return P.minProperties!==void 0&&N.length<P.minProperties&&(D=this.createError(C.OBJECT_PROPERTIES_MINIMUM,{propertyCount:N.length,minimum:P.minProperties},"","/minProperties",null,E,P),this.handleError(D))||P.maxProperties!==void 0&&N.length>P.maxProperties&&(D=this.createError(C.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:N.length,maximum:P.maxProperties},"","/maxProperties",null,E,P),this.handleError(D))?D:null},s.prototype.validateObjectRequiredProperties=function(E,P){if(P.required!==void 0)for(var N=0;N<P.required.length;N++){var D=P.required[N];if(E[D]===void 0){var L=this.createError(C.OBJECT_REQUIRED,{key:D},"","/required/"+N,null,E,P);if(this.handleError(L))return L}}return null},s.prototype.validateObjectProperties=function(E,P,N){var D;for(var L in E){var z=N+"/"+L.replace(/~/g,"~0").replace(/\//g,"~1"),Z=!1;if(P.properties!==void 0&&P.properties[L]!==void 0&&(Z=!0,D=this.validateAll(E[L],P.properties[L],[L],["properties",L],z)))return D;if(P.patternProperties!==void 0)for(var ie in P.patternProperties){var fe=new RegExp(ie);if(fe.test(L)&&(Z=!0,D=this.validateAll(E[L],P.patternProperties[ie],[L],["patternProperties",ie],z)))return D}if(Z)this.trackUnknownProperties&&(this.knownPropertyPaths[z]=!0,delete this.unknownPropertyPaths[z]);else if(P.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[z]=!0,delete this.unknownPropertyPaths[z]),typeof P.additionalProperties=="boolean"){if(!P.additionalProperties&&(D=this.createError(C.OBJECT_ADDITIONAL_PROPERTIES,{key:L},"","/additionalProperties",null,E,P).prefixWith(L,null),this.handleError(D)))return D}else if(D=this.validateAll(E[L],P.additionalProperties,[L],["additionalProperties"],z))return D}else this.trackUnknownProperties&&!this.knownPropertyPaths[z]&&(this.unknownPropertyPaths[z]=!0)}return null},s.prototype.validateObjectDependencies=function(E,P,N){var D;if(P.dependencies!==void 0){for(var L in P.dependencies)if(E[L]!==void 0){var z=P.dependencies[L];if(typeof z=="string"){if(E[z]===void 0&&(D=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:L,missing:z},"","",null,E,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(Array.isArray(z))for(var Z=0;Z<z.length;Z++){var ie=z[Z];if(E[ie]===void 0&&(D=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:L,missing:ie},"","/"+Z,null,E,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(D=this.validateAll(E,z,[],["dependencies",L],N))return D}}return null},s.prototype.validateCombinations=function(E,P,N){return this.validateAllOf(E,P,N)||this.validateAnyOf(E,P,N)||this.validateOneOf(E,P,N)||this.validateNot(E,P,N)||null},s.prototype.validateAllOf=function(E,P,N){if(P.allOf===void 0)return null;for(var D,L=0;L<P.allOf.length;L++){var z=P.allOf[L];if(D=this.validateAll(E,z,[],["allOf",L],N))return D}return null},s.prototype.validateAnyOf=function(E,P,N){if(P.anyOf===void 0)return null;var D=[],L=this.errors.length,z,Z;this.trackUnknownProperties&&(z=this.unknownPropertyPaths,Z=this.knownPropertyPaths);for(var ie=!0,fe=0;fe<P.anyOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var wt=P.anyOf[fe],Ee=this.errors.length,he=this.validateAll(E,wt,[],["anyOf",fe],N);if(he===null&&Ee===this.errors.length){if(this.errors=this.errors.slice(0,L),this.trackUnknownProperties){for(var Xe in this.knownPropertyPaths)Z[Xe]=!0,delete z[Xe];for(var Et in this.unknownPropertyPaths)Z[Et]||(z[Et]=!0);ie=!1;continue}return null}he&&D.push(he.prefixWith(null,""+fe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=z,this.knownPropertyPaths=Z),ie)return D=D.concat(this.errors.slice(L)),this.errors=this.errors.slice(0,L),this.createError(C.ANY_OF_MISSING,{},"","/anyOf",D,E,P)},s.prototype.validateOneOf=function(E,P,N){if(P.oneOf===void 0)return null;var D=null,L=[],z=this.errors.length,Z,ie;this.trackUnknownProperties&&(Z=this.unknownPropertyPaths,ie=this.knownPropertyPaths);for(var fe=0;fe<P.oneOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var wt=P.oneOf[fe],Ee=this.errors.length,he=this.validateAll(E,wt,[],["oneOf",fe],N);if(he===null&&Ee===this.errors.length){if(D===null)D=fe;else return this.errors=this.errors.slice(0,z),this.createError(C.ONE_OF_MULTIPLE,{index1:D,index2:fe},"","/oneOf",null,E,P);if(this.trackUnknownProperties){for(var Xe in this.knownPropertyPaths)ie[Xe]=!0,delete Z[Xe];for(var Et in this.unknownPropertyPaths)ie[Et]||(Z[Et]=!0)}}else he&&L.push(he)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=Z,this.knownPropertyPaths=ie),D===null?(L=L.concat(this.errors.slice(z)),this.errors=this.errors.slice(0,z),this.createError(C.ONE_OF_MISSING,{},"","/oneOf",L,E,P)):(this.errors=this.errors.slice(0,z),null)},s.prototype.validateNot=function(E,P,N){if(P.not===void 0)return null;var D=this.errors.length,L,z;this.trackUnknownProperties&&(L=this.unknownPropertyPaths,z=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var Z=this.validateAll(E,P.not,null,null,N),ie=this.errors.slice(D);return this.errors=this.errors.slice(0,D),this.trackUnknownProperties&&(this.unknownPropertyPaths=L,this.knownPropertyPaths=z),Z===null&&ie.length===0?this.createError(C.NOT_PASSED,{},"","/not",null,E,P):null},s.prototype.validateHypermedia=function(E,P,N){if(!P.links)return null;for(var D,L=0;L<P.links.length;L++){var z=P.links[L];if(z.rel==="describedby"){for(var Z=new i(z.href),ie=!0,fe=0;fe<Z.varNames.length;fe++)if(!(Z.varNames[fe]in E)){ie=!1;break}if(ie){var wt=Z.fillFromObject(E),Ee={$ref:wt};if(D=this.validateAll(E,Ee,[],["links",L],N))return D}}}};function h(k){var E=String(k).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return E?{href:E[0]||"",protocol:E[1]||"",authority:E[2]||"",host:E[3]||"",hostname:E[4]||"",port:E[5]||"",pathname:E[6]||"",search:E[7]||"",hash:E[8]||""}:null}function g(k,E){function P(N){var D=[];return N.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(L){L==="/.."?D.pop():D.push(L)}),D.join("").replace(/^\//,N.charAt(0)==="/"?"/":"")}return E=h(E||""),k=h(k||""),!E||!k?null:(E.protocol||k.protocol)+(E.protocol||E.authority?E.authority:k.authority)+P(E.protocol||E.authority||E.pathname.charAt(0)==="/"?E.pathname:E.pathname?(k.authority&&!k.pathname?"/":"")+k.pathname.slice(0,k.pathname.lastIndexOf("/")+1)+E.pathname:k.pathname)+(E.protocol||E.authority||E.pathname?E.search:E.search||k.search)+E.hash}function m(k){return k.split("#")[0]}function S(k,E){if(k&&typeof k=="object")if(E===void 0?E=k.id:typeof k.id=="string"&&(E=g(E,k.id),k.id=E),Array.isArray(k))for(var P=0;P<k.length;P++)S(k[P],E);else{typeof k.$ref=="string"&&(k.$ref=g(E,k.$ref));for(var N in k)N!=="enum"&&S(k[N],E)}}function _(k){k=k||"en";var E=V[k];return function(P){var N=E[P.code]||T[P.code];if(typeof N!="string")return"Unknown error code "+P.code+": "+JSON.stringify(P.messageParams);var D=P.params;return N.replace(/\{([^{}]*)\}/g,function(L,z){var Z=D[z];return typeof Z=="string"||typeof Z=="number"?Z:L})}}var C={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},x={};for(var A in C)x[C[A]]=A;var T={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function j(k,E,P,N,D){if(Error.call(this),k===void 0)throw new Error("No error code supplied: "+N);this.message="",this.params=E,this.code=k,this.dataPath=P||"",this.schemaPath=N||"",this.subErrors=D||null;var L=new Error(this.message);if(this.stack=L.stack||L.stacktrace,!this.stack)try{throw L}catch(z){this.stack=z.stack||z.stacktrace}}j.prototype=Object.create(Error.prototype),j.prototype.constructor=j,j.prototype.name="ValidationError",j.prototype.prefixWith=function(k,E){if(k!==null&&(k=k.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+k+this.dataPath),E!==null&&(E=E.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+E+this.schemaPath),this.subErrors!==null)for(var P=0;P<this.subErrors.length;P++)this.subErrors[P].prefixWith(k,E);return this};function Y(k,E){if(E.substring(0,k.length)===k){var P=E.substring(k.length);if(E.length>0&&E.charAt(k.length-1)==="/"||P.charAt(0)==="#"||P.charAt(0)==="?")return!0}return!1}var V={};function K(k){var E=new s,P,N,D={setErrorReporter:function(L){return typeof L=="string"?this.language(L):(N=L,!0)},addFormat:function(){E.addFormat.apply(E,arguments)},language:function(L){return L?(V[L]||(L=L.split("-")[0]),V[L]?(P=L,L):!1):P},addLanguage:function(L,z){var Z;for(Z in C)z[Z]&&!z[C[Z]]&&(z[C[Z]]=z[Z]);var ie=L.split("-")[0];if(!V[ie])V[L]=z,V[ie]=z;else{V[L]=Object.create(V[ie]);for(Z in z)typeof V[ie][Z]>"u"&&(V[ie][Z]=z[Z]),V[L][Z]=z[Z]}return this},freshApi:function(L){var z=K();return L&&z.language(L),z},validate:function(L,z,Z,ie){var fe=_(P),wt=N?function(Xe,Et,Mt){return N(Xe,Et,Mt)||fe(Xe,Et,Mt)}:fe,Ee=new s(E,!1,wt,Z,ie);typeof z=="string"&&(z={$ref:z}),Ee.addSchema("",z);var he=Ee.validateAll(L,z,null,null,"");return!he&&ie&&(he=Ee.banUnknownProperties(L,z)),this.error=he,this.missing=Ee.missing,this.valid=he===null,this.valid},validateResult:function(){var L={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(L,arguments),L},validateMultiple:function(L,z,Z,ie){var fe=_(P),wt=N?function(Xe,Et,Mt){return N(Xe,Et,Mt)||fe(Xe,Et,Mt)}:fe,Ee=new s(E,!0,wt,Z,ie);typeof z=="string"&&(z={$ref:z}),Ee.addSchema("",z),Ee.validateAll(L,z,null,null,""),ie&&Ee.banUnknownProperties(L,z);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=Ee.errors,he.missing=Ee.missing,he.valid=he.errors.length===0,he},addSchema:function(){return E.addSchema.apply(E,arguments)},getSchema:function(){return E.getSchema.apply(E,arguments)},getSchemaMap:function(){return E.getSchemaMap.apply(E,arguments)},getSchemaUris:function(){return E.getSchemaUris.apply(E,arguments)},getMissingUris:function(){return E.getMissingUris.apply(E,arguments)},dropSchemas:function(){E.dropSchemas.apply(E,arguments)},defineKeyword:function(){E.defineKeyword.apply(E,arguments)},defineError:function(L,z,Z){if(typeof L!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(L))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof z!="number"||z%1!==0||z<1e4)throw new Error("Code number must be an integer > 10000");if(typeof C[L]<"u")throw new Error("Error already defined: "+L+" as "+C[L]);if(typeof x[z]<"u")throw new Error("Error code already used: "+x[z]+" as "+z);C[L]=z,x[z]=L,T[L]=T[z]=Z;for(var ie in V){var fe=V[ie];fe[L]&&(fe[z]=fe[z]||fe[L])}},reset:function(){E.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:S,resolveUrl:g,getDocumentUri:m,errorCodes:C};return D.language(k||"en"),D}var ee=K();return ee.addLanguage("en-gb",T),ee.tv4=ee,ee})});var wc=F(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.regexpCode=Je.getEsmExportName=Je.getProperty=Je.safeStringify=Je.stringify=Je.strConcat=Je.addCodeArg=Je.str=Je._=Je.nil=Je._Code=Je.Name=Je.IDENTIFIER=Je._CodeOrName=void 0;var bc=class{};Je._CodeOrName=bc;Je.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ho=class extends bc{constructor(e){if(super(),!Je.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Je.Name=Ho;var hn=class extends bc{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Ho&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Je._Code=hn;Je.nil=new hn("");function mC(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Uv(r,e[n]),r.push(t[++n]);return new hn(r)}Je._=mC;var jv=new hn("+");function gC(t,...e){let r=[_c(t[0])],n=0;for(;n<e.length;)r.push(jv),Uv(r,e[n]),r.push(jv,_c(t[++n]));return dD(r),new hn(r)}Je.str=gC;function Uv(t,e){e instanceof hn?t.push(...e._items):e instanceof Ho?t.push(e):t.push(mD(e))}Je.addCodeArg=Uv;function dD(t){let e=1;for(;e<t.length-1;){if(t[e]===jv){let r=hD(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function hD(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ho||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ho))return`"${t}${e.slice(1)}`}function pD(t,e){return e.emptyStr()?t:t.emptyStr()?e:gC`${t}${e}`}Je.strConcat=pD;function mD(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:_c(Array.isArray(t)?t.join(","):t)}function gD(t){return new hn(_c(t))}Je.stringify=gD;function _c(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Je.safeStringify=_c;function yD(t){return typeof t=="string"&&Je.IDENTIFIER.test(t)?new hn(`.${t}`):mC`[${t}]`}Je.getProperty=yD;function vD(t){if(typeof t=="string"&&Je.IDENTIFIER.test(t))return new hn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Je.getEsmExportName=vD;function SD(t){return new hn(t.toString())}Je.regexpCode=SD});var Vv=F(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.ValueScope=kr.ValueScopeName=kr.Scope=kr.varKinds=kr.UsedValueState=void 0;var Pr=wc(),Bv=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Dh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Dh||(kr.UsedValueState=Dh={}));kr.varKinds={const:new Pr.Name("const"),let:new Pr.Name("let"),var:new Pr.Name("var")};var Fh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Pr.Name?e:this.name(e)}name(e){return new Pr.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};kr.Scope=Fh;var Lh=class extends Pr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Pr._)`.${new Pr.Name(r)}[${n}]`}};kr.ValueScopeName=Lh;var bD=(0,Pr._)`\n`,Hv=class extends Fh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?bD:Pr.nil}}get(){return this._scope}name(e){return new Lh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,a=(n=r.key)!==null&&n!==void 0?n:r.ref,u=this._values[s];if(u){let g=u.get(a);if(g)return g}else u=this._values[s]=new Map;u.set(a,i);let f=this._scope[s]||(this._scope[s]=[]),h=f.length;return f[h]=r.ref,i.setValue(r,{property:s,itemIndex:h}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Pr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=Pr.nil;for(let a in e){let u=e[a];if(!u)continue;let f=n[a]=n[a]||new Map;u.forEach(h=>{if(f.has(h))return;f.set(h,Dh.Started);let g=r(h);if(g){let m=this.opts.es5?kr.varKinds.var:kr.varKinds.const;s=(0,Pr._)`${s}${m} ${h} = ${g};${this.opts._n}`}else if(g=i?.(h))s=(0,Pr._)`${s}${g}${this.opts._n}`;else throw new Bv(h);f.set(h,Dh.Completed)})}return s}};kr.ValueScope=Hv});var Ne=F($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.or=$e.and=$e.not=$e.CodeGen=$e.operators=$e.varKinds=$e.ValueScopeName=$e.ValueScope=$e.Scope=$e.Name=$e.regexpCode=$e.stringify=$e.getProperty=$e.nil=$e.strConcat=$e.str=$e._=void 0;var Be=wc(),Ln=Vv(),Vs=wc();Object.defineProperty($e,"_",{enumerable:!0,get:function(){return Vs._}});Object.defineProperty($e,"str",{enumerable:!0,get:function(){return Vs.str}});Object.defineProperty($e,"strConcat",{enumerable:!0,get:function(){return Vs.strConcat}});Object.defineProperty($e,"nil",{enumerable:!0,get:function(){return Vs.nil}});Object.defineProperty($e,"getProperty",{enumerable:!0,get:function(){return Vs.getProperty}});Object.defineProperty($e,"stringify",{enumerable:!0,get:function(){return Vs.stringify}});Object.defineProperty($e,"regexpCode",{enumerable:!0,get:function(){return Vs.regexpCode}});Object.defineProperty($e,"Name",{enumerable:!0,get:function(){return Vs.Name}});var Hh=Vv();Object.defineProperty($e,"Scope",{enumerable:!0,get:function(){return Hh.Scope}});Object.defineProperty($e,"ValueScope",{enumerable:!0,get:function(){return Hh.ValueScope}});Object.defineProperty($e,"ValueScopeName",{enumerable:!0,get:function(){return Hh.ValueScopeName}});Object.defineProperty($e,"varKinds",{enumerable:!0,get:function(){return Hh.varKinds}});$e.operators={GT:new Be._Code(">"),GTE:new Be._Code(">="),LT:new Be._Code("<"),LTE:new Be._Code("<="),EQ:new Be._Code("==="),NEQ:new Be._Code("!=="),NOT:new Be._Code("!"),OR:new Be._Code("||"),AND:new Be._Code("&&"),ADD:new Be._Code("+")};var Gi=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Wv=class extends Gi{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Ln.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=El(this.rhs,e,r)),this}get names(){return this.rhs instanceof Be._CodeOrName?this.rhs.names:{}}},jh=class extends Gi{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Be.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=El(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Be.Name?{}:{...this.lhs.names};return Bh(e,this.rhs)}},Yv=class extends jh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Jv=class extends Gi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},zv=class extends Gi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Kv=class extends Gi{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Gv=class extends Gi{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=El(this.code,e,r),this}get names(){return this.code instanceof Be._CodeOrName?this.code.names:{}}},Ec=class extends Gi{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(_D(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Yo(e,r.names),{})}},Qi=class extends Ec{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Qv=class extends Ec{},wl=class extends Qi{};wl.kind="else";var Vo=class t extends Qi{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new wl(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(yC(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=El(this.condition,e,r),this}get names(){let e=super.names;return Bh(e,this.condition),this.else&&Yo(e,this.else.names),e}};Vo.kind="if";var Wo=class extends Qi{};Wo.kind="for";var Zv=class extends Wo{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=El(this.iteration,e,r),this}get names(){return Yo(super.names,this.iteration.names)}},Xv=class extends Wo{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Ln.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Bh(super.names,this.from);return Bh(e,this.to)}},Uh=class extends Wo{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=El(this.iterable,e,r),this}get names(){return Yo(super.names,this.iterable.names)}},Cc=class extends Qi{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Cc.kind="func";var xc=class extends Ec{render(e){return"return "+super.render(e)}};xc.kind="return";var eS=class extends Qi{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Yo(e,this.catch.names),this.finally&&Yo(e,this.finally.names),e}},Rc=class extends Qi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Rc.kind="catch";var Ic=class extends Qi{render(e){return"finally"+super.render(e)}};Ic.kind="finally";var tS=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
|
-
`:""},this._extScope=e,this._scope=new Ln.Scope({parent:e}),this._nodes=[new Qv]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new Wv(e,s,n)),s}const(e,r,n){return this._def(Ln.varKinds.const,e,r,n)}let(e,r,n){return this._def(Ln.varKinds.let,e,r,n)}var(e,r,n){return this._def(Ln.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new jh(e,r,n))}add(e,r){return this._leafNode(new Yv(e,$e.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Be.nil&&this._leafNode(new Gv(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Be.addCodeArg)(r,i));return r.push("}"),new Be._Code(r)}if(e,r,n){if(this._blockNode(new Vo(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Vo(e))}else(){return this._elseNode(new wl)}endIf(){return this._endBlockNode(Vo,wl)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Zv(e),r)}forRange(e,r,n,i,s=this.opts.es5?Ln.varKinds.var:Ln.varKinds.let){let a=this._scope.toName(e);return this._for(new Xv(s,a,r,n),()=>i(a))}forOf(e,r,n,i=Ln.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=r instanceof Be.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Be._)`${a}.length`,u=>{this.var(s,(0,Be._)`${a}[${u}]`),n(s)})}return this._for(new Uh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Ln.varKinds.var:Ln.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Be._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Uh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Wo)}label(e){return this._leafNode(new Jv(e))}break(e){return this._leafNode(new zv(e))}return(e){let r=new xc;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(xc)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new eS;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Rc(s),r(s)}return n&&(this._currNode=i.finally=new Ic,this.code(n)),this._endBlockNode(Rc,Ic)}throw(e){return this._leafNode(new Kv(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Be.nil,n,i){return this._blockNode(new Cc(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Cc)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Vo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};$e.CodeGen=tS;function Yo(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Bh(t,e){return e instanceof Be._CodeOrName?Yo(t,e.names):t}function El(t,e,r){if(t instanceof Be.Name)return n(t);if(!i(t))return t;return new Be._Code(t._items.reduce((s,a)=>(a instanceof Be.Name&&(a=n(a)),a instanceof Be._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||e[s.str]!==1?s:(delete e[s.str],a)}function i(s){return s instanceof Be._Code&&s._items.some(a=>a instanceof Be.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function _D(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function yC(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Be._)`!${rS(t)}`}$e.not=yC;var wD=vC($e.operators.AND);function ED(...t){return t.reduce(wD)}$e.and=ED;var CD=vC($e.operators.OR);function xD(...t){return t.reduce(CD)}$e.or=xD;function vC(t){return(e,r)=>e===Be.nil?r:r===Be.nil?e:(0,Be._)`${rS(e)} ${t} ${rS(r)}`}function rS(t){return t instanceof Be.Name?t:(0,Be._)`(${t})`}});var ze=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.checkStrictMode=De.getErrorPath=De.Type=De.useFunc=De.setEvaluated=De.evaluatedPropsToName=De.mergeEvaluated=De.eachItem=De.unescapeJsonPointer=De.escapeJsonPointer=De.escapeFragment=De.unescapeFragment=De.schemaRefOrVal=De.schemaHasRulesButRef=De.schemaHasRules=De.checkUnknownRules=De.alwaysValidSchema=De.toHash=void 0;var ct=Ne(),RD=wc();function ID(t){let e={};for(let r of t)e[r]=!0;return e}De.toHash=ID;function OD(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(_C(t,e),!wC(e,t.self.RULES.all))}De.alwaysValidSchema=OD;function _C(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||xC(t,`unknown keyword: "${s}"`)}De.checkUnknownRules=_C;function wC(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}De.schemaHasRules=wC;function PD(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}De.schemaHasRulesButRef=PD;function kD({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ct._)`${r}`}return(0,ct._)`${t}${e}${(0,ct.getProperty)(n)}`}De.schemaRefOrVal=kD;function AD(t){return EC(decodeURIComponent(t))}De.unescapeFragment=AD;function TD(t){return encodeURIComponent(iS(t))}De.escapeFragment=TD;function iS(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=iS;function EC(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=EC;function qD(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}De.eachItem=qD;function SC({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,a,u)=>{let f=a===void 0?s:a instanceof ct.Name?(s instanceof ct.Name?t(i,s,a):e(i,s,a),a):s instanceof ct.Name?(e(i,a,s),s):r(s,a);return u===ct.Name&&!(f instanceof ct.Name)?n(i,f):f}}De.mergeEvaluated={props:SC({mergeNames:(t,e,r)=>t.if((0,ct._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ct._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ct._)`${r} || {}`).code((0,ct._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ct._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ct._)`${r} || {}`),sS(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:CC}),items:SC({mergeNames:(t,e,r)=>t.if((0,ct._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ct._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ct._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ct._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function CC(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ct._)`{}`);return e!==void 0&&sS(t,r,e),r}De.evaluatedPropsToName=CC;function sS(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ct._)`${e}${(0,ct.getProperty)(n)}`,!0))}De.setEvaluated=sS;var bC={};function $D(t,e){return t.scopeValue("func",{ref:e,code:bC[e.code]||(bC[e.code]=new RD._Code(e.code))})}De.useFunc=$D;var nS;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(nS||(De.Type=nS={}));function MD(t,e,r){if(t instanceof ct.Name){let n=e===nS.Num;return r?n?(0,ct._)`"[" + ${t} + "]"`:(0,ct._)`"['" + ${t} + "']"`:n?(0,ct._)`"/" + ${t}`:(0,ct._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ct.getProperty)(t).toString():"/"+iS(t)}De.getErrorPath=MD;function xC(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}De.checkStrictMode=xC});var Zi=F(oS=>{"use strict";Object.defineProperty(oS,"__esModule",{value:!0});var or=Ne(),ND={data:new or.Name("data"),valCxt:new or.Name("valCxt"),instancePath:new or.Name("instancePath"),parentData:new or.Name("parentData"),parentDataProperty:new or.Name("parentDataProperty"),rootData:new or.Name("rootData"),dynamicAnchors:new or.Name("dynamicAnchors"),vErrors:new or.Name("vErrors"),errors:new or.Name("errors"),this:new or.Name("this"),self:new or.Name("self"),scope:new or.Name("scope"),json:new or.Name("json"),jsonPos:new or.Name("jsonPos"),jsonLen:new or.Name("jsonLen"),jsonPart:new or.Name("jsonPart")};oS.default=ND});var Oc=F(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.extendErrors=ar.resetErrorsCount=ar.reportExtraError=ar.reportError=ar.keyword$DataError=ar.keywordError=void 0;var Ve=Ne(),Vh=ze(),vr=Zi();ar.keywordError={message:({keyword:t})=>(0,Ve.str)`must pass "${t}" keyword validation`};ar.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Ve.str)`"${t}" keyword must be ${e} ($data)`:(0,Ve.str)`"${t}" keyword is invalid ($data)`};function DD(t,e=ar.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:a,allErrors:u}=i,f=OC(t,e,r);n??(a||u)?RC(s,f):IC(i,(0,Ve._)`[${f}]`)}ar.reportError=DD;function FD(t,e=ar.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,u=OC(t,e,r);RC(i,u),s||a||IC(n,vr.default.vErrors)}ar.reportExtraError=FD;function LD(t,e){t.assign(vr.default.errors,e),t.if((0,Ve._)`${vr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Ve._)`${vr.default.vErrors}.length`,e),()=>t.assign(vr.default.vErrors,null)))}ar.resetErrorsCount=LD;function jD({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",i,vr.default.errors,u=>{t.const(a,(0,Ve._)`${vr.default.vErrors}[${u}]`),t.if((0,Ve._)`${a}.instancePath === undefined`,()=>t.assign((0,Ve._)`${a}.instancePath`,(0,Ve.strConcat)(vr.default.instancePath,s.errorPath))),t.assign((0,Ve._)`${a}.schemaPath`,(0,Ve.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Ve._)`${a}.schema`,r),t.assign((0,Ve._)`${a}.data`,n))})}ar.extendErrors=jD;function RC(t,e){let r=t.const("err",e);t.if((0,Ve._)`${vr.default.vErrors} === null`,()=>t.assign(vr.default.vErrors,(0,Ve._)`[${r}]`),(0,Ve._)`${vr.default.vErrors}.push(${r})`),t.code((0,Ve._)`${vr.default.errors}++`)}function IC(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,Ve._)`new ${t.ValidationError}(${e})`):(r.assign((0,Ve._)`${n}.errors`,e),r.return(!1))}var Jo={keyword:new Ve.Name("keyword"),schemaPath:new Ve.Name("schemaPath"),params:new Ve.Name("params"),propertyName:new Ve.Name("propertyName"),message:new Ve.Name("message"),schema:new Ve.Name("schema"),parentSchema:new Ve.Name("parentSchema")};function OC(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Ve._)`{}`:UD(t,e,r)}function UD(t,e,r={}){let{gen:n,it:i}=t,s=[BD(i,r),HD(t,r)];return VD(t,e,s),n.object(...s)}function BD({errorPath:t},{instancePath:e}){let r=e?(0,Ve.str)`${t}${(0,Vh.getErrorPath)(e,Vh.Type.Str)}`:t;return[vr.default.instancePath,(0,Ve.strConcat)(vr.default.instancePath,r)]}function HD({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Ve.str)`${e}/${t}`;return r&&(i=(0,Ve.str)`${i}${(0,Vh.getErrorPath)(r,Vh.Type.Str)}`),[Jo.schemaPath,i]}function VD(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:a,it:u}=t,{opts:f,propertyName:h,topSchemaRef:g,schemaPath:m}=u;n.push([Jo.keyword,i],[Jo.params,typeof e=="function"?e(t):e||(0,Ve._)`{}`]),f.messages&&n.push([Jo.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([Jo.schema,a],[Jo.parentSchema,(0,Ve._)`${g}${m}`],[vr.default.data,s]),h&&n.push([Jo.propertyName,h])}});var kC=F(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.boolOrEmptySchema=Cl.topBoolOrEmptySchema=void 0;var WD=Oc(),YD=Ne(),JD=Zi(),zD={message:"boolean schema is false"};function KD(t){let{gen:e,schema:r,validateName:n}=t;r===!1?PC(t,!1):typeof r=="object"&&r.$async===!0?e.return(JD.default.data):(e.assign((0,YD._)`${n}.errors`,null),e.return(!0))}Cl.topBoolOrEmptySchema=KD;function GD(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),PC(t)):r.var(e,!0)}Cl.boolOrEmptySchema=GD;function PC(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,WD.reportError)(i,zD,void 0,e)}});var aS=F(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.getRules=xl.isJSONType=void 0;var QD=["string","number","integer","boolean","null","object","array"],ZD=new Set(QD);function XD(t){return typeof t=="string"&&ZD.has(t)}xl.isJSONType=XD;function eF(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}xl.getRules=eF});var lS=F(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.shouldUseRule=Ws.shouldUseGroup=Ws.schemaHasRulesForType=void 0;function tF({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&AC(t,n)}Ws.schemaHasRulesForType=tF;function AC(t,e){return e.rules.some(r=>TC(t,r))}Ws.shouldUseGroup=AC;function TC(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Ws.shouldUseRule=TC});var Pc=F(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.reportTypeError=lr.checkDataTypes=lr.checkDataType=lr.coerceAndCheckDataType=lr.getJSONTypes=lr.getSchemaTypes=lr.DataType=void 0;var rF=aS(),nF=lS(),iF=Oc(),Ie=Ne(),qC=ze(),Rl;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Rl||(lr.DataType=Rl={}));function sF(t){let e=$C(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}lr.getSchemaTypes=sF;function $C(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(rF.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}lr.getJSONTypes=$C;function oF(t,e){let{gen:r,data:n,opts:i}=t,s=aF(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,nF.schemaHasRulesForType)(t,e[0]));if(a){let u=cS(e,n,i.strictNumbers,Rl.Wrong);r.if(u,()=>{s.length?lF(t,e,s):fS(t)})}return a}lr.coerceAndCheckDataType=oF;var MC=new Set(["string","number","integer","boolean","null"]);function aF(t,e){return e?t.filter(r=>MC.has(r)||e==="array"&&r==="array"):[]}function lF(t,e,r){let{gen:n,data:i,opts:s}=t,a=n.let("dataType",(0,Ie._)`typeof ${i}`),u=n.let("coerced",(0,Ie._)`undefined`);s.coerceTypes==="array"&&n.if((0,Ie._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Ie._)`${i}[0]`).assign(a,(0,Ie._)`typeof ${i}`).if(cS(e,i,s.strictNumbers),()=>n.assign(u,i))),n.if((0,Ie._)`${u} !== undefined`);for(let h of r)(MC.has(h)||h==="array"&&s.coerceTypes==="array")&&f(h);n.else(),fS(t),n.endIf(),n.if((0,Ie._)`${u} !== undefined`,()=>{n.assign(i,u),uF(t,u)});function f(h){switch(h){case"string":n.elseIf((0,Ie._)`${a} == "number" || ${a} == "boolean"`).assign(u,(0,Ie._)`"" + ${i}`).elseIf((0,Ie._)`${i} === null`).assign(u,(0,Ie._)`""`);return;case"number":n.elseIf((0,Ie._)`${a} == "boolean" || ${i} === null
|
|
25
|
-
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(u,(0,
|
|
26
|
-
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(u,(0,
|
|
27
|
-
|| ${a} === "boolean" || ${i} === null`).assign(u,(0,Ie._)`[${i}]`)}}}function uF({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Ie._)`${e} !== undefined`,()=>t.assign((0,Ie._)`${e}[${r}]`,n))}function uS(t,e,r,n=Rl.Correct){let i=n===Rl.Correct?Ie.operators.EQ:Ie.operators.NEQ,s;switch(t){case"null":return(0,Ie._)`${e} ${i} null`;case"array":s=(0,Ie._)`Array.isArray(${e})`;break;case"object":s=(0,Ie._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Ie._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Ie._)`typeof ${e} ${i} ${t}`}return n===Rl.Correct?s:(0,Ie.not)(s);function a(u=Ie.nil){return(0,Ie.and)((0,Ie._)`typeof ${e} == "number"`,u,r?(0,Ie._)`isFinite(${e})`:Ie.nil)}}lr.checkDataType=uS;function cS(t,e,r,n){if(t.length===1)return uS(t[0],e,r,n);let i,s=(0,qC.toHash)(t);if(s.array&&s.object){let a=(0,Ie._)`typeof ${e} != "object"`;i=s.null?a:(0,Ie._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Ie.nil;s.number&&delete s.integer;for(let a in s)i=(0,Ie.and)(i,uS(a,e,r,n));return i}lr.checkDataTypes=cS;var cF={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ie._)`{type: ${t}}`:(0,Ie._)`{type: ${e}}`};function fS(t){let e=fF(t);(0,iF.reportError)(e,cF)}lr.reportTypeError=fS;function fF(t){let{gen:e,data:r,schema:n}=t,i=(0,qC.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var DC=F(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});Wh.assignDefaults=void 0;var Il=Ne(),dF=ze();function hF(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)NC(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>NC(t,s,i.default))}Wh.assignDefaults=hF;function NC(t,e,r){let{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;let u=(0,Il._)`${s}${(0,Il.getProperty)(e)}`;if(i){(0,dF.checkStrictMode)(t,`default is ignored for: ${u}`);return}let f=(0,Il._)`${u} === undefined`;a.useDefaults==="empty"&&(f=(0,Il._)`${f} || ${u} === null || ${u} === ""`),n.if(f,(0,Il._)`${u} = ${(0,Il.stringify)(r)}`)}});var pn=F(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.validateUnion=at.validateArray=at.usePattern=at.callValidateCode=at.schemaProperties=at.allSchemaProperties=at.noPropertyInData=at.propertyInData=at.isOwnProperty=at.hasPropFunc=at.reportMissingProp=at.checkMissingProp=at.checkReportMissingProp=void 0;var ht=Ne(),dS=ze(),Ys=Zi(),pF=ze();function mF(t,e){let{gen:r,data:n,it:i}=t;r.if(pS(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ht._)`${e}`},!0),t.error()})}at.checkReportMissingProp=mF;function gF({gen:t,data:e,it:{opts:r}},n,i){return(0,ht.or)(...n.map(s=>(0,ht.and)(pS(t,e,s,r.ownProperties),(0,ht._)`${i} = ${s}`)))}at.checkMissingProp=gF;function yF(t,e){t.setParams({missingProperty:e},!0),t.error()}at.reportMissingProp=yF;function FC(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ht._)`Object.prototype.hasOwnProperty`})}at.hasPropFunc=FC;function hS(t,e,r){return(0,ht._)`${FC(t)}.call(${e}, ${r})`}at.isOwnProperty=hS;function vF(t,e,r,n){let i=(0,ht._)`${e}${(0,ht.getProperty)(r)} !== undefined`;return n?(0,ht._)`${i} && ${hS(t,e,r)}`:i}at.propertyInData=vF;function pS(t,e,r,n){let i=(0,ht._)`${e}${(0,ht.getProperty)(r)} === undefined`;return n?(0,ht.or)(i,(0,ht.not)(hS(t,e,r))):i}at.noPropertyInData=pS;function LC(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}at.allSchemaProperties=LC;function SF(t,e){return LC(e).filter(r=>!(0,dS.alwaysValidSchema)(t,e[r]))}at.schemaProperties=SF;function bF({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},u,f,h){let g=h?(0,ht._)`${t}, ${e}, ${n}${i}`:e,m=[[Ys.default.instancePath,(0,ht.strConcat)(Ys.default.instancePath,s)],[Ys.default.parentData,a.parentData],[Ys.default.parentDataProperty,a.parentDataProperty],[Ys.default.rootData,Ys.default.rootData]];a.opts.dynamicRef&&m.push([Ys.default.dynamicAnchors,Ys.default.dynamicAnchors]);let S=(0,ht._)`${g}, ${r.object(...m)}`;return f!==ht.nil?(0,ht._)`${u}.call(${f}, ${S})`:(0,ht._)`${u}(${S})`}at.callValidateCode=bF;var _F=(0,ht._)`new RegExp`;function wF({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,ht._)`${i.code==="new RegExp"?_F:(0,pF.useFunc)(t,i)}(${r}, ${n})`})}at.usePattern=wF;function EF(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let u=e.let("valid",!0);return a(()=>e.assign(u,!1)),u}return e.var(s,!0),a(()=>e.break()),s;function a(u){let f=e.const("len",(0,ht._)`${r}.length`);e.forRange("i",0,f,h=>{t.subschema({keyword:n,dataProp:h,dataPropType:dS.Type.Num},s),e.if((0,ht.not)(s),u)})}}at.validateArray=EF;function CF(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,dS.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let a=e.let("valid",!1),u=e.name("_valid");e.block(()=>r.forEach((f,h)=>{let g=t.subschema({keyword:n,schemaProp:h,compositeRule:!0},u);e.assign(a,(0,ht._)`${a} || ${u}`),t.mergeValidEvaluated(g,u)||e.if((0,ht.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}at.validateUnion=CF});var BC=F(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.validateKeywordUsage=_i.validSchemaType=_i.funcKeywordCode=_i.macroKeywordCode=void 0;var Sr=Ne(),zo=Zi(),xF=pn(),RF=Oc();function IF(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,u=e.macro.call(a.self,i,s,a),f=UC(r,n,u);a.opts.validateSchema!==!1&&a.self.validateSchema(u,!0);let h=r.name("valid");t.subschema({schema:u,schemaPath:Sr.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},h),t.pass(h,()=>t.error(!0))}_i.macroKeywordCode=IF;function OF(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:u,it:f}=t;kF(f,e);let h=!u&&e.compile?e.compile.call(f.self,s,a,f):e.validate,g=UC(n,i,h),m=n.let("valid");t.block$data(m,S),t.ok((r=e.valid)!==null&&r!==void 0?r:m);function S(){if(e.errors===!1)x(),e.modifying&&jC(t),A(()=>t.error());else{let T=e.async?_():C();e.modifying&&jC(t),A(()=>PF(t,T))}}function _(){let T=n.let("ruleErrs",null);return n.try(()=>x((0,Sr._)`await `),j=>n.assign(m,!1).if((0,Sr._)`${j} instanceof ${f.ValidationError}`,()=>n.assign(T,(0,Sr._)`${j}.errors`),()=>n.throw(j))),T}function C(){let T=(0,Sr._)`${g}.errors`;return n.assign(T,null),x(Sr.nil),T}function x(T=e.async?(0,Sr._)`await `:Sr.nil){let j=f.opts.passContext?zo.default.this:zo.default.self,Y=!("compile"in e&&!u||e.schema===!1);n.assign(m,(0,Sr._)`${T}${(0,xF.callValidateCode)(t,g,j,Y)}`,e.modifying)}function A(T){var j;n.if((0,Sr.not)((j=e.valid)!==null&&j!==void 0?j:m),T)}}_i.funcKeywordCode=OF;function jC(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Sr._)`${n.parentData}[${n.parentDataProperty}]`))}function PF(t,e){let{gen:r}=t;r.if((0,Sr._)`Array.isArray(${e})`,()=>{r.assign(zo.default.vErrors,(0,Sr._)`${zo.default.vErrors} === null ? ${e} : ${zo.default.vErrors}.concat(${e})`).assign(zo.default.errors,(0,Sr._)`${zo.default.vErrors}.length`),(0,RF.extendErrors)(t)},()=>t.error())}function kF({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function UC(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Sr.stringify)(r)})}function AF(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}_i.validSchemaType=AF;function TF({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a?.some(u=>!Object.prototype.hasOwnProperty.call(t,u)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}_i.validateKeywordUsage=TF});var VC=F(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.extendSubschemaMode=Js.extendSubschemaData=Js.getSubschema=void 0;var wi=Ne(),HC=ze();function qF(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let u=t.schema[e];return r===void 0?{schema:u,schemaPath:(0,wi._)`${t.schemaPath}${(0,wi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:u[r],schemaPath:(0,wi._)`${t.schemaPath}${(0,wi.getProperty)(e)}${(0,wi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,HC.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Js.getSubschema=qF;function $F(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=e;if(r!==void 0){let{errorPath:h,dataPathArr:g,opts:m}=e,S=u.let("data",(0,wi._)`${e.data}${(0,wi.getProperty)(r)}`,!0);f(S),t.errorPath=(0,wi.str)`${h}${(0,HC.getErrorPath)(r,n,m.jsPropertySyntax)}`,t.parentDataProperty=(0,wi._)`${r}`,t.dataPathArr=[...g,t.parentDataProperty]}if(i!==void 0){let h=i instanceof wi.Name?i:u.let("data",i,!0);f(h),a!==void 0&&(t.propertyName=a)}s&&(t.dataTypes=s);function f(h){t.data=h,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,h]}}Js.extendSubschemaData=$F;function MF(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}Js.extendSubschemaMode=MF});var mS=F((H3,WC)=>{"use strict";WC.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var JC=F((V3,YC)=>{"use strict";var zs=YC.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Yh(e,n,i,t,"",t)};zs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};zs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};zs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};zs.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 Yh(t,e,r,n,i,s,a,u,f,h){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,a,u,f,h);for(var g in n){var m=n[g];if(Array.isArray(m)){if(g in zs.arrayKeywords)for(var S=0;S<m.length;S++)Yh(t,e,r,m[S],i+"/"+g+"/"+S,s,i,g,n,S)}else if(g in zs.propsKeywords){if(m&&typeof m=="object")for(var _ in m)Yh(t,e,r,m[_],i+"/"+g+"/"+NF(_),s,i,g,n,_)}else(g in zs.keywords||t.allKeys&&!(g in zs.skipKeywords))&&Yh(t,e,r,m,i+"/"+g,s,i,g,n)}r(n,i,s,a,u,f,h)}}function NF(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var kc=F(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.getSchemaRefs=Ar.resolveUrl=Ar.normalizeId=Ar._getFullPath=Ar.getFullPath=Ar.inlineRef=void 0;var DF=ze(),FF=mS(),LF=JC(),jF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function UF(t,e=!0){return typeof t=="boolean"?!0:e===!0?!gS(t):e?zC(t)<=e:!1}Ar.inlineRef=UF;var BF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function gS(t){for(let e in t){if(BF.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(gS)||typeof r=="object"&&gS(r))return!0}return!1}function zC(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!jF.has(r)&&(typeof t[r]=="object"&&(0,DF.eachItem)(t[r],n=>e+=zC(n)),e===1/0))return 1/0}return e}function KC(t,e="",r){r!==!1&&(e=Ol(e));let n=t.parse(e);return GC(t,n)}Ar.getFullPath=KC;function GC(t,e){return t.serialize(e).split("#")[0]+"#"}Ar._getFullPath=GC;var HF=/#\/?$/;function Ol(t){return t?t.replace(HF,""):""}Ar.normalizeId=Ol;function VF(t,e,r){return r=Ol(r),t.resolve(e,r)}Ar.resolveUrl=VF;var WF=/^[a-z_][-a-z0-9._]*$/i;function YF(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Ol(t[r]||e),s={"":i},a=KC(n,i,!1),u={},f=new Set;return LF(t,{allKeys:!0},(m,S,_,C)=>{if(C===void 0)return;let x=a+S,A=s[C];typeof m[r]=="string"&&(A=T.call(this,m[r])),j.call(this,m.$anchor),j.call(this,m.$dynamicAnchor),s[S]=A;function T(Y){let V=this.opts.uriResolver.resolve;if(Y=Ol(A?V(A,Y):Y),f.has(Y))throw g(Y);f.add(Y);let K=this.refs[Y];return typeof K=="string"&&(K=this.refs[K]),typeof K=="object"?h(m,K.schema,Y):Y!==Ol(x)&&(Y[0]==="#"?(h(m,u[Y],Y),u[Y]=m):this.refs[Y]=x),Y}function j(Y){if(typeof Y=="string"){if(!WF.test(Y))throw new Error(`invalid anchor "${Y}"`);T.call(this,`#${Y}`)}}}),u;function h(m,S,_){if(S!==void 0&&!FF(m,S))throw g(_)}function g(m){return new Error(`reference "${m}" resolves to more than one schema`)}}Ar.getSchemaRefs=YF});var qc=F(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.getData=Ks.KeywordCxt=Ks.validateFunctionCode=void 0;var tx=kC(),QC=Pc(),vS=lS(),Jh=Pc(),JF=DC(),Tc=BC(),yS=VC(),ce=Ne(),_e=Zi(),zF=kc(),Xi=ze(),Ac=Oc();function KF(t){if(ix(t)&&(sx(t),nx(t))){ZF(t);return}rx(t,()=>(0,tx.topBoolOrEmptySchema)(t))}Ks.validateFunctionCode=KF;function rx({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,ce._)`${_e.default.data}, ${_e.default.valCxt}`,n.$async,()=>{t.code((0,ce._)`"use strict"; ${ZC(r,i)}`),QF(t,i),t.code(s)}):t.func(e,(0,ce._)`${_e.default.data}, ${GF(i)}`,n.$async,()=>t.code(ZC(r,i)).code(s))}function GF(t){return(0,ce._)`{${_e.default.instancePath}="", ${_e.default.parentData}, ${_e.default.parentDataProperty}, ${_e.default.rootData}=${_e.default.data}${t.dynamicRef?(0,ce._)`, ${_e.default.dynamicAnchors}={}`:ce.nil}}={}`}function QF(t,e){t.if(_e.default.valCxt,()=>{t.var(_e.default.instancePath,(0,ce._)`${_e.default.valCxt}.${_e.default.instancePath}`),t.var(_e.default.parentData,(0,ce._)`${_e.default.valCxt}.${_e.default.parentData}`),t.var(_e.default.parentDataProperty,(0,ce._)`${_e.default.valCxt}.${_e.default.parentDataProperty}`),t.var(_e.default.rootData,(0,ce._)`${_e.default.valCxt}.${_e.default.rootData}`),e.dynamicRef&&t.var(_e.default.dynamicAnchors,(0,ce._)`${_e.default.valCxt}.${_e.default.dynamicAnchors}`)},()=>{t.var(_e.default.instancePath,(0,ce._)`""`),t.var(_e.default.parentData,(0,ce._)`undefined`),t.var(_e.default.parentDataProperty,(0,ce._)`undefined`),t.var(_e.default.rootData,_e.default.data),e.dynamicRef&&t.var(_e.default.dynamicAnchors,(0,ce._)`{}`)})}function ZF(t){let{schema:e,opts:r,gen:n}=t;rx(t,()=>{r.$comment&&e.$comment&&ax(t),nL(t),n.let(_e.default.vErrors,null),n.let(_e.default.errors,0),r.unevaluated&&XF(t),ox(t),oL(t)})}function XF(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ce._)`${r}.evaluated`),e.if((0,ce._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ce._)`${t.evaluated}.props`,(0,ce._)`undefined`)),e.if((0,ce._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ce._)`${t.evaluated}.items`,(0,ce._)`undefined`))}function ZC(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ce._)`/*# sourceURL=${r} */`:ce.nil}function eL(t,e){if(ix(t)&&(sx(t),nx(t))){tL(t,e);return}(0,tx.boolOrEmptySchema)(t,e)}function nx({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function ix(t){return typeof t.schema!="boolean"}function tL(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&ax(t),iL(t),sL(t);let s=n.const("_errs",_e.default.errors);ox(t,s),n.var(e,(0,ce._)`${s} === ${_e.default.errors}`)}function sx(t){(0,Xi.checkUnknownRules)(t),rL(t)}function ox(t,e){if(t.opts.jtd)return XC(t,[],!1,e);let r=(0,QC.getSchemaTypes)(t.schema),n=(0,QC.coerceAndCheckDataType)(t,r);XC(t,r,!n,e)}function rL(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Xi.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function nL(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Xi.checkStrictMode)(t,"default is ignored in the schema root")}function iL(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,zF.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function sL(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function ax({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,ce._)`${_e.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,ce.str)`${n}/$comment`,u=t.scopeValue("root",{ref:e.root});t.code((0,ce._)`${_e.default.self}.opts.$comment(${s}, ${a}, ${u}.schema)`)}}function oL(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,ce._)`${_e.default.errors} === 0`,()=>e.return(_e.default.data),()=>e.throw((0,ce._)`new ${i}(${_e.default.vErrors})`)):(e.assign((0,ce._)`${n}.errors`,_e.default.vErrors),s.unevaluated&&aL(t),e.return((0,ce._)`${_e.default.errors} === 0`))}function aL({gen:t,evaluated:e,props:r,items:n}){r instanceof ce.Name&&t.assign((0,ce._)`${e}.props`,r),n instanceof ce.Name&&t.assign((0,ce._)`${e}.items`,n)}function XC(t,e,r,n){let{gen:i,schema:s,data:a,allErrors:u,opts:f,self:h}=t,{RULES:g}=h;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,Xi.schemaHasRulesButRef)(s,g))){i.block(()=>ux(t,"$ref",g.all.$ref.definition));return}f.jtd||lL(t,e),i.block(()=>{for(let S of g.rules)m(S);m(g.post)});function m(S){(0,vS.shouldUseGroup)(s,S)&&(S.type?(i.if((0,Jh.checkDataType)(S.type,a,f.strictNumbers)),ex(t,S),e.length===1&&e[0]===S.type&&r&&(i.else(),(0,Jh.reportTypeError)(t)),i.endIf()):ex(t,S),u||i.if((0,ce._)`${_e.default.errors} === ${n||0}`))}}function ex(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,JF.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,vS.shouldUseRule)(n,s)&&ux(t,s.keyword,s.definition,e.type)})}function lL(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(uL(t,e),t.opts.allowUnionTypes||cL(t,e),fL(t,t.dataTypes))}function uL(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{lx(t.dataTypes,r)||SS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),hL(t,e)}}function cL(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&SS(t,"use allowUnionTypes to allow union type keyword")}function fL(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,vS.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>dL(e,a))&&SS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function dL(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function lx(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function hL(t,e){let r=[];for(let n of t.dataTypes)lx(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function SS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Xi.checkStrictMode)(t,e,t.opts.strictTypes)}var zh=class{constructor(e,r,n){if((0,Tc.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Xi.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",cx(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Tc.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",_e.default.errors))}result(e,r,n){this.failResult((0,ce.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,ce.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,ce._)`${r} !== undefined && (${(0,ce.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Ac.reportExtraError:Ac.reportError)(this,this.def.error,r)}$dataError(){(0,Ac.reportError)(this,this.def.$dataError||Ac.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ac.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=ce.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ce.nil,r=ce.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,ce.or)((0,ce._)`${i} === undefined`,r)),e!==ce.nil&&n.assign(e,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ce.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,ce.or)(a(),u());function a(){if(n.length){if(!(r instanceof ce.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,ce._)`${(0,Jh.checkDataTypes)(f,r,s.opts.strictNumbers,Jh.DataType.Wrong)}`}return ce.nil}function u(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,ce._)`!${f}(${r})`}return ce.nil}}subschema(e,r){let n=(0,yS.getSubschema)(this.it,e);(0,yS.extendSubschemaData)(n,this.it,e),(0,yS.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return eL(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Xi.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Xi.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,ce.Name)),!0}};Ks.KeywordCxt=zh;function ux(t,e,r,n){let i=new zh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Tc.funcKeywordCode)(i,r):"macro"in r?(0,Tc.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Tc.funcKeywordCode)(i,r)}var pL=/^\/(?:[^~]|~0|~1)*$/,mL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function cx(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return _e.default.rootData;if(t[0]==="/"){if(!pL.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=_e.default.rootData}else{let h=mL.exec(t);if(!h)throw new Error(`Invalid JSON-pointer: ${t}`);let g=+h[1];if(i=h[2],i==="#"){if(g>=e)throw new Error(f("property/index",g));return n[e-g]}if(g>e)throw new Error(f("data",g));if(s=r[e-g],!i)return s}let a=s,u=i.split("/");for(let h of u)h&&(s=(0,ce._)`${s}${(0,ce.getProperty)((0,Xi.unescapeJsonPointer)(h))}`,a=(0,ce._)`${a} && ${s}`);return a;function f(h,g){return`Cannot access ${h} ${g} levels up, current level is ${e}`}}Ks.getData=cx});var Kh=F(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0});var bS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};_S.default=bS});var $c=F(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});var wS=kc(),ES=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,wS.resolveUrl)(e,r,n),this.missingSchema=(0,wS.normalizeId)((0,wS.getFullPath)(e,this.missingRef))}};CS.default=ES});var Qh=F(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.resolveSchema=mn.getCompilingSchema=mn.resolveRef=mn.compileSchema=mn.SchemaEnv=void 0;var jn=Ne(),gL=Kh(),Ko=Zi(),Un=kc(),fx=ze(),yL=qc(),Pl=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Un.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};mn.SchemaEnv=Pl;function RS(t){let e=dx.call(this,t);if(e)return e;let r=(0,Un.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new jn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),u;t.$async&&(u=a.scopeValue("Error",{ref:gL.default,code:(0,jn._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");t.validateName=f;let h={gen:a,allErrors:this.opts.allErrors,data:Ko.default.data,parentData:Ko.default.parentData,parentDataProperty:Ko.default.parentDataProperty,dataNames:[Ko.default.data],dataPathArr:[jn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,jn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:u,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:jn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,jn._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(t),(0,yL.validateFunctionCode)(h),a.optimize(this.opts.code.optimize);let m=a.toString();g=`${a.scopeRefs(Ko.default.scope)}return ${m}`,this.opts.code.process&&(g=this.opts.code.process(g,t));let _=new Function(`${Ko.default.self}`,`${Ko.default.scope}`,g)(this,this.scope.get());if(this.scope.value(f,{ref:_}),_.errors=null,_.schema=t.schema,_.schemaEnv=t,t.$async&&(_.$async=!0),this.opts.code.source===!0&&(_.source={validateName:f,validateCode:m,scopeValues:a._values}),this.opts.unevaluated){let{props:C,items:x}=h;_.evaluated={props:C instanceof jn.Name?void 0:C,items:x instanceof jn.Name?void 0:x,dynamicProps:C instanceof jn.Name,dynamicItems:x instanceof jn.Name},_.source&&(_.source.evaluated=(0,jn.stringify)(_.evaluated))}return t.validate=_,t}catch(m){throw delete t.validate,delete t.validateName,g&&this.logger.error("Error compiling schema, function code:",g),m}finally{this._compilations.delete(t)}}mn.compileSchema=RS;function vL(t,e,r){var n;r=(0,Un.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=_L.call(this,t,r);if(s===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:u}=this.opts;a&&(s=new Pl({schema:a,schemaId:u,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=SL.call(this,s)}mn.resolveRef=vL;function SL(t){return(0,Un.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:RS.call(this,t)}function dx(t){for(let e of this._compilations)if(bL(e,t))return e}mn.getCompilingSchema=dx;function bL(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function _L(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Gh.call(this,t,e)}function Gh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Un._getFullPath)(this.opts.uriResolver,r),i=(0,Un.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return xS.call(this,r,t);let s=(0,Un.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let u=Gh.call(this,t,a);return typeof u?.schema!="object"?void 0:xS.call(this,r,u)}if(typeof a?.schema=="object"){if(a.validate||RS.call(this,a),s===(0,Un.normalizeId)(e)){let{schema:u}=a,{schemaId:f}=this.opts,h=u[f];return h&&(i=(0,Un.resolveUrl)(this.opts.uriResolver,i,h)),new Pl({schema:u,schemaId:f,root:t,baseId:i})}return xS.call(this,r,a)}}mn.resolveSchema=Gh;var wL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function xS(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let u of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let f=r[(0,fx.unescapeFragment)(u)];if(f===void 0)return;r=f;let h=typeof r=="object"&&r[this.opts.schemaId];!wL.has(u)&&h&&(e=(0,Un.resolveUrl)(this.opts.uriResolver,e,h))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,fx.schemaHasRulesButRef)(r,this.RULES)){let u=(0,Un.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Gh.call(this,n,u)}let{schemaId:a}=this.opts;if(s=s||new Pl({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var hx=F((G3,EL)=>{EL.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 OS=F((Q3,yx)=>{"use strict";var CL=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),mx=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);function IS(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var xL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function px(t){return t.length=0,!0}function RL(t,e,r){if(t.length){let n=IS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function IL(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,u=RL;for(let f=0;f<t.length;f++){let h=t[f];if(!(h==="["||h==="]"))if(h===":"){if(s===!0&&(a=!0),!u(i,n,r))break;if(++e>7){r.error=!0;break}f>0&&t[f-1]===":"&&(s=!0),n.push(":");continue}else if(h==="%"){if(!u(i,n,r))break;u=px}else{i.push(h);continue}}return i.length&&(u===px?r.zone=i.join(""):a?n.push(i.join("")):n.push(IS(i))),r.address=n.join(""),r}function gx(t){if(OL(t,":")<2)return{host:t,isIPV6:!1};let e=IL(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function OL(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function PL(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function kL(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function AL(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!mx(r)){let n=gx(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}yx.exports={nonSimpleDomain:xL,recomposeAuthority:AL,normalizeComponentEncoding:kL,removeDotSegments:PL,isIPv4:mx,isUUID:CL,normalizeIPv6:gx,stringArrayToHexStripped:IS}});var wx=F((Z3,_x)=>{"use strict";var{isUUID:TL}=OS(),qL=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,$L=["http","https","ws","wss","urn","urn:uuid"];function ML(t){return $L.indexOf(t)!==-1}function PS(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function vx(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function Sx(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function NL(t){return t.secure=PS(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function DL(t){if((t.port===(PS(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function FL(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(qL);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=kS(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function LL(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=kS(i);s&&(t=s.serialize(t,e));let a=t,u=t.nss;return a.path=`${n||e.nid}:${u}`,e.skipEscape=!0,a}function jL(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!TL(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function UL(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var bx={scheme:"http",domainHost:!0,parse:vx,serialize:Sx},BL={scheme:"https",domainHost:bx.domainHost,parse:vx,serialize:Sx},Zh={scheme:"ws",domainHost:!0,parse:NL,serialize:DL},HL={scheme:"wss",domainHost:Zh.domainHost,parse:Zh.parse,serialize:Zh.serialize},VL={scheme:"urn",parse:FL,serialize:LL,skipNormalize:!0},WL={scheme:"urn:uuid",parse:jL,serialize:UL,skipNormalize:!0},Xh={http:bx,https:BL,ws:Zh,wss:HL,urn:VL,"urn:uuid":WL};Object.setPrototypeOf(Xh,null);function kS(t){return t&&(Xh[t]||Xh[t.toLowerCase()])||void 0}_x.exports={wsIsSecure:PS,SCHEMES:Xh,isValidSchemeName:ML,getSchemeHandler:kS}});var xx=F((X3,tp)=>{"use strict";var{normalizeIPv6:YL,removeDotSegments:Mc,recomposeAuthority:JL,normalizeComponentEncoding:ep,isIPv4:zL,nonSimpleDomain:KL}=OS(),{SCHEMES:GL,getSchemeHandler:Ex}=wx();function QL(t,e){return typeof t=="string"?t=Ei(es(t,e),e):typeof t=="object"&&(t=es(Ei(t,e),e)),t}function ZL(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Cx(es(t,n),es(e,n),n,!0);return n.skipEscape=!0,Ei(i,n)}function Cx(t,e,r,n){let i={};return n||(t=es(Ei(t,r),r),e=es(Ei(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Mc(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Mc(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Mc(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=Mc(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function XL(t,e,r){return typeof t=="string"?(t=unescape(t),t=Ei(ep(es(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Ei(ep(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=Ei(ep(es(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Ei(ep(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function Ei(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=Ex(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=JL(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let u=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(u=Mc(u)),a===void 0&&u[0]==="/"&&u[1]==="/"&&(u="/%2F"+u.slice(2)),i.push(u)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var ej=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function es(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(ej);if(s){if(n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]),n.host)if(zL(n.host)===!1){let f=YL(n.host);n.host=f.host.toLowerCase(),i=f.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=Ex(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&i===!1&&KL(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}(!a||a&&!a.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var AS={SCHEMES:GL,normalize:QL,resolve:ZL,resolveComponent:Cx,equal:XL,serialize:Ei,parse:es};tp.exports=AS;tp.exports.default=AS;tp.exports.fastUri=AS});var Ix=F(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});var Rx=xx();Rx.code='require("ajv/dist/runtime/uri").default';TS.default=Rx});var Mx=F(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.CodeGen=Zt.Name=Zt.nil=Zt.stringify=Zt.str=Zt._=Zt.KeywordCxt=void 0;var tj=qc();Object.defineProperty(Zt,"KeywordCxt",{enumerable:!0,get:function(){return tj.KeywordCxt}});var kl=Ne();Object.defineProperty(Zt,"_",{enumerable:!0,get:function(){return kl._}});Object.defineProperty(Zt,"str",{enumerable:!0,get:function(){return kl.str}});Object.defineProperty(Zt,"stringify",{enumerable:!0,get:function(){return kl.stringify}});Object.defineProperty(Zt,"nil",{enumerable:!0,get:function(){return kl.nil}});Object.defineProperty(Zt,"Name",{enumerable:!0,get:function(){return kl.Name}});Object.defineProperty(Zt,"CodeGen",{enumerable:!0,get:function(){return kl.CodeGen}});var rj=Kh(),Tx=$c(),nj=aS(),Nc=Qh(),ij=Ne(),Dc=kc(),rp=Pc(),$S=ze(),Ox=hx(),sj=Ix(),qx=(t,e)=>new RegExp(t,e);qx.code="new RegExp";var oj=["removeAdditional","useDefaults","coerceTypes"],aj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),lj={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."},uj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Px=200;function cj(t){var e,r,n,i,s,a,u,f,h,g,m,S,_,C,x,A,T,j,Y,V,K,ee,k,E,P;let N=t.strict,D=(e=t.code)===null||e===void 0?void 0:e.optimize,L=D===!0||D===void 0?1:D||0,z=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:qx,Z=(i=t.uriResolver)!==null&&i!==void 0?i:sj.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&a!==void 0?a:!0,strictNumbers:(f=(u=t.strictNumbers)!==null&&u!==void 0?u:N)!==null&&f!==void 0?f:!0,strictTypes:(g=(h=t.strictTypes)!==null&&h!==void 0?h:N)!==null&&g!==void 0?g:"log",strictTuples:(S=(m=t.strictTuples)!==null&&m!==void 0?m:N)!==null&&S!==void 0?S:"log",strictRequired:(C=(_=t.strictRequired)!==null&&_!==void 0?_:N)!==null&&C!==void 0?C:!1,code:t.code?{...t.code,optimize:L,regExp:z}:{optimize:L,regExp:z},loopRequired:(x=t.loopRequired)!==null&&x!==void 0?x:Px,loopEnum:(A=t.loopEnum)!==null&&A!==void 0?A:Px,meta:(T=t.meta)!==null&&T!==void 0?T:!0,messages:(j=t.messages)!==null&&j!==void 0?j:!0,inlineRefs:(Y=t.inlineRefs)!==null&&Y!==void 0?Y:!0,schemaId:(V=t.schemaId)!==null&&V!==void 0?V:"$id",addUsedSchema:(K=t.addUsedSchema)!==null&&K!==void 0?K:!0,validateSchema:(ee=t.validateSchema)!==null&&ee!==void 0?ee:!0,validateFormats:(k=t.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:(E=t.unicodeRegExp)!==null&&E!==void 0?E:!0,int32range:(P=t.int32range)!==null&&P!==void 0?P:!0,uriResolver:Z}}var Fc=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...cj(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new ij.ValueScope({scope:{},prefixes:aj,es5:r,lines:n}),this.logger=gj(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,nj.getRules)(),kx.call(this,lj,e,"NOT SUPPORTED"),kx.call(this,uj,e,"DEPRECATED","warn"),this._metaOpts=pj.call(this),e.formats&&dj.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&hj.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),fj.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=Ox;n==="id"&&(i={...Ox},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(g,m){await s.call(this,g.$schema);let S=this._addSchema(g,m);return S.validate||a.call(this,S)}async function s(g){g&&!this.getSchema(g)&&await i.call(this,{$ref:g},!0)}async function a(g){try{return this._compileSchemaEnv(g)}catch(m){if(!(m instanceof Tx.default))throw m;return u.call(this,m),await f.call(this,m.missingSchema),a.call(this,g)}}function u({missingSchema:g,missingRef:m}){if(this.refs[g])throw new Error(`AnySchema ${g} is loaded but ${m} cannot be resolved`)}async function f(g){let m=await h.call(this,g);this.refs[g]||await s.call(this,m.$schema),this.refs[g]||this.addSchema(m,g,r)}async function h(g){let m=this._loading[g];if(m)return m;try{return await(this._loading[g]=n(g))}finally{delete this._loading[g]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:a}=this.opts;if(s=e[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,Dc.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=Ax.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Nc.SchemaEnv({schema:{},schemaId:n});if(r=Nc.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Ax.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,Dc.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(vj.call(this,n,r),!r)return(0,$S.eachItem)(n,s=>qS.call(this,s)),this;bj.call(this,r);let i={...r,type:(0,rp.getJSONTypes)(r.type),schemaType:(0,rp.getJSONTypes)(r.schemaType)};return(0,$S.eachItem)(n,i.type.length===0?s=>qS.call(this,s,i):s=>i.type.forEach(a=>qS.call(this,s,i,a))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),a=e;for(let u of s)a=a[u];for(let u in n){let f=n[u];if(typeof f!="object")continue;let{$data:h}=f.definition,g=a[u];h&&g&&(a[u]=$x(g))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:u}=this.opts;if(typeof e=="object")a=e[u];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let f=this._cache.get(e);if(f!==void 0)return f;n=(0,Dc.normalizeId)(a||n);let h=Dc.getSchemaRefs.call(this,e,n);return f=new Nc.SchemaEnv({schema:e,schemaId:u,meta:r,baseId:n,localRefs:h}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),i&&this.validateSchema(e,!0),f}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Nc.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Nc.compileSchema.call(this,e)}finally{this.opts=r}}};Fc.ValidationError=rj.default;Fc.MissingRefError=Tx.default;Zt.default=Fc;function kx(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function Ax(t){return t=(0,Dc.normalizeId)(t),this.schemas[t]||this.refs[t]}function fj(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function dj(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function hj(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function pj(){let t={...this.opts};for(let e of oj)delete t[e];return t}var mj={log(){},warn(){},error(){}};function gj(t){if(t===!1)return mj;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var yj=/^[a-z_$][a-z0-9_$:-]*$/i;function vj(t,e){let{RULES:r}=this;if((0,$S.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!yj.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function qS(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:f})=>f===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[t]=!0,!e)return;let u={keyword:t,definition:{...e,type:(0,rp.getJSONTypes)(e.type),schemaType:(0,rp.getJSONTypes)(e.schemaType)}};e.before?Sj.call(this,a,u,e.before):a.rules.push(u),s.all[t]=u,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function Sj(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function bj(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=$x(e)),t.validateSchema=this.compile(e,!0))}var _j={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function $x(t){return{anyOf:[t,_j]}}});var Nx=F(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});var wj={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};MS.default=wj});var jx=F(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.callRef=Go.getValidate=void 0;var Ej=$c(),Dx=pn(),Tr=Ne(),Al=Zi(),Fx=Qh(),np=ze(),Cj={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:a,opts:u,self:f}=n,{root:h}=s;if((r==="#"||r==="#/")&&i===h.baseId)return m();let g=Fx.resolveRef.call(f,h,i,r);if(g===void 0)throw new Ej.default(n.opts.uriResolver,i,r);if(g instanceof Fx.SchemaEnv)return S(g);return _(g);function m(){if(s===h)return ip(t,a,s,s.$async);let C=e.scopeValue("root",{ref:h});return ip(t,(0,Tr._)`${C}.validate`,h,h.$async)}function S(C){let x=Lx(t,C);ip(t,x,C,C.$async)}function _(C){let x=e.scopeValue("schema",u.code.source===!0?{ref:C,code:(0,Tr.stringify)(C)}:{ref:C}),A=e.name("valid"),T=t.subschema({schema:C,dataTypes:[],schemaPath:Tr.nil,topSchemaRef:x,errSchemaPath:r},A);t.mergeEvaluated(T),t.ok(A)}}};function Lx(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Tr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Go.getValidate=Lx;function ip(t,e,r,n){let{gen:i,it:s}=t,{allErrors:a,schemaEnv:u,opts:f}=s,h=f.passContext?Al.default.this:Tr.nil;n?g():m();function g(){if(!u.$async)throw new Error("async schema referenced by sync schema");let C=i.let("valid");i.try(()=>{i.code((0,Tr._)`await ${(0,Dx.callValidateCode)(t,e,h)}`),_(e),a||i.assign(C,!0)},x=>{i.if((0,Tr._)`!(${x} instanceof ${s.ValidationError})`,()=>i.throw(x)),S(x),a||i.assign(C,!1)}),t.ok(C)}function m(){t.result((0,Dx.callValidateCode)(t,e,h),()=>_(e),()=>S(e))}function S(C){let x=(0,Tr._)`${C}.errors`;i.assign(Al.default.vErrors,(0,Tr._)`${Al.default.vErrors} === null ? ${x} : ${Al.default.vErrors}.concat(${x})`),i.assign(Al.default.errors,(0,Tr._)`${Al.default.vErrors}.length`)}function _(C){var x;if(!s.opts.unevaluated)return;let A=(x=r?.validate)===null||x===void 0?void 0:x.evaluated;if(s.props!==!0)if(A&&!A.dynamicProps)A.props!==void 0&&(s.props=np.mergeEvaluated.props(i,A.props,s.props));else{let T=i.var("props",(0,Tr._)`${C}.evaluated.props`);s.props=np.mergeEvaluated.props(i,T,s.props,Tr.Name)}if(s.items!==!0)if(A&&!A.dynamicItems)A.items!==void 0&&(s.items=np.mergeEvaluated.items(i,A.items,s.items));else{let T=i.var("items",(0,Tr._)`${C}.evaluated.items`);s.items=np.mergeEvaluated.items(i,T,s.items,Tr.Name)}}}Go.callRef=ip;Go.default=Cj});var Ux=F(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});var xj=Nx(),Rj=jx(),Ij=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",xj.default,Rj.default];NS.default=Ij});var Bx=F(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var sp=Ne(),Gs=sp.operators,op={maximum:{okStr:"<=",ok:Gs.LTE,fail:Gs.GT},minimum:{okStr:">=",ok:Gs.GTE,fail:Gs.LT},exclusiveMaximum:{okStr:"<",ok:Gs.LT,fail:Gs.GTE},exclusiveMinimum:{okStr:">",ok:Gs.GT,fail:Gs.LTE}},Oj={message:({keyword:t,schemaCode:e})=>(0,sp.str)`must be ${op[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,sp._)`{comparison: ${op[t].okStr}, limit: ${e}}`},Pj={keyword:Object.keys(op),type:"number",schemaType:"number",$data:!0,error:Oj,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,sp._)`${r} ${op[e].fail} ${n} || isNaN(${r})`)}};DS.default=Pj});var Hx=F(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});var Lc=Ne(),kj={message:({schemaCode:t})=>(0,Lc.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Lc._)`{multipleOf: ${t}}`},Aj={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:kj,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),u=s?(0,Lc._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,Lc._)`${a} !== parseInt(${a})`;t.fail$data((0,Lc._)`(${n} === 0 || (${a} = ${r}/${n}, ${u}))`)}};FS.default=Aj});var Wx=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});function Vx(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}LS.default=Vx;Vx.code='require("ajv/dist/runtime/ucs2length").default'});var Yx=F(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var Qo=Ne(),Tj=ze(),qj=Wx(),$j={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Qo.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Qo._)`{limit: ${t}}`},Mj={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:$j,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Qo.operators.GT:Qo.operators.LT,a=i.opts.unicode===!1?(0,Qo._)`${r}.length`:(0,Qo._)`${(0,Tj.useFunc)(t.gen,qj.default)}(${r})`;t.fail$data((0,Qo._)`${a} ${s} ${n}`)}};jS.default=Mj});var Jx=F(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var Nj=pn(),ap=Ne(),Dj={message:({schemaCode:t})=>(0,ap.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,ap._)`{pattern: ${t}}`},Fj={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Dj,code(t){let{data:e,$data:r,schema:n,schemaCode:i,it:s}=t,a=s.opts.unicodeRegExp?"u":"",u=r?(0,ap._)`(new RegExp(${i}, ${a}))`:(0,Nj.usePattern)(t,n);t.fail$data((0,ap._)`!${u}.test(${e})`)}};US.default=Fj});var zx=F(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});var jc=Ne(),Lj={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,jc.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,jc._)`{limit: ${t}}`},jj={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Lj,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?jc.operators.GT:jc.operators.LT;t.fail$data((0,jc._)`Object.keys(${r}).length ${i} ${n}`)}};BS.default=jj});var Kx=F(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});var Uc=pn(),Bc=Ne(),Uj=ze(),Bj={message:({params:{missingProperty:t}})=>(0,Bc.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Bc._)`{missingProperty: ${t}}`},Hj={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Bj,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:a}=t,{opts:u}=a;if(!s&&r.length===0)return;let f=r.length>=u.loopRequired;if(a.allErrors?h():g(),u.strictRequired){let _=t.parentSchema.properties,{definedProperties:C}=t.it;for(let x of r)if(_?.[x]===void 0&&!C.has(x)){let A=a.schemaEnv.baseId+a.errSchemaPath,T=`required property "${x}" is not defined at "${A}" (strictRequired)`;(0,Uj.checkStrictMode)(a,T,a.opts.strictRequired)}}function h(){if(f||s)t.block$data(Bc.nil,m);else for(let _ of r)(0,Uc.checkReportMissingProp)(t,_)}function g(){let _=e.let("missing");if(f||s){let C=e.let("valid",!0);t.block$data(C,()=>S(_,C)),t.ok(C)}else e.if((0,Uc.checkMissingProp)(t,r,_)),(0,Uc.reportMissingProp)(t,_),e.else()}function m(){e.forOf("prop",n,_=>{t.setParams({missingProperty:_}),e.if((0,Uc.noPropertyInData)(e,i,_,u.ownProperties),()=>t.error())})}function S(_,C){t.setParams({missingProperty:_}),e.forOf(_,n,()=>{e.assign(C,(0,Uc.propertyInData)(e,i,_,u.ownProperties)),e.if((0,Bc.not)(C),()=>{t.error(),e.break()})},Bc.nil)}}};HS.default=Hj});var Gx=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var Hc=Ne(),Vj={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Hc.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Hc._)`{limit: ${t}}`},Wj={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Vj,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Hc.operators.GT:Hc.operators.LT;t.fail$data((0,Hc._)`${r}.length ${i} ${n}`)}};VS.default=Wj});var lp=F(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var Qx=mS();Qx.code='require("ajv/dist/runtime/equal").default';WS.default=Qx});var Zx=F(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0});var YS=Pc(),Xt=Ne(),Yj=ze(),Jj=lp(),zj={message:({params:{i:t,j:e}})=>(0,Xt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Xt._)`{i: ${t}, j: ${e}}`},Kj={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:zj,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:u}=t;if(!n&&!i)return;let f=e.let("valid"),h=s.items?(0,YS.getSchemaTypes)(s.items):[];t.block$data(f,g,(0,Xt._)`${a} === false`),t.ok(f);function g(){let C=e.let("i",(0,Xt._)`${r}.length`),x=e.let("j");t.setParams({i:C,j:x}),e.assign(f,!0),e.if((0,Xt._)`${C} > 1`,()=>(m()?S:_)(C,x))}function m(){return h.length>0&&!h.some(C=>C==="object"||C==="array")}function S(C,x){let A=e.name("item"),T=(0,YS.checkDataTypes)(h,A,u.opts.strictNumbers,YS.DataType.Wrong),j=e.const("indices",(0,Xt._)`{}`);e.for((0,Xt._)`;${C}--;`,()=>{e.let(A,(0,Xt._)`${r}[${C}]`),e.if(T,(0,Xt._)`continue`),h.length>1&&e.if((0,Xt._)`typeof ${A} == "string"`,(0,Xt._)`${A} += "_"`),e.if((0,Xt._)`typeof ${j}[${A}] == "number"`,()=>{e.assign(x,(0,Xt._)`${j}[${A}]`),t.error(),e.assign(f,!1).break()}).code((0,Xt._)`${j}[${A}] = ${C}`)})}function _(C,x){let A=(0,Yj.useFunc)(e,Jj.default),T=e.name("outer");e.label(T).for((0,Xt._)`;${C}--;`,()=>e.for((0,Xt._)`${x} = ${C}; ${x}--;`,()=>e.if((0,Xt._)`${A}(${r}[${C}], ${r}[${x}])`,()=>{t.error(),e.assign(f,!1).break(T)})))}}};JS.default=Kj});var Xx=F(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var zS=Ne(),Gj=ze(),Qj=lp(),Zj={message:"must be equal to constant",params:({schemaCode:t})=>(0,zS._)`{allowedValue: ${t}}`},Xj={keyword:"const",$data:!0,error:Zj,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,zS._)`!${(0,Gj.useFunc)(e,Qj.default)}(${r}, ${i})`):t.fail((0,zS._)`${s} !== ${r}`)}};KS.default=Xj});var eR=F(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var Vc=Ne(),e2=ze(),t2=lp(),r2={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Vc._)`{allowedValues: ${t}}`},n2={keyword:"enum",schemaType:"array",$data:!0,error:r2,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let u=i.length>=a.opts.loopEnum,f,h=()=>f??(f=(0,e2.useFunc)(e,t2.default)),g;if(u||n)g=e.let("valid"),t.block$data(g,m);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let _=e.const("vSchema",s);g=(0,Vc.or)(...i.map((C,x)=>S(_,x)))}t.pass(g);function m(){e.assign(g,!1),e.forOf("v",s,_=>e.if((0,Vc._)`${h()}(${r}, ${_})`,()=>e.assign(g,!0).break()))}function S(_,C){let x=i[C];return typeof x=="object"&&x!==null?(0,Vc._)`${h()}(${r}, ${_}[${C}])`:(0,Vc._)`${r} === ${x}`}}};GS.default=n2});var tR=F(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0});var i2=Bx(),s2=Hx(),o2=Yx(),a2=Jx(),l2=zx(),u2=Kx(),c2=Gx(),f2=Zx(),d2=Xx(),h2=eR(),p2=[i2.default,s2.default,o2.default,a2.default,l2.default,u2.default,c2.default,f2.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d2.default,h2.default];QS.default=p2});var XS=F(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.validateAdditionalItems=void 0;var Zo=Ne(),ZS=ze(),m2={message:({params:{len:t}})=>(0,Zo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Zo._)`{limit: ${t}}`},g2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:m2,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,ZS.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}rR(t,n)}};function rR(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let u=r.const("len",(0,Zo._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Zo._)`${u} <= ${e.length}`);else if(typeof n=="object"&&!(0,ZS.alwaysValidSchema)(a,n)){let h=r.var("valid",(0,Zo._)`${u} <= ${e.length}`);r.if((0,Zo.not)(h),()=>f(h)),t.ok(h)}function f(h){r.forRange("i",e.length,u,g=>{t.subschema({keyword:s,dataProp:g,dataPropType:ZS.Type.Num},h),a.allErrors||r.if((0,Zo.not)(h),()=>r.break())})}}Wc.validateAdditionalItems=rR;Wc.default=g2});var eb=F(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.validateTuple=void 0;var nR=Ne(),up=ze(),y2=pn(),v2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return iR(t,"additionalItems",e);r.items=!0,!(0,up.alwaysValidSchema)(r,e)&&t.ok((0,y2.validateArray)(t))}};function iR(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:u}=t;g(i),u.opts.unevaluated&&r.length&&u.items!==!0&&(u.items=up.mergeEvaluated.items(n,r.length,u.items));let f=n.name("valid"),h=n.const("len",(0,nR._)`${s}.length`);r.forEach((m,S)=>{(0,up.alwaysValidSchema)(u,m)||(n.if((0,nR._)`${h} > ${S}`,()=>t.subschema({keyword:a,schemaProp:S,dataProp:S},f)),t.ok(f))});function g(m){let{opts:S,errSchemaPath:_}=u,C=r.length,x=C===m.minItems&&(C===m.maxItems||m[e]===!1);if(S.strictTuples&&!x){let A=`"${a}" is ${C}-tuple, but minItems or maxItems/${e} are not specified or different at path "${_}"`;(0,up.checkStrictMode)(u,A,S.strictTuples)}}}Yc.validateTuple=iR;Yc.default=v2});var sR=F(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});var S2=eb(),b2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,S2.validateTuple)(t,"items")};tb.default=b2});var aR=F(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});var oR=Ne(),_2=ze(),w2=pn(),E2=XS(),C2={message:({params:{len:t}})=>(0,oR.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,oR._)`{limit: ${t}}`},x2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:C2,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,_2.alwaysValidSchema)(n,e)&&(i?(0,E2.validateAdditionalItems)(t,i):t.ok((0,w2.validateArray)(t)))}};rb.default=x2});var lR=F(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});var gn=Ne(),cp=ze(),R2={message:({params:{min:t,max:e}})=>e===void 0?(0,gn.str)`must contain at least ${t} valid item(s)`:(0,gn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,gn._)`{minContains: ${t}}`:(0,gn._)`{minContains: ${t}, maxContains: ${e}}`},I2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:R2,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,a,u,{minContains:f,maxContains:h}=n;s.opts.next?(a=f===void 0?1:f,u=h):a=1;let g=e.const("len",(0,gn._)`${i}.length`);if(t.setParams({min:a,max:u}),u===void 0&&a===0){(0,cp.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(u!==void 0&&a>u){(0,cp.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,cp.alwaysValidSchema)(s,r)){let x=(0,gn._)`${g} >= ${a}`;u!==void 0&&(x=(0,gn._)`${x} && ${g} <= ${u}`),t.pass(x);return}s.items=!0;let m=e.name("valid");u===void 0&&a===1?_(m,()=>e.if(m,()=>e.break())):a===0?(e.let(m,!0),u!==void 0&&e.if((0,gn._)`${i}.length > 0`,S)):(e.let(m,!1),S()),t.result(m,()=>t.reset());function S(){let x=e.name("_valid"),A=e.let("count",0);_(x,()=>e.if(x,()=>C(A)))}function _(x,A){e.forRange("i",0,g,T=>{t.subschema({keyword:"contains",dataProp:T,dataPropType:cp.Type.Num,compositeRule:!0},x),A()})}function C(x){e.code((0,gn._)`${x}++`),u===void 0?e.if((0,gn._)`${x} >= ${a}`,()=>e.assign(m,!0).break()):(e.if((0,gn._)`${x} > ${u}`,()=>e.assign(m,!1).break()),a===1?e.assign(m,!0):e.if((0,gn._)`${x} >= ${a}`,()=>e.assign(m,!0)))}}};nb.default=I2});var fR=F(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.validateSchemaDeps=Ci.validatePropertyDeps=Ci.error=void 0;var ib=Ne(),O2=ze(),Jc=pn();Ci.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,ib.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,ib._)`{property: ${t},
|
|
23
|
+
`+new Error().stack),v=!1}return p.apply(this,arguments)},p)}var P={};function N(c,p){e.deprecationHandler!=null&&e.deprecationHandler(c,p),P[c]||(k(p),P[c]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function D(c){return typeof Function<"u"&&c instanceof Function||Object.prototype.toString.call(c)==="[object Function]"}function L(c){var p,v;for(v in c)s(c,v)&&(p=c[v],D(p)?this[v]=p:this["_"+v]=p);this._config=c,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function z(c,p){var v=m({},c),b;for(b in p)s(p,b)&&(i(c[b])&&i(p[b])?(v[b]={},m(v[b],c[b]),m(v[b],p[b])):p[b]!=null?v[b]=p[b]:delete v[b]);for(b in c)s(c,b)&&!s(p,b)&&i(c[b])&&(v[b]=m({},v[b]));return v}function Z(c){c!=null&&this.set(c)}var ae;Object.keys?ae=Object.keys:ae=function(c){var p,v=[];for(p in c)s(c,p)&&v.push(p);return v};var de={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function nt(c,p,v){var b=this._calendar[c]||this._calendar.sameElse;return D(b)?b.call(p,v):b}function Ie(c,p,v){var b=""+Math.abs(c),R=p-b.length,$=c>=0;return($?v?"+":"":"-")+Math.pow(10,Math.max(0,R)).toString().substr(1)+b}var ge=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Te=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,wt={},Tt={};function le(c,p,v,b){var R=b;typeof b=="string"&&(R=function(){return this[b]()}),c&&(Tt[c]=R),p&&(Tt[p[0]]=function(){return Ie(R.apply(this,arguments),p[1],p[2])}),v&&(Tt[v]=function(){return this.localeData().ordinal(R.apply(this,arguments),c)})}function Xr(c){return c.match(/\[[\s\S]/)?c.replace(/^\[|\]$/g,""):c.replace(/\\/g,"")}function os(c){var p=c.match(ge),v,b;for(v=0,b=p.length;v<b;v++)Tt[p[v]]?p[v]=Tt[p[v]]:p[v]=Xr(p[v]);return function(R){var $="",W;for(W=0;W<b;W++)$+=D(p[W])?p[W].call(R,c):p[W];return $}}function Et(c,p){return c.isValid()?(p=Cn(p,c.localeData()),wt[p]=wt[p]||os(p),wt[p](c)):c.localeData().invalidDate()}function Cn(c,p){var v=5;function b(R){return p.longDateFormat(R)||R}for(Te.lastIndex=0;v>=0&&Te.test(c);)c=c.replace(Te,b),Te.lastIndex=0,v-=1;return c}var en={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function er(c){var p=this._longDateFormat[c],v=this._longDateFormat[c.toUpperCase()];return p||!v?p:(this._longDateFormat[c]=v.match(ge).map(function(b){return b==="MMMM"||b==="MM"||b==="DD"||b==="dddd"?b.slice(1):b}).join(""),this._longDateFormat[c])}var ht="Invalid date";function tn(){return this._invalidDate}var uo="%d",Ht=/\d{1,2}/;function co(c){return this._ordinal.replace("%d",c)}var ug={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Rn(c,p,v,b){var R=this._relativeTime[v];return D(R)?R(c,p,v,b):R.replace(/%d/i,c)}function ad(c,p){var v=this._relativeTime[c>0?"future":"past"];return D(v)?v(p):v.replace(/%s/i,p)}var ld={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Vt(c){return typeof c=="string"?ld[c]||ld[c.toLowerCase()]:void 0}function dr(c){var p={},v,b;for(b in c)s(c,b)&&(v=Vt(b),v&&(p[v]=c[b]));return p}var fo={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Oa(c){var p=[],v;for(v in c)s(c,v)&&p.push({unit:v,priority:fo[v]});return p.sort(function(b,R){return b.priority-R.priority}),p}var ud=/\d/,Ft=/\d\d/,cd=/\d{3}/,Oi=/\d{4}/,In=/[+-]?\d{6}/,it=/\d\d?/,Pa=/\d\d\d\d?/,ka=/\d\d\d\d\d\d?/,as=/\d{1,3}/,ho=/\d{1,4}/,ls=/[+-]?\d{1,6}/,ni=/\d+/,us=/[+-]?\d+/,Bu=/Z|[+-]\d\d:?\d\d/gi,Aa=/Z|[+-]\d\d(?::?\d\d)?/gi,cg=/[+-]?\d+(\.\d{1,3})?/,po=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Pi=/^[1-9]\d?/,Ta=/^([1-9]\d|\d)/,qa;qa={};function oe(c,p,v){qa[c]=D(p)?p:function(b,R){return b&&v?v:p}}function fg(c,p){return s(qa,c)?qa[c](p._strict,p._locale):new RegExp(dg(c))}function dg(c){return rn(c.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(p,v,b,R,$){return v||b||R||$}))}function rn(c){return c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function xr(c){return c<0?Math.ceil(c)||0:Math.floor(c)}function qe(c){var p=+c,v=0;return p!==0&&isFinite(p)&&(v=xr(p)),v}var Hu={};function Ge(c,p){var v,b=p,R;for(typeof c=="string"&&(c=[c]),f(p)&&(b=function($,W){W[p]=qe($)}),R=c.length,v=0;v<R;v++)Hu[c[v]]=b}function mo(c,p){Ge(c,function(v,b,R,$){R._w=R._w||{},p(v,R._w,R,$)})}function Vu(c,p,v){p!=null&&s(Hu,c)&&Hu[c](p,v._a,v,c)}function $a(c){return c%4===0&&c%100!==0||c%400===0}var Wt=0,On=1,nn=2,Ot=3,Cr=4,Pn=5,ki=6,fd=7,hg=8;le("Y",0,0,function(){var c=this.year();return c<=9999?Ie(c,4):"+"+c}),le(0,["YY",2],0,function(){return this.year()%100}),le(0,["YYYY",4],0,"year"),le(0,["YYYYY",5],0,"year"),le(0,["YYYYYY",6,!0],0,"year"),oe("Y",us),oe("YY",it,Ft),oe("YYYY",ho,Oi),oe("YYYYY",ls,In),oe("YYYYYY",ls,In),Ge(["YYYYY","YYYYYY"],Wt),Ge("YYYY",function(c,p){p[Wt]=c.length===2?e.parseTwoDigitYear(c):qe(c)}),Ge("YY",function(c,p){p[Wt]=e.parseTwoDigitYear(c)}),Ge("Y",function(c,p){p[Wt]=parseInt(c,10)});function go(c){return $a(c)?366:365}e.parseTwoDigitYear=function(c){return qe(c)+(qe(c)>68?1900:2e3)};var dd=cs("FullYear",!0);function pg(){return $a(this.year())}function cs(c,p){return function(v){return v!=null?(vo(this,c,v),e.updateOffset(this,p),this):yo(this,c)}}function yo(c,p){if(!c.isValid())return NaN;var v=c._d,b=c._isUTC;switch(p){case"Milliseconds":return b?v.getUTCMilliseconds():v.getMilliseconds();case"Seconds":return b?v.getUTCSeconds():v.getSeconds();case"Minutes":return b?v.getUTCMinutes():v.getMinutes();case"Hours":return b?v.getUTCHours():v.getHours();case"Date":return b?v.getUTCDate():v.getDate();case"Day":return b?v.getUTCDay():v.getDay();case"Month":return b?v.getUTCMonth():v.getMonth();case"FullYear":return b?v.getUTCFullYear():v.getFullYear();default:return NaN}}function vo(c,p,v){var b,R,$,W,ie;if(!(!c.isValid()||isNaN(v))){switch(b=c._d,R=c._isUTC,p){case"Milliseconds":return void(R?b.setUTCMilliseconds(v):b.setMilliseconds(v));case"Seconds":return void(R?b.setUTCSeconds(v):b.setSeconds(v));case"Minutes":return void(R?b.setUTCMinutes(v):b.setMinutes(v));case"Hours":return void(R?b.setUTCHours(v):b.setHours(v));case"Date":return void(R?b.setUTCDate(v):b.setDate(v));case"FullYear":break;default:return}$=v,W=c.month(),ie=c.date(),ie=ie===29&&W===1&&!$a($)?28:ie,R?b.setUTCFullYear($,W,ie):b.setFullYear($,W,ie)}}function mg(c){return c=Vt(c),D(this[c])?this[c]():this}function Ma(c,p){if(typeof c=="object"){c=dr(c);var v=Oa(c),b,R=v.length;for(b=0;b<R;b++)this[v[b].unit](c[v[b].unit])}else if(c=Vt(c),D(this[c]))return this[c](p);return this}function gg(c,p){return(c%p+p)%p}var St;Array.prototype.indexOf?St=Array.prototype.indexOf:St=function(c){var p;for(p=0;p<this.length;++p)if(this[p]===c)return p;return-1};function Wu(c,p){if(isNaN(c)||isNaN(p))return NaN;var v=gg(p,12);return c+=(p-v)/12,v===1?$a(c)?29:28:31-v%7%2}le("M",["MM",2],"Mo",function(){return this.month()+1}),le("MMM",0,0,function(c){return this.localeData().monthsShort(this,c)}),le("MMMM",0,0,function(c){return this.localeData().months(this,c)}),oe("M",it,Pi),oe("MM",it,Ft),oe("MMM",function(c,p){return p.monthsShortRegex(c)}),oe("MMMM",function(c,p){return p.monthsRegex(c)}),Ge(["M","MM"],function(c,p){p[On]=qe(c)-1}),Ge(["MMM","MMMM"],function(c,p,v,b){var R=v._locale.monthsParse(c,b,v._strict);R!=null?p[On]=R:x(v).invalidMonth=c});var hd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Yu="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ju=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,yg=po,vg=po;function Sg(c,p){return c?n(this._months)?this._months[c.month()]:this._months[(this._months.isFormat||Ju).test(p)?"format":"standalone"][c.month()]:n(this._months)?this._months:this._months.standalone}function bg(c,p){return c?n(this._monthsShort)?this._monthsShort[c.month()]:this._monthsShort[Ju.test(p)?"format":"standalone"][c.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function pd(c,p,v){var b,R,$,W=c.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],b=0;b<12;++b)$=S([2e3,b]),this._shortMonthsParse[b]=this.monthsShort($,"").toLocaleLowerCase(),this._longMonthsParse[b]=this.months($,"").toLocaleLowerCase();return v?p==="MMM"?(R=St.call(this._shortMonthsParse,W),R!==-1?R:null):(R=St.call(this._longMonthsParse,W),R!==-1?R:null):p==="MMM"?(R=St.call(this._shortMonthsParse,W),R!==-1?R:(R=St.call(this._longMonthsParse,W),R!==-1?R:null)):(R=St.call(this._longMonthsParse,W),R!==-1?R:(R=St.call(this._shortMonthsParse,W),R!==-1?R:null))}function md(c,p,v){var b,R,$;if(this._monthsParseExact)return pd.call(this,c,p,v);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),b=0;b<12;b++){if(R=S([2e3,b]),v&&!this._longMonthsParse[b]&&(this._longMonthsParse[b]=new RegExp("^"+this.months(R,"").replace(".","")+"$","i"),this._shortMonthsParse[b]=new RegExp("^"+this.monthsShort(R,"").replace(".","")+"$","i")),!v&&!this._monthsParse[b]&&($="^"+this.months(R,"")+"|^"+this.monthsShort(R,""),this._monthsParse[b]=new RegExp($.replace(".",""),"i")),v&&p==="MMMM"&&this._longMonthsParse[b].test(c))return b;if(v&&p==="MMM"&&this._shortMonthsParse[b].test(c))return b;if(!v&&this._monthsParse[b].test(c))return b}}function zu(c,p){if(!c.isValid())return c;if(typeof p=="string"){if(/^\d+$/.test(p))p=qe(p);else if(p=c.localeData().monthsParse(p),!f(p))return c}var v=p,b=c.date();return b=b<29?b:Math.min(b,Wu(c.year(),v)),c._isUTC?c._d.setUTCMonth(v,b):c._d.setMonth(v,b),c}function Na(c){return c!=null?(zu(this,c),e.updateOffset(this,!0),this):yo(this,"Month")}function _g(){return Wu(this.year(),this.month())}function gd(c){return this._monthsParseExact?(s(this,"_monthsRegex")||Ku.call(this),c?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=yg),this._monthsShortStrictRegex&&c?this._monthsShortStrictRegex:this._monthsShortRegex)}function Da(c){return this._monthsParseExact?(s(this,"_monthsRegex")||Ku.call(this),c?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=vg),this._monthsStrictRegex&&c?this._monthsStrictRegex:this._monthsRegex)}function Ku(){function c(ye,Me){return Me.length-ye.length}var p=[],v=[],b=[],R,$,W,ie;for(R=0;R<12;R++)$=S([2e3,R]),W=rn(this.monthsShort($,"")),ie=rn(this.months($,"")),p.push(W),v.push(ie),b.push(ie),b.push(W);p.sort(c),v.sort(c),b.sort(c),this._monthsRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+v.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+p.join("|")+")","i")}function wg(c,p,v,b,R,$,W){var ie;return c<100&&c>=0?(ie=new Date(c+400,p,v,b,R,$,W),isFinite(ie.getFullYear())&&ie.setFullYear(c)):ie=new Date(c,p,v,b,R,$,W),ie}function fs(c){var p,v;return c<100&&c>=0?(v=Array.prototype.slice.call(arguments),v[0]=c+400,p=new Date(Date.UTC.apply(null,v)),isFinite(p.getUTCFullYear())&&p.setUTCFullYear(c)):p=new Date(Date.UTC.apply(null,arguments)),p}function So(c,p,v){var b=7+p-v,R=(7+fs(c,0,b).getUTCDay()-p)%7;return-R+b-1}function Fa(c,p,v,b,R){var $=(7+v-b)%7,W=So(c,b,R),ie=1+7*(p-1)+$+W,ye,Me;return ie<=0?(ye=c-1,Me=go(ye)+ie):ie>go(c)?(ye=c+1,Me=ie-go(c)):(ye=c,Me=ie),{year:ye,dayOfYear:Me}}function bo(c,p,v){var b=So(c.year(),p,v),R=Math.floor((c.dayOfYear()-b-1)/7)+1,$,W;return R<1?(W=c.year()-1,$=R+sn(W,p,v)):R>sn(c.year(),p,v)?($=R-sn(c.year(),p,v),W=c.year()+1):(W=c.year(),$=R),{week:$,year:W}}function sn(c,p,v){var b=So(c,p,v),R=So(c+1,p,v);return(go(c)-b+R)/7}le("w",["ww",2],"wo","week"),le("W",["WW",2],"Wo","isoWeek"),oe("w",it,Pi),oe("ww",it,Ft),oe("W",it,Pi),oe("WW",it,Ft),mo(["w","ww","W","WW"],function(c,p,v,b){p[b.substr(0,1)]=qe(c)});function Gu(c){return bo(c,this._week.dow,this._week.doy).week}var Qu={dow:0,doy:6};function ds(){return this._week.dow}function yd(){return this._week.doy}function vd(c){var p=this.localeData().week(this);return c==null?p:this.add((c-p)*7,"d")}function Eg(c){var p=bo(this,1,4).week;return c==null?p:this.add((c-p)*7,"d")}le("d",0,"do","day"),le("dd",0,0,function(c){return this.localeData().weekdaysMin(this,c)}),le("ddd",0,0,function(c){return this.localeData().weekdaysShort(this,c)}),le("dddd",0,0,function(c){return this.localeData().weekdays(this,c)}),le("e",0,0,"weekday"),le("E",0,0,"isoWeekday"),oe("d",it),oe("e",it),oe("E",it),oe("dd",function(c,p){return p.weekdaysMinRegex(c)}),oe("ddd",function(c,p){return p.weekdaysShortRegex(c)}),oe("dddd",function(c,p){return p.weekdaysRegex(c)}),mo(["dd","ddd","dddd"],function(c,p,v,b){var R=v._locale.weekdaysParse(c,b,v._strict);R!=null?p.d=R:x(v).invalidWeekday=c}),mo(["d","e","E"],function(c,p,v,b){p[b]=qe(c)});function Sd(c,p){return typeof c!="string"?c:isNaN(c)?(c=p.weekdaysParse(c),typeof c=="number"?c:null):parseInt(c,10)}function bd(c,p){return typeof c=="string"?p.weekdaysParse(c)%7||7:isNaN(c)?null:c}function La(c,p){return c.slice(p,7).concat(c.slice(0,p))}var _d="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),wd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),xg="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Cg=po,Ed=po,Rg=po;function Ig(c,p){var v=n(this._weekdays)?this._weekdays:this._weekdays[c&&c!==!0&&this._weekdays.isFormat.test(p)?"format":"standalone"];return c===!0?La(v,this._week.dow):c?v[c.day()]:v}function Og(c){return c===!0?La(this._weekdaysShort,this._week.dow):c?this._weekdaysShort[c.day()]:this._weekdaysShort}function Pg(c){return c===!0?La(this._weekdaysMin,this._week.dow):c?this._weekdaysMin[c.day()]:this._weekdaysMin}function Zu(c,p,v){var b,R,$,W=c.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],b=0;b<7;++b)$=S([2e3,1]).day(b),this._minWeekdaysParse[b]=this.weekdaysMin($,"").toLocaleLowerCase(),this._shortWeekdaysParse[b]=this.weekdaysShort($,"").toLocaleLowerCase(),this._weekdaysParse[b]=this.weekdays($,"").toLocaleLowerCase();return v?p==="dddd"?(R=St.call(this._weekdaysParse,W),R!==-1?R:null):p==="ddd"?(R=St.call(this._shortWeekdaysParse,W),R!==-1?R:null):(R=St.call(this._minWeekdaysParse,W),R!==-1?R:null):p==="dddd"?(R=St.call(this._weekdaysParse,W),R!==-1||(R=St.call(this._shortWeekdaysParse,W),R!==-1)?R:(R=St.call(this._minWeekdaysParse,W),R!==-1?R:null)):p==="ddd"?(R=St.call(this._shortWeekdaysParse,W),R!==-1||(R=St.call(this._weekdaysParse,W),R!==-1)?R:(R=St.call(this._minWeekdaysParse,W),R!==-1?R:null)):(R=St.call(this._minWeekdaysParse,W),R!==-1||(R=St.call(this._weekdaysParse,W),R!==-1)?R:(R=St.call(this._shortWeekdaysParse,W),R!==-1?R:null))}function kg(c,p,v){var b,R,$;if(this._weekdaysParseExact)return Zu.call(this,c,p,v);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),b=0;b<7;b++){if(R=S([2e3,1]).day(b),v&&!this._fullWeekdaysParse[b]&&(this._fullWeekdaysParse[b]=new RegExp("^"+this.weekdays(R,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[b]=new RegExp("^"+this.weekdaysShort(R,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[b]=new RegExp("^"+this.weekdaysMin(R,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[b]||($="^"+this.weekdays(R,"")+"|^"+this.weekdaysShort(R,"")+"|^"+this.weekdaysMin(R,""),this._weekdaysParse[b]=new RegExp($.replace(".",""),"i")),v&&p==="dddd"&&this._fullWeekdaysParse[b].test(c))return b;if(v&&p==="ddd"&&this._shortWeekdaysParse[b].test(c))return b;if(v&&p==="dd"&&this._minWeekdaysParse[b].test(c))return b;if(!v&&this._weekdaysParse[b].test(c))return b}}function Ag(c){if(!this.isValid())return c!=null?this:NaN;var p=yo(this,"Day");return c!=null?(c=Sd(c,this.localeData()),this.add(c-p,"d")):p}function Tg(c){if(!this.isValid())return c!=null?this:NaN;var p=(this.day()+7-this.localeData()._week.dow)%7;return c==null?p:this.add(c-p,"d")}function qg(c){if(!this.isValid())return c!=null?this:NaN;if(c!=null){var p=bd(c,this.localeData());return this.day(this.day()%7?p:p-7)}else return this.day()||7}function $g(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xu.call(this),c?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Cg),this._weekdaysStrictRegex&&c?this._weekdaysStrictRegex:this._weekdaysRegex)}function ft(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xu.call(this),c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ed),this._weekdaysShortStrictRegex&&c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function ot(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xu.call(this),c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Rg),this._weekdaysMinStrictRegex&&c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xu(){function c($t,Mn){return Mn.length-$t.length}var p=[],v=[],b=[],R=[],$,W,ie,ye,Me;for($=0;$<7;$++)W=S([2e3,1]).day($),ie=rn(this.weekdaysMin(W,"")),ye=rn(this.weekdaysShort(W,"")),Me=rn(this.weekdays(W,"")),p.push(ie),v.push(ye),b.push(Me),R.push(ie),R.push(ye),R.push(Me);p.sort(c),v.sort(c),b.sort(c),R.sort(c),this._weekdaysRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+v.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+p.join("|")+")","i")}function ec(){return this.hours()%12||12}function Mg(){return this.hours()||24}le("H",["HH",2],0,"hour"),le("h",["hh",2],0,ec),le("k",["kk",2],0,Mg),le("hmm",0,0,function(){return""+ec.apply(this)+Ie(this.minutes(),2)}),le("hmmss",0,0,function(){return""+ec.apply(this)+Ie(this.minutes(),2)+Ie(this.seconds(),2)}),le("Hmm",0,0,function(){return""+this.hours()+Ie(this.minutes(),2)}),le("Hmmss",0,0,function(){return""+this.hours()+Ie(this.minutes(),2)+Ie(this.seconds(),2)});function xd(c,p){le(c,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),p)})}xd("a",!0),xd("A",!1);function Cd(c,p){return p._meridiemParse}oe("a",Cd),oe("A",Cd),oe("H",it,Ta),oe("h",it,Pi),oe("k",it,Pi),oe("HH",it,Ft),oe("hh",it,Ft),oe("kk",it,Ft),oe("hmm",Pa),oe("hmmss",ka),oe("Hmm",Pa),oe("Hmmss",ka),Ge(["H","HH"],Ot),Ge(["k","kk"],function(c,p,v){var b=qe(c);p[Ot]=b===24?0:b}),Ge(["a","A"],function(c,p,v){v._isPm=v._locale.isPM(c),v._meridiem=c}),Ge(["h","hh"],function(c,p,v){p[Ot]=qe(c),x(v).bigHour=!0}),Ge("hmm",function(c,p,v){var b=c.length-2;p[Ot]=qe(c.substr(0,b)),p[Cr]=qe(c.substr(b)),x(v).bigHour=!0}),Ge("hmmss",function(c,p,v){var b=c.length-4,R=c.length-2;p[Ot]=qe(c.substr(0,b)),p[Cr]=qe(c.substr(b,2)),p[Pn]=qe(c.substr(R)),x(v).bigHour=!0}),Ge("Hmm",function(c,p,v){var b=c.length-2;p[Ot]=qe(c.substr(0,b)),p[Cr]=qe(c.substr(b))}),Ge("Hmmss",function(c,p,v){var b=c.length-4,R=c.length-2;p[Ot]=qe(c.substr(0,b)),p[Cr]=qe(c.substr(b,2)),p[Pn]=qe(c.substr(R))});function Ng(c){return(c+"").toLowerCase().charAt(0)==="p"}var Rd=/[ap]\.?m?\.?/i,Dg=cs("Hours",!0);function qt(c,p,v){return c>11?v?"pm":"PM":v?"am":"AM"}var ja={calendar:de,longDateFormat:en,invalidDate:ht,ordinal:uo,dayOfMonthOrdinalParse:Ht,relativeTime:ug,months:hd,monthsShort:Yu,week:Qu,weekdays:_d,weekdaysMin:xg,weekdaysShort:wd,meridiemParse:Rd},Qe={},hs={},Ai;function Rr(c,p){var v,b=Math.min(c.length,p.length);for(v=0;v<b;v+=1)if(c[v]!==p[v])return v;return b}function tc(c){return c&&c.toLowerCase().replace("_","-")}function Id(c){for(var p=0,v,b,R,$;p<c.length;){for($=tc(c[p]).split("-"),v=$.length,b=tc(c[p+1]),b=b?b.split("-"):null;v>0;){if(R=_o($.slice(0,v).join("-")),R)return R;if(b&&b.length>=v&&Rr($,b)>=v-1)break;v--}p++}return Ai}function Od(c){return!!(c&&c.match("^[^/\\\\]*$"))}function _o(c){var p=null,v;if(Qe[c]===void 0&&typeof Il<"u"&&Il&&Il.exports&&Od(c))try{p=Ai._abbr,v=require,v("./locale/"+c),kn(p)}catch{Qe[c]=null}return Qe[c]}function kn(c,p){var v;return c&&(u(p)?v=An(c):v=Ua(c,p),v?Ai=v:typeof console<"u"&&console.warn&&console.warn("Locale "+c+" not found. Did you forget to load it?")),Ai._abbr}function Ua(c,p){if(p!==null){var v,b=ja;if(p.abbr=c,Qe[c]!=null)N("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),b=Qe[c]._config;else if(p.parentLocale!=null)if(Qe[p.parentLocale]!=null)b=Qe[p.parentLocale]._config;else if(v=_o(p.parentLocale),v!=null)b=v._config;else return hs[p.parentLocale]||(hs[p.parentLocale]=[]),hs[p.parentLocale].push({name:c,config:p}),null;return Qe[c]=new Z(z(b,p)),hs[c]&&hs[c].forEach(function(R){Ua(R.name,R.config)}),kn(c),Qe[c]}else return delete Qe[c],null}function hr(c,p){if(p!=null){var v,b,R=ja;Qe[c]!=null&&Qe[c].parentLocale!=null?Qe[c].set(z(Qe[c]._config,p)):(b=_o(c),b!=null&&(R=b._config),p=z(R,p),b==null&&(p.abbr=c),v=new Z(p),v.parentLocale=Qe[c],Qe[c]=v),kn(c)}else Qe[c]!=null&&(Qe[c].parentLocale!=null?(Qe[c]=Qe[c].parentLocale,c===kn()&&kn(c)):Qe[c]!=null&&delete Qe[c]);return Qe[c]}function An(c){var p;if(c&&c._locale&&c._locale._abbr&&(c=c._locale._abbr),!c)return Ai;if(!n(c)){if(p=_o(c),p)return p;c=[c]}return Id(c)}function pr(){return ae(Qe)}function rc(c){var p,v=c._a;return v&&x(c).overflow===-2&&(p=v[On]<0||v[On]>11?On:v[nn]<1||v[nn]>Wu(v[Wt],v[On])?nn:v[Ot]<0||v[Ot]>24||v[Ot]===24&&(v[Cr]!==0||v[Pn]!==0||v[ki]!==0)?Ot:v[Cr]<0||v[Cr]>59?Cr:v[Pn]<0||v[Pn]>59?Pn:v[ki]<0||v[ki]>999?ki:-1,x(c)._overflowDayOfYear&&(p<Wt||p>nn)&&(p=nn),x(c)._overflowWeeks&&p===-1&&(p=fd),x(c)._overflowWeekday&&p===-1&&(p=hg),x(c).overflow=p),c}var Pd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ii=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ba=/Z|[+-]\d\d(?::?\d\d)?/,ps=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],at=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],si=/^\/?Date\((-?\d+)/i,nc=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Fg={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ha(c){var p,v,b=c._i,R=Pd.exec(b)||ii.exec(b),$,W,ie,ye,Me=ps.length,$t=at.length;if(R){for(x(c).iso=!0,p=0,v=Me;p<v;p++)if(ps[p][1].exec(R[1])){W=ps[p][0],$=ps[p][2]!==!1;break}if(W==null){c._isValid=!1;return}if(R[3]){for(p=0,v=$t;p<v;p++)if(at[p][1].exec(R[3])){ie=(R[2]||" ")+at[p][0];break}if(ie==null){c._isValid=!1;return}}if(!$&&ie!=null){c._isValid=!1;return}if(R[4])if(Ba.exec(R[4]))ye="Z";else{c._isValid=!1;return}c._f=W+(ie||"")+(ye||""),Wa(c)}else c._isValid=!1}function Lg(c,p,v,b,R,$){var W=[jg(c),Yu.indexOf(p),parseInt(v,10),parseInt(b,10),parseInt(R,10)];return $&&W.push(parseInt($,10)),W}function jg(c){var p=parseInt(c,10);return p<=49?2e3+p:p<=999?1900+p:p}function Ug(c){return c.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function kd(c,p,v){if(c){var b=wd.indexOf(c),R=new Date(p[0],p[1],p[2]).getDay();if(b!==R)return x(v).weekdayMismatch=!0,v._isValid=!1,!1}return!0}function Va(c,p,v){if(c)return Fg[c];if(p)return 0;var b=parseInt(v,10),R=b%100,$=(b-R)/100;return $*60+R}function Ti(c){var p=nc.exec(Ug(c._i)),v;if(p){if(v=Lg(p[4],p[3],p[2],p[5],p[6],p[7]),!kd(p[1],v,c))return;c._a=v,c._tzm=Va(p[8],p[9],p[10]),c._d=fs.apply(null,c._a),c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),x(c).rfc2822=!0}else c._isValid=!1}function Bg(c){var p=si.exec(c._i);if(p!==null){c._d=new Date(+p[1]);return}if(Ha(c),c._isValid===!1)delete c._isValid;else return;if(Ti(c),c._isValid===!1)delete c._isValid;else return;c._strict?c._isValid=!1:e.createFromInputFallback(c)}e.createFromInputFallback=w("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(c){c._d=new Date(c._i+(c._useUTC?" UTC":""))});function qi(c,p,v){return c??p??v}function Ad(c){var p=new Date(e.now());return c._useUTC?[p.getUTCFullYear(),p.getUTCMonth(),p.getUTCDate()]:[p.getFullYear(),p.getMonth(),p.getDate()]}function wo(c){var p,v,b=[],R,$,W;if(!c._d){for(R=Ad(c),c._w&&c._a[nn]==null&&c._a[On]==null&&ic(c),c._dayOfYear!=null&&(W=qi(c._a[Wt],R[Wt]),(c._dayOfYear>go(W)||c._dayOfYear===0)&&(x(c)._overflowDayOfYear=!0),v=fs(W,0,c._dayOfYear),c._a[On]=v.getUTCMonth(),c._a[nn]=v.getUTCDate()),p=0;p<3&&c._a[p]==null;++p)c._a[p]=b[p]=R[p];for(;p<7;p++)c._a[p]=b[p]=c._a[p]==null?p===2?1:0:c._a[p];c._a[Ot]===24&&c._a[Cr]===0&&c._a[Pn]===0&&c._a[ki]===0&&(c._nextDay=!0,c._a[Ot]=0),c._d=(c._useUTC?fs:wg).apply(null,b),$=c._useUTC?c._d.getUTCDay():c._d.getDay(),c._tzm!=null&&c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),c._nextDay&&(c._a[Ot]=24),c._w&&typeof c._w.d<"u"&&c._w.d!==$&&(x(c).weekdayMismatch=!0)}}function ic(c){var p,v,b,R,$,W,ie,ye,Me;p=c._w,p.GG!=null||p.W!=null||p.E!=null?($=1,W=4,v=qi(p.GG,c._a[Wt],bo(Xe(),1,4).year),b=qi(p.W,1),R=qi(p.E,1),(R<1||R>7)&&(ye=!0)):($=c._locale._week.dow,W=c._locale._week.doy,Me=bo(Xe(),$,W),v=qi(p.gg,c._a[Wt],Me.year),b=qi(p.w,Me.week),p.d!=null?(R=p.d,(R<0||R>6)&&(ye=!0)):p.e!=null?(R=p.e+$,(p.e<0||p.e>6)&&(ye=!0)):R=$),b<1||b>sn(v,$,W)?x(c)._overflowWeeks=!0:ye!=null?x(c)._overflowWeekday=!0:(ie=Fa(v,b,R,$,W),c._a[Wt]=ie.year,c._dayOfYear=ie.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Wa(c){if(c._f===e.ISO_8601){Ha(c);return}if(c._f===e.RFC_2822){Ti(c);return}c._a=[],x(c).empty=!0;var p=""+c._i,v,b,R,$,W,ie=p.length,ye=0,Me,$t;for(R=Cn(c._f,c._locale).match(ge)||[],$t=R.length,v=0;v<$t;v++)$=R[v],b=(p.match(fg($,c))||[])[0],b&&(W=p.substr(0,p.indexOf(b)),W.length>0&&x(c).unusedInput.push(W),p=p.slice(p.indexOf(b)+b.length),ye+=b.length),Tt[$]?(b?x(c).empty=!1:x(c).unusedTokens.push($),Vu($,b,c)):c._strict&&!b&&x(c).unusedTokens.push($);x(c).charsLeftOver=ie-ye,p.length>0&&x(c).unusedInput.push(p),c._a[Ot]<=12&&x(c).bigHour===!0&&c._a[Ot]>0&&(x(c).bigHour=void 0),x(c).parsedDateParts=c._a.slice(0),x(c).meridiem=c._meridiem,c._a[Ot]=Hg(c._locale,c._a[Ot],c._meridiem),Me=x(c).era,Me!==null&&(c._a[Wt]=c._locale.erasConvertYear(Me,c._a[Wt])),wo(c),rc(c)}function Hg(c,p,v){var b;return v==null?p:c.meridiemHour!=null?c.meridiemHour(p,v):(c.isPM!=null&&(b=c.isPM(v),b&&p<12&&(p+=12),!b&&p===12&&(p=0)),p)}function sc(c){var p,v,b,R,$,W,ie=!1,ye=c._f.length;if(ye===0){x(c).invalidFormat=!0,c._d=new Date(NaN);return}for(R=0;R<ye;R++)$=0,W=!1,p=H({},c),c._useUTC!=null&&(p._useUTC=c._useUTC),p._f=c._f[R],Wa(p),A(p)&&(W=!0),$+=x(p).charsLeftOver,$+=x(p).unusedTokens.length*10,x(p).score=$,ie?$<b&&(b=$,v=p):(b==null||$<b||W)&&(b=$,v=p,W&&(ie=!0));m(c,v||p)}function oc(c){if(!c._d){var p=dr(c._i),v=p.day===void 0?p.date:p.day;c._a=g([p.year,p.month,v,p.hour,p.minute,p.second,p.millisecond],function(b){return b&&parseInt(b,10)}),wo(c)}}function Vg(c){var p=new K(rc(ac(c)));return p._nextDay&&(p.add(1,"d"),p._nextDay=void 0),p}function ac(c){var p=c._i,v=c._f;return c._locale=c._locale||An(c._l),p===null||v===void 0&&p===""?T({nullInput:!0}):(typeof p=="string"&&(c._i=p=c._locale.preparse(p)),X(p)?new K(rc(p)):(h(p)?c._d=p:n(v)?sc(c):v?Wa(c):mr(c),A(c)||(c._d=null),c))}function mr(c){var p=c._i;u(p)?c._d=new Date(e.now()):h(p)?c._d=new Date(p.valueOf()):typeof p=="string"?Bg(c):n(p)?(c._a=g(p.slice(0),function(v){return parseInt(v,10)}),wo(c)):i(p)?oc(c):f(p)?c._d=new Date(p):e.createFromInputFallback(c)}function Ya(c,p,v,b,R){var $={};return(p===!0||p===!1)&&(b=p,p=void 0),(v===!0||v===!1)&&(b=v,v=void 0),(i(c)&&a(c)||n(c)&&c.length===0)&&(c=void 0),$._isAMomentObject=!0,$._useUTC=$._isUTC=R,$._l=v,$._i=c,$._f=p,$._strict=b,Vg($)}function Xe(c,p,v,b){return Ya(c,p,v,b,!1)}var Td=w("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=Xe.apply(null,arguments);return this.isValid()&&c.isValid()?c<this?this:c:T()}),qd=w("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=Xe.apply(null,arguments);return this.isValid()&&c.isValid()?c>this?this:c:T()});function $d(c,p){var v,b;if(p.length===1&&n(p[0])&&(p=p[0]),!p.length)return Xe();for(v=p[0],b=1;b<p.length;++b)(!p[b].isValid()||p[b][c](v))&&(v=p[b]);return v}function Wg(){var c=[].slice.call(arguments,0);return $d("isBefore",c)}function Yg(){var c=[].slice.call(arguments,0);return $d("isAfter",c)}var Jg=function(){return Date.now?Date.now():+new Date},Eo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function ms(c){var p,v=!1,b,R=Eo.length;for(p in c)if(s(c,p)&&!(St.call(Eo,p)!==-1&&(c[p]==null||!isNaN(c[p]))))return!1;for(b=0;b<R;++b)if(c[Eo[b]]){if(v)return!1;parseFloat(c[Eo[b]])!==qe(c[Eo[b]])&&(v=!0)}return!0}function zg(){return this._isValid}function Kg(){return et(NaN)}function gs(c){var p=dr(c),v=p.year||0,b=p.quarter||0,R=p.month||0,$=p.week||p.isoWeek||0,W=p.day||0,ie=p.hour||0,ye=p.minute||0,Me=p.second||0,$t=p.millisecond||0;this._isValid=ms(p),this._milliseconds=+$t+Me*1e3+ye*6e4+ie*1e3*60*60,this._days=+W+$*7,this._months=+R+b*3+v*12,this._data={},this._locale=An(),this._bubble()}function xo(c){return c instanceof gs}function on(c){return c<0?Math.round(-1*c)*-1:Math.round(c)}function Ja(c,p,v){var b=Math.min(c.length,p.length),R=Math.abs(c.length-p.length),$=0,W;for(W=0;W<b;W++)(v&&c[W]!==p[W]||!v&&qe(c[W])!==qe(p[W]))&&$++;return $+R}function Md(c,p){le(c,0,0,function(){var v=this.utcOffset(),b="+";return v<0&&(v=-v,b="-"),b+Ie(~~(v/60),2)+p+Ie(~~v%60,2)})}Md("Z",":"),Md("ZZ",""),oe("Z",Aa),oe("ZZ",Aa),Ge(["Z","ZZ"],function(c,p,v){v._useUTC=!0,v._tzm=lc(Aa,c)});var Gg=/([\+\-]|\d\d)/gi;function lc(c,p){var v=(p||"").match(c),b,R,$;return v===null?null:(b=v[v.length-1]||[],R=(b+"").match(Gg)||["-",0,0],$=+(R[1]*60)+qe(R[2]),$===0?0:R[0]==="+"?$:-$)}function oi(c,p){var v,b;return p._isUTC?(v=p.clone(),b=(X(c)||h(c)?c.valueOf():Xe(c).valueOf())-v.valueOf(),v._d.setTime(v._d.valueOf()+b),e.updateOffset(v,!1),v):Xe(c).local()}function gr(c){return-Math.round(c._d.getTimezoneOffset())}e.updateOffset=function(){};function Nd(c,p,v){var b=this._offset||0,R;if(!this.isValid())return c!=null?this:NaN;if(c!=null){if(typeof c=="string"){if(c=lc(Aa,c),c===null)return this}else Math.abs(c)<16&&!v&&(c=c*60);return!this._isUTC&&p&&(R=gr(this)),this._offset=c,this._isUTC=!0,R!=null&&this.add(R,"m"),b!==c&&(!p||this._changeInProgress?Co(this,et(c-b,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?b:gr(this)}function Qg(c,p){return c!=null?(typeof c!="string"&&(c=-c),this.utcOffset(c,p),this):-this.utcOffset()}function Zg(c){return this.utcOffset(0,c)}function Xg(c){return this._isUTC&&(this.utcOffset(0,c),this._isUTC=!1,c&&this.subtract(gr(this),"m")),this}function ey(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var c=lc(Bu,this._i);c!=null?this.utcOffset(c):this.utcOffset(0,!0)}return this}function ty(c){return this.isValid()?(c=c?Xe(c).utcOffset():0,(this.utcOffset()-c)%60===0):!1}function ai(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function j(){if(!u(this._isDSTShifted))return this._isDSTShifted;var c={},p;return H(c,this),c=ac(c),c._a?(p=c._isUTC?S(c._a):Xe(c._a),this._isDSTShifted=this.isValid()&&Ja(c._a,p.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function J(){return this.isValid()?!this._isUTC:!1}function V(){return this.isValid()?this._isUTC:!1}function se(){return this.isValid()?this._isUTC&&this._offset===0:!1}var ve=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,ze=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function et(c,p){var v=c,b=null,R,$,W;return xo(c)?v={ms:c._milliseconds,d:c._days,M:c._months}:f(c)||!isNaN(+c)?(v={},p?v[p]=+c:v.milliseconds=+c):(b=ve.exec(c))?(R=b[1]==="-"?-1:1,v={y:0,d:qe(b[nn])*R,h:qe(b[Ot])*R,m:qe(b[Cr])*R,s:qe(b[Pn])*R,ms:qe(on(b[ki]*1e3))*R}):(b=ze.exec(c))?(R=b[1]==="-"?-1:1,v={y:Ue(b[2],R),M:Ue(b[3],R),w:Ue(b[4],R),d:Ue(b[5],R),h:Ue(b[6],R),m:Ue(b[7],R),s:Ue(b[8],R)}):v==null?v={}:typeof v=="object"&&("from"in v||"to"in v)&&(W=ry(Xe(v.from),Xe(v.to)),v={},v.ms=W.milliseconds,v.M=W.months),$=new gs(v),xo(c)&&s(c,"_locale")&&($._locale=c._locale),xo(c)&&s(c,"_isValid")&&($._isValid=c._isValid),$}et.fn=gs.prototype,et.invalid=Kg;function Ue(c,p){var v=c&&parseFloat(c.replace(",","."));return(isNaN(v)?0:v)*p}function za(c,p){var v={};return v.months=p.month()-c.month()+(p.year()-c.year())*12,c.clone().add(v.months,"M").isAfter(p)&&--v.months,v.milliseconds=+p-+c.clone().add(v.months,"M"),v}function ry(c,p){var v;return c.isValid()&&p.isValid()?(p=oi(p,c),c.isBefore(p)?v=za(c,p):(v=za(p,c),v.milliseconds=-v.milliseconds,v.months=-v.months),v):{milliseconds:0,months:0}}function yr(c,p){return function(v,b){var R,$;return b!==null&&!isNaN(+b)&&(N(p,"moment()."+p+"(period, number) is deprecated. Please use moment()."+p+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),$=v,v=b,b=$),R=et(v,b),Co(this,R,c),this}}function Co(c,p,v,b){var R=p._milliseconds,$=on(p._days),W=on(p._months);c.isValid()&&(b=b??!0,W&&zu(c,yo(c,"Month")+W*v),$&&vo(c,"Date",yo(c,"Date")+$*v),R&&c._d.setTime(c._d.valueOf()+R*v),b&&e.updateOffset(c,$||W))}var ny=yr(1,"add"),ys=yr(-1,"subtract");function Ro(c){return typeof c=="string"||c instanceof String}function Ka(c){return X(c)||h(c)||Ro(c)||f(c)||iy(c)||Ze(c)||c===null||c===void 0}function Ze(c){var p=i(c)&&!a(c),v=!1,b=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],R,$,W=b.length;for(R=0;R<W;R+=1)$=b[R],v=v||s(c,$);return p&&v}function iy(c){var p=n(c),v=!1;return p&&(v=c.filter(function(b){return!f(b)&&Ro(c)}).length===0),p&&v}function Dd(c){var p=i(c)&&!a(c),v=!1,b=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],R,$;for(R=0;R<b.length;R+=1)$=b[R],v=v||s(c,$);return p&&v}function Ga(c,p){var v=c.diff(p,"days",!0);return v<-6?"sameElse":v<-1?"lastWeek":v<0?"lastDay":v<1?"sameDay":v<2?"nextDay":v<7?"nextWeek":"sameElse"}function sy(c,p){arguments.length===1&&(arguments[0]?Ka(arguments[0])?(c=arguments[0],p=void 0):Dd(arguments[0])&&(p=arguments[0],c=void 0):(c=void 0,p=void 0));var v=c||Xe(),b=oi(v,this).startOf("day"),R=e.calendarFormat(this,b)||"sameElse",$=p&&(D(p[R])?p[R].call(this,v):p[R]);return this.format($||this.localeData().calendar(R,this,Xe(v)))}function oy(){return new K(this)}function ay(c,p){var v=X(c)?c:Xe(c);return this.isValid()&&v.isValid()?(p=Vt(p)||"millisecond",p==="millisecond"?this.valueOf()>v.valueOf():v.valueOf()<this.clone().startOf(p).valueOf()):!1}function Qa(c,p){var v=X(c)?c:Xe(c);return this.isValid()&&v.isValid()?(p=Vt(p)||"millisecond",p==="millisecond"?this.valueOf()<v.valueOf():this.clone().endOf(p).valueOf()<v.valueOf()):!1}function li(c,p,v,b){var R=X(c)?c:Xe(c),$=X(p)?p:Xe(p);return this.isValid()&&R.isValid()&&$.isValid()?(b=b||"()",(b[0]==="("?this.isAfter(R,v):!this.isBefore(R,v))&&(b[1]===")"?this.isBefore($,v):!this.isAfter($,v))):!1}function Za(c,p){var v=X(c)?c:Xe(c),b;return this.isValid()&&v.isValid()?(p=Vt(p)||"millisecond",p==="millisecond"?this.valueOf()===v.valueOf():(b=v.valueOf(),this.clone().startOf(p).valueOf()<=b&&b<=this.clone().endOf(p).valueOf())):!1}function Fd(c,p){return this.isSame(c,p)||this.isAfter(c,p)}function Xa(c,p){return this.isSame(c,p)||this.isBefore(c,p)}function Ld(c,p,v){var b,R,$;if(!this.isValid())return NaN;if(b=oi(c,this),!b.isValid())return NaN;switch(R=(b.utcOffset()-this.utcOffset())*6e4,p=Vt(p),p){case"year":$=Io(this,b)/12;break;case"month":$=Io(this,b);break;case"quarter":$=Io(this,b)/3;break;case"second":$=(this-b)/1e3;break;case"minute":$=(this-b)/6e4;break;case"hour":$=(this-b)/36e5;break;case"day":$=(this-b-R)/864e5;break;case"week":$=(this-b-R)/6048e5;break;default:$=this-b}return v?$:xr($)}function Io(c,p){if(c.date()<p.date())return-Io(p,c);var v=(p.year()-c.year())*12+(p.month()-c.month()),b=c.clone().add(v,"months"),R,$;return p-b<0?(R=c.clone().add(v-1,"months"),$=(p-b)/(b-R)):(R=c.clone().add(v+1,"months"),$=(p-b)/(R-b)),-(v+$)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function el(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function jd(c){if(!this.isValid())return null;var p=c!==!0,v=p?this.clone().utc():this;return v.year()<0||v.year()>9999?Et(v,p?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):D(Date.prototype.toISOString)?p?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Et(v,"Z")):Et(v,p?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Oo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var c="moment",p="",v,b,R,$;return this.isLocal()||(c=this.utcOffset()===0?"moment.utc":"moment.parseZone",p="Z"),v="["+c+'("]',b=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",R="-MM-DD[T]HH:mm:ss.SSS",$=p+'[")]',this.format(v+b+R+$)}function $i(c){c||(c=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var p=Et(this,c);return this.localeData().postformat(p)}function tl(c,p){return this.isValid()&&(X(c)&&c.isValid()||Xe(c).isValid())?et({to:this,from:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function ly(c){return this.from(Xe(),c)}function uy(c,p){return this.isValid()&&(X(c)&&c.isValid()||Xe(c).isValid())?et({from:this,to:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function cy(c){return this.to(Xe(),c)}function Po(c){var p;return c===void 0?this._locale._abbr:(p=An(c),p!=null&&(this._locale=p),this)}var ko=w("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(c){return c===void 0?this.localeData():this.locale(c)});function rl(){return this._locale}var nl=1e3,Mi=60*nl,il=60*Mi,Ud=(365*400+97)*24*il;function pt(c,p){return(c%p+p)%p}function Lt(c,p,v){return c<100&&c>=0?new Date(c+400,p,v)-Ud:new Date(c,p,v).valueOf()}function Bd(c,p,v){return c<100&&c>=0?Date.UTC(c+400,p,v)-Ud:Date.UTC(c,p,v)}function fy(c){var p,v;if(c=Vt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(v=this._isUTC?Bd:Lt,c){case"year":p=v(this.year(),0,1);break;case"quarter":p=v(this.year(),this.month()-this.month()%3,1);break;case"month":p=v(this.year(),this.month(),1);break;case"week":p=v(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":p=v(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":p=v(this.year(),this.month(),this.date());break;case"hour":p=this._d.valueOf(),p-=pt(p+(this._isUTC?0:this.utcOffset()*Mi),il);break;case"minute":p=this._d.valueOf(),p-=pt(p,Mi);break;case"second":p=this._d.valueOf(),p-=pt(p,nl);break}return this._d.setTime(p),e.updateOffset(this,!0),this}function Hd(c){var p,v;if(c=Vt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(v=this._isUTC?Bd:Lt,c){case"year":p=v(this.year()+1,0,1)-1;break;case"quarter":p=v(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":p=v(this.year(),this.month()+1,1)-1;break;case"week":p=v(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":p=v(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":p=v(this.year(),this.month(),this.date()+1)-1;break;case"hour":p=this._d.valueOf(),p+=il-pt(p+(this._isUTC?0:this.utcOffset()*Mi),il)-1;break;case"minute":p=this._d.valueOf(),p+=Mi-pt(p,Mi)-1;break;case"second":p=this._d.valueOf(),p+=nl-pt(p,nl)-1;break}return this._d.setTime(p),e.updateOffset(this,!0),this}function dy(){return this._d.valueOf()-(this._offset||0)*6e4}function uc(){return Math.floor(this.valueOf()/1e3)}function Ao(){return new Date(this.valueOf())}function cc(){var c=this;return[c.year(),c.month(),c.date(),c.hour(),c.minute(),c.second(),c.millisecond()]}function vs(){var c=this;return{years:c.year(),months:c.month(),date:c.date(),hours:c.hours(),minutes:c.minutes(),seconds:c.seconds(),milliseconds:c.milliseconds()}}function To(){return this.isValid()?this.toISOString():null}function qo(){return A(this)}function sl(){return m({},x(this))}function Ss(){return x(this).overflow}function hy(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}le("N",0,0,"eraAbbr"),le("NN",0,0,"eraAbbr"),le("NNN",0,0,"eraAbbr"),le("NNNN",0,0,"eraName"),le("NNNNN",0,0,"eraNarrow"),le("y",["y",1],"yo","eraYear"),le("y",["yy",2],0,"eraYear"),le("y",["yyy",3],0,"eraYear"),le("y",["yyyy",4],0,"eraYear"),oe("N",tr),oe("NN",tr),oe("NNN",tr),oe("NNNN",$e),oe("NNNNN",vy),Ge(["N","NN","NNN","NNNN","NNNNN"],function(c,p,v,b){var R=v._locale.erasParse(c,b,v._strict);R?x(v).era=R:x(v).invalidEra=c}),oe("y",ni),oe("yy",ni),oe("yyy",ni),oe("yyyy",ni),oe("yo",Sy),Ge(["y","yy","yyy","yyyy"],Wt),Ge(["yo"],function(c,p,v,b){var R;v._locale._eraYearOrdinalRegex&&(R=c.match(v._locale._eraYearOrdinalRegex)),v._locale.eraYearOrdinalParse?p[Wt]=v._locale.eraYearOrdinalParse(c,R):p[Wt]=parseInt(c,10)});function py(c,p){var v,b,R,$=this._eras||An("en")._eras;for(v=0,b=$.length;v<b;++v)switch(typeof $[v].since==="string"&&(R=e($[v].since).startOf("day"),$[v].since=R.valueOf()),typeof $[v].until){case"undefined":$[v].until=1/0;break;case"string":R=e($[v].until).startOf("day").valueOf(),$[v].until=R.valueOf();break}return $}function my(c,p,v){var b,R,$=this.eras(),W,ie,ye;for(c=c.toUpperCase(),b=0,R=$.length;b<R;++b)if(W=$[b].name.toUpperCase(),ie=$[b].abbr.toUpperCase(),ye=$[b].narrow.toUpperCase(),v)switch(p){case"N":case"NN":case"NNN":if(ie===c)return $[b];break;case"NNNN":if(W===c)return $[b];break;case"NNNNN":if(ye===c)return $[b];break}else if([W,ie,ye].indexOf(c)>=0)return $[b]}function gy(c,p){var v=c.since<=c.until?1:-1;return p===void 0?e(c.since).year():e(c.since).year()+(p-c.offset)*v}function yy(){var c,p,v,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(v=this.clone().startOf("day").valueOf(),b[c].since<=v&&v<=b[c].until||b[c].until<=v&&v<=b[c].since)return b[c].name;return""}function ol(){var c,p,v,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(v=this.clone().startOf("day").valueOf(),b[c].since<=v&&v<=b[c].until||b[c].until<=v&&v<=b[c].since)return b[c].narrow;return""}function $o(){var c,p,v,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(v=this.clone().startOf("day").valueOf(),b[c].since<=v&&v<=b[c].until||b[c].until<=v&&v<=b[c].since)return b[c].abbr;return""}function Vd(){var c,p,v,b,R=this.localeData().eras();for(c=0,p=R.length;c<p;++c)if(v=R[c].since<=R[c].until?1:-1,b=this.clone().startOf("day").valueOf(),R[c].since<=b&&b<=R[c].until||R[c].until<=b&&b<=R[c].since)return(this.year()-e(R[c].since).year())*v+R[c].offset;return this.year()}function I(c){return s(this,"_erasNameRegex")||fc.call(this),c?this._erasNameRegex:this._erasRegex}function bs(c){return s(this,"_erasAbbrRegex")||fc.call(this),c?this._erasAbbrRegex:this._erasRegex}function al(c){return s(this,"_erasNarrowRegex")||fc.call(this),c?this._erasNarrowRegex:this._erasRegex}function tr(c,p){return p.erasAbbrRegex(c)}function $e(c,p){return p.erasNameRegex(c)}function vy(c,p){return p.erasNarrowRegex(c)}function Sy(c,p){return p._eraYearOrdinalRegex||ni}function fc(){var c=[],p=[],v=[],b=[],R,$,W,ie,ye,Me=this.eras();for(R=0,$=Me.length;R<$;++R)W=rn(Me[R].name),ie=rn(Me[R].abbr),ye=rn(Me[R].narrow),p.push(W),c.push(ie),v.push(ye),b.push(W),b.push(ie),b.push(ye);this._erasRegex=new RegExp("^("+b.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+p.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+c.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+v.join("|")+")","i")}le(0,["gg",2],0,function(){return this.weekYear()%100}),le(0,["GG",2],0,function(){return this.isoWeekYear()%100});function an(c,p){le(0,[c,c.length],0,p)}an("gggg","weekYear"),an("ggggg","weekYear"),an("GGGG","isoWeekYear"),an("GGGGG","isoWeekYear"),oe("G",us),oe("g",us),oe("GG",it,Ft),oe("gg",it,Ft),oe("GGGG",ho,Oi),oe("gggg",ho,Oi),oe("GGGGG",ls,In),oe("ggggg",ls,In),mo(["gggg","ggggg","GGGG","GGGGG"],function(c,p,v,b){p[b.substr(0,2)]=qe(c)}),mo(["gg","GG"],function(c,p,v,b){p[b]=e.parseTwoDigitYear(c)});function by(c){return Wd.call(this,c,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function _y(c){return Wd.call(this,c,this.isoWeek(),this.isoWeekday(),1,4)}function wy(){return sn(this.year(),1,4)}function Ey(){return sn(this.isoWeekYear(),1,4)}function xy(){var c=this.localeData()._week;return sn(this.year(),c.dow,c.doy)}function Tn(){var c=this.localeData()._week;return sn(this.weekYear(),c.dow,c.doy)}function Wd(c,p,v,b,R){var $;return c==null?bo(this,b,R).year:($=sn(c,b,R),p>$&&(p=$),Cy.call(this,c,p,v,b,R))}function Cy(c,p,v,b,R){var $=Fa(c,p,v,b,R),W=fs($.year,0,$.dayOfYear);return this.year(W.getUTCFullYear()),this.month(W.getUTCMonth()),this.date(W.getUTCDate()),this}le("Q",0,"Qo","quarter"),oe("Q",ud),Ge("Q",function(c,p){p[On]=(qe(c)-1)*3});function Ry(c){return c==null?Math.ceil((this.month()+1)/3):this.month((c-1)*3+this.month()%3)}le("D",["DD",2],"Do","date"),oe("D",it,Pi),oe("DD",it,Ft),oe("Do",function(c,p){return c?p._dayOfMonthOrdinalParse||p._ordinalParse:p._dayOfMonthOrdinalParseLenient}),Ge(["D","DD"],nn),Ge("Do",function(c,p){p[nn]=qe(c.match(it)[0])});var Yd=cs("Date",!0);le("DDD",["DDDD",3],"DDDo","dayOfYear"),oe("DDD",as),oe("DDDD",cd),Ge(["DDD","DDDD"],function(c,p,v){v._dayOfYear=qe(c)});function Iy(c){var p=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return c==null?p:this.add(c-p,"d")}le("m",["mm",2],0,"minute"),oe("m",it,Ta),oe("mm",it,Ft),Ge(["m","mm"],Cr);var qn=cs("Minutes",!1);le("s",["ss",2],0,"second"),oe("s",it,Ta),oe("ss",it,Ft),Ge(["s","ss"],Pn);var Oy=cs("Seconds",!1);le("S",0,0,function(){return~~(this.millisecond()/100)}),le(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),le(0,["SSS",3],0,"millisecond"),le(0,["SSSS",4],0,function(){return this.millisecond()*10}),le(0,["SSSSS",5],0,function(){return this.millisecond()*100}),le(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),le(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),le(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),le(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),oe("S",as,ud),oe("SS",as,Ft),oe("SSS",as,cd);var ui,Jd;for(ui="SSSS";ui.length<=9;ui+="S")oe(ui,ni);function Py(c,p){p[ki]=qe(("0."+c)*1e3)}for(ui="S";ui.length<=9;ui+="S")Ge(ui,Py);Jd=cs("Milliseconds",!1),le("z",0,0,"zoneAbbr"),le("zz",0,0,"zoneName");function ky(){return this._isUTC?"UTC":""}function Ni(){return this._isUTC?"Coordinated Universal Time":""}var te=K.prototype;te.add=ny,te.calendar=sy,te.clone=oy,te.diff=Ld,te.endOf=Hd,te.format=$i,te.from=tl,te.fromNow=ly,te.to=uy,te.toNow=cy,te.get=mg,te.invalidAt=Ss,te.isAfter=ay,te.isBefore=Qa,te.isBetween=li,te.isSame=Za,te.isSameOrAfter=Fd,te.isSameOrBefore=Xa,te.isValid=qo,te.lang=ko,te.locale=Po,te.localeData=rl,te.max=qd,te.min=Td,te.parsingFlags=sl,te.set=Ma,te.startOf=fy,te.subtract=ys,te.toArray=cc,te.toObject=vs,te.toDate=Ao,te.toISOString=jd,te.inspect=Oo,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=To,te.toString=el,te.unix=uc,te.valueOf=dy,te.creationData=hy,te.eraName=yy,te.eraNarrow=ol,te.eraAbbr=$o,te.eraYear=Vd,te.year=dd,te.isLeapYear=pg,te.weekYear=by,te.isoWeekYear=_y,te.quarter=te.quarters=Ry,te.month=Na,te.daysInMonth=_g,te.week=te.weeks=vd,te.isoWeek=te.isoWeeks=Eg,te.weeksInYear=xy,te.weeksInWeekYear=Tn,te.isoWeeksInYear=wy,te.isoWeeksInISOWeekYear=Ey,te.date=Yd,te.day=te.days=Ag,te.weekday=Tg,te.isoWeekday=qg,te.dayOfYear=Iy,te.hour=te.hours=Dg,te.minute=te.minutes=qn,te.second=te.seconds=Oy,te.millisecond=te.milliseconds=Jd,te.utcOffset=Nd,te.utc=Zg,te.local=Xg,te.parseZone=ey,te.hasAlignedHourOffset=ty,te.isDST=ai,te.isLocal=J,te.isUtcOffset=V,te.isUtc=se,te.isUTC=se,te.zoneAbbr=ky,te.zoneName=Ni,te.dates=w("dates accessor is deprecated. Use date instead.",Yd),te.months=w("months accessor is deprecated. Use month instead",Na),te.years=w("years accessor is deprecated. Use year instead",dd),te.zone=w("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Qg),te.isDSTShifted=w("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",j);function Ay(c){return Xe(c*1e3)}function Br(){return Xe.apply(null,arguments).parseZone()}function zd(c){return c}var Ve=Z.prototype;Ve.calendar=nt,Ve.longDateFormat=er,Ve.invalidDate=tn,Ve.ordinal=co,Ve.preparse=zd,Ve.postformat=zd,Ve.relativeTime=Rn,Ve.pastFuture=ad,Ve.set=L,Ve.eras=py,Ve.erasParse=my,Ve.erasConvertYear=gy,Ve.erasAbbrRegex=bs,Ve.erasNameRegex=I,Ve.erasNarrowRegex=al,Ve.months=Sg,Ve.monthsShort=bg,Ve.monthsParse=md,Ve.monthsRegex=Da,Ve.monthsShortRegex=gd,Ve.week=Gu,Ve.firstDayOfYear=yd,Ve.firstDayOfWeek=ds,Ve.weekdays=Ig,Ve.weekdaysMin=Pg,Ve.weekdaysShort=Og,Ve.weekdaysParse=kg,Ve.weekdaysRegex=$g,Ve.weekdaysShortRegex=ft,Ve.weekdaysMinRegex=ot,Ve.isPM=Ng,Ve.meridiem=qt;function ll(c,p,v,b){var R=An(),$=S().set(b,p);return R[v]($,c)}function Kd(c,p,v){if(f(c)&&(p=c,c=void 0),c=c||"",p!=null)return ll(c,p,v,"month");var b,R=[];for(b=0;b<12;b++)R[b]=ll(c,b,v,"month");return R}function dc(c,p,v,b){typeof c=="boolean"?(f(p)&&(v=p,p=void 0),p=p||""):(p=c,v=p,c=!1,f(p)&&(v=p,p=void 0),p=p||"");var R=An(),$=c?R._week.dow:0,W,ie=[];if(v!=null)return ll(p,(v+$)%7,b,"day");for(W=0;W<7;W++)ie[W]=ll(p,(W+$)%7,b,"day");return ie}function Gd(c,p){return Kd(c,p,"months")}function Qd(c,p){return Kd(c,p,"monthsShort")}function Ty(c,p,v){return dc(c,p,v,"weekdays")}function qy(c,p,v){return dc(c,p,v,"weekdaysShort")}function hc(c,p,v){return dc(c,p,v,"weekdaysMin")}kn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(c){var p=c%10,v=qe(c%100/10)===1?"th":p===1?"st":p===2?"nd":p===3?"rd":"th";return c+v}}),e.lang=w("moment.lang is deprecated. Use moment.locale instead.",kn),e.langData=w("moment.langData is deprecated. Use moment.localeData instead.",An);var vr=Math.abs;function ul(){var c=this._data;return this._milliseconds=vr(this._milliseconds),this._days=vr(this._days),this._months=vr(this._months),c.milliseconds=vr(c.milliseconds),c.seconds=vr(c.seconds),c.minutes=vr(c.minutes),c.hours=vr(c.hours),c.months=vr(c.months),c.years=vr(c.years),this}function Zd(c,p,v,b){var R=et(p,v);return c._milliseconds+=b*R._milliseconds,c._days+=b*R._days,c._months+=b*R._months,c._bubble()}function Xd(c,p){return Zd(this,c,p,1)}function $y(c,p){return Zd(this,c,p,-1)}function Hr(c){return c<0?Math.floor(c):Math.ceil(c)}function pc(){var c=this._milliseconds,p=this._days,v=this._months,b=this._data,R,$,W,ie,ye;return c>=0&&p>=0&&v>=0||c<=0&&p<=0&&v<=0||(c+=Hr(rr(v)+p)*864e5,p=0,v=0),b.milliseconds=c%1e3,R=xr(c/1e3),b.seconds=R%60,$=xr(R/60),b.minutes=$%60,W=xr($/60),b.hours=W%24,p+=xr(W/24),ye=xr(ci(p)),v+=ye,p-=Hr(rr(ye)),ie=xr(v/12),v%=12,b.days=p,b.months=v,b.years=ie,this}function ci(c){return c*4800/146097}function rr(c){return c*146097/4800}function My(c){if(!this.isValid())return NaN;var p,v,b=this._milliseconds;if(c=Vt(c),c==="month"||c==="quarter"||c==="year")switch(p=this._days+b/864e5,v=this._months+ci(p),c){case"month":return v;case"quarter":return v/3;case"year":return v/12}else switch(p=this._days+Math.round(rr(this._months)),c){case"week":return p/7+b/6048e5;case"day":return p+b/864e5;case"hour":return p*24+b/36e5;case"minute":return p*1440+b/6e4;case"second":return p*86400+b/1e3;case"millisecond":return Math.floor(p*864e5)+b;default:throw new Error("Unknown unit "+c)}}function ln(c){return function(){return this.as(c)}}var mc=ln("ms"),Mo=ln("s"),fi=ln("m"),eh=ln("h"),Ny=ln("d"),cl=ln("w"),Dy=ln("M"),th=ln("Q"),jt=ln("y"),gc=mc;function rh(){return et(this)}function un(c){return c=Vt(c),this.isValid()?this[c+"s"]():NaN}function $n(c){return function(){return this.isValid()?this._data[c]:NaN}}var fl=$n("milliseconds"),Di=$n("seconds"),nh=$n("minutes"),zt=$n("hours"),yc=$n("days"),Fy=$n("months"),Ly=$n("years");function jy(){return xr(this.days()/7)}var Vr=Math.round,_s={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function No(c,p,v,b,R){return R.relativeTime(p||1,!!v,c,b)}function ih(c,p,v,b){var R=et(c).abs(),$=Vr(R.as("s")),W=Vr(R.as("m")),ie=Vr(R.as("h")),ye=Vr(R.as("d")),Me=Vr(R.as("M")),$t=Vr(R.as("w")),Mn=Vr(R.as("y")),Nn=$<=v.ss&&["s",$]||$<v.s&&["ss",$]||W<=1&&["m"]||W<v.m&&["mm",W]||ie<=1&&["h"]||ie<v.h&&["hh",ie]||ye<=1&&["d"]||ye<v.d&&["dd",ye];return v.w!=null&&(Nn=Nn||$t<=1&&["w"]||$t<v.w&&["ww",$t]),Nn=Nn||Me<=1&&["M"]||Me<v.M&&["MM",Me]||Mn<=1&&["y"]||["yy",Mn],Nn[2]=p,Nn[3]=+c>0,Nn[4]=b,No.apply(null,Nn)}function Uy(c){return c===void 0?Vr:typeof c=="function"?(Vr=c,!0):!1}function By(c,p){return _s[c]===void 0?!1:p===void 0?_s[c]:(_s[c]=p,c==="s"&&(_s.ss=p-1),!0)}function Do(c,p){if(!this.isValid())return this.localeData().invalidDate();var v=!1,b=_s,R,$;return typeof c=="object"&&(p=c,c=!1),typeof c=="boolean"&&(v=c),typeof p=="object"&&(b=Object.assign({},_s,p),p.s!=null&&p.ss==null&&(b.ss=p.s-1)),R=this.localeData(),$=ih(this,!v,b,R),v&&($=R.pastFuture(+this,$)),R.postformat($)}var vc=Math.abs;function ws(c){return(c>0)-(c<0)||+c}function Es(){if(!this.isValid())return this.localeData().invalidDate();var c=vc(this._milliseconds)/1e3,p=vc(this._days),v=vc(this._months),b,R,$,W,ie=this.asSeconds(),ye,Me,$t,Mn;return ie?(b=xr(c/60),R=xr(b/60),c%=60,b%=60,$=xr(v/12),v%=12,W=c?c.toFixed(3).replace(/\.?0+$/,""):"",ye=ie<0?"-":"",Me=ws(this._months)!==ws(ie)?"-":"",$t=ws(this._days)!==ws(ie)?"-":"",Mn=ws(this._milliseconds)!==ws(ie)?"-":"",ye+"P"+($?Me+$+"Y":"")+(v?Me+v+"M":"")+(p?$t+p+"D":"")+(R||b||c?"T":"")+(R?Mn+R+"H":"")+(b?Mn+b+"M":"")+(c?Mn+W+"S":"")):"P0D"}var Fe=gs.prototype;Fe.isValid=zg,Fe.abs=ul,Fe.add=Xd,Fe.subtract=$y,Fe.as=My,Fe.asMilliseconds=mc,Fe.asSeconds=Mo,Fe.asMinutes=fi,Fe.asHours=eh,Fe.asDays=Ny,Fe.asWeeks=cl,Fe.asMonths=Dy,Fe.asQuarters=th,Fe.asYears=jt,Fe.valueOf=gc,Fe._bubble=pc,Fe.clone=rh,Fe.get=un,Fe.milliseconds=fl,Fe.seconds=Di,Fe.minutes=nh,Fe.hours=zt,Fe.days=yc,Fe.weeks=jy,Fe.months=Fy,Fe.years=Ly,Fe.humanize=Do,Fe.toISOString=Es,Fe.toString=Es,Fe.toJSON=Es,Fe.locale=Po,Fe.localeData=rl,Fe.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Es),Fe.lang=ko,le("X",0,0,"unix"),le("x",0,0,"valueOf"),oe("x",us),oe("X",cg),Ge("X",function(c,p,v){v._d=new Date(parseFloat(c)*1e3)}),Ge("x",function(c,p,v){v._d=new Date(qe(c))});return e.version="2.30.1",r(Xe),e.fn=te,e.min=Wg,e.max=Yg,e.now=Jg,e.utc=S,e.unix=Ay,e.months=Gd,e.isDate=h,e.locale=kn,e.invalid=T,e.duration=et,e.isMoment=X,e.weekdays=Ty,e.parseZone=Br,e.localeData=An,e.isDuration=xo,e.monthsShort=Qd,e.weekdaysMin=hc,e.defineLocale=Ua,e.updateLocale=hr,e.locales=pr,e.weekdaysShort=qy,e.normalizeUnits=Vt,e.relativeTimeRounding=Uy,e.relativeTimeThreshold=By,e.calendarFormat=Ga,e.prototype=te,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e}))});var hx=F((dx,Mh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Mh<"u"&&Mh.exports?Mh.exports=e():t.tv4=e()})(dx,function(){Object.keys||(Object.keys=(function(){var k=Object.prototype.hasOwnProperty,w=!{toString:null}.propertyIsEnumerable("toString"),P=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],N=P.length;return function(D){if(typeof D!="object"&&typeof D!="function"||D===null)throw new TypeError("Object.keys called on non-object");var L=[];for(var z in D)k.call(D,z)&&L.push(z);if(w)for(var Z=0;Z<N;Z++)k.call(D,P[Z])&&L.push(P[Z]);return L}})()),Object.create||(Object.create=(function(){function k(){}return function(w){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return k.prototype=w,new k}})()),Array.isArray||(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(k){if(this===null)throw new TypeError;var w=Object(this),P=w.length>>>0;if(P===0)return-1;var N=0;if(arguments.length>1&&(N=Number(arguments[1]),N!==N?N=0:N!==0&&N!==1/0&&N!==-1/0&&(N=(N>0||-1)*Math.floor(Math.abs(N)))),N>=P)return-1;for(var D=N>=0?N:Math.max(P-Math.abs(N),0);D<P;D++)if(D in w&&w[D]===k)return D;return-1}),Object.isFrozen||(Object.isFrozen=function(k){for(var w="tv4_test_frozen_key";k.hasOwnProperty(w);)w+=Math.random();try{return k[w]=!0,delete k[w],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(k){return encodeURI(k).replace(/%25[0-9][0-9]/g,function(w){return"%"+w.substring(3)})}function n(k){var w="";t[k.charAt(0)]&&(w=k.charAt(0),k=k.substring(1));var P="",N="",D=!0,L=!1,z=!1;w==="+"?D=!1:w==="."?(N=".",P="."):w==="/"?(N="/",P="/"):w==="#"?(N="#",D=!1):w===";"?(N=";",P=";",L=!0,z=!0):w==="?"?(N="?",P="&",L=!0):w==="&"&&(N="&",P="&",L=!0);for(var Z=[],ae=k.split(","),de=[],nt={},Ie=0;Ie<ae.length;Ie++){var ge=ae[Ie],Te=null;if(ge.indexOf(":")!==-1){var wt=ge.split(":");ge=wt[0],Te=parseInt(wt[1],10)}for(var Tt={};e[ge.charAt(ge.length-1)];)Tt[ge.charAt(ge.length-1)]=!0,ge=ge.substring(0,ge.length-1);var le={truncate:Te,name:ge,suffices:Tt};de.push(le),nt[ge]=le,Z.push(ge)}var Xr=function(os){for(var Et="",Cn=0,en=0;en<de.length;en++){var er=de[en],ht=os(er.name);if(ht==null||Array.isArray(ht)&&ht.length===0||typeof ht=="object"&&Object.keys(ht).length===0){Cn++;continue}if(en===Cn?Et+=N:Et+=P||",",Array.isArray(ht)){L&&(Et+=er.name+"=");for(var tn=0;tn<ht.length;tn++)tn>0&&(Et+=er.suffices["*"]&&P||",",er.suffices["*"]&&L&&(Et+=er.name+"=")),Et+=D?encodeURIComponent(ht[tn]).replace(/!/g,"%21"):r(ht[tn])}else if(typeof ht=="object"){L&&!er.suffices["*"]&&(Et+=er.name+"=");var uo=!0;for(var Ht in ht)uo||(Et+=er.suffices["*"]&&P||","),uo=!1,Et+=D?encodeURIComponent(Ht).replace(/!/g,"%21"):r(Ht),Et+=er.suffices["*"]?"=":",",Et+=D?encodeURIComponent(ht[Ht]).replace(/!/g,"%21"):r(ht[Ht])}else L&&(Et+=er.name,(!z||ht!=="")&&(Et+="=")),er.truncate!=null&&(ht=ht.substring(0,er.truncate)),Et+=D?encodeURIComponent(ht).replace(/!/g,"%21"):r(ht)}return Et};return Xr.varNames=Z,{prefix:N,substitution:Xr}}function i(k){if(!(this instanceof i))return new i(k);for(var w=k.split("{"),P=[w.shift()],N=[],D=[],L=[];w.length>0;){var z=w.shift(),Z=z.split("}")[0],ae=z.substring(Z.length+1),de=n(Z);D.push(de.substitution),N.push(de.prefix),P.push(ae),L=L.concat(de.substitution.varNames)}this.fill=function(nt){for(var Ie=P[0],ge=0;ge<D.length;ge++){var Te=D[ge];Ie+=Te(nt),Ie+=P[ge+1]}return Ie},this.varNames=L,this.template=k}i.prototype={toString:function(){return this.template},fillFromObject:function(k){return this.fill(function(w){return k[w]})}};var s=function(w,P,N,D,L){if(this.missing=[],this.missingMap={},this.formatValidators=w?Object.create(w.formatValidators):{},this.schemas=w?Object.create(w.schemas):{},this.collectMultiple=P,this.errors=[],this.handleError=P?this.collectError:this.returnError,D&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),L&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=N||E("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},w)for(var z in w.definedKeywords)this.definedKeywords[z]=w.definedKeywords[z].slice(0)};s.prototype.defineKeyword=function(k,w){this.definedKeywords[k]=this.definedKeywords[k]||[],this.definedKeywords[k].push(w)},s.prototype.createError=function(k,w,P,N,D,L,z){var Z=new B(k,w,P,N,D);return Z.message=this.errorReporter(Z,L,z),Z},s.prototype.returnError=function(k){return k},s.prototype.collectError=function(k){return k&&this.errors.push(k),null},s.prototype.prefixErrors=function(k,w,P){for(var N=k;N<this.errors.length;N++)this.errors[N]=this.errors[N].prefixWith(w,P);return this},s.prototype.banUnknownProperties=function(k,w){for(var P in this.unknownPropertyPaths){var N=this.createError(x.UNKNOWN_PROPERTY,{path:P},P,"",null,k,w),D=this.handleError(N);if(D)return D}return null},s.prototype.addFormat=function(k,w){if(typeof k=="object"){for(var P in k)this.addFormat(P,k[P]);return this}this.formatValidators[k]=w},s.prototype.resolveRefs=function(k,w){if(k.$ref!==void 0){if(w=w||{},w[k.$ref])return this.createError(x.CIRCULAR_REFERENCE,{urls:Object.keys(w).join(", ")},"","",null,void 0,k);w[k.$ref]=!0,k=this.getSchema(k.$ref,w)}return k},s.prototype.getSchema=function(k,w){var P;if(this.schemas[k]!==void 0)return P=this.schemas[k],this.resolveRefs(P,w);var N=k,D="";if(k.indexOf("#")!==-1&&(D=k.substring(k.indexOf("#")+1),N=k.substring(0,k.indexOf("#"))),typeof this.schemas[N]=="object"){P=this.schemas[N];var L=decodeURIComponent(D);if(L==="")return this.resolveRefs(P,w);if(L.charAt(0)!=="/")return;for(var z=L.split("/").slice(1),Z=0;Z<z.length;Z++){var ae=z[Z].replace(/~1/g,"/").replace(/~0/g,"~");if(P[ae]===void 0){P=void 0;break}P=P[ae]}if(P!==void 0)return this.resolveRefs(P,w)}this.missing[N]===void 0&&(this.missing.push(N),this.missing[N]=N,this.missingMap[N]=N)},s.prototype.searchSchemas=function(k,w){if(Array.isArray(k))for(var P=0;P<k.length;P++)this.searchSchemas(k[P],w);else if(k&&typeof k=="object"){typeof k.id=="string"&&Y(w,k.id)&&this.schemas[k.id]===void 0&&(this.schemas[k.id]=k);for(var N in k)if(N!=="enum"){if(typeof k[N]=="object")this.searchSchemas(k[N],w);else if(N==="$ref"){var D=m(k[N]);D&&this.schemas[D]===void 0&&this.missingMap[D]===void 0&&(this.missingMap[D]=D)}}}},s.prototype.addSchema=function(k,w){if(typeof k!="string"||typeof w>"u")if(typeof k=="object"&&typeof k.id=="string")w=k,k=w.id;else return;k===m(k)+"#"&&(k=m(k)),this.schemas[k]=w,delete this.missingMap[k],S(w,k),this.searchSchemas(w,k)},s.prototype.getSchemaMap=function(){var k={};for(var w in this.schemas)k[w]=this.schemas[w];return k},s.prototype.getSchemaUris=function(k){var w=[];for(var P in this.schemas)(!k||k.test(P))&&w.push(P);return w},s.prototype.getMissingUris=function(k){var w=[];for(var P in this.missingMap)(!k||k.test(P))&&w.push(P);return w},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(k,w,P,N,D){var L;if(w=this.resolveRefs(w),w){if(w instanceof B)return this.errors.push(w),w}else return null;var z=this.errors.length,Z,ae=null,de=null;if(this.checkRecursive&&k&&typeof k=="object"){if(L=!this.scanned.length,k[this.validatedSchemasKey]){var nt=k[this.validatedSchemasKey].indexOf(w);if(nt!==-1)return this.errors=this.errors.concat(k[this.validationErrorsKey][nt]),null}if(Object.isFrozen(k)&&(Z=this.scannedFrozen.indexOf(k),Z!==-1)){var Ie=this.scannedFrozenSchemas[Z].indexOf(w);if(Ie!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[Z][Ie]),null}if(this.scanned.push(k),Object.isFrozen(k))Z===-1&&(Z=this.scannedFrozen.length,this.scannedFrozen.push(k),this.scannedFrozenSchemas.push([])),ae=this.scannedFrozenSchemas[Z].length,this.scannedFrozenSchemas[Z][ae]=w,this.scannedFrozenValidationErrors[Z][ae]=[];else{if(!k[this.validatedSchemasKey])try{Object.defineProperty(k,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(k,this.validationErrorsKey,{value:[],configurable:!0})}catch{k[this.validatedSchemasKey]=[],k[this.validationErrorsKey]=[]}de=k[this.validatedSchemasKey].length,k[this.validatedSchemasKey][de]=w,k[this.validationErrorsKey][de]=[]}}var ge=this.errors.length,Te=this.validateBasic(k,w,D)||this.validateNumeric(k,w,D)||this.validateString(k,w,D)||this.validateArray(k,w,D)||this.validateObject(k,w,D)||this.validateCombinations(k,w,D)||this.validateHypermedia(k,w,D)||this.validateFormat(k,w,D)||this.validateDefinedKeywords(k,w,D)||null;if(L){for(;this.scanned.length;){var wt=this.scanned.pop();delete wt[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Te||ge!==this.errors.length)for(;P&&P.length||N&&N.length;){var Tt=P&&P.length?""+P.pop():null,le=N&&N.length?""+N.pop():null;Te&&(Te=Te.prefixWith(Tt,le)),this.prefixErrors(ge,Tt,le)}return ae!==null?this.scannedFrozenValidationErrors[Z][ae]=this.errors.slice(z):de!==null&&(k[this.validationErrorsKey][de]=this.errors.slice(z)),this.handleError(Te)},s.prototype.validateFormat=function(k,w){if(typeof w.format!="string"||!this.formatValidators[w.format])return null;var P=this.formatValidators[w.format].call(null,k,w);return typeof P=="string"||typeof P=="number"?this.createError(x.FORMAT_CUSTOM,{message:P},"","/format",null,k,w):P&&typeof P=="object"?this.createError(x.FORMAT_CUSTOM,{message:P.message||"?"},P.dataPath||"",P.schemaPath||"/format",null,k,w):null},s.prototype.validateDefinedKeywords=function(k,w,P){for(var N in this.definedKeywords)if(!(typeof w[N]>"u"))for(var D=this.definedKeywords[N],L=0;L<D.length;L++){var z=D[L],Z=z(k,w[N],w,P);if(typeof Z=="string"||typeof Z=="number")return this.createError(x.KEYWORD_CUSTOM,{key:N,message:Z},"","",null,k,w).prefixWith(null,N);if(Z&&typeof Z=="object"){var ae=Z.code;if(typeof ae=="string"){if(!x[ae])throw new Error("Undefined error code (use defineError): "+ae);ae=x[ae]}else typeof ae!="number"&&(ae=x.KEYWORD_CUSTOM);var de=typeof Z.message=="object"?Z.message:{key:N,message:Z.message||"?"},nt=Z.schemaPath||"/"+N.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ae,de,Z.dataPath||null,nt,null,k,w)}}return null};function a(k,w){if(k===w)return!0;if(k&&w&&typeof k=="object"&&typeof w=="object"){if(Array.isArray(k)!==Array.isArray(w))return!1;if(Array.isArray(k)){if(k.length!==w.length)return!1;for(var P=0;P<k.length;P++)if(!a(k[P],w[P]))return!1}else{var N;for(N in k)if(w[N]===void 0&&k[N]!==void 0)return!1;for(N in w)if(k[N]===void 0&&w[N]!==void 0)return!1;for(N in k)if(!a(k[N],w[N]))return!1}return!0}return!1}s.prototype.validateBasic=function(w,P,N){var D;return(D=this.validateType(w,P,N))||(D=this.validateEnum(w,P,N))?D.prefixWith(null,"type"):null},s.prototype.validateType=function(w,P){if(P.type===void 0)return null;var N=typeof w;w===null?N="null":Array.isArray(w)&&(N="array");var D=P.type;Array.isArray(D)||(D=[D]);for(var L=0;L<D.length;L++){var z=D[L];if(z===N||z==="integer"&&N==="number"&&w%1===0)return null}return this.createError(x.INVALID_TYPE,{type:N,expected:D.join("/")},"","",null,w,P)},s.prototype.validateEnum=function(w,P){if(P.enum===void 0)return null;for(var N=0;N<P.enum.length;N++){var D=P.enum[N];if(a(w,D))return null}return this.createError(x.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(w):w},"","",null,w,P)},s.prototype.validateNumeric=function(w,P,N){return this.validateMultipleOf(w,P,N)||this.validateMinMax(w,P,N)||this.validateNaN(w,P,N)||null};var u=Math.pow(2,-51),f=1-u;s.prototype.validateMultipleOf=function(w,P){var N=P.multipleOf||P.divisibleBy;if(N===void 0)return null;if(typeof w=="number"){var D=w/N%1;if(D>=u&&D<f)return this.createError(x.NUMBER_MULTIPLE_OF,{value:w,multipleOf:N},"","",null,w,P)}return null},s.prototype.validateMinMax=function(w,P){if(typeof w!="number")return null;if(P.minimum!==void 0){if(w<P.minimum)return this.createError(x.NUMBER_MINIMUM,{value:w,minimum:P.minimum},"","/minimum",null,w,P);if(P.exclusiveMinimum&&w===P.minimum)return this.createError(x.NUMBER_MINIMUM_EXCLUSIVE,{value:w,minimum:P.minimum},"","/exclusiveMinimum",null,w,P)}if(P.maximum!==void 0){if(w>P.maximum)return this.createError(x.NUMBER_MAXIMUM,{value:w,maximum:P.maximum},"","/maximum",null,w,P);if(P.exclusiveMaximum&&w===P.maximum)return this.createError(x.NUMBER_MAXIMUM_EXCLUSIVE,{value:w,maximum:P.maximum},"","/exclusiveMaximum",null,w,P)}return null},s.prototype.validateNaN=function(w,P){return typeof w!="number"?null:isNaN(w)===!0||w===1/0||w===-1/0?this.createError(x.NUMBER_NOT_A_NUMBER,{value:w},"","/type",null,w,P):null},s.prototype.validateString=function(w,P,N){return this.validateStringLength(w,P,N)||this.validateStringPattern(w,P,N)||null},s.prototype.validateStringLength=function(w,P){return typeof w!="string"?null:P.minLength!==void 0&&w.length<P.minLength?this.createError(x.STRING_LENGTH_SHORT,{length:w.length,minimum:P.minLength},"","/minLength",null,w,P):P.maxLength!==void 0&&w.length>P.maxLength?this.createError(x.STRING_LENGTH_LONG,{length:w.length,maximum:P.maxLength},"","/maxLength",null,w,P):null},s.prototype.validateStringPattern=function(w,P){if(typeof w!="string"||typeof P.pattern!="string"&&!(P.pattern instanceof RegExp))return null;var N;if(P.pattern instanceof RegExp)N=P.pattern;else{var D,L="",z=P.pattern.match(/^\/(.+)\/([img]*)$/);z?(D=z[1],L=z[2]):D=P.pattern,N=new RegExp(D,L)}return N.test(w)?null:this.createError(x.STRING_PATTERN,{pattern:P.pattern},"","/pattern",null,w,P)},s.prototype.validateArray=function(w,P,N){return Array.isArray(w)&&(this.validateArrayLength(w,P,N)||this.validateArrayUniqueItems(w,P,N)||this.validateArrayItems(w,P,N))||null},s.prototype.validateArrayLength=function(w,P){var N;return P.minItems!==void 0&&w.length<P.minItems&&(N=this.createError(x.ARRAY_LENGTH_SHORT,{length:w.length,minimum:P.minItems},"","/minItems",null,w,P),this.handleError(N))||P.maxItems!==void 0&&w.length>P.maxItems&&(N=this.createError(x.ARRAY_LENGTH_LONG,{length:w.length,maximum:P.maxItems},"","/maxItems",null,w,P),this.handleError(N))?N:null},s.prototype.validateArrayUniqueItems=function(w,P){if(P.uniqueItems){for(var N=0;N<w.length;N++)for(var D=N+1;D<w.length;D++)if(a(w[N],w[D])){var L=this.createError(x.ARRAY_UNIQUE,{match1:N,match2:D},"","/uniqueItems",null,w,P);if(this.handleError(L))return L}}return null},s.prototype.validateArrayItems=function(w,P,N){if(P.items===void 0)return null;var D,L;if(Array.isArray(P.items)){for(L=0;L<w.length;L++)if(L<P.items.length){if(D=this.validateAll(w[L],P.items[L],[L],["items",L],N+"/"+L))return D}else if(P.additionalItems!==void 0){if(typeof P.additionalItems=="boolean"){if(!P.additionalItems&&(D=this.createError(x.ARRAY_ADDITIONAL_ITEMS,{},"/"+L,"/additionalItems",null,w,P),this.handleError(D)))return D}else if(D=this.validateAll(w[L],P.additionalItems,[L],["additionalItems"],N+"/"+L))return D}}else for(L=0;L<w.length;L++)if(D=this.validateAll(w[L],P.items,[L],["items"],N+"/"+L))return D;return null},s.prototype.validateObject=function(w,P,N){return typeof w!="object"||w===null||Array.isArray(w)?null:this.validateObjectMinMaxProperties(w,P,N)||this.validateObjectRequiredProperties(w,P,N)||this.validateObjectProperties(w,P,N)||this.validateObjectDependencies(w,P,N)||null},s.prototype.validateObjectMinMaxProperties=function(w,P){var N=Object.keys(w),D;return P.minProperties!==void 0&&N.length<P.minProperties&&(D=this.createError(x.OBJECT_PROPERTIES_MINIMUM,{propertyCount:N.length,minimum:P.minProperties},"","/minProperties",null,w,P),this.handleError(D))||P.maxProperties!==void 0&&N.length>P.maxProperties&&(D=this.createError(x.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:N.length,maximum:P.maxProperties},"","/maxProperties",null,w,P),this.handleError(D))?D:null},s.prototype.validateObjectRequiredProperties=function(w,P){if(P.required!==void 0)for(var N=0;N<P.required.length;N++){var D=P.required[N];if(w[D]===void 0){var L=this.createError(x.OBJECT_REQUIRED,{key:D},"","/required/"+N,null,w,P);if(this.handleError(L))return L}}return null},s.prototype.validateObjectProperties=function(w,P,N){var D;for(var L in w){var z=N+"/"+L.replace(/~/g,"~0").replace(/\//g,"~1"),Z=!1;if(P.properties!==void 0&&P.properties[L]!==void 0&&(Z=!0,D=this.validateAll(w[L],P.properties[L],[L],["properties",L],z)))return D;if(P.patternProperties!==void 0)for(var ae in P.patternProperties){var de=new RegExp(ae);if(de.test(L)&&(Z=!0,D=this.validateAll(w[L],P.patternProperties[ae],[L],["patternProperties",ae],z)))return D}if(Z)this.trackUnknownProperties&&(this.knownPropertyPaths[z]=!0,delete this.unknownPropertyPaths[z]);else if(P.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[z]=!0,delete this.unknownPropertyPaths[z]),typeof P.additionalProperties=="boolean"){if(!P.additionalProperties&&(D=this.createError(x.OBJECT_ADDITIONAL_PROPERTIES,{key:L},"","/additionalProperties",null,w,P).prefixWith(L,null),this.handleError(D)))return D}else if(D=this.validateAll(w[L],P.additionalProperties,[L],["additionalProperties"],z))return D}else this.trackUnknownProperties&&!this.knownPropertyPaths[z]&&(this.unknownPropertyPaths[z]=!0)}return null},s.prototype.validateObjectDependencies=function(w,P,N){var D;if(P.dependencies!==void 0){for(var L in P.dependencies)if(w[L]!==void 0){var z=P.dependencies[L];if(typeof z=="string"){if(w[z]===void 0&&(D=this.createError(x.OBJECT_DEPENDENCY_KEY,{key:L,missing:z},"","",null,w,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(Array.isArray(z))for(var Z=0;Z<z.length;Z++){var ae=z[Z];if(w[ae]===void 0&&(D=this.createError(x.OBJECT_DEPENDENCY_KEY,{key:L,missing:ae},"","/"+Z,null,w,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(D=this.validateAll(w,z,[],["dependencies",L],N))return D}}return null},s.prototype.validateCombinations=function(w,P,N){return this.validateAllOf(w,P,N)||this.validateAnyOf(w,P,N)||this.validateOneOf(w,P,N)||this.validateNot(w,P,N)||null},s.prototype.validateAllOf=function(w,P,N){if(P.allOf===void 0)return null;for(var D,L=0;L<P.allOf.length;L++){var z=P.allOf[L];if(D=this.validateAll(w,z,[],["allOf",L],N))return D}return null},s.prototype.validateAnyOf=function(w,P,N){if(P.anyOf===void 0)return null;var D=[],L=this.errors.length,z,Z;this.trackUnknownProperties&&(z=this.unknownPropertyPaths,Z=this.knownPropertyPaths);for(var ae=!0,de=0;de<P.anyOf.length;de++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var nt=P.anyOf[de],Ie=this.errors.length,ge=this.validateAll(w,nt,[],["anyOf",de],N);if(ge===null&&Ie===this.errors.length){if(this.errors=this.errors.slice(0,L),this.trackUnknownProperties){for(var Te in this.knownPropertyPaths)Z[Te]=!0,delete z[Te];for(var wt in this.unknownPropertyPaths)Z[wt]||(z[wt]=!0);ae=!1;continue}return null}ge&&D.push(ge.prefixWith(null,""+de).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=z,this.knownPropertyPaths=Z),ae)return D=D.concat(this.errors.slice(L)),this.errors=this.errors.slice(0,L),this.createError(x.ANY_OF_MISSING,{},"","/anyOf",D,w,P)},s.prototype.validateOneOf=function(w,P,N){if(P.oneOf===void 0)return null;var D=null,L=[],z=this.errors.length,Z,ae;this.trackUnknownProperties&&(Z=this.unknownPropertyPaths,ae=this.knownPropertyPaths);for(var de=0;de<P.oneOf.length;de++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var nt=P.oneOf[de],Ie=this.errors.length,ge=this.validateAll(w,nt,[],["oneOf",de],N);if(ge===null&&Ie===this.errors.length){if(D===null)D=de;else return this.errors=this.errors.slice(0,z),this.createError(x.ONE_OF_MULTIPLE,{index1:D,index2:de},"","/oneOf",null,w,P);if(this.trackUnknownProperties){for(var Te in this.knownPropertyPaths)ae[Te]=!0,delete Z[Te];for(var wt in this.unknownPropertyPaths)ae[wt]||(Z[wt]=!0)}}else ge&&L.push(ge)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=Z,this.knownPropertyPaths=ae),D===null?(L=L.concat(this.errors.slice(z)),this.errors=this.errors.slice(0,z),this.createError(x.ONE_OF_MISSING,{},"","/oneOf",L,w,P)):(this.errors=this.errors.slice(0,z),null)},s.prototype.validateNot=function(w,P,N){if(P.not===void 0)return null;var D=this.errors.length,L,z;this.trackUnknownProperties&&(L=this.unknownPropertyPaths,z=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var Z=this.validateAll(w,P.not,null,null,N),ae=this.errors.slice(D);return this.errors=this.errors.slice(0,D),this.trackUnknownProperties&&(this.unknownPropertyPaths=L,this.knownPropertyPaths=z),Z===null&&ae.length===0?this.createError(x.NOT_PASSED,{},"","/not",null,w,P):null},s.prototype.validateHypermedia=function(w,P,N){if(!P.links)return null;for(var D,L=0;L<P.links.length;L++){var z=P.links[L];if(z.rel==="describedby"){for(var Z=new i(z.href),ae=!0,de=0;de<Z.varNames.length;de++)if(!(Z.varNames[de]in w)){ae=!1;break}if(ae){var nt=Z.fillFromObject(w),Ie={$ref:nt};if(D=this.validateAll(w,Ie,[],["links",L],N))return D}}}};function h(k){var w=String(k).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return w?{href:w[0]||"",protocol:w[1]||"",authority:w[2]||"",host:w[3]||"",hostname:w[4]||"",port:w[5]||"",pathname:w[6]||"",search:w[7]||"",hash:w[8]||""}:null}function g(k,w){function P(N){var D=[];return N.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(L){L==="/.."?D.pop():D.push(L)}),D.join("").replace(/^\//,N.charAt(0)==="/"?"/":"")}return w=h(w||""),k=h(k||""),!w||!k?null:(w.protocol||k.protocol)+(w.protocol||w.authority?w.authority:k.authority)+P(w.protocol||w.authority||w.pathname.charAt(0)==="/"?w.pathname:w.pathname?(k.authority&&!k.pathname?"/":"")+k.pathname.slice(0,k.pathname.lastIndexOf("/")+1)+w.pathname:k.pathname)+(w.protocol||w.authority||w.pathname?w.search:w.search||k.search)+w.hash}function m(k){return k.split("#")[0]}function S(k,w){if(k&&typeof k=="object")if(w===void 0?w=k.id:typeof k.id=="string"&&(w=g(w,k.id),k.id=w),Array.isArray(k))for(var P=0;P<k.length;P++)S(k[P],w);else{typeof k.$ref=="string"&&(k.$ref=g(w,k.$ref));for(var N in k)N!=="enum"&&S(k[N],w)}}function E(k){k=k||"en";var w=H[k];return function(P){var N=w[P.code]||T[P.code];if(typeof N!="string")return"Unknown error code "+P.code+": "+JSON.stringify(P.messageParams);var D=P.params;return N.replace(/\{([^{}]*)\}/g,function(L,z){var Z=D[z];return typeof Z=="string"||typeof Z=="number"?Z:L})}}var x={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},C={};for(var A in x)C[x[A]]=A;var T={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function B(k,w,P,N,D){if(Error.call(this),k===void 0)throw new Error("No error code supplied: "+N);this.message="",this.params=w,this.code=k,this.dataPath=P||"",this.schemaPath=N||"",this.subErrors=D||null;var L=new Error(this.message);if(this.stack=L.stack||L.stacktrace,!this.stack)try{throw L}catch(z){this.stack=z.stack||z.stacktrace}}B.prototype=Object.create(Error.prototype),B.prototype.constructor=B,B.prototype.name="ValidationError",B.prototype.prefixWith=function(k,w){if(k!==null&&(k=k.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+k+this.dataPath),w!==null&&(w=w.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+w+this.schemaPath),this.subErrors!==null)for(var P=0;P<this.subErrors.length;P++)this.subErrors[P].prefixWith(k,w);return this};function Y(k,w){if(w.substring(0,k.length)===k){var P=w.substring(k.length);if(w.length>0&&w.charAt(k.length-1)==="/"||P.charAt(0)==="#"||P.charAt(0)==="?")return!0}return!1}var H={};function K(k){var w=new s,P,N,D={setErrorReporter:function(L){return typeof L=="string"?this.language(L):(N=L,!0)},addFormat:function(){w.addFormat.apply(w,arguments)},language:function(L){return L?(H[L]||(L=L.split("-")[0]),H[L]?(P=L,L):!1):P},addLanguage:function(L,z){var Z;for(Z in x)z[Z]&&!z[x[Z]]&&(z[x[Z]]=z[Z]);var ae=L.split("-")[0];if(!H[ae])H[L]=z,H[ae]=z;else{H[L]=Object.create(H[ae]);for(Z in z)typeof H[ae][Z]>"u"&&(H[ae][Z]=z[Z]),H[L][Z]=z[Z]}return this},freshApi:function(L){var z=K();return L&&z.language(L),z},validate:function(L,z,Z,ae){var de=E(P),nt=N?function(Te,wt,Tt){return N(Te,wt,Tt)||de(Te,wt,Tt)}:de,Ie=new s(w,!1,nt,Z,ae);typeof z=="string"&&(z={$ref:z}),Ie.addSchema("",z);var ge=Ie.validateAll(L,z,null,null,"");return!ge&&ae&&(ge=Ie.banUnknownProperties(L,z)),this.error=ge,this.missing=Ie.missing,this.valid=ge===null,this.valid},validateResult:function(){var L={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(L,arguments),L},validateMultiple:function(L,z,Z,ae){var de=E(P),nt=N?function(Te,wt,Tt){return N(Te,wt,Tt)||de(Te,wt,Tt)}:de,Ie=new s(w,!0,nt,Z,ae);typeof z=="string"&&(z={$ref:z}),Ie.addSchema("",z),Ie.validateAll(L,z,null,null,""),ae&&Ie.banUnknownProperties(L,z);var ge={toString:function(){return this.valid?"valid":this.error.message}};return ge.errors=Ie.errors,ge.missing=Ie.missing,ge.valid=ge.errors.length===0,ge},addSchema:function(){return w.addSchema.apply(w,arguments)},getSchema:function(){return w.getSchema.apply(w,arguments)},getSchemaMap:function(){return w.getSchemaMap.apply(w,arguments)},getSchemaUris:function(){return w.getSchemaUris.apply(w,arguments)},getMissingUris:function(){return w.getMissingUris.apply(w,arguments)},dropSchemas:function(){w.dropSchemas.apply(w,arguments)},defineKeyword:function(){w.defineKeyword.apply(w,arguments)},defineError:function(L,z,Z){if(typeof L!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(L))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof z!="number"||z%1!==0||z<1e4)throw new Error("Code number must be an integer > 10000");if(typeof x[L]<"u")throw new Error("Error already defined: "+L+" as "+x[L]);if(typeof C[z]<"u")throw new Error("Error code already used: "+C[z]+" as "+z);x[L]=z,C[z]=L,T[L]=T[z]=Z;for(var ae in H){var de=H[ae];de[L]&&(de[z]=de[z]||de[L])}},reset:function(){w.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:S,resolveUrl:g,getDocumentUri:m,errorCodes:x};return D.language(k||"en"),D}var X=K();return X.addLanguage("en-gb",T),X.tv4=X,X})});var qc=F(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.regexpCode=Ke.getEsmExportName=Ke.getProperty=Ke.safeStringify=Ke.stringify=Ke.strConcat=Ke.addCodeArg=Ke.str=Ke._=Ke.nil=Ke._Code=Ke.Name=Ke.IDENTIFIER=Ke._CodeOrName=void 0;var Ac=class{};Ke._CodeOrName=Ac;Ke.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ho=class extends Ac{constructor(e){if(super(),!Ke.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Ke.Name=Ho;var mn=class extends Ac{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Ho&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Ke._Code=mn;Ke.nil=new mn("");function px(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Lv(r,e[n]),r.push(t[++n]);return new mn(r)}Ke._=px;var Fv=new mn("+");function mx(t,...e){let r=[Tc(t[0])],n=0;for(;n<e.length;)r.push(Fv),Lv(r,e[n]),r.push(Fv,Tc(t[++n]));return wD(r),new mn(r)}Ke.str=mx;function Lv(t,e){e instanceof mn?t.push(...e._items):e instanceof Ho?t.push(e):t.push(CD(e))}Ke.addCodeArg=Lv;function wD(t){let e=1;for(;e<t.length-1;){if(t[e]===Fv){let r=ED(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function ED(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ho||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ho))return`"${t}${e.slice(1)}`}function xD(t,e){return e.emptyStr()?t:t.emptyStr()?e:mx`${t}${e}`}Ke.strConcat=xD;function CD(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Tc(Array.isArray(t)?t.join(","):t)}function RD(t){return new mn(Tc(t))}Ke.stringify=RD;function Tc(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ke.safeStringify=Tc;function ID(t){return typeof t=="string"&&Ke.IDENTIFIER.test(t)?new mn(`.${t}`):px`[${t}]`}Ke.getProperty=ID;function OD(t){if(typeof t=="string"&&Ke.IDENTIFIER.test(t))return new mn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Ke.getEsmExportName=OD;function PD(t){return new mn(t.toString())}Ke.regexpCode=PD});var Bv=F(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.ValueScope=Tr.ValueScopeName=Tr.Scope=Tr.varKinds=Tr.UsedValueState=void 0;var Ar=qc(),jv=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Nh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Nh||(Tr.UsedValueState=Nh={}));Tr.varKinds={const:new Ar.Name("const"),let:new Ar.Name("let"),var:new Ar.Name("var")};var Dh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Ar.Name?e:this.name(e)}name(e){return new Ar.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Tr.Scope=Dh;var Fh=class extends Ar.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Ar._)`.${new Ar.Name(r)}[${n}]`}};Tr.ValueScopeName=Fh;var kD=(0,Ar._)`\n`,Uv=class extends Dh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?kD:Ar.nil}}get(){return this._scope}name(e){return new Fh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,a=(n=r.key)!==null&&n!==void 0?n:r.ref,u=this._values[s];if(u){let g=u.get(a);if(g)return g}else u=this._values[s]=new Map;u.set(a,i);let f=this._scope[s]||(this._scope[s]=[]),h=f.length;return f[h]=r.ref,i.setValue(r,{property:s,itemIndex:h}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ar._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=Ar.nil;for(let a in e){let u=e[a];if(!u)continue;let f=n[a]=n[a]||new Map;u.forEach(h=>{if(f.has(h))return;f.set(h,Nh.Started);let g=r(h);if(g){let m=this.opts.es5?Tr.varKinds.var:Tr.varKinds.const;s=(0,Ar._)`${s}${m} ${h} = ${g};${this.opts._n}`}else if(g=i?.(h))s=(0,Ar._)`${s}${g}${this.opts._n}`;else throw new jv(h);f.set(h,Nh.Completed)})}return s}};Tr.ValueScope=Uv});var Ne=F(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.or=Ae.and=Ae.not=Ae.CodeGen=Ae.operators=Ae.varKinds=Ae.ValueScopeName=Ae.ValueScope=Ae.Scope=Ae.Name=Ae.regexpCode=Ae.stringify=Ae.getProperty=Ae.nil=Ae.strConcat=Ae.str=Ae._=void 0;var He=qc(),Un=Bv(),Ms=qc();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return Ms._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return Ms.str}});Object.defineProperty(Ae,"strConcat",{enumerable:!0,get:function(){return Ms.strConcat}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return Ms.nil}});Object.defineProperty(Ae,"getProperty",{enumerable:!0,get:function(){return Ms.getProperty}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return Ms.stringify}});Object.defineProperty(Ae,"regexpCode",{enumerable:!0,get:function(){return Ms.regexpCode}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return Ms.Name}});var Bh=Bv();Object.defineProperty(Ae,"Scope",{enumerable:!0,get:function(){return Bh.Scope}});Object.defineProperty(Ae,"ValueScope",{enumerable:!0,get:function(){return Bh.ValueScope}});Object.defineProperty(Ae,"ValueScopeName",{enumerable:!0,get:function(){return Bh.ValueScopeName}});Object.defineProperty(Ae,"varKinds",{enumerable:!0,get:function(){return Bh.varKinds}});Ae.operators={GT:new He._Code(">"),GTE:new He._Code(">="),LT:new He._Code("<"),LTE:new He._Code("<="),EQ:new He._Code("==="),NEQ:new He._Code("!=="),NOT:new He._Code("!"),OR:new He._Code("||"),AND:new He._Code("&&"),ADD:new He._Code("+")};var Yi=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Hv=class extends Yi{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Un.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Pl(this.rhs,e,r)),this}get names(){return this.rhs instanceof He._CodeOrName?this.rhs.names:{}}},Lh=class extends Yi{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof He.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Pl(this.rhs,e,r),this}get names(){let e=this.lhs instanceof He.Name?{}:{...this.lhs.names};return Uh(e,this.rhs)}},Vv=class extends Lh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Wv=class extends Yi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Yv=class extends Yi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Jv=class extends Yi{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},zv=class extends Yi{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Pl(this.code,e,r),this}get names(){return this.code instanceof He._CodeOrName?this.code.names:{}}},$c=class extends Yi{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(AD(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Yo(e,r.names),{})}},Ji=class extends $c{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Kv=class extends $c{},Ol=class extends Ji{};Ol.kind="else";var Vo=class t extends Ji{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Ol(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(gx(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Pl(this.condition,e,r),this}get names(){let e=super.names;return Uh(e,this.condition),this.else&&Yo(e,this.else.names),e}};Vo.kind="if";var Wo=class extends Ji{};Wo.kind="for";var Gv=class extends Wo{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Pl(this.iteration,e,r),this}get names(){return Yo(super.names,this.iteration.names)}},Qv=class extends Wo{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Un.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Uh(super.names,this.from);return Uh(e,this.to)}},jh=class extends Wo{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Pl(this.iterable,e,r),this}get names(){return Yo(super.names,this.iterable.names)}},Mc=class extends Ji{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Mc.kind="func";var Nc=class extends $c{render(e){return"return "+super.render(e)}};Nc.kind="return";var Zv=class extends Ji{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Yo(e,this.catch.names),this.finally&&Yo(e,this.finally.names),e}},Dc=class extends Ji{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Dc.kind="catch";var Fc=class extends Ji{render(e){return"finally"+super.render(e)}};Fc.kind="finally";var Xv=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
|
+
`:""},this._extScope=e,this._scope=new Un.Scope({parent:e}),this._nodes=[new Kv]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new Hv(e,s,n)),s}const(e,r,n){return this._def(Un.varKinds.const,e,r,n)}let(e,r,n){return this._def(Un.varKinds.let,e,r,n)}var(e,r,n){return this._def(Un.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Lh(e,r,n))}add(e,r){return this._leafNode(new Vv(e,Ae.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==He.nil&&this._leafNode(new zv(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,He.addCodeArg)(r,i));return r.push("}"),new He._Code(r)}if(e,r,n){if(this._blockNode(new Vo(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Vo(e))}else(){return this._elseNode(new Ol)}endIf(){return this._endBlockNode(Vo,Ol)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Gv(e),r)}forRange(e,r,n,i,s=this.opts.es5?Un.varKinds.var:Un.varKinds.let){let a=this._scope.toName(e);return this._for(new Qv(s,a,r,n),()=>i(a))}forOf(e,r,n,i=Un.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=r instanceof He.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,He._)`${a}.length`,u=>{this.var(s,(0,He._)`${a}[${u}]`),n(s)})}return this._for(new jh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Un.varKinds.var:Un.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,He._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new jh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Wo)}label(e){return this._leafNode(new Wv(e))}break(e){return this._leafNode(new Yv(e))}return(e){let r=new Nc;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Nc)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Zv;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Dc(s),r(s)}return n&&(this._currNode=i.finally=new Fc,this.code(n)),this._endBlockNode(Dc,Fc)}throw(e){return this._leafNode(new Jv(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=He.nil,n,i){return this._blockNode(new Mc(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Mc)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Vo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};Ae.CodeGen=Xv;function Yo(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Uh(t,e){return e instanceof He._CodeOrName?Yo(t,e.names):t}function Pl(t,e,r){if(t instanceof He.Name)return n(t);if(!i(t))return t;return new He._Code(t._items.reduce((s,a)=>(a instanceof He.Name&&(a=n(a)),a instanceof He._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||e[s.str]!==1?s:(delete e[s.str],a)}function i(s){return s instanceof He._Code&&s._items.some(a=>a instanceof He.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function AD(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function gx(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,He._)`!${eS(t)}`}Ae.not=gx;var TD=yx(Ae.operators.AND);function qD(...t){return t.reduce(TD)}Ae.and=qD;var $D=yx(Ae.operators.OR);function MD(...t){return t.reduce($D)}Ae.or=MD;function yx(t){return(e,r)=>e===He.nil?r:r===He.nil?e:(0,He._)`${eS(e)} ${t} ${eS(r)}`}function eS(t){return t instanceof He.Name?t:(0,He._)`(${t})`}});var We=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.checkStrictMode=De.getErrorPath=De.Type=De.useFunc=De.setEvaluated=De.evaluatedPropsToName=De.mergeEvaluated=De.eachItem=De.unescapeJsonPointer=De.escapeJsonPointer=De.escapeFragment=De.unescapeFragment=De.schemaRefOrVal=De.schemaHasRulesButRef=De.schemaHasRules=De.checkUnknownRules=De.alwaysValidSchema=De.toHash=void 0;var dt=Ne(),ND=qc();function DD(t){let e={};for(let r of t)e[r]=!0;return e}De.toHash=DD;function FD(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(bx(t,e),!_x(e,t.self.RULES.all))}De.alwaysValidSchema=FD;function bx(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||xx(t,`unknown keyword: "${s}"`)}De.checkUnknownRules=bx;function _x(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}De.schemaHasRules=_x;function LD(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}De.schemaHasRulesButRef=LD;function jD({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,dt._)`${r}`}return(0,dt._)`${t}${e}${(0,dt.getProperty)(n)}`}De.schemaRefOrVal=jD;function UD(t){return wx(decodeURIComponent(t))}De.unescapeFragment=UD;function BD(t){return encodeURIComponent(rS(t))}De.escapeFragment=BD;function rS(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=rS;function wx(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=wx;function HD(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}De.eachItem=HD;function vx({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,a,u)=>{let f=a===void 0?s:a instanceof dt.Name?(s instanceof dt.Name?t(i,s,a):e(i,s,a),a):s instanceof dt.Name?(e(i,a,s),s):r(s,a);return u===dt.Name&&!(f instanceof dt.Name)?n(i,f):f}}De.mergeEvaluated={props:vx({mergeNames:(t,e,r)=>t.if((0,dt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,dt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,dt._)`${r} || {}`).code((0,dt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,dt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,dt._)`${r} || {}`),nS(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Ex}),items:vx({mergeNames:(t,e,r)=>t.if((0,dt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,dt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,dt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,dt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Ex(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,dt._)`{}`);return e!==void 0&&nS(t,r,e),r}De.evaluatedPropsToName=Ex;function nS(t,e,r){Object.keys(r).forEach(n=>t.assign((0,dt._)`${e}${(0,dt.getProperty)(n)}`,!0))}De.setEvaluated=nS;var Sx={};function VD(t,e){return t.scopeValue("func",{ref:e,code:Sx[e.code]||(Sx[e.code]=new ND._Code(e.code))})}De.useFunc=VD;var tS;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(tS||(De.Type=tS={}));function WD(t,e,r){if(t instanceof dt.Name){let n=e===tS.Num;return r?n?(0,dt._)`"[" + ${t} + "]"`:(0,dt._)`"['" + ${t} + "']"`:n?(0,dt._)`"/" + ${t}`:(0,dt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,dt.getProperty)(t).toString():"/"+rS(t)}De.getErrorPath=WD;function xx(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}De.checkStrictMode=xx});var zi=F(iS=>{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});var sr=Ne(),YD={data:new sr.Name("data"),valCxt:new sr.Name("valCxt"),instancePath:new sr.Name("instancePath"),parentData:new sr.Name("parentData"),parentDataProperty:new sr.Name("parentDataProperty"),rootData:new sr.Name("rootData"),dynamicAnchors:new sr.Name("dynamicAnchors"),vErrors:new sr.Name("vErrors"),errors:new sr.Name("errors"),this:new sr.Name("this"),self:new sr.Name("self"),scope:new sr.Name("scope"),json:new sr.Name("json"),jsonPos:new sr.Name("jsonPos"),jsonLen:new sr.Name("jsonLen"),jsonPart:new sr.Name("jsonPart")};iS.default=YD});var Lc=F(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.extendErrors=or.resetErrorsCount=or.reportExtraError=or.reportError=or.keyword$DataError=or.keywordError=void 0;var Ye=Ne(),Hh=We(),_r=zi();or.keywordError={message:({keyword:t})=>(0,Ye.str)`must pass "${t}" keyword validation`};or.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Ye.str)`"${t}" keyword must be ${e} ($data)`:(0,Ye.str)`"${t}" keyword is invalid ($data)`};function JD(t,e=or.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:a,allErrors:u}=i,f=Ix(t,e,r);n??(a||u)?Cx(s,f):Rx(i,(0,Ye._)`[${f}]`)}or.reportError=JD;function zD(t,e=or.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,u=Ix(t,e,r);Cx(i,u),s||a||Rx(n,_r.default.vErrors)}or.reportExtraError=zD;function KD(t,e){t.assign(_r.default.errors,e),t.if((0,Ye._)`${_r.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Ye._)`${_r.default.vErrors}.length`,e),()=>t.assign(_r.default.vErrors,null)))}or.resetErrorsCount=KD;function GD({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",i,_r.default.errors,u=>{t.const(a,(0,Ye._)`${_r.default.vErrors}[${u}]`),t.if((0,Ye._)`${a}.instancePath === undefined`,()=>t.assign((0,Ye._)`${a}.instancePath`,(0,Ye.strConcat)(_r.default.instancePath,s.errorPath))),t.assign((0,Ye._)`${a}.schemaPath`,(0,Ye.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Ye._)`${a}.schema`,r),t.assign((0,Ye._)`${a}.data`,n))})}or.extendErrors=GD;function Cx(t,e){let r=t.const("err",e);t.if((0,Ye._)`${_r.default.vErrors} === null`,()=>t.assign(_r.default.vErrors,(0,Ye._)`[${r}]`),(0,Ye._)`${_r.default.vErrors}.push(${r})`),t.code((0,Ye._)`${_r.default.errors}++`)}function Rx(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,Ye._)`new ${t.ValidationError}(${e})`):(r.assign((0,Ye._)`${n}.errors`,e),r.return(!1))}var Jo={keyword:new Ye.Name("keyword"),schemaPath:new Ye.Name("schemaPath"),params:new Ye.Name("params"),propertyName:new Ye.Name("propertyName"),message:new Ye.Name("message"),schema:new Ye.Name("schema"),parentSchema:new Ye.Name("parentSchema")};function Ix(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Ye._)`{}`:QD(t,e,r)}function QD(t,e,r={}){let{gen:n,it:i}=t,s=[ZD(i,r),XD(t,r)];return eF(t,e,s),n.object(...s)}function ZD({errorPath:t},{instancePath:e}){let r=e?(0,Ye.str)`${t}${(0,Hh.getErrorPath)(e,Hh.Type.Str)}`:t;return[_r.default.instancePath,(0,Ye.strConcat)(_r.default.instancePath,r)]}function XD({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Ye.str)`${e}/${t}`;return r&&(i=(0,Ye.str)`${i}${(0,Hh.getErrorPath)(r,Hh.Type.Str)}`),[Jo.schemaPath,i]}function eF(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:a,it:u}=t,{opts:f,propertyName:h,topSchemaRef:g,schemaPath:m}=u;n.push([Jo.keyword,i],[Jo.params,typeof e=="function"?e(t):e||(0,Ye._)`{}`]),f.messages&&n.push([Jo.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([Jo.schema,a],[Jo.parentSchema,(0,Ye._)`${g}${m}`],[_r.default.data,s]),h&&n.push([Jo.propertyName,h])}});var Px=F(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.boolOrEmptySchema=kl.topBoolOrEmptySchema=void 0;var tF=Lc(),rF=Ne(),nF=zi(),iF={message:"boolean schema is false"};function sF(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Ox(t,!1):typeof r=="object"&&r.$async===!0?e.return(nF.default.data):(e.assign((0,rF._)`${n}.errors`,null),e.return(!0))}kl.topBoolOrEmptySchema=sF;function oF(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Ox(t)):r.var(e,!0)}kl.boolOrEmptySchema=oF;function Ox(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,tF.reportError)(i,iF,void 0,e)}});var sS=F(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.getRules=Al.isJSONType=void 0;var aF=["string","number","integer","boolean","null","object","array"],lF=new Set(aF);function uF(t){return typeof t=="string"&&lF.has(t)}Al.isJSONType=uF;function cF(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Al.getRules=cF});var oS=F(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.shouldUseRule=Ns.shouldUseGroup=Ns.schemaHasRulesForType=void 0;function fF({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&kx(t,n)}Ns.schemaHasRulesForType=fF;function kx(t,e){return e.rules.some(r=>Ax(t,r))}Ns.shouldUseGroup=kx;function Ax(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Ns.shouldUseRule=Ax});var jc=F(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.reportTypeError=ar.checkDataTypes=ar.checkDataType=ar.coerceAndCheckDataType=ar.getJSONTypes=ar.getSchemaTypes=ar.DataType=void 0;var dF=sS(),hF=oS(),pF=Lc(),Re=Ne(),Tx=We(),Tl;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Tl||(ar.DataType=Tl={}));function mF(t){let e=qx(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}ar.getSchemaTypes=mF;function qx(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(dF.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}ar.getJSONTypes=qx;function gF(t,e){let{gen:r,data:n,opts:i}=t,s=yF(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,hF.schemaHasRulesForType)(t,e[0]));if(a){let u=lS(e,n,i.strictNumbers,Tl.Wrong);r.if(u,()=>{s.length?vF(t,e,s):uS(t)})}return a}ar.coerceAndCheckDataType=gF;var $x=new Set(["string","number","integer","boolean","null"]);function yF(t,e){return e?t.filter(r=>$x.has(r)||e==="array"&&r==="array"):[]}function vF(t,e,r){let{gen:n,data:i,opts:s}=t,a=n.let("dataType",(0,Re._)`typeof ${i}`),u=n.let("coerced",(0,Re._)`undefined`);s.coerceTypes==="array"&&n.if((0,Re._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Re._)`${i}[0]`).assign(a,(0,Re._)`typeof ${i}`).if(lS(e,i,s.strictNumbers),()=>n.assign(u,i))),n.if((0,Re._)`${u} !== undefined`);for(let h of r)($x.has(h)||h==="array"&&s.coerceTypes==="array")&&f(h);n.else(),uS(t),n.endIf(),n.if((0,Re._)`${u} !== undefined`,()=>{n.assign(i,u),SF(t,u)});function f(h){switch(h){case"string":n.elseIf((0,Re._)`${a} == "number" || ${a} == "boolean"`).assign(u,(0,Re._)`"" + ${i}`).elseIf((0,Re._)`${i} === null`).assign(u,(0,Re._)`""`);return;case"number":n.elseIf((0,Re._)`${a} == "boolean" || ${i} === null
|
|
25
|
+
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(u,(0,Re._)`+${i}`);return;case"integer":n.elseIf((0,Re._)`${a} === "boolean" || ${i} === null
|
|
26
|
+
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(u,(0,Re._)`+${i}`);return;case"boolean":n.elseIf((0,Re._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(u,!1).elseIf((0,Re._)`${i} === "true" || ${i} === 1`).assign(u,!0);return;case"null":n.elseIf((0,Re._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(u,null);return;case"array":n.elseIf((0,Re._)`${a} === "string" || ${a} === "number"
|
|
27
|
+
|| ${a} === "boolean" || ${i} === null`).assign(u,(0,Re._)`[${i}]`)}}}function SF({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Re._)`${e} !== undefined`,()=>t.assign((0,Re._)`${e}[${r}]`,n))}function aS(t,e,r,n=Tl.Correct){let i=n===Tl.Correct?Re.operators.EQ:Re.operators.NEQ,s;switch(t){case"null":return(0,Re._)`${e} ${i} null`;case"array":s=(0,Re._)`Array.isArray(${e})`;break;case"object":s=(0,Re._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Re._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Re._)`typeof ${e} ${i} ${t}`}return n===Tl.Correct?s:(0,Re.not)(s);function a(u=Re.nil){return(0,Re.and)((0,Re._)`typeof ${e} == "number"`,u,r?(0,Re._)`isFinite(${e})`:Re.nil)}}ar.checkDataType=aS;function lS(t,e,r,n){if(t.length===1)return aS(t[0],e,r,n);let i,s=(0,Tx.toHash)(t);if(s.array&&s.object){let a=(0,Re._)`typeof ${e} != "object"`;i=s.null?a:(0,Re._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Re.nil;s.number&&delete s.integer;for(let a in s)i=(0,Re.and)(i,aS(a,e,r,n));return i}ar.checkDataTypes=lS;var bF={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Re._)`{type: ${t}}`:(0,Re._)`{type: ${e}}`};function uS(t){let e=_F(t);(0,pF.reportError)(e,bF)}ar.reportTypeError=uS;function _F(t){let{gen:e,data:r,schema:n}=t,i=(0,Tx.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var Nx=F(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.assignDefaults=void 0;var ql=Ne(),wF=We();function EF(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)Mx(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>Mx(t,s,i.default))}Vh.assignDefaults=EF;function Mx(t,e,r){let{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;let u=(0,ql._)`${s}${(0,ql.getProperty)(e)}`;if(i){(0,wF.checkStrictMode)(t,`default is ignored for: ${u}`);return}let f=(0,ql._)`${u} === undefined`;a.useDefaults==="empty"&&(f=(0,ql._)`${f} || ${u} === null || ${u} === ""`),n.if(f,(0,ql._)`${u} = ${(0,ql.stringify)(r)}`)}});var gn=F(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.validateUnion=ct.validateArray=ct.usePattern=ct.callValidateCode=ct.schemaProperties=ct.allSchemaProperties=ct.noPropertyInData=ct.propertyInData=ct.isOwnProperty=ct.hasPropFunc=ct.reportMissingProp=ct.checkMissingProp=ct.checkReportMissingProp=void 0;var mt=Ne(),cS=We(),Ds=zi(),xF=We();function CF(t,e){let{gen:r,data:n,it:i}=t;r.if(dS(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,mt._)`${e}`},!0),t.error()})}ct.checkReportMissingProp=CF;function RF({gen:t,data:e,it:{opts:r}},n,i){return(0,mt.or)(...n.map(s=>(0,mt.and)(dS(t,e,s,r.ownProperties),(0,mt._)`${i} = ${s}`)))}ct.checkMissingProp=RF;function IF(t,e){t.setParams({missingProperty:e},!0),t.error()}ct.reportMissingProp=IF;function Dx(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,mt._)`Object.prototype.hasOwnProperty`})}ct.hasPropFunc=Dx;function fS(t,e,r){return(0,mt._)`${Dx(t)}.call(${e}, ${r})`}ct.isOwnProperty=fS;function OF(t,e,r,n){let i=(0,mt._)`${e}${(0,mt.getProperty)(r)} !== undefined`;return n?(0,mt._)`${i} && ${fS(t,e,r)}`:i}ct.propertyInData=OF;function dS(t,e,r,n){let i=(0,mt._)`${e}${(0,mt.getProperty)(r)} === undefined`;return n?(0,mt.or)(i,(0,mt.not)(fS(t,e,r))):i}ct.noPropertyInData=dS;function Fx(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ct.allSchemaProperties=Fx;function PF(t,e){return Fx(e).filter(r=>!(0,cS.alwaysValidSchema)(t,e[r]))}ct.schemaProperties=PF;function kF({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},u,f,h){let g=h?(0,mt._)`${t}, ${e}, ${n}${i}`:e,m=[[Ds.default.instancePath,(0,mt.strConcat)(Ds.default.instancePath,s)],[Ds.default.parentData,a.parentData],[Ds.default.parentDataProperty,a.parentDataProperty],[Ds.default.rootData,Ds.default.rootData]];a.opts.dynamicRef&&m.push([Ds.default.dynamicAnchors,Ds.default.dynamicAnchors]);let S=(0,mt._)`${g}, ${r.object(...m)}`;return f!==mt.nil?(0,mt._)`${u}.call(${f}, ${S})`:(0,mt._)`${u}(${S})`}ct.callValidateCode=kF;var AF=(0,mt._)`new RegExp`;function TF({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,mt._)`${i.code==="new RegExp"?AF:(0,xF.useFunc)(t,i)}(${r}, ${n})`})}ct.usePattern=TF;function qF(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let u=e.let("valid",!0);return a(()=>e.assign(u,!1)),u}return e.var(s,!0),a(()=>e.break()),s;function a(u){let f=e.const("len",(0,mt._)`${r}.length`);e.forRange("i",0,f,h=>{t.subschema({keyword:n,dataProp:h,dataPropType:cS.Type.Num},s),e.if((0,mt.not)(s),u)})}}ct.validateArray=qF;function $F(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,cS.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let a=e.let("valid",!1),u=e.name("_valid");e.block(()=>r.forEach((f,h)=>{let g=t.subschema({keyword:n,schemaProp:h,compositeRule:!0},u);e.assign(a,(0,mt._)`${a} || ${u}`),t.mergeValidEvaluated(g,u)||e.if((0,mt.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}ct.validateUnion=$F});var Ux=F(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.validateKeywordUsage=vi.validSchemaType=vi.funcKeywordCode=vi.macroKeywordCode=void 0;var wr=Ne(),zo=zi(),MF=gn(),NF=Lc();function DF(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,u=e.macro.call(a.self,i,s,a),f=jx(r,n,u);a.opts.validateSchema!==!1&&a.self.validateSchema(u,!0);let h=r.name("valid");t.subschema({schema:u,schemaPath:wr.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},h),t.pass(h,()=>t.error(!0))}vi.macroKeywordCode=DF;function FF(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:u,it:f}=t;jF(f,e);let h=!u&&e.compile?e.compile.call(f.self,s,a,f):e.validate,g=jx(n,i,h),m=n.let("valid");t.block$data(m,S),t.ok((r=e.valid)!==null&&r!==void 0?r:m);function S(){if(e.errors===!1)C(),e.modifying&&Lx(t),A(()=>t.error());else{let T=e.async?E():x();e.modifying&&Lx(t),A(()=>LF(t,T))}}function E(){let T=n.let("ruleErrs",null);return n.try(()=>C((0,wr._)`await `),B=>n.assign(m,!1).if((0,wr._)`${B} instanceof ${f.ValidationError}`,()=>n.assign(T,(0,wr._)`${B}.errors`),()=>n.throw(B))),T}function x(){let T=(0,wr._)`${g}.errors`;return n.assign(T,null),C(wr.nil),T}function C(T=e.async?(0,wr._)`await `:wr.nil){let B=f.opts.passContext?zo.default.this:zo.default.self,Y=!("compile"in e&&!u||e.schema===!1);n.assign(m,(0,wr._)`${T}${(0,MF.callValidateCode)(t,g,B,Y)}`,e.modifying)}function A(T){var B;n.if((0,wr.not)((B=e.valid)!==null&&B!==void 0?B:m),T)}}vi.funcKeywordCode=FF;function Lx(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,wr._)`${n.parentData}[${n.parentDataProperty}]`))}function LF(t,e){let{gen:r}=t;r.if((0,wr._)`Array.isArray(${e})`,()=>{r.assign(zo.default.vErrors,(0,wr._)`${zo.default.vErrors} === null ? ${e} : ${zo.default.vErrors}.concat(${e})`).assign(zo.default.errors,(0,wr._)`${zo.default.vErrors}.length`),(0,NF.extendErrors)(t)},()=>t.error())}function jF({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function jx(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,wr.stringify)(r)})}function UF(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}vi.validSchemaType=UF;function BF({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a?.some(u=>!Object.prototype.hasOwnProperty.call(t,u)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}vi.validateKeywordUsage=BF});var Hx=F(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.extendSubschemaMode=Fs.extendSubschemaData=Fs.getSubschema=void 0;var Si=Ne(),Bx=We();function HF(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let u=t.schema[e];return r===void 0?{schema:u,schemaPath:(0,Si._)`${t.schemaPath}${(0,Si.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:u[r],schemaPath:(0,Si._)`${t.schemaPath}${(0,Si.getProperty)(e)}${(0,Si.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Bx.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Fs.getSubschema=HF;function VF(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=e;if(r!==void 0){let{errorPath:h,dataPathArr:g,opts:m}=e,S=u.let("data",(0,Si._)`${e.data}${(0,Si.getProperty)(r)}`,!0);f(S),t.errorPath=(0,Si.str)`${h}${(0,Bx.getErrorPath)(r,n,m.jsPropertySyntax)}`,t.parentDataProperty=(0,Si._)`${r}`,t.dataPathArr=[...g,t.parentDataProperty]}if(i!==void 0){let h=i instanceof Si.Name?i:u.let("data",i,!0);f(h),a!==void 0&&(t.propertyName=a)}s&&(t.dataTypes=s);function f(h){t.data=h,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,h]}}Fs.extendSubschemaData=VF;function WF(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}Fs.extendSubschemaMode=WF});var hS=F((p6,Vx)=>{"use strict";Vx.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var Yx=F((m6,Wx)=>{"use strict";var Ls=Wx.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Wh(e,n,i,t,"",t)};Ls.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ls.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ls.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ls.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 Wh(t,e,r,n,i,s,a,u,f,h){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,a,u,f,h);for(var g in n){var m=n[g];if(Array.isArray(m)){if(g in Ls.arrayKeywords)for(var S=0;S<m.length;S++)Wh(t,e,r,m[S],i+"/"+g+"/"+S,s,i,g,n,S)}else if(g in Ls.propsKeywords){if(m&&typeof m=="object")for(var E in m)Wh(t,e,r,m[E],i+"/"+g+"/"+YF(E),s,i,g,n,E)}else(g in Ls.keywords||t.allKeys&&!(g in Ls.skipKeywords))&&Wh(t,e,r,m,i+"/"+g,s,i,g,n)}r(n,i,s,a,u,f,h)}}function YF(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Uc=F(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.getSchemaRefs=qr.resolveUrl=qr.normalizeId=qr._getFullPath=qr.getFullPath=qr.inlineRef=void 0;var JF=We(),zF=hS(),KF=Yx(),GF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function QF(t,e=!0){return typeof t=="boolean"?!0:e===!0?!pS(t):e?Jx(t)<=e:!1}qr.inlineRef=QF;var ZF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function pS(t){for(let e in t){if(ZF.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(pS)||typeof r=="object"&&pS(r))return!0}return!1}function Jx(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!GF.has(r)&&(typeof t[r]=="object"&&(0,JF.eachItem)(t[r],n=>e+=Jx(n)),e===1/0))return 1/0}return e}function zx(t,e="",r){r!==!1&&(e=$l(e));let n=t.parse(e);return Kx(t,n)}qr.getFullPath=zx;function Kx(t,e){return t.serialize(e).split("#")[0]+"#"}qr._getFullPath=Kx;var XF=/#\/?$/;function $l(t){return t?t.replace(XF,""):""}qr.normalizeId=$l;function eL(t,e,r){return r=$l(r),t.resolve(e,r)}qr.resolveUrl=eL;var tL=/^[a-z_][-a-z0-9._]*$/i;function rL(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=$l(t[r]||e),s={"":i},a=zx(n,i,!1),u={},f=new Set;return KF(t,{allKeys:!0},(m,S,E,x)=>{if(x===void 0)return;let C=a+S,A=s[x];typeof m[r]=="string"&&(A=T.call(this,m[r])),B.call(this,m.$anchor),B.call(this,m.$dynamicAnchor),s[S]=A;function T(Y){let H=this.opts.uriResolver.resolve;if(Y=$l(A?H(A,Y):Y),f.has(Y))throw g(Y);f.add(Y);let K=this.refs[Y];return typeof K=="string"&&(K=this.refs[K]),typeof K=="object"?h(m,K.schema,Y):Y!==$l(C)&&(Y[0]==="#"?(h(m,u[Y],Y),u[Y]=m):this.refs[Y]=C),Y}function B(Y){if(typeof Y=="string"){if(!tL.test(Y))throw new Error(`invalid anchor "${Y}"`);T.call(this,`#${Y}`)}}}),u;function h(m,S,E){if(S!==void 0&&!zF(m,S))throw g(E)}function g(m){return new Error(`reference "${m}" resolves to more than one schema`)}}qr.getSchemaRefs=rL});var Vc=F(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.getData=js.KeywordCxt=js.validateFunctionCode=void 0;var eC=Px(),Gx=jc(),gS=oS(),Yh=jc(),nL=Nx(),Hc=Ux(),mS=Hx(),fe=Ne(),_e=zi(),iL=Uc(),Ki=We(),Bc=Lc();function sL(t){if(nC(t)&&(iC(t),rC(t))){lL(t);return}tC(t,()=>(0,eC.topBoolOrEmptySchema)(t))}js.validateFunctionCode=sL;function tC({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,fe._)`${_e.default.data}, ${_e.default.valCxt}`,n.$async,()=>{t.code((0,fe._)`"use strict"; ${Qx(r,i)}`),aL(t,i),t.code(s)}):t.func(e,(0,fe._)`${_e.default.data}, ${oL(i)}`,n.$async,()=>t.code(Qx(r,i)).code(s))}function oL(t){return(0,fe._)`{${_e.default.instancePath}="", ${_e.default.parentData}, ${_e.default.parentDataProperty}, ${_e.default.rootData}=${_e.default.data}${t.dynamicRef?(0,fe._)`, ${_e.default.dynamicAnchors}={}`:fe.nil}}={}`}function aL(t,e){t.if(_e.default.valCxt,()=>{t.var(_e.default.instancePath,(0,fe._)`${_e.default.valCxt}.${_e.default.instancePath}`),t.var(_e.default.parentData,(0,fe._)`${_e.default.valCxt}.${_e.default.parentData}`),t.var(_e.default.parentDataProperty,(0,fe._)`${_e.default.valCxt}.${_e.default.parentDataProperty}`),t.var(_e.default.rootData,(0,fe._)`${_e.default.valCxt}.${_e.default.rootData}`),e.dynamicRef&&t.var(_e.default.dynamicAnchors,(0,fe._)`${_e.default.valCxt}.${_e.default.dynamicAnchors}`)},()=>{t.var(_e.default.instancePath,(0,fe._)`""`),t.var(_e.default.parentData,(0,fe._)`undefined`),t.var(_e.default.parentDataProperty,(0,fe._)`undefined`),t.var(_e.default.rootData,_e.default.data),e.dynamicRef&&t.var(_e.default.dynamicAnchors,(0,fe._)`{}`)})}function lL(t){let{schema:e,opts:r,gen:n}=t;tC(t,()=>{r.$comment&&e.$comment&&oC(t),hL(t),n.let(_e.default.vErrors,null),n.let(_e.default.errors,0),r.unevaluated&&uL(t),sC(t),gL(t)})}function uL(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,fe._)`${r}.evaluated`),e.if((0,fe._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,fe._)`${t.evaluated}.props`,(0,fe._)`undefined`)),e.if((0,fe._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,fe._)`${t.evaluated}.items`,(0,fe._)`undefined`))}function Qx(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,fe._)`/*# sourceURL=${r} */`:fe.nil}function cL(t,e){if(nC(t)&&(iC(t),rC(t))){fL(t,e);return}(0,eC.boolOrEmptySchema)(t,e)}function rC({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function nC(t){return typeof t.schema!="boolean"}function fL(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&oC(t),pL(t),mL(t);let s=n.const("_errs",_e.default.errors);sC(t,s),n.var(e,(0,fe._)`${s} === ${_e.default.errors}`)}function iC(t){(0,Ki.checkUnknownRules)(t),dL(t)}function sC(t,e){if(t.opts.jtd)return Zx(t,[],!1,e);let r=(0,Gx.getSchemaTypes)(t.schema),n=(0,Gx.coerceAndCheckDataType)(t,r);Zx(t,r,!n,e)}function dL(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Ki.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function hL(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ki.checkStrictMode)(t,"default is ignored in the schema root")}function pL(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,iL.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function mL(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function oC({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,fe._)`${_e.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,fe.str)`${n}/$comment`,u=t.scopeValue("root",{ref:e.root});t.code((0,fe._)`${_e.default.self}.opts.$comment(${s}, ${a}, ${u}.schema)`)}}function gL(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,fe._)`${_e.default.errors} === 0`,()=>e.return(_e.default.data),()=>e.throw((0,fe._)`new ${i}(${_e.default.vErrors})`)):(e.assign((0,fe._)`${n}.errors`,_e.default.vErrors),s.unevaluated&&yL(t),e.return((0,fe._)`${_e.default.errors} === 0`))}function yL({gen:t,evaluated:e,props:r,items:n}){r instanceof fe.Name&&t.assign((0,fe._)`${e}.props`,r),n instanceof fe.Name&&t.assign((0,fe._)`${e}.items`,n)}function Zx(t,e,r,n){let{gen:i,schema:s,data:a,allErrors:u,opts:f,self:h}=t,{RULES:g}=h;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,Ki.schemaHasRulesButRef)(s,g))){i.block(()=>lC(t,"$ref",g.all.$ref.definition));return}f.jtd||vL(t,e),i.block(()=>{for(let S of g.rules)m(S);m(g.post)});function m(S){(0,gS.shouldUseGroup)(s,S)&&(S.type?(i.if((0,Yh.checkDataType)(S.type,a,f.strictNumbers)),Xx(t,S),e.length===1&&e[0]===S.type&&r&&(i.else(),(0,Yh.reportTypeError)(t)),i.endIf()):Xx(t,S),u||i.if((0,fe._)`${_e.default.errors} === ${n||0}`))}}function Xx(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,nL.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,gS.shouldUseRule)(n,s)&&lC(t,s.keyword,s.definition,e.type)})}function vL(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(SL(t,e),t.opts.allowUnionTypes||bL(t,e),_L(t,t.dataTypes))}function SL(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{aC(t.dataTypes,r)||yS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),EL(t,e)}}function bL(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&yS(t,"use allowUnionTypes to allow union type keyword")}function _L(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,gS.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>wL(e,a))&&yS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function wL(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function aC(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function EL(t,e){let r=[];for(let n of t.dataTypes)aC(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function yS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Ki.checkStrictMode)(t,e,t.opts.strictTypes)}var Jh=class{constructor(e,r,n){if((0,Hc.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ki.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",uC(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Hc.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",_e.default.errors))}result(e,r,n){this.failResult((0,fe.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,fe.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,fe._)`${r} !== undefined && (${(0,fe.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Bc.reportExtraError:Bc.reportError)(this,this.def.error,r)}$dataError(){(0,Bc.reportError)(this,this.def.$dataError||Bc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Bc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=fe.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=fe.nil,r=fe.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,fe.or)((0,fe._)`${i} === undefined`,r)),e!==fe.nil&&n.assign(e,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==fe.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,fe.or)(a(),u());function a(){if(n.length){if(!(r instanceof fe.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,fe._)`${(0,Yh.checkDataTypes)(f,r,s.opts.strictNumbers,Yh.DataType.Wrong)}`}return fe.nil}function u(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,fe._)`!${f}(${r})`}return fe.nil}}subschema(e,r){let n=(0,mS.getSubschema)(this.it,e);(0,mS.extendSubschemaData)(n,this.it,e),(0,mS.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return cL(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Ki.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Ki.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,fe.Name)),!0}};js.KeywordCxt=Jh;function lC(t,e,r,n){let i=new Jh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Hc.funcKeywordCode)(i,r):"macro"in r?(0,Hc.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Hc.funcKeywordCode)(i,r)}var xL=/^\/(?:[^~]|~0|~1)*$/,CL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function uC(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return _e.default.rootData;if(t[0]==="/"){if(!xL.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=_e.default.rootData}else{let h=CL.exec(t);if(!h)throw new Error(`Invalid JSON-pointer: ${t}`);let g=+h[1];if(i=h[2],i==="#"){if(g>=e)throw new Error(f("property/index",g));return n[e-g]}if(g>e)throw new Error(f("data",g));if(s=r[e-g],!i)return s}let a=s,u=i.split("/");for(let h of u)h&&(s=(0,fe._)`${s}${(0,fe.getProperty)((0,Ki.unescapeJsonPointer)(h))}`,a=(0,fe._)`${a} && ${s}`);return a;function f(h,g){return`Cannot access ${h} ${g} levels up, current level is ${e}`}}js.getData=uC});var zh=F(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});var vS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};SS.default=vS});var Wc=F(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});var bS=Uc(),_S=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,bS.resolveUrl)(e,r,n),this.missingSchema=(0,bS.normalizeId)((0,bS.getFullPath)(e,this.missingRef))}};wS.default=_S});var Gh=F(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.resolveSchema=yn.getCompilingSchema=yn.resolveRef=yn.compileSchema=yn.SchemaEnv=void 0;var Bn=Ne(),RL=zh(),Ko=zi(),Hn=Uc(),cC=We(),IL=Vc(),Ml=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Hn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};yn.SchemaEnv=Ml;function xS(t){let e=fC.call(this,t);if(e)return e;let r=(0,Hn.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Bn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),u;t.$async&&(u=a.scopeValue("Error",{ref:RL.default,code:(0,Bn._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");t.validateName=f;let h={gen:a,allErrors:this.opts.allErrors,data:Ko.default.data,parentData:Ko.default.parentData,parentDataProperty:Ko.default.parentDataProperty,dataNames:[Ko.default.data],dataPathArr:[Bn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Bn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:u,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Bn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Bn._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(t),(0,IL.validateFunctionCode)(h),a.optimize(this.opts.code.optimize);let m=a.toString();g=`${a.scopeRefs(Ko.default.scope)}return ${m}`,this.opts.code.process&&(g=this.opts.code.process(g,t));let E=new Function(`${Ko.default.self}`,`${Ko.default.scope}`,g)(this,this.scope.get());if(this.scope.value(f,{ref:E}),E.errors=null,E.schema=t.schema,E.schemaEnv=t,t.$async&&(E.$async=!0),this.opts.code.source===!0&&(E.source={validateName:f,validateCode:m,scopeValues:a._values}),this.opts.unevaluated){let{props:x,items:C}=h;E.evaluated={props:x instanceof Bn.Name?void 0:x,items:C instanceof Bn.Name?void 0:C,dynamicProps:x instanceof Bn.Name,dynamicItems:C instanceof Bn.Name},E.source&&(E.source.evaluated=(0,Bn.stringify)(E.evaluated))}return t.validate=E,t}catch(m){throw delete t.validate,delete t.validateName,g&&this.logger.error("Error compiling schema, function code:",g),m}finally{this._compilations.delete(t)}}yn.compileSchema=xS;function OL(t,e,r){var n;r=(0,Hn.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=AL.call(this,t,r);if(s===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:u}=this.opts;a&&(s=new Ml({schema:a,schemaId:u,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=PL.call(this,s)}yn.resolveRef=OL;function PL(t){return(0,Hn.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:xS.call(this,t)}function fC(t){for(let e of this._compilations)if(kL(e,t))return e}yn.getCompilingSchema=fC;function kL(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function AL(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Kh.call(this,t,e)}function Kh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Hn._getFullPath)(this.opts.uriResolver,r),i=(0,Hn.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return ES.call(this,r,t);let s=(0,Hn.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let u=Kh.call(this,t,a);return typeof u?.schema!="object"?void 0:ES.call(this,r,u)}if(typeof a?.schema=="object"){if(a.validate||xS.call(this,a),s===(0,Hn.normalizeId)(e)){let{schema:u}=a,{schemaId:f}=this.opts,h=u[f];return h&&(i=(0,Hn.resolveUrl)(this.opts.uriResolver,i,h)),new Ml({schema:u,schemaId:f,root:t,baseId:i})}return ES.call(this,r,a)}}yn.resolveSchema=Kh;var TL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function ES(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let u of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let f=r[(0,cC.unescapeFragment)(u)];if(f===void 0)return;r=f;let h=typeof r=="object"&&r[this.opts.schemaId];!TL.has(u)&&h&&(e=(0,Hn.resolveUrl)(this.opts.uriResolver,e,h))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,cC.schemaHasRulesButRef)(r,this.RULES)){let u=(0,Hn.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Kh.call(this,n,u)}let{schemaId:a}=this.opts;if(s=s||new Ml({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var dC=F((_6,qL)=>{qL.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 IS=F((w6,vC)=>{"use strict";var $L=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),pC=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),CS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),mC=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),ML=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function RS(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var NL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function hC(t){return t.length=0,!0}function DL(t,e,r){if(t.length){let n=RS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function FL(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,u=DL;for(let f=0;f<t.length;f++){let h=t[f];if(!(h==="["||h==="]"))if(h===":"){if(s===!0&&(a=!0),!u(i,n,r))break;if(++e>7){r.error=!0;break}f>0&&t[f-1]===":"&&(s=!0),n.push(":");continue}else if(h==="%"){if(!u(i,n,r))break;u=hC}else{i.push(h);continue}}return i.length&&(u===hC?r.zone=i.join(""):a?n.push(i.join("")):n.push(RS(i))),r.address=n.join(""),r}function gC(t){if(LL(t,":")<2)return{host:t,isIPV6:!1};let e=FL(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function LL(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function jL(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var UL={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},BL=/[@/?#:]/g,HL=/[@/?#]/g;function yC(t,e){let r=e?HL:BL;return r.lastIndex=0,t.replace(r,n=>UL[n])}function VL(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(CS(i)){let s=i.toUpperCase(),a=String.fromCharCode(parseInt(s,16));e&&mC(a)?r+=a:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function WL(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(CS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&mC(s)?e+=s:e+="%"+i,r+=2;continue}}ML(t[r])?e+=t[r]:e+=escape(t[r])}return e}function YL(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(CS(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function JL(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!pC(r)){let n=gC(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=yC(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}vC.exports={nonSimpleDomain:NL,recomposeAuthority:JL,reescapeHostDelimiters:yC,normalizePercentEncoding:VL,normalizePathEncoding:WL,escapePreservingEscapes:YL,removeDotSegments:jL,isIPv4:pC,isUUID:$L,normalizeIPv6:gC,stringArrayToHexStripped:RS}});var EC=F((E6,wC)=>{"use strict";var{isUUID:zL}=IS(),KL=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,GL=["http","https","ws","wss","urn","urn:uuid"];function QL(t){return GL.indexOf(t)!==-1}function OS(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function SC(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function bC(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function ZL(t){return t.secure=OS(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function XL(t){if((t.port===(OS(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function ej(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(KL);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=PS(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function tj(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=PS(i);s&&(t=s.serialize(t,e));let a=t,u=t.nss;return a.path=`${n||e.nid}:${u}`,e.skipEscape=!0,a}function rj(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!zL(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function nj(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var _C={scheme:"http",domainHost:!0,parse:SC,serialize:bC},ij={scheme:"https",domainHost:_C.domainHost,parse:SC,serialize:bC},Qh={scheme:"ws",domainHost:!0,parse:ZL,serialize:XL},sj={scheme:"wss",domainHost:Qh.domainHost,parse:Qh.parse,serialize:Qh.serialize},oj={scheme:"urn",parse:ej,serialize:tj,skipNormalize:!0},aj={scheme:"urn:uuid",parse:rj,serialize:nj,skipNormalize:!0},Zh={http:_C,https:ij,ws:Qh,wss:sj,urn:oj,"urn:uuid":aj};Object.setPrototypeOf(Zh,null);function PS(t){return t&&(Zh[t]||Zh[t.toLowerCase()])||void 0}wC.exports={wsIsSecure:OS,SCHEMES:Zh,isValidSchemeName:QL,getSchemeHandler:PS}});var PC=F((x6,Xh)=>{"use strict";var{normalizeIPv6:lj,removeDotSegments:Yc,recomposeAuthority:uj,normalizePercentEncoding:cj,normalizePathEncoding:fj,escapePreservingEscapes:dj,reescapeHostDelimiters:hj,isIPv4:pj,nonSimpleDomain:mj}=IS(),{SCHEMES:gj,getSchemeHandler:CC}=EC();function yj(t,e){return typeof t=="string"?t=wj(t,e):typeof t=="object"&&(t=Nl(Go(t,e),e)),t}function vj(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=RC(Nl(t,n),Nl(e,n),n,!0);return n.skipEscape=!0,Go(i,n)}function RC(t,e,r,n){let i={};return n||(t=Nl(Go(t,r),r),e=Nl(Go(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Yc(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Yc(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Yc(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=Yc(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function Sj(t,e,r){let n=xC(t,r),i=xC(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function Go(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=CC(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=cj(r.path):(r.path=dj(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=uj(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let u=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(u=Yc(u)),a===void 0&&u[0]==="/"&&u[1]==="/"&&(u="/%2F"+u.slice(2)),i.push(u)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var bj=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function _j(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function IC(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let a=t.match(bj);if(a){n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]);let u=_j(n,a);if(u!==void 0&&(n.error=n.error||u,i=!0),n.host)if(pj(n.host)===!1){let g=lj(n.host);n.host=g.host.toLowerCase(),s=g.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let f=CC(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&mj(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(h){n.error=n.error||"Host's domain name can not be converted to ASCII: "+h}if((!f||f&&!f.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=hj(unescape(n.host),s))),n.path&&(n.path=fj(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}f&&f.parse&&f.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function Nl(t,e){return IC(t,e).parsed}function wj(t,e){return OC(t,e).normalized}function OC(t,e){let{parsed:r,malformedAuthorityOrPort:n}=IC(t,e);return{normalized:n?t:Go(r,e),malformedAuthorityOrPort:n}}function xC(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=OC(t,e);return n?void 0:r}if(typeof t=="object")return Go(t,e)}var kS={SCHEMES:gj,normalize:yj,resolve:vj,resolveComponent:RC,equal:Sj,serialize:Go,parse:Nl};Xh.exports=kS;Xh.exports.default=kS;Xh.exports.fastUri=kS});var AC=F(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});var kC=PC();kC.code='require("ajv/dist/runtime/uri").default';AS.default=kC});var LC=F(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.CodeGen=Gt.Name=Gt.nil=Gt.stringify=Gt.str=Gt._=Gt.KeywordCxt=void 0;var Ej=Vc();Object.defineProperty(Gt,"KeywordCxt",{enumerable:!0,get:function(){return Ej.KeywordCxt}});var Dl=Ne();Object.defineProperty(Gt,"_",{enumerable:!0,get:function(){return Dl._}});Object.defineProperty(Gt,"str",{enumerable:!0,get:function(){return Dl.str}});Object.defineProperty(Gt,"stringify",{enumerable:!0,get:function(){return Dl.stringify}});Object.defineProperty(Gt,"nil",{enumerable:!0,get:function(){return Dl.nil}});Object.defineProperty(Gt,"Name",{enumerable:!0,get:function(){return Dl.Name}});Object.defineProperty(Gt,"CodeGen",{enumerable:!0,get:function(){return Dl.CodeGen}});var xj=zh(),NC=Wc(),Cj=sS(),Jc=Gh(),Rj=Ne(),zc=Uc(),ep=jc(),qS=We(),TC=dC(),Ij=AC(),DC=(t,e)=>new RegExp(t,e);DC.code="new RegExp";var Oj=["removeAdditional","useDefaults","coerceTypes"],Pj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),kj={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."},Aj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},qC=200;function Tj(t){var e,r,n,i,s,a,u,f,h,g,m,S,E,x,C,A,T,B,Y,H,K,X,k,w,P;let N=t.strict,D=(e=t.code)===null||e===void 0?void 0:e.optimize,L=D===!0||D===void 0?1:D||0,z=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:DC,Z=(i=t.uriResolver)!==null&&i!==void 0?i:Ij.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&a!==void 0?a:!0,strictNumbers:(f=(u=t.strictNumbers)!==null&&u!==void 0?u:N)!==null&&f!==void 0?f:!0,strictTypes:(g=(h=t.strictTypes)!==null&&h!==void 0?h:N)!==null&&g!==void 0?g:"log",strictTuples:(S=(m=t.strictTuples)!==null&&m!==void 0?m:N)!==null&&S!==void 0?S:"log",strictRequired:(x=(E=t.strictRequired)!==null&&E!==void 0?E:N)!==null&&x!==void 0?x:!1,code:t.code?{...t.code,optimize:L,regExp:z}:{optimize:L,regExp:z},loopRequired:(C=t.loopRequired)!==null&&C!==void 0?C:qC,loopEnum:(A=t.loopEnum)!==null&&A!==void 0?A:qC,meta:(T=t.meta)!==null&&T!==void 0?T:!0,messages:(B=t.messages)!==null&&B!==void 0?B:!0,inlineRefs:(Y=t.inlineRefs)!==null&&Y!==void 0?Y:!0,schemaId:(H=t.schemaId)!==null&&H!==void 0?H:"$id",addUsedSchema:(K=t.addUsedSchema)!==null&&K!==void 0?K:!0,validateSchema:(X=t.validateSchema)!==null&&X!==void 0?X:!0,validateFormats:(k=t.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:(w=t.unicodeRegExp)!==null&&w!==void 0?w:!0,int32range:(P=t.int32range)!==null&&P!==void 0?P:!0,uriResolver:Z}}var Kc=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Tj(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new Rj.ValueScope({scope:{},prefixes:Pj,es5:r,lines:n}),this.logger=Fj(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Cj.getRules)(),$C.call(this,kj,e,"NOT SUPPORTED"),$C.call(this,Aj,e,"DEPRECATED","warn"),this._metaOpts=Nj.call(this),e.formats&&$j.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&Mj.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),qj.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=TC;n==="id"&&(i={...TC},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(g,m){await s.call(this,g.$schema);let S=this._addSchema(g,m);return S.validate||a.call(this,S)}async function s(g){g&&!this.getSchema(g)&&await i.call(this,{$ref:g},!0)}async function a(g){try{return this._compileSchemaEnv(g)}catch(m){if(!(m instanceof NC.default))throw m;return u.call(this,m),await f.call(this,m.missingSchema),a.call(this,g)}}function u({missingSchema:g,missingRef:m}){if(this.refs[g])throw new Error(`AnySchema ${g} is loaded but ${m} cannot be resolved`)}async function f(g){let m=await h.call(this,g);this.refs[g]||await s.call(this,m.$schema),this.refs[g]||this.addSchema(m,g,r)}async function h(g){let m=this._loading[g];if(m)return m;try{return await(this._loading[g]=n(g))}finally{delete this._loading[g]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:a}=this.opts;if(s=e[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,zc.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=MC.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Jc.SchemaEnv({schema:{},schemaId:n});if(r=Jc.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=MC.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,zc.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(jj.call(this,n,r),!r)return(0,qS.eachItem)(n,s=>TS.call(this,s)),this;Bj.call(this,r);let i={...r,type:(0,ep.getJSONTypes)(r.type),schemaType:(0,ep.getJSONTypes)(r.schemaType)};return(0,qS.eachItem)(n,i.type.length===0?s=>TS.call(this,s,i):s=>i.type.forEach(a=>TS.call(this,s,i,a))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),a=e;for(let u of s)a=a[u];for(let u in n){let f=n[u];if(typeof f!="object")continue;let{$data:h}=f.definition,g=a[u];h&&g&&(a[u]=FC(g))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:u}=this.opts;if(typeof e=="object")a=e[u];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let f=this._cache.get(e);if(f!==void 0)return f;n=(0,zc.normalizeId)(a||n);let h=zc.getSchemaRefs.call(this,e,n);return f=new Jc.SchemaEnv({schema:e,schemaId:u,meta:r,baseId:n,localRefs:h}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),i&&this.validateSchema(e,!0),f}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Jc.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Jc.compileSchema.call(this,e)}finally{this.opts=r}}};Kc.ValidationError=xj.default;Kc.MissingRefError=NC.default;Gt.default=Kc;function $C(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function MC(t){return t=(0,zc.normalizeId)(t),this.schemas[t]||this.refs[t]}function qj(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function $j(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function Mj(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function Nj(){let t={...this.opts};for(let e of Oj)delete t[e];return t}var Dj={log(){},warn(){},error(){}};function Fj(t){if(t===!1)return Dj;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var Lj=/^[a-z_$][a-z0-9_$:-]*$/i;function jj(t,e){let{RULES:r}=this;if((0,qS.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!Lj.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function TS(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:f})=>f===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[t]=!0,!e)return;let u={keyword:t,definition:{...e,type:(0,ep.getJSONTypes)(e.type),schemaType:(0,ep.getJSONTypes)(e.schemaType)}};e.before?Uj.call(this,a,u,e.before):a.rules.push(u),s.all[t]=u,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function Uj(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Bj(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=FC(e)),t.validateSchema=this.compile(e,!0))}var Hj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function FC(t){return{anyOf:[t,Hj]}}});var jC=F($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});var Vj={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};$S.default=Vj});var VC=F(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.callRef=Qo.getValidate=void 0;var Wj=Wc(),UC=gn(),$r=Ne(),Fl=zi(),BC=Gh(),tp=We(),Yj={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:a,opts:u,self:f}=n,{root:h}=s;if((r==="#"||r==="#/")&&i===h.baseId)return m();let g=BC.resolveRef.call(f,h,i,r);if(g===void 0)throw new Wj.default(n.opts.uriResolver,i,r);if(g instanceof BC.SchemaEnv)return S(g);return E(g);function m(){if(s===h)return rp(t,a,s,s.$async);let x=e.scopeValue("root",{ref:h});return rp(t,(0,$r._)`${x}.validate`,h,h.$async)}function S(x){let C=HC(t,x);rp(t,C,x,x.$async)}function E(x){let C=e.scopeValue("schema",u.code.source===!0?{ref:x,code:(0,$r.stringify)(x)}:{ref:x}),A=e.name("valid"),T=t.subschema({schema:x,dataTypes:[],schemaPath:$r.nil,topSchemaRef:C,errSchemaPath:r},A);t.mergeEvaluated(T),t.ok(A)}}};function HC(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,$r._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Qo.getValidate=HC;function rp(t,e,r,n){let{gen:i,it:s}=t,{allErrors:a,schemaEnv:u,opts:f}=s,h=f.passContext?Fl.default.this:$r.nil;n?g():m();function g(){if(!u.$async)throw new Error("async schema referenced by sync schema");let x=i.let("valid");i.try(()=>{i.code((0,$r._)`await ${(0,UC.callValidateCode)(t,e,h)}`),E(e),a||i.assign(x,!0)},C=>{i.if((0,$r._)`!(${C} instanceof ${s.ValidationError})`,()=>i.throw(C)),S(C),a||i.assign(x,!1)}),t.ok(x)}function m(){t.result((0,UC.callValidateCode)(t,e,h),()=>E(e),()=>S(e))}function S(x){let C=(0,$r._)`${x}.errors`;i.assign(Fl.default.vErrors,(0,$r._)`${Fl.default.vErrors} === null ? ${C} : ${Fl.default.vErrors}.concat(${C})`),i.assign(Fl.default.errors,(0,$r._)`${Fl.default.vErrors}.length`)}function E(x){var C;if(!s.opts.unevaluated)return;let A=(C=r?.validate)===null||C===void 0?void 0:C.evaluated;if(s.props!==!0)if(A&&!A.dynamicProps)A.props!==void 0&&(s.props=tp.mergeEvaluated.props(i,A.props,s.props));else{let T=i.var("props",(0,$r._)`${x}.evaluated.props`);s.props=tp.mergeEvaluated.props(i,T,s.props,$r.Name)}if(s.items!==!0)if(A&&!A.dynamicItems)A.items!==void 0&&(s.items=tp.mergeEvaluated.items(i,A.items,s.items));else{let T=i.var("items",(0,$r._)`${x}.evaluated.items`);s.items=tp.mergeEvaluated.items(i,T,s.items,$r.Name)}}}Qo.callRef=rp;Qo.default=Yj});var WC=F(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});var Jj=jC(),zj=VC(),Kj=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Jj.default,zj.default];MS.default=Kj});var YC=F(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});var np=Ne(),Us=np.operators,ip={maximum:{okStr:"<=",ok:Us.LTE,fail:Us.GT},minimum:{okStr:">=",ok:Us.GTE,fail:Us.LT},exclusiveMaximum:{okStr:"<",ok:Us.LT,fail:Us.GTE},exclusiveMinimum:{okStr:">",ok:Us.GT,fail:Us.LTE}},Gj={message:({keyword:t,schemaCode:e})=>(0,np.str)`must be ${ip[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,np._)`{comparison: ${ip[t].okStr}, limit: ${e}}`},Qj={keyword:Object.keys(ip),type:"number",schemaType:"number",$data:!0,error:Gj,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,np._)`${r} ${ip[e].fail} ${n} || isNaN(${r})`)}};NS.default=Qj});var JC=F(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var Gc=Ne(),Zj={message:({schemaCode:t})=>(0,Gc.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Gc._)`{multipleOf: ${t}}`},Xj={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Zj,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),u=s?(0,Gc._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,Gc._)`${a} !== parseInt(${a})`;t.fail$data((0,Gc._)`(${n} === 0 || (${a} = ${r}/${n}, ${u}))`)}};DS.default=Xj});var KC=F(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});function zC(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}FS.default=zC;zC.code='require("ajv/dist/runtime/ucs2length").default'});var GC=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var Zo=Ne(),e2=We(),t2=KC(),r2={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Zo.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Zo._)`{limit: ${t}}`},n2={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:r2,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Zo.operators.GT:Zo.operators.LT,a=i.opts.unicode===!1?(0,Zo._)`${r}.length`:(0,Zo._)`${(0,e2.useFunc)(t.gen,t2.default)}(${r})`;t.fail$data((0,Zo._)`${a} ${s} ${n}`)}};LS.default=n2});var QC=F(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var i2=gn(),s2=We(),Ll=Ne(),o2={message:({schemaCode:t})=>(0,Ll.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Ll._)`{pattern: ${t}}`},a2={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:o2,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t,u=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:f}=a.opts.code,h=f.code==="new RegExp"?(0,Ll._)`new RegExp`:(0,s2.useFunc)(e,f),g=e.let("valid");e.try(()=>e.assign(g,(0,Ll._)`${h}(${s}, ${u}).test(${r})`),()=>e.assign(g,!1)),t.fail$data((0,Ll._)`!${g}`)}else{let f=(0,i2.usePattern)(t,i);t.fail$data((0,Ll._)`!${f}.test(${r})`)}}};jS.default=a2});var ZC=F(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var Qc=Ne(),l2={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Qc.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Qc._)`{limit: ${t}}`},u2={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:l2,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Qc.operators.GT:Qc.operators.LT;t.fail$data((0,Qc._)`Object.keys(${r}).length ${i} ${n}`)}};US.default=u2});var XC=F(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});var Zc=gn(),Xc=Ne(),c2=We(),f2={message:({params:{missingProperty:t}})=>(0,Xc.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Xc._)`{missingProperty: ${t}}`},d2={keyword:"required",type:"object",schemaType:"array",$data:!0,error:f2,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:a}=t,{opts:u}=a;if(!s&&r.length===0)return;let f=r.length>=u.loopRequired;if(a.allErrors?h():g(),u.strictRequired){let E=t.parentSchema.properties,{definedProperties:x}=t.it;for(let C of r)if(E?.[C]===void 0&&!x.has(C)){let A=a.schemaEnv.baseId+a.errSchemaPath,T=`required property "${C}" is not defined at "${A}" (strictRequired)`;(0,c2.checkStrictMode)(a,T,a.opts.strictRequired)}}function h(){if(f||s)t.block$data(Xc.nil,m);else for(let E of r)(0,Zc.checkReportMissingProp)(t,E)}function g(){let E=e.let("missing");if(f||s){let x=e.let("valid",!0);t.block$data(x,()=>S(E,x)),t.ok(x)}else e.if((0,Zc.checkMissingProp)(t,r,E)),(0,Zc.reportMissingProp)(t,E),e.else()}function m(){e.forOf("prop",n,E=>{t.setParams({missingProperty:E}),e.if((0,Zc.noPropertyInData)(e,i,E,u.ownProperties),()=>t.error())})}function S(E,x){t.setParams({missingProperty:E}),e.forOf(E,n,()=>{e.assign(x,(0,Zc.propertyInData)(e,i,E,u.ownProperties)),e.if((0,Xc.not)(x),()=>{t.error(),e.break()})},Xc.nil)}}};BS.default=d2});var eR=F(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});var ef=Ne(),h2={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,ef.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,ef._)`{limit: ${t}}`},p2={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:h2,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?ef.operators.GT:ef.operators.LT;t.fail$data((0,ef._)`${r}.length ${i} ${n}`)}};HS.default=p2});var sp=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var tR=hS();tR.code='require("ajv/dist/runtime/equal").default';VS.default=tR});var rR=F(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});var WS=jc(),Qt=Ne(),m2=We(),g2=sp(),y2={message:({params:{i:t,j:e}})=>(0,Qt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Qt._)`{i: ${t}, j: ${e}}`},v2={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:y2,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:u}=t;if(!n&&!i)return;let f=e.let("valid"),h=s.items?(0,WS.getSchemaTypes)(s.items):[];t.block$data(f,g,(0,Qt._)`${a} === false`),t.ok(f);function g(){let x=e.let("i",(0,Qt._)`${r}.length`),C=e.let("j");t.setParams({i:x,j:C}),e.assign(f,!0),e.if((0,Qt._)`${x} > 1`,()=>(m()?S:E)(x,C))}function m(){return h.length>0&&!h.some(x=>x==="object"||x==="array")}function S(x,C){let A=e.name("item"),T=(0,WS.checkDataTypes)(h,A,u.opts.strictNumbers,WS.DataType.Wrong),B=e.const("indices",(0,Qt._)`{}`);e.for((0,Qt._)`;${x}--;`,()=>{e.let(A,(0,Qt._)`${r}[${x}]`),e.if(T,(0,Qt._)`continue`),h.length>1&&e.if((0,Qt._)`typeof ${A} == "string"`,(0,Qt._)`${A} += "_"`),e.if((0,Qt._)`typeof ${B}[${A}] == "number"`,()=>{e.assign(C,(0,Qt._)`${B}[${A}]`),t.error(),e.assign(f,!1).break()}).code((0,Qt._)`${B}[${A}] = ${x}`)})}function E(x,C){let A=(0,m2.useFunc)(e,g2.default),T=e.name("outer");e.label(T).for((0,Qt._)`;${x}--;`,()=>e.for((0,Qt._)`${C} = ${x}; ${C}--;`,()=>e.if((0,Qt._)`${A}(${r}[${x}], ${r}[${C}])`,()=>{t.error(),e.assign(f,!1).break(T)})))}}};YS.default=v2});var nR=F(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var JS=Ne(),S2=We(),b2=sp(),_2={message:"must be equal to constant",params:({schemaCode:t})=>(0,JS._)`{allowedValue: ${t}}`},w2={keyword:"const",$data:!0,error:_2,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,JS._)`!${(0,S2.useFunc)(e,b2.default)}(${r}, ${i})`):t.fail((0,JS._)`${s} !== ${r}`)}};zS.default=w2});var iR=F(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var tf=Ne(),E2=We(),x2=sp(),C2={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,tf._)`{allowedValues: ${t}}`},R2={keyword:"enum",schemaType:"array",$data:!0,error:C2,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let u=i.length>=a.opts.loopEnum,f,h=()=>f??(f=(0,E2.useFunc)(e,x2.default)),g;if(u||n)g=e.let("valid"),t.block$data(g,m);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let E=e.const("vSchema",s);g=(0,tf.or)(...i.map((x,C)=>S(E,C)))}t.pass(g);function m(){e.assign(g,!1),e.forOf("v",s,E=>e.if((0,tf._)`${h()}(${r}, ${E})`,()=>e.assign(g,!0).break()))}function S(E,x){let C=i[x];return typeof C=="object"&&C!==null?(0,tf._)`${h()}(${r}, ${E}[${x}])`:(0,tf._)`${r} === ${C}`}}};KS.default=R2});var sR=F(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var I2=YC(),O2=JC(),P2=GC(),k2=QC(),A2=ZC(),T2=XC(),q2=eR(),$2=rR(),M2=nR(),N2=iR(),D2=[I2.default,O2.default,P2.default,k2.default,A2.default,T2.default,q2.default,$2.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},M2.default,N2.default];GS.default=D2});var ZS=F(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.validateAdditionalItems=void 0;var Xo=Ne(),QS=We(),F2={message:({params:{len:t}})=>(0,Xo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Xo._)`{limit: ${t}}`},L2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:F2,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,QS.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}oR(t,n)}};function oR(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let u=r.const("len",(0,Xo._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Xo._)`${u} <= ${e.length}`);else if(typeof n=="object"&&!(0,QS.alwaysValidSchema)(a,n)){let h=r.var("valid",(0,Xo._)`${u} <= ${e.length}`);r.if((0,Xo.not)(h),()=>f(h)),t.ok(h)}function f(h){r.forRange("i",e.length,u,g=>{t.subschema({keyword:s,dataProp:g,dataPropType:QS.Type.Num},h),a.allErrors||r.if((0,Xo.not)(h),()=>r.break())})}}rf.validateAdditionalItems=oR;rf.default=L2});var XS=F(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.validateTuple=void 0;var aR=Ne(),op=We(),j2=gn(),U2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return lR(t,"additionalItems",e);r.items=!0,!(0,op.alwaysValidSchema)(r,e)&&t.ok((0,j2.validateArray)(t))}};function lR(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:u}=t;g(i),u.opts.unevaluated&&r.length&&u.items!==!0&&(u.items=op.mergeEvaluated.items(n,r.length,u.items));let f=n.name("valid"),h=n.const("len",(0,aR._)`${s}.length`);r.forEach((m,S)=>{(0,op.alwaysValidSchema)(u,m)||(n.if((0,aR._)`${h} > ${S}`,()=>t.subschema({keyword:a,schemaProp:S,dataProp:S},f)),t.ok(f))});function g(m){let{opts:S,errSchemaPath:E}=u,x=r.length,C=x===m.minItems&&(x===m.maxItems||m[e]===!1);if(S.strictTuples&&!C){let A=`"${a}" is ${x}-tuple, but minItems or maxItems/${e} are not specified or different at path "${E}"`;(0,op.checkStrictMode)(u,A,S.strictTuples)}}}nf.validateTuple=lR;nf.default=U2});var uR=F(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var B2=XS(),H2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,B2.validateTuple)(t,"items")};eb.default=H2});var fR=F(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});var cR=Ne(),V2=We(),W2=gn(),Y2=ZS(),J2={message:({params:{len:t}})=>(0,cR.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,cR._)`{limit: ${t}}`},z2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:J2,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,V2.alwaysValidSchema)(n,e)&&(i?(0,Y2.validateAdditionalItems)(t,i):t.ok((0,W2.validateArray)(t)))}};tb.default=z2});var dR=F(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});var vn=Ne(),ap=We(),K2={message:({params:{min:t,max:e}})=>e===void 0?(0,vn.str)`must contain at least ${t} valid item(s)`:(0,vn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,vn._)`{minContains: ${t}}`:(0,vn._)`{minContains: ${t}, maxContains: ${e}}`},G2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:K2,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,a,u,{minContains:f,maxContains:h}=n;s.opts.next?(a=f===void 0?1:f,u=h):a=1;let g=e.const("len",(0,vn._)`${i}.length`);if(t.setParams({min:a,max:u}),u===void 0&&a===0){(0,ap.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(u!==void 0&&a>u){(0,ap.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,ap.alwaysValidSchema)(s,r)){let C=(0,vn._)`${g} >= ${a}`;u!==void 0&&(C=(0,vn._)`${C} && ${g} <= ${u}`),t.pass(C);return}s.items=!0;let m=e.name("valid");u===void 0&&a===1?E(m,()=>e.if(m,()=>e.break())):a===0?(e.let(m,!0),u!==void 0&&e.if((0,vn._)`${i}.length > 0`,S)):(e.let(m,!1),S()),t.result(m,()=>t.reset());function S(){let C=e.name("_valid"),A=e.let("count",0);E(C,()=>e.if(C,()=>x(A)))}function E(C,A){e.forRange("i",0,g,T=>{t.subschema({keyword:"contains",dataProp:T,dataPropType:ap.Type.Num,compositeRule:!0},C),A()})}function x(C){e.code((0,vn._)`${C}++`),u===void 0?e.if((0,vn._)`${C} >= ${a}`,()=>e.assign(m,!0).break()):(e.if((0,vn._)`${C} > ${u}`,()=>e.assign(m,!1).break()),a===1?e.assign(m,!0):e.if((0,vn._)`${C} >= ${a}`,()=>e.assign(m,!0)))}}};rb.default=G2});var mR=F(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.validateSchemaDeps=bi.validatePropertyDeps=bi.error=void 0;var nb=Ne(),Q2=We(),sf=gn();bi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,nb.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,nb._)`{property: ${t},
|
|
28
28
|
missingProperty: ${n},
|
|
29
29
|
depsCount: ${e},
|
|
30
|
-
deps: ${r}}`};var P2={keyword:"dependencies",type:"object",schemaType:"object",error:Ci.error,code(t){let[e,r]=k2(t);uR(t,e),cR(t,r)}};function k2({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function uR(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let a in e){let u=e[a];if(u.length===0)continue;let f=(0,Jc.propertyInData)(r,n,a,i.opts.ownProperties);t.setParams({property:a,depsCount:u.length,deps:u.join(", ")}),i.allErrors?r.if(f,()=>{for(let h of u)(0,Jc.checkReportMissingProp)(t,h)}):(r.if((0,ib._)`${f} && (${(0,Jc.checkMissingProp)(t,u,s)})`),(0,Jc.reportMissingProp)(t,s),r.else())}}Ci.validatePropertyDeps=uR;function cR(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,a=r.name("valid");for(let u in e)(0,O2.alwaysValidSchema)(s,e[u])||(r.if((0,Jc.propertyInData)(r,n,u,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:u},a);t.mergeValidEvaluated(f,a)},()=>r.var(a,!0)),t.ok(a))}Ci.validateSchemaDeps=cR;Ci.default=P2});var hR=F(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var dR=Ne(),A2=ze(),T2={message:"property name must be valid",params:({params:t})=>(0,dR._)`{propertyName: ${t.propertyName}}`},q2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:T2,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,A2.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),e.if((0,dR.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};sb.default=q2});var ab=F(ob=>{"use strict";Object.defineProperty(ob,"__esModule",{value:!0});var fp=pn(),Bn=Ne(),$2=Zi(),dp=ze(),M2={message:"must NOT have additional properties",params:({params:t})=>(0,Bn._)`{additionalProperty: ${t.additionalProperty}}`},N2={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:M2,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:a}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:u,opts:f}=a;if(a.props=!0,f.removeAdditional!=="all"&&(0,dp.alwaysValidSchema)(a,r))return;let h=(0,fp.allSchemaProperties)(n.properties),g=(0,fp.allSchemaProperties)(n.patternProperties);m(),t.ok((0,Bn._)`${s} === ${$2.default.errors}`);function m(){e.forIn("key",i,A=>{!h.length&&!g.length?C(A):e.if(S(A),()=>C(A))})}function S(A){let T;if(h.length>8){let j=(0,dp.schemaRefOrVal)(a,n.properties,"properties");T=(0,fp.isOwnProperty)(e,j,A)}else h.length?T=(0,Bn.or)(...h.map(j=>(0,Bn._)`${A} === ${j}`)):T=Bn.nil;return g.length&&(T=(0,Bn.or)(T,...g.map(j=>(0,Bn._)`${(0,fp.usePattern)(t,j)}.test(${A})`))),(0,Bn.not)(T)}function _(A){e.code((0,Bn._)`delete ${i}[${A}]`)}function C(A){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){_(A);return}if(r===!1){t.setParams({additionalProperty:A}),t.error(),u||e.break();return}if(typeof r=="object"&&!(0,dp.alwaysValidSchema)(a,r)){let T=e.name("valid");f.removeAdditional==="failing"?(x(A,T,!1),e.if((0,Bn.not)(T),()=>{t.reset(),_(A)})):(x(A,T),u||e.if((0,Bn.not)(T),()=>e.break()))}}function x(A,T,j){let Y={keyword:"additionalProperties",dataProp:A,dataPropType:dp.Type.Str};j===!1&&Object.assign(Y,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(Y,T)}}};ob.default=N2});var gR=F(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var D2=qc(),pR=pn(),lb=ze(),mR=ab(),F2={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&mR.default.code(new D2.KeywordCxt(s,mR.default,"additionalProperties"));let a=(0,pR.allSchemaProperties)(r);for(let m of a)s.definedProperties.add(m);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=lb.mergeEvaluated.props(e,(0,lb.toHash)(a),s.props));let u=a.filter(m=>!(0,lb.alwaysValidSchema)(s,r[m]));if(u.length===0)return;let f=e.name("valid");for(let m of u)h(m)?g(m):(e.if((0,pR.propertyInData)(e,i,m,s.opts.ownProperties)),g(m),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(m),t.ok(f);function h(m){return s.opts.useDefaults&&!s.compositeRule&&r[m].default!==void 0}function g(m){t.subschema({keyword:"properties",schemaProp:m,dataProp:m},f)}}};ub.default=F2});var bR=F(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var yR=pn(),hp=Ne(),vR=ze(),SR=ze(),L2={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:a}=s,u=(0,yR.allSchemaProperties)(r),f=u.filter(x=>(0,vR.alwaysValidSchema)(s,r[x]));if(u.length===0||f.length===u.length&&(!s.opts.unevaluated||s.props===!0))return;let h=a.strictSchema&&!a.allowMatchingProperties&&i.properties,g=e.name("valid");s.props!==!0&&!(s.props instanceof hp.Name)&&(s.props=(0,SR.evaluatedPropsToName)(e,s.props));let{props:m}=s;S();function S(){for(let x of u)h&&_(x),s.allErrors?C(x):(e.var(g,!0),C(x),e.if(g))}function _(x){for(let A in h)new RegExp(x).test(A)&&(0,vR.checkStrictMode)(s,`property ${A} matches pattern ${x} (use allowMatchingProperties)`)}function C(x){e.forIn("key",n,A=>{e.if((0,hp._)`${(0,yR.usePattern)(t,x)}.test(${A})`,()=>{let T=f.includes(x);T||t.subschema({keyword:"patternProperties",schemaProp:x,dataProp:A,dataPropType:SR.Type.Str},g),s.opts.unevaluated&&m!==!0?e.assign((0,hp._)`${m}[${A}]`,!0):!T&&!s.allErrors&&e.if((0,hp.not)(g),()=>e.break())})})}}};cb.default=L2});var _R=F(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});var j2=ze(),U2={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,j2.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};fb.default=U2});var wR=F(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var B2=pn(),H2={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:B2.validateUnion,error:{message:"must match a schema in anyOf"}};db.default=H2});var ER=F(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var pp=Ne(),V2=ze(),W2={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,pp._)`{passingSchemas: ${t.passing}}`},Y2={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:W2,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,a=e.let("valid",!1),u=e.let("passing",null),f=e.name("_valid");t.setParams({passing:u}),e.block(h),t.result(a,()=>t.reset(),()=>t.error(!0));function h(){s.forEach((g,m)=>{let S;(0,V2.alwaysValidSchema)(i,g)?e.var(f,!0):S=t.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},f),m>0&&e.if((0,pp._)`${f} && ${a}`).assign(a,!1).assign(u,(0,pp._)`[${u}, ${m}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(u,m),S&&t.mergeEvaluated(S,pp.Name)})})}}};hb.default=Y2});var CR=F(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});var J2=ze(),z2={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,a)=>{if((0,J2.alwaysValidSchema)(n,s))return;let u=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(u)})}};pb.default=z2});var IR=F(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});var mp=Ne(),RR=ze(),K2={message:({params:t})=>(0,mp.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,mp._)`{failingKeyword: ${t.ifClause}}`},G2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:K2,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,RR.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=xR(n,"then"),s=xR(n,"else");if(!i&&!s)return;let a=e.let("valid",!0),u=e.name("_valid");if(f(),t.reset(),i&&s){let g=e.let("ifClause");t.setParams({ifClause:g}),e.if(u,h("then",g),h("else",g))}else i?e.if(u,h("then")):e.if((0,mp.not)(u),h("else"));t.pass(a,()=>t.error(!0));function f(){let g=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);t.mergeEvaluated(g)}function h(g,m){return()=>{let S=t.subschema({keyword:g},u);e.assign(a,u),t.mergeValidEvaluated(S,a),m?e.assign(m,(0,mp._)`${g}`):t.setParams({ifClause:g})}}}};function xR(t,e){let r=t.schema[e];return r!==void 0&&!(0,RR.alwaysValidSchema)(t,r)}mb.default=G2});var OR=F(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var Q2=ze(),Z2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Q2.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};gb.default=Z2});var PR=F(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});var X2=XS(),eU=sR(),tU=eb(),rU=aR(),nU=lR(),iU=fR(),sU=hR(),oU=ab(),aU=gR(),lU=bR(),uU=_R(),cU=wR(),fU=ER(),dU=CR(),hU=IR(),pU=OR();function mU(t=!1){let e=[uU.default,cU.default,fU.default,dU.default,hU.default,pU.default,sU.default,oU.default,iU.default,aU.default,lU.default];return t?e.push(eU.default,rU.default):e.push(X2.default,tU.default),e.push(nU.default),e}yb.default=mU});var kR=F(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var $t=Ne(),gU={message:({schemaCode:t})=>(0,$t.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,$t._)`{format: ${t}}`},yU={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:gU,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:a,it:u}=t,{opts:f,errSchemaPath:h,schemaEnv:g,self:m}=u;if(!f.validateFormats)return;i?S():_();function S(){let C=r.scopeValue("formats",{ref:m.formats,code:f.code.formats}),x=r.const("fDef",(0,$t._)`${C}[${a}]`),A=r.let("fType"),T=r.let("format");r.if((0,$t._)`typeof ${x} == "object" && !(${x} instanceof RegExp)`,()=>r.assign(A,(0,$t._)`${x}.type || "string"`).assign(T,(0,$t._)`${x}.validate`),()=>r.assign(A,(0,$t._)`"string"`).assign(T,x)),t.fail$data((0,$t.or)(j(),Y()));function j(){return f.strictSchema===!1?$t.nil:(0,$t._)`${a} && !${T}`}function Y(){let V=g.$async?(0,$t._)`(${x}.async ? await ${T}(${n}) : ${T}(${n}))`:(0,$t._)`${T}(${n})`,K=(0,$t._)`(typeof ${T} == "function" ? ${V} : ${T}.test(${n}))`;return(0,$t._)`${T} && ${T} !== true && ${A} === ${e} && !${K}`}}function _(){let C=m.formats[s];if(!C){j();return}if(C===!0)return;let[x,A,T]=Y(C);x===e&&t.pass(V());function j(){if(f.strictSchema===!1){m.logger.warn(K());return}throw new Error(K());function K(){return`unknown format "${s}" ignored in schema at path "${h}"`}}function Y(K){let ee=K instanceof RegExp?(0,$t.regexpCode)(K):f.code.formats?(0,$t._)`${f.code.formats}${(0,$t.getProperty)(s)}`:void 0,k=r.scopeValue("formats",{key:s,ref:K,code:ee});return typeof K=="object"&&!(K instanceof RegExp)?[K.type||"string",K.validate,(0,$t._)`${k}.validate`]:["string",K,k]}function V(){if(typeof C=="object"&&!(C instanceof RegExp)&&C.async){if(!g.$async)throw new Error("async format in sync schema");return(0,$t._)`await ${T}(${n})`}return typeof A=="function"?(0,$t._)`${T}(${n})`:(0,$t._)`${T}.test(${n})`}}}};vb.default=yU});var AR=F(Sb=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});var vU=kR(),SU=[vU.default];Sb.default=SU});var TR=F(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.contentVocabulary=Tl.metadataVocabulary=void 0;Tl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Tl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var $R=F(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});var bU=Ux(),_U=tR(),wU=PR(),EU=AR(),qR=TR(),CU=[bU.default,_U.default,(0,wU.default)(),EU.default,qR.metadataVocabulary,qR.contentVocabulary];bb.default=CU});var NR=F(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.DiscrError=void 0;var MR;(function(t){t.Tag="tag",t.Mapping="mapping"})(MR||(gp.DiscrError=MR={}))});var FR=F(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var ql=Ne(),_b=NR(),DR=Qh(),xU=$c(),RU=ze(),IU={message:({params:{discrError:t,tagName:e}})=>t===_b.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,ql._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},OU={keyword:"discriminator",type:"object",schemaType:"object",error:IU,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let u=n.propertyName;if(typeof u!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),h=e.const("tag",(0,ql._)`${r}${(0,ql.getProperty)(u)}`);e.if((0,ql._)`typeof ${h} == "string"`,()=>g(),()=>t.error(!1,{discrError:_b.DiscrError.Tag,tag:h,tagName:u})),t.ok(f);function g(){let _=S();e.if(!1);for(let C in _)e.elseIf((0,ql._)`${h} === ${C}`),e.assign(f,m(_[C]));e.else(),t.error(!1,{discrError:_b.DiscrError.Mapping,tag:h,tagName:u}),e.endIf()}function m(_){let C=e.name("valid"),x=t.subschema({keyword:"oneOf",schemaProp:_},C);return t.mergeEvaluated(x,ql.Name),C}function S(){var _;let C={},x=T(i),A=!0;for(let V=0;V<a.length;V++){let K=a[V];if(K?.$ref&&!(0,RU.schemaHasRulesButRef)(K,s.self.RULES)){let k=K.$ref;if(K=DR.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,k),K instanceof DR.SchemaEnv&&(K=K.schema),K===void 0)throw new xU.default(s.opts.uriResolver,s.baseId,k)}let ee=(_=K?.properties)===null||_===void 0?void 0:_[u];if(typeof ee!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);A=A&&(x||T(K)),j(ee,V)}if(!A)throw new Error(`discriminator: "${u}" must be required`);return C;function T({required:V}){return Array.isArray(V)&&V.includes(u)}function j(V,K){if(V.const)Y(V.const,K);else if(V.enum)for(let ee of V.enum)Y(ee,K);else throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`)}function Y(V,K){if(typeof V!="string"||V in C)throw new Error(`discriminator: "${u}" values must be unique strings`);C[V]=K}}}};wb.default=OU});var LR=F((U6,PU)=>{PU.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 UR=F((pt,Eb)=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.MissingRefError=pt.ValidationError=pt.CodeGen=pt.Name=pt.nil=pt.stringify=pt.str=pt._=pt.KeywordCxt=pt.Ajv=void 0;var kU=Mx(),AU=$R(),TU=FR(),jR=LR(),qU=["/properties"],yp="http://json-schema.org/draft-07/schema",$l=class extends kU.default{_addVocabularies(){super._addVocabularies(),AU.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(TU.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(jR,qU):jR;this.addMetaSchema(e,yp,!1),this.refs["http://json-schema.org/schema"]=yp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(yp)?yp:void 0)}};pt.Ajv=$l;Eb.exports=pt=$l;Eb.exports.Ajv=$l;Object.defineProperty(pt,"__esModule",{value:!0});pt.default=$l;var $U=qc();Object.defineProperty(pt,"KeywordCxt",{enumerable:!0,get:function(){return $U.KeywordCxt}});var Ml=Ne();Object.defineProperty(pt,"_",{enumerable:!0,get:function(){return Ml._}});Object.defineProperty(pt,"str",{enumerable:!0,get:function(){return Ml.str}});Object.defineProperty(pt,"stringify",{enumerable:!0,get:function(){return Ml.stringify}});Object.defineProperty(pt,"nil",{enumerable:!0,get:function(){return Ml.nil}});Object.defineProperty(pt,"Name",{enumerable:!0,get:function(){return Ml.Name}});Object.defineProperty(pt,"CodeGen",{enumerable:!0,get:function(){return Ml.CodeGen}});var MU=Kh();Object.defineProperty(pt,"ValidationError",{enumerable:!0,get:function(){return MU.default}});var NU=$c();Object.defineProperty(pt,"MissingRefError",{enumerable:!0,get:function(){return NU.default}})});var We=F(tr=>{"use strict";var Ab=Symbol.for("yaml.alias"),nI=Symbol.for("yaml.document"),Ap=Symbol.for("yaml.map"),iI=Symbol.for("yaml.pair"),Tb=Symbol.for("yaml.scalar"),Tp=Symbol.for("yaml.seq"),ts=Symbol.for("yaml.node.type"),sB=t=>!!t&&typeof t=="object"&&t[ts]===Ab,oB=t=>!!t&&typeof t=="object"&&t[ts]===nI,aB=t=>!!t&&typeof t=="object"&&t[ts]===Ap,lB=t=>!!t&&typeof t=="object"&&t[ts]===iI,sI=t=>!!t&&typeof t=="object"&&t[ts]===Tb,uB=t=>!!t&&typeof t=="object"&&t[ts]===Tp;function oI(t){if(t&&typeof t=="object")switch(t[ts]){case Ap:case Tp:return!0}return!1}function cB(t){if(t&&typeof t=="object")switch(t[ts]){case Ab:case Ap:case Tb:case Tp:return!0}return!1}var fB=t=>(sI(t)||oI(t))&&!!t.anchor;tr.ALIAS=Ab;tr.DOC=nI;tr.MAP=Ap;tr.NODE_TYPE=ts;tr.PAIR=iI;tr.SCALAR=Tb;tr.SEQ=Tp;tr.hasAnchor=fB;tr.isAlias=sB;tr.isCollection=oI;tr.isDocument=oB;tr.isMap=aB;tr.isNode=cB;tr.isPair=lB;tr.isScalar=sI;tr.isSeq=uB});var rf=F(qb=>{"use strict";var Ht=We(),Mr=Symbol("break visit"),aI=Symbol("skip children"),Ii=Symbol("remove node");function qp(t,e){let r=lI(e);Ht.isDocument(t)?nu(null,t.contents,r,Object.freeze([t]))===Ii&&(t.contents=null):nu(null,t,r,Object.freeze([]))}qp.BREAK=Mr;qp.SKIP=aI;qp.REMOVE=Ii;function nu(t,e,r,n){let i=uI(t,e,r,n);if(Ht.isNode(i)||Ht.isPair(i))return cI(t,n,i),nu(t,i,r,n);if(typeof i!="symbol"){if(Ht.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=nu(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Mr)return Mr;a===Ii&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=nu("key",e.key,r,n);if(s===Mr)return Mr;s===Ii&&(e.key=null);let a=nu("value",e.value,r,n);if(a===Mr)return Mr;a===Ii&&(e.value=null)}}return i}async function $p(t,e){let r=lI(e);Ht.isDocument(t)?await iu(null,t.contents,r,Object.freeze([t]))===Ii&&(t.contents=null):await iu(null,t,r,Object.freeze([]))}$p.BREAK=Mr;$p.SKIP=aI;$p.REMOVE=Ii;async function iu(t,e,r,n){let i=await uI(t,e,r,n);if(Ht.isNode(i)||Ht.isPair(i))return cI(t,n,i),iu(t,i,r,n);if(typeof i!="symbol"){if(Ht.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=await iu(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Mr)return Mr;a===Ii&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=await iu("key",e.key,r,n);if(s===Mr)return Mr;s===Ii&&(e.key=null);let a=await iu("value",e.value,r,n);if(a===Mr)return Mr;a===Ii&&(e.value=null)}}return i}function lI(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function uI(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Ht.isMap(e))return r.Map?.(t,e,n);if(Ht.isSeq(e))return r.Seq?.(t,e,n);if(Ht.isPair(e))return r.Pair?.(t,e,n);if(Ht.isScalar(e))return r.Scalar?.(t,e,n);if(Ht.isAlias(e))return r.Alias?.(t,e,n)}function cI(t,e,r){let n=e[e.length-1];if(Ht.isCollection(n))n.items[t]=r;else if(Ht.isPair(n))t==="key"?n.key=r:n.value=r;else if(Ht.isDocument(n))n.contents=r;else{let i=Ht.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}qb.visit=qp;qb.visitAsync=$p});var $b=F(dI=>{"use strict";var fI=We(),dB=rf(),hB={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},pB=t=>t.replace(/[!,[\]{}]/g,e=>hB[e]),nf=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,a]=n;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,a),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),a)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(a){return r(String(a)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+pB(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&fI.isNode(e.contents)){let s={};dB.visit(e.contents,(a,u)=>{fI.isNode(u)&&u.tag&&(s[u.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of n)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(u=>u.startsWith(a)))&&r.push(`%TAG ${s} ${a}`);return r.join(`
|
|
31
|
-
`)}};
|
|
32
|
-
`)?
|
|
30
|
+
deps: ${r}}`};var Z2={keyword:"dependencies",type:"object",schemaType:"object",error:bi.error,code(t){let[e,r]=X2(t);hR(t,e),pR(t,r)}};function X2({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function hR(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let a in e){let u=e[a];if(u.length===0)continue;let f=(0,sf.propertyInData)(r,n,a,i.opts.ownProperties);t.setParams({property:a,depsCount:u.length,deps:u.join(", ")}),i.allErrors?r.if(f,()=>{for(let h of u)(0,sf.checkReportMissingProp)(t,h)}):(r.if((0,nb._)`${f} && (${(0,sf.checkMissingProp)(t,u,s)})`),(0,sf.reportMissingProp)(t,s),r.else())}}bi.validatePropertyDeps=hR;function pR(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,a=r.name("valid");for(let u in e)(0,Q2.alwaysValidSchema)(s,e[u])||(r.if((0,sf.propertyInData)(r,n,u,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:u},a);t.mergeValidEvaluated(f,a)},()=>r.var(a,!0)),t.ok(a))}bi.validateSchemaDeps=pR;bi.default=Z2});var yR=F(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});var gR=Ne(),eU=We(),tU={message:"property name must be valid",params:({params:t})=>(0,gR._)`{propertyName: ${t.propertyName}}`},rU={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:tU,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,eU.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),e.if((0,gR.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};ib.default=rU});var ob=F(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var lp=gn(),Vn=Ne(),nU=zi(),up=We(),iU={message:"must NOT have additional properties",params:({params:t})=>(0,Vn._)`{additionalProperty: ${t.additionalProperty}}`},sU={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:iU,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:a}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:u,opts:f}=a;if(a.props=!0,f.removeAdditional!=="all"&&(0,up.alwaysValidSchema)(a,r))return;let h=(0,lp.allSchemaProperties)(n.properties),g=(0,lp.allSchemaProperties)(n.patternProperties);m(),t.ok((0,Vn._)`${s} === ${nU.default.errors}`);function m(){e.forIn("key",i,A=>{!h.length&&!g.length?x(A):e.if(S(A),()=>x(A))})}function S(A){let T;if(h.length>8){let B=(0,up.schemaRefOrVal)(a,n.properties,"properties");T=(0,lp.isOwnProperty)(e,B,A)}else h.length?T=(0,Vn.or)(...h.map(B=>(0,Vn._)`${A} === ${B}`)):T=Vn.nil;return g.length&&(T=(0,Vn.or)(T,...g.map(B=>(0,Vn._)`${(0,lp.usePattern)(t,B)}.test(${A})`))),(0,Vn.not)(T)}function E(A){e.code((0,Vn._)`delete ${i}[${A}]`)}function x(A){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){E(A);return}if(r===!1){t.setParams({additionalProperty:A}),t.error(),u||e.break();return}if(typeof r=="object"&&!(0,up.alwaysValidSchema)(a,r)){let T=e.name("valid");f.removeAdditional==="failing"?(C(A,T,!1),e.if((0,Vn.not)(T),()=>{t.reset(),E(A)})):(C(A,T),u||e.if((0,Vn.not)(T),()=>e.break()))}}function C(A,T,B){let Y={keyword:"additionalProperties",dataProp:A,dataPropType:up.Type.Str};B===!1&&Object.assign(Y,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(Y,T)}}};sb.default=sU});var bR=F(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});var oU=Vc(),vR=gn(),ab=We(),SR=ob(),aU={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&SR.default.code(new oU.KeywordCxt(s,SR.default,"additionalProperties"));let a=(0,vR.allSchemaProperties)(r);for(let m of a)s.definedProperties.add(m);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=ab.mergeEvaluated.props(e,(0,ab.toHash)(a),s.props));let u=a.filter(m=>!(0,ab.alwaysValidSchema)(s,r[m]));if(u.length===0)return;let f=e.name("valid");for(let m of u)h(m)?g(m):(e.if((0,vR.propertyInData)(e,i,m,s.opts.ownProperties)),g(m),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(m),t.ok(f);function h(m){return s.opts.useDefaults&&!s.compositeRule&&r[m].default!==void 0}function g(m){t.subschema({keyword:"properties",schemaProp:m,dataProp:m},f)}}};lb.default=aU});var xR=F(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var _R=gn(),cp=Ne(),wR=We(),ER=We(),lU={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:a}=s,u=(0,_R.allSchemaProperties)(r),f=u.filter(C=>(0,wR.alwaysValidSchema)(s,r[C]));if(u.length===0||f.length===u.length&&(!s.opts.unevaluated||s.props===!0))return;let h=a.strictSchema&&!a.allowMatchingProperties&&i.properties,g=e.name("valid");s.props!==!0&&!(s.props instanceof cp.Name)&&(s.props=(0,ER.evaluatedPropsToName)(e,s.props));let{props:m}=s;S();function S(){for(let C of u)h&&E(C),s.allErrors?x(C):(e.var(g,!0),x(C),e.if(g))}function E(C){for(let A in h)new RegExp(C).test(A)&&(0,wR.checkStrictMode)(s,`property ${A} matches pattern ${C} (use allowMatchingProperties)`)}function x(C){e.forIn("key",n,A=>{e.if((0,cp._)`${(0,_R.usePattern)(t,C)}.test(${A})`,()=>{let T=f.includes(C);T||t.subschema({keyword:"patternProperties",schemaProp:C,dataProp:A,dataPropType:ER.Type.Str},g),s.opts.unevaluated&&m!==!0?e.assign((0,cp._)`${m}[${A}]`,!0):!T&&!s.allErrors&&e.if((0,cp.not)(g),()=>e.break())})})}}};ub.default=lU});var CR=F(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var uU=We(),cU={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,uU.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};cb.default=cU});var RR=F(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});var fU=gn(),dU={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:fU.validateUnion,error:{message:"must match a schema in anyOf"}};fb.default=dU});var IR=F(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var fp=Ne(),hU=We(),pU={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,fp._)`{passingSchemas: ${t.passing}}`},mU={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:pU,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,a=e.let("valid",!1),u=e.let("passing",null),f=e.name("_valid");t.setParams({passing:u}),e.block(h),t.result(a,()=>t.reset(),()=>t.error(!0));function h(){s.forEach((g,m)=>{let S;(0,hU.alwaysValidSchema)(i,g)?e.var(f,!0):S=t.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},f),m>0&&e.if((0,fp._)`${f} && ${a}`).assign(a,!1).assign(u,(0,fp._)`[${u}, ${m}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(u,m),S&&t.mergeEvaluated(S,fp.Name)})})}}};db.default=mU});var OR=F(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var gU=We(),yU={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,a)=>{if((0,gU.alwaysValidSchema)(n,s))return;let u=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(u)})}};hb.default=yU});var AR=F(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});var dp=Ne(),kR=We(),vU={message:({params:t})=>(0,dp.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,dp._)`{failingKeyword: ${t.ifClause}}`},SU={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:vU,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,kR.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=PR(n,"then"),s=PR(n,"else");if(!i&&!s)return;let a=e.let("valid",!0),u=e.name("_valid");if(f(),t.reset(),i&&s){let g=e.let("ifClause");t.setParams({ifClause:g}),e.if(u,h("then",g),h("else",g))}else i?e.if(u,h("then")):e.if((0,dp.not)(u),h("else"));t.pass(a,()=>t.error(!0));function f(){let g=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);t.mergeEvaluated(g)}function h(g,m){return()=>{let S=t.subschema({keyword:g},u);e.assign(a,u),t.mergeValidEvaluated(S,a),m?e.assign(m,(0,dp._)`${g}`):t.setParams({ifClause:g})}}}};function PR(t,e){let r=t.schema[e];return r!==void 0&&!(0,kR.alwaysValidSchema)(t,r)}pb.default=SU});var TR=F(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});var bU=We(),_U={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,bU.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};mb.default=_U});var qR=F(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var wU=ZS(),EU=uR(),xU=XS(),CU=fR(),RU=dR(),IU=mR(),OU=yR(),PU=ob(),kU=bR(),AU=xR(),TU=CR(),qU=RR(),$U=IR(),MU=OR(),NU=AR(),DU=TR();function FU(t=!1){let e=[TU.default,qU.default,$U.default,MU.default,NU.default,DU.default,OU.default,PU.default,IU.default,kU.default,AU.default];return t?e.push(EU.default,CU.default):e.push(wU.default,xU.default),e.push(RU.default),e}gb.default=FU});var $R=F(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});var At=Ne(),LU={message:({schemaCode:t})=>(0,At.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,At._)`{format: ${t}}`},jU={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:LU,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:a,it:u}=t,{opts:f,errSchemaPath:h,schemaEnv:g,self:m}=u;if(!f.validateFormats)return;i?S():E();function S(){let x=r.scopeValue("formats",{ref:m.formats,code:f.code.formats}),C=r.const("fDef",(0,At._)`${x}[${a}]`),A=r.let("fType"),T=r.let("format");r.if((0,At._)`typeof ${C} == "object" && !(${C} instanceof RegExp)`,()=>r.assign(A,(0,At._)`${C}.type || "string"`).assign(T,(0,At._)`${C}.validate`),()=>r.assign(A,(0,At._)`"string"`).assign(T,C)),t.fail$data((0,At.or)(B(),Y()));function B(){return f.strictSchema===!1?At.nil:(0,At._)`${a} && !${T}`}function Y(){let H=g.$async?(0,At._)`(${C}.async ? await ${T}(${n}) : ${T}(${n}))`:(0,At._)`${T}(${n})`,K=(0,At._)`(typeof ${T} == "function" ? ${H} : ${T}.test(${n}))`;return(0,At._)`${T} && ${T} !== true && ${A} === ${e} && !${K}`}}function E(){let x=m.formats[s];if(!x){B();return}if(x===!0)return;let[C,A,T]=Y(x);C===e&&t.pass(H());function B(){if(f.strictSchema===!1){m.logger.warn(K());return}throw new Error(K());function K(){return`unknown format "${s}" ignored in schema at path "${h}"`}}function Y(K){let X=K instanceof RegExp?(0,At.regexpCode)(K):f.code.formats?(0,At._)`${f.code.formats}${(0,At.getProperty)(s)}`:void 0,k=r.scopeValue("formats",{key:s,ref:K,code:X});return typeof K=="object"&&!(K instanceof RegExp)?[K.type||"string",K.validate,(0,At._)`${k}.validate`]:["string",K,k]}function H(){if(typeof x=="object"&&!(x instanceof RegExp)&&x.async){if(!g.$async)throw new Error("async format in sync schema");return(0,At._)`await ${T}(${n})`}return typeof A=="function"?(0,At._)`${T}(${n})`:(0,At._)`${T}.test(${n})`}}}};yb.default=jU});var MR=F(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var UU=$R(),BU=[UU.default];vb.default=BU});var NR=F(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.contentVocabulary=jl.metadataVocabulary=void 0;jl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];jl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var FR=F(Sb=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});var HU=WC(),VU=sR(),WU=qR(),YU=MR(),DR=NR(),JU=[HU.default,VU.default,(0,WU.default)(),YU.default,DR.metadataVocabulary,DR.contentVocabulary];Sb.default=JU});var jR=F(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.DiscrError=void 0;var LR;(function(t){t.Tag="tag",t.Mapping="mapping"})(LR||(hp.DiscrError=LR={}))});var BR=F(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});var Ul=Ne(),bb=jR(),UR=Gh(),zU=Wc(),KU=We(),GU={message:({params:{discrError:t,tagName:e}})=>t===bb.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Ul._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},QU={keyword:"discriminator",type:"object",schemaType:"object",error:GU,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let u=n.propertyName;if(typeof u!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),h=e.const("tag",(0,Ul._)`${r}${(0,Ul.getProperty)(u)}`);e.if((0,Ul._)`typeof ${h} == "string"`,()=>g(),()=>t.error(!1,{discrError:bb.DiscrError.Tag,tag:h,tagName:u})),t.ok(f);function g(){let E=S();e.if(!1);for(let x in E)e.elseIf((0,Ul._)`${h} === ${x}`),e.assign(f,m(E[x]));e.else(),t.error(!1,{discrError:bb.DiscrError.Mapping,tag:h,tagName:u}),e.endIf()}function m(E){let x=e.name("valid"),C=t.subschema({keyword:"oneOf",schemaProp:E},x);return t.mergeEvaluated(C,Ul.Name),x}function S(){var E;let x={},C=T(i),A=!0;for(let H=0;H<a.length;H++){let K=a[H];if(K?.$ref&&!(0,KU.schemaHasRulesButRef)(K,s.self.RULES)){let k=K.$ref;if(K=UR.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,k),K instanceof UR.SchemaEnv&&(K=K.schema),K===void 0)throw new zU.default(s.opts.uriResolver,s.baseId,k)}let X=(E=K?.properties)===null||E===void 0?void 0:E[u];if(typeof X!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);A=A&&(C||T(K)),B(X,H)}if(!A)throw new Error(`discriminator: "${u}" must be required`);return x;function T({required:H}){return Array.isArray(H)&&H.includes(u)}function B(H,K){if(H.const)Y(H.const,K);else if(H.enum)for(let X of H.enum)Y(X,K);else throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`)}function Y(H,K){if(typeof H!="string"||H in x)throw new Error(`discriminator: "${u}" values must be unique strings`);x[H]=K}}}};_b.default=QU});var HR=F((d9,ZU)=>{ZU.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 WR=F((gt,wb)=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.MissingRefError=gt.ValidationError=gt.CodeGen=gt.Name=gt.nil=gt.stringify=gt.str=gt._=gt.KeywordCxt=gt.Ajv=void 0;var XU=LC(),eB=FR(),tB=BR(),VR=HR(),rB=["/properties"],pp="http://json-schema.org/draft-07/schema",Bl=class extends XU.default{_addVocabularies(){super._addVocabularies(),eB.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(tB.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(VR,rB):VR;this.addMetaSchema(e,pp,!1),this.refs["http://json-schema.org/schema"]=pp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(pp)?pp:void 0)}};gt.Ajv=Bl;wb.exports=gt=Bl;wb.exports.Ajv=Bl;Object.defineProperty(gt,"__esModule",{value:!0});gt.default=Bl;var nB=Vc();Object.defineProperty(gt,"KeywordCxt",{enumerable:!0,get:function(){return nB.KeywordCxt}});var Hl=Ne();Object.defineProperty(gt,"_",{enumerable:!0,get:function(){return Hl._}});Object.defineProperty(gt,"str",{enumerable:!0,get:function(){return Hl.str}});Object.defineProperty(gt,"stringify",{enumerable:!0,get:function(){return Hl.stringify}});Object.defineProperty(gt,"nil",{enumerable:!0,get:function(){return Hl.nil}});Object.defineProperty(gt,"Name",{enumerable:!0,get:function(){return Hl.Name}});Object.defineProperty(gt,"CodeGen",{enumerable:!0,get:function(){return Hl.CodeGen}});var iB=zh();Object.defineProperty(gt,"ValidationError",{enumerable:!0,get:function(){return iB.default}});var sB=Wc();Object.defineProperty(gt,"MissingRefError",{enumerable:!0,get:function(){return sB.default}})});var Je=F(Xt=>{"use strict";var kb=Symbol.for("yaml.alias"),aI=Symbol.for("yaml.document"),Op=Symbol.for("yaml.map"),lI=Symbol.for("yaml.pair"),Ab=Symbol.for("yaml.scalar"),Pp=Symbol.for("yaml.seq"),Gi=Symbol.for("yaml.node.type"),OB=t=>!!t&&typeof t=="object"&&t[Gi]===kb,PB=t=>!!t&&typeof t=="object"&&t[Gi]===aI,kB=t=>!!t&&typeof t=="object"&&t[Gi]===Op,AB=t=>!!t&&typeof t=="object"&&t[Gi]===lI,uI=t=>!!t&&typeof t=="object"&&t[Gi]===Ab,TB=t=>!!t&&typeof t=="object"&&t[Gi]===Pp;function cI(t){if(t&&typeof t=="object")switch(t[Gi]){case Op:case Pp:return!0}return!1}function qB(t){if(t&&typeof t=="object")switch(t[Gi]){case kb:case Op:case Ab:case Pp:return!0}return!1}var $B=t=>(uI(t)||cI(t))&&!!t.anchor;Xt.ALIAS=kb;Xt.DOC=aI;Xt.MAP=Op;Xt.NODE_TYPE=Gi;Xt.PAIR=lI;Xt.SCALAR=Ab;Xt.SEQ=Pp;Xt.hasAnchor=$B;Xt.isAlias=OB;Xt.isCollection=cI;Xt.isDocument=PB;Xt.isMap=kB;Xt.isNode=qB;Xt.isPair=AB;Xt.isScalar=uI;Xt.isSeq=TB});var pf=F(Tb=>{"use strict";var Bt=Je(),Dr=Symbol("break visit"),fI=Symbol("skip children"),Ei=Symbol("remove node");function kp(t,e){let r=dI(e);Bt.isDocument(t)?fu(null,t.contents,r,Object.freeze([t]))===Ei&&(t.contents=null):fu(null,t,r,Object.freeze([]))}kp.BREAK=Dr;kp.SKIP=fI;kp.REMOVE=Ei;function fu(t,e,r,n){let i=hI(t,e,r,n);if(Bt.isNode(i)||Bt.isPair(i))return pI(t,n,i),fu(t,i,r,n);if(typeof i!="symbol"){if(Bt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=fu(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Dr)return Dr;a===Ei&&(e.items.splice(s,1),s-=1)}}}else if(Bt.isPair(e)){n=Object.freeze(n.concat(e));let s=fu("key",e.key,r,n);if(s===Dr)return Dr;s===Ei&&(e.key=null);let a=fu("value",e.value,r,n);if(a===Dr)return Dr;a===Ei&&(e.value=null)}}return i}async function Ap(t,e){let r=dI(e);Bt.isDocument(t)?await du(null,t.contents,r,Object.freeze([t]))===Ei&&(t.contents=null):await du(null,t,r,Object.freeze([]))}Ap.BREAK=Dr;Ap.SKIP=fI;Ap.REMOVE=Ei;async function du(t,e,r,n){let i=await hI(t,e,r,n);if(Bt.isNode(i)||Bt.isPair(i))return pI(t,n,i),du(t,i,r,n);if(typeof i!="symbol"){if(Bt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=await du(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Dr)return Dr;a===Ei&&(e.items.splice(s,1),s-=1)}}}else if(Bt.isPair(e)){n=Object.freeze(n.concat(e));let s=await du("key",e.key,r,n);if(s===Dr)return Dr;s===Ei&&(e.key=null);let a=await du("value",e.value,r,n);if(a===Dr)return Dr;a===Ei&&(e.value=null)}}return i}function dI(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function hI(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Bt.isMap(e))return r.Map?.(t,e,n);if(Bt.isSeq(e))return r.Seq?.(t,e,n);if(Bt.isPair(e))return r.Pair?.(t,e,n);if(Bt.isScalar(e))return r.Scalar?.(t,e,n);if(Bt.isAlias(e))return r.Alias?.(t,e,n)}function pI(t,e,r){let n=e[e.length-1];if(Bt.isCollection(n))n.items[t]=r;else if(Bt.isPair(n))t==="key"?n.key=r:n.value=r;else if(Bt.isDocument(n))n.contents=r;else{let i=Bt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}Tb.visit=kp;Tb.visitAsync=Ap});var qb=F(gI=>{"use strict";var mI=Je(),MB=pf(),NB={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},DB=t=>t.replace(/[!,[\]{}]/g,e=>NB[e]),mf=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,a]=n;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,a),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),a)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(a){return r(String(a)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+DB(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&mI.isNode(e.contents)){let s={};MB.visit(e.contents,(a,u)=>{mI.isNode(u)&&u.tag&&(s[u.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of n)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(u=>u.startsWith(a)))&&r.push(`%TAG ${s} ${a}`);return r.join(`
|
|
31
|
+
`)}};mf.defaultYaml={explicit:!1,version:"1.2"};mf.defaultTags={"!!":"tag:yaml.org,2002:"};gI.Directives=mf});var Tp=F(gf=>{"use strict";var yI=Je(),FB=pf();function LB(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function vI(t){let e=new Set;return FB.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function SI(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function jB(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=vI(t));let a=SI(e,i);return i.add(a),a},setAnchors:()=>{for(let s of r){let a=n.get(s);if(typeof a=="object"&&a.anchor&&(yI.isScalar(a.node)||yI.isCollection(a.node)))a.node.anchor=a.anchor;else{let u=new Error("Failed to resolve repeated object (this should not happen)");throw u.source=s,u}}},sourceObjects:n}}gf.anchorIsValid=LB;gf.anchorNames=vI;gf.createNodeAnchors=jB;gf.findNewAnchor=SI});var $b=F(bI=>{"use strict";function yf(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let a=n[i],u=yf(t,n,String(i),a);u===void 0?delete n[i]:u!==a&&(n[i]=u)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),a=yf(t,n,i,s);a===void 0?n.delete(i):a!==s&&n.set(i,a)}else if(n instanceof Set)for(let i of Array.from(n)){let s=yf(t,n,i,i);s===void 0?n.delete(i):s!==i&&(n.delete(i),n.add(s))}else for(let[i,s]of Object.entries(n)){let a=yf(t,n,i,s);a===void 0?delete n[i]:a!==s&&(n[i]=a)}return t.call(e,r,n)}bI.applyReviver=yf});var Js=F(wI=>{"use strict";var UB=Je();function _I(t,e,r){if(Array.isArray(t))return t.map((n,i)=>_I(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!UB.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}wI.toJS=_I});var qp=F(xI=>{"use strict";var BB=$b(),EI=Je(),HB=Js(),Mb=class{constructor(e){Object.defineProperty(this,EI.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!EI.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},u=HB.toJS(this,"",a);if(typeof i=="function")for(let{count:f,res:h}of a.anchors.values())i(h,f);return typeof s=="function"?BB.applyReviver(s,{"":u},"",u):u}};xI.NodeBase=Mb});var vf=F(CI=>{"use strict";var VB=Tp(),WB=pf(),hu=Je(),YB=qp(),JB=Js(),Nb=class extends YB.NodeBase{constructor(e){super(hu.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],WB.visit(e,{Node:(s,a)=>{(hu.isAlias(a)||hu.hasAnchor(a))&&n.push(a)}}),r&&(r.aliasResolveCache=n));let i;for(let s of n){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=r,a=this.resolve(i,r);if(!a){let f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let u=n.get(a);if(u||(JB.toJS(a,null,r),u=n.get(a)),u?.res===void 0){let f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(s>=0&&(u.count+=1,u.aliasCount===0&&(u.aliasCount=$p(i,a,n)),u.count*u.aliasCount>s)){let f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return u.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(VB.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}};function $p(t,e,r){if(hu.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(hu.isCollection(e)){let n=0;for(let i of e.items){let s=$p(t,i,r);s>n&&(n=s)}return n}else if(hu.isPair(e)){let n=$p(t,e.key,r),i=$p(t,e.value,r);return Math.max(n,i)}return 1}CI.Alias=Nb});var Mt=F(Db=>{"use strict";var zB=Je(),KB=qp(),GB=Js(),QB=t=>!t||typeof t!="function"&&typeof t!="object",zs=class extends KB.NodeBase{constructor(e){super(zB.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:GB.toJS(this.value,e,r)}toString(){return String(this.value)}};zs.BLOCK_FOLDED="BLOCK_FOLDED";zs.BLOCK_LITERAL="BLOCK_LITERAL";zs.PLAIN="PLAIN";zs.QUOTE_DOUBLE="QUOTE_DOUBLE";zs.QUOTE_SINGLE="QUOTE_SINGLE";Db.Scalar=zs;Db.isScalarValue=QB});var Sf=F(II=>{"use strict";var ZB=vf(),la=Je(),RI=Mt(),XB="tag:yaml.org,2002:";function eH(t,e,r){if(e){let n=r.filter(s=>s.tag===e),i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function tH(t,e,r){if(la.isDocument(t)&&(t=t.contents),la.isNode(t))return t;if(la.isPair(t)){let m=r.schema[la.MAP].createNode?.(r.schema,null,r);return m.items.push(t),m}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:a,sourceObjects:u}=r,f;if(n&&t&&typeof t=="object"){if(f=u.get(t),f)return f.anchor??(f.anchor=i(t)),new ZB.Alias(f.anchor);f={anchor:null,node:null},u.set(t,f)}e?.startsWith("!!")&&(e=XB+e.slice(2));let h=eH(t,e,a.tags);if(!h){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let m=new RI.Scalar(t);return f&&(f.node=m),m}h=t instanceof Map?a[la.MAP]:Symbol.iterator in Object(t)?a[la.SEQ]:a[la.MAP]}s&&(s(h),delete r.onTagObj);let g=h?.createNode?h.createNode(r.schema,t,r):typeof h?.nodeClass?.from=="function"?h.nodeClass.from(r.schema,t,r):new RI.Scalar(t);return e?g.tag=e:h.default||(g.tag=h.tag),f&&(f.node=g),g}II.createNode=tH});var Np=F(Mp=>{"use strict";var rH=Sf(),xi=Je(),nH=qp();function Fb(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let a=[];a[s]=n,n=a}else n=new Map([[s,n]])}return rH.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var OI=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Lb=class extends nH.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>xi.isNode(n)||xi.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(OI(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(xi.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,Fb(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(xi.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!r&&xi.isScalar(s)?s.value:s:xi.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!xi.isPair(r))return!1;let n=r.value;return n==null||e&&xi.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return xi.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let s=this.get(n,!0);if(xi.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,Fb(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Mp.Collection=Lb;Mp.collectionFromPath=Fb;Mp.isEmptyPath=OI});var bf=F(Dp=>{"use strict";var iH=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function jb(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var sH=(t,e,r)=>t.endsWith(`
|
|
32
|
+
`)?jb(r,e):r.includes(`
|
|
33
33
|
`)?`
|
|
34
|
-
`+
|
|
35
|
-
`)r===
|
|
36
|
-
`&&
|
|
37
|
-
`&&
|
|
38
|
-
${e}${t.slice(0,K)}`:(r===
|
|
39
|
-
${e}${t.slice(
|
|
40
|
-
`);n=e,i=e+1,s=t[i]}return n}
|
|
41
|
-
`){if(s-a>n)return!0;if(a=s+1,i-a<=n)return!1}return!0}function
|
|
34
|
+
`+jb(r,e):(t.endsWith(" ")?"":" ")+r;Dp.indentComment=jb;Dp.lineComment=sH;Dp.stringifyComment=iH});var kI=F(_f=>{"use strict";var oH="flow",Ub="block",Fp="quoted";function aH(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:u}={}){if(!i||i<0)return t;i<s&&(s=0);let f=Math.max(1+s,1+i-e.length);if(t.length<=f)return t;let h=[],g={},m=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?h.push(0):m=i-n);let S,E,x=!1,C=-1,A=-1,T=-1;r===Ub&&(C=PI(t,C,e.length),C!==-1&&(m=C+f));for(let Y;Y=t[C+=1];){if(r===Fp&&Y==="\\"){switch(A=C,t[C+1]){case"x":C+=3;break;case"u":C+=5;break;case"U":C+=9;break;default:C+=1}T=C}if(Y===`
|
|
35
|
+
`)r===Ub&&(C=PI(t,C,e.length)),m=C+e.length+f,S=void 0;else{if(Y===" "&&E&&E!==" "&&E!==`
|
|
36
|
+
`&&E!==" "){let H=t[C+1];H&&H!==" "&&H!==`
|
|
37
|
+
`&&H!==" "&&(S=C)}if(C>=m)if(S)h.push(S),m=S+f,S=void 0;else if(r===Fp){for(;E===" "||E===" ";)E=Y,Y=t[C+=1],x=!0;let H=C>T+1?C-2:A-1;if(g[H])return t;h.push(H),g[H]=!0,m=H+f,S=void 0}else x=!0}E=Y}if(x&&u&&u(),h.length===0)return t;a&&a();let B=t.slice(0,h[0]);for(let Y=0;Y<h.length;++Y){let H=h[Y],K=h[Y+1]||t.length;H===0?B=`
|
|
38
|
+
${e}${t.slice(0,K)}`:(r===Fp&&g[H]&&(B+=`${t[H]}\\`),B+=`
|
|
39
|
+
${e}${t.slice(H+1,K)}`)}return B}function PI(t,e,r){let n=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+r)s=t[++e];else{do s=t[++e];while(s&&s!==`
|
|
40
|
+
`);n=e,i=e+1,s=t[i]}return n}_f.FOLD_BLOCK=Ub;_f.FOLD_FLOW=oH;_f.FOLD_QUOTED=Fp;_f.foldFlowLines=aH});var Ef=F(AI=>{"use strict";var Yn=Mt(),Ks=kI(),jp=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Up=t=>/^(%|---|\.\.\.)/m.test(t);function lH(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let s=0,a=0;s<i;++s)if(t[s]===`
|
|
41
|
+
`){if(s-a>n)return!0;if(a=s+1,i-a<=n)return!1}return!0}function wf(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Up(t)?" ":""),a="",u=0;for(let f=0,h=r[f];h;h=r[++f])if(h===" "&&r[f+1]==="\\"&&r[f+2]==="n"&&(a+=r.slice(u,f)+"\\ ",f+=1,u=f,h="\\"),h==="\\")switch(r[f+1]){case"u":{a+=r.slice(u,f);let g=r.substr(f+2,4);switch(g){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:g.substr(0,2)==="00"?a+="\\x"+g.substr(2):a+=r.substr(f,6)}f+=5,u=f+1}break;case"n":if(n||r[f+2]==='"'||r.length<i)f+=1;else{for(a+=r.slice(u,f)+`
|
|
42
42
|
|
|
43
43
|
`;r[f+2]==="\\"&&r[f+3]==="n"&&r[f+4]!=='"';)a+=`
|
|
44
|
-
`,f+=2;a+=s,r[f+2]===" "&&(a+="\\"),f+=1,u=f+1}break;default:f+=1}return a=u?a+r.slice(u):r,n?a:
|
|
45
|
-
`)||/[ \t]\n|\n[ \t]/.test(t))return
|
|
46
|
-
${r}`)+"'";return e.implicitKey?n:
|
|
44
|
+
`,f+=2;a+=s,r[f+2]===" "&&(a+="\\"),f+=1,u=f+1}break;default:f+=1}return a=u?a+r.slice(u):r,n?a:Ks.foldFlowLines(a,s,Ks.FOLD_QUOTED,jp(e,!1))}function Bb(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
45
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return wf(t,e);let r=e.indent||(Up(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
46
|
+
${r}`)+"'";return e.implicitKey?n:Ks.foldFlowLines(n,r,Ks.FOLD_FLOW,jp(e,!1))}function pu(t,e){let{singleQuote:r}=e.options,n;if(r===!1)n=wf;else{let i=t.includes('"'),s=t.includes("'");i&&!s?n=Bb:s&&!i?n=wf:n=r?Bb:wf}return n(t,e)}var Hb;try{Hb=new RegExp(`(^|(?<!
|
|
47
47
|
))
|
|
48
48
|
+(?!
|
|
49
|
-
|$)`,"g")}catch{
|
|
49
|
+
|$)`,"g")}catch{Hb=/\n+(?!\n|$)/g}function Lp({comment:t,type:e,value:r},n,i,s){let{blockQuote:a,commentString:u,lineWidth:f}=n.options;if(!a||/\n[\t ]+$/.test(r))return pu(r,n);let h=n.indent||(n.forceBlockIndent||Up(r)?" ":""),g=a==="literal"?!0:a==="folded"||e===Yn.Scalar.BLOCK_FOLDED?!1:e===Yn.Scalar.BLOCK_LITERAL?!0:!lH(r,f,h.length);if(!r)return g?`|
|
|
50
50
|
`:`>
|
|
51
51
|
`;let m,S;for(S=r.length;S>0;--S){let K=r[S-1];if(K!==`
|
|
52
|
-
`&&K!==" "&&K!==" ")break}let
|
|
53
|
-
`);
|
|
54
|
-
`&&(
|
|
55
|
-
`)T=A;else break}let
|
|
56
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`),
|
|
57
|
-
${h}${
|
|
58
|
-
${h}${
|
|
59
|
-
`)||g&&/[[\]{},]/.test(s))return
|
|
60
|
-
`)?
|
|
61
|
-
`))return
|
|
62
|
-
${f}`);if(a){let S=
|
|
63
|
-
${e.indent}${u}`:u}
|
|
64
|
-
${u}:`):(A=`${A}:`,S&&(A+=
|
|
65
|
-
`:"",
|
|
66
|
-
${
|
|
67
|
-
`&&Y&&(
|
|
52
|
+
`&&K!==" "&&K!==" ")break}let E=r.substring(S),x=E.indexOf(`
|
|
53
|
+
`);x===-1?m="-":r===E||x!==E.length-1?(m="+",s&&s()):m="",E&&(r=r.slice(0,-E.length),E[E.length-1]===`
|
|
54
|
+
`&&(E=E.slice(0,-1)),E=E.replace(Hb,`$&${h}`));let C=!1,A,T=-1;for(A=0;A<r.length;++A){let K=r[A];if(K===" ")C=!0;else if(K===`
|
|
55
|
+
`)T=A;else break}let B=r.substring(0,T<A?T+1:A);B&&(r=r.substring(B.length),B=B.replace(/\n+/g,`$&${h}`));let H=(C?h?"2":"1":"")+m;if(t&&(H+=" "+u(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!g){let K=r.replace(/\n+/g,`
|
|
56
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`),X=!1,k=jp(n,!0);a!=="folded"&&e!==Yn.Scalar.BLOCK_FOLDED&&(k.onOverflow=()=>{X=!0});let w=Ks.foldFlowLines(`${B}${K}${E}`,h,Ks.FOLD_BLOCK,k);if(!X)return`>${H}
|
|
57
|
+
${h}${w}`}return r=r.replace(/\n+/g,`$&${h}`),`|${H}
|
|
58
|
+
${h}${B}${r}${E}`}function uH(t,e,r,n){let{type:i,value:s}=t,{actualString:a,implicitKey:u,indent:f,indentStep:h,inFlow:g}=e;if(u&&s.includes(`
|
|
59
|
+
`)||g&&/[[\]{},]/.test(s))return pu(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return u||g||!s.includes(`
|
|
60
|
+
`)?pu(s,e):Lp(t,e,r,n);if(!u&&!g&&i!==Yn.Scalar.PLAIN&&s.includes(`
|
|
61
|
+
`))return Lp(t,e,r,n);if(Up(s)){if(f==="")return e.forceBlockIndent=!0,Lp(t,e,r,n);if(u&&f===h)return pu(s,e)}let m=s.replace(/\n+/g,`$&
|
|
62
|
+
${f}`);if(a){let S=C=>C.default&&C.tag!=="tag:yaml.org,2002:str"&&C.test?.test(m),{compat:E,tags:x}=e.doc.schema;if(x.some(S)||E?.some(S))return pu(s,e)}return u?m:Ks.foldFlowLines(m,f,Ks.FOLD_FLOW,jp(e,!1))}function cH(t,e,r,n){let{implicitKey:i,inFlow:s}=e,a=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:u}=t;u!==Yn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(u=Yn.Scalar.QUOTE_DOUBLE);let f=g=>{switch(g){case Yn.Scalar.BLOCK_FOLDED:case Yn.Scalar.BLOCK_LITERAL:return i||s?pu(a.value,e):Lp(a,e,r,n);case Yn.Scalar.QUOTE_DOUBLE:return wf(a.value,e);case Yn.Scalar.QUOTE_SINGLE:return Bb(a.value,e);case Yn.Scalar.PLAIN:return uH(a,e,r,n);default:return null}},h=f(u);if(h===null){let{defaultKeyType:g,defaultStringType:m}=e.options,S=i&&g||m;if(h=f(S),h===null)throw new Error(`Unsupported default string type ${S}`)}return h}AI.stringifyString=cH});var xf=F(Vb=>{"use strict";var fH=Tp(),Gs=Je(),dH=bf(),hH=Ef();function pH(t,e){let r=Object.assign({blockQuote:!0,commentString:dH.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function mH(t,e){if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let r,n;if(Gs.isScalar(e)){n=e.value;let i=t.filter(s=>s.identify?.(n));if(i.length>1){let s=i.filter(a=>a.test);s.length>0&&(i=s)}r=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function gH(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(Gs.isScalar(t)||Gs.isCollection(t))&&t.anchor;s&&fH.anchorIsValid(s)&&(r.add(s),i.push(`&${s}`));let a=t.tag??(e.default?null:e.tag);return a&&i.push(n.directives.tagString(a)),i.join(" ")}function yH(t,e,r,n){if(Gs.isPair(t))return t.toString(e,r,n);if(Gs.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,s=Gs.isNode(t)?t:e.doc.createNode(t,{onTagObj:f=>i=f});i??(i=mH(e.doc.schema.tags,s));let a=gH(s,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);let u=typeof i.stringify=="function"?i.stringify(s,e,r,n):Gs.isScalar(s)?hH.stringifyString(s,e,r,n):s.toString(e,r,n);return a?Gs.isScalar(s)||u[0]==="{"||u[0]==="["?`${a} ${u}`:`${a}
|
|
63
|
+
${e.indent}${u}`:u}Vb.createStringifyContext=pH;Vb.stringify=yH});var MI=F($I=>{"use strict";var Qi=Je(),TI=Mt(),qI=xf(),Cf=bf();function vH({key:t,value:e},r,n,i){let{allNullValues:s,doc:a,indent:u,indentStep:f,options:{commentString:h,indentSeq:g,simpleKeys:m}}=r,S=Qi.isNode(t)&&t.comment||null;if(m){if(S)throw new Error("With simple keys, key nodes cannot have comments");if(Qi.isCollection(t)||!Qi.isNode(t)&&typeof t=="object"){let k="With simple keys, collection cannot be used as a key value";throw new Error(k)}}let E=!m&&(!t||S&&e==null&&!r.inFlow||Qi.isCollection(t)||(Qi.isScalar(t)?t.type===TI.Scalar.BLOCK_FOLDED||t.type===TI.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!E&&(m||!s),indent:u+f});let x=!1,C=!1,A=qI.stringify(t,r,()=>x=!0,()=>C=!0);if(!E&&!r.inFlow&&A.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");E=!0}if(r.inFlow){if(s||e==null)return x&&n&&n(),A===""?"?":E?`? ${A}`:A}else if(s&&!m||e==null&&E)return A=`? ${A}`,S&&!x?A+=Cf.lineComment(A,r.indent,h(S)):C&&i&&i(),A;x&&(S=null),E?(S&&(A+=Cf.lineComment(A,r.indent,h(S))),A=`? ${A}
|
|
64
|
+
${u}:`):(A=`${A}:`,S&&(A+=Cf.lineComment(A,r.indent,h(S))));let T,B,Y;Qi.isNode(e)?(T=!!e.spaceBefore,B=e.commentBefore,Y=e.comment):(T=!1,B=null,Y=null,e&&typeof e=="object"&&(e=a.createNode(e))),r.implicitKey=!1,!E&&!S&&Qi.isScalar(e)&&(r.indentAtStart=A.length+1),C=!1,!g&&f.length>=2&&!r.inFlow&&!E&&Qi.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let H=!1,K=qI.stringify(e,r,()=>H=!0,()=>C=!0),X=" ";if(S||T||B){if(X=T?`
|
|
65
|
+
`:"",B){let k=h(B);X+=`
|
|
66
|
+
${Cf.indentComment(k,r.indent)}`}K===""&&!r.inFlow?X===`
|
|
67
|
+
`&&Y&&(X=`
|
|
68
68
|
|
|
69
|
-
`):
|
|
70
|
-
${r.indent}`}else if(!
|
|
71
|
-
`),P=
|
|
69
|
+
`):X+=`
|
|
70
|
+
${r.indent}`}else if(!E&&Qi.isCollection(e)){let k=K[0],w=K.indexOf(`
|
|
71
|
+
`),P=w!==-1,N=r.inFlow??e.flow??e.items.length===0;if(P||!N){let D=!1;if(P&&(k==="&"||k==="!")){let L=K.indexOf(" ");k==="&"&&L!==-1&&L<w&&K[L+1]==="!"&&(L=K.indexOf(" ",L+1)),(L===-1||w<L)&&(D=!0)}D||(X=`
|
|
72
72
|
${r.indent}`)}}else(K===""||K[0]===`
|
|
73
|
-
`)&&(
|
|
74
|
-
${f}${
|
|
75
|
-
`}}return t?(
|
|
76
|
-
`+
|
|
77
|
-
`))&&(h
|
|
78
|
-
${s}${i}${
|
|
79
|
-
`;return`${
|
|
80
|
-
${i}${
|
|
81
|
-
`:" ")}return
|
|
73
|
+
`)&&(X="");return A+=X+K,r.inFlow?H&&n&&n():Y&&!H?A+=Cf.lineComment(A,r.indent,h(Y)):C&&i&&i(),A}$I.stringifyPair=vH});var Yb=F(Wb=>{"use strict";var NI=require("process");function SH(t,...e){t==="debug"&&console.log(...e)}function bH(t,e){(t==="debug"||t==="warn")&&(typeof NI.emitWarning=="function"?NI.emitWarning(e):console.warn(e))}Wb.debug=SH;Wb.warn=bH});var Yp=F(Wp=>{"use strict";var Vp=Je(),DI=Mt(),Bp="<<",Hp={identify:t=>t===Bp||typeof t=="symbol"&&t.description===Bp,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new DI.Scalar(Symbol(Bp)),{addToJSMap:FI}),stringify:()=>Bp},_H=(t,e)=>(Hp.identify(e)||Vp.isScalar(e)&&(!e.type||e.type===DI.Scalar.PLAIN)&&Hp.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Hp.tag&&r.default);function FI(t,e,r){let n=LI(t,r);if(Vp.isSeq(n))for(let i of n.items)Jb(t,e,i);else if(Array.isArray(n))for(let i of n)Jb(t,e,i);else Jb(t,e,n)}function Jb(t,e,r){let n=LI(t,r);if(!Vp.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,a]of i)e instanceof Map?e.has(s)||e.set(s,a):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function LI(t,e){return t&&Vp.isAlias(e)?e.resolve(t.doc,t):e}Wp.addMergeToJSMap=FI;Wp.isMergeKey=_H;Wp.merge=Hp});var Kb=F(BI=>{"use strict";var wH=Yb(),jI=Yp(),EH=xf(),UI=Je(),zb=Js();function xH(t,e,{key:r,value:n}){if(UI.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(jI.isMergeKey(t,r))jI.addMergeToJSMap(t,e,n);else{let i=zb.toJS(r,"",t);if(e instanceof Map)e.set(i,zb.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=CH(r,i,t),a=zb.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[s]=a}}return e}function CH(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(UI.isNode(t)&&r?.doc){let n=EH.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),wH.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}BI.addPairToJSMap=xH});var Qs=F(Gb=>{"use strict";var HI=Sf(),RH=MI(),IH=Kb(),Jp=Je();function OH(t,e,r){let n=HI.createNode(t,void 0,r),i=HI.createNode(e,void 0,r);return new zp(n,i)}var zp=class t{constructor(e,r=null){Object.defineProperty(this,Jp.NODE_TYPE,{value:Jp.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Jp.isNode(r)&&(r=r.clone(e)),Jp.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return IH.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?RH.stringifyPair(this,e,r,n):JSON.stringify(this)}};Gb.Pair=zp;Gb.createPair=OH});var Qb=F(WI=>{"use strict";var ua=Je(),VI=xf(),Kp=bf();function PH(t,e,r){return(e.inFlow??t.flow?AH:kH)(t,e,r)}function kH({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:a,onComment:u}){let{indent:f,options:{commentString:h}}=r,g=Object.assign({},r,{indent:s,type:null}),m=!1,S=[];for(let x=0;x<e.length;++x){let C=e[x],A=null;if(ua.isNode(C))!m&&C.spaceBefore&&S.push(""),Gp(r,S,C.commentBefore,m),C.comment&&(A=C.comment);else if(ua.isPair(C)){let B=ua.isNode(C.key)?C.key:null;B&&(!m&&B.spaceBefore&&S.push(""),Gp(r,S,B.commentBefore,m))}m=!1;let T=VI.stringify(C,g,()=>A=null,()=>m=!0);A&&(T+=Kp.lineComment(T,s,h(A))),m&&A&&(m=!1),S.push(n+T)}let E;if(S.length===0)E=i.start+i.end;else{E=S[0];for(let x=1;x<S.length;++x){let C=S[x];E+=C?`
|
|
74
|
+
${f}${C}`:`
|
|
75
|
+
`}}return t?(E+=`
|
|
76
|
+
`+Kp.indentComment(h(t),f),u&&u()):m&&a&&a(),E}function AH({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:a,options:{commentString:u}}=e;n+=s;let f=Object.assign({},e,{indent:n,inFlow:!0,type:null}),h=!1,g=0,m=[];for(let x=0;x<t.length;++x){let C=t[x],A=null;if(ua.isNode(C))C.spaceBefore&&m.push(""),Gp(e,m,C.commentBefore,!1),C.comment&&(A=C.comment);else if(ua.isPair(C)){let B=ua.isNode(C.key)?C.key:null;B&&(B.spaceBefore&&m.push(""),Gp(e,m,B.commentBefore,!1),B.comment&&(h=!0));let Y=ua.isNode(C.value)?C.value:null;Y?(Y.comment&&(A=Y.comment),Y.commentBefore&&(h=!0)):C.value==null&&B?.comment&&(A=B.comment)}A&&(h=!0);let T=VI.stringify(C,f,()=>A=null);h||(h=m.length>g||T.includes(`
|
|
77
|
+
`)),x<t.length-1?T+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(h||(h=m.reduce((B,Y)=>B+Y.length+2,2)+(T.length+2)>e.options.lineWidth)),h&&(T+=",")),A&&(T+=Kp.lineComment(T,n,u(A))),m.push(T),g=m.length}let{start:S,end:E}=r;if(m.length===0)return S+E;if(!h){let x=m.reduce((C,A)=>C+A.length+2,2);h=e.options.lineWidth>0&&x>e.options.lineWidth}if(h){let x=S;for(let C of m)x+=C?`
|
|
78
|
+
${s}${i}${C}`:`
|
|
79
|
+
`;return`${x}
|
|
80
|
+
${i}${E}`}else return`${S}${a}${m.join(" ")}${a}${E}`}function Gp({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=Kp.indentComment(e(n),t);r.push(s.trimStart())}}WI.stringifyCollection=PH});var Xs=F(Xb=>{"use strict";var TH=Qb(),qH=Kb(),$H=Np(),Zs=Je(),Qp=Qs(),MH=Mt();function Rf(t,e){let r=Zs.isScalar(e)?e.value:e;for(let n of t)if(Zs.isPair(n)&&(n.key===e||n.key===r||Zs.isScalar(n.key)&&n.key.value===r))return n}var Zb=class extends $H.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Zs.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,a=new this(e),u=(f,h)=>{if(typeof s=="function")h=s.call(r,f,h);else if(Array.isArray(s)&&!s.includes(f))return;(h!==void 0||i)&&a.items.push(Qp.createPair(f,h,n))};if(r instanceof Map)for(let[f,h]of r)u(f,h);else if(r&&typeof r=="object")for(let f of Object.keys(r))u(f,r[f]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,r){let n;Zs.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Qp.Pair(e,e?.value):n=new Qp.Pair(e.key,e.value);let i=Rf(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Zs.isScalar(i.value)&&MH.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let a=this.items.findIndex(u=>s(n,u)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){let r=Rf(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=Rf(this.items,e)?.value;return(!r&&Zs.isScalar(i)?i.value:i)??void 0}has(e){return!!Rf(this.items,e)}set(e,r){this.add(new Qp.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let s of this.items)qH.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Zs.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),TH.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};Xb.YAMLMap=Zb;Xb.findPair=Rf});var mu=F(JI=>{"use strict";var NH=Je(),YI=Xs(),DH={collection:"map",default:!0,nodeClass:YI.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return NH.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>YI.YAMLMap.from(t,e,r)};JI.map=DH});var eo=F(zI=>{"use strict";var FH=Sf(),LH=Qb(),jH=Np(),Xp=Je(),UH=Mt(),BH=Js(),e0=class extends jH.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Xp.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Zp(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Zp(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Xp.isScalar(i)?i.value:i}has(e){let r=Zp(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=Zp(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];Xp.isScalar(i)&&UH.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let s of this.items)n.push(BH.toJS(s,String(i++),r));return n}toString(e,r,n){return e?LH.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r)){let a=0;for(let u of r){if(typeof i=="function"){let f=r instanceof Set?u:String(a++);u=i.call(r,f,u)}s.items.push(FH.createNode(u,void 0,n))}}return s}};function Zp(t){let e=Xp.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}zI.YAMLSeq=e0});var gu=F(GI=>{"use strict";var HH=Je(),KI=eo(),VH={collection:"seq",default:!0,nodeClass:KI.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return HH.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>KI.YAMLSeq.from(t,e,r)};GI.seq=VH});var If=F(QI=>{"use strict";var WH=Ef(),YH={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),WH.stringifyString(t,e,r,n)}};QI.string=YH});var em=F(eO=>{"use strict";var ZI=Mt(),XI={identify:t=>t==null,createNode:()=>new ZI.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ZI.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&XI.test.test(t)?t:e.options.nullStr};eO.nullTag=XI});var t0=F(rO=>{"use strict";var JH=Mt(),tO={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new JH.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&tO.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};rO.boolTag=tO});var yu=F(nO=>{"use strict";function zH({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let u=e-(s.length-a-1);for(;u-- >0;)s+="0"}return s}nO.stringifyNumber=zH});var n0=F(tm=>{"use strict";var KH=Mt(),r0=yu(),GH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:r0.stringifyNumber},QH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():r0.stringifyNumber(t)}},ZH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new KH.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:r0.stringifyNumber};tm.float=ZH;tm.floatExp=QH;tm.floatNaN=GH});var s0=F(nm=>{"use strict";var iO=yu(),rm=t=>typeof t=="bigint"||Number.isInteger(t),i0=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function sO(t,e,r){let{value:n}=t;return rm(n)&&n>=0?r+n.toString(e):iO.stringifyNumber(t)}var XH={identify:t=>rm(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>i0(t,2,8,r),stringify:t=>sO(t,8,"0o")},eV={identify:rm,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>i0(t,0,10,r),stringify:iO.stringifyNumber},tV={identify:t=>rm(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>i0(t,2,16,r),stringify:t=>sO(t,16,"0x")};nm.int=eV;nm.intHex=tV;nm.intOct=XH});var aO=F(oO=>{"use strict";var rV=mu(),nV=em(),iV=gu(),sV=If(),oV=t0(),o0=n0(),a0=s0(),aV=[rV.map,iV.seq,sV.string,nV.nullTag,oV.boolTag,a0.intOct,a0.int,a0.intHex,o0.floatNaN,o0.floatExp,o0.float];oO.schema=aV});var cO=F(uO=>{"use strict";var lV=Mt(),uV=mu(),cV=gu();function lO(t){return typeof t=="bigint"||Number.isInteger(t)}var im=({value:t})=>JSON.stringify(t),fV=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:im},{identify:t=>t==null,createNode:()=>new lV.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:im},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:im},{identify:lO,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>lO(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:im}],dV={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},hV=[uV.map,cV.seq].concat(fV,dV);uO.schema=hV});var u0=F(fO=>{"use strict";var Of=require("buffer"),l0=Mt(),pV=Ef(),mV={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Of.Buffer=="function")return Of.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,s){if(!r)return"";let a=r,u;if(typeof Of.Buffer=="function")u=a instanceof Of.Buffer?a.toString("base64"):Of.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let f="";for(let h=0;h<a.length;++h)f+=String.fromCharCode(a[h]);u=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=l0.Scalar.BLOCK_LITERAL),e!==l0.Scalar.QUOTE_DOUBLE){let f=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),h=Math.ceil(u.length/f),g=new Array(h);for(let m=0,S=0;m<h;++m,S+=f)g[m]=u.substr(S,f);u=g.join(e===l0.Scalar.BLOCK_LITERAL?`
|
|
81
|
+
`:" ")}return pV.stringifyString({comment:t,type:e,value:u},n,i,s)}};fO.binary=mV});var am=F(om=>{"use strict";var sm=Je(),c0=Qs(),gV=Mt(),yV=eo();function dO(t,e){if(sm.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!sm.isPair(n)){if(sm.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new c0.Pair(new gV.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
82
82
|
${i.key.commentBefore}`:n.commentBefore),n.comment){let s=i.value??i.key;s.comment=s.comment?`${n.comment}
|
|
83
|
-
${s.comment}`:n.comment}n=i}t.items[r]=am.isPair(n)?n:new f0.Pair(n)}}else e("Expected a sequence for this tag");return t}function lO(t,e,r){let{replacer:n}=r,i=new zH.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(s++),a));let u,f;if(Array.isArray(a))if(a.length===2)u=a[0],f=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let h=Object.keys(a);if(h.length===1)u=h[0],f=a[u];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else u=a;i.items.push(f0.createPair(u,f,r))}return i}var KH={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:aO,createNode:lO};lm.createPairs=lO;lm.pairs=KH;lm.resolvePairs=aO});var p0=F(h0=>{"use strict";var uO=We(),d0=ro(),Sf=lo(),GH=uo(),cO=um(),ua=class t extends GH.YAMLSeq{constructor(){super(),this.add=Sf.YAMLMap.prototype.add.bind(this),this.delete=Sf.YAMLMap.prototype.delete.bind(this),this.get=Sf.YAMLMap.prototype.get.bind(this),this.has=Sf.YAMLMap.prototype.has.bind(this),this.set=Sf.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,a;if(uO.isPair(i)?(s=d0.toJS(i.key,"",r),a=d0.toJS(i.value,s,r)):s=d0.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}return n}static from(e,r,n){let i=cO.createPairs(e,r,n),s=new this;return s.items=i.items,s}};ua.tag="tag:yaml.org,2002:omap";var QH={collection:"seq",identify:t=>t instanceof Map,nodeClass:ua,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=cO.resolvePairs(t,e),n=[];for(let{key:i}of r.items)uO.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ua,r)},createNode:(t,e,r)=>ua.from(t,e,r)};h0.YAMLOMap=ua;h0.omap=QH});var mO=F(m0=>{"use strict";var fO=Dt();function dO({value:t,source:e},r){return e&&(t?hO:pO).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var hO={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new fO.Scalar(!0),stringify:dO},pO={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new fO.Scalar(!1),stringify:dO};m0.falseTag=pO;m0.trueTag=hO});var gO=F(cm=>{"use strict";var ZH=Dt(),g0=uu(),XH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:g0.stringifyNumber},eV={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():g0.stringifyNumber(t)}},tV={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new ZH.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:g0.stringifyNumber};cm.float=tV;cm.floatExp=eV;cm.floatNaN=XH});var vO=F(_f=>{"use strict";var yO=uu(),bf=t=>typeof t=="bigint"||Number.isInteger(t);function fm(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let a=BigInt(t);return i==="-"?BigInt(-1)*a:a}let s=parseInt(t,r);return i==="-"?-1*s:s}function y0(t,e,r){let{value:n}=t;if(bf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return yO.stringifyNumber(t)}var rV={identify:bf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>fm(t,2,2,r),stringify:t=>y0(t,2,"0b")},nV={identify:bf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>fm(t,1,8,r),stringify:t=>y0(t,8,"0")},iV={identify:bf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>fm(t,0,10,r),stringify:yO.stringifyNumber},sV={identify:bf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>fm(t,2,16,r),stringify:t=>y0(t,16,"0x")};_f.int=iV;_f.intBin=rV;_f.intHex=sV;_f.intOct=nV});var S0=F(v0=>{"use strict";var pm=We(),dm=oo(),hm=lo(),ca=class t extends hm.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;pm.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new dm.Pair(e.key,null):r=new dm.Pair(e,null),hm.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=hm.findPair(this.items,e);return!r&&pm.isPair(n)?pm.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=hm.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new dm.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let a of r)typeof i=="function"&&(a=i.call(r,a,a)),s.items.push(dm.createPair(a,null,n));return s}};ca.tag="tag:yaml.org,2002:set";var oV={collection:"map",identify:t=>t instanceof Set,nodeClass:ca,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ca.from(t,e,r),resolve(t,e){if(pm.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ca,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};v0.YAMLSet=ca;v0.set=oV});var _0=F(mm=>{"use strict";var aV=uu();function b0(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=a=>e?BigInt(a):Number(a),s=n.replace(/_/g,"").split(":").reduce((a,u)=>a*i(60)+i(u),i(0));return r==="-"?i(-1)*s:s}function SO(t){let{value:e}=t,r=a=>a;if(typeof e=="bigint")r=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return aV.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var lV={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>b0(t,r),stringify:SO},uV={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>b0(t,!1),stringify:SO},bO={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(bO.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,a,u]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,h=Date.UTC(r,n-1,i,s||0,a||0,u||0,f),g=e[8];if(g&&g!=="Z"){let m=b0(g,!1);Math.abs(m)<30&&(m*=60),h-=6e4*m}return new Date(h)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};mm.floatTime=uV;mm.intTime=lV;mm.timestamp=bO});var EO=F(wO=>{"use strict";var cV=au(),fV=rm(),dV=lu(),hV=yf(),pV=c0(),_O=mO(),w0=gO(),gm=vO(),mV=zp(),gV=p0(),yV=um(),vV=S0(),E0=_0(),SV=[cV.map,dV.seq,hV.string,fV.nullTag,_O.trueTag,_O.falseTag,gm.intBin,gm.intOct,gm.int,gm.intHex,w0.floatNaN,w0.floatExp,w0.float,pV.binary,mV.merge,gV.omap,yV.pairs,vV.set,E0.intTime,E0.floatTime,E0.timestamp];wO.schema=SV});var qO=F(R0=>{"use strict";var IO=au(),bV=rm(),OO=lu(),_V=yf(),wV=r0(),C0=i0(),x0=o0(),EV=rO(),CV=sO(),PO=c0(),wf=zp(),kO=p0(),AO=um(),CO=EO(),TO=S0(),ym=_0(),xO=new Map([["core",EV.schema],["failsafe",[IO.map,OO.seq,_V.string]],["json",CV.schema],["yaml11",CO.schema],["yaml-1.1",CO.schema]]),RO={binary:PO.binary,bool:wV.boolTag,float:C0.float,floatExp:C0.floatExp,floatNaN:C0.floatNaN,floatTime:ym.floatTime,int:x0.int,intHex:x0.intHex,intOct:x0.intOct,intTime:ym.intTime,map:IO.map,merge:wf.merge,null:bV.nullTag,omap:kO.omap,pairs:AO.pairs,seq:OO.seq,set:TO.set,timestamp:ym.timestamp},xV={"tag:yaml.org,2002:binary":PO.binary,"tag:yaml.org,2002:merge":wf.merge,"tag:yaml.org,2002:omap":kO.omap,"tag:yaml.org,2002:pairs":AO.pairs,"tag:yaml.org,2002:set":TO.set,"tag:yaml.org,2002:timestamp":ym.timestamp};function RV(t,e,r){let n=xO.get(e);if(n&&!t)return r&&!n.includes(wf.merge)?n.concat(wf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(xO.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(wf.merge)),i.reduce((s,a)=>{let u=typeof a=="string"?RO[a]:a;if(!u){let f=JSON.stringify(a),h=Object.keys(RO).map(g=>JSON.stringify(g)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return s.includes(u)||s.push(u),s},[])}R0.coreKnownTags=xV;R0.getTags=RV});var P0=F($O=>{"use strict";var I0=We(),IV=au(),OV=lu(),PV=yf(),vm=qO(),kV=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,O0=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:u}){this.compat=Array.isArray(e)?vm.getTags(e,"compat"):e?vm.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?vm.coreKnownTags:{},this.tags=vm.getTags(r,this.name,n),this.toStringOptions=u??null,Object.defineProperty(this,I0.MAP,{value:IV.map}),Object.defineProperty(this,I0.SCALAR,{value:PV.string}),Object.defineProperty(this,I0.SEQ,{value:OV.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?kV:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};$O.Schema=O0});var NO=F(MO=>{"use strict";var AV=We(),k0=hf(),Ef=uf();function TV(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let f=t.directives.toString(t);f?(r.push(f),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=k0.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(Ef.indentComment(f,""))}let a=!1,u=null;if(t.contents){if(AV.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let g=s(t.contents.commentBefore);r.push(Ef.indentComment(g,""))}i.forceBlockIndent=!!t.comment,u=t.contents.comment}let f=u?void 0:()=>a=!0,h=k0.stringify(t.contents,i,()=>u=null,f);u&&(h+=Ef.lineComment(h,"",s(u))),(h[0]==="|"||h[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${h}`:r.push(h)}else r.push(k0.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
|
|
84
|
-
`)?(r.push("..."),r.push(
|
|
83
|
+
${s.comment}`:n.comment}n=i}t.items[r]=sm.isPair(n)?n:new c0.Pair(n)}}else e("Expected a sequence for this tag");return t}function hO(t,e,r){let{replacer:n}=r,i=new yV.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(s++),a));let u,f;if(Array.isArray(a))if(a.length===2)u=a[0],f=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let h=Object.keys(a);if(h.length===1)u=h[0],f=a[u];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else u=a;i.items.push(c0.createPair(u,f,r))}return i}var vV={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:dO,createNode:hO};om.createPairs=hO;om.pairs=vV;om.resolvePairs=dO});var h0=F(d0=>{"use strict";var pO=Je(),f0=Js(),Pf=Xs(),SV=eo(),mO=am(),ca=class t extends SV.YAMLSeq{constructor(){super(),this.add=Pf.YAMLMap.prototype.add.bind(this),this.delete=Pf.YAMLMap.prototype.delete.bind(this),this.get=Pf.YAMLMap.prototype.get.bind(this),this.has=Pf.YAMLMap.prototype.has.bind(this),this.set=Pf.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,a;if(pO.isPair(i)?(s=f0.toJS(i.key,"",r),a=f0.toJS(i.value,s,r)):s=f0.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}return n}static from(e,r,n){let i=mO.createPairs(e,r,n),s=new this;return s.items=i.items,s}};ca.tag="tag:yaml.org,2002:omap";var bV={collection:"seq",identify:t=>t instanceof Map,nodeClass:ca,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=mO.resolvePairs(t,e),n=[];for(let{key:i}of r.items)pO.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ca,r)},createNode:(t,e,r)=>ca.from(t,e,r)};d0.YAMLOMap=ca;d0.omap=bV});var bO=F(p0=>{"use strict";var gO=Mt();function yO({value:t,source:e},r){return e&&(t?vO:SO).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var vO={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new gO.Scalar(!0),stringify:yO},SO={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new gO.Scalar(!1),stringify:yO};p0.falseTag=SO;p0.trueTag=vO});var _O=F(lm=>{"use strict";var _V=Mt(),m0=yu(),wV={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:m0.stringifyNumber},EV={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():m0.stringifyNumber(t)}},xV={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new _V.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:m0.stringifyNumber};lm.float=xV;lm.floatExp=EV;lm.floatNaN=wV});var EO=F(Af=>{"use strict";var wO=yu(),kf=t=>typeof t=="bigint"||Number.isInteger(t);function um(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let a=BigInt(t);return i==="-"?BigInt(-1)*a:a}let s=parseInt(t,r);return i==="-"?-1*s:s}function g0(t,e,r){let{value:n}=t;if(kf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return wO.stringifyNumber(t)}var CV={identify:kf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>um(t,2,2,r),stringify:t=>g0(t,2,"0b")},RV={identify:kf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>um(t,1,8,r),stringify:t=>g0(t,8,"0")},IV={identify:kf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>um(t,0,10,r),stringify:wO.stringifyNumber},OV={identify:kf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>um(t,2,16,r),stringify:t=>g0(t,16,"0x")};Af.int=IV;Af.intBin=CV;Af.intHex=OV;Af.intOct=RV});var v0=F(y0=>{"use strict";var dm=Je(),cm=Qs(),fm=Xs(),fa=class t extends fm.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;dm.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new cm.Pair(e.key,null):r=new cm.Pair(e,null),fm.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=fm.findPair(this.items,e);return!r&&dm.isPair(n)?dm.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=fm.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new cm.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let a of r)typeof i=="function"&&(a=i.call(r,a,a)),s.items.push(cm.createPair(a,null,n));return s}};fa.tag="tag:yaml.org,2002:set";var PV={collection:"map",identify:t=>t instanceof Set,nodeClass:fa,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>fa.from(t,e,r),resolve(t,e){if(dm.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new fa,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};y0.YAMLSet=fa;y0.set=PV});var b0=F(hm=>{"use strict";var kV=yu();function S0(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=a=>e?BigInt(a):Number(a),s=n.replace(/_/g,"").split(":").reduce((a,u)=>a*i(60)+i(u),i(0));return r==="-"?i(-1)*s:s}function xO(t){let{value:e}=t,r=a=>a;if(typeof e=="bigint")r=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return kV.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var AV={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>S0(t,r),stringify:xO},TV={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>S0(t,!1),stringify:xO},CO={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(CO.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,a,u]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,h=Date.UTC(r,n-1,i,s||0,a||0,u||0,f),g=e[8];if(g&&g!=="Z"){let m=S0(g,!1);Math.abs(m)<30&&(m*=60),h-=6e4*m}return new Date(h)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};hm.floatTime=TV;hm.intTime=AV;hm.timestamp=CO});var OO=F(IO=>{"use strict";var qV=mu(),$V=em(),MV=gu(),NV=If(),DV=u0(),RO=bO(),_0=_O(),pm=EO(),FV=Yp(),LV=h0(),jV=am(),UV=v0(),w0=b0(),BV=[qV.map,MV.seq,NV.string,$V.nullTag,RO.trueTag,RO.falseTag,pm.intBin,pm.intOct,pm.int,pm.intHex,_0.floatNaN,_0.floatExp,_0.float,DV.binary,FV.merge,LV.omap,jV.pairs,UV.set,w0.intTime,w0.floatTime,w0.timestamp];IO.schema=BV});var FO=F(C0=>{"use strict";var TO=mu(),HV=em(),qO=gu(),VV=If(),WV=t0(),E0=n0(),x0=s0(),YV=aO(),JV=cO(),$O=u0(),Tf=Yp(),MO=h0(),NO=am(),PO=OO(),DO=v0(),mm=b0(),kO=new Map([["core",YV.schema],["failsafe",[TO.map,qO.seq,VV.string]],["json",JV.schema],["yaml11",PO.schema],["yaml-1.1",PO.schema]]),AO={binary:$O.binary,bool:WV.boolTag,float:E0.float,floatExp:E0.floatExp,floatNaN:E0.floatNaN,floatTime:mm.floatTime,int:x0.int,intHex:x0.intHex,intOct:x0.intOct,intTime:mm.intTime,map:TO.map,merge:Tf.merge,null:HV.nullTag,omap:MO.omap,pairs:NO.pairs,seq:qO.seq,set:DO.set,timestamp:mm.timestamp},zV={"tag:yaml.org,2002:binary":$O.binary,"tag:yaml.org,2002:merge":Tf.merge,"tag:yaml.org,2002:omap":MO.omap,"tag:yaml.org,2002:pairs":NO.pairs,"tag:yaml.org,2002:set":DO.set,"tag:yaml.org,2002:timestamp":mm.timestamp};function KV(t,e,r){let n=kO.get(e);if(n&&!t)return r&&!n.includes(Tf.merge)?n.concat(Tf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(kO.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(Tf.merge)),i.reduce((s,a)=>{let u=typeof a=="string"?AO[a]:a;if(!u){let f=JSON.stringify(a),h=Object.keys(AO).map(g=>JSON.stringify(g)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return s.includes(u)||s.push(u),s},[])}C0.coreKnownTags=zV;C0.getTags=KV});var O0=F(LO=>{"use strict";var R0=Je(),GV=mu(),QV=gu(),ZV=If(),gm=FO(),XV=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,I0=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:u}){this.compat=Array.isArray(e)?gm.getTags(e,"compat"):e?gm.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?gm.coreKnownTags:{},this.tags=gm.getTags(r,this.name,n),this.toStringOptions=u??null,Object.defineProperty(this,R0.MAP,{value:GV.map}),Object.defineProperty(this,R0.SCALAR,{value:ZV.string}),Object.defineProperty(this,R0.SEQ,{value:QV.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?XV:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};LO.Schema=I0});var UO=F(jO=>{"use strict";var eW=Je(),P0=xf(),qf=bf();function tW(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let f=t.directives.toString(t);f?(r.push(f),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=P0.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(qf.indentComment(f,""))}let a=!1,u=null;if(t.contents){if(eW.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let g=s(t.contents.commentBefore);r.push(qf.indentComment(g,""))}i.forceBlockIndent=!!t.comment,u=t.contents.comment}let f=u?void 0:()=>a=!0,h=P0.stringify(t.contents,i,()=>u=null,f);u&&(h+=qf.lineComment(h,"",s(u))),(h[0]==="|"||h[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${h}`:r.push(h)}else r.push(P0.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
|
|
84
|
+
`)?(r.push("..."),r.push(qf.indentComment(f,""))):r.push(`... ${f}`)}else r.push("...");else{let f=t.comment;f&&a&&(f=f.replace(/^\n+/,"")),f&&((!a||u)&&r[r.length-1]!==""&&r.push(""),r.push(qf.indentComment(s(f),"")))}return r.join(`
|
|
85
85
|
`)+`
|
|
86
|
-
`}
|
|
86
|
+
`}jO.stringifyDocument=tW});var $f=F(BO=>{"use strict";var rW=vf(),vu=Np(),_n=Je(),nW=Qs(),iW=Js(),sW=O0(),oW=UO(),k0=Tp(),aW=$b(),lW=Sf(),A0=qb(),T0=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,_n.NODE_TYPE,{value:_n.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:a}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new A0.Directives({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[_n.NODE_TYPE]:{value:_n.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=_n.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Su(this.contents)&&this.contents.add(e)}addIn(e,r){Su(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=k0.anchorNames(this);e.anchor=!r||n.has(r)?k0.findNewAnchor(r||"a",n):r}return new rW.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let A=B=>typeof B=="number"||B instanceof String||B instanceof Number,T=r.filter(A).map(String);T.length>0&&(r=r.concat(T)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:u,keepUndefined:f,onTagObj:h,tag:g}=n??{},{onAnchor:m,setAnchors:S,sourceObjects:E}=k0.createNodeAnchors(this,a||"a"),x={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:m,onTagObj:h,replacer:i,schema:this.schema,sourceObjects:E},C=lW.createNode(e,g,x);return u&&_n.isCollection(C)&&(C.flow=!0),S(),C}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new nW.Pair(i,s)}delete(e){return Su(this.contents)?this.contents.delete(e):!1}deleteIn(e){return vu.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Su(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return _n.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return vu.isEmptyPath(e)?!r&&_n.isScalar(this.contents)?this.contents.value:this.contents:_n.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return _n.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return vu.isEmptyPath(e)?this.contents!==void 0:_n.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=vu.collectionFromPath(this.schema,[e],r):Su(this.contents)&&this.contents.set(e,r)}setIn(e,r){vu.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=vu.collectionFromPath(this.schema,Array.from(e),r):Su(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new A0.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new A0.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new sW.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:a}={}){let u={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=iW.toJS(this.contents,r??"",u);if(typeof s=="function")for(let{count:h,res:g}of u.anchors.values())s(g,h);return typeof a=="function"?aW.applyReviver(a,{"":f},"",f):f}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return oW.stringifyDocument(this,e)}};function Su(t){if(_n.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}BO.Document=T0});var Df=F(Nf=>{"use strict";var Mf=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},q0=class extends Mf{constructor(e,r,n){super("YAMLParseError",e,r,n)}},$0=class extends Mf{constructor(e,r,n){super("YAMLWarning",e,r,n)}},uW=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(u=>e.linePos(u));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let s=i-1,a=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){let u=Math.min(s-39,a.length-79);a="\u2026"+a.substring(u),s-=u-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(a.substring(0,s))){let u=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);u.length>80&&(u=u.substring(0,79)+`\u2026
|
|
87
87
|
`),a=u+a}if(/[^ ]/.test(a)){let u=1,f=r.linePos[1];f?.line===n&&f.col>i&&(u=Math.max(1,Math.min(f.col-i,80-s)));let h=" ".repeat(s)+"^".repeat(u);r.message+=`:
|
|
88
88
|
|
|
89
89
|
${a}
|
|
90
90
|
${h}
|
|
91
|
-
`}};
|
|
92
|
-
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(
|
|
93
|
-
`+
|
|
94
|
-
`+Y.comment:
|
|
95
|
-
`+
|
|
96
|
-
`+k:
|
|
97
|
-
`+P.comment:
|
|
98
|
-
`+A.comment:h.comment=A.comment),h.range=[n.offset,
|
|
99
|
-
`.repeat(Math.max(1,a.length-1)):"",A=n+i.length;return e.source&&(A+=e.source.length),{value:
|
|
100
|
-
`;for(let
|
|
91
|
+
`}};Nf.YAMLError=Mf;Nf.YAMLParseError=q0;Nf.YAMLWarning=$0;Nf.prettifyError=uW});var Ff=F(HO=>{"use strict";function cW(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:a,startOnNewline:u}){let f=!1,h=u,g=u,m="",S="",E=!1,x=!1,C=null,A=null,T=null,B=null,Y=null,H=null,K=null;for(let w of t)switch(x&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&s(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x=!1),C&&(h&&w.type!=="comment"&&w.type!=="newline"&&s(C,"TAB_AS_INDENT","Tabs are not allowed as indentation"),C=null),w.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&w.source.includes(" ")&&(C=w),g=!0;break;case"comment":{g||s(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let P=w.source.substring(1)||" ";m?m+=S+P:m=P,S="",h=!1;break}case"newline":h?m?m+=w.source:(!H||r!=="seq-item-ind")&&(f=!0):S+=w.source,h=!0,E=!0,(A||T)&&(B=w),g=!0;break;case"anchor":A&&s(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&s(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),A=w,K??(K=w.offset),h=!1,g=!1,x=!0;break;case"tag":{T&&s(w,"MULTIPLE_TAGS","A node can have at most one tag"),T=w,K??(K=w.offset),h=!1,g=!1,x=!0;break}case r:(A||T)&&s(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),H&&s(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${e??"collection"}`),H=w,h=r==="seq-item-ind"||r==="explicit-key-ind",g=!1;break;case"comma":if(e){Y&&s(w,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),Y=w,h=!1,g=!1;break}default:s(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),h=!1,g=!1}let X=t[t.length-1],k=X?X.offset+X.source.length:i;return x&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),C&&(h&&C.indent<=a||n?.type==="block-map"||n?.type==="block-seq")&&s(C,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:Y,found:H,spaceBefore:f,comment:m,hasNewline:E,anchor:A,tag:T,newlineAfterProp:B,end:k,start:K??k}}HO.resolveProps=cW});var ym=F(VO=>{"use strict";function M0(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
92
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(M0(e.key)||M0(e.value))return!0}return!1;default:return!0}}VO.containsNewline=M0});var N0=F(WO=>{"use strict";var fW=ym();function dW(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&fW.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}WO.flowIndentCheck=dW});var D0=F(JO=>{"use strict";var YO=Je();function hW(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,a)=>s===a||YO.isScalar(s)&&YO.isScalar(a)&&s.value===a.value;return e.some(s=>i(s.key,r))}JO.mapIncludes=hW});var XO=F(ZO=>{"use strict";var zO=Qs(),pW=Xs(),KO=Ff(),mW=ym(),GO=N0(),gW=D0(),QO="All mapping items must start at the same column";function yW({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??pW.YAMLMap,u=new a(r.schema);r.atRoot&&(r.atRoot=!1);let f=n.offset,h=null;for(let g of n.items){let{start:m,key:S,sep:E,value:x}=g,C=KO.resolveProps(m,{indicator:"explicit-key-ind",next:S??E?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0}),A=!C.found;if(A){if(S&&(S.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in S&&S.indent!==n.indent&&i(f,"BAD_INDENT",QO)),!C.anchor&&!C.tag&&!E){h=C.end,C.comment&&(u.comment?u.comment+=`
|
|
93
|
+
`+C.comment:u.comment=C.comment);continue}(C.newlineAfterProp||mW.containsNewline(S))&&i(S??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else C.found?.indent!==n.indent&&i(f,"BAD_INDENT",QO);r.atKey=!0;let T=C.end,B=S?t(r,S,C,i):e(r,T,m,null,C,i);r.schema.compat&&GO.flowIndentCheck(n.indent,S,i),r.atKey=!1,gW.mapIncludes(r,u.items,B)&&i(T,"DUPLICATE_KEY","Map keys must be unique");let Y=KO.resolveProps(E??[],{indicator:"map-value-ind",next:x,offset:B.range[2],onError:i,parentIndent:n.indent,startOnNewline:!S||S.type==="block-scalar"});if(f=Y.end,Y.found){A&&(x?.type==="block-map"&&!Y.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&C.start<Y.found.offset-1024&&i(B.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let H=x?t(r,x,Y,i):e(r,f,E,null,Y,i);r.schema.compat&&GO.flowIndentCheck(n.indent,x,i),f=H.range[2];let K=new zO.Pair(B,H);r.options.keepSourceTokens&&(K.srcToken=g),u.items.push(K)}else{A&&i(B.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),Y.comment&&(B.comment?B.comment+=`
|
|
94
|
+
`+Y.comment:B.comment=Y.comment);let H=new zO.Pair(B);r.options.keepSourceTokens&&(H.srcToken=g),u.items.push(H)}}return h&&h<f&&i(h,"IMPOSSIBLE","Map comment with trailing content"),u.range=[n.offset,f,h??f],u}ZO.resolveBlockMap=yW});var tP=F(eP=>{"use strict";var vW=eo(),SW=Ff(),bW=N0();function _W({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??vW.YAMLSeq,u=new a(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset,h=null;for(let{start:g,value:m}of n.items){let S=SW.resolveProps(g,{indicator:"seq-item-ind",next:m,offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!S.found)if(S.anchor||S.tag||m)m?.type==="block-seq"?i(S.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{h=S.end,S.comment&&(u.comment=S.comment);continue}let E=m?t(r,m,S,i):e(r,S.end,g,null,S,i);r.schema.compat&&bW.flowIndentCheck(n.indent,m,i),f=E.range[2],u.items.push(E)}return u.range=[n.offset,f,h??f],u}eP.resolveBlockSeq=_W});var bu=F(rP=>{"use strict";function wW(t,e,r,n){let i="";if(t){let s=!1,a="";for(let u of t){let{source:f,type:h}=u;switch(h){case"space":s=!0;break;case"comment":{r&&!s&&n(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let g=f.substring(1)||" ";i?i+=a+g:i=g,a="";break}case"newline":i&&(a+=f),s=!0;break;default:n(u,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}e+=f.length}}return{comment:i,offset:e}}rP.resolveEnd=wW});var oP=F(sP=>{"use strict";var EW=Je(),xW=Qs(),nP=Xs(),CW=eo(),RW=bu(),iP=Ff(),IW=ym(),OW=D0(),F0="Block collections are not allowed within flow collections",L0=t=>t&&(t.type==="block-map"||t.type==="block-seq");function PW({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=n.start.source==="{",u=a?"flow map":"flow sequence",f=s?.nodeClass??(a?nP.YAMLMap:CW.YAMLSeq),h=new f(r.schema);h.flow=!0;let g=r.atRoot;g&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let m=n.offset+n.start.source.length;for(let A=0;A<n.items.length;++A){let T=n.items[A],{start:B,key:Y,sep:H,value:K}=T,X=iP.resolveProps(B,{flow:u,indicator:"explicit-key-ind",next:Y??H?.[0],offset:m,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!X.found){if(!X.anchor&&!X.tag&&!H&&!K){A===0&&X.comma?i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):A<n.items.length-1&&i(X.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),X.comment&&(h.comment?h.comment+=`
|
|
95
|
+
`+X.comment:h.comment=X.comment),m=X.end;continue}!a&&r.options.strict&&IW.containsNewline(Y)&&i(Y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(A===0)X.comma&&i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`);else if(X.comma||i(X.start,"MISSING_CHAR",`Missing , between ${u} items`),X.comment){let k="";e:for(let w of B)switch(w.type){case"comma":case"space":break;case"comment":k=w.source.substring(1);break e;default:break e}if(k){let w=h.items[h.items.length-1];EW.isPair(w)&&(w=w.value??w.key),w.comment?w.comment+=`
|
|
96
|
+
`+k:w.comment=k,X.comment=X.comment.substring(k.length+1)}}if(!a&&!H&&!X.found){let k=K?t(r,K,X,i):e(r,X.end,H,null,X,i);h.items.push(k),m=k.range[2],L0(K)&&i(k.range,"BLOCK_IN_FLOW",F0)}else{r.atKey=!0;let k=X.end,w=Y?t(r,Y,X,i):e(r,k,B,null,X,i);L0(Y)&&i(w.range,"BLOCK_IN_FLOW",F0),r.atKey=!1;let P=iP.resolveProps(H??[],{flow:u,indicator:"map-value-ind",next:K,offset:w.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(P.found){if(!a&&!X.found&&r.options.strict){if(H)for(let L of H){if(L===P.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}X.start<P.found.offset-1024&&i(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else K&&("source"in K&&K.source?.[0]===":"?i(K,"MISSING_CHAR",`Missing space after : in ${u}`):i(P.start,"MISSING_CHAR",`Missing , or : between ${u} items`));let N=K?t(r,K,P,i):P.found?e(r,P.end,H,null,P,i):null;N?L0(K)&&i(N.range,"BLOCK_IN_FLOW",F0):P.comment&&(w.comment?w.comment+=`
|
|
97
|
+
`+P.comment:w.comment=P.comment);let D=new xW.Pair(w,N);if(r.options.keepSourceTokens&&(D.srcToken=T),a){let L=h;OW.mapIncludes(r,L.items,w)&&i(k,"DUPLICATE_KEY","Map keys must be unique"),L.items.push(D)}else{let L=new nP.YAMLMap(r.schema);L.flow=!0,L.items.push(D);let z=(N??w).range;L.range=[w.range[0],z[1],z[2]],h.items.push(L)}m=N?N.range[2]:P.end}}let S=a?"}":"]",[E,...x]=n.end,C=m;if(E?.source===S)C=E.offset+E.source.length;else{let A=u[0].toUpperCase()+u.substring(1),T=g?`${A} must end with a ${S}`:`${A} in block collection must be sufficiently indented and end with a ${S}`;i(m,g?"MISSING_CHAR":"BAD_INDENT",T),E&&E.source.length!==1&&x.unshift(E)}if(x.length>0){let A=RW.resolveEnd(x,C,r.options.strict,i);A.comment&&(h.comment?h.comment+=`
|
|
98
|
+
`+A.comment:h.comment=A.comment),h.range=[n.offset,C,A.offset]}else h.range=[n.offset,C,C];return h}sP.resolveFlowCollection=PW});var lP=F(aP=>{"use strict";var kW=Je(),AW=Mt(),TW=Xs(),qW=eo(),$W=XO(),MW=tP(),NW=oP();function j0(t,e,r,n,i,s){let a=r.type==="block-map"?$W.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?MW.resolveBlockSeq(t,e,r,n,s):NW.resolveFlowCollection(t,e,r,n,s),u=a.constructor;return i==="!"||i===u.tagName?(a.tag=u.tagName,a):(i&&(a.tag=i),a)}function DW(t,e,r,n,i){let s=n.tag,a=s?e.directives.tagName(s.source,S=>i(s,"TAG_RESOLVE_FAILED",S)):null;if(r.type==="block-seq"){let{anchor:S,newlineAfterProp:E}=n,x=S&&s?S.offset>s.offset?S:s:S??s;x&&(!E||E.offset<x.offset)&&i(x,"MISSING_CHAR","Missing newline after block sequence props")}let u=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===TW.YAMLMap.tagName&&u==="map"||a===qW.YAMLSeq.tagName&&u==="seq")return j0(t,e,r,i,a);let f=e.schema.tags.find(S=>S.tag===a&&S.collection===u);if(!f){let S=e.schema.knownTags[a];if(S?.collection===u)e.schema.tags.push(Object.assign({},S,{default:!1})),f=S;else return S?i(s,"BAD_COLLECTION_TYPE",`${S.tag} used for ${u} collection, but expects ${S.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),j0(t,e,r,i,a)}let h=j0(t,e,r,i,a,f),g=f.resolve?.(h,S=>i(s,"TAG_RESOLVE_FAILED",S),e.options)??h,m=kW.isNode(g)?g:new AW.Scalar(g);return m.range=h.range,m.tag=a,f?.format&&(m.format=f.format),m}aP.composeCollection=DW});var B0=F(uP=>{"use strict";var U0=Mt();function FW(t,e,r){let n=e.offset,i=LW(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?U0.Scalar.BLOCK_FOLDED:U0.Scalar.BLOCK_LITERAL,a=e.source?jW(e.source):[],u=a.length;for(let C=a.length-1;C>=0;--C){let A=a[C][1];if(A===""||A==="\r")u=C;else break}if(u===0){let C=i.chomp==="+"&&a.length>0?`
|
|
99
|
+
`.repeat(Math.max(1,a.length-1)):"",A=n+i.length;return e.source&&(A+=e.source.length),{value:C,type:s,comment:i.comment,range:[n,A,A]}}let f=e.indent+i.indent,h=e.offset+i.length,g=0;for(let C=0;C<u;++C){let[A,T]=a[C];if(T===""||T==="\r")i.indent===0&&A.length>f&&(f=A.length);else{A.length<f&&r(h+A.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=A.length),g=C,f===0&&!t.atRoot&&r(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=A.length+T.length+1}for(let C=a.length-1;C>=u;--C)a[C][0].length>f&&(u=C+1);let m="",S="",E=!1;for(let C=0;C<g;++C)m+=a[C][0].slice(f)+`
|
|
100
|
+
`;for(let C=g;C<u;++C){let[A,T]=a[C];h+=A.length+T.length+1;let B=T[T.length-1]==="\r";if(B&&(T=T.slice(0,-1)),T&&A.length<f){let H=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(h-T.length-(B?2:1),"BAD_INDENT",H),A=""}s===U0.Scalar.BLOCK_LITERAL?(m+=S+A.slice(f)+T,S=`
|
|
101
101
|
`):A.length>f||T[0]===" "?(S===" "?S=`
|
|
102
|
-
`:!
|
|
102
|
+
`:!E&&S===`
|
|
103
103
|
`&&(S=`
|
|
104
104
|
|
|
105
105
|
`),m+=S+A.slice(f)+T,S=`
|
|
106
|
-
`,
|
|
106
|
+
`,E=!0):T===""?S===`
|
|
107
107
|
`?m+=`
|
|
108
108
|
`:S=`
|
|
109
|
-
`:(m+=S+T,S=" ",
|
|
110
|
-
`+a[
|
|
109
|
+
`:(m+=S+T,S=" ",E=!1)}switch(i.chomp){case"-":break;case"+":for(let C=u;C<a.length;++C)m+=`
|
|
110
|
+
`+a[C][0].slice(f);m[m.length-1]!==`
|
|
111
111
|
`&&(m+=`
|
|
112
112
|
`);break;default:m+=`
|
|
113
|
-
`}let
|
|
113
|
+
`}let x=n+i.length+e.source.length;return{value:m,type:s,comment:i.comment,range:[n,x,x]}}function LW({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],s=i[0],a=0,u="",f=-1;for(let S=1;S<i.length;++S){let E=i[S];if(!u&&(E==="-"||E==="+"))u=E;else{let x=Number(E);!a&&x?a=x:f===-1&&(f=t+S)}}f!==-1&&n(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let h=!1,g="",m=i.length;for(let S=1;S<e.length;++S){let E=e[S];switch(E.type){case"space":h=!0;case"newline":m+=E.source.length;break;case"comment":r&&!h&&n(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=E.source.length,g=E.source.substring(1);break;case"error":n(E,"UNEXPECTED_TOKEN",E.message),m+=E.source.length;break;default:{let x=`Unexpected token in block scalar header: ${E.type}`;n(E,"UNEXPECTED_TOKEN",x);let C=E.source;C&&typeof C=="string"&&(m+=C.length)}}}return{mode:s,indent:a,chomp:u,comment:g,length:m}}function jW(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let a=1;a<e.length;a+=2)s.push([e[a],e[a+1]]);return s}uP.resolveBlockScalar=FW});var V0=F(fP=>{"use strict";var H0=Mt(),UW=bu();function BW(t,e,r){let{offset:n,type:i,source:s,end:a}=t,u,f,h=(S,E,x)=>r(n+S,E,x);switch(i){case"scalar":u=H0.Scalar.PLAIN,f=HW(s,h);break;case"single-quoted-scalar":u=H0.Scalar.QUOTE_SINGLE,f=VW(s,h);break;case"double-quoted-scalar":u=H0.Scalar.QUOTE_DOUBLE,f=WW(s,h);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let g=n+s.length,m=UW.resolveEnd(a,g,e,r);return{value:f,type:u,comment:m.comment,range:[n,g,m.offset]}}function HW(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),cP(t)}function VW(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),cP(t.slice(1,-1)).replace(/''/g,"'")}function cP(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
114
114
|
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
115
115
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(t);if(!n)return t;let i=n[1],s=" ",a=e.lastIndex;for(r.lastIndex=a;n=r.exec(t);)n[1]===""?s===`
|
|
116
116
|
`?i+=s:s=`
|
|
117
|
-
`:(i+=s+n[1],s=" "),a=r.lastIndex;let u=/[ \t]*(.*)/sy;return u.lastIndex=a,n=u.exec(t),i+s+(n?.[1]??"")}function
|
|
117
|
+
`:(i+=s+n[1],s=" "),a=r.lastIndex;let u=/[ \t]*(.*)/sy;return u.lastIndex=a,n=u.exec(t),i+s+(n?.[1]??"")}function WW(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
|
|
118
118
|
`))if(i===`
|
|
119
|
-
`){let{fold:s,offset:a}=
|
|
119
|
+
`){let{fold:s,offset:a}=YW(t,n);r+=s,n=a}else if(i==="\\"){let s=t[++n],a=JW[s];if(a)r+=a;else if(s===`
|
|
120
120
|
`)for(s=t[n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="\r"&&t[n+1]===`
|
|
121
|
-
`)for(s=t[++n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="x"||s==="u"||s==="U"){let u=
|
|
121
|
+
`)for(s=t[++n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="x"||s==="u"||s==="U"){let u=s==="x"?2:s==="u"?4:8;r+=zW(t,n+1,u,e),n+=u}else{let u=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),r+=u}}else if(i===" "||i===" "){let s=n,a=t[n+1];for(;a===" "||a===" ";)a=t[++n+1];a!==`
|
|
122
122
|
`&&!(a==="\r"&&t[n+2]===`
|
|
123
|
-
`)&&(r+=n>s?t.slice(s,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function
|
|
123
|
+
`)&&(r+=n>s?t.slice(s,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function YW(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===`
|
|
124
124
|
`||n==="\r")&&!(n==="\r"&&t[e+2]!==`
|
|
125
125
|
`);)n===`
|
|
126
126
|
`&&(r+=`
|
|
127
|
-
`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var
|
|
128
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
127
|
+
`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var JW={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
128
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function zW(t,e,r,n){let i=t.substr(e,r),a=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let u=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),u}}fP.resolveFlowScalar=BW});var pP=F(hP=>{"use strict";var da=Je(),dP=Mt(),KW=B0(),GW=V0();function QW(t,e,r,n){let{value:i,type:s,comment:a,range:u}=e.type==="block-scalar"?KW.resolveBlockScalar(t,e,n):GW.resolveFlowScalar(e,t.options.strict,n),f=r?t.directives.tagName(r.source,m=>n(r,"TAG_RESOLVE_FAILED",m)):null,h;t.options.stringKeys&&t.atKey?h=t.schema[da.SCALAR]:f?h=ZW(t.schema,i,f,r,n):e.type==="scalar"?h=XW(t,i,e,n):h=t.schema[da.SCALAR];let g;try{let m=h.resolve(i,S=>n(r??e,"TAG_RESOLVE_FAILED",S),t.options);g=da.isScalar(m)?m:new dP.Scalar(m)}catch(m){let S=m instanceof Error?m.message:String(m);n(r??e,"TAG_RESOLVE_FAILED",S),g=new dP.Scalar(i)}return g.range=u,g.source=i,s&&(g.type=s),f&&(g.tag=f),h.format&&(g.format=h.format),a&&(g.comment=a),g}function ZW(t,e,r,n,i){if(r==="!")return t[da.SCALAR];let s=[];for(let u of t.tags)if(!u.collection&&u.tag===r)if(u.default&&u.test)s.push(u);else return u;for(let u of s)if(u.test?.test(e))return u;let a=t.knownTags[r];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[da.SCALAR])}function XW({atKey:t,directives:e,schema:r},n,i,s){let a=r.tags.find(u=>(u.default===!0||t&&u.default==="key")&&u.test?.test(n))||r[da.SCALAR];if(r.compat){let u=r.compat.find(f=>f.default&&f.test?.test(n))??r[da.SCALAR];if(a.tag!==u.tag){let f=e.tagString(a.tag),h=e.tagString(u.tag),g=`Value may be parsed as either ${f} or ${h}`;s(i,"TAG_RESOLVE_FAILED",g,!0)}}return a}hP.composeScalar=QW});var gP=F(mP=>{"use strict";function eY(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}mP.emptyScalarPosition=eY});var SP=F(Y0=>{"use strict";var tY=vf(),rY=Je(),nY=lP(),yP=pP(),iY=bu(),sY=gP(),oY={composeNode:vP,composeEmptyNode:W0};function vP(t,e,r,n){let i=t.atKey,{spaceBefore:s,comment:a,anchor:u,tag:f}=r,h,g=!0;switch(e.type){case"alias":h=aY(t,e,n),(u||f)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=yP.composeScalar(t,e,f,n),u&&(h.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{h=nY.composeCollection(oY,t,e,r,n),u&&(h.anchor=u.source.substring(1))}catch(m){let S=m instanceof Error?m.message:String(m);n(e,"RESOURCE_EXHAUSTION",S)}break;default:{let m=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",m),g=!1}}return h??(h=W0(t,e.offset,void 0,null,r,n)),u&&h.anchor===""&&n(u,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!rY.isScalar(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&n(f??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(h.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?h.comment=a:h.commentBefore=a),t.options.keepSourceTokens&&g&&(h.srcToken=e),h}function W0(t,e,r,n,{spaceBefore:i,comment:s,anchor:a,tag:u,end:f},h){let g={type:"scalar",offset:sY.emptyScalarPosition(e,r,n),indent:-1,source:""},m=yP.composeScalar(t,g,u,h);return a&&(m.anchor=a.source.substring(1),m.anchor===""&&h(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),s&&(m.comment=s,m.range[2]=f),m}function aY({options:t},{offset:e,source:r,end:n},i){let s=new tY.Alias(r.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=e+r.length,u=iY.resolveEnd(n,a,t.strict,i);return s.range=[e,a,u.offset],u.comment&&(s.comment=u.comment),s}Y0.composeEmptyNode=W0;Y0.composeNode=vP});var wP=F(_P=>{"use strict";var lY=$f(),bP=SP(),uY=bu(),cY=Ff();function fY(t,e,{offset:r,start:n,value:i,end:s},a){let u=Object.assign({_directives:e},t),f=new lY.Document(void 0,u),h={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},g=cY.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:a,parentIndent:0,startOnNewline:!0});g.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!g.hasNewline&&a(g.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?bP.composeNode(h,i,g,a):bP.composeEmptyNode(h,g.end,n,null,g,a);let m=f.contents.range[2],S=uY.resolveEnd(s,m,!1,a);return S.comment&&(f.comment=S.comment),f.range=[r,m,S.offset],f}_P.composeDoc=fY});var z0=F(CP=>{"use strict";var dY=require("process"),hY=qb(),pY=$f(),Lf=Df(),EP=Je(),mY=wP(),gY=bu();function jf(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function xP(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":n?`
|
|
129
129
|
|
|
130
130
|
`:`
|
|
131
|
-
`)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var
|
|
132
|
-
${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(
|
|
131
|
+
`)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var J0=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let a=jf(r);s?this.warnings.push(new Lf.YAMLWarning(a,n,i)):this.errors.push(new Lf.YAMLParseError(a,n,i))},this.directives=new hY.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=xP(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment}
|
|
132
|
+
${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(EP.isCollection(s)&&!s.flow&&s.items.length>0){let a=s.items[0];EP.isPair(a)&&(a=a.key);let u=a.commentBefore;a.commentBefore=u?`${n}
|
|
133
133
|
${u}`:n}else{let a=s.commentBefore;s.commentBefore=a?`${n}
|
|
134
|
-
${a}`:n}}r
|
|
135
|
-
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new
|
|
134
|
+
${a}`:n}}if(r){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:xP(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(dY.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let s=jf(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=mY.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Lf.YAMLParseError(jf(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Lf.YAMLParseError(jf(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=gY.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
135
|
+
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Lf.YAMLParseError(jf(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new pY.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};CP.Composer=J0});var OP=F(vm=>{"use strict";var yY=B0(),vY=V0(),SY=Df(),RP=Ef();function bY(t,e=!0,r){if(t){let n=(i,s,a)=>{let u=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(u,s,a);else throw new SY.YAMLParseError([u,u+1],s,a)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return vY.resolveFlowScalar(t,e,n);case"block-scalar":return yY.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function _Y(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=e,u=RP.stringifyString({type:a,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),f=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
136
136
|
`}];switch(u[0]){case"|":case">":{let h=u.indexOf(`
|
|
137
137
|
`),g=u.substring(0,h),m=u.substring(h+1)+`
|
|
138
|
-
`,S=[{type:"block-scalar-header",offset:s,indent:n,source:g}];return
|
|
139
|
-
`}),{type:"block-scalar",offset:s,indent:n,props:S,source:m}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:u,end:f};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:u,end:f};default:return{type:"scalar",offset:s,indent:n,source:u,end:f}}}function
|
|
138
|
+
`,S=[{type:"block-scalar-header",offset:s,indent:n,source:g}];return IP(S,f)||S.push({type:"newline",offset:-1,indent:n,source:`
|
|
139
|
+
`}),{type:"block-scalar",offset:s,indent:n,props:S,source:m}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:u,end:f};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:u,end:f};default:return{type:"scalar",offset:s,indent:n,source:u,end:f}}}function wY(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:s=!1,type:a}=r,u="indent"in t?t.indent:null;if(n&&typeof u=="number"&&(u+=2),!a)switch(t.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let h=t.props[0];if(h.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=h.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let f=RP.stringifyString({type:a,value:e},{implicitKey:i||u===null,indent:u!==null&&u>0?" ".repeat(u):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":EY(t,f);break;case'"':K0(t,f,"double-quoted-scalar");break;case"'":K0(t,f,"single-quoted-scalar");break;default:K0(t,f,"scalar")}}function EY(t,e){let r=e.indexOf(`
|
|
140
140
|
`),n=e.substring(0,r),i=e.substring(r+1)+`
|
|
141
|
-
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,a="indent"in t?t.indent:-1,u=[{type:"block-scalar-header",offset:s,indent:a,source:n}];
|
|
142
|
-
`});for(let f of Object.keys(t))f!=="type"&&f!=="offset"&&delete t[f];Object.assign(t,{type:"block-scalar",indent:a,props:u,source:i})}}function
|
|
143
|
-
`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}
|
|
141
|
+
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,a="indent"in t?t.indent:-1,u=[{type:"block-scalar-header",offset:s,indent:a,source:n}];IP(u,"end"in t?t.end:void 0)||u.push({type:"newline",offset:-1,indent:a,source:`
|
|
142
|
+
`});for(let f of Object.keys(t))f!=="type"&&f!=="offset"&&delete t[f];Object.assign(t,{type:"block-scalar",indent:a,props:u,source:i})}}function IP(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function K0(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of n)s.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
143
|
+
`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}vm.createScalarToken=_Y;vm.resolveAsScalar=bY;vm.setScalarValue=wY});var kP=F(PP=>{"use strict";var xY=t=>"type"in t?bm(t):Sm(t);function bm(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=bm(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Sm(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Sm(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Sm(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Sm({start:t,key:e,sep:r,value:n}){let i="";for(let s of t)i+=s.source;if(e&&(i+=bm(e)),r)for(let s of r)i+=s.source;return n&&(i+=bm(n)),i}PP.stringify=xY});var $P=F(qP=>{"use strict";var G0=Symbol("break visit"),CY=Symbol("skip children"),AP=Symbol("remove item");function ha(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),TP(Object.freeze([]),t,e)}ha.BREAK=G0;ha.SKIP=CY;ha.REMOVE=AP;ha.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[i];else return}return r};ha.parentCollection=(t,e)=>{let r=ha.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function TP(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let u=TP(Object.freeze(t.concat([[i,a]])),s.items[a],r);if(typeof u=="number")a=u-1;else{if(u===G0)return G0;u===AP&&(s.items.splice(a,1),a-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}qP.visit=ha});var _m=F(Fr=>{"use strict";var Q0=OP(),RY=kP(),IY=$P(),Z0="\uFEFF",X0="",e_="",t_="",OY=t=>!!t&&"items"in t,PY=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function kY(t){switch(t){case Z0:return"<BOM>";case X0:return"<DOC>";case e_:return"<FLOW_END>";case t_:return"<SCALAR>";default:return JSON.stringify(t)}}function AY(t){switch(t){case Z0:return"byte-order-mark";case X0:return"doc-mode";case e_:return"flow-error-end";case t_:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
144
144
|
`:case`\r
|
|
145
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}
|
|
146
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
147
|
-
\r `),
|
|
145
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Fr.createScalarToken=Q0.createScalarToken;Fr.resolveAsScalar=Q0.resolveAsScalar;Fr.setScalarValue=Q0.setScalarValue;Fr.stringify=RY.stringify;Fr.visit=IY.visit;Fr.BOM=Z0;Fr.DOCUMENT=X0;Fr.FLOW_END=e_;Fr.SCALAR=t_;Fr.isCollection=OY;Fr.isScalar=PY;Fr.prettyToken=kY;Fr.tokenType=AY});var i_=F(NP=>{"use strict";var Uf=_m();function Jn(t){switch(t){case void 0:case" ":case`
|
|
146
|
+
`:case"\r":case" ":return!0;default:return!1}}var MP=new Set("0123456789ABCDEFabcdef"),TY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),wm=new Set(",[]{}"),qY=new Set(` ,[]{}
|
|
147
|
+
\r `),r_=t=>!t||qY.has(t),n_=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
|
|
148
148
|
`?!0:r==="\r"?this.buffer[e+1]===`
|
|
149
149
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===`
|
|
150
150
|
`||!i&&!this.atEnd)return e+n+1}return r===`
|
|
151
|
-
`||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&
|
|
152
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===
|
|
151
|
+
`||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Jn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
152
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Uf.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,n=e.indexOf("#");for(;n!==-1;){let s=e[n-1];if(s===" "||s===" "){r=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let s=e[r-1];if(s===" "||s===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield Uf.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&Jn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Jn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Jn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(r_),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&Jn(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Uf.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(r_),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||Jn(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let s=0;for(;this.buffer[r-1-s]==="\\";)s+=1;if(s%2===0)break;r=this.buffer.indexOf('"',r+1)}let n=this.buffer.substring(0,r),i=n.indexOf(`
|
|
153
153
|
`,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=n.indexOf(`
|
|
154
|
-
`,s)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>
|
|
154
|
+
`,s)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Jn(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":r+=1;break;case`
|
|
155
155
|
`:e=s,r=0;break;case"\r":{let a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
156
156
|
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
157
157
|
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
158
158
|
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let s=e-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);let u=s;for(;a===" ";)a=this.buffer[--s];if(a===`
|
|
159
|
-
`&&s>=this.pos&&s+1+r>u)e=s;else break}while(!0);return yield
|
|
159
|
+
`&&s>=this.pos&&s+1+r>u)e=s;else break}while(!0);return yield Uf.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let s=this.buffer[n+1];if(Jn(s)||e&&wm.has(s))break;r=n}else if(Jn(i)){let s=this.buffer[n+1];if(i==="\r"&&(s===`
|
|
160
160
|
`?(n+=1,i=`
|
|
161
|
-
`,s=this.buffer[n+1]):r=n),s==="#"||e&&
|
|
162
|
-
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&
|
|
161
|
+
`,s=this.buffer[n+1]):r=n),s==="#"||e&&wm.has(s))break;if(i===`
|
|
162
|
+
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&wm.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Uf.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(r_),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Jn(n)||r&&wm.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Jn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(TY.has(r))r=this.buffer[++e];else if(r==="%"&&MP.has(this.buffer[e+1])&&MP.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
163
163
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
164
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};
|
|
164
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};NP.Lexer=n_});var o_=F(DP=>{"use strict";var s_=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let s=r+n>>1;this.lineStarts[s]<e?r=s+1:n=s}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};DP.LineCounter=s_});var l_=F(BP=>{"use strict";var $Y=require("process"),FP=_m(),MY=i_();function to(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function LP(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function UP(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Em(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function _u(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function xm(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function jP(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!to(e.start,"explicit-key-ind")&&!to(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,UP(e.value)?e.value.end?xm(e.value.end,e.sep):e.value.end=e.sep:xm(e.start,e.sep),delete e.sep)}var a_=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new MY.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,$Y.env.LOG_TOKENS&&console.log("|",FP.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=FP.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&jP(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&LP(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{LP(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let r=Em(this.peek(2)),n=_u(r),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
|
|
165
165
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
166
|
-
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){
|
|
166
|
+
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){xm(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let a=[];for(let u=0;u<r.sep.length;++u){let f=r.sep[u];switch(f.type){case"newline":a.push(u);break;case"space":break;case"comment":f.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=r.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(to(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(UP(r.key)&&!to(r.sep,"newline")){let a=_u(r.start),u=r.key,f=r.sep;f.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:u,sep:f}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(to(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let a=_u(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):to(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);i||r.value?(e.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(a):(Object.assign(r,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!r.explicitKey&&r.sep&&!to(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){xm(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||to(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Em(n),s=_u(i);jP(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let u={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
|
|
167
167
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
168
|
-
`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=
|
|
168
|
+
`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=Em(e),n=_u(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Em(e),n=_u(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};BP.Parser=a_});var JP=F(Hf=>{"use strict";var HP=z0(),NY=$f(),Bf=Df(),DY=Yb(),FY=Je(),LY=o_(),VP=l_();function WP(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new LY.LineCounter||null,prettyErrors:e}}function jY(t,e={}){let{lineCounter:r,prettyErrors:n}=WP(e),i=new VP.Parser(r?.addNewLine),s=new HP.Composer(e),a=Array.from(s.compose(i.parse(t)));if(n&&r)for(let u of a)u.errors.forEach(Bf.prettifyError(t,r)),u.warnings.forEach(Bf.prettifyError(t,r));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function YP(t,e={}){let{lineCounter:r,prettyErrors:n}=WP(e),i=new VP.Parser(r?.addNewLine),s=new HP.Composer(e),a=null;for(let u of s.compose(i.parse(t),!0,t.length))if(!a)a=u;else if(a.options.logLevel!=="silent"){a.errors.push(new Bf.YAMLParseError(u.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(a.errors.forEach(Bf.prettifyError(t,r)),a.warnings.forEach(Bf.prettifyError(t,r))),a}function UY(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=YP(t,r);if(!i)return null;if(i.warnings.forEach(s=>DY.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function BY(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return FY.isDocument(t)&&!n?t.toString(r):new NY.Document(t,n,r).toString(r)}Hf.parse=UY;Hf.parseAllDocuments=jY;Hf.parseDocument=YP;Hf.stringify=BY});var c_=F(rt=>{"use strict";var HY=z0(),VY=$f(),WY=O0(),u_=Df(),YY=vf(),ro=Je(),JY=Qs(),zY=Mt(),KY=Xs(),GY=eo(),QY=_m(),ZY=i_(),XY=o_(),eJ=l_(),Cm=JP(),zP=pf();rt.Composer=HY.Composer;rt.Document=VY.Document;rt.Schema=WY.Schema;rt.YAMLError=u_.YAMLError;rt.YAMLParseError=u_.YAMLParseError;rt.YAMLWarning=u_.YAMLWarning;rt.Alias=YY.Alias;rt.isAlias=ro.isAlias;rt.isCollection=ro.isCollection;rt.isDocument=ro.isDocument;rt.isMap=ro.isMap;rt.isNode=ro.isNode;rt.isPair=ro.isPair;rt.isScalar=ro.isScalar;rt.isSeq=ro.isSeq;rt.Pair=JY.Pair;rt.Scalar=zY.Scalar;rt.YAMLMap=KY.YAMLMap;rt.YAMLSeq=GY.YAMLSeq;rt.CST=QY;rt.Lexer=ZY.Lexer;rt.LineCounter=XY.LineCounter;rt.Parser=eJ.Parser;rt.parse=Cm.parse;rt.parseAllDocuments=Cm.parseAllDocuments;rt.parseDocument=Cm.parseDocument;rt.stringify=Cm.stringify;rt.visit=zP.visit;rt.visitAsync=zP.visitAsync});var Rm=F(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.getDeepKeys=wu.toJSON=void 0;var uJ=["function","symbol","undefined"],cJ=["constructor","prototype","__proto__"],fJ=Object.getPrototypeOf({});function dJ(){let t={},e=this;for(let r of GP(e))if(typeof r=="string"){let n=e[r],i=typeof n;uJ.includes(i)||(t[r]=n)}return t}wu.toJSON=dJ;function GP(t,e=[]){let r=[];for(;t&&t!==fJ;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(cJ))n.delete(i);return n}wu.getDeepKeys=GP});var f_=F(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.addInspectMethod=Eu.format=void 0;var QP=require("util"),hJ=Rm(),ZP=QP.inspect.custom||Symbol.for("nodejs.util.inspect.custom");Eu.format=QP.format;function pJ(t){t[ZP]=mJ}Eu.addInspectMethod=pJ;function mJ(){let t={},e=this;for(let r of hJ.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[ZP],t}});var t1=F(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.lazyJoinStacks=Ci.joinStacks=Ci.isWritableStack=Ci.isLazyStack=void 0;var gJ=/\r?\n/,yJ=/\bono[ @]/;function vJ(t){return!!(t&&t.configurable&&typeof t.get=="function")}Ci.isLazyStack=vJ;function SJ(t){return!!(!t||t.writable||typeof t.set=="function")}Ci.isWritableStack=SJ;function XP(t,e){let r=e1(t.stack),n=e?e.stack:void 0;return r&&n?r+`
|
|
169
169
|
|
|
170
|
-
`+n:r||n}
|
|
171
|
-
`)}return t}function
|
|
172
|
-
`:"")+r.message),{originalError:r,props:n,message:s}}gu.normalizeArgs=sJ});var p_=F(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.Ono=void 0;var km=XP(),t1=e1(),oJ=Im(),aJ=h_;Am.Ono=aJ;function h_(t,e){e=t1.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:a}=t1.normalizeArgs(n,e),u=new t(a);return km.extendError(u,i,s)}return r[Symbol.species]=t,r}h_.toJSON=function(e){return oJ.toJSON.call(e)};h_.extend=function(e,r,n){return n||r instanceof Error?km.extendError(e,r,n):r?km.extendError(e,void 0,r):km.extendError(e)}});var r1=F(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.ono=void 0;var ma=p_(),lJ=ki;Tm.ono=lJ;ki.error=new ma.Ono(Error);ki.eval=new ma.Ono(EvalError);ki.range=new ma.Ono(RangeError);ki.reference=new ma.Ono(ReferenceError);ki.syntax=new ma.Ono(SyntaxError);ki.type=new ma.Ono(TypeError);ki.uri=new ma.Ono(URIError);var uJ=ki;function ki(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values(uJ))if(typeof r=="function"&&r.name==="ono"){let n=r[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return r.apply(void 0,t)}}return ki.error.apply(void 0,t)}});var i1=F(n1=>{"use strict";Object.defineProperty(n1,"__esModule",{value:!0});var t7=require("util")});var ho=F((Yn,yu)=>{"use strict";var cJ=Yn&&Yn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fJ=Yn&&Yn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&cJ(e,t,r)};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.ono=void 0;var s1=r1();Object.defineProperty(Yn,"ono",{enumerable:!0,get:function(){return s1.ono}});var dJ=p_();Object.defineProperty(Yn,"Ono",{enumerable:!0,get:function(){return dJ.Ono}});fJ(i1(),Yn);Yn.default=s1.ono;typeof yu=="object"&&typeof yu.exports=="object"&&(yu.exports=Object.assign(yu.exports.default,yu.exports))});var m_=F($f=>{"use strict";var hJ=$f&&$f.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($f,"__esModule",{value:!0});$f.default=pJ;var o1=hJ(require("path"));function pJ(t){return t.startsWith("\\\\?\\")?t:t.split(o1.default?.win32?.sep).join(o1.default?.posix?.sep??"/")}});var a1=F(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});qm.isWindows=void 0;var mJ=/^win/.test(globalThis.process?globalThis.process.platform:""),gJ=()=>mJ;qm.isWindows=gJ});var bn=F(gt=>{"use strict";var yJ=gt&>.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),vJ=gt&>.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),SJ=gt&>.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&yJ(r,e,n[i]);return vJ(r,e),r}}(),bJ=gt&>.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gt,"__esModule",{value:!0});gt.parse=void 0;gt.resolve=l1;gt.cwd=u1;gt.getProtocol=b_;gt.getExtension=OJ;gt.stripQuery=c1;gt.getHash=f1;gt.stripHash=v_;gt.isHttp=PJ;gt.isFileSystemPath=S_;gt.fromFileSystemPath=kJ;gt.toFileSystemPath=AJ;gt.safePointerToPath=TJ;gt.relative=qJ;var Mm=bJ(m_()),y_=SJ(require("path")),_J=/\//g,wJ=/^(\w{2,}):\/\//i,EJ=/~1/g,CJ=/~0/g,xJ=require("path"),$m=a1(),RJ=[[/\?/g,"%3F"],[/#/g,"%23"]],g_=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],IJ=t=>new URL(t);gt.parse=IJ;function l1(t,e){let r=new URL((0,Mm.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,Mm.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:a,hash:u}=n;return s+a+u+i}return n.toString()+i}function u1(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function b_(t){let e=wJ.exec(t||"");if(e)return e[1].toLowerCase()}function OJ(t){let e=t.lastIndexOf(".");return e>=0?c1(t.substr(e).toLowerCase()):""}function c1(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function f1(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function v_(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function PJ(t){let e=b_(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function S_(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=b_(t);return e===void 0||e==="file"}function kJ(t){if((0,$m.isWindows)()){let e=u1(),r=t.toUpperCase(),i=(0,Mm.default)(e).toUpperCase(),s=r.includes(i),a=r.includes(i),u=y_.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||a||u)&&!e.startsWith("http")&&(t=(0,xJ.join)(e,t)),t=(0,Mm.default)(t)}t=encodeURI(t);for(let e of RJ)t=t.replace(e[0],e[1]);return t}function AJ(t,e){t=decodeURI(t);for(let n=0;n<g_.length;n+=2)t=t.replace(g_[n],g_[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,$m.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,$m.isWindows)()?t:"/"+t)),(0,$m.isWindows)()&&!r&&(t=t.replace(_J,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function TJ(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(EJ,"/").replace(CJ,"~"))}function qJ(t,e){if(!S_(t)||!S_(e))return l1(t,e);let r=y_.default.dirname(v_(t)),n=v_(e);return y_.default.relative(r,n)+f1(e)}});var _n=F(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.InvalidPointerError=Ot.TimeoutError=Ot.MissingPointerError=Ot.UnmatchedResolverError=Ot.ResolverError=Ot.UnmatchedParserError=Ot.ParserError=Ot.JSONParserErrorGroup=Ot.JSONParserError=void 0;Ot.isHandledError=$J;Ot.normalizeError=MJ;var d1=ho(),Nm=bn(),Jn=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,d1.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Ot.JSONParserError=Jn;var Dm=class t extends Error{constructor(e){super(),this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${(0,Nm.toFileSystemPath)(e.$refs._root$Ref.path)}'`,d1.Ono.extend(this)}static getParserErrors(e){let r=[];for(let n of Object.values(e.$refs._$refs))n.errors&&r.push(...n.errors);return r}get errors(){return t.getParserErrors(this.files)}};Ot.JSONParserErrorGroup=Dm;var __=class extends Jn{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};Ot.ParserError=__;var w_=class extends Jn{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};Ot.UnmatchedParserError=w_;var E_=class extends Jn{constructor(e,r){super(e.message||`Error reading file "${r}"`,r),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};Ot.ResolverError=E_;var C_=class extends Jn{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};Ot.UnmatchedResolverError=C_;var x_=class extends Jn{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,Nm.getHash)(r)}". Token "${e}" does not exist.`,(0,Nm.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};Ot.MissingPointerError=x_;var R_=class extends Jn{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};Ot.TimeoutError=R_;var I_=class extends Jn{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,Nm.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};Ot.InvalidPointerError=I_;function $J(t){return t instanceof Jn||t instanceof Dm}function MJ(t){return t.path===null&&(t.path=[]),t}});var Mf=F(Dr=>{"use strict";var NJ=Dr&&Dr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),DJ=Dr&&Dr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),FJ=Dr&&Dr.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&NJ(r,e,n[i]);return DJ(r,e),r}}(),LJ=Dr&&Dr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.nullSymbol=void 0;var O_=LJ(vu()),P_=FJ(bn()),Lm=_n();Dr.nullSymbol=Symbol("null");var jJ=/\//g,UJ=/~/g,BJ=/~1/g,HJ=/~0/g,VJ=t=>{try{return decodeURIComponent(t)}catch{return t}},jm=class t{constructor(e,r,n){this.$ref=e,this.path=r,this.originalPath=n||r,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,r,n){let i=t.parse(this.path,this.originalPath),s=[];this.value=p1(e);for(let a=0;a<i.length;a++){if(Fm(this,r,n)&&(this.path=t.join(this.path,i.slice(a))),typeof this.value=="object"&&this.value!==null&&!m1(n)&&"$ref"in this.value)return this;let u=i[a];if(this.value[u]===void 0||this.value[u]===null&&a===i.length-1){let f=!1;for(let _=i.length-1;_>a;_--){let C=i.slice(a,_+1).join("/");if(this.value[C]!==void 0){this.value=this.value[C],a=_,f=!0;break}}if(f)continue;if(u in this.value&&this.value[u]===null){this.value=Dr.nullSymbol;continue}this.value=null;let h=this.$ref.path||"",g=this.path.replace(h,""),m=t.join("",s),S=n?.replace(h,"");throw new Lm.MissingPointerError(u,decodeURI(this.originalPath),g,m,S)}else this.value=this.value[u];s.push(u)}return(!this.value||this.value.$ref&&P_.resolve(this.path,this.value.$ref)!==n)&&Fm(this,r,n),this}set(e,r,n){let i=t.parse(this.path),s;if(i.length===0)return this.value=r,r;this.value=p1(e);for(let a=0;a<i.length-1;a++)Fm(this,n),s=i[a],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=h1(this,s,{});return Fm(this,n),s=i[i.length-1],h1(this,s,r),e}static parse(e,r){let n=P_.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=VJ(i[s].replace(BJ,"/").replace(HJ,"~"));if(i[0]!=="")throw new Lm.InvalidPointerError(n,r===void 0?e:r);return i.slice(1)}static join(e,r){e.indexOf("#")===-1&&(e+="#"),r=Array.isArray(r)?r:[r];for(let n=0;n<r.length;n++){let i=r[n];e+="/"+encodeURIComponent(i.replace(UJ,"~0").replace(jJ,"~1"))}return e}};function Fm(t,e,r){if(O_.default.isAllowed$Ref(t.value,e)){let n=P_.resolve(t.path,t.value.$ref);if(n===t.path&&!m1(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,O_.default.isExtended$Ref(t.value)?(t.value=O_.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Dr.default=jm;function h1(t,e,r){if(t.value&&typeof t.value=="object")e==="-"&&Array.isArray(t.value)?t.value.push(r):t.value[e]=r;else throw new Lm.JSONParserError(`Error assigning $ref pointer "${t.path}".
|
|
173
|
-
Cannot set "${e}" of a non-object.`);return r}function
|
|
174
|
-
"${i}" not found.`);s.set(n,r)}_get$Ref(e){e=
|
|
175
|
-
"${s}" not found.`);return a.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};
|
|
176
|
-
Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new
|
|
170
|
+
`+n:r||n}Ci.joinStacks=XP;function bJ(t,e,r){r?Object.defineProperty(e,"stack",{get:()=>{let n=t.get.apply(e);return XP({stack:n},r)},enumerable:!1,configurable:!0}):_J(e,t)}Ci.lazyJoinStacks=bJ;function e1(t){if(t){let e=t.split(gJ),r;for(let n=0;n<e.length;n++){let i=e[n];if(yJ.test(i))r===void 0&&(r=n);else if(r!==void 0){e.splice(r,n-r);break}}if(e.length>0)return e.join(`
|
|
171
|
+
`)}return t}function _J(t,e){Object.defineProperty(t,"stack",{get:()=>e1(e.get.apply(t)),enumerable:!1,configurable:!0})}});var i1=F(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.extendError=void 0;var r1=f_(),Im=t1(),n1=Rm(),wJ=["name","message","stack"];function EJ(t,e,r){let n=t;return xJ(n,e),e&&typeof e=="object"&&CJ(n,e),n.toJSON=n1.toJSON,r1.addInspectMethod&&r1.addInspectMethod(n),r&&typeof r=="object"&&Object.assign(n,r),n}Om.extendError=EJ;function xJ(t,e){let r=Object.getOwnPropertyDescriptor(t,"stack");Im.isLazyStack(r)?Im.lazyJoinStacks(r,t,e):Im.isWritableStack(r)&&(t.stack=Im.joinStacks(t,e))}function CJ(t,e){let r=n1.getDeepKeys(e,wJ),n=t,i=e;for(let s of r)if(n[s]===void 0)try{n[s]=i[s]}catch{}}});var s1=F(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.normalizeArgs=xu.normalizeOptions=void 0;var RJ=f_();function IJ(t){return t=t||{},{concatMessages:t.concatMessages===void 0?!0:!!t.concatMessages,format:t.format===void 0?RJ.format:typeof t.format=="function"?t.format:!1}}xu.normalizeOptions=IJ;function OJ(t,e){let r,n,i,s="";return typeof t[0]=="string"?i=t:typeof t[1]=="string"?(t[0]instanceof Error?r=t[0]:n=t[0],i=t.slice(1)):(r=t[0],n=t[1],i=t.slice(2)),i.length>0&&(e.format?s=e.format.apply(void 0,i):s=i.join(" ")),e.concatMessages&&r&&r.message&&(s+=(s?`
|
|
172
|
+
`:"")+r.message),{originalError:r,props:n,message:s}}xu.normalizeArgs=OJ});var h_=F(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});km.Ono=void 0;var Pm=i1(),o1=s1(),PJ=Rm(),kJ=d_;km.Ono=kJ;function d_(t,e){e=o1.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:a}=o1.normalizeArgs(n,e),u=new t(a);return Pm.extendError(u,i,s)}return r[Symbol.species]=t,r}d_.toJSON=function(e){return PJ.toJSON.call(e)};d_.extend=function(e,r,n){return n||r instanceof Error?Pm.extendError(e,r,n):r?Pm.extendError(e,void 0,r):Pm.extendError(e)}});var a1=F(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.ono=void 0;var ga=h_(),AJ=Ri;Am.ono=AJ;Ri.error=new ga.Ono(Error);Ri.eval=new ga.Ono(EvalError);Ri.range=new ga.Ono(RangeError);Ri.reference=new ga.Ono(ReferenceError);Ri.syntax=new ga.Ono(SyntaxError);Ri.type=new ga.Ono(TypeError);Ri.uri=new ga.Ono(URIError);var TJ=Ri;function Ri(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values(TJ))if(typeof r=="function"&&r.name==="ono"){let n=r[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return r.apply(void 0,t)}}return Ri.error.apply(void 0,t)}});var u1=F(l1=>{"use strict";Object.defineProperty(l1,"__esModule",{value:!0});var R7=require("util")});var no=F((zn,Cu)=>{"use strict";var qJ=zn&&zn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$J=zn&&zn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&qJ(e,t,r)};Object.defineProperty(zn,"__esModule",{value:!0});zn.ono=void 0;var c1=a1();Object.defineProperty(zn,"ono",{enumerable:!0,get:function(){return c1.ono}});var MJ=h_();Object.defineProperty(zn,"Ono",{enumerable:!0,get:function(){return MJ.Ono}});$J(u1(),zn);zn.default=c1.ono;typeof Cu=="object"&&typeof Cu.exports=="object"&&(Cu.exports=Object.assign(Cu.exports.default,Cu.exports))});var p_=F(Vf=>{"use strict";var NJ=Vf&&Vf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Vf,"__esModule",{value:!0});Vf.default=DJ;var f1=NJ(require("path"));function DJ(t){return t.startsWith("\\\\?\\")?t:t.split(f1.default?.win32?.sep).join(f1.default?.posix?.sep??"/")}});var d1=F(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.isWindows=void 0;var FJ=/^win/.test(globalThis.process?globalThis.process.platform:""),LJ=()=>FJ;Tm.isWindows=LJ});var wn=F(vt=>{"use strict";var jJ=vt&&vt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UJ=vt&&vt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BJ=vt&&vt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&jJ(r,e,n[i]);return UJ(r,e),r}})(),HJ=vt&&vt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vt,"__esModule",{value:!0});vt.parse=void 0;vt.resolve=h1;vt.cwd=p1;vt.getProtocol=S_;vt.getExtension=QJ;vt.stripQuery=m1;vt.getHash=g1;vt.stripHash=y_;vt.isHttp=ZJ;vt.isFileSystemPath=v_;vt.fromFileSystemPath=XJ;vt.toFileSystemPath=ez;vt.safePointerToPath=tz;vt.relative=rz;var $m=HJ(p_()),g_=BJ(require("path")),VJ=/\//g,WJ=/^(\w{2,}):\/\//i,YJ=/~1/g,JJ=/~0/g,zJ=require("path"),qm=d1(),KJ=[[/\?/g,"%3F"],[/#/g,"%23"]],m_=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],GJ=t=>new URL(t);vt.parse=GJ;function h1(t,e){let r=new URL((0,$m.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,$m.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:a,hash:u}=n;return s+a+u+i}return n.toString()+i}function p1(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function S_(t){let e=WJ.exec(t||"");if(e)return e[1].toLowerCase()}function QJ(t){let e=t.lastIndexOf(".");return e>=0?m1(t.substr(e).toLowerCase()):""}function m1(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function g1(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function y_(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function ZJ(t){let e=S_(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function v_(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=S_(t);return e===void 0||e==="file"}function XJ(t){if((0,qm.isWindows)()){let e=p1(),r=t.toUpperCase(),i=(0,$m.default)(e).toUpperCase(),s=r.includes(i),a=r.includes(i),u=g_.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||a||u)&&!e.startsWith("http")&&(t=(0,zJ.join)(e,t)),t=(0,$m.default)(t)}t=encodeURI(t);for(let e of KJ)t=t.replace(e[0],e[1]);return t}function ez(t,e){t=decodeURI(t);for(let n=0;n<m_.length;n+=2)t=t.replace(m_[n],m_[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,qm.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,qm.isWindows)()?t:"/"+t)),(0,qm.isWindows)()&&!r&&(t=t.replace(VJ,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function tz(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(YJ,"/").replace(JJ,"~"))}function rz(t,e){if(!v_(t)||!v_(e))return h1(t,e);let r=g_.default.dirname(y_(t)),n=y_(e);return g_.default.relative(r,n)+g1(e)}});var En=F(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.InvalidPointerError=Rt.TimeoutError=Rt.MissingPointerError=Rt.UnmatchedResolverError=Rt.ResolverError=Rt.UnmatchedParserError=Rt.ParserError=Rt.JSONParserErrorGroup=Rt.JSONParserError=void 0;Rt.isHandledError=nz;Rt.normalizeError=iz;var y1=no(),Mm=wn(),Kn=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,y1.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Rt.JSONParserError=Kn;var Nm=class t extends Error{constructor(e){super(),this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${(0,Mm.toFileSystemPath)(e.$refs._root$Ref.path)}'`,y1.Ono.extend(this)}static getParserErrors(e){let r=[];for(let n of Object.values(e.$refs._$refs))n.errors&&r.push(...n.errors);return r}get errors(){return t.getParserErrors(this.files)}};Rt.JSONParserErrorGroup=Nm;var b_=class extends Kn{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};Rt.ParserError=b_;var __=class extends Kn{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};Rt.UnmatchedParserError=__;var w_=class extends Kn{constructor(e,r){super(e.message||`Error reading file "${r}"`,r),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};Rt.ResolverError=w_;var E_=class extends Kn{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};Rt.UnmatchedResolverError=E_;var x_=class extends Kn{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,Mm.getHash)(r)}". Token "${e}" does not exist.`,(0,Mm.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};Rt.MissingPointerError=x_;var C_=class extends Kn{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};Rt.TimeoutError=C_;var R_=class extends Kn{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,Mm.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};Rt.InvalidPointerError=R_;function nz(t){return t instanceof Kn||t instanceof Nm}function iz(t){return t.path===null&&(t.path=[]),t}});var Wf=F(Lr=>{"use strict";var sz=Lr&&Lr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oz=Lr&&Lr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),az=Lr&&Lr.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&sz(r,e,n[i]);return oz(r,e),r}})(),lz=Lr&&Lr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.nullSymbol=void 0;var I_=lz(Ru()),O_=az(wn()),Fm=En();Lr.nullSymbol=Symbol("null");var uz=/\//g,cz=/~/g,fz=/~1/g,dz=/~0/g,hz=t=>{try{return decodeURIComponent(t)}catch{return t}},Lm=class t{constructor(e,r,n){this.$ref=e,this.path=r,this.originalPath=n||r,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,r,n){let i=t.parse(this.path,this.originalPath),s=[];this.value=S1(e);for(let a=0;a<i.length;a++){if(Dm(this,r,n)&&(this.path=t.join(this.path,i.slice(a))),typeof this.value=="object"&&this.value!==null&&!b1(n)&&"$ref"in this.value)return this;let u=i[a];if(this.value[u]===void 0||this.value[u]===null&&a===i.length-1){let f=!1;for(let E=i.length-1;E>a;E--){let x=i.slice(a,E+1).join("/");if(this.value[x]!==void 0){this.value=this.value[x],a=E,f=!0;break}}if(f)continue;if(u in this.value&&this.value[u]===null){this.value=Lr.nullSymbol;continue}this.value=null;let h=this.$ref.path||"",g=this.path.replace(h,""),m=t.join("",s),S=n?.replace(h,"");throw new Fm.MissingPointerError(u,decodeURI(this.originalPath),g,m,S)}else this.value=this.value[u];s.push(u)}return(!this.value||this.value.$ref&&O_.resolve(this.path,this.value.$ref)!==n)&&Dm(this,r,n),this}set(e,r,n){let i=t.parse(this.path),s;if(i.length===0)return this.value=r,r;this.value=S1(e);for(let a=0;a<i.length-1;a++)Dm(this,n),s=i[a],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=v1(this,s,{});return Dm(this,n),s=i[i.length-1],v1(this,s,r),e}static parse(e,r){let n=O_.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=hz(i[s].replace(fz,"/").replace(dz,"~"));if(i[0]!=="")throw new Fm.InvalidPointerError(n,r===void 0?e:r);return i.slice(1)}static join(e,r){e.indexOf("#")===-1&&(e+="#"),r=Array.isArray(r)?r:[r];for(let n=0;n<r.length;n++){let i=r[n];e+="/"+encodeURIComponent(i.replace(cz,"~0").replace(uz,"~1"))}return e}};function Dm(t,e,r){if(I_.default.isAllowed$Ref(t.value,e)){let n=O_.resolve(t.path,t.value.$ref);if(n===t.path&&!b1(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,I_.default.isExtended$Ref(t.value)?(t.value=I_.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Lr.default=Lm;function v1(t,e,r){if(t.value&&typeof t.value=="object")e==="-"&&Array.isArray(t.value)?t.value.push(r):t.value[e]=r;else throw new Fm.JSONParserError(`Error assigning $ref pointer "${t.path}".
|
|
173
|
+
Cannot set "${e}" of a non-object.`);return r}function S1(t){if((0,Fm.isHandledError)(t))throw t;return t}function b1(t){return typeof t=="string"&&Lm.parse(t).length==0}});var Ru=F(Xi=>{"use strict";var pz=Xi&&Xi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mz=Xi&&Xi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gz=Xi&&Xi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&pz(r,e,n[i]);return mz(r,e),r}})();Object.defineProperty(Xi,"__esModule",{value:!0});var jm=gz(Wf()),Um=En(),P_=wn(),k_=class t{constructor(e){this.errors=[],this.$refs=e}addError(e){this.errors===void 0&&(this.errors=[]);let r=this.errors.map(({footprint:n})=>n);"errors"in e&&Array.isArray(e.errors)?this.errors.push(...e.errors.map(Um.normalizeError).filter(({footprint:n})=>!r.includes(n))):(!("footprint"in e)||!r.includes(e.footprint))&&this.errors.push((0,Um.normalizeError)(e))}exists(e,r){try{return this.resolve(e,r),!0}catch{return!1}}get(e,r){return this.resolve(e,r)?.value}resolve(e,r,n,i){let s=new jm.default(this,e,n);try{let a=s.resolve(this.value,r,i);return a.value===jm.nullSymbol&&(a.value=null),a}catch(a){if(!r||!r.continueOnError||!(0,Um.isHandledError)(a))throw a;return a.path===null&&(a.path=(0,P_.safePointerToPath)((0,P_.getHash)(i))),a instanceof Um.InvalidPointerError&&(a.source=decodeURI((0,P_.stripHash)(i))),this.addError(a),null}}set(e,r){let n=new jm.default(this,e);this.value=n.set(this.value,r),this.value===jm.nullSymbol&&(this.value=null)}static is$Ref(e){return!!e&&typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"&&e.$ref.length>0}static isExternal$Ref(e){return t.is$Ref(e)&&e.$ref[0]!=="#"}static isAllowed$Ref(e,r){if(this.is$Ref(e)){if(e.$ref.substring(0,2)==="#/"||e.$ref==="#")return!0;if(e.$ref[0]!=="#"&&(!r||r.resolve?.external))return!0}}static isExtended$Ref(e){return t.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,r){if(r&&typeof r=="object"&&t.isExtended$Ref(e)){let n={};for(let i of Object.keys(e))i!=="$ref"&&(n[i]=e[i]);for(let i of Object.keys(r))i in n||(n[i]=r[i]);return n}else return r}};Xi.default=k_});var C1=F(Gn=>{"use strict";var yz=Gn&&Gn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vz=Gn&&Gn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Sz=Gn&&Gn.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&yz(r,e,n[i]);return vz(r,e),r}})(),x1=Gn&&Gn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gn,"__esModule",{value:!0});var _1=no(),bz=x1(Ru()),io=Sz(wn()),w1=x1(p_()),A_=class{paths(...e){return E1(this._$refs,e.flat()).map(n=>(0,w1.default)(n.decoded))}values(...e){let r=this._$refs;return E1(r,e.flat()).reduce((i,s)=>(i[(0,w1.default)(s.decoded)]=r[s.encoded].value,i),{})}exists(e,r){try{return this._resolve(e,"",r),!0}catch{return!1}}get(e,r){return this._resolve(e,"",r).value}set(e,r){let n=io.resolve(this._root$Ref.path,e),i=io.stripHash(n),s=this._$refs[i];if(!s)throw(0,_1.ono)(`Error resolving $ref pointer "${e}".
|
|
174
|
+
"${i}" not found.`);s.set(n,r)}_get$Ref(e){e=io.resolve(this._root$Ref.path,e);let r=io.stripHash(e);return this._$refs[r]}_add(e){let r=io.stripHash(e),n=new bz.default(this);return n.path=r,this._$refs[r]=n,this._root$Ref=this._root$Ref||n,n}_resolve(e,r,n){let i=io.resolve(this._root$Ref.path,e),s=io.stripHash(i),a=this._$refs[s];if(!a)throw(0,_1.ono)(`Error resolving $ref pointer "${e}".
|
|
175
|
+
"${s}" not found.`);return a.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};Gn.default=A_;function E1(t,e){let r=Object.keys(t);return e=Array.isArray(e[0])?e[0]:Array.prototype.slice.call(e),e.length>0&&e[0]&&(r=r.filter(n=>e.includes(t[n].pathType))),r.map(n=>({encoded:n,decoded:t[n].pathType==="file"?io.toFileSystemPath(n,!0):n}))}});var I1=F(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.all=_z;Iu.filter=wz;Iu.sort=Ez;Iu.run=xz;function _z(t){return Object.keys(t||{}).filter(e=>typeof t[e]=="object").map(e=>(t[e].name=e,t[e]))}function wz(t,e,r){return t.filter(n=>!!R1(n,e,r))}function Ez(t){for(let e of t)e.order=e.order||Number.MAX_SAFE_INTEGER;return t.sort((e,r)=>e.order-r.order)}async function xz(t,e,r,n){let i,s,a=0;return new Promise((u,f)=>{h();function h(){if(i=t[a++],!i)return f(s);try{let E=R1(i,e,r,g,n);if(E&&typeof E.then=="function")E.then(m,S);else if(E!==void 0)m(E);else if(a===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(E){S(E)}}function g(E,x){E?S(E):m(x)}function m(E){u({plugin:i,result:E})}function S(E){s={plugin:i,error:E},h()}})}function R1(t,e,r,n,i){let s=t[e];if(typeof s=="function")return s.apply(t,[r,n,i]);if(!n){if(s instanceof RegExp)return s.test(r.url);if(typeof s=="string")return s===r.extension;if(Array.isArray(s))return s.indexOf(r.extension)!==-1}return s}});var q_=F(es=>{"use strict";var Cz=es&&es.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Rz=es&&es.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),O1=es&&es.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&Cz(r,e,n[i]);return Rz(r,e),r}})();Object.defineProperty(es,"__esModule",{value:!0});var T_=no(),Iz=O1(wn()),so=O1(I1()),ya=En();async function Oz(t,e,r){let n=t.indexOf("#"),i="";n>=0&&(i=t.substring(n),t=t.substring(0,n));let s=e._add(t),a={url:t,hash:i,extension:Iz.getExtension(t)};try{let u=await Pz(a,r,e);s.pathType=u.plugin.name,a.data=u.result;let f=await kz(a,r,e);return s.value=f.result,f.result}catch(u){throw(0,ya.isHandledError)(u)&&(s.value=u),u}}async function Pz(t,e,r){let n=so.all(e.resolve);n=so.filter(n,"canRead",t),so.sort(n);try{return await so.run(n,"read",t,r)}catch(i){throw!i&&e.continueOnError?new ya.UnmatchedResolverError(t.url):!i||!("error"in i)?T_.ono.syntax(`Unable to resolve $ref pointer "${t.url}"`):i.error instanceof ya.ResolverError?i.error:new ya.ResolverError(i,t.url)}}async function kz(t,e,r){let n=so.all(e.parse),i=so.filter(n,"canParse",t),s=i.length>0?i:n;so.sort(s);try{let a=await so.run(s,"parse",t,r);if(!a.plugin.allowEmpty&&Az(a.result))throw T_.ono.syntax(`Error parsing "${t.url}" as ${a.plugin.name}.
|
|
176
|
+
Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new ya.UnmatchedParserError(t.url):a&&a.message&&a.message.startsWith("Error parsing")?a:!a||!("error"in a)?T_.ono.syntax(`Unable to parse ${t.url}`):a.error instanceof ya.ParserError?a.error:new ya.ParserError(a.error.message,t.url)}}function Az(t){return t===void 0||typeof t=="object"&&Object.keys(t).length===0||typeof t=="string"&&t.trim().length===0||Buffer.isBuffer(t)&&t.length===0}es.default=Oz});var k1=F($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});var P1=En();$_.default={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string"){if(e.trim().length===0)return;try{return JSON.parse(e)}catch(r){if(this.allowBOM)try{let n=e.indexOf("{");return e=e.slice(n),JSON.parse(e)}catch(n){throw new P1.ParserError(n.message,t.url)}throw new P1.ParserError(r.message,t.url)}}else return e}}});var Ou=F((F7,va)=>{"use strict";function A1(t){return typeof t>"u"||t===null}function Tz(t){return typeof t=="object"&&t!==null}function qz(t){return Array.isArray(t)?t:A1(t)?[]:[t]}function $z(t,e){if(e){let r=Object.keys(e);for(let n=0,i=r.length;n<i;n+=1){let s=r[n];t[s]=e[s]}}return t}function Mz(t,e){let r="";for(let n=0;n<e;n+=1)r+=t;return r}function Nz(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}va.exports.isNothing=A1;va.exports.isObject=Tz;va.exports.toArray=qz;va.exports.repeat=Mz;va.exports.isNegativeZero=Nz;va.exports.extend=$z});var Pu=F((L7,q1)=>{"use strict";function T1(t,e){let r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
|
|
177
177
|
|
|
178
|
-
`+t.mark.snippet),n+" "+r):n}function
|
|
179
|
-
`+u
|
|
180
|
-
`,u+=
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
\r`;function
|
|
184
|
-
|
|
185
|
-
`,e-1))}function
|
|
186
|
-
`,
|
|
187
|
-
`);break}
|
|
188
|
-
`,
|
|
189
|
-
`,
|
|
190
|
-
`,
|
|
191
|
-
`,
|
|
192
|
-
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));
|
|
193
|
-
`,n)
|
|
194
|
-
`&&(
|
|
195
|
-
`+
|
|
196
|
-
`,
|
|
178
|
+
`+t.mark.snippet),n+" "+r):n}function Yf(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=T1(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Yf.prototype=Object.create(Error.prototype);Yf.prototype.constructor=Yf;Yf.prototype.toString=function(e){return this.name+": "+T1(this,e)};q1.exports=Yf});var M1=F((j7,$1)=>{"use strict";var Jf=Ou();function M_(t,e,r,n,i){let s="",a="",u=Math.floor(i/2)-1;return n-e>u&&(s=" ... ",e=n-u+s.length),r-n>u&&(a=" ...",r=n+u-a.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+a,pos:n-e+s.length}}function N_(t,e){return Jf.repeat(" ",e-t.length)+t}function Dz(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);let r=/\r?\n|\r|\0/g,n=[0],i=[],s,a=-1;for(;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);let u="",f=Math.min(t.line+e.linesAfter,i.length).toString().length,h=e.maxLength-(e.indent+f+3);for(let m=1;m<=e.linesBefore&&!(a-m<0);m++){let S=M_(t.buffer,n[a-m],i[a-m],t.position-(n[a]-n[a-m]),h);u=Jf.repeat(" ",e.indent)+N_((t.line-m+1).toString(),f)+" | "+S.str+`
|
|
179
|
+
`+u}let g=M_(t.buffer,n[a],i[a],t.position,h);u+=Jf.repeat(" ",e.indent)+N_((t.line+1).toString(),f)+" | "+g.str+`
|
|
180
|
+
`,u+=Jf.repeat("-",e.indent+f+3+g.pos)+`^
|
|
181
|
+
`;for(let m=1;m<=e.linesAfter&&!(a+m>=i.length);m++){let S=M_(t.buffer,n[a+m],i[a+m],t.position-(n[a]-n[a+m]),h);u+=Jf.repeat(" ",e.indent)+N_((t.line+m+1).toString(),f)+" | "+S.str+`
|
|
182
|
+
`}return u.replace(/\n$/,"")}$1.exports=Dz});var cr=F((U7,D1)=>{"use strict";var N1=Pu(),Fz=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Lz=["scalar","sequence","mapping"];function jz(t){let e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function Uz(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(Fz.indexOf(r)===-1)throw new N1('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=jz(e.styleAliases||null),Lz.indexOf(this.kind)===-1)throw new N1('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}D1.exports=Uz});var L_=F((B7,L1)=>{"use strict";var zf=Pu(),D_=cr();function F1(t,e){let r=[];return t[e].forEach(function(n){let i=r.length;r.forEach(function(s,a){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=a)}),r[i]=n}),r}function Bz(){let t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function e(r){r.multi?(t.multi[r.kind].push(r),t.multi.fallback.push(r)):t[r.kind][r.tag]=t.fallback[r.tag]=r}for(let r=0,n=arguments.length;r<n;r+=1)arguments[r].forEach(e);return t}function F_(t){return this.extend(t)}F_.prototype.extend=function(e){let r=[],n=[];if(e instanceof D_)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new zf("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof D_))throw new zf("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new zf("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new zf("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(s){if(!(s instanceof D_))throw new zf("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(F_.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=F1(i,"implicit"),i.compiledExplicit=F1(i,"explicit"),i.compiledTypeMap=Bz(i.compiledImplicit,i.compiledExplicit),i};L1.exports=F_});var j_=F((H7,j1)=>{"use strict";var Hz=cr();j1.exports=new Hz("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var U_=F((V7,U1)=>{"use strict";var Vz=cr();U1.exports=new Vz("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var B_=F((W7,B1)=>{"use strict";var Wz=cr();B1.exports=new Wz("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var H_=F((Y7,H1)=>{"use strict";var Yz=L_();H1.exports=new Yz({explicit:[j_(),U_(),B_()]})});var V_=F((J7,V1)=>{"use strict";var Jz=cr();function zz(t){if(t===null)return!0;let e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function Kz(){return null}function Gz(t){return t===null}V1.exports=new Jz("tag:yaml.org,2002:null",{kind:"scalar",resolve:zz,construct:Kz,predicate:Gz,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var W_=F((z7,W1)=>{"use strict";var Qz=cr();function Zz(t){if(t===null)return!1;let e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function Xz(t){return t==="true"||t==="True"||t==="TRUE"}function eK(t){return Object.prototype.toString.call(t)==="[object Boolean]"}W1.exports=new Qz("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Zz,construct:Xz,predicate:eK,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})});var Y_=F((K7,Y1)=>{"use strict";var tK=Ou(),rK=cr();function nK(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function iK(t){return t>=48&&t<=55}function sK(t){return t>=48&&t<=57}function oK(t){if(t===null)return!1;let e=t.length,r=0,n=!1;if(!e)return!1;let i=t[r];if((i==="-"||i==="+")&&(i=t[++r]),i==="0"){if(r+1===e)return!0;if(i=t[++r],i==="b"){for(r++;r<e;r++){if(i=t[r],i!=="0"&&i!=="1")return!1;n=!0}return n&&Number.isFinite(Kf(t))}if(i==="x"){for(r++;r<e;r++){if(!nK(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Kf(t))}if(i==="o"){for(r++;r<e;r++){if(!iK(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Kf(t))}}for(;r<e;r++){if(!sK(t.charCodeAt(r)))return!1;n=!0}return n?Number.isFinite(Kf(t)):!1}function Kf(t){let e=t,r=1,n=e[0];if((n==="-"||n==="+")&&(n==="-"&&(r=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return r*parseInt(e.slice(2),2);if(e[1]==="x")return r*parseInt(e.slice(2),16);if(e[1]==="o")return r*parseInt(e.slice(2),8)}return r*parseInt(e,10)}function aK(t){return Kf(t)}function lK(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!tK.isNegativeZero(t)}Y1.exports=new rK("tag:yaml.org,2002:int",{kind:"scalar",resolve:oK,construct:aK,predicate:lK,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var J_=F((G7,z1)=>{"use strict";var J1=Ou(),uK=cr(),cK=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),fK=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function dK(t){return t===null||!cK.test(t)?!1:Number.isFinite(parseFloat(t,10))?!0:fK.test(t)}function hK(t){let e=t.toLowerCase(),r=e[0]==="-"?-1:1;return"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}var pK=/^[-+]?[0-9]+e/;function mK(t,e){if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(J1.isNegativeZero(t))return"-0.0";let r=t.toString(10);return pK.test(r)?r.replace("e",".e"):r}function gK(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||J1.isNegativeZero(t))}z1.exports=new uK("tag:yaml.org,2002:float",{kind:"scalar",resolve:dK,construct:hK,predicate:gK,represent:mK,defaultStyle:"lowercase"})});var z_=F((Q7,K1)=>{"use strict";K1.exports=H_().extend({implicit:[V_(),W_(),Y_(),J_()]})});var K_=F((Z7,G1)=>{"use strict";G1.exports=z_()});var G_=F((X7,X1)=>{"use strict";var yK=cr(),Q1=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Z1=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function vK(t){return t===null?!1:Q1.exec(t)!==null||Z1.exec(t)!==null}function SK(t){let e=0,r=null,n=Q1.exec(t);if(n===null&&(n=Z1.exec(t)),n===null)throw new Error("Date resolve error");let i=+n[1],s=+n[2]-1,a=+n[3];if(!n[4])return new Date(Date.UTC(i,s,a));let u=+n[4],f=+n[5],h=+n[6];if(n[7]){for(e=n[7].slice(0,3);e.length<3;)e+="0";e=+e}if(n[9]){let m=+n[10],S=+(n[11]||0);r=(m*60+S)*6e4,n[9]==="-"&&(r=-r)}let g=new Date(Date.UTC(i,s,a,u,f,h,e));return r&&g.setTime(g.getTime()-r),g}function bK(t){return t.toISOString()}X1.exports=new yK("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:vK,construct:SK,instanceOf:Date,represent:bK})});var Q_=F((eQ,ek)=>{"use strict";var _K=cr();function wK(t){return t==="<<"||t===null}ek.exports=new _K("tag:yaml.org,2002:merge",{kind:"scalar",resolve:wK})});var X_=F((tQ,tk)=>{"use strict";var EK=cr(),Z_=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
183
|
+
\r`;function xK(t){if(t===null)return!1;let e=0,r=t.length,n=Z_;for(let i=0;i<r;i++){let s=n.indexOf(t.charAt(i));if(!(s>64)){if(s<0)return!1;e+=6}}return e%8===0}function CK(t){let e=t.replace(/[\r\n=]/g,""),r=e.length,n=Z_,i=0,s=[];for(let u=0;u<r;u++)u%4===0&&u&&(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)),i=i<<6|n.indexOf(e.charAt(u));let a=r%4*6;return a===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):a===18?(s.push(i>>10&255),s.push(i>>2&255)):a===12&&s.push(i>>4&255),new Uint8Array(s)}function RK(t){let e="",r=0,n=t.length,i=Z_;for(let a=0;a<n;a++)a%3===0&&a&&(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]),r=(r<<8)+t[a];let s=n%3;return s===0?(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]):s===2?(e+=i[r>>10&63],e+=i[r>>4&63],e+=i[r<<2&63],e+=i[64]):s===1&&(e+=i[r>>2&63],e+=i[r<<4&63],e+=i[64],e+=i[64]),e}function IK(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}tk.exports=new EK("tag:yaml.org,2002:binary",{kind:"scalar",resolve:xK,construct:CK,predicate:IK,represent:RK})});var ew=F((rQ,rk)=>{"use strict";var OK=cr(),PK=Object.prototype.hasOwnProperty,kK=Object.prototype.toString;function AK(t){if(t===null)return!0;let e=[],r=t;for(let n=0,i=r.length;n<i;n+=1){let s=r[n],a=!1;if(kK.call(s)!=="[object Object]")return!1;let u;for(u in s)if(PK.call(s,u))if(!a)a=!0;else return!1;if(!a)return!1;if(e.indexOf(u)===-1)e.push(u);else return!1}return!0}function TK(t){return t!==null?t:[]}rk.exports=new OK("tag:yaml.org,2002:omap",{kind:"sequence",resolve:AK,construct:TK})});var tw=F((nQ,nk)=>{"use strict";var qK=cr(),$K=Object.prototype.toString;function MK(t){if(t===null)return!0;let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n];if($K.call(s)!=="[object Object]")return!1;let a=Object.keys(s);if(a.length!==1)return!1;r[n]=[a[0],s[a[0]]]}return!0}function NK(t){if(t===null)return[];let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n],a=Object.keys(s);r[n]=[a[0],s[a[0]]]}return r}nk.exports=new qK("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:MK,construct:NK})});var rw=F((iQ,ik)=>{"use strict";var DK=cr(),FK=Object.prototype.hasOwnProperty;function LK(t){if(t===null)return!0;let e=t;for(let r in e)if(FK.call(e,r)&&e[r]!==null)return!1;return!0}function jK(t){return t!==null?t:{}}ik.exports=new DK("tag:yaml.org,2002:set",{kind:"mapping",resolve:LK,construct:jK})});var Bm=F((sQ,sk)=>{"use strict";sk.exports=K_().extend({implicit:[G_(),Q_()],explicit:[X_(),ew(),tw(),rw()]})});var Ck=F((oQ,ow)=>{"use strict";var Sa=Ou(),hk=Pu(),UK=M1(),BK=Bm(),Qn=Object.prototype.hasOwnProperty,Hm=1,pk=2,mk=3,Vm=4,nw=1,HK=2,ok=3,VK=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,WK=/[\x85\u2028\u2029]/,YK=/[,\[\]{}]/,gk=/^(?:!|!!|![0-9A-Za-z-]+!)$/,yk=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function ak(t){return Object.prototype.toString.call(t)}function Ii(t){return t===10||t===13}function ts(t){return t===9||t===32}function jr(t){return t===9||t===32||t===10||t===13}function ku(t){return t===44||t===91||t===93||t===123||t===125}function JK(t){if(t>=48&&t<=57)return t-48;let e=t|32;return e>=97&&e<=102?e-97+10:-1}function zK(t){return t===120?2:t===117?4:t===85?8:0}function KK(t){return t>=48&&t<=57?t-48:-1}function lk(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
184
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function GK(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function vk(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var Sk=new Array(256),bk=new Array(256);for(let t=0;t<256;t++)Sk[t]=lk(t)?1:0,bk[t]=lk(t);function QK(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||BK,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:100,this.maxMergeSeqLength=typeof e.maxMergeSeqLength=="number"?e.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function _k(t,e){let r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=UK(r),new hk(e,r)}function ce(t,e){throw _k(t,e)}function Wm(t,e){t.onWarning&&t.onWarning.call(null,_k(t,e))}function ba(t,e,r){let n=t.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];Qn.call(i,e)||(i[e]={existed:Qn.call(t.anchorMap,e),value:t.anchorMap[e]})}t.anchorMap[e]=r}function ZK(t){t.anchorMapTransactions.push(Object.create(null))}function XK(t){let e=t.anchorMapTransactions.pop(),r=t.anchorMapTransactions;if(r.length===0)return;let n=r[r.length-1],i=Object.keys(e);for(let s=0,a=i.length;s<a;s+=1){let u=i[s];Qn.call(n,u)||(n[u]=e[u])}}function eG(t){let e=t.anchorMapTransactions.pop(),r=Object.keys(e);for(let n=r.length-1;n>=0;n-=1){let i=e[r[n]];i.existed?t.anchorMap[r[n]]=i.value:delete t.anchorMap[r[n]]}}function wk(t){return{position:t.position,line:t.line,lineStart:t.lineStart,lineIndent:t.lineIndent,firstTabInLine:t.firstTabInLine,tag:t.tag,anchor:t.anchor,kind:t.kind,result:t.result}}function uk(t,e){t.position=e.position,t.line=e.line,t.lineStart=e.lineStart,t.lineIndent=e.lineIndent,t.firstTabInLine=e.firstTabInLine,t.tag=e.tag,t.anchor=e.anchor,t.kind=e.kind,t.result=e.result}var ck={YAML:function(e,r,n){e.version!==null&&ce(e,"duplication of %YAML directive"),n.length!==1&&ce(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&ce(e,"ill-formed argument of the YAML directive");let s=parseInt(i[1],10),a=parseInt(i[2],10);s!==1&&ce(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&Wm(e,"unsupported YAML version of the document")},TAG:function(e,r,n){let i;n.length!==2&&ce(e,"TAG directive accepts exactly two arguments");let s=n[0];i=n[1],gk.test(s)||ce(e,"ill-formed tag handle (first argument) of the TAG directive"),Qn.call(e.tagMap,s)&&ce(e,'there is a previously declared suffix for "'+s+'" tag handle'),yk.test(i)||ce(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{ce(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i}};function oo(t,e,r,n){if(e<r){let i=t.input.slice(e,r);if(n)for(let s=0,a=i.length;s<a;s+=1){let u=i.charCodeAt(s);u===9||u>=32&&u<=1114111||ce(t,"expected valid JSON character")}else VK.test(i)&&ce(t,"the stream contains non-printable characters");t.result+=i}}function fk(t,e,r,n){Sa.isObject(r)||ce(t,"cannot merge mappings; the provided source object is unacceptable");let i=Object.keys(r);for(let s=0,a=i.length;s<a;s+=1){let u=i[s];Qn.call(e,u)||(vk(e,u,r[u]),n[u]=!0)}}function Au(t,e,r,n,i,s,a,u,f){if(Array.isArray(i)){i=Array.prototype.slice.call(i);for(let h=0,g=i.length;h<g;h+=1)Array.isArray(i[h])&&ce(t,"nested arrays are not supported inside keys"),typeof i=="object"&&ak(i[h])==="[object Object]"&&(i[h]="[object Object]")}if(typeof i=="object"&&ak(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s)){s.length>t.maxMergeSeqLength&&ce(t,"merge sequence length exceeded maxMergeSeqLength ("+t.maxMergeSeqLength+")");let h=new Set;for(let g=0,m=s.length;g<m;g+=1){let S=s[g];h.has(S)||(h.add(S),fk(t,e,S,r))}}else fk(t,e,s,r);else!t.json&&!Qn.call(r,i)&&Qn.call(e,i)&&(t.line=a||t.line,t.lineStart=u||t.lineStart,t.position=f||t.position,ce(t,"duplicated mapping key")),vk(e,i,s),delete r[i];return e}function iw(t){let e=t.input.charCodeAt(t.position);e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):ce(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Nt(t,e,r){let n=0,i=t.input.charCodeAt(t.position);for(;i!==0;){for(;ts(i);)i===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&i===35)do i=t.input.charCodeAt(++t.position);while(i!==10&&i!==13&&i!==0);if(Ii(i))for(iw(t),i=t.input.charCodeAt(t.position),n++,t.lineIndent=0;i===32;)t.lineIndent++,i=t.input.charCodeAt(++t.position);else break}return r!==-1&&n!==0&&t.lineIndent<r&&Wm(t,"deficient indentation"),n}function Ym(t){let e=t.position,r=t.input.charCodeAt(e);return!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||jr(r)))}function sw(t,e){e===1?t.result+=" ":e>1&&(t.result+=Sa.repeat(`
|
|
185
|
+
`,e-1))}function tG(t,e,r){let n,i,s,a,u,f,h=t.kind,g=t.result,m=t.input.charCodeAt(t.position);if(jr(m)||ku(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96)return!1;if(m===63||m===45){let S=t.input.charCodeAt(t.position+1);if(jr(S)||r&&ku(S))return!1}for(t.kind="scalar",t.result="",n=i=t.position,s=!1;m!==0;){if(m===58){let S=t.input.charCodeAt(t.position+1);if(jr(S)||r&&ku(S))break}else if(m===35){let S=t.input.charCodeAt(t.position-1);if(jr(S))break}else{if(t.position===t.lineStart&&Ym(t)||r&&ku(m))break;if(Ii(m))if(a=t.line,u=t.lineStart,f=t.lineIndent,Nt(t,!1,-1),t.lineIndent>=e){s=!0,m=t.input.charCodeAt(t.position);continue}else{t.position=i,t.line=a,t.lineStart=u,t.lineIndent=f;break}}s&&(oo(t,n,i,!1),sw(t,t.line-a),n=i=t.position,s=!1),ts(m)||(i=t.position+1),m=t.input.charCodeAt(++t.position)}return oo(t,n,i,!1),t.result?!0:(t.kind=h,t.result=g,!1)}function rG(t,e){let r,n,i=t.input.charCodeAt(t.position);if(i!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(i=t.input.charCodeAt(t.position))!==0;)if(i===39)if(oo(t,r,t.position,!0),i=t.input.charCodeAt(++t.position),i===39)r=t.position,t.position++,n=t.position;else return!0;else Ii(i)?(oo(t,r,n,!0),sw(t,Nt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Ym(t)?ce(t,"unexpected end of the document within a single quoted scalar"):(t.position++,ts(i)||(n=t.position));ce(t,"unexpected end of the stream within a single quoted scalar")}function nG(t,e){let r,n,i,s=t.input.charCodeAt(t.position);if(s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return oo(t,r,t.position,!0),t.position++,!0;if(s===92){if(oo(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),Ii(s))Nt(t,!1,e);else if(s<256&&Sk[s])t.result+=bk[s],t.position++;else if((i=zK(s))>0){let a=i,u=0;for(;a>0;a--)s=t.input.charCodeAt(++t.position),(i=JK(s))>=0?u=(u<<4)+i:ce(t,"expected hexadecimal character");t.result+=GK(u),t.position++}else ce(t,"unknown escape sequence");r=n=t.position}else Ii(s)?(oo(t,r,n,!0),sw(t,Nt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Ym(t)?ce(t,"unexpected end of the document within a double quoted scalar"):(t.position++,ts(s)||(n=t.position))}ce(t,"unexpected end of the stream within a double quoted scalar")}function iG(t,e){let r=!0,n,i,s,a=t.tag,u,f=t.anchor,h,g,m,S,E=Object.create(null),x,C,A,T=t.input.charCodeAt(t.position);if(T===91)h=93,S=!1,u=[];else if(T===123)h=125,S=!0,u={};else return!1;for(t.anchor!==null&&ba(t,t.anchor,u),T=t.input.charCodeAt(++t.position);T!==0;){if(Nt(t,!0,e),T=t.input.charCodeAt(t.position),T===h)return t.position++,t.tag=a,t.anchor=f,t.kind=S?"mapping":"sequence",t.result=u,!0;if(r?T===44&&ce(t,"expected the node content, but found ','"):ce(t,"missed comma between flow collection entries"),C=x=A=null,g=m=!1,T===63){let B=t.input.charCodeAt(t.position+1);jr(B)&&(g=m=!0,t.position++,Nt(t,!0,e))}n=t.line,i=t.lineStart,s=t.position,Tu(t,e,Hm,!1,!0),C=t.tag,x=t.result,Nt(t,!0,e),T=t.input.charCodeAt(t.position),(m||t.line===n)&&T===58&&(g=!0,T=t.input.charCodeAt(++t.position),Nt(t,!0,e),Tu(t,e,Hm,!1,!0),A=t.result),S?Au(t,u,E,C,x,A,n,i,s):g?u.push(Au(t,null,E,C,x,A,n,i,s)):u.push(x),Nt(t,!0,e),T=t.input.charCodeAt(t.position),T===44?(r=!0,T=t.input.charCodeAt(++t.position)):r=!1}ce(t,"unexpected end of the stream within a flow collection")}function sG(t,e){let r,n=nw,i=!1,s=!1,a=e,u=0,f=!1,h,g=t.input.charCodeAt(t.position);if(g===124)r=!1;else if(g===62)r=!0;else return!1;for(t.kind="scalar",t.result="";g!==0;)if(g=t.input.charCodeAt(++t.position),g===43||g===45)nw===n?n=g===43?ok:HK:ce(t,"repeat of a chomping mode identifier");else if((h=KK(g))>=0)h===0?ce(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?ce(t,"repeat of an indentation width identifier"):(a=e+h-1,s=!0);else break;if(ts(g)){do g=t.input.charCodeAt(++t.position);while(ts(g));if(g===35)do g=t.input.charCodeAt(++t.position);while(!Ii(g)&&g!==0)}for(;g!==0;){for(iw(t),t.lineIndent=0,g=t.input.charCodeAt(t.position);(!s||t.lineIndent<a)&&g===32;)t.lineIndent++,g=t.input.charCodeAt(++t.position);if(!s&&t.lineIndent>a&&(a=t.lineIndent),Ii(g)){u++;continue}if(!s&&a===0&&ce(t,"missing indentation for block scalar"),t.lineIndent<a){n===ok?t.result+=Sa.repeat(`
|
|
186
|
+
`,i?1+u:u):n===nw&&i&&(t.result+=`
|
|
187
|
+
`);break}r?ts(g)?(f=!0,t.result+=Sa.repeat(`
|
|
188
|
+
`,i?1+u:u)):f?(f=!1,t.result+=Sa.repeat(`
|
|
189
|
+
`,u+1)):u===0?i&&(t.result+=" "):t.result+=Sa.repeat(`
|
|
190
|
+
`,u):t.result+=Sa.repeat(`
|
|
191
|
+
`,i?1+u:u),i=!0,s=!0,u=0;let m=t.position;for(;!Ii(g)&&g!==0;)g=t.input.charCodeAt(++t.position);oo(t,m,t.position,!1)}return!0}function dk(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&ba(t,t.anchor,i);let a=t.input.charCodeAt(t.position);for(;a!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,ce(t,"tab characters must not be used in indentation")),a===45);){let u=t.input.charCodeAt(t.position+1);if(!jr(u))break;if(s=!0,t.position++,Nt(t,!0,-1)&&t.lineIndent<=e){i.push(null),a=t.input.charCodeAt(t.position);continue}let f=t.line;if(Tu(t,e,mk,!1,!0),i.push(t.result),Nt(t,!0,-1),a=t.input.charCodeAt(t.position),(t.line===f||t.lineIndent>e)&&a!==0)ce(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return s?(t.tag=r,t.anchor=n,t.kind="sequence",t.result=i,!0):!1}function Ek(t,e,r){let n,i,s,a,u=t.tag,f=t.anchor,h={},g=Object.create(null),m=null,S=null,E=null,x=!1,C=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&ba(t,t.anchor,h);let A=t.input.charCodeAt(t.position);for(;A!==0;){!x&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,ce(t,"tab characters must not be used in indentation"));let T=t.input.charCodeAt(t.position+1),B=t.line;if((A===63||A===58)&&jr(T))A===63?(x&&(Au(t,h,g,m,S,null,i,s,a),m=S=E=null),C=!0,x=!0,n=!0):x?(x=!1,n=!0):ce(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,A=T;else{if(i=t.line,s=t.lineStart,a=t.position,!Tu(t,r,pk,!1,!0))break;if(t.line===B){for(A=t.input.charCodeAt(t.position);ts(A);)A=t.input.charCodeAt(++t.position);if(A===58)A=t.input.charCodeAt(++t.position),jr(A)||ce(t,"a whitespace character is expected after the key-value separator within a block mapping"),x&&(Au(t,h,g,m,S,null,i,s,a),m=S=E=null),C=!0,x=!1,n=!1,m=t.tag,S=t.result;else if(C)ce(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=u,t.anchor=f,!0}else if(C)ce(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=u,t.anchor=f,!0}if((t.line===B||t.lineIndent>e)&&(x&&(i=t.line,s=t.lineStart,a=t.position),Tu(t,e,Vm,!0,n)&&(x?S=t.result:E=t.result),x||(Au(t,h,g,m,S,E,i,s,a),m=S=E=null),Nt(t,!0,-1),A=t.input.charCodeAt(t.position)),(t.line===B||t.lineIndent>e)&&A!==0)ce(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return x&&Au(t,h,g,m,S,null,i,s,a),C&&(t.tag=u,t.anchor=f,t.kind="mapping",t.result=h),C}function oG(t){let e=!1,r=!1,n,i,s=t.input.charCodeAt(t.position);if(s!==33)return!1;t.tag!==null&&ce(t,"duplication of a tag property"),s=t.input.charCodeAt(++t.position),s===60?(e=!0,s=t.input.charCodeAt(++t.position)):s===33?(r=!0,n="!!",s=t.input.charCodeAt(++t.position)):n="!";let a=t.position;if(e){do s=t.input.charCodeAt(++t.position);while(s!==0&&s!==62);t.position<t.length?(i=t.input.slice(a,t.position),s=t.input.charCodeAt(++t.position)):ce(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!jr(s);)s===33&&(r?ce(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(a-1,t.position+1),gk.test(n)||ce(t,"named tag handle cannot contain such characters"),r=!0,a=t.position+1)),s=t.input.charCodeAt(++t.position);i=t.input.slice(a,t.position),YK.test(i)&&ce(t,"tag suffix cannot contain flow indicator characters")}i&&!yk.test(i)&&ce(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{ce(t,"tag name is malformed: "+i)}return e?t.tag=i:Qn.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:n==="!"?t.tag="!"+i:n==="!!"?t.tag="tag:yaml.org,2002:"+i:ce(t,'undeclared tag handle "'+n+'"'),!0}function aG(t){let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&ce(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!jr(e)&&!ku(e);)e=t.input.charCodeAt(++t.position);return t.position===r&&ce(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(r,t.position),!0}function lG(t){let e=t.input.charCodeAt(t.position);if(e!==42)return!1;e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!jr(e)&&!ku(e);)e=t.input.charCodeAt(++t.position);t.position===r&&ce(t,"name of an alias node must contain at least one character");let n=t.input.slice(r,t.position);return Qn.call(t.anchorMap,n)||ce(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Nt(t,!0,-1),!0}function uG(t,e,r,n){let i=wk(t);return ZK(t),uk(t,e),t.tag=null,t.anchor=null,t.kind=null,t.result=null,Ek(t,r,n)&&t.kind==="mapping"?(XK(t),!0):(eG(t),uk(t,i),!1)}function Tu(t,e,r,n,i){let s,a,u=1,f=!1,h=!1,g=null,m,S,E;t.depth>=t.maxDepth&&ce(t,"nesting exceeded maxDepth ("+t.maxDepth+")"),t.depth+=1,t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null;let x=s=a=Vm===r||mk===r;if(n&&Nt(t,!0,-1)&&(f=!0,t.lineIndent>e?u=1:t.lineIndent===e?u=0:t.lineIndent<e&&(u=-1)),u===1)for(;;){let C=t.input.charCodeAt(t.position),A=wk(t);if(f&&(C===33&&t.tag!==null||C===38&&t.anchor!==null)||!oG(t)&&!aG(t))break;g===null&&(g=A),Nt(t,!0,-1)?(f=!0,a=x,t.lineIndent>e?u=1:t.lineIndent===e?u=0:t.lineIndent<e&&(u=-1)):a=!1}if(a&&(a=f||i),u===1||Vm===r)if(Hm===r||pk===r?S=e:S=e+1,E=t.position-t.lineStart,u===1)if(a&&(dk(t,E)||Ek(t,E,S))||iG(t,S))h=!0;else{let C=t.input.charCodeAt(t.position);g!==null&&x&&!a&&C!==124&&C!==62&&uG(t,g,g.position-g.lineStart,S)||s&&sG(t,S)||rG(t,S)||nG(t,S)?h=!0:lG(t)?(h=!0,(t.tag!==null||t.anchor!==null)&&ce(t,"alias node should not have any properties")):tG(t,S,Hm===r)&&(h=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&ba(t,t.anchor,t.result)}else u===0&&(h=a&&dk(t,E));if(t.tag===null)t.anchor!==null&&ba(t,t.anchor,t.result);else if(t.tag==="?"){t.result!==null&&t.kind!=="scalar"&&ce(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"');for(let C=0,A=t.implicitTypes.length;C<A;C+=1)if(m=t.implicitTypes[C],m.resolve(t.result)){t.result=m.construct(t.result),t.tag=m.tag,t.anchor!==null&&ba(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(Qn.call(t.typeMap[t.kind||"fallback"],t.tag))m=t.typeMap[t.kind||"fallback"][t.tag];else{m=null;let C=t.typeMap.multi[t.kind||"fallback"];for(let A=0,T=C.length;A<T;A+=1)if(t.tag.slice(0,C[A].tag.length)===C[A].tag){m=C[A];break}}m||ce(t,"unknown tag !<"+t.tag+">"),t.result!==null&&m.kind!==t.kind&&ce(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+m.kind+'", not "'+t.kind+'"'),m.resolve(t.result,t.tag)?(t.result=m.construct(t.result,t.tag),t.anchor!==null&&ba(t,t.anchor,t.result)):ce(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.depth-=1,t.tag!==null||t.anchor!==null||h}function cG(t){let e=t.position,r=!1,n;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(n=t.input.charCodeAt(t.position))!==0&&(Nt(t,!0,-1),n=t.input.charCodeAt(t.position),!(t.lineIndent>0||n!==37));){r=!0,n=t.input.charCodeAt(++t.position);let i=t.position;for(;n!==0&&!jr(n);)n=t.input.charCodeAt(++t.position);let s=t.input.slice(i,t.position),a=[];for(s.length<1&&ce(t,"directive name must not be less than one character in length");n!==0;){for(;ts(n);)n=t.input.charCodeAt(++t.position);if(n===35){do n=t.input.charCodeAt(++t.position);while(n!==0&&!Ii(n));break}if(Ii(n))break;for(i=t.position;n!==0&&!jr(n);)n=t.input.charCodeAt(++t.position);a.push(t.input.slice(i,t.position))}n!==0&&iw(t),Qn.call(ck,s)?ck[s](t,s,a):Wm(t,'unknown document directive "'+s+'"')}if(Nt(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Nt(t,!0,-1)):r&&ce(t,"directives end mark is expected"),Tu(t,t.lineIndent-1,Vm,!1,!0),Nt(t,!0,-1),t.checkLineBreaks&&WK.test(t.input.slice(e,t.position))&&Wm(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Ym(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Nt(t,!0,-1));return}t.position<t.length-1&&ce(t,"end of the stream or a document separator is expected")}function xk(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
|
|
192
|
+
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new QK(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,ce(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)cG(r);return r.documents}function fG(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);let n=xk(t,r);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function dG(t,e){let r=xk(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new hk("expected a single document in the stream, but found more")}}ow.exports.loadAll=fG;ow.exports.load=dG});var Yk=F((aQ,Wk)=>{"use strict";var Km=Ou(),ed=Pu(),hG=Bm(),$k=Object.prototype.toString,Mk=Object.prototype.hasOwnProperty,fw=65279,pG=9,Qf=10,mG=13,gG=32,yG=33,vG=34,aw=35,SG=37,bG=38,_G=39,wG=42,Nk=44,EG=45,Jm=58,xG=61,CG=62,RG=63,IG=64,Dk=91,Fk=93,OG=96,Lk=123,PG=124,jk=125,fr={};fr[0]="\\0";fr[7]="\\a";fr[8]="\\b";fr[9]="\\t";fr[10]="\\n";fr[11]="\\v";fr[12]="\\f";fr[13]="\\r";fr[27]="\\e";fr[34]='\\"';fr[92]="\\\\";fr[133]="\\N";fr[160]="\\_";fr[8232]="\\L";fr[8233]="\\P";var kG=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],AG=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function TG(t,e){if(e===null)return{};let r={},n=Object.keys(e);for(let i=0,s=n.length;i<s;i+=1){let a=n[i],u=String(e[a]);a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2));let f=t.compiledTypeMap.fallback[a];f&&Mk.call(f.styleAliases,u)&&(u=f.styleAliases[u]),r[a]=u}return r}function qG(t){let e,r,n=t.toString(16).toUpperCase();if(t<=255)e="x",r=2;else if(t<=65535)e="u",r=4;else if(t<=4294967295)e="U",r=8;else throw new ed("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+Km.repeat("0",r-n.length)+n}var $G=1,Zf=2;function MG(t){this.schema=t.schema||hG,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Km.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=TG(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?Zf:$G,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Rk(t,e){let r=Km.repeat(" ",e),n=0,i="",s=t.length;for(;n<s;){let a,u=t.indexOf(`
|
|
193
|
+
`,n);u===-1?(a=t.slice(n),n=s):(a=t.slice(n,u+1),n=u+1),a.length&&a!==`
|
|
194
|
+
`&&(i+=r),i+=a}return i}function lw(t,e){return`
|
|
195
|
+
`+Km.repeat(" ",t.indent*e)}function NG(t,e){for(let r=0,n=t.implicitTypes.length;r<n;r+=1)if(t.implicitTypes[r].resolve(e))return!0;return!1}function zm(t){return t===gG||t===pG}function Xf(t){return t>=32&&t<=126||t>=161&&t<=55295&&t!==8232&&t!==8233||t>=57344&&t<=65533&&t!==fw||t>=65536&&t<=1114111}function Ik(t){return Xf(t)&&t!==fw&&t!==mG&&t!==Qf}function Ok(t,e,r){let n=Ik(t),i=n&&!zm(t);return(r?n:n&&t!==Nk&&t!==Dk&&t!==Fk&&t!==Lk&&t!==jk)&&t!==aw&&!(e===Jm&&!i)||Ik(e)&&!zm(e)&&t===aw||e===Jm&&i}function DG(t){return Xf(t)&&t!==fw&&!zm(t)&&t!==EG&&t!==RG&&t!==Jm&&t!==Nk&&t!==Dk&&t!==Fk&&t!==Lk&&t!==jk&&t!==aw&&t!==bG&&t!==wG&&t!==yG&&t!==PG&&t!==xG&&t!==CG&&t!==_G&&t!==vG&&t!==SG&&t!==IG&&t!==OG}function FG(t){return!zm(t)&&t!==Jm}function Gf(t,e){let r=t.charCodeAt(e),n;return r>=55296&&r<=56319&&e+1<t.length&&(n=t.charCodeAt(e+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function Uk(t){return/^\n* /.test(t)}var Bk=1,uw=2,Hk=3,Vk=4,qu=5;function LG(t,e,r,n,i,s,a,u){let f,h=0,g=null,m=!1,S=!1,E=n!==-1,x=-1,C=DG(Gf(t,0))&&FG(Gf(t,t.length-1));if(e||a)for(f=0;f<t.length;h>=65536?f+=2:f++){if(h=Gf(t,f),!Xf(h))return qu;C=C&&Ok(h,g,u),g=h}else{for(f=0;f<t.length;h>=65536?f+=2:f++){if(h=Gf(t,f),h===Qf)m=!0,E&&(S=S||f-x-1>n&&t[x+1]!==" ",x=f);else if(!Xf(h))return qu;C=C&&Ok(h,g,u),g=h}S=S||E&&f-x-1>n&&t[x+1]!==" "}return!m&&!S?C&&!a&&!i(t)?Bk:s===Zf?qu:uw:r>9&&Uk(t)?qu:a?s===Zf?qu:uw:S?Vk:Hk}function jG(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===Zf?'""':"''";if(!t.noCompatMode&&(kG.indexOf(e)!==-1||AG.test(e)))return t.quotingType===Zf?'"'+e+'"':"'"+e+"'";let s=t.indent*Math.max(1,r),a=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),u=n||t.flowLevel>-1&&r>=t.flowLevel;function f(h){return NG(t,h)}switch(LG(e,u,t.indent,a,f,t.quotingType,t.forceQuotes&&!n,i)){case Bk:return e;case uw:return"'"+e.replace(/'/g,"''")+"'";case Hk:return"|"+Pk(e,t.indent)+kk(Rk(e,s));case Vk:return">"+Pk(e,t.indent)+kk(Rk(UG(e,a),s));case qu:return'"'+BG(e,a)+'"';default:throw new ed("impossible error: invalid scalar style")}})()}function Pk(t,e){let r=Uk(t)?String(e):"",n=t[t.length-1]===`
|
|
196
|
+
`,s=n&&(t[t.length-2]===`
|
|
197
197
|
`||t===`
|
|
198
|
-
`)
|
|
199
|
-
`}function
|
|
200
|
-
`?t.slice(0,-1):t}function
|
|
201
|
-
`);return
|
|
202
|
-
`||t[0]===" ",s,a;a=r.exec(t);){
|
|
203
|
-
`:"")+
|
|
198
|
+
`)?"+":n?"":"-";return r+s+`
|
|
199
|
+
`}function kk(t){return t[t.length-1]===`
|
|
200
|
+
`?t.slice(0,-1):t}function UG(t,e){let r=/(\n+)([^\n]*)/g,n=(function(){let u=t.indexOf(`
|
|
201
|
+
`);return u=u!==-1?u:t.length,r.lastIndex=u,Ak(t.slice(0,u),e)})(),i=t[0]===`
|
|
202
|
+
`||t[0]===" ",s,a;for(;a=r.exec(t);){let u=a[1],f=a[2];s=f[0]===" ",n+=u+(!i&&!s&&f!==""?`
|
|
203
|
+
`:"")+Ak(f,e),i=s}return n}function Ak(t,e){if(t===""||t[0]===" ")return t;let r=/ [^ ]/g,n,i=0,s,a=0,u=0,f="";for(;n=r.exec(t);)u=n.index,u-i>e&&(s=a>i?a:u,f+=`
|
|
204
204
|
`+t.slice(i,s),i=s+1),a=u;return f+=`
|
|
205
205
|
`,t.length-i>e&&a>i?f+=t.slice(i,a)+`
|
|
206
|
-
`+t.slice(a+1):f+=t.slice(i),f.slice(1)}function
|
|
207
|
-
`:""}
|
|
206
|
+
`+t.slice(a+1):f+=t.slice(i),f.slice(1)}function BG(t){let e="",r=0;for(let n=0;n<t.length;r>=65536?n+=2:n++){r=Gf(t,n);let i=fr[r];!i&&Xf(r)?(e+=t[n],r>=65536&&(e+=t[n+1])):e+=i||qG(r)}return e}function HG(t,e,r){let n="",i=t.tag;for(let s=0,a=r.length;s<a;s+=1){let u=r[s];t.replacer&&(u=t.replacer.call(r,String(s),u)),(rs(t,e,u,!1,!1)||typeof u>"u"&&rs(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump)}t.tag=i,t.dump="["+n+"]"}function Tk(t,e,r,n){let i="",s=t.tag;for(let a=0,u=r.length;a<u;a+=1){let f=r[a];t.replacer&&(f=t.replacer.call(r,String(a),f)),(rs(t,e+1,f,!0,!0,!1,!0)||typeof f>"u"&&rs(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=lw(t,e)),t.dump&&Qf===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump)}t.tag=s,t.dump=i||"[]"}function VG(t,e,r){let n="",i=t.tag,s=Object.keys(r);for(let a=0,u=s.length;a<u;a+=1){let f="";n!==""&&(f+=", "),t.condenseFlow&&(f+='"');let h=s[a],g=r[h];t.replacer&&(g=t.replacer.call(r,h,g)),rs(t,e,h,!1,!1)&&(t.dump.length>1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),rs(t,e,g,!1,!1)&&(f+=t.dump,n+=f))}t.tag=i,t.dump="{"+n+"}"}function WG(t,e,r,n){let i="",s=t.tag,a=Object.keys(r);if(t.sortKeys===!0)a.sort();else if(typeof t.sortKeys=="function")a.sort(t.sortKeys);else if(t.sortKeys)throw new ed("sortKeys must be a boolean or a function");for(let u=0,f=a.length;u<f;u+=1){let h="";(!n||i!=="")&&(h+=lw(t,e));let g=a[u],m=r[g];if(t.replacer&&(m=t.replacer.call(r,g,m)),!rs(t,e+1,g,!0,!0,!0))continue;let S=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024;S&&(t.dump&&Qf===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,S&&(h+=lw(t,e)),rs(t,e+1,m,!0,S)&&(t.dump&&Qf===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,i+=h)}t.tag=s,t.dump=i||"{}"}function qk(t,e,r){let n=r?t.explicitTypes:t.implicitTypes;for(let i=0,s=n.length;i<s;i+=1){let a=n[i];if((a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){let u=t.styleMap[a.tag]||a.defaultStyle,f;if($k.call(a.represent)==="[object Function]")f=a.represent(e,u);else if(Mk.call(a.represent,u))f=a.represent[u](e,u);else throw new ed("!<"+a.tag+'> tag resolver accepts not "'+u+'" style');t.dump=f}return!0}}return!1}function rs(t,e,r,n,i,s,a){t.tag=null,t.dump=r,qk(t,r,!1)||qk(t,r,!0);let u=$k.call(t.dump),f=n;n&&(n=t.flowLevel<0||t.flowLevel>e);let h=u==="[object Object]"||u==="[object Array]",g,m;if(h&&(g=t.duplicates.indexOf(r),m=g!==-1),(t.tag!==null&&t.tag!=="?"||m||t.indent!==2&&e>0)&&(i=!1),m&&t.usedDuplicates[g])t.dump="*ref_"+g;else{if(h&&m&&!t.usedDuplicates[g]&&(t.usedDuplicates[g]=!0),u==="[object Object]")n&&Object.keys(t.dump).length!==0?(WG(t,e,t.dump,i),m&&(t.dump="&ref_"+g+t.dump)):(VG(t,e,t.dump),m&&(t.dump="&ref_"+g+" "+t.dump));else if(u==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!a&&e>0?Tk(t,e-1,t.dump,i):Tk(t,e,t.dump,i),m&&(t.dump="&ref_"+g+t.dump)):(HG(t,e,t.dump),m&&(t.dump="&ref_"+g+" "+t.dump));else if(u==="[object String]")t.tag!=="?"&&jG(t,t.dump,e,s,f);else{if(u==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new ed("unacceptable kind of an object to dump "+u)}if(t.tag!==null&&t.tag!=="?"){let S=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21");t.tag[0]==="!"?S="!"+S:S.slice(0,18)==="tag:yaml.org,2002:"?S="!!"+S.slice(18):S="!<"+S+">",t.dump=S+" "+t.dump}}return!0}function YG(t,e){let r=[],n=[];cw(t,r,n);let i=n.length;for(let s=0;s<i;s+=1)e.duplicates.push(r[n[s]]);e.usedDuplicates=new Array(i)}function cw(t,e,r){if(t!==null&&typeof t=="object"){let n=e.indexOf(t);if(n!==-1)r.indexOf(n)===-1&&r.push(n);else if(e.push(t),Array.isArray(t))for(let i=0,s=t.length;i<s;i+=1)cw(t[i],e,r);else{let i=Object.keys(t);for(let s=0,a=i.length;s<a;s+=1)cw(t[i[s]],e,r)}}}function JG(t,e){e=e||{};let r=new MG(e);r.noRefs||YG(t,r);let n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),rs(r,0,n,!0,!0)?r.dump+`
|
|
207
|
+
`:""}Wk.exports.dump=JG});var hw=F((lQ,Er)=>{"use strict";var Jk=Ck(),zG=Yk();function dw(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}Er.exports.Type=cr();Er.exports.Schema=L_();Er.exports.FAILSAFE_SCHEMA=H_();Er.exports.JSON_SCHEMA=z_();Er.exports.CORE_SCHEMA=K_();Er.exports.DEFAULT_SCHEMA=Bm();Er.exports.load=Jk.load;Er.exports.loadAll=Jk.loadAll;Er.exports.dump=zG.dump;Er.exports.YAMLException=Pu();Er.exports.types={binary:X_(),float:J_(),map:B_(),null:V_(),pairs:tw(),set:rw(),timestamp:G_(),bool:W_(),int:Y_(),merge:Q_(),omap:ew(),seq:U_(),str:j_()};Er.exports.safeLoad=dw("safeLoad","load");Er.exports.safeLoadAll=dw("safeLoadAll","loadAll");Er.exports.safeDump=dw("safeDump","dump")});var zk=F(td=>{"use strict";var KG=td&&td.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(td,"__esModule",{value:!0});var GG=En(),QG=KG(hw()),ZG=hw();td.default={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string")try{return QG.default.load(e,{schema:ZG.JSON_SCHEMA})}catch(r){throw new GG.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var Kk=F(pw=>{"use strict";Object.defineProperty(pw,"__esModule",{value:!0});var XG=En(),e4=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;pw.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&e4.test(t.url)},parse(t){if(typeof t.data=="string")return t.data;if(Buffer.isBuffer(t.data))return t.data.toString(this.encoding);throw new XG.ParserError("data is not text",t.url)}}});var Gk=F(mw=>{"use strict";Object.defineProperty(mw,"__esModule",{value:!0});var t4=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;mw.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&t4.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var eA=F(Zn=>{"use strict";var r4=Zn&&Zn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),n4=Zn&&Zn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),i4=Zn&&Zn.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&r4(r,e,n[i]);return n4(r,e),r}})(),s4=Zn&&Zn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zn,"__esModule",{value:!0});var o4=s4(require("fs")),Qk=no(),Zk=i4(wn()),Xk=En();Zn.default={order:100,canRead(t){return Zk.isFileSystemPath(t.url)},async read(t){let e;try{e=Zk.toFileSystemPath(t.url)}catch(r){throw new Xk.ResolverError(Qk.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await o4.default.promises.readFile(e)}catch(r){throw new Xk.ResolverError((0,Qk.ono)(r,`Error opening file "${e}"`),e)}}}});var nA=F(ns=>{"use strict";var a4=ns&&ns.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),l4=ns&&ns.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),u4=ns&&ns.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&a4(r,e,n[i]);return l4(r,e),r}})();Object.defineProperty(ns,"__esModule",{value:!0});var Gm=no(),rd=u4(wn()),tA=En();ns.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return rd.isHttp(t.url)},read(t){let e=rd.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=rd.parse(location.href).protocol),rA(e,this)}};async function rA(t,e,r){t=rd.parse(t);let n=r||[];n.push(t.href);try{let i=await c4(t,e);if(i.status>=400)throw(0,Gm.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new tA.ResolverError((0,Gm.ono)({status:i.status},`Error downloading ${n[0]}.
|
|
208
208
|
Too many redirects:
|
|
209
209
|
${n.join(`
|
|
210
|
-
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,Qm.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Wf.resolve(t.href,i.headers.location);return zk(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new Jk.ResolverError((0,Qm.ono)(i,`Error downloading ${t.href}`),t.href)}}async function DG(t,e){let r,n;e.timeout&&(r=new AbortController,n=setTimeout(()=>r.abort(),e.timeout));let i=await fetch(t,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:r?r.signal:null});return n&&clearTimeout(n),i}});var yw=F(ls=>{"use strict";var Ru=ls&&ls.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ls,"__esModule",{value:!0});ls.getNewOptions=ls.getJsonSchemaRefParserDefaultOptions=void 0;var FG=Ru(x1()),LG=Ru(jk()),jG=Ru(Uk()),UG=Ru(Bk()),BG=Ru(Yk()),HG=Ru(Kk()),VG=()=>({parse:{json:{...FG.default},yaml:{...LG.default},text:{...jG.default},binary:{...UG.default}},resolve:{file:{...BG.default},http:{...HG.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});ls.getJsonSchemaRefParserDefaultOptions=VG;var WG=t=>{let e=(0,ls.getJsonSchemaRefParserDefaultOptions)();return t&&Qk(e,t),e};ls.getNewOptions=WG;function Qk(t,e){if(Gk(e)){let r=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=e[i],a=t[i];Gk(s)?t[i]=Qk(a||{},s):s!==void 0&&(t[i]=s)}}return t}function Gk(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var Xk=F(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.normalizeArgs=Zk;var YG=yw();function Zk(t){let e,r,n,i,s=Array.prototype.slice.call(t);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(r=s[1],n=s[2]):(r=void 0,n=s[1])):(e="",r=s[0],n=s[1]);try{n=(0,YG.getNewOptions)(n)}catch(a){console.error(`JSON Schema Ref Parser: Error normalizing options: ${a}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}Zm.default=Zk});var eA=F(Gn=>{"use strict";var JG=Gn&&Gn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zG=Gn&&Gn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),KG=Gn&&Gn.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&JG(r,e,n[i]);return zG(r,e),r}}(),vw=Gn&&Gn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gn,"__esModule",{value:!0});var GG=vw(vu()),QG=vw(Mf()),ZG=vw($_()),Iu=KG(bn()),XG=_n();function e4(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=Sw(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function Sw(t,e,r,n,i,s){i||(i=new Set);let a=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),GG.default.isExternal$Ref(t)&&a.push(t4(t,e,r,n));let u=Object.keys(t);for(let f of u){let h=QG.default.join(e,f),g=t[f];a=a.concat(Sw(g,h,r,n,i,s))}}return a}async function t4(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Iu.resolve(i?Iu.cwd():e,t.$ref),a=Iu.stripHash(s),u=r._$refs[a];if(u)return Promise.resolve(u.value);try{let f=await(0,ZG.default)(s,r,n),h=Sw(f,a+"#",r,n,new Set,!0);return Promise.all(h)}catch(f){if(!n?.continueOnError||!(0,XG.isHandledError)(f))throw f;return r._$refs[a]&&(f.source=decodeURI(Iu.stripHash(e)),f.path=Iu.safePointerToPath(Iu.getHash(e))),[]}}Gn.default=e4});var nA=F(Qn=>{"use strict";var r4=Qn&&Qn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),n4=Qn&&Qn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i4=Qn&&Qn.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&r4(r,e,n[i]);return n4(r,e),r}}(),rA=Qn&&Qn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qn,"__esModule",{value:!0});var Xm=rA(vu()),Yf=rA(Mf()),bw=i4(bn());function s4(t,e){let r=[];_w(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),o4(r)}function _w(t,e,r,n,i,s,a,u){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(Xm.default.isAllowed$Ref(f))tA(t,e,r,n,i,s,a,u);else{let h=Object.keys(f).sort((g,m)=>g==="definitions"?-1:m==="definitions"?1:g.length-m.length);for(let g of h){let m=Yf.default.join(r,g),S=Yf.default.join(n,g),_=f[g];Xm.default.isAllowed$Ref(_)?tA(f,g,r,S,i,s,a,u):_w(f,g,m,S,i,s,a,u)}}}function tA(t,e,r,n,i,s,a,u){let f=e===null?t:t[e],h=bw.resolve(r,f.$ref),g=a._resolve(h,n,u);if(g===null)return;let S=Yf.default.parse(n).length,_=bw.stripHash(g.path),C=bw.getHash(g.path),x=_!==a._root$Ref.path,A=Xm.default.isExtended$Ref(f);i+=g.indirections;let T=a4(s,t,e);if(T)if(S<T.depth||i<T.indirections)l4(s,T);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:S,file:_,hash:C,value:g.value,circular:g.circular,extended:A,external:x,indirections:i}),(!T||x)&&_w(g.value,null,g.path,n,i+1,s,a,u)}function o4(t){t.sort((i,s)=>{if(i.file!==s.file)return i.file<s.file?-1:1;if(i.hash!==s.hash)return i.hash<s.hash?-1:1;if(i.circular!==s.circular)return i.circular?-1:1;if(i.extended!==s.extended)return i.extended?1:-1;if(i.indirections!==s.indirections)return i.indirections-s.indirections;if(i.depth!==s.depth)return i.depth-s.depth;{let a=i.pathFromRoot.lastIndexOf("/definitions"),u=s.pathFromRoot.lastIndexOf("/definitions");return a!==u?u-a:i.pathFromRoot.length-s.pathFromRoot.length}});let e,r,n;for(let i of t)i.external?i.file===e&&i.hash===r?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(r+"/")===0?i.$ref.$ref=Yf.default.join(n,Yf.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=Xm.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function a4(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function l4(t,e){let r=t.indexOf(e);t.splice(r,1)}Qn.default=s4});var uA=F(Zn=>{"use strict";var u4=Zn&&Zn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),c4=Zn&&Zn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),f4=Zn&&Zn.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&u4(r,e,n[i]);return c4(r,e),r}}(),aA=Zn&&Zn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zn,"__esModule",{value:!0});var eg=aA(vu()),iA=aA(Mf()),d4=ho(),sA=f4(bn()),h4=_n();Zn.default=p4;function p4(t,e){let r=Date.now(),n=ww(t.schema,t.$refs._root$Ref.path,"#",new Set,new Set,new Map,t.$refs,e,r);t.$refs.circular=n.circular,t.schema=n.value}function ww(t,e,r,n,i,s,a,u,f){let h,g={value:t,circular:!1};if(u&&u.timeoutMs&&Date.now()-f>u.timeoutMs)throw new h4.TimeoutError(u.timeoutMs);let m=u.dereference||{},S=m.excludedPathMatcher||(()=>!1);if((m?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!S(r)){if(n.add(t),i.add(t),eg.default.isAllowed$Ref(t,u))h=oA(t,e,r,n,i,s,a,u,f),g.circular=h.circular,g.value=h.value;else for(let _ of Object.keys(t)){let C=iA.default.join(e,_),x=iA.default.join(r,_);if(S(x))continue;let A=t[_],T=!1;if(eg.default.isAllowed$Ref(A,u)){if(h=oA(A,C,x,n,i,s,a,u,f),T=h.circular,t[_]!==h.value){let j=new Map;m?.preservedProperties&&typeof t[_]=="object"&&!Array.isArray(t[_])&&m?.preservedProperties.forEach(Y=>{Y in t[_]&&j.set(Y,t[_][Y])}),t[_]=h.value,m?.preservedProperties&&j.size&&typeof t[_]=="object"&&!Array.isArray(t[_])&&j.forEach((Y,V)=>{t[_][V]=Y}),m?.onDereference?.(A.$ref,t[_],t,_)}}else n.has(A)?T=lA(C,a,u):(h=ww(A,C,x,n,i,s,a,u,f),T=h.circular,t[_]!==h.value&&(t[_]=h.value));g.circular=g.circular||T}n.delete(t)}return g}function oA(t,e,r,n,i,s,a,u,f){let g=eg.default.isExternal$Ref(t)&&u?.dereference?.externalReferenceResolution==="root",m=sA.resolve(g?sA.cwd():e,t.$ref),S=s.get(m);if(S&&!S.circular){let j=Object.keys(t);if(j.length>1){let Y={};for(let V of j)V!=="$ref"&&!(V in S.value)&&(Y[V]=t[V]);return{circular:S.circular,value:Object.assign({},S.value,Y)}}return S}let _=a._resolve(m,e,u);if(_===null)return{circular:!1,value:null};let C=_.circular,x=C||n.has(_.value);x&&lA(e,a,u);let A=eg.default.dereference(t,_.value);if(!x){let j=ww(A,_.path,r,n,i,s,a,u,f);x=j.circular,A=j.value}x&&!C&&u.dereference?.circular==="ignore"&&(A=t),C&&(A.$ref=r);let T={circular:x,value:A};return Object.keys(t).length===1&&s.set(m,T),T}function lA(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw d4.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var cA=F(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0});function m4(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}Ew.default=m4()});var dA=F(Jf=>{"use strict";var g4=Jf&&Jf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jf,"__esModule",{value:!0});Jf.default=y4;var fA=g4(cA());function y4(t,e){if(t){e.then(function(r){(0,fA.default)(function(){t(null,r)})},function(r){(0,fA.default)(function(){t(r)})});return}else return e}});var gA=F(we=>{"use strict";var v4=we&&we.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),S4=we&&we.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),b4=we&&we.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&v4(r,e,n[i]);return S4(r,e),r}}(),wa=we&&we.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(we,"__esModule",{value:!0});we.getJsonSchemaRefParserDefaultOptions=we.jsonSchemaParserNormalizeArgs=we.dereferenceInternal=we.JSONParserErrorGroup=we.isHandledError=we.UnmatchedParserError=we.ParserError=we.ResolverError=we.MissingPointerError=we.InvalidPointerError=we.JSONParserError=we.UnmatchedResolverError=we.dereference=we.bundle=we.resolve=we.parse=we.$RefParser=void 0;var hA=wa(b1()),_4=wa($_()),zf=wa(Xk());we.jsonSchemaParserNormalizeArgs=zf.default;var w4=wa(eA()),E4=wa(nA()),mA=wa(uA());we.dereferenceInternal=mA.default;var _a=b4(bn()),wn=_n();Object.defineProperty(we,"JSONParserError",{enumerable:!0,get:function(){return wn.JSONParserError}});Object.defineProperty(we,"InvalidPointerError",{enumerable:!0,get:function(){return wn.InvalidPointerError}});Object.defineProperty(we,"MissingPointerError",{enumerable:!0,get:function(){return wn.MissingPointerError}});Object.defineProperty(we,"ResolverError",{enumerable:!0,get:function(){return wn.ResolverError}});Object.defineProperty(we,"ParserError",{enumerable:!0,get:function(){return wn.ParserError}});Object.defineProperty(we,"UnmatchedParserError",{enumerable:!0,get:function(){return wn.UnmatchedParserError}});Object.defineProperty(we,"UnmatchedResolverError",{enumerable:!0,get:function(){return wn.UnmatchedResolverError}});Object.defineProperty(we,"isHandledError",{enumerable:!0,get:function(){return wn.isHandledError}});Object.defineProperty(we,"JSONParserErrorGroup",{enumerable:!0,get:function(){return wn.JSONParserErrorGroup}});var pA=ho(),Xn=wa(dA()),C4=yw();Object.defineProperty(we,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return C4.getJsonSchemaRefParserDefaultOptions}});var vo=class t{constructor(){this.schema=null,this.$refs=new hA.default}async parse(){let e=(0,zf.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,pA.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,Xn.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new hA.default;let n="http";if(_a.isFileSystemPath(e.path))e.path=_a.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=_a.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=_a.resolve(_a.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,r=Promise.resolve(e.schema)}else r=(0,_4.default)(e.path,this.$refs,e.options);try{let i=await r;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,Xn.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,Xn.default)(e.callback,Promise.resolve(this.schema));throw pA.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,wn.isHandledError)(i)?(0,Xn.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[_a.stripHash(e.path)]&&this.$refs._$refs[_a.stripHash(e.path)].addError(i),(0,Xn.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,zf.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,w4.default)(this,e.options),Cw(this),(0,Xn.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,Xn.default)(e.callback,Promise.reject(r))}}static resolve(){let e=new t;return e.resolve.apply(e,arguments)}static bundle(){let e=new t;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,zf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,E4.default)(this,e.options),Cw(this),(0,Xn.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Xn.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,zf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,mA.default)(this,e.options),Cw(this),(0,Xn.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Xn.default)(e.callback,Promise.reject(r))}}};we.$RefParser=vo;we.default=vo;function Cw(t){if(wn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new wn.JSONParserErrorGroup(t)}we.parse=vo.parse;we.resolve=vo.resolve;we.bundle=vo.bundle;we.dereference=vo.dereference});var D4={};DN(D4,{BODY_FILE_MAP:()=>Rv,CONFIG_FILES:()=>na,CollectionLoader:()=>Uo,CollectionLoaderFactory:()=>Yl,CollectionRequestExecutor:()=>Ql,CollectionService:()=>Jl,ConfigService:()=>ia,CookieJar:()=>ml,CookieService:()=>zl,CookieUtils:()=>ot,DEFAULT_CONFIG:()=>Jt,DEFAULT_REQUEST_SETTINGS:()=>dn,DEFAULT_SUITE_CONFIG:()=>Kf,DYNAMIC_VARIABLES:()=>Dv,DataFileParser:()=>Xs,EnvironmentConfigService:()=>Gl,EnvironmentResolver:()=>yi,ExampleGenerator:()=>pa,FetchHttpClient:()=>jl,FolderCollectionLoader:()=>hl,FolderCollectionStore:()=>zi,ForgeContainer:()=>wp,ForgeEnv:()=>Ki,GraphQLSchemaService:()=>Xl,HTTP_METHOD_MAP:()=>ng,HTTP_METHOD_REVERSE:()=>Pu,HistoryAnalyzer:()=>oa,HtmlReportGenerator:()=>qu,HttpForgeParser:()=>Zs,HttpRequestService:()=>Si,InMemoryCookieJar:()=>rg,InterceptorChain:()=>bi,JsonCollectionLoader:()=>ra,LoggingRequestInterceptor:()=>qh,METADATA_FILES:()=>sr,ModuleLoader:()=>Kc,NodeFileSystem:()=>Ul,NodeHttpClient:()=>Hs,OAuth2TokenManager:()=>Vl,OpenApiExporter:()=>ha,OpenApiImporter:()=>Ca,ParserRegistry:()=>pl,PersistentCookieJar:()=>Kl,ROOT_DIRECTORIES:()=>to,RefResolver:()=>Ea,RequestExecutor:()=>Xo,RequestHistoryService:()=>ru,RequestHistoryStore:()=>Ll,RequestPreparer:()=>Zl,RequestPreprocessor:()=>Qs,RequestScriptSession:()=>Fl,ResultStorageService:()=>sg,RetryErrorInterceptor:()=>Mh,SCHEMA_FILES:()=>dl,SCRIPTS_DIR:()=>zr,SCRIPT_FILES:()=>hc,SchemaInferenceService:()=>xa,SchemaInferrer:()=>ns,ScriptAnalyzer:()=>Ra,ScriptExecutor:()=>Ri,ServiceContainer:()=>Ou,ServiceIdentifiers:()=>ne,StatisticsService:()=>ag,TestSuiteService:()=>lg,TestSuiteStore:()=>ug,TimingResponseInterceptor:()=>$h,UrlBuilder:()=>fn,VariableInterpolator:()=>Bs,VariableResolver:()=>Us,applyExtractionPlan:()=>rI,applyFilterChain:()=>Sl,augmentWithDynamicVars:()=>Fs,buildExtractionPlan:()=>tI,buildResultFileName:()=>Pw,cleanupOldBodyFiles:()=>Pv,concatenateScripts:()=>Qc,createExpectChain:()=>Nl,createLodashShim:()=>Cb,createModuleLoader:()=>vp,createMomentShim:()=>Gc,createResponseObject:()=>Sp,createScriptConsole:()=>HR,createTestFunction:()=>bp,createVariableResolver:()=>cC,deepClone:()=>QE,deleteItemFromTree:()=>Ch,detectSensitiveData:()=>eI,evaluateExpression:()=>js,expandSummary:()=>AA,exportCollectionToRestClient:()=>KR,findItemById:()=>Eh,formatBytes:()=>eC,formatConsoleOutput:()=>Zc,formatDuration:()=>tC,generateId:()=>rt,generateSlug:()=>gi,generateUUID:()=>wh,getCompletions:()=>PA,getRestClientExportFolder:()=>zR,getServiceContainer:()=>Rw,hasChanged:()=>Dl,isExpression:()=>Ls,isPlainObject:()=>ZE,isSystemEnvironmentFile:()=>gc,loadEnvironmentsFromFolder:()=>gl,mergeHeadersCaseInsensitive:()=>fl,mergeRequestSettings:()=>Th,normalizeHeaders:()=>_p,parseFilterChain:()=>vl,parsePostmanEnvironment:()=>ef,parsePostmanEnvironmentFile:()=>ZR,parseQueryContext:()=>OA,prepareBodyForSave:()=>Ov,readBodyFromDir:()=>Iv,readSchemaFile:()=>kv,readScriptsFromDir:()=>pc,redactBody:()=>Ip,redactFullResponse:()=>Pp,redactFullResultDetails:()=>kp,redactHeaders:()=>tu,redactHistoryEntry:()=>Op,redactUrl:()=>Rp,registerCoreServices:()=>xw,resolveDynamicVariable:()=>vi,resolveDynamicVariablesInString:()=>lC,safeJsonParse:()=>XE,sanitizeName:()=>_t,searchForItemPath:()=>xh,sortItemsByOrder:()=>Tv,writeEnvFile:()=>ta,writeFolderItems:()=>Xc,writeSchemaFiles:()=>Av,writeScriptFile:()=>Wl,writeScriptsToDir:()=>mc});module.exports=FN(D4);var Uo=class{constructor(e,r){this.fileSystem=e;this.parserRegistry=r}directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,r={}){let n=await this.fileSystem.readFile(e);if(r.format){let s=this.parserRegistry.get(r.format);if(!s)throw new Error(`No parser registered for format: ${r.format}`);return s.parse(n,e)}let i=this.parserRegistry.detect(n);if(!i)throw new Error(`Could not detect collection format for: ${e}. Supported formats: ${this.parserRegistry.getFormats().join(", ")}`);return i.parser.parse(n,e)}async loadDirectory(e,r=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(r,e);for(let s of i)try{let a=await this.load(s);n.push(a)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let r=await this.fileSystem.readFile(e);return this.parserRegistry.detect(r)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};var be=ve(require("fs")),Re=ve(require("path"));function _t(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function rt(t){let e=Date.now().toString(36)+Math.random().toString(36).substr(2,9);return t?`${_t(t)}_${e}`:e}function wh(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function fl(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let a=i.toLowerCase();n[a]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let a=i.toLowerCase(),u=n[a];u&&delete r[u],n[a]=i,r[i]=s}return r}function QE(t){return JSON.parse(JSON.stringify(t))}function ZE(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function XE(t,e){try{return JSON.parse(t)}catch{return e}}function eC(t){if(t===0)return"0 B";let e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(1))} ${r[n]}`}function tC(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var nt=ve(require("fs")),Fn=ve(require("path")),hc={preRequest:"pre-request.js",postResponse:"post-response.js"},sr={collection:"collection.json",folder:"folder.json",request:"request.json"},Rv={"body.json":{type:"raw",format:"json"},"body.xml":{type:"raw",format:"xml"},"body.txt":{type:"raw",format:"text"},"body.html":{type:"raw",format:"html"},"body.js":{type:"raw",format:"javascript"},"body.graphql":{type:"graphql"}},dl={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},zr="scripts";function pc(t){if(!nt.existsSync(t))return;let e={},r=Fn.join(t,hc.preRequest);nt.existsSync(r)&&(e.preRequest=nt.readFileSync(r,"utf-8"));let n=Fn.join(t,hc.postResponse);return nt.existsSync(n)&&(e.postResponse=nt.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function mc(t,e){await nt.promises.mkdir(t,{recursive:!0});let r=Fn.join(t,hc.preRequest);e.preRequest?await nt.promises.writeFile(r,e.preRequest,"utf-8"):nt.existsSync(r)&&await nt.promises.unlink(r);let n=Fn.join(t,hc.postResponse);e.postResponse?await nt.promises.writeFile(n,e.postResponse,"utf-8"):nt.existsSync(n)&&await nt.promises.unlink(n)}function Iv(t){for(let[e,r]of Object.entries(Rv)){let n=Fn.join(t,e);if(nt.existsSync(n))try{let i=nt.readFileSync(n,"utf-8"),s;if(r.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:r.type,format:r.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function Ov(t){if(!t||t.type==="none")return{bodyForMetadata:t};if(t.type==="raw"){let e=t.format||"json",n={json:"body.json",xml:"body.xml",text:"body.txt",html:"body.html",javascript:"body.js"}[e];if(n){let i=e==="json"?typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2):String(t.content||"");return{bodyForMetadata:{type:t.type,format:t.format},externalBodyFile:{filename:n,content:i}}}}if(t.type==="graphql"){let e=typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2);return{bodyForMetadata:{type:t.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:t}}async function Pv(t,e){for(let r of Object.keys(Rv))if(r!==e){let n=Fn.join(t,r);if(nt.existsSync(n))try{await nt.promises.unlink(n)}catch{}}}function kv(t){if(nt.existsSync(t))try{let e=nt.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function Av(t,e,r){let n=Fn.join(t,dl.responseSchema),i=Fn.join(t,dl.bodySchema);e?await nt.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):nt.existsSync(n)&&await nt.promises.unlink(n),r?await nt.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):nt.existsSync(i)&&await nt.promises.unlink(i)}function Eh(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=Eh(r.items,e);if(n)return n}}}function Ch(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(n.id===e)return t.splice(r,1),!0;if(n.type==="folder"&&n.items&&Ch(n.items,e))return!0}return!1}function Tv(t,e){let r=new Map(t.map(i=>[i.id,i])),n=[];for(let i of e){let s=r.get(i);s&&(n.push(s),r.delete(i))}for(let i of r.values())n.push(i);return n}function xh(t,e){let r;try{r=nt.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===zr)continue;if(n.name===e)return Fn.join(t,n.name);let i=xh(Fn.join(t,n.name),e);if(i)return i}}function gi(t,e=[]){let r=t.toLowerCase().trim(),n=r.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=r.match(/t(\d+)/gi)||[],a=0;for(let S of s){let _=parseInt(S.substring(1));_>a&&(a=_)}let u="";if(a>0)u=`t${a}`;else{let S=r.match(/[_\s-](\d+\.\d+)[_\s-]/);S&&(u=`v${S[1].replace(".","_")}`)}let f=r;n&&(f=f.substring(n[0].length)),f=f.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),f=f.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),f=f.replace(/\([^)]+\)/g,""),f=f.replace(/:[a-z_][a-z0-9_]*/gi,""),f=f.replace(/\{[^}]+\}/g,""),f=f.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let h=f.split("-").filter(S=>S.length>0),g=[];i&&g.push(i),g.push(...h),u&&g.push(u);let m=g.join("-");if(m||(m="item"),e.includes(m)){let S=2;for(;e.includes(`${m}-${S}`);)S++;m=`${m}-${S}`}return m}var zi=class{collectionsDir;cache=new Map;slugToIdMap=new Map;idToSlugMap=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}getSlugById(e){return this.idToSlugMap.get(e)}getIdBySlug(e){return this.slugToIdMap.get(e)}ensureDirectory(){be.existsSync(this.collectionsDir)||be.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!be.existsSync(this.collectionsDir))return[];let e=be.readdirSync(this.collectionsDir,{withFileTypes:!0}),r=[];for(let n of e)if(n.isDirectory())try{let i=this.loadCollectionFromFolder(n.name);i&&(this.cache.set(i.id,i),this.slugToIdMap.set(n.name,i.id),this.idToSlugMap.set(i.id,n.name),r.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return r}loadCollectionFromFolder(e){let r=Re.join(this.collectionsDir,e),n=Re.join(r,sr.collection);if(be.existsSync(n))try{let i=be.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Re.join(r,zr)),u=this.loadItemsFromDir(r,s.id,s.order);return{id:s.id,name:s.name,description:s.description,version:s.version,variables:s.variables,auth:s.auth,scripts:a,items:u}}catch(i){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,i);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,a=be.readdirSync(e,{withFileTypes:!0});for(let u of a){if(!u.isDirectory()||u.name===zr)continue;let f=Re.join(e,u.name);if(be.existsSync(Re.join(f,sr.folder))){let h=this.loadFolderFromDir(f,u.name);h&&s.set(u.name,h)}else if(be.existsSync(Re.join(f,sr.request))){let h=this.loadRequestFromDir(f,u.name);h&&s.set(u.name,h)}}if(n&&n.length>0){for(let u of n){let f=s.get(u);f&&(i.push(f),s.delete(u))}for(let u of s.values())i.push(u)}else for(let u of s.values())i.push(u);return i}loadFolderFromDir(e,r){let n=Re.join(e,sr.folder);try{let i=be.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Re.join(e,zr)),u=this.loadItemsFromDir(e,s.id,s.order);return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"folder",name:s.name,description:s.description,auth:s.auth,scripts:a,items:u}}catch(i){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,i);return}}loadRequestFromDir(e,r){let n=Re.join(e,sr.request);try{let i=be.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Re.join(e,zr)),u=s.body,f=this.loadBodyFromDir(e);f&&(u=f);let h=this.loadSchemaFile(Re.join(e,dl.responseSchema)),g=this.loadSchemaFile(Re.join(e,dl.bodySchema)),m=Re.join(e,"doc.md"),S=be.existsSync(m)?be.readFileSync(m,"utf-8"):void 0;return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"request",name:s.name,description:s.description,method:s.method,url:s.url,params:s.params,query:s.query,headers:s.headers,body:u,auth:s.auth,settings:s.settings,scripts:a,deprecated:s.deprecated,...S&&{doc:S},...h&&{responseSchema:h},...g&&{bodySchema:g}}}catch(i){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,i);return}}loadScriptsFromDir(e){return pc(e)}loadBodyFromDir(e){return Iv(e)}loadSchemaFile(e){return kv(e)}async saveSchemaFiles(e,r){return Av(e,r.responseSchema,r.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.idToSlugMap.get(e);if(r){let n=this.loadCollectionFromFolder(r);return n&&this.cache.set(e,n),n}return this.loadAll(),this.cache.get(e)}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=rt(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let a=be.readdirSync(this.collectionsDir);r=gi(e.name,a),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Re.join(this.collectionsDir,r);await be.promises.mkdir(n,{recursive:!0});let i={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth};await be.promises.writeFile(Re.join(n,sr.collection),JSON.stringify(i,null,2),"utf-8"),e.scripts&&await this.saveScriptsToDir(Re.join(n,zr),e.scripts);let s=await this.saveItemsToDir(n,e.items);s.length>0&&(i.order=s,await be.promises.writeFile(Re.join(n,sr.collection),JSON.stringify(i,null,2),"utf-8")),this.cache.set(e.id,e)}async saveItemsToDir(e,r){let n=[];for(let i of r){let s=this.idToSlugMap.get(i.id);s||(s=gi(i.name,n),this.idToSlugMap.set(i.id,s),this.slugToIdMap.set(s,i.id)),n.push(s);let a=Re.join(e,s);await be.promises.mkdir(a,{recursive:!0}),i.type==="folder"?await this.saveFolderToDir(a,i):await this.saveRequestToDir(a,i)}return n}async saveFolderToDir(e,r){let n={id:r.id,name:r.name,description:r.description,auth:r.auth};if(await be.promises.writeFile(Re.join(e,sr.folder),JSON.stringify(n,null,2),"utf-8"),r.scripts&&await this.saveScriptsToDir(Re.join(e,zr),r.scripts),r.items){let i=await this.saveItemsToDir(e,r.items);i.length>0&&(n.order=i,await be.promises.writeFile(Re.join(e,sr.folder),JSON.stringify(n,null,2),"utf-8"))}}async saveRequestToDir(e,r){let{bodyForMetadata:n,externalBodyFile:i}=this.prepareBodyForSave(r.body),s={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:n,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated}};await be.promises.writeFile(Re.join(e,sr.request),JSON.stringify(s,null,2),"utf-8"),i&&await be.promises.writeFile(Re.join(e,i.filename),i.content,"utf-8"),await this.cleanupOldBodyFiles(e,i?.filename),await this.saveSchemaFiles(e,r),r.doc&&await be.promises.writeFile(Re.join(e,"doc.md"),r.doc,"utf-8"),r.scripts&&await this.saveScriptsToDir(Re.join(e,zr),r.scripts)}prepareBodyForSave(e){return Ov(e)}async cleanupOldBodyFiles(e,r){return Pv(e,r)}async saveScriptsToDir(e,r){return mc(e,r)}async delete(e){let r=this.idToSlugMap.get(e);if(!r&&(this.loadAll(),r=this.idToSlugMap.get(e),!r))return!1;let n=Re.join(this.collectionsDir,r);if(!be.existsSync(n))return!1;try{return await be.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(r),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let r=this.idToSlugMap.get(e);return r?be.existsSync(Re.join(this.collectionsDir,r,sr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Re.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||rt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,r);if(!s)throw new Error(`Item ${r} not found in collection ${e}`);await this.saveScriptsToDir(Re.join(s,zr),n);let a=this.findItemById(i.items,r);a&&(a.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(Re.join(n,zr))}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);let i=this.idToSlugMap.get(e);if(!i)throw new Error(`Collection slug not found for ${e}`);let s=Re.join(this.collectionsDir,i),a=Re.join(s,sr.collection),u=be.readFileSync(a,"utf-8"),h={...JSON.parse(u),...r,id:e};await be.promises.writeFile(a,JSON.stringify(h,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let a;if(n){let g=this.findItemPath(e,n);if(!g)throw new Error(`Parent folder ${n} not found`);a=g}else a=Re.join(this.collectionsDir,s);let u=this.idToSlugMap.get(r.id);if(!u){let g=be.readdirSync(a).filter(m=>be.statSync(Re.join(a,m)).isDirectory()&&m!==zr);u=gi(r.name,g),this.idToSlugMap.set(r.id,u),this.slugToIdMap.set(u,r.id)}let f=Re.join(a,u);await be.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let h=this.findItemById(i.items,r.id);if(h)Object.assign(h,r);else if(n){let g=this.findItemById(i.items,n);g&&g.type==="folder"&&(g.items=g.items||[],g.items.push(r))}else i.items.push(r)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,r);if(!i||!be.existsSync(i))return!1;try{await be.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,r);let s=this.idToSlugMap.get(r);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(r)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${r}:`,s),!1}}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,r);if(!s)return!1;let a=this.findItemById(i.items,r);if(!a)return!1;let{id:u,type:f,items:h,...g}=n;return Object.assign(a,g),a.type==="folder"?await this.saveFolderToDir(s,a):await this.saveRequestToDir(s,a),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=this.findItemPath(e,r);if(!a||!be.existsSync(a))return!1;let u;if(n){let g=this.findItemPath(e,n);if(!g)return!1;u=g}else u=Re.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let h=Re.join(u,f);if(be.existsSync(h))return!1;try{await be.promises.rename(a,h);let g=this.findItemById(i.items,r);if(g){let m=g.type==="folder"?{...g,items:g.items?[...g.items]:[]}:{...g};if(this.deleteItemFromTree(i.items,r),n){let S=this.findItemById(i.items,n);S&&S.type==="folder"&&(S.items=S.items||[],S.items.push(m))}else i.items.push(m)}return!0}catch(g){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,g),!1}}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=[];for(let u of n){let f=this.idToSlugMap.get(u);f&&a.push(f)}try{if(r){let u=this.findItemPath(e,r);if(!u)return!1;let f=Re.join(u,sr.folder),h=be.readFileSync(f,"utf-8"),g=JSON.parse(h);g.order=a,await be.promises.writeFile(f,JSON.stringify(g,null,2),"utf-8");let m=this.findItemById(i.items,r);m&&m.type==="folder"&&m.items&&(m.items=this.sortItemsByOrder(m.items,n))}else{let u=Re.join(this.collectionsDir,s,sr.collection),f=be.readFileSync(u,"utf-8"),h=JSON.parse(f);h.order=a,await be.promises.writeFile(u,JSON.stringify(h,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(u){return console.error("[FolderCollectionStore] Failed to reorder items:",u),!1}}sortItemsByOrder(e,r){return Tv(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=this.idToSlugMap.get(r);if(i)return xh(Re.join(this.collectionsDir,n),i)}findItemById(e,r){return Eh(e,r)}deleteItemFromTree(e,r){return Ch(e,r)}};function qv(t,e){return{id:t.id,name:t.name,description:t.description,variables:t.variables||{},auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(rC),source:{format:"folder",filePath:e,version:t.version}}}function rC(t){if(t.type==="folder")return{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(rC)};let e=t;return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:e.headers||[],query:e.query||[],params:e.params,body:e.body??void 0,auth:e.auth,settings:e.settings,scripts:e.scripts,...e.deprecated&&{deprecated:e.deprecated},...e.doc&&{doc:e.doc},...e.responseSchema&&{responseSchema:e.responseSchema},...e.bodySchema&&{bodySchema:e.bodySchema}}}function LN(t){return{id:t.id,name:t.name,description:t.description,version:t.source?.version,variables:t.variables,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map($v)}}function $v(t){return t.type==="folder"?{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map($v)}:{type:"request",id:t.id,name:t.name,description:t.description,method:t.method,url:t.url,headers:t.headers,query:t.query,params:t.params,body:t.body,auth:t.auth,settings:t.settings,scripts:t.scripts,...t.deprecated&&{deprecated:t.deprecated},...t.doc&&{doc:t.doc}}}var hl=class{store;constructor(e){this.store=new zi(e)}loadAll(){return this.store.loadAll().map(r=>qv(r,this.store.getCollectionPath(r.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let r=this.store.load(e);if(r)return qv(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return qv(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(LN(e))}async delete(e){return this.store.delete(e)}exists(e){return this.store.exists(e)}getCollectionPath(e){return this.store.getCollectionPath(e)}async updateCollectionMetadata(e,r){return this.store.updateCollectionMetadata(e,r)}async saveItem(e,r,n){return this.store.saveItem(e,$v(r),n)}async updateItem(e,r,n){let i={...n};return this.store.updateItem(e,r,i)}async deleteItem(e,r){return this.store.deleteItem(e,r)}async moveItem(e,r,n){return this.store.moveItem(e,r,n)}async reorderItems(e,r,n){return this.store.reorderItems(e,r,n)}async saveScripts(e,r,n){return this.store.saveScripts(e,r,n)}loadScripts(e,r){return this.store.loadScripts(e,r)}};var pl=class{parsers=new Map;register(e,r){this.parsers.set(e.toLowerCase(),r)}get(e){return this.parsers.get(e.toLowerCase())}has(e){return this.parsers.has(e.toLowerCase())}getFormats(){return Array.from(this.parsers.keys())}detect(e){for(let[r,n]of this.parsers)if(n.canParse(e))return{parser:n,format:r};return null}clear(){this.parsers.clear()}};var ot=class{static parseSetCookie(e,r){let n=e.split(";").map(g=>g.trim());if(n.length===0)return null;let[i,...s]=n,a=i.indexOf("=");if(a===-1)return null;let u=i.substring(0,a).trim(),f=i.substring(a+1).trim(),h={name:u,value:f,domain:r};for(let g of s){let m=g.indexOf("="),S=(m===-1?g:g.substring(0,m)).toLowerCase(),_=m===-1?"":g.substring(m+1);switch(S){case"domain":h.domain=_.startsWith(".")?_.substring(1):_;break;case"path":h.path=_;break;case"expires":h.expires=_;break;case"max-age":h.maxAge=parseInt(_,10);break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break;case"samesite":h.sameSite=_;break}}return h}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let a of s){let u=this.parseSetCookie(a,r);u&&n.push(u)}return n}static formatCookieHeader(e){return e.map(r=>`${r.name}=${r.value}`).join("; ")}static isExpired(e){return!!(e.expires&&new Date(e.expires).getTime()<Date.now()||e.maxAge!==void 0&&e.maxAge<=0)}static domainMatches(e,r){if(r==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=r.toLowerCase().split(".").reverse();if(i.length>n.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static extractDomain(e){try{return new URL(e).hostname}catch{return""}}static extractPath(e){try{return new URL(e).pathname}catch{return"/"}}};var ml=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}}has(e,r){return this.get(e,r)!==void 0}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return ot.formatCookieHeader(r)}clear(){this.cookies.clear()}clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n)}parseCookieHeaders(e,r){return ot.parseCookieHeaders(e,r)}isExpired(e){return ot.isExpired(e)}domainMatches(e,r){return ot.domainMatches(e,r)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r)}};var Ds=ve(require("fs")),Bo=ve(require("path"));function gc(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function gl(t){if(!Ds.existsSync(t))return jN();let e=Rh(Bo.join(t,"_global.json"))||{},r=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=Ds.readdirSync(t).filter(h=>h.endsWith(".json")).filter(h=>!h.endsWith(".local.json")).filter(h=>!gc(h)),s={};for(let h of i){let g=Rh(Bo.join(t,h))||{},m=Bo.basename(h,".json");s[m]={description:g.description,requiresConfirmation:g.requiresConfirmation,variables:g.variables||{}}}let u=(Rh(Bo.join(t,"_global.local.json"))||{}).variables||{},f={};for(let h of Object.keys(s)){let g=Bo.join(t,`${h}.local.json`);if(Ds.existsSync(g)){let m=Rh(g)||{};f[h]={variables:m.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:u,localCredentials:f}}function jN(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function Rh(t){try{if(!Ds.existsSync(t))return null;let e=Ds.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${t}:`,e),null}}var yi=class t{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let a=this.getEnvironmentVariables(n.inherits);i={...i,...a}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};var fn=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,a="",u=e.indexOf("?");u!==-1&&(a=e.substring(u),s=e.substring(0,u));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let h=/:(\w+)(?:\([^)]*\))?(\?)?/g,g=s.replace(h,(m,S,_)=>{let C=r[S];return C!==void 0&&C!==""?encodeURIComponent(C):_?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${S}`),m)});return g=g.replace(/([^:])\/+/g,"$1/"),g.length>1&&g.endsWith("/")&&(g=g.slice(0,-1)),`${n}${i}${g}${a}`}extractPathParams(e){let r=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=r.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,r){let n=e,i={};if(e.includes("?")){let[f,h]=e.split("?");n=f,h&&new URLSearchParams(h).forEach((m,S)=>{i[S]=m})}let s={...i,...r},a=new URLSearchParams;for(let[f,h]of Object.entries(s))h!=null&&a.append(f,h);let u=a.toString();return u?`${n}?${u}`:n}};var nC=ve(require("crypto")),Oh=new Uint8Array(256),Ih=Oh.length;function Mv(){return Ih>Oh.length-16&&(nC.default.randomFillSync(Oh),Ih=0),Oh.slice(Ih,Ih+=16)}var Qt=[];for(let t=0;t<256;++t)Qt.push((t+256).toString(16).slice(1));function iC(t,e=0){return Qt[t[e+0]]+Qt[t[e+1]]+Qt[t[e+2]]+Qt[t[e+3]]+"-"+Qt[t[e+4]]+Qt[t[e+5]]+"-"+Qt[t[e+6]]+Qt[t[e+7]]+"-"+Qt[t[e+8]]+Qt[t[e+9]]+"-"+Qt[t[e+10]]+Qt[t[e+11]]+Qt[t[e+12]]+Qt[t[e+13]]+Qt[t[e+14]]+Qt[t[e+15]]}var sC=ve(require("crypto")),Nv={randomUUID:sC.default.randomUUID};function UN(t,e,r){if(Nv.randomUUID&&!e&&!t)return Nv.randomUUID();t=t||{};let n=t.random||(t.rng||Mv)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let i=0;i<16;++i)e[r+i]=n[i];return e}return iC(n)}var yl=UN;function BN(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function HN(){return Date.now()}function oC(){return yl()}function VN(){return yl()}function aC(t=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function WN(){let t=aC(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function YN(){return Math.random()<.5}function JN(t=10){let e="0123456789abcdef",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function zN(){return Math.floor(Date.now()/1e3)}function KN(){return new Date().toISOString()}function GN(){return new Date().toISOString().split("T")[0]}function QN(){return new Date().toISOString().split("T")[1].split(".")[0]}function ZN(){return new Date().toISOString()}function XN(t=""){return Buffer.from(String(t)).toString("base64")}function eD(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function tD(t=""){return encodeURIComponent(String(t))}function rD(t=""){return decodeURIComponent(String(t))}var Dv={randomInt:BN,timestamp:HN,guid:VN,uuid:oC,randomUUID:oC,randomString:aC,randomHexadecimal:JN,randomEmail:WN,randomBoolean:YN,isoTimestamp:ZN,timestamp_s:zN,datetime:KN,date:GN,time:QN,base64Encode:XN,base64Decode:eD,urlEncode:tD,urlDecode:rD};function nD(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function vi(t,e){let r=Dv[t];return r?e&&e.length>0?r(...e):r():null}function lC(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?nD(n):void 0,s=vi(r,i);return s===null?e:String(s)}catch{return e}})}function Fs(t,e){let r=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=r.exec(t))!==null;){let s=i[0],a=i[1];if(!(s in e)){let u=vi(a);u!==null&&(n||(n={...e}),n[s]=u)}}return n??e}var Ph=ve(require("vm")),iD=100;function Ls(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function js(t,e={}){try{let r={...e,Math,Date,JSON,Number,String,Boolean,Array,Object,parseInt,parseFloat,isNaN,isFinite,encodeURIComponent,decodeURIComponent,encodeURI,decodeURI,undefined:void 0,null:null,true:!0,false:!1,NaN:NaN,Infinity:1/0},n=Ph.createContext(r);return Ph.runInContext(t,n,{timeout:iD,displayErrors:!1})}catch{return}}var kh=ve(require("crypto"));function vl(t){if(!t||!t.includes("|"))return null;let e=sD(t);if(e.length<2)return null;let r=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let a=oD(s);a&&n.push(a)}return n.length===0?null:{input:r,filters:n}}function sD(t){let e=[],r="",n=0,i=!1,s=!1;for(let a=0;a<t.length;a++){let u=t[a],f=a>0?t[a-1]:"",h=a<t.length-1?t[a+1]:"";if(f==="\\"){r+=u;continue}if(u==="'"&&!s)i=!i;else if(u==='"'&&!i)s=!s;else if(u==="("&&!i&&!s)n++;else if(u===")"&&!i&&!s)n--;else if(u==="|"&&n===0&&!i&&!s){if(h==="|"){r+="||",a++;continue}e.push(r),r="";continue}r+=u}return r&&e.push(r),e}function oD(t){let e=t.indexOf("(");if(e===-1)return{name:t.trim(),args:[]};let r=t.substring(0,e).trim(),n=t.substring(e+1,t.lastIndexOf(")"));return{name:r,args:aD(n)}}function aD(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let a=t[s];if((s>0?t[s-1]:"")==="\\"){r+=a;continue}if(a==="'"&&!i){n=!n,r+=a;continue}else if(a==='"'&&!n){i=!i,r+=a;continue}else if(a===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=a}return r.trim()&&e.push(r.trim()),e}function It(t,e){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=Number(t);if(!isNaN(r)&&t!=="")return r;if(t==="true")return!0;if(t==="false")return!1;if(e&&t in e){let n=e[t],i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Sl(t,e,r={}){let n=t;for(let i of e)n=lD(n,i.name,i.args,r);return n}function lD(t,e,r,n){switch(e){case"upper":return String(t).toUpperCase();case"lower":return String(t).toLowerCase();case"trim":return String(t).trim();case"length":return Array.isArray(t)?t.length:String(t).length;case"substring":{let i=It(r[0],n),s=r[1]!==void 0?It(r[1],n):void 0;return String(t).substring(i<0?String(t).length+i:i,s!==void 0?s<0?String(t).length+s:s:void 0)}case"replace":{let i=r[0]!==void 0?String(It(r[0],n)):"",s=r[1]!==void 0?String(It(r[1],n)):"";return String(t).replace(new RegExp(cD(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(It(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(It(r[0],n)):",";return Array.isArray(t)?t.join(i):String(t)}case"removeQuotes":return String(t).replace(/["']/g,"");case"removeSpaces":return String(t).replace(/\s/g,"");case"format":{let i=r[0]!==void 0?String(It(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let a=It(r[s],n);i=i.replace(`{${s}}`,String(a))}return i}case"add":{let i=It(r[0],n);return Number(t)+i}case"subtract":{let i=It(r[0],n);return Number(t)-i}case"multiply":{let i=It(r[0],n);return Number(t)*i}case"abs":return Math.abs(Number(t));case"btoa":return Buffer.from(String(t)).toString("base64");case"atob":return Buffer.from(String(t),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(t));case"urlDecode":return decodeURIComponent(String(t));case"hash":{let i=String(r[0]!==void 0?It(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?It(r[1],n):"base64"),u={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return kh.createHash(u).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(It(r[0],n)):"",s=String(r[1]!==void 0?It(r[1],n):"sha256").toLowerCase(),a=String(r[2]!==void 0?It(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return kh.createHmac(f,i).update(String(t)).digest(a)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=It(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=It(r[0],n),s=r[1]!==void 0?It(r[1],n):void 0;return Array.isArray(t)?t.slice(i,s):String(t).slice(i,s)}case"unique":return Array.isArray(t)?[...new Set(t)]:t;case"filter":return!Array.isArray(t)||!r[0]?t:uD(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(It(s,n)));return i.length===1?t.map(s=>yc(s,i[0])):t.map(s=>{let a={};for(let u of i){let f=yc(s,u);f!==void 0&&(a[u]=f)}return a})}case"prop":{let i=r[0]!==void 0?String(It(r[0],n)):"";if(Array.isArray(t)){let s=t.map(a=>yc(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?yc(t,i):t}case"parseJSON":try{return JSON.parse(String(t))}catch{return t}case"stringify":try{return JSON.stringify(t)}catch{return String(t)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t));case"isUrl":try{return new URL(String(t)),!0}catch{return!1}case"setIfValue":return t||void 0;case"setNull":return t===null?null:t;default:return t}}function uD(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,a]=n,u=It(a,r);return t.filter(f=>{let h=yc(f,i);if(h===void 0)return!1;switch(s){case">":return Number(h)>Number(u);case">=":return Number(h)>=Number(u);case"<":return Number(h)<Number(u);case"<=":return Number(h)<=Number(u);case"=":return String(h)===String(u);case"!=":return String(h)!==String(u);case"*=":return String(h).includes(String(u));case"^=":return String(h).startsWith(String(u));case"$=":return String(h).endsWith(String(u));default:return!0}})}function yc(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function cD(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function uC(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}var Us=class{allVariables;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.sessionVariables,...e.variables}}resolveString(e,r=!1){if(typeof e!="string")return e;if(!r)return e.replace(/\{\{([^}]+)\}\}/g,(u,f)=>this.resolveTemplateContent(f.trim(),this.allVariables,u));let n="",i=0,s=/\{\{([^}]+)\}\}/g,a;for(;(a=s.exec(e))!==null;){let u=a[1].trim(),f=this.resolveTemplateContent(u,this.allVariables,a[0]);if(f!==a[0]){n+=e.slice(i,a.index);let h=this.getStringContext(e,a.index);n+=h?this.escapeForString(String(f),h):String(f)}else n+=e.slice(i,a.index+a[0].length);i=a.index+a[0].length}return n+=e.slice(i),n}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};if(!n)return e.replace(/\{\{([^}]+)\}\}/g,(h,g)=>this.resolveTemplateContent(g.trim(),i,h));let s="",a=0,u=/\{\{([^}]+)\}\}/g,f;for(;(f=u.exec(e))!==null;){let h=f[1].trim(),g=this.resolveTemplateContent(h,i,f[0]);if(g!==f[0]){s+=e.slice(a,f.index);let m=this.getStringContext(e,f.index);s+=m?this.escapeForString(String(g),m):String(g)}else s+=e.slice(a,f.index+f[0].length);a=f.index+f[0].length}return s+=e.slice(a),s}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,a]of Object.entries(e))i[s]=this.resolveObjectWithExtra(a,r,n);return i}return e}resolveTemplateContent(e,r,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let u=uC(i[2],r),f=vi(i[1],u);return f!==null?String(f):n}let s=vl(e);if(s){let u=this.resolveFilterInput(s.input,r);if(u!==void 0){let f=Sl(u,s.filters,r);return f!==void 0?String(f):n}return n}let a=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(a){let u=a[1];if(r[u]!==void 0){let f=this.deserializeValue(r[u]),h=a[2],g=this.resolvePropertyAccess(f,h);if(g!==void 0)return typeof g=="object"?JSON.stringify(g):String(g)}}if(r[e]!==void 0){let u=r[e];return typeof u=="string"&&u.charCodeAt(0)===30?u.slice(1):String(u)}if(Ls(e)){let u=this.deserializeVariables(r),f=Fs(e,u),h=js(e,f);if(h!==void 0)return String(h)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=uC(n[2],r),a=vi(n[1],s);return a!==null?a:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(r[s]!==void 0){let a=this.deserializeValue(r[s]),u=this.resolvePropertyAccess(a,i[2]);if(u!==void 0)return u}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(Ls(e)){let s=this.deserializeVariables(r),a=Fs(e,s),u=js(e,a);if(u!==void 0)return u}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{return e}return e}deserializeVariables(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.deserializeValue(i);return r}resolvePropertyAccess(e,r){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(r))!==null;){if(n==null)return;if(s[1]!==void 0){let a=s[1];/^\d+$/.test(a)?n=n[Number(a)]:n=n[a.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,r){let n=e.replace(/\\/g,"\\\\");return r==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,r){let n=null;for(let i=0;i<r;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},Bs=class{interpolate(e,r){return!e||typeof e!="string"?e:new Us({globals:{},collectionVariables:{},environmentVariables:{},sessionVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{([^}]+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}};function cC(t){return new Us(t)}var Ki=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new Bs,this.urlBuilder=new fn}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=yi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};var fD=ve(require("http")),vc=ve(require("https")),Fv=require("url"),Ah=ve(require("zlib")),dn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Hs=class{settings;version;constructor(e){this.settings={...dn,...e};try{this.version=require("../../package.json").version||"0.0.0"}catch{this.version="0.0.0"}this.settings.strictSSL===!1&&console.log("[NodeHttpClient] SSL verification disabled (strictSSL: false)")}async send(e){let r=this.mergeSettings(e.settings);return await this.executeInternal(e,r,0)}mergeSettings(e){return{timeout:e?.timeout??this.settings.timeout,followRedirects:e?.followRedirects??this.settings.followRedirects,followOriginalMethod:e?.followOriginalMethod??this.settings.followOriginalMethod,followAuthHeader:e?.followAuthHeader??this.settings.followAuthHeader,maxRedirects:e?.maxRedirects??this.settings.maxRedirects,strictSSL:e?.strictSSL??this.settings.strictSSL,decompress:e?.decompress??this.settings.decompress,includeCookies:e?.includeCookies??this.settings.includeCookies}}async executeInternal(e,r,n,i){let s=Date.now(),a=new Fv.URL(e.url),u=a.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(m=>m.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let g={hostname:a.hostname,port:a.port||(u?443:80),path:a.pathname+a.search,method:e.method,headers:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(g.headers["Accept-Encoding"]="gzip, deflate"),u&&(g.rejectUnauthorized=r.strictSSL,r.strictSSL?g.agent=vc.globalAgent:g.agent=new vc.Agent({rejectUnauthorized:!1})),new Promise((m,S)=>{if(i?.aborted){let x=new Error("Request cancelled");x.name="AbortError",S(x);return}let C=(u?vc:fD).request(g,async x=>{let A=x.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(A)){if(n>=r.maxRedirects){S(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let j=x.headers.location;if(!j){S(new Error("Redirect response missing Location header"));return}let Y=new Fv.URL(j,e.url).toString(),V=e.method;!r.followOriginalMethod&&[301,302,303].includes(A)&&(V="GET");let K={...e.headers};r.followAuthHeader||(delete K.authorization,delete K.Authorization);try{let ee=await this.executeInternal({...e,url:Y,method:V,headers:K,body:V==="GET"?void 0:e.body},r,n+1,i),k=Date.now();ee.time=k-s,m(ee)}catch(ee){S(ee)}return}let T=[];x.on("data",j=>T.push(j)),x.on("end",()=>{let j=Date.now(),Y=Buffer.concat(T),V=x.headers["content-encoding"];if(r.decompress&&V)try{V==="gzip"?Y=Ah.gunzipSync(Y):V==="deflate"&&(Y=Ah.inflateSync(Y))}catch(P){console.warn("[NodeHttpClient] Decompression failed:",P)}let K=Y.toString("utf-8"),ee;try{ee=JSON.parse(K)}catch{ee=K}let k={};for(let[P,N]of Object.entries(x.headers))(typeof N=="string"||Array.isArray(N))&&(k[P]=N);let E=this.parseCookies(x.headers["set-cookie"],a.hostname);m({status:x.statusCode||0,statusText:x.statusMessage||"",headers:k,cookies:E,body:ee,time:j-s,size:Y.length})})});if(i&&i.addEventListener("abort",()=>{C.destroy();let x=new Error("Request cancelled");x.name="AbortError",S(x)}),C.on("error",x=>{S(x)}),C.on("timeout",()=>{C.destroy(),S(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let x=typeof e.body=="string"?e.body:JSON.stringify(e.body);C.write(x)}C.end()})}sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}parseCookies(e,r){return e?e.map(n=>{let i=n.split(";").map(g=>g.trim()),[s,...a]=i,[u,f]=s.split("="),h={name:u.trim(),value:f?.trim()||"",domain:r};for(let g of a){let[m,S]=g.split("=");switch(m.toLowerCase().trim()){case"domain":h.domain=S?.trim();break;case"path":h.path=S?.trim();break;case"expires":h.expires=S?.trim();break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break}}return h}):[]}};function Th(t){return{timeout:t?.timeout??dn.timeout,followRedirects:t?.followRedirects??dn.followRedirects,followOriginalMethod:t?.followOriginalMethod??dn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??dn.followAuthHeader,maxRedirects:t?.maxRedirects??dn.maxRedirects,strictSSL:t?.strictSSL??dn.strictSSL,decompress:t?.decompress??dn.decompress,includeCookies:t?.includeCookies??dn.includeCookies}}var Si=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}async execute(e){let r=Th(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,e,n);if(a)return a;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,i,n);if(a)return a;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}};var bi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(a){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,a),a}return i}async executeErrorInterceptors(e,r,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,r,n);if(s)return s}catch(s){console.error(`[InterceptorChain] Error interceptor '${i.name}' failed:`,s)}}clear(){this.requestInterceptors=[],this.responseInterceptors=[],this.errorInterceptors=[]}getRegisteredInterceptors(){return{request:this.requestInterceptors.map(e=>e.name),response:this.responseInterceptors.map(e=>e.name),error:this.errorInterceptors.map(e=>e.name)}}sortByPriority(e){e.sort((r,n)=>(r.priority??100)-(n.priority??100))}},qh=class{name="logging";priority=1e3;intercept(e,r){return e}},$h=class{name="timing";priority=1;intercept(e,r,n){return e}},Mh=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,r=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=r}handle(e,r,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}};var er=ve(require("crypto")),jU=ve(require("querystring")),WR=ve(require("vm"));var DU=ve(require("crypto")),zc=ve(require("fs")),BR=require("module"),xi=ve(require("path"));function Gc(){return{format:(t,e)=>{let r=t?new Date(t):new Date;return e==="YYYY-MM-DD"?r.toISOString().split("T")[0]:r.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let t=new Date;return{format:()=>t.toISOString(),toISOString:()=>t.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function Cb(){return{get:(t,e,r)=>{let n=e.split("."),i=t;for(let s of n)if(i=i?.[s],i===void 0)return r;return i},set:(t,e,r)=>{let n=e.split("."),i=t;for(let s=0;s<n.length-1;s++)i[n[s]]||(i[n[s]]={}),i=i[n[s]];return i[n[n.length-1]]=r,t},cloneDeep:t=>JSON.parse(JSON.stringify(t)),keys:t=>Object.keys(t??{}),values:t=>Object.values(t??{}),entries:t=>Object.entries(t??{}),each(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},forEach(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},map:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).map(r=>e(r)),filter:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).filter(r=>e(r)),find:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).find(r=>e(r)),reduce:(t,e,r)=>(Array.isArray(t)?t:Object.values(t??{})).reduce((n,i)=>e(n,i),r),includes:(t,e)=>Array.isArray(t)?t.includes(e):Object.values(t??{}).includes(e),isObject:t=>t!==null&&typeof t=="object"&&!Array.isArray(t),isArray:t=>Array.isArray(t),isString:t=>typeof t=="string",isNumber:t=>typeof t=="number",isFunction:t=>typeof t=="function",isNil:t=>t==null,isEmpty:t=>t==null?!0:Array.isArray(t)||typeof t=="string"?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1,assign:(t,...e)=>Object.assign(t,...e),merge:(t,...e)=>{let r={...t};for(let n of e)for(let[i,s]of Object.entries(n??{}))r[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...r[i]??{},...s}:s;return r},omit:(t,e)=>{let r={...t};for(let n of e)delete r[n];return r},pick:(t,e)=>{let r={};for(let n of e)n in(t??{})&&(r[n]=t[n]);return r}}}var Kc=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:yl}),crypto:()=>DU,path:()=>xi,querystring:()=>require("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>fC(),Cb),moment:()=>this.loadOptionalModule("moment",()=>dC(),Gc),tv4:()=>this.loadOptionalModule("tv4",()=>pC()),ajv:()=>this.loadOptionalModule("ajv",()=>UR()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>require("crypto-js"),()=>{throw new Error('crypto-js npm module is not installed. The built-in CryptoJS global is already available in scripts with AES/DES/TripleDES/hash/HMAC/PBKDF2 support. If you need the exact npm package, add "crypto-js" to your modules/package.json and run npm install.')})};constructor(e=[],r={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...r,outputChannel:r.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e)if(this.initializeModules(n)){this.modulesPath=n;break}}loadOptionalModule(e,r,n){try{return r()}catch{if(this.customModulesRequire)try{return console.debug(`[ModuleLoader] ${e} not in core, trying user modules`),this.customModulesRequire(e)}catch{this.logModuleWarning(e,"user")}else this.logModuleWarning(e,"core");if(n)return console.warn(`[ModuleLoader] Using shim for ${e}. Some features may be limited.`),n();throw new Error(this.getModuleInstallInstructions(e))}}logModuleWarning(e,r){let i={moment:"Date/time manipulation",lodash:"Utility functions",tv4:"JSON Schema validation (v4)",ajv:"JSON Schema validation"}[e]||e;console.warn(`[ModuleLoader] ${i} functionality (${e}) is not available.
|
|
210
|
+
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,Gm.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=rd.resolve(t.href,i.headers.location);return rA(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new tA.ResolverError((0,Gm.ono)(i,`Error downloading ${t.href}`),t.href)}}async function c4(t,e){let r,n;e.timeout&&(r=new AbortController,n=setTimeout(()=>r.abort(),e.timeout));let i=await fetch(t,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:r?r.signal:null});return n&&clearTimeout(n),i}});var gw=F(is=>{"use strict";var $u=is&&is.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(is,"__esModule",{value:!0});is.getNewOptions=is.getJsonSchemaRefParserDefaultOptions=void 0;var f4=$u(k1()),d4=$u(zk()),h4=$u(Kk()),p4=$u(Gk()),m4=$u(eA()),g4=$u(nA()),y4=()=>({parse:{json:{...f4.default},yaml:{...d4.default},text:{...h4.default},binary:{...p4.default}},resolve:{file:{...m4.default},http:{...g4.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});is.getJsonSchemaRefParserDefaultOptions=y4;var v4=t=>{let e=(0,is.getJsonSchemaRefParserDefaultOptions)();return t&&sA(e,t),e};is.getNewOptions=v4;function sA(t,e){if(iA(e)){let r=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=e[i],a=t[i];iA(s)?t[i]=sA(a||{},s):s!==void 0&&(t[i]=s)}}return t}function iA(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var aA=F(Qm=>{"use strict";Object.defineProperty(Qm,"__esModule",{value:!0});Qm.normalizeArgs=oA;var S4=gw();function oA(t){let e,r,n,i,s=Array.prototype.slice.call(t);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(r=s[1],n=s[2]):(r=void 0,n=s[1])):(e="",r=s[0],n=s[1]);try{n=(0,S4.getNewOptions)(n)}catch(a){console.error(`JSON Schema Ref Parser: Error normalizing options: ${a}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}Qm.default=oA});var lA=F(Xn=>{"use strict";var b4=Xn&&Xn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_4=Xn&&Xn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w4=Xn&&Xn.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&b4(r,e,n[i]);return _4(r,e),r}})(),yw=Xn&&Xn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xn,"__esModule",{value:!0});var E4=yw(Ru()),x4=yw(Wf()),C4=yw(q_()),Mu=w4(wn()),R4=En();function I4(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=vw(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function vw(t,e,r,n,i,s){i||(i=new Set);let a=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),E4.default.isExternal$Ref(t)&&a.push(O4(t,e,r,n));let u=Object.keys(t);for(let f of u){let h=x4.default.join(e,f),g=t[f];a=a.concat(vw(g,h,r,n,i,s))}}return a}async function O4(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Mu.resolve(i?Mu.cwd():e,t.$ref),a=Mu.stripHash(s),u=r._$refs[a];if(u)return Promise.resolve(u.value);try{let f=await(0,C4.default)(s,r,n),h=vw(f,a+"#",r,n,new Set,!0);return Promise.all(h)}catch(f){if(!n?.continueOnError||!(0,R4.isHandledError)(f))throw f;return r._$refs[a]&&(f.source=decodeURI(Mu.stripHash(e)),f.path=Mu.safePointerToPath(Mu.getHash(e))),[]}}Xn.default=I4});var fA=F(ei=>{"use strict";var P4=ei&&ei.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),k4=ei&&ei.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),A4=ei&&ei.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&P4(r,e,n[i]);return k4(r,e),r}})(),cA=ei&&ei.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ei,"__esModule",{value:!0});var Zm=cA(Ru()),nd=cA(Wf()),Sw=A4(wn());function T4(t,e){let r=[];bw(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),q4(r)}function bw(t,e,r,n,i,s,a,u){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(Zm.default.isAllowed$Ref(f))uA(t,e,r,n,i,s,a,u);else{let h=Object.keys(f).sort((g,m)=>g==="definitions"?-1:m==="definitions"?1:g.length-m.length);for(let g of h){let m=nd.default.join(r,g),S=nd.default.join(n,g),E=f[g];Zm.default.isAllowed$Ref(E)?uA(f,g,r,S,i,s,a,u):bw(f,g,m,S,i,s,a,u)}}}function uA(t,e,r,n,i,s,a,u){let f=e===null?t:t[e],h=Sw.resolve(r,f.$ref),g=a._resolve(h,n,u);if(g===null)return;let S=nd.default.parse(n).length,E=Sw.stripHash(g.path),x=Sw.getHash(g.path),C=E!==a._root$Ref.path,A=Zm.default.isExtended$Ref(f);i+=g.indirections;let T=$4(s,t,e);if(T)if(S<T.depth||i<T.indirections)M4(s,T);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:S,file:E,hash:x,value:g.value,circular:g.circular,extended:A,external:C,indirections:i}),(!T||C)&&bw(g.value,null,g.path,n,i+1,s,a,u)}function q4(t){t.sort((i,s)=>{if(i.file!==s.file)return i.file<s.file?-1:1;if(i.hash!==s.hash)return i.hash<s.hash?-1:1;if(i.circular!==s.circular)return i.circular?-1:1;if(i.extended!==s.extended)return i.extended?1:-1;if(i.indirections!==s.indirections)return i.indirections-s.indirections;if(i.depth!==s.depth)return i.depth-s.depth;{let a=i.pathFromRoot.lastIndexOf("/definitions"),u=s.pathFromRoot.lastIndexOf("/definitions");return a!==u?u-a:i.pathFromRoot.length-s.pathFromRoot.length}});let e,r,n;for(let i of t)i.external?i.file===e&&i.hash===r?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(r+"/")===0?i.$ref.$ref=nd.default.join(n,nd.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=Zm.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function $4(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function M4(t,e){let r=t.indexOf(e);t.splice(r,1)}ei.default=T4});var yA=F(ti=>{"use strict";var N4=ti&&ti.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),D4=ti&&ti.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),F4=ti&&ti.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&N4(r,e,n[i]);return D4(r,e),r}})(),mA=ti&&ti.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ti,"__esModule",{value:!0});var Xm=mA(Ru()),dA=mA(Wf()),L4=no(),hA=F4(wn()),j4=En();ti.default=U4;function U4(t,e){let r=Date.now(),n=_w(t.schema,t.$refs._root$Ref.path,"#",new Set,new Set,new Map,t.$refs,e,r);t.$refs.circular=n.circular,t.schema=n.value}function _w(t,e,r,n,i,s,a,u,f){let h,g={value:t,circular:!1};if(u&&u.timeoutMs&&Date.now()-f>u.timeoutMs)throw new j4.TimeoutError(u.timeoutMs);let m=u.dereference||{},S=m.excludedPathMatcher||(()=>!1);if((m?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!S(r)){if(n.add(t),i.add(t),Xm.default.isAllowed$Ref(t,u))h=pA(t,e,r,n,i,s,a,u,f),g.circular=h.circular,g.value=h.value;else for(let E of Object.keys(t)){let x=dA.default.join(e,E),C=dA.default.join(r,E);if(S(C))continue;let A=t[E],T=!1;if(Xm.default.isAllowed$Ref(A,u)){if(h=pA(A,x,C,n,i,s,a,u,f),T=h.circular,t[E]!==h.value){let B=new Map;m?.preservedProperties&&typeof t[E]=="object"&&!Array.isArray(t[E])&&m?.preservedProperties.forEach(Y=>{Y in t[E]&&B.set(Y,t[E][Y])}),t[E]=h.value,m?.preservedProperties&&B.size&&typeof t[E]=="object"&&!Array.isArray(t[E])&&B.forEach((Y,H)=>{t[E][H]=Y}),m?.onDereference?.(A.$ref,t[E],t,E)}}else n.has(A)?T=gA(x,a,u):(h=_w(A,x,C,n,i,s,a,u,f),T=h.circular,t[E]!==h.value&&(t[E]=h.value));g.circular=g.circular||T}n.delete(t)}return g}function pA(t,e,r,n,i,s,a,u,f){let g=Xm.default.isExternal$Ref(t)&&u?.dereference?.externalReferenceResolution==="root",m=hA.resolve(g?hA.cwd():e,t.$ref),S=s.get(m);if(S&&!S.circular){let B=Object.keys(t);if(B.length>1){let Y={};for(let H of B)H!=="$ref"&&!(H in S.value)&&(Y[H]=t[H]);return{circular:S.circular,value:Object.assign({},S.value,Y)}}return S}let E=a._resolve(m,e,u);if(E===null)return{circular:!1,value:null};let x=E.circular,C=x||n.has(E.value);C&&gA(e,a,u);let A=Xm.default.dereference(t,E.value);if(!C){let B=_w(A,E.path,r,n,i,s,a,u,f);C=B.circular,A=B.value}C&&!x&&u.dereference?.circular==="ignore"&&(A=t),x&&(A.$ref=r);let T={circular:C,value:A};return Object.keys(t).length===1&&s.set(m,T),T}function gA(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw L4.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var vA=F(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});function B4(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}ww.default=B4()});var bA=F(id=>{"use strict";var H4=id&&id.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(id,"__esModule",{value:!0});id.default=V4;var SA=H4(vA());function V4(t,e){if(t){e.then(function(r){(0,SA.default)(function(){t(null,r)})},function(r){(0,SA.default)(function(){t(r)})});return}else return e}});var xA=F(we=>{"use strict";var W4=we&&we.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Y4=we&&we.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),J4=we&&we.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&W4(r,e,n[i]);return Y4(r,e),r}})(),wa=we&&we.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(we,"__esModule",{value:!0});we.getJsonSchemaRefParserDefaultOptions=we.jsonSchemaParserNormalizeArgs=we.dereferenceInternal=we.JSONParserErrorGroup=we.isHandledError=we.UnmatchedParserError=we.ParserError=we.ResolverError=we.MissingPointerError=we.InvalidPointerError=we.JSONParserError=we.UnmatchedResolverError=we.dereference=we.bundle=we.resolve=we.parse=we.$RefParser=void 0;var _A=wa(C1()),z4=wa(q_()),sd=wa(aA());we.jsonSchemaParserNormalizeArgs=sd.default;var K4=wa(lA()),G4=wa(fA()),EA=wa(yA());we.dereferenceInternal=EA.default;var _a=J4(wn()),xn=En();Object.defineProperty(we,"JSONParserError",{enumerable:!0,get:function(){return xn.JSONParserError}});Object.defineProperty(we,"InvalidPointerError",{enumerable:!0,get:function(){return xn.InvalidPointerError}});Object.defineProperty(we,"MissingPointerError",{enumerable:!0,get:function(){return xn.MissingPointerError}});Object.defineProperty(we,"ResolverError",{enumerable:!0,get:function(){return xn.ResolverError}});Object.defineProperty(we,"ParserError",{enumerable:!0,get:function(){return xn.ParserError}});Object.defineProperty(we,"UnmatchedParserError",{enumerable:!0,get:function(){return xn.UnmatchedParserError}});Object.defineProperty(we,"UnmatchedResolverError",{enumerable:!0,get:function(){return xn.UnmatchedResolverError}});Object.defineProperty(we,"isHandledError",{enumerable:!0,get:function(){return xn.isHandledError}});Object.defineProperty(we,"JSONParserErrorGroup",{enumerable:!0,get:function(){return xn.JSONParserErrorGroup}});var wA=no(),ri=wa(bA()),Q4=gw();Object.defineProperty(we,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return Q4.getJsonSchemaRefParserDefaultOptions}});var ao=class t{constructor(){this.schema=null,this.$refs=new _A.default}async parse(){let e=(0,sd.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,wA.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,ri.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new _A.default;let n="http";if(_a.isFileSystemPath(e.path))e.path=_a.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=_a.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=_a.resolve(_a.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,r=Promise.resolve(e.schema)}else r=(0,z4.default)(e.path,this.$refs,e.options);try{let i=await r;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,ri.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,ri.default)(e.callback,Promise.resolve(this.schema));throw wA.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,xn.isHandledError)(i)?(0,ri.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[_a.stripHash(e.path)]&&this.$refs._$refs[_a.stripHash(e.path)].addError(i),(0,ri.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,sd.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,K4.default)(this,e.options),Ew(this),(0,ri.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,ri.default)(e.callback,Promise.reject(r))}}static resolve(){let e=new t;return e.resolve.apply(e,arguments)}static bundle(){let e=new t;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,sd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,G4.default)(this,e.options),Ew(this),(0,ri.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,ri.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,sd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,EA.default)(this,e.options),Ew(this),(0,ri.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,ri.default)(e.callback,Promise.reject(r))}}};we.$RefParser=ao;we.default=ao;function Ew(t){if(xn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new xn.JSONParserErrorGroup(t)}we.parse=ao.parse;we.resolve=ao.resolve;we.bundle=ao.bundle;we.dereference=ao.dereference});var c3={};VN(c3,{BODY_FILE_MAP:()=>Cv,CONFIG_FILES:()=>ia,CollectionLoader:()=>Uo,CollectionLoaderFactory:()=>eu,CollectionRequestExecutor:()=>su,CollectionService:()=>tu,ConfigService:()=>sa,CookieJar:()=>_l,CookieService:()=>ru,CookieUtils:()=>ut,DEFAULT_CONFIG:()=>Jt,DEFAULT_REQUEST_SETTINGS:()=>pn,DEFAULT_SUITE_CONFIG:()=>od,DYNAMIC_VARIABLES:()=>Mv,DataFileParser:()=>Vs,EnvironmentConfigService:()=>iu,EnvironmentResolver:()=>pi,ExampleGenerator:()=>ma,FetchHttpClient:()=>zl,FolderCollectionLoader:()=>Sl,FolderCollectionStore:()=>Vi,ForgeContainer:()=>Sp,ForgeEnv:()=>Wi,GraphQLSchemaService:()=>au,HTTP_METHOD_MAP:()=>rg,HTTP_METHOD_REVERSE:()=>Du,HistoryAnalyzer:()=>aa,HtmlReportGenerator:()=>Uu,HttpForgeParser:()=>Hs,HttpRequestService:()=>gi,InMemoryCookieJar:()=>tg,InterceptorChain:()=>yi,JsonCollectionLoader:()=>na,LoggingRequestInterceptor:()=>Th,METADATA_FILES:()=>ir,ModuleLoader:()=>af,NodeFileSystem:()=>Kl,NodeHttpClient:()=>$s,OAuth2TokenManager:()=>Zl,OpenApiExporter:()=>pa,OpenApiImporter:()=>xa,ParserRegistry:()=>bl,PersistentCookieJar:()=>nu,ROOT_DIRECTORIES:()=>Ys,RefResolver:()=>Ea,RequestExecutor:()=>ea,RequestHistoryService:()=>cu,RequestHistoryStore:()=>Jl,RequestPreparer:()=>ou,RequestPreprocessor:()=>Bs,RequestScriptSession:()=>Yl,ResultStorageService:()=>ig,RetryErrorInterceptor:()=>$h,SCHEMA_FILES:()=>vl,SCRIPTS_DIR:()=>Kr,SCRIPT_FILES:()=>xc,SchemaInferenceService:()=>Ca,SchemaInferrer:()=>Zi,ScriptAnalyzer:()=>Ra,ScriptExecutor:()=>wi,ServiceContainer:()=>Nu,ServiceIdentifiers:()=>ne,StatisticsService:()=>og,TestSuiteService:()=>ag,TestSuiteStore:()=>lg,TimingResponseInterceptor:()=>qh,UrlBuilder:()=>hn,VariableInterpolator:()=>qs,VariableResolver:()=>Ts,applyExtractionPlan:()=>oI,applyFilterChain:()=>Cl,augmentWithDynamicVars:()=>Ps,buildExtractionPlan:()=>sI,buildResultFileName:()=>Ow,cleanupOldBodyFiles:()=>Ov,concatenateScripts:()=>uf,createExpectChain:()=>Vl,createLodashShim:()=>Eb,createModuleLoader:()=>mp,createMomentShim:()=>lf,createResponseObject:()=>gp,createScriptConsole:()=>JR,createTestFunction:()=>yp,createVariableResolver:()=>ux,deepClone:()=>ZE,deleteItemFromTree:()=>Ch,detectSensitiveData:()=>iI,evaluateExpression:()=>As,expandSummary:()=>LA,exportCollectionToRestClient:()=>XR,findItemById:()=>xh,formatBytes:()=>tx,formatConsoleOutput:()=>cf,formatDuration:()=>rx,generateId:()=>lt,generateSlug:()=>hi,generateUUID:()=>Eh,getCompletions:()=>DA,getRestClientExportFolder:()=>ZR,getServiceContainer:()=>Cw,hasChanged:()=>Wl,isExpression:()=>ks,isPlainObject:()=>XE,isSystemEnvironmentFile:()=>Ic,loadEnvironmentsFromFolder:()=>wl,mergeHeadersCaseInsensitive:()=>yl,mergeRequestSettings:()=>Ah,normalizeHeaders:()=>vp,parseFilterChain:()=>xl,parsePostmanEnvironment:()=>df,parsePostmanEnvironmentFile:()=>rI,parseQueryContext:()=>NA,prepareBodyForSave:()=>Iv,readBodyFromDir:()=>Rv,readSchemaFile:()=>Pv,readScriptsFromDir:()=>Cc,redactBody:()=>xp,redactFullResponse:()=>Rp,redactFullResultDetails:()=>Ip,redactHeaders:()=>uu,redactHistoryEntry:()=>Cp,redactUrl:()=>Ep,registerCoreServices:()=>xw,resolveDynamicVariable:()=>mi,resolveDynamicVariablesInString:()=>ax,safeJsonParse:()=>ex,sanitizeName:()=>_t,searchForItemPath:()=>Rh,sortItemsByOrder:()=>Av,writeEnvFile:()=>ra,writeFolderItems:()=>ff,writeSchemaFiles:()=>kv,writeScriptFile:()=>Xl,writeScriptsToDir:()=>Rc});module.exports=WN(c3);var Uo=class{constructor(e,r){this.fileSystem=e;this.parserRegistry=r}fileSystem;parserRegistry;directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,r={}){let n=await this.fileSystem.readFile(e);if(r.format){let s=this.parserRegistry.get(r.format);if(!s)throw new Error(`No parser registered for format: ${r.format}`);return s.parse(n,e)}let i=this.parserRegistry.detect(n);if(!i)throw new Error(`Could not detect collection format for: ${e}. Supported formats: ${this.parserRegistry.getFormats().join(", ")}`);return i.parser.parse(n,e)}async loadDirectory(e,r=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(r,e);for(let s of i)try{let a=await this.load(s);n.push(a)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let r=await this.fileSystem.readFile(e);return this.parserRegistry.detect(r)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};var be=Se(require("fs")),Ce=Se(require("path"));function _t(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function lt(t){let e=Date.now().toString(36)+Math.random().toString(36).substr(2,9);return t?`${_t(t)}_${e}`:e}function Eh(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function yl(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let a=i.toLowerCase();n[a]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let a=i.toLowerCase(),u=n[a];u&&delete r[u],n[a]=i,r[i]=s}return r}function ZE(t){return JSON.parse(JSON.stringify(t))}function XE(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function ex(t,e){try{return JSON.parse(t)}catch{return e}}function tx(t){if(t===0)return"0 B";let e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(1))} ${r[n]}`}function rx(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var st=Se(require("fs")),jn=Se(require("path")),xc={preRequest:"pre-request.js",postResponse:"post-response.js"},ir={collection:"collection.json",folder:"folder.json",request:"request.json"},Cv={"body.json":{type:"raw",format:"json"},"body.xml":{type:"raw",format:"xml"},"body.txt":{type:"raw",format:"text"},"body.html":{type:"raw",format:"html"},"body.js":{type:"raw",format:"javascript"},"body.graphql":{type:"graphql"}},vl={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},Kr="scripts";function Cc(t){if(!st.existsSync(t))return;let e={},r=jn.join(t,xc.preRequest);st.existsSync(r)&&(e.preRequest=st.readFileSync(r,"utf-8"));let n=jn.join(t,xc.postResponse);return st.existsSync(n)&&(e.postResponse=st.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function Rc(t,e){await st.promises.mkdir(t,{recursive:!0});let r=jn.join(t,xc.preRequest);e.preRequest?await st.promises.writeFile(r,e.preRequest,"utf-8"):st.existsSync(r)&&await st.promises.unlink(r);let n=jn.join(t,xc.postResponse);e.postResponse?await st.promises.writeFile(n,e.postResponse,"utf-8"):st.existsSync(n)&&await st.promises.unlink(n)}function Rv(t){for(let[e,r]of Object.entries(Cv)){let n=jn.join(t,e);if(st.existsSync(n))try{let i=st.readFileSync(n,"utf-8"),s;if(r.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:r.type,format:r.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function Iv(t){if(!t||t.type==="none")return{bodyForMetadata:t};if(t.type==="raw"){let e=t.format||"json",n={json:"body.json",xml:"body.xml",text:"body.txt",html:"body.html",javascript:"body.js"}[e];if(n){let i=e==="json"?typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2):String(t.content||"");return{bodyForMetadata:{type:t.type,format:t.format},externalBodyFile:{filename:n,content:i}}}}if(t.type==="graphql"){let e=typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2);return{bodyForMetadata:{type:t.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:t}}async function Ov(t,e){for(let r of Object.keys(Cv))if(r!==e){let n=jn.join(t,r);if(st.existsSync(n))try{await st.promises.unlink(n)}catch{}}}function Pv(t){if(st.existsSync(t))try{let e=st.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function kv(t,e,r){let n=jn.join(t,vl.responseSchema),i=jn.join(t,vl.bodySchema);e?await st.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):st.existsSync(n)&&await st.promises.unlink(n),r?await st.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):st.existsSync(i)&&await st.promises.unlink(i)}function xh(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=xh(r.items,e);if(n)return n}}}function Ch(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(n.id===e)return t.splice(r,1),!0;if(n.type==="folder"&&n.items&&Ch(n.items,e))return!0}return!1}function Av(t,e){let r=new Map(t.map(i=>[i.id,i])),n=[];for(let i of e){let s=r.get(i);s&&(n.push(s),r.delete(i))}for(let i of r.values())n.push(i);return n}function Rh(t,e){let r;try{r=st.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===Kr)continue;if(n.name===e)return jn.join(t,n.name);let i=Rh(jn.join(t,n.name),e);if(i)return i}}function hi(t,e=[]){let r=t.toLowerCase().trim(),n=r.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=r.match(/t(\d+)/gi)||[],a=0;for(let S of s){let E=parseInt(S.substring(1));E>a&&(a=E)}let u="";if(a>0)u=`t${a}`;else{let S=r.match(/[_\s-](\d+\.\d+)[_\s-]/);S&&(u=`v${S[1].replace(".","_")}`)}let f=r;n&&(f=f.substring(n[0].length)),f=f.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),f=f.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),f=f.replace(/\([^)]+\)/g,""),f=f.replace(/:[a-z_][a-z0-9_]*/gi,""),f=f.replace(/\{[^}]+\}/g,""),f=f.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let h=f.split("-").filter(S=>S.length>0),g=[];i&&g.push(i),g.push(...h),u&&g.push(u);let m=g.join("-");if(m||(m="item"),e.includes(m)){let S=2;for(;e.includes(`${m}-${S}`);)S++;m=`${m}-${S}`}return m}var Vi=class{collectionsDir;cache=new Map;slugToIdMap=new Map;idToSlugMap=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}getSlugById(e){return this.idToSlugMap.get(e)}getIdBySlug(e){return this.slugToIdMap.get(e)}ensureDirectory(){be.existsSync(this.collectionsDir)||be.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!be.existsSync(this.collectionsDir))return[];let e=be.readdirSync(this.collectionsDir,{withFileTypes:!0}),r=[];for(let n of e)if(n.isDirectory())try{let i=this.loadCollectionFromFolder(n.name);i&&(this.cache.set(i.id,i),this.slugToIdMap.set(n.name,i.id),this.idToSlugMap.set(i.id,n.name),r.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return r}loadCollectionFromFolder(e){let r=Ce.join(this.collectionsDir,e),n=Ce.join(r,ir.collection);if(be.existsSync(n))try{let i=be.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Ce.join(r,Kr)),u=this.loadItemsFromDir(r,s.id,s.order);return{id:s.id,name:s.name,description:s.description,version:s.version,variables:s.variables,auth:s.auth,scripts:a,items:u}}catch(i){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,i);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,a=be.readdirSync(e,{withFileTypes:!0});for(let u of a){if(!u.isDirectory()||u.name===Kr)continue;let f=Ce.join(e,u.name);if(be.existsSync(Ce.join(f,ir.folder))){let h=this.loadFolderFromDir(f,u.name);h&&s.set(u.name,h)}else if(be.existsSync(Ce.join(f,ir.request))){let h=this.loadRequestFromDir(f,u.name);h&&s.set(u.name,h)}}if(n&&n.length>0){for(let u of n){let f=s.get(u);f&&(i.push(f),s.delete(u))}for(let u of s.values())i.push(u)}else for(let u of s.values())i.push(u);return i}loadFolderFromDir(e,r){let n=Ce.join(e,ir.folder);try{let i=be.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Ce.join(e,Kr)),u=this.loadItemsFromDir(e,s.id,s.order);return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"folder",name:s.name,description:s.description,auth:s.auth,scripts:a,items:u}}catch(i){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,i);return}}loadRequestFromDir(e,r){let n=Ce.join(e,ir.request);try{let i=be.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Ce.join(e,Kr)),u=s.body,f=this.loadBodyFromDir(e);f&&(u=f);let h=this.loadSchemaFile(Ce.join(e,vl.responseSchema)),g=this.loadSchemaFile(Ce.join(e,vl.bodySchema)),m=Ce.join(e,"doc.md"),S=be.existsSync(m)?be.readFileSync(m,"utf-8"):void 0;return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"request",name:s.name,description:s.description,method:s.method,url:s.url,params:s.params,query:s.query,headers:s.headers,body:u,auth:s.auth,settings:s.settings,scripts:a,deprecated:s.deprecated,...S&&{doc:S},...h&&{responseSchema:h},...g&&{bodySchema:g}}}catch(i){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,i);return}}loadScriptsFromDir(e){return Cc(e)}loadBodyFromDir(e){return Rv(e)}loadSchemaFile(e){return Pv(e)}async saveSchemaFiles(e,r){return kv(e,r.responseSchema,r.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.idToSlugMap.get(e);if(r){let n=this.loadCollectionFromFolder(r);return n&&this.cache.set(e,n),n}return this.loadAll(),this.cache.get(e)}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=lt(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let a=be.readdirSync(this.collectionsDir);r=hi(e.name,a),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Ce.join(this.collectionsDir,r);await be.promises.mkdir(n,{recursive:!0});let i={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth};await be.promises.writeFile(Ce.join(n,ir.collection),JSON.stringify(i,null,2),"utf-8"),e.scripts&&await this.saveScriptsToDir(Ce.join(n,Kr),e.scripts);let s=await this.saveItemsToDir(n,e.items);s.length>0&&(i.order=s,await be.promises.writeFile(Ce.join(n,ir.collection),JSON.stringify(i,null,2),"utf-8")),this.cache.set(e.id,e)}async saveItemsToDir(e,r){let n=[];for(let i of r){let s=this.idToSlugMap.get(i.id);s||(s=hi(i.name,n),this.idToSlugMap.set(i.id,s),this.slugToIdMap.set(s,i.id)),n.push(s);let a=Ce.join(e,s);await be.promises.mkdir(a,{recursive:!0}),i.type==="folder"?await this.saveFolderToDir(a,i):await this.saveRequestToDir(a,i)}return n}async saveFolderToDir(e,r){let n={id:r.id,name:r.name,description:r.description,auth:r.auth};if(await be.promises.writeFile(Ce.join(e,ir.folder),JSON.stringify(n,null,2),"utf-8"),r.scripts&&await this.saveScriptsToDir(Ce.join(e,Kr),r.scripts),r.items){let i=await this.saveItemsToDir(e,r.items);i.length>0&&(n.order=i,await be.promises.writeFile(Ce.join(e,ir.folder),JSON.stringify(n,null,2),"utf-8"))}}async saveRequestToDir(e,r){let{bodyForMetadata:n,externalBodyFile:i}=this.prepareBodyForSave(r.body),s={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:n,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated}};await be.promises.writeFile(Ce.join(e,ir.request),JSON.stringify(s,null,2),"utf-8"),i&&await be.promises.writeFile(Ce.join(e,i.filename),i.content,"utf-8"),await this.cleanupOldBodyFiles(e,i?.filename),await this.saveSchemaFiles(e,r),r.doc&&await be.promises.writeFile(Ce.join(e,"doc.md"),r.doc,"utf-8"),r.scripts&&await this.saveScriptsToDir(Ce.join(e,Kr),r.scripts)}prepareBodyForSave(e){return Iv(e)}async cleanupOldBodyFiles(e,r){return Ov(e,r)}async saveScriptsToDir(e,r){return Rc(e,r)}async delete(e){let r=this.idToSlugMap.get(e);if(!r&&(this.loadAll(),r=this.idToSlugMap.get(e),!r))return!1;let n=Ce.join(this.collectionsDir,r);if(!be.existsSync(n))return!1;try{return await be.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(r),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let r=this.idToSlugMap.get(e);return r?be.existsSync(Ce.join(this.collectionsDir,r,ir.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Ce.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||lt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,r);if(!s)throw new Error(`Item ${r} not found in collection ${e}`);await this.saveScriptsToDir(Ce.join(s,Kr),n);let a=this.findItemById(i.items,r);a&&(a.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(Ce.join(n,Kr))}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);let i=this.idToSlugMap.get(e);if(!i)throw new Error(`Collection slug not found for ${e}`);let s=Ce.join(this.collectionsDir,i),a=Ce.join(s,ir.collection),u=be.readFileSync(a,"utf-8"),h={...JSON.parse(u),...r,id:e};await be.promises.writeFile(a,JSON.stringify(h,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let a;if(n){let g=this.findItemPath(e,n);if(!g)throw new Error(`Parent folder ${n} not found`);a=g}else a=Ce.join(this.collectionsDir,s);let u=this.idToSlugMap.get(r.id);if(!u){let g=be.readdirSync(a).filter(m=>be.statSync(Ce.join(a,m)).isDirectory()&&m!==Kr);u=hi(r.name,g),this.idToSlugMap.set(r.id,u),this.slugToIdMap.set(u,r.id)}let f=Ce.join(a,u);await be.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let h=this.findItemById(i.items,r.id);if(h)Object.assign(h,r);else if(n){let g=this.findItemById(i.items,n);g&&g.type==="folder"&&(g.items=g.items||[],g.items.push(r))}else i.items.push(r)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,r);if(!i||!be.existsSync(i))return!1;try{await be.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,r);let s=this.idToSlugMap.get(r);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(r)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${r}:`,s),!1}}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,r);if(!s)return!1;let a=this.findItemById(i.items,r);if(!a)return!1;let{id:u,type:f,items:h,...g}=n;return Object.assign(a,g),a.type==="folder"?await this.saveFolderToDir(s,a):await this.saveRequestToDir(s,a),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=this.findItemPath(e,r);if(!a||!be.existsSync(a))return!1;let u;if(n){let g=this.findItemPath(e,n);if(!g)return!1;u=g}else u=Ce.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let h=Ce.join(u,f);if(be.existsSync(h))return!1;try{await be.promises.rename(a,h);let g=this.findItemById(i.items,r);if(g){let m=g.type==="folder"?{...g,items:g.items?[...g.items]:[]}:{...g};if(this.deleteItemFromTree(i.items,r),n){let S=this.findItemById(i.items,n);S&&S.type==="folder"&&(S.items=S.items||[],S.items.push(m))}else i.items.push(m)}return!0}catch(g){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,g),!1}}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=[];for(let u of n){let f=this.idToSlugMap.get(u);f&&a.push(f)}try{if(r){let u=this.findItemPath(e,r);if(!u)return!1;let f=Ce.join(u,ir.folder),h=be.readFileSync(f,"utf-8"),g=JSON.parse(h);g.order=a,await be.promises.writeFile(f,JSON.stringify(g,null,2),"utf-8");let m=this.findItemById(i.items,r);m&&m.type==="folder"&&m.items&&(m.items=this.sortItemsByOrder(m.items,n))}else{let u=Ce.join(this.collectionsDir,s,ir.collection),f=be.readFileSync(u,"utf-8"),h=JSON.parse(f);h.order=a,await be.promises.writeFile(u,JSON.stringify(h,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(u){return console.error("[FolderCollectionStore] Failed to reorder items:",u),!1}}sortItemsByOrder(e,r){return Av(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=this.idToSlugMap.get(r);if(i)return Rh(Ce.join(this.collectionsDir,n),i)}findItemById(e,r){return xh(e,r)}deleteItemFromTree(e,r){return Ch(e,r)}};function Tv(t,e){return{id:t.id,name:t.name,description:t.description,variables:t.variables||{},auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(nx),source:{format:"folder",filePath:e,version:t.version}}}function nx(t){if(t.type==="folder")return{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(nx)};let e=t;return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:e.headers||[],query:e.query||[],params:e.params,body:e.body??void 0,auth:e.auth,settings:e.settings,scripts:e.scripts,...e.deprecated&&{deprecated:e.deprecated},...e.doc&&{doc:e.doc},...e.responseSchema&&{responseSchema:e.responseSchema},...e.bodySchema&&{bodySchema:e.bodySchema}}}function YN(t){return{id:t.id,name:t.name,description:t.description,version:t.source?.version,variables:t.variables,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(qv)}}function qv(t){return t.type==="folder"?{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(qv)}:{type:"request",id:t.id,name:t.name,description:t.description,method:t.method,url:t.url,headers:t.headers,query:t.query,params:t.params,body:t.body,auth:t.auth,settings:t.settings,scripts:t.scripts,...t.deprecated&&{deprecated:t.deprecated},...t.doc&&{doc:t.doc}}}var Sl=class{store;constructor(e){this.store=new Vi(e)}loadAll(){return this.store.loadAll().map(r=>Tv(r,this.store.getCollectionPath(r.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let r=this.store.load(e);if(r)return Tv(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return Tv(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(YN(e))}async delete(e){return this.store.delete(e)}exists(e){return this.store.exists(e)}getCollectionPath(e){return this.store.getCollectionPath(e)}async updateCollectionMetadata(e,r){return this.store.updateCollectionMetadata(e,r)}async saveItem(e,r,n){return this.store.saveItem(e,qv(r),n)}async updateItem(e,r,n){let i={...n};return this.store.updateItem(e,r,i)}async deleteItem(e,r){return this.store.deleteItem(e,r)}async moveItem(e,r,n){return this.store.moveItem(e,r,n)}async reorderItems(e,r,n){return this.store.reorderItems(e,r,n)}async saveScripts(e,r,n){return this.store.saveScripts(e,r,n)}loadScripts(e,r){return this.store.loadScripts(e,r)}};var bl=class{parsers=new Map;register(e,r){this.parsers.set(e.toLowerCase(),r)}get(e){return this.parsers.get(e.toLowerCase())}has(e){return this.parsers.has(e.toLowerCase())}getFormats(){return Array.from(this.parsers.keys())}detect(e){for(let[r,n]of this.parsers)if(n.canParse(e))return{parser:n,format:r};return null}clear(){this.parsers.clear()}};var ut=class{static parseSetCookie(e,r){let n=e.split(";").map(g=>g.trim());if(n.length===0)return null;let[i,...s]=n,a=i.indexOf("=");if(a===-1)return null;let u=i.substring(0,a).trim(),f=i.substring(a+1).trim(),h={name:u,value:f,domain:r};for(let g of s){let m=g.indexOf("="),S=(m===-1?g:g.substring(0,m)).toLowerCase(),E=m===-1?"":g.substring(m+1);switch(S){case"domain":h.domain=E.startsWith(".")?E.substring(1):E;break;case"path":h.path=E;break;case"expires":h.expires=E;break;case"max-age":h.maxAge=parseInt(E,10);break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break;case"samesite":h.sameSite=E;break}}return h}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let a of s){let u=this.parseSetCookie(a,r);u&&n.push(u)}return n}static formatCookieHeader(e){return e.map(r=>`${r.name}=${r.value}`).join("; ")}static isExpired(e){return!!(e.expires&&new Date(e.expires).getTime()<Date.now()||e.maxAge!==void 0&&e.maxAge<=0)}static domainMatches(e,r){if(r==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=r.toLowerCase().split(".").reverse();if(i.length>n.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static extractDomain(e){try{return new URL(e).hostname}catch{return""}}static extractPath(e){try{return new URL(e).pathname}catch{return"/"}}};var _l=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}}has(e,r){return this.get(e,r)!==void 0}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return ut.formatCookieHeader(r)}clear(){this.cookies.clear()}clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n)}parseCookieHeaders(e,r){return ut.parseCookieHeaders(e,r)}isExpired(e){return ut.isExpired(e)}domainMatches(e,r){return ut.domainMatches(e,r)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r)}};var Os=Se(require("fs")),Bo=Se(require("path"));function Ic(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function wl(t){if(!Os.existsSync(t))return JN();let e=Ih(Bo.join(t,"_global.json"))||{},r=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=Os.readdirSync(t).filter(h=>h.endsWith(".json")).filter(h=>!h.endsWith(".local.json")).filter(h=>!Ic(h)),s={};for(let h of i){let g=Ih(Bo.join(t,h))||{},m=Bo.basename(h,".json");s[m]={description:g.description,requiresConfirmation:g.requiresConfirmation,variables:g.variables||{}}}let u=(Ih(Bo.join(t,"_global.local.json"))||{}).variables||{},f={};for(let h of Object.keys(s)){let g=Bo.join(t,`${h}.local.json`);if(Os.existsSync(g)){let m=Ih(g)||{};f[h]={variables:m.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:u,localCredentials:f}}function JN(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function Ih(t){try{if(!Os.existsSync(t))return null;let e=Os.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${t}:`,e),null}}var pi=class t{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let a=this.getEnvironmentVariables(n.inherits);i={...i,...a}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};var hn=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,a="",u=e.indexOf("?");u!==-1&&(a=e.substring(u),s=e.substring(0,u));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let h=/:(\w+)(?:\([^)]*\))?(\?)?/g,g=s.replace(h,(m,S,E)=>{let x=r[S];return x!==void 0&&x!==""?encodeURIComponent(x):E?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${S}`),m)});return g=g.replace(/([^:])\/+/g,"$1/"),g.length>1&&g.endsWith("/")&&(g=g.slice(0,-1)),`${n}${i}${g}${a}`}extractPathParams(e){let r=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=r.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,r){let n=e,i={};if(e.includes("?")){let[f,h]=e.split("?");n=f,h&&new URLSearchParams(h).forEach((m,S)=>{i[S]=m})}let s={...i,...r},a=new URLSearchParams;for(let[f,h]of Object.entries(s))h!=null&&a.append(f,h);let u=a.toString();return u?`${n}?${u}`:n}};var Kt=[];for(let t=0;t<256;++t)Kt.push((t+256).toString(16).slice(1));function ix(t,e=0){return(Kt[t[e+0]]+Kt[t[e+1]]+Kt[t[e+2]]+Kt[t[e+3]]+"-"+Kt[t[e+4]]+Kt[t[e+5]]+"-"+Kt[t[e+6]]+Kt[t[e+7]]+"-"+Kt[t[e+8]]+Kt[t[e+9]]+"-"+Kt[t[e+10]]+Kt[t[e+11]]+Kt[t[e+12]]+Kt[t[e+13]]+Kt[t[e+14]]+Kt[t[e+15]]).toLowerCase()}var zN=new Uint8Array(16);function $v(){return crypto.getRandomValues(zN)}function KN(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():GN(t,e,r)}function GN(t,e,r){t=t||{};let n=t.random??t.rng?.()??$v();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[r+i]=n[i];return e}return ix(n)}var El=KN;function QN(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function ZN(){return Date.now()}function sx(){return El()}function XN(){return El()}function ox(t=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function eD(){let t=ox(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function tD(){return Math.random()<.5}function rD(t=10){let e="0123456789abcdef",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function nD(){return Math.floor(Date.now()/1e3)}function iD(){return new Date().toISOString()}function sD(){return new Date().toISOString().split("T")[0]}function oD(){return new Date().toISOString().split("T")[1].split(".")[0]}function aD(){return new Date().toISOString()}function lD(t=""){return Buffer.from(String(t)).toString("base64")}function uD(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function cD(t=""){return encodeURIComponent(String(t))}function fD(t=""){return decodeURIComponent(String(t))}var Mv={randomInt:QN,timestamp:ZN,guid:XN,uuid:sx,randomUUID:sx,randomString:ox,randomHexadecimal:rD,randomEmail:eD,randomBoolean:tD,isoTimestamp:aD,timestamp_s:nD,datetime:iD,date:sD,time:oD,base64Encode:lD,base64Decode:uD,urlEncode:cD,urlDecode:fD};function dD(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function mi(t,e){let r=Mv[t];return r?e&&e.length>0?r(...e):r():null}function ax(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?dD(n):void 0,s=mi(r,i);return s===null?e:String(s)}catch{return e}})}function Ps(t,e){let r=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=r.exec(t))!==null;){let s=i[0],a=i[1];if(!(s in e)){let u=mi(a);u!==null&&(n||(n={...e}),n[s]=u)}}return n??e}var Oh=Se(require("vm")),hD=100;function ks(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function As(t,e={}){try{let r={...e,Math,Date,JSON,Number,String,Boolean,Array,Object,parseInt,parseFloat,isNaN,isFinite,encodeURIComponent,decodeURIComponent,encodeURI,decodeURI,undefined:void 0,null:null,true:!0,false:!1,NaN:NaN,Infinity:1/0},n=Oh.createContext(r);return Oh.runInContext(t,n,{timeout:hD,displayErrors:!1})}catch{return}}var Ph=Se(require("crypto"));function pD(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function xl(t){if(!t||!t.includes("|"))return null;let e=mD(t);if(e.length<2)return null;let r=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let a=gD(s);a&&n.push(a)}return n.length===0?null:{input:r,filters:n}}function mD(t){let e=[],r="",n=0,i=!1,s=!1;for(let a=0;a<t.length;a++){let u=t[a],f=a>0?t[a-1]:"",h=a<t.length-1?t[a+1]:"";if(f==="\\"){r+=u;continue}if(u==="'"&&!s)i=!i;else if(u==='"'&&!i)s=!s;else if(u==="("&&!i&&!s)n++;else if(u===")"&&!i&&!s)n--;else if(u==="|"&&n===0&&!i&&!s){if(h==="|"){r+="||",a++;continue}e.push(r),r="";continue}r+=u}return r&&e.push(r),e}function gD(t){let e=t.indexOf("(");if(e===-1)return{name:t.trim(),args:[]};let r=t.substring(0,e).trim(),n=t.substring(e+1,t.lastIndexOf(")"));return{name:r,args:yD(n)}}function yD(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let a=t[s];if((s>0?t[s-1]:"")==="\\"){r+=a;continue}if(a==="'"&&!i){n=!n,r+=a;continue}else if(a==='"'&&!n){i=!i,r+=a;continue}else if(a===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=a}return r.trim()&&e.push(r.trim()),e}function Ct(t,e){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=Number(t);if(!isNaN(r)&&t!=="")return r;if(t==="true")return!0;if(t==="false")return!1;if(e&&t in e){let n=pD(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Cl(t,e,r={}){let n=t;for(let i of e)n=vD(n,i.name,i.args,r);return n}function vD(t,e,r,n){switch(e){case"upper":return String(t).toUpperCase();case"lower":return String(t).toLowerCase();case"trim":return String(t).trim();case"length":return Array.isArray(t)?t.length:String(t).length;case"substring":{let i=Ct(r[0],n),s=r[1]!==void 0?Ct(r[1],n):void 0;return String(t).substring(i<0?String(t).length+i:i,s!==void 0?s<0?String(t).length+s:s:void 0)}case"replace":{let i=r[0]!==void 0?String(Ct(r[0],n)):"",s=r[1]!==void 0?String(Ct(r[1],n)):"";return String(t).replace(new RegExp(bD(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(Ct(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(Ct(r[0],n)):",";return Array.isArray(t)?t.join(i):String(t)}case"removeQuotes":return String(t).replace(/["']/g,"");case"removeSpaces":return String(t).replace(/\s/g,"");case"format":{let i=r[0]!==void 0?String(Ct(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let a=Ct(r[s],n);i=i.replace(`{${s}}`,String(a))}return i}case"add":{let i=Ct(r[0],n);return Number(t)+i}case"subtract":{let i=Ct(r[0],n);return Number(t)-i}case"multiply":{let i=Ct(r[0],n);return Number(t)*i}case"abs":return Math.abs(Number(t));case"btoa":return Buffer.from(String(t)).toString("base64");case"atob":return Buffer.from(String(t),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(t));case"urlDecode":return decodeURIComponent(String(t));case"hash":{let i=String(r[0]!==void 0?Ct(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?Ct(r[1],n):"base64"),u={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return Ph.createHash(u).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(Ct(r[0],n)):"",s=String(r[1]!==void 0?Ct(r[1],n):"sha256").toLowerCase(),a=String(r[2]!==void 0?Ct(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return Ph.createHmac(f,i).update(String(t)).digest(a)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=Ct(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=Ct(r[0],n),s=r[1]!==void 0?Ct(r[1],n):void 0;return Array.isArray(t)?t.slice(i,s):String(t).slice(i,s)}case"unique":return Array.isArray(t)?[...new Set(t)]:t;case"filter":return!Array.isArray(t)||!r[0]?t:SD(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(Ct(s,n)));return i.length===1?t.map(s=>Oc(s,i[0])):t.map(s=>{let a={};for(let u of i){let f=Oc(s,u);f!==void 0&&(a[u]=f)}return a})}case"prop":{let i=r[0]!==void 0?String(Ct(r[0],n)):"";if(Array.isArray(t)){let s=t.map(a=>Oc(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?Oc(t,i):t}case"parseJSON":try{return JSON.parse(String(t))}catch{return t}case"stringify":try{return JSON.stringify(t)}catch{return String(t)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t));case"isUrl":try{return new URL(String(t)),!0}catch{return!1}case"setIfValue":return t||void 0;case"setNull":return t===null?null:t;default:return t}}function SD(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,a]=n,u=Ct(a,r);return t.filter(f=>{let h=Oc(f,i);if(h===void 0)return!1;switch(s){case">":return Number(h)>Number(u);case">=":return Number(h)>=Number(u);case"<":return Number(h)<Number(u);case"<=":return Number(h)<=Number(u);case"=":return String(h)===String(u);case"!=":return String(h)!==String(u);case"*=":return String(h).includes(String(u));case"^=":return String(h).startsWith(String(u));case"$=":return String(h).endsWith(String(u));default:return!0}})}function Oc(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function bD(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function lx(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}var Ts=class{allVariables;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.sessionVariables,...e.variables}}resolveString(e,r=!1){if(typeof e!="string")return e;if(!r)return e.replace(/\{\{([^}]+)\}\}/g,(u,f)=>this.resolveTemplateContent(f.trim(),this.allVariables,u));let n="",i=0,s=/\{\{([^}]+)\}\}/g,a;for(;(a=s.exec(e))!==null;){let u=a[1].trim(),f=this.resolveTemplateContent(u,this.allVariables,a[0]);if(f!==a[0]){n+=e.slice(i,a.index);let h=this.getStringContext(e,a.index);n+=h?this.escapeForString(String(f),h):String(f)}else n+=e.slice(i,a.index+a[0].length);i=a.index+a[0].length}return n+=e.slice(i),n}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};if(!n)return e.replace(/\{\{([^}]+)\}\}/g,(h,g)=>this.resolveTemplateContent(g.trim(),i,h));let s="",a=0,u=/\{\{([^}]+)\}\}/g,f;for(;(f=u.exec(e))!==null;){let h=f[1].trim(),g=this.resolveTemplateContent(h,i,f[0]);if(g!==f[0]){s+=e.slice(a,f.index);let m=this.getStringContext(e,f.index);s+=m?this.escapeForString(String(g),m):String(g)}else s+=e.slice(a,f.index+f[0].length);a=f.index+f[0].length}return s+=e.slice(a),s}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,a]of Object.entries(e))i[s]=this.resolveObjectWithExtra(a,r,n);return i}return e}resolveTemplateContent(e,r,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let u=lx(i[2],r),f=mi(i[1],u);return f!==null?String(f):n}let s=xl(e);if(s){let u=this.resolveFilterInput(s.input,r);if(u!==void 0){let f=Cl(u,s.filters,r);return f!==void 0?String(f):n}return n}let a=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(a){let u=a[1];if(r[u]!==void 0){let f=this.deserializeValue(r[u]),h=a[2],g=this.resolvePropertyAccess(f,h);if(g!==void 0)return typeof g=="object"?JSON.stringify(g):String(g)}}if(r[e]!==void 0){let u=r[e];return typeof u=="string"&&u.charCodeAt(0)===30?u.slice(1):String(u)}if(ks(e)){let u=this.deserializeVariables(r),f=Ps(e,u),h=As(e,f);if(h!==void 0)return String(h)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=lx(n[2],r),a=mi(n[1],s);return a!==null?a:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(r[s]!==void 0){let a=this.deserializeValue(r[s]),u=this.resolvePropertyAccess(a,i[2]);if(u!==void 0)return u}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(ks(e)){let s=this.deserializeVariables(r),a=Ps(e,s),u=As(e,a);if(u!==void 0)return u}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{return e}return e}deserializeVariables(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.deserializeValue(i);return r}resolvePropertyAccess(e,r){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(r))!==null;){if(n==null)return;if(s[1]!==void 0){let a=s[1];/^\d+$/.test(a)?n=n[Number(a)]:n=n[a.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,r){let n=e.replace(/\\/g,"\\\\");return r==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,r){let n=null;for(let i=0;i<r;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},qs=class{interpolate(e,r){return!e||typeof e!="string"?e:new Ts({globals:{},collectionVariables:{},environmentVariables:{},sessionVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{([^}]+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}};function ux(t){return new Ts(t)}var Wi=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new qs,this.urlBuilder=new hn}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=pi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};var _D=Se(require("http")),Pc=Se(require("https")),Nv=require("url"),kh=Se(require("zlib")),pn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},$s=class{settings;version;constructor(e){this.settings={...pn,...e};try{this.version=require("../../package.json").version||"0.0.0"}catch{this.version="0.0.0"}this.settings.strictSSL===!1&&console.log("[NodeHttpClient] SSL verification disabled (strictSSL: false)")}async send(e){let r=this.mergeSettings(e.settings);return await this.executeInternal(e,r,0)}mergeSettings(e){return{timeout:e?.timeout??this.settings.timeout,followRedirects:e?.followRedirects??this.settings.followRedirects,followOriginalMethod:e?.followOriginalMethod??this.settings.followOriginalMethod,followAuthHeader:e?.followAuthHeader??this.settings.followAuthHeader,maxRedirects:e?.maxRedirects??this.settings.maxRedirects,strictSSL:e?.strictSSL??this.settings.strictSSL,decompress:e?.decompress??this.settings.decompress,includeCookies:e?.includeCookies??this.settings.includeCookies}}async executeInternal(e,r,n,i){let s=Date.now(),a=new Nv.URL(e.url),u=a.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(m=>m.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let g={hostname:a.hostname,port:a.port||(u?443:80),path:a.pathname+a.search,method:e.method,headers:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(g.headers["Accept-Encoding"]="gzip, deflate"),u&&(g.rejectUnauthorized=r.strictSSL,r.strictSSL?g.agent=Pc.globalAgent:g.agent=new Pc.Agent({rejectUnauthorized:!1})),new Promise((m,S)=>{if(i?.aborted){let C=new Error("Request cancelled");C.name="AbortError",S(C);return}let x=(u?Pc:_D).request(g,async C=>{let A=C.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(A)){if(n>=r.maxRedirects){S(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let B=C.headers.location;if(!B){S(new Error("Redirect response missing Location header"));return}let Y=new Nv.URL(B,e.url).toString(),H=e.method;!r.followOriginalMethod&&[301,302,303].includes(A)&&(H="GET");let K={...e.headers};r.followAuthHeader||(delete K.authorization,delete K.Authorization);try{let X=await this.executeInternal({...e,url:Y,method:H,headers:K,body:H==="GET"?void 0:e.body},r,n+1,i),k=Date.now();X.time=k-s,m(X)}catch(X){S(X)}return}let T=[];C.on("data",B=>T.push(B)),C.on("end",()=>{let B=Date.now(),Y=Buffer.concat(T),H=C.headers["content-encoding"];if(r.decompress&&H)try{H==="gzip"?Y=kh.gunzipSync(Y):H==="deflate"&&(Y=kh.inflateSync(Y))}catch(P){console.warn("[NodeHttpClient] Decompression failed:",P)}let K=Y.toString("utf-8"),X;try{X=JSON.parse(K)}catch{X=K}let k={};for(let[P,N]of Object.entries(C.headers))(typeof N=="string"||Array.isArray(N))&&(k[P]=N);let w=this.parseCookies(C.headers["set-cookie"],a.hostname);m({status:C.statusCode||0,statusText:C.statusMessage||"",headers:k,cookies:w,body:X,time:B-s,size:Y.length})})});if(i&&i.addEventListener("abort",()=>{x.destroy();let C=new Error("Request cancelled");C.name="AbortError",S(C)}),x.on("error",C=>{S(C)}),x.on("timeout",()=>{x.destroy(),S(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let C=typeof e.body=="string"?e.body:JSON.stringify(e.body);x.write(C)}x.end()})}sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}parseCookies(e,r){return e?e.map(n=>{let i=n.split(";").map(g=>g.trim()),[s,...a]=i,[u,f]=s.split("="),h={name:u.trim(),value:f?.trim()||"",domain:r};for(let g of a){let[m,S]=g.split("=");switch(m.toLowerCase().trim()){case"domain":h.domain=S?.trim();break;case"path":h.path=S?.trim();break;case"expires":h.expires=S?.trim();break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break}}return h}):[]}};function Ah(t){return{timeout:t?.timeout??pn.timeout,followRedirects:t?.followRedirects??pn.followRedirects,followOriginalMethod:t?.followOriginalMethod??pn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??pn.followAuthHeader,maxRedirects:t?.maxRedirects??pn.maxRedirects,strictSSL:t?.strictSSL??pn.strictSSL,decompress:t?.decompress??pn.decompress,includeCookies:t?.includeCookies??pn.includeCookies}}var gi=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=Ah(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,e,n);if(a)return a;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,i,n);if(a)return a;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}};var yi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(a){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,a),a}return i}async executeErrorInterceptors(e,r,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,r,n);if(s)return s}catch(s){console.error(`[InterceptorChain] Error interceptor '${i.name}' failed:`,s)}}clear(){this.requestInterceptors=[],this.responseInterceptors=[],this.errorInterceptors=[]}getRegisteredInterceptors(){return{request:this.requestInterceptors.map(e=>e.name),response:this.responseInterceptors.map(e=>e.name),error:this.errorInterceptors.map(e=>e.name)}}sortByPriority(e){e.sort((r,n)=>(r.priority??100)-(n.priority??100))}},Th=class{name="logging";priority=1e3;intercept(e,r){return e}},qh=class{name="timing";priority=1;intercept(e,r,n){return e}},$h=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,r=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=r}handle(e,r,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}};var Zt=Se(require("crypto")),uB=Se(require("querystring")),KR=Se(require("vm"));var oB=Se(require("crypto")),of=Se(require("fs")),YR=require("module"),_i=Se(require("path"));function lf(){return{format:(t,e)=>{let r=t?new Date(t):new Date;return e==="YYYY-MM-DD"?r.toISOString().split("T")[0]:r.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let t=new Date;return{format:()=>t.toISOString(),toISOString:()=>t.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function Eb(){return{get:(t,e,r)=>{let n=e.split("."),i=t;for(let s of n)if(i=i?.[s],i===void 0)return r;return i},set:(t,e,r)=>{let n=e.split("."),i=t;for(let s=0;s<n.length-1;s++)i[n[s]]||(i[n[s]]={}),i=i[n[s]];return i[n[n.length-1]]=r,t},cloneDeep:t=>JSON.parse(JSON.stringify(t)),keys:t=>Object.keys(t??{}),values:t=>Object.values(t??{}),entries:t=>Object.entries(t??{}),each(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},forEach(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},map:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).map(r=>e(r)),filter:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).filter(r=>e(r)),find:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).find(r=>e(r)),reduce:(t,e,r)=>(Array.isArray(t)?t:Object.values(t??{})).reduce((n,i)=>e(n,i),r),includes:(t,e)=>Array.isArray(t)?t.includes(e):Object.values(t??{}).includes(e),isObject:t=>t!==null&&typeof t=="object"&&!Array.isArray(t),isArray:t=>Array.isArray(t),isString:t=>typeof t=="string",isNumber:t=>typeof t=="number",isFunction:t=>typeof t=="function",isNil:t=>t==null,isEmpty:t=>t==null?!0:Array.isArray(t)||typeof t=="string"?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1,assign:(t,...e)=>Object.assign(t,...e),merge:(t,...e)=>{let r={...t};for(let n of e)for(let[i,s]of Object.entries(n??{}))r[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...r[i]??{},...s}:s;return r},omit:(t,e)=>{let r={...t};for(let n of e)delete r[n];return r},pick:(t,e)=>{let r={};for(let n of e)n in(t??{})&&(r[n]=t[n]);return r}}}var af=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:El}),crypto:()=>oB,path:()=>_i,querystring:()=>require("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>cx(),Eb),moment:()=>this.loadOptionalModule("moment",()=>fx(),lf),tv4:()=>this.loadOptionalModule("tv4",()=>hx()),ajv:()=>this.loadOptionalModule("ajv",()=>WR()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>require("crypto-js"),()=>{throw new Error('crypto-js npm module is not installed. The built-in CryptoJS global is already available in scripts with AES/DES/TripleDES/hash/HMAC/PBKDF2 support. If you need the exact npm package, add "crypto-js" to your modules/package.json and run npm install.')})};constructor(e=[],r={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...r,outputChannel:r.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e)if(this.initializeModules(n)){this.modulesPath=n;break}}loadOptionalModule(e,r,n){try{return r()}catch{if(this.customModulesRequire)try{return console.debug(`[ModuleLoader] ${e} not in core, trying user modules`),this.customModulesRequire(e)}catch{this.logModuleWarning(e,"user")}else this.logModuleWarning(e,"core");if(n)return console.warn(`[ModuleLoader] Using shim for ${e}. Some features may be limited.`),n();throw new Error(this.getModuleInstallInstructions(e))}}logModuleWarning(e,r){let i={moment:"Date/time manipulation",lodash:"Utility functions",tv4:"JSON Schema validation (v4)",ajv:"JSON Schema validation"}[e]||e;console.warn(`[ModuleLoader] ${i} functionality (${e}) is not available.
|
|
211
211
|
${this.getModuleInstallInstructions(e)}`)}getModuleInstallInstructions(e){let n={moment:"^2.30.1",lodash:"^4.17.21",tv4:"^1.3.0",ajv:"^8.17.1"}[e]||"latest";return`To use ${e}, add it to http-forge/modules/package.json:
|
|
212
212
|
{
|
|
213
213
|
"dependencies": {
|
|
214
214
|
"${e}": "${n}"
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
Then run: cd http-forge/modules && npm install`}initializeModules(e){if(this.logDebug("Initializing module loader..."),!this.options.allowCustomModules)return this.logDebug("Custom modules disabled by configuration"),!0;try{let r=
|
|
218
|
-
Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}finally{this.resolveStack.delete(e)}}}getModuleSuggestions(e){let r=this.getAvailableModules(),n=[];for(let i of r)if(i.startsWith(e.substring(0,3))&&(n.push(i),n.length>=3))break;return n}cacheModule(e,r,n,i){this.moduleCache.set(e,{module:r,source:n,resolveTime:i}),i>100&&this.logDebug(`Slow module load: ${e} took ${i}ms`)}getGlobalSetupExports(){return this.globalSetupExports}hasCustomModules(){return this.customModulesRequire!==void 0}getAvailableModules(){return[...Object.keys(this.builtinModules),...Array.from(this.availableModules)].sort()}clearCache(){this.moduleCache.clear(),this.logDebug("Module cache cleared")}getCacheStats(){return{size:this.moduleCache.size,hits:0}}logDebug(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader] ${e}`)}logError(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader ERROR] ${e}`),console.error(`[ModuleLoader ERROR] ${e}`)}};function
|
|
217
|
+
Then run: cd http-forge/modules && npm install`}initializeModules(e){if(this.logDebug("Initializing module loader..."),!this.options.allowCustomModules)return this.logDebug("Custom modules disabled by configuration"),!0;try{let r=_i.join(e,"package.json");return of.existsSync(r)?(this.customModulesRequire=(0,YR.createRequire)(r),this.loadAvailableModules(e),this.loadGlobalSetup(e),this.logDebug(`Module loader initialized with ${this.availableModules.size} workspace modules`),!0):(this.logDebug(`No modules/package.json found at ${e}`),!1)}catch(r){return console.error("Failed to initialize modules:",r),!1}}loadAvailableModules(e){try{let r=_i.join(e,"package.json"),n=of.readFileSync(r,"utf-8"),i=JSON.parse(n);if(typeof i!="object"||i===null)throw new Error("Invalid package.json: must be an object");let s=i.dependencies||{},a=i.devDependencies||{};if(typeof s!="object"||typeof a!="object")throw new Error("Invalid dependencies in package.json");Object.keys(s).forEach(u=>{typeof u=="string"&&u.trim()&&this.availableModules.add(u.trim())}),Object.keys(a).forEach(u=>{typeof u=="string"&&u.trim()&&this.availableModules.add(u.trim())}),this.logDebug(`Loaded ${this.availableModules.size} modules from package.json`)}catch(r){let n=`Failed to load workspace modules from package.json: ${r instanceof Error?r.message:r}`;this.logError(n)}}loadGlobalSetup(e){let r=_i.join(e,"global-setup.js");if(of.existsSync(r))try{this.customModulesRequire&&(this.globalSetupExports=this.customModulesRequire("./global-setup.js"))}catch(n){console.error("Failed to load global-setup.js:",n),this.globalSetupExports=void 0}}createRequireFunction(){return e=>{let r=Date.now();try{if(this.resolveStack.has(e))throw new Error(`Circular dependency detected: ${Array.from(this.resolveStack).join(" -> ")} -> ${e}`);if(this.resolveStack.size>=this.options.maxResolveDepth)throw new Error(`Maximum module resolve depth (${this.options.maxResolveDepth}) exceeded`);this.resolveStack.add(e);let n=this.moduleCache.get(e);if(n)return this.logDebug(`Module cache hit: ${e}`),n.module;if(this.builtinModules[e]){this.logDebug(`Loading built-in module: ${e}`);let a=this.builtinModules[e]();return this.cacheModule(e,a,"builtin",Date.now()-r),a}if(!this.modulesPath)throw new Error("Module loading is not initialized. No valid modules/ directory found. Create http-forge-assets/modules/package.json first.");if(e.startsWith("./")||e.startsWith("../")){if(!this.customModulesRequire)throw new Error(`Cannot load local module '${e}': No modules/ folder found. Create http-forge-assets/modules/package.json first.`);let a=_i.resolve(this.modulesPath,e),u=_i.normalize(a),f=_i.normalize(this.modulesPath);if(!u.startsWith(f))throw new Error(`Security violation: Attempt to load module outside modules directory: ${e}`);try{this.logDebug(`Loading relative module: ${e}`);let h=this.customModulesRequire(e);return this.cacheModule(e,h,"relative",Date.now()-r),h}catch(h){throw new Error(`Failed to load local module '${e}': ${h.message}`)}}if(this.availableModules.has(e)&&this.customModulesRequire)try{this.logDebug(`Loading workspace module: ${e}`);let a=this.customModulesRequire(e);return this.cacheModule(e,a,"workspace",Date.now()-r),a}catch(a){throw new Error(`Module '${e}' is in package.json but failed to load: ${a.message}`)}let i=this.getModuleSuggestions(e),s=`Module '${e}' is not available.`;throw i.length>0&&(s+=` Did you mean: ${i.join(", ")}?`),s+=`
|
|
218
|
+
Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}finally{this.resolveStack.delete(e)}}}getModuleSuggestions(e){let r=this.getAvailableModules(),n=[];for(let i of r)if(i.startsWith(e.substring(0,3))&&(n.push(i),n.length>=3))break;return n}cacheModule(e,r,n,i){this.moduleCache.set(e,{module:r,source:n,resolveTime:i}),i>100&&this.logDebug(`Slow module load: ${e} took ${i}ms`)}getGlobalSetupExports(){return this.globalSetupExports}hasCustomModules(){return this.customModulesRequire!==void 0}getAvailableModules(){return[...Object.keys(this.builtinModules),...Array.from(this.availableModules)].sort()}clearCache(){this.moduleCache.clear(),this.logDebug("Module cache cleared")}getCacheStats(){return{size:this.moduleCache.size,hits:0}}logDebug(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader] ${e}`)}logError(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader ERROR] ${e}`),console.error(`[ModuleLoader ERROR] ${e}`)}};function mp(t,e){return new af(t,e)}var xb=Se(require("vm"));function aB(t){let e={...t};return e.get=r=>{let n=r.toLowerCase();for(let[i,s]of Object.entries(t))if(i.toLowerCase()===n)return s},e.has=r=>{let n=r.toLowerCase();return Object.keys(t).some(i=>i.toLowerCase()===n)},e.toObject=()=>({...t}),e.each=r=>{for(let[n,i]of Object.entries(t))r({key:n,value:i})},e}function gp(t){let e=aB(t.headers);return{status:t.status,code:t.status,statusText:t.statusText,headers:e,body:t.body,cookies:t.cookies||{},responseTime:t.responseTime,responseSize:t.responseSize,getHeader(r){let n=r.toLowerCase();for(let[i,s]of Object.entries(t.headers))if(i.toLowerCase()===n)return s},getCookie(r){return t.cookies?.[r]},reason(){return this.statusText},json(){if(typeof this.body=="object")return this.body;try{return JSON.parse(this.body)}catch{return null}},text(){return typeof this.body=="string"?this.body:JSON.stringify(this.body)},cookie(r){return this.cookies?.[r]},hasCookie(r){return this.cookies?r in this.cookies:!1},to:{have:{status(r){if(t.status!==r)throw new Error(`Expected status ${r} but got ${t.status}`)},header(r,n){let i=t.headers[r]||t.headers[r.toLowerCase()];if(!i)throw new Error(`Expected header "${r}" to exist`);if(n!==void 0&&i!==n)throw new Error(`Expected header "${r}" to be "${n}" but got "${i}"`)},body(r){let n=typeof t.body=="string"?t.body:JSON.stringify(t.body);if(r!==void 0&&n!==r)throw new Error(`Expected body to be "${r}" but got "${n}"`)},jsonBody(r){let n=typeof t.body=="object"?t.body:JSON.parse(t.body);if(r!==void 0&&JSON.stringify(n)!==JSON.stringify(r))throw new Error("Expected JSON body to match")}},be:{get ok(){if(t.status<200||t.status>=300)throw new Error(`Expected response to be OK (2xx) but got ${t.status}`);return(()=>{})},get success(){if(t.status<200||t.status>=300)throw new Error(`Expected response to be successful (2xx) but got ${t.status}`);return(()=>{})},get error(){if(t.status<400)throw new Error(`Expected response to be error (4xx/5xx) but got ${t.status}`);return(()=>{})},get clientError(){if(t.status<400||t.status>=500)throw new Error(`Expected response to be client error (4xx) but got ${t.status}`);return(()=>{})},get serverError(){if(t.status<500||t.status>=600)throw new Error(`Expected response to be server error (5xx) but got ${t.status}`);return(()=>{})}}}}}function Vl(t){return{_value:t,_negated:!1,_deep:!1,get not(){return this._negated=!this._negated,this},get to(){return this},get be(){return this},get have(){return this},get deep(){return this._deep=!0,this},_assert(r,n){if(!(this._negated?!r:r))throw new Error(n)},equal(r){return this._deep?(this._deep=!1,this.eql(r)):(this._assert(this._value===r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}equal ${JSON.stringify(r)}`),this)},eql(r){let n=JSON.stringify(this._value)===JSON.stringify(r);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}deeply equal ${JSON.stringify(r)}`),this},property(r,n){let i=typeof this._value=="object"&&this._value!==null&&r in this._value;return n!==void 0?this._assert(i&&this._value[r]===n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}" with value ${JSON.stringify(n)}`):this._assert(i,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}"`),this},get ok(){return this._assert(!!this._value,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be truthy`),this},get exist(){return this._assert(this._value!==null&&this._value!==void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}exist`),this},include(r){let n=!1;return typeof this._value=="string"?n=this._value.includes(r):Array.isArray(this._value)?n=this._value.includes(r):typeof this._value=="object"&&this._value!==null&&(n=r in this._value),this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}include ${JSON.stringify(r)}`),this},oneOf(r){let n=Array.isArray(r)&&r.includes(this._value);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be one of ${JSON.stringify(r)}`),this},match(r){let n=r.test(String(this._value));return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}match ${r}`),this},above(r){return this._assert(Number(this._value)>r,`Expected ${this._value} to ${this._negated?"not ":""}be above ${r}`),this},below(r){return this._assert(Number(this._value)<r,`Expected ${this._value} to ${this._negated?"not ":""}be below ${r}`),this},greaterThan(r){return this.above(r)},lessThan(r){return this.below(r)},within(r,n){let i=Number(this._value);return this._assert(i>=r&&i<=n,`Expected ${this._value} to ${this._negated?"not ":""}be within ${r}..${n}`),this},get true(){return this._assert(this._value===!0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be true`),this},get false(){return this._assert(this._value===!1,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be false`),this},get null(){return this._assert(this._value===null,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be null`),this},get undefined(){return this._assert(this._value===void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be undefined`),this},get empty(){let r=!1;return this._value===null||this._value===void 0?r=!0:typeof this._value=="string"||Array.isArray(this._value)?r=this._value.length===0:typeof this._value=="object"&&(r=Object.keys(this._value).length===0),this._assert(r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be empty`),this},length(r){let n=Array.isArray(this._value)||typeof this._value=="string"?this._value.length:Object.keys(this._value||{}).length;return this._assert(n===r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have length ${r}`),this},lengthOf(r){return this.length(r)},a(r){let n=Array.isArray(this._value)?"array":typeof this._value;return this._assert(n===r.toLowerCase(),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be a(n) ${r} (got ${n})`),this},an(r){return this.a(r)},members(r){let n=this._value,i=Array.isArray(n)&&Array.isArray(r)&&r.every(s=>n.some(a=>JSON.stringify(a)===JSON.stringify(s)));return this._assert(i,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have members ${JSON.stringify(r)}`),this},keys(...r){let n=Array.isArray(r[0])?r[0]:r,i=Object.keys(this._value||{}),s=n.every(a=>i.includes(a));return this._assert(s,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have keys ${JSON.stringify(n)}`),this},string(r){return this._assert(typeof this._value=="string"&&this._value.includes(r),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}contain string "${r}"`),this}}}function uf(t){return typeof t=="string"?t:t.filter(e=>e&&e.trim()).join(`
|
|
219
219
|
|
|
220
220
|
// --- Next Script ---
|
|
221
221
|
|
|
222
|
-
`)}function Dl(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Zc(t){return t.map(e=>{let r=e.args.map(n=>{if(typeof n=="object")try{return JSON.stringify(n,null,2)}catch{return String(n)}return String(n)}).join(" ");return`[${e.level}] ${r}`})}function HR(t){return{log:(...e)=>t.push({level:"log",args:e}),info:(...e)=>t.push({level:"info",args:e}),warn:(...e)=>t.push({level:"warn",args:e}),error:(...e)=>t.push({level:"error",args:e})}}function bp(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let a=s.then(()=>{t.push({name:n,passed:!0})},u=>{t.push({name:n,passed:!1,message:u.message||String(u)})});e.push(a)}else t.push({name:n,passed:!0})}catch(s){t.push({name:n,passed:!1,message:s.message})}};return r._pendingTests=e,r}function _p(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function LU(t){let e=null;try{e=new URL(t)}catch{}return{toString(){return t},valueOf(){return t},[Symbol.toPrimitive](n){return n==="number"?NaN:t},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:t},getPathWithQuery(){return e?e.pathname+e.search:t},getQueryString(){return e?e.search.startsWith("?")?e.search.slice(1):e.search:""},getRemote(){if(!e)return"";let n=e.port||(e.protocol==="https:"?"443":"80");return`${e.hostname}:${n}`},getOAuth1BaseUrl(){return e?`${e.protocol}//${e.host}${e.pathname}`:t},get protocol(){return e?.protocol?.replace(":","")||""},get host(){return e?e.hostname.split("."):[]},get port(){return e?.port||""},get path(){return e?e.pathname.split("/").filter(Boolean):[]},get hash(){return e?.hash?.replace("#","")||""},query:{toObject(){if(!e)return{};let n={};return e.searchParams.forEach((i,s)=>{n[s]=i}),n},has(n){return e?e.searchParams.has(n):!1},get(n){return e?e.searchParams.get(n):void 0},each(n){e&&e.searchParams.forEach((i,s)=>n({key:s,value:i}))}}}}var Fl=class{constructor(e,r){this.deps=e;this.initialContext=r;this.initializeSession()}vmContext=null;ctx=null;modifiedRequest=null;assertions=[];consoleMessages=[];_variables={};_collectionVariables={};_globals={};_environmentVariables={};_liveEnvironmentScope=null;_liveGlobalsScope=null;_liveCollectionScope=null;_nextRequest=void 0;_skipRequest=!1;_visualizerData=void 0;initializeSession(){this.modifiedRequest={url:this.initialContext.request.url,method:this.initialContext.request.method,headers:{...this.initialContext.request.headers},body:this.initialContext.request.body?{...this.initialContext.request.body}:null,params:this.initialContext.request.params?{...this.initialContext.request.params}:{},query:this.initialContext.request.query?{...this.initialContext.request.query}:{}},this.assertions=[],this.ctx=this.createSharedContext(),this.consoleMessages=[];let e=this,r={log:(...n)=>{e.consoleMessages.push({level:"log",args:n})},info:(...n)=>{e.consoleMessages.push({level:"info",args:n})},warn:(...n)=>{e.consoleMessages.push({level:"warn",args:n})},error:(...n)=>{e.consoleMessages.push({level:"error",args:n})}};this.vmContext=this.deps.createVM(this.ctx,r)}createSharedContext(){let e=this.initialContext,r=this.modifiedRequest,n=this.deps.createCommonContext(e,"prerequest");this._variables={...e.variables},this._collectionVariables={...e.collectionVariables||{}},this._globals={...e.globals||{}},this._environmentVariables={...e.environmentVariables||{}},this._liveEnvironmentScope=n.environment,this._liveGlobalsScope=n.globals,this._liveCollectionScope=n.collectionVariables;let i;try{i=new URL(e.request.url).hostname}catch{}let s={get:u=>e.cookieJar?e.cookieJar.get(u,i)?.value:void 0,set:(u,f)=>{e.cookieJar&&e.cookieJar.set({name:u,value:f,domain:i})},has:u=>e.cookieJar?e.cookieJar.has(u,i):!1,list:()=>e.cookieJar?e.cookieJar.getAll(i).map(u=>({name:u.name,value:u.value})):[],toObject:()=>{if(!e.cookieJar)return{};let u=e.cookieJar.getAll(i),f={};for(let h of u)f[h.name]=h.value;return f},jar:()=>{let u=e.cookieJar;return{getAll(f,h){try{if(!u){h(null,[]);return}let g=u.getAll(f).map(m=>({name:m.name,value:m.value,domain:m.domain,path:m.path,httpOnly:m.httpOnly,secure:m.secure}));h(null,g)}catch(g){h(g,[])}},get(f,h,g){try{if(!u){g(null,void 0);return}let m=u.get(h,f);g(null,m?{name:m.name,value:m.value,domain:m.domain}:void 0)}catch(m){g(m,void 0)}},set(f,h,g,m){try{if(!u){(m||g)?.(null);return}typeof h=="string"&&typeof g=="string"?(u.set({name:h,value:g,domain:f}),m?.(null)):typeof h=="object"&&(u.set({...h,domain:f}),g?.(null))}catch(S){(m||g)?.(S)}},unset(f,h,g){try{if(!u){g?.(null);return}u.delete(h,f),g?.(null)}catch(m){g?.(m)}},clear(f){try{if(!u){f?.(null);return}u.clear(),f?.(null)}catch(h){f?.(h)}}}},remove:u=>{e.cookieJar&&e.cookieJar.delete(u,i)},unset:u=>{e.cookieJar&&e.cookieJar.delete(u,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},a=this;return{request:this.createRequestObject(r,e),response:null,test:bp(this.assertions),expect:Nl,cookies:s,execution:{setNextRequest(u){a._nextRequest=u},skipRequest(){a._skipRequest=!0},location:n.info?.requestName||""},setNextRequest(u){a._nextRequest=u},visualizer:{set(u,f){a._visualizerData={template:u,data:f}},clear(){a._visualizerData=void 0}},...n,info:{...n.info||{},eventName:"prerequest",requestName:n.info?.requestName||void 0,requestId:n.info?.requestId||void 0,iteration:e.iteration||0,iterationCount:e.iterationCount||1}}}createRequestObject(e,r){let n=u=>{if(!u)return"none";switch(u){case"raw":return"raw";case"form-data":return"formdata";case"x-www-form-urlencoded":return"urlencoded";case"binary":return"file";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},i=u=>{if(!u)return"none";switch(u){case"raw":return"raw";case"formdata":return"form-data";case"urlencoded":return"x-www-form-urlencoded";case"file":return"binary";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},s={...e.headers,add:u=>{u&&u.key&&(e.headers[u.key]=u.value||"")},get:u=>{for(let[f,h]of Object.entries(e.headers))if(f.toLowerCase()===u.toLowerCase())return h},has:u=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.toLowerCase())return!0;return!1},remove:u=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.toLowerCase()){delete e.headers[f];break}},update:u=>{if(u&&u.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.key.toLowerCase()){e.headers[f]=u.value||"";return}}},upsert:u=>{if(u&&u.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.key.toLowerCase()){e.headers[f]=u.value||"";return}e.headers[u.key]=u.value||""}},toObject:()=>{let u={};for(let[f,h]of Object.entries(e.headers))typeof h=="string"&&(u[f]=h);return u},each:u=>{for(let[f,h]of Object.entries(e.headers))typeof h=="string"&&u({key:f,value:h})}},a={get mode(){return n(e.body?.type)},set mode(u){let f=i(u);e.body?e.body.type=f:e.body={type:f,content:null}},get raw(){let u=e.body?.content;return typeof u=="string"?u:u&&typeof u=="object"?JSON.stringify(u):""},set raw(u){e.body?(e.body.type="raw",e.body.content=u):e.body={type:"raw",content:u}},get formdata(){return e.body?.type==="form-data"&&Array.isArray(e.body.content)?e.body.content:[]},get urlencoded(){return e.body?.type==="x-www-form-urlencoded"&&Array.isArray(e.body.content)?e.body.content:[]},get graphql(){return e.body?.type==="graphql"?e.body.content:null},get file(){return e.body?.type==="binary"?e.body.content:null}};return{get url(){return LU(e.url)},set url(u){e.url=typeof u=="string"?u:String(u)},get method(){return e.method},set method(u){e.method=u},headers:s,get body(){return a},set body(u){if(u==null)e.body=null;else if(typeof u=="string")e.body={type:"raw",content:u};else if(typeof u=="object")if(u.type||u.mode||u.content!==void 0){let f=u.mode?i(u.mode):u.type||"raw";e.body={type:f,format:u.format,content:u.content}}else e.body={type:"raw",content:u}},get params(){return e.params||{}},set params(u){e.params=u||{}},get query(){return e.query||{}},set query(u){e.query=u||{}},get auth(){return r.request?.auth||null},set auth(u){r.request&&(r.request.auth=u)},get certificate(){return r.request?.certificate||null},set certificate(u){r.request&&(r.request.certificate=u)},get description(){return r.request?.description||null},set description(u){r.request&&(r.request.description=u)},get name(){return r.request?.name||null},set name(u){r.request&&(r.request.name=u)},get id(){return r.request?.id||null},get disabled(){return r.request?.disabled||!1},set disabled(u){r.request&&(r.request.disabled=u)},get messages(){return r.request?.messages||[]},get methodPath(){return r.request?.methodPath||null},get metadata(){return r.request?.metadata||[]},getHeaders(u){let f={};for(let[h,g]of Object.entries(e.headers))typeof g=="string"&&(f[h]=g);return f},addQueryParams(u){if(typeof u=="string"){let f=new URLSearchParams(u);for(let[h,g]of f)e.query||(e.query={}),e.query[h]=g}else Array.isArray(u)&&(e.query||(e.query={}),u.forEach(f=>{f.key&&(e.query[f.key]=f.value||"")}))},removeQueryParams(u){e.query&&(typeof u=="string"?delete e.query[u]:Array.isArray(u)&&u.forEach(f=>{let h=typeof f=="string"?f:f.key;h&&delete e.query[h]}))},authorizeUsing(u,f){r.request&&(typeof u=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=u,f&&(r.request.auth.parameters=f)):typeof u=="object"&&(r.request.auth=u))},clone(){return{url:e.url,method:e.method,headers:{...e.headers},body:e.body?{...e.body}:null,params:e.params?{...e.params}:{},query:e.query?{...e.query}:{},auth:r.request?.auth,certificate:r.request?.certificate,description:r.request?.description,name:r.request?.name,id:r.request?.id,disabled:r.request?.disabled,metadata:r.request?.metadata,messages:r.request?.messages,methodPath:r.request?.methodPath}},describe(u,f){r.request&&(r.request.description={content:u,type:f||"text/plain"})},setHeader(u,f){e.headers[u]=f},removeHeader(u){delete e.headers[u]},setBody(u,f,h){e.body={type:f||e.body?.type||"raw",format:h||e.body?.format,content:u}}}}async executePreRequest(e){let r=Qc(e);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0;let n=this.ctx.variables.replaceIn(r);xb.runInContext(n,this.vmContext,{timeout:5e3});let i=Zc(this.consoleMessages),s=this.initialContext.request.body,a=!this.bodiesEqual(this.modifiedRequest.body,s);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:Dl(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:a?this.modifiedRequest.body:void 0,params:Dl(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:Dl(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:i.length>0?i:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:[`[error] Script execution failed: ${n.message}`],modifiedVariables:this.ctx?.variables?.toObject(),modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,r){let n=Qc(e);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=Sp(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.vmContext.responseBody=r.body??"";let i=this;this.vmContext.tests=new Proxy({},{set(u,f,h){return i.assertions.push({name:String(f),passed:!!h,message:h?void 0:`"${String(f)}" was false`}),!0}});let s=this.ctx.variables.replaceIn(n);xb.runInContext(s,this.vmContext,{timeout:5e3}),this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0);let a=Zc(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:a.length>0?a:void 0,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){return this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"}),{testResults:[...this.assertions],consoleOutput:[`[error] Script execution failed: ${i.message}`],modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.vmContext=null,this.ctx=null,this.assertions=[]}};function YR(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function JR(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function UU(t,e){if(t==="@")return"";if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=t.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(r){let n=YR(r[2],e),i=vi(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return JR(e[t]);if(Ls(t)){let n=Fs(t,e),i=js(t,n);if(i!==void 0)return i}}var Le=class t{_buffer;constructor(e){this._buffer=typeof e=="string"?Buffer.from(e,"utf8"):e}toString(e){return e?e.stringify(this):this._buffer.toString("hex")}toBuffer(){return this._buffer}static fromHex(e){return new t(Buffer.from(e,"hex"))}static fromBase64(e){return new t(Buffer.from(e,"base64"))}static fromUtf8(e){return new t(Buffer.from(e,"utf8"))}};function VR(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],a=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)a=er.createHash("md5").update(Buffer.concat([a,i])).digest(),s.push(a);let u=Buffer.concat(s);return{key:u.subarray(0,e),iv:u.subarray(e,e+r)}}function Rb(t,e,r){let n=i=>t==="aes"?`aes-${i*8}-cbc`:t==="des"?"des-cbc":t==="des-ede3"?"des-ede3-cbc":t;return{encrypt(i,s,a){let u=i instanceof Le?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=er.randomBytes(8),{key:h,iv:g}=VR(s,e,r,f),m=er.createCipheriv(n(e),h,g),S=Buffer.concat([m.update(u),m.final()]),_=Buffer.concat([Buffer.from("Salted__"),f,S]);return{ciphertext:new Le(S),salt:new Le(f),toString:C=>C?C.stringify(new Le(_)):_.toString("base64")}}else{let f=s.toBuffer(),h=a?.iv&&a.iv instanceof Le?a.iv.toBuffer():Buffer.alloc(r),g=er.createCipheriv(n(f.length),f,h);a?.padding===!1&&g.setAutoPadding(!1);let m=Buffer.concat([g.update(u),g.final()]);return{ciphertext:new Le(m),toString:S=>S?S.stringify(new Le(m)):m.toString("base64")}}},decrypt(i,s,a){if(typeof s=="string"){let u=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,h;u.subarray(0,8).toString()==="Salted__"?(h=u.subarray(8,16),f=u.subarray(16)):(h=Buffer.alloc(0),f=u);let{key:g,iv:m}=VR(s,e,r,h),S=er.createDecipheriv(n(e),g,m);return new Le(Buffer.concat([S.update(f),S.final()]))}else{let u=s.toBuffer(),f=a?.iv&&a.iv instanceof Le?a.iv.toBuffer():Buffer.alloc(r),h=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),g=er.createDecipheriv(n(u.length),u,f);return a?.padding===!1&&g.setAutoPadding(!1),new Le(Buffer.concat([g.update(h),g.final()]))}}}}function BU(){let t=r=>n=>{let i=n instanceof Le?n.toBuffer():Buffer.from(String(n),"utf8");return new Le(er.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof Le?n.toBuffer():Buffer.from(String(n),"utf8"),a=i instanceof Le?i.toBuffer():Buffer.from(String(i),"utf8");return new Le(er.createHmac(r,a).update(s).digest())};return{MD5:t("md5"),SHA1:t("sha1"),SHA224:t("sha224"),SHA256:t("sha256"),SHA384:t("sha384"),SHA512:t("sha512"),SHA3:t("sha3-256"),RIPEMD160:t("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:Rb("aes",32,16),DES:Rb("des",8,8),TripleDES:Rb("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof Le?r.toBuffer():Buffer.from(String(r),"utf8"),a=n instanceof Le?n.toBuffer():Buffer.from(String(n),"utf8"),u=(i?.keySize||4)*4,f=i?.iterations||1;return new Le(er.pbkdf2Sync(s,a,f,u,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>Le.fromBase64(r)},Utf8:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>Le.fromUtf8(r)},Hex:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>Le.fromHex(r)},Latin1:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new Le(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new Le(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new Le(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new Le(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new Le(r):new Le(Buffer.from(String(r))):new Le(Buffer.alloc(0)),random:r=>new Le(er.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var Ri=class t{constructor(e,r=[]){this.httpService=e;this.moduleLoader=vp(r)}moduleLoader;createRequestSession(e){return new Fl({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this)},e)}createVM(e,r){let n=this.moduleLoader.getGlobalSetupExports(),i=this.moduleLoader.createRequireFunction(),s={ctx:e,hf:e,pm:e,console:r,...n||{},global:n,setTimeout,setInterval,clearTimeout,clearInterval,URL,URLSearchParams,Buffer,atob:a=>Buffer.from(a,"base64").toString("binary"),btoa:a=>Buffer.from(a,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:er,_:i("lodash"),require:i,moment:Gc(),querystring:jU,CryptoJS:BU(),postman:{setNextRequest:a=>e.setNextRequest?.(a),setGlobalVariable:(a,u)=>e.globals?.set(a,u),getGlobalVariable:a=>e.globals?.get(a),clearGlobalVariable:a=>e.globals?.unset(a),setEnvironmentVariable:(a,u)=>e.environment?.set(a,u),getEnvironmentVariable:a=>e.environment?.get(a),clearEnvironmentVariable:a=>e.environment?.unset(a)},jsonStringify:(a,u,f)=>JSON.stringify(a,u,f),jsonParse:a=>JSON.parse(a),xml2Json:a=>{try{let u=this.moduleLoader.createRequireFunction()("xml2js"),f;return u.parseString(a,{explicitArray:!1},(h,g)=>{if(h)throw h;f=g}),f}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return WR.createContext(s)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},a={...e.environmentVariables||{}},u=e.iterationData||{},f=this.createMergedVariableScope(n,a,i,s,u),h=this.createVariableScope(s),g=this.createVariableScope(i),m=this.createEnvironmentScope(a,e.environmentName,e.onEnvironmentChange,!0),S={...m,set:(C,x)=>{let A=this.serializeValue(x);m.set(C,A),n[C]=A},unset(C){m.unset(C),delete n[C]},clear(){m.clear();for(let C of Object.keys(a))delete n[C]}};return h.replaceIn=f.replaceIn,g.replaceIn=f.replaceIn,S.replaceIn=f.replaceIn,{globals:h,collectionVariables:g,variables:f,environment:S,session:S,iterationData:{get:C=>u[C],has:C=>C in u,toObject:()=>({...u}),toJSON:()=>JSON.stringify(u)},sendRequest:this.createSendRequest(),expect:Nl,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{}return e}}createVariableScope(e){return{get:r=>this.deserializeValue(e[r]),set:(r,n)=>{e[r]=this.serializeValue(n)},has(r){return r in e},unset(r){delete e[r]},clear(){Object.keys(e).forEach(r=>delete e[r])},toObject(){return{...e}}}}createMergedVariableScope(e,r,n,i,s={}){let a={get:u=>u in e?this.deserializeValue(e[u]):u in s?s[u]:u in r?this.deserializeValue(r[u]):u in n?this.deserializeValue(n[u]):this.deserializeValue(i[u]),set:(u,f)=>{e[u]=this.serializeValue(f)},has(u){return u in e||u in s||u in r||u in r||u in n||u in i},unset(u){delete e[u]},clear(){Object.keys(e).forEach(u=>delete e[u])},toObject(){return{...i,...n,...r,...s,...e}},replaceIn(u){if(!u||typeof u!="string")return u;let f=a.toObject();return u.replace(/\{\{([^}]+)\}\}/g,(h,g)=>{let m=g.trim(),S=m.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(S)try{let x=YR(S[2],f),A=vi(S[1],x);return A!==null?String(A):h}catch{return h}let _=vl(m);if(_){let x=UU(_.input,f);if(x!==void 0){let A=Sl(x,_.filters,f);return A!==void 0?String(A):h}return h}let C=a.get(m);if(C!==void 0)return String(C);if(Ls(m)){let x={};for(let[j,Y]of Object.entries(f))x[j]=JR(Y);let A=Fs(m,x),T=js(m,A);if(T!==void 0)return String(T)}return h})}};return a}createEnvironmentScope(e,r,n,i){let s=(a,u,f)=>{n&&(i?n(a,u,f):n(u||"",a==="set"?f:void 0))};return{name:r||"",get:a=>this.deserializeValue(e[a]),set:(a,u)=>{let f=this.serializeValue(u);e[a]=f,s("set",a,f)},has(a){return a in e},unset(a){delete e[a],s("unset",a)},clear(){Object.keys(e).forEach(a=>delete e[a]),s("clear")},toObject(){return{...e}}}}createSendRequest(){return this.httpService?(e,r)=>{let n=typeof e=="string"?{url:e,method:"GET"}:e,i=this.httpService.execute({url:n.url,method:n.method||"GET",headers:n.headers||{},body:n.body,...n});if(r){i.then(s=>r(null,s)).catch(s=>r(s,null));return}return i}:(e,r)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(r){r(n,null);return}return Promise.reject(n)}}};var Xo=class{constructor(e,r,n,i,s){this.httpClient=e;this.forgeEnv=r;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let a=s?.forgeRoot?[require("path").join(s.forgeRoot,"modules")]:[],u=new Si(new fn,new bi,e);this.scriptExecutor=new Ri(u,a)}}scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},a={...n.additionalVariables||{}},u={...s},f=this.buildHttpRequest(e,n.overrides),h=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,h),m={request:{url:f.url,method:f.method,headers:{...f.headers},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:void 0},variables:a,collectionVariables:r.variables||{},globals:{},sessionVariables:{},environmentVariables:u,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onSessionChange:n.onSessionChange,onEnvironmentChange:n.onEnvironmentChange},S=this.scriptExecutor.createRequestSession(m),_,C;try{if(!n.skipPreRequest&&g.preRequest.length>0){let T=await S.executePreRequest(g.preRequest);if(_={success:T.success,error:T.error,modifiedVariables:T.modifiedVariables,modifiedEnvironment:T.modifiedEnvironmentVariables,modifiedGlobals:T.modifiedGlobals,modifiedCollectionVariables:T.modifiedCollectionVariables,consoleOutput:T.consoleOutput,modifiedRequest:T.modifiedRequest?{url:T.modifiedRequest.url,method:T.modifiedRequest.method,headers:T.modifiedRequest.headers,body:T.modifiedRequest.body?.content}:void 0},T.modifiedVariables&&(a={...a,...T.modifiedVariables}),T.modifiedEnvironmentVariables&&(u={...u,...T.modifiedEnvironmentVariables}),T.modifiedRequest){let j=T.modifiedRequest;j.url&&(f.url=j.url),j.method&&(f.method=j.method),j.headers&&(f.headers={...f.headers,...j.headers}),j.body!==void 0&&(f.body=j.body?.content||j.body)}if(!T.success)throw new Error(`Pre-request script failed: ${T.error}`)}let x={...u,...a};f=this.interpolateRequest(f,x);let A=await this.httpClient.send(f);if(!n.skipPostResponse&&g.postResponse.length>0){let T=await S.executePostResponse(g.postResponse,{status:A.status,statusText:A.statusText,headers:A.headers,body:A.body,cookies:Object.fromEntries(A.cookies.map(j=>[j.name,j.value])),responseTime:A.time,responseSize:A.size,executedRequest:{url:f.url,method:f.method,headers:f.headers||{},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:{type:"none",content:""},params:{},query:{}}});C={success:!0,assertions:T.testResults,consoleOutput:T.consoleOutput,modifiedEnvironment:T.modifiedEnvironmentVariables},T.modifiedEnvironmentVariables&&(u={...u,...T.modifiedEnvironmentVariables})}return{response:A,preRequestResult:_,postResponseResult:C,totalTime:Date.now()-i,finalRequest:f,variables:{environment:u,local:a}}}finally{S.dispose?.()}}async executeSimple(e,r={}){let n=e,i={...this.forgeEnv.getAll(),...r.variables||{}};return n=this.interpolateRequest(e,i),r.timeout&&(n={...n,timeout:r.timeout}),this.httpClient.send(n)}buildHttpRequest(e,r){let n=e.url;if(e.query&&e.query.length>0){let g=new URLSearchParams;for(let m of e.query)m.enabled!==!1&&g.append(m.key,m.value);n+=(n.includes("?")?"&":"?")+g.toString()}let i=r?.url||n,s=r?.method||e.method,a={};if(e.headers&&Array.isArray(e.headers))for(let g of e.headers)g.enabled!==!1&&(a[g.key]=g.value);let u={...a,...r?.headers||{}},f,h=r?.body||e.body;return h&&(typeof h=="string"?f=h:h.content&&(f=typeof h.content=="string"?h.content:JSON.stringify(h.content))),this.preprocessor&&h&&this.preprocessor.setContentTypeHeader(u,h),{url:i,method:s,headers:u,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=Ki.create(r);return{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:e.body?n.resolve(typeof e.body=="string"?e.body:JSON.stringify(e.body)):void 0}}buildScriptChain(e,r,n=[]){let i=[],s=[];r.scripts?.preRequest&&i.push(r.scripts.preRequest),r.scripts?.postResponse&&s.push(r.scripts.postResponse);for(let a of n)a.scripts?.preRequest&&i.push(a.scripts.preRequest),a.scripts?.postResponse&&s.push(a.scripts.postResponse);return e.scripts?.preRequest&&i.push(e.scripts.preRequest),e.scripts?.postResponse&&s.push(e.scripts.postResponse),{preRequest:i,postResponse:s}}findFolderPath(e,r){let n=[],i=(s,a)=>{for(let u of s){if(u.type==="request"&&u.id===r)return n.push(...a),!0;if(u.type==="folder"){let f=[...a,u];if(i(u.items,f))return!0}}return!1};return i(e.items,[]),n}};function HU(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var Ll=class{entries=new Map;requestIndex=new Map;fullResponses=new Map;maxEntriesPerRequest;storeFullResponses;constructor(e={}){this.maxEntriesPerRequest=e.maxEntriesPerRequest??100,this.storeFullResponses=e.storeFullResponses??!0}getEntries(e,r){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let a=this.entries.get(s);a&&(!r||a.environment===r)&&i.push(a)}return i}getEntry(e){return this.entries.get(e)}getFullResponse(e){return this.fullResponses.get(e)}get count(){return this.entries.size}addEntry(e,r,n,i,s){let a=HU(),u=Date.now(),f={id:a,timestamp:u,environment:i,method:r.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:r.url,method:r.method,headers:{...r.headers},body:r.body},response:{status:n.status,statusText:n.statusText,time:n.time}};this.entries.set(a,f);let h=this.requestIndex.get(e)||[];for(h.unshift(a);h.length>this.maxEntriesPerRequest;){let g=h.pop();g&&(this.entries.delete(g),this.fullResponses.delete(g))}if(this.requestIndex.set(e,h),this.storeFullResponses){let g={timestamp:u,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(a,g)}return f}deleteEntry(e){if(!this.entries.get(e))return!1;this.entries.delete(e),this.fullResponses.delete(e);for(let[n,i]of this.requestIndex.entries()){let s=i.indexOf(e);if(s!==-1){i.splice(s,1),i.length===0&&this.requestIndex.delete(n);break}}return!0}clearHistory(e){let r=this.requestIndex.get(e);if(r){for(let n of r)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var jl=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let a={method:e.method,headers:e.headers,signal:n.signal};e.body!==void 0&&!["GET","HEAD"].includes(e.method.toUpperCase())&&(typeof e.body=="string"||e.body instanceof FormData||e.body instanceof URLSearchParams?a.body=e.body:typeof e.body=="object"&&(a.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(a.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(a.redirect="manual");let u=await fetch(e.url,a),f=Date.now(),h=u.headers.get("content-type")||"",g;try{h.includes("application/json")?g=await u.json():h.includes("text/")?g=await u.text():g=await u.text()}catch{g=null}let m={};return u.headers.forEach((S,_)=>{let C=m[_];C!==void 0?m[_]=Array.isArray(C)?[...C,S]:[C,S]:m[_]=S}),{status:u.status,statusText:u.statusText,headers:m,cookies:[],body:g,time:f-r}}catch(a){throw a.name==="AbortError"?new Error(`Request timeout after ${i}ms`):a}finally{clearTimeout(s)}}};var Ib={json:"application/json",xml:"application/xml",html:"text/html",text:"text/plain",javascript:"application/javascript",css:"text/css","x-www-form-urlencoded":"application/x-www-form-urlencoded","form-data":"multipart/form-data",graphql:"application/json"},Qs=class{sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}encodeBody(e){if(!e||e.type==="none")return null;let{type:r,content:n}=e;switch(r){case"x-www-form-urlencoded":return this.encodeUrlEncodedBody(n);case"form-data":return n;case"graphql":return this.encodeGraphQLBody(n);case"raw":return n;case"binary":default:return n}}encodeUrlEncodedBody(e){if(Array.isArray(e)){let r=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&r.append(n.key,n.value||"");return r.toString()}return typeof e=="string"?e:String(e)}encodeGraphQLBody(e){return typeof e=="object"&&e.query?JSON.stringify({query:e.query,variables:e.variables||void 0,operationName:e.operationName||void 0}):typeof e=="string"?e:JSON.stringify(e)}setContentTypeHeader(e,r,n){if(Object.keys(e).some(a=>a.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!r||r.type==="none")return;let s;switch(r.type){case"x-www-form-urlencoded":s=Ib["x-www-form-urlencoded"];break;case"raw":s=r.format?Ib[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=Ib.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}};var Zs=class{format="http-forge";canParse(e){try{let r=JSON.parse(e);return typeof r=="object"&&r!==null&&"id"in r&&"name"in r&&"items"in r&&Array.isArray(r.items)&&!r.info?.schema?.includes("postman")&&!r._type}catch{return!1}}parse(e,r){let n=JSON.parse(e);return{id:n.id,name:n.name,description:n.description,variables:n.variables||{},auth:n.auth,scripts:n.scripts?{preRequest:n.scripts.preRequest,postResponse:n.scripts.postResponse}:void 0,items:this.convertItems(n.items),source:{format:"http-forge",filePath:r,version:n.version}}}convertItems(e){return e.map(r=>r.type==="folder"?this.convertFolder(r):this.convertRequest(r))}convertFolder(e){return{type:"folder",id:e.id,name:e.name,description:e.description,auth:e.auth,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0,items:e.items?this.convertItems(e.items):[]}}convertRequest(e){let r={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(r[i.key]=i.value);let n={};if(e.query)for(let i of e.query)i.enabled!==!1&&(n[i.key]=i.value);return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:Object.entries(r).map(([i,s])=>({key:i,value:s,enabled:!0})),query:Object.entries(n).map(([i,s])=>({key:i,value:s,enabled:!0})),params:e.params,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0}}};var Xs=class{parse(e,r){return r.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[r]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let r=e.split(/\r?\n/).filter(s=>s.trim());if(r.length<2)return[{}];let n=this.parseCsvLine(r[0]),i=[];for(let s=1;s<r.length;s++){let a=this.parseCsvLine(r[s]),u={};n.forEach((f,h)=>{u[f]=a[h]||""}),i.push(u)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let a=e[s],u=e[s+1];a==='"'?i&&u==='"'?(n+='"',s++):i=!i:a===","&&!i?(r.push(n.trim()),n=""):n+=a}return r.push(n.trim()),r}};var Kr=ve(require("fs/promises")),Bl=ve(require("path")),Ul=class{async readFile(e){return Kr.readFile(e,"utf-8")}async writeFile(e,r){let n=Bl.dirname(e);await this.mkdir(n),await Kr.writeFile(e,r,"utf-8")}async exists(e){try{return await Kr.access(e),!0}catch{return!1}}async mkdir(e){await Kr.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=Bl.basename(s);for(let u of e)if(this.matchPattern(a,u)){i.push(s);break}})}catch{}return i}async readDir(e){return Kr.readdir(e)}async isDirectory(e){try{return(await Kr.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await Kr.readdir(e,{withFileTypes:!0});for(let i of n){let s=Bl.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,r):i.isFile()&&r(s)}}matchPattern(e,r){let n=r.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};var wp=class t{httpClient;fileSystem;scriptExecutor;interpolator;cookieJar;interceptorChain;preprocessor;dataFileParser;requestHistory;parserRegistry;collectionLoader;environmentStore;forgeEnv;requestExecutor;options;constructor(e={}){if(this.options=e,this.interpolator=e.interpolator||new Bs,this.fileSystem=e.fileSystem||new Ul,this.preprocessor=e.preprocessor||new Qs,this.dataFileParser=e.dataFileParser||new Xs,this.cookieJar=e.cookieJar||new ml,e.enableHistory?this.requestHistory=e.requestHistory||new Ll({maxEntriesPerRequest:e.maxHistoryEntries??100}):this.requestHistory=null,this.interceptorChain=e.interceptorChain||this.createInterceptorChain(e),e.httpClient)this.httpClient=e.httpClient;else if(e.useNativeHttp!==!1){let s={...e.httpSettings,timeout:e.requestTimeout??e.httpSettings?.timeout};this.httpClient=new Hs(s)}else this.httpClient=new jl;let r=e.forgeRoot?[require("path").join(e.forgeRoot,"modules")]:[],n=new Si(new fn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new Ri(n,r),this.parserRegistry=new pl,this.parserRegistry.register("http-forge",new Zs),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=require("path").join(e.forgeRoot,"collections");this.collectionLoader=new hl(s)}else this.collectionLoader=new Uo(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new yi(e.environmentConfig):yi.fromVariables({}),this.forgeEnv=Ki.fromResolver(this.environmentStore),this.requestExecutor=new Xo(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new bi;if(e.requestInterceptors)for(let n of e.requestInterceptors)r.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)r.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)r.addErrorInterceptor(n);return r}async loadCollection(e){if(this.collectionLoader instanceof Uo)return this.collectionLoader.load(e);throw new Error("loadCollection(filePath) is not supported with folder storage format. Use loadAllCollections() instead.")}async loadAllCollections(){return this.collectionLoader.loadAll()}async execute(e,r,n){return this.requestExecutor.execute(e,r,n)}async executeSimple(e,r){return this.requestExecutor.executeSimple(e,r)}registerParser(e,r){this.parserRegistry.register(e,r)}setEnvironmentConfig(e){this.environmentStore=new yi(e),this.forgeEnv=Ki.fromResolver(this.environmentStore),this.requestExecutor=new Xo(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new t(e)}static fromForgeRoot(e="./http-forge",r={}){let n=require("path"),i=n.join(e,"environments"),s,a=gl(i);if(Object.keys(a.environments).length>0||Object.keys(a.globalVariables).length>0){s={globalVariables:{...a.globalVariables,...a.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,h]of Object.entries(a.environments)){let g=a.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...h.variables,...g}}}}else{let f=require("fs"),h=n.join(i,"environments.json");if(f.existsSync(h))try{let g=f.readFileSync(h,"utf-8"),m=JSON.parse(g);if(s={globalVariables:m.globalVariables||{},environments:{},selectedEnvironment:m.selectedEnvironment},m.environments)for(let[S,_]of Object.entries(m.environments)){let C=_;s.environments[S]={name:C.name||S,variables:C.variables||{}}}}catch(g){console.warn(`[ForgeContainer] Failed to load environments from ${h}:`,g)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};var xA=ve(require("path"));var Hl=ve(require("crypto")),VU=3e4,Vl=class{constructor(e,r,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=r;this.envConfigService=n;this.httpService=i;this.callbackPath=s}tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,r){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,r),tokenType:e.tokenPrefix||"Bearer",raw:{}};let n=this.buildCacheKeyString(e),i=this.tokenCache.get(n);if(i&&!this.isExpired(i))return i;if(i?.refreshToken)try{return await this.refreshToken(e,i.refreshToken,r)}catch{this.tokenCache.delete(n)}if(!i){let a=await this.secretStore.get(`oauth2_refresh_${n}`);if(a)try{return await this.refreshToken(e,a,r)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,r,"client_credentials");break;case"password":s=await this.fetchToken(e,r,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,r);break;case"implicit":s=await this.implicitFlow(e,r);break;default:throw new Error(`Unknown OAuth2 grant type: ${e.grantType}`)}return this.tokenCache.set(n,s),s.refreshToken&&await this.storeRefreshToken(n,s.refreshToken),s}async refreshToken(e,r,n){let i=this.resolve(e.tokenUrl||"",n);if(!i)throw new Error("OAuth2 tokenUrl is required for token refresh");let s=this.resolve(e.clientId||"",n),a=this.resolve(e.clientSecret||"",n),u=new URLSearchParams;u.append("grant_type","refresh_token"),u.append("refresh_token",r);let f={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,f,u,s,a,n);let h=await this.httpService.execute({method:"POST",url:i,headers:f,body:u.toString()}),g=this.parseTokenResponse(h.body,e);g.refreshToken||(g.refreshToken=r);let m=this.buildCacheKeyString(e);return this.tokenCache.set(m,g),g.refreshToken&&await this.storeRefreshToken(m,g.refreshToken),g}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),u=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for authorization code flow");if(!i)throw new Error("OAuth2 tokenUrl is required for authorization code flow");if(!s)throw new Error("OAuth2 clientId is required for authorization code flow");let f=e.usePkce!==!1,h,g,m;if(f){h=this.generateCodeVerifier();let ee=e.pkceMethod||"S256";g=ee==="S256"?this.generateCodeChallengeS256(h):h,m=ee}let S=e.state||Hl.randomBytes(16).toString("hex"),_=await this.getCallbackUri(),C=new URL(n);if(C.searchParams.set("response_type","code"),C.searchParams.set("client_id",s),C.searchParams.set("redirect_uri",_),u&&C.searchParams.set("scope",u),C.searchParams.set("state",S),g&&(C.searchParams.set("code_challenge",g),C.searchParams.set("code_challenge_method",m)),e.audience&&C.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&C.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[ee,k]of Object.entries(e.extraParams))C.searchParams.set(ee,this.resolve(k,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let x=new Promise((ee,k)=>{this.pendingAuthCallback={resolve:ee,reject:k,state:S}});await this.browserService.openExternal(C.toString());let A;try{A=await Promise.race([x,new Promise((ee,k)=>setTimeout(()=>{this.pendingAuthCallback=null,k(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(A.state&&A.state!==S)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let T=new URLSearchParams;T.append("grant_type","authorization_code"),T.append("code",A.code),T.append("redirect_uri",_),h&&T.append("code_verifier",h);let j={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,j,T,s,a,r);let Y=await this.httpService.execute({method:"POST",url:i,headers:j,body:T.toString()}),V=this.parseTokenResponse(Y.body,e),K=this.buildCacheKeyString(e);return this.tokenCache.set(K,V),V.refreshToken&&await this.storeRefreshToken(K,V.refreshToken),V}async implicitFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.clientId||"",r),s=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for implicit flow");if(!i)throw new Error("OAuth2 clientId is required for implicit flow");let a=e.state||Hl.randomBytes(16).toString("hex"),u=await this.getCallbackUri(),f=new URL(n);if(f.searchParams.set("response_type","token"),f.searchParams.set("client_id",i),f.searchParams.set("redirect_uri",u),s&&f.searchParams.set("scope",s),f.searchParams.set("state",a),e.audience&&f.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[_,C]of Object.entries(e.extraParams))f.searchParams.set(_,this.resolve(C,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let h=new Promise((_,C)=>{this.pendingImplicitCallback={resolve:_,reject:C,state:a}});await this.browserService.openExternal(f.toString());let g;try{g=await Promise.race([h,new Promise((_,C)=>setTimeout(()=>{this.pendingImplicitCallback=null,C(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(g.state&&g.state!==a)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let m={accessToken:g.accessToken,tokenType:g.tokenType||e.tokenPrefix||"Bearer",expiresAt:g.expiresIn?Date.now()+g.expiresIn*1e3:void 0,raw:{access_token:g.accessToken,token_type:g.tokenType,expires_in:g.expiresIn}},S=this.buildCacheKeyString(e);return this.tokenCache.set(S,m),m}handleAuthorizationCallback(e,r,n){if(n){let i=new Error(`OAuth2 authorization error: ${n}`);this.pendingAuthCallback?.reject(i),this.pendingImplicitCallback?.reject(i),this.pendingAuthCallback=null,this.pendingImplicitCallback=null;return}if(e&&this.pendingAuthCallback){this.pendingAuthCallback.resolve({code:e,state:r}),this.pendingAuthCallback=null;return}!e&&!this.pendingAuthCallback&&this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow did not receive access_token")),this.pendingImplicitCallback=null)}handleImplicitCallback(e,r,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:r,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let r=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(r),this.secretStore.delete(`oauth2_refresh_${r}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,r,n){let i=this.resolve(e.tokenUrl||"",r);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),u=e.scope?this.resolve(e.scope,r):void 0,f=new URLSearchParams;if(f.append("grant_type",n),u&&f.append("scope",u),n==="password"){let m=this.resolve(e.username||"",r),S=this.resolve(e.password||"",r);if(!m)throw new Error("OAuth2 password grant requires username");f.append("username",m),f.append("password",S)}if(e.audience&&f.append("audience",this.resolve(e.audience,r)),e.resource&&f.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[m,S]of Object.entries(e.extraParams))f.append(m,this.resolve(S,r));let h={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,h,f,s,a,r);let g=await this.httpService.execute({method:"POST",url:i,headers:h,body:f.toString()});return this.parseTokenResponse(g.body,e)}applyClientAuth(e,r,n,i,s,a){if(e.clientAuthentication==="header"){let u=Buffer.from(`${i}:${s}`).toString("base64");r.Authorization=`Basic ${u}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,r){if(!e||typeof e!="object")throw new Error("OAuth2 token response is not a valid JSON object");let n=e,i=r.tokenField||"access_token",s=n[i];if(!s)throw new Error(`OAuth2 token fetch failed: '${i}' not present in response`);let a=typeof n.expires_in=="number"?n.expires_in:void 0;return{accessToken:s,tokenType:n.token_type||r.tokenPrefix||"Bearer",expiresAt:a?Date.now()+a*1e3:void 0,refreshToken:n.refresh_token,scope:n.scope,raw:n}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-VU:!1}buildCacheKeyString(e){return`${e.tokenUrl||""}|${e.clientId||""}|${e.scope||""}|${e.grantType}`}async getCallbackUri(){let e=`${this.browserService.uriScheme}://${this.callbackPath}`;return this.browserService.asExternalUri(e)}resolve(e,r){return this.envConfigService.resolveVariables(e,r)}generateCodeVerifier(){return Hl.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Hl.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}};var ea=ve(require("fs")),eo=ve(require("path"));function ta(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&ea.writeFileSync(t,r.join(`
|
|
223
|
-
`),"utf-8")}function
|
|
224
|
-
`)}function YU(t){let e=t.url;if(t.query&&t.query.length){let r=t.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");r&&(e+=(e.includes("?")?"&":"?")+r)}return e}var ur=ve(require("fs")),Ob=ve(require("path"));var ra=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){ur.existsSync(this.collectionsDir)||ur.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!ur.existsSync(this.collectionsDir))return[];let e=ur.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=Ob.join(this.collectionsDir,n),s=ur.readFileSync(i,"utf-8"),a=JSON.parse(s);a.id&&a.name&&(this.cache.set(a.id,a),r.push(a))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return r}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.getCollectionPath(e);if(ur.existsSync(r))try{let n=ur.readFileSync(r,"utf-8"),i=JSON.parse(n);return this.cache.set(e,i),i}catch(n){console.error(`[JsonCollectionLoader] Failed to load collection ${e}:`,n);return}}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=rt(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await ur.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!ur.existsSync(r))return!1;try{return await ur.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return ur.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return Ob.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||rt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r);s&&(s.scripts=n,await this.save(i))}loadScripts(e,r){let n=this.load(e);return n?this.findItemById(n.items,r)?.scripts:void 0}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth),await this.save(n)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r.id);if(s)Object.assign(s,r);else if(n){let a=this.findItemById(i.items,n);if(a&&a.type==="folder")a.items=a.items||[],a.items.push(r);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(r);await this.save(i)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,r);return i&&await this.save(n),i}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let{id:a,type:u,...f}=n;return Object.assign(s,f),await this.save(i),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let a={...s};if(!this.deleteItemById(i.items,r))return!1;if(n){let u=this.findItemById(i.items,n);if(u&&u.type==="folder")u.items=u.items||[],u.items.push(a);else return i.items.push(a),!1}else i.items.push(a);return await this.save(i),!0}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;try{let s;if(r){let f=this.findItemById(i.items,r);if(!f||!f.items)return!1;s=f.items}else s=i.items;let a=new Map(s.map(f=>[f.id,f])),u=[];for(let f of n){let h=a.get(f);h&&(u.push(h),a.delete(f))}for(let f of a.values())u.push(f);if(r){let f=this.findItemById(i.items,r);f&&(f.items=u)}else i.items=u;return await this.save(i),!0}catch(s){return console.error("[JsonCollectionLoader] Failed to reorder items:",s),!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}deleteItemById(e,r){for(let n=0;n<e.length;n++){if(e[n].id===r)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}};var Yl=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new zi(n):new ra(n)}static createForFormat(e,r){return e==="folder"?new zi(r):new ra(r)}};var mt=ve(require("fs")),Hn=ve(require("path"));function GR(t){if(typeof t!="string")return"text";let e=t.trim();try{let r=JSON.parse(e);if(typeof r=="object"&&r!==null)return"json"}catch{}return/^<\?xml/.test(e)||/^<([a-zA-Z_][\w\-\.]*)[\s>]/.test(e)?/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":"xml":/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":/^(function\s*\(|\(\)\s*=>|const |let |var |export |import )/.test(e)?"javascript":"text"}function JU(t){return{info:{name:t.name,_postman_id:t.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:t.items.map(e=>QR(e)),event:Pb(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function QR(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(QR):[],event:Pb(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(r=>r.enabled!==!1).map(zU),url:KU(e),body:GU(e),auth:QU(e.auth),description:e.description},event:Pb(e.scripts),protocolProfileBehavior:ZU(e.settings)}}}function zU(t){return{key:t.key,value:t.value,disabled:t.enabled===!1}}function KU(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let h=i[1];/^{{.*}}$/.test(h)?n=[h]:n=h.split(".")}let s=[],a=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(a&&a[1]!==void 0){let h=a[1].replace(/^\//,"");h.endsWith("/")?(s=h.slice(0,-1).split("/"),s.push("")):s=h.length>0?h.split("/"):[]}let u;if(Array.isArray(t.query)&&t.query.length>0)u=t.query.map(h=>{let g={key:h.key,value:h.value};return h.enabled===!1&&(g.disabled=!0),g});else{let h=r.indexOf("?");h!==-1&&(u=r.substring(h+1).split("&").map(m=>{let[S,..._]=m.split("=");return{key:S,value:_.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([h,g])=>({key:h,value:String(g)}))),{raw:e,host:n.length>0?n:void 0,path:s.length>0?s:void 0,query:u&&u.length>0?u:void 0,variable:f&&f.length>0?f:void 0}}function GU(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=GR(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||GR(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let r=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(r)return{mode:"formdata",formdata:r.map(s=>({key:s.key,value:s.value,type:s.type||"text",disabled:s.enabled===!1}))};let n=e.type==="x-www-form-urlencoded"&&Array.isArray(e.content)?e.content:e.type==="urlencoded"&&Array.isArray(e.fields)?e.fields:null;if(n)return{mode:"urlencoded",urlencoded:n.map(s=>({key:s.key,value:s.value,disabled:s.enabled===!1}))};if(e.type==="file"&&e.fileName)return{mode:"file",file:{src:e.fileName}};if(e.type==="binary")return{mode:"binary",file:{}};let i=e.type==="graphql"?e.content??(e.query?e:null):null;if(i){let s=i.query??"",a=i.variables;return{mode:"graphql",graphql:{query:s,variables:a?typeof a=="string"?a:JSON.stringify(a):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function QU(t){if(!(!t||!t.type||t.type==="none")){if(t.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:t.bearerToken,type:"string"}]};if(t.type==="basic"&&t.basicAuth)return{type:"basic",basic:[{key:"username",value:t.basicAuth.username,type:"string"},{key:"password",value:t.basicAuth.password,type:"string"}]}}}function ZU(t){if(!t)return;let e={};return t.followRedirects===!1&&(e.followRedirects=!1),t.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),t.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),t.maxRedirects!==void 0&&(e.maxRedirects=t.maxRedirects),t.strictSSL===!1&&(e.disableUrlEncoding=!1),t.timeout!==void 0&&(e.requestTimeout=t.timeout),Object.keys(e).length>0?e:void 0}function Pb(t){if(!t)return[];let e=[];return t.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[t.preRequest]}}),t.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[t.postResponse]}}),e}var Jl=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Yl.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}collectionsDir;collections=new Map;fileWatcher;loader;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){mt.existsSync(this.collectionsDir)||mt.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.loadCollections(),this.onCollectionsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=rt(e.name)),await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,n);if(s){let a=this.findItemRecursive(i.items,r);if(a){let{id:u,type:f,...h}=n;Object.assign(a,h)}}return s}async addRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;r.id||(r.id=rt(r.name));try{if(await this.loader.saveItem(e,r,n),n){let s=this.findItemRecursive(i.items,n);s&&s.type==="folder"&&(s.items=s.items||[],s.items.push(r))}else i.items.push(r);return!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(a=>a.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,r,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===r)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,r,n))return!0}return!1}deleteItemRecursive(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,r))return!0}return!1}collectRequestsRecursive(e,r){for(let n of e)n.type==="request"?r.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,r)}async createCollection(e){let r={id:rt(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);let i=rt(r),s=this.loader.getCollectionPath(e),a=Hn.join(this.collectionsDir,i);if(!mt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let u=Hn.join(a,"collection.json");if(mt.existsSync(u)){let h=JSON.parse(mt.readFileSync(u,"utf-8"));h.id=i,h.name=r,mt.writeFileSync(u,JSON.stringify(h,null,2))}else mt.writeFileSync(u,JSON.stringify({id:i,name:r},null,2));this.loadCollections();let f=this.collections.get(i);if(!f)throw new Error("Failed to load duplicated collection");return f}async createFolder(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:rt(e.name),type:"folder",name:e.name,items:[]};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async deleteFolder(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async duplicateFolder(e,r,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,r);if(!s||!mt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let a=Hn.dirname(s),u=rt(n),f=Hn.join(a,u);this.copyDirRecursive(s,f);let h=Hn.join(f,"folder.json");if(mt.existsSync(h)){let S=JSON.parse(mt.readFileSync(h,"utf-8"));S.id=u,S.name=n,mt.writeFileSync(h,JSON.stringify(S,null,2))}else mt.writeFileSync(h,JSON.stringify({id:u,name:n,type:"folder"},null,2));let g=this.loader.load(e);g&&this.collections.set(e,g);let m=this.findItemById(g?.items||[],u);return m||{id:u,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:e.id||rt(e.name),type:"request",name:e.name,method:e.method||"GET",url:e.url,params:e.params,query:e.query,headers:e.headers,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts,deprecated:e.deprecated,description:e.description,doc:e.doc,responseSchema:e.responseSchema,bodySchema:e.bodySchema};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async renameRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}copyDirRecursive(e,r){mt.existsSync(r)||mt.mkdirSync(r,{recursive:!0});for(let n of mt.readdirSync(e,{withFileTypes:!0})){let i=Hn.join(e,n.name),s=Hn.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):mt.copyFileSync(i,s)}}deleteItemById(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}async importCollection(e){let r=mt.readFileSync(e,"utf-8"),n;try{n=JSON.parse(r)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||rt(n.name||"Imported Collection"),name:n.name||"Imported Collection",description:n.description,items:n.items||[]};return await this.saveCollection(i),i}async importPostmanCollection(e){let r=h=>{if(!h)return;switch(h.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:h.bearer?.find(T=>T.key==="token")?.value||""};case"basic":let S=h.basic?.find(T=>T.key==="username"),_=h.basic?.find(T=>T.key==="password");return{type:"basic",basicAuth:{username:S?.value||"",password:_?.value||""}};case"apikey":let C=h.apikey?.find(T=>T.key==="key"),x=h.apikey?.find(T=>T.key==="value"),A=h.apikey?.find(T=>T.key==="in");return{type:"apikey",apikey:{key:C?.value||"",value:x?.value||"",in:A?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=h=>{if(!Array.isArray(h)||h.length===0)return;let g={};for(let m of h){let S=m.script?.exec;if(!S)continue;let _=Array.isArray(S)?S.join(`
|
|
225
|
-
`):S;m.listen==="prerequest"?g.preRequest=_:m.listen==="test"&&(g.postResponse=_)}return g.preRequest||g.postResponse?g:void 0},i=h=>{if(!h||typeof h!="object")return;let g={};return h.followRedirects===!1&&(g.followRedirects=!1),h.followOriginalHttpMethod===!0&&(g.followOriginalMethod=!0),h.followAuthorizationHeader===!1&&(g.followAuthHeader=!1),h.maxRedirects!==void 0&&(g.maxRedirects=h.maxRedirects),h.requestTimeout!==void 0&&(g.timeout=h.requestTimeout),Object.keys(g).length>0?g:void 0},s=h=>{if(!h||typeof h=="string")return;let g=h.query;if(!(!Array.isArray(g)||g.length===0))return g.map(m=>({key:m.key||"",value:m.value||"",enabled:m.disabled!==!0}))},a=h=>{if(typeof h=="string")return h;if(!h)return"";let g=new Set;if(Array.isArray(h.variable))for(let S of h.variable)S.key&&g.add(S.key);if(g.size===0&&h.raw)return h.raw;let m="";if(h.protocol&&(m+=h.protocol+"://"),h.host&&(m+=Array.isArray(h.host)?h.host.join("."):h.host),h.port&&(m+=":"+h.port),h.path){let _=(Array.isArray(h.path)?h.path:[h.path]).map(C=>{let x=C.startsWith(":")?C.substring(1):C;return g.has(x)?":"+x:(C.startsWith(":"),C)});m+="/"+_.join("/")}return!m&&h.raw?h.raw:m},u=h=>h.map(g=>{if(g.item)return{id:rt(g.name),type:"folder",name:g.name,description:g.description,auth:r(g.auth),scripts:n(g.event),items:u(g.item)};{let m=g.request||{};return{id:rt(g.name),type:"request",name:g.name,description:g.description||m.description,method:typeof m.method=="string"?m.method:"GET",url:a(m.url),query:s(m.url),headers:Array.isArray(m.header)?m.header.map(S=>({key:S.key||S.name||"",value:S.value||S.value||"",enabled:S.disabled!==!0})):[],body:(()=>{let S=m.body;if(S){if(S.mode==="raw"&&S.raw){let _=S.options?.raw?.language;return{type:"raw",format:_==="xml"?"xml":_==="html"?"html":_==="javascript"?"javascript":_==="text"?"text":"json",content:S.raw}}if(S.mode==="urlencoded"&&Array.isArray(S.urlencoded))return{type:"x-www-form-urlencoded",content:S.urlencoded.map(_=>({key:_.key||"",value:_.value||"",enabled:_.disabled!==!0}))};if(S.mode==="formdata"&&Array.isArray(S.formdata))return{type:"form-data",content:S.formdata.map(_=>({key:_.key||"",value:_.value||"",type:_.type||"text",enabled:_.disabled!==!0}))};if(S.mode==="graphql"&&S.graphql){let _;if(S.graphql.variables)try{_=JSON.parse(S.graphql.variables)}catch{_=void 0}return{type:"graphql",content:{query:S.graphql.query||"",variables:_}}}if(S.mode==="binary")return{type:"binary",content:""}}})(),auth:r(m.auth),scripts:n(g.event),settings:i(g.protocolProfileBehavior)}}}),f={id:rt(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:r(e.auth),scripts:n(e.event),items:u(e.item||[])};return await this.saveCollection(f),f}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=JU(n),s=JSON.stringify(i,null,2);mt.writeFileSync(r,s,"utf-8")}async exportCollectionAsRestClientFolder(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Hn.join(r,_t(n.name));mt.mkdirSync(i,{recursive:!0});let s=n.variables||{};ta(Hn.join(i,`${_t(n.name)}.env`),s),Wl(i,_t(n.name),n.scripts),Xc(n.items,i,n)}dispose(){this.fileWatcher?.dispose()}};var qr=ve(require("fs")),yn=ve(require("path"));var Jt={version:"1.0",storage:{format:"folder",root:"./http-forge-assets",history:"./.http-forge-cache/histories",results:"./.http-forge-cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0},scripts:{modulePaths:["./http-forge-assets/src","./http-forge-assets/lib"]},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:50,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null},na={config:"http-forge.config.json"},to={collections:"collections",environments:"environments",flows:"flows",suites:"suites"};var ia=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=yn.join(e,na.config),this.config=this.loadConfig(),this.setupFileWatcher()}config;configPath;fileWatcher;loadConfig(){if(!qr.existsSync(this.configPath))return{...Jt};try{let e=qr.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${na.config}. Using default configuration.`),{...Jt}}}mergeWithDefaults(e){return{version:e.version??Jt.version,storage:{...Jt.storage,...e.storage},request:{...Jt.request,...e.request},scripts:{...Jt.scripts,...e.scripts},runner:{...Jt.runner,...e.runner},environments:{...Jt.environments,...e.environments},restClientExport:{...Jt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Jt.proxy,mcp:{...Jt.mcp,...e.mcp,cors:{...Jt.mcp.cors,...e.mcp?.cors}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,na.config);let e=()=>{this.reload()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getConfig(){return this.config}getStorageConfig(){return this.config.storage}getRequestConfig(){return this.config.request}getScriptsConfig(){return this.config.scripts}getRunnerConfig(){return this.config.runner}getEnvironmentsConfig(){return this.config.environments}getRestClientExportPath(){let e=this.config.restClientExport?.path||"collections-rest-client";return yn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){return this.config.mcp??Jt.mcp}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return yn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return yn.join(this.getRootPath(),to.collections)}getEnvironmentsPath(){return yn.join(this.getRootPath(),to.environments)}getFlowsPath(){return yn.join(this.getRootPath(),to.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return yn.join(this.getRootPath(),to.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return qr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(Jt,null,2);await qr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)qr.existsSync(i)||await qr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)qr.existsSync(i)||await qr.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await qr.promises.writeFile(yn.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await qr.promises.writeFile(yn.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await qr.promises.writeFile(yn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}};var XU="httpForge.cookies",zl=class{constructor(e,r=XU){this.store=e;this.storeKey=r;this.loadCookies()}cookies=new Map;loadCookies(){try{let e=this.store.get(this.storeKey);e&&(this.cookies=new Map(Object.entries(e)),this.cleanExpiredCookies())}catch(e){console.error("[CookieService] Failed to load cookies:",e)}}async saveCookies(){try{let e={};this.cookies.forEach((r,n)=>{e[n]=r}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}async set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e),await this.saveCookies()}async setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}await this.saveCookies()}has(e,r){return this.get(e,r)!==void 0}async delete(e,r,n){let i=this.getCookieKey(e,r,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return ot.formatCookieHeader(r)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,r){return ot.parseCookieHeaders(e,r)}isExpired(e){return ot.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r);e.length>0&&this.saveCookies()}domainMatches(e,r){return ot.domainMatches(e,r)}get count(){return this.cookies.size}};var Kl=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}localCache=[];pendingOperations=[];get(e,r){return r?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===r||r.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,r){return this.get(e,r)!==void 0}set(e){let r=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));r>=0?this.localCache[r]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,r,n){let i=this.localCache.findIndex(s=>s.name===e&&(!r||s.domain===r||s.domain&&r.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:r,path:n}),!0}getAll(e){return e?this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,r){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(r,n);i.length>0&&(i.forEach(s=>{let a=this.localCache.findIndex(u=>u.name===s.name&&u.domain===(s.domain||n));a>=0?this.localCache[a]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let r=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(ot.isExpired(s)||s.domain&&!ot.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return ot.formatCookieHeader(i)}clear(){this.localCache=[],this.pendingOperations.push({type:"clear"})}async flush(){for(let e of this.pendingOperations)switch(e.type){case"set":e.cookie&&await this.cookieService.set(e.cookie);break;case"delete":e.name&&await this.cookieService.delete(e.name,e.domain,e.path);break;case"clear":await this.cookieService.clear();break}this.pendingOperations=[]}};var Bt=ve(require("fs")),Gr=ve(require("path"));function ef(t){try{let e=JSON.parse(typeof t=="string"?t:t.toString("utf-8"));if(!e)return null;let r=e.environment||e,n=r.name||e.name||"imported-environment",i=r.values||r.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let u of i){if(!u)continue;let f=u.key??u.name,h=typeof u.enabled=="boolean"?u.enabled:!0;f&&h!==!1&&(s[f]=u.value??u.initial??"")}else if(typeof i=="object"&&i!==null)for(let[u,f]of Object.entries(i))s[u]=String(f??"");let a=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:a}}catch{return null}}async function ZR(t,e){try{let r=await e.readFile(t);return ef(r)}catch{return null}}var tf={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Gl=class{constructor(e,r,n,i){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;let s=n.getEnvironmentsPath();this.environmentsPath=s,this.sharedConfigPath=Gr.join(s,"_global.json"),this.localConfigPath=Gr.join(s,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r.get(tf.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.loadPersistedEnvironmentOverrides(),this.setupFileWatcher()}environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Bt.existsSync(this.environmentsPath))return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.environmentsPath,"**/*.json");let e=()=>{this.reload(),this.onEnvironmentsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}dispose(){this.fileWatcher?.dispose()}getWorkspaceFolder(){return this.workspaceFolder}getRootPath(){return this.configService.getRootPath()}loadConfigs(){if(!Bt.existsSync(this.environmentsPath)){this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}},this.localConfig={credentials:{},variables:{}};return}this.loadFolderConfigs()}getSharedConfig(){return this.sharedConfig||this.loadConfigs(),this.sharedConfig}getLocalConfig(){return this.localConfig||this.loadConfigs(),this.localConfig}getEnvironmentNames(){let e=this.getSharedConfig();return e?.environments?Object.keys(e.environments):[]}getSelectedEnvironment(){return this.selectedEnvironment}async setSelectedEnvironment(e){if(this.selectedEnvironment=e,await this.workspaceStore.update(tf.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let r=this.getEnvOverridesStateKey(e),n=this.workspaceStore.get(r,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}}getEnvOverridesStateKey(e){return`${tf.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),r=this.workspaceStore.get(e,{});r&&Object.keys(r).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...r})}persistEnvironmentOverrides(e){let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore.update(r,n)}setEnvironmentVariable(e,r){let n=this.selectedEnvironment;this.localEnvironmentValues.has(n)||this.localEnvironmentValues.set(n,{}),this.localEnvironmentValues.get(n)[e]=String(r),this.persistEnvironmentOverrides(n)}deleteEnvironmentVariable(e){let r=this.selectedEnvironment,n=this.localEnvironmentValues.get(r);n&&(delete n[e],this.persistEnvironmentOverrides(r))}clearEnvironmentVariables(){let e=this.selectedEnvironment;this.localEnvironmentValues.set(e,{}),this.persistEnvironmentOverrides(e)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}async setSessionVariable(e,r){this.setEnvironmentVariable(e,r)}getSessionVariable(e){return this.getEnvironmentVariableLocal(e)}getSessionVariables(){return this.getEnvironmentVariableLocals()}async deleteSessionVariable(e){this.deleteEnvironmentVariable(e)}async clearSessionVariables(){this.clearEnvironmentVariables()}hasSessionVariable(e){return this.getEnvironmentVariableLocal(e)!==void 0}getResolvedEnvironment(e){let r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],a=i?.credentials?.[r],u=i?.variables||{},f=a?.variables||{},h=a&&a.headers||{},g=fl(n.defaultHeaders||{},h),m=this.localEnvironmentValues.get(r)||{},S={...n.globalVariables||{},...s.variables||{},...u,...f,...m};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:g,variables:S}}resolveVariables(e,r){return this.createResolver(r).resolveString(e,!0)}exportEnvironmentsToFolder(e,r=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!r&&Object.keys(s).length){let a=Gr.join(e,"globals.env");ta(a,s)}n.forEach(a=>{let u=i?.environments?.[a];if(!u)return;let f={...u.variables||{}};r&&(f={...s,...f});let h=Gr.join(e,`${_t(a)}.env`);ta(h,f)})}resolveVariablesWithExtra(e,r,n){return this.createResolver(n,r).resolveString(e,!0)}resolveVariablesInObject(e,r){return this.createResolver(r).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,r,n){return this.createResolver(n,r).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return Gr.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Bt.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let r={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,r);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),a={variables:i.variables||{}};this.saveJsonFile(s,a)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=Bt.readFileSync(e,"utf-8"),n=ef(r);if(!n)throw new Error("Failed to parse Postman environment file");this.sharedConfig||this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}});let i=n.name||`imported-${Date.now()}`;return this.sharedConfig.environments=this.sharedConfig.environments||{},this.sharedConfig.environments[i]=this.sharedConfig.environments[i]||{},this.sharedConfig.environments[i].variables=n.variables,n.description&&(this.sharedConfig.environments[i].description=n.description),this.saveSharedConfig(this.sharedConfig),n}catch(r){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",r),r}}saveEnvLocalConfig(e,r){let n=this.getEnvLocalConfigPath(e),i={variables:r};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:r}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return Gr.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=gl(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,r){let s={...this.getResolvedEnvironment(e)?.variables||{},...this.getSessionVariables(),...r||{}};return new Us({globals:{},collectionVariables:{},environmentVariables:s,sessionVariables:{},variables:{}})}saveFolderSharedConfig(e){Bt.existsSync(this.environmentsPath)||Bt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Bt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!gc(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=Gr.basename(s,".json");if(!i.has(a))try{Bt.unlinkSync(Gr.join(this.environmentsPath,s))}catch{}}for(let[s,a]of Object.entries(e.environments||{})){let u={name:s,description:a.description,requiresConfirmation:a.requiresConfirmation,variables:a.variables||{}};this.saveJsonFile(Gr.join(this.environmentsPath,`${s}.json`),u)}}reload(){this.sharedConfig=null,this.localConfig=null,this.loadConfigs()}getAllEnvironments(){return this.loadConfigs(),this.sharedConfig?Object.entries(this.sharedConfig.environments).map(([e,r])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:r.variables||{}})):[]}async setActiveEnvironment(e){await this.setSelectedEnvironment(e)}async createEnvironment(e){if(this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{}}),this.sharedConfig.environments[e])throw new Error(`Environment "${e}" already exists`);this.sharedConfig.environments[e]={description:`Created ${new Date().toISOString()}`,variables:{}},this.saveSharedConfig(this.sharedConfig)}async deleteEnvironment(e){if(this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentExists(e),delete this.sharedConfig.environments[e],this.selectedEnvironment===e){let r=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=r.length>0?r[0]:"dev",await this.workspaceStore.update(tf.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(r);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[r]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[r].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),r!==e&&(this.validateEnvironmentNameNotTaken(r),this.sharedConfig.environments[r]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=r,await this.workspaceStore.update(tf.SELECTED_ENVIRONMENT,r)),this.saveSharedConfig(this.sharedConfig))}validateEnvironmentName(e){if(!e||e.trim().length===0)throw new Error("Environment name cannot be empty");if(e.length>128)throw new Error("Environment name cannot exceed 128 characters");if(!/^[a-zA-Z0-9_\-\.]+$/.test(e))throw new Error("Environment name can only contain letters, numbers, hyphens, underscores, and dots")}validateEnvironmentExists(e){if(!this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" not found`)}validateEnvironmentNameNotTaken(e){if(this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" already exists`)}validateConfigLoaded(){if(!this.sharedConfig)throw new Error("No environment configuration loaded")}async updateEnvironmentVariables(e,r){if(this.loadConfigs(),!this.sharedConfig)throw new Error("No configuration loaded");let n=this.sharedConfig.environments[e];if(!n)throw new Error(`Environment "${e}" not found`);n.variables=r,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!Bt.existsSync(e))return null;let r=Bt.readFileSync(e,"utf-8");return JSON.parse(r)}catch(r){return console.error(`Failed to load JSON from ${e}:`,r),null}}saveJsonFile(e,r){try{let n=Gr.dirname(e);Bt.existsSync(n)||Bt.mkdirSync(n,{recursive:!0}),Bt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}};var Ql=class t{constructor(e,r,n,i,s,a,u,f,h,g,m,S){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=a;this.collectionScripts=u;this.folderScriptsChain=f;this.onConsoleOutput=h;this.collectionName=g;this.iteration=m;this.iterationCount=S}async execute(e,r,n){let i=Date.now();return this.executeWithSession(e,r,n,i)}async executeWithSession(e,r,n,i){let s=this.collectPreRequestScripts(e),a=this.collectPostResponseScripts(e),u=this.envConfigService.getResolvedEnvironment(this.environment);if(!u)throw new Error(`Environment "${this.environment}" not found or not configured`);let f={request:e,variables:{...r},environmentVariables:u.variables||{},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(m,S,_)=>{m==="set"&&S&&_!==void 0?this.envConfigService.setEnvironmentVariable(S,_):m==="unset"&&S?this.envConfigService.deleteEnvironmentVariable(S):m==="clear"&&this.envConfigService.clearEnvironmentVariables()}},h=this.scriptExecutor.createRequestSession(f),g=null;try{let m={...r},S={...e},_;if(s.length>0){let D=await h.executePreRequest(s);if(D.consoleOutput&&D.consoleOutput.length>0&&this.onConsoleOutput?.(D.consoleOutput),D.nextRequest!==void 0&&(_=D.nextRequest),D.skipRequest){let L={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:L,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:m,nextRequest:_}}D.success&&(D.modifiedRequest&&(D.modifiedRequest.url&&(S.url=D.modifiedRequest.url),D.modifiedRequest.headers&&(S.headers=D.modifiedRequest.headers),D.modifiedRequest.params&&(S.params=D.modifiedRequest.params),D.modifiedRequest.query&&(S.query=D.modifiedRequest.query),D.modifiedRequest.body!==void 0&&(S.body=D.modifiedRequest.body)),D.modifiedVariables&&(m=D.modifiedVariables))}g=await this.requestPreparer.prepareRequest(S,this.environment,u,m);let{url:C,headers:x,body:A,method:T}=g,j={};for(let D in x)Object.prototype.hasOwnProperty.call(x,D)&&(j[D.toUpperCase()]=x[D]);if(!j.COOKIE&&S.settings?.includeCookies!==!1&&this.cookieJar){let L=this.cookieJar.getCookieHeader(C);L&&(j.COOKIE=L)}let Y={method:T,url:C,headers:j,body:A.content,signal:n,settings:S.settings?{timeout:S.settings.timeout,followRedirects:S.settings.followRedirects,maxRedirects:S.settings.maxRedirects,strictSSL:S.settings.strictSSL}:void 0},V=await this.httpService.execute(Y);this.cookieJar&&V.headers&&await this.cookieJar.setCookiesFromResponse(C,V.headers);let K=Date.now()-i,ee=[],k={},E;if(a.length>0){let D=0;if(V.body)if(typeof V.body=="string")D=Buffer.byteLength(V.body,"utf8");else if(Buffer.isBuffer(V.body))D=V.body.length;else try{D=Buffer.byteLength(JSON.stringify(V.body),"utf8")}catch{D=0}let L={};V.cookies&&Array.isArray(V.cookies)&&V.cookies.forEach(ie=>{ie.name&&(L[ie.name]=ie.value)});let z={executedRequest:g,status:V.status,statusText:V.statusText,headers:_p(V.headers||{}),body:V.body,cookies:L,responseTime:V.time,responseSize:D},Z=await h.executePostResponse(a,z);ee=Z.testResults,k=Z.modifiedEnvironmentVariables||{},E=Z.visualizerData,Z.nextRequest!==void 0&&(_=Z.nextRequest),Z.consoleOutput&&Z.consoleOutput.length>0&&this.onConsoleOutput?.(Z.consoleOutput)}let P=ee.length===0||ee.every(D=>D.passed),N=ee.length>0?P:V.status>=200&&V.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...g,headers:j},response:{status:V.status,statusText:V.statusText,headers:V.headers||{},body:V.body,time:V.time||K,cookies:V.cookies||[]},duration:K,timestamp:Date.now(),passed:N,assertions:ee,modifiedVariables:m,modifiedEnvironmentVariables:k,nextRequest:_,visualizerData:E}}catch(m){return this.handleError(e,g,m,i)}finally{h.dispose?.()}}collectPreRequestScripts(e){let r=[];if(this.collectionScripts?.preRequest&&r.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&r.push(n.preRequest);else this.folderScriptsChain.preRequest&&r.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&r.push(e.scripts.preRequest),r}collectPostResponseScripts(e){let r=[];if(e.scripts?.postResponse&&r.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&r.push(i.postResponse)}else this.folderScriptsChain.postResponse&&r.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&r.push(this.collectionScripts.postResponse),r}handleError(e,r,n,i){let s=Date.now()-i,a=r?.method||e.method,u=r?.url||e.url;this.onConsoleOutput?.([`[error] ${e.name}: ${n.message||n}`]);let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),h=n?.stack?String(n.stack):"",g=this.errorBodyFormat,m,S;g==="html"||g==="both"?(m=t.formatErrorAsHtml(f,h),S={"content-type":"text/html; charset=utf-8"}):(m=f,S={});let _={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:u||"",method:a||"GET",headers:r?.headers||{},body:r?.body||_,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:S,cookies:[],body:m,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
222
|
+
`)}function Wl(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function cf(t){return t.map(e=>{let r=e.args.map(n=>{if(typeof n=="object")try{return JSON.stringify(n,null,2)}catch{return String(n)}return String(n)}).join(" ");return`[${e.level}] ${r}`})}function JR(t){return{log:(...e)=>t.push({level:"log",args:e}),info:(...e)=>t.push({level:"info",args:e}),warn:(...e)=>t.push({level:"warn",args:e}),error:(...e)=>t.push({level:"error",args:e})}}function yp(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let a=s.then(()=>{t.push({name:n,passed:!0})},u=>{t.push({name:n,passed:!1,message:u.message||String(u)})});e.push(a)}else t.push({name:n,passed:!0})}catch(s){t.push({name:n,passed:!1,message:s.message})}};return r._pendingTests=e,r}function vp(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function lB(t){let e=null;try{e=new URL(t)}catch{}return{toString(){return t},valueOf(){return t},[Symbol.toPrimitive](n){return n==="number"?NaN:t},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:t},getPathWithQuery(){return e?e.pathname+e.search:t},getQueryString(){return e?e.search.startsWith("?")?e.search.slice(1):e.search:""},getRemote(){if(!e)return"";let n=e.port||(e.protocol==="https:"?"443":"80");return`${e.hostname}:${n}`},getOAuth1BaseUrl(){return e?`${e.protocol}//${e.host}${e.pathname}`:t},get protocol(){return e?.protocol?.replace(":","")||""},get host(){return e?e.hostname.split("."):[]},get port(){return e?.port||""},get path(){return e?e.pathname.split("/").filter(Boolean):[]},get hash(){return e?.hash?.replace("#","")||""},query:{toObject(){if(!e)return{};let n={};return e.searchParams.forEach((i,s)=>{n[s]=i}),n},has(n){return e?e.searchParams.has(n):!1},get(n){return e?e.searchParams.get(n):void 0},each(n){e&&e.searchParams.forEach((i,s)=>n({key:s,value:i}))}}}}var Yl=class{constructor(e,r){this.deps=e;this.initialContext=r;this.initializeSession()}deps;initialContext;vmContext=null;ctx=null;modifiedRequest=null;assertions=[];consoleMessages=[];_variables={};_collectionVariables={};_globals={};_environmentVariables={};_liveEnvironmentScope=null;_liveGlobalsScope=null;_liveCollectionScope=null;_nextRequest=void 0;_skipRequest=!1;_visualizerData=void 0;initializeSession(){this.modifiedRequest={url:this.initialContext.request.url,method:this.initialContext.request.method,headers:{...this.initialContext.request.headers},body:this.initialContext.request.body?{...this.initialContext.request.body}:null,params:this.initialContext.request.params?{...this.initialContext.request.params}:{},query:this.initialContext.request.query?{...this.initialContext.request.query}:{}},this.assertions=[],this.ctx=this.createSharedContext(),this.consoleMessages=[];let e=this,r={log:(...n)=>{e.consoleMessages.push({level:"log",args:n})},info:(...n)=>{e.consoleMessages.push({level:"info",args:n})},warn:(...n)=>{e.consoleMessages.push({level:"warn",args:n})},error:(...n)=>{e.consoleMessages.push({level:"error",args:n})}};this.vmContext=this.deps.createVM(this.ctx,r)}createSharedContext(){let e=this.initialContext,r=this.modifiedRequest,n=this.deps.createCommonContext(e,"prerequest");this._variables={...e.variables},this._collectionVariables={...e.collectionVariables||{}},this._globals={...e.globals||{}},this._environmentVariables={...e.environmentVariables||{}},this._liveEnvironmentScope=n.environment,this._liveGlobalsScope=n.globals,this._liveCollectionScope=n.collectionVariables;let i;try{i=new URL(e.request.url).hostname}catch{}let s={get:u=>e.cookieJar?e.cookieJar.get(u,i)?.value:void 0,set:(u,f)=>{e.cookieJar&&e.cookieJar.set({name:u,value:f,domain:i})},has:u=>e.cookieJar?e.cookieJar.has(u,i):!1,list:()=>e.cookieJar?e.cookieJar.getAll(i).map(u=>({name:u.name,value:u.value})):[],toObject:()=>{if(!e.cookieJar)return{};let u=e.cookieJar.getAll(i),f={};for(let h of u)f[h.name]=h.value;return f},jar:()=>{let u=e.cookieJar;return{getAll(f,h){try{if(!u){h(null,[]);return}let g=u.getAll(f).map(m=>({name:m.name,value:m.value,domain:m.domain,path:m.path,httpOnly:m.httpOnly,secure:m.secure}));h(null,g)}catch(g){h(g,[])}},get(f,h,g){try{if(!u){g(null,void 0);return}let m=u.get(h,f);g(null,m?{name:m.name,value:m.value,domain:m.domain}:void 0)}catch(m){g(m,void 0)}},set(f,h,g,m){try{if(!u){(m||g)?.(null);return}typeof h=="string"&&typeof g=="string"?(u.set({name:h,value:g,domain:f}),m?.(null)):typeof h=="object"&&(u.set({...h,domain:f}),g?.(null))}catch(S){(m||g)?.(S)}},unset(f,h,g){try{if(!u){g?.(null);return}u.delete(h,f),g?.(null)}catch(m){g?.(m)}},clear(f){try{if(!u){f?.(null);return}u.clear(),f?.(null)}catch(h){f?.(h)}}}},remove:u=>{e.cookieJar&&e.cookieJar.delete(u,i)},unset:u=>{e.cookieJar&&e.cookieJar.delete(u,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},a=this;return{request:this.createRequestObject(r,e),response:null,test:yp(this.assertions),expect:Vl,cookies:s,execution:{setNextRequest(u){a._nextRequest=u},skipRequest(){a._skipRequest=!0},location:n.info?.requestName||""},setNextRequest(u){a._nextRequest=u},visualizer:{set(u,f){a._visualizerData={template:u,data:f}},clear(){a._visualizerData=void 0}},...n,info:{...n.info||{},eventName:"prerequest",requestName:n.info?.requestName||void 0,requestId:n.info?.requestId||void 0,iteration:e.iteration||0,iterationCount:e.iterationCount||1}}}createRequestObject(e,r){let n=u=>{if(!u)return"none";switch(u){case"raw":return"raw";case"form-data":return"formdata";case"x-www-form-urlencoded":return"urlencoded";case"binary":return"file";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},i=u=>{if(!u)return"none";switch(u){case"raw":return"raw";case"formdata":return"form-data";case"urlencoded":return"x-www-form-urlencoded";case"file":return"binary";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},s={...e.headers,add:u=>{u&&u.key&&(e.headers[u.key]=u.value||"")},get:u=>{for(let[f,h]of Object.entries(e.headers))if(f.toLowerCase()===u.toLowerCase())return h},has:u=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.toLowerCase())return!0;return!1},remove:u=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.toLowerCase()){delete e.headers[f];break}},update:u=>{if(u&&u.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.key.toLowerCase()){e.headers[f]=u.value||"";return}}},upsert:u=>{if(u&&u.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.key.toLowerCase()){e.headers[f]=u.value||"";return}e.headers[u.key]=u.value||""}},toObject:()=>{let u={};for(let[f,h]of Object.entries(e.headers))typeof h=="string"&&(u[f]=h);return u},each:u=>{for(let[f,h]of Object.entries(e.headers))typeof h=="string"&&u({key:f,value:h})}},a={get mode(){return n(e.body?.type)},set mode(u){let f=i(u);e.body?e.body.type=f:e.body={type:f,content:null}},get raw(){let u=e.body?.content;return typeof u=="string"?u:u&&typeof u=="object"?JSON.stringify(u):""},set raw(u){e.body?(e.body.type="raw",e.body.content=u):e.body={type:"raw",content:u}},get formdata(){return e.body?.type==="form-data"&&Array.isArray(e.body.content)?e.body.content:[]},get urlencoded(){return e.body?.type==="x-www-form-urlencoded"&&Array.isArray(e.body.content)?e.body.content:[]},get graphql(){return e.body?.type==="graphql"?e.body.content:null},get file(){return e.body?.type==="binary"?e.body.content:null}};return{get url(){return lB(e.url)},set url(u){e.url=typeof u=="string"?u:String(u)},get method(){return e.method},set method(u){e.method=u},headers:s,get body(){return a},set body(u){if(u==null)e.body=null;else if(typeof u=="string")e.body={type:"raw",content:u};else if(typeof u=="object")if(u.type||u.mode||u.content!==void 0){let f=u.mode?i(u.mode):u.type||"raw";e.body={type:f,format:u.format,content:u.content}}else e.body={type:"raw",content:u}},get params(){return e.params||{}},set params(u){e.params=u||{}},get query(){return e.query||{}},set query(u){e.query=u||{}},get auth(){return r.request?.auth||null},set auth(u){r.request&&(r.request.auth=u)},get certificate(){return r.request?.certificate||null},set certificate(u){r.request&&(r.request.certificate=u)},get description(){return r.request?.description||null},set description(u){r.request&&(r.request.description=u)},get name(){return r.request?.name||null},set name(u){r.request&&(r.request.name=u)},get id(){return r.request?.id||null},get disabled(){return r.request?.disabled||!1},set disabled(u){r.request&&(r.request.disabled=u)},get messages(){return r.request?.messages||[]},get methodPath(){return r.request?.methodPath||null},get metadata(){return r.request?.metadata||[]},getHeaders(u){let f={};for(let[h,g]of Object.entries(e.headers))typeof g=="string"&&(f[h]=g);return f},addQueryParams(u){if(typeof u=="string"){let f=new URLSearchParams(u);for(let[h,g]of f)e.query||(e.query={}),e.query[h]=g}else Array.isArray(u)&&(e.query||(e.query={}),u.forEach(f=>{f.key&&(e.query[f.key]=f.value||"")}))},removeQueryParams(u){e.query&&(typeof u=="string"?delete e.query[u]:Array.isArray(u)&&u.forEach(f=>{let h=typeof f=="string"?f:f.key;h&&delete e.query[h]}))},authorizeUsing(u,f){r.request&&(typeof u=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=u,f&&(r.request.auth.parameters=f)):typeof u=="object"&&(r.request.auth=u))},clone(){return{url:e.url,method:e.method,headers:{...e.headers},body:e.body?{...e.body}:null,params:e.params?{...e.params}:{},query:e.query?{...e.query}:{},auth:r.request?.auth,certificate:r.request?.certificate,description:r.request?.description,name:r.request?.name,id:r.request?.id,disabled:r.request?.disabled,metadata:r.request?.metadata,messages:r.request?.messages,methodPath:r.request?.methodPath}},describe(u,f){r.request&&(r.request.description={content:u,type:f||"text/plain"})},setHeader(u,f){e.headers[u]=f},removeHeader(u){delete e.headers[u]},setBody(u,f,h){e.body={type:f||e.body?.type||"raw",format:h||e.body?.format,content:u}}}}async executePreRequest(e){let r=uf(e);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0;let n=this.ctx.variables.replaceIn(r);xb.runInContext(n,this.vmContext,{timeout:5e3});let i=cf(this.consoleMessages),s=this.initialContext.request.body,a=!this.bodiesEqual(this.modifiedRequest.body,s);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:Wl(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:a?this.modifiedRequest.body:void 0,params:Wl(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:Wl(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:i.length>0?i:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:[`[error] Script execution failed: ${n.message}`],modifiedVariables:this.ctx?.variables?.toObject(),modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,r){let n=uf(e);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=gp(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.vmContext.responseBody=r.body??"";let i=this;this.vmContext.tests=new Proxy({},{set(u,f,h){return i.assertions.push({name:String(f),passed:!!h,message:h?void 0:`"${String(f)}" was false`}),!0}});let s=this.ctx.variables.replaceIn(n);xb.runInContext(s,this.vmContext,{timeout:5e3}),this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0);let a=cf(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:a.length>0?a:void 0,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){return this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"}),{testResults:[...this.assertions],consoleOutput:[`[error] Script execution failed: ${i.message}`],modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.vmContext=null,this.ctx=null,this.assertions=[]}};function GR(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function QR(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function cB(t,e){if(t==="@")return"";if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=t.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(r){let n=GR(r[2],e),i=mi(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return QR(e[t]);if(ks(t)){let n=Ps(t,e),i=As(t,n);if(i!==void 0)return i}}var je=class t{_buffer;constructor(e){this._buffer=typeof e=="string"?Buffer.from(e,"utf8"):e}toString(e){return e?e.stringify(this):this._buffer.toString("hex")}toBuffer(){return this._buffer}static fromHex(e){return new t(Buffer.from(e,"hex"))}static fromBase64(e){return new t(Buffer.from(e,"base64"))}static fromUtf8(e){return new t(Buffer.from(e,"utf8"))}};function zR(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],a=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)a=Zt.createHash("md5").update(Buffer.concat([a,i])).digest(),s.push(a);let u=Buffer.concat(s);return{key:u.subarray(0,e),iv:u.subarray(e,e+r)}}function Cb(t,e,r){let n=i=>t==="aes"?`aes-${i*8}-cbc`:t==="des"?"des-cbc":t==="des-ede3"?"des-ede3-cbc":t;return{encrypt(i,s,a){let u=i instanceof je?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=Zt.randomBytes(8),{key:h,iv:g}=zR(s,e,r,f),m=Zt.createCipheriv(n(e),h,g),S=Buffer.concat([m.update(u),m.final()]),E=Buffer.concat([Buffer.from("Salted__"),f,S]);return{ciphertext:new je(S),salt:new je(f),toString:x=>x?x.stringify(new je(E)):E.toString("base64")}}else{let f=s.toBuffer(),h=a?.iv&&a.iv instanceof je?a.iv.toBuffer():Buffer.alloc(r),g=Zt.createCipheriv(n(f.length),f,h);a?.padding===!1&&g.setAutoPadding(!1);let m=Buffer.concat([g.update(u),g.final()]);return{ciphertext:new je(m),toString:S=>S?S.stringify(new je(m)):m.toString("base64")}}},decrypt(i,s,a){if(typeof s=="string"){let u=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,h;u.subarray(0,8).toString()==="Salted__"?(h=u.subarray(8,16),f=u.subarray(16)):(h=Buffer.alloc(0),f=u);let{key:g,iv:m}=zR(s,e,r,h),S=Zt.createDecipheriv(n(e),g,m);return new je(Buffer.concat([S.update(f),S.final()]))}else{let u=s.toBuffer(),f=a?.iv&&a.iv instanceof je?a.iv.toBuffer():Buffer.alloc(r),h=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),g=Zt.createDecipheriv(n(u.length),u,f);return a?.padding===!1&&g.setAutoPadding(!1),new je(Buffer.concat([g.update(h),g.final()]))}}}}function fB(){let t=r=>n=>{let i=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8");return new je(Zt.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),a=i instanceof je?i.toBuffer():Buffer.from(String(i),"utf8");return new je(Zt.createHmac(r,a).update(s).digest())};return{MD5:t("md5"),SHA1:t("sha1"),SHA224:t("sha224"),SHA256:t("sha256"),SHA384:t("sha384"),SHA512:t("sha512"),SHA3:t("sha3-256"),RIPEMD160:t("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:Cb("aes",32,16),DES:Cb("des",8,8),TripleDES:Cb("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof je?r.toBuffer():Buffer.from(String(r),"utf8"),a=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),u=(i?.keySize||4)*4,f=i?.iterations||1;return new je(Zt.pbkdf2Sync(s,a,f,u,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>je.fromBase64(r)},Utf8:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>je.fromUtf8(r)},Hex:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>je.fromHex(r)},Latin1:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new je(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new je(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new je(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new je(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new je(r):new je(Buffer.from(String(r))):new je(Buffer.alloc(0)),random:r=>new je(Zt.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var wi=class t{constructor(e,r=[]){this.httpService=e;this.moduleLoader=mp(r)}httpService;moduleLoader;createRequestSession(e){return new Yl({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this)},e)}createVM(e,r){let n=this.moduleLoader.getGlobalSetupExports(),i=this.moduleLoader.createRequireFunction(),s={ctx:e,hf:e,pm:e,console:r,...n||{},global:n,setTimeout,setInterval,clearTimeout,clearInterval,URL,URLSearchParams,Buffer,atob:a=>Buffer.from(a,"base64").toString("binary"),btoa:a=>Buffer.from(a,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:Zt,_:i("lodash"),require:i,moment:lf(),querystring:uB,CryptoJS:fB(),postman:{setNextRequest:a=>e.setNextRequest?.(a),setGlobalVariable:(a,u)=>e.globals?.set(a,u),getGlobalVariable:a=>e.globals?.get(a),clearGlobalVariable:a=>e.globals?.unset(a),setEnvironmentVariable:(a,u)=>e.environment?.set(a,u),getEnvironmentVariable:a=>e.environment?.get(a),clearEnvironmentVariable:a=>e.environment?.unset(a)},jsonStringify:(a,u,f)=>JSON.stringify(a,u,f),jsonParse:a=>JSON.parse(a),xml2Json:a=>{try{let u=this.moduleLoader.createRequireFunction()("xml2js"),f;return u.parseString(a,{explicitArray:!1},(h,g)=>{if(h)throw h;f=g}),f}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return KR.createContext(s)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},a={...e.environmentVariables||{}},u=e.iterationData||{},f=this.createMergedVariableScope(n,a,i,s,u),h=this.createVariableScope(s),g=this.createVariableScope(i),m=this.createEnvironmentScope(a,e.environmentName,e.onEnvironmentChange,!0),S={...m,set:(x,C)=>{let A=this.serializeValue(C);m.set(x,A),n[x]=A},unset(x){m.unset(x),delete n[x]},clear(){m.clear();for(let x of Object.keys(a))delete n[x]}};return h.replaceIn=f.replaceIn,g.replaceIn=f.replaceIn,S.replaceIn=f.replaceIn,{globals:h,collectionVariables:g,variables:f,environment:S,session:S,iterationData:{get:x=>u[x],has:x=>x in u,toObject:()=>({...u}),toJSON:()=>JSON.stringify(u)},sendRequest:this.createSendRequest(),expect:Vl,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{}return e}}createVariableScope(e){return{get:r=>this.deserializeValue(e[r]),set:(r,n)=>{e[r]=this.serializeValue(n)},has(r){return r in e},unset(r){delete e[r]},clear(){Object.keys(e).forEach(r=>delete e[r])},toObject(){return{...e}}}}createMergedVariableScope(e,r,n,i,s={}){let a={get:u=>u in e?this.deserializeValue(e[u]):u in s?s[u]:u in r?this.deserializeValue(r[u]):u in n?this.deserializeValue(n[u]):this.deserializeValue(i[u]),set:(u,f)=>{e[u]=this.serializeValue(f)},has(u){return u in e||u in s||u in r||u in r||u in n||u in i},unset(u){delete e[u]},clear(){Object.keys(e).forEach(u=>delete e[u])},toObject(){return{...i,...n,...r,...s,...e}},replaceIn(u){if(!u||typeof u!="string")return u;let f=a.toObject();return u.replace(/\{\{([^}]+)\}\}/g,(h,g)=>{let m=g.trim(),S=m.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(S)try{let C=GR(S[2],f),A=mi(S[1],C);return A!==null?String(A):h}catch{return h}let E=xl(m);if(E){let C=cB(E.input,f);if(C!==void 0){let A=Cl(C,E.filters,f);return A!==void 0?String(A):h}return h}let x=a.get(m);if(x!==void 0)return String(x);if(ks(m)){let C={};for(let[B,Y]of Object.entries(f))C[B]=QR(Y);let A=Ps(m,C),T=As(m,A);if(T!==void 0)return String(T)}return h})}};return a}createEnvironmentScope(e,r,n,i){let s=(a,u,f)=>{n&&(i?n(a,u,f):n(u||"",a==="set"?f:void 0))};return{name:r||"",get:a=>this.deserializeValue(e[a]),set:(a,u)=>{let f=this.serializeValue(u);e[a]=f,s("set",a,f)},has(a){return a in e},unset(a){delete e[a],s("unset",a)},clear(){Object.keys(e).forEach(a=>delete e[a]),s("clear")},toObject(){return{...e}}}}createSendRequest(){return this.httpService?(e,r)=>{let n=typeof e=="string"?{url:e,method:"GET"}:e,i=this.httpService.execute({url:n.url,method:n.method||"GET",headers:n.headers||{},body:n.body,...n});if(r){i.then(s=>r(null,s)).catch(s=>r(s,null));return}return i}:(e,r)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(r){r(n,null);return}return Promise.reject(n)}}};var ea=class{constructor(e,r,n,i,s){this.httpClient=e;this.forgeEnv=r;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let a=s?.forgeRoot?[require("path").join(s.forgeRoot,"modules")]:[],u=new gi(new hn,new yi,e);this.scriptExecutor=new wi(u,a)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},a={...n.additionalVariables||{}},u={...s},f=this.buildHttpRequest(e,n.overrides),h=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,h),m={request:{url:f.url,method:f.method,headers:{...f.headers},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:void 0},variables:a,collectionVariables:r.variables||{},globals:{},sessionVariables:{},environmentVariables:u,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onSessionChange:n.onSessionChange,onEnvironmentChange:n.onEnvironmentChange},S=this.scriptExecutor.createRequestSession(m),E,x;try{if(!n.skipPreRequest&&g.preRequest.length>0){let T=await S.executePreRequest(g.preRequest);if(E={success:T.success,error:T.error,modifiedVariables:T.modifiedVariables,modifiedEnvironment:T.modifiedEnvironmentVariables,modifiedGlobals:T.modifiedGlobals,modifiedCollectionVariables:T.modifiedCollectionVariables,consoleOutput:T.consoleOutput,modifiedRequest:T.modifiedRequest?{url:T.modifiedRequest.url,method:T.modifiedRequest.method,headers:T.modifiedRequest.headers,body:T.modifiedRequest.body?.content}:void 0},T.modifiedVariables&&(a={...a,...T.modifiedVariables}),T.modifiedEnvironmentVariables&&(u={...u,...T.modifiedEnvironmentVariables}),T.modifiedRequest){let B=T.modifiedRequest;B.url&&(f.url=B.url),B.method&&(f.method=B.method),B.headers&&(f.headers={...f.headers,...B.headers}),B.body!==void 0&&(f.body=B.body?.content||B.body)}if(!T.success)throw new Error(`Pre-request script failed: ${T.error}`)}let C={...u,...a};f=this.interpolateRequest(f,C);let A=await this.httpClient.send(f);if(!n.skipPostResponse&&g.postResponse.length>0){let T=await S.executePostResponse(g.postResponse,{status:A.status,statusText:A.statusText,headers:A.headers,body:A.body,cookies:Object.fromEntries(A.cookies.map(B=>[B.name,B.value])),responseTime:A.time,responseSize:A.size,executedRequest:{url:f.url,method:f.method,headers:f.headers||{},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:{type:"none",content:""},params:{},query:{}}});x={success:!0,assertions:T.testResults,consoleOutput:T.consoleOutput,modifiedEnvironment:T.modifiedEnvironmentVariables},T.modifiedEnvironmentVariables&&(u={...u,...T.modifiedEnvironmentVariables})}return{response:A,preRequestResult:E,postResponseResult:x,totalTime:Date.now()-i,finalRequest:f,variables:{environment:u,local:a}}}finally{S.dispose?.()}}async executeSimple(e,r={}){let n=e,i={...this.forgeEnv.getAll(),...r.variables||{}};return n=this.interpolateRequest(e,i),r.timeout&&(n={...n,timeout:r.timeout}),this.httpClient.send(n)}buildHttpRequest(e,r){let n=e.url;if(e.query&&e.query.length>0){let g=new URLSearchParams;for(let m of e.query)m.enabled!==!1&&g.append(m.key,m.value);n+=(n.includes("?")?"&":"?")+g.toString()}let i=r?.url||n,s=r?.method||e.method,a={};if(e.headers&&Array.isArray(e.headers))for(let g of e.headers)g.enabled!==!1&&(a[g.key]=g.value);let u={...a,...r?.headers||{}},f,h=r?.body||e.body;return h&&(typeof h=="string"?f=h:h.content&&(f=typeof h.content=="string"?h.content:JSON.stringify(h.content))),this.preprocessor&&h&&this.preprocessor.setContentTypeHeader(u,h),{url:i,method:s,headers:u,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=Wi.create(r);return{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:e.body?n.resolve(typeof e.body=="string"?e.body:JSON.stringify(e.body)):void 0}}buildScriptChain(e,r,n=[]){let i=[],s=[];r.scripts?.preRequest&&i.push(r.scripts.preRequest),r.scripts?.postResponse&&s.push(r.scripts.postResponse);for(let a of n)a.scripts?.preRequest&&i.push(a.scripts.preRequest),a.scripts?.postResponse&&s.push(a.scripts.postResponse);return e.scripts?.preRequest&&i.push(e.scripts.preRequest),e.scripts?.postResponse&&s.push(e.scripts.postResponse),{preRequest:i,postResponse:s}}findFolderPath(e,r){let n=[],i=(s,a)=>{for(let u of s){if(u.type==="request"&&u.id===r)return n.push(...a),!0;if(u.type==="folder"){let f=[...a,u];if(i(u.items,f))return!0}}return!1};return i(e.items,[]),n}};function dB(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var Jl=class{entries=new Map;requestIndex=new Map;fullResponses=new Map;maxEntriesPerRequest;storeFullResponses;constructor(e={}){this.maxEntriesPerRequest=e.maxEntriesPerRequest??100,this.storeFullResponses=e.storeFullResponses??!0}getEntries(e,r){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let a=this.entries.get(s);a&&(!r||a.environment===r)&&i.push(a)}return i}getEntry(e){return this.entries.get(e)}getFullResponse(e){return this.fullResponses.get(e)}get count(){return this.entries.size}addEntry(e,r,n,i,s){let a=dB(),u=Date.now(),f={id:a,timestamp:u,environment:i,method:r.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:r.url,method:r.method,headers:{...r.headers},body:r.body},response:{status:n.status,statusText:n.statusText,time:n.time}};this.entries.set(a,f);let h=this.requestIndex.get(e)||[];for(h.unshift(a);h.length>this.maxEntriesPerRequest;){let g=h.pop();g&&(this.entries.delete(g),this.fullResponses.delete(g))}if(this.requestIndex.set(e,h),this.storeFullResponses){let g={timestamp:u,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(a,g)}return f}deleteEntry(e){if(!this.entries.get(e))return!1;this.entries.delete(e),this.fullResponses.delete(e);for(let[n,i]of this.requestIndex.entries()){let s=i.indexOf(e);if(s!==-1){i.splice(s,1),i.length===0&&this.requestIndex.delete(n);break}}return!0}clearHistory(e){let r=this.requestIndex.get(e);if(r){for(let n of r)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var zl=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let a={method:e.method,headers:e.headers,signal:n.signal};e.body!==void 0&&!["GET","HEAD"].includes(e.method.toUpperCase())&&(typeof e.body=="string"||e.body instanceof FormData||e.body instanceof URLSearchParams?a.body=e.body:typeof e.body=="object"&&(a.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(a.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(a.redirect="manual");let u=await fetch(e.url,a),f=Date.now(),h=u.headers.get("content-type")||"",g;try{h.includes("application/json")?g=await u.json():h.includes("text/")?g=await u.text():g=await u.text()}catch{g=null}let m={};return u.headers.forEach((S,E)=>{let x=m[E];x!==void 0?m[E]=Array.isArray(x)?[...x,S]:[x,S]:m[E]=S}),{status:u.status,statusText:u.statusText,headers:m,cookies:[],body:g,time:f-r}}catch(a){throw a.name==="AbortError"?new Error(`Request timeout after ${i}ms`):a}finally{clearTimeout(s)}}};var Rb={json:"application/json",xml:"application/xml",html:"text/html",text:"text/plain",javascript:"application/javascript",css:"text/css","x-www-form-urlencoded":"application/x-www-form-urlencoded","form-data":"multipart/form-data",graphql:"application/json"},Bs=class{sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}encodeBody(e){if(!e||e.type==="none")return null;let{type:r,content:n}=e;switch(r){case"x-www-form-urlencoded":return this.encodeUrlEncodedBody(n);case"form-data":return n;case"graphql":return this.encodeGraphQLBody(n);case"raw":return n;default:return n}}encodeUrlEncodedBody(e){if(Array.isArray(e)){let r=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&r.append(n.key,n.value||"");return r.toString()}return typeof e=="string"?e:String(e)}encodeGraphQLBody(e){return typeof e=="object"&&e.query?JSON.stringify({query:e.query,variables:e.variables||void 0,operationName:e.operationName||void 0}):typeof e=="string"?e:JSON.stringify(e)}setContentTypeHeader(e,r,n){if(Object.keys(e).some(a=>a.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!r||r.type==="none")return;let s;switch(r.type){case"x-www-form-urlencoded":s=Rb["x-www-form-urlencoded"];break;case"raw":s=r.format?Rb[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=Rb.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}};var Hs=class{format="http-forge";canParse(e){try{let r=JSON.parse(e);return typeof r=="object"&&r!==null&&"id"in r&&"name"in r&&"items"in r&&Array.isArray(r.items)&&!r.info?.schema?.includes("postman")&&!r._type}catch{return!1}}parse(e,r){let n=JSON.parse(e);return{id:n.id,name:n.name,description:n.description,variables:n.variables||{},auth:n.auth,scripts:n.scripts?{preRequest:n.scripts.preRequest,postResponse:n.scripts.postResponse}:void 0,items:this.convertItems(n.items),source:{format:"http-forge",filePath:r,version:n.version}}}convertItems(e){return e.map(r=>r.type==="folder"?this.convertFolder(r):this.convertRequest(r))}convertFolder(e){return{type:"folder",id:e.id,name:e.name,description:e.description,auth:e.auth,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0,items:e.items?this.convertItems(e.items):[]}}convertRequest(e){let r={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(r[i.key]=i.value);let n={};if(e.query)for(let i of e.query)i.enabled!==!1&&(n[i.key]=i.value);return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:Object.entries(r).map(([i,s])=>({key:i,value:s,enabled:!0})),query:Object.entries(n).map(([i,s])=>({key:i,value:s,enabled:!0})),params:e.params,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0}}};var Vs=class{parse(e,r){return r.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[r]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let r=e.split(/\r?\n/).filter(s=>s.trim());if(r.length<2)return[{}];let n=this.parseCsvLine(r[0]),i=[];for(let s=1;s<r.length;s++){let a=this.parseCsvLine(r[s]),u={};n.forEach((f,h)=>{u[f]=a[h]||""}),i.push(u)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let a=e[s],u=e[s+1];a==='"'?i&&u==='"'?(n+='"',s++):i=!i:a===","&&!i?(r.push(n.trim()),n=""):n+=a}return r.push(n.trim()),r}};var Gr=Se(require("fs/promises")),Gl=Se(require("path")),Kl=class{async readFile(e){return Gr.readFile(e,"utf-8")}async writeFile(e,r){let n=Gl.dirname(e);await this.mkdir(n),await Gr.writeFile(e,r,"utf-8")}async exists(e){try{return await Gr.access(e),!0}catch{return!1}}async mkdir(e){await Gr.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=Gl.basename(s);for(let u of e)if(this.matchPattern(a,u)){i.push(s);break}})}catch{}return i}async readDir(e){return Gr.readdir(e)}async isDirectory(e){try{return(await Gr.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await Gr.readdir(e,{withFileTypes:!0});for(let i of n){let s=Gl.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,r):i.isFile()&&r(s)}}matchPattern(e,r){let n=r.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};var Sp=class t{httpClient;fileSystem;scriptExecutor;interpolator;cookieJar;interceptorChain;preprocessor;dataFileParser;requestHistory;parserRegistry;collectionLoader;environmentStore;forgeEnv;requestExecutor;options;constructor(e={}){if(this.options=e,this.interpolator=e.interpolator||new qs,this.fileSystem=e.fileSystem||new Kl,this.preprocessor=e.preprocessor||new Bs,this.dataFileParser=e.dataFileParser||new Vs,this.cookieJar=e.cookieJar||new _l,e.enableHistory?this.requestHistory=e.requestHistory||new Jl({maxEntriesPerRequest:e.maxHistoryEntries??100}):this.requestHistory=null,this.interceptorChain=e.interceptorChain||this.createInterceptorChain(e),e.httpClient)this.httpClient=e.httpClient;else if(e.useNativeHttp!==!1){let s={...e.httpSettings,timeout:e.requestTimeout??e.httpSettings?.timeout};this.httpClient=new $s(s)}else this.httpClient=new zl;let r=e.forgeRoot?[require("path").join(e.forgeRoot,"modules")]:[],n=new gi(new hn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new wi(n,r),this.parserRegistry=new bl,this.parserRegistry.register("http-forge",new Hs),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=require("path").join(e.forgeRoot,"collections");this.collectionLoader=new Sl(s)}else this.collectionLoader=new Uo(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new pi(e.environmentConfig):pi.fromVariables({}),this.forgeEnv=Wi.fromResolver(this.environmentStore),this.requestExecutor=new ea(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new yi;if(e.requestInterceptors)for(let n of e.requestInterceptors)r.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)r.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)r.addErrorInterceptor(n);return r}async loadCollection(e){if(this.collectionLoader instanceof Uo)return this.collectionLoader.load(e);throw new Error("loadCollection(filePath) is not supported with folder storage format. Use loadAllCollections() instead.")}async loadAllCollections(){return this.collectionLoader.loadAll()}async execute(e,r,n){return this.requestExecutor.execute(e,r,n)}async executeSimple(e,r){return this.requestExecutor.executeSimple(e,r)}registerParser(e,r){this.parserRegistry.register(e,r)}setEnvironmentConfig(e){this.environmentStore=new pi(e),this.forgeEnv=Wi.fromResolver(this.environmentStore),this.requestExecutor=new ea(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new t(e)}static fromForgeRoot(e="./http-forge",r={}){let n=require("path"),i=n.join(e,"environments"),s,a=wl(i);if(Object.keys(a.environments).length>0||Object.keys(a.globalVariables).length>0){s={globalVariables:{...a.globalVariables,...a.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,h]of Object.entries(a.environments)){let g=a.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...h.variables,...g}}}}else{let f=require("fs"),h=n.join(i,"environments.json");if(f.existsSync(h))try{let g=f.readFileSync(h,"utf-8"),m=JSON.parse(g);if(s={globalVariables:m.globalVariables||{},environments:{},selectedEnvironment:m.selectedEnvironment},m.environments)for(let[S,E]of Object.entries(m.environments)){let x=E;s.environments[S]={name:x.name||S,variables:x.variables||{}}}}catch(g){console.warn(`[ForgeContainer] Failed to load environments from ${h}:`,g)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};var qA=Se(require("path"));var Ql=Se(require("crypto")),hB=3e4,Zl=class{constructor(e,r,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=r;this.envConfigService=n;this.httpService=i;this.callbackPath=s}secretStore;browserService;envConfigService;httpService;callbackPath;tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,r){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,r),tokenType:e.tokenPrefix||"Bearer",raw:{}};let n=this.buildCacheKeyString(e),i=this.tokenCache.get(n);if(i&&!this.isExpired(i))return i;if(i?.refreshToken)try{return await this.refreshToken(e,i.refreshToken,r)}catch{this.tokenCache.delete(n)}if(!i){let a=await this.secretStore.get(`oauth2_refresh_${n}`);if(a)try{return await this.refreshToken(e,a,r)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,r,"client_credentials");break;case"password":s=await this.fetchToken(e,r,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,r);break;case"implicit":s=await this.implicitFlow(e,r);break;default:throw new Error(`Unknown OAuth2 grant type: ${e.grantType}`)}return this.tokenCache.set(n,s),s.refreshToken&&await this.storeRefreshToken(n,s.refreshToken),s}async refreshToken(e,r,n){let i=this.resolve(e.tokenUrl||"",n);if(!i)throw new Error("OAuth2 tokenUrl is required for token refresh");let s=this.resolve(e.clientId||"",n),a=this.resolve(e.clientSecret||"",n),u=new URLSearchParams;u.append("grant_type","refresh_token"),u.append("refresh_token",r);let f={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,f,u,s,a,n);let h=await this.httpService.execute({method:"POST",url:i,headers:f,body:u.toString()}),g=this.parseTokenResponse(h.body,e);g.refreshToken||(g.refreshToken=r);let m=this.buildCacheKeyString(e);return this.tokenCache.set(m,g),g.refreshToken&&await this.storeRefreshToken(m,g.refreshToken),g}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),u=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for authorization code flow");if(!i)throw new Error("OAuth2 tokenUrl is required for authorization code flow");if(!s)throw new Error("OAuth2 clientId is required for authorization code flow");let f=e.usePkce!==!1,h,g,m;if(f){h=this.generateCodeVerifier();let X=e.pkceMethod||"S256";g=X==="S256"?this.generateCodeChallengeS256(h):h,m=X}let S=e.state||Ql.randomBytes(16).toString("hex"),E=await this.getCallbackUri(),x=new URL(n);if(x.searchParams.set("response_type","code"),x.searchParams.set("client_id",s),x.searchParams.set("redirect_uri",E),u&&x.searchParams.set("scope",u),x.searchParams.set("state",S),g&&(x.searchParams.set("code_challenge",g),x.searchParams.set("code_challenge_method",m)),e.audience&&x.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&x.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[X,k]of Object.entries(e.extraParams))x.searchParams.set(X,this.resolve(k,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let C=new Promise((X,k)=>{this.pendingAuthCallback={resolve:X,reject:k,state:S}});await this.browserService.openExternal(x.toString());let A;try{A=await Promise.race([C,new Promise((X,k)=>setTimeout(()=>{this.pendingAuthCallback=null,k(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(A.state&&A.state!==S)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let T=new URLSearchParams;T.append("grant_type","authorization_code"),T.append("code",A.code),T.append("redirect_uri",E),h&&T.append("code_verifier",h);let B={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,B,T,s,a,r);let Y=await this.httpService.execute({method:"POST",url:i,headers:B,body:T.toString()}),H=this.parseTokenResponse(Y.body,e),K=this.buildCacheKeyString(e);return this.tokenCache.set(K,H),H.refreshToken&&await this.storeRefreshToken(K,H.refreshToken),H}async implicitFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.clientId||"",r),s=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for implicit flow");if(!i)throw new Error("OAuth2 clientId is required for implicit flow");let a=e.state||Ql.randomBytes(16).toString("hex"),u=await this.getCallbackUri(),f=new URL(n);if(f.searchParams.set("response_type","token"),f.searchParams.set("client_id",i),f.searchParams.set("redirect_uri",u),s&&f.searchParams.set("scope",s),f.searchParams.set("state",a),e.audience&&f.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[E,x]of Object.entries(e.extraParams))f.searchParams.set(E,this.resolve(x,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let h=new Promise((E,x)=>{this.pendingImplicitCallback={resolve:E,reject:x,state:a}});await this.browserService.openExternal(f.toString());let g;try{g=await Promise.race([h,new Promise((E,x)=>setTimeout(()=>{this.pendingImplicitCallback=null,x(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(g.state&&g.state!==a)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let m={accessToken:g.accessToken,tokenType:g.tokenType||e.tokenPrefix||"Bearer",expiresAt:g.expiresIn?Date.now()+g.expiresIn*1e3:void 0,raw:{access_token:g.accessToken,token_type:g.tokenType,expires_in:g.expiresIn}},S=this.buildCacheKeyString(e);return this.tokenCache.set(S,m),m}handleAuthorizationCallback(e,r,n){if(n){let i=new Error(`OAuth2 authorization error: ${n}`);this.pendingAuthCallback?.reject(i),this.pendingImplicitCallback?.reject(i),this.pendingAuthCallback=null,this.pendingImplicitCallback=null;return}if(e&&this.pendingAuthCallback){this.pendingAuthCallback.resolve({code:e,state:r}),this.pendingAuthCallback=null;return}!e&&!this.pendingAuthCallback&&this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow did not receive access_token")),this.pendingImplicitCallback=null)}handleImplicitCallback(e,r,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:r,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let r=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(r),this.secretStore.delete(`oauth2_refresh_${r}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,r,n){let i=this.resolve(e.tokenUrl||"",r);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),u=e.scope?this.resolve(e.scope,r):void 0,f=new URLSearchParams;if(f.append("grant_type",n),u&&f.append("scope",u),n==="password"){let m=this.resolve(e.username||"",r),S=this.resolve(e.password||"",r);if(!m)throw new Error("OAuth2 password grant requires username");f.append("username",m),f.append("password",S)}if(e.audience&&f.append("audience",this.resolve(e.audience,r)),e.resource&&f.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[m,S]of Object.entries(e.extraParams))f.append(m,this.resolve(S,r));let h={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,h,f,s,a,r);let g=await this.httpService.execute({method:"POST",url:i,headers:h,body:f.toString()});return this.parseTokenResponse(g.body,e)}applyClientAuth(e,r,n,i,s,a){if(e.clientAuthentication==="header"){let u=Buffer.from(`${i}:${s}`).toString("base64");r.Authorization=`Basic ${u}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,r){if(!e||typeof e!="object")throw new Error("OAuth2 token response is not a valid JSON object");let n=e,i=r.tokenField||"access_token",s=n[i];if(!s)throw new Error(`OAuth2 token fetch failed: '${i}' not present in response`);let a=typeof n.expires_in=="number"?n.expires_in:void 0;return{accessToken:s,tokenType:n.token_type||r.tokenPrefix||"Bearer",expiresAt:a?Date.now()+a*1e3:void 0,refreshToken:n.refresh_token,scope:n.scope,raw:n}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-hB:!1}buildCacheKeyString(e){return`${e.tokenUrl||""}|${e.clientId||""}|${e.scope||""}|${e.grantType}`}async getCallbackUri(){let e=`${this.browserService.uriScheme}://${this.callbackPath}`;return this.browserService.asExternalUri(e)}resolve(e,r){return this.envConfigService.resolveVariables(e,r)}generateCodeVerifier(){return Ql.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Ql.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}};var ta=Se(require("fs")),Ws=Se(require("path"));function ra(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&ta.writeFileSync(t,r.join(`
|
|
223
|
+
`),"utf-8")}function Xl(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&ta.writeFileSync(Ws.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&ta.writeFileSync(Ws.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function ZR(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return Ws.isAbsolute(n)?n:Ws.join(t,n)}async function XR(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function ff(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=Ws.join(e,_t(n.name));ta.mkdirSync(i,{recursive:!0}),Xl(i,_t(n.name),n.scripts),ff(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=_t(i.name)+".http",a=Ws.join(e,s),u=pB(i,r);ta.writeFileSync(a,u,"utf-8"),Xl(e,_t(i.name),i.scripts)}})}function pB(t,e){let r=[];r.push(`### ${e.name} / ${t.name}`),r.push(`# collection env: ${_t(e.name)}.env`),r.push(`# request scripts: ${_t(t.name)}.pre.js and .post.js`);let n=mB(t);return r.push(`${t.method} ${n}`),(t.headers||[]).filter(i=>i.enabled!==!1).forEach(i=>{r.push(`${i.key}: ${i.value}`)}),t.body&&t.body.content&&r.push("",t.body.content),r.join(`
|
|
224
|
+
`)}function mB(t){let e=t.url;if(t.query&&t.query.length){let r=t.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");r&&(e+=(e.includes("?")?"&":"?")+r)}return e}var lr=Se(require("fs")),Ib=Se(require("path"));var na=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){lr.existsSync(this.collectionsDir)||lr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!lr.existsSync(this.collectionsDir))return[];let e=lr.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=Ib.join(this.collectionsDir,n),s=lr.readFileSync(i,"utf-8"),a=JSON.parse(s);a.id&&a.name&&(this.cache.set(a.id,a),r.push(a))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return r}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.getCollectionPath(e);if(lr.existsSync(r))try{let n=lr.readFileSync(r,"utf-8"),i=JSON.parse(n);return this.cache.set(e,i),i}catch(n){console.error(`[JsonCollectionLoader] Failed to load collection ${e}:`,n);return}}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=lt(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await lr.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!lr.existsSync(r))return!1;try{return await lr.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return lr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return Ib.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||lt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r);s&&(s.scripts=n,await this.save(i))}loadScripts(e,r){let n=this.load(e);return n?this.findItemById(n.items,r)?.scripts:void 0}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth),await this.save(n)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r.id);if(s)Object.assign(s,r);else if(n){let a=this.findItemById(i.items,n);if(a&&a.type==="folder")a.items=a.items||[],a.items.push(r);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(r);await this.save(i)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,r);return i&&await this.save(n),i}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let{id:a,type:u,...f}=n;return Object.assign(s,f),await this.save(i),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let a={...s};if(!this.deleteItemById(i.items,r))return!1;if(n){let u=this.findItemById(i.items,n);if(u&&u.type==="folder")u.items=u.items||[],u.items.push(a);else return i.items.push(a),!1}else i.items.push(a);return await this.save(i),!0}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;try{let s;if(r){let f=this.findItemById(i.items,r);if(!f||!f.items)return!1;s=f.items}else s=i.items;let a=new Map(s.map(f=>[f.id,f])),u=[];for(let f of n){let h=a.get(f);h&&(u.push(h),a.delete(f))}for(let f of a.values())u.push(f);if(r){let f=this.findItemById(i.items,r);f&&(f.items=u)}else i.items=u;return await this.save(i),!0}catch(s){return console.error("[JsonCollectionLoader] Failed to reorder items:",s),!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}deleteItemById(e,r){for(let n=0;n<e.length;n++){if(e[n].id===r)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}};var eu=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new Vi(n):new na(n)}static createForFormat(e,r){return e==="folder"?new Vi(r):new na(r)}};var yt=Se(require("fs")),Wn=Se(require("path"));function eI(t){if(typeof t!="string")return"text";let e=t.trim();try{let r=JSON.parse(e);if(typeof r=="object"&&r!==null)return"json"}catch{}return/^<\?xml/.test(e)||/^<([a-zA-Z_][\w\-\.]*)[\s>]/.test(e)?/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":"xml":/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":/^(function\s*\(|\(\)\s*=>|const |let |var |export |import )/.test(e)?"javascript":"text"}function gB(t){return{info:{name:t.name,_postman_id:t.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:t.items.map(e=>tI(e)),event:Ob(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function tI(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(tI):[],event:Ob(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(r=>r.enabled!==!1).map(yB),url:vB(e),body:SB(e),auth:bB(e.auth),description:e.description},event:Ob(e.scripts),protocolProfileBehavior:_B(e.settings)}}}function yB(t){return{key:t.key,value:t.value,disabled:t.enabled===!1}}function vB(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let h=i[1];/^{{.*}}$/.test(h)?n=[h]:n=h.split(".")}let s=[],a=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(a&&a[1]!==void 0){let h=a[1].replace(/^\//,"");h.endsWith("/")?(s=h.slice(0,-1).split("/"),s.push("")):s=h.length>0?h.split("/"):[]}let u;if(Array.isArray(t.query)&&t.query.length>0)u=t.query.map(h=>{let g={key:h.key,value:h.value};return h.enabled===!1&&(g.disabled=!0),g});else{let h=r.indexOf("?");h!==-1&&(u=r.substring(h+1).split("&").map(m=>{let[S,...E]=m.split("=");return{key:S,value:E.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([h,g])=>({key:h,value:String(g)}))),{raw:e,host:n.length>0?n:void 0,path:s.length>0?s:void 0,query:u&&u.length>0?u:void 0,variable:f&&f.length>0?f:void 0}}function SB(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=eI(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||eI(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let r=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(r)return{mode:"formdata",formdata:r.map(s=>({key:s.key,value:s.value,type:s.type||"text",disabled:s.enabled===!1}))};let n=e.type==="x-www-form-urlencoded"&&Array.isArray(e.content)?e.content:e.type==="urlencoded"&&Array.isArray(e.fields)?e.fields:null;if(n)return{mode:"urlencoded",urlencoded:n.map(s=>({key:s.key,value:s.value,disabled:s.enabled===!1}))};if(e.type==="file"&&e.fileName)return{mode:"file",file:{src:e.fileName}};if(e.type==="binary")return{mode:"binary",file:{}};let i=e.type==="graphql"?e.content??(e.query?e:null):null;if(i){let s=i.query??"",a=i.variables;return{mode:"graphql",graphql:{query:s,variables:a?typeof a=="string"?a:JSON.stringify(a):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function bB(t){if(!(!t||!t.type||t.type==="none")){if(t.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:t.bearerToken,type:"string"}]};if(t.type==="basic"&&t.basicAuth)return{type:"basic",basic:[{key:"username",value:t.basicAuth.username,type:"string"},{key:"password",value:t.basicAuth.password,type:"string"}]}}}function _B(t){if(!t)return;let e={};return t.followRedirects===!1&&(e.followRedirects=!1),t.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),t.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),t.maxRedirects!==void 0&&(e.maxRedirects=t.maxRedirects),t.strictSSL===!1&&(e.disableUrlEncoding=!1),t.timeout!==void 0&&(e.requestTimeout=t.timeout),Object.keys(e).length>0?e:void 0}function Ob(t){if(!t)return[];let e=[];return t.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[t.preRequest]}}),t.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[t.postResponse]}}),e}var tu=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=eu.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){yt.existsSync(this.collectionsDir)||yt.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.loadCollections(),this.onCollectionsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=lt(e.name)),await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,n);if(s){let a=this.findItemRecursive(i.items,r);if(a){let{id:u,type:f,...h}=n;Object.assign(a,h)}}return s}async addRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;r.id||(r.id=lt(r.name));try{if(await this.loader.saveItem(e,r,n),n){let s=this.findItemRecursive(i.items,n);s&&s.type==="folder"&&(s.items=s.items||[],s.items.push(r))}else i.items.push(r);return!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(a=>a.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,r,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===r)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,r,n))return!0}return!1}deleteItemRecursive(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,r))return!0}return!1}collectRequestsRecursive(e,r){for(let n of e)n.type==="request"?r.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,r)}async createCollection(e){let r={id:lt(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);let i=lt(r),s=this.loader.getCollectionPath(e),a=Wn.join(this.collectionsDir,i);if(!yt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let u=Wn.join(a,"collection.json");if(yt.existsSync(u)){let h=JSON.parse(yt.readFileSync(u,"utf-8"));h.id=i,h.name=r,yt.writeFileSync(u,JSON.stringify(h,null,2))}else yt.writeFileSync(u,JSON.stringify({id:i,name:r},null,2));this.loadCollections();let f=this.collections.get(i);if(!f)throw new Error("Failed to load duplicated collection");return f}async createFolder(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:lt(e.name),type:"folder",name:e.name,items:[]};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async deleteFolder(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async duplicateFolder(e,r,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,r);if(!s||!yt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let a=Wn.dirname(s),u=lt(n),f=Wn.join(a,u);this.copyDirRecursive(s,f);let h=Wn.join(f,"folder.json");if(yt.existsSync(h)){let S=JSON.parse(yt.readFileSync(h,"utf-8"));S.id=u,S.name=n,yt.writeFileSync(h,JSON.stringify(S,null,2))}else yt.writeFileSync(h,JSON.stringify({id:u,name:n,type:"folder"},null,2));let g=this.loader.load(e);g&&this.collections.set(e,g);let m=this.findItemById(g?.items||[],u);return m||{id:u,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:e.id||lt(e.name),type:"request",name:e.name,method:e.method||"GET",url:e.url,params:e.params,query:e.query,headers:e.headers,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts,deprecated:e.deprecated,description:e.description,doc:e.doc,responseSchema:e.responseSchema,bodySchema:e.bodySchema};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async renameRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}copyDirRecursive(e,r){yt.existsSync(r)||yt.mkdirSync(r,{recursive:!0});for(let n of yt.readdirSync(e,{withFileTypes:!0})){let i=Wn.join(e,n.name),s=Wn.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):yt.copyFileSync(i,s)}}deleteItemById(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}async importCollection(e){let r=yt.readFileSync(e,"utf-8"),n;try{n=JSON.parse(r)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||lt(n.name||"Imported Collection"),name:n.name||"Imported Collection",description:n.description,items:n.items||[]};return await this.saveCollection(i),i}async importPostmanCollection(e){let r=h=>{if(!h)return;switch(h.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:h.bearer?.find(T=>T.key==="token")?.value||""};case"basic":let S=h.basic?.find(T=>T.key==="username"),E=h.basic?.find(T=>T.key==="password");return{type:"basic",basicAuth:{username:S?.value||"",password:E?.value||""}};case"apikey":let x=h.apikey?.find(T=>T.key==="key"),C=h.apikey?.find(T=>T.key==="value"),A=h.apikey?.find(T=>T.key==="in");return{type:"apikey",apikey:{key:x?.value||"",value:C?.value||"",in:A?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=h=>{if(!Array.isArray(h)||h.length===0)return;let g={};for(let m of h){let S=m.script?.exec;if(!S)continue;let E=Array.isArray(S)?S.join(`
|
|
225
|
+
`):S;m.listen==="prerequest"?g.preRequest=E:m.listen==="test"&&(g.postResponse=E)}return g.preRequest||g.postResponse?g:void 0},i=h=>{if(!h||typeof h!="object")return;let g={};return h.followRedirects===!1&&(g.followRedirects=!1),h.followOriginalHttpMethod===!0&&(g.followOriginalMethod=!0),h.followAuthorizationHeader===!1&&(g.followAuthHeader=!1),h.maxRedirects!==void 0&&(g.maxRedirects=h.maxRedirects),h.requestTimeout!==void 0&&(g.timeout=h.requestTimeout),Object.keys(g).length>0?g:void 0},s=h=>{if(!h||typeof h=="string")return;let g=h.query;if(!(!Array.isArray(g)||g.length===0))return g.map(m=>({key:m.key||"",value:m.value||"",enabled:m.disabled!==!0}))},a=h=>{if(typeof h=="string")return h;if(!h)return"";let g=new Set;if(Array.isArray(h.variable))for(let S of h.variable)S.key&&g.add(S.key);if(g.size===0&&h.raw)return h.raw;let m="";if(h.protocol&&(m+=h.protocol+"://"),h.host&&(m+=Array.isArray(h.host)?h.host.join("."):h.host),h.port&&(m+=":"+h.port),h.path){let E=(Array.isArray(h.path)?h.path:[h.path]).map(x=>{let C=x.startsWith(":")?x.substring(1):x;return g.has(C)?":"+C:(x.startsWith(":"),x)});m+="/"+E.join("/")}return!m&&h.raw?h.raw:m},u=h=>h.map(g=>{if(g.item)return{id:lt(g.name),type:"folder",name:g.name,description:g.description,auth:r(g.auth),scripts:n(g.event),items:u(g.item)};{let m=g.request||{};return{id:lt(g.name),type:"request",name:g.name,description:g.description||m.description,method:typeof m.method=="string"?m.method:"GET",url:a(m.url),query:s(m.url),headers:Array.isArray(m.header)?m.header.map(S=>({key:S.key||S.name||"",value:S.value||S.value||"",enabled:S.disabled!==!0})):[],body:(()=>{let S=m.body;if(S){if(S.mode==="raw"&&S.raw){let E=S.options?.raw?.language;return{type:"raw",format:E==="xml"?"xml":E==="html"?"html":E==="javascript"?"javascript":E==="text"?"text":"json",content:S.raw}}if(S.mode==="urlencoded"&&Array.isArray(S.urlencoded))return{type:"x-www-form-urlencoded",content:S.urlencoded.map(E=>({key:E.key||"",value:E.value||"",enabled:E.disabled!==!0}))};if(S.mode==="formdata"&&Array.isArray(S.formdata))return{type:"form-data",content:S.formdata.map(E=>({key:E.key||"",value:E.value||"",type:E.type||"text",enabled:E.disabled!==!0}))};if(S.mode==="graphql"&&S.graphql){let E;if(S.graphql.variables)try{E=JSON.parse(S.graphql.variables)}catch{E=void 0}return{type:"graphql",content:{query:S.graphql.query||"",variables:E}}}if(S.mode==="binary")return{type:"binary",content:""}}})(),auth:r(m.auth),scripts:n(g.event),settings:i(g.protocolProfileBehavior)}}}),f={id:lt(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:r(e.auth),scripts:n(e.event),items:u(e.item||[])};return await this.saveCollection(f),f}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=gB(n),s=JSON.stringify(i,null,2);yt.writeFileSync(r,s,"utf-8")}async exportCollectionAsRestClientFolder(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Wn.join(r,_t(n.name));yt.mkdirSync(i,{recursive:!0});let s=n.variables||{};ra(Wn.join(i,`${_t(n.name)}.env`),s),Xl(i,_t(n.name),n.scripts),ff(n.items,i,n)}dispose(){this.fileWatcher?.dispose()}};var Mr=Se(require("fs")),Sn=Se(require("path"));var Jt={version:"1.0",storage:{format:"folder",root:"./http-forge-assets",history:"./.http-forge-cache/histories",results:"./.http-forge-cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0},scripts:{modulePaths:["./http-forge-assets/src","./http-forge-assets/lib"]},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:50,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null},ia={config:"http-forge.config.json"},Ys={collections:"collections",environments:"environments",flows:"flows",suites:"suites"};var sa=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=Sn.join(e,ia.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!Mr.existsSync(this.configPath))return{...Jt};try{let e=Mr.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${ia.config}. Using default configuration.`),{...Jt}}}mergeWithDefaults(e){return{version:e.version??Jt.version,storage:{...Jt.storage,...e.storage},request:{...Jt.request,...e.request},scripts:{...Jt.scripts,...e.scripts},runner:{...Jt.runner,...e.runner},environments:{...Jt.environments,...e.environments},restClientExport:{...Jt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Jt.proxy,mcp:{...Jt.mcp,...e.mcp,cors:{...Jt.mcp.cors,...e.mcp?.cors}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,ia.config);let e=()=>{this.reload()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getConfig(){return this.config}getStorageConfig(){return this.config.storage}getRequestConfig(){return this.config.request}getScriptsConfig(){return this.config.scripts}getRunnerConfig(){return this.config.runner}getEnvironmentsConfig(){return this.config.environments}getRestClientExportPath(){let e=this.config.restClientExport?.path||"collections-rest-client";return Sn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){return this.config.mcp??Jt.mcp}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return Sn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return Sn.join(this.getRootPath(),Ys.collections)}getEnvironmentsPath(){return Sn.join(this.getRootPath(),Ys.environments)}getFlowsPath(){return Sn.join(this.getRootPath(),Ys.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return Sn.join(this.getRootPath(),Ys.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return Mr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(Jt,null,2);await Mr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Mr.existsSync(i)||await Mr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Mr.existsSync(i)||await Mr.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await Mr.promises.writeFile(Sn.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await Mr.promises.writeFile(Sn.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await Mr.promises.writeFile(Sn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}};var wB="httpForge.cookies",ru=class{constructor(e,r=wB){this.store=e;this.storeKey=r;this.loadCookies()}store;storeKey;cookies=new Map;loadCookies(){try{let e=this.store.get(this.storeKey);e&&(this.cookies=new Map(Object.entries(e)),this.cleanExpiredCookies())}catch(e){console.error("[CookieService] Failed to load cookies:",e)}}async saveCookies(){try{let e={};this.cookies.forEach((r,n)=>{e[n]=r}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}async set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e),await this.saveCookies()}async setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}await this.saveCookies()}has(e,r){return this.get(e,r)!==void 0}async delete(e,r,n){let i=this.getCookieKey(e,r,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return ut.formatCookieHeader(r)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,r){return ut.parseCookieHeaders(e,r)}isExpired(e){return ut.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r);e.length>0&&this.saveCookies()}domainMatches(e,r){return ut.domainMatches(e,r)}get count(){return this.cookies.size}};var nu=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}cookieService;localCache=[];pendingOperations=[];get(e,r){return r?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===r||r.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,r){return this.get(e,r)!==void 0}set(e){let r=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));r>=0?this.localCache[r]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,r,n){let i=this.localCache.findIndex(s=>s.name===e&&(!r||s.domain===r||s.domain&&r.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:r,path:n}),!0}getAll(e){return e?this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,r){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(r,n);i.length>0&&(i.forEach(s=>{let a=this.localCache.findIndex(u=>u.name===s.name&&u.domain===(s.domain||n));a>=0?this.localCache[a]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let r=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(ut.isExpired(s)||s.domain&&!ut.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return ut.formatCookieHeader(i)}clear(){this.localCache=[],this.pendingOperations.push({type:"clear"})}async flush(){for(let e of this.pendingOperations)switch(e.type){case"set":e.cookie&&await this.cookieService.set(e.cookie);break;case"delete":e.name&&await this.cookieService.delete(e.name,e.domain,e.path);break;case"clear":await this.cookieService.clear();break}this.pendingOperations=[]}};var Ut=Se(require("fs")),Qr=Se(require("path"));function df(t){try{let e=JSON.parse(typeof t=="string"?t:t.toString("utf-8"));if(!e)return null;let r=e.environment||e,n=r.name||e.name||"imported-environment",i=r.values||r.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let u of i){if(!u)continue;let f=u.key??u.name,h=typeof u.enabled=="boolean"?u.enabled:!0;f&&h!==!1&&(s[f]=u.value??u.initial??"")}else if(typeof i=="object"&&i!==null)for(let[u,f]of Object.entries(i))s[u]=String(f??"");let a=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:a}}catch{return null}}async function rI(t,e){try{let r=await e.readFile(t);return df(r)}catch{return null}}var hf={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},iu=class{constructor(e,r,n,i){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;let s=n.getEnvironmentsPath();this.environmentsPath=s,this.sharedConfigPath=Qr.join(s,"_global.json"),this.localConfigPath=Qr.join(s,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r.get(hf.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.loadPersistedEnvironmentOverrides(),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Ut.existsSync(this.environmentsPath))return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.environmentsPath,"**/*.json");let e=()=>{this.reload(),this.onEnvironmentsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}dispose(){this.fileWatcher?.dispose()}getWorkspaceFolder(){return this.workspaceFolder}getRootPath(){return this.configService.getRootPath()}loadConfigs(){if(!Ut.existsSync(this.environmentsPath)){this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}},this.localConfig={credentials:{},variables:{}};return}this.loadFolderConfigs()}getSharedConfig(){return this.sharedConfig||this.loadConfigs(),this.sharedConfig}getLocalConfig(){return this.localConfig||this.loadConfigs(),this.localConfig}getEnvironmentNames(){let e=this.getSharedConfig();return e?.environments?Object.keys(e.environments):[]}getSelectedEnvironment(){return this.selectedEnvironment}async setSelectedEnvironment(e){if(this.selectedEnvironment=e,await this.workspaceStore.update(hf.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let r=this.getEnvOverridesStateKey(e),n=this.workspaceStore.get(r,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}}getEnvOverridesStateKey(e){return`${hf.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),r=this.workspaceStore.get(e,{});r&&Object.keys(r).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...r})}persistEnvironmentOverrides(e){let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore.update(r,n)}setEnvironmentVariable(e,r){let n=this.selectedEnvironment;this.localEnvironmentValues.has(n)||this.localEnvironmentValues.set(n,{}),this.localEnvironmentValues.get(n)[e]=String(r),this.persistEnvironmentOverrides(n)}deleteEnvironmentVariable(e){let r=this.selectedEnvironment,n=this.localEnvironmentValues.get(r);n&&(delete n[e],this.persistEnvironmentOverrides(r))}clearEnvironmentVariables(){let e=this.selectedEnvironment;this.localEnvironmentValues.set(e,{}),this.persistEnvironmentOverrides(e)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}async setSessionVariable(e,r){this.setEnvironmentVariable(e,r)}getSessionVariable(e){return this.getEnvironmentVariableLocal(e)}getSessionVariables(){return this.getEnvironmentVariableLocals()}async deleteSessionVariable(e){this.deleteEnvironmentVariable(e)}async clearSessionVariables(){this.clearEnvironmentVariables()}hasSessionVariable(e){return this.getEnvironmentVariableLocal(e)!==void 0}getResolvedEnvironment(e){let r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],a=i?.credentials?.[r],u=i?.variables||{},f=a?.variables||{},h=a&&a.headers||{},g=yl(n.defaultHeaders||{},h),m=this.localEnvironmentValues.get(r)||{},S={...n.globalVariables||{},...s.variables||{},...u,...f,...m};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:g,variables:S}}resolveVariables(e,r){return this.createResolver(r).resolveString(e,!0)}exportEnvironmentsToFolder(e,r=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!r&&Object.keys(s).length){let a=Qr.join(e,"globals.env");ra(a,s)}n.forEach(a=>{let u=i?.environments?.[a];if(!u)return;let f={...u.variables||{}};r&&(f={...s,...f});let h=Qr.join(e,`${_t(a)}.env`);ra(h,f)})}resolveVariablesWithExtra(e,r,n){return this.createResolver(n,r).resolveString(e,!0)}resolveVariablesInObject(e,r){return this.createResolver(r).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,r,n){return this.createResolver(n,r).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return Qr.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Ut.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let r={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,r);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),a={variables:i.variables||{}};this.saveJsonFile(s,a)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=Ut.readFileSync(e,"utf-8"),n=df(r);if(!n)throw new Error("Failed to parse Postman environment file");this.sharedConfig||this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}});let i=n.name||`imported-${Date.now()}`;return this.sharedConfig.environments=this.sharedConfig.environments||{},this.sharedConfig.environments[i]=this.sharedConfig.environments[i]||{},this.sharedConfig.environments[i].variables=n.variables,n.description&&(this.sharedConfig.environments[i].description=n.description),this.saveSharedConfig(this.sharedConfig),n}catch(r){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",r),r}}saveEnvLocalConfig(e,r){let n=this.getEnvLocalConfigPath(e),i={variables:r};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:r}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return Qr.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=wl(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,r){let s={...this.getResolvedEnvironment(e)?.variables||{},...this.getSessionVariables(),...r||{}};return new Ts({globals:{},collectionVariables:{},environmentVariables:s,sessionVariables:{},variables:{}})}saveFolderSharedConfig(e){Ut.existsSync(this.environmentsPath)||Ut.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Ut.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!Ic(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=Qr.basename(s,".json");if(!i.has(a))try{Ut.unlinkSync(Qr.join(this.environmentsPath,s))}catch{}}for(let[s,a]of Object.entries(e.environments||{})){let u={name:s,description:a.description,requiresConfirmation:a.requiresConfirmation,variables:a.variables||{}};this.saveJsonFile(Qr.join(this.environmentsPath,`${s}.json`),u)}}reload(){this.sharedConfig=null,this.localConfig=null,this.loadConfigs()}getAllEnvironments(){return this.loadConfigs(),this.sharedConfig?Object.entries(this.sharedConfig.environments).map(([e,r])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:r.variables||{}})):[]}async setActiveEnvironment(e){await this.setSelectedEnvironment(e)}async createEnvironment(e){if(this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{}}),this.sharedConfig.environments[e])throw new Error(`Environment "${e}" already exists`);this.sharedConfig.environments[e]={description:`Created ${new Date().toISOString()}`,variables:{}},this.saveSharedConfig(this.sharedConfig)}async deleteEnvironment(e){if(this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentExists(e),delete this.sharedConfig.environments[e],this.selectedEnvironment===e){let r=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=r.length>0?r[0]:"dev",await this.workspaceStore.update(hf.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(r);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[r]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[r].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),r!==e&&(this.validateEnvironmentNameNotTaken(r),this.sharedConfig.environments[r]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=r,await this.workspaceStore.update(hf.SELECTED_ENVIRONMENT,r)),this.saveSharedConfig(this.sharedConfig))}validateEnvironmentName(e){if(!e||e.trim().length===0)throw new Error("Environment name cannot be empty");if(e.length>128)throw new Error("Environment name cannot exceed 128 characters");if(!/^[a-zA-Z0-9_\-\.]+$/.test(e))throw new Error("Environment name can only contain letters, numbers, hyphens, underscores, and dots")}validateEnvironmentExists(e){if(!this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" not found`)}validateEnvironmentNameNotTaken(e){if(this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" already exists`)}validateConfigLoaded(){if(!this.sharedConfig)throw new Error("No environment configuration loaded")}async updateEnvironmentVariables(e,r){if(this.loadConfigs(),!this.sharedConfig)throw new Error("No configuration loaded");let n=this.sharedConfig.environments[e];if(!n)throw new Error(`Environment "${e}" not found`);n.variables=r,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!Ut.existsSync(e))return null;let r=Ut.readFileSync(e,"utf-8");return JSON.parse(r)}catch(r){return console.error(`Failed to load JSON from ${e}:`,r),null}}saveJsonFile(e,r){try{let n=Qr.dirname(e);Ut.existsSync(n)||Ut.mkdirSync(n,{recursive:!0}),Ut.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}};var su=class t{constructor(e,r,n,i,s,a,u,f,h,g,m,S){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=a;this.collectionScripts=u;this.folderScriptsChain=f;this.onConsoleOutput=h;this.collectionName=g;this.iteration=m;this.iterationCount=S}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;iteration;iterationCount;async execute(e,r,n){let i=Date.now();return this.executeWithSession(e,r,n,i)}async executeWithSession(e,r,n,i){let s=this.collectPreRequestScripts(e),a=this.collectPostResponseScripts(e),u=this.envConfigService.getResolvedEnvironment(this.environment);if(!u)throw new Error(`Environment "${this.environment}" not found or not configured`);let f={request:e,variables:{...r},environmentVariables:u.variables||{},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(m,S,E)=>{m==="set"&&S&&E!==void 0?this.envConfigService.setEnvironmentVariable(S,E):m==="unset"&&S?this.envConfigService.deleteEnvironmentVariable(S):m==="clear"&&this.envConfigService.clearEnvironmentVariables()}},h=this.scriptExecutor.createRequestSession(f),g=null;try{let m={...r},S={...e},E;if(s.length>0){let D=await h.executePreRequest(s);if(D.consoleOutput&&D.consoleOutput.length>0&&this.onConsoleOutput?.(D.consoleOutput),D.nextRequest!==void 0&&(E=D.nextRequest),D.skipRequest){let L={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:L,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:m,nextRequest:E}}D.success&&(D.modifiedRequest&&(D.modifiedRequest.url&&(S.url=D.modifiedRequest.url),D.modifiedRequest.headers&&(S.headers=D.modifiedRequest.headers),D.modifiedRequest.params&&(S.params=D.modifiedRequest.params),D.modifiedRequest.query&&(S.query=D.modifiedRequest.query),D.modifiedRequest.body!==void 0&&(S.body=D.modifiedRequest.body)),D.modifiedVariables&&(m=D.modifiedVariables))}g=await this.requestPreparer.prepareRequest(S,this.environment,u,m);let{url:x,headers:C,body:A,method:T}=g,B={};for(let D in C)Object.prototype.hasOwnProperty.call(C,D)&&(B[D.toUpperCase()]=C[D]);if(!B.COOKIE&&S.settings?.includeCookies!==!1&&this.cookieJar){let L=this.cookieJar.getCookieHeader(x);L&&(B.COOKIE=L)}let Y={method:T,url:x,headers:B,body:A.content,signal:n,settings:S.settings?{timeout:S.settings.timeout,followRedirects:S.settings.followRedirects,maxRedirects:S.settings.maxRedirects,strictSSL:S.settings.strictSSL}:void 0},H=await this.httpService.execute(Y);this.cookieJar&&H.headers&&await this.cookieJar.setCookiesFromResponse(x,H.headers);let K=Date.now()-i,X=[],k={},w;if(a.length>0){let D=0;if(H.body)if(typeof H.body=="string")D=Buffer.byteLength(H.body,"utf8");else if(Buffer.isBuffer(H.body))D=H.body.length;else try{D=Buffer.byteLength(JSON.stringify(H.body),"utf8")}catch{D=0}let L={};H.cookies&&Array.isArray(H.cookies)&&H.cookies.forEach(ae=>{ae.name&&(L[ae.name]=ae.value)});let z={executedRequest:g,status:H.status,statusText:H.statusText,headers:vp(H.headers||{}),body:H.body,cookies:L,responseTime:H.time,responseSize:D},Z=await h.executePostResponse(a,z);X=Z.testResults,k=Z.modifiedEnvironmentVariables||{},w=Z.visualizerData,Z.nextRequest!==void 0&&(E=Z.nextRequest),Z.consoleOutput&&Z.consoleOutput.length>0&&this.onConsoleOutput?.(Z.consoleOutput)}let P=X.length===0||X.every(D=>D.passed),N=X.length>0?P:H.status>=200&&H.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...g,headers:B},response:{status:H.status,statusText:H.statusText,headers:H.headers||{},body:H.body,time:H.time||K,cookies:H.cookies||[]},duration:K,timestamp:Date.now(),passed:N,assertions:X,modifiedVariables:m,modifiedEnvironmentVariables:k,nextRequest:E,visualizerData:w}}catch(m){return this.handleError(e,g,m,i)}finally{h.dispose?.()}}collectPreRequestScripts(e){let r=[];if(this.collectionScripts?.preRequest&&r.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&r.push(n.preRequest);else this.folderScriptsChain.preRequest&&r.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&r.push(e.scripts.preRequest),r}collectPostResponseScripts(e){let r=[];if(e.scripts?.postResponse&&r.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&r.push(i.postResponse)}else this.folderScriptsChain.postResponse&&r.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&r.push(this.collectionScripts.postResponse),r}handleError(e,r,n,i){let s=Date.now()-i,a=r?.method||e.method,u=r?.url||e.url;this.onConsoleOutput?.([`[error] ${e.name}: ${n.message||n}`]);let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),h=n?.stack?String(n.stack):"",g=this.errorBodyFormat,m,S;g==="html"||g==="both"?(m=t.formatErrorAsHtml(f,h),S={"content-type":"text/html; charset=utf-8"}):(m=f,S={});let E={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:u||"",method:a||"GET",headers:r?.headers||{},body:r?.body||E,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:S,cookies:[],body:m,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
226
226
|
<html>
|
|
227
227
|
<body style="font-family:system-ui,Segoe UI,Roboto,-apple-system,Helvetica,Arial,sans-serif;padding:12px;color:#c7254e;">
|
|
228
228
|
<h2 style="margin-top:0;color:#a94442">Request Error</h2>
|
|
@@ -231,7 +231,7 @@ Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}fin
|
|
|
231
231
|
${n(r)}
|
|
232
232
|
</pre>`:""}
|
|
233
233
|
</body>
|
|
234
|
-
</html>`}};var
|
|
234
|
+
</html>`}};var ou=class{constructor(e,r,n,i,s){this.envConfigService=e;this.httpService=r;this.preprocessor=n;this.tokenManager=i;this.appInfo=s}envConfigService;httpService;preprocessor;tokenManager;appInfo;async prepareRequest(e,r,n,i){let s=i&&Object.keys(i).length>0,a=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.params||{},i,r):this.envConfigService.resolveVariablesInObject(e.params||{},r),u=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.query||{},i,r):this.envConfigService.resolveVariablesInObject(e.query||{},r),f=yl(n?.headers||{},e.headers||{}),h=s?this.envConfigService.resolveVariablesInObjectWithExtra(f,i,r):this.envConfigService.resolveVariablesInObject(f,r);if(h=this.preprocessor.sanitizeHeaders(h),!Object.keys(h).some(T=>T.toLowerCase()==="user-agent")){let T=this.appInfo?.version||"0.0.0",B=this.appInfo?.name||"HttpForge";h["User-Agent"]=`${B}/${T}`}if(e.auth?.type==="bearer"&&e.auth.bearerToken){let T=s?this.envConfigService.resolveVariablesWithExtra(e.auth.bearerToken,i,r):this.envConfigService.resolveVariables(e.auth.bearerToken,r);h.Authorization=`Bearer ${T}`}if(e.auth?.type==="basic"&&e.auth.basicAuth){let T=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.username||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.username||"",r),B=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.password||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.password||"",r),Y=Buffer.from(`${T}:${B}`).toString("base64");h.Authorization=`Basic ${Y}`}e.auth?.type==="apikey"&&e.auth.apikey&&this.applyApiKey(e.auth.apikey,h,u,r,i),e.auth?.type==="oauth2"&&e.auth.oauth2&&await this.applyOAuth2(e.auth.oauth2,h,r);let m=null;if(e.body&&e.body.type!=="none"){let T=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesInObjectWithExtra(e.body.content,i,r):this.envConfigService.resolveVariablesInObject(e.body.content,r);if((e.body.format==="json"||e.body.type==="graphql")&&typeof T=="string")try{T=JSON.parse(T)}catch{e.body.format==="json"&&console.warn("[RequestPreparer] Failed to parse JSON body after variable resolution, keeping as string")}let B={type:e.body.type,format:e.body.format,content:T};m=this.preprocessor.encodeBody(B)}this.preprocessor.setContentTypeHeader(h,e.body,e.bodyContentType);let S=e.method||"GET",E=e.url||"",x=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesWithExtra(E,i,r):this.envConfigService.resolveVariables(E,r),C=this.httpService.buildUrl(x,a,u),A={type:e.body?.type||"none",format:e.body?.format,content:m};return{url:C,method:S,headers:h,body:A,params:a,query:u}}async applyOAuth2(e,r,n){if(e.accessToken){let s=this.envConfigService.resolveVariables(e.accessToken,n),a=e.tokenPrefix||"Bearer";r.Authorization=`${a} ${s}`;return}if(!this.tokenManager)throw new Error("OAuth2 authentication requires IOAuth2TokenManager. Ensure the service is properly registered.");let i=await this.tokenManager.getToken(e,n);r.Authorization=`${i.tokenType} ${i.accessToken}`}applyApiKey(e,r,n,i,s){if(!e||!e.key)return;let a=s&&Object.keys(s).length>0,u=a?this.envConfigService.resolveVariablesWithExtra(e.key||"",s,i):this.envConfigService.resolveVariables(e.key||"",i),f=a?this.envConfigService.resolveVariablesWithExtra(e.value||"",s,i):this.envConfigService.resolveVariables(e.value||"",i);(e.in||"header").toLowerCase()==="query"?n[u]=f:r[u]=f}};var EB=`
|
|
235
235
|
query IntrospectionQuery {
|
|
236
236
|
__schema {
|
|
237
237
|
queryType { name }
|
|
@@ -259,58 +259,58 @@ fragment TypeRef on __Type {
|
|
|
259
259
|
kind name
|
|
260
260
|
ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name } } } } } } }
|
|
261
261
|
}
|
|
262
|
-
`.trim(),
|
|
263
|
-
`),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let a=n[s].match(i);a&&r.push({type:a[1],name:a[2],line:s+1})}return r.length===0&&e.trim().startsWith("{")&&r.push({type:"query",name:"(anonymous)",line:1}),r}clearCache(e){e?this.schemaCache.delete(e):this.schemaCache.clear()}schemaToSerializable(e){let r={};for(let[n,i]of e.types)r[n]=i;return{queryType:e.queryType,mutationType:e.mutationType,subscriptionType:e.subscriptionType,types:r,directives:e.directives,fetchedAt:e.fetchedAt,endpointUrl:e.endpointUrl}}parseSchema(e,r){let n=new Map;for(let s of e.types||[]){if(s.name.startsWith("__"))continue;let a={name:s.name,kind:s.kind,description:s.description||void 0,fields:(s.fields||[]).map(u=>this.parseField(u)),inputFields:(s.inputFields||[]).map(u=>this.parseArg(u)),enumValues:(s.enumValues||[]).map(u=>({name:u.name,description:u.description||void 0,isDeprecated:u.isDeprecated||!1,deprecationReason:u.deprecationReason||void 0})),interfaces:(s.interfaces||[]).map(u=>this.renderTypeRef(u)),possibleTypes:(s.possibleTypes||[]).map(u=>this.renderTypeRef(u))};n.set(a.name,a)}let i=(e.directives||[]).map(s=>({name:s.name,description:s.description||void 0,locations:s.locations||[],args:(s.args||[]).map(a=>this.parseArg(a))}));return{queryType:e.queryType?.name||"Query",mutationType:e.mutationType?.name||void 0,subscriptionType:e.subscriptionType?.name||void 0,types:n,directives:i,fetchedAt:Date.now(),endpointUrl:r}}parseField(e){return{name:e.name,type:this.renderTypeRef(e.type),args:(e.args||[]).map(r=>this.parseArg(r)),description:e.description||void 0,isDeprecated:e.isDeprecated||!1,deprecationReason:e.deprecationReason||void 0}}parseArg(e){return{name:e.name,type:this.renderTypeRef(e.type),defaultValue:e.defaultValue??void 0,description:e.description||void 0}}renderTypeRef(e){return e?e.kind==="NON_NULL"?`${this.renderTypeRef(e.ofType)}!`:e.kind==="LIST"?`[${this.renderTypeRef(e.ofType)}]`:e.name||"Unknown":"Unknown"}};var
|
|
264
|
-
`))return
|
|
265
|
-
`)){try{let n=new URLSearchParams(r);for(let[i,s]of n)
|
|
266
|
-
`)){try{let s=new URLSearchParams(i);for(let[a,u]of s)if(
|
|
267
|
-
`)){let f=new URLSearchParams(u);if(f.get(e)===n){f.set(e,i);let h=f.toString();s?s.content=h:t.body=h}return}return}typeof a=="object"&&a!==null&&XR(a,e,r||e,n,i)}}function XR(t,e,r,n,i){let s=r.split("."),a=t;for(let f=0;f<s.length-1;f++){let h=s[f],g=h.match(/^(.+)\[(\d+)\]$/);if(g?a=a?.[g[1]]?.[parseInt(g[2])]:a=a?.[h],a==null)return}let u=s[s.length-1];a&&a[u]===n&&(a[u]=i)}function iB(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var ru=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return $r.join(this.historyPath,_t(e))}getCollectionHistoryPath(e,r){return $r.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return $r.join(this.getCollectionHistoryPath(e,r),_t(n))}getSharedEnvironmentHistoryPath(e){return $r.join(this.sharedHistoryPath,_t(e))}getSharedCollectionHistoryPath(e,r){return $r.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return $r.join(this.getSharedCollectionHistoryPath(e,r),_t(n))}getHistoryFilePath(e,r,n){return $r.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return $r.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return $r.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return $r.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!Ae.existsSync(i))return null;let s=Ae.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load history for ${n}:`,s),null}}loadSharedHistory(e,r,n){let i=this.getSharedHistoryFilePath(e,r,n);try{if(!Ae.existsSync(i))return null;let s=Ae.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load shared history for ${n}:`,s),null}}getEntriesForEnvironment(e,r,n){let i=this.loadHistory(e,r,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,r,n){let i=this.getEntriesForEnvironment(e,r,n),s=new Map;for(let a of i){let u=a.ticket||a.branch||"";s.has(u)||s.set(u,[]),s.get(u).push(a)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let a of i){let u=a.ticket||a.branch||"";s.has(u)||s.set(u,[]),s.get(u).push(a)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Ae.existsSync(r)||Ae.mkdirSync(r,{recursive:!0}),Ae.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save history for ${e.requestId}:`,i),i}}saveSharedHistory(e){let r=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Ae.existsSync(r)||Ae.mkdirSync(r,{recursive:!0}),Ae.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save shared history for ${e.requestId}:`,i),i}}addEntry(e,r,n,i,s){let a=this.loadHistory(e,r,n);a||(a={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let u=Op({...s,method:i,id:wh(),timestamp:Date.now()});return a.requests.unshift(u),a.requests.length>100&&(a.requests=a.requests.slice(0,100)),this.saveHistory(a),u}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(u=>u.id!==i),s.requests.length!==a){this.saveHistory(s);let u=this.getResponseFilePath(e,r,n,i);return Ae.existsSync(u)&&Ae.unlinkSync(u),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(u=>u.id!==i),s.requests.length!==a){this.saveSharedHistory(s);let u=this.getSharedResponseFilePath(e,r,n,i);return Ae.existsSync(u)&&Ae.unlinkSync(u),!0}return!1}shareEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let u=this.loadHistory(e,r,n);if(!u)return!1;let f=u.requests.findIndex(_=>_.id===i);if(f===-1)return!1;let[h]=u.requests.splice(f,1);this.saveHistory(u);let g=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:u.method,requests:[]};if(!g.requests.some(_=>_.id===i)){let _={...h,ticket:null,branch:a};g.requests.unshift(_),g.requests.length>100&&(g.requests=g.requests.slice(0,100)),this.saveSharedHistory(g)}let m=this.getResponseFilePath(e,r,n,i),S=this.getSharedResponseFilePath(e,r,n,i);if(Ae.existsSync(m)){let _=$r.dirname(S);Ae.existsSync(_)||Ae.mkdirSync(_,{recursive:!0});try{Ae.renameSync(m,S)}catch{try{Ae.copyFileSync(m,S)}catch(x){return console.error(`Failed to copy full response from ${m} to ${S}:`,x),!0}try{Ae.unlinkSync(m)}catch(x){console.warn(`Failed to remove original full response after copy: ${m}`,x)}}}return!0}moveSharedEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let u=this.loadSharedHistory(e,r,n);if(!u)return!1;let f=!1;return u.requests=u.requests.map(h=>h.id===i?(f=!0,{...h,ticket:null,branch:a}):h),f?(this.saveSharedHistory(u),!0):!1}renameSharedGroup(e,r,n,i,s){let a=(i||"").trim(),u=(s||"").trim();if(!a||!u||a===u)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let h=!1;return f.requests=f.requests.map(g=>!g.ticket&&g.branch===a?(h=!0,{...g,branch:u}):g),h?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if(Ae.existsSync(i)){let s=Ae.readdirSync(i);for(let a of s)Ae.unlinkSync($r.join(i,a));Ae.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let a=this.getRequestPath(e,r,n),u=this.getResponseFilePath(e,r,n,i);try{Ae.existsSync(a)||Ae.mkdirSync(a,{recursive:!0});let f=Pp(s);Ae.writeFileSync(u,JSON.stringify(f,null,2),"utf-8")}catch(f){throw console.error(`Failed to save full response for ${i}:`,f),f}}loadFullResponse(e,r,n,i){let s=this.getResponseFilePath(e,r,n,i);try{if(!Ae.existsSync(s))return null;let a=Ae.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load full response for ${i}:`,a),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!Ae.existsSync(s))return null;let a=Ae.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load shared full response for ${i}:`,a),null}}};var oa=class{constructor(e,r){this.historyService=e;this.inferrer=r}async analyze(e,r,n){let i=n?.environment||"default",s=n?.maxSamples||50,a=this.historyService.loadHistory(i,e,r),u=this.historyService.loadSharedHistory(i,e,r),f=[...a?.requests||[],...u?.requests||[]];if(f.length===0)return{responses:{}};let h=f.slice(0,s),g=new Map;for(let S of h){let _=this.historyService.loadFullResponse(i,e,r,S.id);if(_||(_=this.historyService.loadSharedFullResponse(i,e,r,S.id)),_){let C=_.status;g.has(C)||g.set(C,[]),g.get(C).push(_)}}let m={};for(let[S,_]of g){let C=this.buildResponseDefinition(_);m[String(S)]=C}return{responses:m}}buildResponseDefinition(e){let r={};if(e.length===0)return r;let n=e[0];r.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(r.contentType=i),i&&this.isJsonContentType(i)){let a=this.inferBodySchema(n);for(let u=1;u<e.length;u++){let f=this.inferBodySchema(e[u]);f&&a?a=this.inferrer.mergeSchemas(a,f):f&&(a=f)}if(a&&(r.schema=a),n.body!==void 0&&n.body!==null){let u=typeof n.body=="string"?this.tryParseJson(n.body):n.body;u!==void 0&&(r.examples={default:{summary:"Captured from history",value:u}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(r.headers=s),r}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let r=e.body;if(!(typeof r=="string"&&(r=this.tryParseJson(r),r===void 0)))return this.inferrer.inferFromValue(r)}extractContentType(e){for(let[r,n]of Object.entries(e))if(r.toLowerCase()==="content-type")return(Array.isArray(n)?n[0]:n).split(";")[0].trim()}isJsonContentType(e){return e.includes("json")||e.includes("+json")||e==="application/json"}findConsistentHeaders(e){if(e.length===0)return{};let r=new Set(["content-type","content-length","content-encoding","transfer-encoding","connection","date","server","set-cookie","vary","cache-control","expires","pragma","etag","last-modified","age"]),n=new Map,i=new Map;for(let u of e)for(let[f,h]of Object.entries(u.headers)){let g=f.toLowerCase();r.has(g)||(n.set(g,(n.get(g)||0)+1),i.has(g)||i.set(g,Array.isArray(h)?h.join(", "):h))}let s=Math.ceil(e.length/2),a={};for(let[u,f]of n)if(f>=s){let h=i.get(u);a[u]={schema:this.inferHeaderSchema(h)}}return a}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}};var VP=ve(f_());var TY=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,qY=/^\d{4}-\d{2}-\d{2}$/,$Y=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,MY=/^https?:\/\/[^\s]+$/,NY=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,DY=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,FY=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,ns=class{inferFromValue(e){if(e==null)return{nullable:!0};if(Array.isArray(e))return this.inferArraySchema(e);switch(typeof e){case"string":return this.inferStringSchema(e);case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"boolean":return{type:"boolean"};case"object":return this.inferObjectSchema(e);default:return{}}}mergeSchemas(e,r){if(!e||Object.keys(e).length===0)return{...r};if(!r||Object.keys(r).length===0)return{...e};let n=e.nullable||r.nullable;if(!e.type&&e.nullable)return{...r,nullable:!0};if(!r.type&&r.nullable)return{...e,nullable:!0};if(e.type!==r.type)return e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer"?{type:"number",...n&&{nullable:!0}}:{...n&&{nullable:!0}};let i={type:e.type};return n&&(i.nullable=!0),e.type==="object"&&r.type==="object"?this.mergeObjectSchemas(e,r,n):e.type==="array"&&r.type==="array"?this.mergeArraySchemas(e,r,n):(e.format&&e.format===r.format&&(i.format=e.format),i)}inferStringFormat(e){if(TY.test(e))return"date-time";if(qY.test(e))return"date";if($Y.test(e))return"email";if(NY.test(e))return"uuid";if(MY.test(e))return"uri";if(DY.test(e))return"ipv4";if(FY.test(e))return"ipv6"}inferStringSchema(e){let r={type:"string"},n=this.inferStringFormat(e);return n&&(r.format=n),r}inferArraySchema(e){let r={type:"array"};if(e.length===0)return r;let n=this.inferFromValue(e[0]);for(let i=1;i<e.length;i++)n=this.mergeSchemas(n,this.inferFromValue(e[i]));return r.items=n,r}inferObjectSchema(e){let r={type:"object",properties:{}},n=Object.keys(e);for(let i of n)r.properties[i]=this.inferFromValue(e[i]);return r}mergeObjectSchemas(e,r,n){let i={type:"object",properties:{},...n&&{nullable:!0}},s=e.properties||{},a=r.properties||{},u=new Set([...Object.keys(s),...Object.keys(a)]);for(let m of u)s[m]&&a[m]?i.properties[m]=this.mergeSchemas(s[m],a[m]):s[m]?i.properties[m]={...s[m]}:i.properties[m]={...a[m]};let f=new Set(e.required||Object.keys(s)),h=new Set(r.required||Object.keys(a)),g=[...u].filter(m=>f.has(m)&&h.has(m));return g.length>0&&(i.required=g),i}mergeArraySchemas(e,r,n){let i={type:"array",...n&&{nullable:!0}};return e.items&&r.items?i.items=this.mergeSchemas(e.items,r.items):e.items?i.items={...e.items}:r.items&&(i.items={...r.items}),i}};var LY=new Set(["content-type","authorization","accept","cookie","host","content-length"]),ha=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new ns}inferrer;async export(e,r){let n=this.collectionService.getCollection(e);if(!n)throw new Error(`Collection ${e} not found`);let i={openapi:"3.0.3",info:this.buildInfo(n,r),servers:this.buildServers(r),paths:{},components:{schemas:{},securitySchemes:{}},tags:[]},s=new Map;if(n.auth&&n.auth.type!=="none"&&n.auth.type!=="inherit"){let f=this.mapAuthToSecurityScheme(n.auth);if(f){let{schemeName:h,scheme:g,requirement:m}=f;s.set(h,g),i.security=[m]}}let a=new Set,u=new Set;if(await this.processItems(n.items,i,s,a,u,void 0,n,r),this.augmentServersFromHostVars(u,i.servers,r),s.size>0)for(let[f,h]of s)i.components.securitySchemes[f]=h;else delete i.components.securitySchemes;return i.tags=[...a].map(f=>({name:f})),i.tags.length===0&&delete i.tags,this.deduplicateComponents(i),Object.keys(i.components.schemas).length===0&&delete i.components.schemas,Object.keys(i.components).length===0&&delete i.components,r.format==="yaml"?VP.stringify(i,{indent:2}):JSON.stringify(i,null,2)}buildInfo(e,r){return{title:r.info?.title||e.name,description:r.info?.description||e.description||"",version:r.info?.version||e.version||"1.0.0"}}buildServers(e){let r=[],n=e.environments||[];if(n.length===0){let i=this.envConfigService.getSelectedEnvironment();if(i){let s=this.envConfigService.resolveVariables("{{baseUrl}}",i);s&&s!=="{{baseUrl}}"&&r.push({url:s,description:i})}}else{let i=new Set;for(let s of n){let a=this.envConfigService.resolveVariables("{{baseUrl}}",s);a&&a!=="{{baseUrl}}"&&!i.has(a)&&(i.add(a),r.push({url:a,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,a,u,f){for(let h of e)if(h.type==="folder"){let g=h,m=a||g.name;i.add(m),g.items&&await this.processItems(g.items,r,n,i,s,m,u,f)}else{let g=h;await this.processRequest(g,r,n,i,s,a,u,f)}}async processRequest(e,r,n,i,s,a,u,f){let{path:h,hostVar:g}=this.normalizeUrl(e.url);g&&s.add(g);let m=(e.method||"GET").toLowerCase();r.paths[h]||(r.paths[h]={});let S={};S.operationId=this.generateOperationId(e,m,h,r),S.summary=this.cleanSummary(e.name),e.description&&(S.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(S.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(S.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,""))),a&&(S.tags=[a]);let _=this.buildParameters(e);_.length>0&&(S.parameters=_);let C=await this.buildRequestBody(e,f);C&&(S.requestBody=C);let x=await this.buildResponses(e,u.id,f);S.responses=x;let A=this.buildOperationSecurity(e,u,n);A!==void 0&&(S.security=A);let T=r.paths[h][m];T?this.mergeOperation(T,S,e.name):r.paths[h][m]=S}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
|
|
262
|
+
`.trim(),au=class{constructor(e){this.httpClient=e}httpClient;schemaCache=new Map;async fetchSchema(e,r){let n={method:"POST",url:e,headers:{"Content-Type":"application/json",Accept:"application/json",...r||{}},body:JSON.stringify({query:EB,operationName:"IntrospectionQuery"})},i=await this.httpClient.send(n);if(i.status<200||i.status>=300)throw new Error(`Introspection query failed with status ${i.status}: ${i.statusText}`);let s=typeof i.body=="string"?JSON.parse(i.body):i.body;if(s.errors&&s.errors.length>0){let u=s.errors.map(f=>f.message).join("; ");throw new Error(`Introspection query returned errors: ${u}`)}if(!s.data?.__schema)throw new Error("Invalid introspection response: missing __schema");let a=this.parseSchema(s.data.__schema,e);return this.schemaCache.set(e,a),a}getCachedSchema(e){return this.schemaCache.get(e)}extractOperations(e){let r=[],n=e.split(`
|
|
263
|
+
`),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let a=n[s].match(i);a&&r.push({type:a[1],name:a[2],line:s+1})}return r.length===0&&e.trim().startsWith("{")&&r.push({type:"query",name:"(anonymous)",line:1}),r}clearCache(e){e?this.schemaCache.delete(e):this.schemaCache.clear()}schemaToSerializable(e){let r={};for(let[n,i]of e.types)r[n]=i;return{queryType:e.queryType,mutationType:e.mutationType,subscriptionType:e.subscriptionType,types:r,directives:e.directives,fetchedAt:e.fetchedAt,endpointUrl:e.endpointUrl}}parseSchema(e,r){let n=new Map;for(let s of e.types||[]){if(s.name.startsWith("__"))continue;let a={name:s.name,kind:s.kind,description:s.description||void 0,fields:(s.fields||[]).map(u=>this.parseField(u)),inputFields:(s.inputFields||[]).map(u=>this.parseArg(u)),enumValues:(s.enumValues||[]).map(u=>({name:u.name,description:u.description||void 0,isDeprecated:u.isDeprecated||!1,deprecationReason:u.deprecationReason||void 0})),interfaces:(s.interfaces||[]).map(u=>this.renderTypeRef(u)),possibleTypes:(s.possibleTypes||[]).map(u=>this.renderTypeRef(u))};n.set(a.name,a)}let i=(e.directives||[]).map(s=>({name:s.name,description:s.description||void 0,locations:s.locations||[],args:(s.args||[]).map(a=>this.parseArg(a))}));return{queryType:e.queryType?.name||"Query",mutationType:e.mutationType?.name||void 0,subscriptionType:e.subscriptionType?.name||void 0,types:n,directives:i,fetchedAt:Date.now(),endpointUrl:r}}parseField(e){return{name:e.name,type:this.renderTypeRef(e.type),args:(e.args||[]).map(r=>this.parseArg(r)),description:e.description||void 0,isDeprecated:e.isDeprecated||!1,deprecationReason:e.deprecationReason||void 0}}parseArg(e){return{name:e.name,type:this.renderTypeRef(e.type),defaultValue:e.defaultValue??void 0,description:e.description||void 0}}renderTypeRef(e){return e?e.kind==="NON_NULL"?`${this.renderTypeRef(e.ofType)}!`:e.kind==="LIST"?`[${this.renderTypeRef(e.ofType)}]`:e.name||"Unknown":"Unknown"}};var Pe=Se(require("fs")),Nr=Se(require("path"));var lu="***",Pb=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,bn=/(password|passwd|pwd|token|cookie|secret|credential|api[_\-]?key|apikey|access[_\-]?token|refresh[_\-]?token|client[_\-]?secret|private[_\-]?key|auth[_\-]?code|bearer|session[_\-]?id|jwt)/i;function uu(t){let e={};for(let[r,n]of Object.entries(t))Pb.test(r)?e[r]=Array.isArray(n)?n.map(()=>lu):lu:e[r]=n;return e}function Ep(t){try{let e=new URL(t),r=!1;for(let[n]of e.searchParams)bn.test(n)&&(e.searchParams.set(n,lu),r=!0);return r?e.toString():t}catch{return t}}function wp(t){if(t==null)return t;if(Array.isArray(t))return t.map(r=>wp(r));if(typeof t!="object")return t;let e={};for(let[r,n]of Object.entries(t))bn.test(r)?e[r]=lu:typeof n=="object"&&n!==null?e[r]=wp(n):e[r]=n;return e}function xB(t){try{let e=new URLSearchParams(t),r=!1;for(let[n]of e)bn.test(n)&&(e.set(n,lu),r=!0);return r?e.toString():t}catch{return t}}function xp(t){if(t==null)return t;if(typeof t=="object"&&!Buffer.isBuffer(t))return wp(t);if(typeof t=="string"){let e=t.trim();if(e.startsWith("{")||e.startsWith("["))try{let r=JSON.parse(e),n=wp(r);return JSON.stringify(n)}catch{}if(e.includes("=")&&!e.includes(`
|
|
264
|
+
`))return xB(e)}return t}function Cp(t){return{...t,sentRequest:{...t.sentRequest,url:Ep(t.sentRequest.url),headers:uu(t.sentRequest.headers),body:t.sentRequest.body!=null?xp(t.sentRequest.body):t.sentRequest.body}}}function Rp(t){return{...t,headers:uu(t.headers),cookies:t.cookies.map(e=>e&&typeof e=="object"&&e.name&&bn.test(e.name)?{...e,value:lu}:e)}}function Ip(t){return{...t,url:Ep(t.url),request:{headers:uu(t.request.headers),body:t.request.body!=null?xp(t.request.body):t.request.body},response:{headers:uu(t.response.headers),body:t.response.body}}}var CB=/\{\{[^}]+\}\}/;function ur(t){return typeof t=="string"&&CB.test(t)}function iI(t){let e=[];if(t.url)try{let r=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[n,i]of r.searchParams)bn.test(n)&&i&&!ur(i)&&e.push({location:"url",field:n,message:`URL query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}if(t.headers){let r=Array.isArray(t.headers)?t.headers.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.headers);for(let[n,i]of r)Pb.test(n)&&i&&!ur(i)&&e.push({location:"header",field:n,message:`Header "${n}" contains a hardcoded value. Use a {{variable}} instead (e.g. {{${n.toLowerCase().replace(/[^a-z0-9]/g,"_")}}})`})}if(t.query){let r=Array.isArray(t.query)?t.query.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.query);for(let[n,i]of r)bn.test(n)&&i&&!ur(i)&&e.push({location:"query",field:n,message:`Query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}if(t.auth){let r=t.auth;if(r.bearerToken&&!ur(r.bearerToken)&&e.push({location:"auth",field:"bearerToken",message:"Bearer token contains a hardcoded value. Store it in a {{variable}} in your .local.json environment file."}),r.basicAuth&&r.basicAuth.password&&!ur(r.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",message:"Basic auth password contains a hardcoded value. Use a {{variable}} instead."}),r.apikey||r.apiKey){let n=r.apikey||r.apiKey;n.value&&!ur(n.value)&&e.push({location:"auth",field:"apiKey.value",message:"API key contains a hardcoded value. Use a {{variable}} instead."})}}if(t.body){let r=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;r&&bp(r,e)}return e}function bp(t,e){if(t!=null){if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")||r.startsWith("[")){try{bp(JSON.parse(r),e)}catch{}return}if(r.includes("=")&&!r.includes(`
|
|
265
|
+
`)){try{let n=new URLSearchParams(r);for(let[i,s]of n)bn.test(i)&&s&&!ur(s)&&e.push({location:"body",field:i,message:`Form field "${i}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}return}return}if(Array.isArray(t)){t.forEach(r=>bp(r,e));return}if(typeof t=="object")for(let[r,n]of Object.entries(t))bn.test(r)&&n&&typeof n=="string"&&!ur(n)?e.push({location:"body",field:r,message:`Body field "${r}" contains a hardcoded value. Use a {{variable}} instead.`}):typeof n=="object"&&n!==null&&bp(n,e)}}function oa(t){return t.replace(/\./g,"_").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()}function sI(t){let e=[],r=new Set;function n(i){let s=i,a=2;for(;r.has(s);)s=`${i}_${a++}`;return r.add(s),s}if(t.url)try{let i=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[s,a]of i.searchParams)bn.test(s)&&a&&!ur(a)&&e.push({location:"url",field:s,value:a,variableName:n(oa(s))})}catch{}if(t.headers){let i=Array.isArray(t.headers)?t.headers.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.headers);for(let[s,a]of i)Pb.test(s)&&a&&!ur(a)&&e.push({location:"header",field:s,value:a,variableName:n(oa(s))})}if(t.query){let i=Array.isArray(t.query)?t.query.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.query);for(let[s,a]of i)bn.test(s)&&a&&!ur(a)&&e.push({location:"query",field:s,value:a,variableName:n(oa(s))})}if(t.auth){let i=t.auth;if(i.bearerToken&&!ur(i.bearerToken)&&e.push({location:"auth",field:"bearerToken",value:i.bearerToken,variableName:n("bearer_token")}),i.basicAuth&&i.basicAuth.password&&!ur(i.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",value:i.basicAuth.password,variableName:n("basic_auth_password")}),i.apikey||i.apiKey){let s=i.apikey||i.apiKey;s.value&&!ur(s.value)&&e.push({location:"auth",field:"apiKey.value",value:s.value,variableName:n("api_key")})}}if(t.body){let i=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;i&&_p(i,e,r,"")}return e}function _p(t,e,r,n){if(t!=null){if(typeof t=="string"){let i=t.trim();if(i.startsWith("{")||i.startsWith("[")){try{_p(JSON.parse(i),e,r,n)}catch{}return}if(i.includes("=")&&!i.includes(`
|
|
266
|
+
`)){try{let s=new URLSearchParams(i);for(let[a,u]of s)if(bn.test(a)&&u&&!ur(u)){let f=oa(a),h=2;for(;r.has(f);)f=`${oa(a)}_${h++}`;r.add(f),e.push({location:"body",field:a,path:n?`${n}.${a}`:a,value:u,variableName:f})}}catch{}return}return}if(Array.isArray(t)){t.forEach((i,s)=>_p(i,e,r,`${n}[${s}]`));return}if(typeof t=="object")for(let[i,s]of Object.entries(t)){let a=n?`${n}.${i}`:i;if(bn.test(i)&&s&&typeof s=="string"&&!ur(s)){let u=oa(i),f=2;for(;r.has(u);)u=`${oa(i)}_${f++}`;r.add(u),e.push({location:"body",field:i,path:a,value:s,variableName:u})}else typeof s=="object"&&s!==null&&_p(s,e,r,a)}}}function oI(t,e){let r=JSON.parse(JSON.stringify(t));for(let n of e){let i=`{{${n.variableName}}}`;switch(n.location){case"url":r.url&&(r.url=r.url.replace(new RegExp(`([?&])${IB(n.field)}=[^&]*`),`$1${n.field}=${i}`));break;case"header":if(Array.isArray(r.headers)){let s=r.headers.find(a=>a.key===n.field&&a.value===n.value);s&&(s.value=i)}else r.headers&&r.headers[n.field]===n.value&&(r.headers[n.field]=i);break;case"query":if(Array.isArray(r.query)){let s=r.query.find(a=>a.key===n.field&&a.value===n.value);s&&(s.value=i)}else r.query&&r.query[n.field]===n.value&&(r.query[n.field]=i);break;case"auth":if(r.auth){if(n.field==="bearerToken")r.auth.bearerToken=i;else if(n.field==="basicAuth.password"&&r.auth.basicAuth)r.auth.basicAuth.password=i;else if(n.field==="apiKey.value"){let s=r.auth.apikey||r.auth.apiKey;s&&(s.value=i)}}break;case"body":RB(r,n.field,n.path,n.value,i);break}}return r}function RB(t,e,r,n,i){let s=typeof t.body=="object"&&t.body!==null&&"content"in t.body?t.body:null,a=s?s.content:t.body;if(a){if(typeof a=="string"){let u=a.trim();if(u.startsWith("{")||u.startsWith("[")){try{let f=JSON.parse(u);nI(f,e,r||e,n,i);let h=JSON.stringify(f,null,2);s?s.content=h:t.body=h}catch{}return}if(u.includes("=")&&!u.includes(`
|
|
267
|
+
`)){let f=new URLSearchParams(u);if(f.get(e)===n){f.set(e,i);let h=f.toString();s?s.content=h:t.body=h}return}return}typeof a=="object"&&a!==null&&nI(a,e,r||e,n,i)}}function nI(t,e,r,n,i){let s=r.split("."),a=t;for(let f=0;f<s.length-1;f++){let h=s[f],g=h.match(/^(.+)\[(\d+)\]$/);if(g?a=a?.[g[1]]?.[parseInt(g[2])]:a=a?.[h],a==null)return}let u=s[s.length-1];a&&a[u]===n&&(a[u]=i)}function IB(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var cu=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return Nr.join(this.historyPath,_t(e))}getCollectionHistoryPath(e,r){return Nr.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return Nr.join(this.getCollectionHistoryPath(e,r),_t(n))}getSharedEnvironmentHistoryPath(e){return Nr.join(this.sharedHistoryPath,_t(e))}getSharedCollectionHistoryPath(e,r){return Nr.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return Nr.join(this.getSharedCollectionHistoryPath(e,r),_t(n))}getHistoryFilePath(e,r,n){return Nr.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return Nr.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return Nr.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return Nr.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!Pe.existsSync(i))return null;let s=Pe.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load history for ${n}:`,s),null}}loadSharedHistory(e,r,n){let i=this.getSharedHistoryFilePath(e,r,n);try{if(!Pe.existsSync(i))return null;let s=Pe.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load shared history for ${n}:`,s),null}}getEntriesForEnvironment(e,r,n){let i=this.loadHistory(e,r,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,r,n){let i=this.getEntriesForEnvironment(e,r,n),s=new Map;for(let a of i){let u=a.ticket||a.branch||"";s.has(u)||s.set(u,[]),s.get(u).push(a)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let a of i){let u=a.ticket||a.branch||"";s.has(u)||s.set(u,[]),s.get(u).push(a)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Pe.existsSync(r)||Pe.mkdirSync(r,{recursive:!0}),Pe.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save history for ${e.requestId}:`,i),i}}saveSharedHistory(e){let r=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Pe.existsSync(r)||Pe.mkdirSync(r,{recursive:!0}),Pe.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save shared history for ${e.requestId}:`,i),i}}addEntry(e,r,n,i,s){let a=this.loadHistory(e,r,n);a||(a={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let u=Cp({...s,method:i,id:Eh(),timestamp:Date.now()});return a.requests.unshift(u),a.requests.length>100&&(a.requests=a.requests.slice(0,100)),this.saveHistory(a),u}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(u=>u.id!==i),s.requests.length!==a){this.saveHistory(s);let u=this.getResponseFilePath(e,r,n,i);return Pe.existsSync(u)&&Pe.unlinkSync(u),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(u=>u.id!==i),s.requests.length!==a){this.saveSharedHistory(s);let u=this.getSharedResponseFilePath(e,r,n,i);return Pe.existsSync(u)&&Pe.unlinkSync(u),!0}return!1}shareEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let u=this.loadHistory(e,r,n);if(!u)return!1;let f=u.requests.findIndex(E=>E.id===i);if(f===-1)return!1;let[h]=u.requests.splice(f,1);this.saveHistory(u);let g=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:u.method,requests:[]};if(!g.requests.some(E=>E.id===i)){let E={...h,ticket:null,branch:a};g.requests.unshift(E),g.requests.length>100&&(g.requests=g.requests.slice(0,100)),this.saveSharedHistory(g)}let m=this.getResponseFilePath(e,r,n,i),S=this.getSharedResponseFilePath(e,r,n,i);if(Pe.existsSync(m)){let E=Nr.dirname(S);Pe.existsSync(E)||Pe.mkdirSync(E,{recursive:!0});try{Pe.renameSync(m,S)}catch{try{Pe.copyFileSync(m,S)}catch(C){return console.error(`Failed to copy full response from ${m} to ${S}:`,C),!0}try{Pe.unlinkSync(m)}catch(C){console.warn(`Failed to remove original full response after copy: ${m}`,C)}}}return!0}moveSharedEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let u=this.loadSharedHistory(e,r,n);if(!u)return!1;let f=!1;return u.requests=u.requests.map(h=>h.id===i?(f=!0,{...h,ticket:null,branch:a}):h),f?(this.saveSharedHistory(u),!0):!1}renameSharedGroup(e,r,n,i,s){let a=(i||"").trim(),u=(s||"").trim();if(!a||!u||a===u)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let h=!1;return f.requests=f.requests.map(g=>!g.ticket&&g.branch===a?(h=!0,{...g,branch:u}):g),h?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if(Pe.existsSync(i)){let s=Pe.readdirSync(i);for(let a of s)Pe.unlinkSync(Nr.join(i,a));Pe.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let a=this.getRequestPath(e,r,n),u=this.getResponseFilePath(e,r,n,i);try{Pe.existsSync(a)||Pe.mkdirSync(a,{recursive:!0});let f=Rp(s);Pe.writeFileSync(u,JSON.stringify(f,null,2),"utf-8")}catch(f){throw console.error(`Failed to save full response for ${i}:`,f),f}}loadFullResponse(e,r,n,i){let s=this.getResponseFilePath(e,r,n,i);try{if(!Pe.existsSync(s))return null;let a=Pe.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load full response for ${i}:`,a),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!Pe.existsSync(s))return null;let a=Pe.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load shared full response for ${i}:`,a),null}}};var aa=class{constructor(e,r){this.historyService=e;this.inferrer=r}historyService;inferrer;async analyze(e,r,n){let i=n?.environment||"default",s=n?.maxSamples||50,a=this.historyService.loadHistory(i,e,r),u=this.historyService.loadSharedHistory(i,e,r),f=[...a?.requests||[],...u?.requests||[]];if(f.length===0)return{responses:{}};let h=f.slice(0,s),g=new Map;for(let S of h){let E=this.historyService.loadFullResponse(i,e,r,S.id);if(E||(E=this.historyService.loadSharedFullResponse(i,e,r,S.id)),E){let x=E.status;g.has(x)||g.set(x,[]),g.get(x).push(E)}}let m={};for(let[S,E]of g){let x=this.buildResponseDefinition(E);m[String(S)]=x}return{responses:m}}buildResponseDefinition(e){let r={};if(e.length===0)return r;let n=e[0];r.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(r.contentType=i),i&&this.isJsonContentType(i)){let a=this.inferBodySchema(n);for(let u=1;u<e.length;u++){let f=this.inferBodySchema(e[u]);f&&a?a=this.inferrer.mergeSchemas(a,f):f&&(a=f)}if(a&&(r.schema=a),n.body!==void 0&&n.body!==null){let u=typeof n.body=="string"?this.tryParseJson(n.body):n.body;u!==void 0&&(r.examples={default:{summary:"Captured from history",value:u}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(r.headers=s),r}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let r=e.body;if(!(typeof r=="string"&&(r=this.tryParseJson(r),r===void 0)))return this.inferrer.inferFromValue(r)}extractContentType(e){for(let[r,n]of Object.entries(e))if(r.toLowerCase()==="content-type")return(Array.isArray(n)?n[0]:n).split(";")[0].trim()}isJsonContentType(e){return e.includes("json")||e.includes("+json")||e==="application/json"}findConsistentHeaders(e){if(e.length===0)return{};let r=new Set(["content-type","content-length","content-encoding","transfer-encoding","connection","date","server","set-cookie","vary","cache-control","expires","pragma","etag","last-modified","age"]),n=new Map,i=new Map;for(let u of e)for(let[f,h]of Object.entries(u.headers)){let g=f.toLowerCase();r.has(g)||(n.set(g,(n.get(g)||0)+1),i.has(g)||i.set(g,Array.isArray(h)?h.join(", "):h))}let s=Math.ceil(e.length/2),a={};for(let[u,f]of n)if(f>=s){let h=i.get(u);a[u]={schema:this.inferHeaderSchema(h)}}return a}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}};var KP=Se(c_());var tJ=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,rJ=/^\d{4}-\d{2}-\d{2}$/,nJ=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,iJ=/^https?:\/\/[^\s]+$/,sJ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,oJ=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,aJ=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,Zi=class{inferFromValue(e){if(e==null)return{nullable:!0};if(Array.isArray(e))return this.inferArraySchema(e);switch(typeof e){case"string":return this.inferStringSchema(e);case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"boolean":return{type:"boolean"};case"object":return this.inferObjectSchema(e);default:return{}}}mergeSchemas(e,r){if(!e||Object.keys(e).length===0)return{...r};if(!r||Object.keys(r).length===0)return{...e};let n=e.nullable||r.nullable;if(!e.type&&e.nullable)return{...r,nullable:!0};if(!r.type&&r.nullable)return{...e,nullable:!0};if(e.type!==r.type)return e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer"?{type:"number",...n&&{nullable:!0}}:{...n&&{nullable:!0}};let i={type:e.type};return n&&(i.nullable=!0),e.type==="object"&&r.type==="object"?this.mergeObjectSchemas(e,r,n):e.type==="array"&&r.type==="array"?this.mergeArraySchemas(e,r,n):(e.format&&e.format===r.format&&(i.format=e.format),i)}inferStringFormat(e){if(tJ.test(e))return"date-time";if(rJ.test(e))return"date";if(nJ.test(e))return"email";if(sJ.test(e))return"uuid";if(iJ.test(e))return"uri";if(oJ.test(e))return"ipv4";if(aJ.test(e))return"ipv6"}inferStringSchema(e){let r={type:"string"},n=this.inferStringFormat(e);return n&&(r.format=n),r}inferArraySchema(e){let r={type:"array"};if(e.length===0)return r;let n=this.inferFromValue(e[0]);for(let i=1;i<e.length;i++)n=this.mergeSchemas(n,this.inferFromValue(e[i]));return r.items=n,r}inferObjectSchema(e){let r={type:"object",properties:{}},n=Object.keys(e);for(let i of n)r.properties[i]=this.inferFromValue(e[i]);return r}mergeObjectSchemas(e,r,n){let i={type:"object",properties:{},...n&&{nullable:!0}},s=e.properties||{},a=r.properties||{},u=new Set([...Object.keys(s),...Object.keys(a)]);for(let m of u)s[m]&&a[m]?i.properties[m]=this.mergeSchemas(s[m],a[m]):s[m]?i.properties[m]={...s[m]}:i.properties[m]={...a[m]};let f=new Set(e.required||Object.keys(s)),h=new Set(r.required||Object.keys(a)),g=[...u].filter(m=>f.has(m)&&h.has(m));return g.length>0&&(i.required=g),i}mergeArraySchemas(e,r,n){let i={type:"array",...n&&{nullable:!0}};return e.items&&r.items?i.items=this.mergeSchemas(e.items,r.items):e.items?i.items={...e.items}:r.items&&(i.items={...r.items}),i}};var lJ=new Set(["content-type","authorization","accept","cookie","host","content-length"]),pa=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new Zi}collectionService;envConfigService;inferenceService;inferrer;async export(e,r){let n=this.collectionService.getCollection(e);if(!n)throw new Error(`Collection ${e} not found`);let i={openapi:"3.0.3",info:this.buildInfo(n,r),servers:this.buildServers(r),paths:{},components:{schemas:{},securitySchemes:{}},tags:[]},s=new Map;if(n.auth&&n.auth.type!=="none"&&n.auth.type!=="inherit"){let f=this.mapAuthToSecurityScheme(n.auth);if(f){let{schemeName:h,scheme:g,requirement:m}=f;s.set(h,g),i.security=[m]}}let a=new Set,u=new Set;if(await this.processItems(n.items,i,s,a,u,void 0,n,r),this.augmentServersFromHostVars(u,i.servers,r),s.size>0)for(let[f,h]of s)i.components.securitySchemes[f]=h;else delete i.components.securitySchemes;return i.tags=[...a].map(f=>({name:f})),i.tags.length===0&&delete i.tags,this.deduplicateComponents(i),Object.keys(i.components.schemas).length===0&&delete i.components.schemas,Object.keys(i.components).length===0&&delete i.components,r.format==="yaml"?KP.stringify(i,{indent:2}):JSON.stringify(i,null,2)}buildInfo(e,r){return{title:r.info?.title||e.name,description:r.info?.description||e.description||"",version:r.info?.version||e.version||"1.0.0"}}buildServers(e){let r=[],n=e.environments||[];if(n.length===0){let i=this.envConfigService.getSelectedEnvironment();if(i){let s=this.envConfigService.resolveVariables("{{baseUrl}}",i);s&&s!=="{{baseUrl}}"&&r.push({url:s,description:i})}}else{let i=new Set;for(let s of n){let a=this.envConfigService.resolveVariables("{{baseUrl}}",s);a&&a!=="{{baseUrl}}"&&!i.has(a)&&(i.add(a),r.push({url:a,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,a,u,f){for(let h of e)if(h.type==="folder"){let g=h,m=a||g.name;i.add(m),g.items&&await this.processItems(g.items,r,n,i,s,m,u,f)}else{let g=h;await this.processRequest(g,r,n,i,s,a,u,f)}}async processRequest(e,r,n,i,s,a,u,f){let{path:h,hostVar:g}=this.normalizeUrl(e.url);g&&s.add(g);let m=(e.method||"GET").toLowerCase();r.paths[h]||(r.paths[h]={});let S={};S.operationId=this.generateOperationId(e,m,h,r),S.summary=this.cleanSummary(e.name),e.description&&(S.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(S.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(S.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,""))),a&&(S.tags=[a]);let E=this.buildParameters(e);E.length>0&&(S.parameters=E);let x=await this.buildRequestBody(e,f);x&&(S.requestBody=x);let C=await this.buildResponses(e,u.id,f);S.responses=C;let A=this.buildOperationSecurity(e,u,n);A!==void 0&&(S.security=A);let T=r.paths[h][m];T?this.mergeOperation(T,S,e.name):r.paths[h][m]=S}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
|
|
268
268
|
|
|
269
|
-
Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=new Set(e.tags||[]);for(let s of r.tags)i.add(s);e.tags=[...i]}if(r.parameters){e.parameters||(e.parameters=[]);for(let i of r.parameters){let s=e.parameters.find(a=>a.name===i.name&&a.in===i.in);s?this.mergeParameterSchema(s,i,n):e.parameters.push(i)}}if(r.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(r.responses))e.responses[i]||(e.responses[i]=s)}if(r.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(r.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else r.requestBody&&!e.requestBody&&(e.requestBody=r.requestBody)}mergeParameterSchema(e,r,n){e.schema||(e.schema={});let i=e.schema,s=r.schema||{},a=this.getConstraintKind(i),u=this.getConstraintKind(s);if(a==="none"&&u==="none")this.widenType(i,s);else if(a==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(u==="none")this.widenType(i,s);else if(a===u)this.mergeSameKindConstraints(i,s,a),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(h=>JSON.stringify(h)===JSON.stringify(f))||i.oneOf.push(f)}else if(s.oneOf){let f=this.buildVariantSchema(i);i.oneOf=[f,...s.oneOf]}else{let f=this.buildVariantSchema(i),h=this.buildVariantSchema(s);i.oneOf=[f,h]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let f=`variant_${n.replace(/[^a-zA-Z0-9_]/g,"_")}`;e.examples[f]={value:r.example},delete e.example}}getConstraintKind(e){return e.oneOf?"oneOf":e.enum&&e.enum.length>0?"enum":e.pattern?"pattern":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"range":e.minLength!==void 0||e.maxLength!==void 0?"length":e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.format?"format":"none"}mergeSameKindConstraints(e,r,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of r.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{r.pattern&&r.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${r.pattern})`);break}case"range":{r.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,r.minimum):r.minimum),r.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,r.maximum):r.maximum),r.exclusiveMinimum&&(e.exclusiveMinimum=!0),r.exclusiveMaximum&&(e.exclusiveMaximum=!0),r.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,r.multipleOf):r.multipleOf);break}case"length":{r.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,r.minLength):r.minLength),r.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,r.maxLength):r.maxLength);break}case"array":{r.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,r.minItems):r.minItems),r.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,r.maxItems):r.maxItems),r.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(r.format&&r.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:r.type||"string",format:r.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(r.oneOf)for(let i of r.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let r={};return e.type&&(r.type=e.type),e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}stripConstraints(e){delete e.enum,delete e.pattern,delete e.format,delete e.minimum,delete e.maximum,delete e.exclusiveMinimum,delete e.exclusiveMaximum,delete e.multipleOf,delete e.minLength,delete e.maxLength,delete e.minItems,delete e.maxItems,delete e.uniqueItems,delete e.nullable}extractConstraints(e){let r={};return e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}widenType(e,r){!r.type||r.type===e.type||(e.type?(e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer")&&(e.type="number"):e.type=r.type)}normalizeUrl(e){let r=e,n=null,i=r.match(/^\{\{(\w+)\}\}/);return i&&(n=i[1],r=r.slice(i[0].length)),r=r.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),r=r.replace(/\{\{(\w+)\}\}/g,"{$1}"),r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),r=r.replace(/\/\//g,"/"),{path:r,hostVar:n}}generateOperationId(e,r,n,i){let s=this.toCamelCase(e.name),a=this.collectOperationIds(i);if(a.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||a.has(s)){let u=n.split("/").filter(f=>f&&!f.startsWith("{"));s=r+u.map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}return s}collectOperationIds(e){let r=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&r.add(i.operationId);return r}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(r,n)=>n.toUpperCase()).replace(/^[A-Z]/,r=>r.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let r=[];if(e.params)for(let[n,i]of Object.entries(e.params)){let s={name:n,in:"path",required:!0};if(typeof i=="string")s.schema={type:this.inferTypeFromValue(i)},s.example=this.coerceExample(i,s.schema.type);else{let a=i;a.oneOf?(s.schema={oneOf:a.oneOf},a.type&&(s.schema.type=a.type)):(s.schema={type:a.type||this.inferTypeFromValue(a.value)},a.format&&(s.schema.format=a.format),a.enum&&(s.schema.enum=a.enum),a.pattern&&(s.schema.pattern=a.pattern),a.minimum!==void 0&&(s.schema.minimum=a.minimum),a.maximum!==void 0&&(s.schema.maximum=a.maximum),a.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=a.exclusiveMinimum),a.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=a.exclusiveMaximum),a.multipleOf!==void 0&&(s.schema.multipleOf=a.multipleOf),a.minLength!==void 0&&(s.schema.minLength=a.minLength),a.maxLength!==void 0&&(s.schema.maxLength=a.maxLength),a.minItems!==void 0&&(s.schema.minItems=a.minItems),a.maxItems!==void 0&&(s.schema.maxItems=a.maxItems),a.uniqueItems&&(s.schema.uniqueItems=!0),a.nullable&&(s.schema.nullable=!0)),a.description&&(s.description=a.description),a.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(a.value,s.schema.type||"string")}r.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");r.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);r.push(...i)}for(let i of e.headers){if(!i.key||LY.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");r.push(s)}}return r}buildKeyValueParam(e,r){let n={name:e.key,in:r,schema:{}};return e.oneOf?(n.schema.oneOf=e.oneOf,e.type&&(n.schema.type=e.type)):(n.schema.type=e.type||"string",e.format&&(n.schema.format=e.format),e.enum&&(n.schema.enum=e.enum),e.pattern&&(n.schema.pattern=e.pattern),e.minimum!==void 0&&(n.schema.minimum=e.minimum),e.maximum!==void 0&&(n.schema.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(n.schema.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(n.schema.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(n.schema.multipleOf=e.multipleOf),e.minLength!==void 0&&(n.schema.minLength=e.minLength),e.maxLength!==void 0&&(n.schema.maxLength=e.maxLength),e.minItems!==void 0&&(n.schema.minItems=e.minItems),e.maxItems!==void 0&&(n.schema.maxItems=e.maxItems),e.uniqueItems&&(n.schema.uniqueItems=!0),e.nullable&&(n.schema.nullable=!0)),e.required&&(n.required=!0),e.description&&(n.description=e.description),e.deprecated&&(n.deprecated=!0),e.value&&(n.example=this.coerceExample(e.value,n.schema.type||"string")),n}parseCookieHeader(e){let r=[],n=e.split(";").map(i=>i.trim()).filter(Boolean);for(let i of n){let s=i.indexOf("=");if(s>0){let a=i.substring(0,s).trim(),u=i.substring(s+1).trim();r.push({name:a,in:"cookie",schema:{type:"string"},example:u})}}return r}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,r){let n=this.sanitizeEnvVar(e);switch(r){case"integer":return parseInt(n,10)||n;case"number":return parseFloat(n)||n;case"boolean":return n==="true";default:return n}}sanitizeEnvVar(e){return e.replace(/\{\{(\w+)\}\}/g,"<$1>")}sanitizeObjectExamples(e){if(typeof e=="string")return this.sanitizeEnvVar(e);if(Array.isArray(e))return e.map(r=>this.sanitizeObjectExamples(r));if(e!==null&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeObjectExamples(i);return r}return e}async buildRequestBody(e,r){if(!e.body||e.body.type==="none")return null;let n=e.body,i={required:!0,content:{}},s,a,u,f;if(e.bodySchema){if(e.bodySchema.content){for(let[m,S]of Object.entries(e.bodySchema.content)){let _={};S.schema&&(_.schema=S.schema),S.examples&&(_.examples=S.examples),S.encoding&&(_.encoding=S.encoding),i.content[m]=_}let g=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(g&&n.content){let m=this.tryParseBodyContent(n);m!==void 0&&i.content[g]&&(i.content[g].example=m)}return i}s=e.bodySchema.contentType||this.getContentType(n),a=e.bodySchema.schema,e.bodySchema.components,u=this.tryParseBodyContent(n),e.bodySchema.encoding&&(f=e.bodySchema.encoding)}else switch(s=this.getContentType(n),n.type){case"raw":{if(n.format==="json"&&n.content){let g=this.tryParseBodyContent(n);g!==void 0?(a=this.inferrer.inferFromValue(g),u=g):a={type:"string"}}else a={type:"string"},u=typeof n.content=="string"?n.content:void 0;break}case"form-data":{a=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{a=this.buildFormDataSchemaFromBody(n);break}case"binary":{a={type:"string",format:"binary"};break}case"graphql":{a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},u=this.tryParseBodyContent(n);break}default:return null}let h={};return a&&(h.schema=a),u!==void 0&&(h.example=u),f&&(h.encoding=f),i.content[s]=h,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,a]of Object.entries(e.responseSchema.responses)){let u={description:a.description||`Status ${s}`};if(a.content){u.content={};for(let[f,h]of Object.entries(a.content)){let g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),u.content[f]=g}}else if(a.schema){let f=a.contentType||"application/json",h={schema:a.schema};a.examples&&(h.examples=a.examples),u.content={[f]:h}}if(a.headers){u.headers={};for(let[f,h]of Object.entries(a.headers))u.headers[f]={...h.description&&{description:h.description},schema:h.schema}}i[s]=u}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}buildOperationSecurity(e,r,n){if(!e.auth||e.auth.type==="inherit")return;if(e.auth.type==="none")return[];let i=this.mapAuthToSecurityScheme(e.auth);if(!i)return;let{schemeName:s,scheme:a,requirement:u}=i;return n.set(s,a),[u]}mapAuthToSecurityScheme(e){switch(e.type){case"bearer":return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}};case"basic":return{schemeName:"BasicAuth",scheme:{type:"http",scheme:"basic"},requirement:{BasicAuth:[]}};case"apikey":{let r=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${r.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:r.in||"header",name:r.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let r=e.oauth2;if(!r)return;let n={};switch(r.grantType){case"client_credentials":n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:r.authUrl||"",tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"password":n.password={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"implicit":n.implicit={authorizationUrl:r.authUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;default:n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:{}}}return{schemeName:"OAuth2",scheme:{type:"oauth2",flows:n},requirement:{OAuth2:[]}}}default:return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}}}}parseScopes(e){let r={};for(let n of e.split(/\s+/))n&&(r[n]="");return r}deduplicateComponents(e){let r=new Map,n=new Map;if(e.paths)for(let[i,s]of Object.entries(e.paths))for(let[a,u]of Object.entries(s)){let f=u;if(f.responses){for(let[h,g]of Object.entries(f.responses))if(g.content)for(let m of Object.values(g.content))m.schema&&this.trackSchema(m.schema,`${a}${i}Response${h}`,r,n)}if(f.requestBody?.content)for(let h of Object.values(f.requestBody.content))h.schema&&this.trackSchema(h.schema,`${a}${i}Request`,r,n)}for(let[i,s]of r)if((n.get(i)||0)>=2){let u=this.sanitizeComponentName(s.name);e.components.schemas[u]=s.schema,this.replaceInlineSchema(e,s.schema,`#/components/schemas/${u}`)}}trackSchema(e,r,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:r,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,r,n){let i=JSON.stringify(r);if(e.paths)for(let s of Object.values(e.paths))for(let a of Object.values(s)){if(a.responses){for(let u of Object.values(a.responses))if(u.content)for(let f of Object.values(u.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(a.requestBody?.content)for(let u of Object.values(a.requestBody.content))u.schema&&JSON.stringify(u.schema)===i&&(u.schema={$ref:n})}}sanitizeComponentName(e){return e.replace(/[^a-zA-Z0-9._-]/g,"").replace(/^[^a-zA-Z]/,"Schema")}cleanSummary(e){return e.replace(/^\[DEPRECATED\]\s*/i,"")}hasDeprecatedPrefix(e){return/^\[DEPRECATED\]/i.test(e)}augmentServersFromHostVars(e,r,n){if(e.size===0)return;let i=new Set(r.map(a=>a.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(a=>!!a);for(let a of e){let u=`{{${a}}}`,f=!1;for(let h of s){let g=this.envConfigService.resolveVariables(u,h);g&&g!==u&&!i.has(g)&&(r.push({url:g,description:h}),i.add(g),f=!0)}if(!f){let h=`{${a}}`;i.has(h)||(r.push({url:h,variables:{[a]:{default:""}}}),i.add(h))}}}};var yA=ve(require("fs")),vA=ve(f_());var pa=class{generate(e,r){if(!e)return;let n=r||{};if(e.$ref){let i=this.resolveLocalRef(e.$ref,n.components);return i?this.generate(i,n):{}}if(e.nullable&&!e.type)return null;if(e.enum&&e.enum.length>0)return e.enum[0];if(e.default!==void 0)return e.default;if(e.example!==void 0)return e.example;if(e.allOf)return this.generateFromAllOf(e.allOf,e.discriminator,n);if(e.oneOf)return this.generateFromOneOfAnyOf(e.oneOf,e.discriminator,n);if(e.anyOf)return this.generateFromOneOfAnyOf(e.anyOf,e.discriminator,n);switch(e.type){case"string":return this.generateString(e);case"integer":return this.generateInteger(e);case"number":return this.generateNumber(e);case"boolean":return!1;case"array":return this.generateArray(e,n);case"object":return this.generateObject(e,n);default:return e.properties?this.generateObject(e,n):{}}}generateString(e){switch(e.format){case"email":return"user@example.com";case"date-time":return"2026-01-01T00:00:00Z";case"date":return"2026-01-01";case"time":return"00:00:00";case"uri":case"url":return"https://example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"ipv4":return"127.0.0.1";case"ipv6":return"::1";case"hostname":return"example.com";case"binary":return"";case"byte":return"c3RyaW5n";case"password":return"********";default:return"string"}}generateInteger(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+1:0}generateNumber(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+.1:0}generateArray(e,r){return e.items?[this.generate(e.items,r)]:[]}generateObject(e,r){let n={},i=e.properties||{};for(let[s,a]of Object.entries(i))r.omitReadOnly&&a.readOnly||(n[s]=this.generate(a,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let a of e){let u=a.$ref?this.resolveLocalRef(a.$ref,n.components)||{}:a;u.properties&&Object.assign(i.properties,u.properties),u.required&&(i.required=[...i.required||[],...u.required])}let s=this.generateObject(i,n);return r?.propertyName&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,r,n){if(e.length===0)return{};let i=e[0].$ref&&this.resolveLocalRef(e[0].$ref,n.components)||e[0],s=this.generate(i,n);return r?.propertyName&&typeof s=="object"&&s!==null&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,r){if(e.length===0)return"unknown";let n=e[0];if(n.$ref){let i=n.$ref.split("/");return i[i.length-1]}return"variant1"}resolveLocalRef(e,r){if(!e||!r)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return r[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return r[i[1]]}};var tg=ve(gA()),Ea=class{async resolve(e){try{return await tg.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",r),e}}async bundle(e){try{return await tg.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await tg.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}};var x4=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Ca=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new pa,this.refResolver=new Ea}exampleGenerator;refResolver;async import(e,r){let n=await yA.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=vA.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},a=r?.collectionName||i.info?.title||"Imported API",f={id:rt(a),name:a,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(f.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let m=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);m&&(f.auth=m)}let h=new Map;if(i.tags)for(let m of i.tags){let S={type:"folder",id:rt(m.name),name:m.name,description:m.description,items:[]};h.set(m.name,S),f.items.push(S)}if(i.paths)for(let[m,S]of Object.entries(i.paths))for(let _ of["get","post","put","patch","delete","head","options","trace"]){let C=S[_];if(!C)continue;let x=this.processOperation(_,m,C,S,i,s),A=C.tags?.[0];if(A&&h.has(A))h.get(A).items.push(x);else if(A){let T={type:"folder",id:rt(A),name:A,items:[x]};h.set(A,T),f.items.push(T)}else f.items.push(x)}await this.collectionService.saveCollection(f);let g;return r?.environmentName&&i.servers&&(g=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:g}}processOperation(e,r,n,i,s,a){let u=rt(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,h=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,g=n.deprecated===!0;g&&(h=`[DEPRECATED] ${h}`);let m={type:"request",id:u,name:h,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:g},S=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(m,S,a),n.requestBody&&this.processRequestBody(m,n.requestBody,a),n.responses&&(m.responseSchema=this.processResponses(n.responses,a)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)m.auth={type:"none"};else if(n.security&&n.security.length>0){let _=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);_&&(m.auth=_)}}return m}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],a={},u=[];for(let f of r){let h=f.name,g=f.in,m=f.schema||{},S=f.example!==void 0?String(f.example):this.generateExampleForParam(m,n),_=f.deprecated===!0;switch(g){case"path":{if(f.description||m.type||m.format||m.enum||_||m.pattern||m.minimum!==void 0||m.maximum!==void 0||m.minLength!==void 0||m.maxLength!==void 0||m.multipleOf!==void 0||m.minItems!==void 0||m.maxItems!==void 0||m.uniqueItems||m.nullable||m.oneOf){let x={value:S};m.oneOf?(x.oneOf=m.oneOf,this.applyOneOfHints(x,m.oneOf)):(m.type&&(x.type=m.type),m.format&&(x.format=m.format),m.enum&&(x.enum=m.enum.map(String)),m.pattern&&(x.pattern=m.pattern),m.minimum!==void 0&&(x.minimum=m.minimum),m.maximum!==void 0&&(x.maximum=m.maximum),m.exclusiveMinimum!==void 0&&(x.exclusiveMinimum=m.exclusiveMinimum),m.exclusiveMaximum!==void 0&&(x.exclusiveMaximum=m.exclusiveMaximum),m.multipleOf!==void 0&&(x.multipleOf=m.multipleOf),m.minLength!==void 0&&(x.minLength=m.minLength),m.maxLength!==void 0&&(x.maxLength=m.maxLength),m.minItems!==void 0&&(x.minItems=m.minItems),m.maxItems!==void 0&&(x.maxItems=m.maxItems),m.uniqueItems&&(x.uniqueItems=!0),m.nullable&&(x.nullable=!0)),f.description&&(x.description=f.description),_&&(x.deprecated=!0),a[h]=x}else a[h]=S;break}case"query":{let C={key:h,value:S};this.applySchemaConstraints(C,m,f,_),s.push(C);break}case"header":{let C={key:h,value:S};this.applySchemaConstraints(C,m,f,_),i.push(C);break}case"cookie":{u.push(`${h}={{${h}}}`);break}}}u.length>0&&i.push({key:"Cookie",value:u.join("; ")}),Object.keys(a).length>0&&(e.params=a),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,r,n,i){r.oneOf?(e.oneOf=r.oneOf,this.applyOneOfHints(e,r.oneOf)):(r.type&&(e.type=r.type),r.format&&(e.format=r.format),r.enum&&(e.enum=r.enum.map(String)),r.pattern&&(e.pattern=r.pattern),r.minimum!==void 0&&(e.minimum=r.minimum),r.maximum!==void 0&&(e.maximum=r.maximum),r.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=r.exclusiveMinimum),r.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=r.exclusiveMaximum),r.multipleOf!==void 0&&(e.multipleOf=r.multipleOf),r.minLength!==void 0&&(e.minLength=r.minLength),r.maxLength!==void 0&&(e.maxLength=r.maxLength),r.minItems!==void 0&&(e.minItems=r.minItems),r.maxItems!==void 0&&(e.maxItems=r.maxItems),r.uniqueItems&&(e.uniqueItems=!0),r.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,r){let n=[],i=new Set;for(let s of r)s.type&&i.add(s.type),s.enum&&n.push(...s.enum.map(String));i.size===1&&(e.type=[...i][0]),n.length>0&&(e.enum=[...new Set(n)])}generateExampleForParam(e,r){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:r});return n==null?"":String(n)}processRequestBody(e,r,n){if(!r.content)return;let i=Object.keys(r.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),a=r.content[s],{bodyType:u,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:u,...f&&{format:f},content:""},a){let g=this.generateBodyContent(a,s,n);g!==void 0&&(e.body.content=typeof g=="string"?g:JSON.stringify(g,null,2)),u==="form-data"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n)),u==="x-www-form-urlencoded"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n))}let h=this.buildBodySchema(r,s,n);h&&(e.bodySchema=h)}selectPrimaryContentType(e){for(let i of x4)if(e.includes(i))return i;let r=e.find(i=>i.includes("json"));if(r)return r;let n=e.find(i=>i.startsWith("text/"));return n||e[0]}mapContentTypeToBodyType(e){return e.includes("json")?{bodyType:"raw",bodyFormat:"json"}:e==="application/xml"||e==="text/xml"?{bodyType:"raw",bodyFormat:"xml"}:e==="text/html"?{bodyType:"raw",bodyFormat:"html"}:e.startsWith("text/")?{bodyType:"raw",bodyFormat:"text"}:e==="multipart/form-data"?{bodyType:"form-data"}:e==="application/x-www-form-urlencoded"?{bodyType:"x-www-form-urlencoded"}:e==="application/octet-stream"?{bodyType:"binary"}:{bodyType:"raw",bodyFormat:"text"}}generateBodyContent(e,r,n){if(e.example!==void 0)return e.example;if(e.examples){let i=Object.values(e.examples)[0];if(i?.value!==void 0)return i.value}if(e.schema)return this.exampleGenerator.generate(e.schema,{omitReadOnly:!0,components:n})}buildFormDataEntries(e,r){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[a,u]of Object.entries(i)){let f=u,h=f.type==="string"&&f.format==="binary",g={key:a,value:h?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:h?"file":"text",enabled:!0};n.push(g)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let a={contentType:r,schema:s.schema};if(i.length>1){a.content={};for(let f of i){let h=e.content[f],g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),h.encoding&&(g.encoding=h.encoding),a.content[f]=g}}s.encoding&&(a.encoding=s.encoding);let u=this.extractUsedComponents(s.schema,n);return Object.keys(u).length>0&&(a.components=u),a}processResponses(e,r){let n={responses:{}},i={};for(let[s,a]of Object.entries(e)){let u=a,f={description:u.description||`Status ${s}`};if(u.content){let h=Object.keys(u.content);if(h.length===1){let g=h[0],m=u.content[g];f.contentType=g,m.schema&&(f.schema=m.schema),m.examples&&(f.examples=m.examples),m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}else{f.content={};for(let g of h){let m=u.content[g],S={};m.schema&&(S.schema=m.schema),m.examples&&(S.examples=m.examples),f.content[g]=S,m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}}}if(u.headers){f.headers={};for(let[h,g]of Object.entries(u.headers)){let m=g;f.headers[h]={...m.description&&{description:m.description},schema:m.schema||{type:"string"}}}}n.responses[s]=f}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,r){let n=Object.keys(e)[0];if(!n)return;let i=r[n];if(i)switch(i.type){case"http":if(i.scheme==="bearer")return{type:"bearer",bearerToken:""};if(i.scheme==="basic")return{type:"basic",basicAuth:{username:"",password:""}};break;case"apiKey":return{type:"apikey",apikey:{key:i.name||"X-Api-Key",value:"",in:i.in||"header"}};case"oauth2":{let s=i.flows||{},a=s.authorizationCode||s.clientCredentials||s.password||s.implicit||{},u="client_credentials";return s.authorizationCode?u="authorization_code":s.password?u="password":s.implicit&&(u="implicit"),{type:"oauth2",oauth2:{grantType:u,tokenUrl:a.tokenUrl||"",authUrl:a.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(a.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,r){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return r}extractUsedComponents(e,r,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&r[s]&&!i[s]&&(i[s]=r[s],this.extractUsedComponents(r[s],r,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,r,i);e.items&&this.extractUsedComponents(e.items,r,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let a of e[s])this.extractUsedComponents(a,r,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,r,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}};var xa=class{constructor(e,r,n){this.historyAnalyzer=e;this.scriptAnalyzer=r;this.inferrer=n}async infer(e,r,n,i){let s=await this.historyAnalyzer.analyze(e,r,{environment:i?.environment}),a;return i?.postResponseScript&&(a=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,a)}async inferBodySchema(e,r,n,i,s){let a,u;if(r==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}a=this.inferrer.inferFromValue(f),u="application/json"}else r==="form-data"&&i?(a=this.buildFormDataSchema(i),u="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(a=this.buildFormDataSchema(i),u="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(a={type:"string"},u="application/xml"):r==="raw"&&(n==="text"||n==="html")?(a={type:"string"},u=n==="html"?"text/html":"text/plain"):r==="binary"?(a={type:"string",format:"binary"},u="application/octet-stream"):r==="graphql"&&(a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},u="application/json");if(a)return s?this.mergeBodySchemaWithExisting(a,s):{contentType:u,schema:a}}buildFormDataSchema(e){let r={type:"object",properties:{}},n=[];for(let i of e){if(!i.enabled&&i.enabled!==void 0)continue;let s={};i.type?s.type=i.type:s.type="string",i.description&&(s.description=i.description),i.format&&(s.format=i.format),i.enum&&(s.enum=i.enum),i.type==="file"&&(s.type="string",s.format="binary"),r.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(r.required=n),r}mergeResponseSchemas(e,r,n){let i={responses:{}};for(let[s,a]of Object.entries(r.responses))i.responses[s]={...a};if(n&&this.applyScriptHints(i,n),e){for(let[s,a]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],a):i.responses[s]={...a};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,r){for(let n of r.expectedStatuses){let i=String(n);e.responses[i]||(e.responses[i]={description:`Status ${n}`})}for(let[,n]of Object.entries(e.responses))n.schema&&this.augmentSchemaWithHints(n.schema,r)}augmentSchemaWithHints(e,r){if(!(e.type!=="object"||!e.properties))for(let n of r.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,r)}}ensureFieldPath(e,r,n,i=""){if(r.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=r[0],a=s.endsWith("[]"),u=a?s.slice(0,-2):s,f=i?`${i}.${s}`:s,h=r.slice(1);if(!e.properties[u])if(a)e.properties[u]={type:"array",items:{type:"object"}};else if(h.length>0)e.properties[u]={type:"object",properties:{}};else{let g=n.typeHints[f];e.properties[u]={type:g||"string"};return}if(h.length>0){let g=a?e.properties[u].items:e.properties[u];g&&this.ensureFieldPath(g,h,n,f)}}mergeResponseDefinitions(e,r){let n={...e};return r.description&&(n.description=r.description),r.contentType&&(n.contentType=r.contentType),r.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,r.schema):r.schema&&(n.schema=r.schema),r.examples&&(n.examples={...e.examples||{},...r.examples}),r.content&&(n.content={...e.content||{},...r.content}),r.headers&&(n.headers={...e.headers||{},...r.headers}),n}mergeBodySchemaWithExisting(e,r){let n={...r};return r.schema?n.schema=this.inferrer.mergeSchemas(e,r.schema):n.schema=e,n}};var SA=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,bA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(?:a|an)\(['"](\w+)['"]\)/g,_A=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.(?:equal|eql)\((.+?)\)/g,wA=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,EA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(true|false)/g,CA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.have\.(?:lengthOf|length\.above|length\.below)/g,Ra=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(SA.source,SA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&r.fieldPaths.push(s)}}extractTypeAssertions(e,r){let n,i=new RegExp(bA.source,bA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(a),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(_A.source,_A.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].trim();if(s){let u=this.parseAssertionValue(a);u!==void 0&&(r.valueHints[s]=u,typeof u=="string"?r.typeHints[s]=r.typeHints[s]||"string":typeof u=="number"?r.typeHints[s]=r.typeHints[s]||(Number.isInteger(u)?"integer":"number"):typeof u=="boolean"&&(r.typeHints[s]=r.typeHints[s]||"boolean")),r.fieldPaths.includes(s)||r.fieldPaths.push(s)}}}extractBooleanAssertions(e,r){let n,i=new RegExp(EA.source,EA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]="boolean",r.valueHints[s]=n[2]==="true",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractLengthAssertions(e,r){let n,i=new RegExp(CA.source,CA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]=r.typeHints[s]||"array",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractStatusAssertions(e,r){let n,i=new RegExp(wA.source,wA.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&r.expectedStatuses.push(s)}}normalizeFieldPath(e){let r=e.replace(/^\./,"");return r=r.replace(/\[\d+\]/g,"[]"),r}isCommonMethodCall(e){return new Set(["to","be","have","not","deep","any","all","that","is","has","include","includes","equal","eql","above","below","least","most","within","length","lengthOf","match","string","keys","key","property","ownProperty","status","header","json","text"]).has(e.split(".")[0])}mapAssertionType(e){return{string:"string",number:"number",object:"object",array:"array",boolean:"boolean",null:"null",undefined:"null",int:"integer",integer:"integer",float:"number",double:"number"}[e]||"string"}parseAssertionValue(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let r=Number(e);return!isNaN(r)&&e.trim().length>0?r:e==="true"?!0:e==="false"?!1:e==="null"?null:e}};var ne={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter")};var R4={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}};function xw(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:a,secretStore:u,browserService:f,applicationInfo:h,consoleService:g}=e;t.registerValue(ne.WorkspaceFolder,r),t.registerSingleton(ne.Config,()=>new ia(r,n,i)),t.registerSingleton(ne.Console,()=>g??R4),t.registerSingleton(ne.EnvironmentConfig,S=>new Gl(r,s,S.resolve(ne.Config),n)),t.registerSingleton(ne.Cookie,()=>new zl(a)),t.registerSingleton(ne.Collection,S=>new Jl(r,S.resolve(ne.Config),n)),t.registerSingleton(ne.HttpClient,()=>new Hs),t.registerSingleton(ne.UrlBuilder,()=>new fn),t.registerSingleton(ne.InterceptorChain,()=>new bi),t.registerSingleton(ne.HttpRequest,S=>new Si(S.resolve(ne.UrlBuilder),S.resolve(ne.InterceptorChain),S.resolve(ne.HttpClient))),t.registerSingleton(ne.RequestPreprocessor,()=>new Qs),t.registerSingleton(ne.RequestHistory,S=>{let _=S.resolve(ne.EnvironmentConfig);return new ru(_.getHistoriesPath(),xA.join(_.getRootPath(),"shared-histories"))}),u&&f&&t.registerSingleton(ne.OAuth2TokenManager,S=>new Vl(u,f,S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest))),t.registerSingleton(ne.GraphQLSchemaService,S=>new Xl(S.resolve(ne.HttpClient)));let m=h??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ne.RequestPreparer,S=>new Zl(S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest),S.resolve(ne.RequestPreprocessor),S.resolve(ne.OAuth2TokenManager),m)),t.registerSingleton(ne.ScriptExecutor,S=>{let _=S.resolve(ne.Config);return new Ri(S.resolve(ne.HttpRequest),_.getModulePaths())}),t.registerSingleton(ne.DataFileParser,()=>new Xs),t.registerSingleton(ne.CollectionRequestExecutor,S=>new Ql(S.resolve(ne.HttpRequest),S.resolve(ne.ScriptExecutor),S.resolve(ne.EnvironmentConfig),S.resolve(ne.RequestPreparer),"")),t.registerSingleton(ne.PersistentCookieJar,S=>new Kl(S.resolve(ne.Cookie))),t.registerSingleton(ne.SchemaInferrer,()=>new ns),t.registerSingleton(ne.HistoryAnalyzer,S=>new oa(S.resolve(ne.RequestHistory),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.ScriptAnalyzer,()=>new Ra),t.registerSingleton(ne.SchemaInferenceService,S=>new xa(S.resolve(ne.HistoryAnalyzer),S.resolve(ne.ScriptAnalyzer),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.OpenApiExporter,S=>new ha(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig),S.resolve(ne.SchemaInferenceService))),t.registerSingleton(ne.OpenApiImporter,S=>new Ca(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig)))}var Ou=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(ne.Config)}get console(){return this.resolve(ne.Console)}get environmentConfig(){return this.resolve(ne.EnvironmentConfig)}get collection(){return this.resolve(ne.Collection)}get httpRequest(){return this.resolve(ne.HttpRequest)}get httpClient(){return this.resolve(ne.HttpClient)}get cookie(){return this.resolve(ne.Cookie)}get requestHistory(){return this.resolve(ne.RequestHistory)}get dataFileParser(){return this.resolve(ne.DataFileParser)}get scriptExecutor(){return this.resolve(ne.ScriptExecutor)}get requestPreparer(){return this.resolve(ne.RequestPreparer)}get persistentCookieJar(){return this.resolve(ne.PersistentCookieJar)}get oauth2TokenManager(){return this.resolve(ne.OAuth2TokenManager)}get graphqlSchemaService(){return this.resolve(ne.GraphQLSchemaService)}};function Rw(){return Ou.instance}var rg=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())ot.isExpired(n)||(!n.domain||ot.domainMatches(e,n.domain))&&r.push(n);return r}has(e,r){return this.get(e,r)!==void 0}get(e,r){let n=this.getCookieKey(e,r),i=this.cookies.get(n);if(i&&!ot.isExpired(i))return i}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let r=[];for(let n of this.cookies.values())ot.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=ot.extractDomain(e),i=ot.parseCookieHeaders(r,n);for(let s of i){let a=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(a,s)}}getCookieHeader(e){let r=ot.extractDomain(e),n=ot.extractPath(e),s=this.getCookiesForDomain(r).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return ot.formatCookieHeader(s)}clear(){this.cookies.clear()}};function OA(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=$4(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(M4(a))return{contextType:"variable_def",fieldPath:[],prefix:s};let u=a.match(/\.\.\.\s+on\s+(\w*)$/);if(u)return{contextType:"fragment_type",fieldPath:[],prefix:u[1]||""};let f=a.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&RA(a)){let m=Iw(a,r),S=m.length>0?m[m.length-1]:void 0,_=IA(a);return{contextType:"argument_value",fieldPath:m,parentType:S,prefix:f[2]||"",currentArg:f[1],currentField:_||void 0}}if(RA(a)){let m=Iw(a,r),S=m.length>0?m[m.length-1]:void 0,_=IA(a);return{contextType:"argument",fieldPath:m,parentType:S,prefix:s,currentField:_||void 0}}if(Ow(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let g=Iw(a,r);return{contextType:"selection_set",fieldPath:g,parentType:g.length>0?g[g.length-1]:void 0,prefix:s}}function PA(t,e){switch(e.contextType){case"root":return I4(t,e.prefix);case"selection_set":return O4(t,e);case"argument":return P4(t,e);case"argument_value":return k4(t,e);case"directive":return A4(t,e.prefix);case"fragment_type":return T4(t,e.prefix);case"variable_def":return q4(t,e.prefix);default:return[]}}function I4(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
|
|
269
|
+
Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=new Set(e.tags||[]);for(let s of r.tags)i.add(s);e.tags=[...i]}if(r.parameters){e.parameters||(e.parameters=[]);for(let i of r.parameters){let s=e.parameters.find(a=>a.name===i.name&&a.in===i.in);s?this.mergeParameterSchema(s,i,n):e.parameters.push(i)}}if(r.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(r.responses))e.responses[i]||(e.responses[i]=s)}if(r.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(r.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else r.requestBody&&!e.requestBody&&(e.requestBody=r.requestBody)}mergeParameterSchema(e,r,n){e.schema||(e.schema={});let i=e.schema,s=r.schema||{},a=this.getConstraintKind(i),u=this.getConstraintKind(s);if(a==="none"&&u==="none")this.widenType(i,s);else if(a==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(u==="none")this.widenType(i,s);else if(a===u)this.mergeSameKindConstraints(i,s,a),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(h=>JSON.stringify(h)===JSON.stringify(f))||i.oneOf.push(f)}else if(s.oneOf){let f=this.buildVariantSchema(i);i.oneOf=[f,...s.oneOf]}else{let f=this.buildVariantSchema(i),h=this.buildVariantSchema(s);i.oneOf=[f,h]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let f=`variant_${n.replace(/[^a-zA-Z0-9_]/g,"_")}`;e.examples[f]={value:r.example},delete e.example}}getConstraintKind(e){return e.oneOf?"oneOf":e.enum&&e.enum.length>0?"enum":e.pattern?"pattern":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"range":e.minLength!==void 0||e.maxLength!==void 0?"length":e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.format?"format":"none"}mergeSameKindConstraints(e,r,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of r.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{r.pattern&&r.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${r.pattern})`);break}case"range":{r.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,r.minimum):r.minimum),r.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,r.maximum):r.maximum),r.exclusiveMinimum&&(e.exclusiveMinimum=!0),r.exclusiveMaximum&&(e.exclusiveMaximum=!0),r.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,r.multipleOf):r.multipleOf);break}case"length":{r.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,r.minLength):r.minLength),r.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,r.maxLength):r.maxLength);break}case"array":{r.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,r.minItems):r.minItems),r.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,r.maxItems):r.maxItems),r.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(r.format&&r.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:r.type||"string",format:r.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(r.oneOf)for(let i of r.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let r={};return e.type&&(r.type=e.type),e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}stripConstraints(e){delete e.enum,delete e.pattern,delete e.format,delete e.minimum,delete e.maximum,delete e.exclusiveMinimum,delete e.exclusiveMaximum,delete e.multipleOf,delete e.minLength,delete e.maxLength,delete e.minItems,delete e.maxItems,delete e.uniqueItems,delete e.nullable}extractConstraints(e){let r={};return e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}widenType(e,r){!r.type||r.type===e.type||(e.type?(e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer")&&(e.type="number"):e.type=r.type)}normalizeUrl(e){let r=e,n=null,i=r.match(/^\{\{(\w+)\}\}/);return i&&(n=i[1],r=r.slice(i[0].length)),r=r.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),r=r.replace(/\{\{(\w+)\}\}/g,"{$1}"),r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),r=r.replace(/\/\//g,"/"),{path:r,hostVar:n}}generateOperationId(e,r,n,i){let s=this.toCamelCase(e.name),a=this.collectOperationIds(i);if(a.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||a.has(s)){let u=n.split("/").filter(f=>f&&!f.startsWith("{"));s=r+u.map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}return s}collectOperationIds(e){let r=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&r.add(i.operationId);return r}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(r,n)=>n.toUpperCase()).replace(/^[A-Z]/,r=>r.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let r=[];if(e.params)for(let[n,i]of Object.entries(e.params)){let s={name:n,in:"path",required:!0};if(typeof i=="string")s.schema={type:this.inferTypeFromValue(i)},s.example=this.coerceExample(i,s.schema.type);else{let a=i;a.oneOf?(s.schema={oneOf:a.oneOf},a.type&&(s.schema.type=a.type)):(s.schema={type:a.type||this.inferTypeFromValue(a.value)},a.format&&(s.schema.format=a.format),a.enum&&(s.schema.enum=a.enum),a.pattern&&(s.schema.pattern=a.pattern),a.minimum!==void 0&&(s.schema.minimum=a.minimum),a.maximum!==void 0&&(s.schema.maximum=a.maximum),a.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=a.exclusiveMinimum),a.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=a.exclusiveMaximum),a.multipleOf!==void 0&&(s.schema.multipleOf=a.multipleOf),a.minLength!==void 0&&(s.schema.minLength=a.minLength),a.maxLength!==void 0&&(s.schema.maxLength=a.maxLength),a.minItems!==void 0&&(s.schema.minItems=a.minItems),a.maxItems!==void 0&&(s.schema.maxItems=a.maxItems),a.uniqueItems&&(s.schema.uniqueItems=!0),a.nullable&&(s.schema.nullable=!0)),a.description&&(s.description=a.description),a.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(a.value,s.schema.type||"string")}r.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");r.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);r.push(...i)}for(let i of e.headers){if(!i.key||lJ.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");r.push(s)}}return r}buildKeyValueParam(e,r){let n={name:e.key,in:r,schema:{}};return e.oneOf?(n.schema.oneOf=e.oneOf,e.type&&(n.schema.type=e.type)):(n.schema.type=e.type||"string",e.format&&(n.schema.format=e.format),e.enum&&(n.schema.enum=e.enum),e.pattern&&(n.schema.pattern=e.pattern),e.minimum!==void 0&&(n.schema.minimum=e.minimum),e.maximum!==void 0&&(n.schema.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(n.schema.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(n.schema.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(n.schema.multipleOf=e.multipleOf),e.minLength!==void 0&&(n.schema.minLength=e.minLength),e.maxLength!==void 0&&(n.schema.maxLength=e.maxLength),e.minItems!==void 0&&(n.schema.minItems=e.minItems),e.maxItems!==void 0&&(n.schema.maxItems=e.maxItems),e.uniqueItems&&(n.schema.uniqueItems=!0),e.nullable&&(n.schema.nullable=!0)),e.required&&(n.required=!0),e.description&&(n.description=e.description),e.deprecated&&(n.deprecated=!0),e.value&&(n.example=this.coerceExample(e.value,n.schema.type||"string")),n}parseCookieHeader(e){let r=[],n=e.split(";").map(i=>i.trim()).filter(Boolean);for(let i of n){let s=i.indexOf("=");if(s>0){let a=i.substring(0,s).trim(),u=i.substring(s+1).trim();r.push({name:a,in:"cookie",schema:{type:"string"},example:u})}}return r}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,r){let n=this.sanitizeEnvVar(e);switch(r){case"integer":return parseInt(n,10)||n;case"number":return parseFloat(n)||n;case"boolean":return n==="true";default:return n}}sanitizeEnvVar(e){return e.replace(/\{\{(\w+)\}\}/g,"<$1>")}sanitizeObjectExamples(e){if(typeof e=="string")return this.sanitizeEnvVar(e);if(Array.isArray(e))return e.map(r=>this.sanitizeObjectExamples(r));if(e!==null&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeObjectExamples(i);return r}return e}async buildRequestBody(e,r){if(!e.body||e.body.type==="none")return null;let n=e.body,i={required:!0,content:{}},s,a,u,f;if(e.bodySchema){if(e.bodySchema.content){for(let[m,S]of Object.entries(e.bodySchema.content)){let E={};S.schema&&(E.schema=S.schema),S.examples&&(E.examples=S.examples),S.encoding&&(E.encoding=S.encoding),i.content[m]=E}let g=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(g&&n.content){let m=this.tryParseBodyContent(n);m!==void 0&&i.content[g]&&(i.content[g].example=m)}return i}s=e.bodySchema.contentType||this.getContentType(n),a=e.bodySchema.schema,e.bodySchema.components,u=this.tryParseBodyContent(n),e.bodySchema.encoding&&(f=e.bodySchema.encoding)}else switch(s=this.getContentType(n),n.type){case"raw":{if(n.format==="json"&&n.content){let g=this.tryParseBodyContent(n);g!==void 0?(a=this.inferrer.inferFromValue(g),u=g):a={type:"string"}}else a={type:"string"},u=typeof n.content=="string"?n.content:void 0;break}case"form-data":{a=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{a=this.buildFormDataSchemaFromBody(n);break}case"binary":{a={type:"string",format:"binary"};break}case"graphql":{a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},u=this.tryParseBodyContent(n);break}default:return null}let h={};return a&&(h.schema=a),u!==void 0&&(h.example=u),f&&(h.encoding=f),i.content[s]=h,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,a]of Object.entries(e.responseSchema.responses)){let u={description:a.description||`Status ${s}`};if(a.content){u.content={};for(let[f,h]of Object.entries(a.content)){let g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),u.content[f]=g}}else if(a.schema){let f=a.contentType||"application/json",h={schema:a.schema};a.examples&&(h.examples=a.examples),u.content={[f]:h}}if(a.headers){u.headers={};for(let[f,h]of Object.entries(a.headers))u.headers[f]={...h.description&&{description:h.description},schema:h.schema}}i[s]=u}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}buildOperationSecurity(e,r,n){if(!e.auth||e.auth.type==="inherit")return;if(e.auth.type==="none")return[];let i=this.mapAuthToSecurityScheme(e.auth);if(!i)return;let{schemeName:s,scheme:a,requirement:u}=i;return n.set(s,a),[u]}mapAuthToSecurityScheme(e){switch(e.type){case"bearer":return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}};case"basic":return{schemeName:"BasicAuth",scheme:{type:"http",scheme:"basic"},requirement:{BasicAuth:[]}};case"apikey":{let r=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${r.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:r.in||"header",name:r.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let r=e.oauth2;if(!r)return;let n={};switch(r.grantType){case"client_credentials":n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:r.authUrl||"",tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"password":n.password={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"implicit":n.implicit={authorizationUrl:r.authUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;default:n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:{}}}return{schemeName:"OAuth2",scheme:{type:"oauth2",flows:n},requirement:{OAuth2:[]}}}default:return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}}}}parseScopes(e){let r={};for(let n of e.split(/\s+/))n&&(r[n]="");return r}deduplicateComponents(e){let r=new Map,n=new Map;if(e.paths)for(let[i,s]of Object.entries(e.paths))for(let[a,u]of Object.entries(s)){let f=u;if(f.responses){for(let[h,g]of Object.entries(f.responses))if(g.content)for(let m of Object.values(g.content))m.schema&&this.trackSchema(m.schema,`${a}${i}Response${h}`,r,n)}if(f.requestBody?.content)for(let h of Object.values(f.requestBody.content))h.schema&&this.trackSchema(h.schema,`${a}${i}Request`,r,n)}for(let[i,s]of r)if((n.get(i)||0)>=2){let u=this.sanitizeComponentName(s.name);e.components.schemas[u]=s.schema,this.replaceInlineSchema(e,s.schema,`#/components/schemas/${u}`)}}trackSchema(e,r,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:r,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,r,n){let i=JSON.stringify(r);if(e.paths)for(let s of Object.values(e.paths))for(let a of Object.values(s)){if(a.responses){for(let u of Object.values(a.responses))if(u.content)for(let f of Object.values(u.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(a.requestBody?.content)for(let u of Object.values(a.requestBody.content))u.schema&&JSON.stringify(u.schema)===i&&(u.schema={$ref:n})}}sanitizeComponentName(e){return e.replace(/[^a-zA-Z0-9._-]/g,"").replace(/^[^a-zA-Z]/,"Schema")}cleanSummary(e){return e.replace(/^\[DEPRECATED\]\s*/i,"")}hasDeprecatedPrefix(e){return/^\[DEPRECATED\]/i.test(e)}augmentServersFromHostVars(e,r,n){if(e.size===0)return;let i=new Set(r.map(a=>a.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(a=>!!a);for(let a of e){let u=`{{${a}}}`,f=!1;for(let h of s){let g=this.envConfigService.resolveVariables(u,h);g&&g!==u&&!i.has(g)&&(r.push({url:g,description:h}),i.add(g),f=!0)}if(!f){let h=`{${a}}`;i.has(h)||(r.push({url:h,variables:{[a]:{default:""}}}),i.add(h))}}}};var CA=Se(require("fs")),RA=Se(c_());var ma=class{generate(e,r){if(!e)return;let n=r||{};if(e.$ref){let i=this.resolveLocalRef(e.$ref,n.components);return i?this.generate(i,n):{}}if(e.nullable&&!e.type)return null;if(e.enum&&e.enum.length>0)return e.enum[0];if(e.default!==void 0)return e.default;if(e.example!==void 0)return e.example;if(e.allOf)return this.generateFromAllOf(e.allOf,e.discriminator,n);if(e.oneOf)return this.generateFromOneOfAnyOf(e.oneOf,e.discriminator,n);if(e.anyOf)return this.generateFromOneOfAnyOf(e.anyOf,e.discriminator,n);switch(e.type){case"string":return this.generateString(e);case"integer":return this.generateInteger(e);case"number":return this.generateNumber(e);case"boolean":return!1;case"array":return this.generateArray(e,n);case"object":return this.generateObject(e,n);default:return e.properties?this.generateObject(e,n):{}}}generateString(e){switch(e.format){case"email":return"user@example.com";case"date-time":return"2026-01-01T00:00:00Z";case"date":return"2026-01-01";case"time":return"00:00:00";case"uri":case"url":return"https://example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"ipv4":return"127.0.0.1";case"ipv6":return"::1";case"hostname":return"example.com";case"binary":return"";case"byte":return"c3RyaW5n";case"password":return"********";default:return"string"}}generateInteger(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+1:0}generateNumber(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+.1:0}generateArray(e,r){return e.items?[this.generate(e.items,r)]:[]}generateObject(e,r){let n={},i=e.properties||{};for(let[s,a]of Object.entries(i))r.omitReadOnly&&a.readOnly||(n[s]=this.generate(a,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let a of e){let u=a.$ref?this.resolveLocalRef(a.$ref,n.components)||{}:a;u.properties&&Object.assign(i.properties,u.properties),u.required&&(i.required=[...i.required||[],...u.required])}let s=this.generateObject(i,n);return r?.propertyName&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,r,n){if(e.length===0)return{};let i=e[0].$ref&&this.resolveLocalRef(e[0].$ref,n.components)||e[0],s=this.generate(i,n);return r?.propertyName&&typeof s=="object"&&s!==null&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,r){if(e.length===0)return"unknown";let n=e[0];if(n.$ref){let i=n.$ref.split("/");return i[i.length-1]}return"variant1"}resolveLocalRef(e,r){if(!e||!r)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return r[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return r[i[1]]}};var eg=Se(xA()),Ea=class{async resolve(e){try{return await eg.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",r),e}}async bundle(e){try{return await eg.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await eg.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}};var Z4=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],xa=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new ma,this.refResolver=new Ea}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await CA.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=RA.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},a=r?.collectionName||i.info?.title||"Imported API",f={id:lt(a),name:a,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(f.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let m=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);m&&(f.auth=m)}let h=new Map;if(i.tags)for(let m of i.tags){let S={type:"folder",id:lt(m.name),name:m.name,description:m.description,items:[]};h.set(m.name,S),f.items.push(S)}if(i.paths)for(let[m,S]of Object.entries(i.paths))for(let E of["get","post","put","patch","delete","head","options","trace"]){let x=S[E];if(!x)continue;let C=this.processOperation(E,m,x,S,i,s),A=x.tags?.[0];if(A&&h.has(A))h.get(A).items.push(C);else if(A){let T={type:"folder",id:lt(A),name:A,items:[C]};h.set(A,T),f.items.push(T)}else f.items.push(C)}await this.collectionService.saveCollection(f);let g;return r?.environmentName&&i.servers&&(g=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:g}}processOperation(e,r,n,i,s,a){let u=lt(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,h=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,g=n.deprecated===!0;g&&(h=`[DEPRECATED] ${h}`);let m={type:"request",id:u,name:h,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:g},S=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(m,S,a),n.requestBody&&this.processRequestBody(m,n.requestBody,a),n.responses&&(m.responseSchema=this.processResponses(n.responses,a)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)m.auth={type:"none"};else if(n.security&&n.security.length>0){let E=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);E&&(m.auth=E)}}return m}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],a={},u=[];for(let f of r){let h=f.name,g=f.in,m=f.schema||{},S=f.example!==void 0?String(f.example):this.generateExampleForParam(m,n),E=f.deprecated===!0;switch(g){case"path":{if(f.description||m.type||m.format||m.enum||E||m.pattern||m.minimum!==void 0||m.maximum!==void 0||m.minLength!==void 0||m.maxLength!==void 0||m.multipleOf!==void 0||m.minItems!==void 0||m.maxItems!==void 0||m.uniqueItems||m.nullable||m.oneOf){let C={value:S};m.oneOf?(C.oneOf=m.oneOf,this.applyOneOfHints(C,m.oneOf)):(m.type&&(C.type=m.type),m.format&&(C.format=m.format),m.enum&&(C.enum=m.enum.map(String)),m.pattern&&(C.pattern=m.pattern),m.minimum!==void 0&&(C.minimum=m.minimum),m.maximum!==void 0&&(C.maximum=m.maximum),m.exclusiveMinimum!==void 0&&(C.exclusiveMinimum=m.exclusiveMinimum),m.exclusiveMaximum!==void 0&&(C.exclusiveMaximum=m.exclusiveMaximum),m.multipleOf!==void 0&&(C.multipleOf=m.multipleOf),m.minLength!==void 0&&(C.minLength=m.minLength),m.maxLength!==void 0&&(C.maxLength=m.maxLength),m.minItems!==void 0&&(C.minItems=m.minItems),m.maxItems!==void 0&&(C.maxItems=m.maxItems),m.uniqueItems&&(C.uniqueItems=!0),m.nullable&&(C.nullable=!0)),f.description&&(C.description=f.description),E&&(C.deprecated=!0),a[h]=C}else a[h]=S;break}case"query":{let x={key:h,value:S};this.applySchemaConstraints(x,m,f,E),s.push(x);break}case"header":{let x={key:h,value:S};this.applySchemaConstraints(x,m,f,E),i.push(x);break}case"cookie":{u.push(`${h}={{${h}}}`);break}}}u.length>0&&i.push({key:"Cookie",value:u.join("; ")}),Object.keys(a).length>0&&(e.params=a),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,r,n,i){r.oneOf?(e.oneOf=r.oneOf,this.applyOneOfHints(e,r.oneOf)):(r.type&&(e.type=r.type),r.format&&(e.format=r.format),r.enum&&(e.enum=r.enum.map(String)),r.pattern&&(e.pattern=r.pattern),r.minimum!==void 0&&(e.minimum=r.minimum),r.maximum!==void 0&&(e.maximum=r.maximum),r.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=r.exclusiveMinimum),r.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=r.exclusiveMaximum),r.multipleOf!==void 0&&(e.multipleOf=r.multipleOf),r.minLength!==void 0&&(e.minLength=r.minLength),r.maxLength!==void 0&&(e.maxLength=r.maxLength),r.minItems!==void 0&&(e.minItems=r.minItems),r.maxItems!==void 0&&(e.maxItems=r.maxItems),r.uniqueItems&&(e.uniqueItems=!0),r.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,r){let n=[],i=new Set;for(let s of r)s.type&&i.add(s.type),s.enum&&n.push(...s.enum.map(String));i.size===1&&(e.type=[...i][0]),n.length>0&&(e.enum=[...new Set(n)])}generateExampleForParam(e,r){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:r});return n==null?"":String(n)}processRequestBody(e,r,n){if(!r.content)return;let i=Object.keys(r.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),a=r.content[s],{bodyType:u,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:u,...f&&{format:f},content:""},a){let g=this.generateBodyContent(a,s,n);g!==void 0&&(e.body.content=typeof g=="string"?g:JSON.stringify(g,null,2)),u==="form-data"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n)),u==="x-www-form-urlencoded"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n))}let h=this.buildBodySchema(r,s,n);h&&(e.bodySchema=h)}selectPrimaryContentType(e){for(let i of Z4)if(e.includes(i))return i;let r=e.find(i=>i.includes("json"));if(r)return r;let n=e.find(i=>i.startsWith("text/"));return n||e[0]}mapContentTypeToBodyType(e){return e.includes("json")?{bodyType:"raw",bodyFormat:"json"}:e==="application/xml"||e==="text/xml"?{bodyType:"raw",bodyFormat:"xml"}:e==="text/html"?{bodyType:"raw",bodyFormat:"html"}:e.startsWith("text/")?{bodyType:"raw",bodyFormat:"text"}:e==="multipart/form-data"?{bodyType:"form-data"}:e==="application/x-www-form-urlencoded"?{bodyType:"x-www-form-urlencoded"}:e==="application/octet-stream"?{bodyType:"binary"}:{bodyType:"raw",bodyFormat:"text"}}generateBodyContent(e,r,n){if(e.example!==void 0)return e.example;if(e.examples){let i=Object.values(e.examples)[0];if(i?.value!==void 0)return i.value}if(e.schema)return this.exampleGenerator.generate(e.schema,{omitReadOnly:!0,components:n})}buildFormDataEntries(e,r){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[a,u]of Object.entries(i)){let f=u,h=f.type==="string"&&f.format==="binary",g={key:a,value:h?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:h?"file":"text",enabled:!0};n.push(g)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let a={contentType:r,schema:s.schema};if(i.length>1){a.content={};for(let f of i){let h=e.content[f],g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),h.encoding&&(g.encoding=h.encoding),a.content[f]=g}}s.encoding&&(a.encoding=s.encoding);let u=this.extractUsedComponents(s.schema,n);return Object.keys(u).length>0&&(a.components=u),a}processResponses(e,r){let n={responses:{}},i={};for(let[s,a]of Object.entries(e)){let u=a,f={description:u.description||`Status ${s}`};if(u.content){let h=Object.keys(u.content);if(h.length===1){let g=h[0],m=u.content[g];f.contentType=g,m.schema&&(f.schema=m.schema),m.examples&&(f.examples=m.examples),m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}else{f.content={};for(let g of h){let m=u.content[g],S={};m.schema&&(S.schema=m.schema),m.examples&&(S.examples=m.examples),f.content[g]=S,m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}}}if(u.headers){f.headers={};for(let[h,g]of Object.entries(u.headers)){let m=g;f.headers[h]={...m.description&&{description:m.description},schema:m.schema||{type:"string"}}}}n.responses[s]=f}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,r){let n=Object.keys(e)[0];if(!n)return;let i=r[n];if(i)switch(i.type){case"http":if(i.scheme==="bearer")return{type:"bearer",bearerToken:""};if(i.scheme==="basic")return{type:"basic",basicAuth:{username:"",password:""}};break;case"apiKey":return{type:"apikey",apikey:{key:i.name||"X-Api-Key",value:"",in:i.in||"header"}};case"oauth2":{let s=i.flows||{},a=s.authorizationCode||s.clientCredentials||s.password||s.implicit||{},u="client_credentials";return s.authorizationCode?u="authorization_code":s.password?u="password":s.implicit&&(u="implicit"),{type:"oauth2",oauth2:{grantType:u,tokenUrl:a.tokenUrl||"",authUrl:a.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(a.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,r){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return r}extractUsedComponents(e,r,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&r[s]&&!i[s]&&(i[s]=r[s],this.extractUsedComponents(r[s],r,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,r,i);e.items&&this.extractUsedComponents(e.items,r,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let a of e[s])this.extractUsedComponents(a,r,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,r,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}};var Ca=class{constructor(e,r,n){this.historyAnalyzer=e;this.scriptAnalyzer=r;this.inferrer=n}historyAnalyzer;scriptAnalyzer;inferrer;async infer(e,r,n,i){let s=await this.historyAnalyzer.analyze(e,r,{environment:i?.environment}),a;return i?.postResponseScript&&(a=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,a)}async inferBodySchema(e,r,n,i,s){let a,u;if(r==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}a=this.inferrer.inferFromValue(f),u="application/json"}else r==="form-data"&&i?(a=this.buildFormDataSchema(i),u="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(a=this.buildFormDataSchema(i),u="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(a={type:"string"},u="application/xml"):r==="raw"&&(n==="text"||n==="html")?(a={type:"string"},u=n==="html"?"text/html":"text/plain"):r==="binary"?(a={type:"string",format:"binary"},u="application/octet-stream"):r==="graphql"&&(a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},u="application/json");if(a)return s?this.mergeBodySchemaWithExisting(a,s):{contentType:u,schema:a}}buildFormDataSchema(e){let r={type:"object",properties:{}},n=[];for(let i of e){if(!i.enabled&&i.enabled!==void 0)continue;let s={};i.type?s.type=i.type:s.type="string",i.description&&(s.description=i.description),i.format&&(s.format=i.format),i.enum&&(s.enum=i.enum),i.type==="file"&&(s.type="string",s.format="binary"),r.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(r.required=n),r}mergeResponseSchemas(e,r,n){let i={responses:{}};for(let[s,a]of Object.entries(r.responses))i.responses[s]={...a};if(n&&this.applyScriptHints(i,n),e){for(let[s,a]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],a):i.responses[s]={...a};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,r){for(let n of r.expectedStatuses){let i=String(n);e.responses[i]||(e.responses[i]={description:`Status ${n}`})}for(let[,n]of Object.entries(e.responses))n.schema&&this.augmentSchemaWithHints(n.schema,r)}augmentSchemaWithHints(e,r){if(!(e.type!=="object"||!e.properties))for(let n of r.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,r)}}ensureFieldPath(e,r,n,i=""){if(r.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=r[0],a=s.endsWith("[]"),u=a?s.slice(0,-2):s,f=i?`${i}.${s}`:s,h=r.slice(1);if(!e.properties[u])if(a)e.properties[u]={type:"array",items:{type:"object"}};else if(h.length>0)e.properties[u]={type:"object",properties:{}};else{let g=n.typeHints[f];e.properties[u]={type:g||"string"};return}if(h.length>0){let g=a?e.properties[u].items:e.properties[u];g&&this.ensureFieldPath(g,h,n,f)}}mergeResponseDefinitions(e,r){let n={...e};return r.description&&(n.description=r.description),r.contentType&&(n.contentType=r.contentType),r.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,r.schema):r.schema&&(n.schema=r.schema),r.examples&&(n.examples={...e.examples||{},...r.examples}),r.content&&(n.content={...e.content||{},...r.content}),r.headers&&(n.headers={...e.headers||{},...r.headers}),n}mergeBodySchemaWithExisting(e,r){let n={...r};return r.schema?n.schema=this.inferrer.mergeSchemas(e,r.schema):n.schema=e,n}};var IA=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,OA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(?:a|an)\(['"](\w+)['"]\)/g,PA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.(?:equal|eql)\((.+?)\)/g,kA=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,AA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(true|false)/g,TA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.have\.(?:lengthOf|length\.above|length\.below)/g,Ra=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(IA.source,IA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&r.fieldPaths.push(s)}}extractTypeAssertions(e,r){let n,i=new RegExp(OA.source,OA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(a),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(PA.source,PA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].trim();if(s){let u=this.parseAssertionValue(a);u!==void 0&&(r.valueHints[s]=u,typeof u=="string"?r.typeHints[s]=r.typeHints[s]||"string":typeof u=="number"?r.typeHints[s]=r.typeHints[s]||(Number.isInteger(u)?"integer":"number"):typeof u=="boolean"&&(r.typeHints[s]=r.typeHints[s]||"boolean")),r.fieldPaths.includes(s)||r.fieldPaths.push(s)}}}extractBooleanAssertions(e,r){let n,i=new RegExp(AA.source,AA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]="boolean",r.valueHints[s]=n[2]==="true",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractLengthAssertions(e,r){let n,i=new RegExp(TA.source,TA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]=r.typeHints[s]||"array",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractStatusAssertions(e,r){let n,i=new RegExp(kA.source,kA.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&r.expectedStatuses.push(s)}}normalizeFieldPath(e){let r=e.replace(/^\./,"");return r=r.replace(/\[\d+\]/g,"[]"),r}isCommonMethodCall(e){return new Set(["to","be","have","not","deep","any","all","that","is","has","include","includes","equal","eql","above","below","least","most","within","length","lengthOf","match","string","keys","key","property","ownProperty","status","header","json","text"]).has(e.split(".")[0])}mapAssertionType(e){return{string:"string",number:"number",object:"object",array:"array",boolean:"boolean",null:"null",undefined:"null",int:"integer",integer:"integer",float:"number",double:"number"}[e]||"string"}parseAssertionValue(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let r=Number(e);return!isNaN(r)&&e.trim().length>0?r:e==="true"?!0:e==="false"?!1:e==="null"?null:e}};var ne={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter")};var X4={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}};function xw(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:a,secretStore:u,browserService:f,applicationInfo:h,consoleService:g}=e;t.registerValue(ne.WorkspaceFolder,r),t.registerSingleton(ne.Config,()=>new sa(r,n,i)),t.registerSingleton(ne.Console,()=>g??X4),t.registerSingleton(ne.EnvironmentConfig,S=>new iu(r,s,S.resolve(ne.Config),n)),t.registerSingleton(ne.Cookie,()=>new ru(a)),t.registerSingleton(ne.Collection,S=>new tu(r,S.resolve(ne.Config),n)),t.registerSingleton(ne.HttpClient,()=>new $s),t.registerSingleton(ne.UrlBuilder,()=>new hn),t.registerSingleton(ne.InterceptorChain,()=>new yi),t.registerSingleton(ne.HttpRequest,S=>new gi(S.resolve(ne.UrlBuilder),S.resolve(ne.InterceptorChain),S.resolve(ne.HttpClient))),t.registerSingleton(ne.RequestPreprocessor,()=>new Bs),t.registerSingleton(ne.RequestHistory,S=>{let E=S.resolve(ne.EnvironmentConfig);return new cu(E.getHistoriesPath(),qA.join(E.getRootPath(),"shared-histories"))}),u&&f&&t.registerSingleton(ne.OAuth2TokenManager,S=>new Zl(u,f,S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest))),t.registerSingleton(ne.GraphQLSchemaService,S=>new au(S.resolve(ne.HttpClient)));let m=h??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ne.RequestPreparer,S=>new ou(S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest),S.resolve(ne.RequestPreprocessor),S.resolve(ne.OAuth2TokenManager),m)),t.registerSingleton(ne.ScriptExecutor,S=>{let E=S.resolve(ne.Config);return new wi(S.resolve(ne.HttpRequest),E.getModulePaths())}),t.registerSingleton(ne.DataFileParser,()=>new Vs),t.registerSingleton(ne.CollectionRequestExecutor,S=>new su(S.resolve(ne.HttpRequest),S.resolve(ne.ScriptExecutor),S.resolve(ne.EnvironmentConfig),S.resolve(ne.RequestPreparer),"")),t.registerSingleton(ne.PersistentCookieJar,S=>new nu(S.resolve(ne.Cookie))),t.registerSingleton(ne.SchemaInferrer,()=>new Zi),t.registerSingleton(ne.HistoryAnalyzer,S=>new aa(S.resolve(ne.RequestHistory),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.ScriptAnalyzer,()=>new Ra),t.registerSingleton(ne.SchemaInferenceService,S=>new Ca(S.resolve(ne.HistoryAnalyzer),S.resolve(ne.ScriptAnalyzer),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.OpenApiExporter,S=>new pa(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig),S.resolve(ne.SchemaInferenceService))),t.registerSingleton(ne.OpenApiImporter,S=>new xa(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig)))}var Nu=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(ne.Config)}get console(){return this.resolve(ne.Console)}get environmentConfig(){return this.resolve(ne.EnvironmentConfig)}get collection(){return this.resolve(ne.Collection)}get httpRequest(){return this.resolve(ne.HttpRequest)}get httpClient(){return this.resolve(ne.HttpClient)}get cookie(){return this.resolve(ne.Cookie)}get requestHistory(){return this.resolve(ne.RequestHistory)}get dataFileParser(){return this.resolve(ne.DataFileParser)}get scriptExecutor(){return this.resolve(ne.ScriptExecutor)}get requestPreparer(){return this.resolve(ne.RequestPreparer)}get persistentCookieJar(){return this.resolve(ne.PersistentCookieJar)}get oauth2TokenManager(){return this.resolve(ne.OAuth2TokenManager)}get graphqlSchemaService(){return this.resolve(ne.GraphQLSchemaService)}};function Cw(){return Nu.instance}var tg=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())ut.isExpired(n)||(!n.domain||ut.domainMatches(e,n.domain))&&r.push(n);return r}has(e,r){return this.get(e,r)!==void 0}get(e,r){let n=this.getCookieKey(e,r),i=this.cookies.get(n);if(i&&!ut.isExpired(i))return i}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let r=[];for(let n of this.cookies.values())ut.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=ut.extractDomain(e),i=ut.parseCookieHeaders(r,n);for(let s of i){let a=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(a,s)}}getCookieHeader(e){let r=ut.extractDomain(e),n=ut.extractPath(e),s=this.getCookiesForDomain(r).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return ut.formatCookieHeader(s)}clear(){this.cookies.clear()}};function NA(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=a3(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(l3(a))return{contextType:"variable_def",fieldPath:[],prefix:s};let u=a.match(/\.\.\.\s+on\s+(\w*)$/);if(u)return{contextType:"fragment_type",fieldPath:[],prefix:u[1]||""};let f=a.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&$A(a)){let m=Rw(a,r),S=m.length>0?m[m.length-1]:void 0,E=MA(a);return{contextType:"argument_value",fieldPath:m,parentType:S,prefix:f[2]||"",currentArg:f[1],currentField:E||void 0}}if($A(a)){let m=Rw(a,r),S=m.length>0?m[m.length-1]:void 0,E=MA(a);return{contextType:"argument",fieldPath:m,parentType:S,prefix:s,currentField:E||void 0}}if(Iw(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let g=Rw(a,r);return{contextType:"selection_set",fieldPath:g,parentType:g.length>0?g[g.length-1]:void 0,prefix:s}}function DA(t,e){switch(e.contextType){case"root":return e3(t,e.prefix);case"selection_set":return t3(t,e);case"argument":return r3(t,e);case"argument_value":return n3(t,e);case"directive":return i3(t,e.prefix);case"fragment_type":return s3(t,e.prefix);case"variable_def":return o3(t,e.prefix);default:return[]}}function e3(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
|
|
270
270
|
$0
|
|
271
271
|
}`},{label:"mutation",detail:"Mutation operation",insertText:`mutation \${1:OperationName} {
|
|
272
272
|
$0
|
|
273
273
|
}`},{label:"subscription",detail:"Subscription operation",insertText:`subscription \${1:OperationName} {
|
|
274
274
|
$0
|
|
275
|
-
}`},{label:"fragment",detail:"Fragment definition",insertText:"fragment ${1:FragmentName} on ${2:TypeName} {\n $0\n}"}];for(let s of n)s.label==="mutation"&&!t.mutationType||s.label==="subscription"&&!t.subscriptionType||(!e||s.label.startsWith(e.toLowerCase()))&&r.push({label:s.label,kind:"keyword",detail:s.detail,insertText:s.insertText,sortOrder:0});let i=t.types.get(t.queryType);if(i)for(let s of i.fields)(!e||s.name.toLowerCase().startsWith(e.toLowerCase()))&&r.push(
|
|
275
|
+
}`},{label:"fragment",detail:"Fragment definition",insertText:"fragment ${1:FragmentName} on ${2:TypeName} {\n $0\n}"}];for(let s of n)s.label==="mutation"&&!t.mutationType||s.label==="subscription"&&!t.subscriptionType||(!e||s.label.startsWith(e.toLowerCase()))&&r.push({label:s.label,kind:"keyword",detail:s.detail,insertText:s.insertText,sortOrder:0});let i=t.types.get(t.queryType);if(i)for(let s of i.fields)(!e||s.name.toLowerCase().startsWith(e.toLowerCase()))&&r.push(FA(s,1,t));return r}function t3(t,e){let r=[],n=e.parentType;if(!n)return r;let i=t.types.get(n);if(!i)return r;if(i.kind==="OBJECT"||i.kind==="INTERFACE"){for(let s of i.fields)(!e.prefix||s.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push(FA(s,0,t));(!e.prefix||"__typename".startsWith(e.prefix.toLowerCase()))&&r.push({label:"__typename",kind:"field",detail:"String!",description:"The name of the current object type",sortOrder:10})}if(i.kind==="UNION"||i.kind==="INTERFACE")for(let s of i.possibleTypes){let a=s.replace(/[!\[\]]/g,"");(!e.prefix||a.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push({label:`... on ${a}`,kind:"snippet",detail:`Inline fragment on ${a}`,insertText:`... on ${a} {
|
|
276
276
|
$0
|
|
277
|
-
}`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&r.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),r}function
|
|
277
|
+
}`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&r.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),r}function r3(t,e){if(!e.currentField||!e.parentType)return[];let r=t.types.get(e.parentType);if(!r)return[];let n=r.fields.find(s=>s.name===e.currentField);if(!n)return[];let i=[];for(let s of n.args)(!e.prefix||s.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&i.push({label:s.name,kind:"argument",detail:s.type,description:s.description,insertText:`${s.name}: `,sortOrder:0});return i}function n3(t,e){if(!e.currentArg||!e.currentField||!e.parentType)return[];let r=[],n=t.types.get(e.parentType);if(!n)return r;let i=n.fields.find(f=>f.name===e.currentField);if(!i)return r;let s=i.args.find(f=>f.name===e.currentArg);if(!s)return r;let a=s.type.replace(/[!\[\]]/g,""),u=t.types.get(a);if(u&&u.kind==="ENUM")for(let f of u.enumValues)(!e.prefix||f.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push({label:f.name,kind:"enum",detail:u.name,description:f.description,deprecated:f.isDeprecated,sortOrder:0});else if(a==="Boolean")for(let f of["true","false"])(!e.prefix||f.startsWith(e.prefix.toLowerCase()))&&r.push({label:f,kind:"keyword",detail:"Boolean",sortOrder:0});return r}function i3(t,e){let r=[];for(let n of t.directives)if(!e||n.name.toLowerCase().startsWith(e.toLowerCase())){let i=n.args.length>0?`(${n.args.map(s=>`${s.name}: ${s.type}`).join(", ")})`:"";r.push({label:`@${n.name}`,kind:"directive",detail:i||void 0,description:n.description,insertText:n.args.length>0?`@${n.name}($1)`:`@${n.name}`,sortOrder:0})}return r}function s3(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="OBJECT"||i.kind==="INTERFACE"||i.kind==="UNION")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function o3(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="SCALAR"||i.kind==="INPUT_OBJECT"||i.kind==="ENUM")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function FA(t,e,r){let n=t.type.replace(/[!\[\]]/g,""),i=!1;if(r){let a=r.types.get(n);i=!!a&&(a.kind==="OBJECT"||a.kind==="INTERFACE"||a.kind==="UNION")}else i=!new Set(["String","Int","Float","Boolean","ID"]).has(n);let s=t.name;if(t.args.length>0){let a=t.args.filter(u=>u.type.endsWith("!"));if(a.length>0){let u=a.map((f,h)=>`${f.name}: \${${h+1}}`).join(", ");s=`${t.name}(${u})`}}return i&&(s+=` {
|
|
278
278
|
$0
|
|
279
|
-
}`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function
|
|
279
|
+
}`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function a3(t){return t.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function Iw(t,e,r){let n=0;for(let i of t)i===e?n++:i===r&&n--;return n}function $A(t){return Iw(t,"(",")")>0}function l3(t){if(Iw(t,"(",")")<=0)return!1;let r=t.indexOf("{"),n=r>=0?t.slice(0,r):t;return/\$\w+\s*:\s*\w*$/.test(n)}function MA(t){let e=0;for(let r=t.length-1;r>=0;r--)if(t[r]===")")e++;else if(t[r]==="("){if(e===0){let i=t.slice(0,r).trimEnd().match(/(\w+)$/);return i?i[1]:null}e--}return null}function Rw(t,e){if(!e)return[];let r=[],n=e.queryType,i=t.match(/\b(query|mutation|subscription)\b/);i&&(i[1]==="mutation"&&e.mutationType?n=e.mutationType:i[1]==="subscription"&&e.subscriptionType&&(n=e.subscriptionType)),r.push(n);let s=u3(t),a=e.types.get(n);for(let u=0;u<s.length;u++){let f=s[u];if(f!=="{"){if(f==="}"){r.pop(),a=r.length>0?e.types.get(r[r.length-1]):void 0;continue}if(u+1<s.length&&(s[u+1]==="{"||s[u+1]==="(")){let h=u+1;if(s[h]==="("){let g=1;for(h++;h<s.length&&g>0;)s[h]==="("?g++:s[h]===")"&&g--,h++}if(h<s.length&&s[h]==="{"&&a){let g=a.fields.find(m=>m.name===f);if(g){let m=g.type.replace(/[!\[\]]/g,"");r.push(m),a=e.types.get(m)}}}}}return r}function u3(t){let e=[],r=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=r.exec(t))!==null;)e.push(n[1]);return e}var ju=Se(require("fs/promises")),Lu=Se(require("path"));var rg={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Du={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"};function Ow(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function LA(t){return{index:t.i,iteration:t.it,name:t.n,method:Du[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:Ow(t.i,t.it,t.r),error:t.e}}function Zr(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Fu(t){return t>=1e3?`${(t/1e3).toFixed(2)}s`:`${t}ms`}function Pw(t){try{return new Date(t).toLocaleString()}catch{return t}}function jA(t){return t>=200&&t<300?"status-2xx":t>=300&&t<400?"status-3xx":t>=400&&t<500?"status-4xx":"status-5xx"}function UA(t,e){return e===0?"\u2014":`${Math.round(t/e*100)}%`}function BA(t){try{return typeof t=="string"&&(t=JSON.parse(t)),JSON.stringify(t,null,2)}catch{return String(t??"")}}var Uu=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=Lu.join(this.basePath,e,r),i=JSON.parse(await ju.readFile(Lu.join(n,"manifest.json"),"utf-8")),s=await this.loadAllSummaries(n,i.totalIndexPages),a=await this.loadFailedDetails(n,s),u=this.buildHtml(i,s,a),f=Lu.join(n,"report.html");return await ju.writeFile(f,u,"utf-8"),f}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=Lu.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let a=JSON.parse(await ju.readFile(s,"utf-8"));n.push(...a.summaries)}catch{}}return n}async loadFailedDetails(e,r){let n=new Map,i=r.filter(s=>!s.p);for(let s of i){let a=String(s.i).padStart(6,"0"),u=String(s.it).padStart(4,"0"),f=`result-${a}-iter-${u}-${s.r}.json`,h=`${s.i}-${s.it}`;try{let g=JSON.parse(await ju.readFile(Lu.join(e,"results",f),"utf-8"));n.set(h,g)}catch{}}return n}buildHtml(e,r,n){let i=UA(e.stats.passed,e.stats.totalRequests),s=Fu(e.stats.totalDuration),a=e.stats.failed===0,u=Object.entries(e.requestStats).map(([,m])=>{let S=UA(m.passed,m.count);return`
|
|
280
280
|
<tr${m.failed>0?' class="row-fail"':""}>
|
|
281
|
-
<td>${
|
|
281
|
+
<td>${Zr(m.name)}</td>
|
|
282
282
|
<td>${m.count}</td>
|
|
283
283
|
<td class="pass">${m.passed}</td>
|
|
284
284
|
<td class="${m.failed>0?"fail":""}">${m.failed}</td>
|
|
285
|
-
<td>${
|
|
286
|
-
<td>${m.p90!==void 0?
|
|
287
|
-
<td>${m.p99!==void 0?
|
|
285
|
+
<td>${Fu(m.avgDuration)}</td>
|
|
286
|
+
<td>${m.p90!==void 0?Fu(m.p90):"\u2014"}</td>
|
|
287
|
+
<td>${m.p99!==void 0?Fu(m.p99):"\u2014"}</td>
|
|
288
288
|
<td class="${m.failed>0?"fail":"pass"}">${S}</td>
|
|
289
|
-
</tr>`}).join(""),f=Math.max(...r.map(m=>m.d),1),h=r.map(m=>{let S=
|
|
289
|
+
</tr>`}).join(""),f=Math.max(...r.map(m=>m.d),1),h=r.map(m=>{let S=Du[m.m]??"GET",E=Math.max(2,Math.round(m.d/f*100)),x=m.p?"bar-pass":"bar-fail";return`
|
|
290
290
|
<tr${m.p?"":' class="row-fail"'}>
|
|
291
291
|
<td>${m.it}</td>
|
|
292
292
|
<td><span class="method method-${S.toLowerCase()}">${S}</span></td>
|
|
293
|
-
<td>${
|
|
294
|
-
<td class="${
|
|
295
|
-
<td>${
|
|
296
|
-
<td><div class="bar-wrap"><div class="${
|
|
293
|
+
<td>${Zr(m.n)}</td>
|
|
294
|
+
<td class="${jA(m.s)}">${m.s}</td>
|
|
295
|
+
<td>${Fu(m.d)}</td>
|
|
296
|
+
<td><div class="bar-wrap"><div class="${x}" style="width:${E}%"></div></div></td>
|
|
297
297
|
<td class="${m.p?"pass":"fail"}">${m.p?"\u2713":"\u2717"}</td>
|
|
298
|
-
</tr>`}).join(""),g=r.filter(m=>!m.p).map(m=>{let S=`${m.i}-${m.it}`,
|
|
298
|
+
</tr>`}).join(""),g=r.filter(m=>!m.p).map(m=>{let S=`${m.i}-${m.it}`,E=n.get(S),x=Du[m.m]??"GET",C=E?.assertions?.map(Y=>`
|
|
299
299
|
<li class="${Y.passed?"pass":"fail"}">
|
|
300
|
-
${Y.passed?"\u2713":"\u2717"} ${
|
|
301
|
-
${Y.message?`<span class="assert-msg">\u2014 ${
|
|
302
|
-
</li>`).join("")??"",A=
|
|
300
|
+
${Y.passed?"\u2713":"\u2717"} ${Zr(Y.name)}
|
|
301
|
+
${Y.message?`<span class="assert-msg">\u2014 ${Zr(Y.message)}</span>`:""}
|
|
302
|
+
</li>`).join("")??"",A=E?.request?.body!==void 0?`<pre class="code">${Zr(BA(E.request.body))}</pre>`:"",T=E?.response?.body!==void 0?`<pre class="code">${Zr(BA(E.response.body))}</pre>`:"",B=E?.error?`<div class="error-box">${Zr(E.error)}</div>`:"";return`
|
|
303
303
|
<details class="fail-detail">
|
|
304
304
|
<summary>
|
|
305
|
-
<span class="method method-${
|
|
306
|
-
<strong>${
|
|
307
|
-
<span class="${
|
|
308
|
-
<span class="dim">iter ${m.it} \xB7 ${
|
|
305
|
+
<span class="method method-${x.toLowerCase()}">${x}</span>
|
|
306
|
+
<strong>${Zr(m.n)}</strong>
|
|
307
|
+
<span class="${jA(m.s)}">${m.s}</span>
|
|
308
|
+
<span class="dim">iter ${m.it} \xB7 ${Fu(m.d)}</span>
|
|
309
309
|
</summary>
|
|
310
310
|
<div class="detail-body">
|
|
311
|
-
${
|
|
312
|
-
${
|
|
313
|
-
${
|
|
311
|
+
${B}
|
|
312
|
+
${E?`<p class="detail-url">${Zr(E.url)}</p>`:""}
|
|
313
|
+
${C?`<ul class="assert-list">${C}</ul>`:""}
|
|
314
314
|
${A?`<h4>Request Body</h4>${A}`:""}
|
|
315
315
|
${T?`<h4>Response Body</h4>${T}`:""}
|
|
316
316
|
</div>
|
|
@@ -319,7 +319,7 @@ Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=
|
|
|
319
319
|
<head>
|
|
320
320
|
<meta charset="UTF-8">
|
|
321
321
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
322
|
-
<title>HTTP Forge \u2014 ${
|
|
322
|
+
<title>HTTP Forge \u2014 ${Zr(e.suiteName)}</title>
|
|
323
323
|
<style>
|
|
324
324
|
*{box-sizing:border-box;margin:0;padding:0}
|
|
325
325
|
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
|
|
@@ -405,12 +405,12 @@ Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=
|
|
|
405
405
|
<div class="header">
|
|
406
406
|
<div class="header-top">
|
|
407
407
|
<div>
|
|
408
|
-
<div class="suite-name">${
|
|
408
|
+
<div class="suite-name">${Zr(e.suiteName)}</div>
|
|
409
409
|
<div class="meta">
|
|
410
|
-
Environment: <strong>${
|
|
411
|
-
Run ID: <code>${
|
|
412
|
-
${
|
|
413
|
-
${e.endTime?` \u2192 ${
|
|
410
|
+
Environment: <strong>${Zr(e.environment)}</strong> \xB7
|
|
411
|
+
Run ID: <code>${Zr(e.runId)}</code> \xB7
|
|
412
|
+
${Pw(e.startTime)}
|
|
413
|
+
${e.endTime?` \u2192 ${Pw(e.endTime)}`:""}
|
|
414
414
|
\xB7 Iterations: ${e.config.iterations}
|
|
415
415
|
</div>
|
|
416
416
|
</div>
|
|
@@ -492,7 +492,7 @@ Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=
|
|
|
492
492
|
</div>`:""}
|
|
493
493
|
|
|
494
494
|
<p class="dim" style="margin-top:16px;text-align:center">
|
|
495
|
-
Generated by HTTP Forge \xB7 ${
|
|
495
|
+
Generated by HTTP Forge \xB7 ${Pw(new Date().toISOString())}
|
|
496
496
|
</p>
|
|
497
497
|
</div>
|
|
498
498
|
<script>
|
|
@@ -505,4 +505,4 @@ Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=
|
|
|
505
505
|
}
|
|
506
506
|
</script>
|
|
507
507
|
</body>
|
|
508
|
-
</html>`}};var Kf={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1};var Lt=ve(require("fs/promises")),Lr=ve(require("path"));function ig(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,Math.min(r,t.length-1))]}var sg=class{constructor(e){this.configService=e;let r=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=r.indexPageSize,this.recentErrorsLimit=r.recentErrorsLimit}basePath;currentRunPath=null;currentRunId=null;currentSuiteId=null;currentManifest=null;currentIndexPage=[];currentPageNumber=1;indexPageSize;recentErrors=[];recentErrorsLimit;resultIndex=0;requestDurations={};getBasePath(){return this.basePath}async initializeRun(e,r,n,i){let s=this.generateRunId();return this.currentRunId=s,this.currentSuiteId=e,this.currentRunPath=Lr.join(this.basePath,e,s),await Lt.mkdir(Lr.join(this.currentRunPath,"results"),{recursive:!0}),await Lt.mkdir(Lr.join(this.currentRunPath,"index"),{recursive:!0}),this.currentManifest={version:"1.0",runId:s,suiteId:e,suiteName:r,environment:n,startTime:new Date().toISOString(),status:"running",config:i,stats:{totalRequests:0,passed:0,failed:0,skipped:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0},requestStats:{},totalIndexPages:0,indexPageSize:this.indexPageSize},this.currentIndexPage=[],this.currentPageNumber=1,this.recentErrors=[],this.resultIndex=0,this.requestDurations={},await this.saveManifest(),s}async saveResult(e,r){if(!this.currentRunPath||!this.currentManifest)throw new Error("No active run. Call initializeRun first.");this.resultIndex++;let n=Date.now(),i=String(e).padStart(4,"0"),s=String(this.resultIndex).padStart(6,"0"),a=_t(r.requestId),u=`result-${s}-iter-${i}-${a}.json`,f=Lr.join(this.currentRunPath,"results",u),h={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,status:r.response.status,statusText:r.response.statusText||"",duration:r.duration,passed:r.passed,timestamp:n,request:{headers:r.executedRequest.headers,body:r.executedRequest.body.content},response:{headers:r.response.headers,body:r.response.body},assertions:r.assertions.map(_=>({name:_.name,passed:_.passed,message:_.message||null})),error:r.error||null};await Lt.writeFile(f,JSON.stringify(kp(h),null,2),"utf-8");let g=r.assertions.filter(_=>_.passed).length,m=r.assertions.filter(_=>!_.passed).length,S={i:this.resultIndex,it:e,n:r.name,m:ng[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:g,af:m,r:r.requestId,e:r.passed?null:r.error||null};return this.currentIndexPage.push(S),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:u}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),S}async finalizeRun(e="completed"){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let a in this.currentManifest.requestStats){let u=this.currentManifest.requestStats[a],f=this.requestDurations[a]||[];u.count>0&&(u.avgDuration=Math.round(u.totalDuration/u.count)),u.minDuration===Number.MAX_SAFE_INTEGER&&(u.minDuration=0),f.length>0&&(f.sort((h,g)=>h-g),u.p50=ig(f,50),u.p90=ig(f,90),u.p95=ig(f,95),u.p99=ig(f,99))}this.requestDurations={},await this.saveManifest();let r=null,n=this.currentRunPath,i=this.currentSuiteId,s=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,i&&s&&n)try{r=await new qu(this.basePath).generate(i,s)}catch(a){console.warn("[ResultStorage] HTML report generation failed:",a)}return r}getCurrentStats(){return this.currentManifest?{stats:{...this.currentManifest.stats},requestStats:{...this.currentManifest.requestStats},recentErrors:[...this.recentErrors]}:null}getCurrentRunId(){return this.currentRunId}getCurrentSuiteId(){return this.currentSuiteId}async getResultDetails(e,r,n){let i=Lr.join(this.basePath,e,r,"results",n),s=await Lt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Lr.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await Lt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Lr.join(this.basePath,e,r,"manifest.json"),i=await Lt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Lr.join(this.basePath,e);try{let n=await Lt.readdir(r),i=[];for(let s of n.sort().reverse())try{let a=await this.getManifest(e,s);i.push(a)}catch{}return i}catch{return[]}}async listSuites(){try{return(await Lt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Lr.join(this.basePath,e,r);await Lt.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let r=this.configService.getRunnerConfig().resultsRetentionDays;if(r===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-r);let i=0,s=0,a=await this.listSuites();for(let u of a){let f=await this.listRuns(u);for(let h of f)if(new Date(h.startTime)<n){let g=Lr.join(this.basePath,u,h.runId),m=await this.getDirectorySize(g);await Lt.rm(g,{recursive:!0,force:!0}),i++,s+=m}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,r=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${r}-${n}-${i}`}async saveManifest(){if(!this.currentRunPath||!this.currentManifest)return;let e=Lr.join(this.currentRunPath,"manifest.json");await Lt.writeFile(e,JSON.stringify(this.currentManifest,null,2),"utf-8")}async writeCurrentIndexPage(){if(!this.currentRunPath||this.currentIndexPage.length===0)return;let e=`page-${String(this.currentPageNumber).padStart(4,"0")}.json`,r=Lr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await Lt.writeFile(r,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let r=this.currentManifest.stats,n=this.currentManifest.requestStats;r.totalRequests++,r.totalDuration+=e.duration,r.minDuration=Math.min(r.minDuration,e.duration),r.maxDuration=Math.max(r.maxDuration,e.duration),e.passed?r.passed++:r.failed++,n[e.requestId]||(n[e.requestId]={name:e.name,count:0,passed:0,failed:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0});let i=n[e.requestId];i.count++,i.totalDuration+=e.duration,i.minDuration=Math.min(i.minDuration,e.duration),i.maxDuration=Math.max(i.maxDuration,e.duration),e.passed?i.passed++:i.failed++}async getDirectorySize(e){let r=0;try{let n=await Lt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Lr.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let a=await Lt.stat(s);r+=a.size}}}catch{}return r}};function og(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function Aw(t){return{name:t,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function MA(t){if(t.durations.length===0){t.min=0,t.max=0,t.avg=0,t.p50=0,t.p90=0,t.p95=0,t.p99=0;return}let e=[...t.durations].sort((n,i)=>n-i),r=t.durations.reduce((n,i)=>n+i,0);t.min=e[0],t.max=e[e.length-1],t.avg=Math.round(r/t.durations.length),t.p50=og(e,50),t.p90=og(e,90),t.p95=og(e,95),t.p99=og(e,99)}var ag=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=Aw("Overall"),this.errors=new Map}createEmptySummary(){return{totalRequests:0,passed:0,failed:0,skipped:0,passRate:0,duration:0,isRunning:!1}}start(){this.startTime=Date.now(),this.summary.isRunning=!0}reset(){this.summary=this.createEmptySummary(),this.byRequest.clear(),this.overall=Aw("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,r,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let a=this.summary.passed+this.summary.failed;if(this.summary.passRate=a>0?Math.round(this.summary.passed/a*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,Aw(e));let u=this.byRequest.get(e);if(u.count++,n?u.passed++:u.failed++,u.durations.push(r),MA(u),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),MA(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((r,n)=>{e.push({message:n,count:r})}),e.sort((r,n)=>n.count-r.count),{summary:{...this.summary},byRequest:new Map(this.byRequest),overall:{...this.overall},errors:e}}getSerializableStatistics(){let e=this.getStatistics();return{summary:e.summary,byRequest:Array.from(e.byRequest.values()),overall:e.overall,errors:e.errors}}};var Pt=ve(require("fs")),So=ve(require("path"));var lg=class{constructor(e,r,n){this.collectionService=e;this.configService=r;this.suitesDir=r.getSuitesPath(),this.onSuitesChanged=n?.onSuitesChanged,this.ensureSuitesDir(),this.loadSuites(),n?.watch!==!1&&this.setupFileWatcher()}suitesDir;suites=new Map;fileWatcher=null;debounceTimer=null;onSuitesChanged;ensureSuitesDir(){Pt.existsSync(this.suitesDir)||Pt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Pt.watch(this.suitesDir,(e,r)=>{r&&!r.endsWith(".suite.json")||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.loadSuites(),this.onSuitesChanged?.()},200))}),this.fileWatcher.on("error",()=>{})}catch{}}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.close(),this.fileWatcher=null}loadSuites(){if(this.suites.clear(),!Pt.existsSync(this.suitesDir))return;let e=Pt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=So.join(this.suitesDir,r),i=Pt.readFileSync(n,"utf-8"),s=JSON.parse(i);s.id&&s.name&&this.suites.set(s.id,s)}catch(n){console.error(`[TestSuiteService] Failed to load ${r}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e,r=[]){let n=Date.now(),i={id:rt(e),name:e,requests:r,config:{...Kf},createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}async updateSuite(e){e.updatedAt=Date.now(),await this.saveSuiteToDisk(e),this.suites.set(e.id,e)}async duplicateSuite(e,r){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=await this.createSuite(r,n.requests.map(u=>({...u})));i.config={...n.config},i.description=n.description;let s=So.join(this.suitesDir,e),a=So.join(this.suitesDir,i.id);return Pt.existsSync(s)&&this.copyDirRecursive(s,a),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Pt.existsSync(r)||Pt.mkdirSync(r,{recursive:!0});for(let n of Pt.readdirSync(e,{withFileTypes:!0})){let i=So.join(e,n.name),s=So.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Pt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=So.join(this.suitesDir,n);try{return Pt.existsSync(i)&&Pt.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!1}}async createTempSuiteFromCollection(e){let r=this.collectionService.getCollection(e);if(!r){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(r,e,r.name,"",n);let i=Date.now();return{id:`temp-${rt(r.name)}`,name:r.name,requests:n,config:{...Kf},isTemporary:!0,createdAt:i,updatedAt:i}}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:rt(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}getAllAvailableRequests(){let e=[],r=this.collectionService.getAllCollections();for(let n of r)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,r,n,i,s){if(e.requests)for(let a of e.requests)s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.items)for(let a of e.items)if(a.items||a.folders||a.requests){let u=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,u,s)}else s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.folders)for(let a of e.folders){let u=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,u,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=So.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Pt.writeFileSync(n,i,"utf-8")}};var us=ve(require("fs")),Ia=ve(require("path"));var ug=class{constructor(e){this.collectionService=e}suite;suiteDir;setSuite(e){this.suite=e}setSuiteDir(e){this.suiteDir=e}getSuite(){return this.suite}loadSuiteRequest(e){if(!this.suiteDir)return;let r=Ia.join(this.suiteDir,e,"request.json");if(us.existsSync(r))try{let n=JSON.parse(us.readFileSync(r,"utf-8")),i=Ia.join(this.suiteDir,e,"scripts"),s=pc(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,r){if(!this.suiteDir)return;let n=Ia.join(this.suiteDir,e);us.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,us.writeFileSync(Ia.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=Ia.join(n,"scripts");mc(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:us.existsSync(Ia.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let r=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(r){let s,a=[];if(n){s=n.scripts;let u=this.findRequestInCollection(n,e.requestId);u&&(a=u.folderScriptsChain)}return{request:r,suiteRequest:e,collectionScripts:s,folderScriptsChain:a}}if(!n){console.warn(`[TestSuiteStore] Collection not found: ${e.collectionId}`);return}let i=this.findRequestInCollection(n,e.requestId);if(!i){console.warn(`[TestSuiteStore] Request not found: ${e.requestId}`);return}return{request:i.request,suiteRequest:e,collectionScripts:n.scripts,folderScriptsChain:i.folderScriptsChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n){for(let i of e)if(i.type==="folder"){let s=i;if(!s.items)continue;let a=s.scripts?[...n,s.scripts]:n,u=this.searchItems(s.items||[],r,a);if(u)return u}else if(i.id===r)return{request:this.normalizeRequest(i),folderScriptsChain:n}}normalizeRequest(e){let{type:r,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(r=>({key:r.key||"",value:r.value||"",enabled:r.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([r,n])=>({key:r,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,r){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===r);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let r=this.suite.requests.find(n=>n.slug===e);if(r)return this.resolveRequest(r)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){let n=this.resolveRequest(r);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){if(!r.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);r.slug=gi(r.name||"request",i)}let n=this.resolveRequest(r);if(n){let i=this.collectionService.getCollection(r.collectionId);e.push({id:`${r.collectionId}:${r.requestId}`,collectionId:r.collectionId,requestId:r.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:r.folderPath||"",enabled:r.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(r.slug),slug:r.slug})}}return e}getSelectedRequests(e){let r=[];for(let n of e){let[i,s]=n.split(":"),a=this.suite?.requests.find(u=>u.collectionId===i&&u.requestId===s);if(a){let u=this.resolveRequest(a);u&&r.push(u)}}return r}addRequest(e,r){if(this.suite){if(this.suiteDir&&r){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=gi(e.name||r.name||"request",n)}this.saveSuiteRequest(e.slug,r)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let r=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!r.has(e))return e;let n=2;for(;r.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(r=>r.requestId!==e))}reorderRequests(e){if(!this.suite)return;let r=new Map;for(let i of this.suite.requests)r.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=r.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,r){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,r);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=r.name||n.name,n.method=r.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let r=this.suite.requests.find(s=>s.slug===e);if(!r)return;let n=this.collectionService.getCollection(r.collectionId);if(!n)return;let i=this.findRequestInCollection(n,r.requestId);if(i)return this.saveSuiteRequest(e,i.request),r.name=i.request.name||r.name,r.method=i.request.method||r.method,i.request}};0&&(module.exports={BODY_FILE_MAP,CONFIG_FILES,CollectionLoader,CollectionLoaderFactory,CollectionRequestExecutor,CollectionService,ConfigService,CookieJar,CookieService,CookieUtils,DEFAULT_CONFIG,DEFAULT_REQUEST_SETTINGS,DEFAULT_SUITE_CONFIG,DYNAMIC_VARIABLES,DataFileParser,EnvironmentConfigService,EnvironmentResolver,ExampleGenerator,FetchHttpClient,FolderCollectionLoader,FolderCollectionStore,ForgeContainer,ForgeEnv,GraphQLSchemaService,HTTP_METHOD_MAP,HTTP_METHOD_REVERSE,HistoryAnalyzer,HtmlReportGenerator,HttpForgeParser,HttpRequestService,InMemoryCookieJar,InterceptorChain,JsonCollectionLoader,LoggingRequestInterceptor,METADATA_FILES,ModuleLoader,NodeFileSystem,NodeHttpClient,OAuth2TokenManager,OpenApiExporter,OpenApiImporter,ParserRegistry,PersistentCookieJar,ROOT_DIRECTORIES,RefResolver,RequestExecutor,RequestHistoryService,RequestHistoryStore,RequestPreparer,RequestPreprocessor,RequestScriptSession,ResultStorageService,RetryErrorInterceptor,SCHEMA_FILES,SCRIPTS_DIR,SCRIPT_FILES,SchemaInferenceService,SchemaInferrer,ScriptAnalyzer,ScriptExecutor,ServiceContainer,ServiceIdentifiers,StatisticsService,TestSuiteService,TestSuiteStore,TimingResponseInterceptor,UrlBuilder,VariableInterpolator,VariableResolver,applyExtractionPlan,applyFilterChain,augmentWithDynamicVars,buildExtractionPlan,buildResultFileName,cleanupOldBodyFiles,concatenateScripts,createExpectChain,createLodashShim,createModuleLoader,createMomentShim,createResponseObject,createScriptConsole,createTestFunction,createVariableResolver,deepClone,deleteItemFromTree,detectSensitiveData,evaluateExpression,expandSummary,exportCollectionToRestClient,findItemById,formatBytes,formatConsoleOutput,formatDuration,generateId,generateSlug,generateUUID,getCompletions,getRestClientExportFolder,getServiceContainer,hasChanged,isExpression,isPlainObject,isSystemEnvironmentFile,loadEnvironmentsFromFolder,mergeHeadersCaseInsensitive,mergeRequestSettings,normalizeHeaders,parseFilterChain,parsePostmanEnvironment,parsePostmanEnvironmentFile,parseQueryContext,prepareBodyForSave,readBodyFromDir,readSchemaFile,readScriptsFromDir,redactBody,redactFullResponse,redactFullResultDetails,redactHeaders,redactHistoryEntry,redactUrl,registerCoreServices,resolveDynamicVariable,resolveDynamicVariablesInString,safeJsonParse,sanitizeName,searchForItemPath,sortItemsByOrder,writeEnvFile,writeFolderItems,writeSchemaFiles,writeScriptFile,writeScriptsToDir});
|
|
508
|
+
</html>`}};var od={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1};var Dt=Se(require("fs/promises")),Ur=Se(require("path"));function ng(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,Math.min(r,t.length-1))]}var ig=class{constructor(e){this.configService=e;let r=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=r.indexPageSize,this.recentErrorsLimit=r.recentErrorsLimit}configService;basePath;currentRunPath=null;currentRunId=null;currentSuiteId=null;currentManifest=null;currentIndexPage=[];currentPageNumber=1;indexPageSize;recentErrors=[];recentErrorsLimit;resultIndex=0;requestDurations={};getBasePath(){return this.basePath}async initializeRun(e,r,n,i){let s=this.generateRunId();return this.currentRunId=s,this.currentSuiteId=e,this.currentRunPath=Ur.join(this.basePath,e,s),await Dt.mkdir(Ur.join(this.currentRunPath,"results"),{recursive:!0}),await Dt.mkdir(Ur.join(this.currentRunPath,"index"),{recursive:!0}),this.currentManifest={version:"1.0",runId:s,suiteId:e,suiteName:r,environment:n,startTime:new Date().toISOString(),status:"running",config:i,stats:{totalRequests:0,passed:0,failed:0,skipped:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0},requestStats:{},totalIndexPages:0,indexPageSize:this.indexPageSize},this.currentIndexPage=[],this.currentPageNumber=1,this.recentErrors=[],this.resultIndex=0,this.requestDurations={},await this.saveManifest(),s}async saveResult(e,r){if(!this.currentRunPath||!this.currentManifest)throw new Error("No active run. Call initializeRun first.");this.resultIndex++;let n=Date.now(),i=String(e).padStart(4,"0"),s=String(this.resultIndex).padStart(6,"0"),a=_t(r.requestId),u=`result-${s}-iter-${i}-${a}.json`,f=Ur.join(this.currentRunPath,"results",u),h={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,status:r.response.status,statusText:r.response.statusText||"",duration:r.duration,passed:r.passed,timestamp:n,request:{headers:r.executedRequest.headers,body:r.executedRequest.body.content},response:{headers:r.response.headers,body:r.response.body},assertions:r.assertions.map(E=>({name:E.name,passed:E.passed,message:E.message||null})),error:r.error||null};await Dt.writeFile(f,JSON.stringify(Ip(h),null,2),"utf-8");let g=r.assertions.filter(E=>E.passed).length,m=r.assertions.filter(E=>!E.passed).length,S={i:this.resultIndex,it:e,n:r.name,m:rg[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:g,af:m,r:r.requestId,e:r.passed?null:r.error||null};return this.currentIndexPage.push(S),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:u}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),S}async finalizeRun(e="completed"){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let a in this.currentManifest.requestStats){let u=this.currentManifest.requestStats[a],f=this.requestDurations[a]||[];u.count>0&&(u.avgDuration=Math.round(u.totalDuration/u.count)),u.minDuration===Number.MAX_SAFE_INTEGER&&(u.minDuration=0),f.length>0&&(f.sort((h,g)=>h-g),u.p50=ng(f,50),u.p90=ng(f,90),u.p95=ng(f,95),u.p99=ng(f,99))}this.requestDurations={},await this.saveManifest();let r=null,n=this.currentRunPath,i=this.currentSuiteId,s=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,i&&s&&n)try{r=await new Uu(this.basePath).generate(i,s)}catch(a){console.warn("[ResultStorage] HTML report generation failed:",a)}return r}getCurrentStats(){return this.currentManifest?{stats:{...this.currentManifest.stats},requestStats:{...this.currentManifest.requestStats},recentErrors:[...this.recentErrors]}:null}getCurrentRunId(){return this.currentRunId}getCurrentSuiteId(){return this.currentSuiteId}async getResultDetails(e,r,n){let i=Ur.join(this.basePath,e,r,"results",n),s=await Dt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Ur.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await Dt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Ur.join(this.basePath,e,r,"manifest.json"),i=await Dt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Ur.join(this.basePath,e);try{let n=await Dt.readdir(r),i=[];for(let s of n.sort().reverse())try{let a=await this.getManifest(e,s);i.push(a)}catch{}return i}catch{return[]}}async listSuites(){try{return(await Dt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Ur.join(this.basePath,e,r);await Dt.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let r=this.configService.getRunnerConfig().resultsRetentionDays;if(r===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-r);let i=0,s=0,a=await this.listSuites();for(let u of a){let f=await this.listRuns(u);for(let h of f)if(new Date(h.startTime)<n){let g=Ur.join(this.basePath,u,h.runId),m=await this.getDirectorySize(g);await Dt.rm(g,{recursive:!0,force:!0}),i++,s+=m}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,r=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${r}-${n}-${i}`}async saveManifest(){if(!this.currentRunPath||!this.currentManifest)return;let e=Ur.join(this.currentRunPath,"manifest.json");await Dt.writeFile(e,JSON.stringify(this.currentManifest,null,2),"utf-8")}async writeCurrentIndexPage(){if(!this.currentRunPath||this.currentIndexPage.length===0)return;let e=`page-${String(this.currentPageNumber).padStart(4,"0")}.json`,r=Ur.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await Dt.writeFile(r,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let r=this.currentManifest.stats,n=this.currentManifest.requestStats;r.totalRequests++,r.totalDuration+=e.duration,r.minDuration=Math.min(r.minDuration,e.duration),r.maxDuration=Math.max(r.maxDuration,e.duration),e.passed?r.passed++:r.failed++,n[e.requestId]||(n[e.requestId]={name:e.name,count:0,passed:0,failed:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0});let i=n[e.requestId];i.count++,i.totalDuration+=e.duration,i.minDuration=Math.min(i.minDuration,e.duration),i.maxDuration=Math.max(i.maxDuration,e.duration),e.passed?i.passed++:i.failed++}async getDirectorySize(e){let r=0;try{let n=await Dt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Ur.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let a=await Dt.stat(s);r+=a.size}}}catch{}return r}};function sg(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function kw(t){return{name:t,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function HA(t){if(t.durations.length===0){t.min=0,t.max=0,t.avg=0,t.p50=0,t.p90=0,t.p95=0,t.p99=0;return}let e=[...t.durations].sort((n,i)=>n-i),r=t.durations.reduce((n,i)=>n+i,0);t.min=e[0],t.max=e[e.length-1],t.avg=Math.round(r/t.durations.length),t.p50=sg(e,50),t.p90=sg(e,90),t.p95=sg(e,95),t.p99=sg(e,99)}var og=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=kw("Overall"),this.errors=new Map}createEmptySummary(){return{totalRequests:0,passed:0,failed:0,skipped:0,passRate:0,duration:0,isRunning:!1}}start(){this.startTime=Date.now(),this.summary.isRunning=!0}reset(){this.summary=this.createEmptySummary(),this.byRequest.clear(),this.overall=kw("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,r,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let a=this.summary.passed+this.summary.failed;if(this.summary.passRate=a>0?Math.round(this.summary.passed/a*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,kw(e));let u=this.byRequest.get(e);if(u.count++,n?u.passed++:u.failed++,u.durations.push(r),HA(u),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),HA(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((r,n)=>{e.push({message:n,count:r})}),e.sort((r,n)=>n.count-r.count),{summary:{...this.summary},byRequest:new Map(this.byRequest),overall:{...this.overall},errors:e}}getSerializableStatistics(){let e=this.getStatistics();return{summary:e.summary,byRequest:Array.from(e.byRequest.values()),overall:e.overall,errors:e.errors}}};var It=Se(require("fs")),lo=Se(require("path"));var ag=class{constructor(e,r,n){this.collectionService=e;this.configService=r;this.suitesDir=r.getSuitesPath(),this.onSuitesChanged=n?.onSuitesChanged,this.ensureSuitesDir(),this.loadSuites(),n?.watch!==!1&&this.setupFileWatcher()}collectionService;configService;suitesDir;suites=new Map;fileWatcher=null;debounceTimer=null;onSuitesChanged;ensureSuitesDir(){It.existsSync(this.suitesDir)||It.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=It.watch(this.suitesDir,(e,r)=>{r&&!r.endsWith(".suite.json")||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.loadSuites(),this.onSuitesChanged?.()},200))}),this.fileWatcher.on("error",()=>{})}catch{}}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.close(),this.fileWatcher=null}loadSuites(){if(this.suites.clear(),!It.existsSync(this.suitesDir))return;let e=It.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=lo.join(this.suitesDir,r),i=It.readFileSync(n,"utf-8"),s=JSON.parse(i);s.id&&s.name&&this.suites.set(s.id,s)}catch(n){console.error(`[TestSuiteService] Failed to load ${r}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e,r=[]){let n=Date.now(),i={id:lt(e),name:e,requests:r,config:{...od},createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}async updateSuite(e){e.updatedAt=Date.now(),await this.saveSuiteToDisk(e),this.suites.set(e.id,e)}async duplicateSuite(e,r){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=await this.createSuite(r,n.requests.map(u=>({...u})));i.config={...n.config},i.description=n.description;let s=lo.join(this.suitesDir,e),a=lo.join(this.suitesDir,i.id);return It.existsSync(s)&&this.copyDirRecursive(s,a),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){It.existsSync(r)||It.mkdirSync(r,{recursive:!0});for(let n of It.readdirSync(e,{withFileTypes:!0})){let i=lo.join(e,n.name),s=lo.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):It.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=lo.join(this.suitesDir,n);try{return It.existsSync(i)&&It.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!1}}async createTempSuiteFromCollection(e){let r=this.collectionService.getCollection(e);if(!r){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(r,e,r.name,"",n);let i=Date.now();return{id:`temp-${e}`,name:r.name,requests:n,config:{...od},isTemporary:!0,createdAt:i,updatedAt:i}}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:lt(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}getAllAvailableRequests(){let e=[],r=this.collectionService.getAllCollections();for(let n of r)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,r,n,i,s){if(e.requests)for(let a of e.requests)s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.items)for(let a of e.items)if(a.items||a.folders||a.requests){let u=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,u,s)}else s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.folders)for(let a of e.folders){let u=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,u,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=lo.join(this.suitesDir,r),i=JSON.stringify(e,null,2);It.writeFileSync(n,i,"utf-8")}};var ss=Se(require("fs")),Ia=Se(require("path"));var lg=class{constructor(e){this.collectionService=e}collectionService;suite;suiteDir;setSuite(e){this.suite=e}setSuiteDir(e){this.suiteDir=e}getSuite(){return this.suite}loadSuiteRequest(e){if(!this.suiteDir)return;let r=Ia.join(this.suiteDir,e,"request.json");if(ss.existsSync(r))try{let n=JSON.parse(ss.readFileSync(r,"utf-8")),i=Ia.join(this.suiteDir,e,"scripts"),s=Cc(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,r){if(!this.suiteDir)return;let n=Ia.join(this.suiteDir,e);ss.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,ss.writeFileSync(Ia.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=Ia.join(n,"scripts");Rc(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:ss.existsSync(Ia.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let r=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(r){let s,a=[];if(n){s=n.scripts;let u=this.findRequestInCollection(n,e.requestId);u&&(a=u.folderScriptsChain)}return{request:r,suiteRequest:e,collectionScripts:s,folderScriptsChain:a}}if(!n){console.warn(`[TestSuiteStore] Collection not found: ${e.collectionId}`);return}let i=this.findRequestInCollection(n,e.requestId);if(!i){console.warn(`[TestSuiteStore] Request not found: ${e.requestId}`);return}return{request:i.request,suiteRequest:e,collectionScripts:n.scripts,folderScriptsChain:i.folderScriptsChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n){for(let i of e)if(i.type==="folder"){let s=i;if(!s.items)continue;let a=s.scripts?[...n,s.scripts]:n,u=this.searchItems(s.items||[],r,a);if(u)return u}else if(i.id===r)return{request:this.normalizeRequest(i),folderScriptsChain:n}}normalizeRequest(e){let{type:r,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(r=>({key:r.key||"",value:r.value||"",enabled:r.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([r,n])=>({key:r,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,r){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===r);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let r=this.suite.requests.find(n=>n.slug===e);if(r)return this.resolveRequest(r)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){let n=this.resolveRequest(r);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){if(!r.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);r.slug=hi(r.name||"request",i)}let n=this.resolveRequest(r);if(n){let i=this.collectionService.getCollection(r.collectionId);e.push({id:`${r.collectionId}:${r.requestId}`,collectionId:r.collectionId,requestId:r.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:r.folderPath||"",enabled:r.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(r.slug),slug:r.slug})}}return e}getSelectedRequests(e){let r=[];for(let n of e){let[i,s]=n.split(":"),a=this.suite?.requests.find(u=>u.collectionId===i&&u.requestId===s);if(a){let u=this.resolveRequest(a);u&&r.push(u)}}return r}addRequest(e,r){if(this.suite){if(this.suiteDir&&r){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=hi(e.name||r.name||"request",n)}this.saveSuiteRequest(e.slug,r)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let r=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!r.has(e))return e;let n=2;for(;r.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(r=>r.requestId!==e))}reorderRequests(e){if(!this.suite)return;let r=new Map;for(let i of this.suite.requests)r.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=r.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,r){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,r);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=r.name||n.name,n.method=r.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let r=this.suite.requests.find(s=>s.slug===e);if(!r)return;let n=this.collectionService.getCollection(r.collectionId);if(!n)return;let i=this.findRequestInCollection(n,r.requestId);if(i)return this.saveSuiteRequest(e,i.request),r.name=i.request.name||r.name,r.method=i.request.method||r.method,i.request}};0&&(module.exports={BODY_FILE_MAP,CONFIG_FILES,CollectionLoader,CollectionLoaderFactory,CollectionRequestExecutor,CollectionService,ConfigService,CookieJar,CookieService,CookieUtils,DEFAULT_CONFIG,DEFAULT_REQUEST_SETTINGS,DEFAULT_SUITE_CONFIG,DYNAMIC_VARIABLES,DataFileParser,EnvironmentConfigService,EnvironmentResolver,ExampleGenerator,FetchHttpClient,FolderCollectionLoader,FolderCollectionStore,ForgeContainer,ForgeEnv,GraphQLSchemaService,HTTP_METHOD_MAP,HTTP_METHOD_REVERSE,HistoryAnalyzer,HtmlReportGenerator,HttpForgeParser,HttpRequestService,InMemoryCookieJar,InterceptorChain,JsonCollectionLoader,LoggingRequestInterceptor,METADATA_FILES,ModuleLoader,NodeFileSystem,NodeHttpClient,OAuth2TokenManager,OpenApiExporter,OpenApiImporter,ParserRegistry,PersistentCookieJar,ROOT_DIRECTORIES,RefResolver,RequestExecutor,RequestHistoryService,RequestHistoryStore,RequestPreparer,RequestPreprocessor,RequestScriptSession,ResultStorageService,RetryErrorInterceptor,SCHEMA_FILES,SCRIPTS_DIR,SCRIPT_FILES,SchemaInferenceService,SchemaInferrer,ScriptAnalyzer,ScriptExecutor,ServiceContainer,ServiceIdentifiers,StatisticsService,TestSuiteService,TestSuiteStore,TimingResponseInterceptor,UrlBuilder,VariableInterpolator,VariableResolver,applyExtractionPlan,applyFilterChain,augmentWithDynamicVars,buildExtractionPlan,buildResultFileName,cleanupOldBodyFiles,concatenateScripts,createExpectChain,createLodashShim,createModuleLoader,createMomentShim,createResponseObject,createScriptConsole,createTestFunction,createVariableResolver,deepClone,deleteItemFromTree,detectSensitiveData,evaluateExpression,expandSummary,exportCollectionToRestClient,findItemById,formatBytes,formatConsoleOutput,formatDuration,generateId,generateSlug,generateUUID,getCompletions,getRestClientExportFolder,getServiceContainer,hasChanged,isExpression,isPlainObject,isSystemEnvironmentFile,loadEnvironmentsFromFolder,mergeHeadersCaseInsensitive,mergeRequestSettings,normalizeHeaders,parseFilterChain,parsePostmanEnvironment,parsePostmanEnvironmentFile,parseQueryContext,prepareBodyForSave,readBodyFromDir,readSchemaFile,readScriptsFromDir,redactBody,redactFullResponse,redactFullResultDetails,redactHeaders,redactHistoryEntry,redactUrl,registerCoreServices,resolveDynamicVariable,resolveDynamicVariablesInString,safeJsonParse,sanitizeName,searchForItemPath,sortItemsByOrder,writeEnvFile,writeFolderItems,writeSchemaFiles,writeScriptFile,writeScriptsToDir});
|