@sebastianwessel/quickjs
Version:
A typescript package to execute JavaScript and TypeScript code in a WebAssembly QuickJS sandbox
2 lines • 75.8 kB
JavaScript
var{defineProperty:TX,getOwnPropertyNames:RY}=Object,F=(Q,X)=>TX(Q,"name",{value:X,configurable:!0}),qY=(Q,X)=>function Y(){return X||Q[RY(Q)[0]]((X={exports:{}}).exports,X),X.exports},AQ=(Q,X)=>{for(var Y in X)TX(Q,Y,{get:X[Y],enumerable:!0})},DY=qY({"(disabled):util"(){}}),s={};AQ(s,{addChainableMethod:()=>lQ,addLengthGuard:()=>o,addMethod:()=>dQ,addProperty:()=>cQ,checkError:()=>x,compareByInspect:()=>YQ,eql:()=>rX,expectTypes:()=>kX,flag:()=>q,getActual:()=>WQ,getMessage:()=>yQ,getName:()=>GQ,getOperator:()=>oQ,getOwnEnumerableProperties:()=>nQ,getOwnEnumerablePropertySymbols:()=>iQ,getPathInfo:()=>uQ,hasProperty:()=>VQ,inspect:()=>S,isNaN:()=>$Q,isNumeric:()=>L,isProxyEnabled:()=>n,isRegExp:()=>JQ,objDisplay:()=>h,overwriteChainableMethod:()=>pQ,overwriteMethod:()=>gQ,overwriteProperty:()=>mQ,proxify:()=>g,test:()=>vQ,transferFlags:()=>k,type:()=>C});var x={};AQ(x,{compatibleConstructor:()=>HX,compatibleInstance:()=>LX,compatibleMessage:()=>MX,getConstructorName:()=>xX,getMessage:()=>OX});function UQ(Q){return Q instanceof Error||Object.prototype.toString.call(Q)==="[object Error]"}F(UQ,"isErrorInstance");function EX(Q){return Object.prototype.toString.call(Q)==="[object RegExp]"}F(EX,"isRegExp");function LX(Q,X){return UQ(X)&&Q===X}F(LX,"compatibleInstance");function HX(Q,X){if(UQ(X))return Q.constructor===X.constructor||Q instanceof X.constructor;else if((typeof X==="object"||typeof X==="function")&&X.prototype)return Q.constructor===X||Q instanceof X;return!1}F(HX,"compatibleConstructor");function MX(Q,X){let Y=typeof Q==="string"?Q:Q.message;if(EX(X))return X.test(Y);else if(typeof X==="string")return Y.indexOf(X)!==-1;return!1}F(MX,"compatibleMessage");function xX(Q){let X=Q;if(UQ(Q))X=Q.constructor.name;else if(typeof Q==="function"){if(X=Q.name,X==="")X=new Q().name||X}return X}F(xX,"getConstructorName");function OX(Q){let X="";if(Q&&Q.message)X=Q.message;else if(typeof Q==="string")X=Q;return X}F(OX,"getMessage");function q(Q,X,Y){var $=Q.__flags||(Q.__flags=Object.create(null));if(arguments.length===3)$[X]=Y;else return $[X]}F(q,"flag");function vQ(Q,X){var Y=q(Q,"negate"),$=X[0];return Y?!$:$}F(vQ,"test");function C(Q){if(typeof Q==="undefined")return"undefined";if(Q===null)return"null";let X=Q[Symbol.toStringTag];if(typeof X==="string")return X;return Object.prototype.toString.call(Q).slice(8,-1)}F(C,"type");var NY="captureStackTrace"in Error,P=class Q extends Error{static{F(this,"AssertionError")}message;get name(){return"AssertionError"}get ok(){return!1}constructor(X="Unspecified AssertionError",Y,$){super(X);if(this.message=X,NY)Error.captureStackTrace(this,$||Q);for(let J in Y)if(!(J in this))this[J]=Y[J]}toJSON(X){return{...this,name:this.name,message:this.message,ok:!1,stack:X!==!1?this.stack:void 0}}};function kX(Q,X){var Y=q(Q,"message"),$=q(Q,"ssfi");Y=Y?Y+": ":"",Q=q(Q,"object"),X=X.map(function(V){return V.toLowerCase()}),X.sort();var J=X.map(function(V,K){var z=~["a","e","i","o","u"].indexOf(V.charAt(0))?"an":"a",B=X.length>1&&K===X.length-1?"or ":"";return B+z+" "+V}).join(", "),W=C(Q).toLowerCase();if(!X.some(function(V){return W===V}))throw new P(Y+"object tested must be "+J+", but "+W+" given",void 0,$)}F(kX,"expectTypes");function WQ(Q,X){return X.length>4?X[4]:Q._obj}F(WQ,"getActual");var RX={bold:["1","22"],dim:["2","22"],italic:["3","23"],underline:["4","24"],inverse:["7","27"],hidden:["8","28"],strike:["9","29"],black:["30","39"],red:["31","39"],green:["32","39"],yellow:["33","39"],blue:["34","39"],magenta:["35","39"],cyan:["36","39"],white:["37","39"],brightblack:["30;1","39"],brightred:["31;1","39"],brightgreen:["32;1","39"],brightyellow:["33;1","39"],brightblue:["34;1","39"],brightmagenta:["35;1","39"],brightcyan:["36;1","39"],brightwhite:["37;1","39"],grey:["90","39"]},IY={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},c="…";function _X(Q,X){let Y=RX[IY[X]]||RX[X]||"";if(!Y)return String(Q);return`\x1B[${Y[0]}m${String(Q)}\x1B[${Y[1]}m`}F(_X,"colorise");function AX({showHidden:Q=!1,depth:X=2,colors:Y=!1,customInspect:$=!0,showProxy:J=!1,maxArrayLength:W=1/0,breakLength:V=1/0,seen:K=[],truncate:z=1/0,stylize:B=String}={},R){let D={showHidden:Boolean(Q),depth:Number(X),colors:Boolean(Y),customInspect:Boolean($),showProxy:Boolean(J),maxArrayLength:Number(W),breakLength:Number(V),truncate:Number(z),seen:K,inspect:R,stylize:B};if(D.colors)D.stylize=_X;return D}F(AX,"normaliseOptions");function vX(Q){return Q>="\uD800"&&Q<="\uDBFF"}F(vX,"isHighSurrogate");function A(Q,X,Y=c){Q=String(Q);let $=Y.length,J=Q.length;if($>X&&J>$)return Y;if(J>X&&J>$){let W=X-$;if(W>0&&vX(Q[W-1]))W=W-1;return`${Q.slice(0,W)}${Y}`}return Q}F(A,"truncate");function O(Q,X,Y,$=", "){Y=Y||X.inspect;let J=Q.length;if(J===0)return"";let W=X.truncate,V="",K="",z="";for(let B=0;B<J;B+=1){let R=B+1===Q.length,D=B+2===Q.length;z=`${c}(${Q.length-B})`;let w=Q[B];X.truncate=W-V.length-(R?0:$.length);let N=K||Y(w,X)+(R?"":$),I=V.length+N.length,T=I+z.length;if(R&&I>W&&V.length+z.length<=W)break;if(!R&&!D&&T>W)break;if(K=R?"":Y(Q[B+1],X)+(D?"":$),!R&&D&&T>W&&I+K.length>W)break;if(V+=N,!R&&!D&&I+K.length>=W){z=`${c}(${Q.length-B-1})`;break}z=""}return`${V}${z}`}F(O,"inspectList");function jX(Q){if(Q.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/))return Q;return JSON.stringify(Q).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}F(jX,"quoteComplexKey");function d([Q,X],Y){if(Y.truncate-=2,typeof Q==="string")Q=jX(Q);else if(typeof Q!=="number")Q=`[${Y.inspect(Q,Y)}]`;return Y.truncate-=Q.length,X=Y.inspect(X,Y),`${Q}: ${X}`}F(d,"inspectProperty");function yX(Q,X){let Y=Object.keys(Q).slice(Q.length);if(!Q.length&&!Y.length)return"[]";X.truncate-=4;let $=O(Q,X);X.truncate-=$.length;let J="";if(Y.length)J=O(Y.map((W)=>[W,Q[W]]),X,d);return`[ ${$}${J?`, ${J}`:""} ]`}F(yX,"inspectArray");var SY=F((Q)=>{if(typeof Buffer==="function"&&Q instanceof Buffer)return"Buffer";if(Q[Symbol.toStringTag])return Q[Symbol.toStringTag];return Q.constructor.name},"getArrayName");function _(Q,X){let Y=SY(Q);X.truncate-=Y.length+4;let $=Object.keys(Q).slice(Q.length);if(!Q.length&&!$.length)return`${Y}[]`;let J="";for(let V=0;V<Q.length;V++){let K=`${X.stylize(A(Q[V],X.truncate),"number")}${V===Q.length-1?"":", "}`;if(X.truncate-=K.length,Q[V]!==Q.length&&X.truncate<=3){J+=`${c}(${Q.length-Q[V]+1})`;break}J+=K}let W="";if($.length)W=O($.map((V)=>[V,Q[V]]),X,d);return`${Y}[ ${J}${W?`, ${W}`:""} ]`}F(_,"inspectTypedArray");function hX(Q,X){let Y=Q.toJSON();if(Y===null)return"Invalid Date";let $=Y.split("T"),J=$[0];return X.stylize(`${J}T${A($[1],X.truncate-J.length-1)}`,"date")}F(hX,"inspectDate");function IQ(Q,X){let Y=Q[Symbol.toStringTag]||"Function",$=Q.name;if(!$)return X.stylize(`[${Y}]`,"special");return X.stylize(`[${Y} ${A($,X.truncate-11)}]`,"special")}F(IQ,"inspectFunction");function bX([Q,X],Y){return Y.truncate-=4,Q=Y.inspect(Q,Y),Y.truncate-=Q.length,X=Y.inspect(X,Y),`${Q} => ${X}`}F(bX,"inspectMapEntry");function fX(Q){let X=[];return Q.forEach((Y,$)=>{X.push([$,Y])}),X}F(fX,"mapToEntries");function uX(Q,X){if(Q.size-1<=0)return"Map{}";return X.truncate-=7,`Map{ ${O(fX(Q),X,bX)} }`}F(uX,"inspectMap");var PY=Number.isNaN||((Q)=>Q!==Q);function SQ(Q,X){if(PY(Q))return X.stylize("NaN","number");if(Q===1/0)return X.stylize("Infinity","number");if(Q===-1/0)return X.stylize("-Infinity","number");if(Q===0)return X.stylize(1/Q===1/0?"+0":"-0","number");return X.stylize(A(String(Q),X.truncate),"number")}F(SQ,"inspectNumber");function PQ(Q,X){let Y=A(Q.toString(),X.truncate-1);if(Y!==c)Y+="n";return X.stylize(Y,"bigint")}F(PQ,"inspectBigInt");function cX(Q,X){let Y=Q.toString().split("/")[2],$=X.truncate-(2+Y.length),J=Q.source;return X.stylize(`/${A(J,$)}/${Y}`,"regexp")}F(cX,"inspectRegExp");function dX(Q){let X=[];return Q.forEach((Y)=>{X.push(Y)}),X}F(dX,"arrayFromSet");function mX(Q,X){if(Q.size===0)return"Set{}";return X.truncate-=7,`Set{ ${O(dX(Q),X)} }`}F(mX,"inspectSet");var qX=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),wY={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},CY=16,TY=4;function gX(Q){return wY[Q]||`\\u${`0000${Q.charCodeAt(0).toString(CY)}`.slice(-TY)}`}F(gX,"escape");function wQ(Q,X){if(qX.test(Q))Q=Q.replace(qX,gX);return X.stylize(`'${A(Q,X.truncate-2)}'`,"string")}F(wQ,"inspectString");function CQ(Q){if("description"in Symbol.prototype)return Q.description?`Symbol(${Q.description})`:"Symbol()";return Q.toString()}F(CQ,"inspectSymbol");var lX=F(()=>"Promise{…}","getPromiseValue");try{let{getPromiseDetails:Q,kPending:X,kRejected:Y}=process.binding("util");if(Array.isArray(Q(Promise.resolve())))lX=F(($,J)=>{let[W,V]=Q($);if(W===X)return"Promise{<pending>}";return`Promise${W===Y?"!":""}{${J.inspect(V,J)}}`},"getPromiseValue")}catch(Q){}var EY=lX;function p(Q,X){let Y=Object.getOwnPropertyNames(Q),$=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(Q):[];if(Y.length===0&&$.length===0)return"{}";if(X.truncate-=4,X.seen=X.seen||[],X.seen.includes(Q))return"[Circular]";X.seen.push(Q);let J=O(Y.map((K)=>[K,Q[K]]),X,d),W=O($.map((K)=>[K,Q[K]]),X,d);X.seen.pop();let V="";if(J&&W)V=", ";return`{ ${J}${V}${W} }`}F(p,"inspectObject");var DQ=typeof Symbol!=="undefined"&&Symbol.toStringTag?Symbol.toStringTag:!1;function pX(Q,X){let Y="";if(DQ&&DQ in Q)Y=Q[DQ];if(Y=Y||Q.constructor.name,!Y||Y==="_class")Y="<Anonymous Class>";return X.truncate-=Y.length,`${Y}${p(Q,X)}`}F(pX,"inspectClass");function iX(Q,X){if(Q.length===0)return"Arguments[]";return X.truncate-=13,`Arguments[ ${O(Q,X)} ]`}F(iX,"inspectArguments");var LY=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function nX(Q,X){let Y=Object.getOwnPropertyNames(Q).filter((V)=>LY.indexOf(V)===-1),$=Q.name;X.truncate-=$.length;let J="";if(typeof Q.message==="string")J=A(Q.message,X.truncate);else Y.unshift("message");if(J=J?`: ${J}`:"",X.truncate-=J.length+5,X.seen=X.seen||[],X.seen.includes(Q))return"[Circular]";X.seen.push(Q);let W=O(Y.map((V)=>[V,Q[V]]),X,d);return`${$}${J}${W?` { ${W} }`:""}`}F(nX,"inspectObject");function oX([Q,X],Y){if(Y.truncate-=3,!X)return`${Y.stylize(String(Q),"yellow")}`;return`${Y.stylize(String(Q),"yellow")}=${Y.stylize(`"${X}"`,"string")}`}F(oX,"inspectAttribute");function e(Q,X){return O(Q,X,jQ,`
`)}F(e,"inspectHTMLCollection");function jQ(Q,X){let Y=Q.getAttributeNames(),$=Q.tagName.toLowerCase(),J=X.stylize(`<${$}`,"special"),W=X.stylize(">","special"),V=X.stylize(`</${$}>`,"special");X.truncate-=$.length*2+5;let K="";if(Y.length>0)K+=" ",K+=O(Y.map((R)=>[R,Q.getAttribute(R)]),X,oX," ");X.truncate-=K.length;let z=X.truncate,B=e(Q.children,X);if(B&&B.length>z)B=`${c}(${Q.children.length})`;return`${J}${K}${W}${B}${V}`}F(jQ,"inspectHTML");var HY=typeof Symbol==="function"&&typeof Symbol.for==="function",NQ=HY?Symbol.for("chai/inspect"):"@@chai/inspect",u=!1;try{let Q=DY();u=Q.inspect?Q.inspect.custom:!1}catch(Q){u=!1}var DX=new WeakMap,NX={},IX={undefined:(Q,X)=>X.stylize("undefined","undefined"),null:(Q,X)=>X.stylize("null","null"),boolean:(Q,X)=>X.stylize(String(Q),"boolean"),Boolean:(Q,X)=>X.stylize(String(Q),"boolean"),number:SQ,Number:SQ,bigint:PQ,BigInt:PQ,string:wQ,String:wQ,function:IQ,Function:IQ,symbol:CQ,Symbol:CQ,Array:yX,Date:hX,Map:uX,Set:mX,RegExp:cX,Promise:EY,WeakSet:(Q,X)=>X.stylize("WeakSet{…}","special"),WeakMap:(Q,X)=>X.stylize("WeakMap{…}","special"),Arguments:iX,Int8Array:_,Uint8Array:_,Uint8ClampedArray:_,Int16Array:_,Uint16Array:_,Int32Array:_,Uint32Array:_,Float32Array:_,Float64Array:_,Generator:()=>"",DataView:()=>"",ArrayBuffer:()=>"",Error:nX,HTMLCollection:e,NodeList:e},MY=F((Q,X,Y)=>{if(NQ in Q&&typeof Q[NQ]==="function")return Q[NQ](X);if(u&&u in Q&&typeof Q[u]==="function")return Q[u](X.depth,X);if("inspect"in Q&&typeof Q.inspect==="function")return Q.inspect(X.depth,X);if("constructor"in Q&&DX.has(Q.constructor))return DX.get(Q.constructor)(Q,X);if(NX[Y])return NX[Y](Q,X);return""},"inspectCustom"),xY=Object.prototype.toString;function QQ(Q,X={}){let Y=AX(X,QQ),{customInspect:$}=Y,J=Q===null?"null":typeof Q;if(J==="object")J=xY.call(Q).slice(8,-1);if(J in IX)return IX[J](Q,Y);if($&&Q){let V=MY(Q,Y,J);if(V){if(typeof V==="string")return V;return QQ(V,Y)}}let W=Q?Object.getPrototypeOf(Q):!1;if(W===Object.prototype||W===null)return p(Q,Y);if(Q&&typeof HTMLElement==="function"&&Q instanceof HTMLElement)return jQ(Q,Y);if("constructor"in Q){if(Q.constructor!==Object)return pX(Q,Y);return p(Q,Y)}if(Q===Object(Q))return p(Q,Y);return Y.stylize(String(Q),J)}F(QQ,"inspect");var M={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"],deepEqual:null};function S(Q,X,Y,$){var J={colors:$,depth:typeof Y==="undefined"?2:Y,showHidden:X,truncate:M.truncateThreshold?M.truncateThreshold:1/0};return QQ(Q,J)}F(S,"inspect");function h(Q){var X=S(Q),Y=Object.prototype.toString.call(Q);if(M.truncateThreshold&&X.length>=M.truncateThreshold)if(Y==="[object Function]")return!Q.name||Q.name===""?"[Function]":"[Function: "+Q.name+"]";else if(Y==="[object Array]")return"[ Array("+Q.length+") ]";else if(Y==="[object Object]"){var $=Object.keys(Q),J=$.length>2?$.splice(0,2).join(", ")+", ...":$.join(", ");return"{ Object ("+J+") }"}else return X;else return X}F(h,"objDisplay");function yQ(Q,X){var Y=q(Q,"negate"),$=q(Q,"object"),J=X[3],W=WQ(Q,X),V=Y?X[2]:X[1],K=q(Q,"message");if(typeof V==="function")V=V();return V=V||"",V=V.replace(/#\{this\}/g,function(){return h($)}).replace(/#\{act\}/g,function(){return h(W)}).replace(/#\{exp\}/g,function(){return h(J)}),K?K+": "+V:V}F(yQ,"getMessage");function k(Q,X,Y){var $=Q.__flags||(Q.__flags=Object.create(null));if(!X.__flags)X.__flags=Object.create(null);Y=arguments.length===3?Y:!0;for(var J in $)if(Y||J!=="object"&&J!=="ssfi"&&J!=="lockSsfi"&&J!="message")X.__flags[J]=$[J]}F(k,"transferFlags");function TQ(Q){if(typeof Q==="undefined")return"undefined";if(Q===null)return"null";let X=Q[Symbol.toStringTag];if(typeof X==="string")return X;let Y=8,$=-1;return Object.prototype.toString.call(Q).slice(Y,$)}F(TQ,"type");function hQ(){this._key="chai/deep-eql__"+Math.random()+Date.now()}F(hQ,"FakeMap");hQ.prototype={get:F(function Q(X){return X[this._key]},"get"),set:F(function Q(X,Y){if(Object.isExtensible(X))Object.defineProperty(X,this._key,{value:Y,configurable:!0})},"set")};var aX=typeof WeakMap==="function"?WeakMap:hQ;function EQ(Q,X,Y){if(!Y||b(Q)||b(X))return null;var $=Y.get(Q);if($){var J=$.get(X);if(typeof J==="boolean")return J}return null}F(EQ,"memoizeCompare");function l(Q,X,Y,$){if(!Y||b(Q)||b(X))return;var J=Y.get(Q);if(J)J.set(X,$);else J=new aX,J.set(X,$),Y.set(Q,J)}F(l,"memoizeSet");var rX=i;function i(Q,X,Y){if(Y&&Y.comparator)return LQ(Q,X,Y);var $=bQ(Q,X);if($!==null)return $;return LQ(Q,X,Y)}F(i,"deepEqual");function bQ(Q,X){if(Q===X)return Q!==0||1/Q===1/X;if(Q!==Q&&X!==X)return!0;if(b(Q)||b(X))return!1;return null}F(bQ,"simpleEqual");function LQ(Q,X,Y){Y=Y||{},Y.memoize=Y.memoize===!1?!1:Y.memoize||new aX;var $=Y&&Y.comparator,J=EQ(Q,X,Y.memoize);if(J!==null)return J;var W=EQ(X,Q,Y.memoize);if(W!==null)return W;if($){var V=$(Q,X);if(V===!1||V===!0)return l(Q,X,Y.memoize,V),V;var K=bQ(Q,X);if(K!==null)return K}var z=TQ(Q);if(z!==TQ(X))return l(Q,X,Y.memoize,!1),!1;l(Q,X,Y.memoize,!0);var B=tX(Q,X,z,Y);return l(Q,X,Y.memoize,B),B}F(LQ,"extensiveDeepEqual");function tX(Q,X,Y,$){switch(Y){case"String":case"Number":case"Boolean":case"Date":return i(Q.valueOf(),X.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return Q===X;case"Error":return fQ(Q,X,["name","message","code"],$);case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return y(Q,X,$);case"RegExp":return sX(Q,X);case"Generator":return eX(Q,X,$);case"DataView":return y(new Uint8Array(Q.buffer),new Uint8Array(X.buffer),$);case"ArrayBuffer":return y(new Uint8Array(Q),new Uint8Array(X),$);case"Set":return HQ(Q,X,$);case"Map":return HQ(Q,X,$);case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.Instant":case"Temporal.ZonedDateTime":case"Temporal.PlainYearMonth":case"Temporal.PlainMonthDay":return Q.equals(X);case"Temporal.Duration":return Q.total("nanoseconds")===X.total("nanoseconds");case"Temporal.TimeZone":case"Temporal.Calendar":return Q.toString()===X.toString();default:return XY(Q,X,$)}}F(tX,"extensiveDeepEqualByType");function sX(Q,X){return Q.toString()===X.toString()}F(sX,"regexpEqual");function HQ(Q,X,Y){try{if(Q.size!==X.size)return!1;if(Q.size===0)return!0}catch(W){return!1}var $=[],J=[];return Q.forEach(F(function W(V,K){$.push([V,K])},"gatherEntries")),X.forEach(F(function W(V,K){J.push([V,K])},"gatherEntries")),y($.sort(),J.sort(),Y)}F(HQ,"entriesEqual");function y(Q,X,Y){var $=Q.length;if($!==X.length)return!1;if($===0)return!0;var J=-1;while(++J<$)if(i(Q[J],X[J],Y)===!1)return!1;return!0}F(y,"iterableEqual");function eX(Q,X,Y){return y(XQ(Q),XQ(X),Y)}F(eX,"generatorEqual");function QY(Q){return typeof Symbol!=="undefined"&&typeof Q==="object"&&typeof Symbol.iterator!=="undefined"&&typeof Q[Symbol.iterator]==="function"}F(QY,"hasIteratorFunction");function MQ(Q){if(QY(Q))try{return XQ(Q[Symbol.iterator]())}catch(X){return[]}return[]}F(MQ,"getIteratorEntries");function XQ(Q){var X=Q.next(),Y=[X.value];while(X.done===!1)X=Q.next(),Y.push(X.value);return Y}F(XQ,"getGeneratorEntries");function xQ(Q){var X=[];for(var Y in Q)X.push(Y);return X}F(xQ,"getEnumerableKeys");function OQ(Q){var X=[],Y=Object.getOwnPropertySymbols(Q);for(var $=0;$<Y.length;$+=1){var J=Y[$];if(Object.getOwnPropertyDescriptor(Q,J).enumerable)X.push(J)}return X}F(OQ,"getEnumerableSymbols");function fQ(Q,X,Y,$){var J=Y.length;if(J===0)return!0;for(var W=0;W<J;W+=1)if(i(Q[Y[W]],X[Y[W]],$)===!1)return!1;return!0}F(fQ,"keysEqual");function XY(Q,X,Y){var $=xQ(Q),J=xQ(X),W=OQ(Q),V=OQ(X);if($=$.concat(W),J=J.concat(V),$.length&&$.length===J.length){if(y(kQ($).sort(),kQ(J).sort())===!1)return!1;return fQ(Q,X,$,Y)}var K=MQ(Q),z=MQ(X);if(K.length&&K.length===z.length)return K.sort(),z.sort(),y(K,z,Y);if($.length===0&&K.length===0&&J.length===0&&z.length===0)return!0;return!1}F(XY,"objectEqual");function b(Q){return Q===null||typeof Q!=="object"}F(b,"isPrimitive");function kQ(Q){return Q.map(F(function X(Y){if(typeof Y==="symbol")return Y.toString();return Y},"mapSymbol"))}F(kQ,"mapSymbols");function VQ(Q,X){if(typeof Q==="undefined"||Q===null)return!1;return X in Object(Q)}F(VQ,"hasProperty");function YY(Q){return Q.replace(/([^\\])\[/g,"$1.[").match(/(\\\.|[^.]+?)+/g).map(($)=>{if($==="constructor"||$==="__proto__"||$==="prototype")return{};let W=/^\[(\d+)\]$/.exec($),V=null;if(W)V={i:parseFloat(W[1])};else V={p:$.replace(/\\([.[\]])/g,"$1")};return V})}F(YY,"parsePath");function _Q(Q,X,Y){let $=Q,J=null;Y=typeof Y==="undefined"?X.length:Y;for(let W=0;W<Y;W++){let V=X[W];if($){if(typeof V.p==="undefined")$=$[V.i];else $=$[V.p];if(W===Y-1)J=$}}return J}F(_Q,"internalGetPathValue");function uQ(Q,X){let Y=YY(X),$=Y[Y.length-1],J={parent:Y.length>1?_Q(Q,Y,Y.length-1):Q,name:$.p||$.i,value:_Q(Q,Y)};return J.exists=VQ(J.parent,J.name),J}F(uQ,"getPathInfo");function U(Q,X,Y,$){return q(this,"ssfi",Y||U),q(this,"lockSsfi",$),q(this,"object",Q),q(this,"message",X),q(this,"eql",M.deepEqual||rX),g(this)}F(U,"Assertion");Object.defineProperty(U,"includeStack",{get:function(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),M.includeStack},set:function(Q){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),M.includeStack=Q}});Object.defineProperty(U,"showDiff",{get:function(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),M.showDiff},set:function(Q){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),M.showDiff=Q}});U.addProperty=function(Q,X){cQ(this.prototype,Q,X)};U.addMethod=function(Q,X){dQ(this.prototype,Q,X)};U.addChainableMethod=function(Q,X,Y){lQ(this.prototype,Q,X,Y)};U.overwriteProperty=function(Q,X){mQ(this.prototype,Q,X)};U.overwriteMethod=function(Q,X){gQ(this.prototype,Q,X)};U.overwriteChainableMethod=function(Q,X,Y){pQ(this.prototype,Q,X,Y)};U.prototype.assert=function(Q,X,Y,$,J,W){var V=vQ(this,arguments);if(W!==!1)W=!0;if($===void 0&&J===void 0)W=!1;if(M.showDiff!==!0)W=!1;if(!V){X=yQ(this,arguments);var K=WQ(this,arguments),z={actual:K,expected:$,showDiff:W},B=oQ(this,arguments);if(B)z.operator=B;throw new P(X,z,M.includeStack?this.assert:q(this,"ssfi"))}};Object.defineProperty(U.prototype,"_obj",{get:function(){return q(this,"object")},set:function(Q){q(this,"object",Q)}});function n(){return M.useProxy&&typeof Proxy!=="undefined"&&typeof Reflect!=="undefined"}F(n,"isProxyEnabled");function cQ(Q,X,Y){Y=Y===void 0?function(){}:Y,Object.defineProperty(Q,X,{get:F(function $(){if(!n()&&!q(this,"lockSsfi"))q(this,"ssfi",$);var J=Y.call(this);if(J!==void 0)return J;var W=new U;return k(this,W),W},"propertyGetter"),configurable:!0})}F(cQ,"addProperty");var OY=Object.getOwnPropertyDescriptor(function(){},"length");function o(Q,X,Y){if(!OY.configurable)return Q;return Object.defineProperty(Q,"length",{get:function(){if(Y)throw Error("Invalid Chai property: "+X+'.length. Due to a compatibility issue, "length" cannot directly follow "'+X+'". Use "'+X+'.lengthOf" instead.');throw Error("Invalid Chai property: "+X+'.length. See docs for proper usage of "'+X+'".')}}),Q}F(o,"addLengthGuard");function $Y(Q){var X=Object.getOwnPropertyNames(Q);function Y(J){if(X.indexOf(J)===-1)X.push(J)}F(Y,"addProperty");var $=Object.getPrototypeOf(Q);while($!==null)Object.getOwnPropertyNames($).forEach(Y),$=Object.getPrototypeOf($);return X}F($Y,"getProperties");var SX=["__flags","__methods","_obj","assert"];function g(Q,X){if(!n())return Q;return new Proxy(Q,{get:F(function Y($,J){if(typeof J==="string"&&M.proxyExcludedKeys.indexOf(J)===-1&&!Reflect.has($,J)){if(X)throw Error("Invalid Chai property: "+X+"."+J+'. See docs for proper usage of "'+X+'".');var W=null,V=4;if($Y($).forEach(function(K){if(!Object.prototype.hasOwnProperty(K)&&SX.indexOf(K)===-1){var z=JY(J,K,V);if(z<V)W=K,V=z}}),W!==null)throw Error("Invalid Chai property: "+J+'. Did you mean "'+W+'"?');else throw Error("Invalid Chai property: "+J)}if(SX.indexOf(J)===-1&&!q($,"lockSsfi"))q($,"ssfi",Y);return Reflect.get($,J)},"proxyGetter")})}F(g,"proxify");function JY(Q,X,Y){if(Math.abs(Q.length-X.length)>=Y)return Y;var $=[];for(let W=0;W<=Q.length;W++)$[W]=Array(X.length+1).fill(0),$[W][0]=W;for(let W=0;W<X.length;W++)$[0][W]=W;for(let W=1;W<=Q.length;W++){var J=Q.charCodeAt(W-1);for(let V=1;V<=X.length;V++){if(Math.abs(W-V)>=Y){$[W][V]=Y;continue}$[W][V]=Math.min($[W-1][V]+1,$[W][V-1]+1,$[W-1][V-1]+(J===X.charCodeAt(V-1)?0:1))}}return $[Q.length][X.length]}F(JY,"stringDistanceCapped");function dQ(Q,X,Y){var $=F(function(){if(!q(this,"lockSsfi"))q(this,"ssfi",$);var J=Y.apply(this,arguments);if(J!==void 0)return J;var W=new U;return k(this,W),W},"methodWrapper");o($,X,!1),Q[X]=g($,X)}F(dQ,"addMethod");function mQ(Q,X,Y){var $=Object.getOwnPropertyDescriptor(Q,X),J=F(function(){},"_super");if($&&typeof $.get==="function")J=$.get;Object.defineProperty(Q,X,{get:F(function W(){if(!n()&&!q(this,"lockSsfi"))q(this,"ssfi",W);var V=q(this,"lockSsfi");q(this,"lockSsfi",!0);var K=Y(J).call(this);if(q(this,"lockSsfi",V),K!==void 0)return K;var z=new U;return k(this,z),z},"overwritingPropertyGetter"),configurable:!0})}F(mQ,"overwriteProperty");function gQ(Q,X,Y){var $=Q[X],J=F(function(){throw new Error(X+" is not a function")},"_super");if($&&typeof $==="function")J=$;var W=F(function(){if(!q(this,"lockSsfi"))q(this,"ssfi",W);var V=q(this,"lockSsfi");q(this,"lockSsfi",!0);var K=Y(J).apply(this,arguments);if(q(this,"lockSsfi",V),K!==void 0)return K;var z=new U;return k(this,z),z},"overwritingMethodWrapper");o(W,X,!1),Q[X]=g(W,X)}F(gQ,"overwriteMethod");var kY=typeof Object.setPrototypeOf==="function",PX=F(function(){},"testFn"),_Y=Object.getOwnPropertyNames(PX).filter(function(Q){var X=Object.getOwnPropertyDescriptor(PX,Q);if(typeof X!=="object")return!0;return!X.configurable}),AY=Function.prototype.call,vY=Function.prototype.apply;function lQ(Q,X,Y,$){if(typeof $!=="function")$=F(function(){},"chainingBehavior");var J={method:Y,chainingBehavior:$};if(!Q.__methods)Q.__methods={};Q.__methods[X]=J,Object.defineProperty(Q,X,{get:F(function W(){J.chainingBehavior.call(this);var V=F(function(){if(!q(this,"lockSsfi"))q(this,"ssfi",V);var B=J.method.apply(this,arguments);if(B!==void 0)return B;var R=new U;return k(this,R),R},"chainableMethodWrapper");if(o(V,X,!0),kY){var K=Object.create(this);K.call=AY,K.apply=vY,Object.setPrototypeOf(V,K)}else{var z=Object.getOwnPropertyNames(Q);z.forEach(function(B){if(_Y.indexOf(B)!==-1)return;var R=Object.getOwnPropertyDescriptor(Q,B);Object.defineProperty(V,B,R)})}return k(this,V),g(V)},"chainableMethodGetter"),configurable:!0})}F(lQ,"addChainableMethod");function pQ(Q,X,Y,$){var J=Q.__methods[X],W=J.chainingBehavior;J.chainingBehavior=F(function K(){var z=$(W).call(this);if(z!==void 0)return z;var B=new U;return k(this,B),B},"overwritingChainableMethodGetter");var V=J.method;J.method=F(function K(){var z=Y(V).apply(this,arguments);if(z!==void 0)return z;var B=new U;return k(this,B),B},"overwritingChainableMethodWrapper")}F(pQ,"overwriteChainableMethod");function YQ(Q,X){return S(Q)<S(X)?-1:1}F(YQ,"compareByInspect");function iQ(Q){if(typeof Object.getOwnPropertySymbols!=="function")return[];return Object.getOwnPropertySymbols(Q).filter(function(X){return Object.getOwnPropertyDescriptor(Q,X).enumerable})}F(iQ,"getOwnEnumerablePropertySymbols");function nQ(Q){return Object.keys(Q).concat(iQ(Q))}F(nQ,"getOwnEnumerableProperties");var $Q=Number.isNaN;function ZY(Q){var X=C(Q),Y=["Array","Object","Function"];return Y.indexOf(X)!==-1}F(ZY,"isObjectType");function oQ(Q,X){var Y=q(Q,"operator"),$=q(Q,"negate"),J=X[3],W=$?X[2]:X[1];if(Y)return Y;if(typeof W==="function")W=W();if(W=W||"",!W)return;if(/\shave\s/.test(W))return;var V=ZY(J);if(/\snot\s/.test(W))return V?"notDeepStrictEqual":"notStrictEqual";return V?"deepStrictEqual":"strictEqual"}F(oQ,"getOperator");function GQ(Q){return Q.name}F(GQ,"getName");function JQ(Q){return Object.prototype.toString.call(Q)==="[object RegExp]"}F(JQ,"isRegExp");function L(Q){return["Number","BigInt"].includes(C(Q))}F(L,"isNumeric");var{flag:G}=s;["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still","also"].forEach(function(Q){U.addProperty(Q)});U.addProperty("not",function(){G(this,"negate",!0)});U.addProperty("deep",function(){G(this,"deep",!0)});U.addProperty("nested",function(){G(this,"nested",!0)});U.addProperty("own",function(){G(this,"own",!0)});U.addProperty("ordered",function(){G(this,"ordered",!0)});U.addProperty("any",function(){G(this,"any",!0),G(this,"all",!1)});U.addProperty("all",function(){G(this,"all",!0),G(this,"any",!1)});var wX={function:["function","asyncfunction","generatorfunction","asyncgeneratorfunction"],asyncfunction:["asyncfunction","asyncgeneratorfunction"],generatorfunction:["generatorfunction","asyncgeneratorfunction"],asyncgeneratorfunction:["asyncgeneratorfunction"]};function aQ(Q,X){if(X)G(this,"message",X);Q=Q.toLowerCase();var Y=G(this,"object"),$=~["a","e","i","o","u"].indexOf(Q.charAt(0))?"an ":"a ";let J=C(Y).toLowerCase();if(wX.function.includes(Q))this.assert(wX[Q].includes(J),"expected #{this} to be "+$+Q,"expected #{this} not to be "+$+Q);else this.assert(Q===J,"expected #{this} to be "+$+Q,"expected #{this} not to be "+$+Q)}F(aQ,"an");U.addChainableMethod("an",aQ);U.addChainableMethod("a",aQ);function UY(Q,X){return $Q(Q)&&$Q(X)||Q===X}F(UY,"SameValueZero");function a(){G(this,"contains",!0)}F(a,"includeChainingBehavior");function r(Q,X){if(X)G(this,"message",X);var Y=G(this,"object"),$=C(Y).toLowerCase(),J=G(this,"message"),W=G(this,"negate"),V=G(this,"ssfi"),K=G(this,"deep"),z=K?"deep ":"",B=K?G(this,"eql"):UY;J=J?J+": ":"";var R=!1;switch($){case"string":R=Y.indexOf(Q)!==-1;break;case"weakset":if(K)throw new P(J+"unable to use .deep.include with WeakSet",void 0,V);R=Y.has(Q);break;case"map":Y.forEach(function(I){R=R||B(I,Q)});break;case"set":if(K)Y.forEach(function(I){R=R||B(I,Q)});else R=Y.has(Q);break;case"array":if(K)R=Y.some(function(I){return B(I,Q)});else R=Y.indexOf(Q)!==-1;break;default:if(Q!==Object(Q))throw new P(J+"the given combination of arguments ("+$+" and "+C(Q).toLowerCase()+") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a "+C(Q).toLowerCase(),void 0,V);var D=Object.keys(Q),w=null,N=0;if(D.forEach(function(I){var T=new U(Y);if(k(this,T,!0),G(T,"lockSsfi",!0),!W||D.length===1){T.property(I,Q[I]);return}try{T.property(I,Q[I])}catch(H){if(!x.compatibleConstructor(H,P))throw H;if(w===null)w=H;N++}},this),W&&D.length>1&&N===D.length)throw w;return}this.assert(R,"expected #{this} to "+z+"include "+S(Q),"expected #{this} to not "+z+"include "+S(Q))}F(r,"include");U.addChainableMethod("include",r,a);U.addChainableMethod("contain",r,a);U.addChainableMethod("contains",r,a);U.addChainableMethod("includes",r,a);U.addProperty("ok",function(){this.assert(G(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")});U.addProperty("true",function(){this.assert(G(this,"object")===!0,"expected #{this} to be true","expected #{this} to be false",G(this,"negate")?!1:!0)});U.addProperty("numeric",function(){let Q=G(this,"object");this.assert(["Number","BigInt"].includes(C(Q)),"expected #{this} to be numeric","expected #{this} to not be numeric",G(this,"negate")?!1:!0)});U.addProperty("callable",function(){let Q=G(this,"object"),X=G(this,"ssfi"),Y=G(this,"message"),$=Y?`${Y}: `:"",J=G(this,"negate"),W=J?`${$}expected ${S(Q)} not to be a callable function`:`${$}expected ${S(Q)} to be a callable function`,V=["Function","AsyncFunction","GeneratorFunction","AsyncGeneratorFunction"].includes(C(Q));if(V&&J||!V&&!J)throw new P(W,void 0,X)});U.addProperty("false",function(){this.assert(G(this,"object")===!1,"expected #{this} to be false","expected #{this} to be true",G(this,"negate")?!0:!1)});U.addProperty("null",function(){this.assert(G(this,"object")===null,"expected #{this} to be null","expected #{this} not to be null")});U.addProperty("undefined",function(){this.assert(G(this,"object")===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined")});U.addProperty("NaN",function(){this.assert($Q(G(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});function rQ(){var Q=G(this,"object");this.assert(Q!==null&&Q!==void 0,"expected #{this} to exist","expected #{this} to not exist")}F(rQ,"assertExist");U.addProperty("exist",rQ);U.addProperty("exists",rQ);U.addProperty("empty",function(){var Q=G(this,"object"),X=G(this,"ssfi"),Y=G(this,"message"),$;switch(Y=Y?Y+": ":"",C(Q).toLowerCase()){case"array":case"string":$=Q.length;break;case"map":case"set":$=Q.size;break;case"weakmap":case"weakset":throw new P(Y+".empty was passed a weak collection",void 0,X);case"function":var J=Y+".empty was passed a function "+GQ(Q);throw new P(J.trim(),void 0,X);default:if(Q!==Object(Q))throw new P(Y+".empty was passed non-string primitive "+S(Q),void 0,X);$=Object.keys(Q).length}this.assert($===0,"expected #{this} to be empty","expected #{this} not to be empty")});function tQ(){var Q=G(this,"object"),X=C(Q);this.assert(X==="Arguments","expected #{this} to be arguments but got "+X,"expected #{this} to not be arguments")}F(tQ,"checkArguments");U.addProperty("arguments",tQ);U.addProperty("Arguments",tQ);function KQ(Q,X){if(X)G(this,"message",X);var Y=G(this,"object");if(G(this,"deep")){var $=G(this,"lockSsfi");G(this,"lockSsfi",!0),this.eql(Q),G(this,"lockSsfi",$)}else this.assert(Q===Y,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",Q,this._obj,!0)}F(KQ,"assertEqual");U.addMethod("equal",KQ);U.addMethod("equals",KQ);U.addMethod("eq",KQ);function sQ(Q,X){if(X)G(this,"message",X);var Y=G(this,"eql");this.assert(Y(Q,G(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",Q,this._obj,!0)}F(sQ,"assertEql");U.addMethod("eql",sQ);U.addMethod("eqls",sQ);function FQ(Q,X){if(X)G(this,"message",X);var Y=G(this,"object"),$=G(this,"doLength"),J=G(this,"message"),W=J?J+": ":"",V=G(this,"ssfi"),K=C(Y).toLowerCase(),z=C(Q).toLowerCase();if($&&K!=="map"&&K!=="set")new U(Y,J,V,!0).to.have.property("length");if(!$&&K==="date"&&z!=="date")throw new P(W+"the argument to above must be a date",void 0,V);else if(!L(Q)&&($||L(Y)))throw new P(W+"the argument to above must be a number",void 0,V);else if(!$&&K!=="date"&&!L(Y)){var B=K==="string"?"'"+Y+"'":Y;throw new P(W+"expected "+B+" to be a number or a date",void 0,V)}if($){var R="length",D;if(K==="map"||K==="set")R="size",D=Y.size;else D=Y.length;this.assert(D>Q,"expected #{this} to have a "+R+" above #{exp} but got #{act}","expected #{this} to not have a "+R+" above #{exp}",Q,D)}else this.assert(Y>Q,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",Q)}F(FQ,"assertAbove");U.addMethod("above",FQ);U.addMethod("gt",FQ);U.addMethod("greaterThan",FQ);function zQ(Q,X){if(X)G(this,"message",X);var Y=G(this,"object"),$=G(this,"doLength"),J=G(this,"message"),W=J?J+": ":"",V=G(this,"ssfi"),K=C(Y).toLowerCase(),z=C(Q).toLowerCase(),B,R=!0;if($&&K!=="map"&&K!=="set")new U(Y,J,V,!0).to.have.property("length");if(!$&&K==="date"&&z!=="date")B=W+"the argument to least must be a date";else if(!L(Q)&&($||L(Y)))B=W+"the argument to least must be a number";else if(!$&&K!=="date"&&!L(Y)){var D=K==="string"?"'"+Y+"'":Y;B=W+"expected "+D+" to be a number or a date"}else R=!1;if(R)throw new P(B,void 0,V);if($){var w="length",N;if(K==="map"||K==="set")w="size",N=Y.size;else N=Y.length;this.assert(N>=Q,"expected #{this} to have a "+w+" at least #{exp} but got #{act}","expected #{this} to have a "+w+" below #{exp}",Q,N)}else this.assert(Y>=Q,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",Q)}F(zQ,"assertLeast");U.addMethod("least",zQ);U.addMethod("gte",zQ);U.addMethod("greaterThanOrEqual",zQ);function BQ(Q,X){if(X)G(this,"message",X);var Y=G(this,"object"),$=G(this,"doLength"),J=G(this,"message"),W=J?J+": ":"",V=G(this,"ssfi"),K=C(Y).toLowerCase(),z=C(Q).toLowerCase(),B,R=!0;if($&&K!=="map"&&K!=="set")new U(Y,J,V,!0).to.have.property("length");if(!$&&K==="date"&&z!=="date")B=W+"the argument to below must be a date";else if(!L(Q)&&($||L(Y)))B=W+"the argument to below must be a number";else if(!$&&K!=="date"&&!L(Y)){var D=K==="string"?"'"+Y+"'":Y;B=W+"expected "+D+" to be a number or a date"}else R=!1;if(R)throw new P(B,void 0,V);if($){var w="length",N;if(K==="map"||K==="set")w="size",N=Y.size;else N=Y.length;this.assert(N<Q,"expected #{this} to have a "+w+" below #{exp} but got #{act}","expected #{this} to not have a "+w+" below #{exp}",Q,N)}else this.assert(Y<Q,"expected #{this} to be below #{exp}","expected #{this} to be at least #{exp}",Q)}F(BQ,"assertBelow");U.addMethod("below",BQ);U.addMethod("lt",BQ);U.addMethod("lessThan",BQ);function RQ(Q,X){if(X)G(this,"message",X);var Y=G(this,"object"),$=G(this,"doLength"),J=G(this,"message"),W=J?J+": ":"",V=G(this,"ssfi"),K=C(Y).toLowerCase(),z=C(Q).toLowerCase(),B,R=!0;if($&&K!=="map"&&K!=="set")new U(Y,J,V,!0).to.have.property("length");if(!$&&K==="date"&&z!=="date")B=W+"the argument to most must be a date";else if(!L(Q)&&($||L(Y)))B=W+"the argument to most must be a number";else if(!$&&K!=="date"&&!L(Y)){var D=K==="string"?"'"+Y+"'":Y;B=W+"expected "+D+" to be a number or a date"}else R=!1;if(R)throw new P(B,void 0,V);if($){var w="length",N;if(K==="map"||K==="set")w="size",N=Y.size;else N=Y.length;this.assert(N<=Q,"expected #{this} to have a "+w+" at most #{exp} but got #{act}","expected #{this} to have a "+w+" above #{exp}",Q,N)}else this.assert(Y<=Q,"expected #{this} to be at most #{exp}","expected #{this} to be above #{exp}",Q)}F(RQ,"assertMost");U.addMethod("most",RQ);U.addMethod("lte",RQ);U.addMethod("lessThanOrEqual",RQ);U.addMethod("within",function(Q,X,Y){if(Y)G(this,"message",Y);var $=G(this,"object"),J=G(this,"doLength"),W=G(this,"message"),V=W?W+": ":"",K=G(this,"ssfi"),z=C($).toLowerCase(),B=C(Q).toLowerCase(),R=C(X).toLowerCase(),D,w=!0,N=B==="date"&&R==="date"?Q.toISOString()+".."+X.toISOString():Q+".."+X;if(J&&z!=="map"&&z!=="set")new U($,W,K,!0).to.have.property("length");if(!J&&z==="date"&&(B!=="date"||R!=="date"))D=V+"the arguments to within must be dates";else if((!L(Q)||!L(X))&&(J||L($)))D=V+"the arguments to within must be numbers";else if(!J&&z!=="date"&&!L($)){var I=z==="string"?"'"+$+"'":$;D=V+"expected "+I+" to be a number or a date"}else w=!1;if(w)throw new P(D,void 0,K);if(J){var T="length",H;if(z==="map"||z==="set")T="size",H=$.size;else H=$.length;this.assert(H>=Q&&H<=X,"expected #{this} to have a "+T+" within "+N,"expected #{this} to not have a "+T+" within "+N)}else this.assert($>=Q&&$<=X,"expected #{this} to be within "+N,"expected #{this} to not be within "+N)});function eQ(Q,X){if(X)G(this,"message",X);var Y=G(this,"object"),$=G(this,"ssfi"),J=G(this,"message");try{var W=Y instanceof Q}catch(K){if(K instanceof TypeError)throw J=J?J+": ":"",new P(J+"The instanceof assertion needs a constructor but "+C(Q)+" was given.",void 0,$);throw K}var V=GQ(Q);if(V==null)V="an unnamed constructor";this.assert(W,"expected #{this} to be an instance of "+V,"expected #{this} to not be an instance of "+V)}F(eQ,"assertInstanceOf");U.addMethod("instanceof",eQ);U.addMethod("instanceOf",eQ);function QX(Q,X,Y){if(Y)G(this,"message",Y);var $=G(this,"nested"),J=G(this,"own"),W=G(this,"message"),V=G(this,"object"),K=G(this,"ssfi"),z=typeof Q;if(W=W?W+": ":"",$){if(z!=="string")throw new P(W+"the argument to property must be a string when using nested syntax",void 0,K)}else if(z!=="string"&&z!=="number"&&z!=="symbol")throw new P(W+"the argument to property must be a string, number, or symbol",void 0,K);if($&&J)throw new P(W+'The "nested" and "own" flags cannot be combined.',void 0,K);if(V===null||V===void 0)throw new P(W+"Target cannot be null or undefined.",void 0,K);var B=G(this,"deep"),R=G(this,"negate"),D=$?uQ(V,Q):null,w=$?D.value:V[Q],N=B?G(this,"eql"):(H,f)=>H===f,I="";if(B)I+="deep ";if(J)I+="own ";if($)I+="nested ";I+="property ";var T;if(J)T=Object.prototype.hasOwnProperty.call(V,Q);else if($)T=D.exists;else T=VQ(V,Q);if(!R||arguments.length===1)this.assert(T,"expected #{this} to have "+I+S(Q),"expected #{this} to not have "+I+S(Q));if(arguments.length>1)this.assert(T&&N(X,w),"expected #{this} to have "+I+S(Q)+" of #{exp}, but got #{act}","expected #{this} to not have "+I+S(Q)+" of #{act}",X,w);G(this,"object",w)}F(QX,"assertProperty");U.addMethod("property",QX);function XX(Q,X,Y){G(this,"own",!0),QX.apply(this,arguments)}F(XX,"assertOwnProperty");U.addMethod("ownProperty",XX);U.addMethod("haveOwnProperty",XX);function YX(Q,X,Y){if(typeof X==="string")Y=X,X=null;if(Y)G(this,"message",Y);var $=G(this,"object"),J=Object.getOwnPropertyDescriptor(Object($),Q),W=G(this,"eql");if(J&&X)this.assert(W(X,J),"expected the own property descriptor for "+S(Q)+" on #{this} to match "+S(X)+", got "+S(J),"expected the own property descriptor for "+S(Q)+" on #{this} to not match "+S(X),X,J,!0);else this.assert(J,"expected #{this} to have an own property descriptor for "+S(Q),"expected #{this} to not have an own property descriptor for "+S(Q));G(this,"object",J)}F(YX,"assertOwnPropertyDescriptor");U.addMethod("ownPropertyDescriptor",YX);U.addMethod("haveOwnPropertyDescriptor",YX);function $X(){G(this,"doLength",!0)}F($X,"assertLengthChain");function JX(Q,X){if(X)G(this,"message",X);var Y=G(this,"object"),$=C(Y).toLowerCase(),J=G(this,"message"),W=G(this,"ssfi"),V="length",K;switch($){case"map":case"set":V="size",K=Y.size;break;default:new U(Y,J,W,!0).to.have.property("length"),K=Y.length}this.assert(K==Q,"expected #{this} to have a "+V+" of #{exp} but got #{act}","expected #{this} to not have a "+V+" of #{act}",Q,K)}F(JX,"assertLength");U.addChainableMethod("length",JX,$X);U.addChainableMethod("lengthOf",JX,$X);function ZX(Q,X){if(X)G(this,"message",X);var Y=G(this,"object");this.assert(Q.exec(Y),"expected #{this} to match "+Q,"expected #{this} not to match "+Q)}F(ZX,"assertMatch");U.addMethod("match",ZX);U.addMethod("matches",ZX);U.addMethod("string",function(Q,X){if(X)G(this,"message",X);var Y=G(this,"object"),$=G(this,"message"),J=G(this,"ssfi");new U(Y,$,J,!0).is.a("string"),this.assert(~Y.indexOf(Q),"expected #{this} to contain "+S(Q),"expected #{this} to not contain "+S(Q))});function UX(Q){var X=G(this,"object"),Y=C(X),$=C(Q),J=G(this,"ssfi"),W=G(this,"deep"),V,K="",z,B=!0,R=G(this,"message");R=R?R+": ":"";var D=R+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if(Y==="Map"||Y==="Set"){if(K=W?"deeply ":"",z=[],X.forEach(function(E,j){z.push(j)}),$!=="Array")Q=Array.prototype.slice.call(arguments)}else{switch(z=nQ(X),$){case"Array":if(arguments.length>1)throw new P(D,void 0,J);break;case"Object":if(arguments.length>1)throw new P(D,void 0,J);Q=Object.keys(Q);break;default:Q=Array.prototype.slice.call(arguments)}Q=Q.map(function(E){return typeof E==="symbol"?E:String(E)})}if(!Q.length)throw new P(R+"keys required",void 0,J);var w=Q.length,N=G(this,"any"),I=G(this,"all"),T=Q,H=W?G(this,"eql"):(E,j)=>E===j;if(!N&&!I)I=!0;if(N)B=T.some(function(E){return z.some(function(j){return H(E,j)})});if(I){if(B=T.every(function(E){return z.some(function(j){return H(E,j)})}),!G(this,"contains"))B=B&&Q.length==z.length}if(w>1){Q=Q.map(function(E){return S(E)});var f=Q.pop();if(I)V=Q.join(", ")+", and "+f;if(N)V=Q.join(", ")+", or "+f}else V=S(Q[0]);V=(w>1?"keys ":"key ")+V,V=(G(this,"contains")?"contain ":"have ")+V,this.assert(B,"expected #{this} to "+K+V,"expected #{this} to not "+K+V,T.slice(0).sort(YQ),z.sort(YQ),!0)}F(UX,"assertKeys");U.addMethod("keys",UX);U.addMethod("key",UX);function qQ(Q,X,Y){if(Y)G(this,"message",Y);var $=G(this,"object"),J=G(this,"ssfi"),W=G(this,"message"),V=G(this,"negate")||!1;if(new U($,W,J,!0).is.a("function"),JQ(Q)||typeof Q==="string")X=Q,Q=null;let K,z=!1;try{$()}catch(E){z=!0,K=E}var B=Q===void 0&&X===void 0,R=Boolean(Q&&X),D=!1,w=!1;if(B||!B&&!V){var N="an error";if(Q instanceof Error)N="#{exp}";else if(Q)N=x.getConstructorName(Q);let E=K;if(K instanceof Error)E=K.toString();else if(typeof K==="string")E=K;else if(K&&(typeof K==="object"||typeof K==="function"))try{E=x.getConstructorName(K)}catch(j){}this.assert(z,"expected #{this} to throw "+N,"expected #{this} to not throw an error but #{act} was thrown",Q&&Q.toString(),E)}if(Q&&K){if(Q instanceof Error){var I=x.compatibleInstance(K,Q);if(I===V)if(R&&V)D=!0;else this.assert(V,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(K&&!V?" but #{act} was thrown":""),Q.toString(),K.toString())}var T=x.compatibleConstructor(K,Q);if(T===V)if(R&&V)D=!0;else this.assert(V,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(K?" but #{act} was thrown":""),Q instanceof Error?Q.toString():Q&&x.getConstructorName(Q),K instanceof Error?K.toString():K&&x.getConstructorName(K))}if(K&&X!==void 0&&X!==null){var H="including";if(JQ(X))H="matching";var f=x.compatibleMessage(K,X);if(f===V)if(R&&V)w=!0;else this.assert(V,"expected #{this} to throw error "+H+" #{exp} but got #{act}","expected #{this} to throw error not "+H+" #{exp}",X,x.getMessage(K))}if(D&&w)this.assert(V,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(K?" but #{act} was thrown":""),Q instanceof Error?Q.toString():Q&&x.getConstructorName(Q),K instanceof Error?K.toString():K&&x.getConstructorName(K));G(this,"object",K)}F(qQ,"assertThrows");U.addMethod("throw",qQ);U.addMethod("throws",qQ);U.addMethod("Throw",qQ);function WX(Q,X){if(X)G(this,"message",X);var Y=G(this,"object"),$=G(this,"itself"),J=typeof Y==="function"&&!$?Y.prototype[Q]:Y[Q];this.assert(typeof J==="function","expected #{this} to respond to "+S(Q),"expected #{this} to not respond to "+S(Q))}F(WX,"respondTo");U.addMethod("respondTo",WX);U.addMethod("respondsTo",WX);U.addProperty("itself",function(){G(this,"itself",!0)});function VX(Q,X){if(X)G(this,"message",X);var Y=G(this,"object"),$=Q(Y);this.assert($,"expected #{this} to satisfy "+h(Q),"expected #{this} to not satisfy"+h(Q),G(this,"negate")?!1:!0,$)}F(VX,"satisfy");U.addMethod("satisfy",VX);U.addMethod("satisfies",VX);function GX(Q,X,Y){if(Y)G(this,"message",Y);var $=G(this,"object"),J=G(this,"message"),W=G(this,"ssfi");new U($,J,W,!0).is.numeric;let V="A `delta` value is required for `closeTo`";if(X==null)throw new P(J?`${J}: ${V}`:V,void 0,W);if(new U(X,J,W,!0).is.numeric,V="A `expected` value is required for `closeTo`",Q==null)throw new P(J?`${J}: ${V}`:V,void 0,W);new U(Q,J,W,!0).is.numeric;let K=F((B)=>B<0n?-B:B,"abs"),z=F((B)=>parseFloat(parseFloat(B).toPrecision(12)),"strip");this.assert(z(K($-Q))<=X,"expected #{this} to be close to "+Q+" +/- "+X,"expected #{this} not to be close to "+Q+" +/- "+X)}F(GX,"closeTo");U.addMethod("closeTo",GX);U.addMethod("approximately",GX);function WY(Q,X,Y,$,J){let W=Array.from(X),V=Array.from(Q);if(!$){if(V.length!==W.length)return!1;W=W.slice()}return V.every(function(K,z){if(J)return Y?Y(K,W[z]):K===W[z];if(!Y){var B=W.indexOf(K);if(B===-1)return!1;if(!$)W.splice(B,1);return!0}return W.some(function(R,D){if(!Y(K,R))return!1;if(!$)W.splice(D,1);return!0})})}F(WY,"isSubsetOf");U.addMethod("members",function(Q,X){if(X)G(this,"message",X);var Y=G(this,"object"),$=G(this,"message"),J=G(this,"ssfi");new U(Y,$,J,!0).to.be.iterable,new U(Q,$,J,!0).to.be.iterable;var W=G(this,"contains"),V=G(this,"ordered"),K,z,B;if(W)K=V?"an ordered superset":"a superset",z="expected #{this} to be "+K+" of #{exp}",B="expected #{this} to not be "+K+" of #{exp}";else K=V?"ordered members":"members",z="expected #{this} to have the same "+K+" as #{exp}",B="expected #{this} to not have the same "+K+" as #{exp}";var R=G(this,"deep")?G(this,"eql"):void 0;this.assert(WY(Q,Y,R,W,V),z,B,Q,Y,!0)});U.addProperty("iterable",function(Q){if(Q)G(this,"message",Q);var X=G(this,"object");this.assert(X!=null&&X[Symbol.iterator],"expected #{this} to be an iterable","expected #{this} to not be an iterable",X)});function VY(Q,X){if(X)G(this,"message",X);var Y=G(this,"object"),$=G(this,"message"),J=G(this,"ssfi"),W=G(this,"contains"),V=G(this,"deep"),K=G(this,"eql");if(new U(Q,$,J,!0).to.be.an("array"),W)this.assert(Q.some(function(z){return Y.indexOf(z)>-1}),"expected #{this} to contain one of #{exp}","expected #{this} to not contain one of #{exp}",Q,Y);else if(V)this.assert(Q.some(function(z){return K(Y,z)}),"expected #{this} to deeply equal one of #{exp}","expected #{this} to deeply equal one of #{exp}",Q,Y);else this.assert(Q.indexOf(Y)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",Q,Y)}F(VY,"oneOf");U.addMethod("oneOf",VY);function KX(Q,X,Y){if(Y)G(this,"message",Y);var $=G(this,"object"),J=G(this,"message"),W=G(this,"ssfi");new U($,J,W,!0).is.a("function");var V;if(!X)new U(Q,J,W,!0).is.a("function"),V=Q();else new U(Q,J,W,!0).to.have.property(X),V=Q[X];$();var K=X===void 0||X===null?Q():Q[X],z=X===void 0||X===null?V:"."+X;G(this,"deltaMsgObj",z),G(this,"initialDeltaValue",V),G(this,"finalDeltaValue",K),G(this,"deltaBehavior","change"),G(this,"realDelta",K!==V),this.assert(V!==K,"expected "+z+" to change","expected "+z+" to not change")}F(KX,"assertChanges");U.addMethod("change",KX);U.addMethod("changes",KX);function FX(Q,X,Y){if(Y)G(this,"message",Y);var $=G(this,"object"),J=G(this,"message"),W=G(this,"ssfi");new U($,J,W,!0).is.a("function");var V;if(!X)new U(Q,J,W,!0).is.a("function"),V=Q();else new U(Q,J,W,!0).to.have.property(X),V=Q[X];new U(V,J,W,!0).is.a("number"),$();var K=X===void 0||X===null?Q():Q[X],z=X===void 0||X===null?V:"."+X;G(this,"deltaMsgObj",z),G(this,"initialDeltaValue",V),G(this,"finalDeltaValue",K),G(this,"deltaBehavior","increase"),G(this,"realDelta",K-V),this.assert(K-V>0,"expected "+z+" to increase","expected "+z+" to not increase")}F(FX,"assertIncreases");U.addMethod("increase",FX);U.addMethod("increases",FX);function zX(Q,X,Y){if(Y)G(this,"message",Y);var $=G(this,"object"),J=G(this,"message"),W=G(this,"ssfi");new U($,J,W,!0).is.a("function");var V;if(!X)new U(Q,J,W,!0).is.a("function"),V=Q();else new U(Q,J,W,!0).to.have.property(X),V=Q[X];new U(V,J,W,!0).is.a("number"),$();var K=X===void 0||X===null?Q():Q[X],z=X===void 0||X===null?V:"."+X;G(this,"deltaMsgObj",z),G(this,"initialDeltaValue",V),G(this,"finalDeltaValue",K),G(this,"deltaBehavior","decrease"),G(this,"realDelta",V-K),this.assert(K-V<0,"expected "+z+" to decrease","expected "+z+" to not decrease")}F(zX,"assertDecreases");U.addMethod("decrease",zX);U.addMethod("decreases",zX);function GY(Q,X){if(X)G(this,"message",X);var Y=G(this,"deltaMsgObj"),$=G(this,"initialDeltaValue"),J=G(this,"finalDeltaValue"),W=G(this,"deltaBehavior"),V=G(this,"realDelta"),K;if(W==="change")K=Math.abs(J-$)===Math.abs(Q);else K=V===Math.abs(Q);this.assert(K,"expected "+Y+" to "+W+" by "+Q,"expected "+Y+" to not "+W+" by "+Q)}F(GY,"assertDelta");U.addMethod("by",GY);U.addProperty("extensible",function(){var Q=G(this,"object"),X=Q===Object(Q)&&Object.isExtensible(Q);this.assert(X,"expected #{this} to be extensible","expected #{this} to not be extensible")});U.addProperty("sealed",function(){var Q=G(this,"object"