ILL=isForced$1.POLYFILL="P",isForced_1=isForced$1,global$7=global$g,getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$3=createNonEnumerableProperty$5,defineBuiltIn$7=defineBuiltIn$8,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties=copyConstructorProperties$1,isForced=isForced_1,_export=function(e,t){var n,r,i,s,o,a=e.target,l=e.global,c=e.stat;if(n=l?global$7:c?global$7[a]||defineGlobalProperty(a,{}):(global$7[a]||{}).prototype)for(r in t){if(s=t[r],i=e.dontCallGetSet?(o=getOwnPropertyDescriptor$2(n,r))&&o.value:n[r],!isForced(l?r:a+(c?".":"#")+r,e.forced)&&void 0!==i){if(typeof s==typeof i)continue;copyConstructorProperties(s,i)}(e.sham||i&&i.sham)&&createNonEnumerableProperty$3(s,"sham",!0),defineBuiltIn$7(n,r,s,e)}},wellKnownSymbol$e=wellKnownSymbol$g,TO_STRING_TAG$3=wellKnownSymbol$e("toStringTag"),test={};test[TO_STRING_TAG$3]="z";var toStringTagSupport="[object z]"===String(test),TO_STRING_TAG_SUPPORT=toStringTagSupport,isCallable$8=isCallable$j,classofRaw$1=classofRaw$2,wellKnownSymbol$d=wellKnownSymbol$g,TO_STRING_TAG$2=wellKnownSymbol$d("toStringTag"),$Object$1=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw$1(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},classof$6=TO_STRING_TAG_SUPPORT?classofRaw$1:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=tryGet(t=$Object$1(e),TO_STRING_TAG$2))?n:CORRECT_ARGUMENTS?classofRaw$1(t):"Object"==(r=classofRaw$1(t))&&isCallable$8(t.callee)?"Arguments":r},classof$5=classof$6,$String$1=String,toString$8=function(e){if("Symbol"===classof$5(e))throw TypeError("Cannot convert a Symbol value to a string");return $String$1(e)},anObject$b=anObject$e,regexpFlags$1=function(){var e=anObject$b(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},fails$c=fails$l,global$6=global$g,$RegExp$2=global$6.RegExp,UNSUPPORTED_Y$1=fails$c((function(){var e=$RegExp$2("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),MISSED_STICKY=UNSUPPORTED_Y$1||fails$c((function(){return!$RegExp$2("a","y").sticky})),BROKEN_CARET=UNSUPPORTED_Y$1||fails$c((function(){var e=$RegExp$2("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),regexpStickyHelpers={BROKEN_CARET:BROKEN_CARET,MISSED_STICKY:MISSED_STICKY,UNSUPPORTED_Y:UNSUPPORTED_Y$1},objectDefineProperties={},internalObjectKeys=objectKeysInternal,enumBugKeys$1=enumBugKeys$3,objectKeys$2=Object.keys||function(e){return internalObjectKeys(e,enumBugKeys$1)},DESCRIPTORS$5=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$1=objectDefineProperty,anObject$a=anObject$e,toIndexedObject$1=toIndexedObject$5,objectKeys$1=objectKeys$2;objectDefineProperties.f=DESCRIPTORS$5&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(e,t){anObject$a(e);for(var n,r=toIndexedObject$1(t),i=objectKeys$1(t),s=i.length,o=0;s>o;)definePropertyModule$1.f(e,n=i[o++],r[n]);return e};var activeXDocument,getBuiltIn$1=getBuiltIn$4,html$1=getBuiltIn$1("document","documentElement"),anObject$9=anObject$e,definePropertiesModule=objectDefineProperties,enumBugKeys=enumBugKeys$3,hiddenKeys=hiddenKeys$4,html=html$1,documentCreateElement$1=documentCreateElement$2,sharedKey$1=sharedKey$3,GT=">",LT="<",PROTOTYPE="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$1("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObjectViaIFrame=function(){var e,t=documentCreateElement$1("iframe"),n="java"+SCRIPT+":";return t.style.display="none",html.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"!=typeof document?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var e=enumBugKeys.length;e--;)delete NullProtoObject[PROTOTYPE][enumBugKeys[e]];return NullProtoObject()};hiddenKeys[IE_PROTO$1]=!0;var re1,re2,objectCreate=Object.create||function(e,t){var n;return null!==e?(EmptyConstructor[PROTOTYPE]=anObject$9(e),n=new EmptyConstructor,EmptyConstructor[PROTOTYPE]=null,n[IE_PROTO$1]=e):n=NullProtoObject(),void 0===t?n:definePropertiesModule.f(n,t)},fails$b=fails$l,global$5=global$g,$RegExp$1=global$5.RegExp,regexpUnsupportedDotAll=fails$b((function(){var e=$RegExp$1(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),fails$a=fails$l,global$4=global$g,$RegExp=global$4.RegExp,regexpUnsupportedNcg=fails$a((function(){var e=$RegExp("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")})),call$b=functionCall,uncurryThis$f=functionUncurryThis,toString$7=toString$8,regexpFlags=regexpFlags$1,stickyHelpers=regexpStickyHelpers,shared=shared$4.exports,create$3=objectCreate,getInternalState$2=internalState.get,UNSUPPORTED_DOT_ALL=regexpUnsupportedDotAll,UNSUPPORTED_NCG=regexpUnsupportedNcg,nativeReplace=shared("native-string-replace",String.prototype.replace),nativeExec=RegExp.prototype.exec,patchedExec=nativeExec,charAt$6=uncurryThis$f("".charAt),indexOf=uncurryThis$f("".indexOf),replace$5=uncurryThis$f("".replace),stringSlice$6=uncurryThis$f("".slice),UPDATES_LAST_INDEX_WRONG=(re2=/b*/g,call$b(nativeExec,re1=/a/,"a"),call$b(nativeExec,re2,"a"),0!==re1.lastIndex||0!==re2.lastIndex),UNSUPPORTED_Y=stickyHelpers.BROKEN_CARET,NPCG_INCLUDED=void 0!==/()??/.exec("")[1],PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y||UNSUPPORTED_DOT_ALL||UNSUPPORTED_NCG;PATCH&&(patchedExec=function(e){var t,n,r,i,s,o,a,l=this,c=getInternalState$2(l),d=toString$7(e),u=c.raw;if(u)return u.lastIndex=l.lastIndex,t=call$b(patchedExec,u,d),l.lastIndex=u.lastIndex,t;var h=c.groups,p=UNSUPPORTED_Y&&l.sticky,g=call$b(regexpFlags,l),m=l.source,f=0,v=d;if(p&&(g=replace$5(g,"y",""),-1===indexOf(g,"g")&&(g+="g"),v=stringSlice$6(d,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==charAt$6(d,l.lastIndex-1))&&(m="(?: "+m+")",v=" "+v,f++),n=new RegExp("^(?:"+m+")",g)),NPCG_INCLUDED&&(n=new RegExp("^"+m+"$(?!\\s)",g)),UPDATES_LAST_INDEX_WRONG&&(r=l.lastIndex),i=call$b(nativeExec,p?n:l,v),p?i?(i.input=stringSlice$6(i.input,f),i[0]=stringSlice$6(i[0],f),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:UPDATES_LAST_INDEX_WRONG&&i&&(l.lastIndex=l.global?i.index+i[0].length:r),NPCG_INCLUDED&&i&&i.length>1&&call$b(nativeReplace,i[0],n,(function(){for(s=1;s=a?e?"":void 0:(r=charCodeAt$1(s,o))<55296||r>56319||o+1===a||(i=charCodeAt$1(s,o+1))<56320||i>57343?e?charAt$5(s,o):r:e?stringSlice$5(s,o,o+2):i-56320+(r-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$1(!1),charAt:createMethod$1(!0)},charAt$4=stringMultibyte.charAt,advanceStringIndex$1=function(e,t,n){return t+(n?charAt$4(e,t).length:1)},uncurryThis$b=functionUncurryThis,toObject$3=toObject$5,floor$3=Math.floor,charAt$3=uncurryThis$b("".charAt),replace$4=uncurryThis$b("".replace),stringSlice$4=uncurryThis$b("".slice),SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d{1,2})/g,getSubstitution$1=function(e,t,n,r,i,s){var o=n+e.length,a=r.length,l=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==i&&(i=toObject$3(i),l=SUBSTITUTION_SYMBOLS),replace$4(s,l,(function(s,l){var c;switch(charAt$3(l,0)){case"$":return"$";case"&":return e;case"`":return stringSlice$4(t,0,n);case"'":return stringSlice$4(t,o);case"<":c=i[stringSlice$4(l,1,-1)];break;default:var d=+l;if(0===d)return s;if(d>a){var u=floor$3(d/10);return 0===u?s:u<=a?void 0===r[u-1]?charAt$3(l,1):r[u-1]+charAt$3(l,1):s}c=r[d-1]}return void 0===c?"":c}))},call$9=functionCall,anObject$8=anObject$e,isCallable$7=isCallable$j,classof$4=classofRaw$2,regexpExec=regexpExec$2,$TypeError$5=TypeError,regexpExecAbstract=function(e,t){var n=e.exec;if(isCallable$7(n)){var r=call$9(n,e,t);return null!==r&&anObject$8(r),r}if("RegExp"===classof$4(e))return call$9(regexpExec,e,t);throw $TypeError$5("RegExp#exec called on incompatible receiver")},apply=functionApply,call$8=functionCall,uncurryThis$a=functionUncurryThis,fixRegExpWellKnownSymbolLogic$1=fixRegexpWellKnownSymbolLogic,fails$8=fails$l,anObject$7=anObject$e,isCallable$6=isCallable$j,isNullOrUndefined$2=isNullOrUndefined$5,toIntegerOrInfinity=toIntegerOrInfinity$4,toLength$1=toLength$3,toString$5=toString$8,requireObjectCoercible$4=requireObjectCoercible$8,advanceStringIndex=advanceStringIndex$1,getMethod$3=getMethod$5,getSubstitution=getSubstitution$1,regExpExec$1=regexpExecAbstract,wellKnownSymbol$b=wellKnownSymbol$g,REPLACE=wellKnownSymbol$b("replace"),max$1=Math.max,min$1=Math.min,concat$1=uncurryThis$a([].concat),push$3=uncurryThis$a([].push),stringIndexOf$1=uncurryThis$a("".indexOf),stringSlice$3=uncurryThis$a("".slice),maybeToString=function(e){return void 0===e?e:String(e)},REPLACE_KEEPS_$0="$0"==="a".replace(/./,"$0"),REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=!!/./[REPLACE]&&""===/./[REPLACE]("a","$0"),REPLACE_SUPPORTS_NAMED_GROUPS=!fails$8((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}));fixRegExpWellKnownSymbolLogic$1("replace",(function(e,t,n){var r=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?"$":"$0";return[function(e,n){var r=requireObjectCoercible$4(this),i=isNullOrUndefined$2(e)?void 0:getMethod$3(e,REPLACE);return i?call$8(i,e,r,n):call$8(t,toString$5(r),e,n)},function(e,i){var s=anObject$7(this),o=toString$5(e);if("string"==typeof i&&-1===stringIndexOf$1(i,r)&&-1===stringIndexOf$1(i,"$<")){var a=n(t,s,o,i);if(a.done)return a.value}var l=isCallable$6(i);l||(i=toString$5(i));var c=s.global;if(c){var d=s.unicode;s.lastIndex=0}for(var u=[];;){var h=regExpExec$1(s,o);if(null===h)break;if(push$3(u,h),!c)break;""===toString$5(h[0])&&(s.lastIndex=advanceStringIndex(o,toLength$1(s.lastIndex),d))}for(var p="",g=0,m=0;m=g&&(p+=stringSlice$3(o,g,v)+T,g=v+f.length)}return p+stringSlice$3(o,g)}]}),!REPLACE_SUPPORTS_NAMED_GROUPS||!REPLACE_KEEPS_$0||REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);var whitespaces$2="\t\n\v\f\r                \u2028\u2029\ufeff",uncurryThis$9=functionUncurryThis,requireObjectCoercible$3=requireObjectCoercible$8,toString$4=toString$8,whitespaces$1=whitespaces$2,replace$3=uncurryThis$9("".replace),ltrim=RegExp("^["+whitespaces$1+"]+"),rtrim=RegExp("(^|[^"+whitespaces$1+"])["+whitespaces$1+"]+$"),createMethod=function(e){return function(t){var n=toString$4(requireObjectCoercible$3(t));return 1&e&&(n=replace$3(n,ltrim,"")),2&e&&(n=replace$3(n,rtrim,"$1")),n}},stringTrim={start:createMethod(1),end:createMethod(2),trim:createMethod(3)},PROPER_FUNCTION_NAME$2=functionName.PROPER,fails$7=fails$l,whitespaces=whitespaces$2,non="​…᠎",stringTrimForced=function(e){return fails$7((function(){return!!whitespaces[e]()||non[e]()!==non||PROPER_FUNCTION_NAME$2&&whitespaces[e].name!==e}))},$$7=_export,$trim=stringTrim.trim,forcedStringTrimMethod=stringTrimForced;$$7({target:"String",proto:!0,forced:forcedStringTrimMethod("trim")},{trim:function(){return $trim(this)}});var wellKnownSymbol$a=wellKnownSymbol$g,create$2=objectCreate,defineProperty$4=objectDefineProperty.f,UNSCOPABLES=wellKnownSymbol$a("unscopables"),ArrayPrototype$1=Array.prototype;null==ArrayPrototype$1[UNSCOPABLES]&&defineProperty$4(ArrayPrototype$1,UNSCOPABLES,{configurable:!0,value:create$2(null)});var addToUnscopables$2=function(e){ArrayPrototype$1[UNSCOPABLES][e]=!0},$$6=_export,$includes=arrayIncludes.includes,fails$6=fails$l,addToUnscopables$1=addToUnscopables$2,BROKEN_ON_SPARSE=fails$6((function(){return!Array(1).includes()}));$$6({target:"Array",proto:!0,forced:BROKEN_ON_SPARSE},{includes:function(e){return $includes(this,e,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables$1("includes");var isObject$2=isObject$8,classof$3=classofRaw$2,wellKnownSymbol$9=wellKnownSymbol$g,MATCH$1=wellKnownSymbol$9("match"),isRegexp=function(e){var t;return isObject$2(e)&&(void 0!==(t=e[MATCH$1])?!!t:"RegExp"==classof$3(e))},isRegExp=isRegexp,$TypeError$4=TypeError,notARegexp=function(e){if(isRegExp(e))throw $TypeError$4("The method doesn't accept regular expressions");return e},wellKnownSymbol$8=wellKnownSymbol$g,MATCH=wellKnownSymbol$8("match"),correctIsRegexpLogic=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[MATCH]=!1,"/./"[e](t)}catch(e){}}return!1},$$5=_export,uncurryThis$8=functionUncurryThis,notARegExp$1=notARegexp,requireObjectCoercible$2=requireObjectCoercible$8,toString$3=toString$8,correctIsRegExpLogic$1=correctIsRegexpLogic,stringIndexOf=uncurryThis$8("".indexOf);function __setFunctionName(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}$$5({target:"String",proto:!0,forced:!correctIsRegExpLogic$1("includes")},{includes:function(e){return!!~stringIndexOf(toString$3(requireObjectCoercible$2(this)),toString$3(notARegExp$1(e)),arguments.length>1?arguments[1]:void 0)}});const ArcwareStyles={customStyles:{":root":{"--color0":"#18181A !important","--color1":"#000000","--color2":"#FFFFFF","--color3":"#ffffff !important","--color4":"#35b350","--color5":"#ffab00","--color6":"#858588 !important","--color7":"#B5B5B7 !important","--color8":"#41008c","--color9":"#3e0070","--color10":"#2e0052","--color11":"rgba(65,0,139,1) !important","--color12":"#222224 !important","--color13":"#f0f0f2 !important","--colorBoxShadow":"rgba(0, 0, 0, 0.20) !important"},"*":{fontFamily:"system-ui"},"#shared-stream-container":{boxSizing:"border-box"},"#shared-stream-container::-webkit-scrollbar":{width:"10px"},"#shared-stream-container::-webkit-scrollbar-track":{opacity:"0.5",borderRadius:"30px",borderTop:"20px solid var(--color0)",borderRight:"5px solid var(--color0)",borderBottom:"20px solid var(--color0)",borderLeft:"5px solid var(--color0)"},"#shared-stream-container::-webkit-scrollbar-track-piece":{background:"transparent"},"#shared-stream-container::-webkit-scrollbar-thumb":{width:"8px",borderRight:"2px solid var(--color0)",borderLeft:"2px solid var(--color0)",transition:"all ease-in-out 0.3s",borderRadius:"7px"},"#shared-stream-container::-webkit-scrollbar-thumb:hover":{transition:"all ease-in-out 0.3s"},"#playerUI, #videoElementParent":{position:"absolute",width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",top:0,right:0,bottom:0,left:0,margin:"auto",boxSizing:"border-box",pointerEvents:"all"},"#streamingVideo":{maxWidth:"100%",maxHeight:"100%",boxSizing:"border-box",background:"transparent"},"#uiFeatures #controls":{top:"auto",left:"auto",bottom:"10px",right:"20px",display:"flex",flexDirection:"column-reverse"},"#uiFeatures #connection":{bottom:"5px",left:"10px",width:"2.5rem",heihgt:"2.5rem"},"#uiFeatures button":{backgroundColor:"transparent",border:"none",position:"relative",width:"45px",height:"45px",padding:"0.5rem",textAlign:"center",cursor:"pointer",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",boxShadow:"0px 0px 24px 0px var(--colorBoxShadow)",borderRadius:"3px",outline:"none"},"#uiFeatures button:hover, #uiFeatures button:active":{padding:"0 !important",border:"none"},"#uiFeatures button #audioIconMuted, #uiFeatures button #audioIconUnmuted, #uiFeatures button #micIconMuted, #uiFeatures button #micIconUnmuted":{width:"31px",height:"28px"},"#uiFeatures button #maximizeIcon, #uiFeatures button #minimizeIcon":{width:"25px",height:"25px"},"#stopIcon, #playIcon":{width:"30px",height:"30px"},"#uiFeatures button .tooltiptext":{right:"125%",left:"auto",boxShadow:"0px 0px 24px 0px var(--colorBoxShadow)",borderRadius:"3px",width:"95px"},"#controls>*":{marginBottom:"0.5rem",display:"block",lineHeight:"1.75rem",padding:"0.5rem"},"#uiFeatures #settingsIcon, #uiFeatures #statsIcon":{width:"27px",height:"27px"},".svgIcon":{fill:"var(--color13)"},"#uiFeatures button:hover .svgIcon, #uiFeatures button:active .svgIcon":{fill:"var(--color12)"},".tgl-switch .tgl-slider, .tgl-flat:checked+.tgl-slider":{border:"3px solid transparent"},".tgl-switch .tgl-slider":{background:"none"},".tgl-switch .tgl-slider::before":{content:"''",display:"block",background:"var(--color6)",position:"absolute",height:"50%",width:"90%",borderRadius:"5px",margin:"auto",top:"0",bottom:"0",left:"0",right:"0"},".tgl-switch .tgl-slider::after":{height:"13px",width:"13px",borderRadius:"50%",top:"-2px",left:"-1%"},".tgl-flat:checked+.tgl-slider:after":{left:"62%",background:"var(--color3)"},".form-control":{backgroundColor:"transparent",border:"1px solid white",borderRadius:"2px",color:"var(--color13)",textAlign:"left",fontFamily:"inherit",padding:"5px 15px "},".btn-flat":{background:"var(--color3)",color:"var(--color12)",border:"none",padding:"7px 50px",cursor:"pointer",borderRadius:"4px",textTransform:"uppercase",minWidth:"175px"},".btn-flat:disabled":{background:"var(--color7)",borderColor:"var(--color3)",color:"var(--color3)",cursor:"default"},".btn-flat:focus":{outline:"none"},".arcware-logo-loader":{position:"relative",display:"block",width:"12.5%",height:"12.5%"},"#playOverlay img#playButton":{width:"5%"},"#disconnectOverlay, #errorOverlay":{textTransform:"initial",textAlign:"center",fontSize:"20px",lineHeight:2.5},"#disconnectOverlay .clickableState":{textTransform:"initial",textAlign:"center",color:"white",padding:"5px",fontSize:"18px",border:"1px solid white",margin:"25px auto 0",width:"180px"},"#afkOverlay":{background:"none",transition:"all ease-in-out 0.5s",opacity:1,pointerEvents:"initial"},"#afkOverlayInner":{textTransform:"initial",padding:"20px 10px 30px",fontSize:"18px",width:"360px",textAlign:"center",lineHeight:2.5},"#afkOverlayInner center::first-line":{textTransform:"uppercase",color:"#FF8461",fontWeight:"bold",fontSize:"24px"},"#afkOverlayInner #afkCountDownNumber":{color:"white",fontSize:"26px",lineHeight:"22px"},"#afkOverlayInner center .retry-button":{textTransform:"initial",textAlign:"center",color:"white",padding:"5px",fontSize:"18px",border:"1px solid #DAF693",margin:"25px auto 0",width:"180px"},"#connectOverlay #connectButton":{textTransform:"initial",textAlign:"center",color:"white",padding:"5px 5px 8px",fontSize:"18px",margin:"25px auto 0",width:"180px"},"#connectOverlay .connection-text":{textTransform:"initial",textAlign:"center",margin:"25px auto 0"},"#connectOverlay .connection-text .title":{color:"#ffffff",fontSize:"18px",margin:"5px 0"},"#connectOverlay .connection-text .subtitle":{color:"#ffffff",opacity:.5,fontSize:"12px",margin:"10px 0"},"#infoOverlay.hiddenState":{display:"none"},"#disconnectOverlay, #playOverlay, #errorOverlay, #microphoneOverlay, #connectOverlay":{display:"flex",transition:"all ease-in-out 0.5s",opacity:1,pointerEvents:"initial"},"#microphoneOverlay":{textTransform:"initial",padding:"20px 30px",fontSize:"14px",height:"230px",width:"360px",textAlign:"center",lineHeight:1.25,position:"absolute",margin:"auto",top:"0",bottom:"0",left:"0",right:"0",justifyContent:"center",alignItems:"center",flexDirection:"column",zIndex:99999},"#microphoneOverlay .title":{fontSize:"24px",position:"relative",marginBottom:"20px",color:"#F0F0F2"},"#microphoneOverlay .title:after":{content:"''",display:"inline-block",animation:"dotty steps(1,end) 1s infinite",position:"absolute"},"#microphoneOverlay p":{margin:0,color:"#858588"},"#microphoneOverlay svg":{height:"65px",marginBottom:"15px",marginTop:"-5px"},"#microphoneOverlay .svgIcon":{fill:"#DAF693"},"#disconnectOverlay.hiddenState, #playOverlay.hiddenState, #errorOverlay.hiddenState, #afkOverlay.hiddenState, #microphoneOverlay.hiddenState":{opacity:0,pointerEvents:"none"},"#disconnectOverlay.mic-overlay-is-visible, #errorOverlay.mic-overlay-is-visible, #infoOverlay.mic-overlay-is-visible":{opacity:0,pointerEvents:"none"},"#infoOverlay.hiddenState, #connectOverlay.hiddenState":{display:"none"},"#connectOverlay":{display:"flex",flexDirection:"column-reverse",alignItems:"center",justifyContent:"center"},"#infoOverlay":{display:"none"},".love-letters-box-root":{display:"flex",position:"absolute",width:"100%",height:"100%",color:"#ffffff",justifyContent:"center",alignItems:"center",flexDirection:"column",background:"#18181A",zIndex:1},".love-letters-box-root.fade-out":{opacity:0,transition:"opacity 0.5s"},"#letters-block":{position:"absolute",top:0,left:0,right:0,bottom:0,margin:"auto",color:"#ffffff",zIndex:4,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",fontSize:"16px",textTransform:"initial",textAlign:"center"},"#letters-wrapper":{height:"77px",overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",marginTop:"10px",paddingBottom:"2px"},"#letters-wrapper p":{textAlign:"center",lineHeight:1.25,fontSize:"16px"},".letter-animation:nth-last-of-type(1)::after":{display:"inline-block",animation:"dotty steps(1,end) 1s infinite",content:"''",position:"absolute"},".letter-animation":{transition:"all 0.5s ease-in-out",transformOrigin:"bottom",margin:"0 auto"},".letter-animation-enter":{animation:"fadeInUp 0.75s ease-out"},".letter-animation-exit":{opacity:0,scale:.9,transition:"all ease-in-out 1s",margin:0},"@keyframes dotty":{"0%":{content:"''"},"25%":{content:"'.'"},"50%":{content:"'..'"},"75%":{content:"'...'"},"100%":{content:"''"}},"@keyframes fadeInUp":{from:{opacity:0,transform:" translateY(5px)",scale:.9},to:{opacity:1,transform:"translateY(0)",scale:1}},".hidden":{display:"none",opacity:0},".visible":{display:"block",opacity:1,transition:"opacity 1s ease-out"}}};class AudioIcon{constructor(){this.audioIconUnmuted=this.createAudioIconUnmuted(),this.audioIconMuted=this.createAudioIconMuted()}createAudioIconUnmuted(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","audioIconUnmuted"),t.setAttributeNS(null,"x","31px"),t.setAttributeNS(null,"y","28px"),t.setAttributeNS(null,"viewBox","0 0 31 28");const n=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==n?void 0:n.classList)||void 0===e||e.add("svgIcon"),t.appendChild(n);const r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M21.0008,0.0720318C20.556,-0.117811,20.0379,0.0805569,19.8435,0.514827C19.6492,0.949098,19.8522,1.45512,20.297,1.6449C25.1233,3.70434,28.242,8.35761,28.2422,13.4998C28.2422,18.6423,25.1234,23.2957,20.2966,25.3551C19.8518,25.5448,19.6488,26.0508,19.8431,26.4852C19.9874,26.8077,20.3102,27,20.649,27C20.7664,27,20.8859,26.9769,21.0004,26.928C26.4674,24.5954,30,19.3246,30,13.4997C29.9998,7.67531,26.4674,2.40462,21.0008,0.0720318Z");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M21.2351,6.69434C20.8735,6.37822,20.3179,6.4082,19.9941,6.76134C19.6703,7.11454,19.701,7.65706,20.0627,7.97324C21.6712,9.37932,22.5937,11.3937,22.5937,13.5C22.5937,15.6062,21.6711,17.6206,20.0627,19.0267C19.701,19.3428,19.6703,19.8854,19.9941,20.2386C20.1677,20.4279,20.4079,20.5244,20.6492,20.5244C20.8579,20.5244,21.0674,20.4522,21.2351,20.3056C23.2157,18.5744,24.3515,16.0937,24.3515,13.4999C24.3515,10.9061,23.2156,8.42553,21.2351,6.69434Z");const s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttributeNS(null,"d","M15.3973,2.16277C15.1018,2.01658,14.7473,2.04502,14.4803,2.23623L7.65176,7.12598H0.878906C0.393516,7.12598,0,7.51024,0,7.98422V19.0155C0,19.4895,0.393516,19.8738,0.878906,19.8738H7.6517L14.4802,24.7637C14.6339,24.8737,14.8164,24.9298,15.0001,24.9298C15.1356,24.9298,15.2718,24.8992,15.3973,24.8371C15.6927,24.6909,15.8789,24.395,15.8789,24.0716V2.9282C15.8789,2.60482,15.6927,2.30884,15.3973,2.16277ZM14.121,22.3778L8.45918,18.3234C8.30842,18.2154,8.12637,18.1572,7.93939,18.1572H1.75781V8.84246H7.93939C8.12631,8.84246,8.30842,8.78422,8.45912,8.67636L14.121,4.62197V22.3778Z"),n.appendChild(r),n.appendChild(i),n.appendChild(s),t}createAudioIconMuted(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","audioIconMuted"),t.setAttributeNS(null,"x","31px"),t.setAttributeNS(null,"y","28px"),t.setAttributeNS(null,"viewBox","0 -1 31 28");const n=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=n.classList)||void 0===e||e.add("svgIcon"),t.appendChild(n);const r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M16.3501,0.829286C16.046,0.678799,15.6811,0.708072,15.4062,0.904912L8.37681,5.93848H1.40476C0.90509,5.93848,0.5,6.33404,0.5,6.82196V18.1777C0.5,18.6657,0.90509,19.0612,1.40476,19.0612H8.37675L15.4061,24.0949C15.5643,24.2082,15.7522,24.2659,15.9412,24.2659C16.0808,24.2659,16.221,24.2344,16.3501,24.1705C16.6542,24.02,16.8459,23.7154,16.8459,23.3825V1.61724C16.8459,1.28434,16.6542,0.979655,16.3501,0.829286ZM15.0364,21.6389L9.20798,17.4652C9.05278,17.3541,8.86538,17.2942,8.6729,17.2942H2.30951V7.70544H8.6729C8.86532,7.70544,9.05278,7.64548,9.20792,7.53446L15.0364,3.36082V21.6389Z");const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttributeNS(null,"d","M25.2799,11.7634L21.8442,8.32748C21.6206,8.10399,21.6206,7.74264,21.8442,7.51915C22.0676,7.29566,22.429,7.29566,22.6525,7.51915L26.0883,10.955L29.524,7.51915C29.7476,7.29566,30.1088,7.29566,30.3323,7.51915C30.5559,7.74264,30.5559,8.10399,30.3323,8.32748L26.8966,11.7634L30.3323,15.1992C30.5559,15.4227,30.5559,15.7841,30.3323,16.0076C30.2209,16.1191,30.0745,16.1751,29.9281,16.1751C29.7818,16.1751,29.6355,16.1191,29.524,16.0076L26.0883,12.5717L22.6525,16.0076C22.541,16.1191,22.3947,16.1751,22.2483,16.1751C22.102,16.1751,21.9556,16.1191,21.8442,16.0076C21.6206,15.7841,21.6206,15.4227,21.8442,15.1992L25.2799,11.7634Z"),n.appendChild(r),n.appendChild(i),t}}class AudioButton{constructor(e){this.stream=e,this.setAudioMutedByDefault(),this.button=this.createButton(),this.audioIcon=new AudioIcon,this.button.appendChild(this.audioIcon.audioIconMuted),this.button.appendChild(this.audioIcon.audioIconUnmuted),this.audioIcon.audioIconUnmuted.style.display="none",this.button.addEventListener("click",this.toggleAudio.bind(this)),this.onVolumeChange=this.onVolumeChange.bind(this),this.stream.webRtcController.videoPlayer.videoElement.addEventListener("volumechange",this.onVolumeChange.bind(this))}setAudioMutedByDefault(){const e=this.stream.videoElementParent;if(e){const t=e.querySelector("video");t&&this.stream.toggleAudio(t,!0)}}createButton(){var e;const t=document.createElement("button");return null==t||t.setAttribute("id","audioBtn"),null==t||t.setAttribute("type","button"),null===(e=null==t?void 0:t.classList)||void 0===e||e.add("UiTool"),t}createTooltipText(){var e;const t=document.createElement("span");return null===(e=null==t?void 0:t.classList)||void 0===e||e.add("tooltiptext"),t.innerHTML="Mute/Unmute",t}toggleAudio(){const e=this.stream.videoElementParent;if(e){const t=e.querySelector("video");if(t){const e=!t.muted;this.stream.toggleAudio(t,e),this.updateAudioIcon(e)}}}updateAudioIcon(e){e?(this.audioIcon.audioIconUnmuted.style.display="none",this.audioIcon.audioIconMuted.style.display="block"):(this.audioIcon.audioIconMuted.style.display="none",this.audioIcon.audioIconUnmuted.style.display="block")}get element(){return this.button}onVolumeChange(e){const t=e.target;this.updateAudioIcon(t.muted)}}class MicIcon{constructor(){this.micIconUnmuted=this.createMicIconUnmuted(),this.micIconMuted=this.createMicIconMuted()}createMicIconUnmuted(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","micIconUnmuted"),t.setAttributeNS(null,"x","24px"),t.setAttributeNS(null,"y","24px"),t.setAttributeNS(null,"viewBox","0 -1 24 24");const n=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==n?void 0:n.classList)||void 0===e||e.add("svgIcon"),t.appendChild(n);const r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"d","M12 14c1.66,0,2.99-1.34,2.99-3L15,5c0-1.66-1.34-3-3-3S9,3.34,9,5v6c0,1.66,1.34,3,3,3zm5.3-3c0,3-2.54,5.1-5.3,5.1S6.7,14,6.7,11H5c0,3.41,2.72,6.23,6,6.72V21h2v-3.28c3.28-.48,6-3.3,6-6.72h-1.7z"),n.appendChild(r),t}createMicIconMuted(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","micIconMuted"),t.setAttributeNS(null,"x","24px"),t.setAttributeNS(null,"y","24px"),t.setAttributeNS(null,"viewBox","0 -1 24 24");const n=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==n?void 0:n.classList)||void 0===e||e.add("svgIcon"),t.appendChild(n);const r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"d","M19,11h-1.7c0,.74-.16,1.43-.43,2.05l1.23,1.23c.56-.98.9-2.09.9-3.28zm-4.02.17c0-.06.02-.11.02-.17V5c0-1.66-1.34-3-3-3S9,3.34,9,5v.18l5.98,5.99zM4.27,3,3,4.27l6.01,6.01V11c0,1.66,1.33,3,2.99,3,.22,0,.44-.03.65-.08l1.66,1.66c-.71.33-1.5.52-2.31.52-2.76,0-5.3-2.1-5.3-5.1H5c0,3.41,2.72,6.23,6,6.72V21h2v-3.28c.91-.13,1.77-.45,2.54-.9L19.73,21,21,19.73,4.27,3z"),n.appendChild(r),t}}class MicButton{constructor(e){this.stream=e,this.setMicMutedByDefault(),this.button=this.createButton(),this.micIcon=new MicIcon,this.button.appendChild(this.micIcon.micIconMuted),this.button.appendChild(this.micIcon.micIconUnmuted),this.micIcon.micIconUnmuted.style.display="none",this.button.addEventListener("click",this.toggleMic.bind(this))}setMicMutedByDefault(){const e=this.stream.videoElementParent;e&&e.querySelector("video")&&this.stream.toggleMic(!1,!0)}createButton(){var e;const t=document.createElement("button");return t.setAttribute("id","micBtn"),t.setAttribute("type","button"),null===(e=null==t?void 0:t.classList)||void 0===e||e.add("UiTool"),t}createTooltipText(){var e;const t=document.createElement("span");return null===(e=null==t?void 0:t.classList)||void 0===e||e.add("tooltiptext"),t.innerHTML="Mic on/off",t}toggleMic(){var e,t;const n=null===(t=null===(e=null==this?void 0:this.stream)||void 0===e?void 0:e.config)||void 0===t?void 0:t.isFlagEnabled(Ot.UseMic);this.stream.toggleMic(!n,!1),this.updateMicIcon(!n)}updateMicIcon(e){e?(this.micIcon.micIconMuted.style.display="none",this.micIcon.micIconUnmuted.style.display="block"):(this.micIcon.micIconUnmuted.style.display="none",this.micIcon.micIconMuted.style.display="block")}get element(){return this.button}}class StopIcon{constructor(){this.stopIcon=this.createStopIcon()}createStopIcon(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","stopIcon"),t.setAttributeNS(null,"x","24px"),t.setAttributeNS(null,"y","24px"),t.setAttributeNS(null,"viewBox","0 -1 24 24");const n=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==n?void 0:n.classList)||void 0===e||e.add("svgIcon"),null==t||t.appendChild(n);const r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"d","M6 6h12v12H6z"),n.appendChild(r),t}}class PlayIcon{constructor(){this.playIcon=this.createPlayIcon()}createPlayIcon(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","playIcon"),t.setAttributeNS(null,"x","24px"),t.setAttributeNS(null,"y","24px"),t.setAttributeNS(null,"viewBox","0 0 24 24");const n=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==n?void 0:n.classList)||void 0===e||e.add("svgIcon"),t.appendChild(n);const r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"d","M8 5v14l11-7z"),n.appendChild(r),t}}class StopButton{constructor(e){this.isStreaming=!0,this.stream=e,this.button=this.createButton(),this.stopIcon=new StopIcon,this.playIcon=new PlayIcon,this.button.appendChild(this.stopIcon.stopIcon),this.button.addEventListener("click",this.toggleStreaming.bind(this)),e.onStreamingStateChange(this.updateButtonState.bind(this))}createButton(){var e;const t=document.createElement("button");return null==t||t.setAttribute("id","stopBtn"),null==t||t.setAttribute("type","button"),null===(e=null==t?void 0:t.classList)||void 0===e||e.add("UiTool"),t}createTooltipText(){var e;const t=document.createElement("span");return null===(e=null==t?void 0:t.classList)||void 0===e||e.add("tooltiptext"),t.innerHTML="Disconnect",t}toggleStreaming(){var e;this.isStreaming=!this.isStreaming,this.updateButtonIcon(),this.isStreaming?null===(e=this.stream)||void 0===e||e.webRtcController.restartStreamAutomatically():this.stream.disconnect()}updateButtonIcon(){const e=this.isStreaming?this.stopIcon.stopIcon:this.playIcon.playIcon;this.isStreaming;this.button.firstChild&&this.button.removeChild(this.button.children[1]),this.button.appendChild(e)}get element(){return this.button}updateButtonState(e){this.isStreaming=e,this.updateButtonIcon()}}var _a;const TextKeyRegex=/^(\['([a-zA-Z 0-9-_]+)'\] )/;function findElementByTextContent(e,t){const n=TextKeyRegex.exec(t);if(!n)return null;const r=t.replace(n[1],""),i=n[2].trim(),s=(e||document).querySelectorAll(r);let o=null;return s.forEach((e=>{var t;null==e||e.innerHTML.trim(),!o&&(null===(t=null==e?void 0:e.innerHTML)||void 0===t?void 0:t.includes(`>${i}<`))&&(o=e)})),o}const removals={"#StreamerId":!0,"#ss":!0,"#TimeoutIfIdle":!0,"#OfferToReceive":!0,"#preferSFU":!0,"#ForceTURN":!0,"#LightMode":!0,"#UseMic":!0,"#MatchViewportRes":!0,"#HoveringMouse":!0,"['AFK timeout'] div.setting.form-group:not([id])":!0,"['Encoder'] section.settingsContainer:not([id])":!0,"['WebRTC'] section.settingsContainer:not([id])":!0,"['UI'] section.settingsContainer:not([id])":!0};function remove(e,t){!0===removals[e]&&t&&(t.style.display="none")}class ArcwareApplication extends G{get rootElement(){return super.rootElement}constructor(e){var t,n,r,i,s,o,a,l,c,d,u,h;super(e),this.responseCallback=null,this.ArcwareSection=this.configUI.buildSectionWithHeading(this.settingsPanel.settingsContentElement,"Arcware CloudRT"),this.stream=null==e?void 0:e.stream,this.emitUIInteraction=this.emitUIInteraction.bind(this),this.adjustSettingsPanel(),this.createAudioToggleButton(),this.createMicToggleButton(),this.createStopButton(),this.applyArcwareStyles(),this.videoElementParent=null===(t=null==this?void 0:this.stream)||void 0===t?void 0:t.videoElementParent,this.parentElement=null===(n=null==this?void 0:this.videoElementParent)||void 0===n?void 0:n.parentElement,this.webRtcController=null===(r=null==this?void 0:this.stream)||void 0===r?void 0:r._webRtcController,null===(s=null===(i=null==this?void 0:this.stream)||void 0===i?void 0:i.loveLetterHandler)||void 0===s||s.add((e=>{var t,n,r;if((null==this?void 0:this.playOverlay)&&e&&(null==this?void 0:this.parentElement)){const i=null===(t=null==this?void 0:this.parentElement)||void 0===t?void 0:t.querySelector("#infoOverlay");if(i){null===(n=null==i?void 0:i.classList)||void 0===n||n.remove("hiddenState");const t=null==i?void 0:i.querySelector("#messageOverlayInner");t&&(t.innerHTML=null===(r=null==e?void 0:e.reason)||void 0===r?void 0:r.replace("LL: ",""))}}})),null===(o=null==this?void 0:this.stream)||void 0===o||o.addResponseEventListener("ue-response",(e=>null==this?void 0:this.applicationResponse(e))),null===(l=null===(a=null==this?void 0:this.stream)||void 0===a?void 0:a.sessionIdHandler)||void 0===l||l.add((e=>{var t;null===(t=null==this?void 0:this.statsPanel)||void 0===t||t.addOrUpdateStat("sessionId","SessionId",e)})),null===(d=null===(c=null==this?void 0:this.stream)||void 0===c?void 0:c.videoInitializedHandler)||void 0===d||d.add((()=>{var e,t,n;null===(e=null==this?void 0:this.currentOverlay)||void 0===e||e.hide(),(null===(t=null==this?void 0:this.stream)||void 0===t?void 0:t.streamInfo)&&(null==this||this.autoPlayHandler(null===(n=null==this?void 0:this.stream)||void 0===n?void 0:n.streamInfo))})),null===(h=null===(u=null==this?void 0:this.stream)||void 0===u?void 0:u.videoInitializedHandler)||void 0===h||h.add((()=>{null==this||this.uiDefaultButtonVisibilty("fullscreenButton","#fullscreen-btn"),null==this||this.uiDefaultButtonVisibilty("settingsButton","#settingsBtn"),null==this||this.uiDefaultButtonVisibilty("infoButton","#statsBtn"),null==this||this.uiDefaultButtonVisibilty("audioButton","#audioBtn"),null==this||this.uiDefaultButtonVisibilty("stopButton","#stopBtn"),null==this||this.uiDefaultButtonVisibilty("connectionStrengthIcon","#connection"),null==this||this.uiDefaultButtonVisibilty("micButton","#micBtn"),this.uiElementsVisibility(!0)}).bind(this)),this.uiElementsVisibility(!1),this.addTextToConnectOverlay(),this.preventDefaultKeyboardEvents()}uiElementsVisibility(e){var t,n,r,i,s,o,a,l,c,d;const u=null===(t=null==this?void 0:this.parentElement)||void 0===t?void 0:t.querySelector("#controls");u&&(e?(null===(n=null==u?void 0:u.classList)||void 0===n||n.remove("hidden"),null===(r=null==u?void 0:u.classList)||void 0===r||r.add("visible")):(null===(i=null==u?void 0:u.classList)||void 0===i||i.remove("visible"),null===(s=null==u?void 0:u.classList)||void 0===s||s.add("hidden")));const h=null===(o=null==this?void 0:this.parentElement)||void 0===o?void 0:o.querySelector("#connection");h&&(e?(null===(a=null==h?void 0:h.classList)||void 0===a||a.remove("hidden"),null===(l=null==h?void 0:h.classList)||void 0===l||l.add("visible")):(null===(c=null==h?void 0:h.classList)||void 0===c||c.remove("visible"),null===(d=null==h?void 0:h.classList)||void 0===d||d.add("hidden")))}adjustSettingsPanel(){var e,t,n,r,i,s,o,a,l,c,d,u,h,p;const g=null===(e=null==this?void 0:this.ArcwareSection)||void 0===e?void 0:e.parentElement;g&&(null==g||g.removeChild(null==this?void 0:this.ArcwareSection),null==g||g.insertBefore(null==this?void 0:this.ArcwareSection,null==g?void 0:g.firstChild));const m=null===(t=null==this?void 0:this.settingsPanel)||void 0===t?void 0:t.settingsContentElement;if(m){m.style.minWidth="400px";for(const e in removals)TextKeyRegex.test(e)?remove(e,findElementByTextContent(m,e)):remove(e,m.querySelector(e));const e=findElementByTextContent(m,"['Restart Stream'] section > div.setting");if(e){const t=null==e?void 0:e.querySelector("div");t&&(t.textContent="Reconnect to Stream");const n=null==e?void 0:e.querySelector("label > input");n&&(n.value="reconnect")}}{const e=document.createElement("div");null===(n=null==e?void 0:e.classList)||void 0===n||n.add("setting"),e.textContent="Keep in mind, these settings will be applied in your current session only.",e.style.paddingBottom="15px",null===(r=null==this?void 0:this.ArcwareSection)||void 0===r||r.appendChild(e)}null===(i=null==this?void 0:this.ArcwareSection)||void 0===i||i.appendChild(new ot(new ts(null===(s=null==ArcwareApplication?void 0:ArcwareApplication.Flags)||void 0===s?void 0:s.noSession,"Disable SessionId","Disable sessionId based reconnection.",null===(a=null===(o=null==this?void 0:this.stream)||void 0===o?void 0:o.session)||void 0===a?void 0:a.noSession,!0)).rootElement),null===(l=null==this?void 0:this.ArcwareSection)||void 0===l||l.appendChild(new rt(new rs("signalling-url","Signalling URL","Signalling URL",`${null===(d=null===(c=null==this?void 0:this.stream)||void 0===c?void 0:c.config)||void 0===d?void 0:d.getTextSettingValue("ss")}?${null===(p=null===(h=null===(u=null==this?void 0:this.stream)||void 0===u?void 0:u.config)||void 0===h?void 0:h.urlFlags)||void 0===p?void 0:p.slice(1)}`,!1)).rootElement)}createAudioToggleButton(){var e;const t=new AudioButton(null==this?void 0:this.stream),n=(null===(e=null==this?void 0:this.stream)||void 0===e?void 0:e.videoElementParent).parentElement;if(n){const e=null==n?void 0:n.querySelector("#uiFeatures");if(e){const n=null==e?void 0:e.querySelector("#controls");n&&(null==n||n.appendChild(null==t?void 0:t.element))}}}createMicToggleButton(){var e;const t=new MicButton(null==this?void 0:this.stream),n=(null===(e=null==this?void 0:this.stream)||void 0===e?void 0:e.videoElementParent).parentElement;if(n){const e=null==n?void 0:n.querySelector("#uiFeatures");if(e){const n=null==e?void 0:e.querySelector("#controls");n&&(null==n||n.appendChild(null==t?void 0:t.element))}}}createStopButton(){var e,t,n,r;if(!0===(null===(n=null===(t=null===(e=this.stream)||void 0===e?void 0:e.config)||void 0===t?void 0:t.settings)||void 0===n?void 0:n.stopButton)){const e=new StopButton(null==this?void 0:this.stream),t=(null===(r=null==this?void 0:this.stream)||void 0===r?void 0:r.videoElementParent).parentElement;if(t){const n=null==t?void 0:t.querySelector("#uiFeatures");if(n){const t=null==n?void 0:n.querySelector("#controls");t&&(null==t||t.appendChild(null==e?void 0:e.element))}}}}uiDefaultButtonVisibilty(e,t){var n,r,i;if(null==this?void 0:this.parentElement){const s=null===(n=null==this?void 0:this.parentElement)||void 0===n?void 0:n.querySelector(t);if(!1===(null===(i=null===(r=null==this?void 0:this.stream)||void 0===r?void 0:r.config)||void 0===i?void 0:i.settings[e])&&s){null==s||s.remove();const t=this.uiFeaturesElement,n=t.querySelector("#stats-panel"),r=t.querySelector("#settings-panel");t&&("infoButton"===e&&(null==n||n.remove()),"settingsButton"===e&&(null==r||r.remove()))}const o=/iPad|iPhone|iPod/.test(null===navigator||void 0===navigator?void 0:navigator.userAgent);"fullscreenButton"===e&&o&&s&&(null==s||s.remove())}}preventDefaultKeyboardEvents(){this.videoElementParent&&(this.videoElementParent.addEventListener("keydown",(function(e){"Tab"!==e.key&&" "!==e.key&&"Spacebar"!==e.key||(e.preventDefault(),e.stopPropagation())}),!0),this.uiFeaturesElement.querySelectorAll("button").forEach((e=>{e.addEventListener("keydown",(function(t){" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),e.blur())}))})))}autoPlayHandler(e){var t;const{videoPlayer:n}=null==this?void 0:this.webRtcController,r=null===(t=null==e?void 0:e.streamInfo)||void 0===t?void 0:t.autoPlay,i=null==n?void 0:n.isPaused();if(r&&i&&n){const e=null==n?void 0:n.getVideoElement();if(e){const t=null==e?void 0:e.parentElement;if(t){const e=null==t?void 0:t.querySelector("#playOverlay");e&&(null==e||e.remove())}null==e||e.play()}}}getApplicationResponse(e){var t;null===(t=null==this?void 0:this.stream)||void 0===t||t.addResponseEventListener("ue-response",(t=>{e(t)}))}applicationResponse(e){(null==this?void 0:this.responseCallback)&&(null==this||this.responseCallback(e))}applyArcwareStyles(){const e=new st(ArcwareStyles);null==e||e.applyStyleSheet()}emitUIInteraction(e){var t;e&&(null===(t=null==this?void 0:this.webRtcController)||void 0===t||t.emitUIInteraction(e))}addTextToConnectOverlay(){var e,t,n,r;if(!(null===(n=null===(t=null===(e=null==this?void 0:this.stream)||void 0===e?void 0:e.config)||void 0===t?void 0:t.initialSettings)||void 0===n?void 0:n.AutoConnect)&&this.videoElementParent){null===(r=null==this?void 0:this.parentElement)||void 0===r||r.querySelector("#connectOverlay")}}}ArcwareApplication.Flags=(__setFunctionName(_a=class{},"Flags"),_a.noSession="noSession",_a);var descriptor,$$4=_export,uncurryThis$7=functionUncurryThisClause,getOwnPropertyDescriptor$1=objectGetOwnPropertyDescriptor.f,toLength=toLength$3,toString$2=toString$8,notARegExp=notARegexp,requireObjectCoercible$1=requireObjectCoercible$8,correctIsRegExpLogic=correctIsRegexpLogic,nativeStartsWith=uncurryThis$7("".startsWith),stringSlice$2=uncurryThis$7("".slice),min=Math.min,CORRECT_IS_REGEXP_LOGIC=correctIsRegExpLogic("startsWith"),MDN_POLYFILL_BUG=!(CORRECT_IS_REGEXP_LOGIC||(descriptor=getOwnPropertyDescriptor$1(String.prototype,"startsWith"),!descriptor||descriptor.writable));$$4({target:"String",proto:!0,forced:!MDN_POLYFILL_BUG&&!CORRECT_IS_REGEXP_LOGIC},{startsWith:function(e){var t=toString$2(requireObjectCoercible$1(this));notARegExp(e);var n=toLength(min(arguments.length>1?arguments[1]:void 0,t.length)),r=toString$2(e);return nativeStartsWith?nativeStartsWith(t,r,n):stringSlice$2(t,n,n+r.length)===r}});var IteratorPrototype$2,PrototypeOfArrayIteratorPrototype,arrayIterator,iterators={},fails$5=fails$l,correctPrototypeGetter=!fails$5((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),hasOwn$4=hasOwnProperty_1,isCallable$5=isCallable$j,toObject$2=toObject$5,sharedKey=sharedKey$3,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,IE_PROTO=sharedKey("IE_PROTO"),$Object=Object,ObjectPrototype=$Object.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER?$Object.getPrototypeOf:function(e){var t=toObject$2(e);if(hasOwn$4(t,IE_PROTO))return t[IE_PROTO];var n=t.constructor;return isCallable$5(n)&&t instanceof n?n.prototype:t instanceof $Object?ObjectPrototype:null},fails$4=fails$l,isCallable$4=isCallable$j,isObject$1=isObject$8,getPrototypeOf$1=objectGetPrototypeOf,defineBuiltIn$5=defineBuiltIn$8,wellKnownSymbol$7=wellKnownSymbol$g,ITERATOR$6=wellKnownSymbol$7("iterator"),BUGGY_SAFARI_ITERATORS$1=!1;[].keys&&("next"in(arrayIterator=[].keys())?(PrototypeOfArrayIteratorPrototype=getPrototypeOf$1(getPrototypeOf$1(arrayIterator)))!==Object.prototype&&(IteratorPrototype$2=PrototypeOfArrayIteratorPrototype):BUGGY_SAFARI_ITERATORS$1=!0);var NEW_ITERATOR_PROTOTYPE=!isObject$1(IteratorPrototype$2)||fails$4((function(){var e={};return IteratorPrototype$2[ITERATOR$6].call(e)!==e}));NEW_ITERATOR_PROTOTYPE&&(IteratorPrototype$2={}),isCallable$4(IteratorPrototype$2[ITERATOR$6])||defineBuiltIn$5(IteratorPrototype$2,ITERATOR$6,(function(){return this}));var iteratorsCore={IteratorPrototype:IteratorPrototype$2,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1},defineProperty$3=objectDefineProperty.f,hasOwn$3=hasOwnProperty_1,wellKnownSymbol$6=wellKnownSymbol$g,TO_STRING_TAG$1=wellKnownSymbol$6("toStringTag"),setToStringTag$4=function(e,t,n){e&&!n&&(e=e.prototype),e&&!hasOwn$3(e,TO_STRING_TAG$1)&&defineProperty$3(e,TO_STRING_TAG$1,{configurable:!0,value:t})},IteratorPrototype$1=iteratorsCore.IteratorPrototype,create$1=objectCreate,createPropertyDescriptor$2=createPropertyDescriptor$5,setToStringTag$3=setToStringTag$4,Iterators$4=iterators,returnThis$1=function(){return this},iteratorCreateConstructor=function(e,t,n,r){var i=t+" Iterator";return e.prototype=create$1(IteratorPrototype$1,{next:createPropertyDescriptor$2(+!r,n)}),setToStringTag$3(e,i,!1),Iterators$4[i]=returnThis$1,e},uncurryThis$6=functionUncurryThis,aCallable$2=aCallable$4,functionUncurryThisAccessor=function(e,t,n){try{return uncurryThis$6(aCallable$2(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}},isCallable$3=isCallable$j,$String=String,$TypeError$3=TypeError,aPossiblePrototype$1=function(e){if("object"==typeof e||isCallable$3(e))return e;throw $TypeError$3("Can't set "+$String(e)+" as a prototype")},uncurryThisAccessor=functionUncurryThisAccessor,anObject$6=anObject$e,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=uncurryThisAccessor(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return anObject$6(n),aPossiblePrototype(r),t?e(n,r):n.__proto__=r,n}}():void 0),$$3=_export,call$7=functionCall,FunctionName=functionName,isCallable$2=isCallable$j,createIteratorConstructor$1=iteratorCreateConstructor,getPrototypeOf=objectGetPrototypeOf,setPrototypeOf=objectSetPrototypeOf,setToStringTag$2=setToStringTag$4,createNonEnumerableProperty$1=createNonEnumerableProperty$5,defineBuiltIn$4=defineBuiltIn$8,wellKnownSymbol$5=wellKnownSymbol$g,Iterators$3=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME$1=FunctionName.PROPER,CONFIGURABLE_FUNCTION_NAME=FunctionName.CONFIGURABLE,IteratorPrototype=IteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$5=wellKnownSymbol$5("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},iteratorDefine=function(e,t,n,r,i,s,o){createIteratorConstructor$1(n,t,r);var a,l,c,d=function(e){if(e===i&&m)return m;if(!BUGGY_SAFARI_ITERATORS&&e in p)return p[e];switch(e){case KEYS:case VALUES:case ENTRIES:return function(){return new n(this,e)}}return function(){return new n(this)}},u=t+" Iterator",h=!1,p=e.prototype,g=p[ITERATOR$5]||p["@@iterator"]||i&&p[i],m=!BUGGY_SAFARI_ITERATORS&&g||d(i),f="Array"==t&&p.entries||g;if(f&&(a=getPrototypeOf(f.call(new e)))!==Object.prototype&&a.next&&(getPrototypeOf(a)!==IteratorPrototype&&(setPrototypeOf?setPrototypeOf(a,IteratorPrototype):isCallable$2(a[ITERATOR$5])||defineBuiltIn$4(a,ITERATOR$5,returnThis)),setToStringTag$2(a,u,!0)),PROPER_FUNCTION_NAME$1&&i==VALUES&&g&&g.name!==VALUES&&(CONFIGURABLE_FUNCTION_NAME?createNonEnumerableProperty$1(p,"name",VALUES):(h=!0,m=function(){return call$7(g,this)})),i)if(l={values:d(VALUES),keys:s?m:d(KEYS),entries:d(ENTRIES)},o)for(c in l)(BUGGY_SAFARI_ITERATORS||h||!(c in p))&&defineBuiltIn$4(p,c,l[c]);else $$3({target:t,proto:!0,forced:BUGGY_SAFARI_ITERATORS||h},l);return p[ITERATOR$5]!==m&&defineBuiltIn$4(p,ITERATOR$5,m,{name:i}),Iterators$3[t]=m,l},createIterResultObject$2=function(e,t){return{value:e,done:t}},toIndexedObject=toIndexedObject$5,addToUnscopables=addToUnscopables$2,Iterators$2=iterators,InternalStateModule$3=internalState,defineProperty$2=objectDefineProperty.f,defineIterator$1=iteratorDefine,createIterResultObject$1=createIterResultObject$2,DESCRIPTORS$4=descriptors,ARRAY_ITERATOR="Array Iterator",setInternalState$3=InternalStateModule$3.set,getInternalState$1=InternalStateModule$3.getterFor(ARRAY_ITERATOR),es_array_iterator=defineIterator$1(Array,"Array",(function(e,t){setInternalState$3(this,{type:ARRAY_ITERATOR,target:toIndexedObject(e),index:0,kind:t})}),(function(){var e=getInternalState$1(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,createIterResultObject$1(void 0,!0)):createIterResultObject$1("keys"==n?r:"values"==n?t[r]:[r,t[r]],!1)}),"values"),values=Iterators$2.Arguments=Iterators$2.Array;if(addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries"),DESCRIPTORS$4&&"values"!==values.name)try{defineProperty$2(values,"name",{value:"values"})}catch(e){}var domIterables={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},documentCreateElement=documentCreateElement$2,classList=documentCreateElement("span").classList,DOMTokenListPrototype$1=classList&&classList.constructor&&classList.constructor.prototype,domTokenListPrototype=DOMTokenListPrototype$1===Object.prototype?void 0:DOMTokenListPrototype$1,global$3=global$g,DOMIterables=domIterables,DOMTokenListPrototype=domTokenListPrototype,ArrayIteratorMethods=es_array_iterator,createNonEnumerableProperty=createNonEnumerableProperty$5,wellKnownSymbol$4=wellKnownSymbol$g,ITERATOR$4=wellKnownSymbol$4("iterator"),TO_STRING_TAG=wellKnownSymbol$4("toStringTag"),ArrayValues=ArrayIteratorMethods.values,handlePrototype=function(e,t){if(e){if(e[ITERATOR$4]!==ArrayValues)try{createNonEnumerableProperty(e,ITERATOR$4,ArrayValues)}catch(t){e[ITERATOR$4]=ArrayValues}if(e[TO_STRING_TAG]||createNonEnumerableProperty(e,TO_STRING_TAG,t),DOMIterables[t])for(var n in ArrayIteratorMethods)if(e[n]!==ArrayIteratorMethods[n])try{createNonEnumerableProperty(e,n,ArrayIteratorMethods[n])}catch(t){e[n]=ArrayIteratorMethods[n]}}};for(var COLLECTION_NAME in DOMIterables)handlePrototype(global$3[COLLECTION_NAME]&&global$3[COLLECTION_NAME].prototype,COLLECTION_NAME);handlePrototype(DOMTokenListPrototype,"DOMTokenList");var charAt$2=stringMultibyte.charAt,toString$1=toString$8,InternalStateModule$2=internalState,defineIterator=iteratorDefine,createIterResultObject=createIterResultObject$2,STRING_ITERATOR="String Iterator",setInternalState$2=InternalStateModule$2.set,getInternalState=InternalStateModule$2.getterFor(STRING_ITERATOR);defineIterator(String,"String",(function(e){setInternalState$2(this,{type:STRING_ITERATOR,string:toString$1(e),index:0})}),(function(){var e,t=getInternalState(this),n=t.string,r=t.index;return r>=n.length?createIterResultObject(void 0,!0):(e=charAt$2(n,r),t.index+=e.length,createIterResultObject(e,!1))}));var fails$3=fails$l,wellKnownSymbol$3=wellKnownSymbol$g,DESCRIPTORS$3=descriptors,IS_PURE=isPure,ITERATOR$3=wellKnownSymbol$3("iterator"),urlConstructorDetection=!fails$3((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),IS_PURE&&!e.toJSON||!t.size&&(IS_PURE||!DESCRIPTORS$3)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[ITERATOR$3]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),uncurryThis$5=functionUncurryThisClause,aCallable$1=aCallable$4,NATIVE_BIND=functionBindNative,bind$3=functionUncurryThisClause(functionUncurryThisClause.bind),functionBindContext=function(e,t){return aCallable$1(e),void 0===t?e:NATIVE_BIND?bind$3(e,t):function(){return e.apply(t,arguments)}},makeBuiltIn=makeBuiltIn$3.exports,defineProperty$1=objectDefineProperty,defineBuiltInAccessor$2=function(e,t,n){return n.get&&makeBuiltIn(n.get,t,{getter:!0}),n.set&&makeBuiltIn(n.set,t,{setter:!0}),defineProperty$1.f(e,t,n)},isPrototypeOf$1=objectIsPrototypeOf,$TypeError$2=TypeError,anInstance$2=function(e,t){if(isPrototypeOf$1(t,e))return e;throw $TypeError$2("Incorrect invocation")},DESCRIPTORS$2=descriptors,uncurryThis$4=functionUncurryThis,call$6=functionCall,fails$2=fails$l,objectKeys=objectKeys$2,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$1=toObject$5,IndexedObject=indexedObject,$assign=Object.assign,defineProperty=Object.defineProperty,concat=uncurryThis$4([].concat),objectAssign=!$assign||fails$2((function(){if(DESCRIPTORS$2&&1!==$assign({b:1},$assign(defineProperty({},"a",{enumerable:!0,get:function(){defineProperty(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=$assign({},e)[n]||objectKeys($assign({},t)).join("")!=r}))?function(e,t){for(var n=toObject$1(e),r=arguments.length,i=1,s=getOwnPropertySymbolsModule.f,o=propertyIsEnumerableModule.f;r>i;)for(var a,l=IndexedObject(arguments[i++]),c=s?concat(objectKeys(l),s(l)):objectKeys(l),d=c.length,u=0;d>u;)a=c[u++],DESCRIPTORS$2&&!call$6(o,l,a)||(n[a]=l[a]);return n}:$assign,call$5=functionCall,anObject$5=anObject$e,getMethod$2=getMethod$5,iteratorClose$1=function(e,t,n){var r,i;anObject$5(e);try{if(!(r=getMethod$2(e,"return"))){if("throw"===t)throw n;return n}r=call$5(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return anObject$5(r),n},anObject$4=anObject$e,iteratorClose=iteratorClose$1,callWithSafeIterationClosing$1=function(e,t,n,r){try{return r?t(anObject$4(n)[0],n[1]):t(n)}catch(t){iteratorClose(e,"throw",t)}},wellKnownSymbol$2=wellKnownSymbol$g,Iterators$1=iterators,ITERATOR$2=wellKnownSymbol$2("iterator"),ArrayPrototype=Array.prototype,isArrayIteratorMethod$1=function(e){return void 0!==e&&(Iterators$1.Array===e||ArrayPrototype[ITERATOR$2]===e)},uncurryThis$3=functionUncurryThis,fails$1=fails$l,isCallable$1=isCallable$j,classof$2=classof$6,getBuiltIn=getBuiltIn$4,inspectSource=inspectSource$2,noop=function(){},empty=[],construct=getBuiltIn("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$2=uncurryThis$3(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop),isConstructorModern=function(e){if(!isCallable$1(e))return!1;try{return construct(noop,empty,e),!0}catch(e){return!1}},isConstructorLegacy=function(e){if(!isCallable$1(e))return!1;switch(classof$2(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$2(constructorRegExp,inspectSource(e))}catch(e){return!0}};isConstructorLegacy.sham=!0;var isConstructor$1=!construct||fails$1((function(){var e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){e=!0}))||e}))?isConstructorLegacy:isConstructorModern,toPropertyKey=toPropertyKey$3,definePropertyModule=objectDefineProperty,createPropertyDescriptor$1=createPropertyDescriptor$5,createProperty$2=function(e,t,n){var r=toPropertyKey(t);r in e?definePropertyModule.f(e,r,createPropertyDescriptor$1(0,n)):e[r]=n},classof$1=classof$6,getMethod$1=getMethod$5,isNullOrUndefined$1=isNullOrUndefined$5,Iterators=iterators,wellKnownSymbol$1=wellKnownSymbol$g,ITERATOR$1=wellKnownSymbol$1("iterator"),getIteratorMethod$3=function(e){if(!isNullOrUndefined$1(e))return getMethod$1(e,ITERATOR$1)||getMethod$1(e,"@@iterator")||Iterators[classof$1(e)]},call$4=functionCall,aCallable=aCallable$4,anObject$3=anObject$e,tryToString=tryToString$2,getIteratorMethod$2=getIteratorMethod$3,$TypeError$1=TypeError,getIterator$2=function(e,t){var n=arguments.length<2?getIteratorMethod$2(e):t;if(aCallable(n))return anObject$3(call$4(n,e));throw $TypeError$1(tryToString(e)+" is not iterable")},bind$2=functionBindContext,call$3=functionCall,toObject=toObject$5,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod=isArrayIteratorMethod$1,isConstructor=isConstructor$1,lengthOfArrayLike$1=lengthOfArrayLike$3,createProperty$1=createProperty$2,getIterator$1=getIterator$2,getIteratorMethod$1=getIteratorMethod$3,$Array$1=Array,arrayFrom$1=function(e){var t=toObject(e),n=isConstructor(this),r=arguments.length,i=r>1?arguments[1]:void 0,s=void 0!==i;s&&(i=bind$2(i,r>2?arguments[2]:void 0));var o,a,l,c,d,u,h=getIteratorMethod$1(t),p=0;if(!h||this===$Array$1&&isArrayIteratorMethod(h))for(o=lengthOfArrayLike$1(t),a=n?new this(o):$Array$1(o);o>p;p++)u=s?i(t[p],p):t[p],createProperty$1(a,p,u);else for(d=(c=getIterator$1(t,h)).next,a=n?new this:[];!(l=call$3(d,c)).done;p++)u=s?callWithSafeIterationClosing(c,i,[l.value,p],!0):l.value,createProperty$1(a,p,u);return a.length=p,a},toAbsoluteIndex=toAbsoluteIndex$2,lengthOfArrayLike=lengthOfArrayLike$3,createProperty=createProperty$2,$Array=Array,max=Math.max,arraySliceSimple=function(e,t,n){for(var r=lengthOfArrayLike(e),i=toAbsoluteIndex(t,r),s=toAbsoluteIndex(void 0===n?r:n,r),o=$Array(max(s-i,0)),a=0;i=55296&&i<=56319&&n>1,e+=floor$2(e/t);e>baseMinusTMin*tMax>>1;)e=floor$2(e/baseMinusTMin),r+=base;return floor$2(r+(baseMinusTMin+1)*e/(e+skew))},encode=function(e){var t,n,r=[],i=(e=ucs2decode(e)).length,s=initialN,o=0,a=initialBias;for(t=0;t=s&&nfloor$2((maxInt-o)/u))throw $RangeError(OVERFLOW_ERROR);for(o+=(d-s)*u,s=d,t=0;tmaxInt)throw $RangeError(OVERFLOW_ERROR);if(n==s){for(var h=o,p=base;;){var g=p<=a?tMin:p>=a+tMax?tMax:p-a;if(h0;)e[r]=e[--r];r!==s++&&(e[r]=n)}return e},merge=function(e,t,n,r){for(var i=t.length,s=n.length,o=0,a=0;o0?arguments[0]:void 0));DESCRIPTORS$1||(this.length=e.entries.length)},URLSearchParamsPrototype=URLSearchParamsConstructor.prototype;if(defineBuiltIns(URLSearchParamsPrototype,{append:function(e,t){validateArgumentsLength$1(arguments.length,2);var n=getInternalParamsState(this);push$1(n.entries,{key:$toString$2(e),value:$toString$2(t)}),DESCRIPTORS$1||this.length++,n.updateURL()},delete:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this),n=t.entries,r=$toString$2(e),i=0;it.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=getInternalParamsState(this).entries,r=bind$1(e,arguments.length>1?arguments[1]:void 0),i=0;i1?wrapRequestOptions(arguments[1]):{})}}),isCallable(NativeRequest)){var RequestConstructor=function(e){return anInstance$1(this,RequestPrototype),new NativeRequest(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,$$2({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})}}var EOF,web_urlSearchParams_constructor={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},$$1=_export,DESCRIPTORS=descriptors,USE_NATIVE_URL=urlConstructorDetection,global$1=global$g,bind=functionBindContext,uncurryThis=functionUncurryThis,defineBuiltIn$1=defineBuiltIn$8,defineBuiltInAccessor=defineBuiltInAccessor$2,anInstance=anInstance$2,hasOwn$1=hasOwnProperty_1,assign$1=objectAssign,arrayFrom=arrayFrom$1,arraySlice=arraySliceSimple,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString$1=toString$8,setToStringTag=setToStringTag$4,validateArgumentsLength=validateArgumentsLength$2,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule=internalState,setInternalState=InternalStateModule.set,getInternalURLState=InternalStateModule.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=global$1.URL,TypeError$1=global$1.TypeError,parseInt$1=global$1.parseInt,floor=Math.floor,pow=Math.pow,charAt=uncurryThis("".charAt),exec=uncurryThis(/./.exec),join=uncurryThis([].join),numberToString=uncurryThis(1..toString),pop=uncurryThis([].pop),push=uncurryThis([].push),replace=uncurryThis("".replace),shift=uncurryThis([].shift),split=uncurryThis("".split),stringSlice=uncurryThis("".slice),toLowerCase=uncurryThis("".toLowerCase),unshift=uncurryThis([].unshift),INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[a-z]/i,ALPHANUMERIC=/[\d+-.a-z]/i,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\da-f]+$/i,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+/,TRAILING_C0_CONTROL_OR_SPACE=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,TAB_AND_NEW_LINE=/[\t\n\r]/g,parseIPv4=function(e){var t,n,r,i,s,o,a,l=split(e,".");if(l.length&&""==l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(n=[],r=0;r1&&"0"==charAt(i,0)&&(s=exec(HEX_START,i)?16:8,i=stringSlice(i,8==s?1:2)),""===i)o=0;else{if(!exec(10==s?DEC:8==s?OCT:HEX,i))return e;o=parseInt$1(i,s)}push(n,o)}for(r=0;r=pow(256,5-t))return null}else if(o>255)return null;for(a=pop(n),r=0;r6)return;for(r=0;h();){if(i=null,r>0){if(!("."==h()&&r<4))return;u++}if(!exec(DIGIT,h()))return;for(;exec(DIGIT,h());){if(s=parseInt$1(h(),10),null===i)i=s;else{if(0==i)return;i=10*i+s}if(i>255)return;u++}l[c]=256*l[c]+i,2!=++r&&4!=r||c++}if(4!=r)return;break}if(":"==h()){if(u++,!h())return}else if(h())return;l[c++]=t}else{if(null!==d)return;u++,d=++c}}if(null!==d)for(o=c-d,c=7;0!=c&&o>0;)a=l[c],l[c--]=l[d+o-1],l[d+--o]=a;else if(8!=c)return;return l},findLongestZeroSequence=function(e){for(var t=null,n=1,r=null,i=0,s=0;s<8;s++)0!==e[s]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=s),++i);return i>n&&(t=r,n=i),t},serializeHost=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)unshift(t,e%256),e=floor(e/256);return join(t,".")}if("object"==typeof e){for(t="",r=findLongestZeroSequence(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=numberToString(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign$1({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign$1({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign$1({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,t){var n=codeAt(e,0);return n>32&&n<127&&!hasOwn$1(t,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(e,t){var n;return 2==e.length&&exec(ALPHA,charAt(e,0))&&(":"==(n=charAt(e,1))||!t&&"|"==n)},startsWithWindowsDriveLetter=function(e){var t;return e.length>1&&isWindowsDriveLetter(stringSlice(e,0,2))&&(2==e.length||"/"===(t=charAt(e,2))||"\\"===t||"?"===t||"#"===t)},isSingleDot=function(e){return"."===e||"%2e"===toLowerCase(e)},isDoubleDot=function(e){return".."===(e=toLowerCase(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},URLState=function(e,t,n){var r,i,s,o=$toString$1(e);if(t){if(i=this.parse(o))throw TypeError$1(i);this.searchParams=null}else{if(void 0!==n&&(r=new URLState(n,!0)),i=this.parse(o,null,r))throw TypeError$1(i);(s=getInternalSearchParamsState(new URLSearchParams$1)).bindURL(this),this.searchParams=s}};URLState.prototype={type:"URL",parse:function(e,t,n){var r,i,s,o,a=this,l=t||SCHEME_START,c=0,d="",u=!1,h=!1,p=!1;for(e=$toString$1(e),t||(a.scheme="",a.username="",a.password="",a.host=null,a.port=null,a.path=[],a.query=null,a.fragment=null,a.cannotBeABaseURL=!1,e=replace(e,LEADING_C0_CONTROL_OR_SPACE,""),e=replace(e,TRAILING_C0_CONTROL_OR_SPACE,"$1")),e=replace(e,TAB_AND_NEW_LINE,""),r=arrayFrom(e);c<=r.length;){switch(i=r[c],l){case SCHEME_START:if(!i||!exec(ALPHA,i)){if(t)return INVALID_SCHEME;l=NO_SCHEME;continue}d+=toLowerCase(i),l=SCHEME;break;case SCHEME:if(i&&(exec(ALPHANUMERIC,i)||"+"==i||"-"==i||"."==i))d+=toLowerCase(i);else{if(":"!=i){if(t)return INVALID_SCHEME;d="",l=NO_SCHEME,c=0;continue}if(t&&(a.isSpecial()!=hasOwn$1(specialSchemes,d)||"file"==d&&(a.includesCredentials()||null!==a.port)||"file"==a.scheme&&!a.host))return;if(a.scheme=d,t)return void(a.isSpecial()&&specialSchemes[a.scheme]==a.port&&(a.port=null));d="","file"==a.scheme?l=FILE:a.isSpecial()&&n&&n.scheme==a.scheme?l=SPECIAL_RELATIVE_OR_AUTHORITY:a.isSpecial()?l=SPECIAL_AUTHORITY_SLASHES:"/"==r[c+1]?(l=PATH_OR_AUTHORITY,c++):(a.cannotBeABaseURL=!0,push(a.path,""),l=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!n||n.cannotBeABaseURL&&"#"!=i)return INVALID_SCHEME;if(n.cannotBeABaseURL&&"#"==i){a.scheme=n.scheme,a.path=arraySlice(n.path),a.query=n.query,a.fragment="",a.cannotBeABaseURL=!0,l=FRAGMENT;break}l="file"==n.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=i||"/"!=r[c+1]){l=RELATIVE;continue}l=SPECIAL_AUTHORITY_IGNORE_SLASHES,c++;break;case PATH_OR_AUTHORITY:if("/"==i){l=AUTHORITY;break}l=PATH;continue;case RELATIVE:if(a.scheme=n.scheme,i==EOF)a.username=n.username,a.password=n.password,a.host=n.host,a.port=n.port,a.path=arraySlice(n.path),a.query=n.query;else if("/"==i||"\\"==i&&a.isSpecial())l=RELATIVE_SLASH;else if("?"==i)a.username=n.username,a.password=n.password,a.host=n.host,a.port=n.port,a.path=arraySlice(n.path),a.query="",l=QUERY;else{if("#"!=i){a.username=n.username,a.password=n.password,a.host=n.host,a.port=n.port,a.path=arraySlice(n.path),a.path.length--,l=PATH;continue}a.username=n.username,a.password=n.password,a.host=n.host,a.port=n.port,a.path=arraySlice(n.path),a.query=n.query,a.fragment="",l=FRAGMENT}break;case RELATIVE_SLASH:if(!a.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){a.username=n.username,a.password=n.password,a.host=n.host,a.port=n.port,l=PATH;continue}l=AUTHORITY}else l=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(l=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=i||"/"!=charAt(d,c+1))continue;c++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=i&&"\\"!=i){l=AUTHORITY;continue}break;case AUTHORITY:if("@"==i){u&&(d="%40"+d),u=!0,s=arrayFrom(d);for(var g=0;g65535)return INVALID_PORT;a.port=a.isSpecial()&&v===specialSchemes[a.scheme]?null:v,d=""}if(t)return;l=PATH_START;continue}return INVALID_PORT}d+=i;break;case FILE:if(a.scheme="file","/"==i||"\\"==i)l=FILE_SLASH;else{if(!n||"file"!=n.scheme){l=PATH;continue}if(i==EOF)a.host=n.host,a.path=arraySlice(n.path),a.query=n.query;else if("?"==i)a.host=n.host,a.path=arraySlice(n.path),a.query="",l=QUERY;else{if("#"!=i){startsWithWindowsDriveLetter(join(arraySlice(r,c),""))||(a.host=n.host,a.path=arraySlice(n.path),a.shortenPath()),l=PATH;continue}a.host=n.host,a.path=arraySlice(n.path),a.query=n.query,a.fragment="",l=FRAGMENT}}break;case FILE_SLASH:if("/"==i||"\\"==i){l=FILE_HOST;break}n&&"file"==n.scheme&&!startsWithWindowsDriveLetter(join(arraySlice(r,c),""))&&(isWindowsDriveLetter(n.path[0],!0)?push(a.path,n.path[0]):a.host=n.host),l=PATH;continue;case FILE_HOST:if(i==EOF||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&isWindowsDriveLetter(d))l=PATH;else if(""==d){if(a.host="",t)return;l=PATH_START}else{if(o=a.parseHost(d))return o;if("localhost"==a.host&&(a.host=""),t)return;d="",l=PATH_START}continue}d+=i;break;case PATH_START:if(a.isSpecial()){if(l=PATH,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=EOF&&(l=PATH,"/"!=i))continue}else a.fragment="",l=FRAGMENT;else a.query="",l=QUERY;break;case PATH:if(i==EOF||"/"==i||"\\"==i&&a.isSpecial()||!t&&("?"==i||"#"==i)){if(isDoubleDot(d)?(a.shortenPath(),"/"==i||"\\"==i&&a.isSpecial()||push(a.path,"")):isSingleDot(d)?"/"==i||"\\"==i&&a.isSpecial()||push(a.path,""):("file"==a.scheme&&!a.path.length&&isWindowsDriveLetter(d)&&(a.host&&(a.host=""),d=charAt(d,0)+":"),push(a.path,d)),d="","file"==a.scheme&&(i==EOF||"?"==i||"#"==i))for(;a.path.length>1&&""===a.path[0];)shift(a.path);"?"==i?(a.query="",l=QUERY):"#"==i&&(a.fragment="",l=FRAGMENT)}else d+=percentEncode(i,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==i?(a.query="",l=QUERY):"#"==i?(a.fragment="",l=FRAGMENT):i!=EOF&&(a.path[0]+=percentEncode(i,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=i?i!=EOF&&("'"==i&&a.isSpecial()?a.query+="%27":a.query+="#"==i?"%23":percentEncode(i,C0ControlPercentEncodeSet)):(a.fragment="",l=FRAGMENT);break;case FRAGMENT:i!=EOF&&(a.fragment+=percentEncode(i,fragmentPercentEncodeSet))}c++}},parseHost:function(e){var t,n,r;if("["==charAt(e,0)){if("]"!=charAt(e,e.length-1))return INVALID_HOST;if(!(t=parseIPv6(stringSlice(e,1,-1))))return INVALID_HOST;this.host=t}else if(this.isSpecial()){if(e=toASCII(e),exec(FORBIDDEN_HOST_CODE_POINT,e))return INVALID_HOST;if(null===(t=parseIPv4(e)))return INVALID_HOST;this.host=t}else{if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,e))return INVALID_HOST;for(t="",n=arrayFrom(e),r=0;r1?arguments[1]:void 0,r=setInternalState(t,new URLState(e,!1,n));DESCRIPTORS||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())},URLPrototype=URLConstructor.prototype,accessorDescriptor=function(e,t){return{get:function(){return getInternalURLState(this)[e]()},set:t&&function(e){return getInternalURLState(this)[t](e)},configurable:!0,enumerable:!0}};if(DESCRIPTORS&&(defineBuiltInAccessor(URLPrototype,"href",accessorDescriptor("serialize","setHref")),defineBuiltInAccessor(URLPrototype,"origin",accessorDescriptor("getOrigin")),defineBuiltInAccessor(URLPrototype,"protocol",accessorDescriptor("getProtocol","setProtocol")),defineBuiltInAccessor(URLPrototype,"username",accessorDescriptor("getUsername","setUsername")),defineBuiltInAccessor(URLPrototype,"password",accessorDescriptor("getPassword","setPassword")),defineBuiltInAccessor(URLPrototype,"host",accessorDescriptor("getHost","setHost")),defineBuiltInAccessor(URLPrototype,"hostname",accessorDescriptor("getHostname","setHostname")),defineBuiltInAccessor(URLPrototype,"port",accessorDescriptor("getPort","setPort")),defineBuiltInAccessor(URLPrototype,"pathname",accessorDescriptor("getPathname","setPathname")),defineBuiltInAccessor(URLPrototype,"search",accessorDescriptor("getSearch","setSearch")),defineBuiltInAccessor(URLPrototype,"searchParams",accessorDescriptor("getSearchParams")),defineBuiltInAccessor(URLPrototype,"hash",accessorDescriptor("getHash","setHash"))),defineBuiltIn$1(URLPrototype,"toJSON",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),defineBuiltIn$1(URLPrototype,"toString",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&defineBuiltIn$1(URLConstructor,"createObjectURL",bind(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&defineBuiltIn$1(URLConstructor,"revokeObjectURL",bind(nativeRevokeObjectURL,NativeURL))}setToStringTag(URLConstructor,"URL"),$$1({global:!0,constructor:!0,forced:!USE_NATIVE_URL,sham:!DESCRIPTORS},{URL:URLConstructor});var util,objectUtil,sameValue$1=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},call$1=functionCall,fixRegExpWellKnownSymbolLogic=fixRegexpWellKnownSymbolLogic,anObject$1=anObject$e,isNullOrUndefined=isNullOrUndefined$5,requireObjectCoercible=requireObjectCoercible$8,sameValue=sameValue$1,toString=toString$8,getMethod=getMethod$5,regExpExec=regexpExecAbstract;fixRegExpWellKnownSymbolLogic("search",(function(e,t,n){return[function(t){var n=requireObjectCoercible(this),r=isNullOrUndefined(t)?void 0:getMethod(t,e);return r?call$1(r,t,n):new RegExp(t)[e](toString(n))},function(e){var r=anObject$1(this),i=toString(e),s=n(t,r,i);if(s.done)return s.value;var o=r.lastIndex;sameValue(o,0)||(r.lastIndex=0);var a=regExpExec(r,i);return sameValue(r.lastIndex,o)||(r.lastIndex=o),null===a?-1:a.index}]})),function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(util||(util={})),(objectUtil||(objectUtil={})).mergeShapes=(e,t)=>({...e,...t});const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=e=>{switch(typeof e){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(e)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(e)?ZodParsedType.array:null===e?ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;re.message)){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const errorMap=(e,t)=>{let n;switch(e.code){case ZodIssueCode.invalid_type:n=e.received===ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${util.joinValues(e.keys,", ")}`;break;case ZodIssueCode.invalid_union:n="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${util.joinValues(e.options)}`;break;case ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${util.joinValues(e.options)}, received '${e.received}'`;break;case ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case ZodIssueCode.invalid_date:n="Invalid date";break;case ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:util.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case ZodIssueCode.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case ZodIssueCode.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case ZodIssueCode.custom:n="Invalid input";break;case ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ZodIssueCode.not_finite:n="Number must be finite";break;default:n=t.defaultError,util.assertNever(e)}return{message:n}};let overrideErrorMap=errorMap;function setErrorMap(e){overrideErrorMap=e}function getErrorMap(){return overrideErrorMap}const makeIssue=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],o={...i,path:s};let a="";const l=r.filter((e=>!!e)).slice().reverse();for(const e of l)a=e(o,{data:t,defaultError:a}).message;return{...i,path:s,message:i.message||a}},EMPTY_PATH=[];function addIssueToContext(e,t){const n=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e))});e.common.issues.push(n)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return INVALID;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return ParseStatus.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:i}=r;if("aborted"===t.status)return INVALID;if("aborted"===i.status)return INVALID;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"===t.value||void 0===i.value&&!r.alwaysSet||(n[t.value]=i.value)}return{status:e.value,value:n}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=e=>({status:"dirty",value:e}),OK=e=>({status:"valid",value:e}),isAborted=e=>"aborted"===e.status,isDirty=e=>"dirty"===e.status,isValid=e=>"valid"===e.status,isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise;var errorUtil;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(e,t)=>{if(isValid(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ZodError(e.common.issues);return this._error=t,this._error}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError},description:i}}class ZodType{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return getParsedType(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(isAsync(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},i=this._parseSync({data:e,path:r.path,parent:r});return handleResult(r,i)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(isAsync(r)?r:Promise.resolve(r));return handleResult(n,i)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const i=e(t),s=()=>r.addIssue({code:ZodIssueCode.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(s(),!1))):!!i||(s(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:t,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:t,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[a-z][a-z0-9]*$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,ipv6Regex=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,datetimeRegex=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):0===e.precision?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function isValidIP(e,t){return!("v4"!==t&&t||!ipv4Regex.test(e))||!("v6"!==t&&t||!ipv6Regex.test(e))}class ZodString extends ZodType{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ZodParsedType.string){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:t.parsedType}),INVALID}const t=new ParseStatus;let n;for(const r of this._def.checks)if("min"===r.kind)e.data.lengthr.value&&(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const i=e.data.length>r.value,s=e.data.lengthe.test(t)),{validation:t,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(n)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...errorUtil.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...errorUtil.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...errorUtil.errToObj(t)})}nonempty(e){return this.min(1,errorUtil.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuer?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}ZodString.create=e=>{var t;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ZodParsedType.number){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:t.parsedType}),INVALID}let t;const n=new ParseStatus;for(const r of this._def.checks)"int"===r.kind?util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==floatSafeRemainder(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_finite,message:r.message}),n.dirty()):util.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,n,r){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:errorUtil.toString(r)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.valuenew ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ZodParsedType.bigint){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:t.parsedType}),INVALID}let t;const n=new ParseStatus;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):util.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,n,r){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:errorUtil.toString(r)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodBoolean extends ZodType{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:t.parsedType}),INVALID}return OK(e.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodDate extends ZodType{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ZodParsedType.date){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:t.parsedType}),INVALID}if(isNaN(e.data.getTime()))return addIssueToContext(this._getOrReturnCtx(e),{code:ZodIssueCode.invalid_date}),INVALID;const t=new ParseStatus;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()r.value&&(n=this._getOrReturnCtx(e,n),addIssueToContext(n,{code:ZodIssueCode.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):util.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew ZodDate({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:t.parsedType}),INVALID}return OK(e.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:t.parsedType}),INVALID}return OK(e.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.null){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:t.parsedType}),INVALID}return OK(e.data)}}ZodNull.create=e=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(e){return OK(e.data)}}ZodAny.create=e=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(e){return OK(e.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:t.parsedType}),INVALID}}ZodNever.create=e=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:t.parsedType}),INVALID}return OK(e.data)}}ZodVoid.create=e=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==ZodParsedType.array)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:t.parsedType}),INVALID;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.lengthr.maxLength.value&&(addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new ParseInputLazyPath(t,e,t.path,n))))).then((e=>ParseStatus.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new ParseInputLazyPath(t,e,t.path,n))));return ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:errorUtil.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ZodOptional.create(deepPartialify(r))}return new ZodObject({...e._def,shape:()=>t})}return e instanceof ZodArray?new ZodArray({...e._def,type:deepPartialify(e.element)}):e instanceof ZodOptional?ZodOptional.create(deepPartialify(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(deepPartialify(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map((e=>deepPartialify(e)))):e}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(t)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==ZodParsedType.object){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const e in n.data)i.includes(e)||s.push(e);const o=[];for(const e of i){const t=r[e],i=n.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new ParseInputLazyPath(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)o.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)s.length>0&&(addIssueToContext(n,{code:ZodIssueCode.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const r=n.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of o){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>ParseStatus.mergeObjectSync(t,e))):ParseStatus.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,s,o;const a=null!==(s=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==s?s:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=errorUtil.errToObj(e).message)&&void 0!==o?o:a}:{message:a}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(e){const t={};return util.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new ZodObject({...this._def,shape:()=>t})}omit(e){const t={};return util.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new ZodObject({...this._def,shape:()=>t})}deepPartial(){return deepPartialify(this)}partial(e){const t={};return util.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new ZodObject({...this._def,shape:()=>t})}required(e){const t={};return util.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof ZodOptional;)e=e._def.innerType;t[n]=e}})),new ZodObject({...this._def,shape:()=>t})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});class ZodUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new ZodError(e.ctx.common.issues)));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:n}),INVALID}));{let e;const r=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},s=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map((e=>new ZodError(e)));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:i}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?Object.keys(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:null;class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.object)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID;const n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(addIssueToContext(t,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=getDiscriminator(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...processCreateParams(n)})}}function mergeValues(e,t){const n=getParsedType(e),r=getParsedType(t);if(e===t)return{valid:!0,data:e};if(n===ZodParsedType.object&&r===ZodParsedType.object){const n=util.objectKeys(t),r=util.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=mergeValues(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===ZodParsedType.array&&r===ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r{if(isAborted(e)||isAborted(r))return INVALID;const i=mergeValues(e.value,r.value);return i.valid?((isDirty(e)||isDirty(r))&&t.dirty(),{status:t.value,value:i.data}):(addIssueToContext(n,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ZodIntersection.create=(e,t,n)=>new ZodIntersection({left:e,right:t,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(n)});class ZodTuple extends ZodType{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ZodParsedType.array)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:n.parsedType}),INVALID;if(n.data.lengththis._def.items.length&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new ParseInputLazyPath(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>ParseStatus.mergeArray(t,e))):ParseStatus.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ZodParsedType.object)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:n.parsedType}),INVALID;const r=[],i=this._def.keyType,s=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new ParseInputLazyPath(n,e,n.path,e)),value:s._parse(new ParseInputLazyPath(n,n.data[e],n.path,e))});return n.common.async?ParseStatus.mergeObjectAsync(t,r):ParseStatus.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new ZodRecord(t instanceof ZodType?{keyType:e,valueType:t,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(n)}:{keyType:ZodString.create(),valueType:e,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(t)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ZodParsedType.map)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:n.parsedType}),INVALID;const r=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map((([e,t],s)=>({key:r._parse(new ParseInputLazyPath(n,e,n.path,[s,"key"])),value:i._parse(new ParseInputLazyPath(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of s){const r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return INVALID;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of s){const r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return INVALID;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}ZodMap.create=(e,t,n)=>new ZodMap({valueType:t,keyType:e,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(n)});class ZodSet extends ZodType{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ZodParsedType.set)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:n.parsedType}),INVALID;const r=this._def;null!==r.minSize&&n.data.sizer.maxSize.value&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function s(e){const n=new Set;for(const r of e){if("aborted"===r.status)return INVALID;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const o=[...n.data.values()].map(((e,t)=>i._parse(new ParseInputLazyPath(n,e,n.path,t))));return n.common.async?Promise.all(o).then((e=>s(e))):s(o)}min(e,t){return new ZodSet({...this._def,minSize:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodSet({...this._def,maxSize:{value:e,message:errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.function)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:t.parsedType}),INVALID;function n(e,n){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:n}})}function r(e,n){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof ZodPromise){const e=this;return OK((async function(...t){const o=new ZodError([]),a=await e._def.args.parseAsync(t,i).catch((e=>{throw o.addIssue(n(t,e)),o})),l=await Reflect.apply(s,this,a);return await e._def.returns._def.type.parseAsync(l,i).catch((e=>{throw o.addIssue(r(l,e)),o}))}))}{const e=this;return OK((function(...t){const o=e._def.args.safeParse(t,i);if(!o.success)throw new ZodError([n(t,o.error)]);const a=Reflect.apply(s,this,o.data),l=e._def.returns.safeParse(a,i);if(!l.success)throw new ZodError([r(a,l.error)]);return l.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ZodFunction({...this._def,args:ZodTuple.create(e).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ZodFunction({args:e||ZodTuple.create([]).rest(ZodUnknown.create()),returns:t||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(n)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(t)});class ZodLiteral extends ZodType{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function createZodEnum(e,t){return new ZodEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(t)})}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(t)});class ZodEnum extends ZodType{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return addIssueToContext(t,{expected:util.joinValues(n),received:t.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_enum_value,options:n}),INVALID}return OK(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return ZodEnum.create(e)}exclude(e){return ZodEnum.create(this.options.filter((t=>!e.includes(t))))}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(e){const t=util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ZodParsedType.string&&n.parsedType!==ZodParsedType.number){const e=util.objectValues(t);return addIssueToContext(n,{expected:util.joinValues(e),received:n.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(-1===t.indexOf(e.data)){const e=util.objectValues(t);return addIssueToContext(n,{received:n.data,code:ZodIssueCode.invalid_enum_value,options:e}),INVALID}return OK(e.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.promise&&!1===t.common.async)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:t.parsedType}),INVALID;const n=t.parsedType===ZodParsedType.promise?t.data:Promise.resolve(t.data);return OK(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{addIssueToContext(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===r.type){const e=r.transform(n.data,i);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?INVALID:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?INVALID:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!isValid(e))return e;const s=r.transform(e.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>isValid(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}util.assertNever(r)}}ZodEffects.create=(e,t,n)=>new ZodEffects({schema:e,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:t,...processCreateParams(n)}),ZodEffects.createWithPreprocess=(e,t,n)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(n)});class ZodOptional extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(t)});class ZodNullable extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.null?OK(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(t)});class ZodDefault extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...processCreateParams(t)});class ZodCatch extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return isAsync(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...processCreateParams(t)});class ZodNaN extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.nan){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:t.parsedType}),INVALID}return{status:"valid",value:e.data}}}ZodNaN.create=e=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(e)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),DIRTY(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new ZodPipeline({in:e,out:t,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(e){const t=this._def.innerType._parse(e);return isValid(t)&&(t.value=Object.freeze(t.value)),t}}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(t)});const custom=(e,t={},n)=>e?ZodAny.create().superRefine(((r,i)=>{var s,o;if(!e(r)){const e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,a=null===(o=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===o||o,l="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...l,fatal:a})}})):ZodAny.create(),late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(e,t={message:`Input not instance of ${e.name}`})=>custom((t=>t instanceof e),t),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:e=>ZodString.create({...e,coerce:!0}),number:e=>ZodNumber.create({...e,coerce:!0}),boolean:e=>ZodBoolean.create({...e,coerce:!0}),bigint:e=>ZodBigInt.create({...e,coerce:!0}),date:e=>ZodDate.create({...e,coerce:!0})},NEVER=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap:setErrorMap,getErrorMap:getErrorMap,makeIssue:makeIssue,EMPTY_PATH:EMPTY_PATH,addIssueToContext:addIssueToContext,ParseStatus:ParseStatus,INVALID:INVALID,DIRTY:DIRTY,OK:OK,isAborted:isAborted,isDirty:isDirty,isValid:isValid,isAsync:isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType:ZodParsedType,getParsedType:getParsedType,ZodType:ZodType,ZodString:ZodString,ZodNumber:ZodNumber,ZodBigInt:ZodBigInt,ZodBoolean:ZodBoolean,ZodDate:ZodDate,ZodSymbol:ZodSymbol,ZodUndefined:ZodUndefined,ZodNull:ZodNull,ZodAny:ZodAny,ZodUnknown:ZodUnknown,ZodNever:ZodNever,ZodVoid:ZodVoid,ZodArray:ZodArray,ZodObject:ZodObject,ZodUnion:ZodUnion,ZodDiscriminatedUnion:ZodDiscriminatedUnion,ZodIntersection:ZodIntersection,ZodTuple:ZodTuple,ZodRecord:ZodRecord,ZodMap:ZodMap,ZodSet:ZodSet,ZodFunction:ZodFunction,ZodLazy:ZodLazy,ZodLiteral:ZodLiteral,ZodEnum:ZodEnum,ZodNativeEnum:ZodNativeEnum,ZodPromise:ZodPromise,ZodEffects:ZodEffects,ZodTransformer:ZodEffects,ZodOptional:ZodOptional,ZodNullable:ZodNullable,ZodDefault:ZodDefault,ZodCatch:ZodCatch,ZodNaN:ZodNaN,BRAND:BRAND,ZodBranded:ZodBranded,ZodPipeline:ZodPipeline,ZodReadonly:ZodReadonly,custom:custom,Schema:ZodType,ZodSchema:ZodType,late:late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce:coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean:oboolean,onumber:onumber,optional:optionalType,ostring:ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER:NEVER,ZodIssueCode:ZodIssueCode,quotelessJson:quotelessJson,ZodError:ZodError});const ZSession=z.object({id:z.string().min(1),created:z.date().or(z.string()).transform((e=>moment(e).toDate())),expire:z.boolean().default(!1).optional()}).strict(),ZOptions=z.object({localStorageKey:z.string().min(3).default("pxss"),keepSession:z.number().int().min(3).default(10)});class Session{get current(){return this._current}get noSession(){return new URLSearchParams(window.location.search).has("noSession")}get id(){if(this.noSession)return null;const e=window.localStorage.getItem(this.localStorageKey);if(null===e)return null;const t=ZSession.safeParse(JSON.parse(e));if(!t.success)return this.unset(),null;const n=t.data;return moment(n.created).add(this.options.keepSession,"seconds").isBefore(moment())?(this.unset(),null):n.id}get localStorageKey(){return this.options.localStorageKey}constructor(e){this.options=ZOptions.parse(e||{})}set(e){ZSession.shape.id.parse(e),this._current=e;const t={id:e,created:moment().toDate(),expire:!1};window.localStorage.setItem(this.localStorageKey,JSON.stringify(t))}unset(){window.localStorage.removeItem(this.localStorageKey)}}const ZErrorMessage=z.object({type:z.literal("error"),code:z.number().int(),reason:z.string(),verbosity:z.number()}),ZLoveLetter=z.object({type:z.literal("letter"),reason:z.string().startsWith("LL: "),code:z.number(),verbosity:z.number()}),ZSessionId=z.object({type:z.literal("sessionId"),sessionId:z.string()}),disabledDisclaimer="Disabled",WebSdkSettings=z.object({conf:z.object({fullscreenButton:z.boolean().default(!0).describe(["Full-Screen Button|","Override Enable/Disable Enable/Disable the full-screen button.","Info: Please be aware that iOS (iPhone devices) does not support full-screen mode, and as a result, the button will not be displayed on these devices."].join("\n")).optional(),stopButton:z.boolean().default(!0).describe(["Stop Button|","Override Enable/Disable the stop overlay-button."].join("\n")).optional(),audioButton:z.boolean().default(!1).describe(["Audio Button|","Override Enable/Disable the audio overlay-button."].join("\n")).optional(),infoButton:z.boolean().default(!1).describe(["Info Button|","Override Enable/Disable the info overlay-button."].join("\n")).optional(),micButton:z.boolean().default(!1).describe(["Mic Button|","Override Enable/Disable the microphone overlay-button.",disabledDisclaimer].join("\n")).optional(),settingsButton:z.boolean().default(!1).describe(["Settings Button|","Override Enable/Disable the settings overlay-button."].join("\n")).optional(),connectionStrengthIcon:z.boolean().default(!1).describe(["Connection Strength|","Override Enable/Disable the connection strength overlay-icon."].join("\n")).optional()}).optional(),init:z.object({KeyboardInput:z.boolean().default(!0).describe(["Keyboard Input|","Override 'KeyboardInput' property of the WebSDK integration.","Info: Allows keyboard input events."].join("\n")).optional(),MouseInput:z.boolean().default(!0).describe(["Mouse Input|","Override 'MouseInput' property of the WebSDK integration.","Info: Allows mouse input events."].join("\n")).optional(),GamepadInput:z.boolean().describe(["Game pad Input|","Override 'GamepadInput' property of the WebSDK integration.","Info: Allows input events from gamepad controllers.",disabledDisclaimer].join("\n")).optional(),TouchInput:z.boolean().describe(["Touch Input|","Override 'TouchInput' property of the WebSDK integration.","Info: Allows touch events on mobile devices and tablets."].join("\n")).optional(),XRControllerInput:z.boolean().describe(["XR Controller Input|","Override 'XRControllerInput' property of the WebSDK integration.","Info: Allows input events from XR controllers for use with AR and VR setups.",disabledDisclaimer].join("\n")).optional(),FakeMouseWithTouches:z.boolean().describe(["Fake mouse with touches|","Override 'FakeMouseWithTouches' property of the WebSDK integration."].join("\n")).optional(),ForceMonoAudio:z.boolean().describe(["Force mono audio|","Override 'ForceMonoAudio' of the WebSDK integration."].join("\n")).optional(),HoveringMouse:z.boolean().describe(["Hovering mouse|","Override 'HoveringMouse' property of the WebSDK integration."].join("\n")).optional()}).optional()}).strict(),ZStreamInfo=z.object({type:z.literal("streamInfo"),streamInfo:z.object({guid:z.string(),autoPlay:z.boolean().optional(),touchCapable:z.boolean().optional(),resolution:z.object({width:z.number().int().nonnegative(),height:z.number().int().nonnegative(),dynamic:z.boolean().optional(),fixed:z.boolean().optional()}).optional(),meta:z.object({friendlyName:z.string().optional(),isTrial:z.boolean().optional(),mouseLock:z.boolean().optional(),poweredBy:z.boolean().optional(),ueVersion:z.string().optional(),version:z.string().optional()}).optional(),webSdkSettings:WebSdkSettings.optional(),afk:z.object({enabled:z.boolean().describe("Enables / Disables AFK functionality."),warn:z.number().int().nonnegative().describe("Time in seconds, after last interaction, when the first warning will be triggered."),error:z.number().int().nonnegative().describe("Time in seconds, after warn trigger, when a more pushy warning will be triggered."),action:z.number().int().nonnegative().describe("Time in seconds, after error trigger, the actual disconnection action will take place.")},{description:"AFK stands for 'away from keyboard'"}).optional()})}),ZStats=z.object({type:z.literal("stats"),stats:z.object({codecs:z.custom(),candidatePair:z.custom(),localCandidates:z.custom(),remoteCandidates:z.custom(),DataChannelStats:z.custom(),bytesReceived:z.number(),packetsLost:z.number(),frameWidth:z.number(),frameHeight:z.number(),framesDecoded:z.number(),framesPerSecond:z.number(),framesDropped:z.number(),videoCodec:z.string(),audioCodec:z.string(),browserInfo:z.object({userAgent:z.string(),platform:z.string().nullable(),language:z.string()}).passthrough().partial(),currentRTT:z.number(),sessionRunTime:z.string(),controlsStreamInput:z.string().refine((e=>"true"===e||"false"===e)),videoEncoderAvgQP:z.number(),videoBitrate:z.number(),audioBitrate:z.number()}).passthrough().partial()}),ZPing=z.object({type:z.literal("ping"),message:z.string()}),ZQueue=z.object({type:z.literal("queue"),queue:z.object({index:z.number().int().optional(),queueLength:z.number().int().optional(),waited:z.number().optional(),estimatedWaitTime:z.number().optional(),averageWaitTime:z.number().optional(),valueType:z.enum(["milliseconds","seconds","minutes","hours","days"])})}),ZVersion=z.object({type:z.literal("version"),version:z.string().optional()}),Send={stats:ZStats},ArcwareSettingsSchema=z.object({session:z.string().optional(),token:z.string().optional(),bypass:z.boolean().optional(),errorHandler:z.function().args(ZErrorMessage).returns(z.void()).optional(),queueHandler:z.function().args(ZQueue).returns(z.void()).optional(),sessionIdHandler:z.function().args(z.string()).returns(z.void()).optional(),loveLetterHandler:z.function().args(ZLoveLetter).returns(z.void()).optional(),fullscreenButton:z.boolean().optional(),settingsButton:z.boolean().optional(),infoButton:z.boolean().optional(),audioButton:z.boolean().optional(),micButton:z.boolean().optional(),stopButton:z.boolean().optional(),connectionStrengthIcon:z.boolean().optional(),shareId:z.string().startsWith("share-").optional(),projectId:z.string().optional(),loveLetterLogging:z.boolean().optional(),connectionIdentifierLoggingDisabled:z.boolean().optional()}),DefaultUrl="wss://signalling-client.ragnarok.arcware.cloud";Vt.Log=(e,t,n)=>{},Vt.Info=(e,t,n)=>{},Vt.Warning=(e,t,n)=>{console.warn(t,e)},Vt.Error=(e,t,n)=>{(null==t?void 0:t.startsWith("unhandled Stat Type"))||console.error(t,e)};class ArcwareConfig extends Pt{static PickIdsOfUrl(){const{pathname:e}=new URL(window.location.href),t=e.split("/");return{projectId:t.find((e=>z.string().uuid().safeParse(e).success)),shareId:t.find((e=>z.string().startsWith("share-").safeParse(e).success))}}constructor(e){var t,n;if(!new URL(window.location.href).search.slice(1).split("&").find((e=>e.startsWith("df-")))&&!e.settings.shareId&&!e.settings.projectId)throw new Error("ShareId or ProjectId must be specified.");const r=ArcwareSettingsSchema.parse(e.settings);e.initialSettings||(e.initialSettings={}),(null===(t=e.initialSettings)||void 0===t?void 0:t.hasOwnProperty("AutoConnect"))||(e.initialSettings.AutoConnect=!1),(null===(n=e.initialSettings)||void 0===n?void 0:n.hasOwnProperty("AFKTimeout"))||(e.initialSettings.AFKTimeout=600),e.initialSettings.ss||(e.initialSettings.ss=DefaultUrl),super(e),this.VERSION="0.1.9",this.settings=r,this.session=new Session,this._initialSettings=e.initialSettings,this.setFlagEnabled(Ot.AFKDetection,!0),this.setFlagEnabled(Ot.BrowserSendOffer,!0)}get urlFlags(){var e;let t="";if(this.settings.shareId&&(t+=`&sh=${this.settings.shareId}`),this.settings.projectId&&(t+=`&p=${this.settings.projectId}`),"string"==typeof this.settings.session)t+=`&s=${this.settings.session}`;else{const e=this.session.id;e&&(t+=`&s=${e}`,t+="&r=true")}this.settings.bypass&&(t+="&b=true"),this.settings.token&&(t+=`&t=${this.settings.token}`);const n=null!==(e=new URLSearchParams(window.location.search).get("rId"))&&void 0!==e?e:void 0;n&&(t+=`&rId=${n}`);const r=new URL(window.location.href).search.slice(1).split("&").find((e=>e.startsWith("df-")));return r&&(t+=`&${r}`),t}get initialSettings(){return this._initialSettings}modifyInitialSettings(e){this.setFlagEnabled(Ot.HoveringMouseMode,e)}}var call=functionCall,hasOwn=hasOwnProperty_1,isPrototypeOf=objectIsPrototypeOf,regExpFlags=regexpFlags$1,RegExpPrototype$1=RegExp.prototype,regexpGetFlags=function(e){var t=e.flags;return void 0!==t||"flags"in RegExpPrototype$1||hasOwn(e,"flags")||!isPrototypeOf(RegExpPrototype$1,e)?t:call(regExpFlags,e)},PROPER_FUNCTION_NAME=functionName.PROPER,defineBuiltIn=defineBuiltIn$8,anObject=anObject$e,$toString=toString$8,fails=fails$l,getRegExpFlags=regexpGetFlags,TO_STRING="toString",RegExpPrototype=RegExp.prototype,nativeToString=RegExpPrototype[TO_STRING],NOT_GENERIC=fails((function(){return"/a/b"!=nativeToString.call({source:"a",flags:"b"})})),INCORRECT_NAME=PROPER_FUNCTION_NAME&&nativeToString.name!=TO_STRING;function UrlBuilder(e,t){const n=new URL(decodeURIComponent(e())),r=n.searchParams;let i=t;return i&&(i.startsWith("?")&&(i=i.substring(1)),i.split("&").forEach((e=>{const[t,n]=e.split("=");r.append(t,n)}))),n.toString()}function ApplyUrlHack(){const e=jt.prototype.setWebRtcPlayerController;jt.prototype.setWebRtcPlayerController=function(t){const n=t.signallingUrlBuilder;t.signallingUrlBuilder=()=>UrlBuilder(n,this.config.urlFlags),e.call(this,t)}}(NOT_GENERIC||INCORRECT_NAME)&&defineBuiltIn(RegExp.prototype,TO_STRING,(function(){var e=anObject(this);return"/"+$toString(e.source)+"/"+$toString(getRegExpFlags(e))}),{unsafe:!0});class EventHandler{add(e){return this.callbacks.find((t=>t===e))?null:(this.callbacks.push(e),e)}remove(e){const t=this.callbacks.find((t=>t===e));return t&&this.callbacks.splice(this.callbacks.indexOf(t),1),!!t}constructor(){this.callbacks=new Array}static Emit(e,t){e.callbacks.forEach((e=>e(t)))}}function Stats(e){return ZStats.shape.stats.parse({codecs:e.codecs,candidatePair:e.candidatePair,localCandidates:e.localCandidates,remoteCandidates:e.remoteCandidates,DataChannelStats:e.DataChannelStats,bytesReceived:e.inboundVideoStats.bytesReceived,packetsLost:e.inboundVideoStats.packetsLost,frameWidth:e.inboundVideoStats.frameWidth,frameHeight:e.inboundVideoStats.frameHeight,framesDecoded:e.inboundVideoStats.framesDecoded,framesPerSecond:e.inboundVideoStats.framesPerSecond,framesDropped:e.inboundVideoStats.framesDropped,videoCodec:e.inboundVideoStats.codecId,audioCodec:e.inboundAudioStats.codecId,browserInfo:{userAgent:navigator.userAgent,platform:navigator.oscpu||navigator.platform||null,language:navigator.language},currentRTT:e.candidatePair.currentRoundTripTime,sessionRunTime:e.sessionStats.runTime,controlsStreamInput:e.sessionStats.controlsStreamInput,videoEncoderAvgQP:e.sessionStats.videoEncoderAvgQP,videoBitrate:e.inboundVideoStats.bitrate,audioBitrate:e.inboundAudioStats.bitrate})}var lodash={exports:{}}; /** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */!function(e,t){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",o=32,a=128,l=1/0,c=9007199254740991,d=NaN,u=4294967295,h=[["ary",a],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",o],["partialRight",64],["rearg",256]],p="[object Arguments]",g="[object Array]",m="[object Boolean]",f="[object Date]",v="[object Error]",y="[object Function]",S="[object GeneratorFunction]",b="[object Map]",C="[object Number]",T="[object Object]",E="[object Promise]",w="[object RegExp]",_="[object Set]",$="[object String]",P="[object Symbol]",I="[object WeakMap]",x="[object ArrayBuffer]",R="[object DataView]",O="[object Float32Array]",A="[object Float64Array]",L="[object Int8Array]",k="[object Int16Array]",M="[object Int32Array]",N="[object Uint8Array]",U="[object Uint8ClampedArray]",D="[object Uint16Array]",F="[object Uint32Array]",B=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,Z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,V=RegExp(z.source),G=RegExp(H.source),W=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y=/^\w*$/,X=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,J=/[\\^$.*+?()[\]{}|]/g,ee=RegExp(J.source),te=/^\s+/,ne=/\s/,re=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,oe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ae=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,ue=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,pe=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,fe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,ye=/['\n\r\u2028\u2029\\]/g,Se="\\ud800-\\udfff",be="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Te="a-z\\xdf-\\xf6\\xf8-\\xff",Ee="A-Z\\xc0-\\xd6\\xd8-\\xde",we="\\ufe0e\\ufe0f",_e="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$e="["+Se+"]",Pe="["+_e+"]",Ie="["+be+"]",xe="\\d+",Re="["+Ce+"]",Oe="["+Te+"]",Ae="[^"+Se+_e+xe+Ce+Te+Ee+"]",Le="\\ud83c[\\udffb-\\udfff]",ke="[^"+Se+"]",Me="(?:\\ud83c[\\udde6-\\uddff]){2}",Ne="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Ee+"]",De="\\u200d",Fe="(?:"+Oe+"|"+Ae+")",Be="(?:"+Ue+"|"+Ae+")",je="(?:['’](?:d|ll|m|re|s|t|ve))?",Ze="(?:['’](?:D|LL|M|RE|S|T|VE))?",ze="(?:"+Ie+"|"+Le+")?",He="["+we+"]?",Ve=He+ze+"(?:"+De+"(?:"+[ke,Me,Ne].join("|")+")"+He+ze+")*",Ge="(?:"+[Re,Me,Ne].join("|")+")"+Ve,We="(?:"+[ke+Ie+"?",Ie,Me,Ne,$e].join("|")+")",Ke=RegExp("['’]","g"),qe=RegExp(Ie,"g"),Qe=RegExp(Le+"(?="+Le+")|"+We+Ve,"g"),Ye=RegExp([Ue+"?"+Oe+"+"+je+"(?="+[Pe,Ue,"$"].join("|")+")",Be+"+"+Ze+"(?="+[Pe,Ue+Fe,"$"].join("|")+")",Ue+"?"+Fe+"+"+je,Ue+"+"+Ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xe,Ge].join("|"),"g"),Xe=RegExp("["+De+Se+be+we+"]"),Je=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,et=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tt=-1,nt={};nt[O]=nt[A]=nt[L]=nt[k]=nt[M]=nt[N]=nt[U]=nt[D]=nt[F]=!0,nt[p]=nt[g]=nt[x]=nt[m]=nt[R]=nt[f]=nt[v]=nt[y]=nt[b]=nt[C]=nt[T]=nt[w]=nt[_]=nt[$]=nt[I]=!1;var rt={};rt[p]=rt[g]=rt[x]=rt[R]=rt[m]=rt[f]=rt[O]=rt[A]=rt[L]=rt[k]=rt[M]=rt[b]=rt[C]=rt[T]=rt[w]=rt[_]=rt[$]=rt[P]=rt[N]=rt[U]=rt[D]=rt[F]=!0,rt[v]=rt[y]=rt[I]=!1;var it={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,ot=parseInt,at="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,lt="object"==typeof self&&self&&self.Object===Object&&self,ct=at||lt||Function("return this")(),dt=t&&!t.nodeType&&t,ut=dt&&e&&!e.nodeType&&e,ht=ut&&ut.exports===dt,pt=ht&&at.process,gt=function(){try{return ut&&ut.require&&ut.require("util").types||pt&&pt.binding&&pt.binding("util")}catch(e){}}(),mt=gt&>.isArrayBuffer,ft=gt&>.isDate,vt=gt&>.isMap,yt=gt&>.isRegExp,St=gt&>.isSet,bt=gt&>.isTypedArray;function Ct(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Tt(e,t,n,r){for(var i=-1,s=null==e?0:e.length;++i-1}function It(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Yt(e,t){for(var n=e.length;n--&&Ut(t,e[n],0)>-1;);return n}var Xt=Zt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Jt=Zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function en(e){return"\\"+it[e]}function tn(e){return Xe.test(e)}function nn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function rn(e,t){return function(n){return e(t(n))}}function sn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"}),un=function e(t){var ne=(t=null==t?ct:un.defaults(ct.Object(),t,un.pick(ct,et))).Array,Se=t.Date,be=t.Error,Ce=t.Function,Te=t.Math,Ee=t.Object,we=t.RegExp,_e=t.String,$e=t.TypeError,Pe=ne.prototype,Ie=Ce.prototype,xe=Ee.prototype,Re=t["__core-js_shared__"],Oe=Ie.toString,Ae=xe.hasOwnProperty,Le=0,ke=function(){var e=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Me=xe.toString,Ne=Oe.call(Ee),Ue=ct._,De=we("^"+Oe.call(Ae).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fe=ht?t.Buffer:n,Be=t.Symbol,je=t.Uint8Array,Ze=Fe?Fe.allocUnsafe:n,ze=rn(Ee.getPrototypeOf,Ee),He=Ee.create,Ve=xe.propertyIsEnumerable,Ge=Pe.splice,We=Be?Be.isConcatSpreadable:n,Qe=Be?Be.iterator:n,Xe=Be?Be.toStringTag:n,it=function(){try{var e=os(Ee,"defineProperty");return e({},"",{}),e}catch(e){}}(),at=t.clearTimeout!==ct.clearTimeout&&t.clearTimeout,lt=Se&&Se.now!==ct.Date.now&&Se.now,dt=t.setTimeout!==ct.setTimeout&&t.setTimeout,ut=Te.ceil,pt=Te.floor,gt=Ee.getOwnPropertySymbols,kt=Fe?Fe.isBuffer:n,Zt=t.isFinite,hn=Pe.join,pn=rn(Ee.keys,Ee),gn=Te.max,mn=Te.min,fn=Se.now,vn=t.parseInt,yn=Te.random,Sn=Pe.reverse,bn=os(t,"DataView"),Cn=os(t,"Map"),Tn=os(t,"Promise"),En=os(t,"Set"),wn=os(t,"WeakMap"),_n=os(Ee,"create"),$n=wn&&new wn,Pn={},In=As(bn),xn=As(Cn),Rn=As(Tn),On=As(En),An=As(wn),Ln=Be?Be.prototype:n,kn=Ln?Ln.valueOf:n,Mn=Ln?Ln.toString:n;function Nn(e){if(Qo(e)&&!Fo(e)&&!(e instanceof Bn)){if(e instanceof Fn)return e;if(Ae.call(e,"__wrapped__"))return Ls(e)}return new Fn(e)}var Un=function(){function e(){}return function(t){if(!qo(t))return{};if(He)return He(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Dn(){}function Fn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Bn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=u,this.__views__=[]}function jn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ir(e,t,r,i,s,o){var a,l=1&t,c=2&t,d=4&t;if(r&&(a=s?r(e,i,s,o):r(e)),a!==n)return a;if(!qo(e))return e;var u=Fo(e);if(u){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ae.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return wi(e,a)}else{var h=cs(e),g=h==y||h==S;if(zo(e))return yi(e,l);if(h==T||h==p||g&&!s){if(a=c||g?{}:us(e),!l)return c?function(e,t){return _i(e,ls(e),t)}(e,function(e,t){return e&&_i(t,Pa(t),e)}(a,e)):function(e,t){return _i(e,as(e),t)}(e,er(a,e))}else{if(!rt[h])return s?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case x:return Si(e);case m:case f:return new i(+e);case R:return function(e,t){var n=t?Si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case O:case A:case L:case k:case M:case N:case U:case D:case F:return bi(e,n);case b:return new i;case C:case $:return new i(e);case w:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case _:return new i;case P:return r=e,kn?Ee(kn.call(r)):{}}}(e,h,l)}}o||(o=new Vn);var v=o.get(e);if(v)return v;o.set(e,a),ta(e)?e.forEach((function(n){a.add(ir(n,t,r,n,e,o))})):Yo(e)&&e.forEach((function(n,i){a.set(i,ir(n,t,r,i,e,o))}));var E=u?n:(d?c?Ji:Xi:c?Pa:$a)(e);return Et(E||e,(function(n,i){E&&(n=e[i=n]),Yn(a,i,ir(n,t,r,i,e,o))})),a}function sr(e,t,r){var i=r.length;if(null==e)return!i;for(e=Ee(e);i--;){var s=r[i],o=t[s],a=e[s];if(a===n&&!(s in e)||!o(a))return!1}return!0}function or(e,t,i){if("function"!=typeof e)throw new $e(r);return _s((function(){e.apply(n,i)}),t)}function ar(e,t,n,r){var i=-1,s=Pt,o=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=xt(t,Wt(n))),r?(s=It,o=!1):t.length>=200&&(s=qt,o=!1,t=new Hn(t));e:for(;++i-1},Zn.prototype.set=function(e,t){var n=this.__data__,r=Xn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},zn.prototype.clear=function(){this.size=0,this.__data__={hash:new jn,map:new(Cn||Zn),string:new jn}},zn.prototype.delete=function(e){var t=is(this,e).delete(e);return this.size-=t?1:0,t},zn.prototype.get=function(e){return is(this,e).get(e)},zn.prototype.has=function(e){return is(this,e).has(e)},zn.prototype.set=function(e,t){var n=is(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Hn.prototype.add=Hn.prototype.push=function(e){return this.__data__.set(e,i),this},Hn.prototype.has=function(e){return this.__data__.has(e)},Vn.prototype.clear=function(){this.__data__=new Zn,this.size=0},Vn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Vn.prototype.get=function(e){return this.__data__.get(e)},Vn.prototype.has=function(e){return this.__data__.has(e)},Vn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Zn){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new zn(r)}return n.set(e,t),this.size=n.size,this};var lr=Ii(fr),cr=Ii(vr,!0);function dr(e,t){var n=!0;return lr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function ur(e,t,r){for(var i=-1,s=e.length;++i0&&n(a)?t>1?pr(a,t-1,n,r,i):Rt(i,a):r||(i[i.length]=a)}return i}var gr=xi(),mr=xi(!0);function fr(e,t){return e&&gr(e,t,$a)}function vr(e,t){return e&&mr(e,t,$a)}function yr(e,t){return $t(t,(function(t){return Go(e[t])}))}function Sr(e,t){for(var r=0,i=(t=gi(t,e)).length;null!=e&&rt}function Er(e,t){return null!=e&&Ae.call(e,t)}function wr(e,t){return null!=e&&t in Ee(e)}function _r(e,t,r){for(var i=r?It:Pt,s=e[0].length,o=e.length,a=o,l=ne(o),c=1/0,d=[];a--;){var u=e[a];a&&t&&(u=xt(u,Wt(t))),c=mn(u.length,c),l[a]=!r&&(t||s>=120&&u.length>=120)?new Hn(a&&u):n}u=e[0];var h=-1,p=l[0];e:for(;++h=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Br(e,t,n){for(var r=-1,i=t.length,s={};++r-1;)a!==e&&Ge.call(a,l,1),Ge.call(e,l,1);return e}function Zr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==s){var s=i;ps(i)?Ge.call(e,i,1):oi(e,i)}}return e}function zr(e,t){return e+pt(yn()*(t-e+1))}function Hr(e,t){var n="";if(!e||t<1||t>c)return n;do{t%2&&(n+=e),(t=pt(t/2))&&(e+=e)}while(t);return n}function Vr(e,t){return $s(Cs(e,t,Xa),e+"")}function Gr(e){return Wn(Ma(e))}function Wr(e,t){var n=Ma(e);return xs(n,rr(t,0,n.length))}function Kr(e,t,r,i){if(!qo(e))return e;for(var s=-1,o=(t=gi(t,e)).length,a=o-1,l=e;null!=l&&++si?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=ne(i);++r>>1,o=e[s];null!==o&&!ra(o)&&(n?o<=t:o=200){var c=t?null:Hi(e);if(c)return on(c);o=!1,i=qt,l=new Hn}else l=t?[]:a;e:for(;++r=i?e:Xr(e,t,r)}var vi=at||function(e){return ct.clearTimeout(e)};function yi(e,t){if(t)return e.slice();var n=e.length,r=Ze?Ze(n):new e.constructor(n);return e.copy(r),r}function Si(e){var t=new e.constructor(e.byteLength);return new je(t).set(new je(e)),t}function bi(e,t){var n=t?Si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ci(e,t){if(e!==t){var r=e!==n,i=null===e,s=e==e,o=ra(e),a=t!==n,l=null===t,c=t==t,d=ra(t);if(!l&&!d&&!o&&e>t||o&&a&&c&&!l&&!d||i&&a&&c||!r&&c||!s)return 1;if(!i&&!o&&!d&&e1?r[s-1]:n,a=s>2?r[2]:n;for(o=e.length>3&&"function"==typeof o?(s--,o):n,a&&gs(r[0],r[1],a)&&(o=s<3?n:o,s=1),t=Ee(t);++i-1?s[o?t[a]:a]:n}}function ki(e){return Yi((function(t){var i=t.length,s=i,o=Fn.prototype.thru;for(e&&t.reverse();s--;){var a=t[s];if("function"!=typeof a)throw new $e(r);if(o&&!l&&"wrapper"==ts(a))var l=new Fn([],!0)}for(s=l?s:i;++s1&&S.reverse(),h&&dl))return!1;var d=o.get(e),u=o.get(t);if(d&&u)return d==t&&u==e;var h=-1,p=!0,g=2&r?new Hn:n;for(o.set(e,t),o.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(re,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Et(h,(function(n){var r="_."+n[0];t&n[1]&&!Pt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(se):[]}(r),n)))}function Is(e){var t=0,r=0;return function(){var i=fn(),s=16-(i-r);if(r=i,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function xs(e,t){var r=-1,i=e.length,s=i-1;for(t=t===n?i:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,Js(e,r)}));function oo(e){var t=Nn(e);return t.__chain__=!0,t}function ao(e,t){return t(e)}var lo=Yi((function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,s=function(t){return nr(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Bn&&ps(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:ao,args:[s],thisArg:n}),new Fn(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(s)})),co=$i((function(e,t,n){Ae.call(e,n)?++e[n]:tr(e,n,1)})),uo=Li(Us),ho=Li(Ds);function po(e,t){return(Fo(e)?Et:lr)(e,rs(t,3))}function go(e,t){return(Fo(e)?wt:cr)(e,rs(t,3))}var mo=$i((function(e,t,n){Ae.call(e,n)?e[n].push(t):tr(e,n,[t])})),fo=Vr((function(e,t,n){var r=-1,i="function"==typeof t,s=jo(e)?ne(e.length):[];return lr(e,(function(e){s[++r]=i?Ct(t,e,n):$r(e,t,n)})),s})),vo=$i((function(e,t,n){tr(e,n,t)}));function yo(e,t){return(Fo(e)?xt:kr)(e,rs(t,3))}var So=$i((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),bo=Vr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&gs(e,t[0],t[1])?t=[]:n>2&&gs(t[0],t[1],t[2])&&(t=[t[0]]),Fr(e,pr(t,1),[])})),Co=lt||function(){return ct.Date.now()};function To(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Gi(e,a,n,n,n,n,t)}function Eo(e,t){var i;if("function"!=typeof t)throw new $e(r);return e=ca(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var wo=Vr((function(e,t,n){var r=1;if(n.length){var i=sn(n,ns(wo));r|=o}return Gi(e,r,t,n,i)})),_o=Vr((function(e,t,n){var r=3;if(n.length){var i=sn(n,ns(_o));r|=o}return Gi(t,r,e,n,i)}));function $o(e,t,i){var s,o,a,l,c,d,u=0,h=!1,p=!1,g=!0;if("function"!=typeof e)throw new $e(r);function m(t){var r=s,i=o;return s=o=n,u=t,l=e.apply(i,r)}function f(e){var r=e-d;return d===n||r>=t||r<0||p&&e-u>=a}function v(){var e=Co();if(f(e))return y(e);c=_s(v,function(e){var n=t-(e-d);return p?mn(n,a-(e-u)):n}(e))}function y(e){return c=n,g&&s?m(e):(s=o=n,l)}function S(){var e=Co(),r=f(e);if(s=arguments,o=this,d=e,r){if(c===n)return function(e){return u=e,c=_s(v,t),h?m(e):l}(d);if(p)return vi(c),c=_s(v,t),m(d)}return c===n&&(c=_s(v,t)),l}return t=ua(t)||0,qo(i)&&(h=!!i.leading,a=(p="maxWait"in i)?gn(ua(i.maxWait)||0,t):a,g="trailing"in i?!!i.trailing:g),S.cancel=function(){c!==n&&vi(c),u=0,s=d=o=c=n},S.flush=function(){return c===n?l:y(Co())},S}var Po=Vr((function(e,t){return or(e,1,t)})),Io=Vr((function(e,t,n){return or(e,ua(t)||0,n)}));function xo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new $e(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(xo.Cache||zn),n}function Ro(e){if("function"!=typeof e)throw new $e(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}xo.Cache=zn;var Oo=mi((function(e,t){var n=(t=1==t.length&&Fo(t[0])?xt(t[0],Wt(rs())):xt(pr(t,1),Wt(rs()))).length;return Vr((function(r){for(var i=-1,s=mn(r.length,n);++i=t})),Do=Pr(function(){return arguments}())?Pr:function(e){return Qo(e)&&Ae.call(e,"callee")&&!Ve.call(e,"callee")},Fo=ne.isArray,Bo=mt?Wt(mt):function(e){return Qo(e)&&Cr(e)==x};function jo(e){return null!=e&&Ko(e.length)&&!Go(e)}function Zo(e){return Qo(e)&&jo(e)}var zo=kt||ul,Ho=ft?Wt(ft):function(e){return Qo(e)&&Cr(e)==f};function Vo(e){if(!Qo(e))return!1;var t=Cr(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Jo(e)}function Go(e){if(!qo(e))return!1;var t=Cr(e);return t==y||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wo(e){return"number"==typeof e&&e==ca(e)}function Ko(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=c}function qo(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Qo(e){return null!=e&&"object"==typeof e}var Yo=vt?Wt(vt):function(e){return Qo(e)&&cs(e)==b};function Xo(e){return"number"==typeof e||Qo(e)&&Cr(e)==C}function Jo(e){if(!Qo(e)||Cr(e)!=T)return!1;var t=ze(e);if(null===t)return!0;var n=Ae.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Oe.call(n)==Ne}var ea=yt?Wt(yt):function(e){return Qo(e)&&Cr(e)==w},ta=St?Wt(St):function(e){return Qo(e)&&cs(e)==_};function na(e){return"string"==typeof e||!Fo(e)&&Qo(e)&&Cr(e)==$}function ra(e){return"symbol"==typeof e||Qo(e)&&Cr(e)==P}var ia=bt?Wt(bt):function(e){return Qo(e)&&Ko(e.length)&&!!nt[Cr(e)]},sa=ji(Lr),oa=ji((function(e,t){return e<=t}));function aa(e){if(!e)return[];if(jo(e))return na(e)?ln(e):wi(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=cs(e);return(t==b?nn:t==_?on:Ma)(e)}function la(e){return e?(e=ua(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ca(e){var t=la(e),n=t%1;return t==t?n?t-n:t:0}function da(e){return e?rr(ca(e),0,u):0}function ua(e){if("number"==typeof e)return e;if(ra(e))return d;if(qo(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=qo(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Gt(e);var n=he.test(e);return n||ge.test(e)?ot(e.slice(2),n?2:8):ue.test(e)?d:+e}function ha(e){return _i(e,Pa(e))}function pa(e){return null==e?"":ii(e)}var ga=Pi((function(e,t){if(ys(t)||jo(t))_i(t,$a(t),e);else for(var n in t)Ae.call(t,n)&&Yn(e,n,t[n])})),ma=Pi((function(e,t){_i(t,Pa(t),e)})),fa=Pi((function(e,t,n,r){_i(t,Pa(t),e,r)})),va=Pi((function(e,t,n,r){_i(t,$a(t),e,r)})),ya=Yi(nr),Sa=Vr((function(e,t){e=Ee(e);var r=-1,i=t.length,s=i>2?t[2]:n;for(s&&gs(t[0],t[1],s)&&(i=1);++r1),t})),_i(e,Ji(e),n),r&&(n=ir(n,7,qi));for(var i=t.length;i--;)oi(n,t[i]);return n})),Oa=Yi((function(e,t){return null==e?{}:function(e,t){return Br(e,t,(function(t,n){return Ta(e,n)}))}(e,t)}));function Aa(e,t){if(null==e)return{};var n=xt(Ji(e),(function(e){return[e]}));return t=rs(t),Br(e,n,(function(e,n){return t(e,n[0])}))}var La=Vi($a),ka=Vi(Pa);function Ma(e){return null==e?[]:Kt(e,$a(e))}var Na=Oi((function(e,t,n){return t=t.toLowerCase(),e+(n?Ua(t):t)}));function Ua(e){return Va(pa(e).toLowerCase())}function Da(e){return(e=pa(e))&&e.replace(fe,Xt).replace(qe,"")}var Fa=Oi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ba=Oi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),ja=Ri("toLowerCase"),Za=Oi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),za=Oi((function(e,t,n){return e+(n?" ":"")+Va(t)})),Ha=Oi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Va=Ri("toUpperCase");function Ga(e,t,r){return e=pa(e),(t=r?n:t)===n?function(e){return Je.test(e)}(e)?function(e){return e.match(Ye)||[]}(e):function(e){return e.match(oe)||[]}(e):e.match(t)||[]}var Wa=Vr((function(e,t){try{return Ct(e,n,t)}catch(e){return Vo(e)?e:new be(e)}})),Ka=Yi((function(e,t){return Et(t,(function(t){t=Os(t),tr(e,t,wo(e[t],e))})),e}));function qa(e){return function(){return e}}var Qa=ki(),Ya=ki(!0);function Xa(e){return e}function Ja(e){return Or("function"==typeof e?e:ir(e,1))}var el=Vr((function(e,t){return function(n){return $r(n,e,t)}})),tl=Vr((function(e,t){return function(n){return $r(e,n,t)}}));function nl(e,t,n){var r=$a(t),i=yr(t,r);null!=n||qo(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=yr(t,$a(t)));var s=!(qo(n)&&"chain"in n&&!n.chain),o=Go(e);return Et(i,(function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(s||t){var n=e(this.__wrapped__);return(n.__actions__=wi(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Rt([this.value()],arguments))})})),e}function rl(){}var il=Di(xt),sl=Di(_t),ol=Di(Lt);function al(e){return ms(e)?jt(Os(e)):function(e){return function(t){return Sr(t,e)}}(e)}var ll=Bi(),cl=Bi(!0);function dl(){return[]}function ul(){return!1}var hl,pl=Ui((function(e,t){return e+t}),0),gl=zi("ceil"),ml=Ui((function(e,t){return e/t}),1),fl=zi("floor"),vl=Ui((function(e,t){return e*t}),1),yl=zi("round"),Sl=Ui((function(e,t){return e-t}),0);return Nn.after=function(e,t){if("function"!=typeof t)throw new $e(r);return e=ca(e),function(){if(--e<1)return t.apply(this,arguments)}},Nn.ary=To,Nn.assign=ga,Nn.assignIn=ma,Nn.assignInWith=fa,Nn.assignWith=va,Nn.at=ya,Nn.before=Eo,Nn.bind=wo,Nn.bindAll=Ka,Nn.bindKey=_o,Nn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Fo(e)?e:[e]},Nn.chain=oo,Nn.chunk=function(e,t,r){t=(r?gs(e,t,r):t===n)?1:gn(ca(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var s=0,o=0,a=ne(ut(i/t));ss?0:s+r),(i=i===n||i>s?s:ca(i))<0&&(i+=s),i=r>i?0:da(i);r>>0)?(e=pa(e))&&("string"==typeof t||null!=t&&!ea(t))&&!(t=ii(t))&&tn(e)?fi(ln(e),0,r):e.split(t,r):[]},Nn.spread=function(e,t){if("function"!=typeof e)throw new $e(r);return t=null==t?0:gn(ca(t),0),Vr((function(n){var r=n[t],i=fi(n,0,t);return r&&Rt(i,r),Ct(e,this,i)}))},Nn.tail=function(e){var t=null==e?0:e.length;return t?Xr(e,1,t):[]},Nn.take=function(e,t,r){return e&&e.length?Xr(e,0,(t=r||t===n?1:ca(t))<0?0:t):[]},Nn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?Xr(e,(t=i-(t=r||t===n?1:ca(t)))<0?0:t,i):[]},Nn.takeRightWhile=function(e,t){return e&&e.length?li(e,rs(t,3),!1,!0):[]},Nn.takeWhile=function(e,t){return e&&e.length?li(e,rs(t,3)):[]},Nn.tap=function(e,t){return t(e),e},Nn.throttle=function(e,t,n){var i=!0,s=!0;if("function"!=typeof e)throw new $e(r);return qo(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),$o(e,t,{leading:i,maxWait:t,trailing:s})},Nn.thru=ao,Nn.toArray=aa,Nn.toPairs=La,Nn.toPairsIn=ka,Nn.toPath=function(e){return Fo(e)?xt(e,Os):ra(e)?[e]:wi(Rs(pa(e)))},Nn.toPlainObject=ha,Nn.transform=function(e,t,n){var r=Fo(e),i=r||zo(e)||ia(e);if(t=rs(t,4),null==n){var s=e&&e.constructor;n=i?r?new s:[]:qo(e)&&Go(s)?Un(ze(e)):{}}return(i?Et:fr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Nn.unary=function(e){return To(e,1)},Nn.union=qs,Nn.unionBy=Qs,Nn.unionWith=Ys,Nn.uniq=function(e){return e&&e.length?si(e):[]},Nn.uniqBy=function(e,t){return e&&e.length?si(e,rs(t,2)):[]},Nn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?si(e,n,t):[]},Nn.unset=function(e,t){return null==e||oi(e,t)},Nn.unzip=Xs,Nn.unzipWith=Js,Nn.update=function(e,t,n){return null==e?e:ai(e,t,pi(n))},Nn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:ai(e,t,pi(r),i)},Nn.values=Ma,Nn.valuesIn=function(e){return null==e?[]:Kt(e,Pa(e))},Nn.without=eo,Nn.words=Ga,Nn.wrap=function(e,t){return Ao(pi(t),e)},Nn.xor=to,Nn.xorBy=no,Nn.xorWith=ro,Nn.zip=io,Nn.zipObject=function(e,t){return ui(e||[],t||[],Yn)},Nn.zipObjectDeep=function(e,t){return ui(e||[],t||[],Kr)},Nn.zipWith=so,Nn.entries=La,Nn.entriesIn=ka,Nn.extend=ma,Nn.extendWith=fa,nl(Nn,Nn),Nn.add=pl,Nn.attempt=Wa,Nn.camelCase=Na,Nn.capitalize=Ua,Nn.ceil=gl,Nn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=ua(r))==r?r:0),t!==n&&(t=(t=ua(t))==t?t:0),rr(ua(e),t,r)},Nn.clone=function(e){return ir(e,4)},Nn.cloneDeep=function(e){return ir(e,5)},Nn.cloneDeepWith=function(e,t){return ir(e,5,t="function"==typeof t?t:n)},Nn.cloneWith=function(e,t){return ir(e,4,t="function"==typeof t?t:n)},Nn.conformsTo=function(e,t){return null==t||sr(e,t,$a(t))},Nn.deburr=Da,Nn.defaultTo=function(e,t){return null==e||e!=e?t:e},Nn.divide=ml,Nn.endsWith=function(e,t,r){e=pa(e),t=ii(t);var i=e.length,s=r=r===n?i:rr(ca(r),0,i);return(r-=t.length)>=0&&e.slice(r,s)==t},Nn.eq=Mo,Nn.escape=function(e){return(e=pa(e))&&G.test(e)?e.replace(H,Jt):e},Nn.escapeRegExp=function(e){return(e=pa(e))&&ee.test(e)?e.replace(J,"\\$&"):e},Nn.every=function(e,t,r){var i=Fo(e)?_t:dr;return r&&gs(e,t,r)&&(t=n),i(e,rs(t,3))},Nn.find=uo,Nn.findIndex=Us,Nn.findKey=function(e,t){return Mt(e,rs(t,3),fr)},Nn.findLast=ho,Nn.findLastIndex=Ds,Nn.findLastKey=function(e,t){return Mt(e,rs(t,3),vr)},Nn.floor=fl,Nn.forEach=po,Nn.forEachRight=go,Nn.forIn=function(e,t){return null==e?e:gr(e,rs(t,3),Pa)},Nn.forInRight=function(e,t){return null==e?e:mr(e,rs(t,3),Pa)},Nn.forOwn=function(e,t){return e&&fr(e,rs(t,3))},Nn.forOwnRight=function(e,t){return e&&vr(e,rs(t,3))},Nn.get=Ca,Nn.gt=No,Nn.gte=Uo,Nn.has=function(e,t){return null!=e&&ds(e,t,Er)},Nn.hasIn=Ta,Nn.head=Bs,Nn.identity=Xa,Nn.includes=function(e,t,n,r){e=jo(e)?e:Ma(e),n=n&&!r?ca(n):0;var i=e.length;return n<0&&(n=gn(i+n,0)),na(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ut(e,t,n)>-1},Nn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ca(n);return i<0&&(i=gn(r+i,0)),Ut(e,t,i)},Nn.inRange=function(e,t,r){return t=la(t),r===n?(r=t,t=0):r=la(r),function(e,t,n){return e>=mn(t,n)&&e=-9007199254740991&&e<=c},Nn.isSet=ta,Nn.isString=na,Nn.isSymbol=ra,Nn.isTypedArray=ia,Nn.isUndefined=function(e){return e===n},Nn.isWeakMap=function(e){return Qo(e)&&cs(e)==I},Nn.isWeakSet=function(e){return Qo(e)&&"[object WeakSet]"==Cr(e)},Nn.join=function(e,t){return null==e?"":hn.call(e,t)},Nn.kebabCase=Fa,Nn.last=Hs,Nn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var s=i;return r!==n&&(s=(s=ca(r))<0?gn(i+s,0):mn(s,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,s):Nt(e,Ft,s,!0)},Nn.lowerCase=Ba,Nn.lowerFirst=ja,Nn.lt=sa,Nn.lte=oa,Nn.max=function(e){return e&&e.length?ur(e,Xa,Tr):n},Nn.maxBy=function(e,t){return e&&e.length?ur(e,rs(t,2),Tr):n},Nn.mean=function(e){return Bt(e,Xa)},Nn.meanBy=function(e,t){return Bt(e,rs(t,2))},Nn.min=function(e){return e&&e.length?ur(e,Xa,Lr):n},Nn.minBy=function(e,t){return e&&e.length?ur(e,rs(t,2),Lr):n},Nn.stubArray=dl,Nn.stubFalse=ul,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=vl,Nn.nth=function(e,t){return e&&e.length?Dr(e,ca(t)):n},Nn.noConflict=function(){return ct._===this&&(ct._=Ue),this},Nn.noop=rl,Nn.now=Co,Nn.pad=function(e,t,n){e=pa(e);var r=(t=ca(t))?an(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Fi(pt(i),n)+e+Fi(ut(i),n)},Nn.padEnd=function(e,t,n){e=pa(e);var r=(t=ca(t))?an(e):0;return t&&rt){var i=e;e=t,t=i}if(r||e%1||t%1){var s=yn();return mn(e+s*(t-e+st("1e-"+((s+"").length-1))),t)}return zr(e,t)},Nn.reduce=function(e,t,n){var r=Fo(e)?Ot:zt,i=arguments.length<3;return r(e,rs(t,4),n,i,lr)},Nn.reduceRight=function(e,t,n){var r=Fo(e)?At:zt,i=arguments.length<3;return r(e,rs(t,4),n,i,cr)},Nn.repeat=function(e,t,r){return t=(r?gs(e,t,r):t===n)?1:ca(t),Hr(pa(e),t)},Nn.replace=function(){var e=arguments,t=pa(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nn.result=function(e,t,r){var i=-1,s=(t=gi(t,e)).length;for(s||(s=1,e=n);++ic)return[];var n=u,r=mn(e,u);t=rs(t),e-=u;for(var i=Vt(r,t);++n=o)return e;var l=r-an(i);if(l<1)return i;var c=a?fi(a,0,l).join(""):e.slice(0,l);if(s===n)return c+i;if(a&&(l+=c.length-l),ea(s)){if(e.slice(l).search(s)){var d,u=c;for(s.global||(s=we(s.source,pa(de.exec(s))+"g")),s.lastIndex=0;d=s.exec(u);)var h=d.index;c=c.slice(0,h===n?l:h)}}else if(e.indexOf(ii(s),l)!=l){var p=c.lastIndexOf(s);p>-1&&(c=c.slice(0,p))}return c+i},Nn.unescape=function(e){return(e=pa(e))&&V.test(e)?e.replace(z,dn):e},Nn.uniqueId=function(e){var t=++Le;return pa(e)+t},Nn.upperCase=Ha,Nn.upperFirst=Va,Nn.each=po,Nn.eachRight=go,Nn.first=Bs,nl(Nn,(hl={},fr(Nn,(function(e,t){Ae.call(Nn.prototype,t)||(hl[t]=e)})),hl),{chain:!1}),Nn.VERSION="4.17.21",Et(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Nn[e].placeholder=Nn})),Et(["drop","take"],(function(e,t){Bn.prototype[e]=function(r){r=r===n?1:gn(ca(r),0);var i=this.__filtered__&&!t?new Bn(this):this.clone();return i.__filtered__?i.__takeCount__=mn(r,i.__takeCount__):i.__views__.push({size:mn(r,u),type:e+(i.__dir__<0?"Right":"")}),i},Bn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Et(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Bn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:rs(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Et(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Bn.prototype[e]=function(){return this[n](1).value()[0]}})),Et(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Bn.prototype[e]=function(){return this.__filtered__?new Bn(this):this[n](1)}})),Bn.prototype.compact=function(){return this.filter(Xa)},Bn.prototype.find=function(e){return this.filter(e).head()},Bn.prototype.findLast=function(e){return this.reverse().find(e)},Bn.prototype.invokeMap=Vr((function(e,t){return"function"==typeof e?new Bn(this):this.map((function(n){return $r(n,e,t)}))})),Bn.prototype.reject=function(e){return this.filter(Ro(rs(e)))},Bn.prototype.slice=function(e,t){e=ca(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Bn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ca(t))<0?r.dropRight(-t):r.take(t-e)),r)},Bn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Bn.prototype.toArray=function(){return this.take(u)},fr(Bn.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),s=Nn[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);s&&(Nn.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,l=t instanceof Bn,c=a[0],d=l||Fo(t),u=function(e){var t=s.apply(Nn,Rt([e],a));return i&&h?t[0]:t};d&&r&&"function"==typeof c&&1!=c.length&&(l=d=!1);var h=this.__chain__,p=!!this.__actions__.length,g=o&&!h,m=l&&!p;if(!o&&d){t=m?t:new Bn(this);var f=e.apply(t,a);return f.__actions__.push({func:ao,args:[u],thisArg:n}),new Fn(f,h)}return g&&m?e.apply(this,a):(f=this.thru(u),g?i?f.value()[0]:f.value():f)})})),Et(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Nn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Fo(i)?i:[],e)}return this[n]((function(n){return t.apply(Fo(n)?n:[],e)}))}})),fr(Bn.prototype,(function(e,t){var n=Nn[t];if(n){var r=n.name+"";Ae.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:t,func:n})}})),Pn[Mi(n,2).name]=[{name:"wrapper",func:n}],Bn.prototype.clone=function(){var e=new Bn(this.__wrapped__);return e.__actions__=wi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=wi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=wi(this.__views__),e},Bn.prototype.reverse=function(){if(this.__filtered__){var e=new Bn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Bn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Fo(e),r=t<0,i=n?e.length:0,s=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Nn.prototype.plant=function(e){for(var t,r=this;r instanceof Dn;){var i=Ls(r);i.__index__=0,i.__values__=n,t?s.__wrapped__=i:t=i;var s=i;r=r.__wrapped__}return s.__wrapped__=e,t},Nn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Bn){var t=e;return this.__actions__.length&&(t=new Bn(this)),(t=t.reverse()).__actions__.push({func:ao,args:[Ks],thisArg:n}),new Fn(t,this.__chain__)}return this.thru(Ks)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return ci(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,Qe&&(Nn.prototype[Qe]=function(){return this}),Nn}();ut?((ut.exports=un)._=un,dt._=un):ct._=un}).call(commonjsGlobal)}(lodash,lodash.exports);var WebsocketState,v="5.7.4",fr=24,ip=0,op=24,w=1080,h=1080,nm="Loading animation",ddd=0,assets=[],layers=[{}],markers=[],animationData={v:v,fr:fr,ip:ip,op:op,w:w,h:h,nm:nm,ddd:ddd,assets:assets,layers:layers,markers:markers};class ArcwareLogoLoader{constructor(){this.arcwareLogoLoader=this.createArcwareLogoLoader()}createArcwareLogoLoader(){}}class MicrophoneOverlay{constructor(e){this.overlay=null,this.stream=e,this.micIcon=new MicIcon,this.parentElement=null==e?void 0:e.videoElementParent}createOverlay(){var e,t;if(this.parentElement){this.overlay&&(this.parentElement.removeChild(this.overlay),this.overlay=null),this.overlay=document.createElement("div"),this.overlay.id="microphoneOverlay",null===(t=null===(e=this.overlay)||void 0===e?void 0:e.classList)||void 0===t||t.add("hiddenState"),this.overlay.appendChild(this.micIcon.micIconUnmuted),this.overlay.appendChild(this.micIcon.micIconMuted),this.micIcon.micIconMuted.style.display="none";const n=document.createElement("div");n.className="title",n.textContent="Enabling microphone...";const r=document.createElement("p");r.textContent="Please check your browser's prompt to allow microphone access. You may also need to re-enable the sound.",this.overlay.appendChild(n),this.overlay.appendChild(r),this.parentElement.appendChild(this.overlay)}}toggleMessage(e){if(this.parentElement&&this.overlay){const t=this.overlay.querySelector(".title"),n=this.overlay.querySelector("p");this.micIcon.micIconMuted.style.display=e?"none":"block",this.micIcon.micIconUnmuted.style.display=e?"block":"none",t&&(t.textContent=e?"Enabling microphone":"Disabling microphone"),n&&(n.textContent=e?"Please check your browser's prompt to allow microphone access. You may also need to re-enable the sound.":"Please wait. You may need to re-enable the sound.")}}toggleVisibility(e){var t,n,r,i,s,o,a,l,c,d,u,h,p;if(this.parentElement){const g=null===(t=null==this?void 0:this.parentElement)||void 0===t?void 0:t.querySelector("#infoOverlay"),m=null===(n=null==this?void 0:this.parentElement)||void 0===n?void 0:n.querySelector("#disconnectOverlay"),f=null===(r=null==this?void 0:this.parentElement)||void 0===r?void 0:r.querySelector("#errorOverlay"),v="mic-overlay-is-visible";this.overlay&&g&&m&&f&&(e?(null===(i=null==g?void 0:g.classList)||void 0===i||i.add(v),null===(s=null==m?void 0:m.classList)||void 0===s||s.add(v),null===(o=null==f?void 0:f.classList)||void 0===o||o.add(v),null===(l=null===(a=null==this?void 0:this.overlay)||void 0===a?void 0:a.classList)||void 0===l||l.remove("hiddenState")):(null===(d=null===(c=null==this?void 0:this.overlay)||void 0===c?void 0:c.classList)||void 0===d||d.add("hiddenState"),null===(u=null==g?void 0:g.classList)||void 0===u||u.remove(v),null===(h=null==m?void 0:m.classList)||void 0===h||h.remove(v),null===(p=null==f?void 0:f.classList)||void 0===p||p.remove(v)))}}}!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(WebsocketState||(WebsocketState={}));class ConnectionIdentifier{static get Instance(){return this.instance||(this.instance=new ConnectionIdentifier),this.instance}get WebsocketStates(){return this.aps.map((e=>e.websocketState))}constructor(){this.aps=[],this.enabled=!0}register(e){var t;this.aps.includes(e)||(this.aps.push(e),(null===(t=e.config.settings)||void 0===t?void 0:t.connectionIdentifierLoggingDisabled)&&this.disable()),this.interval||(this.interval=setInterval(this.connectionWatcher.bind(this),1e4))}GetWebSocketStates(){return this.aps.map((e=>e.websocketState))}ActiveInstances(){return this.GetWebSocketStates().filter((e=>e<=WebsocketState.OPEN)).length}disable(){this.enabled=!1}connectionWatcher(){if(!this.enabled)return;const e=this.GetWebSocketStates().filter((e=>e<=WebsocketState.OPEN));1===e.length?console.log("PixelStreaming Instance is connected."):0!==e.length&&console.warn(`${e.length} PixelStreaming Instances are connected!`)}}class ArcwarePixelStreaming extends jt{get WebsocketStates(){return ConnectionIdentifier.Instance.GetWebSocketStates()}get ActiveInstances(){return ConnectionIdentifier.Instance.ActiveInstances}get websocketState(){var e;return null===(e=this.webSocketController.webSocket)||void 0===e?void 0:e.readyState}constructor(e,t){ApplyUrlHack(),super(e,t),this.loveLettersQueue=[],this.isProcessingQueue=!1,this.queueHandler=new EventHandler,this.errorHandler=new EventHandler,this.loveLetterHandler=new EventHandler,this.sessionIdHandler=new EventHandler,this.videoInitializedHandler=new EventHandler,this.websocketOnCloseHandler=new EventHandler,this.config=e,this.webRtcController=this._webRtcController,this.loveLettersList=[],this.microphoneOverlay=new MicrophoneOverlay(this),this.wrapWebSocketOnCloseHandler(),this.handleResolutionChange=this.handleResolutionChange.bind(this),this.addMessageHandler("letter",ZLoveLetter,this.onLoveLetter),this.addMessageHandler("streamInfo",ZStreamInfo,this.onStreamInfo),this.addMessageHandler("sessionId",ZSessionId,this.onSessionId),this.addMessageHandler("error",ZErrorMessage,this.onError),this.addMessageHandler("ping",ZPing,this.onPing),this.addMessageHandler("queue",ZQueue,this.onQueue),this.addMessageHandler("version",ZVersion,this.onVersion);const n=lodash.exports.debounce((()=>{this.handleResolutionChange()}),500);this.addEventListener("videoInitialized",this.onVideoInitialized.bind(this)),this.addEventListener("statsReceived",(e=>{this.sendStats(e.data.aggregatedStats)})),window.addEventListener("resize",n),this.webRtcController.streamMessageController.registerMessageHandler(0,"TextboxEntry",(e=>{console.error("Incomplete handler: ToStreamer.TextboxEntry",e)})),this.createMicrophoneOverlay(),this.config.settings.errorHandler&&this.errorHandler.add(this.config.settings.errorHandler),this.config.settings.queueHandler&&this.queueHandler.add(this.config.settings.queueHandler),this.config.settings.sessionIdHandler&&this.sessionIdHandler.add(this.config.settings.sessionIdHandler),this.config.settings.loveLetterHandler&&this.loveLetterHandler.add(this.config.settings.loveLetterHandler),ConnectionIdentifier.Instance.register(this),this.removeXRIconIfDisabled()}get session(){return this.config.session}onVersion(e){this.send({type:"version",version:this.config.VERSION})}onPing(e){this.session.current&&this.session.set(this.session.current)}onStreamInfo(e){var t,n,r,i;if(Vt.Info(Vt.GetStackTrace(),"StreamInfo received."),this.streamInfo=e,!(null===(n=null===(t=this.config)||void 0===t?void 0:t.settings)||void 0===n?void 0:n["do-not-eval-streamInfo"])){const{afk:t}=e.streamInfo;if(t){this.config.setFlagEnabled(Ot.AFKDetection,t.enabled),this.config.setNumericSetting($t.AFKTimeoutSecs,t.warn+t.error);const{afkController:e}=this.webRtcController;e.closeTimeout=t.action}(null===(r=e.streamInfo.webSdkSettings)||void 0===r?void 0:r.init)&&this.config.setSettings(e.streamInfo.webSdkSettings.init),(null===(i=e.streamInfo.webSdkSettings)||void 0===i?void 0:i.conf)&&Object.entries(e.streamInfo.webSdkSettings.conf).forEach((([e,t])=>{const n=e;this.config.settings[n]=t,"connectionIdentifierLoggingDisabled"===e&&!0===t&&ConnectionIdentifier.Instance.disable()}))}this.handleMouseLock(),this.injectCustomUI()}onQueue(e){Vt.Info(Vt.GetStackTrace(),"QueueInfo received."),EventHandler.Emit(this.queueHandler,e)}onError(e){Vt.Error(Vt.GetStackTrace(),e.type),EventHandler.Emit(this.errorHandler,e)}onLoveLetter(e){}onSessionId(e){Vt.Info(Vt.GetStackTrace(),e.sessionId),this.session.set(e.sessionId),EventHandler.Emit(this.sessionIdHandler,e.sessionId)}onVideoInitialized(){this.send({type:"onVideoInitialized"}),EventHandler.Emit(this.videoInitializedHandler,void 0),this.handleResolutionChange(),this.handleMouseLock(),this.microphoneOverlay.toggleVisibility(!1),this.applyResolutionIfPlaying(),this.removeXRIconIfDisabled()}addMessageHandler(e,t,n){this.webSocketController.signallingProtocol.addMessageHandler(e,(r=>{const i=t.safeParse(JSON.parse(r));if(i.success)n.call(this,i.data);else{const t=new Error(`Unexpected message content. Event:'${e}', ZodError: ${i.error.message}`);Vt.Error(t.stack,t.message)}}))}sendStats(e){const t={type:"stats",stats:Stats(e)};this.send(t)}send(e){if(Send[e.type]){const t=Send[e.type].safeParse(e);if(t.success)this.webSocketController.webSocket.send(JSON.stringify(t.data));else{const e=t;Vt.Error(Vt.GetStackTrace(),`Failed to send. ${e.error}`)}}else this.webSocketController.webSocket.send(JSON.stringify(e))}handleResolutionChange(){var e,t,n,r,i,s,o,a,l,c,d;if(!(null==this?void 0:this.streamInfo)||!(null==this?void 0:this.webRtcController)||!(null===(t=null===(e=null==this?void 0:this.webRtcController)||void 0===e?void 0:e.videoPlayer)||void 0===t?void 0:t.getVideoElement()))return;const u=null===(r=null===(n=null==this?void 0:this.streamInfo)||void 0===n?void 0:n.streamInfo)||void 0===r?void 0:r.resolution,h=null!==(a=null===(o=null===(s=null===(i=null==this?void 0:this.streamInfo)||void 0===i?void 0:i.streamInfo)||void 0===s?void 0:s.meta)||void 0===o?void 0:o.version)&&void 0!==a?a:null===(d=null===(c=null===(l=this.streamInfo)||void 0===l?void 0:l.streamInfo)||void 0===c?void 0:c.meta)||void 0===d?void 0:d.ueVersion;u&&(null==u?void 0:u.dynamic)&&setTimeout((()=>{var e;const{videoPlayer:t}=null==this?void 0:this.webRtcController,n=null==t?void 0:t.getVideoParentElement(),r=null==n?void 0:n.getBoundingClientRect().width,i=null==n?void 0:n.getBoundingClientRect().height,s=null==u?void 0:u.width,o=null==u?void 0:u.height,a=r/i;let l,c;if(a>s/o?(l=s,c=s/a):(c=o,l=o*a),t)if(!h||(null==h?void 0:h.startsWith("4.27"))){const t={Console:`r.setres ${Math.round(l)}x${Math.round(c)}w`};null===(e=null==this?void 0:this.webRtcController)||void 0===e||e.emitUIInteraction(t)}else t.onMatchViewportResolutionCallback(Math.round(l),Math.round(c))}),500)}applyResolutionIfPlaying(){var e;const t=null===(e=null==this?void 0:this.webRtcController)||void 0===e?void 0:e.videoPlayer.getVideoElement();t&&t.addEventListener("playing",(()=>{setTimeout((()=>{null==this||this.handleResolutionChange()}),1500)}))}removePlayer(){var e;null===(e=null==this?void 0:this.webSocketController)||void 0===e||e.close()}handleMouseLock(){var e,t,n;null===(e=null==this?void 0:this.config)||void 0===e||e.modifyInitialSettings(!(null===(n=null===(t=null==this?void 0:this.streamInfo)||void 0===t?void 0:t.streamInfo.meta)||void 0===n?void 0:n.mouseLock))}toggleAudio(e,t){var n,r;const{streamController:i}=this.webRtcController;e&&(e.muted=t,i&&(i.audioElement.muted=t,(null==e?void 0:e.currentTime)>0&&!(null==e?void 0:e.paused)&&(null===(n=null==i?void 0:i.audioElement)||void 0===n?void 0:n.paused)&&(null===(r=null==i?void 0:i.audioElement)||void 0===r||r.play())))}createMicrophoneOverlay(){var e;null===(e=null==this?void 0:this.microphoneOverlay)||void 0===e||e.createOverlay()}toggleMic(e,t){var n,r;null===(n=null==this?void 0:this.config)||void 0===n||n.setFlagEnabled(Ot.UseMic,e),t||(null===(r=null==this?void 0:this.microphoneOverlay)||void 0===r||r.toggleMessage(e),setTimeout((()=>{var e;null===(e=null==this?void 0:this.microphoneOverlay)||void 0===e||e.toggleVisibility(!0)}),200),setTimeout((()=>{var e;null===(e=null==this?void 0:this.webRtcController)||void 0===e||e.restartStreamAutomatically()}),1e3))}wrapWebSocketOnCloseHandler(){var e;(null===(e=null==this?void 0:this.webSocketController)||void 0===e?void 0:e.webSocket)&&(this.webSocketController.webSocket.onclose=e=>{var t;null===(t=null==this?void 0:this.webSocketController)||void 0===t||t.handleOnClose(e),EventHandler.Emit(this.websocketOnCloseHandler,e)})}onStreamingStateChange(e){var t,n,r,i,s,o;const a=null===(n=null===(t=null==this?void 0:this.webRtcController)||void 0===t?void 0:t.videoPlayer)||void 0===n?void 0:n.getVideoElement();null==a||a.addEventListener("play",(()=>e(!0))),null==a||a.addEventListener("pause",(()=>e(!1))),null==a||a.addEventListener("ended",(()=>e(!1)));const l=null===(i=null===(r=null==this?void 0:this.webSocketController)||void 0===r?void 0:r.webSocket)||void 0===i?void 0:i.onopen;this.webSocketController.webSocket.onopen=t=>{var n;null==l||l.call(null===(n=null==this?void 0:this.webSocketController)||void 0===n?void 0:n.webSocket,t),e(!0)};const c=null===(o=null===(s=null==this?void 0:this.webSocketController)||void 0===s?void 0:s.webSocket)||void 0===o?void 0:o.onclose;this.webSocketController.webSocket.onclose=t=>{var n;null==c||c.call(null===(n=null==this?void 0:this.webSocketController)||void 0===n?void 0:n.webSocket,t),e(!1)}}removeXRIconIfDisabled(){var e,t,n,r,i;if(!(null===(t=null===(e=null==this?void 0:this.config)||void 0===e?void 0:e.initialSettings)||void 0===t?void 0:t.XRControllerInput)&&(null===(n=null==this?void 0:this.config)||void 0===n||n.setFlagEnabled(Ot.XRControllerInput,!1),this.videoElementParent&&(null===(r=null==this?void 0:this.videoElementParent)||void 0===r?void 0:r.parentElement))){const e=null===(i=null==this?void 0:this.videoElementParent)||void 0===i?void 0:i.parentElement.querySelector("#xrBtn");null==e||e.remove()}}injectCustomUI(){var e;const t=null===document||void 0===document?void 0:document.getElementById("stream-ui"),n=null===(e=null==this?void 0:this.videoElementParent)||void 0===e?void 0:e.parentElement;t&&n&&(null==n||n.appendChild(t))}}var $=_export,assign=objectAssign;function ArcwareInit({shareId:e,projectId:t},n){if(e&&!e.startsWith("share-"))throw new Error(`Unexpected shareId-format: '${e}'.`);const r=new ArcwareConfig({useUrlParams:!0===(null==n?void 0:n.useUrlParams),initialSettings:Object.assign({ss:DefaultUrl,AutoConnect:!1,StartVideoMuted:!0,AutoPlayVideo:!0,KeyboardInput:!0,MouseInput:!0,GamepadInput:!1,TouchInput:!0,XRControllerInput:!1,UseMic:!0,SuppressBrowserKeys:!0,AFKTimeout:void 0,ControlsQuality:void 0,FakeMouseWithTouches:!1,ForceMonoAudio:!1,ForceTURN:void 0,HoveringMouse:!0,MatchViewportRes:void 0,MaxQP:void 0,MinQP:void 0,OfferToReceive:void 0,PreferredCodec:void 0,preferSFU:void 0,StreamerId:void 0,TimeoutIfIdle:void 0,WebRTCFPS:void 0,WebRTCMaxBitrate:void 0,WebRTCMinBitrate:void 0},null==n?void 0:n.initialSettings),settings:Object.assign({shareId:e,projectId:t,token:void 0,session:void 0,fullscreenButton:!0,audioButton:!0,stopButton:!1,infoButton:!1,micButton:!1,settingsButton:!1,connectionStrengthIcon:!1,connectionIdentifierLoggingDisabled:void 0,errorHandler:void 0,queueHandler:void 0,sessionIdHandler:void 0},null==n?void 0:n.settings)}),i=new ArcwarePixelStreaming(r);return{Config:r,PixelStreaming:i,Application:new ArcwareApplication({stream:i})}}$({target:"Object",stat:!0,arity:2,forced:Object.assign!==assign},{assign:assign});export{ArcwareInit};