hotstaq 0.9.21 → 0.9.23
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/build/src/HotStaq.d.ts +61 -2
- package/build/src/HotStaq.d.ts.map +1 -1
- package/build/src/HotStaq.js +163 -75
- package/build/src/HotStaq.js.map +1 -1
- package/build/src/HotStaqRegisterComponent.d.ts.map +1 -1
- package/build/src/HotStaqRegisterComponent.js +9 -0
- package/build/src/HotStaqRegisterComponent.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build-web/HotStaq.js +2 -2
- package/build-web/HotStaq.min.js +262 -262
- package/package.json +1 -1
- package/src/HotStaq.ts +207 -109
- package/src/HotStaqRegisterComponent.ts +11 -1
package/build-web/HotStaq.min.js
CHANGED
|
@@ -9,75 +9,75 @@ $jscomp.polyfillUnisolated=function(N,Z,ba,L){ba=$jscomp.global;N=N.split(".");f
|
|
|
9
9
|
$jscomp.polyfillIsolated=function(N,Z,ba,L){var J=N.split(".");N=J.length===1;L=J[0];L=!N&&L in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var p=0;p<J.length-1;p++){var v=J[p];if(!(v in L))return;L=L[v]}J=J[J.length-1];ba=$jscomp.IS_SYMBOL_NATIVE&&ba==="es6"?L[J]:null;Z=Z(ba);Z!=null&&(N?$jscomp.defineProperty($jscomp.polyfills,J,{configurable:!0,writable:!0,value:Z}):Z!==ba&&($jscomp.propertyToPolyfillSymbol[J]===void 0&&(ba=Math.random()*1E9>>>0,$jscomp.propertyToPolyfillSymbol[J]=$jscomp.IS_SYMBOL_NATIVE?
|
|
10
10
|
$jscomp.global.Symbol(J):$jscomp.POLYFILL_PREFIX+ba+"$"+J),$jscomp.defineProperty(L,$jscomp.propertyToPolyfillSymbol[J],{configurable:!0,writable:!0,value:Z})))};$jscomp.initSymbol=function(){};$jscomp.iteratorPrototype=function(N){N={next:N};N[Symbol.iterator]=function(){return this};return N};
|
|
11
11
|
$jscomp.polyfill("Object.fromEntries",function(N){return N?N:function(Z){var ba={};if(!(Symbol.iterator in Z))throw new TypeError(""+Z+" is not iterable");Z=Z[Symbol.iterator].call(Z);for(var L=Z.next();!L.done;L=Z.next()){L=L.value;if(Object(L)!==L)throw new TypeError("iterable for fromEntries should yield objects");ba[L[0]]=L[1]}return ba}},"es_2019","es3");var HotStaqWeb;
|
|
12
|
-
(()=>{function N(J){var p=ba[J];if(void 0!==p)return p.exports;p=ba[J]={exports:{}};return Z[J].call(p.exports,p,p.exports,N),p.exports}var Z={[893](J,p,v){function w(E,k){var r,n,l,c,
|
|
13
|
-
C.length;A++)t.indexOf(C[A])<0&&Object.prototype.propertyIsEnumerable.call(m,C[A])&&(D[C[A]]=m[C[A]])}return D}(k,"signal headers onopen onmessage onclose onerror openWhenHidden fetch".split(" "));return new Promise((m,t)=>{function D(){K.abort();document.hidden||A()}function C(){document.removeEventListener("visibilitychange",D);window.clearTimeout(M);K.abort()}async function A(){var
|
|
14
|
-
await async function(q,e){q=q.getReader();for(var y;!(y=await q.read()).done;)e(y.value)}(
|
|
15
|
-
e,y){var B={data:"",event:"",id:"",retry:void 0},G=new TextDecoder;return function(F,
|
|
16
|
-
null!==(
|
|
12
|
+
(()=>{function N(J){var p=ba[J];if(void 0!==p)return p.exports;p=ba[J]={exports:{}};return Z[J].call(p.exports,p,p.exports,N),p.exports}var Z={[893](J,p,v){function w(E,k){var r,n,l,c,h,a,d,u;({signal:r,headers:n,onopen:l,onmessage:c,onclose:h,onerror:a,openWhenHidden:d,fetch:u}=k);var b=function(m,t){var D={},C;for(C in m)Object.prototype.hasOwnProperty.call(m,C)&&t.indexOf(C)<0&&(D[C]=m[C]);if(null!=m&&"function"==typeof Object.getOwnPropertySymbols){var A=0;for(C=Object.getOwnPropertySymbols(m);A<
|
|
13
|
+
C.length;A++)t.indexOf(C[A])<0&&Object.prototype.propertyIsEnumerable.call(m,C[A])&&(D[C[A]]=m[C[A]])}return D}(k,"signal headers onopen onmessage onclose onerror openWhenHidden fetch".split(" "));return new Promise((m,t)=>{function D(){K.abort();document.hidden||A()}function C(){document.removeEventListener("visibilitychange",D);window.clearTimeout(M);K.abort()}async function A(){var f;K=new AbortController;try{let g=await W(E,Object.assign(Object.assign({},b),{headers:H,signal:K.signal}));await z(g);
|
|
14
|
+
await async function(q,e){q=q.getReader();for(var y;!(y=await q.read()).done;)e(y.value)}(g.body,function(q){var e,y,B,G=!1;return function(F){if(void 0===e)e=F,y=0,B=-1;else{var T=e,S=new Uint8Array(T.length+F.length);e=(S.set(T),S.set(F,T.length),S)}F=e.length;for(T=0;y<F;){G&&(10===e[y]&&(T=++y),G=!1);for(S=-1;y<F&&-1===S;++y)switch(e[y]){case 58:-1===B&&(B=y-T);break;case 13:G=!0;case 10:S=y}if(-1===S)break;q(e.subarray(T,S),B);T=y;B=-1}T===F?e=void 0:0!==T&&(e=e.subarray(T),y-=T)}}(function(q,
|
|
15
|
+
e,y){var B={data:"",event:"",id:"",retry:void 0},G=new TextDecoder;return function(F,T){if(0===F.length)null==y||y(B),B={data:"",event:"",id:"",retry:void 0};else if(T>0){let R=G.decode(F.subarray(0,T));F=G.decode(F.subarray(T+(32===F[T+1]?2:1)));switch(R){case "data":B.data=B.data?B.data+"\n"+F:F;break;case "event":B.event=F;break;case "id":(S=B.id=F)?H["last-event-id"]=S:delete H["last-event-id"];break;case "retry":S=parseInt(F,10),isNaN(S)||(P=B.retry=S)}}var S}}(0,0,c)));null==h||h();C();m()}catch(g){if(!K.signal.aborted)try{let q=
|
|
16
|
+
null!==(f=null==a?void 0:a(g))&&void 0!==f?f:P;window.clearTimeout(M);M=window.setTimeout(A,q)}catch(q){C(),t(q)}}}var H=Object.assign({},n),K;H.accept||(H.accept="text/event-stream");d||document.addEventListener("visibilitychange",D);var P=1E3,M=0;null==r||r.addEventListener("abort",()=>{C();m()});var W=null!=u?u:window.fetch,z=null!=l?l:x;A()})}function x(E){E=E.headers.get("content-type");if(null==E||!E.startsWith("text/event-stream"))throw Error(`Expected content-type to be text/event-stream, Actual: ${E}`);
|
|
17
17
|
}v.r(p);v.d(p,{EventStreamContentType:()=>"text/event-stream",fetchEventSource:()=>w})},[7833](J,p,v){p.formatArgs=function(x){if(x[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+x[0]+(this.useColors?"%c ":" ")+"+"+J.exports.humanize(this.diff),this.useColors){var E="color: "+this.color;x.splice(1,0,E,"color: inherit");var k=0,r=0;x[0].replace(/%[a-zA-Z%]/g,n=>{"%%"!==n&&(k++,"%c"===n&&(r=k))});x.splice(r,0,E)}};p.save=function(x){try{x?p.storage.setItem("debug",x):p.storage.removeItem("debug")}catch(E){}};
|
|
18
18
|
p.load=function(){try{var x=p.storage.getItem("debug")||p.storage.getItem("DEBUG")}catch(E){}return!x&&"undefined"!=typeof process&&"env"in process&&(x=process.env.DEBUG),x};p.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;var x;return"undefined"!=typeof document&&document.documentElement&&
|
|
19
19
|
document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(x=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(x[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)};a:{try{var w=localStorage;break a}catch(x){}w=void 0}p.storage=
|
|
20
20
|
w;p.destroy=(()=>{var x=!1;return()=>{x||(x=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();p.colors="#0000CC #0000FF #0033CC #0033FF #0066CC #0066FF #0099CC #0099FF #00CC00 #00CC33 #00CC66 #00CC99 #00CCCC #00CCFF #3300CC #3300FF #3333CC #3333FF #3366CC #3366FF #3399CC #3399FF #33CC00 #33CC33 #33CC66 #33CC99 #33CCCC #33CCFF #6600CC #6600FF #6633CC #6633FF #66CC00 #66CC33 #9900CC #9900FF #9933CC #9933FF #99CC00 #99CC33 #CC0000 #CC0033 #CC0066 #CC0099 #CC00CC #CC00FF #CC3300 #CC3333 #CC3366 #CC3399 #CC33CC #CC33FF #CC6600 #CC6633 #CC9900 #CC9933 #CCCC00 #CCCC33 #FF0000 #FF0033 #FF0066 #FF0099 #FF00CC #FF00FF #FF3300 #FF3333 #FF3366 #FF3399 #FF33CC #FF33FF #FF6600 #FF6633 #FF9900 #FF9933 #FFCC00 #FFCC33".split(" ");
|
|
21
21
|
p.log=console.debug||console.log||(()=>{});J.exports=v(736)(p);({formatters:v}=J.exports);v.j=function(x){try{return JSON.stringify(x)}catch(E){return"[UnexpectedJSONParseError]: "+E.message}}},[736](J,p,v){J.exports=function(w){function x(r){function n(...d){if(n.enabled){var u=Number(new Date);n.diff=u-(l||u);n.prev=l;l=n.curr=u;d[0]=x.coerce(d[0]);"string"!=typeof d[0]&&d.unshift("%O");var b=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(m,t)=>{if("%%"===m)return"%";b++;t=x.formatters[t];"function"==typeof t&&
|
|
22
|
-
(m=t.call(n,d[b]),d.splice(b,1),b--);return m});x.formatArgs.call(n,d);(n.log||x.log).apply(n,d)}}var l,c,
|
|
23
|
-
n){for(var l=0,c=0,
|
|
22
|
+
(m=t.call(n,d[b]),d.splice(b,1),b--);return m});x.formatArgs.call(n,d);(n.log||x.log).apply(n,d)}}var l,c,h,a=null;return n.namespace=r,n.useColors=x.useColors(),n.color=x.selectColor(r),n.extend=E,n.destroy=x.destroy,Object.defineProperty(n,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(c!==x.namespaces&&(c=x.namespaces,h=x.enabled(r)),h),set:d=>{a=d}}),"function"==typeof x.init&&x.init(n),n}function E(r,n){r=x(this.namespace+(void 0===n?":":n)+r);return r.log=this.log,r}function k(r,
|
|
23
|
+
n){for(var l=0,c=0,h=-1,a=0;l<r.length;)if(c<n.length&&(n[c]===r[l]||"*"===n[c]))"*"===n[c]?(h=c,a=l,c++):(l++,c++);else{if(-1===h)return!1;c=h+1;a++;l=a}for(;c<n.length&&"*"===n[c];)c++;return c===n.length}return x.debug=x,x.default=x,x.coerce=function(r){return r instanceof Error?r.stack||r.message:r},x.disable=function(){var r=[...x.names,...x.skips.map(n=>"-"+n)].join();return x.enable(""),r},x.enable=function(r){x.save(r);x.namespaces=r;x.names=[];x.skips=[];r=("string"==typeof r?r:"").trim().replace(/\s+/g,
|
|
24
24
|
",").split(",").filter(Boolean);for(let n of r)"-"===n[0]?x.skips.push(n.slice(1)):x.names.push(n)},x.enabled=function(r){for(let n of x.skips)if(k(r,n))return!1;for(let n of x.names)if(k(r,n))return!0;return!1},x.humanize=v(6585),x.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(w).forEach(r=>{x[r]=w[r]}),x.names=[],x.skips=[],x.formatters={},x.selectColor=function(r){var n=
|
|
25
25
|
0;for(let l=0;l<r.length;l++)n=(n<<5)-n+r.charCodeAt(l),n|=0;return x.colors[Math.abs(n)%x.colors.length]},x.enable(x.load()),x}},[5454](J){function p(ia){return function(fa){fa instanceof RegExp&&(fa.lastIndex=0);for(var ca=arguments.length,Y=Array(ca>1?ca-1:0),aa=1;aa<ca;aa++)Y[aa-1]=arguments[aa];return d(ia,fa,Y)}}function v(ia,fa){var ca=arguments.length>2&&void 0!==arguments[2]?arguments[2]:A;k&&k(ia,null);for(var Y=fa.length;Y--;){let aa=fa[Y];if("string"==typeof aa){let ta=ca(aa);ta!==aa&&
|
|
26
26
|
(r(fa)||(fa[Y]=ta),aa=ta)}ia[aa]=!0}return ia}function w(ia){var fa=a(null);for(let [ca,Y]of E(ia))if(z(ia,ca))if(Array.isArray(Y)){for(let aa=0;aa<Y.length;aa++)z(Y,aa)||(Y[aa]=null);fa[ca]=Y}else Y&&"object"==typeof Y&&Y.constructor===Object?fa[ca]=w(Y):fa[ca]=Y;return fa}function x(ia,fa){for(;null!==ia;){let ca=l(ia,fa);if(ca){if(ca.get)return p(ca.get);if("function"==typeof ca.value)return p(ca.value)}ia=n(ia)}return function(){return null}}var {entries:E,setPrototypeOf:k,isFrozen:r,getPrototypeOf:n,
|
|
27
|
-
getOwnPropertyDescriptor:l}=Object,{freeze:c,seal:
|
|
28
|
-
t=p(Array.prototype.pop),D=p(Array.prototype.push),C=p(Array.prototype.splice),A=p(String.prototype.toLowerCase),H=p(String.prototype.toString),K=p(String.prototype.match),P=p(String.prototype.replace),M=p(String.prototype.indexOf),
|
|
27
|
+
getOwnPropertyDescriptor:l}=Object,{freeze:c,seal:h,create:a}=Object,{apply:d,construct:u}="undefined"!=typeof Reflect&&Reflect;c||(c=function(ia){return ia});h||(h=function(ia){return ia});d||(d=function(ia,fa){for(var ca=arguments.length,Y=Array(ca>2?ca-2:0),aa=2;aa<ca;aa++)Y[aa-2]=arguments[aa];return ia.apply(fa,Y)});u||(u=function(ia){for(var fa=arguments.length,ca=Array(fa>1?fa-1:0),Y=1;Y<fa;Y++)ca[Y-1]=arguments[Y];return new ia(...ca)});var b=p(Array.prototype.forEach),m=p(Array.prototype.lastIndexOf),
|
|
28
|
+
t=p(Array.prototype.pop),D=p(Array.prototype.push),C=p(Array.prototype.splice),A=p(String.prototype.toLowerCase),H=p(String.prototype.toString),K=p(String.prototype.match),P=p(String.prototype.replace),M=p(String.prototype.indexOf),W=p(String.prototype.trim),z=p(Object.prototype.hasOwnProperty),f=p(RegExp.prototype.test),g=(q=TypeError,function(){for(var ia=arguments.length,fa=Array(ia),ca=0;ca<ia;ca++)fa[ca]=arguments[ca];return u(q,fa)}),q,e=c("a abbr acronym address area article aside audio b bdi bdo big blink blockquote body br button canvas caption center cite code col colgroup content data datalist dd decorator del details dfn dialog dir div dl dt element em fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i img input ins kbd label legend li main map mark marquee menu menuitem meter nav nobr ol optgroup option output p picture pre progress q rp rt ruby s samp search section select shadow slot small source spacer span strike strong style sub summary sup table tbody td template textarea tfoot th thead time tr track tt u ul var video wbr".split(" ")),
|
|
29
29
|
y=c("svg a altglyph altglyphdef altglyphitem animatecolor animatemotion animatetransform circle clippath defs desc ellipse enterkeyhint exportparts filter font g glyph glyphref hkern image inputmode line lineargradient marker mask metadata mpath part path pattern polygon polyline radialgradient rect stop style switch symbol text textpath title tref tspan view vkern".split(" ")),B=c("feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence".split(" ")),
|
|
30
|
-
G=c("animate color-profile cursor discard font-face font-face-format font-face-name font-face-src font-face-uri foreignobject hatch hatchpath mesh meshgradient meshpatch meshrow missing-glyph script set solidcolor unknown use".split(" ")),F=c("math menclose merror mfenced mfrac mglyph mi mlabeledtr mmultiscripts mn mo mover mpadded mphantom mroot mrow ms mspace msqrt mstyle msub msup msubsup mtable mtd mtext mtr munder munderover mprescripts".split(" ")),
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
G=c("animate color-profile cursor discard font-face font-face-format font-face-name font-face-src font-face-uri foreignobject hatch hatchpath mesh meshgradient meshpatch meshrow missing-glyph script set solidcolor unknown use".split(" ")),F=c("math menclose merror mfenced mfrac mglyph mi mlabeledtr mmultiscripts mn mo mover mpadded mphantom mroot mrow ms mspace msqrt mstyle msub msup msubsup mtable mtd mtext mtr munder munderover mprescripts".split(" ")),T=c("maction maligngroup malignmark mlongdiv mscarries mscarry msgroup mstack msline msrow semantics annotation annotation-xml mprescripts none".split(" ")),
|
|
31
|
+
S=c(["#text"]),R=c("accept action align alt autocapitalize autocomplete autopictureinpicture autoplay background bgcolor border capture cellpadding cellspacing checked cite class clear color cols colspan controls controlslist coords crossorigin datetime decoding default dir disabled disablepictureinpicture disableremoteplayback download draggable enctype enterkeyhint exportparts face for headers height hidden high href hreflang id inert inputmode integrity ismap kind label lang list loading loop low max maxlength media method min minlength multiple muted name nonce noshade novalidate nowrap open optimum part pattern placeholder playsinline popover popovertarget popovertargetaction poster preload pubdate radiogroup readonly rel required rev reversed role rows rowspan spellcheck scope selected shape size sizes slot span srclang start src srcset step style summary tabindex title translate type usemap valign value width wrap xmlns slot".split(" ")),
|
|
32
|
+
X=c("accent-height accumulate additive alignment-baseline amplitude ascent attributename attributetype azimuth basefrequency baseline-shift begin bias by class clip clippathunits clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering cx cy d dx dy diffuseconstant direction display divisor dur edgemode elevation end exponent fill fill-opacity fill-rule filter filterunits flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight fx fy g1 g2 glyph-name glyphref gradientunits gradienttransform height href id image-rendering in in2 intercept k k1 k2 k3 k4 kerning keypoints keysplines keytimes lang lengthadjust letter-spacing kernelmatrix kernelunitlength lighting-color local marker-end marker-mid marker-start markerheight markerunits markerwidth maskcontentunits maskunits max mask mask-type media method mode min name numoctaves offset operator opacity order orient orientation origin overflow paint-order path pathlength patterncontentunits patterntransform patternunits points preservealpha preserveaspectratio primitiveunits r rx ry radius refx refy repeatcount repeatdur restart result rotate scale seed shape-rendering slope specularconstant specularexponent spreadmethod startoffset stddeviation stitchtiles stop-color stop-opacity stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke stroke-width style surfacescale systemlanguage tabindex tablevalues targetx targety transform transform-origin text-anchor text-decoration text-rendering textlength type u1 u2 unicode values viewbox visibility version vert-adv-y vert-origin-x vert-origin-y width word-spacing wrap writing-mode xchannelselector ychannelselector x x1 x2 xmlns y y1 y2 z zoomandpan".split(" ")),
|
|
33
33
|
da=c("accent accentunder align bevelled close columnsalign columnlines columnspan denomalign depth dir display displaystyle encoding fence frame height href id largeop length linethickness lspace lquote mathbackground mathcolor mathsize mathvariant maxsize minsize movablelimits notation numalign open rowalign rowlines rowspacing rowspan rspace rquote scriptlevel scriptminsize scriptsizemultiplier selection separator separators stretchy subscriptshift supscriptshift symmetric voffset width xmlns".split(" ")),
|
|
34
|
-
ha=c(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ea=
|
|
35
|
-
ARIA_ATTR:za,ATTR_WHITESPACE:wa,CUSTOM_ELEMENT:Pb,DATA_ATTR:Ea,DOCTYPE_NAME:Aa,ERB_EXPR:Qa,IS_ALLOWED_URI:la,IS_SCRIPT_OR_DATA:sa,MUSTACHE_EXPR:ea,TMPLIT_EXPR:Da});ea=function fa(){function ca(I,O,
|
|
34
|
+
ha=c(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ea=h(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Qa=h(/<%[\w\W]*|[\w\W]*%>/gm),Da=h(/\$\{[\w\W]*/gm),Ea=h(/^data-[\-\w.\u00B7-\uFFFF]+$/),za=h(/^aria-[\-\w]+$/),la=h(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sa=h(/^(?:\w+script|data):/i),wa=h(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Aa=h(/^html$/i),Pb=h(/^[a-z][.\w]*(-[.\w]+)+$/i),ob=Object.freeze({__proto__:null,
|
|
35
|
+
ARIA_ATTR:za,ATTR_WHITESPACE:wa,CUSTOM_ELEMENT:Pb,DATA_ATTR:Ea,DOCTYPE_NAME:Aa,ERB_EXPR:Qa,IS_ALLOWED_URI:la,IS_SCRIPT_OR_DATA:sa,MUSTACHE_EXPR:ea,TMPLIT_EXPR:Da});ea=function fa(){function ca(I,O,Q){b(I,U=>{U.call(aa,O,Q,Fa)})}var Y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window,aa=I=>fa(I);if(aa.version="3.3.3",aa.removed=[],!Y||!Y.document||9!==Y.document.nodeType||!Y.Element)return aa.isSupported=!1,aa;var {document:ta}=Y,Za=ta,Qb=Za.currentScript,
|
|
36
36
|
{DocumentFragment:pb,HTMLTemplateElement:Rb,Node:$a,Element:qb,NodeFilter:La,NamedNodeMap:Sb=Y.NamedNodeMap||Y.MozNamedAttrMap,HTMLFormElement:Tb,DOMParser:Ub,trustedTypes:Ra}=Y;Y=qb.prototype;var Vb=x(Y,"cloneNode"),Wb=x(Y,"remove"),Xb=x(Y,"nextSibling"),Yb=x(Y,"childNodes"),Sa=x(Y,"parentNode");"function"==typeof Rb&&(Y=ta.createElement("template"),Y.content&&Y.content.ownerDocument&&(ta=Y.content.ownerDocument));var qa,Ma="",{implementation:ab,createNodeIterator:Zb,createDocumentFragment:$b,getElementsByTagName:ac}=
|
|
37
37
|
ta,{importNode:bc}=Za,ra={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};aa.isSupported="function"==typeof E&&"function"==typeof Sa&&ab&&void 0!==ab.createHTMLDocument;var {MUSTACHE_EXPR:bb,ERB_EXPR:cb,TMPLIT_EXPR:db,DATA_ATTR:cc,ARIA_ATTR:dc,IS_SCRIPT_OR_DATA:ec,ATTR_WHITESPACE:rb,CUSTOM_ELEMENT:sb}=ob,{IS_ALLOWED_URI:tb}=
|
|
38
|
-
ob,na=null,ub=v({},[...e,...y,...B,...F,...
|
|
38
|
+
ob,na=null,ub=v({},[...e,...y,...B,...F,...S]),oa=null,vb=v({},[...R,...X,...da,...ha]),ka=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Na=null,Ta=null,xa=Object.seal(a(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,
|
|
39
39
|
value:null}})),wb=!0,eb=!0,xb=!1,yb=!0,Ga=!1,Ua=!0,Ba=!1,fb=!1,gb=!1,Ha=!1,Va=!1,Wa=!1,zb=!0,Ab=!1,hb=!0,Oa=!1,Ia={},va=null,ib=v({},"annotation-xml audio colgroup desc foreignobject head iframe math mi mn mo ms mtext noembed noframes noscript plaintext script style svg template thead title video xmp".split(" ")),Bb=null,Cb=v({},"audio video img source image track".split(" ")),jb=null,Db=v({},"alt class for id label name pattern placeholder role summary title value style xmlns".split(" ")),Ja="http://www.w3.org/1999/xhtml",
|
|
40
40
|
kb=!1,lb=null,fc=v({},["http://www.w3.org/1998/Math/MathML","http://www.w3.org/2000/svg","http://www.w3.org/1999/xhtml"],H),Xa=v({},["mi","mo","mn","ms","mtext"]),Ya=v({},["annotation-xml"]),hc=v({},["title","style","font","a","script"]),Pa=null,ic=["application/xhtml+xml","text/html"],ma=null,Fa=null,jc=ta.createElement("form"),Eb=function(I){return I instanceof RegExp||I instanceof Function},mb=function(){var I=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Fa||Fa!==I){if(I&&"object"==
|
|
41
41
|
typeof I||(I={}),I=w(I),Pa=-1===ic.indexOf(I.PARSER_MEDIA_TYPE)?"text/html":I.PARSER_MEDIA_TYPE,ma="application/xhtml+xml"===Pa?H:A,na=z(I,"ALLOWED_TAGS")?v({},I.ALLOWED_TAGS,ma):ub,oa=z(I,"ALLOWED_ATTR")?v({},I.ALLOWED_ATTR,ma):vb,lb=z(I,"ALLOWED_NAMESPACES")?v({},I.ALLOWED_NAMESPACES,H):fc,jb=z(I,"ADD_URI_SAFE_ATTR")?v(w(Db),I.ADD_URI_SAFE_ATTR,ma):Db,Bb=z(I,"ADD_DATA_URI_TAGS")?v(w(Cb),I.ADD_DATA_URI_TAGS,ma):Cb,va=z(I,"FORBID_CONTENTS")?v({},I.FORBID_CONTENTS,ma):ib,Na=z(I,"FORBID_TAGS")?v({},
|
|
42
42
|
I.FORBID_TAGS,ma):w({}),Ta=z(I,"FORBID_ATTR")?v({},I.FORBID_ATTR,ma):w({}),Ia=!!z(I,"USE_PROFILES")&&I.USE_PROFILES,wb=!1!==I.ALLOW_ARIA_ATTR,eb=!1!==I.ALLOW_DATA_ATTR,xb=I.ALLOW_UNKNOWN_PROTOCOLS||!1,yb=!1!==I.ALLOW_SELF_CLOSE_IN_ATTR,Ga=I.SAFE_FOR_TEMPLATES||!1,Ua=!1!==I.SAFE_FOR_XML,Ba=I.WHOLE_DOCUMENT||!1,Ha=I.RETURN_DOM||!1,Va=I.RETURN_DOM_FRAGMENT||!1,Wa=I.RETURN_TRUSTED_TYPE||!1,gb=I.FORCE_BODY||!1,zb=!1!==I.SANITIZE_DOM,Ab=I.SANITIZE_NAMED_PROPS||!1,hb=!1!==I.KEEP_CONTENT,Oa=I.IN_PLACE||!1,
|
|
43
43
|
tb=I.ALLOWED_URI_REGEXP||la,Ja=I.NAMESPACE||"http://www.w3.org/1999/xhtml",Xa=I.MATHML_TEXT_INTEGRATION_POINTS||Xa,Ya=I.HTML_INTEGRATION_POINTS||Ya,ka=I.CUSTOM_ELEMENT_HANDLING||{},I.CUSTOM_ELEMENT_HANDLING&&Eb(I.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ka.tagNameCheck=I.CUSTOM_ELEMENT_HANDLING.tagNameCheck),I.CUSTOM_ELEMENT_HANDLING&&Eb(I.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ka.attributeNameCheck=I.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),I.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof I.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&
|
|
44
|
-
(ka.allowCustomizedBuiltInElements=I.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ga&&(eb=!1),Va&&(Ha=!0),Ia&&(na=v({},
|
|
45
|
-
("function"==typeof I.ADD_ATTR?xa.attributeCheck=I.ADD_ATTR:(oa===vb&&(oa=w(oa)),v(oa,I.ADD_ATTR,ma))),I.ADD_URI_SAFE_ATTR&&v(jb,I.ADD_URI_SAFE_ATTR,ma),I.FORBID_CONTENTS&&(va===ib&&(va=w(va)),v(va,I.FORBID_CONTENTS,ma)),I.ADD_FORBID_CONTENTS&&(va===ib&&(va=w(va)),v(va,I.ADD_FORBID_CONTENTS,ma)),hb&&(na["#text"]=!0),Ba&&v(na,["html","head","body"]),na.table&&(v(na,["tbody"]),delete Na.tbody),I.TRUSTED_TYPES_POLICY){if("function"!=typeof I.TRUSTED_TYPES_POLICY.createHTML)throw
|
|
46
|
-
if("function"!=typeof I.TRUSTED_TYPES_POLICY.createScriptURL)throw
|
|
47
|
-
|
|
48
|
-
gb?I="<remove></remove>"+I:
|
|
44
|
+
(ka.allowCustomizedBuiltInElements=I.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ga&&(eb=!1),Va&&(Ha=!0),Ia&&(na=v({},S),oa=a(null),!0===Ia.html&&(v(na,e),v(oa,R)),!0===Ia.svg&&(v(na,y),v(oa,X),v(oa,ha)),!0===Ia.svgFilters&&(v(na,B),v(oa,X),v(oa,ha)),!0===Ia.mathMl&&(v(na,F),v(oa,da),v(oa,ha))),z(I,"ADD_TAGS")||(xa.tagCheck=null),z(I,"ADD_ATTR")||(xa.attributeCheck=null),I.ADD_TAGS&&("function"==typeof I.ADD_TAGS?xa.tagCheck=I.ADD_TAGS:(na===ub&&(na=w(na)),v(na,I.ADD_TAGS,ma))),I.ADD_ATTR&&
|
|
45
|
+
("function"==typeof I.ADD_ATTR?xa.attributeCheck=I.ADD_ATTR:(oa===vb&&(oa=w(oa)),v(oa,I.ADD_ATTR,ma))),I.ADD_URI_SAFE_ATTR&&v(jb,I.ADD_URI_SAFE_ATTR,ma),I.FORBID_CONTENTS&&(va===ib&&(va=w(va)),v(va,I.FORBID_CONTENTS,ma)),I.ADD_FORBID_CONTENTS&&(va===ib&&(va=w(va)),v(va,I.ADD_FORBID_CONTENTS,ma)),hb&&(na["#text"]=!0),Ba&&v(na,["html","head","body"]),na.table&&(v(na,["tbody"]),delete Na.tbody),I.TRUSTED_TYPES_POLICY){if("function"!=typeof I.TRUSTED_TYPES_POLICY.createHTML)throw g('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
46
|
+
if("function"!=typeof I.TRUSTED_TYPES_POLICY.createScriptURL)throw g('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');qa=I.TRUSTED_TYPES_POLICY;Ma=qa.createHTML("")}else void 0===qa&&(qa=function(O,Q){if("object"!=typeof O||"function"!=typeof O.createPolicy)return null;var U=null;Q&&Q.hasAttribute("data-tt-policy-suffix")&&(U=Q.getAttribute("data-tt-policy-suffix"));Q="dompurify"+(U?"#"+U:"");try{return O.createPolicy(Q,{createHTML:V=>V,createScriptURL:V=>V})}catch(V){return console.warn("TrustedTypes policy "+
|
|
47
|
+
Q+" could not be created."),null}}(Ra,Qb)),null!==qa&&"string"==typeof Ma&&(Ma=qa.createHTML(""));c&&c(I);Fa=I}},Fb=v({},[...y,...B,...G]),Gb=v({},[...F,...T]),ya=function(I){D(aa.removed,{element:I});try{Sa(I).removeChild(I)}catch(O){Wb(I)}},Ca=function(I,O){try{D(aa.removed,{attribute:O.getAttributeNode(I),from:O})}catch(Q){D(aa.removed,{attribute:null,from:O})}if(O.removeAttribute(I),"is"===I)if(Ha||Va)try{ya(O)}catch(Q){}else try{O.setAttribute(I,"")}catch(Q){}},Hb=function(I){var O=null,Q=null;
|
|
48
|
+
gb?I="<remove></remove>"+I:Q=(Q=K(I,/^[\r\n\t ]+/))&&Q[0];"application/xhtml+xml"===Pa&&Ja==="http://www.w3.org/1999/xhtml"&&(I='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+I+"</body></html>");var U=qa?qa.createHTML(I):I;if(Ja==="http://www.w3.org/1999/xhtml")try{O=(new Ub).parseFromString(U,Pa)}catch(V){}if(!O||!O.documentElement){O=ab.createDocument(Ja,"template",null);try{O.documentElement.innerHTML=kb?Ma:U}catch(V){}}U=O.body||O.documentElement;return I&&Q&&U.insertBefore(ta.createTextNode(Q),
|
|
49
49
|
U.childNodes[0]||null),Ja==="http://www.w3.org/1999/xhtml"?ac.call(O,Ba?"html":"body")[0]:Ba?O.documentElement:U},Ib=function(I){return Zb.call(I.ownerDocument||I,I,La.SHOW_ELEMENT|La.SHOW_COMMENT|La.SHOW_TEXT|La.SHOW_PROCESSING_INSTRUCTION|La.SHOW_CDATA_SECTION,null)},nb=function(I){return I instanceof Tb&&("string"!=typeof I.nodeName||"string"!=typeof I.textContent||"function"!=typeof I.removeChild||!(I.attributes instanceof Sb)||"function"!=typeof I.removeAttribute||"function"!=typeof I.setAttribute||
|
|
50
|
-
"string"!=typeof I.namespaceURI||"function"!=typeof I.insertBefore||"function"!=typeof I.hasChildNodes)},Jb=function(I){return"function"==typeof $a&&I instanceof $a},Kb=function(I){var O=null;if(ca(ra.beforeSanitizeElements,I,null),nb(I))return ya(I),!0;var
|
|
51
|
-
!0;if(!(xa.tagCheck instanceof Function&&xa.tagCheck(
|
|
50
|
+
"string"!=typeof I.namespaceURI||"function"!=typeof I.insertBefore||"function"!=typeof I.hasChildNodes)},Jb=function(I){return"function"==typeof $a&&I instanceof $a},Kb=function(I){var O=null;if(ca(ra.beforeSanitizeElements,I,null),nb(I))return ya(I),!0;var Q=ma(I.nodeName);if((ca(ra.uponSanitizeElement,I,{tagName:Q,allowedTags:na}),Ua&&I.hasChildNodes()&&!Jb(I.firstElementChild)&&f(/<[/\w!]/g,I.innerHTML)&&f(/<[/\w!]/g,I.textContent))||7===I.nodeType||Ua&&8===I.nodeType&&f(/<[/\w]/g,I.data))return ya(I),
|
|
51
|
+
!0;if(!(xa.tagCheck instanceof Function&&xa.tagCheck(Q)||na[Q]&&!Na[Q])){if(!Na[Q]&&"annotation-xml"!==Q&&K(Q,sb)&&(ka.tagNameCheck instanceof RegExp&&f(ka.tagNameCheck,Q)||ka.tagNameCheck instanceof Function&&ka.tagNameCheck(Q)))return!1;if(hb&&!va[Q]){Q=Sa(I)||I.parentNode;let U=Yb(I)||I.childNodes;if(U&&Q)for(let V=U.length-1;V>=0;--V){let ja=Vb(U[V],!0);ja.__removalCount=(I.__removalCount||0)+1;Q.insertBefore(ja,Xb(I))}}return ya(I),!0}return I instanceof qb&&!function(U){var V=Sa(U);V&&V.tagName||
|
|
52
52
|
(V={namespaceURI:Ja,tagName:"template"});var ja=A(U.tagName),ua=A(V.tagName);return!!lb[U.namespaceURI]&&(U.namespaceURI==="http://www.w3.org/2000/svg"?V.namespaceURI==="http://www.w3.org/1999/xhtml"?"svg"===ja:V.namespaceURI==="http://www.w3.org/1998/Math/MathML"?"svg"===ja&&("annotation-xml"===ua||Xa[ua]):!!Fb[ja]:U.namespaceURI==="http://www.w3.org/1998/Math/MathML"?V.namespaceURI==="http://www.w3.org/1999/xhtml"?"math"===ja:V.namespaceURI==="http://www.w3.org/2000/svg"?"math"===ja&&Ya[ua]:!!Gb[ja]:
|
|
53
|
-
U.namespaceURI==="http://www.w3.org/1999/xhtml"?!(V.namespaceURI==="http://www.w3.org/2000/svg"&&!Ya[ua])&&!(V.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&!Xa[ua])&&!Gb[ja]&&(hc[ja]||!Fb[ja]):!("application/xhtml+xml"!==Pa||!lb[U.namespaceURI]))}(I)?(ya(I),!0):"noscript"!==
|
|
54
|
-
O)),ca(ra.afterSanitizeElements,I,null),!1):(ya(I),!0)},Lb=function(I,O,
|
|
55
|
-
Function&&ka.attributeNameCheck(O,I))||"is"===O&&ka.allowCustomizedBuiltInElements&&(ka.tagNameCheck instanceof RegExp&&
|
|
56
|
-
allowedAttributes:oa,forceKeepAttr:void 0},U=O.length;U--;){let {name:V,namespaceURI:ja,value:ua}=O[U],Ka=ma(V),pa="value"===V?ua:
|
|
57
|
-
if(!
|
|
58
|
-
I,null)}},kc=function
|
|
59
|
-
}if(!aa.isSupported)return O;if(fb||mb(
|
|
60
|
-
for(
|
|
61
|
-
ua=>{ja=P(ja,ua," ")}),qa&&Wa?qa.createHTML(ja):ja},aa.setConfig=function(){mb(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});fb=!0},aa.clearConfig=function(){Fa=null;fb=!1},aa.isValidAttribute=function(O,
|
|
53
|
+
U.namespaceURI==="http://www.w3.org/1999/xhtml"?!(V.namespaceURI==="http://www.w3.org/2000/svg"&&!Ya[ua])&&!(V.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&!Xa[ua])&&!Gb[ja]&&(hc[ja]||!Fb[ja]):!("application/xhtml+xml"!==Pa||!lb[U.namespaceURI]))}(I)?(ya(I),!0):"noscript"!==Q&&"noembed"!==Q&&"noframes"!==Q||!f(/<\/no(script|embed|frames)/i,I.innerHTML)?(Ga&&3===I.nodeType&&(O=I.textContent,b([bb,cb,db],U=>{O=P(O,U," ")}),I.textContent!==O&&(D(aa.removed,{element:I.cloneNode()}),I.textContent=
|
|
54
|
+
O)),ca(ra.afterSanitizeElements,I,null),!1):(ya(I),!0)},Lb=function(I,O,Q){if(Ta[O]||zb&&("id"===O||"name"===O)&&(Q in ta||Q in jc))return!1;if(!(eb&&!Ta[O]&&f(cc,O)||wb&&f(dc,O)||xa.attributeCheck instanceof Function&&xa.attributeCheck(O,I)))if(!oa[O]||Ta[O]){if(!("annotation-xml"!==I&&K(I,sb)&&(ka.tagNameCheck instanceof RegExp&&f(ka.tagNameCheck,I)||ka.tagNameCheck instanceof Function&&ka.tagNameCheck(I))&&(ka.attributeNameCheck instanceof RegExp&&f(ka.attributeNameCheck,O)||ka.attributeNameCheck instanceof
|
|
55
|
+
Function&&ka.attributeNameCheck(O,I))||"is"===O&&ka.allowCustomizedBuiltInElements&&(ka.tagNameCheck instanceof RegExp&&f(ka.tagNameCheck,Q)||ka.tagNameCheck instanceof Function&&ka.tagNameCheck(Q))))return!1}else if(!(jb[O]||f(tb,P(Q,rb,""))||("src"===O||"xlink:href"===O||"href"===O)&&"script"!==I&&0===M(Q,"data:")&&Bb[I]||xb&&!f(ec,P(Q,rb,"")))&&Q)return!1;return!0},Ob=function(I){ca(ra.beforeSanitizeAttributes,I,null);var {attributes:O}=I;if(O&&!nb(I)){for(var Q={attrName:"",attrValue:"",keepAttr:!0,
|
|
56
|
+
allowedAttributes:oa,forceKeepAttr:void 0},U=O.length;U--;){let {name:V,namespaceURI:ja,value:ua}=O[U],Ka=ma(V),pa="value"===V?ua:W(ua);if(Q.attrName=Ka,Q.attrValue=pa,Q.keepAttr=!0,Q.forceKeepAttr=void 0,ca(ra.uponSanitizeAttribute,I,Q),pa=Q.attrValue,!Ab||"id"!==Ka&&"name"!==Ka||(Ca(V,I),pa="user-content-"+pa),Ua&&f(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,pa)){Ca(V,I);continue}if("attributename"===Ka&&K(pa,"href")){Ca(V,I);continue}if(Q.forceKeepAttr)continue;
|
|
57
|
+
if(!Q.keepAttr){Ca(V,I);continue}if(!yb&&f(/\/>/i,pa)){Ca(V,I);continue}Ga&&b([bb,cb,db],Mb=>{pa=P(pa,Mb," ")});let Nb=ma(I.nodeName);if(Lb(Nb,Ka,pa)){if(qa&&"object"==typeof Ra&&"function"==typeof Ra.getAttributeType&&!ja)switch(Ra.getAttributeType(Nb,Ka)){case "TrustedHTML":pa=qa.createHTML(pa);break;case "TrustedScriptURL":pa=qa.createScriptURL(pa)}if(pa!==ua)try{ja?I.setAttributeNS(ja,V,pa):I.setAttribute(V,pa),nb(I)?ya(I):t(aa.removed)}catch(Mb){Ca(V,I)}}else Ca(V,I)}ca(ra.afterSanitizeAttributes,
|
|
58
|
+
I,null)}},kc=function Q(O){var U,V=Ib(O);for(ca(ra.beforeSanitizeShadowDOM,O,null);U=V.nextNode();)ca(ra.uponSanitizeShadowNode,U,null),Kb(U),Ob(U),U.content instanceof pb&&Q(U.content);ca(ra.afterSanitizeShadowDOM,O,null)};return aa.sanitize=function(O){var Q=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},U=null,V=null;V=V=null;if(kb=!O,kb&&(O="\x3c!--\x3e"),"string"!=typeof O&&!Jb(O)){if("function"!=typeof O.toString)throw g("toString is not a function");if("string"!=typeof(O=O.toString()))throw g("dirty is not a string, aborting");
|
|
59
|
+
}if(!aa.isSupported)return O;if(fb||mb(Q),aa.removed=[],"string"==typeof O&&(Oa=!1),Oa){if(O.nodeName&&(Q=ma(O.nodeName),!na[Q]||Na[Q]))throw g("root node is forbidden and cannot be sanitized in-place");}else if(O instanceof $a)U=Hb("\x3c!----\x3e"),V=U.ownerDocument.importNode(O,!0),1===V.nodeType&&"BODY"===V.nodeName||"HTML"===V.nodeName?U=V:U.appendChild(V);else{if(!Ha&&!Ga&&!Ba&&-1===O.indexOf("<"))return qa&&Wa?qa.createHTML(O):O;if(U=Hb(O),!U)return Ha?null:Wa?Ma:""}U&&gb&&ya(U.firstChild);
|
|
60
|
+
for(Q=Ib(Oa?O:U);V=Q.nextNode();)Kb(V),Ob(V),V.content instanceof pb&&kc(V.content);if(Oa)return O;if(Ha){if(Va)for(V=$b.call(U.ownerDocument);U.firstChild;)V.appendChild(U.firstChild);else V=U;return(oa.shadowroot||oa.shadowrootmode)&&(V=bc.call(Za,V,!0)),V}var ja=Ba?U.outerHTML:U.innerHTML;return Ba&&na["!doctype"]&&U.ownerDocument&&U.ownerDocument.doctype&&U.ownerDocument.doctype.name&&f(Aa,U.ownerDocument.doctype.name)&&(ja="<!DOCTYPE "+U.ownerDocument.doctype.name+">\n"+ja),Ga&&b([bb,cb,db],
|
|
61
|
+
ua=>{ja=P(ja,ua," ")}),qa&&Wa?qa.createHTML(ja):ja},aa.setConfig=function(){mb(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});fb=!0},aa.clearConfig=function(){Fa=null;fb=!1},aa.isValidAttribute=function(O,Q,U){Fa||mb({});O=ma(O);Q=ma(Q);return Lb(O,Q,U)},aa.addHook=function(O,Q){"function"==typeof Q&&D(ra[O],Q)},aa.removeHook=function(O,Q){return void 0!==Q?(Q=m(ra[O],Q),-1===Q?void 0:C(ra[O],Q,1)[0]):t(ra[O])},aa.removeHooks=function(O){ra[O]=[]},aa.removeAllHooks=function(){ra={afterSanitizeAttributes:[],
|
|
62
62
|
afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},aa}();J.exports=ea},[7007](J){function p(){p.init.call(this)}function v(b){if("function"!=typeof b)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof b);}function w(b,m,t,D){var C,A,H;if(v(t),void 0===(A=b._events)?(A=b._events=Object.create(null),b._eventsCount=
|
|
63
63
|
0):(void 0!==A.newListener&&(b.emit("newListener",m,t.listener?t.listener:t),A=b._events),H=A[m]),void 0===H)A[m]=t,++b._eventsCount;else if("function"==typeof H?H=A[m]=D?[t,H]:[H,t]:D?H.unshift(t):H.push(t),(C=void 0===b._maxListeners?p.defaultMaxListeners:b._maxListeners)>0&&H.length>C&&!H.warned)H.warned=!0,t=Error("Possible EventEmitter memory leak detected. "+H.length+" "+String(m)+" listeners added. Use emitter.setMaxListeners() to increase limit"),t.name="MaxListenersExceededWarning",t.emitter=
|
|
64
64
|
b,t.type=m,t.count=H.length,console&&console.warn&&console.warn(t);return b}function x(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function E(b,m,t){b={fired:!1,wrapFn:void 0,target:b,type:m,listener:t};m=x.bind(b);return m.listener=t,b.wrapFn=m,m}function k(b,m,t){b=b._events;if(void 0===b)return[];m=b[m];if(void 0===m)t=[];else if("function"==typeof m)t=t?[m.listener||
|
|
65
65
|
m]:[m];else if(t)for(t=Array(m.length),b=0;b<t.length;++b)t[b]=m[b].listener||m[b];else t=n(m,m.length);return t}function r(b){var m=this._events;if(void 0!==m){b=m[b];if("function"==typeof b)return 1;if(void 0!==b)return b.length}return 0}function n(b,m){for(var t=Array(m),D=0;D<m;++D)t[D]=b[D];return t}function l(b,m,t,D){if("function"==typeof b.on)D.once?b.once(m,t):b.on(m,t);else{if("function"!=typeof b.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+
|
|
66
|
-
typeof b);b.addEventListener(m,function H(A){D.once&&b.removeEventListener(m,H);t(A)})}}var c="object"==typeof Reflect?Reflect:null,
|
|
66
|
+
typeof b);b.addEventListener(m,function H(A){D.once&&b.removeEventListener(m,H);t(A)})}}var c="object"==typeof Reflect?Reflect:null,h=c&&"function"==typeof c.apply?c.apply:function(b,m,t){return Function.prototype.apply.call(b,m,t)};var a=c&&"function"==typeof c.ownKeys?c.ownKeys:Object.getOwnPropertySymbols?function(b){return Object.getOwnPropertyNames(b).concat(Object.getOwnPropertySymbols(b))}:function(b){return Object.getOwnPropertyNames(b)};var d=Number.isNaN||function(b){return b!=b};J.exports=
|
|
67
67
|
p;J.exports.once=function(b,m){return new Promise(function(t,D){function C(H){b.removeListener(m,A);D(H)}function A(){"function"==typeof b.removeListener&&b.removeListener("error",C);t([].slice.call(arguments))}l(b,m,A,{once:!0});"error"!==m&&"function"==typeof b.on&&l(b,"error",C,{once:!0})})};p.EventEmitter=p;p.prototype._events=void 0;p.prototype._eventsCount=0;p.prototype._maxListeners=void 0;var u=10;Object.defineProperty(p,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(b){if("number"!=
|
|
68
68
|
typeof b||b<0||d(b))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+b+".");u=b}});p.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0);this._maxListeners=this._maxListeners||void 0};p.prototype.setMaxListeners=function(b){if("number"!=typeof b||b<0||d(b))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+
|
|
69
69
|
b+".");return this._maxListeners=b,this};p.prototype.getMaxListeners=function(){return void 0===this._maxListeners?p.defaultMaxListeners:this._maxListeners};p.prototype.emit=function(b){for(var m=[],t=1;t<arguments.length;t++)m.push(arguments[t]);t="error"===b;var D=this._events;if(void 0!==D)t=t&&void 0===D.error;else if(!t)return!1;if(t){var C;if(m.length>0&&(C=m[0]),C instanceof Error)throw C;m=Error("Unhandled error."+(C?" ("+C.message+")":""));throw m.context=C,m;}t=D[b];if(void 0===t)return!1;
|
|
70
|
-
if("function"==typeof t)
|
|
70
|
+
if("function"==typeof t)h(t,this,m);else for(C=t.length,D=n(t,C),t=0;t<C;++t)h(D[t],this,m);return!0};p.prototype.addListener=function(b,m){return w(this,b,m,!1)};p.prototype.on=p.prototype.addListener;p.prototype.prependListener=function(b,m){return w(this,b,m,!0)};p.prototype.once=function(b,m){return v(m),this.on(b,E(this,b,m)),this};p.prototype.prependOnceListener=function(b,m){return v(m),this.prependListener(b,E(this,b,m)),this};p.prototype.removeListener=function(b,m){var t,D,C;if((v(m),void 0===
|
|
71
71
|
(D=this._events))||void 0===(t=D[b]))return this;if(t===m||t.listener===m)0===--this._eventsCount?this._events=Object.create(null):(delete D[b],D.removeListener&&this.emit("removeListener",b,t.listener||m));else if("function"!=typeof t){var A=-1;for(C=t.length-1;C>=0;C--)if(t[C]===m||t[C].listener===m){var H=t[C].listener;A=C;break}if(A<0)return this;if(0===A)t.shift();else{for(;A+1<t.length;A++)t[A]=t[A+1];t.pop()}1===t.length&&(D[b]=t[0]);void 0!==D.removeListener&&this.emit("removeListener",b,
|
|
72
72
|
H||m)}return this};p.prototype.off=p.prototype.removeListener;p.prototype.removeAllListeners=function(b){var m,t;if(void 0===(t=this._events))return this;if(void 0===t.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==t[b]&&(0===--this._eventsCount?this._events=Object.create(null):delete t[b]),this;if(0===arguments.length){var D=Object.keys(t);for(t=0;t<D.length;++t)"removeListener"!==(m=D[t])&&this.removeAllListeners(m);return this.removeAllListeners("removeListener"),
|
|
73
73
|
this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(m=t[b]))this.removeListener(b,m);else if(void 0!==m)for(t=m.length-1;t>=0;t--)this.removeListener(b,m[t]);return this};p.prototype.listeners=function(b){return k(this,b,!0)};p.prototype.rawListeners=function(b){return k(this,b,!1)};p.listenerCount=function(b,m){return"function"==typeof b.listenerCount?b.listenerCount(m):r.call(b,m)};p.prototype.listenerCount=r;p.prototype.eventNames=function(){return this._eventsCount>
|
|
74
|
-
0?a(this._events):[]}},[2733](J){J.exports=function(){function p(v){for(var w=1;w<arguments.length;w++){var x=arguments[w],E;for(E in x)v[E]=x[E]}return v}return function E(w,x){function k(r,n,l){if("undefined"!=typeof document){"number"==typeof(l=p({},x,l)).expires&&(l.expires=new Date(Date.now()+864E5*l.expires));l.expires&&(l.expires=l.expires.toUTCString());r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="",
|
|
75
|
-
!0!==l[
|
|
74
|
+
0?a(this._events):[]}},[2733](J){J.exports=function(){function p(v){for(var w=1;w<arguments.length;w++){var x=arguments[w],E;for(E in x)v[E]=x[E]}return v}return function E(w,x){function k(r,n,l){if("undefined"!=typeof document){"number"==typeof(l=p({},x,l)).expires&&(l.expires=new Date(Date.now()+864E5*l.expires));l.expires&&(l.expires=l.expires.toUTCString());r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="",h;for(h in l)l[h]&&(c+="; "+h,
|
|
75
|
+
!0!==l[h]&&(c+="="+l[h].split(";")[0]));return document.cookie=r+"="+w.write(n,r)+c}}return Object.create({set:k,get:function(r){if("undefined"!=typeof document&&(!arguments.length||r)){for(var n=document.cookie?document.cookie.split("; "):[],l={},c=0;c<n.length;c++){var h=n[c].split("="),a=h.slice(1).join("=");try{var d=decodeURIComponent(h[0]);if(l[d]=w.read(a,d),r===d)break}catch(u){}}return r?l[r]:l}},remove:function(r,n){k(r,"",p({},n,{expires:-1}))},withAttributes:function(r){return E(this.converter,
|
|
76
76
|
p({},this.attributes,r))},withConverter:function(r){return E(p({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(x)},converter:{value:Object.freeze(w)}})}({read:function(w){return'"'===w[0]&&(w=w.slice(1,-1)),w.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(w){return encodeURIComponent(w).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()},[6585](J){function p(w,x,E,k){return Math.round(w/E)+" "+k+(x>=1.5*E?"s":"")}var v=
|
|
77
77
|
6048E5;J.exports=function(w,x){x=x||{};var E,k=typeof w;if("string"===k&&w.length>0)return function(r){if(!((r=String(r)).length>100)&&(r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r))){var n=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case "years":case "year":case "yrs":case "yr":case "y":return 315576E5*n;case "weeks":case "week":case "w":return n*v;case "days":case "day":case "d":return n*864E5;
|
|
78
78
|
case "hours":case "hour":case "hrs":case "hr":case "h":return n*36E5;case "minutes":case "minute":case "mins":case "min":case "m":return n*6E4;case "seconds":case "second":case "secs":case "sec":case "s":return n*1E3;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return n}}}(w);if("number"===k&&isFinite(w))return x.long?(E=Math.abs(w))>=864E5?p(w,E,864E5,"day"):E>=36E5?p(w,E,36E5,"hour"):E>=6E4?p(w,E,6E4,"minute"):E>=1E3?p(w,E,1E3,"second"):w+" ms":function(r){var n=Math.abs(r);
|
|
79
|
-
return n>=864E5?Math.round(r/864E5)+"d":n>=36E5?Math.round(r/36E5)+"h":n>=6E4?Math.round(r/6E4)+"m":n>=1E3?Math.round(r/1E3)+"s":r+"ms"}(w);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(w));}},[1814](J,p,v){var w=this&&this.__awaiter||function(t,D,C,A){return new (C||(C=Promise))(function(H,K){function P(z){try{
|
|
80
|
-
M)}
|
|
79
|
+
return n>=864E5?Math.round(r/864E5)+"d":n>=36E5?Math.round(r/36E5)+"h":n>=6E4?Math.round(r/6E4)+"m":n>=1E3?Math.round(r/1E3)+"s":r+"ms"}(w);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(w));}},[1814](J,p,v){var w=this&&this.__awaiter||function(t,D,C,A){return new (C||(C=Promise))(function(H,K){function P(z){try{W(A.next(z))}catch(f){K(f)}}function M(z){try{W(A.throw(z))}catch(f){K(f)}}function W(z){var f;z.done?H(z.value):(f=z.value,f instanceof C?f:new C(function(g){g(f)})).then(P,
|
|
80
|
+
M)}W((A=A.apply(t,D||[])).next())})};J=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(p,"__esModule",{value:!0});p.Hot=p.DeveloperMode=void 0;var x=v(8296),E=v(9343),k=v(1284),r=v(9844),n=v(8374),l=J(v(7007)),c=J(v(5454)),h=J(v(2733)),a=J(v(2365)),d=J(v(8241)),u=v(893),b;!function(t){t[t.Production=0]="Production";t[t.Development=1]="Development"}(b||(p.DeveloperMode=b={}));class m{static getUrlParam(t,D){var C=(new URLSearchParams(window.location.search)).get(t);
|
|
81
81
|
if(null==C)return null;if("string"==typeof D){switch(D){case "int":return parseInt(C);case "float":return parseFloat(C);case "email":if(!0===RegExp("^\\S+@\\S+\\.\\S+$").test(C))return C;break;case "phone":if(!0===RegExp("^\\+?([0-9 ]?){6,14}[0-9]$").test(C))return C;break;case "uuid":if(!0===RegExp("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}").test(C))return C;break;default:if(D.indexOf("string")>-1){let A=parseInt(D.split("(")[1].split(")")[0]);if(C.length===A)return C}}throw Error(`getUrlParam retreiving parameter "${t}" using validation type "${D}" failed.`);
|
|
82
82
|
}return D(C)}static navigateTo(t){return w(this,void 0,void 0,function*(){yield E.HotStaq.navigateTo(t)})}static include(t){return w(this,arguments,void 0,function*(D,C=null){if(!0===E.HotStaq.isWeb&&"string"==typeof D){let A=D.toLowerCase();A.indexOf(".hott")>-1&&A.indexOf("nahfam")<0&&(D+="?hstqserve=nahfam")}m.echoUnsafe(yield m.getFile(D,C))})}static includeJS(t){return w(this,arguments,void 0,function*(D,C=null,A=null){D=yield m.getFile(D);return!0===E.HotStaq.isWeb?null==A&&(A=window):null==
|
|
83
83
|
A&&(A=v.g),(new Function(D)).apply(A,C)})}static import(t){return w(this,arguments,void 0,function*(D,C=null,A=null){var H=m.CurrentPage.processor.getModule(D);if(null!=H)return H;C=yield m.getFile(`./hotstaq_modules/${D}/index.js`,C);!0===E.HotStaq.isWeb?null==A&&(A=window):null==A&&(A=v.g);A=(new Function(C)).apply(A);return null!=A.loadHTML&&(yield A.loadHTML()),m.CurrentPage.processor.addModule(D,A),A})}static runFile(t){return w(this,arguments,void 0,function*(D,C=null){D=m.CurrentPage.processor.getFile(D);
|
|
@@ -85,231 +85,231 @@ D.page=this.CurrentPage;C=yield D.process(C);m.echoUnsafe(C)})}static getFile(t)
|
|
|
85
85
|
if(null==m.CurrentPage.processor)throw Error("Current page's processor is null!");if(null==m.CurrentPage.processor.api)throw Error("Current page's processor api is null! Did you forget to set the API name or URL?");return null!=m.CurrentPage.processor.api&&(P=yield m.CurrentPage.processor.api.makeCall(D,C,A,H,K)),P})}static sseRequest(t){var D=200,C=new l.default;try{if(null==t.url||""===t.url)throw Error("A url must be provided to the request.");if(null==t.ctrl)throw Error("A ctrl AbortController must be provided to the request.");
|
|
86
86
|
null==t.httpMethod&&(t.httpMethod=r.HotEventMethod.POST);null==t.echoErrorToConsole&&(t.echoErrorToConsole=!0);null==t.autoParseMsgs&&(t.autoParseMsgs=!0);let A={method:t.httpMethod,headers:{Accept:"application/json","Content-Type":"application/json"},signal:t.ctrl.signal};t.httpMethod!==r.HotEventMethod.GET&&(A.body=JSON.stringify(t.data));null!=t.bearerToken&&""!==t.bearerToken&&(A.headers.Authorization=`Bearer ${t.bearerToken}`);(0,u.fetchEventSource)(t.url,Object.assign(Object.assign({},A),{onopen:H=>
|
|
87
87
|
w(this,void 0,void 0,function*(){if(D=H.status,!1===H.ok){let K=yield H.json();return void C.emit("error",K.error)}C.emit("open",H)}),onerror:H=>{!0===t.echoErrorToConsole&&console.error(`SSE Error: ${H.message}`);C.emit("error",H)},onmessage:H=>w(this,void 0,void 0,function*(){var K=H.data;!0===t.autoParseMsgs&&(K=JSON.parse(H.data));C.emit(H.event,K)}),onclose:()=>w(this,void 0,void 0,function*(){C.emit("close")})}))}catch(A){throw new n.HttpError(A.message,D);}return C}static getJSON(t){return w(this,
|
|
88
|
-
arguments,void 0,function*(D,C=""){return m.jsonRequest(D,null,C,r.HotEventMethod.GET)})}static jsonRequest(t){return w(this,arguments,void 0,function*(D,C=null,A="",H=r.HotEventMethod.POST){var K=200;try{let P={method:H,headers:{Accept:"application/json","Content-Type":"application/json"}};H!==r.HotEventMethod.GET&&(P.body=JSON.stringify(C));""!=A&&(P.headers.Authorization=`Bearer ${A}`);let M=yield(0,a.default)(D,P);if(K=M.status,!1===M.ok){D=null;try{D=yield M.json()}catch(
|
|
89
|
-
}return yield M.json()}catch(P){return{error:P.message,errorCode:K}}})}static httpRequest(t,D){return w(this,arguments,void 0,function*(C,A,H=r.HotEventMethod.POST,K={},P=""){var M=Object.keys(K).length,
|
|
90
|
-
""!=P&&(K.headers={Authorization:`Bearer ${P}`}),K=yield(yield(0,a.default)(C,K)).json(),null==A.hotstaq&&(A.hotstaq={skipValidation:!0}),null==A.hotstaq.uploads&&(A.hotstaq.uploads={}),A.hotstaq.uploads.uploadId=K.hotstaq.uploads.uploadId,yield m.httpRequest(C,A,r.HotEventMethod.POST,{},P);var
|
|
91
|
-
{(0,a.default)(C,
|
|
92
|
-
m.echoUnsafe(D)}}static displayJSScripts(){for(let t=0;t<m.JSScripts.length;t++){let D=m.jsScriptsStr;D=D.replace(/%JS_CODE%/g,m.JSScripts[t]);m.echoUnsafe(D)}}}if(p.Hot=m,m.__purifyWindow=null,m.__domPurify=null,m.Debugger={benchmark:!1,processCount:0,processTotalTime:0,processAvgTime:0},m.CurrentPage=null,m.Arguments=null,m.DeveloperMode=b,m.HotTestElement=k.HotTestElement,m.Mode=b.Production,m.API=null,m.TesterAPI=null,m.Output="",m.Data={},m.Cookies=
|
|
93
|
-
m.CSS=[],m.JSFiles=[],m.JSScripts=[],m.jsFileStr='<script type = "text/javascript" src = "%JS_FILE%">\x3c/script>',m.jsScriptsStr='<script type = "text/javascript">%JS_CODE%\x3c/script>',"undefined"==typeof window)({JSDOM:p}=eval("require")("jsdom")),m.__purifyWindow=(new p("")).window,m.__domPurify=(0,c.default)(m.__purifyWindow),m.echo=(t,D)=>{m.Output+=m.__domPurify.sanitize(t,D)}},[6044](J,p,v){var w=this&&this.__awaiter||function(l,c,
|
|
94
|
-
function m(D){try{t(a.throw(D))}catch(C){u(C)}}function t(D){var C;D.done?d(D.value):(C=D.value,C instanceof
|
|
95
|
-
this.connection=c;this.bearerToken=this.description="";this.baseUrl=l;this.createFunctions=!0;this.executeEventsUsing=n.HotRoute;this.db=
|
|
96
|
-
return this.connection.api.db}getDBSchema(){if(null==this.connection.api.db)throw Error(`No database has been set for API base url ${this.connection.api.baseUrl}`);return this.connection.api.db.schema}addRoute(l,c=null,
|
|
97
|
-
this.connection;!0===this.createFunctions&&this.createAPIRouteMethods(a)}createAPIRouteMethods(l){var c=this[l];null==c&&(c={});for(let
|
|
98
|
-
void 0,void 0,function*(){for(let l in this.routes)yield this.registerRoute(this.routes[l])})}makeCall(l,c){return w(this,arguments,void 0,function*(
|
|
88
|
+
arguments,void 0,function*(D,C=""){return m.jsonRequest(D,null,C,r.HotEventMethod.GET)})}static jsonRequest(t){return w(this,arguments,void 0,function*(D,C=null,A="",H=r.HotEventMethod.POST){var K=200;try{let P={method:H,headers:{Accept:"application/json","Content-Type":"application/json"}};H!==r.HotEventMethod.GET&&(P.body=JSON.stringify(C));""!=A&&(P.headers.Authorization=`Bearer ${A}`);let M=yield(0,a.default)(D,P);if(K=M.status,!1===M.ok){D=null;try{D=yield M.json()}catch(W){D=yield M.text()}throw Error(D.error);
|
|
89
|
+
}return yield M.json()}catch(P){return{error:P.message,errorCode:K}}})}static httpRequest(t,D){return w(this,arguments,void 0,function*(C,A,H=r.HotEventMethod.POST,K={},P=""){var M=Object.keys(K).length,W=H.toLowerCase();H===r.HotEventMethod.FILE_UPLOAD&&(W="post");H=!1;var z=new d.default;if(M>0){if("post"!==W)throw Error("To upload files, you must set the httpMethod to POST.");for(let g in K)M=K[g],null!=M&&(z.append(g,M),H=!0)}if(!0===H)return K={method:"POST",headers:{HotStaqUpload:"true"},body:z},
|
|
90
|
+
""!=P&&(K.headers={Authorization:`Bearer ${P}`}),K=yield(yield(0,a.default)(C,K)).json(),null==A.hotstaq&&(A.hotstaq={skipValidation:!0}),null==A.hotstaq.uploads&&(A.hotstaq.uploads={}),A.hotstaq.uploads.uploadId=K.hotstaq.uploads.uploadId,yield m.httpRequest(C,A,r.HotEventMethod.POST,{},P);var f={method:W,headers:{Accept:"application/json","Content-Type":"application/json"}};return""!=P&&(f.headers.Authorization=`Bearer ${P}`),"get"!==W&&"head"!==W&&(f.body=JSON.stringify(A)),new Promise((g,q)=>
|
|
91
|
+
{(0,a.default)(C,f).then(e=>w(this,void 0,void 0,function*(){e.json().then(y=>{g(y)}).catch(y=>{throw Error(`${C}: ${y.message}`);})})).catch(e=>{throw Error(`${C}: ${e.message}`);})})})}static echo(t,D){m.Output+=c.default.sanitize(t,D)}static echoUnsafe(t){m.Output+=t}static displayCSS(){for(let t=0;t<m.CSS.length;t++){let D=m.cssStr;D=D.replace(/%CSS_FILE%/g,m.CSS[t]);m.echoUnsafe(D)}}static displayJSFiles(){for(let t=0;t<m.JSFiles.length;t++){let D=m.jsFileStr;D=D.replace(/%JS_FILE%/g,m.JSFiles[t]);
|
|
92
|
+
m.echoUnsafe(D)}}static displayJSScripts(){for(let t=0;t<m.JSScripts.length;t++){let D=m.jsScriptsStr;D=D.replace(/%JS_CODE%/g,m.JSScripts[t]);m.echoUnsafe(D)}}}if(p.Hot=m,m.__purifyWindow=null,m.__domPurify=null,m.Debugger={benchmark:!1,processCount:0,processTotalTime:0,processAvgTime:0},m.CurrentPage=null,m.Arguments=null,m.DeveloperMode=b,m.HotTestElement=k.HotTestElement,m.Mode=b.Production,m.API=null,m.TesterAPI=null,m.Output="",m.Data={},m.Cookies=h.default,m.PublicKeys={},m.cssStr='<link rel = "stylesheet" href = "%CSS_FILE%" />',
|
|
93
|
+
m.CSS=[],m.JSFiles=[],m.JSScripts=[],m.jsFileStr='<script type = "text/javascript" src = "%JS_FILE%">\x3c/script>',m.jsScriptsStr='<script type = "text/javascript">%JS_CODE%\x3c/script>',"undefined"==typeof window)({JSDOM:p}=eval("require")("jsdom")),m.__purifyWindow=(new p("")).window,m.__domPurify=(0,c.default)(m.__purifyWindow),m.echo=(t,D)=>{m.Output+=m.__domPurify.sanitize(t,D)}},[6044](J,p,v){var w=this&&this.__awaiter||function(l,c,h,a){return new (h||(h=Promise))(function(d,u){function b(D){try{t(a.next(D))}catch(C){u(C)}}
|
|
94
|
+
function m(D){try{t(a.throw(D))}catch(C){u(C)}}function t(D){var C;D.done?d(D.value):(C=D.value,C instanceof h?C:new h(function(A){A(C)})).then(b,m)}t((a=a.apply(l,c||[])).next())})};Object.defineProperty(p,"__esModule",{value:!0});p.HotAPI=p.EventExecutionType=void 0;var x=v(3205),E=v(7605),k=v(9844),r=v(1814),n;!function(l){l[l.HotRoute=0]="HotRoute";l[l.HotMethod=1]="HotMethod";l[l.HotAPI=2]="HotAPI"}(n||(p.EventExecutionType=n={}));p.HotAPI=(()=>class{constructor(l,c,h=null){if(null==c)throw Error(`No server attached to api with baseUrl: ${l}`);
|
|
95
|
+
this.connection=c;this.bearerToken=this.description="";this.baseUrl=l;this.createFunctions=!0;this.executeEventsUsing=n.HotRoute;this.db=h;this.openAPI={};this.userAuth=null;this.routes={};this.onPostRegister=this.onPreRegister=null}setDBSchema(l){if(null==this.connection.api)throw Error("No API has been set!");if(null==this.connection.api.db)throw Error(`No database has been set for API base url ${this.connection.api.baseUrl}`);this.connection.api.db.schema=l}getDB(){if(null==this.connection.api.db)throw Error(`No database has been set for API base url ${this.connection.api.baseUrl}`);
|
|
96
|
+
return this.connection.api.db}getDBSchema(){if(null==this.connection.api.db)throw Error(`No database has been set for API base url ${this.connection.api.baseUrl}`);return this.connection.api.db.schema}addRoute(l,c=null,h=null){var a="";"string"==typeof l?(a=l,null==this.routes[a]&&(this.routes[a]=new E.HotRoute(this.connection,a)),"string"==typeof c?this.routes[a].addMethod(k.HotRouteMethod.create(this.routes[a],c,h)):this.routes[a].addMethod(c)):(a=l.route,this.routes[l.route]=l);this.routes[a].connection=
|
|
97
|
+
this.connection;!0===this.createFunctions&&this.createAPIRouteMethods(a)}createAPIRouteMethods(l){var c=this[l];null==c&&(c={});for(let h=0;h<this.routes[l].methods.length;h++){this.routes[l];let a=this.routes[l].methods[h];c[a.name]=(d,u)=>{var b=a.type;d=[a.getRouteUrl(),d,b,u,this.bearerToken];return this.makeCall.apply(this,d)}}this[l]=c}registerRoute(l){return w(this,void 0,void 0,function*(){this.connection instanceof x.HotServer&&(yield this.connection.registerRoute(l))})}registerRoutes(){return w(this,
|
|
98
|
+
void 0,void 0,function*(){for(let l in this.routes)yield this.registerRoute(this.routes[l])})}makeCall(l,c){return w(this,arguments,void 0,function*(h,a,d=k.HotEventMethod.POST,u={},b=""){var m=this.baseUrl;return d.toUpperCase(),"/"===m[m.length-1]&&(m=m.substr(0,m.length-1)),"/"!==h[0]&&(m+="/"),m+=h,r.Hot.httpRequest(m,a,d,u,b)})}})()},[5472](J,p){Object.defineProperty(p,"__esModule",{value:!0});p.HotAsset=void 0;p.HotAsset=(()=>class{constructor(v,w=""){this.type=v;this.name=w;this.content=this.path=
|
|
99
99
|
""}load(){}output(){if(null==this.path&&null==this.content)throw Error(`HotAsset ${this.name} of type ${this.type} does not have a path or content set!`);var v="";if(null!=this.path&&""!==this.path&&("js"===this.type&&(v=`<script type = "text/javascript" src = "${this.path}"><\/script>`),"css"===this.type&&(v=`<link href = "${this.path}" rel = "stylesheet" />`),"html"===this.type||"component"===this.type)){if(""===this.name)throw Error("Loading an HTML or component asset requires a name to be set!");
|
|
100
100
|
this.path;v={name:this.name,url:this.path}}if(null!=this.content&&""!==this.content){if("js"===this.type)throw Error("Loading JS assets using content is not supported yet!");if("css"===this.type)throw Error("Loading CSS assets using content is not supported yet!");if("html"===this.type){if(""===this.name)throw Error("Loading an HTML asset requires a name to be set!");v=JSON.stringify(this.content);let w=this.path;v=v.replace(RegExp("\\<script","gmi"),'<scr" + "ipt');v=v.replace(RegExp("\\<\\/script",
|
|
101
101
|
"gmi"),'</scr" + "ipt');v={name:this.name,url:w,content:v}}}return v}})()},[3025](J,p,v){Object.defineProperty(p,"__esModule",{value:!0});p.HotClient=void 0;var w=v(3205);p.HotClient=class{constructor(x){this.processor=x;this.testerAPI=this.api=null;this.type=w.HotServerType.HTTP;this.logger=x.logger}}},[3299](J,p,v){Object.defineProperty(p,"__esModule",{value:!0});p.HotComponent=void 0;var w=v(9343);p.HotComponent=class{constructor(x,E=null){x instanceof w.HotStaq||null==x?(this.processor=x,this.htmlElements=
|
|
102
102
|
[],this.name="",this.tag="",this.api=null,this.elementOptions=void 0,this.observedAttributes=[],this.type="",this.value=null,this.inner=null,this.events={}):(this.processor=x.processor,this.htmlElements=x.htmlElements||[],this.name=x.name||"",this.tag=x.tag||this.name,this.api=x.api||null,this.elementOptions=x.elementOptions||void 0,this.observedAttributes=x.observedAttributes||[],this.type=x.type||"",this.value=x.value||null,this.inner=x.inner||null,this.events={});null!=E&&(this.api=E)}onCreated(x){return x}}},
|
|
103
103
|
[9164](J,p){Object.defineProperty(p,"__esModule",{value:!0})},[8296](J,p,v){var w,x=this&&this.__createBinding||(Object.create?function(a,d,u,b){void 0===b&&(b=u);var m=Object.getOwnPropertyDescriptor(d,u);m&&("get"in m?d.__esModule:!m.writable&&!m.configurable)||(m={enumerable:!0,get:function(){return d[u]}});Object.defineProperty(a,b,m)}:function(a,d,u,b){void 0===b&&(b=u);a[b]=d[u]}),E=this&&this.__setModuleDefault||(Object.create?function(a,d){Object.defineProperty(a,"default",{enumerable:!0,
|
|
104
104
|
value:d})}:function(a,d){a.default=d});J=this&&this.__importStar||(w=function(a){return w=Object.getOwnPropertyNames||function(d){var u=[],b;for(b in d)Object.prototype.hasOwnProperty.call(d,b)&&(u[u.length]=b);return u},w(a)},function(a){if(a&&a.__esModule)return a;var d={};if(null!=a)for(var u=w(a),b=0;b<u.length;b++)"default"!==u[b]&&x(d,a,u[b]);return E(d,a),d});var k=this&&this.__awaiter||function(a,d,u,b){return new (u||(u=Promise))(function(m,t){function D(H){try{A(b.next(H))}catch(K){t(K)}}
|
|
105
|
-
function C(H){try{A(b.throw(H))}catch(K){t(K)}}function A(H){var K;H.done?m(H.value):(K=H.value,K instanceof u?K:new u(function(P){P(K)})).then(D,C)}A((b=b.apply(a,d||[])).next())})},r=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(p,"__esModule",{value:!0});p.HotFile=void 0;var n=J(v(1603)),l=r(v(2365)),c=v(1814);class
|
|
105
|
+
function C(H){try{A(b.throw(H))}catch(K){t(K)}}function A(H){var K;H.done?m(H.value):(K=H.value,K instanceof u?K:new u(function(P){P(K)})).then(D,C)}A((b=b.apply(a,d||[])).next())})},r=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(p,"__esModule",{value:!0});p.HotFile=void 0;var n=J(v(1603)),l=r(v(2365)),c=v(1814);class h{constructor(a={}){this.page=a.page||null;this.name=a.name||"";this.url=a.url||"";this.localFile=a.localFile||"";this.content=
|
|
106
106
|
a.content||"";this.throwAllErrors=a.throwAllErrors||!1}setContent(a){this.content=a}getContent(){return this.content}static httpGet(a){return k(this,void 0,void 0,function*(){try{let d=yield(0,l.default)(a);if(!1===d.ok)throw Error(`${d.status}: ${d.statusText}`);return yield d.text()}catch(d){return JSON.stringify({error:`${d.message} - Could not fetch ${a}`})}})}loadUrl(){return k(this,void 0,void 0,function*(){var a=null;if(null!=c.Hot.CurrentPage&&null!=c.Hot.Debugger&&!0===c.Hot.Debugger.benchmark&&
|
|
107
|
-
(a=performance.now(),c.Hot.CurrentPage.processor.logger.info(`Downloading file "${this.name}" from "${this.url}"...`)),this.content=yield
|
|
107
|
+
(a=performance.now(),c.Hot.CurrentPage.processor.logger.info(`Downloading file "${this.name}" from "${this.url}"...`)),this.content=yield h.httpGet(this.url),null!=c.Hot.CurrentPage&&null!=c.Hot.Debugger&&!0===c.Hot.Debugger.benchmark)a=performance.now()-a,c.Hot.CurrentPage.processor.logger.info(`Downloaded file "${this.name}" from "${this.url}" in ${a.toFixed(2)} ms.`);return this.content})}loadLocalFile(){return k(this,void 0,void 0,function*(){return new Promise((a,d)=>{n.readFile(this.localFile,
|
|
108
108
|
(u,b)=>{if(null!=u)throw u;this.content=b.toString();a(this.content)})})})}load(){return k(this,void 0,void 0,function*(){var a="";return""!==this.url&&(a=yield this.loadUrl()),""!==this.localFile&&(a=yield this.loadLocalFile()),a})}static processContent(a,d,u,b,m=2,t=2){for(var D=d.exec(a),C=0,A="";null!=D;){let H=d.lastIndex+t,K=a.substr(C,D.index-m-C);C=H;A+=b(K);A+=u(D[0]);D=d.exec(a)}return A+=b(a.substr(C)),A}static processNestedContent(a,d,u,b,m,t,D=2,C=1){for(var A=a.indexOf(d),H=0,K=a.indexOf(b,
|
|
109
|
-
A),P="";A>-1;){var M=a.indexOf(u,A);let
|
|
110
|
-
a.indexOf("{",D);let C=m;if(-1!==b&&-1!==m&&-1!==D&&-1!==t){let A="}> }A> }a> }R> }RA> }Ra>".split(" "),H=-1,K=null;for(let P=0;P<A.length;P++){let M=A[P],
|
|
109
|
+
A),P="";A>-1;){var M=a.indexOf(u,A);let W=0;if(""!==b){let z=a.lastIndexOf(b,M-C);for(;z>-1&&z!==K;)z=a.lastIndexOf(b,z-C),W++}if(W>0){for(M=K=a.indexOf(u,M+C);K>-1&&W>0&&!(M<0)&&!(a.lastIndexOf(d,M-C)>K);)K=M,M=a.indexOf(u,K+C),W--;M=K}P+=t(a.substr(H,A-H));P+=m(a.substr(A+D,M-(A+D)),A,M);A=a.indexOf(d,M+C);K=a.indexOf(b,A);H=M+C}return P+=t(a.substr(H)),P}static parseFunction(a,d,u){for(var b=(a=h.processHotDomBlocks(a,"`")).indexOf("<(");b>-1;){var m=a.indexOf(")",b);let D=a.indexOf("=>",m);var t=
|
|
110
|
+
a.indexOf("{",D);let C=m;if(-1!==b&&-1!==m&&-1!==D&&-1!==t){let A="}> }A> }a> }R> }RA> }Ra>".split(" "),H=-1,K=null;for(let P=0;P<A.length;P++){let M=A[P],W=a.indexOf(M,D);W>-1&&(-1==H||W<H)&&(H=W,K=M)}H>-1&&(m=a.slice(b+2,m).trim().split(",").map(P=>P.trim()),t=a.slice(t+1,H).trim(),d(m),t=u(t,K),a=a.slice(0,b)+t+a.slice(H+K.length),C=H)}b=a.indexOf("<(",C)}return a}static processHotDomBlocks(a,d="`"){a=a.replace(/<hot\-dom>([\s\S]*?)<\/hot\-dom>/gi,(u,b)=>{u=b.replace(/\$\{(.*?)\}/g,(m,t)=>`#$%#@{HotStaq.sanitizeHTML(${t.trim()})}`);
|
|
111
111
|
return u=b.replace(/\$\\\{(.*?)\}/g,(m,t)=>`#$%#@{HotStaq.sanitizeHTML(${t.trim()})}`),`HotStaq.addHtmlUnsafe(null,${d}${u}${d})`});return a=a.replace(/<hot\-dom\-escape>([\s\S]*?)<\/hot\-dom\-escape>/gi,(u,b)=>{u=b.replace(/\$\{(.*?)\}/g,(m,t)=>`^$&#@{HotStaq.sanitizeHTML(${t.trim()})}`);return u=b.replace(/\$\\\{(.*?)\}/g,(m,t)=>`^$&#@{HotStaq.sanitizeHTML(${t.trim()})}`),`HotStaq.addHtmlUnsafe(null,${d}${u}${d})`}),a}static parseContent(a,d,u=null){null==u&&(u={outputCommands:!0,allowStringify:!0});
|
|
112
|
-
var b="JSON.stringify (",m=")";!1===u.allowStringify&&(b="",m="");a=
|
|
112
|
+
var b="JSON.stringify (",m=")";!1===u.allowStringify&&(b="",m="");a=h.processContent(a,RegExp("(?=\\<\\*)([\\s\\S]*?)(?=\\*\\>)","g"),t=>`${t.substr(2)}`,t=>{if(""===t)return"";t=h.processNestedContent(t,"STR{","}","{",(A,H,K)=>{H="";return H=!0===u.outputCommands?`*&&%*%@#@!echoOutput (JSON.stringify(${A}), ${d});*&!#%@!@*!`:`*&&%*%@#@!${b}${A}${m}, ${d});*&!#%@!@*!`,H},A=>A,4,1);var D="";t=h.parseFunction(t,A=>{D=JSON.stringify(A)},(A,H)=>{A=A.replace(/`/g,"\\`");var K="Hot.CurrentPage.callFunction",
|
|
113
113
|
P="false";"}A>"===H&&(K="await Hot.CurrentPage.callAsyncFunction",P="true");"}a>"===H&&(K="Hot.CurrentPage.callAsyncFunction",P="true");"}R>"===H&&(K="return Hot.CurrentPage.callFunction");"}RA>"===H&&(K="return await Hot.CurrentPage.callAsyncFunction",P="true");"}Ra>"===H&&(K="return Hot.CurrentPage.callAsyncFunction",P="true");H=`*&&%*%@#@!{\nconst newFuncName = createFunction (null, ${D}, \`${A}\`, ${P});\nHot.echo (\`${K} (this, '\${newFuncName}', arguments);\`);\n}*&!#%@!@*!`;return H=H.replace(/\$\{/g,
|
|
114
|
-
"${&&!*#!!"),H});t=
|
|
115
|
-
"?(",")","(",(A,H,K)=>"",A=>A));c.Hot.Mode===c.DeveloperMode.Development&&(C=
|
|
114
|
+
"${&&!*#!!"),H});t=h.processNestedContent(t,"${","}","{",(A,H,K)=>{H="";K=u.outputCommands;return A.indexOf("&&!*#!!")>-1?(A=A.replace(/&&!\*#!!/g,""),`\${(typeof (${A}) !== "undefined") ? ${A} : "\${${A}}"}`):(!0===K?(H=`*&&%*%@#@!try { Hot.echo (${A}); }catch (ex){Hot.echo (\`\\\${${A.replace(/[`]/g,"\\`")}}\`);}*&!#%@!@*!`,!0===d&&(H=`*&&%*%@#@!Hot.echo (${A});*&!#%@!@*!`)):H=`*&&%*%@#@!${A}*&!#%@!@*!`,H)},A=>A);t=h.processHotDomBlocks(t);var C="";c.Hot.Mode===c.DeveloperMode.Production&&(C=h.processNestedContent(t,
|
|
115
|
+
"?(",")","(",(A,H,K)=>"",A=>A));c.Hot.Mode===c.DeveloperMode.Development&&(C=h.processNestedContent(t,"?(",")","(",(A,H,K)=>{H="";try{JSON.parse(A),H=!0===u.allowStringify?JSON.stringify(A):`${A}`}catch(P){H=`${A}`}if(!0===u.outputCommands)A=`*&&%*%@#@!{\nconst testElm = createTestElement (${H});\nHot.echo (\`data-test-object-name = "\${testElm.name}" data-test-object-func = "\${testElm.func}" data-test-object-value = "\${testElm.value}"\`);\n}*&!#%@!@*!\n`;else{A=H;H=null;try{if(K=A,"string"==typeof A&&
|
|
116
116
|
(K=JSON.parse(A)),"string"==typeof K&&(H=new c.Hot.HotTestElement(K)),K instanceof Array&&(H=new c.Hot.HotTestElement(K[0],K[1],K[2])),null!=K.name&&(H=new c.Hot.HotTestElement(K)),null!=c.Hot.CurrentPage.testElements[H.name])throw Error(`Test element ${H.name} already exists!`);}catch(P){throw Error(`Error processing test element ${A} in ${c.Hot.CurrentPage.name}. Error: ${P.message}`);}A=H;A=`*&&%*%@#@!data-test-object-name = "${A.name}" data-test-object-func = "${A.func}" data-test-object-value = "${A.value}"*&!#%@!@*!`}return A},
|
|
117
|
-
A=>A));t=
|
|
118
|
-
c.Hot.Debugger.processCount++);var u=this.content;if(null!=a&&a instanceof Array)throw Error(`In ${this.name}, the passed arguments received cannot be an array!`);var b=c.Hot.Arguments;c.Hot.Mode=this.page.processor.mode;c.Hot.Arguments=a;c.Hot.CurrentPage=this.page;c.Hot.PublicKeys=this.page.processor.publicKeys;c.Hot.API=this.page.getAPI();c.Hot.TesterAPI=this.page.getTesterAPI();u=
|
|
117
|
+
A=>A));t=h.processNestedContent(C,"*&&%*%@#@!","*&!#%@!@*!","*&&%*%@#@!",(A,H,K)=>A,A=>{A=!0===u.allowStringify?JSON.stringify(A):A;var H="";return H=!0===u.outputCommands?`echoOutput (${A}, ${d});\n`:A,H},10,10);return t=t.replace(/\*&&%\*%@#@!/g,""),t=t.replace(/\*&!#%@!@\*!/g,""),t},0);return a=a.replace(/#\$%#@\{/g,"${"),a=a.replace(/\^\$&#@\{/g,"$\\\\{"),a}process(){return k(this,arguments,void 0,function*(a=null){var d=null;null!=c.Hot.Debugger&&!0===c.Hot.Debugger.benchmark&&(d=performance.now(),
|
|
118
|
+
c.Hot.Debugger.processCount++);var u=this.content;if(null!=a&&a instanceof Array)throw Error(`In ${this.name}, the passed arguments received cannot be an array!`);var b=c.Hot.Arguments;c.Hot.Mode=this.page.processor.mode;c.Hot.Arguments=a;c.Hot.CurrentPage=this.page;c.Hot.PublicKeys=this.page.processor.publicKeys;c.Hot.API=this.page.getAPI();c.Hot.TesterAPI=this.page.getTesterAPI();u=h.parseContent(u,this.throwAllErrors);var m=null;try{let t="\n\t\t\tvar Hot = arguments[0];\n\t\t\tvar PassedHotFile = arguments[1];\n\n\t\t\t";
|
|
119
119
|
if("string"==typeof a)throw Error("The passing arguments cannot be a string!");for(let D in a){let C="";C=`var ${D} = ${JSON.stringify(a[D])};\n`;t+=C}t+='\n\t\t\t/**\n\t\t\t * Helper function to output content.\n\t\t\t */\n\t\t\tfunction echoOutput (content, throwErrors)\n\t\t\t{\n\t\t\t\tif (throwErrors == null)\n\t\t\t\t\tthrowErrors = true;\n\n\t\t\t\tif (throwErrors === true)\n\t\t\t\t{\n\t\t\t\t\tHot.echoUnsafe (content);\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tHot.echoUnsafe (content);\n\t\t\t\t}\n\t\t\t\tcatch (ex)\n\t\t\t\t{\n\t\t\t\t\tHot.echoUnsafe ("");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Outputs a ${JS Content} value.\n\t\t\t */\n\t\t\tfunction outputStr (value, possibleValue)\n\t\t\t{\n\t\t\t\tlet result = `\\${${value}}`;\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (possibleValue != null)\n\t\t\t\t\t\tresult = possibleValue;\n\t\t\t\t\telse\n\t\t\t\t\t\tresult = eval (value);\n\t\t\t\t}\n\t\t\t\tcatch (ex)\n\t\t\t\t{\n\t\t\t\t}\n\n\t\t\t\treturn (result);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Create a function for later execution on this page.\n\t\t\t */\n\t\t\tfunction createFunction (name, args, funcBody, isAsync)\n\t\t\t{\n\t\t\t\treturn (Hot.CurrentPage.addFunction (name, args, funcBody, isAsync));\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Create a test element.\n\t\t\t */\n\t\t\tfunction createTestElement (foundStr)\n\t\t\t{\n\t\t\t\tlet testElm = null;\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tlet obj = foundStr;\n\n\t\t\t\t\tif (typeof (foundStr) === "string")\n\t\t\t\t\t\tobj = JSON.parse (foundStr);\n\n\t\t\t\t\tif (typeof (obj) === "string")\n\t\t\t\t\t\ttestElm = new Hot.HotTestElement (obj);\n\n\t\t\t\t\tif (obj instanceof Array)\n\t\t\t\t\t\ttestElm = new Hot.HotTestElement (obj[0], obj[1], obj[2]);\n\n\t\t\t\t\tif (obj["name"] != null)\n\t\t\t\t\t\ttestElm = new Hot.HotTestElement (obj);\n\n\t\t\t\t\tif (Hot.CurrentPage.testElements[testElm.name] != null)\n\t\t\t\t\t\tthrow new Error (`Test element ${testElm.name} already exists!`);\n\n\t\t\t\t\tHot.CurrentPage.addTestElement (testElm);\n\t\t\t\t}\n\t\t\t\tcatch (ex)\n\t\t\t\t{\n\t\t\t\t\tthrow new Error (\n\t\t\t`Error processing test element ${foundStr} in ${Hot.CurrentPage.name}. Error: ${ex.message}`\n\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn (testElm);\n\t\t\t}\n\n\t\t\tasync function runContent (CurrentHotFile)\n\t\t\t{\n';
|
|
120
120
|
t+=u;m=yield(new Function(t+"\n\t\t\t}\n\n\t\t\treturn (runContent (PassedHotFile).then (() =>\n\t\t\t{\n\t\t\t\treturn ({\n\t\t\t\t\t\thot: Hot,\n\t\t\t\t\t\toutput: Hot.Output,\n\t\t\t\t\t\tdata: JSON.stringify (Hot.Data)\n\t\t\t\t\t});\n\t\t\t}));")).apply(this,[c.Hot,this])}catch(t){throw SyntaxError,t;}c.Hot.Data=m.hot.Data;a=m.output;if(c.Hot.Output="",c.Hot.Arguments=b,null!=c.Hot.Debugger&&!0===c.Hot.Debugger.benchmark)d=performance.now()-d,c.Hot.Debugger.processTotalTime+=d,c.Hot.Debugger.processCount>
|
|
121
|
-
0&&(c.Hot.Debugger.processAvgTime=c.Hot.Debugger.processTotalTime/c.Hot.Debugger.processCount),b=this.localFile,""!==this.url&&(b=this.url),c.Hot.CurrentPage.processor.logger.info(`Processed file "${this.name}" from "${b}" in ${d.toFixed(2)} ms. Average time: ${c.Hot.Debugger.processAvgTime.toFixed(2)} ms.`);return a})}}p.HotFile=
|
|
121
|
+
0&&(c.Hot.Debugger.processAvgTime=c.Hot.Debugger.processTotalTime/c.Hot.Debugger.processCount),b=this.localFile,""!==this.url&&(b=this.url),c.Hot.CurrentPage.processor.logger.info(`Processed file "${this.name}" from "${b}" in ${d.toFixed(2)} ms. Average time: ${c.Hot.Debugger.processAvgTime.toFixed(2)} ms.`);return a})}}p.HotFile=h},[8374](J,p){Object.defineProperty(p,"__esModule",{value:!0});p.HttpError=void 0;class v extends Error{constructor(w,x=400){super(w);this.name="HttpError";this.statusCode=
|
|
122
122
|
x}}p.HttpError=v},[3622](J,p){var v;Object.defineProperty(p,"__esModule",{value:!0});p.HotLog=p.HotLogLevel=void 0;(function(w){w[w.Info=0]="Info";w[w.Warning=1]="Warning";w[w.Error=2]="Error";w[w.Verbose=3]="Verbose";w[w.All=4]="All";w[w.None=5]="None"})(v||(p.HotLogLevel=v={}));p.HotLog=(()=>class{constructor(w=v.All){this.logLevel=w;this.showWebSocketEvents=this.showHTTPEvents=this.showResponses=!1}static parse(w){var x=v.All;return"info"===w&&(x=v.Info),"warning"===w&&(x=v.Warning),"error"===
|
|
123
123
|
w&&(x=v.Error),"verbose"===w&&(x=v.Verbose),"all"===w&&(x=v.All),"none"===w&&(x=v.None),x}log(w,x){this.logLevel===v.Verbose&&(w===v.Error&&this.error(x),w===v.Warning&&this.warning(x),w!==v.Info&&w!==v.Verbose||this.info(x));this.logLevel===v.All&&(w===v.Error&&this.error(x),w===v.Warning&&this.warning(x),w===v.Info&&this.info(x));this.logLevel===v.Error&&w===v.Error&&this.error(x);this.logLevel===v.Warning&&w===v.Warning&&this.warning(x);this.logLevel===v.Info&&w===v.Info&&this.info(x)}verbose(w,
|
|
124
124
|
x=null){this.logLevel===v.Verbose&&("string"==typeof w?console.info(w):console.info(w(x)))}info(w){this.logLevel!==v.All&&this.logLevel!==v.Verbose&&this.logLevel!==v.Info||console.info(w)}warning(w){this.logLevel!==v.All&&this.logLevel!==v.Verbose&&this.logLevel!==v.Warning||console.warn(w)}error(w){if(this.logLevel===v.All||this.logLevel===v.Verbose||this.logLevel===v.Error){let x="";"string"==typeof w?x=w:(null!=w.message&&(x=w.message),null!=w.stack&&(x=w.stack));console.error(x)}}})()},[6370](J,
|
|
125
|
-
p,v){var w=this&&this.__awaiter||function(k,r,n,l){return new (n||(n=Promise))(function(c,
|
|
125
|
+
p,v){var w=this&&this.__awaiter||function(k,r,n,l){return new (n||(n=Promise))(function(c,h){function a(b){try{u(l.next(b))}catch(m){h(m)}}function d(b){try{u(l.throw(b))}catch(m){h(m)}}function u(b){var m;b.done?c(b.value):(m=b.value,m instanceof n?m:new n(function(t){t(m)})).then(a,d)}u((l=l.apply(k,r||[])).next())})};Object.defineProperty(p,"__esModule",{value:!0});p.HotModule=void 0;var x=v(1814),E=v(5472);p.HotModule=class{constructor(k){this.name=k;this.import=[];this.html=[];this.css=[];this.js=
|
|
126
126
|
[];this.componentLibrary="";this.components=[]}outputCSS(k=!0){if(null!=this.css){var r="";return this.outputAsset("css",this.css,n=>{n=n.output();r+=`${n}\n`}),!0===k&&x.Hot.echoUnsafe(r),r}}outputJS(k=!0){if(null!=this.js){var r="";return this.outputAsset("js",this.js,n=>{n=n.output();r+=`${n}\n`}),!0===k&&x.Hot.echoUnsafe(r),r}}output(k){return w(this,arguments,void 0,function*(r,n=null){yield x.Hot.include(`${this.name}/${r}.hott`,n)})}loadHTML(){return w(this,void 0,void 0,function*(){if(null!=
|
|
127
127
|
this.html){var k={};this.outputAsset("html",this.html,r=>{r=r.output();if("string"==typeof r)throw Error("HTML assets cannot be outputted using only a string!");k[r.name]=r});yield x.Hot.CurrentPage.processor.loadHotFiles(k)}})}outputComponents(k=!0){if(null==this.components||this.components.length<1)return"";var r='<script type = "text/javascript">',n="";null!=this.componentLibrary&&""!==this.componentLibrary&&(n=`${this.componentLibrary}.`);for(let l=0;l<this.components.length;l++)r+=`Hot.CurrentPage.processor.addComponent (${n}${this.components[l]});\n`;
|
|
128
|
-
return r+="\x3c/script>",!0===k&&x.Hot.echoUnsafe(r),r}outputAsset(k,r=[],n){for(let l=0;l<r.length;l++){let c=r[l],
|
|
128
|
+
return r+="\x3c/script>",!0===k&&x.Hot.echoUnsafe(r),r}outputAsset(k,r=[],n){for(let l=0;l<r.length;l++){let c=r[l],h;h=new E.HotAsset(k);"string"==typeof c?h.path=c:(null!=c.name&&(h.name=c.name),null!=c.path&&(h.path=c.path),null!=c.content&&(h.content=c.content));n(h)}}}},[5989](J,p,v){var w=this&&this.__awaiter||function(k,r,n,l){return new (n||(n=Promise))(function(c,h){function a(b){try{u(l.next(b))}catch(m){h(m)}}function d(b){try{u(l.throw(b))}catch(m){h(m)}}function u(b){var m;b.done?c(b.value):
|
|
129
129
|
(m=b.value,m instanceof n?m:new n(function(t){t(m)})).then(a,d)}u((l=l.apply(k,r||[])).next())})};Object.defineProperty(p,"__esModule",{value:!0});p.HotPage=void 0;var x=v(1814),E=v(9343);p.HotPage=class{constructor(k){k instanceof E.HotStaq?(this.processor=k,this.name="",this.testerName="HotTesterMochaSelenium",this.testerMap="",this.route="",this.components={},this.files=[],this.functions={},this.testElements={},this.testPaths={}):(this.processor=k.processor,this.name=k.name||"",this.testerName=
|
|
130
130
|
k.testerName||"HotTesterMochaSelenium",this.testerMap=k.testerMap||"",this.route=k.route||"",this.components=k.components||{},this.files=k.files||[],this.functions=k.functions||{},this.testElements=k.testElements||{},this.testPaths=k.testPaths||{})}addFile(k){return w(this,void 0,void 0,function*(){k.page=this;this.files.push(k)})}getAPI(){return this.processor.api}getTesterAPI(){return this.processor.testerAPI}load(k){return w(this,void 0,void 0,function*(){for(let r=0;r<this.files.length;r++)yield this.files[r].load()})}process(){return w(this,
|
|
131
|
-
arguments,void 0,function*(k=null){var r="";for(let n=0;n<this.files.length;n++){let l=this.files[n];x.Hot.Output="";l.page=this;r+=yield l.process(k)}return r})}addFunction(k,r,n,l=!1){null==k&&(k="__func"+Object.keys(this.functions).length);var c="",
|
|
131
|
+
arguments,void 0,function*(k=null){var r="";for(let n=0;n<this.files.length;n++){let l=this.files[n];x.Hot.Output="";l.page=this;r+=yield l.process(k)}return r})}addFunction(k,r,n,l=!1){null==k&&(k="__func"+Object.keys(this.functions).length);var c="",h="";!0===l&&(h="async ");for(l=0;l<r.length;l++){let a=r[l],d=",";l==r.length-1&&(d="");c+=`${a}${d}`}return this.functions[k]=new Function(`return (${h}(${c}) => { ${n} }).apply (this, arguments);`),k}callFunction(k,r,n){var l=this.functions[r];if(null==
|
|
132
132
|
l)throw Error(`Function ${r} does not exist!`);return l.apply(k,n)}callAsyncFunction(k,r,n){return w(this,void 0,void 0,function*(){var l=this.functions[r];if(null==l)throw Error(`Function ${r} does not exist!`);return l.apply(k,n)})}addTestElement(k){if(null!=this.testElements[k.name])throw Error(`Test element ${k.name} already exists!`);this.testElements[k.name]=k}getTestElement(k){if(null==this.testElements[k])throw Error(`Test element ${k} doest not exist!`);return this.testElements[k]}createTestPath(k,
|
|
133
|
-
r){if(null!=this.testPaths[k])throw Error(`Test path ${k} already exists!`);this.testPaths[k]=r}}},[6801](J,p,v){function w(
|
|
134
|
-
t.type===n.HotValidReturnType.Delete)||t.type===n.HotValidReturnType.Return)return t;null!=t.validationType&&(b.type=t.validationType)}}if(!b)return{value:m};if(null!=
|
|
135
|
-
var D=n.HotStaq.valids[t];if(null==D)throw new l(`Validation '${t}' not found.`,t);if(null!=b.defaultValue&&null==m)return{value:b.defaultValue};t=A=>k(this,void 0,void 0,function*(){var H=null;if(D instanceof Function){if(H=yield D(
|
|
136
|
-
value:K}}return H});var C={type:n.HotValidReturnType.Return};if(m instanceof Array){let A=[];for(let H=0;H<m.length;H++){let K=yield t(m[H]);null!=K&&K.type===n.HotValidReturnType.Delete||A.push(K.value)}C.value=A}else C=yield t(m);if(null!=n.HotStaq.postValidate&&(C=yield n.HotStaq.postValidate(
|
|
137
|
-
{value:C.value}:x(
|
|
138
|
-
H.validations[
|
|
139
|
-
var k=this&&this.__awaiter||function(
|
|
140
|
-
a){super(
|
|
133
|
+
r){if(null!=this.testPaths[k])throw Error(`Test path ${k} already exists!`);this.testPaths[k]=r}}},[6801](J,p,v){function w(h){return k(this,void 0,void 0,function*(){var a={};for(let d in h){let u=h[d];a[d]="string"==typeof u?{validations:[{type:"Text"}]}:"function"==typeof u?yield u():u}return a})}function x(h,a,d,u,b){return k(this,void 0,void 0,function*(){var m=d[a];if(null!=n.HotStaq.preValidate){var t=yield n.HotStaq.preValidate(h,a,b,m,u);if(null!=t){if((null==t.type&&(t.type=n.HotValidReturnType.Return),
|
|
134
|
+
t.type===n.HotValidReturnType.Delete)||t.type===n.HotValidReturnType.Return)return t;null!=t.validationType&&(b.type=t.validationType)}}if(!b)return{value:m};if(null!=h.falsy&&!0===h.falsy(m)){if(h.falsyOptions===c.ThrowError)throw Error(`Falsy "${a}" triggered by value ${m}.`);if(h.falsyOptions===c.Delete)return{type:n.HotValidReturnType.Delete};if(h.falsyOptions===c.Continue)return{type:n.HotValidReturnType.Ignore}}t=b.type;if("Ignore"===t)return{value:m};if("Delete"===t)return{type:n.HotValidReturnType.Delete};
|
|
135
|
+
var D=n.HotStaq.valids[t];if(null==D)throw new l(`Validation '${t}' not found.`,t);if(null!=b.defaultValue&&null==m)return{value:b.defaultValue};t=A=>k(this,void 0,void 0,function*(){var H=null;if(D instanceof Function){if(H=yield D(h,a,b,A,u),null!=H&&(null==H.type&&(H.type=n.HotValidReturnType.Return),H.type===n.HotValidReturnType.Delete))return{type:n.HotValidReturnType.Delete}}else{let K;!(a in D)||m instanceof Array?K=yield E(h,D,A,u,a):(K=yield E(h,D,d,u,a),K=K[a]);H={type:n.HotValidReturnType.Return,
|
|
136
|
+
value:K}}return H});var C={type:n.HotValidReturnType.Return};if(m instanceof Array){let A=[];for(let H=0;H<m.length;H++){let K=yield t(m[H]);null!=K&&K.type===n.HotValidReturnType.Delete||A.push(K.value)}C.value=A}else C=yield t(m);if(null!=n.HotStaq.postValidate&&(C=yield n.HotStaq.postValidate(h,a,b,C.value,u),null!=C)){if(C.type===n.HotValidReturnType.Delete)return{type:n.HotValidReturnType.Delete};if(C.type===n.HotValidReturnType.Return)return{value:C.value}}return C.type===n.HotValidReturnType.Return?
|
|
137
|
+
{value:C.value}:x(h,a,C.value,u,b.next)})}function E(h,a,d,u){return k(this,arguments,void 0,function*(b,m,t,D,C=""){if(!(t instanceof Object))throw Error(`Parameter '${C}' must be an object.`);if(!0===b.strictInput)for(var A in t)if(!(A in m))throw Error(`Unexpected parameter '${A}' provided.`);for(let K in m){var H=void 0;A=m[K];if(H="function"==typeof A?yield A():"string"==typeof A?{validations:[{type:A}]}:A,K in t){A=t[K];let P=null;if(H.validations){let M=null;H.required;for(let W=0;W<H.validations.length;W++){let z=
|
|
138
|
+
H.validations[W];try{let f=yield x(b,K,t,D,z);P=f.type;A=f.value;M=null;break}catch(f){if(f instanceof l)throw f;M=f}}if(null!=M)throw M;}if(null!=P&&P===n.HotValidReturnType.Delete)delete t[K];else{if(H.parameters){if("object"!=typeof A||null===A)throw Error(`Parameter '${K}' must be an object.`);H=yield w(H.parameters);A=yield E(b,H,A,D,K)}t[K]=A}}else if(!0===H.required)throw b="",""!==C&&(b=` Parent Key: '${C}'`),new r.HttpError(`Parameter '${K}' is required but not provided.${b}`,400);}return t})}
|
|
139
|
+
var k=this&&this.__awaiter||function(h,a,d,u){return new (d||(d=Promise))(function(b,m){function t(A){try{C(u.next(A))}catch(H){m(H)}}function D(A){try{C(u.throw(A))}catch(H){m(H)}}function C(A){var H;A.done?b(A.value):(H=A.value,H instanceof d?H:new d(function(K){K(H)})).then(t,D)}C((u=u.apply(h,a||[])).next())})};Object.defineProperty(p,"__esModule",{value:!0});p.ValidationOptions=p.FalsyOptions=p.ValidationError=void 0;p.validateRecursively=x;p.processInput=E;var r=v(8374),n=v(9343);class l extends Error{constructor(h,
|
|
140
|
+
a){super(h);this.name="HttpError";this.validType=a}}var c;p.ValidationError=l;(function(h){h[h.ThrowError=0]="ThrowError";h[h.Delete=1]="Delete";h[h.Continue=2]="Continue"})(c||(p.FalsyOptions=c={}));p.ValidationOptions=(()=>class{constructor(h=!1){this.strictInput=h;this.falsy=null;this.falsyOptions=c.Continue}})()},[7605](J,p,v){Object.defineProperty(p,"__esModule",{value:!0});p.HotRoute=void 0;var w=v(9844);class x{constructor(E,k,r=[]){this.onAuthorizeUser=this.onPostRegister=this.onRegister=
|
|
141
141
|
this.onPreRegister=null;this.connection=E;this.logger=null;null!=this.connection&&null!=this.connection.processor&&(this.logger=this.connection.processor.logger);this.route=k;this.description="";this.openAPI=null;this.version="v1";this.prefix="";this.methods=r;this.errors={not_authorized:x.createError("Not authorized."),no_server_execute_function:x.createError("Missing server execute function.",500)}}static createError(E,k=400){return{error:E,errorCode:k}}addMethod(E,k=null,r=w.HotEventMethod.POST,
|
|
142
142
|
n=null){return"string"==typeof E&&(E=w.HotRouteMethod.create(this,E,k,r,null,null,n)),E instanceof w.HotRouteMethod||(null==E.route&&(E.route=this),E=w.HotRouteMethod.create(E)),this.methods.push(E),E}getMethod(E){var k=null;for(let r=0;r<this.methods.length;r++){let n=this.methods[r];if(n.name===E){k=n;break}}return k}}p.HotRoute=x},[9844](J,p,v){var w=this&&this.__awaiter||function(a,d,u,b){return new (u||(u=Promise))(function(m,t){function D(H){try{A(b.next(H))}catch(K){t(K)}}function C(H){try{A(b.throw(H))}catch(K){t(K)}}
|
|
143
143
|
function A(H){var K;H.done?m(H.value):(K=H.value,K instanceof u?K:new u(function(P){P(K)})).then(D,C)}A((b=b.apply(a,d||[])).next())})};Object.defineProperty(p,"__esModule",{value:!0});p.HotRouteMethod=p.HotValidationType=p.ServerRequest=p.PassType=p.HotEventMethod=void 0;var x=v(1814),E=v(7605),k=v(3205),r=v(6801),n,l,c;!function(a){a.GET="get";a.POST="post";a.FILE_UPLOAD="file_upload_then_post_json";a.SSE_SUB_EVENT="sse_sub_event";a.WEBSOCKET_CLIENT_PUB_EVENT="websocket_client_pub_event";a.POST_AND_WEBSOCKET_CLIENT_PUB_EVENT=
|
|
144
144
|
"post_and_websocket_client_pub_event"}(n||(p.HotEventMethod=n={}));(function(a){a[a.ReturnToClient=0]="ReturnToClient";a[a.Update=1]="Update";a[a.Ignore=2]="Ignore"})(l||(p.PassType=l={}));p.ServerRequest=(()=>class{constructor(a=null){null==a&&(a={});this.req=a.req||null;this.res=a.res||null;this.bearerToken=a.bearerToken||"";this.wsSocket=a.wsSocket||null;this.authorizedValue=a.authorizedValue||null;this.jsonObj=a.jsonObj||null;this.queryObj=a.queryObj||null;this.files=a.files||null;this.onClose=
|
|
145
145
|
a.onClose||null}httpWrite(a,d){return w(this,void 0,void 0,function*(){if(null==this.res)throw Error("Cannot close HTTP response because it is null!");return new Promise((u,b)=>{!0===this.res.writable?(b=d,"string"!=typeof d&&(b=JSON.stringify(d)),this.res.write(`event: ${a}\ndata: ${b}\n\n`,m=>{if(null!=m)throw m;u()})):u()})})}httpWriteRaw(a){return w(this,void 0,void 0,function*(){if(null==this.res)throw Error("Cannot close HTTP response because it is null!");return new Promise((d,u)=>{!0===this.res.writable?
|
|
146
146
|
this.res.write(a,b=>{if(null!=b)throw b;d()}):d()})})}httpClose(){if(null==this.res)throw Error("Cannot close HTTP response because it is null!");this.res.end()}})();(function(a){a.UUID="UUID";a.Boolean="boolean";a.Number="number";a.Integer="Integer";a.Float="Float";a.Text="Text";a.Email="Email";a.Phone="Phone";a.URL="URL";a.IPv4="IPv4";a.IP="IP";a.IPv6="IPv6";a.Date="Date";a.Object="Object";a.Array="Array";a.Map="Map";a.Enum="Enum";a.JSON="JSON";a.JS="JS";a.Undefined="undefined";a.Null="null"})(c||
|
|
147
|
-
(p.HotValidationType=c={}));class
|
|
148
|
-
this.onPostRegister=this.onRegister=this.onPreRegister=null}static create(a,d="",u=null,b=n.POST,m=null,t=null,D=null){var C=new
|
|
147
|
+
(p.HotValidationType=c={}));class h{constructor(){this.route=null;this.description=this.name="";this.openAPI=null;this.tags=[];this.returns=null;this.validateQueryInput=new r.ValidationOptions;this.validateJSONInput=new r.ValidationOptions;this.parametersRefName="";this.parameters={};this.queryParameters={};this.type=n.POST;this.isRegistered=!1;this.executeSetup=!0;this.testCases={};this.onValidateJSONInput=this.onValidateQueryInput=this.onClientExecute=this.onServerExecute=this.onServerAuthorize=
|
|
148
|
+
this.onPostRegister=this.onRegister=this.onPreRegister=null}static create(a,d="",u=null,b=n.POST,m=null,t=null,D=null){var C=new h;if(a instanceof E.HotRoute)var A=a;else{if(A=a.route,null!=a.type&&(b=a.type),null!=a.name&&(d=a.name),null!=a.name&&(C.tags=a.tags),null!=a.description&&(C.description=a.description),null!=a.openAPI&&(C.openAPI=a.openAPI),null!=a.validateQueryInput&&(C.validateQueryInput=a.validateQueryInput),null!=a.validateJSONInput&&(C.validateJSONInput=a.validateJSONInput),null!=
|
|
149
149
|
a.parametersRefName&&(C.parametersRefName=a.parametersRefName),null!=a.queryParameters&&(C.queryParameters=a.queryParameters),null!=a.returns&&("string"==typeof a.returns?C.returns={type:"string",required:!0,description:a.returns}:(a.returns,C.returns=a.returns)),null!=a.parameters)if(a.parameters instanceof Function)C.parameters=a.parameters;else for(let H in a.parameters){let K=a.parameters[H];"string"==typeof K?C.parameters[H]={type:"string",required:!1,description:K}:("function"==typeof K||null==
|
|
150
150
|
K.type&&(K.type="string"),C.parameters[H]=K)}null!=a.onServerExecute&&(u=a.onServerExecute);null!=a.onServerAuthorize&&(m=a.onServerAuthorize);null!=a.onRegister&&(t=a.onRegister);null!=a.onPostRegister&&(C.onPostRegister=a.onPostRegister);null!=a.onServerExecute&&(C.onServerExecute=a.onServerExecute);null!=a.onClientExecute&&(C.onClientExecute=a.onClientExecute);null!=a.onValidateQueryInput&&(C.onValidateQueryInput=a.onValidateQueryInput);null!=a.onValidateJSONInput&&(C.onValidateJSONInput=a.onValidateJSONInput);
|
|
151
151
|
null!=a.testCases&&(D=a.testCases)}if(""===d)throw Error("All route methods must have a name!");if(C.route=A,C.name=d,C.type=b,C.isRegistered=!1,C.executeSetup=!1,C.onServerAuthorize=m,C.onRegister=t,C.testCases={},C.route.connection.processor.mode===x.DeveloperMode.Development&&null!=D)if(D instanceof Array)for(a=0;a<D.length;a++)d=D[a],"string"==typeof d?(C.addTestCase(d,D[a+1]),a++):C.addTestCase(d);else for(let H in D)C.addTestCase(D[H]);return C.route.connection instanceof k.HotServer&&(C.onServerExecute=
|
|
152
152
|
u),C}addTestCase(a,d=null){if("string"==typeof a)return void(this.testCases[a]={name:a,func:d});if("function"==typeof a)return d=Object.keys(this.testCases).length,d=`${this.route.route}/${this.name} test case ${d}`,void(this.testCases[d]={name:d,func:a});this.testCases[a.name]=a}getRouteUrl(){if(null==this.route)throw Error(`Route method ${this.name} does not have a parent route!`);var a="/";return""!==this.route.version&&(a+=`${this.route.version}/`),""!==this.route.prefix&&(a+=`${this.route.prefix}/`),
|
|
153
|
-
""!==this.route.route&&(a+=`${this.route.route}/`),a+=this.name,a}}p.HotRouteMethod=
|
|
153
|
+
""!==this.route.route&&(a+=`${this.route.route}/`),a+=this.name,a}}p.HotRouteMethod=h},[3205](J,p,v){var w=this&&this.__awaiter||function(k,r,n,l){return new (n||(n=Promise))(function(c,h){function a(b){try{u(l.next(b))}catch(m){h(m)}}function d(b){try{u(l.throw(b))}catch(m){h(m)}}function u(b){var m;b.done?c(b.value):(m=b.value,m instanceof n?m:new n(function(t){t(m)})).then(a,d)}u((l=l.apply(k,r||[])).next())})};Object.defineProperty(p,"__esModule",{value:!0});p.HotServer=p.HotServerType=void 0;
|
|
154
154
|
var x=v(9343),E;!function(k){k[k.HTTP=0]="HTTP";k[k.WebSockets=1]="WebSockets";k[k.Generate=2]="Generate";k[k.WebTesting=3]="WebTesting";k[k.APITesting=4]="APITesting"}(E||(p.HotServerType=E={}));p.HotServer=(()=>class{constructor(k){k instanceof x.HotStaq?(this.processor=k,this.serverType="Server",this.api=null,this.listenAddress="0.0.0.0",this.ports={http:5E3,https:443},this.ssl={cert:"",key:"",ca:""},this.redirectHTTPtoHTTPS=!0,this.type=E.HTTP,this.logger=k.logger,this.secrets={}):(this.processor=
|
|
155
155
|
k.processor,this.serverType=k.serverType||"Server",this.api=k.api||null,this.listenAddress=k.listenAddress||"0.0.0.0",this.ports=k.ports||{http:5E3,https:443},this.ssl=k.ssl||{cert:"",key:"",ca:""},this.redirectHTTPtoHTTPS=null==k.redirectHTTPtoHTTPS||k.redirectHTTPtoHTTPS,this.type=k.type||E.HTTP,this.logger=k.logger,this.secrets=k.secrets||{})}setAPI(k){return w(this,void 0,void 0,function*(){this.api=this.processor.api=k})}})()},[5269](J,p){Object.defineProperty(p,"__esModule",{value:!0})},[9343](J,
|
|
156
|
-
p,v){var w=this&&this.__createBinding||(Object.create?function(g,
|
|
157
|
-
Object.getOwnPropertyNames||function(
|
|
158
|
-
|
|
159
|
-
0]="Delete";
|
|
156
|
+
p,v){var w=this&&this.__createBinding||(Object.create?function(f,g,q,e){void 0===e&&(e=q);var y=Object.getOwnPropertyDescriptor(g,q);y&&("get"in y?g.__esModule:!y.writable&&!y.configurable)||(y={enumerable:!0,get:function(){return g[q]}});Object.defineProperty(f,e,y)}:function(f,g,q,e){void 0===e&&(e=q);f[e]=g[q]}),x=this&&this.__setModuleDefault||(Object.create?function(f,g){Object.defineProperty(f,"default",{enumerable:!0,value:g})}:function(f,g){f.default=g});J=this&&this.__importStar||(E=function(f){return E=
|
|
157
|
+
Object.getOwnPropertyNames||function(g){var q=[],e;for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(q[q.length]=e);return q},E(f)},function(f){if(f&&f.__esModule)return f;var g={};if(null!=f)for(var q=E(f),e=0;e<q.length;e++)"default"!==q[e]&&w(g,f,q[e]);return x(g,f),g});var E,k=this&&this.__awaiter||function(f,g,q,e){return new (q||(q=Promise))(function(y,B){function G(S){try{T(e.next(S))}catch(R){B(R)}}function F(S){try{T(e.throw(S))}catch(R){B(R)}}function T(S){var R;S.done?y(S.value):(R=
|
|
158
|
+
S.value,R instanceof q?R:new q(function(X){X(R)})).then(G,F)}T((e=e.apply(f,g||[])).next())})},r=this&&this.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(p,"__esModule",{value:!0});p.HotStaq=p.HotValidReturnType=void 0;var n=J(v(9247)),l=r(v(2365)),c=r(v(7963)),h=r(v(5454)),a=v(5989),d=v(8296),u=v(3622);J=v(6044);var b=v(1814),m=v(5472),t=v(3025),D=v(6681),C=v(6434),A=v(4744),H=v(6019);r=v(6061);var K=v(9844),P=v(6801),M=v(8374),W;!function(f){f[f.Delete=
|
|
159
|
+
0]="Delete";f[f.Return=1]="Return";f[f.Ignore=2]="Ignore"}(W||(p.HotValidReturnType=W={}));class z{constructor(f={}){this.logger=new u.HotLog(u.HotLogLevel.All);this.startDelay=0;this.api=f.api||null;this.testerAPI=f.testerAPI||null;this.mode=f.mode||b.DeveloperMode.Production;this.pages=f.pages||{};this.modules=f.modules||{};this.components=f.components||{};this.files=f.files||{};this.hotSite=f.hotSite||null;this.apiContent="\n\t\t\t{\n\t\t\t\tvar %api_name% = %api_exported_name%.%api_name%;\n\t\t\t\tvar newHotClient = new HotClient (processor);\n\t\t\t\tvar newapi = new %api_name% (%base_url%, newHotClient);\n\t\t\t\tnewHotClient.api = newapi;\n\t\t\t\tprocessor.api = newapi;\n\t\t\t}";
|
|
160
160
|
this.testerApiContent="\n\t\t\tvar HotTesterAPI = HotStaqWeb.HotTesterAPI;\n\t\t\tvar newHotTesterClient = new HotClient (processor);\n\t\t\tvar newtesterapi = new HotTesterAPI (%base_tester_url%, newHotTesterClient);\n\t\t\tnewHotTesterClient.testerAPI = newtesterapi;\n\t\t\tprocessor.testerAPI = newtesterapi;";this.pageContent='<!DOCTYPE html>\n<html>\n\n<head>\n\t<title>%title%</title>\n\n\t<script type = "text/javascript" src = "%hotstaq_js_src%">\x3c/script>\n\t<script type = "text/javascript">\n\t\twindow.hotstaqStartingApp = true;\n\n\t\tfor (let key in HotStaqWeb)\n\t\t\twindow[key] = HotStaqWeb[key];\n\t\x3c/script>\n\n%apis_to_load%\n\n\t<script type = "text/javascript">\n\t\tasync function hotstaq_startApp ()\n\t\t{\n\t\t\tlet tempMode = 0;\n\n\t\t\tif (window["Hot"] != null)\n\t\t\t\ttempMode = Hot.Mode;\n\n\t\t\t%start_delay%\n\n\t\t\tvar processor = new HotStaq ();\n\t\t\tprocessor.logger.logLevel = %logging_level%;\n\n\t\t\tvar promises = [];\n\t\t\t%developer_mode%\n\n\t\t\t%api_code%\n\n\t\t\t%public_secrets%\n\t\t\t%tester_api%\n\t\t\t%load_files%\n\n\t\t\tprocessor.mode = tempMode;\n\n\t\t\tPromise.all (promises).then (function ()\n\t\t\t\t{\n\t\t\t\t\tHotStaq.displayUrl ({\n\t\t\t\t\t\t\turl: "%url%",\n\t\t\t\t\t\t\tname: "%title%",\n\t\t\t\t\t\t\tprocessor: processor,\n\t\t\t\t\t\t\targs: %args%,\n\t\t\t\t\t\t\ttesterName: %tester_name%,\n\t\t\t\t\t\t\ttesterMap: %tester_map%,\n\t\t\t\t\t\t\ttesterAPIBaseUrl: %tester_api_base_url%,\n\t\t\t\t\t\t\ttesterLaunchpadUrl: %tester_launchpad_url%\n\t\t\t\t\t\t});\n\t\t\t\t});\n\t\t}\n\n\t\thotstaq_startApp ();\n\t\x3c/script>\n</head>\n\n<body>\n</body>\n\n</html>';
|
|
161
|
-
this.publicKeys={};this.testers={}}static baseValidator(g,
|
|
162
|
-
if(void 0!==
|
|
163
|
-
400);return{value:e}};z.valids.null=function(g,
|
|
164
|
-
400);if(q.regex&&!1===("string"==typeof q.regex?new RegExp(q.regex):q.regex).test(e))throw new M.HttpError(`Text parameter '${
|
|
165
|
-
400);if(void 0!==q.max&&e>q.max)throw new M.HttpError(`The value of number parameter '${
|
|
166
|
-
400);if(void 0!==q.max&&e>q.max)throw new M.HttpError(`The value of number parameter '${
|
|
167
|
-
400);if(void 0!==q.max&&e>q.max)throw new M.HttpError(`The value of number parameter '${
|
|
168
|
-
q,e,y){if("string"!=typeof e&&!0===
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
400);
|
|
173
|
-
|
|
174
|
-
400);if(null!=q.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
q])=>[
|
|
180
|
-
parameters:e.
|
|
181
|
-
e&&(e={typeConversions:{Date:"string"},returnFirstUnionType:!0,unknownTypeDefaultsToType:"string",tsconfigPath:null});
|
|
182
|
-
|
|
183
|
-
{type:
|
|
184
|
-
|
|
185
|
-
return
|
|
186
|
-
|
|
187
|
-
this.components[
|
|
188
|
-
|
|
189
|
-
(e=!1),null!=q.errors&&q.errors.length>0&&(e=!1),!1===e&&!0===
|
|
190
|
-
case "integer":case "int":return"integer";case "number":case "float":return"number";case "boolean":case "bool":return"boolean";case "array":return"array";case "object":case "map":return"object";
|
|
191
|
-
"array"===
|
|
192
|
-
if(null!=
|
|
193
|
-
g.testMaps[
|
|
194
|
-
|
|
195
|
-
null!=g?
|
|
196
|
-
|
|
197
|
-
this.logger.verbose(`Accessed site ${
|
|
198
|
-
".yml"===
|
|
199
|
-
(G.localFile=B.localFile);let F=!0;null!=B.content&&(G.content=B.content,F=!1);!0===q&&(F=!0);!1===e&&""!==G.url&&(F=!1);!0===F&&(this.logger.verbose(`Loading Hott file: ${G.url}`),yield G.load(),this.logger.verbose(`Finished loading Hott file: ${G.url}`));
|
|
200
|
-
""!==this.hotSite.server.globalApi){var
|
|
201
|
-
null==
|
|
202
|
-
this.hotSite.routes[
|
|
203
|
-
|
|
204
|
-
if("string"==typeof
|
|
205
|
-
(Qa="tempMode = HotStaqWeb.DeveloperMode.Development;",null!=this.hotSite&&null!=this.hotSite.testing&&null!=this.hotSite.testing.web&&(Da=this.testerApiContent,null==this.hotSite.testing.web.testerAPIUrl&&(this.hotSite.testing.web.testerAPIUrl="http://127.0.0.1:8182"),Da=Da.replace(/%base_tester_url%/g,`"${this.hotSite.testing.web.testerAPIUrl}"`)));var Ea="";if(Object.keys(this.files).length>
|
|
206
|
-
""!==la.localFile&&(sa.path=la.localFile);""!==la.url&&(sa.path=la.url);""!==la.content&&(sa.path="",sa.content=la.content);la=yield sa.output();if("string"==typeof la)throw Error("During initial load, HTML assets cannot be outputted using only a string!");var wa=sa="";null!=la.url&&(sa=`"url": "${la.url}", `);null!=la.content&&(wa=`"content": ${la.content}`);Ea+=`\t\t\tfiles["${la.name}"] = { ${sa}${wa} };\n`}Ea+=
|
|
207
|
-
q);!0===B&&(ea=ea.replace(/%args%/g,"Hot.Arguments"));null!=G&&(ea=ea.replace(/%args%/g,JSON.stringify(G)));za=
|
|
208
|
-
null!=this.hotSite.routes&&null!=this.hotSite.routes[
|
|
209
|
-
|
|
210
|
-
F.status(200).send(B)})}})}addTester(
|
|
211
|
-
if(null==this.hotSite.testing)throw Error("The HotSite does not have a testing object!");if(null==this.hotSite.testing.api)throw Error("The HotSite does not have a testing api object!");if(null==this.hotSite.testing.api.maps)throw Error("The HotSite testing object does not have any maps!");return this.hotSite.testing.api.maps}getRouteKeyFromName(
|
|
212
|
-
this.hotSite.web[q]){
|
|
213
|
-
for(let q=0;q<
|
|
214
|
-
arguments,void 0,function*(
|
|
215
|
-
void 0,void 0,function*(){var
|
|
216
|
-
String(
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
if(null!=y.redirect)return void(window.location.href=y.redirect);null!=y.src&&(e=y.src)}else for(var B=0;B<z.routerWildcards.length;B++){
|
|
220
|
-
0&&(
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
z.
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
null
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
yield x.HotStaq.wait(10)}})}static interpretDestination(k,r){k={mapName:k,url:"",api:"",paths:[]};r=r.destination.split(/\->/g);var n=r[0];if(n.length<2||"/"===n[0]&&"/"===n[1])return null;var l=(c,
|
|
262
|
-
r,n){return w(this,arguments,void 0,function*(l,c,
|
|
263
|
-
void 0,void 0,function*(){var r=[];if(null==this.testMaps[k.mapName])throw Error(`HotTester: API Map ${k.mapName} does not exist!`);if(null==this.processor.api)throw Error("HotTester: Associated processor does not have an API!");var n=this.processor.api.routes[k.api];if(null==n)throw Error(`HotTester: API does not have route ${k.api}!`);for(let c=0;c+1<k.paths.length;c+=2){var l=k.paths[c].path;let
|
|
264
|
-
l=yield this.executeTestAPIPath(k,
|
|
265
|
-
a){if(null==d)throw Error(`HotTester: Test path ${u} does not have a function!`);l=yield d(this.driver)}return!1===c&&null!=this.onTestPagePathEnd&&(yield this.onTestPagePathEnd(n,d,l,
|
|
266
|
-
u):[]},
|
|
267
|
-
yield this.driver.waitForTestElement(u)})),!0===l(r.cmd,"waitForTesterAPIData")&&(
|
|
268
|
-
!0===l(r.cmd,"click")&&(a=c(r.cmd),
|
|
269
|
-
yield(yield this.driver.waitForTestElement(u)).sendKeys(b)})),!0===l(r.cmd,"clear")&&(a=c(r.cmd),
|
|
270
|
-
r,n,a,
|
|
161
|
+
this.publicKeys={};this.testers={}}static baseValidator(f,g,q,e,y=4096){if(null==q.max&&"string"==typeof e&&e.length>y)throw new M.HttpError(`Parameter '${g}' is longer than ${y} characters.`,400);if(q.notEmptyOrNull){if(null==e)throw Error(`Parameter '${g}' must not be empty or null.`);if("string"==typeof e&&""===e)throw Error(`Parameter '${g}' must not be empty or null.`);}if(q.comparison){f=q.comparison;if(void 0!==f.greaterThan&&!(e>f.greaterThan))throw Error(`Parameter '${g}' must be greater than ${f.greaterThan}.`);
|
|
162
|
+
if(void 0!==f.lessThan&&!(e<f.lessThan))throw Error(`Parameter '${g}' must be less than ${f.lessThan}.`);if(void 0!==f.eq&&e!==f.eq)throw Error(`Parameter '${g}' must equal ${f.eq}.`);if(void 0!==f.not&&e===f.not)throw Error(`Parameter '${g}' must not equal ${f.not}.`);}if(q.values&&q.values.length>0&&!q.values.includes(e))throw Error(`Parameter '${g}' must be one of the allowed values.`);return!0}static setupValidators(){z.valids[void 0]=function(f,g,q,e,y){if(void 0!==e&&!0===f.strictInput)throw new M.HttpError(`Parameter '${g}' must be undefined.`,
|
|
163
|
+
400);return{value:e}};z.valids.null=function(f,g,q,e,y){if(null!==e&&!0===f.strictInput)throw new M.HttpError(`Parameter '${g}' must be null.`,400);return{value:e}};z.valids.Text=function(f,g,q,e,y){if("string"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`Parameter '${g}' must be a string.`,400);if(z.baseValidator(f,g,q,e),void 0!==q.min&&e.length<q.min)throw new M.HttpError(`Text parameter '${g}' must be at least ${q.min} characters long.`,400);if(void 0!==q.max&&e.length>q.max)throw new M.HttpError(`Text parameter '${g}' must be at most ${q.max} characters long.`,
|
|
164
|
+
400);if(q.regex&&!1===("string"==typeof q.regex?new RegExp(q.regex):q.regex).test(e))throw new M.HttpError(`Text parameter '${g}' does not match the required regex pattern ${q.regex}`,400);return{value:e}};z.valids.number=function(f,g,q,e,y){if("number"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`Parameter '${g}' must be a number.`,400);if(z.baseValidator(f,g,q,e,100),e=parseFloat(e),void 0!==q.min&&e<q.min)throw new M.HttpError(`The value of number parameter '${g}' must be greater than ${q.min}.`,
|
|
165
|
+
400);if(void 0!==q.max&&e>q.max)throw new M.HttpError(`The value of number parameter '${g}' must be less than ${q.max}.`,400);return{value:e}};z.valids.Number=z.valids.number;z.valids.Integer=function(f,g,q,e,y){if("number"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`Parameter '${g}' must be a number.`,400);if(z.baseValidator(f,g,q,e,100),e=parseInt(e),!0===isNaN(e))throw new M.HttpError(`The value of number parameter '${g}' must be an integer.`,400);if(void 0!==q.min&&e<q.min)throw new M.HttpError(`The value of number parameter '${g}' must be greater than ${q.min}.`,
|
|
166
|
+
400);if(void 0!==q.max&&e>q.max)throw new M.HttpError(`The value of number parameter '${g}' must be less than ${q.max}.`,400);return{value:e}};z.valids.Float=function(f,g,q,e,y){if("number"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`Parameter '${g}' must be a number.`,400);if(z.baseValidator(f,g,q,e,100),e=parseFloat(e),!0===isNaN(e))throw new M.HttpError(`The value of number parameter '${g}' must be an float.`,400);if(void 0!==q.min&&e<q.min)throw new M.HttpError(`The value of number parameter '${g}' must be greater than ${q.min}.`,
|
|
167
|
+
400);if(void 0!==q.max&&e>q.max)throw new M.HttpError(`The value of number parameter '${g}' must be less than ${q.max}.`,400);return{value:e}};z.valids.boolean=function(f,g,q,e,y){if("boolean"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`Boolean parameter '${g}' must be a boolean.`,400);if("string"==typeof e&&e.length>20)throw new M.HttpError(`Parameter '${g}' is longer than 20 characters.`,400);return{value:z.parseBoolean(e)}};z.valids.Boolean=z.valids.boolean;z.valids.UUID=function(f,g,
|
|
168
|
+
q,e,y){if("string"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`UUID parameter '${g}' must be a string.`,400);if(z.baseValidator(f,g,q,e,100),!1===z.isUUID(e))throw new M.HttpError(`UUID parameter '${g}' must be a valid UUID.`,400);return{value:e}};z.valids.URL=function(f,g,q,e,y){if("string"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`URL parameter '${g}' must be a string.`,400);if(z.baseValidator(f,g,q,e,8192),!1===/^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/[^\s]*)?$/.test(e))throw new M.HttpError(`URL parameter '${g}' must be a valid http or https url.`,
|
|
169
|
+
400);return{value:e}};z.valids.Email=function(f,g,q,e,y){if("string"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`Email parameter '${g}' must be a string.`,400);if(z.baseValidator(f,g,q,e),!1===/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))throw new M.HttpError(`Email parameter '${g}' must be a valid email.`,400);return{value:e}};z.valids.Phone=function(f,g,q,e,y){if("string"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`Phone parameter '${g}' must be a string.`,400);if(z.baseValidator(f,g,
|
|
170
|
+
q,e,100),!1===/^\+?[1-9]\d{1,14}$/.test(e))throw new M.HttpError(`Phone parameter '${g}' must be a valid phone number using regex /^\\+?[1-9]\\d{1,14}$/.`,400);return{value:e}};z.valids.IPv4=function(f,g,q,e,y){if("string"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`Phone parameter '${g}' must be a string.`,400);if(z.baseValidator(f,g,q,e,100),!1===/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e))throw new M.HttpError(`IPv4 parameter '${g}' must be a valid IPv4 address.`,
|
|
171
|
+
400);return{value:e}};z.valids.IP=z.valids.IPv4;z.valids.IPv6=function(f,g,q,e,y){if("string"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`Phone parameter '${g}' must be a string.`,400);if(z.baseValidator(f,g,q,e,100),!1===/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,7}:/.test(e))throw new M.HttpError(`IPv4 parameter '${g}' must be a valid IPv4 address.`,400);return{value:e}};z.valids.Date=function(f,g,q,e,y){if(!(e instanceof Date)&&"string"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`Date parameter '${g}' must be a string or Date.`,
|
|
172
|
+
400);if(z.baseValidator(f,g,q,e),isNaN(Date.parse(e)))throw new M.HttpError(`Date parameter '${g}' must be a valid date.`);return{value:e}};z.valids.Object=function(f,g,q,e,y){return k(this,void 0,void 0,function*(){if("object"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`Object parameter '${g}' must be an object.`,400);if(q.properties)for(let B in q.properties){let G=q.properties[B],F=z.getParamUnsafe(B,e,!0,!0);yield(0,P.validateRecursively)(f,B,F,y,G)}return{value:e}})};z.valids.Array=
|
|
173
|
+
function(f,g,q,e,y){return k(this,void 0,void 0,function*(){if(e instanceof Array==0&&!0===f.strictInput)throw new M.HttpError(`Array parameter '${g}' must be a string.`,400);if(!1===Array.isArray(e))throw new M.HttpError(`Parameter '${g}' must be an array.`,400);if(null==q.associatedValids)throw new M.HttpError(`Parameter '${g}' must have an associated type(s) that describes each item.`,400);if(null!=q.notEmptyOrNull&&0===e.length)throw new M.HttpError(`Array parameter '${g}' must not be empty or null.`,
|
|
174
|
+
400);if(null!=q.min&&e.length<q.min)throw new M.HttpError(`Array parameter '${g}' must have at least ${q.min} items.`,400);if(null!=q.max&&e.length>q.max)throw new M.HttpError(`Array parameter '${g}' must have at most ${q.max} items.`,400);for(let B=0;B<e.length;B++){let G=e[B];for(let F=0;F<q.associatedValids.length;F++)yield(0,P.validateRecursively)(f,g,G,y,q.associatedValids[F])}return{value:e}})};z.valids.Map=function(f,g,q,e,y){return k(this,void 0,void 0,function*(){if("object"!=typeof e&&!0===
|
|
175
|
+
f.strictInput)throw new M.HttpError(`Map parameter '${g}' must be an object or map.`,400);if(null==q.associatedValids)throw new M.HttpError(`Parameter '${g}' must have an associated type that describes each map property.`,400);for(let B in e){let G=e[B];for(let F=0;F<q.associatedValids.length;F++)yield(0,P.validateRecursively)(f,B,G,y,q.associatedValids[F])}return{value:e}})};z.valids.Enum=function(f,g,q,e,y){if("string"!=typeof e&&"number"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`Enum parameter '${g}' must be a string or number.`,
|
|
176
|
+
400);if("string"==typeof e&&e.length>1024)throw new M.HttpError(`Parameter '${g}' is longer than 1024 characters.`,400);if(q.values&&!q.values.includes(e))throw new M.HttpError(`Enum parameter '${g}' must be one of the allowed enum values: ${q.values.join(", ")}`,400);return{value:e}};z.valids.JSON=function(f,g,q,e,y){return k(this,void 0,void 0,function*(){if("string"==typeof e&&e.length>1024)throw new M.HttpError(`JSON Parameter '${g}' is longer than 1024 characters.`,400);return{value:e=JSON.parse(e)}})};
|
|
177
|
+
z.valids.JS=function(f,g,q,e,y){return k(this,void 0,void 0,function*(){if(!(e instanceof Function)&&"string"!=typeof e&&!0===f.strictInput)throw new M.HttpError(`JS parameter '${g}' must be a string or Function.`,400);if(null==q.func)throw new M.HttpError(`JS parameter '${g}' must be a valid JS function.`,400);return yield q.func(f,g,e)})}}static setValid(f,g){z.valids[f]=g}static parseBoolean(f){if(null==f)return!1;if("boolean"==typeof f)return f;if("number"==typeof f||"bigint"==typeof f)return 0!==
|
|
178
|
+
f;if("string"==typeof f){if(""===f)return!1;if("true"===(f=f.toLowerCase()))return!0;if("false"===f)return!1;if("yes"===f)return!0;if("no"===f)return!1;if("yep"===f)return!0}return!1}static isUUID(f){return"string"==typeof f&&z.uuidRegex.test(f)}static removeStaleDuplicateIds(f){if(null!=f&&"undefined"!=typeof document){var g=[];null!=f.id&&""!==f.id&&g.push(f.id);var q=f.querySelectorAll("[id]");for(var e=0;e<q.length;e++){var y=q[e].getAttribute("id");null!=y&&""!==y&&g.push(y)}for(q=0;q<g.length;q++){e=
|
|
179
|
+
g[q];y=0;let B=document.getElementById(e);for(;null!=B&&B!==f&&!1===f.contains(B)&&y<100;)null!=B.parentNode&&B.parentNode.removeChild(B),B=document.getElementById(e),y++}}}static sanitizeHTML(f){return h.default.sanitize(f)}static sanitizeJSON(f){return Array.isArray(f)?f.map(z.sanitizeJSON):null!==f&&"object"==typeof f?Object.fromEntries(Object.entries(f).map(([g,q])=>[g,z.sanitizeJSON(q)])):"string"==typeof f?z.sanitizeHTML(f):f}static convertParsedInterfaceToParameters(f){var g={};for(let q in f.parameters){let e=
|
|
180
|
+
f.parameters[q],y={type:e.type,required:e.required,description:e.description||""};e.isReadOnly&&(y.readOnly=!0);e.valids&&(y.validations=e.valids);e.isArray?(y.type="array",e.parameters&&Object.keys(e.parameters).length>0?y.items=z.convertParsedInterfaceToParameters({type:"object",typeName:"",description:"",required:!0,isReadOnly:!1,isArray:!1,parameters:e.parameters}):y.items={type:e.typeName||e.type}):e.parameters&&Object.keys(e.parameters).length>0&&(y.parameters=z.convertParsedInterfaceToParameters({type:"object",
|
|
181
|
+
typeName:"",description:"",required:!0,isReadOnly:!1,isArray:!1,parameters:e.parameters}));g[q]=y}return g}static convertInterfaceToRouteParameters(f){return k(this,arguments,void 0,function*(g,q=!0,e=null){var y={};if(!0===z.isWeb)throw Error("HotStaq.convertInterfaceToRouteParameters is not supported in the browser.");null==e&&(e={typeConversions:{Date:"string"},returnFirstUnionType:!0,unknownTypeDefaultsToType:"string",tsconfigPath:null});g="string"==typeof g?g:g.name;var B=eval("require")("./HotConvertInterfaceToRouteParameters").generateParsedInterface,
|
|
182
|
+
G=n.join(process.cwd(),"tsconfig.json");null!=e.tsconfigPath&&(G=e.tsconfigPath);e=yield B(g,G);if(null==e)throw Error(`Interface ${g} not found.`);return y=z.convertParsedInterfaceToParameters(e),!0===q&&z.setValid(g,y),y})}static getParam(f,g,q,e){return k(this,arguments,void 0,function*(y,B,G,F,T,S,R=new P.ValidationOptions){return"string"==typeof y&&(y={type:y}),(yield(0,P.validateRecursively)(R,B,G,F,y)).value})}static getParamRange(f,g,q,e,y,B){return k(this,arguments,void 0,function*(G,F,T,
|
|
183
|
+
S,R,X,da,ha,ea=new P.ValidationOptions){return"string"==typeof G&&(G={type:G}),(yield(0,P.validateRecursively)(ea,F,T,X,G)).value})}static getParamDefault(f,g,q,e,y){return k(this,arguments,void 0,function*(B,G,F,T,S,R=new P.ValidationOptions){return"string"==typeof B&&(B={type:B}),(yield(0,P.validateRecursively)(R,G,F,S,B)).value})}static getParamDefaultRange(f,g,q,e,y,B,G){return k(this,arguments,void 0,function*(F,T,S,R,X,da,ha,ea=new P.ValidationOptions){return"string"==typeof F&&(F={type:F}),
|
|
184
|
+
(yield(0,P.validateRecursively)(ea,T,S,ha,F)).value})}static getParamUnsafe(f,g,q=!0,e=!0){g=g[f];if(null==g&&!0===q&&!0===e)throw Error(`Missing required parameter ${f}.`);if("string"==typeof g&&!0===q&&""===g&&!0===e)throw Error(`Missing required parameter ${f}.`);return g}static getParamRangeUnsafe(f,g,q,e,y=!0,B=!0){g=z.getParamUnsafe(f,g,y,B);if(g<q)throw Error(`Parameter ${f} must be greater than or equal to ${q}.`);if(g>e)throw Error(`Parameter ${f} must be less than or equal to ${e}.`);return g}static getParamDefaultUnsafe(f,
|
|
185
|
+
g,q){f=g[f];return null==f||"string"==typeof f&&""===f?q:f}static getParamDefaultRangeUnsafe(f,g,q,e,y){g=z.getParamDefaultUnsafe(f,g,q);if(g<e)throw Error(`Parameter ${f} must be greater than or equal to ${e}.`);if(g>y)throw Error(`Parameter ${f} must be less than or equal to ${y}.`);return g}static checkIfEmpty(f){return!f}static executeError(f){if(null!=z.errors[f]){var g=z.errors[f].redirectToUrl;if(null!=g&&""!==g)return void(window.location.href=g);g=z.errors[f].func;null!=g&&g(f)}}static wait(f){return k(this,
|
|
186
|
+
void 0,void 0,function*(){return new Promise((g,q)=>{setTimeout(()=>{g()},f)})})}addPage(f){this.pages[f.name]=f}getPage(f){return this.pages[f]}addModule(f,g){this.modules[f]=g}getModule(f){return this.modules[f]}addFile(f){var g=f.name;""===g&&(g=f.localFile);""===g&&(g=f.url);this.files[g]=f}getFile(f,g=!0){if(null==this.files[f]){let q=f.indexOf("?hstqserve="),e=f;if(q>-1&&(e=f.substring(0,q)),null!=this.files[e])return this.files[e];if(!0===g)throw Error(`Unable to find file ${f}`);return null}return this.files[f]}static keepContext(f,
|
|
187
|
+
g,q){return function(){var e=Array.prototype.slice.call(arguments);return null!=q&&e.push(q),null==g?f.apply(this,e):f.apply(g,e)}}addComponent(f,g=null,q){var e=this.api;null!=g&&(e=g);g=new f(this,e);if(null!=this.components[g.tag])throw Error(`Component ${g.tag} already exists!`);this.components[g.tag]={componentType:f,processor:this,api:e};H.registerComponent.call(this,g.tag,q)}static fixHTML(f){var g=f.replace(/ \/>/g,">").replace(/(<(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr).*?>)/g,
|
|
188
|
+
"$1</$2>"),q=(new DOMParser).parseFromString(`<xml>${g}</xml>`,"text/xml");g="";q.documentElement.children.length>0&&(q=q.documentElement.children[0].tagName.toLowerCase(),"tr"===q&&(f=`<table>${f}</table>`,g="tbody"),"th"===q&&(f=`<table>${f}</table>`,g=q));return{fixedStr:f,querySelector:g}}static addHtmlUnsafe(f,g){f="string"==typeof f?document.querySelector(f):f;var q=null;if("string"==typeof g){g=z.fixHTML(g);q=(new DOMParser).parseFromString(g.fixedStr,"text/html");g=""===g.querySelector?q.body.children:
|
|
189
|
+
q.querySelector(g.querySelector).children;q=[];for(let e=0;e<g.length;e++){let y=g[e];null!=f&&f.appendChild(y);q.push(y)}return q}return null!=f&&f.appendChild(g),q=g,q}static checkHotSiteName(f,g=!1){var q=(0,c.default)(f),e=!0;if(!1===q.validForNewPackages&&(e=!1),null!=q.errors&&q.errors.length>0&&(e=!1),!1===e&&!0===g)throw Error(`HotSite ${f} has an invalid name! The name cannot be empty and must have a valid NPM module name.`);return e}static replaceKey(f,g,q){return f.replace(new RegExp(`\\$\\{${g}\\}`,
|
|
190
|
+
"g"),q)}static convertParamTypeToJSONSchemaType(f){if(null==f||""===f)return"string";switch(f.toLowerCase()){case "string":case "uuid":case "text":case "richtext":case "objectname":case "messagetexst":case "date":case "email":case "url":case "ip":case "ignore":case "delete":case "messagetext":case "enum":return"string";case "integer":case "int":return"integer";case "number":case "float":return"number";case "boolean":case "bool":return"boolean";case "array":return"array";case "object":case "map":return"object";
|
|
191
|
+
default:return f.length>0&&f[0]===f[0].toUpperCase()?"object":"string"}}static convertParamToJSONSchemaProperty(f){var g=z.convertParamTypeToJSONSchemaType(f.type),q={type:g};if(null!=f.description&&(q.description=f.description),null!=f.type&&"enum"===f.type.toLowerCase()&&null!=f.values&&(q.enum=f.values),"array"===g&&null!=f.items&&"function"!=typeof f.items&&(q.items=z.convertParamToJSONSchemaProperty(f.items)),"object"===g&&null!=f.parameters){q.properties={};for(let e in f.parameters)g=f.parameters[e],
|
|
192
|
+
"string"==typeof g?q.properties[e]={type:"string",description:g}:"function"!=typeof g&&(q.properties[e]=z.convertParamToJSONSchemaProperty(g))}return q}static getHTTPMethodFromEvent(f){switch(f){case K.HotEventMethod.GET:return"GET";default:return"POST"}}static getValueFromHotSiteObj(f,g){var q=null;if(null!=f){for(let e=0;e<g.length;e++){let y=g[e];if(null==f[y]){f=null;break}f=f[y]}null!=f&&(q=f)}return q}processHotSite(){return k(this,arguments,void 0,function*(f=null){z.checkHotSiteName(this.hotSite.name,
|
|
193
|
+
!0);var g=this.hotSite.routes;if(null!=g)for(var q in g){var e=g[q],y=new d.HotFile(e);y=new a.HotPage({processor:this,name:e.name||"",route:q,files:[y]});if(null!=f&&this.mode===b.DeveloperMode.Development){let S=e.name,R=null;if(null!=e.map){if("string"==typeof e.map){if(null==f.testMaps[e.map])throw Error(`Test map ${e.map} does not exist!`);f.testMaps[S]=f.testMaps[e.map]}else{R=new C.HotTestMap;let X;if(e.map instanceof Array){X=[];for(let da=0;da<e.map.length;da++)X.push(new A.HotTestDestination(e.map[da]))}else{X=
|
|
194
|
+
{};for(var B in e.map)X[B]=new A.HotTestDestination(e.map[B])}R.destinations=X}f.testMaps[S]=R}null!=e.destinationOrder&&(f.testMaps[S].destinationOrder=e.destinationOrder)}this.addPage(y)}if(null!=this.hotSite.web)for(var G in this.hotSite.web)if(g=this.hotSite.web[G],null!=g.map&&!1===z.isWeb&&this.mode===b.DeveloperMode.Development){q=G;e=new C.HotTestMap;e.destinations=[];for(B=0;B<g.map.length;B++)e.destinations.push(new A.HotTestDestination(g.map[B]));null!=f?f.testMaps[q]=e:this.logger.warning("A tester was not created first! You must specify one in the CLI.")}if(null!=
|
|
195
|
+
this.hotSite.apis)for(var F in this.hotSite.apis)if(G=this.hotSite.apis[F],null!=G.map&&!1===z.isWeb&&this.mode===b.DeveloperMode.Development){g=F;q=new C.HotTestMap;q.destinations=[];for(e=0;e<G.map.length;e++)q.destinations.push(new A.HotTestDestination(G.map[e]));null!=f?f.testMaps[g]=q:this.logger.warning("A tester was not created first! You must specify one in the CLI.")}if(!0===z.isWeb)for(var T in this.hotSite.components)F=yield(0,l.default)(this.hotSite.components[T].url),F=eval(F),this.addComponent(F);
|
|
196
|
+
null==this.hotSite.routes&&(this.hotSite.routes={});T=!1;null!=this.hotSite.disableFileLoading&&(T=this.hotSite.disableFileLoading);!1===T?yield this.loadHotFiles(this.hotSite.files,!1,!1):this.logger.verbose("Hotsite has file loading disabled...");null!=f&&this.addTester(f);this.logger.verbose(`Processed HotSite ${this.hotSite.name}`)})}loadHotSite(f){return k(this,void 0,void 0,function*(){var g=n.extname(f).toLowerCase();if(!0===z.isWeb){this.logger.verbose(`Downloading HotSite ${f}`);var q=yield(0,l.default)(f);
|
|
197
|
+
this.logger.verbose(`Downloaded site ${f}`);q=q.text()}else{f=n.normalize(f);this.logger.verbose(`Accessing HotSite ${f}`);q=eval("require")("./HotIO").HotIO;if(!1===(yield q.exists(f)))throw Error(`HotSite ${f} does not exist!`);q=yield q.readTextFile(f);this.logger.verbose(`Accessed site ${f}`)}if(".yaml"===g||".yml"===g){if(!0===z.isWeb)throw Error("YAML support for HotSites is not available on the web yet!");this.hotSite=eval("require")("yaml").parse(q)}else this.hotSite=JSON.parse(q);if(null==
|
|
198
|
+
this.hotSite)throw Error(`HotSite ${f} cannot be null!`);this.hotSite.hotsitePath=f})}saveHotSite(f){return k(this,void 0,void 0,function*(){if(!0===z.isWeb)throw Error("Cannot save a HotSite on the web!");var g=n.extname(f).toLowerCase();g=".yaml"===g||".yml"===g?eval("require")("yaml").stringify(this.hotSite):JSON.stringify(this.hotSite,null,2);yield eval("require")("./HotIO").HotIO.writeTextFile(f,g);this.logger.verbose(`Saved site ${f}`)})}loadHotFiles(f){return k(this,arguments,void 0,function*(g,
|
|
199
|
+
q=!1,e=!0){this.logger.verbose("Loading Hott files...");for(let y in g){let B=g[y],G;z.isWeb;G=new d.HotFile({name:y});null!=B.url&&(!0===z.isWeb&&B.url.indexOf("hstqserve")<0?G.url=`${B.url}?hstqserve=nahfam`:G.url=B.url);!1===z.isWeb&&null!=B.localFile&&(G.localFile=B.localFile);let F=!0;null!=B.content&&(G.content=B.content,F=!1);!0===q&&(F=!0);!1===e&&""!==G.url&&(F=!1);!0===F&&(this.logger.verbose(`Loading Hott file: ${G.url}`),yield G.load(),this.logger.verbose(`Finished loading Hott file: ${G.url}`));
|
|
200
|
+
this.addFile(G)}this.logger.verbose("Finished loading Hott files...")})}generateContent(f){return k(this,arguments,void 0,function*(g,q="",e="./",y="./js/HotStaq.min.js",B=!0,G=null){var F="",T="",S="";if(null!=this.hotSite){if(null!=this.hotSite.server.globalApi&&""!==this.hotSite.server.globalApi){var R=this.hotSite.apis[this.hotSite.server.globalApi];if(null==R)this.logger.warning(`API with name ${this.hotSite.server.globalApi} doesn't exist!`);else{var X=!0;if(null==R.jsapi&&(X=!1,this.logger.warning(`API with name ${this.hotSite.server.globalApi} doesn't have a jsapi set. Will not send js content to client.`)),
|
|
201
|
+
null==R.libraryName&&(X=!1,this.logger.warning(`API with name ${this.hotSite.server.globalApi} doesn't have a libraryName set. Will not send js content to client.`)),null==R.apiName&&(X=!1,this.logger.warning(`API with name ${this.hotSite.server.globalApi} doesn't have a apiName set. Will not send js content to client.`)),!0===X){F+=`\t<script type = "text/javascript" src = "${R.jsapi}"><\/script>\n`;X='""';null!=R.url&&(X=`"${R.url}"`);null!=this.api&&(X=`"${this.api.baseUrl}"`);var da=this.apiContent;
|
|
202
|
+
da=da.replace(/%api_name%/g,R.apiName);da=da.replace(/%api_exported_name%/g,R.libraryName);da=da.replace(/%base_url%/g,X);T+=da}}}if(null!=this.hotSite.apis&&(X=this.hotSite.routes[g],null!=X&&null!=X.api)){R=this.hotSite.apis[X.api];if(null==R)throw Error(`Unable to find API ${X.api}`);X.api!==this.hotSite.server.globalApi&&(da=!0,null==R.jsapi&&(da=!1,this.logger.warning(`API with name ${X.api} doesn't have a jsapi set. Will not send js content to client.`)),null==R.libraryName&&(da=!1,this.logger.warning(`API with name ${X.api} doesn't have a libraryName set. Will not send js content to client.`)),
|
|
203
|
+
null==R.apiName&&(da=!1,this.logger.warning(`API with name ${X.api} doesn't have a apiName set. Will not send js content to client.`)),!0===da)&&(F+=`\t<script type = "text/javascript" src = "${R.jsapi}"><\/script>\n`,X='""',null!=R.url&&(X=`"${R.url}"`),null!=this.api&&(X=`"${this.api.baseUrl}"`),da=this.apiContent,da=da.replace(/%api_name%/g,R.apiName),da=da.replace(/%api_exported_name%/g,R.libraryName),da=da.replace(/%base_url%/g,X),T+=da)}if(null!=this.hotSite.server&&null!=this.hotSite.server.jsSrcPath&&
|
|
204
|
+
(y=this.hotSite.server.jsSrcPath),null!=this.hotSite.publicKeys)for(var ha in this.hotSite.publicKeys){let ea;R=this.hotSite.publicKeys[ha];if("string"==typeof R)ea=JSON.stringify(R);else if(!1===z.isWeb){if(null!=this.api){if(null==this.api.connection)throw Error("Cannot pass secrets from the API if there's no connection!");X=this.api.connection;null!=R.passSecretFromAPI&&(ea=JSON.stringify(X.secrets[ha]))}null!=R.env&&(ea=JSON.stringify(process.env[R.env]))}S+=`processor.publicKeys["${ha}"] = ${ea};\n`}}ha=
|
|
205
|
+
this.pageContent;return ha=yield(ea=>k(this,void 0,void 0,function*(){var Qa="",Da="";this.mode===b.DeveloperMode.Development&&(Qa="tempMode = HotStaqWeb.DeveloperMode.Development;",null!=this.hotSite&&null!=this.hotSite.testing&&null!=this.hotSite.testing.web&&(Da=this.testerApiContent,null==this.hotSite.testing.web.testerAPIUrl&&(this.hotSite.testing.web.testerAPIUrl="http://127.0.0.1:8182"),Da=Da.replace(/%base_tester_url%/g,`"${this.hotSite.testing.web.testerAPIUrl}"`)));var Ea="";if(Object.keys(this.files).length>
|
|
206
|
+
0){Ea+="var files = {};\n\n";for(var za in this.files){var la=this.files[za],sa=new m.HotAsset("html",za);""!==la.localFile&&(sa.path=la.localFile);""!==la.url&&(sa.path=la.url);""!==la.content&&(sa.path="",sa.content=la.content);la=yield sa.output();if("string"==typeof la)throw Error("During initial load, HTML assets cannot be outputted using only a string!");var wa=sa="";null!=la.url&&(sa=`"url": "${la.url}", `);null!=la.content&&(wa=`"content": ${la.content}`);Ea+=`\t\t\tfiles["${la.name}"] = { ${sa}${wa} };\n`}Ea+=
|
|
207
|
+
"\t\t\tpromises.push (processor.loadHotFiles (files));\n"}ea=ea.replace(/%title%/g,q);!0===B&&(ea=ea.replace(/%args%/g,"Hot.Arguments"));null!=G&&(ea=ea.replace(/%args%/g,JSON.stringify(G)));za=g;sa=la="";wa="HotTesterMochaSelenium";for(var Aa in this.testers){wa=Aa;break}null!=this.hotSite&&(null!=this.hotSite.testing&&null!=this.hotSite.testing.web&&(null!=this.hotSite.testing.web.testerName&&(wa=this.hotSite.testing.web.testerName),null!=this.hotSite.testing.web.testerAPIUrl&&(la=this.hotSite.testing.web.testerAPIUrl),
|
|
208
|
+
null!=this.hotSite.testing.web.launchpadUrl&&(sa=this.hotSite.testing.web.launchpadUrl)),null!=this.hotSite.routes&&null!=this.hotSite.routes[g])&&(za=this.hotSite.routes[g].name);Aa="";return 0!==this.startDelay&&(Aa=`await HotStaq.wait (${this.startDelay});`),ea=(ea=(ea=(ea=(ea=(ea=(ea=(ea=(ea=(ea=(ea=(ea=(ea=(ea=ea.replace(/%start_delay%/g,Aa)).replace(/%logging_level%/g,`HotLogLevel.${u.HotLogLevel[this.logger.logLevel]}`)).replace(/%hotstaq_js_src%/g,y)).replace(/%developer_mode%/g,Qa)).replace(/%tester_api%/g,
|
|
209
|
+
Da)).replace(/%apis_to_load%/g,F)).replace(/%load_files%/g,Ea)).replace(/%api_code%/g,T)).replace(/%public_secrets%/g,S)).replace(/%url%/g,e)).replace(/%tester_name%/g,`"${wa}"`)).replace(/%tester_map%/g,`"${za}"`)).replace(/%tester_api_base_url%/g,`"${la}"`)).replace(/%tester_launchpad_url%/g,`"${sa}"`)}))(ha),ha})}createExpressRoutes(f){return k(this,arguments,void 0,function*(g,q="./js/HotStaq.min.js"){for(let e in this.pages){let y=this.pages[e],B=yield this.generateContent(y.route,y.name,y.files[0].url,
|
|
210
|
+
q);g.get(y.route,(G,F)=>{this.logger.verbose("Sending custom Express content.");F.status(200).send(B)})}})}addTester(f){this.testers[f.name]=f}getWebTestingMaps(){if(null==this.hotSite)throw Error("No HotSite was loaded!");if(null==this.hotSite.testing)throw Error("The HotSite does not have a testing object!");if(null==this.hotSite.testing.web)throw Error("The HotSite does not have a testing web object!");if(null==this.hotSite.testing.web.maps)throw Error("The HotSite testing object does not have any maps!");
|
|
211
|
+
return this.hotSite.testing.web.maps}getAPITestingMaps(){if(null==this.hotSite)throw Error("No HotSite was loaded!");if(null==this.hotSite.testing)throw Error("The HotSite does not have a testing object!");if(null==this.hotSite.testing.api)throw Error("The HotSite does not have a testing api object!");if(null==this.hotSite.testing.api.maps)throw Error("The HotSite testing object does not have any maps!");return this.hotSite.testing.api.maps}getRouteKeyFromName(f){var g="";if(null!=this.hotSite){if(null!=
|
|
212
|
+
this.hotSite.routes)for(let q in this.hotSite.routes)if(this.hotSite.routes[q].name===f){g=q;break}if(null!=this.hotSite.web)for(let q in this.hotSite.web)if(null!=this.hotSite.web[q]){g=q;break}}return g}getRouteFromName(f){var g=null;f=this.getRouteKeyFromName(f);return""!==f&&(g=this.hotSite.routes[f]),g}executeTests(f,g){return k(this,void 0,void 0,function*(){var q=this.testers[f];if(null==q)throw Error(`Unable to execute tests. Tester ${f} does not exist!`);return q.execute(g)})}executeAllWebTests(f){return k(this,
|
|
213
|
+
void 0,void 0,function*(){var g=this.getWebTestingMaps();if(null==this.testers[f])throw Error(`Unable to execute tests. Tester ${f} does not exist!`);for(let q=0;q<g.length;q++)yield this.executeTests(f,g[q])})}executeAllAPITests(f){return k(this,void 0,void 0,function*(){var g=this.getAPITestingMaps();if(null==this.testers[f])throw Error(`Unable to execute tests. Tester ${f} does not exist!`);this.logger.verbose(()=>`Executing all API tests for tester ${f}. Maps: ${JSON.stringify(g)}`);for(let q=
|
|
214
|
+
0;q<g.length;q++)yield this.executeTests(f,g[q])})}process(f){return k(this,arguments,void 0,function*(g,q=null){return yield this.getPage(g).process(q)})}static processLocalFile(f){return k(this,arguments,void 0,function*(g,q=g,e=null){var y=new z;g=new d.HotFile({localFile:g});yield g.load();g=new a.HotPage({processor:y,name:q,files:[g]});return y.addPage(g),yield y.process(q,e)})}static processUrl(f){return k(this,void 0,void 0,function*(){var g=new d.HotFile({url:f.url});yield g.load();g=new a.HotPage({processor:f.processor,
|
|
215
|
+
name:f.name,files:[g],testerName:f.testerName,testerMap:f.testerMap});return f.processor.addPage(g),yield f.processor.process(f.name,f.args)})}static processContent(f){return k(this,void 0,void 0,function*(){var g=new d.HotFile({content:f.content});yield g.load();g=new a.HotPage({processor:f.processor,name:f.name,files:[g]});return f.processor.addPage(g),yield f.processor.process(f.name,f.args)})}static onReady(f){z.onReadyEvent=f}static displayDefault404(f){f='<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Page not found</title><style>html,body{height:100%;margin:0;}body{display:flex;align-items:center;justify-content:center;font-family:system-ui,-apple-system,sans-serif;color:#1f2937;background:#f9fafb;}.fl-404{text-align:center;padding:2rem;}.fl-404 h1{font-size:4rem;margin:0 0 0.5rem;color:#4f46e5;}.fl-404 p{margin:0.25rem 0;color:#6b7280;}.fl-404 code{background:#e5e7eb;padding:0.125rem 0.375rem;border-radius:0.25rem;font-size:0.875rem;}.fl-404 a{color:#4f46e5;text-decoration:none;font-weight:500;display:inline-block;margin-top:1rem;}.fl-404 a:hover{text-decoration:underline;}</style></head><body><div class="fl-404"><h1>404</h1><p>Page not found.</p><p><code>'+
|
|
216
|
+
String(f||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")+'</code> doesn\'t match any registered route.</p><a href="/">← Go home</a></div></body></html>';z.useOutput(f)}static executeInlineScripts(f){return k(this,void 0,void 0,function*(){var g=f.getElementsByTagName("script");if(!(g.length<1)){var q=[];for(var e=0;e<g.length;e++)q.push(g[e]);for(g=0;g<q.length;g++){let y=q[g];if(null!=y.getAttribute("data-hotstaq-executed"))continue;e=y.getAttribute("src");
|
|
217
|
+
let B=null!=e&&""!==e,G=y.textContent||"";if(!1===B&&""===G){y.setAttribute("data-hotstaq-executed","1");continue}let F=document.createElement("script"),T=y.getAttribute("type");null!=T&&""!==T&&F.setAttribute("type",T);!0===B?F.setAttribute("src",e):F.text=G;F.setAttribute("data-hotstaq-executed","1");yield new Promise((S,R)=>{F.onload=()=>{S()};F.onerror=()=>{S()};null!=y.parentNode?y.parentNode.replaceChild(F,y):document.head.appendChild(F);!1===B&&S()})}}})}static useOutput(f){return k(this,void 0,
|
|
218
|
+
void 0,function*(){null!=z.onOutputReceived&&z.onOutputReceived(f);var g=(new DOMParser).parseFromString(f,"text/html");document.getElementsByTagName("html")[0].innerHTML=g.getElementsByTagName("html")[0].innerHTML;!0===z.dispatchReadyEvents&&(document.dispatchEvent(new Event("DOMContentLoaded")),window.dispatchEvent(new Event("load")));null!=z.onReadyEvent&&z.onReadyEvent(f);g=!0;if(null!=z.onAfterUseOutput){let q=z.onAfterUseOutput(f);q instanceof Promise&&(q=yield q);!1===q&&(g=!1)}!0===g&&(yield z.executeInlineScripts(document))})}static navigateTo(f){return k(this,
|
|
219
|
+
arguments,void 0,function*(g,q=!0){if(z.restoreSpaData(),null==z.spaTarget)return void(window.location.href=g);if(null!=z.onBeforeNavigate){var e=z.onBeforeNavigate(g);if(e instanceof Promise&&(e=yield e),!1===e)return}var y=g.split("?")[0];e=null;if(null!=z.routerManager[y]){y=z.routerManager[y];if(null!=y.redirect)return void(window.location.href=y.redirect);null!=y.src&&(e=y.src)}else for(var B=0;B<z.routerWildcards.length;B++){let G=z.routerWildcards[B],F=G.replace("*","");if(y.indexOf(F)>-1){y=
|
|
220
|
+
z.routerManager[G];null!=y.src&&(e=y.src);break}}if(null==e)return void(window.location.href=g);!0===q&&(q=g,""!==window.location.search&&g.indexOf("?")<0&&(q=g),window.history.pushState({hotstaqSpa:!0},"",q));q=z.spaProcessor;if(null==q)return void(window.location.href=g);y=e;y.indexOf("hstqserve")<0&&(y+="?hstqserve=nahfam");B={url:y,name:g,processor:q,args:null};e=q.getFile(e,!1);null==e&&(e=q.getFile(y,!1));q=null!=e&&""!==e.content?yield z.processContent({content:e.content,name:g,processor:q,
|
|
221
|
+
args:null}):yield z.processUrl(B);e=document.querySelector(z.spaTarget);if(null==e)return void(yield z.useOutput(q));y=(new DOMParser).parseFromString(q,"text/html");B=y.querySelector(z.spaTarget);e.innerHTML=null!=B?B.innerHTML:y.body.innerHTML;!0===z.dispatchReadyEvents&&(document.dispatchEvent(new Event("DOMContentLoaded")),window.dispatchEvent(new Event("load")));null!=z.onReadyEvent&&z.onReadyEvent(q);q=!0;null!=z.onAfterNavigate&&(g=z.onAfterNavigate(g),g instanceof Promise&&(g=yield g),!1===
|
|
222
|
+
g&&(q=!1));!0===q&&(yield z.executeInlineScripts(e))})}static restoreSpaData(){0===Object.keys(z.routerManager).length&&null!=window.__hotstaqRouterManager&&(z.routerManager=window.__hotstaqRouterManager);0===z.routerWildcards.length&&null!=window.__hotstaqRouterWildcards&&(z.routerWildcards=window.__hotstaqRouterWildcards);null==z.spaProcessor&&null!=window.__hotstaqSpaProcessor&&(z.spaProcessor=window.__hotstaqSpaProcessor)}static enableSPA(f,g=null){z.spaTarget=f;z.spaEnabled=!0;null!=g&&(z.spaProcessor=
|
|
223
|
+
g);z.restoreSpaData();!0===z.autoInstallFetchInterceptors&&z.installFetchInterceptors();document.addEventListener("click",q=>{var e=q.target.closest("a");if(null!=e){var y=e.getAttribute("href");if(null!=y&&""!==y&&!(y.startsWith("http://")||y.startsWith("https://")||y.startsWith("#")||y.startsWith("javascript:")||null!=e.getAttribute("target"))&&null==e.getAttribute("data-spa-ignore")){z.restoreSpaData();e=y.split("?")[0];var B=null!=z.routerManager[e];if(!B)for(let G=0;G<z.routerWildcards.length;G++){let F=
|
|
224
|
+
z.routerWildcards[G].replace("*","");if(e.indexOf(F)>-1){B=!0;break}}B&&(q.preventDefault(),z.navigateTo(y))}}});window.addEventListener("popstate",q=>{z.navigateTo(window.location.pathname+window.location.search,!1)});z.prefetchRoutes()}static installFetchInterceptors(f={}){if(z.fetchInterceptorOptions=Object.assign(Object.assign(Object.assign({},z.fetchInterceptorOptions),f),{skipUrls:[...((z.fetchInterceptorOptions||{}).skipUrls||[]),...(f.skipUrls||[])]}),!0!==z.fetchInterceptorsInstalled)if(z.fetchInterceptorsInstalled=
|
|
225
|
+
!0,"undefined"!=typeof window&&"function"==typeof window.fetch){z.navAbort=new AbortController;var g=window.fetch.bind(window);window.fetch=function(e,y){var B=z.fetchInterceptorOptions||{},G="string"==typeof e?e:e&&e.url||"",F=!1,T=B.skipUrls||[];for(let R=0;R<T.length;R++)if(0===G.indexOf(T[R])){F=!0;break}var S=y;return F||(S=y||{},null==S.signal&&(S=Object.assign({},S,{signal:z.navAbort.signal}))),g(e,S).then(R=>{if(401===R.status&&!F&&"function"==typeof B.on401)try{B.on401(R,e,S)}catch(X){}return R})};
|
|
226
|
+
var q=z.onBeforeNavigate;z.onBeforeNavigate=e=>{try{z.navAbort.abort()}catch(y){}return z.navAbort=new AbortController,"function"!=typeof q||q(e)}}}static prefetchRoutes(){var f=z.spaProcessor;if(null!=f){var g=window.location.pathname,q={};for(let e in z.routerManager){let y=z.routerManager[e];null!=y.src&&e!==g&&(q[y.src]={url:y.src})}Object.keys(q).length>0&&f.loadHotFiles(q)}}static waitForTesters(){return k(this,void 0,void 0,function*(){for(;!1===z.isReadyForTesting;)yield z.wait(10);null!=
|
|
227
|
+
z.onReadyForTesting&&(yield z.onReadyForTesting())})}static setupTesters(f,g){if(f.mode===b.DeveloperMode.Development&&null==f.testerAPI){null==g.testerAPIBaseUrl&&(g.testerAPIBaseUrl="");""===g.testerAPIBaseUrl&&(g.testerAPIBaseUrl="http://127.0.0.1:8182");let q=new t.HotClient(f);g=new D.HotTesterAPI(g.testerAPIBaseUrl,q);g.connection.api=g;f.testerAPI=g}}static setupClientTesters(f){var g="";return f.mode===b.DeveloperMode.Development&&(g+='<script type = "text/javascript">\nfunction hotstaq_isDocumentReady ()\n{\nif (window["Hot"] != null)\n{\nif (Hot.Mode === HotStaqWeb.DeveloperMode.Development)\n{\nlet func = function ()\n\t{\n\t\tif (Hot.TesterAPI != null)\n\t\t{\n\t\t\twindow.addEventListener ("beforeunload",\n\t\t\t\t(event) =>\n\t\t\t\t{\n\t\t\t\t\tHotStaqWeb.HotStaq.isReadyForTesting = false;\n\n\t\t\t\t\tHot.TesterAPI.tester.pageUnloaded ({\n\t\t\t\t\t\t\ttesterName: Hot.CurrentPage.testerName\n\t\t\t\t\t\t}).then (function (resp)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (resp.error != null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (resp.error !== "")\n\t\t\t\t\t\t\t\t\t\tthrow new Error (resp.error);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\tlet testPaths = {};\n\t\t\tlet testElements = JSON.stringify (Hot.CurrentPage.testElements);\n\t\t\tlet testMaps = JSON.stringify (Hot.CurrentPage.testMaps);\n\n\t\t\tfor (let key in Hot.CurrentPage.testPaths)\n\t\t\t{\n\t\t\t\tlet testPath = Hot.CurrentPage.testPaths[key];\n\n\t\t\t\ttestPaths[key] = testPath.toString ();\n\t\t\t}\n\n\t\t\tlet testPathsStr = JSON.stringify (testPaths);\n\n\t\t\tHot.TesterAPI.tester.pageLoaded ({\n\t\t\t\t\ttesterName: Hot.CurrentPage.testerName,\n\t\t\t\t\ttestElements: testElements,\n\t\t\t\t\ttestPaths: testPathsStr\n\t\t\t\t}).then (function (resp)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (resp.error != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (resp.error !== "")\n\t\t\t\t\t\t\t\tthrow new Error (resp.error);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tHotStaqWeb.HotStaq.isReadyForTesting = true;\n\t\t\t\t\t});\n\t\t}\n\t};\n\nif ((document.readyState === "complete") || (document.readyState === "interactive"))\n\tfunc ();\nelse\n\tdocument.addEventListener ("DOMContentLoaded", func);\n}\n}\n}\n\nhotstaq_isDocumentReady ();\n\x3c/script>'),
|
|
228
|
+
g}static onInitalLoad(f){"complete"===document.readyState||"interactive"===document.readyState?f():window.addEventListener("load",f,{once:!0})}static displayUrl(f){return k(this,arguments,void 0,function*(g,q=null,e=null,y=null){return new Promise((B,G)=>{z.onInitalLoad(()=>k(this,void 0,void 0,function*(){var F={url:""};F.name=null==q?"string"==typeof g?g:g.name:q;""===F.name&&(F.name="string"==typeof g?g:g.name);"string"==typeof g?F.url=g:(F.url=g.url,null==e&&null!=g.processor&&(e=g.processor),
|
|
229
|
+
null==y&&null!=g.args&&(y=g.args),null!=g.testerMap&&(F.testerMap=g.testerMap),null!=g.testerName&&(F.testerName=g.testerName),null!=g.testerAPIBaseUrl&&(F.testerAPIBaseUrl=g.testerAPIBaseUrl));null==e&&(e=new z);e.mode===b.DeveloperMode.Development&&(b.Hot.Debugger.benchmark=!0);z.setupTesters(e,F);F.processor=e;F.args=y;F.url.indexOf("hstqserve")<0&&(F.url+="?hstqserve=nahfam");F=yield z.processUrl(F);F+=z.setupClientTesters(e);yield z.useOutput(F);B(e)}))})})}static displayContent(f){return k(this,
|
|
230
|
+
arguments,void 0,function*(g,q=null,e=null,y=null){return new Promise((B,G)=>{z.onInitalLoad(()=>k(this,void 0,void 0,function*(){var F={content:""};F.name=null==q?"string"==typeof g?"":g.name:q;""===F.name&&(F.name="string"==typeof g?"":g.name);"string"==typeof g?F.content=g:(F.content=g.content,null==e&&null!=g.processor&&(e=g.processor),null==y&&null!=g.args&&(y=g.args),null!=g.testerMap&&(F.testerMap=g.testerMap),null!=g.testerName&&(F.testerName=g.testerName),null!=g.testerAPIBaseUrl&&(F.testerAPIBaseUrl=
|
|
231
|
+
g.testerAPIBaseUrl));null==e&&(e=new z);z.setupTesters(e,F);F.processor=e;F.args=y;F=yield z.processContent(F);yield z.useOutput(F);B(e)}))})})}}p.HotStaq=z;z.version="0.9.23";z.isWeb=!1;z.isReadyForTesting=!1;z.onReadyForTesting=null;z.onOutputReceived=null;z.onReadyEvent=null;z.dispatchReadyEvents=!0;z.spaTarget=null;z.routerManager={};z.routerWildcards=[];z.spaProcessor=null;z.spaEnabled=!1;z.onBeforeNavigate=null;z.onAfterNavigate=null;z.onAfterUseOutput=null;z.onRouteNotFound=null;z.autoInstallFetchInterceptors=
|
|
232
|
+
!0;z.navAbort=null;z.fetchInterceptorsInstalled=!1;z.fetchInterceptorOptions={};z.errors={};z.preValidate=null;z.valids={};z.postValidate=null;z.uuidRegex=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/;z.setupValidators();"undefined"!=typeof document&&(window.HotAPI=J.HotAPI,window.addEventListener("load",r.hotStaqWebStart,{once:!0}))},[6019](J,p,v){Object.defineProperty(p,"__esModule",{value:!0});p.registerComponent=function(r,n){if(null==r||""===r)throw Error("All components must have a tag!");
|
|
233
|
+
if(void 0===customElements.get(r)){var l=this.components;customElements.define(r,class extends HTMLElement{constructor(){super();var c=l[r];if(this.component=new c.componentType(c.processor,c.api),this.hotComponent=this.component,this.component.htmlElements=[this],this.component.inner=this.innerHTML,null!=this.component.handleAttributes)this.component.handleAttributes(this.attributes);else for(c=0;c<this.attributes.length;c++){var h=this.attributes[c],a=h.name.toLowerCase();h=h.value;if("id"===a&&
|
|
234
|
+
(this.component.name=h),"name"===a&&(this.component.name=h),"value"===a&&(this.component.value=h),a.indexOf("hot-")>-1)a=a.substring(4),this.component[a]=h}if(null==this.component.onPreOutput||!1!==this.component.onPreOutput())for(a=this.component.output(),null!=this.component.onPostOutput&&(a=this.component.onPostOutput(a)),c=[],"string"==typeof a?c.push({html:a}):c=a instanceof Array?a:[a],a=0;a<c.length;a++){h=c[a];var d=h.html,u="",b=this.component["place-here"];null!=h.addFunctionsTo&&(u=h.addFunctionsTo);
|
|
235
|
+
null!=b&&(h.documentSelector=`hot-place-here[name="${b}"]`);d=w.HotFile.parseContent(d,!0,{outputCommands:!1});null!=this.component.onParsed&&(d=this.component.onParsed(d));b={fixedStr:"",querySelector:""};b=null!=this.component.onFixHTML?this.component.onFixHTML(d):E.HotStaq.fixHTML(d);d=[];var m=Array.from(this.children);for(var t=0;t<m.length;t++)d.push(this.removeChild(m[t]));m=t=null;if(t=null!=this.component.onParseDOM?this.component.onParseDOM(b.fixedStr):(new DOMParser).parseFromString(b.fixedStr,
|
|
236
|
+
"text/html"),t.body.children.length<1)throw Error(`No component output from ${this.component.name} with tag ${this.component.tag}`);if(t.body.children.length>1){m=!0;for(var D=0;D<t.body.children.length;D++){var C=t.body.children[D];if(C instanceof HTMLElement&&"parsererror"===C.tagName.toLowerCase()){m=C;m=!1;break}}if(!0===m)throw Error(`Only a single html element can come from component ${this.component.name}, multiple elements were detected.`);}m=""===b.querySelector?t.body.children[0]:t.querySelector(b.querySelector);
|
|
237
|
+
this.replaceWith(m);null!=this.component.click&&m.addEventListener("click",this.component.click.bind(this.component));for(let A in this.component.events)b=this.component.events[A],m.addEventListener(b.type,b.func,b.options);b=Object.getOwnPropertyNames(this.component.constructor.prototype);for(t=0;t<b.length;t++)if(D=b[t],"constructor"!==D&&"function"==typeof this.component[D]){C=!0;for(let A in x.HotComponent.prototype)if(D===A){C=!1;break}!0===C&&(m[D]=E.HotStaq.keepContext(this.component[D],this.component),
|
|
238
|
+
""!==u)&&(document.querySelector(u)[D]=E.HotStaq.keepContext(this.component[D],this.component))}null!=this.component.onPrePlace&&(m=this.component.onPrePlace(m));u=this.component.onCreated(m);if(null!=this.component.onParentPlace&&(u.onParentPlace=this.component.onParentPlace),u.hotComponent=this.component,this.component.htmlElements.push(u),null!=h.closestSelector){for(b=u;b;){m=b.querySelector(h.closestSelector);if(null!=m){b=m;break}b=b.parentElement}if(null==b)throw Error(`Unable to find closest node with selector '${h.closestSelector}'`);
|
|
239
|
+
u.parentElement.removeChild(u);b.appendChild(u);null!=u.onParentPlace&&u.hotComponent.onParentPlace(parentNode,u)}if(null!=h.documentSelector){b=document.querySelector(h.documentSelector);if(null==b)throw Error(`Unable to find document node with selector '${h.documentSelector}'`);E.HotStaq.removeStaleDuplicateIds(u);u.parentElement.removeChild(u);b.appendChild(u);null!=u.onParentPlace&&u.hotComponent.onParentPlace(b,u)}b=(A,H,K)=>{for(var P=0;P<10&&null!=A&&!(A instanceof HTMLHtmlElement);){var M=
|
|
240
|
+
A.querySelectorAll(`hot-place-here[name="${H}"]`);if(M.length>0){H=M[0];null!=K.parentNode&&K.parentNode.removeChild(K);H.appendChild(K);null!=K.onParentPlace&&K.hotComponent.onParentPlace(H,K);break}if(M.length<1&&(M=A.querySelectorAll(`[hot-place-here="${H}"]`),M.length>0)){H=M[0];null!=K.parentNode&&K.parentNode.removeChild(K);H.appendChild(K);null!=K.onParentPlace&&K.hotComponent.onParentPlace(H,K);break}A=A.parentNode;P++}return A};if(null!=h.placeHereParent&&(m=u.parentNode,m=b(m,h.placeHereParent,
|
|
241
|
+
u),null==m))throw Error(`Unable to find parent node with hot-place-here attribute '${h.placeHereParent}'`);for(m=0;m<d.length;m++){t=d[m];C=!1;if(void 0!==t.getAttribute&&(D=t.getAttribute("hot-place-parent"),null!=D&&""!==D)){C=u;if(C=b(C,D,t),null==C)throw Error(`Unable to find parent node with hot-place-here attribute '${h.placeHereParent}'`);C=!0}!1===C&&u.appendChild(t);null!=t.onParentPlace&&t.hotComponent.onParentPlace(u,t)}null!=this.component.onPostPlace&&(h=this.component.onPostPlace(u.parentElement,
|
|
242
|
+
u),null!=h&&(u=h));void 0!==k.Hot&&null!=k.Hot.CurrentPage&&(h="",null!=this.component.name&&(h=this.component.name),null!=h&&""!==h||(h=this.id),""!==h&&(k.Hot.CurrentPage.components[h]=this.component))}}looseParseFromString(c,h){h=h.replace(/ \/>/g,">").replace(/(<(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr).*?>)/g,"$1</$2>");h=c.parseFromString("<xml>"+h+"</xml>","text/xml");c=c.parseFromString("","text/html");for(let a of Array.from(h.documentElement.children))c.body.appendChild(a);
|
|
243
|
+
for(let a of Array.from(c.querySelectorAll("area,base,br,col,command,embed,hr,img,input,keygen,link,meta,param,source,track,wbr")))a.outerHTML="<"+a.outerHTML.slice(1).split("<")[0];return c}get observedAttributes(){return this.component.observedAttributes}},n)}};var w=v(8296),x=v(3299),E=v(9343),k=v(1814)},[6061](J,p,v){var w=this&&this.__awaiter||function(l,c,h,a){return new (h||(h=Promise))(function(d,u){function b(D){try{t(a.next(D))}catch(C){u(C)}}function m(D){try{t(a.throw(D))}catch(C){u(C)}}
|
|
244
|
+
function t(D){var C;D.done?d(D.value):(C=D.value,C instanceof h?C:new h(function(A){A(C)})).then(b,m)}t((a=a.apply(l,c||[])).next())})};Object.defineProperty(p,"__esModule",{value:!0});p.hotStaqWebStart=function(){if(void 0===window.hotstaqStartingApp||!0!==window.hotstaqStartingApp){window.hotstaqStartingApp=!0;var l=document.getElementsByTagName("hotstaq");if(n.HotStaq.isWeb=!0,void 0!==HotStaqWeb)for(let c in HotStaqWeb)window[c]=HotStaqWeb[c];if(l.length>0){let c=l[0];setTimeout(function(){return w(this,
|
|
245
|
+
void 0,void 0,function*(){var h=(R,X)=>{for(let da=0;da<X.length;da++){let ha=X[da];if(null!=R.getAttribute(ha))return R.getAttribute(ha);if(null!=R.getAttribute(`data-${ha}`))return R.getAttribute(`data-${ha}`)}},a=h(c,["load-page","loadPage","src"])||"",d=h(c,["logging-level","loggingLevel"])||null,u=h(c,["start-delay","startDelay"])||null,b=h(c,["router"])||"",m=h(c,["spa-target","spaTarget"])||null,t=h(c,["name"])||"default",D=h(c,["args"])||null,C=h(c,["api-js-url","apiJSUrl"])||null,A=h(c,["api-library",
|
|
246
|
+
"apiLibrary"])||null,H=h(c,["api-name","apiName"])||null,K=h(c,["api-url","apiUrl"])||null,P=h(c,["tester-name","testerName"])||"HotTesterMochaSelenium",M=h(c,["tester-map","testerMap"])||null,W=h(c,["tester-api-base-url","testerApiBaseUrl"])||null,z=h(c,["tester-launchpad-url","testerLaunchpadUrl"])||null,f=!1,g=!1,q=c.innerHTML||"",e={},y=[],B=new URLSearchParams(window.location.search);null!=u&&(yield n.HotStaq.wait(parseInt(u)));null!=h(c,["src"])&&(a=h(c,["src"]));null!=h(c,["passRawUrl"])&&
|
|
247
|
+
(g=!0);null!=h(c,["dont-reuse-processor","dontReuseProcessor"])&&(f=!0);u=B.get("hstqbaseredirect");null!=u&&(u=decodeURI(u),window.history.replaceState("","",u),a=u);u=document.getElementsByTagName("hotstaq-error");for(B=0;B<u.length;B++){var G=u[B],F=h(G,["status"]);G=h(G,["unsupported-browser-redirect"]);null!=G?n.HotStaq.errors.unsupportedBrowser={redirectToUrl:G}:n.HotStaq.errors[`${F}`]={redirectToUrl:G}}try{eval("async () => {}")}catch(R){n.HotStaq.executeError("unsupportedBrowser")}if(""!==
|
|
248
|
+
b)for(F=document.getElementsByTagName("hotstaq-router"),G=0;G<F.length;G++){B=F[G];var T=h(B,["name"]);u=h(B,["serve-local","serveLocally"]);if(T===b){for(b=0;b<B.childNodes.length;b++){var S=B.childNodes[b];if(S instanceof HTMLElement&&"ROUTE"===S.tagName.toUpperCase()){F=h(S,["path"]);G=h(S,["redirect"]);T=h(S,["base-redirect","baseRedirect"]);let R=h(S,["base"]);S=h(S,["src"]);F.indexOf("*")>-1&&y.push(F);e[F]={redirect:G||void 0,baseRedirect:T||void 0,base:R||void 0,src:S||void 0}}}b=h=window.location.pathname;
|
|
249
|
+
null!=u&&(u=u.toLowerCase(),"true"===u||"yes"===u||"1"===u)&&(u=h.lastIndexOf("/"),u>-1&&(h=h.substring(u),b=b.substring(u)));if(y.length>0)for(u=0;u<y.length;u++)if(B=y[u],F=B.replace("*",""),h.indexOf(F)>-1){h=B;break}if(null!=e[h]){if(null!=e[h].redirect)return void(window.location.href=e[h].redirect);if(null!=e[h].baseRedirect)return a=window.location.search,m="",""!==a&&"?"!==a&&(m=`&${a.substring(1)}`),void(window.location.href=`${e[h].baseRedirect}?hstqbaseredirect=${encodeURI(b+a)}${m}`);
|
|
250
|
+
null!=e[h].src&&(a=e[h].src)}break}}n.HotStaq.routerManager=e;n.HotStaq.routerWildcards=y;window.__hotstaqRouterManager=e;window.__hotstaqRouterWildcards=y;D=null!=D?JSON.parse(D):x.Hot.Arguments;y=!1;""!==q&&""!==q.replace(/\s/g,"")&&(y=!0);h=0;null!=window.Hot&&(h=x.Hot.Mode);q=null;!1===f&&void 0!==x.Hot&&null!=x.Hot.CurrentPage&&null!=x.Hot.CurrentPage.processor&&(q=x.Hot.CurrentPage.processor);null==q&&(q=new n.HotStaq);null!=d&&(q.logger.logLevel=r.HotLog.parse(d));q.mode=h;d={name:t,processor:q,
|
|
251
|
+
args:D};if(""!==a&&(!1===g&&a.indexOf("hstqserve")<0&&(a+="?hstqserve=nahfam"),d.url=a),null!=M&&(d.testerMap=M,d.testerName=P),null!=P&&(d.testerName=P),null!=W&&(d.testerAPIBaseUrl=W),null!=z&&(d.testerLaunchpadUrl=z),null!=H){P=new E.HotClient(q);if(null==K||""===K)throw Error("api-url was not set!");if(null==C||""===C)throw Error("api-js-url was not set!");C=yield k.HotFile.httpGet(C);if(""===C)throw Error("api-js-url content was empty!");M=null;!0===n.HotStaq.isWeb?null==M&&(M=window):null==
|
|
252
|
+
M&&(M=v.g);eval.apply(M,[C]);C=window;if(null!=A&&(C=window[A],null==C))throw Error(`Unable to find the API library ${A}!`);A=new C[H](K,P);null!=A.onPreRegister&&(yield A.onPreRegister());A.connection.api=A;q.api=A}if(n.HotStaq.spaProcessor=q,window.__hotstaqSpaProcessor=q,null!=m&&n.HotStaq.enableSPA(m,q),!1===y){if(""===a){a=window.location.pathname;m="";if(null!=e[404]&&null!=e[404].src?m=e[404].src:null!=e["*"]&&null!=e["*"].src&&(m=e["*"].src),""===m)return"function"==typeof n.HotStaq.onRouteNotFound?
|
|
253
|
+
void n.HotStaq.onRouteNotFound(a):void n.HotStaq.displayDefault404(a);a=m}a.indexOf("hstqserve")<0&&(a+="?hstqserve=nahfam");d.url=a;n.HotStaq.displayUrl(d)}else n.HotStaq.displayContent(d)})},50)}}};var x=v(1814),E=v(3025),k=v(8296),r=v(3622),n=v(9343)},[4744](J,p){Object.defineProperty(p,"__esModule",{value:!0});p.HotTestDestination=void 0;class v{constructor(w="",x=!0){"string"==typeof w?(this.destination=w,this.autoStart=x):w instanceof v?(this.destination=w.destination,this.autoStart=w.autoStart):
|
|
254
|
+
(this.destination=w.path,this.autoStart=w.autoStart)}}p.HotTestDestination=v},[896](J,p){var v=this&&this.__awaiter||function(w,x,E,k){return new (E||(E=Promise))(function(r,n){function l(a){try{h(k.next(a))}catch(d){n(d)}}function c(a){try{h(k.throw(a))}catch(d){n(d)}}function h(a){var d;a.done?r(a.value):(d=a.value,d instanceof E?d:new E(function(u){u(d)})).then(l,c)}h((k=k.apply(w,x||[])).next())})};Object.defineProperty(p,"__esModule",{value:!0});p.HotTestDriver=void 0;p.HotTestDriver=(()=>class{constructor(w,
|
|
255
|
+
x=null){this.processor=w;this.tester=null;this.page=x;this.commandDelay=20;this.pageTestDelay=700;this.persistentData={}}parseTestObject(w){var x="";w.indexOf("*")>-1&&(w=w.replace(/\*/,""),x="*");x=`[data-test-object-name${x}='${w}']`;return w.length>0&&">"===w[0]&&(x=w.substring(1)),x}wait(w){return v(this,void 0,void 0,function*(){return new Promise((x,E)=>{setTimeout(()=>{x()},w)})})}print(w){return v(this,void 0,void 0,function*(){process.stdout.write(w)})}println(w){return v(this,void 0,void 0,
|
|
256
|
+
function*(){yield this.print(`${w}\n`)})}destroy(){return v(this,void 0,void 0,function*(){})}assert(w){return v(this,arguments,void 0,function*(x,E=""){if(!x)throw Error(E);})}})()},[1284](J,p){Object.defineProperty(p,"__esModule",{value:!0});p.HotTestElement=p.HotTestElementOptions=void 0;p.HotTestElementOptions=(()=>class{constructor(v={}){this.mustBeVisible=v.mustBeVisible||!0;this.ignoreMissingElementError=v.ignoreMissingElementError||!1}})();p.HotTestElement=(()=>class{constructor(v,w="",x=
|
|
257
|
+
null){"string"==typeof v?(this.name=v,this.func=w,this.value=x):(this.name=v.name,this.func=v.func||w,this.value=v.value||x)}})()},[6434](J,p,v){Object.defineProperty(p,"__esModule",{value:!0});p.HotTestMap=void 0;var w=v(4744);p.HotTestMap=class{constructor(x=[],E={},k=[]){if(x instanceof Array){this.destinations=[];for(var r=0;r<x.length;r++)this.destinations.push(new w.HotTestDestination(x[r]))}else for(r in this.destinations={},x)this.destinations[r]=new w.HotTestDestination(x[r]);this.destinationOrder=
|
|
258
|
+
k;this.pages=E}}},[1153](J,p){Object.defineProperty(p,"__esModule",{value:!0})},[9962](J,p){Object.defineProperty(p,"__esModule",{value:!0})},[8969](J,p,v){var w=this&&this.__awaiter||function(k,r,n,l){return new (n||(n=Promise))(function(c,h){function a(b){try{u(l.next(b))}catch(m){h(m)}}function d(b){try{u(l.throw(b))}catch(m){h(m)}}function u(b){var m;b.done?c(b.value):(m=b.value,m instanceof n?m:new n(function(t){t(m)})).then(a,d)}u((l=l.apply(k,r||[])).next())})};Object.defineProperty(p,"__esModule",
|
|
259
|
+
{value:!0});p.HotTester=void 0;var x=v(9343);class E{constructor(k,r,n,l,c={}){if(null==c)throw Error("The testMaps parameter can be an empty object, but cannot be null! It is set to null.");this.processor=k;this.name=r;this.timeout=1E4;this.baseUrl=n;this.testMaps=c;this.driver=l;null!=this.driver&&(this.driver.tester=this);this.hasBeenDestroyed=this.hasBeenSetup=this.finishedLoading=!1;this.currentPage=null;this.numFailures=0}setup(k,r,n){return w(this,void 0,void 0,function*(){})}destroy(){return w(this,
|
|
260
|
+
void 0,void 0,function*(){})}waitForData(){return w(this,void 0,void 0,function*(){for(var k=parseInt(process.env.HOTSTAQ_WAIT_FOR_DATA_TIMEOUT_MS||"120000",10)||12E4,r=Date.now();!1===this.finishedLoading;){if(Date.now()-r>k)throw Error(`HotTester: waitForData timed out after ${k}ms \u2014 the test page never registered its test paths with HotTesterAPI. Check that HotStaq.min.js loaded, the page didn't error before Hot.CurrentPage.createTestPath, and testerAPIUrl in HotSite.yaml points at this server. Override the cap with HOTSTAQ_WAIT_FOR_DATA_TIMEOUT_MS.`);
|
|
261
|
+
yield x.HotStaq.wait(10)}})}static interpretDestination(k,r){k={mapName:k,url:"",api:"",paths:[]};r=r.destination.split(/\->/g);var n=r[0];if(n.length<2||"/"===n[0]&&"/"===n[1])return null;var l=(c,h)=>{var a=c.indexOf(h),d="";return a>-1&&(d=c.substr(a+h.length),d=d.trim()),d};k.url=l(n,"url:");k.api=l(n,"api:");for(n=1;n<r.length;n++){let c=r[n],h={cmd:"",dest:"",path:""};c=c.trim();h.dest=l(c,"dest:");h.cmd=l(c,"cmd:");h.path=l(c,"path:");""==h.dest&&""==h.cmd&&""==h.path&&(h.path=c);k.paths.push(h)}return k}executeTestAPIPath(k,
|
|
262
|
+
r,n){return w(this,arguments,void 0,function*(l,c,h,a=!1,d=!1){var u=!0;if(null==c)throw Error(`Trying to access null method on destination map ${l.mapName}.`);!1===a&&null!=this.onTestAPIPathStart&&(u=yield this.onTestAPIPathStart(l,c,h,d));var b=null;if(!0===u){u=c.testCases[h];if(null==u)throw Error(`HotTester: Test case object ${h} does not exist!`);b=yield u.func(this.driver)}return!1===a&&null!=this.onTestAPIPathEnd&&(yield this.onTestAPIPathEnd(l,c,h,b,d)),b})}executeTestAPIPaths(k){return w(this,
|
|
263
|
+
void 0,void 0,function*(){var r=[];if(null==this.testMaps[k.mapName])throw Error(`HotTester: API Map ${k.mapName} does not exist!`);if(null==this.processor.api)throw Error("HotTester: Associated processor does not have an API!");var n=this.processor.api.routes[k.api];if(null==n)throw Error(`HotTester: API does not have route ${k.api}!`);for(let c=0;c+1<k.paths.length;c+=2){var l=k.paths[c].path;let h=n.getMethod(l),a=k.paths[c+1].path;if(null==h)throw Error(`Unable to find method related to path ${l} in map ${k.mapName}`);
|
|
264
|
+
l=yield this.executeTestAPIPath(k,h,a);r.push(l)}return r})}executeTestPagePath(k,r){return w(this,arguments,void 0,function*(n,l,c=!1,h=!1){yield this.waitForData();var a=!0;if(null==this.testMaps[n.mapName])throw Error(`HotTester: Web Map ${n.mapName} does not exist!`);var d=this.currentPage;if(null==d)throw Error("HotTester: A current page was not set!");this.driver.page=d;var u=l.path;d=d.testPaths[u];!1===c&&null!=this.onTestPagePathStart&&(a=yield this.onTestPagePathStart(n,l,h));l=null;if(!0===
|
|
265
|
+
a){if(null==d)throw Error(`HotTester: Test path ${u} does not have a function!`);l=yield d(this.driver)}return!1===c&&null!=this.onTestPagePathEnd&&(yield this.onTestPagePathEnd(n,d,l,h)),!0===a&&(yield x.HotStaq.wait(this.driver.pageTestDelay)),l})}executeCommand(k,r,n){return w(this,void 0,void 0,function*(){var l=(d,u,b)=>{d=!1;r.cmd===u&&(d=!0);b=r.cmd.indexOf("(");return b>-1&&r.cmd.substr(0,b)===u&&(d=!0),d},c=d=>{var u=[];return(d=d.match(/\(([^)]+)\)/))?(u=d[1].split(",").map(b=>b.trim()),
|
|
266
|
+
u):[]},h=null,a=[];if(!0===l(r.cmd,"url")&&(a=c(r.cmd),h=d=>w(this,void 0,void 0,function*(){var u=d[0];if(null==this.driver.waitForTestElement)throw Error(`HotTester: Driver ${this.driver.constructor.name} does not support waitForTestElement!`);yield this.driver.navigateToUrl(u)})),!0===l(r.cmd,"waitForTestObject")&&(a=c(r.cmd),h=d=>w(this,void 0,void 0,function*(){var u=d[0];if(null==this.driver.waitForTestElement)throw Error(`HotTester: Driver ${this.driver.constructor.name} does not support waitForTestElement!`);
|
|
267
|
+
yield this.driver.waitForTestElement(u)})),!0===l(r.cmd,"waitForTesterAPIData")&&(h=d=>w(this,void 0,void 0,function*(){this.finishedLoading=!1;yield this.waitForData()})),!0===l(r.cmd,"wait")&&(a=c(r.cmd),h=d=>w(this,void 0,void 0,function*(){var u=parseInt(d[0]);yield x.HotStaq.wait(u)})),!0===l(r.cmd,"print")&&(a=c(r.cmd),h=d=>w(this,void 0,void 0,function*(){yield this.driver.print(d[0])})),!0===l(r.cmd,"println")&&(a=c(r.cmd),h=d=>w(this,void 0,void 0,function*(){yield this.driver.println(d[0])})),
|
|
268
|
+
!0===l(r.cmd,"click")&&(a=c(r.cmd),h=d=>w(this,void 0,void 0,function*(){var u=d[0];if(null==this.driver.waitForTestElement)throw Error(`HotTester: Driver ${this.driver.constructor.name} does not support waitForTestElement!`);yield(yield this.driver.waitForTestElement(u)).click()})),!0===l(r.cmd,"sendKeys")&&(a=c(r.cmd),h=d=>w(this,void 0,void 0,function*(){var u=d[0],b=d[1];if(null==this.driver.waitForTestElement)throw Error(`HotTester: Driver ${this.driver.constructor.name} does not support waitForTestElement!`);
|
|
269
|
+
yield(yield this.driver.waitForTestElement(u)).sendKeys(b)})),!0===l(r.cmd,"clear")&&(a=c(r.cmd),h=d=>w(this,void 0,void 0,function*(){var u=d[0];if(null==this.driver.waitForTestElement)throw Error(`HotTester: Driver ${this.driver.constructor.name} does not support waitForTestElement!`);yield(yield this.driver.waitForTestElement(u)).clear()})),!0===l(r.cmd,"debugger")&&(a=c(r.cmd),h=d=>w(this,void 0,void 0,function*(){})),null==h)throw Error(`HotTester: Command ${r.cmd} does not exist!`);yield this.onCommand(k,
|
|
270
|
+
r,n,a,h)})}executeTestPagePaths(k){return w(this,arguments,void 0,function*(r,n=!1){var l=[],c=this.testMaps[r.mapName];if(null==c)throw Error(`HotTester: Web Map ${r.mapName} does not exist!`);for(let h=0;h<r.paths.length;h++){let a=r.paths[h],d=null;if(""!==a.dest){if(c.destinations instanceof Array)throw Error(`HotTester: When using type 'dest' in a destination string, all destinations in map ${r.mapName} must be named.`);let u=E.interpretDestination(r.mapName,c.destinations[a.dest]);null!=u&&
|
|
271
271
|
(d=yield this.executeTestPagePaths(u))}""!==a.cmd&&(yield this.executeCommand(r,a,a.cmd));""!==a.path&&(d=yield this.executeTestPagePath(r,a,!1,n));l.push(d)}return l})}execute(k){return w(this,void 0,void 0,function*(){var r=this.testMaps[k];if(null==r)throw Error(`HotTester: Map ${k} does not exist!`);this.processor.logger.verbose(`HotTester: Executing map ${k}...`);this.processor.getRouteKeyFromName(k);var n=(d,...u)=>w(this,[d,...u],void 0,function*(b,m=""){if(!1!==b.autoStart)try{this.processor.logger.verbose(()=>
|
|
272
272
|
`HotTester: Executing ${k} destination ${JSON.stringify(b)}...`);let t=E.interpretDestination(k,b),D=!1,C=!0,A=this.baseUrl;""!==t.url&&(D=!0,A+=t.url);null!=this.setup&&!1===this.hasBeenSetup&&(yield this.setup(D,A,m),this.hasBeenSetup=!0,this.hasBeenDestroyed=!1);null!=this.onTestStart&&(C=yield this.onTestStart(t,A,m));!0===C&&(""!==t.url&&(yield this.executeTestPagePaths(t)),""!==t.api&&(yield this.executeTestAPIPaths(t)));null!=this.onTestEnd&&(yield this.onTestEnd(t));null!=this.destroy&&!1===
|
|
273
|
-
this.hasBeenDestroyed&&(yield this.destroy(),this.hasBeenDestroyed=!0,this.hasBeenSetup=!1)}catch(t){throw t;}});if(r.destinations instanceof Array)for(var l=0;l<r.destinations.length;l++)yield n(r.destinations[l]);else if(r.destinationOrder.length>0){var c=[];for(var
|
|
274
|
-
l){
|
|
275
|
-
p.HotTesterAPI=void 0;var x=v(6044),E=v(7605),k=v(9844),r=v(9343);class n extends x.HotAPI{constructor(l,c=null,
|
|
273
|
+
this.hasBeenDestroyed&&(yield this.destroy(),this.hasBeenDestroyed=!0,this.hasBeenSetup=!1)}catch(t){throw t;}});if(r.destinations instanceof Array)for(var l=0;l<r.destinations.length;l++)yield n(r.destinations[l]);else if(r.destinationOrder.length>0){var c=[];for(var h=0;h<r.destinationOrder.length;h++){var a=r.destinationOrder[h];let d=r.destinations[a];if(null==d)throw Error(`HotTester: Destination ${a} does not exist!`);c.push(a);yield n(d,a)}for(l in r.destinations){h=!0;for(a=0;a<c.length;a++)if(c[a]===
|
|
274
|
+
l){h=!1;break}!0===h&&(yield n(r.destinations[l],l))}}else for(c in r.destinations)yield n(r.destinations[c],c)})}}p.HotTester=E},[6681](J,p,v){var w=this&&this.__awaiter||function(l,c,h,a){return new (h||(h=Promise))(function(d,u){function b(D){try{t(a.next(D))}catch(C){u(C)}}function m(D){try{t(a.throw(D))}catch(C){u(C)}}function t(D){var C;D.done?d(D.value):(C=D.value,C instanceof h?C:new h(function(A){A(C)})).then(b,m)}t((a=a.apply(l,c||[])).next())})};Object.defineProperty(p,"__esModule",{value:!0});
|
|
275
|
+
p.HotTesterAPI=void 0;var x=v(6044),E=v(7605),k=v(9844),r=v(9343);class n extends x.HotAPI{constructor(l,c=null,h=null){super(l,c,h);this.executeEventsUsing=x.EventExecutionType.HotAPI;l=new E.HotRoute(c,"tester");l.addMethod({name:"pageLoaded",onServerExecute:this.pageLoaded,parameters:{testerName:{required:!0,type:"string",description:"The name of the tester executing the test."},testerMap:{required:!0,type:"string",description:"The tester map executing the test."},pageName:{required:!0,type:"string",
|
|
276
276
|
description:"The name of the page executing the test."},testElements:{required:!0,type:"array",description:"The test elements on the page."},testPaths:{required:!0,type:"array",description:"The test paths on the page."}},returns:"Returns true as an acknowledgement."});l.addMethod({name:"pageUnloaded",onServerExecute:this.pageUnloaded,parameters:{testerName:{required:!0,type:"string",description:"The name of the tester executing the test."}},returns:"Returns true as an acknowledgement."});l.addMethod({name:"executeTests",
|
|
277
277
|
onServerExecute:this.executeTests,parameters:{testerName:{required:!0,type:"string",description:"The name of the tester executing the test."},testerMap:{required:!0,type:"object",description:"The tester map to execute."}},returns:"Returns true when tests are complete."});l.addMethod({name:"heartbeat",type:k.HotEventMethod.GET,onServerExecute:this.heartbeat,returns:"Returns true as an acknowledgement."});this.addRoute(l)}pageLoaded(l){return w(this,void 0,void 0,function*(){var c={testerName:l.jsonObj.testerName,
|
|
278
|
-
testElements:l.jsonObj.testElements,testPathsStrs:l.jsonObj.testPaths};for(var
|
|
279
|
-
c={testElements:c.testElements,testPaths:
|
|
280
|
-
void 0,void 0,function*(){var c=l.jsonObj.testerName,
|
|
281
|
-
|
|
282
|
-
null}useSocket(k){this.socket=k}connect(){return w(this,arguments,void 0,function*(k=null,r=null,n){return null!=k&&(null==n&&(n={}),n=Object.assign(Object.assign({},n),{auth:k})),null!=r&&(null==n&&(n={}),n=Object.assign(Object.assign({},n),{query:r})),this.socket=(0,x.io)(this.url,n),new Promise((l,c)=>{this.socket.on("connect",()=>{null!=this.onConnect&&this.onConnect();l()});this.socket.on("connect_error",
|
|
283
|
-
this.onError?c(
|
|
284
|
-
this.socket&&!1!==this.socket.connected}send(k,r,n=null){if(null==this.socket)throw Error(`Client socket is null. Unable to send event ${k}`);if(!1===this.socket.connected)throw Error(`Client socket is not connected. Unable to send event ${k}`);return null==n&&(n=(0,E.v4)()),this.socket.emit(k,{uuid:n,data:r}),n}sendOn(k,r,n){return w(this,arguments,void 0,function*(l,c,
|
|
285
|
-
c,a)})})}sendOnce(k,r){return w(this,arguments,void 0,function*(n,l,c=null){return yield new Promise((
|
|
286
|
-
return c(
|
|
287
|
-
q.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",q}function E(z,
|
|
288
|
-
validate:()=>d,version:()=>
|
|
289
|
-
11]]+u[z[
|
|
290
|
-
1&16383),(F<0||B>D)&&void 0===z.nsecs&&(G=0),G>=1E4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");D=B;C=G;t=y;z=(1E4*(268435455&(B+=122192928E5))+G)%4294967296;q[
|
|
291
|
-
(
|
|
292
|
-
|
|
278
|
+
testElements:l.jsonObj.testElements,testPathsStrs:l.jsonObj.testPaths};for(var h in c){var a=!1;if(null==c[h]&&(a=!0),""!=c.testerName&&""!==c.testElements&&""!==c.testPathsStrs||(a=!0),!0===a)throw Error(`TesterAPI: Object ${h} was not passed.`);}c.testElements=JSON.parse(c.testElements);c.testPathsStrs=JSON.parse(c.testPathsStrs);h={};for(var d in c.testPathsStrs)a=eval(c.testPathsStrs[d]),h[d]=a;d=this.connection.processor.testers[c.testerName];if(null==d)throw Error(`TesterAPI: Tester ${c.testerName} does not exist!`);
|
|
279
|
+
c={testElements:c.testElements,testPaths:h};h=d.finishedLoading=!0;return null!=d.onFinishedLoading&&(h=yield d.onFinishedLoading(c)),!0===h&&(d.currentPage=c),!0})}pageUnloaded(l){return w(this,void 0,void 0,function*(){var c=r.HotStaq.getParamUnsafe("testerName",l.jsonObj),h=this.connection.processor.testers[c];if(null==h)throw Error(`TesterAPI: Tester ${c} does not exist!`);return h.finishedLoading=!1,h.currentPage=null,null!=h.onFinishedUnloading&&(yield h.onFinishedUnloading()),!0})}executeTests(l){return w(this,
|
|
280
|
+
void 0,void 0,function*(){var c=l.jsonObj.testerName,h=l.jsonObj.testerMap;if(null==c||null==h)throw Error("TesterAPI: Not all required json objects were passed.");if(""===c||""===h)throw Error("TesterAPI: Not all required json objects were passed.");var a=this.connection;return null!=a.executeTests&&(yield a.executeTests(c,h)),!0})}heartbeat(l){return w(this,void 0,void 0,function*(){return!0})}}p.HotTesterAPI=n},[3596](J,p,v){var w=this&&this.__awaiter||function(k,r,n,l){return new (n||(n=Promise))(function(c,
|
|
281
|
+
h){function a(b){try{u(l.next(b))}catch(m){h(m)}}function d(b){try{u(l.throw(b))}catch(m){h(m)}}function u(b){var m;b.done?c(b.value):(m=b.value,m instanceof n?m:new n(function(t){t(m)})).then(a,d)}u((l=l.apply(k,r||[])).next())})};Object.defineProperty(p,"__esModule",{value:!0});p.HotWebSocketClient=void 0;var x=v(8007),E=v(611);p.HotWebSocketClient=class{constructor(k,r=null){this.url=k;this.socket=r;this.persistentData={};this.onDisconnect=this.onError=this.onConnectError=this.authorizedValue=
|
|
282
|
+
null}useSocket(k){this.socket=k}connect(){return w(this,arguments,void 0,function*(k=null,r=null,n){return null!=k&&(null==n&&(n={}),n=Object.assign(Object.assign({},n),{auth:k})),null!=r&&(null==n&&(n={}),n=Object.assign(Object.assign({},n),{query:r})),this.socket=(0,x.io)(this.url,n),new Promise((l,c)=>{this.socket.on("connect",()=>{null!=this.onConnect&&this.onConnect();l()});this.socket.on("connect_error",h=>{null==this.onConnectError?c(h):this.onConnectError(h)});this.socket.on("error",h=>{null==
|
|
283
|
+
this.onError?c(h):this.onError(h)});this.socket.on("disconnect",()=>{null!=this.onDisconnect&&this.onDisconnect()})})})}on(k,r,n=null){this.socket.on(k,function(l,c){null!=c.uuid?null!=l?c.uuid===l&&r(c.data,c.uuid):r(c.data,c.uuid):r(c,l)}.bind(this,n))}onRaw(k,r){this.socket.on(k,r)}off(k){this.socket.off(k,null)}once(k,r,n=null){this.socket.once(k,function(l,c){null!=c.uuid?null!=l?c.uuid===l&&r(c.data,c.uuid):r(c.data,c.uuid):r(c,l)}.bind(this,n))}onceRaw(k,r){this.socket.once(k,r)}getId(){return this.socket.id}isConnected(){return null!=
|
|
284
|
+
this.socket&&!1!==this.socket.connected}send(k,r,n=null){if(null==this.socket)throw Error(`Client socket is null. Unable to send event ${k}`);if(!1===this.socket.connected)throw Error(`Client socket is not connected. Unable to send event ${k}`);return null==n&&(n=(0,E.v4)()),this.socket.emit(k,{uuid:n,data:r}),n}sendOn(k,r,n){return w(this,arguments,void 0,function*(l,c,h,a=null){return yield new Promise((d,u)=>{null==a&&(a=(0,E.v4)());this.on(l,function(b,m){h(m,b);d(m)}.bind(this,a),a);this.send(l,
|
|
285
|
+
c,a)})})}sendOnce(k,r){return w(this,arguments,void 0,function*(n,l,c=null){return yield new Promise((h,a)=>{null==c&&(c=(0,E.v4)());this.once(n,function(d,u){h(u)}.bind(this,c),c);this.send(n,l,c)})})}disconnect(k){null!=this.socket&&!1!==this.socket.connected&&this.socket.disconnect()}}},[611](J,p,v){function w(){if(!c&&!(c="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
286
|
+
return c(h)}function x(z,f,g){function q(e,y,B,G){if("string"==typeof e){var F=unescape(encodeURIComponent(e));e=[];for(var T=0;T<F.length;++T)e.push(F.charCodeAt(T))}if("string"==typeof y&&(y=H(y)),16!==y.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");F=new Uint8Array(16+e.length);if(F.set(y),F.set(e,y.length),(F=g(F))[6]=15&F[6]|f,F[8]=63&F[8]|128,B){G=G||0;for(y=0;y<16;++y)B[G+y]=F[y];return B}return b(F)}try{q.name=z}catch(e){}return q.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
287
|
+
q.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",q}function E(z,f){var g=(65535&z)+(65535&f);return(z>>16)+(f>>16)+(g>>16)<<16|65535&g}function k(z,f,g,q,e,y){var B;return E((B=E(E(f,z),E(q,y)))<<e|B>>>32-e,g)}function r(z,f,g,q,e,y,B){return k(f&g|~f&q,z,f,e,y,B)}function n(z,f,g,q,e,y,B){return k(f&q|g&~q,z,f,e,y,B)}function l(z,f,g,q,e,y,B){return k(g^(f|~q),z,f,e,y,B)}var c;v.r(p);v.d(p,{NIL:()=>"00000000-0000-0000-0000-000000000000",parse:()=>H,stringify:()=>b,v1:()=>A,v3:()=>K,v4:()=>P,v5:()=>M,
|
|
288
|
+
validate:()=>d,version:()=>W});var h=new Uint8Array(16),a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,d=function(z){return"string"==typeof z&&a.test(z)},u=[];for(J=0;J<256;++J)u.push((J+256).toString(16).substr(1));var b=function(z){var f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;f=(u[z[f+0]]+u[z[f+1]]+u[z[f+2]]+u[z[f+3]]+"-"+u[z[f+4]]+u[z[f+5]]+"-"+u[z[f+6]]+u[z[f+7]]+"-"+u[z[f+8]]+u[z[f+9]]+"-"+u[z[f+10]]+u[z[f+
|
|
289
|
+
11]]+u[z[f+12]]+u[z[f+13]]+u[z[f+14]]+u[z[f+15]]).toLowerCase();if(!d(f))throw TypeError("Stringified UUID is invalid");return f},m,t,D=0,C=0,A=function(z,f,g){g=f&&g||0;var q=f||Array(16),e=(z=z||{}).node||m,y=void 0!==z.clockseq?z.clockseq:t;if(null==e||null==y){var B=z.random||(z.rng||w)();null==e&&(e=m=[1|B[0],B[1],B[2],B[3],B[4],B[5]]);null==y&&(y=t=16383&(B[6]<<8|B[7]))}B=void 0!==z.msecs?z.msecs:Date.now();var G=void 0!==z.nsecs?z.nsecs:C+1,F=B-D+(G-C)/1E4;if(F<0&&void 0===z.clockseq&&(y=y+
|
|
290
|
+
1&16383),(F<0||B>D)&&void 0===z.nsecs&&(G=0),G>=1E4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");D=B;C=G;t=y;z=(1E4*(268435455&(B+=122192928E5))+G)%4294967296;q[g++]=z>>>24&255;q[g++]=z>>>16&255;q[g++]=z>>>8&255;q[g++]=255&z;z=B/4294967296*1E4&268435455;q[g++]=z>>>8&255;q[g++]=255&z;q[g++]=z>>>24&15|16;q[g++]=z>>>16&255;q[g++]=y>>>8|128;q[g++]=255&y;for(y=0;y<6;++y)q[g+y]=e[y];return f||b(q)},H=function(z){if(!d(z))throw TypeError("Invalid UUID");var f,g=new Uint8Array(16);return g[0]=
|
|
291
|
+
(f=parseInt(z.slice(0,8),16))>>>24,g[1]=f>>>16&255,g[2]=f>>>8&255,g[3]=255&f,g[4]=(f=parseInt(z.slice(9,13),16))>>>8,g[5]=255&f,g[6]=(f=parseInt(z.slice(14,18),16))>>>8,g[7]=255&f,g[8]=(f=parseInt(z.slice(19,23),16))>>>8,g[9]=255&f,g[10]=(f=parseInt(z.slice(24,36),16))/1099511627776&255,g[11]=f/4294967296&255,g[12]=f>>>24&255,g[13]=f>>>16&255,g[14]=f>>>8&255,g[15]=255&f,g},K=x("v3",48,function(z){if("string"==typeof z){var f=unescape(encodeURIComponent(z));z=new Uint8Array(f.length);for(var g=0;g<
|
|
292
|
+
f.length;++g)z[g]=f.charCodeAt(g)}return function(q){for(var e=[],y=32*q.length,B=0;B<y;B+=8){var G=q[B>>5]>>>B%32&255;G=parseInt("0123456789abcdef".charAt(G>>>4&15)+"0123456789abcdef".charAt(15&G),16);e.push(G)}return e}(function(q,e){q[e>>5]|=128<<e%32;q[14+(e+64>>>9<<4)+1-1]=e;var y=1732584193;e=-271733879;for(var B=-1732584194,G=271733878,F=0;F<q.length;F+=16){var T=y,S=e,R=B,X=G;y=r(y,e,B,G,q[F],7,-680876936);G=r(G,y,e,B,q[F+1],12,-389564586);B=r(B,G,y,e,q[F+2],17,606105819);e=r(e,B,G,y,q[F+
|
|
293
293
|
3],22,-1044525330);y=r(y,e,B,G,q[F+4],7,-176418897);G=r(G,y,e,B,q[F+5],12,1200080426);B=r(B,G,y,e,q[F+6],17,-1473231341);e=r(e,B,G,y,q[F+7],22,-45705983);y=r(y,e,B,G,q[F+8],7,1770035416);G=r(G,y,e,B,q[F+9],12,-1958414417);B=r(B,G,y,e,q[F+10],17,-42063);e=r(e,B,G,y,q[F+11],22,-1990404162);y=r(y,e,B,G,q[F+12],7,1804603682);G=r(G,y,e,B,q[F+13],12,-40341101);B=r(B,G,y,e,q[F+14],17,-1502002290);y=n(y,e=r(e,B,G,y,q[F+15],22,1236535329),B,G,q[F+1],5,-165796510);G=n(G,y,e,B,q[F+6],9,-1069501632);B=n(B,G,
|
|
294
294
|
y,e,q[F+11],14,643717713);e=n(e,B,G,y,q[F],20,-373897302);y=n(y,e,B,G,q[F+5],5,-701558691);G=n(G,y,e,B,q[F+10],9,38016083);B=n(B,G,y,e,q[F+15],14,-660478335);e=n(e,B,G,y,q[F+4],20,-405537848);y=n(y,e,B,G,q[F+9],5,568446438);G=n(G,y,e,B,q[F+14],9,-1019803690);B=n(B,G,y,e,q[F+3],14,-187363961);e=n(e,B,G,y,q[F+8],20,1163531501);y=n(y,e,B,G,q[F+13],5,-1444681467);G=n(G,y,e,B,q[F+2],9,-51403784);B=n(B,G,y,e,q[F+7],14,1735328473);var da=y;y=e=n(e,B,G,y,q[F+12],20,-1926607734);y=k(y^B^G,da,y,q[F+5],4,-378558);
|
|
295
295
|
G=k(y^e^B,G,y,q[F+8],11,-2022574463);B=k(G^y^e,B,G,q[F+11],16,1839030562);e=k(B^G^y,e,B,q[F+14],23,-35309556);y=k(e^B^G,y,e,q[F+1],4,-1530992060);G=k(y^e^B,G,y,q[F+4],11,1272893353);B=k(G^y^e,B,G,q[F+7],16,-155497632);e=k(B^G^y,e,B,q[F+10],23,-1094730640);y=k(e^B^G,y,e,q[F+13],4,681279174);G=k(y^e^B,G,y,q[F],11,-358537222);B=k(G^y^e,B,G,q[F+3],16,-722521979);e=k(B^G^y,e,B,q[F+6],23,76029189);y=k(e^B^G,y,e,q[F+9],4,-640364487);G=k(y^e^B,G,y,q[F+12],11,-421815835);B=k(G^y^e,B,G,q[F+15],16,530742520);
|
|
296
296
|
y=l(y,e=k(B^G^y,e,B,q[F+2],23,-995338651),B,G,q[F],6,-198630844);G=l(G,y,e,B,q[F+7],10,1126891415);B=l(B,G,y,e,q[F+14],15,-1416354905);e=l(e,B,G,y,q[F+5],21,-57434055);y=l(y,e,B,G,q[F+12],6,1700485571);G=l(G,y,e,B,q[F+3],10,-1894986606);B=l(B,G,y,e,q[F+10],15,-1051523);e=l(e,B,G,y,q[F+1],21,-2054922799);y=l(y,e,B,G,q[F+8],6,1873313359);G=l(G,y,e,B,q[F+15],10,-30611744);B=l(B,G,y,e,q[F+6],15,-1560198380);e=l(e,B,G,y,q[F+13],21,1309151649);y=l(y,e,B,G,q[F+4],6,-145523070);G=l(G,y,e,B,q[F+11],10,-1120210379);
|
|
297
|
-
B=l(B,G,y,e,q[F+2],15,718787259);e=l(e,B,G,y,q[F+9],21,-343485551);y=E(y,
|
|
298
|
-
3395469782],
|
|
299
|
-
1][14]);e[q-1][15]=8*(z.length-1)&4294967295;for(z=0;z<q;++z){y=new Uint32Array(80);for(B=0;B<16;++B)y[B]=e[z][B];for(B=16;B<80;++B)G=y[B-3]^y[B-8]^y[B-14]^y[B-16],y[B]=G<<1|G>>>31;B=
|
|
300
|
-
|
|
297
|
+
B=l(B,G,y,e,q[F+2],15,718787259);e=l(e,B,G,y,q[F+9],21,-343485551);y=E(y,T);e=E(e,S);B=E(B,R);G=E(G,X)}return[y,e,B,G]}(function(q){if(0===q.length)return[];for(var e=8*q.length,y=new Uint32Array(14+(e+64>>>9<<4)+1),B=0;B<e;B+=8)y[B>>5]|=(255&q[B/8])<<B%32;return y}(z),8*z.length))}),P=function(z,f,g){var q=(z=z||{}).random||(z.rng||w)();if(q[6]=15&q[6]|64,q[8]=63&q[8]|128,f){g=g||0;for(z=0;z<16;++z)f[g+z]=q[z];return f}return b(q)},M=x("v5",80,function(z){var f=[1518500249,1859775393,2400959708,
|
|
298
|
+
3395469782],g=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof z){var q=unescape(encodeURIComponent(z));z=[];for(var e=0;e<q.length;++e)z.push(q.charCodeAt(e))}else Array.isArray(z)||(z=Array.prototype.slice.call(z));z.push(128);q=Math.ceil((z.length/4+2)/16);e=Array(q);for(var y=0;y<q;++y){for(var B=new Uint32Array(16),G=0;G<16;++G)B[G]=z[64*y+4*G]<<24|z[64*y+4*G+1]<<16|z[64*y+4*G+2]<<8|z[64*y+4*G+3];e[y]=B}e[q-1][14]=8*(z.length-1)/4294967296;e[q-1][14]=Math.floor(e[q-
|
|
299
|
+
1][14]);e[q-1][15]=8*(z.length-1)&4294967295;for(z=0;z<q;++z){y=new Uint32Array(80);for(B=0;B<16;++B)y[B]=e[z][B];for(B=16;B<80;++B)G=y[B-3]^y[B-8]^y[B-14]^y[B-16],y[B]=G<<1|G>>>31;B=g[0];G=g[1];for(var F=g[2],T=g[3],S=g[4],R=0;R<80;++R){var X=Math.floor(R/20),da=B<<5|B>>>27;a:{switch(X){case 0:var ha=G&F^~G&T;break a;case 1:case 3:ha=G^F^T;break a;case 2:ha=G&F^G&T^F&T;break a}ha=void 0}X=da+ha+S+f[X]+y[R]>>>0;S=T;T=F;F=(G<<30|G>>>2)>>>0;G=B;B=X}g[0]=g[0]+B>>>0;g[1]=g[1]+G>>>0;g[2]=g[2]+F>>>0;g[3]=
|
|
300
|
+
g[3]+T>>>0;g[4]=g[4]+S>>>0}return[g[0]>>24&255,g[0]>>16&255,g[0]>>8&255,255&g[0],g[1]>>24&255,g[1]>>16&255,g[1]>>8&255,255&g[1],g[2]>>24&255,g[2]>>16&255,g[2]>>8&255,255&g[2],g[3]>>24&255,g[3]>>16&255,g[3]>>8&255,255&g[3],g[4]>>24&255,g[4]>>16&255,g[4]>>8&255,255&g[4]]}),W=function(z){if(!d(z))throw TypeError("Invalid UUID");return parseInt(z.substr(14,1),16)}},[8241](J){J.exports=FormData},[2365](J){J.exports=fetch},[7963](J){J.exports={}},[1603](){},[9247](){},[4110](J,p){Object.defineProperty(p,
|
|
301
301
|
"__esModule",{value:!0});p.hasCORS=void 0;J=!1;try{J="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(v){}p.hasCORS=J},[8661](J,p){Object.defineProperty(p,"__esModule",{value:!0});p.encode=function(v){var w="";for(let x in v)v.hasOwnProperty(x)&&(w.length&&(w+="&"),w+=encodeURIComponent(x)+"="+encodeURIComponent(v[x]));return w};p.decode=function(v){var w={};v=v.split("&");for(let x=0,E=v.length;x<E;x++){let k=v[x].split("=");w[decodeURIComponent(k[0])]=decodeURIComponent(k[1])}return w}},
|
|
302
302
|
[1015](J,p){Object.defineProperty(p,"__esModule",{value:!0});p.parse=function(x){if(x.length>8E3)throw"URI too long";var E=x,k=x.indexOf("["),r=x.indexOf("]");-1!=k&&-1!=r&&(x=x.substring(0,k)+x.substring(k,r).replace(/:/g,";")+x.substring(r,x.length));x=v.exec(x||"");for(var n={},l=14;l--;)n[w[l]]=x[l]||"";return-1!=k&&-1!=r&&(n.source=E,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=
|
|
303
|
-
function(c,
|
|
303
|
+
function(c,h){c=h.replace(/\/{2,9}/g,"/").split("/");return"/"!=h.slice(0,1)&&0!==h.length||c.splice(0,1),"/"==h.slice(-1)&&c.splice(c.length-1,1),c}(0,n.path),n.queryKey=function(c,h){var a={};return h.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(d,u,b){u&&(a[u]=b)}),a}(0,n.query),n};var v=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,
|
|
304
304
|
w="source protocol authority userInfo user password host port relative path directory file query anchor".split(" ")},[4624](J,p){Object.defineProperty(p,"__esModule",{value:!0});p.defaultBinaryType=p.globalThisShim=p.nextTick=void 0;p.createCookieJar=function(){};p.nextTick="function"==typeof Promise&&"function"==typeof Promise.resolve?v=>Promise.resolve().then(v):(v,w)=>w(v,0);p.globalThisShim="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();p.defaultBinaryType=
|
|
305
305
|
"arraybuffer"},[4956](J,p,v){Object.defineProperty(p,"__esModule",{value:!0});p.WebTransport=p.WebSocket=p.NodeWebSocket=p.XHR=p.NodeXHR=p.Fetch=p.nextTick=p.parse=p.installTimerFunctions=p.transports=p.TransportError=p.Transport=p.protocol=p.SocketWithUpgrade=p.SocketWithoutUpgrade=p.Socket=void 0;var w=v(8223);Object.defineProperty(p,"Socket",{enumerable:!0,get:function(){return w.Socket}});var x=v(8223);Object.defineProperty(p,"SocketWithoutUpgrade",{enumerable:!0,get:function(){return x.SocketWithoutUpgrade}});
|
|
306
306
|
Object.defineProperty(p,"SocketWithUpgrade",{enumerable:!0,get:function(){return x.SocketWithUpgrade}});p.protocol=w.Socket.protocol;var E=v(4689);Object.defineProperty(p,"Transport",{enumerable:!0,get:function(){return E.Transport}});Object.defineProperty(p,"TransportError",{enumerable:!0,get:function(){return E.TransportError}});var k=v(9419);Object.defineProperty(p,"transports",{enumerable:!0,get:function(){return k.transports}});var r=v(5374);Object.defineProperty(p,"installTimerFunctions",{enumerable:!0,
|
|
307
|
-
get:function(){return r.installTimerFunctions}});var n=v(1015);Object.defineProperty(p,"parse",{enumerable:!0,get:function(){return n.parse}});var l=v(4624);Object.defineProperty(p,"nextTick",{enumerable:!0,get:function(){return l.nextTick}});var c=v(8209);Object.defineProperty(p,"Fetch",{enumerable:!0,get:function(){return c.Fetch}});var
|
|
307
|
+
get:function(){return r.installTimerFunctions}});var n=v(1015);Object.defineProperty(p,"parse",{enumerable:!0,get:function(){return n.parse}});var l=v(4624);Object.defineProperty(p,"nextTick",{enumerable:!0,get:function(){return l.nextTick}});var c=v(8209);Object.defineProperty(p,"Fetch",{enumerable:!0,get:function(){return c.Fetch}});var h=v(2071);Object.defineProperty(p,"NodeXHR",{enumerable:!0,get:function(){return h.XHR}});var a=v(2071);Object.defineProperty(p,"XHR",{enumerable:!0,get:function(){return a.XHR}});
|
|
308
308
|
var d=v(8716);Object.defineProperty(p,"NodeWebSocket",{enumerable:!0,get:function(){return d.WS}});var u=v(8716);Object.defineProperty(p,"WebSocket",{enumerable:!0,get:function(){return u.WS}});var b=v(4480);Object.defineProperty(p,"WebTransport",{enumerable:!0,get:function(){return b.WT}})},[8223](J,p,v){J=this&&this.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(p,"__esModule",{value:!0});p.Socket=p.SocketWithUpgrade=p.SocketWithoutUpgrade=void 0;var w=
|
|
309
|
-
v(9419),x=v(5374),E=v(8661),k=v(1015),r=v(4454),n=v(6376),l=v(4624),c=(0,J(v(7833)).default)("engine.io-client:socket"),
|
|
309
|
+
v(9419),x=v(5374),E=v(8661),k=v(1015),r=v(4454),n=v(6376),l=v(4624),c=(0,J(v(7833)).default)("engine.io-client:socket"),h="function"==typeof addEventListener&&"function"==typeof removeEventListener,a=[];h&&addEventListener("offline",()=>{c("closing %d connection(s) because the network was lost",a.length);a.forEach(b=>b())},!1);class d extends r.Emitter{constructor(b,m){(super(),this.binaryType=l.defaultBinaryType,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,
|
|
310
310
|
this._maxPayload=-1,this._pingTimeoutTime=1/0,b&&"object"==typeof b&&(m=b,b=null),b)?(b=(0,k.parse)(b),m.hostname=b.host,m.secure="https"===b.protocol||"wss"===b.protocol,m.port=b.port,b.query&&(m.query=b.query)):m.host&&(m.hostname=(0,k.parse)(m.host).host);(0,x.installTimerFunctions)(this,m);this.secure=null!=m.secure?m.secure:"undefined"!=typeof location&&"https:"===location.protocol;m.hostname&&!m.port&&(m.port=this.secure?"443":"80");this.hostname=m.hostname||("undefined"!=typeof location?location.hostname:
|
|
311
311
|
"localhost");this.port=m.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80");this.transports=[];this._transportsByName={};m.transports.forEach(t=>{var D=t.prototype.name;this.transports.push(D);this._transportsByName[D]=t});this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},
|
|
312
|
-
m);this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":"");"string"==typeof this.opts.query&&(this.opts.query=(0,E.decode)(this.opts.query));
|
|
312
|
+
m);this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":"");"string"==typeof this.opts.query&&(this.opts.query=(0,E.decode)(this.opts.query));h&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(c("adding listener for the 'offline' event"),this._offlineEventListener=()=>{this._onClose("transport close",
|
|
313
313
|
{description:"network connection lost"})},a.push(this._offlineEventListener)));this.opts.withCredentials&&(this._cookieJar=(0,l.createCookieJar)());this._open()}createTransport(b){c('creating transport "%s"',b);var m=Object.assign({},this.opts.query);m.EIO=n.protocol;m.transport=b;this.id&&(m.sid=this.id);m=Object.assign({},this.opts,{query:m,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[b]);return c("options: %j",m),new this._transportsByName[b](m)}_open(){if(0===
|
|
314
314
|
this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);var b=this.opts.rememberUpgrade&&d.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";b=this.createTransport(b);b.open();this.setTransport(b)}setTransport(b){c("setting transport %s",b.name);this.transport&&(c("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners());this.transport=
|
|
315
315
|
b;b.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",m=>this._onClose("transport close",m))}onOpen(){c("socket open");this.readyState="open";d.priorWebsocketSuccess="websocket"===this.transport.name;this.emitReserved("open");this.flush()}_onPacket(b){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(c('socket receive: type "%s", data "%s"',b.type,b.data),this.emitReserved("packet",
|
|
@@ -319,90 +319,90 @@ this._prevBufferLen);this._prevBufferLen=0;0===this.writeBuffer.length?this.emit
|
|
|
319
319
|
var b=1;for(let m=0;m<this.writeBuffer.length;m++){let t=this.writeBuffer[m].data;if(t&&(b+=(0,x.byteLength)(t)),m>0&&b>this._maxPayload)return c("only send %d out of %d packets",m,this.writeBuffer.length),this.writeBuffer.slice(0,m);b+=2}return c("payload size is %d (max: %d)",b,this._maxPayload),this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;var b=Date.now()>this._pingTimeoutTime;return b&&(c("throttled timer detected, scheduling connection close"),this._pingTimeoutTime=0,
|
|
320
320
|
(0,l.nextTick)(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),b}write(b,m,t){return this._sendPacket("message",b,m,t),this}send(b,m,t){return this._sendPacket("message",b,m,t),this}_sendPacket(b,m,t,D){if("function"==typeof m&&(D=m,m=void 0),"function"==typeof t&&(D=t,t=null),"closing"!==this.readyState&&"closed"!==this.readyState)(t=t||{}).compress=!1!==t.compress,b={type:b,data:m,options:t},this.emitReserved("packetCreate",b),this.writeBuffer.push(b),D&&this.once("flush",D),this.flush()}close(){var b=
|
|
321
321
|
()=>{this._onClose("forced close");c("socket closing - telling transport to close");this.transport.close()},m=()=>{this.off("upgrade",m);this.off("upgradeError",m);b()},t=()=>{this.once("upgrade",m);this.once("upgradeError",m)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?t():b()}):this.upgrading?t():b()),this}_onError(b){if(c("socket error %j",b),d.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&
|
|
322
|
-
this.transports.length>1&&"opening"===this.readyState)return c("trying next transport"),this.transports.shift(),this._open();this.emitReserved("error",b);this._onClose("transport error",b)}_onClose(b,m){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(c('socket close with reason: "%s"',b),this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),
|
|
322
|
+
this.transports.length>1&&"opening"===this.readyState)return c("trying next transport"),this.transports.shift(),this._open();this.emitReserved("error",b);this._onClose("transport error",b)}_onClose(b,m){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(c('socket close with reason: "%s"',b),this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),h&&(this._beforeunloadEventListener&&
|
|
323
323
|
removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let t=a.indexOf(this._offlineEventListener);-1!==t&&(c("removing listener for the 'offline' event"),a.splice(t,1))}this.readyState="closed";this.id=null;this.emitReserved("close",b,m);this.writeBuffer=[];this._prevBufferLen=0}}}p.SocketWithoutUpgrade=d;d.protocol=n.protocol;class u extends d{constructor(){super(...arguments);this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade){c("starting upgrade probes");
|
|
324
|
-
for(let b=0;b<this._upgrades.length;b++)this._probe(this._upgrades[b])}}_probe(b){function m(){H||(H=!0,M(),A.close(),A=null)}function t(){P("transport closed")}function D(){P("socket closed")}function C(
|
|
325
|
-
"probe"===
|
|
326
|
-
|
|
324
|
+
for(let b=0;b<this._upgrades.length;b++)this._probe(this._upgrades[b])}}_probe(b){function m(){H||(H=!0,M(),A.close(),A=null)}function t(){P("transport closed")}function D(){P("socket closed")}function C(W){A&&W.name!==A.name&&(c('"%s" works - aborting "%s"',W.name,A.name),m())}c('probing transport "%s"',b);var A=this.createTransport(b),H=!1;d.priorWebsocketSuccess=!1;var K=()=>{H||(c('probe transport "%s" opened',b),A.send([{type:"ping",data:"probe"}]),A.once("packet",W=>{if(!H)if("pong"===W.type&&
|
|
325
|
+
"probe"===W.data){if(c('probe transport "%s" pong',b),this.upgrading=!0,this.emitReserved("upgrading",A),A)d.priorWebsocketSuccess="websocket"===A.name,c('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{H||"closed"!==this.readyState&&(c("changing transport and sending upgrade packet"),M(),this.setTransport(A),A.send([{type:"upgrade"}]),this.emitReserved("upgrade",A),A=null,this.upgrading=!1,this.flush())})}else c('probe transport "%s" failed',b),W=Error("probe error"),
|
|
326
|
+
W.transport=A.name,this.emitReserved("upgradeError",W)}))},P=W=>{var z=Error("probe error: "+W);z.transport=A.name;m();c('probe transport "%s" failed because of error: %s',b,W);this.emitReserved("upgradeError",z)},M=()=>{A.removeListener("open",K);A.removeListener("error",P);A.removeListener("close",t);this.off("close",D);this.off("upgrading",C)};A.once("open",K);A.once("error",P);A.once("close",t);this.once("close",D);this.once("upgrading",C);-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==
|
|
327
327
|
b?this.setTimeoutFn(()=>{H||A.open()},200):A.open()}onHandshake(b){this._upgrades=this._filterUpgrades(b.upgrades);super.onHandshake(b)}_filterUpgrades(b){var m=[];for(let t=0;t<b.length;t++)~this.transports.indexOf(b[t])&&m.push(b[t]);return m}}p.SocketWithUpgrade=u;p.Socket=(()=>class extends u{constructor(b,m={}){m="object"==typeof b?b:m;(!m.transports||m.transports&&"string"==typeof m.transports[0])&&(m.transports=(m.transports||["polling","websocket","webtransport"]).map(t=>w.transports[t]).filter(t=>
|
|
328
|
-
!!t));super(b,m)}})()},[4689](J,p,v){J=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(p,"__esModule",{value:!0});p.Transport=p.TransportError=void 0;var w=v(6376),x=v(4454),E=v(5374),k=v(8661),r=(0,J(v(7833)).default)("engine.io-client:transport");class n extends Error{constructor(c,
|
|
329
|
-
c);this.opts=c;this.query=c.query;this.socket=c.socket;this.supportsBinary=!c.forceBase64}onError(c,
|
|
330
|
-
(0,w.decodePacket)(c,this.socket.binaryType);this.onPacket(c)}onPacket(c){super.emitReserved("packet",c)}onClose(c){this.readyState="closed";super.emitReserved("close",c)}pause(c){}createUri(c,
|
|
328
|
+
!!t));super(b,m)}})()},[4689](J,p,v){J=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(p,"__esModule",{value:!0});p.Transport=p.TransportError=void 0;var w=v(6376),x=v(4454),E=v(5374),k=v(8661),r=(0,J(v(7833)).default)("engine.io-client:transport");class n extends Error{constructor(c,h,a){super(c);this.description=h;this.context=a;this.type="TransportError"}}p.TransportError=n;class l extends x.Emitter{constructor(c){super();this.writable=!1;(0,E.installTimerFunctions)(this,
|
|
329
|
+
c);this.opts=c;this.query=c.query;this.socket=c.socket;this.supportsBinary=!c.forceBase64}onError(c,h,a){return super.emitReserved("error",new n(c,h,a)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(c){"open"===this.readyState?this.write(c):r("transport is not open, discarding packets")}onOpen(){this.readyState="open";this.writable=!0;super.emitReserved("open")}onData(c){c=
|
|
330
|
+
(0,w.decodePacket)(c,this.socket.binaryType);this.onPacket(c)}onPacket(c){super.emitReserved("packet",c)}onClose(c){this.readyState="closed";super.emitReserved("close",c)}pause(c){}createUri(c,h={}){return c+"://"+this._hostname()+this._port()+this.opts.path+this._query(h)}_hostname(){var c=this.opts.hostname;return-1===c.indexOf(":")?c:"["+c+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(c){c=
|
|
331
331
|
(0,k.encode)(c);return c.length?"?"+c:""}}p.Transport=l},[9419](J,p,v){Object.defineProperty(p,"__esModule",{value:!0});p.transports=void 0;J=v(2071);var w=v(8716);v=v(4480);p.transports={websocket:w.WS,webtransport:v.WT,polling:J.XHR}},[8209](J,p,v){Object.defineProperty(p,"__esModule",{value:!0});p.Fetch=void 0;J=v(528);class w extends J.Polling{doPoll(){this._fetch().then(x=>{if(!x.ok)return this.onError("fetch read error",x.status,x);x.text().then(E=>this.onData(E))}).catch(x=>{this.onError("fetch read error",
|
|
332
332
|
x)})}doWrite(x,E){this._fetch(x).then(k=>{if(!k.ok)return this.onError("fetch write error",k.status,k);E()}).catch(k=>{this.onError("fetch write error",k)})}_fetch(x){var E,k=void 0!==x,r=new Headers(this.opts.extraHeaders);return k&&r.set("content-type","text/plain;charset=UTF-8"),null===(E=this.socket._cookieJar)||void 0===E||E.appendCookies(r),fetch(this.uri(),{method:k?"POST":"GET",body:k?x:null,headers:r,credentials:this.opts.withCredentials?"include":"omit"}).then(n=>{var l;return null===(l=
|
|
333
333
|
this.socket._cookieJar)||void 0===l||l.parseCookies(n.headers.getSetCookie()),n})}}p.Fetch=w},[2071](J,p,v){function w(){}function x(){for(let b in d.requests)d.requests.hasOwnProperty(b)&&d.requests[b].abort()}function E(b){b=b.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!b||c.hasCORS))return new XMLHttpRequest}catch(m){}if(!b)try{return new (l.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(m){}}J=this&&this.__importDefault||function(b){return b&&b.__esModule?
|
|
334
|
-
b:{default:b}};Object.defineProperty(p,"__esModule",{value:!0});p.XHR=p.Request=p.BaseXHR=void 0;var k=v(528),r=v(4454),n=v(5374),l=v(4624),c=v(4110),
|
|
335
|
-
m);b.on("error",(t,D)=>{this.onError("xhr post error",t,D)})}doPoll(){
|
|
336
|
-
"passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");m.xdomain=!!this._opts.xd;var t=this._xhr=this.createRequest(m);try{
|
|
334
|
+
b:{default:b}};Object.defineProperty(p,"__esModule",{value:!0});p.XHR=p.Request=p.BaseXHR=void 0;var k=v(528),r=v(4454),n=v(5374),l=v(4624),c=v(4110),h=(0,J(v(7833)).default)("engine.io-client:polling");class a extends k.Polling{constructor(b){if(super(b),"undefined"!=typeof location){let m="https:"===location.protocol,t=location.port;t||(t=m?"443":"80");this.xd="undefined"!=typeof location&&b.hostname!==location.hostname||t!==b.port}}doWrite(b,m){b=this.request({method:"POST",data:b});b.on("success",
|
|
335
|
+
m);b.on("error",(t,D)=>{this.onError("xhr post error",t,D)})}doPoll(){h("xhr poll");var b=this.request();b.on("data",this.onData.bind(this));b.on("error",(m,t)=>{this.onError("xhr poll error",m,t)});this.pollXhr=b}}p.BaseXHR=a;class d extends r.Emitter{constructor(b,m,t){super();this.createRequest=b;(0,n.installTimerFunctions)(this,t);this._opts=t;this._method=t.method||"GET";this._uri=m;this._data=void 0!==t.data?t.data:null;this._create()}_create(){var b,m=(0,n.pick)(this._opts,"agent","pfx","key",
|
|
336
|
+
"passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");m.xdomain=!!this._opts.xd;var t=this._xhr=this.createRequest(m);try{h("xhr open %s: %s",this._method,this._uri);t.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let D in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(D)&&t.setRequestHeader(D,this._opts.extraHeaders[D])}}catch(D){}if("POST"===this._method)try{t.setRequestHeader("Content-type",
|
|
337
337
|
"text/plain;charset=UTF-8")}catch(D){}try{t.setRequestHeader("Accept","*/*")}catch(D){}null===(b=this._opts.cookieJar)||void 0===b||b.addCookies(t);"withCredentials"in t&&(t.withCredentials=this._opts.withCredentials);this._opts.requestTimeout&&(t.timeout=this._opts.requestTimeout);t.onreadystatechange=()=>{var D;3!==t.readyState||null!==(D=this._opts.cookieJar)&&void 0!==D&&D.parseCookies(t.getResponseHeader("set-cookie"));4===t.readyState&&(200===t.status||1223===t.status?this._onLoad():this.setTimeoutFn(()=>
|
|
338
|
-
{this._onError("number"==typeof t.status?t.status:0)},0))};
|
|
338
|
+
{this._onError("number"==typeof t.status?t.status:0)},0))};h("xhr data %s",this._data);t.send(this._data)}catch(D){return void this.setTimeoutFn(()=>{this._onError(D)},0)}"undefined"!=typeof document&&(this._index=d.requestsCount++,d.requests[this._index]=this)}_onError(b){this.emitReserved("error",b,this._xhr);this._cleanup(!0)}_cleanup(b){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=w,b)try{this._xhr.abort()}catch(m){}"undefined"!=typeof document&&delete d.requests[this._index];
|
|
339
339
|
this._xhr=null}}_onLoad(){var b=this._xhr.responseText;null!==b&&(this.emitReserved("data",b),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(p.Request=d,d.requestsCount=0,d.requests={},"undefined"!=typeof document)"function"==typeof attachEvent?attachEvent("onunload",x):"function"==typeof addEventListener&&addEventListener("onpagehide"in l.globalThisShim?"pagehide":"unload",x,!1);var u=function(){var b=E({xdomain:!1});return b&&null!==b.responseType}();p.XHR=class extends a{constructor(b){super(b);
|
|
340
340
|
b=b&&b.forceBase64;this.supportsBinary=u&&!b}request(b={}){return Object.assign(b,{xd:this.xd},this.opts),new d(E,this.uri(),b)}}},[528](J,p,v){J=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(p,"__esModule",{value:!0});p.Polling=void 0;var w=v(4689),x=v(5374),E=v(6376),k=(0,J(v(7833)).default)("engine.io-client:polling");class r extends w.Transport{constructor(){super(...arguments);this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(n){this.readyState=
|
|
341
341
|
"pausing";var l=()=>{k("paused");this.readyState="paused";n()};if(this._polling||!this.writable){let c=0;this._polling&&(k("we are currently polling - waiting to pause"),c++,this.once("pollComplete",function(){k("pre-pause polling complete");--c||l()}));this.writable||(k("we are currently writing - waiting to pause"),c++,this.once("drain",function(){k("pre-pause writing complete");--c||l()}))}else l()}_poll(){k("polling");this._polling=!0;this.doPoll();this.emitReserved("poll")}onData(n){k("polling got data %s",
|
|
342
342
|
n);(0,E.decodePayload)(n,this.socket.binaryType).forEach(l=>{if("opening"===this.readyState&&"open"===l.type&&this.onOpen(),"close"===l.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(l)});"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState?this._poll():k('ignoring poll - transport state "%s"',this.readyState))}doClose(){var n=()=>{k("writing close packet");this.write([{type:"close"}])};"open"===this.readyState?
|
|
343
|
-
(k("transport open - closing"),n()):(k("transport not open - deferring close"),this.once("open",n))}write(n){this.writable=!1;(0,E.encodePayload)(n,l=>{this.doWrite(l,()=>{this.writable=!0;this.emitReserved("drain")})})}uri(){var n=this.opts.secure?"https":"http",l=this.query||{};return!1!==this.opts.timestampRequests&&(l[this.opts.timestampParam]=(0,x.randomString)()),this.supportsBinary||l.sid||(l.b64=1),this.createUri(n,l)}}p.Polling=r},[8716](J,p,v){J=this&&this.__importDefault||function(
|
|
344
|
-
|
|
345
|
-
"ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(d.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(
|
|
346
|
-
context:
|
|
347
|
-
"wss":"ws",a=this.query||{};return this.opts.timestampRequests&&(a[this.opts.timestampParam]=(0,x.randomString)()),this.supportsBinary||(a.b64=1),this.createUri(
|
|
343
|
+
(k("transport open - closing"),n()):(k("transport not open - deferring close"),this.once("open",n))}write(n){this.writable=!1;(0,E.encodePayload)(n,l=>{this.doWrite(l,()=>{this.writable=!0;this.emitReserved("drain")})})}uri(){var n=this.opts.secure?"https":"http",l=this.query||{};return!1!==this.opts.timestampRequests&&(l[this.opts.timestampParam]=(0,x.randomString)()),this.supportsBinary||l.sid||(l.b64=1),this.createUri(n,l)}}p.Polling=r},[8716](J,p,v){J=this&&this.__importDefault||function(h){return h&&
|
|
344
|
+
h.__esModule?h:{default:h}};Object.defineProperty(p,"__esModule",{value:!0});p.WS=p.BaseWS=void 0;var w=v(4689),x=v(5374),E=v(6376),k=v(4624),r=(0,J(v(7833)).default)("engine.io-client:websocket"),n="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class l extends w.Transport{get name(){return"websocket"}doOpen(){var h=this.uri(),a=this.opts.protocols,d=n?{}:(0,x.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert",
|
|
345
|
+
"ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(d.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(h,a,d)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType;this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref();this.onOpen()};this.ws.onclose=h=>this.onClose({description:"websocket connection closed",
|
|
346
|
+
context:h});this.ws.onmessage=h=>this.onData(h.data);this.ws.onerror=h=>this.onError("websocket error",h)}write(h){this.writable=!1;for(let a=0;a<h.length;a++){let d=h[a],u=a===h.length-1;(0,E.encodePacket)(d,this.supportsBinary,b=>{try{this.doWrite(d,b)}catch(m){r("websocket closed before onclose event")}u&&(0,k.nextTick)(()=>{this.writable=!0;this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){var h=this.opts.secure?
|
|
347
|
+
"wss":"ws",a=this.query||{};return this.opts.timestampRequests&&(a[this.opts.timestampParam]=(0,x.randomString)()),this.supportsBinary||(a.b64=1),this.createUri(h,a)}}p.BaseWS=l;var c=k.globalThisShim.WebSocket||k.globalThisShim.MozWebSocket;p.WS=class extends l{createSocket(h,a,d){return n?new c(h,a,d):a?new c(h,a):new c(h)}doWrite(h,a){this.ws.send(a)}}},[4480](J,p,v){J=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(p,"__esModule",{value:!0});
|
|
348
348
|
p.WT=void 0;var w=v(4689),x=v(4624),E=v(6376),k=(0,J(v(7833)).default)("engine.io-client:webtransport");class r extends w.Transport{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(n){return this.emitReserved("error",n)}this._transport.closed.then(()=>{k("transport closed gracefully");this.onClose()}).catch(n=>{k("transport closed due to %s",n);this.onError("webtransport error",n)});this._transport.ready.then(()=>
|
|
349
|
-
{this._transport.createBidirectionalStream().then(n=>{var l=(0,E.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),c=n.readable.pipeThrough(l).getReader();l=(0,E.createPacketEncoderStream)();l.readable.pipeTo(n.writable);this._writer=l.writable.getWriter();var
|
|
349
|
+
{this._transport.createBidirectionalStream().then(n=>{var l=(0,E.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),c=n.readable.pipeThrough(l).getReader();l=(0,E.createPacketEncoderStream)();l.readable.pipeTo(n.writable);this._writer=l.writable.getWriter();var h=()=>{c.read().then(({done:a,value:d})=>{a?k("session is closed"):(k("received chunk: %o",d),this.onPacket(d),h())}).catch(a=>{k("an error occurred while reading: %s",a)})};h();n={type:"open"};this.query.sid&&(n.data=
|
|
350
350
|
`{"sid":"${this.query.sid}"}`);this._writer.write(n).then(()=>this.onOpen())})})}write(n){this.writable=!1;for(let l=0;l<n.length;l++){let c=l===n.length-1;this._writer.write(n[l]).then(()=>{c&&(0,x.nextTick)(()=>{this.writable=!0;this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;null===(n=this._transport)||void 0===n||n.close()}}p.WT=r},[5374](J,p,v){Object.defineProperty(p,"__esModule",{value:!0});p.pick=function(k,...r){return r.reduce((n,l)=>(k.hasOwnProperty(l)&&(n[l]=k[l]),n),
|
|
351
351
|
{})};p.installTimerFunctions=function(k,r){r.useNativeTimers?(k.setTimeoutFn=x.bind(w.globalThisShim),k.clearTimeoutFn=E.bind(w.globalThisShim)):(k.setTimeoutFn=w.globalThisShim.setTimeout.bind(w.globalThisShim),k.clearTimeoutFn=w.globalThisShim.clearTimeout.bind(w.globalThisShim))};p.byteLength=function(k){if("string"==typeof k){let r,n=0;for(let l=0,c=k.length;l<c;l++)r=k.charCodeAt(l),r<128?n+=1:r<2048?n+=2:r<55296||r>=57344?n+=3:(l++,n+=4);k=n}else k=Math.ceil(1.33*(k.byteLength||k.size));return k};
|
|
352
352
|
p.randomString=function(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)};var w=v(4624),x=w.globalThisShim.setTimeout,E=w.globalThisShim.clearTimeout},[2046](J,p){Object.defineProperty(p,"__esModule",{value:!0});p.ERROR_PACKET=p.PACKET_TYPES_REVERSE=p.PACKET_TYPES=void 0;var v=Object.create(null);p.PACKET_TYPES=v;v.open="0";v.close="1";v.ping="2";v.pong="3";v.message="4";v.upgrade="5";v.noop="6";var w=Object.create(null);p.PACKET_TYPES_REVERSE=w;Object.keys(v).forEach(x=>
|
|
353
353
|
{w[v[x]]=x});p.ERROR_PACKET={type:"error",data:"parser error"}},[2745](J,p){Object.defineProperty(p,"__esModule",{value:!0});p.decode=p.encode=void 0;var v="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(J=0;J<64;J++)v["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(J)]=J;p.encode=w=>{var x=new Uint8Array(w),E=x.length,k="";for(w=0;w<E;w+=3)k+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[x[w]>>2],k+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&
|
|
354
354
|
x[w])<<4|x[w+1]>>4],k+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&x[w+1])<<2|x[w+2]>>6],k+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&x[w+2]];return E%3==2?k=k.substring(0,k.length-1)+"=":E%3==1&&(k=k.substring(0,k.length-2)+"=="),k};p.decode=w=>{var x=.75*w.length;var E=w.length,k=0;"="===w[w.length-1]&&(x--,"="===w[w.length-2]&&x--);var r=new ArrayBuffer(x),n=new Uint8Array(r);for(x=0;x<E;x+=4){var l=v[w.charCodeAt(x)];var c=v[w.charCodeAt(x+
|
|
355
|
-
1)];var
|
|
356
|
-
r.length>1?{type:w.PACKET_TYPES_REVERSE[l],data:r.substring(1)}:{type:w.PACKET_TYPES_REVERSE[l]}:w.ERROR_PACKET;return n};var k=(r,n)=>"blob"===n?r instanceof Blob?r:new Blob([r]):r instanceof ArrayBuffer?r:r.buffer},[2686](J,p,v){function w(
|
|
357
|
-
Blob?
|
|
358
|
-
r(a))?d?u(a):l(new Blob([a]),u):u(x.PACKET_TYPES[
|
|
359
|
-
{value:!0});p.decodePayload=p.decodePacket=p.encodePayload=p.encodePacket=p.protocol=void 0;p.createPacketEncoderStream=function(){return new TransformStream({transform(c,
|
|
360
|
-
typeof c.data&&(u[0]|=128);
|
|
361
|
-
if(D>2097151){t.enqueue(r.ERROR_PACKET);break}u=D*4294967296+m.getUint32(4);d=3}else{if(w(a)<u)break;m=x(a,u);t.enqueue((0,k.decodePacket)(b?m:l.decode(m),
|
|
362
|
-
c.length,d=Array(a),u=0;c.forEach((b,m)=>{(0,E.encodePacket)(b,!1,t=>{d[m]=t;++u===a&&
|
|
355
|
+
1)];var h=v[w.charCodeAt(x+2)];var a=v[w.charCodeAt(x+3)];n[k++]=l<<2|c>>4;n[k++]=(15&c)<<4|h>>2;n[k++]=(3&h)<<6|63&a}return r}},[2662](J,p,v){Object.defineProperty(p,"__esModule",{value:!0});p.decodePacket=void 0;var w=v(2046),x=v(2745),E="function"==typeof ArrayBuffer;p.decodePacket=(r,n)=>{if("string"!=typeof r)return{type:"message",data:k(r,n)};var l=r.charAt(0);"b"===l?(r=r.substring(1),E?(r=(0,x.decode)(r),n=k(r,n)):n={base64:!0,data:r},n={type:"message",data:n}):n=w.PACKET_TYPES_REVERSE[l]?
|
|
356
|
+
r.length>1?{type:w.PACKET_TYPES_REVERSE[l],data:r.substring(1)}:{type:w.PACKET_TYPES_REVERSE[l]}:w.ERROR_PACKET;return n};var k=(r,n)=>"blob"===n?r instanceof Blob?r:new Blob([r]):r instanceof ArrayBuffer?r:r.buffer},[2686](J,p,v){function w(h){return h instanceof Uint8Array?h:h instanceof ArrayBuffer?new Uint8Array(h):new Uint8Array(h.buffer,h.byteOffset,h.byteLength)}Object.defineProperty(p,"__esModule",{value:!0});p.encodePacket=void 0;p.encodePacketToBinary=function(h,a){return E&&h.data instanceof
|
|
357
|
+
Blob?h.data.arrayBuffer().then(w).then(a):k&&(h.data instanceof ArrayBuffer||r(h.data))?a(w(h.data)):void n(h,!1,d=>{c||(c=new TextEncoder);a(c.encode(d))})};var x=v(2046),E="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),k="function"==typeof ArrayBuffer,r=h=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(h):h&&h.buffer instanceof ArrayBuffer,n=({type:h,data:a},d,u)=>E&&a instanceof Blob?d?u(a):l(a,u):k&&(a instanceof ArrayBuffer||
|
|
358
|
+
r(a))?d?u(a):l(new Blob([a]),u):u(x.PACKET_TYPES[h]+(a||""));p.encodePacket=n;var l=(h,a)=>{var d=new FileReader;return d.onload=function(){var u=d.result.split(",")[1];a("b"+(u||""))},d.readAsDataURL(h)},c},[6376](J,p,v){function w(c){return c.reduce((h,a)=>h+a.length,0)}function x(c,h){if(c[0].length===h)return c.shift();var a=new Uint8Array(h),d=0;for(let u=0;u<h;u++)a[u]=c[0][d++],d===c[0].length&&(c.shift(),d=0);return c.length&&d<c[0].length&&(c[0]=c[0].slice(d)),a}Object.defineProperty(p,"__esModule",
|
|
359
|
+
{value:!0});p.decodePayload=p.decodePacket=p.encodePayload=p.encodePacket=p.protocol=void 0;p.createPacketEncoderStream=function(){return new TransformStream({transform(c,h){(0,E.encodePacketToBinary)(c,a=>{var d=a.length;if(d<126){var u=new Uint8Array(1);(new DataView(u.buffer)).setUint8(0,d)}else if(d<65536){u=new Uint8Array(3);var b=new DataView(u.buffer);b.setUint8(0,126);b.setUint16(1,d)}else u=new Uint8Array(9),b=new DataView(u.buffer),b.setUint8(0,127),b.setBigUint64(1,BigInt(d));c.data&&"string"!=
|
|
360
|
+
typeof c.data&&(u[0]|=128);h.enqueue(u);h.enqueue(a)})}})};p.createPacketDecoderStream=function(c,h){l||(l=new TextDecoder);var a=[],d=0,u=-1,b=!1;return new TransformStream({transform(m,t){for(a.push(m);;){if(0===d){if(w(a)<1)break;m=x(a,1);b=!(128&~m[0]);u=127&m[0];d=u<126?3:126===u?1:2}else if(1===d){if(w(a)<2)break;m=x(a,2);u=(new DataView(m.buffer,m.byteOffset,m.length)).getUint16(0);d=3}else if(2===d){if(w(a)<8)break;m=x(a,8);m=new DataView(m.buffer,m.byteOffset,m.length);let D=m.getUint32(0);
|
|
361
|
+
if(D>2097151){t.enqueue(r.ERROR_PACKET);break}u=D*4294967296+m.getUint32(4);d=3}else{if(w(a)<u)break;m=x(a,u);t.enqueue((0,k.decodePacket)(b?m:l.decode(m),h));d=0}if(0===u||u>c){t.enqueue(r.ERROR_PACKET);break}}}})};var E=v(2686);Object.defineProperty(p,"encodePacket",{enumerable:!0,get:function(){return E.encodePacket}});var k=v(2662);Object.defineProperty(p,"decodePacket",{enumerable:!0,get:function(){return k.decodePacket}});var r=v(2046),n=String.fromCharCode(30),l;p.encodePayload=(c,h)=>{var a=
|
|
362
|
+
c.length,d=Array(a),u=0;c.forEach((b,m)=>{(0,E.encodePacket)(b,!1,t=>{d[m]=t;++u===a&&h(d.join(n))})})};p.decodePayload=(c,h)=>{c=c.split(n);var a=[];for(let d=0;d<c.length;d++){let u=(0,k.decodePacket)(c[d],h);if(a.push(u),"error"===u.type)break}return a};p.protocol=4},[7743](J,p){function v(w){w=w||{};this.ms=w.min||100;this.max=w.max||1E4;this.factor=w.factor||2;this.jitter=w.jitter>0&&w.jitter<=1?w.jitter:0;this.attempts=0}Object.defineProperty(p,"__esModule",{value:!0});p.Backoff=v;v.prototype.duration=
|
|
363
363
|
function(){var w=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var x=Math.random(),E=Math.floor(x*this.jitter*w);w=1&Math.floor(10*x)?w+E:w-E}return 0|Math.min(w,this.max)};v.prototype.reset=function(){this.attempts=0};v.prototype.setMin=function(w){this.ms=w};v.prototype.setMax=function(w){this.max=w};v.prototype.setJitter=function(w){this.jitter=w}},[8007](J,p,v){function w(a,d){"object"==typeof a&&(d=a,a=void 0);d=d||{};a=(0,E.url)(a,d.path||"/socket.io");var u=a.source,b=a.id,
|
|
364
364
|
m=a.path;m=l[b]&&m in l[b].nsps;var t;return d.forceNew||d["force new connection"]||!1===d.multiplex||m?(n("ignoring socket cache for %s",u),t=new k.Manager(u,d)):(l[b]||(n("new io instance for %s",u),l[b]=new k.Manager(u,d)),t=l[b]),a.query&&!d.query&&(d.query=a.queryKey),t.socket(a.path,d)}var x=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(p,"__esModule",{value:!0});p.WebTransport=p.WebSocket=p.NodeWebSocket=p.XHR=p.NodeXHR=p.Fetch=p.Socket=
|
|
365
|
-
p.Manager=p.protocol=void 0;p.io=w;p.connect=w;p.default=w;var E=v(6894),k=v(3776);Object.defineProperty(p,"Manager",{enumerable:!0,get:function(){return k.Manager}});var r=v(6214);Object.defineProperty(p,"Socket",{enumerable:!0,get:function(){return r.Socket}});var n=(0,x(v(7833)).default)("socket.io-client"),l={};Object.assign(w,{Manager:k.Manager,Socket:r.Socket,io:w,connect:w});var c=v(4627);Object.defineProperty(p,"protocol",{enumerable:!0,get:function(){return c.protocol}});var
|
|
366
|
-
"Fetch",{enumerable:!0,get:function(){return
|
|
365
|
+
p.Manager=p.protocol=void 0;p.io=w;p.connect=w;p.default=w;var E=v(6894),k=v(3776);Object.defineProperty(p,"Manager",{enumerable:!0,get:function(){return k.Manager}});var r=v(6214);Object.defineProperty(p,"Socket",{enumerable:!0,get:function(){return r.Socket}});var n=(0,x(v(7833)).default)("socket.io-client"),l={};Object.assign(w,{Manager:k.Manager,Socket:r.Socket,io:w,connect:w});var c=v(4627);Object.defineProperty(p,"protocol",{enumerable:!0,get:function(){return c.protocol}});var h=v(4956);Object.defineProperty(p,
|
|
366
|
+
"Fetch",{enumerable:!0,get:function(){return h.Fetch}});Object.defineProperty(p,"NodeXHR",{enumerable:!0,get:function(){return h.NodeXHR}});Object.defineProperty(p,"XHR",{enumerable:!0,get:function(){return h.XHR}});Object.defineProperty(p,"NodeWebSocket",{enumerable:!0,get:function(){return h.NodeWebSocket}});Object.defineProperty(p,"WebSocket",{enumerable:!0,get:function(){return h.WebSocket}});Object.defineProperty(p,"WebTransport",{enumerable:!0,get:function(){return h.WebTransport}});J.exports=
|
|
367
367
|
w},[3776](J,p,v){var w=this&&this.__createBinding||(Object.create?function(d,u,b,m){void 0===m&&(m=b);var t=Object.getOwnPropertyDescriptor(u,b);t&&("get"in t?u.__esModule:!t.writable&&!t.configurable)||(t={enumerable:!0,get:function(){return u[b]}});Object.defineProperty(d,m,t)}:function(d,u,b,m){void 0===m&&(m=b);d[m]=u[b]}),x=this&&this.__setModuleDefault||(Object.create?function(d,u){Object.defineProperty(d,"default",{enumerable:!0,value:u})}:function(d,u){d.default=u}),E=this&&this.__importStar||
|
|
368
|
-
function(d){if(d&&d.__esModule)return d;var u={};if(null!=d)for(var b in d)"default"!==b&&Object.prototype.hasOwnProperty.call(d,b)&&w(u,d,b);return x(u,d),u};J=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(p,"__esModule",{value:!0});p.Manager=void 0;var k=v(4956),r=v(6214),n=E(v(4627)),l=v(5942),c=v(7743);E=v(4454);var
|
|
368
|
+
function(d){if(d&&d.__esModule)return d;var u={};if(null!=d)for(var b in d)"default"!==b&&Object.prototype.hasOwnProperty.call(d,b)&&w(u,d,b);return x(u,d),u};J=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(p,"__esModule",{value:!0});p.Manager=void 0;var k=v(4956),r=v(6214),n=E(v(4627)),l=v(5942),c=v(7743);E=v(4454);var h=(0,J(v(7833)).default)("socket.io-client:manager");class a extends E.Emitter{constructor(d,u){var b;super();this.nsps={};this.subs=
|
|
369
369
|
[];d&&"object"==typeof d&&(u=d,d=void 0);(u=u||{}).path=u.path||"/socket.io";this.opts=u;(0,k.installTimerFunctions)(this,u);this.reconnection(!1!==u.reconnection);this.reconnectionAttempts(u.reconnectionAttempts||1/0);this.reconnectionDelay(u.reconnectionDelay||1E3);this.reconnectionDelayMax(u.reconnectionDelayMax||5E3);this.randomizationFactor(null!==(b=u.randomizationFactor)&&void 0!==b?b:.5);this.backoff=new c.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()});
|
|
370
370
|
this.timeout(null==u.timeout?2E4:u.timeout);this._readyState="closed";this.uri=d;d=u.parser||n;this.encoder=new d.Encoder;this.decoder=new d.Decoder;(this._autoConnect=!1!==u.autoConnect)&&this.open()}reconnection(d){return arguments.length?(this._reconnection=!!d,d||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(d){return void 0===d?this._reconnectionAttempts:(this._reconnectionAttempts=d,this)}reconnectionDelay(d){var u;return void 0===d?this._reconnectionDelay:(this._reconnectionDelay=
|
|
371
371
|
d,null===(u=this.backoff)||void 0===u||u.setMin(d),this)}randomizationFactor(d){var u;return void 0===d?this._randomizationFactor:(this._randomizationFactor=d,null===(u=this.backoff)||void 0===u||u.setJitter(d),this)}reconnectionDelayMax(d){var u;return void 0===d?this._reconnectionDelayMax:(this._reconnectionDelayMax=d,null===(u=this.backoff)||void 0===u||u.setMax(d),this)}timeout(d){return arguments.length?(this._timeout=d,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&
|
|
372
|
-
0===this.backoff.attempts&&this.reconnect()}open(d){if(
|
|
373
|
-
|
|
374
|
-
(0,l.on)(d,"error",this.onerror.bind(this)),(0,l.on)(d,"close",this.onclose.bind(this)),(0,l.on)(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(d){try{this.decoder.add(d)}catch(u){this.onclose("parse error",u)}}ondecoded(d){(0,k.nextTick)(()=>{this.emitReserved("packet",d)},this.setTimeoutFn)}onerror(d){
|
|
375
|
-
this.nsps[d]=b),b}_destroy(d){d=Object.keys(this.nsps);for(let u of d)if(this.nsps[u].active)return void
|
|
376
|
-
u){var b;
|
|
377
|
-
u);this._reconnecting=!0;let b=this.setTimeoutFn(()=>{d.skipReconnect||(
|
|
372
|
+
0===this.backoff.attempts&&this.reconnect()}open(d){if(h("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;h("opening %s",this.uri);var u=this.engine=new k.Socket(this.uri,this.opts),b=this;this._readyState="opening";this.skipReconnect=!1;var m=(0,l.on)(u,"open",function(){b.onopen();d&&d()}),t=C=>{h("error");this.cleanup();this._readyState="closed";this.emitReserved("error",C);d?d(C):this.maybeReconnectOnOpen()},D=(0,l.on)(u,"error",t);if(!1!==this._timeout){let C=this._timeout;
|
|
373
|
+
h("connect attempt will timeout after %d",C);let A=this.setTimeoutFn(()=>{h("connect attempt timed out after %d",C);m();t(Error("timeout"));u.close()},C);this.opts.autoUnref&&A.unref();this.subs.push(()=>{this.clearTimeoutFn(A)})}return this.subs.push(m),this.subs.push(D),this}connect(d){return this.open(d)}onopen(){h("open");this.cleanup();this._readyState="open";this.emitReserved("open");var d=this.engine;this.subs.push((0,l.on)(d,"ping",this.onping.bind(this)),(0,l.on)(d,"data",this.ondata.bind(this)),
|
|
374
|
+
(0,l.on)(d,"error",this.onerror.bind(this)),(0,l.on)(d,"close",this.onclose.bind(this)),(0,l.on)(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(d){try{this.decoder.add(d)}catch(u){this.onclose("parse error",u)}}ondecoded(d){(0,k.nextTick)(()=>{this.emitReserved("packet",d)},this.setTimeoutFn)}onerror(d){h("error",d);this.emitReserved("error",d)}socket(d,u){var b=this.nsps[d];return b?this._autoConnect&&!b.active&&b.connect():(b=new r.Socket(this,d,u),
|
|
375
|
+
this.nsps[d]=b),b}_destroy(d){d=Object.keys(this.nsps);for(let u of d)if(this.nsps[u].active)return void h("socket %s is still active, skipping close",u);this._close()}_packet(d){h("writing packet %j",d);var u=this.encoder.encode(d);for(let b=0;b<u.length;b++)this.engine.write(u[b],d.options)}cleanup(){h("cleanup");this.subs.forEach(d=>d());this.subs.length=0;this.decoder.destroy()}_close(){h("disconnect");this.skipReconnect=!0;this._reconnecting=!1;this.onclose("forced close")}disconnect(){return this._close()}onclose(d,
|
|
376
|
+
u){var b;h("closed due to %s",d);this.cleanup();null===(b=this.engine)||void 0===b||b.close();this.backoff.reset();this._readyState="closed";this.emitReserved("close",d,u);this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;var d=this;if(this.backoff.attempts>=this._reconnectionAttempts)h("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let u=this.backoff.duration();h("will wait %dms before reconnect attempt",
|
|
377
|
+
u);this._reconnecting=!0;let b=this.setTimeoutFn(()=>{d.skipReconnect||(h("attempting reconnect"),this.emitReserved("reconnect_attempt",d.backoff.attempts),d.skipReconnect||d.open(m=>{m?(h("reconnect attempt error"),d._reconnecting=!1,d.reconnect(),this.emitReserved("reconnect_error",m)):(h("reconnect success"),d.onreconnect())}))},u);this.opts.autoUnref&&b.unref();this.subs.push(()=>{this.clearTimeoutFn(b)})}}onreconnect(){var d=this.backoff.attempts;this._reconnecting=!1;this.backoff.reset();this.emitReserved("reconnect",
|
|
378
378
|
d)}}p.Manager=a},[5942](J,p){Object.defineProperty(p,"__esModule",{value:!0});p.on=function(v,w,x){return v.on(w,x),function(){v.off(w,x)}}},[6214](J,p,v){J=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(p,"__esModule",{value:!0});p.Socket=void 0;var w=v(4627),x=v(5942),E=v(4454),k=(0,J(v(7833)).default)("socket.io-client:socket"),r=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class n extends E.Emitter{constructor(l,
|
|
379
|
-
c,
|
|
380
|
-
"close",this.onclose.bind(this))]}}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...l){return l.unshift("message"),this.emit.apply(this,l),this}emit(l,...c){var
|
|
381
|
-
this;l={type:w.PacketType.EVENT,data:c,options:{}};if(l.options.compress=!1!==this.flags.compress,"function"==typeof c[c.length-1]){let u=this.ids++;k("emitting packet with ack id %d",u);c=c.pop();this._registerAckCallback(u,c);l.id=u}c=null===(a=null===(
|
|
382
|
-
|
|
383
|
-
Error("operation has timed out"))},a);
|
|
384
|
-
this._opts.retries&&(k("packet [%d] is discarded after %d tries",
|
|
379
|
+
c,h){super();this.recovered=this.connected=!1;this.receiveBuffer=[];this.sendBuffer=[];this._queue=[];this.ids=this._queueSeq=0;this.acks={};this.flags={};this.io=l;this.nsp=c;h&&h.auth&&(this.auth=h.auth);this._opts=Object.assign({},h);this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(!this.subs){var l=this.io;this.subs=[(0,x.on)(l,"open",this.onopen.bind(this)),(0,x.on)(l,"packet",this.onpacket.bind(this)),(0,x.on)(l,"error",this.onerror.bind(this)),(0,x.on)(l,
|
|
380
|
+
"close",this.onclose.bind(this))]}}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...l){return l.unshift("message"),this.emit.apply(this,l),this}emit(l,...c){var h,a,d;if(r.hasOwnProperty(l))throw Error('"'+l.toString()+'" is a reserved event name');if(c.unshift(l),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(c),
|
|
381
|
+
this;l={type:w.PacketType.EVENT,data:c,options:{}};if(l.options.compress=!1!==this.flags.compress,"function"==typeof c[c.length-1]){let u=this.ids++;k("emitting packet with ack id %d",u);c=c.pop();this._registerAckCallback(u,c);l.id=u}c=null===(a=null===(h=this.io.engine)||void 0===h?void 0:h.transport)||void 0===a?void 0:a.writable;h=this.connected&&!(null===(d=this.io.engine)||void 0===d?0:d._hasPingExpired());return this.flags.volatile&&!c?k("discard packet as the transport is not currently writable"):
|
|
382
|
+
h?(this.notifyOutgoingListeners(l),this.packet(l)):this.sendBuffer.push(l),this.flags={},this}_registerAckCallback(l,c){var h,a=null!==(h=this.flags.timeout)&&void 0!==h?h:this._opts.ackTimeout;if(void 0===a)return void(this.acks[l]=c);var d=this.io.setTimeoutFn(()=>{delete this.acks[l];for(let u=0;u<this.sendBuffer.length;u++)this.sendBuffer[u].id===l&&(k("removing packet with ack id %d from the buffer",l),this.sendBuffer.splice(u,1));k("event with ack id %d has timed out after %d ms",l,a);c.call(this,
|
|
383
|
+
Error("operation has timed out"))},a);h=(...u)=>{this.io.clearTimeoutFn(d);c.apply(this,u)};h.withError=!0;this.acks[l]=h}emitWithAck(l,...c){return new Promise((h,a)=>{var d=(u,b)=>u?a(u):h(b);d.withError=!0;c.push(d);this.emit(l,...c)})}_addToQueue(l){var c;"function"==typeof l[l.length-1]&&(c=l.pop());var h={id:this._queueSeq++,tryCount:0,pending:!1,args:l,flags:Object.assign({fromQueue:!0},this.flags)};l.push((a,...d)=>h!==this._queue[0]?k("packet [%d] already acknowledged",h.id):(null!==a?h.tryCount>
|
|
384
|
+
this._opts.retries&&(k("packet [%d] is discarded after %d tries",h.id,h.tryCount),this._queue.shift(),c&&c(a)):(k("packet [%d] was successfully sent",h.id),this._queue.shift(),c&&c(null,...d)),h.pending=!1,this._drainQueue()));this._queue.push(h);this._drainQueue()}_drainQueue(l=!1){if(k("draining queue"),this.connected&&0!==this._queue.length){var c=this._queue[0];!c.pending||l?(c.pending=!0,c.tryCount++,k("sending packet [%d] (try n\u00b0%d)",c.id,c.tryCount),this.flags=c.flags,this.emit.apply(this,
|
|
385
385
|
c.args)):k("packet [%d] has already been sent and is waiting for an ack",c.id)}}packet(l){l.nsp=this.nsp;this.io._packet(l)}onopen(){k("transport is open - connecting");"function"==typeof this.auth?this.auth(l=>{this._sendConnectPacket(l)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(l){this.packet({type:w.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},l):l})}onerror(l){this.connected||this.emitReserved("connect_error",l)}onclose(l,c){k("close (%s)",
|
|
386
386
|
l);this.connected=!1;delete this.id;this.emitReserved("disconnect",l,c);this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(l=>{if(!this.sendBuffer.some(c=>String(c.id)===l)){let c=this.acks[l];delete this.acks[l];c.withError&&c.call(this,Error("socket has been disconnected"))}})}onpacket(l){if(l.nsp===this.nsp)switch(l.type){case w.PacketType.CONNECT:l.data&&l.data.sid?this.onconnect(l.data.sid,l.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));
|
|
387
387
|
break;case w.PacketType.EVENT:case w.PacketType.BINARY_EVENT:this.onevent(l);break;case w.PacketType.ACK:case w.PacketType.BINARY_ACK:this.onack(l);break;case w.PacketType.DISCONNECT:this.ondisconnect();break;case w.PacketType.CONNECT_ERROR:this.destroy();let c=Error(l.data.message);c.data=l.data.data;this.emitReserved("connect_error",c)}}onevent(l){var c=l.data||[];k("emitting event %j",c);null!=l.id&&(k("attaching ack callback to event"),c.push(this.ack(l.id)));this.connected?this.emitEvent(c):
|
|
388
|
-
this.receiveBuffer.push(Object.freeze(c))}emitEvent(l){if(this._anyListeners&&this._anyListeners.length){let c=this._anyListeners.slice();for(let
|
|
388
|
+
this.receiveBuffer.push(Object.freeze(c))}emitEvent(l){if(this._anyListeners&&this._anyListeners.length){let c=this._anyListeners.slice();for(let h of c)h.apply(this,l)}super.emit.apply(this,l);this._pid&&l.length&&"string"==typeof l[l.length-1]&&(this._lastOffset=l[l.length-1])}ack(l){var c=this,h=!1;return function(...a){h||(h=!0,k("sending ack %j",a),c.packet({type:w.PacketType.ACK,id:l,data:a}))}}onack(l){var c=this.acks[l.id];"function"==typeof c?(delete this.acks[l.id],k("calling ack %s with %j",
|
|
389
389
|
l.id,l.data),c.withError&&l.data.unshift(null),c.apply(this,l.data)):k("bad ack %s",l.id)}onconnect(l,c){k("socket connected with id %s",l);this.id=l;this.recovered=c&&this._pid===c;this._pid=c;this.connected=!0;this.emitBuffered();this._drainQueue(!0);this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(l=>this.emitEvent(l));this.receiveBuffer=[];this.sendBuffer.forEach(l=>{this.notifyOutgoingListeners(l);this.packet(l)});this.sendBuffer=[]}ondisconnect(){k("server disconnect (%s)",
|
|
390
390
|
this.nsp);this.destroy();this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(l=>l()),this.subs=void 0);this.io._destroy(this)}disconnect(){return this.connected&&(k("performing disconnect (%s)",this.nsp),this.packet({type:w.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(l){return this.flags.compress=l,this}get volatile(){return this.flags.volatile=!0,this}timeout(l){return this.flags.timeout=
|
|
391
|
-
l,this}onAny(l){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(l),this}prependAny(l){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(l),this}offAny(l){if(!this._anyListeners)return this;if(l){let c=this._anyListeners;for(let
|
|
392
|
-
this._anyOutgoingListeners.push(l),this}prependAnyOutgoing(l){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(l),this}offAnyOutgoing(l){if(!this._anyOutgoingListeners)return this;if(l){let c=this._anyOutgoingListeners;for(let
|
|
393
|
-
this._anyOutgoingListeners.length){let c=this._anyOutgoingListeners.slice();for(let
|
|
391
|
+
l,this}onAny(l){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(l),this}prependAny(l){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(l),this}offAny(l){if(!this._anyListeners)return this;if(l){let c=this._anyListeners;for(let h=0;h<c.length;h++)if(l===c[h])return c.splice(h,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(l){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],
|
|
392
|
+
this._anyOutgoingListeners.push(l),this}prependAnyOutgoing(l){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(l),this}offAnyOutgoing(l){if(!this._anyOutgoingListeners)return this;if(l){let c=this._anyOutgoingListeners;for(let h=0;h<c.length;h++)if(l===c[h])return c.splice(h,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(l){if(this._anyOutgoingListeners&&
|
|
393
|
+
this._anyOutgoingListeners.length){let c=this._anyOutgoingListeners.slice();for(let h of c)h.apply(this,l.data)}}}p.Socket=n},[6894](J,p,v){J=this&&this.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(p,"__esModule",{value:!0});p.url=function(E,k="",r){var n=E;r=r||"undefined"!=typeof location&&location;null==E&&(E=r.protocol+"//"+r.host);"string"==typeof E&&("/"===E.charAt(0)&&(E="/"===E.charAt(1)?r.protocol+E:r.host+E),/^(https?|wss?):\/\//.test(E)||(x("protocol-less url %s",
|
|
394
394
|
E),E=void 0!==r?r.protocol+"//"+E:"https://"+E),x("parse %s",E),n=(0,w.parse)(E));n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443"));n.path=n.path||"/";E=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+E+":"+n.port+k,n.href=n.protocol+"://"+E+(r&&r.port===n.port?"":":"+n.port),n};var w=v(4956),x=(0,J(v(7833)).default)("socket.io-client:url")},[4926](J,p,v){function w(k,r){if(!k)return k;if((0,E.isBinary)(k)){var n={_placeholder:!0,
|
|
395
395
|
num:r.length};return r.push(k),n}if(Array.isArray(k)){n=Array(k.length);for(var l=0;l<k.length;l++)n[l]=w(k[l],r);return n}if("object"==typeof k&&!(k instanceof Date)){n={};for(l in k)Object.prototype.hasOwnProperty.call(k,l)&&(n[l]=w(k[l],r));return n}return k}function x(k,r){if(!k)return k;if(k&&!0===k._placeholder){if("number"==typeof k.num&&k.num>=0&&k.num<r.length)return r[k.num];throw Error("illegal attachments");}if(Array.isArray(k))for(var n=0;n<k.length;n++)k[n]=x(k[n],r);else if("object"==
|
|
396
396
|
typeof k)for(n in k)Object.prototype.hasOwnProperty.call(k,n)&&(k[n]=x(k[n],r));return k}Object.defineProperty(p,"__esModule",{value:!0});p.deconstructPacket=function(k){var r=[];return k.data=w(k.data,r),k.attachments=r.length,{packet:k,buffers:r}};p.reconstructPacket=function(k,r){return k.data=x(k.data,r),delete k.attachments,k};var E=v(9133)},[4627](J,p,v){function w(a){return"[object Object]"===Object.prototype.toString.call(a)}Object.defineProperty(p,"__esModule",{value:!0});p.Decoder=p.Encoder=
|
|
397
|
-
p.PacketType=p.protocol=void 0;p.isPacketValid=function(a){var d;return"string"==typeof a.nsp&&(void 0===(d=a.id)||
|
|
397
|
+
p.PacketType=p.protocol=void 0;p.isPacketValid=function(a){var d;return"string"==typeof a.nsp&&(void 0===(d=a.id)||h(d))&&function(u,b){switch(u){case n.CONNECT:return void 0===b||w(b);case n.DISCONNECT:return void 0===b;case n.EVENT:return Array.isArray(b)&&("number"==typeof b[0]||"string"==typeof b[0]&&-1===r.indexOf(b[0]));case n.ACK:return Array.isArray(b);case n.CONNECT_ERROR:return"string"==typeof b||w(b);default:return!1}}(a.type,a.data)};J=v(4454);var x=v(4926),E=v(9133),k=(0,v(7833).default)("socket.io-parser"),
|
|
398
398
|
r="connect connect_error disconnect disconnecting newListener removeListener".split(" "),n;p.protocol=5;(function(a){a[a.CONNECT=0]="CONNECT";a[a.DISCONNECT=1]="DISCONNECT";a[a.EVENT=2]="EVENT";a[a.ACK=3]="ACK";a[a.CONNECT_ERROR=4]="CONNECT_ERROR";a[a.BINARY_EVENT=5]="BINARY_EVENT";a[a.BINARY_ACK=6]="BINARY_ACK"})(n||(p.PacketType=n={}));p.Encoder=(()=>class{constructor(a){this.replacer=a}encode(a){return k("encoding packet %j",a),a.type!==n.EVENT&&a.type!==n.ACK||!(0,E.hasBinary)(a)?[this.encodeAsString(a)]:
|
|
399
399
|
this.encodeAsBinary({type:a.type===n.EVENT?n.BINARY_EVENT:n.BINARY_ACK,nsp:a.nsp,data:a.data,id:a.id})}encodeAsString(a){var d=""+a.type;return a.type!==n.BINARY_EVENT&&a.type!==n.BINARY_ACK||(d+=a.attachments+"-"),a.nsp&&"/"!==a.nsp&&(d+=a.nsp+","),null!=a.id&&(d+=a.id),null!=a.data&&(d+=JSON.stringify(a.data,this.replacer)),k("encoded %j as %s",a,d),d}encodeAsBinary(a){var d=(0,x.deconstructPacket)(a);a=this.encodeAsString(d.packet);d=d.buffers;return d.unshift(a),d}})();class l extends J.Emitter{constructor(a){super();
|
|
400
400
|
this.opts=Object.assign({reviver:void 0,maxAttachments:10},"function"==typeof a?{reviver:a}:a)}add(a){if("string"==typeof a){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");a=this.decodeString(a);let d=a.type===n.BINARY_EVENT;d||a.type===n.BINARY_ACK?(a.type=d?n.EVENT:n.ACK,this.reconstructor=new c(a),0===a.attachments&&super.emitReserved("decoded",a)):super.emitReserved("decoded",a)}else{if(!(0,E.isBinary)(a)&&!a.base64)throw Error("Unknown type: "+a);if(!this.reconstructor)throw Error("got binary data when not reconstructing a packet");
|
|
401
|
-
(a=this.reconstructor.takeBinaryData(a))&&(this.reconstructor=null,super.emitReserved("decoded",a))}}decodeString(a){var d=0,u={type:Number(a.charAt(0))};if(void 0===n[u.type])throw Error("unknown packet type "+u.type);if(u.type===n.BINARY_EVENT||u.type===n.BINARY_ACK){for(var b=d+1;"-"!==a.charAt(++d)&&d!=a.length;);b=a.substring(b,d);if(b!=Number(b)||"-"!==a.charAt(d))throw Error("Illegal attachments");b=Number(b);if(!
|
|
401
|
+
(a=this.reconstructor.takeBinaryData(a))&&(this.reconstructor=null,super.emitReserved("decoded",a))}}decodeString(a){var d=0,u={type:Number(a.charAt(0))};if(void 0===n[u.type])throw Error("unknown packet type "+u.type);if(u.type===n.BINARY_EVENT||u.type===n.BINARY_ACK){for(var b=d+1;"-"!==a.charAt(++d)&&d!=a.length;);b=a.substring(b,d);if(b!=Number(b)||"-"!==a.charAt(d))throw Error("Illegal attachments");b=Number(b);if(!h(b)||b<0)throw Error("Illegal attachments");if(b>this.opts.maxAttachments)throw Error("too many attachments");
|
|
402
402
|
u.attachments=b}if("/"===a.charAt(d+1)){for(b=d+1;++d&&","!==a.charAt(d)&&d!==a.length;);u.nsp=a.substring(b,d)}else u.nsp="/";b=a.charAt(d+1);if(""!==b&&Number(b)==b){for(b=d+1;++d;){let m=a.charAt(d);if(null==m||Number(m)!=m){--d;break}if(d===a.length)break}u.id=Number(a.substring(b,d+1))}if(a.charAt(++d)){d=this.tryParse(a.substr(d));if(!l.isPayloadValid(u.type,d))throw Error("invalid payload");u.data=d}return k("decoded %s as %j",a,u),u}tryParse(a){try{return JSON.parse(a,this.opts.reviver)}catch(d){return!1}}static isPayloadValid(a,
|
|
403
403
|
d){switch(a){case n.CONNECT:return w(d);case n.DISCONNECT:return void 0===d;case n.CONNECT_ERROR:return"string"==typeof d||w(d);case n.EVENT:case n.BINARY_EVENT:return Array.isArray(d)&&("number"==typeof d[0]||"string"==typeof d[0]&&-1===r.indexOf(d[0]));case n.ACK:case n.BINARY_ACK:return Array.isArray(d)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}p.Decoder=l;class c{constructor(a){this.packet=a;this.buffers=[];this.reconPack=a}takeBinaryData(a){return(this.buffers.push(a),
|
|
404
|
-
this.buffers.length===this.reconPack.attachments)?(a=(0,x.reconstructPacket)(this.reconPack,this.buffers),this.finishedReconstruction(),a):null}finishedReconstruction(){this.reconPack=null;this.buffers=[]}}var
|
|
405
|
-
k instanceof File}Object.defineProperty(p,"__esModule",{value:!0});p.isBinary=v;p.hasBinary=function l(r,n){if(!r||"object"!=typeof r)return!1;if(Array.isArray(r)){for(let c=0,
|
|
404
|
+
this.buffers.length===this.reconPack.attachments)?(a=(0,x.reconstructPacket)(this.reconPack,this.buffers),this.finishedReconstruction(),a):null}finishedReconstruction(){this.reconPack=null;this.buffers=[]}}var h=Number.isInteger||function(a){return"number"==typeof a&&isFinite(a)&&Math.floor(a)===a}},[9133](J,p){function v(k){var r;if(r=w)(r=k instanceof ArrayBuffer)||(r="function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(k):k.buffer instanceof ArrayBuffer);return r||x&&k instanceof Blob||E&&
|
|
405
|
+
k instanceof File}Object.defineProperty(p,"__esModule",{value:!0});p.isBinary=v;p.hasBinary=function l(r,n){if(!r||"object"!=typeof r)return!1;if(Array.isArray(r)){for(let c=0,h=r.length;c<h;c++)if(l(r[c]))return!0;return!1}if(v(r))return!0;if(r.toJSON&&"function"==typeof r.toJSON&&1===arguments.length)return l(r.toJSON(),!0);for(let c in r)if(Object.prototype.hasOwnProperty.call(r,c)&&l(r[c]))return!0;return!1};var w="function"==typeof ArrayBuffer;J=Object.prototype.toString;var x="function"==typeof Blob||
|
|
406
406
|
"undefined"!=typeof Blob&&"[object BlobConstructor]"===J.call(Blob),E="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===J.call(File)},[4454](J,p,v){function w(x){if(x){for(var E in w.prototype)x[E]=w.prototype[E];return x}}v.r(p);v.d(p,{Emitter:()=>w});w.prototype.on=w.prototype.addEventListener=function(x,E){return this._callbacks=this._callbacks||{},(this._callbacks["$"+x]=this._callbacks["$"+x]||[]).push(E),this};w.prototype.once=function(x,E){function k(){this.off(x,
|
|
407
407
|
k);E.apply(this,arguments)}return k.fn=E,this.on(x,k),this};w.prototype.off=w.prototype.removeListener=w.prototype.removeAllListeners=w.prototype.removeEventListener=function(x,E){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var k,r=this._callbacks["$"+x];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+x],this;for(var n=0;n<r.length;n++)if((k=r[n])===E||k.fn===E){r.splice(n,1);break}return 0===r.length&&delete this._callbacks["$"+
|
|
408
408
|
x],this};w.prototype.emit=function(x){this._callbacks=this._callbacks||{};for(var E=Array(arguments.length-1),k=this._callbacks["$"+x],r=1;r<arguments.length;r++)E[r-1]=arguments[r];if(k){r=0;for(var n=(k=k.slice(0)).length;r<n;++r)k[r].apply(this,E)}return this};w.prototype.emitReserved=w.prototype.emit;w.prototype.listeners=function(x){return this._callbacks=this._callbacks||{},this._callbacks["$"+x]||[]};w.prototype.hasListeners=function(x){return!!this.listeners(x).length}}},ba={};N.d=(J,p)=>
|
|
@@ -413,9 +413,9 @@ L.HotFile=L.APItoLoad=L.EventExecutionType=L.HotAPI=L.IHotComponent=L.HotCompone
|
|
|
413
413
|
var v=N(5269);Object.defineProperty(L,"HotSite",{enumerable:!0,get:function(){return v.HotSite}});Object.defineProperty(L,"HotSiteRoute",{enumerable:!0,get:function(){return v.HotSiteRoute}});Object.defineProperty(L,"HotSiteMapPath",{enumerable:!0,get:function(){return v.HotSiteMapPath}});var w=N(1814);Object.defineProperty(L,"Hot",{enumerable:!0,get:function(){return w.Hot}});Object.defineProperty(L,"DeveloperMode",{enumerable:!0,get:function(){return w.DeveloperMode}});var x=N(5472);Object.defineProperty(L,
|
|
414
414
|
"HotAsset",{enumerable:!0,get:function(){return x.HotAsset}});var E=N(6370);Object.defineProperty(L,"HotModule",{enumerable:!0,get:function(){return E.HotModule}});var k=N(3299);Object.defineProperty(L,"HotComponent",{enumerable:!0,get:function(){return k.HotComponent}});Object.defineProperty(L,"HotComponentOutput",{enumerable:!0,get:function(){return k.HotComponentOutput}});Object.defineProperty(L,"IHotComponent",{enumerable:!0,get:function(){return k.IHotComponent}});var r=N(8296);Object.defineProperty(L,
|
|
415
415
|
"HotFile",{enumerable:!0,get:function(){return r.HotFile}});var n=N(3622);Object.defineProperty(L,"HotLog",{enumerable:!0,get:function(){return n.HotLog}});Object.defineProperty(L,"HotLogLevel",{enumerable:!0,get:function(){return n.HotLogLevel}});var l=N(5989);Object.defineProperty(L,"HotPage",{enumerable:!0,get:function(){return l.HotPage}});var c=N(6801);Object.defineProperty(L,"ValidationError",{enumerable:!0,get:function(){return c.ValidationError}});Object.defineProperty(L,"FalsyOptions",{enumerable:!0,
|
|
416
|
-
get:function(){return c.FalsyOptions}});Object.defineProperty(L,"ValidationOptions",{enumerable:!0,get:function(){return c.ValidationOptions}});var
|
|
416
|
+
get:function(){return c.FalsyOptions}});Object.defineProperty(L,"ValidationOptions",{enumerable:!0,get:function(){return c.ValidationOptions}});var h=N(6044);Object.defineProperty(L,"HotAPI",{enumerable:!0,get:function(){return h.HotAPI}});Object.defineProperty(L,"EventExecutionType",{enumerable:!0,get:function(){return h.EventExecutionType}});Object.defineProperty(L,"APItoLoad",{enumerable:!0,get:function(){return h.APItoLoad}});var a=N(7605);Object.defineProperty(L,"HotRoute",{enumerable:!0,get:function(){return a.HotRoute}});
|
|
417
417
|
var d=N(9844);Object.defineProperty(L,"HotRouteMethod",{enumerable:!0,get:function(){return d.HotRouteMethod}});Object.defineProperty(L,"HotEventMethod",{enumerable:!0,get:function(){return d.HotEventMethod}});Object.defineProperty(L,"ServerRequest",{enumerable:!0,get:function(){return d.ServerRequest}});Object.defineProperty(L,"PassType",{enumerable:!0,get:function(){return d.PassType}});Object.defineProperty(L,"HotRouteMethodParameter",{enumerable:!0,get:function(){return d.HotRouteMethodParameter}});
|
|
418
418
|
Object.defineProperty(L,"HotValidation",{enumerable:!0,get:function(){return d.HotValidation}});var u=N(3205);Object.defineProperty(L,"HotServer",{enumerable:!0,get:function(){return u.HotServer}});Object.defineProperty(L,"HotServerType",{enumerable:!0,get:function(){return u.HotServerType}});var b=N(8374);Object.defineProperty(L,"HttpError",{enumerable:!0,get:function(){return b.HttpError}});var m=N(3025);Object.defineProperty(L,"HotClient",{enumerable:!0,get:function(){return m.HotClient}});var t=
|
|
419
419
|
N(3596);Object.defineProperty(L,"HotWebSocketClient",{enumerable:!0,get:function(){return t.HotWebSocketClient}});var D=N(896);Object.defineProperty(L,"HotTestDriver",{enumerable:!0,get:function(){return D.HotTestDriver}});var C=N(1284);Object.defineProperty(L,"IHotTestElement",{enumerable:!0,get:function(){return C.IHotTestElement}});Object.defineProperty(L,"HotTestElement",{enumerable:!0,get:function(){return C.HotTestElement}});Object.defineProperty(L,"HotTestElementOptions",{enumerable:!0,get:function(){return C.HotTestElementOptions}});
|
|
420
420
|
Object.defineProperty(L,"IHotTestElementOptions",{enumerable:!0,get:function(){return C.IHotTestElementOptions}});var A=N(8969);Object.defineProperty(L,"HotTester",{enumerable:!0,get:function(){return A.HotTester}});var H=N(9962);Object.defineProperty(L,"HotTestStop",{enumerable:!0,get:function(){return H.HotTestStop}});var K=N(9164);Object.defineProperty(L,"HotDestination",{enumerable:!0,get:function(){return K.HotDestination}});var P=N(6681);Object.defineProperty(L,"HotTesterAPI",{enumerable:!0,
|
|
421
|
-
get:function(){return P.HotTesterAPI}});var M=N(6434);Object.defineProperty(L,"HotTestMap",{enumerable:!0,get:function(){return M.HotTestMap}});Object.defineProperty(L,"HotTestPath",{enumerable:!0,get:function(){return M.HotTestPath}});var
|
|
421
|
+
get:function(){return P.HotTesterAPI}});var M=N(6434);Object.defineProperty(L,"HotTestMap",{enumerable:!0,get:function(){return M.HotTestMap}});Object.defineProperty(L,"HotTestPath",{enumerable:!0,get:function(){return M.HotTestPath}});var W=N(4744);Object.defineProperty(L,"HotTestDestination",{enumerable:!0,get:function(){return W.HotTestDestination}});var z=N(1153);Object.defineProperty(L,"HotTestPage",{enumerable:!0,get:function(){return z.HotTestPage}})})();HotStaqWeb=L})();
|