1var lW=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var _De=lW((SDe,dg)=>{function ve(n,e,t,r,i,a,s,o){var c=typeof n=="function"?n.options:n;return e&&(c.render=e,c.staticRenderFns=t,c._compiled=!0),a&&(c._scopeId="data-v-"+a),{exports:n,options:c}}const dW={props:["on"]};var fW=function(){var e=this,t=e._self._c;return t("div",[t("transition",{attrs:{"leave-active-class":"transition ease-in duration-1000","leave-class":"opacity-100","leave-to-class":"opacity-0"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.on,expression:"on"}],staticClass:"text-sm text-gray-600"},[e._t("default")],2)])],1)},hW=[],pW=ve(dW,fW,hW,!1,null,null);const tu=pW.exports,mW={};var gW=function(){var e=this,t=e._self._c;return t("div",{staticClass:"md:col-span-1"},[t("div",{staticClass:"px-4 sm:px-0"},[t("h3",{staticClass:"text-lg font-medium text-fck-blue"},[e._t("title")],2),t("p",{staticClass:"mt-1 text-sm text-gray-600"},[e._t("description")],2)])])},vW=[],yW=ve(mW,gW,vW,!1,null,null);const S2=yW.exports,_W={components:{JetSectionTitle:S2}};var bW=function(){var e=this,t=e._self._c;return t("div",{staticClass:"md:grid md:grid-cols-3 md:gap-6"},[t("jet-section-title",{scopedSlots:e._u([{key:"title",fn:function(){return[e._t("title")]},proxy:!0},{key:"description",fn:function(){return[e._t("description")]},proxy:!0}],null,!0)}),t("div",{staticClass:"mt-5 md:mt-0 md:col-span-2"},[t("div",{staticClass:"px-4 py-5 sm:p-6 bg-white shadow-xl sm:rounded-lg"},[e._t("content")],2)])],1)},xW=[],wW=ve(_W,bW,xW,!1,null,null);const Tp=wW.exports,CW={props:{type:{type:String,default:"submit"}}};var kW=function(){var e=this,t=e._self._c;return t("button",{staticClass:"inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray transition ease-in-out duration-150",attrs:{type:e.type}},[e._t("default")],2)},SW=[],TW=ve(CW,kW,SW,!1,null,null);const mn=TW.exports,EW={props:{show:{default:!1},maxWidth:{default:"2xl"},closeable:{default:!0}},methods:{close(){this.closeable&&this.$emit("close")}},watch:{show:{immediate:!0,handler:n=>{n?document.body.style.overflow="hidden":document.body.style.overflow=null}}},created(){const n=e=>{e.key==="Escape"&&this.show&&this.close()};document.addEventListener("keydown",n),this.$once("hook:destroyed",()=>{document.removeEventListener("keydown",n)})},computed:{maxWidthClass(){return{sm:"sm:max-w-sm",md:"sm:max-w-md",lg:"sm:max-w-lg",xl:"sm:max-w-xl","2xl":"sm:max-w-2xl"}[this.maxWidth]}}};var PW=function(){var e=this,t=e._self._c;return t("portal",{attrs:{to:"modal"}},[t("transition",{attrs:{"leave-active-class":"duration-200"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"fixed inset-0 overflow-y-auto px-4 py-6 sm:px-0"},[t("transition",{attrs:{"enter-active-class":"ease-out duration-300","enter-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"ease-in duration-200","leave-class":"opacity-100","leave-to-class":"opacity-0"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"fixed inset-0 transform transition-all",on:{click:e.close}},[t("div",{staticClass:"absolute inset-0 bg-gray-500 opacity-75"})])]),t("transition",{attrs:{"enter-active-class":"ease-out duration-300","enter-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 translate-y-0 sm:scale-100","leave-active-class":"ease-in duration-200","leave-class":"opacity-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"mb-6 bg-white rounded-lg overflow-hidden shadow-xl transform transition-all sm:w-full sm:mx-auto",class:e.maxWidthClass},[e._t("default")],2)])],1)])],1)},RW=[],AW=ve(EW,PW,RW,!1,null,null);const EM=AW.exports,IW={components:{Modal:EM},props:{show:{default:!1},maxWidth:{default:"2xl"},closeable:{default:!0}},methods:{close(){this.$emit("close")}}};var OW=function(){var e=this,t=e._self._c;return t("modal",{attrs:{show:e.show,"max-width":e.maxWidth,closeable:e.closeable},on:{close:e.close}},[t("div",{staticClass:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},[t("div",{staticClass:"sm:flex sm:items-start"},[t("div",{staticClass:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10"},[t("svg",{staticClass:"h-6 w-6 text-red-600",attrs:{stroke:"currentColor",fill:"none",viewBox:"0 0 24 24"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}})])]),t("div",{staticClass:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},[t("h3",{staticClass:"text-lg"},[e._t("title")],2),t("div",{staticClass:"mt-2"}
1,[e._t("content")],2)])])]),t("div",{staticClass:"px-6 py-4 bg-gray-100 text-right"},[e._t("footer")],2)])},MW=[],DW=ve(IW,OW,MW,!1,null,null);const kf=DW.exports,NW={props:{type:{type:String,default:"button"}}};var LW=function(){var e=this,t=e._self._c;return t("button",{staticClass:"inline-flex items-center justify-center px-4 py-2 bg-red-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-500 focus:outline-none focus:border-red-700 focus:shadow-outline-red active:bg-red-600 transition ease-in-out duration-150",attrs:{type:e.type}},[e._t("default")],2)},FW=[],$W=ve(NW,LW,FW,!1,null,null);const vo=$W.exports,BW={components:{Modal:EM},props:{show:{default:!1},maxWidth:{default:"2xl"},closeable:{default:!0}},methods:{close(){this.$emit("close")}}};var UW=function(){var e=this,t=e._self._c;return t("modal",{attrs:{show:e.show,"max-width":e.maxWidth,closeable:e.closeable},on:{close:e.close}},[t("div",{staticClass:"px-6 py-4"},[t("div",{staticClass:"text-lg"},[e._t("title")],2),t("div",{staticClass:"mt-4"},[e._t("content")],2)]),t("div",{staticClass:"px-6 py-4 bg-gray-100 text-right"},[e._t("footer")],2)])},jW=[],qW=ve(BW,UW,jW,!1,null,null);const Ep=qW.exports,zW={components:{JetSectionTitle:S2},computed:{hasActions(){return!!this.$slots.actions}}};var WW=function(){var e=this,t=e._self._c;return t("div",{staticClass:"md:grid md:grid-cols-3 md:gap-6"},[t("jet-section-title",{scopedSlots:e._u([{key:"title",fn:function(){return[e._t("title")]},proxy:!0},{key:"description",fn:function(){return[e._t("description")]},proxy:!0}],null,!0)}),t("div",{staticClass:"mt-5 md:mt-0 md:col-span-2"},[t("form",{on:{submit:function(r){return r.preventDefault(),e.$emit("submitted")}}},[t("div",{staticClass:"shadow-xl overflow-hidden sm:rounded-lg"},[t("div",{staticClass:"px-4 py-5 bg-white sm:p-6"},[t("div",{staticClass:"grid grid-cols-6 gap-6"},[e._t("form")],2)]),e.hasActions?t("div",{staticClass:"flex items-center justify-end px-4 py-3 bg-gray-50 text-right sm:px-6"},[e._t("actions")],2):e._e()])])])],1)},HW=[],VW=ve(zW,WW,HW,!1,null,null);const rd=VW.exports,GW={props:["value"],methods:{focus(){this.$refs.input.focus()}}};var KW=function(){var e=this,t=e._self._c;return t("input",{ref:"input",staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 shadow-sm",domProps:{value:e.value},on:{input:function(r){return e.$emit("input",r.target.value)}}})},YW=[],XW=ve(GW,KW,YW,!1,null,null);const Rn=XW.exports,JW={model:{prop:"checked",event:"change"},props:{checked:{type:[Array,Boolean],default:!1},value:{default:null}},computed:{proxyChecked:{get(){return this.checked},set(n){this.$emit("change",n)}}}};var QW=function(){var e=this,t=e._self._c;return t("input",{directives:[{name:"model",rawName:"v-model",value:e.proxyChecked,expression:"proxyChecked"}],staticClass:"rounded border-gray-300 text-blue-600 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50",attrs:{type:"checkbox"},domProps:{value:e.value,checked:Array.isArray(e.proxyChecked)?e._i(e.proxyChecked,e.value)>-1:e.proxyChecked},on:{change:function(r){var i=e.proxyChecked,a=r.target,s=!!a.checked;if(Array.isArray(i)){var o=e.value,c=e._i(i,o);a.checked?c<0&&(e.proxyChecked=i.concat([o])):c>-1&&(e.proxyChecked=i.slice(0,c).concat(i.slice(c+1)))}else e.proxyChecked=s}}})},ZW=[],eH=ve(JW,QW,ZW,!1,null,null);const Pp=eH.exports,tH={props:["message"]};var nH=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.message,expression:"message"}]},[t("p",{staticClass:"text-sm text-red-600"},[e._v(" "+e._s(e.message)+" ")])])},rH=[],iH=ve(tH,nH,rH,!1,null,null);const ea=iH.exports,aH={props:["value"]};var sH=function(){var e=this,t=e._self._c;return t("label",{staticClass:"block font-medium text-sm text-gray-700"},[e.value?t("span",[e._v(e._s(e.value))]):t("span",[e._t("default")],2)])},oH=[],cH=ve(aH,sH,oH,!1,null,null);const Un=cH.exports,uH={props:{type:{type:String,default:"button"}}};var lH=function(){var e=this,t=e._self._c;return t("button",{staticClass:"inline-flex items-center px-4 py-2 bg-white border border-gray-300 rounded-md font-semibold text-xs text-gray-700 uppercase tracking-widest shadow-sm hover:text-gray-500 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:text-gray-800 active:bg-gray-50 transition ease-in-out duration-150",attrs:{type:e.type}},[e._t("default")],2)},dH=[],fH=ve(uH,lH,dH,!1,null,null);const Br=fH.exports,hH={};var pH=function(){var e=this;return e._self._c,e._m(0)},mH=[function(){var n=this,e=n._self._c;return e("div",{staticClass:"hidden sm:block"},[e("div",{staticClass:"py-8"},[e("div",{staticClass:"border-t border-gray-200"})])])}],gH=ve(hH,pH,mH,!1,null,null);const T2=gH.exports,vH={components:{JetActionMessage:tu,JetActionSection:Tp,JetButton:mn,JetConfirmationModal:kf,JetDangerButton:vo,JetDialogModal:Ep,JetFormSection:rd,JetInput:Rn,JetCheckbox:Pp,JetInputError:ea,JetLabel:Un,JetSecondaryButton:Br,JetSectionBorder:T2},props:["tokens","availablePermissions","defaultPermissions"],data(){return{createApiTokenForm:this.$inertia.form({name:"",permissions:this.defaultPermissions}),updateApiTokenForm:this.$inertia.form({permissions:[]}),deleteApiTokenForm:this.$inertia.form(),displayingToken:!1,managingPermissionsFor:null,apiTokenBeingDeleted:null}},methods:{createApiToken(){this.createApiTokenForm.post(route("api-tokens.store"),{preserveScroll:!0,onSuccess:()=>{this.displayingToken=!0,this.createApiTokenForm.reset()}})},manageApiTokenPermissions(n){this.updateApiTokenForm.permissions=n.abilities,this.managingPermissionsFor=n},updateApiToken(){this.updateApiTokenForm.put(route("api-tokens.update",this.managingPermissionsFor),{preserveScroll:!0,preserveState:!0,onSuccess:()=>this.managingPermissionsFor=null})},confirmApiTokenDeletion(n){this.apiTokenBeingDeleted=n},deleteApiToken(){this.deleteApiTokenForm.delete(route("api-tokens.destroy",this.apiTokenBeingDeleted),{preserveScroll:!0,preserveState:!0,onSuccess:()=>this.apiTokenBeingDeleted=null})}}};var yH=function(){var e=this,t=e._self._c;return t("div",[t("jet-form-section",{on:{submitted:e.createApiToken},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" Create API Token ")]},proxy:!0},{key:"description",fn:function(){return[e._v(" API tokens allow third-party services to authenticate with our application on your behalf. ")]},proxy:!0},{key:"form",fn:function(){return[t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"name",value:"Name"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"name",type:"text",autofocus:""},model:{value:e.createApiTokenForm.name,callback:function(r){e.$set(e.createApiTokenForm,"name",r)},expression:"createApiTokenForm.name"}}
1),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.createApiTokenForm.errors.name}})],1),e.availablePermissions.length>0?t("div",{staticClass:"col-span-6"},[t("jet-label",{attrs:{for:"permissions",value:"Permissions"}}),t("div",{staticClass:"mt-2 grid grid-cols-1 md:grid-cols-2 gap-4"},e._l(e.availablePermissions,function(r){return t("div",{key:r},[t("label",{staticClass:"flex items-center"},[t("jet-checkbox",{attrs:{value:r},model:{value:e.createApiTokenForm.permissions,callback:function(i){e.$set(e.createApiTokenForm,"permissions",i)},expression:"createApiTokenForm.permissions"}}),t("span",{staticClass:"ml-2 text-sm text-gray-600"},[e._v(e._s(r))])],1)])}),0)],1):e._e()]},proxy:!0},{key:"actions",fn:function(){return[t("jet-action-message",{staticClass:"mr-3",attrs:{on:e.createApiTokenForm.recentlySuccessful}},[e._v(" Created. ")]),t("jet-button",{class:{"opacity-25":e.createApiTokenForm.processing},attrs:{disabled:e.createApiTokenForm.processing}},[e._v(" Create ")])]},proxy:!0}])}),e.tokens.length>0?t("div",[t("jet-section-border"),t("div",{staticClass:"mt-10 sm:mt-0"},[t("jet-action-section",{scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" Manage API Tokens ")]},proxy:!0},{key:"description",fn:function(){return[e._v(" You may delete any of your existing tokens if they are no longer needed. ")]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"space-y-6"},e._l(e.tokens,function(r){return t("div",{key:r.id,staticClass:"flex items-center justify-between"},[t("div",[e._v(" "+e._s(r.name)+" ")]),t("div",{staticClass:"flex items-center"},[r.last_used_ago?t("div",{staticClass:"text-sm text-gray-400"},[e._v(" Last used "+e._s(r.last_used_ago)+" ")]):e._e(),e.availablePermissions.length>0?t("button",{staticClass:"cursor-pointer ml-6 text-sm text-gray-400 underline",on:{click:function(i){return e.manageApiTokenPermissions(r)}}},[e._v(" Permissions ")]):e._e(),t("button",{staticClass:"cursor-pointer ml-6 text-sm text-red-500",on:{click:function(i){return e.confirmApiTokenDeletion(r)}}},[e._v(" Delete ")])])])}),0)]},proxy:!0}],null,!1,1027387836)})],1)],1):e._e(),t("jet-dialog-modal",{attrs:{show:e.displayingToken},on:{close:function(r){e.displayingToken=!1}},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" API Token ")]},proxy:!0},{key:"content",fn:function(){return[t("div",[e._v(" Please copy your new API token. For your security, it won't be shown again. ")]),e.$page.props.jetstream.flash.token?t("div",{staticClass:"mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500"},[e._v(" "+e._s(e.$page.props.jetstream.flash.token)+" ")]):e._e()]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){e.displayingToken=!1}}},[e._v(" Close ")])]},proxy:!0}])}),t("jet-dialog-modal",{attrs:{show:e.managingPermissionsFor},on:{close:function(r){e.managingPermissionsFor=null}},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" API Token Permissions ")]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"grid grid-cols-1 md:grid-cols-2 gap-4"},e._l(e.availablePermissions,function(r){return t("div",{key:r},[t("label",{staticClass:"flex items-center"},[t("jet-checkbox",{attrs:{value:r},model:{value:e.updateApiTokenForm.permissions,callback:function(i){e.$set(e.updateApiTokenForm,"permissions",i)},expression:"updateApiTokenForm.permissions"}}),t("span",{staticClass:"ml-2 text-sm text-gray-600"},[e._v(e._s(r))])],1)])}),0)]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){e.managingPermissionsFor=null}}},[e._v(" Nevermind ")]),t("jet-button",{staticClass:"ml-2",class:{"opacity-25":e.updateApiTokenForm.processing},attrs:{disabled:e.updateApiTokenForm.processing},nativeOn:{click:function(r){return e.updateApiToken.apply(null,arguments)}}},[e._v(" Save ")])]},proxy:!0}])}),t("jet-confirmation-modal",{attrs:{show:e.apiTokenBeingDeleted},on:{close:function(r){e.apiTokenBeingDeleted=null}},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" Delete API Token ")]},proxy:!0},{key:"content",fn:function(){return[e._v(" Are you sure you would like to delete this API token? ")]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){e.apiTokenBeingDeleted=null}}},[e._v(" Nevermind ")]),t("jet-danger-button",{staticClass:"ml-2",class:{"opacity-25":e.deleteApiTokenForm.processing},attrs:{disabled:e.deleteApiTokenForm.processing},nativeOn:{click:function(r){return e.deleteApiToken.apply(null,arguments)}}},[e._v(" Delete ")])]},proxy:!0}])})],1)},_H=[],bH=ve(vH,yH,_H,!1,null,null);const PM=bH.exports,xH=Object.freeze(Object.defineProperty({__proto__:null,default:PM},Symbol.toStringTag,{value:"Module"})),wH={};var CH=function(){var e=this,t=e._self._c;return t("img",{attrs:{src:"/img/logo.png"}})},kH=[],SH=ve(wH,CH,kH,!1,null,null);const RM=SH.exports,TH={data(){return{show:!0}},computed:{style(){var n;return((n=this.$page.props.jetstream.flash)==null?void 0:n.bannerStyle)||"success"},message(){var n;return((n=this.$page.props.jetstream.flash)==null?void 0:n.banner)||""}}};var EH=function(){var e=this,t=e._self._c;return t("div",[e.show&&e.message?t("div",{class:{"bg-indigo-500":e.style=="success","bg-red-700":e.style=="danger"}},[t("div",{staticClass:"max-w-screen-xl mx-auto py-2 px-3 sm:px-6 lg:px-8"},[t("div",{staticClass:"flex items-center justify-between flex-wrap"},[t("div",{staticClass:"w-0 flex-1 flex items-center min-w-0"},[t("span",{staticClass:"flex p-2 rounded-lg",class:{"bg-indigo-600":e.style=="success","bg-red-600":e.style=="danger"}},[e.style=="success"?t("svg",{staticClass:"h-5 w-5 text-white",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}}
1)]):e._e(),e.style=="danger"?t("svg",{staticClass:"h-5 w-5 text-white",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}})]):e._e()]),t("p",{staticClass:"ml-3 font-medium text-sm text-white truncate"},[e._v(" "+e._s(e.message)+" ")])]),t("div",{staticClass:"flex-shrink-0 sm:ml-3"},[t("button",{staticClass:"-mr-1 flex p-2 rounded-md focus:outline-none sm:-mr-2 transition ease-in-out duration-150",class:{"hover:bg-indigo-600 focus:bg-indigo-600":e.style=="success","hover:bg-red-600 focus:bg-red-600":e.style=="danger"},attrs:{type:"button","aria-label":"Dismiss"},on:{click:function(r){r.preventDefault(),e.show=!1}}},[t("svg",{staticClass:"h-5 w-5 text-white",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"}})])])])])])]):e._e()])},PH=[],RH=ve(TH,EH,PH,!1,null,null);const AM=RH.exports,AH={props:{align:{default:"right"},width:{default:"48"},contentClasses:{default:()=>["py-1","bg-white"]}},data(){return{open:!1}},created(){const n=e=>{this.open&&e.keyCode===27&&(this.open=!1)};this.$once("hook:destroyed",()=>{document.removeEventListener("keydown",n)}),document.addEventListener("keydown",n)},computed:{widthClass(){return{48:"w-48"}[this.width.toString()]},alignmentClasses(){return this.align==="left"?"origin-top-left left-0":this.align==="right"?"origin-top-right right-0":"origin-top"}}};var IH=function(){var e=this,t=e._self._c;return t("div",{staticClass:"relative"},[t("div",{on:{click:function(r){e.open=!e.open}}},[e._t("trigger")],2),t("div",{directives:[{name:"show",rawName:"v-show",value:e.open,expression:"open"}],staticClass:"fixed inset-0 z-40",on:{click:function(r){e.open=!1}}}),t("transition",{attrs:{"enter-active-class":"transition ease-out duration-200","enter-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.open,expression:"open"}],staticClass:"absolute z-50 mt-2 rounded-md shadow-lg",class:[e.widthClass,e.alignmentClasses],staticStyle:{display:"none"},on:{click:function(r){e.open=!1}}},[t("div",{staticClass:"rounded-md ring-1 ring-black ring-opacity-5",class:e.contentClasses},[e._t("content")],2)])])],1)},OH=[],MH=ve(AH,IH,OH,!1,null,null);const IM=MH.exports,DH={props:["href","as"]};var NH=function(){var e=this,t=e._self._c;return t("div",[e.as=="button"?t("button",{staticClass:"block w-full px-4 py-2 text-sm leading-5 text-gray-700 text-left hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out",attrs:{type:"submit"}},[e._t("default")],2):t("inertia-link",{staticClass:"block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out",attrs:{href:e.href}},[e._t("default")],2)],1)},LH=[],FH=ve(DH,NH,LH,!1,null,null);const OM=FH.exports,$H={props:["href","active"],computed:{classes(){return this.active?"inline-flex items-center px-1 pt-1 border-b-2 border-fck-blue text-base md:text-lg font-medium leading-5 text-fck-blue focus:outline-none focus:border-fck-blue transition duration-150 ease-in-out":"inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-base md:text-lg font-medium leading-5 text-gray-500 hover:text-gray-700 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-300 transition duration-150 ease-in-out"}}};var BH=function(){var e=this,t=e._self._c;return t("inertia-link",{class:e.classes,attrs:{href:e.href}},[e._t("default")],2)},UH=[],jH=ve($H,BH,UH,!1,null,null);const Zu=jH.exports,qH={props:["active","href","as"],computed:{classes(){return this.active?"block pl-3 pr-4 py-2 border-l-4 border-fck-blue text-md font-medium text-fck-blue bg-fck-white focus:outline-none focus:text-fck-blue focus:bg-fck-white focus:border-fck-blue transition duration-150 ease-in-out":"block pl-3 pr-4 py-2 border-l-4 border-transparent text-md font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 hover:border-gray-300 focus:outline-none focus:text-gray-800 focus:bg-gray-50 focus:border-gray-300 transition duration-150 ease-in-out"}}};var zH=function(){var e=this,t=e._self._c;return t("div",[e.as=="button"?t("button",{staticClass:"w-full text-left",class:e.classes},[e._t("default")],2):t("inertia-link",{class:e.classes,attrs:{href:e.href}},[e._t("default")],2)],1)},WH=[],HH=ve(qH,zH,WH,!1,null,null);const E2=HH.exports,VH={components:{JetApplicationMark:RM,JetBanner:AM,JetDropdown:IM,JetDropdownLink:OM,JetNavLink:Zu,JetResponsiveNavLink:E2},data(){return{showNavigationDropdown:!1}},methods:{toggleNavigationDropdown(){this.showNavigationDropdown=!this.showNavigationDropdown},logout(){this.$inertia.post(route("logout"))}}};var GH=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"min-h-screen bg-gray-100 flex flex-col"},[t("header",{staticClass:"bg-white"},[t("nav",{staticClass:"mx-auto flex max-w-7xl items-center justify-between sm:p-4 lg:px-8",attrs:{"aria-label":"Global"}},[t("div",{staticClass:"flex lg:flex-1"},[t("jet-nav-link",{staticClass:"p-0",attrs:{href:e.route("dashboard")}},[t("span",{staticClass:"sr-only"},[e._v("FCK Profile")]),t("img",{staticClass:"h-12 w-auto",attrs:{src:"/img/FCK_Profil_Blue.svg",alt:""}})])],1),t("div",{staticClass:"flex lg:hidden"},[t("button",{staticClass:"rounded-md p-2.5 text-gray-700",attrs:{type:"button"},on:{click:this.toggleNavigationDropdown}},[t("span",{staticClass:"sr-only"},[e._v("Open menu")]),t("svg",{staticClass:"h-6 w-6",attrs:{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h16"}})])])]),t("div",{staticClass:"hidden lg:flex lg:gap-x-12"},[t("jet-nav-link",{staticClass:"text-sm font-semibold leading-6 text-gray-900",class:{"border-b-2":e.route().current("user.tickets")},attrs:{href:e.route("user.tickets")}},[e._v(e._s(e.$trans("layouts.appLayout.tickets")))]),t("jet-nav-link",{staticClass:"text-sm font-semibold leading-6 text-gray-900",class:{"border-b-2":e.route().current("user.fckaway")},attrs:{href:e.route("user.fckaway")}},[e._v(e._s(e.$trans("layouts.appLayout.away")))]),t("jet-nav-link",{staticClass:"text-sm font-semibold leading-6 text-gray-900",class:{"border-b-2":e.route().current("user.webshop")},attrs:{href:e.route("user.webshop")}},[e._v(e._s(e.$trans("layouts.appLayout.webshop")))]),t("jet-nav-link",{staticClass:"text-sm font-semibold leading-6 text-gray-900",class:{"border-b-2":e.route().current("profile.show")},attrs:{href:e.route("profile.show")}}
1,[e._v(e._s(e.$trans("layouts.appLayout.profile")))])],1),t("div",{staticClass:"hidden lg:flex lg:flex-1 lg:justify-end"},[t("form",{attrs:{method:"POST"},on:{submit:function(r){return r.preventDefault(),e.logout.apply(null,arguments)}}},[t("button",{staticClass:"text-sm font-semibold leading-6 text-gray-900"},[e._v(e._s(e.$trans("layouts.appLayout.logout"))),t("span",{attrs:{"aria-hidden":"true"}},[e._v("â")])])])]),t("div",{staticClass:"lg:hidden",class:{hidden:!e.showNavigationDropdown},attrs:{role:"dialog","aria-modal":"true"}},[t("div",{staticClass:"fixed inset-0 z-10"}),t("div",{staticClass:"fixed inset-y-0 right-0 z-10 w-full overflow-y-auto bg-white sm:max-w-sm sm:ring-1 sm:ring-gray-900/10"},[t("div",{staticClass:"flex items-center justify-between p-1"},[e._m(0),t("button",{staticClass:"-m-1.5 rounded-md p-2.5 text-gray-700",attrs:{type:"button"},on:{click:e.toggleNavigationDropdown}},[t("span",{staticClass:"sr-only"},[e._v("Close menu")]),t("svg",{staticClass:"h-6 w-6",attrs:{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"}})])])]),t("div",{staticClass:"mt-2 flow-root"},[t("div",{staticClass:"-my-6 divide-y divide-gray-500/10"},[t("div",{staticClass:"space-y-2 py-6"},[t("jet-responsive-nav-link",{staticClass:"-mx-3 block rounded-lg px-3 py-2 text-lg font-semibold leading-7 text-gray-900 hover:bg-gray-50",attrs:{href:e.route("user.tickets")}},[e._v(e._s(e.$trans("layouts.appLayout.tickets")))]),t("jet-responsive-nav-link",{staticClass:"-mx-3 block rounded-lg px-3 py-2 text-lg font-semibold leading-7 text-gray-900 hover:bg-gray-50",attrs:{href:e.route("user.fckaway")}},[e._v(e._s(e.$trans("layouts.appLayout.away")))]),t("jet-responsive-nav-link",{staticClass:"-mx-3 block rounded-lg px-3 py-2 text-lg font-semibold leading-7 text-gray-900 hover:bg-gray-50",attrs:{href:e.route("user.webshop")}},[e._v(e._s(e.$trans("layouts.appLayout.webshop")))]),t("jet-responsive-nav-link",{staticClass:"-mx-3 block rounded-lg px-3 py-2 text-lg font-semibold leading-7 text-gray-900 hover:bg-gray-50",attrs:{href:e.route("profile.show")}}
1,[e._v(e._s(e.$trans("layouts.appLayout.profile")))])],1),t("div",{staticClass:"p-6"},[t("form",{attrs:{method:"POST"},on:{submit:function(r){return r.preventDefault(),e.logout.apply(null,arguments)}}},[t("button",{staticClass:"text-sm font-semibold leading-6 text-gray-900"},[e._v(e._s(e.$trans("layouts.appLayout.logout"))),t("span",{attrs:{"aria-hidden":"true"}},[e._v("â")])])])])])])])])])]),t("main",{staticClass:"flex flex-col align-center flex-1"},[e._t("default")],2),t("portal-target",{attrs:{name:"modal",multiple:""}})],1)])},KH=[function(){var n=this,e=n._self._c;return e("a",{attrs:{href:"#"}},[e("span",{staticClass:"sr-only"},[n._v("FCK Profil")]),e("img",{staticClass:"h-12 w-auto",attrs:{src:"/img/FCK_Profil_Blue.svg",alt:""}})])}],YH=ve(VH,GH,KH,!1,null,null);const ta=YH.exports,XH={props:["tokens","availablePermissions","defaultPermissions"],components:{ApiTokenManager:PM,AppLayout:ta}};var JH=function(){var e=this,t=e._self._c;return t("app-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" API Tokens ")])]},proxy:!0}])},[t("div",[t("div",{staticClass:"max-w-7xl mx-auto py-10 sm:px-6 lg:px-8"},[t("api-token-manager",{attrs:{tokens:e.tokens,"available-permissions":e.availablePermissions,"default-permissions":e.defaultPermissions}})],1)])])},QH=[],ZH=ve(XH,JH,QH,!1,null,null);const eV=ZH.exports,tV=Object.freeze(Object.defineProperty({__proto__:null,default:eV},Symbol.toStringTag,{value:"Module"})),nV={components:{JetDialogModal:Ep,JetSecondaryButton:Br,JetButton:mn,JetCheckbox:Pp},props:{show:{type:Boolean,default:!1}},data(){return{selected:["quarantine","warning","person_of_interest"]}},computed:{lists(){return[{value:"quarantine",label:this.$trans("admin.quarantine.quarantines")},{value:"warning",label:this.$trans("admin.quarantine.warnings")},{value:"person_of_interest",label:this.$trans("admin.quarantine.person_of_interest")}]}},methods:{close(){this.$emit("close")},download(){if(this.selected.length===0)return;const n=this.selected.map(e=>`lists[]=${encodeURIComponent(e)}`).join("&");window.open(`${this.route("admin.quarantines.download-images")}?${n}`,"_blank"),this.close()}}};var rV=function(){var e=this,t=e._self._c;return t("jet-dialog-modal",{attrs:{show:e.show,"max-width":"md"},on:{close:e.close},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.$trans("admin.quarantine.download_images"))+" ")]},proxy:!0},{key:"content",fn:function(){return[t("p",{staticClass:"text-sm text-gray-600 mb-4"},[e._v(" "+e._s(e.$trans("admin.quarantine.download_select_lists"))+" ")]),t("div",{staticClass:"space-y-3"},e._l(e.lists,function(r){return t("label",{key:r.value,staticClass:"flex items-center space-x-3 cursor-pointer"},[t("jet-checkbox",{attrs:{value:r.value},model:{value:e.selected,callback:function(i){e.selected=i},expression:"selected"}}),t("span",{staticClass:"text-sm"},[e._v(e._s(r.label))])],1)}),0),e.selected.length===0?t("p",{staticClass:"mt-4 text-sm text-red-600"},[e._v(" "+e._s(e.$trans("admin.quarantine.download_select_at_least_one"))+" ")]):e._e()]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){return e.close.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("admin.quarantine.download_cancel"))+" ")]),t("jet-button",{staticClass:"ml-2",class:{"opacity-50 cursor-not-allowed":e.selected.length===0},attrs:{disabled:e.selected.length===0},nativeOn:{click:function(r){return e.download.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("admin.quarantine.download_images"))+" ")])]},proxy:!0}])})},iV=[],aV=ve(nV,rV,iV,!1,null,null);const MM=aV.exports,sV=Object.freeze(Object.defineProperty({__proto__:null,default:MM},Symbol.toStringTag,{value:"Module"})),oV={components:{JetApplicationMark:RM,JetBanner:AM,JetDropdown:IM,JetDropdownLink:OM,JetNavLink:Zu,JetResponsiveNavLink:E2,DownloadImagesModal:MM},data(){return{showingNavigationDropdown:!1,showingApplicationsDropdown:!0,showingQuarantinesDropdown:!0,showQuarantineDownloadModal:!1}},methods:{openQuarantineDownloadModal(){this.showingNavigationDropdown=!1,this.showQuarantineDownloadModal=!0},toggleApplicationsDropdown(){this.showingApplicationsDropdown=!this.showingApplicationsDropdown},toggleQuarantinesDropdown(){this.showingQuarantinesDropdown=!this.showingQuarantinesDropdown},logout(){this.$inertia.post(route("logout"))}}};var cV=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"root flow-root"}),t("jet-banner"),t("div",{staticClass:"flex flex-row bg-gray-100 text-gray-800 min-h-screen"},[t("aside",{staticClass:"hidden md:block sidebar min-w-[300px] w-64 flex-shrink md:shadow transform -translate-x-full md:translate-x-0 transition-transform duration-150 ease-in",staticStyle:{"background-color":"#000f4b"}},[e._m(0),t("div",{staticClass:"sidebar-content px-4 py-6 text-white"},[t("ul",{staticClass:"flex flex-col w-full"},[t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.dashboard"),"bg-gray-100":e.route().current("admin.dashboard")},attrs:{href:e.route("admin.dashboard")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"h-6 w-6",attrs:{fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"}})])]),t("span",{staticClass:"ml-3 capitalize"}
1,[e._v(e._s(e.$trans("admin.nav.dashboard")))])])],1),e.$page.props.user.permissions.some(r=>r.name==="users.view")?t("li",{staticClass:"my-px"},[t("span",{staticClass:"flex font-black font-medium text-sm text-white px-4 my-4 uppercase"},[e._v(e._s(e.$trans("admin.nav.section_profil")))])]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="users.view")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.users.index"),"bg-gray-100":e.route().current("admin.users.index")},attrs:{href:e.route("admin.users.index")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"h-6 w-6",attrs:{fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}})])]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.nav.users")))])])],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="companies.view")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.companies.index"),"bg-gray-100":e.route().current("admin.companies.index")},attrs:{href:e.route("admin.companies.index")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"h-6 w-6",attrs:{fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"}})])]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.nav.companies")))])])],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="away.view-all")?t("li",{staticClass:"my-px"},[t("span",{staticClass:"flex font-black font-medium text-sm text-white px-4 my-4 uppercase"},[e._v(e._s(e.$trans("admin.nav.section_away")))])]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="away.view-all")?t("li",{staticClass:"my-px"},[t("button",{staticClass:"flex w-full items-center gap-x-3 rounded-md p-2 text-left text-sm font-semibold leading-6 hover:bg-gray-100 hover:text-gray-700",attrs:{type:"button","aria-controls":"sub-menu-1","aria-expanded":"false"},on:{click:this.toggleApplicationsDropdown}},[t("svg",{staticClass:"h-6 w-6 shrink-0 text-gray-400",attrs:{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"}})]),e._v(" "+e._s(e.$trans("admin.nav.members"))+" "),t("svg",{staticClass:"ml-auto h-5 w-5 shrink-0 text-gray-400",class:{"rotate-90 text-gray-500":this.showingApplicationsDropdown,"text-gray-400":!this.showingApplicationsDropdown},attrs:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"}})])]),t("ul",{staticClass:"mt-1 px-2",class:{block:this.showingApplicationsDropdown,hidden:!this.showingApplicationsDropdown},attrs:{id:"sub-menu-1"}},[e.$page.props.user.permissions.some(r=>r.name==="away.view-approved")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.fck-away.approved"),"bg-gray-100":e.route().current("admin.fck-away.approved")},attrs:{href:e.route("admin.fck-away.approved")}},[t("svg",{staticClass:"size-6 w-6 h-6 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 0 1-1.043 3.296 3.745 3.745 0 0 1-3.296 1.043A3.745 3.745 0 0 1 12 21c-1.268 0-2.39-.63
1-3.068-1.593a3.746 3.746 0 0 1-3.296-1.043 3.745 3.745 0 0 1-1.043-3.296A3.745 3.745 0 0 1 3 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 0 1 1.043-3.296 3.746 3.746 0 0 1 3.296-1.043A3.746 3.746 0 0 1 12 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 0 1 3.296 1.043 3.746 3.746 0 0 1 1.043 3.296A3.745 3.745 0 0 1 21 12Z"}})]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.nav.active_members")))])])],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="away.view-pending")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.fck-away.applications"),"bg-gray-100":e.route().current("admin.fck-away.applications")},attrs:{href:e.route("admin.fck-away.applications")}},[t("svg",{staticClass:"size-6 w-6 h-6 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}})]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.nav.pending_approval")))])])],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="away.view-pending")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.fck-away.unpaid"),"bg-gray-100":e.route().current("admin.fck-away.unpaid")},attrs:{href:e.route("admin.fck-away.unpaid")}},[t("svg",{staticClass:"size-6 w-6 h-6 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 18.75a60.07 60.07 0 0 1 15.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 0 1 3 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 0 0-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 0 1-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 0 0 3 15h-.75M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm3 0h.008v.008H18V10.5Zm-12 0h.008v.008H6V10.5Z"}})]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.nav.missing_payment")))])])],1):e._e()])]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="away.scan-access")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.scan.index"),"bg-gray-100":e.route().current("admin.scan.index")},attrs:{href:e.route("admin.scan.index")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"w-6 h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}}),t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"}})])]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.nav.scan")))])])],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="away.settings-manage")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.fck-away"),"bg-gray-100":e.route().current("admin.fck-away")},attrs:{href:e.route("admin.fck-away")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"h-6 w-6",attrs:{fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}}),t("path",{attrs:{d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}})])]),t("span",{staticClass:"ml-3 capitalize"}
1,[e._v(e._s(e.$trans("admin.nav.settings")))])])],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="quarantine.view")?t("li",{staticClass:"my-px"},[t("span",{staticClass:"flex font-black font-medium text-sm text-white px-4 my-4 uppercase capitalize"},[e._v(e._s(e.$trans("admin.quarantine.quarantines")))])]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="quarantine.view")?t("li",{staticClass:"my-px"},[t("div",[t("button",{staticClass:"flex w-full items-center gap-x-3 rounded-md p-2 text-left text-sm font-semibold leading-6 hover:bg-gray-100 hover:text-gray-700",attrs:{type:"button","aria-controls":"sub-menu-1","aria-expanded":"false"},on:{click:this.toggleQuarantinesDropdown}},[t("svg",{staticClass:"w-6 h-6 shrink-0 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.05 4.575a1.575 1.575 0 10-3.15 0v3m3.15-3v-1.5a1.575 1.575 0 013.15 0v1.5m-3.15 0l.075 5.925m3.075.75V4.575m0 0a1.575 1.575 0 013.15 0V15M6.9 7.575a1.575 1.575 0 10-3.15 0v8.175a6.75 6.75 0 006.75 6.75h2.018a5.25 5.25 0 003.712-1.538l1.732-1.732a5.25 5.25 0 001.538-3.712l.003-2.024a.668.668 0 01.198-.471 1.575 1.575 0 10-2.228-2.228 3.818 3.818 0 00-1.12 2.687M6.9 7.575V12m6.27 4.318A4.49 4.49 0 0116.35 15m.002 0h-.002"}})]),e._v(" "+e._s(e.$trans("admin.quarantine.quarantines"))+" "),t("svg",{staticClass:"ml-auto h-5 w-5 shrink-0 text-gray-400",class:{"rotate-90 text-gray-500":this.showingQuarantinesDropdown,"text-gray-400":!this.showingQuarantinesDropdown},attrs:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z","clip-rule":"evenodd"}})])]),t("ul",{staticClass:"mt-1 px-2",class:{block:this.showingQuarantinesDropdown,hidden:!this.showingQuarantinesDropdown},attrs:{id:"sub-menu-1"}},[t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",attrs:{href:e.route("admin.quarantines.index",{category:"quarantine"})}},[t("svg",{staticClass:"size-6 w-6 h-6 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"}})]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.quarantines")))])])],1),t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",attrs:{href:e.route("admin.quarantines.index",{category:"warning"})}},[t("svg",{staticClass:"size-6 w-6 h-6 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}})]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.warnings")))])])],1),t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",attrs:{href:e.route("admin.quarantines.index",{category:"person_of_interest"})}},[t("svg",{staticClass:"size-6 w-6 h-6 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"}})]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.person_of_interest")))])])],1
1),t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.quarantines.expired"),"bg-gray-100":e.route().current("admin.quarantines.expired")},attrs:{href:e.route("admin.quarantines.expired")}},[t("svg",{staticClass:"size-6 w-6 h-6 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"}})]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.expired_short")))])])],1)])])]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="quarantine.create")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.quarantines.create"),"bg-gray-100":e.route().current("admin.quarantines.create")},attrs:{href:e.route("admin.quarantines.create"),target:"_blank"}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"w-6 h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zM4 19.235v-.11a6.375 6.375 0 0112.75 0v.109A12.318 12.318 0 0110.374 21c-2.331 0-4.512-.645-6.374-1.766z"}})])]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.create-quarantine")))])])],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="quarantine.download")?t("li",{staticClass:"my-px"},[t("button",{staticClass:"w-full text-left flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",attrs:{type:"button"},on:{click:function(r){e.showQuarantineDownloadModal=!0}}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"size-6 h-6 w-6 text-gray.400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"m9 13.5 3 3m0 0 3-3m-3 3v-6m1.06-4.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}})])]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.download_images")))])])]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="commentary.broadcast")?t("li",{staticClass:"my-px"},[t("span",{staticClass:"flex font-black font-medium text-sm text-white px-4 my-4 uppercase"},[e._v(e._s(e.$trans("admin.nav.section_commentary")))])]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="commentary.broadcast")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.commentary.broadcasts")||e.route().current("admin.commentary.broadcast"),"bg-gray-100":e.route().current("admin.commentary.broadcasts")||e.route().current("admin.commentary.broadcast")},attrs:{href:e.route("admin.commentary.broadcasts")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"h-6 w-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 18.75a6 6 0 0 0 6-6v-1.5m-6 7.5a6 6 0 0 1-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 0 1-3-3V4.5a3 3 0 1 1 6 0v8.25a3 3 0 0 1-3 3Z"}})])]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.nav.commentary_broadcasts")))])])],1
1):e._e(),e.$page.props.user.roles.some(r=>r.name==="Admin")||e.$page.props.user.permissions.some(r=>["admin.stats","admin.live-users","activity-log.view","jobs.view"].includes(r.name))?t("li",{staticClass:"my-px"},[t("span",{staticClass:"flex font-black font-medium text-sm text-white px-4 my-4 uppercase"},[e._v(e._s(e.$trans("admin.nav.section_system")))])]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="stats.view")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.stats"),"bg-gray-100":e.route().current("admin.stats")},attrs:{href:e.route("admin.stats")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"w-6 h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z"}})])]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.nav.stats")))])])],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="stats.view")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.entitlements.index"),"bg-gray-100":e.route().current("admin.entitlements.index")},attrs:{href:e.route("admin.entitlements.index")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"w-6 h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z"}})])]),t("span",{staticClass:"ml-3 capitalize"},[e._v("Abonnementer")])])],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="exports.subscriptions")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.subscription-exports.index"),"bg-gray-100":e.route().current("admin.subscription-exports.index")},attrs:{href:e.route("admin.subscription-exports.index")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"w-6 h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"}})])]),t("span",{staticClass:"ml-3 capitalize"},[e._v("Abonnements-eksport")])])],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="live-users.view")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",attrs:{href:e.route("admin.live-users")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"size-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.288 15.038a5.25 5.25 0 0 1 7.424 0M5.106 11.856c3.807-3.808 9.98-3.808 13.788 0M1.924 8.674c5.565-5.565 14.587-5.565 20.152 0M12.53 18.22l-.53.53-.53-.53a.75.75 0 0 1 1.06 0Z"}})])]),t("span",{staticClass:"ml-3 capitalize"}
1,[e._v(e._s(e.$trans("admin.nav.users_online")))])])],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="jobs.view")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",attrs:{href:e.route("horizon.index")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"h-6 w-6",attrs:{fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"}})])]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.nav.jobs")))])])],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="activity-log.view")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.activity-log"),"bg-gray-100":e.route().current("admin.activity-log")},attrs:{href:e.route("admin.activity-log")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"h-6 w-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}})])]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.nav.activity_log")))])])],1):e._e(),e.$page.props.user.roles.some(r=>r.name==="Admin")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.video-sessions.index"),"bg-gray-100":e.route().current("admin.video-sessions.index")},attrs:{href:e.route("admin.video-sessions.index")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"h-6 w-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z"}})])]),t("span",{staticClass:"ml-3 capitalize"},[e._v(e._s(e.$trans("admin.nav.video_sessions")))])])],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="apikeys:handle")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.api-keys.index"),"bg-gray-100":e.route().current("admin.api-keys.index")},attrs:{href:e.route("admin.api-keys.index")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"h-6 w-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"}})])]),t("span",{staticClass:"ml-3"},[e._v(e._s(e.$trans("admin.nav.api_keys")))])])],1):e._e(),e.$page.props.user.roles.some(r=>r.name==="Admin")?t("li",{staticClass:"my-px"},[t("inertia-link",{staticClass:"flex flex-row items-center h-10 px-3 rounded-lg hover:bg-gray-100 hover:text-gray-700",class:{"text-gray-700":e.route().current("admin.roles.index"),"bg-gray-100":e.route().current("admin.roles.index")},attrs:{href:e.route("admin.roles.index")}},[t("span",{staticClass:"flex items-center justify-center text-lg text-gray-400"},[t("svg",{staticClass:"h-6 w-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"}})])]),t("span",{staticClass:"ml-3 capitalize"}
1,[e._v(e._s(e.$trans("admin.nav.role_management")))])])],1):e._e()])])]),t("main",{staticClass:"main flex flex-col w-full md:ml-0 transition-all duration-150 ease-in"},[t("header",{staticClass:"header fixed w-full z-50"},[t("div",{staticClass:"flex justify-between md:hidden items-center bg-white shadow py-1 px-4"},[t("h1",{staticClass:"font-black text-sm uppercase visible md:hidden"},[e._v(e._s(e.$trans("admin.nav.section_profil")))]),t("div",{staticClass:"-mr-2 flex items-center md:hidden"},[t("button",{staticClass:"inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out",on:{click:function(r){e.showingNavigationDropdown=!e.showingNavigationDropdown}}},[t("svg",{staticClass:"h-6 w-6",attrs:{stroke:"currentColor",fill:"none",viewBox:"0 0 24 24"}},[t("path",{class:{hidden:e.showingNavigationDropdown,"inline-flex":!e.showingNavigationDropdown},attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"}}),t("path",{class:{hidden:!e.showingNavigationDropdown,"inline-flex":e.showingNavigationDropdown},attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"}})])])])]),t("div",{staticClass:"md:hidden fixed inset-0",class:{block:e.showingNavigationDropdown,hidden:!e.showingNavigationDropdown}},[t("div",{staticClass:"fixed inset-0 bg-black bg-opacity-50",on:{click:function(r){e.showingNavigationDropdown=!1}}}),t("div",{staticClass:"fixed inset-y-0 left-0 w-full max-w-sm bg-white shadow-xl z-50 overflow-y-auto"},[t("div",{staticClass:"flex items-center justify-between p-4 border-b"},[t("h1",{staticClass:"font-black text-sm uppercase"},[e._v(e._s(e.$trans("admin.nav.section_profil")))]),t("button",{staticClass:"p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none",on:{click:function(r){e.showingNavigationDropdown=!1}}},[t("svg",{staticClass:"h-6 w-6",attrs:{stroke:"currentColor",fill:"none",viewBox:"0 0 24 24"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"}})])])]),t("div",[t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.dashboard"),active:e.route().current("admin.dashboard")}},[e._v(" "+e._s(e.$trans("admin.nav.dashboard"))+" ")]),e.$page.props.user.permissions.some(r=>r.name==="users.view")?t("p",{staticClass:"text-gray-400 text-xs uppercase font-bold px-2 my-1"},[e._v(e._s(e.$trans("admin.nav.section_profil")))]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="users.view")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.users.index"),active:e.route().current("admin.users.index")}},[e._v(" "+e._s(e.$trans("layouts.appLayout.users"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="companies.view")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.companies.index"),active:e.route().current("admin.companies.index")}},[e._v(" "+e._s(e.$trans("admin.nav.companies"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="away.view-approved")?t("p",{staticClass:"text-gray-400 text-xs uppercase font-bold px-2 my-1"},[e._v(e._s(e.$trans("admin.nav.section_away"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="away.view-approved")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.fck-away.approved"),active:e.route().current("admin.fck-away.approved")}},[e._v(" "+e._s(e.$trans("admin.nav.active_members"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="away.view-pending")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.fck-away.applications"),active:e.route().current("admin.fck-away.applications")}},[e._v(" "+e._s(e.$trans("admin.nav.pending_approval"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="away.scan-access")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.scan.index"),active:e.route().current("admin.scan.index")}}
1,[e._v(" "+e._s(e.$trans("admin.nav.scan"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="away.settings-manage")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.fck-away"),active:e.route().current("admin.fck-away")}},[e._v(" "+e._s(e.$trans("admin.nav.settings"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="quarantine.view")?t("p",{staticClass:"text-gray-400 text-xs uppercase font-bold px-2 my-1"},[e._v(e._s(e.$trans("admin.quarantine.quarantines")))]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="quarantine.view")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.quarantines.index",{category:"quarantine"})}},[e._v(" "+e._s(e.$trans("admin.quarantine.quarantines"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="quarantine.view")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.quarantines.index",{category:"warning"})}},[e._v(" "+e._s(e.$trans("admin.quarantine.warnings"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="quarantine.view")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.quarantines.index",{category:"person_of_interest"})}},[e._v(" "+e._s(e.$trans("admin.quarantine.person_of_interest"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="quarantine.view")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.quarantines.expired"),active:e.route().current("admin.quarantines.expired")}},[e._v(" "+e._s(e.$trans("admin.quarantine.expired_quarantines"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="quarantine.create")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.quarantines.create"),active:e.route().current("admin.quarantines.create")}},[e._v(" "+e._s(e.$trans("admin.quarantine.create-quarantine"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="quarantine.download")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{as:"button"},nativeOn:{click:function(r){return e.openQuarantineDownloadModal.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("admin.quarantine.download_images"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="commentary.broadcast")?t("p",{staticClass:"text-gray-400 text-xs uppercase font-bold px-2 my-1"},[e._v(e._s(e.$trans("admin.nav.section_commentary")))]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="commentary.broadcast")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.commentary.broadcasts"),active:e.route().current("admin.commentary.broadcasts")||e.route().current("admin.commentary.broadcast")}},[e._v(" "+e._s(e.$trans("admin.nav.commentary_broadcasts"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="jobs.view")?t("p",{staticClass:"text-gray-400 text-xs uppercase font-bold px-2 my-1"},[e._v(e._s(e.$trans("admin.nav.section_system")))]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="stats.view")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.stats"),active:e.route().current("admin.stats")}},[e._v(" "+e._s(e.$trans("admin.nav.stats"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="apikeys:handle")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.api-keys.index"),active:e.route().current("admin.api-keys.index")}},[e._v(" "+e._s(e.$trans("admin.nav.api_keys"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="live-users.view")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.live-users"),active:e.route().current("admin.live-users")}},[e._v(" "+e._s(e.$trans("admin.nav.users_online"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="jobs.view")?t("a",{staticClass:"block pl-3 pr-4 py-2 border-l-4 border-transparent text-xs font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 hover:border-gray-300 focus:outline-none focus:text-gray-800 focus:bg-gray-50 focus:border-gray-300 transition duration-150 ease-in-out",attrs:{href:e.route("horizon.index"),active:e.route().current("horizon.index")}},[e._v(" "+e._s(e.$trans("layouts.appLayout.queue"))+" ")]):e._e(
1),e.$page.props.user.permissions.some(r=>r.name==="activity-log.view")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.activity-log"),active:e.route().current("admin.activity-log")}},[e._v(" "+e._s(e.$trans("admin.nav.activity_log"))+" ")]):e._e(),e.$page.props.user.permissions.some(r=>r.name==="roles.assign.admin")?t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("admin.roles.index"),active:e.route().current("admin.roles.index")}},[e._v(" "+e._s(e.$trans("admin.nav.role_management"))+" ")]):e._e()],1)]),t("div",{staticClass:"pt-4 pb-1 border-t border-gray-200"},[t("div",{staticClass:"flex items-center px-4"},[e.$page.props.jetstream.managesProfilePhotos?t("div",{staticClass:"flex-shrink-0 mr-3"},[t("img",{staticClass:"h-10 w-10 rounded-full object-cover",attrs:{src:e.$page.props.user.profile_photo_url,alt:e.$page.props.user.name}})]):e._e(),t("div",[t("div",{staticClass:"font-medium text-base text-gray-800"},[e._v(" "+e._s(e.$page.props.user.firstname)+" "+e._s(e.$page.props.user.lastname)+" ")]),t("div",{staticClass:"font-medium text-sm text-gray-500"},[e._v(" "+e._s(e.$page.props.user.email)+" ")])])]),t("div",{staticClass:"mt-3 space-y-1"},[t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{href:e.route("dashboard"),active:e.route().current("dashboard")}},[e._v(" "+e._s(e.$trans("admin.nav.section_profil"))+" ")]),t("form",{attrs:{method:"POST"},on:{submit:function(r){return r.preventDefault(),e.logout.apply(null,arguments)}}},[t("jet-responsive-nav-link",{staticClass:"text-xs font-regular font-light",attrs:{as:"button"}},[e._v(" "+e._s(e.$trans("layouts.appLayout.logout"))+" ")])],1)],1)])])]),t("div",{staticClass:"main-content mt-12 md:mt-0 flex flex-col h-full md:p-4 border-t-1 sm:border-t-0 border-gray-500"},[e._t("header"),t("div",{staticClass:"flex flex-col flex-grow sm:mt-4"},[e._t("default")],2)],2),t("portal-target",{attrs:{name:"modal",multiple:""}}),t("footer",{staticClass:"footer md:px-4 md:py-6"},[t("div",{staticClass:"footer-content"},[e._t("footer")],2)])],1)]),e.$page.props.user.permissions.some(r=>r.name==="quarantine.download")?t("download-images-modal",{attrs:{show:e.showQuarantineDownloadModal},on:{close:function(r){e.showQuarantineDownloadModal=!1}}}):e._e()],1)},uV=[function(){var n=this,e=n._self._c;return e("div",{staticClass:"sidebar-header flex items-center justify-center py-4"},[e("div",{staticClass:"inline-flex"},[e("a",{staticClass:"inline-flex flex-row items-center",attrs:{href:"#"}},[e("span",{staticClass:"leading-10 text-white text-2xl font-bold ml-1 uppercase"},[n._v("FCK Profil")])])])])}],lV=ve(oV,cV,uV,!1,null,null);const Gt=lV.exports,dV={name:"jet-pagination",props:["total","per_page","current_page","last_page","first_page_url","last_page_url","next_page_url","prev_page_url","path","from","to","data","search","searchFields"],components:{},methods:{focus(){this.$refs.input.focus()},update(n){this.$emit("input",n.target.checked)},pageClass(n){return["relative inline-flex items-center px-4 py-2 text-sm font-semibold",{"bg-blue-600 text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600":n===this.current_page,"text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0":n!==this.current_page}]}},computed:{pagesToShow(){let n=[];const e=this.current_page,t=this.last_page,r=2;for(let i=Math.max(2,e-r);i<=Math.min(t-1,e+r);i++)n.push(i);return e-r>2&&(this.shouldShowEllipsesBefore=!0),e+r<t-1&&(this.shouldShowEllipsesAfter=!0),n},shouldShowEllipsesBefore(){return this.current_page-2>2},shouldShowEllipsesAfter(){return this.current_page+2<this.last_page-1},computedPath(){if(this.search)return`${this.path}?search=${encodeURIComponent(this.search)}&`;if(this.searchFields){const n=new URLSearchParams;Object.keys(this.searchFields).forEach(t=>{this.searchFields[t]&&n.append(`searchFields[${t}]`,this.searchFields[t])});const e=n.toString();return e?`${this.path}?${e}&`:`${this.path}?`}if(this.first_page_url.includes("search=")){let n=decodeURIComponent(this.first_page_url);return`${this.path}?search=${encodeURIComponent(n.split("search=")[1].split("&page")[0])}&`}return`${this.path}?`}}};var fV=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex items-center justify-between border-t border-gray-200 bg-white px-4 py-3 sm:px-6"},[t("div",{staticClass:"flex flex-1 justify-between sm:hidden"},[e.prev_page_url?t("a",{staticClass:"relative inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50",attrs:{href:e.prev_page_url}}
1,[e._v("Previous")]):e._e(),e.next_page_url?t("a",{staticClass:"relative ml-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50",attrs:{href:e.next_page_url}},[e._v("Next")]):e._e()]),t("div",{staticClass:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between"},[t("div",[t("p",{staticClass:"text-sm text-gray-700"},[e._v(" Showing "),t("span",{staticClass:"font-medium"},[e._v(e._s(e.from))]),e._v(" to "),t("span",{staticClass:"font-medium"},[e._v(e._s(e.to))]),e._v(" of "),t("span",{staticClass:"font-medium"},[e._v(e._s(e.total))]),e._v(" results ")])]),t("div",[t("nav",{staticClass:"isolate inline-flex -space-x-px rounded-md shadow-sm",attrs:{"aria-label":"Pagination"}},[e.prev_page_url?t("inertia-link",{staticClass:"relative inline-flex items-center rounded-l-md px-2 py-2 text-gray-400 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0",attrs:{href:e.prev_page_url}},[e._v(" < ")]):e._e(),t("inertia-link",{class:e.pageClass(1),attrs:{href:`${e.computedPath}page=1`,"aria-current":"current_page === 1 ? 'page' : false"}},[e._v("1")]),e.shouldShowEllipsesBefore?t("span",{staticClass:"px-2 py-2"}
1,[e._v("...")]):e._e(),e._l(e.pagesToShow,function(r){return t("inertia-link",{key:r,class:e.pageClass(r),attrs:{href:`${e.computedPath}page=${r}`,"aria-current":"page === current_page ? 'page' : false"}},[e._v(e._s(r))])}),e.shouldShowEllipsesAfter?t("span",{staticClass:"px-2 py-2"},[e._v("...")]):e._e(),e.last_page>1?t("inertia-link",{class:e.pageClass(e.last_page),attrs:{href:`${e.computedPath}page=${e.last_page}`,"aria-current":"current_page === last_page ? 'page' : false"}},[e._v(e._s(e.last_page))]):e._e(),e.next_page_url?t("inertia-link",{staticClass:"relative inline-flex items-center rounded-r-md px-2 py-2 text-gray-400 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0",attrs:{href:e.next_page_url}},[e._v(" > ")]):e._e()],2)])])])},hV=[],pV=ve(dV,fV,hV,!1,null,null);const Rp=pV.exports;var Fr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function id(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function mV(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var Ay={exports:{}};/** 2 * @license 3 * Lodash <https://lodash.com/> 4 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 5 * Released under MIT license <https://lodash.com/license> 6 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 7 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 8 */Ay.exports;(function(n,e){(function(){var t,r="4.18.1",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",o="Invalid `variable` option passed into `_.template`",c="Invalid `imports` option passed into `_.template`",u="__lodash_hash_undefined__",l=500,d="__lodash_placeholder__",h=1,p=2,g=4,v=1,y=2,b=1,x=2,S=4,w=8,k=16,E=32,I=64,P=128,A=256,N=512,j=30,L="...",B=800,V=16,X=1,ne=2,se=3,ie=1/0,de=9007199254740991,ue=17976931348623157e292,Ce=NaN,we=4294967295,Fe=we-1,Ge=we>>>1,Ie=[["ary",P],["bind",b],["bindKey",x],["curry",w],["curryRight",k],["flip",N],["partial",E],["partialRight",I],["rearg",A]],He="[object Arguments]",ot="[object Array]",Je="[object AsyncFunction]",et="[object Boolean]",Ut="[object Date]",_t="[object DOMException]",mt="[object Error]",wt="[object Function]",Kt="[object GeneratorFunction]",Ct="[object Map]",kt="[object Number]",jn="[object Null]",zt="[object Object]",qn="[object Promise]",_r="[object Proxy]",On="[object RegExp]",hn="[object Set]",xn="[object String]",kn="[object Symbol]",St="[object Undefined]",Er="[object WeakMap]",Jn="[object WeakSet]",rn="[object ArrayBuffer]",sr="[object DataView]",Qn="[object Float32Array]",Pr="[object Float64Array]",Gr="[object Int8Array]",gt="[object Int16Array]",Rt="[object Int32Array]",Wt="[object Uint8Array]",Di="[object Uint8ClampedArray]",Kr="[object Uint16Array]",Ni="[object Uint32Array]",Yr=/\b__p \+= '';/g,Zn=/\b(__p \+=) '' \+/g,Ya=/(__e\(.*?\)|\b__t\)) \+\n'';/g,br=/&(?:amp|lt|gt|quot|#39);/g,Xa=/[&<>"']/g,na=RegExp(br.source),Os=RegExp(Xa.source),Ca=/<%-([\s\S]+?)%>/g,Ja=/<%([\s\S]+?)%>/g,ra=/<%=([\s\S]+?)%>/g,Ms=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ia=/^\w*$/,Ds=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qa=/[\\^$.*+?()[\]{}|]/g,dc=RegExp(Qa.source),Ns=/^\s+/,ko=/\s/,Sn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,cu=/\{\n\/\* \[wrapped with (.+)\] \*/,uu=/,? & /,lu=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Za=/[()=,{}\[\]\/\s]/,Ur=/\\(\\)?/g,or=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ls=/\w*$/,fc=/^[-+]0x[0-9a-f]+$/i,So=/^0b[01]+$/i,Fs=/^\[object .+?Constructor\]$/,du=/^0o[0-7]+$/i,Rr=/^(?:0|[1-9]\d*)$/,fu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 71,925 bytes, lines 8-27
87f]/g,$s=/($^)/,To=/['\n\r\u2028\u2029\\]/g,es="\\ud800-\\udfff",hu="\\u0300-\\u036f",Bs="\\ufe20-\\ufe2f",Eo="\\u20d0-\\u20ff",ts=hu+Bs+Eo,Vn="\\u2700-\\u27bf",ns="a-z\\xdf-\\xf6\\xf8-\\xff",aa="\\xac\\xb1\\xd7\\xf7",Us="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",pu="\\u2000-\\u206f",hc=" \\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",Po="A-Z\\xc0-\\xd6\\xd8-\\xde",rs="\\ufe0e\\ufe0f",Li=aa+Us+pu+hc,Fi="['â]",pc="["+es+"]",js="["+Li+"]",sa="["+ts+"]",oa="\\d+",mc="["+Vn+"]",wi="["+ns+"]",qs="[^"+es+Li+oa+Vn+ns+Po+"]",zs="\\ud83c[\\udffb-\\udfff]",gc="(?:"+sa+"|"+zs+")",Xr="[^"+es+"]",Jr="(?:\\ud83c[\\udde6-\\uddff]){2}",jr="[\\ud800-\\udbff][\\udc00-\\udfff]",qr="["+Po+"]",ka="\\u200d",cr="(?:"+wi+"|"+qs+")",mu="(?:"+qr+"|"+qs+")",Ro="(?:"+Fi+"(?:d|ll|m|re|s|t|ve))?",Ws="(?:"+Fi+"(?:D|LL|M|RE|S|T|VE))?",vc=gc+"?",Hs="["+rs+"]?",Mn="(?:"+ka+"(?:"+[Xr,Jr,jr].join("|")+")"+Hs+vc+")*",Ao="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",is=Hs+vc+Mn,Io="(?:"+[mc,Jr,jr].join("|")+")"+is,zn="(?:"+[Xr+sa+"?",sa,Jr,jr,pc].join("|")+")",O=RegExp(Fi,"g"),U=RegExp(sa,"g"),W=RegExp(zs+"(?="+zs+")|"+zn+is,"g"),q=RegExp([qr+"?"+wi+"+"+Ro+"(?="+[js,qr,"$"].join("|")+")",mu+"+"+Ws+"(?="+[js,qr+cr,"$"].join("|")+")",qr+"?"+cr+"+"+Ro,qr+"+"+Ws,yc,Ao,oa,Io].join("|"),"g"),Z=RegExp("["+ka+es+ts+rs+"]"),ge=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,me=["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"],$e=-1,oe={};oe[Qn]=oe[Pr]=oe[Gr]=oe[gt]=oe[Rt]=oe[Wt]=oe[Di]=oe[Kr]=oe[Ni]=!0,oe[He]=oe[ot]=oe[rn]=oe[et]=oe[sr]=oe[Ut]=oe[mt]=oe[wt]=oe[Ct]=oe[kt]=oe[zt]=oe[On]=oe[hn]=oe[xn]=oe[Er]=!1;var T={};T[He]=T[ot]=T[rn]=T[sr]=T[et]=T[Ut]=T[Qn]=T[Pr]=T[Gr]=T[gt]=T[Rt]=T[Ct]=T[kt]=T[zt]=T[On]=T[hn]=T[xn]=T[kn]=T[Wt]=T[Di]=T[Kr]=T[Ni]=!0,T[mt]=T[wt]=T[Er]=!1;var $={Ã:"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",Å¿:"s"},Y={"&":"&","<":"<",">":">",'"':""","'":"'"},le={"&":"&","<":"<",">":">",""":'"',"'":"'"},Oe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Re=parseFloat,Qe=parseInt,je=typeof Fr=="object"&&Fr&&Fr.Object===Object&&Fr,it=typeof self=="object"&&self&&self.Object===Object&&self,Xe=je||it||Function("return this")(),Tt=e&&!e.nodeType&&e,Mt=Tt&&!0&&n&&!n.nodeType&&n,bt=Mt&&Mt.exports===Tt,gn=bt&&je.process,Yt=function(){try{var fe=Mt&&Mt.require&&Mt.require("util").types;return fe||gn&&gn.binding&&gn.binding("util")}catch{}}(),ca=Yt&&Yt.isArrayBuffer,Sa=Yt&&Yt.isDate,Vs=Yt&&Yt.isMap,yd=Yt&&Yt.isRegExp,gu=Yt&&Yt.isSet,vu=Yt&&Yt.isTypedArray;function ua(fe,Se,_e){switch(_e.length){case 0:return fe.call(Se);case 1:return fe.call(Se,_e[0]);case 2:return fe.call(Se,_e[0],_e[1]);case 3:return fe.call(Se,_e[0],_e[1],_e[2])}return fe.apply(Se,_e)}function m1(fe,Se,_e,nt){for(var It=-1,wn=fe==null?0:fe.length;++It<wn;){var Qr=fe[It];Se(nt,Qr,_e(Qr),fe)}return nt}function la(fe,Se){for(var _e=-1,nt=fe==null?0:fe.length;++_e<nt&&Se(fe[_e],_e,fe)!==!1;);return fe}function g1(fe,Se){for(var _e=fe==null?0:fe.length;_e--&&Se(fe[_e],_e,fe)!==!1;);return fe}function Tv(fe,Se){for(var _e=-1,nt=fe==null?0:fe.length;++_e<nt;)if(!Se(fe[_e],_e,fe))return!1;return!0}function _c(fe,Se){for(var _e=-1,nt=fe==null?0:fe.length,It=0,wn=[];++_e<nt;){var Qr=fe[_e];Se(Qr,_e,fe)&&(wn[It++]=Qr)}return wn}function jf(fe,Se){var _e=fe==null?0:fe.length;return!!_e&&tt(fe,Se,0)>-1}function Wp(fe,Se,_e){for(var nt=-1,It=fe==null?0:fe.length;++nt<It;)if(_e(Se,fe[nt]))return!0;return!1}function Lt(fe,Se){for(var _e=-1,nt=fe==null?0:fe.length,It=Array(nt);++_e<nt;)It[_e]=Se(fe[_e],_e,fe);return It}function Gs(fe,Se){for(var _e=-1,nt=Se.length,It=fe.length;++_e<nt;)fe[It+_e]=Se[_e];return fe}function Hp(fe,Se,_e,nt){var It=-1,wn=fe==null?0:fe.length;for(nt&&wn&&(_e=fe[++It]);++It<wn;)_e=Se(_e,fe[It],It,fe);return _e}function D(fe,Se,_e,nt){var It=fe==null?0:fe.length;for(nt&&It&&(_e=fe[--It]);It--;)_e=Se(_e,fe[It],It,fe);return _e}function C(fe,Se){for(var _e=-1,nt=fe==null?0:fe.length;++_e<nt;)if(Se(fe[_e],_e,fe))return!0;return!1}var M=er("length");function K(fe){return fe.split("")}function te(fe){return fe.match(lu)||[]}function Te(fe,Se,_e){var nt;return _e(fe,function(It,wn,Qr){if(Se(It,wn,Qr))return nt=wn,!1}),nt}function ze(fe,Se,_e,nt){for(var It=fe.length,wn=_e+(nt?1:-1);nt?wn--:++wn<It;)if(Se(fe[wn],wn,fe))return wn;return-1}function tt(fe,Se,_e){return Se===Se?JU(fe,Se,_e):ze(fe,on,_e)}function At(fe,Se,_e,nt){for(var It=_e-1,wn=fe.length;++It<wn;)if(nt(fe[It],Se))return It;return-1}function on(fe){return fe!==fe}function vn(fe,Se){var _e=fe==null?0:fe.length;return _e?Vp(fe,Se)/_e:Ce}function er(fe){return function(Se){return Se==null?t:Se[fe]}}function ul(fe){return function(Se){return fe==null?t:fe[Se]}}function Ev(fe,Se,_e,nt,It){return It(fe,function(wn,Qr,Dn){_e=nt?(nt=!1,wn):Se(_e,wn,Qr,Dn)}),_e}function Pv(fe,Se){var _e=fe.length;for(fe.sort(Se);_e--;)fe[_e]=fe[_e].value;return fe}function Vp(fe,Se){for(var _e,nt=-1,It=fe.length;++nt<It;){var wn=Se(fe[nt]);wn!==t&&(_e=_e===t?wn:_e+wn)}return _e}function qf(fe,Se){for(var _e=-1,nt=Array(fe);++_e<fe;)nt[_e]=Se(_e);return nt}function v1(fe,Se){return Lt(Se,function(_e){return[_e,fe[_e]]})}function Gp(fe){return fe&&fe.slice(0,CP(fe)+1).replace(Ns,"")}function da(fe){return function(Se){return fe(Se)}}function Kp(fe,Se){return Lt(Se,function(_e){return fe[_e]})}function ll(fe,Se){return fe.has(Se)}function Yp(fe,Se){for(var _e=-1,nt=fe.length;++_e<nt&&tt(Se,fe[_e],0)>-1;);return _e}function Xp(fe,Se){for(var _e=fe.length;_e--&&tt(Se,fe[_e],0)>-1;);return _e}function Jp(fe,Se){for(var _e=fe.length,nt=0;_e--;)fe[_e]===Se&&++nt;return nt}var Qp=ul($),Rv=ul(Y);function y1(fe){return"\\"+Oe[fe]}function _1(fe,Se){return fe==null?t:fe[Se]}function dl(fe){return Z.test(fe)}function b1(fe){return ge.test(fe)}function Av(fe){for(var Se,_e=[];!(Se=fe.next()).done;)_e.push(Se.value);return _e}function x1(fe){var Se=-1,_e=Array(fe.size);return fe.forEach(function(nt,It){_e[++Se]=[It,nt]}),_e}function wP(fe,Se){return function(_e){return fe(Se(_e))}}function fl(fe,Se){for(var _e=-1,nt=fe.length,It=0,wn=[];++_e<nt;){var Qr=fe[_e];(Qr===Se||Qr===d)&&(fe[_e]=d,wn[It++]=_e)}return wn}function Iv(fe){var Se=-1,_e=Array(fe.size);return fe.forEach(function(nt){_e[++Se]=nt}),_e}function XU(fe){var Se=-1,_e=Array(fe.size);return fe.forEach(function(nt){_e[++Se]=[nt,nt]}),_e}function JU(fe,Se,_e){for(var nt=_e-1,It=fe.length;++nt<It;)if(fe[nt]===Se)return nt;return-1}function QU(fe,Se,_e){for(var nt=_e+1;nt--;)if(fe[nt]===Se)return nt;return nt}function zf(fe){return dl(fe)?e8(fe):M(fe)}function Oo(fe){return dl(fe)?t8(fe):K(fe)}function CP(fe){for(var Se=fe.length;Se--&&ko.test(fe.charAt(Se)););return Se}var ZU=ul(le);function e8(fe){for(var Se=W.lastIndex=0;W.test(fe);)++Se;return Se}function t8(fe){return fe.match(W)||[]}function n8(fe){return fe.match(q)||[]}var r8=function fe(Se){Se=Se==null?Xe:Wf.defaults(Xe.Object(),Se,Wf.pick(Xe,me));var _e=Se.Array,nt=Se.Date,It=Se.Error,wn=Se.Function,Qr=Se.Math,Dn=Se.Object,w1=Se.RegExp,i8=Se.String,Ks=Se.TypeError,Ov=_e.prototype,a8=wn.prototype,Hf=Dn.prototype,Mv=Se["__core-js_shared__"],Dv=a8.toString,Tn=Hf.hasOwnProperty,s8=0,kP=function(){var f=/[^.]+$/.exec(Mv&&Mv.keys&&Mv.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""}(),Nv=Hf.toString,o8=Dv.call(Dn),c8=Xe._,u8=w1("^"+Dv.call(Tn).replace(Qa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Lv=bt?Se.Buffer:t,hl=Se.Symbol,Fv=Se.Uint8Array,SP=Lv?Lv.allocUnsafe:t,$v=wP(Dn.getPrototypeOf,Dn),TP=Dn.create,EP=Hf.propertyIsEnumerable,Bv=Ov.splice,PP=hl?hl.isConcatSpreadable:t,Zp=hl?hl.iterator:t,_d=hl?hl.toStringTag:t,Uv=function(){try{var f=kd(Dn,"defineProperty");return f({},"",{}),f}catch{}}(),l8=Se.clearTimeout!==Xe.clearTimeout&&Se.clearTimeout,d8=nt&&nt.now!==Xe.Date.now&&nt.now,f8=Se.setTimeout!==Xe.setTimeout&&Se.setTimeout,jv=Qr.ceil,qv=Qr.floor,C1=Dn.getOwnPropertySymbols,h8=Lv?Lv.isBuffer:t,RP=Se.isFinite,p8=Ov.join,m8=wP(Dn.keys,Dn),Zr=Qr.max,$i=Qr.min,g8=nt.now,v8=Se.parseInt,AP=Qr.random,y8=Ov.reverse,k1=kd(Se,"DataView"),em=kd(Se,"Map"),S1=kd(Se,"Promise"),Vf=kd(Se,"Set"),tm=kd(Se,"WeakMap"),nm=kd(Dn,"create"),zv=tm&&new tm,Gf={},_8=Sd(k1),b8=Sd(em),x8=Sd(S1),w8=Sd(Vf),C8=Sd(tm),Wv=hl?hl.prototype:t,rm=Wv?Wv.valueOf:t,IP=Wv?Wv.toString:t;function z(f){if(xr(f)&&!Nt(f)&&!(f instanceof an)){if(f instanceof Ys)return f;if(Tn.call(f,"__wrapped__"))return OR(f)}return new Ys(f)}var Kf=function(){function f(){}return function(m){if(!ur(m))return{};if(TP)return TP(m);f.prototype=m;var _=new f;return f.prototype=t,_}}();function Hv(){}function Ys(f,m){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!m,this.__index__=0,this.__values__=t}z.templateSettings={escape:Ca,evaluate:Ja,interpolate:ra,variable:"",imports:{_:z}},z.prototype=Hv.prototype,z.prototype.constructor=z,Ys.prototype=Kf(Hv.prototype),Ys.prototype.constructor=Ys;function an(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=we,this.__views__=[]}function k8(){var f=new an(this.__wrapped__);return f.__actions__=Ta(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=Ta(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=Ta(this.__views__),f}function S8(){if(this.__filtered__){var f=new an(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function T8(){var f=this.__wrapped__.value(),m=this.__dir__,_=Nt(f),R=m<0,F=_?f.length:0,H=$j(0,F,this.__views__),ee=H.start,ae=H.end,he=ae-ee,Ee=R?ae:ee-1,Pe=this.__iteratees__,Be=Pe.length,Ye=0,ut=$i(he,this.__takeCount__);if(!_||!R&&F==he&&ut==he)return tR(f,this.__actions__);var xt=[];e:for(;he--&&Ye<ut;){Ee+=m;for(var jt=-1,vt=f[Ee];++jt<Be;){var Qt=Pe[jt],cn=Qt.iteratee,os=Qt.type,pa=cn(vt);if(os==ne)vt=pa;else if(!pa){if(os==X)continue e;break e}}xt[Ye++]=vt}return xt}an.prototype=Kf(Hv.prototype),an.prototype.constructor=an;function bd(f){var m=-1,_=f==null?0:f.length;for(this.clear();++m<_;){var R=f[m];this.set(R[0],R[1])}}function E8(){this.__data__=nm?nm(null):{},this.size=0}function P8(f){var m=this.has(f)&&delete this.__data__[f];return this.size-=m?1:0,m}function R8(f){var m=this.__data__;if(nm){var _=m[f];return _===u?t:_}return Tn.call(m,f)?m[f]:t}function A8(f){var m=this.__data__;return nm?m[f]!==t:Tn.call(m,f)}function I8(f,m){var _=this.__data__;return this.size+=this.has(f)?0:1,_[f]=nm&&m===t?u:m,this}bd.prototype.clear=E8,bd.prototype.delete=P8,bd.prototype.get=R8,bd.prototype.has=A8,bd.prototype.set=I8;function yu(f){var m=-1,_=f==null?0:f.length;for(this.clear();++m<_;){var R=f[m];this.set(R[0],R[1])}}function O8(){this.__data__=[],this.size=0}function M8(f){var m=this.__data__,_=Vv(m,f);if(_<0)return!1;var R=m.length-1;return _==R?m.pop():Bv.call(m,_,1),--this.size,!0}function D8(f){var m=this.__data__,_=Vv(m,f);return _<0?t:m[_][1]}function N8(f){return Vv(this.__data__,f)>-1}function L8(f,m){var _=this.__data__,R=Vv(_,f);return R<0?(++this.size,_.push([f,m])):_[R][1]=m,this}yu.prototype.clear=O8,yu.prototype.delete=M8,yu.prototype.get=D8,yu.prototype.has=N8,yu.prototype.set=L8;function _u(f){var m=-1,_=f==null?0:f.length;for(this.clear();++m<_;){var R=f[m];this.set(R[0],R[1])}}function F8(){this.size=0,this.__data__={hash:new bd,map:new(em||yu),string:new bd}}function $8(f){var m=i0(this,f).delete(f);return this.size-=m?1:0,m}function B8(f){return i0(this,f).get(f)}function U8(f){return i0(this,f).has(f)}function j8(f,m){var _=i0(this,f),R=_.size;return _.set(f,m),this.size+=_.size==R?0:1,this}_u.prototype.clear=F8,_u.prototype.delete=$8,_u.prototype.get=B8,_u.prototype.has=U8,_u.prototype.set=j8;function xd(f){var m=-1,_=f==null?0:f.length;for(this.__data__=new _u;++m<_;)this.add(f[m])}function q8(f){return this.__data__.set(f,u),this}function z8(f){return this.__data__.has(f)}xd.prototype.add=xd.prototype.push=q8,xd.prototype.has=z8;function Mo(f){var m=this.__data__=new yu(f);this.size=m.size}function W8(){this.__data__=new yu,this.size=0}function H8(f){var m=this.__data__,_=m.delete(f);return this.size=m.size,_}function V8(f){return this.__data__.get(f)}function G8(f){return this.__data__.has(f)}function K8(f,m){var _=this.__data__;if(_ instanceof yu){var R=_.__data__;if(!em||R.length<i-1)return R.push([f,m]),this.size=++_.size,this;_=this.__data__=new _u(R)}return _.set(f,m),this.size=_.size,this}Mo.prototype.clear=W8,Mo.prototype.delete=H8,Mo.prototype.get=V8,Mo.prototype.has=G8,Mo.prototype.set=K8;function OP(f,m){var _=Nt(f),R=!_&&Td(f),F=!_&&!R&&yl(f),H=!_&&!R&&!F&&Qf(f),ee=_||R||F||H,ae=ee?qf(f.length,i8):[],he=ae.length;for(var Ee in f)(m||Tn.call(f,Ee))&&!(ee&&(Ee=="length"||F&&(Ee=="offset"||Ee=="parent")||H&&(Ee=="buffer"||Ee=="byteLength"||Ee=="byteOffset")||wu(Ee,he)))&&ae.push(Ee);return ae}function MP(f){var m=f.length;return m?f[L1(0,m-1)]:t}function Y8(f,m){return a0(Ta(f),wd(m,0,f.length))}function X8(f){return a0(Ta(f))}function T1(f,m,_){(_!==t&&!No(f[m],_)||_===t&&!(m in f))&&bc(f,m,_)}function im(f,m,_){var R=f[m];(!(Tn.call(f,m)&&No(R,_))||_===t&&!(m in f))&&bc(f,m,_)}function Vv(f,m){for(var _=f.length;_--;)if(No(f[_][0],m))return _;return-1}function J8(f,m,_,R){return pl(f,function(F,H,ee){m(R,F,_(F),ee)}),R}function DP(f,m){return f&&wc(m,li(m),f)}function Q8(f,m){return f&&wc(m,Pa(m),f)}function bc(f,m,_){m=="__proto__"&&Uv?Uv(f,m,{configurable:!0,enumerable:!0,value:_,writable:!0}):f[m]=_}function E1(f,m){for(var _=-1,R=m.length,F=_e(R),H=f==null;++_<R;)F[_]=H?t:cx(f,m[_]);return F}function wd(f,m,_){return f===f&&(_!==t&&(f=f<=_?f:_),m!==t&&(f=f>=m?f:m)),f}function Xs(f,m,_,R,F,H){var ee,ae=m&h,he=m&p,Ee=m&g;if(_&&(ee=F?_(f,R,F,H):_(f)),ee!==t)return ee;if(!ur(f))return f;var Pe=Nt(f);if(Pe){if(ee=Uj(f),!ae)return Ta(f,ee)}else{var Be=Bi(f),Ye=Be==wt||Be==Kt;if(yl(f))return iR(f,ae);if(Be==zt||Be==He||Ye&&!F){if(ee=he||Ye?{}:CR(f),!ae)return he?Rj(f,Q8(ee,f)):Pj(f,DP(ee,f))}else{if(!T[Be])return F?f:{};ee=jj(f,Be,ae)}}H||(H=new Mo);var ut=H.get(f);if(ut)return ut;H.set(f,ee),QR(f)?f.forEach(function(vt){ee.add(Xs(vt,m,_,vt,f,H))}):XR(f)&&f.forEach(function(vt,Qt){ee.set(Qt,Xs(vt,m,_,Qt,f,H))});var xt=Ee?he?G1:V1:he?Pa:li,jt=Pe?t:xt(f);return la(jt||f,function(vt,Qt){jt&&(Qt=vt,vt=f[Qt]),im(ee,Qt,Xs(vt,m,_,Qt,f,H))}),ee}function Z8(f){var m=li(f);return function(_){return NP(_,f,m)}}function NP(f,m,_){var R=_.length;if(f==null)return!R;for(f=Dn(f);R--;){var F=_[R],H=m[F],ee=f[F];if(ee===t&&!(F in f)||!H(ee))return!1}return!0}function LP(f,m,_){if(typeof f!="function")throw new Ks(s);return dm(function(){f.apply(t,_)},m)}function am(f,m,_,R){var F=-1,H=jf,ee=!0,ae=f.length,he=[],Ee=m.length;if(!ae)return he;_&&(m=Lt(m,da(_))),R?(H=Wp,ee=!1):m.length>=i&&(H=ll,ee=!1,m=new xd(m));e:for(;++F<ae;){var Pe=f[F],Be=_==null?Pe:_(Pe);if(Pe=R||Pe!==0?Pe:0,ee&&Be===Be){for(var Ye=Ee;Ye--;)if(m[Ye]===Be)continue e;he.push(Pe)}else H(m,Be,R)||he.push(Pe)}return he}var pl=uR(xc),FP=uR(R1,!0);function ej(f,m){var _=!0;return pl(f,function(R,F,H){return _=!!m(R,F,H),_}),_}function Gv(f,m,_){for(var R=-1,F=f.length;++R<F;){var H=f[R],ee=m(H);if(ee!=null&&(ae===t?ee===ee&&!ss(ee):_(ee,ae)))var ae=ee,he=H}return he}function tj(f,m,_,R){var F=f.length;for(_=Ft(_),_<0&&(_=-_>F?0:F+_),R=R===t||R>F?F:Ft(R),R<0&&(R+=F),R=_>R?0:eA(R);_<R;)f[_++]=m;return f}function $P(f,m){var _=[];return pl(f,function(R,F,H){m(R,F,H)&&_.push(R)}),_}function Ci(f,m,_,R,F){var H=-1,ee=f.length;for(_||(_=zj),F||(F=[]);++H<ee;){var ae=f[H];m>0&&_(ae)?m>1?Ci(ae,m-1,_,R,F):Gs(F,ae):R||(F[F.length]=ae)}return F}var P1=lR(),BP=lR(!0);function xc(f,m){return f&&P1(f,m,li)}function R1(f,m){return f&&BP(f,m,li)}function Kv(f,m){return _c(m,function(_){return Cu(f[_])})}function Cd(f,m){m=gl(m,f);for(var _=0,R=m.length;f!=null&&_<R;)f=f[Do(m[_++])];return _&&_==R?f:t}function UP(f,m,_){var R=m(f);return Nt(f)?R:Gs(R,_(f))}function fa(f){return f==null?f===t?St:jn:_d&&_d in Dn(f)?Fj(f):Xj(f)}function A1(f,m){return f>m}function nj(f,m){return f!=null&&Tn.call(f,m)}function rj(f,m){return f!=null&&m in Dn(f)}function ij(f,m,_){return f>=$i(m,_)&&f<Zr(m,_)}function I1(f,m,_){for(var R=_?Wp:jf,F=f[0].length,H=f.length,ee=H,ae=_e(H),he=1/0,Ee=[];ee--;){var Pe=f[ee];ee&&m&&(Pe=Lt(Pe,da(m))),he=$i(Pe.length,he),ae[ee]=!_&&(m||F>=120&&Pe.length>=120)?new xd(ee&&Pe):t}Pe=f[0];var Be=-1,Ye=ae[0];e:for(;++Be<F&&Ee.length<he;){var ut=Pe[Be],xt=m?m(ut):ut;if(ut=_||ut!==0?ut:0,!(Ye?ll(Ye,xt):R(Ee,xt,_))){for(ee=H;--ee;){var jt=ae[ee];if(!(jt?ll(jt,xt):R(f[ee],xt,_)))continue e}Ye&&Ye.push(xt),Ee.push(ut)}}return Ee}function aj(f,m,_,R){return xc(f,function(F,H,ee){m(R,_(F),H,ee)}),R}function sm(f,m,_){m=gl(m,f),f=ER(f,m);var R=f==null?f:f[Do(Qs(m))];return R==null?t:ua(R,f,_)}function jP(f){return xr(f)&&fa(f)==He}function sj(f){return xr(f)&&fa(f)==rn}function oj(f){return xr(f)&&fa(f)==Ut}function om(f,m,_,R,F){return f===m?!0:f==null||m==null||!xr(f)&&!xr(m)?f!==f&&m!==m:cj(f,m,_,R,om,F)}function cj(f,m,_,R,F,H){var ee=Nt(f),ae=Nt(m),he=ee?ot:Bi(f),Ee=ae?ot:Bi(m);he=he==He?zt:he,Ee=Ee==He?zt:Ee;var Pe=he==zt,Be=Ee==zt,Ye=he==Ee;if(Ye&&yl(f)){if(!yl(m))return!1;ee=!0,Pe=!1}if(Ye&&!Pe)return H||(H=new Mo),ee||Qf(f)?bR(f,m,_,R,F,H):Nj(f,m,he,_,R,F,H);if(!(_&v)){var ut=Pe&&Tn.call(f,"__wrapped__"),xt=Be&&Tn.call(m,"__wrapped__");if(ut||xt){var jt=ut?f.value():f,vt=xt?m.value():m;return H||(H=new Mo),F(jt,vt,_,R,H)}}return Ye?(H||(H=new Mo),Lj(f,m,_,R,F,H)):!1}function uj(f){return xr(f)&&Bi(f)==Ct}function O1(f,m,_,R){var F=_.length,H=F,ee=!R;if(f==null)return!H;for(f=Dn(f);F--;){var ae=_[F];if(ee&&ae[2]?ae[1]!==f[ae[0]]:!(ae[0]in f))return!1}for(;++F<H;){ae=_[F];var he=ae[0],Ee=f[he],Pe=ae[1];if(ee&&ae[2]){if(Ee===t&&!(he in f))return!1}else{var Be=new Mo;if(R)var Ye=R(Ee,Pe,he,f,m,Be);if(!(Ye===t?om(Pe,Ee,v|y,R,Be):Ye))return!1}}return!0}function qP(f){if(!ur(f)||Hj(f))return!1;var m=Cu(f)?u8:Fs;return m.test(Sd(f))}function lj(f){return xr(f)&&fa(f)==On}function dj(f){return xr(f)&&Bi(f)==hn}function fj(f){return xr(f)&&d0(f.length)&&!!oe[fa(f)]}function zP(f){return typeof f=="function"?f:f==null?Ra:typeof f=="object"?Nt(f)?VP(f[0],f[1]):HP(f):fA(f)}function M1(f){if(!lm(f))return m8(f);var m=[];for(var _ in Dn(f))Tn.call(f,_)&&_!="constructor"&&m.push(_);return m}function hj(f){if(!ur(f))return Yj(f);var m=lm(f),_=[];for(var R in f)R=="constructor"&&(m||!Tn.call(f,R))||_.push(R);return _}function D1(f,m){return f<m}function WP(f,m){var _=-1,R=Ea(f)?_e(f.length):[];return pl(f,function(F,H,ee){R[++_]=m(F,H,ee)}),R}function HP(f){var m=Y1(f);return m.length==1&&m[0][2]?SR(m[0][0],m[0][1]):function(_){return _===f||O1(_,f,m)}}function VP(f,m){return J1(f)&&kR(m)?SR(Do(f),m):function(_){var R=cx(_,f);return R===t&&R===m?ux(_,f):om(m,R,v|y)}}function Yv(f,m,_,R,F){f!==m&&P1(m,function(H,ee){if(F||(F=new Mo),ur(H))pj(f,m,ee,_,Yv,R,F);else{var ae=R?R(Z1(f,ee),H,ee+"",f,m,F):t;ae===t&&(ae=H),T1(f,ee,ae)}},Pa)}function pj(f,m,_,R,F,H,ee){var ae=Z1(f,_),he=Z1(m,_),Ee=ee.get(he);if(Ee){T1(f,_,Ee);return}var Pe=H?H(ae,he,_+"",f,m,ee):t,Be=Pe===t;if(Be){var Ye=Nt(he),ut=!Ye&&yl(he),xt=!Ye&&!ut&&Qf(he);Pe=he,Ye||ut||xt?Nt(ae)?Pe=ae:Ar(ae)?Pe=Ta(ae):ut?(Be=!1,Pe=iR(he,!0)):xt?(Be=!1,Pe=aR(he,!0)):Pe=[]:fm(he)||Td(he)?(Pe=ae,Td(ae)?Pe=tA(ae):(!ur(ae)||Cu(ae))&&(Pe=CR(he))):Be=!1}Be&&(ee.set(he,Pe),F(Pe,he,R,H,ee),ee.delete(he)),T1(f,_,Pe)}function GP(f,m){var _=f.length;if(_)return m+=m<0?_:0,wu(m,_)?f[m]:t}function KP(f,m,_){m.length?m=Lt(m,function(H){return Nt(H)?function(ee){return Cd(ee,H.length===1?H[0]:H)}:H}):m=[Ra];var R=-1;m=Lt(m,da(yt()));var F=WP(f,function(H,ee,ae){var he=Lt(m,function(Ee){return Ee(H)});return{criteria:he,index:++R,value:H}});return Pv(F,function(H,ee){return Ej(H,ee,_)})}function mj(f,m){return YP(f,m,function(_,R){return ux(f,R)})}function YP(f,m,_){for(var R=-1,F=m.length,H={};++R<F;){var ee=m[R],ae=Cd(f,ee);_(ae,ee)&&cm(H,gl(ee,f),ae)}return H}function gj(f){return function(m){return Cd(m,f)}}function N1(f,m,_,R){var F=R?At:tt,H=-1,ee=m.length,ae=f;for(f===m&&(m=Ta(m)),_&&(ae=Lt(f,da(_)));++H<ee;)for(var he=0,Ee=m[H],Pe=_?_(Ee):Ee;(he=F(ae,Pe,he,R))>-1;)ae!==f&&Bv.call(ae,he,1),Bv.call(f,he,1);return f}function XP(f,m){for(var _=f?m.length:0,R=_-1;_--;){var F=m[_];if(_==R||F!==H){var H=F;wu(F)?Bv.call(f,F,1):B1(f,F)}}return f}function L1(f,m){return f+qv(AP()*(m-f+1))}function vj(f,m,_,R){for(var F=-1,H=Zr(jv((m-f)/(_||1)),0),ee=_e(H);H--;)ee[R?H:++F]=f,f+=_;return ee}function F1(f,m){var _="";if(!f||m<1||m>de)return _;do m%2&&(_+=f),m=qv(m/2),m&&(f+=f);while(m);return _}function Ht(f,m){return ex(TR(f,m,Ra),f+"")}function yj(f){return MP(Zf(f))}function _j(f,m){var _=Zf(f);return a0(_,wd(m,0,_.length))}function cm(f,m,_,R){if(!ur(f))return f;m=gl(m,f);for(var F=-1,H=m.length,ee=H-1,ae=f;ae!=null&&++F<H;){var he=Do(m[F]),Ee=_;if(he==="__proto__"||he==="constructor"||he==="prototype")return f;if(F!=ee){var Pe=ae[he];Ee=R?R(Pe,he,ae):t,Ee===t&&(Ee=ur(Pe)?Pe:wu(m[F+1])?[]:{})}im(ae,he,Ee),ae=ae[he]}return f}var JP=zv?function(f,m){return zv.set(f,m),f}:Ra,bj=Uv?function(f,m){return Uv(f,"toString",{configurable:!0,enumerable:!1,value:dx(m),writable:!0})}:Ra;function xj(f){return a0(Zf(f))}function Js(f,m,_){var R=-1,F=f.length;m<0&&(m=-m>F?0:F+m),_=_>F?F:_,_<0&&(_+=F),F=m>_?0:_-m>>>0,m>>>=0;for(var H=_e(F);++R<F;)H[R]=f[R+m];return H}function wj(f,m){var _;return pl(f,function(R,F,H){return _=m(R,F,H),!_}),!!_}function Xv(f,m,_){var R=0,F=f==null?R:f.length;if(typeof m=="number"&&m===m&&F<=Ge){for(;R<F;){var H=R+F>>>1,ee=f[H];ee!==null&&!ss(ee)&&(_?ee<=m:ee<m)?R=H+1:F=H}return F}return $1(f,m,Ra,_)}function $1(f,m,_,R){var F=0,H=f==null?0:f.length;if(H===0)return 0;m=_(m);for(var ee=m!==m,ae=m===null,he=ss(m),Ee=m===t;F<H;){var Pe=qv((F+H)/2),Be=_(f[Pe]),Ye=Be!==t,ut=Be===null,xt=Be===Be,jt=ss(Be);if(ee)var vt=R||xt;else Ee?vt=xt&&(R||Ye):ae?vt=xt&&Ye&&(R||!ut):he?vt=xt&&Ye&&!ut&&(R||!jt):ut||jt?vt=!1:vt=R?Be<=m:Be<m;vt?F=Pe+1:H=Pe}return $i(H,Fe)}function QP(f,m){for(var _=-1,R=f.length,F=0,H=[];++_<R;){var ee=f[_],ae=m?m(ee):ee;if(!_||!No(ae,he)){var he=ae;H[F++]=ee===0?0:ee}}return H}function ZP(f){return typeof f=="number"?f:ss(f)?Ce:+f}function as(f){if(typeof f=="string")return f;if(Nt(f))return Lt(f,as)+"";if(ss(f))return IP?IP.call(f):"";var m=f+"";return m=="0"&&1/f==-ie?"-0":m}function ml(f,m,_){var R=-1,F=jf,H=f.length,ee=!0,ae=[],he=ae;if(_)ee=!1,F=Wp;else if(H>=i){var Ee=m?null:Mj(f);if(Ee)return Iv(Ee);ee=!1,F=ll,he=new xd}else he=m?[]:ae;e:for(;++R<H;){var Pe=f[R],Be=m?m(Pe):Pe;if(Pe=_||Pe!==0?Pe:0,ee&&Be===Be){for(var Ye=he.length;Ye--;)if(he[Ye]===Be)continue e;m&&he.push(Be),ae.push(Pe)}else F(he,Be,_)||(he!==ae&&he.push(Be),ae.push(Pe))}return ae}function B1(f,m){m=gl(m,f);var _=-1,R=m.length;if(!R)return!0;for(;++_<R;){var F=Do(m[_]);if(F==="__proto__"&&!Tn.call(f,"__proto__")||(F==="constructor"||F==="prototype")&&_<R-1)return!1}var H=ER(f,m);return H==null||delete H[Do(Qs(m))]}function eR(f,m,_,R){return cm(f,m,_(Cd(f,m)),R)}function Jv(f,m,_,R){for(var F=f.length,H=R?F:-1;(R?H--:++H<F)&&m(f[H],H,f););return _?Js(f,R?0:H,R?H+1:F):Js(f,R?H+1:0,R?F:H)}function tR(f,m){var _=f;return _ instanceof an&&(_=_.value()),Hp(m,function(R,F){return F.func.apply(F.thisArg,Gs([R],F.args))},_)}function U1(f,m,_){var R=f.length;if(R<2)return R?ml(f[0]):[];for(var F=-1,H=_e(R);++F<R;)for(var ee=f[F],ae=-1;++ae<R;)ae!=F&&(H[F]=am(H[F]||ee,f[ae],m,_));return ml(Ci(H,1),m,_)}function nR(f,m,_){for(var R=-1,F=f.length,H=m.length,ee={};++R<F;){var ae=R<H?m[R]:t;_(ee,f[R],ae)}return ee}function j1(f){return Ar(f)?f:[]}function q1(f){return typeof f=="function"?f:Ra}function gl(f,m){return Nt(f)?f:J1(f,m)?[f]:IR(En(f))}var Cj=Ht;function vl(f,m,_){var R=f.length;return _=_===t?R:_,!m&&_>=R?f:Js(f,m,_)}var rR=l8||function(f){return Xe.clearTimeout(f)};function iR(f,m){if(m)return f.slice();var _=f.length,R=SP?SP(_):new f.constructor(_);return f.copy(R),R}function z1(f){var m=new f.constructor(f.byteLength);return new Fv(m).set(new Fv(f)),m}function kj(f,m){var _=m?z1(f.buffer):f.buffer;return new f.constructor(_,f.byteOffset,f.byteLength)}function Sj(f){var m=new f.constructor(f.source,Ls.exec(f));return m.lastIndex=f.lastIndex,m}function Tj(f){return rm?Dn(rm.call(f)):{}}function aR(f,m){var _=m?z1(f.buffer):f.buffer;return new f.constructor(_,f.byteOffset,f.length)}function sR(f,m){if(f!==m){var _=f!==t,R=f===null,F=f===f,H=ss(f),ee=m!==t,ae=m===null,he=m===m,Ee=ss(m);if(!ae&&!Ee&&!H&&f>m||H&&ee&&he&&!ae&&!Ee||R&&ee&&he||!_&&he||!F)return 1;if(!R&&!H&&!Ee&&f<m||Ee&&_&&F&&!R&&!H||ae&&_&&F||!ee&&F||!he)return-1}return 0}function Ej(f,m,_){for(var R=-1,F=f.criteria,H=m.criteria,ee=F.length,ae=_.length;++R<ee;){var he=sR(F[R],H[R]);if(he){if(R>=ae)return he;var Ee=_[R];return he*(Ee=="desc"?-1:1)}}return f.index-m.index}function oR(f,m,_,R){for(var F=-1,H=f.length,ee=_.length,ae=-1,he=m.length,Ee=Zr(H-ee,0),Pe=_e(he+Ee),Be=!R;++ae<he;)Pe[ae]=m[ae];for(;++F<ee;)(Be||F<H)&&(Pe[_[F]]=f[F]);for(;Ee--;)Pe[ae++]=f[F++];return Pe}function cR(f,m,_,R){for(var F=-1,H=f.length,ee=-1,ae=_.length,he=-1,Ee=m.length,Pe=Zr(H-ae,0),Be=_e(Pe+Ee),Ye=!R;++F<Pe;)Be[F]=f[F];for(var ut=F;++he<Ee;)Be[ut+he]=m[he];for(;++ee<ae;)(Ye||F<H)&&(Be[ut+_[ee]]=f[F++]);return Be}function Ta(f,m){var _=-1,R=f.length;for(m||(m=_e(R));++_<R;)m[_]=f[_];return m}function wc(f,m,_,R){var F=!_;_||(_={});for(var H=-1,ee=m.length;++H<ee;){var ae=m[H],he=R?R(_[ae],f[ae],ae,_,f):t;he===t&&(he=f[ae]),F?bc(_,ae,he):im(_,ae,he)}return _}function Pj(f,m){return wc(f,X1(f),m)}function Rj(f,m){return wc(f,xR(f),m)}function Qv(f,m){return function(_,R){var F=Nt(_)?m1:J8,H=m?m():{};return F(_,f,yt(R,2),H)}}function Yf(f){return Ht(function(m,_){var R=-1,F=_.length,H=F>1?_[F-1]:t,ee=F>2?_[2]:t;for(H=f.length>3&&typeof H=="function"?(F--,H):t,ee&&ha(_[0],_[1],ee)&&(H=F<3?t:H,F=1),m=Dn(m);++R<F;){var ae=_[R];ae&&f(m,ae,R,H)}return m})}function uR(f,m){return function(_,R){if(_==null)return _;if(!Ea(_))return f(_,R);for(var F=_.length,H=m?F:-1,ee=Dn(_);(m?H--:++H<F)&&R(ee[H],H,ee)!==!1;);return _}}function lR(f){return function(m,_,R){for(var F=-1,H=Dn(m),ee=R(m),ae=ee.length;ae--;){var he=ee[f?ae:++F];if(_(H[he],he,H)===!1)break}return m}}function Aj(f,m,_){var R=m&b,F=um(f);function H(){var ee=this&&this!==Xe&&this instanceof H?F:f;return ee.apply(R?_:this,arguments)}return H}function dR(f){return function(m){m=En(m);var _=dl(m)?Oo(m):t,R=_?_[0]:m.charAt(0),F=_?vl(_,1).join(""):m.slice(1);return R[f]()+F}}function Xf(f){return function(m){return Hp(lA(uA(m).replace(O,"")),f,"")}}function um(f){return function(){var m=arguments;switch(m.length){case 0:return new f;case 1:return new f(m[0]);case 2:return new f(m[0],m[1]);case 3:return new f(m[0],m[1],m[2]);case 4:return new f(m[0],m[1],m[2],m[3]);case 5:return new f(m[0],m[1],m[2],m[3],m[4]);case 6:return new f(m[0],m[1],m[2],m[3],m[4],m[5]);case 7:return new f(m[0],m[1],m[2],m[3],m[4],m[5],m[6])}var _=Kf(f.prototype),R=f.apply(_,m);return ur(R)?R:_}}function Ij(f,m,_){var R=um(f);function F(){for(var H=arguments.length,ee=_e(H),ae=H,he=Jf(F);ae--;)ee[ae]=arguments[ae];var Ee=H<3&&ee[0]!==he&&ee[H-1]!==he?[]:fl(ee,he);if(H-=Ee.length,H<_)return gR(f,m,Zv,F.placeholder,t,ee,Ee,t,t,_-H);var Pe=this&&this!==Xe&&this instanceof F?R:f;return ua(Pe,this,ee)}return F}function fR(f){return function(m,_,R){var F=Dn(m);if(!Ea(m)){var H=yt(_,3);m=li(m),_=function(ae){return H(F[ae],ae,F)}}var ee=f(m,_,R);return ee>-1?F[H?m[ee]:ee]:t}}function hR(f){return xu(function(m){var _=m.length,R=_,F=Ys.prototype.thru;for(f&&m.reverse();R--;){var H=m[R];if(typeof H!="function")throw new Ks(s);if(F&&!ee&&r0(H)=="wrapper")var ee=new Ys([],!0)}for(R=ee?R:_;++R<_;){H=m[R];var ae=r0(H),he=ae=="wrapper"?K1(H):t;he&&Q1(he[0])&&he[1]==(P|w|E|A)&&!he[4].length&&he[9]==1?ee=ee[r0(he[0])].apply(ee,he[3]):ee=H.length==1&&Q1(H)?ee[ae]():ee.thru(H)}return function(){var Ee=arguments,Pe=Ee[0];if(ee&&Ee.length==1&&Nt(Pe))return ee.plant(Pe).value();for(var Be=0,Ye=_?m[Be].apply(this,Ee):Pe;++Be<_;)Ye=m[Be].call(this,Ye);return Ye}})}function Zv(f,m,_,R,F,H,ee,ae,he,Ee){var Pe=m&P,Be=m&b,Ye=m&x,ut=m&(w|k),xt=m&N,jt=Ye?t:um(f);function vt(){for(var Qt=arguments.length,cn=_e(Qt),os=Qt;os--;)cn[os]=arguments[os];if(ut)var pa=Jf(vt),cs=Jp(cn,pa);if(R&&(cn=oR(cn,R,F,ut)),H&&(cn=cR(cn,H,ee,ut)),Qt-=cs,ut&&Qt<Ee){var Ir=fl(cn,pa);return gR(f,m,Zv,vt.placeholder,_,cn,Ir,ae,he,Ee-Qt)}var Lo=Be?_:this,Su=Ye?Lo[f]:f;return Qt=cn.length,ae?cn=Jj(cn,ae):xt&&Qt>1&&cn.reverse(),Pe&&he<Qt&&(cn.length=he),this&&this!==Xe&&this instanceof vt&&(Su=jt||um(Su)),Su.apply(Lo,cn)}return vt}function pR(f,m){return function(_,R){return aj(_,f,m(R),{})}}function e0(f,m){return function(_,R){var F;if(_===t&&R===t)return m;if(_!==t&&(F=_),R!==t){if(F===t)return R;typeof _=="string"||typeof R=="string"?(_=as(_),R=as(R)):(_=ZP(_),R=ZP(R)),F=f(_,R)}return F}}function W1(f){return xu(function(m){return m=Lt(m,da(yt())),Ht(function(_){var R=this;return f(m,function(F){return ua(F,R,_)})})})}function t0(f,m){m=m===t?" ":as(m);var _=m.length;if(_<2)return _?F1(m,f):m;var R=F1(m,jv(f/zf(m)));return dl(m)?vl(Oo(R),0,f).join(""):R.slice(0,f)}function Oj(f,m,_,R){var F=m&b,H=um(f);function ee(){for(var ae=-1,he=arguments.length,Ee=-1,Pe=R.length,Be=_e(Pe+he),Ye=this&&this!==Xe&&this instanceof ee?H:f;++Ee<Pe;)Be[Ee]=R[Ee];for(;he--;)Be[Ee++]=arguments[++ae];return ua(Ye,F?_:this,Be)}return ee}function mR(f){return function(m,_,R){return R&&typeof R!="number"&&ha(m,_,R)&&(_=R=t),m=ku(m),_===t?(_=m,m=0):_=ku(_),R=R===t?m<_?1:-1:ku(R),vj(m,_,R,f)}}function n0(f){return function(m,_){return typeof m=="string"&&typeof _=="string"||(m=Zs(m),_=Zs(_)),f(m,_)}}function gR(f,m,_,R,F,H,ee,ae,he,Ee){var Pe=m&w,Be=Pe?ee:t,Ye=Pe?t:ee,ut=Pe?H:t,xt=Pe?t:H;m|=Pe?E:I,m&=~(Pe?I:E),m&S||(m&=-4);var jt=[f,m,F,ut,Be,xt,Ye,ae,he,Ee],vt=_.apply(t,jt);return Q1(f)&&PR(vt,jt),vt.placeholder=R,RR(vt,f,m)}function H1(f){var m=Qr[f];return function(_,R){if(_=Zs(_),R=R==null?0:$i(Ft(R),292),R&&RP(_)){var F=(En(_)+"e").split("e"),H=m(F[0]+"e"+(+F[1]+R));return F=(En(H)+"e").split("e"),+(F[0]+"e"+(+F[1]-R))}return m(_)}}var Mj=Vf&&1/Iv(new Vf([,-0]))[1]==ie?function(f){return new Vf(f)}:px;function vR(f){return function(m){var _=Bi(m);return _==Ct?x1(m):_==hn?XU(m):v1(m,f(m))}}function bu(f,m,_,R,F,H,ee,ae){var he=m&x;if(!he&&typeof f!="function")throw new Ks(s);var Ee=R?R.length:0;if(Ee||(m&=-97,R=F=t),ee=ee===t?ee:Zr(Ft(ee),0),ae=ae===t?ae:Ft(ae),Ee-=F?F.length:0,m&I){var Pe=R,Be=F;R=F=t}var Ye=he?t:K1(f),ut=[f,m,_,R,F,Pe,Be,H,ee,ae];if(Ye&&Kj(ut,Ye),f=ut[0],m=ut[1],_=ut[2],R=ut[3],F=ut[4],ae=ut[9]=ut[9]===t?he?0:f.length:Zr(ut[9]-Ee,0),!ae&&m&(w|k)&&(m&=-25),!m||m==b)var xt=Aj(f,m,_);else m==w||m==k?xt=Ij(f,m,ae):(m==E||m==(b|E))&&!F.length?xt=Oj(f,m,_,R):xt=Zv.apply(t,ut);var jt=Ye?JP:PR;return RR(jt(xt,ut),f,m)}function yR(f,m,_,R){return f===t||No(f,Hf[_])&&!Tn.call(R,_)?m:f}function _R(f,m,_,R,F,H){return ur(f)&&ur(m)&&(H.set(m,f),Yv(f,m,t,_R,H),H.delete(m)),f}function Dj(f){return fm(f)?t:f}function bR(f,m,_,R,F,H){var ee=_&v,ae=f.length,he=m.length;if(ae!=he&&!(ee&&he>ae))return!1;var Ee=H.get(f),Pe=H.get(m);if(Ee&&Pe)return Ee==m&&Pe==f;var Be=-1,Ye=!0,ut=_&y?new xd:t;for(H.set(f,m),H.set(m,f);++Be<ae;){var xt=f[Be],jt=m[Be];if(R)var vt=ee?R(jt,xt,Be,m,f,H):R(xt,jt,Be,f,m,H);if(vt!==t){if(vt)continue;Ye=!1;break}if(ut){if(!C(m,function(Qt,cn){if(!ll(ut,cn)&&(xt===Qt||F(xt,Qt,_,R,H)))return ut.push(cn)})){Ye=!1;break}}else if(!(xt===jt||F(xt,jt,_,R,H))){Ye=!1;break}}return H.delete(f),H.delete(m),Ye}function Nj(f,m,_,R,F,H,ee){switch(_){case sr:if(f.byteLength!=m.byteLength||f.byteOffset!=m.byteOffset)return!1;f=f.buffer,m=m.buffer;case rn:return!(f.byteLength!=m.byteLength||!H(new Fv(f),new Fv(m)));case et:case Ut:case kt:return No(+f,+m);case mt:return f.name==m.name&&f.message==m.message;case On:case xn:return f==m+"";case Ct:var ae=x1;case hn:var he=R&v;if(ae||(ae=Iv),f.size!=m.size&&!he)return!1;var Ee=ee.get(f);if(Ee)return Ee==m;R|=y,ee.set(f,m);var Pe=bR(ae(f),ae(m),R,F,H,ee);return ee.delete(f),Pe;case kn:if(rm)return rm.call(f)==rm.call(m)}return!1}function Lj(f,m,_,R,F,H){var ee=_&v,ae=V1(f),he=ae.length,Ee=V1(m),Pe=Ee.length;if(he!=Pe&&!ee)return!1;for(var Be=he;Be--;){var Ye=ae[Be];if(!(ee?Ye in m:Tn.call(m,Ye)))return!1}var ut=H.get(f),xt=H.get(m);if(ut&&xt)return ut==m&&xt==f;var jt=!0;H.set(f,m),H.set(m,f);for(var vt=ee;++Be<he;){Ye=ae[Be];var Qt=f[Ye],cn=m[Ye];if(R)var os=ee?R(cn,Qt,Ye,m,f,H):R(Qt,cn,Ye,f,m,H);if(!(os===t?Qt===cn||F(Qt,cn,_,R,H):os)){jt=!1;break}vt||(vt=Ye=="constructor")}if(jt&&!vt){var pa=f.constructor,cs=m.constructor;pa!=cs&&"constructor"in f&&"constructor"in m&&!(typeof pa=="function"&&pa instanceof pa&&typeof cs=="function"&&cs instanceof cs)&&(jt=!1)}return H.delete(f),H.delete(m),jt}function xu(f){return ex(TR(f,t,NR),f+"")}function V1(f){return UP(f,li,X1)}function G1(f){return UP(f,Pa,xR)}var K1=zv?function(f){return zv.get(f)}:px;function r0(f){for(var m=f.name+"",_=Gf[m],R=Tn.call(Gf,m)?_.length:0;R--;){var F=_[R],H=F.func;if(H==null||H==f)return F.name}return m}function Jf(f){var m=Tn.call(z,"placeholder")?z:f;return m.placeholder}function yt(){var f=z.iteratee||fx;return f=f===fx?zP:f,arguments.length?f(arguments[0],arguments[1]):f}function i0(f,m){var _=f.__data__;return Wj(m)?_[typeof m=="string"?"string":"hash"]:_.map}function Y1(f){for(var m=li(f),_=m.length;_--;){var R=m[_],F=f[R];m[_]=[R,F,kR(F)]}return m}function kd(f,m){var _=_1(f,m);return qP(_)?_:t}function Fj(f){var m=Tn.call(f,_d),_=f[_d];try{f[_d]=t;var R=!0}catch{}var F=Nv.call(f);return R&&(m?f[_d]=_:delete f[_d]),F}var X1=C1?function(f){return f==null?[]:(f=Dn(f),_c(C1(f),function(m){return EP.call(f,m)}))}:mx,xR=C1?function(f){for(var m=[];f;)Gs(m,X1(f)),f=$v(f);return m}:mx,Bi=fa;(k1&&Bi(new k1(new ArrayBuffer(1)))!=sr||em&&Bi(new em)!=Ct||S1&&Bi(S1.resolve())!=qn||Vf&&Bi(new Vf)!=hn||tm&&Bi(new tm)!=Er)&&(Bi=function(f){var m=fa(f),_=m==zt?f.constructor:t,R=_?Sd(_):"";if(R)switch(R){case _8:return sr;case b8:return Ct;case x8:return qn;case w8:return hn;case C8:return Er}return m});function $j(f,m,_){for(var R=-1,F=_.length;++R<F;){var H=_[R],ee=H.size;switch(H.type){case"drop":f+=ee;break;case"dropRight":m-=ee;break;case"take":m=$i(m,f+ee);break;case"takeRight":f=Zr(f,m-ee);break}}return{start:f,end:m}}function Bj(f){var m=f.match(cu);return m?m[1].split(uu):[]}function wR(f,m,_){m=gl(m,f);for(var R=-1,F=m.length,H=!1;++R<F;){var ee=Do(m[R]);if(!(H=f!=null&&_(f,ee)))break;f=f[ee]}return H||++R!=F?H:(F=f==null?0:f.length,!!F&&d0(F)&&wu(ee,F)&&(Nt(f)||Td(f)))}function Uj(f){var m=f.length,_=new f.constructor(m);return m&&typeof f[0]=="string"&&Tn.call(f,"index")&&(_.index=f.index,_.input=f.input),_}function CR(f){return typeof f.constructor=="function"&&!lm(f)?Kf($v(f)):{}}function jj(f,m,_){var R=f.constructor;switch(m){case rn:return z1(f);case et:case Ut:return new R(+f);case sr:return kj(f,_);case Qn:case Pr:case Gr:case gt:case Rt:case Wt:case Di:case Kr:case Ni:return aR(f,_);case Ct:return new R;case kt:case xn:return new R(f);case On:return Sj(f);case hn:return new R;case kn:return Tj(f)}}function qj(f,m){var _=m.length;if(!_)return f;var R=_-1;return m[R]=(_>1?"& ":"")+m[R],m=m.join(_>2?", ":" "),f.replace(Sn,`{ 9/* [wrapped with `+m+`] */ 10`)}function zj(f){return Nt(f)||Td(f)||!!(PP&&f&&f[PP])}function wu(f,m){var _=typeof f;return m=m??de,!!m&&(_=="number"||_!="symbol"&&Rr.test(f))&&f>-1&&f%1==0&&f<m}function ha(f,m,_){if(!ur(_))return!1;var R=typeof m;return(R=="number"?Ea(_)&&wu(m,_.length):R=="string"&&m in _)?No(_[m],f):!1}function J1(f,m){if(Nt(f))return!1;var _=typeof f;return _=="number"||_=="symbol"||_=="boolean"||f==null||ss(f)?!0:ia.test(f)||!Ms.test(f)||m!=null&&f in Dn(m)}function Wj(f){var m=typeof f;return m=="string"||m=="number"||m=="symbol"||m=="boolean"?f!=="__proto__":f===null}function Q1(f){var m=r0(f),_=z[m];if(typeof _!="function"||!(m in an.prototype))return!1;if(f===_)return!0;var R=K1(_);return!!R&&f===R[0]}function Hj(f){return!!kP&&kP in f}var Vj=Mv?Cu:gx;function lm(f){var m=f&&f.constructor,_=typeof m=="function"&&m.prototype||Hf;return f===_}function kR(f){return f===f&&!ur(f)}function SR(f,m){return function(_){return _==null?!1:_[f]===m&&(m!==t||f in Dn(_))}}function Gj(f){var m=u0(f,function(R){return _.size===l&&_.clear(),R}),_=m.cache;return m}function Kj(f,m){var _=f[1],R=m[1],F=_|R,H=F<(b|x|P),ee=R==P&&_==w||R==P&&_==A&&f[7].length<=m[8]||R==(P|A)&&m[7].length<=m[8]&&_==w;if(!(H||ee))return f;R&b&&(f[2]=m[2],F|=_&b?0:S);var ae=m[3];if(ae){var he=f[3];f[3]=he?oR(he,ae,m[4]):ae,f[4]=he?fl(f[3],d):m[4]}return ae=m[5],ae&&(he=f[5],f[5]=he?cR(he,ae,m[6]):ae,f[6]=he?fl(f[5],d):m[6]),ae=m[7],ae&&(f[7]=ae),R&P&&(f[8]=f[8]==null?m[8]:$i(f[8],m[8])),f[9]==null&&(f[9]=m[9]),f[0]=m[0],f[1]=F,f}function Yj(f){var m=[];if(f!=null)for(var _ in Dn(f))m.push(_);return m}function Xj(f){return Nv.call(f)}function TR(f,m,_){return m=Zr(m===t?f.length-1:m,0),function(){for(var R=arguments,F=-1,H=Zr(R.length-m,0),ee=_e(H);++F<H;)ee[F]=R[m+F];F=-1;for(var ae=_e(m+1);++F<m;)ae[F]=R[F];return ae[m]=_(ee),ua(f,this,ae)}}function ER(f,m){return m.length<2?f:Cd(f,Js(m,0,-1))}function Jj(f,m){for(var _=f.length,R=$i(m.length,_),F=Ta(f);R--;){var H=m[R];f[R]=wu(H,_)?F[H]:t}return f}function Z1(f,m){if(!(m==="constructor"&&typeof f[m]=="function")&&m!="__proto__")return f[m]}var PR=AR(JP),dm=f8||function(f,m){return Xe.setTimeout(f,m)},ex=AR(bj);function RR(f,m,_){var R=m+"";return ex(f,qj(R,Qj(Bj(R),_)))}function AR(f){var m=0,_=0;return function(){var R=g8(),F=V-(R-_);if(_=R,F>0){if(++m>=B)return arguments[0]}else m=0;return f.apply(t,arguments)}}function a0(f,m){var _=-1,R=f.length,F=R-1;for(m=m===t?R:m;++_<m;){var H=L1(_,F),ee=f[H];f[H]=f[_],f[_]=ee}return f.length=m,f}var IR=Gj(function(f){var m=[];return f.charCodeAt(0)===46&&m.push(""),f.replace(Ds,function(_,R,F,H){m.push(F?H.replace(Ur,"$1"):R||_)}),m});function Do(f){if(typeof f=="string"||ss(f))return f;var m=f+"";return m=="0"&&1/f==-ie?"-0":m}function Sd(f){if(f!=null){try{return Dv.call(f)}catch{}try{return f+""}catch{}}return""}function Qj(f,m){return la(Ie,function(_){var R="_."+_[0];m&_[1]&&!jf(f,R)&&f.push(R)}),f.sort()}function OR(f){if(f instanceof an)return f.clone();var m=new Ys(f.__wrapped__,f.__chain__);return m.__actions__=Ta(f.__actions__),m.__index__=f.__index__,m.__values__=f.__values__,m}function Zj(f,m,_){(_?ha(f,m,_):m===t)?m=1:m=Zr(Ft(m),0);var R=f==null?0:f.length;if(!R||m<1)return[];for(var F=0,H=0,ee=_e(jv(R/m));F<R;)ee[H++]=Js(f,F,F+=m);return ee}function e7(f){for(var m=-1,_=f==null?0:f.length,R=0,F=[];++m<_;){var H=f[m];H&&(F[R++]=H)}return F}function t7(){var f=arguments.length;if(!f)return[];for(var m=_e(f-1),_=arguments[0],R=f;R--;)m[R-1]=arguments[R];return Gs(Nt(_)?Ta(_):[_],Ci(m,1))}var n7=Ht(function(f,m){return Ar(f)?am(f,Ci(m,1,Ar,!0)):[]}),r7=Ht(function(f,m){var _=Qs(m);return Ar(_)&&(_=t),Ar(f)?am(f,Ci(m,1,Ar,!0),yt(_,2)):[]}),i7=Ht(function(f,m){var _=Qs(m);return Ar(_)&&(_=t),Ar(f)?am(f,Ci(m,1,Ar,!0),t,_):[]});function a7(f,m,_){var R=f==null?0:f.length;return R?(m=_||m===t?1:Ft(m),Js(f,m<0?0:m,R)):[]}function s7(f,m,_){var R=f==null?0:f.length;return R?(m=_||m===t?1:Ft(m),m=R-m,Js(f,0,m<0?0:m)):[]}function o7(f,m){return f&&f.length?Jv(f,yt(m,3),!0,!0):[]}function c7(f,m){return f&&f.length?Jv(f,yt(m,3),!0):[]}function u7(f,m,_,R){var F=f==null?0:f.length;return F?(_&&typeof _!="number"&&ha(f,m,_)&&(_=0,R=F),tj(f,m,_,R)):[]}function MR(f,m,_){var R=f==null?0:f.length;if(!R)return-1;var F=_==null?0:Ft(_);return F<0&&(F=Zr(R+F,0)),ze(f,yt(m,3),F)}function DR(f,m,_){var R=f==null?0:f.length;if(!R)return-1;var F=R-1;return _!==t&&(F=Ft(_),F=_<0?Zr(R+F,0):$i(F,R-1)),ze(f,yt(m,3),F,!0)}function NR(f){var m=f==null?0:f.length;return m?Ci(f,1):[]}function l7(f){var m=f==null?0:f.length;return m?Ci(f,ie):[]}function d7(f,m){var _=f==null?0:f.length;return _?(m=m===t?1:Ft(m),Ci(f,m)):[]}function f7(f){for(var m=-1,_=f==null?0:f.length,R={};++m<_;){var F=f[m];bc(R,F[0],F[1])}return R}function LR(f){return f&&f.length?f[0]:t}function h7(f,m,_){var R=f==null?0:f.length;if(!R)return-1;var F=_==null?0:Ft(_);return F<0&&(F=Zr(R+F,0)),tt(f,m,F)}function p7(f){var m=f==null?0:f.length;return m?Js(f,0,-1):[]}var m7=Ht(function(f){var m=Lt(f,j1);return m.length&&m[0]===f[0]?I1(m):[]}),g7=Ht(function(f){var m=Qs(f),_=Lt(f,j1);return m===Qs(_)?m=t:_.pop(),_.length&&_[0]===f[0]?I1(_,yt(m,2)):[]}),v7=Ht(function(f){var m=Qs(f),_=Lt(f,j1);return m=typeof m=="function"?m:t,m&&_.pop(),_.length&&_[0]===f[0]?I1(_,t,m):[]});function y7(f,m){return f==null?"":p8.call(f,m)}function Qs(f){var m=f==null?0:f.length;return m?f[m-1]:t}function _7(f,m,_){var R=f==null?0:f.length;if(!R)return-1;var F=R;return _!==t&&(F=Ft(_),F=F<0?Zr(R+F,0):$i(F,R-1)),m===m?QU(f,m,F):ze(f,on,F,!0)}function b7(f,m){return f&&f.length?GP(f,Ft(m)):t}var x7=Ht(FR);function FR(f,m){return f&&f.length&&m&&m.length?N1(f,m):f}function w7(f,m,_){return f&&f.length&&m&&m.length?N1(f,m,yt(_,2)):f}function C7(f,m,_){return f&&f.length&&m&&m.length?N1(f,m,t,_):f}var k7=xu(function(f,m){var _=f==null?0:f.length,R=E1(f,m);return XP(f,Lt(m,function(F){return wu(F,_)?+F:F}).sort(sR)),R});function S7(f,m){var _=[];if(!(f&&f.length))return _;var R=-1,F=[],H=f.length;for(m=yt(m,3);++R<H;){var ee=f[R];m(ee,R,f)&&(_.push(ee),F.push(R))}return XP(f,F),_}function tx(f){return f==null?f:y8.call(f)}function T7(f,m,_){var R=f==null?0:f.length;return R?(_&&typeof _!="number"&&ha(f,m,_)?(m=0,_=R):(m=m==null?0:Ft(m),_=_===t?R:Ft(_)),Js(f,m,_)):[]}function E7(f,m){return Xv(f,m)}function P7(f,m,_){return $1(f,m,yt(_,2))}function R7(f,m){var _=f==null?0:f.length;if(_){var R=Xv(f,m);if(R<_&&No(f[R],m))return R}return-1}function A7(f,m){return Xv(f,m,!0)}function I7(f,m,_){return $1(f,m,yt(_,2),!0)}function O7(f,m){var _=f==null?0:f.length;if(_){var R=Xv(f,m,!0)-1;if(No(f[R],m))return R}return-1}function M7(f){return f&&f.length?QP(f):[]}function D7(f,m){return f&&f.length?QP(f,yt(m,2)):[]}function N7(f){var m=f==null?0:f.length;return m?Js(f,1,m):[]}function L7(f,m,_){return f&&f.length?(m=_||m===t?1:Ft(m),Js(f,0,m<0?0:m)):[]}function F7(f,m,_){var R=f==null?0:f.length;return R?(m=_||m===t?1:Ft(m),m=R-m,Js(f,m<0?0:m,R)):[]}function $7(f,m){return f&&f.length?Jv(f,yt(m,3),!1,!0):[]}function B7(f,m){return f&&f.length?Jv(f,yt(m,3)):[]}var U7=Ht(function(f){return ml(Ci(f,1,Ar,!0))}),j7=Ht(function(f){var m=Qs(f);return Ar(m)&&(m=t),ml(Ci(f,1,Ar,!0),yt(m,2))}),q7=Ht(function(f){var m=Qs(f);return m=typeof m=="function"?m:t,ml(Ci(f,1,Ar,!0),t,m)});function z7(f){return f&&f.length?ml(f):[]}function W7(f,m){return f&&f.length?ml(f,yt(m,2)):[]}function H7(f,m){return m=typeof m=="function"?m:t,f&&f.length?ml(f,t,m):[]}function nx(f){if(!(f&&f.length))return[];var m=0;return f=_c(f,function(_){if(Ar(_))return m=Zr(_.length,m),!0}),qf(m,function(_){return Lt(f,er(_))})}function $R(f,m){if(!(f&&f.length))return[];var _=nx(f);return m==null?_:Lt(_,function(R){return ua(m,t,R)})}var V7=Ht(function(f,m){return Ar(f)?am(f,m):[]}),G7=Ht(function(f){return U1(_c(f,Ar))}),K7=Ht(function(f){var m=Qs(f);return Ar(m)&&(m=t),U1(_c(f,Ar),yt(m,2))}),Y7=Ht(function(f){var m=Qs(f);return m=typeof m=="function"?m:t,U1(_c(f,Ar),t,m)}),X7=Ht(nx);function J7(f,m){return nR(f||[],m||[],im)}function Q7(f,m){return nR(f||[],m||[],cm)}var Z7=Ht(function(f){var m=f.length,_=m>1?f[m-1]:t;return _=typeof _=="function"?(f.pop(),_):t,$R(f,_)});function BR(f){var m=z(f);return m.__chain__=!0,m}function e9(f,m){return m(f),f}function s0(f,m){return m(f)}var t9=xu(function(f){var m=f.length,_=m?f[0]:0,R=this.__wrapped__,F=function(H){return E1(H,f)};return m>1||this.__actions__.length||!(R instanceof an)||!wu(_)?this.thru(F):(R=R.slice(_,+_+(m?1:0)),R.__actions__.push({func:s0,args:[F],thisArg:t}),new Ys(R,this.__chain__).thru(function(H){return m&&!H.length&&H.push(t),H}))});function n9(){return BR(this)}function r9(){return new Ys(this.value(),this.__chain__)}function i9(){this.__values__===t&&(this.__values__=ZR(this.value()));var f=this.__index__>=this.__values__.length,m=f?t:this.__values__[this.__index__++];return{done:f,value:m}}function a9(){return this}function s9(f){for(var m,_=this;_ instanceof Hv;){var R=OR(_);R.__index__=0,R.__values__=t,m?F.__wrapped__=R:m=R;var F=R;_=_.__wrapped__}return F.__wrapped__=f,m}function o9(){var f=this.__wrapped__;if(f instanceof an){var m=f;return this.__actions__.length&&(m=new an(this)),m=m.reverse(),m.__actions__.push({func:s0,args:[tx],thisArg:t}),new Ys(m,this.__chain__)}return this.thru(tx)}function c9(){return tR(this.__wrapped__,this.__actions__)}var u9=Qv(function(f,m,_){Tn.call(f,_)?++f[_]:bc(f,_,1)});function l9(f,m,_){var R=Nt(f)?Tv:ej;return _&&ha(f,m,_)&&(m=t),R(f,yt(m,3))}function d9(f,m){var _=Nt(f)?_c:$P;return _(f,yt(m,3))}var f9=fR(MR),h9=fR(DR);function p9(f,m){return Ci(o0(f,m),1)}function m9(f,m){return Ci(o0(f,m),ie)}function g9(f,m,_){return _=_===t?1:Ft(_),Ci(o0(f,m),_)}function UR(f,m){var _=Nt(f)?la:pl;return _(f,yt(m,3))}function jR(f,m){var _=Nt(f)?g1:FP;return _(f,yt(m,3))}var v9=Qv(function(f,m,_){Tn.call(f,_)?f[_].push(m):bc(f,_,[m])});function y9(f,m,_,R){f=Ea(f)?f:Zf(f),_=_&&!R?Ft(_):0;var F=f.length;return _<0&&(_=Zr(F+_,0)),f0(f)?_<=F&&f.indexOf(m,_)>-1:!!F&&tt(f,m,_)>-1}var _9=Ht(function(f,m,_){var R=-1,F=typeof m=="function",H=Ea(f)?_e(f.length):[];return pl(f,function(ee){H[++R]=F?ua(m,ee,_):sm(ee,m,_)}),H}),b9=Qv(function(f,m,_){bc(f,_,m)});function o0(f,m){var _=Nt(f)?Lt:WP;return _(f,yt(m,3))}function x9(f,m,_,R){return f==null?[]:(Nt(m)||(m=m==null?[]:[m]),_=R?t:_,Nt(_)||(_=_==null?[]:[_]),KP(f,m,_))}var w9=Qv(function(f,m,_){f[_?0:1].push(m)},function(){return[[],[]]});function C9(f,m,_){var R=Nt(f)?Hp:Ev,F=arguments.length<3;return R(f,yt(m,4),_,F,pl)}function k9(f,m,_){var R=Nt(f)?D:Ev,F=arguments.length<3;return R(f,yt(m,4),_,F,FP)}function S9(f,m){var _=Nt(f)?_c:$P;return _(f,l0(yt(m,3)))}function T9(f){var m=Nt(f)?MP:yj;return m(f)}function E9(f,m,_){(_?ha(f,m,_):m===t)?m=1:m=Ft(m);var R=Nt(f)?Y8:_j;return R(f,m)}function P9(f){var m=Nt(f)?X8:xj;return m(f)}function R9(f){if(f==null)return 0;if(Ea(f))return f0(f)?zf(f):f.length;var m=Bi(f);return m==Ct||m==hn?f.size:M1(f).length}function A9(f,m,_){var R=Nt(f)?C:wj;return _&&ha(f,m,_)&&(m=t),R(f,yt(m,3))}var I9=Ht(function(f,m){if(f==null)return[];var _=m.length;return _>1&&ha(f,m[0],m[1])?m=[]:_>2&&ha(m[0],m[1],m[2])&&(m=[m[0]]),KP(f,Ci(m,1),[])}),c0=d8||function(){return Xe.Date.now()};function O9(f,m){if(typeof m!="function")throw new Ks(s);return f=Ft(f),function(){if(--f<1)return m.apply(this,arguments)}}function qR(f,m,_){return m=_?t:m,m=f&&m==null?f.length:m,bu(f,P,t,t,t,t,m)}function zR(f,m){var _;if(typeof m!="function")throw new Ks(s);return f=Ft(f),function(){return--f>0&&(_=m.apply(this,arguments)),f<=1&&(m=t),_}}var rx=Ht(function(f,m,_){var R=b;if(_.length){var F=fl(_,Jf(rx));R|=E}return bu(f,R,m,_,F)}),WR=Ht(function(f,m,_){var R=b|x;if(_.length){var F=fl(_,Jf(WR));R|=E}return bu(m,R,f,_,F)});function HR(f,m,_){m=_?t:m;var R=bu(f,w,t,t,t,t,t,m);return R.placeholder=HR.placeholder,R}function VR(f,m,_){m=_?t:m;var R=bu(f,k,t,t,t,t,t,m);return R.placeholder=VR.placeholder,R}function GR(f,m,_){var R,F,H,ee,ae,he,Ee=0,Pe=!1,Be=!1,Ye=!0;if(typeof f!="function")throw new Ks(s);m=Zs(m)||0,ur(_)&&(Pe=!!_.leading,Be="maxWait"in _,H=Be?Zr(Zs(_.maxWait)||0,m):H,Ye="trailing"in _?!!_.trailing:Ye);function ut(Ir){var Lo=R,Su=F;return R=F=t,Ee=Ir,ee=f.apply(Su,Lo),ee}function xt(Ir){return Ee=Ir,ae=dm(Qt,m),Pe?ut(Ir):ee}function jt(Ir){var Lo=Ir-he,Su=Ir-Ee,hA=m-Lo;return Be?$i(hA,H-Su):hA}function vt(Ir){var Lo=Ir-he,Su=Ir-Ee;return he===t||Lo>=m||Lo<0||Be&&Su>=H}function Qt(){var Ir=c0();if(vt(Ir))return cn(Ir);ae=dm(Qt,jt(Ir))}function cn(Ir){return ae=t,Ye&&R?ut(Ir):(R=F=t,ee)}function os(){ae!==t&&rR(ae),Ee=0,R=he=F=ae=t}function pa(){return ae===t?ee:cn(c0())}function cs(){var Ir=c0(),Lo=vt(Ir);if(R=arguments,F=this,he=Ir,Lo){if(ae===t)return xt(he);if(Be)return rR(ae),ae=dm(Qt,m),ut(he)}return ae===t&&(ae=dm(Qt,m)),ee}return cs.cancel=os,cs.flush=pa,cs}var M9=Ht(function(f,m){return LP(f,1,m)}),D9=Ht(function(f,m,_){return LP(f,Zs(m)||0,_)});function N9(f){return bu(f,N)}function u0(f,m){if(typeof f!="function"||m!=null&&typeof m!="function")throw new Ks(s);var _=function(){var R=arguments,F=m?m.apply(this,R):R[0],H=_.cache;if(H.has(F))return H.get(F);var ee=f.apply(this,R);return _.cache=H.set(F,ee)||H,ee};return _.cache=new(u0.Cache||_u),_}u0.Cache=_u;function l0(f){if(typeof f!="function")throw new Ks(s);return function(){var m=arguments;switch(m.length){case 0:return!f.call(this);case 1:return!f.call(this,m[0]);case 2:return!f.call(this,m[0],m[1]);case 3:return!f.call(this,m[0],m[1],m[2])}return!f.apply(this,m)}}function L9(f){return zR(2,f)}var F9=Cj(function(f,m){m=m.length==1&&Nt(m[0])?Lt(m[0],da(yt())):Lt(Ci(m,1),da(yt()));var _=m.length;return Ht(function(R){for(var F=-1,H=$i(R.length,_);++F<H;)R[F]=m[F].call(this,R[F]);return ua(f,this,R)})}),ix=Ht(function(f,m){var _=fl(m,Jf(ix));return bu(f,E,t,m,_)}),KR=Ht(function(f,m){var _=fl(m,Jf(KR));return bu(f,I,t,m,_)}),$9=xu(function(f,m){return bu(f,A,t,t,t,m)});function B9(f,m){if(typeof f!="function")throw new Ks(s);return m=m===t?m:Ft(m),Ht(f,m)}function U9(f,m){if(typeof f!="function")throw new Ks(s);return m=m==null?0:Zr(Ft(m),0),Ht(function(_){var R=_[m],F=vl(_,0,m);return R&&Gs(F,R),ua(f,this,F)})}function j9(f,m,_){var R=!0,F=!0;if(typeof f!="function")throw new Ks(s);return ur(_)&&(R="leading"in _?!!_.leading:R,F="trailing"in _?!!_.trailing:F),GR(f,m,{leading:R,maxWait:m,trailing:F})}function q9(f){return qR(f,1)}function z9(f,m){return ix(q1(m),f)}function W9(){if(!arguments.length)return[];var f=arguments[0];return Nt(f)?f:[f]}function H9(f){return Xs(f,g)}function V9(f,m){return m=typeof m=="function"?m:t,Xs(f,g,m)}function G9(f){return Xs(f,h|g)}function K9(f,m){return m=typeof m=="function"?m:t,Xs(f,h|g,m)}function Y9(f,m){return m==null||NP(f,m,li(m))}function No(f,m){return f===m||f!==f&&m!==m}var X9=n0(A1),J9=n0(function(f,m){return f>=m}),Td=jP(function(){return arguments}())?jP:function(f){return xr(f)&&Tn.call(f,"callee")&&!EP.call(f,"callee")},Nt=_e.isArray,Q9=ca?da(ca):sj;function Ea(f){return f!=null&&d0(f.length)&&!Cu(f)}function Ar(f){return xr(f)&&Ea(f)}function Z9(f){return f===!0||f===!1||xr(f)&&fa(f)==et}var yl=h8||gx,eq=Sa?da(Sa):oj;function tq(f){return xr(f)&&f.nodeType===1&&!fm(f)}function nq(f){if(f==null)return!0;if(Ea(f)&&(Nt(f)||typeof f=="string"||typeof f.splice=="function"||yl(f)||Qf(f)||Td(f)))return!f.length;var m=Bi(f);if(m==Ct||m==hn)return!f.size;if(lm(f))return!M1(f).length;for(var _ in f)if(Tn.call(f,_))return!1;return!0}function rq(f,m){return om(f,m)}function iq(f,m,_){_=typeof _=="function"?_:t;var R=_?_(f,m):t;return R===t?om(f,m,t,_):!!R}function ax(f){if(!xr(f))return!1;var m=fa(f);return m==mt||m==_t||typeof f.message=="string"&&typeof f.name=="string"&&!fm(f)}function aq(f){return typeof f=="number"&&RP(f)}function Cu(f){if(!ur(f))return!1;var m=fa(f);return m==wt||m==Kt||m==Je||m==_r}function YR(f){return typeof f=="number"&&f==Ft(f)}function d0(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=de}function ur(f){var m=typeof f;return f!=null&&(m=="object"||m=="function")}function xr(f){return f!=null&&typeof f=="object"}var XR=Vs?da(Vs):uj;function sq(f,m){return f===m||O1(f,m,Y1(m))}function oq(f,m,_){return _=typeof _=="function"?_:t,O1(f,m,Y1(m),_)}function cq(f){return JR(f)&&f!=+f}function uq(f){if(Vj(f))throw new It(a);return qP(f)}function lq(f){return f===null}function dq(f){return f==null}function JR(f){return typeof f=="number"||xr(f)&&fa(f)==kt}function fm(f){if(!xr(f)||fa(f)!=zt)return!1;var m=$v(f);if(m===null)return!0;var _=Tn.call(m,"constructor")&&m.constructor;return typeof _=="function"&&_ instanceof _&&Dv.call(_)==o8}var sx=yd?da(yd):lj;function fq(f){return YR(f)&&f>=-de&&f<=de}var QR=gu?da(gu):dj;function f0(f){return typeof f=="string"||!Nt(f)&&xr(f)&&fa(f)==xn}function ss(f){return typeof f=="symbol"||xr(f)&&fa(f)==kn}var Qf=vu?da(vu):fj;function hq(f){return f===t}function pq(f){return xr(f)&&Bi(f)==Er}function mq(f){return xr(f)&&fa(f)==Jn}var gq=n0(D1),vq=n0(function(f,m){return f<=m});function ZR(f){if(!f)return[];if(Ea(f))return f0(f)?Oo(f):Ta(f);if(Zp&&f[Zp])return Av(f[Zp]());var m=Bi(f),_=m==Ct?x1:m==hn?Iv:Zf;return _(f)}function ku(f){if(!f)return f===0?f:0;if(f=Zs(f),f===ie||f===-ie){var m=f<0?-1:1;return m*ue}return f===f?f:0}function Ft(f){var m=ku(f),_=m%1;return m===m?_?m-_:m:0}function eA(f){return f?wd(Ft(f),0,we):0}function Zs(f){if(typeof f=="number")return f;if(ss(f))return Ce;if(ur(f)){var m=typeof f.valueOf=="function"?f.valueOf():f;f=ur(m)?m+"":m}if(typeof f!="string")return f===0?f:+f;f=Gp(f);var _=So.test(f);return _||du.test(f)?Qe(f.slice(2),_?2:8):fc.test(f)?Ce:+f}function tA(f){return wc(f,Pa(f))}function yq(f){return f?wd(Ft(f),-de,de):f===0?f:0}function En(f){return f==null?"":as(f)}var _q=Yf(function(f,m){if(lm(m)||Ea(m)){wc(m,li(m),f);return}for(var _ in m)Tn.call(m,_)&&im(f,_,m[_])}),nA=Yf(function(f,m){wc(m,Pa(m),f)}),rA=Yf(function(f,m,_,R){wc(m,Pa(m),f,R)}),ox=Yf(function(f,m,_,R){wc(m,li(m),f,R)}),bq=xu(E1);function xq(f,m){var _=Kf(f);return m==null?_:DP(_,m)}var wq=Ht(function(f,m){f=Dn(f);var _=-1,R=m.length,F=R>2?m[2]:t;for(F&&ha(m[0],m[1],F)&&(R=1);++_<R;)for(var H=m[_],ee=Pa(H),ae=-1,he=ee.length;++ae<he;){var Ee=ee[ae],Pe=f[Ee];(Pe===t||No(Pe,Hf[Ee])&&!Tn.call(f,Ee))&&(f[Ee]=H[Ee])}return f}),Cq=Ht(function(f){return f.push(t,_R),ua(iA,t,f)});function kq(f,m){return Te(f,yt(m,3),xc)}function Sq(f,m){return Te(f,yt(m,3),R1)}function Tq(f,m){return f==null?f:P1(f,yt(m,3),Pa)}function Eq(f,m){return f==null?f:BP(f,yt(m,3),Pa)}function Pq(f,m){return f&&xc(f,yt(m,3))}function Rq(f,m){return f&&R1(f,yt(m,3))}function Aq(f){return f==null?[]:Kv(f,li(f))}function Iq(f){return f==null?[]:Kv(f,Pa(f))}function cx(f,m,_){var R=f==null?t:Cd(f,m);return R===t?_:R}function Oq(f,m){return f!=null&&wR(f,m,nj)}function ux(f,m){return f!=null&&wR(f,m,rj)}var Mq=pR(function(f,m,_){m!=null&&typeof m.toString!="function"&&(m=Nv.call(m)),f[m]=_},dx(Ra)),Dq=pR(function(f,m,_){m!=null&&typeof m.toString!="function"&&(m=Nv.call(m)),Tn.call(f,m)?f[m].push(_):f[m]=[_]},yt),Nq=Ht(sm);function li(f){return Ea(f)?OP(f):M1(f)}function Pa(f){return Ea(f)?OP(f,!0):hj(f)}function Lq(f,m){var _={};return m=yt(m,3),xc(f,function(R,F,H){bc(_,m(R,F,H),R)}),_}function Fq(f,m){var _={};return m=yt(m,3),xc(f,function(R,F,H){bc(_,F,m(R,F,H))}),_}var $q=Yf(function(f,m,_){Yv(f,m,_)}),iA=Yf(function(f,m,_,R){Yv(f,m,_,R)}),Bq=xu(function(f,m){var _={};if(f==null)return _;var R=!1;m=Lt(m,function(H){return H=gl(H,f),R||(R=H.length>1),H}),wc(f,G1(f),_),R&&(_=Xs(_,h|p|g,Dj));for(var F=m.length;F--;)B1(_,m[F]);return _});function Uq(f,m){return aA(f,l0(yt(m)))}var jq=xu(function(f,m){return f==null?{}:mj(f,m)});function aA(f,m){if(f==null)return{};var _=Lt(G1(f),function(R){return[R]});return m=yt(m),YP(f,_,function(R,F){return m(R,F[0])})}function qq(f,m,_){m=gl(m,f);var R=-1,F=m.length;for(F||(F=1,f=t);++R<F;){var H=f==null?t:f[Do(m[R])];H===t&&(R=F,H=_),f=Cu(H)?H.call(f):H}return f}function zq(f,m,_){return f==null?f:cm(f,m,_)}function Wq(f,m,_,R){return R=typeof R=="function"?R:t,f==null?f:cm(f,m,_,R)}var sA=vR(li),oA=vR(Pa);function Hq(f,m,_){var R=Nt(f),F=R||yl(f)||Qf(f);if(m=yt(m,4),_==null){var H=f&&f.constructor;F?_=R?new H:[]:ur(f)?_=Cu(H)?Kf($v(f)):{}:_={}}return(F?la:xc)(f,function(ee,ae,he){return m(_,ee,ae,he)}),_}function Vq(f,m){return f==null?!0:B1(f,m)}function Gq(f,m,_){return f==null?f:eR(f,m,q1(_))}function Kq(f,m,_,R){return R=typeof R=="function"?R:t,f==null?f:eR(f,m,q1(_),R)}function Zf(f){return f==null?[]:Kp(f,li(f))}function Yq(f){return f==null?[]:Kp(f,Pa(f))}function Xq(f,m,_){return _===t&&(_=m,m=t),_!==t&&(_=Zs(_),_=_===_?_:0),m!==t&&(m=Zs(m),m=m===m?m:0),wd(Zs(f),m,_)}function Jq(f,m,_){return m=ku(m),_===t?(_=m,m=0):_=ku(_),f=Zs(f),ij(f,m,_)}function Qq(f,m,_){if(_&&typeof _!="boolean"&&ha(f,m,_)&&(m=_=t),_===t&&(typeof m=="boolean"?(_=m,m=t):typeof f=="boolean"&&(_=f,f=t)),f===t&&m===t?(f=0,m=1):(f=ku(f),m===t?(m=f,f=0):m=ku(m)),f>m){var R=f;f=m,m=R}if(_||f%1||m%1){var F=AP();return $i(f+F*(m-f+Re("1e-"+((F+"").length-1))),m)}return L1(f,m)}var Zq=Xf(function(f,m,_){return m=m.toLowerCase(),f+(_?cA(m):m)});function cA(f){return lx(En(f).toLowerCase())}function uA(f){return f=En(f),f&&f.replace(fu,Qp).replace(U,"")}function ez(f,m,_){f=En(f),m=as(m);var R=f.length;_=_===t?R:wd(Ft(_),0,R);var F=_;return _-=m.length,_>=0&&f.slice(_,F)==m}function tz(f){return f=En(f),f&&Os.test(f)?f.replace(Xa,Rv):f}function nz(f){return f=En(f),f&&dc.test(f)?f.replace(Qa,"\\$&"):f}var rz=Xf(function(f,m,_){return f+(_?"-":"")+m.toLowerCase()}),iz=Xf(function(f,m,_){return f+(_?" ":"")+m.toLowerCase()}),az=dR("toLowerCase");function sz(f,m,_){f=En(f),m=Ft(m);var R=m?zf(f):0;if(!m||R>=m)return f;var F=(m-R)/2;return t0(qv(F),_)+f+t0(jv(F),_)}function oz(f,m,_){f=En(f),m=Ft(m);var R=m?zf(f):0;return m&&R<m?f+t0(m-R,_):f}function cz(f,m,_){f=En(f),m=Ft(m);var R=m?zf(f):0;return m&&R<m?t0(m-R,_)+f:f}function uz(f,m,_){return _||m==null?m=0:m&&(m=+m),v8(En(f).replace(Ns,""),m||0)}function lz(f,m,_){return(_?ha(f,m,_):m===t)?m=1:m=Ft(m),F1(En(f),m)}function dz(){var f=arguments,m=En(f[0]);return f.length<3?m:m.replace(f[1],f[2])}var fz=Xf(function(f,m,_){return f+(_?"_":"")+m.toLowerCase()});function hz(f,m,_){return _&&typeof _!="number"&&ha(f,m,_)&&(m=_=t),_=_===t?we:_>>>0,_?(f=En(f),f&&(typeof m=="string"||m!=null&&!sx(m))&&(m=as(m),!m&&dl(f))?vl(Oo(f),0,_):f.split(m,_)):[]}var pz=Xf(function(f,m,_){return f+(_?" ":"")+lx(m)});function mz(f,m,_){return f=En(f),_=_==null?0:wd(Ft(_),0,f.length),m=as(m),f.slice(_,_+m.length)==m}function gz(f,m,_){var R=z.templateSettings;_&&ha(f,m,_)&&(m=t),f=En(f),m=ox({},m,R,yR);var F=ox({},m.imports,R.imports,yR),H=li(F),ee=Kp(F,H);la(H,function(vt){if(Za.test(vt))throw new It(c)});var ae,he,Ee=0,Pe=m.interpolate||$s,Be="__p += '",Ye=w1((m.escape||$s).source+"|"+Pe.source+"|"+(Pe===ra?or:$s).source+"|"+(m.evaluate||$s).source+"|$","g"),ut="//# sourceURL="+(Tn.call(m,"sourceURL")?(m.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$e+"]")+` 11`;f.replace(Ye,function(vt,Qt,cn,os,pa,cs){return cn||(cn=os),Be+=f.slice(Ee,cs).replace(To,y1),Qt&&(ae=!0,Be+=`' + 12__e(`+Qt+`) + 13'`),pa&&(he=!0,Be+=`'; 14`+pa+`; 15__p += '`),cn&&(Be+=`' + 16((__t = (`+cn+`)) == null ? '' : __t) + 17'`),Ee=cs+vt.length,vt}),Be+=`'; 18`;var xt=Tn.call(m,"variable")&&m.variable;if(!xt)Be=`with (obj) { 19`+Be+` 20} 21`;else if(Za.test(xt))throw new It(o);Be=(he?Be.replace(Yr,""):Be).replace(Zn,"$1").replace(Ya,"$1;"),Be="function("+(xt||"obj")+`) { 22`+(xt?"":`obj || (obj = {}); 23`)+"var __t, __p = ''"+(ae?", __e = _.escape":"")+(he?`, __j = Array.prototype.join; 24function print() { __p += __j.call(arguments, '') } 25`:`; 26`)+Be+`return __p 27}`;var jt=dA(function(){return wn(H,ut+"return "+Be).apply(t,ee)});if(jt.source=Be,ax(jt))throw jt;return jt}function vz(f){return En(f).toLowerCase()}function yz(f){return En(f).toUpperCase()}function _z(f,m,_){if(f=En(f),f&&(_||m===t))return Gp(f);if(!f||!(m=as(m)))return f;var R=Oo(f),F=Oo(m),H=Yp(R,F),ee=Xp(R,F)+1;return vl(R,H,ee).join("")}function bz(f,m,_){if(f=En(f),f&&(_||m===t))return f.slice(0,CP(f)+1);if(!f||!(m=as(m)))return f;var R=Oo(f),F=Xp(R,Oo(m))+1;return vl(R,0,F).join("")}function xz(f,m,_){if(f=En(f),f&&(_||m===t))return f.replace(Ns,"");if(!f||!(m=as(m)))return f;var R=Oo(f),F=Yp(R,Oo(m));return vl(R,F).join("")}function wz(f,m){var _=j,R=L;if(ur(m)){var F="separator"in m?m.separator:F;_="length"in m?Ft(m.length):_,R="omission"in m?as(m.omission):R}f=En(f);var H=f.length;if(dl(f)){var ee=Oo(f);H=ee.length}if(_>=H)return f;var ae=_-zf(R);if(ae<1)return R;var he=ee?vl(ee,0,ae).join(""):f.slice(0,ae);if(F===t)return he+R;if(ee&&(ae+=he.length-ae),sx(F)){if(f.slice(ae).search(F)){var Ee,Pe=he;for(F.global||(F=w1(F.source,En(Ls.exec(F))+"g")),F.lastIndex=0;Ee=F.exec(Pe);)var Be=Ee.index;he=he.slice(0,Be===t?ae:Be)}}else if(f.indexOf(as(F),ae)!=ae){var Ye=he.lastIndexOf(F);Ye>-1&&(he=he.slice(0,Ye))}return he+R}function Cz(f){return f=En(f),f&&na.test(f)?f.replace(br,ZU):f}var kz=Xf(function(f,m,_){return f+(_?" ":"")+m.toUpperCase()}),lx=dR("toUpperCase");function lA(f,m,_){return f=En(f),m=_?t:m,m===t?b1(f)?n8(f):te(f):f.match(m)||[]}var dA=Ht(function(f,m){try{return ua(f,t,m)}catch(_){return ax(_)?_:new It(_)}}),Sz=xu(function(f,m){return la(m,function(_){_=Do(_),bc(f,_,rx(f[_],f))}),f});function Tz(f){var m=f==null?0:f.length,_=yt();return f=m?Lt(f,function(R){if(typeof R[1]!="function")throw new Ks(s);return[_(R[0]),R[1]]}):[],Ht(function(R){for(var F=-1;++F<m;){var H=f[F];if(ua(H[0],this,R))return ua(H[1],this,R)}})}function Ez(f){return Z8(Xs(f,h))}function dx(f){return function(){return f}}function Pz(f,m){return f==null||f!==f?m:f}var Rz=hR(),Az=hR(!0);function Ra(f){return f}function fx(f){return zP(typeof f=="function"?f:Xs(f,h))}function Iz(f){return HP(Xs(f,h))}function Oz(f,m){return VP(f,Xs(m,h))}var Mz=Ht(function(f,m){return function(_){return sm(_,f,m)}}),Dz=Ht(function(f,m){return function(_){return sm(f,_,m)}});function hx(f,m,_){var R=li(m),F=Kv(m,R);_==null&&!(ur(m)&&(F.length||!R.length))&&(_=m,m=f,f=this,F=Kv(m,li(m)));var H=!(ur(_)&&"chain"in _)||!!_.chain,ee=Cu(f);return la(F,function(ae){var he=m[ae];f[ae]=he,ee&&(f.prototype[ae]=function(){var Ee=this.__chain__;if(H||Ee){var Pe=f(this.__wrapped__),Be=Pe.__actions__=Ta(this.__actions__);return Be.push({func:he,args:arguments,thisArg:f}),Pe.__chain__=Ee,Pe}return he.apply(f,Gs([this.value()],arguments))})}),f}function Nz(){return Xe._===this&&(Xe._=c8),this}function px(){}function Lz(f){return f=Ft(f),Ht(function(m){return GP(m,f)})}var Fz=W1(Lt),$z=W1(Tv),Bz=W1(C);function fA(f){return J1(f)?er(Do(f)):gj(f)}function Uz(f){return function(m){return f==null?t:Cd(f,m)}}var jz=mR(),qz=mR(!0);function mx(){return[]}function gx(){return!1}function zz(){return{}}function Wz(){return""}function Hz(){return!0}function Vz(f,m){if(f=Ft(f),f<1||f>de)return[];var _=we,R=$i(f,we);m=yt(m),f-=we;for(var F=qf(R,m);++_<f;)m(_);return F}function Gz(f){return Nt(f)?Lt(f,Do):ss(f)?[f]:Ta(IR(En(f)))}function Kz(f){var m=++s8;return En(f)+m}var Yz=e0(function(f,m){return f+m},0),Xz=H1("ceil"),Jz=e0(function(f,m){return f/m},1),Qz=H1("floor");function Zz(f){return f&&f.length?Gv(f,Ra,A1):t}function eW(f,m){return f&&f.length?Gv(f,yt(m,2),A1):t}function tW(f){return vn(f,Ra)}function nW(f,m){return vn(f,yt(m,2))}function rW(f){return f&&f.length?Gv(f,Ra,D1):t}function iW(f,m){return f&&f.length?Gv(f,yt(m,2),D1):t}var aW=e0(function(f,m){return f*m},1),sW=H1("round"),oW=e0(function(f,m){return f-m},0);function cW(f){return f&&f.length?Vp(f,Ra):0}function uW(f,m){return f&&f.length?Vp(f,yt(m,2)):0}return z.after=O9,z.ary=qR,z.assign=_q,z.assignIn=nA,z.assignInWith=rA,z.assignWith=ox,z.at=bq,z.before=zR,z.bind=rx,z.bindAll=Sz,z.bindKey=WR,z.castArray=W9,z.chain=BR,z.chunk=Zj,z.compact=e7,z.concat=t7,z.cond=Tz,z.conforms=Ez,z.constant=dx,z.countBy=u9,z.create=xq,z.curry=HR,z.curryRight=VR,z.debounce=GR,z.defaults=wq,z.defaultsDeep=Cq,z.defer=M9,z.delay=D9,z.difference=n7,z.differenceBy=r7,z.differenceWith=i7,z.drop=a7,z.dropRight=s7,z.dropRightWhile=o7,z.dropWhile=c7,z.fill=u7,z.filter=d9,z.flatMap=p9,z.flatMapDeep=m9,z.flatMapDepth=g9,z.flatten=NR,z.flattenDeep=l7,z.flattenDepth=d7,z.flip=N9,z.flow=Rz,z.flowRight=Az,z.fromPairs=f7,z.functions=Aq,z.functionsIn=Iq,z.groupBy=v9,z.initial=p7,z.intersection=m7,z.intersectionBy=g7,z.intersectionWith=v7,z.invert=Mq,z.invertBy=Dq,z.invokeMap=_9,z.iteratee=fx,z.keyBy=b9,z.keys=li,z.keysIn=Pa,z.map=o0,z.mapKeys=Lq,z.mapValues=Fq,z.matches=Iz,z.matchesProperty=Oz,z.memoize=u0,z.merge=$q,z.mergeWith=iA,z.method=Mz,z.methodOf=Dz,z.mixin=hx,z.negate=l0,z.nthArg=Lz,z.omit=Bq,z.omitBy=Uq,z.once=L9,z.orderBy=x9,z.over=Fz,z.overArgs=F9,z.overEvery=$z,z.overSome=Bz,z.partial=ix,z.partialRight=KR,z.partition=w9,z.pick=jq,z.pickBy=aA,z.property=fA,z.propertyOf=Uz,z.pull=x7,z.pullAll=FR,z.pullAllBy=w7,z.pullAllWith=C7,z.pullAt=k7,z.range=jz,z.rangeRight=qz,z.rearg=$9,z.reject=S9,z.remove=S7,z.rest=B9,z.reverse=tx,z.sampleSize=E9,z.set=zq,z.setWith=Wq,z.shuffle=P9,z.slice=T7,z.sortBy=I9,z.sortedUniq=M7,z.sortedUniqBy=D7,z.split=hz,z.spread=U9,z.tail=N7,z.take=L7,z.takeRight=F7,z.takeRightWhile=$7,z.takeWhile=B7,z.tap=e9,z.throttle=j9,z.thru=s0,z.toArray=ZR,z.toPairs=sA,z.toPairsIn=oA,z.toPath=Gz,z.toPlainObject=tA,z.transform=Hq,z.unary=q9,z.union=U7,z.unionBy=j7,z.unionWith=q7,z.uniq=z7,z.uniqBy=W7,z.uniqWith=H7,z.unset=Vq,z.unzip=nx,z.unzipWith=$R,z.update=Gq,z.updateWith=Kq,z.values=Zf,z.valuesIn=Yq,z.without=V7,z.words=lA,z.wrap=z9,z.xor=G7,z.xorBy=K7,z.xorWith=Y7,z.zip=X7,z.zipObject=J7,z.zipObjectDeep=Q7,z.zipWith=Z7,z.entries=sA,z.entriesIn=oA,z.extend=nA,z.extendWith=rA,hx(z,z),z.add=Yz,z.attempt=dA,z.camelCase=Zq,z.capitalize=cA,z.ceil=Xz,z.clamp=Xq,z.clone=H9,z.cloneDeep=G9,z.cloneDeepWith=K9,z.cloneWith=V9,z.conformsTo=Y9,z.deburr=uA,z.defaultTo=Pz,z.divide=Jz,z.endsWith=ez,z.eq=No,z.escape=tz,z.escapeRegExp=nz,z.every=l9,z.find=f9,z.findIndex=MR,z.findKey=kq,z.findLast=h9,z.findLastIndex=DR,z.findLastKey=Sq,z.floor=Qz,z.forEach=UR,z.forEachRight=jR,z.forIn=Tq,z.forInRight=Eq,z.forOwn=Pq,z.forOwnRight=Rq,z.get=cx,z.gt=X9,z.gte=J9,z.has=Oq,z.hasIn=ux,z.head=LR,z.identity=Ra,z.includes=y9,z.indexOf=h7,z.inRange=Jq,z.invoke=Nq,z.isArguments=Td,z.isArray=Nt,z.isArrayBuffer=Q9,z.isArrayLike=Ea,z.isArrayLikeObject=Ar,z.isBoolean=Z9,z.isBuffer=yl,z.isDate=eq,z.isElement=tq,z.isEmpty=nq,z.isEqual=rq,z.isEqualWith=iq,z.isError=ax,z.isFinite=aq,z.isFunction=Cu,z.isInteger=YR,z.isLength=d0,z.isMap=XR,z.isMatch=sq,z.isMatchWith=oq,z.isNaN=cq,z.isNative=uq,z.isNil=dq,z.isNull=lq,z.isNumber=JR,z.isObject=ur,z.isObjectLike=xr,z.isPlainObject=fm,z.isRegExp=sx,z.isSafeInteger=fq,z.isSet=QR,z.isString=f0,z.isSymbol=ss,z.isTypedArray=Qf,z.isUndefined=hq,z.isWeakMap=pq,z.isWeakSet=mq,z.join=y7,z.kebabCase=rz,z.last=Qs,z.lastIndexOf=_7,z.lowerCase=iz,z.lowerFirst=az,z.lt=gq,z.lte=vq,z.max=Zz,z.maxBy=eW,z.mean=tW,z.meanBy=nW,z.min=rW,z.minBy=iW,z.stubArray=mx,z.stubFalse=gx,z.stubObject=zz,z.stubString=Wz,z.stubTrue=Hz,z.multiply=aW,z.nth=b7,z.noConflict=Nz,z.noop=px,z.now=c0,z.pad=sz,z.padEnd=oz,z.padStart=cz,z.parseInt=uz,z.random=Qq,z.reduce=C9,z.reduceRight=k9,z.repeat=lz,z.replace=dz,z.result=qq,z.round=sW,z.runInContext=fe,z.sample=T9,z.size=R9,z.snakeCase=fz,z.some=A9,z.sortedIndex=E7,z.sortedIndexBy=P7,z.sortedIndexOf=R7,z.sortedLastIndex=A7,z.sortedLastIndexBy=I7,z.sortedLastIndexOf=O7,z.startCase=pz,z.startsWith=mz,z.subtract=oW,z.sum=cW,z.sumBy=uW,z.template=gz,z.times=Vz,z.toFinite=ku,z.toInteger=Ft,z.toLength=eA,z.toLower=vz,z.toNumber=Zs,z.toSafeInteger=yq,z.toString=En,z.toUpper=yz,z.trim=_z,z.trimEnd=bz,z.trimStart=xz,z.truncate=wz,z.unescape=Cz,z.uniqueId=Kz,z.upperCase=kz,z.upperFirst=lx,z.each=UR,z.eachRight=jR,z.first=LR,hx(z,function(){var f={};return xc(z,function(m,_){Tn.call(z.prototype,_)||(f[_]=m)}),f}(),{chain:!1}),z.VERSION=r,la(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){z[f].placeholder=z}),la(["drop","take"],function(f,m){an.prototype[f]=function(_){_=_===t?1:Zr(Ft(_),0);var R=this.__filtered__&&!m?new an(this):this.clone();return R.__filtered__?R.__takeCount__=$i(_,R.__takeCount__):R.__views__.push({size:$i(_,we),type:f+(R.__dir__<0?"Right":"")}),R},an.prototype[f+"Right"]=function(_){return this.reverse()[f](_).reverse()}}),la(["filter","map","takeWhile"],function(f,m){var _=m+1,R=_==X||_==se;an.prototype[f]=function(F){var H=this.clone();return H.__iteratees__.push({iteratee:yt(F,3),type:_}),H.__filtered__=H.__filtered__||R,H}}),la(["head","last"],function(f,m){var _="take"+(m?"Right":"");an.prototype[f]=function(){return this[_](1).value()[0]}}),la(["initial","tail"],function(f,m){var _="drop"+(m?"":"Right");an.prototype[f]=function(){return this.__filtered__?new an(this):this[_](1)}}),an.prototype.compact=function(){return this.filter(Ra)},an.prototype.find=function(f){return this.filter(f).head()},an.prototype.findLast=function(f){return this.reverse().find(f)},an.prototype.invokeMap=Ht(function(f,m){return typeof f=="function"?new an(this):this.map(function(_){return sm(_,f,m)})}),an.prototype.reject=function(f){return this.filter(l0(yt(f)))},an.prototype.slice=function(f,m){f=Ft(f);var _=this;return _.__filtered__&&(f>0||m<0)?new an(_):(f<0?_=_.takeRight(-f):f&&(_=_.drop(f)),m!==t&&(m=Ft(m),_=m<0?_.dropRight(-m):_.take(m-f)),_)},an.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},an.prototype.toArray=function(){return this.take(we)},xc(an.prototype,function(f,m){var _=/^(?:filter|find|map|reject)|While$/.test(m),R=/^(?:head|last)$/.test(m),F=z[R?"take"+(m=="last"?"Right":""):m],H=R||/^find/.test(m);F&&(z.prototype[m]=function(){var ee=this.__wrapped__,ae=R?[1]:arguments,he=ee instanceof an,Ee=ae[0],Pe=he||Nt(ee),Be=function(Qt){var cn=F.apply(z,Gs([Qt],ae));return R&&Ye?cn[0]:cn};Pe&&_&&typeof Ee=="function"&&Ee.length!=1&&(he=Pe=!1);var Ye=this.__chain__,ut=!!this.__actions__.length,xt=H&&!Ye,jt=he&&!ut;if(!H&&Pe){ee=jt?ee:new an(this);var vt=f.apply(ee,ae);return vt.__actions__.push({func:s0,args:[Be],thisArg:t}),new Ys(vt,Ye)}return xt&&jt?f.apply(this,ae):(vt=this.thru(Be),xt?R?vt.value()[0]:vt.value():vt)})}),la(["pop","push","shift","sort","splice","unshift"],function(f){var m=Ov[f],_=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",R=/^(?:pop|shift)$/.test(f);z.prototype[f]=function(){var F=arguments;if(R&&!this.__chain__){var H=this.value();return m.apply(Nt(H)?H:[],F)}return this[_](function(ee){return m.apply(Nt(ee)?ee:[],F)})}}),xc(an.prototype,function(f,m){var _=z[m];if(_){var R=_.name+"";Tn.call(Gf,R)||(Gf[R]=[]),Gf[R].push({name:m,func:_})}}),Gf[Zv(t,x).name]=[{name:"wrapper",func:t}],an.prototype.clone=k8,an.prototype.reverse=S8,an.prototype.value=T8,z.prototype.at=t9,z.prototype.chain=n9,z.prototype.commit=r9,z.prototype.next=i9,z.prototype.plant=s9,z.prototype.reverse=o9,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=c9,z.prototype.first=z.prototype.head,Zp&&(z.prototype[Zp]=a9),z},Wf=r8();Mt?((Mt.exports=Wf)._=Wf,Tt._=Wf):Xe._=Wf}).call(Fr)}
27)(Ay,Ay.exports);var Y_=Ay.exports;const gV=id(Y_),vV={components:{AdminLayout:Gt,JetPagination:Rp},props:{activities:{type:Object,required:!0}},data(){return{search:"",fetching:!1}},methods:{formatDate(n){return new Date(n).toLocaleString("da-DK",{dateStyle:"medium",timeStyle:"short",hour12:!1})},performSearch:Y_.debounce(function(){this.fetching=!0,this.$inertia.get(route("admin.activity-log"),{search:this.search},{preserveState:!0,preserveScroll:!0,replace:!0,onFinish:()=>{this.fetching=!1}})},300)}};var yV=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"flex flex-col space-y-4 relative z-0"},[t("div",{staticClass:"flex justify-between items-center"},[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight"},[e._v(" Activity Log ")])]),t("div",{staticClass:"flex items-center space-x-3"},[t("div",{staticClass:"relative flex-1"},[t("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[t("svg",{staticClass:"h-5 w-5 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"}})])]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],staticClass:"pl-10 w-full border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-lg shadow-sm",attrs:{type:"text",placeholder:"Search activities..."},domProps:{value:e.search},on:{input:[function(r){r.target.composing||(e.search=r.target.value)},e.performSearch]}})]),e.fetching?t("svg",{staticClass:"animate-spin w-5 h-5 flex-shrink-0 text-gray-500",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[t("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]):e._e()])])]},proxy:!0},{key:"footer",fn:function(){return[e.activities.data.length>0?t("jet-pagination",{staticClass:"mt-6",attrs:{total:e.activities.total,per_page:e.activities.per_page,current_page:e.activities.current_page,last_page:e.activities.last_page,first_page_url:e.activities.first_page_url,last_page_url:e.activities.last_page_url,next_page_url:e.activities.next_page_url,prev_page_url:e.activities.prev_page_url,path:e.activities.path,from:e.activities.from,to:e.activities.to,data:e.activities.data,search:e.search}}):e._e()]},proxy:!0}])},[t("div",{staticClass:"py-6"},[t("div",{staticClass:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"},[t("div",{staticClass:"bg-white overflow-hidden shadow-xl sm:rounded-lg"},[t("div",{staticClass:"p-6"},[t("table",{staticClass:"min-w-full divide-y divide-gray-200"},[t("thead",{staticClass:"bg-gray-50"},[t("tr",[t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Time ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" User ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Action ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Details ")])])]),t("tbody",{staticClass:"bg-white divide-y divide-gray-200"},e._l(e.activities.data,function(r){return t("tr",{key:r.id},[t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},[e._v(" "+e._s(e.formatDate(r.created_at))+" ")]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[r.causer?t("div",{staticClass:"text-sm text-gray-900"},[e._v(" "+e._s(r.causer.firstname)+" "+e._s(r.causer.lastname)+" "),t("div",{staticClass:"text-sm text-gray-500"},[e._v(e._s(r.causer.email))])]):t("div",{staticClass:"text-sm text-gray-500"},[e._v("System")])]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},[r.description==="Game show viewed"?t("p",[e._v(e._s(r.description))]):e._e(
27),r.description==="Active quarantines viewed"?t("p",[e._v(e._s(r.description))]):e._e(),r.description==="Expired quarantines viewed"?t("p",[e._v(e._s(r.description))]):e._e(),r.description==="Active quarantine records viewed"?t("p",[e._v("Viewing active quarantines")]):e._e(),r.description==="Active warning records viewed"?t("p",[e._v("Viewing active warnings")]):e._e(),r.description==="Active person_of_interest records viewed"?t("p",[e._v("Viewing persons of interest")]):e._e(),r.description==="Quarantine created"?t("p",[e._v("Quarantine created")]):e._e(),r.description==="Quarantine viewed"?t("p",[e._v("Quarantine viewed")]):e._e(),r.description==="Quarantine updated"?t("p",[e._v("Quarantine updated")]):e._e(),r.description==="Quarantine deleted"?t("p",[e._v("Quarantine deleted")]):e._e(),r.description==="Quarantine images downloaded"?t("p",[e._v("Quarantine images downloaded")]):e._e(),r.description==="Quarantine expiry reminder sent"?t("p",[e._v("Quarantine expiry reminder sent")]):e._e(),r.description==="Approved away applications viewed"?t("p",[e._v(e._s(r.description))]):e._e(),r.description==="Away applications viewed"?t("p",[e._v(e._s(r.description))]):e._e(),r.description==="Users index viewed"?t("p",[e._v("Viewing users")]):e._e(),r.description==="Away application approved"?t("p",[e._v(e._s(r.description))]):e._e(),r.description==="Away application rejected"?t("p",[e._v(e._s(r.description))]):e._e(),r.description==="Away application deleted"?t("p",[e._v(e._s(r.description))]):e._e(),r.description==="User profile viewed"?t("p",[e._v("Viewing user")]):e._e(
27),r.description==="User profile updated"?t("p",[e._v("User updated")]):e._e()]),t("td",{staticClass:"px-6 py-4 text-sm text-gray-500"},[r.description==="Users index viewed"&&r.properties.search?t("p",[e._v('Searched for "'+e._s(r.properties.search)+'"')]):e._e(),r.description==="Users index viewed"&&!r.properties.search?t("p",[e._v("Viewed all users")]):e._e(),r.description==="Game show viewed"&&r.properties.search?t("p",[e._v('Searched for "'+e._s(r.properties.search)+'" at '+e._s(r.properties.game.home_team.name)+" - "+e._s(r.properties.game.away_team.name))]):e._e(),r.description==="Game show viewed"&&!r.properties.search?t("p",[e._v(e._s(r.properties.game.home_team.name)+" - "+e._s(r.properties.game.away_team.name))]):e._e(),r.description==="Away applications viewed"&&r.properties.search?t("p",[e._v('Searched for "'+e._s(r.properties.search)+'"')]):e._e(),r.description==="Approved away applications viewed"&&r.properties.search?t("p",[e._v('Searched for "'+e._s(r.properties.search)+'"')]):e._e(),r.description==="Away application approved"?t("p",[e._v("UserId: "),t("a",{attrs:{href:`/admin/users/${r.properties.away_application.user_id}`}},[e._v(e._s(r.properties.away_application.user_id))])]):e._e(),r.description==="Away application rejected"?t("p",[e._v("UserId: "),t("a",{attrs:{href:`/admin/users/${r.properties.away_application.user_id}`}},[e._v(e._s(r.properties.away_application.user_id))])]):e._e(),r.description==="Away application deleted"?t("p",[e._v("UserId: "),t("a",{attrs:{href:`/admin/users/${r.properties.away_application.user_id}`}},[e._v(e._s(r.properties.away_application.user_id))])]):e._e(),["Quarantine created","Quarantine viewed","Quarantine updated","Quarantine deleted"].includes(r.description)&&r.properties.quarantine?t("p",[e._v(" "+e._s(r.properties.quarantine.firstname)+" "+e._s(r.properties.quarantine.lastname)+" ("),t("a",{attrs:{href:`/admin/quarantines/${r.properties.quarantine.id}`}},[e._v("#"+e._s(r.properties.quarantine.id))]),e._v(") ")]):e._e(),r.description==="Quarantine expiry reminder sent"&&r.properties.count?t("p",[e._v(" Sent for "+e._s(r.properties.count)+" quarantine(s) ")]):e._e(
27),r.description==="User profile viewed"?t("p",[e._v("User: "+e._s(r.properties.firstname)+" "+e._s(r.properties.lastname)+" ("+e._s(r.properties.email)+") Id: "),t("a",{attrs:{href:`/admin/users/${r.properties.user}`}},[e._v(e._s(r.properties.user))])]):e._e(),r.description==="User profile updated"?t("p",[e._v(" User: "+e._s(r.properties.old_values.firstname)+" "+e._s(r.properties.old_values.lastname)+" ("+e._s(r.properties.old_values.email)+") Id: "),t("a",{attrs:{href:`/admin/users/${r.properties.old_values.id}`}},[e._v(e._s(r.properties.old_values.id))])]):e._e(),r.properties.old_values&&r.properties.new_values?t("div",{staticClass:"space-y-2"},e._l(r.properties.new_values,function(i,a){return t("div",{key:a},[r.properties.old_values[a]!==i&&a!=="created_at"&&a!=="updated_at"&&a!=="email_verified_at"?[t("div",{staticClass:"flex items-start space-x-2"},[t("span",{staticClass:"font-medium"},[e._v(e._s(a)+":")]),t("div",{staticClass:"flex-1"},[t("div",{staticClass:"text-red-500 line-through"},[e._v(" "+e._s(r.properties.old_values[a]||"null")+" ")]),t("div",{staticClass:"text-green-600"},[e._v(" "+e._s(i||"null")+" ")])])])]:e._e()],2)}),0):e._e(),t("p")])])}),0)])])])])])])},_V=[],bV=ve(vV,yV,_V,!1,null,null);const xV=bV.exports,wV=Object.freeze(Object.defineProperty({__proto__:null,default:xV},Symbol.toStringTag,{value:"Module"}));var CV={};/*! 28 * Vue.js v2.7.16 29 * (c) 2014-2023 Evan You 30 * Released under the MIT License. 31 */var ps=Object.freeze({}),Jt=Array.isArray;function Pt(n){return n==null}function be(n){return n!=null}function fr(n){return n===!0}function kV(n){return n===!1}function Yg(n){return typeof n=="string"||typeof n=="number"||typeof n=="symbol"||typeof n=="boolean"}function ar(n){return typeof n=="function"}function Zi(n){return n!==null&&typeof n=="object"}var P2=Object.prototype.toString;function ks(n){return P2.call(n)==="[object Object]"}function SV(n){return P2.call(n)==="[object RegExp]"}function DM(n){var e=parseFloat(String(n));return e>=0&&Math.floor(e)===e&&isFinite(n)}function wC(n){return be(n)&&typeof n.then=="function"&&typeof n.catch=="function"}function TV(n){return n==null?"":Array.isArray(n)||ks(n)&&n.toString===P2?JSON.stringify(n,EV,2):String(n)}function EV(n,e){return e&&e.__v_isRef?e.value:e}function fg(n){var e=parseFloat(n);return isNaN(e)?n:e}function sc(n,e){for(var t=Object.create(null),r=n.split(","),i=0;i<r.length;i++)t[r[i]]=!0;return e?function(a){return t[a.toLowerCase()]}:function(a){return t[a]}}sc("slot,component",!0);var PV=sc("key,ref,slot,slot-scope,is");function ad(n,e){var t=n.length;if(t){if(e===n[t-1]){n.length=t-1;return}var r=n.indexOf(e);if(r>-1)return n.splice(r,1)}}var RV=Object.prototype.hasOwnProperty;function _a(n,e){return RV.call(n,e)}function Sf(n){var e=Object.create(null);return function(r){var i=e[r];return i||(e[r]=n(r))}}var AV=/-(\w)/g,hf=Sf(function(n){return n.replace(AV,function(e,t){return t?t.toUpperCase():""})}),IV=Sf(function(n){return n.charAt(0).toUpperCase()+n.slice(1)}),OV=/\B([A-Z])/g,Xg=Sf(function(n){return n.replace(OV,"-$1").toLowerCase()});function MV(n,e){function t(r){var i=arguments.length;return i?i>1?n.apply(e,arguments):n.call(e,r):n.call(e)}return t._length=n.length,t}function DV(n,e){return n.bind(e)}var NM=Function.prototype.bind?DV:MV;function CC(n,e){e=e||0;for(var t=n.length-e,r=new Array(t);t--;)r[t]=n[t+e];return r}function Wn(n,e){for(var t in e)n[t]=e[t];return n}function LM(n){for(var e={},t=0;t<n.length;t++)n[t]&&Wn(e,n[t]);return e}function mi(n,e,t){}var h0=function(n,e,t){return!1},FM=function(n){return n};function pf(n,e){if(n===e)return!0;var t=Zi(n),r=Zi(e);if(t&&r)try{var i=Array.isArray(n),a=Array.isArray(e);if(i&&a)return n.length===e.length&&n.every(function(c,u){return pf(c,e[u])});if(n instanceof Date&&e instanceof Date)return n.getTime()===e.getTime();if(!i&&!a){var s=Object.keys(n),o=Object.keys(e);return s.length===o.length&&s.every(function(c){return pf(n[c],e[c])})}else return!1}catch{return!1}else return!t&&!r?String(n)===String(e):!1}function $M(n,e){for(var t=0;t<n.length;t++)if(pf(n[t],e))return t;return-1}function Iy(n){var e=!1;return function(){e||(e=!0,n.apply(this,arguments))}}function NV(n,e){return n===e?n===0&&1/n!==1/e:n===n||e===e}var pA="data-server-rendered",X_=["component","directive","filter"],BM=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","
31serverPrefetch","renderTracked","renderTriggered"],mo={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:h0,isReservedAttr:h0,isUnknownElement:h0,getTagNamespace:mi,parsePlatformTagName:FM,mustUseProp:h0,async:!0,_lifecycleHooks:BM},LV=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function UM(n){var e=(n+"").charCodeAt(0);return e===36||e===95}function Fl(n,e,t,r){Object.defineProperty(n,e,{value:t,enumerable:!1,writable:!0,configurable:!0})}var FV=new RegExp("[^".concat(LV.source,".$_\\d]"));function $V(n){if(!FV.test(n)){var e=n.split(".");return function(t){for(var r=0;r<e.length;r++){if(!t)return;t=t[e[r]]}return t}}}var BV="__proto__"in{},Ps=typeof window<"u",go=Ps&&window.navigator.userAgent.toLowerCase(),Ap=go&&/msie|trident/.test(go),Ip=go&&go.indexOf("msie 9.0")>0,jM=go&&go.indexOf("edge/")>0;go&&go.indexOf("android")>0;var UV=go&&/iphone|ipad|ipod|ios/.test(go),mA=go&&go.match(/firefox\/(\d+)/),kC={}.watch,qM=!1;if(Ps)try{var gA={};Object.defineProperty(gA,"passive",{get:function(){qM=!0}}),window.addEventListener("test-passive",null,gA)}catch{}var p0,Jg=function(){return p0===void 0&&(!Ps&&typeof global<"u"?p0=global.process&&CV.VUE_ENV==="server":p0=!1),p0},Oy=Ps&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function Oh(n){return typeof n=="function"&&/native code/.test(n.toString())}var Qg=typeof Symbol<"u"&&Oh(Symbol)&&typeof Reflect<"u"&&Oh(Reflect.ownKeys),hg;typeof Set<"u"&&Oh(Set)?hg=Set:hg=function(){function n(){this.set=Object.create(null)}return n.prototype.has=function(e){return this.set[e]===!0},n.prototype.add=function(e){this.set[e]=!0},n.prototype.clear=function(){this.set=Object.create(null)},n}();var Mh=null;function Gl(n){n===void 0&&(n=null),n||Mh&&Mh._scope.off(),Mh=n,n&&n._scope.on()}var Ss=function(){function n(e,t,r,i,a,s,o,c){this.tag=e,this.data=t,this.children=r,this.text=i,this.elm=a,this.ns=void 0,this.context=s,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=o,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=c,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(n.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),n}(),Jd=function(n){n===void 0&&(n="");var e=new Ss;return e.text=n,e.isComment=!0,e};function wh(n){return new Ss(void 0,void 0,void 0,String(n))}function SC(n){var e=new Ss(n.tag,n.data,n.children&&n.children.slice(),n.text,n.elm,n.context,n.componentOptions,n.asyncFactory);return e.ns=n.ns,e.isStatic=n.isStatic,e.key=n.key,e.isComment=n.isComment,e.fnContext=n.fnContext,e.fnOptions=n.fnOptions,e.fnScopeId=n.fnScopeId,e.asyncMeta=n.asyncMeta,e.isCloned=!0,e}var jV=0,J0=[],qV=function(){for(var n=0;n<J0.length;n++){var e=J0[n];e.subs=e.subs.filter(function(t){return t}),e._pending=!1}J0.length=0},Kl=function(){function n(){this._pending=!1,this.id=jV++,this.subs=[]}return n.prototype.addSub=function(e){this.subs.push(e)},n.prototype.removeSub=function(e){this.subs[this.subs.indexOf(e)]=null,this._pending||(this._pending=!0,J0.push(this))}
31,n.prototype.depend=function(e){n.target&&n.target.addDep(this)},n.prototype.notify=function(e){for(var t=this.subs.filter(function(s){return s}),r=0,i=t.length;r<i;r++){var a=t[r];a.update()}},n}();Kl.target=null;var Q0=[];function Op(n){Q0.push(n),Kl.target=n}function Mp(){Q0.pop(),Kl.target=Q0[Q0.length-1]}var zM=Array.prototype,My=Object.create(zM),zV=["push","pop","shift","unshift","splice","sort","reverse"];zV.forEach(function(n){var e=zM[n];Fl(My,n,function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=e.apply(this,r),s=this.__ob__,o;switch(n){case"push":case"unshift":o=r;break;case"splice":o=r.slice(2);break}return o&&s.observeArray(o),s.dep.notify(),a})});var vA=Object.getOwnPropertyNames(My),WM={},R2=!0;function Yl(n){R2=n}var WV={notify:mi,depend:mi,addSub:mi,removeSub:mi},yA=function(){function n(e,t,r){if(t===void 0&&(t=!1),r===void 0&&(r=!1),this.value=e,this.shallow=t,this.mock=r,this.dep=r?WV:new Kl,this.vmCount=0,Fl(e,"__ob__",this),Jt(e)){if(!r)if(BV)e.__proto__=My;else for(var i=0,a=vA.length;i<a;i++){var s=vA[i];Fl(e,s,My[s])}t||this.observeArray(e)}else for(var o=Object.keys(e),i=0;i<o.length;i++){var s=o[i];mf(e,s,WM,void 0,t,r)}}return n.prototype.observeArray=function(e){for(var t=0,r=e.length;t<r;t++)Yu(e[t],!1,this.mock)},n}();function Yu(n,e,t){if(n&&_a(n,"__ob__")&&n.__ob__ instanceof yA)return n.__ob__;if(R2&&(t||!Jg())&&(Jt(n)||ks(n))&&Object.isExtensible(n)&&!n.__v_skip&&!Wc(n)&&!(n instanceof Ss))return new yA(n,e,t)}function mf(n,e,t,r,i,a,s){s===void 0&&(s=!1);var o=new Kl,c=Object.getOwnPropertyDescriptor(n,e);if(!(c&&c.configurable===!1)){var u=c&&c.get,l=c&&c.set;(!u||l)&&(t===WM||arguments.length===2)&&(t=n[e]);var d=i?t&&t.__ob__:Yu(t,!1,a);return Object.defineProperty(n,e,{enumerable:!0,configurable:!0,get:function(){var p=u?u.call(n):t;return Kl.target&&(o.depend(),d&&(d.dep.depend(),Jt(p)&&VM(p))),Wc(p)&&!i?p.value:p},set:function(p){var g=u?u.call(n):t;if(NV(g,p)){if(l)l.call(n,p);else{if(u)return;if(!i&&Wc(g)&&!Wc(p)){g.value=p;return}else t=p}d=i?p&&p.__ob__:Yu(p,!1,a),o.notify()}}}),o}}function A2(n,e,t){if(!I2(n)){var r=n.__ob__;return Jt(n)&&DM(e)?(n.length=Math.max(n.length,e),n.splice(e,1,t),r&&!r.shallow&&r.mock&&Yu(t,!1,!0),t):e in n&&!(e in Object.prototype)?(n[e]=t,t):n._isVue||r&&r.vmCount?t:r?(mf(r.value,e,t,void 0,r.shallow,r.mock),r.dep.notify(),t):(n[e]=t,t)}}function HM(n,e){if(Jt(n)&&DM(e)){n.splice(e,1);return}var t=n.__ob__;n._isVue||t&&t.vmCount||I2(n)||_a(n,e)&&(delete n[e],t&&t.dep.notify())}function VM(n){for(var e=void 0,t=0,r=n.length;t<r;t++)e=n[t],e&&e.__ob__&&e.__ob__.dep.depend(),Jt(e)&&VM(e)}function GM(n){return HV(n,!0),Fl(n,"__v_isShallow",!0),n}function HV(n,e){I2(n)||Yu(n,e,Jg())}function I2(n){return!!(n&&n.__v_isReadonly)}function Wc(n){return!!(n&&n.__v_isRef===!0)}function TC(n,e,t){Object.defineProperty(n,t,{enumerable:!0,configurable:!0,get:function(){var r=e[t];if(Wc(r))return r.value;var i=r&&r.__ob__;return i&&i.dep.depend(),r},set:function(r){var i=e[t];Wc(i)&&!Wc(r)?i.value=r:e[t]=r}})}var Ia,VV=function(){function n(e){e===void 0&&(e=!1),this.detached=e,this.active=!0,this.effects=[],this.cleanups=[],this.parent=Ia,!e&&Ia&&(this.index=(Ia.scopes||(Ia.scopes=[])).push(this)-1)}return n.prototype.run=function(e){if(this.active){var t=Ia;try{return Ia=this,e()}finally{Ia=t}}},n.prototype.on=function(){Ia=this},n.prototype.off=function(){Ia=this.parent},n.prototype.stop=function(e){if(this.active){var t=void 0,r=void 0;for(t=0,r=this.effects.length;t<r;t++)this.effects[t].teardown();for(t=0,r=this.cleanups.length;t<r;t++)this.cleanups[t]();if(this.scopes)for(t=0,r=this.scopes.length;t<r;t++)this.scopes[t].stop(!0);if(!this.detached&&this.parent&&!e){var i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0,this.active=!1}},n}();function GV(n,e){e===void 0&&(e=Ia),e&&e.active&&e.effects.push(n)}function KV(){return Ia}function YV(n){var e=n._provided,t=n.$parent&&n.$parent._provided;return t===e?n._provided=Object.create(t):e}var _A=Sf(function(n){var e=n.charAt(0)==="&";n=e?n.slice(1):n;var t=n.charAt(0)==="~";n=t?n.slice(1):n;var r=n.charAt(0)==="!";return n=r?n.slice(1):n,{name:n,once:t,capture:r,passive:e}});function EC(n,e){function t(){var r=t.fns;if(Jt(r))for(var i=r.slice(),a=0;a<i.length;a++)Xl(i[a],null,arguments,e,"v-on handler");else return Xl(r,null,arguments,e,"v-on handler")}return t.fns=n,t}function KM(n,e,t,r,i,a){var s,o,c,u;for(s in n)o=n[s],c=e[s],u=_A(s),Pt(o)||(Pt(c)?(Pt(o.fns)&&(o=n[s]=EC(o,a)),fr(u.once)&&(o=n[s]=i(u.name,o,u.capture)),t(u.name,o,u.capture,u.passive,u.params)):o!==c&&(c.fns=o,n[s]=c));for(s in e)Pt(n[s])&&(u=_A(s),r(u.name,e[s],u.capture))}function Sl(n,e,t){n instanceof Ss&&(n=n.data.hook||(n.data.hook={}));var r,i=n[e];function a(){t.apply(this,arguments),ad(r.fns,a)}Pt(i)?r=EC([a]):be(i.fns)&&fr(i.merged)?(r=i,r.fns.push(a)):r=EC([i,a]),r.merged=!0,n[e]=r}function XV(n,e,t){var r=e.options.props;if(!Pt(r)){var i={},a=n.attrs,s=n.props;if(be(a)||be(s))for(var o in r){var c=Xg(o);bA(i,s,o,c,!0)||bA(i,a,o,c,!1)}return i}}function bA(n,e,t,r,i){if(be(e)){if(_a(e,t))return n[t]=e[t],i||delete e[t],!0;if(_a(e,r))return n[t]=e[r],i||delete e[r],!0}return!1}function JV(n){for(var e=0;e<n.length;e++)if(Jt(n[e]))return Array.prototype.concat.apply([],n);return n}function O2(n){return Yg(n)?[wh(n)]:Jt(n)?YM(n):void 0}function hm(n){return be(n)&&be(n.text)&&kV(n.isComment)}function YM(n,e){var t=[],r,i,a,s;for(r=0;r<n.length;r++)i=n[r],!(Pt(i)||typeof i=="boolean")&&(a=t.length-1,s=t[a],Jt(i)?i.length>0&&(i=YM(i,"".concat(e||"","_").concat(r)),hm(i[0])&&hm(s)&&(t[a]=wh(s.text+i[0].text),i.shift()),t.push.apply(t,i)):Yg(i)?hm(s)?t[a]=wh(s.text+i):i!==""&&t.push(w
31h(i)):hm(i)&&hm(s)?t[a]=wh(s.text+i.text):(fr(n._isVList)&&be(i.tag)&&Pt(i.key)&&be(e)&&(i.key="__vlist".concat(e,"_").concat(r,"__")),t.push(i)));return t}function QV(n,e){var t=null,r,i,a,s;if(Jt(n)||typeof n=="string")for(t=new Array(n.length),r=0,i=n.length;r<i;r++)t[r]=e(n[r],r);else if(typeof n=="number")for(t=new Array(n),r=0;r<n;r++)t[r]=e(r+1,r);else if(Zi(n))if(Qg&&n[Symbol.iterator]){t=[];for(var o=n[Symbol.iterator](),c=o.next();!c.done;)t.push(e(c.value,t.length)),c=o.next()}else for(a=Object.keys(n),t=new Array(a.length),r=0,i=a.length;r<i;r++)s=a[r],t[r]=e(n[s],s,r);return be(t)||(t=[]),t._isVList=!0,t}function ZV(n,e,t,r){var i=this.$scopedSlots[n],a;i?(t=t||{},r&&(t=Wn(Wn({},r),t)),a=i(t)||(ar(e)?e():e)):a=this.$slots[n]||(ar(e)?e():e);var s=t&&t.slot;return s?this.$createElement("template",{slot:s},a):a}function eG(n){return By(this.$options,"filters",n)||FM}function xA(n,e){return Jt(n)?n.indexOf(e)===-1:n!==e}function tG(n,e,t,r,i){var a=mo.keyCodes[e]||t;return i&&r&&!mo.keyCodes[e]?xA(i,r):a?xA(a,n):r?Xg(r)!==e:n===void 0}function nG(n,e,t,r,i){if(t&&Zi(t)){Jt(t)&&(t=LM(t));var a=void 0,s=function(c){if(c==="class"||c==="style"||PV(c))a=n;else{var u=n.attrs&&n.attrs.type;a=r||mo.mustUseProp(e,u,c)?n.domProps||(n.domProps={}):n.attrs||(n.attrs={})}var l=hf(c),d=Xg(c);if(!(l in a)&&!(d in a)&&(a[c]=t[c],i)){var h=n.on||(n.on={});h["update:".concat(c)]=function(p){t[c]=p}}};for(var o in t)s(o)}return n}function rG(n,e){var t=this._staticTrees||(this._staticTrees=[]),r=t[n];return r&&!e||(r=t[n]=this.$options.staticRenderFns[n].call(this._renderProxy,this._c,this),XM(r,"__static__".concat(n),!1)),r}function iG(n,e,t){return XM(n,"__once__".concat(e).concat(t?"_".concat(t):""),!0),n}function XM(n,e,t){if(Jt(n))for(var r=0;r<n.length;r++)n[r]&&typeof n[r]!="string"&&wA(n[r],"".concat(e,"_").concat(r),t);else wA(n,e,t)}function wA(n,e,t){n.isStatic=!0,n.key=e,n.isOnce=t}function aG(n,e){if(e&&ks(e)){var t=n.on=n.on?Wn({},n.on):{};for(var r in e){var i=t[r],a=e[r];t[r]=i?[].concat(i,a):a}}return n}function JM(n,e,t,r){e=e||{$stable:!t};for(var i=0;i<n.length;i++){var a=n[i];Jt(a)?JM(a,e,t):a&&(a.proxy&&(a.fn.proxy=!0),e[a.key]=a.fn)}return r&&(e.$key=r),e}function sG(n,e){for(var t=0;t<e.length;t+=2){var r=e[t];typeof r=="string"&&r&&(n[e[t]]=e[t+1])}return n}function oG(n,e){return typeof n=="string"?e+n:n}function QM(n){n._o=iG,n._n=fg,n._s=TV,n._l=QV,n._t=ZV,n._q=pf,n._i=$M,n._m=rG,n._f=eG,n._k=tG,n._b=nG,n._v=wh,n._e=Jd,n._u=JM,n._g=aG,n._d=sG,n._p=oG}function M2(n,e){if(!n||!n.length)return{};for(var t={},r=0,i=n.length;r<i;r++){var a=n[r],s=a.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,(a.context===e||a.fnContext===e)&&s&&s.slot!=null){var o=s.slot,c=t[o]||(t[o]=[]);a.tag==="template"?c.push.apply(c,a.children||[]):c.push(a)}else(t.default||(t.default=[])).push(a)}for(var u in t)t[u].every(cG)&&delete t[u];return t}function cG(n){return n.isComment&&!n.asyncFactory||n.text===" "}function pg(n){return n.isComment&&n.asyncFactory}function qm(n,e,t,r){var i,a=Object.keys(t).length>0,s=e?!!e.$stable:!a,o=e&&e.$key;if(!e)i={};else{if(e._normalized)return e._normalized;if(s&&r&&r!==ps&&o===r.$key&&!a&&!r.$hasNormal)return r;i={};for(var c in e)e[c]&&c[0]!=="$"&&(i[c]=uG(n,t,c,e[c]))}for(var u in t)u in i||(i[u]=lG(t,u));return e&&Object.isExtensible(e)&&(e._normalized=i),Fl(i,"$stable",s),Fl(i,"$key",o),Fl(i,"$hasNormal",a),i}function uG(n,e,t,r){var i=function(){var a=Mh;Gl(n);var s=arguments.length?r.apply(null,arguments):r({});s=s&&typeof s=="object"&&!Jt(s)?[s]:O2(s);var o=s&&s[0];return Gl(a),s&&(!o||s.length===1&&o.isComment&&!pg(o))?void 0:s};return r.proxy&&Object.defineProperty(e,t,{get:i,enumerable:!0,configurable:!0}),i}function lG(n,e){return function(){return n[e]}}function dG(n){var e=n.$options,t=e.setup;if(t){var r=n._setupContext=fG(n);Gl(n),Op();var i=Xl(t,null,[n._props||GM({}),r],n,"setup");if(Mp(),Gl(),ar(i))e.render=i;else if(Zi(i))if(n._setupState=i,i.__sfc){var s=n._setupProxy={};for(var a in i)a!=="__sfc"&&TC(s,i,a)}else for(var a in i)UM(a)||TC(n,i,a)}}function fG(n){return{get attrs(){if(!n._attrsProxy){var e=n._attrsProxy={};Fl(e,"_v_attr_proxy",!0),Dy(e,n.$attrs,ps,n,"$attrs")}return n._attrsProxy},get listeners(){if(!n._listenersProxy){var e=n._listenersProxy={};Dy(e,n.$listeners,ps,n,"$listeners")}return n._listenersProxy},get slots(){return pG(n)},emit:NM(n.$emit,n),expose:function(e){e&&Object.keys(e).forEach(function(t){return TC(n,e,t)})}}}function Dy(n,e,t,r,i){var a=!1;for(var s in e)s in n?e[s]!==t[s]&&(a=!0):(a=!0,hG(n,s,r,i));for(var s in n)s in e||(a=!0,delete n[s]);return a}function hG(n,e,t,r){Object.defineProperty(n,e,{enumerable:!0,configurable:!0,get:function(){return t[r][e]}})}function pG(n){return n._slotsProxy||ZM(n._slotsProxy={},n.$scopedSlots),n._slotsProxy}function ZM(n,e){for(var t in e)n[t]=e[t];for(var t in n)t in e||delete n[t]}function mG(n){n._vnode=null,n._staticTrees=null;var e=n.$options,t=n.$vnode=e._parentVnode,r=t&&t.context;n.$slots=M2(e._renderChildren,r),n.$scopedSlots=t?qm(n.$parent,t.data.scopedSlots,n.$slots):ps,n._c=function(a,s,o,c){return Ny(n,a,s,o,c,!1)},n.$createElement=function(a,s,o,c){return Ny(n,a,s,o,c,!0)};var i=t&&t.data;mf(n,"$attrs",i&&i.attrs||ps,null,!0),mf(n,"$listeners",e._parentListeners||ps,null,!0)}var Z0=null;function gG(n){QM(n.prototype),n.prototype.$nextTick=function(e){return D2(e,this)},n.prototype._render=function(){var e=this,t=e.$options,r=t.render,i=t._parentVnode;i&&e._isMounted&&(e.$scopedSlots=qm(e.$parent,i.data.scopedSlots,e.$slots,e.$scopedSlots),e._slotsProxy&&ZM(e._slotsProxy,e.$scopedSlots)),e.$vnode=i;var a=Mh,s=Z0,o;try{Gl(e),Z0=e,o=r.call(e._renderProxy,e.$createElement)}catch(c){gf(c,e,"render"),o=e._vnode}finally{Z0=s,Gl(a)}return Jt(o)&&o.length===1&&(o=o[0]),o instanceof Ss||(o=Jd()),o.parent=i,o}}function vx(n,e){return(n.__esModule||Qg&&n[Symbol.toStringTag]==="Module")&&(n=n.default),Zi(n)?e.extend(n):n}function vG(n,e,t,r,i){var a=Jd();return a.asyncFactory=n,a.asyncMeta={data:e,context:t,children:r,tag:i},a}function yG(n,e){if(fr(n.error)&&be(n.errorComp))return n.errorComp;if(be(n.resolved))return n.resolved;var t=Z0;
31if(t&&be(n.owners)&&n.owners.indexOf(t)===-1&&n.owners.push(t),fr(n.loading)&&be(n.loadingComp))return n.loadingComp;if(t&&!be(n.owners)){var r=n.owners=[t],i=!0,a=null,s=null;t.$on("hook:destroyed",function(){return ad(r,t)});var o=function(d){for(var h=0,p=r.length;h<p;h++)r[h].$forceUpdate();d&&(r.length=0,a!==null&&(clearTimeout(a),a=null),s!==null&&(clearTimeout(s),s=null))},c=Iy(function(d){n.resolved=vx(d,e),i?r.length=0:o(!0)}),u=Iy(function(d){be(n.errorComp)&&(n.error=!0,o(!0))}),l=n(c,u);return Zi(l)&&(wC(l)?Pt(n.resolved)&&l.then(c,u):wC(l.component)&&(l.component.then(c,u),be(l.error)&&(n.errorComp=vx(l.error,e)),be(l.loading)&&(n.loadingComp=vx(l.loading,e),l.delay===0?n.loading=!0:a=setTimeout(function(){a=null,Pt(n.resolved)&&Pt(n.error)&&(n.loading=!0,o(!1))},l.delay||200)),be(l.timeout)&&(s=setTimeout(function(){s=null,Pt(n.resolved)&&u(null)},l.timeout)))),i=!1,n.loading?n.loadingComp:n.resolved}}function eD(n){if(Jt(n))for(var e=0;e<n.length;e++){var t=n[e];if(be(t)&&(be(t.componentOptions)||pg(t)))return t}}var _G=1,tD=2;function Ny(n,e,t,r,i,a){return(Jt(t)||Yg(t))&&(i=r,r=t,t=void 0),fr(a)&&(i=tD),bG(n,e,t,r,i)}function bG(n,e,t,r,i){if(be(t)&&be(t.__ob__)||(be(t)&&be(t.is)&&(e=t.is),!e))return Jd();Jt(r)&&ar(r[0])&&(t=t||{},t.scopedSlots={default:r[0]},r.length=0),i===tD?r=O2(r):i===_G&&(r=JV(r));var a,s;if(typeof e=="string"){var o=void 0;s=n.$vnode&&n.$vnode.ns||mo.getTagNamespace(e),mo.isReservedTag(e)?a=new Ss(mo.parsePlatformTagName(e),t,r,void 0,void 0,n):(!t||!t.pre)&&be(o=By(n.$options,"components",e))?a=AA(o,t,n,r,e):a=new Ss(e,t,r,void 0,void 0,n)}else a=AA(e,t,n,r);return Jt(a)?a:be(a)?(be(s)&&nD(a,s),be(t)&&xG(t),a):Jd()}function nD(n,e,t){if(n.ns=e,n.tag==="foreignObject"&&(e=void 0,t=!0),be(n.children))for(var r=0,i=n.children.length;r<i;r++){var a=n.children[r];be(a.tag)&&(Pt(a.ns)||fr(t)&&a.tag!=="svg")&&nD(a,e,t)}}function xG(n){Zi(n.style)&&Ly(n.style),Zi(n.class)&&Ly(n.class)}function gf(n,e,t){Op();try{if(e)for(var r=e;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var a=0;a<i.length;a++)try{var s=i[a].call(r,n,e,t)===!1;if(s)return}catch(o){CA(o,r,"errorCaptured hook")}}CA(n,e,t)}finally{Mp()}}function Xl(n,e,t,r,i){var a;try{a=t?n.apply(e,t):n.call(e),a&&!a._isVue&&wC(a)&&!a._handled&&(a.catch(function(s){return gf(s,r,i+" (Promise/async)")}),a._handled=!0)}catch(s){gf(s,r,i)}return a}function CA(n,e,t){if(mo.errorHandler)try{return mo.errorHandler.call(null,n,e,t)}catch(r){r!==n&&kA(r)}kA(n)}function kA(n,e,t){if(Ps&&typeof console<"u")console.error(n);else throw n}var PC=!1,RC=[],AC=!1;function m0(){AC=!1;var n=RC.slice(0);RC.length=0;for(var e=0;e<n.length;e++)n[e]()}var Dm;if(typeof Promise<"u"&&Oh(Promise)){var wG=Promise.resolve();Dm=function(){wG.then(m0),UV&&setTimeout(mi)},PC=!0}else if(!Ap&&typeof MutationObserver<"u"&&(Oh(MutationObserver)||MutationObserver.toString()==="[object MutationObserverConstructor]")){var g0=1,CG=new MutationObserver(m0),SA=document.createTextNode(String(g0));CG.observe(SA,{characterData:!0}),Dm=function(){g0=(g0+1)%2,SA.data=String(g0)},PC=!0}else typeof setImmediate<"u"&&Oh(setImmediate)?Dm=function(){setImmediate(m0)}:Dm=function(){setTimeout(m0,0)};function D2(n,e){var t;if(RC.push(function(){if(n)try{n.call(e)}catch(r){gf(r,e,"nextTick")}else t&&t(e)}),AC||(AC=!0,Dm()),!n&&typeof Promise<"u")return new Promise(function(r){t=r})}var kG="2.7.16",TA=new hg;function Ly(n){return ey(n,TA),TA.clear(),n}function ey(n,e){var t,r,i=Jt(n);if(!(!i&&!Zi(n)||n.__v_skip||Object.isFrozen(n)||n instanceof Ss)){if(n.__ob__){var a=n.__ob__.dep.id;if(e.has(a))return;e.add(a)}if(i)for(t=n.length;t--;)ey(n[t],e);else if(Wc(n))ey(n.value,e);else for(r=Object.keys(n),t=r.length;t--;)ey(n[r[t]],e)}}var SG=0,N2=function(){function n(e,t,r,i,a){GV(this,Ia&&!Ia._vm?Ia:e?e._scope:void 0),(this.vm=e)&&a&&(e._watcher=this),i?(this.deep=!!i.deep,this.user=!!i.user,this.lazy=!!i.lazy,this.sync=!!i.sync,this.before=i.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=r,this.id=++SG,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new hg,this.newDepIds=new hg,this.expression="",ar(t)?this.getter=t:(this.getter=$V(t),this.getter||(this.getter=mi)),this.value=this.lazy?void 0:this.get()}return n.prototype.get=function(){Op(this);var e,t=this.vm;try{e=this.getter.call(t,t)}catch(r){if(this.user)gf(r,t,'getter for watcher "'.concat(this.expression,'"'));else throw r}finally{this.deep&&Ly(e),Mp(),this.cleanupDeps()}return e},n.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},n.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}
31var r=this.depIds;this.depIds=this.newDepIds,this.newDepIds=r,this.newDepIds.clear(),r=this.deps,this.deps=this.newDeps,this.newDeps=r,this.newDeps.length=0},n.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():jG(this)},n.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||Zi(e)||this.deep){var t=this.value;if(this.value=e,this.user){var r='callback for watcher "'.concat(this.expression,'"');Xl(this.cb,this.vm,[e,t],this.vm,r)}else this.cb.call(this.vm,e,t)}}},n.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},n.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},n.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&ad(this.vm._scope.effects,this),this.active){for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},n}();function TG(n){n._events=Object.create(null),n._hasHookEvent=!1;var e=n.$options._parentListeners;e&&rD(n,e)}var mg;function EG(n,e){mg.$on(n,e)}function PG(n,e){mg.$off(n,e)}function RG(n,e){var t=mg;return function r(){var i=e.apply(null,arguments);i!==null&&t.$off(n,r)}}function rD(n,e,t){mg=n,KM(e,t||{},EG,PG,RG,n),mg=void 0}function AG(n){var e=/^hook:/;n.prototype.$on=function(t,r){var i=this;if(Jt(t))for(var a=0,s=t.length;a<s;a++)i.$on(t[a],r);else(i._events[t]||(i._events[t]=[])).push(r),e.test(t)&&(i._hasHookEvent=!0);return i},n.prototype.$once=function(t,r){var i=this;function a(){i.$off(t,a),r.apply(i,arguments)}return a.fn=r,i.$on(t,a),i},n.prototype.$off=function(t,r){var i=this;if(!arguments.length)return i._events=Object.create(null),i;if(Jt(t)){for(var a=0,s=t.length;a<s;a++)i.$off(t[a],r);return i}var o=i._events[t];if(!o)return i;if(!r)return i._events[t]=null,i;for(var c,u=o.length;u--;)if(c=o[u],c===r||c.fn===r){o.splice(u,1);break}return i},n.prototype.$emit=function(t){var r=this,i=r._events[t];if(i){i=i.length>1?CC(i):i;for(var a=CC(arguments,1),s='event handler for "'.concat(t,'"'),o=0,c=i.length;o<c;o++)Xl(i[o],r,a,r,s)}return r}}var Qd=null;function iD(n){var e=Qd;return Qd=n,function(){Qd=e}}function IG(n){var e=n.$options,t=e.parent;if(t&&!e.abstract){for(;t.$options.abstract&&t.$parent;)t=t.$parent;t.$children.push(n)}n.$parent=t,n.$root=t?t.$root:n,n.$children=[],n.$refs={},n._provided=t?t._provided:Object.create(null),n._watcher=null,n._inactive=null,n._directInactive=!1,n._isMounted=!1,n._isDestroyed=!1,n._isBeingDestroyed=!1}function OG(n){n.prototype._update=function(e,t){var r=this,i=r.$el,a=r._vnode,s=iD(r);r._vnode=e,a?r.$el=r.__patch__(a,e):r.$el=r.__patch__(r.$el,e,t,!1),s(),i&&(i.__vue__=null),r.$el&&(r.$el.__vue__=r);for(var o=r;o&&o.$vnode&&o.$parent&&o.$vnode===o.$parent._vnode;)o.$parent.$el=o.$el,o=o.$parent},n.prototype.$forceUpdate=function(){var e=this;e._watcher&&e._watcher.update()},n.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){tc(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;t&&!t._isBeingDestroyed&&!e.$options.abstract&&ad(t.$children,e),e._scope.stop(),e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),tc(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}function MG(n,e,t){n.$el=e,n.$options.render||(n.$options.render=Jd),tc(n,"beforeMount");var r;r=function(){n._update(n._render(),t)};var i={before:function(){n._isMounted&&!n._isDestroyed&&tc(n,"beforeUpdate")}};new N2(n,r,mi,i,!0),t=!1;var a=n._preWatchers;if(a)for(var s=0;s<a.length;s++)a[s].run();return n.$vnode==null&&(n._isMounted=!0,tc(n,"mounted")),n}function DG(n,e,t,r,i){var a=r.data.scopedSlots,s=n.$scopedSlots,o=!!(a&&!a.$stable||s!==ps&&!s.$stable||a&&n.$scopedSlots.$key!==a.$key||!a&&n.$scopedSlots.$key),c=!!(i||n.$options._renderChildren||o),u=n.$vnode;n.$options._parentVnode=r,n.$vnode=r,n._vnode&&(n._vnode.parent=r),n.$options._renderChildren=i;var l=r.data.attrs||ps;n._attrsProxy&&Dy(n._attrsProxy,l,u.data&&u.data.attrs||ps,n,"$attrs")&&(c=!0),n.$attrs=l,t=t||ps;var d=n.$options._parentListeners;if(n._listenersProxy&&Dy(n._listenersProxy,t,d||ps,n,"$listeners"),n.$listeners=n.$options._parentListeners=t,rD(n,t,d),e&&n.$options.props){Yl(!1);for(var h=n._props,p=n.$options._propKeys||[],g=0;g<p.length;g++){var v=p[g],y=n.$options.props;h[v]=j2(v,y,e,n)}Yl(!0),n.$options.propsData=e}c&&(n.$slots=M2(i,r.context),n.$forceUpdate())}function aD(n){for(;n&&(n=n.$parent);)if(n._inactive)return!0;return!1}function L2(n,e){if(e){if(n._directInactive=!1,aD(n))return}else if(n._directInactive)return;if(n._inactive||n._inactive===null){n._inactive=!1;for(var t=0;t<n.$children.length;t++)L2(n.$children[t]);tc(n,"activated")}}function sD(n,e){if(!(e&&(n._directInactive=!0,aD(n)))&&!n._inactive){n._inactive=!0;for(var t=0;t<n.$children.length;t++)sD(n.$children[t]);tc(n,"deactivated")}}function tc(n,e,t,r){r===void 0&&(r=!0),Op();var i=Mh,a=KV();r&&Gl(n);var s=n.$options[e],o="".concat(e," hook");if(s)for(var c=0,u=s.length;c<u;c++)Xl(s[c],n,null,n,o);n._hasHookEvent&&n.$emit("hook:"+e),r&&(Gl(i),a&&a.on()),Mp()}var qu=[],F2=[],Fy={},IC=!1,$2=!1,Ch=0;function NG(){Ch=qu.length=F2.length=0,Fy={},IC=$2=!1}var oD=0,OC=Date.now;if(Ps&&!Ap){var yx=window.performance;yx&&typeof yx.now=="function"&&OC()>document.createEvent("Event").timeStamp&&(OC=function(){return yx.now()})}var LG=function(n,e){if(n.post){if(!e.post)return 1}else if(e.post)return-1;return n.id-e.id};function FG(){oD=OC(),$2=!0;var n,e;for(qu.sort(LG),Ch=0;Ch<qu.length;Ch++)n=qu[Ch],n.before&&n.before(),e=n.id,Fy[e]=null,n.run();var t=F2.slice(),r=qu.slice();NG(),UG(t),$G(r),qV(),Oy&&mo.devtools&&Oy.emit("flush")}function $G(n){for(var e=n.length;e--;){var t=n[e],r=t.vm;r&&r._watcher===t&&r._isMounted&&!r._isDestroyed&&tc(r,"updated")}}function BG(n){n._inactive=!1,F2.push(n)}function UG(n){for(var e=0;e<n.length;e++)n[e]._inactive=!0,L2(n[e],!0)}function jG(n){var e=n.id;if(Fy[e]==null&&!(n===Kl.target&&n.noRecurse)){if(Fy[e]=!0,!$2)qu.push(n);else{for(var t=qu.length-1;t>Ch&&qu[t].id>n.id;)t--;qu.splice(t+1,0,n)}IC||(IC=!0,D2(FG))}}function qG(n){var e=n.$options.provide;if(e){var t=ar(e)?e.call(n):e;if(!Zi(t))return;for(var r=YV(n),i=Qg?Reflect.ownKeys(t):Object.keys(t),a=0;a<i.length;a++){var s=i[a];Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(t,s))}}}function zG(n){var e=cD(n.$options.inject,n);e&&(Yl(!1),Object.keys(e).forEach(function(t){mf(n,t,e[t])}),Yl(!0))}function cD(n,e){if(n){for(var t=Object.create(null),r=Qg?Reflect.ownKeys(n):Object.keys(n),i=0;i<r.length;i++){var a=r[i];if(a!=="__ob__"){var s=n[a].from;if(s in e._provided)t[a]=e._provided[s];else if("default"in n[a]){var o=n[a].default;t[a]=ar(o)?o.call(e):o}}}return t}}function B2(n,e,t,r,i){var a=this,s=i.options,o;_a(r,"_uid")?(o=Object.create(r),o._original=r):(o=r,r=r._original);var c=fr(s._compiled),u=!c;this.data=n,this.props=e,this.children=t,this.parent=r,this.listeners=n.on||ps,this.injections=cD(s.inject,r),this.slots=function(){return a.$slots||qm(r,n.scopedSlots,a.$slots=M2(t,r)),a.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return qm(r,n.scopedSlots,this.slots())}}),c&&(this.$options=s,this.$slots=this.slots(),this.$scopedSlots=qm(r,
31n.scopedSlots,this.$slots)),s._scopeId?this._c=function(l,d,h,p){var g=Ny(o,l,d,h,p,u);return g&&!Jt(g)&&(g.fnScopeId=s._scopeId,g.fnContext=r),g}:this._c=function(l,d,h,p){return Ny(o,l,d,h,p,u)}}QM(B2.prototype);function WG(n,e,t,r,i){var a=n.options,s={},o=a.props;if(be(o))for(var c in o)s[c]=j2(c,o,e||ps);else be(t.attrs)&&PA(s,t.attrs),be(t.props)&&PA(s,t.props);var u=new B2(t,s,i,r,n),l=a.render.call(null,u._c,u);if(l instanceof Ss)return EA(l,t,u.parent,a);if(Jt(l)){for(var d=O2(l)||[],h=new Array(d.length),p=0;p<d.length;p++)h[p]=EA(d[p],t,u.parent,a);return h}}function EA(n,e,t,r,i){var a=SC(n);return a.fnContext=t,a.fnOptions=r,e.slot&&((a.data||(a.data={})).slot=e.slot),a}function PA(n,e){for(var t in e)n[hf(t)]=e[t]}function $y(n){return n.name||n.__name||n._componentTag}var U2={init:function(n,e){if(n.componentInstance&&!n.componentInstance._isDestroyed&&n.data.keepAlive){var t=n;U2.prepatch(t,t)}else{var r=n.componentInstance=HG(n,Qd);r.$mount(e?n.elm:void 0,e)}},prepatch:function(n,e){var t=e.componentOptions,r=e.componentInstance=n.componentInstance;DG(r,t.propsData,t.listeners,e,t.children)},insert:function(n){var e=n.context,t=n.componentInstance;t._isMounted||(t._isMounted=!0,tc(t,"mounted")),n.data.keepAlive&&(e._isMounted?BG(t):L2(t,!0))},destroy:function(n){var e=n.componentInstance;e._isDestroyed||(n.data.keepAlive?sD(e,!0):e.$destroy())}},RA=Object.keys(U2);function AA(n,e,t,r,i){if(!Pt(n)){var a=t.$options._base;if(Zi(n)&&(n=a.extend(n)),typeof n=="function"){var s;if(Pt(n.cid)&&(s=n,n=yG(s,a),n===void 0))return vG(s,e,t,r,i);e=e||{},z2(n),be(e.model)&&KG(n.options,e);var o=XV(e,n);if(fr(n.options.functional))return WG(n,o,e,t,r);var c=e.on;if(e.on=e.nativeOn,fr(n.options.abstract)){var u=e.slot;e={},u&&(e.slot=u)}VG(e);var l=$y(n.options)||i,d=new Ss("vue-component-".concat(n.cid).concat(l?"-".concat(l):""),e,void 0,void 0,void 0,t,{Ctor:n,propsData:o,listeners:c,tag:i,children:r},s);return d}}}function HG(n,e){var t={_isComponent:!0,_parentVnode:n,parent:e},r=n.data.inlineTemplate;return be(r)&&(t.render=r.render,t.staticRenderFns=r.staticRenderFns),new n.componentOptions.Ctor(t)}function VG(n){for(var e=n.hook||(n.hook={}),t=0;t<RA.length;t++){var r=RA[t],i=e[r],a=U2[r];i!==a&&!(i&&i._merged)&&(e[r]=i?GG(a,i):a)}}function GG(n,e){var t=function(r,i){n(r,i),e(r,i)};return t._merged=!0,t}function KG(n,e){var t=n.model&&n.model.prop||"value",r=n.model&&n.model.event||"input";(e.attrs||(e.attrs={}))[t]=e.model.value;var i=e.on||(e.on={}),a=i[r],s=e.model.callback;be(a)?(Jt(a)?a.indexOf(s)===-1:a!==s)&&(i[r]=[s].concat(a)):i[r]=s}var YG=mi,$c=mo.optionMergeStrategies;function gg(n,e,t){if(t===void 0&&(t=!0),!e)return n;for(var r,i,a,s=Qg?Reflect.ownKeys(e):Object.keys(e),o=0;o<s.length;o++)r=s[o],r!=="__ob__"&&(i=n[r],a=e[r],!t||!_a(n,r)?A2(n,r,a):i!==a&&ks(i)&&ks(a)&&gg(i,a));return n}function IA(n,e,t){return t?function(){var i=ar(e)?e.call(t,t):e,a=ar(n)?n.call(t,t):n;return i?gg(i,a):a}:e?n?function(){return gg(ar(e)?e.call(this,this):e,ar(n)?n.call(this,this):n)}:e:n}$c.data=function(n,e,t){return t?IA(n,e,t):e&&typeof e!="function"?n:IA(n,e)};function XG(n,e){var t=e?n?n.concat(e):Jt(e)?e:[e]:n;return t&&JG(t)}function JG(n){for(var e=[],t=0;t<n.length;t++)e.indexOf(n[t])===-1&&e.push(n[t]);return e}BM.forEach(function(n){$c[n]=XG});function QG(n,e,t,r){var i=Object.create(n||null);return e?Wn(i,e):i}X_.forEach(function(n){$c[n+"s"]=QG});$c.watch=function(n,e,t,r){if(n===kC&&(n=void 0),e===kC&&(e=void 0),!e)return Object.create(n||null);if(!n)return e;var i={};Wn(i,n);for(var a in e){var s=i[a],o=e[a];s&&!Jt(s)&&(s=[s]),i[a]=s?s.concat(o):Jt(o)?o:[o]}return i};$c.props=$c.methods=$c.inject=$c.computed=function(n,e,t,r){if(!n)return e;var i=Object.create(null);return Wn(i,n),e&&Wn(i,e),i};$c.provide=function(n,e){return n?function(){var t=Object.create(null);return gg(t,ar(n)?n.call(this):n),e&&gg(t,ar(e)?e.call(this):e,!1),t}:e};var ZG=function(n,e){return e===void 0?n:e};function eK(n,e){var t=n.props;if(t){var r={},i,a,s;if(Jt(t))for(i=t.length;i--;)a=t[i],typeof a=="string"&&(s=hf(a),r[s]={type:null});else if(ks(t))for(var o in t)a=t[o],s=hf(o),r[s]=ks(a)?a:{type:a};n.props=r}}function tK(n,e){var t=n.inject;if(t){var r=n.inject={};if(Jt(t))for(var i=0;i<t.length;i++)r[t[i]]={from:t[i]};else if(ks(t))for(var a in t){var s=t[a];r[a]=ks(s)?Wn({from:a},s):{from:s}}}}function nK(n){var e=n.directives;if(e)for(var t in e){var r=e[t];ar(r)&&(e[t]={bind:r,update:r})}}function vf(n,e,t){if(ar(e)&&(e=e.options),eK(e),tK(e),nK(e),!e._base&&(e.extends&&(n=vf(n,e.extends,t)),e.mixins))for(var r=0,i=e.mixins.length;r<i;r++)n=vf(n,e.mixins[r],t);var a={},s;for(s in n)o(s);for(s in e)_a(n,s)||o(s);function o(c){var u=$c[c]||ZG;a[c]=u(n[c],e[c],t,c)}return a}function By(n,e,t,r){if(typeof t=="string"){var i=n[e];if(_a(i,t))return i[t];
31var a=hf(t);if(_a(i,a))return i[a];var s=IV(a);if(_a(i,s))return i[s];var o=i[t]||i[a]||i[s];return o}}function j2(n,e,t,r){var i=e[n],a=!_a(t,n),s=t[n],o=MA(Boolean,i.type);if(o>-1){if(a&&!_a(i,"default"))s=!1;else if(s===""||s===Xg(n)){var c=MA(String,i.type);(c<0||o<c)&&(s=!0)}}if(s===void 0){s=rK(r,i,n);var u=R2;Yl(!0),Yu(s),Yl(u)}return s}function rK(n,e,t){if(_a(e,"default")){var r=e.default;return n&&n.$options.propsData&&n.$options.propsData[t]===void 0&&n._props[t]!==void 0?n._props[t]:ar(r)&&MC(e.type)!=="Function"?r.call(n):r}}var iK=/^\s*function (\w+)/;function MC(n){var e=n&&n.toString().match(iK);return e?e[1]:""}function OA(n,e){return MC(n)===MC(e)}function MA(n,e){if(!Jt(e))return OA(e,n)?0:-1;for(var t=0,r=e.length;t<r;t++)if(OA(e[t],n))return t;return-1}var kl={enumerable:!0,configurable:!0,get:mi,set:mi};function q2(n,e,t){kl.get=function(){return this[e][t]},kl.set=function(i){this[e][t]=i},Object.defineProperty(n,t,kl)}function aK(n){var e=n.$options;if(e.props&&sK(n,e.props),dG(n),e.methods&&dK(n,e.methods),e.data)oK(n);else{var t=Yu(n._data={});t&&t.vmCount++}e.computed&&lK(n,e.computed),e.watch&&e.watch!==kC&&fK(n,e.watch)}function sK(n,e){var t=n.$options.propsData||{},r=n._props=GM({}),i=n.$options._propKeys=[],a=!n.$parent;a||Yl(!1);var s=function(c){i.push(c);var u=j2(c,e,t,n);mf(r,c,u,void 0,!0),c in n||q2(n,"_props",c)};for(var o in e)s(o);Yl(!0)}function oK(n){var e=n.$options.data;e=n._data=ar(e)?cK(e,n):e||{},ks(e)||(e={});var t=Object.keys(e),r=n.$options.props;n.$options.methods;for(var i=t.length;i--;){var a=t[i];r&&_a(r,a)||UM(a)||q2(n,"_data",a)}var s=Yu(e);s&&s.vmCount++}function cK(n,e){Op();try{return n.call(e,e)}catch(t){return gf(t,e,"data()"),{}}finally{Mp()}}var uK={lazy:!0};function lK(n,e){var t=n._computedWatchers=Object.create(null),r=Jg();for(var i in e){var a=e[i],s=ar(a)?a:a.get;r||(t[i]=new N2(n,s||mi,mi,uK)),i in n||uD(n,i,a)}}function uD(n,e,t){var r=!Jg();ar(t)?(kl.get=r?DA(e):NA(t),kl.set=mi):(kl.get=t.get?r&&t.cache!==!1?DA(e):NA(t.get):mi,kl.set=t.set||mi),Object.defineProperty(n,e,kl)}function DA(n){return function(){var t=this._computedWatchers&&this._computedWatchers[n];if(t)return t.dirty&&t.evaluate(),Kl.target&&t.depend(),t.value}}function NA(n){return function(){return n.call(this,this)}}function dK(n,e){n.$options.props;for(var t in e)n[t]=typeof e[t]!="function"?mi:NM(e[t],n)}function fK(n,e){for(var t in e){var r=e[t];if(Jt(r))for(var i=0;i<r.length;i++)DC(n,t,r[i]);else DC(n,t,r)}}function DC(n,e,t,r){return ks(t)&&(r=t,t=t.handler),typeof t=="string"&&(t=n[t]),n.$watch(e,t,r)}function hK(n){var e={};e.get=function(){return this._data};var t={};t.get=function(){return this._props},Object.defineProperty(n.prototype,"$data",e),Object.defineProperty(n.prototype,"$props",t),n.prototype.$set=A2,n.prototype.$delete=HM,n.prototype.$watch=function(r,i,a){var s=this;if(ks(i))return DC(s,r,i,a);a=a||{},a.user=!0;var o=new N2(s,r,i,a);if(a.immediate){var c='callback for immediate watcher "'.concat(o.expression,'"');Op(),Xl(i,s,[o.value],s,c),Mp()}return function(){o.teardown()}}}var pK=0;function mK(n){n.prototype._init=function(e){var t=this;t._uid=pK++,t._isVue=!0,t.__v_skip=!0,t._scope=new VV(!0),t._scope.parent=void 0,t._scope._vm=!0,e&&e._isComponent?gK(t,e):t.$options=vf(z2(t.constructor),e||{},t),t._renderProxy=t,t._self=t,IG(t),TG(t),mG(t),tc(t,"beforeCreate",void 0,!1),zG(t),aK(t),qG(t),tc(t,"created"),t.$options.el&&t.$mount(t.$options.el)}}function gK(n,e){var t=n.$options=Object.create(n.constructor.options),r=e._parentVnode;t.parent=e.parent,t._parentVnode=r;var i=r.componentOptions;t.propsData=i.propsData,t._parentListeners=i.listeners,t._renderChildren=i.children,t._componentTag=i.tag,e.render&&(t.render=e.render,t.staticRenderFns=e.staticRenderFns)}function z2(n){var e=n.options;if(n.super){var t=z2(n.super),r=n.superOptions;if(t!==r){n.superOptions=t;var i=vK(n);i&&Wn(n.extendOptions,i),e=n.options=vf(t,n.extendOptions),e.name&&(e.components[e.name]=n)}}return e}function vK(n){var e,t=n.options,r=n.sealedOptions;for(var i in t)t[i]!==r[i]&&(e||(e={}),e[i]=t[i]);return e}function pn(n){this._init(n)}mK(pn);hK(pn);AG(pn);OG(pn);gG(pn);function yK(n){n.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;
31var r=CC(arguments,1);return r.unshift(this),ar(e.install)?e.install.apply(e,r):ar(e)&&e.apply(null,r),t.push(e),this}}function _K(n){n.mixin=function(e){return this.options=vf(this.options,e),this}}function bK(n){n.cid=0;var e=1;n.extend=function(t){t=t||{};var r=this,i=r.cid,a=t._Ctor||(t._Ctor={});if(a[i])return a[i];var s=$y(t)||$y(r.options),o=function(u){this._init(u)};return o.prototype=Object.create(r.prototype),o.prototype.constructor=o,o.cid=e++,o.options=vf(r.options,t),o.super=r,o.options.props&&xK(o),o.options.computed&&wK(o),o.extend=r.extend,o.mixin=r.mixin,o.use=r.use,X_.forEach(function(c){o[c]=r[c]}),s&&(o.options.components[s]=o),o.superOptions=r.options,o.extendOptions=t,o.sealedOptions=Wn({},o.options),a[i]=o,o}}function xK(n){var e=n.options.props;for(var t in e)q2(n.prototype,"_props",t)}function wK(n){var e=n.options.computed;for(var t in e)uD(n.prototype,t,e[t])}function CK(n){X_.forEach(function(e){n[e]=function(t,r){return r?(e==="component"&&ks(r)&&(r.name=r.name||t,r=this.options._base.extend(r)),e==="directive"&&ar(r)&&(r={bind:r,update:r}),this.options[e+"s"][t]=r,r):this.options[e+"s"][t]}})}function LA(n){return n&&($y(n.Ctor.options)||n.tag)}function v0(n,e){return Jt(n)?n.indexOf(e)>-1:typeof n=="string"?n.split(",").indexOf(e)>-1:SV(n)?n.test(e):!1}function FA(n,e){var t=n.cache,r=n.keys,i=n._vnode,a=n.$vnode;for(var s in t){var o=t[s];if(o){var c=o.name;c&&!e(c)&&NC(t,s,r,i)}}a.componentOptions.children=void 0}function NC(n,e,t,r){var i=n[e];i&&(!r||i.tag!==r.tag)&&i.componentInstance.$destroy(),n[e]=null,ad(t,e)}var $A=[String,RegExp,Array],kK={name:"keep-alive",abstract:!0,props:{include:$A,exclude:$A,max:[String,Number]},methods:{cacheVNode:function(){var n=this,e=n.cache,t=n.keys,r=n.vnodeToCache,i=n.keyToCache;if(r){var a=r.tag,s=r.componentInstance,o=r.componentOptions;e[i]={name:LA(o),tag:a,componentInstance:s},t.push(i),this.max&&t.length>parseInt(this.max)&&NC(e,t[0],t,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var n in this.cache)NC(this.cache,n,this.keys)},mounted:function(){var n=this;this.cacheVNode(),this.$watch("include",function(e){FA(n,function(t){return v0(e,t)})}),this.$watch("exclude",function(e){FA(n,function(t){return!v0(e,t)})})},updated:function(){this.cacheVNode()},render:function(){var n=this.$slots.default,e=eD(n),t=e&&e.componentOptions;if(t){var r=LA(t),i=this,a=i.include,s=i.exclude;if(a&&(!r||!v0(a,r))||s&&r&&v0(s,r))return e;var o=this,c=o.cache,u=o.keys,l=e.key==null?t.Ctor.cid+(t.tag?"::".concat(t.tag):""):e.key;c[l]?(e.componentInstance=c[l].componentInstance,ad(u,l),u.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||n&&n[0]}},SK={KeepAlive:kK};function TK(n){var e={};e.get=function(){return mo},Object.defineProperty(n,"config",e),n.util={warn:YG,extend:Wn,mergeOptions:vf,defineReactive:mf},n.set=A2,n.delete=HM,n.nextTick=D2,n.observable=function(t){return Yu(t),t},n.options=Object.create(null),X_.forEach(function(t){n.options[t+"s"]=Object.create(null)}),n.options._base=n,Wn(n.options.components,SK),yK(n),_K(n),bK(n),CK(n)}TK(pn);Object.defineProperty(pn.prototype,"$isServer",{get:Jg});Object.defineProperty(pn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}});Object.defineProperty(pn,"FunctionalRenderContext",{value:B2});pn.version=kG;var EK=sc("style,class"),PK=sc("input,textarea,option,select,progress"),RK=function(n,e,t){return t==="value"&&PK(n)&&e!=="button"||t==="selected"&&n==="option"||t==="checked"&&n==="input"||t==="muted"&&n==="video"},lD=sc("contenteditable,draggable,spellcheck"),AK=sc("events,caret,typing,plaintext-only"),IK=function(n,e){return Uy(e)||e==="false"?"false":n==="contenteditable"&&AK(e)?e:"true"},OK=sc("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),LC="http://www.w3.org/1999/xlink",W2=function(n){return n.charAt(5)===":"&&n.slice(0,5)==="xlink"},dD=function(n){return W2(n)?n.slice(6,n.length):""},Uy=function(n){return n==null||n===!1};function MK(n){for(var e=n.data,t=n,r=n;be(r.componentInstance);)r=r.componentInstance._vnode,r&&r.data&&(e=BA(r.data,e));for(;be(t=t.parent);)t&&t.data&&(e=BA(e,t.data));return DK(e.staticClass,e.class)}function BA(n,e){return{staticClass:H2(n.staticClass,e.staticClass),class:be(n.class)?[n.class,e.class]:e.class}}function DK(n,e){return be(n)||be(e)?H2(n,V2(e)):""}function H2(n,e){return n?e?n+" "+e:n:e||""}function V2(n){return Array.isArray(n)?NK(n):Zi(n)?LK(n):typeof n=="string"?n:""}function NK(n){for(var e="",t,r=0,i=n.length;r<i;r++)be(t=V2(n[r]))&&t!==""&&(e&&(e+=" "),e+=t);return e}function LK(n){var e="";for(var t in n)n[t]&&(e&&(e+=" "),e+=t);return e}var FK={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},$K=sc("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),G2=sc("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),fD=function(n){return $K(n)||G2(n)};function BK(n){if(G2(n))return"svg";if(n==="math")return"math"}var y0=Object.create(null);function UK(n){if(!Ps)return!0;
31if(fD(n))return!1;if(n=n.toLowerCase(),y0[n]!=null)return y0[n];var e=document.createElement(n);return n.indexOf("-")>-1?y0[n]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:y0[n]=/HTMLUnknownElement/.test(e.toString())}var FC=sc("text,number,password,search,email,tel,url");function jK(n){if(typeof n=="string"){var e=document.querySelector(n);return e||document.createElement("div")}else return n}function qK(n,e){var t=document.createElement(n);return n!=="select"||e.data&&e.data.attrs&&e.data.attrs.multiple!==void 0&&t.setAttribute("multiple","multiple"),t}function zK(n,e){return document.createElementNS(FK[n],e)}function WK(n){return document.createTextNode(n)}function HK(n){return document.createComment(n)}function VK(n,e,t){n.insertBefore(e,t)}function GK(n,e){n.removeChild(e)}function KK(n,e){n.appendChild(e)}function YK(n){return n.parentNode}function XK(n){return n.nextSibling}function JK(n){return n.tagName}function QK(n,e){n.textContent=e}function ZK(n,e){n.setAttribute(e,"")}var eY=Object.freeze({__proto__:null,createElement:qK,createElementNS:zK,createTextNode:WK,createComment:HK,insertBefore:VK,removeChild:GK,appendChild:KK,parentNode:YK,nextSibling:XK,tagName:JK,setTextContent:QK,setStyleScope:ZK}),tY={create:function(n,e){kh(e)},update:function(n,e){n.data.ref!==e.data.ref&&(kh(n,!0),kh(e))},destroy:function(n){kh(n,!0)}};function kh(n,e){var t=n.data.ref;if(be(t)){var r=n.context,i=n.componentInstance||n.elm,a=e?null:i,s=e?void 0:i;if(ar(t)){Xl(t,r,[a],r,"template ref function");return}var o=n.data.refInFor,c=typeof t=="string"||typeof t=="number",u=Wc(t),l=r.$refs;if(c||u){if(o){var d=c?l[t]:t.value;e?Jt(d)&&ad(d,i):Jt(d)?d.includes(i)||d.push(i):c?(l[t]=[i],UA(r,t,l[t])):t.value=[i]}else if(c){if(e&&l[t]!==i)return;l[t]=s,UA(r,t,a)}else if(u){if(e&&t.value!==i)return;t.value=a}}}}function UA(n,e,t){var r=n._setupState;r&&_a(r,e)&&(Wc(r[e])?r[e].value=t:r[e]=t)}var Tl=new Ss("",{},[]),pm=["create","activate","update","remove","destroy"];function Ed(n,e){return n.key===e.key&&n.asyncFactory===e.asyncFactory&&(n.tag===e.tag&&n.isComment===e.isComment&&be(n.data)===be(e.data)&&nY(n,e)||fr(n.isAsyncPlaceholder)&&Pt(e.asyncFactory.error))}function nY(n,e){if(n.tag!=="input")return!0;var t,r=be(t=n.data)&&be(t=t.attrs)&&t.type,i=be(t=e.data)&&be(t=t.attrs)&&t.type;return r===i||FC(r)&&FC(i)}function rY(n,e,t){var r,i,a={};for(r=e;r<=t;++r)i=n[r].key,be(i)&&(a[i]=r);return a}function iY(n){var e,t,r={},i=n.modules,a=n.nodeOps;for(e=0;e<pm.length;++e)for(r[pm[e]]=[],t=0;t<i.length;++t)be(i[t][pm[e]])&&r[pm[e]].push(i[t][pm[e]]);function s(L){return new Ss(a.tagName(L).toLowerCase(),{},[],void 0,L)}function o(L,B){function V(){--V.listeners===0&&c(L)}return V.listeners=B,V}function c(L){var B=a.parentNode(L);be(B)&&a.removeChild(B,L)}function u(L,B,V,X,ne,se,ie){if(be(L.elm)&&be(se)&&(L=se[ie]=SC(L)),L.isRootInsert=!ne,!l(L,B,V,X)){var de=L.data,ue=L.children,Ce=L.tag;be(Ce)?(L.elm=L.ns?a.createElementNS(L.ns,Ce):a.createElement(Ce,L),b(L),g(L,ue,B),be(de)&&y(L,B),p(V,L.elm,X)):fr(L.isComment)?(L.elm=a.createComment(L.text),p(V,L.elm,X)):(L.elm=a.createTextNode(L.text),p(V,L.elm,X))}}function l(L,B,V,X){var ne=L.data;if(be(ne)){var se=be(L.componentInstance)&&ne.keepAlive;if(be(ne=ne.hook)&&be(ne=ne.init)&&ne(L,!1),be(L.componentInstance))return d(L,B),p(V,L.elm,X),fr(se)&&h(L,B,V,X),!0}}function d(L,B){be(L.data.pendingInsert)&&(B.push.apply(B,L.data.pendingInsert),L.data.pendingInsert=null),L.elm=L.componentInstance.$el,v(L)?(y(L,B),b(L)):(kh(L),B.push(L))}function h(L,B,V,X){for(var ne,se=L;se.componentInstance;)if(se=se.componentInstance._vnode,be(ne=se.data)&&be(ne=ne.transition)){for(ne=0;ne<r.activate.length;++ne)r.activate[ne](Tl,se);B.push(se);break}p(V,L.elm,X)}function p(L,B,V){be(L)&&(be(V)?a.parentNode(V)===L&&a.insertBefore(L,B,V):a.appendChild(L,B))}function g(L,B,V){if(Jt(B))for(var X=0;X<B.length;++X)u(B[X],V,L.elm,null,!0,B,X);else Yg(L.text)&&a.appendChild(L.elm,a.createTextNode(String(L.text)))}function v(L){for(;L.componentInstance;)L=L.componentInstance._vnode;return be(L.tag)}function y(L,B){for(var V=0;V<r.create.length;++V)r.create[V](Tl,L);e=L.data.hook,be(e)&&(be(e.create)&&e.create(Tl,L),be(e.insert)&&B.push(L))}function b(L){var B;if(be(B=L.fnScopeId))a.setStyleScope(L.elm,B);else for(var V=L;V;)be(B=V.context)&&be(B=B.$options._scopeId)&&a.setStyleScope(L.elm,B),V=V.parent;be(B=Qd)&&B!==L.context&&B!==L.fnContext&&be(B=B.$options._scopeId)&&a.setStyleScope(L.elm,B)}function x(L,B,V,X,ne,se){for(;X<=ne;++X)u(V[X],se,L,B,!1,V,X)}function S(L){var B,V,X=L.data;if(be(X))for(be(B=X.hook)&&be(B=B.destroy)&&B(L),B=0;B<r.destroy.length;++B)r.destroy[B](L);if(be(B=L.children))for(V=0;V<L.children.length;++V)S(L.children[V])}function w(L,B,V){for(;B<=V;++B){var X=L[B];be(X)&&(be(X.tag)?(k(X),S(X)):c(X.elm))}}function k(L,B){if(be(B)||be(L.data)){var V,X=r.remove.length+1;for(be(B)?B.listeners+=X:B=o(L.elm,X),be(V=L.componentInstance)&&be(V=V._vnode)&&be(V.data)&&k(V,B),V=0;V<r.remove.length;++V)r.remove[V](L,B);be(V=L.data.hook)&&be(V=V.remove)?V(L,B):B()}else c(L.elm)}function E(L,B,V,X,ne){for(var se=0,ie=0,de=B.length-1,ue=B[0],Ce=B[de],we=V.length-1,Fe=V[0],Ge=V[we],Ie,He,ot,Je,et=!ne;se<=de&&ie<=we;)Pt(ue)?ue=B[++se]:Pt(Ce)?Ce=B[--de]:Ed(ue,Fe)?(P(ue,Fe,X,V,ie),ue=B[++se],Fe=V[++ie]):Ed(Ce,Ge)?(P(Ce,Ge,X,V,we),Ce=B[--de],Ge=V[--we]):Ed(ue,Ge)?(P(ue,Ge,X,V,we),et&&a.insertBefore(L,ue.elm,a.nextSibling(Ce.elm)),ue=B[++se],Ge=V[--we]):Ed(Ce,Fe)?(P(Ce,Fe,X,V,ie),et&&a.insertBefore(L,Ce.elm,ue.elm),Ce=B[--de],Fe=V[++ie]):(Pt(Ie)&&(Ie=rY(B,se,de)),He=be(Fe.key)?Ie[Fe.key]:I(Fe,B,se,de),Pt(He)?u(Fe,X,L,ue.elm,!1,V,ie):(ot=B[He],Ed(ot,Fe)?(P(ot,Fe,X,V,ie),B[He]=void 0,et&&a.insertBefore(L,ot.elm,ue.elm)):u(Fe,X,L,ue.elm,!1,V,ie)),Fe=V[++ie]);se>de?(Je=Pt(V[we+1])?null:V[we+1].elm,x(L,Je,V,ie,we,X)):ie>we&&w(B,se,de)}function I(L,B,V,X){for(var ne=V;ne<X;ne++){var se=B[ne];if(be(se)&&Ed(L,se))return ne}}function P(L,B,V,X,ne,se){if(L!==B){be(B.elm)&&be(X)&&(B=X[ne]=SC(B));var ie=B.elm=L.elm;if(fr(L.isAsyncPlaceholder)){be(B.asyncFactory.resolved)?j(L.elm,B,V):B.isAsyncPlaceholder=!0;return}
vendor: 1,067 bytes, line 31
31if(fr(B.isStatic)&&fr(L.isStatic)&&B.key===L.key&&(fr(B.isCloned)||fr(B.isOnce))){B.componentInstance=L.componentInstance;return}var de,ue=B.data;be(ue)&&be(de=ue.hook)&&be(de=de.prepatch)&&de(L,B);var Ce=L.children,we=B.children;if(be(ue)&&v(B)){for(de=0;de<r.update.length;++de)r.update[de](L,B);be(de=ue.hook)&&be(de=de.update)&&de(L,B)}Pt(B.text)?be(Ce)&&be(we)?Ce!==we&&E(ie,Ce,we,V,se):be(we)?(be(L.text)&&a.setTextContent(ie,""),x(ie,null,we,0,we.length-1,V)):be(Ce)?w(Ce,0,Ce.length-1):be(L.text)&&a.setTextContent(ie,""):L.text!==B.text&&a.setTextContent(ie,B.text),be(ue)&&be(de=ue.hook)&&be(de=de.postpatch)&&de(L,B)}}function A(L,B,V){if(fr(V)&&be(L.parent))L.parent.data.pendingInsert=B;else for(var X=0;X<B.length;++X)B[X].data.hook.insert(B[X])}var N=sc("attrs,class,staticClass,staticStyle,key");function j(L,B,V,X){var ne,se=B.tag,ie=B.data,de=B.children;if(X=X||ie&&ie.pre,B.elm=L,fr(B.isComment)&&be(B.asyncFactory))return B.isAsyncPlaceholder=!0,!0;if(be(ie)&&(be(ne=ie.hook)&&be(ne=ne.init)&&ne(B,!0),be(ne=B.componentInstance)))return d(B,V),!0;
31if(be(se)){if(be(de))if(!L.hasChildNodes())g(B,de,V);else if(be(ne=ie)&&be(ne=ne.domProps)&&be(ne=ne.innerHTML)){if(ne!==L.innerHTML)return!1}else{for(var ue=!0,Ce=L.firstChild,we=0;we<de.length;we++){if(!Ce||!j(Ce,de[we],V,X)){ue=!1;break}Ce=Ce.nextSibling}if(!ue||Ce)return!1}if(be(ie)){var Fe=!1;for(var Ge in ie)if(!N(Ge)){Fe=!0,y(B,V);break}!Fe&&ie.class&&Ly(ie.class)}}else L.data!==B.text&&(L.data=B.text);return!0}return function(B,V,X,ne){if(Pt(V)){be(B)&&S(B);return}var se=!1,ie=[];if(Pt(B))se=!0,u(V,ie);else{var de=be(B.nodeType);if(!de&&Ed(B,V))P(B,V,ie,null,null,ne);else{if(de){if(B.nodeType===1&&B.hasAttribute(pA)&&(B.removeAttribute(pA),X=!0),fr(X)&&j(B,V,ie))return A(V,ie,!0),B;B=s(B)}var ue=B.elm,Ce=a.parentNode(ue);if(u(V,ie,ue._leaveCb?null:Ce,a.nextSibling(ue)),be(V.parent))for(var we=V.parent,Fe=v(V);we;){for(var Ge=0;Ge<r.destroy.length;++Ge)r.destroy[Ge](we);if(we.elm=V.elm,Fe){for(var Ie=0;Ie<r.create.length;++Ie)r.create[Ie](Tl,we);var He=we.data.hook.insert;if(He.merged)for(var ot=He.fns.slice(1),Je=0;Je<ot.length;Je++)ot[Je]()}else kh(we);we=we.parent}be(Ce)?w([B],0,0):be(B.tag)&&S(B)}}return A(V,ie,se),V.elm}}var aY={create:_x,update:_x,destroy:function(e){_x(e,Tl)}};function _x(n,e){(n.data.directives||e.data.directives)&&sY(n,e)}function sY(n,e){var t=n===Tl,r=e===Tl,i=jA(n.data.directives,n.context),a=jA(e.data.directives,e.context),s=[],o=[],c,u,l;for(c in a)u=i[c],l=a[c],u?(l.oldValue=u.value,l.oldArg=u.arg,mm(l,"update",e,n),l.def&&l.def.componentUpdated&&o.push(l)):(mm(l,"bind",e,n),l.def&&l.def.inserted&&s.push(l));if(s.length){var d=function(){for(var h=0;h<s.length;h++)mm(s[h],"inserted",e,n)};t?Sl(e,"insert",d):d()}if(o.length&&Sl(e,"postpatch",function(){for(var h=0;h<o.length;h++)mm(o[h],"componentUpdated",e,n)}),!t)for(c in i)a[c]||mm(i[c],"unbind",n,n,r)}var oY=Object.create(null);function jA(n,e){var t=Object.create(null);if(!n)return t;var r,i;for(r=0;r<n.length;r++){if(i=n[r],i.modifiers||(i.modifiers=oY),t[cY(i)]=i,e._setupState&&e._setupState.__sfc){var a=i.def||By(e,"_setupState","v-"+i.name);typeof a=="function"?i.def={bind:a,update:a}:i.def=a}i.def=i.def||By(e.$options,"directives",i.name)}return t}function cY(n){return n.rawName||"".concat(n.name,".").concat(Object.keys(n.modifiers||{}).join("."))}function mm(n,e,t,r,i){var a=n.def&&n.def[e];if(a)try{a(t.elm,n,t,r,i)}catch(s){gf(s,t.context,"directive ".concat(n.name," ").concat(e," hook"))}}var uY=[tY,aY];function qA(n,e){var t=e.componentOptions;if(!(be(t)&&t.Ctor.options.inheritAttrs===!1)&&!(Pt(n.data.attrs)&&Pt(e.data.attrs))){var r,i,a,s=e.elm,o=n.data.attrs||{},c=e.data.attrs||{};(be(c.__ob__)||fr(c._v_attr_proxy))&&(c=e.data.attrs=Wn({},c));for(r in c)i=c[r],a=o[r],a!==i&&zA(s,r,i,e.data.pre);(Ap||jM)&&c.value!==o.value&&zA(s,"value",c.value);for(r in o)Pt(c[r])&&(W2(r)?s.removeAttributeNS(LC,dD(r)):lD(r)||s.removeAttribute(r))}}function zA(n,e,t,r){r||n.tagName.indexOf("-")>-1?WA(n,e,t):OK(e)?Uy(t)?n.removeAttribute(e):(t=e==="allowfullscreen"&&n.tagName==="EMBED"?"true":e,n.setAttribute(e,t)):lD(e)?n.setAttribute(e,IK(e,t)):W2(e)?Uy(t)?n.removeAttributeNS(LC,dD(e)):n.setAttributeNS(LC,e,t):WA(n,e,t)}function WA(n,e,t){if(Uy(t))n.removeAttribute(e);else{if(Ap&&!Ip&&n.tagName==="TEXTAREA"&&e==="placeholder"&&t!==""&&!n.__ieph){var r=function(i){i.stopImmediatePropagation(),n.removeEventListener("input",r)};n.addEventListener("input",r),n.__ieph=!0}n.setAttribute(e,t)}}var lY={create:qA,update:qA};function HA(n,e){var t=e.elm,r=e.data,i=n.data;if(!(Pt(r.staticClass)&&Pt(r.class)&&(Pt(i)||Pt(i.staticClass)&&Pt(i.class)))){var a=MK(e),s=t._transitionClasses;be(s)&&(a=H2(a,V2(s))),a!==t._prevClass&&(t.setAttribute("class",a),t._prevClass=a)}}var dY={create:HA,update:HA},bx="__r",xx="__c";function fY(n){if(be(n[bx])){var e=Ap?"change":"input";n[e]=[].concat(n[bx],n[e]||[]),delete n[bx]}be(n[xx])&&(n.change=[].concat(n[xx],n.change||[]),delete n[xx])}var vg;function hY(n,e,t){var r=vg;return function i(){var a=e.apply(null,arguments);a!==null&&hD(n,i,t,r)}}var pY=PC&&!(mA&&Number(mA[1])<=53);function mY(n,e,t,r){if(pY){var i=oD,a=e;e=a._wrapper=function(s){if(s.target===s.currentTarget||s.timeStamp>=i||s.timeStamp<=0||s.target.ownerDocument!==document)return a.apply(this,arguments)}}vg.addEventListener(n,e,qM?{capture:t,passive:r}:t)}function hD(n,e,t,r){(r||vg).removeEventListener(n,e._wrapper||e,t)}function wx(n,e){if(!(Pt(n.data.on)&&Pt(e.data.on))){var t=e.data.on||{},r=n.data.on||{};vg=e.elm||n.elm,fY(t),KM(t,r,mY,hD,hY,e.context),vg=void 0}}var gY={create:wx,update:wx,destroy:function(n){return wx(n,Tl)}},_0;function VA(n,e){if(!(Pt(n.data.domProps)&&Pt(e.data.domProps))){var t,r,i=e.elm,a=n.data.domProps||{},s=e.data.domProps||{};(be(s.__ob__)||fr(s._v_attr_proxy))&&(s=e.data.domProps=Wn({},s));for(t in a)t in s||(i[t]="");for(t in s){if(r=s[t],t==="textContent"||t==="innerHTML"){if(e.children&&(e.children.length=0),r===a[t])continue;i.childNodes.length===1&&i.removeChild(i.childNodes[0])}if(t==="value"&&i.tagName!=="PROGRESS"){i._value=r;var o=Pt(r)?"":String(r);vY(i,o)&&(i.value=o)}else if(t==="innerHTML"&&G2(i.tagName)&&Pt(i.innerHTML)){_0=_0||document.createElement("div"),_0.innerHTML="<svg>".concat(r,"</svg>");for(var c=_0.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;c.firstChild;)i.appendChild(c.firstChild)}else if(r!==a[t])try{i[t]=r}catch{}}}}function vY(n,e){return!n.composing&&(n.tagName==="OPTION"||yY(n,e)||_Y(n,e))}function yY(n,e){var t=!0;try{t=document.activeElement!==n}catch{}return t&&n.value!==e}function _Y(n,e){var t=n.value,r=n._vModifiers;if(be(r)){if(r.number)return fg(t)!==fg(e);if(r.trim)return t.trim()!==e.trim()}return t!==e}var bY={create:VA,update:VA},xY=Sf(function(n){var e={},t=/;(?![^(]*\))/g,r=/:(.+)/;return n.split(t).forEach(function(i){if(i){var a=i.split(r);a.length>1&&(e[a[0].trim()]=a[1].trim())}}),e});function Cx(n){var e=pD(n.style);return n.staticStyle?Wn(n.staticStyle,e):e}function pD(n){return Array.isArray(n)?LM(n):typeof n=="string"?xY(n):n}function wY(n,e){for(var t={},r,i=n;i.componentInstance;)i=i.componentInstance._vnode,i&&i.data&&(r=Cx(i.data))&&Wn(t,r);(r=Cx(n.data))&&Wn(t,r);for(var a=n;a=a.parent;)a.data&&(r=Cx(a.data))&&Wn(t,r);return t}var CY=/^--/,GA=/\s*!important$/,KA=function(n,e,t){if(CY.test(e))n.style.setProperty(e,t);else if(GA.test(t))n.style.setProperty(Xg(e),t.replace(GA,""),"important");else{var r=kY(e);if(Array.isArray(t))for(var i=0,a=t.length;i<a;i++)n.style[r]=t[i];else n.style[r]=t}},YA=["Webkit","Moz","ms"],b0,kY=Sf(function(n){if(b0=b0||document.createElement("div").style,n=hf(n),n!=="filter"&&n in b0)return n;for(var e=n.charAt(0).toUpperCase()+n.slice(1),t=0;t<YA.length;t++){var r=YA[t]+e;if(r in b0)return r}});function XA(n,e){var t=e.data,r=n.data;if(!(Pt(t.staticStyle)&&Pt(t.style)&&Pt(r.staticStyle)&&Pt(r.style))){var i,a,s=e.elm,o=r.staticStyle,c=r.normalizedStyle||r.style||{},u=o||c,l=pD(e.data.style)||{};e.data.normalizedStyle=be(l.__ob__)?Wn({},l):l;var d=wY(e);for(a in u)Pt(d[a])&&KA(s,a,"");for(a in d)i=d[a],KA(s,a,i??"")}}var SY={create:XA,update:XA},mD=/\s+/;function gD(n,e){if(!(!e||!(e=e.trim())))if(n.classList)e.indexOf(" ")>
31-1?e.split(mD).forEach(function(r){return n.classList.add(r)}):n.classList.add(e);else{var t=" ".concat(n.getAttribute("class")||""," ");t.indexOf(" "+e+" ")<0&&n.setAttribute("class",(t+e).trim())}}function vD(n,e){if(!(!e||!(e=e.trim())))if(n.classList)e.indexOf(" ")>-1?e.split(mD).forEach(function(i){return n.classList.remove(i)}):n.classList.remove(e),n.classList.length||n.removeAttribute("class");else{for(var t=" ".concat(n.getAttribute("class")||""," "),r=" "+e+" ";t.indexOf(r)>=0;)t=t.replace(r," ");t=t.trim(),t?n.setAttribute("class",t):n.removeAttribute("class")}}function yD(n){if(n){if(typeof n=="object"){var e={};return n.css!==!1&&Wn(e,JA(n.name||"v")),Wn(e,n),e}else if(typeof n=="string")return JA(n)}}var JA=Sf(function(n){return{enterClass:"".concat(n,"-enter"),enterToClass:"".concat(n,"-enter-to"),enterActiveClass:"".concat(n,"-enter-active"),leaveClass:"".concat(n,"-leave"),leaveToClass:"".concat(n,"-leave-to"),leaveActiveClass:"".concat(n,"-leave-active")}}),_D=Ps&&!Ip,mh="transition",kx="animation",ty="transition",jy="transitionend",$C="animation",bD="animationend";_D&&(window.ontransitionend===void 0&&window.onwebkittransitionend!==void 0&&(ty="WebkitTransition",jy="webkitTransitionEnd"),window.onanimationend===void 0&&window.onwebkitanimationend!==void 0&&($C="WebkitAnimation",bD="webkitAnimationEnd"));var QA=Ps?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(n){return n()};function xD(n){QA(function(){QA(n)})}function Zd(n,e){var t=n._transitionClasses||(n._transitionClasses=[]);t.indexOf(e)<0&&(t.push(e),gD(n,e))}function zu(n,e){n._transitionClasses&&ad(n._transitionClasses,e),vD(n,e)}function wD(n,e,t){var r=CD(n,e),i=r.type,a=r.timeout,s=r.propCount;if(!i)return t();var o=i===mh?jy:bD,c=0,u=function(){n.removeEventListener(o,l),t()},l=function(d){d.target===n&&++c>=s&&u()};setTimeout(function(){c<s&&u()},a+1),n.addEventListener(o,l)}var TY=/\b(transform|all)(,|$)/;function CD(n,e){var t=window.getComputedStyle(n),r=(t[ty+"Delay"]||"").split(", "),i=(t[ty+"Duration"]||"").split(", "),a=ZA(r,i),s=(t[$C+"Delay"]||"").split(", "),o=(t[$C+"Duration"]||"").split(", "),c=ZA(s,o),u,l=0,d=0;e===mh?a>0&&(u=mh,l=a,d=i.length):e===kx?c>0&&(u=kx,l=c,d=o.length):(l=Math.max(a,c),u=l>0?a>c?mh:kx:null,d=u?u===mh?i.length:o.length:0);var h=u===mh&&TY.test(t[ty+"Property"]);return{type:u,timeout:l,propCount:d,hasTransform:h}}function ZA(n,e){for(;n.length<e.length;)n=n.concat(n);return Math.max.apply(null,e.map(function(t,r){return e3(t)+e3(n[r])}))}function e3(n){return Number(n.slice(0,-1).replace(",","."))*1e3}function BC(n,e){var t=n.elm;be(t._leaveCb)&&(t._leaveCb.cancelled=!0,t._leaveCb());var r=yD(n.data.transition);if(!Pt(r)&&!(be(t._enterCb)||t.nodeType!==1)){for(var i=r.css,a=r.type,s=r.enterClass,o=r.enterToClass,c=r.enterActiveClass,u=r.appearClass,l=r.appearToClass,d=r.appearActiveClass,h=r.beforeEnter,p=r.enter,g=r.afterEnter,v=r.enterCancelled,y=r.beforeAppear,b=r.appear,x=r.afterAppear,S=r.appearCancelled,w=r.duration,k=Qd,E=Qd.$vnode;E&&E.parent;)k=E.context,E=E.parent;var I=!k._isMounted||!n.isRootInsert;if(!(I&&!b&&b!=="")){var P=I&&u?u:s,A=I&&d?d:c,N=I&&l?l:o,j=I&&y||h,L=I&&ar(b)?b:p,B=I&&x||g,V=I&&S||v,X=fg(Zi(w)?w.enter:w),ne=i!==!1&&!Ip,se=K2(L),ie=t._enterCb=Iy(function(){ne&&(zu(t,N),zu(t,A)),ie.cancelled?(ne&&zu(t,P),V&&V(t)):B&&B(t),t._enterCb=null});n.data.show||Sl(n,"insert",function(){var de=t.parentNode,ue=de&&de._pending&&de._pending[n.key];ue&&ue.tag===n.tag&&ue.elm._leaveCb&&ue.elm._leaveCb(),L&&L(t,ie)}),j&&j(t),ne&&(Zd(t,P),Zd(t,A),xD(function(){zu(t,P),ie.cancelled||(Zd(t,N),se||(SD(X)?setTimeout(ie,X):wD(t,a,ie)))})),n.data.show&&(e&&e(),L&&L(t,ie)),!ne&&!se&&ie()}}}function kD(n,e){var t=n.elm;be(t._enterCb)&&(t._enterCb.cancelled=!0,t._enterCb());var r=yD(n.data.transition);if(Pt(r)||t.nodeType!==1)return e();if(be(t._leaveCb))return;var i=r.css,a=r.type,s=r.leaveClass,o=r.leaveToClass,c=r.leaveActiveClass,u=r.beforeLeave,l=r.leave,d=r.afterLeave,h=r.leaveCancelled,p=r.delayLeave,g=r.duration,v=i!==!1&&!Ip,y=K2(l),b=fg(Zi(g)?g.leave:g),x=t._leaveCb=Iy(function(){t.parentNode&&t.parentNode._pending&&(t.parentNode._pending[n.key]=null),v&&(zu(t,o),zu(t,c)),x.cancelled?(v&&zu(t,s),h&&h(t)):(e(),d&&d(t)),t._leaveCb=null});p?p(S):S();function S(){x.cancelled||(!n.data.show&&t.parentNode&&((t.parentNode._pending||(t.parentNode._pending={}))[n.key]=n),u&&u(t),v&&(Zd(t,s),Zd(t,c),xD(function(){zu(t,s),x.cancelled||(Zd(t,o),y||(SD(b)?setTimeout(x,b):wD(t,a,x)))})),l&&l(t,x),!v&&!y&&x())}}function SD(n){return typeof n=="number"&&!isNaN(n)}function K2(n){if(Pt(n))return!1;var e=n.fns;return be(e)?K2(Array.isArray(e)?e[0]:e):(n._length||n.length)>1}function t3(n,e){e.data.show!==!0&&BC(e)}var EY=Ps?{create:t3,activate:t3,remove:function(n,e){n.data.show!==!0?kD(n,e):e()}}:{},PY=[lY,dY,gY,bY,SY,EY],RY=PY.concat(uY),AY=iY({nodeOps:eY,modules:RY});Ip&&document.addEventListener("selectionchange",function(){var n=document.activeElement;n&&n.vmodel&&Y2(n,"input")});var TD={inserted:function(n,e,t,r){t.tag==="select"?(r.elm&&!r.elm._vOptions?Sl(t,"postpatch",function(){TD.componentUpdated(n,e,t)}):n3(n,e,t.context),n._vOptions=[].map.call(n.options,qy)):(t.tag==="textarea"||FC(n.type))&&(n._vModifiers=e.modifiers,e.modifiers.lazy||(n.addEventListener("compositionstart",IY),n.addEventListener("compositionend",a3),n.addEventListener("change",a3),Ip&&(n.vmodel=!0)))},componentUpdated:function(n,e,t){if(t.tag==="select"){n3(n,e,t.context);var r=n._vOptions,i=n._vOptions=[].map.call(n.options,qy);if(i.some(function(s,o){return!pf(s,r[o])})){var a=n.multiple?e.value.some(function(s){return i3(s,i)}):e.value!==e.oldValue&&i3(e.value,i);a&&Y2(n,"change")}}}};function n3(n,e,t){r3(n,e),(Ap||jM)&&setTimeout(function(){r3(n,e)},0)}function r3(n,e,t){var r=e.value,i=n.multiple;if(!(i&&!Array.isArray(r))){for(var a,s,o=0,c=n.options.length;o<c;o++)if(s=n.options[o],i)a=$M(r,qy(s))>-1,s.selected!==a&&(s.selected=a);else if(pf(qy(s),r)){n.selectedIndex!==o&&(n.selectedIndex=o);return}i||(n.selectedIndex=-1)}}function i3(n,e){return e.every(function(t){return!pf(t,n)})}function qy(n){return"_value"in n?n._value:n.value}function IY(n){n.target.composing=!0}function a3(n){n.target.composing&&(n.target.composing=!1,Y2(n.target,"input"))}function Y2(n,e){var t=document.createEvent("HTMLEvents");t.initEvent(e,!0,!0),n.dispatchEvent(t)}function UC(n){return n.componentInstance&&(!n.data||!n.data.transition)?UC(n.componentInstance._vnode):n}var OY={bind:function(n,e,t){var r=e.value;t=UC(t);var i=t.data&&t.data.transition,a=n.__vOriginalDisplay=n.style.display==="none"?"":n.style.display;r&&i?(t.data.show=!0,BC(t,function(){n.style.display=a})):n.style.display=r?a:"none"},update:function(n,e,t){var r=e.value,i=e.oldValue;if(!r!=!i){t=UC(t);var a=t.data&&t.data.transition;a?(t.data.show=!0,r?BC(t,function(){n.style.display=n.__vOriginalDisplay}):kD(t,function(){n.style.display="none"})):n.style.display=r?n.__vOriginalDisplay:"none"}},unbind:function(n,e,t,r,i){i||(n.style.display=n.__vOriginalDisplay)}},MY={model:TD,show:OY},ED={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterA
31ctiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function jC(n){var e=n&&n.componentOptions;return e&&e.Ctor.options.abstract?jC(eD(e.children)):n}function PD(n){var e={},t=n.$options;for(var r in t.propsData)e[r]=n[r];var i=t._parentListeners;for(var r in i)e[hf(r)]=i[r];return e}function s3(n,e){if(/\d-keep-alive$/.test(e.tag))return n("keep-alive",{props:e.componentOptions.propsData})}function DY(n){for(;n=n.parent;)if(n.data.transition)return!0}function NY(n,e){return e.key===n.key&&e.tag===n.tag}var LY=function(n){return n.tag||pg(n)},FY=function(n){return n.name==="show"},$Y={name:"transition",props:ED,abstract:!0,render:function(n){var e=this,t=this.$slots.default;if(t&&(t=t.filter(LY),!!t.length)){var r=this.mode,i=t[0];if(DY(this.$vnode))return i;var a=jC(i);if(!a)return i;if(this._leaving)return s3(n,i);var s="__transition-".concat(this._uid,"-");a.key=a.key==null?a.isComment?s+"comment":s+a.tag:Yg(a.key)?String(a.key).indexOf(s)===0?a.key:s+a.key:a.key;var o=(a.data||(a.data={})).transition=PD(this),c=this._vnode,u=jC(c);if(a.data.directives&&a.data.directives.some(FY)&&(a.data.show=!0),u&&u.data&&!NY(a,u)&&!pg(u)&&!(u.componentInstance&&u.componentInstance._vnode.isComment)){var l=u.data.transition=Wn({},o);if(r==="out-in")return this._leaving=!0,Sl(l,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),s3(n,i);if(r==="in-out"){if(pg(a))return c;var d,h=function(){d()};Sl(o,"afterEnter",h),Sl(o,"enterCancelled",h),Sl(l,"delayLeave",function(p){d=p})}}return i}}},RD=Wn({tag:String,moveClass:String},ED);delete RD.mode;var BY={props:RD,beforeMount:function(){var n=this,e=this._update;this._update=function(t,r){var i=iD(n);n.__patch__(n._vnode,n.kept,!1,!0),n._vnode=n.kept,i(),e.call(n,t,r)}},render:function(n){for(var e=this.tag||this.$vnode.data.tag||"span",t=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],a=this.children=[],s=PD(this),o=0;o<i.length;o++){var c=i[o];c.tag&&c.key!=null&&String(c.key).indexOf("__vlist")!==0&&(a.push(c),t[c.key]=c,(c.data||(c.data={})).transition=s)}if(r){for(var u=[],l=[],o=0;o<r.length;o++){var c=r[o];c.data.transition=s,c.data.pos=c.elm.getBoundingClientRect(),t[c.key]?u.push(c):l.push(c)}this.kept=n(e,null,u),this.removed=l}return n(e,null,a)},updated:function(){var n=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";!n.length||!this.hasMove(n[0].elm,e)||(n.forEach(UY),n.forEach(jY),n.forEach(qY),this._reflow=document.body.offsetHeight,n.forEach(function(t){if(t.data.moved){var r=t.elm,i=r.style;Zd(r,e),i.transform=i.WebkitTransform=i.transitionDuration="",r.addEventListener(jy,r._moveCb=function a(s){s&&s.target!==r||(!s||/transform$/.test(s.propertyName))&&(r.removeEventListener(jy,a),r._moveCb=null,zu(r,e))})}}))},methods:{hasMove:function(n,e){if(!_D)return!1;if(this._hasMove)return this._hasMove;var t=n.cloneNode();n._transitionClasses&&n._transitionClasses.forEach(function(i){vD(t,i)}),gD(t,e),t.style.display="none",this.$el.appendChild(t);var r=CD(t);return this.$el.removeChild(t),this._hasMove=r.hasTransform}}};function UY(n){n.elm._moveCb&&n.elm._moveCb(),n.elm._enterCb&&n.elm._enterCb()}function jY(n){n.data.newPos=n.elm.getBoundingClientRect()}function qY(n){var e=n.data.pos,t=n.data.newPos,r=e.left-t.left,i=e.top-t.top;if(r||i){n.data.moved=!0;var a=n.elm.style;a.transform=a.WebkitTransform="translate(".concat(r,"px,").concat(i,"px)"),a.transitionDuration="0s"}}var zY={Transition:$Y,TransitionGroup:BY};pn.config.mustUseProp=RK;pn.config.isReservedTag=fD;pn.config.isReservedAttr=EK;pn.config.getTagNamespace=BK;pn.config.isUnknownElement=UK;Wn(pn.options.directives,MY);Wn(pn.options.components,zY);pn.prototype.__patch__=Ps?AY:mi;pn.prototype.$mount=function(n,e){return n=n&&Ps?jK(n):void 0,MG(this,n,e)};Ps&&setTimeout(function(){mo.devtools&&Oy&&Oy.emit("init",pn)},0);var zy={exports:{}};zy.exports;(function(n,e){var t=200,r="__lodash_hash_undefined__",i=1,a=2,s=9007199254740991,o="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",l="[object Boolean]",d="[object Date]",h="[object Error]",p="[object Function]",g="[object GeneratorFunction]",v="[object Map]",y="[object Number]",b="[object Null]",x="[object Object]",S="[object Promise]",w="[object Proxy]",k="[object RegExp]",E="[object Set]",I="[object String]",P="[object Symbol]",A="[object Undef
31ined]",N="[object WeakMap]",j="[object ArrayBuffer]",L="[object DataView]",B="[object Float32Array]",V="[object Float64Array]",X="[object Int8Array]",ne="[object Int16Array]",se="[object Int32Array]",ie="[object Uint8Array]",de="[object Uint8ClampedArray]",ue="[object Uint16Array]",Ce="[object Uint32Array]",we=/[\\^$.*+?()[\]{}|]/g,Fe=/^\[object .+?Constructor\]$/,Ge=/^(?:0|[1-9]\d*)$/,Ie={};Ie[B]=Ie[V]=Ie[X]=Ie[ne]=Ie[se]=Ie[ie]=Ie[de]=Ie[ue]=Ie[Ce]=!0,Ie[o]=Ie[c]=Ie[j]=Ie[l]=Ie[L]=Ie[d]=Ie[h]=Ie[p]=Ie[v]=Ie[y]=Ie[x]=Ie[k]=Ie[E]=Ie[I]=Ie[N]=!1;var He=typeof Fr=="object"&&Fr&&Fr.Object===Object&&Fr,ot=typeof self=="object"&&self&&self.Object===Object&&self,Je=He||ot||Function("return this")(),et=e&&!e.nodeType&&e,Ut=et&&!0&&n&&!n.nodeType&&n,_t=Ut&&Ut.exports===et,mt=_t&&He.process,wt=function(){try{return mt&&mt.binding&&mt.binding("util")}catch{}}(),Kt=wt&&wt.isTypedArray;function Ct(T,$){for(var Y=-1,le=T==null?0:T.length,Oe=0,Re=[];++Y<le;){var Qe=T[Y];$(Qe,Y,T)&&(Re[Oe++]=Qe)}return Re}function kt(T,$){for(var Y=-1,le=$.length,Oe=T.length;++Y<le;)T[Oe+Y]=$[Y];return T}function jn(T,$){for(var Y=-1,le=T==null?0:T.length;++Y<le;)if($(T[Y],Y,T))return!0;return!1}function zt(T,$){for(var Y=-1,le=Array(T);++Y<T;)le[Y]=$(Y);return le}function qn(T){return function($){return T($)}}function _r(T,$){return T.has($)}function On(T,$){return T==null?void 0:T[$]}function hn(T){var $=-1,Y=Array(T.size);return T.forEach(function(le,Oe){Y[++$]=[Oe,le]}),Y}function xn(T,$){return function(Y){return T($(Y))}}function kn(T){var $=-1,Y=Array(T.size);return T.forEach(function(le){Y[++$]=le}),Y}var St=Array.prototype,Er=Function.prototype,Jn=Object.prototype,rn=Je["__core-js_shared__"],sr=Er.toString,Qn=Jn.hasOwnProperty,Pr=function(){var T=/[^.]+$/.exec(rn&&rn.keys&&rn.keys.IE_PROTO||"");return T?"Symbol(src)_1."+T:""}(),Gr=Jn.toString,gt=RegExp("^"+sr.call(Qn).replace(we,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rt=_t?Je.Buffer:void 0,Wt=Je.Symbol,Di=Je.Uint8Array,Kr=Jn.propertyIsEnumerable,Ni=St.splice,Yr=Wt?Wt.toStringTag:void 0,Zn=Object.getOwnPropertySymbols,Ya=Rt?Rt.isBuffer:void 0,br=xn(Object.keys,Object),Xa=jr(Je,"DataView"),na=jr(Je,"Map"),Os=jr(Je,"Promise"),Ca=jr(Je,"Set"),Ja=jr(Je,"WeakMap"),ra=jr(Object,"create"),Ms=Mn(Xa),ia=Mn(na),Ds=Mn(Os),Qa=Mn(Ca),dc=Mn(Ja),Ns=Wt?Wt.prototype:void 0,ko=Ns?Ns.valueOf:void 0;function Sn(T){var $=-1,Y=T==null?0:T.length;for(this.clear();++$<Y;){var le=T[$];this.set(le[0],le[1])}}function cu(){this.__data__=ra?ra(null):{},this.size=0}function uu(T){var $=this.has(T)&&delete this.__data__[T];return this.size-=$?1:0,$}function lu(T){var $=this.__data__;if(ra){var Y=$[T];return Y===r?void 0:Y}return Qn.call($,T)?$[T]:void 0}function Za(T){var $=this.__data__;return ra?$[T]!==void 0:Qn.call($,T)}function Ur(T,$){var Y=this.__data__;return this.size+=this.has(T)?0:1,Y[T]=ra&&$===void 0?r:$,this}Sn.prototype.clear=cu,Sn.prototype.delete=uu,Sn.prototype.get=lu,Sn.prototype.has=Za,Sn.prototype.set=Ur;function or(T){var $=-1,Y=T==null?0:T.length;for(this.clear();++$<Y;){var le=T[$];this.set(le[0],le[1])}}function Ls(){this.__data__=[],this.size=0}function fc(T){var $=this.__data__,Y=rs($,T);if(Y<0)return!1;var le=$.length-1;return Y==le?$.pop():Ni.call($,Y,1),--this.size,!0}function So(T){var $=this.__data__,Y=rs($,T);return Y<0?void 0:$[Y][1]}function Fs(T){return rs(this.__data__,T)>-1}function du(T,$){var Y=this.__data__,le=rs(Y,T);return le<0?(++this.size,Y.push([T,$])):Y[le][1]=$,this}or.prototype.clear=Ls,or.prototype.delete=fc,or.prototype.get=So,or.prototype.has=Fs,or.prototype.set=du;function Rr(T){var $=-1,Y=T==null?0:T.length;for(this.clear();++$<Y;){var le=T[$];this.set(le[0],le[1])}}function fu(){this.size=0,this.__data__={hash:new Sn,map:new(na||or),string:new Sn}}function $s(T){var $=Jr(this,T).delete(T);return this.size-=$?1:0,$}function To(T){return Jr(this,T).get(T)}function es(T){return Jr(this,T).has(T)}function hu(T,$){var Y=Jr(this,T),le=Y.size;return Y.set(T,$),this.size+=Y.size==le?0:1,this}Rr.prototype.clear=fu,Rr.prototype.delete=$s,Rr.prototype.get=To,Rr.prototype.has=es,Rr.prototype.set=hu;function Bs(T){var $=-1,Y=T==null?0:T.length;for(this.__data__=new Rr;++$<Y;)this.add(T[$])}function Eo(T){return this.__data__.set(T,r),this}function ts(T){return this.__data__.has(T)}Bs.prototype.add=Bs.prototype.push=Eo,Bs.prototype.has=ts;function Vn(T){var $=this.__data__=new or(T);this.size=$.size}function ns(){this.__data__=new or,this.size=0}function aa(T){var $=this.__data__,Y=$.delete(T);return this.size=$.size,Y}function Us(T){return this.__data__.get(T)}function pu(T){return this.__data__.has(T)}function hc(T,$){var Y=this.__data__;if(Y instanceof or){var le=Y.__data__;if(!na||le.length<t-1)return le.push([T,$]),this.size=++Y.size,this;Y=this.__data__=new Rr(le)}return Y.set(T,$),this.size=Y.size,this}Vn.prototype.clear=ns,Vn.prototype.delete=aa,Vn.prototype.get=Us,Vn.prototype.has=pu,Vn.prototype.set=hc;function Po(T,$){var Y=is(T),le=!Y&&yc(T),Oe=!Y&&!le&&zn(T),Re=!Y&&!le&&!Oe&&ge(T),Qe=Y||le||Oe||Re,je=Qe?zt(T.length,String):[],it=je.length;for(var Xe in T)Qn.call(T,Xe)&&!(Qe&&(Xe=="length"||Oe&&(Xe=="offset"||Xe=="parent")||Re&&(Xe=="buffer"||Xe=="byteLength"||Xe=="byteOffset")||mu(Xe,it)))&&je.pu
vendor: 4,725 bytes, line 31
31sh(Xe);return je}function rs(T,$){for(var Y=T.length;Y--;)if(Ao(T[Y][0],$))return Y;return-1}function Li(T,$,Y){var le=$(T);return is(T)?le:kt(le,Y(T))}function Fi(T){return T==null?T===void 0?A:b:Yr&&Yr in Object(T)?qr(T):Hs(T)}function pc(T){return Z(T)&&Fi(T)==o}function js(T,$,Y,le,Oe){return T===$?!0:T==null||$==null||!Z(T)&&!Z($)?T!==T&&$!==$:sa(T,$,Y,le,js,Oe)}function sa(T,$,Y,le,Oe,Re){var Qe=is(T),je=is($),it=Qe?c:cr(T),Xe=je?c:cr($);it=it==o?x:it,Xe=Xe==o?x:Xe;var Tt=it==x,Mt=Xe==x,bt=it==Xe;if(bt&&zn(T)){if(!zn($))return!1;Qe=!0,Tt=!1}if(bt&&!Tt)return Re||(Re=new Vn),Qe||ge(T)?qs(T,$,Y,le,Oe,Re):zs(T,$,it,Y,le,Oe,Re);if(!(Y&i)){var gn=Tt&&Qn.call(T,"__wrapped__"),Yt=Mt&&Qn.call($,"__wrapped__");if(gn||Yt){var ca=gn?T.value():T,Sa=Yt?$.value():$;return Re||(Re=new Vn),Oe(ca,Sa,Y,le,Re)}}return bt?(Re||(Re=new Vn),gc(T,$,Y,le,Oe,Re)):!1}function oa(T){if(!q(T)||Ws(T))return!1;var $=U(T)?gt:Fe;return $.test(Mn(T))}function mc(T){return Z(T)&&W(T.length)&&!!Ie[Fi(T)]}function wi(T){if(!vc(T))return br(T);var $=[];for(var Y in Object(T))Qn.call(T,Y)&&Y!="constructor"&&$.push(Y);return $}function qs(T,$,Y,le,Oe,Re){var Qe=Y&i,je=T.length,it=$.length;if(je!=it&&!(Qe&&it>je))return!1;var Xe=Re.get(T);if(Xe&&Re.get($))return Xe==$;var Tt=-1,Mt=!0,bt=Y&a?new Bs:void 0;for(Re.set(T,$),Re.set($,T);++Tt<je;){var gn=T[Tt],Yt=$[Tt];if(le)var ca=Qe?le(Yt,gn,Tt,$,T,Re):le(gn,Yt,Tt,T,$,Re);if(ca!==void 0){if(ca)continue;Mt=!1;break}if(bt){if(!jn($,function(Sa,Vs){if(!_r(bt,Vs)&&(gn===Sa||Oe(gn,Sa,Y,le,Re)))return bt.push(Vs)})){Mt=!1;break}}else if(!(gn===Yt||Oe(gn,Yt,Y,le,Re))){Mt=!1;break}}return Re.delete(T),Re.delete($),Mt}function zs(T,$,Y,le,Oe,Re,Qe){switch(Y){case L:if(T.byteLength!=$.byteLength||T.byteOffset!=$.byteOffset)return!1;T=T.buffer,$=$.buffer;case j:return!(T.byteLength!=$.byteLength||!Re(new Di(T),new Di($)));case l:case d:case y:return Ao(+T,+$);case h:return T.name==$.name&&T.message==$.message;case k:case I:return T==$+"";case v:var je=hn;case E:var it=le&i;if(je||(je=kn),T.size!=$.size&&!it)return!1;var Xe=Qe.get(T);if(Xe)return Xe==$;le|=a,Qe.set(T,$);var Tt=qs(je(T),je($),le,Oe,Re,Qe);return Qe.delete(T),Tt;case P:if(ko)return ko.call(T)==ko.call($)}return!1}function gc(T,$,Y,le,Oe,Re){var Qe=Y&i,je=Xr(T),it=je.length,Xe=Xr($),Tt=Xe.length;if(it!=Tt&&!Qe)return!1;for(var Mt=it;Mt--;){var bt=je[Mt];if(!(Qe?bt in $:Qn.call($,bt)))return!1}var gn=Re.get(T);if(gn&&Re.get($))return gn==$;var Yt=!0;Re.set(T,$),Re.set($,T);for(var ca=Qe;++Mt<it;){bt=je[Mt];var Sa=T[bt],Vs=$[bt];if(le)var yd=Qe?le(Vs,Sa,bt,$,T,Re):le(Sa,Vs,bt,T,$,Re);if(!(yd===void 0?Sa===Vs||Oe(Sa,Vs,Y,le,Re):yd)){Yt=!1;break}ca||(ca=bt=="constructor")}if(Yt&&!ca){var gu=T.constructor,vu=$.constructor;gu!=vu&&"constructor"in T&&"constructor"in $&&!(typeof gu=="function"&&gu instanceof gu&&typeof vu=="function"&&vu instanceof vu)&&(Yt=!1)}return Re.delete(T),Re.delete($),Yt}function Xr(T){return Li(T,me,ka)}function Jr(T,$){var Y=T.__data__;return Ro($)?Y[typeof $=="string"?"string":"hash"]:Y.map}function jr(T,$){var Y=On(T,$);return oa(Y)?Y:void 0}function qr(T){var $=Qn.call(T,Yr),Y=T[Yr];try{T[Yr]=void 0;var le=!0}catch{}var Oe=Gr.call(T);return le&&($?T[Yr]=Y:delete T[Yr]),Oe}var ka=Zn?function(T){return T==null?[]:(T=Object(T),Ct(Zn(T),function($){return Kr.call(T,$)}))}:$e,cr=Fi;(Xa&&cr(new Xa(new ArrayBuffer(1)))!=L||na&&cr(new na)!=v||Os&&cr(Os.resolve())!=S||Ca&&cr(new Ca)!=E||Ja&&cr(new Ja)!=N)&&(cr=function(T){var $=Fi(T),Y=$==x?T.constructor:void 0,le=Y?Mn(Y):"";if(le)switch(le){case Ms:return L;case ia:return v;case Ds:return S;case Qa:return E;case dc:return N}return $});function mu(T,$){return $=$??s,!!$&&(typeof T=="number"||Ge.test(T))&&T>-1&&T%1==0&&T<$}function Ro(T){var $=typeof T;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?T!=="__proto__":T===null}function Ws(T){return!!Pr&&Pr in T}function vc(T){var $=T&&T.constructor,Y=typeof $=="function"&&$.prototype||Jn;return T===Y}function Hs(T){return Gr.call(T)}function Mn(T){if(T!=null){try{return sr.call(T)}catch{}try{return T+""}catch{}}return""}function Ao(T,$){return T===$||T!==T&&$!==$}var yc=pc(function(){return arguments}())?pc:function(T){return Z(T)&&Qn.call(T,"callee")&&!Kr.call(T,"callee")},is=Array.isArray;function Io(T){return T!=null&&W(T.length)&&!U(T)}var zn=Ya||oe;function O(T,$){return js(T,$)}function U(T){if(!q(T))return!1;var $=Fi(T);return $==p||$==g||$==u||$==w}function W(T){return typeof T=="number"&&T>-1&&T%1==0&&T<=s}function q(T){var $=typeof T;return T!=null&&($=="object"||$=="function")}function Z(T){return T!=null&&typeof T=="object"}var ge=Kt?qn(Kt):mc;function me(T){return Io(T)?Po(T):wi(T)}function $e(){return[]}function oe(){return!1}n.exports=O}
31)(zy,zy.exports);var WY=zy.exports;const HY=id(WY);var Wy={exports:{}};Wy.exports;(function(n,e){var t=200,r="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Array]",o="[object Boolean]",c="[object Date]",u="[object Error]",l="[object Function]",d="[object GeneratorFunction]",h="[object Map]",p="[object Number]",g="[object Object]",v="[object Promise]",y="[object RegExp]",b="[object Set]",x="[object String]",S="[object Symbol]",w="[object WeakMap]",k="[object ArrayBuffer]",E="[object DataView]",I="[object Float32Array]",P="[object Float64Array]",A="[object Int8Array]",N="[object Int16Array]",j="[object Int32Array]",L="[object Uint8Array]",B="[object Uint8ClampedArray]",V="[object Uint16Array]",X="[object Uint32Array]",ne=/[\\^$.*+?()[\]{}|]/g,se=/\w*$/,ie=/^\[object .+?Constructor\]$/,de=/^(?:0|[1-9]\d*)$/,ue={};ue[a]=ue[s]=ue[k]=ue[E]=ue[o]=ue[c]=ue[I]=ue[P]=ue[A]=ue[N]=ue[j]=ue[h]=ue[p]=ue[g]=ue[y]=ue[b]=ue[x]=ue[S]=ue[L]=ue[B]=ue[V]=ue[X]=!0,ue[u]=ue[l]=ue[w]=!1;var Ce=typeof Fr=="object"&&Fr&&Fr.Object===Object&&Fr,we=typeof self=="object"&&self&&self.Object===Object&&self,Fe=Ce||we||Function("return this")(),Ge=e&&!e.nodeType&&e,Ie=Ge&&!0&&n&&!n.nodeType&&n,He=Ie&&Ie.exports===Ge;function ot(T,$){return T.set($[0],$[1]),T}function Je(T,$){return T.add($),T}function et(T,$){for(var Y=-1,le=T?T.length:0;++Y<le&&$(T[Y],Y,T)!==!1;);return T}function Ut(T,$){for(var Y=-1,le=$.length,Oe=T.length;++Y<le;)T[Oe+Y]=$[Y];return T}function _t(T,$,Y,le){for(var Oe=-1,Re=T?T.length:0;++Oe<Re;)Y=$(Y,T[Oe],Oe,T);return Y}function mt(T,$){for(var Y=-1,le=Array(T);++Y<T;)le[Y]=$(Y);return le}function wt(T,$){return T==null?void 0:T[$]}function Kt(T){var $=!1;if(T!=null&&typeof T.toString!="function")try{$=!!(T+"")}catch{}return $}function Ct(T){var $=-1,Y=Array(T.size);return T.forEach(function(le,Oe){Y[++$]=[Oe,le]}),Y}function kt(T,$){return function(Y){return T($(Y))}}function jn(T){var $=-1,Y=Array(T.size);return T.forEach(function(le){Y[++$]=le}),Y}var zt=Array.prototype,qn=Function.prototype,_r=Object.prototype,On=Fe["__core-js_shared__"],hn=function(){var T=/[^.]+$/.exec(On&&On.keys&&On.keys.IE_PROTO||"");return T?"Symbol(src)_1."+T:""}(),xn=qn.toString,kn=_r.hasOwnProperty,St=_r.toString,Er=RegExp("^"+xn.call(kn).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Jn=He?Fe.Buffer:void 0,rn=Fe.Symbol,sr=Fe.Uint8Array,Qn=kt(Object.getPrototypeOf,Object),Pr=Object.create,Gr=_r.propertyIsEnumerable,gt=zt.splice,Rt=Object.getOwnPropertySymbols,Wt=Jn?Jn.isBuffer:void 0,Di=kt(Object.keys,Object),Kr=Jr(Fe,"DataView"),Ni=Jr(Fe,"Map"),Yr=Jr(Fe,"Promise"),Zn=Jr(Fe,"Set"),Ya=Jr(Fe,"WeakMap"),br=Jr(Object,"create"),Xa=Mn(Kr),na=Mn(Ni),Os=Mn(Yr),Ca=Mn(Zn),Ja=Mn(Ya),ra=rn?rn.prototype:void 0,Ms=ra?ra.valueOf:void 0;function ia(T){var $=-1,Y=T?T.length:0;for(this.clear();++$<Y;){var le=T[$];this.set(le[0],le[1])}}function Ds(){this.__data__=br?br(null):{}}function Qa(T){return this.has(T)&&delete this.__data__[T]}function dc(T){var $=this.__data__;if(br){var Y=$[T];return Y===r?void 0:Y}return kn.call($,T)?$[T]:void 0}function Ns(T){var $=this.__data__;return br?$[T]!==void 0:kn.call($,T)}
31function ko(T,$){var Y=this.__data__;return Y[T]=br&&$===void 0?r:$,this}ia.prototype.clear=Ds,ia.prototype.delete=Qa,ia.prototype.get=dc,ia.prototype.has=Ns,ia.prototype.set=ko;function Sn(T){var $=-1,Y=T?T.length:0;for(this.clear();++$<Y;){var le=T[$];this.set(le[0],le[1])}}function cu(){this.__data__=[]}function uu(T){var $=this.__data__,Y=ts($,T);if(Y<0)return!1;var le=$.length-1;return Y==le?$.pop():gt.call($,Y,1),!0}function lu(T){var $=this.__data__,Y=ts($,T);return Y<0?void 0:$[Y][1]}function Za(T){return ts(this.__data__,T)>-1}function Ur(T,$){var Y=this.__data__,le=ts(Y,T);return le<0?Y.push([T,$]):Y[le][1]=$,this}Sn.prototype.clear=cu,Sn.prototype.delete=uu,Sn.prototype.get=lu,Sn.prototype.has=Za,Sn.prototype.set=Ur;function or(T){var $=-1,Y=T?T.length:0;for(this.clear();++$<Y;){var le=T[$];this.set(le[0],le[1])}}function Ls(){this.__data__={hash:new ia,map:new(Ni||Sn),string:new ia}}function fc(T){return Xr(this,T).delete(T)}function So(T){return Xr(this,T).get(T)}function Fs(T){return Xr(this,T).has(T)}function du(T,$){return Xr(this,T).set(T,$),this}or.prototype.clear=Ls,or.prototype.delete=fc,or.prototype.get=So,or.prototype.has=Fs,or.prototype.set=du;function Rr(T){this.__data__=new Sn(T)}function fu(){this.__data__=new Sn}function $s(T){return this.__data__.delete(T)}function To(T){return this.__data__.get(T)}function es(T){return this.__data__.has(T)}function hu(T,$){var Y=this.__data__;if(Y instanceof Sn){var le=Y.__data__;if(!Ni||le.length<t-1)return le.push([T,$]),this;Y=this.__data__=new or(le)}return Y.set(T,$),this}Rr.prototype.clear=fu,Rr.prototype.delete=$s,Rr.prototype.get=To,Rr.prototype.has=es,Rr.prototype.set=hu;function Bs(T,$){var Y=Io(T)||is(T)?mt(T.length,String):[],le=Y.length,Oe=!!le;for(var Re in T)kn.call(T,Re)&&!(Oe&&(Re=="length"||Ro(Re,le)))&&Y.push(Re);return Y}function Eo(T,$,Y){var le=T[$];(!(kn.call(T,$)&&yc(le,Y))||Y===void 0&&!($ in T))&&(T[$]=Y)}function ts(T,$){for(var Y=T.length;Y--;)if(yc(T[Y][0],$))return Y;return-1}function Vn(T,$){return T&&qs($,me($),T)}function ns(T,$,Y,le,Oe,Re,Qe){var je;if(le&&(je=Re?le(T,Oe,Re,Qe):le(T)),je!==void 0)return je;if(!Z(T))return T;var it=Io(T);if(it){if(je=ka(T),!$)return wi(T,je)}else{var Xe=qr(T),Tt=Xe==l||Xe==d;if(U(T))return rs(T,$);if(Xe==g||Xe==a||Tt&&!Re){if(Kt(T))return Re?T:{};if(je=cr(Tt?{}:T),!$)return zs(T,Vn(je,T))}else{if(!ue[Xe])return Re?T:{};je=mu(T,Xe,ns,$)}}Qe||(Qe=new Rr);var Mt=Qe.get(T);if(Mt)return Mt;if(Qe.set(T,je),!it)var bt=Y?gc(T):me(T);return et(bt||T,function(gn,Yt){bt&&(Yt=gn,gn=T[Yt]),Eo(je,Yt,ns(gn,$,Y,le,Yt,T,Qe))}),je}function aa(T){return Z(T)?Pr(T):{}}function Us(T,$,Y){var le=$(T);return Io(T)?le:Ut(le,Y(T))}function pu(T){return St.call(T)}function hc(T){if(!Z(T)||vc(T))return!1;var $=W(T)||Kt(T)?Er:ie;return $.test(Mn(T))}function Po(T){if(!Hs(T))return Di(T);var $=[];for(var Y in Object(T))kn.call(T,Y)&&Y!="constructor"&&$.push(Y);return $}function rs(T,$){if($)return T.slice();var Y=new T.constructor(T.length);return T.copy(Y),Y}function Li(T){var $=new T.constructor(T.byteLength);return new sr($).set(new sr(T)),$}function Fi(T,$){var Y=$?Li(T.buffer):T.buffer;return new T.constructor(Y,T.byteOffset,T.byteLength)}function pc(T,$,Y){var le=$?Y(Ct(T),!0):Ct(T);return _t(le,ot,new T.constructor)}function js(T){var $=new T.constructor(T.source,se.exec(T));return $.lastIndex=T.lastIndex,$}function sa(T,$,Y){var le=$?Y(jn(T),!0):jn(T);return _t(le,Je,new T.constructor)}function oa(T){return Ms?Object(Ms.call(T)):{}}function mc(T,$){var Y=$?Li(T.buffer):T.buffer;return new T.constructor(Y,T.byteOffset,T.length)}function wi(T,$){var Y=-1,le=T.length;for($||($=Array(le));++Y<le;)$[Y]=T[Y];return $}function qs(T,$,Y,le){Y||(Y={});for(var Oe=-1,Re=$.length;++Oe<Re;){var Qe=$[Oe],je=void 0;Eo(Y,Qe,je===void 0?T[Qe]:je)}return Y}function zs(T,$){return qs(T,jr(T),$)}function gc(T){return Us(T,me,jr)}function Xr(T,$){var Y=T.__data__;return Ws($)?Y[typeof $=="string"?"string":"hash"]:Y.map}function Jr(T,$){var Y=wt(T,$);return hc(Y)?Y:void 0}var jr=Rt?kt(Rt,Object):$e,qr=pu;(Kr&&qr(new Kr(new ArrayBuffer(1)))!=E||Ni&&qr(new Ni)!=h||Yr&&qr(Yr.resolve())!=v||Zn&&qr(new Zn)!=b||Ya&&qr(new Ya)!=w)&&(qr=function(T){var $=St.call(T),Y=$==g?T.constructor:void 0,le=Y?Mn(Y):void 0;if(le)switch(le){case Xa:return E;case na:return h;case Os:return v;case Ca:return b;case Ja:return w}return $});function ka(T){var $=T.length,Y=T.constructor($);return $&&typeof T[0]=="string"&&kn.call(T,"index")&&(Y.index=T.index,Y.input=T.input),Y}function cr(T){return typeof T.constructor=="function"&&!Hs(T)?aa(Qn(T)):{}}function mu(T,$,Y,le){var Oe=T.constructor;switch($){case k:return Li(T);case o:case c:return new Oe(+T);case E:return Fi(T,le);case I:case P:case A:case N:case j:case L:case B:case V:case X:return mc(T,le);case h:return pc(T,le,Y);case p:case x:return new Oe(T);case y:return js(T);case b:return sa(T,le,Y);case S:return oa(T)}}function Ro(T,$){return $=$??i,!!$&&(typeof T=="number"||de.test(T))&&T>-1&&T%1==0&&T<$}function Ws(T){var $=typeof T;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?T!=="__proto__":T===null}function vc(T){return!!hn&&hn in T}function Hs(T){var $=T&&T.constructor,Y=typeof $=="function"&&$.prototype||_r;return T===Y}function Mn(T){if(T!=null){try{return xn.call(T)}catch{}try{return T+""}catch{}}return""}function Ao(T){return ns(T,!0,!0)}function yc(T,$){return T===$||T!==T&&$!==$}function is(T){return O(T)&&kn.call(T,"callee")&&(!Gr.call(T,"callee")||St.call(T)==a)}var Io=Array.isArray;function zn(T){return T!=null&&q(T.length)&&!W(T)}function O(T){return ge(T)&&zn(T)}var U=Wt||oe;function W(T){var $=Z(T)?St.call(T):"";return $==l||$==d}function q(T){return typeof T=="number"&&T>-1&&T%1==0&&T<=i}function Z(T){var $=typeof T;return!!T&&($=="object"||$=="function")}function ge(T){return!!T&&typeof T=="object"}function me(T){return zn(T)?Bs(T):Po(T)}function $e(){return[]}function oe(){return!1}n.exports=Ao}
31)(Wy,Wy.exports);var VY=Wy.exports;const x0=id(VY);var Gi={},X2={exports:{}},AD=function(e,t){return function(){for(var i=new Array(arguments.length),a=0;a<i.length;a++)i[a]=arguments[a];return e.apply(t,i)}},GY=AD,Tf=Object.prototype.toString;function J2(n){return Tf.call(n)==="[object Array]"}function qC(n){return typeof n>"u"}function KY(n){return n!==null&&!qC(n)&&n.constructor!==null&&!qC(n.constructor)&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function YY(n){return Tf.call(n)==="[object ArrayBuffer]"}function XY(n){return typeof FormData<"u"&&n instanceof FormData}function JY(n){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&n.buffer instanceof ArrayBuffer,e}function QY(n){return typeof n=="string"}function ZY(n){return typeof n=="number"}function ID(n){return n!==null&&typeof n=="object"}function ny(n){if(Tf.call(n)!=="[object Object]")return!1;var e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}function eX(n){return Tf.call(n)==="[object Date]"}function tX(n){return Tf.call(n)==="[object File]"}function nX(n){return Tf.call(n)==="[object Blob]"}function OD(n){return Tf.call(n)==="[object Function]"}function rX(n){return ID(n)&&OD(n.pipe)}function iX(n){return typeof URLSearchParams<"u"&&n instanceof URLSearchParams}function aX(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function sX(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Q2(n,e){if(!(n===null||typeof n>"u"))if(typeof n!="object"&&(n=[n]),J2(n))for(var t=0,r=n.length;t<r;t++)e.call(null,n[t],t,n);else for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.call(null,n[i],i,n)}function zC(){var n={};function e(i,a){ny(n[a])&&ny(i)?n[a]=zC(n[a],i):ny(i)?n[a]=zC({},i):J2(i)?n[a]=i.slice():n[a]=i}for(var t=0,r=arguments.length;t<r;
31t++)Q2(arguments[t],e);return n}function oX(n,e,t){return Q2(e,function(i,a){t&&typeof i=="function"?n[a]=GY(i,t):n[a]=i}),n}function cX(n){return n.charCodeAt(0)===65279&&(n=n.slice(1)),n}var Rs={isArray:J2,isArrayBuffer:YY,isBuffer:KY,isFormData:XY,isArrayBufferView:JY,isString:QY,isNumber:ZY,isObject:ID,isPlainObject:ny,isUndefined:qC,isDate:eX,isFile:tX,isBlob:nX,isFunction:OD,isStream:rX,isURLSearchParams:iX,isStandardBrowserEnv:sX,forEach:Q2,merge:zC,extend:oX,trim:aX,stripBOM:cX},eh=Rs;function o3(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var MD=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(eh.isURLSearchParams(t))i=t.toString();else{var a=[];eh.forEach(t,function(c,u){c===null||typeof c>"u"||(eh.isArray(c)?u=u+"[]":c=[c],eh.forEach(c,function(d){eh.isDate(d)?d=d.toISOString():eh.isObject(d)&&(d=JSON.stringify(d)),a.push(o3(u)+"="+o3(d))}))}),i=a.join("&")}if(i){var s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e},uX=Rs;function J_(){this.handlers=[]}J_.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1};J_.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};J_.prototype.forEach=function(e){uX.forEach(this.handlers,function(r){r!==null&&e(r)})};var lX=J_,dX=Rs,fX=function(e,t){dX.forEach(e,function(i,a){a!==t&&a.toUpperCase()===t.toUpperCase()&&(e[t]=i,delete e[a])})},DD=function(e,t,r,i,a){return e.config=t,r&&(e.code=r),e.request=i,e.response=a,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e},Sx,c3;function ND(){if(c3)return Sx;c3=1;var n=DD;return Sx=function(t,r,i,a,s){var o=new Error(t);return n(o,r,i,a,s)},Sx}var Tx,u3;function hX(){if(u3)return Tx;u3=1;var n=ND();return Tx=function(t,r,i){var a=i.config.validateStatus;!i.status||!a||a(i.status)?t(i):r(n("Request failed with status code "+i.status,i.config,null,i.request,i))},Tx}var Ex,l3;function pX(){if(l3)return Ex;l3=1;var n=Rs;return Ex=n.isStandardBrowserEnv()?function(){return{write:function(r,i,a,s,o,c){var u=[];u.push(r+"="+encodeURIComponent(i)),n.isNumber(a)&&u.push("expires="+new Date(a).toGMTString()),n.isString(s)&&u.push("path="+s),n.isString(o)&&u.push("domain="+o),c===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(r){var i=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Ex}var Px,d3;function mX(){return d3||(d3=1,Px=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}),Px}var Rx,f3;function gX(){return f3||(f3=1,Rx=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}),Rx}var Ax,h3;function vX(){if(h3)return Ax;h3=1;var n=mX(),e=gX();return Ax=function(r,i){return r&&!n(i)?e(r,i):i},Ax}var Ix,p3;function yX(){if(p3)return Ix;p3=1;var n=Rs,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Ix=function(r){var i={},a,s,o;
31return r&&n.forEach(r.split(` 32`),function(u){if(o=u.indexOf(":"),a=n.trim(u.substr(0,o)).toLowerCase(),s=n.trim(u.substr(o+1)),a){if(i[a]&&e.indexOf(a)>=0)return;a==="set-cookie"?i[a]=(i[a]?i[a]:[]).concat([s]):i[a]=i[a]?i[a]+", "+s:s}}),i},Ix}var Ox,m3;function _X(){if(m3)return Ox;m3=1;var n=Rs;return Ox=n.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),i;function a(s){var o=s;return t&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return i=a(window.location.href),function(o){var c=n.isString(o)?a(o):o;return c.protocol===i.protocol&&c.host===i.host}}():function(){return function(){return!0}}(),Ox}var Mx,g3;function v3(){if(g3)return Mx;g3=1;var n=Rs,e=hX(),t=pX(),r=MD,i=vX(),a=yX(),s=_X(),o=ND();return Mx=function(u){return new Promise(function(d,h){var p=u.data,g=u.headers,v=u.responseType;n.isFormData(p)&&delete g["Content-Type"];var y=new XMLHttpRequest;if(u.auth){var b=u.auth.username||"",x=u.auth.password?unescape(encodeURIComponent(u.auth.password)):"";g.Authorization="Basic "+btoa(b+":"+x)}var S=i(u.baseURL,u.url);y.open(u.method.toUpperCase(),r(S,u.params,u.paramsSerializer),!0),y.timeout=u.timeout;function w(){if(y){var E="getAllResponseHeaders"in y?a(y.getAllResponseHeaders()):null,I=!v||v==="text"||v==="json"?y.responseText:y.response,P={data:I,status:y.status,statusText:y.statusText,headers:E,config:u,request:y};e(d,h,P),y=null}}if("onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(w)},y.onabort=function(){y&&(h(o("Request aborted",u,"ECONNABORTED",y)),y=null)},y.onerror=function(){h(o("Network Error",u,null,y)),y=null},y.ontimeout=function(){var I="timeout of "+u.timeout+"ms exceeded";u.timeoutErrorMessage&&(I=u.timeoutErrorMessage),h(o(I,u,u.transitional&&u.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",y)),y=null},n.isStandardBrowserEnv()){var k=(u.withCredentials||s(S))&&u.xsrfCookieName?t.read(u.xsrfCookieName):void 0;k&&(g[u.xsrfHeaderName]=k)}"setRequestHeader"in y&&n.forEach(g,function(I,P){typeof p>"u"&&P.toLowerCase()==="content-type"?delete g[P]:y.setRequestHeader(P,I)}),n.isUndefined(u.withCredentials)||(y.withCredentials=!!u.withCredentials),v&&v!=="json"&&(y.responseType=u.responseType),typeof u.onDownloadProgress=="function"&&y.addEventListener("progress",u.onDownloadProgress),typeof u.onUploadProgress=="function"&&y.upload&&y.upload.addEventListener("progress",u.onUploadProgress),u.cancelToken&&u.cancelToken.promise.then(function(I){y&&(y.abort(),h(I),y=null)}),p||(p=null),y.send(p)})},Mx}var Si=Rs,y3=fX,bX=DD,xX={"Content-Type":"application/x-www-form-urlencoded"};function _3(n,e){!Si.isUndefined(n)&&Si.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}function wX(){var n;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(n=v3()),n}function CX(n,e,t){if(Si.isString(n))try{return(e||JSON.parse)(n),Si.trim(n)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(n)}var Q_={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:wX(),transformRequest:[function(e,t){return y3(t,"Accept"),y3(t,"Content-Type"),Si.isFormData(e)||Si.isArrayBuffer(e)||Si.isBuffer(e)||Si.isStream(e)||Si.isFile(e)||Si.isBlob(e)?e:Si.isArrayBufferView(e)?e.buffer:Si.isURLSearchParams(e)?(_3(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Si.isObject(e)||t&&t["Content-Type"]==="application/json"?(_3(t,"application/json"),CX(e)):e}],transformResponse:[function(e){var t=this.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,a=!r&&this.responseType==="json";if(a||i&&Si.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(a)throw s.name==="SyntaxError"?bX(s,this,"E_JSON_PARSE"):s}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};Q_.headers={common:{Accept:"application/json, text/plain, */*"}};Si.forEach(["delete","get","head"],function(e){Q_.headers[e]={}});Si.forEach(["post","put","patch"],function(e){Q_.headers[e]=Si.merge
32(xX)});var Z2=Q_,kX=Rs,SX=Z2,TX=function(e,t,r){var i=this||SX;return kX.forEach(r,function(s){e=s.call(i,e,t)}),e},Dx,b3;function LD(){return b3||(b3=1,Dx=function(e){return!!(e&&e.__CANCEL__)}),Dx}var x3=Rs,Nx=TX,EX=LD(),PX=Z2;function Lx(n){n.cancelToken&&n.cancelToken.throwIfRequested()}var RX=function(e){Lx(e),e.headers=e.headers||{},e.data=Nx.call(e,e.data,e.headers,e.transformRequest),e.headers=x3.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),x3.forEach(["delete","get","head","post","put","patch","common"],function(i){delete e.headers[i]});var t=e.adapter||PX.adapter;return t(e).then(function(i){return Lx(e),i.data=Nx.call(e,i.data,i.headers,e.transformResponse),i},function(i){return EX(i)||(Lx(e),i&&i.response&&(i.response.data=Nx.call(e,i.response.data,i.response.headers,e.transformResponse))),Promise.reject(i)})},Ui=Rs,FD=function(e,t){t=t||{};var r={},i=["url","method","data"],a=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],o=["validateStatus"];function c(h,p){return Ui.isPlainObject(h)&&Ui.isPlainObject(p)?Ui.merge(h,p):Ui.isPlainObject(p)?Ui.merge({},p):Ui.isArray(p)?p.slice():p}function u(h){Ui.isUndefined(t[h])?Ui.isUndefined(e[h])||(r[h]=c(void 0,e[h])):r[h]=c(e[h],t[h])}Ui.forEach(i,function(p){Ui.isUndefined(t[p])||(r[p]=c(void 0,t[p]))}),Ui.forEach(a,u),Ui.forEach(s,function(p){Ui.isUndefined(t[p])?Ui.isUndefined(e[p])||(r[p]=c(void 0,e[p])):r[p]=c(void 0,t[p])}),Ui.forEach(o,function(p){p in t?r[p]=c(e[p],t[p]):p in e&&(r[p]=c(void 0,e[p]))});var l=i.concat(a).concat(s).concat(o),d=Object.keys(e).concat(Object.keys(t)).filter(function(p){return l.indexOf(p)===-1});return Ui.forEach(d,u),r};const AX="0.21.4",IX={version:AX};var $D=IX,eS={};["object","boolean","number","function","string","symbol"].forEach(function(n,e){eS[n]=function(r){return typeof r===n||"a"+(e<1?"n ":" ")+n}});var w3={},OX=$D.version.split(".");function BD(n,e){for(var t=e?e.split("."):OX,r=n.split("."),i=0;i<3;i++){if(t[i]>r[i])return!0;if(t[i]<r[i])return!1}return!1}eS.transitional=function(e,t,r){var i=t&&BD(t);function a(s,o){return"[Axios v"+$D.version+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return function(s,o,c){if(e===!1)throw new Error(a(o," has been removed in "+t));return i&&!w3[o]&&(w3[o]=!0,console.warn(a(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,o,c):!0}};function MX(n,e,t){if(typeof n!="object")throw new TypeError("options must be an object");for(var r=Object.keys(n),i=r.length;i-- >0;){var a=r[i],s=e[a];if(s){var o=n[a],c=o===void 0||s(o,a,n);if(c!==!0)throw new TypeError("option "+a+" must be "+c);continue}if(t!==!0)throw Error("Unknown option "+a)}}var DX={isOlderVersion:BD,assertOptions:MX,validators:eS},UD=Rs,NX=MD,C3=lX,k3=RX,Z_=FD,jD=DX,th=jD.validators;function Zg(n){this.defaults=n,this.interceptors={request:new C3,response:new C3}}Zg.prototype.request=function(e){typeof e=="string"?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=Z_(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;t!==void 0&&jD.assertOptions(t,{silentJSONParsing:th.transitional(th.boolean,"1.0.0"),forcedJSONParsing:th.transitional(th.boolean,"1.0.0"),clarifyTimeoutError:th.transitional(th.boolean,"1.0.0")},!1);var r=[],i=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(e)===!1||(i=i&&h.synchronous,r.unshift(h.fulfilled,h.rejected))});var a=[];this.interceptors.response.forEach(function(h){a.push(h.fulfilled,h.rejected)});var s;if(!i){var o=[k3,void 0];for(Array.prototype.unshift.apply(o,r),o=o.concat(a),s=Promise.resolve(e);o.length;)s=s.then(o.shift(),o.shift());return s}for(var c=e;r.length;){var u=r.shift(),l=r.shift();try{c=u(c)}catch(d){l(d);break}}try{s=k3(c)}catch(d){return Promise.reject(d)}for(;a.length;)s=s.then(a.shift(),a.shift());return s};Zg.prototype.getUri=function(e){return e=Z_(this.defaults,e),NX(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};
32UD.forEach(["delete","get","head","options"],function(e){Zg.prototype[e]=function(t,r){return this.request(Z_(r||{},{method:e,url:t,data:(r||{}).data}))}});UD.forEach(["post","put","patch"],function(e){Zg.prototype[e]=function(t,r,i){return this.request(Z_(i||{},{method:e,url:t,data:r}))}});var LX=Zg,Fx,S3;function qD(){if(S3)return Fx;S3=1;function n(e){this.message=e}return n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,Fx=n,Fx}var $x,T3;function FX(){if(T3)return $x;T3=1;var n=qD();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(s){r=s});var i=this;t(function(s){i.reason||(i.reason=new n(s),r(i.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.source=function(){var r,i=new e(function(s){r=s});return{token:i,cancel:r}},$x=e,$x}var Bx,E3;function $X(){return E3||(E3=1,Bx=function(e){return function(r){return e.apply(null,r)}}),Bx}var Ux,P3;function BX(){return P3||(P3=1,Ux=function(e){return typeof e=="object"&&e.isAxiosError===!0}),Ux}var R3=Rs,UX=AD,ry=LX,jX=FD,qX=Z2;function zD(n){var e=new ry(n),t=UX(ry.prototype.request,e);return R3.extend(t,ry.prototype,e),R3.extend(t,e),t}var rc=zD(qX);rc.Axios=ry;rc.create=function(e){return zD(jX(rc.defaults,e))};rc.Cancel=qD();rc.CancelToken=FX();rc.isCancel=LD();rc.all=function(e){return Promise.all(e)};rc.spread=$X();rc.isAxiosError=BX();X2.exports=rc;X2.exports.default=rc;var zX=X2.exports,WD=zX;const WX=id(WD);var Dp=TypeError;const HX={},VX=Object.freeze(Object.defineProperty({__proto__:null,default:HX},Symbol.toStringTag,{value:"Module"})),GX=mV(VX);var tS=typeof Map=="function"&&Map.prototype,jx=Object.getOwnPropertyDescriptor&&tS?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Hy=tS&&jx&&typeof jx.get=="function"?jx.get:null,A3=tS&&Map.prototype.forEach,nS=typeof Set=="function"&&Set.prototype,qx=Object.getOwnPropertyDescriptor&&nS?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Vy=nS&&qx&&typeof qx.get=="function"?qx.get:null,I3=nS&&Set.prototype.forEach,KX=typeof WeakMap=="function"&&WeakMap.prototype,zm=KX?WeakMap.prototype.has:null,YX=typeof WeakSet=="function"&&WeakSet.prototype,Wm=YX?WeakSet.prototype.has:null,XX=typeof WeakRef=="function"&&WeakRef.prototype,O3=XX?WeakRef.prototype.deref:null,JX=Boolean.prototype.valueOf,QX=Object.prototype.toString,ZX=Function.prototype.toString,eJ=String.prototype.match,rS=String.prototype.slice,El=String.prototype.replace,tJ=String.prototype.toUpperCase,M3=String.prototype.toLowerCase,HD=RegExp.prototype.test,D3=Array.prototype.concat,Ic=Array.prototype.join,nJ=Array.prototype.slice,N3=Math.floor,WC=typeof BigInt=="function"?BigInt.prototype.valueOf:null,zx=Object.getOwnPropertySymbols,HC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ip=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Hm=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ip||!0)?Symbol.toStringTag:null,VD=Object.prototype.propertyIsEnumerable,L3=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function F3(n,e){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||HD.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-N3(-n):N3(n);if(r!==n){var i=String(r),a=rS.call(e,i.length+1);return El.call(i,t,"$&_")+"."+El.call(El.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return El.call(e,t,"$&_")}var VC=GX,$3=VC.custom,B3=YD($3)?$3:null,GD={__proto__:null,double:'"',single:"'"},rJ={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},eb=function n(e,t,r,i){var a=t||{};if(Ou(a,"quoteStyle")&&!Ou(GD,a.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ou(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Ou(a,"customInspect")?a.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
vendor: 34,408 bytes, lines 32-35
32if(Ou(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ou(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return JD(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return o?F3(e,c):c}if(typeof e=="bigint"){var u=String(e)+"n";return o?F3(e,u):u}var l=typeof a.depth>"u"?5:a.depth;if(typeof r>"u"&&(r=0),r>=l&&l>0&&typeof e=="object")return GC(e)?"[Array]":"[Object]";var d=xJ(a,r);if(typeof i>"u")i=[];else if(XD(i,e)>=0)return"[Circular]";function h(B,V,X){if(V&&(i=nJ.call(i),i.push(V)),X){var ne={depth:a.depth};return Ou(a,"quoteStyle")&&(ne.quoteStyle=a.quoteStyle),n(B,ne,r+1,i)}return n(B,a,r+1,i)}if(typeof e=="function"&&!U3(e)){var p=fJ(e),g=w0(e,h);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(g.length>0?" { "+Ic.call(g,", ")+" }":"")}if(YD(e)){var v=ip?El.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):HC.call(e);return typeof e=="object"&&!ip?gm(v):v}if(yJ(e)){for(var y="<"+M3.call(String(e.nodeName)),b=e.attributes||[],x=0;x<b.length;x++)y+=" "+b[x].name+"="+KD(iJ(b[x].value),"double",a);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+M3.call(String(e.nodeName))+">",y}if(GC(e)){if(e.length===0)return"[]";var S=w0(e,h);return d&&!bJ(S)?"["+KC(S,d)+"]":"[ "+Ic.call(S,", ")+" ]"}if(sJ(e)){var w=w0(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!VD.call(e,"cause")?"{ ["+String(e)+"] "+Ic.call(D3.call("[cause]: "+h(e.cause),w),", ")+" }":w.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Ic.call(w,", ")+" }"}if(typeof e=="object"&&s){if(B3&&typeof e[B3]=="function"&&VC)return VC(e,{depth:l-r});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(hJ(e)){var k=[];return A3&&A3.call(e,function(B,V){k.push(h(V,e,!0)+" => "+h(B,e))}),j3("Map",Hy.call(e),k,d)}if(gJ(e)){var E=[];return I3&&I3.call(e,function(B){E.push(h(B,e))}),j3("Set",Vy.call(e),E,d)}if(pJ(e))return Wx("WeakMap");if(vJ(e))return Wx("WeakSet");if(mJ(e))return Wx("WeakRef");if(cJ(e))return gm(h(Number(e)));if(lJ(e))return gm(h(WC.call(e)));if(uJ(e))return gm(JX.call(e));if(oJ(e))return gm(h(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof Fr<"u"&&e===Fr)return"{ [object globalThis] }";if(!aJ(e)&&!U3(e)){var I=w0(e,h),P=L3?L3(e)===Object.prototype:e instanceof Object||e.constructor===Object,A=e instanceof Object?"":"null prototype",N=!P&&Hm&&Object(e)===e&&Hm in e?rS.call(sd(e),8,-1):A?"Object":"",j=P||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",L=j+(N||A?"["+Ic.call(D3.call([],N||[],A||[]),": ")+"] ":"");return I.length===0?L+"{}":d?L+"{"+KC(I,d)+"}":L+"{ "+Ic.call(I,", ")+" }"}return String(e)};function KD(n,e,t){var r=t.quoteStyle||e,i=GD[r];return i+n+i}function iJ(n){return El.call(String(n),/"/g,""")}function Ef(n){return!Hm||!(typeof n=="object"&&(Hm in n||typeof n[Hm]<"u"))}function GC(n){return sd(n)==="[object Array]"&&Ef(n)}function aJ(n){return sd(n)==="[object Date]"&&Ef(n)}function U3(n){return sd(n)==="[object RegExp]"&&Ef(n)}function sJ(n){return sd(n)==="[object Error]"&&Ef(n)}function oJ(n){return sd(n)==="[object String]"&&Ef(n)}function cJ(n){return sd(n)==="[object Number]"&&Ef(n)}function uJ(n){return sd(n)==="[object Boolean]"&&Ef(n)}function YD(n){if(ip)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!HC)return!1;try{return HC.call(n),!0}catch{}return!1}function lJ(n){if(!n||typeof n!="object"||!WC)return!1;try{return WC.call(n),!0}catch{}return!1}var dJ=Object.prototype.hasOwnProperty||function(n){return n in this};function Ou(n,e){return dJ.call(n,e)}function sd(n){return QX.call(n)}function fJ(n){if(n.name)return n.name;var e=eJ.call(ZX.call(n),/^function\s*([\w$]+)/);return e?e[1]:null}function XD(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function hJ(n){if(!Hy||!n||typeof n!="object")return!1;try{Hy.call(n);try{Vy.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function pJ(n){if(!zm||!n||typeof n!="object")return!1;try{zm.call(n,zm);try{Wm.call(n,Wm)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function mJ(n){if(!O3||!n||typeof n!="object")return!1;try{return O3.call(n),!0}catch{}return!1}function gJ(n){if(!Vy||!n||typeof n!="object")return!1;try{Vy.call(n);try{Hy.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function vJ(n){if(!Wm||!n||typeof n!="object")return!1;try{Wm.call(n,Wm);try{zm.call(n,zm)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function yJ(n){return!n||typeof n!="object"?!1:typeof HTMLElement<"u"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function JD(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return JD(rS.call(n,0,e.maxStringLength),e)+r}var i=rJ[e.quoteStyle||"single"];i.lastIndex=0;var a=El.call(El.call(n,i,"\\$1"),/[\x00-\x1f]/g,_J);return KD(a,"single",e)}function _J(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+tJ.call(e.toString(16))}function gm(n){return"Object("+n+")"}function Wx(n){return n+" { ? }"}function j3(n,e,t,r){var i=r?KC(t,r):Ic.call(t,", ");return n+" ("+e+") {"+i+"}"}function bJ(n){for(var e=0;e<n.length;e++)if(XD(n[e],` 33`)>=0)return!1;return!0}function xJ(n,e){var t;if(n.indent===" ")t=" ";else if(typeof n.indent=="number"&&n.indent>0)t=Ic.call(Array(n.indent+1)," ");else return null;return{base:t,prev:Ic.call(Array(e+1),t)}}function KC(n,e){if(n.length===0)return"";var t=` 34`+e.prev+e.base;return t+Ic.call(n,","+t)+` 35`+e.prev}function w0(n,e){var t=GC(n),r=[];if(t){r.length=n.length;for(var i=0;i<n.length;i++)r[i]=Ou(n,i)?e(n[i],n):""}var a=typeof zx=="function"?zx(n):[],s;if(ip){s={};for(var o=0;o<a.length;o++)s["$"+a[o]]=a[o]}for(var c in n)Ou(n,c)&&(t&&String(Number(c))===c&&c<n.length||ip&&s["$"+c]instanceof Symbol||(HD.call(/[^\w$]/,c)?r.push(e(c,n)+": "+e(n[c],n)):r.push(c+": "+e(n[c],n))));if(typeof zx=="function")for(var u=0;u<a.length;u++)VD.call(n,a[u])&&r.push("["+e(a[u])+"]: "+e(n[a[u]],n));return r}var wJ=eb,CJ=Dp,tb=function(n,e,t){for(var r=n,i;(i=r.next)!=null;r=i)if(i.key===e)return r.next=i.next,t||(i.next=n.next,n.next=i),i},kJ=function(n,e){if(n){var t=tb(n,e);return t&&t.value}},SJ=function(n,e,t){var r=tb(n,e);r?r.value=t:n.next={key:e,next:n.next,value:t}},TJ=function(n,e){return n?!!tb(n,e):!1},EJ=function(n,e){if(n)return tb(n,e,!0)},PJ=function(){var e,t={assert:function(r){if(!t.has(r))throw new CJ("Side channel does not contain "+wJ(r))},delete:function(r){var i=e&&e.next,a=EJ(e,r);return a&&i&&i===a&&(e=void 0),!!a},get:function(r){return kJ(e,r)},has:function(r){return TJ(e,r)},set:function(r,i){e||(e={next:void 0}),SJ(e,r,i)}};return t},QD=Object,RJ=Error,AJ=EvalError,IJ=RangeError,OJ=ReferenceError,MJ=SyntaxError,DJ=URIError,NJ=Math.abs,LJ=Math.floor,FJ=Math.max,$J=Math.min,BJ=Math.pow,UJ=Math.round,jJ=Number.isNaN||function(e){return e!==e},qJ=jJ,zJ=function(e){return qJ(e)||e===0?e:e<0?-1:1},WJ=Object.getOwnPropertyDescriptor,iy=WJ;if(iy)try{iy([],"length")}catch{iy=null}var ZD=iy,ay=Object.defineProperty||!1;if(ay)try{ay({},"a",{value:1})}catch{ay=!1}var HJ=ay,Hx,q3;function VJ(){return q3||(q3=1,Hx=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==i||o.enumerable!==!0)return!1}return!0}),Hx}var Vx,z3;function GJ(){if(z3)return Vx;z3=1;var n=typeof Symbol<"u"&&Symbol,e=VJ();return Vx=function(){return typeof n!="function"||typeof Symbol!="function"||typeof n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Vx}var Gx,W3;function e5(){return W3||(W3=1,Gx=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Gx}var Kx,H3;function t5(){if(H3)return Kx;H3=1;var n=QD;return Kx=n.getPrototypeOf||null,Kx}var Yx,V3;function KJ(){if(V3)return Yx;V3=1;var n="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,r="[object Function]",i=function(c,u){for(var l=[],d=0;d<c.length;d+=1)l[d]=c[d];for(var h=0;h<u.length;h+=1)l[h+c.length]=u[h];return l},a=function(c,u){for(var l=[],d=u,h=0;d<c.length;d+=1,h+=1)l[h]=c[d];return l},s=function(o,c){for(var u="",l=0;l<o.length;l+=1)u+=o[l],l+1<o.length&&(u+=c);return u};return Yx=function(c){var u=this;if(typeof u!="function"||e.apply(u)!==r)throw new TypeError(n+u);for(var l=a(arguments,1),d,h=function(){if(this instanceof d){var b=u.apply(this,i(l,arguments));return Object(b)===b?b:this}return u.apply(c,i(l,arguments))},p=t(0,u.length-l.length),g=[],v=0;v<p;v++)g[v]="$"+v;if(d=Function("binder","return function ("+s(g,",")+"){ return binder.apply(this,arguments); }")(h),u.prototype){var y=function(){};y.prototype=u.prototype,d.prototype=new y,y.prototype=null}return d},Yx}var Xx,G3;function nb(){if(G3)return Xx;G3=1;var n=KJ();return Xx=Function.prototype.bind||n,Xx}var Jx,K3;function iS(){return K3||(K3=1,Jx=Function.prototype.call),Jx}var Qx,Y3;function n5(){return Y3||(Y3=1,Qx=Function.prototype.apply),Qx}var YJ=typeof Reflect<"u"&&Reflect&&Reflect.apply,XJ=nb(),JJ=n5(),QJ=iS(),ZJ=YJ,eQ=ZJ||XJ.call(QJ,JJ),tQ=nb(),nQ=Dp,rQ=iS(),iQ=eQ,r5=function(e){if(e.length<1||typeof e[0]!="function")throw new nQ("a function is required");return iQ(tQ,rQ,e)},Zx,X3;function aQ(){if(X3)return Zx;X3=1;var n=r5,e=ZD,t;try{t=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var r=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return Zx=r&&typeof r.get=="function"?n([r.get]):typeof a=="function"?function(o){return a(o==null?o:i(o))}:!1,Zx}var ew,J3;function sQ(){if(J3)return ew;J3=1;var n=e5(),e=t5(),t=aQ();return ew=n?function(i){return n(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,ew}var tw,Q3;function oQ(){if(Q3)return tw;Q3=1;var n=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=nb();return tw=t.call(n,e),tw}var Zt,cQ=QD,uQ=RJ,lQ=AJ,dQ=IJ,fQ=OJ,ap=MJ,Dh=Dp,hQ=DJ,pQ=NJ,mQ=LJ,gQ=FJ,vQ=$J,yQ=BJ,_Q=UJ,bQ=zJ,i5=Function,nw=function(n){try{return i5('"use strict"; return ('+n+").constructor;")()}catch{}},yg=ZD,xQ=HJ,rw=function(){throw new Dh},wQ=yg?function(){try{return arguments.callee,rw}catch{try{return yg(arguments,"callee").get}catch{return rw}}}():rw,nh=GJ()(),fi=sQ(),CQ=t5(),kQ=e5(),a5=n5(),ev=iS(),gh={},SQ=typeof Uint8Array>"u"||!fi?Zt:fi(Uint8Array),ef={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Zt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Zt:ArrayBuffer,"%ArrayIteratorPrototype%":nh&&fi?fi([][Symbol.iterator]()):Zt,"%AsyncFromSyncIteratorPrototype%":Zt,"%AsyncFunction%":gh,"%AsyncGenerator%":gh,"%AsyncGeneratorFunction%":gh,"%AsyncIteratorPrototype%":gh,"%Atomics%":typeof Atomics>"u"?Zt:Atomics,"%BigInt%":typeof BigInt>"u"?Zt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Zt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Zt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Zt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":uQ,"%eval%":eval,"%EvalError%":lQ,"%Float16Array%":typeof Float16Array>"u"?Zt:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Zt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Zt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Zt:FinalizationRegistry,"%Function%":i5,"%GeneratorFunction%":gh,"%Int8Array%":typeof Int8Array>"u"?Zt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Zt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Zt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nh&&fi?fi(fi([][Symbol.iterator]())):Zt,"%JSON%":typeof JSON=="object"?JSON:Zt,"%Map%":typeof Map>"u"?Zt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!nh||!fi?Zt:fi(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":cQ,"%Object.getOwnPropertyDescriptor%":yg,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Zt:Promise,"%Proxy%":typeof Proxy>"u"?Zt:Proxy,"%RangeError%":dQ,"%ReferenceError%":fQ,"%Reflect%":typeof Reflect>"u"?Zt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Zt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!nh||!fi?Zt:fi(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Zt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nh&&fi?fi(""[Symbol.iterator]()):Zt,"%Symbol%":nh?Symbol:Zt,"%SyntaxError%":ap,"%ThrowTypeError%":wQ,"%TypedArray%":SQ,"%TypeError%":Dh,"%Uint8Array%":typeof Uint8Array>"u"?Zt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Zt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Zt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Zt:Uint32Array,"%URIError%":hQ,"%WeakMap%":typeof WeakMap>"u"?Zt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Zt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Zt:WeakSet,"%Function.prototype.call%":ev,"%Function.prototype.apply%":a5,"%Object.defineProperty%":xQ,"%Object.getPrototypeOf%":CQ,"%Math.abs%":pQ,"%Math.floor%":mQ,"%Math.max%":gQ,"%Math.min%":vQ,"%Math.pow%":yQ,"%Math.round%":_Q,"%Math.sign%":bQ,"%Reflect.getPrototypeOf%":kQ};if(fi)try{null.error}catch(n){var TQ=fi(fi(n));ef["%Error.prototype%"]=TQ}var EQ=function n(e){var t;if(e==="%AsyncFunction%")t=nw("async function () {}");else if(e==="%GeneratorFunction%")t=nw("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=nw("async function* () {}");else if(e==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&fi&&(t=fi(i.prototype))}return ef[e]=t,t},Z3={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},tv=nb(),Gy=oQ(),PQ=tv.call(ev,Array.prototype.concat),RQ=tv.call(a5,Array.prototype.splice),e4=tv.call(ev,String.prototype.replace),Ky=tv.call(ev,String.prototype.slice),AQ=tv.call(ev,RegExp.prototype.exec),IQ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,OQ=/\\(\\)?/g,MQ=function(e){var t=Ky(e,0,1),r=Ky(e,-1);if(t==="%"&&r!=="%")throw new ap("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&t!=="%")throw new ap("invalid intrinsic syntax, expected opening `%`");var i=[];return e4(e,IQ,function(a,s,o,c){i[i.length]=o?e4(c,OQ,"$1"):s||a}),i},DQ=function(e,t){var r=e,i;if(Gy(Z3,r)&&(i=Z3[r],r="%"+i[0]+"%"),Gy(ef,r)){var a=ef[r];if(a===gh&&(a=EQ(r)),typeof a>"u"&&!t)throw new Dh("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:a}}throw new ap("intrinsic "+e+" does not exist!")},aS=function(e,t){if(typeof e!="string"||e.length===0)throw new Dh("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Dh('"allowMissing" argument must be a boolean');if(AQ(/^%?[^%]*%?$/,e)===null)throw new ap("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=MQ(e),i=r.length>0?r[0]:"",a=DQ("%"+i+"%",t),s=a.name,o=a.value,c=!1,u=a.alias;u&&(i=u[0],RQ(r,PQ([0,1],u)));for(var l=1,d=!0;l<r.length;l+=1){var h=r[l],p=Ky(h,0,1),g=Ky(h,-1);if((p==='"'||p==="'"||p==="`"||g==='"'||g==="'"||g==="`")&&p!==g)throw new ap("property names with quotes must have matching quotes");if((h==="constructor"||!d)&&(c=!0),i+="."+h,s="%"+i+"%",Gy(ef,s))o=ef[s];else if(o!=null){if(!(h in o)){if(!t)throw new Dh("base intrinsic for "+e+" exists, but the property is not available.");return}if(yg&&l+1>=r.length){var v=yg(o,h);d=!!v,d&&"get"in v&&!("originalValue"in v.get)?o=v.get:o=o[h]}else d=Gy(o,h),o=o[h];d&&!c&&(ef[s]=o)}}return o},s5=aS,o5=r5,NQ=o5([s5("%String.prototype.indexOf%")]),c5=function(e,t){var r=s5(e,!!t);return typeof r=="function"&&NQ(e,".prototype.")>-1?o5([r]):r},LQ=aS,nv=c5,FQ=eb,$Q=Dp,t4=LQ("%Map%",!0),BQ=nv("Map.prototype.get",!0),UQ=nv("Map.prototype.set",!0),jQ=nv("Map.prototype.has",!0),qQ=nv("Map.prototype.delete",!0),zQ=nv("Map.prototype.size",!0),u5=!!t4&&function(){var e,t={assert:function(r){if(!t.has(r))throw new $Q("Side channel does not contain "+FQ(r))},delete:function(r){if(e){var i=qQ(e,r);return zQ(e)===0&&(e=void 0),i}return!1},get:function(r){if(e)return BQ(e,r)},has:function(r){return e?jQ(e,r):!1},set:function(r,i){e||(e=new t4),UQ(e,r,i)}};return t},WQ=aS,rb=c5,HQ=eb,C0=u5,VQ=Dp,rh=WQ("%WeakMap%",!0),GQ=rb("WeakMap.prototype.get",!0),KQ=rb("WeakMap.prototype.set",!0),YQ=rb("WeakMap.prototype.has",!0),XQ=rb("WeakMap.prototype.delete",!0),JQ=rh?function(){var e,t,r={assert:function(i){if(!r.has(i))throw new VQ("Side channel does not contain "+HQ(i))},delete:function(i){if(rh&&i&&(typeof i=="object"||typeof i=="function")){if(e)return XQ(e,i)}else if(C0&&t)return t.delete(i);return!1},get:function(i){return rh&&i&&(typeof i=="object"||typeof i=="function")&&e?GQ(e,i):t&&t.get(i)},has:function(i){return rh&&i&&(typeof i=="object"||typeof i=="function")&&e?YQ(e,i):!!t&&t.has(i)},set:function(i,a){rh&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new rh),KQ(e,i,a)):C0&&(t||(t=C0()),t.set(i,a))}};return r}:C0,QQ=Dp,ZQ=eb,eZ=PJ,tZ=u5,nZ=JQ,rZ=nZ||tZ||eZ,l5=function(){var e,t={assert:function(r){if(!t.has(r))throw new QQ("Side channel does not contain "+ZQ(r))},delete:function(r){return!!e&&e.delete(r)},get:function(r){return e&&e.get(r)},has:function(r){return!!e&&e.has(r)},set:function(r,i){e||(e=rZ()),e.set(r,i)}};return t},iZ=String.prototype.replace,aZ=/%20/g,iw={RFC1738:"RFC1738",RFC3986:"RFC3986"},sS={default:iw.RFC3986,formatters:{RFC1738:function(n){return iZ.call(n,aZ,"+")},RFC3986:function(n){return String(n)}},RFC1738:iw.RFC1738,RFC3986:iw.RFC3986},sZ=sS,oZ=l5,aw=Object.prototype.hasOwnProperty,Fd=Array.isArray,ib=oZ(),Sh=function(e,t){return ib.set(e,t),e},$d=function(e){return ib.has(e)},Nm=function(e){return ib.get(e)},YC=function(e,t){ib.set(e,t)},Cc=function(){for(var n=[],e=0;e<256;++e)n[n.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return n}(),cZ=function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(Fd(r)){for(var i=[],a=0;a<r.length;++a)typeof r[a]<"u"&&(i[i.length]=r[a]);t.obj[t.prop]=i}}},Vm=function(e,t){for(var r=t&&t.plainObjects?{__proto__:null}:{},i=0;i<e.length;++i)typeof e[i]<"u"&&(r[i]=e[i]);return r},uZ=function n(e,t,r){if(!t)return e;if(typeof t!="object"&&typeof t!="function"){if(Fd(e)){var i=e.length;if(r&&typeof r.arrayLimit=="number"&&i>r.arrayLimit)return Sh(Vm(e.concat(t),r),i);e[i]=t}else if(e&&typeof e=="object")if($d(e)){var a=Nm(e)+1;e[a]=t,YC(e,a)}else{if(r&&r.strictMerge)return[e,t];(r&&(r.plainObjects||r.allowPrototypes)||!aw.call(Object.prototype,t))&&(e[t]=!0)}else return[e,t];return e}if(!e||typeof e!="object"){if($d(t)){for(var s=Object.keys(t),o=r&&r.plainObjects?{__proto__:null,0:e}:{0:e},c=0;c<s.length;c++){var u=parseInt(s[c],10);o[u+1]=t[s[c]]}return Sh(o,Nm(t)+1)}var l=[e].concat(t);return r&&typeof r.arrayLimit=="number"&&l.length>r.arrayLimit?Sh(Vm(l,r),l.length-1):l}var d=e;return Fd(e)&&!Fd(t)&&(d=Vm(e,r)),Fd(e)&&Fd(t)?(t.forEach(function(h,p){if(aw.call(e,p)){var g=e[p];g&&typeof g=="object"&&h&&typeof h=="object"?e[p]=n(g,h,r):e[e.length]=h}else e[p]=h}),e):Object.keys(t).reduce(function(h,p){var g=t[p];if(aw.call(h,p)?h[p]=n(h[p],g,r):h[p]=g,$d(t)&&!$d(h)&&Sh(h,Nm(t)),$d(h)){var v=parseInt(p,10);String(v)===p&&v>=0&&v>Nm(h)&&YC(h,v)}return h},d)},lZ=function(e,t){return Object.keys(t).reduce(function(r,i){return r[i]=t[i],r},e)},dZ=function(n,e,t){var r=n.replace(/\+/g," ");if(t==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},sw=1024,fZ=function(e,t,r,i,a){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),r==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(p){return"%26%23"+parseInt(p.slice(2),16)+"%3B"});for(var o="",c=0;c<s.length;c+=sw){for(var u=s.length>=sw?s.slice(c,c+sw):s,l=[],d=0;d<u.length;++d){var h=u.charCodeAt(d);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||a===sZ.RFC1738&&(h===40||h===41)){l[l.length]=u.charAt(d);continue}if(h<128){l[l.length]=Cc[h];continue}if(h<2048){l[l.length]=Cc[192|h>>6]+Cc[128|h&63];continue}if(h<55296||h>=57344){l[l.length]=Cc[224|h>>12]+Cc[128|h>>6&63]+Cc[128|h&63];continue}d+=1,h=65536+((h&1023)<<10|u.charCodeAt(d)&1023),l[l.length]=Cc[240|h>>18]+Cc[128|h>>12&63]+Cc[128|h>>6&63]+Cc[128|h&63]}o+=l.join("")}return o},hZ=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],i=0;i<t.length;++i)for(var a=t[i],s=a.obj[a.prop],o=Object.keys(s),c=0;c<o.length;++c){var u=o[c],l=s[u];typeof l=="object"&&l!==null&&r.indexOf(l)===-1&&(t[t.length]={obj:s,prop:u},r[r.length]=l)}return cZ(t),e},pZ=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},mZ=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},gZ=function(e,t,r,i){if($d(e)){var a=Nm(e)+1;return e[a]=t,YC(e,a),e}var s=[].concat(e,t);return s.length>r?Sh(Vm(s,{plainObjects:i}),s.length-1):s},vZ=function(e,t){if(Fd(e)){for(var r=[],i=0;i<e.length;i+=1)r[r.length]=t(e[i]);return r}return t(e)},d5={arrayToObject:Vm,assign:lZ,combine:gZ,compact:hZ,decode:dZ,encode:fZ,isBuffer:mZ,isOverflow:$d,isRegExp:pZ,markOverflow:Sh,maybeMap:vZ,merge:uZ},f5=l5,sy=d5,Gm=sS,yZ=Object.prototype.hasOwnProperty,h5={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},Pc=Array.isArray,_Z=Array.prototype.push,p5=function(n,e){_Z.apply(n,Pc(e)?e:[e])},bZ=Date.prototype.toISOString,n4=Gm.default,ei={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:sy.encode,encodeValuesOnly:!1,filter:void 0,format:n4,formatter:Gm.formatters[n4],indices:!1,serializeDate:function(e){return bZ.call(e)},skipNulls:!1,strictNullHandling:!1},xZ=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},ow={},wZ=function n(e,t,r,i,a,s,o,c,u,l,d,h,p,g,v,y,b,x){for(var S=e,w=x,k=0,E=!1;(w=w.get(ow))!==void 0&&!E;){var I=w.get(e);if(k+=1,typeof I<"u"){if(I===k)throw new RangeError("Cyclic object value");E=!0}typeof w.get(ow)>"u"&&(k=0)}if(typeof l=="function"?S=l(t,S):S instanceof Date?S=p(S):r==="comma"&&Pc(S)&&(S=sy.maybeMap(S,function(ue){return ue instanceof Date?p(ue):ue})),S===null){if(s)return v(u&&!y?u(t,ei.encoder,b,"key",g):t);S=""}if(xZ(S)||sy.isBuffer(S)){if(u){var P=y?t:u(t,ei.encoder,b,"key",g);return[v(P)+"="+v(u(S,ei.encoder,b,"value",g))]}return[v(t)+"="+v(String(S))]}var A=[];if(typeof S>"u")return A;var N;if(r==="comma"&&Pc(S))y&&u&&(S=sy.maybeMap(S,function(ue){return ue==null?ue:u(ue)})),N=[{value:S.length>0?S.join(",")||null:void 0}];else if(Pc(l))N=l;else{var j=Object.keys(S);N=d?j.sort(d):j}var L=c?String(t).replace(/\./g,"%2E"):String(t),B=i&&Pc(S)&&S.length===1?L+"[]":L;if(a&&Pc(S)&&S.length===0)return B+"[]";for(var V=0;V<N.length;++V){var X=N[V],ne=typeof X=="object"&&X&&typeof X.value<"u"?X.value:S[X];if(!(o&&ne===null)){var se=h&&c?String(X).replace(/\./g,"%2E"):String(X),ie=Pc(S)?typeof r=="function"?r(B,se):B:B+(h?"."+se:"["+se+"]");x.set(e,k);var de=f5();de.set(ow,x),p5(A,n(ne,ie,r,i,a,s,o,c,r==="comma"&&y&&Pc(S)?null:u,l,d,h,p,g,v,y,b,de))}}return A},CZ=function(e){if(!e)return ei;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||ei.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Gm.default;if(typeof e.format<"u"){if(!yZ.call(Gm.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=Gm.formatters[r],a=ei.filter;(typeof e.filter=="function"||Pc(e.filter))&&(a=e.filter);var s;if(e.arrayFormat in h5?s=e.arrayFormat:"indices"in e?s=e.indices?"indices":"repeat":s=ei.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var o=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:ei.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:ei.addQueryPrefix,allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:ei.allowEmptyArrays,arrayFormat:s,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ei.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?ei.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:ei.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:ei.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:ei.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:ei.encodeValuesOnly,filter:a,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:ei.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:ei.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ei.strictNullHandling}},kZ=function(n,e){var t=n,r=CZ(e),i,a;typeof r.filter=="function"?(a=r.filter,t=a("",t)):Pc(r.filter)&&(a=r.filter,i=a);var s=[];if(typeof t!="object"||t===null)return"";var o=h5[r.arrayFormat],c=o==="comma"&&r.commaRoundTrip;i||(i=Object.keys(t)),r.sort&&i.sort(r.sort);for(var u=f5(),l=0;l<i.length;++l){var d=i[l];if(!(typeof d>"u"||d===null)){var h=t[d];r.skipNulls&&h===null||p5(s,wZ(h,d,o,c,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,u))}}var p=s.join(r.delimiter),g=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?g+="utf8=%26%2310003%3B"+r.delimiter:g+="utf8=%E2%9C%93"+r.delimiter),p.length>0?g+p:""},Hc=d5,oy=Object.prototype.hasOwnProperty,cw=Array.isArray,lr={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Hc.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},SZ=function(n){return n.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},m5=function(n,e,t){if(n&&typeof n=="string"&&e.comma&&n.indexOf(",")>-1)return n.split(",");if(e.throwOnLimitExceeded&&t>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return n},TZ="utf8=%26%2310003%3B",EZ="utf8=%E2%9C%93",PZ=function(e,t){var r={__proto__:null},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,s=i.split(t.delimiter,t.throwOnLimitExceeded&&typeof a<"u"?a+1:a);if(t.throwOnLimitExceeded&&typeof a<"u"&&s.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(a===1?"":"s")+" allowed.");var o=-1,c,u=t.charset;if(t.charsetSentinel)for(c=0;c<s.length;++c)s[c].indexOf("utf8=")===0&&(s[c]===EZ?u="utf-8":s[c]===TZ&&(u="iso-8859-1"),o=c,c=s.length);for(c=0;c<s.length;++c)if(c!==o){var l=s[c],d=l.indexOf("]="),h=d===-1?l.indexOf("="):d+1,p,g;if(h===-1?(p=t.decoder(l,lr.decoder,u,"key"),g=t.strictNullHandling?null:""):(p=t.decoder(l.slice(0,h),lr.decoder,u,"key"),p!==null&&(g=Hc.maybeMap(m5(l.slice(h+1),t,cw(r[p])?r[p].length:0),function(y){return t.decoder(y,lr.decoder,u,"value")}))),g&&t.interpretNumericEntities&&u==="iso-8859-1"&&(g=SZ(String(g))),l.indexOf("[]=")>-1&&(g=cw(g)?[g]:g),t.comma&&cw(g)&&g.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");g=Hc.combine([],g,t.arrayLimit,t.plainObjects)}if(p!==null){var v=oy.call(r,p);v&&(t.duplicates==="combine"||l.indexOf("[]=")>-1)?r[p]=Hc.combine(r[p],g,t.arrayLimit,t.plainObjects):(!v||t.duplicates==="last")&&(r[p]=g)}}return r},RZ=function(n,e,t,r){var i=0;if(n.length>0&&n[n.length-1]==="[]"){var a=n.slice(0,-1).join("");i=Array.isArray(e)&&e[a]?e[a].length:0}for(var s=r?e:m5(e,t,i),o=n.length-1;o>=0;--o){var c,u=n[o];if(u==="[]"&&t.parseArrays)Hc.isOverflow(s)?c=s:c=t.allowEmptyArrays&&(s===""||t.strictNullHandling&&s===null)?[]:Hc.combine([],s,t.arrayLimit,t.plainObjects);else{c=t.plainObjects?{__proto__:null}:{};var l=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,d=t.decodeDotInKeys?l.replace(/%2E/g,"."):l,h=parseInt(d,10),p=!isNaN(h)&&u!==d&&String(h)===d&&h>=0&&t.parseArrays;if(!t.parseArrays&&d==="")c={0:s};else if(p&&h<t.arrayLimit)c=[],c[h]=s;else{if(p&&t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");p?(c[h]=s,Hc.markOverflow(c,h)):d!=="__proto__"&&(c[d]=s)}}s=c}return s},AZ=function(e,t){var r=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(t.depth<=0)return!t.plainObjects&&oy.call(Object.prototype,r)&&!t.allowPrototypes?void 0:[r];var i=[],a=r.indexOf("["),s=a>=0?r.slice(0,a):r;if(s){if(!t.plainObjects&&oy.call(Object.prototype,s)&&!t.allowPrototypes)return;i[i.length]=s}for(var o=r.length,c=a,u=0;c>=0&&u<t.depth;){for(var l=1,d=c+1,h=-1;d<o&&h<0;){var p=r.charCodeAt(d);p===91?l+=1:p===93&&(l-=1,l===0&&(h=d)),d+=1}if(h<0)return i[i.length]="["+r.slice(c)+"]",i;var g=r.slice(c,h+1),v=g.slice(1,-1);if(!t.plainObjects&&oy.call(Object.prototype,v)&&!t.allowPrototypes)return;i[i.length]=g,u+=1,c=r.indexOf("[",h+1)}if(c>=0){if(t.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+t.depth+" and strictDepth is true");i[i.length]="["+r.slice(c)+"]"}return i},IZ=function(e,t,r,i){if(e){var a=AZ(e,r);if(a)return RZ(a,t,r,i)}},OZ=function(e){if(!e)return lr;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
35if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=typeof e.charset>"u"?lr.charset:e.charset,r=typeof e.duplicates>"u"?lr.duplicates:e.duplicates;if(r!=="combine"&&r!=="first"&&r!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var i=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:lr.allowDots:!!e.allowDots;return{allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:lr.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:lr.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:lr.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:lr.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:lr.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:lr.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:lr.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:lr.decoder,delimiter:typeof e.delimiter=="string"||Hc.isRegExp(e.delimiter)?e.delimiter:lr.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:lr.depth,duplicates:r,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:lr.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:lr.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:lr.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:lr.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:lr.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:lr.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},MZ=function(n,e){var t=OZ(e);if(n===""||n===null||typeof n>"u")return t.plainObjects?{__proto__:null}:{};for(var r=typeof n=="string"?PZ(n,t):n,i=t.plainObjects?{__proto__:null}:{},a=Object.keys(r),s=0;s<a.length;++s){var o=a[s],c=IZ(o,r[o],t,typeof n=="string");i=Hc.merge(i,c,t)}return t.allowSparse===!0?i:Hc.compact(i)},DZ=kZ,NZ=MZ,LZ=sS,FZ={formats:LZ,parse:NZ,stringify:DZ},$Z=function(e){return BZ(e)&&!UZ(e)};function BZ(n){return!!n&&typeof n=="object"}function UZ(n){var e=Object.prototype.toString.call(n);return e==="[object RegExp]"||e==="[object Date]"||zZ(n)}var jZ=typeof Symbol=="function"&&Symbol.for,qZ=jZ?Symbol.for("react.element"):60103;function zZ(n){return n.$$typeof===qZ}function WZ(n){return Array.isArray(n)?[]:{}}function _g(n,e){return e.clone!==!1&&e.isMergeableObject(n)?sp(WZ(n),n,e):n}function HZ(n,e,t){return n.concat(e).map(function(r){return _g(r,t)})}function VZ(n,e){if(!e.customMerge)return sp;var t=e.customMerge(n);return typeof t=="function"?t:sp}function GZ(n){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(n).filter(function(e){return Object.propertyIsEnumerable.call(n,e)}):[]}function r4(n){return Object.keys(n).concat(GZ(n))}function g5(n,e){try{return e in n}catch{return!1}}function KZ(n,e){return g5(n,e)&&!(Object.hasOwnProperty.call(n,e)&&Object.propertyIsEnumerable.call(n,e))}function YZ(n,e,t){var r={};return t.isMergeableObject(n)&&r4(n).forEach(function(i){r[i]=_g(n[i],t)}),r4(e).forEach(function(i){KZ(n,i)||(g5(n,i)&&t.isMergeableObject(e[i])?r[i]=VZ(i,t)(n[i],e[i],t):r[i]=_g(e[i],t))}),r}function sp(n,e,t){t=t||{},t.arrayMerge=t.arrayMerge||HZ,t.isMergeableObject=t.isMergeableObject||$Z,t.cloneUnlessOtherwiseSpecified=_g;var r=Array.isArray(e),i=Array.isArray(n),a=r===i;return a?r?t.arrayMerge(n,e,t):YZ(n,e,t):_g(e,t)}sp.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,i){return sp(r,i,t)},{})};var XZ=sp,JZ=XZ;(function(n){function e(E){return E&&typeof E=="object"&&"default"in E?E.default:E}
35var t=e(WD),r=FZ,i=e(JZ);function a(){return(a=Object.assign?Object.assign.bind():function(E){for(var I=1;I<arguments.length;I++){var P=arguments[I];for(var A in P)Object.prototype.hasOwnProperty.call(P,A)&&(E[A]=P[A])}return E}).apply(this,arguments)}var s,o={modal:null,listener:null,show:function(E){var I=this;typeof E=="object"&&(E="All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.<hr>"+JSON.stringify(E));var P=document.createElement("html");P.innerHTML=E,P.querySelectorAll("a").forEach(function(N){return N.setAttribute("target","_top")}),this.modal=document.createElement("div"),this.modal.style.position="fixed",this.modal.style.width="100vw",this.modal.style.height="100vh",this.modal.style.padding="50px",this.modal.style.boxSizing="border-box",this.modal.style.backgroundColor="rgba(0, 0, 0, .6)",this.modal.style.zIndex=2e5,this.modal.addEventListener("click",function(){return I.hide()});var A=document.createElement("iframe");if(A.style.backgroundColor="white",A.style.borderRadius="5px",A.style.width="100%",A.style.height="100%",this.modal.appendChild(A),document.body.prepend(this.modal),document.body.style.overflow="hidden",!A.contentWindow)throw new Error("iframe not yet ready.");A.contentWindow.document.open(),A.contentWindow.document.write(P.outerHTML),A.contentWindow.document.close(),this.listener=this.hideOnEscape.bind(this),document.addEventListener("keydown",this.listener)},hide:function(){this.modal.outerHTML="",this.modal=null,document.body.style.overflow="visible",document.removeEventListener("keydown",this.listener)},hideOnEscape:function(E){E.keyCode===27&&this.hide()}};function c(E,I){var P;return function(){var A=arguments,N=this;clearTimeout(P),P=setTimeout(function(){return E.apply(N,[].slice.call(A))},I)}}function u(E,I,P){for(var A in I===void 0&&(I=new FormData),P===void 0&&(P=null),E=E||{})Object.prototype.hasOwnProperty.call(E,A)&&d(I,l(P,A),E[A]);return I}function l(E,I){return E?E+"["+I+"]":I}function d(E,I,P){return Array.isArray(P)?Array.from(P.keys()).forEach(function(A){return d(E,l(I,A.toString()),P[A])}):P instanceof Date?E.append(I,P.toISOString()):P instanceof File?E.append(I,P,P.name):P instanceof Blob?E.append(I,P):typeof P=="boolean"?E.append(I,P?"1":"0"):typeof P=="string"?E.append(I,P):typeof P=="number"?E.append(I,""+P):P==null?E.append(I,""):void u(P,E,I)}function h(E){return new URL(E.toString(),window.location.toString())}function p(E,I,P,A){A===void 0&&(A="brackets");var N=/^https?:\/\//.test(I.toString()),j=N||I.toString().startsWith("/"),L=!j&&!I.toString().startsWith("#")&&!I.toString().startsWith("?"),B=I.toString().includes("?")||E===n.Method.GET&&Object.keys(P).length,V=I.toString().includes("#"),X=new URL(I.toString(),"http://localhost");return E===n.Method.GET&&Object.keys(P).length&&(X.search=r.stringify(i(r.parse(X.search,{ignoreQueryPrefix:!0}),P),{encodeValuesOnly:!0,arrayFormat:A}),P={}),[[N?X.protocol+"//"+X.host:"",j?X.pathname:"",L?X.pathname.substring(1):"",B?X.search:"",V?X.hash:""].join(""),P]}function g(E){return(E=new URL(E.href)).hash="",E}function v(E,I){return document.dispatchEvent(new CustomEvent("inertia:"+E,I))}(s=n.Method||(n.Method={})).GET="get",s.POST="post",s.PUT="put",s.PATCH="patch",s.DELETE="delete";var y=function(E){return v("finish",{detail:{visit:E}})},b=function(E){return v("navigate",{detail:{page:E}})},x=typeof window>"u",S=function(){function E(){this.visitId=null}var I=E.prototype;
35return I.init=function(P){var A=P.resolveComponent,N=P.swapComponent;this.page=P.initialPage,this.resolveComponent=A,this.swapComponent=N,this.isBackForwardVisit()?this.handleBackForwardVisit(this.page):this.isLocationVisit()?this.handleLocationVisit(this.page):this.handleInitialPageVisit(this.page),this.setupEventListeners()},I.handleInitialPageVisit=function(P){this.page.url+=window.location.hash,this.setPage(P,{preserveState:!0}).then(function(){return b(P)})},I.setupEventListeners=function(){window.addEventListener("popstate",this.handlePopstateEvent.bind(this)),document.addEventListener("scroll",c(this.handleScrollEvent.bind(this),100),!0)},I.scrollRegions=function(){return document.querySelectorAll("[scroll-region]")},I.handleScrollEvent=function(P){typeof P.target.hasAttribute=="function"&&P.target.hasAttribute("scroll-region")&&this.saveScrollPositions()},I.saveScrollPositions=function(){this.replaceState(a({},this.page,{scrollRegions:Array.from(this.scrollRegions()).map(function(P){return{top:P.scrollTop,left:P.scrollLeft}})}))},I.resetScrollPositions=function(){var P;window.scrollTo(0,0),this.scrollRegions().forEach(function(A){typeof A.scrollTo=="function"?A.scrollTo(0,0):(A.scrollTop=0,A.scrollLeft=0)}),this.saveScrollPositions(),window.location.hash&&((P=document.getElementById(window.location.hash.slice(1)))==null||P.scrollIntoView())},I.restoreScrollPositions=function(){var P=this;this.page.scrollRegions&&this.scrollRegions().forEach(function(A,N){var j=P.page.scrollRegions[N];j&&(typeof A.scrollTo=="function"?A.scrollTo(j.left,j.top):(A.scrollTop=j.top,A.scrollLeft=j.left))})},I.isBackForwardVisit=function(){return window.history.state&&window.performance&&window.performance.getEntriesByType("navigation").length>0&&window.performance.getEntriesByType("navigation")[0].type==="back_forward"},I.handleBackForwardVisit=function(P){var A=this;window.history.state.version=P.version,this.setPage(window.history.state,{preserveScroll:!0,preserveState:!0}).then(function(){A.restoreScrollPositions(),b(P)})},I.locationVisit=function(P,A){try{window.sessionStorage.setItem("inertiaLocationVisit",JSON.stringify({preserveScroll:A})),window.location.href=P.href,g(window.location).href===g(P).href&&window.location.reload()}catch{return!1}},I.isLocationVisit=function(){try{return window.sessionStorage.getItem("inertiaLocationVisit")!==null}catch{return!1}},I.handleLocationVisit=function(P){var A,N,j,L,B=this,V=JSON.parse(window.sessionStorage.getItem("inertiaLocationVisit")||"");window.sessionStorage.removeItem("inertiaLocationVisit"),P.url+=window.location.hash,P.rememberedState=(A=(N=window.history.state)==null?void 0:N.rememberedState)!=null?A:{},P.scrollRegions=(j=(L=window.history.state)==null?void 0:L.scrollRegions)!=null?j:[],this.setPage(P,{preserveScroll:V.preserveScroll,preserveState:!0}).then(function(){V.preserveScroll&&B.restoreScrollPositions(),b(P)})},I.isLocationVisitResponse=function(P){return P&&P.status===409&&P.headers["x-inertia-location"]},I.isInertiaResponse=function(P){return P==null?void 0:P.headers["x-inertia"]},I.createVisitId=function(){return this.visitId={},this.visitId},I.cancelVisit=function(P,A){var N=A.cancelled,j=N!==void 0&&N,L=A.interrupted,B=L!==void 0&&L;!P||P.completed||P.cancelled||P.interrupted||(P.cancelToken.cancel(),P.onCancel(),P.completed=!1,P.cancelled=j,P.interrupted=B,y(P),P.onFinish(P))},I.finishVisit=function(P){P.cancelled||P.interrupted||(P.completed=!0,P.cancelled=!1,P.interrupted=!1,y(P),P.onFinish(P))},I.resolvePreserveOption=function(P,A){return typeof P=="function"?P(A):P==="errors"?Object.keys(A.props.errors||{}).length>0:P},I.visit=function(P,A){var N=this,j=A===void 0?{}:A,L=j.method,B=L===void 0?n.Method.GET:L,V=j.data,X=V===void 0?{}:V,ne=j.replace,se=ne!==void 0&&ne,ie=j.preserveScroll,de=ie!==void 0&&ie,ue=j.preserveState,Ce=ue!==void 0&&ue,we=j.only,Fe=we===void 0?[]:we,Ge=j.headers,Ie=Ge===void 0?{}:Ge,He=j.errorBag,ot=He===void 0?"":He,Je=j.forceFormData,et=Je!==void 0&&Je,Ut=j.onCancelToken,_t=Ut===void 0?function(){}:Ut,mt=j.onBefore,wt=mt===void 0?function(){}:mt,Kt=j.onStart,Ct=Kt===void 0?function(){}:Kt,kt=j.onProgress,jn=kt===void 0?function(){}:kt,zt=j.onFinish,qn=zt===void 0?function(){}:zt,_r=j.onCancel,On=_r===void 0?function(){}:_r,hn=j.onSuccess,xn=hn===void 0?function(){}:hn,kn=j.onError,St=kn===void 0?function(){}:kn,Er=j.queryStringArrayFormat,Jn=Er===void 0?"brackets":Er,rn=typeof P=="string"?h(P):P;if(!function gt(Rt){return Rt instanceof File||Rt instanceof Blob||Rt instanceof FileList&&Rt.length>0||Rt instanceof FormData&&Array.from(Rt.values()).some(function(Wt){return gt(Wt)})||typeof Rt=="object"&&Rt!==null&&Object.values(Rt).some(function(Wt){return gt(Wt)})}(X)&&!et||X instanceof FormData||(X=u(X)),!(X instanceof FormData)){var sr=p(B,rn,X,Jn),Qn=sr[1];rn=h(sr[0]),X=Qn}var Pr={url:rn,method:B,data:X,replace:se,preserveScroll:de,preserveState:Ce,only:Fe,headers:Ie,errorBag:ot,forceFormData:et,queryStringArrayFormat:Jn,cancelled:!1,completed:!1,interrupted:!1};if(wt(Pr)!==!1&&function(gt){return v("before",{cancelable:!0,detail:{visit:gt}})}(Pr)){this.activeVisit&&this.cancelVisit(this.activeVisit,{interrupted:!0}),this.saveScrollPositions();var Gr=this.createVisitId();this.activeVisit=a({},Pr,{onCancelToken:_t,onBefore:wt,onStart:Ct,onProgress:jn,onFinish:qn,onCancel:On,onSuccess:xn,onError:St,queryStringArrayFormat:Jn,cancelToken:t.CancelToken.source()}),_t({cancel:function(){N.activeVisit&&N.cancelVisit(N.activeVisit,{cancelled:!0})}}),function(gt){v("start",{detail:{visit:gt}})}(Pr),Ct(Pr),t({method:B,url:g(rn).href,data:B===n.Method.GET?{}:X,params:B===n.Method.GET?X:{},cancelToken:this.activeVisit.cancelToken.token,headers:a({},Ie,{Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0},Fe.length?{"X-Inertia-Partial-Component":this.page.component,"X-Inertia-Partial-Data":Fe.join(",")}:{},ot&&ot.length?{"X-Inertia-Error-Bag":ot}:{},this.page.version?{"X-Inertia-Version":this.page.version}:{}),onUploadProgress:function(gt){X instanceof FormData&&(gt.percentage=Math.round(gt.loaded/gt.total*100),function(Rt){v("progress",{detail:{progress:Rt}})}(gt),jn(gt))}}).then(function(gt){var Rt;if(!N.isInertiaResponse(gt))return Promise.reject({response:gt});var Wt=gt.data;Fe.length&&Wt.component===N.page.component&&(Wt.props=a({},N.page.props,Wt.props)),de=N.resolvePreserveOption(de,Wt),(Ce=N.resolvePreserveOption(Ce,Wt))&&(Rt=window.history.state)!=null&&Rt.rememberedState&&Wt.component===N.page.component&&(Wt.rememberedState=window.history.state.rememberedState);var Di=rn,Kr=h(Wt.url);return Di.hash&&!Kr.hash&&g(Di).href===Kr.href&&(Kr.hash=Di.hash,Wt.url=Kr.href),N.setPage(Wt,{visitId:Gr,replace:se,preserveScroll:de,preserveState:Ce})}).then(function(){var gt=N.page.props.errors||{};if(Object.keys(gt).length>0){var Rt=ot?gt[ot]?gt[ot]:{}:gt;return function(Wt){v("error",{detail:{errors:Wt}})}(Rt),St(Rt)}return v("success",{detail:{page:N.page}}),xn(N.page)}
35).catch(function(gt){if(N.isInertiaResponse(gt.response))return N.setPage(gt.response.data,{visitId:Gr});if(N.isLocationVisitResponse(gt.response)){var Rt=h(gt.response.headers["x-inertia-location"]),Wt=rn;Wt.hash&&!Rt.hash&&g(Wt).href===Rt.href&&(Rt.hash=Wt.hash),N.locationVisit(Rt,de===!0)}else{if(!gt.response)return Promise.reject(gt);v("invalid",{cancelable:!0,detail:{response:gt.response}})&&o.show(gt.response.data)}}).then(function(){N.activeVisit&&N.finishVisit(N.activeVisit)}).catch(function(gt){if(!t.isCancel(gt)){var Rt=v("exception",{cancelable:!0,detail:{exception:gt}});if(N.activeVisit&&N.finishVisit(N.activeVisit),Rt)return Promise.reject(gt)}})}},I.setPage=function(P,A){var N=this,j=A===void 0?{}:A,L=j.visitId,B=L===void 0?this.createVisitId():L,V=j.replace,X=V!==void 0&&V,ne=j.preserveScroll,se=ne!==void 0&&ne,ie=j.preserveState,de=ie!==void 0&&ie;return Promise.resolve(this.resolveComponent(P.component)).then(function(ue){B===N.visitId&&(P.scrollRegions=P.scrollRegions||[],P.rememberedState=P.rememberedState||{},(X=X||h(P.url).href===window.location.href)?N.replaceState(P):N.pushState(P),N.swapComponent({component:ue,page:P,preserveState:de}).then(function(){se||N.resetScrollPositions(),X||b(P)}))})},I.pushState=function(P){this.page=P,window.history.pushState(P,"",P.url)},I.replaceState=function(P){this.page=P,window.history.replaceState(P,"",P.url)},I.handlePopstateEvent=function(P){var A=this;if(P.state!==null){var N=P.state,j=this.createVisitId();Promise.resolve(this.resolveComponent(N.component)).then(function(B){j===A.visitId&&(A.page=N,A.swapComponent({component:B,page:N,preserveState:!1}).then(function(){A.restoreScrollPositions(),b(N)}))})}else{var L=h(this.page.url);L.hash=window.location.hash,this.replaceState(a({},this.page,{url:L.href})),this.resetScrollPositions()}},I.get=function(P,A,N){return A===void 0&&(A={}),N===void 0&&(N={}),this.visit(P,a({},N,{method:n.Method.GET,data:A}))},I.reload=function(P){return P===void 0&&(P={}),this.visit(window.location.href,a({},P,{preserveScroll:!0,preserveState:!0}))},I.replace=function(P,A){var N;return A===void 0&&(A={}),console.warn("Inertia.replace() has been deprecated and will be removed in a future release. Please use Inertia."+((N=A.method)!=null?N:"get")+"() instead."),this.visit(P,a({preserveState:!0},A,{replace:!0}))},I.post=function(P,A,N){return A===void 0&&(A={}),N===void 0&&(N={}),this.visit(P,a({preserveState:!0},N,{method:n.Method.POST,data:A}))},I.put=function(P,A,N){return A===void 0&&(A={}),N===void 0&&(N={}),this.visit(P,a({preserveState:!0},N,{method:n.Method.PUT,data:A}))},I.patch=function(P,A,N){return A===void 0&&(A={}),N===void 0&&(N={}),this.visit(P,a({preserveState:!0},N,{method:n.Method.PATCH,data:A}))},I.delete=function(P,A){return A===void 0&&(A={}),this.visit(P,a({preserveState:!0},A,{method:n.Method.DELETE}))},I.remember=function(P,A){var N,j;A===void 0&&(A="default"),x||this.replaceState(a({},this.page,{rememberedState:a({},(N=this.page)==null?void 0:N.rememberedState,(j={},j[A]=P,j))}))},I.restore=function(P){var A,N;if(P===void 0&&(P="default"),!x)return(A=window.history.state)==null||(N=A.rememberedState)==null?void 0:N[P]},I.on=function(P,A){var N=function(j){var L=A(j);j.cancelable&&!j.defaultPrevented&&L===!1&&j.preventDefault()};return document.addEventListener("inertia:"+P,N),function(){return document.removeEventListener("inertia:"+P,N)}},E}(),w={buildDOMElement:function(E){var I=document.createElement("template");I.innerHTML=E;var P=I.content.firstChild;if(!E.startsWith("<script "))return P;var A=document.createElement("script");return A.innerHTML=P.innerHTML,P.getAttributeNames().forEach(function(N){A.setAttribute(N,P.getAttribute(N)||"")}),A},isInertiaManagedElement:function(E){return E.nodeType===Node.ELEMENT_NODE&&E.getAttribute("inertia")!==null},findMatchingElementIndex:function(E,I){var P=E.getAttribute("inertia");return P!==null?I.findIndex(function(A){return A.getAttribute("inertia")===P}):-1},update:c(function(E){var I=this,P=E.map(function(A){return I.buildDOMElement(A)});Array.from(document.head.childNodes).filter(function(A){return I.isInertiaManagedElement(A)}
35).forEach(function(A){var N=I.findMatchingElementIndex(A,P);if(N!==-1){var j,L=P.splice(N,1)[0];L&&!A.isEqualNode(L)&&(A==null||(j=A.parentNode)==null||j.replaceChild(L,A))}else{var B;A==null||(B=A.parentNode)==null||B.removeChild(A)}}),P.forEach(function(A){return document.head.appendChild(A)})},1)},k=new S;n.Inertia=k,n.createHeadManager=function(E,I,P){var A={},N=0;function j(){var B=Object.values(A).reduce(function(V,X){return V.concat(X)},[]).reduce(function(V,X){if(X.indexOf("<")===-1)return V;if(X.indexOf("<title ")===0){var ne=X.match(/(<title [^>]+>)(.*?)(<\/title>)/);return V.title=ne?""+ne[1]+I(ne[2])+ne[3]:X,V}var se=X.match(/ inertia="[^"]+"/);return se?V[se[0]]=X:V[Object.keys(V).length]=X,V},{});return Object.values(B)}function L(){E?P(j()):w.update(j())}return{createProvider:function(){var B=function(){var V=N+=1;return A[V]=[],V.toString()}();return{update:function(V){return function(X,ne){ne===void 0&&(ne=[]),X!==null&&Object.keys(A).indexOf(X)>-1&&(A[X]=ne),L()}(B,V)},disconnect:function(){return function(V){V!==null&&Object.keys(A).indexOf(V)!==-1&&(delete A[V],L())}(B)}}}}},n.hrefToUrl=h,n.mergeDataIntoQueryString=p,n.shouldIntercept=function(E){var I=E.currentTarget.tagName.toLowerCase()==="a";return!(E.target&&E!=null&&E.target.isContentEditable||E.defaultPrevented||I&&E.which>1||I&&E.altKey||I&&E.ctrlKey||I&&E.metaKey||I&&E.shiftKey)},n.urlWithoutHash=g})(Gi);function QZ(...n){const e=typeof n[0]=="string"?n[0]:null,t=(typeof n[0]=="string"?n[1]:n[0])||{},r=e?Gi.Inertia.restore(e):null;let i=x0(t),a=null,s=null,o=u=>u;const c=pn.observable({...r?r.data:t,isDirty:!1,errors:r?r.errors:{},hasErrors:!1,processing:!1,progress:null,wasSuccessful:!1,recentlySuccessful:!1,data(){return Object.keys(t).reduce((u,l)=>(u[l]=this[l],u),{})},transform(u){return o=u,this},defaults(u,l){return typeof u>"u"?i=this.data():i=Object.assign({},x0(i),l?{[u]:l}:u),this},reset(...u){let l=x0(i);return u.length===0?Object.assign(this,l):Object.assign(this,Object.keys(l).filter(d=>u.includes(d)).reduce((d,h)=>(d[h]=l[h],d),{})),this},setError(u,l){return Object.assign(this.errors,l?{[u]:l}:u),this.hasErrors=Object.keys(this.errors).length>0,this},clearErrors(...u){return this.errors=Object.keys(this.errors).reduce((l,d)=>({...l,...u.length>0&&!u.includes(d)?{[d]:this.errors[d]}:{}}),{}),this.hasErrors=Object.keys(this.errors).length>0,this},submit(u,l,d={}){const h=o(this.data()),p={...d,onCancelToken:g=>{if(a=g,d.onCancelToken)return d.onCancelToken(g)},onBefore:g=>{if(this.wasSuccessful=!1,this.recentlySuccessful=!1,clearTimeout(s),d.onBefore)return d.onBefore(g)},onStart:g=>{if(this.processing=!0,d.onStart)return d.onStart(g)},onProgress:g=>{if(this.progress=g,d.onProgress)return d.onProgress(g)},onSuccess:async g=>{this.processing=!1,this.progress=null,this.clearErrors(),this.wasSuccessful=!0,this.recentlySuccessful=!0,s=setTimeout(()=>this.recentlySuccessful=!1,2e3);const v=d.onSuccess?await d.onSuccess(g):null;return i=x0(this.data()),this.isDirty=!1,v},onError:g=>{if(this.processing=!1,this.progress=null,this.clearErrors().setError(g),d.onError)return d.onError(g)},onCancel:()=>{if(this.processing=!1,this.progress=null,d.onCancel)return d.onCancel()},onFinish:()=>{if(this.processing=!1,this.progress=null,a=null,d.onFinish)return d.onFinish()}};u==="delete"?Gi.Inertia.delete(l,{...p,data:h}):Gi.Inertia[u](l,h,p)},get(u,l){this.submit("get",u,l)},post(u,l){this.submit("post",u,l)},put(u,l){this.submit("put",u,l)},patch(u,l){this.submit("patch",u,l)},delete(u,l){this.submit("delete",u,l)},cancel(){a&&a.cancel()},__rememberable:e===null,__remember(){return{data:this.data(),errors:this.errors}},__restore(u){Object.assign(this,u.data),this.setError(u.errors)}});return new pn({created(){this.$watch(()=>c,u=>{c.isDirty=!HY(c.data(),i),e&&Gi.Inertia.remember(u.__remember(),e)},{immediate:!0,deep:!0})}}),c}const ZZ={created(){if(!this.$options.remember||this.$isServer)return;Array.isArray(this.$options.remember)&&(this.$options.remember={data:this.$options.remember}),typeof this.$options.remember=="string"&&(this.$options.remember={data:[this.$options.remember]}
35),typeof this.$options.remember.data=="string"&&(this.$options.remember={data:[this.$options.remember.data]});const n=this.$options.remember.key instanceof Function?this.$options.remember.key.call(this):this.$options.remember.key,e=Gi.Inertia.restore(n),t=this.$options.remember.data.filter(i=>!(this[i]!==null&&typeof this[i]=="object"&&this[i].__rememberable===!1)),r=i=>this[i]!==null&&typeof this[i]=="object"&&typeof this[i].__remember=="function"&&typeof this[i].__restore=="function";t.forEach(i=>{this[i]!==void 0&&e!==void 0&&e[i]!==void 0&&(r(i)?this[i].__restore(e[i]):this[i]=e[i]),this.$watch(i,()=>{Gi.Inertia.remember(t.reduce((a,s)=>({...a,[s]:r(s)?this[s].__remember():this[s]}),{}),n)},{immediate:!0,deep:!0})})}};let v5={},y5=null;const eee={name:"Inertia",props:{initialPage:{type:Object,required:!0},initialComponent:{type:[Object,Function,String],required:!1},resolveComponent:{type:Function,required:!1},titleCallback:{type:Function,required:!1,default:n=>n},onHeadUpdate:{type:Function,required:!1,default:()=>()=>{}}},data(){return{component:this.initialComponent||null,page:this.initialPage,key:null}},created(){v5=this,y5=Gi.createHeadManager(this.$isServer,this.titleCallback,this.onHeadUpdate),this.$isServer||Gi.Inertia.init({initialPage:this.initialPage,resolveComponent:this.resolveComponent,swapComponent:async({component:n,page:e,preserveState:t})=>{this.component=n,this.page=e,this.key=t?this.key:Date.now()}})},render(n){if(this.component){const e=n(this.component,{key:this.key,props:this.page.props,scopedSlots:this.$scopedSlots});return this.component.layout?typeof this.component.layout=="function"?this.component.layout(n,e):Array.isArray(this.component.layout)?this.component.layout.concat(e).reverse().reduce((t,r)=>n(r,{props:this.page.props},[t])):n(this.component.layout,{props:this.page.props},[e]):e}}},tee={install(n){Gi.Inertia.form=QZ,n.mixin(ZZ),n.mixin({beforeCreate(){Object.defineProperty(this,"$headManager",{get:function(){return y5}}),Object.defineProperty(this,"$inertia",{get:function(){return Gi.Inertia}}),Object.defineProperty(this,"$page",{get:function(){return v5.page}})}})}},oS={functional:!0,props:{as:{type:String,default:"a"},data:{type:Object,default:()=>({})},href:{type:String},method:{type:String,default:"get"},replace:{type:Boolean,default:!1},preserveScroll:{type:Boolean,default:!1},preserveState:{type:Boolean,default:null},only:{type:Array,default:()=>[]},headers:{type:Object,default:()=>({})},queryStringArrayFormat:{type:String,default:"brackets"}},render(n,{props:e,data:t,children:r}){t.on={click:()=>({}),cancelToken:()=>({}),start:()=>({}),progress:()=>({}),finish:()=>({}),cancel:()=>({}),success:()=>({}),error:()=>({}),...t.on||{}};const i=e.as.toLowerCase(),a=e.method.toLowerCase(),[s,o]=Gi.mergeDataIntoQueryString(a,e.href||"",e.data,e.queryStringArrayFormat);return i==="a"&&a!=="get"&&console.warn(`Creating POST/PUT/PATCH/DELETE <a> links is discouraged as it causes "Open Link in New Tab/Window" accessibility issues. 36 37Please specify a more appropriate element using the "as" attribute. For example: 38 39<Link href="${s}" method="${a}" as="button">...</Link>`),n(e.as,{...t,attrs:{...t.attrs,...i==="a"?{href:s}:{}},on:{...t.on,click:c=>{t.on.click(c),Gi.shouldIntercept(c)&&(c.preventDefault(),Gi.Inertia.visit(s,{data:o,method:a,replace:e.replace,preserveScroll:e.preserveScroll,preserveState:e.preserveState??a!=="get",only:e.only,headers:e.headers,onCancelToken:t.on.cancelToken,onBefore:t.on.before,onStart:t.on.start,onProgress:t.on.progress,onFinish:t.on.finish,onCancel:t.on.cancel,onSuccess:t.on.success,onError:t.on.error}))}}},r)}},nee={components:{AdminLayout:Gt,InertiaLink:oS},props:{availablePermissions:Object},data(){return{form:this.$inertia.form({name:"",permissions:[]})}},methods:{createApiKey(){this.form.post(route("admin.api-keys.store"))}}};var ree=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-semibold text-xl text-gray-800 leading-tight"},[e._v(" Create API Key ")])]},proxy:!0}])},[t("div",{staticClass:"py-12"}
39,[t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8"},[t("div",{staticClass:"bg-white overflow-hidden shadow-xl sm:rounded-lg p-6"},[t("form",{on:{submit:function(r){return r.preventDefault(),e.createApiKey.apply(null,arguments)}}},[t("div",{staticClass:"mb-6"},[t("label",{staticClass:"block text-sm font-medium text-gray-700"},[e._v("Name")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.name,expression:"form.name"}],staticClass:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm",attrs:{type:"text",placeholder:"Enter a name for this API key"},domProps:{value:e.form.name},on:{input:function(r){r.target.composing||e.$set(e.form,"name",r.target.value)}}}),e.form.errors.name?t("div",{staticClass:"mt-2 text-sm text-red-600"},[e._v(" "+e._s(e.form.errors.name)+" ")]):e._e()]),t("div",{staticClass:"mb-6"},[t("label",{staticClass:"block text-sm font-medium text-gray-700 mb-2"},[e._v("Permissions")]),t("div",{staticClass:"space-y-2"},e._l(e.availablePermissions,function(r,i){return t("div",{key:i,staticClass:"flex items-center"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.permissions,expression:"form.permissions"}],staticClass:"h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500",attrs:{type:"checkbox",id:i},domProps:{value:i,checked:Array.isArray(e.form.permissions)?e._i(e.form.permissions,i)>-1:e.form.permissions},on:{change:function(a){var s=e.form.permissions,o=a.target,c=!!o.checked;if(Array.isArray(s)){var u=i,l=e._i(s,u);o.checked?l<0&&e.$set(e.form,"permissions",s.concat([u])):l>-1&&e.$set(e.form,"permissions",s.slice(0,l).concat(s.slice(l+1)))}else e.$set(e.form,"permissions",c)}}}),t("label",{staticClass:"ml-2 block text-sm text-gray-900",attrs:{for:i}},[e._v(" "+e._s(r)+" ")])])}),0),e.form.errors.permissions?t("div",{staticClass:"mt-2 text-sm text-red-600"},[e._v(" "+e._s(e.form.errors.permissions)+" ")]):e._e()]),t("div",{staticClass:"flex items-center justify-end"},[t("inertia-link",{staticClass:"mr-3 inline-flex items-center px-4 py-2 border border-gray-300 rounded-md font-semibold text-xs text-gray-700 uppercase tracking-widest shadow-sm hover:text-gray-500 focus:outline-none focus:border-blue-300 focus:ring focus:ring-blue-200 active:text-gray-800 active:bg-gray-50 disabled:opacity-25 transition",attrs:{href:e.route("admin.api-keys.index")}},[e._v(" Cancel ")]),t("button",{staticClass:"inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700",attrs:{type:"submit",disabled:e.form.processing}},[e._v(" Create API Key ")])],1)])])])])])},iee=[],aee=ve(nee,ree,iee,!1,null,null);const see=aee.exports,oee=Object.freeze(Object.defineProperty({__proto__:null,default:see},Symbol.toStringTag,{value:"Module"})),cee={components:{AdminLayout:Gt,InertiaLink:oS},props:{apiKeys:{type:Array,default:()=>[]}},data(){return{showDocs:!1}},mounted(){},methods:{deleteApiKey(n){confirm("Are you sure you want to delete this API key?")&&this.$inertia.delete(route("admin.api-keys.destroy",n.id))}}};var uee=function(){var r;var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-semibold text-xl text-gray-800 leading-tight"},[e._v(" API Keys ")])]},proxy:!0}])},[t("div",{staticClass:"py-12"},[t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6"},[t("div",{staticClass:"bg-white overflow-hidden shadow-xl sm:rounded-lg p-6"},[t("div",{staticClass:"flex items-center justify-between mb-4"},[t("h3",{staticClass:"text-lg font-medium text-gray-900"},[e._v("API Documentation")]),t("button",{staticClass:"text-sm text-gray-500 hover:text-gray-700",on:{click:function(i){e.showDocs=!e.showDocs}}},[e._v(" "+e._s(e.showDocs?"Hide":"Show")+" ")])]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.showDocs,expression:"showDocs"}],staticClass:"prose max-w-none"},[t("div",{staticClass:"space-y-6"},[t("div",[t("h4",{staticClass:"text-base font-semibold mb-2"},[e._v("Authentication")]),t("p",{staticClass:"text-sm text-gray-600 mb-2"},[e._v(" Include your API key in the request headers: ")]),t("div",{staticClass:"bg-gray-50 rounded-md p-4 font-mono text-sm"},[e._v(" X-API-Key: your-api-key-here ")])]),t("div",[t("h4",{staticClass:"text-base font-semibold mb-2"},[e._v("Available Endpoints")]),t("div",{staticClass:"space-y-4"},[t("div",{staticClass:"border border-gray-200 rounded-md p-4"},[t("div",{staticClass:"flex items-center gap-2 mb-2"},[t("span",{staticClass:"bg-blue-100 text-blue-700 px-2 py-1 rounded text-xs font-medium"},[e._v("GET")]),t("code",{staticClass:"text-sm"},[e._v("/api/users")])]),t("p",{staticClass:"text-sm text-gray-600 mb-2"},[e._v("List all users")]),t("p",{staticClass:"text-sm text-gray-500"},[e._v("Required permission: "),t("span",{staticClass:"text-blue-600"},[e._v("List Users")])])]),t("div",{staticClass:"border border-gray-200 rounded-md p-4"},[t("div",{staticClass:"flex items-center gap-2 mb-2"},[t("span",{staticClass:"bg-blue-100 text-blue-700 px-2 py-1 rounded text-xs font-medium"},[e._v("GET")]),t("code",{staticClass:"text-sm"},[e._v("/api/users/{id}")])]),t("p",{staticClass:"text-sm text-gray-600 mb-2"},[e._v("Get details of a specific user")]),t("p",{staticClass:"text-sm text-gray-500"},[e._v("Required permission: "),t("span",{staticClass:"text-blue-600"},[e._v("View User Details")])])])])]),t("div",[t("h4",{staticClass:"text-base font-semibold mb-2"},[e._v("Example Request")]),t("div",{staticClass:"bg-gray-50 rounded-md p-4"},[t("pre",{staticClass:"text-sm overflow-x-auto"}
39,[t("code",[e._v(`curl -X GET \\ 40'http://localhost/api/users' \\ 41-H 'X-API-Key: your-api-key-here'`)])])])])])])]),t("div",{staticClass:"bg-white overflow-hidden shadow-xl sm:rounded-lg p-6"},[t("div",{staticClass:"flex justify-between items-center mb-6"},[t("h3",{staticClass:"text-lg font-medium text-gray-900"},[e._v("Manage API Keys")]),t("inertia-link",{staticClass:"inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700",attrs:{href:e.route("admin.api-keys.create")}},[e._v(" Create New API Key ")])],1),(r=e.$page.props.jetstream.flash)!=null&&r.banner?t("div",{staticClass:"mb-6 bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded"},[e._v(" "+e._s(e.$page.props.jetstream.flash.banner)+" ")]):e._e(),t("div",{staticClass:"overflow-x-auto"},[t("table",{staticClass:"min-w-full divide-y divide-gray-200"},[t("thead",{staticClass:"bg-gray-50"},[t("tr",[t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},[e._v("Name")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},[e._v("Created By")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},[e._v("Permissions")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},[e._v("Last Used")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},[e._v("Created")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},[e._v("Actions")])])]),t("tbody",{staticClass:"bg-white divide-y divide-gray-200"},[!e.apiKeys||e.apiKeys.length===0?t("tr",[t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center",attrs:{colspan:"6"}},[e._v(" No API keys found ")])]):e._l(e.apiKeys,function(i){var a;return t("tr",{key:i.id},[t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},[e._v(" "+e._s(i.name)+" ")]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},[e._v(" "+e._s(i.user?i.user.name:"N/A")+" "),t("div",{staticClass:"text-xs text-gray-400"},[e._v(e._s((a=i.user)==null?void 0:a.email))])]),t("td",{staticClass:"px-6 py-4 text-sm text-gray-500"},[t("div",{staticClass:"flex flex-wrap gap-2"},e._l(i.permissions,function(s){return t("span",{key:s,staticClass:"inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium bg-blue-50 text-blue-700 border border-blue-100"},[e._v(" "+e._s(s)+" ")])}),0)]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},[e._v(" "+e._s(i.last_used_at||"Never")+" ")]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},[e._v(" "+e._s(i.created_at)+" ")]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},[t("button",{staticClass:"text-red-600 hover:text-red-900",on:{click:function(s){return e.deleteApiKey(i)}}},[e._v(" Delete ")])])])})],2)])])])])])])},lee=[],dee=ve(cee,uee,lee,!1,null,null);const fee=dee.exports,hee=Object.freeze(Object.defineProperty({__proto__:null,default:fee},Symbol.toStringTag,{value:"Module"}));/** 42 * @license 43 * Copyright 2020 Google LLC. All Rights Reserved. 44 * Licensed under the Apache License, Version 2.0 (the "License"); 45 * you may not use this file except in compliance with the License. 46 * You may obtain a copy of the License at 47 * 48 * http://www.apache.org/licenses/LICENSE-2.0 49 * 50 * Unless required by applicable law or agreed to in writing, software 51 * distributed under the License is distributed on an "AS IS" BASIS, 52 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 53 * See the License for the specific language governing permissions and 54 * limitations under the License. 55 * ============================================================================= 56 */var _5=function(n,e){return(_5=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])})(n,e)};function oc(n,e){function t(){this.constructor=n}
56_5(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function at(n,e,t,r){return new(t||(t=Promise))(function(i,a){function s(u){try{c(r.next(u))}catch(l){a(l)}}function o(u){try{c(r.throw(u))}catch(l){a(l)}}function c(u){u.done?i(u.value):new t(function(l){l(u.value)}).then(s,o)}c((r=r.apply(n,[])).next())})}function st(n,e){var t,r,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(u){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return s.label++,{value:l[1],done:!1};case 5:s.label++,r=l[1],l=[0];continue;case 7:l=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){s=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){s.label=l[1];break}if(l[0]===6&&s.label<i[1]){s.label=i[1],i=l;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(l);break}i[2]&&s.ops.pop(),s.trys.pop();continue}l=e.call(n,s)}catch(d){l=[6,d],r=0}finally{t=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([c,u])}}}var pee=function(){function n(e){this.global=e,this.flags={},this.flagRegistry={},this.urlFlags={},this.populateURLFlags()}return n.prototype.setPlatform=function(e,t){this.platform!=null&&console.warn("Platform "+this.platformName+" has already been set. Overwriting the platform with "+t+"."),this.platformName=e,this.platform=t},n.prototype.registerFlag=function(e,t,r){if(this.flagRegistry[e]={evaluationFn:t,setHook:r},this.urlFlags[e]!=null){var i=this.urlFlags[e];console.warn("Setting feature override from URL "+e+": "+i+"."),this.set(e,i)}},n.prototype.get=function(e){return e in this.flags?this.flags[e]:(this.flags[e]=this.evaluateFlag(e),this.flags[e])},n.prototype.getNumber=function(e){return this.get(e)},n.prototype.getBool=function(e){return this.get(e)},n.prototype.getFlags=function(){return this.flags},Object.defineProperty(n.prototype,"features",{get:function(){return this.flags},enumerable:!0,configurable:!0}),n.prototype.set=function(e,t){if(this.flagRegistry[e]==null)throw new Error("Cannot set flag "+e+" as it has not been registered.");this.flags[e]=t,this.flagRegistry[e].setHook!=null&&this.flagRegistry[e].setHook(t)},n.prototype.evaluateFlag=function(e){if(this.flagRegistry[e]==null)throw new Error("Cannot evaluate flag '"+e+"': no evaluation function found.");return this.flagRegistry[e].evaluationFn()},n.prototype.setFlags=function(e){this.flags=Object.assign({},e)},n.prototype.reset=function(){this.flags={},this.urlFlags={},this.populateURLFlags()},n.prototype.populateURLFlags=function(){var e=this;if(this.global!==void 0&&this.global.location!==void 0&&this.global.location.search!==void 0){var t,r,i=(t=this.global.location.search,r={},t.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,function(a){for(var s=[],o=1;o<arguments.length;o++)s[o-1]=arguments[o];return mee(r,s[0],s[1]),s.join("=")}),r);"tfjsflags"in i&&i.tfjsflags.split(",").forEach(function(a){var s=a.split(":"),o=s[0],c=s[1];e.urlFlags[o]=function(u,l){if((l=l.toLowerCase())==="true"||l==="false")return l==="true";if(""+ +l===l)return+l;throw new Error("Could not parse value flag value "+l+" for flag "+u+".")}(o,c)})}},n}();function mee(n,e,t){n[decodeURIComponent(e)]=decodeURIComponent(t||"")}function ke(){return b5}var b5=null,Yy=new Map,XC=new Map;function x5(n,e){var t=C5(n,e);return Yy.get(t)}function gee(n){return XC.get(n)}function i4(n){for(var e=Yy.entries(),t=[];;){var r=e.next(),i=r.done,a=r.value;if(i)break;var s=a[0],o=a[1];s.split("_")[0]===n&&t.push(o)}return t}function w5(n){var e=n.kernelName,t=n.backendName,r=C5(e,t);if(Yy.has(r))throw new Error("The kernel '"+e+"' for backend '"+t+"' is already registered");Yy.set(r,n)}function vee(n){var e=n.kernelName;XC.has(e)&&console.warn("Overriding the gradient for '"+e+"'"),XC.set(e,n)}function C5(n,e){return e+"_"+n}function JC(n,e,t){return Math.max(n,Math.min(e,t))}function k5(n){return n%2==0?n:n+1}function yee(n){for(var e=0,t=0;t<n.length;t++)e+=n[t];return e}function J(n,e){if(!n)throw new Error(typeof e=="string"?e:e())}function Pn(n,e,t){t===void 0&&(t=""),J(gi(n,e),function(){return t+" Shapes "+n+" and "+e+" must match"})}function Np(n){J(n!=null,function(){return"The input to the tensor constructor must be a non-null value."})}function op(n,e,t){if(e===void 0&&(e=[]),t===void 0&&(t=!1),e==null&&(e=[]),Array.isArray(n)||Vc(n)&&!t)for(var r=0;r<n.length;++r)op(n[r],e,t);else e.push(n);return e}function ct(n){if(n.length===0)return 1;for(var e=n[0],t=1;t<n.length;t++)e*=n[t];return e}function gi(n,e){if(n===e)return!0;
56if(n==null||e==null||n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function $r(n){return n%1==0}function _ee(n){if(Math.tanh!=null)return Math.tanh(n);if(n===1/0)return 1;if(n===-1/0)return-1;var e=Math.exp(2*n);return(e-1)/(e+1)}function QC(n){var e=Math.ceil(Math.sqrt(n));return[e,Math.ceil(n/e)]}function Nh(n,e){return e<=n.length?n:n+" ".repeat(e-n.length)}function a4(n,e,t){return e===void 0&&(e=function(r){return 0}),new Promise(function(r,i){var a=0,s=function(){if(n())r();else{a++;var o=e(a);t!=null&&a>=t?i():setTimeout(s,o)}};s()})}function bee(n,e){for(var t=1,r=-1,i=0;i<n.length;++i)if(n[i]>=0)t*=n[i];else if(n[i]===-1){if(r!==-1)throw Error("Shapes can only have 1 implicit size. Found -1 at dim "+r+" and dim "+i);r=i}else if(n[i]<0)throw Error("Shapes can not be < 0. Found "+n[i]+" at dim "+i);if(r===-1){if(e>0&&e!==t)throw Error("Size("+e+") must match the product of shape "+n);return n}if(t===0)throw Error("Cannot infer the missing size in ["+n+"] when there are 0 elements");if(e%t!=0)throw Error("The implicit shape can't be a fractional number. Got "+e+" / "+t);var a=n.slice();return a[r]=e/t,a}function ui(n,e){var t=e.length;return J((n=n==null?e.map(function(r,i){return i}):[].concat(n)).every(function(r){return r>=-t&&r<t}),function(){return"All values in axis param must be in range [-"+t+", "+t+") but got axis "+n}),J(n.every(function(r){return $r(r)}),function(){return"All values in axis param must be integers but got axis "+n}),n.map(function(r){return r<0?t+r:r})}function Bd(n,e){for(var t=[],r=[],i=e!=null&&Array.isArray(e)&&e.length===0,a=e==null||i?null:ui(e,n).sort(),s=0,o=0;o<n.length;++o){if(a!=null){if(a[s]===o&&n[o]!==1)throw new Error("Can't squeeze axis "+o+" since its dim '"+n[o]+"' is not 1");(a[s]==null||a[s]>o)&&n[o]===1&&(t.push(n[o]),r.push(o)),a[s]<=o&&s++}n[o]!==1&&(t.push(n[o]),r.push(o))}return{newShape:t,keptDims:r}}function bg(n,e){var t=null;if(n==null||n==="float32")t=new Float32Array(e);else if(n==="int32")t=new Int32Array(e);else{if(n!=="bool")throw new Error("Unknown data type "+n);t=new Uint8Array(e)}return t}function Xy(n,e){var t=null;if(n==null||n==="float32")t=new Float32Array(e);else if(n==="int32")t=new Int32Array(e);else if(n==="bool")t=new Uint8Array(e);else{if(n!=="string")throw new Error("Unknown data type "+n);t=new Array(e)}return t}function xee(n,e){for(var t=0;t<n.length;t++){var r=n[t];if(isNaN(r)||!isFinite(r))throw Error("A tensor of type "+e+" being uploaded contains "+r+".")}}function wee(n){return n==="bool"||n==="complex64"||n==="float32"||n==="int32"||n==="string"}function Cee(n,e){return e!=="complex64"&&(e!=="float32"||n==="complex64")&&(e!=="int32"||n==="float32"||n==="complex64")&&(e!=="bool"||n!=="bool")}function Vc(n){return n instanceof Float32Array||n instanceof Int32Array||n instanceof Uint8Array}function S5(n){if(n==="float32"||n==="int32")return 4;if(n==="complex64")return 8;if(n==="bool")return 1;throw new Error("Unknown dtype "+n)}function kee(n){if(n==null)return 0;var e=0;return n.forEach(function(t){return e+=t.length}),e}function cS(n){return typeof n=="string"||n instanceof String}function See(n){return typeof n=="boolean"}function Tee(n){return typeof n=="number"}function rv(n){return Array.isArray(n)?rv(n[0]):n instanceof Float32Array?"float32":n instanceof Int32Array||n instanceof Uint8Array?"int32":Tee(n)?"float32":cS(n)?"string":See(n)?"bool":"float32"}function ZC(n){return!!(n&&n.constructor&&n.call&&n.apply)}function ek(n,e){for(var t=e;t<n;++t)if(n%t==0)return t;return n}function Gc(n){var e=n.length;if(e<2)return[];var t=new Array(e-1);t[e-2]=n[e-1];for(var r=e-3;r>=0;--r)t[r]=t[r+1]*n[r+1];return t}function T5(n,e,t){if(e==="string")throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(n)&&(n=op(n)),t&&xee(n,e),function(a,s){return a instanceof Float32Array&&s==="float32"||a instanceof Int32Array&&s==="int32"||a instanceof Uint8Array&&s==="bool"}(n,e))return n;if(e==null||e==="float32"||e==="complex64")return new Float32Array(n);if(e==="int32")return new Int32Array(n);
56if(e==="bool"){for(var r=new Uint8Array(n.length),i=0;i<r.length;++i)Math.round(n[i])!==0&&(r[i]=1);return r}throw new Error("Unknown data type "+e)}function s4(n,e){if(n.length===0)return e[0];var t=n.reduce(function(r,i){return r*i});if(t===0)return[];if(t!==e.length)throw new Error("["+n+"] does not match the input size.");return function r(i,a,s){var o=new Array;if(a.length===1)for(var c=a[0],u=0;u<c;u++)o[u]=s[i+u];else{c=a[0];var l=a.slice(1),d=l.reduce(function(h,p){return h*p});for(u=0;u<c;u++)o[u]=r(i+u*d,l,s)}return o}(0,n,e)}function E5(n,e){for(var t=iv(n,e),r=0;r<t.length;r++)t[r]=1;return t}function iv(n,e){if(e==null||e==="float32"||e==="complex64")return new Float32Array(n);if(e==="int32")return new Int32Array(n);if(e==="bool")return new Uint8Array(n);throw new Error("Unknown data type "+e)}function Oc(){return ke().platform.now()}function P5(n){n.forEach(function(e){J(Number.isInteger(e)&&e>=0,function(){return"Tensor must have a shape comprised of positive integers but got shape ["+n+"]."})})}function Eee(n,e){return e===void 0&&(e="utf-8"),e=e||"utf-8",ke().platform.encode(n,e)}function Jy(n,e){return e===void 0&&(e="utf-8"),e=e||"utf-8",ke().platform.decode(n,e)}function o4(n,e,t){if(e===0)return 0;if(e===1)return n[0];for(var r=n[n.length-1],i=0;i<n.length-1;++i)r+=t[i]*n[i];return r}function Pee(n,e,t){if(e===0)return[];if(e===1)return[n];for(var r=new Array(e),i=0;i<r.length-1;++i)r[i]=Math.floor(n/t[i]),n-=r[i]*t[i];return r[r.length-1]=n,r}var Ree=function(){function n(e,t){this.backendTimer=e,this.logger=t,t==null&&(this.logger=new Aee)}return n.prototype.profileKernel=function(e,t,r){var i,a=this,s=this.backendTimer.time(function(){i=r()});return i.forEach(function(o){o.data().then(function(c){(function(u,l,d){if(l!=="float32")return!1;for(var h=0;h<u.length;h++){var p=u[h];if(isNaN(p)||!isFinite(p))return console.warn("Found "+p+" in the result of '"+d+"'"),!0}})(c,o.dtype,e),s.then(function(u){var l="";u.getExtraProfileInfo!=null&&(l=u.getExtraProfileInfo()),a.logger.logKernelProfile(e,o,c,u.kernelMs,t,l)})})}),i},n}(),Aee=function(){function n(){}return n.prototype.logKernelProfile=function(e,t,r,i,a,s){var o=typeof i=="number"?Nh(i+"ms",9):i.error,c=Nh(e,25),u=t.rank,l=t.size,d=Nh(t.shape.toString(),14),h="";for(var p in a){var g=a[p].shape||t.shape,v=g.length;h+=p+": "+v+"D "+(v>0?g:"")+" "}
56console.log("%c"+c+" %c"+o+" %c"+u+"D "+d+" %c"+l+" %c"+h+" %c"+s,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")},n}(),c4=20,vm=3,uw=7;function Iee(n,e,t,r){var i=Gc(e),a=function(u,l,d,h){var p=ct(l),g=h[h.length-1],v=new Array(g).fill(0),y=l.length,b=d==="complex64"?_m(u):u;if(y>1)for(var x=0;x<p/g;x++)for(var S=x*g,w=0;w<g;w++)v[w]=Math.max(v[w],ym(b[S+w],0,d).length);return v}(n,e,t,i),s=e.length,o=function u(l,d,h,p,g,v){v===void 0&&(v=!0);var y=h==="complex64"?2:1,b=d[0],x=d.length;if(x===0)return h==="complex64"?[ym(_m(l)[0],0,h)]:h==="bool"?[R5(l[0])]:[l[0].toString()];if(x===1){if(b>c4){var S=vm*y,w=Array.from(l.slice(0,S)),k=Array.from(l.slice((b-vm)*y,b*y));return h==="complex64"&&(w=_m(w),k=_m(k)),["["+w.map(function(X,ne){return ym(X,g[ne],h)}).join(", ")+", ..., "+k.map(function(X,ne){return ym(X,g[b-vm+ne],h)}).join(", ")+"]"]}return["["+(h==="complex64"?_m(l):Array.from(l)).map(function(X,ne){return ym(X,g[ne],h)}).join(", ")+"]"]}var E=d.slice(1),I=p.slice(1),P=p[0]*y,A=[];if(b>c4){for(var N=0;N<vm;N++){var j=(L=N*P)+P;A.push.apply(A,u(l.slice(L,j),E,h,I,g,!1))}
vendor: 16,384 bytes, lines 56-60
56for(A.push("..."),N=b-vm;N<b;N++)j=(L=N*P)+P,A.push.apply(A,u(l.slice(L,j),E,h,I,g,N===b-1))}else for(N=0;N<b;N++){var L;j=(L=N*P)+P,A.push.apply(A,u(l.slice(L,j),E,h,I,g,N===b-1))}var B=x===2?",":"";for(A[0]="["+A[0]+B,N=1;N<A.length-1;N++)A[N]=" "+A[N]+B;var V=`, 57`;for(N=2;N<x;N++)V+=` 58`;return A[A.length-1]=" "+A[A.length-1]+"]"+(v?"":V),A}(n,e,t,i,a),c=["Tensor"];return r&&(c.push(" dtype: "+t),c.push(" rank: "+s),c.push(" shape: ["+e+"]"),c.push(" values:")),c.push(o.map(function(u){return" "+u}).join(` 59`)),c.join(` 60`)}function ym(n,e,t){return Nh(Array.isArray(n)?parseFloat(n[0].toFixed(uw))+" + "+parseFloat(n[1].toFixed(uw))+"j":cS(n)?"'"+n+"'":t==="bool"?R5(n):parseFloat(n.toFixed(uw)).toString(),e)}function R5(n){return n===0?"false":"true"}function _m(n){for(var e=[],t=0;t<n.length;t+=2)e.push([n[t],n[t+1]]);return e}var xg=function(){function n(e,t,r){var i=this;if(this.dtype=t,this.shape=e.slice(),this.size=ct(e),r!=null){var a=r.length;J(a===this.size,function(){return"Length of values '"+a+"' does not match the size inferred by the shape '"+i.size+"'."})}if(t==="complex64")throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=r||Xy(t,this.size),this.strides=Gc(e)}return n.prototype.set=function(e){for(var t=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];r.length===0&&(r=[0]),J(r.length===this.rank,function(){return"The number of provided coordinates ("+r.length+") must match the rank ("+t.rank+")"});var a=this.locToIndex(r);this.values[a]=e},n.prototype.get=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];e.length===0&&(e=[0]);for(var r=0,i=0,a=e;i<a.length;i++){var s=a[i];if(s<0||s>=this.shape[r]){var o="Requested out of range element at "+e+". Buffer shape="+this.shape;throw new Error(o)}r++}for(var c=e[e.length-1],u=0;u<e.length-1;++u)c+=this.strides[u]*e[u];return this.values[c]},n.prototype.locToIndex=function(e){if(this.rank===0)return 0;if(this.rank===1)return e[0];for(var t=e[e.length-1],r=0;r<e.length-1;++r)t+=this.strides[r]*e[r];return t},n.prototype.indexToLoc=function(e){if(this.rank===0)return[];if(this.rank===1)return[e];for(var t=new Array(this.shape.length),r=0;r<t.length-1;++r)t[r]=Math.floor(e/this.strides[r]),e-=t[r]*this.strides[r];return t[t.length-1]=e,t},Object.defineProperty(n.prototype,"rank",{get:function(){return this.shape.length},enumerable:!0,configurable:!0}),n.prototype.toTensor=function(){return Mc().makeTensor(this.values,this.shape,this.dtype)},n}(),Mc=null,xe=null,A5=null,mr=function(){function n(e,t,r,i){this.kept=!1,this.isDisposedInternal=!1,this.shape=e.slice(),this.dtype=t||"float32",this.size=ct(e),this.strides=Gc(e),this.dataId=r,this.id=i,this.rankType=this.rank<5?this.rank.toString():"higher"}return n.prototype.flatten=function(){return this.throwIfDisposed(),this.as1D()},n.prototype.asScalar=function(){return this.throwIfDisposed(),J(this.size===1,function(){return"The array must have only 1 element."}),this.reshape([])},n.prototype.as1D=function(){return this.throwIfDisposed(),this.reshape([this.size])},n.prototype.as2D=function(e,t){return this.throwIfDisposed(),this.reshape([e,t])},n.prototype.as3D=function(e,t,r){return this.throwIfDisposed(),this.reshape([e,t,r])},n.prototype.as4D=function(e,t,r,i){return this.throwIfDisposed(),this.reshape([e,t,r,i])},n.prototype.as5D=function(e,t,r,i,a){return this.throwIfDisposed(),this.reshape([e,t,r,i,a])},n.prototype.asType=function(e){return this.throwIfDisposed(),xe.cast(this,e)},Object.defineProperty(n.prototype,"rank",{get:function(){return this.shape.length},enumerable:!0,configurable:!0}),n.prototype.buffer=function(){return at(this,void 0,void 0,function(){var e;return st(this,function(t){switch(t.label){case 0:return[4,this.data()];case 1:return e=t.sent(),[2,xe.buffer(this.shape,this.dtype,e)]}})})},n.prototype.bufferSync=function(){return xe.buffer(this.shape,this.dtype,this.dataSync())},n.prototype.array=function(){return at(this,void 0,void 0,function(){var e;return st(this,function(t){switch(t.label){case 0:return[4,this.data()];case 1:return e=t.sent(),[2,s4(this.shape,e)]}})})},n.prototype.arraySync=function(){return s4(this.shape,this.dataSync())},n.prototype.data=function(){return at(this,void 0,void 0,function(){var e,t;return st(this,function(r){switch(r.label){case 0:return this.throwIfDisposed(),e=Mc().read(this.dataId),this.dtype!=="string"?[3,2]:[4,e];case 1:t=r.sent();try{return[2,t.map(function(i){return Jy(i)})]}catch{throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}r.label=2;case 2:return[2,e]}})})},n.prototype.dataSync=function(){this.throwIfDisposed();var e=Mc().readSync(this.dataId);if(this.dtype==="string")try{return e.map(function(t){return Jy(t)})}catch{throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e},n.prototype.bytes=function(){return at(this,void 0,void 0,function(){var e;return st(this,function(t){switch(t.label){case 0:return this.throwIfDisposed(),[4,Mc().read(this.dataId)];case 1:return e=t.sent(),this.dtype==="string"?[2,e]:[2,new Uint8Array(e.buffer)]}})})},n.prototype.dispose=function(){this.isDisposed||(Mc().disposeTensor(this),this.isDisposedInternal=!0)},Object.defineProperty(n.prototype,"isDisposed",{get:function(){return this.isDisposedInternal},enumerable:!0,configurable:!0}),n.prototype.throwIfDisposed=function(){if(this.isDisposed)throw new Error("Tensor is disposed.")},n.prototype.toFloat=function(){return this.asType("float32")},n.prototype.toInt=function(){return this.asType("int32")},n.prototype.toBool=function(){return this.asType("bool")},n.prototype.print=function(e){return e===void 0&&(e=!1),xe.print(this,e)},n.prototype.reshape=function(e){return this.throwIfDisposed(),xe.reshape(this,e)},n.prototype.reshapeAs=function(e){return this.throwIfDisposed(),this.reshape(e.shape)},n.prototype.expandDims=function(e){return e===void 0&&(e=0),xe.expandDims(this,e)},n.prototype.cumsum=function(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=!1),r===void 0&&(r=!1),xe.cumsum(this,e,t,r)},n.prototype.squeeze=function(e){return this.throwIfDisposed(),xe.squeeze(this,e)},n.prototype.clone=function(){return this.throwIfDisposed(),xe.clone(this)},n.prototype.oneHot=function(e,t,r){return this.throwIfDisposed(),xe.oneHot(this,e,t,r)},n.prototype.toString=function(e){return e===void 0&&(e=!1),Iee(this.dataSync(),this.shape,this.dtype,e)},n.prototype.tile=function(e){return this.throwIfDisposed(),xe.tile(this,e)},n.prototype.gather=function(e,t){return t===void 0&&(t=0),this.throwIfDisposed(),xe.gather(this,e,t)},n.prototype.matMul=function(e,t,r){return t===void 0&&(t=!1),r===void 0&&(r=!1),this.throwIfDisposed(),xe.matMul(this,e,t,r)},n.prototype.dot=function(e){return this.throwIfDisposed(),xe.dot(this,e)},n.prototype.norm=function(e,t,r){return e===void 0&&(e="euclidean"),t===void 0&&(t=null),r===void 0&&(r=!1),this.throwIfDisposed(),xe.norm(this,e,t,r)},n.prototype.slice=function(e,t){return this.throwIfDisposed(),xe.slice(this,e,t)},n.prototype.reverse=function(e){return this.throwIfDisposed(),xe.reverse(this,e)},n.prototype.concat=function(e,t){return t===void 0&&(t=0),this.throwIfDisposed(),e instanceof n&&(e=[e]),xe.concat([this].concat(e),t)},n.prototype.split=function(e,t){return t===void 0&&(t=0),this.throwIfDisposed(),xe.split(this,e,t)},n.prototype.stack=function(e,t){return t===void 0&&(t=0),xe.stack([this,e],t)},n.prototype.unstack=function(e){return e===void 0&&(e=0),xe.unstack(this,e)},n.prototype.pad=function(e,t){return t===void 0&&(t=0),xe.pad(this,e,t)},n.prototype.batchNormalization=function(e,t,r,i,a){return r===void 0&&(r=.001),A5("tf.batchNormalization() is going away. Use tf.batchNorm() instead, and note the positional argument change of scale, offset, and varianceEpsilon"),this.batchNorm(e,t,a,i,r)},n.prototype.batchNorm=function(e,t,r,i,a){return a===void 0&&(a=.001),this.throwIfDisposed(),xe.batchNorm(this,e,t,r,i,a)},n.prototype.all=function(e,t){return e===void 0&&(e=null),t===void 0&&(t=!1),this.throwIfDisposed(),xe.all(this,e,t)},n.prototype.any=function(e,t){return e===void 0&&(e=null),t===void 0&&(t=!1),this.throwIfDisposed(),xe.any(this,e,t)},n.prototype.logSumExp=function(e,t){return e===void 0&&(e=null),t===void 0&&(t=!1),this.throwIfDisposed(),xe.logSumExp(this,e,t)},n.prototype.sum=function(e,t){return e===void 0&&(e=null),t===void 0&&(t=!1),this.throwIfDisposed(),xe.sum(this,e,t)},n.prototype.prod=function(e,t){return e===void 0&&(e=null),t===void 0&&(t=!1),this.throwIfDisposed(),xe.prod(this,e,t)},n.prototype.mean=function(e,t){return e===void 0&&(e=null),t===void 0&&(t=!1),this.throwIfDisposed(),xe.mean(this,e,t)},n.prototype.min=function(e,t){return e===void 0&&(e=null),t===void 0&&(t=!1),this.throwIfDisposed(),xe.min(this,e,t)},n.prototype.max=function(e,t){return e===void 0&&(e=null),t===void 0&&(t=!1),this.throwIfDisposed(),xe.max(this,e,t)},n.prototype.argMin=function(e){return e===void 0&&(e=null),this.throwIfDisposed(),xe.argMin(this,e)},n.prototype.argMax=function(e){return e===void 0&&(e=null),this.throwIfDisposed(),xe.argMax(this,e)},n.prototype.cast=function(e){return this.throwIfDisposed(),xe.cast(this,e)},n.prototype.add=function(e){return this.throwIfDisposed(),xe.add(this,e)},n.prototype.addStrict=function(e){return this.throwIfDisposed(),xe.addStrict(this,e)},n.prototype.atan2=function(e){return this.throwIfDisposed(),xe.atan2(this,e)},n.prototype.sub=function(e){return this.throwIfDisposed(),xe.sub(this,e)},n.prototype.subStrict=function(e){return this.throwIfDisposed(),xe.subStrict(this,e)},n.prototype.pow=function(e){return this.throwIfDisposed(),xe.pow(this,e)},n.prototype.powStrict=function(e){return this.throwIfDisposed(),xe.powStrict(this,e)},n.prototype.mul=function(e){return this.throwIfDisposed(),xe.mul(this,e)},n.prototype.mulStrict=function(e){return this.throwIfDisposed(),xe.mulStrict(this,e)},n.prototype.div=function(e){return this.throwIfDisposed(),xe.div(this,e)},n.prototype.divNoNan=function(e){return this.throwIfDisposed(),xe.divNoNan(this,e)},n.prototype.floorDiv=function(e){return this.throwIfDisposed(),xe.floorDiv(this,e)},n.prototype.divStrict=function(e){return this.throwIfDisposed(),xe.divStrict(this,e)},n.prototype.minimum=function(e){return this.throwIfDisposed(),xe.minimum(this,e)},n.prototype.minimumStrict=function(e){return this.throwIfDisposed(),xe.minimumStrict(this,e)},n.prototype.maximum=function(e){return this.throwIfDisposed(),xe.maximum(this,e)},n.prototype.maximumStrict=function(e){return this.throwIfDisposed(),xe.maximumStrict(this,e)},n.prototype.mod=function(e){return this.throwIfDisposed(),xe.mod(this,e)},n.prototype.modStrict=function(e){return this.throwIfDisposed(),xe.modStrict(this,e)},n.prototype.squaredDifferenceStrict=function(e){return this.throwIfDisposed(),xe.squaredDifferenceStrict(this,e)},n.prototype.transpose=function(e){return this.throwIfDisposed(),xe.transpose(this,e)},n.prototype.notEqual=function(e){return this.throwIfDisposed(),xe.notEqual(this,e)},n.prototype.notEqualStrict=function(e){return this.throwIfDisposed(),xe.notEqualStrict(this,e)},n.prototype.less=function(e){return this.throwIfDisposed(),xe.less(this,e)},n.prototype.lessStrict=function(e){return this.throwIfDisposed(),xe.lessStrict(this,e)},n.prototype.equal=function(e){return this.throwIfDisposed(),xe.equal(this,e)},n.prototype.equalStrict=function(e){return this.throwIfDisposed(),xe.equalStrict(this,e)},n.prototype.lessEqual=function(e){return this.throwIfDisposed(),xe.lessEqual(this,e)},n.prototype.lessEqualStrict=function(e){return this.throwIfDisposed(),xe.lessEqualStrict(this,e)},n.prototype.greater=function(e){return this.throwIfDisposed(),xe.greater(this,e)},n.prototype.greaterStrict=function(e){return this.throwIfDisposed(),xe.greaterStrict(this,e)},n.prototype.greaterEqual=function(e){return this.throwIfDisposed(),xe.greaterEqual(this,e)},n.prototype.greaterEqualStrict=function(e){return this.throwIfDisposed(),xe.greaterEqualStrict(this,e)},n.prototype.logicalAnd=function(e){return this.throwIfDisposed(),xe.logicalAnd(this,e)},n.prototype.logicalOr=function(e){return this.throwIfDisposed(),xe.logicalOr(this,e)},n.prototype.logicalNot=function(){return this.throwIfDisposed(),xe.logicalNot(this)},n.prototype.logicalXor=function(e){return this.throwIfDisposed(),xe.logicalXor(this,e)},n.prototype.where=function(e,t){return this.throwIfDisposed(),xe.where(e,this,t)},n.prototype.neg=function(){return this.throwIfDisposed(),xe.neg(this)},n.prototype.ceil=function(){return this.throwIfDisposed(),xe.ceil(this)},n.prototype.floor=function(){return this.throwIfDisposed(),xe.floor(this)},n.prototype.sign=function(){return this.throwIfDisposed(),xe.sign(this)},n.prototype.isNaN=function(){return this.throwIfDisposed(),xe.isNaN(this)},n.prototype.isInf=function(){return this.throwIfDisposed(),xe.isInf(this)},n.prototype.isFinite=function(){return this.throwIfDisposed(),xe.isFinite(this)},n.prototype.exp=function(){return this.throwIfDisposed(),xe.exp(this)},n.prototype.expm1=function(){return this.throwIfDisposed(),xe.expm1(this)},n.prototype.log=function(){return this.throwIfDisposed(),xe.log(this)},n.prototype.log1p=function(){return this.throwIfDisposed(),xe.log1p(this)},n.prototype.sqrt=function(){return this.throwIfDisposed(),xe.sqrt(this)},n.prototype.rsqrt=function(){return this.throwIfDisposed(),xe.rsqrt(this)},n.prototype.square=function(){return this.throwIfDisposed(),xe.square(this)},n.prototype.reciprocal=function(){return this.throwIfDisposed(),xe.reciprocal(this)},n.prototype.abs=function(){return this.throwIfDisposed(),xe.abs(this)},n.prototype.clipByValue=function(e,t){return this.throwIfDisposed(),xe.clipByValue(this,e,t)},n.prototype.relu=function(){return this.throwIfDisposed(),xe.relu(this)},n.prototype.relu6=function(){return this.throwIfDisposed(),xe.relu6(this)},n.prototype.elu=function(){return this.throwIfDisposed(),xe.elu(this)},n.prototype.selu=function(){return this.throwIfDisposed(),xe.selu(this)},n.prototype.leakyRelu=function(e){return e===void 0&&(e=.2),this.throwIfDisposed(),xe.leakyRelu(this,e)},n.prototype.prelu=function(e){return this.throwIfDisposed(),xe.prelu(this,e)},n.prototype.sigmoid=function(){return this.throwIfDisposed(),xe.sigmoid(this)},n.prototype.logSigmoid=function(){return this.throwIfDisposed(),xe.logSigmoid(this)},n.prototype.softplus=function(){return this.throwIfDisposed(),xe.softplus(this)},n.prototype.zerosLike=function(){return this.throwIfDisposed(),xe.zerosLike(this)},n.prototype.onesLike=function(){return this.throwIfDisposed(),xe.onesLike(this)},n.prototype.sin=function(){return this.throwIfDisposed(),xe.sin(this)},n.prototype.cos=function(){return this.throwIfDisposed(),xe.cos(this)},n.prototype.tan=function(){return this.throwIfDisposed(),xe.tan(this)},n.prototype.asin=function(){return this.throwIfDisposed(),xe.asin(this)},n.prototype.acos=function(){return this.throwIfDisposed(),xe.acos(this)},n.prototype.atan=function(){return this.throwIfDisposed(),xe.atan(this)},n.prototype.sinh=function(){return this.throwIfDisposed(),xe.sinh(this)},n.prototype.cosh=function(){return this.throwIfDisposed(),xe.cosh(this)},n.prototype.tanh=function(){return this.throwIfDisposed(),xe.tanh(this)},n.prototype.asinh=function(){return this.throwIfDisposed(),xe.asinh(this)},n.prototype.acosh=function(){return this.throwIfDisposed(),xe.acosh(this)},n.prototype.atanh=function(){return this.throwIfDisposed(),xe.atanh(this)},n.prototype.erf=function(){return this.throwIfDisposed(),xe.erf(this)},n.prototype.round=function(){return this.throwIfDisposed(),xe.round(this)},n.prototype.step=function(e){return e===void 0&&(e=0),this.throwIfDisposed(),xe.step(this,e)},n.prototype.softmax=function(e){return e===void 0&&(e=-1),this.throwIfDisposed(),xe.softmax(this,e)},n.prototype.logSoftmax=function(e){return e===void 0&&(e=-1),this.throwIfDisposed(),xe.logSoftmax(this,e)},n.prototype.resizeBilinear=function(e,t){return t===void 0&&(t=!1),this.throwIfDisposed(),xe.image.resizeBilinear(this,e,t)},n.prototype.resizeNearestNeighbor=function(e,t){return t===void 0&&(t=!1),this.throwIfDisposed(),xe.image.resizeNearestNe
60ighbor(this,e,t)},n.prototype.conv1d=function(e,t,r,i,a,s){return i===void 0&&(i="NWC"),a===void 0&&(a=1),this.throwIfDisposed(),xe.conv1d(this,e,t,r,i,a,s)},n.prototype.conv2d=function(e,t,r,i,a,s){return i===void 0&&(i="NHWC"),a===void 0&&(a=[1,1]),this.throwIfDisposed(),xe.conv2d(this,e,t,r,i,a,s)},n.prototype.conv2dTranspose=function(e,t,r,i,a){return this.throwIfDisposed(),xe.conv2dTranspose(this,e,t,r,i,a)},n.prototype.depthwiseConv2D=function(e,t,r,i,a,s){return i===void 0&&(i="NHWC"),a===void 0&&(a=[1,1]),this.throwIfDisposed(),xe.depthwiseConv2d(this,e,t,r,i,a,s)},n.prototype.separableConv2d=function(e,t,r,i,a,s){return a===void 0&&(a=[1,1]),s===void 0&&(s="NHWC"),this.throwIfDisposed(),xe.separableConv2d(this,e,t,r,i,a,s)},n.prototype.avgPool=function(e,t,r,i){return this.throwIfDisposed(),xe.avgPool(this,e,t,r,i)},n.prototype.maxPool=function(e,t,r,i){return this.throwIfDisposed(),xe.maxPool(this,e,t,r,i)},n.prototype.localResponseNormalization=function(e,t,r,i){return e===void 0&&(e=5),t===void 0&&(t=1),r===void 0&&(r=1),i===void 0&&(i=.5),xe.localResponseNormalization(this,e,t,r,i)},n.prototype.pool=function(e,t,r,i,a){return this.throwIfDisposed(),xe.pool(this,e,t,r,i,a)},n.prototype.variable=function(e,t,r){return e===void 0&&(e=!0),this.throwIfDisposed(),Mc().makeVariable(this,e,t,r)},n.prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),xe.unsortedSegmentSum(this,e,t)},n.prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),xe.batchToSpaceND(this,e,t)},n.prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),xe.spaceToBatchND(this,e,t)},n.prototype.topk=function(e,t){return e===void 0&&(e=1),t===void 0&&(t=!0),this.throwIfDisposed(),xe.topk(this,e,t)},n.prototype.stridedSlice=function(e,t,r,i,a,s,o,c){return i===void 0&&(i=0),a===void 0&&(a=0),s===void 0&&(s=0),o===void 0&&(o=0),c===void 0&&(c=0),this.throwIfDisposed(),xe.stridedSlice(this,e,t,r,i,a,s,o,c)},n.prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),xe.depthToSpace(this,e,t)},n.prototype.fft=function(){return this.throwIfDisposed(),xe.spectral.fft(this)},n.prototype.ifft=function(){return this.throwIfDisposed(),xe.spectral.ifft(this)},n.prototype.rfft=function(){return this.throwIfDisposed(),xe.spectral.rfft(this)},n.prototype.irfft=function(){return this.throwIfDisposed(),xe.spectral.irfft(this)},n}();Object.defineProperty(mr,Symbol.hasInstance,{value:function(n){return!!n&&n.dataId!=null&&n.shape!=null&&n.dtype!=null}});var u4,tk,nk,rk,ik,cp=function(n){function e(t,r,i,a){var s=n.call(this,t.shape,t.dtype,t.dataId,a)||this;return s.trainable=r,s.name=i,s}return oc(e,n),e.prototype.assign=function(t){if(t.dtype!==this.dtype)throw new Error("dtype of the new value ("+t.dtype+") and previous value ("+this.dtype+") must match");if(!gi(t.shape,this.shape))throw new Error("shape of the new value ("+t.shape+") and previous value ("+this.shape+") must match");Mc().disposeTensor(this),this.dataId=t.dataId,Mc().incRef(this,null)},e.prototype.dispose=function(){Mc().disposeVariable(this),this.isDisposedInternal=!0},e}(mr);Object.defineProperty(cp,Symbol.hasInstance,{value:function(n){return n instanceof mr&&n.assign!=null&&n.assign instanceof Function}}),function(n){n.R0="R0",n.R1="R1",n.R2="R2",n.R3="R3",n.R4="R4",n.R5="R5",n.R6="R6"}(u4||(u4={})),function(n){n.float32="float32",n.int32="int32",n.bool="int32",n.complex64="complex64"}(tk||(tk={})),function(n){n.float32="float32",n.int32="int32",n.bool="bool",n.complex64="complex64"}(nk||(nk={})),function(n){n.float32="float32",n.int32="float32",n.bool="float32",n.complex64="complex64"}(rk||(rk={})),function(n){n.float32="complex64",n.int32="complex64",n.bool="complex64",n.complex64="complex64"}(ik||(ik={}));var Oee={float32:rk,int32:tk,bool:nk,complex64:ik};function Ei(n,e){if(n==="string"||e==="string"){if(n==="string"&&e==="string")return"string";throw new Error("Can not upcast "+n+" with "+e)}return Oee[n][e]}function lw(n){return Ei(n,"int32")}function yr(n,e){if(n.dtype===e.dtype)return[n,e];var t=Ei(n.dtype,e.dtype);return[n.cast(t),e.cast(t)]}
60function Mee(n,e){J(n.dtype===e.dtype,function(){return"The dtypes of the first("+n.dtype+") and second("+e.dtype+") input must match"})}function I5(n){var e=[];return function t(r,i,a){if(r!=null){if(r instanceof mr)return void i.push(r);if(s=r,!(!Array.isArray(s)&&typeof s!="object")){var s,o=r;for(var c in o){var u=o[c];a.has(u)||(a.add(u),t(u,i,a))}}}}(n,e,new Set),e}var dw,l4=function(){function n(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null}}return n.prototype.dispose=function(){for(var e in this.registeredVariables)this.registeredVariables[e].dispose()},n}(),Dee=function(){function n(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new l4}return n.prototype.ready=function(){return at(this,void 0,void 0,function(){var e,t,r;return st(this,function(i){switch(i.label){case 0:if(this.pendingBackendInit!=null)return[2,this.pendingBackendInit.then(function(){})];if(this.backendInstance!=null)return[2];e=this.getSortedBackends(),t=0,i.label=1;case 1:return t<e.length?(r=e[t],[4,this.initializeBackend(r).success]):[3,5];case 2:return i.sent()?[4,this.setBackend(r)]:[3,4];case 3:return i.sent(),[2];case 4:return t++,[3,1];case 5:throw new Error("Could not initialize any backends, all backend initializations failed.")}})})},Object.defineProperty(n.prototype,"backend",{get:function(){if(this.pendingBackendInit!=null)throw new Error("Backend '"+this.backendName+"' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods");if(this.backendInstance==null){var e=this.initializeBackendsAndReturnBest(),t=e.name;if(e.asyncInit)throw new Error("The highest priority backend '"+t+"' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods");this.setBackend(t)}return this.backendInstance},enumerable:!0,configurable:!0}),n.prototype.backendNames=function(){return Object.keys(this.registryFactory)},n.prototype.findBackend=function(e){return!(e in this.registry)&&(!(e in this.registryFactory)||this.initializeBackend(e).asyncInit)?null:this.registry[e]},n.prototype.findBackendFactory=function(e){return e in this.registryFactory?this.registryFactory[e].factory:null},n.prototype.registerBackend=function(e,t,r){return r===void 0&&(r=1),e in this.registryFactory?(console.warn(e+" backend was already registered. Reusing existing backend factory."),!1):(this.registryFactory[e]={factory:t,priority:r},!0)},n.prototype.setBackend=function(e){return at(this,void 0,void 0,function(){var t,r,i;return st(this,function(a){switch(a.label){case 0:if(this.registryFactory[e]==null)throw new Error("Backend name '"+e+"' not found in registry");return this.backendName=e,this.registry[e]!=null?[3,4]:(this.backendInstance=null,t=this.initializeBackend(e),r=t.success,t.asyncInit?[4,r]:[3,2]);case 1:return i=a.sent(),[3,3];case 2:i=r,a.label=3;case 3:if(!i)return[2,!1];a.label=4;case 4:return this.backendInstance=this.registry[e],this.setupRegisteredKernels(),this.profiler=new Ree(this.backendInstance),[2,!0]}})})},n.prototype.setupRegisteredKernels=function(){var e=this;i4(this.backendName).forEach(function(t){t.setupFunc!=null&&t.setupFunc(e.backendInstance)})},n.prototype.disposeRegisteredKernels=function(e){var t=this;i4(e).forEach(function(r){r.disposeFunc!=null&&r.disposeFunc(t.registry[e])})},n.prototype.initializeBackend=function(e){var t=this,r=this.registryFactory[e];if(r==null)throw new Error("Cannot initialize backend "+e+", no registration found.");try{var i=r.factory();if(Promise.resolve(i)===i){var a=++this.pendingBackendInitId,s=i.then(function(o){return!(a<t.pendingBackendInitId)&&(t.registry[e]=o,t.pendingBackendInit=null,!0)}).catch(function(o){return!(a<t.pendingBackendInitId)&&(t.pendingBackendInit=null,console.warn("Initialization of backend "+e+" failed"),console.warn(o.stack||o.message),!1)});return this.pendingBackendInit=s,{success:s,asyncInit:!0}}return this.registry[e]=i,{success:!0,asyncInit:!1}}catch(o){return console.warn("Initialization of backend "+e+" failed"),console.warn(o.stack||o.message),{success:!1,asyncInit:!1}}},n.prototype.removeBackend=function(e){if(!(e in this.registryFactory))throw new Error(e+" backend not found in registry");this.backendName===e&&this.pendingBackendInit!=null&&this.pendingBackendInitId++,e in this.registry&&(this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e]),delete this.registryFactory[e],this.backendName===e&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)},n.prototype.getSortedBackends=function(){var e=this;if(Object.keys(this.registryFactory).length===0)throw new Error("No backend found in registry.");return Object.keys(this.registryFactory).sort(function(t,r){return e.registryFactory[r].priority-e.registryFactory[t].priority})},n.prototype.initializeBackendsAndReturnBest=function(){for(var e=this.getSortedBackends(),t=0;t<e.length;t++){var r=e[t],i=this.initializeBackend(r),a=i.success,s=i.asyncInit;if(s||a)return{name:r,asyncInit:s}}throw new Error("Could not initialize any backends, all backend initializations failed.")},n.prototype.moveData=function(e,t){var r=this.state.tensorInfo.get(t),i=r.backend,a=this.readSync(t);i.disposeData(t),r.backend=e,e.move(t,a,r.shape,r.dtype),this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack[this.state.numDataMovesStack.length-1]++},n.prototype.tidy=function(e,t){var r,i=this,a=null;if(t==null){if(typeof e!="function")throw new Error("Please provide a function to tidy()");t=e}else{if(typeof e!="string"&&!(e instanceof String))throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if(typeof t!="function")throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");a=e}return this.scopedRun(function(){return i.startScope(a)},function(){return i.endScope(r)},function(){return(r=t())instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),r})},n.prototype.scopedRun=function(e,t,r){e();try{var i=r();return t(),i}catch(a){throw t(),a}},n.prototype.nextTensorId=function(){return n.nextTensorId++},n.prototype.nextVariableId=function(){return n.nextVariableId++},n.prototype.clone=function(e){var t=this.makeTensorFromDataId(e.dataId,e.shape,e.dtype),r={x:e};return this.addTapeNode(this.state.activeScope.name,r,[t],function(i){return{x:function(){return i.toFloat
60()}}},[]),t},n.prototype.runKernel=function(e,t,r,i,a){return this.runKernelFunc(null,t,null,e,r,i,a)},n.prototype.shouldCheckForMemLeaks=function(){return this.ENV.getBool("IS_TEST")},n.prototype.checkKernelForMemLeak=function(e,t,r){var i=this.backend.numDataIds(),a=0;r.forEach(function(c){a+=c.dtype==="complex64"?3:1});var s=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],o=i-t-a-s;if(o>0)throw new Error("Backend '"+this.backendName+"' has an internal memory leak ("+o+" data ids) after running '"+e+"'")},n.prototype.runKernelFunc=function(e,t,r,i,a,s,o){var c,u=this;s===void 0&&(s=[]),o===void 0&&(o=[]);var l=[],d=this.isTapeOn();i==null&&(i=this.state.activeScope!=null?this.state.activeScope.name:"");var h,p=function(x){d&&(l=x.map(function(S){return u.keep(u.clone(S))}))},g=this.state.numBytes,v=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);var y,b=x5(i,this.backendName);return h=b!=null?function(){var x=u.backend.numDataIds();y=b.kernelFunc({inputs:t,attrs:a,backend:u.backend});var S=Array.isArray(y)?y:[y];u.shouldCheckForMemLeaks()&&u.checkKernelForMemLeak(i,x,S);var w=S.map(function(E){var I=E.dataId,P=E.shape,A=E.dtype;return u.makeTensorFromDataId(I,P,A)}),k=w.filter(function(E,I){return o[I]});return p((s||[]).slice().concat(k)),w}:function(){var x=u.backend.numDataIds();y=u.tidy(function(){return e(u.backend,p)});var S=Array.isArray(y)?y:[y];return u.shouldCheckForMemLeaks()&&u.checkKernelForMemLeak(i,x,S),S},this.scopedRun(function(){return u.state.kernelDepth++},function(){return u.state.kernelDepth--},function(){c=u.ENV.getBool("DEBUG")?u.profiler.profileKernel(i,t,function(){return h()}):h()}),d&&this.addTapeNode(i,t,c,r,l),this.state.profiling&&this.state.activeProfile.kernels.push({name:i,bytesAdded:this.state.numBytes-g,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-v,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(t).map(function(x){return t[x].shape}),outputShapes:c.map(function(x){return x.shape})}),Array.isArray(y)?c:c[0]},n.prototype.makeTensor=function(e,t,r,i){if(e==null)throw new Error("Values passed to engine.makeTensor() are null");r=r||"float32",i=i||this.backend;var a=e;r==="string"&&cS(e[0])&&(a=e.map(function(l){return Eee(l)}));var s=i.write(a,t,r),o=new mr(t,r,s,this.nextTensorId());if(this.incRef(o,i),r==="string"){var c=this.state.tensorInfo.get(s),u=kee(a);this.state.numBytes+=u-c.bytes,c.bytes=u}return o},n.prototype.makeTensorFromDataId=function(e,t,r,i){var a=new mr(t,r=r||"float32",e,this.nextTensorId());return this.incRef(a,i),a},n.prototype.makeVariable=function(e,t,r,i){t===void 0&&(t=!0),r=r||this.nextVariableId().toString(),i!=null&&i!==e.dtype&&(e=e.asType(i));var a=new cp(e,t,r,this.nextTensorId());if(this.state.registeredVariables[a.name]!=null)throw new Error("Variable with name "+a.name+" was already registered");return this.state.registeredVariables[a.name]=a,this.incRef(a,this.backend),a},n.prototype.incRef=function(e,t){var r=this.state.tensorInfo.has(e.dataId)?this.state.tensorInfo.get(e.dataId).refCount:0;if(this.state.numTensors++,e.dtype==="string"&&this.state.numStringTensors++,r===0){this.state.numDataBuffers++;var i=0;e.dtype!=="complex64"&&e.dtype!=="string"&&(i=e.size*S5(e.dtype)),this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:i,refCount:0}),this.state.numBytes+=i}this.state.tensorInfo.get(e.dataId).refCount++,e instanceof cp||this.track(e)},n.prototype.disposeTensor=function(e){if(this.state.tensorInfo.has(e.dataId)){this.state.numTensors--,e.dtype==="string"&&this.state.numStringTensors--;var t=this.state.tensorInfo.get(e.dataId);t.refCount<=1?(e.dtype!=="complex64"&&(this.state.numBytes-=t.bytes),this.state.numDataBuffers--,t.backend.disposeData(e.dataId),this.state.tensorInfo.delete(e.dataId)):this.state.tensorInfo.get(e.dataId).refCount--}},n.prototype.disposeVariables=function(){for(var e in this.state.registeredVariables){var t=this.state.registeredVariables[e];this.disposeVariable(t)}},n.prototype.disposeVariable=function(e){this.disposeTensor(e),this.state.registeredVariables[e.name]!=null&&delete this.state.registeredVariables[e.name]},n.prototype.memory=function(){var e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,e.reasons==null&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e},n.prototype.profile=function(e){return at(this,void 0,void 0,function(){var t,r;return st(this,function(i){return this.state.profiling=!0,t=this.state.numBytes,r=this.state.numTensors,this.state.activeProfile.kernels=[],this.state.activeProfile.result=e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max.apply(Math,this.state.activeProfile.kernels.map(function(a){return a.totalBytesSnapshot})),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-r,[2,this.state.activeProfile]})})},n.prototype.isTapeOn=function(){return this.state.gradientDepth>
600&&this.state.kernelDepth===0},n.prototype.addTapeNode=function(e,t,r,i,a){var s=this,o={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:r,saved:a},c=gee(e);c!=null&&(i=c.gradFunc),i!=null&&(o.gradient=function(u){return u=u.map(function(l,d){if(l==null){var h=r[d],p=iv(h.size,h.dtype);return s.makeTensor(p,h.shape,h.dtype)}return l}),i(u.length>1?u:u[0],a)}),this.state.activeTape.push(o)},n.prototype.keep=function(e){return e.kept=!0,e},n.prototype.startTape=function(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++},n.prototype.endTape=function(){this.state.gradientDepth--},n.prototype.startScope=function(e){var t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t},n.prototype.endScope=function(e){for(var t=this,r=I5(e),i=new Set(r.map(function(c){return c.id})),a=0;a<this.state.activeScope.track.length;a++){var s=this.state.activeScope.track[a];s.kept||i.has(s.id)||s.dispose()}var o=this.state.scopeStack.pop();this.state.activeScope=this.state.scopeStack.length===0?null:this.state.scopeStack[this.state.scopeStack.length-1],r.forEach(function(c){c.kept||c.scopeId!==o.id||t.track(c)})},n.prototype.gradients=function(e,t,r,i){var a=this;if(i===void 0&&(i=!1),J(t.length>0,function(){return"gradients() received an empty list of xs."}),r!=null&&r.dtype!=="float32")throw new Error("dy must have 'float32' dtype, but has '"+r.dtype+"'");var s=this.scopedRun(function(){return a.startTape()},function(){return a.endTape()},function(){return a.tidy("forward",e)});J(s instanceof mr,function(){return"The result y returned by f() must be a tensor."});var o=function(c,u,l){for(var d={},h={},p=0;p<u.length;p++)d[u[p].id]=!0;for(p=0;p<c.length;p++){var g=(E=c[p]).inputs;for(var v in g){for(var y=g[v],b=!1,x=0;x<u.length;x++)if(d[y.id]){E.outputs.forEach(function(N){return d[N.id]=!0}),b=!0,h[E.id]=!0;break}if(b)break}}var S={};S[l.id]=!0;var w={};for(p=c.length-1;p>=0;p--)for(g=(E=c[p]).inputs,x=0;x<E.outputs.length;x++)if(S[E.outputs[x].id]){for(var v in g)S[g[v].id]=!0,w[E.id]=!0;break}var k=[];for(p=0;p<c.length;p++){var E;if(h[(E=c[p]).id]&&w[E.id]){var I={};for(var v in E.inputs){var P=E.inputs[v];d[P.id]&&(I[v]=P)}var A=Object.assign({},E);A.inputs=I,A.outputs=E.outputs,k.push(A)}}return k}(this.state.activeTape,t,s);if(!i&&o.length===0&&t.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",function(){var c,u,l={};l[s.id]=r??(c=s.shape,u=E5(ct(c),"float32"),ce.makeTensor(u,c,"float32")),function(h,p,g){for(var v=function(b){var x=p[b],S=[];if(x.outputs.forEach(function(I){var P=h[I.id];P!=null?S.push(P):S.push(null)}),x.gradient==null)throw new Error("Cannot compute gradient: gradient function not found for "+x.kernelName+".");var w=x.gradient(S),k=function(I){if(!(I in w))throw new Error("Cannot backprop through input "+I+". Available gradients found: "+Object.keys(w)+".");var P=g(function(){return w[I]()});if(P.dtype!=="float32")throw new Error("Error in gradient for op "+x.kernelName+". The gradient of input "+I+" must have 'float32' dtype, but has '"+P.dtype+"'");var A=x.inputs[I];if(!gi(P.shape,A.shape))throw new Error("Error in gradient for op "+x.kernelName+". The gradient of input '"+I+"' has shape '"+P.shape+"', which does not match the shape of the input '"+A.shape+"'");if(h[A.id]==null)h[A.id]=P;else{var N=h[A.id];h[A.id]=N.add(P),N.dispose()}};for(var E in x.inputs)k(E)},y=p.length-1;y>=0;y--)v(y)}(l,o,function(h){return a.tidy(h)});var d=t.map(function(h){return l[h.id]});return a.state.gradientDepth===0&&(a.state.activeTape.forEach(function(h){for(var p=0,g=h.saved;p<g.length;p++)g[p].dispose()}),a.state.activeTape=null),{value:s,grads:d}})},n.prototype.customGrad=function(e){var t=this;return J(ZC(e),function(){return"The f passed in customGrad(f) must be a function."}),function(){for(var r,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];J(i.every(function(o){return o instanceof mr}),function(){return"The args passed in customGrad(f)(x1, x2,...) must all be tensors"});var s={};
60return i.forEach(function(o,c){s[c]=o}),t.runKernelFunc(function(o,c){return J((r=e.apply(void 0,i.concat([c]))).value instanceof mr,function(){return"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"}),J(ZC(r.gradFunc),function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."}),r.value},s,function(o,c){var u=r.gradFunc(o,c),l=Array.isArray(u)?u:[u];J(l.length===i.length,function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."}),J(l.every(function(h){return h instanceof mr}),function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."});var d={};return l.forEach(function(h,p){d[p]=function(){return h}}),d})}},n.prototype.readSync=function(e){return this.state.tensorInfo.get(e).backend.readSync(e)},n.prototype.read=function(e){return this.state.tensorInfo.get(e).backend.read(e)},n.prototype.time=function(e){return at(this,void 0,void 0,function(){var t,r;return st(this,function(i){switch(i.label){case 0:return t=Oc(),[4,this.backend.time(e)];case 1:return(r=i.sent()).wallMs=Oc()-t,[2,r]}})})},n.prototype.track=function(e){return this.state.activeScope!=null&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e},Object.defineProperty(n.prototype,"registeredVariables",{get:function(){return this.state.registeredVariables},enumerable:!0,configurable:!0}),n.prototype.reset=function(){for(var e in this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new l4,this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null},n.nextTensorId=0,n.nextVariableId=0,n}(),ce=function(){var n=function(){if(dw==null){var t=void 0;if(typeof window<"u")t=window;else if(typeof global<"u")t=global;else if(typeof process<"u")t=process;else{if(typeof self>"u")throw new Error("Could not find a global object");t=self}dw=t}return dw}();if(n._tfengine==null){var e=new pee(n);n._tfengine=new Dee(e)}return function(t){b5=t}(n._tfengine.ENV),Mc=function(){return n._tfengine},n._tfengine}();function O5(){return typeof window<"u"&&window.document!=null||typeof WorkerGlobalScope<"u"}var Tu=ke();Tu.registerFlag("DEBUG",function(){return!1},function(n){n&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")}),Tu.registerFlag("IS_BROWSER",function(){return O5()}),Tu.registerFlag("IS_NODE",function(){return typeof process<"u"&&process.versions!==void 0&&process.versions.node!==void 0}),Tu.registerFlag("IS_CHROME",function(){return typeof navigator<"u"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}),Tu.registerFlag("PROD",function(){return!1}),Tu.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",function(){return Tu.getBool("DEBUG")}),Tu.registerFlag("DEPRECATION_WARNINGS_ENABLED",function(){return!0}),Tu.registerFlag("IS_TEST",function(){return!1});var wg,vs,hs,Od={},fw={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function Nee(n,e){Od[n]=e}function nu(n){n in Od||(Od[n]=function(t){if(t!==1&&t!==2)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");var r=function(i){if(typeof OffscreenCanvas<"u"&&i===2)return new OffscreenCanvas(300,150);if(typeof document<"u")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}(t);return r.addEventListener("webglcontextlost",function(i){i.preventDefault(),delete Od[t]},!1),t===1?r.getContext("webgl",fw)||r.getContext("experimental-webgl",fw):r.getContext("webgl2",fw)}(n));var e=Od[n];return e.isContextLost()?(delete Od[n],nu(n)):(e.disable(e.DEPTH_TEST),e.disable(e.STENCIL_TEST),e.disable(e.BLEND),e.disable(e.DITHER),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SAMPLE_COVERAGE),e.enable(e.SCISSOR_TEST),e.enable(e.CULL_FACE),e.cullFace(e.BACK),Od[n])}function ab(n,e){return[e,n]}function Km(n){var e=ct(n);return QC(Math.ceil(e/4))}function av(n,e){return[Math.max(1,Math.ceil(e/2)),Math.max(1,Math.ceil(n/2))]}function uS(n,e){var t,r,i,a,s,o,c,u,l,d=n;return ke().getNumber("WEBGL_VERSION")===2?(t=d.R32F,r=d.R16F,i=d.RGBA16F,a=d.RGBA32F,s=d.RED,o=4,c=1,u=d.HALF_FLOAT,l=d.FLOAT):(t=n.RGBA,r=n.RGBA,i=n.RGBA,a=d.RGBA,s=n.RGBA,o=4,c=4,u=e!=null?e.HALF_FLOAT_OES:null,l=n.FLOAT),{internalFormatFloat:t,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:i,internalFormatPackedFloat:a,textureFormatFloat:s,downloadTextureFormat:n.RGBA,downloadUnpackNumChannels:o,defaultNumChannels:c,textureTypeHalfFloat:u,textureTypeFloat:l}}function lt(n,e,t){var r=t();return e&&function(i){var a=i.getError();if(a!==i.NO_ERROR)throw new Error("WebGL Error: "+Bee(i,a))}(n),r}(function(n){n[n.DENSE=0]="DENSE",n[n.SHARED_BATCH=1]="SHARED_BATCH"})(wg||(wg={})),function(n){n[n.RENDER=0]="RENDER",n[n.UPLOAD=1]="UPLOAD",n[n.PIXELS=2]="PIXELS",n[n.DOWNLOAD=3]="DOWNLOAD"}(vs||(vs={})),function(n){n[n.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",n[n.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",n[n.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",n[n.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",n[n.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"}(hs||(hs={}));var Lee=596e-10,Fee=65504;function $ee(n){return!!(ke().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||n===0||Lee<Math.abs(n)&&Math.abs(n)<Fee)}function Bee(n,e){switch(e){case n.NO_ERROR:return"NO_ERROR";case n.INVALID_ENUM:return"INVALID_ENUM";case n.INVALID_VALUE:return"INVALID_VALUE";case n.INVALID_OPERATION:return"INVALID_OPERATION";case n.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case n.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case n.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return"Unknown error code "+e}}function k0(n,e,t){return el(n,e,function(){return n.getExtension(t)},'Extension "'+t+'" not supported on this browser.')}function Uee(n,e,t){var r=el(n,e,function(){return n.createShader(n.VERTEX_SHADER)},"Unable to create vertex WebGLShader.");if(lt(n,e,function(){return n.shaderSource(r,t)}),lt(n,e,function(){return n.compileShader(r)}),n.getShaderParameter(r,n.COMPILE_STATUS)===!1)throw console.log(n.getShaderInfoLog(r)),new Error("Failed to compile vertex shader.");return r}function jee(n,e,t){var r=el(n,e,function(){return n.createShader(n.FRAGMENT_SHADER)},"Unable to create fragment WebGLShader.");if(lt(n,e,function(){return n.shaderSource(r,t)}),lt(n,e,function(){return n.compileShader(r)}),n.getShaderParameter(r,n.COMPILE_STATUS)===!1)throw function(i,a){var s=qee.exec(a);if(s==null)return console.log("Couldn't parse line number in error: "+a),void console.log(i);for(var o=+s[1],c=i.split(` 61`),u=c.length.toString().length+2,l=c.map(function(y,b){return Nh((b+1).toString(),u)+y}),d=0,h=0;h<l.length;h++)d=Math.max(l[h].length,d);var p=l.slice(0,o-1),g=l.slice(o-1,o),v=l.slice(o);console.log(p.join(` 62`)),console.log(a.split(` 63`)[0]),console.log("%c "+Nh(g[0],d),"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(v.join(` 64`))}(t,n.getShaderInfoLog(r)),new Error("Failed to compile fragment shader.");return r}var hw,pw,qee=/ERROR: [0-9]+:([0-9]+):/g;function zee(n,e){return el(n,e,function(){return n.createProgram()},"Unable to create WebGLProgram.")}function Wee(n,e,t){if(lt(n,e,function(){return n.linkProgram(t)}),n.getProgramParameter(t,n.LINK_STATUS)===!1)throw console.log(n.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}function mw(n,e,t){if(lt(n,e,function(){return n.validateProgram(t)}),n.getProgramParameter(t,n.VALIDATE_STATUS)===!1)throw console.log(n.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function Hee(n,e,t){var r=el(n,e,function(){return n.createBuffer()},"Unable to create WebGLBuffer");return lt(n,e,function(){return n.bindBuffer(n.ARRAY_BUFFER,r)}),lt(n,e,function(){return n.bufferData(n.ARRAY_BUFFER,t,n.STATIC_DRAW)}),r}function Vee(n,e,t){var r=el(n,e,function(){return n.createBuffer()},"Unable to create WebGLBuffer");return lt(n,e,function(){return n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,r)}),lt(n,e,function(){return n.bufferData(n.ELEMENT_ARRAY_BUFFER,t,n.STATIC_DRAW)}),r}function Gee(n,e){return el(n,e,function(){return n.createTexture()},"Unable to create WebGLTexture.")}function Kee(n,e){var t=ke().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(n<=0||e<=0){var r="["+n+"x"+e+"]";
64throw new Error("Requested texture size "+r+" is invalid.")}if(n>t||e>t)throw r="["+n+"x"+e+"]",new Error("Requested texture size "+r+" greater than WebGL maximum on this browser / GPU "+("["+t+"x"+t+"]")+".")}function Yee(n,e){return el(n,e,function(){return n.createFramebuffer()},"Unable to create WebGLFramebuffer.")}function d4(n,e,t,r,i,a,s,o){var c=n.getAttribLocation(t,r);return c!==-1&&(lt(n,e,function(){return n.bindBuffer(n.ARRAY_BUFFER,i)}),lt(n,e,function(){return n.vertexAttribPointer(c,a,n.FLOAT,!1,s,o)}),lt(n,e,function(){return n.enableVertexAttribArray(c)}),!0)}function Xee(n,e,t,r){tte(n,r),lt(n,e,function(){return n.activeTexture(n.TEXTURE0+r)}),lt(n,e,function(){return n.bindTexture(n.TEXTURE_2D,t)})}function Jee(n,e,t,r){return el(n,e,function(){return n.getUniformLocation(t,r)},'uniform "'+r+'" not present in program.')}function Qee(n,e,t){return n.getUniformLocation(e,t)}function Zee(n,e,t,r,i,a){lt(n,e,function(){return Xee(n,e,r,a)}),lt(n,e,function(){return n.uniform1i(i,a)})}function gw(n,e,t,r){lt(n,e,function(){return n.bindFramebuffer(n.FRAMEBUFFER,r)}),lt(n,e,function(){return n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t,0)})}function f4(n,e,t){lt(n,e,function(){return n.bindFramebuffer(n.FRAMEBUFFER,t)}),lt(n,e,function(){return n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,null,0)})}function S0(n){var e=n.checkFramebufferStatus(n.FRAMEBUFFER);if(e!==n.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+ete(n,e))}function ete(n,e){switch(e){case n.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case n.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case n.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case n.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return"unknown error "+e}}function el(n,e,t,r){var i=lt(n,e,function(){return t()});if(i==null)throw new Error(r);return i}function tte(n,e){var t=n.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=e+n.TEXTURE0;if(r<n.TEXTURE0||r>t)throw new Error("textureUnit must be in "+("[gl.TEXTURE0, gl.TEXTURE"+t+"]")+".")}function Qy(n,e){return e===void 0&&(e=2),ct(n.slice(0,n.length-e))}function Zy(n){if(n.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[n.length>1?n[n.length-2]:1,n[n.length-1]]}function vw(n){var e=[1,1,1];return n.length===0||n.length===1&&n[0]===1||(e=[Qy(n)].concat(Zy(n))),e}function nte(n,e){var t;e===void 0&&(e=!1);var r=ke().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e&&(r*=2,(n=n.map(function(u,l){return l>=n.length-2?k5(n[l]):n[l]})).length===1&&(n=[2,n[0]])),n.length!==2){var i=Bd(n);n=i.newShape}var a=ct(n);if(n.length<=1&&a<=r)return[1,a];if(n.length===2&&n[0]<=r&&n[1]<=r)return n;if(n.length===3&&n[0]*n[1]<=r&&n[2]<=r)return[n[0]*n[1],n[2]];if(n.length===3&&n[0]<=r&&n[1]*n[2]<=r)return[n[0],n[1]*n[2]];if(n.length===4&&n[0]*n[1]*n[2]<=r&&n[3]<=r)return[n[0]*n[1]*n[2],n[3]];if(n.length===4&&n[0]<=r&&n[1]*n[2]*n[3]<=r)return[n[0],n[1]*n[2]*n[3]];if(e){var s=Qy(n),o=2,c=2;return n.length&&(o=(t=Zy(n))[0],c=t[1]),QC(a=s*(o/2)*(c/2)).map(function(u){return 2*u})}return QC(a)}function T0(n){return n%2==0}function E0(n,e){if(gi(n=n.slice(-2),e=e.slice(-2))||!n.length||!e.length||n[0]===0||n[1]===0||e[0]===0||e[1]===0)return!0;if(n.length!==e.length){var t=n.slice(-1)[0],r=e.slice(-1)[0];if(t===r||T0(t)&&T0(r)&&(n[0]===1||e[0]===1))return!0}return n[1]===e[1]&&T0(n[0])&&T0(e[0])}function rte(n){if(hw==null){var e=nu(n);hw=e.getParameter(e.MAX_TEXTURE_SIZE)}return hw}function ite(n){if(pw==null){var e=nu(n);pw=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,pw)}function ate(n){if(n===0)return 0;var e=nu(n);return lo(e,"EXT_disjoint_timer_query_webgl2")&&n===2?2:lo(e,"EXT_disjoint_timer_query")?1:0}function lo(n,e){return n.getExtension(e)!=null}function h4(n){try{if(nu(n)!=null)return!0}catch{return!1}return!1}function ste(n){if(n===0)return!1;var e=nu(n);if(n===1){if(!lo(e,"OES_texture_float"))return!1}else if(!lo(e,"EXT_color_buffer_float"))return!1;return ak(e)}function ote(n){if(n===0)return!1;var e=nu(n);if(n!==1){if(lo(e,"EXT_color_buffer_float"))return ak(e);if(lo(e,"EXT_color_buffer_half_float")){var t=e.getExtension("EXT_color_buffer_half_float");return function(r,i){var a=uS(r,i),s=r.createTexture();r.bindTexture(r.TEXTURE_2D,s),r.texImage2D(r.TEXTURE_2D,0,a.internalFormatHalfFloat,1,1,0,a.textureFormatFloat,a.textureTypeHalfFloat,null);var o=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,o),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,s,0);var c=r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE;return r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteTexture(s),r.deleteFramebuffer(o
64),c}(e,t)}return!1}return!!lo(e,"OES_texture_float")&&!!lo(e,"WEBGL_color_buffer_float")&&ak(e)}function ak(n){var e=uS(n),t=n.createTexture();n.bindTexture(n.TEXTURE_2D,t),n.texImage2D(n.TEXTURE_2D,0,e.internalFormatFloat,1,1,0,e.textureFormatFloat,e.textureTypeFloat,null);var r=n.createFramebuffer();n.bindFramebuffer(n.FRAMEBUFFER,r),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t,0);var i=n.checkFramebufferStatus(n.FRAMEBUFFER)===n.FRAMEBUFFER_COMPLETE;return n.bindTexture(n.TEXTURE_2D,null),n.bindFramebuffer(n.FRAMEBUFFER,null),n.deleteTexture(t),n.deleteFramebuffer(r),i}function cte(n){return n===2&&nu(n).fenceSync!=null}var Et=ke();function M5(n){ke().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(n+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}function Ze(n,e){return ce.tidy(n,e)}function $a(n){I5(n).forEach(function(e){return e.dispose()})}function ute(n){return ce.keep(n)}function e_(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];ke().getBool("IS_TEST")||console.warn.apply(console,n)}function od(n,e){var t=n;if(Vc(n))return e==="string"?[]:[n.length];if(!Array.isArray(n))return[];for(var r=[];Array.isArray(t)||Vc(t)&&e!=="string";)r.push(t.length),t=t[0];return Array.isArray(n)&&ke().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&function i(a,s,o){if(o=o||[],!Array.isArray(a)&&!Vc(a))return void J(s.length===0,function(){return"Element arr["+o.join("][")+"] is a primitive, but should be an array/TypedArray of "+s[0]+" elements"});J(s.length>0,function(){return"Element arr["+o.join("][")+"] should be a primitive, but is an array of "+a.length+" elements"}),J(a.length===s[0],function(){return"Element arr["+o.join("][")+"] should have "+s[0]+" elements, but has "+a.length+" elements"});for(var c=s.slice(1),u=0;u<a.length;++u)i(a[u],c,o.concat(u))}(n,r,[]),r}function p4(n,e,t,r){if(n!=null&&(n!=="numeric"&&n!==e||n==="numeric"&&e==="string"))throw new Error("Argument '"+t+"' passed to '"+r+"' must be "+n+" tensor, but got "+e+" tensor")}function G(n,e,t,r){if(r===void 0&&(r="numeric"),n instanceof mr)return p4(r,n.dtype,e,t),n;var i=rv(n);if(i!=="string"&&["bool","int32","float32"].indexOf(r)>=0&&(i=r),p4(r,i,e,t),n==null||!Vc(n)&&!Array.isArray(n)&&typeof n!="number"&&typeof n!="boolean"&&typeof n!="string"){var a=n==null?"null":n.constructor.name;throw new Error("Argument '"+e+"' passed to '"+t+"' must be a Tensor or TensorLike, but got '"+a+"'")}var s=od(n,i);Vc(n)||Array.isArray(n)||(n=[n]);var o=i!=="string"?T5(n,i,ke().getBool("DEBUG")):op(n,[],!0);return ce.makeTensor(o,s,i)}function t_(n,e,t,r){if(r===void 0&&(r="numeric"),!Array.isArray(n))throw new Error("Argument "+e+" passed to "+t+" must be a `Tensor[]` or `TensorLike[]`");return n.map(function(i,a){return G(i,e+"["+a+"]",t)},r)}function D5(n,e){for(var t=0;t<n.length;++t)if(n[n.length-t-1]!==e-1-t)return!1;return!0}function lte(n,e,t){for(var r=n.length+e.length,i=[],a=0,s=0,o=0;o<r;o++)t.indexOf(o)===-1?i.push(n[a++]):i.push(e[s++]);return i}function qi(n,e){for(var t=[],r=n.length,i=0;i<r;i++)e.indexOf(i)===-1&&t.push(n[i]);return[t,e.map(function(a){return n[a]})]}function za(n,e){return lte(n,e.map(function(t){return 1}),e)}function ds(n,e,t){J(D5(e,t),function(){return n+" supports only inner-most axes for now. Got axes "+e+" and rank-"+t+" input."})}function ru(n,e){if(D5(n,e))return null;for(var t=[],r=0;r<e;++r)n.indexOf(r)===-1&&t.push(r);return n.forEach(function(i){return t.push(i)}),t}function lS(n){return n.map(function(e,t){return[t,e]}).sort(function(e,t){return e[1]-t[1]}).map(function(e){return e[0]})}function iu(n,e){for(var t=[],r=e-n;r<e;++r)t.push(r);return t}function dte(n,e){var t=n[0].length;n.forEach(function(i,a){J(i.length===t,function(){return"Error in concat"+t+"D: rank of tensors["+a+"] must be the same as the rank of the rest ("+t+")"})}),J(e>=0&&e<t,function(){return"Error in concat"+t+"D: axis must be between 0 and "+(t-1)+"."});var r=n[0];n.forEach(function(i,a){for(var s=0;s<t;s++)J(s===e||i[s]===r[s],function(){return"Error in concat"+t+"D: Shape of tensors["+a+"] ("+i+") does not match the shape of the rest ("+r+") along the non-concatenated axis "+a+"."})})}function up(n,e){for(var t=n[0].slice(),r=1;r<n.length;r++)t[e]+=n[r][e];return t}function re(n){var e=Object.keys(n);if(e.length!==1)throw new Error("Please provide an object with a single key (operation name) mapping to a function. Got an object with "+e.length+" keys.");var t=e[0],r=n[t];
64t.endsWith("_")&&(t=t.substring(0,t.length-1));var i=function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];ce.startScope(t);try{var o=r.apply(void 0,a);return o instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),ce.endScope(o),o}catch(c){throw ce.endScope(null),c}};return Object.defineProperty(i,"name",{value:t,configurable:!0}),i}Et.registerFlag("HAS_WEBGL",function(){return Et.getNumber("WEBGL_VERSION")>0}),Et.registerFlag("WEBGL_VERSION",function(){return h4(2)?2:h4(1)?1:0}),Et.registerFlag("WEBGL_BUFFER_SUPPORTED",function(){return Et.get("WEBGL_VERSION")===2}),Et.registerFlag("WEBGL_CPU_FORWARD",function(){return!0}),Et.registerFlag("WEBGL_FORCE_F16_TEXTURES",function(){return!1}),Et.registerFlag("WEBGL_PACK",function(){return Et.getBool("HAS_WEBGL")}),Et.registerFlag("WEBGL_PACK_NORMALIZATION",function(){return Et.getBool("WEBGL_PACK")}),Et.registerFlag("WEBGL_PACK_CLIP",function(){return Et.getBool("WEBGL_PACK")}),Et.registerFlag("WEBGL_PACK_DEPTHWISECONV",function(){return!1}),Et.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",function(){return Et.getBool("WEBGL_PACK")}),Et.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",function(){return Et.getBool("WEBGL_PACK")}),Et.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",function(){return Et.getBool("WEBGL_PACK")}),Et.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",function(){return Et.getBool("WEBGL_PACK")}),Et.registerFlag("WEBGL_PACK_REDUCE",function(){return Et.getBool("WEBGL_PACK")}),Et.registerFlag("WEBGL_LAZILY_UNPACK",function(){return Et.getBool("WEBGL_PACK")}),Et.registerFlag("WEBGL_CONV_IM2COL",function(){return Et.getBool("WEBGL_PACK")}),Et.registerFlag("WEBGL_MAX_TEXTURE_SIZE",function(){return rte(Et.getNumber("WEBGL_VERSION"))}),Et.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",function(){return ite(Et.getNumber("WEBGL_VERSION"))}),Et.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",function(){var n=Et.getNumber("WEBGL_VERSION");return n===0?0:ate(n)}),Et.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",function(){return Et.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&(n=navigator.userAgent||navigator.vendor||window.opera,!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(n)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(n.substr(0,4))));var n}),Et.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",function(){return ste(Et.getNumber("WEBGL_VERSION"))}),Et.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",function(){return!Et.getBool("WEBGL_FORCE_F16_TEXTURES")&&Et.getBool("WEBGL_RENDER_FLOAT32_CAPABLE")}),Et.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",function(){return ote(Et.getNumber("WEBGL_VERSION"))}),Et.registerFlag("WEBGL_FENCE_API_ENABLED",function(){return cte(Et.getNumber("WEBGL_VERSION"))}),Et.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",function(){return Et.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0}),A5=M5;var Ti=re({complex_:function(n,e){var t=G(n,"real","complex"),r=G(e,"imag","complex");return Pn(t.shape,r.shape,"real and imag shapes, "+t.shape+" and "+r.shape+", must match in call to tf.complex()."),ce.runKernelFunc(function(i){return i.complex(t,r)},{$real:t,$imag:r})}}
64),oo=re({real_:function(n){var e=G(n,"input","real");return ce.runKernelFunc(function(t){return t.real(e)},{$input:e})}}),Dc=re({imag_:function(n){var e=G(n,"input","imag");return ce.runKernelFunc(function(t){return t.imag(e)},{$input:e})}});function Pi(n,e,t){return cd(n,e,od(n,t),t)}function cd(n,e,t,r){if(r==null&&(r=rv(n)),r==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!Vc(n)&&!Array.isArray(n)&&typeof n!="number"&&typeof n!="boolean"&&typeof n!="string")throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(e!=null){P5(e);var i=ct(e),a=ct(t);J(i===a,function(){return"Based on the provided shape, ["+e+"], the tensor should have "+i+" values but has "+a});for(var s=0;s<t.length;++s){var o=t[s],c=s!==t.length-1||o!==ct(e.slice(s));J(t[s]===e[s]||!c,function(){return"Error creating a new Tensor. Inferred shape ("+t+") does not match the provided shape ("+e+"). "})}}return Vc(n)||Array.isArray(n)||(n=[n]),e=e||t,n=r!=="string"?T5(n,r,ke().getBool("DEBUG")):op(n,[],!0),ce.makeTensor(n,e,r)}function Ke(n,e){if((Vc(n)&&e!=="string"||Array.isArray(n))&&e!=="complex64")throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if(e==="string"&&Vc(n)&&!(n instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return cd(n,[],[],e)}function Hr(n,e){Np(n);var t=od(n,e);if(t.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return cd(n,null,t,e)}function $l(n,e,t){if(Np(n),e!=null&&e.length!==2)throw new Error("tensor2d() requires shape to have two numbers");var r=od(n,t);if(r.length!==2&&r.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return cd(n,e,r,t)}function dS(n,e,t){if(Np(n),e!=null&&e.length!==3)throw new Error("tensor3d() requires shape to have three numbers");var r=od(n,t);if(r.length!==3&&r.length!==1)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return cd(n,e,r,t)}function Ma(n,e,t){if(Np(n),e!=null&&e.length!==4)throw new Error("tensor4d() requires shape to have four numbers");var r=od(n,t);if(r.length!==4&&r.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return cd(n,e,r,t)}function fte(n,e,t){if(Np(n),e!=null&&e.length!==5)throw new Error("tensor5d() requires shape to have five numbers");var r=od(n,t);if(r.length!==5&&r.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return cd(n,e,r,t)}function hte(n,e,t){if(Np(n),e!=null&&e.length!==6)throw new Error("tensor6d() requires shape to have six numbers");var r=od(n,t);if(r.length!==6&&r.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return cd(n,e=e||r,r,t)}function pte(n,e,t,r){return e===void 0&&(e=!0),ce.makeVariable(n,e,t,r)}function Lp(n,e){if(e===void 0&&(e="float32"),e==="complex64"){var t=Lp(n,"float32"),r=Gn(n,"float32");return Ti(t,r)}var i=E5(ct(n),e);return ce.makeTensor(i,n,e)}function Gn(n,e){if(e===void 0&&(e="float32"),e==="complex64"){var t=Gn(n,"float32"),r=Gn(n,"float32");return Ti(t,r)}var i=iv(ct(n),e);return ce.makeTensor(i,n,e)}function Kc(n,e,t){return ce.runKernelFunc(function(r){return r.fill(n,e,t)},{})}function mte(n,e,t){if(t<=0)throw new Error("The number of values should be positive.");return ce.runKernelFunc(function(r){return r.linspace(n,e,t)},{})}function n_(n,e,t,r){if(t===void 0&&(t=1),r===void 0&&(r="float32"),t===0)throw new Error("Cannot have a step of zero");if(n===e||n<e&&t<0||e<n&&t>1)return Gn([0],r);var i=iv(Math.abs(Math.ceil((e-n)/t)),r);e<n&&t===1&&(t=-1),i[0]=n;for(var a=1;a<i.length;a++)i[a]=i[a-1]+t;return Hr(i,r)}
vendor: 8,375 bytes, lines 64-65
64var N5=re({onesLike_:function(n){var e=G(n,"x","onesLike");if(e.dtype==="complex64"){var t=N5(oo(e)),r=dn(Dc(e));return Ti(t,r)}return ce.runKernelFunc(function(i){return i.onesLike(e)},{$x:e},function(i,a){return{$x:function(){return dn(i)}}})}}),dn=re({zerosLike_:function(n){var e=G(n,"x","zerosLike");return ce.runKernelFunc(function(t){return t.zerosLike(e)},{$x:e},function(t,r){return{$x:function(){return dn(t)}}})}}),ai=re({concat_:function(n,e){e===void 0&&(e=0),J(n.length>=1,function(){return"Pass at least one tensor to concat"});var t=t_(n,"tensors","concat");t[0].dtype==="complex64"&&t.forEach(function(o){if(o.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor 65 with dtype `+o.dtype+". ")}),e=ui(e,t[0].shape)[0];var r=up(t.map(function(o){return o.shape}),e);if(ct(r)===0)return Pi([],r);if((t=t.filter(function(o){return o.size>0})).length===1)return t[0];var i=t.map(function(o){return o.shape});dte(i,e);var a=t,s={axis:e};return ce.runKernelFunc(function(o){return o.concat(t,e)},a,function(o){var c=i.map(function(u){return u[e]});return fS(o,c,e).map(function(u){return function(){return u}})},"Concat",s)}}),gte=re({concat1d_:function(n){return ai(n,0)}}),vte=re({concat2d_:function(n,e){return ai(n,e)}}),yte=re({concat3d_:function(n,e){return ai(n,e)}}),_te=re({concat4d_:function(n,e){return ai(n,e)}}),fS=re({split_:function(n,e,t){t===void 0&&(t=0);var r,i=G(n,"x","split");return t=ui(t,i.shape)[0],typeof e=="number"?(J(i.shape[t]%e==0,function(){return"Number of splits must evenly divide the axis."}),r=new Array(e).fill(i.shape[t]/e)):(J(i.shape[t]===e.reduce(function(a,s){return a+s}),function(){return"The sum of sizes must match the size of the axis dimension."}),r=e),ce.runKernelFunc(function(a){return a.split(i,r,t)},{$x:i},function(a){return{$x:function(){return ai(a,t)}}})}});function Pf(n,e){return n(e={exports:{}},e.exports),e.exports}var bte=Pf(function(n){(function(e,t,r){function i(o){var c,u=this,l=(c=4022871197,function(d){d=d.toString();for(var h=0;h<d.length;h++){var p=.02519603282416938*(c+=d.charCodeAt(h));p-=c=p>>>0,c=(p*=c)>>>0,c+=4294967296*(p-=c)}return 23283064365386963e-26*(c>>>0)});u.next=function(){var d=2091639*u.s0+23283064365386963e-26*u.c;return u.s0=u.s1,u.s1=u.s2,u.s2=d-(u.c=0|d)},u.c=1,u.s0=l(" "),u.s1=l(" "),u.s2=l(" "),u.s0-=l(o),u.s0<0&&(u.s0+=1),u.s1-=l(o),u.s1<0&&(u.s1+=1),u.s2-=l(o),u.s2<0&&(u.s2+=1),l=null}function a(o,c){return c.c=o.c,c.s0=o.s0,c.s1=o.s1,c.s2=o.s2,c}function s(o,c){var u=new i(o),l=c&&c.state,d=u.next;return d.int32=function(){return 4294967296*u.next()|0},d.double=function(){return d()+11102230246251565e-32*(2097152*d()|0)},d.quick=d,l&&(typeof l=="object"&&a(l,u),d.state=function(){return a(u,{})}),d}t&&t.exports?t.exports=s:this.alea=s})(0,n)}),xte=Pf(function(n){(function(e,t,r){function i(o){var c=this,u="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var d=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^d^d>>>8},o===(0|o)?c.x=o:u+=o;for(var l=0;l<u.length+64;l++)c.x^=0|u.charCodeAt(l),c.next()}function a(o,c){return c.x=o.x,c.y=o.y,c.z=o.z,c.w=o.w,c}function s(o,c){var u=new i(o),l=c&&c.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var h=((u.next()>>>11)+(u.next()>>>0)/4294967296)/2097152;while(h===0);return h},d.int32=u.next,d.quick=d,l&&(typeof l=="object"&&a(l,u),d.state=function(){return a(u,{})}),d}t&&t.exports?t.exports=s:this.xor128=s})(0,n)}),wte=Pf(function(n){(function(e,t,r){function i(o){var c=this,u="";c.next=function(){var d=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^d^d<<1)|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,o===(0|o)?c.x=o:u+=o;for(var l=0;l<u.length+64;l++)c.x^=0|u.charCodeAt(l),l==u.length&&(c.d=c.x<<10^c.x>>>4),c.next()}function a(o,c){return c.x=o.x,c.y=o.y,c.z=o.z,c.w=o.w,c.v=o.v,c.d=o.d,c}function s(o,c){var u=new i(o),l=c&&c.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var h=((u.next()>>>11)+(u.next()>>>0)/4294967296)/2097152;while(h===0);return h},d.int32=u.next,d.quick=d,l&&(typeof l=="object"&&a(l,u),d.state=function(){return a(u,{})}),d}t&&t.exports?t.exports=s:this.xorwow=s})(0,n)}),Cte=Pf(function(n){(function(e,t,r){function i(o){var c=this;c.next=function(){var u,l,d=c.x,h=c.i;return u=d[h],l=(u^=u>>>7)^u<<24,l^=(u=d[h+1&7])^u>>>10,l^=(u=d[h+3&7])^u>>>3,l^=(u=d[h+4&7])^u<<7,u=d[h+7&7],l^=(u^=u<<13)^u<<9,d[h]=l,c.i=h+1&7,l},function(u,l){var d,h=[];if(l===(0|l))h[0]=l;else for(l=""+l,d=0;d<l.length;++d)h[7&d]=h[7&d]<<15^l.charCodeAt(d)+h[d+1&7]<<13;for(;h.length<8;)h.push(0);for(d=0;d<8&&h[d]===0;++d);for(d==8?h[7]=-1:h[d],u.x=h,u.i=0,d=256;d>0;--d)u.next()}(c,o)}function a(o,c){return c.x=o.x.slice(),c.i=o.i,c}function s(o,c){o==null&&(o=+new Date);var u=new i(o),l=c&&c.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var h=((u.next()>>>11)+(u.next()>>>0)/4294967296)/2097152;while(h===0);return h},d.int32=u.next,d.quick=d,l&&(l.x&&a(l,u),d.state=function(){return a(u,{})}),d}t&&t.exports?t.exports=s:this.xorshift7=s})(0,n)}),kte=Pf(function(n){(function(e,t,r){function i(o){var c=this;c.next=function(){var u,l,d=c.w,h=c.X,p=c.i;return c.w=d=d+1640531527|0,l=h[p+34&127],u=h[p=p+1&127],l^=l<<13,u^=u<<17,l^=l>>>15,u^=u>>>12,l=h[p]=l^u,c.i=p,l+(d^d>>>16)|0},function(u,l){var d,h,p,g,v,y=[],b=128;for(l===(0|l)?(h=l,l=null):(l+="\0",h=0,b=Math.max(b,l.length)),p=0,g=-32;g<b;++g)l&&(h^=l.charCodeAt((g+32)%l.length)),g===0&&(v=h),h^=h<<10,h^=h>>>15,h^=h<<4,h^=h>>>13,g>=0&&(v=v+1640531527|0,p=(d=y[127&g]^=h+v)==0?p+1:0);for(p>=128&&(y[127&(l&&l.length||0)]=-1),p=127,g=512;g>0;--g)h=y[p+34&127],d=y[p=p+1&127],h^=h<<13,d^=d<<17,h^=h>>>15,d^=d>>>12,y[p]=h^d;u.w=v,u.X=y,u.i=p}(c,o)}function a(o,c){return c.i=o.i,c.w=o.w,c.X=o.X.slice(),c}function s(o,c){o==null&&(o=+new Date);var u=new i(o),l=c&&c.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var h=((u.next()>>>11)+(u.next()>>>0)/4294967296)/2097152;while(h===0);return h},d.int32=u.next,d.quick=d,l&&(l.X&&a(l,u),d.state=function(){return a(u,{})}),d}t&&t.exports?t.exports=s:this.xor4096=s})(0,n)}),Ste=Pf(function(n){(function(e,t,r){function i(o){var c=this,u="";c.next=function(){var d=c.b,h=c.c,p=c.d,g=c.a;return d=d<<25^d>>>7^h,h=h-p|0,p=p<<24^p>>>8^g,g=g-d|0,c.b=d=d<<20^d>>>12^h,c.c=h=h-p|0,c.d=p<<16^h>>>16^g,c.a=g-d|0},c.a=0,c.b=0,c.c=-1640531527,c.d=1367130551,o===Math.floor(o)?(c.a=o/4294967296|0,c.b=0|o):u+=o;for(var l=0;l<u.length+20;l++)c.b^=0|u.charCodeAt(l),c.next()}function a(o,c){return c.a=o.a,c.b=o.b,c.c=o.c,c.d=o.d,c}function s(o,c){var u=new i(o),l=c&&c.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var h=((u.next()>>>11)+(u.next()>>>0)/4294967296)/2097152;while(h===0);return h},d.int32=u.next,d.quick=d,l&&(typeof l=="object"&&a(l,u),d.state=function(){return a(u,{})}),d}t&&t.exports?t.exports=s:this.tychei=s})(0,n)}),Md=Pf(function(n){(function(e,t){var r,i=this,a=256,s=6,o="random",c=t.pow(a,s),u=t.pow(2,52),l=2*u,d=a-1;function h(b,x,S){var w=[],k=v(function P(A,N){var j,L=[],B=typeof A;if(N&&B=="object")for(j in A)try{L.push(P(A[j],N-1))}catch{}return L.length?L:B=="string"?A:A+"\0"}((x=x==1?{entropy:!0}:x||{}).entropy?[b,y(e)]:b??function(){try{var P;return r&&(P=r.randomBytes)?P=P(a):(P=new Uint8Array(a),(i.crypto||i.msCrypto).getRandomValues(P)),y(P)}catch{var A=i.navigator,N=A&&A.plugins;return[+new Date,i,N,i.screen,y(e)]}}(),3),w),E=new p(w),I=function(){for(var P=E.g(s),A=c,N=0;P<u;)P=(P+N)*a,A*=a,N=E.g(1);for(;P>=l;)P/=2,A/=2,N>>>=1;return(P+N)/A};return I.int32=function(){return 0|E.g(4)},I.quick=function(){return E.g(4)/4294967296},I.double=I,v(y(E.S),e),(x.pass||S||function(P,A,N,j){return j&&(j.S&&g(j,E),P.state=function(){return g(E,{})}),N?(t[o]=P,A):P})(I,k,"global"in x?x.global:this==t,x.state)}function p(b){var x,S=b.length,w=this,k=0,E=w.i=w.j=0,I=w.S=[];for(S||(b=[S++]);k<a;)I[k]=k++;for(k=0;k<a;k++)I[k]=I[E=d&E+b[k%S]+(x=I[k])],I[E]=x;(w.g=function(P){for(var A,N=0,j=w.i,L=w.j,B=w.S;P--;)A=B[j=d&j+1],N=N*a+B[d&(B[j]=B[L=d&L+A])+(B[L]=A)];return w.i=j,w.j=L,N})(a)}function g(b,x){return x.i=b.i,x.j=b.j,x.S=b.S.slice(),x}function v(b,x){for(var S,w=b+"",k=0;k<w.length;)x[d&k]=d&(S^=19*x[d&k])+w.charCodeAt(k++);return y(x)}function y(b){return String.fromCharCode.apply(0,b)}
65if(t["seed"+o]=h,v(t.random(),e),n.exports){n.exports=h;try{r=require("crypto")}catch{}}})([],Math)});Md.alea=bte,Md.xor128=xte,Md.xorwow=wte,Md.xorshift7=Cte,Md.xor4096=kte,Md.tychei=Ste;var sb=Md.alea,hS=function(){function n(e,t,r,i,a){this.mean=e,this.stdDev=t,this.dtype=r,this.nextVal=NaN,this.truncated=i,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);var s=a||Math.random();this.random=sb(s.toString())}return n.prototype.nextValue=function(){if(!isNaN(this.nextVal)){var e=this.nextVal;return this.nextVal=NaN,e}for(var t,r,i=!1;!i;){var a=void 0,s=void 0,o=void 0;do o=(a=2*this.random()-1)*a+(s=2*this.random()-1)*s;while(o>=1||o===0);var c=Math.sqrt(-2*Math.log(o)/o);t=this.mean+this.stdDev*a*c,r=this.mean+this.stdDev*s*c,this.truncated&&!this.isValidTruncated(t)||(i=!0)}return this.truncated&&!this.isValidTruncated(r)||(this.nextVal=this.convertValue(r)),this.convertValue(t)},n.prototype.convertValue=function(e){return this.dtype==null||this.dtype==="float32"?e:Math.round(e)},n.prototype.isValidTruncated=function(e){return e<=this.upper&&e>=this.lower},n}(),Tte=function(){function n(e,t,r,i){this.alpha=e,this.beta=1/t,this.dtype=r;var a=i||Math.random();this.randu=sb(a.toString()),this.randn=new hS(0,1,r,!1,this.randu()),this.d=e<1?e+2/3:e-1/3,this.c=1/Math.sqrt(9*this.d)}return n.prototype.nextValue=function(){for(var e,t,r,i,a,s;;){do i=this.randn.nextValue(),s=1+this.c*i;while(s<=0);if(s*=s*s,t=1-.331*(e=i*i)*e,r=.5*e+this.d*(1-s+Math.log(s)),(a=this.randu())<t||Math.log(a)<r)break}return s=1/this.beta*this.d*s,this.alpha<1&&(s*=Math.pow(this.randu(),1/this.alpha)),this.convertValue(s)},n.prototype.convertValue=function(e){return this.dtype==="float32"?e:Math.round(e)},n}(),Ete=function(){function n(e,t,r,i){var a=this;if(e===void 0&&(e=0),t===void 0&&(t=1),this.canReturnFloat=function(){return a.dtype==null||a.dtype==="float32"},this.min=e,this.range=t-e,this.dtype=r,i==null&&(i=Math.random()),typeof i=="number"&&(i=i.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error("The difference between "+e+" - "+t+" <= 1 and dtype is not float");this.random=sb(i)}return n.prototype.convertValue=function(e){return this.canReturnFloat()?e:Math.round(e)},n.prototype.nextValue=function(){return this.convertValue(this.min+this.range*this.random())},n}();function Dt(n,e,t){return e===void 0&&(e="float32"),e=e||"float32",P5(n),new xg(n,e,t)}function Pte(n,e){e===void 0&&(e=!1),console.log(n.toString(e))}var L5=re({batchToSpaceND_:function(n,e,t){var r=G(n,"x","batchToSpaceND"),i=e.reduce(function(a,s){return a*s});return J(r.rank>=1+e.length,function(){return"input rank is "+r.rank+" but should be > than blockShape.length "+e.length}),J(t.length===e.length,function(){return"crops.length is "+t.length+" but should be equal to blockShape.length "+e.length}),J(r.shape[0]%i==0,function(){return"input tensor batch is "+r.shape[0]+" but is not divisible by the product of the elements of blockShape "+e.join(" * ")+" === "+i}),ce.runKernelFunc(function(a){return a.batchToSpaceND(r,e,t)},{$x:r},function(a){return{$x:function(){return a.spaceToBatchND(e,t)}}})}}),Rte=re({broadcastTo_:function(n,e){var t=G(n,"broadcastTo","x"),r=t.shape;if(e.some(function(c){return!(c>0)||c%1!=0}))throw new Error("broadcastTo(): Invalid broadcast shape ["+e+"].");if(e.length<t.rank)throw new Error("broadcastTo(): shape.length="+e.length+" < input.rank="+t.rank+".");if(e.length>t.rank){for(var i=t.shape.slice();i.length<e.length;)i.unshift(1);t=t.reshape(i)}for(var a=Array.from(e),s=e.length-1;s>=0;s--)if(t.shape[s]===e[s])a[s]=1;else if(t.shape[s]!==1)throw new Error("broadcastTo(): ["+r+"] cannot be broadcast to ["+e+"].");var o=a.map(function(c,u){return c>1?u:-1}).filter(function(c){return c>=0});return o.length===0?t.clone():ce.runKernelFunc(function(c){return c.tile(t,a)},{input:t},function(c){return{input:function(){return c.sum(o,!0)}}})}}),Ate=re({cast_:function(n,e){var t=G(n,"x","cast");if(!wee(e))throw new Error("Failed to cast to unknown dtype "+e);if(e==="string"&&t.dtype!=="string"||e!=="string"&&t.dtype==="string")throw new Error("Only strings can be casted to strings");var r={dtype:e};return ce.runKernelFunc(function(i){return i.cast(t,e)},{x:t},function(i){return{x:function(){return i.clone()}}},"Cast",r)}}
65),Ite=re({clone_:function(n){var e=G(n,"x","clone",null);return ce.runKernelFunc(function(){return ce.makeTensorFromDataId(e.dataId,e.shape,e.dtype)},{$x:e},function(t){return{$x:function(){return t.toFloat()}}})}}),Ote=re({cumsum_:function(n,e,t,r){e===void 0&&(e=0),t===void 0&&(t=!1),r===void 0&&(r=!1);var i=G(n,"x","cumsum"),a=ru([e|=0],i.rank),s=i;a!=null&&(s=i.transpose(a));var o=iu(1,i.rank)[0],c=ce.runKernelFunc(function(u){return u.cumsum(s,o,t,r)},{permutedX:s},function(u){return{permutedX:function(){return u.cumsum(e,t,!r)}}});return a!=null&&(c=c.transpose(a)),c}}),Mte=re({depthToSpace_:function(n,e,t){t===void 0&&(t="NHWC");var r=G(n,"x","depthToSpace"),i=t==="NHWC"?r.shape[1]:r.shape[2],a=t==="NHWC"?r.shape[2]:r.shape[3],s=t==="NHWC"?r.shape[3]:r.shape[1];return J(i*e>=0,function(){return`Negative dimension size caused by overflow when multiplying 66 `+i+" and "+e+` for depthToSpace with input shape 67 `+r.shape}),J(a*e>=0,function(){return`Negative dimension size caused by overflow when multiplying 68 `+a+" and "+e+` for depthToSpace with input shape 69 `+r.shape}),J(s%(e*e)==0,function(){return"Dimension size must be evenly divisible by "+e*e+" but is "+s+" for depthToSpace with input shape "+r.shape}),ce.runKernelFunc(function(o){return o.depthToSpace(r,e,t)},{$x:r})}}),ao=re({expandDims_:function(n,e){e===void 0&&(e=0);var t=G(n,"x","expandDims",null);J(e<=t.rank,function(){return"Axis must be <= rank of the tensor"});var r=t.shape.slice();return e<0&&(J(-(t.rank+1)<=e,function(){return"Axis must be in the interval ["+-(t.rank+1)+", "+t.rank+"]"}),e=t.rank+e+1),r.splice(e,0,1),Jo(t,r)}}),F5=re({eye_:function(n,e,t,r){r===void 0&&(r="float32"),e==null&&(e=n);for(var i=Dt([n,e],r),a=n<=e?n:e,s=0;s<a;++s)i.set(1,s,s);var o=i.toTensor().as2D(n,e);if(t==null)return o;if(t.length===1)return Lh(ao(o,0),[t[0],1,1]);if(t.length===2)return Lh(ao(ao(o,0),0),[t[0],t[1],1,1]);if(t.length===3)return Lh(ao(ao(ao(o,0),0),0),[t[0],t[1],t[2],1,1]);throw new Error("eye() currently supports only 1D and 2D batchShapes, but received "+t.length+"D.")}}),Dte=re({multinomial_:function(n,e,t,r){r===void 0&&(r=!1);var i=G(n,"logits","multinomial"),a=i.size,s=i.rank;if(a<2)throw new Error("Error in multinomial: you need at least 2 outcomes, but got "+a+".");if(s>2)throw new Error("Rank of probabilities must be 1 or 2, but is "+s);t=t||Math.random();var o=s===1?i.as2D(1,-1):i,c=ce.runKernelFunc(function(u){return u.multinomial(o,r,e,t)},{logits2D:o});return s===1?c.as1D():c}}),sk=re({oneHot_:function(n,e,t,r){if(t===void 0&&(t=1),r===void 0&&(r=0),e<2)throw new Error("Error in oneHot: depth must be >=2, but it is "+e);var i=G(n,"indices","oneHot","int32"),a=i.shape.concat([e]);return i=i.flatten(),ce.runKernelFunc(function(s){return s.oneHot(i,e,t,r)},{$indices:i},function(s){return{$indices:function(){return Gn(i.shape,"float32")}}}).reshape(a)}}),Rf=re({pad_:function(n,e,t){t===void 0&&(t=0);var r=G(n,"x","pad");if(r.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");var i={paddings:e,constantValue:t};return ce.runKernelFunc(function(a){return a.pad(r,e,t)},{x:r},function(a){var s=e.map(function(o){return o[0]});return{x:function(){return a.slice(s,r.shape)}}},"PadV2",i)}}),Nte=re({pad1d_:function(n,e,t){return t===void 0&&(t=0),J(e.length===2,function(){return"Invalid number of paddings. Must be length of 2."}),Rf(n,[e],t)}}),Lte=re({pad2d_:function(n,e,t){return t===void 0&&(t=0),J(e.length===2&&e[0].length===2&&e[1].length===2,function(){return"Invalid number of paddings. Must be length of 2 each."}),Rf(n,e,t)}}),Fte=re({pad3d_:function(n,e,t){return t===void 0&&(t=0),J(e.length===3&&e[0].length===2&&e[1].length===2&&e[2].length===2,function(){return"Invalid number of paddings. Must be length of 2 each."}),Rf(n,e,t)}}),$te=re({pad4d_:function(n,e,t){return t===void 0&&(t=0),J(e.length===4&&e[0].length===2&&e[1].length===2&&e[2].length===2&&e[3].length===2,function(){return"Invalid number of paddings. Must be length of 2 each."}),Rf(n,e,t)}}),Bte=re({rand_:function(n,e,t){var r=ct(n),i=null;if(t==null||t==="float32")i=new Float32Array(r);else if(t==="int32")i=new Int32Array(r);else{if(t!=="bool")throw new Error("Unknown data type "+t);i=new Uint8Array(r)}for(var a=0;a<r;a++)i[a]=e();return ce.makeTensor(i,n,t)}}),Ute=re({randomNormal_:function(n,e,t,r,i){if(e===void 0&&(e=0),t===void 0&&(t=1),r!=null&&r==="bool")throw new Error("Unsupported data type "+r);for(var a=new hS(e,t,r,!1,i),s=Dt(n,r),o=0;o<s.values.length;o++)s.values[o]=a.nextValue();return s.toTensor()}}),jte=re({randomGamma_:function(n,e,t,r,i){if(t===void 0&&(t=1),r===void 0&&(r="float32"),t==null&&(t=1),r==null&&(r="float32"),r!=="float32"&&r!=="int32")throw new Error("Unsupported data type "+r);
vendor: 4,228 bytes, line 69
69for(var a=new Tte(e,t,r,i),s=Dt(n,r),o=0;o<s.values.length;o++)s.values[o]=a.nextValue();return s.toTensor()}}),$5=re({randomUniform_:function(n,e,t,r,i){e===void 0&&(e=0),t===void 0&&(t=1),r===void 0&&(r="float32");for(var a=Dt(n,r),s=new Ete(e,t,null,i),o=0;o<a.values.length;o++)a.values[o]=s.nextValue();return a.toTensor()}}),Jo=re({reshape_:function(n,e){var t=G(n,"x","reshape",null);e=bee(e,t.size),J(t.size===ct(e),function(){return"new shape and old shape must have the same number of elements."});var r={shape:e};return ce.runKernelFunc(function(i){return i.reshape(t,e)},{x:t},function(i){return{x:function(){return i.reshape(t.shape)}}},"Reshape",r)}}),B5=re({spaceToBatchND_:function(n,e,t){var r=G(n,"x","spaceToBatchND");return J(r.rank>=1+e.length,function(){return"input rank "+r.rank+" should be > than [blockShape] "+e.length}),J(t.length===e.length,function(){return"paddings.shape[0] "+t.length+" must be equal to [blockShape] "+e.length}),J(r.shape.reduce(function(i,a,s){return s>0&&s<=e.length?i&&(a+t[s-1][0]+t[s-1][1])%e[s-1]==0:i},!0),function(){return"input spatial dimensions "+r.shape.slice(1)+" with paddings "+t.toString()+" must be divisible by blockShapes "+e.toString()}),ce.runKernelFunc(function(i){return i.spaceToBatchND(r,e,t)},{$x:r},function(i){return{$x:function(){return i.batchToSpaceND(e,t)}}})}}),U5=re({squeeze_:function(n,e){var t=G(n,"x","squeeze");return Jo(t,Bd(t.shape,e).newShape)}}),ws=re({stack_:function(n,e){e===void 0&&(e=0);var t=t_(n,"tensors","stack");if(J(t.length>=1,function(){return"Pass at least one tensor to tf.stack"}),t.length===1)return t[0].expandDims(e);var r=t[0].rank,i=t[0].shape,a=t[0].dtype;J(e<=r,function(){return"Axis must be <= rank of the tensor"}),t.forEach(function(o){Pn(i,o.shape,"All tensors passed to stack must have matching shapes")}),t.forEach(function(o){J(a===o.dtype,function(){return"All tensors passed to stack must have matching dtypes"})});var s=t.map(function(o){return o.expandDims(e)});return ai(s,e)}}),Lh=re({tile_:function(n,e){var t=G(n,"x","tile",null);J(t.rank===e.length,function(){return"Error in transpose: rank of input "+t.rank+" must match length of reps "+e+"."});var r=[t],i={reps:e};return ce.runKernelFunc(function(a,s){var o=a.tile(t,e);return s([t]),o},{x:t},function(a,s){var o=s[0];return{x:function(){var c=dn(o);if(o.rank===1)for(var u=0;u<e[0];++u)c=c.add(a.slice([u*o.shape[0]],[o.shape[0]]));else if(o.rank===2)for(u=0;u<e[0];++u)for(var l=0;l<e[1];++l)c=c.add(a.slice([u*o.shape[0],l*o.shape[1]],[o.shape[0],o.shape[1]]));else if(o.rank===3)for(u=0;u<e[0];++u)for(l=0;l<e[1];++l)for(var d=0;d<e[2];++d)c=c.add(a.slice([u*o.shape[0],l*o.shape[1],d*o.shape[2]],[o.shape[0],o.shape[1],o.shape[2]]));else{if(o.rank!==4)throw new Error("Gradient for tile operation is not implemented for rank-"+o.rank+" tensors yet.");for(u=0;u<e[0];++u)for(l=0;l<e[1];++l)for(d=0;d<e[2];++d)for(var h=0;h<e[3];++h)c=c.add(a.slice([u*o.shape[0],l*o.shape[1],d*o.shape[2],h*o.shape[3]],[o.shape[0],o.shape[1],o.shape[2],o.shape[3]]))}return c}}},"Tile",i,r)}}),qte=re({truncatedNormal_:function(n,e,t,r,i){if(e===void 0&&(e=0),t===void 0&&(t=1),r!=null&&r==="bool")throw new Error("Unsupported data type "+r);for(var a=new hS(e,t,r,!0,i),s=Dt(n,r),o=0;o<s.values.length;o++)s.values[o]=a.nextValue();return s.toTensor()}}),si=re({unstack_:function(n,e){e===void 0&&(e=0),e=e||0;var t=G(n,"x","unstack");J(e>=-t.shape.length&&e<t.shape.length,function(){return"Axis = "+e+" is not in [-"+t.shape.length+", "+t.shape.length+")"}),e<0&&(e+=t.shape.length);var r={axis:e};return ce.runKernelFunc(function(i){return i.unstack(t,e)},{x:t},function(i){return{x:function(){return ws(i,e)}}},"Unpack",r)}}),zte=function(n,e){return at(this,void 0,void 0,function(){var t,r,i,a,s,o,c,u,l,d;return st(this,function(h){switch(h.label){case 0:return t=G(n,"x","setdiff1d"),r=G(e,"y","setdiff1d"),J(t.dtype===r.dtype,function(){return"x and y should have the same dtype, but got x ("+t.dtype+") and y ("+r.dtype+")."}),J(t.rank===1,function(){return"x should be 1D tensor, but got x ("+t.shape+")."}),J(r.rank===1,function(){return"y should be 1D tensor, but got y ("+r.shape+")."}),[4,t.data()];case 1:return i=h.sent(),[4,r.data()];
vendor: 4,938 bytes, line 69
69case 2:for(a=h.sent(),s=new Set(a),o=0,l=0;l<i.length;l++)s.has(i[l])||o++;for(c=new xg([o],t.dtype),u=new xg([o],"int32"),l=0,d=0;l<i.length;l++)s.has(i[l])||(c.values[d]=i[l],u.values[d]=l,d++);return[2,[c.toTensor(),u.toTensor()]]}})})};function r_(n,e,t,r){r===void 0&&(r=!0);var i=[];if(r)(i=i.concat(e.slice(0))).push(n[0]/t),i=i.concat(n.slice(1));else{i=i.concat(n[0]);for(var a=e.length,s=0;s<a;++s)i=i.concat([n[s+1]/e[s],e[s]]);i=i.concat(n.slice(a+1))}return i}function i_(n,e,t){t===void 0&&(t=!0);var r=[];if(t){r.push(e);for(var i=e+1;i<n;++i)i<=2*e?(r.push(i),r.push(i-(e+1))):r.push(i)}else{var a=[],s=[];for(i=1;i<n;++i)i>=2*e+1||i%2==1?s.push(i):a.push(i);r.push.apply(r,a),r.push(0),r.push.apply(r,s)}return r}function a_(n,e,t,r){r===void 0&&(r=!0);var i=[];r?i.push(n[0]/t):i.push(n[0]*t);for(var a=1;a<n.length;++a)a<=e.length?r?i.push(e[a-1]*n[a]):i.push(n[a]/e[a-1]):i.push(n[a]);return i}function j5(n,e){for(var t=[0],r=0;r<e;++r)t.push(n[r][0]);return t}function q5(n,e,t){for(var r=n.slice(0,1),i=0;i<t;++i)r.push(n[i+1]-e[i][0]-e[i][1]);return r}function z5(n,e){if(n.rank<1)throw new Error("tf.gatherND() expects the input to be rank 1 or higher, but the rank was "+n.rank+".");if(e.rank<1)throw new Error("tf.gatherND() expects the indices to be rank 1 or higher, but the rank was "+e.rank+".");if(e.dtype!=="int32")throw new Error("tf.gatherND() expects the indices to be int32 type, but the dtype was "+e.dtype+".");if(e.shape[e.rank-1]>n.rank)throw new Error("index innermost dimension length must be <= tensor rank; saw: "+e.shape[e.rank-1]+" vs. "+n.rank);if(n.size===0)throw new Error("Requested more than 0 entries, but input is empty. Input shape: "+n.shape+".");for(var t=e.shape,r=t[t.length-1],i=1,a=0;a<t.length-1;++a)i*=t[a];var s=n.shape,o=t.slice();o.pop();var c=1;for(a=r;a<n.rank;++a)c*=s[a],o.push(s[a]);var u=Gc(n.shape).map(function(l){return l/c}).concat([1]).slice(0,r);return[o,i,c,u]}var W5=30;function yw(n){return n<=W5?n:ek(n,Math.floor(Math.sqrt(n)))}function Wte(n,e,t){var r=e.rank>1?e.shape[e.rank-1]:1,i=e.rank>1?e.rank-1:1,a="Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: "+t.shape+", indices.shape: "+e.shape+", shape: "+n+", sliceDim: "+r+", and batchDim: "+i+".";if(t.rank<i)throw new Error(a+" update.rank < "+i+". ");if(n.length<r+(t.rank-i))throw new Error(a+" Output shape length < "+(r+(t.rank-i)));if(t.rank!==i+n.length-r)throw new Error(a+" update.rank != "+(i+n.length-r));for(var s=0;s<i;++s)if(t.shape[s]!==e.shape[s])throw new Error(a+" updates.shape["+s+"] ("+t.shape[s]+") != indices.shape["+s+"] ("+e.shape[s]+").");for(s=0;s<t.rank-i;++s)if(t.shape[s+i]!==n[s+r])throw new Error(a+" updates.shape["+(s+i)+"] ("+t.shape[s+i]+") != shape["+(s+i)+"] ("+n[s+i]+")")}function Hte(n,e,t){if(e.rank<1)throw new Error("tf.scatterND() expects the indices to be rank 1 or higher, but the rank was "+e.rank+".");if(n.rank<1)throw new Error("tf.scatterND() expects the updates to be rank 1 or higher, but the rank was "+n.rank+".");if(e.dtype!=="int32")throw new Error("The dtype of 'indices' should be int32, but got dtype: "+e.dtype);if(t.length<1)throw new Error("Output rank must be greater or equal to 1, but got shape: "+t);if(t.length===0){if(e.size===0)throw new Error("Indices specified for empty output. indices shape: "+e.shape);if(n.size===0)throw new Error("Updates specified for empty output. updates shape: "+n.shape)}Wte(t,e,n)}function s_(n,e,t){for(var r=e.shape.length,i=r>1?e.shape[r-1]:1,a=t.length,s=1,o=i;o<a;++o)s*=t[o];var c=i<1?1:i;return{sliceRank:i,numUpdates:ct(e.shape)/c,sliceSize:s,strides:Gc(t.slice(0,i)).concat([1]),outputSize:ct(t)}}function Vte(n,e,t){J(n.rank===e.length,function(){return"Error in slice"+n.rank+"D: Length of begin "+e+" must match the rank of the array ("+n.rank+")."}),J(n.rank===t.length,function(){return"Error in slice"+n.rank+"D: Length of size "+t+" must match the rank of the array ("+n.rank+")."});for(var r=function(a){J(e[a]+t[a]<=n.shape[a],function(){return"Error in slice"+n.rank+"D: begin["+a+"] + size["+a+"] ("+(e[a]+t[a])+") would overflow input.shape["+a+"] ("+n.shape[a]+")"})},i=0;i<n.rank;++i)r(i)}function m4(n){for(var e=[],t=0;n>0;)1&n&&e.push(t),n/=2,t++;return e}function pS(n,e,t){for(var r=[],i=0;i<n.length;i++)r[i]=Math.ceil((e[i]-n[i])/t[i]);return r}function Gte(n,e,t,r,i){var a=e[i],s=t[i]||1;(n&1<<i||a==null)&&(a=s>0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);var o=r[i];return a<0&&(a+=o),a=JC(0,a,o-1)}function Kte(n,e,t,r,i){var a=e[i],s=t[i]||1;(n&1<<i||a==null)&&(a=s>0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);var o=r[i];return a<0&&(a+=o),a=s>0?JC(0,a,o):JC(-1,a,o-1)}function H5(n,e,t){for(var r=t.length,i=0;i<t.length;i++)if(t[i]>1){r=i;break}for(i=r+1;i<t.length;i++)if(e[i]>0||t[i]!==n[i])return!1;return!0}function V5(n,e){for(var t=n.length>0?n[n.length-1]:1,r=0;r<n.length-1;r++)t+=n[r]*e[r];return t}
69function Yte(n,e){J(ZC(n),function(){return"The f passed in variableGrads(f) must be a function"}),J(e==null||Array.isArray(e)&&e.every(function(l){return l instanceof cp}),function(){return"The varList passed in variableGrads(f, varList) must be an array of variables"});var t=e!=null;if(!t)for(var r in e=[],ce.registeredVariables)e.push(ce.registeredVariables[r]);var i=t?e.filter(function(l){return!l.trainable}):null,a=e.length;J((e=e.filter(function(l){return l.trainable})).length>0,function(){return"variableGrads() expects at least one of the input variables to be trainable, but none of the "+a+" variables is trainable."});var s=ce.gradients(n,e,null,!0),o=s.value,c=s.grads;J(c.some(function(l){return l!=null}),function(){return"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."}),J(o.rank===0,function(){return"The f passed in variableGrads(f) must return a scalar, but it returned a rank-"+o.rank+" tensor"});var u={};return e.forEach(function(l,d){c[d]!=null&&(u[l.name]=c[d])}),i!=null&&i.forEach(function(l){return u[l.name]=null}),{value:o,grads:u}}function ob(n){return ce.customGrad(n)}var tl=re({softmax_:function(n,e){e===void 0&&(e=-1);var t=G(n,"logits","softmax","float32");if(e===-1&&(e=t.rank-1),e!==t.rank-1)throw Error("Softmax along a non-last dimension is not yet supported. Logits was rank "+t.rank+" and dim was "+e);return ce.runKernelFunc(function(r,i){var a=r.softmax(t,e);return i([a]),a},{logits:t},function(r,i){var a=i[0],s=r.mul(a);return{logits:function(){return s.sub(s.sum([e],!0).mul(a))}}},"Softmax",{dim:e},[],[!0])}}),Xte=re({logSoftmax_:function(n,e){e===void 0&&(e=-1);var t=G(n,"logits","logSoftmax");if(e===-1&&(e=t.rank-1),e!==t.rank-1)throw Error("Log Softmax along a non-last dimension is not yet supported. Logits was rank "+t.rank+" and axis was "+e);return ob(function(r,i){var a=r.max(e,!0),s=r.sub(a),o=s.toFloat().sub(s.exp().sum(e,!0).log());return i([o]),{value:o,gradFunc:function(c,u){var l=u[0].exp();return c.sub(c.sum(e,!0).mul(l))}}})(t)}}),G5=function(){function n(e,t){this.backend=e,this.dataMover=t,this.data=new WeakMap,this.dataIdsCount=0}return n.prototype.get=function(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)},n.prototype.set=function(e,t){this.dataIdsCount++,this.data.set(e,t)},n.prototype.has=function(e){return this.data.has(e)},n.prototype.delete=function(e){return this.dataIdsCount--,this.data.delete(e)},n.prototype.numDataIds=function(){return this.dataIdsCount},n}(),K5=function(){function n(){}return n.prototype.time=function(e){return ye("time")},n.prototype.read=function(e){return ye("read")},n.prototype.readSync=function(e){return ye("readSync")},n.prototype.numDataIds=function(){return ye("numDataIds")},n.prototype.disposeData=function(e){return ye("disposeData")},n.prototype.write=function(e,t,r){return ye("write")},n.prototype.move=function(e,t,r,i){return ye("move")},n.prototype.memory=function(){return ye("memory")},n.prototype.floatPrecision=function(){return ye("floatPrecision")},n.prototype.epsilon=function(){return this.floatPrecision()===32?1e-7:1e-4},n.prototype.batchMatMul=function(e,t,r,i){return ye("batchMatMul")},n.prototype.fusedBatchMatMul=function(e){return e.a,e.b,e.transposeA,e.transposeB,e.bias,e.activation,e.preluActivationWeights,ye("fusedBatchMatMul")},n.prototype.slice=function(e,t,r){return ye("slice")},n.prototype.stridedSlice=function(e,t,r,i){return ye("stridedSlice")},n.prototype.unstack=function(e,t){return ye("unstack")},n.prototype.reverse=function(e,t){return ye("reverse")},n.prototype.concat=function(e,t){return ye("concat")},n.prototype.neg=function(e){return ye("neg")},n.prototype.add=function(e,t){return ye("add")},n.prototype.addN=function(e){return ye("addN")},n.prototype.subtract=function(e,t){return ye("subtract")},n.prototype.multiply=function(e,t){return ye("multiply")},n.prototype.realDivide=function(e,t){return ye("realDivide")},n.prototype.floorDiv=function(e,t){return ye("floorDiv")},n.prototype.sum=function(e,t){return ye("sum")},n.prototype.prod=function(e,t){return ye("prod")},n.prototype.unsortedSegmentSum=function(e,t,r){return ye("unsortedSegmentSum")},n.prototype.argMin=function(e,t){return ye("argMin")},n.prototype.argMax=function(e,t){return ye("argMax")},n.prototype.equal=function(e,t){return ye("equal")},n.prototype.notEqual=function(e,t){return ye("notEqual")},n.prototype.less=function(e,t){return ye("less")},n.prototype.lessEqual=function(e,t){return ye("lessEqual")},n.prototype.greater=function(e,t){return ye("greater")},n.prototype.greaterEqual=function(e,t){return ye("greaterEqual")},n.prototype.logicalNot=function(e){return ye("logicalNot")},n.prototype.logicalAnd=function(e,t){return ye("logicalAnd")},n.prototype.logicalOr=function(e,t){return ye("logicalOr")},n.prototype.where=function(e){return ye("where")},n.prototype.select=function(e,t,r){return ye("select")},n.prototype.topk=function(e,t,r){return ye("topk")},n.prototype.min=function(e,t){return ye("min")},n.prototype.minimum=function(e,t){return ye("minimum")},n.prototype.mod=function(e,t){return ye("mod")},n.prototype.max=function(e,t){return ye("max")}
69,n.prototype.maximum=function(e,t){return ye("maximum")},n.prototype.all=function(e,t){return ye("all")},n.prototype.any=function(e,t){return ye("any")},n.prototype.squaredDifference=function(e,t){return ye("squaredDifference")},n.prototype.ceil=function(e){return ye("ceil")},n.prototype.floor=function(e){return ye("floor")},n.prototype.round=function(e){return ye("round")},n.prototype.sign=function(e){return ye("sign")},n.prototype.isNaN=function(e){return ye("isNaN")},n.prototype.isInf=function(e){return ye("isInf")},n.prototype.isFinite=function(e){return ye("isFinite")},n.prototype.pow=function(e,t){return ye("pow")},n.prototype.exp=function(e){return ye("exp")},n.prototype.expm1=function(e){return ye("expm1")},n.prototype.softmax=function(e,t){return ye("softmax")},n.prototype.log=function(e){return ye("log")},n.prototype.log1p=function(e){return ye("log1p")},n.prototype.sqrt=function(e){return ye("sqrt")},n.prototype.rsqrt=function(e){return ye("rsqrt")},n.prototype.square=function(e){return ye("square")},n.prototype.reciprocal=function(e){return ye("reciprocal")},n.prototype.relu=function(e){return ye("relu")},n.prototype.relu6=function(e){return ye("relu6")},n.prototype.prelu=function(e,t){return ye("prelu")},n.prototype.elu=function(e){return ye("elu")},n.prototype.eluDer=function(e,t){return ye("eluDer")},n.prototype.selu=function(e){return ye("selu")},n.prototype.int=function(e){return ye("int")},n.prototype.clip=function(e,t,r){return ye("clip")},n.prototype.abs=function(e){return ye("abs")},n.prototype.complexAbs=function(e){return ye("complexAbs")},n.prototype.sigmoid=function(e){return ye("sigmoid")},n.prototype.softplus=function(e){return ye("softplus")},n.prototype.sin=function(e){return ye("sin")},n.prototype.cos=function(e){return ye("cos")},n.prototype.tan=function(e){return ye("tan")},n.prototype.asin=function(e){return ye("asin")},n.prototype.acos=function(e){return ye("acos")},n.prototype.atan=function(e){return ye("atan")},n.prototype.atan2=function(e,t){return ye("atan2")},n.prototype.sinh=function(e){return ye("sinh")},n.prototype.cosh=function(e){return ye("cosh")},n.prototype.tanh=function(e){return ye("tanh")},n.prototype.asinh=function(e){return ye("asinh")},n.prototype.acosh=function(e){return ye("acosh")},n.prototype.atanh=function(e){return ye("atanh")},n.prototype.erf=function(e){return ye("erf")},n.prototype.step=function(e,t){return ye("step")},n.prototype.fusedConv2d=function(e){return e.input,e.filter,e.convInfo,e.bias,e.activation,e.preluActivationWeights,ye("fusedConv2d")},n.prototype.conv2d=function(e,t,r){return ye("conv2d")},n.prototype.conv2dDerInput=function(e,t,r){return ye("conv2dDerInput")},n.prototype.conv2dDerFilter=function(e,t,r){return ye("conv2dDerFilter")},n.prototype.fusedDepthwiseConv2D=function(e){return e.input,e.filter,e.convInfo,e.bias,e.activation,e.preluActivationWeights,ye("fusedDepthwiseConv2D")},n.prototype.depthwiseConv2D=function(e,t,r){return ye("depthwiseConv2D")},n.prototype.depthwiseConv2DDerInput=function(e,t,r){return ye("depthwiseConv2DDerInput")},n.prototype.depthwiseConv2DDerFilter=function(e,t,r){return ye("depthwiseConv2DDerFilter")},n.prototype.conv3d=function(e,t,r){return ye("conv3d")},n.prototype.conv3dDerInput=function(e,t,r){return ye("conv3dDerInput")},n.prototype.conv3dDerFilter=function(e,t,r){return ye("conv3dDerFilter")},n.prototype.maxPool=function(e,t){return ye("maxPool")},n.prototype.maxPoolBackprop=function(e,t,r,i){return ye("maxPoolBackprop")},n.prototype.avgPool=function(e,t){return ye("avgPool")},n.prototype.avgPoolBackprop=function(e,t,r){return ye("avgPoolBackprop")},n.prototype.avgPool3d=function(e,t){return ye("avgPool3d")},n.prototype.avgPool3dBackprop=function(e,t,r){return ye("avgPool3dBackprop")},n.prototype.maxPool3d=function(e,t){return ye("maxPool3d")},n.prototype.maxPool3dBackprop=function(e,t,r,i){return ye("maxPool3dBackprop")},n.prototype.reshape=function(e,t){return ye("reshape")},n.prototype.cast=function(e,t){return ye("cast")},n.prototype.tile=function(e,t){return ye("tile")},n.prototype.pad=function(e,t,r){return ye("pad")},n.prototype.transpose=function(e,t){return ye("transpose")},n.prototype.gather=function(e,t,r){return ye("gather")},n.prototype.gatherND=function(e,t){return ye("gatherND")},n.prototype.scatterND=function(e,t,r){return ye("scatterND")},n.prototype.batchToSpaceND=function(e,t,r){return ye("batchToSpaceND")},n.prototype.spaceToBatchND=function(e,t,r){return ye("spaceToBatchND")}
69,n.prototype.resizeBilinear=function(e,t,r,i){return ye("resizeBilinear")},n.prototype.resizeBilinearBackprop=function(e,t,r){return ye("resizeBilinearBackprop")},n.prototype.resizeNearestNeighbor=function(e,t,r,i){return ye("resizeNearestNeighbor")},n.prototype.resizeNearestNeighborBackprop=function(e,t,r){return ye("resizeNearestNeighborBackprop")},n.prototype.batchNormalization=function(e,t,r,i,a,s){return ye("batchNormalization")},n.prototype.localResponseNormalization4D=function(e,t,r,i,a){return ye("localResponseNormalization4D")},n.prototype.LRNGrad=function(e,t,r,i,a,s,o){return ye("LRNGrad")},n.prototype.multinomial=function(e,t,r,i){return ye("multinomial")},n.prototype.oneHot=function(e,t,r,i){return ye("oneHot")},n.prototype.cumsum=function(e,t,r,i){return ye("cumsum")},n.prototype.nonMaxSuppression=function(e,t,r,i,a){return ye("nonMaxSuppression")},n.prototype.fft=function(e){return ye("fft")},n.prototype.ifft=function(e){return ye("ifft")},n.prototype.complex=function(e,t){return ye("complex")},n.prototype.real=function(e){return ye("real")},n.prototype.imag=function(e){return ye("imag")},n.prototype.cropAndResize=function(e,t,r,i,a,s){return ye("cropAndResize")},n.prototype.depthToSpace=function(e,t,r){return ye("depthToSpace")},n.prototype.split=function(e,t,r){return ye("split")},n.prototype.sparseToDense=function(e,t,r,i){return ye("sparseToDense")},n.prototype.diag=function(e){return ye("diag")},n.prototype.fill=function(e,t,r){return ye("fill")},n.prototype.onesLike=function(e){return ye("onesLike")},n.prototype.zerosLike=function(e){return ye("zerosLike")},n.prototype.linspace=function(e,t,r){return ye("linspace")},n.prototype.dispose=function(){return ye("dispose")},n}();function ye(n){throw new Error("'"+n+"' not yet implemented or not found in the registry. Did you forget to import the kernel?")}function Pl(n,e){for(var t=n.length,r=[],i=0;i<t;i++){var a=t-1-i,s=n[a]||1;(e[e.length-1-i]||1)>1&&s===1&&r.unshift(a)}return r}function oi(n,e){for(var t=[],r=0;r<e.length;r++){var i=n[n.length-r-1],a=e.length-r-1,s=e[a];(i==null||i===1&&s>1)&&t.unshift(a)}return t}function tn(n,e){for(var t=[],r=Math.max(n.length,e.length),i=0;i<r;i++){var a=n[n.length-i-1];a==null&&(a=1);var s=e[e.length-i-1];if(s==null&&(s=1),a===1)t.unshift(s);else if(s===1)t.unshift(a);else{if(a!==s)throw Error("Operands could not be broadcast together with shapes "+n+" and "+e+".");t.unshift(a)}}return t}function Cg(n,e,t,r,i,a,s){s===void 0&&(s="channelsLast");var o,c=u_(e),u=c[0],l=c[1];if(s==="channelsLast")o=[u,l,n[3],n[3]];else{if(s!=="channelsFirst")throw new Error("Unknown dataFormat "+s);o=[u,l,n[1],n[1]]}return Af(n,o,t,r,i,a,!1,s)}function o_(n,e,t,r,i,a,s){s===void 0&&(s="NDHWC");var o,c,u=ok(e),l=u[0],d=u[1],h=u[2];if(s==="NDHWC")c="channelsLast",o=[l,d,h,n[4],n[4]];else{if(s!=="NCDHW")throw new Error("Unknown dataFormat "+s);c="channelsFirst",o=[l,d,h,n[1],n[1]]}return c_(n,o,t,r,i,!1,c,a)}function Af(n,e,t,r,i,a,s,o){s===void 0&&(s=!1),o===void 0&&(o="channelsLast");var c=[-1,-1,-1,-1],u=c[0],l=c[1],d=c[2],h=c[3];if(o==="channelsLast")u=n[0],l=n[1],d=n[2],h=n[3];else{if(o!=="channelsFirst")throw new Error("Unknown dataFormat "+o);u=n[0],h=n[1],l=n[2],d=n[3]}var p,g=e[0],v=e[1],y=e[3],b=u_(t),x=b[0],S=b[1],w=u_(r),k=w[0],E=w[1],I=Fh(g,k),P=Fh(v,E),A=function(V,X,ne,se,ie,de,ue,Ce){var we,Fe,Ge;if(typeof V=="number"){we={top:V,bottom:V,left:V,right:V,type:V===0?"VALID":"NUMBER"};var Ie=function(_t,mt,wt,Kt,Ct){Kt==null&&(Kt=Y5(_t,mt,wt));var kt=_t[0],jn=_t[1],zt=Ym((kt-mt+2*Kt)/wt+1,Ct);J($r(zt),function(){return"The output # of rows ("+zt+") must be an integer. Change the stride and/or zero pad parameters"});var qn=Ym((jn-mt+2*Kt)/wt+1,Ct);return J($r(qn),function(){return"The output # of columns ("+qn+") must be an integer. Change the stride and/or zero pad parameters"}),[zt,qn]}([X,ne],de,se,V,Ce);Fe=Ie[0],Ge=Ie[1]}else if(V==="same"){Fe=Math.ceil(X/se),Ge=Math.ceil(ne/ie);var He=Math.max(0,(Fe-1)*se+de-X),ot=Math.max(0,(Ge-1)*ie+ue-ne),Je=Math.floor(He/2),et=He-Je,Ut=Math.floor(ot/2);we={top:Je,bottom:et,left:Ut,right:ot-Ut,type:"SAME"}}else{if(V!=="valid")throw Error("Unknown padding parameter: "+V);we={top:0,bottom:0,left:0,right:0,type:"VALID"},Fe=Math.ceil((X-de+1)/se),Ge=Math.ceil((ne-ue+1)/ie)}return{padInfo:we,outHeight:Fe,outWidth:Ge}}(i,l,d,x,S,I,P,a),N=A.padInfo,j=A.outHeight,L=A.outWidth,B=s?y*h:y;return o==="channelsFirst"?p=[u,B,j,L]:o==="channelsLast"&&(p=[u,j,L,B]),{batchSize:u,dataFormat:o,inHeight:l,inWidth:d,inChannels:h,outHeight:j,outWidth:L,outChannels:B,padInfo:N,strideHeight:x,strideWidth:S,filterHeight:g,filterWidth:v,effectiveFilterHeight:I,effectiveFilterWidth:P,dilationHeight:k,dilationWidth:E,inShape:n,outShape:p,filterShape:e}}function c_(n,e,t,r,i,a,s,o){a===void 0&&(a=!1),s===void 0&&(s="channelsLast");var c=[-1,-1,-1,-1,-1],u=c[0],l=c[1],d=c[2],h=c[3],p=c[4];if(s==="channelsLast")u=n[0],l=n[1],d=n[2],h=n[3],p=n[4];else{if(s!=="channelsFirst")throw new Error("Unknown dataFormat "+s);u=n[0],p=n[1],l=n[2],d=n[3],h=n[4]}var g,v=e[0],y=e[1],b=e[2],x=e[4],S=ok(t),w=S[0],k=S[1],E=S[2],I=ok(r),P=I[0],A=I[1],N=I[2],j=Fh(v,P),L=Fh(y,A),B=Fh(b,N),V=function(ue,Ce,we,Fe,Ge,Ie,He,ot,Je,et,Ut){var _t,mt,wt,Kt;if(typeof ue=="number"){_t={top:ue,bottom:ue,left:ue,right:ue,front:ue,back:ue,type:ue===0?"VALID":"NUMBER"};var Ct=function(kn,St,Er,Jn,rn,sr){rn==null&&(rn=Y5(kn,St,Jn));var Qn=kn[0],Pr=kn[1],Gr=kn[2],gt=Ym((Qn-St+2*rn)/Jn+1,sr);J($r(gt),function(){return"The output # of depths ("+gt+") must be an integer. Change the stride and/or zero pad parameters"});var Rt=Ym((Pr-St+2*rn)/Jn+1,sr);J($r(Rt),function(){return"The output # of rows ("+Rt+") must be an integer. Change the stride and/or zero pad parameters"});var Wt=Ym((Gr-St+2*rn)/Jn+1,sr);return J($r(Wt),function(){return"The output # of columns ("+Wt+") must be an integer. Change the stride and/or zero pad parameters"}),[gt,Rt,Wt,Er]}([Ce,we,Fe,1],ot,1,Ge,ue,Ut);mt=Ct[0],wt=Ct[1],Kt=Ct[2]}else if(ue==="same"){mt=Math.ceil(Ce/Ge),wt=Math.ceil(we/Ie),Kt=Math.ceil(Fe/He);var kt=(mt-1)*Ge+ot-Ce,jn=(wt-1)*Ie+Je-we,zt=(Kt-1)*He+et-Fe,qn=Math.floor(kt/2),_r=kt-qn,On=Math.floor(jn/2),hn=jn-On,xn=Math.floor(zt/2);_t={top:On,bottom:hn,left:xn,right:zt-xn,front:qn,back:_r,type:"SAME"}}else{if(ue!=="valid")throw Error("Unknown padding parameter: "+ue);_t={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},mt=Math.ceil((Ce-ot+1)/Ge),wt=Math.ceil((we-Je+1)/Ie),Kt=Math.ceil((Fe-et+1)/He)}return{padInfo:_t,outDepth:mt,outHeight:wt,outWidth:Kt}}(i,l,d,h,w,k,E,j,L,B,o),X=V.padInfo,ne=V.outDepth,se=V.outHeight,ie=V.outWidth,de=a?x*p:x;return s==="channelsFirst"?g=[u,de,ne,se,ie]:s==="channelsLast"&&(g=[u,ne,se,ie,de]),{batchSize:u,dataFormat:s,inDepth:l,inHeight:d,inWidth:h,inChannels:p,outDepth:ne,outHeight:se,outWidth:ie,outChannels:de,padInfo:X,strideDepth:w,strideHeight:k,strideWidth:E,filterDepth:v,filterHeight:y,filterWidth:b,effectiveFilterDepth:j,effectiveFilterHeight:L,effectiveFilterWidth:B,dilationDepth:P,dilationHeight:A,dilationWidth:N,inShape:n,outShape:g,filterShape:e}}function Y5(n,e,t,r){r===void 0&&(r=1);var i=Fh(e,r);return Math.floor((n[0]*(t-1)-t+i)/2)}function u_(n){return typeof n=="number"?[n,n,n]:n.length===2?[n[0],n[1],1]:n}function ok(n){return typeof n=="number"?[n,n,n]:n}function Fh(n,e){return e<=1?n:n+(n-1)*(e-1)}function Ym(n,e){if(!e)return n;switch(e){case"round":return Math.round(n);case"ceil":return Math.ceil(n);case"floor":return Math.floor(n);default:throw new Error("Unknown roundingMode "+e)}}function lp(n){var e=u_(n),t=e[0],r=e[1],i=e[2];return t===1&&r===1&&i===1}function Wa(n,e){return lp(n)||lp(e)}function mS(n){if(n==="NHWC")return"channelsLast";if(n==="NCHW")return"channelsFirst";throw new Error("Unknown dataFormat "+n)}function X5(n,e,t){if(e==="complex64"){if(n.dtype==="complex64")return n.clone();
69var r=Gn(n.shape),i=n.toFloat(),a=t.complex(i,r);return r.dispose(),i.dispose(),a}if(!Cee(n.dtype,e))return ce.makeTensorFromDataId(n.dataId,n.shape,e);if(n.dtype==="complex64"){var s=t.real(n);return a=s.cast(e),s.dispose(),a}if(e==="int32")return t.int(n);if(e==="bool"){var o=Ke(0,n.dtype);return a=t.notEqual(n,o),o.dispose(),a}throw new Error("Error in Cast: failed to cast "+n.dtype+" to "+e)}function ck(n,e){return ce.makeTensorFromDataId(n.dataId,e,n.dtype)}function J5(n,e,t){var r=(e-n)/(t-1),i=iv(t,"float32");i[0]=n;for(var a=1;a<i.length;a++)i[a]=i[a-1]+r;return Hr(i,"float32")}function uk(n,e){if(n.length!==e.length)throw new Error("Cannot merge real and imag arrays of different lengths. real:"+n.length+", imag: "+e.length+".");for(var t=new Float32Array(2*n.length),r=0;r<t.length;r+=2)t[r]=n[r/2],t[r+1]=e[r/2];return t}function g4(n,e){return{real:n[2*e],imag:n[2*e+1]}}function Jte(n,e,t,r){n[2*r]=e,n[2*r+1]=t}function Qte(n,e,t){var r=(t?2:-2)*Math.PI*(n/e);return{real:Math.cos(r),imag:Math.sin(r)}}function Zte(n,e,t){var r=function(a,s,o){return function(c,u,l){for(var d=0,h=c.length,p=0,g=!1;d<h;){var v=l(u,c[p=d+(h-d>>>1)]);v>0?d=p+1:(h=p,g=!v)}return g?d:-d-1}(a,s,o||ene)}(n,e,t),i=r<0?-(r+1):r;n.splice(i,0,e)}function ene(n,e){return n>e?1:n<e?-1:0}function gS(n,e,t,r,i){return Q5(n,e,t,r,i,0).selectedIndices}function vS(n,e,t,r,i,a){var s=Q5(n,e,t,r,i,a);return s.numValidOutputs.dispose(),{selectedIndices:s.selectedIndices,selectedScores:s.selectedScores}}function Q5(n,e,t,r,i,a,s,o){o===void 0&&(o=!1);for(var c=Array.from(e).map(function(w,k){return{score:w,boxIndex:k,suppressBeginIndex:0}}).filter(function(w){return w.score>i}).sort(v4),u=a>0?-.5/a:0,l=[],d=[];l.length<t&&c.length>0;){var h=c.pop(),p=h.score,g=h.boxIndex,v=h.suppressBeginIndex;if(p<i)break;for(var y=!1,b=l.length-1;b>=v;--b){var x=tne(n,g,l[b]);if(x>=r){y=!0;break}if(h.score=h.score*nne(r,u,x),h.score<=i)break}h.suppressBeginIndex=l.length,y||(h.score===p?(l.push(g),d.push(h.score)):h.score>i&&Zte(c,h,v4))}var S=l.length;return o&&(l.fill(0,S),d.fill(0,S)),{selectedIndices:Hr(l,"int32"),selectedScores:Hr(d,"float32"),numValidOutputs:Ke(S,"int32")}}function tne(n,e,t){var r=n.subarray(4*e,4*e+4),i=n.subarray(4*t,4*t+4),a=Math.min(r[0],r[2]),s=Math.min(r[1],r[3]),o=Math.max(r[0],r[2]),c=Math.max(r[1],r[3]),u=Math.min(i[0],i[2]),l=Math.min(i[1],i[3]),d=Math.max(i[0],i[2]),h=Math.max(i[1],i[3]),p=(o-a)*(c-s),g=(d-u)*(h-l);if(p<=0||g<=0)return 0;var v=Math.max(a,u),y=Math.max(s,l),b=Math.min(o,d),x=Math.min(c,h),S=Math.max(b-v,0)*Math.max(x-y,0);return S/(p+g-S)}function nne(n,e,t){var r=Math.exp(e*t*t);return t<=n?r:0}function v4(n,e){return n.score-e.score||n.score===e.score&&e.boxIndex-n.boxIndex}function Z5(n,e,t){var r=new Array(n.rank).fill(0),i=n.shape.slice();return e.map(function(a){i[t]=a;var s=n.slice(r,i);return r[t]+=a,s})}function eN(n,e){for(var t=new Array(n.rank),r=0;r<t.length;r++)t[r]=n.shape[r]*e[r];var i=Dt(t,n.dtype);for(r=0;r<i.values.length;++r){for(var a=i.indexToLoc(r),s=new Array(n.rank),o=0;o<s.length;o++)s[o]=a[o]%n.shape[o];var c=n.locToIndex(s);i.values[r]=n.values[c]}return i.toTensor()}function tN(n,e,t,r,i){for(var a=e[e.length-1],s=[n.length/a,a],o=s[0],c=s[1],u=bg(t,o*r),l=bg("int32",o*r),d=0;d<o;d++){for(var h=d*c,p=n.subarray(h,h+c),g=[],v=0;v<p.length;v++)g.push({value:p[v],index:v});g.sort(function(w,k){return k.value-w.value});var y=d*r,b=u.subarray(y,y+r),x=l.subarray(y,y+r);for(v=0;v<r;v++)b[v]=g[v].value,x[v]=g[v].index}var S=e.slice();return S[S.length-1]=r,[Pi(u,S,t),Pi(l,S,"int32")]}function yS(n,e){for(var t=[],r=0;r<e.length;r++)e[r]&&t.push(r);var i=Dt(n,"int32"),a=Dt([t.length,n.length],"int32");for(r=0;r<t.length;r++){var s=i.indexToLoc(t[r]),o=r*n.length;a.values.set(s,o)}return a.toTensor()}var rne=function(n,e){this.outputShape=[],this.outputShape=n,this.variableNames=e.map(function(i,a){return"T"+a});var t=[];this.variableNames.forEach(function(i){t.push("float v"+i+" = get"+i+"AtOutCoords();")});var r=this.variableNames.map(function(i){return"v"+i}).join(" + ");this.userCode=` 70 void main() { 71 `+t.join(` 72 `)+` 73 74 float result = `+r+`; 75 setOutput(result); 76 } 77 `},ine=function(n,e){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n,this.variableNames=e.map(function(i,a){return"T"+a});var t=[];
77this.variableNames.forEach(function(i){t.push("vec4 v"+i+" = get"+i+"AtOutCoords();")});var r=this.variableNames.map(function(i){return"v"+i}).join(" + ");this.userCode=` 78 void main() { 79 `+t.join(` 80 `)+` 81 82 vec4 result = `+r+`; 83 setOutput(result); 84 } 85 `},ane=function(n,e,t){this.variableNames=["A"];var r=n.windowSize,i=n.batchSize,a=n.inSize,s=Math.ceil(a/r);t||this.variableNames.push("bestIndicesA"),this.outputShape=[i,s];var o=e==="max"?">":"<",c=t?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=` 86 void main() { 87 ivec2 coords = getOutputCoords(); 88 int batch = coords[0]; 89 int outIdx = coords[1]; 90 int inOffset = outIdx * `+r+`; 91 92 int bestIndex = inOffset; 93 float bestValue = getA(batch, bestIndex); 94 95 for (int i = 0; i < `+r+`; i++) { 96 int inIdx = `+c+`; 97 float candidate = getA(batch, inIdx); 98 if (candidate `+o+` bestValue) { 99 bestValue = candidate; 100 bestIndex = inIdx; 101 } 102 } 103 setOutput(float(bestIndex)); 104 } 105 `};function nN(n,e){return["x","y","z","w","u","v"].slice(0,e).map(function(t){return n+"."+t})}function La(n,e){return e===1?[n]:nN(n,e)}function Wi(){var n,e,t,r,i,a,s,o,c,u;return ke().getNumber("WEBGL_VERSION")===2?(n="#version 300 es",e="in",t="out",r="in",i="texture",a="outputColor",s="out vec4 outputColor;",o=` 106 bool isnan_custom(float val) { 107 return (val > 0.0 || val < 0.0) ? false : val != 0.0; 108 } 109 110 bvec4 isnan_custom(vec4 val) { 111 return bvec4(isnan_custom(val.x), 112 isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w)); 113 } 114 115 #define isnan(value) isnan_custom(value) 116 `,c="",u=` 117 #define round(value) newRound(value) 118 int newRound(float value) { 119 return int(floor(value + 0.5)); 120 } 121 122 ivec4 newRound(vec4 value) { 123 return ivec4(floor(value + vec4(0.5))); 124 } 125 `):(n="",e="attribute",t="varying",r="varying",i="texture2D",a="gl_FragColor",s="",o=` 126 #define isnan(value) isnan_custom(value) 127 bool isnan_custom(float val) { 128 return (val > 0. || val < 1. || val == 0.) ? false : true; 129 } 130 bvec4 isnan_custom(vec4 val) { 131 return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w)); 132 } 133 `,c=` 134 uniform float INFINITY; 135 136 bool isinf(float val) { 137 return abs(val) == INFINITY; 138 } 139 bvec4 isinf(vec4 val) { 140 return equal(abs(val), vec4(INFINITY)); 141 } 142 `,u=` 143 int round(float value) { 144 return int(floor(value + 0.5)); 145 } 146 147 ivec4 round(vec4 value) { 148 return ivec4(floor(value + vec4(0.5))); 149 } 150 `),{version:n,attribute:e,varyingVs:t,varyingFs:r,texture2D:i,output:a,defineOutput:s,defineSpecialNaN:o,defineSpecialInf:c,defineRound:u}}function Hd(n,e,t){t===void 0&&(t="index");var r=Gc(e);return r.map(function(i,a){return"int "+n[a]+" = "+t+" / "+i+"; "+(a===r.length-1?"int "+n[a+1]+" = "+t+" - "+n[a]+" * "+i:"index -= "+n[a]+" * "+i)+";"}).join("")}function _S(n){var e=Gc(n).map(function(t){return t.toString()});return` 151 int getFlatIndex(ivec3 coords) { 152 return coords.x * `+e[0]+" + coords.y * "+e[1]+` + coords.z; 153 } 154`}var rN=` 155 const float FLOAT_MAX = 1.70141184e38; 156 const float FLOAT_MIN = 1.17549435e-38; 157 158 lowp vec4 encode_float(highp float v) { 159 if (isnan(v)) { 160 return vec4(255, 255, 255, 255); 161 } 162 163 highp float av = abs(v); 164 165 if(av < FLOAT_MIN) { 166 return vec4(0.0, 0.0, 0.0, 0.0); 167 } else if(v > FLOAT_MAX) { 168 return vec4(0.0, 0.0, 128.0, 127.0) / 255.0; 169 } else if(v < -FLOAT_MAX) { 170 return vec4(0.0, 0.0, 128.0, 255.0) / 255.0; 171 } 172 173 highp vec4 c = vec4(0,0,0,0); 174 175 highp float e = floor(log2(av)); 176 highp float m = exp2(fract(log2(av))) - 1.0; 177 178 c[2] = floor(128.0 * m); 179 m -= c[2] / 128.0; 180 c[1] = floor(32768.0 * m); 181 m -= c[1] / 32768.0; 182 c[0] = floor(8388608.0 * m); 183 184 highp float ebias = e + 127.0; 185 c[3] = floor(ebias / 2.0); 186 ebias -= c[3] * 2.0; 187 c[2] += floor(ebias) * 128.0; 188 189 c[3] += 128.0 * step(0.0, -v); 190 191 return c / 255.0; 192 } 193`;function sne(n,e,t,r){var i=[];
193n.forEach(function(p){var g=ct(p.shapeInfo.logicalShape);p.shapeInfo.isUniform?i.push("uniform float "+p.name+(g>1?"["+g+"]":"")+";"):(i.push("uniform sampler2D "+p.name+";"),i.push("uniform int offset"+p.name+";"))});var a,s,o=i.join(` 194`),c=n.map(function(p){return function(g,v,y){y===void 0&&(y=!1);var b="";b+=y?iN(g):vh(g);var x=g.shapeInfo.logicalShape,S=v.logicalShape;return x.length<=S.length&&(b+=y?function(w,k){var E,I=w.name,P=I.charAt(0).toUpperCase()+I.slice(1),A="get"+P+"AtOutCoords",N=w.shapeInfo.logicalShape.length,j=k.logicalShape.length,L=Pl(w.shapeInfo.logicalShape,k.logicalShape),B=Hn(j),V=j-N,X=["x","y","z","w","u","v"];E=N===0?"":j<2&&L.length>=1?"coords = 0;":L.map(function(we){return"coords."+X[we+V]+" = 0;"}).join(` 195`);var ne="";ne=j<2&&N>0?"coords":w.shapeInfo.logicalShape.map(function(we,Fe){return"coords."+X[Fe+V]}).join(", ");var se="return outputValue;",ie=ct(w.shapeInfo.logicalShape)===1,de=ct(k.logicalShape)===1;if(N!==1||ie||de){if(ie&&!de)se=j===1?` 196 return vec4(outputValue.x, outputValue.x, 0., 0.); 197 `:` 198 return vec4(outputValue.x); 199 `;else if(L.length){var ue=N-2,Ce=N-1;L.indexOf(ue)>-1&&L.indexOf(Ce)>-1?se="return vec4(outputValue.x);":L.indexOf(ue)>-1?se="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":L.indexOf(Ce)>-1&&(se="return vec4(outputValue.xx, outputValue.zz);")}}else se=` 200 return vec4(outputValue.xy, outputValue.xy); 201 `;return` 202 vec4 `+A+`() { 203 `+B+` coords = getOutputCoords(); 204 `+E+` 205 vec4 outputValue = get`+P+"("+ne+`); 206 `+se+` 207 } 208 `}(g,v):function(w,k){var E=w.name,I=E.charAt(0).toUpperCase()+E.slice(1),P="get"+I+"AtOutCoords",A=k.texShape,N=w.shapeInfo.texShape,j=w.shapeInfo.logicalShape.length,L=k.logicalShape.length;if(!w.shapeInfo.isUniform&&j===L&&w.shapeInfo.flatOffset==null&&gi(N,A))return` 209 float `+P+`() { 210 return sampleTexture(`+E+`, resultUV); 211 } 212 `;var B,V=Hn(L),X=Pl(w.shapeInfo.logicalShape,k.logicalShape),ne=L-j,se=["x","y","z","w","u","v"];B=j===0?"":L<2&&X.length>=1?"coords = 0;":X.map(function(de){return"coords."+se[de+ne]+" = 0;"}).join(` 213`);var ie="";return ie=L<2&&j>0?"coords":w.shapeInfo.logicalShape.map(function(de,ue){return"coords."+se[ue+ne]}).join(", "),` 214 float `+P+`() { 215 `+V+` coords = getOutputCoords(); 216 `+B+` 217 return get`+I+"("+ie+`); 218 } 219 `}(g,v)),b}(p,e,r)}).join(` 220`),u=e.texShape,l=Wi(),d=function(p){return` 221 float sampleTexture(sampler2D textureSampler, vec2 uv) { 222 return `+p.texture2D+`(textureSampler, uv).r; 223 } 224 `}(l),h=function(p){return p.version+` 225 precision highp float; 226 precision highp int; 227 precision highp sampler2D; 228 `+p.varyingFs+` vec2 resultUV; 229 `+p.defineOutput+` 230 const vec2 halfCR = vec2(0.5, 0.5); 231 232 struct ivec5 233 { 234 int x; 235 int y; 236 int z; 237 int w; 238 int u; 239 }; 240 241 struct ivec6 242 { 243 int x; 244 int y; 245 int z; 246 int w; 247 int u; 248 int v; 249 }; 250 251 uniform float NAN; 252 `+p.defineSpecialNaN+` 253 `+p.defineSpecialInf+` 254 `+p.defineRound+` 255 256 int imod(int x, int y) { 257 return x - y * (x / y); 258 } 259 260 int idiv(int a, int b, float sign) { 261 int res = a / b; 262 int mod = imod(a, b); 263 if (sign < 0. && mod != 0) { 264 res -= 1; 265 } 266 return res; 267 } 268 269 //Based on the work of Dave Hoskins 270 //https://www.shadertoy.com/view/4djSRW 271 #define HASHSCALE1 443.8975 272 float random(float seed){ 273 vec2 p = resultUV * seed; 274 vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1); 275 p3 += dot(p3, p3.yzx + 19.19); 276 return fract((p3.x + p3.y) * p3.z); 277 } 278 279 `+one+` 280 `+cne+` 281 `+une+` 282 `}(l);return e.isPacked?(a=function(p,g){switch(p.length){case 0:return` 283 int getOutputCoords() { 284 return 0; 285 } 286 `;case 1:return function(w,k){var E=[Math.ceil(k[0]/2),Math.ceil(k[1]/2)];return E[0]===1?` 287 int getOutputCoords() { 288 return 2 * int(resultUV.x * `+E[1]+`.0); 289 } 290 `:E[1]===1?` 291 int getOutputCoords() { 292 return 2 * int(resultUV.y * `+E[0]+`.0); 293 } 294 `:` 295 int getOutputCoords() {
296 ivec2 resTexRC = ivec2(resultUV.yx * 297 vec2(`+E[0]+", "+E[1]+`)); 298 return 2 * (resTexRC.x * `+E[1]+` + resTexRC.y); 299 } 300 `}(0,g);case 2:return function(w,k){var E=[Math.ceil(k[0]/2),Math.ceil(k[1]/2)];if(gi(w,k))return` 301 ivec2 getOutputCoords() { 302 return 2 * ivec2(resultUV.yx * vec2(`+E[0]+", "+E[1]+`)); 303 } 304 `;var I=Math.ceil(w[1]/2);return` 305 ivec2 getOutputCoords() { 306 ivec2 resTexRC = ivec2(resultUV.yx * 307 vec2(`+E[0]+", "+E[1]+`)); 308 309 int index = resTexRC.x * `+E[1]+` + resTexRC.y; 310 int r = 2 * (index / `+I+`); 311 int c = imod(index, `+I+`) * 2; 312 313 return ivec2(r, c); 314 } 315 `}(p,g);case 3:return v=p,y=g,b=[Math.ceil(y[0]/2),Math.ceil(y[1]/2)],x=Math.ceil(v[2]/2),S=x*Math.ceil(v[1]/2),` 316 ivec3 getOutputCoords() { 317 ivec2 resTexRC = ivec2(resultUV.yx * 318 vec2(`+b[0]+", "+b[1]+`)); 319 int index = resTexRC.x * `+b[1]+` + resTexRC.y; 320 321 int b = index / `+S+`; 322 index -= b * `+S+`; 323 324 int r = 2 * (index / `+x+`); 325 int c = imod(index, `+x+`) * 2; 326 327 return ivec3(b, r, c); 328 } 329 `;default:return function(w,k){for(var E=[Math.ceil(k[0]/2),Math.ceil(k[1]/2)],I=Math.ceil(w[w.length-1]/2),P=I*Math.ceil(w[w.length-2]/2),A=P,N="",j="b, r, c",L=2;L<w.length-1;L++)A*=w[w.length-L-1],N=` 330 int b`+L+" = index / "+A+`; 331 index -= b`+L+" * "+A+`; 332 `+N,j="b"+L+", "+j;return` 333 ivec`+w.length+` getOutputCoords() { 334 ivec2 resTexRC = ivec2(resultUV.yx * 335 vec2(`+E[0]+", "+E[1]+`)); 336 int index = resTexRC.x * `+E[1]+` + resTexRC.y; 337 338 `+N+` 339 340 int b = index / `+P+`; 341 index -= b * `+P+`; 342 343 int r = 2 * (index / `+I+`); 344 int c = imod(index, `+I+`) * 2; 345 346 return ivec`+w.length+"("+j+`); 347 } 348 `}(p,g)}var v,y,b,x,S}(e.logicalShape,u),s=function(p){return` 349 void setOutput(vec4 val) { 350 `+p.output+` = val; 351 } 352 `}(l)):(a=function(p,g){switch(p.length){case 0:return` 353 int getOutputCoords() { 354 return 0; 355 } 356 `;case 1:return function(b,x){return x[0]===1?` 357 int getOutputCoords() { 358 return int(resultUV.x * `+x[1]+`.0); 359 } 360 `:x[1]===1?` 361 int getOutputCoords() { 362 return int(resultUV.y * `+x[0]+`.0); 363 } 364 `:` 365 int getOutputCoords() { 366 ivec2 resTexRC = ivec2(resultUV.yx * 367 vec2(`+x[0]+", "+x[1]+`)); 368 return resTexRC.x * `+x[1]+` + resTexRC.y; 369 } 370 `}(0,g);case 2:return function(b,x){return gi(b,x)?` 371 ivec2 getOutputCoords() { 372 return ivec2(resultUV.yx * vec2(`+x[0]+", "+x[1]+`)); 373 } 374 `:b[1]===1?` 375 ivec2 getOutputCoords() { 376 ivec2 resTexRC = ivec2(resultUV.yx * 377 vec2(`+x[0]+", "+x[1]+`)); 378 int index = resTexRC.x * `+x[1]+` + resTexRC.y; 379 return ivec2(index, 0); 380 } 381 `:b[0]===1?` 382 ivec2 getOutputCoords() { 383 ivec2 resTexRC = ivec2(resultUV.yx * 384 vec2(`+x[0]+", "+x[1]+`)); 385 int index = resTexRC.x * `+x[1]+` + resTexRC.y; 386 return ivec2(0, index); 387 } 388 `:` 389 ivec2 getOutputCoords() { 390 ivec2 resTexRC = ivec2(resultUV.yx * 391 vec2(`+x[0]+", "+x[1]+`)); 392 int index = resTexRC.x * `+x[1]+` + resTexRC.y; 393 int r = index / `+b[1]+`; 394 int c = index - r * `+b[1]+`; 395 return ivec2(r, c); 396 } 397 `}(p,g);case 3:return v=g,y=Hd(["r","c","d"],p),` 398 ivec3 getOutputCoords() { 399 ivec2 resTexRC = ivec2(resultUV.yx * 400 vec2(`+v[0]+", "+v[1]+`)); 401 int index = resTexRC.x * `+v[1]+` + resTexRC.y; 402 `+y+` 403 return ivec3(r, c, d); 404 } 405 `;case 4:return function(b,x){var S=Hd(["r","c","d","d2"],b);return` 406 ivec4 getOutputCoords() { 407 ivec2 resTexRC = ivec2(resultUV.yx * 408 vec2(`+x[0]+", "+x[1]+`)); 409 int index = resTexRC.x * `+x[1]+` + resTexRC.y; 410 `+S+` 411 return ivec4(r, c, d, d2); 412 } 413 `}(p,g);case 5:return function(b,x){var S=Hd(["r","c","d","d2","d3"],b);return` 414 ivec5 getOutputCoords() {
415 ivec2 resTexRC = ivec2(resultUV.yx * vec2(`+x[0]+`, 416 `+x[1]+`)); 417 418 int index = resTexRC.x * `+x[1]+` + resTexRC.y; 419 420 `+S+` 421 422 ivec5 outShape = ivec5(r, c, d, d2, d3); 423 return outShape; 424 } 425 `}(p,g);case 6:return function(b,x){var S=Hd(["r","c","d","d2","d3","d4"],b);return` 426 ivec6 getOutputCoords() { 427 ivec2 resTexRC = ivec2(resultUV.yx * 428 vec2(`+x[0]+", "+x[1]+`)); 429 int index = resTexRC.x * `+x[1]+` + resTexRC.y; 430 431 `+S+` 432 433 ivec6 result = ivec6(r, c, d, d2, d3, d4); 434 return result; 435 } 436 `}(p,g);default:throw new Error(p.length+"-D output sampling is not yet supported")}var v,y}(e.logicalShape,u),s=function(p){return` 437 void setOutput(float val) { 438 `+p.output+` = vec4(val, 0, 0, 0); 439 } 440 `}(l)),r&&(h+=lne),[h,d,s,o,a,c,t].join(` 441`)}function vh(n){var e=n.shapeInfo.logicalShape;switch(e.length){case 0:return function(t){var r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1);if(t.shapeInfo.isUniform)return"float "+i+"() {return "+r+";}";var a=t.shapeInfo.texShape,s=a[0],o=a[1];if(s===1&&o===1)return` 442 float `+i+`() { 443 return sampleTexture(`+r+`, halfCR); 444 } 445 `;var c=t.shapeInfo.texShape,u=c[0],l=c[1],d=Pd(r);return` 446 float `+i+`() { 447 vec2 uv = uvFromFlat(`+u+", "+l+", "+d+`); 448 return sampleTexture(`+r+`, uv); 449 } 450 `}(n);case 1:return function(t){var r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1);if(t.shapeInfo.isUniform)return` 451 float `+i+`(int index) { 452 `+ih(t)+` 453 } 454 `;var a=t.shapeInfo.texShape,s=a[0],o=a[1];if(o===1&&s===1)return` 455 float `+i+`(int index) { 456 return sampleTexture(`+r+`, halfCR); 457 } 458 `;var c=Pd(r);return o===1?` 459 float `+i+`(int index) { 460 vec2 uv = vec2(0.5, (float(index + `+c+") + 0.5) / "+s+`.0); 461 return sampleTexture(`+r+`, uv); 462 } 463 `:s===1?` 464 float `+i+`(int index) { 465 vec2 uv = vec2((float(index + `+c+") + 0.5) / "+o+`.0, 0.5); 466 return sampleTexture(`+r+`, uv); 467 } 468 `:` 469 float `+i+`(int index) { 470 vec2 uv = uvFromFlat(`+s+", "+o+", index + "+c+`); 471 return sampleTexture(`+r+`, uv); 472 } 473 `}(n);case 2:return function(t){var r=t.shapeInfo.logicalShape,i=t.name,a="get"+i.charAt(0).toUpperCase()+i.slice(1),s=t.shapeInfo.texShape;if(s!=null&&gi(r,s)){var o=s[0],c=s[1];return` 474 float `+a+`(int row, int col) { 475 vec2 uv = (vec2(col, row) + halfCR) / vec2(`+c+".0, "+o+`.0); 476 return sampleTexture(`+i+`, uv); 477 } 478 `}var u=Bd(r),l=u.newShape,d=u.keptDims,h=l;if(h.length<r.length){var p=yh(t,h);return` 479 `+vh(p)+` 480 float `+a+`(int row, int col) { 481 return `+a+"("+_h(["row","col"],d)+`); 482 } 483 `}if(t.shapeInfo.isUniform)return` 484 float `+a+`(int row, int col) { 485 int index = round(dot(vec2(row, col), vec2(`+r[1]+`, 1))); 486 `+ih(t)+` 487 } 488 `;var g=s[0],v=s[1],y=Pd(i);return v===1?` 489 float `+a+`(int row, int col) { 490 float index = dot(vec3(row, col, `+y+"), vec3("+r[1]+`, 1, 1)); 491 vec2 uv = vec2(0.5, (index + 0.5) / `+g+`.0); 492 return sampleTexture(`+i+`, uv); 493 } 494 `:g===1?` 495 float `+a+`(int row, int col) { 496 float index = dot(vec3(row, col, `+y+"), vec3("+r[1]+`, 1, 1)); 497 vec2 uv = vec2((index + 0.5) / `+v+`.0, 0.5); 498 return sampleTexture(`+i+`, uv); 499 } 500 `:` 501 float `+a+`(int row, int col) { 502 // Explicitly use integer operations as dot() only works on floats. 503 int index = row * `+r[1]+" + col + "+y+`; 504 vec2 uv = uvFromFlat(`+g+", "+v+`, index); 505 return sampleTexture(`+i+`, uv); 506 } 507`}(n);case 3:return function(t){var r=t.shapeInfo.logicalShape,i=t.name,a="get"+i.charAt(0).toUpperCase()+i.slice(1),s=r[1]*r[2],o=r[2],c=Bd(r),u=c.newShape,l=c.keptDims,d=u;if(d.length<r.length){var h=yh(t,d);return` 508 `+vh(h)+` 509 float `+a+`(int row, int col, int depth) { 510 return `+a+"("+_h(["row","col","depth"],l)+`); 511 } 512 `}if(t.shapeInfo.isUniform)return` 513 float `+a+`(int row, int col, int depth) { 514 int index = round(dot(vec3(row, col, depth), 515 vec3(`+s+", "+o+`, 1))); 516 `+ih(t)+` 517 } 518 `;var p=t.shapeInfo.texShape,g=p[0],v=p[1],y=t.shapeInfo.flatOffset;if(v===s&&y==null)return` 519 float `+a+`(int row, int col, int depth) { 520 float texR = float(row); 521 float texC = dot(vec2(col, depth), vec2(`+o+`, 1)); 522 vec2 uv = (vec2(texC, texR) + halfCR) / 523 vec2(`+v+".0, "+g+`.0); 524 return sampleTexture(`+i+`, uv); 525 } 526 `;if(v===o&&y==null)return` 527 float `+a+`(int row, int col, int depth) {
528 float texR = dot(vec2(row, col), vec2(`+r[1]+`, 1)); 529 float texC = float(depth); 530 vec2 uv = (vec2(texC, texR) + halfCR) / vec2(`+v+".0, "+g+`.0); 531 return sampleTexture(`+i+`, uv); 532 } 533 `;var b=Pd(i);return` 534 float `+a+`(int row, int col, int depth) { 535 // Explicitly use integer operations as dot() only works on floats. 536 int index = row * `+s+" + col * "+o+" + depth + "+b+`; 537 vec2 uv = uvFromFlat(`+g+", "+v+`, index); 538 return sampleTexture(`+i+`, uv); 539 } 540 `}(n);case 4:return function(t){var r=t.shapeInfo.logicalShape,i=t.name,a="get"+i.charAt(0).toUpperCase()+i.slice(1),s=r[3],o=r[2]*s,c=r[1]*o,u=Bd(r),l=u.newShape,d=u.keptDims;if(l.length<r.length){var h=yh(t,l);return` 541 `+vh(h)+` 542 float `+a+`(int row, int col, int depth, int depth2) { 543 return `+a+"("+_h(["row","col","depth","depth2"],d)+`); 544 } 545 `}if(t.shapeInfo.isUniform)return` 546 float `+a+`(int row, int col, int depth, int depth2) { 547 int index = round(dot(vec4(row, col, depth, depth2), 548 vec4(`+c+", "+o+", "+s+`, 1))); 549 `+ih(t)+` 550 } 551 `;var p=t.shapeInfo.flatOffset,g=t.shapeInfo.texShape,v=g[0],y=g[1];if(y===c&&p==null)return` 552 float `+a+`(int row, int col, int depth, int depth2) { 553 float texR = float(row); 554 float texC = 555 dot(vec3(col, depth, depth2), 556 vec3(`+o+", "+s+`, 1)); 557 vec2 uv = (vec2(texC, texR) + halfCR) / 558 vec2(`+y+".0, "+v+`.0); 559 return sampleTexture(`+i+`, uv); 560 } 561 `;if(y===s&&p==null)return` 562 float `+a+`(int row, int col, int depth, int depth2) { 563 float texR = dot(vec3(row, col, depth), 564 vec3(`+r[1]*r[2]+", "+r[2]+`, 1)); 565 float texC = float(depth2); 566 vec2 uv = (vec2(texC, texR) + halfCR) / 567 vec2(`+y+".0, "+v+`.0); 568 return sampleTexture(`+i+`, uv); 569 } 570 `;var b=Pd(i);return` 571 float `+a+`(int row, int col, int depth, int depth2) { 572 // Explicitly use integer operations as dot() only works on floats. 573 int index = row * `+c+" + col * "+o+` + 574 depth * `+s+` + depth2; 575 vec2 uv = uvFromFlat(`+v+", "+y+", index + "+b+`); 576 return sampleTexture(`+i+`, uv); 577 } 578 `}(n);case 5:return function(t){var r=t.shapeInfo.logicalShape,i=t.name,a="get"+i.charAt(0).toUpperCase()+i.slice(1),s=r[4],o=r[3]*s,c=r[2]*o,u=r[1]*c,l=Bd(r),d=l.newShape,h=l.keptDims;if(d.length<r.length){var p=yh(t,d);return` 579 `+vh(p)+` 580 float `+a+`(int row, int col, int depth, int depth2, int depth3) { 581 return `+a+"("+_h(["row","col","depth","depth2","depth3"],h)+`); 582 } 583 `}if(t.shapeInfo.isUniform)return` 584 float `+a+`(int row, int col, int depth, int depth2, int depth3) { 585 float index = dot( 586 vec4(row, col, depth, depth2), 587 vec4(`+u+", "+c+", "+o+", "+s+`)) + 588 depth3; 589 `+ih(t)+` 590 } 591 `;var g=t.shapeInfo.flatOffset,v=t.shapeInfo.texShape,y=v[0],b=v[1];if(b===u&&g==null)return` 592 float `+a+`(int row, int col, int depth, int depth2, int depth3) { 593 int texR = row; 594 float texC = dot(vec4(col, depth, depth2, depth3), 595 vec4(`+c+", "+o+", "+s+`, 1)); 596 vec2 uv = (vec2(texC, texR) + halfCR) / 597 vec2(`+b+".0, "+y+`.0); 598 return sampleTexture(`+i+`, uv); 599 } 600 `;if(b===s&&g==null)return` 601 float `+a+`(int row, int col, int depth, int depth2, int depth3) { 602 float texR = dot( 603 vec4(row, col, depth, depth2), 604 vec4(`+r[1]*r[2]*r[3]+`, 605 `+r[2]*r[3]+", "+r[3]+`, 1)); 606 int texC = depth3; 607 vec2 uv = (vec2(texC, texR) + halfCR) / 608 vec2(`+b+".0, "+y+`.0); 609 return sampleTexture(`+i+`, uv); 610 } 611 `;var x=Pd(i);return` 612 float `+a+`(int row, int col, int depth, int depth2, int depth3) { 613 // Explicitly use integer operations as dot() only works on floats. 614 int index = row * `+u+" + col * "+c+" + depth * "+o+` + 615 depth2 * `+s+" + depth3 + "+x+`; 616 vec2 uv = uvFromFlat(`+y+", "+b+`, index); 617 return sampleTexture(`+i+`, uv); 618 } 619 `}(n);case 6:return function(t){var r=t.shapeInfo.logicalShape,i=t.name,a="get"+i.charAt(0).toUpperCase()+i.slice(1),s=Bd(r),o=s.newShape,c=s.keptDims;if(o.length<r.length){var u=yh(t,o);return` 620 `+vh(u)+` 621 float `+a+`(int row, int col, int depth, 622 int depth2, int depth3, int depth4) { 623 return `+a+"("+_h(["row","col","depth","depth2","depth3","depth4"],c)+`); 624 } 625 `}var l=r[5],d=r[4]*l,h=r[3]*d,p=r[2]*h,g=r[1]*p;if(t.shapeInfo.isUniform)return` 626 float `+a+`(int row, int col, int depth, 627 int depth2, int depth3, int depth4) { 628 int index = round(dot( 629 vec4(row, col, depth, depth2), 630 vec4(`+g+", "+p+", "+h+", "+d+`)) + 631 dot( 632 vec2(depth3, depth4), 633 vec2(`+l+`, 1))); 634 `+ih(t)+` 635 } 636 `;var v=t.shapeInfo.flatOffset,y=t.shapeInfo.texShape,b=y[0],x=y[1];if(x===g&&v==null)return` 637 float `+a+`(int row, int col, int depth, 638 int depth2, int depth3, int depth4) { 639 int texR = row; 640 float texC = dot(vec4(col, depth, depth2, depth3), 641 vec4(`+p+", "+h+", "+d+", "+l+`)) + 642 float(depth4); 643 vec2 uv = (vec2(texC, texR) + halfCR) / 644 vec2(`+x+".0, "+b+`.0); 645 return sampleTexture(`+i+`, uv); 646 } 647 `;if(x===l&&v==null)return` 648 float `+a+`(int row, int col, int depth, 649 int depth2, int depth3, int depth4) {
650 float texR = dot(vec4(row, col, depth, depth2), 651 vec4(`+r[1]*r[2]*r[3]*r[4]+`, 652 `+r[2]*r[3]*r[4]+`, 653 `+r[3]*r[4]+`, 654 `+r[4]+`)) + float(depth3); 655 int texC = depth4; 656 vec2 uv = (vec2(texC, texR) + halfCR) / 657 vec2(`+x+".0, "+b+`.0); 658 return sampleTexture(`+i+`, uv); 659 } 660 `;var S=Pd(i);return` 661 float `+a+`(int row, int col, int depth, 662 int depth2, int depth3, int depth4) { 663 // Explicitly use integer operations as dot() only works on floats. 664 int index = row * `+g+" + col * "+p+" + depth * "+h+` + 665 depth2 * `+d+" + depth3 * "+l+" + depth4 + "+S+`; 666 vec2 uv = uvFromFlat(`+b+", "+x+`, index); 667 return sampleTexture(`+i+`, uv); 668 } 669 `}(n);default:throw new Error(e.length+"-D input sampling is not yet supported")}}function iN(n){var e,t,r;switch(n.shapeInfo.logicalShape.length){case 0:return e=n.name,t="get"+e.charAt(0).toUpperCase()+e.slice(1),r=Wi(),` 670 vec4 `+t+`() { 671 return `+r.texture2D+"("+e+`, halfCR); 672 } 673 `;case 1:return function(i){var a=i.name,s="get"+a.charAt(0).toUpperCase()+a.slice(1),o=i.shapeInfo.texShape,c=[Math.ceil(o[0]/2),Math.ceil(o[1]/2)],u=Wi();return` 674 vec4 `+s+`(int index) { 675 vec2 uv = packedUVfrom1D( 676 `+c[0]+", "+c[1]+`, index); 677 return `+u.texture2D+"("+a+`, uv); 678 } 679 `}(n);case 2:return function(i){var a=i.shapeInfo.logicalShape,s=i.name,o="get"+s.charAt(0).toUpperCase()+s.slice(1),c=i.shapeInfo.texShape,u=c[0],l=c[1],d=Wi();if(c!=null&&gi(a,c))return` 680 vec4 `+o+`(int row, int col) { 681 vec2 uv = (vec2(col, row) + halfCR) / vec2(`+l+".0, "+u+`.0); 682 683 return `+d.texture2D+"("+s+`, uv); 684 } 685 `;var h=[Math.ceil(c[0]/2),Math.ceil(c[1]/2)],p=Math.ceil(a[1]/2);return` 686 vec4 `+o+`(int row, int col) { 687 vec2 uv = packedUVfrom2D(`+p+", "+h[0]+", "+h[1]+`, row, col); 688 return `+d.texture2D+"("+s+`, uv); 689 } 690 `}(n);case 3:return function(i){var a=i.shapeInfo.logicalShape,s=i.name,o="get"+s.charAt(0).toUpperCase()+s.slice(1),c=i.shapeInfo.texShape,u=[Math.ceil(c[0]/2),Math.ceil(c[1]/2)];if(a[0]===1){var l=a.slice(1),d=yh(i,l);return` 691 `+iN(d)+` 692 vec4 `+o+`(int b, int row, int col) { 693 return `+o+"("+_h(["b","row","col"],[1,2])+`); 694 } 695 `}var h=u[0],p=u[1],g=Math.ceil(a[2]/2),v=g*Math.ceil(a[1]/2),y=Wi();return` 696 vec4 `+o+`(int b, int row, int col) { 697 vec2 uv = packedUVfrom3D( 698 `+h+", "+p+", "+v+", "+g+`, b, row, col); 699 return `+y.texture2D+"("+s+`, uv); 700 } 701 `}(n);default:return function(i){for(var a=i.shapeInfo.logicalShape,s=a.length,o=i.name,c="get"+o.charAt(0).toUpperCase()+o.slice(1),u=i.shapeInfo.texShape,l=[Math.ceil(u[0]/2),Math.ceil(u[1]/2)],d=l[0],h=l[1],p=Math.ceil(a[s-1]/2),g=p*Math.ceil(a[s-2]/2),v="int b, int row, int col",y="b * "+g+" + (row / 2) * "+p+" + (col / 2)",b=2;b<s-1;b++)v="int b"+b+", "+v,g*=a[s-b-1],y="b"+b+" * "+g+" + "+y;var x=Wi();return` 702 vec4 `+c+"("+v+`) { 703 int index = `+y+`; 704 int texR = index / `+h+`; 705 int texC = index - texR * `+h+`; 706 vec2 uv = (vec2(texC, texR) + halfCR) / vec2(`+h+", "+d+`); 707 return `+x.texture2D+"("+o+`, uv); 708 } 709 `}(n)}}var one=` 710vec2 uvFromFlat(int texNumR, int texNumC, int index) { 711 int texR = index / texNumC; 712 int texC = index - texR * texNumC; 713 return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); 714} 715vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { 716 int texelIndex = index / 2; 717 int texR = texelIndex / texNumC; 718 int texC = texelIndex - texR * texNumC; 719 return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); 720} 721`,cne=` 722vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, 723 int texNumC, int row, int col) { 724 int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); 725 int texR = texelIndex / texNumC; 726 int texC = texelIndex - texR * texNumC; 727 return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); 728} 729`,une=` 730vec2 packedUVfrom3D(int texNumR, int texNumC, 731 int texelsInBatch, int texelsInLogicalRow, int b, 732 int row, int col) { 733 int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2); 734 int texR = index / texNumC; 735 int texC = index - texR * texNumC; 736 return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); 737} 738`,lne=` 739 float getChannel(vec4 frag, vec2 innerDims) { 740 vec2 modCoord = mod(innerDims, 2.); 741 return modCoord.x == 0. ? 742 (modCoord.y == 0. ? frag.r : frag.g) : 743 (modCoord.y == 0. ? frag.b : frag.a); 744 } 745 float getChannel(vec4 frag, int dim) { 746 float modCoord = mod(float(dim), 2.); 747 return modCoord == 0. ? frag.r : frag.g; 748 } 749`;function Pd(n){return"offset"+n}function ih(n){var e=n.name,t=ct(n.shapeInfo.logicalShape);return t<2?"return "+e+";":` 750 for (int i = 0; i < `+t+`; i++) { 751 if (i == index) { 752 return `+e+`[i]; 753 } 754 } 755 `}function Hn(n){if(n<=1)return"int";if(n===2)return"ivec2";if(n===3)return"ivec3";if(n===4)return"ivec4";if(n===5)return"ivec5";if(n===6)return"ivec6";throw Error("GPU for rank "+n+" is not yet supported")}function yh(n,e){var t=JSON.parse(JSON.stringify(n));return t.shapeInfo.logicalShape=e,t}function _h(n,e){return e.map(function(t){return n[t]}).join(", ")}var dne=function(n,e,t,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,J(n.length>2,function(){return"Packed arg"+(t.charAt(0).toUpperCase()+t.slice(1))+" supports only input
755s with rank above 2."});var i=n[n.length-1],a=Math.ceil(i/e);this.outputShape=n.slice(0,-1),a>1&&this.outputShape.push(a),r||this.variableNames.push("bestIndicesA");var s,o,c=this.outputShape,u=c.length,l=Hn(u),d=La("coords",u);if(a===1){var h=Hn(o=u+1);s=` 756 `+h+" sourceLocR = "+h+"("+d.join()+`, 0); 757 ++`+d[u-1]+`; 758 `+h+" sourceLocG = "+h+"("+d.join()+`, 0); 759 ++`+d[u-2]+`; 760 `+h+" sourceLocA = "+h+"("+d.join()+`, 0); 761 --`+d[u-1]+`; 762 `+h+" sourceLocB = "+h+"("+d.join()+`, 0); 763 --`+d[u-2]+";"}else o=u,s=` 764 `+l+` sourceLocR = coords; 765 ++`+d[u-1]+`; 766 `+l+` sourceLocG = coords; 767 ++`+d[u-2]+`; 768 `+l+` sourceLocA = coords; 769 --`+d[u-1]+`; 770 `+l+` sourceLocB = coords; 771 --`+d[u-2]+";";var p=["x","y","z","w","u","v"].slice(0,o),g="."+p[o-1],v=p.map(function(P){return"int "+P}),y=La("sourceLocR",o-1).concat("inIdx.r"),b=La("sourceLocG",o-1).concat("inIdx.g"),x=La("sourceLocB",o-1).concat("inIdx.b"),S=La("sourceLocA",o-1).concat("inIdx.a"),w=t==="max"?"greaterThan":"lessThan",k=r?"":` 772 inIdx = round(vec4(getBestIndicesAChannel(`+y.join()+`), 773 getBestIndicesAChannel(`+b.join()+`), 774 getBestIndicesAChannel(`+x.join()+`), 775 getBestIndicesAChannel(`+S.join()+")));",E=`vec4( 776 getAChannel(`+y.join()+`), 777 hasNextCol ? getAChannel(`+b.join()+`) : 0., 778 hasNextRow ? getAChannel(`+x.join()+`) : 0., 779 hasNextRow && hasNextCol ? getAChannel(`+S.join()+") : 0.)",I=r?"":` 780 float getBestIndicesAChannel(`+v.join()+`) { 781 return getChannel(getBestIndicesA(`+p.join()+`), 782 vec2(`+p.slice(-2).join()+`)); 783 }`;this.userCode=` 784 float getAChannel(`+v.join()+`) { 785 return getChannel(getA(`+p.join()+`), 786 vec2(`+p.slice(-2).join()+`)); 787 } 788 `+I+` 789 void main() { 790 `+l+` coords = getOutputCoords(); 791 bool hasNextCol = `+d[u-1]+" < "+(c[u-1]-1)+`; 792 bool hasNextRow = `+d[u-2]+" < "+(c[u-2]-1)+`; 793 `+s+` 794 ivec4 srcIdx = ivec4(sourceLocR`+g+", sourceLocG"+g+`, 795 sourceLocB`+g+", sourceLocA"+g+") * "+e+`; 796 ivec4 inIdx = srcIdx; 797 vec4 bestIndex = vec4(inIdx); 798 vec4 bestValue = `+E+`; 799 800 for (int i = 0; i < `+e+`; i++) { 801 inIdx = srcIdx; 802 `+k+` 803 vec4 candidate = `+E+`; 804 bvec4 nan = isnan(candidate); 805 bvec4 replace = bvec4( 806 vec4(`+w+`(candidate, bestValue)) * (vec4(1.0) - vec4(nan))); 807 808 bestValue = vec4(replace.x ? candidate.x : bestValue.x, 809 replace.y ? candidate.y : bestValue.y, 810 replace.z ? candidate.z : bestValue.z, 811 replace.w ? candidate.w : bestValue.w); 812 bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace)); 813 srcIdx++; 814 } 815 setOutput(bestIndex); 816 } 817 `},fne=function(n){this.variableNames=["dy"],this.outputShape=n.inShape;var e=n.filterHeight,t=n.filterWidth,r=n.strideHeight,i=n.strideWidth,a=n.dilationHeight,s=n.dilationWidth,o=n.effectiveFilterHeight,c=n.effectiveFilterWidth,u=o-1-n.padInfo.top,l=c-1-n.padInfo.left,d=1/(e*t);this.userCode=` 818 const ivec2 pads = ivec2(`+u+", "+l+`); 819 const float avgMultiplier = float(`+d+`); 820 821 void main() { 822 ivec4 coords = getOutputCoords(); 823 int b = coords[0]; 824 int d = coords[3]; 825 826 ivec2 dyRCCorner = coords.yz - pads; 827 int dyRCorner = dyRCCorner.x; 828 int dyCCorner = dyRCCorner.y; 829 830 // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d). 831 // ? = to be determined. : = across all values in that axis. 832 float dotProd = 0.0; 833 for (int wR = 0; wR < `+o+`; 834 wR += `+a+`) { 835 float dyR = float(dyRCorner + wR) / `+r+`.0; 836 837 if (dyR < 0.0 || dyR >= `+n.outHeight+`.0 || fract(dyR) > 0.0) { 838 continue; 839 } 840 int idyR = int(dyR); 841 842 for (int wC = 0; wC < `+c+`; 843 wC+= `+s+`) { 844 float dyC = float(dyCCorner + wC) / `+i+`.0; 845 846 if (dyC < 0.0 || dyC >= `+n.outWidth+`.0 || 847 fract(dyC) > 0.0) { 848 continue; 849 } 850 int idyC = int(dyC); 851 852 float dyValue = getDy(b, idyR, idyC, d); 853 854 dotProd += dyValue * avgMultiplier; 855 } 856 } 857 setOutput(dotProd); 858 } 859 `},hne=function(n){this.variableNames=["dy"],this.outputShape=n.inShape;var e=n.filterDepth,t=n.filterHeight,r=n.filterWidth,i=n.strideDepth,a=n.strideHeight,s=n.strideWidth,o=n.dilationDepth,c=n.dilationHeight,u=n.dilationWidth,l=n.effectiveFilterDepth,d=n.effectiveFilterHeight,h=n.effectiveFilterWidth,p=l-1-n.padInfo.front,g=d-1-n.padInfo.top,v=h-1-n.padInfo.left,y=1/(e*t*r);this.userCode=` 860 const ivec3 pads = ivec3(`+p+", "+g+", "+v+`); 861 const float avgMultiplier = float(`+y+`); 862 863 void main() { 864 ivec5 coords = getOutputCoords(); 865 int batch = coords.x; 866 int ch = coords.u; 867 868 ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; 869 int dyDCorner = dyCorner.x; 870 int dyRCorner = dyCorner.y; 871 int dyCCorner = dyCorner.z; 872 873 // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get
874 // dx(xD, xR, xC, ch). 875 // ? = to be determined. : = across all values in that axis. 876 float dotProd = 0.0; 877 878 for (int wD = 0; wD < `+l+`; 879 wD += `+o+`) { 880 float dyD = float(dyDCorner + wD) / `+i+`.0; 881 882 if (dyD < 0.0 || dyD >= `+n.outDepth+`.0 || fract(dyD) > 0.0) { 883 continue; 884 } 885 int idyD = int(dyD); 886 887 for (int wR = 0; wR < `+d+`; 888 wR += `+c+`) { 889 float dyR = float(dyRCorner + wR) / `+a+`.0; 890 891 if (dyR < 0.0 || dyR >= `+n.outHeight+`.0 || 892 fract(dyR) > 0.0) { 893 continue; 894 } 895 int idyR = int(dyR); 896 897 for (int wC = 0; wC < `+h+`; 898 wC += `+u+`) { 899 float dyC = float(dyCCorner + wC) / `+s+`.0; 900 901 if (dyC < 0.0 || dyC >= `+n.outWidth+`.0 || 902 fract(dyC) > 0.0) { 903 continue; 904 } 905 int idyC = int(dyC); 906 907 float dyValue = getDy(batch, idyD, idyR, idyC, ch); 908 909 dotProd += dyValue * avgMultiplier; 910 } 911 } 912 } 913 setOutput(dotProd); 914 } 915 `},pne=function(n,e,t,r,i,a){this.outputShape=[],this.variableNames=["x","mean","variance"],tn(n,e),tn(n,t);var s="0.0";r!=null&&(tn(n,r),this.variableNames.push("offset"),s="getOffsetAtOutCoords()");var o="1.0";i!=null&&(tn(n,i),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=n,this.userCode=` 916 void main() { 917 float x = getXAtOutCoords(); 918 float mean = getMeanAtOutCoords(); 919 float variance = getVarianceAtOutCoords(); 920 float offset = `+s+`; 921 float scale = `+o+`; 922 float inv = scale * inversesqrt(variance + float(`+a+`)); 923 setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1))); 924 } 925 `},mne=function(n,e,t,r,i,a){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],tn(n,e),tn(n,t);var s="vec4(0.0)";r!=null&&(tn(n,r),this.variableNames.push("offset"),s="getOffsetAtOutCoords()");var o="vec4(1.0)";i!=null&&(tn(n,i),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=n,this.userCode=` 926 void main() { 927 vec4 offset = `+s+`; 928 vec4 scale = `+o+`; 929 930 vec4 x = getXAtOutCoords(); 931 vec4 mean = getMeanAtOutCoords(); 932 vec4 variance = getVarianceAtOutCoords(); 933 934 vec4 inv = scale * inversesqrt(variance + vec4(`+a+`)); 935 936 setOutput((x - mean) * inv + offset); 937 } 938 `},gne="return areal * breal - aimag * bimag;",vne="return areal * bimag + aimag * breal;
938",y4=function(n,e,t){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=tn(e,t),this.userCode=` 939 float binaryOpComplex( 940 float areal, float aimag, float breal, float bimag) { 941 `+n+` 942 } 943 944 void main() { 945 float areal = getARealAtOutCoords(); 946 float aimag = getAImagAtOutCoords(); 947 float breal = getBRealAtOutCoords(); 948 float bimag = getBImagAtOutCoords(); 949 setOutput(binaryOpComplex(areal, aimag, breal, bimag)); 950 } 951 `},_w="return a + b;",bw="return a - b;",_4="return a * b;",aN="return (a < 0.) ? b * a : a;",wr=function(n,e,t){this.variableNames=["A","B"],this.outputShape=tn(e,t),this.userCode=` 952 float binaryOperation(float a, float b) { 953 `+n+` 954 } 955 956 void main() { 957 float a = getAAtOutCoords(); 958 float b = getBAtOutCoords(); 959 setOutput(binaryOperation(a, b)); 960 } 961 `},sN=` 962 vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); 963 return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); 964`,Au=function(n,e,t,r){r===void 0&&(r=!1),this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=tn(e,t);var i=this.outputShape.length,a="";if(r)if(i===0||ct(this.outputShape)===1)a=` 965 result.y = 0.; 966 result.z = 0.; 967 result.w = 0.; 968 `;else if(a=` 969 `+Hn(i)+` coords = getOutputCoords(); 970 `,i===1)a+=` 971 result.y = (coords + 1) >= `+this.outputShape[0]+` ? 0. : result.y; 972 result.z = 0.; 973 result.w = 0.; 974 `;else{var s=La("coords",i);a+=` 975 bool nextRowOutOfBounds = 976 (`+s[i-2]+" + 1) >= "+this.outputShape[i-2]+`; 977 bool nextColOutOfBounds = 978 (`+s[i-1]+" + 1) >= "+this.outputShape[i-1]+`; 979 result.y = nextColOutOfBounds ? 0. : result.y; 980 result.z = nextRowOutOfBounds ? 0. : result.z; 981 result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w; 982 `}this.userCode=` 983 vec4 binaryOperation(vec4 a, vec4 b) { 984 `+n+` 985 } 986 987 void main() { 988 vec4 a = getAAtOutCoords(); 989 vec4 b = getBAtOutCoords(); 990 991 vec4 result = binaryOperation(a, b); 992 `+a+` 993 994 setOutput(result); 995 } 996 `},yne=function(){function n(e){this.variableNames=["A"],this.outputShape=e,this.userCode=` 997 uniform float minVal; 998 uniform float maxVal; 999 1000 void main() { 1001 float value = getAAtOutCoords(); 1002 if (isnan(value)) { 1003 setOutput(value); 1004 return; 1005 } 1006 1007 setOutput(clamp(value, minVal, maxVal)); 1008 } 1009 `}return n.prototype.getCustomSetupFunc=function(e,t){var r=this;return function(i,a){r.minLoc==null&&(r.minLoc=i.getUniformLocationNoThrow(a,"minVal"),r.maxLoc=i.getUniformLocationNoThrow(a,"maxVal")),i.gl.uniform1f(r.minLoc,e),i.gl.uniform1f(r.maxLoc,t)}},n}(),_ne=function(){function n(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.userCode=` 1010 uniform float minVal; 1011 uniform float maxVal; 1012 1013 void main() { 1014 vec4 value = getAAtOutCoords(); 1015 1016 if (any(isnan(value))) { 1017 setOutput(value); 1018 return; 1019 } 1020 1021 setOutput(clamp(value, vec4(minVal), vec4(maxVal))); 1022 } 1023 `}return n.prototype.getCustomSetupFunc=function(e,t){var r=this;return function(i,a){r.minLoc==null&&(r.minLoc=i.getUniformLocationNoThrow(a,"minVal"),r.maxLoc=i.getUniformLocationNoThrow(a,"maxVal")),i.gl.uniform1f(r.minLoc,e),i.gl.uniform1f(r.maxLoc,t)}},n}(),bne=function(n){this.variableNames=["real","imag"],this.outputShape=n,this.userCode=` 1024 void main() { 1025 float re = abs(getRealAtOutCoords()); 1026 float im = abs(getImagAtOutCoords()); 1027 float mx = max(re, im); 1028 1029 // sadly the length function in glsl is not underflow-safe 1030 // (at least not on Intel GPUs). So the safe solution is 1031 // to ensure underflow-safety in all cases. 1032 setOutput( 1033 mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx)) 1034 ); 1035 } 1036 `},xne=function(n){this.outputShape=[],this.outputShape=up(n,1),this.variableNames=n.map(function(o,c){return"T"+c});var e=new Array(n.length-1);e[0]=n[0][1];for(var t=1;t<e.length;t++)e[t]=e[t-1]+n[t][1];var r=["if (yC < "+e[0]+") setOutput(getT0(yR, yC));"];for(t=1;t<e.length;t++){var i=e[t-1];r.push("else if (yC < "+e[t]+") setOutput(getT"+t+"(yR, yC-"+i+"));")}var a=e.length,s=e[e.length-1];r.push("else setOutput(getT"+a+"(yR, yC-"+s+"));"),this.userCode=` 1037 void main() { 1038 ivec2 coords = getOutputCoords(); 1039 int yR = coords.x; 1040 int yC = coords.y; 1041 1042 `+r.join(` 1043 `)+` 1044 } 1045 `},wne=function(n,e){this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[],this.outputShape=up(n,e);var t=this.outputShape,r=t.length,i=Hn(r),a=La("coords",r),s=["x","y","z","w","u","v"].slice(0,r);this.variableNames=n.map(function(y,b){return"T"+b});var o=new Array(n.length-1);o[0]=n[0][e];for(var c=1;c<o.length;c++)o[c]=o[c-1]+n[c][e];var u=s[e],l=s.slice(-2),d=s.join(),h="if ("+u+" < "+o[0]+`) { 1046 return getChannel( 1047 getT0(`+d+"), vec2("+l.join()+`)); 1048 }`;for(c=1;c<o.length;c++){var p=o[c-1];h+=` 1049 if (`+u+" < "+o[c]+" && "+u+" >= "+o[c-1]+`) { 1050 return getChannel( 1051 getT`+c+"("+P0(s,u,p)+`), 1052 vec2(`+P0(l,u,p)+`)); 1053 }`}var g=o.length,v=o[o.length-1];h+=` 1054 return getChannel( 1055 getT`+g+"("+P0(s,u,v)+`), 1056 vec2(`+P0(l,u,v)+"));",this.userCode=` 1057 float getValue(`+s.map(function(y){return"int "+y})+`) { 1058 `+h+` 1059 } 1060 1061 void main() { 1062 `+i+` coords = getOutputCoords(); 1063 vec4 result = vec4(getValue(`+a+`), 0., 0., 0.); 1064 1065 `+a[r-1]+" = "+a[r-1]+` + 1; 1066 if (`+a[r-1]+" < "+t[r-1]+`) { 1067 result.g = getValue(`+a+`); 1068 } 1069 1070 `+a[r-2]+" = "+a[r-2]+` + 1; 1071 if (`+a[r-2]+" < "+t[r-2]+`) { 1072 result.a = getValue(`+a+`); 1073 } 1074 1075 `+a[r-1]+" = "+a[r-1]+` - 1; 1076 if (`+a[r-2]+" < "+t[r-2]+` && 1077 `+a[r-1]+" < "+t[r-1]+`) { 1078 result.b = getValue(`+a+`); 1079 } 1080 setOutput(result); 1081 } 1082 `};function P0(n,e,t){var r=n.indexOf(e);return n.map(function(i,a){return a===r?i+" - "+t:i}).join()}var Cne=function(n){this.variableNames=["x","dy"],this.outputShape=n.filterShape;var e=n.strideHeight,t=n.strideWidth,r=n.padInfo.top,i=n.padInfo.left,a=n.dataFormat==="channelsLast";this.userCode=` 1083 void main() { 1084 ivec4 coords = getOutputCoords(); 1085 int wR = coords.x; 1086 int wC = coords.y; 1087 int d1 = coords.z; 1088 int d2 = coords.w; 1089 1090 // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2). 1091 // ? = to be determined. : = across all values in that axis. 1092 float dotProd = 0.0; 1093 1094 for (int b = 0; b < `+n.batchSize+`; b++) { 1095 for (int yR = 0; yR < `+n.outHeight+`; yR++) { 1096 int xR = wR + yR * `+e+" - "+r+`; 1097 1098 if (xR < 0 || xR >= `+n.inHeight+`) { 1099 continue; 1100 } 1101 1102 for (int yC = 0; yC < `+n.outWidth+`; yC++) { 1103 int xC = wC + yC * `+t+" - "+i+`; 1104 1105 if (xC < 0 || xC >= `+n.inWidth+`) { 1106 continue; 1107 } 1108 1109 if (`+a+`) { 1110 float dyValue = getDy(b, yR, yC, d2); 1111 float xValue = getX(b, xR, xC, d1); 1112 dotProd += (xValue * dyValue); 1113 } else { 1114 float dyValue = getDy(b, d2, yR, yC); 1115 float xValue = getX(b, d1, xR, xC); 1116 dotProd += (xValue * dyValue); 1117 } 1118 1119 } 1120 } 1121 } 1122 setOutput(dotProd); 1123 } 1124 `},kne=function(n){this.variableNames=["dy","W"],this.outputShape=n.inShape;var e=n.filterHeight,t=n.filterWidth,r=n.strideHeight,i=n.strideWidth,a=n.dataFormat==="channelsLast",s=e-1-n.padInfo.top,o=t-1-n.padInfo.left,c=a?1:2,u=a?2:3,l=a?3:1;this.userCode=` 1125 const ivec2 pads = ivec2(`+s+", "+o+`); 1126 1127 void main() { 1128 ivec4 coords = getOutputCoords(); 1129 int batch = coords[0]; 1130 int d1 = coords[`+l+`]; 1131 1132 ivec2 dyCorner = ivec2(coords[`+c+"], coords["+u+`]) - pads; 1133 int dyRCorner = dyCorner.x; 1134 int dyCCorner = dyCorner.y; 1135 1136 // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1). 1137 // ? = to be determined. : = across all values in that axis. 1138 float dotProd = 0.0; 1139 for (int wR = 0; wR < `+e+`; wR++) { 1140 float dyR = float(dyRCorner + wR) / `+r+`.0; 1141 1142 if (dyR < 0.0 || dyR >= `+n.outHeight+`.0 || fract(dyR) > 0.0) { 1143 continue; 1144 } 1145 int idyR = int(dyR); 1146 1147 int wRPerm = `+e+` - 1 - wR; 1148 1149 for (int wC = 0; wC < `+t+`; wC++) { 1150 float dyC = float(dyCCorner + wC) / `+i+`.0; 1151 1152 if (dyC < 0.0 || dyC >= `+n.outWidth+`.0 || 1153 fract(dyC) > 0.0) { 1154 continue; 1155 } 1156 int idyC = int(dyC); 1157 1158 int wCPerm = `+t+` - 1 - wC; 1159 1160 for (int d2 = 0; d2 < `+n.outChannels+`; d2++) { 1161 1162 if (`+a+`) { 1163 float xValue = getDy(batch, idyR, idyC, d2); 1164 float wValue = getW(wRPerm, wCPerm, d1, d2); 1165 dotProd += xValue * wValue; 1166 } else { 1167 float xValue = getDy(batch, d2, idyR, idyC); 1168 float wValue = getW(wRPerm, wCPerm, d1, d2); 1169 dotProd += xValue * wValue; 1170 } 1171 1172 } 1173 } 1174 } 1175 setOutput(dotProd); 1176 } 1177 `},Sne=function(n){this.variableNames=["x","dy"],this.outputShape=n.filterShape;var e=n.strideDepth,t=n.strideHeight,r=n.strideWidth,i=n.padInfo.front,a=n.padInfo.top,s=n.padInfo.left;this.userCode=` 1178 void main() { 1179 ivec5 coords = getOutputCoords(); 1180 int wF = coords.x; 1181 int wR = coords.y; 1182 int wC = coords.z; 1183 int d1 = coords.w; 1184 int d2 = coords.u; 1185 1186 float dotProd = 0.0; 1187 1188 for (int b = 0; b < `+n.batchSize+`; b++) { 1189 for (int yF = 0; yF < `+n.outDepth+`; yF++) { 1190 int xF = wF + yF * `+e+" - "+i+`; 1191 1192 if (xF < 0 || xF >= `+n.inDepth+`) { 1193 continue; 1194 } 1195 1196 for (int yR = 0; yR < `+n.outHeight+`; yR++) { 1197 int xR = wR + yR * `+t+" - "+a+`; 1198 1199 if (xR < 0 || xR >= `+n.inHeight+`) { 1200 continue; 1201 } 1202 1203 for (int yC = 0; yC < `+n.outWidth+`; yC++) { 1204 int xC = wC + yC * `+r+" - "+s+`; 1205 1206 if (xC < 0 || xC >= `+n.inWidth+`) { 1207 continue; 1208 } 1209 1210 float dyValue = getDy(b, yF, yR, yC, d2); 1211 float xValue = getX(b, xF, xR, xC, d1); 1212 dotProd += (xValue * dyValue); 1213 } 1214 } 1215 } 1216 } 1217 setOutput(dotProd); 1218 } 1219 `},Tne=function(n){this.variableNames=["dy","W"],this.outputShape=n.inShape;var e=n.filterDepth,t=n.filterHeight,r=n.filterWidth,i=n.strideDepth,a=n.strideHeight,s=n.strideWidth,o=e-1-n.padInfo.front,c=t-1-n.padInfo.top,u=r-1-n.padInfo.left;this.userCode=` 1220 const ivec3 pads = ivec3(`+o+", "+c+", "+u+`); 1221 1222 void main() { 1223 ivec5 coords = getOutputCoords(); 1224 int batch = coords.x; 1225 int d1 = coords.u; 1226 1227 1228 ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; 1229 int dyFCorner = dyCorner.x; 1230 int dyRCorner = dyCorner.y; 1231 int dyCCorner = dyCorner.z; 1232 1233 float dotProd = 0.0; 1234 for (int wF = 0; wF < `+e+`; wF++) { 1235 float dyF = float(dyFCorner + wF) / `+i+`.0; 1236 1237 if (dyF < 0.0 || dyF >= `+n.outDepth+`.0 || fract(dyF) > 0.0) { 1238 continue; 1239 } 1240 int idyF = int(dyF); 1241 1242 int wFPerm = `+e+` - 1 - wF; 1243 1244 for (int wR = 0; wR < `+t+`; wR++) { 1245 float dyR = float(dyRCorner + wR) / `+a+`.0; 1246 1247 if (dyR < 0.0 || dyR >= `+n.outHeight+`.0 || 1248 fract(dyR) > 0.0) { 1249 continue; 1250 } 1251 int idyR = int(dyR); 1252 1253 int wRPerm = `+t+` - 1 - wR; 1254 1255 for (int wC = 0; wC < `+r+`; wC++) { 1256 float dyC = float(dyCCorner + wC) / `+s+`.0; 1257 1258 if (dyC < 0.0 || dyC >= `+n.outWidth+`.0 || 1259 fract(dyC) > 0.0) { 1260 continue; 1261 } 1262 int idyC = int(dyC); 1263 1264 int wCPerm = `+r+` - 1 - wC; 1265 1266 for (int d2 = 0; d2 < `+n.outChannels+`; d2++) { 1267 float xValue = getDy(batch, idyF, idyR, idyC, d2); 1268 float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2); 1269 dotProd += xValue * wValue; 1270 } 1271 } 1272 } 1273 } 1274 setOutput(dotProd); 1275 } 1276 `},Ene=function(n){this.variableNames=["x","dy"],this.outputShape=n.filterShape;var e=n.strideHeight,t=n.strideWidth,r=n.padInfo.top,i=n.padInfo.left,a=n.outChannels/n.inChannels;this.userCode=` 1277 void main() { 1278 ivec4 coords = getOutputCoords(); 1279 int wR = coords.x; 1280 int wC = coords.y; 1281 int d1 = coords.z; 1282 int dm = coords.w; 1283 int d2 = d1 * `+a+` + dm; 1284 1285 float dotProd = 0.0; 1286 1287 // TO DO: Vec4 over the batch size 1288 for (int b = 0; b < `+n.batchSize+`; b++) { 1289 for (int yR = 0; yR < `+n.outHeight+`; yR++) { 1290 int xR = wR + yR * `+e+" - "+r+`; 1291 1292 if (xR < 0 || xR >= `+n.inHeight+`) { 1293 continue; 1294 } 1295 1296 for (int yC = 0; yC < `+n.outWidth+`; yC++) { 1297 int xC = wC + yC * `+t+" - "+i+`; 1298 1299 if (xC < 0 || xC >= `+n.inWidth+`) { 1300 continue; 1301 } 1302 1303 float dyValue = getDy(b, yR, yC, d2); 1304 float xValue = getX(b, xR, xC, d1); 1305 dotProd += (xValue * dyValue); 1306 } 1307 } 1308 } 1309 setOutput(dotProd); 1310 } 1311 `},Pne=function(n){this.variableNames=["dy","W"],this.outputShape=n.inShape;var e=n.filterHeight,t=n.filterWidth,r=n.strideHeight,i=n.strideWidth,a=e-1-n.padInfo.top,s=t-1-n.padInfo.left,o=n.outChannels/n.inChannels;this.userCode=` 1312 const ivec2 pads = ivec2(`+a+", "+s+`); 1313 1314 void main() { 1315 ivec4 coords = getOutputCoords(); 1316 int batch = coords[0]; 1317 int d1 = coords[3]; 1318 ivec2 dyCorner = coords.yz - pads; 1319 int dyRCorner = dyCorner.x; 1320 int dyCCorner = dyCorner.y; 1321 1322 float dotProd = 0.0; 1323 1324 for (int wR = 0; wR < `+e+`; wR++) { 1325 float dyR = float(dyRCorner + wR) / `+r+`.0; 1326 1327 if (dyR < 0.0 || dyR >= `+n.outHeight+`.0 || fract(dyR) > 0.0) { 1328 continue; 1329 } 1330 int idyR = int(dyR); 1331 1332 int wRPerm = `+e+` - 1 - wR; 1333 1334 for (int wC = 0; wC < `+t+`; wC++) { 1335 float dyC = float(dyCCorner + wC) / `+i+`.0; 1336 1337 if (dyC < 0.0 || dyC >= `+n.outWidth+`.0 || 1338 fract(dyC) > 0.0) { 1339 continue; 1340 } 1341 int idyC = int(dyC); 1342 1343 int wCPerm = `+t+` - 1 - wC; 1344 1345 // TO DO: Vec4 over the channelMul 1346 for (int dm = 0; dm < `+o+`; dm++) { 1347 int d2 = d1 * `+o+` + dm; 1348 float xValue = getDy(batch, idyR, idyC, d2); 1349 float wValue = getW(wRPerm, wCPerm, d1, dm); 1350 dotProd += xValue * wValue; 1351 } 1352 } 1353 } 1354 setOutput(dotProd); 1355 } 1356 `},b4=function(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=null),r===void 0&&(r=!1),this.variableNames=["x","W"],this.outputShape=n.outShape;var i=n.padInfo.top,a=n.padInfo.left,s=n.strideHeight,o=n.strideWidth,c=n.dilationHeight,u=n.dilationWidth,l=n.filterHeight,d=n.filterWidth,h=4*Math.floor(n.inChannels/4),p=n.inChannels%4,g=n.dataFormat==="channelsLast",v=g?1:2,y=g?2:3,b=g?3:1,x="",S="";t&&(x=r?`float activation(float a) { 1357 float b = getPreluActivationWeightsAtOutCoords(); 1358 `+t+` 1359 }`:` 1360 float activation(float x) { 1361 `+t+` 1362 } 1363 `,S="result = activation(result);");var w=e?"result += getBiasAtOutCoords();":"";e&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),this.userCode=` 1364 `+x+` 1365 1366 const i
1366vec2 strides = ivec2(`+s+", "+o+`); 1367 const ivec2 pads = ivec2(`+i+", "+a+`); 1368 1369 void main() { 1370 ivec4 coords = getOutputCoords(); 1371 int batch = coords[0]; 1372 int d2 = coords[`+b+`]; 1373 1374 ivec2 xRCCorner = 1375 ivec2(coords[`+v+"], coords["+y+`]) * strides - pads; 1376 int xRCorner = xRCCorner.x; 1377 int xCCorner = xRCCorner.y; 1378 1379 // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2). 1380 // ? = to be determined. : = across all values in that axis. 1381 float dotProd = 0.0; 1382 for (int wR = 0; wR < `+l+`; wR++) { 1383 int xR = xRCorner + wR * `+c+`; 1384 1385 if (xR < 0 || xR >= `+n.inHeight+`) { 1386 continue; 1387 } 1388 1389 for (int wC = 0; wC < `+d+`; wC++) { 1390 int xC = xCCorner + wC * `+u+`; 1391 1392 if (xC < 0 || xC >= `+n.inWidth+`) { 1393 continue; 1394 } 1395 1396 for (int d1 = 0; d1 < `+h+`; d1 += 4) { 1397 vec4 wValues = vec4( 1398 getW(wR, wC, d1, d2), 1399 getW(wR, wC, d1 + 1, d2), 1400 getW(wR, wC, d1 + 2, d2), 1401 getW(wR, wC, d1 + 3, d2) 1402 ); 1403 1404 if (`+g+`) { 1405 vec4 xValues = vec4( 1406 getX(batch, xR, xC, d1), 1407 getX(batch, xR, xC, d1 + 1), 1408 getX(batch, xR, xC, d1 + 2), 1409 getX(batch, xR, xC, d1 + 3) 1410 ); 1411 dotProd += dot(xValues, wValues); 1412 } else { 1413 vec4 xValues = vec4( 1414 getX(batch, d1, xR, xC), 1415 getX(batch, d1 + 1, xR, xC), 1416 getX(batch, d1 + 2, xR, xC), 1417 getX(batch, d1 + 3, xR, xC) 1418 ); 1419 dotProd += dot(xValues, wValues); 1420 } 1421 } 1422 1423 if (`+(p===1)+`) { 1424 1425 if (`+g+`) { 1426 dotProd += 1427 getX(batch, xR, xC, `+h+`) * 1428 getW(wR, wC, `+h+`, d2); 1429 } else { 1430 dotProd += 1431 getX(batch, `+h+`, xR, xC) * 1432 getW(wR, wC, `+h+`, d2); 1433 } 1434 1435 } else if (`+(p===2)+`) { 1436 vec2 wValues = vec2( 1437 getW(wR, wC, `+h+`, d2), 1438 getW(wR, wC, `+h+` + 1, d2) 1439 ); 1440 1441 if (`+g+`) { 1442 vec2 xValues = vec2( 1443 getX(batch, xR, xC, `+h+`), 1444 getX(batch, xR, xC, `+h+` + 1) 1445 ); 1446 dotProd += dot(xValues, wValues); 1447 } else { 1448 vec2 xValues = vec2( 1449 getX(batch, `+h+`, xR, xC), 1450 getX(batch, `+h+` + 1, xR, xC) 1451 ); 1452 dotProd += dot(xValues, wValues); 1453 } 1454 1455 } else if (`+(p===3)+`) { 1456 vec3 wValues = vec3( 1457 getW(wR, wC, `+h+`, d2), 1458 getW(wR, wC, `+h+` + 1, d2), 1459 getW(wR, wC, `+h+` + 2, d2) 1460 ); 1461 1462 if (`+g+`) { 1463 vec3 xValues = vec3( 1464 getX(batch, xR, xC, `+h+`), 1465 getX(batch, xR, xC, `+h+` + 1), 1466 getX(batch, xR, xC, `+h+` + 2) 1467 ); 1468 dotProd += dot(xValues, wValues); 1469 } else { 1470 vec3 xValues = vec3( 1471 getX(batch, `+h+`, xR, xC), 1472 getX(batch, `+h+` + 1, xR, xC), 1473 getX(batch, `+h+` + 2, xR, xC) 1474 ); 1475 dotProd += dot(xValues, wValues); 1476 } 1477 1478 } 1479 } 1480 } 1481 1482 float result = dotProd; 1483 `+w+` 1484 `+S+` 1485 setOutput(result); 1486 } 1487 `},Rne=function(n){this.variableNames=["x","W"],this.outputShape=n.outShape;var e=n.padInfo.front,t=n.padInfo.top,r=n.padInfo.left,i=n.strideDepth,a=n.strideHeight,s=n.strideWidth,o=n.dilationDepth,c=n.dilationHeight,u=n.dilationWidth,l=n.filterDepth,d=n.filterHeight,h=n.filterWidth,p=4*Math.floor(n.inChannels/4),g=n.inChannels%4;this.userCode=` 1488 const ivec3 strides = ivec3(`+i+", "+a+", "+s+`); 1489 const ivec3 pads = ivec3(`+e+", "+t+", "+r+`); 1490 1491 void main() { 1492 ivec5 coords = getOutputCoords(); 1493 int batch = coords.x; 1494 int d2 = coords.u; 1495 1496 ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; 1497 int xFCorner = xFRCCorner.x; 1498 int xRCorner = xFRCCorner.y; 1499 int xCCorner = xFRCCorner.z; 1500 1501 // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get 1502 // y(yF, yR, yC, d2). ? = to be determined. : = across all 1503 // values in that axis. 1504 float dotProd = 0.0; 1505 for (int wF = 0; wF < `+l+`; wF++) { 1506 int xF = xFCorner + wF * `+o+`; 1507 1508 if (xF < 0 || xF >= `+n.inDepth+`) { 1509 continue; 1510 } 1511 1512 for (int wR = 0; wR < `+d+`; wR++) { 1513 int xR = xRCorner + wR * `+c+`; 1514 1515 if (xR < 0 || xR >= `+n.inHeight+`) { 1516 continue; 1517 } 1518 1519 for (int wC = 0; wC < `+h+`; wC++) { 1520 int xC = xCCorner + wC * `+u+`; 1521 1522 if (xC < 0 || xC >= `+n.inWidth+`) { 1523 continue; 1524 } 1525 1526 for (int d1 = 0; d1 < `+p+`; d1 += 4) { 1527 vec4 xValues = vec4( 1528 getX(batch, xF, xR, xC, d1), 1529 getX(batch, xF, xR, xC, d1 + 1), 1530 getX(batch, xF, xR, xC, d1 + 2), 1531 getX(batch, xF, xR, xC, d1 + 3) 1532 ); 1533 vec4 wValues = vec4( 1534 getW(wF, wR, wC, d1, d2), 1535 getW(wF, wR, wC, d1 + 1, d2), 1536 getW(wF, wR, wC, d1 + 2, d2), 1537 getW(wF, wR, wC, d1 + 3, d2) 1538 ); 1539 1540 dotProd += dot(xValues, wValues); 1541 } 1542 1543 if (`+(g===1)+`) { 1544 dotProd += 1545 getX(batch, xF, xR, xC, `+p+`) * 1546 getW(wF, wR, wC, `+p+`, d2); 1547 } else if (`+(g===2)+`) { 1548 vec2 xValues = vec2( 1549 getX(batch, xF, xR, xC, `+p+`), 1550 getX(batch, xF, xR, xC, `+p+` + 1) 1551 ); 1552 vec2 wValues = vec2( 1553 getW(wF, wR, wC, `+p+`, d2), 1554 getW(wF, wR, wC, `+p+` + 1, d2) 1555 ); 1556 dotProd += dot(xValues, wValues); 1557 } else if (`+(g===3)+`) { 1558 vec3 xValues = vec3( 1559 getX(batch, xF, xR, xC, `+p+`), 1560 getX(batch, xF, xR, xC, `+p+` + 1), 1561 getX(batch, xF, xR, xC, `+p+` + 2) 1562 ); 1563 vec3 wValues = vec3( 1564 getW(wF, wR, wC, `+p+`, d2), 1565 getW(wF, wR, wC, `+p+` + 1, d2), 1566 getW(wF, wR, wC, `+p+` + 2, d2) 1567 ); 1568 dotProd += dot(xValues, wValues); 1569 } 1570 } 1571 } 1572 } 1573 setOutput(dotProd); 1574 } 1575 `},x4=function(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=null),r===void 0&&(r=!1),this.variableNames=["x","W"],this.outputShape=n.outShape;var i=n.inHeight,a=n.inWidth,s=n.padInfo.top,o=n.padInfo.left,c=n.strideHeight,u=n.strideWidth,l=n.dilationHeight,d=n.dilationWidth,h=n.filterHeight,p=n.filterWidth,g=n.outChannels/n.inChannels,v="",y="";t&&(v=r?`float activation(float a) { 1576 float b = getPreluActivationWeightsAtOutCoords(); 1577 `+t+` 1578 }`:` 1579 float activation(float x) { 1580 `+t+` 1581 } 1582 `,y="result = activation(result);");var b=e?"result += getBiasAtOutCoords();":"";e&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),this.userCode=` 1583 `+v+` 1584 1585 const ivec2 strides = ivec2(`+c+", "+u+`); 1586 const ivec2 pads = ivec2(`+s+", "+o+`); 1587 1588 void main() { 1589 ivec4 coords = getOutputCoords(); 1590 int batch = coords.x; 1591 ivec2 xRCCorner = coords.yz * strides - pads; 1592 int d2 = coords.w; 1593 int d1 = d2 / `+g+`; 1594 int q = d2 - d1 * `+g+`; 1595 1596 int xRCorner = xRCCorner.x; 1597 int xCCorner = xRCCorner.y; 1598 1599 // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2). 1600 // ? = to be determined. : = across all values in that axis. 1601 float dotProd = 0.0; 1602 // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations. 1603 for (int wR = 0; wR < `+h+`; wR++) { 1604 int xR = xRCorner + wR * `+l+`; 1605 1606 if (xR < 0 || xR >= `+i+`) { 1607 continue; 1608 } 1609 1610 for (int wC = 0; wC < `+p+`; wC++) { 1611 int xC = xCCorner + wC * `+d+`; 1612 1613 if (xC < 0 || xC >= `+a+`) { 1614 continue; 1615 } 1616 1617 float xVal = getX(batch, xR, xC, d1); 1618 float wVal = getW(wR, wC, d1, q); 1619 dotProd += xVal * wVal; 1620 } 1621 } 1622 1623 float result = dotProd; 1624 `+b+` 1625 `+y+` 1626 setOutput(result); 1627 } 1628 `},w4=function(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=null),r===void 0&&(r=!1),this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n.outShape;for(var i=n.inHeight,a=n.inWidth,s=n.padInfo.top,o=n.padInfo.left,c=n.strideHeight,u=n.strideWidth,l=n.dilationHeight,d=n.dilationWidth,h=n.filterHeight,p=n.filterWidth,g=p,v="int xR; int xC; int xCOffset;",y=0;y<h;y++)for(var b=0;b<p;b++)v+=` 1629 vec4 xTexelR`+y+"C"+2*b+` = vec4(0.); 1630 vec4 wR`+y+"C"+b+` = vec4(0.); 1631 vec4 xR`+y+"C"+b+" = vec4(0.);";for(y=0;y<h;y++)for(var x=0;x<g;x++){if(v+=` 1632 xR = xRCorner + `+y*l+`; 1633 xC = xCCorner + `+(b=2*x)*d+`; 1634 `,u===1){if(b<p&&(v+=o%2==1?` 1635 xCOffset = xC + 1; 1636 if(xR >= 0 && xR < `+i+" && xCOffset >= 0 && xCOffset < "+a+`) { 1637 xTexelR`+y+"C"+b+` = getX(batch, xR, xCOffset, d1); 1638 1639 // Need to manually clear unused channels in case 1640 // we're reading from recycled texture. 1641 if(xCOffset + 1 >= `+a+`) { 1642 xTexelR`+y+"C"+b+`.zw = vec2(0.); 1643 } 1644 } else { 1645 xTexelR`+y+"C"+b+` = vec4(0.); 1646 } 1647 1648 xCOffset = xC + 1 - 2; 1649 if(xR >= 0 && xR < `+i+" && xCOffset >= 0 && xCOffset < "+a+`) { 1650 vec4 previous = getX(batch, xR, xCOffset, d1); 1651 1652 // Need to manually clear unused channels in case 1653 // we're reading from recycled texture. 1654 if(xCOffset + 1 >= `+a+`) { 1655 previous.zw = vec2(0.); 1656 } 1657 1658 xR`+y+"C"+b+" = vec4(previous.zw, xTexelR"+y+"C"+b+`.xy); 1659 } else { 1660 xR`+y+"C"+b+" = vec4(0, 0, xTexelR"+y+"C"+b+`.xy); 1661 } 1662 `:` 1663 if(xR >= 0 && xR < `+i+" && xC >= 0 && xC < "+a+`) { 1664 xTexelR`+y+"C"+b+` = getX(batch, xR, xC, d1); 1665 } else { 1666 xTexelR`+y+"C"+b+` = vec4(0.); 1667 } 1668 1669 xR`+y+"C"+b+" = xTexelR"+y+"C"+b+`; 1670 `,b+1<p)){var S=o%2==0?k5(d):d;d%2==0&&o%2==1||d%2!=0&&o%2!=1?(v+=` 1671 xCOffset = xC + `+o%2+" + "+S+`; 1672 1673 if(xR >= 0 && xR < `+i+` && 1674 xCOffset >= 0 && xCOffset < `+a+`) { 1675 xTexelR`+y+"C"+(b+2)+` = getX(batch, xR, xCOffset, d1); 1676 } 1677 `,d>1&&(v+=` 1678 xCOffset -= 2; 1679 if(xR >= 0 && xR < `+i+` && 1680 xCOffset >= 0 && xCOffset < `+a+`) { 1681 xTexelR`+y+"C"+b+` = getX(batch, xR, xCOffset, d1); 1682 } else { 1683 xTexelR`+y+"C"+b+` = vec4(0.); 1684 } 1685 `),v+=` 1686 xR`+y+"C"+(b+1)+` = vec4( 1687 xTexelR`+y+"C"+b+".zw, xTexelR"+y+"C"+(b+2)+`.xy); 1688 `):v+=` 1689 xCOffset = xC + `+S+`; 1690 1691 if(xR >= 0 && xR < `+i+` && 1692 xCOffset >= 0 && xCOffset < `+a+`) { 1693 xTexelR`+y+"C"+(b+2)+` = getX(batch, xR, xCOffset, d1); 1694 } 1695 1696 xR`+y+"C"+(b+1)+" = xTexelR"+y+"C"+(b+2)+`; 1697 `}}else b<p&&(v+=` 1698 if(xR >= 0 && xR < `+i+`) { 1699 `,o%2==1?(v+=` 1700 xCOffset = xC + 1 - `+u+`; 1701 if(xCOffset >= 0 && xCOffset < `+a+`) { 1702 xTexelR`+y+"C"+b+` = getX(batch, xR, xCOffset, d1); 1703 } else { 1704 xTexelR`+y+"C"+b+` = vec4(0.); 1705 } 1706 1707 if(xC + 1 >= 0 && xC + 1 < `+a+`) { 1708 xTexelR`+y+"C"+(b+2)+` = getX(batch, xR, xC + 1, d1); 1709 } else { 1710 xTexelR`+y+"C"+(b+2)+` = vec4(0.); 1711 } 1712 1713 xR`+y+"C"+b+` = vec4( 1714 xTexelR`+y+"C"+b+".zw, xTexelR"+y+"C"+(b+2)+`.zw); 1715 `,b+1<p&&(v+=` 1716 vec4 final = vec4(0.); 1717 xCOffset = xC + 1 + `+u+`; 1718 if(xCOffset >= 0 && xCOffset < `+a+`) { 1719 final = getX(batch, xR, xCOffset, d1); 1720 } 1721 xR`+y+"C"+(b+1)+" = vec4(xTexelR"+y+"C"+(b+2)+`.xy, final.xy); 1722 `)):(v+=` 1723 if(xC >= 0 && xC < `+a+`) { 1724 xTexelR`+y+"C"+b+` = getX(batch, xR, xC, d1); 1725 } else { 1726 xTexelR`+y+"C"+b+` = vec4(0.); 1727 } 1728 1729 xCOffset = xC + `+u+`; 1730 if(xCOffset >= 0 && xCOffset < `+a+`) { 1731 xTexelR`+y+"C"+(b+2)+` = getX(batch, xR, xCOffset, d1); 1732 } else { 1733 xTexelR`+y+"C"+(b+2)+` = vec4(0.); 1734 } 1735 1736 xR`+y+"C"+b+` = vec4( 1737 xTexelR`+y+"C"+b+".xy, xTexelR"+y+"C"+(b+2)+`.xy); 1738 `,b+1<p&&(v+=` 1739 xR`+y+"C"+(b+1)+` = vec4( 1740 xTexelR`+y+"C"+b+".zw, xTexelR"+y+"C"+(b+2)+`.zw); 1741 `)),v+="}");b<p&&(v+=` 1742 vec4 wTexelR`+y+"C"+b+" = getW("+y+", "+b+`, d1, q); 1743 wR`+y+"C"+b+" = vec4(wTexelR"+y+"C"+b+".xz, wTexelR"+y+"C"+b+`.xz); 1744 `,b+1<p&&(v+=` 1745 vec4 wTexelR`+y+"C"+(b+1)+" = getW("+y+", "+(b+1)+`, d1, q); 1746 wR`+y+"C"+(b+1)+` = 1747 vec4(wTexelR`+y+"C"+(b+1)+".xz, wTexelR"+y+"C"+(b+1)+".xz);"))}for(y=0;y<h;y++)for(b=0;b<p;b++)v+="dotProd += xR"+y+"C"+b+" * wR"+y+"C"+b+";";var w="",k="";t&&(w=r?`vec4 activation(vec4 a) { 1748 vec4 b = getPreluActivationWeightsAtOutCoords(); 1749 `+t+` 1750 }`:`vec4 activation(vec4 x) { 1751 `+t+` 1752 }`,k="result = activation(result);");var E=e?"result += getBiasAtOutCoords();":"";e&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),this.userCode=` 1753 `+w+` 1754 1755 const ivec2 strides = ivec2(`+c+", "+u+`); 1756 const ivec2 pads = ivec2(`+s+", "+o+`); 1757 1758 void main() { 1759 1760 ivec4 coords = getOutputCoords(); 1761 int batch = coords.x; 1762 ivec2 xRCCorner = coords.yz * strides - pads; 1763 int d2 = coords.w; 1764 int d1 = d2; 1765 int q = 0; 1766 int xRCorner = xRCCorner.x; 1767 int xCCorner = xRCCorner.y; 1768 1769 vec4 dotProd = vec4(0.); 1770 1771 `+v+` 1772 1773 vec4 result = dotProd; 1774 `+E+` 1775 `+k+` 1776 setOutput(result); 1777 } 1778 `},Ane=function(n,e,t,r,i){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];
1778var a=n[0],s=n[1],o=n[2],c=n[3],u=e[0],l=t[0],d=t[1];this.outputShape=[u,l,d,c];var h=r==="bilinear"?1:0,p=[s-1+".0",o-1+".0"],g=p[0],v=p[1],y=l>1?[""+(s-1)/(l-1),"(y2-y1) * height_ratio","y1*"+g+" + float(y)*(height_scale)"]:["0.0","0.0","0.5 * (y1+y2) * "+g],b=y[0],x=y[1],S=y[2],w=d>1?[""+(o-1)/(d-1),"(x2-x1) * width_ratio","x1*"+v+" + float(x)*(width_scale)"]:["0.0","0.0","0.5 * (x1+x2) * "+v],k=w[0],E=w[1],I=w[2];this.userCode=` 1779 const float height_ratio = float(`+b+`); 1780 const float width_ratio = float(`+k+`); 1781 void main() { 1782 ivec4 coords = getOutputCoords(); 1783 int b = coords[0]; 1784 int y = coords[1]; 1785 int x = coords[2]; 1786 int d = coords[3]; 1787 1788 // get box vals 1789 float y1 = getBoxes(b,0); 1790 float x1 = getBoxes(b,1); 1791 float y2 = getBoxes(b,2); 1792 float x2 = getBoxes(b,3); 1793 1794 // get image in batch index 1795 int bInd = round(getBoxInd(b)); 1796 if(bInd < 0 || bInd >= `+a+`) { 1797 return; 1798 } 1799 1800 float height_scale = `+x+`; 1801 float width_scale = `+E+`; 1802 1803 float in_y = `+S+`; 1804 if( in_y < 0.0 || in_y > `+g+` ) { 1805 setOutput(float(`+i+`)); 1806 return; 1807 } 1808 float in_x = `+I+`; 1809 if( in_x < 0.0 || in_x > `+v+` ) { 1810 setOutput(float(`+i+`)); 1811 return; 1812 } 1813 1814 vec2 sourceFracIndexCR = vec2(in_x,in_y); 1815 if(`+h+` == 1) { 1816 // Compute the four integer indices. 1817 ivec2 sourceFloorCR = ivec2(sourceFracIndexCR); 1818 ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR)); 1819 1820 float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d); 1821 float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d); 1822 float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d); 1823 float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d); 1824 1825 vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR); 1826 1827 float top = topLeft + (topRight - topLeft) * fracCR.x; 1828 float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x; 1829 float newValue = top + (bottom - top) * fracCR.y; 1830 setOutput(newValue); 1831 } else { 1832 // Compute the coordinators of nearest neighbor point. 1833 ivec2 sourceNearestCR = ivec2(floor( 1834 sourceFracIndexCR + vec2(0.5,0.5))); 1835 float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d); 1836 setOutput(newValue); 1837 } 1838 } 1839 `},Ine=function(n,e,t){this.variableNames=["x"],this.outputShape=n;var r=n.length,i=n[n.length-1],a=t?"<":">";this.userCode=` 1840 int getIndex(int i) { 1841 `+(t?"return "+i+" -i - 1;":"return i;")+` 1842 } 1843 1844 void main() { 1845 `+Hn(r)+` coords = getOutputCoords(); 1846 int end = `+C4(r,"coords")+`; 1847 float val = 0.0; 1848 for (int i = `+i+` - 1; i >= 0; i -= 1) { 1849 int idx = getIndex(i); 1850 if (idx `+a+` end) { 1851 continue; 1852 } 1853 if (idx == end && `+e+`) { 1854 continue; 1855 } 1856 `+C4(r,"coords")+` = idx; 1857 val += getX(`+function(s,o){if(s===1)return""+o;if(s===2)return o+".x, "+o+".y";if(s===3)return o+".x, "+o+".y, "+o+".z";if(s===4)return o+".x, "+o+".y, "+o+".z, "+o+".w";throw Error("Cumulative sum for rank "+s+" is not yet supported")}(r,"coords")+`); 1858 } 1859 setOutput(val); 1860 } 1861 `};function C4(n,e){if(n===1)return""+e;if(n===2)return e+".y";if(n===3)return e+".z";if(n===4)return e+".w";throw Error("Cumulative sum for rank "+n+" is not yet supported")}var One=function(n){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=wg.DENSE;var e=Km(n),t=Wi();this.outputShape=n,this.userCode=` 1862 ivec3 outCoordsFromFlatIndex(int index) { 1863 `+Hd(["r","c","d"],n)+` 1864 return ivec3(r, c, d); 1865 } 1866 1867 void main() { 1868 ivec2 resTexRC = ivec2(resultUV.yx * 1869 vec2(`+e[0]+", "+e[1]+`)); 1870 int index = 4 * (resTexRC.x * `+e[1]+` + resTexRC.y); 1871 1872 vec4 result = vec4(0.); 1873 1874 for (int i=0; i<4; i++) { 1875 int flatIndex = index + i; 1876 ivec3 rc = outCoordsFromFlatIndex(flatIndex); 1877 result[i] = getA(rc.x, rc.y, rc.z); 1878 } 1879 1880 `+t.output+` = result; 1881 } 1882 `},Mne=function(n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=wg.DENSE;var e=Km(n),t=Wi();this.outputShape=n,this.userCode=` 1883 ivec3 outCoordsFromFlatIndex(int index) { 1884 `+Hd(["r","c","d"],n)+` 1885 return ivec3(r, c, d); 1886 } 1887 1888 void main() {
1889 ivec2 resTexRC = ivec2(resultUV.yx * 1890 vec2(`+e[0]+", "+e[1]+`)); 1891 int index = 4 * (resTexRC.x * `+e[1]+` + resTexRC.y); 1892 1893 vec4 result = vec4(0.); 1894 1895 for (int i=0; i<4; i++) { 1896 int flatIndex = index + i; 1897 ivec3 rc = outCoordsFromFlatIndex(flatIndex); 1898 result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z)); 1899 } 1900 1901 `+t.output+` = result; 1902 } 1903 `},Dne=function(){function n(e,t,r){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=r,this.userCode=` 1904 void main() { 1905 ivec4 coords = getOutputCoords(); 1906 int b = coords[0]; 1907 int h = `+this.getHeightCoordString()+`; 1908 int w = `+this.getWidthCoordString()+`; 1909 int d = `+this.getDepthCoordString()+`; 1910 1911 int in_h = h / `+t+`; 1912 int offset_h = imod(h, `+t+`); 1913 int in_w = w / `+t+`; 1914 int offset_w = imod(w, `+t+`); 1915 int offset_d = (offset_h * `+t+` + offset_w) * 1916 `+this.getOutputDepthSize()+`; 1917 int in_d = d + offset_d; 1918 1919 float result = `+this.getInputSamplingString()+`; 1920 setOutput(result); 1921 } 1922 `}return n.prototype.getHeightCoordString=function(){return this.dataFormat==="NHWC"?"coords[1]":"coords[2]"},n.prototype.getWidthCoordString=function(){return this.dataFormat==="NHWC"?"coords[2]":"coords[3]"},n.prototype.getDepthCoordString=function(){return this.dataFormat==="NHWC"?"coords[3]":"coords[1]"},n.prototype.getOutputDepthSize=function(){return this.dataFormat==="NHWC"?this.outputShape[3]:this.outputShape[1]},n.prototype.getInputSamplingString=function(){return this.dataFormat==="NHWC"?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"},n}(),Nne=function(n){this.variableNames=["X"],this.outputShape=[n,n],this.userCode=` 1923 void main() { 1924 ivec2 coords = getOutputCoords(); 1925 float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0; 1926 setOutput(val); 1927 } 1928 `},Lne=function(n){this.variableNames=["A"],this.outTexUsage=vs.DOWNLOAD;var e=Wi();this.outputShape=n,this.userCode=` 1929 `+rN+` 1930 1931 void main() { 1932 float x = getAAtOutCoords(); 1933 `+e.output+` = encode_float(x); 1934 } 1935 `},Fne=function(n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=vs.DOWNLOAD;var e=Wi();this.outputShape=n,this.userCode=` 1936 `+rN+` 1937 1938 void main() { 1939 ivec3 coords = getOutputCoords(); 1940 float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z)); 1941 `+e.output+` = encode_float(x); 1942 } 1943 `},$ne=function(n,e,t){t===void 0&&(t=!1),this.variableNames=["A"];var r=Wi(),i=e[0],a=e[1];this.outputShape=n;var s="result";t&&(s="floor(result * 255. + 0.5)"),this.userCode=` 1944 `+_S(n)+` 1945 1946 void main() { 1947 ivec3 coords = getOutputCoords(); 1948 1949 int flatIndex = getFlatIndex(coords); 1950 int offset = imod(flatIndex, 4); 1951 1952 flatIndex = idiv(flatIndex, 4, 1.); 1953 1954 int r = flatIndex / `+a+`; 1955 int c = imod(flatIndex, `+a+`); 1956 vec2 uv = (vec2(c, r) + halfCR) / vec2(`+a+".0, "+i+`.0); 1957 vec4 values = `+r.texture2D+`(A, uv); 1958 1959 float result; 1960 1961 if(offset == 0) { 1962 result = values[0]; 1963 } else if(offset == 1) { 1964 result = values[1]; 1965 } else if(offset == 2) { 1966 result = values[2]; 1967 } else { 1968 result = values[3]; 1969 } 1970 1971 `+r.output+" = vec4("+s+`, 0., 0., 0.); 1972 } 1973 `},Bne=function(n,e,t){t===void 0&&(t=!1),this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;var r=Wi(),i=e[0],a=e[1];this.outputShape=n;var s="",o="result";t&&(o="floor(result * 255. + 0.5)");for(var c=0;c<=1;c++)for(var u=0;u<=1;u++){var l=2*c+u;s+=` 1974 localCoords = coords; 1975 if(localCoords[2] + `+u+" < "+n[2]+`) { 1976 localCoords[2] += `+u+`; 1977 if(localCoords[1] + `+c+" < "+n[1]+`) { 1978 localCoords[1] += `+c+`; 1979 1980 flatIndex = getFlatIndex(localCoords); 1981 offset = imod(flatIndex, 4); 1982 1983 flatIndex = idiv(flatIndex, 4, 1.); 1984 1985 r = flatIndex / `+a+`; 1986 c = imod(flatIndex, `+a+`); 1987 uv = (vec2(c, r) + halfCR) / vec2(`+a+".0, "+i+`.0); 1988 values = `+r.texture2D+`(A, uv); 1989 1990 if(offset == 0) { 1991 result[`+l+`] = values[0]; 1992 } else if(offset == 1) { 1993 result[`+l+`] = values[1]; 1994 } else if(offset == 2) { 1995 result[`+l+`] = values[2]; 1996 } else { 1997 result[`+l+`] = values[3]; 1998 } 1999 } 2000 } 2001 `}this.userCode=` 2002 `+_S(n)+` 2003 2004 void main() { 2005 ivec3 coords = getOutputCoords(); 2006 2007 vec4 result = vec4(0.); 2008 int flatIndex, r, c, offset; 2009 ivec3 localCoords; 2010 vec2 uv; 2011 vec4 values; 2012 2013 `+s+` 2014 2015 `+r.output+" = "+o+`; 2016 } 2017 `},Une="return real * expR - imag * expI;",jne="return real * expI + imag * expR;",k4=function(n,e,t){this.variableNames=["real","imag"];var r=e[1];this.outputShape=e;var i=t?"2.0 * "+Math.PI:"-2.0 * "+Math.PI,a=t?r+".0":"1.0";this.userCode=` 2018 const float exponentMultiplier = `+i+`; 2019 2020 float unaryOpComplex(float real, float expR, float imag, float expI) { 2021 `+n+` 2022 } 2023 2024 float mulMatDFT(int batch, int index) { 2025 float indexRatio = float(index) / float(`+r+`); 2026 float exponentMultiplierTimesIndexRatio = 2027 exponentMultiplier * indexRatio; 2028 2029 float result = 0.0; 2030 2031 for (int i = 0; i < `+r+`; i++) { 2032 // x = (-2|2 * PI / N) * index * i; 2033 float x = exponentMultiplierTimesIndexRatio * float(i); 2034 float expR = cos(x); 2035 float expI = sin(x); 2036 float real = getReal(batch, i); 2037 float imag = getImag(batch, i); 2038 2039 result += 2040 unaryOpComplex(real, expR, imag, expI) / `+a+`; 2041 } 2042 2043 return result; 2044 } 2045 2046 void main() { 2047 ivec2 coords = getOutputCoords(); 2048 setOutput(mulMatDFT(coords[0], coords[1])); 2049 } 2050 `},qne=function(){function n(e,t){this.outputShape=[],this.variableNames=["x"],this.outputShape=e,this.userCode=` 2051 uniform float value; 2052 void main() {
2053 // Input can be obtained from uniform value. 2054 setOutput(value); 2055 } 2056 `}return n.prototype.getCustomSetupFunc=function(e){var t=this;return function(r,i){t.valueLoc==null&&(t.valueLoc=r.getUniformLocationNoThrow(i,"value")),r.gl.uniform1f(t.valueLoc,e)}},n}(),zne=function(n,e,t){this.variableNames=["A","indices"];var r=n.slice();r[t]=e,this.outputShape=r,this.rank=r.length;var i=Hn(this.rank),a=function(s,o){var c=s.length;if(c>4)throw Error("Gather for rank "+c+" is not yet supported");if(c===1)return"int(getIndices(resRC))";for(var u=["resRC.x","resRC.y","resRC.z","resRC.w"],l=[],d=0;d<s.length;d++)d===o?l.push("int(getIndices("+u[d]+"))"):l.push(""+u[d]);return l.join()}(n,t);this.userCode=` 2057 void main() { 2058 `+i+` resRC = getOutputCoords(); 2059 setOutput(getA(`+a+`)); 2060 } 2061 `},Wne=function(n,e,t){this.sliceDim=n,this.strides=e,this.variableNames=["x","indices"],this.outputShape=t;var r=Hn(e.length),i=Hn(t.length),a=this.sliceDim>1?"strides[j]":"strides";this.userCode=` 2062 `+r+" strides = "+r+"("+this.strides+`); 2063 void main() { 2064 `+i+` coords = getOutputCoords(); 2065 int flattenIndex = 0; 2066 for (int j = 0; j < `+this.sliceDim+`; j++) { 2067 int index = round(getIndices(coords[0], j)); 2068 flattenIndex += index * `+a+`; 2069 } 2070 setOutput(getX(flattenIndex, coords[1])); 2071 } 2072 `};function Hne(n,e){var t=Wi();return Uee(n,e,t.version+` 2073 precision highp float; 2074 `+t.attribute+` vec3 clipSpacePos; 2075 `+t.attribute+` vec2 uv; 2076 `+t.varyingVs+` vec2 resultUV; 2077 2078 void main() { 2079 gl_Position = vec4(clipSpacePos, 1); 2080 resultUV = uv; 2081 }`)}function Vne(n,e){return Hee(n,e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function Gne(n,e){return Vee(n,e,new Uint16Array([0,1,2,2,1,3]))}function sv(n,e,t,r,i,a,s){Kee(t,r);var o=Gee(n,e),c=n.TEXTURE_2D;return lt(n,e,function(){return n.bindTexture(c,o)}),lt(n,e,function(){return n.texParameteri(c,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE)}),lt(n,e,function(){return n.texParameteri(c,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE)}),lt(n,e,function(){return n.texParameteri(c,n.TEXTURE_MIN_FILTER,n.NEAREST)}),lt(n,e,function(){return n.texParameteri(c,n.TEXTURE_MAG_FILTER,n.NEAREST)}),lt(n,e,function(){return n.texImage2D(c,0,i,t,r,0,a,s,null)}),lt(n,e,function(){return n.bindTexture(n.TEXTURE_2D,null)}),o}function Kne(n,e,t,r,i){var a=ab(t,r);return sv(n,e,a[0],a[1],i.internalFormatFloat,i.textureFormatFloat,n.FLOAT)}function Yne(n,e,t,r,i){var a=ab(t,r);return sv(n,e,a[0],a[1],i.internalFormatHalfFloat,i.textureFormatFloat,i.textureTypeHalfFloat)}function Xne(n,e,t,r,i){var a=ab(t,r);return sv(n,e,a[0],a[1],n.RGBA,n.RGBA,n.UNSIGNED_BYTE)}function Jne(n,e,t,r,i){var a=av(t,r);return sv(n,e,a[0],a[1],i.internalFormatPackedFloat,n.RGBA,n.FLOAT)}function Qne(n,e,t,r,i){var a=av(t,r);return sv(n,e,a[0],a[1],i.internalFormatPackedHalfFloat,n.RGBA,i.textureTypeHalfFloat)}function Zne(n,e,t,r){return lt(n,e,function(){return n.bindBuffer(n.ARRAY_BUFFER,r)}),d4(n,e,t,"clipSpacePos",r,3,20,0)&&d4(n,e,t,"uv",r,2,20,12)}function ere(n,e,t,r,i,a,s){var o,c,u;lt(n,e,function(){return n.bindTexture(n.TEXTURE_2D,t)}),a instanceof Uint8Array?(o=new Uint8Array(r*i*4),c=n.UNSIGNED_BYTE,u=n.RGBA):(o=new Float32Array(r*i*4),c=n.FLOAT,u=s.internalFormatPackedFloat),o.set(a),lt(n,e,function(){return n.texImage2D(n.TEXTURE_2D,0,u,r,i,0,n.RGBA,c,o)}),lt(n,e,function(){return n.bindTexture(n.TEXTURE_2D,null)})}function tre(n,e,t,r){lt(n,e,function(){return n.bindTexture(n.TEXTURE_2D,t)}),r.data instanceof Uint8Array?lt(n,e,function(){return n.texImage2D(n.TEXTURE_2D,0,n.RGBA,r.width,r.height,0,n.RGBA,n.UNSIGNED_BYTE,r.data)}):lt(n,e,function(){return n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r)}),lt(n,e,function(){return n.bindTexture(n.TEXTURE_2D,null)})}function nre(n,e,t,r,i){var a=n.createBuffer();lt(n,e,function(){return n.bindBuffer(n.PIXEL_PACK_BUFFER,a)});var s=16*t*r;return lt(n,e,function(){return n.bufferData(n.PIXEL_PACK_BUFFER,s,n.STREAM_READ)}),lt(n,e,function(){return n.readPixels(0,0,r,t,n.RGBA,n.FLOAT,0)}),lt(n,e,function(){return n.bindBuffer(n.PIXEL_PACK_BUFFER,null)}),a}function rre(n,e,t){var r=n,i=new Float32Array(t);return r.bindBuffer(r.PIXEL_PACK_BUFFER,e),r.getBufferSubData(r.PIXEL_PACK_BUFFER,0,i),r.bindBuffer(r.PIXEL_PACK_BUFFER,null),i}function ire(n,e,t,r,i){var a=ab(t,r),s=a[0],o=a[1],c=new Uint8Array(t*r*4);return lt(n,e,function(){return n.readPixels(0,0,s,o,i.downloadTextureFormat,n.UNSIGNED_BYTE,c
vendor: 4,773 bytes, line 2081
2081)}),new Float32Array(c.buffer)}function are(n,e,t,r,i,a,s,o){var c=n,u=new Float32Array(function(l,d){var h=av(l,d);return h[0]*h[1]*4}(a,s));return c.bindBuffer(c.PIXEL_PACK_BUFFER,e),c.getBufferSubData(c.PIXEL_PACK_BUFFER,0,u),c.bindBuffer(c.PIXEL_PACK_BUFFER,null),u}function sre(n,e,t,r){var i=new Float32Array(t*r*4);return lt(n,e,function(){return n.readPixels(0,0,r,t,n.RGBA,n.FLOAT,i)}),i}var ore=function(){function n(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];var t=ke().getNumber("WEBGL_VERSION");e!=null?(this.gl=e,Nee(t,e)):this.gl=nu(t);var r="WEBGL_color_buffer_float";if(ke().getNumber("WEBGL_VERSION")===1){if(this.textureFloatExtension=k0(this.gl,this.debug,"OES_texture_float"),lo(this.gl,"OES_texture_half_float"))this.textureHalfFloatExtension=k0(this.gl,this.debug,"OES_texture_half_float");else if(ke().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(r),lo(this.gl,"EXT_color_buffer_half_float"))this.colorBufferHalfFloatExtension=k0(this.gl,this.debug,"EXT_color_buffer_half_float");else if(ke().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(r="EXT_color_buffer_float",lo(this.gl,r))this.colorBufferFloatExtension=this.gl.getExtension(r);else{if(!lo(this.gl,"EXT_color_buffer_half_float"))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension("EXT_color_buffer_half_float")}this.vertexBuffer=Vne(this.gl,this.debug),this.indexBuffer=Gne(this.gl,this.debug),this.framebuffer=Yee(this.gl,this.debug),this.textureConfig=uS(this.gl,this.textureHalfFloatExtension)}return Object.defineProperty(n.prototype,"debug",{get:function(){return ke().getBool("DEBUG")},enumerable:!0,configurable:!0}),n.prototype.dispose=function(){var e=this;if(!this.disposed){this.program!=null&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),this.outputTexture!=null&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");var t=this.gl;lt(t,this.debug,function(){return t.finish()}),lt(t,this.debug,function(){return t.bindFramebuffer(t.FRAMEBUFFER,null)}),lt(t,this.debug,function(){return t.deleteFramebuffer(e.framebuffer)}),lt(t,this.debug,function(){return t.bindBuffer(t.ARRAY_BUFFER,null)}),lt(t,this.debug,function(){return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}),lt(t,this.debug,function(){return t.deleteBuffer(e.indexBuffer)}),this.disposed=!0}},n.prototype.createFloat32MatrixTexture=function(e,t){return this.throwIfDisposed(),Kne(this.gl,this.debug,e,t,this.textureConfig)},n.prototype.createFloat16MatrixTexture=function(e,t){return this.throwIfDisposed(),Yne(this.gl,this.debug,e,t,this.textureConfig)},n.prototype.createUnsignedBytesMatrixTexture=function(e,t){return this.throwIfDisposed(),Xne(this.gl,this.debug,e,t,this.textureConfig)},n.prototype.uploadPixelDataToTexture=function(e,t){this.throwIfDisposed(),tre(this.gl,this.debug,e,t)},n.prototype.uploadDenseMatrixToTexture=function(e,t,r,i){this.throwIfDisposed(),ere(this.gl,this.debug,e,t,r,i,this.textureConfig)},n.prototype.createFloat16PackedMatrixTexture=function(e,t){return this.throwIfDisposed(),Qne(this.gl,this.debug,e,t,this.textureConfig)},n.prototype.createPackedMatrixTexture=function(e,t){return this.throwIfDisposed(),Jne(this.gl,this.debug,e,t,this.textureConfig)},n.prototype.deleteMatrixTexture=function(e){var t=this;this.throwIfDisposed(),this.outputTexture===e&&(f4(this.gl,this.debug,this.framebuffer),this.outputTexture=null),lt(this.gl,this.debug,function(){return t.gl.deleteTexture(e)})},n.prototype.downloadByteEncodedFloatMatrixFromOutputTexture=function(e,t,r){var i=this;return this.downloadMatrixDriver(e,function(){return ire(i.gl,i.debug,t,r,i.textureConfig)})},n.prototype.downloadPackedMatrixFromBuffer=function(e,t,r,i,a,s){return are(this.gl,e,0,0,0,a,s,this.textureConfig)},n.prototype.downloadFloat32MatrixFromBuffer=function(e,t){return rre(this.gl,e,t)},n.prototype.createBufferFromTexture=function(e,t,r){this.bindTextureToFrameBuffer(e);var i=nre(this.gl,this.debug,t,r,this.textureConfig);return this.unbindTextureToFrameBuffer(),i},n.prototype.createAndWaitForFence=function(){var e=this.createFence(this.gl);
2081return this.pollFence(e)},n.prototype.createFence=function(e){var t,r,i=this;if(ke().getBool("WEBGL_FENCE_API_ENABLED")){var a=e,s=a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),r=function(){var o=a.clientWaitSync(s,0,0);return o===a.ALREADY_SIGNALED||o===a.CONDITION_SATISFIED},t=s}else ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),r=function(){return i.isQueryAvailable(t,ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}):r=function(){return!0};return{query:t,isFencePassed:r}},n.prototype.downloadMatrixFromPackedTexture=function(e,t,r){var i=this;return this.downloadMatrixDriver(e,function(){return sre(i.gl,i.debug,t,r)})},n.prototype.createProgram=function(e){this.throwIfDisposed();var t=this.gl,r=jee(t,this.debug,e),i=Hne(t,this.debug),a=zee(t,this.debug);return lt(t,this.debug,function(){return t.attachShader(a,i)}),lt(t,this.debug,function(){return t.attachShader(a,r)}),Wee(t,this.debug,a),this.debug&&mw(t,this.debug,a),this.vertexAttrsAreBound||(this.setProgram(a),this.vertexAttrsAreBound=Zne(t,this.debug,this.program,this.vertexBuffer)),a},n.prototype.deleteProgram=function(e){var t=this;this.throwIfDisposed(),e===this.program&&(this.program=null),e!=null&<(this.gl,this.debug,function(){return t.gl.deleteProgram(e)})},n.prototype.setProgram=function(e){var t=this;this.throwIfDisposed(),this.program=e,this.program!=null&&this.debug&&mw(this.gl,this.debug,this.program),lt(this.gl,this.debug,function(){return t.gl.useProgram(e)})},n.prototype.getUniformLocation=function(e,t,r){return r===void 0&&(r=!0),this.throwIfDisposed(),r?Jee(this.gl,this.debug,e,t):Qee(this.gl,e,t)},n.prototype.getAttributeLocation=function(e,t){var r=this;return this.throwIfDisposed(),lt(this.gl,this.debug,function(){return r.gl.getAttribLocation(e,t)})},n.prototype.getUniformLocationNoThrow=function(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)},n.prototype.setInputMatrixTexture=function(e,t,r){this.throwIfDisposed(),this.throwIfNoProgram(),Zee(this.gl,this.debug,this.program,e,t,r)},n.prototype.setOutputMatrixTexture=function(e,t,r){this.setOutputMatrixTextureDriver(e,r,t)},n.prototype.setOutputPackedMatrixTexture=function(e,t,r){this.throwIfDisposed();var i=av(t,r),a=i[0],s=i[1];this.setOutputMatrixTextureDriver(e,a,s)},n.prototype.setOutputMatrixWriteRegion=function(e,t,r,i){this.setOutputMatrixWriteRegionDriver(r,e,i,t)},n.prototype.setOutputPackedMatrixWriteRegion=function(e,t,r,i){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")},n.prototype.debugValidate=function(){this.program!=null&&mw(this.gl,this.debug,this.program),S0(this.gl)},n.prototype.executeProgram=function(){this.throwIfDisposed(),this.throwIfNoProgram();var e=this.gl;this.debug&&this.debugValidate(),lt(e,this.debug,function(){return e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)})},n.prototype.blockUntilAllProgramsCompleted=function(){var e=this;this.throwIfDisposed(),lt(this.gl,this.debug,function(){return e.gl.finish()})},n.prototype.getQueryTimerExtension=function(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=k0(this.gl,this.debug,ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension},n.prototype.getQueryTimerExtensionWebGL2=function(){return this.getQueryTimerExtension()},n.prototype.getQueryTimerExtensionWebGL1=function(){return this.getQueryTimerExtension()},n.prototype.beginQuery=function(){if(ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){var e=this.gl,t=this.getQueryTimerExtensionWebGL2(),r=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,r),r}var i=this.getQueryTimerExtensionWebGL1(),a=i.createQueryEXT();return i.beginQueryEXT(i.TIME_ELAPSED_EXT,a),a},n.prototype.endQuery=function(){if(ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")!==2){var e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}else{var t=this.gl,r=this.getQueryTimerExtensionWebGL2();t.endQuery(r.TIME_ELAPSED_EXT)}},n.prototype.waitForQueryAndGetTime=function(e){return at(this,void 0,void 0,function(){var t=this;return st(this,function(r){switch(r.label){case 0:return[4,a4(function(){return t.disposed||t.isQueryAvailable(e,ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))})];case 1:return r.sent(),[2,this.getQueryTime(e,ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))]}})})},n.prototype.getQueryTime=function(e,t){if(t===0)return null;if(t===2){var r=this.gl;return r.getQueryParameter(e,r.QUERY_RESULT)/1e6}var i=this.getQueryTimerExtensionWebGL1();return i.getQueryObjectEXT(e,i.QUERY_RESULT_EXT)/1e6},n.prototype.isQueryAvailable=function(e,t){if(t===0)return!0;
2081if(t===2){var r=this.gl,i=this.getQueryTimerExtensionWebGL2(),a=r.getQueryParameter(e,r.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(i.GPU_DISJOINT_EXT)),a&&!this.disjoint}return a=(i=this.getQueryTimerExtensionWebGL1()).getQueryObjectEXT(e,i.QUERY_RESULT_AVAILABLE_EXT),this.disjoint==null&&(this.disjoint=this.gl.getParameter(i.GPU_DISJOINT_EXT)),a&&!this.disjoint},n.prototype.pollFence=function(e){var t=this;return new Promise(function(r){t.addItemToPoll(function(){return e.isFencePassed()},function(){return r()})})},n.prototype.pollItems=function(){for(var e=function(r){for(var i=0;i<r.length&&r[i]();++i);return i-1}(this.itemsToPoll.map(function(r){return r.isDoneFn})),t=0;t<=e;++t)(0,this.itemsToPoll[t].resolveFn)();this.itemsToPoll=this.itemsToPoll.slice(e+1)},n.prototype.addItemToPoll=function(e,t){var r=this;this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||a4(function(){return r.pollItems(),r.itemsToPoll.length===0})},n.prototype.bindTextureToFrameBuffer=function(e){this.throwIfDisposed(),gw(this.gl,this.debug,e,this.framebuffer),this.debug&&S0(this.gl)},n.prototype.unbindTextureToFrameBuffer=function(){this.outputTexture!=null?(gw(this.gl,this.debug,this.outputTexture,this.framebuffer),this.debug&&S0(this.gl)):f4(this.gl,this.debug,this.framebuffer)},n.prototype.downloadMatrixDriver=function(e,t){this.bindTextureToFrameBuffer(e);var r=t();return this.unbindTextureToFrameBuffer(),r},n.prototype.setOutputMatrixTextureDriver=function(e,t,r){this.throwIfDisposed();var i=this.gl;gw(i,this.debug,e,this.framebuffer),this.debug&&S0(i),this.outputTexture=e,lt(i,this.debug,function(){return i.viewport(0,0,t,r)}),lt(i,this.debug,function(){return i.scissor(0,0,t,r)})},n.prototype.setOutputMatrixWriteRegionDriver=function(e,t,r,i){var a=this;this.throwIfDisposed(),lt(this.gl,this.debug,function(){return a.gl.scissor(e,t,r,i)})},n.prototype.throwIfDisposed=function(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")},n.prototype.throwIfNoProgram=function(){if(this.program==null)throw new Error("No GPU program is currently set.")},n}();function S4(n,e){if(n.length!==e.length)throw Error("Binary was compiled with "+n.length+" inputs, but was executed with "+e.length+" inputs");n.forEach(function(t,r){var i=t.logicalShape,a=e[r],s=a.shape;if(!gi(i,s))throw Error("Binary was compiled with different shapes than the current args. Shapes "+i+" and "+s+" must match");if(!t.isUniform||!a.isUniform){var o=t.texShape,c=a.isUniform?null:a.texData.texShape;if(!gi(o,c))throw Error("Binary was compiled with different texture shapes than the current args. Shape "+o+" and "+c+" must match")}})}var cre=function(n,e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n;for(var r=t.filterWidth,i=t.inChannels,a=t.strideWidth,s=t.strideHeight,o=t.padInfo,c=t.outWidth,u=t.dilationWidth,l=t.dilationHeight,d=t.dataFormat,h=o.left,p=o.top,g=i*r,v=Wi(),y=d==="channelsLast",b=y?0:1,x=y?1:2,S="",w=0;w<=1;w++)for(var k=0;k<=1;k++)S+=` 2082 blockIndex = rc.y + `+k+`; 2083 pos = rc.x + `+w+`; 2084 2085 if(blockIndex < `+n[1]+" && pos < "+n[0]+`) { 2086 offsetY = int(blockIndex / (`+c+")) * "+s+" - "+p+`; 2087 d0 = offsetY + `+l+" * (pos / "+g+`); 2088 2089 if(d0 < `+e[b]+` && d0 >= 0) { 2090 2091 offsetX = int(mod(float(blockIndex), `+c+".) * "+a+". - "+h+`.); 2092 d1 = offsetX + `+u+" * (int(mod(float(pos), "+g+".) / "+i+`.)); 2093 2094 if(d1 < `+e[x]+` && d1 >= 0) { 2095 2096 ch = int(mod(float(pos), `+i+`.)); 2097 2098 if (`+y+`) { 2099 innerDims = vec2(d1, ch); 2100 result[`+(2*w+k)+`] = getChannel( 2101 getA(d0, int(innerDims.x), 2102 int(innerDims.y)), innerDims); 2103 } else { 2104 innerDims = vec2(d0, d1); 2105 result[`+(2*w+k)+`] = getChannel( 2106 getA(ch, int(innerDims.x), 2107 int(innerDims.y)), innerDims); 2108 } 2109 } 2110 } 2111 } 2112 `;this.userCode=` 2113 void main() { 2114 ivec2 rc = getOutputCoords(); 2115 2116 vec4 result = vec4(0); 2117 2118 int blockIndex, pos, offsetY, d0, offsetX, d1, ch; 2119 vec2 innerDims; 2120 2121 `+S+` 2122 2123 `+v.output+` = result; 2124 } 2125 `},ure=function(n,e,t,r,i){this.variableNames=["x"],this.outputShape=[];var a,s=e,o=n[3]-1;this.outputShape=n;var c="float("+t+") + float("+r+") * sum";a=i===.5?"inversesqrt("+c+")":i===1?"1.0/("+c+")":"exp(log("+c+") * float(-"+i+"));",this.userCode=` 2126 void main() { 2127 ivec4 coords = getOutputCoords(); 2128 int b = coords[0]; 2129 int r = coords[1]; 2130 int c = coords[2]; 2131 int d = coords[3]; 2132 float x = getX(b, r, c, d); 2133 float sum = 0.0;
2134 for (int j = -`+s+"; j <= "+s+`; j++) { 2135 int idx = d + j; 2136 if (idx >= 0 && idx <= `+o+`) { 2137 float z = getX(b, r, c, idx); 2138 sum += z * z; 2139 } 2140 } 2141 float val = x * `+a+`; 2142 setOutput(val); 2143 } 2144 `},lre=function(n,e,t,r,i){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=n,this.depth=n[3],this.depthRadius=e,this.bias=t,this.alpha=r,this.beta=i,this.userCode=` 2145 void main() { 2146 ivec4 coords = getOutputCoords(); 2147 int b = coords[0]; 2148 int r = coords[1]; 2149 int c = coords[2]; 2150 2151 float result = 0.0; 2152 for (int d = 0; d < `+this.depth+`; ++d) { 2153 int depthBegin = int(max(0.0, float(d - `+e+`))); 2154 int depthEnd = int(min(float(`+this.depth+`), 2155 float(d + `+e+` + 1))); 2156 2157 const int MIN_DEPTH_BEGIN = 0; 2158 const int MAX_DEPTH_END = `+this.depth+`; 2159 2160 float norm = 0.0; 2161 for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) { 2162 if (k < depthBegin){ 2163 continue; 2164 } 2165 else if (k >= depthBegin && k < depthEnd) { 2166 norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k); 2167 } 2168 else { 2169 break; 2170 } 2171 } 2172 2173 norm = float(`+r+") * norm + float("+t+`); 2174 2175 for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){ 2176 if (k < depthBegin){ 2177 continue; 2178 } 2179 else if (k >= depthBegin && k < depthEnd){ 2180 float dyi = -2.0 * float(`+r+`) 2181 * float(`+i+`) 2182 * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d) 2183 / norm; 2184 if (k == d) { 2185 dyi += pow(norm, -1.0 * `+i+`); 2186 } 2187 if (k == coords[3]) { 2188 dyi *= getDy(b, r, c, d); 2189 result += dyi; 2190 } 2191 } 2192 else { 2193 break; 2194 } 2195 } 2196 } 2197 setOutput(result); 2198 } 2199 `},dre=function(n,e,t,r,i){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;var a,s=e,o=n[3]-1;this.outputShape=n;var c="float("+t+") + float("+r+") * sum";a=i===.5?"inversesqrt("+c+")":i===1?"1.0/("+c+")":"exp(log("+c+") * float(-"+i+"));",this.userCode=` 2200 void main() { 2201 ivec4 coords = getOutputCoords(); 2202 int b = coords.x; 2203 int r = coords.y; 2204 int c = coords.z; 2205 int d = coords.w; 2206 2207 bool hasNextCol = d < `+this.outputShape[3]+`; 2208 bool hasNextRow = c < `+this.outputShape[2]+`; 2209 2210 vec4 sum = vec4(0.); 2211 vec4 xFragAtOutputCoords = getX(b, r, c, d); 2212 2213 vec4 xAtOutputCoords = vec4( 2214 getChannel(xFragAtOutputCoords, vec2(c, d)), 2215 hasNextCol ? 2216 getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0, 2217 hasNextRow ? 2218 getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0, 2219 (hasNextRow && hasNextCol) ? 2220 getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0 2221 ); 2222 2223 int firstChannel = d - `+s+`; 2224 vec2 cache = vec2(0.); 2225 if(firstChannel >= 0){ 2226 vec4 firstChannelFrag = getX(b, r, c, firstChannel); 2227 cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel)); 2228 if(hasNextRow){ 2229 cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel)); 2230 } 2231 } 2232 2233 ivec2 depth = ivec2(d, d + 1); 2234 for (int j = - `+s+"; j <= "+s+`; j++) { 2235 ivec2 idx = depth + j; 2236 bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0)); 2237 bvec2 belowUpperBound = lessThanEqual(idx, ivec2(`+o+`)); 2238 2239 bool depthInRange = aboveLowerBound.x && belowUpperBound.x; 2240 bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y; 2241 2242 if(depthInRange || depthPlusOneInRange){ 2243 vec4 z = vec4(0.); 2244 vec4 xFragAtCurrentDepth; 2245 z.xz = cache.xy; 2246 if(depthPlusOneInRange && hasNextCol){ 2247 xFragAtCurrentDepth = idx.y != d ? 2248 getX(b, r, c, idx.y) : xFragAtOutputCoords; 2249 z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y)); 2250 if(hasNextRow){ 2251 z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y)); 2252 } 2253 } 2254 cache.xy = z.yw; 2255 sum += z * z; 2256 } 2257 } 2258 vec4 result = xAtOutputCoords * `+a+`; 2259 setOutput(result); 2260 } 2261 `},fre=function(n){this.variableNames=["dy","maxPos"],this.outputShape=n.inShape;var e=n.strideHeight,t=n.strideWidth,r=n.dilationHeight,i=n.effectiveFilterHeight,a=n.effectiveFilterWidth,s=i-1-n.padInfo.top,o=a-1-n.padInfo.left,c=i*a-1;this.userCode=` 2262 const ivec2 pads = ivec2(`+s+", "+o+`); 2263 2264 void main() { 2265 ivec4 coords = getOutputCoords(); 2266 int b = coords[0]; 2267 int d = coords[3]; 2268 2269 ivec2 dyRCCorner = coords.yz - pads; 2270 int dyRCorner = dyRCCorner.x; 2271 int dyCCorner = dyRCCorner.y; 2272 2273 // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d). 2274 // ? = to be determined. : = across all values in that axis. 2275 float dotProd = 0.0; 2276 for (int wR = 0; wR < `+i+`; 2277 wR += `+r+`) { 2278 float dyR = float(dyRCorner + wR) / `+e+`.0; 2279 2280 if (dyR < 0.0 || dyR >= `+n.outHeight+`.0 || fract(dyR) > 0.0) { 2281 continue; 2282 } 2283 int idyR = int(dyR); 2284 2285 for (int wC = 0; wC < `+a+`; wC++) { 2286 float dyC = float(dyCCorner + wC) / `+t+`.0; 2287 2288 if (dyC < 0.0 || dyC >= `+n.outWidth+`.0 || 2289 fract(dyC) > 0.0) { 2290 continue; 2291 } 2292 int idyC = int(dyC); 2293 2294 float dyValue = getDy(b, idyR, idyC, d); 2295 int maxPosValue = `+c+` - int(getMaxPos(b, idyR, idyC, d)); 2296 2297 // Get the current value, check it against the value from the 2298 // position matrix. 2299 int curPosValue = wR * `+a+` + wC; 2300 float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); 2301 2302 dotProd += dyValue * mask; 2303 } 2304 } 2305 setOutput(dotProd); 2306 } 2307 `},hre=function(n){this.variableNames=["dy","maxPos"],this.outputShape=n.inShape;var e=n.strideDepth,t=n.strideHeight,r=n.strideWidth,i=n.dilationDepth,a=n.dilationHeight,s=n.dilationWidth,o=n.effectiveFilterDepth,c=n.effectiveFilterHeight,u=n.effectiveFilterWidth,l=o-1-n.padInfo.front,d=c-1-n.padInfo.top,h=u-1-n.padInfo.left,p=o*c*u-1;this.userCode=` 2308 const ivec3 pads = ivec3(`+l+", "+d+", "+h+`); 2309 2310 void main() { 2311 ivec5 coords = getOutputCoords(); 2312 int batch = coords.x; 2313 int ch = coords.u; 2314 2315 ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; 2316 int dyDCorner = dyCorner.x; 2317 int dyRCorner = dyCorner.y; 2318 int dyCCorner = dyCorner.z; 2319 2320 // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get
2321 // dx(xD, xR, xC, ch). 2322 // ? = to be determined. : = across all values in that axis. 2323 float dotProd = 0.0; 2324 2325 for (int wD = 0; wD < `+o+`; 2326 wD += `+i+`) { 2327 float dyD = float(dyDCorner + wD) / `+e+`.0; 2328 2329 if (dyD < 0.0 || dyD >= `+n.outDepth+`.0 || fract(dyD) > 0.0) { 2330 continue; 2331 } 2332 int idyD = int(dyD); 2333 2334 for (int wR = 0; wR < `+c+`; 2335 wR += `+a+`) { 2336 float dyR = float(dyRCorner + wR) / `+t+`.0; 2337 2338 if (dyR < 0.0 || dyR >= `+n.outHeight+`.0 || 2339 fract(dyR) > 0.0) { 2340 continue; 2341 } 2342 int idyR = int(dyR); 2343 2344 for (int wC = 0; wC < `+u+`; 2345 wC += `+s+`) { 2346 float dyC = float(dyCCorner + wC) / `+r+`.0; 2347 2348 if (dyC < 0.0 || dyC >= `+n.outWidth+`.0 || 2349 fract(dyC) > 0.0) { 2350 continue; 2351 } 2352 int idyC = int(dyC); 2353 2354 float dyValue = getDy(batch, idyD, idyR, idyC, ch); 2355 int maxPosValue = `+p+` - 2356 int(getMaxPos(batch, idyD, idyR, idyC, ch)); 2357 2358 // Get the current value, check it against the value from the 2359 // position matrix. 2360 int curPosValue = 2361 wD * `+c+" * "+u+` + 2362 wR * `+u+` + wC; 2363 float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); 2364 2365 dotProd += dyValue * mask; 2366 } 2367 } 2368 } 2369 setOutput(dotProd); 2370 } 2371 `},xw=function(n,e,t,r,i,a,s){t===void 0&&(t=!1),r===void 0&&(r=!1),i===void 0&&(i=!1),a===void 0&&(a=null),s===void 0&&(s=!1),this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;var o=t?n[1]:n[2],c=Math.ceil(o/2),u=t?"i * 2, rc.y":"rc.y, i * 2",l=r?"rc.z, i * 2":"i * 2, rc.z",d=t?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],h=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],p="",g="";a&&(p=s?`vec4 activation(vec4 a) { 2372 vec4 b = getPreluActivationWeightsAtOutCoords(); 2373 `+a+` 2374 }`:`vec4 activation(vec4 x) { 2375 `+a+` 2376 }`,g="result = activation(result);");var v=i?"result += getBiasAtOutCoords();":"";i&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),this.userCode=` 2377 `+p+` 2378 2379 const float sharedDimension = `+c+`.0; 2380 2381 vec4 dot2x2ARowBCol(ivec3 rc) { 2382 vec4 result = vec4(0); 2383 for (int i = 0; i < `+c+`; i++) { 2384 vec4 a = getMatrixA(rc.x, `+u+`); 2385 vec4 b = getMatrixB(rc.x, `+l+`); 2386 2387 // These swizzled products need to be separately added.
2388 // See: https://github.com/tensorflow/tfjs/issues/1735 2389 result += (`+d[0]+" * "+h[0]+`); 2390 result += (`+d[1]+" * "+h[1]+`); 2391 } 2392 return result; 2393 } 2394 2395 void main() { 2396 ivec3 rc = getOutputCoords(); 2397 vec4 result = dot2x2ARowBCol(rc); 2398 2399 `+v+` 2400 2401 `+g+` 2402 2403 setOutput(result); 2404 } 2405 `},pre=function(){function n(e,t,r){this.variableNames=["probs"],this.outputShape=[e,r],this.userCode=` 2406 uniform float seed; 2407 2408 void main() { 2409 ivec2 coords = getOutputCoords(); 2410 int batch = coords[0]; 2411 2412 float r = random(seed); 2413 float cdf = 0.0; 2414 2415 for (int i = 0; i < `+(t-1)+`; i++) { 2416 cdf += getProbs(batch, i); 2417 2418 if (r < cdf) { 2419 setOutput(float(i)); 2420 return; 2421 } 2422 } 2423 2424 // If no other event happened, last event happened. 2425 setOutput(float(`+(t-1)+`)); 2426 } 2427 `}return n.prototype.getCustomSetupFunc=function(e){var t=this;return function(r,i){t.seedLoc==null&&(t.seedLoc=r.getUniformLocation(i,"seed")),r.gl.uniform1f(t.seedLoc,e)}},n}(),mre=function(n,e,t,r){this.variableNames=["indices"],this.outputShape=[n,e],this.userCode=` 2428 void main() { 2429 ivec2 coords = getOutputCoords(); 2430 int index = round(getIndices(coords.x)); 2431 setOutput(mix(float(`+r+"), float("+t+`), 2432 float(index == coords.y))); 2433 } 2434 `},gre=function(n){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=n;var e=n.length;if(e===0)this.userCode=` 2435 void main() { 2436 setOutput(vec4(getA(), 0., 0., 0.)); 2437 } 2438 `;else{var t=La("rc",e),r=Hn(e),i=function(o,c,u){if(o===1)return"rc > "+c[0];for(var l="",d=o-2;d<o;d++)l+=u[d]+" >= "+c[d],d<o-1&&(l+="||");return l}(e,n,t),a=function(o,c,u,l){if(o===1)return"";var d=l.slice(-2);return` 2439 int r = `+d[0]+`; 2440 int c = `+d[1]+`; 2441 int rp1 = r + 1; 2442 int cp1 = c + 1; 2443 2444 bool cEdge = cp1 >= `+c+`; 2445 bool rEdge = rp1 >= `+u+`; 2446 `}(e,n[n.length-1],n[n.length-2],t),s=function(o,c){var u=o.length,l=function(d,h){for(var p=[],g=0;g<=1;g++)for(var v=0;v<=1;v++){for(var y=(g===0?"r":"rp1")+", "+(v===0?"c":"cp1"),b=2;b<d;b++)y=h[h.length-1-b]+","+y;p.push(y)}return p}(u,c);return u===1?`getA(rc), 2447 rc + 1 >= `+o[0]+` ? 0. : getA(rc + 1), 2448 0, 0`:"getA("+l[0]+`), 2449 cEdge ? 0. : getA(`+l[1]+`), 2450 rEdge ? 0. : getA(`+l[2]+`), 2451 rEdge || cEdge ? 0. : getA(`+l[3]+")"}(n,t);this.userCode=` 2452 void main() { 2453 `+r+` rc = getOutputCoords(); 2454 2455 if(`+i+`) { 2456 setOutput(vec4(0)); 2457 } else { 2458 `+a+` 2459 2460 setOutput(vec4(`+s+`)); 2461 } 2462 } 2463 `}},vre=function(n,e,t){this.variableNames=["x"],this.outputShape=e.map(function(c,u){return c[0]+n[u]+c[1]});var r=n.length,i=Hn(r),a=e.map(function(c){return c[0]}).join(","),s=e.map(function(c,u){return c[0]+n[u]}).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r);this.userCode=r!==1?` 2464 `+i+" start = "+i+"("+a+`); 2465 `+i+" end = "+i+"("+s+`); 2466 2467 void main() { 2468 `+i+` outC = getOutputCoords(); 2469 if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) { 2470 setOutput(float(`+t+`)); 2471 } else { 2472 `+i+` coords = outC - start; 2473 setOutput(getX(`+o+`)); 2474 } 2475 } 2476 `:` 2477 int start = `+a+`; 2478 int end = `+s+`; 2479 2480 void main() { 2481 int outC = getOutputCoords(); 2482 if (outC < start || outC >= end) { 2483 setOutput(float(`+t+`)); 2484 } else { 2485 setOutput(getX(outC - start)); 2486 } 2487 } 2488 `},yre=function(n,e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e.map(function(y,b){return y[0]+n[b]+y[1]});for(var r=n.length,i=Hn(r),a=e.map(function(y){return y[0]}).join(","),s=e.map(function(y,b){return y[0]+n[b]}).join(","),o=La("rc",r),c=La("source",r),u=o[r-1]+" < "+this.outputShape[r-1],l=r===1?"source":"vec2("+c.slice(-2).join()+")",d=[i+" rc = outputLoc;",o[r-1]+` += 1; 2489 if(`+u+`) { 2490 `,r===1?"":`} 2491 rc = outputLoc; 2492 `+o[r-2]+` += 1; 2493 if(`+o[r-2]+" < "+this.outputShape[r-2]+") {",r===1?"":" "+o[r-1]+` += 1; 2494 if(`+u+") {"],h=r===1?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",p="",g=0,v=r===1?2:4;g<v;g++)p+=` 2495 `+d[g]+` 2496 if (`+h+`) { 2497 result[`+g+"] = float("+t+`); 2498 } else { 2499 `+i+` source = rc - start; 2500 result[`+g+"] = getChannel(getX("+c.join()+"), "+l+`); 2501 } 2502 `;p+=r===1?"} ":"}}",this.userCode=` 2503 const `+i+" start = "+i+"("+a+`); 2504 const `+i+" end = "+i+"("+s+`); 2505 2506 void main() { 2507 `+i+` outputLoc = getOutputCoords(); 2508 vec4 result = vec4(0.); 2509 `+p+` 2510 setOutput(result); 2511 } 2512 `},ww=function(n,e,t){if(this.variableNames=["x"],e==="avg"&&t)throw new Error("Cannot compute positions for average pool.");var r=n.filterWidth,i=n.strideHeight,a=n.strideWidth,s=n.dilationHeight,o=n.dilationWidth,c=n.effectiveFilterHeight,u=n.effectiveFilterWidth,l=n.padInfo.top,d=n.padInfo.left;this.outputShape=n.outShape;var h=e==="avg",p="0.0";if(h||(p="-1.0 / 1e-20"),t)this.userCode=` 2513 const ivec2 strides = ivec2(`+i+", "+a+`); 2514 const ivec2 pads = ivec2(`+l+", "+d+`); 2515 2516 void main() { 2517 ivec4 coords = getOutputCoords(); 2518 int batch = coords[0]; 2519 int d = coords[3]; 2520 2521 ivec2 xRCCorner = coords.yz * strides - pads; 2522 int xRCorner = xRCCorner.x; 2523 int xCCorner = xRCCorner.y; 2524 2525 // max/min x(?, ?, d) to get y(yR, yC, d). 2526 // ? = to be determined 2527 float minMaxValue = 0.0; 2528 float minMaxValueFound = 0.0; 2529 int minMaxPosition = 0; 2530 float avgValue = 0.0; 2531 2532 for (int wR = 0; wR < `+c+`; 2533 wR += `+s+`) { 2534 int xR = xRCorner + wR; 2535 2536 if (xR < 0 || xR >= `+n.inHeight+`) { 2537 continue; 2538 } 2539 2540 for (int wC = 0; wC < `+u+`; 2541 wC += `+o+`) { 2542 int xC = xCCorner + wC; 2543 2544 if (xC < 0 || xC >= `+n.inWidth+`) { 2545 continue; 2546 } 2547 2548 float value = getX(batch, xR, xC, d); 2549 2550 // If a min / max value has already been found, use it. If not, 2551 // use the current value. 2552 float currMinMaxValue = mix( 2553 value, minMaxValue, minMaxValueFound); 2554 if (value >= currMinMaxValue) { 2555 minMaxValue = value; 2556 minMaxValueFound = 1.0; 2557 minMaxPosition = wR * `+u+` + wC; 2558 } 2559 } 2560 } 2561 setOutput(float(minMaxPosition)); 2562 } 2563 `;else{var g=e+"("+e+"("+e+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";e==="avg"&&(g="avgValue / count");var v=4*Math.floor(r/4),y=r%4,b=` 2564 if (`+h+`) { 2565 avgValue += dot(values, ones); 2566 } else { 2567 minMaxValue = max(values, minMaxValue); 2568 } 2569 `;this.userCode=` 2570 const ivec2 strides = ivec2(`+i+", "+a+`); 2571 const ivec2 pads = ivec2(`+l+", "+d+`); 2572 const float initializationValue = `+p+`; 2573 const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); 2574 2575 float count = 0.0; 2576 2577 float getValue(int batch, int xR, int xC, int d) { 2578 if (xC < 0 || xC >= `+n.inWidth+`) { 2579 return initializationValue; 2580 } 2581 count += 1.0; 2582 return getX(batch, xR, xC, d); 2583 } 2584 2585 void main() { 2586 ivec4 coords = getOutputCoords(); 2587 int batch = coords[0]; 2588 int d = coords[3]; 2589 2590 ivec2 xRCCorner = coords.yz * strides - pads; 2591 int xRCorner = xRCCorner.x; 2592 int xCCorner = xRCCorner.y; 2593 2594 // max/min x(?, ?, d) to get y(yR, yC, d). 2595 // ? = to be determined 2596 vec4 minMaxValue = vec4(`+p+`); 2597 float avgValue = 0.0; 2598 count = 0.0; 2599 2600 for (int wR = 0; wR < `+c+`; 2601 wR += `+s+`) { 2602 int xR = xRCorner + wR; 2603 2604 if (xR < 0 || xR >= `+n.inHeight+`) { 2605 continue; 2606 } 2607 2608 for (int wC = 0; wC < `+v+`; wC += 4) { 2609 int xC = xCCorner + wC * `+o+`; 2610 2611 vec4 values = vec4( 2612 getValue(batch, xR, xC, d), 2613 getValue(batch, xR, xC + `+o+`, d), 2614 getValue(batch, xR, xC + 2 * `+o+`, d), 2615 getValue(batch, xR, xC + 3 * `+o+`, d) 2616 ); 2617 2618 `+b+` 2619 } 2620 2621 int xC = xCCorner + `+v+`; 2622 if (`+(y===1)+`) { 2623 vec4 values = vec4( 2624 getValue(batch, xR, xC, d), 2625 initializationValue, 2626 initializationValue, 2627 initializationValue 2628 ); 2629 2630 `+b+` 2631 } else if (`+(y===2)+`) { 2632 vec4 values = vec4( 2633 getValue(batch, xR, xC, d), 2634 getValue(batch, xR, xC + `+o+`, d), 2635 initializationValue, 2636 initializationValue 2637 ); 2638 2639 `+b+` 2640 } else if (`+(y===3)+`) { 2641 vec4 values = vec4( 2642 getValue(batch, xR, xC, d), 2643 getValue(batch, xR, xC + `+o+`, d), 2644 getValue(batch, xR, xC + 2 * `+o+`, d), 2645 initializationValue 2646 ); 2647 2648 `+b+` 2649 } 2650 } 2651 setOutput(`+g+`); 2652 } 2653 `}},Cw=function(n,e,t){if(this.variableNames=["x"],e==="avg"&&t)throw new Error("Cannot compute positions for average pool.");var r=n.filterWidth,i=n.strideDepth,a=n.strideHeight,s=n.strideWidth,o=n.dilationDepth,c=n.dilationHeight,u=n.dilationWidth,l=n.effectiveFilterDepth,d=n.effectiveFilterHeight,h=n.effectiveFilterWidth,p=n.padInfo.front,g=n.padInfo.top,v=n.padInfo.left;this.outputShape=n.outShape;var y=e==="avg",b="0.0";if(y||(b="-1.0 / 1e-20"),t)this.userCode=` 2654 const ivec3 strides = 2655 ivec3(`+i+", "+a+", "+s+`); 2656 const ivec3 pads = ivec3(`+p+", "+g+", "+v+`); 2657 2658 void main() { 2659 ivec5 coords = getOutputCoords(); 2660 int batch = coords.x; 2661 int ch = coords.u; 2662 2663 ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; 2664 int xDCorner = xCorner.x; 2665 int xRCorner = xCorner.y; 2666 int xCCorner = xCorner.z; 2667 2668 // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch). 2669 // ? = to be determined 2670 float minMaxValue = 0.0; 2671 float minMaxValueFound = 0.0; 2672 int minMaxPosition = 0; 2673 2674 for (int wD = 0; wD < `+l+`; 2675 wD += `+o+`) { 2676 int xD = xDCorner + wD; 2677 2678 if (xD < 0 || xD >= `+n.inDepth+`) { 2679 continue; 2680 } 2681 2682 for (int wR = 0; wR < `+d+`; 2683 wR += `+c+`) { 2684 int xR = xRCorner + wR; 2685 2686 if (xR < 0 || xR >= `+n.inHeight+`) { 2687 continue; 2688 } 2689 2690 for (int wC = 0; wC < `+h+`; 2691 wC += `+u+`) { 2692 int xC = xCCorner + wC; 2693 2694 if (xC < 0 || xC >= `+n.inWidth+`) { 2695 continue; 2696 } 2697 2698 float value = getX(batch, xD, xR, xC, ch); 2699 2700 // If a min / max value has already been found, use it. If not, 2701 // use the current value. 2702 float currMinMaxValue = mix( 2703 value, minMaxValue, minMaxValueFound); 2704 if (value >= currMinMaxValue) { 2705 minMaxValue = value; 2706 minMaxValueFound = 1.0; 2707 minMaxPosition = 2708 wD * `+d+" * "+h+` + 2709 wR * `+h+` + wC;; 2710 } 2711 } 2712 } 2713 } 2714 setOutput(float(minMaxPosition)); 2715 } 2716 `;else{var x=e+"("+e+"("+e+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";e==="avg"&&(x="avgValue / count");var S=4*Math.floor(r/4),w=r%4,k=` 2717 if (`+y+`) { 2718 avgValue += dot(values, ones); 2719 } else { 2720 minMaxValue = max(values, minMaxValue); 2721 } 2722 `;this.userCode=` 2723 const ivec3 strides = 2724 ivec3(`+i+", "+a+", "+s+`); 2725 const ivec3 pads = ivec3(`+p+", "+g+", "+v+`); 2726 const float initializationValue = `+b+`; 2727 const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); 2728 2729 float count = 0.0; 2730 2731 float getValue(int batch, int xD, int xR, int xC, int ch) { 2732 if (xC < 0 || xC >= `+n.inWidth+`) { 2733 return initializationValue; 2734 } 2735 count += 1.0; 2736 return getX(batch, xD, xR, xC, ch); 2737 } 2738 2739 void main() { 2740 ivec5 coords = getOutputCoords(); 2741 int batch = coords.x; 2742 int ch = coords.u; 2743 2744 ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; 2745 int xDCorner = xCorner.x; 2746 int xRCorner = xCorner.y; 2747 int xCCorner = xCorner.z; 2748 2749 // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch). 2750 // ? = to be determined 2751 vec4 minMaxValue = vec4(`+b+`); 2752 float avgValue = 0.0; 2753 count = 0.0; 2754 2755 for (int wD = 0; wD < `+l+`; 2756 wD += `+o+`) { 2757 int xD = xDCorner + wD; 2758 2759 if (xD < 0 || xD >= `+n.inDepth+`) { 2760 continue; 2761 } 2762 2763 for (int wR = 0; wR < `+d+`; 2764 wR += `+c+`) { 2765 int xR = xRCorner + wR; 2766 2767 if (xR < 0 || xR >= `+n.inHeight+`) { 2768 continue; 2769 } 2770 2771 for (int wC = 0; wC < `+S+`; wC += 4) { 2772 int xC = xCCorner + wC * `+u+`; 2773 2774 vec4 values = vec4( 2775 getValue(batch, xD, xR, xC, ch), 2776 getValue(batch, xD, xR, xC + `+u+`, ch), 2777 getValue(batch, xD, xR, xC + 2 * `+u+`, ch), 2778 getValue(batch, xD, xR, xC + 3 * `+u+`, ch) 2779 ); 2780 2781 `+k+` 2782 } 2783 2784 int xC = xCCorner + `+S+`; 2785 if (`+(w===1)+`) { 2786 vec4 values = vec4( 2787 getValue(batch, xD, xR, xC, ch), 2788 initializationValue, 2789 initializationValue, 2790 initializationValue 2791 ); 2792 2793 `+k+` 2794 } else if (`+(w===2)+`) { 2795 vec4 values = vec4( 2796 getValue(batch, xD, xR, xC, ch), 2797 getValue(batch, xD, xR, xC + `+u+`, ch), 2798 initializationValue, 2799 initializationValue 2800 ); 2801 2802 `+k+` 2803 } else if (`+(w===3)+`) { 2804 vec4 values = vec4( 2805 getValue(batch, xD, xR, xC, ch), 2806 getValue(batch, xD, xR, xC + `+u+`, ch), 2807 getValue(batch, xD, xR, xC + 2 * `+u+`, ch), 2808 initializationValue 2809 ); 2810 2811 `+k+` 2812 } 2813 } 2814 setOutput(`+x+`); 2815 } 2816 } 2817 `}},_re=function(n,e){this.variableNames=["x"];var t=n.windowSize,r=n.batchSize,i=n.inSize,a=Math.ceil(i/t);this.outputShape=[r,a];var s="0.0",o="";e==="prod"?s="1.0":e==="min"?(s="1.0 / 1e-20",o="min"):e==="max"&&(s="-1.0 / 1e-20",o="max");var c=e+"("+e+"("+e+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";e==="sum"?c="sumValue":e==="prod"?c="prodValue":e==="all"?c="allValue":e==="any"&&(c="anyValue");var u=4*Math.floor(t/4),l=t%4,d=` 2818 if (`+(e==="sum")+`) { 2819 sumValue += dot(values, ones); 2820 } else if (`+(e==="prod")+`) { 2821 vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]); 2822 prodValue *= tmp[0] * tmp[1]; 2823 } else { 2824 minMaxValue = `+o+`(values, minMaxValue); 2825 } 2826 `,h="vec4";e==="all"?(s="1.0",d=` 2827 bool reducedAllValue = all(values); 2828 float floatedReducedAllValue = float(reducedAllValue); 2829 allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0); 2830 `,h="bvec4"):e==="any"&&(s="0.0",d=` 2831 bool reducedAnyValue = any(values); 2832 float floatedReducedAnyValue = float(reducedAnyValue); 2833 anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0); 2834 `,h="bvec4");var p="";i%t>0&&(p=` 2835 if (inIdx < 0 || inIdx >= `+i+`) { 2836 return initializationValue; 2837 } 2838 `),this.userCode=` 2839 const float initializationValue = `+s+`; 2840 const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); 2841 2842 float get
2842Value(int batch, int inIdx) { 2843 `+p+` 2844 return getX(batch, inIdx); 2845 } 2846 2847 void main() { 2848 ivec2 coords = getOutputCoords(); 2849 int batch = coords[0]; 2850 int outIdx = coords[1]; 2851 int inOffset = outIdx * `+t+`; 2852 2853 vec4 minMaxValue = vec4(`+s+`); 2854 float prodValue = 1.0; 2855 float sumValue = 0.0; 2856 float allValue = 1.0; 2857 float anyValue = 0.0; 2858 2859 for (int i = 0; i < `+u+`; i += 4) { 2860 int inIdx = inOffset + i; 2861 `+h+" values = "+h+`( 2862 getValue(batch, inIdx), 2863 getValue(batch, inIdx + 1), 2864 getValue(batch, inIdx + 2), 2865 getValue(batch, inIdx + 3) 2866 ); 2867 2868 `+d+` 2869 } 2870 2871 int inIdx = inOffset + `+u+`; 2872 if (`+(l===1)+`) { 2873 `+h+" values = "+h+`( 2874 getValue(batch, inIdx), 2875 initializationValue, 2876 initializationValue, 2877 initializationValue 2878 ); 2879 2880 `+d+` 2881 } else if (`+(l===2)+`) { 2882 `+h+" values = "+h+`( 2883 getValue(batch, inIdx), 2884 getValue(batch, inIdx + 1), 2885 initializationValue, 2886 initializationValue 2887 ); 2888 2889 `+d+` 2890 } else if (`+(l===3)+`) { 2891 `+h+" values = "+h+`( 2892 getValue(batch, inIdx), 2893 getValue(batch, inIdx + 1), 2894 getValue(batch, inIdx + 2), 2895 initializationValue 2896 ); 2897 2898 `+d+` 2899 } 2900 setOutput(`+c+`); 2901 } 2902 `},bre=function(n,e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n;for(var t="",r=0;r<4;r++){var i="thisRC = rc;";r%2==1&&(i+="thisRC.z += 1;"),r>1&&(i+="thisRC.y += 1;"),t+=` 2903 `+i+` 2904 `+(r>0?"if(thisRC.y < rows && thisRC.z < cols){":"")+` 2905 int flatIndex = getFlatIndex(thisRC); 2906 2907 ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex); 2908 vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z)); 2909 2910 result[`+r+`] = 2911 getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims); 2912 `+(r>0?"}":"")+` 2913 `}this.userCode=` 2914 2915 ivec3 inputCoordsFromReshapedOutCoords(int index) { 2916 `+Hd(["r","c","d"],e)+` 2917 return ivec3(r, c, d); 2918 } 2919 2920 `+_S(n)+` 2921 2922 void main() { 2923 ivec3 rc = getOutputCoords(); 2924 2925 vec4 result = vec4(0.); 2926 2927 ivec3 thisRC; 2928 int rows = `+n[1]+`; 2929 int cols = `+n[2]+`; 2930 2931 `+t+` 2932 2933 setOutput(result); 2934 } 2935 `},xre=function(n,e,t){this.variableNames=["dy"],this.outputShape=[],this.outputShape=e.shape;var r=e.shape,i=r[1],a=r[2],s=n.shape,o=s[1],c=s[2],u=[t&&o>1?i-1:i,t&&c>1?a-1:a],l=[t&&o>1?o-1:o,t&&c>1?c-1:c],d=u[0]/l[0],h=u[1]/l[1],p=1/d,g=1/h,v=2*Math.ceil(p)+2,y=2*Math.ceil(g)+2;this.userCode=` 2936 void main() { 2937 ivec4 coords = getOutputCoords(); 2938 int b = coords[0]; 2939 int d = coords[3]; 2940 int r = coords[1]; 2941 int c = coords[2]; 2942 2943 float accumulator = 0.0; 2944 2945 const float heightScale = float(`+d+`); 2946 const float widthScale = float(`+h+`); 2947 2948 const float invHeightScale = float(`+p+`); 2949 const float invWidthScale = float(`+g+`); 2950 2951 const int winHeight = int(`+v+`); 2952 const int winWidth = int(`+y+`); 2953 2954 // Compute bounds for where in dy we will look 2955 float startRLerp = floor(float(r) * invHeightScale); 2956 int startDyR = int(startRLerp - float(winHeight / 2)); 2957 2958 float startCLerp = floor(float(c) * invWidthScale); 2959 int startDyC = int(startCLerp - float(winWidth / 2)); 2960 2961 // Loop over dy 2962 for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) { 2963 int dyR = dyROffset + startDyR; 2964 2965 // Guard against the window exceeding the bounds of dy 2966 if (dyR < 0 || dyR >= `+o+`) { 2967 continue; 2968 } 2969 2970 for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) { 2971 int dyC = dyCOffset + startDyC; 2972 2973 // Guard against the window exceeding the bounds of dy 2974 if (dyC < 0 || dyC >= `+c+`) { 2975 continue; 2976 } 2977 2978 float dxR = float(dyR) * heightScale; 2979 int topDxRIndex = int(floor(dxR)); 2980 int bottomDxRIndex = int(min(ceil(dxR), `+(i-1)+`.0)); 2981 float dxRLerp = dxR - float(topDxRIndex); 2982 float inverseDxRLerp = 1.0 - dxRLerp; 2983 2984 float dxC = float(dyC) * widthScale; 2985 int leftDxCIndex = int(floor(dxC)); 2986 int rightDxCIndex = int(min(ceil(dxC), `+(a-1)+`.0)); 2987 float dxCLerp = dxC - float(leftDxCIndex); 2988 float inverseDxCLerp = 1.0 - dxCLerp; 2989 2990 if (r == topDxRIndex && c == leftDxCIndex) { 2991 // topLeft 2992 accumulator += 2993 getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp; 2994 } 2995 2996 if (r == topDxRIndex && c == rightDxCIndex) { 2997 // topRight 2998 accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp; 2999 } 3000 3001 if (r == bottomDxRIndex && c == leftDxCIndex) { 3002 // bottomLeft 3003 accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp; 3004 } 3005 3006 if (r == bottomDxRIndex && c == rightDxCIndex) { 3007 // bottomRight 3008 accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp; 3009 } 3010 } 3011 } 3012 // End loop over dy 3013 3014 setOutput(accumulator); 3015 } 3016 `},wre=function(n,e,t,r){this.variableNames=["A"],this.outputShape=[];var i=n[0],a=n[1],s=n[2],o=n[3];this.outputShape=[i,e,t,o];var c=[r&&e>1?a-1:a,r&&t>1?s-1:s],u=[r&&e>1?e-1:e,r&&t>1?t-1:t];this.userCode=` 3017 const vec2 effectiveInputOverOutputRatioRC = vec2( 3018 `+c[0]/u[0]+`, 3019 `+c[1]/u[1]+`); 3020 const vec2 inputShapeRC = vec2(`+a+".0, "+s+`.0); 3021 3022 void main() { 3023 ivec4 coords = getOutputCoords(); 3024 int b = coords[0]; 3025 int d = coords[3]; 3026 ivec2 yRC = coords.yz; 3027 3028 // Fractional source index. 3029 vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC; 3030 3031 // Compute the four integer indices. 3032 ivec2 sourceFloorRC = ivec2(sourceFracIndexRC); 3033 ivec2 sourceCeilRC = ivec2( 3034 min(inputShapeRC - 1.0, ceil(sourceFracIndexRC))); 3035 3036 float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d); 3037 float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d); 3038 float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d); 3039 float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d); 3040 3041 vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC); 3042 3043 float top = topLeft + (topRight - topLeft) * fracRC.y; 3044 float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y; 3045 float newValue = top + (bottom - top) * fracRC.x; 3046 3047 setOutput(newValue); 3048 } 3049 `},Cre=function(n,e,t,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];var i=n[0],a=n[1],s=n[2],o=n[3];this.outputShape=[i,e,t,o];var c=[r&&e>1?a-1:a,r&&t>1?s-1:s],u=[r&&e>1?e-1:e,r&&t>1?t-1:t];this.userCode=` 3050 const vec3 effectiveInputOverOutputRatioRC = vec3( 3051 `+c[0]/u[0]+`, 3052 `+c[1]/u[1]+`, 3053 `+c[1]/u[1]+`); 3054 const vec3 inputShapeRC = vec3(`+a+".0, "+s+`.0, 3055 `+s+`.0); 3056 3057 float getAValue(int b, int r, int c, int d) { 3058 return getChannel(getA(b, r, c, d), vec2(c, d)); 3059 } 3060 3061 void main() { 3062 ivec4 coords = getOutputCoords(); 3063 int b = coords[0]; 3064 int d = coords[3]; 3065 // Calculate values for next column in yRC.z. 3066 ivec3 yRC = coords.yzz + ivec3(0, 0, 1); 3067 3068 // Fractional source index. 3069 vec3 sourceFracIndexRC = vec3(yRC) * effectiveInputOverOutputRatioRC; 3070 3071 // Compute the four integer indices. 3072 ivec3 sourceFloorRC = ivec3(sourceFracIndexRC); 3073 ivec3 sourceCeilRC = ivec3( 3074 min(inputShapeRC - 1.0, ceil(sourceFracIndexRC))); 3075 3076 // Should we calculate next column and row elements in 2x2 packed cell. 3077 bool hasNextCol = d < `+(o-1)+`; 3078 bool hasNextRow = coords.z < `+(t-1)+`
vendor: 2,018 bytes, lines 3078-3126
3078; 3079 3080 // In parallel, construct four corners for all four components in 3081 // packed 2x2 cell. 3082 vec4 topLeft = vec4( 3083 getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d), 3084 hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1) 3085 : 0.0, 3086 hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d) 3087 : 0.0, 3088 (hasNextRow && hasNextCol) ? 3089 getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0); 3090 3091 vec4 bottomLeft = vec4( 3092 getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d), 3093 hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1) 3094 : 0.0, 3095 hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d) 3096 : 0.0, 3097 (hasNextRow && hasNextCol) ? 3098 getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0); 3099 3100 vec4 topRight = vec4( 3101 getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d), 3102 hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1) 3103 : 0.0, 3104 hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d) 3105 : 0.0, 3106 (hasNextRow && hasNextCol) ? 3107 getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0); 3108 3109 vec4 bottomRight = vec4( 3110 getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d), 3111 hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1) 3112 : 0.0, 3113 hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d) 3114 : 0.0, 3115 (hasNextRow && hasNextCol) ? 3116 getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0); 3117 3118 vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC); 3119 3120 vec4 top = mix(topLeft, topRight, fracRC.yyzz); 3121 vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz); 3122 vec4 newValue = mix(top, bottom, fracRC.x); 3123 3124 setOutput(newValue); 3125 } 3126 `}
3126,kre=function(n,e,t){this.variableNames=["dy"],this.outputShape=[],this.outputShape=e.shape;var r=e.shape,i=r[1],a=r[2],s=n.shape,o=s[1],c=s[2],u=[t&&o>1?i-1:i,t&&c>1?a-1:a],l=[t&&o>1?o-1:o,t&&c>1?c-1:c],d=u[0]/l[0],h=u[1]/l[1],p=1/d,g=1/h,v=2*Math.ceil(p)+2,y=2*Math.ceil(g)+2;this.userCode=` 3127 void main() { 3128 ivec4 coords = getOutputCoords(); 3129 int b = coords[0]; 3130 int d = coords[3]; 3131 int r = coords[1]; 3132 int c = coords[2]; 3133 3134 float accumulator = 0.0; 3135 3136 const float heightScale = float(`+d+`); 3137 const float widthScale = float(`+h+`); 3138 3139 const float invHeightScale = float(`+p+`); 3140 const float invWidthScale = float(`+g+`); 3141 3142 const int winHeight = int(`+v+`); 3143 const int winWidth = int(`+y+`); 3144 3145 // Compute bounds for where in dy we will look 3146 float startRLerp = floor(float(r) * invHeightScale); 3147 int startDyR = int(floor(startRLerp - float(winHeight / 2))); 3148 3149 float startCLerp = floor(float(c) * invWidthScale); 3150 int startDyC = int(floor(startCLerp - float(winWidth / 2))); 3151 3152 // Loop over dy 3153 for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) { 3154 int dyR = dyROffset + startDyR; 3155 3156 // Guard against the window exceeding the bounds of dy 3157 if (dyR < 0 || dyR >= `+o+`) { 3158 continue; 3159 } 3160 3161 for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) { 3162 int dyC = dyCOffset + startDyC; 3163 3164 // Guard against the window exceeding the bounds of dy 3165 if (dyC < 0 || dyC >= `+c+`) { 3166 continue; 3167 } 3168 3169 float sourceFracRow = 3170 float(`+u[0]+`) * 3171 (float(dyR) / float(`+l[0]+`)); 3172 3173 float sourceFracCol = 3174 float(`+u[1]+`) * 3175 (float(dyC) / float(`+l[1]+`)); 3176 3177 int sourceNearestRow = int(min( 3178 float(int(`+i+`) - 1), 3179 `+t+` ? float(round(sourceFracRow)) : 3180 float(floor(sourceFracRow)))); 3181 3182 int sourceNearestCol = int(min( 3183 float(int(`+a+`) - 1), 3184 `+t+` ? float(round(sourceFracCol)) : 3185 float(floor(sourceFracCol)))); 3186 3187 if (r == sourceNearestRow && c == sourceNearestCol) { 3188 accumulator += getDy(b, dyR, dyC, d); 3189 } 3190 } 3191 } 3192 // End loop over dy 3193 3194 setOutput(accumulator); 3195 } 3196 `},Sre=function(n,e,t,r){this.variableNames=["A"],this.outputShape=[];var i=n[0],a=n[1],s=n[2],o=n[3];this.outputShape=[i,e,t,o];var c=[r&&e>1?a-1:a,r&&t>1?s-1:s],u=[r&&e>1?e-1:e,r&&t>1?t-1:t],l=r?"0.5":"0.0";this.userCode=` 3197 const vec2 effectiveInputOverOutputRatioRC = vec2( 3198 `+c[0]/u[0]+`, 3199 `+c[1]/u[1]+`); 3200 const vec2 inputShapeRC = vec2(`+a+".0, "+s+`.0); 3201 3202 void main() { 3203 ivec4 coords = getOutputCoords(); 3204 int b = coords[0]; 3205 int d = coords[3]; 3206 ivec2 yRC = coords.yz; 3207 3208 // Fractional source index. 3209 vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC; 3210 3211 // Compute the coordinators of nearest neighbor point. 3212 ivec2 sourceNearestRC = ivec2( 3213 min(inputShapeRC - 1.0, floor(sourceFracIndexRC + `+l+`))); 3214 3215 float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d); 3216 3217 setOutput(newValue); 3218 } 3219 `},Tre=function(n,e){this.variableNames=["x"];var t=n.length;if(t>4)throw new Error("WebGL backend: Reverse of rank-"+t+" tensor is not yet supported");if(this.outputShape=n,t!==1){var r=n.map(function(a,s){return function(o){return e.indexOf(o)!==-1&&n[o]!==1?n[o]+" - coords["+o+"] - 1":"coords["+o+"]"}(s)}).join(","),i=Hn(t);this.userCode=` 3220 void main() { 3221 `+i+` coords = getOutputCoords(); 3222 setOutput(getX(`+r+`)); 3223 } 3224 `}else this.userCode=` 3225 void main() { 3226 int coord = getOutputCoords(); 3227 setOutput(getX(`+n[0]+` - coord - 1)); 3228 } 3229 `},Ere=function(n,e){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;var t=n.length;if(t>4)throw new Error("WebGL backend: Reverse of rank-"+t+" tensor is not yet supported");this.outputShape=n;var r=La("rc",t),i=r[t-1]+" + 1 < "+this.outputShape[t-1],a=r[t-2]+" + 1 < "+this.outputShape[t-2],s=Hn(t);function o(c){var u=n.map(function(l,d){return function(h,p){return e.indexOf(h)!==-1&&n[h]!==1?n[h]+" - "+p[h]+" - 1":""+p[h]}(d,c)});return"getChannel(getX("+u.join(",")+"), vec2("+u.slice(-2).join(",")+"))"}this.userCode=t===1?` 3230 void main(){ 3231 int rc = getOutputCoords(); 3232 vec4 result = vec4(0.); 3233 result.r = getChannel(getX(`+n[0]+` - rc - 1), 3234 `+n[0]+` - rc - 1); 3235 if(`+i+`){ 3236 result.g = getChannel(getX(`+n[0]+` - (rc + 1) - 1), 3237 `+n[0]+` - (rc + 1) - 1); 3238 } 3239 setOutput(result); 3240 } 3241 `:` 3242 void main() { 3243 `+s+` rc = getOutputCoords(); 3244 vec4 result = vec4(0.); 3245 result.r = `+function(c){return o(c)}(r.slice())+`; 3246 if(`+i+`){ 3247 result.g = `+function(c){return c[t-1]="("+c[t-1]+" + 1)",o(c)}(r.slice())+`; 3248 } 3249 if(`+a+`) { 3250 result.b = `+function(c){return c[t-2]="("+c[t-2]+" + 1)",o(c)}(r.slice())+`; 3251 if(`+i+`) { 3252 result.a = `+function(c){return c[t-1]="("+c[t-1]+" + 1)",c[t-2]="("+c[t-2]+" + 1)",o(c)}(r.slice())+`; 3253 } 3254 } 3255 setOutput(result); 3256 } 3257 `},T4=function(n,e,t,r,i,a,s){this.variableNames=["updates","indices","defaultValue"],this.outputShape=a;var o=Hn(i.length),c=Hn(a.length),u="";t===1?u="i":t===2&&(u="i, j");var l="getIndices("+u+")",d="";r===1?d="i":r===2&&(d="i, coords[1]");
3257var h="getUpdates("+d+")",p=e>1?"strides[j]":"strides";this.userCode=` 3258 `+o+" strides = "+o+"("+i+`); 3259 3260 void main() { 3261 `+c+` coords = getOutputCoords(); 3262 float sum = 0.0; 3263 bool found = false; 3264 for (int i = 0; i < `+n+`; i++) { 3265 int flattenedIndex = 0; 3266 for (int j = 0; j < `+e+`; j++) { 3267 int index = round(`+l+`); 3268 flattenedIndex += index * `+p+`; 3269 } 3270 if (flattenedIndex == coords[0]) { 3271 sum += `+h+`; 3272 found = true; 3273 } 3274 } 3275 setOutput(mix(getDefaultValue(), sum, float(found))); 3276 } 3277 `},Pre=function(n,e){this.variableNames=["x","segmentIds"];var t=n.windowSize,r=n.batchSize,i=n.inSize,a=n.numSegments,s=a*Math.ceil(i/t);this.outputShape=[r,s];var o=4*Math.floor(t/4),c=t%4,u=` 3278 sumValue += dot(values, segFilter); 3279 `,l="";i%t>0&&(l=` 3280 if (inIdx < 0 || inIdx >= `+i+`) { 3281 return initializationValue; 3282 } 3283 `);var d="";i%t>0&&(d=` 3284 if (inIdx < 0 || inIdx >= `+i+`) { 3285 return -1.0; 3286 } 3287 `),this.userCode=` 3288 const float initializationValue = 0.0; 3289 3290 float getValue(int batch, int inIdx) { 3291 `+l+` 3292 return getX(batch, inIdx); 3293 } 3294 3295 float getSegmentIdAtIndex(int inIdx) { 3296 `+d+` 3297 return getSegmentIds(inIdx); 3298 } 3299 3300 void main() { 3301 ivec2 coords = getOutputCoords(); 3302 int batch = coords[0]; 3303 int outIdx = coords[1]; 3304 int inOffset = int(floor(float(outIdx) / float( 3305 `+a+")) * float("+t+`)); 3306 int currentSeg = int(mod(float(outIdx), float(`+a+`))); 3307 3308 float sumValue = 0.0; 3309 3310 for (int i = 0; i < `+o+`; i += 4) { 3311 int inIdx = inOffset + i; 3312 vec4 values = vec4( 3313 getValue(batch, inIdx), 3314 getValue(batch, inIdx + 1), 3315 getValue(batch, inIdx + 2), 3316 getValue(batch, inIdx + 3) 3317 ); 3318 3319 vec4 segFilter = vec4( 3320 int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, 3321 int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, 3322 int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0, 3323 int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0 3324 ); 3325 3326 `+u+` 3327 } 3328 3329 int inIdx = inOffset + `+o+`; 3330 if (`+(c===1)+`) { 3331 vec4 values = vec4( 3332 getValue(batch, inIdx), 3333 initializationValue, 3334 initializationValue, 3335 initializationValue 3336 ); 3337 3338 int inIdxSeg = int(getSegmentIdAtIndex(inIdx)); 3339 3340 vec4 segFilter = vec4( 3341 int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, 3342 0, 3343 0, 3344 0 3345 ); 3346 3347 `+u+` 3348 } else if (`+(c===2)+`) { 3349 vec4 values = vec4( 3350 getValue(batch, inIdx), 3351 getValue(batch, inIdx + 1), 3352 initializationValue, 3353 initializationValue 3354 ); 3355 3356 vec4 segFilter = vec4( 3357 int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, 3358 int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, 3359 0, 3360 0 3361 ); 3362 3363 `+u+` 3364 } else if (`+(c===3)+`) { 3365 vec4 values = vec4( 3366 getValue(batch, inIdx), 3367 getValue(batch, inIdx + 1), 3368 getValue(batch, inIdx + 2), 3369 initializationValue 3370 ); 3371 3372 vec4 segFilter = vec4( 3373 int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, 3374 int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, 3375 int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0, 3376 0 3377 ); 3378 3379 `+u+` 3380 } 3381 setOutput(sumValue); 3382 } 3383 `},Rre=function(n,e,t){var r,i;if(this.variableNames=["c","a","b"],this.outputShape=e,t>4)throw Error("Where for rank "+t+" is not yet supported");if(t===1)i="resRC",r="resRC";else{for(var a=["resRC.x","resRC.y","resRC.z","resRC.w"],s=[],o=[],c=0;c<e.length;c++)o.push(""+a[c]),c<n&&s.push(""+a[c]);r=s.join(),i=o.join()}var u=Hn(t);this.userCode=` 3384 void main() { 3385 `+u+` resRC = getOutputCoords(); 3386 float cVal = getC(`+r+`); 3387 if (cVal >= 1.0) { 3388 setOutput(getA(`+i+`)); 3389 } else { 3390 setOutput(getB(`+i+`)); 3391 } 3392 } 3393 `},Are=function(){function n(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;var t,r=Hn(this.rank),i="uniform int start["+this.rank+"];",a=function(s){if(s===1)return"sourceLoc";if(s<=6)return kw.slice(0,s).map(function(o){return"sourceLoc."+o}).join(",");throw Error("Slicing for rank "+s+" is not yet supported")}(this.rank);t=` 3394 `+r+` sourceLoc; 3395 `+r+` coords = getOutputCoords(); 3396 `+e.map(function(s,o){return"sourceLoc."+kw[o]+" = start["+o+"] + coords."+kw[o]+";"}).join(` 3397`)+` 3398 `,this.userCode=` 3399 `+i+` 3400 void main() { 3401 `+t+` 3402 setOutput(getSource(`+a+`)); 3403 } 3404 `}return n.prototype.getCustomSetupFunc=function(e){var t=this;if(e.length!==this.rank)throw Error("The rank ("+this.rank+") of the program must match the length of start ("+e.length+")");return function(r,i){t.startLoc==null&&(t.startLoc=r.getUniformLocationNoThrow(i,"start"),t.startLoc==null)||r.gl.uniform1iv(t.startLoc,e)}},n}(),kw=["x","y","z","w","u","v"],Ire=function(){function n(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length;var t=Hn(this.rank),r=La("coords",this.rank),i=La("sourceLoc",this.rank),a=this.rank===1?"sourceLoc":"vec2("+i.slice(-2).join()+")",s="getChannel(getSource("+i.join()+"), "+a+")",o=` 3405 result.x = `+s+`; 3406 if (++`+r[this.rank-1]+" < "+e[this.rank-1]+`) { 3407 ++`+i[this.rank-1]+`; 3408 result.y = `+s+`; 3409 --`+i[this.rank-1]+`; 3410 } 3411 `,c=this.rank===1?"":` 3412 --`+r[this.rank-1]+`; 3413 if (++`+r[this.rank-2]+" < "+e[this.rank-2]+`) { 3414 ++`+i[this.rank-2]+`; 3415 result.z = `+s+`; 3416 if (++`+r[this.rank-1]+" < "+e[this.rank-1]+`) { 3417 ++`+i[this.rank-1]+`; 3418 result.w = `+s+`; 3419 } 3420 }
3421 `,u=this.rank<=4?`sourceLoc = coords + 3422 `+t+"("+e.map(function(l,d){return"start["+d+"]"}).join()+");":e.map(function(l,d){return i[d]+" = "+r[d]+" + start["+d+"];"}).join(` 3423`);this.userCode=` 3424 uniform int start[`+this.rank+`]; 3425 void main() { 3426 `+t+` coords = getOutputCoords(); 3427 `+t+` sourceLoc; 3428 `+u+` 3429 vec4 result = vec4(0.); 3430 `+o+` 3431 `+c+` 3432 setOutput(result); 3433 } 3434 `}return n.prototype.getCustomSetupFunc=function(e){var t=this;if(e.length!==this.rank)throw Error("The rank ("+this.rank+") of the program must match the length of start ("+e.length+")");return function(r,i){t.startLoc==null&&(t.startLoc=r.getUniformLocationNoThrow(i,"start"),t.startLoc==null)||r.gl.uniform1iv(t.startLoc,e)}},n}(),Ore=function(n,e,t){this.variableNames=["x"],this.outputShape=t;var r=t.length,i=Hn(t.length),a=Hn(t.length),s="";if(r===1)s="coords * strides + begin";else{var o=0;s=t.map(function(c,u){return o++,t.length===1?"coords * strides["+u+"] + begin["+u+"]":"coords["+(o-1)+"] * strides["+u+"] + begin["+u+"]"}).join(",")}this.userCode=` 3435 `+i+" begin = "+i+"("+n+`); 3436 `+i+" strides = "+i+"("+e+`); 3437 3438 void main() { 3439 `+a+` coords = getOutputCoords(); 3440 setOutput(getX(`+s+`)); 3441 } 3442 `},Mre=function(){function n(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}return n.prototype.acquireTexture=function(e,t,r){var i,a=E4(t,r),s=P4(e,a,r);if(s in this.freeTextures||(this.freeTextures[s]=[]),s in this.usedTextures||(this.usedTextures[s]=[]),this.freeTextures[s].length>0){this.numFreeTextures--,this.numUsedTextures++,this.log();var o=this.freeTextures[s].shift();return this.usedTextures[s].push(o),o}return this.numUsedTextures++,this.log(),a===hs.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):a===hs.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):a===hs.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):a===hs.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):a===hs.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[s].push(i),i},n.prototype.releaseTexture=function(e,t,r,i){if(this.freeTextures!=null){var a=P4(t,E4(r,i),i);a in this.freeTextures||(this.freeTextures[a]=[]),this.freeTextures[a].push(e),this.numFreeTextures++,this.numUsedTextures--;var s=this.usedTextures[a],o=s.indexOf(e);if(o<0)throw new Error("Cannot release a texture that was never provided by this texture manager");s.splice(o,1),this.log()}},n.prototype.log=function(){if(this.logEnabled){var e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",this.numFreeTextures+" / "+this.numUsedTextures,"("+e+")")}},n.prototype.getNumUsedTextures=function(){return this.numUsedTextures},n.prototype.getNumFreeTextures=function(){return this.numFreeTextures},n.prototype.dispose=function(){var e=this;if(this.freeTextures!=null){for(var t in this.freeTextures)this.freeTextures[t].forEach(function(r){e.gpgpu.deleteMatrixTexture(r)});for(var t in this.usedTextures)this.usedTextures[t].forEach(function(i){e.gpgpu.deleteMatrixTexture(i)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0}},n}();function E4(n,e){if(n===vs.UPLOAD)return hs.PACKED_2X2_FLOAT32;if(n===vs.RENDER||n==null)return function(t){return ke().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?t?hs.PACKED_2X2_FLOAT32:hs.UNPACKED_FLOAT32:t?hs.PACKED_2X2_FLOAT16:hs.UNPACKED_FLOAT16}(e);if(n===vs.DOWNLOAD||n===vs.PIXELS)return hs.PACKED_4X1_UNSIGNED_BYTE;throw new Error("Unknown logical texture type "+n)}function P4(n,e,t){return n[0]+"_"+n[1]+"_"+e+"_"+t}var Dre=function(n,e){this.variableNames=["A"];for(var t=new Array(n.length),r=0;r<t.length;r++)t[r]=n[r]*e[r];this.outputShape=t,this.rank=t.length;var i=Hn(this.rank),a=function(s){var o=s.length;if(o>5)throw Error("Tile for rank "+o+" is not yet supported");if(o===1)return"imod(resRC, "+s[0]+")";for(var c=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],u=[],l=0;l<s.length;l++)u.push("imod("+c[l]+", "+s[l]+")");return u.join()}(n);this.userCode=` 3443 void main() { 3444 `+i+` resRC = getOutputCoords(); 3445 setOutput(getA(`+a+`)); 3446 } 3447 `},Nre=function(n,e){this.variableNames=["A"];for(var t=new Array(n.length),r=0;r<t.length;r++)t[r]=n[e[r]];this.outputShape=t,this.rank=t.length;var i=Hn(this.rank),a=function(s){var o=s.length;if(o>6)throw Error("Transpose for rank "+o+" is not yet supported");for(var c=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],u=new Array(o),l=0;l<s.length;l++)u[s[l]]=c[l];return u.join()}(e);this.userCode=` 3448 void main() { 3449 `+i+` resRC = getOutputCoords(); 3450 setOutput(getA(`+a+`)); 3451 } 3452 `},Lre=function(n,e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0;for(var t=new Array(n.length),r=0;r<t.length;r++)t[r]=n[e[r]];if(this.outputShape=t,this.rank=t.length,this.rank>6)throw Error("Packed transpose for rank "+this.rank+" is not yet supported.");var i=Hn(this.rank),a=nN("rc",this.rank),s=new Array(this.rank);for(r=0;r<e.length;r++)s[e[r]]=a[r];var o="vec2("+s.slice(-2).join()+")",c="++"+a[this.rank-1]+" < "+t[this.rank-1],u="getChannel(getA("+s.join()+"), "+o+")";this.userCode=` 3453 void main() { 3454 `+i+` rc = getOutputCoords(); 3455 vec4 result = vec4(0.); 3456 result[0] = `+u+`; 3457 if(`+c+`) { 3458 result[1] = `+u+`; 3459 } 3460 --`+a[this.rank-1]+`; 3461 if(++`+a[this.rank-2]+" < "+t[this.rank-2]+`) { 3462 result[2] = `+u+`; 3463 if(`+c+`) { 3464 result[3] = `+u+`; 3465 } 3466 } 3467 setOutput(result); 3468 } 3469 `},bS=1.7580993408473768,xS=1.0507009873554805,$t=function(n,e){this.variableNames=["A"],this.outputShape=n,this.userCode=` 3470 float unaryOperation(float x) { 3471 `+e+` 3472 } 3473 3474 void main() { 3475 float x = getAAtOutCoords(); 3476 float y = unaryOperation(x); 3477 3478 setOutput(y); 3479 } 3480 `},cc="if (isnan(x)) return x;",Fre="return x;",R4="return abs(x);",oN=cc+` 3481 return (x < 0.0) ? 0.0 : x; 3482`,cN=cc+` 3483 return (x < 0.0) ? 0.0 : min(6.0, x); 3484`,uN="return (x >= 0.0) ? x : (exp(x) - 1.0);",$re=` 3485 // Stable and Attracting Fixed Point (0, 1) for Normalized Weights. 3486 // see: https://arxiv.org/abs/1706.02515 3487 float scaleAlpha = `+bS+`; 3488 float scale = `+xS+`; 3489 return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0); 3490`,A4="return -x;",I4="return ceil(x);",O4="return floor(x);",M4="return exp(x);",D4="return exp(x) - 1.0;",Bre=cc+` 3491 return sin(x); 3492`,Ure=cc+` 3493 return cos(x); 3494`,jre=cc+` 3495 if (abs(x) > 1.) { 3496 return NAN; 3497 } 3498 return asin(x); 3499`,qre=cc+` 3500 if (abs(x) > 1.) { 3501 return NAN; 3502 } 3503 return acos(x); 3504`,zre=cc+` 3505 return atan(x); 3506`,Wre=cc+"return log(x + sqrt(x * x + 1.0));",Hre=cc+` 3507 if (x < 1.0) return NAN; 3508 return log(x + sqrt(x * x - 1.0));`,Vre=cc+` 3509 if ((x < -1.0) || (x > 1.0)) return NAN;
3510 return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,R0="return x;",Gre="return x;",lN=` 3511 vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); 3512 bvec4 isNaN = isnan(x); 3513 3514 result.r = isNaN.r ? x.r : result.r; 3515 result.g = isNaN.g ? x.g : result.g; 3516 result.b = isNaN.b ? x.b : result.b; 3517 result.a = isNaN.a ? x.a : result.a; 3518 3519 return result; 3520`,dN=` 3521 vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); 3522 bvec4 isNaN = isnan(x); 3523 3524 result.r = isNaN.r ? x.r : result.r; 3525 result.g = isNaN.g ? x.g : result.g; 3526 result.b = isNaN.b ? x.b : result.b; 3527 result.a = isNaN.a ? x.a : result.a; 3528 3529 return result; 3530`,fN=` 3531 vec4 result; 3532 3533 result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); 3534 result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0); 3535 result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0); 3536 result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); 3537 3538 return result; 3539`,bm=function(n,e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n,this.userCode=` 3540 vec4 unaryOperation(vec4 x) { 3541 `+e+` 3542 } 3543 3544 void main() { 3545 vec4 x = getAAtOutCoords(); 3546 vec4 y = unaryOperation(x); 3547 3548 setOutput(y); 3549 } 3550 `},Kre=function(n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=n;var e=n.length,t=La("rc",e),r=Hn(e),i=function(o,c){if(o===1)return"rc";for(var u="",l=0;l<o;l++)u+=c[l],l<o-1&&(u+=",");return u}(e,t),a=t.slice(-2),s=e<=1?"rc":"vec2("+a.join(",")+")";this.userCode=` 3551 void main() { 3552 `+r+` rc = getOutputCoords(); 3553 vec4 packedInput = getA(`+i+`); 3554 3555 setOutput(getChannel(packedInput, `+s+`)); 3556 } 3557 `},A0={};function I0(n,e){if(e===void 0&&(e=!1),n==="linear")return e?Gre:Fre;if(n==="relu")return e?lN:oN;if(n==="elu")return e?fN:uN;if(n==="relu6")return e?dN:cN;if(n==="prelu")return e?sN:aN;throw new Error("Activation "+n+" has not been implemented for the WebGL backend.")}var Yre=600,Xre=function(n){function e(t){var r,i=n.call(this)||this;if(i.pendingRead=new WeakMap,i.pendingDisposal=new WeakSet,i.dataRefCount=new WeakMap,i.numBytesInGPU=0,i.uploadWaitMs=0,i.downloadWaitMs=0,i.warnedAboutMemory=!1,i.pendingDeletes=0,i.disposed=!1,!ke().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(t==null){var a=nu(ke().getNumber("WEBGL_VERSION"));i.binaryCache=((r=ke().getNumber("WEBGL_VERSION"))in A0||(A0[r]={}),A0[r]),i.gpgpu=new ore(a),i.canvas=a.canvas,i.gpgpuCreatedLocally=!0}else i.gpgpu=t,i.binaryCache={},i.gpgpuCreatedLocally=!1,i.canvas=t.gl.canvas;return i.textureManager=new Mre(i.gpgpu),i.numMBBeforeWarning=ke().global.screen==null?1024:ke().global.screen.height*ke().global.screen.width*window.devicePixelRatio*Yre/1024/1024,i.texData=new G5(i,ce),i}return oc(e,n),e.prototype.numDataIds=function(){return this.texData.numDataIds()+(this.cpuBackend?this.cpuBackend.numDataIds():0)-this.pendingDeletes},e.prototype.write=function(t,r,i){if(ke().getBool("DEBUG")&&this.checkNumericalProblems(t),i==="complex64"&&t!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");var a={};return this.texData.set(a,{shape:r,dtype:i,values:t,usage:vs.UPLOAD}),a},e.prototype.move=function(t,r,i,a){if(ke().getBool("DEBUG")&&this.checkNumericalProblems(r),a==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(t,{shape:i,dtype:a,values:r,usage:vs.UPLOAD})},e.prototype.readSync=function(t){var r=this.texData.get(t),i=r.values,a=r.dtype,s=r.complexTensors,o=r.slice,c=r.shape,u=r.isPacked;if(o!=null){var l=void 0;l=u?new bm(c,R0):new $t(c,R0);var d=this.runWebGLProgram(l,[{dataId:t,shape:c,dtype:a}],a),h=this.readSync(d.dataId);return this.disposeData(d.dataId),h}if(i!=null)return this.convertAndCacheOnCPU(t);if(a==="string")return i;var p,g,v=this.activeTimers!=null;return v&&(p=Oc()),a==="complex64"?g=uk(s.real.dataSync(),s.imag.dataSync()):g=this.getValuesFromTexture(t),v&&(this.downloadWaitMs+=Oc()-p),this.convertAndCacheOnCPU(t,g)},e.prototype.read=function(t){return at(this,void 0,void 0,function(){var r,i,a,s,o,c,u,l,d,h,p,g,v,y,b,x,S,w,k,E,I,P;return st(this,function(A){switch(A.label){case 0:if(this.pendingRead.has(t))return r=this.pendingRead.get(t),[2,new Promise(function(N){return r.push(N)})];if(i=this.texData.get(t),a=i.values,s=i.shape,o=i.slice,c=i.dtype,u=i.complexTensors,l=i.isPacked,o!=null)return d=void 0,d=l?new bm(s,R0):new $t(s,R0),h=this.runWebGLProgram(d,[{dataId:t,shape:s,dtype:c}],c),p=this.read(h.dataId),this.disposeData(h.dataId),[2,p];if(a!=null)return[2,this.convertAndCacheOnCPU(t)];if(!ke().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&ke().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");return g=null,c!=="complex64"&&ke().get("WEBGL_BUFFER_SUPPORTED")&&(v=this.decode(t),y=this.texData.get(v.dataId),g=(P=this.gpgpu).createBufferFromTexture.apply(P,[y.texture].concat(Km(s)))),this.pendingRead.set(t,[]),c==="complex64"?[3,2]:[4,this.gpgpu.createAndWaitForFence()];case 1:A.sent(),A.label=2;case 2:return c!=="complex64"?[3,4]:[4,Promise.all([u.real.data(),u.imag.data()])];case 3:return x=A.sent(),S=x[0],w=x[1],b=uk(S,w),[3,5];case 4:g==null?b=this.getValuesFromTexture(t):(k=ct(s),b=this.gpgpu.downloadFloat32MatrixFromBuffer(g,k)),A.label=5;case 5:return v!=null&&this.disposeData(v.dataId),E=this.convertAndCacheOnCPU(t,b),I=this.pendingRead.get(t),this.pendingRead.delete(t),I.forEach(function(N){return N(E)}),this.pendingDisposal.has(t)&&(this.pendingDisposal.delete(t),this.disposeData(t),this.pendingDeletes--),[2,E]}})})},e.prototype.checkNumericalProblems=function(t){if(t!=null)for(var r=0;r<t.length;r++){var i=t[r];
3557if(!$ee(i))throw ke().getBool("WEBGL_RENDER_FLOAT32_CAPABLE")?Error("The value "+i+" cannot be represented with your current settings. Consider enabling float32 rendering: 'tf.env().set('WEBGL_RENDER_FLOAT32_ENABLED', true);'"):Error("The value "+i+" cannot be represented on this device.")}},e.prototype.getValuesFromTexture=function(t){var r,i=this.texData.get(t),a=i.shape,s=i.dtype,o=i.isPacked,c=ct(a);if(ke().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")){var u=this.decode(t),l=this.texData.get(u.dataId),d=(r=this.gpgpu).downloadMatrixFromPackedTexture.apply(r,[l.texture].concat(Km(a))).subarray(0,c);return this.disposeData(u.dataId),d}var h=ke().getBool("WEBGL_PACK")&&o===!0,p=h?vw(a):a,g=h?new Fne(p):new Lne(p),v=this.runWebGLProgram(g,[{shape:p,dtype:s,dataId:t}],"float32"),y=this.texData.get(v.dataId),b=this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(y.texture,y.texShape[0],y.texShape[1]).subarray(0,c);return this.disposeData(v.dataId),b},e.prototype.time=function(t){return at(this,void 0,void 0,function(){var r,i,a,s,o,c,u;return st(this,function(l){switch(l.label){case 0:return r=this.activeTimers,i=[],a=!1,this.programTimersStack==null?(this.programTimersStack=i,a=!0):this.activeTimers.push(i),this.activeTimers=i,t(),s=op(this.activeTimers.map(function(d){return d.query})).filter(function(d){return d!=null}),o=op(this.activeTimers.map(function(d){return d.name})).filter(function(d){return d!=null}),this.activeTimers=r,a&&(this.programTimersStack=null),c={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null},ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?[4,Promise.all(s)]:[3,2];case 1:return u=l.sent(),c.kernelMs=yee(u),c.getExtraProfileInfo=function(){return u.map(function(d,h){return{name:o[h],ms:d}}).map(function(d){return d.name+": "+d.ms}).join(", ")},[3,3];case 2:c.kernelMs={error:"WebGL query timers are not supported in this environment."},l.label=3;case 3:return this.uploadWaitMs=0,this.downloadWaitMs=0,[2,c]}})})},e.prototype.memory=function(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU}},e.prototype.startTimer=function(){return ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:Oc(),endMs:null}},e.prototype.endTimer=function(t){return ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),t):(t.endMs=Oc(),t)},e.prototype.getQueryTime=function(t){return at(this,void 0,void 0,function(){var r;return st(this,function(i){return ke().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?[2,this.gpgpu.waitForQueryAndGetTime(t)]:[2,(r=t).endMs-r.startMs]})})},e.prototype.disposeData=function(t){if(!this.pendingDisposal.has(t)){if(this.pendingRead.has(t))return this.pendingDisposal.add(t),void this.pendingDeletes++;if(this.texData.has(t)){this.releaseGPUData(t);var r=this.texData.get(t).complexTensors;r!=null&&(r.real.dispose(),r.imag.dispose()),this.texData.delete(t)}}},e.prototype.releaseGPUData=function(t){var r=this.texData.get(t),i=r.texture,a=r.dtype,s=r.texShape,o=r.usage,c=r.isPacked,u=r.slice,l=u&&u.origDataId||t,d=this.dataRefCount.get(l);d>1?this.dataRefCount.set(l,d-1):(this.dataRefCount.delete(l),i!=null&&(this.numBytesInGPU-=this.computeBytes(s,a),this.textureManager.releaseTexture(i,s,o,c)));var h=this.texData.get(t);h.texture=null,h.texShape=null,h.isPacked=!1,h.slice=null},e.prototype.getTexture=function(t){return this.uploadToGPU(t),this.texData.get(t).texture},e.prototype.getDataInfo=function(t){return this.texData.get(t)},e.prototype.getCPUBackend=function(){return ke().getBool("WEBGL_CPU_FORWARD")?(this.cpuBackend==null&&(this.cpuBackend=ce.findBackend("cpu")),this.cpuBackend):null},e.prototype.shouldExecuteOnCPU=function(t,r){var i=this;return r===void 0&&(r=128),this.getCPUBackend()!=null&&t.every(function(a){return i.texData.get(a.dataId).texture==null&&a.size<r})},e.prototype.getGPGPUContext=function(){return this.gpgpu},e.prototype.complex=function(t,r){var i=this.makeOutput(t.shape,"complex64");return this.texData.get(i.dataId).complexTensors={real:ce.keep(t.clone()),imag:ce.keep(r.clone())},i},e.prototype.real=function(t){return this.texData.get(t.dataId).complexTensors.real.clone()},e.prototype.imag=function(t){return this.texData.get(t.dataId).complexTensors.imag.clone()},e.prototype.slice=function(t,r,i){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.slice(t,r,i);if(ct(i)===0)return Pi([],i,t.dtype);var a=this.texData.get(t.dataId).isPacked,s=H5(t.shape,r,i);if(a||!s){var o=ke().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Ire(i):new Are(i),c=o.getCustomSetupFunc(r);return this.compileAndRun(o,[t],null,c)}return this.uploadToGPU(t.dataId),this.shallowSlice(t,r,i)},e.prototype.shallowSlice=function(t,r,i){var a=this.texData.get(t.dataId),s=this.makeOutput(i,t.dtype),o=this.texData.get(s.dataId);Object.assign(o,a),o.shape=i,o.dtype=t.dtype;var c=V5(r,t.strides);
3557a.slice&&(c+=a.slice.flatOffset),o.slice={flatOffset:c,origDataId:a.slice&&a.slice.origDataId||t.dataId};var u=this.dataRefCount.get(o.slice.origDataId)||1;return this.dataRefCount.set(o.slice.origDataId,u+1),s},e.prototype.stridedSlice=function(t,r,i,a){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.stridedSlice(t,r,i,a);var s=pS(r,i,a);if(s.some(function(c){return c===0}))return Pi([],s);var o=new Ore(r,a,s);return this.compileAndRun(o,[t])},e.prototype.reverse=function(t,r){var i=ke().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Ere(t.shape,r):new Tre(t.shape,r);return this.compileAndRun(i,[t])},e.prototype.concat=function(t,r){if(t[0].dtype==="complex64"){var i=t.map(function(p){return oo(p)}),a=t.map(function(p){return Dc(p)});return Ti(this.concat(i,r),this.concat(a,r))}if(this.shouldExecuteOnCPU(t))return this.cpuBackend.concat(t,r);if(t.length===1)return t[0];if(t.length>ke().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){var s=Math.floor(t.length/2),o=this.concat(t.slice(0,s),r),c=this.concat(t.slice(s),r);return this.concat([o,c],r)}if(ke().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&t[0].rank>1){var u=new wne(t.map(function(p){return p.shape}),r);return this.compileAndRun(u,t)}var l=up(t.map(function(p){return p.shape}),r),d=t.map(function(p){return p.as2D(-1,ct(p.shape.slice(r)))}),h=new xne(d.map(function(p){return p.shape}));return this.compileAndRun(h,d).reshape(l)},e.prototype.neg=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.neg(t);if(ke().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,A4,t.dtype);var r=new $t(t.shape,A4);return this.compileAndRun(r,[t])},e.prototype.batchMatMul=function(t,r,i,a){var s=i?t.shape[2]:t.shape[1],o=a?r.shape[1]:r.shape[2],c=i?t.shape[1]:t.shape[2],u=t.shape[0];if((s===1||o===1)&&c>1e3){i&&(t=t.transpose([0,2,1])),a&&(r=r.transpose([0,2,1]));var l=o===1?t:t.as3D(u,c,1),d=o===1?2:1,h=o===1?r.as3D(u,1,c):r;return this.multiply(l,h).sum(d,!0)}var p=Ei(t.dtype,r.dtype),g=new xw(t.shape,[u,s,o],i,a);return this.compileAndRun(g,[t,r],p)},e.prototype.fusedBatchMatMul=function(t){var r=t.a,i=t.b,a=t.transposeA,s=t.transposeB,o=t.bias,c=t.activation,u=t.preluActivationWeights,l=a?r.shape[2]:r.shape[1],d=s?i.shape[1]:i.shape[2],h=r.shape[0],p=Ei(r.dtype,i.dtype),g=o!=null,v=u!=null,y=c?I0(c,!0):null,b=new xw(r.shape,[h,l,d],a,s,g,y,v),x=[r,i];return o&&x.push(o),u&&x.push(u),this.compileAndRun(b,x,p)},e.prototype.multiply=function(t,r){if(t.dtype==="complex64"){var i=this.texData.get(t.dataId),a=this.texData.get(r.dataId),s=new y4(gne,t.shape,r.shape),o=new y4(vne,t.shape,r.shape),c=[this.makeComplexComponentTensorInfo(t,i.complexTensors.real),this.makeComplexComponentTensorInfo(t,i.complexTensors.imag),this.makeComplexComponentTensorInfo(r,a.complexTensors.real),this.makeComplexComponentTensorInfo(r,a.complexTensors.imag)],u=this.compileAndRun(s,c),l=this.compileAndRun(o,c),d=this.complex(u,l);return u.dispose(),l.dispose(),d}if(this.shouldExecuteOnCPU([t,r]))return this.cpuBackend.multiply(t,r);if(ke().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,r,_4,t.dtype);var h=new wr(_4,t.shape,r.shape);return this.compileAndRun(h,[t,r],t.dtype)},e.prototype.batchNormalization=function(t,r,i,a,s,o){var c=[t,r,i],u=null;o!=null&&(u=o.shape,c.push(o));var l=null;if(s!=null&&(l=s.shape,c.push(s)),ke().getBool("WEBGL_PACK_NORMALIZATION")){var d=new mne(t.shape,r.shape,i.shape,u,l,a);return this.compileAndRun(d,c)}var h=new pne(t.shape,r.shape,i.shape,u,l,a);return this.compileAndRun(h,c)},e.prototype.localResponseNormalization4D=function(t,r,i,a,s){var o=ke().getBool("WEBGL_PACK_NORMALIZATION")?new dre(t.shape,r,i,a,s):new ure(t.shape,r,i,a,s);return this.compileAndRun(o,[t])},e.prototype.LRNGrad=function(t,r,i,a,s,o,c){var u=new lre(r.shape,a,s,o,c);return this.compileAndRun(u,[r,i,t])},e.prototype.tile=function(t,r){if(t.dtype==="string"){var i=this.readSync(t.dataId).map(function(s){return Jy(s)});return eN(Dt(t.shape,t.dtype,i),r)}var a=new Dre(t.shape,r);return this.compileAndRun(a,[t])},e.prototype.pad=function(t,r,i){var a=ke().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new yre(t.shape,r,i):new vre(t.shape,r,i);return this.compileAndRun(a,[t])},e.prototype.transpose=function(t,r){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.transpose(t,r);var i=ke().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Lre(t.shape,r):new Nre(t.shape,r);return this.compileAndRun(i,[t])},e.prototype.gather=function(t,r,i){if(this.shouldExecuteOnCPU([t,r]))return this.cpuBackend.gather(t,r,i);var a=new zne(t.shape,r.size,i);return this.compileAndRun(a,[t,r])},e.prototype.batchToSpaceND=function(t,r,i){J(t.rank<=4,function(){return"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"});var a=r.reduce(function(d,h){return d*h}
vendor: 12,835 bytes, lines 3557-3700
3557),s=r_(t.shape,r,a),o=i_(s.length,r.length),c=a_(t.shape,r,a),u=j5(i,r.length),l=q5(c,i,r.length);return t.reshape(s).transpose(o).reshape(c).slice(u,l)},e.prototype.spaceToBatchND=function(t,r,i){J(t.rank<=4,function(){return"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"});var a=r.reduce(function(h,p){return h*p}),s=[[0,0]];s.push.apply(s,i);for(var o=1+r.length;o<t.shape.length;++o)s.push([0,0]);var c=t.pad(s),u=r_(c.shape,r,a,!1),l=i_(u.length,r.length,!1),d=a_(c.shape,r,a,!1);return c.reshape(u).transpose(l).reshape(d)},e.prototype.reduce=function(t,r,i){var a=t.shape[0],s=t.shape[1],o=yw(s),c=new _re({windowSize:o,inSize:s,batchSize:a},r),u=this.compileAndRun(c,[t],i);return u.shape[1]===1?u:this.reduce(u,r,i)},e.prototype.argReduce=function(t,r,i){i===void 0&&(i=null);var a=t.shape[0],s=t.shape[1];i!=null&&(a=i.shape[0],s=i.shape[1]);var o=yw(s),c=new ane({windowSize:o,inSize:s,batchSize:a},r,i==null),u=[t];i!=null&&u.push(i);var l=this.compileAndRun(c,u,"int32");return l.shape[1]===1?l:this.argReduce(t,r,l)},e.prototype.argReducePacked=function(t,r,i){i===void 0&&(i=null);var a=i!=null?i.shape:t.shape,s=yw(a[a.length-1]),o=new dne(a,s,r,i==null),c=i==null?[t]:[t,i],u=this.compileAndRun(o,c,"int32");return u.rank===t.rank?this.argReducePacked(t,r,u):u},e.prototype.sum=function(t,r){ds("sum",r,t.rank);var i=qi(t.shape,r),a=i[0],s=ct(i[1]),o=t.as2D(-1,s),c=lw(t.dtype);return this.reduce(o,"sum",c).reshape(a)},e.prototype.prod=function(t,r){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.prod(t,r);var i=qi(t.shape,r),a=i[0],s=ct(i[1]),o=t.as2D(-1,s),c=lw(t.dtype);return this.reduce(o,"prod",c).reshape(a)},e.prototype.unsortedSegmentSum=function(t,r,i){var a=0,s=ru([a],t.rank),o=t;s!=null&&(o=t.transpose(s),a=iu(1,t.rank)[0]);var c=function(p,g,v){for(var y=[],b=p.length,x=0;x<b;x++)x!==g?y.push(p[x]):y.push(v);return y}(o.shape,a,i),u=ct([o.shape[a]]),l=o.as2D(-1,u),d=lw(t.dtype),h=this.segOpCompute(l,"unsortedSegmentSum",r,d,i).reshape(c);return s!=null&&(h=h.transpose(lS(s))),h},e.prototype.segOpCompute=function(t,r,i,a,s){var o=t.shape[0],c=t.shape[1],u=function(h,p){var g,v=!1;for(h<=W5?(g=h,v=!0):g=ek(h,Math.floor(Math.sqrt(h)));!v;)g>p||g===h?v=!0:g=ek(h,g+1);return g}(c,s),l=new Pre({windowSize:u,inSize:c,batchSize:o,numSegments:s}),d=this.compileAndRun(l,[t,i],a);return d.shape[1]===s?d:(i=n_(0,s).tile([c/u]),this.segOpCompute(d,r,i,a,s))},e.prototype.argMinMaxReduce=function(t,r,i){var a=[r];if(ds("arg"+i.charAt(0).toUpperCase()+i.slice(1),a,t.rank),!ke().getBool("WEBGL_PACK_REDUCE")||t.rank<=2){var s=qi(t.shape,a),o=s[0],c=ct(s[1]),u=t.as2D(-1,c);return this.argReduce(u,i).reshape(o)}return this.argReducePacked(t,i)},e.prototype.argMin=function(t,r){return this.argMinMaxReduce(t,r,"min")},e.prototype.argMax=function(t,r){return this.argMinMaxReduce(t,r,"max")},e.prototype.cumsum=function(t,r,i,a){if(r!==t.rank-1)throw new Error("WebGL cumsum shader expects an inner-most axis="+(t.rank-1)+" but got axis="+r);var s=new Ine(t.shape,i,a);return this.compileAndRun(s,[t])},e.prototype.equal=function(t,r){if(ke().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,r,` 3558 return vec4(equal(a, b)); 3559`,"bool");var i=new wr("return float(a == b);",t.shape,r.shape);return this.compileAndRun(i,[t,r],"bool")},e.prototype.notEqual=function(t,r){if(ke().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,r,` 3560 return vec4(notEqual(a, b)); 3561`,"bool");var i=new wr("return float(a != b);",t.shape,r.shape);return this.compileAndRun(i,[t,r],"bool")},e.prototype.less=function(t,r){if(this.shouldExecuteOnCPU([t,r]))return this.cpuBackend.less(t,r);if(ke().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,r,` 3562 return vec4(lessThan(a, b)); 3563`,"bool");var i=new wr("return float(a < b);",t.shape,r.shape);return this.compileAndRun(i,[t,r],"bool")},e.prototype.lessEqual=function(t,r){if(ke().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,r,` 3564 return vec4(lessThanEqual(a, b)); 3565`,"bool");var i=new wr("return float(a <= b);",t.shape,r.shape);return this.compileAndRun(i,[t,r],"bool")},e.prototype.greater=function(t,r){if(this.shouldExecuteOnCPU([t,r]))return this.cpuBackend.greater(t,r);if(ke().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,r,` 3566 return vec4(greaterThan(a, b)); 3567`,"bool");var i=new wr("return float(a > b);",t.shape,r.shape);return this.compileAndRun(i,[t,r],"bool")},e.prototype.greaterEqual=function(t,r){if(ke().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,r,` 3568 return vec4(greaterThanEqual(a, b)); 3569`,"bool");var i=new wr("return float(a >= b);",t.shape,r.shape);return this.compileAndRun(i,[t,r],"bool")},e.prototype.logicalNot=function(t){var r=new $t(t.shape,"return float(!(x >= 1.0));");return this.compileAndRun(r,[t])},e.prototype.logicalAnd=function(t,r){if(ke().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,r,` 3570 return vec4( 3571 vec4(greaterThanEqual(a, vec4(1.0))) * 3572 vec4(greaterThanEqual(b, vec4(1.0)))); 3573`,"bool");var i=new wr("return float(a >= 1.0 && b >= 1.0);",t.shape,r.shape);return this.compileAndRun(i,[t,r],"bool")},e.prototype.logicalOr=function(t,r){if(ke().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,r,` 3574 return min( 3575 vec4(greaterThanEqual(a, vec4(1.0))) + 3576 vec4(greaterThanEqual(b, vec4(1.0))), 3577 vec4(1.0)); 3578`,"bool");var i=new wr("return float(a >= 1.0 || b >= 1.0);",t.shape,r.shape);return this.compileAndRun(i,[t,r],"bool")},e.prototype.select=function(t,r,i){var a=new Rre(t.rank,r.shape,r.rank);return this.compileAndRun(a,[t,r,i],Ei(r.dtype,i.dtype))},e.prototype.where=function(t){e_("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead");var r=t.dataSync();return yS(t.shape,r)},e.prototype.topk=function(t,r,i){return tN(t.dataSync(),t.shape,t.dtype,r)},e.prototype.min=function(t,r){ds("min",r,t.rank);var i=qi(t.shape,r),a=i[0],s=ct(i[1]),o=t.as2D(-1,s);return this.reduce(o,"min",o.dtype).reshape(a)},e.prototype.minimum=function(t,r){if(this.shouldExecuteOnCPU([t,r]))return this.cpuBackend.minimum(t,r);var i=ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Au(` 3579 vec4 result = vec4(min(a, b)); 3580 vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0)); 3581 3582 result.r = isNaN.r > 0. ? NAN : result.r; 3583 result.g = isNaN.g > 0. ? NAN : result.g; 3584 result.b = isNaN.b > 0. ? NAN : result.b; 3585 result.a = isNaN.a > 0. ? NAN : result.a; 3586 3587 return result; 3588`,t.shape,r.shape):new wr(` 3589 if (isnan(a)) return a; 3590 if (isnan(b)) return b; 3591 3592 return min(a, b); 3593`,t.shape,r.shape);return this.compileAndRun(i,[t,r])},e.prototype.mod=function(t,r){var i=ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Au(` 3594 vec4 result = mod(a, b); 3595 vec4 isNaN = vec4(equal(b, vec4(0.0))); 3596 3597 result.r = isNaN.r > 0. ? NAN : result.r; 3598 result.g = isNaN.g > 0. ? NAN : result.g; 3599 result.b = isNaN.b > 0. ? NAN : result.b; 3600 result.a = isNaN.a > 0. ? NAN : result.a; 3601 3602 return result; 3603`,t.shape,r.shape):new wr(`if (b == 0.0) return NAN; 3604 return mod(a, b);`,t.shape,r.shape);return this.compileAndRun(i,[t,r])},e.prototype.max=function(t,r){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.max(t,r);ds("max",r,t.rank);var i=qi(t.shape,r),a=i[0],s=ct(i[1]),o=t.as2D(-1,s);return this.reduce(o,"max",o.dtype).reshape(a)},e.prototype.maximum=function(t,r){if(this.shouldExecuteOnCPU([t,r]))return this.cpuBackend.maximum(t,r);var i=ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Au(` 3605 vec4 result = vec4(max(a, b)); 3606 vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0)); 3607 3608 result.r = isNaN.r > 0. ? NAN : result.r; 3609 result.g = isNaN.g > 0. ? NAN : result.g; 3610 result.b = isNaN.b > 0. ? NAN : result.b; 3611 result.a = isNaN.a > 0. ? NAN : result.a; 3612 3613 return result; 3614`,t.shape,r.shape):new wr(` 3615 if (isnan(a)) return a; 3616 if (isnan(b)) return b; 3617 3618 return max(a, b); 3619`,t.shape,r.shape);return this.compileAndRun(i,[t,r])},e.prototype.all=function(t,r){ds("all",r,t.rank);var i=qi(t.shape,r),a=i[0],s=ct(i[1]),o=t.as2D(-1,s);return this.reduce(o,"all",o.dtype).reshape(a)},e.prototype.any=function(t,r){ds("any",r,t.rank);var i=qi(t.shape,r),a=i[0],s=ct(i[1]),o=t.as2D(-1,s);return this.reduce(o,"any",o.dtype).reshape(a)},e.prototype.realDivide=function(t,r){if(ke().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,r,` 3620 // vec4 one = vec4(equal(a, b)); 3621 // return one + (vec4(1.0) - one) * a / b; 3622 vec4 result = a / b; 3623 if(a.x == b.x) { 3624 result.x = 1.; 3625 } 3626 if(a.y == b.y) { 3627 result.y = 1.; 3628 } 3629 if(a.z == b.z) { 3630 result.z = 1.; 3631 } 3632 if(a.w == b.w) { 3633 result.w = 1.; 3634 } 3635 3636 return result; 3637`,"float32",!0);var i=new wr(` 3638if (a == b) { 3639 return 1.0; 3640}; 3641return a / b;`,t.shape,r.shape);return this.compileAndRun(i,[t,r],"float32")},e.prototype.floorDiv=function(t,r){if(ke().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,r,` 3642 ivec4 ia = round(a); 3643 ivec4 ib = round(b); 3644 bvec4 cond = notEqual(ib, ivec4(0)); 3645 ivec4 result = ivec4(0); 3646 vec4 s = sign(a) * sign(b); 3647 3648 // Windows (D3D) wants guaranteed non-zero int division at compile-time. 3649 if (cond[0]) { 3650 result[0] = idiv(ia[0], ib[0], s[0]); 3651 } 3652 if (cond[1]) { 3653 result[1] = idiv(ia[1], ib[1], s[1]); 3654 } 3655 if (cond[2]) { 3656 result[2] = idiv(ia[2], ib[2], s[2]); 3657 } 3658 if (cond[3]) { 3659 result[3] = idiv(ia[3], ib[3], s[3]); 3660 } 3661 return vec4(result); 3662`,"int32");var i=new wr(` 3663 float s = sign(a) * sign(b); 3664 int ia = round(a); 3665 int ib = round(b); 3666 if (ib != 0) { 3667 // Windows (D3D) wants guaranteed non-zero int division at compile-time. 3668 return float(idiv(ia, ib, s)); 3669 } else { 3670 return NAN; 3671 } 3672`,t.shape,r.shape);return this.compileAndRun(i,[t,r],"int32")},e.prototype.add=function(t,r){if(t.dtype==="complex64"&&r.dtype==="complex64")return this.complexSeparableBinaryOp(t,r,_w);if(this.shouldExecuteOnCPU([t,r]))return this.cpuBackend.add(t,r);var i=Ei(t.dtype,r.dtype);if(ke().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,r,_w,i);var a=new wr(_w,t.shape,r.shape);return this.compileAndRun(a,[t,r],i)},e.prototype.packedUnaryOp=function(t,r,i){var a=new bm(t.shape,r);return this.compileAndRun(a,[t],i)},e.prototype.packedBinaryOp=function(t,r,i,a,s){s===void 0&&(s=!1);var o=new Au(i,t.shape,r.shape,s);return this.compileAndRun(o,[t,r],a)},e.prototype.complexSeparableBinaryOp=function(t,r,i){var a=this,s=this.texData.get(t.dataId),o=this.texData.get(r.dataId),c=[[s.complexTensors.real,o.complexTensors.real],[s.complexTensors.imag,o.complexTensors.imag]].map(function(h){var p=h[0],g=h[1],v=a.makeComplexComponentTensorInfo(t,p),y=a.makeComplexComponentTensorInfo(r,g),b=new wr(i,t.shape,r.shape);return a.compileAndRun(b,[v,y],Ei(p.dtype,g.dtype))}),u=c[0],l=c[1],d=this.complex(u,l);return u.dispose(),l.dispose(),d},e.prototype.makeComplexComponentTensorInfo=function(t,r){return{dataId:r.dataId,dtype:r.dtype,shape:t.shape}},e.prototype.addN=function(t){if(t.length===1)return t[0];if(t.length>ke().get("WEBGL_MAX_TEXTURES_IN_SHADER")){var r=Math.floor(t.length/2),i=this.addN(t.slice(0,r)),a=this.addN(t.slice(r));return this.addN([i,a])}var s=t.map(function(u){return u.dtype}).reduce(function(u,l){return Ei(u,l)}),o=t.map(function(u){return u.shape}),c=ke().getBool("WEBGL_PACK")?new ine(t[0].shape,o):new rne(t[0].shape,o);return this.compileAndRun(c,t,s)},e.prototype.subtract=function(t,r){if(t.dtype==="complex64"&&r.dtype==="complex64")return this.complexSeparableBinaryOp(t,r,bw);if(this.shouldExecuteOnCPU([t,r]))return this.cpuBackend.subtract(t,r);var i=Ei(t.dtype,r.dtype);if(ke().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,r,bw,t.dtype);var a=new wr(bw,t.shape,r.shape);return this.compileAndRun(a,[t,r],i)},e.prototype.pow=function(t,r){var i=ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Au(` 3673 // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise. 3674 vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1))); 3675 vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1); 3676 vec4 result = multiplier * pow(abs(a), b); 3677 3678 // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS 3679 bvec4 isExpZero = equal(b, vec4(0.0)); 3680 result.r = isExpZero.r ? 1.0 : result.r; 3681 result.g = isExpZero.g ? 1.0 : result.g; 3682 result.b = isExpZero.b ? 1.0 : result.b; 3683 result.a = isExpZero.a ? 1.0 : result.a; 3684 3685 vec4 isNaN = vec4(lessThan(a, vec4(0.0))) * vec4(lessThan(floor(b), b)); 3686 3687 result.r = isNaN.r > 0. ? NAN : result.r; 3688 result.g = isNaN.g > 0. ? NAN : result.g; 3689 result.b = isNaN.b > 0. ? NAN : result.b; 3690 result.a = isNaN.a > 0. ? NAN : result.a; 3691 3692 return result; 3693`,t.shape,r.shape):new wr(` 3694if(a < 0.0 && floor(b) < b){ 3695 return NAN; 3696} 3697if (b == 0.0) { 3698 return 1.0; 3699} 3700return (round(mod(b, 2.0)) != 1) ?
3701 pow(abs(a), b) : sign(a) * pow(abs(a), b); 3702`,t.shape,r.shape),a=Ei(t.dtype,r.dtype);return this.compileAndRun(i,[t,r],a)},e.prototype.ceil=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.ceil(t);if(ke().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,I4,t.dtype);var r=new $t(t.shape,I4);return this.compileAndRun(r,[t])},e.prototype.floor=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.floor(t);if(ke().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,O4,t.dtype);var r=new $t(t.shape,O4);return this.compileAndRun(r,[t])},e.prototype.sign=function(t){var r=new $t(t.shape,` 3703 if (isnan(x)) { return 0.0; } 3704 return sign(x); 3705`);return this.compileAndRun(r,[t])},e.prototype.isNaN=function(t){var r=new $t(t.shape,"return float(isnan(x));");return this.compileAndRun(r,[t],"bool")},e.prototype.isInf=function(t){var r=new $t(t.shape,"return float(isinf(x));");return this.compileAndRun(r,[t],"bool")},e.prototype.isFinite=function(t){var r=new $t(t.shape,"return float(!isnan(x) && !isinf(x));");return this.compileAndRun(r,[t],"bool")},e.prototype.round=function(t){var r=new $t(t.shape,` 3706 // OpenGL ES does not support round function. 3707 // The algorithm is based on banker's rounding. 3708 float base = floor(x); 3709 if ((x - base) < 0.5) { 3710 return floor(x); 3711 } else if ((x - base) > 0.5) { 3712 return ceil(x); 3713 } else { 3714 if (mod(base, 2.0) == 0.0) { 3715 return base; 3716 } else { 3717 return base + 1.0; 3718 } 3719 } 3720`);return this.compileAndRun(r,[t])},e.prototype.exp=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.exp(t);if(ke().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,M4,t.dtype);var r=new $t(t.shape,M4);return this.compileAndRun(r,[t])},e.prototype.expm1=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.expm1(t);if(ke().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,D4,t.dtype);var r=new $t(t.shape,D4);return this.compileAndRun(r,[t])},e.prototype.softmax=function(t,r){var i=ui([r],t.shape),a=this.max(t,i),s=za(a.shape,i),o=this.subtract(t,a.reshape(s)),c=this.exp(o),u=this.sum(c,i).reshape(s);return this.realDivide(c,u)},e.prototype.log=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.log(t);if(ke().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,` 3721 vec4 result = log(x); 3722 vec4 isNaN = vec4(lessThan(x, vec4(0.0))); 3723 result.r = isNaN.r == 1.0 ? NAN : result.r; 3724 result.g = isNaN.g == 1.0 ? NAN : result.g; 3725 result.b = isNaN.b == 1.0 ? NAN : result.b; 3726 result.a = isNaN.a == 1.0 ? NAN : result.a; 3727 3728 return result; 3729`,t.dtype);var r=new $t(t.shape,`if (x < 0.0) return NAN; 3730 return log(x);`);return this.compileAndRun(r,[t])},e.prototype.log1p=function(t){var r=new $t(t.shape,"return log(1.0 + x);");return this.compileAndRun(r,[t])},e.prototype.sqrt=function(t){var r=new $t(t.shape,"return sqrt(x);");return this.compileAndRun(r,[t])},e.prototype.rsqrt=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.rsqrt(t);var r=new $t(t.shape,"return inversesqrt(x);");return this.compileAndRun(r,[t])},e.prototype.reciprocal=function(t){var r=new $t(t.shape,"return 1.0 / x;");return this.compileAndRun(r,[t])},e.prototype.relu=function(t){var r;return r=ke().getBool("WEBGL_PACK")?new bm(t.shape,lN):new $t(t.shape,oN),this.compileAndRun(r,[t])},e.prototype.relu6=function(t){var r;return r=ke().getBool("WEBGL_PACK")?new bm(t.shape,dN):new $t(t.shape,cN),this.compileAndRun(r,[t])},e.prototype.prelu=function(t,r){var i=ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Au(sN,t.shape,r.shape):new wr(aN,t.shape,r.shape);return this.compileAndRun(i,[t,r])},e.prototype.elu=function(t){if(ke().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,fN,t.dtype);var r=new $t(t.shape,uN);return this.compileAndRun(r,[t])},e.prototype.eluDer=function(t,r){var i=ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Au(` 3731 vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));
3732 return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0)))); 3733`,t.shape,r.shape):new wr("return (b >= 1.0) ? a : a * (b + 1.0);",t.shape,r.shape);return this.compileAndRun(i,[t,r])},e.prototype.selu=function(t){var r=new $t(t.shape,$re);return this.compileAndRun(r,[t])},e.prototype.int=function(t){var r=new $t(t.shape,"return float(int(x));");return this.compileAndRun(r,[t],"int32")},e.prototype.clip=function(t,r,i){var a,s=(a=ke().getBool("WEBGL_PACK_CLIP")?new _ne(t.shape):new yne(t.shape)).getCustomSetupFunc(r,i);return this.compileAndRun(a,[t],null,s)},e.prototype.abs=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.abs(t);if(ke().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,R4,t.dtype);var r=new $t(t.shape,R4);return this.compileAndRun(r,[t])},e.prototype.complexAbs=function(t){var r=this.texData.get(t.dataId),i=new bne(t.shape),a=[this.makeComplexComponentTensorInfo(t,r.complexTensors.real),this.makeComplexComponentTensorInfo(t,r.complexTensors.imag)];return this.compileAndRun(i,a)},e.prototype.sigmoid=function(t){var r=new $t(t.shape,"return 1.0 / (1.0 + exp(-1.0 * x));");return this.compileAndRun(r,[t])},e.prototype.softplus=function(t){var r=new $t(t.shape,` 3734 float epsilon = 1.1920928955078125e-7; 3735 float threshold = log(epsilon) + 2.0; 3736 3737 bool too_large = x > -threshold; 3738 bool too_small = x < threshold; 3739 3740 float result; 3741 float exp_x = exp(x); 3742 3743 if (too_large){ 3744 result = x; 3745 } 3746 else if (too_small){ 3747 result = exp_x; 3748 } 3749 else{ 3750 result = log(exp_x + 1.0); 3751 } 3752 return result; 3753`);return this.compileAndRun(r,[t])},e.prototype.sin=function(t){var r=new $t(t.shape,Bre);return this.compileAndRun(r,[t])},e.prototype.cos=function(t){var r=new $t(t.shape,Ure);return this.compileAndRun(r,[t])},e.prototype.tan=function(t){var r=new $t(t.shape,"return tan(x);");return this.compileAndRun(r,[t])},e.prototype.asin=function(t){var r=new $t(t.shape,jre);return this.compileAndRun(r,[t])},e.prototype.acos=function(t){var r=new $t(t.shape,qre);return this.compileAndRun(r,[t])},e.prototype.atan=function(t){var r=new $t(t.shape,zre);return this.compileAndRun(r,[t])},e.prototype.atan2=function(t,r){var i=ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Au(` 3754 vec4 result = atan(a, b); 3755 vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0)); 3756 3757 result.r = isNaN.r > 0. ? NAN : result.r; 3758 result.g = isNaN.g > 0. ? NAN : result.g; 3759 result.b = isNaN.b > 0. ? NAN : result.b; 3760 result.a = isNaN.a > 0. ? NAN : result.a; 3761 3762 return result; 3763`,t.shape,r.shape):new wr(` 3764 if (isnan(a)) return a; 3765 if (isnan(b)) return b; 3766 3767 return atan(a, b); 3768`,t.shape,r.shape);return this.compileAndRun(i,[t,r])},e.prototype.sinh=function(t){var r=new $t(t.shape,` 3769 float e2x = exp(x); 3770 return (e2x - 1.0 / e2x) / 2.0; 3771`);return this.compileAndRun(r,[t])},e.prototype.cosh=function(t){var r=new $t(t.shape,` 3772 float e2x = exp(-x); 3773 return (e2x + 1.0 / e2x) / 2.0; 3774`);return this.compileAndRun(r,[t])},e.prototype.tanh=function(t){var r=new $t(t.shape,` 3775 float e2x = exp(-2.0 * abs(x)); 3776 return sign(x) * (1.0 - e2x) / (1.0 + e2x); 3777`);return this.compileAndRun(r,[t])},e.prototype.asinh=function(t){var r=new $t(t.shape,Wre);return this.compileAndRun(r,[t])},e.prototype.acosh=function(t){var r=new $t(t.shape,Hre);return this.compileAndRun(r,[t])},e.prototype.atanh=function(t){var r=new $t(t.shape,Vre);return this.compileAndRun(r,[t])},e.prototype.erf=function(t){var r=new $t(t.shape,` 3778 // Error function is calculated approximately with elementary function. 3779 // See "Handbook of Mathematical Functions with Formulas, 3780 // Graphs, and Mathematical Tables", Abramowitz and Stegun. 3781 float p = 0.3275911; 3782 float a1 = 0.254829592; 3783 float a2 = -0.284496736; 3784 float a3 = 1.421413741; 3785 float a4 = -1.453152027; 3786 float a5 = 1.061405429; 3787 3788 float sign = sign(x); 3789 x = abs(x); 3790 float t = 1.0 / (1.0 + p * x); 3791 return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x)); 3792`);return this.compileAndRun(r,[t])},e.prototype.step=function(t,r){var i=new $t(t.shape,function(a){return a===void 0&&(a=0),cc+` 3793 return x > 0.0 ? 1.0 : float(`+a+`); 3794 `}(r));return this.compileAndRun(i,[t])},e.prototype.conv2dByMatMul=function(t,r,i,a,s,o){var c=t.shape,u=this.texData.get(t.dataId),l=i.inChannels,d=c[0]*c[1]*c[2],h=i.outChannels,p=i.dataFormat==="channelsLast",g=(d===1||h===1)&&l>1e3,v=c[2]%2!=0&&!!u.isPacked;if(g||!ke().getBool("WEBGL_LAZILY_UNPACK")||!ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")||!v){var y=p?c[0]*c[1]*c[2]:c[0]*c[2]*c[3],b=this.reshape(t,[1,y,i.inChannels]),x=this.reshape(r,[1,i.inChannels,i.outChannels]);return this.reshape(this.fusedBatchMatMul({a:b,b:x,transposeA:!1,transposeB:!1,bias:a,activation:s,preluActivationWeights:o}),i.outShape)}var S=p?c[0]*c[1]*(c[2]+1):c[0]*c[2]*(c[3]+1),w={dataId:t.dataId,shape:[1,S,i.inChannels],dtype:t.dtype},k=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,J(E0(u.shape,w.shape),function(){return"packed reshape "+u.shape+" to "+w.shape+" isn't free"});var E=this.reshape(r,[1,i.inChannels,i.outChannels]),I=this.fusedBatchMatMul({a:w,b:E,transposeA:!1,transposeB:!1,bias:a,activation:s,preluActivationWeights:o}),P=this.texData.get(I.dataId);return J(P.isPacked,function(){return"batchMatMul result is expected to be packed"}),u.shape=k,P.shape=i.outShape,ce.makeTensorFromDataId(I.dataId,i.outShape,I.dtype)},e.prototype.conv2dWithIm2Row=function(t,r,i,a,s,o){var c=i.filterWidth,u=i.filterHeight,l=i.inChannels,d=i.outWidth,h=i.outHeight,p=i.dataFormat==="channelsLast",g=c*u*l,v=h*d,y=[g,v],b=t.squeeze([0]),x=r.reshape([1,g,-1]),S=new cre(y,b.shape,i),w=this.compileAndRun(S,[b]).reshape([1,y[0],y[1]]),k=a!=null,E=o!=null,I=s?I0(s,!0):null,P=new xw(w.shape,[1,v,i.outChannels],!0,!1,k,I,E),A=[w,x];a&&A.push(a),E&&A.push(o);var N=this.compileAndRun(P,A);return p?N.reshape([1,h,d,i.outChannels]):N.reshape([1,i.outChannels,h,d])},e.prototype.fusedConv2d=function(t){var r=t.input,i=t.filter,a=t.convInfo,s=t.bias,o=t.activation,c=t.preluActivationWeights;if(a.filterHeight===1&&a.filterWidth===1&&a.dilationHeight===1&&a.dilationWidth===1&&a.strideHeight===1&&a.strideWidth===1&&(a.padInfo.type==="SAME"||a.padInfo.type==="VALID"))return this.conv2dByMatMul(r,i,a,s,o,c);if(ke().getBool("WEBGL_CONV_IM2COL")&&r.shape[0]===1)return this.conv2dWithIm2Row(r,i,a,s,o,c);var u=s!=null,l=c!=null,d=o?I0(o,!1):null,h=new b4(a,u,d,l),p=[r,i];return s&&p.push(s),c&&p.push(c),this.compileAndRun(h,p)},e.prototype.conv2d=function(t,r,i){if(i.filterHeight===1&&i.filterWidth===1&&i.dilationHeight===1&&i.dilationWidth===1&&i.strideHeight===1&&i.strideWidth===1&&(i.padInfo.type==="SAME"||i.padInfo.type==="VALID"))return this.conv2dByMatMul(t,r,i);if(ke().getBool("WEBGL_CONV_IM2COL")&&t.shape[0]===1)return this.conv2dWithIm2Row(t,r,i);var a=new b4(i);return this.compileAndRun(a,[t,r])}
vendor: 4,806 bytes, line 3794
3794,e.prototype.conv2dDerInput=function(t,r,i){var a=new kne(i);return this.compileAndRun(a,[t,r])},e.prototype.conv2dDerFilter=function(t,r,i){var a=new Cne(i);return this.compileAndRun(a,[t,r])},e.prototype.fusedDepthwiseConv2D=function(t){var r,i=t.input,a=t.filter,s=t.convInfo,o=t.bias,c=t.activation,u=t.preluActivationWeights,l=ke().getBool("WEBGL_PACK_DEPTHWISECONV")&&s.strideWidth<=2&&s.outChannels/s.inChannels==1,d=c?I0(c,l):null,h=[i,a],p=o!=null,g=u!=null;return p&&h.push(o),g&&h.push(u),l?(r=new w4(s,p,d,g),this.compileAndRun(r,h)):(r=new x4(s,p,d,g),this.compileAndRun(r,h))},e.prototype.depthwiseConv2D=function(t,r,i){var a;return ke().getBool("WEBGL_PACK_DEPTHWISECONV")&&i.strideWidth<=2&&i.outChannels/i.inChannels==1?(a=new w4(i),this.compileAndRun(a,[t,r])):(a=new x4(i),this.compileAndRun(a,[t,r]))},e.prototype.depthwiseConv2DDerInput=function(t,r,i){var a=new Pne(i);return this.compileAndRun(a,[t,r])},e.prototype.depthwiseConv2DDerFilter=function(t,r,i){var a=new Ene(i);return this.compileAndRun(a,[t,r])},e.prototype.conv3d=function(t,r,i){var a=new Rne(i);return this.compileAndRun(a,[t,r])},e.prototype.conv3dDerInput=function(t,r,i){var a=new Tne(i);return this.compileAndRun(a,[t,r])},e.prototype.conv3dDerFilter=function(t,r,i){var a=new Sne(i);return this.compileAndRun(a,[t,r])},e.prototype.maxPool=function(t,r){var i=new ww(r,"max",!1);return this.compileAndRun(i,[t])},e.prototype.avgPool=function(t,r){var i=new ww(r,"avg",!1);return this.compileAndRun(i,[t],"float32")},e.prototype.maxPoolBackprop=function(t,r,i,a){var s=new ww(a,"max",!0),o=this.compileAndRun(s,[r]),c=new fre(a),u=this.compileAndRun(c,[t,o],r.dtype);return o.dispose(),u},e.prototype.avgPoolBackprop=function(t,r,i){var a=new fne(i);return this.compileAndRun(a,[t],r.dtype)},e.prototype.cast=function(t,r){return X5(t,r,this)},e.prototype.unstack=function(t,r){for(var i=t.shape[r],a=new Array(t.rank-1),s=0,o=0;o<t.rank;o++)o!==r&&(a[s++]=t.shape[o]);var c=new Array(t.rank).fill(0),u=t.shape.slice();u[r]=1;var l=new Array(i);for(o=0;o<l.length;o++)c[r]=o,l[o]=this.slice(t,c,u).reshape(a);return l},e.prototype.avgPool3d=function(t,r){var i=new Cw(r,"avg",!1);return this.compileAndRun(i,[t],"float32")},e.prototype.avgPool3dBackprop=function(t,r,i){var a=new hne(i);return this.compileAndRun(a,[t],r.dtype)},e.prototype.maxPool3d=function(t,r){var i=new Cw(r,"max",!1);return this.compileAndRun(i,[t],"float32")},e.prototype.maxPool3dBackprop=function(t,r,i,a){var s=new Cw(a,"max",!0),o=this.compileAndRun(s,[r]),c=new hre(a),u=this.compileAndRun(c,[t,o],r.dtype);return o.dispose(),u},e.prototype.reshape=function(t,r){var i=this.texData.get(t.dataId);if(i.isPacked&&!E0(t.shape,r)&&(i.texture===null||!E0(i.shape,r))){var a=this.packedReshape(t,r);return ce.makeTensorFromDataId(a.dataId,a.shape,a.dtype)}return ck(t,r)},e.prototype.resizeBilinear=function(t,r,i,a){var s=ke().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new Cre(t.shape,r,i,a):new wre(t.shape,r,i,a);return this.compileAndRun(s,[t],"float32")},e.prototype.resizeBilinearBackprop=function(t,r,i){var a=new xre(t,r,i);return this.compileAndRun(a,[t])},e.prototype.resizeNearestNeighbor=function(t,r,i,a){var s=new Sre(t.shape,r,i,a);return this.compileAndRun(s,[t])},e.prototype.resizeNearestNeighborBackprop=function(t,r,i){var a=new kre(t,r,i);return this.compileAndRun(a,[t])},e.prototype.multinomial=function(t,r,i,a){var s=r?t:tl(t),o=s.shape[0],c=s.shape[1],u=new pre(o,c,i),l=u.getCustomSetupFunc(a);return this.compileAndRun(u,[s],"int32",l)},e.prototype.oneHot=function(t,r,i,a){var s=new mre(t.size,r,i,a);return this.compileAndRun(s,[t])},e.prototype.diag=function(t){var r=new Nne(t.size);return this.compileAndRun(r,[t])},e.prototype.nonMaxSuppression=function(t,r,i,a,s){return e_("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"),gS(t.dataSync(),r.dataSync(),i,a,s)},e.prototype.cropAndResize=function(t,r,i,a,s,o){var c=new Ane(t.shape,r.shape,a,s,o);return this.compileAndRun(c,[t,r,i],"float32")},e.prototype.depthToSpace=function(t,r,i){J(r>1,function(){return"blockSize should be > 1 for depthToSpace, but was: "+r});var a=t.shape[0],s=i==="NHWC"?t.shape[1]:t.shape[2],o=i==="NHWC"?t.shape[2]:t.shape[3],c=i==="NHWC"?t.shape[3]:t.shape[1],u=s*r,l=o*r,d=c/(r*r),h=new Dne(i==="NHWC"?[a,u,l,d]:[a,d,u,l],r,i);return this.compileAndRun(h,[t])},e.prototype.split=function(t,r,i){return Z5(t,r,i)},e.prototype.scatterND=function(t,r,i){var a=s_(0,t,i),s=a.sliceRank,o=a.numUpdates,c=a.sliceSize,u=a.strides,l=a.outputSize,d=[l/c,c],h=t.reshape([o,s]),p=r.reshape([o,c]);if(l===0)return ck(Pi([]),i);var g=Ke(0),v=new T4(o,s,h.rank,p.rank,u,d);return this.compileAndRun(v,[p,h,g]).reshape(i)},e.prototype.sparseToDense=function(t,r,i,a){var s=s_(0,t,i),o=s.sliceRank,
3794c=s.numUpdates,u=s.strides,l=s.outputSize,d=new T4(c,o,t.rank,r.rank,u,[l,1]);return this.compileAndRun(d,[r,t,a]).reshape(i)},e.prototype.fft=function(t){return this.fftImpl(t,!1)},e.prototype.ifft=function(t){return this.fftImpl(t,!0)},e.prototype.fftImpl=function(t,r){var i=this.texData.get(t.dataId),a=new k4(Une,t.shape,r),s=new k4(jne,t.shape,r),o=[this.makeComplexComponentTensorInfo(t,i.complexTensors.real),this.makeComplexComponentTensorInfo(t,i.complexTensors.imag)],c=this.compileAndRun(a,o),u=this.compileAndRun(s,o),l=this.complex(c,u).as2D(t.shape[0],t.shape[1]);return c.dispose(),u.dispose(),l},e.prototype.gatherND=function(t,r){var i=r.shape,a=i[i.length-1],s=z5(t,r),o=s[0],c=s[1],u=s[2],l=s[3],d=r.reshape([c,a]),h=t.reshape([t.size/u,u]),p=new Wne(a,l,[c,u]);return this.compileAndRun(p,[h,d]).reshape(o)},e.prototype.fill=function(t,r,i){if((i=i||rv(r))==="string"){var a=Xy(i,ct(t));return a.fill(r),ce.makeTensor(a,t,i,this)}var s=new qne(t,r),o=s.getCustomSetupFunc(r);return this.compileAndRun(s,[],i,o)},e.prototype.onesLike=function(t){if(t.dtype==="string")throw new Error("onesLike is not supported under string dtype");return this.fill(t.shape,1,t.dtype)},e.prototype.zerosLike=function(t){return this.fill(t.shape,t.dtype==="string"?"":0,t.dtype)},e.prototype.linspace=function(t,r,i){return J5(t,r,i)},e.prototype.makeTensorInfo=function(t,r){var i=this.write(null,t,r);return this.texData.get(i).usage=null,{dataId:i,shape:t,dtype:r}},e.prototype.makeOutput=function(t,r){var i=this.makeTensorInfo(t,r).dataId;return ce.makeTensorFromDataId(i,t,r,this)},e.prototype.unpackTensor=function(t){var r=new Kre(t.shape);return this.runWebGLProgram(r,[t],t.dtype)},e.prototype.packTensor=function(t){var r=new gre(t.shape);return this.runWebGLProgram(r,[t],t.dtype,null,!0)},e.prototype.packedReshape=function(t,r){var i=[Qy(t.shape)].concat(Zy(t.shape)),a={dtype:t.dtype,shape:i,dataId:t.dataId},s=[Qy(r)].concat(Zy(r)),o=new bre(s,i),c=this.runWebGLProgram(o,[a],t.dtype,null,!0);return{dataId:c.dataId,shape:r,dtype:c.dtype}},e.prototype.decode=function(t){var r,i=this.texData.get(t),a=i.isPacked,s=i.shape,o=i.dtype,c=vw(s);return r=a?new Mne(c):new One(c),{dtype:o,shape:s,dataId:this.runWebGLProgram(r,[{shape:c,dtype:o,dataId:t}],o,null,!0).dataId}},e.prototype.runWebGLProgram=function(t,r,i,a,s){var o=this;s===void 0&&(s=!1);var c=this.makeTensorInfo(t.outputShape,i),u=this.texData.get(c.dataId);if(t.packedOutput&&(u.isPacked=!0),t.outPackingScheme===wg.DENSE){var l=Km(t.outputShape);u.texShape=l.map(function(S){return 2*S})}if(t.outTexUsage!=null&&(u.usage=t.outTexUsage),ct(c.shape)===0)return u.values=bg(c.dtype,0),c;var d=[],h=r.map(function(S){if(S.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");var w=o.texData.get(S.dataId);if(w.texture==null){if(!t.packedInputs&&ct(S.shape)<=ke().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:S.shape,texData:null,isUniform:!0,uniformValues:w.values};t.packedInputs&&(w.isPacked=!0,w.shape=S.shape)}else if(!!w.isPacked!=!!t.packedInputs)S=w.isPacked?o.unpackTensor(S):o.packTensor(S),d.push(S),w=o.texData.get(S.dataId);else if(w.isPacked&&!E0(w.shape,S.shape)){var k=S,E=S.shape;S.shape=w.shape,S=o.packedReshape(S,E),d.push(S),w=o.texData.get(S.dataId),k.shape=E}return o.uploadToGPU(S.dataId),{shape:S.shape,texData:w,isUniform:!1}});this.uploadToGPU(c.dataId);var p,g={shape:c.shape,texData:u,isUniform:!1},v=function(S,w,k){var E="";w.concat(k).forEach(function(A){var N=A.texData!=null&&A.texData.slice!=null&&A.texData.slice.flatOffset>0,j=A.isUniform?"uniform":A.texData.texShape;E+=A.shape+"_"+j+"_"+N});var I=S.userCode,P=S.constructor.name;return P+="_"+E+"_"+I}(t,h,g),y=this.getAndSaveBinary(v,function(){return function(S,w,k,E){var I=w.userCode,P=k.map(function(ie,de){var ue={logicalShape:ie.shape,texShape:ie.isUniform?null:ie.texData.texShape,isUniform:ie.isUniform,isPacked:!ie.isUniform&&ie.texData.isPacked,flatOffset:null};return ie.texData!=null&&ie.texData.slice!=null&&ie.texData.slice.flatOffset>0&&(ue.flatOffset=ie.texData.slice.flatOffset),{name:w.variableNames[de],shapeInfo:ue}}),A=P.map(function(ie){return ie.shapeInfo}),N={logicalShape:E.shape,texShape:E.texData.texShape,isUniform:!1,isPacked:E.texData.isPacked,flatOffset:null},j=sne(P,N,I,w.packedInputs),L=S.createProgram(j),B=null,V=S.getUniformLocation(L,"NAN",!1);ke().getNumber("WEBGL_VERSION")===1&&(B=S.getUniformLocation(L,"INFINITY",!1));for(var X={},ne=0;ne<w.variableNames.length;ne++){var se=w.variableNames[ne];X[se]=S.getUniformLocation(L,se,!1),X["offset"+se]=S.getUniformLocation(L,"offset"+se,!1)}return{program:w,source:j,webGLProgram:L,uniformLocations:X,inShapeInfos:A,outShapeInfo:N,infLoc:B,nanLoc:V}}(o.gpgpu,t,h,g)}),b=this.activeTimers!=null;if(b&&(p=this.startTimer()),function(S,w,k,E,I){S4(w.inShapeInfos,k),S4([w.outShapeInfo],[E]);var P=E.texData.texture,A=E.texData.texShape;E.texData.isPacked?S.setOutputPackedMatrixTexture(P,A[0],A[1]):S.setOutputMatrixTexture(P,A[0],A[1]),S.setProgram(w.webGLProgram),ke().getNumber("WEBGL_VERSION")===1&&w.infLoc!==null&&S.gl.uniform1f(w.infLoc,1/0),w.nanLoc!==null&&S.gl.uniform1f(w.nanLoc,NaN),k.forEac
3794h(function(N,j){var L=w.program.variableNames[j],B=w.uniformLocations[L],V=w.uniformLocations["offset"+L];if(B!=null)if(N.isUniform)if(ct(N.shape)<2)S.gl.uniform1f(B,N.uniformValues[0]);else{var X=N.uniformValues;X instanceof Float32Array||(X=new Float32Array(X)),S.gl.uniform1fv(B,X)}else N.texData.slice!=null&&V!=null&&S.gl.uniform1i(V,N.texData.slice.flatOffset),S.setInputMatrixTexture(N.texData.texture,B,j)}),I!=null&&I(S,w.webGLProgram),S.executeProgram()}(this.gpgpu,y,h,g,a),d.forEach(function(S){return o.disposeData(S.dataId)}),b&&(p=this.endTimer(p),this.activeTimers.push({name:t.constructor.name,query:this.getQueryTime(p)})),!ke().getBool("WEBGL_LAZILY_UNPACK")&&u.isPacked&&s===!1){var x=this.unpackTensor(c);return this.disposeData(c.dataId),x}return c},e.prototype.compileAndRun=function(t,r,i,a,s){s===void 0&&(s=!1),i=i||r[0].dtype;var o=this.runWebGLProgram(t,r,i,a,s);return ce.makeTensorFromDataId(o.dataId,o.shape,o.dtype)},e.prototype.getAndSaveBinary=function(t,r){return t in this.binaryCache||(this.binaryCache[t]=r()),this.binaryCache[t]},e.prototype.getTextureManager=function(){return this.textureManager},e.prototype.dispose=function(){var t=this;this.disposed||(ke().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(function(r){t.gpgpu.deleteProgram(t.binaryCache[r].webGLProgram),delete t.binaryCache[r]}),this.textureManager.dispose(),this.canvas!=null&&typeof HTMLCanvasElement<"u"&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)},e.prototype.floatPrecision=function(){var t=this;return this.floatPrecisionValue==null&&(this.floatPrecisionValue=Ze(function(){if(!ke().get("WEBGL_RENDER_FLOAT32_ENABLED")){var r=ke().getBool("DEBUG");ke().set("DEBUG",!1);var i=t.abs(Ke(1e-8)).dataSync()[0];if(ke().set("DEBUG",r),i>0)return 32}return 16})),this.floatPrecisionValue},e.prototype.epsilon=function(){return this.floatPrecision()===32?1e-7:1e-4},e.prototype.uploadToGPU=function(t){var r,i=this.texData.get(t),a=i.shape,s=i.dtype,o=i.values,c=i.texture,u=i.usage,l=i.isPacked;if(c==null){var d,h=this.activeTimers!=null;h&&(d=Oc());var p=i.texShape;if(p==null&&(p=nte(a,l),i.texShape=p),o!=null){var g=vw(a),v=void 0,y=p[1],b=p[0],x=o instanceof Uint8Array;l?(y=(r=av(p[0],p[1]))[0],b=r[1],v=new Bne(g,[b,y],x)):v=new $ne(g,[b,y],x);var S=this.makeTensorInfo([b,y],s);this.texData.get(S.dataId).usage=x?vs.PIXELS:vs.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(S.dataId),y,b,o);var w=this.runWebGLProgram(v,[S],s,null,!0),k=this.texData.get(w.dataId);i.texture=k.texture,i.texShape=k.texShape,i.isPacked=k.isPacked,i.usage=k.usage,this.disposeData(S.dataId),this.texData.delete(w.dataId),i.values=null,h&&(this.uploadWaitMs+=Oc()-d)}else{var E=this.acquireTexture(p,u,s,l);i.texture=E}}},e.prototype.convertAndCacheOnCPU=function(t,r){var i=this.texData.get(t),a=i.dtype;return this.releaseGPUData(t),r!=null&&(i.values=function(s,o){if(o==="float32"||o==="complex64")return s;if(o==="int32"||o==="bool"){for(var c=o==="int32"?new Int32Array(s.length):new Uint8Array(s.length),u=0;u<c.length;++u)c[u]=Math.round(s[u]);return c}throw new Error("Unknown dtype "+o)}(r,a)),i.values},e.prototype.acquireTexture=function(t,r,i,a){if(this.numBytesInGPU+=this.computeBytes(t,i),!this.warnedAboutMemory&&this.numBytesInGPU>1024*this.numMBBeforeWarning*1024){var s=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn("High memory usage in GPU: "+s+" MB, most likely due to a memory leak")}return this.textureManager.acquireTexture(t,r,a)},e.prototype.computeBytes=function(t,r){return t[0]*t[1]*S5(r)},e}(K5);O5()&&ce.registerBackend("webgl",function(){return new Xre},2);
vendor: 7,693 bytes, line 3794
3794var Jre=re({square_:function(n){var e=G(n,"x","square"),t=[e];return ce.runKernelFunc(function(r,i){return i([e]),r.square(e)},{x:e},null,"Square",{},t,[])}}),kg="SquaredDifference",hN=re({squaredDifference_:function(n,e){var t,r=G(n,"a","squaredDifference"),i=G(e,"b","squaredDifference");t=yr(r,i),r=t[0],i=t[1],tn(r.shape,i.shape);var a={a:r,b:i},s=[r,i];return ce.runKernelFunc(function(o,c){var u=o.squaredDifference(r,i);return c([r,i]),u},a,function(o,c){var u=c[0],l=c[1],d=Ke(2);return{a:function(){return o.mul(u.sub(l).mul(d))},b:function(){return o.mul(l.sub(u).mul(d))}}},kg,{},s,[])}}),Qre=re({abs_:function(n){var e=G(n,"x","abs");return e.dtype==="complex64"?ce.runKernelFunc(function(t){return t.complexAbs(e)},{$x:e}):ce.runKernelFunc(function(t,r){var i=t.abs(e);return r([e]),i},{x:e},function(t,r){var i=r[0];return{x:function(){return t.mul(i.toFloat().step(-1))}}},"Abs")}}),Zre=re({acos_:function(n){var e=G(n,"x","acos");return ce.runKernelFunc(function(t,r){var i=t.acos(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.divStrict(Ke(1).sub(i.toFloat().square()).sqrt()).neg()}}})}}),eie=re({acosh_:function(n){var e=G(n,"x","acosh");return ce.runKernelFunc(function(t,r){var i=t.acosh(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.divStrict(i.toFloat().square().sub(1).sqrt())}}})}}),tie=re({asin_:function(n){var e=G(n,"x","asin");return ce.runKernelFunc(function(t,r){var i=t.asin(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.divStrict(Ke(1).sub(i.toFloat().square()).sqrt())}}})}}),nie=re({asinh_:function(n){var e=G(n,"x","asinh");return ce.runKernelFunc(function(t,r){var i=t.asinh(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.divStrict(Ke(1).add(i.toFloat().square()).sqrt())}}})}}),rie=re({atan_:function(n){var e=G(n,"x","atan");return ce.runKernelFunc(function(t,r){var i=t.atan(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.div(i.toFloat().square().add(1))}}})}}),iie=re({atanh_:function(n){var e=G(n,"x","atanh");return ce.runKernelFunc(function(t,r){var i=t.atanh(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.div(Ke(1).sub(i.toFloat().square()))}}})}}),aie=re({ceil_:function(n){var e=G(n,"x","ceil");return ce.runKernelFunc(function(t){return t.ceil(e)},{$x:e},function(t){return{$x:function(){return dn(t)}}})}}),wS=re({clipByValue_:function(n,e,t){var r=G(n,"x","clipByValue");J(e<=t,function(){return"Error in clip: min ("+e+") must be less than or equal to max ("+t+")."});var i=[r],a={min:e,max:t};return ce.runKernelFunc(function(s,o){var c=s.clip(r,e,t);return o([r]),c},{x:r},function(s,o){var c=o[0];return{x:function(){return s.where(c.greaterEqual(e).logicalAnd(c.lessEqual(t)),dn(s))}}},"ClipByValue",a,i)}}),sie=re({cos_:function(n){var e=G(n,"x","cos"),t=[e];return ce.runKernelFunc(function(r,i){var a=r.cos(e);return i([e]),a},{x:e},function(r,i){var a=i[0];return{x:function(){return a.toFloat().sin().neg().mul(r)}}},"Cos",{},t)}}),oie=re({cosh_:function(n){var e=G(n,"x","cosh");return ce.runKernelFunc(function(t,r){var i=t.cosh(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return i.toFloat().sinh().mulStrict(t)}}})}}),cie=re({erf_:function(n){var e=G(n,"x","erf");return J(e.dtype==="int32"||e.dtype==="float32",function(){return"Input dtype must be `int32` or `float32`."}),e.dtype==="int32"&&(e=e.toFloat()),ce.runKernelFunc(function(t,r){var i=t.erf(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.mul(i.square().neg().exp().mul(2/Math.sqrt(Math.PI)))}}})}}),lk=re({exp_:function(n){var e=G(n,"x","exp");return ce.runKernelFunc(function(t,r){var i=t.exp(e);return r([i]),i},{x:e},function(t,r){return{x:function(){return t.mulStrict(r[0])}}},"Exp",{},[],[!0])}}),uie=re({expm1_:function(n){var e=G(n,"x","expm1");return ce.runKernelFunc(function(t,r){var i=t.expm1(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.mul(i.exp())}}})}}),lie=re({floor_:function(n){var e=G(n,"x","floor");return ce.runKernelFunc(function(t){return t.floor(e)},{$x:e},function(t){return{$x:function(){return dn(t)}}})}}),die=re({log_:function(n){var e=G(n,"x","log"),t=[e];return ce.runKernelFunc(function(r,i){var a=r.log(e);return i([e]),a},{x:e},function(r,i){var a=i[0];return{x:function(){return r.div(a.toFloat())}}},"Log",{},t)}}),fie=re({log1p_:function(n){var e=G(n,"x","log1p");return ce.runKernelFunc(function(t,r){var i=t.log1p(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.div(i.add(1))}}})}}),hie=re({logSigmoid_:function(n){var e=G(n,"x","logSigmoid");return ce.runKernelFunc(function(t,r){var i=t.softplus(e.neg()).neg();return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.mul(i.neg().sigmoid())}}})}}),l_=re({neg_:function(n){var e=G(n,"x","neg"),t=[e];return ce.runKernelFunc(function(r){return r.neg(e)},{x:e},function(r){return{x:function(){return r.neg()}}},"Neg",{},t)}}),pie=re({reciprocal_:function(n){var e=G(n,"x","reciprocal");return ce.runKernelFunc(function(t,r){var i=t.reciprocal(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.div(i.square().neg())}}})}}),mie=re({round_:function(n){var e=G(n,"x","round");return ce.runKernelFunc(function(t){return t.round(e)},{$x:e},function(t){return{$x:function(){return dn(t)}}})}}),pN=re({rsqrt_:function(n){var e=G(n,"x","rsqrt"),t=[e];return ce.runKernelFunc(function(r,i){var a=r.rsqrt(e);return i([e]),a},{x:e},function(r,i){var a=i[0];return{x:function(){return r.div(a.pow(1.5).mul(2)).neg()}}},"Rsqrt",{},t)}}),mN=re({sigmoid_:function(n){var e=G(n,"x","sigmoid");return ce.runKernelFunc(function(t,r){var i=t.sigmoid(e);return r([i]),i},{x:e},function(t,r){var i=r[0];return{x:function(){return t.mul(i.mul(Ke(1).sub(i)))}}},"Sigmoid")}}),gie=re({sign_:function(n){var e=G(n,"x","sign");return ce.runKernelFunc(function(t){return t.sign(e)},{$x:e},function(t){return{$x:function(){return dn(t)}}})}}),vie=re({isNaN_:function(n){var e=G(n,"x","isNaN");return ce.runKernelFunc(function(t){return t.isNaN(e)},{$x:e},function(t){return{$x:function(){return dn(t)}}})}}),yie=re({isInf_:function(n){var e=G(n,"x","isInf");return ce.runKernelFunc(function(t){return t.isInf(e)},{$x:e},function(t){return{$x:function(){return dn(t)}}})}}),_ie=re({isFinite_:function(n){var e=G(n,"x","isFinite");return ce.runKernelFunc(function(t){return t.isFinite(e)},{$x:e},function(t){return{$x:function(){return dn(t)}}})}}),bie=re({sin_:function(n){var e=G(n,"x","sin"),t=[e];return ce.runKernelFunc(function(r,i){var a=r.sin(e);return i([e]),a},{x:e},function(r,i){var a=i[0];return{x:function(){return a.toFloat().cos().mul(r)}}},"Sin",{},t)}}),xie=re({sinh_:function(n){var e=G(n,"x","sinh");return ce.runKernelFunc(function(t,r){var i=t.sinh(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return i.toFloat().cosh().mulStrict(t)}}})}}),wie=re({softplus_:function(n){var e=G(n,"x","softplus");return ce.runKernelFunc(function(t,r){var i=t.softplus(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.mul(i.sigmoid())}}})}}),Cie=re({sqrt_:function(n){var e=G(n,"x","sqrt");return ce.runKernelFunc(function(t,r){var i=t.sqrt(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.div(i.toFloat().sqrt().mul(2))}}})}}),kie=re({step_:function(n,e){e===void 0&&(e=0);var t=G(n,"x","step");return ce.runKernelFunc(function(r){return r.step(t,e)},{$x:t},function(r){return{$x:function(){return dn(r)}}})}}
3794),Sie=re({tan_:function(n){var e=G(n,"x","tan");return ce.runKernelFunc(function(t,r){var i=t.tan(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return t.div(i.cos().square())}}})}}),Tie=re({tanh_:function(n){var e=G(n,"x","tanh");return ce.runKernelFunc(function(t,r){var i=t.tanh(e);return r([i]),i},{x:e},function(t,r){var i=r[0];return{x:function(){return Ke(1).sub(i.square()).mulStrict(t)}}},"Tanh",{},null,[!0])}});function gN(n,e,t,r,i,a){var s,o,c=G(n,"x","batchNorm"),u=G(e,"mean","batchNorm"),l=G(t,"variance","batchNorm");return i!=null&&(s=G(i,"scale","batchNorm")),r!=null&&(o=G(r,"offset","batchNorm")),J(c.rank===2,function(){return"Error in batchNorm3D: x must be rank 3 but got rank "+c.rank+"."}),J(u.rank===2||u.rank===1,function(){return"Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank "+u.rank+"."}),J(l.rank===2||l.rank===1,function(){return"Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank "+l.rank+"."}),s!=null&&J(s.rank===2||s.rank===1,function(){return"Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank "+s.rank+"."}),o!=null&&J(o.rank===2||o.rank===1,function(){return"Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank "+o.rank+"."}),ov(c,u,l,o,s,a)}function vN(n,e,t,r,i,a){var s,o,c=G(n,"x","batchNorm"),u=G(e,"mean","batchNorm"),l=G(t,"variance","batchNorm");return i!=null&&(s=G(i,"scale","batchNorm")),r!=null&&(o=G(r,"offset","batchNorm")),J(c.rank===3,function(){return"Error in batchNorm3D: x must be rank 3 but got rank "+c.rank+"."}),J(u.rank===3||u.rank===1,function(){return"Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank "+u.rank+"."}),J(l.rank===3||l.rank===1,function(){return"Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank "+l.rank+"."}),s!=null&&J(s.rank===3||s.rank===1,function(){return"Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank "+s.rank+"."}),o!=null&&J(o.rank===3||o.rank===1,function(){return"Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank "+o.rank+"."}),ov(c,u,l,o,s,a)}function yN(n,e,t,r,i,a){var s,o,c=G(n,"x","batchNorm"),u=G(e,"mean","batchNorm"),l=G(t,"variance","batchNorm");return i!=null&&(s=G(i,"scale","batchNorm")),r!=null&&(o=G(r,"offset","batchNorm")),J(c.rank===4,function(){return"Error in batchNorm4D: x must be rank 4 but got rank "+c.rank+"."}),J(u.rank===4||u.rank===1,function(){return"Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank "+u.rank+"."}),J(l.rank===4||l.rank===1,function(){return"Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank "+l.rank+"."}),s!=null&&J(s.rank===4||s.rank===1,function(){return"Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank "+s.rank+"."}),o!=null&&J(o.rank===4||o.rank===1,function(){return"Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank "+o.rank+"."}),ov(c,u,l,o,s,a)}function ov(n,e,t,r,i,a){a==null&&(a=.001);var s,o,c,u=G(n,"x","batchNorm"),l=G(e,"mean","batchNorm"),d=G(t,"variance","batchNorm");i!=null&&(s=G(i,"scale","batchNorm")),r!=null&&(o=G(r,"offset","batchNorm")),J(l.rank===d.rank,function(){return"Batch normalization gradient requires mean and variance to have equal ranks."}),J(o==null||l.rank===o.rank,function(){return"Batch normalization gradient requires mean and offset to have equal ranks."}),J(s==null||l.rank===s.rank,function(){return"Batch normalization gradient requires mean and scale to have equal ranks."}),c=u.rank===0||u.rank===1?u.as4D(1,1,1,u.size):u.rank===2?u.as4D(1,1,u.shape[0],u.shape[1]):u.rank===3?u.as4D(1,u.shape[0],u.shape[1],u.shape[2]):u;var h=[u,l,d,s];return ce.runKernelFunc(function(p,g){var v=p.batchNormalization(c,O0(l),O0(d),a,O0(s),O0(o));return g([u,l,d,s]),v},{x:u,mean:l,variance:d,scale:s,offset:o},function(p,g){var v=g,y=v[0],b=v[1],x=v[2],S=v[3],w=S??Ke(1),k=oi(b.shape,c.shape),E=[];if(b.rank===1){for(var I=0;I<c.shape.length-1;++I)E.push(c.shape[I]);E.push(1)}var P=y.sub(b),A=p.mul(w),N=pN(x.add(Ke(a))),j=N.mul(N).mul(N).mul(Ke(-.5));return{x:function(){return b.rank===1?p.mul(Lh(N.as4D(1,1,1,b.shape[0]),E)).mul(w).reshape(y.shape):p.mul(N).mul(w).reshape(y.shape)},mean:function(){var L=N.mul(Ke(-1)).mul(A);return b.rank===1&&(L=L.sum(k)),L.reshape(b.shape)},variance:function(){var L=j.mul(P).mul(A);return b.rank===1&&(L=L.sum(k)),L.reshape(b.shape)},scale:function(){var L=P.mul(N),B=p.mul(L);return b.rank===1&&(B=B.sum(k)),B.reshape(b.shape)},offset:function(){var L=p;return b.rank===1&&(L=L.sum(k)),L.reshape(b.shape)}}},"BatchNormalization",{varianceEpsilon:a},h).reshape(u.shape)}function O0(n){return n==null?null:n.rank===0?n.as1D():n.rank===1?n:n.rank===2?n.as4D(1,1,n.shape[0],n.shape[1]):n.rank===3?n.as4D(1,n.shape[0],n.shape[1],n.shape[2]):n}function cb(){M5("tf.batchNormalization() is going away. Use tf.batchNorm() instead, and note the positional argument change of scale, offset, and varianceEpsilon")}var Eie=re({batchNormalization2d_:function(n,e,t,r,i,a){return r===void 0&&(r=.001),cb(),gN(n,e,t,a,i,r)}}),Pie=re({batchNormalization3d_:function(n,e,t,r,i,a){return r===void 0&&(r=.001),cb(),vN(n,e,t,a,i,r)}}),Rie=re({batchNormalization4d_:function(n,e,t,r,i,a){return r===void 0&&(r=.001),cb(),yN(n,e,t,a,i,r)}}),Aie=re({batchNormalization_:function(n,e,t,r,i,a){return r===void 0&&(r=.001),cb(),ov(n,e,t,a,i,r)}}),_N=re({batchNorm_:ov}),Iie=re({batchNorm2d_:gN}),Oie=re({batchNorm3d_:vN}),Mie=re({batchNorm4d_:yN}),ub=re({logicalAnd_:function(n,e){var t=G(n,"a","logicalAnd","bool"),r=G(e,"b","logicalAnd","bool");return tn(t.shape,r.shape),ce.runKernelFunc(function(i){return i.logicalAnd(t,r)},{a:t,b:r},null,"LogicalAnd")}}
vendor: 13,133 bytes, line 3794
3794),Die=re({logicalNot_:function(n){var e=G(n,"x","logicalNot","bool");return ce.runKernelFunc(function(t){return t.logicalNot(e)},{$x:e})}}),bN=re({logicalOr_:function(n,e){var t=G(n,"a","logicalOr","bool"),r=G(e,"b","logicalOr","bool");return tn(t.shape,r.shape),ce.runKernelFunc(function(i){return i.logicalOr(t,r)},{$a:t,$b:r})}}),Nie=re({logicalXor_:function(n,e){var t=G(n,"a","logicalXor","bool"),r=G(e,"b","logicalXor","bool");return tn(t.shape,r.shape),bN(n,e).logicalAnd(ub(n,e).logicalNot())}}),yf=re({where_:function(n,e,t){var r=G(e,"a","where"),i=G(t,"b","where"),a=G(n,"condition","where","bool");return Pn(r.shape,i.shape,"Error in where: "),a.rank===1?J(a.shape[0]===r.shape[0],function(){return"The first dimension of `a` must match the size of `condition`."}):Pn(a.shape,i.shape,"Error in where: "),ce.runKernelFunc(function(s,o){var c=s.select(a,r,i);return o([a]),c},{$condition:a,$a:r,$b:i},function(s,o){var c=o[0];return{$condition:function(){return dn(c).toFloat()},$a:function(){return s.mul(c.cast(s.dtype))},$b:function(){return s.mul(c.logicalNot().cast(s.dtype))}}})}}),xN=function(n){return at(this,void 0,void 0,function(){var e,t,r;return st(this,function(i){switch(i.label){case 0:return[4,(e=G(n,"condition","whereAsync","bool")).data()];case 1:return t=i.sent(),r=yS(e.shape,t),n!==e&&e.dispose(),[2,r]}})})},Xt=re({add_:function(n,e){var t,r=G(n,"a","add"),i=G(e,"b","add");t=yr(r,i),r=t[0],i=t[1];var a=tn(r.shape,i.shape);return ce.runKernelFunc(function(s){return s.add(r,i)},{a:r,b:i},function(s){return{a:function(){var o=s,c=oi(r.shape,a);return c.length>0&&(o=o.sum(c)),o.reshape(r.shape)},b:function(){var o=s,c=oi(i.shape,a);return c.length>0&&(o=o.sum(c)),o.reshape(i.shape)}}},"Add")}}),Lie=re({addN_:function(n){J(Array.isArray(n),function(){return"The argument passed to tf.addN() must be a list of tensors"}),J(n.length>=1,function(){return"Must pass at least one tensor to tf.addN(), but got "+n.length});var e=n.map(function(i,a){return G(i,"tensors"+a,"addN")}),t=e[0];e.forEach(function(i){if(i.dtype!==t.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),e.forEach(function(i){if(!gi(i.shape,t.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});var r=e;return ce.runKernelFunc(function(i){return i.addN(e)},r,function(i){var a={};return e.forEach(function(s,o){a[o]=function(){return i.clone()}}),a},"AddN")}}),Fie=re({addStrict_:function(n,e){var t=G(n,"a","addStrict"),r=G(e,"b","addStrict");return Pn(t.shape,r.shape,"Error in addStrict: "),t.add(r)}}),$ie=re({atan2_:function(n,e){var t,r=G(n,"a","atan2"),i=G(e,"b","atan2");t=yr(r,i),r=t[0],i=t[1];var a=tn(r.shape,i.shape);return ce.runKernelFunc(function(s,o){var c=s.atan2(r,i);return o([r,i]),c},{$a:r,$b:i},function(s,o){var c=o[0],u=o[1];return{$a:function(){var l=Xt(c.square(),u.square()),d=s.mul(u.div(l)),h=oi(c.shape,a);return h.length>0&&(d=d.sum(h)),d.reshape(c.shape)},$b:function(){var l=Xt(c.square(),u.square()),d=l_(s.mul(c.div(l))),h=oi(u.shape,a);return h.length>0&&(d=d.sum(h)),d.reshape(u.shape)}}})}}),jo=re({div_:function(n,e){var t,r=G(n,"a","div"),i=G(e,"b","div");if(t=yr(r,i),r=t[0],i=t[1],r.dtype==="int32"&&i.dtype==="int32")return wN(r,i);var a=tn(r.shape,i.shape);return ce.runKernelFunc(function(s,o){var c=s.realDivide(r,i);return o([r,i]),c},{a:r,b:i},function(s,o){var c=o[0],u=o[1];return{a:function(){var l=s.div(u.toFloat()),d=oi(c.shape,a);return d.length>0?l.sum(d).reshape(c.shape):l},b:function(){var l=s.mul(c.toFloat()),d=oi(u.shape,a);d.length>0&&(l=l.sum(d).reshape(u.shape));var h=u.square();return l.div(h.toFloat()).neg()}}},"Div")}}),Bie=re({divNoNan_:function(n,e){var t,r=G(n,"a","div"),i=G(e,"b","div");r=(t=yr(r,i))[0],i=t[1];var a=jo(r,i),s=dn(a),o=i.equal(s);return yf(o,s,a)}}),Uie=re({divStrict_:function(n,e){var t=G(n,"a","div"),r=G(e,"b","div");return Pn(t.shape,r.shape,"Error in divideStrict: "),t.div(r)}}),wN=re({floorDiv_:function(n,e){var t,r=G(n,"a","floorDiv"),i=G(e,"b","floorDiv");t=yr(r,i),r=t[0],i=t[1];var a=tn(r.shape,i.shape);return ce.runKernelFunc(function(s,o){var c=s.floorDiv(r,i);return o([r,i]),c},{a:r,b:i},function(s,o){var c=o[0],u=o[1];return{a:function(){var l=s.div(u.toFloat()),d=oi(c.shape,a);return d.length>0?l.sum(d).reshape(c.shape):l},b:function(){var l=s.mul(c.toFloat()),d=oi(u.shape,a);d.length>0&&(l=l.sum(d).reshape(u.shape));var h=u.square();return l.div(h.toFloat()).neg()}}},"FloorDiv")}}),CS=re({maximum_:function(n,e){var t,r=G(n,"a","maximum"),i=G(e,"b","maximum");return t=yr(r,i),r=t[0],i=t[1],r.dtype==="bool"&&(r=r.toInt(),i=i.toInt()),tn(r.shape,i.shape),ce.runKernelFunc(function(a,s){var o=a.maximum(r,i);return s([r,i]),o},{a:r,b:i},function(a,s){var o=s[0],c=s[1];return{a:function(){return a.mul(o.greaterEqual(c).toFloat())},b:function(){return a.mul(o.less(c).toFloat())}}},"Maximum")}}),jie=re({maximumStrict_:function(n,e){var t=G(n,"a","maximumStrict"),r=G(e,"b","maximumStrict");return Pn(t.shape,r.shape,"Error in maximumStrict: "),t.maximum(r)}}),CN=re({minimum_:function(n,e){var t,r=G(n,"a","minimum"),i=G(e,"b","minimum");return t=yr(r,i),r=t[0],i=t[1],r.dtype==="bool"&&(r=r.toInt(),i=i.toInt()),tn(r.shape,i.shape),ce.runKernelFunc(function(a,s){var o=a.minimum(r,i);return s([r,i]),o},{a:r,b:i},function(a,s){var o=s[0],c=s[1];return{a:function(){return a.mul(o.lessEqual(c).toFloat())},b:function(){return a.mul(o.greater(c).toFloat())}}},"Minimum")}}),qie=re({minimumStrict_:function(n,e){var t=G(n,"a","minimumStrict"),r=G(e,"b","minimumStrict");return Pn(t.shape,r.shape,"Error in minimumStrict: "),t.minimum(r)}}),zie=re({mod_:function(n,e){var t,r=G(n,"a","mod"),i=G(e,"b","mod");t=yr(r,i),r=t[0],i=t[1];var a=tn(r.shape,i.shape);return ce.runKernelFunc(function(s,o){var c=s.mod(r,i);return o([r,i]),c},{$a:r,$b:i},function(s,o){var c=o[0],u=o[1];return{$a:function(){var l=oi(c.shape,a);return l.length>0?s.sum(l).reshape(c.shape):s},$b:function(){var l=s.mul(c.div(u).floor().neg()),d=oi(u.shape,a);return d.length>0?l.sum(d).reshape(u.shape):l}}})}}),Wie=re({modStrict_:function(n,e){var t=G(n,"a","modStrict"),r=G(e,"b","modStrict");return Pn(t.shape,r.shape,"Error in modStrict: "),t.mod(r)}}),Ki=re({mul_:function(n,e){var t,r=G(n,"a","mul"),i=G(e,"b","mul");t=yr(r,i),r=t[0],i=t[1];var a=tn(r.shape,i.shape);return ce.runKernelFunc(function(s,o){var c=s.multiply(r,i);return o([r,i]),c},{a:r,b:i},function(s,o){var c=o[0],u=o[1];return{a:function(){var l=s.mul(u.toFloat()),d=oi(c.shape,a);return d.length>0?l.sum(d).reshape(c.shape):l},b:function(){var l=s.mul(c.toFloat()),d=oi(u.shape,a);return d.length>0?l.sum(d).reshape(u.shape):l}}},"Mul")}}),Hie=re({mulStrict_:function(n,e){var t=G(n,"a","mul"),r=G(e,"b","mul");return Pn(t.shape,r.shape,"Error in multiplyStrict: "),t.mul(r)}}),d_=re({pow_:function(n,e){var t,r=G(n,"base","pow"),i=G(e,"exp","pow");t=yr(r,i),r=t[0],i=t[1];var a=tn(r.shape,i.shape),s=[r,i];return ce.runKernelFunc(function(o,c){var u=o.pow(r,i);return c([r,i,u]),u},{a:r,b:i},function(o,c){var u=c[0],l=c[1],d=c[2];return{a:function(){var h=l.toFloat(),p=o.mul(h.mul(u.pow(h.sub(Ke(1))))),g=oi(u.shape,a);return g.length>0&&(p=p.sum(g)),p.reshape(u.shape)},b:function(){var h=u.greater(0),p=u.log().where(h,dn(u)),g=o.mul(d.mul(p)),v=oi(l.shape,a);return v.length>0&&(g=g.sum(v)),g.reshape(l.shape)}}},"Pow",{},s,[!0])}}),Vie=re({powStrict_:function(n,e){return Pn(n.shape,e.shape,"Error in powStrict: "),n.pow(e)}}),Gie=re({squaredDifferenceStrict_:function(n,e){var t=G(n,"a","squaredDifferenceStrict"),r=G(e,"b","squaredDifferenceStrict");return Pn(t.shape,r.shape,"Error in squaredDifferenceStrict: "),t.squaredDifference(r)}}),ci=re({sub_:function(n,e){var t,r=G(n,"a","sub"),i=G(e,"b","sub");t=yr(r,i),r=t[0],i=t[1];var a=tn(r.shape,i.shape);return ce.runKernelFunc(function(s){return s.subtract(r,i)},{a:r,b:i},function(s){return{a:function(){var o=s,c=oi(r.shape,a);return c.length>0&&(o=o.sum(c)),o.reshape(r.shape)},b:function(){var o=s,c=oi(i.shape,a);return c.length>0&&(o=o.sum(c)),o.neg().reshape(i.shape)}}},"Sub")}}),Kie=re({subStrict_:function(n,e){var t=G(n,"a","subStrict"),r=G(e,"b","subStrict");return Pn(t.shape,r.shape,"Error in subStrict: "),t.sub(r)}}),kN=re({equal_:function(n,e){var t,r=G(n,"a","equal"),i=G(e,"b","equal");return t=yr(r,i),r=t[0],i=t[1],tn(r.shape,i.shape),ce.runKernelFunc(function(a){return a.equal(r,i)},{$a:r,$b:i})}}),Yie=re({equalStrict_:function(n,e){var t=G(n,"a","equalStrict"),r=G(e,"b","equalStrict");return Pn(t.shape,r.shape,"Error in equalStrict: "),t.equal(r)}}),Xie=re({greater_:function(n,e){var t,r=G(n,"a","greater"),i=G(e,"b","greater");return t=yr(r,i),r=t[0],i=t[1],tn(r.shape,i.shape),ce.runKernelFunc(function(a){return a.greater(r,i)},{a:r,b:i},null,"Greater")}}),SN=re({greaterEqual_:function(n,e){var t,r=G(n,"a","greaterEqual"),i=G(e,"b","greaterEqual");return t=yr(r,i),r=t[0],i=t[1],tn(r.shape,i.shape),ce.runKernelFunc(function(a,s){var o=a.greaterEqual(r,i);return s([r,i]),o},{a:r,b:i},function(a,s){var o=s[0],c=s[1];return{a:function(){return dn(o)},b:function(){return dn(c)}}},"GreaterEqual")}}),Jie=re({greaterEqualStrict_:function(n,e){var t=G(n,"a","greaterEqualStrict"),r=G(e,"b","greaterEqualStrict");return Pn(t.shape,r.shape,"Error in greaterEqualStrict: "),t.greaterEqual(r)}}),Qie=re({greaterStrict_:function(n,e){var t=G(n,"a","greaterStrict"),r=G(e,"b","greaterStrict");return Pn(t.shape,r.shape,"Error in greaterStrict: "),t.greater(r)}}),Zie=re({less_:function(n,e){var t,r=G(n,"a","less"),i=G(e,"b","less");return t=yr(r,i),r=t[0],i=t[1],tn(r.shape,i.shape),ce.runKernelFunc(function(a){return a.less(r,i)},{a:r,b:i},null,"Less")}}),eae=re({lessEqual_:function(n,e){var t,r=G(n,"a","lessEqual"),i=G(e,"b","lessEqual");return t=yr(r,i),r=t[0],i=t[1],tn(r.shape,i.shape),ce.runKernelFunc(function(a,s){var o=a.lessEqual(r,i);return s([r,i]),o},{a:r,b:i},null,"LessEqual")}}),tae=re({lessEqualStrict_:function(n,e){var t=G(n,"a","lessEqualStrict"),r=G(e,"b","lessEqualStrict");return Pn(t.shape,r.shape,"Error in lessEqualStrict: "),t.lessEqual(r)}}),nae=re({lessStrict_:function(n,e){var t=G(n,"a","lessStrict"),r=G(e,"b","lessStrict");return Pn(t.shape,r.shape,"Error in lessStrict: "),t.less(r)}}),rae=re({notEqual_:function(n,e){var t,r=G(n,"a","notEqual"),i=G(e,"b","notEqual");return t=yr(r,i),r=t[0],i=t[1],tn(r.shape,i.shape),ce.runKernelFunc(function(a){return a.notEqual(r,i)},{a:r,b:i},null,"NotEqual")}}),iae=re({notEqualStrict_:function(n,e){var t=G(n,"a","notEqualStrict"),r=G(e,"b","notEqualStrict");return Pn(t.shape,r.shape,"Error in notEqualStrict: "),t.notEqual(r)}});function N4(n,e){for(var t=[],r=n;r<e;++r)t.push(r);return t}function L4(n){for(var e=[],t=0;t<n.length;++t)for(var r=0;r<n[t].length;++r)e.push(n[t][r]);return e}var kS=re({gather_:function(n,e,t){t===void 0&&(t=0);var r=G(n,"x","gather"),i=G(e,"indices","gather","int32");t=ui(t,r.shape)[0];var a=function(s,o,c){for(var u=s.shape[c],l=[],d=1,h=1,p=0;p<c;p++)l.push(s.shape[p]),d*=s.shape[p];for(p=0;p<o.rank;p++)l.push(o.shape[p]);for(p=c+1;p<s.rank;p++)l.push(s.shape[p]),h*=s.shape[p];return{batchSize:d,sliceSize:h,dimSize:u,outputShape:l}}(r,i,t);return ce.runKernelFunc(function(s,o){var c=s.gather(r,i.flatten(),t);return o([i]),c},{x:r,indices:i},function(s,o){var c=o[0];return{x:function(){var u=r.shape,l=c.size,d=u.slice(0,t),h=d.length,p=u.slice(t,u.length).slice(1),g=p.length,v=N4(0,h),y=N4(h+1,h+1+g),b=L4([d,[l],p]),x=s.reshape(b),S=c.reshape([l]),w=L4([[h],v,y]),k=x.transpose(w),E=TN(k,S,r.shape[t]),I=lS(w);return E=E.transpose(I)},indices:function(){return c}}},"Gather",{axis:t}).reshape(a.outputShape)}}),TN=re({unsortedSegmentSum_:function(n,e,t){var r=G(n,"x","unsortedSegmentSum"),i=G(e,"segmentIds","unsortedSegmentSum","int32");return J($r(t),function(){return"numSegments must be of dtype int"}),ce.runKernelFunc(function(a,s){var o=a.unsortedSegmentSum(r,i,t);return s([i]),o},{$x:r},function(a,s){var o=s[0];return{$x:function(){return function(c,u){for(var l=CS(u,dn(u)),d=kS(c,l),h=SN(u,Ke(0,"int32")),p=d.rank-h.rank,g=0;g<p;++g)h=ao(h,g+1);h=ub(h,Lp(d.shape,"bool"));var v=dn(d);return yf(h,d,v)}(a,o)}}})}}),aae=function(n,e,t){return at(this,void 0,void 0,function(){var r,i,a,s,o,c,u,l,d,h,p,g,v;return st(this,function(y){switch(y.label){case 0:for(r=G(n,"tensor","boolMask"),i=G(e,"mask","boolMask","bool"),a=t??0,s=i.rank,o=r.shape,J(s>0,function(){return"mask cannot be scalar"}),Pn(o.slice(a,a+s),i.shape,"mask's shape must match the first K dimensions of tensor's shape,"),c=1,u=a;u<a+s;u++)c*=o[u];return l=o.slice(0,a).concat([c],o.slice(a+s)),d=r.reshape(l),h=i.reshape([-1]),[4,xN(h)];case 1:return p=y.sent(),g=p.squeeze([1]),v=kS(d,g,a),n!==r&&r.dispose(),e!==i&&i.dispose(),g.dispose(),d.dispose(),h.dispose(),p.dispose(),[2,v]}})})};function EN(n,e,t,r,i,a,s){a===void 0&&(a="NHWC"),J(n.length===e.rank,function(){return"Length of inShape ("+n.length+") and rank of dy ("+e.rank+") must match"});var o=n,c=e,u=!1;e.rank===3&&(u=!0,c=e.as4D(1,e.shape[0],e.shape[1],e.shape[2]),o=[1,n[0],n[1],n[2]]),J(o.length===4,function(){return"Error in conv2dDerIn
3794put: inShape must be length 4, but got length "+o.length+"."}),J(c.rank===4,function(){return"Error in conv2dDerInput: dy must be rank 4, but got rank "+c.rank}),J(t.rank===4,function(){return"Error in conv2dDerInput: filter must be rank 4, but got rank "+t.rank});var l=a==="NHWC"?o[3]:o[1],d=a==="NHWC"?c.shape[3]:c.shape[1];J(l===t.shape[2],function(){return"Error in conv2dDerInput: depth of input ("+l+") must match input depth for filter "+t.shape[2]+"."}),J(d===t.shape[3],function(){return"Error in conv2dDerInput: depth of output ("+d+") must match output depth for filter "+t.shape[3]+"."}),s!=null&&J($r(i),function(){return"Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode "+s+" but got pad "+i+"."});var h=mS(a),p=Af(o,t.shape,r,1,i,s,!1,h),g=ce.runKernelFunc(function(v,y){var b=v.conv2dDerInput(c,t,p);return y([t,c]),b},{dy4D:c,filter:t},function(v,y){var b=y[0],x=y[1];return{dy4D:function(){return yo(v,b,r,i,a,1,s)},filter:function(){return SS(v,x,b.shape,r,i,a,s)}}});return u?g.as3D(g.shape[1],g.shape[2],g.shape[3]):g}function Sw(n){var e=function(a){return typeof a=="number"?[a,a,a]:a.length===2?[a[0],a[1],1]:a}(n),t=e[0],r=e[1],i=e[2];return t===1&&r===1&&i===1}function PN(n,e,t,r,i){J(n.length===e.rank,function(){return"Length of inShape ("+n.length+") and rank of dy ("+e.rank+") must match"});var a=n,s=e,o=!1;e.rank===4&&(o=!0,s=e.as5D(1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]),a=[1,n[0],n[1],n[2],n[3]]);var c=a[4],u=s.shape[4];J(a.length===5,function(){return"Error in conv3dDerInput: inShape must be length 5, but got length "+a.length+"."}),J(s.rank===5,function(){return"Error in conv3dDerInput: dy must be rank 5, but got rank "+s.rank}),J(t.rank===5,function(){return"Error in conv3dDerInput: filter must be rank 5, but got rank "+t.rank}),J(c===t.shape[3],function(){return"Error in conv3dDerInput: depth of input ("+c+") must match input depth for filter "+t.shape[3]+"."}),J(u===t.shape[4],function(){return"Error in conv3dDerInput: depth of output ("+u+") must match output depth for filter "+t.shape[4]+"."});var l=c_(a,t.shape,r,1,i),d=ce.runKernelFunc(function(h){return h.conv3dDerInput(s,t,l)},{dy5D:s});return o?d.as4D(d.shape[1],d.shape[2],d.shape[3],d.shape[4]):d}var sae=re({conv1d_:function(n,e,t,r,i,a,s){i===void 0&&(i="NWC"),a===void 0&&(a=1);var o=G(n,"x","conv1d"),c=G(e,"filter","conv1d"),u=o,l=!1;o.rank===2&&(l=!0,u=o.as3D(1,o.shape[0],o.shape[1])),J(u.rank===3,function(){return"Error in conv1d: input must be rank 3, but got rank "+u.rank+"."}),J(c.rank===3,function(){return"Error in conv1d: filter must be rank 3, but got rank "+c.rank+"."}),s!=null&&J($r(r),function(){return"Error in conv1d: pad must be an integer when using, dimRoundingMode "+s+" but got pad "+r+"."}),J(u.shape[2]===c.shape[1],function(){return"Error in conv1d: depth of input ("+u.shape[2]+") must match input depth for filter "+c.shape[1]+"."}),J(Wa(t,a),function(){return"Error in conv1D: Either stride or dilation must be 1. Got stride "+t+" and dilation '"+a+"'"}),J(i==="NWC",function(){return"Error in conv1d: got dataFormat of "+i+" but only NWC is currently supported."});var d=c.as4D(1,c.shape[0],c.shape[1],c.shape[2]),h=u.as4D(u.shape[0],1,u.shape[1],u.shape[2]),p=yo(h,d,[1,t],r,"NHWC",[1,a],s);return l?p.as2D(p.shape[2],p.shape[3]):p.as3D(p.shape[0],p.shape[2],p.shape[3])}}),yo=re({conv2d_:function(n,e,t,r,i,a,s){i===void 0&&(i="NHWC"),a===void 0&&(a=[1,1]);var o=G(n,"x","conv2d"),c=G(e,"filter","conv2d"),u=o,l=!1;o.rank===3&&(l=!0,u=o.as4D(1,o.shape[0],o.shape[1],o.shape[2])),J(u.rank===4,function(){return"Error in conv2d: input must be rank 4, but got rank "+u.rank+"."}),J(c.rank===4,function(){return"Error in conv2d: filter must be rank 4, but got rank "+c.rank+"."}),s!=null&&J($r(r),function(){return"Error in conv2d: pad must be an integer when using, dimRoundingMode "+s+" but got pad "+r+"."});var d=i==="NHWC"?u.shape[3]:u.shape[1];J(d===c.shape[2],function(){return"Error in conv2d: depth of input ("+d+") must match input depth for filter "+c.shape[2]+"."}),J(Wa(t,a),function(){return"Error in conv2D: Either strides or dilations must be 1. Got strides "+t+" and dilations '"+a+"'"});var h=mS(i),p=Af(u.shape,c.shape,t,a,r,s,!1,h),g=[c,u],v=ce.runKernelFunc(function(y,b){var x=y.conv2d(u,c,p);return b([c,u]),x}
3794,{x:u,filter:c},function(y,b){var x=b,S=x[0],w=x[1];return J(lp(a),function(){return"Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '"+a+"'"}),{x:function(){return RN(w.shape,y,S,t,r,i)},filter:function(){return SS(w,y,S.shape,t,r,i)}}},"Conv2D",p,g);return l?v.as3D(v.shape[1],v.shape[2],v.shape[3]):v}}),oae=re({conv3d_:function(n,e,t,r,i,a){i===void 0&&(i="NDHWC"),a===void 0&&(a=[1,1,1]);var s=G(n,"x","conv3d"),o=G(e,"filter","conv3d"),c=s,u=!1;s.rank===4&&(u=!0,c=s.as5D(1,s.shape[0],s.shape[1],s.shape[2],s.shape[3])),J(c.rank===5,function(){return"Error in conv3d: input must be rank 5, but got rank "+c.rank+"."}),J(o.rank===5,function(){return"Error in conv3d: filter must be rank 5, but got rank "+o.rank+"."}),J(c.shape[4]===o.shape[3],function(){return"Error in conv3d: depth of input ("+c.shape[4]+") must match input depth for filter "+o.shape[3]+"."}),J(function(h,p){return Sw(h)||Sw(p)}(t,a),function(){return"Error in conv3D: Either strides or dilations must be 1. Got strides "+t+" and dilations '"+a+"'"}),J(i==="NDHWC",function(){return"Error in conv3d: got dataFormat of "+i+" but only NDHWC is currently supported."});var l=c_(c.shape,o.shape,t,a,r),d=ce.runKernelFunc(function(h,p){var g=h.conv3d(c,o,l);return p([c,o]),g},{x:c,$filter:o},function(h,p){J(Sw(a),function(){return"Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '"+a+"'"});var g=p[0],v=p[1];return{x:function(){return PN(g.shape,h,v,t,r)},$filter:function(){return function(y,b,x,S,w){var k=y;y.rank===4&&(k=y.as5D(1,y.shape[0],y.shape[1],y.shape[2],y.shape[3]));var E=b;E.rank===4&&(E=b.as5D(1,b.shape[0],b.shape[1],b.shape[2],b.shape[3])),J(k.rank===5,function(){return"Error in conv3dDerFilter: input must be rank 5, but got shape "+k.shape+"."}),J(E.rank===5,function(){return"Error in conv3dDerFilter: dy must be rank 5, but got shape "+E.shape+"."}),J(x.length===5,function(){return"Error in conv3dDerFilter: filterShape must be length 5, but got "+x+"."}),J(k.shape[4]===x[3],function(){return"Error in conv3dDerFilter: depth of input "+k.shape[4]+") must match input depth in filter ("+x[3]+"."}),J(E.shape[4]===x[4],function(){return"Error in conv3dDerFilter: depth of dy ("+E.shape[4]+") must match output depth for filter ("+x[4]+")."});var I=c_(k.shape,x,S,1,w);return ce.runKernelFunc(function(P){return P.conv3dDerFilter(k,E,I)},{x5D:k,dy5D:E}
3794)}(g,h,v.shape,t,r)}}});return u?d.as4D(d.shape[1],d.shape[2],d.shape[3],d.shape[4]):d}}),SS=re({conv2dDerFilter_:function(n,e,t,r,i,a,s){a===void 0&&(a="NHWC");var o=n;n.rank===3&&(o=n.as4D(1,n.shape[0],n.shape[1],n.shape[2]));var c=e;c.rank===3&&(c=e.as4D(1,e.shape[0],e.shape[1],e.shape[2])),J(o.rank===4,function(){return"Error in conv2dDerFilter: input must be rank 4, but got shape "+o.shape+"."}),J(c.rank===4,function(){return"Error in conv2dDerFilter: dy must be rank 4, but got shape "+c.shape+"."}),J(t.length===4,function(){return"Error in conv2dDerFilter: filterShape must be length 4, but got "+t+"."});var u=a==="NHWC"?o.shape[3]:o.shape[1],l=a==="NHWC"?c.shape[3]:c.shape[1];J(u===t[2],function(){return"Error in conv2dDerFilter: depth of input "+u+") must match input depth in filter ("+t[2]+"."}),J(l===t[3],function(){return"Error in conv2dDerFilter: depth of dy ("+l+") must match output depth for filter ("+t[3]+")."}),s!=null&&J($r(i),function(){return"Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode "+s+" but got pad "+i+"."});var d=mS(a),h=Af(o.shape,t,r,1,i,s,!1,d);return ce.runKernelFunc(function(p){return p.conv2dDerFilter(o,c,h)},{x4D:o,dy4D:c})}}),RN=re({conv2dDerInput_:EN}),lb=re({depthwiseConv2d_:function(n,e,t,r,i,a,s){a===void 0&&(a=[1,1]);var o=G(n,"x","depthwiseConv2d"),c=G(e,"filter","depthwiseConv2d"),u=o,l=!1;o.rank===3&&(l=!0,u=o.as4D(1,o.shape[0],o.shape[1],o.shape[2])),J(u.rank===4,function(){return"Error in depthwiseConv2d: input must be rank 4, but got rank "+u.rank+"."}),J(c.rank===4,function(){return"Error in depthwiseConv2d: filter must be rank 4, but got rank "+c.rank+"."}),J(u.shape[3]===c.shape[2],function(){return"Error in depthwiseConv2d: number of input channels ("+u.shape[3]+") must match the inChannels dimension in filter "+c.shape[2]+"."}),a==null&&(a=[1,1]),J(Wa(t,a),function(){return"Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides "+t+" and dilations '"+a+"'"}),s!=null&&J($r(r),function(){return"Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode "+s+" but got pad "+r+"."});var d=Af(u.shape,c.shape,t,a,r,s,!0),h=[u,c],p=ce.runKernelFunc(function(g,v){var y=g.depthwiseConv2D(u,c,d);return v([u,c]),y},{x:u,filter:c},function(g,v){J(lp(a),function(){return"Error in gradient of depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '"+a+"'"});var y=v[0],b=v[1];return{x:function(){return AN(y.shape,g,b,d)},filter:function(){return IN(y,g,b.shape,d)}}},"DepthwiseConv2dNative",d,h);return l?p.as3D(p.shape[1],p.shape[2],p.shape[3]):p}}),AN=re({depthwiseConv2dDerInput_:function(n,e,t,r){var i=e,a=!1;e.rank===3&&(a=!0,i=e.as4D(1,e.shape[0],e.shape[1],e.shape[2]));var s=ce.runKernelFunc(function(o){return o.depthwiseConv2DDerInput(i,t,r)},{dy4D:i});return a?s.as3D(s.shape[1],s.shape[2],s.shape[3]):s}}),IN=re({depthwiseConv2dDerFilter_:function(n,e,t,r){var i=n;n.rank===3&&(i=n.as4D(1,n.shape[0],n.shape[1],n.shape[2]));var a=e;return a.rank===3&&(a=e.as4D(1,e.shape[0],e.shape[1],e.shape[2])),ce.runKernelFunc(function(s){return s.depthwiseConv2DDerFilter(i,a,r)},{x4D:i,dy4D:a})}}),TS=re({separableConv2d_:function(n,e,t,r,i,a,s){a===void 0&&(a=[1,1]),s===void 0&&(s="NHWC");var o=G(n,"x","separableConv2d"),c=G(e,"depthwiseFilter","separableConv2d"),u=G(t,"pointwiseFilter","separableConv2d"),l=o,d=!1;if(o.rank===3&&(d=!0,l=o.as4D(1,o.shape[0],o.shape[1],o.shape[2])),s==="NCHW")throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");J(l.rank===4,function(){return"Error in separableConv2d: input must be rank 4, but got rank "+l.rank+"."}),J(c.rank===4,function(){return"Error in separableConv2d: depthwise filter must be rank 4, but got rank "+c.rank+"."}),J(u.rank===4,function(){return"Error in separableConv2d: pointwise filter must be rank 4, but got rank "+c.rank+"."}),J(u.shape[0]===1,function(){return"Error in separableConv2d: the first dimension of pointwise filter must be 1, but got "+u.shape[0]+"."}),J(u.shape[1]===1,function(){return"Error in separableConv2d: the second dimension of pointwise filter must be 1, but got "+u.shape[1]+"."});var h=c.shape[2],p=c.shape[3];J(u.shape[2]===h*p,function(){return"Error in separableConv2d: the third dimension of pointwise filter must be "+h*p+", but got "+u.shape[2]+"."});var g=lb(l,c,r,i,s,a),v=yo(g,u,1,"valid",s);return d?v.as3D(v.shape[1],v.shape[2],v.shape[3]):v}}),cae=re({conv2dTranspose_:function(n,e,t,r,i,a){return EN(t,G(n,"x","conv2dTranspose"),G(e,"filter","conv2dTranspose"),r,i,"NHWC",a)}}),uae=re({conv3dTranspose_:function(n,e,t,r,i){return PN(t,G(n,"x","conv3dTranspose"),G(e,"filter","conv3dTranspose"),r,i)}}),db=re({matMul_:function(n,e,t,r){var i;t===void 0&&(t=!1),r===void 0&&(r=!1);var a=G(n,"a","matMul"),s=G(e,"b","matMul");i=yr(a,s),a=i[0],s=i[1];var o=t?a.shape[a.rank-2]:a.shape[a.rank-1],c=r?s.shape[s.rank-1]:s.shape[s.rank-2],u=t?a.shape[a.rank-1]:a.shape[a.rank-2],l=r?s.shape[s.rank-2]:s.shape[s.rank-1],d=a.shape.slice(0,-2),h=s.shape.slice(0,-2),p=ct(d),g=ct(h);J(a.rank>=2&&s.rank>=2&&a.rank===s.rank,function(){return"Error in matMul: inputs must have the same rank of at least 2, got ranks "+a.rank+" and "+s.rank+"."}),J(gi(d,h),function(){return"Error in matMul: outer dimensions ("+d+") and ("+h+") of Tensors with shapes "+a.shape+" and "+s.shape+" must match."}),J(o===c,function(){return"Error in matMul: inner shapes ("+o+") and ("+c+") of Tensors with shapes "+a.shape+" and "+s.shape+" and transposeA="+t+" and transposeB="+r+" must match."});var v=a.shape.slice(0,-2).concat([u,l]),y=t?a.as3D(p,o,u):a.as3D(p,u,o),b=r?s.as3D(g,l,c):s.as3D(g,c,l),x={transposeA:t,transposeB:r};return ce.runKernelFunc(function(S,w){var k=S.batchMatMul(y,b,t,r);return w([y,b]),k},{a:y,b},function(S,w){var k=w,E=k[0],I=k[1];return t||r?!t&&r?{a:function(){return S.matMul(I,!1,!1)}
3794,b:function(){return S.matMul(E,!0,!1)}}:t&&!r?{a:function(){return I.matMul(S,!1,!0)},b:function(){return E.matMul(S,!1,!1)}}:{a:function(){return I.matMul(S,!0,!0)},b:function(){return S.matMul(E,!0,!0)}}:{a:function(){return S.matMul(I,!1,!0)},b:function(){return E.matMul(S,!0,!1)}}},"BatchMatMul",x).reshape(v)}}),lae=re({dot_:function(n,e){var t=G(n,"t1","dot"),r=G(e,"t2","dot");J(!(t.rank!==1&&t.rank!==2||r.rank!==1&&r.rank!==2),function(){return"Error in dot: inputs must all be rank 1 or 2, but got ranks "+t.rank+" and "+r.rank+"."});var i=t.rank===1?t.size:t.shape[1],a=r.rank===1?r.size:r.shape[0];return J(i===a,function(){return"Error in dot: inner dimensions of inputs must match, but got "+i+" and "+a+"."}),t.rank===1&&r.rank===1?t.as2D(1,-1).matMul(r.as2D(-1,1)).asScalar():t.rank===1&&r.rank===2?t.as2D(1,-1).matMul(r.as2D(r.shape[0],r.shape[1])).as1D():t.rank===2&&r.rank===1?t.matMul(r.as2D(-1,1)).as1D():t.matMul(r.as2D(r.shape[0],r.shape[1]))}}),dae=re({outerProduct_:function(n,e){var t=G(n,"v1","outerProduct"),r=G(e,"v2","outerProduct");return J(t.rank===1&&r.rank===1,function(){return"Error in outerProduct: inputs must be rank 1, but got ranks "+t.rank+" and "+r.rank+"."}),t.as2D(-1,1).matMul(r.as2D(1,-1))}}),cv=re({reverse_:function(n,e){var t=G(n,"x","reverse");if(t.rank===0)return t.clone();var r=ui(e,t.shape);return ce.runKernelFunc(function(i){return i.reverse(t,r)},{$x:t},function(i){return{$x:function(){return i.reverse(r)}}}).reshapeAs(t)}}
3794),fae=re({reverse1d_:function(n){var e=G(n,"x","reverse");return J(e.rank===1,function(){return"Error in reverse1D: x must be rank 1 but got rank "+e.rank+"."}),cv(e,0)}}),hae=re({reverse2d_:function(n,e){var t=G(n,"x","reverse");return J(t.rank===2,function(){return"Error in reverse2D: x must be rank 2 but got rank "+t.rank+"."}),cv(t,e)}}),pae=re({reverse3d_:function(n,e){var t=G(n,"x","reverse");return J(t.rank===3,function(){return"Error in reverse3D: x must be rank 3 but got rank "+t.rank+"."}),cv(t,e)}}),mae=re({reverse4d_:function(n,e){var t=G(n,"x","reverse");return J(t.rank===4,function(){return"Error in reverse4D: x must be rank 4 but got rank "+t.rank+"."}),cv(t,e)}});function ON(n,e,t,r,i,a){var s=G(n,"x","maxPool"),o=s,c=!1;s.rank===3&&(c=!0,o=s.as4D(1,s.shape[0],s.shape[1],s.shape[2])),J(o.rank===4,function(){return"Error in maxPool: input must be rank 4 but got rank "+o.rank+"."}),J(Wa(t,r),function(){return"Error in maxPool: Either strides or dilations must be 1. Got strides "+t+" and dilations '"+r+"'"}),a!=null&&J($r(i),function(){return"Error in maxPool: pad must be an integer when using, dimRoundingMode "+a+" but got pad "+i+"."});var u=Cg(o.shape,e,t,r,i,a);if(u.filterWidth===1&&u.filterHeight===1&&gi(u.inShape,u.outShape))return s.clone();var l=[o],d=ce.runKernelFunc(function(h,p){var g=h.maxPool(o,u);return p([o,g]),g},{x:o},function(h,p){var g=p[0],v=p[1];return{x:function(){return function(y,b,x,S,w,k,E,I){var P=G(y,"dy","maxPoolBackprop"),A=G(b,"input","maxPoolBackprop"),N=G(x,"output","maxPoolBackprop");J(A.rank===P.rank,function(){return"Rank of input ("+A.rank+") does not match rank of dy ("+P.rank+")"}),J(Wa(w,k),function(){return"Error in maxPoolBackProp: Either strides or dilations must be 1. Got strides "+w+" and dilations '"+k+"'"}),J(P.rank===4,function(){return"Error in maxPoolBackprop: dy must be rank 4 but got rank "+P.rank+"."}),J(A.rank===4,function(){return"Error in maxPoolBackprop: input must be rank 4 but got rank "+A.rank+"."});var j=Cg(A.shape,S,w,k,E,I);return ce.runKernelFunc(function(L){return L.maxPoolBackprop(P,A,N,j)},{$dy:P,$input:A})}(h,g,v,e,t,r,i)}}},"MaxPool",u,l);return c?d.as3D(d.shape[1],d.shape[2],d.shape[3]):d}function MN(n,e,t,r,i,a){var s=G(n,"x","avgPool","float32");J(Wa(t,r),function(){return"Error in avgPool: Either strides or dilations must be 1. Got strides "+t+" and dilations '"+r+"'"});var o=s,c=!1;s.rank===3&&(c=!0,o=s.as4D(1,s.shape[0],s.shape[1],s.shape[2])),J(o.rank===4,function(){return"Error in avgPool: x must be rank 4 but got rank "+o.rank+"."}),a!=null&&J($r(i),function(){return"Error in avgPool: pad must be an integer when using, dimRoundingMode "+a+" but got pad "+i+"."});var u=Cg(o.shape,e,t,r,i,a);if(u.filterWidth===1&&u.filterHeight===1&&gi(u.inShape,u.outShape))return s.clone();var l=ce.runKernelFunc(function(d){return d.avgPool(o,u)},{x:o},function(d){return{x:function(){return function(h,p,g,v,y,b){var x=G(h,"dy","avgPoolBackprop"),S=G(p,"input","avgPoolBackprop");J(S.rank===x.rank,function(){return"Rank of input ("+S.rank+") does not match rank of dy ("+x.rank+")"}),J(Wa(v,y),function(){return"Error in avgPoolBackprop: Either strides or dilations must be 1. Got strides "+v+" and dilations '"+y+"'"});var w=S,k=x,E=!1;S.rank===3&&(E=!0,w=S.as4D(1,S.shape[0],S.shape[1],S.shape[2]),k=x.as4D(1,x.shape[0],x.shape[1],x.shape[2])),J(k.rank===4,function(){return"Error in avgPoolBackprop: dy must be rank 4 but got rank "+k.rank+"."}),J(w.rank===4,function(){return"Error in avgPoolBackprop: input must be rank 4 but got rank "+w.rank+"."});var I=Cg(w.shape,g,v,y,b),P=ce.runKernelFunc(function(A){return A.avgPoolBackprop(k,w,I)},{dy4D:k,input4D:w});return E?P.as3D(P.shape[1],P.shape[2],P.shape[3]):P}(d,o,e,t,r,i)}}},"AvgPool",u);return l=l.cast(s.dtype),c?l.as3D(l.shape[1],l.shape[2],l.shape[3]):l}var di=re({maxPool_:function(n,e,t,r,i){return ON(n,e,t,1,r,i)}}),uv=re({avgPool_:function(n,e,t,r,i){return MN(n,e,t,1,r,i)}}),gae=re({pool_:function(n,e,t,r,i,a){i==null&&(i=[1,1]),a==null&&(a=1),r===0&&(r="valid");var s=G(n,"x","maxPool"),o=s,c=!1;s.rank===3&&(c=!0,o=s.as4D(1,s.shape[0],s.shape[1],s.shape[2])),J(Wa(a,i),function(){return"Error in pool: Either strides or dilations must be 1. Got strides "+a+" and dilations '"+i+"'"});var u,l=Cg(o.shape,e,a,i,r),d=[l.dilationHeight,l.dilationWidth];u=r==="same"?function(w,k){var E=w.map(function(A,N){return A+(A-1)*(k[N]-1)}).map(function(A){return A-1}),I=E.map(function(A){return Math.floor(A/2)}),P=E.map(function(A,N){return A-I[N]});return E.map(function(A,N){return[I[N],P[N]]})}([l.filterHeight,l.filterWidth],d):[[0,0],[0,0]];var h=d[0]===1&&d[1]===1,p=function(w,k,E){var I=E.map(function(V){return V[0]}),P=E.map(function(V){return V[1]}),A=w.concat(I,P),N=k.map(function(V,X){return(V-A[X]%V)%V}),j=P.map(function(V,X){return V+N[X]}),L=k.map(function(V,X){return[I[X],j[X]]}),B=k.map(function(V,X){return[0,N[X]]});return[L,B]}([l.inHeight,l.inWidth],d,u),g=p[0],v=p[1],y=h?r:"valid",b=h?o:B5(o,d,g),x=(t==="avg"?function(){return MN(b,e,a,1,y)}:function(){return ON(b,e,a,1,y)})(),S=h?x:L5(x,d,v);return c?S.as3D(S.shape[1],S.shape[2],S.shape[3]):S}}),vae=re({maxPool3d_:function(n,e,t,r,i,a,s){a===void 0&&(a="NDHWC");var o=G(n,"x","maxPool3d"),c=o,u=!1;o.rank===4&&(u=!0,c=o.as5D(1,o.shape[0],o.shape[1],o.shape[2],o.shape[3])),s==null&&(s=[1,1,1]),J(c.rank===5,function(){return"Error in maxPool3d: x must be rank 5 but got rank "+c.rank+"."}),J(a==="NDHWC",function(){return"Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of "+a}),J(Wa(t,s),function(){return"Error in maxPool3d: Either strides or dilations must be 1. Got strides "+t+" and dilations '"+s+"'"}),i!=null&&J($r(r),function(){return"Error in maxPool3d: pad must be an integer when using, dimRoundingMode "+i+" but got pad "+r
3794+"."});var l=o_(c.shape,e,t,s,r,i,a),d=ce.runKernelFunc(function(h,p){var g=h.maxPool3d(c,l);return p([c,g]),g},{x:c},function(h,p){var g=p[0],v=p[1];return{x:function(){return function(y,b,x,S,w,k,E,I){var P=G(y,"dy","maxPool3dBackprop"),A=G(b,"input","maxPool3dBackprop"),N=G(x,"output","maxPool3dBackprop"),j=P,L=A,B=N,V=!1;A.rank===4&&(V=!0,j=P.as5D(1,P.shape[0],P.shape[1],P.shape[2],P.shape[3]),L=A.as5D(1,A.shape[0],A.shape[1],A.shape[2],A.shape[3]),B=N.as5D(1,N.shape[0],N.shape[1],N.shape[2],N.shape[3])),J(j.rank===5,function(){return"Error in maxPool3dBackprop: dy must be rank 5 but got rank "+j.rank+"."}),J(L.rank===5,function(){return"Error in maxPool3dBackprop: input must be rank 5 but got rank "+L.rank+"."}),J(B.rank===5,function(){return"Error in maxPool3dBackprop: output must be rank 5 but got rank "+B.rank+"."}),k==null&&(k=[1,1,1]),J(Wa(w,k),function(){return"Error in maxPool3dBackprop: Either strides or dilations must be 1. Got strides "+w+" and dilations '"+k+"'"}),I!=null&&J($r(E),function(){return"Error in maxPool3dBackprop: pad must be an integer when using, dimRoundingMode "+I+" but got pad "+E+"."});var X=o_(L.shape,S,w,k,E,I),ne=ce.runKernelFunc(function(se){return se.maxPool3dBackprop(j,L,B,X)},{dy5D:j,input5D:L});return V?ne.as4D(ne.shape[1],ne.shape[2],ne.shape[3],ne.shape[4]):ne}(h,g,v,e,t,s,r,i)}}});return u?d.as4D(d.shape[1],d.shape[2],d.shape[3],d.shape[4]):d}}),yae=re({avgPool3d_:function(n,e,t,r,i,a,s){a===void 0&&(a="NDHWC");var o=G(n,"x","avgPool3d","float32"),c=o,u=!1;o.rank===4&&(u=!0,c=o.as5D(1,o.shape[0],o.shape[1],o.shape[2],o.shape[3])),s==null&&(s=[1,1,1]),J(c.rank===5,function(){return"Error in avgPool3d: x must be rank 5 but got rank "+c.rank+"."}),J(a==="NDHWC",function(){return"Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of "+a}),J(Wa(t,s),function(){return"Error in avgPool3d: Either strides or dilations must be 1. Got strides "+t+" and dilations '"+s+"'"}),i!=null&&J($r(r),function(){return"Error in avgPool3d: pad must be an integer when using, dimRoundingMode "+i+" but got pad "+r+"."});var l=o_(c.shape,e,t,s,r,i,a),d=ce.runKernelFunc(function(h){return h.avgPool3d(c,l)},{x:c},function(h){return{x:function(){return function(p,g,v,y,b,x,S){var w=G(p,"dy","avgPool3dBackprop"),k=G(g,"input","avgPool3dBackprop"),E=w,I=k,P=!1;k.rank===4&&(P=!0,E=w.as5D(1,w.shape[0],w.shape[1],w.shape[2],w.shape[3]),I=k.as5D(1,k.shape[0],k.shape[1],k.shape[2],k.shape[3])),J(E.rank===5,function(){return"Error in avgPool3dBackprop: dy must be rank 5 but got rank "+E.rank+"."}),J(I.rank===5,function(){return"Error in avgPool3dBackprop: input must be rank 5 but got rank "+I.rank+"."}),b==null&&(b=[1,1,1]),J(Wa(y,b),function(){return"Error in avgPool3dBackprop: Either strides or dilations must be 1. Got strides "+y+" and dilations '"+b+"'"}),S!=null&&J($r(x),function(){return"Error in maxPool3dBackprop: pad must be an integer when using, dimRoundingMode "+S+" but got pad "+x+"."});var A=o_(I.shape,v,y,b,x,S),N=ce.runKernelFunc(function(j){return j.avgPool3dBackprop(E,I,A)},{dy5D:E,input5D:I});return P?N.as4D(N.shape[1],N.shape[2],N.shape[3],N.shape[4]):N}(h,c,e,t,s,r,i)}}});return d=d.cast(c.dtype),u?d.as4D(d.shape[1],d.shape[2],d.shape[3],d.shape[4]):d}}),Xc=re({slice_:function(n,e,t){var r,i,a=G(n,"x","slice");if(a.rank===0)throw new Error("Slicing scalar is not possible");(r=typeof e=="number"?[e].concat(new Array(a.rank-1).fill(0)):e.length<a.rank?e.concat(new Array(a.rank-e.length).fill(0)):e.slice()).forEach(function(c){J(c!==-1,function(){return"slice() does not support negative begin indexing."})}),i=(i=t==null?new Array(a.rank).fill(-1):typeof t=="number"?[t].concat(new Array(a.rank-1).fill(-1)):t.length<a.rank?t.concat(new Array(a.rank-t.length).fill(-1)):t).map(function(c,u){return c>=0?c:(J(c===-1,function(){return"Negative size values should be exactly -1 but got "+c+" for the slice() size at index "+u+"."}),a.shape[u]-r[u])}),Vte(a,r,i);var s=a.shape,o={begin:r,size:i};return ce.runKernelFunc(function(c){return c.slice(a,r,i)},{x:a},function(c){for(var u=[],l=0;l<c.rank;l++)u.push([r[l],s[l]-r[l]-i[l]]);return{x:function(){return c.pad(u)}}},"Slice",o)}}),_ae=re({slice1d_:function(n,e,t){var r=G(n,"x","slice1d");return J(r.rank===1,function(){return"slice1d expects a rank-1 tensor, but got a rank-"+r.rank+" tensor"}),Xc(r,[e],[t])}}),bae=re({slice2d_:function(n,e,t){var r=G(n,"x","slice2d");return J(r.rank===2,function(){return"slice2d expects a rank-2 tensor, but got a rank-"+r.rank+" tensor"}),Xc(r,e,t)}}),DN=re({slice3d_:function(n,e,t){var r=G(n,"x","slice3d");return J(r.rank===3,function(){return"slice3d expects a rank-3 tensor, but got a rank-"+r.rank+" tensor"}),Xc(r,e,t)}}),xae=re({slice4d_:function(n,e,t){var r=G(n,"x","slice4d");return J(r.rank===4,function(){return"slice4d expects a rank-4 tensor, but got a rank-"+r.rank+" tensor"}),Xc(r,e,t)}});function NN(n,e,t,r,i){return e.rank<t.rank&&(e=e.reshape(za(e.shape,r))),n.rank<t.rank&&(n=n.reshape(za(n.shape,r))),{x:function(){var a=n.mul(t.equal(e).cast(n.dtype));return i==null?a:a.transpose(i)}}}var wae=re({all_:function(n,e,t){e===void 0&&(e=null),t===void 0&&(t=!1);var r=G(n,"x","all","bool"),i=ui(e,r.shape),a=i,s=ru(a,r.rank);s!=null&&(r=r.transpose(s),a=iu(a.length,r.rank));var o=ce.runKernelFunc(function(u){return u.all(r,a)},{$x:r});if(t){var c=za(o.shape,i);return o.reshape(c)}return o}}),Cae=re({any_:function(n,e,t){e===void 0&&(e=null),t===void 0&&(t=!1);var r=G(n,"x","any","bool"),i=ui(e,r.shape),a=i,s=ru(a,r.rank);s!=null&&(r=r.transpose(s),a=iu(a.length,r.rank));var o=ce.runKernelFunc(function(u){return u.any(r,a)},{$x:r});if(t){var c=za(o.shape,i);return o.reshape(c)}return o}}),kae=re({argMax_:function(n,e){e===void 0&&(e=0);var t=G(n,"x","argMax");e==null&&(e=0);var r=ui(e,t.shape),i=ru(r,t.rank);i!=null&&(t=t.transpose(i),r=iu(r.length,t.rank));var a={axis:r[0]},s=[t];return ce.runKernelFunc(function(o,c){var u=o.argMax(t,r[0]);return c([t]),u},{x:t},function(o,c){var u=c[0];return{x:function(){return dn(u)}}},"ArgMax",a,s)}}),Sae=re({argMin_:function(n,e){e===void 0&&(e=0);var t=G(n,"x","argMin");e==null&&(e=0);var r=ui(e,t.shape),i=ru(r,t.rank);return i!=null&&(t=t.transpose(i),r=iu(r.length,t.rank)),ce.runKernelFunc(function(a,s){var o=a.argMin(t,r[0]);return s([t]),o},{$x:t},function(a,s){var o=s[0];return{$x:function(){return dn(o)}}})}}),Tae=re({logSumExp_:function(n,e,t){e===void 0&&(e=null),t===void 0&&(t=!1);var r=G(n,"x","logSumExp"),i=ui(e,r.shape),a=r.max(i,!0),s=r.sub(a).exp().sum(i).log(),o=a.reshape(s.shape).add(s);if(t){var c=za(o.shape,i);return o.reshape(c)}return o}}),fb=re({max_:function(n,e,t){e===void 0&&(e=null),t===void 0&&(t=!1);var r=G(n,"x","max"),i=r,a=ui(e,r.shape),s=a,o=ru(s,r.rank);o!=null&&(r=r.transpose(o),s=iu(s.length,r.rank));var c=[r],u=ce.runKernelFunc(function(d,h){var p=d.max(r,s);return h([i,p]),p},{x:r},function(d,h){return NN(d,h[1],h[0],a,o)},"Max",{axes:s},c,[!0]);if(t){var l=za(u.shape,a);u=u.reshape(l)}return u}}),Eae=re({mean_:function(n,e,t){e===void 0&&(e=null),t===void 0&&(t=!1);var r=G(n,"x","mean"),i=ui(e,r.shape),a=ct(qi(r.shape,i)[1]);return ob(function(s){var o=Ke(a);return{value:(o.dtype===s.dtype?s:s.cast(o.dtype)).div(o).sum(e,t),gradFunc:function(c){var u=s.shape.slice();
3794return i.forEach(function(l){u[l]=1}),c.reshape(u).mul(Lp(s.shape,"float32")).div(a)}}})(r)}}),Pae=re({min_:function(n,e,t){e===void 0&&(e=null),t===void 0&&(t=!1);var r=G(n,"x","min"),i=r,a=ui(e,r.shape),s=a,o=ru(s,r.rank);o!=null&&(r=r.transpose(o),s=iu(s.length,r.rank));var c=[r],u=ce.runKernelFunc(function(d,h){var p=d.min(r,s);return h([i,p]),p},{x:r},function(d,h){return NN(d,h[1],h[0],a,o)},"Min",{axes:s},c,[!0]);if(t){var l=za(u.shape,a);u=u.reshape(l)}return u}}),Rae=re({moments_:function(n,e,t){e===void 0&&(e=null),t===void 0&&(t=!1);var r=ui(e,(n=G(n,"x","moments")).shape),i=n.mean(r,t),a=i.shape;t||(a=za(i.shape,r));var s=n.toFloat().sub(i.reshape(a)).square();return{mean:i,variance:s.mean(r,t)}}}),LN=re({sum_:function(n,e,t){e===void 0&&(e=null),t===void 0&&(t=!1);var r=G(n,"x","sum");r.dtype==="bool"&&(r=r.toInt());var i=ui(e,r.shape);return ob(function(a){var s=ru(i,a.rank),o=i,c=a;s!=null&&(c=a.transpose(s),o=iu(o.length,a.rank));var u=function(p){var g=a.shape.slice();return i.forEach(function(v){g[v]=1}),p.reshape(g).mul(Lp(a.shape,"float32"))},l={axes:o},d=ce.runKernelFunc(function(p){return p.sum(c,o)},{x:c},function(p){return{x:function(){return u(p)}}},"Sum",l);if(t){var h=za(d.shape,i);d=d.reshape(h)}return{value:d,gradFunc:u}})(r)}}),Aae=re({prod_:function(n,e,t){e===void 0&&(e=null),t===void 0&&(t=!1);var r=G(n,"x","prod");r.dtype==="bool"&&(r=r.toInt());var i=ui(e,r.shape),a=ru(i,r.rank),s=i,o=r;a!=null&&(o=r.transpose(a),s=iu(s.length,r.rank));var c=ce.runKernelFunc(function(l){return l.prod(o,s)},{permutedX:o});if(t){var u=za(c.shape,i);c=c.reshape(u)}return c}}
vendor: 1,267 bytes, line 3794
3794),FN=re({elu_:function(n){var e=G(n,"x","elu");return ce.runKernelFunc(function(t,r){var i=t.elu(e);return r([i]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){return ce.runKernelFunc(function(a){return a.eluDer(t,i)},{dy:t,y:i})}}})}}),Iae=re({leakyRelu_:function(n,e){e===void 0&&(e=.2);var t=G(n,"x","leakyRelu");return CS(Ke(e).mul(t),t)}}),$N=re({prelu_:function(n,e){var t=G(n,"x","prelu"),r=G(e,"alpha","prelu");return ce.runKernelFunc(function(i,a){var s=i.prelu(t,r);return a([t,r]),s},{x:t,alpha:r},function(i,a){var s=a[0],o=a[1],c=s.greater(0);return{x:function(){return yf(c,i,i.mul(o))},alpha:function(){var u=yf(c,dn(i),i.mul(s)),l=oi(o.shape,i.shape);return l.length>0&&(u=u.sum(l)),u.reshape(o.shape)}}},"Prelu")}}),vr=re({relu_:function(n){var e=G(n,"x","relu");return e.dtype==="bool"?e.toInt():ce.runKernelFunc(function(t,r){var i=t.relu(e);return r([e]),i},{x:e},function(t,r){var i=r[0];return{x:function(){return t.mulStrict(i.step().toFloat())}}},"Relu")}}),BN=re({relu6_:function(n){var e=G(n,"x","relu6");return e.dtype==="bool"?e.toInt():ce.runKernelFunc(function(t,r){var i=t.relu6(e);return r([e]),i},{x:e},function(t,r){var i=r[0],a=i.lessEqual(6).mul(i.step());return{x:function(){return t.mulStrict(a.toFloat())}}},"Relu6")}}
3794),Oae=re({selu_:function(n){var e=G(n,"x","selu");return ce.runKernelFunc(function(t,r){var i=t.selu(e);return r([e]),i},{$x:e},function(t,r){var i=r[0];return{$x:function(){var a=i.greater(Ke(0)),s=Ke(bS),o=Ke(xS),c=t.mul(o),u=t.mul(s).mul(i.toFloat().exp());return yf(a,c,u)}}})}}),Jl=re({transpose_:function(n,e){var t=G(n,"x","transpose");if(e==null&&(e=t.shape.map(function(i,a){return a}).reverse()),J(t.rank===e.length,function(){return"Error in transpose: rank of input "+t.rank+" must match length of perm "+e+"."}),e.forEach(function(i){J(i>=0&&i<t.rank,function(){return"All entries in 'perm' must be between 0 and "+(t.rank-1)+" but got "+e})}),t.rank<=1)return t.clone();var r={perm:e};return ce.runKernelFunc(function(i){return i.transpose(t,e)},{x:t},function(i){var a=lS(e);return{x:function(){return i.transpose(a)}}},"Transpose",r)}}),Mae=re({localResponseNormalization_:function(n,e,t,r,i){e===void 0&&(e=5),t===void 0&&(t=1),r===void 0&&(r=1),i===void 0&&(i=.5);var a=G(n,"x","localResponseNormalization");J(a.rank===4||a.rank===3,function(){return`Error in localResponseNormalization: x must be rank 3 or 4 but got 3795 rank `+a.rank+"."}),J($r(e),function(){return"Error in localResponseNormalization: depthRadius must be an integer but got depthRadius "+e+"."});var s=a,o=!1;a.rank===3&&(o=!0,s=a.as4D(1,a.shape[0],a.shape[1],a.shape[2]));var c=ce.runKernelFunc(function(u,l){var d=u.localResponseNormalization4D(s,e,t,r,i);return l([s,d]),d},{x4D:s},function(u,l){var d=l[0],h=l[1];return{x4D:function(){return ce.runKernelFunc(function(p){return p.LRNGrad(u,d,h,e,t,r,i)},{})}}});return o?c.as3D(c.shape[1],c.shape[2],c.shape[3]):c}}),UN=re({norm_:function(n,e,t,r){e===void 0&&(e="euclidean"),t===void 0&&(t=null),r===void 0&&(r=!1);var i=function o(c,u,l){if(l===void 0&&(l=null),c.rank===0)return c.abs();if(c.rank!==1&&l===null)return o(c.reshape([-1]),u,l);if(c.rank===1||typeof l=="number"||Array.isArray(l)&&l.length===1){if(u===1)return c.abs().sum(l);if(u===1/0)return c.abs().max(l);if(u===-1/0)return c.abs().min(l);if(u==="euclidean"||u===2)return c.abs().pow(Ke(2,"int32")).sum(l).sqrt();throw new Error("Error in norm: invalid ord value: "+u)}if(Array.isArray(l)&&l.length===2){if(u===1)return c.abs().sum(l[0]).max(l[1]-1);if(u===1/0)return c.abs().sum(l[1]).max(l[0]);if(u===-1/0)return c.abs().sum(l[1]).min(l[0]);if(u==="fro"||u==="euclidean")return c.square().sum(l).sqrt();throw new Error("Error in norm: invalid ord value: "+u)}throw new Error("Error in norm: invalid axis: "+l)}(n=G(n,"x","norm"),e,t),a=i.shape;if(r){var s=ui(t,n.shape);a=za(i.shape,s)}return i.reshape(a)}}),Dae=re({basicLSTMCell_:function(n,e,t,r,i,a){var s=G(n,"forgetBias","basicLSTMCell"),o=G(e,"lstmKernel","basicLSTMCell"),c=G(t,"lstmBias","basicLSTMCell"),u=G(r,"data","basicLSTMCell"),l=G(i,"c","basicLSTMCell"),d=G(a,"h","basicLSTMCell"),h=u.concat(d,1).matMul(o).add(c),p=h.shape[0],g=h.shape[1]/4,v=[p,g],y=h.slice([0,0],v),b=h.slice([0,g],v),x=h.slice([0,2*g],v),S=h.slice([0,3*g],v),w=y.sigmoid().mulStrict(b.tanh()).addStrict(l.mulStrict(s.add(x).sigmoid())),k=w.tanh().mulStrict(S.sigmoid());return[w,k]}}),Nae=re({multiRNNCell_:function(n,e,t,r){for(var i=G(e,"data","multiRNNCell"),a=t_(t,"c","multiRNNCell"),s=t_(r,"h","multiRNNCell"),o=i,c=[],u=0;u<n.length;u++){var l=n[u](o,a[u],s[u]);c.push(l[0]),c.push(l[1]),o=l[1]}var d=[],h=[];for(u=0;u<c.length;u+=2)d.push(c[u]),h.push(c[u+1]);return[d,h]}}),Lae=re({movingAverage_:function(n,e,t,r,i){i===void 0&&(i=!0);var a=G(n,"v","movingAverage"),s=G(e,"x","movingAverage"),o=G(t,"decay","movingAverage");Mee(a,s),J(gi(a.shape,s.shape),function(){return"Shape mismatch in v and x"});var c=Ke(1),u=c.sub(o),l=s.sub(a).mul(u);if(i){J(r!=null,function(){return"When using zeroDebias: true, step is required."});var d=G(r,"step","movingAverage");l=l.div(c.sub(d_(o,d)))}return a.add(l)}}),Fae=re({stridedSlice_:function(n,e,t,r,i,a,s,o,c){if(i===void 0&&(i=0),a===void 0&&(a=0),s===void 0&&(s=0),o===void 0&&(o=0),c===void 0&&(c=0),r==null&&(r=new Array(e.length)),s!==0)throw new Error("ellipsis mask is not yet supported");var u=G(n,"x","stridedSlice"),l=m4(o),d=u.shape.slice();l.forEach(function(y){e[y]=0,t[y]=1,d.splice(y,0,1)}),u=u.reshape(d);for(var h=0;h<u.rank;h++)e[h]=Gte(i,e,r,u.shape,h),t[h]=Kte(a,t,r,u.shape,h),r[h]=r[h]||1;var p=m4(c);p.forEach(function(y){t[y]=e[y]+1,r[y]=1});var g=pS(e,t,r),v=g.filter(function(y,b){return p.indexOf(b)===-1});return r.every(function(y){return y===1})?Xc(u,e,g).reshape(v):ce.runKernelFunc(function(y){return y.stridedSlice(u,e,t,r)},{$x:u}).reshape(v)}}),$ae=re({topk_:function(n,e,t){e===void 0&&(e=1),t===void 0&&(t=!0);var r=G(n,"x","topk");
vendor: 3,340 bytes, line 3795
3795if(r.rank===0)throw new Error("topk() expects the input to be of rank 1 or higher");var i=r.shape[r.shape.length-1];if(e>i)throw new Error("'k' passed to topk() must be <= the last dimension ("+i+") but got "+e);var a=ce.runKernelFunc(function(s){return s.topk(r,e,t)},{$x:r});return{values:a[0],indices:a[1]}}}),Bae=re({scatterND_:function(n,e,t){var r=G(n,"indices","scatterND","int32"),i=G(e,"updates","scatterND");return Hte(i,r,t),ce.runKernelFunc(function(a){return a.scatterND(r,i,t)},{indices:r,updates:i},null,"ScatterNd",{shape:t})}}),ES=re({fft_:function(n){J(n.dtype==="complex64",function(){return"The dtype for tf.spectral.fft() must be complex64 but got "+n.dtype+"."});var e=n.shape[n.shape.length-1],t=n.size/e,r=n.as2D(t,e);return ce.runKernelFunc(function(i){return i.fft(r)},{input:n}).reshape(n.shape)}}),f_=re({ifft_:function(n){J(n.dtype==="complex64",function(){return"The dtype for tf.spectral.ifft() must be complex64 but got "+n.dtype+"."});var e=n.shape[n.shape.length-1],t=n.size/e,r=n.as2D(t,e);return ce.runKernelFunc(function(i){return i.ifft(r)},{input:n}).reshape(n.shape)}}),PS=re({rfft_:function(n,e){J(n.dtype==="float32",function(){return"The dtype for rfft() must be real value but got "+n.dtype});var t,r=n.shape[n.shape.length-1],i=n.size/r;if(e!=null&&e<r){var a=n.shape.map(function(b){return 0}),s=n.shape.map(function(b){return b});s[n.shape.length-1]=e,t=n.slice(a,s),r=e}else if(e!=null&&e>r){var o=n.shape.map(function(b){return b});o[n.shape.length-1]=e-r,t=n.concat(Gn(o),n.shape.length-1),r=e}else t=n;var c=t.zerosLike(),u=Ti(t,c).as2D(i,r),l=ES(u),d=Math.floor(r/2)+1,h=oo(l),p=Dc(l),g=h.split([d,r-d],h.shape.length-1),v=p.split([d,r-d],p.shape.length-1),y=t.shape.slice();return y[t.shape.length-1]=d,Ti(g[0],v[0]).reshape(y)}}),jN=re({irfft_:function(n){var e=n.shape[n.shape.length-1],t=n.size/e;if(e<=2){var r=n.as2D(t,e),i=f_(r);return oo(i)}var a=[t,2*(e-1)],s=oo(n).as2D(t,e),o=Dc(n).as2D(t,e),c=s.slice([0,1],[t,e-2]).reverse(1),u=o.slice([0,1],[t,e-2]).reverse(1).mul(Ke(-1)),l=s.concat(c,1),d=o.concat(u,1);return r=Ti(l,d).as2D(a[0],a[1]),i=f_(r),oo(i)}}),Uae=Object.freeze({fft:ES,ifft:f_,rfft:PS,irfft:jN}),jae=re({sparseToDense_:function(n,e,t,r){r===void 0&&(r=0);var i=G(n,"sparseIndices","sparseToDense","int32"),a=G(e,"sparseValues","sparseToDense"),s=G(r,"defaultValue","sparseToDense",a.dtype);return function(o,c,u,l){if(o.dtype!=="int32")throw new Error("tf.sparseToDense() expects the indices to be int32 type, but the dtype was "+o.dtype+".");if(o.rank>2)throw new Error("sparseIndices should be a scalar, vector, or matrix, but got shape "+o.shape+".");var d=o.rank>0?o.shape[0]:1,h=o.rank>1?o.shape[1]:1;if(u.length!==h)throw new Error("outputShape has incorrect number of elements:, "+u.length+", should be: "+h+".");var p=c.size;if(c.rank!==0&&(c.rank!==1||p!==d))throw new Error("sparseValues has incorrect shape "+c.shape+", should be [] or ["+d+"]");if(c.dtype!==l.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(i,a,t,s),ce.runKernelFunc(function(o){return o.sparseToDense(i,a,t,s)},{$sparseIndices:i,$sparseValues:a,$defaultValue:s})}}),qae=re({gatherND_:function(n,e){var t=G(e,"indices","gatherND","int32"),r=G(n,"x","gatherND");return ce.runKernelFunc(function(i){return i.gatherND(r,t)},{x:r,indices:t},null,"GatherNd")}}
3795),zae=re({diag_:function(n){var e=G(n,"x","diag").flatten(),t=n.shape.concat(n.shape);return ce.runKernelFunc(function(r){return r.diag(e)},{$x:e}).reshape(t)}}),Wae=re({dropout_:function(n,e,t,r){var i=G(n,"x","dropout");if(J(i.dtype==="float32",function(){return"x has to be a floating point tensor since it's going to be scaled, but got a "+i.dtype+" tensor instead."}),J(e>=0&&e<1,function(){return"rate must be a float in the range [0, 1), but got "+e+"."}),e===0)return n instanceof mr?i.clone():i;var a=function(c,u){if(u==null)return c.shape.slice();if(gi(c.shape,u))return u;if(c.shape.length===u.length){for(var l=[],d=0;d<c.shape.length;d++)u[d]==null&&c.shape[d]!=null?l.push(c.shape[d]):l.push(u[d]);return l}return u}(i,t),s=1-e,o=$5(a,0,1,"float32",r).add(s).floor().div(s);return i.mul(o)}});function qN(n,e,t){for(var r=1-n%2,i=new Float32Array(n),a=0;a<n;++a){var s=2*Math.PI*a/(n+r-1);i[a]=e-t*Math.cos(s)}return Hr(i,"float32")}var RS=re({hannWindow_:function(n){return qN(n,.5,.5)}}),zN=re({hammingWindow_:function(n){return qN(n,.54,.46)}}),AS=re({frame_:function(n,e,t,r,i){r===void 0&&(r=!1),i===void 0&&(i=0);for(var a=0,s=[];a+e<=n.size;)s.push(Xc(n,a,e)),a+=t;if(r)for(;a<n.size;){var o=a+e-n.size,c=ai([Xc(n,a,e-o),Kc([o],i)]);s.push(c),a+=t}return s.length===0?$l([],[0,e]):ai(s).as2D(s.length,e)}}),WN=re({stft_:function(n,e,t,r,i){var a;i===void 0&&(i=RS),r==null&&(a=e,r=Math.floor(Math.pow(2,Math.ceil(Math.log(a)/Math.log(2)))));for(var s=AS(n,e,t),o=Ki(s,i(e)),c=[],u=0;u<s.shape[0];u++)c.push(PS(o.slice([u,0],[1,e]),r));return ai(c)}}),Hae=Object.freeze({hannWindow:RS,hammingWindow:zN,frame:AS,stft:WN}),Hi,Vae=function(n,e,t){return t===void 0&&(t=1),at(this,void 0,void 0,function(){var r,i,a,s,o,c,u,l,d,h,p,g,v,y;return st(this,function(b){switch(b.label){case 0:return r=G(n,"predictions","inTopK"),i=G(e,"targets","inTopK"),J(r.rank>1,function(){return"inTopK() expects the predictions to be of rank 2 or higher, but got "+r.rank}),J(r.rank-1===i.rank,function(){return"predictions rank should be 1 larger than targets rank, but got predictions rank "+r.rank+" and targets rank "+i.rank}),Pn(r.shape.slice(0,r.shape.length-1),i.shape,"predictions's shape should be align with the targets' shape, except the last dimension."),a=r.shape[r.shape.length-1],J(t>0&&t<=a,function(){return"'k' passed to inTopK() must be > 0 && <= the predictions last dimension ("+a+"), but got "+t}),[4,r.data()];case 1:return s=b.sent(),[4,i.data()];case 2:for(o=b.sent(),c=[s.length/a,a],l=c[1],d=bg("bool",u=c[0]),h=0;h<u;h++){for(p=h*l,g=s.subarray(p,p+l),v=[],y=0;y<g.length;y++)v.push({value:g[y],index:y});for(v.sort(function(x,S){return S.value-x.value}),d[h]=0,y=0;y<t;y++)if(v[y].index===o[h]){d[h]=1;break}}return n!==r&&r.dispose(),e!==i&&i.dispose(),[2,Pi(d,i.shape,"bool")]}})})};(function(n){n[n.NONE=0]="NONE",n[n.MEAN=1]="MEAN",n[n.SUM=2]="SUM",n[n.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"})(Hi||(Hi={}));var Gae=re({absoluteDifference_:function(n,e,t,r){r===void 0&&(r=Hi.SUM_BY_NONZERO_WEIGHTS);var i=G(n,"labels","absoluteDifference"),a=G(e,"predictions","absoluteDifference"),s=null;t!=null&&(s=G(t,"weights","absoluteDifference")),Pn(i.shape,a.shape,"Error in absoluteDifference: ");var o=i.sub(a).abs();return nl(o,s,r)}}),nl=re({computeWeightedLoss_:function(n,e,t){t===void 0&&(t=Hi.SUM_BY_NONZERO_WEIGHTS);var r=G(n,"losses","computeWeightedLoss"),i=null;e!=null&&(i=G(e,"weights","computeWeightedLoss"));var a=i==null?r:r.mul(i);if(t===Hi.NONE)return a;if(t===Hi.SUM)return a.sum();if(t===Hi.MEAN){if(i==null)return a.mean();var s=r.size/i.size,o=a.sum().div(i.sum());return s>1?o.div(Ke(s)):o}if(t===Hi.SUM_BY_NONZERO_WEIGHTS){if(i==null)return a.sum().div(Ke(r.size));var c=i.mul(Lp(r.shape)).notEqual(Ke(0)).sum().toFloat();return a.sum().div(c)}throw Error("Unknown reduction: "+t)}}),Kae=re({cosineDistance_:function(n,e,t,r,i){i===void 0&&(i=Hi.SUM_BY_NONZERO_WEIGHTS);var a=G(n,"labels","cosineDistance"),s=G(e,"predictions","cosineDistance"),o=null;r!=null&&(o=G(r,"weights","cosineDistance")),Pn(a.shape,s.shape,"Error in cosineDistance: ");var c=Ke(1).sub(a.mul(s).sum(t,!0));return nl(c,o,i)}}),Yae=re({hingeLoss_:function(n,e,t,r){r===void 0&&(r=Hi.SUM_BY_NONZERO_WEIGHTS);var i=G(n,"labels","hingeLoss"),a=G(e,"predictions","hingeLoss"),s=null;t!=null&&(s=G(t,"weights","hingeLoss")),Pn(i.shape,a.shape,"Error in hingeLoss: ");var o=Ke(1);i=Ke(2).mul(i).sub(o);var c=o.sub(i.mul(a)).relu();return nl(c,s,r)}}),Xae=re({huberLoss_:function(n,e,t,r,i){r===void 0&&(r=1),i===void 0&&(i=Hi.SUM_BY_NONZERO_WEIGHTS);var a=G(n,"labels","huberLoss"),s=G(e,"predictions","huberLoss"),o=null;t!=null&&(o=G(t,"weights","huberLoss")),Pn(a.shape,s.shape,"Error in huberLoss: ");var c=Ke(r),u=s.sub(a).abs(),l=CN(u,c),d=u.sub(l),h=Ke(.5).mul(l.square()).add(c.mul(d));return nl(h,o,i)}}),Jae=re({logLoss_:function(n,e,t,r,i){r===void 0&&(r=1e-7),i===void 0&&(i=Hi.SUM_BY_NONZERO_WEIGHTS);var a=G(n,"labels","logLoss"),s=G(e,"predictions","logLoss"),o=null;t!=null&&(o=G(t,"weights","logLoss")),Pn(a.shape,s.shape,"Error in logLoss: ");
vendor: 4,409 bytes, line 3795
3795var c=Ke(1),u=Ke(r),l=a.mul(s.add(u).log()).neg().sub(c.sub(a).mul(c.sub(s).add(u).log()));return nl(l,o,i)}}),Qae=re({meanSquaredError_:function(n,e,t,r){r===void 0&&(r=Hi.SUM_BY_NONZERO_WEIGHTS);var i=G(n,"labels","meanSquaredError"),a=G(e,"predictions","meanSquaredError"),s=null;t!=null&&(s=G(t,"weights","meanSquaredError")),Pn(i.shape,a.shape,"Error in meanSquaredError: ");var o=i.squaredDifference(a);return nl(o,s,r)}}),Zae=re({sigmoidCrossEntropy_:function(n,e,t,r,i){r===void 0&&(r=0),i===void 0&&(i=Hi.SUM_BY_NONZERO_WEIGHTS);var a=G(n,"multiClassLabels","sigmoidCrossEntropy"),s=G(e,"logits","sigmoidCrossEntropy"),o=null;if(t!=null&&(o=G(t,"weights","sigmoidCrossEntropy")),Pn(a.shape,s.shape,"Error in sigmoidCrossEntropy: "),r>0){var c=Ke(r),u=Ke(1),l=Ke(.5);a=a.mul(u.sub(c)).add(l.mul(c))}var d=function(h,p){var g=G(h,"labels","sigmoidCrossEntropyWithLogits"),v=G(p,"logits","sigmoidCrossEntropyWithLogits");Pn(g.shape,v.shape,"Error in sigmoidCrossEntropyWithLogits: ");var y=v.relu(),b=v.mul(g),x=v.abs().neg().exp().log1p();return y.sub(b).add(x)}(a,s);return nl(d,o,i)}}),ese=re({softmaxCrossEntropy_:function(n,e,t,r,i){r===void 0&&(r=0),i===void 0&&(i=Hi.SUM_BY_NONZERO_WEIGHTS);var a=G(n,"onehotLabels","softmaxCrossEntropy"),s=G(e,"logits","softmaxCrossEntropy"),o=null;if(t!=null&&(o=G(t,"weights","softmaxCrossEntropy")),Pn(a.shape,s.shape,"Error in softmaxCrossEntropy: "),r>0){var c=Ke(r),u=Ke(1),l=Ke(a.shape[1]);a=a.mul(u.sub(c)).add(c.div(l))}var d=function(h,p,g){if(g===void 0&&(g=-1),g===-1&&(g=p.rank-1),g!==p.rank-1)throw Error("Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank "+p.rank+" and dim was "+g);return ob(function(v,y,b){var x=y.logSumExp([g],!0),S=y.toFloat().sub(x);return b([v,S]),{value:S.mul(v).neg().sum([g]),gradFunc:function(w,k){var E=k[0],I=k[1],P=za(w.shape,[g]);return[w.reshape(P).mul(E.toFloat().sub(I.exp())),w.reshape(P).mul(I.exp().sub(E.toFloat()))]}}})(h,p)}(a,s);return nl(d,o,i)}}),tse=Object.freeze({get Reduction(){return Hi},absoluteDifference:Gae,computeWeightedLoss:nl,cosineDistance:Kae,hingeLoss:Yae,huberLoss:Xae,logLoss:Jae,meanSquaredError:Qae,sigmoidCrossEntropy:Zae,softmaxCrossEntropy:ese});function F4(n,e){return e===void 0&&(e=!1),ce.tidy(function(){if(n.shape.length!==2)throw new Error("qr2d() requires a 2D Tensor, but got a "+n.shape.length+"D Tensor.");for(var t=n.shape[0],r=n.shape[1],i=F5(t),a=n.clone(),s=$l([[1]],[1,1]),o=s.clone(),c=t>=r?r:t,u=function(d){var h,p=a,g=o,v=i;h=ce.tidy(function(){var y=a.slice([d,d],[t-d,1]),b=y.norm(),x=a.slice([d,d],[1,1]),S=$l([[-1]]).where(x.greater(0),$l([[1]])),w=x.sub(S.mul(b)),k=y.div(w);o=k.shape[0]===1?s.clone():s.concat(k.slice([1,0],[k.shape[0]-1,k.shape[1]]),0);var E=S.matMul(w).div(b).neg(),I=a.slice([d,0],[t-d,r]),P=E.mul(o);if(d===0)a=I.sub(P.matMul(o.transpose().matMul(I)));else{var A=I.sub(P.matMul(o.transpose().matMul(I)));a=a.slice([0,0],[d,r]).concat(A,0)}var N=i.slice([0,d],[t,i.shape[1]-d]);if(d===0)i=N.sub(N.matMul(o).matMul(P.transpose()));else{var j=N.sub(N.matMul(o).matMul(P.transpose()));i=i.slice([0,0],[t,d]).concat(j,1)}return[o,a,i]}),o=h[0],a=h[1],i=h[2],$a([p,g,v])},l=0;l<c;++l)u(l);return!e&&t>r&&(i=i.slice([0,0],[t,r]),a=a.slice([0,0],[r,r])),[i,a]})}var nse=re({bandPart_:function(n,e,t){if(e%1!=0)throw new Error("bandPart(): numLower must be an integer, got "+e+".");if(t%1!=0)throw new Error("bandPart(): numUpper must be an integer, got "+t+".");var r=G(n,"a","bandPart");if(r.rank<2)throw new Error("bandPart(): Rank must be at least 2, got "+r.rank+".");var i=r.shape,a=r.shape.slice(-2),s=a[0],o=a[1];if(!(e<=s))throw new Error("bandPart(): numLower ("+e+") must not be greater than the number of rows ("+s+").");if(!(t<=o))throw new Error("bandPart(): numUpper ("+t+") must not be greater than the number of columns ("+o+").");e<0&&(e=s),t<0&&(t=o);var c=n_(0,s,1,"int32").reshape([-1,1]),u=n_(0,o,1,"int32"),l=ci(c,u),d=ub(l.lessEqual(Ke(+e,"int32")),l.greaterEqual(Ke(-t,"int32"))),h=Gn([s,o],r.dtype);return ws(si(r.reshape([-1,s,o])).map(function(p){return yf(d,p,h)})).reshape(i)}}),rse=re({gramSchmidt_:function(n){var e;if(Array.isArray(n)){e=!1,J(n!=null&&n.length>0,function(){return"Gram-Schmidt process: input must not be null, undefined, or empty"});for(var t=n[0].shape[0],r=function(c){J(n[c].shape[0]===t,function(){return"Gram-Schmidt: Non-unique lengths foun
3795d in the input vectors: ("+n[c].shape[0]+" vs. "+t+")"})},i=1;i<n.length;++i)r(i)}else e=!0,n=fS(n,n.shape[0],0).map(function(c){return U5(c,[0])});J(n.length<=n[0].shape[0],function(){return"Gram-Schmidt: Number of vectors ("+n.length+") exceeds number of dimensions ("+n[0].shape[0]+")."});var a=[],s=n,o=function(c){a.push(ce.tidy(function(){var u=s[c];if(c>0)for(var l=0;l<c;++l){var d=LN(a[l].mulStrict(u)).mul(a[l]);u=u.sub(d)}return u.div(UN(u,"euclidean"))}))};for(i=0;i<n.length;++i)o(i);return e?ws(a,0):a}}),ise=re({qr_:function(n,e){if(e===void 0&&(e=!1),n.rank<2)throw new Error("qr() requires input tensor to have a rank >= 2, but got rank "+n.rank);if(n.rank===2)return F4(n,e);var t=n.shape.slice(0,n.shape.length-2).reduce(function(s,o){return s*o}),r=si(n.reshape([t,n.shape[n.shape.length-2],n.shape[n.shape.length-1]]),0),i=[],a=[];return r.forEach(function(s){var o=F4(s,e),c=o[0],u=o[1];i.push(c),a.push(u)}),[ws(i,0).reshape(n.shape),ws(a,0).reshape(n.shape)]}}),ase=Object.freeze({bandPart:nse,gramSchmidt:rse,qr:ise});function hb(n,e,t,r,i,a){r==null&&(r=.5),i==null&&(i=Number.NEGATIVE_INFINITY),a==null&&(a=0);var s=n.shape[0];return t=Math.min(t,s),J(0<=r&&r<=1,function(){return"iouThreshold must be in [0, 1], but was '"+r+"'"}),J(n.rank===2,function(){return"boxes must be a 2D tensor, but was of rank '"+n.rank+"'"}),J(n.shape[1]===4,function(){return"boxes must have 4 columns, but 2nd dimension was "+n.shape[1]}),J(e.rank===1,function(){return"scores must be a 1D tensor"}),J(e.shape[0]===s,function(){return"scores has incompatible shape with boxes. Expected "+s+", but was "+e.shape[0]}),J(0<=a&&a<=1,function(){return"softNmsSigma must be in [0, 1], but was '"+a+"'"}),{maxOutputSize:t,iouThreshold:r,scoreThreshold:i,softNmsSigma:a}}var sse=re({resizeBilinear_:function(n,e,t){t===void 0&&(t=!1);var r=G(n,"images","resizeBilinear");J(r.rank===3||r.rank===4,function(){return"Error in resizeBilinear: x must be rank 3 or 4, but got rank "+r.rank+"."}),J(e.length===2,function(){return"Error in resizeBilinear: new shape must 2D, but got shape "+e+"."});var i=r,a=!1;r.rank===3&&(a=!0,i=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var s=e[0],o=e[1],c=ce.runKernelFunc(function(u,l){return l([i]),u.resizeBilinear(i,s,o,t)},{x:i},function(u,l){return{x:function(){return ce.runKernelFunc(function(d){return d.resizeBilinearBackprop(u,l[0],t)},{})}}},"ResizeBilinear",{alignCorners:t,newHeight:s,newWidth:o});return a?c.as3D(c.shape[1],c.shape[2],c.shape[3]):c}}),ose=re({resizeNearestNeighbor_:function(n,e,t){t===void 0&&(t=!1);var r=G(n,"images","resizeNearestNeighbor");J(r.rank===3||r.rank===4,function(){return"Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank "+r.rank+"."}),J(e.length===2,function(){return"Error in resizeNearestNeighbor: new shape must 2D, but got shape "+e+"."}),J(r.dtype==="float32"||r.dtype==="int32",function(){return"`images` must have `int32` or `float32` as dtype"});var i=r,a=!1;r.rank===3&&(a=!0,i=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var s=e[0],o=e[1],c=ce.runKernelFunc(function(u,l){return l([i]),u.resizeNearestNeighbor(i,s,o,t)},{batchImages:i},function(u,l){return{batchImages:function(){return ce.runKernelFunc(function(d){return d.resizeNearestNeighborBackprop(u,l[0],t)},{})}}});return a?c.as3D(c.shape[1],c.shape[2],c.shape[3]):c}}),cse=re({nonMaxSuppression_:function(n,e,t,r,i){r===void 0&&(r=.5),i===void 0&&(i=Number.NEGATIVE_INFINITY);var a=G(n,"boxes","nonMaxSuppression"),s=G(e,"scores","nonMaxSuppression"),o=hb(a,s,t,r,i);t=o.maxOutputSize,r=o.iouThreshold,i=o.scoreThreshold;var c={maxOutputSize:t,iouThreshold:r,scoreThreshold:i};return ce.runKernelFunc(function(u){return u.nonMaxSuppression(a,s,t,r,i)},{boxes:a,scores:s},null,"NonMaxSuppressionV3",c)}}),use=function(n,e,t,r,i){return r===void 0&&(r=.5),i===void 0&&(i=Number.NEGATIVE_INFINITY),at(this,void 0,void 0,function(){var a,s,o,c,u,l,d;return st(this,function(h){switch(h.label){case 0:return a=G(n,"boxes","nonMaxSuppressionAsync"),s=G(e,"scores","nonMaxSuppressionAsync"),o=hb(a,s,t,r,i),t=o.maxOutputSize,r=o.iouThreshold,i=o.scoreThreshold,[4,Promise.all([a.data(),s.data()])];case 1:return c=h.sent(),u=c[0],l=c[1],d=gS(u,l,t,r,i),a!==n&&a.dispose(),s!==e&&s.dispose(),[2,d]}})})},lse=re({nonMaxSuppressionWithScore_:function(n,e,t,r,i,a){r===void 0&&(r=.5),i===void 0&&(i=Number.NEGATIVE_INFINITY),a===void 0&&(a=0);var s=G(n,"boxes","nonMaxSuppression"),o=G(e,"scores","nonMaxSuppression"),c=hb(s,o,t,r,i,a),u={maxOutputSize:t=c.maxOutputSize,iouThreshold:r=c.iouThreshold,scoreThreshold:i=c.scoreThreshold,softNmsSigma:a=c.softNmsSigma},l=ce.runKernel("NonMaxSuppressionV5",{boxes:s,scores:o},u);return{selectedIndices:l[0],selectedScores:l[1]}}}),dse=function(n,e,t,r,i,a){return r===void 0&&(r=.5),i===void 0&&(i=Number.NEGATIVE_INFINITY),a===void 0&&(a=0),at(this,void 0,void 0,function(){var s,o,c,u,l,d,h;return st(this,function(p){switch(p.label){case 0:return s=G(n,"boxes","nonMaxSuppressionAsync"),o=G(e,"scores","nonMaxSuppressionAsync"),
3795c=hb(s,o,t,r,i,a),t=c.maxOutputSize,r=c.iouThreshold,i=c.scoreThreshold,a=c.softNmsSigma,[4,Promise.all([s.data(),o.data()])];case 1:return u=p.sent(),l=u[0],d=u[1],h=vS(l,d,t,r,i,a),s!==n&&s.dispose(),o!==e&&o.dispose(),[2,h]}})})},fse=re({cropAndResize_:function(n,e,t,r,i,a){var s=G(n,"image","cropAndResize"),o=G(e,"boxes","cropAndResize","float32"),c=G(t,"boxInd","cropAndResize","int32");i=i||"bilinear",a=a||0;var u=o.shape[0];return J(s.rank===4,function(){return"Error in cropAndResize: image must be rank 4,but got rank "+s.rank+"."}),J(o.rank===2&&o.shape[1]===4,function(){return"Error in cropAndResize: boxes must be have size ["+u+",4] but had shape "+o.shape+"."}),J(c.rank===1&&c.shape[0]===u,function(){return"Error in cropAndResize: boxInd must be have size ["+u+"] but had shape "+o.shape+"."}),J(r.length===2,function(){return"Error in cropAndResize: cropSize must be of length 2, but got length "+r.length+"."}),J(r[0]>=1&&r[1]>=1,function(){return"cropSize must be atleast [1,1], but was "+r}),J(i==="bilinear"||i==="nearest",function(){return"method must be bilinear or nearest, but was "+i}),ce.runKernelFunc(function(l,d){return l.cropAndResize(s,o,c,r,i,a)},{images:s,boxes:o,boxInd:c},null,"CropAndResize",{method:i,extrapolationValue:a,cropSize:r})}}),IS=Object.freeze({resizeBilinear:sse,resizeNearestNeighbor:ose,nonMaxSuppression:cse,nonMaxSuppressionAsync:use,nonMaxSuppressionWithScore:lse,nonMaxSuppressionWithScoreAsync:dse,cropAndResize:fse}),OS=function(n,e){return!(n>0)||e==="linear"},MS=function(n,e,t){if(t==null||t==="linear")return n;if(t==="relu")return n.mul(e.step());throw new Error("Gradient for activation "+t+" has not been implemented yet.")},DS=function(n,e){var t=e,r=oi(n.shape,e.shape);return r.length>0&&(t=t.sum(r)),t.reshape(n.shape)},NS=function(n,e,t){if(e==="linear")return n;if(e==="relu")return vr(n);if(e==="elu")return FN(n);if(e==="relu6")return BN(n);if(e==="prelu")return $N(n,t);throw new Error("Unknown fused activation "+e+".")},hse=re({fusedMatMul_:function(n){var e,t=n.a,r=n.b,i=n.transposeA,a=i!==void 0&&i,s=n.transposeB,o=s!==void 0&&s,c=n.bias,u=n.activation,l=u===void 0?"linear":u,d=n.preluActivationWeights;if(OS(ce.state.gradientDepth,l)===!1){var h=db(t,r,a,o);return c!=null&&(h=Xt(h,c)),NS(h,l,d)}var p=G(t,"a","fused matMul"),g=G(r,"b","fused matMul");e=yr(p,g),p=e[0],g=e[1];var v=a?p.shape[p.rank-2]:p.shape[p.rank-1],y=o?g.shape[g.rank-1]:g.shape[g.rank-2],b=a?p.shape[p.rank-1]:p.shape[p.rank-2],x=o?g.shape[g.rank-2]:g.shape[g.rank-1],S=p.shape.slice(0,-2),w=g.shape.slice(0,-2),k=ct(S),E=ct(w);J(p.rank>=2&&g.rank>=2&&p.rank===g.rank,function(){return"Error in fused matMul: inputs must have the same rank of at least 2, got ranks "+p.rank+" and "+g.rank+"."}),J(gi(S,w),function(){return"Error in fused matMul: outer dimensions ("+S+") and ("+w+") of Tensors with shapes "+p.shape+" and "+g.shape+" must match."}),J(v===y,function(){return"Error in fused matMul: inner shapes ("+v+") and ("+y+") of Tensors with shapes "+p.shape+" and "+g.shape+" and transposeA="+a+" and transposeB="+o+" must match."});var I,P,A=p.shape.slice(0,-2).concat([b,x]),N=a?p.as3D(k,v,b):p.as3D(k,b,v),j=o?g.as3D(E,x,y):g.as3D(E,y,x);c!=null&&tn(A,(I=yr(I=G(c,"bias","fused matMul"),p)[0]).shape),d!=null&&(P=G(d,"prelu weights","fused matMul"));var L={a:N,b:j};c!=null&&(L.bias=I),d!=null&&(L.preluActivationWeights=P);var B=[N,j];return ce.runKernelFunc(function(V,X){var ne=V.fusedBatchMatMul({a:N,b:j,transposeA:a,transposeB:o,bias:I,activation:l,preluActivationWeights:P});return X([N,j,ne]),ne},L,function(V,X){var ne=X[0],se=X[1],ie=X[2],de=MS(V,ie,l),ue={};return c!=null&&(ue={bias:function(){return DS(I,de)}}),Object.assign(a||o?!a&&o?{a:function(){return de.matMul(se,!1,!1)},b:function(){return de.matMul(ne,!0,!1)}}:a&&!o?{a:function(){return se.matMul(de,!1,!0)},b:function(){return ne.matMul(de,!1,!1)}}:{a:function(){return se.matMul(de,!0,!0)},b:function(){return de.matMul(ne,!0,!0)}}:{a:function(){return de.matMul(se,!1,!0)},b:function(){return ne.matMul(de,!0,!1)}},ue)},"_FusedMatMul",{transposeA:a,transposeB:o,activation:l},B,[!0]).reshape(A)}}),pse=re({fusedConv2d_:function(n){var e=n.x,t=n.filter,r=n.strides,i=n.pad,a=n.dataFormat,s=a===void 0?"NHWC":a,o=n.dilations,c=o===void 0?[1,1]:o,u=n.dimRoundingMode,l=n.bias,d=n.activation,h=d===void 0?"linear":d,p=n.preluActivationWeights;if(h=h||"linear",OS(ce.state.gradientDepth,h)===!1){var g=yo(e,t,r,i,s,c,u);return l!=null&&(g=Xt(g,l)),NS(g,h,p)}var v=G(e,"x","conv2d"),y=G(t,"filter","conv2d"),b=v,x=!1;v.rank===3&&(x=!0,b=v.as4D(1,v.shape[0],v.shape[1],v.shape[2])),J(b.rank===4,function(){return"Error in fused conv2d: input must be rank 4, but got rank "+b.rank+"."}),J(y.rank===4,function(){return"Error in fused conv2d: filter must be rank 4, but got rank "+y.rank+"."}),u!=null&&J($r(i),function(){return"Error in fused conv2d: pad must be an integer when using, dimRoundingMode "+u+" but got pad "+i+"."}),J(b.shape[3]===y.shape[2],function(){return"Error in conv2d: depth of input ("+b.
3795shape[3]+") must match input depth for filter "+y.shape[2]+"."}),J(Wa(r,c),function(){return"Error in conv2D: Either strides or dilations must be 1. Got strides "+r+" and dilations '"+c+"'"}),J(s==="NHWC",function(){return"Error in conv2d: got dataFormat of "+s+" but only NHWC is currently supported."});var S,w,k=Af(b.shape,y.shape,r,c,i,u);l!=null&&(S=yr(S=G(l,"bias","fused conv2d"),v)[0],tn(k.outShape,S.shape)),p!=null&&(w=G(p,"prelu weights","fused conv2d"));var E={x:b,filter:y};l!=null&&(E.bias=S),p!=null&&(E.preluActivationWeights=w);var I=[y,b],P=ce.runKernelFunc(function(A,N){var j=A.fusedConv2d({input:b,filter:y,convInfo:k,bias:S,activation:h,preluActivationWeights:w});return N([y,b,j]),j},E,function(A,N){var j=N,L=j[0],B=j[1],V=j[2],X=MS(A,V,h);J(lp(c),function(){return"Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '"+c+"'"});var ne={};return l!=null&&(ne={bias:function(){return DS(S,X)}}),Object.assign({x:function(){return RN(B.shape,X,L,r,i)},filter:function(){return SS(B,X,L.shape,r,i)}},ne)},"FusedConv2D",{convInfo:k,activation:h},I,[!0]);return x?P.as3D(P.shape[1],P.shape[2],P.shape[3]):P}}),mse=re({fusedDepthwiseConv2d_:function(n){var e=n.x,t=n.filter,r=n.strides,i=n.pad,a=n.dataFormat,s=a===void 0?"NHWC":a,o=n.dilations,c=o===void 0?[1,1]:o,u=n.dimRoundingMode,l=n.bias,d=n.activation,h=d===void 0?"linear":d,p=n.preluActivationWeights;if(OS(ce.state.gradientDepth,h)===!1){var g=lb(e,t,r,i,s,c,u);return l!=null&&(g=Xt(g,l)),NS(g,h,p)}var v=G(e,"x","depthwiseConv2d"),y=G(t,"filter","depthwiseConv2d"),b=v,x=!1;v.rank===3&&(x=!0,b=v.as4D(1,v.shape[0],v.shape[1],v.shape[2])),J(b.rank===4,function(){return"Error in fused depthwiseConv2d: input must be rank 4, but got rank "+b.rank+"."}),J(y.rank===4,function(){return"Error in fused depthwiseConv2d: filter must be rank 4, but got rank "+y.rank+"."}),J(b.shape[3]===y.shape[2],function(){return"Error in fused depthwiseConv2d: number of input channels ("+b.shape[3]+") must match the inChannels dimension in filter "+y.shape[2]+"."}),c==null&&(c=[1,1]),J(Wa(r,c),function(){return"Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides "+r+" and dilations '"+c+"'"}),u!=null&&J($r(i),function(){return"Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode "+u+" but got pad "+i+"."});var S,w,k=Af(b.shape,y.shape,r,c,i,u,!0);l!=null&&(S=yr(S=G(l,"bias","fused conv2d"),v)[0],tn(k.outShape,S.shape)),p!=null&&(w=G(p,"prelu weights","fused depthwiseConv2d"));var E={x:b,filter:y};l!=null&&(E.bias=S),p!=null&&(E.preluActivationWeights=w);var I=[y,b],P=ce.runKernelFunc(function(A,N){var j=A.fusedDepthwiseConv2D({input:b,filter:y,convInfo:k,bias:S,activation:h,preluActivationWeights:w});return N([y,b,j]),j},E,function(A,N){J(lp(c),function(){return"Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '"+c+"'"});var j=N[0],L=N[1],B=N[2],V=MS(A,B,h),X={};return l!=null&&(X={bias:function(){return DS(S,V)}}),Object.assign({x:function(){return AN(L.shape,V,j,k)},filter:function(){return IN(L,V,j.shape,k)}},X)},"FusedDepthwiseConv2D",{convInfo:k,activation:h},I,[!0]);return x?P.as3D(P.shape[1],P.shape[2],P.shape[3]):P}}),gse=Object.freeze({matMul:hse,conv2d:pse,depthwiseConv2d:mse}),vse=Object.freeze({image:IS,linalg:ase,losses:tse,spectral:Uae,fused:gse,signal:Hae,square:Jre,squaredDifference:hN,conv1d:sae,conv2d:yo,conv3d:oae,depthwiseConv2d:lb,separableConv2d:TS,conv2dTranspose:cae,conv3dTranspose:uae,op:re,batchNormalization2d:Eie,batchNormalization3d:Pie,batchNormalization4d:Rie,batchNormalization:Aie,batchNorm:_N,batchNorm2d:Iie,batchNorm3d:Oie,batchNorm4d:Mie,booleanMaskAsync:aae,complex:Ti,real:oo,imag:Dc,concat:ai,concat1d:gte,concat2d:vte,concat3d:yte,concat4d:_te,split:fS,matMul:db,dot:lae,outerProduct:dae,reverse:cv,reverse1d:fae,reverse2d:hae,reverse3d:pae,reverse4d:mae,maxPool:di,avgPool:uv,pool:gae,maxPool3d:vae,avgPool3d:yae,slice:Xc,slice1d:_ae,slice2d:bae,slice3d:DN,slice4d:xae,abs:Qre,acos:Zre,acosh:eie,asin:tie,asinh:nie,atan:rie,atanh:iie,ceil:aie,clipByValue:wS,cos:sie,cosh:oie,erf:cie,exp:lk,expm1:uie,floor:lie,log:die,log1p:fie,logSigmoid:hie,neg:l_,reciprocal:pie,round:mie,rsqrt:pN,sigmoid:mN,sign:gie,isNaN:vie,isInf:yie,isFinite:_ie,sin:bie,sinh:xie,softplus:wie,sqrt:Cie,step:kie,tan:Sie,tanh:Tie,all:wae,any:Cae,argMax:kae,argMin:Sae,logSumExp:Tae,max:fb,mean:Eae,min:Pae,moments:Rae,sum:LN,prod:Aae,equal:kN,equalStrict:Yie,greater:Xie,greaterEqual:SN,greaterEqualStrict:Jie,greaterStrict:Qie,less:Zie,lessEqual:eae,lessEqualStrict:tae,lessStrict:nae,notEqual:rae,notEqualStrict:iae,add:Xt,addN:Lie,addStrict:Fie,atan2:$ie,div:jo,divNoNan:Bie,divStrict:Uie,floorDiv:wN,maximum:CS,maximumStrict:jie,minimum:CN,minimumStrict:qie,mod:zie,modStrict:Wie,mul:Ki,mulStrict:Hie,pow:d_,powStrict:Vie,squaredDifferenceStrict:Gie,sub:ci,subStrict:Kie,elu:FN,leakyRelu:Iae,prelu:$N,relu:vr,relu6:BN,selu:Oae,logicalAnd:ub,logicalNot:Die,logicalOr:bN,logicalXor:Nie,where:yf,whereAsync:xN,buffer:Dt,print:Pte,batchToSpaceND:L5,broadcastTo:Rte,cast:Ate,clone:Ite,cumsum:Ote,depthToSpace:Mte,expandDims:ao,eye:F5,multinomial:Dte,oneHot:sk,pad:Rf,pad1d:Nte,pad2d:Lte,pad3d:Fte,pad4d:$te,rand:Bte,randomNormal:Ute,randomGamma:jte,randomUniform:$5,reshape:Jo,spaceToBatchND:B5,squeeze:U5,stack:ws,tile:Lh,truncatedNormal:qte,unstack:si,setdiff1dAsync:zte,fill:Kc,linspace:mte,ones:Lp,range:n_,scalar:Ke,tensor:Pi,tensor1d:Hr,tensor2d:$l,tensor3d:dS,tensor4d:Ma,tensor5d:fte,tensor6d:hte,variable:pte,zeros:Gn,onesLike:N5,zerosLike:dn,transpose:Jl,softmax:tl,logSoftmax:Xte,localResponseNormalization:Mae,norm:UN,gather:kS,unsortedSegmentSum:TN,basicLSTMCell:Dae,multiRNNCell:Nae,movingAverage:Lae,stridedSlice:Fae,topk:$ae,scatterND:Bae,fft:ES,ifft:f_,rfft:PS,irfft:jN,sparseToDense:jae,gatherND:qae,diag:zae,dropout:Wae,hannWindow:RS,hammingWindow:zN,frame:AS,stft:WN,inTopKAsync:Vae});
vendor: 40,387 bytes, lines 3795-3798
3795function De(n,e){Array.isArray(n)||(n=[n]),n.forEach(function(t){t!=null&&J(t.dtype!=="complex64",function(){return e+" does not support complex64 tensors."})})}function Tw(n,e,t,r){if(t==="linear")return n.linear(e);if(t==="relu")return n.relu(e);if(t==="elu")return n.elu(e);if(t==="relu6")return n.relu6(e);if(t==="prelu")return n.prelu(e,r);throw new Error("Activation "+t+" has not been implemented for the CPU backend.")}var yse=function(n){function e(){var t=n.call(this)||this;return t.blockSize=48,t.firstUse=!0,t.data=new G5(t,ce),t}return oc(e,n),e.prototype.write=function(t,r,i){this.firstUse&&(this.firstUse=!1,ke().get("IS_NODE")&&e_(` 3796============================ 3797Hi there ð. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details. 3798============================`));var a={};return this.data.set(a,{values:t,dtype:i}),a},e.prototype.move=function(t,r,i,a){this.data.set(t,{values:r,dtype:a})},e.prototype.numDataIds=function(){return this.data.numDataIds()},e.prototype.read=function(t){return at(this,void 0,void 0,function(){return st(this,function(r){return[2,this.readSync(t)]})})},e.prototype.readSync=function(t){var r=this.data.get(t),i=r.dtype,a=r.complexTensors;return i==="complex64"?uk(this.readSync(a.real.dataId),this.readSync(a.imag.dataId)):this.data.get(t).values},e.prototype.bufferSync=function(t){var r=this.readSync(t.dataId),i=r;if(t.dtype==="string")try{i=r.map(function(a){return Jy(a)})}catch{throw new Error("Failed to decode encoded string bytes into utf-8")}return Dt(t.shape,t.dtype,i)},e.prototype.makeOutput=function(t,r,i){var a=this.write(t,r,i);return ce.makeTensorFromDataId(a,r,i,this)},e.prototype.disposeData=function(t){if(this.data.has(t)){var r=this.data.get(t).complexTensors;r!=null&&(r.real.dispose(),r.imag.dispose()),this.data.delete(t)}},e.prototype.time=function(t){return at(this,void 0,void 0,function(){var r;return st(this,function(i){return r=Oc(),t(),[2,{kernelMs:Oc()-r}]})})},e.prototype.memory=function(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}},e.prototype.complex=function(t,r){var i=this.makeOutput(null,t.shape,"complex64");return this.data.get(i.dataId).complexTensors={real:ce.keep(t.clone()),imag:ce.keep(r.clone())},i},e.prototype.real=function(t){return this.data.get(t.dataId).complexTensors.real.clone()},e.prototype.imag=function(t){return this.data.get(t.dataId).complexTensors.imag.clone()},e.prototype.slice=function(t,r,i){if(De(t,"slice"),H5(t.shape,r,i)){var a=V5(r,t.strides),s=ct(i);return Pi(this.readSync(t.dataId).subarray(a,a+s),i,t.dtype)}for(var o=Dt(i,t.dtype),c=this.bufferSync(t),u=0;u<o.size;++u){var l=o.indexToLoc(u).map(function(d,h){return d+r[h]});o.values[u]=c.get.apply(c,l)}return o.toTensor()},e.prototype.stridedSlice=function(t,r,i,a){De(t,"stridedSlice");var s=pS(r,i,a);if(s.some(function(p){return p===0}))return Pi([],s);for(var o=Dt(s,t.dtype),c=this.bufferSync(t),u=0;u<o.size;u++){for(var l=o.indexToLoc(u),d=new Array(l.length),h=0;h<d.length;h++)d[h]=l[h]*a[h]+r[h];o.set.apply(o,[c.get.apply(c,d)].concat(l))}return o.toTensor()},e.prototype.diag=function(t){for(var r=this.readSync(t.dataId),i=Dt([t.size,t.size],t.dtype),a=i.values,s=0;s<r.length;s++)a[s*t.size+s]=r[s];return i.toTensor()},e.prototype.unstack=function(t,r){for(var i=t.shape[r],a=new Array(t.rank-1),s=0,o=0;o<t.rank;o++)o!==r&&(a[s++]=t.shape[o]);var c=new Array(t.rank).fill(0),u=t.shape.slice();u[r]=1;var l=new Array(i);for(o=0;o<l.length;o++)c[r]=o,l[o]=this.slice(t,c,u).reshape(a);return l},e.prototype.reverse=function(t,r){De(t,"reverse");for(var i=Dt(t.shape,t.dtype),a=this.bufferSync(t),s=function(c){var u=i.indexToLoc(c),l=u.slice();r.forEach(function(d){return l[d]=t.shape[d]-1-l[d]}),i.set.apply(i,[a.get.apply(a,l)].concat(u))},o=0;o<i.size;o++)s(o);return i.toTensor()},e.prototype.concat=function(t,r){var i=this;if(t[0].dtype==="complex64"){var a=t.map(function(p){return oo(p)}),s=t.map(function(p){return Dc(p)});return Ti(this.concat(a,r),this.concat(s,r))}var o=t.map(function(p){var g=ct(p.shape.slice(r));return p.as2D(-1,g)}),c=up(o.map(function(p){return p.shape}),1),u=Dt(c,t[0].dtype).values;if(o[0].shape[0]===1){var l=0;o.forEach(function(p){u.set(i.readSync(p.dataId),l),l+=p.size})}else{var d=0;o.forEach(function(p){for(var g=i.readSync(p.dataId),v=0,y=0;y<p.shape[0];++y)for(var b=y*c[1]+d,x=0;x<p.shape[1];++x)u[b+x]=g[v++];d+=p.shape[1]})}var h=up(t.map(function(p){return p.shape}),r);return Pi(u,h,t[0].dtype)},e.prototype.neg=function(t){return De(t,"neg"),this.multiply(Ke(-1),t)},e.prototype.add=function(t,r){return t.dtype==="complex64"||r.dtype==="complex64"?this.broadcastedBinaryComplexOp(t.cast("complex64"),r.cast("complex64"),function(i,a,s,o){return{real:i+s,imag:a+o}}):this.broadcastedBinaryOp(t,r,Ei(t.dtype,r.dtype),function(i,a){return i+a})},e.prototype.addN=function(t){var r=this;De(t,"addN");for(var i=t.map(function(l){return r.readSync(l.dataId)}),a=Dt(t[0].shape,t[0].dtype),s=a.values,o=0;o<t.length;o++)for(var c=i[o],u=0;u<s.length;u++)s[u]+=c[u];return a.toTensor()},e.prototype.softmax=function(t,r){var i=ui([r],t.shape),a=this.max(t,i),s=za(a.shape,i),o=this.subtract(t,a.reshape(s)),c=this.exp(o),u=this.sum(c,i).reshape(s);return this.realDivide(c,u)},e.prototype.subtract=function(t,r){return t.dtype==="complex64"||r.dtype==="complex64"?this.broadcastedBinaryComplexOp(t.cast("complex64"),r.cast("complex64"),function(i,a,s,o){return{real:i-s,imag:a-o}}):this.broadcastedBinaryOp(t,r,Ei(t.dtype,r.dtype),function(i,a){return i-a})},e.prototype.pow=function(t,r){return De([t,r],"pow"),this.broadcastedBinaryOp(t,r,t.dtype,function(i,a){return Math.pow(i,a)})},e.prototype.batchMatMul=function(t,r,i,a){De([t,r],"matMul");for(var s=i?t.shape[1]:t.shape[2],o=i?t.shape[2]:t.shape[1],c=a?r.shape[1]:r.shape[2],u=t.shape[0],l=this.readSync(t.dataId),d=this.readSync(r.dataId),h=i?[t.strides[0],1,t.strides[1]]:[t.strides[0],t.strides[1],1],p=h[0],g=h[1],v=h[2],y=a?[1,r.strides[1],r.strides[0]]:[r.strides[1],1,r.strides[0]],b=y[0],x=y[1],S=y[2],w=o*c,k=Dt([u,o,c],t.dtype),E=k.values,I=this.blockSize,P=0;P<u;P++)for(var A=0;A<o;A+=I)for(var N=0;N<c;N+=I)for(var j=0;j<s;j+=I)for(var L=Math.min(A+I,o),B=Math.min(N+I,c),V=Math.min(j+I,s),X=A;X<L;X++)for(var ne=N;ne<B;ne++){for(var se=0,ie=j;ie<V;ie++)se+=l[P*p+X*g+ie*v]*d[ie*b+ne*x+P*S];E[P*w+(X*c+ne)]+=se}return k.toTensor()},e.prototype.fusedBatchMatMul=function(t){var r=t.a,i=t.b,a=t.transposeA,s=t.transposeB,o=t.bias,c=t.activation,u=t.preluActivationWeights,l=this.batchMatMul(r,i,a,s);return o&&(l=this.add(l,o)),c&&(l=Tw(this,l,c,u)),l},e.prototype.multiply=function(t,r){return t.dtype==="complex64"||r.dtype==="complex64"?this.broadcastedBinaryComplexOp(t.cast("complex64"),r.cast("complex64"),function(i,a,s,o){return{real:i*s-a*o,imag:i*o+a*s}}):this.broadcastedBinaryOp(t,r,Ei(t.dtype,r.dtype),function(i,a){return i*a})},e.prototype.realDivide=function(t,r){return De([t,r],"realDivide"),this.broadcastedBinaryOp(t,r,"float32",function(i,a){return i/a})},e.prototype.floorDiv=function(t,r){return De([t,r],"floorDiv"),this.broadcastedBinaryOp(t,r,"int32",function(i,a){return Math.floor(i/a)})},e.prototype.sum=function(t,r){De(t,"sum"),ds("sum",r,t.rank);for(var i=qi(t.shape,r),a=i[0],s=i[1],o=Gn(a,Ei(t.dtype,"int32")),c=ct(s),u=this.readSync(o.dataId),l=this.readSync(t.dataId),d=0;d<u.length;++d){for(var h=d*c,p=0,g=0;g<c;++g)p+=l[h+g];u[d]=p}return o},e.prototype.prod=function(t,r){De(t,"sum");for(var i=qi(t.shape,r),a=i[0],s=i[1],o=Gn(a,Ei(t.dtype,"int32")),c=ct(s),u=this.readSync(o.dataId),l=this.readSync(t.dataId),d=0;d<u.length;++d){for(var h=d*c,p=1,g=0;g<c;++g)p*=l[h+g];u[d]=p}return o},e.prototype.unsortedSegmentSum=function(t,r,i){De(t,"unsortedSegmentSum");for(var a=[],s=t.rank-r.rank,o=0;o<s;++o)r=r.expandDims(o+1);for(o=0;o<i;++o){var c=Ke(o,"int32"),u=kN(c,r).asType("float32").mul(t).sum(0);a.push(u)}return ws(a)},e.prototype.argMin=function(t,r){De(t,"argMin");var i=[r];ds("argMin",i,t.rank);for(var a=qi(t.shape,i),s=a[0],o=a[1],c=Gn(s,"int32"),u=ct(o),l=this.readSync(c.dataId),d=this.readSync(t.dataId),h=0;h<l.length;++h){for(var p=h*u,g=d[p],v=0,y=0;y<u;++y){var b=d[p+y];b<g&&(g=b,v=y)}l[h]=v}return c},e.prototype.argMax=function(t,r){De(t,"argMax");var i=[r];ds("argMax",i,t.rank);for(var a=qi(t.shape,i),s=a[0],o=a[1],c=Gn(s,"int32"),u=ct(o),l=this.readSync(c.dataId),d=this.readSync(t.dataId),h=0;h<l.length;++h){for(var p=h*u,g=d[p],v=0,y=0;y<u;++y){var b=d[p+y];b>g&&(g=b,v=y)}l[h]=v}return c},e.prototype.cumsum=function(t,r,i,a){if(De(t,"cumsum"),r!==t.rank-1)throw new Error("backend.cumsum in CPU expects an inner-most axis="+(t.rank-1)+" but got axis="+r);for(var s=Ei(t.dtype,"int32"),o=Gn(t.shape,s),c=this.readSync(o.dataId),u=this.readSync(t.dataId),l=t.shape[t.rank-1],d=a?function(y,b){return y+l-b-1}:function(y,b){return y+b},h=0;h<u.length;h+=l)for(var p=0;p<l;p++){var g=d(h,p);if(p===0)c[g]=i?0:u[g];else{var v=d(h,p-1);c[g]=i?u[v]+c[v]:u[g]+c[v]}}return o},e.prototype.equal=function(t,r){return De([t,r],"equal"),this.broadcastedBinaryOp(t,r,"bool",function(i,a){return i===a?1:0})},e.prototype.notEqual=function(t,r){return De([t,r],"notEqual"),this.broadcastedBinaryOp(t,r,"bool",function(i,a){return i!==a?1:0})},e.prototype.less=function(t,r){return De([t,r],"less"),this.broadcastedBinaryOp(t,r,"bool",function(i,a){return i<a?1:0})},e.prototype.lessEqual=function(t,r){return De([t,r],"lessEqual"),this.broadcastedBinaryOp(t,r,"bool",function(i,a){return i<=a?1:0})},e.prototype.greater=function(t,r){return De([t,r],"greater"),this.broadcastedBinaryOp(t,r,"bool",function(i,a){return i>a?1:0})},e.prototype.greaterEqual=function(t,r){return De([t,r],"greaterEqual"),this.broadcastedBinaryOp(t,r,"bool",function(i,a){return i>=a?1:0})},e.prototype.logicalNot=function(t){De(t,"logicalNot");for(var r=this.readSync(t.dataId),i=new Uint8Array(r.length),a=0;a<r.length;++a)i[a]=r[a]?0:1;return this.makeOutput(i,t.shape,"bool")},e.prototype.logicalAnd=function(t,r){return De([t,r],"logicalAnd"),this.broadcastedBinaryOp(t,r,"bool",function(i,a){return i&&a})},e.prototype.logicalOr=function(t,r){return De([t,r],"logicalOr"),this.broadcastedBinaryOp(t,r,"bool",function(i,a){return i||a})},e.prototype.select=function(t,r,i){De([t,r,i],"select");for(var a=this.readSync(t.dataId),s=this.readSync(r.dataId),o=this.readSync(i.dataId),c=Gn(r.shape,Ei(r.dtype,i.dtype)),u=this.readSync(c.dataId),l=0,d=t.rank===0||t.rank>1||r.rank===1?1:ct(r.shape.slice(1)),h=0;h<a.length;h++)for(var p=0;p<d;p++)a[h]===1?u[l++]=s[h]:u[l++]=o[h];return c},e.prototype.where=function(t){De([t],"where");var r=this.readSync(t.dataId);return yS(t.shape,r)},e.prototype.topk=function(t,r,i){return De(t,"topk"),tN(this.readSync(t.dataId),t.shape,t.dtype,r)},e.prototype.min=function(t,r){De(t,"min"),ds("min",r,t.rank);for(var i=qi(t.shape,r),a=i[0],s=i[1],o=Gn(a,t.dtype),c=ct(s),u=this.readSync(o.dataId),l=this.readSync(t.dataId),d=0;d<u.length;++d){for(var h=d*c,p=l[h],g=0;g<c;++g){var v=l[h+g];v<p&&(p=v)}u[d]=p}return o},e.prototype.minimum=function(t,r){return De([t,r],"minimum"),this.broadcastedBinaryOp(t,r,t.dtype,function(i,a){return Math.min(i,a)})},e.prototype.mod=function(t,r){return De([t,r],"mod"),this.broadcastedBinaryOp(t,r,t.dtype,function(i,a){var s=i%a;return i<0&&a<0||i>=0&&a>=0?s:(s+a)%a})},e.prototype.max=function(t,r){De(t,"max"),ds("max",r,t.rank);for(var i=qi(t.shape,r),a=i[0],s=i[1],o=Gn(a,t.dtype),c=ct(s),u=this.readSync(o.dataId),l=this.readSync(t.dataId),d=0;d<u.length;++d){for(var h=d*c,p=l[h],g=0;g<c;++g){var v=l[h+g];v>p&&(p=v)}u[d]=p}return o},e.prototype.maximum=function(t,r){return De([t,r],"maximum"),this.broadcastedBinaryOp(t,r,t.dtype,function(i,a){return Math.max(i,a)})},e.prototype.all=function(t,r){De(t,"all"),ds("all",r,t.rank);for(var i=qi(t.shape,r),a=i[0],s=i[1],o=Gn(a,t.dtype),c=ct(s),u=this.readSync(o.dataId),l=this.readSync(t.dataId),d=0;d<u.length;++d){for(var h=d*c,p=l[h],g=0;g<c;++g){var v=l[h+g];p=p&&v}u[d]=p}return o},e.prototype.any=function(t,r){De(t,"any"),ds("any",r,t.rank);for(var i=qi(t.shape,r),a=i[0],s=i[1],o=Gn(a,t.dtype),c=ct(s),u=this.readSync(o.dataId),l=this.readSync(t.dataId),d=0;d<u.length;++d){for(var h=d*c,p=l[h],g=0;g<c;++g){var v=l[h+g];p=p||v}u[d]=p}return o},e.prototype.squaredDifference=function(t,r){return De([t,r],"squaredDifference"),this.broadcastedBinaryOp(t,r,t.dtype,function(i,a){var s=i-a;return s*s})},e.prototype.ceil=function(t){De(t,"ceil");for(var r=this.readSync(t.dataId),i=new Float32Array(r.length),a=0;a<r.length;++a)i[a]=Math.ceil(r[a]);return this.makeOutput(i,t.shape,"float32")},e.prototype.floor=function(t){De(t,"floor");for(var r=this.readSync(t.dataId),i=new Float32Array(r.length),a=0;a<r.length;++a)i[a]=Math.floor(r[a]);return this.makeOutput(i,t.shape,"float32")},e.prototype.sign=function(t){De(t,"x");for(var r=this.readSync(t.dataId),i=new Float32Array(r.length),a=0;a<r.length;++a)r[a]<0?i[a]=-1:r[a]>0?i[a]=1:i[a]=0;return this.makeOutput(i,t.shape,"float32")},e.prototype.isNaN=function(t){De(t,"x");for(var r=this.readSync(t.dataId),i=new Uint8Array(r.length),a=0;a<r.length;++a)Number.isNaN(r[a])&&(i[a]=1);return this.makeOutput(i,t.shape,"bool")},e.prototype.isInf=function(t){De(t,"x");for(var r=this.readSync(t.dataId),i=new Uint8Array(r.length),a=0;a<r.length;++a)Math.abs(r[a])===1/0&&(i[a]=1);return this.makeOutput(i,t.shape,"bool")},e.prototype.isFinite=function(t){De(t,"x");for(var r=this.readSync(t.dataId),i=new Uint8Array(r.length),a=0;a<r.length;++a)Number.isFinite(r[a])&&(i[a]=1);return this.makeOutput(i,t.shape,"bool")},e.prototype.round=function(t){De(t,"round");for(var r=this.readSync(t.dataId),i=new Float32Array(r.length),a=0;a<r.length;++a){var s=Math.floor(r[a]);r[a]-s<.5?i[a]=Math.floor(r[a]):r[a]-s>.5?i[a]=Math.ceil(r[a]):i[a]=s%2==0?s:s+1}return this.makeOutput(i,t.shape,"float32")},e.prototype.exp=function(t){De(t,"exp");for(var r=this.readSync(t.dataId),i=new Float32Array(r.length),a=0;a<r.length;++a)i[a]=Math.exp(r[a]);return this.makeOutput(i,t.shape,"float32")},e.prototype.expm1=function(t){De(t,"expm1");for(var r=this.readSync(t.dataId),i=new Float32Array(r.length),a=0;a<r.length;++a)i[a]=Math.expm1(r[a]);return this.makeOutput(i,t.shape,"float32")},e.prototype.log=function(t){De(t,"log");for(var r=this.readSync(t.dataId),i=new Float32Array(r.length),a=0;a<r.length;++a){var s=r[a];i[a]=Math.log(s)}return this.makeOutput(i,t.shape,"float32")},e.prototype.log1p=function(t){De(t,"log1p");for(var r=this.readSync(t.dataId),i=new Float32Array(r.length),a=0;a<r.length;++a){var s=r[a];i[a]=Math.log1p(s)}return this.makeOutput(i,t.shape,"float32")},e.prototype.sqrt=function(t){De(t,"sqrt");for(var r=this.readSync(t.dataId),i=new Float32Array(r.length),a=0;a<r.length;++a){var s=r[a];i[a]=Math.sqrt(s)}return this.makeOutput(i,t.shape,"float32")},e.prototype.rsqrt=function(t){De(t,"rsqrt");for(var r=this.readSync(t.dataId),i=new Float32Array(r.length),a=0;a<r.length;++a){var s=r[a];i[a]=1/Math.sqrt(s)}return this.makeOutput(i,t.shape,"float32")},e.prototype.reciprocal=function(t){De(t,"reciprocal");for(var r=this.readSync(t.dataId),i=new Float32Array(r.length),a=0;a<r.length;++a)i[a]=1/r[a];return this.makeOutput(i,t.shape,"float32")},e.prototype.linear=function(t){return t},e.prototype.relu=function(t){De(t,"relu");for(var r=Gn(t.shape,t.dtype),i=this.readSync(r.dataId),a=this.readSync(t.dataId),s=0;s<a.length;++s)i[s]=Math.max(0,a[s]);return r},e.prototype.relu6=function(t){De(t,"relu");for(var r=Gn(t.shape,t.dtype),i=this.readSync(r.dataId),a=this.readSync(t.dataId),s=0;s<a.length;++s)i[s]=Math.min(Math.max(0,a[s]),6);return r},e.prototype.prelu=function(t,r){return De([t,r],"prelu"),this.broadcastedBinaryOp(t,r,t.dtype,function(i,a){return i<0?a*i:i})},e.prototype.elu=function(t){De(t,"elu");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a){var s=i[a];r[a]=s>=0?s:Math.exp(s)-1}return this.makeOutput(r,t.shape,"float32")},e.prototype.eluDer=function(t,r){De([t,r],"eluDer");for(var i=new Float32Array(r.size),a=this.readSync(r.dataId),s=this.readSync(t.dataId),o=0;o<a.length;++o){var c=a[o];i[o]=c>=1?s[o]:s[o]*(c+1)}return this.makeOutput(i,r.shape,"float32")},e.prototype.selu=function(t){De(t,"selu");for(var r=bS,i=xS,a=new Float32Array(t.size),s=this.readSync(t.dataId),o=0;o<s.length;++o){var c=s[o];a[o]=c>=0?i*c:r*(Math.exp(c)-1)}return this.makeOutput(a,t.shape,"float32")},e.prototype.clip=function(t,r,i){De(t,"clip");for(var a=new Float32Array(t.size),s=this.readSync(t.dataId),o=0;o<s.length;++o){var c=s[o];a[o]=c>i?i:c<r?r:c}return this.makeOutput(a,t.shape,"float32")},e.prototype.abs=function(t){for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=Math.abs(i[a]);return this.makeOutput(r,t.shape,"float32")},e.prototype.complexAbs=function(t){for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<t.size;++a){var s=i[2*a],o=i[2*a+1];r[a]=Math.hypot(s,o)}return this.makeOutput(r,t.shape,"float32")},e.prototype.int=function(t){De(t,"int");for(var r=new Int32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=i[a];return this.makeOutput(r,t.shape,"int32")},e.prototype.sigmoid=function(t){De(t,"sigmoid");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=1/(1+Math.exp(-i[a]));return this.makeOutput(r,t.shape,"float32")},e.prototype.softplus=function(t){De(t,"softplus");for(var r=Math.log(11920928955078125e-23)+2,i=new Float32Array(t.size),a=this.readSync(t.dataId),s=0;s<a.length;++s){var o=a[s]>-r,c=a[s]<r,u=Math.exp(a[s]),l=void 0;l=c?u:o?a[s]:Math.log(1+u),i[s]=l}return this.makeOutput(i,t.shape,"float32")},e.prototype.sin=function(t){De(t,"sin");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=Math.sin(i[a]);return this.makeOutput(r,t.shape,"float32")},e.prototype.cos=function(t){De(t,"cos");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=Math.cos(i[a]);return this.makeOutput(r,t.shape,"float32")},e.prototype.tan=function(t){De(t,"tan");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=Math.tan(i[a]);return this.makeOutput(r,t.shape,"float32")},e.prototype.asin=function(t){De(t,"asin");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=Math.asin(i[a]);return this.makeOutput(r,t.shape,"float32")},e.prototype.acos=function(t){De(t,"acos");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=Math.acos(i[a]);return this.makeOutput(r,t.shape,"float32")},e.prototype.atan=function(t){De(t,"atan");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=Math.atan(i[a]);return this.makeOutput(r,t.shape,"float32")},e.prototype.atan2=function(t,r){return De([t,r],"atan2"),this.broadcastedBinaryOp(t,r,t.dtype,function(i,a){return Math.atan2(i,a)})},e.prototype.sinh=function(t){De(t,"sinh");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=Math.sinh(i[a]);return this.makeOutput(r,t.shape,"float32")},e.prototype.cosh=function(t){De(t,"cosh");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=Math.cosh(i[a]);return this.makeOutput(r,t.shape,"float32")},e.prototype.tanh=function(t){De(t,"tanh");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=_ee(i[a]);return this.makeOutput(r,t.shape,"float32")},e.prototype.asinh=function(t){De(t,"asinh");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=Math.asinh(i[a]);return this.makeOutput(r,t.shape,"float32")},e.prototype.acosh=function(t){De(t,"acosh");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=Math.acosh(i[a]);return this.makeOutput(r,t.shape,"float32")},e.prototype.atanh=function(t){De(t,"atanh");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a)r[a]=Math.atanh(i[a]);return this.makeOutput(r,t.shape,"float32")},e.prototype.erf=function(t){De(t,"erf");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),a=0;a<i.length;++a){var s=Math.sign(i[a]),o=Math.abs(i[a]),c=1/(1+.3275911*o);r[a]=s*(1-((((1.061405429*c-1.453152027)*c+1.421413741)*c-.284496736)*c+.254829592)*c*Math.exp(-o*o))}return this.makeOutput(r,t.shape,"float32")},e.prototype.step=function(t,r){r===void 0&&(r=0),De(t,"step");for(var i=new Float32Array(t.size),a=this.readSync(t.dataId),s=0;s<a.length;++s){var o=a[s];isNaN(o)?i[s]=NaN:i[s]=o>0?1:r}return this.makeOutput(i,t.shape,"float32")},e.prototype.fusedConv2d=function(t){var r=t.input,i=t.filter,a=t.convInfo,s=t.bias,o=t.activation,c=t.preluActivationWeights,u=this.conv2d(r,i,a);return s&&(u=this.add(u,s)),o&&(u=Tw(this,u,o,c)),u},e.prototype.conv2d=function(t,r,i){De([t,r],"conv2d");for(var a=i.filterHeight,s=i.filterWidth,o=i.dilationHeight,c=i.dilationWidth,u=i.padInfo.left,l=i.padInfo.top,d=i.dataFormat==="channelsLast",h=Dt(i.outShape,t.dtype),p=t.strides[0],g=d?t.strides[1]:t.strides[2],v=d?t.strides[2]:1,y=d?1:t.strides[1],b=h.strides[0],x=d?h.strides[1]:h.strides[2],S=d?h.strides[2]:1,w=d?1:h.strides[1],k=this.readSync(t.dataId),E=this.readSync(r.dataId),I=h.values,P=0;P<i.batchSize;++P)for(var A=P*p,N=P*b,j=0;j<i.outHeight;++j)for(var L=N+j*x,B=j*i.strideHeight-l,V=0;V<a;V++){var X=B+V*o;if(!(X<0||X>=i.inHeight))for(var ne=V*r.strides[0],se=A+X*g,ie=0;ie<i.outWidth;++ie)for(var de=L+ie*S,ue=ie*i.strideWidth-u,Ce=0;Ce<s;Ce++){var we=ue+Ce*c;if(!(we<0||we>=i.inWidth))for(var Fe=se+we*v,Ge=ne+Ce*r.strides[1],Ie=0;Ie<i.inChannels;++Ie){for(var He=k[Fe+Ie*y],ot=0;ot<i.outChannels;++ot)I[de+ot*w]+=He*E[Ge+ot];Ge+=i.outChannels}}}return h.toTensor()},e.prototype.conv3d=function(t,r,i){for(var a=i.filterDepth,s=i.filterHeight,o=i.filterWidth,c=i.dilationDepth,u=i.dilationHeight,l=i.dilationWidth,d=i.padInfo.front,h=i.padInfo.left,p=i.padInfo.top,g=Dt(i.outShape,t.dtype),v=this.readSync(t.dataId),y=this.readSync(r.dataId),b=g.values,x=0;x<i.batchSize;++x)for(var S=x*t.strides[0],w=x*g.strides[0],k=0;k<i.outDepth;++k)for(var E=w+k*g.strides[1],I=k*i.strideDepth-d,P=0;P<a;P++){var A=I+P*c;if(!(A<0||A>=i.inDepth))for(var N=P*r.strides[0],j=S+A*t.strides[1],L=0;L<i.outHeight;++L)for(var B=E+L*g.strides[2],V=L*i.strideHeight-p,X=0;X<s;X++){var ne=V+X*u;if(!(ne<0||ne>=i.inHeight))for(var se=N+X*r.strides[1],ie=j+ne*t.strides[2],de=0;de<i.outWidth;++de)for(var ue=B+de*i.outChannels,Ce=de*i.strideWidth-h,we=0;we<o;we++){var Fe=Ce+we*l;if(!(Fe<0||Fe>=i.inWidth))for(var Ge=se+we*r.strides[2],Ie=ie+Fe*i.inChannels,He=Ge,ot=0;ot<i.inChannels;++ot){for(var Je=v[Ie+ot],et=0;et<i.outChannels;++et)b[ue+et]+=Je*y[He+et];He+=i.outChannels}}}}return g.toTensor()},e.prototype.conv2dDerInput=function(t,r,i){De([t,r],"conv2dDerInput");for(var a=Dt(i.inShape,"float32"),s=a.values,o=this.readSync(t.dataId),c=this.readSync(r.dataId),u=r.strides,l=u[0],d=u[1],h=u[2],p=i.batchSize,g=i.filterHeight,v=i.filterWidth,y=i.inChannels,b=i.inHeight,x=i.inWidth,S=i.outChannels,w=i.outHeight,k=i.outWidth,E=i.strideHeight,I=i.strideWidth,P=i.dataFormat,A=g-1-i.padInfo.top,N=v-1-i.padInfo.left,j=P==="channelsLast",L=a.strides[0],B=j?a.strides[1]:a.strides[2],V=j?a.strides[2]:1,X=j?1:a.strides[1],ne=t.strides[0],se=j?t.strides[1]:t.strides[2],ie=j?t.strides[2]:1,de=j?1:t.strides[1],ue=0;ue<p;++ue)for(var Ce=0;Ce<y;++Ce)for(var we=0;we<b;++we)for(var Fe=we-A,Ge=Math.max(0,Math.ceil(Fe/E)),Ie=Math.min(w,(g+Fe)/E),He=0;He<x;++He){for(var ot=He-N,Je=Math.max(0,Math.ceil(ot/I)),et=Math.min(k,(v+ot)/I),Ut=0,_t=Ge;_t<Ie;++_t)for(var mt=_t*E-Fe,wt=Je;wt<et;++wt)for(var Kt=ne*ue+se*_t+ie*wt,Ct=l*(g-1-mt)+d*(v-1-(wt*I-ot))+h*Ce,kt=0;kt<S;++kt)Ut+=o[Kt+de*kt]*c[Ct+kt];s[L*ue+B*we+V*He+X*Ce]=Ut}return a.toTensor()},e.prototype.conv3dDerInput=function(t,r,i){for(var a=Dt(i.inShape,"float32"),s=a.values,o=a.strides,c=o[0],u=o[1],l=o[2],d=o[3],h=this.readSync(t.dataId),p=t.strides,g=p[0],v=p[1],y=p[2],b=p[3],x=this.readSync(r.dataId),S=r.strides,w=S[0],k=S[1],E=S[2],I=S[3],P=i.batchSize,A=i.filterDepth,N=i.filterHeight,j=i.filterWidth,L=i.inChannels,B=i.inDepth,V=i.inHeight,X=i.inWidth,ne=i.outChannels,se=i.outDepth,ie=i.outHeight,de=i.outWidth,ue=i.strideDepth,Ce=i.strideHeight,we=i.strideWidth,Fe=A-1-i.padInfo.front,Ge=N-1-i.padInfo.top,Ie=j-1-i.padInfo.left,He=0;He<P;++He)for(var ot=0;ot<L;++ot)for(var Je=0;Je<B;++Je)for(var et=Je-Fe,Ut=Math.max(0,Math.ceil(et/ue)),_t=Math.min(se,(A+et)/ue),mt=0;mt<V;++mt)for(var wt=mt-Ge,Kt=Math.max(0,Math.ceil(wt/Ce)),Ct=Math.min(ie,(N+wt)/Ce),kt=0;kt<X;++kt){for(var jn=kt-Ie,zt=Math.max(0,Math.ceil(jn/we)),qn=Math.min(de,(j+jn)/we),_r=0,On=Ut;On<_t;++On)for(var hn=On*ue-et,xn=Kt;xn<Ct;++xn)for(var kn=xn*Ce-wt,St=zt;St<qn;++St)for(var Er=g*He+v*On+y*xn+b*St,Jn=w*(A-1-hn)+k*(N-1-kn)+E*(j-1-(St*we-jn))+I*ot,rn=0;rn<ne;++rn)_r+=h[Er+rn]*x[Jn+rn];s[c*He+u*Je+l*mt+d*kt+ot]=_r}return a.toTensor()},e.prototype.conv2dDerFilter=function(t,r,i){De([t,r],"conv2dDerFilter");for(var a=i.strideHeight,s=i.strideWidth,o=i.filterHeight,c=i.filterWidth,u=i.dataFormat==="channelsLast",l=Dt(i.filterShape,"float32"),d=i.padInfo.left,h=i.padInfo.top,p=this.bufferSync(t),g=this.bufferSync(r),v=0;v<o;++v)for(var y=Math.max(0,Math.ceil((h-v)/a)),b=Math.min(i.outHeight,(i.inHeight+h-v)/a),x=0;x<c;++x)for(var S=Math.max(0,Math.ceil((d-x)/s)),w=Math.min(i.outWidth,(i.inWidth+d-x)/s),k=0;k<i.inChannels;++k)for(var E=0;E<i.outChannels;++E){for(var I=0,P=0;P<i.batchSize;++P)for(var A=y;A<b;++A)for(var N=v+A*a-h,j=S;j<w;++j){var L=x+j*s-d;I+=u?p.get(P,N,L,k)*g.get(P,A,j,E):p.get(P,k,N,L)*g.get(P,E,A,j)}l.set(I,v,x,k,E)}return l.toTensor()},e.prototype.conv3dDerFilter=function(t,r,i){for(var a=i.strideDepth,s=i.strideHeight,o=i.strideWidth,c=i.filterDepth,u=i.filterHeight,l=i.filterWidth,d=Dt(i.filterShape,"float32"),h=d.values,p=d.strides,g=p[0],v=p[1],y=p[2],b=p[3],x=this.readSync(r.dataId),S=r.strides,w=S[0],k=S[1],E=S[2],I=S[3],P=this.readSync(t.dataId),A=t.strides,N=A[0],j=A[1],L=A[2],B=A[3],V=i.padInfo.front,X=i.padInfo.left,ne=i.padInfo.top,se=0;se<c;++se)for(var ie=Math.max(0,Math.ceil((V-se)/a)),de=Math.min(i.outDepth,(i.inDepth+V-se)/a),ue=se*g,Ce=0;Ce<u;++Ce)for(var we=Math.max(0,Math.ceil((ne-Ce)/s)),Fe=Math.min(i.outHeight,(i.inHeight+ne-Ce)/s),Ge=Ce*v+ue,Ie=0;Ie<l;++Ie)for(var He=Math.max(0,Math.ceil((X-Ie)/o)),ot=Math.min(i.outWidth,(i.inWidth+X-Ie)/o),Je=Ie*y+Ge,et=0;et<i.inChannels;++et)for(var Ut=et*b+Je,_t=0;_t<i.outChannels;++_t){for(var mt=0,wt=0;wt<i.batchSize;++wt)for(var Kt=wt*N,Ct=wt*w,kt=ie;kt<de;++kt)for(var jn=(se+kt*a-V)*j+Kt,zt=kt*k+Ct,qn=we;qn<Fe;++qn)for(var _r=(Ce+qn*s-ne)*L+jn,On=qn*E+zt,hn=He;hn<ot;++hn){var xn=hn*I+On;mt+=P[(Ie+hn*o-X)*B+_r+et]*x[xn+_t]}h[Ut+_t]=mt}return d.toTensor()},e.prototype.fusedDepthwiseConv2D=function(t){var r=t.input,i=t.filter,a=t.convInfo,s=t.bias,o=t.activation,c=t.preluActivationWeights,u=this.depthwiseConv2D(r,i,a);return s&&(u=this.add(u,s)),o&&(u=Tw(this,u,o,c)),u},e.prototype.depthwiseConv2D=function(t,r,i){De([t,r],"depthwiseConv2D");for(var a=i.filterHeight,s=i.filterWidth,o=i.dilationHeight,c=i.dilationWidth,u=i.padInfo.left,l=i.padInfo.top,d=i.outChannels/i.inChannels,h=Dt(i.outShape,t.dtype),p=this.readSync(t.dataId),g=this.readSync(r.dataId),v=h.values,y=0;y<i.batchSize;++y)for(var b=y*t.strides[0],x=y*h.strides[0],S=0;S<i.outHeight;++S)for(var w=x+S*h.strides[1],k=S*i.strideHeight-u,E=0;E<a;++E){var I=k+E*o;if(!(I<0||I>=i.inHeight))for(var P=E*r.strides[0],A=b+I*t.strides[1],N=0;N<i.outWidth;++N)for(var j=w+N*h.strides[2],L=N*i.strideWidth-l,B=0;B<s;++B){var V=L+B*c;if(!(V<0||V>=i.inWidth))for(var X=P+B*r.strides[1],ne=A+V*i.inChannels,se=j,ie=X,de=0;de<i.inChannels;++de){for(var ue=p[ne+de],Ce=0;Ce<d;++Ce)v[se+Ce]+=ue*g[ie+Ce];se+=d,ie+=d}}}return h.toTensor()},e.prototype.depthwiseConv2DDerInput=function(t,r,i){De([t,r],"depthwiseConv2DDerInput");for(var a=Dt(i.inShape,"float32"),s=a.values,o=a.strides,c=o[0],u=o[1],l=o[2],d=this.readSync(t.dataId),h=t.strides,p=h[0],g=h[1],v=h[2],y=this.readSync(r.dataId),b=r.strides,x=b[0],S=b[1],w=b[2],k=i.batchSize,E=i.filterHeight,I=i.filterWidth,P=i.inChannels,A=i.inHeight,N=i.inWidth,j=i.outChannels,L=i.outHeight,B=i.outWidth,V=i.strideHeight,X=i.strideWidth,ne=E-1-i.padInfo.top,se=I-1-i.padInfo.left,ie=j/P,de=0;de<k;++de)for(var ue=0;ue<P;++ue)for(var Ce=0;Ce<A;++Ce)for(var we=Ce-ne,Fe=Math.max(0,Math.ceil(we/V)),Ge=Math.min(L,(E+we)/V),Ie=0;Ie<N;++Ie){for(var He=Ie-se,ot=Math.max(0,Math.ceil(He/X)),Je=Math.min(B,(I+He)/X),et=0,Ut=Fe;Ut<Ge;++Ut)for(var _t=Ut*V-we,mt=ot;mt<Je;++mt)for(var wt=p*de+g*Ut+v*mt,Kt=x*(E-1-_t)+S*(I-1-(mt*X-He))+w*ue,Ct=0;Ct<ie;++Ct)et+=d[wt+(ue*ie+Ct)]*y[Kt+Ct];s[c*de+u*Ce+l*Ie+ue]=et}return a.toTensor()},e.prototype.depthwiseConv2DDerFilter=function(t,r,i){De([t,r],"depthwiseConv2DDerFilter");for(var a=i.strideHeight,s=i.strideWidth,o=i.filterHeight,c=i.filterWidth,u=Dt(i.filterShape,"float32"),l=i.padInfo.left,d=i.padInfo.top,h=i.outChannels/i.inChannels,p=this.bufferSync(t),g=this.bufferSync(r),v=0;v<o;++v)for(var y=Math.max(0,Math.ceil((d-v)/a)),b=Math.min(i.outHeight,(i.inHeight+d-v)/a),x=0;x<c;++x)for(var S=Math.max(0,Math.ceil((l-x)/s)),w=Math.min(i.outWidth,(i.inWidth+l-x)/s),k=0;k<i.outChannels;++k){for(var E=Math.trunc(k/h),I=k%h,P=0,A=0;A<i.batchSize;++A)for(var N=y;N<b;++N)for(var j=v+N*a-d,L=S;L<w;++L){var B=x+L*s-l;P+=p.get(A,j,B,E)*g.get(A,N,L,k)}u.set(P,v,x,E,I)}return u.toTensor()},e.prototype.tile=function(t,r){return De(t,"tile"),eN(this.bufferSync(t),r)},e.prototype.pad=function(t,r,i){De(t,"pad");var a=r.map(function(h,p){return h[0]+t.shape[p]+h[1]}),s=r.map(function(h){return h[0]}),o=this.bufferSync(t),c=Dt(a,t.dtype);i!==0&&c.values.fill(i);for(var u=0;u<t.size;u++){var l=o.indexToLoc(u),d=l.map(function(h,p){return h+s[p]});c.set.apply(c,[o.get.apply(o,l)].concat(d))}return c.toTensor()},e.prototype.transpose=function(t,r){De(t,"transpose");for(var i=new Array(t.rank),a=0;a<i.length;a++)i[a]=t.shape[r[a]];var s=this.readSync(t.dataId),o=Dt(i,t.dtype),c=this.bufferSync(t);for(a=0;a<t.size;++a){for(var u=c.indexToLoc(a),l=new Array(u.length),d=0;d<l.length;d++)l[d]=u[r[d]];var h=o.locToIndex(l);o.values[h]=s[a]}return o.toTensor()},e.prototype.gather=function(t,r,i){De([t,r],"gather");var a=t.shape.slice(),s=this.readSync(r.dataId);a[i]=s.length;for(var o=Dt(a,t.dtype),c=this.bufferSync(t),u=0;u<o.size;++u){var l=o.indexToLoc(u),d=l.slice();d[i]=s[l[i]];var h=c.locToIndex(d);o.values[u]=c.values[h]}return o.toTensor()},e.prototype.batchToSpaceND=function(t,r,i){De([t],"batchToSpaceND");var a=r.reduce(function(d,h){return d*h}),s=r_(t.shape,r,a),o=i_(s.length,r.length),c=a_(t.shape,r,a),u=j5(i,r.length),l=q5(c,i,r.length);return t.reshape(s).transpose(o).reshape(c).slice(u,l)},e.prototype.spaceToBatchND=function(t,r,i){De([t],"spaceToBatchND");var a=r.reduce(function(h,p){return h*p}),s=[[0,0]];s.push.apply(s,i);for(var o=1+r.length;o<t.shape.length;++o)s.push([0,0]);var c=t.pad(s),u=r_(c.shape,r,a,!1),l=i_(u.length,r.length,!1),d=a_(c.shape,r,a,!1);return c.reshape(u).transpose(l).reshape(d)},e.prototype.pool=function(t,r,i){De(t,"pool");for(var a=r.strideHeight,s=r.strideWidth,o=r.dilationHeight,c=r.dilationWidth,u=r.effectiveFilterHeight,l=r.effectiveFilterWidth,d=r.padInfo.top,h=r.padInfo.left,p=i==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,g=this.readSync(t.dataId),v=Dt(r.outShape,t.dtype),y=v.values,b=r.outShape[1]*r.outShape[2]*r.outShape[3],x=r.outShape[2]*r.outShape[3],S=r.outShape[3],w=0;w<r.batchSize;++w)for(var k=w*b,E=w*t.strides[0],I=0;I<r.inChannels;++I)for(var P=0;P<r.outHeight;++P)for(var A=P*a-d,N=Math.max(0,A),j=Math.min(r.inHeight,u+A),L=k+P*x,B=0;B<r.outWidth;++B){for(var V=B*s-h,X=Math.max(0,V),ne=Math.min(r.inWidth,l+V),se=p,ie=0,de=0,ue=N;ue<j;ue+=o){for(var Ce=E+ue*t.strides[1],we=X;we<ne;we+=c){var Fe=g[Ce+we*t.strides[2]+I];i==="max"&&Fe>se?se=Fe:i==="avg"&&(ie+=Fe,de++)}if(isNaN(se))break}y[L+B*S+I]=i==="avg"?ie/de:se}return v.toTensor()},e.prototype.maxPool=function(t,r){return this.pool(t,r,"max")},e.prototype.maxPoolPositions=function(t,r){for(var i=Dt(r.outShape,"int32"),a=r.strideHeight,s=r.strideWidth,o=r.dilationHeight,c=r.dilationWidth,u=r.effectiveFilterHeight,l=r.effectiveFilterWidth,d=r.padInfo.top,h=r.padInfo.left,p=this.bufferSync(t),g=0;g<r.batchSize;++g)for(var v=0;v<r.inChannels;++v)for(var y=0;y<r.outHeight;++y){for(var b=y*a-d,x=b;x<0;)x+=o;for(var S=Math.min(r.inHeight,u+b),w=0;w<r.outWidth;++w){for(var k=w*s-h,E=k;E<0;)E+=c;for(var I=Math.min(r.inWidth,l+k),P=Number.NEGATIVE_INFINITY,A=-1,N=x;N<S;N+=o)for(var j=N-b,L=E;L<I;L+=c){var B=L-k,V=p.get(g,N,L,v);V>P&&(P=V,A=j*l+B)}i.set(A,g,y,w,v)}}return i.toTensor()},e.prototype.maxPoolBackprop=function(t,r,i,a){De([r,i],"maxPoolBackprop");for(var s=this.maxPoolPositions(r,a),o=a.strideHeight,c=a.strideWidth,u=a.dilationHeight,l=a.dilationWidth,d=a.effectiveFilterHeight,h=a.effectiveFilterWidth,p=h-1-a.padInfo.left,g=d-1-a.padInfo.top,v=Dt(r.shape,"float32"),y=this.bufferSync(s),b=this.bufferSync(t),x=0;x<a.batchSize;++x)for(var S=0;S<a.inChannels;++S)for(var w=0;w<a.inHeight;++w)for(var k=0;k<a.inWidth;++k){for(var E=w-g,I=k-p,P=0,A=0;A<d;A+=u){var N=(E+A)/o;if(!(N<0||N>=a.outHeight||Math.floor(N)!==N))for(var j=0;j<h;j+=l){var L=(I+j)/c;if(!(L<0||L>=a.outWidth||Math.floor(L)!==L)){var B=d*h-1-y.get(x,N,L,S)===A*h+j?1:0;B!==0&&(P+=b.get(x,N,L,S)*B)}}}v.set(P,x,w,k,S)}return v.toTensor()},e.prototype.avgPoolBackprop=function(t,r,i){De([t,r],"avgPoolBackprop");for(var a=i.strideHeight,s=i.strideWidth,o=i.filterHeight,c=i.filterWidth,u=i.dilationHeight,l=i.dilationWidth,d=i.effectiveFilterHeight,h=i.effectiveFilterWidth,p=h-1-i.padInfo.left,g=d-1-i.padInfo.top,v=Dt(r.shape,"float32"),y=1/(o*c),b=this.bufferSync(t),x=0;x<i.batchSize;++x)for(var S=0;S<i.inChannels;++S)for(var w=0;w<i.inHeight;++w)for(var k=0;k<i.inWidth;++k){for(var E=w-g,I=k-p,P=0,A=0;A<d;A+=u){var N=(E+A)/a;if(!(N<0||N>=i.outHeight||Math.floor(N)!==N))for(var j=0;j<h;j+=l){var L=(I+j)/s;L<0||L>=i.outWidth||Math.floor(L)!==L||(P+=b.get(x,N,L,S))}}v.set(P*y,x,w,k,S)}return v.toTensor()},e.prototype.pool3d=function(t,r,i){De(t,"pool3d");for(var a=r.strideDepth,s=r.strideHeight,o=r.strideWidth,c=r.dilationDepth,u=r.dilationHeight,l=r.dilationWidth,d=r.effectiveFilterDepth,h=r.effectiveFilterHeight,p=r.effectiveFilterWidth,g=r.padInfo.front,v=r.padInfo.top,y=r.padInfo.left,b=i==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,x=this.readSync(t.dataId),S=Dt(r.outShape,t.dtype),w=S.values,k=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],E=r.outShape[2]*r.outShape[3]*r.outShape[4],I=r.outShape[3]*r.outShape[4],P=r.outShape[4],A=0;A<r.batchSize;++A)for(var N=A*k,j=A*t.strides[0],L=0;L<r.inChannels;++L)for(var B=0;B<r.outDepth;++B){for(var V=B*a-g,X=V;X<0;)X+=c;for(var ne=Math.min(r.inDepth,d+V),se=N+B*E,ie=0;ie<r.outHeight;++ie){for(var de=ie*s-v,ue=de;ue<0;)ue+=u;for(var Ce=Math.min(r.inHeight,h+de),we=se+ie*I,Fe=0;Fe<r.outWidth;++Fe){for(var Ge=Fe*o-y,Ie=Ge;Ie<0;)Ie+=l;for(var He=Math.min(r.inWidth,p+Ge),ot=we+Fe*P,Je=b,et=0,Ut=0,_t=X;_t<ne;_t+=c){for(var mt=j+_t*t.strides[1],wt=ue;wt<Ce;wt+=u){for(var Kt=mt+wt*t.strides[2],Ct=Ie;Ct<He;Ct+=l){var kt=x[Kt+Ct*t.strides[3]+L];if(i==="max"&&kt>Je?Je=kt:i==="avg"&&(et+=kt,Ut++),isNaN(Je))break}if(isNaN(Je))break}if(isNaN(Je))break}w[ot+L]=i==="avg"?et/Ut:Je}}}return S.toTensor()},e.prototype.avgPool3d=function(t,r){return De(t,"avgPool3d"),this.pool3d(t,r,"avg").toFloat()},e.prototype.avgPool3dBackprop=function(t,r,i){De([t,r],"avgPool3dBackprop");for(var a=i.strideDepth,s=i.strideHeight,o=i.strideWidth,c=i.filterDepth,u=i.filterHeight,l=i.filterWidth,d=i.dilationDepth,h=i.dilationHeight,p=i.dilationWidth,g=i.effectiveFilterDepth,v=i.effectiveFilterHeight,y=i.effectiveFilterWidth,b=g-1-i.padInfo.front,x=y-1-i.padInfo.left,S=v-1-i.padInfo.top,w=Dt(r.shape,"float32"),k=1/(c*u*l),E=this.bufferSync(t),I=0;I<i.batchSize;++I)for(var P=0;P<i.inChannels;++P)for(var A=0;A<i.inDepth;++A)for(var N=0;N<i.inHeight;++N)for(var j=0;j<i.inWidth;++j){for(var L=A-b,B=N-S,V=j-x,X=0,ne=0;ne<g;ne+=d){var se=(L+ne)/a;if(!(se<0||se>=i.outDepth||Math.floor(se)!==se))for(var ie=0;ie<v;ie+=h){var de=(B+ie)/s;if(!(de<0||de>=i.outHeight||Math.floor(de)!==de))for(var ue=0;ue<y;ue+=p){var Ce=(V+ue)/o;Ce<0||Ce>=i.outWidth||Math.floor(Ce)!==Ce||(X+=E.get(I,se,de,Ce,P))}}}w.set(X*k,I,A,N,j,P)}return w.toTensor()},e.prototype.maxPool3d=function(t,r){return De(t,"maxPool3d"),this.pool3d(t,r,"max").toFloat()},e.prototype.maxPool3dPositions=function(t,r){for(var i=Dt(r.outShape,"int32"),a=r.strideDepth,s=r.strideHeight,o=r.strideWidth,c=r.dilationDepth,u=r.dilationHeight,l=r.dilationWidth,d=r.effectiveFilterDepth,h=r.effectiveFilterHeight,p=r.effectiveFilterWidth,g=r.padInfo.front,v=r.padInfo.top,y=r.padInfo.left,b=this.bufferSync(t),x=0;x<r.batchSize;++x)for(var S=0;S<r.inChannels;++S)for(var w=0;w<r.outDepth;++w){for(var k=w*a-g,E=k;E<0;)E+=c;for(var I=Math.min(r.inDepth,d+k),P=0;P<r.outHeight;++P){for(var A=P*s-v,N=A;N<0;)N+=u;for(var j=Math.min(r.inHeight,h+A),L=0;L<r.outWidth;++L){for(var B=L*o-y,V=B;V<0;)V+=l;for(var X=Math.min(r.inWidth,p+B),ne=Number.NEGATIVE_INFINITY,se=-1,ie=E;ie<I;ie+=c)for(var de=ie-k,ue=N;ue<j;ue+=u)for(var Ce=ue-A,we=V;we<X;we+=l){var Fe=we-B,Ge=b.get(x,ie,ue,we,S);Ge>=ne&&(ne=Ge,se=de*h*p+Ce*h+Fe)}i.set(se,x,w,P,L,S)}}}return i.toTensor()},e.prototype.maxPool3dBackprop=function(t,r,i,a){De([r,i],"maxPool3dBackprop");for(var s=this.maxPool3dPositions(r,a),o=a.strideDepth,c=a.strideHeight,u=a.strideWidth,l=a.dilationDepth,d=a.dilationHeight,h=a.dilationWidth,p=a.effectiveFilterDepth,g=a.effectiveFilterHeight,v=a.effectiveFilterWidth,y=p-1-a.padInfo.front,b=v-1-a.padInfo.left,x=g-1-a.padInfo.top,S=Dt(r.shape,"float32"),w=this.bufferSync(s),k=this.bufferSync(t),E=0;E<a.batchSize;++E)for(var I=0;I<a.inChannels;++I)for(var P=0;P<a.inDepth;++P)for(var A=0;A<a.inHeight;++A)for(var N=0;N<a.inWidth;++N){for(var j=P-y,L=A-x,B=N-b,V=0,X=0;X<p;X+=l){var ne=(j+X)/o;if(!(ne<0||ne>=a.outDepth||Math.floor(ne)!==ne))for(var se=0;se<g;se+=d){var ie=(L+se)/c;if(!(ie<0||ie>=a.outHeight||Math.floor(ie)!==ie))for(var de=0;de<v;de+=h){var ue=(B+de)/u;if(!(ue<0||ue>=a.outWidth||Math.floor(ue)!==ue)){var Ce=p*g*v-1-w.get(E,ne,ie,ue,I)===X*g*v+se*v+de?1:0;Ce!==0&&(V+=k.get(E,ne,ie,ue,I)*Ce)}}}}S.set(V,E,P,A,N,I)}return S.toTensor()},e.prototype.cast=function(t,r){return X5(t,r,this)},e.prototype.reshape=function(t,r){return ck(t,r)},e.prototype.avgPool=function(t,r){return De(t,"avgPool"),this.pool(t,r,"avg").toFloat()},e.prototype.resizeBilinear=function(t,r,i,a){De(t,"resizeBilinear");for(var s=t.shape,o=s[0],c=s[1],u=s[2],l=s[3],d=this.readSync(t.dataId),h=new Float32Array(ct([o,r,i,l])),p=[a&&r>1?c-1:c,a&&i>1?u-1:u],g=[a&&r>1?r-1:r,a&&i>1?i-1:i],v=0,y=p[0]/g[0],b=p[1]/g[1],x=0;x<o;x++)for(var S=0;S<r;S++)for(var w=y*S,k=Math.floor(w),E=w-k,I=Math.min(c-1,Math.ceil(w)),P=x*t.strides[0]+k*t.strides[1],A=x*t.strides[0]+I*t.strides[1],N=0;N<i;N++)for(var j=b*N,L=Math.floor(j),B=j-L,V=Math.min(u-1,Math.ceil(j)),X=P+L*t.strides[2],ne=A+L*t.strides[2],se=P+V*t.strides[2],ie=A+V*t.strides[2],de=0;de<l;de++){var ue=d[X+de],Ce=d[ne+de],we=ue+(d[se+de]-ue)*B,Fe=we+(Ce+(d[ie+de]-Ce)*B-we)*E;h[v++]=Fe}return Pi(h,[o,r,i,l])},e.prototype.resizeBilinearBackprop=function(t,r,i){De([t,r],"resizeBilinearBackprop");for(var a=r.shape,s=a[0],o=a[1],c=a[2],u=a[3],l=t.shape,d=l[1],h=l[2],p=new Float32Array(s*o*c*u),g=[i&&d>1?o-1:o,i&&h>1?c-1:c],v=[i&&d>1?d-1:d,i&&h>1?h-1:h],y=g[0]/v[0],b=g[1]/v[1],x=this.readSync(t.dataId),S=0,w=0;w<s;w++)for(var k=w*r.strides[0],E=0;E<d;E++)for(var I=E*y,P=Math.floor(I),A=Math.min(Math.ceil(I),o-1),N=k+P*r.strides[1],j=k+A*r.strides[1],L=I-P,B=1-L,V=0;V<h;V++)for(var X=V*b,ne=Math.floor(X),se=Math.min(Math.ceil(X),c-1),ie=X-ne,de=1-ie,ue=N+ne*r.strides[2],Ce=N+se*r.strides[2],we=j+ne*r.strides[2],Fe=j+se*r.strides[2],Ge=B*de,Ie=B*ie,He=L*de,ot=L*ie,Je=0;Je<u;Je++){var et=x[S++];
vendor: 5,410 bytes, line 3798
3798p[ue+Je]+=et*Ge,p[Ce+Je]+=et*Ie,p[we+Je]+=et*He,p[Fe+Je]+=et*ot}return Ma(p,[s,c,o,u],r.dtype)},e.prototype.resizeNearestNeighbor=function(t,r,i,a){De(t,"resizeNearestNeighbor");for(var s=t.shape,o=s[0],c=s[1],u=s[2],l=s[3],d=this.readSync(t.dataId),h=new Float32Array(o*r*i*l),p=[a&&r>1?c-1:c,a&&i>1?u-1:u],g=[a&&r>1?r-1:r,a&&i>1?i-1:i],v=p[0]/g[0],y=p[1]/g[1],b=0,x=0;x<o;x++)for(var S=x*t.strides[0],w=0;w<r;w++)for(var k=v*w,E=S+Math.min(c-1,a?Math.round(k):Math.floor(k))*t.strides[1],I=0;I<i;I++)for(var P=y*I,A=E+Math.min(u-1,a?Math.round(P):Math.floor(P))*t.strides[2],N=0;N<l;N++){var j=d[A+N];h[b++]=j}return Pi(h,[o,r,i,l],t.dtype)},e.prototype.resizeNearestNeighborBackprop=function(t,r,i){De([t,r],"resizeNearestNeighborBackprop");for(var a=r.shape,s=a[0],o=a[1],c=a[2],u=a[3],l=t.shape,d=l[1],h=l[2],p=new Float32Array(s*o*c*u),g=this.readSync(t.dataId),v=[i&&d>1?o-1:o,i&&h>1?c-1:c],y=[i&&d>1?d-1:d,i&&h>1?h-1:h],b=v[0]/y[0],x=v[1]/y[1],S=1/b,w=1/x,k=2*Math.ceil(S)+2,E=2*Math.ceil(w)+2,I=0;I<s;I++)for(var P=I*r.strides[0],A=0;A<o;A++)for(var N=P+A*r.strides[1],j=Math.floor(A*S),L=Math.floor(j-k/2),B=0;B<c;B++)for(var V=N+B*r.strides[2],X=Math.floor(B*w),ne=Math.floor(X-E/2),se=0;se<u;se++){for(var ie=0,de=0;de<k;de++){var ue=de+L;if(!(ue<0||ue>=d)){var Ce=P+ue*t.strides[1],we=ue*b;if(A===Math.min(o-1,i?Math.round(we):Math.floor(we)))for(var Fe=0;Fe<E;Fe++){var Ge=Fe+ne;if(!(Ge<0||Ge>=h)){var Ie=Ce+Ge*t.strides[2],He=Ge*x;B===Math.min(c-1,i?Math.round(He):Math.floor(He))&&(ie+=g[Ie+se])}}}}p[V+se]=ie}return Ma(p,r.shape,r.dtype)},e.prototype.batchNormalization=function(t,r,i,a,s,o){De([t,r,i,s,o],"batchNorm");for(var c=this.readSync(t.dataId),u=this.readSync(r.dataId),l=this.readSync(i.dataId),d=s?this.readSync(s.dataId):new Float32Array([1]),h=o?this.readSync(o.dataId):new Float32Array([0]),p=new Float32Array(c.length),g=h.length,v=d.length,y=l.length,b=u.length,x=0,S=0,w=0,k=0,E=0;E<c.length;++E)p[E]=h[x++]+(c[E]-u[S++])*d[w++]/Math.sqrt(l[k++]+a),x>=g&&(x=0),S>=b&&(S=0),w>=v&&(w=0),k>=y&&(k=0);return Ma(p,t.shape)},e.prototype.localResponseNormalization4D=function(t,r,i,a,s){De(t,"localResponseNormalization4D");var o=t.shape[3],c=o-1,u=this.readSync(t.dataId),l=t.size,d=new Float32Array(l);function h(y){for(var b=y%o,x=y-b+Math.max(0,b-r),S=y-b+Math.min(b+r,c),w=0;x<=S;x++){var k=u[x];w+=k*k}return w}for(var p=0;p<l;p++){var g=h(p),v=u[p]*Math.pow(i+a*g,-s);d[p]=v}return Ma(d,t.shape)},e.prototype.LRNGrad=function(t,r,i,a,s,o,c){De(t,"LRNGrad");for(var u=t.shape[3],l=this.readSync(t.dataId),d=this.readSync(r.dataId),h=this.readSync(i.dataId),p=new Float32Array(t.size),g=t.size,v=0;v<g;v++){for(var y=v%u,b=v-y+Math.max(0,y-a),x=v-y+Math.min(u,y+a+1),S=0,w=b;w<x;w++)S+=Math.pow(d[w],2);for(S=o*S+s,w=b;w<x;w++){var k=-2*o*c*d[w]*h[v]/S;v===w&&(k+=Math.pow(S,-c)),k*=l[v],p[w]+=k}}return Ma(p,t.shape)},e.prototype.multinomial=function(t,r,i,a){De(t,"multinomial");for(var s=r?t:tl(t),o=s.shape[0],c=s.shape[1],u=Gn([o,i],"int32"),l=this.readSync(u.dataId),d=this.readSync(s.dataId),h=0;h<o;++h){var p=h*c,g=new Float32Array(c-1);g[0]=d[p];for(var v=1;v<g.length;++v)g[v]=g[v-1]+d[p+v];for(var y=sb(a.toString()),b=h*i,x=0;x<i;++x){var S=y();l[b+x]=g.length;for(var w=0;w<g.length;w++)if(S<g[w]){l[b+x]=w;break}}}return u},e.prototype.oneHot=function(t,r,i,a){De(t,"oneHot");var s=new Float32Array(t.size*r);s.fill(a);for(var o=this.readSync(t.dataId),c=0;c<t.size;++c)o[c]>=0&&o[c]<r&&(s[c*r+o[c]]=i);return $l(s,[t.size,r],"int32")},e.prototype.nonMaxSuppression=function(t,r,i,a,s){return De(t,"nonMaxSuppression"),gS(this.readSync(t.dataId),this.readSync(r.dataId),i,a,s)},e.prototype.fft=function(t){return this.fftBatch(t,!1)},e.prototype.ifft=function(t){return this.fftBatch(t,!0)},e.prototype.fftBatch=function(t,r){for(var i=t.shape[0],a=t.shape[1],s=Dt(t.shape,"float32"),o=Dt(t.shape,"float32"),c=oo(t).as2D(i,a),u=Dc(t).as2D(i,a),l=0;l<i;l++)for(var d=c.slice([l,0],[1,a]),h=u.slice([l,0],[1,a]),p=Ti(d,h),g=this.readSync(this.fftImpl(p,r).dataId),v=0;v<a;v++){var y=g4(g,v);s.values[l*a+v]=y.real,o.values[l*a+v]=y.imag}return Ti(s.toTensor(),o.toTensor()).as2D(i,a)},e.prototype.fftImpl=function(t,r){var i=t.as1D(),a=i.size;if(this.isExponentOf2(a)){var s=this.fftRadix2(i,a,r).as2D(t.shape[0],t.shape[1]);return r&&(s=Ti(oo(s).div(Ke(a)),Dc(s).div(Ke(a)))),s}var o=this.readSync(t.dataId),c=function(u){for(var l=new Float32Array(u.length/2),d=new Float32Array(u.length/2),h=0;h<u.length;h+=2)l[h/2]=u[h],d[h/2]=u[h+1];return{real:l,imag:d}}(this.fourierTransformByMatmul(o,a,r));return Ti(c.real,c.imag).as2D(t.shape[0],t.shape[1])},e.prototype.isExponentOf2=function(t){return(t&t-1)==0},e.prototype.fftRadix2=function(t,r,i){if(r===1)return t;var a=this.readSync(t.dataId),s=r/2,o=function(b){for(var x=Math.ceil(b.length/4),S=new Float32Array(x),w=new Float32Array(x),k=0;k<b.length;k+=4)S[Math.floor(k/4)]=b[k],w[Math.floor(k/4)]=b[k+1];return{real:S,imag:w}}(a),c=Ti(o.real,o.imag).as1D(),u=function(b){for(var x=Math.floor(b.length/4),S=new Float32Array(x),w=new Float32Array(x),k=2;k<b.length;k+=4)S[Math.floor(k/4)]=b[k],w[Math.floor(k/4)]=b[k+1];return{real:S,imag:w}}(a),l=Ti(u.real,u.imag).as1D();c=this.fftRadix2(c,s,i),l=this.fftRadix2(l,s,i);var d=function(b,x){for(var S=new Float32Array(b/2),w=new Float32Array(b/2),k=0;k<Math.ceil(b/2);k++){var E=(x?2:-2)*Math.PI*(k/b);S[k]=Math.cos(E),w[k]=Math.sin(E)}return{real:S,imag:w}}
vendor: 10,501 bytes, lines 3798-3854
3798(r,i),h=Ti(d.real,d.imag).mul(l),p=c.add(h),g=c.sub(h),v=oo(p).concat(oo(g)),y=Dc(p).concat(Dc(g));return Ti(v,y).as1D()},e.prototype.fourierTransformByMatmul=function(t,r,i){for(var a=new Float32Array(2*r),s=0;s<r;s++){for(var o=0,c=0,u=0;u<r;u++){var l=Qte(s*u,r,i),d=g4(t,u);o+=d.real*l.real-d.imag*l.imag,c+=d.real*l.imag+d.imag*l.real}i&&(o/=r,c/=r),Jte(a,o,c,s)}return a},e.prototype.depthToSpace=function(t,r,i){J(i==="NHWC",function(){return"Only NHWC dataFormat supported on CPU for depthToSpace. Got "+i}),J(r>1,function(){return"blockSize should be > 1 for depthToSpace, but was: "+r});for(var a=t.shape[0],s=t.shape[1],o=t.shape[2],c=t.shape[3],u=s*r,l=o*r,d=c/(r*r),h=this.readSync(t.dataId),p=new Float32Array(a*u*l*d),g=0,v=0;v<a;++v)for(var y=0;y<u;++y)for(var b=Math.floor(y/r),x=y%r,S=0;S<l;++S)for(var w=Math.floor(S/r),k=(x*r+S%r)*d,E=0;E<d;++E){var I=E+k+c*(w+o*(b+s*v));p[g++]=h[I]}return Ma(p,[a,u,l,d])},e.prototype.broadcastedBinaryOp=function(t,r,i,a){var s=tn(t.shape,r.shape),o=Dt(s,i),c=this.readSync(t.dataId),u=this.readSync(r.dataId),l=Pl(t.shape,s),d=Pl(r.shape,s),h=o.values;if(l.length+d.length===0)for(var p=0;p<h.length;++p)h[p]=a(c[p%c.length],u[p%u.length]);else{var g=this.bufferSync(t),v=this.bufferSync(r),y=function(b){var x=o.indexToLoc(b),S=x.slice(-t.rank);l.forEach(function(I){return S[I]=0});var w=g.locToIndex(S),k=x.slice(-r.rank);d.forEach(function(I){return k[I]=0});var E=v.locToIndex(k);h[b]=a(c[w],u[E])};for(p=0;p<h.length;++p)y(p)}return o.toTensor()},e.prototype.broadcastedBinaryComplexOp=function(t,r,i){var a=tn(t.shape,r.shape),s=Dt(a,"float32"),o=Dt(a,"float32"),c=this.readSync(t.dataId),u=this.readSync(r.dataId),l=Pl(t.shape,a),d=Pl(r.shape,a),h=s.values,p=o.values;if(l.length+d.length===0)for(var g=0;g<h.length;g++){var v=g%c.length,y=g%u.length,b=i(c[2*v],c[2*v+1],u[2*y],u[2*y+1]);h[g]=b.real,p[g]=b.imag}else{var x=this.bufferSync(this.data.get(t.dataId).complexTensors.real),S=this.bufferSync(this.data.get(r.dataId).complexTensors.real),w=function(k){var E=s.indexToLoc(k),I=E.slice(-t.rank);l.forEach(function(L){return I[L]=0});var P=x.locToIndex(I),A=E.slice(-r.rank);d.forEach(function(L){return A[L]=0});var N=S.locToIndex(A),j=i(c[2*P],c[2*P+1],u[2*N],u[2*N+1]);h[k]=j.real,p[k]=j.imag};for(g=0;g<h.length;g++)w(g)}return this.complex(s.toTensor(),o.toTensor())},e.prototype.split=function(t,r,i){return Z5(t,r,i)},e.prototype.dispose=function(){},e.prototype.floatPrecision=function(){return 32},e.prototype.epsilon=function(){return 1e-7},e.prototype.cropAndResize=function(t,r,i,a,s,o){for(var c=t.shape,u=c[0],l=c[1],d=c[2],h=c[3],p=r.shape[0],g=a[0],v=a[1],y=Dt([p,g,v,h],"float32"),b=this.readSync(r.dataId),x=this.readSync(i.dataId),S=this.readSync(t.dataId),w=t.strides,k=y.strides,E=0;E<p;E++){var I=4*E,P=b[I],A=b[I+1],N=b[I+2],j=b[I+3],L=x[E];if(!(L>=u))for(var B=g>1?(N-P)*(l-1)/(g-1):0,V=v>1?(j-A)*(d-1)/(v-1):0,X=0;X<g;X++){var ne=g>1?P*(l-1)+X*B:.5*(P+N)*(l-1);if(ne<0||ne>l-1)for(var se=0;se<v;se++)for(var ie=0;ie<h;ie++){var de=ie+se*k[2]+X*k[1]+E*k[0];y.values[de]=o}else if(s==="bilinear"){var ue=Math.floor(ne),Ce=Math.ceil(ne),we=ne-ue;for(se=0;se<v;se++)if((_t=v>1?A*(d-1)+se*V:.5*(A+j)*(d-1))<0||_t>d-1)for(ie=0;ie<h;ie++)de=ie+se*k[2]+X*k[1]+E*k[0],y.values[de]=o;else{var Fe=Math.floor(_t),Ge=Math.ceil(_t),Ie=_t-Fe;for(ie=0;ie<h;ie++){var He=S[de=ie+Fe*w[2]+ue*w[1]+L*w[0]],ot=S[de=ie+Ge*w[2]+ue*w[1]+L*w[0]],Je=S[de=ie+Fe*w[2]+Ce*w[1]+L*w[0]],et=He+(ot-He)*Ie,Ut=Je+(S[de=ie+Ge*w[2]+Ce*w[1]+L*w[0]]-Je)*Ie;de=ie+se*k[2]+X*k[1]+E*k[0],y.values[de]=et+(Ut-et)*we}}}else for(se=0;se<v;++se){var _t;if((_t=v>1?A*(d-1)+se*V:.5*(A+j)*(d-1))<0||_t>d-1)for(ie=0;ie<h;ie++)de=ie+se*k[2]+X*k[1]+E*k[0],y.values[de]=o;else{var mt=Math.round(_t),wt=Math.round(ne);for(ie=0;ie<h;ie++){var Kt=ie+mt*w[2]+wt*w[1]+L*w[0],Ct=ie+se*k[2]+X*k[1]+E*k[0];y.values[Ct]=S[Kt]}}}}}return y.toTensor()},e.prototype.sparseToDense=function(t,r,i,a){var s=s_(0,t,i),o=s.sliceRank,c=s.numUpdates,u=s.sliceSize,l=s.strides,d=s.outputSize;return this.scatter(t,r,i,d,u,c,o,l,a,!1)},e.prototype.gatherND=function(t,r){var i=r.shape,a=i[i.length-1],s=z5(t,r),o=s[0],c=s[1],u=s[2],l=s[3];if(c===0)return Pi([],o,t.dtype);for(var d=new xg([c,u],t.dtype),h=this.readSync(r.dataId),p=this.readSync(t.dataId),g=0;g<c;g++){for(var v=[],y=0,b=0;b<a;b++){var x=h[g*a+b];y+=x*l[b],v.push(x)}if(y<0||y>=t.size/u)throw new Error("Invalid indices: "+v+" does not index into "+t.shape);for(var S=0;S<u;S++)d.values[g*u+S]=p[y*u+S]}return d.toTensor().reshape(o)},e.prototype.scatterND=function(t,r,i){var a=s_(0,t,i),s=a.sliceRank,o=a.numUpdates,c=a.sliceSize,u=a.strides,l=a.outputSize,d=Ke(0);return this.scatter(t,r,i,l,c,o,s,u,d,!0)},e.prototype.fill=function(t,r,i){var a=Xy(i=i||rv(r),ct(t));return a.fill(r),ce.makeTensor(a,t,i,this)},e.prototype.onesLike=function(t){if(t.dtype==="string")throw new Error("onesLike is not supported for string tensors");return this.fill(t.shape,1,t.dtype)},e.prototype.zerosLike=function(t){var r=Xy(t.dtype,ct(t.shape));return this.makeOutput(r,t.shape,t.dtype)},e.prototype.linspace=function(t,r,i){return J5(t,r,i)},e.prototype.scatter=function(t,r,i,a,s,o,c,u,l,d){var h=[a/s,s],p=this.readSync(t.dataId),g=this.readSync(r.dataId);if(a===0)return Pi([],i,r.dtype);var v=new xg(h,r.dtype);v.values.fill(this.readSync(l.dataId)[0]);for(var y=0;y<o;y++){for(var b=[],x=0,S=0;S<c;S++){var w=p[y*c+S];b.push(w),x+=w*u[S]}if(x<0||x>=a/s)throw new Error("Invalid indices: "+b+" does not index into "+i);for(var k=0;k<s;k++)d?v.values[x*s+k]+=g[y*s+k]:v.values[x*s+k]=r.rank===0?g[0]:g[y*s+k]}return v.toTensor().reshape(i)},e}(K5);ce.registerBackend("cpu",function(){return new yse},1);for(var Ew=0,$4=[{kernelName:"NonMaxSuppressionV5",backendName:"cpu",kernelFunc:function(n){var e=n.inputs,t=n.backend,r=n.attrs,i=e,a=i.boxes,s=i.scores,o=r,c=o.maxOutputSize,u=o.iouThreshold,l=o.scoreThreshold,d=o.softNmsSigma,h=t;De(a,"NonMaxSuppressionWithScore");var p=vS(h.data.get(a.dataId).values,h.data.get(s.dataId).values,c,u,l,d);return[p.selectedIndices,p.selectedScores]}},{kernelName:"Square",backendName:"cpu",kernelFunc:function(n){var e=n.inputs,t=n.backend,r=e.x,i=t;De(r,"square");for(var a=i.data.get(r.dataId).values,s=new Float32Array(a.length),o=0;o<a.length;++o){var c=a[o];s[o]=c*c}return{dataId:i.write(s,r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},{kernelName:kg,backendName:"cpu",kernelFunc:function(n){var e=n.inputs,t=n.backend,r=e,i=r.a,a=r.b,s=t;De([i,a],kg);var o=s.data.get(i.dataId).values,c=s.data.get(a.dataId).values,u=function(h,p,g,v,y,b){var x=tn(h,p),S=x.length,w=Gc(x),k=bg(y,ct(x)),E=h.length,I=p.length,P=Gc(h),A=Gc(p),N=Pl(h,x),j=Pl(p,x);if(N.length+j.length===0)for(var L=0;L<k.length;++L)k[L]=b(g[L%g.length],v[L%v.length]);else{var B=function(V){var X=Pee(V,S,w),ne=X.slice(-E);N.forEach(function(ue){return ne[ue]=0});var se=o4(ne,E,P),ie=X.slice(-I);j.forEach(function(ue){return ie[ue]=0});var de=o4(ie,I,A);k[V]=b(g[se],v[de])};for(L=0;L<k.length;++L)B(L)}return[k,x]}(i.shape,a.shape,o,c,i.dtype,function(h,p){var g=h-p;return g*g}),l=u[0],d=u[1];return{dataId:s.write(l,d,i.dtype),shape:d,dtype:i.dtype}}}];Ew<$4.length;Ew++)w5($4[Ew]);var ah,_se=function(n){this.variableNames=["A"];var e=Wi(),t=n[0],r=n[1];this.outputShape=n,this.userCode=` 3799 void main() { 3800 ivec3 coords = getOutputCoords(); 3801 int texR = coords[0]; 3802 int texC = coords[1]; 3803 int depth = coords[2]; 3804 vec2 uv = (vec2(texC, texR) + halfCR) / vec2(`+r+".0, "+t+`.0); 3805 3806 vec4 values = `+e.texture2D+`(A, uv); 3807 float value; 3808 if (depth == 0) { 3809 value = values.r; 3810 } else if (depth == 1) { 3811 value = values.g; 3812 } else if (depth == 2) { 3813 value = values.b; 3814 } else if (depth == 3) { 3815 value = values.a; 3816 } 3817 3818 setOutput(floor(value * 255.0 + 0.5)); 3819 } 3820 `},bse=function(n){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;var e=Wi(),t=n[0],r=n[1];this.outputShape=n,this.userCode=` 3821 void main() { 3822 ivec3 coords = getOutputCoords(); 3823 int texR = coords[0]; 3824 int texC = coords[1]; 3825 int depth = coords[2]; 3826 3827 vec4 result = vec4(0.); 3828 3829 for(int row=0; row<=1; row++) { 3830 for(int col=0; col<=1; col++) { 3831 texC = coords[1] + row; 3832 depth = coords[2] + col; 3833 3834 vec2 uv = (vec2(texC, texR) + halfCR) / 3835 vec2(`+r+".0, "+t+`.0); 3836 vec4 values = `+e.texture2D+`(A, uv); 3837 float value; 3838 if (depth == 0) { 3839 value = values.r; 3840 } else if (depth == 1) { 3841 value = values.g; 3842 } else if (depth == 2) { 3843 value = values.b; 3844 } else if (depth == 3) { 3845 value = values.a; 3846 } 3847 3848 result[row * 2 + col] = floor(value * 255.0 + 0.5); 3849 } 3850 } 3851 3852 `+e.output+` = result; 3853 } 3854 `};for(var Pw=0,B4=[{kernelName:"FromPixels",backendName:"webgl",kernelFunc:function(n){var e=n.inputs,t=n.backend,r=n.attrs,i=e.pixels,a=r.numChannels,s=typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement,o=typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement,c=s?[i.videoWidth,i.videoHeight]:[i.width,i.height],u=c[0],l=c[1],d=[l,u],h=[l,u,a];(o||s)&&(ah==null&&(ah=document.createElement("canvas").getContext("2d")),ah.canvas.width=u,ah.canvas.height=l,ah.drawImage(i,0,0,u,l),i=ah.canvas);var p=t.makeTensorInfo(d,"int32");t.texData.get(p.dataId).usage=vs.PIXELS,t.gpgpu.uploadPixelDataToTexture(t.getTexture(p.dataId),i);var g=ke().getBool("WEBGL_PACK")?new bse(h):new _se(h),v=t.runWebGLProgram(g,[p],"int32");return t.disposeData(p.dataId),v}},{kernelName:"NonMaxSuppressionV5",backendName:"webgl",kernelFunc:function(n){var e=n.inputs,t=n.backend,r=n.attrs;e_("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");var i=e,a=i.boxes,s=i.scores,o=r,c=o.maxOutputSize,u=o.iouThreshold,l=o.scoreThreshold,d=o.softNmsSigma,h=t,p=vS(h.readSync(a.dataId),h.readSync(s.dataId),c,u,l,d);return[p.selectedIndices,p.selectedScores]}},{kernelName:"Square",backendName:"webgl",kernelFunc:function(n){var e=n.inputs,t=n.backend,r=e.x,i=t,a=new $t(r.shape,"return x * x;");return i.runWebGLProgram(a,[r],r.dtype)}},{kernelName:kg,backendName:"webgl",kernelFunc:function(n){var e=n.inputs,t=n.backend,r=e,i=r.a,a=r.b,s=t,o=ke().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Au("return (a
3854- b) * (a - b);",i.shape,a.shape):new wr("return (a - b) * (a - b);",i.shape,a.shape);return s.compileAndRun(o,[i,a])}}];Pw<B4.length;Pw++)w5(B4[Pw]);for(var Rw=0,U4=[{kernelName:"Square",gradFunc:function(n,e){var t=e[0];return{x:function(){return n.mul(t.toFloat().mul(2))}}}},{kernelName:kg,gradFunc:function(n,e){var t=e[0],r=e[1],i=Ke(2);return{a:function(){return Ki(n,Ki(i,ci(t,r)))},b:function(){return Ki(n,Ki(i,ci(r,t)))}}}}];Rw<U4.length;Rw++)vee(U4[Rw]);var xse=function(){function n(){}return n.prototype.fetch=function(e,t){return fetch(e,t)},n.prototype.now=function(){return performance.now()},n.prototype.encode=function(e,t){if(t!=="utf-8"&&t!=="utf8")throw new Error("Browser's encoder only supports utf-8, but got "+t);return this.textEncoder==null&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)},n.prototype.decode=function(e,t){return new TextDecoder(t).decode(e)},n}();ke().get("IS_BROWSER")&&ke().setPlatform("browser",new xse);var Aw,wse=function(){return require("node-fetch")},Cse=function(){function n(){this.util=require("util"),this.textEncoder=new this.util.TextEncoder}return n.prototype.fetch=function(e,t){return ke().global.fetch!=null?ke().global.fetch(e,t):(Aw==null&&(Aw=wse()),Aw(e,t))},n.prototype.now=function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6},n.prototype.encode=function(e,t){if(t!=="utf-8"&&t!=="utf8")throw new Error("Node built-in encoder only supports utf-8, but got "+t);return this.textEncoder.encode(e)},n.prototype.decode=function(e,t){return e.length===0?"":new this.util.TextDecoder(t).decode(e)},n}();ke().get("IS_NODE")&&ke().setPlatform("node",new Cse);var dk={float32:4,int32:4,uint16:2,uint8:1,bool:1},h_=4;function HN(n,e){for(var t={},r=0,i=function(o){var c=o.name,u=o.dtype,l=o.shape,d=ct(l),h=void 0;if("quantization"in o){var p=o.quantization;if(p.dtype!=="uint8"&&p.dtype!=="uint16")throw new Error("Weight "+o.name+" has unknown quantization dtype "+p.dtype+". Supported quantization dtypes are: 'uint8' and 'uint16'.");var g=dk[p.dtype],v=n.slice(r,r+d*g),y=p.dtype==="uint8"?new Uint8Array(v):new Uint16Array(v);if(u==="float32")h=Float32Array.from(y,function(E){return E*p.scale+p.min});else{if(u!=="int32")throw new Error("Unsupported dtype in weight '"+c+"': "+u);h=Int32Array.from(y,function(E){return Math.round(E*p.scale+p.min)})}r+=d*g}else if(u==="string"){var b=ct(o.shape);h=[];for(var x=0;x<b;x++){var S=new Uint32Array(n.slice(r,r+h_))[0];r+=h_;var w=new Uint8Array(n.slice(r,r+S));h.push(w),r+=S}}else{var k=dk[u];if(v=n.slice(r,r+d*k),u==="float32")h=new Float32Array(v);else if(u==="int32")h=new Int32Array(v);else{if(u!=="bool")throw new Error("Unsupported dtype in weight '"+c+"': "+u);h=new Uint8Array(v)}r+=d*k}t[c]=Pi(h,l,u)},a=0,s=e;a<s.length;a++)i(s[a]);return t}function kse(n){if(n===null)throw new Error("Invalid input value: "+JSON.stringify(n));var e=0,t=[];n.forEach(function(a){if(e+=a.byteLength,t.push(a.byteLength===a.buffer.byteLength?a:new a.constructor(a)),!(a instanceof Float32Array||a instanceof Int32Array||a instanceof Uint8Array))throw new Error("Unsupported TypedArray subtype: "+a.constructor.name)});var r=new Uint8Array(e),i=0;return t.forEach(function(a){r.set(new Uint8Array(a.buffer),i),i+=a.byteLength}),r.buffer}var fk=typeof Buffer<"u"&&(typeof Blob>"u"||typeof atob>"u"||typeof btoa>"u");function j4(n){return fk?Buffer.byteLength(n):new Blob([n]).size}function LS(n){var e=0;n.forEach(function(i){e+=i.byteLength});var t=new Uint8Array(e),r=0;return n.forEach(function(i){t.set(new Uint8Array(i),r),r+=i.byteLength}),t.buffer}function q4(n){for(n=n.trim();n.endsWith("/");)n=n.slice(0,n.length-1);var e=n.split("/");return e[e.length-1]}function lv(n){if(n.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:n.modelTopology==null?0:j4(JSON.stringify(n.modelTopology)),weightSpecsBytes:n.weightSpecs==null?0:j4(JSON.stringify(n.weightSpecs)),weightDataBytes:n.weightData==null?0:n.weightData.byteLength}}var ys=function(){function n(){this.saveRouters=[],this.loadRouters=[]}return n.getInstance=function(){return n.instance==null&&(n.instance=new n),n.instance},n.registerSaveRouter=function(e){n.getInstance().saveRouters.push(e)},n.registerLoadRouter=function(e){n.getInstance().loadRouters.push(e)},n.getSaveHandlers=function(e){return n.getHandlers(e,"save")},n.getLoadHandlers=function(e,t){return n.getHandlers(e,"load",t)},n.getHandlers=function(e,t,r){var i=[];return(t==="load"?n.getInstance().loadRouters:n.getInstance().saveRouters).forEac
3854h(function(a){var s=a(e,r);s!==null&&i.push(s)}),i},n}(),$h="://",Bl=function(){function n(){this.managers={}}return n.getInstance=function(){return n.instance==null&&(n.instance=new n),n.instance},n.registerManager=function(e,t){J(e!=null,function(){return"scheme must not be undefined or null."}),e.endsWith($h)&&(e=e.slice(0,e.indexOf($h))),J(e.length>0,function(){return"scheme must not be an empty string."});var r=n.getInstance();J(r.managers[e]==null,function(){return"A model store manager is already registered for scheme '"+e+"'."}),r.managers[e]=t},n.getManager=function(e){var t=this.getInstance().managers[e];if(t==null)throw new Error("Cannot find model manager for scheme '"+e+"'");return t},n.getSchemes=function(){return Object.keys(this.getInstance().managers)},n}();function cy(n){if(n.indexOf($h)===-1)throw new Error("The url string provided does not contain a scheme. Supported schemes are: "+Bl.getSchemes().join(","));return{scheme:n.split($h)[0],path:n.split($h)[1]}}function z4(n,e,t){return t===void 0&&(t=!1),at(this,void 0,void 0,function(){var r,i,a,s,o,c,u,l,d;return st(this,function(h){switch(h.label){case 0:return J(n!==e,function(){return"Old path and new path are the same: '"+n+"'"}),J((r=ys.getLoadHandlers(n)).length>0,function(){return"Copying failed because no load handler is found for source URL "+n+"."}),J(r.length<2,function(){return"Copying failed because more than one ("+r.length+") load handlers for source URL "+n+"."}),i=r[0],J((a=ys.getSaveHandlers(e)).length>0,function(){return"Copying failed because no save handler is found for destination URL "+e+"."}),J(a.length<2,function(){return"Copying failed because more than one ("+r.length+") save handlers for destination URL "+e+"."}),s=a[0],o=cy(n).scheme,c=cy(n).path,u=o===cy(n).scheme,[4,i.load()];case 1:return l=h.sent(),t&&u?[4,Bl.getManager(o).removeModel(c)]:[3,3];case 2:h.sent(),h.label=3;
3854case 3:return[4,s.save(l)];case 4:return d=h.sent(),!t||u?[3,6]:[4,Bl.getManager(o).removeModel(c)];case 5:h.sent(),h.label=6;case 6:return[2,d.modelArtifactsInfo]}})})}var Vd="models_store",Rl="model_info_store";function VN(){if(!ke().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");var n=window||self,e=n.indexedDB||n.mozIndexedDB||n.webkitIndexedDB||n.msIndexedDB||n.shimIndexedDB;if(e==null)throw new Error("The current browser does not appear to support IndexedDB.");return e}function hk(n){var e=n.result;e.createObjectStore(Vd,{keyPath:"modelPath"}),e.createObjectStore(Rl,{keyPath:"modelPath"})}var Bh=function(){function n(e){if(this.indexedDB=VN(),e==null||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}return n.prototype.save=function(e){return at(this,void 0,void 0,function(){return st(this,function(t){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return[2,this.databaseAction(this.modelPath,e)]})})},n.prototype.load=function(){return at(this,void 0,void 0,function(){return st(this,function(e){return[2,this.databaseAction(this.modelPath)]})})},n.prototype.databaseAction=function(e,t){var r=this;return new Promise(function(i,a){var s=r.indexedDB.open("tensorflowjs",1);s.onupgradeneeded=function(){return hk(s)},s.onsuccess=function(){var o=s.result;if(t==null){var c=o.transaction(Vd,"readonly"),u=c.objectStore(Vd).get(r.modelPath);u.onsuccess=function(){if(u.result==null)return o.close(),a(new Error("Cannot find model with path '"+r.modelPath+"' in IndexedDB."));i(u.result.modelArtifacts)},u.onerror=function(v){return o.close(),a(u.error)},c.oncomplete=function(){return o.close()}}else{var l,d=lv(t),h=o.transaction(Rl,"readwrite"),p=h.objectStore(Rl),g=p.put({modelPath:r.modelPath,modelArtifactsInfo:d});g.onsuccess=function(){var v=(l=o.transaction(Vd,"readwrite")).objectStore(Vd).put({modelPath:r.modelPath,modelArtifacts:t,modelArtifactsInfo:d});v.onsuccess=function(){return i({modelArtifactsInfo:d})},v.onerror=function(y){var b=(p=h.objectStore(Rl)).delete(r.modelPath);b.onsuccess=function(){return o.close(),a(v.error)},b.onerror=function(x){return o.close(),a(v.error)}}},g.onerror=function(v){return o.close(),a(g.error)},h.oncomplete=function(){l==null?o.close():l.oncomplete=function(){return o.close()}}}},s.onerror=function(o){return a(s.error)}})},n.URL_SCHEME="indexeddb://",n}(),W4=function(n){return ke().getBool("IS_BROWSER")&&!Array.isArray(n)&&n.startsWith(Bh.URL_SCHEME)?(e=n.slice(Bh.URL_SCHEME.length),new Bh(e)):null;var e};ys.registerSaveRouter(W4),ys.registerLoadRouter(W4);var Sse=function(){function n(){this.indexedDB=VN()}return n.prototype.listModels=function(){return at(this,void 0,void 0,function(){var e=this;return st(this,function(t){return[2,new Promise(function(r,i){var a=e.indexedDB.open("tensorflowjs",1);a.onupgradeneeded=function(){return hk(a)},a.onsuccess=function(){var s=a.result,o=s.transaction(Rl,"readonly"),c=o.objectStore(Rl).getAll();c.onsuccess=function(){for(var u={},l=0,d=c.result;l<d.length;l++){var h=d[l];u[h.modelPath]=h.modelArtifactsInfo}r(u)},c.onerror=function(u){return s.close(),i(c.error)},o.oncomplete=function(){return s.close()}},a.onerror=function(s){return i(a.error)}})]})})},n.prototype.removeModel=function(e){return at(this,void 0,void 0,function(){var t=this;return st(this,function(r){var i;return e=(i=e).startsWith(Bh.URL_SCHEME)?i.slice(Bh.URL_SCHEME.length):i,[2,new Promise(function(a,s){var o=t.indexedDB.open("tensorflowjs",1);o.onupgradeneeded=function(){return hk(o)},o.onsuccess=function(){var c,u=o.result,l=u.transaction(Rl,"readwrite"),d=l.objectStore(Rl),h=d.get(e);h.onsuccess=function(){if(h.result==null)return u.close(),s(new Error("Cannot find model with path '"+e+"' in IndexedDB."));var p=d.delete(e),g=function(){var v=(c=u.transaction(Vd,"readwrite")).objectStore(Vd).delete(e);v.onsuccess=function(){return a(h.result.modelArtifactsInfo)},v.onerror=function(y){return s(h.error)}};p.onsuccess=g,p.onerror=function(v){return g(),u.close(),s(h.error)}},h.onerror=function(p){return u.close(),s(h.error)},l.oncomplete=function(){c==null?u.close():c.oncomplete=function(){return u.close()}}},o.onerror=function(c){return s(o.error)}})]})})},n}();
3854if(ke().getBool("IS_BROWSER"))try{Bl.registerManager(Bh.URL_SCHEME,new Sse)}catch{}var $u="/",bh="tensorflowjs_models",GN="info",Tse="model_topology",Ese="weight_specs",Pse="weight_data",Rse="model_metadata";function KN(n){return{info:[bh,n,GN].join($u),topology:[bh,n,Tse].join($u),weightSpecs:[bh,n,Ese].join($u),weightData:[bh,n,Pse].join($u),modelMetadata:[bh,n,Rse].join($u)}}function Ase(n){var e=n.split($u);if(e.length<3)throw new Error("Invalid key format: "+n);return e.slice(1,e.length-1).join($u)}var Uh=function(){function n(e){if(!ke().getBool("IS_BROWSER")||typeof window>"u"||window.localStorage===void 0)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,e==null||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=KN(this.modelPath)}return n.prototype.save=function(e){return at(this,void 0,void 0,function(){var t,r,i;return st(this,function(a){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");t=JSON.stringify(e.modelTopology),r=JSON.stringify(e.weightSpecs),i=lv(e);try{return this.LS.setItem(this.keys.info,JSON.stringify(i)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,r),this.LS.setItem(this.keys.weightData,function(s){if(fk)return Buffer.from(s).toString("base64");for(var o=new Uint8Array(s),c="",u=0,l=o.length;u<l;u++)c+=String.fromCharCode(o[u]);return btoa(c)}(e.weightData)),this.LS.setItem(this.keys.modelMetadata,JSON.stringify({format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,userDefinedMetadata:e.userDefinedMetadata})),[2,{modelArtifactsInfo:i}]}catch{throw this.LS.removeItem(this.keys.info),this.LS.removeItem(this.keys.topology),this.LS.removeItem(this.keys.weightSpecs),this.LS.removeItem(this.keys.weightData),this.LS.removeItem(this.keys.modelMetadata),new Error("Failed to save model '"+this.modelPath+"' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes="+i.modelTopologyBytes+", weightSpecsBytes="+i.weightSpecsBytes+", weightDataBytes="+i.weightDataBytes+".")}return[2]})})},n.prototype.load=function(){return at(this,void 0,void 0,function(){var e,t,r,i,a,s,o;return st(this,function(c){if((e=JSON.parse(this.LS.getItem(this.keys.info)))==null)throw new Error("In local storage, there is no model with name '"+this.modelPath+"'");if(e.modelTopologyType!=="JSON")throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");if(t={},(r=JSON.parse(this.LS.getItem(this.keys.topology)))==null)throw new Error("In local storage, the topology of model '"+this.modelPath+"' is missing.");if(t.modelTopology=r,(i=JSON.parse(this.LS.getItem(this.keys.weightSpecs)))==null)throw new Error("In local storage, the weight specs of model '"+this.modelPath+"' are missing.");if(t.weightSpecs=i,(a=this.LS.getItem(this.keys.modelMetadata))!=null&&(s=JSON.parse(a),t.format=s.format,t.generatedBy=s.generatedBy,t.convertedBy=s.convertedBy,t.userDefinedMetadata=s.userDefinedMetadata),(o=this.LS.getItem(this.keys.weightData))==null)throw new Error("In local storage, the binary weight values of model '"+this.modelPath+"' are missing.");return t.weightData=function(u){if(fk){var l=Buffer.from(u,"base64");return l.buffer.slice(l.byteOffset,l.byteOffset+l.byteLength)}for(var d=atob(u),h=new Uint8Array(d.length),p=0;p<d.length;++p)h.set([d.charCodeAt(p)],p);return h.buffer}(o),[2,t]})})},n.URL_SCHEME="localstorage://",n}(),H4=function(n){return ke().getBool("IS_BROWSER")&&!Array.isArray(n)&&n.startsWith(Uh.URL_SCHEME)?(e=n.slice(Uh.URL_SCHEME.length),new Uh(e)):null;var e};ys.registerSaveRouter(H4),ys.registerLoadRouter(H4);var Ise=function(){function n(){J(ke().getBool("IS_BROWSER"),function(){return"Current environment is not a web browser"}),J(typeof window>"u"||window.localStorage!==void 0,function(){return"Current browser does not appear to support localStorage"}),this.LS=window.localStorage}return n.prototype.listModels=function(){return at(this,void 0,void 0,function(){var e,t,r,i,a,s;return st(this,function(o){for(e={},t=bh+$u,r=$u+GN,i=0;i<this.LS.length;++i)(a=this.LS.key(i)).startsWith(t)&&a.endsWith(r)&&(s=Ase(a),e[s]=JSON.parse(this.LS.getItem(a)));return[2,e]})})},n.prototype.removeModel=function(e){return at(this,void 0,void 0,function(){var t,r;return st(this,function(i){var a;if(e=(a=e).startsWith(Uh.URL_SCHEME)?a.slice(Uh.URL_SCHEME.length):a,t=KN(e),this.LS.getItem(t.info)==null)throw new Error("Cannot find model at path '"+e+"'");return r=JSON.parse(this.LS.getItem(t.info)),this.LS.removeItem(t.info),this.LS.removeItem(t.topology),this.LS.removeItem(t.weightSpecs),this.LS.removeItem(t.weightData),[2,r]})})},n}();
3854if(ke().getBool("IS_BROWSER"))try{Bl.registerManager(Uh.URL_SCHEME,new Ise)}catch{}var Ose="model",Mse=".json",Dse=".weights.bin";function V4(n){return new Promise(function(e){return setTimeout(e)}).then(n)}var Iw=function(){function n(e){if(!ke().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(n.URL_SCHEME)&&(e=e.slice(n.URL_SCHEME.length)),e!=null&&e.length!==0||(e=Ose),this.modelTopologyFileName=e+Mse,this.weightDataFileName=e+Dse}return n.prototype.save=function(e){return at(this,void 0,void 0,function(){var t,r,i,a,s,o;return st(this,function(c){switch(c.label){case 0:if(typeof document>"u")throw new Error("Browser downloads are not supported in this environment since `document` is not present");if(t=window.URL.createObjectURL(new Blob([e.weightData],{type:"application/octet-stream"})),!(e.modelTopology instanceof ArrayBuffer))return[3,1];throw new Error("BrowserDownloads.save() does not support saving model topology
3854in binary formats yet.");case 1:return r=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],i={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:r},a=window.URL.createObjectURL(new Blob([JSON.stringify(i)],{type:"application/json"})),(s=this.jsonAnchor==null?document.createElement("a"):this.jsonAnchor).download=this.modelTopologyFileName,s.href=a,[4,V4(function(){return s.dispatchEvent(new MouseEvent("click"))})];case 2:return c.sent(),e.weightData==null?[3,4]:((o=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor).download=this.weightDataFileName,o.href=t,[4,V4(function(){return o.dispatchEvent(new MouseEvent("click"))})]);case 3:c.sent(),c.label=4;case 4:return[2,{modelArtifactsInfo:lv(e)}]}})})},n.URL_SCHEME="downloads://",n}(),Nse=function(){function n(e){if(e==null||e.length<1)throw new Error("When calling browserFiles, at least 1 file is required, but received "+e);this.files=e}return n.prototype.load=function(){return at(this,void 0,void 0,function(){var e,t,r=this;return st(this,function(i){return e=this.files[0],t=this.files.slice(1),[2,new Promise(function(a,s){var o=new FileReader;o.onload=function(c){var u=JSON.parse(c.target.result),l=u.modelTopology;if(l!=null){t.length===0&&a({modelTopology:l});var d=u.weightsManifest;if(d!=null){var h;try{h=r.checkManifestAndWeightFiles(d,t)}catch(y){return void s(y)}var p=[],g=[],v=[];d.forEach(function(y){y.paths.forEach(function(b){g.push(b),v.push(null)}),p.push.apply(p,y.weights)}),d.forEach(function(y){y.paths.forEach(function(b){var x=new FileReader;x.onload=function(S){var w=S.target.result,k=g.indexOf(b);v[k]=w,v.indexOf(null)===-1&&a({modelTopology:l,weightSpecs:p,weightData:LS(v),format:u.format,generatedBy:u.generatedBy,convertedBy:u.convertedBy,userDefinedMetadata:u.userDefinedMetadata})},x.onerror=function(S){return s("Failed to weights data from file of path '"+b+"'.")},x.readAsArrayBuffer(h[b])})})}else s(new Error("weightManifest field is missing from file "+e.name))}else s(new Error("modelTopology field is missing from file "+e.name))},o.onerror=function(c){return s("Failed to read model topology and weights manifest JSON from file '"+e.name+"'. BrowserFiles supports loading Keras-style tf.Model artifacts only.")},o.readAsText(e)})]})})},n.prototype.checkManifestAndWeightFiles=function(e,t){for(var r=[],i=t.map(function(c){return q4(c.name)}),a={},s=0,o=e;s<o.length;s++)o[s].paths.forEach(function(c){var u=q4(c);if(r.indexOf(u)!==-1)throw new Error("Duplicate file basename found in weights manifest: '"+u+"'");if(r.push(u),i.indexOf(u)===-1)throw new Error("Weight file with basename '"+u+"' is not provided.");a[c]=t[i.indexOf(u)]});if(r.length!==t.length)throw new Error("Mismatch in the number of files in weights manifest ("+r.length+") and the number of weight files provided ("+t.length+").");return a},n}();function G4(n,e,t,r){(function(a){J(a!=null&&Array.isArray(a)&&a.length>0,function(){return"promises must be a none empty array"})})(n),function(a,s){J(a>=0&&a<=1,function(){return"Progress fraction must be in range [0, 1], but got startFraction "+a}),J(s>=0&&s<=1,function(){return"Progress fraction must be in range [0, 1], but got endFraction "+s}),J(s>=a,function(){return"startFraction must be no more than endFraction, but got startFraction "+a+" and endFraction "+s})}(t=t??0,r=r??1);var i=0;return Promise.all(n.map(function(a){return a.then(function(s){var o=t+ ++i/n.length*(r-t);return e(o),s}),a}))}function YN(n,e){return at(this,void 0,void 0,function(){var t,r,i,a,s,o,c,u,l;return st(this,function(d){switch(d.label){case 0:return e==null&&(e={}),t=e.fetchFunc==null?ke().platform.fetch:e.fetchFunc,r=n.map(function(h){return t(h,e.requestInit,{isBinary:!0})}),i=0,a=.5,e.onProgress!=null?[3,2]:[4,Promise.all(r)];case 1:return s=d.sent(),[3,4];case 2:return[4,G4(r,e.onProgress,i,a)];case 3:s=d.sent(),d.label=4;case 4:return o=s.map(function(h){return h.arrayBuffer()}),c=.5,u=1,e.onProgress!=null?[3,6]:[4,Promise.all(o)];case 5:return l=d.sent(),[3,8];case 6:return[4,G4(o,e.onProgress,c,u)];case 7:l=d.sent(),d.label=8;case 8:return[2,l]}})})}function K4(n){var e=this;return function(t,r,i){return r===void 0&&(r=""),at(e,void 0,void 0,function(){var a,s,o,c,u,l,d,h,p,g;return st(this,function(v){switch(v.label){case 0:if(a=t.map(function(){return!1}),s={},o=i!=null?i.map(function(){return!1}):[],c=[],t.forEach(function(y,b){var x=0;
3854y.weights.forEach(function(S){var w="quantization"in S?S.quantization.dtype:S.dtype,k=dk[w]*ct(S.shape),E=function(){a[b]=!0,s[b]==null&&(s[b]=[]),s[b].push({manifestEntry:S,groupOffset:x,sizeBytes:k})};i!=null?i.forEach(function(I,P){I===S.name&&(E(),o[P]=!0)}):E(),c.push(S.name),x+=k})}),!o.every(function(y){return y}))throw u=i.filter(function(y,b){return!o[b]}),new Error("Could not find weights in manifest with names: "+u.join(", ")+`. 3855Manifest JSON has weights with names: `+c.join(", ")+".");return l=a.reduce(function(y,b,x){return b&&y.push(x),y},[]),d=[],l.forEach(function(y){t[y].paths.forEach(function(b){var x=r+(r.endsWith("/")?"":"/")+b;d.push(x)})}),[4,n(d)];case 1:return h=v.sent(),p={},g=0,l.forEach(function(y){for(var b=t[y].paths.length,x=0,S=0;S<b;S++)x+=h[g+S].byteLength;for(var w=new ArrayBuffer(x),k=new Uint8Array(w),E=0,I=0;I<b;I++){var P=new Uint8Array(h[g+I]);k.set(P,E),E+=P.byteLength}s[y].forEach(function(A){var N=HN(w.slice(A.groupOffset,A.groupOffset+A.sizeBytes),[A.manifestEntry]);for(var j in N)p[j]=N[j]}),g+=b}),[2,p]}})})}}ys.registerSaveRouter(function(n){return ke().getBool("IS_BROWSER")&&!Array.isArray(n)&&n.startsWith(Iw.URL_SCHEME)?function(e){return e===void 0&&(e="model"),new Iw(e)}(n.slice(Iw.URL_SCHEME.length)):null});var XN=function(){function n(e,t){if(this.DEFAULT_METHOD="POST",t==null&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,t.fetchFunc!=null?(J(typeof t.fetchFunc=="function",function(){return"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"}),this.fetch=t.fetchFunc):this.fetch=ke().platform.fetch,J(e!=null&&e.length>0,function(){return"URL path for http must not be null, undefined or empty."}),Array.isArray(e)&&J(e.length===2,function(){return"URL paths for http must have a length of 2, (actual length is "+e.length+")."}),this.path=e,t.requestInit!=null&&t.requestInit.body!=null)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{}}return n.prototype.save=function(e){return at(this,void 0,void 0,function(){var t,r,i,a;return st(this,function(s){switch(s.label){case 0:if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");return(t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit)).body=new FormData,r=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],i={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,userDefinedMetadata:e.userDefinedMetadata,weightsManifest:r},t.body.append("model.json",new Blob([JSON.stringify(i)],{type:"application/json"}),"model.json"),e.weightData!=null&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:"application/octet-stream"}),"model.weights.bin"),[4,this.fetch(this.path,t)];case 1:if((a=s.sent()).ok)return[2,{modelArtifactsInfo:lv(e),responses:[a]}];throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status "+a.status+".")}})})},n.prototype.load=function(){return at(this,void 0,void 0,function(){var e,t,r,i,a,s,o,c,u,l,d,h;return st(this,function(p){switch(p.label){case 0:return[4,this.fetch(this.path,this.requestInit)];case 1:if(!(e=p.sent()).ok)throw new Error("Request to "+this.path+" failed with status code "+e.status+". Please verify this URL points to the model JSON of the model to load.");p.label=2;case 2:return p.trys.push([2,4,,5]),[4,e.json()];case 3:return t=p.sent(),[3,5];case 4:throw p.sent(),r="Failed to parse model JSON of response from "+this.path+".",this.path.endsWith(".pb")?r+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":r+=" Please make sure the server is serving valid JSON for this request.",new Error(r);case 5:if(i=t.modelTopology,a=t.weightsManifest,s=t.generatedBy,o=t.convertedBy,c=t.format,u=t.userDefinedMetadata,i==null&&a==null)throw new Error("The JSON from HTTP path "+this.path+" contains
3855neither model topology or manifest for weights.");return a==null?[3,7]:[4,this.loadWeights(a)];case 6:h=p.sent(),l=h[0],d=h[1],p.label=7;case 7:return[2,{modelTopology:i,weightSpecs:l,weightData:d,userDefinedMetadata:u,generatedBy:s,convertedBy:o,format:c}]}})})},n.prototype.loadWeights=function(e){return at(this,void 0,void 0,function(){var t,r,i,a,s,o,c,u,l,d,h;return st(this,function(p){switch(p.label){case 0:for(t=Array.isArray(this.path)?this.path[1]:this.path,r=function(g){var v=g.lastIndexOf("/"),y=g.lastIndexOf("?"),b=g.substring(0,v),x=y>v?g.substring(y):"";return[b+"/",x]}(t),i=r[0],a=r[1],s=this.weightPathPrefix||i,o=[],c=0,u=e;c<u.length;c++)l=u[c],o.push.apply(o,l.weights);return d=[],e.forEach(function(g){g.paths.forEach(function(v){d.push(s+v+a)})}),[4,YN(d,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress})];case 1:return h=p.sent(),[2,[o,LS(h)]]}})})},n.URL_SCHEME_REGEX=/^https?:\/\//,n}();function pk(n){return n.match(XN.URL_SCHEME_REGEX)!=null}var Y4=function(n,e){return typeof fetch>"u"?null:(Array.isArray(n)?n.every(function(t){return pk(t)}):pk(n))?mk(n,{onProgress:e}):null};function mk(n,e){return new XN(n,e)}ys.registerSaveRouter(Y4),ys.registerLoadRouter(Y4);var Ow=function(){function n(e){this.modelArtifacts=e}return n.prototype.load=function(){return at(this,void 0,void 0,function(){return st(this,function(e){return[2,this.modelArtifacts]})})},n}(),Lse=function(){function n(e){this.saveHandler=e}return n.prototype.save=function(e){return at(this,void 0,void 0,function(){return st(this,function(t){return[2,this.saveHandler(e)]})})},n}(),JN=Object.freeze({browserFiles:function(n){return new Nse(n)},browserHTTPRequest:function(n,e){return mk(n,e)},concatenateArrayBuffers:LS,decodeWeights:HN,encodeWeights:function(n,e){return at(this,void 0,void 0,function(){var t,r,i,a,s,o=this;return st(this,function(c){switch(c.label){case 0:for(t=[],r=[],i=Array.isArray(n)?n.map(function(u){return u.name}):Object.keys(n),a=function(u){var l=i[u],d=Array.isArray(n)?n[u].tensor:n[l];if(d.dtype!=="float32"&&d.dtype!=="int32"&&d.dtype!=="bool"&&d.dtype!=="string")throw new Error("Unsupported dtype in weight '"+l+"': "+d.dtype);var h={name:l,shape:d.shape,dtype:d.dtype};if(d.dtype==="string"){var p=new Promise(function(g){return at(o,void 0,void 0,function(){var v,y,b,x,S,w,k;return st(this,function(E){switch(E.label){case 0:return[4,d.bytes()];case 1:for(v=E.sent(),y=v.reduce(function(I,P){return I+P.length},0)+h_*v.length,b=new Uint8Array(y),x=0,S=0;S<v.length;S++)w=v[S],k=new Uint8Array(new Uint32Array([w.length]).buffer),b.set(k,x),x+=h_,b.set(w,x),x+=w.length;return g(b),[2]}})})});r.push(p)}else r.push(d.data());e!=null&&(h.group=e),t.push(h)},s=0;s<i.length;++s)a(s);return[4,Promise.all(r)];case 1:return[2,{data:kse(c.sent()),specs:t}]}})})},fromMemory:function(n,e,t,r){return arguments.length===1?n.modelTopology!=null||n.weightSpecs!=null?new Ow(n):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Ow({modelTopology:n})):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Ow({modelTopology:n,weightSpecs:e,weightData:t,trainingConfig:r}))},getLoadHandlers:function(n,e){return ys.getLoadHandlers(n,e)},getModelArtifactsInfoForJSON:lv,getSaveHandlers:function(n){return ys.getSaveHandlers(n)},http:mk,isHTTPScheme:pk,loadWeights:function(n,e,t,r){return e===void 0&&(e=""),at(this,void 0,void 0,function(){return st(this,function(i){return[2,K4(function(a){return YN(a,{requestInit:r})})(n,e,t)]})})},registerLoadRouter:function(n){return ys.registerLoadRouter(n)},registerSaveRouter:function(n){return ys.registerSaveRouter(n)},weightsLoaderFactory:K4,withSaveHandler:function(n){return new Lse(n)},copyModel:function(n,e){return at(this,void 0,void 0,function(){return st(this,function(t){return[2,z4(n,e,!1)]})})},listModels:function(){return at(this,void 0,void 0,function(){var n,e,t,r,i,a,s;return st(this,function(o){switch(o.label){case 0:n=Bl.getSchemes(),e={},t=0,r=n,o.label=1;case 1:return t<r.length?(i=r[t],[4,Bl.getManager(i).listModels()]):[3,4];case 2:for(s in a=o.sent())e[i+$h+s]=a[s];o.label=3;case 3:return t++,[3,1];case 4:return[2,e]}})})},moveModel:function(n,e){return at(this,void 0,void 0,function(){return st(this,function(t){return[2,z4(n,e,!0)]})})},removeModel:function(n){return at(this,void 0,void 0,function(){var e;return st(this,function(t){return e=cy(n),[2,Bl.getManager(e.scheme).removeModel(e.path)]})})}}),sh;re({confusionMatrix_:function(n,e,t){var r=G(n,"labels","confusionMatrix"),i=G(e,"predictions","confusionMatrix");J(t==null||t>0&&Number.isInteger(t),function(){return"If provided, numClasses must be a positive integer, but got "+t}),J(r.rank===1,function(){return"Expected the rank of labels to be 1, but got "+r.rank}),J(i.rank===1,function(){return"Expected the rank of predictions to be 1, but got "+i.rank}),J(r.shape[0]===i.shape[0],function(){return"Mismatch in the number of examples: "+r.shape[0]+" vs. "+i.shape[0]+". Labels and predictions should have the same number of elements."}),J(t>0&&Number.isInteger(t),function(){return"numClasses is required to be a positive integer, but got "+t});var a=sk(r.asType("int32"),t),s=sk(i.asType("int32"),t);return a.transpose().matMul(s).asType("int32")}});var Fse=re({fromPixels_:function(n,e){if(e===void 0&&(e=3),e>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(n==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");var t=!1,r=!1,i=!1,a=!1,s=!1;if(n.data instanceof Uint8Array)t=!0;else if(typeof ImageData<"u"&&n instanceof ImageData)r=!0;else if(typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement)i=!0;else if(typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement)a=!0;else{if(n.getContext==null)throw new Error("pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was "+n.constructor.name);s=!0}if(i&&i&&n.readyState<2)throw new Error("The video element has not loaded data yet. Please wait for `loadeddata` event on the <video> element.");if(x5("FromPixels",ce.backendName)!=null)return ce.runKernel("FromPixels",{pixels:n},{numChannels:e});var o,c,u=i?[n.videoWidth,n.videoHeight]:[n.width,n.height],l=u[0],d=u[1];if(s?o=n.getContext("2d").getImageData(0,0,l,d).data:r||t?o=n.data:(a||i)&&(sh==null&&(sh=document.createElement("canvas").getContext("2d")),sh.canvas.width=l,sh.canvas.height=d,sh.drawImage(n,
38550,0,l,d),o=sh.getImageData(0,0,l,d).data),e===4)c=new Int32Array(o);else{var h=l*d;c=new Int32Array(h*e);for(var p=0;p<h;p++)for(var g=0;g<e;++g)c[p*e+g]=o[4*p+g]}return dS(c,[d,l,e],"int32")}}),FS=Object.freeze({toPixels:function(n,e){return at(this,void 0,void 0,function(){var t,r,i,a,s,o,c,u,l,d,h,p,g,v,y,b,x,S,w,k,E,I,P;return st(this,function(A){switch(A.label){case 0:if(t=G(n,"img","toPixels"),n instanceof mr||(t=t.toInt()),t.rank!==2&&t.rank!==3)throw new Error("toPixels only supports rank 2 or 3 tensors, got rank "+t.rank+".");if(r=t.shape.slice(0,2),i=r[0],a=r[1],(s=t.rank===2?1:t.shape[2])>4||s===2)throw new Error("toPixels only supports depth of size 1, 3 or 4 but got "+s);return[4,t.data()];case 1:return o=A.sent(),c=t.min(),u=t.max(),[4,Promise.all([c.data(),u.data()])];case 2:if(l=A.sent(),d=l[0],h=l[1],p=d[0],g=h[0],c.dispose(),u.dispose(),t.dtype==="float32"){if(p<0||g>1)throw new Error("Tensor values for a float32 Tensor must be in the range [0 - 1] but got range ["+p+" - "+g+"].")}else{if(t.dtype!=="int32")throw new Error("Unsupported type for toPixels: "+t.dtype+". Please use float32 or int32 tensors.");if(p<0||g>255)throw new Error("Tensor values for a int32 Tensor must be in the range [0 - 255] but got range ["+p+" - "+g+"].")}for(v=t.dtype==="float32"?255:1,y=new Uint8ClampedArray(a*i*4),b=0;b<i*a;++b)x=void 0,S=void 0,w=void 0,k=void 0,s===1?(x=o[b]*v,S=o[b]*v,w=o[b]*v,k=255):s===3?(x=o[3*b]*v,S=o[3*b+1]*v,w=o[3*b+2]*v,k=255):s===4&&(x=o[4*b]*v,S=o[4*b+1]*v,w=o[4*b+2]*v,k=o[4*b+3]*v),y[(E=4*b)+0]=Math.round(x),y[E+1]=Math.round(S),y[E+2]=Math.round(w),y[E+3]=Math.round(k);return e!=null&&(e.width=a,e.height=i,I=e.getContext("2d"),P=new ImageData(y,a,i),I.putImageData(P,0,0)),t!==n&&t.dispose(),[2,y]}})})},fromPixels:Fse}),$se=function(){function n(){}return n.prototype.getClassName=function(){return this.constructor.className},n.fromConfig=function(e,t){return new e(t)},n}(),Bse=function(){function n(){this.classNameMap={}}return n.getMap=function(){return n.instance==null&&(n.instance=new n),n.instance},n.register=function(e){n.getMap().classNameMap[e.className]=[e,e.fromConfig]},n}();function If(n){J(n.className!=null,function(){return"Class being registered does not have the static className property defined."}),J(typeof n.className=="string",function(){return"className is required to be a string, but got type "+typeof n.className}),J(n.className.length>0,function(){return"Class being registered has an empty-string as its className, which is disallowed."}),Bse.register(n)}var Of=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return oc(e,n),e.prototype.minimize=function(t,r,i){r===void 0&&(r=!1);var a=this.computeGradients(t,i),s=a.value,o=a.grads;if(i!=null){var c=i.map(function(u){return{name:u.name,tensor:o[u.name]}});this.applyGradients(c)}else this.applyGradients(o);return $a(o),r?s:(s.dispose(),null)},Object.defineProperty(e.prototype,"iterations",{get:function(){return this.iterations_==null&&(this.iterations_=0),this.iterations_},enumerable:!0,configurable:!0}),e.prototype.incrementIterations=function(){this.iterations_=this.iterations+1},e.prototype.computeGradients=function(t,r){return Yte(t,r)},e.prototype.dispose=function(){this.iterations_!=null&&$a(this.iterations_)},e.prototype.saveIterations=function(){return at(this,void 0,void 0,function(){return st(this,function(t){return this.iterations_==null&&(this.iterations_=0),[2,{name:"iter",tensor:Ke(this.iterations_,"int32")}]})})},e.prototype.getWeights=function(){return at(this,void 0,void 0,function(){return st(this,function(t){throw new Error("getWeights() is not implemented for this optimizer yet.")})})},e.prototype.setWeights=function(t){return at(this,void 0,void 0,function(){return st(this,function(r){throw new Error("setWeights() is not implemented for this optimizer class "+this.getClassName())})})},e.prototype.extractIterations=function(t){return at(this,void 0,void 0,function(){var r;return st(this,function(i){switch(i.label){case 0:return r=this,[4,t[0].tensor.data()];case 1:return r.iterations_=i.sent()[0],[2,t.slice(1)]}})})},e}($se);Object.defineProperty(Of,Symbol.hasInstance,{value:function(n){return n.minimize!=null&&n.computeGradients!=null&&n.applyGradients!=null}});var Use=function(n){function e(t,r,i){i===void 0&&(i=null);var a=n.call(this)||this;return a.learningRate=t,a.rho=r,a.epsilon=i,a.accumulatedGrads=[],a.accumulatedUpdates=[],i==null&&(a.epsilon=ce.backend.epsilon()),a}return oc(e,n),e.prototype.applyGradients=function(t){var r=this;(Array.isArray(t)?t.map(function(i){return i.name}
3855):Object.keys(t)).forEach(function(i,a){var s=ce.registeredVariables[i];r.accumulatedGrads[a]==null&&(r.accumulatedGrads[a]={originalName:i+"/accum_grad",variable:Ze(function(){return dn(s).variable(!1)})}),r.accumulatedUpdates[a]==null&&(r.accumulatedUpdates[a]={originalName:i+"/accum_var",variable:Ze(function(){return dn(s).variable(!1)})});var o=Array.isArray(t)?t[a].tensor:t[i];if(o!=null){var c=r.accumulatedGrads[a].variable,u=r.accumulatedUpdates[a].variable;Ze(function(){var l=c.mul(r.rho).add(o.square().mul(1-r.rho)),d=u.add(r.epsilon).sqrt().div(c.add(r.epsilon).sqrt()).mul(o),h=u.mul(r.rho).add(d.square().mul(1-r.rho));c.assign(l),u.assign(h);var p=d.mul(-r.learningRate).add(s);s.assign(p)})}}),this.incrementIterations()},e.prototype.dispose=function(){this.accumulatedUpdates!=null&&($a(this.accumulatedGrads.map(function(t){return t.variable})),$a(this.accumulatedUpdates.map(function(t){return t.variable})))},e.prototype.getWeights=function(){return at(this,void 0,void 0,function(){var t;return st(this,function(r){switch(r.label){case 0:return t=this.accumulatedGrads.concat(this.accumulatedUpdates),[4,this.saveIterations()];case 1:return[2,[r.sent()].concat(t.map(function(i){return{name:i.originalName,tensor:i.variable}}))]}})})},e.prototype.setWeights=function(t){return at(this,void 0,void 0,function(){var r;return st(this,function(i){switch(i.label){case 0:return[4,this.extractIterations(t)];case 1:return t=i.sent(),r=t.length/2,this.accumulatedGrads=t.slice(0,r).map(function(a){return{originalName:a.name,variable:a.tensor.variable(!1)}}),this.accumulatedUpdates=t.slice(r,2*r).map(function(a){return{originalName:a.name,variable:a.tensor.variable(!1)}}),[2]}})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}},e.fromConfig=function(t,r){return new t(r.learningRate,r.rho,r.epsilon)},e.className="Adadelta",e}(Of);If(Use);var jse=function(n){function e(t,r){r===void 0&&(r=.1);var i=n.call(this)||this;return i.learningRate=t,i.initialAccumulatorValue=r,i.accumulatedGrads=[],i}return oc(e,n),e.prototype.applyGradients=function(t){var r=this;(Array.isArray(t)?t.map(function(i){return i.name}):Object.keys(t)).forEach(function(i,a){var s=ce.registeredVariables[i];r.accumulatedGrads[a]==null&&(r.accumulatedGrads[a]={originalName:i+"/accumulator",variable:Ze(function(){return Kc(s.shape,r.initialAccumulatorValue).variable(!1)})});var o=Array.isArray(t)?t[a].tensor:t[i];if(o!=null){var c=r.accumulatedGrads[a].variable;Ze(function(){var u=c.add(o.square());c.assign(u);var l=o.div(u.add(ce.backend.epsilon()).sqrt()).mul(-r.learningRate).add(s);s.assign(l)})}}),this.incrementIterations()},e.prototype.dispose=function(){this.accumulatedGrads!=null&&$a(this.accumulatedGrads.map(function(t){return t.variable}))},e.prototype.getWeights=function(){return at(this,void 0,void 0,function(){return st(this,function(t){switch(t.label){case 0:return[4,this.saveIterations()];case 1:return[2,[t.sent()].concat(this.accumulatedGrads.map(function(r){return{name:r.originalName,tensor:r.variable}}))]}})})},e.prototype.setWeights=function(t){return at(this,void 0,void 0,function(){return st(this,function(r){switch(r.label){case 0:return[4,this.extractIterations(t)];case 1:return t=r.sent(),this.accumulatedGrads=t.map(function(i){return{originalName:i.name,variable:i.tensor.variable(!1)}}),[2]}})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}},e.fromConfig=function(t,r){return new t(r.learningRate,r.initialAccumulatorValue)},e.className="Adagrad",e}(Of);If(jse);var qse=function(n){function e(t,r,i,a){a===void 0&&(a=null);var s=n.call(this)||this;return s.learningRate=t,s.beta1=r,s.beta2=i,s.epsilon=a,s.accumulatedFirstMoment=[],s.accumulatedSecondMoment=[],Ze(function(){s.accBeta1=Ke(r).variable(),s.accBeta2=Ke(i).variable()}),a==null&&(s.epsilon=ce.backend.epsilon()),s}return oc(e,n),e.prototype.applyGradients=function(t){var r=this,i=Array.isArray(t)?t.map(function(a){return a.name}):Object.keys(t);Ze(function(){var a=ci(1,r.accBeta1),s=ci(1,r.accBeta2);
vendor: 4,662 bytes, line 3855
3855i.forEach(function(o,c){var u=ce.registeredVariables[o];r.accumulatedFirstMoment[c]==null&&(r.accumulatedFirstMoment[c]={originalName:o+"/m",variable:Ze(function(){return dn(u).variable(!1)})}),r.accumulatedSecondMoment[c]==null&&(r.accumulatedSecondMoment[c]={originalName:o+"/v",variable:Ze(function(){return dn(u).variable(!1)})});var l=Array.isArray(t)?t[c].tensor:t[o];if(l!=null){var d=r.accumulatedFirstMoment[c].variable,h=r.accumulatedSecondMoment[c].variable,p=d.mul(r.beta1).add(l.mul(1-r.beta1)),g=h.mul(r.beta2).add(l.square().mul(1-r.beta2)),v=p.div(a),y=g.div(s);d.assign(p),h.assign(g);var b=v.div(y.sqrt().add(r.epsilon)).mul(-r.learningRate).add(u);u.assign(b)}}),r.accBeta1.assign(r.accBeta1.mul(r.beta1)),r.accBeta2.assign(r.accBeta2.mul(r.beta2))}),this.incrementIterations()},e.prototype.dispose=function(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&$a(this.accumulatedFirstMoment.map(function(t){return t.variable})),this.accumulatedSecondMoment!=null&&$a(this.accumulatedSecondMoment.map(function(t){return t.variable}))},e.prototype.getWeights=function(){return at(this,void 0,void 0,function(){var t;return st(this,function(r){switch(r.label){case 0:return t=this.accumulatedFirstMoment.concat(this.accumulatedSecondMoment),[4,this.saveIterations()];case 1:return[2,[r.sent()].concat(t.map(function(i){return{name:i.originalName,tensor:i.variable}}))]}})})},e.prototype.setWeights=function(t){return at(this,void 0,void 0,function(){var r,i=this;return st(this,function(a){switch(a.label){case 0:return[4,this.extractIterations(t)];case 1:return t=a.sent(),Ze(function(){i.accBeta1.assign(d_(i.beta1,i.iterations_+1)),i.accBeta2.assign(d_(i.beta2,i.iterations_+1))}),r=t.length/2,this.accumulatedFirstMoment=t.slice(0,r).map(function(s){return{originalName:s.name,variable:s.tensor.variable(!1)}}),this.accumulatedSecondMoment=t.slice(r,2*r).map(function(s){return{originalName:s.name,variable:s.tensor.variable(!1)}}),[2]}})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}},e.fromConfig=function(t,r){return new t(r.learningRate,r.beta1,r.beta2,r.epsilon)},e.className="Adam",e}(Of);If(qse);var zse=function(n){function e(t,r,i,a,s){a===void 0&&(a=null),s===void 0&&(s=0);var o=n.call(this)||this;return o.learningRate=t,o.beta1=r,o.beta2=i,o.epsilon=a,o.decay=s,o.accumulatedFirstMoment=[],o.accumulatedWeightedInfNorm=[],Ze(function(){o.iteration=Ke(0).variable(),o.accBeta1=Ke(r).variable()}),a==null&&(o.epsilon=ce.backend.epsilon()),o}return oc(e,n),e.prototype.applyGradients=function(t){var r=this,i=Array.isArray(t)?t.map(function(a){return a.name}):Object.keys(t);Ze(function(){var a=ci(1,r.accBeta1),s=jo(-r.learningRate,r.iteration.mul(r.decay).add(1));i.forEach(function(o,c){var u=ce.registeredVariables[o];r.accumulatedFirstMoment[c]==null&&(r.accumulatedFirstMoment[c]={originalName:o+"/m",variable:dn(u).variable(!1)}),r.accumulatedWeightedInfNorm[c]==null&&(r.accumulatedWeightedInfNorm[c]={originalName:o+"/v",variable:dn(u).variable(!1)});var l=Array.isArray(t)?t[c].tensor:t[o];if(l!=null){var d=r.accumulatedFirstMoment[c].variable,h=r.accumulatedWeightedInfNorm[c].variable,p=d.mul(r.beta1).add(l.mul(1-r.beta1)),g=h.mul(r.beta2),v=l.abs(),y=g.maximum(v);d.assign(p),h.assign(y);var b=s.div(a).mul(p.div(y.add(r.epsilon))).add(u);u.assign(b)}}),r.iteration.assign(r.iteration.add(1)),r.accBeta1.assign(r.accBeta1.mul(r.beta1))}),this.incrementIterations()},e.prototype.dispose=function(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&$a(this.accumulatedFirstMoment.map(function(t){return t.variable})),this.accumulatedWeightedInfNorm!=null&&$a(this.accumulatedWeightedInfNorm.map(function(t){return t.variable}))},e.prototype.getWeights=function(){return at(this,void 0,void 0,function(){return st(this,function(t){throw new Error("getWeights() is not implemented for Adamax yet.")})})},e.prototype.setWeights=function(t){return at(this,void 0,void 0,function(){return st(this,function(r){throw new Error("setWeights() is not implemented for Adamax yet.")})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}},e.fromConfig=function(t,r){return new t(r.learningRate,r.beta1,r.beta2,r.epsilon,r.decay)},e.className="Adamax",e}(Of);If(zse);var QN=function(n){function e(t){var r=n.call(this)||this;return r.learningRate=t,r.setLearningRate(t),r}return oc(e,n),e.prototype.applyGradients=function(t){var r=this;(Array.isArray(t)?t.map(function(i){return i.name}
3855):Object.keys(t)).forEach(function(i,a){var s=Array.isArray(t)?t[a].tensor:t[i];if(s!=null){var o=ce.registeredVariables[i];Ze(function(){var c=r.c.mul(s).add(o);o.assign(c)})}}),this.incrementIterations()},e.prototype.setLearningRate=function(t){this.learningRate=t,this.c!=null&&this.c.dispose(),this.c=ute(Ke(-t))},e.prototype.dispose=function(){this.c.dispose()},e.prototype.getWeights=function(){return at(this,void 0,void 0,function(){return st(this,function(t){switch(t.label){case 0:return[4,this.saveIterations()];case 1:return[2,[t.sent()]]}})})},e.prototype.setWeights=function(t){return at(this,void 0,void 0,function(){return st(this,function(r){switch(r.label){case 0:return[4,this.extractIterations(t)];case 1:if((t=r.sent()).length!==0)throw new Error("SGD optimizer does not have settable weights.");return[2]}})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate}},e.fromConfig=function(t,r){return new t(r.learningRate)},e.className="SGD",e}(Of);If(QN);var Wse=function(n){function e(t,r,i){i===void 0&&(i=!1);var a=n.call(this,t)||this;return a.learningRate=t,a.momentum=r,a.useNesterov=i,a.accumulations=[],a.m=Ke(a.momentum),a}return oc(e,n),e.prototype.applyGradients=function(t){var r=this;(Array.isArray(t)?t.map(function(i){return i.name}):Object.keys(t)).forEach(function(i,a){var s=ce.registeredVariables[i];r.accumulations[a]==null&&(r.accumulations[a]={originalName:i+"/momentum",variable:Ze(function(){return dn(s).variable(!1)})});var o=r.accumulations[a].variable,c=Array.isArray(t)?t[a].tensor:t[i];c!=null&&Ze(function(){var u,l=r.m.mul(o).add(c);u=r.useNesterov?r.c.mul(c.add(l.mul(r.m))).add(s):r.c.mul(l).add(s),o.assign(l),s.assign(u)})}),this.incrementIterations()},e.prototype.dispose=function(){this.m.dispose(),this.accumulations!=null&&$a(this.accumulations.map(function(t){return t.variable}))},e.prototype.setMomentum=function(t){this.momentum=t},e.prototype.getWeights=function(){return at(this,void 0,void 0,function(){return st(this,function(t){switch(t.label){case 0:return[4,this.saveIterations()];case 1:return[2,[t.sent()].concat(this.accumulations.map(function(r){return{name:r.originalName,tensor:r.variable}}))]}})})},e.prototype.setWeights=function(t){return at(this,void 0,void 0,function(){return st(this,function(r){switch(r.label){case 0:return[4,this.extractIterations(t)];case 1:return t=r.sent(),this.accumulations=t.map(function(i){return{originalName:i.name,variable:i.tensor.variable(!1)}}),[2]}})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}},e.fromConfig=function(t,r){return new t(r.learningRate,r.momentum,r.useNesterov)},e.className="Momentum",e}(QN);If(Wse);var Hse=function(n){function e(t,r,i,a,s){r===void 0&&(r=.9),i===void 0&&(i=0),a===void 0&&(a=null),s===void 0&&(s=!1);var o=n.call(this)||this;if(o.learningRate=t,o.decay=r,o.momentum=i,o.epsilon=a,o.accumulatedMeanSquares=[],o.accumulatedMoments=[],o.accumulatedMeanGrads=[],o.centered=s,a==null&&(o.epsilon=ce.backend.epsilon()),t==null)throw new Error("learningRate for RMSPropOptimizer must be defined.");return o}return oc(e,n),e.prototype.applyGradients=function(t){var r=this;(Array.isArray(t)?t.map(function(i){return i.name}):Object.keys(t)).forEach(function(i,a){var s=ce.registeredVariables[i];r.accumulatedMeanSquares[a]==null&&(r.accumulatedMeanSquares[a]={originalName:i+"/rms",variable:Ze(function(){return dn(s).variable(!1)})}),r.accumulatedMoments[a]==null&&(r.accumulatedMoments[a]={originalName:i+"/momentum",variable:Ze(function(){return dn(s).variable(!1)})}),r.accumulatedMeanGrads[a]==null&&r.centered&&(r.accumulatedMeanGrads[a]={originalName:i+"/mg",variable:Ze(function(){return dn(s).variable(!1)})});var o=Array.isArray(t)?t[a].tensor:t[i];if(o!=null){var c=r.accumulatedMeanSquares[a].variable,u=r.accumulatedMoments[a].variable;Ze(function(){var l=c.mul(r.decay).add(o.square().mul(1-r.decay));if(r.centered){var d=r.accumulatedMeanGrads[a].variable,h=d.mul(r.decay).add(o.mul(1-r.decay)),p=u.mul(r.momentum).add(o.mul(r.learningRate).div(l.sub(h.square().add(r.epsilon)).sqrt()));c.assign(l),d.assign(h),u.assign(p);var g=s.sub(p);s.assign(g)}else{var v=c.mul(r.decay).add(o.square().mul(1-r.decay));p=u.mul(r.momentum).add(o.mul(r.learningRate).div(v.add(r.epsilon).sqrt())),c.assign(v),u.assign(p),g=s.sub(p),s.assign(g)}})}}),this.incrementIterations()},e.prototype.dispose=function(){this.accumulatedMeanSquares!=null&&$a(this.accumulatedMeanSquares.map(function(t){return t.variable})),this.accumulatedMeanGrads!=null&&this.centered&&$a(this.accumulatedMeanGrads.map(function(t){return t.variable})),this.accumulatedMoments!=null&&$a(this.accumulatedMoments.map(function(t){return t.variable}))},e.prototype.getWeights=function(){return at(this,void 0,void 0,function(){var t;return st(this,function(r){switch(r.label){case 0:return t=this.accumulatedMeanSquares.concat(this.accumulatedMoments),this.centered&&t.push.apply(t,this.accumulatedMeanGrads),[4,this.saveIterations()];case 1:return[2,[r.sent()].concat(t.map(function(i){return{name:i.originalName,tensor:i.variable}}))]}})})},e.prototype.setWeights=function(t){return at(this,void 0,void 0,function(){var r;return st(this,function(i){switch(i.label){case 0:return[4,this.extractIterations(t)];case 1:return t=i.sent(),r=this.centered?t.length/3:t.length/2,this.accumulatedMeanSquares=t.slice(0,r).map(function(a){return{originalName:a.name,variable:a.tensor.variable(!1)}}),this.accumulatedMoments=t.slice(r,2*r).map(function(a){return{originalName:a.name,variable:a.tensor.variable(!1)}}),this.centered&&(this.accumulatedMeanGrads=t.slice(2*r,3*r).map(function(a){return{originalName:a.name,variable:a.tensor.variable(!1)}})),[2]}})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}},e.fromConfig=function(t,r){return new t(r.learningRate,r.decay,r.momentum,r.epsilon,r.centered)},e.className="RMSProp",e}(Of);If(Hse);mr.prototype.squaredDifference=function(n){return hN(this,n)},xe=vse;/*! ***************************************************************************** 3856Copyright (c) Microsoft Corporation. 3857 3858Permission to use, copy, modify, and/or distribute this software for any 3859purpose with or without fee is hereby granted. 3860 3861THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 3862REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 3863AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 3864INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 3865LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 3866OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 3867PERFORMANCE OF THIS SOFTWARE. 3868***************************************************************************** */var gk=function(n,e){return gk=Object.
3868setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},gk(n,e)};function Ot(n,e){gk(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var zi=function(){return zi=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},zi.apply(this,arguments)};function dt(n,e,t,r){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(l){try{u(r.next(l))}catch(d){s(d)}}function c(l){try{u(r.throw(l))}catch(d){s(d)}}function u(l){l.done?a(l.value):i(l.value).then(o,c)}u((r=r.apply(n,[])).next())})}function ft(n,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(u){return function(l){return c([u,l])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(l){u=[6,l],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Xm(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)r[i]=a[s];return r}var jh=function(){function n(e,t){if(!tf(e)||!tf(t))throw new Error("Dimensions.constructor - expected width and height to be valid numbers, instead have "+JSON.stringify({width:e,height:t}));this._width=e,this._height=t}return Object.defineProperty(n.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),n.prototype.reverse=function(){return new n(1/this.width,1/this.height)},n}();function pb(n,e){return n instanceof mr&&n.shape.length===e}function Vse(n){return pb(n,2)}function mb(n){return pb(n,3)}function Ul(n){return pb(n,4)}function Gse(n){return n%1!==0}function X4(n){return n%2===0}function Kse(n,e){e===void 0&&(e=2);var t=Math.pow(10,e);return Math.floor(n*t)/t}function J4(n){return n&&n.width&&n.height}function Yse(n,e){var t=n.width,r=n.height,i=e/Math.max(r,t);return new jh(Math.round(t*i),Math.round(r*i))}function $S(n){return n.reduce(function(e,t){return e.add(t)},new Cn(0,0)).div(new Cn(n.length,n.length))}function Sg(n,e,t){return Array(n).fill(0).map(function(r,i){return e+i*t})}function tf(n){return!!n&&n!==1/0&&n!==-1/0&&!isNaN(n)||n===0}function Q4(n){return tf(n)&&0<=n&&n<=1}var Cn=function(){function n(e,t){this._x=e,this._y=t}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},enumerable:!0,configurable:!0}),n.prototype.add=function(e){return new n(this.x+e.x,this.y+e.y)},n.prototype.sub=function(e){return new n(this.x-e.x,this.y-e.y)},n.prototype.mul=function(e){return new n(this.x*e.x,this.y*e.y)},n.prototype.div=function(e){return new n(this.x/e.x,this.y/e.y)},n.prototype.abs=function(){return new n(Math.abs(this.x),Math.abs(this.y))},n.prototype.magnitude=function(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))},n.prototype.floor=function(){return new n(Math.floor(this.x),Math.floor(this.y))},n}
3868(),Ql=function(){function n(e,t){t===void 0&&(t=!0);var r=e||{},i=[r.left,r.top,r.right,r.bottom].every(tf),a=[r.x,r.y,r.width,r.height].every(tf);if(!a&&!i)throw new Error("Box.constructor - expected box to be IBoundingBox | IRect, instead have "+JSON.stringify(r));var s=a?[r.x,r.y,r.width,r.height]:[r.left,r.top,r.right-r.left,r.bottom-r.top],o=s[0],c=s[1],u=s[2],l=s[3];n.assertIsValidBox({x:o,y:c,width:u,height:l},"Box.constructor",t),this._x=o,this._y=c,this._width=u,this._height=l}return n.isRect=function(e){return!!e&&[e.x,e.y,e.width,e.height].every(tf)},n.assertIsValidBox=function(e,t,r){if(r===void 0&&(r=!1),!n.isRect(e))throw new Error(t+" - invalid box: "+JSON.stringify(e)+", expected object with properties x, y, width, height");if(!r&&(e.width<0||e.height<0))throw new Error(t+" - width ("+e.width+") and height ("+e.height+") must be positive numbers")},Object.defineProperty(n.prototype,"x",{get:function(){return this._x},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"left",{get:function(){return this.x},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"top",{get:function(){return this.y},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"area",{get:function(){return this.width*this.height},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"topLeft",{get:function(){return new Cn(this.left,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"topRight",{get:function(){return new Cn(this.right,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"bottomLeft",{get:function(){return new Cn(this.left,this.bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"bottomRight",{get:function(){return new Cn(this.right,this.bottom)},enumerable:!0,configurable:!0}),n.prototype.round=function(){var e=[this.x,this.y,this.width,this.height].map(function(s){return Math.round(s)}),t=e[0],r=e[1],i=e[2],a=e[3];return new n({x:t,y:r,width:i,height:a})},n.prototype.floor=function(){var e=[this.x,this.y,this.width,this.height].map(function(s){return Math.floor(s)}),t=e[0],r=e[1],i=e[2],a=e[3];return new n({x:t,y:r,width:i,height:a})},n.prototype.toSquare=function(){var e=this,t=e.x,r=e.y,i=e.width,a=e.height,s=Math.abs(i-a);return i<a&&(t-=s/2,i+=s),a<i&&(r-=s/2,a+=s),new n({x:t,y:r,width:i,height:a})},n.prototype.rescale=function(e){var t=J4(e)?e.width:e,r=J4(e)?e.height:e;return new n({x:this.x*t,y:this.y*r,width:this.width*t,height:this.height*r})},n.prototype.pad=function(e,t){var r=[this.x-e/2,this.y-t/2,this.width+e,this.height+t],i=r[0],a=r[1],s=r[2],o=r[3];return new n({x:i,y:a,width:s,height:o})},n.prototype.clipAtImageBorders=function(e,t){var r=this,i=r.x,a=r.y,s=r.right,o=r.bottom,c=Math.max(i,0),u=Math.max(a,0),l=s-c,d=o-u,h=Math.min(l,e-c),p=Math.min(d,t-u);return new n({x:c,y:u,width:h,height:p}).floor()},n.prototype.shift=function(e,t){var r=this,i=r.width,a=r.height,s=this.x+e,o=this.y+t;return new n({x:s,y:o,width:i,height:a})},n.prototype.padAtBorders=function(e,t){var r=this.width+1,i=this.height+1,a=1,s=1,o=r,c=i,u=this.left,l=this.top,d=this.right,h=this.bottom;return d>t&&(o=-d+t+r,d=t),h>e&&(c=-h+e+i,h=e),u<1&&(c=2-u,u=1),l<1&&(c=2-l,l=1),{dy:s,edy:c,dx:a,edx:o,y:l,ey:h,x:u,ex:d,w:r,h:i}},n.prototype.calibrate=function(e){return new n({left:this.left+e.left*this.width,top:this.top+e.top*this.height,right:this.right+e.right*this.width,bottom:this.bottom+e.bottom*this.height}).toSquare().round()},n}(),gb=function(n){Ot(e,n);function e(t,r,i,a,s){return s===void 0&&(s=!1),n.call(this,{left:t,top:r,right:i,bottom:a},s)||this}return e}(Ql),ZN=function(){function n(e,t,r,i,a){this._imageDims=new jh(a.width,a.height),this._score=e,this._classScore=t,this._className=r,this._box=new Ql(i).rescale(this._imageDims)}return Object.defineProperty(n.prototype,"score",{get:function(){return this._score},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"classScore",{get:function(){return this._classScore},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"className",{get:function(){return this._className},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"box",{get:function(){return this._box},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"imageDims",{get:function(){return this._imageDims},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"imageWidth",{get:function(){return this.imageDims.width},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"imageHeight",{get:function(){return this.imageDims.height},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"relativeBox",{get:function(){return new Ql(this._box).rescale(this.imageDims.reverse())},enumerable:!0,configurable:!0}),n.prototype.forSize=function(e,t){return new n(this.score,this.classScore,this.className,this.relativeBox,{width:e,height:t})},n}(),au=function(n){Ot(e,n);function e(t,r,i){return n.call(this,t,t,"",r,i)||this}return e.prototype.forSize=function(t,r){var i=n.prototype.forSize.call(this,t,r),a=i.score,s=i.relativeBox,o=i.imageDims;return new e(a,s,o)},e}(ZN);function Xse(n,e,t){t===void 0&&(t=!0);var r=Math.max(0,Math.min(n.right,e.right)-Math.max(n.left,e.left)),i=Math.max(0,Math.min(n.bottom,e.bottom)-Math.max(n.top,e.top)),a=r*i;return t?a/(n.area+e.area-a):a/Math.min(n.area,e.area)}function Jse(n){var e=n.map(function(o){return o.x}),t=n.map(function(o){return o.y}),r=e.reduce(function(o,c){return c<o?c:o},1/0),i=t.reduce(function(o,c){return c<o?c:o},1/0),a=e.reduce(function(o,c){return o<c?c:o},0),s=t.reduce(function(o,c){return o<c?c:o},0);return new gb(r,i,a,s)}function Tg(n,e,t,r){r===void 0&&(r=!0);for(var i=e.map(function(o,c){return{score:o,boxIndex:c}}).sort(function(o,c){return o.score-c.score}).map(function(o){return o.boxIndex}),a=[],s=function(){var o=i.pop();a.push(o);for(var c=i,u=[],l=0;l<c.length;l++){var d=c[l],h=n[o],p=n[d];u.push(Xse(h,p,r))}i=i.filter(function(g,v){return u[v]<=t})};i.length>0;)s();return a}function dv(n,e){return Ze(function(){var t=e[0],r=e[1],i=e[2],a=Kc(Xm(n.shape.slice(0,3),[1]),t),s=Kc(Xm(n.shape.slice(0,3),[1]),r),o=Kc(Xm(n.shape.slice(0,3),[1]),i),c=ai([a,s,o],3);return ci(n,c)})}function Qse(n,e){return e===void 0&&(e=!1),Ze(function(){var t=n.shape.slice(1),r=t[0],i=t[1];if(r===i)return n;var a=Math.abs(r-i),s=Math.round(a*(e?.5:1)),o=r>i?2:1,c=function(p){var g=n.shape.slice();return g[o]=p,Kc(g,0)},u=c(s),l=a-u.shape[o],d=e&&l?c(l):null,h=[d,n,u].filter(function(p){return!!p}
3868).map(function(p){return p.toFloat()});return ai(h,o)})}function Mw(n){return 1/(1+Math.exp(-n))}var BS=function(n){Ot(e,n);function e(t,r,i,a,s){return s===void 0&&(s=!1),n.call(this,{x:t,y:r,width:i,height:a},s)||this}return e}(Ql),Zse=.5,eoe=.43,toe=.45,p_=function(){function n(e,t,r){r===void 0&&(r=new Cn(0,0));var i=t.width,a=t.height;this._imgDims=new jh(i,a),this._shift=r,this._positions=e.map(function(s){return s.mul(new Cn(i,a)).add(r)})}return Object.defineProperty(n.prototype,"shift",{get:function(){return new Cn(this._shift.x,this._shift.y)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"imageWidth",{get:function(){return this._imgDims.width},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"imageHeight",{get:function(){return this._imgDims.height},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"positions",{get:function(){return this._positions},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"relativePositions",{get:function(){var e=this;return this._positions.map(function(t){return t.sub(e._shift).div(new Cn(e.imageWidth,e.imageHeight))})},enumerable:!0,configurable:!0}),n.prototype.forSize=function(e,t){return new this.constructor(this.relativePositions,{width:e,height:t})},n.prototype.shiftBy=function(e,t){return new this.constructor(this.relativePositions,this._imgDims,new Cn(e,t))},n.prototype.shiftByPoint=function(e){return this.shiftBy(e.x,e.y)},n.prototype.align=function(e,t){if(t===void 0&&(t={}),e){var r=e instanceof au?e.box.floor():new Ql(e);return this.shiftBy(r.x,r.y).align(null,t)}var i=Object.assign({},{useDlibAlignment:!1,minBoxPadding:.2},t),a=i.useDlibAlignment,s=i.minBoxPadding;return a?this.alignDlib():this.alignMinBbox(s)},n.prototype.alignDlib=function(){var e=this.getRefPointsForAlignment(),t=e[0],r=e[1],i=e[2],a=function(d){return i.sub(d).magnitude()},s=(a(t)+a(r))/2,o=Math.floor(s/toe),c=$S(e),u=Math.floor(Math.max(0,c.x-Zse*o)),l=Math.floor(Math.max(0,c.y-eoe*o));return new BS(u,l,Math.min(o,this.imageWidth+u),Math.min(o,this.imageHeight+l))},n.prototype.alignMinBbox=function(e){var t=Jse(this.positions);return t.pad(t.width*e,t.height*e)},n.prototype.getRefPointsForAlignment=function(){throw new Error("getRefPointsForAlignment not implemented by base class")},n}(),noe=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getRefPointsForAlignment=function(){var t=this.positions;return[t[0],t[1],$S([t[3],t[4]])]},e}(p_),roe=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getJawOutline=function(){return this.positions.slice(0,17)},e.prototype.getLeftEyeBrow=function(){return this.positions.slice(17,22)},e.prototype.getRightEyeBrow=function(){return this.positions.slice(22,27)},e.prototype.getNose=function(){return this.positions.slice(27,36)},e.prototype.getLeftEye=function(){return this.positions.slice(36,42)},e.prototype.getRightEye=function(){return this.positions.slice(42,48)},e.prototype.getMouth=function(){return this.positions.slice(48,68)},e.prototype.getRefPointsForAlignment=function(){return[this.getLeftEye(),this.getRightEye(),this.getMouth()].map($S)},e}(p_),Z4=function(){function n(e,t){this._label=e,this._distance=t}return Object.defineProperty(n.prototype,"label",{get:function(){return this._label},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"distance",{get:function(){return this._distance},enumerable:!0,configurable:!0}),n.prototype.toString=function(e){return e===void 0&&(e=!0),""+this.label+(e?" ("+Kse(this.distance)+")":"")},n}(),eI=function(n){Ot(e,n);function e(t,r){var i=n.call(this,t)||this;return i._label=r,i}return e.assertIsValidLabeledBox=function(t,r){if(Ql.assertIsValidBox(t,r),!tf(t.label))throw new Error(r+" - expected property label ("+t.label+") to be a number")},Object.defineProperty(e.prototype,"label",{get:function(){return this._label},enumerable:!0,configurable:!0}),e}(Ql),M0=function(){function n(e,t){if(typeof e!="string")throw new Error("LabeledFaceDescriptors - constructor expected label to be a string");if(!Array.isArray(t)||t.some(function(r){return!(r instanceof Float32Array)}))throw new Error("LabeledFaceDescriptors - constructor expected descriptors to be an array of Float32Array");this._label=e,this._descriptors=t}return Object.defineProperty(n.prototype,"label",{get:function(){return this._label},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"descriptors",{get:function(){return this._descriptors},enumerable:!0,configurable:!0}),n.prototype.toJSON=function(){return{label:this.label,descriptors:this.descriptors.map(function(e){return Array.from(e)})}},n.fromJSON=function(e){var t=e.descriptors.map(function(r){return new Float32Array(r)});return new n(e.label,t)},n}();(function(n){Ot(e,n);function e(t,r,i,a){var s=n.call(this,t,r)||this;return s._score=i,s._classScore=a,s}return e.assertIsValidPredictedBox=function(t,r){if(eI.assertIsValidLabeledBox(t,r),!Q4(t.score)||!Q4(t.classScore))throw new Error(r+" - expected properties score ("+t.score+") and ("+t.classScore+") to be a number between [0, 1]")},Object.defineProperty(e.prototype,"score",{get:function(){return this._score},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classScore",{get:function(){return this._classScore},enumerable:!0,configurable:!0}),e})(eI);function ioe(n){return n.detection instanceof au}function US(n,e){var t={detection:e};return Object.assign({},n,t)}function eL(){var n=window.fetch||function(){throw new Error("fetch - missing fetch implementation for browser environment")},e=function(){throw new Error("readFile - filesystem not available for browser environment")};return{Canvas:HTMLCanvasElement,CanvasRenderingContext2D,Image:HTMLImageElement,ImageData,Video:HTMLVideoElement,createCanvasElement:function(){return document.createElement("canvas")},createImageElement:function(){return document.createElement("img")},fetch:n,readFile:e}}function tL(n){var e="";if(!n)try{n=require("fs")}catch(r){e=r.toString()}var t=n?function(r){return new Promise(function(i,a){n.readFile(r,function(s,o){return s?a(s):i(o)})})}:function(){throw new Error("readFile - failed to require fs in nodejs environment with error: "+e)};return{readFile:t}}function nL(){var n=global.Canvas||global.HTMLCanvasElement,e=global.Image||global.HTMLImageElement,t=function(){if(n)return new n;throw new Error("createCanvasElement - missing Canvas implementation for nodejs environment")},r=function(){if(e)return new e;throw new Error("createImageElement - missing Image implementation for nodejs environment")},i=global.fetch||function(){throw new Error("fetch - missing fetch implementation for nodejs environment")},a=tL();return zi({Canvas:n||function(){function s(){}return s}(),CanvasRenderingContext2D:global.CanvasRenderingContext2D||function(){function s(){}return s}(),Image:e||function(){function s(){}return s}(),ImageData:global.ImageData||function(){function s(){}return s}(),Video:global.HTMLVideoElement||function(){function s(){}return s}(),createCanvasElement:t,createImageElement:r,fetch:i},a)}function rL(){return typeof window=="object"&&typeof document<"u"&&typeof HTMLImageElement<"u"&&typeof HTMLCanvasElement<"u"&&typeof HTMLVideoElement<"u"&&typeof ImageData<"u"&&typeof CanvasRenderingContext2D<"u"}function iL(){return typeof global=="object"&&typeof require=="function"&&typeof dg<"u"&&typeof process<"u"&&!!process.version}var ti;
3868function aoe(){if(!ti)throw new Error("getEnv - environment is not defined, check isNodejs() and isBrowser()");return ti}function vk(n){ti=n}function jS(){rL()&&vk(eL()),iL()&&vk(nL())}function soe(n){if(ti||jS(),!ti)throw new Error("monkeyPatch - environment is not defined, check isNodejs() and isBrowser()");var e=n.Canvas,t=e===void 0?ti.Canvas:e,r=n.Image,i=r===void 0?ti.Image:r;ti.Canvas=t,ti.Image=i,ti.createCanvasElement=n.createCanvasElement||function(){return new t},ti.createImageElement=n.createImageElement||function(){return new i},ti.ImageData=n.ImageData||ti.ImageData,ti.Video=n.Video||ti.Video,ti.fetch=n.fetch||ti.fetch,ti.readFile=n.readFile||ti.readFile}var Mi={getEnv:aoe,setEnv:vk,initialize:jS,createBrowserEnv:eL,createFileSystem:tL,createNodejsEnv:nL,monkeyPatch:soe,isBrowser:rL,isNodejs:iL};jS();function aL(n){return!Mi.isNodejs()&&typeof n=="string"?document.getElementById(n):n}function _f(n){var e=Mi.getEnv(),t=e.Canvas,r=e.CanvasRenderingContext2D;if(n instanceof r)return n;var i=aL(n);if(!(i instanceof t))throw new Error("resolveContext2d - expected canvas to be of instance of Canvas");var a=i.getContext("2d");if(!a)throw new Error("resolveContext2d - canvas 2d context is null");return a}var tI;(function(n){n.TOP_LEFT="TOP_LEFT",n.TOP_RIGHT="TOP_RIGHT",n.BOTTOM_LEFT="BOTTOM_LEFT",n.BOTTOM_RIGHT="BOTTOM_RIGHT"})(tI||(tI={}));function sL(n){var e=Mi.getEnv(),t=e.Image,r=e.Video;return n instanceof t&&n.complete||n instanceof r&&n.readyState>=3}function ooe(n){return new Promise(function(e,t){if(n instanceof Mi.getEnv().Canvas||sL(n))return e();function r(a){a.currentTarget&&(a.currentTarget.removeEventListener("load",r),a.currentTarget.removeEventListener("error",i),e(a))}function i(a){a.currentTarget&&(a.currentTarget.removeEventListener("load",r),a.currentTarget.removeEventListener("error",i),t(a))}n.addEventListener("load",r),n.addEventListener("error",i)})}function oL(n){return new Promise(function(e,t){if(!(n instanceof Blob))return t("bufferToImage - expected buf to be of type: Blob");var r=new FileReader;r.onload=function(){if(typeof r.result!="string")return t("bufferToImage - expected reader.result to be a string, in onload");var i=Mi.getEnv().createImageElement();i.onload=function(){return e(i)},i.onerror=t,i.src=r.result},r.onerror=t,r.readAsDataURL(n)})}function qS(n){var e=Mi.getEnv(),t=e.Image,r=e.Video;return n instanceof t?new jh(n.naturalWidth,n.naturalHeight):n instanceof r?new jh(n.videoWidth,n.videoHeight):new jh(n.width,n.height)}function vb(n){var e=n.width,t=n.height,r=Mi.getEnv().createCanvasElement,i=r();return i.width=e,i.height=t,i}function fv(n,e){var t=Mi.getEnv().ImageData;if(!(n instanceof t)&&!sL(n))throw new Error("createCanvasFromMedia - media has not finished loading yet");
3868var r=qS(n),i=r.width,a=r.height,s=vb({width:i,height:a});return n instanceof t?_f(s).putImageData(n,0,0):_f(s).drawImage(n,0,0,i,a),s}function coe(n,e){return dt(this,void 0,void 0,function(){var t,r,i,a,s,o;return ft(this,function(c){switch(c.label){case 0:return t=Mi.getEnv().createCanvasElement(),r=n.shape.slice(Ul(n)?1:0),i=r[0],a=r[1],s=r[2],o=Ze(function(){return n.as3D(i,a,s).toInt()}),[4,FS.toPixels(o,t)];case 1:return c.sent(),o.dispose(),[2,t]}})})}function nI(n){var e=Mi.getEnv(),t=e.Image,r=e.Canvas,i=e.Video;return n instanceof t||n instanceof r||n instanceof i}function uoe(n,e,t){t===void 0&&(t=!1);var r=Mi.getEnv(),i=r.Image,a=r.Canvas;if(!(n instanceof i||n instanceof a))throw new Error("imageToSquare - expected arg0 to be HTMLImageElement | HTMLCanvasElement");var s=qS(n),o=e/Math.max(s.height,s.width),c=o*s.width,u=o*s.height,l=vb({width:e,height:e}),d=n instanceof a?n:fv(n),h=Math.abs(c-u)/2,p=t&&c<u?h:0,g=t&&u<c?h:0;return _f(l).drawImage(d,p,g,c,u),l}var m_=function(){function n(e,t){var r=this;if(t===void 0&&(t=!1),this._imageTensors=[],this._canvases=[],this._treatAsBatchInput=!1,this._inputDimensions=[],!Array.isArray(e))throw new Error("NetInput.constructor - expected inputs to be an Array of TResolvedNetInput or to be instanceof tf.Tensor4D, instead have "+e);this._treatAsBatchInput=t,this._batchSize=e.length,e.forEach(function(i,a){if(mb(i)){r._imageTensors[a]=i,r._inputDimensions[a]=i.shape;return}if(Ul(i)){var s=i.shape[0];if(s!==1)throw new Error("NetInput - tf.Tensor4D with batchSize "+s+" passed, but not supported in input array");r._imageTensors[a]=i,r._inputDimensions[a]=i.shape.slice(1);return}var o=i instanceof Mi.getEnv().Canvas?i:fv(i);r._canvases[a]=o,r._inputDimensions[a]=[o.height,o.width,3]})}return Object.defineProperty(n.prototype,"imageTensors",{get:function(){return this._imageTensors},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"canvases",{get:function(){return this._canvases},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isBatchInput",{get:function(){return this.batchSize>1||this._treatAsBatchInput},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"batchSize",{get:function(){return this._batchSize},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"inputDimensions",{get:function(){return this._inputDimensions},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"inputSize",{get:function(){return this._inputSize},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"reshapedInputDimensions",{get:function(){var e=this;return Sg(this.batchSize,0,1).map(function(t,r){return e.getReshapedInputDimensions(r)})},enumerable:!0,configurable:!0}),n.prototype.getInput=function(e){return this.canvases[e]||this.imageTensors[e]},n.prototype.getInputDimensions=function(e){return this._inputDimensions[e]},n.prototype.getInputHeight=function(e){return this._inputDimensions[e][0]},n.prototype.getInputWidth=function(e){return this._inputDimensions[e][1]},n.prototype.getReshapedInputDimensions=function(e){if(typeof this.inputSize!="number")throw new Error("getReshapedInputDimensions - inputSize not set, toBatchTensor has not been called yet");var t=this.getInputWidth(e),r=this.getInputHeight(e);return Yse({width:t,height:r},this.inputSize)},n.prototype.toBatchTensor=function(e,t){var r=this;return t===void 0&&(t=!0),this._inputSize=e,Ze(function(){var i=Sg(r.batchSize,0,1).map(function(s){var o=r.getInput(s);if(o instanceof mr){var c=Ul(o)?o:o.expandDims();return c=Qse(c,t),(c.shape[1]!==e||c.shape[2]!==e)&&(c=IS.resizeBilinear(c,[e,e])),c.as3D(e,e,3)}if(o instanceof Mi.getEnv().Canvas)return FS.fromPixels(uoe(o,e,t));throw new Error("toBatchTensor - at batchIdx "+s+", expected input to be instanceof tf.Tensor or instanceof HTMLCanvasElement, instead have "+o)}
3868),a=ws(i.map(function(s){return s.toFloat()})).as4D(r.batchSize,e,e,3);return a})},n}();function vi(n){return dt(this,void 0,void 0,function(){var e,t,r;return ft(this,function(i){switch(i.label){case 0:if(n instanceof m_)return[2,n];if(e=Array.isArray(n)?n:[n],!e.length)throw new Error("toNetInput - empty array passed as input");return t=function(a){return Array.isArray(n)?" at input index "+a+":":""},r=e.map(aL),r.forEach(function(a,s){if(!nI(a)&&!mb(a)&&!Ul(a))throw typeof e[s]=="string"?new Error("toNetInput -"+t(s)+" string passed, but could not resolve HTMLElement for element id "+e[s]):new Error("toNetInput -"+t(s)+" expected media to be of type HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | tf.Tensor3D, or to be an element id");if(Ul(a)){var o=a.shape[0];if(o!==1)throw new Error("toNetInput -"+t(s)+" tf.Tensor4D with batchSize "+o+" passed, but not supported in input array")}}),[4,Promise.all(r.map(function(a){return nI(a)&&ooe(a)}))];case 1:return i.sent(),[2,new m_(r,Array.isArray(n))]}})})}function zS(n,e){return dt(this,void 0,void 0,function(){var t,r,i,a,s,o,c;return ft(this,function(u){switch(u.label){case 0:return t=Mi.getEnv().Canvas,r=n,n instanceof t?[3,5]:[4,vi(n)];case 1:if(i=u.sent(),i.batchSize>1)throw new Error("extractFaces - batchSize > 1 not supported");return a=i.getInput(0),a instanceof t?(s=a,[3,4]):[3,2];case 2:return[4,coe(a)];case 3:s=u.sent(),u.label=4;case 4:r=s,u.label=5;case 5:return o=_f(r),c=e.map(function(l){return l instanceof au?l.forSize(r.width,r.height).box.floor():l}).map(function(l){return l.clipAtImageBorders(r.width,r.height)}),[2,c.map(function(l){var d=l.x,h=l.y,p=l.width,g=l.height,v=vb({width:p,height:g});return _f(v).putImageData(o.getImageData(d,h,p,g),0,0),v})]}})})}function WS(n,e){return dt(this,void 0,void 0,function(){return ft(this,function(t){if(!mb(n)&&!Ul(n))throw new Error("extractFaceTensors - expected image tensor to be 3D or 4D");if(Ul(n)&&n.shape[0]>1)throw new Error("extractFaceTensors - batchSize > 1 not supported");return[2,Ze(function(){var r=n.shape.slice(Ul(n)?1:0),i=r[0],a=r[1],s=r[2],o=e.map(function(u){return u instanceof au?u.forSize(a,i).box:u}).map(function(u){return u.clipAtImageBorders(a,i)}),c=o.map(function(u){var l=u.x,d=u.y,h=u.width,p=u.height;return DN(n.as3D(i,a,s),[d,l,0],[p,h,s])});return c})]})})}function loe(n,e){return dt(this,void 0,void 0,function(){var t,r;return ft(this,function(i){switch(i.label){case 0:return t=Mi.getEnv().fetch,[4,t(n,e)];case 1:if(r=i.sent(),!(r.status<400))throw new Error("failed to fetch: ("+r.status+") "+r.statusText+", from url: "+r.url);return[2,r]}})})}function doe(n){return dt(this,void 0,void 0,function(){return ft(this,function(e){switch(e.label){case 0:return[4,loe(n)];case 1:return[2,e.sent().json()]}})})}function cL(n,e){var t=e+"-weights_manifest.json";if(!n)return{modelBaseUri:"",manifestUri:t};if(n==="/")return{modelBaseUri:"/",manifestUri:"/"+t};var r=n.startsWith("http://")?"http://":n.startsWith("https://")?"https://":"";n=n.replace(r,"");var i=n.split("/").filter(function(o){return o}),a=n.endsWith(".json")?i[i.length-1]:t,s=r+(n.endsWith(".json")?i.slice(0,i.length-1):i).join("/");return s=n.startsWith("/")?"/"+s:s,{modelBaseUri:s,manifestUri:s==="/"?"/"+a:s+"/"+a}}function foe(n,e){return dt(this,void 0,void 0,function(){var t,r,i,a;return ft(this,function(s){switch(s.label){case 0:return t=cL(n,e),r=t.manifestUri,i=t.modelBaseUri,[4,doe(r)];case 1:return a=s.sent(),[2,JN.loadWeights(a,i)]}})})}function uL(n,e,t){t===void 0&&(t=!1);var r=t?qS(e):e,i=r.width,a=r.height;return n.width=i,n.height=a,{width:i,height:a}}var rl=function(){function n(e){this._name=e,this._params=void 0,this._paramMappings=[]}return Object.defineProperty(n.prototype,"params",{get:function(){return this._params},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"paramMappings",{get:function(){return this._paramMappings},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isLoaded",{get:function(){return!!this.params},enumerable:!0,configurable:!0}),n.prototype.getParamFromPath=function(e){var t=this.traversePropertyPath(e),r=t.obj,i=t.objProp;return r[i]},n.prototype.reassignParamFromPath=function(e,t){var r=this.traversePropertyPath(e),i=r.obj,a=r.objProp;i[a].dispose(),i[a]=t},n.prototype.getParamList=function(){var e=this;return this._paramMappings.map(function(t){var r=t.paramPath;return{path:r,tensor:e.getParamFromPath(r)}})},n.prototype.getTrainableParams=function(){return this.getParamList().filter(function(e){return e.tensor instanceof cp})},n.prototype.getFrozenParams=function(){return this.getParamList().filter(function(e){return!(e.tensor instanceof cp)})},n.prototype.variable=function(){var e=this;
vendor: 5,114 bytes, line 3868
3868this.getFrozenParams().forEach(function(t){var r=t.path,i=t.tensor;e.reassignParamFromPath(r,i.variable())})},n.prototype.freeze=function(){var e=this;this.getTrainableParams().forEach(function(t){var r=t.path,i=t.tensor,a=Pi(i.dataSync());i.dispose(),e.reassignParamFromPath(r,a)})},n.prototype.dispose=function(e){e===void 0&&(e=!0),this.getParamList().forEach(function(t){if(e&&t.tensor.isDisposed)throw new Error("param tensor has already been disposed for path "+t.path);t.tensor.dispose()}),this._params=void 0},n.prototype.serializeParams=function(){return new Float32Array(this.getParamList().map(function(e){var t=e.tensor;return Array.from(t.dataSync())}).reduce(function(e,t){return e.concat(t)}))},n.prototype.load=function(e){return dt(this,void 0,void 0,function(){return ft(this,function(t){switch(t.label){case 0:return e instanceof Float32Array?(this.extractWeights(e),[2]):[4,this.loadFromUri(e)];case 1:return t.sent(),[2]}})})},n.prototype.loadFromUri=function(e){return dt(this,void 0,void 0,function(){var t;return ft(this,function(r){switch(r.label){case 0:if(e&&typeof e!="string")throw new Error(this._name+".loadFromUri - expected model uri");return[4,foe(e,this.getDefaultModelName())];case 1:return t=r.sent(),this.loadFromWeightMap(t),[2]}})})},n.prototype.loadFromDisk=function(e){return dt(this,void 0,void 0,function(){var t,r,i,a,s,o,c,u,l,d;return ft(this,function(h){switch(h.label){case 0:if(e&&typeof e!="string")throw new Error(this._name+".loadFromDisk - expected model file path");return t=Mi.getEnv().readFile,r=cL(e,this.getDefaultModelName()),i=r.manifestUri,a=r.modelBaseUri,s=function(p){return Promise.all(p.map(function(g){return t(g).then(function(v){return v.buffer})}))},o=JN.weightsLoaderFactory(s),l=(u=JSON).parse,[4,t(i)];case 1:return c=l.apply(u,[h.sent().toString()]),[4,o(c,a)];case 2:return d=h.sent(),this.loadFromWeightMap(d),[2]}})})},n.prototype.loadFromWeightMap=function(e){var t=this.extractParamsFromWeigthMap(e),r=t.paramMappings,i=t.params;this._paramMappings=r,this._params=i},n.prototype.extractWeights=function(e){var t=this.extractParams(e),r=t.paramMappings,i=t.params;this._paramMappings=r,this._params=i},n.prototype.traversePropertyPath=function(e){if(!this.params)throw new Error("traversePropertyPath - model has no loaded params");var t=e.split("/").reduce(function(a,s){if(!a.nextObj.hasOwnProperty(s))throw new Error("traversePropertyPath - object does not have property "+s+", for path "+e);return{obj:a.nextObj,objProp:s,nextObj:a.nextObj[s]}},{nextObj:this.params}),r=t.obj,i=t.objProp;if(!r||!i||!(r[i]instanceof mr))throw new Error("traversePropertyPath - parameter is not a tensor, for path "+e);return{obj:r,objProp:i}},n}();function _s(n,e,t){return Ze(function(){var r=TS(n,e.depthwise_filter,e.pointwise_filter,t,"same");return r=Xt(r,e.bias),r})}function Dw(n,e,t){return t===void 0&&(t=!1),Ze(function(){var r=vr(t?Xt(yo(n,e.conv0.filters,[2,2],"same"),e.conv0.bias):_s(n,e.conv0,[2,2])),i=_s(r,e.conv1,[1,1]),a=vr(Xt(r,i)),s=_s(a,e.conv2,[1,1]);return vr(Xt(r,Xt(i,s)))})}function D0(n,e,t,r){return t===void 0&&(t=!1),r===void 0&&(r=!0),Ze(function(){var i=vr(t?Xt(yo(n,e.conv0.filters,r?[2,2]:[1,1],"same"),e.conv0.bias):_s(n,e.conv0,r?[2,2]:[1,1])),a=_s(i,e.conv1,[1,1]),s=vr(Xt(i,a)),o=_s(s,e.conv2,[1,1]),c=vr(Xt(i,Xt(a,o))),u=_s(c,e.conv3,[1,1]);return vr(Xt(i,Xt(a,Xt(o,u))))})}function nc(n,e,t,r){return t===void 0&&(t="same"),r===void 0&&(r=!1),Ze(function(){var i=Xt(yo(n,e.filters,[1,1],t),e.bias);return r?vr(i):i})}function il(n,e){Object.keys(n).forEach(function(t){e.some(function(r){return r.originalPath===t})||n[t].dispose()})}function yb(n,e){return function(t,r,i,a){var s=Ma(n(t*r*i*i),[i,i,t,r]),o=Hr(n(r));return e.push({paramPath:a+"/filters"},{paramPath:a+"/bias"}),{filters:s,bias:o}}}function HS(n,e){return function(t,r,i){var a=$l(n(t*r),[t,r]),s=Hr(n(r));return e.push({paramPath:i+"/weights"},{paramPath:i+"/bias"}),{weights:a,bias:s}}}var lL=function(){function n(e,t,r){this.depthwise_filter=e,this.pointwise_filter=t,this.bias=r}return n}();function VS(n,e){return function(t,r,i){var a=Ma(n(9*t),[3,3,t,1]),s=Ma(n(t*r),[1,1,t,r]),o=Hr(n(r));return e.push({paramPath:i+"/depthwise_filter"},{paramPath:i+"/pointwise_filter"},{paramPath:i+"/bias"}),new lL(a,s,o)}}function GS(n){return function(e){var t=n(e+"/depthwise_filter",4),r=n(e+"/pointwise_filter",4),i=n(e+"/bias",1);return new lL(t,r,i)}}function ud(n,e){return function(t,r,i){var a=n[t];if(!pb(a,r))throw new Error("expected weightMap["+t+"] to be a Tensor"+r+"D, instead have "+a);return e.push({originalPath:t,paramPath:i||t}),a}}function al(n){var e=n;function t(i){var a=e.slice(0,i);return e=e.slice(i),a}function r(){return e}return{extractWeights:t,getRemainingWeights:r}}function dL(n,e){var t=yb(n,e),r=VS(n,e);function i(s,o,c,u){u===void 0&&(u=!1);var l=u?t(s,o,3,c+"/conv0"):r(s,o,c+"/conv0"),d=r(o,o,c+"/conv1"),h=r(o,o,c+"/conv2");return{conv0:l,conv1:d,conv2:h}}function a(s,o,c,u){u===void 0&&(u=!1);var l=i(s,o,c,u),d=l.conv0,h=l.conv1,p=l.conv2,g=r(o,o,c+"/conv3");return{conv0:d,conv1:h,conv2:p,conv3:g}}
3868return{extractDenseBlock3Params:i,extractDenseBlock4Params:a}}function hoe(n){var e=[],t=al(n),r=t.extractWeights,i=t.getRemainingWeights,a=dL(r,e).extractDenseBlock4Params,s=a(3,32,"dense0",!0),o=a(32,64,"dense1"),c=a(64,128,"dense2"),u=a(128,256,"dense3");if(i().length!==0)throw new Error("weights remaing after extract: "+i().length);return{paramMappings:e,params:{dense0:s,dense1:o,dense2:c,dense3:u}}}function fL(n){return function(e){var t=n(e+"/filters",4),r=n(e+"/bias",1);return{filters:t,bias:r}}}function hL(n,e){var t=ud(n,e),r=fL(t),i=GS(t);function a(o,c){c===void 0&&(c=!1);var u=c?r(o+"/conv0"):i(o+"/conv0"),l=i(o+"/conv1"),d=i(o+"/conv2");return{conv0:u,conv1:l,conv2:d}}function s(o,c){c===void 0&&(c=!1);var u=c?r(o+"/conv0"):i(o+"/conv0"),l=i(o+"/conv1"),d=i(o+"/conv2"),h=i(o+"/conv3");return{conv0:u,conv1:l,conv2:d,conv3:h}}return{extractDenseBlock3Params:a,extractDenseBlock4Params:s}}function poe(n){var e=[],t=hL(n,e).extractDenseBlock4Params,r={dense0:t("dense0",!0),dense1:t("dense1"),dense2:t("dense2"),dense3:t("dense3")};return il(n,e),{params:r,paramMappings:e}}var pL=function(n){Ot(e,n);function e(){return n.call(this,"FaceFeatureExtractor")||this}return e.prototype.forwardInput=function(t){var r=this.params;if(!r)throw new Error("FaceFeatureExtractor - load model before inference");return Ze(function(){var i=t.toBatchTensor(112,!0),a=[122.782,117.001,104.298],s=dv(i,a).div(Ke(255)),o=D0(s,r.dense0,!0);return o=D0(o,r.dense1),o=D0(o,r.dense2),o=D0(o,r.dense3),o=uv(o,[7,7],[2,2],"valid"),o})},e.prototype.forward=function(t){return dt(this,void 0,void 0,function(){var r;return ft(this,function(i){switch(i.label){case 0:return r=this.forwardInput,[4,vi(t)];case 1:return[2,r.apply(this,[i.sent()])]}})})},e.prototype.getDefaultModelName=function(){return"face_feature_extractor_model"},e.prototype.extractParamsFromWeigthMap=function(t){return poe(t)},e.prototype.extractParams=function(t){return hoe(t)},e}(rl);function Bc(n,e){return Ze(function(){return Xt(db(n,e.weights),e.bias)})}function moe(n,e,t){var r=[],i=al(n),a=i.extractWeights,s=i.getRemainingWeights,o=HS(a,r),c=o(e,t,"fc");if(s().length!==0)throw new Error("weights remaing after extract: "+s().length);return{paramMappings:r,params:{fc:c}}}function goe(n){var e=[],t=ud(n,e);function r(a){var s=t(a+"/weights",2),o=t(a+"/bias",1);return{weights:s,bias:o}}var i={fc:r("fc")};return il(n,e),{params:i,paramMappings:e}}function mL(n){var e={},t={};return Object.keys(n).forEach(function(r){var i=r.startsWith("fc")?t:e;i[r]=n[r]}),{featureExtractorMap:e,classifierMap:t}}var gL=function(n){Ot(e,n);function e(t,r){var i=n.call(this,t)||this;return i._faceFeatureExtractor=r,i}return Object.defineProperty(e.prototype,"faceFeatureExtractor",{get:function(){return this._faceFeatureExtractor},enumerable:!0,configurable:!0}),e.prototype.runNet=function(t){var r=this,i=this.params;if(!i)throw new Error(this._name+" - load model before inference");return Ze(function(){var a=t instanceof m_?r.faceFeatureExtractor.forwardInput(t):t;return Bc(a.as2D(a.shape[0],-1),i.fc)})},e.prototype.dispose=function(t){t===void 0&&(t=!0),this.faceFeatureExtractor.dispose(t),n.prototype.dispose.call(this,t)},e.prototype.loadClassifierParams=function(t){var r=this.extractClassifierParams(t),i=r.params,a=r.paramMappings;this._params=i,this._paramMappings=a},e.prototype.extractClassifierParams=function(t){return moe(t,this.getClassifierChannelsIn(),this.getClassifierChannelsOut())},e.prototype.extractParamsFromWeigthMap=function(t){var r=mL(t),i=r.featureExtractorMap,a=r.classifierMap;return this.faceFeatureExtractor.loadFromWeightMap(i),goe(a)},e.prototype.extractParams=function(t){var r=this.getClassifierChannelsIn(),i=this.getClassifierChannelsOut(),a=i*r+i,s=t.slice(0,t.length-a),o=t.slice(t.length-a);return this.faceFeatureExtractor.extractWeights(s),this.extractClassifierParams(o)},e}(rl),rI=["neutral","happy","sad","angry","fearful","disgusted","surprised"],voe=function(){function n(e){var t=this;if(e.length!==7)throw new Error("FaceExpressions.constructor - expected probabilities.length to be 7, have: "+e.length);rI.forEach(function(r,i){t[r]=e[i]})}return n.prototype.asSortedArray=function(){var e=this;return rI.map(function(t){return{expression:t,probability:e[t]}}).sort(function(t,r){return r.probability-t.probability})},n}(),yoe=function(n){Ot(e,n);function e(t){return t===void 0&&(t=new pL),n.call(this,"FaceExpressionNet",t)||this}return e.prototype.forwardInput=function(t){var r=this;return Ze(function(){return tl(r.runNet(t))})},e.prototype.forward=function(t){return dt(this,void 0,void 0,function(){var r;return ft(this,function(i){switch(i.label){case 0:return r=this.forwardInput,[4,vi(t)];case 1:return[2,r.apply(this,[i.sent()])]}})})},e.prototype.predictExpressions=function(t){return dt(this,void 0,void 0,function(){var r,i,a,s,o=this;return ft(this,function(c){switch(c.label){case 0:return[4,vi(t)];case 1:return r=c.sent(),[4,this.forwardInput(r)];case 2:return i=c.sent(),[4,Promise.all(si(i).map(function(u){return dt(o,void 0,void 0,function(){var l;return ft(this,function(d){switch(d.label){case 0:return[4,u.data()];case 1:return l=d.sent(),u.dispose(),[2,l]}})})}))];case 3:return a=c.sent(),i.dispose(),s=a.map(function(u){return new voe(u)}),[2,r.isBatchInput?s:s[0]]}})})},e.prototype.getDefaultModelName=function(){return"face_expression_model"},e.prototype.getClassifierChannelsIn=function(){return 256},e.prototype.getClassifierChannelsOut=function(){return 7},e}(gL);function vL(n,e){var t={expressions:e};return Object.assign({},n,t)}function _oe(n){return ioe(n)&&n.landmarks instanceof p_&&n.unshiftedLandmarks instanceof p_&&n.alignedRect instanceof au}function KS(n,e){var t=n.detection.box,r=e.shiftBy(t.x,t.y),i=r.align(),a=n.detection.imageDims,s=new au(n.detection.score,i.rescale(a.reverse()),a),o={landmarks:r,unshiftedLandmarks:e,alignedRect:s};return Object.assign({},n,o)}function boe(n,e){var t=yb(n,e),r=VS(n,e);function i(s,o,c){var u=r(s,o,c+"/separable_conv0"),l=r(o,o,c+"/separable_conv1"),d=t(s,o,1,c+"/expansion_conv");return{separable_conv0:u,separable_conv1:l,expansion_conv:d}}function a(s,o){var c=r(s,s,o+"/separable_conv0"),u=r(s,s,o+"/separable_conv1"),l=r(s,s,o+"/separable_conv2");return{separable_conv0:c,separable_conv1:u,separable_conv2:l}}return{extractConvParams:t,extractSeparableConvParams:r,extractReductionBlockParams:i,extractMainBlockParams:a}}function xoe(n,e){var t=[],r=al(n),i=r.extractWeights,a=r.getRemainingWeights,s=boe(i,t),o=s.extractConvParams,c=s.extractSeparableConvParams,u=s.extractReductionBlockParams,l=s.extractMainBlockParams,d=o(3,32,3,"entry_flow/conv_in"),h=u(32,64,"entry_flow/reduction_block_0"),p=u(64,128,"entry_flow/reduction_block_1"),g={conv_in:d,reduction_block_0:h,reduction_block_1:p},v={};
3868Sg(e,0,1).forEach(function(S){v["main_block_"+S]=l(128,"middle_flow/main_block_"+S)});var y=u(128,256,"exit_flow/reduction_block"),b=c(256,512,"exit_flow/separable_conv"),x={reduction_block:y,separable_conv:b};if(a().length!==0)throw new Error("weights remaing after extract: "+a().length);return{paramMappings:t,params:{entry_flow:g,middle_flow:v,exit_flow:x}}}function woe(n,e){var t=ud(n,e),r=fL(t),i=GS(t);function a(o){var c=i(o+"/separable_conv0"),u=i(o+"/separable_conv1"),l=r(o+"/expansion_conv");return{separable_conv0:c,separable_conv1:u,expansion_conv:l}}function s(o){var c=i(o+"/separable_conv0"),u=i(o+"/separable_conv1"),l=i(o+"/separable_conv2");return{separable_conv0:c,separable_conv1:u,separable_conv2:l}}return{extractConvParams:r,extractSeparableConvParams:i,extractReductionBlockParams:a,extractMainBlockParams:s}}function Coe(n,e){var t=[],r=woe(n,t),i=r.extractConvParams,a=r.extractSeparableConvParams,s=r.extractReductionBlockParams,o=r.extractMainBlockParams,c=i("entry_flow/conv_in"),u=s("entry_flow/reduction_block_0"),l=s("entry_flow/reduction_block_1"),d={conv_in:c,reduction_block_0:u,reduction_block_1:l},h={};Sg(e,0,1).forEach(function(y){h["main_block_"+y]=o("middle_flow/main_block_"+y)});var p=s("exit_flow/reduction_block"),g=a("exit_flow/separable_conv"),v={reduction_block:p,separable_conv:g};return il(n,t),{params:{entry_flow:d,middle_flow:h,exit_flow:v},paramMappings:t}}function yL(n,e,t){return Xt(yo(n,e.filters,t,"same"),e.bias)}function Nw(n,e,t){t===void 0&&(t=!0);var r=t?vr(n):n;return r=_s(r,e.separable_conv0,[1,1]),r=_s(vr(r),e.separable_conv1,[1,1]),r=di(r,[3,3],[2,2],"same"),r=Xt(r,yL(n,e.expansion_conv,[2,2])),r}function koe(n,e){var t=_s(vr(n),e.separable_conv0,[1,1]);return t=_s(vr(t),e.separable_conv1,[1,1]),t=_s(vr(t),e.separable_conv2,[1,1]),t=Xt(t,n),t}var Soe=function(n){Ot(e,n);function e(t){var r=n.call(this,"TinyXception")||this;return r._numMainBlocks=t,r}return e.prototype.forwardInput=function(t){var r=this,i=this.params;if(!i)throw new Error("TinyXception - load model before inference");return Ze(function(){var a=t.toBatchTensor(112,!0),s=[122.782,117.001,104.298],o=dv(a,s).div(Ke(256)),c=vr(yL(o,i.entry_flow.conv_in,[2,2]));return c=Nw(c,i.entry_flow.reduction_block_0,!1),c=Nw(c,i.entry_flow.reduction_block_1),Sg(r._numMainBlocks,0,1).forEach(function(u){c=koe(c,i.middle_flow["main_block_"+u])}),c=Nw(c,i.exit_flow.reduction_block),c=vr(_s(c,i.exit_flow.separable_conv,[1,1])),c})},e.prototype.forward=function(t){return dt(this,void 0,void 0,function(){var r;return ft(this,function(i){switch(i.label){case 0:return r=this.forwardInput,[4,vi(t)];case 1:return[2,r.apply(this,[i.sent()])]}})})},e.prototype.getDefaultModelName=function(){return"tiny_xception_model"},e.prototype.extractParamsFromWeigthMap=function(t){return Coe(t,this._numMainBlocks)},e.prototype.extractParams=function(t){return xoe(t,this._numMainBlocks)},e}(rl);function Toe(n){var e=[],t=al(n),r=t.extractWeights,i=t.getRemainingWeights,a=HS(r,e),s=a(512,1,"fc/age"),o=a(512,2,"fc/gender");if(i().length!==0)throw new Error("weights remaing after extract: "+i().length);return{paramMappings:e,params:{fc:{age:s,gender:o}}}}function Eoe(n){var e=[],t=ud(n,e);function r(a){var s=t(a+"/weights",2),o=t(a+"/bias",1);return{weights:s,bias:o}}var i={fc:{age:r("fc/age"),gender:r("fc/gender")}};return il(n,e),{params:i,paramMappings:e}}var g_;(function(n){n.FEMALE="female",n.MALE="male"})(g_||(g_={}));var Poe=function(n){Ot(e,n);function e(t){t===void 0&&(t=new Soe(2));var r=n.call(this,"AgeGenderNet")||this;return r._faceFeatureExtractor=t,r}return Object.defineProperty(e.prototype,"faceFeatureExtractor",{get:function(){return this._faceFeatureExtractor},enumerable:!0,configurable:!0}),e.prototype.runNet=function(t){var r=this,i=this.params;if(!i)throw new Error(this._name+" - load model before inference");return Ze(function(){var a=t instanceof m_?r.faceFeatureExtractor.forwardInput(t):t,s=uv(a,[7,7],[2,2],"valid").as2D(a.shape[0],-1),o=Bc(s,i.fc.age).as1D(),c=Bc(s,i.fc.gender);return{age:o,gender:c}})},e.prototype.forwardInput=function(t){var r=this;return Ze(function(){var i=r.runNet(t),a=i.age,s=i.gender;return{age:a,gender:tl(s)}})},e.prototype.forward=function(t){return dt(this,void 0,void 0,function(){var r;return ft(this,function(i){switch(i.label){case 0:return r=this.forwardInput,[4,vi(t)];case 1:return[2,r.apply(this,[i.sent()])]}})})},e.prototype.predictAgeAndGender=function(t){return dt(this,void 0,void 0,function(){var r,i,a,s,o,c,u=this;return ft(this,function(l){switch(l.label){case 0:return[4,vi(t)];case 1:return r=l.sent(),[4,this.forwardInput(r)];case 2:return i=l.sent(),a=si(i.age),s=si(i.gender),o=a.map(function(d,h){return{ageTensor:d,genderTensor:s[h]}}),[4,Promise.all(o.map(function(d){var h=d.ageTensor,p=d.genderTensor;return dt(u,void 0,void 0,function(){var g,v,y,b,x;return ft(this,function(S){switch(S.label){case 0:return[4,h.data()];case 1:return g=S.sent()[0],[4,p.data()];case 2:return v=S.sent()[0],y=v>.5,b=y?g_.MALE:g_.FEMALE,x=y?v:1-v,h.dispose(),p.dispose(),[2,{age:g,gender:b,genderProbability:x}]}})})}))];case 3:return c=l.sent(),i.age.dispose(),i.gender.dispose(),[2,r.isBatchInput?c:c[0]]}})})},e.prototype.getDefaultModelName=function(){return"age_gender_model"},e.prototype.dispose=function(t){t===void 0&&(t=!0),this.faceFeatureExtractor.dispose(t),n.prototype.dispose.call(this,t)},e.prototype.loadClassifierParams=function(t){var r=this.extractClassifierParams(t),i=r.params,a=r.paramMappings;this._params=i,this._paramMappings=a},e.prototype.extractClassifierParams=function(t){return Toe(t)},e.prototype.extractParamsFromWeigthMap=function(t){var r=mL(t),i=r.featureExtractorMap,a=r.classifierMap;return this.faceFeatureExtractor.loadFromWeightMap(i),Eoe(a)},e.prototype.extractParams=function(t){var r=1539,i=t.slice(0,t.length-r),a=t.slice(t.length-r);return this.faceFeatureExtractor.extractWeights(i),this.extractClassifierParams(a)},e}(rl),_L=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.postProcess=function(t,r,i){var a=i.map(function(o){var c=o.width,u=o.height,l=r/Math.max(u,c);return{width:c*l,height:u*l}}),s=a.length;return Ze(function(){var o=function(h,p){return ws([Kc([68],h),Kc([68],p)],1).as2D(1,136).as1D()},c=function(h,p){var g=a[h],v=g.width,y=g.height;return p(v,y)?Math.abs(v-y)/2:0},u=function(h){return c(h,function(p,g){return p<g})},l=function(h){return c(h,function(p,g){return g<p})},d=t.mul(Kc([s,136],r)).sub(ws(Array.from(Array(s),function(h,p){return o(u(p),l(p))}))).div(ws(Array.from(Array(s),function(h,p){return o(a[p].width,a[p].height)})));return d})},e.prototype.forwardInput=function(t){var r=this;return Ze(function(){var i=r.runNet(t);return r.postProcess(i,t.inputSize,t.inputDimensions.map(function(a){var s=a[0],o=a[1];return{height:s,width:o}}))})},e.prototype.forward=function(t){return dt(this,void 0,void 0,function(){var r;return ft(this,function(i){switch(i.label){case 0:return r=this.forwardInput,[4,vi(t)];case 1:return[2,r.apply(this,[i.sent()])]}})})},e.prototype.detectLandmarks=function(t){return dt(this,void 0,void 0,function(){var r,i,a,s=this;return ft(this,function(o){switch(o.label){case 0:return[4,vi(t)];case 1:return r=o.sent(),i=Ze(function(){return si(s.forwardInput(r))}),[4,Promise.all(i.map(function(c,u){return dt(s,void 0,void 0,function(){var l,d,h,p,g;return ft(this,function(v){switch(v.label){case 0:return h=(d=Array).from,[4,c.data()];case 1:return l=h.apply(d,[v.sent()]),p=l.filter(function(y,b){return X4(b)}
3868),g=l.filter(function(y,b){return!X4(b)}),[2,new roe(Array(68).fill(0).map(function(y,b){return new Cn(p[b],g[b])}),{height:r.getInputHeight(u),width:r.getInputWidth(u)})]}})})}))];case 2:return a=o.sent(),i.forEach(function(c){return c.dispose()}),[2,r.isBatchInput?a:a[0]]}})})},e.prototype.getClassifierChannelsOut=function(){return 136},e}(gL),bL=function(n){Ot(e,n);function e(t){return t===void 0&&(t=new pL),n.call(this,"FaceLandmark68Net",t)||this}return e.prototype.getDefaultModelName=function(){return"face_landmark_68_model"},e.prototype.getClassifierChannelsIn=function(){return 256},e}(_L);function Roe(n){var e=[],t=hL(n,e).extractDenseBlock3Params,r={dense0:t("dense0",!0),dense1:t("dense1"),dense2:t("dense2")};return il(n,e),{params:r,paramMappings:e}}function Aoe(n){var e=[],t=al(n),r=t.extractWeights,i=t.getRemainingWeights,a=dL(r,e).extractDenseBlock3Params,s=a(3,32,"dense0",!0),o=a(32,64,"dense1"),c=a(64,128,"dense2");if(i().length!==0)throw new Error("weights remaing after extract: "+i().length);return{paramMappings:e,params:{dense0:s,dense1:o,dense2:c}}}var Ioe=function(n){Ot(e,n);function e(){return n.call(this,"TinyFaceFeatureExtractor")||this}return e.prototype.forwardInput=function(t){var r=this.params;if(!r)throw new Error("TinyFaceFeatureExtractor - load model before inference");return Ze(function(){var i=t.toBatchTensor(112,!0),a=[122.782,117.001,104.298],s=dv(i,a).div(Ke(255)),o=Dw(s,r.dense0,!0);return o=Dw(o,r.dense1),o=Dw(o,r.dense2),o=uv(o,[14,14],[2,2],"valid"),o})},e.prototype.forward=function(t){return dt(this,void 0,void 0,function(){var r;return ft(this,function(i){switch(i.label){case 0:return r=this.forwardInput,[4,vi(t)];case 1:return[2,r.apply(this,[i.sent()])]}})})},e.prototype.getDefaultModelName=function(){return"face_feature_extractor_tiny_model"},e.prototype.extractParamsFromWeigthMap=function(t){return Roe(t)},e.prototype.extractParams=function(t){return Aoe(t)},e}(rl),Ooe=function(n){Ot(e,n);function e(t){return t===void 0&&(t=new Ioe),n.call(this,"FaceLandmark68TinyNet",t)||this}return e.prototype.getDefaultModelName=function(){return"face_landmark_68_tiny_model"},e.prototype.getClassifierChannelsIn=function(){return 128},e}(_L);(function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e})(bL);function Moe(n,e){return Xt(Ki(n,e.weights),e.biases)}function YS(n,e,t,r,i){i===void 0&&(i="same");var a=e.conv,s=a.filters,o=a.bias,c=yo(n,s,t,i);return c=Xt(c,o),c=Moe(c,e.scale),r?vr(c):c}function Doe(n,e){return YS(n,e,[1,1],!0)}function xL(n,e){return YS(n,e,[1,1],!1)}function wL(n,e){return YS(n,e,[2,2],!0,"valid")}function Noe(n,e){function t(o,c,u){var l=n(o),d=l.length/(c*u*u);if(Gse(d))throw new Error("depth has to be an integer: "+d+", weights.length: "+l.length+", numFilters: "+c+", filterSize: "+u);return Ze(function(){return Jl(Ma(l,[c,d,u,u]),[2,3,1,0])})}function r(o,c,u,l){var d=t(o,c,u),h=Hr(n(c));return e.push({paramPath:l+"/filters"},{paramPath:l+"/bias"}),{filters:d,bias:h}}function i(o,c){var u=Hr(n(o)),l=Hr(n(o));return e.push({paramPath:c+"/weights"},{paramPath:c+"/biases"}),{weights:u,biases:l}}function a(o,c,u,l){var d=r(o,c,u,l+"/conv"),h=i(c,l+"/scale");return{conv:d,scale:h}}function s(o,c,u,l,d){d===void 0&&(d=!1);var h=a((d?.5:1)*o,c,u,l+"/conv1"),p=a(o,c,u,l+"/conv2");return{conv1:h,conv2:p}}return{extractConvLayerParams:a,extractResidualLayerParams:s}}function Loe(n){var e=al(n),t=e.extractWeights,r=e.getRemainingWeights,i=[],a=Noe(t,i),s=a.extractConvLayerParams,o=a.extractResidualLayerParams,c=s(4704,32,7,"conv32_down"),u=o(9216,32,3,"conv32_1"),l=o(9216,32,3,"conv32_2"),d=o(9216,32,3,"conv32_3"),h=o(36864,64,3,"conv64_down",!0),p=o(36864,64,3,"conv64_1"),g=o(36864,64,3,"conv64_2"),v=o(36864,64,3,"conv64_3"),y=o(147456,128,3,"conv128_down",!0),b=o(147456,128,3,"conv128_1"),x=o(147456,128,3,"conv128_2"),S=o(589824,256,3,"conv256_down",!0),w=o(589824,256,3,"conv256_1"),k=o(589824,256,3,"conv256_2"),E=o(589824,256,3,"conv256_down_out"),I=Ze(function(){return Jl($l(t(256*128),[128,256]),[1,0])});if(i.push({paramPath:"fc"}),r().length!==0)throw new Error("weights remaing after extract: "+r().length);var P={conv32_down:c,conv32_1:u,conv32_2:l,conv32_3:d,conv64_down:h,conv64_1:p,conv64_2:g,conv64_3:v,conv128_down:y,conv128_1:b,conv128_2:x,conv256_down:S,conv256_1:w,conv256_2:k,conv256_down_out:E,fc:I};return{params:P,paramMappings:i}}function Foe(n,e){var t=ud(n,e);function r(s){var o=t(s+"/scale/weights",1),c=t(s+"/scale/biases",1);return{weights:o,biases:c}}function i(s){var o=t(s+"/conv/filters",4),c=t(s+"/conv/bias",1),u=r(s);return{conv:{filters:o,bias:c},scale:u}}function a(s){return{conv1:i(s+"/conv1"),conv2:i(s+"/conv2")}}return{extractConvLayerParams:i,extractResidualLayerParams:a}}function $oe(n){var e=[],t=Foe(n,e),r=t.extractConvLayerParams,i=t.extractResidualLayerParams,a=r("conv32_down"),s=i("conv32_1"),o=i("conv32_2"),c=i("conv32_3"),u=i("conv64_down"),l=i("conv64_1"),d=i("conv64_2"),h=i("conv64_3"),p=i("conv128_down"),g=i("conv128_1"),v=i("conv128_2"),y=i("conv256_down"),b=i("conv256_1"),x=i("conv256_2"),S=i("conv256_down_out"),w=n.fc;if(e.push({originalPath:"fc",paramPath:"fc"}),!Vse(w))throw new Error("expected weightMap[fc] to be a Tensor2D, instead have "+w);var k={conv32_down:a,conv32_1:s,conv32_2:o,conv32_3:c,conv64_down:u,conv64_1:l,conv64_2:d,conv64_3:h,conv128_down:p,conv128_1:g,conv128_2:v,conv256_down:y,conv256_1:b,conv256_2:x,conv256_down_out:S,fc:w};return il(n,e),{params:k,paramMappings:e}}function kc(n,e){var t=Doe(n,e.conv1);return t=xL(t,e.conv2),t=Xt(t,n),t=vr(t),t}function N0(n,e){var t=wL(n,e.conv1);t=xL(t,e.conv2);var r=uv(n,2,2,"valid"),i=Gn(r.shape),a=r.shape[3]!==t.shape[3],s=r.shape[1]!==t.shape[1]||r.shape[2]!==t.shape[2];if(s){var o=Xm(t.shape);o[1]=1;var c=Gn(o);t=ai([t,c],1);var u=Xm(t.shape);u[2]=1;var l=Gn(u);t=ai([t,l],2)}return r=a?ai([r,i],3):r,t=Xt(r,t),t=vr(t),t}var Boe=function(n){Ot(e,n);function e(){return n.call(this,"FaceRecognitionNet")||this}return e.prototype.forwardInput=function(t){var r=this.params;if(!r)throw new Error("FaceRecognitionNet - load model before inference");
3868return Ze(function(){var i=t.toBatchTensor(150,!0).toFloat(),a=[122.782,117.001,104.298],s=dv(i,a).div(Ke(256)),o=wL(s,r.conv32_down);o=di(o,3,2,"valid"),o=kc(o,r.conv32_1),o=kc(o,r.conv32_2),o=kc(o,r.conv32_3),o=N0(o,r.conv64_down),o=kc(o,r.conv64_1),o=kc(o,r.conv64_2),o=kc(o,r.conv64_3),o=N0(o,r.conv128_down),o=kc(o,r.conv128_1),o=kc(o,r.conv128_2),o=N0(o,r.conv256_down),o=kc(o,r.conv256_1),o=kc(o,r.conv256_2),o=N0(o,r.conv256_down_out);var c=o.mean([1,2]),u=db(c,r.fc);return u})},e.prototype.forward=function(t){return dt(this,void 0,void 0,function(){var r;return ft(this,function(i){switch(i.label){case 0:return r=this.forwardInput,[4,vi(t)];case 1:return[2,r.apply(this,[i.sent()])]}})})},e.prototype.computeFaceDescriptor=function(t){return dt(this,void 0,void 0,function(){var r,i,a,s=this;return ft(this,function(o){switch(o.label){case 0:return[4,vi(t)];case 1:return r=o.sent(),i=Ze(function(){return si(s.forwardInput(r))}),[4,Promise.all(i.map(function(c){return c.data()}))];case 2:return a=o.sent(),i.forEach(function(c){return c.dispose()}),[2,r.isBatchInput?a:a[0]]}})})},e.prototype.getDefaultModelName=function(){return"face_recognition_model"},e.prototype.extractParamsFromWeigthMap=function(t){return $oe(t)},e.prototype.extractParams=function(t){return Loe(t)},e}(rl);function CL(n,e){var t={descriptor:e};return Object.assign({},n,t)}function kL(n,e){var t={age:e};return Object.assign({},n,t)}function SL(n,e,t){var r={gender:e,genderProbability:t};return Object.assign({},n,r)}var TL=function(){function n(e){var t=e===void 0?{}:e,r=t.minFaceSize,i=t.scaleFactor,a=t.maxNumScales,s=t.scoreThresholds,o=t.scaleSteps;if(this._name="MtcnnOptions",this._minFaceSize=r||20,this._scaleFactor=i||.709,this._maxNumScales=a||10,this._scoreThresholds=s||[.6,.7,.7],this._scaleSteps=o,typeof this._minFaceSize!="number"||this._minFaceSize<0)throw new Error(this._name+" - expected minFaceSize to be a number > 0");if(typeof this._scaleFactor!="number"||this._scaleFactor<=0||this._scaleFactor>=1)throw new Error(this._name+" - expected scaleFactor to be a number between 0 and 1");if(typeof this._maxNumScales!="number"||this._maxNumScales<0)throw new Error(this._name+" - expected maxNumScales to be a number > 0");if(!Array.isArray(this._scoreThresholds)||this._scoreThresholds.length!==3||this._scoreThresholds.some(function(c){return typeof c!="number"}))throw new Error(this._name+" - expected scoreThresholds to be an array of numbers of length 3");if(this._scaleSteps&&(!Array.isArray(this._scaleSteps)||this._scaleSteps.some(function(c){return typeof c!="number"})))throw new Error(this._name+" - expected scaleSteps to be an array of numbers")}return Object.defineProperty(n.prototype,"minFaceSize",{get:function(){return this._minFaceSize},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"scaleFactor",{get:function(){return this._scaleFactor},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"maxNumScales",{get:function(){return this._maxNumScales},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"scoreThresholds",{get:function(){return this._scoreThresholds},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"scaleSteps",{get:function(){return this._scaleSteps},enumerable:!0,configurable:!0}),n}();function Uoe(n,e){function t(c,u){var l=Ma(n(9*c),[3,3,c,1]),d=Hr(n(c)),h=Hr(n(c)),p=Hr(n(c)),g=Hr(n(c));return e.push({paramPath:u+"/filters"},{paramPath:u+"/batch_norm_scale"},{paramPath:u+"/batch_norm_offset"},{paramPath:u+"/batch_norm_mean"},{paramPath:u+"/batch_norm_variance"}),{filters:l,batch_norm_scale:d,batch_norm_offset:h,batch_norm_mean:p,batch_norm_variance:g}}function r(c,u,l,d,h){var p=Ma(n(c*u*l*l),[l,l,c,u]),g=Hr(n(u));return e.push({paramPath:d+"/filters"},{paramPath:d+"/"+(h?"batch_norm_offset":"bias")}),{filters:p,bias:g}}function i(c,u,l,d){var h=r(c,u,l,d,!0),p=h.filters,g=h.bias;return{filters:p,batch_norm_offset:g}}function a(c,u,l){var d=t(c,l+"/depthwise_conv"),h=i(c,u,1,l+"/pointwise_conv");return{depthwise_conv:d,pointwise_conv:h}}function s(){var c=i(3,32,3,"mobilenetv1/conv_0"),u=a(32,64,"mobilenetv1/conv_1"),l=a(64,128,"mobilenetv1/conv_2"),d=a(128,128,"mobilenetv1/conv_3"),h=a(128,256,"mobilenetv1/conv_4"),p=a(256,256,"mobilenetv1/conv_5"),g=a(256,512,"mobilenetv1/conv_6"),v=a(512,512,"mobilenetv1/conv_7"),y=a(512,512,"mobilenetv1/conv_8"),b=a(512,512,"mobilenetv1/conv_9"),x=a(512,512,"mobilenetv1/conv_10"),S=a(512,512,"mobilenetv1/conv_11"),w=a(512,1024,"mobilenetv1/conv_12"),k=a(1024,1024,"mobilenetv1/conv_13");return{conv_0:c,conv_1:u,conv_2:l,conv_3:d,conv_4:h,conv_5:p,conv_6:g,conv_7:v,conv_8:y,conv_9:b,conv_10:x,conv_11:S,conv_12:w,conv_13:k}}function o(){var c=i(1024,256,1,"prediction_layer/conv_0"),u=i(256,512,3,"prediction_layer/conv_1"),l=i(512,128,1,"prediction_layer/conv_2"),d=i(128,256,3,"prediction_layer/conv_3"),h=i(256,128,1,"prediction_layer/conv_4"),p=i(128,256,3,"prediction_layer/conv_5"),g=i(256,64,1,"prediction_layer/conv_6"),v=i(64,128,3,"prediction_layer/conv_7"),y=r(512,12,1,"prediction_layer/box_predictor_0/box_encoding_predictor"),b=r(512,9,1,"prediction_layer/box_predictor_0/class_predictor"),x=r(1024,24,1,"prediction_layer/box_predictor_1/box_encoding_predictor"),S=r(1024,18,1,"prediction_layer/box_predictor_1/class_predictor"),w=r(512,24,1,"prediction_layer/box_predictor_2/box_encoding_predictor"),k=r(512,18,1,"prediction_layer/box_predictor_2/class_predictor"),E=r(256,24,1,"prediction_layer/box_predictor_3/box_encoding_predictor"),I=r(256,18,1,"prediction_layer/box_predictor_3/class_predictor"),P=r(256,24,1,"prediction_layer/box_predictor_4/box_encoding_predictor"),A=r(256,18,1,"prediction_layer/box_predictor_4/class_predictor"),N=r(128,24,1,"prediction_layer/box_predictor_5/box_encoding_predictor"),j=r(128,18,1,"prediction_layer/box_predictor_5/class_predictor"),L={box_encoding_predictor:y,class_predictor:b},B={box_encoding_predictor:x,class_predictor:S},V={box_encoding_predictor:w,class_predictor:k},X={box_encoding_predictor:E,class_predictor:I},ne={box_encoding_predictor:P,class_predictor:A},se={box_encoding_predictor:N,class_predictor:j};return{conv_0:c,conv_1:u,conv_2:l,conv_3:d,conv_4:h,conv_5:p,conv_6:g,conv_7:v,box_predictor_0:L,box_predictor_1:B,box_predictor_2:V,box_predictor_3:X,box_predictor_4:ne,box_predictor_5:se}}return{extractMobilenetV1Params:s,extractPredictionLayerParams:o}}function joe(n){var e=[],t=al(n),r=t.extractWeights,i=t.getRemainingWeights,a=Uoe(r,e),s=a.extractMobilenetV1Params,o=a.extractPredictionLayerParams,c=s(),u=o(),l=dS(r(5118*4),[1,5118,4]),d={extra_dim:l};if(e.push({paramPath:"output_layer/extra_dim"}),i().length!==0)throw new Error("weights remaing after extract: "+i().length);return{params:{mobilenetv1:c,prediction_layer:u,output_layer:d},paramMappings:e}}function qoe(n,e){var t=ud(n,e);function r(u,l,d){var h=t(u+"/Conv2d_"+l+"_pointwise/weights",4,d+"/filters"),p=t(u+"/Conv2d_"+l+"_pointwise/convolution_bn_offset",1,d+"/batch_norm_offset");return{filters:h,batch_norm_offset:p}}function i(u){var l="mobilenetv1/conv_"+u,d="MobilenetV1/Conv2d_"+u+"_depthwise",h=l+"/depthwise_conv",p=l+"/pointwise_conv",g=t(
3868d+"/depthwise_weights",4,h+"/filters"),v=t(d+"/BatchNorm/gamma",1,h+"/batch_norm_scale"),y=t(d+"/BatchNorm/beta",1,h+"/batch_norm_offset"),b=t(d+"/BatchNorm/moving_mean",1,h+"/batch_norm_mean"),x=t(d+"/BatchNorm/moving_variance",1,h+"/batch_norm_variance");return{depthwise_conv:{filters:g,batch_norm_scale:v,batch_norm_offset:y,batch_norm_mean:b,batch_norm_variance:x},pointwise_conv:r("MobilenetV1",u,p)}}function a(){return{conv_0:r("MobilenetV1",0,"mobilenetv1/conv_0"),conv_1:i(1),conv_2:i(2),conv_3:i(3),conv_4:i(4),conv_5:i(5),conv_6:i(6),conv_7:i(7),conv_8:i(8),conv_9:i(9),conv_10:i(10),conv_11:i(11),conv_12:i(12),conv_13:i(13)}}function s(u,l){var d=t(u+"/weights",4,l+"/filters"),h=t(u+"/biases",1,l+"/bias");return{filters:d,bias:h}}function o(u){var l=s("Prediction/BoxPredictor_"+u+"/BoxEncodingPredictor","prediction_layer/box_predictor_"+u+"/box_encoding_predictor"),d=s("Prediction/BoxPredictor_"+u+"/ClassPredictor","prediction_layer/box_predictor_"+u+"/class_predictor");return{box_encoding_predictor:l,class_predictor:d}}function c(){return{conv_0:r("Prediction",0,"prediction_layer/conv_0"),conv_1:r("Prediction",1,"prediction_layer/conv_1"),conv_2:r("Prediction",2,"prediction_layer/conv_2"),conv_3:r("Prediction",3,"prediction_layer/conv_3"),conv_4:r("Prediction",4,"prediction_layer/conv_4"),conv_5:r("Prediction",5,"prediction_layer/conv_5"),conv_6:r("Prediction",6,"prediction_layer/conv_6"),conv_7:r("Prediction",7,"prediction_layer/conv_7"),box_predictor_0:o(0),box_predictor_1:o(1),box_predictor_2:o(2),box_predictor_3:o(3),box_predictor_4:o(4),box_predictor_5:o(5)}}return{extractMobilenetV1Params:a,extractPredictionLayerParams:c}}function zoe(n){var e=[],t=qoe(n,e),r=t.extractMobilenetV1Params,i=t.extractPredictionLayerParams,a=n["Output/extra_dim"];if(e.push({originalPath:"Output/extra_dim",paramPath:"output_layer/extra_dim"}),!mb(a))throw new Error("expected weightMap['Output/extra_dim'] to be a Tensor3D, instead have "+a);var s={mobilenetv1:r(),prediction_layer:i(),output_layer:{extra_dim:a}};return il(n,e),{params:s,paramMappings:e}}function Ec(n,e,t){return Ze(function(){var r=yo(n,e.filters,t,"same");return r=Xt(r,e.batch_norm_offset),wS(r,0,6)})}var Woe=.0010000000474974513;function Hoe(n,e,t){return Ze(function(){var r=lb(n,e.filters,t,"same");return r=_N(r,e.batch_norm_mean,e.batch_norm_variance,e.batch_norm_offset,e.batch_norm_scale,Woe),wS(r,0,6)})}function Voe(n){return[2,4,6,12].some(function(e){return e===n})?[2,2]:[1,1]}function Goe(n,e){return Ze(function(){var t=null,r=Ec(n,e.conv_0,[2,2]),i=[e.conv_1,e.conv_2,e.conv_3,e.conv_4,e.conv_5,e.conv_6,e.conv_7,e.conv_8,e.conv_9,e.conv_10,e.conv_11,e.conv_12,e.conv_13];if(i.forEach(function(a,s){var o=s+1,c=Voe(o);r=Hoe(r,a.depthwise_conv,c),r=Ec(r,a.pointwise_conv,[1,1]),o===11&&(t=r)}),t===null)throw new Error("mobileNetV1 - output of conv layer 11 is null");return{out:r,conv11:t}})}function Koe(n,e,t,r,i){var a=n.shape[0],s=Math.min(t,a),o=e.map(function(l,d){return{score:l,boxIndex:d}}).filter(function(l){return l.score>i}).sort(function(l,d){return d.score-l.score}),c=function(l){return l<=r?1:0},u=[];return o.forEach(function(l){if(!(u.length>=s)){for(var d=l.score,h=u.length-1;h>=0;--h){var p=Yoe(n,l.boxIndex,u[h]);if(p!==0&&(l.score*=c(p),l.score<=i))break}d===l.score&&u.push(l.boxIndex)}}),u}function Yoe(n,e,t){var r=n.arraySync(),i=Math.min(r[e][0],r[e][2]),a=Math.min(r[e][1],r[e][3]),s=Math.max(r[e][0],r[e][2]),o=Math.max(r[e][1],r[e][3]),c=Math.min(r[t][0],r[t][2]),u=Math.min(r[t][1],r[t][3]),l=Math.max(r[t][0],r[t][2]),d=Math.max(r[t][1],r[t][3]),h=(s-i)*(o-a),p=(l-c)*(d-u);if(h<=0||p<=0)return 0;var g=Math.max(i,c),v=Math.max(a,u),y=Math.min(s,l),b=Math.min(o,d),x=Math.max(y-g,0)*Math.max(b-v,0);return x/(h+p-x)}function Xoe(n){var e=si(Jl(n,[1,0])),t=[ci(e[2],e[0]),ci(e[3],e[1])],r=[Xt(e[0],jo(t[0],Ke(2))),Xt(e[1],jo(t[1],Ke(2)))];return{sizes:t,centers:r}}function Joe(n,e){var t=Xoe(n),r=t.sizes,i=t.centers,a=si(Jl(e,[1,0])),s=jo(Ki(lk(jo(a[2],Ke(5))),r[0]),Ke(2)),o=Xt(Ki(jo(a[0],Ke(10)),r[0]),i[0]),c=jo(Ki(lk(jo(a[3],Ke(5))),r[1]),Ke(2)),u=Xt(Ki(jo(a[1],Ke(10)),r[1]),i[1]);return Jl(ws([ci(o,s),ci(u,c),Xt(o,s),Xt(u,c)]),[1,0])}function Qoe(n,e,t){return Ze(function(){var r=n.shape[0],i=Joe(Jo(Lh(t.extra_dim,[r,1,1]),[-1,4]),Jo(n,[-1,4]));i=Jo(i,[r,i.shape[0]/r,4]);var a=mN(Xc(e,[0,0,1],[-1,-1,-1])),s=Xc(a,[0,0,0],[-1,-1,1]);s=Jo(s,[r,s.shape[1]]);var o=si(i),c=si(s);return{boxes:o,scores:c}
3868})}function oh(n,e){return Ze(function(){var t=n.shape[0],r=Jo(nc(n,e.box_encoding_predictor),[t,-1,1,4]),i=Jo(nc(n,e.class_predictor),[t,-1,3]);return{boxPredictionEncoding:r,classPrediction:i}})}function Zoe(n,e,t){return Ze(function(){var r=Ec(n,t.conv_0,[1,1]),i=Ec(r,t.conv_1,[2,2]),a=Ec(i,t.conv_2,[1,1]),s=Ec(a,t.conv_3,[2,2]),o=Ec(s,t.conv_4,[1,1]),c=Ec(o,t.conv_5,[2,2]),u=Ec(c,t.conv_6,[1,1]),l=Ec(u,t.conv_7,[2,2]),d=oh(e,t.box_predictor_0),h=oh(n,t.box_predictor_1),p=oh(i,t.box_predictor_2),g=oh(s,t.box_predictor_3),v=oh(c,t.box_predictor_4),y=oh(l,t.box_predictor_5),b=ai([d.boxPredictionEncoding,h.boxPredictionEncoding,p.boxPredictionEncoding,g.boxPredictionEncoding,v.boxPredictionEncoding,y.boxPredictionEncoding],1),x=ai([d.classPrediction,h.classPrediction,p.classPrediction,g.classPrediction,v.classPrediction,y.classPrediction],1);return{boxPredictions:b,classPredictions:x}})}var _b=function(){function n(e){var t=e===void 0?{}:e,r=t.minConfidence,i=t.maxResults;if(this._name="SsdMobilenetv1Options",this._minConfidence=r||.5,this._maxResults=i||100,typeof this._minConfidence!="number"||this._minConfidence<=0||this._minConfidence>=1)throw new Error(this._name+" - expected minConfidence to be a number between 0 and 1");if(typeof this._maxResults!="number")throw new Error(this._name+" - expected maxResults to be a number")}return Object.defineProperty(n.prototype,"minConfidence",{get:function(){return this._minConfidence},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"maxResults",{get:function(){return this._maxResults},enumerable:!0,configurable:!0}),n}(),EL=function(n){Ot(e,n);function e(){return n.call(this,"SsdMobilenetv1")||this}return e.prototype.forwardInput=function(t){var r=this.params;if(!r)throw new Error("SsdMobilenetv1 - load model before inference");return Ze(function(){var i=t.toBatchTensor(512,!1).toFloat(),a=ci(Ki(i,Ke(.007843137718737125)),Ke(1)),s=Goe(a,r.mobilenetv1),o=Zoe(s.out,s.conv11,r.prediction_layer),c=o.boxPredictions,u=o.classPredictions;return Qoe(c,u,r.output_layer)})},e.prototype.forward=function(t){return dt(this,void 0,void 0,function(){var r;return ft(this,function(i){switch(i.label){case 0:return r=this.forwardInput,[4,vi(t)];case 1:return[2,r.apply(this,[i.sent()])]}})})},e.prototype.locateFaces=function(t,r){return r===void 0&&(r={}),dt(this,void 0,void 0,function(){var i,a,s,o,c,u,l,d,h,p,g,v,y,b,x,S,w,k,E,I,P;return ft(this,function(A){switch(A.label){case 0:return i=new _b(r),a=i.maxResults,s=i.minConfidence,[4,vi(t)];case 1:for(o=A.sent(),c=this.forwardInput(o),u=c.boxes,l=c.scores,d=u[0],h=l[0],p=1;p<u.length;p++)u[p].dispose(),l[p].dispose();return y=(v=Array).from,[4,h.data()];case 2:return g=y.apply(v,[A.sent()]),b=.5,x=Koe(d,g,a,b,s),S=o.getReshapedInputDimensions(0),w=o.inputSize,k=w/S.width,E=w/S.height,I=d.arraySync(),P=x.map(function(N){var j=[Math.max(0,I[N][0]),Math.min(1,I[N][2])].map(function(se){return se*E}),L=j[0],B=j[1],V=[Math.max(0,I[N][1]),Math.min(1,I[N][3])].map(function(se){return se*k}),X=V[0],ne=V[1];return new au(g[N],new BS(X,L,ne-X,B-L),{height:o.getInputHeight(0),width:o.getInputWidth(0)})}),d.dispose(),h.dispose(),[2,P]}})})},e.prototype.getDefaultModelName=function(){return"ssd_mobilenetv1_model"},e.prototype.extractParamsFromWeigthMap=function(t){return zoe(t)},e.prototype.extractParams=function(t){return joe(t)},e}(rl);(function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e})(EL);var ece=.4,tce=[new Cn(.738768,.874946),new Cn(2.42204,2.65704),new Cn(4.30971,7.04493),new Cn(10.246,4.59428),new Cn(12.6868,11.8741)],nce=[new Cn(1.603231,2.094468),new Cn(6.041143,7.080126),new Cn(2.882459,3.518061),new Cn(4.266906,5.178857),new Cn(9.041765,10.66308)],rce=[117.001,114.697,97.404],ice="tiny_yolov2_model",ace="tiny_yolov2_separable_conv_model",L0=function(n){return typeof n=="number"};function sce(n){if(!n)throw new Error("invalid config: "+n);if(typeof n.withSeparableConvs!="boolean")throw new Error("config.withSeparableConvs has to be a boolean, have: "+n.withSeparableConvs);if(!L0(n.iouThreshold)||n.iouThreshold<0||n.iouThreshold>1)throw new Error("config.iouThreshold has to be a number between [0, 1], have: "+n.iouThreshold);if(!Array.isArray(n.classes)||!n.classes.length||!n.classes.every(function(e){return typeof e=="string"}))throw new Error("config.classes has to be an array class names: string[], have: "+JSON.stringify(n.classes));if(!Array.isArray(n.anchors)||!n.anchors.length||!n.anchors.map(function(e){return e||{}}).every(function(e){return L0(e.x)&&L0(e.y)}))throw new Error("config.anchors has to be an array of { x: number, y: number }, have: "+JSON.stringify(n.anchors));if(n.meanRgb&&(!Array.isArray(n.meanRgb)||n.meanRgb.length!==3||!n.meanRgb.every(L0)))throw new Error("config.meanRgb has to be an array of shape [number, number, number], have: "+JSON.stringify(n.meanRgb))}function XS(n){return Ze(function(){var e=Ki(n,Ke(.10000000149011612));return Xt(vr(ci(n,e)),e)})}
3868function _l(n,e){return Ze(function(){var t=Rf(n,[[0,0],[1,1],[1,1],[0,0]]);return t=yo(t,e.conv.filters,[1,1],"valid"),t=ci(t,e.bn.sub),t=Ki(t,e.bn.truediv),t=Xt(t,e.conv.bias),XS(t)})}function bl(n,e){return Ze(function(){var t=Rf(n,[[0,0],[1,1],[1,1],[0,0]]);return t=TS(t,e.depthwise_filter,e.pointwise_filter,[1,1],"valid"),t=Xt(t,e.bias),XS(t)})}function oce(n,e){var t=yb(n,e);function r(s,o){var c=Hr(n(s)),u=Hr(n(s));return e.push({paramPath:o+"/sub"},{paramPath:o+"/truediv"}),{sub:c,truediv:u}}function i(s,o,c){var u=t(s,o,3,c+"/conv"),l=r(o,c+"/bn");return{conv:u,bn:l}}var a=VS(n,e);return{extractConvParams:t,extractConvWithBatchNormParams:i,extractSeparableConvParams:a}}function cce(n,e,t,r){var i=al(n),a=i.extractWeights,s=i.getRemainingWeights,o=[],c=oce(a,o),u=c.extractConvParams,l=c.extractConvWithBatchNormParams,d=c.extractSeparableConvParams,h;if(e.withSeparableConvs){var p=r[0],g=r[1],v=r[2],y=r[3],b=r[4],x=r[5],S=r[6],w=r[7],k=r[8],E=e.isFirstLayerConv2d?u(p,g,3,"conv0"):d(p,g,"conv0"),I=d(g,v,"conv1"),P=d(v,y,"conv2"),A=d(y,b,"conv3"),N=d(b,x,"conv4"),j=d(x,S,"conv5"),L=w?d(S,w,"conv6"):void 0,B=k?d(w,k,"conv7"):void 0,V=u(k||w||S,5*t,1,"conv8");h={conv0:E,conv1:I,conv2:P,conv3:A,conv4:N,conv5:j,conv6:L,conv7:B,conv8:V}}else{var p=r[0],g=r[1],v=r[2],y=r[3],b=r[4],x=r[5],S=r[6],w=r[7],k=r[8],E=l(p,g,"conv0"),I=l(g,v,"conv1"),P=l(v,y,"conv2"),A=l(y,b,"conv3"),N=l(b,x,"conv4"),j=l(x,S,"conv5"),L=l(S,w,"conv6"),B=l(w,k,"conv7"),V=u(k,5*t,1,"conv8");h={conv0:E,conv1:I,conv2:P,conv3:A,conv4:N,conv5:j,conv6:L,conv7:B,conv8:V}}if(s().length!==0)throw new Error("weights remaing after extract: "+s().length);return{params:h,paramMappings:o}}function uce(n,e){var t=ud(n,e);function r(o){var c=t(o+"/sub",1),u=t(o+"/truediv",1);return{sub:c,truediv:u}}function i(o){var c=t(o+"/filters",4),u=t(o+"/bias",1);return{filters:c,bias:u}}function a(o){var c=i(o+"/conv"),u=r(o+"/bn");return{conv:c,bn:u}}var s=GS(t);return{extractConvParams:i,extractConvWithBatchNormParams:a,extractSeparableConvParams:s}}function lce(n,e){var t=[],r=uce(n,t),i=r.extractConvParams,a=r.extractConvWithBatchNormParams,s=r.extractSeparableConvParams,o;if(e.withSeparableConvs){var c=e.filterSizes&&e.filterSizes.length||9;o={conv0:e.isFirstLayerConv2d?i("conv0"):s("conv0"),conv1:s("conv1"),conv2:s("conv2"),conv3:s("conv3"),conv4:s("conv4"),conv5:s("conv5"),conv6:c>7?s("conv6"):void 0,conv7:c>8?s("conv7"):void 0,conv8:i("conv8")}}else o={conv0:a("conv0"),conv1:a("conv1"),conv2:a("conv2"),conv3:a("conv3"),conv4:a("conv4"),conv5:a("conv5"),conv6:a("conv6"),conv7:a("conv7"),conv8:i("conv8")};return il(n,t),{params:o,paramMappings:t}}var iI;(function(n){n[n.XS=224]="XS",n[n.SM=320]="SM",n[n.MD=416]="MD",n[n.LG=608]="LG"})(iI||(iI={}));var JS=function(){function n(e){var t=e===void 0?{}:e,r=t.inputSize,i=t.scoreThreshold;if(this._name="TinyYolov2Options",this._inputSize=r||416,this._scoreThreshold=i||.5,typeof this._inputSize!="number"||this._inputSize%32!==0)throw new Error(this._name+" - expected inputSize to be a number divisible by 32");if(typeof this._scoreThreshold!="number"||this._scoreThreshold<=0||this._scoreThreshold>=1)throw new Error(this._name+" - expected scoreThreshold to be a number between 0 and 1")}return Object.defineProperty(n.prototype,"inputSize",{get:function(){return this._inputSize},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"scoreThreshold",{get:function(){return this._scoreThreshold},enumerable:!0,configurable:!0}),n}(),PL=function(n){Ot(e,n);function e(t){var r=n.call(this,"TinyYolov2")||this;return sce(t),r._config=t,r}return Object.defineProperty(e.prototype,"config",{get:function(){return this._config},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"withClassScores",{get:function(){return this.config.withClassScores||this.config.classes.length>1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"boxEncodingSize",{get:function(){return 5+(this.withClassScores?this.config.classes.length:0)},enumerable:!0,configurable:!0}),e.prototype.runTinyYolov2=function(t,r){var i=_l(t,r.conv0);return i=di(i,[2,2],[2,2],"same"),i=_l(i,r.conv1),i=di(i,[2,2],[2,2],"same"),i=_l(i,r.conv2),i=di(i,[2,2],[2,2],"same"),i=_l(i,r.conv3),i=di(i,[2,2],[2,2],"same"),i=_l(i,r.conv4),i=di(i,[2,2],[2,2],"same"),i=_l(i,r.conv5),i=di(i,[2,2],[1,1],"same"),i=_l(i,r.conv6),i=_l(i,r.conv7),nc(i,r.conv8,"valid",!1)},e.prototype.runMobilenet=function(t,r){var i=this.config.isFirstLayerConv2d?XS(nc(t,r.conv0,"valid",!1)):bl(t,r.conv0);return i=di(i,[2,2],[2,2],"same"),i=bl(i,r.conv1),i=di(i,[2,2],[2,2],"same"),i=bl(i,r.conv2),i=di(i,[2,2],[2,2],"same"),i=bl(i,r.conv3),i=di(i,[2,2],[2,2],"same"),i=bl(i,r.conv4),i=di(i,[2,2],[2,2],"same"),i=bl(i,r.conv5),i=di(i,[2,2],[1,1],"same"),i=r.conv6?bl(i,r.conv6):i,i=r.conv7?bl(i,r.conv7):i,nc(i,r.conv8,"valid",!1)},e.prototype.forwardInput=function(t,r){var i=this,a=this.params;if(!a)throw new Error("TinyYolov2 - load model before inference");
3868return Ze(function(){var s=t.toBatchTensor(r,!1).toFloat();return s=i.config.meanRgb?dv(s,i.config.meanRgb):s,s=s.div(Ke(256)),i.config.withSeparableConvs?i.runMobilenet(s,a):i.runTinyYolov2(s,a)})},e.prototype.forward=function(t,r){return dt(this,void 0,void 0,function(){var i;return ft(this,function(a){switch(a.label){case 0:return i=this.forwardInput,[4,vi(t)];case 1:return[4,i.apply(this,[a.sent(),r])];case 2:return[2,a.sent()]}})})},e.prototype.detect=function(t,r){return r===void 0&&(r={}),dt(this,void 0,void 0,function(){var i,a,s,o,c,u,l,d,h,p,g,v,y,b,x=this;return ft(this,function(S){switch(S.label){case 0:return i=new JS(r),a=i.inputSize,s=i.scoreThreshold,[4,vi(t)];case 1:return o=S.sent(),[4,this.forwardInput(o,a)];case 2:return c=S.sent(),u=Ze(function(){return si(c)[0].expandDims()}),l={width:o.getInputWidth(0),height:o.getInputHeight(0)},[4,this.extractBoxes(u,o.getReshapedInputDimensions(0),s)];case 3:return d=S.sent(),c.dispose(),u.dispose(),h=d.map(function(w){return w.box}),p=d.map(function(w){return w.score}),g=d.map(function(w){return w.classScore}),v=d.map(function(w){return x.config.classes[w.label]}),y=Tg(h.map(function(w){return w.rescale(a)}),p,this.config.iouThreshold,!0),b=y.map(function(w){return new ZN(p[w],g[w],v[w],h[w],l)}),[2,b]}})})},e.prototype.getDefaultModelName=function(){return""},e.prototype.extractParamsFromWeigthMap=function(t){return lce(t,this.config)},e.prototype.extractParams=function(t){var r=this.config.filterSizes||e.DEFAULT_FILTER_SIZES,i=r?r.length:void 0;if(i!==7&&i!==8&&i!==9)throw new Error("TinyYolov2 - expected 7 | 8 | 9 convolutional filters, but found "+i+" filterSizes in config");return cce(t,this.config,this.boxEncodingSize,r)},e.prototype.extractBoxes=function(t,r,i){return dt(this,void 0,void 0,function(){var a,s,o,c,u,l,d,h,p,g,v,y,b,x,S,w,k,E,I,P,A,N,j,L,B,V,X,ne,se,ie=this;return ft(this,function(de){switch(de.label){case 0:return a=r.width,s=r.height,o=Math.max(a,s),c=o/a,u=o/s,l=t.shape[1],d=this.config.anchors.length,h=Ze(function(){var ue=t.reshape([l,l,d,ie.boxEncodingSize]),Ce=ue.slice([0,0,0,0],[l,l,d,4]),we=ue.slice([0,0,0,4],[l,l,d,1]),Fe=ie.withClassScores?tl(ue.slice([0,0,0,5],[l,l,d,ie.config.classes.length]),3):Ke(0);return[Ce,we,Fe]}),p=h[0],g=h[1],v=h[2],y=[],[4,g.array()];case 1:return b=de.sent(),[4,p.array()];case 2:x=de.sent(),S=0,de.label=3;case 3:if(!(S<l))return[3,12];w=0,de.label=4;case 4:if(!(w<l))return[3,11];k=0,de.label=5;case 5:return k<d?(E=Mw(b[S][w][k][0]),!i||E>i?(I=(w+Mw(x[S][w][k][0]))/l*c,P=(S+Mw(x[S][w][k][1]))/l*u,A=Math.exp(x[S][w][k][2])*this.config.anchors[k].x/l*c,N=Math.exp(x[S][w][k][3])*this.config.anchors[k].y/l*u,j=I-A/2,L=P-N/2,B={row:S,col:w,anchor:k},this.withClassScores?[4,this.extractPredictedClass(v,B)]:[3,7]):[3,9]):[3,10];case 6:return se=de.sent(),[3,8];case 7:se={classScore:1,label:0},de.label=8;case 8:V=se,X=V.classScore,ne=V.label,y.push(zi({box:new gb(j,L,j+A,L+N),score:E,classScore:E*X,label:ne},B)),de.label=9;case 9:return k++,[3,5];case 10:return w++,[3,4];case 11:return S++,[3,3];case 12:return p.dispose(),g.dispose(),v.dispose(),[2,y]}})})},e.prototype.extractPredictedClass=function(t,r){return dt(this,void 0,void 0,function(){var i,a,s,o;return ft(this,function(c){switch(c.label){case 0:return i=r.row,a=r.col,s=r.anchor,[4,t.array()];case 1:return o=c.sent(),[2,Array(this.config.classes.length).fill(0).map(function(u,l){return o[i][a][s][l]}).map(function(u,l){return{classScore:u,label:l}}).reduce(function(u,l){return u.classScore>l.classScore?u:l})]}})})},e.DEFAULT_FILTER_SIZES=[3,16,32,64,128,256,512,1024,1024],e}(rl),dce=function(n){Ot(e,n);function e(t){t===void 0&&(t=!0);var r=this,i=Object.assign({},{withSeparableConvs:t,iouThreshold:ece,classes:["face"]},t?{anchors:nce,meanRgb:rce}:{anchors:tce,withClassScores:!0});return r=n.call(this,i)||this,r}return Object.defineProperty(e.prototype,"withSeparableConvs",{get:function(){return this.config.withSeparableConvs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"anchors",{get:function(){return this.config.anchors},enumerable:!0,configurable:!0}),e.prototype.locateFaces=function(t,r){return dt(this,void 0,void 0,function(){var i;return ft(this,function(a){switch(a.label){case 0:return[4,this.detect(t,r)];case 1:return i=a.sent(),[2,i.map(function(s){return new au(s.score,s.relativeBox,{width:s.imageWidth,height:s.imageHeight})})]}})})},e.prototype.getDefaultModelName=function(){return this.withSeparableConvs?ace:ice},e.prototype.extractParamsFromWeigthMap=function(t){return n.prototype.extractParamsFromWeigthMap.call(this,t)},e}(PL),fce=function(n){Ot(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._name="TinyFaceDetectorOptions",t}return e}
3868(JS),hv=function(){function n(){}return n.prototype.then=function(e){return dt(this,void 0,void 0,function(){var t;return ft(this,function(r){switch(r.label){case 0:return t=e,[4,this.run()];case 1:return[2,t.apply(void 0,[r.sent()])]}})})},n.prototype.run=function(){return dt(this,void 0,void 0,function(){return ft(this,function(e){throw new Error("ComposableTask - run is not implemented")})})},n}();function bb(n,e,t,r,i){return i===void 0&&(i=function(a){var s=a.alignedRect;return s}),dt(this,void 0,void 0,function(){var a,s,o,c,u;return ft(this,function(l){switch(l.label){case 0:return a=n.map(function(d){return _oe(d)?i(d):d.detection}),o=r,o?[3,5]:e instanceof mr?[4,WS(e,a)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,zS(e,a)];case 3:c=l.sent(),l.label=4;case 4:o=c,l.label=5;case 5:return s=o,[4,t(s)];case 6:return u=l.sent(),s.forEach(function(d){return d instanceof mr&&d.dispose()}),[2,u]}})})}function QS(n,e,t,r,i){return dt(this,void 0,void 0,function(){var a=this;return ft(this,function(s){return[2,bb([n],e,function(o){return dt(a,void 0,void 0,function(){return ft(this,function(c){return[2,t(o[0])]})})},r,i)]})})}function hce(n){return Ze(function(){return ws(si(n,3).reverse(),3)})}var F0=2,v_=12;function pce(n,e){var t=yb(n,e),r=HS(n,e);function i(u,l){var d=Hr(n(u));return e.push({paramPath:l}),d}function a(u,l,d){d===void 0&&(d=!1);var h=t(u[0],u[1],3,l+"/conv1"),p=i(u[1],l+"/prelu1_alpha"),g=t(u[1],u[2],3,l+"/conv2"),v=i(u[2],l+"/prelu2_alpha"),y=t(u[2],u[3],d?2:3,l+"/conv3"),b=i(u[3],l+"/prelu3_alpha");return{conv1:h,prelu1_alpha:p,conv2:g,prelu2_alpha:v,conv3:y,prelu3_alpha:b}}function s(){var u=a([3,10,16,32],"pnet"),l=t(32,2,1,"pnet/conv4_1"),d=t(32,4,1,"pnet/conv4_2");return zi(zi({},u),{conv4_1:l,conv4_2:d})}function o(){var u=a([3,28,48,64],"rnet",!0),l=r(576,128,"rnet/fc1"),d=i(128,"rnet/prelu4_alpha"),h=r(128,2,"rnet/fc2_1"),p=r(128,4,"rnet/fc2_2");return zi(zi({},u),{fc1:l,prelu4_alpha:d,fc2_1:h,fc2_2:p})}function c(){var u=a([3,32,64,64],"onet"),l=t(64,128,2,"onet/conv4"),d=i(128,"onet/prelu4_alpha"),h=r(1152,256,"onet/fc1"),p=i(256,"onet/prelu5_alpha"),g=r(256,2,"onet/fc2_1"),v=r(256,4,"onet/fc2_2"),y=r(256,10,"onet/fc2_3");return zi(zi({},u),{conv4:l,prelu4_alpha:d,fc1:h,prelu5_alpha:p,fc2_1:g,fc2_2:v,fc2_3:y})}return{extractPNetParams:s,extractRNetParams:o,extractONetParams:c}}function mce(n){var e=al(n),t=e.extractWeights,r=e.getRemainingWeights,i=[],a=pce(t,i),s=a.extractPNetParams,o=a.extractRNetParams,c=a.extractONetParams,u=s(),l=o(),d=c();if(r().length!==0)throw new Error("weights remaing after extract: "+r().length);return{params:{pnet:u,rnet:l,onet:d},paramMappings:i}}function gce(n,e){var t=ud(n,e);function r(l){var d=t(l+"/weights",4,l+"/filters"),h=t(l+"/bias",1);return{filters:d,bias:h}}function i(l){var d=t(l+"/weights",2),h=t(l+"/bias",1);return{weights:d,bias:h}}function a(l){return t(l,1)}function s(l){var d=r(l+"/conv1"),h=a(l+"/prelu1_alpha"),p=r(l+"/conv2"),g=a(l+"/prelu2_alpha"),v=r(l+"/conv3"),y=a(l+"/prelu3_alpha");return{conv1:d,prelu1_alpha:h,conv2:p,prelu2_alpha:g,conv3:v,prelu3_alpha:y}}function o(){var l=s("pnet"),d=r("pnet/conv4_1"),h=r("pnet/conv4_2");return zi(zi({},l),{conv4_1:d,conv4_2:h})}function c(){var l=s("rnet"),d=i("rnet/fc1"),h=a("rnet/prelu4_alpha"),p=i("rnet/fc2_1"),g=i("rnet/fc2_2");return zi(zi({},l),{fc1:d,prelu4_alpha:h,fc2_1:p,fc2_2:g})}function u(){var l=s("onet"),d=r("onet/conv4"),h=a("onet/prelu4_alpha"),p=i("onet/fc1"),g=a("onet/prelu5_alpha"),v=i("onet/fc2_1"),y=i("onet/fc2_2"),b=i("onet/fc2_3");return zi(zi({},l),{conv4:d,prelu4_alpha:h,fc1:p,prelu5_alpha:g,fc2_1:v,fc2_2:y,fc2_3:b})}return{extractPNetParams:o,extractRNetParams:c,extractONetParams:u}}function vce(n){var e=[],t=gce(n,e),r=t.extractPNetParams,i=t.extractRNetParams,a=t.extractONetParams,s=r(),o=i(),c=a();return il(n,e),{params:{pnet:s,rnet:o,onet:c},paramMappings:e}}function yk(n,e){var t=e[0],r=e[1];return{height:Math.floor(t*n),width:Math.floor(r*n)}}function yce(n,e,t){for(var r=t[0],i=t[1],a=v_/n,s=[],o=Math.min(r,i)*a,c=0;o>=12;)s.push(a*Math.pow(e,c)),o=o*e,c+=1;return s}var ZS=function(n){Ot(e,n);function e(t,r,i,a){return n.call(this,{left:t,top:r,right:i,bottom:a},!0)||this}return e}(Ql);function RL(n){return Ze(function(){return Ki(ci(n,Ke(127.5)),Ke(.0078125))})}function qh(n,e){return Ze(function(){return Xt(vr(n),Ki(e,l_(vr(l_(n)))))})}function eT(n,e,t){return t===void 0&&(t=!1),Ze(function(){var r=nc(n,e.conv1,"valid");return r=qh(r,e.prelu1_alpha),r=di(r,t?[2,2]:[3,3],[2,2],"same"),r=nc(r,e.conv2,"valid"),r=qh(r,e.prelu2_alpha),r=t?r:di(r,[3,3],[2,2],"valid"),r=nc(r,e.conv3,"valid"),r=qh(r,e.prelu3_alpha),r})}function _ce(n,e){return Ze(function(){var t=eT(n,e,!0),r=nc(t,e.conv4_1,"valid"),i=ao(fb(r,3),3),a=tl(ci(r,i),3),s=nc(t,e.conv4_2,"valid");return{prob:a,regions:s}})}function bce(n,e){return Ze(function(){var t=yk(e,n.shape.slice(1)),r=t.height,i=t.width,a=IS.resizeBilinear(n,[r,i]),s=RL(a);return Jl(s,[0,2,1,3])})}function xce(n,e,t,r){for(var i=[],a=n.arraySync(),s=0;s<n.shape[0];s++)for(var o=0;o<n.shape[1];o++)a[s][o]>=r&&i.push(new Cn(o,s));var c=i.map(function(u){var l=new gb(Math.round((u.y*F0+1)/t),Math.round((u.x*F0+1)/t),Math.round((u.y*F0+v_)/t),Math.round((u.x*F0+v_)/t)),d=a[u.y][u.x],h=e.arraySync(),p=new ZS(h[u.y][u.x][0],h[u.y][u.x][1],h[u.y][u.x][2],h[u.y][u.x][3]);return{cell:l,score:d,region:p}});return c}function wce(n,e,t,r,i){i.stage1=[];var a=e.map(function(h){return Ze(function(){var p={scale:h},g=bce(n,h),v=Date.now(),y=_ce(g,r),b=y.prob,x=y.regions;p.pnet=Date.now()-v;var S=si(si(b,3)[1])[0],w=si(x)[0];return{scoresTensor:S,regionsTensor:w,scale:h,statsForScale:p}})}),s=a.map(function(h){var p=h.scoresTensor,g=h.regionsTensor,v=h.scale,y=h.statsForScale,b=xce(p,g,v,t);if(p.dispose(),g.dispose(),!b.length)return i.stage1.push(y),[];var x=Date.now(),S=Tg(b.map(function(w){return w.cell}),b.map(function(w){return w.score}),.5);return y.nms=Date.now()-x,y.numBoxes=S.length,i.stage1.push(y),S.map(function(w){return b[w]})}),o=s.reduce(function(h,p){return h.concat(p)},[]),c=[],u=[];
3868if(o.length>0){var l=Date.now(),d=Tg(o.map(function(h){return h.cell}),o.map(function(h){return h.score}),.7);i.stage1_nms=Date.now()-l,u=d.map(function(h){return o[h].score}),c=d.map(function(h){return o[h]}).map(function(h){var p=h.cell,g=h.region;return new gb(p.left+g.left*p.width,p.top+g.top*p.height,p.right+g.right*p.width,p.bottom+g.bottom*p.height).toSquare().round()})}return{boxes:c,scores:u}}function AL(n,e,t){var r=t.width,i=t.height;return dt(this,void 0,void 0,function(){var a,s,o,c=this;return ft(this,function(u){switch(u.label){case 0:return a=_f(n),[4,Promise.all(e.map(function(l){return dt(c,void 0,void 0,function(){var d,h,p,g,v,y,b,x;return ft(this,function(S){return d=l.padAtBorders(n.height,n.width),h=d.y,p=d.ey,g=d.x,v=d.ex,y=g-1,b=h-1,x=a.getImageData(y,b,v-y,p-b),[2,Mi.isNodejs()?fv(x):createImageBitmap(x)]})})}))];case 1:return s=u.sent(),o=[],s.forEach(function(l){var d=vb({width:r,height:i}),h=_f(d);h.drawImage(l,0,0,r,i);for(var p=h.getImageData(0,0,r,i).data,g=[],v=0;v<p.length;v+=4)g.push(p[v+2]),g.push(p[v+1]),g.push(p[v]);o.push(g)}),[2,o.map(function(l){var d=Ze(function(){var h=Jl(Ma(l,[1,r,i,3]),[0,2,1,3]).toFloat();return RL(h)});return d})]}})})}function Cce(n,e){return Ze(function(){var t=eT(n,e),r=Jo(t,[t.shape[0],e.fc1.weights.shape[0]]),i=Bc(r,e.fc1),a=qh(i,e.prelu4_alpha),s=Bc(a,e.fc2_1),o=ao(fb(s,1),1),c=tl(ci(s,o),1),u=Bc(a,e.fc2_2),l=si(c,1)[1];return{scores:l,regions:u}})}function kce(n,e,t,r,i){return dt(this,void 0,void 0,function(){var a,s,o,c,u,l,d,h,p,g,v,y,b,x;return ft(this,function(S){switch(S.label){case 0:return a=Date.now(),[4,AL(n,e,{width:24,height:24})];case 1:return s=S.sent(),i.stage2_extractImagePatches=Date.now()-a,a=Date.now(),o=s.map(function(w){var k=Cce(w,r);return w.dispose(),k}),i.stage2_rnet=Date.now()-a,c=o.length>1?ai(o.map(function(w){return w.scores})):o[0].scores,d=(l=Array).from,[4,c.data()];case 2:return u=d.apply(l,[S.sent()]),c.dispose(),h=u.map(function(w,k){return{score:w,idx:k}}).filter(function(w){return w.score>t}).map(function(w){var k=w.idx;return k}),p=h.map(function(w){return e[w]}),g=h.map(function(w){return u[w]}),v=[],y=[],p.length>0&&(a=Date.now(),b=Tg(p,g,.7),i.stage2_nms=Date.now()-a,x=b.map(function(w){var k=o[h[w]].regions.arraySync();return new ZS(k[0][0],k[0][1],k[0][2],k[0][3])}),y=b.map(function(w){return g[w]}),v=b.map(function(w,k){return p[w].calibrate(x[k])})),o.forEach(function(w){w.regions.dispose(),w.scores.dispose()}),[2,{boxes:v,scores:y}]}})})}function Sce(n,e){return Ze(function(){var t=eT(n,e);t=di(t,[2,2],[2,2],"same"),t=nc(t,e.conv4,"valid"),t=qh(t,e.prelu4_alpha);var r=Jo(t,[t.shape[0],e.fc1.weights.shape[0]]),i=Bc(r,e.fc1),a=qh(i,e.prelu5_alpha),s=Bc(a,e.fc2_1),o=ao(fb(s,1),1),c=tl(ci(s,o),1),u=Bc(a,e.fc2_2),l=Bc(a,e.fc2_3),d=si(c,1)[1];return{scores:d,regions:u,points:l}})}function Tce(n,e,t,r,i){return dt(this,void 0,void 0,function(){var a,s,o,c,u,l,d,h,p,g,v,y,b,x,S;return ft(this,function(w){switch(w.label){case 0:return a=Date.now(),[4,AL(n,e,{width:48,height:48})];case 1:return s=w.sent(),i.stage3_extractImagePatches=Date.now()-a,a=Date.now(),o=s.map(function(k){var E=Sce(k,r);return k.dispose(),E}),i.stage3_onet=Date.now()-a,c=o.length>1?ai(o.map(function(k){return k.scores})):o[0].scores,d=(l=Array).from,[4,c.data()];case 2:return u=d.apply(l,[w.sent()]),c.dispose(),h=u.map(function(k,E){return{score:k,idx:E}}).filter(function(k){return k.score>t}).map(function(k){var E=k.idx;return E}),p=h.map(function(k){var E=o[k].regions.arraySync();return new ZS(E[0][0],E[0][1],E[0][2],E[0][3])}),g=h.map(function(k,E){return e[k].calibrate(p[E])}),v=h.map(function(k){return u[k]}),y=[],b=[],x=[],g.length>0&&(a=Date.now(),S=Tg(g,v,.7,!1),i.stage3_nms=Date.now()-a,y=S.map(function(k){return g[k]}),b=S.map(function(k){return v[k]}),x=S.map(function(k,E){return Array(5).fill(0).map(function(I,P){var A=o[k].points.arraySync();return new Cn(A[0][P]*(y[E].width+1)+y[E].left,A[0][P+5]*(y[E].height+1)+y[E].top)})})),o.forEach(function(k){k.regions.dispose(),k.scores.dispose(),k.points.dispose()}),[2,{boxes:y,scores:b,points:x}]}})})}var Ece=function(n){Ot(e,n);function e(){return n.call(this,"Mtcnn")||this}return e.prototype.load=function(t){return dt(this,void 0,void 0,function(){return ft(this,function(r){return console.warn("mtcnn is deprecated and will be removed soon"),[2,n.prototype.load.call(this,t)]})})},e.prototype.loadFromDisk=function(t){return dt(this,void 0,void 0,function(){return ft(this,function(r){return console.warn("mtcnn is deprecated and will be removed soon"),[2,n.prototype.loadFromDisk.call(this,t)]})})},e.prototype.forwardInput=function(t,r){return r===void 0&&(r={}),dt(this,void 0,void 0,function(){var i,a,s,o,c,u,l,d,h,p,g,v,y,b,x,S,w,k,E,I,P;return ft(this,function(A){switch(A.label){case 0:if(i=this.params,!i)throw new Error("Mtcnn - load model before inference");if(a=t.canvases[0],!a)throw new Error("Mtcnn - inputCanvas is not defined, note that passing tensors into Mtcnn.forwardInput is not supported yet.");return s={},o=Date.now(),c=Ze(function(){return hce(ao(FS.fromPixels(a)).toFloat
vendor: 9,093 bytes, line 3868
3868())}),u=function(N){return c.dispose(),s.total=Date.now()-o,N},l=c.shape.slice(1),d=l[0],h=l[1],p=new TL(r),g=p.minFaceSize,v=p.scaleFactor,y=p.maxNumScales,b=p.scoreThresholds,x=p.scaleSteps,S=(x||yce(g,v,[d,h])).filter(function(N){var j=yk(N,[d,h]);return Math.min(j.width,j.height)>v_}).slice(0,y),s.scales=S,s.pyramid=S.map(function(N){return yk(N,[d,h])}),w=Date.now(),[4,wce(c,S,b[0],i.pnet,s)];case 1:return k=A.sent(),s.total_stage1=Date.now()-w,k.boxes.length?(s.stage2_numInputBoxes=k.boxes.length,w=Date.now(),[4,kce(a,k.boxes,b[1],i.rnet,s)]):[2,u({results:[],stats:s})];case 2:return E=A.sent(),s.total_stage2=Date.now()-w,E.boxes.length?(s.stage3_numInputBoxes=E.boxes.length,w=Date.now(),[4,Tce(a,E.boxes,b[2],i.onet,s)]):[2,u({results:[],stats:s})];case 3:return I=A.sent(),s.total_stage3=Date.now()-w,P=I.boxes.map(function(N,j){return KS(US({},new au(I.scores[j],new BS(N.left/h,N.top/d,N.width/h,N.height/d),{height:d,width:h})),new noe(I.points[j].map(function(L){return L.sub(new Cn(N.left,N.top)).div(new Cn(N.width,N.height))}),{width:N.width,height:N.height}))}),[2,u({results:P,stats:s})]}})})},e.prototype.forward=function(t,r){return r===void 0&&(r={}),dt(this,void 0,void 0,function(){var i;return ft(this,function(a){switch(a.label){case 0:return i=this.forwardInput,[4,vi(t)];case 1:return[4,i.apply(this,[a.sent(),r])];case 2:return[2,a.sent().results]}})})},e.prototype.forwardWithStats=function(t,r){return r===void 0&&(r={}),dt(this,void 0,void 0,function(){var i;return ft(this,function(a){switch(a.label){case 0:return i=this.forwardInput,[4,vi(t)];case 1:return[2,i.apply(this,[a.sent(),r])]}})})},e.prototype.getDefaultModelName=function(){return"mtcnn_model"},e.prototype.extractParamsFromWeigthMap=function(t){return vce(t)},e.prototype.extractParams=function(t){return mce(t)},e}(rl),Pce=.4,Rce=[new Cn(1.603231,2.094468),new Cn(6.041143,7.080126),new Cn(2.882459,3.518061),new Cn(4.266906,5.178857),new Cn(9.041765,10.66308)],Ace=[117.001,114.697,97.404],Ice=function(n){Ot(e,n);function e(){var t=this,r={withSeparableConvs:!0,iouThreshold:Pce,classes:["face"],anchors:Rce,meanRgb:Ace,isFirstLayerConv2d:!0,filterSizes:[3,16,32,64,128,256,512]};return t=n.call(this,r)||this,t}return Object.defineProperty(e.prototype,"anchors",{get:function(){return this.config.anchors},enumerable:!0,configurable:!0}),e.prototype.locateFaces=function(t,r){return dt(this,void 0,void 0,function(){var i;return ft(this,function(a){switch(a.label){case 0:return[4,this.detect(t,r)];case 1:return i=a.sent(),[2,i.map(function(s){return new au(s.score,s.relativeBox,{width:s.imageWidth,height:s.imageHeight})})]}})})},e.prototype.getDefaultModelName=function(){return"tiny_face_detector_model"},e.prototype.extractParamsFromWeigthMap=function(t){return n.prototype.extractParamsFromWeigthMap.call(this,t)},e}(PL),Nr={ssdMobilenetv1:new EL,tinyFaceDetector:new Ice,tinyYolov2:new dce,mtcnn:new Ece,faceLandmark68Net:new bL,faceLandmark68TinyNet:new Ooe,faceRecognitionNet:new Boe,faceExpressionNet:new yoe,ageGenderNet:new Poe},IL=function(n){Ot(e,n);function e(t,r,i){var a=n.call(this)||this;return a.parentTask=t,a.input=r,a.extractedFaces=i,a}return e}(hv),tT=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.run=function(){return dt(this,void 0,void 0,function(){var t,r,i=this;return ft(this,function(a){switch(a.label){case 0:return[4,this.parentTask];case 1:return t=a.sent(),[4,bb(t,this.input,function(s){return dt(i,void 0,void 0,function(){return ft(this,function(o){switch(o.label){case 0:return[4,Promise.all(s.map(function(c){return Nr.faceExpressionNet.predictExpressions(c)}))];case 1:return[2,o.sent()]}})})},this.extractedFaces)];case 2:return r=a.sent(),[2,t.map(function(s,o){return vL(s,r[o])})]}})})},e.prototype.withAgeAndGender=function(){return new aT(this,this.input)},e}(IL),nT=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.run=function(){return dt(this,void 0,void 0,function(){var t,r;return ft(this,function(i){switch(i.label){case 0:return[4,this.parentTask];case 1:return t=i.sent(),t?[4,QS(t,this.input,function(a){return Nr.faceExpressionNet.predictExpressions(a)},this.extractedFaces)]:[2];case 2:return r=i.sent(),[2,vL(t,r)]}})})},e.prototype.withAgeAndGender=function(){return new sT(this,this.input)},e}(IL),rT=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.withAgeAndGender=function(){return new oT(this,this.input)},e.prototype.withFaceDescriptors=function(){return new uT(this,this.input)},e}(tT),iT=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.withAgeAndGender=function(){return new cT(this,this.input)},e.prototype.withFaceDescriptor=function(){return new lT(this,this.input)},e}(nT),OL=function(n){Ot(e,n);function e(t,r,i){var a=n.call(this)||this;return a.parentTask=t,a.input=r,a.extractedFaces=i,a}return e}(hv),aT=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.run=function(){return dt(this,void 0,void 0,function(){var t,r,i=this;return ft(this,function(a){switch(a.label){case 0:return[4,this.parentTask];case 1:return t=a.sent(),[4,bb(t,this.input,function(s){return dt(i,void 0,void 0,function(){return ft(this,function(o){switch(o.label){case 0:return[4,Promise.all(s.map(function(c){return Nr.ageGenderNet.predictAgeAndGender(c)}))];case 1:return[2,o.sent()]}})})},this.extractedFaces)];case 2:return r=a.sent(),[2,t.map(function(s,o){var c=r[o],u=c.age,l=c.gender,d=c.genderProbability;return kL(SL(s,l,d),u)})]}})})},e.prototype.withFaceExpressions=function(){return new tT(this,this.input)},e}(OL),sT=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.run=function(){return dt(this,void 0,void 0,function(){var t,r,i,a,s;return ft(this,function(o){switch(o.label){case 0:return[4,this.parentTask];case 1:return t=o.sent(),t?[4,QS(t,this.input,function(c){return Nr.ageGenderNet.predictAgeAndGender(c)},this.extractedFaces)]:[2];case 2:return r=o.sent(),i=r.age,a=r.gender,s=r.genderProbability,[2,kL(SL(t,a,s),i)]}})})},e.prototype.withFaceExpressions=function(){return new nT(this,this.input)},e}(OL),oT=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.withFaceExpressions=function(){return new rT(this,this.input)},e.prototype.withFaceDescriptors=function(){return new uT(this,this.input)},e}(aT),cT=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.withFaceExpressions=function(){return new iT(this,this.input)},e.prototype.withFaceDescriptor=function(){return new lT(this,this.input)},e}(sT),ML=function(n){Ot(e,n);function e(t,r){var i=n.call(this)||this;return i.parentTask=t,i.input=r,i}return e}(hv),uT=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.run=function(){return dt(this,void 0,void 0,function(){var t,r;return ft(this,function(i){switch(i.label){case 0:return[4,this.parentTask];case 1:return t=i.sent(),[4,bb(t,this.input,function(a){return Promise.all(a.map(function(s){return Nr.faceRecognitionNet.computeFaceDescriptor(s)}))},null,function(a){return a.landmarks.align(null,{useDlibAlignment:!0})})];case 2:return r=i.sent(),[2,r.map(function(a,s){return CL(t[s],a)})]}})})},e.prototype.withFaceExpressions=function(){return new rT(this,this.input)},e.prototype.withAgeAndGender=function(){return new oT(this,this.input)},e}(ML),lT=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.run=function(){return dt(this,void 0,void 0,function(){var t,r;return ft(this,function(i){switch(i.label){case 0:return[4,this.parentTask];case 1:return t=i.sent(),t?[4,QS(t,this.input,function(a){return Nr.faceRecognitionNet.computeFaceDescriptor(a)},null,function(a){return a.landmarks.align(null,{useDlibAlignment:!0})})]:[2];case 2:return r=i.sent(),[2,CL(t,r)]}})})},e.prototype.withFaceExpressions=function(){return new iT(this,this.input)},e.prototype.withAgeAndGender=function(){return new cT(this,this.input)},e}(ML),DL=function(n){Ot(e,n);function e(t,r,i){var a=n.call(this)||this;return a.parentTask=t,a.input=r,a.useTinyLandmarkNet=i,a}return Object.defineProperty(e.prototype,"landmarkNet",{get:function(){return this.useTinyLandmarkNet?Nr.faceLandmark68TinyNet:Nr.faceLandmark68Net},enumerable:!0,configurable:!0}),e}(hv),Oce=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.run=function(){return dt(this,void 0,void 0,function(){var t,r,i,a,s,o=this;return ft(this,function(c){switch(c.label){case 0:return[4,this.parentTask];case 1:return t=c.sent(),r=t.map(function(u){return u.detection}),this.input instanceof mr?[4,WS(this.input,r)]:[3,3];case 2:return a=c.sent(),[3,5];case 3:return[4,zS(this.input,r)];case 4:a=c.sent(),c.label=5;case 5:return i=a,[4,Promise.all(i.map(function(u){return o.landmarkNet.detectLandmarks(u)}))];
3868case 6:return s=c.sent(),i.forEach(function(u){return u instanceof mr&&u.dispose()}),[2,t.map(function(u,l){return KS(u,s[l])})]}})})},e.prototype.withFaceExpressions=function(){return new rT(this,this.input)},e.prototype.withAgeAndGender=function(){return new oT(this,this.input)},e.prototype.withFaceDescriptors=function(){return new uT(this,this.input)},e}(DL),Mce=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.run=function(){return dt(this,void 0,void 0,function(){var t,r,i,a,s;return ft(this,function(o){switch(o.label){case 0:return[4,this.parentTask];case 1:return t=o.sent(),t?(r=t.detection,this.input instanceof mr?[4,WS(this.input,[r])]:[3,3]):[2];case 2:return a=o.sent(),[3,5];case 3:return[4,zS(this.input,[r])];case 4:a=o.sent(),o.label=5;case 5:return i=a,[4,this.landmarkNet.detectLandmarks(i[0])];case 6:return s=o.sent(),i.forEach(function(c){return c instanceof mr&&c.dispose()}),[2,KS(t,s)]}})})},e.prototype.withFaceExpressions=function(){return new iT(this,this.input)},e.prototype.withAgeAndGender=function(){return new cT(this,this.input)},e.prototype.withFaceDescriptor=function(){return new lT(this,this.input)},e}(DL),NL=function(n){Ot(e,n);function e(t,r){r===void 0&&(r=new _b);var i=n.call(this)||this;return i.input=t,i.options=r,i}return e}(hv),LL=function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.run=function(){return dt(this,void 0,void 0,function(){var t,r,i,a;return ft(this,function(s){switch(s.label){case 0:return t=this,r=t.input,i=t.options,i instanceof TL?[4,Nr.mtcnn.forward(r,i)]:[3,2];case 1:return[2,s.sent().map(function(o){return o.detection})];case 2:if(a=i instanceof fce?function(o){return Nr.tinyFaceDetector.locateFaces(o,i)}:i instanceof _b?function(o){return Nr.ssdMobilenetv1.locateFaces(o,i)}:i instanceof JS?function(o){return Nr.tinyYolov2.locateFaces(o,i)}:null,!a)throw new Error("detectFaces - expected options to be instance of TinyFaceDetectorOptions | SsdMobilenetv1Options | MtcnnOptions | TinyYolov2Options");return[2,a(r)]}})})},e.prototype.runAndExtendWithFaceDetections=function(){var t=this;return new Promise(function(r){return dt(t,void 0,void 0,function(){var i;return ft(this,function(a){switch(a.label){case 0:return[4,this.run()];case 1:return i=a.sent(),[2,r(i.map(function(s){return US({},s)}))]}})})})},e.prototype.withFaceLandmarks=function(t){return t===void 0&&(t=!1),new Oce(this.runAndExtendWithFaceDetections(),this.input,t)},e.prototype.withFaceExpressions=function(){return new tT(this.runAndExtendWithFaceDetections(),this.input)},e.prototype.withAgeAndGender=function(){return new aT(this.runAndExtendWithFaceDetections(),this.input)},e}(NL);(function(n){Ot(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.run=function(){return dt(this,void 0,void 0,function(){var t,r;return ft(this,function(i){switch(i.label){case 0:return[4,new LL(this.input,this.options)];case 1:return t=i.sent(),r=t[0],t.forEach(function(a){a.score>r.score&&(r=a)}),[2,r]}})})},e.prototype.runAndExtendWithFaceDetection=function(){var t=this;return new Promise(function(r){return dt(t,void 0,void 0,function(){var i;return ft(this,function(a){switch(a.label){case 0:return[4,this.run()];case 1:return i=a.sent(),[2,r(i?US({},i):void 0)]}})})})},e.prototype.withFaceLandmarks=function(t){return t===void 0&&(t=!1),new Mce(this.runAndExtendWithFaceDetection(),this.input,t)},e.prototype.withFaceExpressions=function(){return new nT(this.runAndExtendWithFaceDetection(),this.input)},e.prototype.withAgeAndGender=function(){return new sT(this.runAndExtendWithFaceDetection(),this.input)},e})(NL);function FL(n,e){return e===void 0&&(e=new _b),new LL(n,e)}function Dce(n,e){if(n.length!==e.length)throw new Error("euclideanDistance: arr1.length !== arr2.length");var t=Array.from(n),r=Array.from(e);return Math.sqrt(t.map(function(i,a){return i-r[a]}).reduce(function(i,a){return i+Math.pow(a,2)},0))}(function(){function n(e,t){t===void 0&&(t=.6),this._distanceThreshold=t;var r=Array.isArray(e)?e:[e];if(!r.length)throw new Error("FaceRecognizer.constructor - expected atleast one input");var i=1,a=function(){return"person "+i++};this._labeledDescriptors=r.map(function(s){if(s instanceof M0)return s;if(s instanceof Float32Array)return new M0(a(),[s]);if(s.descriptor&&s.descriptor instanceof Float32Array)return new M0(a(),[s.descriptor]);throw new Error("FaceRecognizer.constructor - expected inputs to be of type LabeledFaceDescriptors | WithFaceDescriptor<any> | Float32Array | Array<LabeledFaceDescriptors | WithFaceDescriptor<any> | Float32Array>")})}return Object.defineProperty(n.prototype,"labeledDescriptors",{get:function(){return this._labeledDescriptors},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"distanceThreshold",{get:function(){return this._distanceThreshold},enumerable:!0,configurable:!0}),n.prototype.computeMeanDistance=function(e,t){return t.map(function(r){return Dce(r,e)}).reduce(function(r,i){return r+i},0)/(t.length||1)},n.prototype.matchDescriptor=function(e){var t=this;return this.labeledDescriptors.map(function(r){var i=r.descriptors,a=r.label;return new Z4(a,t.computeMeanDistance(e,i))}).reduce(function(r,i){return r.distance<i.distance?r:i})},n.prototype.findBestMatch=function(e){var t=this.matchDescriptor(e);return t.distance<this.distanceThreshold?t:new Z4("unknown",t.distance)},n.prototype.toJSON=function(){return{distanceThreshold:this.distanceThreshold,labeledDescriptors:this.labeledDescriptors.map(function(e){return e.toJSON()})}},n.fromJSON=function(e){var t=e.labeledDescriptors.map(function(r){return M0.fromJSON(r)});return new n(t,e.distanceThreshold)},n})();const Nce={components:{JetSecondaryButton:Br},props:{application:{type:Object,required:!0}},data(){return{photoPreview:null,faceDetectionStarted:!1,faceDetectionFinished:!1,faces:0}},methods:{async updatePhotoPreview(){try{if(this.faceDetectionFinished=!1,this.photoPreview=null,this.loading=!0,!document.getElementById("photo"))throw new Error("Element with id 'photo' not found.");const e=this.$refs.photo.files[0];if(!e)throw new Error("No file selected.");
3868if(!this.modelsLoaded)try{await Promise.all([Nr.ssdMobilenetv1.loadFromUri("/models"),Nr.faceLandmark68Net.loadFromUri("/models"),Nr.faceRecognitionNet.loadFromUri("/models")]),this.modelsLoaded=!0}catch(t){console.error("Error loading face-api.js models:",t)}this.faceDetectionStarted=!0,await this.cropFaces(e)}catch(n){console.error(n.message),this.loading=!1}},async cropFaces(n){try{const e=await oL(n),t=fv(e);let r={width:e.width,height:e.height};uL(t,r);const i=await FL(e).withFaceLandmarks().withFaceDescriptors();if(this.faceDetectionFinished=!0,this.faceDetectionStarted=!1,this.faces=i.length,i.length!==1)throw new Error("No face or multiple faces detected.");const[a]=i.sort((u,l)=>l.detection.score-u.detection.score),s=this.getCroppedImageData(e,a,r);this.photoPreview=s.dataUrl,this.$emit("input",this.photoPreview);const o=await this.dataUrlToBlob(this.photoPreview),c=new File([o],"photo.jpg",{type:"image/jpeg"});this.$emit("file-selected",c)}catch(e){console.error(e.message),this.loading=!1}},getCroppedImageData(n,e,t){const r=.7782101167315175,i=2,a=300,{cropX:s,cropY:o,paddedWidth:c,paddedHeight:u}=this.cropToAspectRatio(e,t,r,i),l=a/r,d=document.createElement("canvas");return d.width=c,d.height=u,d.getContext("2d").drawImage(n,s,o,c,u,0,0,c,u),{dataUrl:d.toDataURL("image/jpeg",.4),width:a,height:l}},cropToAspectRatio(n,e,t=1/1.285,r=1.2){const{x:i,y:a,width:s,height:o}=n.detection.box;let c=s*r,u=c/t;const l=e.width,d=e.height;let h=Math.max(0,i+(s-c)/2),p=Math.max(0,a+(o-u)/2);return c=Math.min(c,l-h),u=Math.min(u,d-p),{cropX:h,cropY:p,paddedWidth:c,paddedHeight:u}},deletePhoto(){this.$inertia.delete(route("current-user-photo.destroy"),{preserveScroll:!0,onSuccess:()=>this.photoPreview=null})},dataUrlToBlob(n){return new Promise((e,t)=>{var r;try{const i=n.split(","),a=(r=i[0])==null?void 0:r.match(/:(.*?);/);if(!a){t(new Error("Invalid data URL: could not parse MIME type"));return}const s=a[1],o=atob(i[1]);let c=o.length;const u=new Uint8Array(c);for(;c--;)u[c]=o.charCodeAt(c);e(new Blob([u],{type:s}))}catch(i){t(i)}})},dataURLtoFile(n,e){var c;const t=n.split(","),r=(c=t[0])==null?void 0:c.match(/:(.*?);/);if(!r)throw new Error("Invalid data URL: could not parse MIME type");const i=r[1],a=atob(t[t.length-1]);let s=a.length;const o=new Uint8Array(s);for(;s--;)o[s]=a.charCodeAt(s);return new File([o],e,{type:i})}}};var Lce=function(){var e=this,t=e._self._c;return t("div",[t("input",{ref:"photo",staticClass:"hidden",attrs:{id:"photo",type:"file"},on:{change:e.updatePhotoPreview}}),t("jet-secondary-button",{staticClass:"btn btn-primary",nativeOn:{click:function(r){return e.$refs.photo.click()}}},[e._v("Vælg nyt billede")])],1)},Fce=[],$ce=ve(Nce,Lce,Fce,!1,null,null);const $L=$ce.exports,Bce=Object.freeze(Object.defineProperty({__proto__:null,default:$L},Symbol.toStringTag,{value:"Module"})),Uce={props:{application:{type:Object,required:!0}},components:{JetConfirmationModal:kf,JetSecondaryButton:Br,JetDangerButton:vo,JetButton:mn,UpdateImage:$L},data(){return{form:this.$inertia.form({_method:"POST",photo:null,id:this.application.id}),isPaid:this.application.is_paid,isApproved:this.application.is_approved,isFetching:!1,rowHidden:!1,isDeleteModalOpen:!1,isUpdateImageModalOpen:!1,isRejectModalOpen:!1,selectedRejectionReason:null,image:null,previewImage:null}},methods:{openDeleteApplicationModal(){this.isDeleteModalOpen=!0},toggleUpdateImageModal(){this.isUpdateImageModalOpen=!0},openRejectModal(){this.isRejectModalOpen=!0},closeRejectModal(){this.isRejectModalOpen=!1,this.selectedRejectionReason=null},async refreshPaymentStatus(n){this.isFetching=!0;try{(await(await fetch(`/admin/fck-away/applications/${n.id}/check-payment`,{method:"GET",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').getAttribute("content")}})).json()).hasAwayPayment?this.isPaid=1:this.isPaid=0}catch(e){this.isFetching=!1,console.error(e)}this.isFetching=!1},async approveApplication(n){(await(await fetch(`/admin/fck-away/applications/${n.id}/approve`,{method:"GET",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').getAttribute("content")}})).json()).success==="Application approved"&&(this.rowHidden=!0)},async rejectApplicationWithReason(){if(!this.selectedRejectionReason)return;(await(await fetch(`/admin/fck-away/applications/${this.application.id}/reject`,{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').getAttribute("content")},body:JSON.stringify({reason:this.selectedRejectionReason})}
3868)).json()).success==="Application rejected"&&(this.closeRejectModal(),this.rowHidden=!0)},async deleteApplication(n){(await(await fetch(`/admin/fck-away/applications/${n.id}/delete`,{method:"GET",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').getAttribute("content")}})).json()).success==="Application deleted"&&(this.isDeleteModalOpen=!1,this.rowHidden=!0)},onFileSelected(n){this.form.photo=n},updatePhotoPreview(n){this.previewImage=n},async updateImage(){this.form.post(`/admin/fck-away/applications/${this.application.id}/update-image`,{onSuccess:()=>{this.isUpdateImageModalOpen=!1,this.application.photo=this.previewImage},onError:n=>{console.error("Error updating image:",n)}})}},computed:{rejectionReasons(){return{hat_glasses:this.$trans("pages.awayRejection.reasons.hat_glasses"),poor_quality:this.$trans("pages.awayRejection.reasons.poor_quality"),incomplete_face:this.$trans("pages.awayRejection.reasons.incomplete_face"),multiple_people:this.$trans("pages.awayRejection.reasons.multiple_people"),wrong_format:this.$trans("pages.awayRejection.reasons.wrong_format"),no_payment:this.$trans("pages.awayRejection.reasons.no_payment"),age_mismatch:this.$trans("pages.awayRejection.reasons.age_mismatch")}}}};var jce=function(){var e=this,t=e._self._c;return t("tr",{class:{hidden:e.rowHidden}},[t("td",{staticClass:"whitespace-nowrap text-sm font-medium text-gray-900"},[t("img",{staticClass:"max-w-16 sm:max-w-24 md:max-w-32",attrs:{src:e.application.photo,alt:"Billede"}})]),t("td",{staticClass:"whitespace-nowrap p-1 text-xs"},[t("a",{staticClass:"hover:text-blue-600 transition-colors duration-200",attrs:{href:`/admin/users/${e.application.user.id}`}},[t("div",{staticClass:"flex flex-col"},[t("p",{staticClass:"text-pretty break-all"},[e._v(e._s(e.application.user.firstname)+" "+e._s(e.application.user.lastname))]),t("p",{staticClass:"text-gray-400"},[e._v(e._s(Math.abs(new Date(Date.now()-new Date(e.application.user.birthday).getTime()).getFullYear()-1970))+" år")]),t("p",{staticClass:"text-gray-400"},[e._v(e._s(new Date(e.application.user.birthday).toLocaleString("da-DK",{dateStyle:"long"})))])])])]),t("td",{staticClass:"relative whitespace-nowrap p-1 text-right text-sm font-medium"},[t("div",{staticClass:"flex flex-col space-y-2 lg:space-y-0 lg:flex-row lg:space-x-2 items-center relative z-0"},[e.application.is_approved?e._e():t("button",{staticClass:"w-full lg:w-auto bg-gray-100 hover:bg-gray-200 text-gray-800 py-2 px-1 sm:px-4 roun
3868ded-lg inline-flex items-center justify-center transition-colors duration-200",class:e.isPaid===1?"cursor-default":"cursor-pointer",attrs:{disabled:!!e.isPaid},on:{click:function(r){return e.refreshPaymentStatus(e.application)}}},[e.isPaid?t("svg",{staticClass:"size-4 text-grey-500",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}})]):t("svg",{staticClass:"size-4 text-grey-500",class:{"animate-spin":e.isFetching},attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}})]),t("span",{staticClass:"ml-1.5"},[e._v(" "+e._s(e.isPaid===1?"Ja":"Nej")+" ")])]),t("div",{staticClass:"flex flex-col lg:flex-row space-y-2 lg:space-y-0 lg:space-x-2 w-full lg:w-auto"},[e.isApproved?e._e():t("a",{staticClass:"w-full lg:w-auto inline-flex items-center justify-center px-1 sm:px-4 py-2 rounded-lg bg-green-600 text-white hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 transition-colors duration-200",on:{click:function(r){return r.preventDefault(),e.approveApplication(e.application)}}},[t("svg",{staticClass:"h-4 w-4 mr-1.5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"}})]),e._v(" Godkend ")]),e.isApproved?e._e():t("a",{staticClass:"w-full lg:w-auto inline-flex items-center justify-center px-1 sm:px-4 py-2 rounded-lg bg-red-600 text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 transition-colors duration-200",on:{click:function(r){return r.preventDefault(),e.openRejectModal.apply(null,arguments)}}},[t("svg",{staticClass:"h-4 w-4 mr-1.5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"}})]),e._v(" Afvis ")]),e.isApproved?t("jet-secondary-button",{staticClass:"w-full lg:w-auto inline-flex items-center justify-center px-0.5 sm:px-2",nativeOn:{click:function(r){return e.toggleUpdateImageModal.apply(null,arguments)}}},[t("svg",{staticClass:"h-4 w-4 mr-1.5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"}})]),e._v(" Nyt billede ")]):e._e(),e.isApproved?t("jet-danger-button",{staticClass:"w-full lg:w-auto inline-flex items-center justify-center px-0.5 sm:px-2",nativeOn:{click:function(r){return e.openDeleteApplicationModal.apply(null,arguments)}}},[t("svg",{staticClass:"h-4 w-4 mr-1.5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}})]),e._v(" Slet ")]):e._e()],1)])]),t("jet-confirmation-modal",{attrs:{show:e.isDeleteModalOpen},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" Slet awaykort ")]},proxy:!0},{key:"content",fn:function(){return[e._v(" Er du sikker på at du vil slette awaykortet for "),t("span",{staticClass:"font-bold"},[e._v(e._s(e.application.user.firstname)+" "+e._s(e.application.user.lastname)+" ("+e._s(e.application.user.email)+")")]),e._v("? ")]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){e.isDeleteModalOpen=!1}}},[e._v(" Annuller ")]),t("jet-danger-button",{nativeOn:{click:function(r){return e.deleteApplication(e.application)}}},[e._v(" Slet ")])]},proxy:!0}])}),t("jet-confirmation-modal",{attrs:{show:e.isUpdateImageModalOpen},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" Opdater billede ")]},proxy:!0},{key:"content",fn:function(){return[t("p",[e._v("Vil du opdatere billedet for "),t("span",{staticClass:"font-bold"},[e._v(e._s(e.application.user.firstname)+" "+e._s(e.application.user.lastname)+" ("+e._s(e.application.user.email)+")")]),e._v("?")]),t("div",{staticClass:"flex flex-row"},[t("div",{staticClass:"flex flex-col border p-2 items-center w-40"},[t("p",{staticClass:"text-sm"},[e._v("Nuværende billede")]),t("img",{staticClass:"w-24",attrs:{src:e.application.photo,alt:"Gammelt billede"}})]),t("div",{staticClass:"flex items-center justify-center ml-2"},[t("svg",{staticClass:"size-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3"}})])]),t("div",{staticClass:"flex flex-col ml-2 border p-2 items-center w-40"},[t("p",{staticClass:"text-sm"},[e._v("Nyt billede")]),t("div",{staticClass:"flex items-center justify-center flex-1"},[e.previewImage?t("img",{staticClass:"w-24",attrs:{src:e.previewImage,alt:"Nyt billede"}}):t("svg",{staticClass:"w-24",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"}})])])])]),t("UpdateImage",{attrs:{application:e.application},on:{"file-selected":e.onFileSelected,input:e.updatePhotoPreview},model:{value:e.form.photo,callback:function(r){e.$set(e.form,"photo",r)},expression:"form.photo"}})]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){e.isUpdateImageModalOpen=!1}}},[e._v(" Annuller ")]),t("jet-button",{nativeOn:{click:function(r){return e.updateImage.apply(null,arguments)}}}
3868,[e._v(" Opdater ")])]},proxy:!0}])}),t("jet-confirmation-modal",{attrs:{show:e.isRejectModalOpen},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" Afvis awaykort-ansøgning ")]},proxy:!0},{key:"content",fn:function(){return[t("p",{staticClass:"mb-4"},[e._v("Vælg årsag til afvisning af ansøgningen for "),t("span",{staticClass:"font-bold"},[e._v(e._s(e.application.user.firstname)+" "+e._s(e.application.user.lastname)+" ("+e._s(e.application.user.email)+")")]),e._v(":")]),t("div",{staticClass:"space-y-3"},e._l(e.rejectionReasons,function(r,i){return t("label",{key:i,staticClass:"flex items-start space-x-3 cursor-pointer"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.selectedRejectionReason,expression:"selectedRejectionReason"}],staticClass:"mt-1 rounded border-gray-300 text-red-600 shadow-sm focus:border-red-300 focus:ring focus:ring-red-200 focus:ring-opacity-50",attrs:{type:"radio"},domProps:{value:r,checked:e._q(e.selectedRejectionReason,r)},on:{change:function(a){e.selectedRejectionReason=r}}}),t("span",{staticClass:"text-sm"},[e._v(e._s(r))])])}),0),t("div",{staticClass:"mt-4 p-3 bg-gray-50 rounded-lg"},[t("p",{staticClass:"text-sm text-gray-600 font-semibold"},[e._v("Krav til billede:")]),t("p",{staticClass:"text-sm text-gray-600 mt-1"},[e._v("Billedet skal være i pasfotoformat, vellignende og taget lige forfra. Du må ikke bære hovedbeklædning på billedet, og ansigtet må ikke være helt eller delvist dækket.")])])]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){return e.closeRejectModal.apply(null,arguments)}}},[e._v(" Annuller ")]),t("jet-danger-button",{attrs:{disabled:!e.selectedRejectionReason},nativeOn:{click:function(r){return e.rejectApplicationWithReason.apply(null,arguments)}}},[e._v(" Afvis ansøgning ")])]},proxy:!0}])})],1)},qce=[],zce=ve(Uce,jce,qce,!1,null,null);const BL=zce.exports,Wce=Object.freeze(Object.defineProperty({__proto__:null,default:BL},Symbol.toStringTag,{value:"Module"})),Hce={props:["applications","path","is_approved"],components:{AdminLayout:Gt,JetPagination:Rp,ApplicationRow:BL},created(){this.fetchApplications=this.debounce(this.fetchApplications,300)},data(){return{searchFields:{firstname:"",lastname:"",email:"",phone:""},fetching:!1,data:this.applications.data}},methods:{async fetchApplications(){this.fetching=!0;let n=this.is_approved?"approved":"applications";await this.$inertia.get(`/admin/fck-away/${n}`,{searchFields:this.searchFields},{preserveState:!0,preserveScroll:!0,replace:!0}),this.fetching=!1},debounce(n,e,t){let r;return function(){const i=this,a=arguments,s=function(){r=null,t||n.apply(i,a)},o=t&&!r;clearTimeout(r),r=setTimeout(s,e),o&&n.apply(i,a)}}},computed:{}};var Vce=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"flex flex-col space-y-4 relative z-0"},[t("div",{staticClass:"flex justify-between items-center"},[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight mt-2 md:mt-0"},[e._v(" "+e._s(e.$trans("pages.users.users"))+" ")])]),t("div",{staticClass:"flex items-center space-x-3"},[t("div",{staticClass:"flex flex-col md:flex-row gap-3 flex-1"},[t("div",{staticClass:"relative flex-1"},[t("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[t("svg",{staticClass:"h-5 w-5 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"}})])]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchFields.firstname,expression:"searchFields.firstname"}],staticClass:"pl-10 w-full border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-lg shadow-sm",attrs:{type:"text",placeholder:"First name..."},domProps:{value:e.searchFields.firstname},on:{input:[function(r){r.target.composing||e.$set(e.searchFields,"firstname",r.target.value)},e.fetchApplications]}})]),t("div",{staticClass:"relative flex-1"},[t("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[t("svg",{staticClass:"h-5 w-5 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"}})])]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchFields.lastname,expression:"searchFields.lastname"}],staticClass:"pl-10 w-full border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-lg shadow-sm",attrs:{type:"text",placeholder:"Last name..."},domProps:{value:e.searchFields.lastname},on:{input:[function(r){r.target.composing||e.$set(e.searchFields,"lastname",r.target.value)},e.fetchApplications]}})]),t("div",{staticClass:"relative flex-1"},[t("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[t("svg",{staticClass:"h-5 w-5 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M14.243 5.757a6 6 0 10-.986 9.284 1 1 0 111.087 1.678A8 8 0 1118 10a3 3 0 01-4.8 2.401A4 4 0 1114 10a1 1 0 102 0c0-1.537-.586-3.07-1.757-4.243zM12 10a2 2 0 10-4 0 2 2
38680 004 0z","clip-rule":"evenodd"}})])]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchFields.email,expression:"searchFields.email"}],staticClass:"pl-10 w-full border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-lg shadow-sm",attrs:{type:"text",placeholder:"Email..."},domProps:{value:e.searchFields.email},on:{input:[function(r){r.target.composing||e.$set(e.searchFields,"email",r.target.value)},e.fetchApplications]}})]),t("div",{staticClass:"relative flex-1"},[t("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[t("svg",{staticClass:"h-5 w-5 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{d:"M2 3a1 1 0 011-1h2.153a1 1 0 01.986.836l.74 4.435a1 1 0 01-.54 1.06l-1.548.773a11.037 11.037 0 006.105 6.105l.774-1.548a1 1 0 011.059-.54l4.435.74a1 1 0 01.836.986V17a1 1 0 01-1 1h-2C7.82 18 2 12.18 2 5V3z"}})])]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchFields.phone,expression:"searchFields.phone"}],staticClass:"pl-10 w-full border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-lg shadow-sm",attrs:{type:"text",placeholder:"Phone..."},domProps:{value:e.searchFields.phone},on:{input:[function(r){r.target.composing||e.$set(e.searchFields,"phone",r.target.value)},e.fetchApplications]}})])]),e.fetching?t("svg",{staticClass:"animate-spin w-5 h-5 flex-shrink-0 text-gray-500",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[t("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]):e._e()])])]},proxy:!0},{key:"footer",fn:function(){return[e.applications.data.length>0?t("jet-pagination",{staticClass:"mt-6",attrs:{total:e.applications.total,per_page:e.applications.per_page,current_page:e.applications.current_page,last_page:e.applications.last_page,first_page_url:e.applications.first_page_url,last_page_url:e.applications.last_page_url,next_page_url:e.applications.next_page_url,prev_page_url:e.applications.prev_page_url,path:e.applications.path,from:e.applications.from,to:e.applications.to,data:e.applications.data,searchFields:e.searchFields}}):e._e()]},proxy:!0}])},[t("div",{staticClass:"flow-root bg-white rounded-lg shadow-sm relative z-0"},[t("div",{staticClass:"overflow-x-auto"},[t("div",{staticClass:"inline-block min-w-full align-middle"},[t("table",{staticClass:"min-w-full divide-y divide-gray-200"},[t("thead",{staticClass:"bg-gray-50"},[t("tr",[t("th",{staticClass:"py-2 pl-2 text-left text-xs font-semibold text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Foto ")]),t("th",{staticClass:"px-2 py-2 text-left text-xs font-semibold text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Oplysninger ")]),t("th",{staticClass:"pr-2 py-2 text-left text-xs font-semibold text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Handlinger ")])])]),t("tbody",{staticClass:"divide-y divide-gray-200 bg-white"},e._l(e.applications.data,function(r){return t("ApplicationRow",{key:r.id,attrs:{application:r}})}),1)])])])])])},Gce=[],Kce=ve(Hce,Vce,Gce,!1,null,null);const Yce=Kce.exports,Xce=Object.freeze(Object.defineProperty({__proto__:null,default:Yce},Symbol.toStringTag,{value:"Module"}));//! moment.js 3869//! version : 2.30.1 3870//! authors : Tim Wood, Iskren Chernev, Moment.js contributors 3871//! license : MIT 3872//! momentjs.com 3873var UL;function Le(){return UL.apply(null,arguments)}function Jce(n){UL=n}function ic(n){return n instanceof Array||Object.prototype.toString.call(n)==="[object Array]"}function nf(n){return n!=null&&Object.prototype.toString.call(n)==="[object Object]"}function _n(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function dT(n){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(n).length===0;var e;
vendor: 25,208 bytes, lines 3873-3876
3873for(e in n)if(_n(n,e))return!1;return!0}function Aa(n){return n===void 0}function Xu(n){return typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]"}function pv(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function jL(n,e){var t=[],r,i=n.length;for(r=0;r<i;++r)t.push(e(n[r],r));return t}function Al(n,e){for(var t in e)_n(e,t)&&(n[t]=e[t]);return _n(e,"toString")&&(n.toString=e.toString),_n(e,"valueOf")&&(n.valueOf=e.valueOf),n}function su(n,e,t,r){return lF(n,e,t,r,!0).utc()}function Qce(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function Bt(n){return n._pf==null&&(n._pf=Qce()),n._pf}var _k;Array.prototype.some?_k=Array.prototype.some:_k=function(n){var e=Object(this),t=e.length>>>0,r;for(r=0;r<t;r++)if(r in e&&n.call(this,e[r],r,e))return!0;return!1};function fT(n){var e=null,t=!1,r=n._d&&!isNaN(n._d.getTime());if(r&&(e=Bt(n),t=_k.call(e.parsedDateParts,function(i){return i!=null}),r=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&t),n._strict&&(r=r&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(n))n._isValid=r;else return r;return n._isValid}function xb(n){var e=su(NaN);return n!=null?Al(Bt(e),n):Bt(e).userInvalidated=!0,e}var aI=Le.momentProperties=[],Lw=!1;function hT(n,e){var t,r,i,a=aI.length;if(Aa(e._isAMomentObject)||(n._isAMomentObject=e._isAMomentObject),Aa(e._i)||(n._i=e._i),Aa(e._f)||(n._f=e._f),Aa(e._l)||(n._l=e._l),Aa(e._strict)||(n._strict=e._strict),Aa(e._tzm)||(n._tzm=e._tzm),Aa(e._isUTC)||(n._isUTC=e._isUTC),Aa(e._offset)||(n._offset=e._offset),Aa(e._pf)||(n._pf=Bt(e)),Aa(e._locale)||(n._locale=e._locale),a>0)for(t=0;t<a;t++)r=aI[t],i=e[r],Aa(i)||(n[r]=i);return n}function mv(n){hT(this,n),this._d=new Date(n._d!=null?n._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Lw===!1&&(Lw=!0,Le.updateOffset(this),Lw=!1)}function ac(n){return n instanceof mv||n!=null&&n._isAMomentObject!=null}function qL(n){Le.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+n)}function _o(n,e){var t=!0;return Al(function(){if(Le.deprecationHandler!=null&&Le.deprecationHandler(null,n),t){var r=[],i,a,s,o=arguments.length;for(a=0;a<o;a++){if(i="",typeof arguments[a]=="object"){i+=` 3874[`+a+"] ";for(s in arguments[0])_n(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[a];r.push(i)}qL(n+` 3875Arguments: `+Array.prototype.slice.call(r).join("")+` 3876`+new Error().stack),t=!1}return e.apply(this,arguments)},e)}var sI={};function zL(n,e){Le.deprecationHandler!=null&&Le.deprecationHandler(n,e),sI[n]||(qL(e),sI[n]=!0)}Le.suppressDeprecationWarnings=!1;Le.deprecationHandler=null;function ou(n){return typeof Function<"u"&&n instanceof Function||Object.prototype.toString.call(n)==="[object Function]"}function Zce(n){var e,t;for(t in n)_n(n,t)&&(e=n[t],ou(e)?this[t]=e:this["_"+t]=e);this._config=n,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function bk(n,e){var t=Al({},n),r;for(r in e)_n(e,r)&&(nf(n[r])&&nf(e[r])?(t[r]={},Al(t[r],n[r]),Al(t[r],e[r])):e[r]!=null?t[r]=e[r]:delete t[r]);for(r in n)_n(n,r)&&!_n(e,r)&&nf(n[r])&&(t[r]=Al({},t[r]));return t}function pT(n){n!=null&&this.set(n)}var xk;Object.keys?xk=Object.keys:xk=function(n){var e,t=[];for(e in n)_n(n,e)&&t.push(e);return t};var eue={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function tue(n,e,t){var r=this._calendar[n]||this._calendar.sameElse;return ou(r)?r.call(e,t):r}function Jc(n,e,t){var r=""+Math.abs(n),i=e-r.length,a=n>=0;return(a?t?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var mT=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,$0=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Fw={},zh={};function ht(n,e,t,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),n&&(zh[n]=i),e&&(zh[e[0]]=function(){return Jc(i.apply(this,arguments),e[1],e[2])}),t&&(zh[t]=function(){return this.localeData().ordinal(i.apply(this,arguments),n)})}function nue(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function rue(n){var e=n.match(mT),t,r;for(t=0,r=e.length;t<r;t++)zh[e[t]]?e[t]=zh[e[t]]:e[t]=nue(e[t]);return function(i){var a="",s;for(s=0;s<r;s++)a+=ou(e[s])?e[s].call(i,n):e[s];return a}}function uy(n,e){return n.isValid()?(e=WL(e,n.localeData()),Fw[e]=Fw[e]||rue(e),Fw[e](n)):n.localeData().invalidDate()}function WL(n,e){var t=5;function r(i){return e.longDateFormat(i)||i}for($0.lastIndex=0;t>=0&&$0.test(n);)n=n.replace($0,r),$0.lastIndex=0,t-=1;return n}var iue={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function aue(n){var e=this._longDateFormat[n],t=this._longDateFormat[n.toUpperCase()];return e||!t?e:(this._longDateFormat[n]=t.match(mT).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[n])}var sue="Invalid date";function oue(){return this._invalidDate}var cue="%d",uue=/\d{1,2}/;function lue(n){return this._ordinal.replace("%d",n)}var due={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function fue(n,e,t,r){var i=this._relativeTime[t];return ou(i)?i(n,e,t,r):i.replace(/%d/i,n)}function hue(n,e){var t=this._relativeTime[n>0?"future":"past"];return ou(t)?t(e):t.replace(/%s/i,e)}var oI={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function bo(n){return typeof n=="string"?oI[n]||oI[n.toLowerCase()]:void 0}function gT(n){var e={},t,r;for(r in n)_n(n,r)&&(t=bo(r),t&&(e[t]=n[r]));return e}var pue={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function mue(n){var e=[],t;for(t in n)_n(n,t)&&e.push({unit:t,priority:pue[t]});return e.sort(function(r,i){return r.priority-i.priority}),e}var HL=/\d/,As=/\d\d/,VL=/\d{3}/,vT=/\d{4}/,wb=/[+-]?\d{6}/,Yn=/\d\d?/,GL=/\d\d\d\d?/,KL=/\d\d\d\d\d\d?/,Cb=/\d{1,3}/,yT=/\d{1,4}/,kb=/[+-]?\d{1,6}/,Fp=/\d+/,Sb=/[+-]?\d+/,gue=/Z|[+-]\d\d:?\d\d/gi,Tb=/Z|[+-]\d\d(?::?\d\d)?/gi,vue=/[+-]?\d+(\.\d{1,3})?/,gv=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,$p=/^[1-9]\d?/,_T=/^([1-9]\d|\d)/,y_;y_={};function rt(n,e,t){y_[n]=ou(e)?e:function(r,i){return r&&t?t:e}}function yue(n,e){return _n(y_,n)?y_[n](e._strict,e._locale):new RegExp(_ue(n))}function _ue(n){return Vu(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,r,i,a){return t||r||i||a}))}function Vu(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function so(n){return n<0?Math.ceil(n)||0:Math.floor(n)}function sn(n){var e=+n,t=0;return e!==0&&isFinite(e)&&(t=so(e)),t}var wk={};function In(n,e){var t,r=e,i;for(typeof n=="string"&&(n=[n]),Xu(e)&&(r=function(a,s){s[e]=sn(a)}),i=n.length,t=0;t<i;t++)wk[n[t]]=r}function vv(n,e){In(n,function(t,r,i,a){i._w=i._w||{},e(t,i._w,i,a)})}function bue(n,e,t){e!=null&&_n(wk,n)&&wk[n](e,t._a,t,n)}function Eb(n){return n%4===0&&n%100!==0||n%400===0}var Xi=0,Wu=1,Nc=2,ii=3,Qo=4,Hu=5,Gd=6,xue=7,wue=8;ht("Y",0,0,function(){var n=this.year();return n<=9999?Jc(n,4):"+"+n});ht(0,["YY",2],0,function(){return this.year()%100});ht(0,["YYYY",4],0,"year");ht(0,["YYYYY",5],0,"year");ht(0,["YYYYYY",6,!0],0,"year");rt("Y",Sb);rt("YY",Yn,As);rt("YYYY",yT,vT);rt("YYYYY",kb,wb);rt("YYYYYY",kb,wb);In(["YYYYY","YYYYYY"],Xi);In("YYYY",function(n,e){e[Xi]=n.length===2?Le.parseTwoDigitYear(n):sn(n)});In("YY",function(n,e){e[Xi]=Le.parseTwoDigitYear(n)});In("Y",function(n,e){e[Xi]=parseInt(n,10)});function Jm(n){return Eb(n)?366:365}Le.parseTwoDigitYear=function(n){return sn(n)+(sn(n)>68?1900:2e3)};var YL=Bp("FullYear",!0);function Cue(){return Eb(this.year())}function Bp(n,e){return function(t){return t!=null?(XL(this,n,t),Le.updateOffset(this,e),this):Eg(this,n)}}function Eg(n,e){if(!n.isValid())return NaN;var t=n._d,r=n._isUTC;switch(e){case"Milliseconds":return r?t.getUTCMilliseconds():t.getMilliseconds();case"Seconds":return r?t.getUTCSeconds():t.getSeconds();case"Minutes":return r?t.getUTCMinutes():t.getMinutes();case"Hours":return r?t.getUTCHours():t.getHours();case"Date":return r?t.getUTCDate():t.getDate();case"Day":return r?t.getUTCDay():t.getDay();case"Month":return r?t.getUTCMonth():t.getMonth();case"FullYear":return r?t.getUTCFullYear():t.getFullYear();default:return NaN}}function XL(n,e,t){var r,i,a,s,o;if(!(!n.isValid()||isNaN(t))){switch(r=n._d,i=n._isUTC,e){case"Milliseconds":return void(i?r.setUTCMilliseconds(t):r.setMilliseconds(t));case"Seconds":return void(i?r.setUTCSeconds(t):r.setSeconds(t));case"Minutes":return void(i?r.setUTCMinutes(t):r.setMinutes(t));case"Hours":return void(i?r.setUTCHours(t):r.setHours(t));case"Date":return void(i?r.setUTCDate(t):r.setDate(t));case"FullYear":break;default:return}a=t,s=n.month(),o=n.date(),o=o===29&&s===1&&!Eb(a)?28:o,i?r.setUTCFullYear(a,s,o):r.setFullYear(a,s,o)}}function kue(n){return n=bo(n),ou(this[n])?this[n]():this}function Sue(n,e){if(typeof n=="object"){n=gT(n);var t=mue(n),r,i=t.length;for(r=0;r<i;r++)this[t[r].unit](n[t[r].unit])}else if(n=bo(n),ou(this[n]))return this[n](e);return this}function Tue(n,e){return(n%e+e)%e}var Or;Array.prototype.indexOf?Or=Array.prototype.indexOf:Or=function(n){var e;for(e=0;e<this.length;++e)if(this[e]===n)return e;return-1};function bT(n,e){if(isNaN(n)||isNaN(e))return NaN;var t=Tue(e,12);return n+=(e-t)/12,t===1?Eb(n)?29:28:31-t%7%2}ht("M",["MM",2],"Mo",function(){return this.month()+1});ht("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)});ht("MMMM",0,0,function(n){return this.localeData().months(this,n)});rt("M",Yn,$p);rt("MM",Yn,As);rt("MMM",function(n,e){return e.monthsShortRegex(n)});rt("MMMM",function(n,e){return e.monthsRegex(n)});In(["M","MM"],function(n,e){e[Wu]=sn(n)-1});In(["MMM","MMMM"],function(n,e,t,r){var i=t._locale.monthsParse(n,r,t._strict);i!=null?e[Wu]=i:Bt(t).invalidMonth=n});var Eue="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),JL="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),QL=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Pue=gv,Rue=gv;function Aue(n,e){return n?ic(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||QL).test(e)?"format":"standalone"][n.month()]:ic(this._months)?this._months:this._months.standalone}function Iue(n,e){return n?ic(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[QL.test(e)?"format":"standalone"][n.month()]:ic(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Oue(n,e,t){var r,i,a,s=n.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=su([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,"").toLocaleLowerCase();return t?e==="MMM"?(i=Or.call(this._shortMonthsParse,s),i!==-1?i:null):(i=Or.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=Or.call(this._shortMonthsParse,s),i!==-1?i:(i=Or.call(this._longMonthsParse,s),i!==-1?i:null)):(i=Or.call(this._longMonthsParse,s),i!==-1?i:(i=Or.call(this._shortMonthsParse,s),i!==-1?i:null))}function Mue(n,e,t){var r,i,a;if(this._monthsParseExact)return Oue.call(this,n,e,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=su([2e3,r]),t&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!t&&!this._monthsParse[r]&&(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),t&&e==="MMMM"&&this._longMonthsParse[r].test(n))return r;if(t&&e==="MMM"&&this._shortMonthsParse[r].test(n))return r;if(!t&&this._monthsParse[r].test(n))return r}}function ZL(n,e){if(!n.isValid())return n;if(typeof e=="string"){if(/^\d+$/.test(e))e=sn(e);else if(e=n.localeData().monthsParse(e),!Xu(e))return n}var t=e,r=n.date();return r=r<29?r:Math.min(r,bT(n.year(),t)),n._isUTC?n._d.setUTCMonth(t,r):n._d.setMonth(t,r),n}function eF(n){return n!=null?(ZL(this,n),Le.updateOffset(this,!0),this):Eg(this,"Month")}function Due(){return bT(this.year(),this.month())}function Nue(n){return this._monthsParseExact?(_n(this,"_monthsRegex")||tF.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(_n(this,"_monthsShortRegex")||(this._monthsShortRegex=Pue),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function Lue(n){return this._monthsParseExact?(_n(this,"_monthsRegex")||tF.call(this),n?this._monthsStrictRegex:this._monthsRegex):(_n(this,"_monthsRegex")||(this._monthsRegex=Rue),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function tF(){function n(c,u){return u.length-c.length}var e=[],t=[],r=[],i,a,s,o;for(i=0;i<12;i++)a=su([2e3,i]),s=Vu(this.monthsShort(a,"")),o=Vu(this.months(a,"")),e.push(s),t.push(o),r.push(o),r.push(s);e.sort(n),t.sort(n),r.sort(n),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Fue(n,e,t,r,i,a,s){var o;return n<100&&n>=0?(o=new Date(n+400,e,t,r,i,a,s),isFinite(o.getFullYear())&&o.setFullYear(n)):o=new Date(n,e,t,r,i,a,s),o}function Pg(n){var e,t;return n<100&&n>=0?(t=Array.prototype.slice.call(arguments),t[0]=n+400,e=new Date(Date.UTC.apply(null,t)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(n)):e=new Date(Date.UTC.apply(null,arguments)),e}function __(n,e,t){var r=7+e-t,i=(7+Pg(n,0,r).getUTCDay()-e)%7;return-i+r-1}function nF(n,e,t,r,i){var a=(7+t-r)%7,s=__(n,r,i),o=1+7*(e-1)+a+s,c,u;return o<=0?(c=n-1,u=Jm(c)+o):o>Jm(n)?(c=n+1,u=o-Jm(n)):(c=n,u=o),{year:c,dayOfYear:u}}function Rg(n,e,t){var r=__(n.year(),e,t),i=Math.floor((n.dayOfYear()-r-1)/7)+1,a,s;return i<1?(s=n.year()-1,a=i+Gu(s,e,t)):i>Gu(n.year(),e,t)?(a=i-Gu(n.year(),e,t),s=n.year()+1):(s=n.year(),a=i),{week:a,year:s}}function Gu(n,e,t){var r=__(n,e,t),i=__(n+1,e,t);return(Jm(n)-r+i)/7}ht("w",["ww",2],"wo","week");ht("W",["WW",2],"Wo","isoWeek");rt("w",Yn,$p);rt("ww",Yn,As);rt("W",Yn,$p);rt("WW",Yn,As);vv(["w","ww","W","WW"],function(n,e,t,r){e[r.substr(0,1)]=sn(n)});function $ue(n){return Rg(n,this._week.dow,this._week.doy).week}var Bue={dow:0,doy:6};function Uue(){return this._week.dow}function jue(){return this._week.doy}function que(n){var e=this.localeData().week(this);return n==null?e:this.add((n-e)*7,"d")}function zue(n){var e=Rg(this,1,4).week;return n==null?e:this.add((n-e)*7,"d")}ht("d",0,"do","day");ht("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)});ht("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)});ht("dddd",0,0,function(n){return this.localeData().weekdays(this,n)});ht("e",0,0,"weekday");ht("E",0,0,"isoWeekday");rt("d",Yn);rt("e",Yn);rt("E",Yn);rt("dd",function(n,e){return e.weekdaysMinRegex(n)});rt("ddd",function(n,e){return e.weekdaysShortRegex(n)});rt("dddd",function(n,e){return e.weekdaysRegex(n)});vv(["dd","ddd","dddd"],function(n,e,t,r){var i=t._locale.weekdaysParse(n,r,t._strict);i!=null?e.d=i:Bt(t).invalidWeekday=n});vv(["d","e","E"],function(n,e,t,r){e[r]=sn(n)});function Wue(n,e){return typeof n!="string"?n:isNaN(n)?(n=e.weekdaysParse(n),typeof n=="number"?n:null):parseInt(n,10)}function Hue(n,e){return typeof n=="string"?e.weekdaysParse(n)%7||7:isNaN(n)?null:n}function xT(n,e){return n.slice(e,7).concat(n.slice(0,e))}var Gue="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),rF="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Kue="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Yue=gv,Xue=gv,Jue=gv;function Que(n,e){var t=ic(this._weekdays)?this._weekdays:this._weekdays[n&&n!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return n===!0?xT(t,this._week.dow):n?t[n.day()]:t}function Zue(n){return n===!0?xT(this._weekdaysShort,this._week.dow):n?this._weekdaysShort[n.day()]:this._weekdaysShort}function ele(n){return n===!0?xT(this._weekdaysMin,this._week.dow):n?this._weekdaysMin[n.day()]:this._weekdaysMin}function tle(n,e,t){var r,i,a,s=n.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=su([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return t?e==="dddd"?(i=Or.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=Or.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=Or.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=Or.call(this._weekdaysParse,s),i!==-1||(i=Or.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=Or.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=Or.call(this._shortWeekdaysParse,s),i!==-1||(i=Or.call(this._weekdaysParse,s),i!==-1)?i:(i=Or.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=Or.call(this._minWeekdaysParse,s),i!==-1||(i=Or.call(this._weekdaysParse,s),i!==-1)?i:(i=Or.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function nle(n,e,t){var r,i,a;if(this._weekdaysParseExact)return tle.call(this,n,e,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=su([2e3,1]).day(r),t&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),t&&e==="dddd"&&this._fullWeekdaysParse[r].test(n))return r;if(t&&e==="ddd"&&this._shortWeekdaysParse[r].test(n))return r;if(t&&e==="dd"&&this._minWeekdaysParse[r].test(n))return r;if(!t&&this._weekdaysParse[r].test(n))return r}}function rle(n){if(!this.isValid())return n!=null?this:NaN;var e=Eg(this,"Day");return n!=null?(n=Wue(n,this.localeData()),this.add(n-e,"d")):e}function ile(n){if(!this.isValid())return n!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return n==null?e:this.add(n-e,"d")}function ale(n){if(!this.isValid())return n!=null?this:NaN;if(n!=null){var e=Hue(n,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function sle(n){return this._weekdaysParseExact?(_n(this,"_weekdaysRegex")||wT.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(_n(this,"_weekdaysRegex")||(this._weekdaysRegex=Yue),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function ole(n){return this._weekdaysParseExact?(_n(this,"_weekdaysRegex")||wT.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(_n(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Xue),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function cle(n){return this._weekdaysParseExact?(_n(this,"_weekdaysRegex")||wT.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(_n(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Jue),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function wT(){function n(l,d){return d.length-l.length}var e=[],t=[],r=[],i=[],a,s,o,c,u;for(a=0;a<7;a++)s=su([2e3,1]).day(a),o=Vu(this.weekdaysMin(s,"")),c=Vu(this.weekdaysShort(s,"")),u=Vu(this.weekdays(s,"")),e.push(o),t.push(c),r.push(u),i.push(o),i.push(c),i.push(u);e.sort(n),t.sort(n),r.sort(n),i.sort(n),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function CT(){return this.hours()%12||12}function ule(){return this.hours()||24}ht("H",["HH",2],0,"hour");ht("h",["hh",2],0,CT);ht("k",["kk",2],0,ule);ht("hmm",0,0,function(){return""+CT.apply(this)+Jc(this.minutes(),2)});ht("hmmss",0,0,function(){return""+CT.apply(this)+Jc(this.minutes(),2)+Jc(this.seconds(),2)});ht("Hmm",0,0,function(){return""+this.hours()+Jc(this.minutes(),2)});ht("Hmmss",0,0,function(){return""+this.hours()+Jc(this.minutes(),2)+Jc(this.seconds(),2)});function iF(n,e){ht(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}iF("a",!0);iF("A",!1);function aF(n,e){return e._meridiemParse}rt("a",aF);rt("A",aF);rt("H",Yn,_T);rt("h",Yn,$p);rt("k",Yn,$p);rt("HH",Yn,As);rt("hh",Yn,As);rt("kk",Yn,As);rt("hmm",GL);rt("hmmss",KL);rt("Hmm",GL);rt("Hmmss",KL);In(["H","HH"],ii);In(["k","kk"],function(n,e,t){var r=sn(n);e[ii]=r===24?0:r});In(["a","A"],function(n,e,t){t._isPm=t._locale.isPM(n),t._meridiem=n});In(["h","hh"],function(n,e,t){e[ii]=sn(n),Bt(t).bigHour=!0});In("hmm",function(n,e,t){var r=n.length-2;e[ii]=sn(n.substr(0,r)),e[Qo]=sn(n.substr(r)),Bt(t).bigHour=!0});In("hmmss",function(n,e,t){var r=n.length-4,i=n.length-2;e[ii]=sn(n.substr(0,r)),e[Qo]=sn(n.substr(r,2)),e[Hu]=sn(n.substr(i)),Bt(t).bigHour=!0});In("Hmm",function(n,e,t){var r=n.length-2;e[ii]=sn(n.substr(0,r)),e[Qo]=sn(n.substr(r))});In("Hmmss",function(n,e,t){var r=n.length-4,i=n.length-2;e[ii]=sn(n.substr(0,r)),e[Qo]=sn(n.substr(r,2)),e[Hu]=sn(n.substr(i))});function lle(n){return(n+"").toLowerCase().charAt(0)==="p"}var dle=/[ap]\.?m?\.?/i,fle=Bp("Hours",!0);function hle(n,e,t){return n>11?t?"pm":"PM":t?"am":"AM"}var sF={calendar:eue,longDateFormat:iue,invalidDate:sue,ordinal:cue,dayOfMonthOrdinalParse:uue,relativeTime:due,months:Eue,monthsShort:JL,week:Bue,weekdays:Gue,weekdaysMin:Kue,weekdaysShort:rF,meridiemParse:dle},tr={},xm={},Ag;function ple(n,e){var t,r=Math.min(n.length,e.length);for(t=0;t<r;t+=1)if(n[t]!==e[t])return t;return r}function cI(n){return n&&n.toLowerCase().replace("_","-")}function mle(n){for(var e=0,t,r,i,a;e<n.length;){for(a=cI(n[e]).split("-"),t=a.length,r=cI(n[e+1]),r=r?r.split("-"):null;t>0;){if(i=Pb(a.slice(0,t).join("-")),i)return i;if(r&&r.length>=t&&ple(a,r)>=t-1)break;t--}e++}return Ag}function gle(n){return!!(n&&n.match("^[^/\\\\]*$"))}function Pb(n){var e=null,t;if(tr[n]===void 0&&typeof dg<"u"&&dg&&dg.exports&&gle(n))try{e=Ag._abbr,t=require,t("./locale/"+n),jl(e)}catch{tr[n]=null}return tr[n]}function jl(n,e){var t;return n&&(Aa(e)?t=sl(n):t=kT(n,e),t?Ag=t:typeof console<"u"&&console.warn&&console.warn("Locale "+n+" not found. Did you forget to load it?")),Ag._abbr}function kT(n,e){if(e!==null){var t,r=sF;if(e.abbr=n,tr[n]!=null)zL("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=tr[n]._config;else if(e.parentLocale!=null)if(tr[e.parentLocale]!=null)r=tr[e.parentLocale]._config;else if(t=Pb(e.parentLocale),t!=null)r=t._config;else return xm[e.parentLocale]||(xm[e.parentLocale]=[]),xm[e.parentLocale].push({name:n,config:e}),null;return tr[n]=new pT(bk(r,e)),xm[n]&&xm[n].forEach(function(i){kT(i.name,i.config)}),jl(n),tr[n]}else return delete tr[n],null}function vle(n,e){if(e!=null){var t,r,i=sF;
vendor: 8,578 bytes, line 3876
3876tr[n]!=null&&tr[n].parentLocale!=null?tr[n].set(bk(tr[n]._config,e)):(r=Pb(n),r!=null&&(i=r._config),e=bk(i,e),r==null&&(e.abbr=n),t=new pT(e),t.parentLocale=tr[n],tr[n]=t),jl(n)}else tr[n]!=null&&(tr[n].parentLocale!=null?(tr[n]=tr[n].parentLocale,n===jl()&&jl(n)):tr[n]!=null&&delete tr[n]);return tr[n]}function sl(n){var e;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return Ag;if(!ic(n)){if(e=Pb(n),e)return e;n=[n]}return mle(n)}function yle(){return xk(tr)}function ST(n){var e,t=n._a;return t&&Bt(n).overflow===-2&&(e=t[Wu]<0||t[Wu]>11?Wu:t[Nc]<1||t[Nc]>bT(t[Xi],t[Wu])?Nc:t[ii]<0||t[ii]>24||t[ii]===24&&(t[Qo]!==0||t[Hu]!==0||t[Gd]!==0)?ii:t[Qo]<0||t[Qo]>59?Qo:t[Hu]<0||t[Hu]>59?Hu:t[Gd]<0||t[Gd]>999?Gd:-1,Bt(n)._overflowDayOfYear&&(e<Xi||e>Nc)&&(e=Nc),Bt(n)._overflowWeeks&&e===-1&&(e=xue),Bt(n)._overflowWeekday&&e===-1&&(e=wue),Bt(n).overflow=e),n}var _le=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ble=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,xle=/Z|[+-]\d\d(?::?\d\d)?/,B0=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],$w=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],wle=/^\/?Date\((-?\d+)/i,Cle=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,kle={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function oF(n){var e,t,r=n._i,i=_le.exec(r)||ble.exec(r),a,s,o,c,u=B0.length,l=$w.length;if(i){for(Bt(n).iso=!0,e=0,t=u;e<t;e++)if(B0[e][1].exec(i[1])){s=B0[e][0],a=B0[e][2]!==!1;break}if(s==null){n._isValid=!1;return}if(i[3]){for(e=0,t=l;e<t;e++)if($w[e][1].exec(i[3])){o=(i[2]||" ")+$w[e][0];break}if(o==null){n._isValid=!1;return}}if(!a&&o!=null){n._isValid=!1;return}if(i[4])if(xle.exec(i[4]))c="Z";else{n._isValid=!1;return}n._f=s+(o||"")+(c||""),ET(n)}else n._isValid=!1}function Sle(n,e,t,r,i,a){var s=[Tle(n),JL.indexOf(e),parseInt(t,10),parseInt(r,10),parseInt(i,10)];return a&&s.push(parseInt(a,10)),s}function Tle(n){var e=parseInt(n,10);return e<=49?2e3+e:e<=999?1900+e:e}function Ele(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ple(n,e,t){if(n){var r=rF.indexOf(n),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return Bt(t).weekdayMismatch=!0,t._isValid=!1,!1}return!0}function Rle(n,e,t){if(n)return kle[n];if(e)return 0;var r=parseInt(t,10),i=r%100,a=(r-i)/100;return a*60+i}function cF(n){var e=Cle.exec(Ele(n._i)),t;if(e){if(t=Sle(e[4],e[3],e[2],e[5],e[6],e[7]),!Ple(e[1],t,n))return;n._a=t,n._tzm=Rle(e[8],e[9],e[10]),n._d=Pg.apply(null,n._a),n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),Bt(n).rfc2822=!0}else n._isValid=!1}function Ale(n){var e=wle.exec(n._i);if(e!==null){n._d=new Date(+e[1]);return}if(oF(n),n._isValid===!1)delete n._isValid;else return;if(cF(n),n._isValid===!1)delete n._isValid;else return;n._strict?n._isValid=!1:Le.createFromInputFallback(n)}Le.createFromInputFallback=_o("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(n){n._d=new Date(n._i+(n._useUTC?" UTC":""))});function xh(n,e,t){return n??e??t}function Ile(n){var e=new Date(Le.now());return n._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function TT(n){var e,t,r=[],i,a,s;if(!n._d){for(i=Ile(n),n._w&&n._a[Nc]==null&&n._a[Wu]==null&&Ole(n),n._dayOfYear!=null&&(s=xh(n._a[Xi],i[Xi]),(n._dayOfYear>Jm(s)||n._dayOfYear===0)&&(Bt(n)._overflowDayOfYear=!0),t=Pg(s,0,n._dayOfYear),n._a[Wu]=t.getUTCMonth(),n._a[Nc]=t.getUTCDate()),e=0;e<3&&n._a[e]==null;++e)n._a[e]=r[e]=i[e];for(;e<7;e++)n._a[e]=r[e]=n._a[e]==null?e===2?1:0:n._a[e];n._a[ii]===24&&n._a[Qo]===0&&n._a[Hu]===0&&n._a[Gd]===0&&(n._nextDay=!0,n._a[ii]=0),n._d=(n._useUTC?Pg:Fue).apply(null,r),a=n._useUTC?n._d.getUTCDay():n._d.getDay(),n._tzm!=null&&n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),n._nextDay&&(n._a[ii]=24),n._w&&typeof n._w.d<"u"&&n._w.d!==a&&(Bt(n).weekdayMismatch=!0)}}function Ole(n){var e,t,r,i,a,s,o,c,u;e=n._w,e.GG!=null||e.W!=null||e.E!=null?(a=1,s=4,t=xh(e.GG,n._a[Xi],Rg(Kn(),1,4).year),r=xh(e.W,1),i=xh(e.E,1),(i<1||i>7)&&(c=!0)):(a=n._locale._week.dow,s=n._locale._week.doy,u=Rg(Kn(),a,s),t=xh(e.gg,n._a[Xi],u.year),r=xh(e.w,u.week),e.d!=null?(i=e.d,(i<0||i>6)&&(c=!0)):e.e!=null?(i=e.e+a,(e.e<0||e.e>6)&&(c=!0)):i=a),r<1||r>Gu(t,a,s)?Bt(n)._overflowWeeks=!0:c!=null?Bt(n)._overflowWeekday=!0:(o=nF(t,r,i,a,s),n._a[Xi]=o.year,n._dayOfYear=o.dayOfYear)}Le.ISO_8601=function(){};Le.RFC_2822=function(){};function ET(n){if(n._f===Le.ISO_8601){oF(n);return}if(n._f===Le.RFC_2822){cF(n);return}n._a=[],Bt(n).empty=!0;var e=""+n._i,t,r,i,a,s,o=e.length,c=0,u,l;for(i=WL(n._f,n._locale).match(mT)||[],l=i.length,t=0;t<l;t++)a=i[t],r=(e.match(yue(a,n))||[])[0],r&&(s=e.substr(0,e.indexOf(r)),s.length>0&&Bt(n).unusedInput.push(s),e=e.slice(e.indexOf(r)+r.length),c+=r.length),zh[a]?(r?Bt(n).empty=!1:Bt(n).unusedTokens.push(a),bue(a,r,n)):n._strict&&!r&&Bt(n).unusedTokens.push(a);Bt(n).charsLeftOver=o-c,e.length>0&&Bt(n).unusedInput.push(e),n._a[ii]<=12&&Bt(n).bigHour===!0&&n._a[ii]>0&&(Bt(n).bigHour=void 0),Bt(n).parsedDateParts=n._a.slice(0),Bt(n).meridiem=n._meridiem,n._a[ii]=Mle(n._locale,n._a[ii],n._meridiem),u=Bt(n).era,u!==null&&(n._a[Xi]=n._locale.erasConvertYear(u,n._a[Xi])),TT(n),ST(n)}function Mle(n,e,t){var r;return t==null?e:n.meridiemHour!=null?n.meridiemHour(e,t):(n.isPM!=null&&(r=n.isPM(t),r&&e<12&&(e+=12),!r&&e===12&&(e=0)),e)}function Dle(n){var e,t,r,i,a,s,o=!1,c=n._f.length;if(c===0){Bt(n).invalidFormat=!0,n._d=new Date(NaN);return}for(i=0;i<c;i++)a=0,s=!1,e=hT({},n),n._useUTC!=null&&(e._useUTC=n._useUTC),e._f=n._f[i],ET(e),fT(e)&&(s=!0),a+=Bt(e).charsLeftOver,a+=Bt(e).unusedTokens.length*10,Bt(e).score=a,o?a<r&&(r=a,t=e):(r==null||a<r||s)&&(r=a,t=e,s&&(o=!0));Al(n,t||e)}function Nle(n){if(!n._d){var e=gT(n._i),t=e.day===void 0?e.date:e.day;n._a=jL([e.year,e.month,t,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),TT(n)}}function Lle(n){var e=new mv(ST(uF(n)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function uF(n){var e=n._i,t=n._f;return n._locale=n._locale||sl(n._l),e===null||t===void 0&&e===""?xb({nullInput:!0}):(typeof e=="string"&&(n._i=e=n._locale.preparse(e)),ac(e)?new mv(ST(e)):(pv(e)?n._d=e:ic(t)?Dle(n):t?ET(n):Fle(n),fT(n)||(n._d=null),n))}function Fle(n){var e=n._i;Aa(e)?n._d=new Date(Le.now()):pv(e)?n._d=new Date(e.valueOf()):typeof e=="string"?Ale(n):ic(e)?(n._a=jL(e.slice(0),function(t){return parseInt(t,10)}),TT(n)):nf(e)?Nle(n):Xu(e)?n._d=new Date(e):Le.createFromInputFallback(n)}function lF(n,e,t,r,i){var a={};return(e===!0||e===!1)&&(r=e,e=void 0),(t===!0||t===!1)&&(r=t,t=void 0),(nf(n)&&dT(n)||ic(n)&&n.length===0)&&(n=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=t,a._i=n,a._f=e,a._strict=r,Lle(a)}function Kn(n,e,t,r){return lF(n,e,t,r,!1)}var $le=_o("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=Kn.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:xb()}),Ble=_o("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=Kn.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:xb()});function dF(n,e){var t,r;if(e.length===1&&ic(e[0])&&(e=e[0]),!e.length)return Kn();for(t=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][n](t))&&(t=e[r]);return t}function Ule(){var n=[].slice.call(arguments,0);return dF("isBefore",n)}function jle(){var n=[].slice.call(arguments,0);
vendor: 8,673 bytes, line 3876
3876return dF("isAfter",n)}var qle=function(){return Date.now?Date.now():+new Date},wm=["year","quarter","month","week","day","hour","minute","second","millisecond"];function zle(n){var e,t=!1,r,i=wm.length;for(e in n)if(_n(n,e)&&!(Or.call(wm,e)!==-1&&(n[e]==null||!isNaN(n[e]))))return!1;for(r=0;r<i;++r)if(n[wm[r]]){if(t)return!1;parseFloat(n[wm[r]])!==sn(n[wm[r]])&&(t=!0)}return!0}function Wle(){return this._isValid}function Hle(){return uc(NaN)}function Rb(n){var e=gT(n),t=e.year||0,r=e.quarter||0,i=e.month||0,a=e.week||e.isoWeek||0,s=e.day||0,o=e.hour||0,c=e.minute||0,u=e.second||0,l=e.millisecond||0;this._isValid=zle(e),this._milliseconds=+l+u*1e3+c*6e4+o*1e3*60*60,this._days=+s+a*7,this._months=+i+r*3+t*12,this._data={},this._locale=sl(),this._bubble()}function ly(n){return n instanceof Rb}function Ck(n){return n<0?Math.round(-1*n)*-1:Math.round(n)}function Vle(n,e,t){var r=Math.min(n.length,e.length),i=Math.abs(n.length-e.length),a=0,s;for(s=0;s<r;s++)sn(n[s])!==sn(e[s])&&a++;return a+i}function fF(n,e){ht(n,0,0,function(){var t=this.utcOffset(),r="+";return t<0&&(t=-t,r="-"),r+Jc(~~(t/60),2)+e+Jc(~~t%60,2)})}fF("Z",":");fF("ZZ","");rt("Z",Tb);rt("ZZ",Tb);In(["Z","ZZ"],function(n,e,t){t._useUTC=!0,t._tzm=PT(Tb,n)});var Gle=/([\+\-]|\d\d)/gi;function PT(n,e){var t=(e||"").match(n),r,i,a;return t===null?null:(r=t[t.length-1]||[],i=(r+"").match(Gle)||["-",0,0],a=+(i[1]*60)+sn(i[2]),a===0?0:i[0]==="+"?a:-a)}function RT(n,e){var t,r;return e._isUTC?(t=e.clone(),r=(ac(n)||pv(n)?n.valueOf():Kn(n).valueOf())-t.valueOf(),t._d.setTime(t._d.valueOf()+r),Le.updateOffset(t,!1),t):Kn(n).local()}function kk(n){return-Math.round(n._d.getTimezoneOffset())}Le.updateOffset=function(){};function Kle(n,e,t){var r=this._offset||0,i;if(!this.isValid())return n!=null?this:NaN;if(n!=null){if(typeof n=="string"){if(n=PT(Tb,n),n===null)return this}else Math.abs(n)<16&&!t&&(n=n*60);return!this._isUTC&&e&&(i=kk(this)),this._offset=n,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==n&&(!e||this._changeInProgress?mF(this,uc(n-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,Le.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:kk(this)}function Yle(n,e){return n!=null?(typeof n!="string"&&(n=-n),this.utcOffset(n,e),this):-this.utcOffset()}function Xle(n){return this.utcOffset(0,n)}function Jle(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(kk(this),"m")),this}function Qle(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var n=PT(gue,this._i);n!=null?this.utcOffset(n):this.utcOffset(0,!0)}return this}function Zle(n){return this.isValid()?(n=n?Kn(n).utcOffset():0,(this.utcOffset()-n)%60===0):!1}function ede(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function tde(){if(!Aa(this._isDSTShifted))return this._isDSTShifted;var n={},e;return hT(n,this),n=uF(n),n._a?(e=n._isUTC?su(n._a):Kn(n._a),this._isDSTShifted=this.isValid()&&Vle(n._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function nde(){return this.isValid()?!this._isUTC:!1}function rde(){return this.isValid()?this._isUTC:!1}function hF(){return this.isValid()?this._isUTC&&this._offset===0:!1}var ide=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,ade=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function uc(n,e){var t=n,r=null,i,a,s;return ly(n)?t={ms:n._milliseconds,d:n._days,M:n._months}:Xu(n)||!isNaN(+n)?(t={},e?t[e]=+n:t.milliseconds=+n):(r=ide.exec(n))?(i=r[1]==="-"?-1:1,t={y:0,d:sn(r[Nc])*i,h:sn(r[ii])*i,m:sn(r[Qo])*i,s:sn(r[Hu])*i,ms:sn(Ck(r[Gd]*1e3))*i}):(r=ade.exec(n))?(i=r[1]==="-"?-1:1,t={y:Rd(r[2],i),M:Rd(r[3],i),w:Rd(r[4],i),d:Rd(r[5],i),h:Rd(r[6],i),m:Rd(r[7],i),s:Rd(r[8],i)}):t==null?t={}:typeof t=="object"&&("from"in t||"to"in t)&&(s=sde(Kn(t.from),Kn(t.to)),t={},t.ms=s.milliseconds,t.M=s.months),a=new Rb(t),ly(n)&&_n(n,"_locale")&&(a._locale=n._locale),ly(n)&&_n(n,"_isValid")&&(a._isValid=n._isValid),a}uc.fn=Rb.prototype;uc.invalid=Hle;function Rd(n,e){var t=n&&parseFloat(n.replace(",","."));return(isNaN(t)?0:t)*e}function uI(n,e){var t={};return t.months=e.month()-n.month()+(e.year()-n.year())*12,n.clone().add(t.months,"M").isAfter(e)&&--t.months,t.milliseconds=+e-+n.clone().add(t.months,"M"),t}function sde(n,e){var t;return n.isValid()&&e.isValid()?(e=RT(e,n),n.isBefore(e)?t=uI(n,e):(t=uI(e,n),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function pF(n,e){return function(t,r){var i,a;return r!==null&&!isNaN(+r)&&(zL(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=t,t=r,r=a),i=uc(t,r),mF(this,i,n),this}}function mF(n,e,t,r){var i=e._milliseconds,a=Ck(e._days),s=Ck(e._months);n.isValid()&&(r=r??!0,s&&ZL(n,Eg(n,"Month")+s*t),a&&XL(n,"Date",Eg(n,"Date")+a*t),i&&n._d.setTime(n._d.valueOf()+i*t),r&&Le.updateOffset(n,a||s))}var ode=pF(1,"add"),cde=pF(-1,"subtract");function gF(n){return typeof n=="string"||n instanceof String}function ude(n){return ac(n)||pv(n)||gF(n)||Xu(n)||dde(n)||lde(n)||n===null||n===void 0}function lde(n){var e=nf(n)&&!dT(n),t=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,a,s=r.length;for(i=0;i<s;i+=1)a=r[i],t=t||_n(n,a);return e&&t}function dde(n){var e=ic(n),t=!1;return e&&(t=n.filter(function(r){return!Xu(r)&&gF(n)}).length===0),e&&t}function fde(n){var e=nf(n)&&!dT(n),t=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,a;for(i=0;i<r.length;i+=1)a=r[i],t=t||_n(n,a);return e&&t}function hde(n,e){var t=n.diff(e,"days",!0);return t<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"}function pde(n,e){arguments.length===1&&(arguments[0]?ude(arguments[0])?(n=arguments[0],e=void 0):fde(arguments[0])&&(e=arguments[0],n=void 0):(n=void 0,e=void 0));var t=n||Kn(),r=RT(t,this).startOf("day"),i=Le.calendarFormat(this,r)||"sameElse",a=e&&(ou(e[i])?e[i].call(this,t):e[i]);return this.format(a||this.localeData().calendar(i,this,Kn(t)))}function mde(){return new mv(this)}function gde(n,e){var t=ac(n)?n:Kn(n);return this.isValid()&&t.isValid()?(e=bo(e)||"millisecond",e==="millisecond"?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf()):!1}function vde(n,e){var t=ac(n)?n:Kn(n);return this.isValid()&&t.isValid()?(e=bo(e)||"millisecond",e==="millisecond"?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf()):!1}function yde(n,e,t,r){var i=ac(n)?n:Kn(n),a=ac(e)?e:Kn(e);return this.isValid()&&i.isValid()&&a.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,t):!this.isBefore(i,t))&&(r[1]===")"?this.isBefore(a,t):!this.isAfter(a,t))):!1}function _de(n,e){var t=ac(n)?n:Kn(n),r;return this.isValid()&&t.isValid()?(e=bo(e)||"millisecond",e==="millisecond"?this.valueOf()===t.valueOf():(r=t.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf())):!1}function bde(n,e){return this.isSame(n,e)||this.isAfter(n,e)}function xde(n,e){return this.isSame(n,e)||this.isBefore(n,e)}function wde(n,e,t){var r,i,a;if(!this.isValid())return NaN;if(r=RT(n,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=bo(e),e){case"year":a=dy(this,r)/12;break;case"month":a=dy(this,r);break;case"quarter":a=dy(this,r)/3;break;case"second":a=(this-r)/1e3;break;case"minute":a=(this-r)/6e4;break;case"hour":a=(this-r)/36e5;break;case"day":a=(this-r-i)/864e5;break;case"week":a=(this-r-i)/6048e5;break;default:a=this-r}return t?a:so(a)}function dy(n,e){if(n.date()<e.date())return-dy(e,n);var t=(e.year()-n.year())*12+(e.month()-n.month()),r=n.clone().add(t,"months"),i,a;return e-r<0?(i=n.clone().add(t-1,"months"),a=(e-r)/(r-i)):(i=n.clone().add(t+1,"months"),a=(e-r)/(i-r)),-(t+a)||0}Le.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";Le.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Cde(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function kde(n){if(!this.isValid())return null;var e=n!==!0,t=e?this.clone().utc():this;return t.year()<0||t.year()>9999?uy(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):ou(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",uy(t,"Z")):uy(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}
vendor: 15,904 bytes, line 3876
3876function Sde(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var n="moment",e="",t,r,i,a;return this.isLocal()||(n=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),t="["+n+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",a=e+'[")]',this.format(t+r+i+a)}function Tde(n){n||(n=this.isUtc()?Le.defaultFormatUtc:Le.defaultFormat);var e=uy(this,n);return this.localeData().postformat(e)}function Ede(n,e){return this.isValid()&&(ac(n)&&n.isValid()||Kn(n).isValid())?uc({to:this,from:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Pde(n){return this.from(Kn(),n)}function Rde(n,e){return this.isValid()&&(ac(n)&&n.isValid()||Kn(n).isValid())?uc({from:this,to:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Ade(n){return this.to(Kn(),n)}function vF(n){var e;return n===void 0?this._locale._abbr:(e=sl(n),e!=null&&(this._locale=e),this)}var yF=_o("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(n){return n===void 0?this.localeData():this.locale(n)});function _F(){return this._locale}var b_=1e3,Wh=60*b_,x_=60*Wh,bF=(365*400+97)*24*x_;function Hh(n,e){return(n%e+e)%e}function xF(n,e,t){return n<100&&n>=0?new Date(n+400,e,t)-bF:new Date(n,e,t).valueOf()}function wF(n,e,t){return n<100&&n>=0?Date.UTC(n+400,e,t)-bF:Date.UTC(n,e,t)}function Ide(n){var e,t;if(n=bo(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?wF:xF,n){case"year":e=t(this.year(),0,1);break;case"quarter":e=t(this.year(),this.month()-this.month()%3,1);break;case"month":e=t(this.year(),this.month(),1);break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=t(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Hh(e+(this._isUTC?0:this.utcOffset()*Wh),x_);break;case"minute":e=this._d.valueOf(),e-=Hh(e,Wh);break;case"second":e=this._d.valueOf(),e-=Hh(e,b_);break}return this._d.setTime(e),Le.updateOffset(this,!0),this}function Ode(n){var e,t;if(n=bo(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?wF:xF,n){case"year":e=t(this.year()+1,0,1)-1;break;case"quarter":e=t(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=t(this.year(),this.month()+1,1)-1;break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=t(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=x_-Hh(e+(this._isUTC?0:this.utcOffset()*Wh),x_)-1;break;case"minute":e=this._d.valueOf(),e+=Wh-Hh(e,Wh)-1;break;case"second":e=this._d.valueOf(),e+=b_-Hh(e,b_)-1;break}return this._d.setTime(e),Le.updateOffset(this,!0),this}function Mde(){return this._d.valueOf()-(this._offset||0)*6e4}function Dde(){return Math.floor(this.valueOf()/1e3)}function Nde(){return new Date(this.valueOf())}function Lde(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function Fde(){var n=this;return{years:n.year(),months:n.month(),date:n.date(),hours:n.hours(),minutes:n.minutes(),seconds:n.seconds(),milliseconds:n.milliseconds()}}function $de(){return this.isValid()?this.toISOString():null}function Bde(){return fT(this)}function Ude(){return Al({},Bt(this))}function jde(){return Bt(this).overflow}function qde(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ht("N",0,0,"eraAbbr");ht("NN",0,0,"eraAbbr");ht("NNN",0,0,"eraAbbr");ht("NNNN",0,0,"eraName");ht("NNNNN",0,0,"eraNarrow");ht("y",["y",1],"yo","eraYear");ht("y",["yy",2],0,"eraYear");ht("y",["yyy",3],0,"eraYear");ht("y",["yyyy",4],0,"eraYear");rt("N",AT);rt("NN",AT);rt("NNN",AT);rt("NNNN",Zde);rt("NNNNN",efe);In(["N","NN","NNN","NNNN","NNNNN"],function(n,e,t,r){var i=t._locale.erasParse(n,r,t._strict);i?Bt(t).era=i:Bt(t).invalidEra=n});rt("y",Fp);rt("yy",Fp);rt("yyy",Fp);rt("yyyy",Fp);rt("yo",tfe);In(["y","yy","yyy","yyyy"],Xi);In(["yo"],function(n,e,t,r){var i;t._locale._eraYearOrdinalRegex&&(i=n.match(t._locale._eraYearOrdinalRegex)),t._locale.eraYearOrdinalParse?e[Xi]=t._locale.eraYearOrdinalParse(n,i):e[Xi]=parseInt(n,10)});function zde(n,e){var t,r,i,a=this._eras||sl("en")._eras;for(t=0,r=a.length;t<r;++t){switch(typeof a[t].since){case"string":i=Le(a[t].since).startOf("day"),a[t].since=i.valueOf();break}switch(typeof a[t].until){case"undefined":a[t].until=1/0;break;case"string":i=Le(a[t].until).startOf("day").valueOf(),a[t].until=i.valueOf();break}}return a}function Wde(n,e,t){var r,i,a=this.eras(),s,o,c;for(n=n.toUpperCase(),r=0,i=a.length;r<i;++r)if(s=a[r].name.toUpperCase(),o=a[r].abbr.toUpperCase(),c=a[r].narrow.toUpperCase(),t)switch(e){case"N":case"NN":case"NNN":if(o===n)return a[r];break;case"NNNN":if(s===n)return a[r];break;case"NNNNN":if(c===n)return a[r];break}else if([s,o,c].indexOf(n)>=0)return a[r]}function Hde(n,e){var t=n.since<=n.until?1:-1;return e===void 0?Le(n.since).year():Le(n.since).year()+(e-n.offset)*t}function Vde(){var n,e,t,r=this.localeData().eras();for(n=0,e=r.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),r[n].since<=t&&t<=r[n].until||r[n].until<=t&&t<=r[n].since)return r[n].name;return""}function Gde(){var n,e,t,r=this.localeData().eras();for(n=0,e=r.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),r[n].since<=t&&t<=r[n].until||r[n].until<=t&&t<=r[n].since)return r[n].narrow;return""}function Kde(){var n,e,t,r=this.localeData().eras();for(n=0,e=r.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),r[n].since<=t&&t<=r[n].until||r[n].until<=t&&t<=r[n].since)return r[n].abbr;return""}function Yde(){var n,e,t,r,i=this.localeData().eras();for(n=0,e=i.length;n<e;++n)if(t=i[n].since<=i[n].until?1:-1,r=this.clone().startOf("day").valueOf(),i[n].since<=r&&r<=i[n].until||i[n].until<=r&&r<=i[n].since)return(this.year()-Le(i[n].since).year())*t+i[n].offset;return this.year()}function Xde(n){return _n(this,"_erasNameRegex")||IT.call(this),n?this._erasNameRegex:this._erasRegex}function Jde(n){return _n(this,"_erasAbbrRegex")||IT.call(this),n?this._erasAbbrRegex:this._erasRegex}function Qde(n){return _n(this,"_erasNarrowRegex")||IT.call(this),n?this._erasNarrowRegex:this._erasRegex}function AT(n,e){return e.erasAbbrRegex(n)}function Zde(n,e){return e.erasNameRegex(n)}function efe(n,e){return e.erasNarrowRegex(n)}function tfe(n,e){return e._eraYearOrdinalRegex||Fp}function IT(){var n=[],e=[],t=[],r=[],i,a,s,o,c,u=this.eras();for(i=0,a=u.length;i<a;++i)s=Vu(u[i].name),o=Vu(u[i].abbr),c=Vu(u[i].narrow),e.push(s),n.push(o),t.push(c),r.push(s),r.push(o),r.push(c);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+t.join("|")+")","i")}ht(0,["gg",2],0,function(){return this.weekYear()%100});ht(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ab(n,e){ht(0,[n,n.length],0,e)}Ab("gggg","weekYear");Ab("ggggg","weekYear");Ab("GGGG","isoWeekYear");Ab("GGGGG","isoWeekYear");rt("G",Sb);rt("g",Sb);rt("GG",Yn,As);rt("gg",Yn,As);rt("GGGG",yT,vT);rt("gggg",yT,vT);rt("GGGGG",kb,wb);rt("ggggg",kb,wb);vv(["gggg","ggggg","GGGG","GGGGG"],function(n,e,t,r){e[r.substr(0,2)]=sn(n)});vv(["gg","GG"],function(n,e,t,r){e[r]=Le.parseTwoDigitYear(n)});function nfe(n){return CF.call(this,n,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function rfe(n){return CF.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function ife(){return Gu(this.year(),1,4)}function afe(){return Gu(this.isoWeekYear(),1,4)}function sfe(){var n=this.localeData()._week;return Gu(this.year(),n.dow,n.doy)}function ofe(){var n=this.localeData()._week;return Gu(this.weekYear(),n.dow,n.doy)}function CF(n,e,t,r,i){var a;return n==null?Rg(this,r,i).year:(a=Gu(n,r,i),e>a&&(e=a),cfe.call(this,n,e,t,r,i))}function cfe(n,e,t,r,i){var a=nF(n,e,t,r,i),s=Pg(a.year,0,a.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}ht("Q",0,"Qo","quarter");rt("Q",HL);In("Q",function(n,e){e[Wu]=(sn(n)-1)*3});function ufe(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)}ht("D",["DD",2],"Do","date");rt("D",Yn,$p);rt("DD",Yn,As);rt("Do",function(n,e){return n?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});In(["D","DD"],Nc);In("Do",function(n,e){e[Nc]=sn(n.match(Yn)[0])});var kF=Bp("Date",!0);ht("DDD",["DDDD",3],"DDDo","dayOfYear");rt("DDD",Cb);rt("DDDD",VL);In(["DDD","DDDD"],function(n,e,t){t._dayOfYear=sn(n)});function lfe(n){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return n==null?e:this.add(n-e,"d")}ht("m",["mm",2],0,"minute");rt("m",Yn,_T);rt("mm",Yn,As);In(["m","mm"],Qo);var dfe=Bp("Minutes",!1);ht("s",["ss",2],0,"second");rt("s",Yn,_T);rt("ss",Yn,As);In(["s","ss"],Hu);var ffe=Bp("Seconds",!1);ht("S",0,0,function(){return~~(this.millisecond()/100)});ht(0,["SS",2],0,function(){return~~(this.millisecond()/10)});ht(0,["SSS",3],0,"millisecond");ht(0,["SSSS",4],0,function(){return this.millisecond()*10});ht(0,["SSSSS",5],0,function(){return this.millisecond()*100});ht(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});ht(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});ht(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});ht(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});rt("S",Cb,HL);rt("SS",Cb,As);rt("SSS",Cb,VL);var Il,SF;for(Il="SSSS";Il.length<=9;Il+="S")rt(Il,Fp);function hfe(n,e){e[Gd]=sn(("0."+n)*1e3)}for(Il="S";Il.length<=9;Il+="S")In(Il,hfe);SF=Bp("Milliseconds",!1);ht("z",0,0,"zoneAbbr");ht("zz",0,0,"zoneName");function pfe(){return this._isUTC?"UTC":""}function mfe(){return this._isUTC?"Coordinated Universal Time":""}var qe=mv.prototype;qe.add=ode;qe.calendar=pde;qe.clone=mde;qe.diff=wde;qe.endOf=Ode;qe.format=Tde;qe.from=Ede;qe.fromNow=Pde;qe.to=Rde;qe.toNow=Ade;qe.get=kue;qe.invalidAt=jde;qe.isAfter=gde;qe.isBefore=vde;qe.isBetween=yde;qe.isSame=_de;qe.isSameOrAfter=bde;qe.isSameOrBefore=xde;qe.isValid=Bde;qe.lang=yF;qe.locale=vF;qe.localeData=_F;qe.max=Ble;qe.min=$le;qe.parsingFlags=Ude;qe.set=Sue;qe.startOf=Ide;qe.subtract=cde;qe.toArray=Lde;qe.toObject=Fde;qe.toDate=Nde;qe.toISOString=kde;qe.inspect=Sde;typeof Symbol<"u"&&Symbol.for!=null&&(qe[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});qe.toJSON=$de;qe.toString=Cde;qe.unix=Dde;qe.valueOf=Mde;qe.creationData=qde;qe.eraName=Vde;qe.eraNarrow=Gde;qe.eraAbbr=Kde;qe.eraYear=Yde;qe.year=YL;qe.isLeapYear=Cue;qe.weekYear=nfe;qe.isoWeekYear=rfe;qe.quarter=qe.quarters=ufe;qe.month=eF;qe.daysInMonth=Due;qe.week=qe.weeks=que;qe.isoWeek=qe.isoWeeks=zue;qe.weeksInYear=sfe;qe.weeksInWeekYear=ofe;qe.isoWeeksInYear=ife;qe.isoWeeksInISOWeekYear=afe;qe.date=kF;qe.day=qe.days=rle;qe.weekday=ile;qe.isoWeekday=ale;qe.dayOfYear=lfe;qe.hour=qe.hours=fle;qe.minute=qe.minutes=dfe;qe.second=qe.seconds=ffe;qe.millisecond=qe.milliseconds=SF;qe.utcOffset=Kle;qe.utc=Xle;qe.local=Jle;qe.parseZone=Qle;qe.hasAlignedHourOffset=Zle;qe.isDST=ede;qe.isLocal=nde;qe.isUtcOffset=rde;qe.isUtc=hF;qe.isUTC=hF;qe.zoneAbbr=pfe;qe.zoneName=mfe;qe.dates=_o("dates accessor is deprecated. Use date instead.",kF);qe.months=_o("months accessor is deprecated. Use month instead",eF);qe.years=_o("years accessor is deprecated. Use year instead",YL);qe.zone=_o("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Yle);qe.isDSTShifted=_o("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",tde);function gfe(n){return Kn(n*1e3)}function vfe(){return Kn.apply(null,arguments).parseZone()}function TF(n){return n}var bn=pT.prototype;bn.calendar=tue;bn.longDateFormat=aue;bn.invalidDate=oue;bn.ordinal=lue;bn.preparse=TF;bn.postformat=TF;bn.relativeTime=fue;bn.pastFuture=hue;bn.set=Zce;bn.eras=zde;bn.erasParse=Wde;bn.erasConvertYear=Hde;bn.erasAbbrRegex=Jde;bn.erasNameRegex=Xde;bn.erasNarrowRegex=Qde;bn.months=Aue;bn.monthsShort=Iue;bn.monthsParse=Mue;bn.monthsRegex=Lue;bn.monthsShortRegex=Nue;bn.week=$ue;bn.firstDayOfYear=jue;bn.firstDayOfWeek=Uue;bn.weekdays=Que;bn.weekdaysMin=ele;bn.weekdaysShort=Zue;bn.weekdaysParse=nle;bn.weekdaysRegex=sle;bn.weekdaysShortRegex=ole;bn.weekdaysMinRegex=cle;bn.isPM=lle;bn.meridiem=hle;function w_(n,e,t,r){var i=sl(),a=su().set(r,e);return i[t](a,n)}function EF(n,e,t){if(Xu(n)&&(e=n,n=void 0),n=n||"",e!=null)return w_(n,e,t,"month");var r,i=[];for(r=0;r<12;r++)i[r]=w_(n,r,t,"month");return i}function OT(n,e,t,r){typeof n=="boolean"?(Xu(e)&&(t=e,e=void 0),e=e||""):(e=n,t=e,n=!1,Xu(e)&&(t=e,e=void 0),e=e||"");var i=sl(),a=n?i._week.dow:0,s,o=[];if(t!=null)return w_(e,(t+a)%7,r,"day");for(s=0;s<7;s++)o[s]=w_(e,(s+a)%7,r,"day");return o}function yfe(n,e){return EF(n,e,"months")}function _fe(n,e){return EF(n,e,"monthsShort")}function bfe(n,e,t){return OT(n,e,t,"weekdays")}function xfe(n,e,t){return OT(n,e,t,"weekdaysShort")}function wfe(n,e,t){return OT(n,e,t,"weekdaysMin")}jl("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(n){var e=n%10,t=sn(n%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return n+t}});Le.lang=_o("moment.lang is deprecated. Use moment.locale instead.",jl);Le.langData=_o("moment.langData is deprecated. Use moment.localeData instead.",sl);var Eu=Math.abs;function Cfe(){var n=this._data;return this._milliseconds=Eu(this._milliseconds),this._days=Eu(this._days),this._months=Eu(this._months),n.milliseconds=Eu(n.milliseconds),n.seconds=Eu(n.seconds),n.minutes=Eu(n.minutes),n.hours=Eu(n.hours),n.months=Eu(n.months),n.years=Eu(n.years),this}function PF(n,e,t,r){var i=uc(e,t);return n._milliseconds+=r*i._milliseconds,n._days+=r*i._days,n._months+=r*i._months,n._bubble()}function kfe(n,e){return PF(this,n,e,1)}function Sfe(n,e){return PF(this,n,e,-1)}function lI(n){return n<0?Math.floor(n):Math.ceil(n)}function Tfe(){var n=this._milliseconds,e=this._days,t=this._months,r=this._data,i,a,s,o,c;return n>=0&&e>=0&&t>=0||n<=0&&e<=0&&t<=0||(n+=lI(Sk(t)+e)*864e5,e=0,t=0),r.milliseconds=n%1e3,i=so(n/1e3),r.seconds=i%60,a=so(i/60),r.minutes=a%60,s=so(a/60),r.hours=s%24,e+=so(s/24),c=so(RF(e)),t+=c,e-=lI(Sk(c)),o=so(t/12),t%=12,r.days=e,r.months=t,r.years=o,this}function RF(n){return n*4800/146097}function Sk(n){return n*146097/4800}function Efe(n){if(!this.isValid())return NaN;var e,t,r=this._milliseconds;if(n=bo(n),n==="month"||n==="quarter"||n==="year")switch(e=this._days+r/864e5,t=this._months+RF(e),n){case"month":return t;case"quarter":return t/3;case"year":return t/12}else switch(e=this._days+Math.round(Sk(this._months)),n){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return e*24+r/36e5;case"minute":return e*1440+r/6e4;case"second":return e*86400+r/1e3;case"millisecond":return Math.floor(e*864e5)+r;default:throw new Error("Unknown unit "+n)}}function ol(n){return function(){return this.as(n)}}var AF=ol("ms"),Pfe=ol("s"),Rfe=ol("m"),Afe=ol("h"),Ife=ol("d"),Ofe=ol("w"),Mfe=ol("M"),Dfe=ol("Q"),Nfe=ol("y"),Lfe=AF;function Ffe(){return uc(this)}function $fe(n){return n=bo(n),this.isValid()?this[n+"s"]():NaN}function Mf(n){return function(){return this.isValid()?this._data[n]:NaN}}var Bfe=Mf("milliseconds"),Ufe=Mf("seconds"),jfe=Mf("minutes"),qfe=Mf("hours"),zfe=Mf
3876("days"),Wfe=Mf("months"),Hfe=Mf("years");function Vfe(){return so(this.days()/7)}var Mu=Math.round,Th={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Gfe(n,e,t,r,i){return i.relativeTime(e||1,!!t,n,r)}function Kfe(n,e,t,r){var i=uc(n).abs(),a=Mu(i.as("s")),s=Mu(i.as("m")),o=Mu(i.as("h")),c=Mu(i.as("d")),u=Mu(i.as("M")),l=Mu(i.as("w")),d=Mu(i.as("y")),h=a<=t.ss&&["s",a]||a<t.s&&["ss",a]||s<=1&&["m"]||s<t.m&&["mm",s]||o<=1&&["h"]||o<t.h&&["hh",o]||c<=1&&["d"]||c<t.d&&["dd",c];return t.w!=null&&(h=h||l<=1&&["w"]||l<t.w&&["ww",l]),h=h||u<=1&&["M"]||u<t.M&&["MM",u]||d<=1&&["y"]||["yy",d],h[2]=e,h[3]=+n>0,h[4]=r,Gfe.apply(null,h)}function Yfe(n){return n===void 0?Mu:typeof n=="function"?(Mu=n,!0):!1}function Xfe(n,e){return Th[n]===void 0?!1:e===void 0?Th[n]:(Th[n]=e,n==="s"&&(Th.ss=e-1),!0)}function Jfe(n,e){if(!this.isValid())return this.localeData().invalidDate();var t=!1,r=Th,i,a;return typeof n=="object"&&(e=n,n=!1),typeof n=="boolean"&&(t=n),typeof e=="object"&&(r=Object.assign({},Th,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),a=Kfe(this,!t,r,i),t&&(a=i.pastFuture(+this,a)),i.postformat(a)}var Bw=Math.abs;function ch(n){return(n>0)-(n<0)||+n}function Ib(){if(!this.isValid())return this.localeData().invalidDate();var n=Bw(this._milliseconds)/1e3,e=Bw(this._days),t=Bw(this._months),r,i,a,s,o=this.asSeconds(),c,u,l,d;return o?(r=so(n/60),i=so(r/60),n%=60,r%=60,a=so(t/12),t%=12,s=n?n.toFixed(3).replace(/\.?0+$/,""):"",c=o<0?"-":"",u=ch(this._months)!==ch(o)?"-":"",l=ch(this._days)!==ch(o)?"-":"",d=ch(this._milliseconds)!==ch(o)?"-":"",c+"P"+(a?u+a+"Y":"")+(t?u+t+"M":"")+(e?l+e+"D":"")+(i||r||n?"T":"")+(i?d+i+"H":"")+(r?d+r+"M":"")+(n?d+s+"S":"")):"P0D"}var fn=Rb.prototype;fn.isValid=Wle;fn.abs=Cfe;fn.add=kfe;fn.subtract=Sfe;fn.as=Efe;fn.asMilliseconds=AF;fn.asSeconds=Pfe;fn.asMinutes=Rfe;fn.asHours=Afe;fn.asDays=Ife;fn.asWeeks=Ofe;fn.asMonths=Mfe;fn.asQuarters=Dfe;fn.asYears=Nfe;fn.valueOf=Lfe;fn._bubble=Tfe;fn.clone=Ffe;fn.get=$fe;fn.milliseconds=Bfe;fn.seconds=Ufe;fn.minutes=jfe;fn.hours=qfe;fn.days=zfe;fn.weeks=Vfe;fn.months=Wfe;fn.years=Hfe;fn.humanize=Jfe;fn.toISOString=Ib;fn.toString=Ib;fn.toJSON=Ib;fn.locale=vF;fn.localeData=_F;fn.toIsoString=_o("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ib);fn.lang=yF;ht("X",0,0,"unix");ht("x",0,0,"valueOf");rt("x",Sb);rt("X",vue);In("X",function(n,e,t){t._d=new Date(parseFloat(n)*1e3)});In("x",function(n,e,t){t._d=new Date(sn(n))});//! moment.js 3877Le.version="2.30.1";Jce(Kn);Le.fn=qe;Le.min=Ule;Le.max=jle;Le.now=qle;Le.utc=su;Le.unix=gfe;Le.months=yfe;Le.isDate=pv;Le.locale=jl;Le.invalid=xb;Le.duration=uc;Le.isMoment=ac;Le.weekdays=bfe;Le.parseZone=vfe;Le.localeData=sl;Le.isDuration=ly;Le.monthsShort=_fe;Le.weekdaysMin=wfe;Le.defineLocale=kT;Le.updateLocale=vle;Le.locales=yle;Le.weekdaysShort=xfe;Le.normalizeUnits=bo;Le.relativeTimeRounding=Yfe;Le.relativeTimeThreshold=Xfe;Le.calendarFormat=hde;Le.prototype=qe;Le.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const Qfe={props:["tournaments","teams","defaultTeamId"],components:{AdminLayout:Gt,JetInput:Rn,JetInputError:ea,JetLabel:Un,JetButton:mn},data(){return{form:this.$inertia.form({kickoff_at:Le().format("YYYY-MM-DDTHH:mm"),tournament_id:1,home_team_id:this.defaultTeamId,away_team_id:this.defaultTeamId,roboticket_id:null,capacity:null,spectators:null,loyalty_points:null,has_away_scanning:!1,has_audio_broadcast:!1})}},methods:{submit(){this.form.post(this.route("admin.matches.store"),{errorBag:"createGame",onFinish:()=>this.form.reset("name")})}}};var Zfe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("admin.away.create-game"))+" ")])]},proxy:!0}])},[t("div",{staticClass:"bg-white p-3 rounded-md"},[t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"kickoff_at",value:e.$trans("admin.away.kickoff_at")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"kickoff_at",type:"datetime-local",autocomplete:"kickoff_at"},model:{value:e.form.kickoff_at,callback:function(r){e.$set(e.form,"kickoff_at",r)},expression:"form.kickoff_at"}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"tournament_id"}},[e._v(e._s(e.$trans("admin.away.tournament")))]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.tournament_id,expression:"form.tournament_id"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",attrs:{type:"select",id:"tournament_id"},on:{change:function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.$set(e.form,"tournament_id",r.target.multiple?i:i[0])}}},e._l(e.tournaments,function(r){return t("option",{domProps:{value:r.
3877id}},[e._v(e._s(r.name)+" "+e._s(r.type&&`- ${r.type}`))])}),0)],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"home_team_id"}},[e._v(e._s(e.$trans("admin.away.hometeam")))]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.home_team_id,expression:"form.home_team_id"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",attrs:{name:"home_team_id",id:"home_team_id",type:"select"},on:{change:function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.$set(e.form,"home_team_id",r.target.multiple?i:i[0])}}},e._l(e.teams,function(r){return t("option",{domProps:{value:r.id}},[e._v(e._s(r.name))])}),0),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.home_team_id}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"away_team_id"}},[e._v(e._s(e.$trans("admin.away.awayteam")))]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.away_team_id,expression:"form.away_team_id"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",attrs:{name:"away_team_id",id:"away_team_id",type:"select"},on:{change:function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.$set(e.form,"away_team_id",r.target.multiple?i:i[0])}}},e._l(e.teams,function(r){return t("option",{domProps:{value:r.id}},[e._v(e._s(r.name))])}),0),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.away_team_id}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"roboticket_id",value:"RoboticketId"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"roboticket_id",type:"number",autocomplete:"roboticket_id"},model:{value:e.form.roboticket_id,callback:function(r){e.$set(e.form,"roboticket_id",r)},expression:"form.roboticket_id"}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"capacity",value:e.$trans("admin.away.capacity")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"capacity",type:"number",autocomplete:"capacity"},model:{value:e.form.capacity,callback:function(r){e.$set(e.form,"capacity",r)},expression:"form.capacity"}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"spectators",value:e.$trans("admin.away.spectators")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"spectators",type:"number",autocomplete:"spectators"},model:{value:e.form.spectators,callback:function(r){e.$set(e.form,"spectators",r)},expression:"form.spectators"}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"loyalty_points",value:e.$trans("admin.away.loyalty_points")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"loyalty_points",type:"number",autocomplete:"loyalty_points"},model:{value:e.form.loyalty_points,callback:function(r){e.$set(e.form,"loyalty_points",r)},expression:"form.loyalty_points"}})],1),t("div",{staticClass:"mt-6 border-t border-gray-200 pt-4"},[t("p",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-2"},[e._v(" "+e._s(e.$trans("admin.away.game_features"))+" ")]),t("label",{staticClass:"flex items-center",attrs:{for:"has_away_scanning"}},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.has_away_scanning,expression:"form.has_away_scanning"}],staticClass:"rounded border-gray-300 text-fck-blue shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50",attrs:{id:"has_away_scanning",type:"checkbox"},domProps:{checked:Array.isArray(e.form.has_away_scanning)?e._i(e.form.has_away_scanning,null)>-1:e.form.has_away_scanning},on:{change:function(r){var i=e.form.has_away_scanning,a=r.target,s=!!a.checked;if(Array.isArray(i)){var o=null,c=e._i(i,o);a.checked?c<0&&e.$set(e.form,"has_away_scanning",i.concat([o])):c>-1&&e.$set(e.form,"has_away_scanning",i.slice(0,c).concat(i.slice(c+1)))}else e.$set(e.form,"has_away_scanning",s)}}}),t("span",{staticClass:"ml-2 text-sm text-gray-700"},[e._v(e._s(e.$trans("admin.away.has_away_scanning")))])]),t("label",{staticClass:"flex items-center mt-2",attrs:{for:"has_audio_broadcast"}},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.has_audio_broadcast,expression:"form.has_audio_broadcast"}],staticClass:"rounded border-gray-300 text-fck-blue shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50",attrs:{id:"has_audio_broadcast",type:"checkbox"},domProps:{checked:Array.isArray(e.form.has_audio_broadcast)?e._i(e.form.has_audio_broadcast,null)>-1:e.form.has_audio_broadcast},on:{change:function(r){var i=e.form.has_audio_broadcast,a=r.target,s=!!a.checked;if(Array.isArray(i)){var o=null,c=e._i(i,o);a.checked?c<0&&e.$set(e.form,"has_audio_broadcast",i.concat([o])):c>-1&&e.$set(e.form,"has_audio_broadcast",i.slice(0,c).concat(i.slice(c+1)))}else e.$set(e.form,"has_audio_broadcast",s)}}}),t("span",{staticClass:"ml-2 text-sm text-gray-700"},[e._v(e._s(e.$trans("admin.away.has_audio_broadcast")))])]),t("p",{staticClass:"mt-2 text-xs text-gray-500"},[e._v(e._s(e.$trans("admin.away.game_features_help")))])]),t("div",{staticClass:"mt-3 flex justify-end"},[t("jet-button",{staticClass:"ml-4",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("admin.away.create-game"))+" ")])],1)])])])}
3877,ehe=[],the=ve(Qfe,Zfe,ehe,!1,null,null);const nhe=the.exports,rhe=Object.freeze(Object.defineProperty({__proto__:null,default:nhe},Symbol.toStringTag,{value:"Module"})),ihe={props:["game","tournaments","teams"],components:{AdminLayout:Gt,JetInput:Rn,JetInputError:ea,JetLabel:Un,JetButton:mn},data(){return{form:this.$inertia.form({kickoff_at:this.game.kickoff_at,tournament_id:this.game.tournament_id,home_team_id:this.game.home_team_id,away_team_id:this.game.away_team_id,roboticket_id:this.game.roboticket_id,capacity:this.game.capacity,spectators:this.game.spectators,loyalty_points:this.game.loyalty_points,has_away_scanning:!!this.game.has_away_scanning,has_audio_broadcast:!!this.game.has_audio_broadcast})}},methods:{submit(){this.form.put(this.route("admin.matches.update",this.game.id),{errorBag:"updateGame"})}}};var ahe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("admin.away.edit-game"))+" ")])]},proxy:!0}])},[t("div",{staticClass:"bg-white p-3 rounded-md"},[t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"kickoff_at",value:e.$trans("admin.away.kickoff_at")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"kickoff_at",type:"datetime-local",autocomplete:"kickoff_at"},model:{value:e.form.kickoff_at,callback:function(r){e.$set(e.form,"kickoff_at",r)},expression:"form.kickoff_at"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.kickoff_at}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"tournament_id"}},[e._v(e._s(e.$trans("admin.away.tournament")))]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.tournament_id,expression:"form.tournament_id"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",attrs:{type:"select",id:"tournament_id"},on:{change:function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.$set(e.form,"tournament_id",r.target.multiple?i:i[0])}}},e._l(e.tournaments,function(r){return t("option",{domProps:{value:r.id}},[e._v(e._s(r.name)+" "+e._s(r.type&&`- ${r.type}`))])}),0),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.tournament_id}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"home_team_id"}},[e._v(e._s(e.$trans("admin.away.hometeam")))]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.home_team_id,expression:"form.home_team_id"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",attrs:{name:"home_team_id",id:"home_team_id",type:"select"},on:{change:function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.$set(e.form,"home_team_id",r.target.multiple?i:i[0])}}},e._l(e.teams,function(r){return t("option",{domProps:{value:r.id}},[e._v(e._s(r.name))])}),0),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.home_team_id}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"away_team_id"}},[e._v(e._s(e.$trans("admin.away.awayteam")))]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.away_team_id,expression:"form.away_team_id"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",attrs:{name:"away_team_id",id:"away_team_id",type:"select"},on:{change:function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.$set(e.form,"away_team_id",r.target.multiple?i:i[0])}}}
3877,e._l(e.teams,function(r){return t("option",{domProps:{value:r.id}},[e._v(e._s(r.name))])}),0),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.away_team_id}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"roboticket_id",value:"RoboticketId"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"roboticket_id",type:"number",autocomplete:"roboticket_id"},model:{value:e.form.roboticket_id,callback:function(r){e.$set(e.form,"roboticket_id",r)},expression:"form.roboticket_id"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.roboticket_id}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"capacity",value:e.$trans("admin.away.capacity")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"capacity",type:"number",autocomplete:"capacity"},model:{value:e.form.capacity,callback:function(r){e.$set(e.form,"capacity",r)},expression:"form.capacity"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.capacity}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"spectators",value:e.$trans("admin.away.spectators")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"spectators",type:"number",autocomplete:"spectators"},model:{value:e.form.spectators,callback:function(r){e.$set(e.form,"spectators",r)},expression:"form.spectators"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.spectators}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"loyalty_points",value:e.$trans("admin.away.loyalty_points")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"loyalty_points",type:"number",autocomplete:"loyalty_points"},model:{value:e.form.loyalty_points,callback:function(r){e.$set(e.form,"loyalty_points",r)},expression:"form.loyalty_points"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.loyalty_points}})],1),e.game.scans_count>0?t("p",{staticClass:"mt-4 text-sm text-gray-500"},[e._v(" "+e._s(e.game.scans_count)+" scanninger er registreret på kampen. ")]):e._e(),t("div",{staticClass:"mt-6 border-t border-gray-200 pt-4"},[t("p",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-2"},[e._v(" "+e._s(e.$trans("admin.away.game_features"))+" ")]),t("label",{staticClass:"flex items-center",attrs:{for:"has_away_scanning"}},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.has_away_scanning,expression:"form.has_away_scanning"}],staticClass:"rounded border-gray-300 text-fck-blue shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50",attrs:{id:"has_away_scanning",type:"checkbox"},domProps:{checked:Array.isArray(e.form.has_away_scanning)?e._i(e.form.has_away_scanning,null)>-1:e.form.has_away_scanning},on:{change:function(r){var i=e.form.has_away_scanning,a=r.target,s=!!a.checked;if(Array.isArray(i)){var o=null,c=e._i(i,o);a.checked?c<0&&e.$set(e.form,"has_away_scanning",i.concat([o])):c>-1&&e.$set(e.form,"has_away_scanning",i.slice(0,c).concat(i.slice(c+1)))}else e.$set(e.form,"has_away_scanning",s)}}}),t("span",{staticClass:"ml-2 text-sm text-gray-700"},[e._v(e._s(e.$trans("admin.away.has_away_scanning")))])]),t("label",{staticClass:"flex items-center mt-2",attrs:{for:"has_audio_broadcast"}},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.has_audio_broadcast,expression:"form.has_audio_broadcast"}],staticClass:"rounded border-gray-300 text-fck-blue shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50",attrs:{id:"has_audio_broadcast",type:"checkbox"},domProps:{checked:Array.isArray(e.form.has_audio_broadcast)?e._i(e.form.has_audio_broadcast,null)>-1:e.form.has_audio_broadcast},on:{change:function(r){var i=e.form.has_audio_broadcast,a=r.target,s=!!a.checked;if(Array.isArray(i)){var o=null,c=e._i(i,o);a.checked?c<0&&e.$set(e.form,"has_audio_broadcast",i.concat([o])):c>-1&&e.$set(e.form,"has_audio_broadcast",i.slice(0,c).concat(i.slice(c+1)))}else e.$set(e.form,"has_audio_broadcast",s)}}}),t("span",{staticClass:"ml-2 text-sm text-gray-700"},[e._v(e._s(e.$trans("admin.away.has_audio_broadcast")))])]),t("p",{staticClass:"mt-2 text-xs text-gray-500"},[e._v(e._s(e.$trans("admin.away.game_features_help")))])]),t("div",{staticClass:"mt-3 flex justify-end items-center"},[t("inertia-link",{staticClass:"text-sm text-gray-600 underline",attrs:{href:e.route("admin.matches.index")}},[e._v(" "+e._s(e.$trans("admin.away.cancel"))+" ")]),t("jet-button",{staticClass:"ml-4",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("admin.away.update-game"))+" ")])],1)])])])},she=[],ohe=ve(ihe,ahe,she,!1,null,null);const che=ohe.exports,uhe=Object.freeze(Object.defineProperty({__proto__:null,default:che},Symbol.toStringTag,{value:"Module"})),lhe={props:["matches"],components:{AdminLayout:Gt,JetNavLink:Zu,JetConfirmationModal:kf,JetSecondaryButton:Br,JetDangerButton:vo},data(){return{gameToDelete:null,deleting:!1}},computed:{flash(){return this.$page.props.flash}},methods:{confirmDelete(n){this.gameToDelete=n},executeDelete(){const n=this.gameToDelete.id;this.deleting=!0,this.$inertia.delete(route("admin.matches.destroy",n),{preserveScroll:!0,onFinish:()=>{this.deleting=!1,this.gameToDelete=null}})}}};var dhe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"flex flex-row justify-between items-center"},[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" Kampe ")]),t("jet-nav-link",{staticClass:"cursor-pointer font-bold py-2 px-4 roun
3877ded",attrs:{href:e.route("admin.matches.create")}},[e._v(" Opret kamp ")])],1)]},proxy:!0}])},[e.flash?t("div",{staticClass:"mb-4 px-4 py-3 rounded",class:e.flash.type==="error"?"bg-red-100 border border-red-400 text-red-700":"bg-green-100 border border-green-400 text-green-700"},[e._v(" "+e._s(e.flash.message)+" ")]):e._e(),t("div",{staticClass:"bg-white p-3 rounded-md"},[t("table",{staticClass:"table-auto w-full border-separate border-spacing-2 border border-grey-500"},[t("thead",[t("tr",[t("th",{staticClass:"text-left"},[e._v("Kickoff")]),t("th",{staticClass:"text-left"},[e._v("Tournament")]),t("th",{staticClass:"text-left"},[e._v("Home")]),t("th",{staticClass:"text-left"},[e._v("Away")]),t("th",{staticClass:"text-left"},[e._v("Bruges til")]),t("th",{staticClass:"text-left"},[e._v("RoboticketId")]),t("th",{staticClass:"text-left"},[e._v("Capacity")]),t("th",{staticClass:"text-left"},[e._v("Spectators")]),t("th",{staticClass:"text-left"},[e._v("Loyalty Points")]),t("th",{staticClass:"text-left"},[e._v("Options")])])]),t("tbody",e._l(e.matches,function(r){return t("tr",{key:r.id},[t("td",{staticClass:"p2"},[e._v(e._s(r.kickoff_at))]),t("td",{staticClass:"p2"},[e._v(e._s(r.season_tournament.tournament.name))]),t("td",{staticClass:"p2"},[r.home_team.logo_path?t("img",{staticStyle:{height:"60px"},attrs:{src:r.home_team.logo_path,alt:r.home_team.name}}):t("span",[e._v(e._s(r.home_team.name))])]),t("td",{staticClass:"p2"},[r.away_team.logo_path?t("img",{staticStyle:{height:"60px"},attrs:{src:r.away_team.logo_path,alt:r.away_team.name}}):t("span",[e._v(e._s(r.away_team.name))])]),t("td",{staticClass:"p2"},[t("div",{staticClass:"flex flex-col gap-1 items-start"},[r.has_away_scanning?t("span",{staticClass:"inline-block text-xs px-2 py-0.5 rounded bg-blue-100 text-blue-800 whitespace-nowrap"},[e._v(" Udescanning ")]):e._e(),r.has_audio_broadcast?t("span",{staticClass:"inline-block text-xs px-2 py-0.5 rounded bg-green-100 text-green-800 whitespace-nowrap"},[e._v(" Lydkommentar ")]):e._e(),!r.has_away_scanning&&!r.has_audio_broadcast?t("span",{staticClass:"text-gray-400"}
3877,[e._v("â")]):e._e()])]),t("td",{staticClass:"p2"},[r.roboticket_id?t("span",[e._v(e._s(r.roboticket_id))]):t("span",{staticClass:"text-gray-400"},[e._v("â")])]),t("td",{staticClass:"p2"},[e._v(e._s(r.capacity))]),t("td",{staticClass:"p2"},[e._v(e._s(r.scans_count))]),t("td",{staticClass:"p2"},[e._v(e._s(r.loyalty_points))]),t("td",{staticClass:"p2"},[t("div",{staticClass:"flex flex-row items-center gap-2"},[t("jet-nav-link",{staticClass:"cursor-pointer font-bold py-2 px-4 rounded",attrs:{href:e.route("admin.matches.edit",r.id)}},[e._v(" Rediger ")]),t("jet-danger-button",{nativeOn:{click:function(i){return e.confirmDelete(r)}}},[e._v(" Slet ")])],1)])])}),0)])]),t("jet-confirmation-modal",{attrs:{show:e.gameToDelete!==null},on:{close:function(r){e.gameToDelete=null}},scopedSlots:e._u([{key:"title",fn:function(){return[e._v("Slet kamp")]},proxy:!0},{key:"content",fn:function(){return[e.gameToDelete?[t("p",[e._v(" Slet kampen "+e._s(e.gameToDelete.home_team.name)+" â "+e._s(e.gameToDelete.away_team.name)+" ("+e._s(e.gameToDelete.kickoff_at)+")? ")]),e.gameToDelete.scans_count>0?t("p",{staticClass:"mt-2 text-red-600"},[e._v(" Kampen har "+e._s(e.gameToDelete.scans_count)+" scanninger og kan ikke slettes. Ret den i stedet. ")]):t("p",{staticClass:"mt-2"},[e._v("Handlingen kan ikke fortrydes.")])]:e._e()]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){e.gameToDelete=null}}},[e._v(" Annullér ")]),e.gameToDelete&&e.gameToDelete.scans_count===0?t("jet-danger-button",{staticClass:"ml-2",class:{"opacity-25":e.deleting},attrs:{disabled:e.deleting},nativeOn:{click:function(r){return e.executeDelete.apply(null,arguments)}}},[e._v(" Slet ")]):e._e()]},proxy:!0}])})],1)},fhe=[],hhe=ve(lhe,dhe,fhe,!1,null,null);const phe=hhe.exports,mhe=Object.freeze(Object.defineProperty({__proto__:null,default:phe},Symbol.toStringTag,{value:"Module"})),ghe={components:{AdminLayout:Gt,JetPagination:Rp},props:{game:{type:Object,required:!0},users:{type:Object,required:!1}},data(){return{search:"",fetching:!1}},methods:{performSearch:Y_.debounce(function(){this.fetching=!0,this.$inertia.get(route("admin.matches.show",this.game.id),{search:this.search},{preserveState:!0,preserveScroll:!0,replace:!0,onFinish:()=>{this.fetching=!1}})},300),formatDatetime(n){return Le(n).utcOffset(1).format("DD/MM-YYYY HH:mm:ss")}},computed:{getGameTime(){return new Date(this.game.kickoff_at).toLocaleString("da-DK",{dateStyle:"short",timeStyle:"short",hour12:!1})},printedAt(){return Le().format("D-M-YYYY HH:mm")}}};var vhe=function(){var e=this,t=e._self._c;return t("AdminLayout",{scopedSlots:e._u([{key:"footer",fn:function(){return[e.users.data.length>0?t("jet-pagination",{attrs:{total:e.users.total,per_page:e.users.per_page,current_page:e.users.current_page,last_page:e.users.last_page,first_page_url:e.users.first_page_url,last_page_url:e.users.last_page_url,next_page_url:e.users.next_page_url,prev_page_url:e.users.prev_page_url,path:e.users.path,from:e.users.from,to:e.users.to,data:e.users.data,search:e.search}}):e._e()]},proxy:!0}])},[e._t("header",function(){return[t("h2",{staticClass:"font-semibold text-xl text-gray-800 leading-tight ml-2 mt-2",attrs:{"data-print-hide":""}},[e._v(" Game ")]),t("div",{staticClass:"flex flex-row items-center m-2",attrs:{"data-print-hide":""}},[t("img",{staticClass:"h-8 object-cover aspect-1",attrs:{src:`${e.game.home_team.logo_path}`}}),t("span",{staticClass:"text-xl ml-2 mr-2"},[e._v("-")]),t("img",{staticClass:"h-8 object-cover aspect-1",attrs:{src:`${e.game.away_team.logo_path}`}}),t("div",{staticClass:"flex flex-col ml-2"},[t("p",{staticClass:"text-sm"},[e._v(" "+e._s(e.getGameTime))]),t("p",{staticClass:"text-sm"},[e._v(" "+e._s(e.users.total)+" scannede")])])])]}),t("div",{staticClass:"scan-sheet"},[t("div",{staticClass:"hidden print:block mb-3"},[t("div",{staticClass:"flex items-baseline justify-between border-b border-black pb-1"},[t("span",{staticClass:"text-base font-bold"},[e._v(" "+e._s(e.game.home_team.name)+" â "+e._s(e.game.away_team.name)+" ")]),t("span",{staticClass:"text-xs"},[e._v(e._s(e.getGameTime))])]),t("div",{staticClass:"flex items-baseline justify-between text-xs mt-1"},[t("span",[e._v(" Scanningsliste · "),e.users.from?[e._v("viser "+e._s(e.users.from)+"â"+e._s(e.users.to)+" af "+e._s(e.users.total))]:[e._v(e._s(e.users.total)+" scannede")],e.users.last_page>1?[e._v(" (side "+e._s(e.users.current_page)+" af "+e._s(e.users.last_page)+") ")]:e._e(
3877)],2),t("span",[e._v("Udskrevet "+e._s(e.printedAt))])]),t("p",{staticClass:"text-xs mt-1"},[e._v("Fortroligt · indeholder persondata")])]),t("div",{staticClass:"flex items-center space-x-3",attrs:{"data-print-hide":""}},[t("div",{staticClass:"relative flex-1"},[t("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[t("svg",{staticClass:"h-5 w-5 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"}})])]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],staticClass:"pl-10 w-full border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-lg shadow-sm",attrs:{type:"text",placeholder:"Search users..."},domProps:{value:e.search},on:{input:[function(r){r.target.composing||(e.search=r.target.value)},e.performSearch]}})]),e.fetching?t("svg",{staticClass:"animate-spin w-5 h-5 flex-shrink-0 text-gray-500",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[t("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]):e._e()]),t("div",{staticClass:"mt-6 print:mt-0"},[t("table",{staticClass:"min-w-full divide-y divide-gray-200"},[t("thead",{staticClass:"bg-gray-50"},[t("tr",[t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Img ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Info ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Scan info ")])])]),t("tbody",{staticClass:"bg-white divide-y divide-gray-200"},e._l(e.users.data,function(r){return t("tr",{key:r.id},[t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[t("img",{staticClass:"scan-photo h-48 w-36 object-contain object-top bg-gray-50",attrs:{src:r.away_application.photo,alt:`${r.firstname} ${r.lastname}`}})]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[t("div",{staticClass:"text-sm text-gray-900"},[t("span",{staticClass:"scan-name"},[e._v(e._s(r.firstname)+" "+e._s(r.lastname))]),t("br"),e._v(e._s(r.birthday)+" "),t("br"),e._v(e._s(r.street)+" "+e._s(r.housenumber)+" "+e._s(r.side)+", "+e._s(r.zipcode)+" "+e._s(r.city)+" "),t("br"),e._v(e._s(r.email)+" | "+e._s(r.phone)+" ")])]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[t("div",{staticClass:"text-sm text-gray-900"},[e._v(" "+e._s(e.formatDatetime(r.scans.filter(i=>i.game_id===e.game.id)[0].created_at))+" "),t("br"),e._v(" "+e._s(r.scans.length)+" scanninger totalt ")])])])}),0)])])])],2)},yhe=[],_he=ve(ghe,vhe,yhe,!1,null,null);const bhe=_he.exports,xhe=Object.freeze(Object.defineProperty({__proto__:null,default:bhe},Symbol.toStringTag,{value:"Module"})),whe={props:{errors:{type:Object,default:()=>({})},title:{type:String,required:!0}},computed:{messages(){return Object.values(this.errors||{}).filter(Boolean)}}};var Che=function(){var e=this,t=e._self._c;return e.messages.length?t("div",{staticClass:"mb-6 rounded-md border border-red-300 bg-red-50 p-4",attrs:{role:"alert"}},[t("p",{staticClass:"text-sm font-semibold text-red-800"},[e._v(e._s(e.title))]),t("ul",{staticClass:"mt-2 list-disc list-inside text-sm text-red-700 space-y-1"},e._l(e.messages,function(r,i){return t("li",{key:i},[e._v(e._s(r))])}),0)]):e._e()},khe=[],She=ve(whe,Che,khe,!1,null,null);const IF=She.exports,The={props:["tournaments","teams","categories"],components:{FormErrors:IF,AdminLayout:Gt,JetInput:Rn,JetLabel:Un,JetButton:mn},data(){return{form:this.$inertia.form({category:"quarantine",firstname:"",lastname:"",cpr:"",phone:"",email:"",street:"",housenumber:"",side:"",zipcode:"",city:"",country:"",reason:"",expire_at:"",user_id:"",away_a
3877pplication_id:"",photos:[],fine:0,fine_amount:"",invoice_number:"",invoice_paid:0,quarantine_startdate:"",quarantine_sent_via:"",sharepoint_files_link:"",quarantine_letter_link:""}),imagePreviews:[]}},watch:{"form.category"(n){n!=="quarantine"&&(this.form.fine=0,this.form.fine_amount="",this.form.expire_at="",this.form.invoice_number="",this.form.invoice_paid=0,this.form.quarantine_startdate="",this.form.quarantine_sent_via="")},"form.fine"(n){n||(this.form.invoice_paid=0)}},methods:{handleImageChange(n){Array.from(n.target.files).forEach(t=>{const r=new FileReader;r.onload=i=>{this.imagePreviews.push(i.target.result)},r.readAsDataURL(t),this.form.photos.push(t)}),n.target.value=""},removePhoto(n){this.imagePreviews.splice(n,1),this.form.photos.splice(n,1)},submit(){this.form.post(this.route("admin.quarantines.store"),{onFinish:()=>this.form.reset("name")})}}};var Ehe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-2 sm:m-0 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.create-quarantine"))+" ")])]},proxy:!0}])},[t("div",{staticClass:"bg-white rounded-lg shadow-sm p-4 sm:p-6"},[t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",{staticClass:"max-w-3xl mx-auto"},[t("form-errors",{attrs:{errors:e.form.errors,title:e.$trans("admin.quarantine.not_saved")}}),t("div",{staticClass:"flex flex-col items-center pb-6 border-b border-gray-200"},[e.imagePreviews.length>0?t("div",{staticClass:"flex gap-3 overflow-x-auto pb-2 mb-3 w-full justify-center"},e._l(e.imagePreviews,function(r,i){return t("div",{key:i,staticClass:"relative flex-shrink-0"},[t("img",{staticClass:"w-24 h-24 sm:w-32 sm:h-32 object-cover rounded-lg",attrs:{src:r,alt:"Preview"}}),t("button",{staticClass:"absolute -top-2 -right-2 bg-red-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-xs hover:bg-red-600",attrs:{type:"button"},on:{click:function(a){return e.removePhoto(i)}}},[e._v(" Ã ")])])}),0):t("div",{staticClass:"w-24 h-24 rounded-lg border-2 border-dashed border-gray-300 flex items-center justify-center mb-3"},[t("svg",{staticClass:"w-10 h-10 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}})])]),t("jet-label",{staticClass:"capitalize text-sm font-medium text-gray-700",attrs:{for:"photos",value:e.$trans("admin.quarantine.photo")}}),t("input",{staticClass:"mt-1 block text-sm",attrs:{id:"photos",type:"file",multiple:"",accept:"image/*"},on:{change:e.handleImageChange}})],1),t("div",{staticClass:"mt-6"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"category",value:e.$trans("admin.quarantine.category")}}),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.category,expression:"form.category"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",attrs:{id:"category"},on:{change:function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.$set(e.form,"category",r.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"quarantine"}},[e._v(e._s(e.$trans("admin.quarantine.category_quarantine")))]),t("option",{attrs:{value:"warning"}},[e._v(e._s(e.$trans("admin.quarantine.category_warning")))]),t("option",{attrs:{value:"person_of_interest"}},[e._v(e._s(e.$trans("admin.quarantine.category_person_of_interest")))])])],1),t("div",{staticClass:"mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4"},[t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"user_id",value:"user_id"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"user_id",type:"number"},model:{value:e.form.user_id,callback:function(r){e.$set(e.form,"user_id",r)},expression:"form.user_id"}})],1),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"away_application_id",value:"awaycard_id"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"away_application_id",type:"number"},model:{value:e.form.away_application_id,callback:function(r){e.$set(e.form,"away_application_id",r)},expression:"form.away_application_id"}})],1)]),t("div",{staticClass:"mt-8 pt-6 border-t border-gray-200"},[t("h3",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-4 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.section_personal"))+" ")]),t("div",{staticClass:"grid grid-cols-1 sm:grid-cols-2 gap-4"},[t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"firstname",value:e.$trans("admin.quarantine.firstname")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"firstname",type:"text"},model:{value:e.form.firstname,callback:function(r){e.$set(e.form,"firstname",r)},expression:"form.firstname"}})],1),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"lastname",value:e.$trans("admin.quarantine.lastname")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"lastname",type:"text"},model:{value:e.form.lastname,callback:function(r){e.$set(e.form,"lastname",r)},expression:"form.lastname"}})],1)]),t("div",{staticClass:"mt-4"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"cpr",value:e.$trans("admin.quarantine.cpr")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"cpr",type:"number"},model:{value:e.form.cpr,callback:function(r){e.$set(e.form,"cpr",r)},expression:"form.cpr"}})],1),t("div",{staticClass:"mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4"},[t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"phone",value:e.$trans("admin.quarantine.phone")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"phone",type:"text"},model:{value:e.form.phone,callback:function(r){e.$set(e.form,"phone",r)},expression:"form.phone"}})],1),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"email",value:e.$trans("admin.quarantine.email")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"email",type:"text"},model:{value:e.form.email,callback:function(r){e.$set(e.form,"email",r)},expression:"form.email"}})],1)])]),t("div",{staticClass:"mt-8 pt-6 border-t border-gray-200"},[t("h3",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-4 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.section_address"))+" ")]),t("div",{staticClass:"grid grid-cols-3 gap-4"},[t("div",{staticClass:"col-span-3 sm:col-span-1"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"street",value:e.$trans("admin.quarantine.street")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"street",type:"text"},model:{value:e.form.street,callback:function(r){e.$set(e.form,"street",r)},expression:"form.street"}})],1),t("div",{staticClass:"col-span-2 sm:col-span-1"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"housenumber",value:e.$trans("admin.quarantine.housenumber")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"housenumber",type:"text"},model:{value:e.form.housenumber,callback:function(r){e.$set(e.form,"housenumber",r)},expression:"form.housenumber"}})],1),t("div",{staticClass:"col-span-1"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"side",value:e.$trans("admin.quarantine.side")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"side",type:"text"},model:{value:e.form.side,callback:function(r){e.$set(e.form,"side",r)},expression:"form.side"}})],1)]),t("div",{staticClass:"mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4"},[t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"zipcode",value:e.$trans("admin.quarantine.zipcode")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"zipcode",type:"text"},model:{value:e.form.zipcode,callback:function(r){e.$set(e.form,"zipcode",r)},expression:"form.zipcode"}})],1),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"city",value:e.$trans("admin.quarantine.city")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"city",type:"text"},model:{value:e.form.city,callback:function(r){e.$set(e.form,"city",r)},expression:"form.city"}})],1)]),t("div",{staticClass:"mt-4"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"country",value:e.$trans("admin.quarantine.country")}}
3877),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"country",type:"text"},model:{value:e.form.country,callback:function(r){e.$set(e.form,"country",r)},expression:"form.country"}})],1)]),t("div",{staticClass:"mt-8 pt-6 border-t border-gray-200"},[t("h3",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-4 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.section_details"))+" ")]),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"reason",value:e.$trans("admin.quarantine.reason")}}),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.form.reason,expression:"form.reason"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",attrs:{id:"reason",rows:"4"},domProps:{value:e.form.reason},on:{input:function(r){r.target.composing||e.$set(e.form,"reason",r.target.value)}}})],1)]),e.form.category==="quarantine"?[t("div",{staticClass:"mt-8 pt-6 border-t border-gray-200"},[t("h3",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-4 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.section_quarantine"))+" ")]),t("div",{staticClass:"flex items-start gap-6 flex-wrap"},[t("div",{staticClass:"flex items-center mt-2"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.fine,expression:"form.fine"}],staticClass:"rounded border-gray-300 text-blue-600 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50",attrs:{id:"fine",type:"checkbox","true-value":1,"false-value":0},domProps:{checked:Array.isArray(e.form.fine)?e._i(e.form.fine,null)>-1:e._q(e.form.fine,1)},on:{change:function(r){var i=e.form.fine,a=r.target,s=a.checked?1:0;if(Array.isArray(i)){var o=null,c=e._i(i,o);a.checked?c<0&&e.$set(e.form,"fine",i.concat([o])):c>-1&&e.$set(e.form,"fine",i.slice(0,c).concat(i.slice(c+1)))}else e.$set(e.form,"fine",s)}}}),t("jet-label",{staticClass:"ml-2 capitalize",attrs:{for:"fine",value:e.$trans("admin.quarantine.fine")}})],1),t("div",{staticClass:"flex-1 min-w-0",staticStyle:{"min-width":"150px"}},[t("jet-label",{staticClass:"capitalize",attrs:{for:"fine_amount",value:e.$trans("admin.quarantine.fine_amount")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"fine_amount",type:"number"},model:{value:e.form.fine_amount,callback:function(r){e.$set(e.form,"fine_amount",r)},expression:"form.fine_amount"}})],1)]),t("div",{staticClass:"mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4"},[t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"quarantine_startdate",value:e.$trans("admin.quarantine.quarantine_startdate")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"quarantine_startdate",type:"date"},model:{value:e.form.quarantine_startdate,callback:function(r){e.$set(e.form,"quarantine_startdate",r)},expression:"form.quarantine_startdate"}})],1),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"expire_at",value:e.$trans("admin.quarantine.expire_at")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"expire_at",type:"datetime-local"},model:{value:e.form.expire_at,callback:function(r){e.$set(e.form,"expire_at",r)},expression:"form.expire_at"}})],1)]),t("div",{staticClass:"mt-4"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"invoice_number",value:e.$trans("admin.quarantine.invoice_number")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"invoice_number",type:"text"},model:{value:e.form.invoice_number,callback:function(r){e.$set(e.form,"invoice_number",r)},expression:"form.invoice_number"}})],1),t("div",{staticClass:"mt-4 flex items-center"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.invoice_paid,expression:"form.invoice_paid"}],staticClass:"rounded border-gray-300 text-blue-600 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50",attrs:{id:"invoice_paid",type:"checkbox","true-value":1,"false-value":0,disabled:!e.form.fine},domProps:{checked:Array.isArray(e.form.invoice_paid)?e._i(e.form.invoice_paid,null)>-1:e._q(e.form.invoice_paid,1)},on:{change:function(r){var i=e.form.invoice_paid,a=r.target,s=a.checked?1:0;if(Array.isArray(i)){var o=null,c=e._i(i,o);a.checked?c<0&&e.$set(e.form,"invoice_paid",i.concat([o])):c>-1&&e.$set(e.form,"invoice_paid",i.slice(0,c).concat(i.slice(c+1)))}else e.$set(e.form,"invoice_paid",s)}}}),t("jet-label",{staticClass:"ml-2 capitalize",attrs:{for:"invoice_paid",value:e.$trans("admin.quarantine.invoice_paid")}}),e.form.fine?e._e():t("p",{staticClass:"text-xs text-gray-400 ml-2"},[e._v("("+e._s(e.$trans("admin.quarantine.invoice_paid_help"))+")")])],1),t("div",{staticClass:"mt-4"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"quarantine_sent_via",value:e.$trans("admin.quarantine.quarantine_sent_via")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"quarantine_sent_via",type:"text",placeholder:e.$trans("admin.quarantine.quarantine_sent_via_placeholder")},model:{value:e.form.quarantine_sent_via,callback:function(r){e.$set(e.form,"quarantine_sent_via",r)},expression:"form.quarantine_sent_via"}})],1)])]:e._e(),t("div",{staticClass:"mt-8 pt-6 border-t border-gray-200"},[t("h3",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-4 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.section_links"))+" ")]),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"sharepoint_files_link",value:e.$trans("admin.quarantine.sharepoint_files_link")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"sharepoint_files_link",type:"url"},model:{value:e.form.sharepoint_files_link,callback:function(r){e.$set(e.form,"sharepoint_files_link",r)},expression:"form.sharepoint_files_link"}})],1),t("div",{staticClass:"mt-4"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"quarantine_letter_link",value:e.$trans("admin.quarantine.quarantine_letter_link")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"quarantine_letter_link",type:"url"},model:{value:e.form.quarantine_letter_link,callback:function(r){e.$set(e.form,"quarantine_letter_link",r)},expression:"form.quarantine_letter_link"}})],1)]),t("div",{staticClass:"mt-8 pt-6 border-t border-gray-200 flex justify-end"},[t("jet-button",{staticClass:"ml-4",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("admin.quarantine.create-quarantine"))+" ")])],1)],2)])])])},Phe=[],Rhe=ve(The,Ehe,Phe,!1,null,null);const Ahe=Rhe.exports,Ihe=Object.freeze(Object.defineProperty({__proto__:null,default:Ahe},Symbol.toStringTag,{value:"Module"})),Ohe={props:{quarantine:Object,categories:Array}
3877,components:{AdminLayout:Gt,JetInput:Rn,JetLabel:Un,JetButton:mn,JetConfirmationModal:kf,JetSecondaryButton:Br,JetDangerButton:vo,JetInputError:ea,FormErrors:IF},data(){return{form:this.$inertia.form({category:this.quarantine.category||"quarantine",firstname:this.quarantine.firstname,lastname:this.quarantine.lastname,cpr:this.quarantine.cpr,phone:this.quarantine.phone,email:this.quarantine.email,street:this.quarantine.street,housenumber:this.quarantine.housenumber,side:this.quarantine.side,zipcode:this.quarantine.zipcode,city:this.quarantine.city,country:this.quarantine.country,reason:this.quarantine.reason,fine:this.quarantine.fine||0,fine_amount:this.quarantine.fine_amount,expire_at:this.quarantine.expire_at?this.quarantine.expire_at.slice(0,16):"",user_id:this.quarantine.user_id,away_application_id:this.quarantine.away_application_id,photos:[],invoice_number:this.quarantine.invoice_number||"",invoice_paid:this.quarantine.invoice_paid||0,quarantine_startdate:this.quarantine.quarantine_startdate?this.quarantine.quarantine_startdate.slice(0,10):"",quarantine_sent_via:this.quarantine.quarantine_sent_via||"",sharepoint_files_link:this.quarantine.sharepoint_files_link||"",quarantine_letter_link:this.quarantine.quarantine_letter_link||"",_method:"put"}),imagePreviews:[],showDeletePhotoModal:!1,deletePhotoId:null}},watch:{"form.category"(n){n!=="quarantine"&&(this.form.fine=0,this.form.fine_amount="",this.form.expire_at="",this.form.invoice_number="",this.form.invoice_paid=0,this.form.quarantine_startdate="",this.form.quarantine_sent_via="")},"form.fine"(n){n||(this.form.invoice_paid=0)}},methods:{handleImageChange(n){Array.from(n.target.files).forEach(t=>{const r=new FileReader;r.onload=i=>{this.imagePreviews.push(i.target.result)},r.readAsDataURL(t),this.form.photos.push(t)}),n.target.value=""},removeNewPhoto(n){this.imagePreviews.splice(n,1),this.form.photos.splice(n,1)},confirmDeletePhoto(n){this.deletePhotoId=n,this.showDeletePhotoModal=!0},executeDeletePhoto(){this.$inertia.delete(this.route("admin.quarantines.destroy-photo",this.deletePhotoId)),this.showDeletePhotoModal=!1,this.deletePhotoId=null},submit(){this.form.post(this.route("admin.quarantines.update",this.quarantine.id),{onError:()=>this.scrollToErrors()})},scrollToErrors(){this.$nextTick(()=>{const n=this.$el.querySelector('[role="alert"]');n&&n.scrollIntoView&&n.scrollIntoView({behavior:"smooth",block:"center"})})}}};var Mhe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-2 sm:m-0 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.edit-quarantine"))+" ")])]},proxy:!0}])},[t("div",{staticClass:"bg-white rounded-lg shadow-sm p-4 sm:p-6"},[t("form",{attrs:{method:"POST"},on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",{staticClass:"max-w-3xl mx-auto"},[t("form-errors",{attrs:{errors:e.form.errors,title:e.$trans("admin.quarantine.not_saved")}}),t("div",{staticClass:"flex flex-col items-center pb-6 border-b border-gray-200"},[e.quarantine.photos&&e.quarantine.photos.length>0||e.imagePreviews.length>0?t("div",{staticClass:"flex gap-3 overflow-x-auto pb-2 mb-3 w-full justify-center"},[e._l(e.quarantine.photos,function(r){return t("div",{key:r.id,staticClass:"relative flex-shrink-0"},[t("img",{staticClass:"w-24 h-24 sm:w-32 sm:h-32 object-cover rounded-lg",attrs:{src:r.url,alt:"Existing photo"}}),t("button",{staticClass:"absolute -top-2 -right-2 bg-red-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-xs hover:bg-red-600",attrs:{type:"button"},on:{click:function(i){return e.confirmDeletePhoto(r.id)}}},[e._v(" Ã ")])])}),e._l(e.imagePreviews,function(r,i){return t("div",{key:"new-"+i,staticClass:"relative flex-shrink-0"},[t("img",{staticClass:"w-24 h-24 sm:w-32 sm:h-32 object-cover rounded-lg border-2 border-blue-300",attrs:{src:r,alt:"New photo preview"}}),t("button",{staticClass:"absolute -top-2 -right-2 bg-red-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-xs hover:bg-red-600",attrs:{type:"button"},on:{click:function(a){return e.removeNewPhoto(i)}}},[e._v(" Ã ")])])})],2):t("div",{staticClass:"w-24 h-24 rounded-lg border-2 border-dashed border-gray-300 flex items-center justify-center mb-3"},[t("svg",{staticClass:"w-10 h-10 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}})])]),t("jet-label",{staticClass:"capitalize text-sm font-medium text-gray-700",attrs:{for:"photos",value:e.$trans("admin.quarantine.photo")}}),t("input",{staticClass:"mt-1 block text-sm",attrs:{id:"photos",type:"file",multiple:"",accept:"image/*"},on:{change:e.handleImageChange}})],1),t("div",{staticClass:"mt-6"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"category",value:e.$trans("admin.quarantine.category")}}),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.category,expression:"form.category"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",attrs:{id:"category"},on:{change:function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.$set(e.form,"category",r.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"quarantine"}},[e._v(e._s(e.$trans("admin.quarantine.category_quarantine")))]),t("option",{attrs:{value:"warning"}},[e._v(e._s(e.$trans("admin.quarantine.category_warning")))]),t("option",{attrs:{value:"person_of_interest"}},[e._v(e._s(e.$trans("admin.quarantine.category_person_of_interest")))])])],1
3877),t("div",{staticClass:"mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4"},[t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"user_id",value:"user_id"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"user_id",type:"number"},model:{value:e.form.user_id,callback:function(r){e.$set(e.form,"user_id",r)},expression:"form.user_id"}})],1),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"away_application_id",value:"awaycard_id"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"away_application_id",type:"number"},model:{value:e.form.away_application_id,callback:function(r){e.$set(e.form,"away_application_id",r)},expression:"form.away_application_id"}})],1)]),t("div",{staticClass:"mt-8 pt-6 border-t border-gray-200"},[t("h3",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-4 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.section_personal"))+" ")]),t("div",{staticClass:"grid grid-cols-1 sm:grid-cols-2 gap-4"},[t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"firstname",value:e.$trans("admin.quarantine.firstname")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"firstname",type:"text"},model:{value:e.form.firstname,callback:function(r){e.$set(e.form,"firstname",r)},expression:"form.firstname"}})],1),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"lastname",value:e.$trans("admin.quarantine.lastname")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"lastname",type:"text"},model:{value:e.form.lastname,callback:function(r){e.$set(e.form,"lastname",r)},expression:"form.lastname"}})],1)]),t("div",{staticClass:"mt-4"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"cpr",value:e.$trans("admin.quarantine.cpr")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"cpr",type:"number"},model:{value:e.form.cpr,callback:function(r){e.$set(e.form,"cpr",r)},expression:"form.cpr"}}),t("jet-input-error",{staticClass:"mt-1",attrs:{message:e.form.errors.cpr}})],1),t("div",{staticClass:"mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4"},[t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"phone",value:e.$trans("admin.quarantine.phone")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"phone",type:"text"},model:{value:e.form.phone,callback:function(r){e.$set(e.form,"phone",r)},expression:"form.phone"}}),t("jet-input-error",{staticClass:"mt-1",attrs:{message:e.form.errors.phone}})],1),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"email",value:e.$trans("admin.quarantine.email")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"email",type:"text"},model:{value:e.form.email,callback:function(r){e.$set(e.form,"email",r)},expression:"form.email"}}),t("jet-input-error",{staticClass:"mt-1",attrs:{message:e.form.errors.email}})],1)])]),t("div",{staticClass:"mt-8 pt-6 border-t border-gray-200"},[t("h3",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-4 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.section_address"))+" ")]),t("div",{staticClass:"grid grid-cols-3 gap-4"},[t("div",{staticClass:"col-span-3 sm:col-span-1"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"street",value:e.$trans("admin.quarantine.street")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"street",type:"text"},model:{value:e.form.street,callback:function(r){e.$set(e.form,"street",r)},expression:"form.street"}})],1),t("div",{staticClass:"col-span-2 sm:col-span-1"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"housenumber",value:e.$trans("admin.quarantine.housenumber")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"housenumber",type:"text"},model:{value:e.form.housenumber,callback:function(r){e.$set(e.form,"housenumber",r)},expression:"form.housenumber"}})],1),t("div",{staticClass:"col-span-1"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"side",value:e.$trans("admin.quarantine.side")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"side",type:"text"},model:{value:e.form.side,callback:function(r){e.$set(e.form,"side",r)},expression:"form.side"}})],1)]),t("div",{staticClass:"mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4"},[t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"zipcode",value:e.$trans("admin.quarantine.zipcode")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"zipcode",type:"text"},model:{value:e.form.zipcode,callback:function(r){e.$set(e.form,"zipcode",r)},expression:"form.zipcode"}})],1),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"city",value:e.$trans("admin.quarantine.city")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"city",type:"text"},model:{value:e.form.city,callback:function(r){e.$set(e.form,"city",r)},expression:"form.city"}})],1)]),t("div",{staticClass:"mt-4"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"country",value:e.$trans("admin.quarantine.country")}}
3877),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"country",type:"text"},model:{value:e.form.country,callback:function(r){e.$set(e.form,"country",r)},expression:"form.country"}})],1)]),t("div",{staticClass:"mt-8 pt-6 border-t border-gray-200"},[t("h3",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-4 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.section_details"))+" ")]),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"reason",value:e.$trans("admin.quarantine.reason")}}),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.form.reason,expression:"form.reason"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",attrs:{id:"reason",rows:"4"},domProps:{value:e.form.reason},on:{input:function(r){r.target.composing||e.$set(e.form,"reason",r.target.value)}}})],1)]),e.form.category==="quarantine"?[t("div",{staticClass:"mt-8 pt-6 border-t border-gray-200"},[t("h3",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-4 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.section_quarantine"))+" ")]),t("div",{staticClass:"flex items-start gap-6 flex-wrap"},[t("div",{staticClass:"flex items-center mt-2"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.fine,expression:"form.fine"}],staticClass:"rounded border-gray-300 text-blue-600 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50",attrs:{id:"fine",type:"checkbox","true-value":1,"false-value":0},domProps:{checked:Array.isArray(e.form.fine)?e._i(e.form.fine,null)>-1:e._q(e.form.fine,1)},on:{change:function(r){var i=e.form.fine,a=r.target,s=a.checked?1:0;if(Array.isArray(i)){var o=null,c=e._i(i,o);a.checked?c<0&&e.$set(e.form,"fine",i.concat([o])):c>-1&&e.$set(e.form,"fine",i.slice(0,c).concat(i.slice(c+1)))}else e.$set(e.form,"fine",s)}}}),t("jet-label",{staticClass:"ml-2 capitalize",attrs:{for:"fine",value:e.$trans("admin.quarantine.fine")}})],1),t("div",{staticClass:"flex-1 min-w-0",staticStyle:{"min-width":"150px"}},[t("jet-label",{staticClass:"capitalize",attrs:{for:"fine_amount",value:e.$trans("admin.quarantine.fine_amount")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"fine_amount",type:"number"},model:{value:e.form.fine_amount,callback:function(r){e.$set(e.form,"fine_amount",r)},expression:"form.fine_amount"}}),t("jet-input-error",{staticClass:"mt-1",attrs:{message:e.form.errors.fine_amount}})],1)]),t("div",{staticClass:"mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4"},[t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"quarantine_startdate",value:e.$trans("admin.quarantine.quarantine_startdate")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"quarantine_startdate",type:"date"},model:{value:e.form.quarantine_startdate,callback:function(r){e.$set(e.form,"quarantine_startdate",r)},expression:"form.quarantine_startdate"}}),t("jet-input-error",{staticClass:"mt-1",attrs:{message:e.form.errors.quarantine_startdate}})],1),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"expire_at",value:e.$trans("admin.quarantine.expire_at")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"expire_at",type:"datetime-local"},model:{value:e.form.expire_at,callback:function(r){e.$set(e.form,"expire_at",r)},expression:"form.expire_at"}}),t("jet-input-error",{staticClass:"mt-1",attrs:{message:e.form.errors.expire_at}})],1)]),t("div",{staticClass:"mt-4"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"invoice_number",value:e.$trans("admin.quarantine.invoice_number")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"invoice_number",type:"text"},model:{value:e.form.invoice_number,callback:function(r){e.$set(e.form,"invoice_number",r)},expression:"form.invoice_number"}})],1),t("div",{staticClass:"mt-4 flex items-center"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.invoice_paid,expression:"form.invoice_paid"}],staticClass:"rounded border-gray-300 text-blue-600 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50",attrs:{id:"invoice_paid",type:"checkbox","true-value":1,"false-value":0,disabled:!e.form.fine},domProps:{checked:Array.isArray(e.form.invoice_paid)?e._i(e.form.invoice_paid,null)>-1:e._q(e.form.invoice_paid,1)},on:{change:function(r){var i=e.form.invoice_paid,a=r.target,s=a.checked?1:0;if(Array.isArray(i)){var o=null,c=e._i(i,o);a.checked?c<0&&e.$set(e.form,"invoice_paid",i.concat([o])):c>-1&&e.$set(e.form,"invoice_paid",i.slice(0,c).concat(i.slice(c+1)))}else e.$set(e.form,"invoice_paid",s)}}}),t("jet-label",{staticClass:"ml-2 capitalize",attrs:{for:"invoice_paid",value:e.$trans("admin.quarantine.invoice_paid")}}),e.form.fine?e._e():t("p",{staticClass:"text-xs text-gray-400 ml-2"},[e._v("("+e._s(e.$trans("admin.quarantine.invoice_paid_help"))+")")])],1),t("div",{staticClass:"mt-4"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"quarantine_sent_via",value:e.$trans("admin.quarantine.quarantine_sent_via")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"quarantine_sent_via",type:"text",placeholder:e.$trans("admin.quarantine.quarantine_sent_via_placeholder")},model:{value:e.form.quarantine_sent_via,callback:function(r){e.$set(e.form,"quarantine_sent_via",r)},expression:"form.quarantine_sent_via"}})],1)])]:e._e(),t("div",{staticClass:"mt-8 pt-6 border-t border-gray-200"},[t("h3",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider mb-4 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.section_links"))+" ")]),t("div",[t("jet-label",{staticClass:"capitalize",attrs:{for:"sharepoint_files_link",value:e.$trans("admin.quarantine.sharepoint_files_link")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"sharepoint_files_link",type:"url"},model:{value:e.form.sharepoint_files_link,callback:function(r){e.$set(e.form,"sharepoint_files_link",r)},expression:"form.sharepoint_files_link"}}),t("jet-input-error",{staticClass:"mt-1",attrs:{message:e.form.errors.sharepoint_files_link}})],1),t("div",{staticClass:"mt-4"},[t("jet-label",{staticClass:"capitalize",attrs:{for:"quarantine_letter_link",value:e.$trans("admin.quarantine.quarantine_letter_link")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"quarantine_letter_link",type:"url"},model:{value:e.form.quarantine_letter_link,callback:function(r){e.$set(e.form,"quarantine_letter_link",r)},expression:"form.quarantine_letter_link"}}),t("jet-input-error",{staticClass:"mt-1",attrs:{message:e.form.errors.quarantine_letter_link}})],1)]),t("div",{staticClass:"mt-8 pt-6 border-t border-gray-200 flex justify-end"},[t("jet-button",{staticClass:"ml-4",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("admin.quarantine.update-quarantine"))+" ")])],1)],2)])]),t("jet-confirmation-modal",{attrs:{show:e.showDeletePhotoModal},on:{close:function(r){e.showDeletePhotoModal=!1}},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(e._s(e.$trans("admin.quarantine.delete")))]},proxy:!0},{key:"content",fn:function(){return[e._v(e._s(e.$trans("admin.quarantine.confirm_delete_photo")))]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){e.showDeletePhotoModal=!1}}},[e._v(" "+e._s(e.$trans("admin.quarantine.cancel"))+" ")]),t("jet-danger-button",{staticClass:"ml-2",nativeOn:{click:function(r){return e.executeDeletePhoto.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("admin.quarantine.delete"))+" ")])]},proxy:!0}])})],1)},Dhe=[],Nhe=ve(Ohe,Mhe,Dhe,!1,null,null);const Lhe=Nhe.exports,Fhe=Object.freeze(Object.defineProperty({__proto__:null,default:Lhe},Symbol.toStringTag,{value:"Module"})),$he={props:["quarantines","currentCategory"],components:{AdminLayout:Gt,JetNavLink:Zu,JetConfirmationModal:kf,JetSecondaryButton:Br,JetDangerButton:vo},data(){return{showDeleteModal:!1,deleteId:null}},computed:{pageTitle(){const n={quarantine:"admin.quarantine.quarantines",warning:"admin.quarantine.warnings",person_of_interest:"admin.quarantine.person_of_interest",expired:"admin.quarantine.expired_quarantines"};return this.$trans(n[this.currentCategory]||"admin.quarantine.quarantines")}},methods:{confirmDelete(n){this.deleteId=n,this.showDeleteModal=!0},executeDelete(){this.$inertia.delete(`/admin/quarantines/${this.deleteId}`),this.showDeleteModal=!1,this.deleteId=null},computedAge(n){if(!n||n.length<6)return"";const e=n.substring(0,2),t=n.substring(2,4),r=n.substring(4,6),i=r<50?`20${r}`:`19${r}`,a=new Date(`${i}-${t}-${e}`),s=new Date;let o=s.getFullYear()-a.getFullYear();const c=s.getMonth()-a.getMonth();return(c<0||c===0&&s.getDate()<a.getDate())&&o--,o},formatDate(n){return n?new Date(n).toLocaleDateString("da-DK",{year:"numeric",month:"long",day:"numeric"}):""},getOverdueDays(n){if(!n.expire_at)return 0;const e=new Date(n.expire_at),r=Math.floor((new Date-e)/(1e3*60*60*24));return r>0?r:0},getDaysRemaining(n){if(!n)return"";const r=new Date(n)-new Date,i=Math.ceil(r/(1e3*60*60*24));return i<0?this.$trans("admin.quarantine.expired"):i===0?this.$trans("admin.quarantine.expires_today"):this.$trans("admin.quarantine.days_remaining").replace(":days",i)}}};var Bhe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"flex flex-row justify-between items-center"},[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight mt-2 md:mt-0 capitalize"},[e._v(" "+e._s(e.pageTitle)+" ")]),t("jet-nav-link",{staticClass:"bg-blue-600 hover:bg-blue-700 text-white capitalize cursor-pointer font-bold py-2 px-4 roun
3877ded transition duration-150 ease-in-out",attrs:{href:e.route("admin.quarantines.create")}},[t("i",{staticClass:"fas fa-plus mr-2"}),e._v(e._s(e.$trans("admin.quarantine.create-quarantine"))+" ")])],1)]},proxy:!0}])},[t("div",{staticClass:"border-b border-gray-200 mb-4 overflow-x-auto"},[t("nav",{staticClass:"flex space-x-1 px-2 min-w-max",attrs:{"aria-label":"Tabs"}},[t("inertia-link",{staticClass:"px-4 py-2 font-medium text-sm border-b-2 transition-colors duration-200 whitespace-nowrap",class:e.currentCategory==="quarantine"?"border-red-500 text-red-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300",attrs:{href:e.route("admin.quarantines.index",{category:"quarantine"})}},[e._v(" "+e._s(e.$trans("admin.quarantine.quarantines"))+" ")]),t("inertia-link",{staticClass:"px-4 py-2 font-medium text-sm border-b-2 transition-colors duration-200 whitespace-nowrap",class:e.currentCategory==="warning"?"border-yellow-500 text-yellow-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300",attrs:{href:e.route("admin.quarantines.index",{category:"warning"})}},[e._v(" "+e._s(e.$trans("admin.quarantine.warnings"))+" ")]),t("inertia-link",{staticClass:"px-4 py-2 font-medium text-sm border-b-2 transition-colors duration-200 whitespace-nowrap",class:e.currentCategory==="person_of_interest"?"border-purple-500 text-purple-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300",attrs:{href:e.route("admin.quarantines.index",{category:"person_of_interest"})}},[e._v(" "+e._s(e.$trans("admin.quarantine.person_of_interest"))+" ")]),t("inertia-link",{staticClass:"px-4 py-2 font-medium text-sm border-b-2 transition-colors duration-200 whitespace-nowrap",class:e.currentCategory==="expired"?"border-gray-500 text-gray-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300",attrs:{href:e.route("admin.quarantines.expired")}},[e._v(" "+e._s(e.$trans("admin.quarantine.expired_quarantines"))+" ")])],1)]),e.quarantines.length===0?t("div",{staticClass:"bg-white shadow overflow-hidden sm:rounded-lg"},[t("div",{staticClass:"text-center py-12"},[t("i",{staticClass:"fas fa-user-slash text-gray-300 text-4xl mb-4 block"}),t("p",{staticClass:"text-sm text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.no_records")))])])]):[t("div",{staticClass:"hidden md:block bg-white shadow overflow-hidden sm:rounded-lg"},[t("div",{staticClass:"overflow-x-auto"},[t("table",{staticClass:"min-w-full divide-y divide-gray-200"},[t("thead",{staticClass:"bg-gray-50"},[t("tr",[t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider capitalize",attrs:{scope:"col"}},[e._v(" "+e._s(e.$trans("admin.quarantine.image"))+" ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider capitalize",attrs:{scope:"col"}},[e._v(" "+e._s(e.$trans("admin.quarantine.info"))+" ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider capitalize",attrs:{scope:"col"}},[e._v(" "+e._s(e.currentCategory==="quarantine"||e.currentCategory==="expired"?e.$trans("admin.quarantine.expiry"):e.$trans("admin.quarantine.status"))+" ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider capitalize",attrs:{scope:"col"}},[e._v(" "+e._s(e.$trans("admin.quarantine.actions"))+" ")])])]),t("tbody",{staticClass:"bg-white divide-y divide-gray-200"},e._l(e.quarantines,function(r){var i;return t("tr",{key:r.id,staticClass:"hover:bg-gray-50 transition-colors duration-200"},[t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[t("div",{staticClass:"flex-shrink-0 h-24 w-24 relative"},[r.photos&&r.photos.length>0?t("img",{staticClass:"h-24 w-24 rounded-lg object-cover shadow-sm",attrs:{src:r.photos[0].url,alt:r.firstname+" "+r.lastname}}):t("div",{staticClass:"h-24 w-24 rounded-lg bg-gray-100 flex items-center justify-center"},[t("i",{staticClass:"fas fa-user text-gray-400 text-2xl"})]),r.photos&&r.photos.length>1?t("span",{staticClass:"absolute -top-1 -right-1 bg-blue-600 text-white text-xs rounded-full w-5 h-5 flex items-center justify-center"}
3877,[e._v(" "+e._s(r.photos.length)+" ")]):e._e()])]),t("td",{staticClass:"px-6 py-4"},[t("div",{staticClass:"text-sm"},[t("div",{staticClass:"font-medium text-gray-900"},[e._v(e._s(r.firstname)+" "+e._s(r.lastname))]),t("div",{staticClass:"text-gray-500"},[e._v(e._s(e.computedAge(r.cpr))+" "+e._s(e.$trans("admin.quarantine.years_old")))]),r.reason?t("div",{staticClass:"text-gray-500 mt-1"},[t("span",{staticClass:"font-medium"},[e._v(e._s(e.$trans("admin.quarantine.reason")))]),e._v(" "+e._s(r.reason)+" ")]):e._e()])]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[e.currentCategory==="quarantine"||e.currentCategory==="expired"?[t("div",{staticClass:"text-sm text-gray-900"},[e._v(" "+e._s(e.formatDate(r.expire_at))+" ")]),e.getOverdueDays(r)>0?t("div",{staticClass:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-red-100 text-red-800"},[e._v(" "+e._s(e.$trans("admin.quarantine.overdue_days").replace(":days",e.getOverdueDays(r)))+" ")]):t("div",{staticClass:"text-xs text-gray-500"},[e._v(" "+e._s(e.getDaysRemaining(r.expire_at))+" ")])]:[t("span",{staticClass:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.always_active"))+" ")])]],2),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm font-medium"},[t("div",{staticClass:"flex flex-col space-y-2"},[t("inertia-link",{staticClass:"inline-flex items-center px-3 py-2 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors duration-200",attrs:{href:`/admin/quarantines/${r.id}`}},[t("i",{staticClass:"fas fa-eye mr-2"}),e._v(" "+e._s(e.$trans("admin.quarantine.view_details"))+" ")]),(i=r==null?void 0:r.user)!=null&&i.id?t("inertia-link",{staticClass:"inline-flex items-center px-3 py-2 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors duration-200",attrs:{href:`/admin/users/${r.user.id}`}},[t("i",{staticClass:"fas fa-user mr-2"}),e._v(" "+e._s(e.$trans("admin.quarantine.view_profile"))+" ")]):e._e(),t("button",{staticClass:"inline-flex items-center px-3 py-2 border border-transparent shadow-sm text-sm leading-4 font-medium rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 transition-colors duration-200",on:{click:function(a){return e.confirmDelete(r.id)}}},[t("i",{staticClass:"fas fa-trash-alt mr-2"}),e._v(" "+e._s(e.$trans("admin.quarantine.delete"))+" ")])],1)])])}),0)])])]),t("div",{staticClass:"md:hidden space-y-3"},e._l(e.quarantines,function(r){var i;return t("div",{key:"m-"+r.id,staticClass:"bg-white rounded-lg shadow-sm p-4"},[t("div",{staticClass:"flex items-start space-x-4"},[t("div",{staticClass:"flex-shrink-0 h-16 w-16 relative"},[r.photos&&r.photos.length>0?t("img",{staticClass:"h-16 w-16 rounded-lg object-cover shadow-sm",attrs:{src:r.photos[0].url,alt:r.firstname+" "+r.lastname}}):t("div",{staticClass:"h-16 w-16 rounded-lg bg-gray-100 flex items-center justify-center"},[t("i",{staticClass:"fas fa-user text-gray-400 text-lg"})]),r.photos&&r.photos.length>1?t("span",{staticClass:"absolute -top-1 -right-1 bg-blue-600 text-white text-xs rounded-full w-4 h-4 flex items-center justify-center"},[e._v(" "+e._s(r.photos.length)+" ")]):e._e()]),t("div",{staticClass:"flex-1 min-w-0"},[t("div",{staticClass:"font-medium text-gray-900"},[e._v(e._s(r.firstname)+" "+e._s(r.lastname))]),t("div",{staticClass:"text-sm text-gray-500"},[e._v(e._s(e.computedAge(r.cpr))+" "+e._s(e.$trans("admin.quarantine.years_old")))]),t("div",{staticClass:"mt-1"},[e.currentCategory==="quarantine"||e.currentCategory==="expired"?[t("div",{staticClass:"text-sm text-gray-700"},[e._v(e._s(e.formatDate(r.expire_at)))]),e.getOverdueDays(r)>0?t("span",{staticClass:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-red-100 text-red-800"},[e._v(" "+e._s(e.$trans("admin.quarantine.overdue_days").replace(":days",e.getOverdueDays(r)))+" ")]):t("span",{staticClass:"text-xs text-gray-500"},[e._v(e._s(e.getDaysRemaining(r.expire_at)))])]:[t("span",{staticClass:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.always_active"))+" ")])]],2)])]),r.reason?t("div",{staticClass:"mt-3 text-sm text-gray-500 line-clamp-2"},[t("span",{staticClass:"font-medium"},[e._v(e._s(e.$trans("admin.quarantine.reason")))]),e._v(" "+e._s(r.reason)+" ")]):e._e(
3877),t("div",{staticClass:"mt-3 pt-3 border-t border-gray-100 flex flex-wrap gap-2"},[t("inertia-link",{staticClass:"inline-flex items-center px-3 py-1.5 border border-gray-300 shadow-sm text-xs font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50",attrs:{href:`/admin/quarantines/${r.id}`}},[t("i",{staticClass:"fas fa-eye mr-1.5"}),e._v(" "+e._s(e.$trans("admin.quarantine.view_details"))+" ")]),(i=r==null?void 0:r.user)!=null&&i.id?t("inertia-link",{staticClass:"inline-flex items-center px-3 py-1.5 border border-gray-300 shadow-sm text-xs font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50",attrs:{href:`/admin/users/${r.user.id}`}},[t("i",{staticClass:"fas fa-user mr-1.5"}),e._v(" "+e._s(e.$trans("admin.quarantine.view_profile"))+" ")]):e._e(),t("button",{staticClass:"inline-flex items-center px-3 py-1.5 border border-transparent shadow-sm text-xs font-medium rounded-md text-white bg-red-600 hover:bg-red-700",on:{click:function(a){return e.confirmDelete(r.id)}}},[t("i",{staticClass:"fas fa-trash-alt mr-1.5"}),e._v(" "+e._s(e.$trans("admin.quarantine.delete"))+" ")])],1)])}),0)],t("jet-confirmation-modal",{attrs:{show:e.showDeleteModal},on:{close:function(r){e.showDeleteModal=!1}},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(e._s(e.$trans("admin.quarantine.delete-quarantine")))]},proxy:!0},{key:"content",fn:function(){return[e._v(e._s(e.$trans("admin.quarantine.confirm_delete")))]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){e.showDeleteModal=!1}}},[e._v(" "+e._s(e.$trans("admin.quarantine.cancel"))+" ")]),t("jet-danger-button",{staticClass:"ml-2",nativeOn:{click:function(r){return e.executeDelete.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("admin.quarantine.delete"))+" ")])]},proxy:!0}])})],2)},Uhe=[],jhe=ve($he,Bhe,Uhe,!1,null,null);const qhe=jhe.exports,zhe=Object.freeze(Object.defineProperty({__proto__:null,default:qhe},Symbol.toStringTag,{value:"Module"})),Whe={props:["quarantine"],components:{AdminLayout:Gt,JetNavLink:Zu},methods:{formatDate(n){return n?new Date(n).toLocaleDateString("da-DK",{year:"numeric",month:"long",day:"numeric"}):"-"},categoryLabel(n){const e={quarantine:"admin.quarantine.category_quarantine",warning:"admin.quarantine.category_warning",person_of_interest:"admin.quarantine.category_person_of_interest"};return e[n]?this.$trans(e[n]):n},formatDateTime(n){return n?new Date(n).toLocaleString("da-DK",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-"}}};var Hhe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"flex flex-row justify-between items-center"},[t("h2",{staticClass:"capitalize font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("admin.quarantine.quarantine"))+" ")]),t("jet-nav-link",{staticClass:"inline-flex items-center bg-blue-600 hover:bg-blue-700 text-white capitalize cursor-pointer font-bold py-2 px-4 rounded transition duration-150 ease-in-out",attrs:{href:e.route("admin.quarantines.edit",e.quarantine.id)}},[t("i",{staticClass:"fas fa-edit mr-2"}),e._v(e._s(e.$trans("admin.quarantine.edit"))+" ")])],1)]},proxy:!0}])},[t("div",{staticClass:"bg-white rounded-lg shadow-sm overflow-hidden"},[e.quarantine.photos&&e.quarantine.photos.length>0?t("div",{staticClass:"p-4 sm:p-6 bg-gray-50 border-b border-gray-200"},[t("div",{staticClass:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4"},e._l(e.quarantine.photos,function(r){return t("img",{key:r.id,staticClass:"w-full rounded-lg object-cover shadow-sm",attrs:{src:r.url,alt:"Quarantine photo"}})}),0)]):e._e(),t("h3",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider px-4 sm:px-6 py-3 bg-gray-100 border-b border-gray-200 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.section_personal"))+" ")]),t("dl",{staticClass:"divide-y divide-gray-200"},[t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-white"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.category")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[t("span",{staticClass:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",class:{"bg-red-100 text-red-800":e.quarantine.category==="quarantine","bg-yellow-100 text-yellow-800":e.quarantine.category==="warning","bg-purple-100 text-purple-800":e.quarantine.category==="person_of_interest"}},[e._v(" "+e._s(e.categoryLabel(e.quarantine.category))+" ")])])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-gray-50"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.firstname")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[e._v(e._s(e.quarantine.firstname))])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-white"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.lastname")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[e._v(e._s(e.quarantine.lastname))])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-gray-50"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.cpr")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[e._v(e._s(e.quarantine.cpr))])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-white"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.phone")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[e._v(e._s(e.quarantine.phone))])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-gray-50"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.email")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[e._v(e._s(e.quarantine.email))])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-white"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.address")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[e._v(" "+e._s(e.quarantine.street)+" "+e._s(e.quarantine.housenumber)+" "+e._s(e.quarantine.side)+", "+e._s(e.quarantine.zipcode)+" "+e._s(e.quarantine.city)+", "+e._s(e.quarantine.country)+" ")])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-gray-50"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.reason")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2 whitespace-pre-line"},[e._v(e._s(e.quarantine.reason))])])]),e.quarantine.category==="quarantine"?[t("h3",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider px-4 sm:px-6 py-3 bg-gray-100 border-t border-b border-gray-200 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.section_quarantine"))+" ")]),t("dl",{staticClass:"divide-y divide-gray-200"},[t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-white"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.fine")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[t("span",{class:e.quarantine.fine?"text-red-600 font-medium":"text-gray-500"},[e._v(" "+e._s(e.quarantine.fine?e.$trans("admin.quarantine.yes"):e.$trans("admin.quarantine.no"))+" ")])])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-gray-50"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.fine_amount")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[e._v(e._s(e.quarantine.fine_amount||"-"))])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-white"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.quarantine_startdate")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[e._v(e._s(e.formatDate(e.quarantine.quarantine_startdate)))])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-gray-50"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.expire_at")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[e._v(e._s(e.formatDateTime(e.quarantine.expire_at)))])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-white"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.invoice_number")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[e._v(e._s(e.quarantine.invoice_number||"-"))])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-gray-50"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.invoice_paid")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[t("span",{class:e.quarantine.invoice_paid?"text-green-600 font-medium":"text-gray-500"},[e._v(" "+e._s(e.quarantine.invoice_paid?e.$trans("admin.quarantine.yes"):e.$trans("admin.quarantine.no"))+" ")])])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-white"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.quarantine_sent_via")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[e._v(e._s(e.quarantine.quarantine_sent_via||"-"))])])])]:e._e(),t("h3",{staticClass:"text-xs font-medium text-gray-500 uppercase tracking-wider px-4 sm:px-6 py-3 bg-gray-100 border-t border-b border-gray-200 capitalize"},[e._v(" "+e._s(e.$trans("admin.quarantine.section_links"))+" ")]),t("dl",{staticClass:"divide-y divide-gray-200"},[t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-white"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.files_link")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[e.quarantine.sharepoint_files_link?t("a",{staticClass:"text-blue-600 hover:text-blue-800 underline inline-flex items-center",attrs:{href:e.quarantine.sharepoint_files_link,target:"_blank"}},[t("i",{staticClass:"fas fa-external-link-alt mr-1.5 text-xs"}),e._v(" "+e._s(e.$trans("admin.quarantine.open_sharepoint_link"))+" ")]):t("span",{staticClass:"text-gray-400"},[e._v("-")])])]),t("div",{staticClass:"px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 bg-gray-50"},[t("dt",{staticClass:"text-sm font-medium text-gray-500 capitalize"},[e._v(e._s(e.$trans("admin.quarantine.quarantine_letter")))]),t("dd",{staticClass:"mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"},[e.quarantine.quarantine_letter_link?t("a",{staticClass:"text-blue-600 hover:text-blue-800 underline inline-flex items-center",attrs:{href:e.quarantine.quarantine_letter_link,target:"_blank"}},[t("i",{staticClass:"fas fa-external-link-alt mr-1.5 text-xs"}),e._v(" "+e._s(e.$trans("admin.quarantine.open_quarantine_letter"))+" ")]):t("span",{staticClass:"text-gray-400"},[e._v("-")])])])])],2)])},Vhe=[],Ghe=ve(Whe,Hhe,Vhe,!1,null,null);const Khe=Ghe.exports,Yhe=Object.freeze(Object.defineProperty({__proto__:null,default:Khe},Symbol.toStringTag,{value:"Module"})),Xhe={props:["games"],components:{AdminLayout:Gt},updated(){},created(){this.setNextUpcomingGame()},data(){return{selectedGame:null}},methods:{setNextUpcomingGame(){const n=new Date,t=this.games.filter(r=>new Date(r.kickoff_at)>n).reduce((r,i)=>r.kickoff_at<i.kickoff_at?r:i);this.selectedGame=t.id?t.id:this.games[0].id}}};var Jhe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" Admin ")])]},proxy:!0}])},[t("div",{staticClass:"bg-white p-3 overflow-hidden shadow-lg rounded-sm h-full"},[t("div",{staticClass:"sm:hidden block"},[t("label",{staticClass:"block text-sm font-medium leading-6 text-gray-900",attrs:{for:"location"}},[e._v("Game")]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.selectedGame,expression:"selectedGame"}],staticClass:"mt-2 block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 sm:text-sm sm:leading-6",attrs:{id:"location",name:"location"},on:{change:function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.selectedGame=r.target.multiple?i:i[0]}}}
3877,e._l(e.games,function(r){return t("option",{domProps:{value:r.id}},[e._v(e._s(r.kickoff_at)+" "+e._s(r.home_team.name)+" - "+e._s(r.away_team.name))])}),0),t("div",{staticClass:"mt-2"},[t("inertia-link",{staticClass:"inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray transition ease-in-out duration-150",attrs:{href:`/admin/fck-away/scan/${e.selectedGame}`}},[e._v("Scan")])],1)]),t("table",{staticClass:"hidden sm:table min-w-full divide-y divide-gray-300 border mt-2"},[t("thead",[t("tr",[t("th",{staticClass:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-3",attrs:{scope:"col"}},[e._v("Home team")]),t("th",{staticClass:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900",attrs:{scope:"col"}},[e._v("Away team")]),t("th",{staticClass:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900",attrs:{scope:"col"}},[e._v("Kickoff")]),t("th",{staticClass:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900",attrs:{scope:"col"}},[e._v("Stadium")]),t("th",{staticClass:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900",attrs:{scope:"col"}},[e._v("Scans")]),t("th",{staticClass:"relative py-3.5 pl-3 pr-4 sm:pr-3",attrs:{scope:"col"}},[t("span",{staticClass:"sr-only"},[e._v("Edit")])])])]),t("tbody",{staticClass:"bg-white"},e._l(e.games,function(r){return t("tr",{key:r.id,staticClass:"even:bg-gray-50"},[t("td",{staticClass:"whitespace-nowrap py-4 pl-4 pr-3 text-sm text-gray-900 sm:pl-3"},[e._v(e._s(r.home_team.name))]),t("td",{staticClass:"whitespace-nowrap px-3 py-4 text-sm text-gray-500"},[e._v(e._s(r.away_team.name))]),t("td",{staticClass:"whitespace-nowrap px-3 py-4 text-sm text-gray-500"},[e._v(e._s(r.kickoff_at))]),t("td",{staticClass:"whitespace-nowrap px-3 py-4 text-sm text-gray-500"},[e._v(e._s(r.home_team.stadium))]),t("td",{staticClass:"whitespace-nowrap px-3 py-4 text-sm text-gray-500"},[e._v(e._s(r.scans_count))]),t("td",{staticClass:"whitespace-nowrap px-3 py-4 pr-4 text-sm text-gray-500 flex flex-col"},[t("inertia-link",{staticClass:"text-indigo-600 hover:text-indigo-900 hover:underline cursor-pointer",attrs:{href:`/admin/fck-away/scan/${r.id}`}},[e._v("GÃ¥ til scan")]),t("inertia-link",{staticClass:"text-indigo-600 hover:text-indigo-900 hover:underline",attrs:{href:`/admin/fck-away/matches/${r.id}?page=1`}},[e._v("Se scanninger")])],1)])}),0)])])])},Qhe=[],Zhe=ve(Xhe,Jhe,Qhe,!1,null,null);const epe=Zhe.exports,tpe=Object.freeze(Object.defineProperty({__proto__:null,default:epe},Symbol.toStringTag,{value:"Module"})),npe={props:["game","count"],components:{AdminLayout:Gt},mounted(){const n=document.getElementById("barcode-input");n.addEventListener("blur",()=>{setTimeout(()=>{n.focus()},0)}),window.Echo&&window.Echo.channel(`game.${this.game.id}`).listen(".AwaycardScanned",e=>{this.currentCount=e.count})},updated(){},data(){return{currentCount:this.count,userId:1,member:null,memberId:null,warning:!1,warningMessage:"",isFullscreen:!1,fetching:!1}},methods:{async scan(){try{this.fetching=!0,this.warning=!1,this.warningMessage="",this.member=null;let n=await fetch("/admin/fck-away/scan",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').getAttribute("content")},body:JSON.stringify({gameId:this.game.id,barcode:this.memberId})});if(this.fetching=!1,n.status===404)this.warning=!0,this.warningMessage="User not found";else if(n.status===409){let e=await n.json(),t=Le(e.scan[0].created_at),r=t.fromNow(),i=Le(),a=Le.duration(i.diff(t)),s=a.days(),o=a.hours(),c=a.minutes(),u=a.seconds(),l="";s>0&&(l+=`${s} days, `),(o>0||s>0)&&(l+=`${o} hours, `),(c>0||o>0||s>0)&&(l+=`${c} minutes, `),l+=`${u} seconds`,this.warning=!0,this.warningMessage=`User already scanned ${r} (${l} ago)`}else if(n.status===200){let e=await n.json();this.member=e}else this.warning=!0,this.warningMessage=`Unexpected error: ${n.status}`}catch(n){this.warning=!0,this.warningMessage=`Network error: ${n.message}`,console.error("Fetch error:",n)}finally{this.memberId=null}},toggleFullscreen(){let n=document.documentElement;!document.fullscreenElement&&!document.webkitFullscreenElement&&!document.msFullscreenElement?n.requestFullscreen?n.requestFullscreen().then(()=>{this.isFullscreen=!0}).catch(e=>{console.error(`Error attempting to enable full-screen mode: ${e.message} (${e.name})`)}):n.webkitRequestFullscreen?(n.webkitRequestFullscreen(),this.isFullscreen=!0):n.msRequestFullscreen&&(n.msRequestFullscreen(),this.isFullscreen=!0):document.exitFullscreen?document.exitFullscreen().then(()=>{this.isFullscreen=!1}).catch(e=>{console.error(`Error attempting to disable full-screen mode: ${e.message} (${e.name})`)}):document.webkitExitFullscreen?(document.webkitExitFullscreen(),this.isFullscreen=!1):document.msExitFullscreen&&(document.msExitFullscreen(),this.isFullscreen=!1)}},computed:{isFocused(){return document.querySelector('[name="barcode"]')},getGameTime(){return new Date(this.game.kickoff_at).toLocaleStr
3877ing("da-DK",{dateStyle:"short",timeStyle:"short",hour12:!1})}}};var rpe=function(){var e=this,t=e._self._c;return t("admin-layout",[t("div",{staticClass:"bg-white overflow-hidden shadow-lg rounded-sm flex flex-col flex-1 sm:p-6"},[t("div",{staticClass:"flex flex-row space-between px-2"},[t("div",{staticClass:"flex flex-col flex-1"},[t("div",{staticClass:"flex flex-row items-center"},[t("img",{staticClass:"h-8 object-cover aspect-1",attrs:{src:`${e.game.home_team.logo_path}`}}),t("span",{staticClass:"text-xl ml-2 mr-2"},[e._v("-")]),t("img",{staticClass:"h-8 object-cover aspect-1",attrs:{src:`${e.game.away_team.logo_path}`}}),t("div",{staticClass:"flex flex-col ml-2"},[t("p",{staticClass:"text-sm"},[e._v(" "+e._s(e.getGameTime))]),t("p",{staticClass:"text-sm"},[e._v("Scanned: "+e._s(e.currentCount))])])])]),t("div",{staticClass:"flex justify-center items-center"},[e.isFullscreen?t("svg",{staticClass:"size-6 h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},on:{click:e.toggleFullscreen}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"}})]):t("svg",{staticClass:"size-6 h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},on:{click:e.toggleFullscreen}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M2
38770.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"}})])])]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.memberId,expression:"memberId"}],attrs:{id:"barcode-input",type:"text",autofocus:"",name:"barcode",inputmode:"none"},domProps:{value:e.memberId},on:{change:e.scan,input:function(r){r.target.composing||(e.memberId=r.target.value)}}}),!e.member&&!e.warning&&!e.fetching?t("div",{staticClass:"flex flex-1 justify-center items-center"},[t("h3",{staticClass:"text-xl text-center"},[e._v("Klar til scanning")])]):e._e(),!e.member&&!e.warning&&e.fetching?t("div",{staticClass:"flex flex-1 justify-center items-center"},[t("h3",{staticClass:"text-xl text-center"},[t("svg",{staticClass:"size-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}})])])]):e._e(),e.member?t("div",{staticClass:"flex flex-col justify-center"},[t("img",{staticClass:"object-cover aspect-1/1.28 border-[16px] border-green-500",attrs:{src:`${e.member.photo}`}}),t("h3",{staticClass:"text-xl text-center"},[e._v(e._s(e.member.user.firstname)+" "+e._s(e.member.user.lastname))]),t("p",{staticClass:"text-center font-bold"},[e._v(e._s(Math.floor((new Date-new Date(e.member.user.birthday).getTime())/315576e5))+" år")])]):e._e(),e.warning?t("div",{staticClass:"bg-red-300 p-3 mt-3 flex flex-row"},[t("svg",{staticClass:"w-6 h-6 text-red-800",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"}})]),t("p",{staticClass:"text-red-800 text-lg ml-1"},[e._v(e._s(e.warningMessage))])]):e._e()])])},ipe=[],ape=ve(npe,rpe,ipe,!1,null,null);const spe=ape.exports,ope=Object.freeze(Object.defineProperty({__proto__:null,default:spe},Symbol.toStringTag,{value:"Module"})),cpe={};var upe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"w-full sm:max-w-md px-6 py-4 bg-white shadow-md overflow-hidden"},[e._t("default")],2)},lpe=[],dpe=ve(cpe,upe,lpe,!1,null,null);
3877const ld=dpe.exports,fpe={};var hpe=function(){var e=this,t=e._self._c;return t("inertia-link",{attrs:{href:"/"}},[t("img",{staticStyle:{width:"100px"},attrs:{src:"/img/logo.png"}})])},ppe=[],mpe=ve(fpe,hpe,ppe,!1,null,null);const cl=mpe.exports,gpe={computed:{errors(){return this.$page.props.errors},hasErrors(){return Object.keys(this.errors).length>0}}};var vpe=function(){var e=this,t=e._self._c;return e.hasErrors?t("div",[t("div",{staticClass:"font-medium text-red-600"},[e._v(e._s(e.$trans("jetstream.validationErrors.error")))]),t("ul",{staticClass:"mt-3 list-disc list-inside text-sm text-red-600"},e._l(e.errors,function(r,i){return t("div",{key:i},[r=="The email has already been taken."?t("li",[e._v("Brugeren findes allerede. Dette skyldes formentlig, at du har en aktiv billet-profil og dermed ogsÃ¥ en FCK Profil. Du skal blot oprette en adgangskode til din FCK Profil via âglemt din adgangskode?â og dermed aktivere din profil.")]):t("li",[e._v(e._s(r))])])}),0)]):e._e()},ype=[],_pe=ve(gpe,vpe,ype,!1,null,null);const Df=_pe.exports,Qm=[["Afghanistan (â«Ø§ÙØºØ§ÙØ³ØªØ§Ùâ¬â)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (â«Ø§Ùجزائرâ¬â)","dz","213"],["American Samoa","as","1684"],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1264"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54"],["Armenia (ÕÕ¡ÕµÕ¡Õ½Õ¿Õ¡Õ¶)","am","374"],["Aruba","aw","297"],["Australia","au","61",0],["Austria (Ãsterreich)","at","43"],["Azerbaijan (AzÉrbaycan)","az","994"],["Bahamas","bs","1242"],["Bahrain (â«Ø§ÙØ¨ØØ±ÙÙâ¬â)","bh","973"],["Bangladesh (বাà¦à¦²à¦¾à¦¦à§à¦¶)","bd","880"],["Barbados","bb","1246"],["Belarus (ÐелаÑÑÑÑ)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1441"],["Bhutan (འà½à¾²à½´à½)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (ÐоÑна и ХеÑÑеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1284"],["Brunei","bn","673"],["Bulgaria (ÐÑлгаÑиÑ)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (ááááá»áá¶)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1],["Cayman Islands","ky","1345"],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (ä¸å½)","cn","86"],["Christmas Island","cx","61",2],["Cocos (Keeling) Islands","cc","61",1],["Colombia","co","57"],["Comoros (â«Ø¬Ø²Ø± اÙÙÙ
رâ¬â)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d'Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (ÎÏÏÏοÏ)","cy","357"],["Czech Republic (Äeská republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1767"],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (â«Ù
صرâ¬â)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (á¡áá¥áá ááááá)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["G
3877ibraltar","gi","350"],["Greece (Îλλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1473"],["Guadeloupe","gp","590",0],["Guam","gu","1671"],["Guatemala","gt","502"],["Guernsey","gg","44",1],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (馿¸¯)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ãsland)","is","354"],["India (à¤à¤¾à¤°à¤¤)","in","91"],["Indonesia","id","62"],["Iran (â«Ø§ÛراÙâ¬â)","ir","98"],["Iraq (â«Ø§ÙعراÙâ¬â)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2],["Israel (â«×שר××â¬â)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1876"],["Japan (æ¥æ¬)","jp","81"],["Jersey","je","44",3],["Jordan (â«Ø§ÙأردÙâ¬â)","jo","962"],["Kazakhstan (ÐазаÑ
ÑÑан)","kz","7",1],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (â«Ø§ÙÙÙÙØªâ¬â)","kw","965"],["Kyrgyzstan (ÐÑÑгÑзÑÑан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (â«ÙØ¨ÙØ§Ùâ¬â)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (â«ÙÙØ¨Ùاâ¬â)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (æ¾³é)","mo","853"],["Macedonia (FYROM) (ÐакедониÑа)","mk","389"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (â«Ù
ÙØ±ÙتاÙÙØ§â¬â)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Ðонгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1664"],["Morocco (â«Ø§ÙÙ
غربâ¬â)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (áá¼ááºáá¬)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नà¥à¤ªà¤¾à¤²)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (ì¡°ì 민주주ì ì¸ë¯¼ ê³µíêµ)","kp","850"],["Northern Mariana Islands","mp","1670"],["Norway (Norge)","no","47",0],["Oman (â«Ø¹ÙÙ
اÙâ¬â)","om","968"],["Pakistan (â«Ù¾Ø§Ú©Ø³ØªØ§Ùâ¬â)","pk","92"],["Palau","pw","680"],["Palestine (â«ÙÙØ³Ø·ÙÙâ¬â)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (â«Ùطرâ¬â)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (РоÑÑиÑ)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and PrÃncipe (São Tomé e PrÃncipe)","st","239"],["Saudi Arabia (â«Ø§ÙÙ
Ù
ÙÙØ© Ø§ÙØ¹Ø±Ø¨ÙØ© Ø§ÙØ³Ø¹ÙØ¯ÙØ©â¬â)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (СÑбиÑа)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1721"],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (ëí민êµ)","kr","82"],["South Sudan (â«Ø¬ÙÙØ¨ Ø§ÙØ³ÙداÙâ¬â)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (à·à·âර෠ලà¶à¶à·à·)","lk","94"],["Sudan (â«Ø§ÙØ³ÙØ¯Ø§Ùâ¬â)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1],["Swaziland","sz","268"],["Swede
3877n (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (â«Ø³ÙØ±ÙØ§â¬â)","sy","963"],["Taiwan (å°ç£)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (à¹à¸à¸¢)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia (â«ØªÙÙØ³â¬â)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1649"],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1340"],["Uganda","ug","256"],["Ukraine (УкÑаÑна)","ua","380"],["United Arab Emirates (â«Ø§ÙØ¥Ù
ارات Ø§ÙØ¹Ø±Ø¨ÙØ© اÙÙ
ØªØØ¯Ø©â¬â)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (OÊ»zbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1],["Venezuela","ve","58"],["Vietnam (Viá»t Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (â«Ø§ÙØµØØ±Ø§Ø¡ Ø§ÙØºØ±Ø¨ÙØ©â¬â)","eh","212",1],["Yemen (â«Ø§ÙÙÙ
Ùâ¬â)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Ã
land Islands","ax","358",1]];Qm.map(n=>n[1].toUpperCase());Qm.map(n=>({name:n[0],iso2:n[1].toUpperCase(),dialCode:`+${n[2]}`,priority:n[3]||0,areaCodes:n[4]||null}));const bpe={name:"PhoneInput",props:{value:{type:[String,Object],default:""},initNumber:{type:String,default:""},initCountry:{type:String,default:"+45"},ccTrans:{type:String,default:""},numberTrans:{type:String,default:""}},data(){var r;let e={name:"Denmark",iso2:"dk",dialCode:"45"},t="";if(this.value&&typeof this.value=="object"){const i=(r=this.value.countryCallingCode)==null?void 0:r.replace("+",""),a=Qm.find(s=>s[2]===i);a&&(e={name:a[0],iso2:a[1],dialCode:a[2]}),t=this.value.nationalNumber||""}else if(this.initNumber||this.initCountry){const i=Qm.find(a=>`+${a[2]}`===this.initCountry);i&&(e={name:i[0],iso2:i[1],dialCode:i[2]}),t=this.initNumber}return{showCountryList:!1,countrySearch:"",phoneNumber:t,selectedCountry:e,countries:Qm.map(i=>({name:i[0],iso2:i[1],dialCode:i[2]}))}},computed:{filteredCountries(){if(!this.countrySearch)return this.countries;const n=this.countrySearch.toLowerCase();return this.countries.filter(e=>e.name.toLowerCase().includes(n)||e.dialCode.includes(n))}},methods:{toggleCountryList(){this.showCountryList=!this.showCountryList},selectCountry(n){this.selectedCountry=n,this.showCountryList=!1,this.emitValue()},updateValue(){this.emitValue()},emitValue(){const n={countryCallingCode:`+${this.selectedCountry.dialCode}`,nationalNumber:this.phoneNumber.replace(/[^0-9]/g,"")};this.$emit("input",n),this.$emit("change",n)},closeDropdown(n){this.$el.contains(n.target)||(this.showCountryList=!1)},focus(){this.$refs.input.focus()}},watch:{value:{immediate:!0,deep:!0,handler(n){if(n&&typeof n=="object"){if(n.nationalNumber!==void 0&&n.nationalNumber!==this.phoneNumber&&(this.phoneNumber=n.nationalNumber),n.countryCallingCode){const e=n.countryCallingCode.replace("+",""),t=this.countries.find(r=>r.dialCode===e);t&&t.dialCode!==this.selectedCountry.dialCode&&(this.selectedCountry=t)}}else n||(this.phoneNumber="",this.selectedCountry={name:"Denmark",iso2:"dk",dialCode:"45"})}},initNumber:{immediate:!0,handler(n){n!==this.phoneNumber&&(this.phoneNumber=n)}},initCountry:{immediate:!0,handler(n){const e=this.countries.find(t=>`+${t.dialCode}`===n);e&&e.dialCode!==this.selectedCountry.dialCode&&(this.selectedCountry=e)}}},created(){document.addEventListener("click",this.closeDropdown),(this.phoneNumber||this.selectedCountry)&&this.emitValue()},beforeDestroy(){document.removeEventListener("click",this.closeDropdown)}};var xpe=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"flex phone-input-group items-stretch"},[t("div",{staticClass:"relative country-dropdown"},[t("button",{staticClass:"h-full flex items-center px-3 border border-gray-300 border-r-0 rounded-l-md bg-white text-sm focus:outline-none group-focus-within:border-blue-300",attrs:{type:"button"},on:{click:function(r){return r.preventDefault(),r.stopPropagation(),e.toggleCountryList.apply(null,arguments)}}},[t("span",{staticClass:"flex items-center"},[t("img",{staticClass:"mr-2 w-6 h-4",attrs:{src:`https://flagcdn.com/${e.selectedCountry.iso2.toLowerCase()}.svg`,alt:e.selectedCountry.name}}),t("span",{staticClass:"whitespace-nowrap leading-6"},[e._v("+"+e._s(e.selectedCountry.dialCode))])]),t("svg",{staticClass:"w-5 h-5 ml-2",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"}})])]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.showCountryList,expression:"showCountryList"}],staticClass:"absolute z-50 mt-1 w-72 bg-white rounded-md shadow-lg"},[t("div",{staticClass:"p-2 border-b"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.countrySearch,expression:"countrySearch"}],staticClass:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-200 focus:border-blue-300",attrs:{type:"text",placeholder:e.ccTrans||"Search country"},domProps:{value:e.countrySearch},on:{click:function(r){r.stopPropagation()},input:function(r){r.target.composing||(e.countrySearch=r.target.value)}}})]),t("div",{staticClass:"max-h-60 overflow-auto"},e._l(e.filteredCountries,function(r){return t("button",{key:r.iso2,staticClass:"w-full px-4 py-2 text-left hover:bg-gray-100 flex items-center",attrs:{type:"button"},on:{click:function(i){return i.preventDefault(),i.stopPropagation(),e.selectCountry(r)}}},[t("img",{staticClass:"w-5 h-4 mr-3",attrs:{src:`https://flagcdn.com/${r.iso2.toLowerCase()}.svg`,alt:r.name}}),t("span",{staticClass:"flex-1"},[e._v(e._s(r.name))]),t("span",{staticClass:"text-gray-500"},[e._v("+"+e._s(r.dialCode))])])}),0)])]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.phoneNumber,expression:"phoneNumber"}],ref:"input",staticClass:"flex-1 min-h-10 text-sm block w-full h-full border border-gray-300 rounded-r-md focus:outline-none group-focus-within:border-blue-300 py-2 px-3 leading-6",attrs:{type:"tel",placeholder:e.numberTrans||"Phone number"},domProps:{value:e.phoneNumber},on:{input:[function(r){r.target.composing||(e.phoneNumber=r.target.value)},e.updateValue]}})])])},wpe=[],Cpe=ve(bpe,xpe,wpe,!1,null,"95941165");const kpe=Cpe.exports,Spe={name:"jet-phone",props:{value:{type:[String,Object],default:null},initNumber:{type:String,default:""},initCountry:{type:String,default:"+45"},ccTrans:String,numberTrans:String},components:{PhoneInput:kpe},methods:{focus(){this.$refs.input.focus()},change(n){this.$emit("input",n),this.$emit("change",n),this.$emit("update:value",n)}}};var Tpe=function(){var e=this,t=e._self._c;return t("PhoneInput",{ref:"input",attrs:{id:"phone",value:e.value,"init-number":e.initNumber,"init-country":e.initCountry,"cc-trans":e.ccTrans,"number-trans":e.numberTrans},on:{change:e.change,input:e.change}})},Epe=[],Ppe=ve(Spe,Tpe,Epe,!1,null,null);const MT=Ppe.exports,Rpe={components:{JetInput:Rn,JetLabel:Un},props:["password","label"],data(){return{form:{password:""}}},methods:{validationTextStyle(n){return{color:n?"green":"rgb(107,114,128)"}}},computed:{checkEmail(){var n=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return n.test(this.form.email)},checkPasswordMatch(){return this.form.password===this.form.password_confirmation},checkPasswordLetter(){return!!this.form.password.match(/[A-Za-z]/)},checkPasswordNumber(){return!!this.form.password.match(/[0-9]/)},checkPasswordLength(){return this.form.password.length>=8},checkValidPassword(){return this.checkPasswordLetter&&this.checkPasswordNumber&&this.checkPasswordLength}}};var Ape=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mt-4"},[t("jet-label",{attrs:{for:"password",value:this.label||e.$trans("pages.register.password")}}),t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.password,expression:"form.password"}],staticClass:"mt-1 block w-full border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 shadow-sm",attrs:{id:"password",type:"password",required:"",autocomplete:"new-password"},domProps:{value:e.form.password},on:{input:[function(r){r.target.composing||e.$set(e.form,"password",r.target.value)},function(r){return e.$emit("input",r.target.value)}]}}),t("div",{staticClass:"grid grid-cols-3 mt-1"},[t("div",{staticClass:"mt-0.5 text-xs items-center flex flex-row",style:this.validationTextStyle(this.checkPasswordLetter)},[this.checkPasswordLetter?t("svg",{staticClass:"w-5 h-5 mr-0.5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}})]):t("svg",{staticClass:"w-5 h-5 mr-0.5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75
3877a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"}})]),e._v(" "+e._s(e.$trans("pages.register.passwordRequirement1"))+" ")]),t("div",{staticClass:"text-xs items-center flex flex-row",style:this.validationTextStyle(this.checkPasswordNumber)},[this.checkPasswordNumber?t("svg",{staticClass:"w-5 h-5 mr-0.5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}})]):t("svg",{staticClass:"w-5 h-5 mr-0.5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"}})]),e._v(" "+e._s(e.$trans("pages.register.passwordRequirement2"))+" ")]),t("div",{staticClass:"text-xs items-center flex flex-row",style:this.validationTextStyle(this.checkPasswordLength)},[this.checkPasswordLength?t("svg",{staticClass:"w-5 h-5 mr-0.5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}})]):t("svg",{staticClass:"w-5 h-5 mr-0.5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"}})]),e._v(" "+e._s(e.$trans("pages.register.passwordRequirement3"))+" ")])])],1)},Ipe=[],Ope=ve(Rpe,Ape,Ipe,!1,null,null);const Ob=Ope.exports,Mpe={components:{JetInput:Rn,JetLabel:Un},props:["password","label"],data(){return{form:{password_confirmation:""}}},methods:{validationTextStyle(n){return{color:n?"green":"rgb(107,114,128)"}},setPasswordFocus(n){this.passwordFocused=n}},computed:{checkPasswordMatch(){return this.password===this.form.password_confirmation}}};var Dpe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mt-4"},[t("jet-label",{staticClass:"mt-4",attrs:{for:"password_confirmation",value:this.label||e.$trans("pages.register.confirmPassword")}}),t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.password_confirmation,expression:"form.password_confirmation"}],staticClass:"mt-1 block w-full border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 shadow-sm",attrs:{id:"password_confirmation",type:"password",required:"",autocomplete:"new-password"},domProps:{value:e.form.password_confirmation},on:{input:[function(r){r.target.composing||e.$set(e.form,"password_confirmation",r.target.value)},function(r){return e.$emit("input",r.target.value)}]}}),t("div",{staticClass:"mt-1.5 text-xs items-center flex flex-row",style:this.validationTextStyle(this.checkPasswordMatch&&e.form.password_confirmation.length>0)},[this.checkPasswordMatch&&e.form.password_confirmation.length>0?t("svg",{staticClass:"w-5 h-5 mr-0.5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}})]):t("svg",{staticClass:"w-5 h-5 mr-0.5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"}})]),e._v(" "+e._s(e.$trans("pages.register.passwordMatch"))+" ")])],1)},Npe=[],Lpe=ve(Mpe,Dpe,Npe,!1,null,null);const Mb=Lpe.exports,Fpe={props:["seasons"],components:{AdminLayout:Gt,JetInput:Rn,JetLabel:Un,JetButton:mn},data(){return{form:this.$inertia.form({name:"",startdate:"2023-07-01",enddate:"2024-06-30"})}},methods:{submit(){this.form.post(this.route("admin.seasons.store"),{onFinish:()=>this.form.reset("name")}
3877)}}};var $pe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" Opret sæson ")])]},proxy:!0}])},[t("div",{staticClass:"bg-white p-3 rounded-md"},[t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",[t("jet-label",{attrs:{for:"name",value:"Navn"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"name",type:"text",required:"",autofocus:"",autocomplete:"name"},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{attrs:{for:"startdate",value:e.$trans("admin.away.startdate")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"startdate",type:"date",autocomplete:"startdate"},model:{value:e.form.startdate,callback:function(r){e.$set(e.form,"startdate",r)},expression:"form.startdate"}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{attrs:{for:"enddate",value:e.$trans("admin.away.enddate")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"enddate",type:"date",autocomplete:"enddate"},model:{value:e.form.enddate,callback:function(r){e.$set(e.form,"enddate",r)},expression:"form.enddate"}})],1),t("div",{staticClass:"mt-3 flex justify-end"},[t("jet-button",{staticClass:"ml-4",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("admin.away.create-season"))+" ")])],1)])])])},Bpe=[],Upe=ve(Fpe,$pe,Bpe,!1,null,null);const jpe=Upe.exports,qpe=Object.freeze(Object.defineProperty({__proto__:null,default:jpe},Symbol.toStringTag,{value:"Module"})),zpe={props:["seasons"],components:{AdminLayout:Gt,JetNavLink:Zu},data(){return{email:"",data:null,requests:[],request:null,amount:0,qrCode:""}},methods:{}};var Wpe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"flex flex-row justify-between items-center"},[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" Sæsoner ")]),t("jet-nav-link",{staticClass:"cursor-pointer font-bold py-2 px-4 rounded",attrs:{href:e.route("admin.seasons.create")}},[e._v(" Opret sæson ")])],1)]},proxy:!0}])},[t("div",{staticClass:"bg-white p-3 rounded-md"},[t("table",{staticClass:"table-auto w-full border-separate border-spacing-2 border border-grey-500"},[t("thead",[t("tr",[t("th",{staticClass:"text-left"},[e._v("Name")]),t("th",{staticClass:"text-left"},[e._v("Startdate")]),t("th",{staticClass:"text-left"},[e._v("Enddate")])])]),t("tbody",e._l(e.seasons,function(r){return t("tr",[t("td",{staticClass:"p2"},[e._v(e._s(r.name))]),t("td",{staticClass:"p2"},[e._v(e._s(r.start_date))]),t("td",{staticClass:"p2"},[e._v(e._s(r.end_date))])])}),0)])])])},Hpe=[],Vpe=ve(zpe,Wpe,Hpe,!1,null,null);const Gpe=Vpe.exports,Kpe=Object.freeze(Object.defineProperty({__proto__:null,default:Gpe},Symbol.toStringTag,{value:"Module"})),Ype={props:["tournaments"],components:{AdminLayout:Gt,JetInput:Rn,JetLabel:Un,JetButton:mn,JetInputError:ea},data(){return{form:this.$inertia.form({_method:"POST",name:"",shortname:"",stadium:"",country:"",logo:null}),logoPreview:null}},methods:{submit(){this.$refs.logo&&(this.form.logo=this.$refs.logo.files[0]),this.form.post(route("admin.teams.store"),{onFinish:()=>this.form.reset("name")})},selectNewLogo(){this.$refs.logo.click()},updateLogoPreview(){const n=new FileReader;n.onload=e=>{this.logoPreview=e.target.result},n.readAsDataURL(this.$refs.logo.files[0])}}};var Xpe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" Opret hold ")])]},proxy:!0}])},[t("div",{staticClass:"bg-white p-3 rounded-md"},[t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",{},[t("jet-label",{attrs:{for:"name",value:"Navn"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"name",type:"text",required:"",autofocus:"",autocomplete:"name"}
3877,model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{attrs:{for:"shortname",value:"Forkortelse"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"shortname",type:"text",required:"",autofocus:"",autocomplete:"shortname"},model:{value:e.form.shortname,callback:function(r){e.$set(e.form,"shortname",r)},expression:"form.shortname"}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{attrs:{for:"stadium",value:"stadium"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"stadium",type:"text",autofocus:"",autocomplete:"stadium"},model:{value:e.form.stadium,callback:function(r){e.$set(e.form,"stadium",r)},expression:"form.stadium"}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{attrs:{for:"country",value:"country"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"country",type:"text",autofocus:"",autocomplete:"country"},model:{value:e.form.country,callback:function(r){e.$set(e.form,"country",r)},expression:"form.country"}})],1),t("div",[t("input",{ref:"logo",staticClass:"hidden",attrs:{type:"file"},on:{change:e.updateLogoPreview}}),t("jet-label",{attrs:{for:"logo",value:"Logo"}}),t("div",{directives:[{name:"show",rawName:"v-show",value:e.logoPreview,expression:"logoPreview"}],staticClass:"mt-2"},[t("span",{staticClass:"block rounded-full w-20 h-20",style:"background-size: cover; background-repeat: no-repeat; background-position: center center; background-image: url('"+e.logoPreview+"');"})]),t("jet-button",{staticClass:"mt-2 mr-2",attrs:{type:"button"},nativeOn:{click:function(r){return r.preventDefault(),e.selectNewLogo.apply(null,arguments)}}},[e._v(" Vælg et logo ")]),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.logo}})],1),t("div",{staticClass:"mt-3 flex justify-end"},[t("jet-button",{staticClass:"ml-4",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("admin.away.create-team"))+" ")])],1)])])])},Jpe=[],Qpe=ve(Ype,Xpe,Jpe,!1,null,null);const Zpe=Qpe.exports,eme=Object.freeze(Object.defineProperty({__proto__:null,default:Zpe},Symbol.toStringTag,{value:"Module"})),tme={props:["teams"],components:{AdminLayout:Gt,JetNavLink:Zu},data(){return{email:"",data:null,requests:[],request:null,amount:0,qrCode:""}},methods:{}};var nme=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"flex flex-row justify-between items-center"},[t("h2",{staticClass:"capitalize font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("admin.away.teams"))+" ")]),t("jet-nav-link",{staticClass:"cursor-pointer font-bold py-2 px-4 rounded capitalize",attrs:{href:e.route("admin.teams.create")}},[e._v(" "+e._s(e.$trans("admin.away.create-team"))+" ")])],1)]},proxy:!0}])},[t("div",{staticClass:"bg-white p-3 rounded-md"},[t("table",{staticClass:"table-auto w-full border-separate border-spacing-2 border border-grey-500"},[t("thead",[t("tr",[t("th",{staticClass:"capitalize text-left"},[e._v(e._s(e.$trans("admin.away.name")))]),t("th",{staticClass:"capitalize text-left"},[e._v(e._s(e.$trans("admin.away.shortname")))]),t("th",{staticClass:"capitalize text-left"},[e._v(e._s(e.$trans("admin.away.stadium")))]),t("th",{staticClass:"capitalize text-left"},[e._v(e._s(e.$trans("admin.away.country")))]),t("th",{staticClass:"capitalize text-left"},[e._v(e._s(e.$trans("admin.away.logo")))])])]),t("tbody",e._l(e.teams,function(r){return t("tr",[t("td",{staticClass:"p2"},[e._v(e._s(r.name))]),t("td",{staticClass:"p2"},[e._v(e._s(r.short_name))]),t("td",{staticClass:"p2"},[e._v(e._s(r.stadium))]),t("td",{staticClass:"p2"},[e._v(e._s(r.country))]),t("td",{staticClass:"p2"},[t("img",{staticStyle:{height:"60px"},attrs:{src:r.logo_path}})])])}),0)])])])},rme=[],ime=ve(tme,nme,rme,!1,null,null);const ame=ime.exports,sme=Object.freeze(Object.defineProperty({__proto__:null,default:ame},Symbol.toStringTag,{value:"Module"})),ome={props:["tournaments"],components:{AdminLayout:Gt,JetInput:Rn,JetLabel:Un,JetButton:mn},data(){return{form:this.$inertia.form({name:"",type:""})}},methods:{submit(){this.form.post(this.route("admin.tournaments.store"),{onFinish:()=>this.form.reset("name")}
3877)}}};var cme=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" Opret turnering ")])]},proxy:!0}])},[t("div",{staticClass:"bg-white p-3 rounded-md"},[t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",{},[t("jet-label",{attrs:{for:"name",value:"Navn"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"name",type:"text",required:"",autofocus:"",autocomplete:"name"},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}})],1),t("div",{staticClass:"mt-3"},[t("jet-label",{attrs:{for:"type",value:"Type"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"type",type:"text",autofocus:"",autocomplete:"type"},model:{value:e.form.type,callback:function(r){e.$set(e.form,"type",r)},expression:"form.type"}})],1),t("div",{staticClass:"mt-3 flex justify-end"},[t("jet-button",{staticClass:"ml-4",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("admin.away.create-tournament"))+" ")])],1)])])])},ume=[],lme=ve(ome,cme,ume,!1,null,null);const dme=lme.exports,fme=Object.freeze(Object.defineProperty({__proto__:null,default:dme},Symbol.toStringTag,{value:"Module"})),hme={props:["tournaments"],components:{AdminLayout:Gt,JetNavLink:Zu},data(){return{email:"",data:null,requests:[],request:null,amount:0,qrCode:""}},methods:{}};var pme=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"flex flex-row justify-between items-center"},[t("h2",{staticClass:"capitalize font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("admin.away.tournaments"))+" ")]),t("jet-nav-link",{staticClass:"capitalize cursor-pointer font-bold py-2 px-4 rounded",attrs:{href:e.route("admin.tournaments.create")}},[e._v(" "+e._s(e.$trans("admin.away.create-tournament"))+" ")])],1)]},proxy:!0}])},[t("div",{staticClass:"bg-white p-3 rounded-md"},[t("table",{staticClass:"table-auto w-full border-separate border-spacing-2 border border-grey-500"},[t("thead",[t("tr",[t("th",{staticClass:"capitalize text-left"},[e._v(e._s(e.$trans("admin.away.name")))]),t("th",{staticClass:"capitalize text-left"},[e._v("Type")])])]),t("tbody",e._l(e.tournaments,function(r){return t("tr",[t("td",{staticClass:"p2"},[e._v(e._s(r.name))]),t("td",{staticClass:"p2"},[e._v(e._s(r.type))])])}),0)])])])},mme=[],gme=ve(hme,pme,mme,!1,null,null);const vme=gme.exports,yme=Object.freeze(Object.defineProperty({__proto__:null,default:vme},Symbol.toStringTag,{value:"Module"})),_me={components:{AdminLayout:Gt},data(){return{data:null}},methods:{}};var bme=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight my-2 ml-2"},[e._v(" Admin ")])]},proxy:!0}])},[t("div",{staticClass:"bg-white p-3 overflow-hidden shadow-lg rounded-sm h-full"},[t("p",[e._v("Welcome to the admin dashboard, "+e._s(e.$page.props.user.firstname))])])])},xme=[],wme=ve(_me,bme,xme,!1,null,null);const Cme=wme.exports,kme=Object.freeze(Object.defineProperty({__proto__:null,default:Cme},Symbol.toStringTag,{value:"Module"})),Sme={name:"DesignBoard",components:{AdminLayout:Gt}};var Tme=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"uppercase font-semibold text-xl text-gray-800 leading-tight"},[e._v(" Designboard ")])]},proxy:!0}])},[t("div",{staticClass:"flex flex-col w-7xl"},[t("div",{staticClass:"flex flex-col justify-center items-center mb-4 py-8"},[t("h1",[e._v("Welcome to the designboard")]),t("p",{staticClass:"text-lg font-light"},[e._v("Here you can find all information about the UI elements and style used at FCK")])]),t("div",{staticClass:"flex flex-col py-8"},[t("h2",{staticClass:"uppercase mx-auto"},[e._v("Colors")]),t("p",{staticClass:"mx-auto text-lg font-light"},[e._v("Here you can find all information about the colors used at FCK")]
3877),t("div",{staticClass:"grid grid-cols-1 md:grid-cols-2 gap-4 p-4"},[t("div",{staticClass:"bg-fck-black p-8"},[t("p",{staticClass:"text-white text-3xl font-bold"},[e._v("FCK Black"),t("br"),e._v(" fck-black")])]),t("div",{staticClass:"bg-fck-dark-blue p-8"},[t("p",{staticClass:"text-white text-3xl font-bold"},[e._v("FCK Dark Blue"),t("br"),e._v(" fck-dark-blue")])]),t("div",{staticClass:"bg-fck-blue p-8"},[t("p",{staticClass:"text-white text-3xl font-bold"},[e._v("FCK Blue"),t("br"),e._v(" fck-blue")])]),t("div",{staticClass:"bg-fck-women p-8"},[t("p",{staticClass:"text-white text-3xl font-bold"},[e._v("FCK Women"),t("br"),e._v(" fck-women")])]),t("div",{staticClass:"bg-fck-soft-blue p-8"},[t("p",{staticClass:"text-white text-3xl font-bold"},[e._v("FCK Soft Blue"),t("br"),e._v(" fck-soft-blue")])]),t("div",{staticClass:"bg-fck-pale-blue p-8"},[t("p",{staticClass:"text-fck-blue text-3xl font-bold"},[e._v("FCK Pale Blue"),t("br"),e._v(" fck-pale-blue")])]),t("div",{staticClass:"bg-fck-white p-8"},[t("p",{staticClass:"text-black text-3xl font-bold"},[e._v("FCK White"),t("br"),e._v(" fck-white")])]),t("div",{staticClass:"bg-fck-logo-red p-8"},[t("p",{staticClass:"text-white text-3xl font-bold"},[e._v("FCK Logo Red"),t("br"),e._v(" fck-logo-red")])]),t("div",{staticClass:"bg-fck-gold p-8"},[t("p",{staticClass:"text-fck-dark-blue text-3xl font-bold"},[e._v("FCK Gold"),t("br"),e._v(" fck-gold")])])]),t("h2",{staticClass:"uppercase mx-auto mt-16"},[e._v("Color combinations")]),t("h3",{staticClass:"mx-auto mt-16"},[e._v("Men")]),t("div",{staticClass:"grid grid-cols-1 md:grid-cols-3 gap-4 p-4"},[t("div",{staticClass:"flex flex-row justify-between bg-fck-white p-8 shadow-xl"},[t("div",{staticClass:"h-24 w-24 bg-fck-dark-blue"}),t("div",{staticClass:"h-24 w-24 bg-fck-black"}),t("div",{staticClass:"h-24 w-24 bg-fck-blue"}),t("div",{staticClass:"h-24 w-24 bg-fck-gold"})]),t("div",{staticClass:"flex flex-row justify-between bg-fck-blue p-8 shadow-xl"},[t("div",{staticClass:"h-24 w-24 bg-fck-white"}),t("div",{staticClass:"h-24 w-24 bg-fck-dark-blue"}),t("div",{staticClass:"h-24 w-24 bg-fck-black"})]),t("div",{staticClass:"flex flex-row justify-between bg-fck-dark-blue p-8 shadow-xl"},[t("div",{staticClass:"h-24 w-24 bg-fck-white"}),t("div",{staticClass:"h-24 w-24 bg-fck-pale-blue"}),t("div",{staticClass:"h-24 w-24 bg-fck-soft-blue"})]),t("div",{staticClass:"flex flex-row justify-between bg-fck-pale-blue p-8 shadow-xl"},[t("div",{staticClass:"h-24 w-24 bg-fck-blue"}),t("div",{staticClass:"h-24 w-24 bg-fck-dark-blue"}),t("div",{staticClass:"h-24 w-24 bg-fck-black"}),t("div",{staticClass:"h-24 w-24 bg-fck-gold"})]),t("div",{staticClass:"flex flex-row justify-between bg-fck-soft-blue p-8 shadow-xl"},[t("div",{staticClass:"h-24 w-24 bg-fck-white"}),t("div",{staticClass:"h-24 w-24 bg-fck-black"}),t("div",{staticClass:"h-24 w-24 bg-fck-blue"})]),t("div",{staticClass:"flex flex-row justify-between bg-fck-black p-8 shadow-xl"},[t("div",{staticClass:"h-24 w-24 bg-fck-blue"}),t("div",{staticClass:"h-24 w-24 bg-fck-white"}),t("div",{staticClass:"h-24 w-24 bg-fck-soft-blue"}),t("div",{staticClass:"h-24 w-24 bg-fck-gold"})])]),t("h3",{staticClass:"mx-auto mt-16"},[e._v("Women")]),t("div",{staticClass:"grid grid-cols-1 md:grid-cols-3 gap-4 p-4"},[t("div",{staticClass:"flex flex-row justify-between bg-fck-white p-8 shadow-xl"},[t("div",{staticClass:"h-24 w-24 bg-fck-women"}),t("div",{staticClass:"h-24 w-24 bg-fck-black"}),t("div",{staticClass:"h-24 w-24 bg-fck-blue"}),t("div",{staticClass:"h-24 w-24 bg-fck-gold"})]),t("div",{staticClass:"flex flex-row justify-between bg-fck-blue p-8 shadow-xl"},[t("div",{staticClass:"h-24 w-24 bg-fck-white"}),t("div",{staticClass:"h-24 w-24 bg-fck-soft-blue"}),t("div",{staticClass:"h-24 w-24 bg-fck-women"})]),t("div",{staticClass:"flex flex-row justify-between bg-fck-dark-blue p-8 shadow-xl"},[t("div",{staticClass:"h-24 w-24 bg-fck-white"}),t("div",{staticClass:"h-24 w-24 bg-fck-women"}),t("div",{staticClass:"h-24 w-24 bg-fck-soft-blue"})]),t("div",{staticClass:"flex flex-row justify-between bg-fck-soft-blue p-8 shadow-xl"},[t("div",{staticClass:"h-24 w-24 bg-fck-blue"}),t("div",{staticClass:"h-24 w-24 bg-fck-white"}),t("div",{staticClass:"h-24 w-24 bg-fck-black"}),t("div",{staticClass:"h-24 w-24 bg-fck-gold"})]),t("div",{staticClass:"flex flex-row justify-between bg-fck-women p-8 shadow-xl"},[t("div",{staticClass:"h-24 w-24 bg-fck-white"}),t("div",{staticClass:"h-24 w-24 bg-fck-black"}),t("div",{staticClass:"h-24 w-24 bg-fck-soft-blue"})]),t("div",{staticClass:"flex flex-row justify-between bg-fck-black p-8 shadow-xl"},[t("div",{staticClass:"h-24 w-24 bg-fck-women"}),t("div",{staticClass:"h-24 w-24 bg-fck-white"}),t("div",{staticClass:"h-24 w-24 bg-fck-soft-blue"}),t("div",{staticClass:"h-24 w-24 bg-fck-gold"})])])])]),t("div",{staticClass:"flex flex-col"},[t("h2",{staticClass:"uppercase mx-auto mt-16"},[e._v("Typography")]),t("div",{staticClass:"flex flex-col md:flex-row gap-4"},[t("div",{staticClass:"flex-1 bg-white p-6 shadow-xl rounded-lg"},[t("h3",{staticClass:"text-xl font-bold mb-4"},[e._v("Regular Font")]),t("p",{staticClass:"font-regular text-base mb-2"},[e._v("Regular 400: The quick brown fox jumps over the lazy dog.")]),t("p",{staticClass:"font-regular font-medium text-base mb-2"},[e._v("Medium 500: The quick brown fox jumps over the lazy dog.")]),t("p",{staticClass:"font-regular font-semibold text-base mb-2"},[e._v("Semibold 600: The quick brown fox jumps over the lazy dog.")]),t("p",{staticClass:"font-regular font-bold text-base"},[e._v("Bold 700: The quick brown fox jumps over the lazy dog.")])]),t("div",{staticClass:"flex-1 bg-white p-6 shadow-xl rounded-lg"},[t("h3",{staticClass:"text-xl font-bold mb-4"},[e._v("Serif Font")]),t("p",{staticClass:"font-serif text-base mb-2"},[e._v("Regular 400: The quick brown fox jumps over the lazy dog.")]),t("p",{staticClass:"font-serif font-medium text-base mb-2"},[e._v("Medium 500: The quick brown fox jumps over the lazy dog.")]),t("p",{staticClass:"font-serif font-semibold text-base mb-2"},[e._v("Semibold 600: The quick brown fox jumps over the lazy dog.")]),t("p",{staticClass:"font-serif font-bold text-base"},[e._v("Bold 700: The quick brown fox jumps over the lazy dog.")])]),t("div",{staticClass:"flex-1 bg-white p-6 shadow-xl rounded-lg"},[t("h3",{staticClass:"text-xl font-bold mb-4"},[e._v("Bold Font")]),t("p",{staticClass:"font-bold text-base mb-2"},[e._v("Bold 700: The quick brown fox jumps over the lazy dog.")]),t("p",{staticClass:"font-extrabold text-base mb-2"},[e._v("Extra Bold 800: The quick brown fox jumps over the lazy dog.")]),t("p",{staticClass:"font-black text-base"},[e._v("Black 900: The quick brown fox jumps over the lazy dog.")])])]),t("div",{staticClass:"flex flex-col md:flex-row"},[t("div",{staticClass:"flex bg-fck-white p-8 shadow-xl"},[t("p",{staticClass:"text-fck-black text-3xl font-regular"},[e._v("FCK sans G")]),t("p",{staticClass:"text-fck-black text-3xl font-sans font-thin"},[e._v("FCK sans G")])]),t("div",{staticClass:"flex bg-fck-white p-8 shadow-xl"},[t("p",{staticClass:"text-fck-black text-3xl font-serif"},[e._v("FCK serif")])]),t("div",{staticClass:"flex bg-fck-white p-8 shadow-xl"},[t("p",{staticClass:"text-fck-black text-3xl font-regular"},[e._v("FCK text")])])]),t("p",{staticClass:"text-lg font-light"},[e._v("Here you can find all information about the typography used at FCK")]
3877),t("div",{staticClass:"flex flex-row"},[t("div",{staticClass:"border-b my-4 pb-2 bg-white"},[t("p",[e._v("test")])]),t("div",{staticClass:"border-b my-4 pb-2 bg-white"},[t("p",[e._v("test")])]),t("div",{staticClass:"border-b my-4 pb-2 bg-white"},[t("p",[e._v("test")])])]),t("div",{staticClass:"border-b my-4 pb-2"},[t("h3",[e._v("Headings")])]),t("h1",[e._v("Heading 1")]),t("h2",[e._v("Heading 2")]),t("h3",[e._v("Heading 3")]),t("h4",[e._v("Heading 4")]),t("h5",[e._v("Heading 5")]),t("h6",[e._v("Heading 6")]),t("p",{staticClass:"font-light text-xs"},[e._v("font-light text-xs")]),t("p",{staticClass:"font-light text-sm"},[e._v("font-light text-sm")]),t("p",{staticClass:"font-light text-base"},[e._v("font-light text-base")]),t("p",{staticClass:"font-light text-lg"},[e._v("font-light text-lg")]),t("p",{staticClass:"font-light text-xl"},[e._v("font-light text-xl")]),t("p",{staticClass:"font-light text-2xl"},[e._v("font-light text-2xl")]),t("p",{staticClass:"font-light text-3xl"},[e._v("font-light text-3xl")]),t("p",{staticClass:"font-light text-4xl"},[e._v("font-light text-4xl")]),t("p",{staticClass:"font-light text-5xl"},[e._v("font-light text-5xl")]),t("p",{staticClass:"font-light text-6xl"},[e._v("font-light text-6xl")]),t("p",{staticClass:"font-light text-7xl"},[e._v("font-light text-7xl")]),t("p",{staticClass:"font-light text-8xl"},[e._v("font-light text-8xl")]),t("p",{staticClass:"font-light text-9xl"},[e._v("font-light text-9xl")]),t("p",{staticClass:"font-normal text-xs"},[e._v("font-normal text-xs")]),t("p",{staticClass:"font-normal text-sm"},[e._v("font-normal text-sm")]),t("p",{staticClass:"font-normal text-base"},[e._v("font-normal text-base")]),t("p",{staticClass:"font-normal text-lg"},[e._v("font-normal text-lg")]),t("p",{staticClass:"font-normal text-xl"},[e._v("font-normal text-xl")]),t("p",{staticClass:"font-normal text-2xl"},[e._v("font-normal text-2xl")]),t("p",{staticClass:"font-normal text-3xl"},[e._v("font-normal text-3xl")]),t("p",{staticClass:"font-normal text-4xl"},[e._v("font-normal text-4xl")]),t("p",{staticClass:"font-normal text-5xl"},[e._v("font-normal text-5xl")]),t("p",{staticClass:"font-normal text-6xl"},[e._v("font-normal text-6xl")]),t("p",{staticClass:"font-normal text-7xl"},[e._v("font-normal text-7xl")]),t("p",{staticClass:"font-normal text-8xl"},[e._v("font-normal text-8xl")]),t("p",{staticClass:"font-normal text-9xl"},[e._v("font-normal text-9xl")]),t("p",{staticClass:"font-medium text-xs"},[e._v("font-medium text-xs")]),t("p",{staticClass:"font-medium text-sm"},[e._v("font-medium text-sm")]),t("p",{staticClass:"font-medium text-base"},[e._v("font-medium text-base")]),t("p",{staticClass:"font-medium text-lg"},[e._v("font-medium text-lg")]),t("p",{staticClass:"font-medium text-xl"},[e._v("font-medium text-xl")]),t("p",{staticClass:"font-medium text-2xl"},[e._v("font-medium text-2xl")]),t("p",{staticClass:"font-medium text-3xl"},[e._v("font-medium text-3xl")]),t("p",{staticClass:"font-medium text-4xl"},[e._v("font-medium text-4xl")]),t("p",{staticClass:"font-medium text-5xl"},[e._v("font-medium text-5xl")]),t("p",{staticClass:"font-medium text-6xl"},[e._v("font-medium text-6xl")]),t("p",{staticClass:"font-medium text-7xl"},[e._v("font-medium text-7xl")]),t("p",{staticClass:"font-medium text-8xl"},[e._v("font-medium text-8xl")]),t("p",{staticClass:"font-medium text-9xl"},[e._v("font-medium text-9xl")]),t("p",{staticClass:"font-semibold text-xs"},[e._v("font-semibold text-xs")]),t("p",{staticClass:"font-semibold text-sm"},[e._v("font-semibold text-sm")]),t("p",{staticClass:"font-semibold text-base"},[e._v("font-semibold text-base")]),t("p",{staticClass:"font-semibold text-lg"},[e._v("font-semibold text-lg")]),t("p",{staticClass:"font-semibold text-xl"},[e._v("font-semibold text-xl")]),t("p",{staticClass:"font-semibold text-2xl"},[e._v("font-semibold text-2xl")]),t("p",{staticClass:"font-semibold text-3xl"},[e._v("font-semibold text-3xl")]),t("p",{staticClass:"font-semibold text-4xl"},[e._v("font-semibold text-4xl")]),t("p",{staticClass:"font-semibold text-5xl"},[e._v("font-semibold text-5xl")]),t("p",{staticClass:"font-semibold text-6xl"},[e._v("font-semibold text-6xl")]),t("p",{staticClass:"font-semibold text-7xl"},[e._v("font-semibold text-7xl")]),t("p",{staticClass:"font-bold text-xs"},[e._v("font-bold text-xs")]),t("p",{staticClass:"font-bold text-sm"},[e._v("font-bold text-sm")]),t("p",{staticClass:"font-bold text-base"},[e._v("font-bold text-base")]),t("p",{staticClass:"font-bold text-lg"},[e._v("font-bold text-lg")]),t("p",{staticClass:"font-bold text-xl"},[e._v("font-bold text-xl")]),t("p",{staticClass:"font-bold text-2xl"},[e._v("font-bold text-2xl")]),t("p",{staticClass:"font-bold text-3xl"},[e._v("font-bold text-3xl")]),t("p",{staticClass:"font-bold text-4xl"},[e._v("font-bold text-4xl")]),t("p",{staticClass:"font-bold text-5xl"},[e._v("font-bold text-5xl")]),t("p",{staticClass:"font-bold text-6xl"},[e._v("font-bold text-6xl")]),t("p",{staticClass:"font-bold text-7xl"},[e._v("font-bold text-7xl")]),t("p",{staticClass:"font-extrabold text-xs"},[e._v("font-extrabold text-xs")]),t("p",{staticClass:"font-extrabold text-sm"},[e._v("font-extrabold text-sm")]),t("p",{staticClass:"font-extrabold text-base"},[e._v("font-extrabold text-base")]),t("p",{staticClass:"font-extrabold text-lg"},[e._v("font-extrabold text-lg")]),t("p",{staticClass:"font-extrabold text-xl"},[e._v("font-extrabold text-xl")]),t("p",{staticClass:"font-extrabold text-2xl"},[e._v("font-extrabold text-2xl")]),t("p",{staticClass:"font-extrabold text-3xl"},[e._v("font-extrabold text-3xl")]),t("p",{staticClass:"font-extrabold text-4xl"},[e._v("font-extrabold text-4xl")]),t("p",{staticClass:"font-extrabold text-5xl"},[e._v("font-extrabold text-5xl")]),t("p",{staticClass:"font-extrabold text-6xl"},[e._v("font-extrabold text-6xl")]),t("p",{staticClass:"font-extrabold text-7xl"},[e._v("font-extrabold text-7xl")]),t("p",{staticClass:"font-black text-xs"},[e._v("font-black text-xs")]),t("p",{staticClass:"font-black text-sm"},[e._v("font-black text-sm")]),t("p",{staticClass:"font-black text-base"},[e._v("font-black text-base")]),t("p",{staticClass:"font-black text-lg"},[e._v("font-black text-lg")]),t("p",{staticClass:"font-black text-xl"},[e._v("font-black text-xl")]),t("p",{staticClass:"font-black text-2xl"},[e._v("font-black text-2xl")]),t("p",{staticClass:"font-black text-3xl"},[e._v("font-black text-3xl")]),t("p",{staticClass:"font-black text-4xl"},[e._v("font-black text-4xl")]),t("p",{staticClass:"font-black text-5xl"},[e._v("font-black text-5xl")]),t("p",{staticClass:"font-black text-6xl"},[e._v("font-black text-6xl")]),t("p",{staticClass:"font-black text-7xl"},[e._v("font-black text-7xl")]),t("p",{staticClass:"font-black text-8xl"},[e._v("font-black text-8xl")]),t("p",{staticClass:"font-black text-9xl"},[e._v("font-black text-9xl")])])])},Eme=[],Pme=ve(Sme,Tme,Eme,!1,null,null);const Rme=Pme.exports,Ame=Object.freeze(Object.defineProperty({__proto__:null,default:Rme},Symbol.toStringTag,{value:"Module"}));/*! 3878 * qrcode.vue v1.7.0 3879 * A Vue component to generate QRCode. 3880 * © 2017-2019 @scopewu(https://github.com/scopewu) 3881 * MIT License. 3882 */var ls={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8};function OF(n){this.mode=ls.MODE_8BIT_BYTE,this.data=n}OF.prototype={getLength:function(n){return this.data.length},write:function(n){for(var e=0;e<this.data.length;e++)n.put(this.data.charCodeAt(e),8)}};var Ime=OF,Lm={L:1,M:0,Q:3,H:2};function Lc(n,e){this.totalCount=n,this.dataCount=e}Lc.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37
3882],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];Lc.getRSBlocks=function(n,e){var t=Lc.getRsBlockTable(n,e);if(t==null)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+e);for(var r=t.length/3,i=new Array,a=0;a<r;a++)for(var s=t[a*3+0],o=t[a*3+1],c=t[a*3+2],u=0;u<s;u++)i.push(new Lc(o,c));return i};Lc.getRsBlockTable=function(n,e){switch(e){case Lm.L:return Lc.RS_BLOCK_TABLE[(n-1)*4+0];case Lm.M:return Lc.RS_BLOCK_TABLE[(n-1)*4+1];case Lm.Q:return Lc.RS_BLOCK_TABLE[(n-1)*4+2];case Lm.H:return Lc.RS_BLOCK_TABLE[(n-1)*4+3];default:return}};var MF=Lc;function DF(){this.buffer=new Array,this.length=0}DF.prototype={get:function(n){var e=Math.floor(n/8);return(this.buffer[e]>>>7-n%8&1)==1},put:function(n,e){for(var t=0;t<e;t++)this.putBit((n>>>e-t-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(n){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),n&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var NF=DF,zo={glog:function(n){if(n<1)throw new Error("glog("+n+")");return zo.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return zo.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Ri=0;Ri<8;Ri++)zo.EXP_TABLE[Ri]=1<<Ri;for(var Ri=8;Ri<256;Ri++)zo.EXP_TABLE[Ri]=zo.EXP_TABLE[Ri-4]^zo.EXP_TABLE[Ri-5]^zo.EXP_TABLE[Ri-6]^zo.EXP_TABLE[Ri-8];for(var Ri=0;Ri<255;Ri++)zo.LOG_TABLE[zo.EXP_TABLE[Ri]]=Ri;var Cl=zo;function fy(n,e){if(n.length==null)throw new Error(n.length+"/"+e);for(var t=0;t<n.length&&n[t]==0;)t++;this.num=new Array(n.length-t+e);for(var r=0;r<n.length-t;r++)this.num[r]=n[r+t]}fy.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var e=new Array(this.getLength()+n.getLength()-1),t=0;t<this.getLength();t++)for(var r=0;r<n.getLength();r++)e[t+r]^=Cl.gexp(Cl.glog(this.get(t))+Cl.glog(n.get(r)));return new fy(e,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var e=Cl.glog(this.get(0))-Cl.glog(n.get(0)),t=new Array(this.getLength()),r
3882=0;r<this.getLength();r++)t[r]=this.get(r);for(var r=0;r<n.getLength();r++)t[r]^=Cl.gexp(Cl.glog(n.get(r))+e);return new fy(t,0).mod(n)}};var Tk=fy,xl={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},ki={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(n){for(var e=n<<10;ki.getBCHDigit(e)-ki.getBCHDigit(ki.G15)>=0;)e^=ki.G15<<ki.getBCHDigit(e)-ki.getBCHDigit(ki.G15);return(n<<10|e)^ki.G15_MASK},getBCHTypeNumber:function(n){for(var e=n<<12;ki.getBCHDigit(e)-ki.getBCHDigit(ki.G18)>=0;)e^=ki.G18<<ki.getBCHDigit(e)-ki.getBCHDigit(ki.G18);return n<<12|e},getBCHDigit:function(n){for(var e=0;n!=0;)e++,n>>>=1;return e},getPatternPosition:function(n){return ki.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,e,t){switch(n){case xl.PATTERN000:return(e+t)%2==0;case xl.PATTERN001:return e%2==0;case xl.PATTERN010:return t%3==0;case xl.PATTERN011:return(e+t)%3==0;case xl.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2==0;case xl.PATTERN101:return e*t%2+e*t%3==0;case xl.PATTERN110:return(e*t%2+e*t%3)%2==0;case xl.PATTERN111:return(e*t%3+(e+t)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){for(var e=new Tk([1],0),t=0;t<n;t++)e=e.multiply(new Tk([1,Cl.gexp(t)],0));return e},getLengthInBits:function(n,e){if(1<=e&&e<10)switch(n){case ls.MODE_NUMBER:return 10;case ls.MODE_ALPHA_NUM:return 9;case ls.MODE_8BIT_BYTE:return 8;case ls.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(e<27)switch(n){case ls.MODE_NUMBER:return 12;case ls.MODE_ALPHA_NUM:return 11;case ls.MODE_8BIT_BYTE:return 16;case ls.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(e<41)switch(n){case ls.MODE_NUMBER:return 14;case ls.MODE_ALPHA_NUM:return 13;case ls.MODE_8BIT_BYTE:return 16;case ls.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+e)},getLostPoint:function(n){for(var e=n.getModuleCount(),t=0,r=0;r<e;r++)for(var i=0;i<e;i++){for(var a=0,s=n.isDark(r,i),o=-1;o<=1;o++)if(!(r+o<0||e<=r+o))for(var c=-1;c<=1;c++)i+c<0||e<=i+c||o==0&&c==0||s==n.isDark(r+o,i+c)&&a++;a>5&&(t+=3+a-5)}for(var r=0;r<e-1;r++)for(var i=0;i<e-1;i++){var u=0;n.isDark(r,i)&&u++,n.isDark(r+1,i)&&u++,n.isDark(r,i+1)&&u++,n.isDark(r+1,i+1)&&u++,(u==0||u==4)&&(t+=3)}for(var r=0;r<e;r++)for(var i=0;i<e-6;i++)n.isDark(r,i)&&!n.isDark(r,i+1)&&n.isDark(r,i+2)&&n.isDark(r,i+3)&&n.isDark(r,i+4)&&!n.isDark(r,i+5)&&n.isDark(r,i+6)&&(t+=40);for(var i=0;i<e;i++)for(var r=0;r<e-6;r++)n.isDark(r,i)&&!n.isDark(r+1,i)&&n.isDark(r+2,i)&&n.isDark(r+3,i)&&n.isDark(r+4,i)&&!n.isDark(r+5,i)&&n.isDark(r+6,i)&&(t+=40);for(var l=0,i=0;i<e;i++)for(var r=0;r<e;r++)n.isDark(r,i)&&l++;var d=Math.abs(100*l/e/e-50)/5;return t+=d*10,t}},dd=ki;function Uc(n,e){this.typeNumber=n,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var Is=Uc.prototype;Is.addData=function(n){var e=new Ime(n);this.dataList.push(e),this.dataCache=null};Is.isDark=function(n,e){if(n<0||this.moduleCount<=n||e<0||this.moduleCount<=e)throw new Error(n+","+e);return this.modules[n][e]};Is.getModuleCount=function(){return this.moduleCount};Is.make=function(){if(this.typeNumber<1){var n=1;for(n=1;n<40;n++){for(var e=MF.getRSBlocks(n,this.errorCorrectLevel),t=new NF,r=0,i=0;i<e.length;i++)r+=e[i].dataCount;for(var i=0;i<this.dataList.length;i++){var a=this.dataList[i];t.put(a.mode,4),t.put(a.getLength(),dd.getLengthInBits(a.mode,n)),a.write(t)}if(t.getLengthInBits()<=r*8)break}
3882this.typeNumber=n}this.makeImpl(!1,this.getBestMaskPattern())};Is.makeImpl=function(n,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var t=0;t<this.moduleCount;t++){this.modules[t]=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++)this.modules[t][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(n,e),this.typeNumber>=7&&this.setupTypeNumber(n),this.dataCache==null&&(this.dataCache=Uc.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)};Is.setupPositionProbePattern=function(n,e){for(var t=-1;t<=7;t++)if(!(n+t<=-1||this.moduleCount<=n+t))for(var r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(0<=t&&t<=6&&(r==0||r==6)||0<=r&&r<=6&&(t==0||t==6)||2<=t&&t<=4&&2<=r&&r<=4?this.modules[n+t][e+r]=!0:this.modules[n+t][e+r]=!1)};Is.getBestMaskPattern=function(){for(var n=0,e=0,t=0;t<8;t++){this.makeImpl(!0,t);var r=dd.getLostPoint(this);(t==0||n>r)&&(n=r,e=t)}return e};Is.createMovieClip=function(n,e,t){var r=n.createEmptyMovieClip(e,t),i=1;this.make();for(var a=0;a<this.modules.length;a++)for(var s=a*i,o=0;o<this.modules[a].length;o++){var c=o*i,u=this.modules[a][o];u&&(r.beginFill(0,100),r.moveTo(c,s),r.lineTo(c+i,s),r.lineTo(c+i,s+i),r.lineTo(c,s+i),r.endFill())}return r};Is.setupTimingPattern=function(){for(var n=8;n<this.moduleCount-8;n++)this.modules[n][6]==null&&(this.modules[n][6]=n%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)};Is.setupPositionAdjustPattern=function(){for(var n=dd.getPatternPosition(this.typeNumber),e=0;e<n.length;e++)for(var t=0;t<n.length;t++){var r=n[e],i=n[t];if(this.modules[r][i]==null)for(var a=-2;a<=2;a++)for(var s=-2;s<=2;s++)a==-2||a==2||s==-2||s==2||a==0&&s==0?this.modules[r+a][i+s]=!0:this.modules[r+a][i+s]=!1}};Is.setupTypeNumber=function(n){for(var e=dd.getBCHTypeNumber(this.typeNumber),t=0;t<18;t++){var r=!n&&(e>>t&1)==1;this.modules[Math.floor(t/3)][t%3+this.moduleCount-8-3]=r}for(var t=0;t<18;t++){var r=!n&&(e>>t&1)==1;this.modules[t%3+this.moduleCount-8-3][Math.floor(t/3)]=r}};Is.setupTypeInfo=function(n,e){for(var t=this.errorCorrectLevel<<3|e,r=dd.getBCHTypeInfo(t),i=0;i<15;i++){var a=!n&&(r>>i&1)==1;i<6?this.modules[i][8]=a:i<8?this.modules[i+1][8]=a:this.modules[this.moduleCount-15+i][8]=a}for(var i=0;i<15;i++){var a=!n&&(r>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=a:i<9?this.modules[8][15-i-1+1]=a:this.modules[8][15-i-1]=a}this.modules[this.moduleCount-8][8]=!n};Is.mapData=function(n,e){for(var t=-1,r=this.moduleCount-1,i=7,a=0,s=this.moduleCount-1;s>0;s-=2)for(s==6&&s--;;){for(var o=0;o<2;o++)if(this.modules[r][s-o]==null){var c=!1;a<n.length&&(c=(n[a]>>>i&1)==1);var u=dd.getMask(e,r,s-o);u&&(c=!c),this.modules[r][s-o]=c,i--,i==-1&&(a++,i=7)}if(r+=t,r<0||this.moduleCount<=r){r-=t,t=-t;break}}};Uc.PAD0=236;Uc.PAD1=17;Uc.createData=function(n,e,t){for(var r=MF.getRSBlocks(n,e),i=new NF,a=0;a<t.length;a++){var s=t[a];i.put(s.mode,4),i.put(s.getLength(),dd.getLengthInBits(s.mode,n)),s.write(i)}for(var o=0,a=0;a<r.length;a++)o+=r[a].dataCount;if(i.getLengthInBits()>o*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+o*8+")");for(i.getLengthInBits()+4<=o*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=o*8||(i.put(Uc.PAD0,8),i.getLengthInBits()>=o*8));)i.put(Uc.PAD1,8);return Uc.createBytes(i,r)};Uc.createBytes=function(n,e){for(var t=0,r=0,i=0,a=new Array(e.length),s=new Array(e.length),o=0;o<e.length;o++){var c=e[o].dataCount,u=e[o].totalCount-c;r=Math.max(r,c),i=Math.max(i,u),a[o]=new Array(c);for(var l=0;l<a[o].length;l++)a[o][l]=255&n.buffer[l+t];t+=c;var d=dd.getErrorCorrectPolynomial(u),h=new Tk(a[o],d.getLength()-1),p=h.mod(d);s[o]=new Array(d.getLength()-1);for(var l=0;l<s[o].length;l++){var g=l+p.getLength()-s[o].length;s[o][l]=g>=0?p.get(g):0}}for(var v=0,l=0;l<e.length;l++)v+=e[l].totalCount;for(var y=new Array(v),b=0,l=0;l<r;l++)for(var o=0;o<e.length;o++)l<a[o].length&&(y[b++]=a[o][l]);for(var l=0;l<i;l++)for(var o=0;o<e.length;o++)l<s[o].length&&(y[b++]=s[o][l]);return y};var Ome=Uc;function Mme(n){for(var e="",t=0;t<n.length;t++){var r=n.charCodeAt(t);r<128?e+=String.fromCharCode(r):r<2048?(e+=String.fromCharCode(192|r>>6),e+=String.fromCharCode(128|r&63)):r<55296||r>=57344?(e+=String.fromCharCode(224|r>>12),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|r&63)):(t++,r=65536+((r&1023)<<10|n.charCo
3882deAt(t)&1023),e+=String.fromCharCode(240|r>>18),e+=String.fromCharCode(128|r>>12&63),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|r&63))}return e}function Dme(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=[];return n.forEach(function(r,i){var a=null;r.forEach(function(s,o){if(!s&&a!==null){t.push("M".concat(a+e," ").concat(i+e,"h").concat(o-a,"v1H").concat(a+e,"z")),a=null;return}if(o===r.length-1){if(!s)return;a===null?t.push("M".concat(o+e,",").concat(i+e," h1v1H").concat(o+e,"z")):t.push("M".concat(a+e,",").concat(i+e," h").concat(o+1-a,"v1H").concat(a+e,"z"));return}s&&a===null&&(a=o)})}),t.join("")}var DT={props:{value:{type:String,required:!0,default:""},className:{type:String,default:""},size:{type:[Number,String],default:100,validator:function(e){return isNaN(Number(e))!==!0}},level:{type:String,default:"L",validator:function(e){return["L","Q","M","H"].indexOf(e)>-1}},background:{type:String,default:"#fff"},foreground:{type:String,default:"#000"},renderAs:{type:String,required:!1,default:"canvas",validator:function(e){return["canvas","svg"].indexOf(e)>-1}}},data:function(){return{numCells:0,fgPath:""}},updated:function(){this.render()},mounted:function(){this.render()},methods:{render:function(){var e=this.value,t=this.size,r=this.level,i=this.background,a=this.foreground,s=this.renderAs,o=t>>>0,c=new Ome(-1,Lm[r]);c.addData(Mme(e)),c.make();var u=c.modules,l=o/u.length,d=o/u.length,h=window.devicePixelRatio||1;if(s==="svg")this.numCells=u.length,this.fgPath=Dme(u);else{var p=this.$refs["qrcode-vue"],g=p.getContext("2d");p.height=p.width=o*h,g.scale(h,h),u.forEach(function(v,y){v.forEach(function(b,x){g.fillStyle=b?a:i;var S=Math.ceil((x+1)*l)-Math.floor(x*l),w=Math.ceil((y+1)*d)-Math.floor(y*d);g.fillRect(Math.round(x*l),Math.round(y*d),S,w)})})}}},render:function(e){var t=this.className,r=this.value,i=this.level,a=this.background,s=this.foreground,o=this.size,c=this.renderAs,u=this.numCells,l=this.fgPath;return e("div",{class:this.class||t,attrs:{value:r,level:i,background:a,foreground:s}},[c==="svg"?e("svg",{attrs:{height:o,width:o,shapeRendering:"crispEdges",viewBox:"0 0 ".concat(u," ").concat(u)},style:{width:o+"px",height:o+"px"}},[e("path",{attrs:{fill:a,d:"M0,0 h".concat(u,"v").concat(u,"H0z")}}),e("path",{attrs:{fill:s,d:l}})]):e("canvas",{attrs:{height:o,width:o},style:{width:o+"px",height:o+"px"},ref:"qrcode-vue"},[])])}};const Nme={props:[],components:{AdminLayout:Gt,QrcodeVue:DT},data(){return{email:"",data:null,requests:[],request:null,amount:0,qrCode:""}},methods:{lookupEcash(){const n=axios.CancelToken.source();return this.request={cancel:n.cancel,msg:"Loading..."},axios.get(`ecash-lookup/search/${this.email}`,{cancelToken:n.token}).then(e=>{this.data=e.data,this.qrCode=e.data.code,this.amount=e.data.amount,this.fetching=!1}).catch(this.logResponseErrors)},send(){this.request&&this.cancel(),this.lookupEcash()},cancel(){this.request.cancel(),this.clearOldRequest("Cancelled")},logResponseErrors(n){axios.isCancel(n)},clearOldRequest(n){this.request.msg=n,this.requests.push(this.request),this.request=null}}};var Lme=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" Admin - eCash Lookup ")])]},proxy:!0}])},[t("div",{staticClass:"bg-white p-3 overflow-hidden shadow-xl sm:rounded-lg"},[t("label",{staticClass:"block font-medium text-sm text-gray-700 mb-5",attrs:{for:"email"}},[e._v(" Indtast email "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.email,expression:"email"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",attrs:{id:"email",type:"text"},domProps:{value:e.email},on:{input:[function(r){r.target.composing||(e.email=r.target.value)},e.send]}})]),t("div",{staticClass:"text-center"},[t("p",[e._v("Kunden har")]),t("h1",{staticClass:"mt-2 mb-2"},[e._v(e._s(parseFloat(e.amount).toFixed(2).replace(".",","))+" kr")]),t("p",{staticClass:"mb-5"},[e._v("i eCash")]),t("br"),t("qrcode-vue",{staticClass:"qrCode",attrs:{value:e.qrCode,level:"H"}}),t("p",{staticClass:"mt-2 text-sm"},[e._v("(PÃ¥ Shopify POS vælg betaling med gavekort og scan QR koden)")])],1)])])},Fme=[],$me=ve(Nme,Lme,Fme,!1,null,null);const Bme=$me.exports,Ume=Object.freeze(Object.defineProperty({__proto__:null,default:Bme},Symbol.toStringTag,{value:"Module"})),jme={components:{AdminLayout:Gt},props:{runs:{type:Array,default:()=>[]},membershipProducts:{type:Array,default:()=>[]},packageProducts:{type:Array,default:()=>[]},grantingProductIds:{type:Array,default:()=>[]},unrecognisedProducts:{type:Array,default:()=>[]},newestEntitlements:{type:Array,default:()=>[]},activeRows:{type:Number,default:0},isFresh:{type:Boolean,default:!1},maxAgeMinutes:{type:Number,default:180},closedWorld:{type:Boolean,default:!1}},data(){return{submitting:!1,expanded:null,form:{memberships:this.membershipProducts.map(n=>n.id),packages:this.packageProducts.map(n=>n.id),force:!1}}},computed:{flash(){return this.$page.props.flash},selectedCount(){return this.form.memberships.length+this.form.packages.length},lastCompletedAt(){const n=this.runs.find(e=>e.status==="completed");return n?this.formatDate(n.finished_at):"aldrig"}},methods:{granting(n){return this.grantingProductIds.includes(n)},toggle(n){this.expanded=this.expanded===n?null:n},productLabel(n){const e=Number(String(n).split(":").pop()),t=[...this.membershipProducts,...this.packageProducts].find(r=>r.id===e);return t?t.name:""},formatDate(n){return n?Le(n).format("D-M-YYYY HH:mm"):"â"},totalHolders(n){return n.counts?Object.values(n.counts).reduce((e,t)=>
3882e+Number(t),0).toLocaleString("da-DK"):"â"},sourceLabel(n){return{event:"mp-server",rebuild:"genopbygning",refresh:"manuelt opslag"}[n]||n},statusClass(n){return{completed:"bg-green-600",running:"bg-blue-600",aborted:"bg-amber-600",failed:"bg-red-600","dry-run":"bg-gray-500"}[n]||"bg-gray-500"},selectAll(){this.form.memberships=this.membershipProducts.map(n=>n.id),this.form.packages=this.packageProducts.map(n=>n.id)},selectNone(){this.form.memberships=[],this.form.packages=[]},selectFckPlus(){this.form.memberships=[1032],this.form.packages=[]},submitRebuild(){this.submitting=!0,this.$inertia.post(this.route("admin.entitlements.rebuild"),this.form,{preserveScroll:!0,onFinish:()=>{this.submitting=!1}})},syncPartners(){this.submitting=!0,this.$inertia.post(this.route("admin.entitlements.sync-partners"),{},{preserveScroll:!0,onFinish:()=>{this.submitting=!1}})}}};var qme=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v("Abonnementer")])]},proxy:!0}])},[t("div",{staticClass:"py-6 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 space-y-6"},[e.flash?t("p",{staticClass:"px-4 py-3 rounded border",class:e.flash.type==="error"?"bg-red-50 border-red-300 text-red-700":"bg-green-50 border-green-300 text-green-700"},[e._v(" "+e._s(e.flash.message)+" ")]):e._e(),t("div",{staticClass:"bg-white shadow-sm rounded-sm p-4 flex flex-wrap gap-6 items-center"},[t("div",[t("span",{staticClass:"block text-xs uppercase tracking-wide text-gray-500"},[e._v("Status")]),t("span",{staticClass:"inline-block mt-1 py-1 px-2 rounded text-white text-sm",class:e.isFresh?"bg-green-600":"bg-red-600"},[e._v(e._s(e.isFresh?"Frisk":"Forældet"))])]),t("div",[t("span",{staticClass:"block text-xs uppercase tracking-wide text-gray-500"},[e._v("Aktive rettigheder")]),t("span",{staticClass:"block mt-1 text-lg font-bold"},[e._v(e._s(e.activeRows.toLocaleString("da-DK")))])]),t("div",[t("span",{staticClass:"block text-xs uppercase tracking-wide text-gray-500"},[e._v("Seneste kørsel")]),t("span",{staticClass:"block mt-1 text-lg"},[e._v(e._s(e.lastCompletedAt))])]),t("div",[t("span",{staticClass:"block text-xs uppercase tracking-wide text-gray-500"},[e._v("Opslag mod Roboticket")]),t("span",{staticClass:"block mt-1 text-lg"},[e._v(e._s(e.closedWorld?"SlÃ¥et fra":"Aktivt"))])]),t("p",{staticClass:"text-sm text-gray-500 basis-full m-0"},[e._v(" Sættet regnes for forældet efter "+e._s(e.maxAgeMinutes)+" minutter. Bliver det forældet, slÃ¥r adgangskontrollen tilbage til at spørge Roboticket for hver bruger â langsomt, men korrekt. ")])]),e.unrecognisedProducts.length?t("div",{staticClass:"bg-amber-50 border border-amber-300 rounded-sm p-4"},[t("h3",{staticClass:"font-bold text-lg mb-1 text-amber-900"},[e._v("Ukendte produkter")]),t("p",{staticClass:"text-sm text-amber-800 mb-3"},[e._v(" Disse produkter er købt af rigtige brugere, men giver ingen adgang og stÃ¥r ikke pÃ¥ listen over produkter vi har taget stilling til. Er det en ny produktlinje, skal den have en beslutning â se "),t("code",[e._v("services.entitlements")]),e._v(" i CLAUDE.md. ")]),t("ul",{staticClass:"text-sm space-y-1"},e._l(e.unrecognisedProducts,function(r){return t("li",{key:r.product},[t("span",{staticClass:"font-mono"},[e._v(e._s(r.product))]),r.name?t("span",[e._v(" â "+e._s(r.name))]):e._e(),t("span",{staticClass:"text-amber-700"},[e._v(" · "+e._s(r.holders)+" indehaver(e)")])])}),0)]):e._e(),t("div",{staticClass:"bg-white shadow-sm rounded-sm p-4"},[t("h3",{staticClass:"font-bold text-lg mb-1"},[e._v("Genopbyg sættet")]),t("p",{staticClass:"text-sm text-gray-500 mb-4"},[e._v(" Henter alle indehavere af de valgte produkter fra Roboticket. Kører i baggrunden â det tager typisk et par minutter. Vælg færre produkter for en hurtigere kørsel. ")]),t("form",{on:{submit:function(r){return r.preventDefault(),e.submitRebuild.apply(null,arguments)}}},[t("div",{staticClass:"grid md:grid-cols-2 gap-6"},[t("fieldset",[t("legend",{staticClass:"font-bold text-sm mb-2"},[e._v("Medlemskaber")]),e._l(e.membershipProducts,function(r){return t("label",{key:r.id,staticClass:"flex items-start gap-2 py-1"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.memberships,expression:"form.memberships"}],staticClass:"mt-1",attrs:{type:"checkbox"}
3882,domProps:{value:r.id,checked:Array.isArray(e.form.memberships)?e._i(e.form.memberships,r.id)>-1:e.form.memberships},on:{change:function(i){var a=e.form.memberships,s=i.target,o=!!s.checked;if(Array.isArray(a)){var c=r.id,u=e._i(a,c);s.checked?u<0&&e.$set(e.form,"memberships",a.concat([c])):u>-1&&e.$set(e.form,"memberships",a.slice(0,u).concat(a.slice(u+1)))}else e.$set(e.form,"memberships",o)}}}),t("span",{staticClass:"text-sm"},[e._v(" "+e._s(r.name)+" "),t("span",{staticClass:"text-gray-400"},[e._v("("+e._s(r.id)+")")]),e.granting(r.id)?e._e():t("span",{staticClass:"text-amber-600"},[e._v(" · giver ikke adgang")])])])})],2),t("fieldset",[t("legend",{staticClass:"font-bold text-sm mb-2"},[e._v("Sæsonkort")]),e._l(e.packageProducts,function(r){return t("label",{key:r.id,staticClass:"flex items-start gap-2 py-1"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.packages,expression:"form.packages"}],staticClass:"mt-1",attrs:{type:"checkbox"},domProps:{value:r.id,checked:Array.isArray(e.form.packages)?e._i(e.form.packages,r.id)>-1:e.form.packages},on:{change:function(i){var a=e.form.packages,s=i.target,o=!!s.checked;if(Array.isArray(a)){var c=r.id,u=e._i(a,c);s.checked?u<0&&e.$set(e.form,"packages",a.concat([c])):u>-1&&e.$set(e.form,"packages",a.slice(0,u).concat(a.slice(u+1)))}else e.$set(e.form,"packages",o)}}}),t("span",{staticClass:"text-sm"},[e._v(" "+e._s(r.name)+" "),t("span",{staticClass:"text-gray-400"},[e._v("("+e._s(r.id)+")")]),e.granting(r.id)?e._e():t("span",{staticClass:"text-amber-600"},[e._v(" · giver ikke adgang")])])])})],2)]),t("div",{staticClass:"mt-4 flex flex-wrap gap-3 items-center"},[t("button",{staticClass:"text-sm text-fck-blue underline",attrs:{type:"button"},on:{click:e.selectAll}},[e._v("Vælg alle")]),t("button",{staticClass:"text-sm text-fck-blue underline",attrs:{type:"button"},on:{click:e.selectNone}},[e._v("Ryd")]),t("button",{staticClass:"text-sm text-fck-blue underline",attrs:{type:"button"},on:{click:e.selectFckPlus}},[e._v("Kun FCK+")])]),t("label",{staticClass:"flex items-start gap-2 mt-4 text-sm"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.force,expression:"form.force"}],staticClass:"mt-1",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.form.force)?e._i(e.form.force,null)>-1:e.form.force},on:{change:function(r){var i=e.form.force,a=r.target,s=!!a.checked;if(Array.isArray(i)){var o=null,c=e._i(i,o);a.checked?c<0&&e.$set(e.form,"force",i.concat([o])):c>-1&&e.$set(e.form,"force",i.slice(0,c).concat(i.slice(c+1)))}else e.$set(e.form,"force",s)}}}),t("span",[e._v(" Ignorér fald-spærren "),t("span",{staticClass:"text-gray-500"},[e._v(" â kun hvis du ved, at antallet af indehavere reelt er faldet kraftigt. Ellers beskytter spærren mod at fjerne adgang for betalende brugere. ")])])]),t("button",{staticClass:"mt-4 bg-fck-blue text-white text-sm py-2 px-4 rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-blue-900 transition",attrs:{type:"submit",disabled:e.submitting||e.selectedCount===0}},[e._v(" "+e._s(e.submitting?"Sætter i køâ¦":`Genopbyg ${e.selectedCount} produkt(er)`)+" ")])])]),t("div",{staticClass:"bg-white shadow-sm rounded-sm p-4"},[t("h3",{staticClass:"font-bold text-lg mb-1"},[e._v("Partnere")]),t("p",{staticClass:"text-sm text-gray-500 mb-4"},[e._v(" Henter partnerlisten fra Airtable og opløser den til adgang pr. bruger. Kører automatisk hver nat kl. 03:30. Partneradgang ligger uden om Roboticket, sÃ¥ den pÃ¥virkes ikke af genopbygningen ovenfor. ")]),t("button",{staticClass:"bg-gray-800 text-white text-sm py-2 px-4 rounded disabled:opacity-50 hover:bg-black transition",attrs:{type:"button",disabled:e.submitting},on:{click:e.syncPartners}},[e._v(" Synkronisér partnere nu ")])]),t("div",{staticClass:"bg-white shadow-sm rounded-sm overflow-hidden"},[t("h3",{staticClass:"font-bold text-lg p-4 pb-1"},[e._v("Nyeste rettigheder")]),t("p",{staticClass:"text-sm text-gray-500 px-4 pb-3"},[e._v(" De 25 senest oprettede rettigheder. Kilden viser hvad der skrev dem: "),t("span",{staticClass:"font-mono"},[e._v("mp-server")]),e._v(" betyder at hændelsen kom med det samme, "),t("span",{staticClass:"font-mono"},[e._v("genopbygning")]),e._v(" at den blev fanget af timekørslen. Ophør vises ikke her â se âFjernetâ i kørslerne nedenfor. ")]),t("div",{staticClass:"overflow-x-auto"},[t("table",{staticClass:"min-w-full divide-y divide-gray-200"},[t("thead",{staticClass:"bg-gray-50"},[t("tr",[t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Oprettet")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"}
3882,[e._v("Produkt")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Navn")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Giver adgang")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Kilde")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Bruger")])])]),t("tbody",{staticClass:"divide-y divide-gray-100"},[e._l(e.newestEntitlements,function(r){return t("tr",{key:r.product+":"+r.roboticket_user_id},[t("td",{staticClass:"px-4 py-2 text-sm whitespace-nowrap"},[e._v(e._s(e.formatDate(r.created_at)))]),t("td",{staticClass:"px-4 py-2 text-sm font-mono whitespace-nowrap"},[e._v(e._s(r.product))]),t("td",{staticClass:"px-4 py-2 text-sm"},[e._v(e._s(r.product_name||"â"))]),t("td",{staticClass:"px-4 py-2 text-sm"},[r.grants?t("span",{staticClass:"text-green-700"},[e._v("ja")]):t("span",{staticClass:"text-gray-500"},[e._v("nej")])]),t("td",{staticClass:"px-4 py-2 text-sm"},[e._v(e._s(e.sourceLabel(r.source)))]),t("td",{staticClass:"px-4 py-2 text-sm whitespace-nowrap"},[r.user_id?t("inertia-link",{staticClass:"text-fck-blue underline",attrs:{href:e.route("admin.users.show",r.user_id)}},[e._v(e._s(r.roboticket_user_id))]):t("span",{staticClass:"text-gray-400",attrs:{title:"Ingen FCK Profil-konto"}},[e._v(" "+e._s(r.roboticket_user_id)+" ")])],1)])}),e.newestEntitlements.length?e._e():t("tr",[t("td",{staticClass:"px-4 py-6 text-sm text-gray-500 text-center",attrs:{colspan:"6"}},[e._v(" Ingen rettigheder registreret endnu. ")])])],2)])])]),t("div",{staticClass:"bg-white shadow-sm rounded-sm overflow-hidden"},[t("h3",{staticClass:"font-bold text-lg p-4 pb-2"},[e._v("Seneste kørsler")]),t("div",{staticClass:"overflow-x-auto"},[t("table",{staticClass:"min-w-full divide-y divide-gray-200"},[t("thead",{staticClass:"bg-gray-50"},[t("tr",[t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("#")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Status")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Startet")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Produkter")]),t("th",{staticClass:"px-4 py-2 text-right text-xs font-medium text-gray-500 uppercase"},[e._v("Indehavere")]),t("th",{staticClass:"px-4 py-2 text-right text-xs font-medium text-gray-500 uppercase"},[e._v("Skrevet")]),t("th",{staticClass:"px-4 py-2 text-right text-xs font-medium text-gray-500 uppercase"},[e._v("Fjernet")]),t("th",{staticClass:"px-4 py-2 text-right text-xs font-medium text-gray-500 uppercase"},[e._v("Uden profil")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Note")])])]),t("tbody",{staticClass:"divide-y divide-gray-100"},[e._l(e.runs,function(r){return[t("tr",{key:r.id,staticClass:"cursor-pointer hover:bg-gray-50",on:{click:function(i){return e.toggle(r.id)}}},[t("td",{staticClass:"px-4 py-2 text-sm"},[e._v(e._s(r.id))]),t("td",{staticClass:"px-4 py-2 text-sm"},[t("span",{staticClass:"py-1 px-2 rounded text-white text-xs",class:e.statusClass(r.status)},[e._v(" "+e._s(r.status)+" ")])]),t("td",{staticClass:"px-4 py-2 text-sm whitespace-nowrap"},[e._v(e._s(e.formatDate(r.started_at)))]),t("td",{staticClass:"px-4 py-2 text-sm whitespace-nowrap"},[e._v(" "+e._s((r.product_ids||[]).length)+" produkter "),t("span",{staticClass:"text-gray-400"},[e._v(e._s(e.expanded===r.id?"â¾":"â¸"))])]),t("td",{staticClass:"px-4 py-2 text-sm text-right"},[e._v(e._s(e.totalHolders(r)))]),t("td",{staticClass:"px-4 py-2 text-sm text-right"},[e._v(e._s(r.rows_written))]),t("td",{staticClass:"px-4 py-2 text-sm text-right"},[e._v(e._s(r.rows_deactivated))]),t("td",{staticClass:"px-4 py-2 text-sm text-right"},[e._v(e._s(r.rows_unmatched))]),t("td",{staticClass:"px-4 py-2 text-sm text-gray-500"},[e._v(e._s(r.reason))])]),e.expanded===r.id?t("tr",{key:r.id+"-detail",staticClass:"bg-gray-50"},[t("td",{staticClass:"px-4 py-3",attrs:{colspan:"9"}},[t("table",{staticClass:"text-sm"},[e._l(r.counts||{},function(i,a){return t("tr",{key:a},[t("td",{staticClass:"pr-6 py-1 font-mono"},[e._v(e._s(a))]),t("td",{staticClass:"pr-6 py-1"},[e._v(e._s(e.productLabel(a)))]),t("td",{staticClass:"py-1 text-right tabular-nums"}
3882,[e._v(e._s(Number(i).toLocaleString("da-DK")))])])}),r.counts?e._e():t("tr",{staticClass:"text-gray-500"},[t("td",{staticClass:"py-1",attrs:{colspan:"3"}},[e._v("Ingen optælling â kørslen nÃ¥ede ikke sÃ¥ langt.")])])],2)])]):e._e()]}),e.runs.length?e._e():t("tr",[t("td",{staticClass:"px-4 py-6 text-sm text-gray-500 text-center",attrs:{colspan:"9"}},[e._v(" Ingen kørsler endnu. ")])])],2)])])])])])},zme=[],Wme=ve(jme,qme,zme,!1,null,null);const Hme=Wme.exports,Vme=Object.freeze(Object.defineProperty({__proto__:null,default:Hme},Symbol.toStringTag,{value:"Module"})),Gme={components:{AdminLayout:Gt},props:{products:Array,exports:Array,defaultStatuses:Array,lifetimeHours:Number},data(){return{submitting:!1,form:{products:[],statuses:[...this.defaultStatuses]},statusOptions:[{value:"Active",label:"Aktive",hint:"løbende abonnementer"},{value:"On Hold",label:"Sat i bero",hint:"midlertidigt pauserede"},{value:"Cancelled",label:"Annullerede",hint:"fylder typisk 3-4 gange sÃ¥ meget som resten tilsammen"}]}},computed:{flash(){return this.$page.props.flash},groupedProducts(){return this.products.reduce((n,e)=>((n[e.group]=n[e.group]||[]).push(e),n),{})}},methods:{selectAll(){this.form.products=this.products.map(n=>n.id)},selectNone(){this.form.products=[]},formatDate(n){return n?Le(n).format("D-M-YYYY HH:mm"):"â"},formatNumber(n){return Number(n||0).toLocaleString("da-DK")},formatSize(n){if(!n)return"";const e=n/(1024*1024);return e>=1?`${e.toFixed(1)} MB`:`${Math.round(n/1024)} KB`},matchShare(n){return n.row_count?`(${Math.round(n.profile_match_count/n.row_count*100)}%)`:""},summariseProducts(n){return!n||n.length===0?"â":n.length<=2?n.join(", "):`${n[0]} + ${n.length-1} andre`},statusLabel(n){return n.status==="completed"&&!n.downloadable?"Udløbet":{queued:"I kø",running:"Kører",completed:"Klar",expired:"Udløbet",failed:"Fejlet"}[n.status]||n.status},statusClass(n){return n.status==="completed"&&!n.downloadable?"bg-gray-500":{queued:"bg-gray-500",running:"bg-blue-600",completed:"bg-green-600",expired:"bg-gray-500",failed:"bg-red-600"}[n.status]||"bg-gray-500"},submit(){this.submitting=!0,this.$inertia.post(this.route("admin.subscription-exports.store"),this.form,{preserveScroll:!0,onFinish:()=>{this.submitting=!1}})}}};var Kme=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v("Abonnements-eksport")])]},proxy:!0}])},[t("div",{staticClass:"py-6 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 space-y-6"},[e.flash?t("p",{staticClass:"px-4 py-3 rounded border",class:e.flash.type==="error"?"bg-red-50 border-red-300 text-red-700":"bg-green-50 border-green-300 text-green-700"},[e._v(" "+e._s(e.flash.message)+" ")]):e._e(),t("div",{staticClass:"bg-amber-50 border border-amber-300 rounded-sm p-4"},[t("h3",{staticClass:"font-bold text-lg mb-1 text-amber-900"},[e._v("Filen indeholder persondata")]),t("p",{staticClass:"text-sm text-amber-800 m-0"},[e._v(" Eksporten indeholder navne og e-mailadresser pÃ¥ abonnenter. Linket udløber efter "+e._s(e.lifetimeHours)+" timer, og filen slettes automatisk bagefter. BÃ¥de oprettelse og download bliver logget i aktivitetsloggen. Del ikke filen videre, og gem den ikke længere end nødvendigt. ")])]),t("div",{staticClass:"bg-white shadow-sm rounded-sm p-4"},[t("h3",{staticClass:"font-bold text-lg mb-1"},[e._v("Ny eksport")]),t("p",{staticClass:"text-sm text-gray-500 mb-4"},[e._v(" Henter alle indehavere af de valgte produkter fra Roboticket og kobler dem til FCK Profiler. Kører i baggrunden â du fÃ¥r en mail med et link, nÃ¥r filen er klar. ")
3882]),t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",{staticClass:"grid md:grid-cols-2 lg:grid-cols-3 gap-6"},e._l(e.groupedProducts,function(r,i){return t("fieldset",{key:i},[t("legend",{staticClass:"font-bold text-sm mb-2"},[e._v(e._s(i))]),e._l(r,function(a){return t("label",{key:a.id,staticClass:"flex items-start gap-2 py-1"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.products,expression:"form.products"}],staticClass:"mt-1",attrs:{type:"checkbox"},domProps:{value:a.id,checked:Array.isArray(e.form.products)?e._i(e.form.products,a.id)>-1:e.form.products},on:{change:function(s){var o=e.form.products,c=s.target,u=!!c.checked;if(Array.isArray(o)){var l=a.id,d=e._i(o,l);c.checked?d<0&&e.$set(e.form,"products",o.concat([l])):d>-1&&e.$set(e.form,"products",o.slice(0,d).concat(o.slice(d+1)))}else e.$set(e.form,"products",u)}}}),t("span",{staticClass:"text-sm"},[e._v(" "+e._s(a.name)+" "),t("span",{staticClass:"text-gray-400"},[e._v("("+e._s(a.id)+")")])])])})],2)}),0),t("div",{staticClass:"mt-4 flex flex-wrap gap-3 items-center"},[t("button",{staticClass:"text-sm text-fck-blue underline",attrs:{type:"button"},on:{click:e.selectAll}},[e._v("Vælg alle")]),t("button",{staticClass:"text-sm text-fck-blue underline",attrs:{type:"button"},on:{click:e.selectNone}},[e._v("Ryd")])]),t("fieldset",{staticClass:"mt-6"},[t("legend",{staticClass:"font-bold text-sm mb-2"},[e._v("Status")]),e._l(e.statusOptions,function(r){return t("label",{key:r.value,staticClass:"flex items-start gap-2 py-1"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.statuses,expression:"form.statuses"}],staticClass:"mt-1",attrs:{type:"checkbox"},domProps:{value:r.value,checked:Array.isArray(e.form.statuses)?e._i(e.form.statuses,r.value)>-1:e.form.statuses},on:{change:function(i){var a=e.form.statuses,s=i.target,o=!!s.checked;if(Array.isArray(a)){var c=r.value,u=e._i(a,c);s.checked?u<0&&e.$set(e.form,"statuses",a.concat([c])):u>-1&&e.$set(e.form,"statuses",a.slice(0,u).concat(a.slice(u+1)))}else e.$set(e.form,"statuses",o)}}}),t("span",{staticClass:"text-sm"},[e._v(" "+e._s(r.label)+" "),t("span",{staticClass:"text-gray-500"},[e._v(" â "+e._s(r.hint))])])])})],2),t("button",{staticClass:"mt-6 bg-fck-blue text-white text-sm py-2 px-4 rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-blue-900 transition",attrs:{type:"submit",disabled:e.submitting||e.form.products.length===0||e.form.statuses.length===0}},[e._v(" "+e._s(e.submitting?"Sætter i køâ¦":`Eksportér ${e.form.products.length} produkt(er)`)+" ")])])]),t("div",{staticClass:"bg-white shadow-sm rounded-sm overflow-hidden"},[t("h3",{staticClass:"font-bold text-lg p-4 pb-1"},[e._v("Tidligere eksporter")]),t("p",{staticClass:"text-sm text-gray-500 px-4 pb-3"},[e._v(" De 25 seneste. Rækkerne bliver stÃ¥ende efter filen er slettet â det er dokumentationen for hvem der har trukket hvad. ")]),t("div",{staticClass:"overflow-x-auto"},[t("table",{staticClass:"min-w-full divide-y divide-gray-200"},[t("thead",{staticClass:"bg-gray-50"},[t("tr",[t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Status")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Produkter")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Rækker")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Med profil")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Bestilt af")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Færdig")]),t("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[e._v("Udløber")]),t("th",{staticClass:"px-4 py-2"})])]),t("tbody",{staticClass:"divide-y divide-gray-100"},[e._l(e.exports,function(r){return t("tr",{key:r.id},[t("td",{staticClass:"px-4 py-2 whitespace-nowrap"},[t("span",{staticClass:"inline-block py-1 px-2 rounded text-white text-xs",class:e.statusClass(r)},[e._v(e._s(e.statusLabel(r)))]),r.failure_reason?t("p",{staticClass:"text-xs text-red-600 mt-1 mb-0 max-w-xs"}
3882,[e._v(" "+e._s(r.failure_reason)+" ")]):e._e()]),t("td",{staticClass:"px-4 py-2 text-sm"},[t("span",{attrs:{title:r.product_names.join(", ")}},[e._v(" "+e._s(e.summariseProducts(r.product_names))+" ")]),t("span",{staticClass:"block text-xs text-gray-400"},[e._v(e._s((r.statuses||[]).join(", ")))])]),t("td",{staticClass:"px-4 py-2 text-sm whitespace-nowrap"},[e._v(e._s(e.formatNumber(r.row_count)))]),t("td",{staticClass:"px-4 py-2 text-sm whitespace-nowrap"},[e._v(" "+e._s(e.formatNumber(r.profile_match_count))+" "),t("span",{staticClass:"text-gray-400"},[e._v(e._s(e.matchShare(r)))])]),t("td",{staticClass:"px-4 py-2 text-sm"},[e._v(e._s(r.requester||"â"))]),t("td",{staticClass:"px-4 py-2 text-sm whitespace-nowrap"},[e._v(e._s(e.formatDate(r.finished_at)))]),t("td",{staticClass:"px-4 py-2 text-sm whitespace-nowrap"},[e._v(e._s(e.formatDate(r.expires_at)))]),t("td",{staticClass:"px-4 py-2 text-right whitespace-nowrap"},[r.download_url?t("a",{staticClass:"text-sm text-fck-blue underline whitespace-nowrap",attrs:{href:r.download_url}},[e._v(" Hent CSV "),r.file_size?t("span",{staticClass:"text-gray-400"},[e._v("("+e._s(e.formatSize(r.file_size))+")")]):e._e()]):r.downloadable?t("span",{staticClass:"text-xs text-gray-500"},[e._v(" Link sendt til "+e._s(r.requester||"bestilleren")+" ")]):t("span",{staticClass:"text-xs text-gray-400"},[e._v("â")])])])}),e.exports.length===0?t("tr",[t("td",{staticClass:"px-4 py-6 text-sm text-gray-500 text-center",attrs:{colspan:"8"}},[e._v(" Ingen eksporter endnu. ")])]):e._e()],2)])])])])])},Yme=[],Xme=ve(Gme,Kme,Yme,!1,null,null);const Jme=Xme.exports,Qme=Object.freeze(Object.defineProperty({__proto__:null,default:Jme},Symbol.toStringTag,{value:"Module"})),Zme={props:[],components:{AdminLayout:Gt,QrcodeVue:DT},data(){return{email:"",data:null,requests:[],request:null,amount:0,qrCode:""}},methods:{lookupEcash(){const n=axios.CancelToken.source();return this.request={cancel:n.cancel,msg:"Loading..."},axios.get(`ecash-lookup/search/${this.email}`,{cancelToken:n.token}).then(e=>{this.data=e.data,this.qrCode=e.data.code,this.amount=e.data.amount,this.fetching=!1}).catch(this.logResponseErrors)},send(){this.request&&this.cancel(),this.lookupEcash()},cancel(){this.request.cancel(),this.clearOldRequest("Cancelled")},logResponseErrors(n){axios.isCancel(n)},clearOldRequest(n){this.request.msg=n,this.requests.push(this.request),this.request=null}}};var ege=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" Admin ")])]},proxy:!0}])},[t("div",{staticClass:"bg-white p-3 rounded-md"},[t("div",{staticClass:"grid grid-cols-1 md:grid-cols-2"},[t("div",{staticClass:"flex flex-col"},[t("h3",{staticClass:"text-md"},[e._v("Kampe")]),t("div",{staticClass:"flex flex-row mt-3"},[t("svg",{staticClass:"w-6 h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 6v.75m0 3v.75m0 3v.75m0 3V18m-9-5.25h5.25M7.5 15h3M3.375 5.25c-.621 0-1.125.504-1.125 1.125v3.026a2.999 2.999 0 010 5.198v3.026c0 .621.504 1.125 1.125 1.125h17.25c.621 0 1.125-.504 1.125-1.125v-3.026a2.999 2.999 0 010-5.198V6.375c0-.621-.504-1.125-1.125-1.125H3.375z"}})]),t("inertia-link",{staticClass:"ml-1",attrs:{href:e.route("admin.matches.index")}},[e._v("Kampe")])],1),t("div",{staticClass:"flex flex-row mt-3"},[t("svg",{staticClass:"w-6 h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z"}})]),t("inertia-link",{staticClass:"ml-1",attrs:{href:e.route("admin.teams.index")}},[e._v("Hold")])],1),t("div",{staticClass:"flex flex-row mt-3"},[t("svg",{staticClass:"w-6 h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 18.75h-9m9 0a3 3 0 013 3h-15a3 3 0 013-3m9 0v
3882-3.375c0-.621-.503-1.125-1.125-1.125h-.871M7.5 18.75v-3.375c0-.621.504-1.125 1.125-1.125h.872m5.007 0H9.497m5.007 0a7.454 7.454 0 01-.982-3.172M9.497 14.25a7.454 7.454 0 00.981-3.172M5.25 4.236c-.982.143-1.954.317-2.916.52A6.003 6.003 0 007.73 9.728M5.25 4.236V4.5c0 2.108.966 3.99 2.48 5.228M5.25 4.236V2.721C7.456 2.41 9.71 2.25 12 2.25c2.291 0 4.545.16 6.75.47v1.516M7.73 9.728a6.726 6.726 0 002.748 1.35m8.272-6.842V4.5c0 2.108-.966 3.99-2.48 5.228m2.48-5.492a46.32 46.32 0 012.916.52 6.003 6.003 0 01-5.395 4.972m0 0a6.726 6.726 0 01-2.749 1.35m0 0a6.772 6.772 0 01-3.044 0"}})]),t("inertia-link",{staticClass:"ml-1",attrs:{href:e.route("admin.tournaments.index")}},[e._v("Turneringer")])],1),t("div",{staticClass:"flex flex-row mt-3"},[t("svg",{staticClass:"w-6 h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5m-9-6h.008v.008H12v-.008zM12 15h.008v.008H12V15zm0 2.25h.008v.008H12v-.008zM9.75 15h.008v.008H9.75V15zm0 2.25h.008v.008H9.75v-.008zM7.5 15h.008v.008H7.5V15zm0 2.25h.008v.008H7.5v-.008zm6.75-4.5h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V15zm0 2.25h.008v.008h-.008v-.008zm2.25-4.5h.008v.008H16.5v-.008zm0 2.25h.008v.008H16.5V15z"}})]),t("inertia-link",{staticClass:"ml-1",attrs:{href:e.route("admin.seasons.index")}},[e._v("Sæsoner")])],1)])])])])},tge=[],nge=ve(Zme,ege,tge,!1,null,null);const rge=nge.exports,ige=Object.freeze(Object.defineProperty({__proto__:null,default:rge},Symbol.toStringTag,{value:"Module"}));function Zm(n){"@babel/helpers - typeof";return Zm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zm(n)}function bi(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function age(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function xi(n,e,t){return e&&age(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function Ig(){return Ig=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ig.apply(this,arguments)}function Ga(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Ek(n,e)}function C_(n){return C_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},C_(n)}function Ek(n,e){return Ek=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Ek(n,e)}function sge(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function oge(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function cge(n,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oge(n)}function Ka(n){var e=sge();return function(){var r=C_(n),i;if(e){var a=C_(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return cge(this,i)}}var NT=function(){function n(){bi(this,n)}return xi(n,[{key:"listenForWhisper",value:function(t,r){return this.listen(".client-"+t,r)}},{key:"notification",value:function(t){return this.listen(".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated",t)}},{key:"stopListeningForWhisper",value:function(t,r){return this.stopListening(".client-"+t,r)}}]),n}(),LF=function(){function n(e){bi(this,n),this.namespace=e}return xi(n,[{key:"format",value:function(t){return[".","\\"].includes(t.charAt(0))?t.substring(1):(this.namespace&&(t=this.namespace+"."+t),t.replace(/\./g,"\\"))}},{key:"setNamespace",value:function(t){this.namespace=t}}]),n}();function uge(n){try{new n}catch(e){if(e.message.includes("is not a constructor"))return!1}return!0}var LT=function(n){Ga(t,n);var e=Ka(t);function t(r,i,a){var s;return bi(this,t),s=e.call(this),s.name=i,s.pusher=r,s.options=a,s.eventFormatter=new LF(s.options.namespace),s.subscribe(),s}return xi(t,[{key:"subscribe",value:function(){this.subscription=this.pusher.subscribe(this.name)}},{key:"unsubscribe",value:function(){this.pusher.unsubscribe(this.name)}},{key:"listen",value:function(i,a){return this.on(this.eventFormatter.format(i),a),this}},{key:"listenToAll",value:function(i){var a=this;return this.subscription.bind_global(function(s,o){if(!s.startsWith("pusher:")){var c=a.options.namespace.replace(/\./g,"\\"),u=s.startsWith(c)?s.substring(c.length+1):"."+s;
3882i(u,o)}}),this}},{key:"stopListening",value:function(i,a){return a?this.subscription.unbind(this.eventFormatter.format(i),a):this.subscription.unbind(this.eventFormatter.format(i)),this}},{key:"stopListeningToAll",value:function(i){return i?this.subscription.unbind_global(i):this.subscription.unbind_global(),this}},{key:"subscribed",value:function(i){return this.on("pusher:subscription_succeeded",function(){i()}),this}},{key:"error",value:function(i){return this.on("pusher:subscription_error",function(a){i(a)}),this}},{key:"on",value:function(i,a){return this.subscription.bind(i,a),this}}]),t}(NT),FF=function(n){Ga(t,n);var e=Ka(t);function t(){return bi(this,t),e.apply(this,arguments)}return xi(t,[{key:"whisper",value:function(i,a){return this.pusher.channels.channels[this.name].trigger("client-".concat(i),a),this}}]),t}(LT),lge=function(n){Ga(t,n);var e=Ka(t);function t(){return bi(this,t),e.apply(this,arguments)}return xi(t,[{key:"whisper",value:function(i,a){return this.pusher.channels.channels[this.name].trigger("client-".concat(i),a),this}}]),t}(LT),dge=function(n){Ga(t,n);var e=Ka(t);function t(){return bi(this,t),e.apply(this,arguments)}return xi(t,[{key:"here",value:function(i){return this.on("pusher:subscription_succeeded",function(a){i(Object.keys(a.members).map(function(s){return a.members[s]}))}),this}},{key:"joining",value:function(i){return this.on("pusher:member_added",function(a){i(a.info)}),this}},{key:"whisper",value:function(i,a){return this.pusher.channels.channels[this.name].trigger("client-".concat(i),a),this}},{key:"leaving",value:function(i){return this.on("pusher:member_removed",function(a){i(a.info)}),this}}]),t}(FF),$F=function(n){Ga(t,n);var e=Ka(t);function t(r,i,a){var s;return bi(this,t),s=e.call(this),s.events={},s.listeners={},s.name=i,s.socket=r,s.options=a,s.eventFormatter=new LF(s.options.namespace),s.subscribe(),s}return xi(t,[{key:"subscribe",value:function(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"unsubscribe",value:function(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"listen",value:function(i,a){return this.on(this.eventFormatter.format(i),a),this}},{key:"stopListening",value:function(i,a){return this.unbindEvent(this.eventFormatter.format(i),a),this}},{key:"subscribed",value:function(i){return this.on("connect",function(a){i(a)}),this}},{key:"error",value:function(i){return this}},{key:"on",value:function(i,a){var s=this;return this.listeners[i]=this.listeners[i]||[],this.events[i]||(this.events[i]=function(o,c){s.name===o&&s.listeners[i]&&s.listeners[i].forEac
3882h(function(u){return u(c)})},this.socket.on(i,this.events[i])),this.listeners[i].push(a),this}},{key:"unbind",value:function(){var i=this;Object.keys(this.events).forEach(function(a){i.unbindEvent(a)})}},{key:"unbindEvent",value:function(i,a){this.listeners[i]=this.listeners[i]||[],a&&(this.listeners[i]=this.listeners[i].filter(function(s){return s!==a})),(!a||this.listeners[i].length===0)&&(this.events[i]&&(this.socket.removeListener(i,this.events[i]),delete this.events[i]),delete this.listeners[i])}}]),t}(NT),BF=function(n){Ga(t,n);var e=Ka(t);function t(){return bi(this,t),e.apply(this,arguments)}return xi(t,[{key:"whisper",value:function(i,a){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(i),data:a}),this}}]),t}($F),fge=function(n){Ga(t,n);var e=Ka(t);function t(){return bi(this,t),e.apply(this,arguments)}return xi(t,[{key:"here",value:function(i){return this.on("presence:subscribed",function(a){i(a.map(function(s){return s.user_info}))}),this}},{key:"joining",value:function(i){return this.on("presence:joining",function(a){return i(a.user_info)}),this}},{key:"whisper",value:function(i,a){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(i),data:a}),this}},{key:"leaving",value:function(i){return this.on("presence:leaving",function(a){return i(a.user_info)}),this}}]),t}(BF),k_=function(n){Ga(t,n);var e=Ka(t);function t(){return bi(this,t),e.apply(this,arguments)}return xi(t,[{key:"subscribe",value:function(){}},{key:"unsubscribe",value:function(){}},{key:"listen",value:function(i,a){return this}},{key:"listenToAll",value:function(i){return this}},{key:"stopListening",value:function(i,a){return this}},{key:"subscribed",value:function(i){return this}},{key:"error",value:function(i){return this}},{key:"on",value:function(i,a){return this}}]),t}(NT),UF=function(n){Ga(t,n);var e=Ka(t);function t(){return bi(this,t),e.apply(this,arguments)}return xi(t,[{key:"whisper",value:function(i,a){return this}}]),t}(k_),hge=function(n){Ga(t,n);var e=Ka(t);function t(){return bi(this,t),e.apply(this,arguments)}return xi(t,[{key:"whisper",value:function(i,a){return this}}]),t}(k_),pge=function(n){Ga(t,n);var e=Ka(t);function t(){return bi(this,t),e.apply(this,arguments)}return xi(t,[{key:"here",value:function(i){return this}},{key:"joining",value:function(i){return this}},{key:"whisper",value:function(i,a){return this}},{key:"leaving",value:function(i){return this}}]),t}(UF),FT=function(){function n(e){bi(this,n),this._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},broadcaster:"pusher",csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"},this.setOptions(e),this.connect()}return xi(n,[{key:"setOptions",value:function(t){this.options=Ig(this._defaultOptions,t);var r=this.csrfToken();return r&&(this.options.auth.headers["X-CSRF-TOKEN"]=r,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=r),r=this.options.bearerToken,r&&(this.options.auth.headers.Authorization="Bearer "+r,this.options.userAuthentication.headers.Authorization="Bearer "+r),t}},{key:"csrfToken",value:function(){var t;return typeof window<"u"&&window.Laravel&&window.Laravel.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"&&(t=document.querySelector('meta[name="csrf-token"]'))?t.getAttribute("content"):null}}]),n}(),dI=function(n){Ga(t,n);var e=Ka(t);function t(){var r;return bi(this,t),r=e.apply(this,arguments),r.channels={},r}
3882return xi(t,[{key:"connect",value:function(){typeof this.options.client<"u"?this.pusher=this.options.client:this.options.Pusher?this.pusher=new this.options.Pusher(this.options.key,this.options):this.pusher=new Pusher(this.options.key,this.options)}},{key:"signin",value:function(){this.pusher.signin()}},{key:"listen",value:function(i,a,s){return this.channel(i).listen(a,s)}},{key:"channel",value:function(i){return this.channels[i]||(this.channels[i]=new LT(this.pusher,i,this.options)),this.channels[i]}},{key:"privateChannel",value:function(i){return this.channels["private-"+i]||(this.channels["private-"+i]=new FF(this.pusher,"private-"+i,this.options)),this.channels["private-"+i]}},{key:"encryptedPrivateChannel",value:function(i){return this.channels["private-encrypted-"+i]||(this.channels["private-encrypted-"+i]=new lge(this.pusher,"private-encrypted-"+i,this.options)),this.channels["private-encrypted-"+i]}},{key:"presenceChannel",value:function(i){return this.channels["presence-"+i]||(this.channels["presence-"+i]=new dge(this.pusher,"presence-"+i,this.options)),this.channels["presence-"+i]}},{key:"leave",value:function(i){var a=this,s=[i,"private-"+i,"private-encrypted-"+i,"presence-"+i];s.forEach(function(o,c){a.leaveChannel(o)})}},{key:"leaveChannel",value:function(i){this.channels[i]&&(this.channels[i].unsubscribe(),delete this.channels[i])}},{key:"socketId",value:function(){return this.pusher.connection.socket_id}},{key:"disconnect",value:function(){this.pusher.disconnect()}}]),t}(FT),fI=function(n){Ga(t,n);var e=Ka(t);function t(){var r;return bi(this,t),r=e.apply(this,arguments),r.channels={},r}
3882return xi(t,[{key:"connect",value:function(){var i=this,a=this.getSocketIO();return this.socket=a(this.options.host,this.options),this.socket.on("reconnect",function(){Object.values(i.channels).forEach(function(s){s.subscribe()})}),this.socket}},{key:"getSocketIO",value:function(){if(typeof this.options.client<"u")return this.options.client;if(typeof io<"u")return io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}},{key:"listen",value:function(i,a,s){return this.channel(i).listen(a,s)}},{key:"channel",value:function(i){return this.channels[i]||(this.channels[i]=new $F(this.socket,i,this.options)),this.channels[i]}},{key:"privateChannel",value:function(i){return this.channels["private-"+i]||(this.channels["private-"+i]=new BF(this.socket,"private-"+i,this.options)),this.channels["private-"+i]}},{key:"presenceChannel",value:function(i){return this.channels["presence-"+i]||(this.channels["presence-"+i]=new fge(this.socket,"presence-"+i,this.options)),this.channels["presence-"+i]}},{key:"leave",value:function(i){var a=this,s=[i,"private-"+i,"presence-"+i];s.forEach(function(o){a.leaveChannel(o)})}},{key:"leaveChannel",value:function(i){this.channels[i]&&(this.channels[i].unsubscribe(),delete this.channels[i])}},{key:"socketId",value:function(){return this.socket.id}},{key:"disconnect",value:function(){this.socket.disconnect()}}]),t}(FT),mge=function(n){Ga(t,n);var e=Ka(t);function t(){var r;return bi(this,t),r=e.apply(this,arguments),r.channels={},r}
3882return xi(t,[{key:"connect",value:function(){}},{key:"listen",value:function(i,a,s){return new k_}},{key:"channel",value:function(i){return new k_}},{key:"privateChannel",value:function(i){return new UF}},{key:"encryptedPrivateChannel",value:function(i){return new hge}},{key:"presenceChannel",value:function(i){return new pge}},{key:"leave",value:function(i){}},{key:"leaveChannel",value:function(i){}},{key:"socketId",value:function(){return"fake-socket-id"}},{key:"disconnect",value:function(){}}]),t}(FT),gge=function(){function n(e){bi(this,n),this.options=e,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}return xi(n,[{key:"channel",value:function(t){return this.connector.channel(t)}},{key:"connect",value:function(){if(this.options.broadcaster=="reverb")this.connector=new dI(Ig(Ig({},this.options),{cluster:""}));else if(this.options.broadcaster=="pusher")this.connector=new dI(this.options);else if(this.options.broadcaster=="socket.io")this.connector=new fI(this.options);else if(this.options.broadcaster=="null")this.connector=new mge(this.options);else if(typeof this.options.broadcaster=="function"&&uge(this.options.broadcaster))this.connector=new this.options.broadcaster(this.options);else throw new Error("Broadcaster ".concat(Zm(this.options.broadcaster)," ").concat(this.options.broadcaster," is not supported."))}},{key:"disconnect",value:function(){this.connector.disconnect()}},{key:"join",value:function(t){return this.connector.presenceChannel(t)}},{key:"leave",value:function(t){this.connector.leave(t)}},{key:"leaveChannel",value:function(t){this.connector.leaveChannel(t)}},{key:"leaveAllChannels",value:function(){for(var t in this.connector.channels)this.leaveChannel(t)}},{key:"listen",value:function(t,r,i){return this.connector.listen(t,r,i)}},{key:"private",value:function(t){return this.connector.privateChannel(t)}},{key:"encryptedPrivate",value:function(t){if(this.connector instanceof fI)throw new Error("Broadcaster ".concat(Zm(this.options.broadcaster)," ").concat(this.options.broadcaster," does not support encrypted private channels."));return this.connector.encryptedPrivateChannel(t)}},{key:"socketId",value:function(){return this.connector.socketId()}},{key:"registerInterceptors",value:function(){typeof Vue=="function"&&Vue.http&&this.registerVueRequestInterceptor(),typeof axios=="function"&&this.registerAxiosRequestInterceptor(),typeof jQuery=="function"&&this.registerjQueryAjaxSetup(),(typeof Turbo>"u"?"undefined":Zm(Turbo))==="object"&&this.registerTurboRequestInterceptor()}},{key:"registerVueRequestInterceptor",value:function(){var t=this;Vue.http.interceptors.push(function(r,i){t.socketId()&&r.headers.set("X-Socket-ID",t.socketId()),i()})}},{key:"registerAxiosRequestInterceptor",value:function(){var t=this;axios.interceptors.request.use(function(r){return t.socketId()&&(r.headers["X-Socket-Id"]=t.socketId()),r})}},{key:"registerjQueryAjaxSetup",value:function(){var t=this;typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter(function(r,i,a){t.socketId()&&a.setRequestHeader("X-Socket-Id",t.socketId())})}},{key:"registerTurboRequestInterceptor",value:function(){var t=this;document.addEventListener("turbo:before-fetch-request",function(r){r.detail.fetchOptions.headers["X-Socket-Id"]=t.socketId()})}}]),n}(),jF={exports:{}};/*! 3883 * Pusher JavaScript Library v8.4.0 3884 * https://pusher.com/ 3885 * 3886 * Copyright 2020, Pusher 3887 * Released under the MIT licence. 3888 */(function(n,e){(function(r,i){n.exports=i()})(window,function(){return function(t){var r={};function i(a){if(r[a])return r[a].exports;var s=r[a]={i:a,l:!1,exports:{}};return t[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=r,i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:o})},i.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},i.t=function(a,s){if(s&1&&(a=i(a)),s&8||s&4&&typeof a=="object"&&a&&a.__esModule)return a;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:a}),s&2&&typeof a!="string")for(var c in a)i.d(o,c,(function(u){return a[u]}).bind(null,c));return o},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=2)}([function(t,r,i){var a=this&&this.__extends||function(){var v=function(y,b){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])},v(y,b)};return function(y,b){v(y,b);function x(){this.constructor=y}
3888y.prototype=b===null?Object.create(b):(x.prototype=b.prototype,new x)}}();Object.defineProperty(r,"__esModule",{value:!0});var s=256,o=function(){function v(y){y===void 0&&(y="="),this._paddingCharacter=y}return v.prototype.encodedLength=function(y){return this._paddingCharacter?(y+2)/3*4|0:(y*8+5)/6|0},v.prototype.encode=function(y){for(var b="",x=0;x<y.length-2;x+=3){var S=y[x]<<16|y[x+1]<<8|y[x+2];b+=this._encodeByte(S>>>3*6&63),b+=this._encodeByte(S>>>2*6&63),b+=this._encodeByte(S>>>1*6&63),b+=this._encodeByte(S>>>0*6&63)}var w=y.length-x;if(w>0){var S=y[x]<<16|(w===2?y[x+1]<<8:0);b+=this._encodeByte(S>>>3*6&63),b+=this._encodeByte(S>>>2*6&63),w===2?b+=this._encodeByte(S>>>1*6&63):b+=this._paddingCharacter||"",b+=this._paddingCharacter||""}return b},v.prototype.maxDecodedLength=function(y){return this._paddingCharacter?y/4*3|0:(y*6+7)/8|0},v.prototype.decodedLength=function(y){return this.maxDecodedLength(y.length-this._getPaddingLength(y))},v.prototype.decode=function(y){if(y.length===0)return new Uint8Array(0);for(var b=this._getPaddingLength(y),x=y.length-b,S=new Uint8Array(this.maxDecodedLength(x)),w=0,k=0,E=0,I=0,P=0,A=0,N=0;k<x-4;k+=4)I=this._decodeChar(y.charCodeAt(k+0)),P=this._decodeChar(y.charCodeAt(k+1)),A=this._decodeChar(y.charCodeAt(k+2)),N=this._decodeChar(y.charCodeAt(k+3)),S[w++]=I<<2|P>>>4,S[w++]=P<<4|A>>>2,S[w++]=A<<6|N,E|=I&s,E|=P&s,E|=A&s,E|=N&s;if(k<x-1&&(I=this._decodeChar(y.charCodeAt(k)),P=this._decodeChar(y.charCodeAt(k+1)),S[w++]=I<<2|P>>>4,E|=I&s,E|=P&s),k<x-2&&(A=this._decodeChar(y.charCodeAt(k+2)),S[w++]=P<<4|A>>>2,E|=A&s),k<x-3&&(N=this._decodeChar(y.charCodeAt(k+3)),S[w++]=A<<6|N,E|=N&s),E!==0)throw new Error("Base64Coder: incorrect characters for decoding");return S},v.prototype._encodeByte=function(y){var b=y;return b+=65,b+=25-y>>>8&6,b+=51-y>>>8&-75,b+=61-y>>>8&-15,b+=62-y>>>8&3,String.fromCharCode(b)},v.prototype._decodeChar=function(y){var b=s;return b+=(42-y&y-44)>>>8&-s+y-43+62,b+=(46-y&y-48)>>>8&-s+y-47+63,b+=(47-y&y-58)>>>8&-s+y-48+52,b+=(64-y&y-91)>>>8&-s+y-65+0,b+=(96-y&y-123)>>>8&-s+y-97+26,b},v.prototype._getPaddingLength=function(y){var b=0;if(this._paddingCharacter){for(var x=y.length-1;x>=0&&y[x]===this._paddingCharacter;x--)b++;if(y.length<4||b>2)throw new Error("Base64Coder: incorrect padding")}return b},v}();r.Coder=o;var c=new o;function u(v){return c.encode(v)}r.encode=u;function l(v){return c.decode(v)}r.decode=l;var d=function(v){a(y,v);function y(){return v!==null&&v.apply(this,arguments)||this}return y.prototype._encodeByte=function(b){var x=b;return x+=65,x+=25-b>>>8&6,x+=51-b>>>8&-75,x+=61-b>>>8&-13,x+=62-b>>>8&49,String.fromCharCode(x)},y.prototype._decodeChar=function(b){var x=s;return x+=(44-b&b-46)>>>8&-s+b-45+62,x+=(94-b&b-96)>>>8&-s+b-95+63,x+=(47-b&b-58)>>>8&-s+b-48+52,x+=(64-b&b-91)>>>8&-s+b-65+0,x+=(96-b&b-123)>>>8&-s+b-97+26,x},y}(o);r.URLSafeCoder=d;var h=new d;function p(v){return h.encode(v)}r.encodeURLSafe=p;function g(v){return h.decode(v)}r.decodeURLSafe=g,r.encodedLength=function(v){return c.encodedLength(v)},r.maxDecodedLength=function(v){return c.maxDecodedLength(v)},r.decodedLength=function(v){return c.decodedLength(v)}},function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a="utf8: invalid string",s="utf8: invalid source encoding";function o(l){for(var d=new Uint8Array(c(l)),h=0,p=0;p<l.length;p++){var g=l.charCodeAt(p);g<128?d[h++]=g:g<2048?(d[h++]=192|g>>6,d[h++]=128|g&63):g<55296?(d[h++]=224|g>>12,d[h++]=128|g>>6&63,d[h++]=128|g&63):(p++,g=(g&1023)<<10,g|=l.charCodeAt(p)&1023,g+=65536,d[h++]=240|g>>18,d[h++]=128|g>>12&63,d[h++]=128|g>>6&63,d[h++]=128|g&63)}return d}r.encode=o;function c(l){for(var d=0,h=0;h<l.length;h++){var p=l.charCodeAt(h);if(p<128)d+=1;else if(p<2048)d+=2;else if(p<55296)d+=3;else if(p<=57343){if(h>=l.length-1)throw new Error(a);h++,d+=4}else throw new Error(a)}return d}r.encodedLength=c;function u(l){for(var d=[],h=0;h<l.length;h++){var p=l[h];if(p&128){var g=void 0;if(p<224){if(h>=l.length)throw new Error(s);var v=l[++h];if((v&192)!==128)throw new Error(s);p=(p&31)<<6|v&63,g=128}else if(p<240){if(h>=l.length-1)throw new Error(s);var v=l[++h],y=l[++h];if((v&192)!==128||(y&192)!==128)throw new Error(s);p=(p&15)<<12|(v&63)<<6|y&63,g=2048}else if(p<248){if(h>=l.length-2)throw new Error(s);var v=l[++h],y=l[++h],b=l[++h];if((v&192)!==128||(y&192)!==128||(b&192)!==128)throw new Error(s);p=(p&15)<<18|(v&63)<<12|(y&63)<<6|b&63,g=65536}else throw new Error(s);if(p<g||p>=55296&&p<=57343)throw new Error(s);if(p>
3888=65536){if(p>1114111)throw new Error(s);p-=65536,d.push(String.fromCharCode(55296|p>>10)),p=56320|p&1023}}d.push(String.fromCharCode(p))}return d.join("")}r.decode=u},function(t,r,i){t.exports=i(3).default},function(t,r,i){i.r(r);class a{constructor(C,M){this.lastId=0,this.prefix=C,this.name=M}create(C){this.lastId++;var M=this.lastId,K=this.prefix+M,te=this.name+"["+M+"]",Te=!1,ze=function(){Te||(C.apply(null,arguments),Te=!0)};return this[M]=ze,{number:M,id:K,name:te,callback:ze}}remove(C){delete this[C.number]}}var s=new a("_pusher_script_","Pusher.ScriptReceivers"),o={VERSION:"8.4.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},c=o;class u{constructor(C){this.options=C,this.receivers=C.receivers||s,this.loading={}}load(C,M,K){var te=this;if(te.loading[C]&&te.loading[C].length>0)te.loading[C].push(K);else{te.loading[C]=[K];var Te=oe.createScriptRequest(te.getPath(C,M)),ze=te.receivers.create(function(tt){if(te.receivers.remove(ze),te.loading[C]){var At=te.loading[C];delete te.loading[C];for(var on=function(er){er||Te.cleanup()},vn=0;vn<At.length;vn++)At[vn](tt,on)}});Te.send(ze)}}getRoot(C){var M,K=oe.getDocument().location.protocol;return C&&C.useTLS||K==="https:"?M=this.options.cdn_https:M=this.options.cdn_http,M.replace(/\/*$/,"")+"/"+this.options.version}getPath(C,M){return this.getRoot(M)+"/"+C+this.options.suffix+".js"}}var l=new a("_pusher_dependencies","Pusher.DependenciesReceivers"),d=new u({cdn_http:c.cdn_http,cdn_https:c.cdn_https,version:c.VERSION,suffix:c.dependency_suffix,receivers:l});const h={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var g={buildLogSuffix:function(D){const C="See:",M=h.urls[D];if(!M)return"";let K;return M.fullUrl?K=M.fullUrl:M.path&&(K=h.baseUrl+M.path),K?`${C} ${K}`:""}},v;(function(D){D.UserAuthentication="user-authentication",D.ChannelAuthorization="channel-authorization"})(v||(v={}));class y extends Error{constructor(C){super(C),Object.setPrototypeOf(this,new.target.prototype)}}class b extends Error{constructor(C){super(C),Object.setPrototypeOf(this,new.target.prototype)}}class x extends Error{constructor(C){super(C),Object.setPrototypeOf(this,new.target.prototype)}}class S extends Error{constructor(C){super(C),Object.setPrototypeOf(this,new.target.prototype)}}class w extends Error{constructor(C){super(C),Object.setPrototypeOf(this,new.target.prototype)}}class k extends Error{constructor(C){super(C),Object.setPrototypeOf(this,new.target.prototype)}}class E extends Error{constructor(C){super(C),Object.setPrototypeOf(this,new.target.prototype)}}class I extends Error{constructor(C){super(C),Object.setPrototypeOf(this,new.target.prototype)}}class P extends Error{constructor(C,M){super(M),this.status=C,Object.setPrototypeOf(this,new.target.prototype)}}var N=function(D,C,M,K,te){const Te=oe.createXHR();Te.open("POST",M.endpoint,!0),Te.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var ze in M.headers)Te.setRequestHeader(ze,M.headers[ze]);if(M.headersProvider!=null){let tt=M.headersProvider();for(var ze in tt)Te.setRequestHeader(ze,tt[ze])}return Te.onreadystatechange=function(){if(Te.readyState===4)if(Te.status===200){let tt,At=!1;try{tt=JSON.parse(Te.responseText),At=!0}catch{te(new P(200,`JSON returned from ${K.toString()}
3888 endpoint was invalid, yet status code was 200. Data was: ${Te.responseText}`),null)}At&&te(null,tt)}else{let tt="";switch(K){case v.UserAuthentication:tt=g.buildLogSuffix("authenticationEndpoint");break;case v.ChannelAuthorization:tt=`Clients must be authorized to join private or presence channels. ${g.buildLogSuffix("authorizationEndpoint")}`;break}te(new P(Te.status,`Unable to retrieve auth string from ${K.toString()} endpoint - received status: ${Te.status} from ${M.endpoint}. ${tt}`),null)}},Te.send(C),Te};function j(D){return se(X(D))}var L=String.fromCharCode,B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",V=function(D){var C=D.charCodeAt(0);return C<128?D:C<2048?L(192|C>>>6)+L(128|C&63):L(224|C>>>12&15)+L(128|C>>>6&63)+L(128|C&63)},X=function(D){return D.replace(/[^\x00-\x7F]/g,V)},ne=function(D){var C=[0,2,1][D.length%3],M=D.charCodeAt(0)<<16|(D.length>1?D.charCodeAt(1):0)<<8|(D.length>2?D.charCodeAt(2):0),K=[B.charAt(M>>>18),B.charAt(M>>>12&63),C>=2?"=":B.charAt(M>>>6&63),C>=1?"=":B.charAt(M&63)];return K.join("")},se=window.btoa||function(D){return D.replace(/[\s\S]{1,3}/g,ne)};class ie{constructor(C,M,K,te){this.clear=M,this.timer=C(()=>{this.timer&&(this.timer=te(this.timer))},K)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var de=ie;function ue(D){window.clearTimeout(D)}function Ce(D){window.clearInterval(D)}class we extends de{constructor(C,M){super(setTimeout,ue,C,function(K){return M(),null})}}class Fe extends de{constructor(C,M){super(setInterval,Ce,C,function(K){return M(),K})}}var Ge={now(){return Date.now?Date.now():new Date().valueOf()},defer(D){return new we(0,D)},method(D,...C){var M=Array.prototype.slice.call(arguments,1);return function(K){return K[D].apply(K,M.concat(arguments))}}},Ie=Ge;function He(D,...C){for(var M=0;M<C.length;M++){var K=C[M];for(var te in K)K[te]&&K[te].constructor&&K[te].constructor===Object?D[te]=He(D[te]||{},K[te]):D[te]=K[te]}return D}function ot(){for(var D=["Pusher"],C=0;C<arguments.length;C++)typeof arguments[C]=="string"?D.push(arguments[C]):D.push(xn(arguments[C]));return D.join(" : ")}function Je(D,C){var M=Array.prototype.indexOf;if(D===null)return-1;if(M&&D.indexOf===M)return D.indexOf(C);for(var K=0,te=D.length;K<te;K++)if(D[K]===C)return K;return-1}function et(D,C){for(var M in D)Object.prototype.hasOwnProperty.call(D,M)&&C(D[M],M,D)}function Ut(D){var C=[];return et(D,function(M,K){C.push(K)}),C}function _t(D){var C=[];return et(D,function(M){C.push(M)}),C}function mt(D,C,M){for(var K=0;K<D.length;K++)C.call(M||window,D[K],K,D)}function wt(D,C){for(var M=[],K=0;K<D.length;K++)M.push(C(D[K],K,D,M));return M}function Kt(D,C){var M={};return et(D,function(K,te){M[te]=C(K)}),M}function Ct(D,C){C=C||function(te){return!!te};for(var M=[],K=0;K<D.length;K++)C(D[K],K,D,M)&&M.push(D[K]);return M}function kt(D,C){var M={};return et(D,function(K,te){(C&&C(K,te,D,M)||K)&&(M[te]=K)}),M}function jn(D){var C=[];return et(D,function(M,K){C.push([K,M])}),C}function zt(D,C){for(var M=0;M<D.length;M++)if(C(D[M],M,D))return!0;return!1}function qn(D,C){for(var M=0;M<D.length;M++)if(!C(D[M],M,D))return!1;return!0}function _r(D){return Kt(D,function(C){return typeof C=="object"&&(C=xn(C)),encodeURIComponent(j(C.toString()))})}function On(D){var C=kt(D,function(K){return K!==void 0}),M=wt(jn(_r(C)),Ie.method("join","=")).join("&");return M}function hn(D){var C=[],M=[];return function K(te,Te){var ze,tt,At;switch(typeof te){case"object":if(!te)return null;for(ze=0;ze<C.length;ze+=1)if(C[ze]===te)return{$ref:M[ze]};if(C.push(te),M.push(Te),Object.prototype.toString.apply(te)==="[object Array]")for(At=[],ze=0;ze<te.length;ze+=1)At[ze]=K(te[ze],Te+"["+ze+"]");else{At={};for(tt in te)Object.prototype.hasOwnProperty.call(te,tt)&&(At[tt]=K(te[tt],Te+"["+JSON.stringify(tt)+"]"))}return At;case"number":case"string":case"boolean":return te}}(D,"$")}function xn(D){try{return JSON.stringify(D)}catch{return JSON.stringify(hn(D))}}class kn{constructor(){this.globalLog=C=>{window.console&&window.console.log&&window.console.log(C)}}debug(...C){this.log(this.globalLog,C)}warn(...C){this.log(this.globalLogWarn,C)}error(...C){this.log(this.globalLogError,C)}globalLogWarn(C){window.console&&window.console.warn?window.console.warn(C):this.globalLog(C)}
3888globalLogError(C){window.console&&window.console.error?window.console.error(C):this.globalLogWarn(C)}log(C,...M){var K=ot.apply(this,arguments);Gs.log?Gs.log(K):Gs.logToConsole&&C.bind(this)(K)}}var St=new kn,Er=function(D,C,M,K,te){(M.headers!==void 0||M.headersProvider!=null)&&St.warn(`To send headers with the ${K.toString()} request, you must use AJAX, rather than JSONP.`);var Te=D.nextAuthCallbackID.toString();D.nextAuthCallbackID++;var ze=D.getDocument(),tt=ze.createElement("script");D.auth_callbacks[Te]=function(vn){te(null,vn)};var At="Pusher.auth_callbacks['"+Te+"']";tt.src=M.endpoint+"?callback="+encodeURIComponent(At)+"&"+C;var on=ze.getElementsByTagName("head")[0]||ze.documentElement;on.insertBefore(tt,on.firstChild)},Jn=Er;class rn{constructor(C){this.src=C}send(C){var M=this,K="Error loading "+M.src;M.script=document.createElement("script"),M.script.id=C.id,M.script.src=M.src,M.script.type="text/javascript",M.script.charset="UTF-8",M.script.addEventListener?(M.script.onerror=function(){C.callback(K)},M.script.onload=function(){C.callback(null)}):M.script.onreadystatechange=function(){(M.script.readyState==="loaded"||M.script.readyState==="complete")&&C.callback(null)},M.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(M.errorScript=document.createElement("script"),M.errorScript.id=C.id+"_error",M.errorScript.text=C.name+"('"+K+"');",M.script.async=M.errorScript.async=!1):M.script.async=!0;var te=document.getElementsByTagName("head")[0];te.insertBefore(M.script,te.firstChild),M.errorScript&&te.insertBefore(M.errorScript,M.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class sr{constructor(C,M){this.url=C,this.data=M}send(C){if(!this.request){var M=On(this.data),K=this.url+"/"+C.number+"?"+M;this.request=oe.createScriptRequest(K),this.request.send(C)}}cleanup(){this.request&&this.request.cleanup()}}var Qn=function(D,C){return function(M,K){var te="http"+(C?"s":"")+"://",Te=te+(D.host||D.options.host)+D.options.path,ze=oe.createJSONPRequest(Te,M),tt=oe.ScriptReceivers.create(function(At,on){s.remove(tt),ze.cleanup(),on&&on.host&&(D.host=on.host),K&&K(At,on)});ze.send(tt)}},Pr={name:"jsonp",getAgent:Qn},Gr=Pr;function gt(D,C,M){var K=D+(C.useTLS?"s":""),te=C.useTLS?C.hostTLS:C.hostNonTLS;return K+"://"+te+M}function Rt(D,C){var M="/app/"+D,K="?protocol="+c.PROTOCOL+"&client=js&version="+c.VERSION+(C?"&"+C:"");return M+K}var Wt={getInitial:function(D,C){var M=(C.httpPath||"")+Rt(D,"flash=false");return gt("ws",C,M)}},Di={getInitial:function(D,C){var M=(C.httpPath||"/pusher")+Rt(D);return gt("http",C,M)}},Kr={getInitial:function(D,C){return gt("http",C,C.httpPath||"/pusher")},getPath:function(D,C){return Rt(D)}};class Ni{constructor(){this._callbacks={}}get(C){return this._callbacks[Yr(C)]}add(C,M,K){var te=Yr(C);this._callbacks[te]=this._callbacks[te]||[],this._callbacks[te].push({fn:M,context:K})}remove(C,M,K){if(!C&&!M&&!K){this._callbacks={};return}var te=C?[Yr(C)]:Ut(this._callbacks);M||K?this.removeCallback(te,M,K):this.removeAllCallbacks(te)}removeCallback(C,M,K){mt(C,function(te){this._callbacks[te]=Ct(this._callbacks[te]||[],function(Te){return M&&M!==Te.fn||K&&K!==Te.context}),this._callbacks[te].length===0&&delete this._callbacks[te]},this)}removeAllCallbacks(C){mt(C,function(M){delete this._callbacks[M]},this)}}function Yr(D){return"_"+D}class Zn{constructor(C){this.callbacks=new Ni,this.global_callbacks=[],this.failThrough=C}bind(C,M,K){return this.callbacks.add(C,M,K),this}bind_global(C){return this.global_callbacks.push(C),this}unbind(C,M,K){return this.callbacks.remove(C,M,K),this}unbind_global(C){return C?(this.global_callbacks=Ct(this.global_callbacks||[],M=>M!==C),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(C,M,K){for(var te=0;te<this.global_callbacks.length;te++)this.global_callbacks[te](C,M);var Te=this.callbacks.get(C),ze=[];if(K?ze.push(M,K):M&&ze.push(M),Te&&Te.length>0)for(var te=0;te<Te.length;te++)Te[te].fn.apply(Te[te].context||window,ze);else this.failThrough&&this.failThrough(C,M);return this}}class Ya extends Zn{constructor(C,M,K,te,Te){super(),this.initialize=oe.transportConnectionInitializer,this.hooks=C,this.name=M,this.priority=K,this.key=te,this.options=Te,this.state="new",this.timeline=Te.timeline,this.activityTimeout=Te.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var C=this.hooks.urls.getInitial(this.key,this.options);
3888try{this.socket=this.hooks.getSocket(C,this.options)}catch(M){return Ie.defer(()=>{this.onError(M),this.changeState("closed")}),!1}return this.bindListeners(),St.debug("Connecting",{transport:this.name,url:C}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(C){return this.state==="open"?(Ie.defer(()=>{this.socket&&this.socket.send(C)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(C){this.emit("error",{type:"WebSocketError",error:C}),this.timeline.error(this.buildTimelineMessage({error:C.toString()}))}onClose(C){C?this.changeState("closed",{code:C.code,reason:C.reason,wasClean:C.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(C){this.emit("message",C)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=C=>{this.onError(C)},this.socket.onclose=C=>{this.onClose(C)},this.socket.onmessage=C=>{this.onMessage(C)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(C,M){this.state=C,this.timeline.info(this.buildTimelineMessage({state:C,params:M})),this.emit(C,M)}buildTimelineMessage(C){return He({cid:this.id},C)}}class br{constructor(C){this.hooks=C}isSupported(C){return this.hooks.isSupported(C)}createConnection(C,M,K,te){return new Ya(this.hooks,C,M,K,te)}}var Xa=new br({urls:Wt,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!oe.getWebSocketAPI()},isSupported:function(){return!!oe.getWebSocketAPI()},getSocket:function(D){return oe.createWebSocket(D)}}),na={urls:Di,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Os=He({getSocket:function(D){return oe.HTTPFactory.createStreamingSocket(D)}},na),Ca=He({getSocket:function(D){return oe.HTTPFactory.createPollingSocket(D)}},na),Ja={isSupported:function(){return oe.isXHRSupported()}},ra=new br(He({},Os,Ja)),Ms=new br(He({},Ca,Ja)),ia={ws:Xa,xhr_streaming:ra,xhr_polling:Ms},Ds=ia,Qa=new br({file:"sockjs",urls:Kr,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(D,C){return new window.SockJS(D,null,{js_path:d.getPath("sockjs",{useTLS:C.useTLS}),ignore_null_origin:C.ignoreNullOrigin})},beforeOpen:function(D,C){D.send(JSON.stringify({path:C}))}}),dc={isSupported:function(D){var C=oe.isXDRSupported(D.useTLS);return C}},Ns=new br(He({},Os,dc)),ko=new br(He({},Ca,dc));Ds.xdr_streaming=Ns,Ds.xdr_polling=ko,Ds.sockjs=Qa;var Sn=Ds;class cu extends Zn{constructor(){super();var C=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){C.emit("online")},!1),window.addEventListener("offline",function(){C.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var uu=new cu;class lu{constructor(C,M,K){this.manager=C,this.transport=M,this.minPingDelay=K.minPingDelay,this.maxPingDelay=K.maxPingDelay,this.pingDelay=void 0}createConnection(C,M,K,te){te=He({},te,{activityTimeout:this.pingDelay});var Te=this.transport.createConnection(C,M,K,te),ze=null,tt=function(){Te.unbind("open",tt),Te.bind("closed",At),ze=Ie.now()},At=on=>{if(Te.unbind("closed",At),on.code===1002||on.code===1003)this.manager.reportDeath();else if(!on.wasClean&&ze){var vn=Ie.now()-ze;vn<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(vn/2,this.minPingDelay))}};return Te.bind("open",tt),Te}isSupported(C){return this.manager.isAlive()&&this.transport.isSupported(C)}}const Za={decodeMessage:function(D){try{var C=JSON.parse(D.data),M=C.data;if(typeof M=="string")try{M=JSON.parse(C.data)}catch{}var K={event:C.event,channel:C.channel,data:M};
3888return C.user_id&&(K.user_id=C.user_id),K}catch(te){throw{type:"MessageParseError",error:te,data:D.data}}},encodeMessage:function(D){return JSON.stringify(D)},processHandshake:function(D){var C=Za.decodeMessage(D);if(C.event==="pusher:connection_established"){if(!C.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:C.data.socket_id,activityTimeout:C.data.activity_timeout*1e3}}else{if(C.event==="pusher:error")return{action:this.getCloseAction(C.data),error:this.getCloseError(C.data)};throw"Invalid handshake"}},getCloseAction:function(D){return D.code<4e3?D.code>=1002&&D.code<=1004?"backoff":null:D.code===4e3?"tls_only":D.code<4100?"refused":D.code<4200?"backoff":D.code<4300?"retry":"refused"},getCloseError:function(D){return D.code!==1e3&&D.code!==1001?{type:"PusherError",data:{code:D.code,message:D.reason||D.message}}:null}};var Ur=Za;class or extends Zn{constructor(C,M){super(),this.id=C,this.transport=M,this.activityTimeout=M.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(C){return this.transport.send(C)}send_event(C,M,K){var te={event:C,data:M};return K&&(te.channel=K),St.debug("Event sent",te),this.send(Ur.encodeMessage(te))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var C={message:K=>{var te;try{te=Ur.decodeMessage(K)}catch(Te){this.emit("error",{type:"MessageParseError",error:Te,data:K.data})}if(te!==void 0){switch(St.debug("Event recd",te),te.event){case"pusher:error":this.emit
vendor: 4,110 bytes, line 3888
3888("error",{type:"PusherError",data:te.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",te)}},activity:()=>{this.emit("activity")},error:K=>{this.emit("error",K)},closed:K=>{M(),K&&K.code&&this.handleCloseEvent(K),this.transport=null,this.emit("closed")}},M=()=>{et(C,(K,te)=>{this.transport.unbind(te,K)})};et(C,(K,te)=>{this.transport.bind(te,K)})}handleCloseEvent(C){var M=Ur.getCloseAction(C),K=Ur.getCloseError(C);K&&this.emit("error",K),M&&this.emit(M,{action:M,error:K})}}class Ls{constructor(C,M){this.transport=C,this.callback=M,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=C=>{this.unbindListeners();var M;try{M=Ur.processHandshake(C)}catch(K){this.finish("error",{error:K}),this.transport.close();return}M.action==="connected"?this.finish("connected",{connection:new or(M.id,this.transport),activityTimeout:M.activityTimeout}):(this.finish(M.action,{error:M.error}),this.transport.close())},this.onClosed=C=>{this.unbindListeners();var M=Ur.getCloseAction(C)||"backoff",K=Ur.getCloseError(C);this.finish(M,{error:K})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(C,M){this.callback(He({transport:this.transport,action:C},M))}}class fc{constructor(C,M){this.timeline=C,this.options=M||{}}send(C,M){this.timeline.isEmpty()||this.timeline.send(oe.TimelineTransport.getAgent(this,C),M)}}class So extends Zn{constructor(C,M){super(function(K,te){St.debug("No callbacks on "+C+" for "+K)}),this.name=C,this.pusher=M,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(C,M){return M(null,{auth:""})}trigger(C,M){if(C.indexOf("client-")!==0)throw new y("Event '"+C+"' does not start with 'client-'");if(!this.subscribed){var K=g.buildLogSuffix("triggeringClientEvents");St.warn(`Client event triggered before channel 'subscription_succeeded' event . ${K}`)}return this.pusher.send_event(C,M,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(C){var M=C.event,K=C.data;if(M==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(C);else if(M==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(C);else if(M.indexOf("pusher_internal:")!==0){var te={};this.emit(M,K,te)}}handleSubscriptionSucceededEvent(C){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",C.data)}handleSubscriptionCountEvent(C){C.data.subscription_count&&(this.subscriptionCount=C.data.subscription_count),this.emit("pusher:subscription_count",C.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(C,M)=>{C?(this.subscriptionPending=!1,St.error(C.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:C.message},C instanceof P?{status:C.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:M.auth,channel_data:M.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class Fs extends So{authorize(C,M){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:C},M)}}class du{constructor(){this.reset()}get(C){return Object.prototype.hasOwnProperty.call(this.members,C)?{id:C,info:this.members[C]}:null}each(C){et(this.members,(M,K)=>{C(this.get(K))})}setMyID(C){this.myID=C}onSubscription(C){this.members=C.presence.hash,this.count=C.presence.count,this.me=this.get(this.myID)}addMember(C){return this.get(C.user_id)===null&&this.count++,this.members[C.user_id]=C.user_info,this.get(C.user_id)}removeMember(C){var M=this.get(C.user_id);return M&&(delete this.members[C.user_id],this.count--),M}
3888reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var Rr=function(D,C,M,K){function te(Te){return Te instanceof M?Te:new M(function(ze){ze(Te)})}return new(M||(M=Promise))(function(Te,ze){function tt(vn){try{on(K.next(vn))}catch(er){ze(er)}}function At(vn){try{on(K.throw(vn))}catch(er){ze(er)}}function on(vn){vn.done?Te(vn.value):te(vn.value).then(tt,At)}on((K=K.apply(D,C||[])).next())})};class fu extends Fs{constructor(C,M){super(C,M),this.members=new du}authorize(C,M){super.authorize(C,(K,te)=>Rr(this,void 0,void 0,function*(){if(!K)if(te=te,te.channel_data!=null){var Te=JSON.parse(te.channel_data);this.members.setMyID(Te.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let ze=g.buildLogSuffix("authorizationEndpoint");St.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${ze}, or the user should be signed in.`),M("Invalid auth response");return}M(K,te)}))}handleEvent(C){var M=C.event;if(M.indexOf("pusher_internal:")===0)this.handleInternalEvent(C);else{var K=C.data,te={};C.user_id&&(te.user_id=C.user_id),this.emit(M,K,te)}}handleInternalEvent(C){var M=C.event,K=C.data;switch(M){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(C);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(C);break;case"pusher_internal:member_added":var te=this.members.addMember(K);this.emit("pusher:member_added",te);break;case"pusher_internal:member_removed":var Te=this.members.removeMember(K);Te&&this.emit("pusher:member_removed",Te);break}}handleSubscriptionSucceededEvent(C){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(C.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var $s=i(1),To=i(0);class es extends Fs{constructor(C,M,K){super(C,M),this.key=null,this.nacl=K}authorize(C,M){super.authorize(C,(K,te)=>{if(K){M(K,te);return}let Te=te.shared_secret;if(!Te){M(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(To.decode)(Te),delete te.shared_secret,M(null,te)})}trigger(C,M){throw new k("Client events are not currently supported for encrypted channels")}handleEvent(C){var M=C.event,K=C.data;if(M.indexOf("pusher_internal:")===0||M.indexOf("pusher:")===0){super.handleEvent(C);return}this.handleEncryptedEvent(M,K)}handleEncryptedEvent(C,M){if(!this.key){St.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!M.ciphertext||!M.nonce){St.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+M);return}let K=Object(To.decode)(M.ciphertext);if(K.length<this.nacl.secretbox.overheadLength){St.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${K.length}`);return}let te=Object(To.decode)(M.nonce);if(te.length<this.nacl.secretbox.nonceLength){St.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${te.length}`);return}let Te=this.nacl.secretbox.open(K,te,this.key);if(Te===null){St.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(ze,tt)=>{if(ze){St.error(`Failed to make a request to the authEndpoint: ${tt}. Unable to fetch new key, so dropping encrypted event`);return}if(Te=this.nacl.secretbox.open(K,te,this.key),Te===null){St.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(C,this.getDataToEmit(Te))});return}this.emit(C,this.getDataToEmit(Te))}getDataToEmit(C){let M=Object($s.decode)(C);try{return JSON.parse(M)}catch{return M}}}class hu extends Zn{constructor(C,M){super(),this.state="initialized",this.connection=null,this.key=C,this.options=M,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var K=oe.getNetwork();K.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),K.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(C){return this.connection?this.connection.send(C):!1}send_event(C,M,K){return this.connection?this.connection.send_event(C,M,K):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var C=(M,K)=>{M?this.runner=this.strategy.connect(0,C):K.action==="error"?(this.emit
3888("error",{type:"HandshakeError",error:K.error}),this.timeline.error({handshakeError:K.error})):(this.abortConnecting(),this.handshakeCallbacks[K.action](K))};this.runner=this.strategy.connect(0,C)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var C=this.abandonConnection();C.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(C){this.timeline.info({action:"retry",delay:C}),C>0&&this.emit("connecting_in",Math.round(C/1e3)),this.retryTimer=new we(C||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new we(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new we(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new we(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(C){return He({},C,{message:M=>{this.resetActivityCheck(),this.emit("message",M)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:M=>{this.emit("error",M)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(C){return He({},C,{connected:M=>{this.activityTimeout=Math.min(this.options.activityTimeout,M.activityTimeout,M.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(M.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let C=M=>K=>{K.error&&this.emit("error",{type:"WebSocketError",error:K.error}),M(K)};return{tls_only:C(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:C(()=>{this.disconnect()}),backoff:C(()=>{this.retryIn(1e3)}),retry:C(()=>{this.retryIn(0)})}}setConnection(C){this.connection=C;for(var M in this.connectionCallbacks)this.connection.bind(M,this.connectionCallbacks[M]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var C in this.connectionCallbacks)this.connection.unbind(C,this.connectionCallbacks[C]);var M=this.connection;return this.connection=null,M}}updateState(C,M){var K=this.state;if(this.state=C,K!==C){var te=C;te==="connected"&&(te+=" with new socket ID "+M.socket_id),St.debug("State changed",K+" -> "+te),this.timeline.info({state:C,params:M}),this.emit("state_change",{previous:K,current:C}),this.emit(C,M)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Bs{constructor(){this.channels={}}add(C,M){return this.channels[C]||(this.channels[C]=Eo(C,M)),this.channels[C]}all(){return _t(this.channels)}find(C){return this.channels[C]}remove(C){var M=this.channels[C];return delete this.channels[C],M}disconnect(){et(this.channels,function(C){C.disconnect()})}}function Eo(D,C){if(D.indexOf("private-encrypted-")===0){if(C.config.nacl)return Vn.createEncryptedChannel(D,C,C.config.nacl);let M="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",K=g.buildLogSuffix("encryptedChannelSupport");throw new k(`${M}. ${K}`)}else{if(D.indexOf("private-")===0)return Vn.createPrivateChannel(D,C);if(D.indexOf("presence-")===0)return Vn.createPresenceChannel(D,C);if(D.indexOf("#")===0)throw new b('Cannot create a channel with name "'+D+'".');return Vn.createChannel(D,C)}}var ts={createChannels(){return new Bs},createConnectionManager(D,C){return new hu(D,C)},createChannel(D,C){return new So(D,C)},createPrivateChannel(D,C){return new Fs(D,C)},createPresenceChannel(D,C){return new fu(D,C)}
3888,createEncryptedChannel(D,C,M){return new es(D,C,M)},createTimelineSender(D,C){return new fc(D,C)},createHandshake(D,C){return new Ls(D,C)},createAssistantToTheTransportManager(D,C,M){return new lu(D,C,M)}},Vn=ts;class ns{constructor(C){this.options=C||{},this.livesLeft=this.options.lives||1/0}getAssistant(C){return Vn.createAssistantToTheTransportManager(this,C,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class aa{constructor(C,M){this.strategies=C,this.loop=!!M.loop,this.failFast=!!M.failFast,this.timeout=M.timeout,this.timeoutLimit=M.timeoutLimit}isSupported(){return zt(this.strategies,Ie.method("isSupported"))}connect(C,M){var K=this.strategies,te=0,Te=this.timeout,ze=null,tt=(At,on)=>{on?M(null,on):(te=te+1,this.loop&&(te=te%K.length),te<K.length?(Te&&(Te=Te*2,this.timeoutLimit&&(Te=Math.min(Te,this.timeoutLimit))),ze=this.tryStrategy(K[te],C,{timeout:Te,failFast:this.failFast},tt)):M(!0))};return ze=this.tryStrategy(K[te],C,{timeout:Te,failFast:this.failFast},tt),{abort:function(){ze.abort()},forceMinPriority:function(At){C=At,ze&&ze.forceMinPriority(At)}}}tryStrategy(C,M,K,te){var Te=null,ze=null;return K.timeout>0&&(Te=new we(K.timeout,function(){ze.abort(),te(!0)})),ze=C.connect(M,function(tt,At){tt&&Te&&Te.isRunning()&&!K.failFast||(Te&&Te.ensureAborted(),te(tt,At))}),{abort:function(){Te&&Te.ensureAborted(),ze.abort()},forceMinPriority:function(tt){ze.forceMinPriority(tt)}}}}class Us{constructor(C){this.strategies=C}isSupported(){return zt(this.strategies,Ie.method("isSupported"))}connect(C,M){return pu(this.strategies,C,function(K,te){return function(Te,ze){if(te[K].error=Te,Te){hc(te)&&M(!0);return}mt(te,function(tt){tt.forceMinPriority(ze.transport.priority)}),M(null,ze)}})}}function pu(D,C,M){var K=wt(D,function(te,Te,ze,tt){return te.connect(C,M(Te,tt))});return{abort:function(){mt(K,Po)},forceMinPriority:function(te){mt(K,function(Te){Te.forceMinPriority(te)})}}}function hc(D){return qn(D,function(C){return!!C.error})}function Po(D){!D.error&&!D.aborted&&(D.abort(),D.aborted=!0)}class rs{constructor(C,M,K){this.strategy=C,this.transports=M,this.ttl=K.ttl||1800*1e3,this.usingTLS=K.useTLS,this.timeline=K.timeline}isSupported(){return this.strategy.isSupported()}connect(C,M){var K=this.usingTLS,te=Fi(K),Te=te&&te.cacheSkipCount?te.cacheSkipCount:0,ze=[this.strategy];if(te&&te.timestamp+this.ttl>=Ie.now()){var tt=this.transports[te.transport];tt&&(["ws","wss"].includes(te.transport)||Te>3?(this.timeline.info({cached:!0,transport:te.transport,latency:te.latency}),ze.push(new aa([tt],{timeout:te.latency*2+1e3,failFast:!0}))):Te++)}var At=Ie.now(),on=ze.pop().connect(C,function vn(er,ul){er?(js(K),ze.length>0?(At=Ie.now(),on=ze.pop().connect(C,vn)):M(er)):(pc(K,ul.transport.name,Ie.now()-At,Te),M(null,ul))});return{abort:function(){on.abort()},forceMinPriority:function(vn){C=vn,on&&on.forceMinPriority(vn)}}}}function Li(D){return"pusherTransport"+(D?"TLS":"NonTLS")}function Fi(D){var C=oe.getLocalStorage();if(C)try{var M=C[Li(D)];if(M)return JSON.parse(M)}catch{js(D)}return null}function pc(D,C,M,K){var te=oe.getLocalStorage();if(te)try{te[Li(D)]=xn({timestamp:Ie.now(),transport:C,latency:M,cacheSkipCount:K})}catch{}}function js(D){var C=oe.getLocalStorage();if(C)try{delete C[Li(D)]}catch{}}class sa{constructor(C,{delay:M}){this.strategy=C,this.options={delay:M}}isSupported(){return this.strategy.isSupported()}connect(C,M){var K=this.strategy,te,Te=new we(this.options.delay,function(){te=K.connect(C,M)});return{abort:function(){Te.ensureAborted(),te&&te.abort()},forceMinPriority:function(ze){C=ze,te&&te.forceMinPriority(ze)}}}}class oa{constructor(C,M,K){this.test=C,this.trueBranch=M,this.falseBranch=K}isSupported(){var C=this.test()?this.trueBranch:this.falseBranch;return C.isSupported()}connect(C,M){var K=this.test()?this.trueBranch:this.falseBranch;return K.connect(C,M)}}class mc{constructor(C){this.strategy=C}isSupported(){return this.strategy.isSupported()}connect(C,M){var K=this.strategy.connect(C,function(te,Te){Te&&K.abort(),M(te,Te)});return K}}function wi(D){return function(){return D.isSupported()}}var qs=function(D,C,M){var K={};
3888function te(Rv,y1,_1,dl,b1){var Av=M(D,Rv,y1,_1,dl,b1);return K[Rv]=Av,Av}var Te=Object.assign({},C,{hostNonTLS:D.wsHost+":"+D.wsPort,hostTLS:D.wsHost+":"+D.wssPort,httpPath:D.wsPath}),ze=Object.assign({},Te,{useTLS:!0}),tt=Object.assign({},C,{hostNonTLS:D.httpHost+":"+D.httpPort,hostTLS:D.httpHost+":"+D.httpsPort,httpPath:D.httpPath}),At={loop:!0,timeout:15e3,timeoutLimit:6e4},on=new ns({minPingDelay:1e4,maxPingDelay:D.activityTimeout}),vn=new ns({lives:2,minPingDelay:1e4,maxPingDelay:D.activityTimeout}),er=te("ws","ws",3,Te,on),ul=te("wss","ws",3,ze,on),Ev=te("sockjs","sockjs",1,tt),Pv=te("xhr_streaming","xhr_streaming",1,tt,vn),Vp=te("xdr_streaming","xdr_streaming",1,tt,vn),qf=te("xhr_polling","xhr_polling",1,tt),v1=te("xdr_polling","xdr_polling",1,tt),Gp=new aa([er],At),da=new aa([ul],At),Kp=new aa([Ev],At),ll=new aa([new oa(wi(Pv),Pv,Vp)],At),Yp=new aa([new oa(wi(qf),qf,v1)],At),Xp=new aa([new oa(wi(ll),new Us([ll,new sa(Yp,{delay:4e3})]),Yp)],At),Jp=new oa(wi(Xp),Xp,Kp),Qp;return C.useTLS?Qp=new Us([Gp,new sa(Jp,{delay:2e3})]):Qp=new Us([Gp,new sa(da,{delay:2e3}),new sa(Jp,{delay:5e3})]),new rs(new mc(new oa(wi(er),Qp,Jp)),K,{ttl:18e5,timeline:C.timeline,useTLS:C.useTLS})},zs=qs,gc=function(){var D=this;D.timeline.info(D.buildTimelineMessage({transport:D.name+(D.options.useTLS?"s":"")})),D.hooks.isInitialized()?D.changeState("initialized"):D.hooks.file?(D.changeState("initializing"),d.load(D.hooks.file,{useTLS:D.options.useTLS},function(C,M){D.hooks.isInitialized()?(D.changeState("initialized"),M(!0)):(C&&D.onError(C),D.onClose(),M(!1))})):D.onClose()},Xr={getRequest:function(D){var C=new window.XDomainRequest;return C.ontimeout=function(){D.emit("error",new x),D.close()},C.onerror=function(M){D.emit("error",M),D.close()},C.onprogress=function(){C.responseText&&C.responseText.length>0&&D.onChunk(200,C.responseText)},C.onload=function(){C.responseText&&C.responseText.length>0&&D.onChunk(200,C.responseText),D.emit("finished",200),D.close()},C},abortRequest:function(D){D.ontimeout=D.onerror=D.onprogress=D.onload=null,D.abort()}},Jr=Xr;const jr=256*1024;class qr extends Zn{constructor(C,M,K){super(),this.hooks=C,this.method=M,this.url=K}start(C){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},oe.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(C)}close(){this.unloader&&(oe.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(C,M){for(;;){var K=this.advanceBuffer(M);if(K)this.emit("chunk",{status:C,data:K});else break}this.isBufferTooLong(M)&&this.emit("buffer_too_long")}advanceBuffer(C){var M=C.slice(this.position),K=M.indexOf(` 3889`);return K!==-1?(this.position+=K+1,M.slice(0,K)):null}isBufferTooLong(C){return this.position===C.length&&C.length>jr}}var ka;(function(D){D[D.CONNECTING=0]="CONNECTING",D[D.OPEN=1]="OPEN",D[D.CLOSED=3]="CLOSED"})(ka||(ka={}));var cr=ka,mu=1;class Ro{constructor(C,M){this.hooks=C,this.session=Ao(1e3)+"/"+yc(8),this.location=Ws(M),this.readyState=cr.CONNECTING,this.openStream()}send(C){return this.sendRaw(JSON.stringify([C]))}ping(){this.hooks.sendHeartbeat(this)}close(C,M){this.onClose(C,M,!0)}sendRaw(C){if(this.readyState===cr.OPEN)try{return oe.createSocketRequest("POST",Hs(vc(this.location,this.session))).start(C),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(C,M,K){this.closeStream(),this.readyState=cr.CLOSED,this.onclose&&this.onclose({code:C,reason:M,wasClean:K})}onChunk(C){if(C.status===200){this.readyState===cr.OPEN&&this.onActivity();var M,K=C.data.slice(0,1);switch(K){case"o":M=JSON.parse(C.data.slice(1)||"{}"),this.onOpen(M);break;case"a":M=JSON.parse(C.data.slice(1)||"[]");for(var te=0;te<M.length;te++)this.onEvent(M[te]);break;case"m":M=JSON.parse(C.data.slice(1)||"null"),this.onEvent(M);break;case"h":this.hooks.onHeartbeat(this);break;case"c":M=JSON.parse(C.data.slice(1)||"[]"),this.onClose(M[0],M[1],!0);break}}}onOpen(C){this.readyState===cr.CONNECTING?(C&&C.hostname&&(this.location.base=Mn(this.location.base,C.hostname)),this.readyState=cr.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(C){this.readyState===cr.OPEN&&this.onmessage&&this.onmessage({data:C})}onActivity(){this.onactivity&&this.onactivity()}
3889onError(C){this.onerror&&this.onerror(C)}openStream(){this.stream=oe.createSocketRequest("POST",Hs(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",C=>{this.onChunk(C)}),this.stream.bind("finished",C=>{this.hooks.onFinished(this,C)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(C){Ie.defer(()=>{this.onError(C),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function Ws(D){var C=/([^\?]*)\/*(\??.*)/.exec(D);return{base:C[1],queryString:C[2]}}function vc(D,C){return D.base+"/"+C+"/xhr_send"}function Hs(D){var C=D.indexOf("?")===-1?"?":"&";return D+C+"t="+ +new Date+"&n="+mu++}function Mn(D,C){var M=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(D);return M[1]+C+M[3]}function Ao(D){return oe.randomInt(D)}function yc(D){for(var C=[],M=0;M<D;M++)C.push(Ao(32).toString(32));return C.join("")}var is=Ro,Io={getReceiveURL:function(D,C){return D.base+"/"+C+"/xhr_streaming"+D.queryString},onHeartbeat:function(D){D.sendRaw("[]")},sendHeartbeat:function(D){D.sendRaw("[]")},onFinished:function(D,C){D.onClose(1006,"Connection interrupted ("+C+")",!1)}},zn=Io,O={getReceiveURL:function(D,C){return D.base+"/"+C+"/xhr"+D.queryString},onHeartbeat:function(){},sendHeartbeat:function(D){D.sendRaw("[]")},onFinished:function(D,C){C===200?D.reconnect():D.onClose(1006,"Connection interrupted ("+C+")",!1)}},U=O,W={getRequest:function(D){var C=oe.getXHRAPI(),M=new C;return M.onreadystatechange=M.onprogress=function(){switch(M.readyState){case 3:M.responseText&&M.responseText.length>0&&D.onChunk(M.status,M.responseText);break;case 4:M.responseText&&M.responseText.length>0&&D.onChunk(M.status,M.responseText),D.emit("finished",M.status),D.close();break}},M},abortRequest:function(D){D.onreadystatechange=null,D.abort()}},q=W,Z={createStreamingSocket(D){return this.createSocket(zn,D)},createPollingSocket(D){return this.createSocket(U,D)},createSocket(D,C){return new is(D,C)},createXHR(D,C){return this.createRequest(q,D,C)},createRequest(D,C,M){return new qr(D,C,M)}},ge=Z;ge.createXDR=function(D,C){return this.createRequest(Jr,D,C)};var me=ge,$e={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:s,DependenciesReceivers:l,getDefaultStrategy:zs,Transports:Sn,transportConnectionInitializer:gc,HTTPFactory:me,TimelineTransport:Gr,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(D){window.Pusher=D;var C=()=>{this.onDocumentBody(D.ready)};window.JSON?C():d.load("json2",{},C)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:N,jsonp:Jn}},onDocumentBody(D){document.body?D():setTimeout(()=>{this.onDocumentBody(D)},0)},createJSONPRequest(D,C){return new sr(D,C)},createScriptRequest(D){return new rn(D)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var D=this.getXHRAPI();return new D},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return uu},createWebSocket(D){var C=this.getWebSocketAPI();return new C(D)},createSocketRequest(D,C){if(this.isXHRSupported())return this.HTTPFactory.createXHR(D,C);if(this.isXDRSupported(C.indexOf("https:")===0))return this.HTTPFactory.createXDR(D,C);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var D=this.getXHRAPI();return!!D&&new D().withCredentials!==void 0},isXDRSupported(D){var C=D?"https:":"http:",M=this.getProtocol();return!!window.XDomainRequest&&M===C},addUnloadListener(D){window.addEventListener!==void 0?window.addEventListener("unload",D,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",D)},removeUnloadListener(D){window.addEventListener!==void 0?window.removeEventListener("unload",D,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",D)},randomInt(D){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*D)}},oe=$e,T;(function(D){D[D.ERROR=3]="ERROR",D[D.INFO=6]="INFO",D[D.DEBUG=7]="DEBUG"})(T||(T={}));var $=T;class Y{constructor(C,M,K){this.key=C,this.session=M,this.events=[],this.options=K||{},this.sent=0,this.uniqueID=0}log(C,M){C<=this.options.level&&(this.events.push(He({},M,{timestamp:Ie.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(C){this.log($.ERROR,C)}info(C){this.log($.INFO,C)}debug(C){this.log($.DEBUG,C)}isEmpty(){return this.events.length===0}
3889send(C,M){var K=He({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],C(K,(te,Te)=>{te||this.sent++,M&&M(te,Te)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class le{constructor(C,M,K,te){this.name=C,this.priority=M,this.transport=K,this.options=te||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(C,M){if(this.isSupported()){if(this.priority<C)return Oe(new S,M)}else return Oe(new I,M);var K=!1,te=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),Te=null,ze=function(){te.unbind("initialized",ze),te.connect()},tt=function(){Te=Vn.createHandshake(te,function(er){K=!0,vn(),M(null,er)})},At=function(er){vn(),M(er)},on=function(){vn();var er;er=xn(te),M(new w(er))},vn=function(){te.unbind("initialized",ze),te.unbind("open",tt),te.unbind("error",At),te.unbind("closed",on)};return te.bind("initialized",ze),te.bind("open",tt),te.bind("error",At),te.bind("closed",on),te.initialize(),{abort:()=>{K||(vn(),Te?Te.close():te.close())},forceMinPriority:er=>{K||this.priority<er&&(Te?Te.close():te.close())}}}}function Oe(D,C){return Ie.defer(function(){C(D)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Re}=oe;var Qe=function(D,C,M,K,te,Te){var ze=Re[M];if(!ze)throw new E(M);var tt=(!D.enabledTransports||Je(D.enabledTransports,C)!==-1)&&(!D.disabledTransports||Je(D.disabledTransports,C)===-1),At;return tt?(te=Object.assign({ignoreNullOrigin:D.ignoreNullOrigin},te),At=new le(C,K,Te?Te.getAssistant(ze):ze,te)):At=je,At},je={isSupported:function(){return!1},connect:function(D,C){var M=Ie.defer(function(){C(new I)});return{abort:function(){M.ensureAborted()},forceMinPriority:function(){}}}};function it(D){if(D==null)throw"You must pass an options object";if(D.cluster==null)throw"Options object must provide a cluster";"disableStats"in D&&St.warn("The disableStats option is deprecated in favor of enableStats")}const Xe=(D,C)=>{var M="socket_id="+encodeURIComponent(D.socketId);for(var K in C.params)M+="&"+encodeURIComponent(K)+"="+encodeURIComponent(C.params[K]);if(C.paramsProvider!=null){let te=C.paramsProvider();for(var K in te)M+="&"+encodeURIComponent(K)+"="+encodeURIComponent(te[K])}return M};var Mt=D=>{if(typeof oe.getAuthorizers()[D.transport]>"u")throw`'${D.transport}' is not a recognized auth transport`;return(C,M)=>{const K=Xe(C,D);oe.getAuthorizers()[D.transport](oe,K,D,v.UserAuthentication,M)}};const bt=(D,C)=>{var M="socket_id="+encodeURIComponent(D.socketId);M+="&channel_name="+encodeURIComponent(D.channelName);for(var K in C.params)M+="&"+encodeURIComponent(K)+"="+encodeURIComponent(C.params[K]);if(C.paramsProvider!=null){let te=C.paramsProvider();for(var K in te)M+="&"+encodeURIComponent(K)+"="+encodeURIComponent(te[K])}return M};var Yt=D=>{if(typeof oe.getAuthorizers()[D.transport]>"u")throw`'${D.transport}' is not a recognized auth transport`;return(C,M)=>{const K=bt(C,D);oe.getAuthorizers()[D.transport](oe,K,D,v.ChannelAuthorization,M)}};const ca=(D,C,M)=>{const K={authTransport:C.transport,authEndpoint:C.endpoint,auth:{params:C.params,headers:C.headers}};return(te,Te)=>{const ze=D.channel(te.channelName);M(ze,K).authorize(te.socketId,Te)}};function Sa(D,C){let M={activityTimeout:D.activityTimeout||c.activityTimeout,cluster:D.cluster,httpPath:D.httpPath||c.httpPath,httpPort:D.httpPort||c.httpPort,httpsPort:D.httpsPort||c.httpsPort,pongTimeout:D.pongTimeout||c.pongTimeout,statsHost:D.statsHost||c.stats_host,unavailableTimeout:D.unavailableTimeout||c.unavailableTimeout,wsPath:D.wsPath||c.wsPath,wsPort:D.wsPort||c.wsPort,wssPort:D.wssPort||c.wssPort,enableStats:ua(D),httpHost:Vs(D),useTLS:vu(D),wsHost:yd(D),userAuthenticator:m1(D),channelAuthorizer:g1(D,C)};return"disabledTransports"in D&&(M.disabledTransports=D.disabledTransports),"enabledTransports"in D&&(M.enabledTransports=D.enabledTransports),"ignoreNullOrigin"in D&&(M.ignoreNullOrigin=D.ignoreNullOrigin),"timelineParams"in D&&(M.timelineParams=D.timelineParams),"nacl"in D&&(M.nacl=D.nacl),M}function Vs(D){return D.httpHost?D.httpHost:D.cluster?`sockjs-${D.cluster}.pusher.com`:c.httpHost}function yd(D){return D.wsHost?D.wsHost:gu(D.cluster)}function gu(D){return`ws-${D}.pusher.com`}function vu(D){return oe.getProtocol()==="https:"?!0:D.forceTLS!==!1}function ua(D){return"enableStats"in D?D.enableStats:"disableStats"in D?!D.disableStats:!1}function m1(D){const C=Object.assign(Object.assign({},c.userAuthentication),D.userAuthentication);return"customHandler"in C&&C.customHandler!=null?C.customHandler:Mt(C)}function la(D,C){let M;return"channelAuthorization"in D?M=Object.assign(Object.assign({},c.channelAuthorization),D.channelAuthorization):(M={transport:D.authTransport||c.authTransport,endpoint:D.authEndpoint||c.authEndpoint},"auth"in D&&("params"in D.auth&&(M.params=D.auth.params),"headers"in D.auth&&(M.headers=D.auth.headers)),"authorizer"in D&&(M.customHandler=ca(C,M,D.authorizer))),M}function g1(D,C){const M=la(D,C);return"customHandler"in M&&M.customHandler!=null?M.customHandler:Yt(M)}class Tv extends Zn{constructor(C){super(function(M,K){St.debug(`No callbacks on watchlist events for ${M}`)}
3889),this.pusher=C,this.bindWatchlistInternalEvent()}handleEvent(C){C.data.events.forEach(M=>{this.emit(M.name,M)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",C=>{var M=C.event;M==="pusher_internal:watchlist_events"&&this.handleEvent(C)})}}function _c(){let D,C;return{promise:new Promise((K,te)=>{D=K,C=te}),resolve:D,reject:C}}var jf=_c;class Wp extends Zn{constructor(C){super(function(M,K){St.debug("No callbacks on user for "+M)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(M,K)=>{if(M){St.warn(`Error during signin: ${M}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:K.auth,user_data:K.user_data})},this.pusher=C,this.pusher.connection.bind("state_change",({previous:M,current:K})=>{M!=="connected"&&K==="connected"&&this._signin(),M==="connected"&&K!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new Tv(C),this.pusher.connection.bind("message",M=>{var K=M.event;K==="pusher:signin_success"&&this._onSigninSuccess(M.data),this.serverToUserChannel&&this.serverToUserChannel.name===M.channel&&this.serverToUserChannel.handleEvent(M)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(C){try{this.user_data=JSON.parse(C.user_data)}catch{St.error(`Failed parsing user data after signin: ${C.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){St.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const C=M=>{M.subscriptionPending&&M.subscriptionCancelled?M.reinstateSubscription():!M.subscriptionPending&&this.pusher.connection.state==="connected"&&M.subscribe()};this.serverToUserChannel=new So(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((M,K)=>{M.indexOf("pusher_internal:")===0||M.indexOf("pusher:")===0||this.emit(M,K)}),C(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:C,resolve:M}=jf();C.done=!1;const K=()=>{C.done=!0};C.then(K).catch(K),this.signinDonePromise=C,this._signinDoneResolve=M}}class Lt{static ready(){Lt.isReady=!0;for(var C=0,M=Lt.instances.length;C<M;C++)Lt.instances[C].connect()}static getClientFeatures(){return Ut(kt({ws:oe.Transports.ws},function(C){return C.isSupported({})}))}constructor(C,M){Hp(C),it(M),this.key=C,this.config=Sa(M,this),this.channels=Vn.createChannels(),this.global_emitter=new Zn,this.sessionID=oe.randomInt(1e9),this.timeline=new Y(this.key,this.sessionID,{cluster:this.config.cluster,features:Lt.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:$.INFO,version:c.VERSION}),this.config.enableStats&&(this.timelineSender=Vn.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+oe.TimelineTransport.name}));var K=te=>oe.getDefaultStrategy(this.config,te,Qe);this.connection=Vn.createConnectionManager(this.key,{getStrategy:K,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",te=>{var Te=te.event,ze=Te.indexOf("pusher_internal:")===0;if(te.channel){var tt=this.channel(te.channel);tt&&tt.handleEvent(te)}ze||this.global_emitter.emit(te.event,te.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",te=>{St.warn(te)}),Lt.instances.push(this),this.timeline.info({instances:Lt.instances.length}),this.user=new Wp(this),Lt.isReady&&this.connect()}channel(C){return this.channels.find(C)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var
3889C=this.connection.isUsingTLS(),M=this.timelineSender;this.timelineSenderTimer=new Fe(6e4,function(){M.send(C)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(C,M,K){return this.global_emitter.bind(C,M,K),this}unbind(C,M,K){return this.global_emitter.unbind(C,M,K),this}bind_global(C){return this.global_emitter.bind_global(C),this}unbind_global(C){return this.global_emitter.unbind_global(C),this}unbind_all(C){return this.global_emitter.unbind_all(),this}subscribeAll(){var C;for(C in this.channels.channels)this.channels.channels.hasOwnProperty(C)&&this.subscribe(C)}subscribe(C){var M=this.channels.add(C,this);return M.subscriptionPending&&M.subscriptionCancelled?M.reinstateSubscription():!M.subscriptionPending&&this.connection.state==="connected"&&M.subscribe(),M}unsubscribe(C){var M=this.channels.find(C);M&&M.subscriptionPending?M.cancelSubscription():(M=this.channels.remove(C),M&&M.subscribed&&M.unsubscribe())}send_event(C,M,K){return this.connection.send_event(C,M,K)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}Lt.instances=[],Lt.isReady=!1,Lt.logToConsole=!1,Lt.Runtime=oe,Lt.ScriptReceivers=oe.ScriptReceivers,Lt.DependenciesReceivers=oe.DependenciesReceivers,Lt.auth_callbacks=oe.auth_callbacks;var Gs=r.default=Lt;function Hp(D){if(D==null)throw"You must pass your app key when you instantiate Pusher."}oe.setup(Lt)}])})})(jF);var vge=jF.exports;const yge=id(vge),_ge={components:{AdminLayout:Gt},props:{users:{type:Array,required:!0}},data(){return{onlineUsers:[],connectionStatus:"disconnected",presenceChannel:null}},computed:{allUsers(){return this.users||[]},connectionStatusText(){switch(this.connectionStatus){case"connected":return"Connected";case"connecting":return"Connecting...";case"disconnected":return"Disconnected";default:return"Unknown"}}},mounted(){this.initializePresence()},beforeUnmount(){this.disconnectPresence()},methods:{initializePresence(){window.Echo||(window.Pusher=yge,window.Echo=new gge({broadcaster:"pusher",key:void 0,cluster:void 0,forceTLS:!0,encrypted:!0})),this.connectToPresence()},connectToPresence(){this.connectionStatus="connecting",window.Echo.connector.pusher.connection.bind("state_change",n=>{this.connectionStatus=n.current}),this.presenceChannel=window.Echo.join("admin-presence").here(n=>{this.onlineUsers=n}).joining(n=>{this.onlineUsers.find(e=>e.id===n.id)||this.onlineUsers.push(n)}).leaving(n=>{this.onlineUsers=this.onlineUsers.filter(e=>e.id!==n.id)}).error(n=>{this.connectionStatus="error"})},disconnectPresence(){this.presenceChannel&&(window.Echo.leave("admin-presence"),this.presenceChannel=null,this.onlineUsers=[],this.connectionStatus="disconnected")},isUserOnline(n){return this.onlineUsers.some(e=>e.id===n)}}};var bge=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-semibold text-xl text-gray-800 leading-tight"},[e._v(" Online Users ")])]},proxy:!0}])},[t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8"},[t("div",{staticClass:"bg-white overflow-hidden shadow-xl sm:rounded-lg p-6"},[t("div",{staticClass:"mb-4 flex items-center justify-between"},[t("h3",{staticClass:"text-lg font-medium"},[e._v("Admin Users ("+e._s(e.allUsers.length)+")")]),t("div",{staticClass:"flex items-center"},[t("span",{class:["h-3 w-3 rounded-full mr-2",e.connectionStatus==="connected"?"bg-green-500":e.connectionStatus==="connecting"?"bg-yellow-500":"bg-red-500"]}),t("span",{staticClass:"text-sm text-gray-600"},[e._v(" "+e._s(e.connectionStatusText)+" ")]),e.onlineUsers.length>0?t("span",{staticClass:"ml-4 text-sm text-green-600"},[e._v(" "+e._s(e.onlineUsers.length)+" online ")]):e._e()])]),e.allUsers.length===0?t("div",{staticClass:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4"},e._l(3,function(r){return t("div",{key:r,staticClass:"bg-white rounded-lg shadow p-6 animate-pulse"},[t("div",{staticClass:"h-4 bg-gray-200 rounded w-3/4 mb-4"}),t("div",{staticClass:"h-4 bg-gray-200 rounded w-1/2"}),t("div",{staticClass:"mt-4 flex items-center"},[t("div",{staticClass:"h-3 w-3 rounded-full bg-gray-200 mr-2"}),t("div",{staticClass:"h-4 bg-gray-200 rounded w-1/4"})])])}),0):t("div",{staticClass:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4"},e._l(e.allUsers,function(r){return t("div",{key:r.id,staticClass:"bg-white rounded-lg shadow p-6"},[t("h3",{staticClass:"text-lg font-semibold"},[e._v(e._s(r.name))]),t("p",{staticClass:"text-gray-600"},[e._v(e._s(r.email))]),r.roles&&r.roles.length>0?t("p",{staticClass:"text-sm text-gray-500 mt-1"},[e._v(" "+e._s(r.roles.map(i=>
3889i.name).join(", "))+" ")]):e._e(),t("div",{staticClass:"mt-4 flex items-center"},[t("span",{class:["h-3 w-3 rounded-full mr-2",e.isUserOnline(r.id)?"bg-green-500":"bg-gray-300"]}),t("span",{staticClass:"text-sm text-gray-600"},[e._v(" "+e._s(e.isUserOnline(r.id)?"Online":"Offline")+" ")])])])}),0)])])])},xge=[],wge=ve(_ge,bge,xge,!1,null,null);const Cge=wge.exports,kge=Object.freeze(Object.defineProperty({__proto__:null,default:Cge},Symbol.toStringTag,{value:"Module"})),Sge={components:{AdminLayout:Gt,JetButton:mn,JetInput:Rn,JetInputError:ea,JetLabel:Un},props:{permissionGroups:Object},data(){return{form:this.$inertia.form({name:"",permissions:[]})}},methods:{submit(){this.form.post(route("admin.roles.store"),{preserveScroll:!0})}}};var Tge=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight"},[e._v(" Create New Role ")])]},proxy:!0}])},[t("div",{staticClass:"py-12"},[t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8"},[t("div",{staticClass:"bg-white overflow-hidden shadow-xl sm:rounded-lg"},[t("form",{staticClass:"p-6 bg-white border-b border-gray-200",on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",[t("jet-label",{attrs:{for:"name",value:"Role Name"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"name",type:"text",required:"",autofocus:""}
3889,model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.name}})],1),t("div",{staticClass:"mt-6"},[t("jet-label",{attrs:{value:"Permissions"}}),e._l(e.permissionGroups,function(r,i){return t("div",{key:i,staticClass:"mt-4"},[t("h3",{staticClass:"font-semibold text-gray-700 capitalize mb-2"},[e._v(e._s(i))]),t("div",{staticClass:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},e._l(r,function(a){return t("div",{key:a.id},[t("label",{staticClass:"inline-flex items-center"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.permissions,expression:"form.permissions"}],staticClass:"rounded border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50",attrs:{type:"checkbox"},domProps:{value:a.name,checked:Array.isArray(e.form.permissions)?e._i(e.form.permissions,a.name)>-1:e.form.permissions},on:{change:function(s){var o=e.form.permissions,c=s.target,u=!!c.checked;if(Array.isArray(o)){var l=a.name,d=e._i(o,l);c.checked?d<0&&e.$set(e.form,"permissions",o.concat([l])):d>-1&&e.$set(e.form,"permissions",o.slice(0,d).concat(o.slice(d+1)))}else e.$set(e.form,"permissions",u)}}}),t("span",{staticClass:"ml-2 text-sm text-gray-600"},[e._v(e._s(a.name))])])])}),0)])}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.permissions}})],2),t("div",{staticClass:"flex items-center justify-end mt-6"},[t("inertia-link",{staticClass:"inline-flex items-center px-4 py-2 bg-gray-200 border border-transparent rounded-md font-semibold text-xs text-gray-700 uppercase tracking-widest hover:bg-gray-300 active:bg-gray-400 focus:outline-none focus:border-gray-500 focus:ring focus:ring-gray-300 disabled:opacity-25 transition mr-2",attrs:{href:e.route("admin.roles.index")}},[e._v(" Cancel ")]),t("jet-button",{staticClass:"ml-4",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" Create Role ")])],1)])])])])])},Ege=[],Pge=ve(Sge,Tge,Ege,!1,null,null);const Rge=Pge.exports,Age=Object.freeze(Object.defineProperty({__proto__:null,default:Rge},Symbol.toStringTag,{value:"Module"})),Ige={components:{AdminLayout:Gt,JetButton:mn,JetInput:Rn,JetInputError:ea,JetLabel:Un},props:{role:Object,permissionGroups:Object},data(){return{form:this.$inertia.form({name:this.role.name,permissions:this.role.permissions.map(n=>n.name)})}},methods:{submit(){this.form.put(route("admin.roles.update",this.role.id),{preserveScroll:!0})}}};var Oge=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight"},[e._v(" Edit Role: "+e._s(e.role.name)+" ")])]},proxy:!0}])},[t("div",{staticClass:"py-12"},[t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8"},[t("div",{staticClass:"bg-white overflow-hidden shadow-xl sm:rounded-lg"},[t("form",{staticClass:"p-6 bg-white border-b border-gray-200",on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",[t("jet-label",{attrs:{for:"name",value:"Role Name"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"name",type:"text",required:"",disabled:e.role.name==="Admin"}
3889,model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.name}})],1),t("div",{staticClass:"mt-6"},[t("jet-label",{attrs:{value:"Permissions"}}),e._l(e.permissionGroups,function(r,i){return t("div",{key:i,staticClass:"mt-4"},[t("h3",{staticClass:"font-semibold text-gray-700 capitalize mb-2"},[e._v(e._s(i))]),t("div",{staticClass:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},e._l(r,function(a){return t("div",{key:a.id},[t("label",{staticClass:"inline-flex items-center"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.permissions,expression:"form.permissions"}],staticClass:"rounded border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50",attrs:{type:"checkbox",disabled:e.role.name==="Admin"},domProps:{value:a.name,checked:Array.isArray(e.form.permissions)?e._i(e.form.permissions,a.name)>-1:e.form.permissions},on:{change:function(s){var o=e.form.permissions,c=s.target,u=!!c.checked;if(Array.isArray(o)){var l=a.name,d=e._i(o,l);c.checked?d<0&&e.$set(e.form,"permissions",o.concat([l])):d>-1&&e.$set(e.form,"permissions",o.slice(0,d).concat(o.slice(d+1)))}else e.$set(e.form,"permissions",u)}}}),t("span",{staticClass:"ml-2 text-sm text-gray-600"},[e._v(e._s(a.name))])])])}),0)])}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.permissions}})],2),t("div",{staticClass:"flex items-center justify-end mt-6"},[t("inertia-link",{staticClass:"inline-flex items-center px-4 py-2 bg-gray-200 border border-transparent rounded-md font-semibold text-xs text-gray-700 uppercase tracking-widest hover:bg-gray-300 active:bg-gray-400 focus:outline-none focus:border-gray-500 focus:ring focus:ring-gray-300 disabled:opacity-25 transition mr-2",attrs:{href:e.route("admin.roles.index")}},[e._v(" Cancel ")]),e.role.name!=="Admin"?t("jet-button",{staticClass:"ml-4",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" Update Role ")]):e._e()],1)])])])])])},Mge=[],Dge=ve(Ige,Oge,Mge,!1,null,null);const Nge=Dge.exports,Lge=Object.freeze(Object.defineProperty({__proto__:null,default:Nge},Symbol.toStringTag,{value:"Module"})),Fge={components:{AdminLayout:Gt},props:{roles:Array,permissionGroups:Object},methods:{deleteRole(n){confirm(`Are you sure you want to delete the role "${n.name}"?`)&&Gi.Inertia.delete(route("admin.roles.destroy",n.id))}}};var $ge=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"flex justify-between items-center"},[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight"},[e._v(" Role Management ")]),t("inertia-link",{staticClass:"inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:ring focus:ring-gray-300 disabled:opacity-25 transition",attrs:{href:e.route("admin.roles.create")}},[e._v(" Create New Role ")])],1)]},proxy:!0}])},[t("div",{staticClass:"py-12"},[t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8"},[t("div",{staticClass:"bg-white overflow-hidden shadow-xl sm:rounded-lg"},[t("div",{staticClass:"p-6 bg-white border-b border-gray-200"},[t("div",{staticClass:"overflow-x-auto"},[t("table",{staticClass:"min-w-full divide-y divide-gray-200"},[t("thead",{staticClass:"bg-gray-50"},[t("tr",[t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Role Name ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Permissions ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Actions ")])])]),t("tbody",{staticClass:"bg-white divide-y divide-gray-200"},e._l(e.roles,function(r){return t("tr",{key:r.id},[t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[t("div",{staticClass:"text-sm font-medium text-gray-900"},[e._v(" "+e._s(r.name)+" ")])]),t("td",{staticClass:"px-6 py-4"},[t("div",{staticClass:"flex flex-wrap gap-2"},e._l(r.permissions,function(i){return t("span",{key:i.id,staticClass:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800"},[e._v(" "+e._s(i.name)+" ")])}),0)]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium"},[t("inertia-link",{staticClass:"text-indigo-600 hover:text-indigo-900 mr-4",attrs:{href:e.route("admin.roles.edit",r.id)}},[e._v(" Edit ")]),r.name!=="Admin"?t("button",{staticClass:"text-red-600 hover:text-red-900",on:{click:function(i){return e.deleteRole(r)}}}
3889,[e._v(" Delete ")]):e._e()],1)])}),0)])])])])])])])},Bge=[],Uge=ve(Fge,$ge,Bge,!1,null,null);const jge=Uge.exports,qge=Object.freeze(Object.defineProperty({__proto__:null,default:jge},Symbol.toStringTag,{value:"Module"})),zge={methods:{},props:["title","explainer","value","icon"]};var Wge=function(){var e=this,t=e._self._c;return t("div",{},[t("div",{staticClass:"bg-white rounded shadow-lg h-full"},[t("div",{staticClass:"px-4 py-4 flex flex-col justify-between"},[t("div",{staticClass:"flex flex-col"},[t("div",{staticClass:"flex flex-row"},[e._t("icon"),t("p",{staticClass:"ml-1 font-bold"},[e._v(e._s(e.title))])],2),t("p",{staticClass:"text-gray-700 text-sm"},[e._v(e._s(e.explainer))])]),t("div",{staticClass:"flex flex-col"},[t("p",{staticClass:"font-bold text-4xl text-center mt-2"},[e._v(" "+e._s(e.value)+" ")])])])])])},Hge=[],Vge=ve(zge,Wge,Hge,!1,null,null);const Gge=Vge.exports,Kge={props:[],components:{AdminLayout:Gt,ScoreCard:Gge},created(){this.getTotalUsers(),this.getTotalUsersToday(),this.getTotalUsersActive(),this.getTotalUsersPendingInvite(),this.getTotalUsersExpiredInvite(),this.getTotalUsersWebshop(),this.getTotalUsersTicket(),this.getSubscriptionChecks()},data(){return{totalUsers:0,usersToday:0,activeUsers:0,pendingInviteUsers:0,expiredInviteUsers:0,webshopUsers:0,ticketUsers:0,subscriptionStats:null}},methods:{getTotalUsers(){return this.fetching=!0,axios.get("stats/total-users").then(n=>{this.totalUsers=n.data,this.fetching=!1})},getTotalUsersToday(){return this.fetching=!0,axios.get("stats/total-users-today").then(n=>{this.usersToday=n.data})},getTotalUsersActive(){return this.fetching=!0,axios.get("stats/total-users-active").then(n=>{this.activeUsers=n.data})},getTotalUsersPendingInvite(){return this.fetching=!0,axios.get("stats/total-users-pending-invite").then(n=>{this.pendingInviteUsers=n.data})},getTotalUsersExpiredInvite(){return this.fetching=!0,axios.get("stats/total-users-expired-invite").then(n=>{this.expiredInviteUsers=n.data})},getTotalUsersWebshop(){return this.fetching=!0,axios.get("stats/total-users-webshop").then(n=>{this.webshopUsers=n.data})},getTotalUsersTicket(){return this.fetching=!0,axios.get("stats/total-users-ticket").then(n=>{this.ticketUsers=n.data})},getSubscriptionChecks(){return axios.get("stats/subscription-checks").then(n=>{this.subscriptionStats=n.data})}},computed:{totalUsersIncrease(){return this.usersToday/(this.totalUsers-this.usersToday)*100},subscriptionTotals(){var n;return((n=this.subscriptionStats)==null?void 0:n.totals)||{}},cacheHitRatePct(){var e;const n=(e=this.subscriptionStats)==null?void 0:e.totals;return!n||!n.total_checks?"â":(n.cache_hit_ratio*100).toFixed(1)+"%"}}};var Yge=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" Admin - Statistics ")])]},proxy:!0}])},[t("div",{staticClass:"grid sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-4"},[t("score-card",{attrs:{title:"Users",value:e.totalUsers,explainer:"Total users in the system"}},[t("svg",{staticClass:"h-6 w-6",attrs:{slot:"icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},slot:"icon"},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"}})])]),t("score-card",{attrs:{title:"Active users",value:e.activeUsers}},[t("svg",{staticClass:"h-6 w-6",attrs:{slot:"icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},slot:"icon"},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"}})])]),t("score-card",{attrs:{title:"Pending invite",explainer:"Users with a pending invite",value:e.pendingInviteUsers}},[t("svg",{staticClass:"h-6 w-6",attrs:{slot:"icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},slot:"icon"},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"}})])]),t("score-card",{attrs:{title:"Expired invite",explainer:"Users with an expired invite (Will be deleted within 14 days",value:e.expiredInviteUsers}},[t("svg",{staticClass:"h-6 w-6",attrs:{slot:"icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},slot:"icon"},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"}})])]),t("score-card",{attrs:{title:"FCKFanshop.dk users",explainer:"Users that has an account at FCK Fanshop",value:e.webshopUsers}},[t("svg",{staticClass:"h-6 w-6",attrs:{slot:"icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},slot:"icon"},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2
38890 014 0z"}})])]),t("score-card",{attrs:{title:"Billet.fck.dk users",explainer:"Users that has an account at Billet.fck.dk",value:e.ticketUsers}},[t("svg",{staticClass:"h-6 w-6",attrs:{slot:"icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},slot:"icon"},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z"}})])])],1),t("h3",{staticClass:"mt-8 mb-3 font-bold text-lg text-gray-800"},[e._v("Subscription checks (last 24h)")]),t("div",{staticClass:"grid sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-4 gap-4"},[t("score-card",{attrs:{title:"Total checks",explainer:"FCK+ subscription checks performed in the last 24 hours",value:e.subscriptionTotals.total_checks||0}},[t("svg",{staticClass:"h-6 w-6",attrs:{slot:"icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},slot:"icon"},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}})])]),t("score-card",{attrs:{title:"Cache hit rate",explainer:"Percent of checks served from cache without hitting Roboticket",value:e.cacheHitRatePct}},[t("svg",{staticClass:"h-6 w-6",attrs:{slot:"icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},slot:"icon"},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"}})])]),t("score-card",{attrs:{title:"Roboticket calls",explainer:"Subscription checks that required a Roboticket API round-trip",value:e.subscriptionTotals.roboticket_calls||0}},[t("svg",{staticClass:"h-6 w-6",attrs:{slot:"icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},slot:"icon"},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M12 5l7 7-7 7"}})])]),t("score-card",{attrs:{title:"Lock timeouts",explainer:"Stampede-protection lock timeouts. Should be near zero â a spike suggests Roboticket is very slow.",value:e.subscriptionTotals.lock_timeouts||0}},[t("svg",{staticClass:"h-6 w-6",attrs:{slot:"icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},slot:"icon"},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}})])])],1)])},Xge=[],Jge=ve(Kge,Yge,Xge,!1,null,null);const Qge=Jge.exports,Zge=Object.freeze(Object.defineProperty({__proto__:null,default:Qge},Symbol.toStringTag,{value:"Module"})),eve={components:{AdminLayout:Gt,JetPagination:Rp},props:{sessions:{type:Object,required:!0},filters:{type:Object,default:()=>({})}},data(){return{search:this.filters.search||"",statusFilter:this.filters.status||"active",fetching:!1}},methods:{performSearch:Y_.debounce(function(){this.fetching=!0,this.$inertia.get(route("admin.video-sessions.index"),{search:this.search,status:this.statusFilter},{preserveState:!0,preserveScroll:!0,replace:!0,onFinish:()=>{this.fetching=!1}})},300),terminateSession(n){confirm("Are you sure you want to terminate this video session?")&&this.$inertia.delete(route("admin.video-sessions.destroy",n.id),{preserveScroll:!0})},truncate(n,e){return n?n.length>e?n.substring(0,e)+"...":n:"-"},formatDate(n){return new Date(n).toLocaleString("da-DK",{dateStyle:"medium",timeStyle:"short",hour12:!1})},timeAgo(n){const e=new Date,t=new Date(n),r=e-t,i=Math.floor(r/1e3),a=Math.floor(i/60),s=Math.floor(a/60),o=Math.floor(s/24);return i<60?`${i}s ago`:a<60?`${a}m ago`:s<24?`${s}h ago`:`${o}
3889d ago`},statusBadgeClass(n){if(!n.is_active||new Date(n.expires_at)<=new Date)return"bg-gray-100 text-gray-800";const e=new Date(n.last_heartbeat),r=(new Date-e)/1e3;return r>300?"bg-red-100 text-red-800":r>120?"bg-yellow-100 text-yellow-800":"bg-green-100 text-green-800"},statusLabel(n){if(!n.is_active||new Date(n.expires_at)<=new Date)return"Expired";const e=new Date(n.last_heartbeat),r=(new Date-e)/1e3;return r>300?"Stale":r>120?"Idle":"Active"}}};var tve=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"flex flex-col space-y-4 relative z-0"},[t("div",{staticClass:"flex justify-between items-center"},[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight"},[e._v(" Video Sessions ")])]),t("div",{staticClass:"flex items-center space-x-3"},[t("select",{directives:[{name:"model",rawName:"v-model",value:e.statusFilter,expression:"statusFilter"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-lg shadow-sm text-sm",on:{change:[function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.statusFilter=r.target.multiple?i:i[0]},e.performSearch]}},[t("option",{attrs:{value:"active"}},[e._v("Active")]),t("option",{attrs:{value:"idle"}},[e._v("Idle")]),t("option",{attrs:{value:"stale"}},[e._v("Stale")]),t("option",{attrs:{value:"expired"}},[e._v("Expired / Terminated")]),t("option",{attrs:{value:"all"}},[e._v("All Sessions")])]),t("div",{staticClass:"relative flex-1"},[t("div",{staticClass:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[t("svg",{staticClass:"h-5 w-5 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"}})])]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],staticClass:"pl-10 w-full border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-lg shadow-sm",attrs:{type:"text",placeholder:"Search by user, entry ID, device, IP..."},domProps:{value:e.search},on:{input:[function(r){r.target.composing||(e.search=r.target.value)},e.performSearch]}})]),e.fetching?t("svg",{staticClass:"animate-spin w-5 h-5 flex-shrink-0 text-gray-500",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[t("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]):e._e()])])]},proxy:!0},{key:"footer",fn:function(){return[e.sessions.data.length>0?t("jet-pagination",{staticClass:"mt-6",attrs:{total:e.sessions.total,per_page:e.sessions.per_page,current_page:e.sessions.current_page,last_page:e.sessions.last_page,first_page_url:e.sessions.first_page_url,last_page_url:e.sessions.last_page_url,next_page_url:e.sessions.next_page_url,prev_page_url:e.sessions.prev_page_url,path:e.sessions.path,from:e.sessions.from,to:e.sessions.to,data:e.sessions.data,search:e.search}}):e._e()]},proxy:!0}])},[t("div",{staticClass:"py-6"},[t("div",{staticClass:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"},[t("div",{staticClass:"bg-white overflow-hidden shadow-xl sm:rounded-lg"},[t("div",{staticClass:"overflow-x-auto"},[t("table",{staticClass:"min-w-full divide-y divide-gray-200"},[t("thead",{staticClass:"bg-gray-50"},[t("tr",[t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v("User")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v("Entry ID")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v("Device")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v("Device ID")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v("IP Address")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v("Last Heartbeat")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v("Status")]),t("th",{staticClass:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v("Actions")])])]),t("tbody",{staticClass:"bg-white divide-y divide-gray-200"},[e._l(e.sessions.data,function(r){return t("tr",{key:r.id},[t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[r.user?t("div",{staticClass:"text-sm"},[t("div",{staticClass:"text-gray-900"},[e._v(e._s(r.user.firstname)+" "+e._s(r.user.lastname))]),t("div",{staticClass:"text-gray-500"},[e._v(e._s(r.user.email))])]):t("span",{staticClass:"text-sm text-gray-400"},[e._v("Anonymous")])]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 font-mono"},[t("span",{attrs:{title:r.entry_id}},[e._v(e._s(e.truncate(r.entry_id,20)))])]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},[r.device_type||r.device_name?t("div",[r.device_type?t("div",{staticClass:"text-gray-900"}
3889,[e._v(e._s(r.device_type))]):e._e(),r.device_name?t("div",{staticClass:"text-gray-400 text-xs"},[e._v(e._s(r.device_name))]):e._e()]):t("span",{staticClass:"text-gray-400"},[e._v("-")])]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 font-mono"},[t("span",{attrs:{title:r.device_id}},[e._v(e._s(e.truncate(r.device_id,20)))])]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 font-mono"},[e._v(" "+e._s(r.ip_address)+" ")]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},[t("span",{attrs:{title:e.formatDate(r.last_heartbeat)}},[e._v(e._s(e.timeAgo(r.last_heartbeat)))])]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[t("span",{staticClass:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",class:e.statusBadgeClass(r)},[e._v(" "+e._s(e.statusLabel(r))+" ")])]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-right text-sm"},[r.is_active?t("button",{staticClass:"text-red-600 hover:text-red-900 font-medium",on:{click:function(i){return e.terminateSession(r)}}},[e._v(" Terminate ")]):t("span",{staticClass:"text-gray-400"},[e._v("Terminated")])])])}),e.sessions.data.length===0?t("tr",[t("td",{staticClass:"px-6 py-12 text-center text-sm text-gray-500",attrs:{colspan:"8"}},[e._v(" No video sessions found. ")])]):e._e()],2)])])])])])])},nve=[],rve=ve(eve,tve,nve,!1,null,null);const ive=rve.exports,ave=Object.freeze(Object.defineProperty({__proto__:null,default:ive},Symbol.toStringTag,{value:"Module"})),sve={components:{AppLayout:ta},mounted(){},props:{profileAgreement:{type:Object,required:!1,default:()=>null},awayAgreement:{type:Object,required:!1,default:()=>null},userProfileAgreement:{type:Object,required:!1,default:()=>null},userAwayAgreement:{type:Object,required:!1,default:()=>null},userAwayApplication:{type:Boolean,required:!1,default:!1}},methods:{acceptAgreement(n){Gi.Inertia.post(route("agreements.accept"),{agreement_id:n})}},computed:{agreementList(){const n=[];return this.userProfileAgreement||n.push(this.$trans("pages.agreements.profileAgreement")),!this.userAwayAgreement&&this.userAwayApplication&&n.push(this.$trans("pages.agreements.awayAgreement")),n}}};var ove=function(){var r,i;var e=this,t=e._self._c;return t("app-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("pages.agreements.agreements"))+" ")])]},proxy:!0}])},[e.agreementList.length>0?t("div",{staticClass:"max-w-7xl mx-auto pt-6 lg:pt-8"},[t("div",{staticClass:"bg-blue-100 border-l-4 border-blue-500 text-blue-700 p-4",attrs:{role:"alert"}},[t("p",{staticClass:"font-bold"},[e._v(e._s(e.$trans("pages.agreements.agreements")))]),t("p",[e._v(e._s(e.$trans("pages.agreements.pleaseAccept"))+e._s(e.agreementList.length>0?e.agreementList.join(", "):""))])])]):e._e(),t("div",{staticClass:"pt-6 lg:pt-8"},[t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8"},[t("div",{staticClass:"bg-white overflow-hidden shadow-xl sm:rounded-lg p-2 md:py-4"},[t("h1",{staticClass:"capitalize mb-2"},[e._v(e._s(e.$trans("pages.agreements.agreements")))]),t("div",{staticClass:"flex flex-col md:flex-row",class:{"flex-col-reverse md:flex-row-reverse":e.awayAgreement&&!e.userAwayAgreement}},[t("div",{staticClass:"w-full md:w-1/2 md:mr-4"},[t("h2",{staticClass:"text-2xl"},[e._v(e._s(e.$trans("pages.agreements.profileAgreement")))]),e.userProfileAgreement?t("div",{staticClass:"min-h-14 flex items-center"},[t("p",[e._v(e._s(e.$trans("pages.agreements.agreementAccepted"))+" "+e._s(new Date(e.userProfileAgreement.accepted_at).toLocaleString("da-DK",{dateStyle:"short",timeStyle:"short"})))])]):t("div",{staticClass:"min-h-14 flex items-center"},[t("button",{staticClass:"inline-flex items-center gap-x-2 rounded-md bg-blue-600 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-blue-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600",on:{click:function(a){var s;return e.acceptAgreement((s=e.profileAgreement)==null?void 0:s.id)}}},[e._v("Accept agreement "),t("svg",{staticClass:"-mr-0.5 h-5 w-5",attrs:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"}})])])]),t("div",{staticClass:"bg-gray-100 mt-2 p-2",domProps:{innerHTML:e._s((r=e.profileAgreement)==null?void 0:r.content)}})]),t("div",{staticClass:"w-full md:w-1/2"},[t("h2",{staticClass:"text-2xl"},[e._v(e._s(e.$trans("pages.agreements.awayAgreement")))]),e.userAwayAgreement?t("div",{staticClass:"min-h-14 flex items-center"},[t("p",[e._v(e._s(e.$trans("pages.agreements.agreementAccepted"))+" "+e._s(new Date(e.userAwayAgreement.accepted_at).toLocaleStr
3889ing("da-DK",{dateStyle:"short",timeStyle:"short"})))])]):t("div",{staticClass:"min-h-14 flex items-center"},[t("button",{staticClass:"inline-flex items-center gap-x-2 rounded-md bg-blue-600 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-blue-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600",on:{click:function(a){var s;return e.acceptAgreement((s=e.awayAgreement)==null?void 0:s.id)}}},[e._v("Accepter aftale "),t("svg",{staticClass:"-mr-0.5 h-5 w-5",attrs:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"}})])])]),t("div",{staticClass:"bg-gray-100 mt-2 p-2",domProps:{innerHTML:e._s((i=e.awayAgreement)==null?void 0:i.content)}})])])])])])])},cve=[],uve=ve(sve,ove,cve,!1,null,null);const lve=uve.exports,dve=Object.freeze(Object.defineProperty({__proto__:null,default:lve},Symbol.toStringTag,{value:"Module"})),fve={name:"GuestLayout",components:{JetNavLink:Zu,JetResponsiveNavLink:E2},data(){return{showNavigationDropdown:!1}},methods:{toggleNavigationDropdown(){this.showNavigationDropdown=!this.showNavigationDropdown}}};var hve=function(){var e=this,t=e._self._c;return t("div",{staticClass:"min-h-screen bg-gray-100 flex flex-col"},[t("header",{staticClass:"bg-white"},[t("nav",{staticClass:"mx-auto flex max-w-7xl items-center justify-between sm:p-4 lg:px-8",attrs:{"aria-label":"Global"}},[t("div",{staticClass:"flex lg:flex-1"},[t("jet-nav-link",{staticClass:"p-0",attrs:{href:e.route("dashboard")}},[t("span",{staticClass:"sr-only"},[e._v("FCK Profile")]),t("img",{staticClass:"h-12 w-auto",attrs:{src:"/img/FCK_Profil_Blue.svg",alt:""}})])],1),t("div",{staticClass:"flex lg:hidden"},[t("button",{staticClass:"rounded-md p-2.5 text-gray-700",attrs:{type:"button"},on:{click:this.toggleNavigationDropdown}},[t("span",{staticClass:"sr-only"},[e._v("Open menu")]),t("svg",{staticClass:"h-6 w-6",attrs:{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h16"}})])])]),t("div",{staticClass:"hidden lg:flex lg:gap-x-12"},[t("jet-nav-link",{staticClass:"text-sm font-semibold leading-6 text-gray-900",attrs:{href:"/login"}},[e._v(e._s(e.$trans("layouts.appLayout.login")))])],1),t("div",{staticClass:"lg:hidden",class:{hidden:!e.showNavigationDropdown},attrs:{role:"dialog","aria-modal":"true"}},[t("div",{staticClass:"fixed inset-0 z-10"}),t("div",{staticClass:"fixed inset-y-0 right-0 z-10 w-full overflow-y-auto bg-white sm:max-w-sm sm:ring-1 sm:ring-gray-900/10"},[t("div",{staticClass:"flex items-center justify-between p-1"},[e._m(0),t("button",{staticClass:"-m-1.5 rounded-md p-2.5 text-gray-700",attrs:{type:"button"},on:{click:e.toggleNavigationDropdown}},[t("span",{staticClass:"sr-only"},[e._v("Close menu")]),t("svg",{staticClass:"h-6 w-6",attrs:{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"}})])])]),t("div",{staticClass:"mt-2 flow-root"},[t("div",{staticClass:"-my-6 divide-y divide-gray-500/10"},[t("div",{staticClass:"space-y-2 py-6"},[t("jet-responsive-nav-link",{staticClass:"-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 hover:bg-gray-50",attrs:{href:"/login"}},[e._v(e._s(e.$trans("layouts.appLayout.login")))])],1)])])])])])]),t("main",[e._t("default")],2)])},pve=[function(){var n=this,e=n._self._c;return e("a",{attrs:{href:"#"}},[e("span",{staticClass:"sr-only"},[n._v("FCK Profil")]),e("img",{staticClass:"h-12 w-auto",attrs:{src:"/img/FCK_Profil_Blue.svg",alt:""}})])}],mve=ve(fve,hve,pve,!1,null,"9af0a6c8");const gve=mve.exports,vve={components:{GuestLayout:gve},mounted(){},props:{profileAgreement:{type:Object,required:!1,default:()=>null},awayAgreement:{type:Object,required:!1,default:()=>null}}};var yve=function(){var r,i;var e=this,t=e._self._c;return t("guest-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("pages.agreements.agreements"))+" ")])]},proxy:!0}])},[t("div",{staticClass:"pt-6 lg:pt-8"}
3889,[t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8"},[t("div",{staticClass:"bg-white overflow-hidden shadow-xl sm:rounded-lg p-2 md:py-4"},[t("h1",{staticClass:"capitalize mb-2"},[e._v(e._s(e.$trans("pages.agreements.agreements")))]),t("div",{staticClass:"flex flex-col md:flex-row"},[t("div",{staticClass:"w-full md:w-1/2 md:mr-4"},[t("h2",{staticClass:"text-2xl"},[e._v(e._s(e.$trans("pages.agreements.profileAgreement")))]),t("div",{staticClass:"bg-gray-100 mt-2 p-2",domProps:{innerHTML:e._s((r=e.profileAgreement)==null?void 0:r.content)}})]),t("div",{staticClass:"w-full md:w-1/2"},[t("h2",{staticClass:"text-2xl"},[e._v(e._s(e.$trans("pages.agreements.awayAgreement")))]),t("div",{staticClass:"bg-gray-100 mt-2 p-2",domProps:{innerHTML:e._s((i=e.awayAgreement)==null?void 0:i.content)}})])])])])])])},_ve=[],bve=ve(vve,yve,_ve,!1,null,null);const xve=bve.exports,wve=Object.freeze(Object.defineProperty({__proto__:null,default:xve},Symbol.toStringTag,{value:"Module"})),Cve={components:{JetAuthenticationCard:ld,JetAuthenticationCardLogo:cl,JetButton:mn,JetInput:Rn,JetLabel:Un,JetValidationErrors:Df},data(){return{form:this.$inertia.form({password:""})}},methods:{submit(){this.form.post(this.route("password.confirm"),{onFinish:()=>this.form.reset()})}}};var kve=function(){var e=this,t=e._self._c;return t("jet-authentication-card",{scopedSlots:e._u([{key:"logo",fn:function(){return[t("jet-authentication-card-logo")]},proxy:!0}])},[t("div",{staticClass:"mb-4 text-sm text-gray-600"},[e._v(" This is a secure area of the application. Please confirm your password before continuing. ")]),t("jet-validation-errors",{staticClass:"mb-4"}),t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",[t("jet-label",{attrs:{for:"password",value:"Password"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"password",type:"password",required:"",autocomplete:"current-password",autofocus:""},model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}})],1),t("div",{staticClass:"flex justify-end mt-4"},[t("jet-button",{staticClass:"ml-4",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" Confirm ")])],1)])],1)},Sve=[],Tve=ve(Cve,kve,Sve,!1,null,null);const Eve=Tve.exports,Pve=Object.freeze(Object.defineProperty({__proto__:null,default:Eve},Symbol.toStringTag,{value:"Module"})),Rve={components:{JetAuthenticationCard:ld,JetAuthenticationCardLogo:cl,JetButton:mn,JetInput:Rn,JetLabel:Un,JetValidationErrors:Df},props:{status:String},data(){return{form:this.$inertia.form({email:""})}},methods:{submit(){this.form.post(this.route("password.email"))}}};var Ave=function(){var e=this,t=e._self._c;return t("jet-authentication-card",{scopedSlots:e._u([{key:"logo",fn:function(){return[t("jet-authentication-card-logo")]},proxy:!0}])},[t("div",{staticClass:"mb-4 text-sm text-gray-600"},[e._v(" "+e._s(e.$trans("pages.forgotPassword.message"))+" ")]),e.status?t("div",{staticClass:"mb-4 font-medium text-sm text-green-600"},[e._v(" "+e._s(e.status)+" ")]):e._e(),t("jet-validation-errors",{staticClass:"mb-4"}),t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",[t("jet-label",{attrs:{for:"email",value:"Email"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"email",type:"email",required:"",autofocus:""},model:{value:e.form.email,callback:function(r){e.$set(e.form,"email",r)},expression:"form.email"}})],1),t("div",{staticClass:"flex items-center justify-end mt-4"},[t("jet-button",{class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("pages.forgotPassword.resetPassword"))+" ")])],1)])],1)},Ive=[],Ove=ve(Rve,Ave,Ive,!1,null,null);const Mve=Ove.exports,Dve={components:{ForgotPasswordForm:Mve}};var Nve=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col sm:justify-center sm:items-center background-profile min-h-screen py-8"},[t("div",{staticClass:"flex flex-row items-center justify-center space-x-2 mb-6"},[t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v("FCK")]),t("img",{staticClass:"h-14 w-14",attrs:{src:"/img/FCK_Logo_symbol_RGB_Blue.png",alt:"FCK Logo"}}),t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v(e._s(e.$trans("pages.login.profile")))])]),t("forgot-password-form",{attrs:{canResetPassword:""}})],1)},Lve=[],Fve=ve(Dve,Nve,Lve,!1,null,null);const $ve=Fve.exports,Bve=Object.freeze(Object.defineProperty({__proto__:null,default:$ve},Symbol.toStringTag,{value:"Module"})),Uve={components:{JetAuthenticationCard:ld,JetButton:mn,JetInput:Rn,JetCheckbox:Pp,JetLabel:Un,JetValidationErrors:Df},props:{canResetPassword:Boolean,status:String},data(){return{form:this.$inertia.form({email:"",password:"",remember:!1})}},mounted(){this.setupAutofillHandlers()},methods:{setupAutofillHandlers(){this.$nextTick(()=>{const n=document.getElementById("email"),e=document.getElementById("password"),t=a=>{const s=a.target;s.value&&(s.id==="email"&&(this.form.email=s.value),s.id==="password"&&(this.form.password=s.value))};["input","change","animationstart"].forEach(a=>{n==null||n.addEventListener(a,t),e==null||e.addEventListener(a,t)});const i=new MutationObserver(a=>{a.forEach(s=>{s.target.value&&t({target:s.target})})});[n,e].forEach(a=>{a&&i.observe(a,{attributes:!0,characterData:!0,subtree:!0})})})},submit(){this.form.transform(n=>({...n,remember:this.form.remember?"on":""})).post(this.route("login"),{onFinish:()=>this.form.reset("password")})}}};var jve=function(){var e=this,t=e._self._c;return t("div",{staticClass:"sm:px-6 lg:px-8"},[t("div",{staticClass:"flex min-h-full flex-1 flex-col justify-center"},[t("div",{staticClass:"mt-2 sm:mx-auto sm:w-full sm:max-w-[480px]"},[t("div",{staticClass:"bg-white px-4 py-4 shadow sm:max-w-80 mx-auto"},[t("jet-validation-errors",{staticClass:"mb-4"}),e.status?t("div",{staticClass:"mb-4 font-medium text-sm text-green-600"}
3889,[e._v(" "+e._s(e.status)+" ")]):e._e(),t("form",{staticClass:"space-y-6",on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",[t("label",{staticClass:"block text-sm/6 font-medium text-gray-900",attrs:{for:"email"}},[e._v(e._s(e.$trans("pages.login.email")))]),t("div",{staticClass:"mt-2"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.email,expression:"form.email"}],staticClass:"block w-full bg-white px-3 py-1.5 text-base text-gray-900 outline outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline focus:outline-2 focus:-outline-offset-2 focus:outline-fck-blue-600 sm:text-sm/6",attrs:{type:"email",name:"email",id:"email",required:"",autofocus:"",autocomplete:"email"},domProps:{value:e.form.email},on:{input:function(r){r.target.composing||e.$set(e.form,"email",r.target.value)}}})])]),t("div",[t("label",{staticClass:"block text-sm/6 font-medium text-gray-900",attrs:{for:"password"}},[e._v(e._s(e.$trans("pages.login.password")))]),t("div",{staticClass:"mt-2"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.password,expression:"form.password"}],staticClass:"block w-full bg-white px-3 py-1.5 text-base text-gray-900 outline outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline focus:outline-2 focus:-outline-offset-2 focus:outline-fck-blue-600 sm:text-sm/6",attrs:{type:"password",name:"password",id:"password",required:"",autocomplete:"current-password"},domProps:{value:e.form.password},on:{input:function(r){r.target.composing||e.$set(e.form,"password",r.target.value)}}})])]),t("div",{staticClass:"flex items-center justify-between"},[t("div",{staticClass:"flex gap-3"},[t("div",{staticClass:"flex h-6 shrink-0 items-center"},[t("div",{staticClass:"group grid size-4 grid-cols-1"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.remember,expression:"form.remember"}],staticClass:"col-start-1 row-start-1 appearance-none border border-gray-300 bg-white checked:border-fck-blue-600 checked:bg-fck-blue-600 indeterminate:border-fck-blue-600 indeterminate:bg-fck-blue-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fck-blue-600 disabled:border-gray-300 disabled:bg-gray-100 disabled:checked:bg-gray-100 forced-colors:appearance-auto",attrs:{id:"remember",name:"remember",type:"checkbox"},domProps:{checked:Array.isArray(e.form.remember)?e._i(e.form.remember,null)>-1:e.form.remember},on:{change:function(r){var i=e.form.remember,a=r.target,s=!!a.checked;if(Array.isArray(i)){var o=null,c=e._i(i,o);a.checked?c<0&&e.$set(e.form,"remember",i.concat([o])):c>-1&&e.$set(e.form,"remember",i.slice(0,c).concat(i.slice(c+1)))}else e.$set(e.form,"remember",s)}}}),t("svg",{staticClass:"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white group-has-[:disabled]:stroke-gray-950/25",attrs:{viewBox:"0 0 14 14",fill:"none"}},[t("path",{staticClass:"opacity-0 group-has-[:checked]:opacity-100",attrs:{d:"M3 8L6 11L11 3.5","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}}),t("path",{staticClass:"opacity-0 group-has-[:indeterminate]:opacity-100",attrs:{d:"M3 7H11","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}})])])]),t("label",{staticClass:"block text-sm/6 text-gray-900",attrs:{for:"remember"}},[e._v(e._s(e.$trans("pages.login.remember")))])]),t("div",{staticClass:"text-sm/6"},[t("a",{staticClass:"font-semibold text-fck-blue-600 hover:text-fck-blue-500",attrs:{href:e.route("password.request")}},[e._v(e._s(e.$trans("pages.login.forgot")))])])]),t("div",[t("button",{staticClass:"flex w-full justify-center bg-fck-blue px-3 py-1.5 text-sm/6 font-semibold text-white shadow-sm hover:bg-blue-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600",attrs:{type:"submit"}},[e._v(e._s(e.$trans("pages.login.login")))])])]),t("p",{staticClass:"mt-4 text-center text-sm/6 text-gray-500"},[e._v(" "+e._s(e.$trans("pages.login.notmember"))+" "),t("a",{staticClass:"font-semibold text-fck-blue hover:text-blue-600",attrs:{href:e.route("register")}}
3889,[e._v(e._s(e.$trans("pages.login.notmemberText")))])])],1)])])])},qve=[],zve=ve(Uve,jve,qve,!1,null,null);const Db=zve.exports,Wve={components:{LoginForm:Db}};var Hve=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col sm:justify-center sm:items-center background-profile min-h-screen py-8"},[t("div",{staticClass:"flex flex-row items-center justify-center space-x-2 mb-6"},[t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v("FCK")]),t("img",{staticClass:"h-14 w-14",attrs:{src:"/img/FCK_Logo_symbol_RGB_Blue.png",alt:"FCK Logo"}}),t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v(e._s(e.$trans("pages.login.profile")))])]),t("h2",{staticClass:"text-sm font-regular text-balance mb-6 mx-auto text-center max-w-80",domProps:{innerHTML:e._s(e.$trans("pages.login.profilevp1"))}}),t("login-form",{attrs:{canResetPassword:""}})],1)},Vve=[],Gve=ve(Wve,Hve,Vve,!1,null,null);const Kve=Gve.exports,Yve=Object.freeze(Object.defineProperty({__proto__:null,default:Kve},Symbol.toStringTag,{value:"Module"})),Xve={components:{JetAuthenticationCard:ld,JetAuthenticationCardLogo:cl,JetButton:mn,JetInput:Rn,JetCheckbox:Pp,JetLabel:Un,JetValidationErrors:Df,JetPhone:MT,JetPassword:Ob,JetPasswordConfirmation:Mb},data(){return{form:this.$inertia.form({firstname:"",lastname:"",birthday:"1992-07-01",day:1,month:7,year:1992,phone:"",country_code:"",email:"",password:"",password_confirmation:"",terms:!1,consent:!1,pickerFormatted2:null}),passwordFocused:!1}},computed:{checkFirstName(){return this.form.firstname.length>0},checkLastName(){return this.form.lastname.length>0},checkBirthday(){return this.form.birthday.length>0},checkPhone(){return this.form.phone.length>0},checkCountryCode(){return this.form.country_code.length>0},checkEmail(){var n=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return n.test(this.form.email)}},methods:{submit(){this.form.post(this.route("register"),{onFinish:()=>this.form.reset("password","password_confirmation")})},phoneUpdate({countryCallingCode:n,nationalNumber:e}){this.form.phone=e,this.form.country_code=n},birthdayUpdate(){let n=`${this.form.year}-${this.form.month}-${this.form.day}`,e=Le(n,"YYYY-M-D").format("YYYY-MM-DD");this.form.birthday=e},validationTextStyle(n){return{color:n?"green":"rgb(107,114,128)"}},setPasswordFocus(n){this.passwordFocused=n}}};var Jve=function(){var e=this,t=e._self._c;return t("div",[t("jet-authentication-card",{scopedSlots:e._u([{key:"logo",fn:function(){return[t("jet-authentication-card-logo")]},proxy:!0}])},[t("jet-validation-errors",{staticClass:"mb-4"}),t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",[t("jet-label",{attrs:{for:"firstname",value:e.$trans("pages.register.firstname")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"firstname",type:"text",required:"",autofocus:"",autocomplete:"firstname"},model:{value:e.form.firstname,callback:function(r){e.$set(e.form,"firstname",r)},expression:"form.firstname"}})],1),t("div",{staticClass:"mt-4"},[t("jet-label",{attrs:{for:"lastname",value:e.$trans("pages.register.lastname")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"lastname",type:"text",required:"",autocomplete:"lastname"},model:{value:e.form.lastname,callback:function(r){e.$set(e.form,"lastname",r)},expression:"form.lastname"}})],1),t("div",{staticClass:"mt-4"},[t("jet-label",{attrs:{for:"birthday",value:e.$trans("pages.register.birthday")}}),t("div",{staticClass:"grid grid-cols-3 gap-2"},[t("div",[t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.day,expression:"form.day"}],staticClass:"mt-1 w-full block border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 shadow-sm",attrs:{id:"day",type:"select"},on:{change:[function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.$set(e.form,"day",r.target.multiple?i:i[0])},e.birthdayUpdate]}},e._l(parseInt(31),function(r){return t("option",[e._v(e._s(r))])}),0),t("p",{staticClass:"text-xs text-gray-500"},[e._v(e._s(e.$trans("pages.register.day")))])]),t("div",[t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.month,expression:"form.month"}],staticClass:"mt-1 w-full block border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 shadow-sm",attrs:{id:"month",type:"select"},on:{change:[function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.$set(e.form,"month",r.target.multiple?i:i[0])},e.birthdayUpdate]}},e._l(parseInt(12),function(r){return t("option",{domProps:{value:r}},[e._v(e._s(r))])}),0),t("p",{staticClass:"text-xs text-gray-500"},[e._v(e._s(e.$trans("pages.register.month")))])]),t("div",[t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.year,expression:"form.year"}],staticClass:"mt-1 w-full block border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 shadow-sm",attrs:{id:"year",type:"select"},on:{change:[function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.$set(e.form,"year",r.target.multiple?i:i[0])},e.birthdayUpdate]}},e._l(Array.from(Array(new Date().getFullYear()+1).keys()).slice(1900),function(r){return t("option",{domProps:{value:r}},[e._v(e._s(r))])}),0),t("p",{staticClass:"text-xs text-gray-500"}
3889,[e._v(e._s(e.$trans("pages.register.year")))])])])],1),t("div",{staticClass:"mt-4"},[t("jet-label",{attrs:{for:"phone",value:e.$trans("pages.register.phone")}}),t("jet-phone",{attrs:{initNumber:e.form.phone,initCountry:"+45",ccTrans:e.$trans("pages.register.countryCode"),numberTrans:e.$trans("pages.register.number"),required:""},on:{change:e.phoneUpdate},model:{value:e.form.phone,callback:function(r){e.$set(e.form,"phone",r)},expression:"form.phone"}})],1),t("div",{staticClass:"mt-4"},[t("jet-label",{attrs:{for:"email",value:"Email"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"email",type:"email",required:"",autocomplete:"on"},model:{value:e.form.email,callback:function(r){e.$set(e.form,"email",r)},expression:"form.email"}})],1),t("div",{staticClass:"mt-4"},[t("jet-password",{attrs:{label:e.$trans("users.password.new")},model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}}),t("jet-password-confirmation",{attrs:{password:e.form.password,label:e.$trans("users.password.confirm")},model:{value:e.form.password_confirmation,callback:function(r){e.$set(e.form,"password_confirmation",r)},expression:"form.password_confirmation"}})],1),e.$page.props.jetstream.hasTermsAndPrivacyPolicyFeature?t("div",{staticClass:"mt-4"},[t("jet-label",{attrs:{for:"terms"}},[t("div",{staticClass:"flex mb-2"},[t("jet-checkbox",{attrs:{name:"terms",id:"terms"},model:{value:e.form.terms,callback:function(r){e.$set(e.form,"terms",r)},expression:"form.terms"}}),t("div",{staticClass:"ml-2 consent-text"},[e._v(" "+e._s(e.$trans("pages.register.agree"))+" "),t("a",{staticClass:"underline text-sm text-gray-600 hover:text-gray-900 consent-text",attrs:{target:"_blank",href:"https://www.fck.dk/privatlivspolitik"}},[e._v(e._s(e.$trans("pages.register.privacy")))]),e._v(" "+e._s(e.$trans("pages.register.and"))+" "),t("a",{staticClass:"underline text-sm text-gray-600 hover:text-gray-900 consent-text",attrs:{target:"_blank",href:e.route("terms.show")}},[e._v(e._s(e.$trans("pages.register.terms")))]),e._v(". "+e._s(e.$trans("pages.register.withdraw"))+" ")])],1)]),t("jet-label",{attrs:{for:"consent"}},[t("div",{staticClass:"flex mb-2"},[t("jet-checkbox",{attrs:{name:"consent",id:"consent"},model:{value:e.form.consent,callback:function(r){e.$set(e.form,"consent",r)},expression:"form.consent"}}),t("div",{staticClass:"ml-2 consent-text"},[e._v(" "+e._s(e.$trans("pages.register.agree2"))+" "),t("a",{staticClass:"underline text-sm text-gray-600 hover:text-gray-900 consent-text",attrs:{target:"_blank",href:"https://www.fck.dk/samtykke"}},[e._v(e._s(e.$trans("pages.register.consent")))]),e._v(". "+e._s(e.$trans("pages.register.agree3"))+" ")])],1)])],1):e._e(),t("div",{staticClass:"flex items-center justify-end mt-4"},[t("inertia-link",{staticClass:"underline text-sm text-gray-600 hover:text-gray-900",attrs:{href:e.route("login")}},[e._v(" "+e._s(e.$trans("pages.register.alreadyRegistered"))+" ")]),t("jet-button",{staticClass:"ml-4",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("pages.register.register"))+" ")])],1)]),t("pre",[e._v(e._s(this.$inertia.phone))])],1)],1)},Qve=[],Zve=ve(Xve,Jve,Qve,!1,null,null);const e0e=Zve.exports,t0e={components:{RegisterForm:e0e}};var n0e=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col sm:justify-center sm:items-center background-profile min-h-screen py-8"},[t("div",{staticClass:"flex flex-row items-center justify-center space-x-2 mb-6"},[t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v("FCK")]),t("img",{staticClass:"h-14 w-14",attrs:{src:"/img/FCK_Logo_symbol_RGB_Blue.png",alt:"FCK Logo"}}),t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v(e._s(e.$trans("pages.login.profile")))])]),t("h2",{staticClass:"text-sm font-regular text-balance mb-6 mx-auto text-center max-w-80",domProps:{innerHTML:e._s(e.$trans("pages.login.profilevp1"))}}),t("register-form",{attrs:{canResetPassword:""}})],1)},r0e=[],i0e=ve(t0e,n0e,r0e,!1,null,null);const a0e=i0e.exports,s0e=Object.freeze(Object.defineProperty({__proto__:null,default:a0e},Symbol.toStringTag,{value:"Module"})),o0e={components:{JetAuthenticationCard:ld,JetAuthenticationCardLogo:cl,JetButton:mn,JetInput:Rn,JetLabel:Un,JetValidationErrors:Df,JetPassword:Ob,JetPasswordConfirmation:Mb},props:{email:String,token:String},data(){return{form:this.$inertia.form({token:this.token,email:this.email,password:"",password_confirmation:""})}},methods:{submit(){this.form.post(this.route("password.update"),{onFinish:()=>this.form.reset("password","password_confirmation")})}}};var c0e=function(){var e=this,t=e._self._c;return t("jet-authentication-card",{scopedSlots:e._u([{key:"logo",fn:function(){return[t("jet-authentication-card-logo")]},proxy:!0}])},[t("jet-validation-errors",{staticClass:"mb-4"}),t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",[t("jet-label",{attrs:{for:"email",value:"Email"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"email",type:"email",required:"",autofocus:""},model:{value:e.form.email,callback:function(r){e.$set(e.form,"email",r)},expression:"form.email"}})],1),t("div",{staticClass:"mt-4"},[t("jet-password",{model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}}),t("jet-password-confirmation",{attrs:{password:e.form.password},model:{value:e.form.password_confirmation,callback:function(r){e.$set(e.form,"password_confirmation",r)},expression:"form.password_confirmation"}})],1),t("div",{staticClass:"flex items-center justify-end mt-4"},[t("jet-button",{class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" Reset Password ")])],1)])],1)},u0e=[],l0e=ve(o0e,c0e,u0e,!1,null,null);const d0e=l0e.exports,f0e={components:{ResetPasswordForm:d0e},props:{email:String,token:String}};var h0e=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col sm:justify-center sm:items-center background-profile min-h-screen py-8"},[t("div",{staticClass:"flex flex-row items-center justify-center space-x-2 mb-6"},[t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v("FCK")]),t("img",{staticClass:"h-14 w-14",attrs:{src:"/img/FCK_Logo_symbol_RGB_Blue.png",alt:"FCK Logo"}}),t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v(e._s(e.$trans("pages.login.profile")))])]),t("reset-password-form",{attrs:{email:e.email,token:e.token}})],1)},p0e=[],m0e=ve(f0e,h0e,p0e,!1,null,null);const g0e=m0e.exports,v0e=Object.freeze(Object.defineProperty({__proto__:null,default:g0e},Symbol.toStringTag,{value:"Module"})),y0e={components:{LoginForm:Db}};var _0e=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"flex flex-col sm:justify-center sm:items-center background-ticket min-h-screen py-8"},[t("div",{staticClass:"flex flex-row items-center justify-center space-x-2 mb-6"},[t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v("FCK")]),t("img",{staticClass:"h-14 w-14",attrs:{src:"/img/FCK_Logo_symbol_RGB_Blue.png",alt:"FCK Logo"}}),t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v(e._s(e.$trans("pages.login.ticket")))])]),t("h2",{staticClass:"text-sm font-regular text-balance mb-6 mx-auto text-center max-w-80",domProps:{innerHTML:e._s(e.$trans("pages.login.ticketvp1"))}}),t("login-form",{attrs:{"show-register":!0}}),t("div",{staticClass:"flex flex-col justify-center items-center mt-4 sm:max-w-80"},[t("h2",{staticClass:"text-base font-regular text-center"},[e._v(e._s(e.$trans("pages.login.awayfans")))]),t("div",{staticClass:"flex items-center justify-center flex-row space-x-4 mt-1"},[t("a",{staticClass:"font-light text-sm",attrs:{href:"https://billet.fck.dk/CMS?page=login",target:"_blank",rel:"noopener"}},[e._v(" "+e._s(e.$trans("pages.login.awayfanslogin"))+" ")]),t("a",{staticClass:"font-light text-sm ml-2",attrs:{href:"https://billet.fck.dk/Home/CreateAccount",target:"_blank",rel:"noopener"}},[e._v(" "+e._s(e.$trans("pages.login.awayfansregister"))+" ")])])])],1
3889)])},b0e=[],x0e=ve(y0e,_0e,b0e,!1,null,null);const w0e=x0e.exports,C0e=Object.freeze(Object.defineProperty({__proto__:null,default:w0e},Symbol.toStringTag,{value:"Module"})),k0e={components:{JetAuthenticationCard:ld,JetAuthenticationCardLogo:cl,JetButton:mn,JetInput:Rn,JetLabel:Un,JetValidationErrors:Df},data(){return{recovery:!1,form:this.$inertia.form({code:"",recovery_code:""})}},methods:{toggleRecovery(){this.recovery^=!0,this.$nextTick(()=>{this.recovery?(this.$refs.recovery_code.focus(),this.form.code=""):(this.$refs.code.focus(),this.form.recovery_code="")})},submit(){this.form.post(this.route("two-factor.login"))}}};var S0e=function(){var e=this,t=e._self._c;return t("jet-authentication-card",{scopedSlots:e._u([{key:"logo",fn:function(){return[t("jet-authentication-card-logo")]},proxy:!0}])},[t("div",{staticClass:"mb-4 text-sm text-gray-600"},[e.recovery?[e._v(" Please confirm access to your account by entering one of your emergency recovery codes. ")]:[e._v(" Please confirm access to your account by entering the authentication code provided by your authenticator application. ")]],2),t("jet-validation-errors",{staticClass:"mb-4"}),t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[e.recovery?t("div",[t("jet-label",{attrs:{for:"recovery_code",value:"Recovery Code"}}),t("jet-input",{ref:"recovery_code",staticClass:"mt-1 block w-full",attrs:{id:"recovery_code",type:"text",autocomplete:"one-time-code"},model:{value:e.form.recovery_code,callback:function(r){e.$set(e.form,"recovery_code",r)},expression:"form.recovery_code"}})],1):t("div",[t("jet-label",{attrs:{for:"code",value:"Code"}}),t("jet-input",{ref:"code",staticClass:"mt-1 block w-full",attrs:{id:"code",type:"text",inputmode:"numeric",autofocus:"",autocomplete:"one-time-code"},model:{value:e.form.code,callback:function(r){e.$set(e.form,"code",r)},expression:"form.code"}})],1),t("div",{staticClass:"flex items-center justify-end mt-4"},[t("button",{staticClass:"text-sm text-gray-600 hover:text-gray-900 underline cursor-pointer",attrs:{type:"button"},on:{click:function(r){return r.preventDefault(),e.toggleRecovery.apply(null,arguments)}}},[e.recovery?[e._v(" Use an authentication code ")]:[e._v(" Use a recovery code ")]],2),t("jet-button",{staticClass:"ml-4",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" Login ")])],1)])],1)},T0e=[],E0e=ve(k0e,S0e,T0e,!1,null,null);const P0e=E0e.exports,R0e=Object.freeze(Object.defineProperty({__proto__:null,default:P0e},Symbol.toStringTag,{value:"Module"})),A0e={components:{JetAuthenticationCard:ld,JetAuthenticationCardLogo:cl,JetButton:mn},props:{status:String},data(){return{form:this.$inertia.form()}},methods:{submit(){this.form.post(this.route("verification.send"))}},computed:{verificationLinkSent(){return this.status==="verification-link-sent"}}};var I0e=function(){var e=this,t=e._self._c;return t("jet-authentication-card",{scopedSlots:e._u([{key:"logo",fn:function(){return[t("jet-authentication-card-logo")]},proxy:!0}])},[t("div",{staticClass:"mb-4 text-sm text-gray-600"},[e._v(" "+e._s(e.$trans("pages.verifyEmail.registeredText"))+" ")]),e.verificationLinkSent?t("div",{staticClass:"mb-4 font-medium text-sm text-green-600"},[e._v(" Et nyt verificerings-link er sendt til den email-adresse du opgav ved oprettelsen. ")]):e._e(),t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("div",{staticClass:"mt-4 flex items-center justify-between"},[t("jet-button",{class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("pages.verifyEmail.resendVerification"))+" ")]),t("inertia-link",{staticClass:"underline text-sm text-gray-600 hover:text-gray-900",attrs:{href:e.route("logout"),method:"post",as:"button"}},[e._v(e._s(e.$trans("pages.verifyEmail.logOut")))])],1)])])},O0e=[],M0e=ve(A0e,I0e,O0e,!1,null,null);const D0e=M0e.exports,N0e={components:{VerifyEmailForm:D0e}};var L0e=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col sm:justify-center sm:items-center background-fck min-h-screen py-8"},[t("img",{staticClass:"mb-5",staticStyle:{height:"100px"},attrs:{src:"/img/FCK_Profil_White.svg"}}),t("verify-email-form")],1)},F0e=[],$0e=ve(N0e,L0e,F0e,!1,null,null);const B0e=$0e.exports,U0e=Object.freeze(Object.defineProperty({__proto__:null,default:B0e},Symbol.toStringTag,{value:"Module"})),j0e={components:{LoginForm:Db}};var q0e=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col sm:justify-center sm:items-center background-webshop min-h-screen py-8"},[t("div",{staticClass:"flex flex-row items-center justify-center space-x-2 mb-6"},[t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v("FCK")]),t("img",{staticClass:"h-14 w-14",attrs:{src:"/img/FCK_Logo_symbol_RGB_Blue.png",alt:"FCK Logo"}}),t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v(e._s(e.$trans("pages.login.fanshop")))])]),t("h2",{staticClass:"text-sm font-regular text-balance mb-6 mx-auto text-center max-w-80",domProps:{innerHTML:e._s(e.$trans("pages.login.fanshopvp1"))}}),t("login-form",{attrs:{"show-register":!0}})],1)},z0e=[],W0e=ve(j0e,q0e,z0e,!1,null,null);const H0e=W0e.exports,V0e=Object.freeze(Object.defineProperty({__proto__:null,default:H0e},Symbol.toStringTag,{value:"Module"})),G0e={components:{JetAuthenticationCard:ld,JetAuthenticationCardLogo:cl,JetButton:mn,JetInput:Rn,JetCheckbox:Pp,JetLabel:Un,JetValidationErrors:Df},props:{status:String,user:Object},methods:{submit(){this.form.post(window.location.href)}},data(){return{form:this.$inertia.form({password:"",password_confirmation:"",email:this.user.email,terms:!1,consent:!1})}}};var K0e=function(){var e=this,t=e._self._c;return t("jet-authentication-card",{scopedSlots:e._u([{key:"logo",fn:function(){return[t("jet-authentication-card-logo")]},proxy:!0}])},[t("jet-validation-errors",{staticClass:"mb-4"}),t("div",{staticClass:"bg-blue-100 border-l-4 border-blue-500 text-blue-700 p-4",attrs:{role:"alert"}},[t("p",{staticClass:"font-bold"},[e._v(e._s(e.$trans("pages.welcome.welcomeText")))]),t("p",[e._v(e._s(e.$trans("pages.welcome.welcomeCTA")))])]),t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.email,expression:"form.email"}],attrs:{type:"hidden",name:"email"},domProps:{value:e.form.email},on:{input:function(r){r.target.composing||e.$set(e.form,"email",r.target.value)}}}),t("div",{staticClass:"mt-4"},[t("jet-label",{attrs:{for:"password",value:e.$trans("pages.welcome.password")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"password",type:"password",required:""},model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}})],1),t("div",{staticClass:"mt-4"},[t("jet-label",{attrs:{for:"password_confirmation",value:e.$trans("pages.welcome.confirmPassword")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"password_confirmation",type:"password",required:""},model:{value:e.form.password_confirmation,callback:function(r){e.$set(e.form,"password_confirmation",r)},expression:"form.password_confirmation"}})],1),e.$page.props.jetstream.hasTermsAndPrivacyPolicyFeature?t("div",{staticClass:"mt-4"},[t("jet-label",{attrs:{for:"terms"}},[t("div",{staticClass:"flex items-center mb-2"}
3889,[t("jet-checkbox",{attrs:{name:"terms",id:"terms"},model:{value:e.form.terms,callback:function(r){e.$set(e.form,"terms",r)},expression:"form.terms"}}),t("div",{staticClass:"ml-2"},[e._v(" "+e._s(e.$trans("pages.register.agree"))+" "),t("a",{staticClass:"underline text-sm text-gray-600 hover:text-gray-900",attrs:{target:"_blank",href:"https://www.fck.dk/privatlivspolitik"}},[e._v(e._s(e.$trans("pages.register.privacy")))]),e._v(" "+e._s(e.$trans("pages.register.and"))+" "),t("a",{staticClass:"underline text-sm text-gray-600 hover:text-gray-900",attrs:{target:"_blank",href:e.route("terms.show")}},[e._v(e._s(e.$trans("pages.register.terms")))]),e._v(". "+e._s(e.$trans("pages.register.withdraw"))+" ")])],1),t("div",{staticClass:"flex items-center mb-2"},[t("jet-checkbox",{attrs:{name:"consent",id:"consent"},model:{value:e.form.consent,callback:function(r){e.$set(e.form,"consent",r)},expression:"form.consent"}}),t("div",{staticClass:"ml-2"},[e._v(" "+e._s(e.$trans("pages.register.agree2"))+" "),t("a",{staticClass:"underline text-sm text-gray-600 hover:text-gray-900",attrs:{target:"_blank",href:"https://www.fck.dk/samtykke"}},[e._v(e._s(e.$trans("pages.register.consent")))]),e._v(". ")])],1)])],1):e._e(),t("div",{staticClass:"flex items-center justify-end mt-4"},[t("jet-button",{staticClass:"ml-4",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("pages.welcome.save"))+" ")])],1)])],1)},Y0e=[],X0e=ve(G0e,K0e,Y0e,!1,null,null);const J0e=X0e.exports,Q0e={components:{WelcomeForm:J0e},props:{user:Object},mounted(){}};var Z0e=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col sm:justify-center sm:items-center background-fck min-h-screen py-8"},[t("img",{staticClass:"mb-5",staticStyle:{height:"100px"},attrs:{src:"/img/FCK_Profil_White.svg"}}),t("welcome-form",{attrs:{user:e.user}})],1)},eye=[],tye=ve(Q0e,Z0e,eye,!1,null,null);const nye=tye.exports,rye=Object.freeze(Object.defineProperty({__proto__:null,default:nye},Symbol.toStringTag,{value:"Module"}));var hI={};function iye(n,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if(r!=="default"&&!(r in n)){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(n)}var aye=Object.defineProperty,sye=(n,e,t)=>e in n?aye(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,pI=(n,e,t)=>sye(n,typeof e!="symbol"?e+"":e,t);class Ii{constructor(){pI(this,"_locking"),pI(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){this._locks+=1;let e;const t=new Promise(i=>e=()=>{this._locks-=1,i()}),r=this._locking.then(()=>e);return this._locking=this._locking.then(()=>t),r}}function Cr(n,e){if(!n)throw new Error(e)}const oye=34028234663852886e22,cye=-34028234663852886e22,uye=4294967295,lye=2147483647,dye=-2147483648;function hy(n){if(typeof n!="number")throw new Error("invalid int 32: "+typeof n);if(!Number.isInteger(n)||n>lye||n<dye)throw new Error("invalid int 32: "+n)}function Pk(n){if(typeof n!="number")throw new Error("invalid uint 32: "+typeof n);if(!Number.isInteger(n)||n>uye||n<0)throw new Error("invalid uint 32: "+n)}function qF(n){if(typeof n!="number")throw new Error("invalid float 32: "+typeof n);if(Number.isFinite(n)&&(n>oye||n<cye))throw new Error("invalid float 32: "+n)}const zF=Symbol("@bufbuild/protobuf/enum-type");function fye(n){const e=n[zF];return Cr(e,"missing enum type on enum object"),e}function WF(n,e,t,r){n[zF]=HF(e,t.map(i=>({no:i.no,name:i.name,localName:n[i.no]})))}function HF(n,e,t){const r=Object.create(null),i=Object.create(null),a=[];for(const s of e){const o=VF(s);a.push(o),r[s.name]=o,i[s.no]=o}return{typeName:n,values:a,findName(s){return r[s]},findNumber(s){return i[s]}}}function hye(n,e,t){const r={};for(const i of e){const a=VF(i);r[a.localName]=a.no,r[a.no]=a.localName}return WF(r,n,e),r}function VF(n){return"localName"in n?n:Object.assign(Object.assign({},n),{localName:n.name})}class $T{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,t){const r=this.getType(),i=r.runtime.bin,a=i.makeReadOptions(t);return i.readMessage(this,a.readerFactory(e),e.byteLength,a),this}fromJson(e,t){const r=this.getType(),i=r.runtime.json,a=i.makeReadOptions(t);return i.readMessage(r,e,a,this),this}fromJsonString(e,t){let r;try{r=JSON.parse(e)}catch(i){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(i instanceof Error?i.message:String(i)))}return this.fromJson(r,t)}toBinary(e){const t=this.getType(),r=t.runtime.bin,i=r.makeWriteOptions(e),a=i.writerFactory();return r.writeMessage(this,a,i),a.finish()}
vendor: 10,545 bytes, line 3889
3889toJson(e){const t=this.getType(),r=t.runtime.json,i=r.makeWriteOptions(e);return r.writeMessage(this,i)}toJsonString(e){var t;const r=this.toJson(e);return JSON.stringify(r,null,(t=e==null?void 0:e.prettySpaces)!==null&&t!==void 0?t:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function pye(n,e,t,r){var i;const a=(i=r==null?void 0:r.localName)!==null&&i!==void 0?i:e.substring(e.lastIndexOf(".")+1),s={[a]:function(o){n.util.initFields(this),n.util.initPartial(o,this)}}[a];return Object.setPrototypeOf(s.prototype,new $T),Object.assign(s,{runtime:n,typeName:e,fields:n.util.newFieldList(t),fromBinary(o,c){return new s().fromBinary(o,c)},fromJson(o,c){return new s().fromJson(o,c)},fromJsonString(o,c){return new s().fromJsonString(o,c)},equals(o,c){return n.util.equals(s,o,c)}}),s}function mye(){let n=0,e=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(n|=(i&127)<<r,!(i&128))return this.assertBounds(),[n,e]}let t=this.buf[this.pos++];if(n|=(t&15)<<28,e=(t&112)>>4,!(t&128))return this.assertBounds(),[n,e];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<r,!(i&128))return this.assertBounds(),[n,e]}throw new Error("invalid varint")}function Uw(n,e,t){for(let a=0;a<28;a=a+7){const s=n>>>a,o=!(!(s>>>7)&&e==0),c=(o?s|128:s)&255;if(t.push(c),!o)return}const r=n>>>28&15|(e&7)<<4,i=!!(e>>3);if(t.push((i?r|128:r)&255),!!i){for(let a=3;a<31;a=a+7){const s=e>>>a,o=!!(s>>>7),c=(o?s|128:s)&255;if(t.push(c),!o)return}t.push(e>>>31&1)}}const py=4294967296;function mI(n){const e=n[0]==="-";e&&(n=n.slice(1));const t=1e6;let r=0,i=0;function a(s,o){const c=Number(n.slice(s,o));i*=t,r=r*t+c,r>=py&&(i=i+(r/py|0),r=r%py)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),e?KF(r,i):BT(r,i)}function gye(n,e){let t=BT(n,e);const r=t.hi&2147483648;r&&(t=KF(t.lo,t.hi));const i=GF(t.lo,t.hi);return r?"-"+i:i}function GF(n,e){if({lo:n,hi:e}=vye(n,e),e<=2097151)return String(py*e+n);const t=n&16777215,r=(n>>>24|e<<8)&16777215,i=e>>16&65535;let a=t+r*6777216+i*6710656,s=r+i*8147497,o=i*2;const c=1e7;return a>=c&&(s+=Math.floor(a/c),a%=c),s>=c&&(o+=Math.floor(s/c),s%=c),o.toString()+gI(s)+gI(a)}function vye(n,e){return{lo:n>>>0,hi:e>>>0}}function BT(n,e){return{lo:n|0,hi:e|0}}function KF(n,e){return e=~e,n?n=~n+1:e+=1,BT(n,e)}const gI=n=>{const e=String(n);return"0000000".slice(e.length)+e};function vI(n,e){if(n>=0){for(;n>127;)e.push(n&127|128),n=n>>>7;e.push(n)}else{for(let t=0;t<9;t++)e.push(n&127|128),n=n>>7;e.push(1)}}function yye(){let n=this.buf[this.pos++],e=n&127;if(!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<7,!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<14,!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<21,!(n&128))return this.assertBounds(),e;n=this.buf[this.pos++],e|=(n&15)<<28;for(let t=5;n&128&&t<10;t++)n=this.buf[this.pos++];if(n&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function _ye(){const n=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof n.getBigInt64=="function"&&typeof n.getBigUint64=="function"&&typeof n.setBigInt64=="function"&&typeof n.setBigUint64=="function"&&(typeof process!="object"||typeof hI!="object"||hI.BUF_BIGINT_DISABLE!=="1")){const i=BigInt("-9223372036854775808"),a=BigInt("9223372036854775807"),s=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(c){const u=typeof c=="bigint"?c:BigInt(c);if(u>a||u<i)throw new Error("int64 invalid: ".concat(c));return u},uParse(c){const u=typeof c=="bigint"?c:BigInt(c);if(u>o||u<s)throw new Error("uint64 invalid: ".concat(c));return u},enc(c){return n.setBigInt64(0,this.parse(c),!0),{lo:n.getInt32(0,!0),hi:n.getInt32(4,!0)}},uEnc(c){return n.setBigInt64(0,this.uParse(c),!0),{lo:n.getInt32(0,!0),hi:n.getInt32(4,!0)}},dec(c,u){return n.setInt32(0,c,!0),n.setInt32(4,u,!0),n.getBigInt64(0,!0)},uDec(c,u){return n.setInt32(0,c,!0),n.setInt32(4,u,!0),n.getBigUint64(0,!0)}}}const t=i=>Cr(/^-?[0-9]+$/.test(i),"int64 invalid: ".concat(i)),r=i=>Cr(/^[0-9]+$/.test(i),"uint64 invalid: ".concat(i));return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),t(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),r(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),t(i),mI(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),mI(i)},dec(i,a){return gye(i,a)},uDec(i,a){return GF(i,a)}}}const ir=_ye();var Ne;(function(n){n[n.DOUBLE=1]="DOUBLE",n[n.FLOAT=2]="FLOAT",n[n.INT64=3]="INT64",n[n.UINT64=4]="UINT64",n[n.INT32=5]="INT32",n[n.FIXED64=6]="FIXED64",n[n.FIXED32=7]="FIXED32",n[n.BOOL=8]="BOOL",n[n.STRING=9]="STRING",n[n.BYTES=12]="BYTES",n[n.UINT32=13]="UINT32",n[n.SFIXED32=15]="SFIXED32",n[n.SFIXED64=16]="SFIXED64",n[n.SINT32=17]="SINT32",n[n.SINT64=18]="SINT64"})(Ne||(Ne={}));var Zl;(function(n){n[n.BIGINT=0]="BIGINT",n[n.STRING=1]="STRING"})(Zl||(Zl={}));function wl(n,e,t){if(e===t)return!0;if(n==Ne.BYTES){if(!(e instanceof Uint8Array)||!(t instanceof Uint8Array)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}switch(n){case Ne.UINT64:case Ne.FIXED64:case Ne.INT64:case Ne.SFIXED64:case Ne.SINT64:return e==t}return!1}function dp(n,e){switch(n){case Ne.BOOL:return!1;case Ne.UINT64:case Ne.FIXED64:case Ne.INT64:case Ne.SFIXED64:case Ne.SINT64:return e==0?ir.zero:"0";case Ne.DOUBLE:case Ne.FLOAT:return 0;case Ne.BYTES:return new Uint8Array(0);case Ne.STRING:return"";default:return 0}}function YF(n,e){switch(n){case Ne.BOOL:return e===!1;case Ne.STRING:return e==="";case Ne.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var Lr;(function(n){n[n.Varint=0]="Varint",n[n.Bit64=1]="Bit64",n[n.LengthDelimited=2]="LengthDelimited",n[n.StartGroup=3]="StartGroup",n[n.EndGroup=4]="EndGroup",n[n.Bit32=5]="Bit32"})(Lr||(Lr={}));class bye{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let t=new Uint8Array(e),r=0;for(let i=0;i<this.chunks.length;i++)t.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Pk(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return hy(e),vI(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){qF(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){Pk(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){hy(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return hy(e),e=(e<<1^e>>31)>>>0,vI(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=ir.enc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=ir.uEnc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}int64(e){let t=ir.enc(e);return Uw(t.lo,t.hi,this.buf),this}sint64(e){let t=ir.enc(e),r=t.hi>>31,i=t.lo<<1^r,a=(t.hi<<1|t.lo>>>31)^r;return Uw(i,a,this.buf),this}uint64(e){let t=ir.uEnc(e);return Uw(t.lo,t.hi,this.buf),this}}class xye{constructor(e,t){this.varint64=mye,this.uint32=yye,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder}tag(){let e=this.uint32(),t=e>>>3,r=e&7;if(t<=0||r<0||r>5)throw new Error("illegal tag: field no "+t+" wire type "+r);return[t,r]}skip(e,t){let r=this.pos;switch(e){case Lr.Varint:for(;this.buf[this.pos++]&128;);break;case Lr.Bit64:this.pos+=4;case Lr.Bit32:this.pos+=4;break;case Lr.LengthDelimited:let i=this.uint32();this.pos+=i;break;case Lr.StartGroup:for(;;){const[a,s]=this.tag();if(s===Lr.EndGroup){if(t!==void 0&&a!==t)throw new Error("invalid end group tag");break}this.skip(s,a)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return ir.dec(...this.varint64())}uint64(){return ir.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),r=-(e&1);return e=(e>>>1|(t&1)<<31)^r,t=t>>>1^r,ir.dec(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return ir.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return ir.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}}function wye(n,e,t,r){let i;return{typeName:e,extendee:t,get field(){if(!i){const a=typeof r=="function"?r():r;a.name=e.split(".").pop(),a.jsonName="[".concat(e,"]"),i=n.util.newFieldList([a]).list()[0]}return i},runtime:n}}function XF(n){const e=n.field.localName,t=Object.create(null);return t[e]=Cye(n),[t,()=>t[e]]}function Cye(n){const e=n.field;if(e.repeated)return[];if(e.default!==void 0)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return dp(e.T,e.L);case"message":const t=e.T,r=new t;return t.fieldWrapper?t.fieldWrapper.unwrapField(r):r;case"map":throw"map fields are not allowed to be extensions"}}function kye(n,e){if(!e.repeated&&(e.kind=="enum"||e.kind=="scalar")){for(let t=n.length-1;t>=0;--t)if(n[t].no==e.no)return[n[t]];return[]}return n.filter(t=>t.no===e.no)}let Bu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
3889+/".split(""),Nb=[];for(let n=0;n<Bu.length;n++)Nb[Bu[n].charCodeAt(0)]=n;Nb[45]=Bu.indexOf("+");Nb[95]=Bu.indexOf("/");const JF={dec(n){let e=n.length*3/4;n[n.length-2]=="="?e-=2:n[n.length-1]=="="&&(e-=1);let t=new Uint8Array(e),r=0,i=0,a,s=0;for(let o=0;o<n.length;o++){if(a=Nb[n.charCodeAt(o)],a===void 0)switch(n[o]){case"=":i=0;case` 3890`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:s=a,i=1;break;case 1:t[r++]=s<<2|(a&48)>>4,s=a,i=2;break;case 2:t[r++]=(s&15)<<4|(a&60)>>2,s=a,i=3;break;case 3:t[r++]=(s&3)<<6|a,i=0;break}}if(i==1)throw Error("invalid base64 string.");return t.subarray(0,r)},enc(n){let e="",t=0,r,i=0;for(let a=0;a<n.length;a++)switch(r=n[a],t){case 0:e+=Bu[r>>2],i=(r&3)<<4,t=1;break;case 1:e+=Bu[i|r>>4],i=(r&15)<<2,t=2;break;case 2:e+=Bu[i|r>>6],e+=Bu[r&63],t=0;break}return t&&(e+=Bu[i],e+="=",t==1&&(e+="=")),e}};function Sye(n,e,t){ZF(e,n);const r=e.runtime.bin.makeReadOptions(t),i=kye(n.getType().runtime.bin.listUnknownFields(n),e.field),[a,s]=XF(e);for(const o of i)e.runtime.bin.readField(a,r.readerFactory(o.data),e.field,o.wireType,r);return s()}function Tye(n,e,t,r){ZF(e,n);const i=e.runtime.bin.makeReadOptions(r),a=e.runtime.bin.makeWriteOptions(r);if(QF(n,e)){const u=n.getType().runtime.bin.listUnknownFields(n).filter(l=>l.no!=e.field.no);n.getType().runtime.bin.discardUnknownFields(n);for(const l of u)n.getType().runtime.bin.onUnknownField(n,l.no,l.wireType,l.data)}const s=a.writerFactory();let o=e.field;!o.opt&&!o.repeated&&(o.kind=="enum"||o.kind=="scalar")&&(o=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(o,t,s,a);const c=i.readerFactory(s.finish());for(;c.pos<c.len;){const[u,l]=c.tag(),d=c.skip(l,u);n.getType().runtime.bin.onUnknownField(n,u,l,d)}}function QF(n,e){const t=n.getType();return e.extendee.typeName===t.typeName&&!!t.runtime.bin.listUnknownFields(n).find(r=>r.no==e.field.no)}function ZF(n,e){Cr(n.extendee.typeName==e.getType().typeName,"extension ".concat(n.typeName," can only be applied to message ").concat(n.extendee.typeName))}function e6(n,e){const t=n.localName;if(n.repeated)return e[t].length>0;if(n.oneof)return e[n.oneof.localName].case===t;switch(n.kind){case"enum":case"scalar":return n.opt||n.req?e[t]!==void 0:n.kind=="enum"?e[t]!==n.T.values[0].no:!YF(n.T,e[t]);case"message":return e[t]!==void 0;case"map":return Object.keys(e[t]).length>0}}function yI(n,e){const t=n.localName,r=!n.opt&&!n.req;if(n.repeated)e[t]=[];else if(n.oneof)e[n.oneof.localName]={case:void 0};else switch(n.kind){case"map":e[t]={};break;case"enum":e[t]=r?n.T.values[0].no:void 0;break;case"scalar":e[t]=r?dp(n.T,n.L):void 0;break;case"message":e[t]=void 0;break}}function Uu(n,e){if(n===null||typeof n!="object"||!Object.getOwnPropertyNames($T.prototype).every(r=>r in n&&typeof n[r]=="function"))return!1;const t=n.getType();return t===null||typeof t!="function"||!("typeName"in t)||typeof t.typeName!="string"?!1:e===void 0?!0:t.typeName==e.typeName}function t6(n,e){return Uu(e)||!n.fieldWrapper?e:n.fieldWrapper.wrapField(e)}Ne.DOUBLE,Ne.FLOAT,Ne.INT64,Ne.UINT64,Ne.INT32,Ne.UINT32,Ne.BOOL,Ne.STRING,Ne.BYTES;const _I={ignoreUnknownFields:!1},bI={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function Eye(n){return n?Object.assign(Object.assign({},_I),n):_I}function Pye(n){return n?Object.assign(Object.assign({},bI),n):bI}const S_=Symbol(),my=Symbol();function Rye(){return{makeReadOptions:Eye,makeWriteOptions:Pye,readMessage(n,e,t,r){if(e==null||Array.isArray(e)||typeof e!="object")throw new Error("cannot decode message ".concat(n.typeName," from JSON: ").concat(Rc(e)));r=r??new n;const i=new Map,a=t.typeRegistry;for(const[s,o]of Object.entries(e)){const c=n.fields.findJsonName(s);if(c){if(c.oneof){if(o===null&&c.kind=="scalar")continue;const u=i.get(c.oneof);if(u!==void 0)throw new Error("cannot decode message ".concat(n.typeName,' from JSON: multiple keys for oneof "').concat(c.oneof.name,'" present: "').concat(u,'", "').concat(s,'"'));i.set(c.oneof,s)}xI(r,o,c,t,n)}else{let u=!1;if(a!=null&&a.findExtension&&s.startsWith("[")&&s.endsWith("]")){const l=a.findExtension(s.substring(1,s.length-1));if(l&&l.extendee.typeName==n.typeName){u=!0;const[d,h]=XF(l);xI(d,o,l.field,t,l),Tye(r,l,h(),t)}}if(!u&&!t.ignoreUnknownFields)throw new Error("cannot decode message ".concat(n.typeName,' from JSON: key "').concat(s,'" is unknown'))}}return r},writeMessage(n,e){const t=n.getType(),r={};let i;try{for(i of t.fields.byNumber()){if(!e6(i,n)){if(i.req)throw"required field not set";if(!e.emitDefaultValues||!Iye(i))continue}const s=i.oneof?n[i.oneof.localName].value:n[i.localName],o=wI(i,s,e);o!==void 0&&(r[e.useProtoFieldName?i.name:i.jsonName]=o)}const a=e.typeRegistry;if(a!=null&&a.findExtensionFor)for(const s of t.runtime.bin.listUnknownFields(n)){const o=a.findExtensionFor(t.typeName,s.no);if(o&&QF(n,o)){const c=Sye(n,o,e),u=wI(o.field,c,e);u!==void 0&&(r[o.field.jsonName]=u)}}}catch(a){const s=i?"cannot encode field ".concat(t.typeName,".").concat(i.name," to JSON"):"cannot encode message ".concat(t.typeName," to JSON"),o=a instanceof Error?a.message:String(a);throw new Error(s+(o.length>0?": ".concat(o):""))}return r}
vendor: 17,396 bytes, line 3890
3890,readScalar(n,e,t){return eg(n,e,t??Zl.BIGINT,!0)},writeScalar(n,e,t){if(e!==void 0&&(t||YF(n,e)))return gy(n,e)},debug:Rc}}function Rc(n){if(n===null)return"null";switch(typeof n){case"object":return Array.isArray(n)?"array":"object";case"string":return n.length>100?"string":'"'.concat(n.split('"').join('\\"'),'"');default:return String(n)}}function xI(n,e,t,r,i){let a=t.localName;if(t.repeated){if(Cr(t.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Rc(e)));const s=n[a];for(const o of e){if(o===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Rc(o)));switch(t.kind){case"message":s.push(t.T.fromJson(o,r));break;case"enum":const c=jw(t.T,o,r.ignoreUnknownFields,!0);c!==my&&s.push(c);break;case"scalar":try{s.push(eg(t.T,o,t.L,!0))}catch(u){let l="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Rc(o));throw u instanceof Error&&u.message.length>0&&(l+=": ".concat(u.message)),new Error(l)}break}}}else if(t.kind=="map"){if(e===null)return;if(typeof e!="object"||Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Rc(e)));const s=n[a];for(const[o,c]of Object.entries(e)){if(c===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: map value null"));let u;try{u=Aye(t.K,o)}catch(l){let d="cannot decode map key for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Rc(e));throw l instanceof Error&&l.message.length>0&&(d+=": ".concat(l.message)),new Error(d)}switch(t.V.kind){case"message":s[u]=t.V.T.fromJson(c,r);break;case"enum":const l=jw(t.V.T,c,r.ignoreUnknownFields,!0);l!==my&&(s[u]=l);break;case"scalar":try{s[u]=eg(t.V.T,c,Zl.BIGINT,!0)}catch(d){let h="cannot decode map value for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Rc(e));throw d instanceof Error&&d.message.length>0&&(h+=": ".concat(d.message)),new Error(h)}break}}}else switch(t.oneof&&(n=n[t.oneof.localName]={case:a},a="value"),t.kind){case"message":const s=t.T;if(e===null&&s.typeName!="google.protobuf.Value")return;let o=n[a];Uu(o)?o.fromJson(e,r):(n[a]=o=s.fromJson(e,r),s.fieldWrapper&&!t.oneof&&(n[a]=s.fieldWrapper.unwrapField(o)));break;case"enum":const c=jw(t.T,e,r.ignoreUnknownFields,!1);switch(c){case S_:yI(t,n);break;case my:break;default:n[a]=c;break}break;case"scalar":try{const u=eg(t.T,e,t.L,!1);switch(u){case S_:yI(t,n);break;default:n[a]=u;break}}catch(u){let l="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Rc(e));throw u instanceof Error&&u.message.length>0&&(l+=": ".concat(u.message)),new Error(l)}break}}function Aye(n,e){if(n===Ne.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return eg(n,e,Zl.BIGINT,!0).toString()}function eg(n,e,t,r){if(e===null)return r?dp(n,t):S_;switch(n){case Ne.DOUBLE:case Ne.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;const i=Number(e);if(Number.isNaN(i)||!Number.isFinite(i))break;return n==Ne.FLOAT&&qF(i),i;case Ne.INT32:case Ne.FIXED32:case Ne.SFIXED32:case Ne.SINT32:case Ne.UINT32:let a;if(typeof e=="number"?a=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(a=Number(e)),a===void 0)break;return n==Ne.UINT32||n==Ne.FIXED32?Pk(a):hy(a),a;case Ne.INT64:case Ne.SFIXED64:case Ne.SINT64:if(typeof e!="number"&&typeof e!="string")break;const s=ir.parse(e);return t?s.toString():s;case Ne.FIXED64:case Ne.UINT64:if(typeof e!="number"&&typeof e!="string")break;const o=ir.uParse(e);return t?o.toString():o;case Ne.BOOL:if(typeof e!="boolean")break;return e;case Ne.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case Ne.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return JF.dec(e)}throw new Error}function jw(n,e,t,r){if(e===null)return n.typeName=="google.protobuf.NullValue"?0:r?n.values[0].no:S_;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const i=n.findName(e);if(i!==void 0)return i.no;if(t)return my;break}throw new Error("cannot decode enum ".concat(n.typeName," from JSON: ").concat(Rc(e)))}function Iye(n){return n.repeated||n.kind=="map"?!0:!(n.oneof||n.kind=="message"||n.opt||n.req)}function wI(n,e,t){if(n.kind=="map"){Cr(typeof e=="object"&&e!=null);const r={},i=Object.entries(e);switch(n.V.kind){case"scalar":for(const[s,o]of i)r[s.toString()]=gy(n.V.T,o);break;case"message":for(const[s,o]of i)r[s.toString()]=o.toJson(t);break;case"enum":const a=n.V.T;for(const[s,o]of i)r[s.toString()]=qw(a,o,t.enumAsInteger);break}return t.emitDefaultValues||i.length>0?r:void 0}if(n.repeated){Cr(Array.isArray(e));const r=[];switch(n.kind){case"scalar":for(let i=0;i<e.length;i++)r.push(gy(n.T,e[i]));break;case"enum":for(let i=0;i<e.length;i++)r.push(qw(n.T,e[i],t.enumAsInteger));break;case"message":for(let i=0;i<e.length;i++)r.push(e[i].toJson(t));break}return t.emitDefaultValues||r.length>0?r:void 0}switch(n.kind){case"scalar":return gy(n.T,e);case"enum":return qw(n.T,e,t.enumAsInteger);case"message":return t6(n.T,e).toJson(t)}}function qw(n,e,t){var r;if(Cr(typeof e=="number"),n.typeName=="google.protobuf.NullValue")return null;if(t)return e;const i=n.findNumber(e);return(r=i==null?void 0:i.name)!==null&&r!==void 0?r:e}function gy(n,e){switch(n){case Ne.INT32:case Ne.SFIXED32:case Ne.SINT32:case Ne.FIXED32:case Ne.UINT32:return Cr(typeof e=="number"),e;case Ne.FLOAT:case Ne.DOUBLE:return Cr(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case Ne.STRING:return Cr(typeof e=="string"),e;case Ne.BOOL:return Cr(typeof e=="boolean"),e;case Ne.UINT64:case Ne.FIXED64:case Ne.INT64:case Ne.SFIXED64:case Ne.SINT64:return Cr(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case Ne.BYTES:return Cr(e instanceof Uint8Array),JF.enc(e)}}const uh=Symbol("@bufbuild/protobuf/unknown-fields"),CI={readUnknownFields:!0,readerFactory:n=>new xye(n)},kI={writeUnknownFields:!0,writerFactory:()=>new bye};function Oye(n){return n?Object.assign(Object.assign({},CI),n):CI}function Mye(n){return n?Object.assign(Object.assign({},kI),n):kI}function Dye(){return{makeReadOptions:Oye,makeWriteOptions:Mye,listUnknownFields(n){var e;return(e=n[uh])!==null&&e!==void 0?e:[]},discardUnknownFields(n){delete n[uh]},writeUnknownFields(n,e){const r=n[uh];if(r)for(const i of r)e.tag(i.no,i.wireType).raw(i.data)},onUnknownField(n,e,t,r){const i=n;Array.isArray(i[uh])||(i[uh]=[]),i[uh].push({no:e,wireType:t,data:r})},readMessage(n,e,t,r,i){const a=n.getType(),s=i?e.len:e.pos+t;let o,c;for(;e.pos<s&&([o,c]=e.tag(),!(i===!0&&c==Lr.EndGroup));){const u=a.fields.find(o);if(!u){const l=e.skip(c,o);r.readUnknownFields&&this.onUnknownField(n,o,c,l);continue}SI(n,e,u,c,r)}if(i&&(c!=Lr.EndGroup||o!==t))throw new Error("invalid end group tag")},readField:SI,writeMessage(n,e,t){const r=n.getType();for(const i of r.fields.byNumber()){if(!e6(i,n)){if(i.req)throw new Error("cannot encode field ".concat(r.typeName,".").concat(i.name," to binary: required field not set"));continue}const a=i.oneof?n[i.oneof.localName].value:n[i.localName];TI(i,a,e,t)}return t.writeUnknownFields&&this.writeUnknownFields(n,e),e},writeField(n,e,t,r){e!==void 0&&TI(n,e,t,r)}}}function SI(n,e,t,r,i){let{repeated:a,localName:s}=t;switch(t.oneof&&(n=n[t.oneof.localName],n.case!=s&&delete n.value,n.case=s,s="value"),t.kind){case"scalar":case"enum":const o=t.kind=="enum"?Ne.INT32:t.T;let c=T_;if(t.kind=="scalar"&&t.L>0&&(c=Lye),a){let h=n[s];if(r==Lr.LengthDelimited&&o!=Ne.STRING&&o!=Ne.BYTES){let g=e.uint32()+e.pos;for(;e.pos<g;)h.push(c(e,o))}else h.push(c(e,o))}else n[s]=c(e,o);break;case"message":const u=t.T;a?n[s].push(vy(e,new u,i,t)):Uu(n[s])?vy(e,n[s],i,t):(n[s]=vy(e,new u,i,t),u.fieldWrapper&&!t.oneof&&!t.repeated&&(n[s]=u.fieldWrapper.unwrapField(n[s])));break;case"map":let[l,d]=Nye(t,e,i);n[s][l]=d;break}}function vy(n,e,t,r){const i=e.getType().runtime.bin,a=r==null?void 0:r.delimited;return i.readMessage(e,n,a?r.no:n.uint32(),t,a),e}function Nye(n,e,t){const r=e.uint32(),i=e.pos+r;let a,s;for(;e.pos<i;){const[o]=e.tag();switch(o){case 1:a=T_(e,n.K);break;case 2:switch(n.V.kind){case"scalar":s=T_(e,n.V.T);break;case"enum":s=e.int32();break;case"message":s=vy(e,new n.V.T,t,void 0);break}break}}if(a===void 0&&(a=dp(n.K,Zl.BIGINT)),typeof a!="string"&&typeof a!="number"&&(a=a.toString()),s===void 0)switch(n.V.kind){case"scalar":s=dp(n.V.T,Zl.BIGINT);break;case"enum":s=n.V.T.values[0].no;break;case"message":s=new n.V.T;break}return[a,s]}function Lye(n,e){const t=T_(n,e);return typeof t=="bigint"?t.toString():t}function T_(n,e){switch(e){case Ne.STRING:return n.string();case Ne.BOOL:return n.bool();case Ne.DOUBLE:return n.double();case Ne.FLOAT:return n.float();case Ne.INT32:return n.int32();case Ne.INT64:return n.int64();case Ne.UINT64:return n.uint64();case Ne.FIXED64:return n.fixed64();case Ne.BYTES:return n.bytes();case Ne.FIXED32:return n.fixed32();case Ne.SFIXED32:return n.sfixed32();case Ne.SFIXED64:return n.sfixed64();case Ne.SINT64:return n.sint64();case Ne.UINT32:return n.uint32();case Ne.SINT32:return n.sint32()}}function TI(n,e,t,r){Cr(e!==void 0);const i=n.repeated;switch(n.kind){case"scalar":case"enum":let a=n.kind=="enum"?Ne.INT32:n.T;if(i)if(Cr(Array.isArray(e)),n.packed)$ye(t,a,n.no,e);else for(const s of e)tg(t,a,n.no,s);else tg(t,a,n.no,e);break;case"message":if(i){Cr(Array.isArray(e));for(const s of e)EI(t,r,n,s)}else EI(t,r,n,e);break;case"map":Cr(typeof e=="object"&&e!=null);for(const[s,o]of Object.entries(e))Fye(t,r,n,s,o);break}}function Fye(n,e,t,r,i){n.tag(t.no,Lr.LengthDelimited),n.fork();let a=r;switch(t.K){case Ne.INT32:case Ne.FIXED32:case Ne.UINT32:case Ne.SFIXED32:case Ne.SINT32:a=Number.parseInt(r);break;case Ne.BOOL:Cr(r=="true"||r=="false"),a=r=="true";break}switch(tg(n,t.K,1,a),t.V.kind){case"scalar":tg(n,t.V.T,2,i);break;case"enum":tg(n,Ne.INT32,2,i);break;case"message":Cr(i!==void 0),n.tag(2,Lr.LengthDelimited).bytes(i.toBinary(e));break}n.join()}function EI(n,e,t,r){const i=t6(t.T,r);t.delimited?n.tag(t.no,Lr.StartGroup).raw(i.toBinary(e)).tag(t.no,Lr.EndGroup):n.tag(t.no,Lr.LengthDelimited).bytes(i.toBinary(e))}function tg(n,e,t,r){Cr(r!==void 0);let[i,a]=n6(e);n.tag(t,i)[a](r)}function $ye(n,e,t,r){if(!r.length)return;n.tag(t,Lr.LengthDelimited).fork();let[,i]=n6(e);for(let a=0;a<r.length;a++)n[i](r[a]);n.join()}function n6(n){let e=Lr.Varint;switch(n){case Ne.BYTES:case Ne.STRING:e=Lr.LengthDelimited;break;case Ne.DOUBLE:case Ne.FIXED64:case Ne.SFIXED64:e=Lr.Bit64;break;case Ne.FIXED32:case Ne.SFIXED32:case Ne.FLOAT:e=Lr.Bit32;break}const t=Ne[n].toLowerCase();return[e,t]}function Bye(){return{setEnumType:WF,initPartial(n,e){if(n===void 0)return;const t=e.getType();for(const r of t.fields.byMember()){const i=r.localName,a=e,s=n;if(s[i]!=null)switch(r.kind){case"oneof":const o=s[i].case;if(o===void 0)continue;const c=r.findField(o);let u=s[i].value;c&&c.kind=="message"&&!Uu(u,c.T)?u=new c.T(u):c&&c.kind==="scalar"&&c.T===Ne.BYTES&&(u=Cm(u)),a[i]={case:o,value:u};break;case"scalar":case"enum":let l=s[i];r.T===Ne.BYTES&&(l=r.repeated?l.map(Cm):Cm(l)),a[i]=l;break;case"map":switch(r.V.kind){case"scalar":case"enum":if(r.V.T===Ne.BYTES)for(const[p,g]of Object.entries(s[i]))a[i][p]=Cm(g);else Object.assign(a[i],s[i]);break;case"message":const h=r.V.T;for(const p of Object.keys(s[i])){let g=s[i][p];h.fieldWrapper||(g=new h(g)),a[i][p]=g}break}break;case"message":const d=r.T;if(r.repeated)a[i]=s[i].map(h=>Uu(h,d)?h:new d(h));else{const h=s[i];d.fieldWrapper?d.typeName==="google.protobuf.BytesValue"?a[i]=Cm(h):a[i]=h:a[i]=Uu(h,d)?h:new d(h)}break}}},equals(n,e,t){return e===t?!0:!e||!t?!1:n.fields.byMember().every(r=>{const i=e[r.localName],a=t[r.localName];if(r.repeated){if(i.length!==a.length)return!1;switch(r.kind){case"message":return i.every((s,o)=>r.T.equals(s,a[o]));case"scalar":return i.every((s,o)=>wl(r.T,s,a[o]));case"enum":return i.every((s,o)=>wl(Ne.INT32,s,a[o]))}throw new Error("repeated cannot contain ".concat(r.kind))}switch(r.kind){case"message":let s=i,o=a;return r.T.fieldWrapper&&(s!==void 0&&!Uu(s)&&(s=r.T.fieldWrapper.wrapField(s)),o!==void 0&&!Uu(o)&&(o=r.T.fieldWrapper.wrapField(o))),r.T.equals(s,o);case"enum":return wl(Ne.INT32,i,a);case"scalar":return wl(r.T,i,a);case"oneof":if(i.case!==a.case)return!1;const c=r.findField(i.case);if(c===void 0)return!0;switch(c.kind){case"message":return c.T.equals(i.value,a.value);case"enum":return wl(Ne.INT32,i.value,a.value);case"scalar":return wl(c.T,i.value,a.value)}throw new Error("oneof cannot contain ".concat(c.kind));case"map":const u=Object.keys(i).concat(Object.keys(a));switch(r.V.kind){case"message":const l=r.V.T;return u.every(h=>l.equals(i[h],a[h]));case"enum":return u.every(h=>wl(Ne.INT32,i[h],a[h]));case"scalar":const d=r.V.T;return u.every(h=>wl(d,i[h],a[h]))}break}})},clone(n){const e=n.getType(),t=new e,r=t;for(const i of e.fields.byMember()){const a=n[i.localName];let s;if(i.repeated)s=a.map(U0);else if(i.kind=="map"){s=r[i.localName];for(const[o,c]of Object.entries(a))s[o]=U0(c)}else i.kind=="oneof"?s=i.findField(a.case)?{case:a.case,value:U0(a.value)}:{case:void 0}:s=U0(a);r[i.localName]=s}for(const i of e.runtime.bin.listUnknownFields(n))e.runtime.bin.onUnknownField(r,i.no,i.wireType,i.data);return t}}}function U0(n){if(n===void 0)return n;if(Uu(n))return n.clone();if(n instanceof Uint8Array){const e=new Uint8Array(n.byteLength);return e.set(n),e}return n}function Cm(n){return n instanceof Uint8Array?n:new Uint8Array(n)}function Uye(n,e,t){return{syntax:n,json:Rye(),bin:Dye(),util:Object.assign(Object.assign({},Bye()),{newFieldList:e,initFields:t}),makeMessageType(r,i,a){return pye(this,r,i,a)},makeEnum:hye,makeEnumType:HF,getEnumType:fye,makeExtension(r,i,a){return wye(this,r,i,a)}}}class jye{constructor(e,t){this._fields=e,this._normalizer=t}findJsonName(e){if(!this.jsonNames){const t={};for(const r of this.list())t[r.jsonName]=t[r.name]=r;this.jsonNames=t}return this.jsonNames[e]}find(e){if(!this.numbers){const t={};for(const r of this.list())t[r.no]=r;this.numbers=t}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((e,t)=>e.no-t.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let t;for(const r of this.list())r.oneof?r.oneof!==t&&(t=r.oneof,e.push(t)):e.push(r)}return this.members}}function r6(n,e){const t=i6(n);return e?t:Gye(Vye(t))}function qye(n){return r6(n,!1)}const zye=i6;function i6(n){let e=!1;const t=[];for(let r=0;r<n.length;r++){let i=n.charAt(r);switch(i){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":t.push(i),e=!1;break;default:e&&(e=!1,i=i.toUpperCase()),t.push(i);break}}return t.join("")}const Wye=new Set(["constructor","toString","toJSON","valueOf"]),Hye=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),a6=n=>"".concat(n,"$"),Vye=n=>Hye.has(n)?a6(n):n,Gye=n=>Wye.has(n)?a6(n):n;class Kye{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=qye(e)}addField(e){Cr(e.oneof===this,"field ".concat(e.name," not one of ").concat(this.name)),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=Object.create(null);for(let t=0;t<this.fields.length;t++)this._lookup[this.fields[t].localName]=this.fields[t]}return this._lookup[e]}}function Yye(n,e){var t,r,i,a,s,o;const c=[];let u;for(const l of typeof n=="function"?n():n){const d=l;if(d.localName=r6(l.name,l.oneof!==void 0),d.jsonName=(t=l.jsonName)!==null&&t!==void 0?t:zye(l.name),d.repeated=(r=l.repeated)!==null&&r!==void 0?r:!1,l.kind=="scalar"&&(d.L=(i=l.L)!==null&&i!==void 0?i:Zl.BIGINT),d.delimited=(a=l.delimited)!==null&&a!==void 0?a:!1,d.req=(s=l.req)!==null&&s!==void 0?s:!1,d.opt=(o=l.opt)!==null&&o!==void 0?o:!1,l.packed===void 0&&(d.packed=l.kind=="enum"||l.kind=="scalar"&&l.T!=Ne.BYTES&&l.T!=Ne.STRING),l.oneof!==void 0){const h=typeof l.oneof=="string"?l.oneof:l.oneof.name;(!u||u.name!=h)&&(u=new Kye(h)),d.oneof=u,u.addField(d)}c.push(d)}return c}const pe=Uye("proto3",n=>new jye(n,e=>Yye(e)),n=>{for(const e of n.getType().fields.byMember()){if(e.opt)continue;const t=e.localName,r=n;if(e.repeated){r[t]=[];continue}switch(e.kind){case"oneof":r[t]={case:void 0};break;case"enum":r[t]=0;break;case"map":r[t]={};break;case"scalar":r[t]=dp(e.T,e.L);break}}});class Da extends $T{constructor(e){super(),this.seconds=ir.zero,this.nanos=0,pe.util.initPartial(e,this)}fromJson(e,t){if(typeof e!="string")throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(pe.json.debug(e)));const r=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invali
3890d RFC 3339 string");const i=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(i))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=ir.parse(i/1e3),this.nanos=0,r[7]&&(this.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),this}toJson(e){const t=Number(this.seconds)*1e3;if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let r="Z";if(this.nanos>0){const i=(this.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?r="."+i.substring(0,3)+"Z":i.substring(6)==="000"?r="."+i.substring(0,6)+"Z":r="."+i+"Z"}return new Date(t).toISOString().replace(".000Z",r)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return Da.fromDate(new Date)}static fromDate(e){const t=e.getTime();return new Da({seconds:ir.parse(Math.floor(t/1e3)),nanos:t%1e3*1e6})}static fromBinary(e,t){return new Da().fromBinary(e,t)}static fromJson(e,t){return new Da().fromJson(e,t)}static fromJsonString(e,t){return new Da().fromJsonString(e,t)}static equals(e,t){return pe.util.equals(Da,e,t)}}Da.runtime=pe;Da.typeName="google.protobuf.Timestamp";Da.fields=pe.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);const Xye=pe.makeMessageType("livekit.MetricsBatch",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Da},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:Jye,repeated:!0},{no:5,name:"events",kind:"message",T:Zye,repeated:!0}]),Jye=pe.makeMessageType("livekit.TimeSeriesMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:Qye,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}]),Qye=pe.makeMessageType("livekit.MetricSample",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Da},{no:3,name:"value",kind:"scalar",T:2}]),Zye=pe.makeMessageType("livekit.EventMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:Da},{no:7,name:"normalized_end_timestamp",kind:"message",T:Da,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}]),s6=pe.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"PREFER_REGRESSION"},{no:1,name:"SIMULCAST"},{no:2,name:"REGRESSION"}]),Wo=pe.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),zr=pe.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),UT=pe.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),Fm=pe.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),Og=pe.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),Zo=pe.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"},{no:13,name:"SIP_TRUNK_FAILURE"},{no:14,name:"CONNECTION_TIMEOUT"},{no:15,name:"MEDIA_FAILURE"},{no:16,name:"AGENT_ERROR"}]),Dd=pe.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),e_e=pe.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),hi=pe.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"},{no:6,name:"TF_PRECONNECT_BUFFER"}]),o6=pe.makeEnum("livekit.PacketTrailerFeature",[{no:0,name:"PTF_USER_TIMESTAMP"},{no:1,name:"PTF_FRAME_ID"}]),Lb=pe.makeMessageType("livekit.Room",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:15,name:"creation_time_ms",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:E_,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:b6}]),E_=pe.makeMessageType("livekit.Codec",()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}]),t_e=pe.makeMessageType("livekit.ParticipantPermission",()=>[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:pe.getEnumType(zr),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8},{no:13,name:"can_manage_agent_session",kind:"scalar",T:8}]),bf=pe.makeMessageType("livekit.ParticipantInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:pe.getEnumType(Vh)},{no:4,name:"tracks",kind:"message",T:Eh,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:17,name:"joined_at_ms",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:t_e},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:pe.getEnumType(Mg)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:pe.getEnumType(Zo)},{no:18,name:"kind_details",kind:"enum",T:pe.getEnumType(n_e),repeated:!0},{no:19,name:"data_tracks",kind:"message",T:Fb,repeated:!0},{no:20,name:"client_protocol",kind:"scalar",T:5}]),Vh=pe.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),Mg=pe.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"},{no:7,name:"CONNECTOR"},{no:8,name:"BRIDGE"}]),n_e=pe.makeEnum("livekit.ParticipantInfo.KindDetail",[{no:0,name:"CLOUD_AGENT"},{no:1,name:"FORWARDED"},{no:2,name:"CONNECTOR_WHATSAPP"},{no:3,name:"CONNECTOR_TWILIO"},{no:4,name:"BRIDGE_RTSP"}]),Bn=pe.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),r_e=pe.makeMessageType("livekit.SimulcastCodecInfo",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:ql,repeated:!0},{no:5,name:"video_layer_mode",kind:"enum",T:pe.getEnumType(c6)},{no:6,name:"sdp_cid",kind:"scalar",T:9}]),Eh=pe.makeMessageType("livekit.TrackInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:pe.getEnumType(Wo)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:pe.getEnumType(zr)},{no:10,name:"layers",kind:"message",T:ql,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:r_e,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:pe.getEnumType(Bn)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:b6},{no:19,name:"audio_features",kind:"enum",T:pe.getEnumType(hi),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:pe.getEnumType(s6)},{no:21,name:"packet_trailer_features",kind:"enum",T:pe.getEnumType(o6),repeated:!0}]),Fb=pe.makeMessageType("livekit.DataTrackInfo",()=>[{no:1,name:"pub_handle",kind:"scalar",T:13},{no:2,name:"sid",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"encryption",kind:"enum",T:pe.getEnumType(Bn)}]),i_e=pe.makeMessageType("livekit.DataTrackSubscriptionOptions",()=>[{no:1,name:"target_fps",kind:"scalar",T:13,opt:!0}]),ql=pe.makeMessageType("livekit.VideoLayer",()=>[{no:1,name:"quality",kind:"enum",T:pe.getEnumType(UT)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13},{no:6,name:"spatial_layer",kind:"scalar",T:5},{no:7,name:"rid",kind:"scalar",T:9},{no:8,name:"repair_ssrc",kind:"scalar",T:13}]),c6=pe.makeEnum("livekit.VideoLayer.Mode",[{no:0,name:"MODE_UNUSED"},{no:1,name:"ONE_SPATIAL_LAYER_PER_STREAM"},{no:2,name:"MULTIPLE_SPATIAL_LAYERS_PER_STREAM"},{no:3,name:"ONE_SPATIAL_LAYER_PER_STREAM_INCOMPLETE_RTCP_SR"}]),ga=pe.makeMessageType("livekit.DataPacket",()=>[{no:1,name:"kind",kind:"enum",T:pe.getEnumType(Kd)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:jT,oneof:"value"},{no:3,name:"speaker",kind:"message",T:a_e,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:f6,oneof:"value"},{no:7,name:"transcription",kind:"message",T:s_e,oneof:"value"},{no:8,name:"metrics",kind:"message",T:Xye,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:P_,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:qT,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:zT,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:WT,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:R_,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:A_,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:I_,oneof:"value"},{no:18,name:"encrypted_packet",kind:"message",T:u6,oneof:"value"},{no:16,name:"sequence",kind:"scalar",T:13},{no:17,name:"participant_sid",kind:"scalar",T:9}]),Kd=pe.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),u6=pe.makeMessageType("livekit.EncryptedPacket",()=>[{no:1,name:"encryption_type",kind:"enum",T:pe.getEnumType(Bn)},{no:2,name:"iv",kind:"scalar",T:12},{no:3,name:"key_index",kind:"scalar",T:13},{no:4,name:"encrypted_value",kind:"scalar",T:12}]),l6=pe.makeMessageType("livekit.EncryptedPacketPayload",()=>[{no:1,name:"user",kind:"message",T:jT,oneof:"value"},{no:3,name:"chat_message",kind:"message",T:P_,oneof:"value"},{no:4,name:"rpc_request",kind:"message",T:qT,oneof:"value"},{no:5,name:"rpc_ack",kind:"message",T:zT,oneof:"value"},{no:6,name:"rpc_response",kind:"message",T:WT,oneof:"value"},{no:7,name:"stream_header",kind:"message",T:R_,oneof:"value"},{no:8,name:"stream_chunk",kind:"message",T:A_,oneof:"value"},{no:9,name:"stream_trailer",kind:"message",T:I_,oneof:"value"}]),a_e=pe.makeMessageType("livekit.ActiveSpeakerUpdate",()=>[{no:1,name:"speakers",kind:"message",T:d6,repeated:!0}]),d6=pe.makeMessageType("livekit.SpeakerInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}]),jT=pe.makeMessageType("livekit.UserPacket",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0},{no:11,name:"nonce",kind:"scalar",T:12}]),f6=pe.makeMessageType("livekit.SipDTMF",()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}]),s_e=pe.makeMessageType("livekit.Transcription",()=>[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:o_e,repeated:!0}]),o_e=pe.makeMessageType("livekit.TranscriptionSegment",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}]),P_=pe.makeMessageType("livekit.ChatMessage",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}]),qT=pe.makeMessageType("livekit.RpcRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13},{no:6,name:"compressed_payload",kind:"scalar",T:12}]),zT=pe.makeMessageType("livekit.RpcAck",()=>[{no:1,name:"request_id",kind:"scalar",T:9}]),WT=pe.makeMessageType("livekit.RpcResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:h6,oneof:"value"},{no:4,name:"compressed_payload",kind:"scalar",T:12,oneof:"value"}]),h6=pe.makeMessageType("livekit.RpcError",()=>[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}]),p6=pe.makeMessageType("livekit.ParticipantTracks",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}]),m6=pe.makeMessageType("livekit.ServerInfo",()=>[{no:1,name:"edition",kind:"enum",T:pe.getEnumType(g6)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}]),g6=pe.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),v6=pe.makeMessageType("livekit.ClientInfo",()=>[{no:1,name:"sdk",kind:"enum",T:pe.getEnumType(y6)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9},{no:12,name:"client_protocol",kind:"scalar",T:5}]),y6=pe.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,
vendor: 16,384 bytes, line 3890
3890name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"},{no:13,name:"UNREAL"},{no:14,name:"ESP32"}]),_6=pe.makeMessageType("livekit.ClientConfiguration",()=>[{no:1,name:"video",kind:"message",T:PI},{no:2,name:"screen",kind:"message",T:PI},{no:3,name:"resume_connection",kind:"enum",T:pe.getEnumType(Og)},{no:4,name:"disabled_codecs",kind:"message",T:c_e},{no:5,name:"force_relay",kind:"enum",T:pe.getEnumType(Og)}]),PI=pe.makeMessageType("livekit.VideoConfiguration",()=>[{no:1,name:"hardware_encoder",kind:"enum",T:pe.getEnumType(Og)}]),c_e=pe.makeMessageType("livekit.DisabledCodecs",()=>[{no:1,name:"codecs",kind:"message",T:E_,repeated:!0},{no:2,name:"publish",kind:"message",T:E_,repeated:!0}]),b6=pe.makeMessageType("livekit.TimedVersion",()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]),Rk=pe.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),x6=pe.makeMessageType("livekit.DataStream.TextHeader",()=>[{no:1,name:"operation_type",kind:"enum",T:pe.getEnumType(Rk)},{no:2,name:"version",kind:"scalar",T:5},{no:3,name:"reply_to_stream_id",kind:"scalar",T:9},{no:4,name:"attached_stream_ids",kind:"scalar",T:9,repeated:!0},{no:5,name:"generated",kind:"scalar",T:8}],{localName:"DataStream_TextHeader"}),w6=pe.makeMessageType("livekit.DataStream.ByteHeader",()=>[{no:1,name:"name",kind:"scalar",T:9}],{localName:"DataStream_ByteHeader"}),R_=pe.makeMessageType("livekit.DataStream.Header",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"topic",kind:"scalar",T:9},{no:4,name:"mime_type",kind:"scalar",T:9},{no:5,name:"total_length",kind:"scalar",T:4,opt:!0},{no:7,name:"encryption_type",kind:"enum",T:pe.getEnumType(Bn)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:x6,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:w6,oneof:"content_header"}],{localName:"DataStream_Header"}),A_=pe.makeMessageType("livekit.DataStream.Chunk",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"chunk_index",kind:"scalar",T:4},{no:3,name:"content",kind:"scalar",T:12},{no:4,name:"version",kind:"scalar",T:5},{no:5,name:"iv",kind:"scalar",T:12,opt:!0}],{localName:"DataStream_Chunk"}),I_=pe.makeMessageType("livekit.DataStream.Trailer",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"reason",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}}],{localName:"DataStream_Trailer"}),u_e=pe.makeMessageType("livekit.SubscribedAudioCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"enabled",kind:"scalar",T:8}]),Ho=pe.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),Ak=pe.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),l_e=pe.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),d_e=pe.makeMessageType("livekit.SignalRequest",()=>[{no:1,name:"offer",kind:"message",T:ed,oneof:"message"},{no:2,name:"answer",kind:"message",T:ed,oneof:"message"},{no:3,name:"trickle",kind:"message",T:$b,oneof:"message"},{no:4,name:"add_track",kind:"message",T:Dg,oneof:"message"},{no:5,name:"mute",kind:"message",T:Bb,oneof:"message"},{no:6,name:"subscription",kind:"message",T:Ub,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:S6,oneof:"message"},{no:8,name:"leave",kind:"message",T:jb,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:E6,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:A6,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:QT,oneof:"message"},{no:13,name:"simulate",kind:"message",T:Tc,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:XT,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:M6,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:YT,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:T6,oneof:"message"},{no:19,name:"publish_data_track_request",kind:"message",T:HT,oneof:"message"},{no:20,name:"unpublish_data_track_request",kind:"message",T:GT,oneof:"message"},{no:21,name:"update_data_subscription",kind:"message",T:C6,oneof:"message"}]),RI=pe.makeMessageType("livekit.SignalResponse",()=>[{no:1,name:"join",kind:"message",T:m_e,oneof:"message"},{no:2,name:"answer",kind:"message",T:ed,oneof:"message"},{no:3,name:"offer",kind:"message",T:ed,oneof:"message"},{no:4,name:"trickle",kind:"message",T:$b,oneof:"message"},{no:5,name:"update",kind:"message",T:y_e,oneof:"message"},{no:6,name:"track_published",kind:"message",T:KT,oneof:"message"},{no:8,name:"leave",kind:"message",T:jb,oneof:"message"},{no:9,name:"mute",kind:"message",T:Bb,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:__e,oneof:"message"},{no:11,name:"room_update",kind:"message",T:b_e,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:w_e,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:k_e,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:T_e,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:P_e,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:v_e,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:g_e,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:A_e,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:M_e,oneof:"message"},{no:22,name:"request_response",kind:"message",T:D_e,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:N_e,oneof:"message"},{no:24,name:"room_moved",kind:"message",T:R_e,oneof:"message"},{no:25,name:"media_sections_requirement",kind:"message",T:$_e,oneof:"message"},{no:26,name:"subscribed_audio_codec_update",kind:"message",T:E_e,oneof:"message"},{no:27,name:"publish_data_track_response",kind:"message",T:VT,oneof:"message"},{no:28,name:"unpublish_data_track_response",kind:"message",T:f_e,oneof:"message"},{no:29,name:"data_track_subscriber_handles",kind:"message",T:h_e,oneof:"message"}]),Ik=pe.makeMessageType("livekit.SimulcastCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:ql,repeated:!0},{no:5,name:"video_layer_mode",kind:"enum",T:pe.getEnumType(c6)}]),Dg=pe.makeMessageType("livekit.AddTrackRequest",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:pe.getEnumType(Wo)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:pe.getEnumType(zr)},{no:9,name:"layers",kind:"message",T:ql,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:Ik,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:pe.getEnumType(Bn)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:pe.getEnumType(s6)},{no:17,name:"audio_features",kind:"enum",T:pe.getEnumType(hi),repeated:!0},{no:18,name:"packet_trailer_features",kind:"enum",T:pe.getEnumType(o6),repeated:!0}]),HT=pe.makeMessageType("livekit.PublishDataTrackRequest",()=>[{no:1,name:"pub_handle",kind:"scalar",T:13},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"encryption",kind:"enum",T:pe.getEnumType(Bn)}]),VT=pe.makeMessageType("livekit.PublishDataTrackResponse",()=>[{no:1,name:"info",kind:"message",T:Fb}]),GT=pe.makeMessageType("livekit.UnpublishDataTrackRequest",()=>[{no:1,name:"pub_handle",kind:"scalar",T:13}]),f_e=pe.makeMessageType("livekit.UnpublishDataTrackResponse",()=>[{no:1,name:"info",kind:"message",T:Fb}]),h_e=pe.makeMessageType("livekit.DataTrackSubscriberHandles",()=>[{no:1,name:"sub_handles",kind:"map",K:13,V:{kind:"message",T:p_e}}]),p_e=pe.makeMessageType("livekit.DataTrackSubscriberHandles.PublishedDataTrack",()=>[{no:1,name:"publisher_identity",kind:"scalar",T:9},{no:2,name:"publisher_sid",kind:"scalar",T:9},{no:3,name:"track_sid",kind:"scalar",T:9}],{localName:"DataTrackSubscriberHandles_PublishedDataTrack"}),$b=pe.makeMessageType("livekit.TrickleRequest",()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:pe.getEnumType(Ho)},{no:3,name:"final",kind:"scalar",T:8}]),Bb=pe.makeMessageType("livekit.MuteTrackRequest",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}]),m_e=pe.makeMessageType("livekit.JoinResponse",()=>[{no:1,name:"room",kind:"message",T:Lb},{no:2,name:"participant",kind:"message",T:bf},{no:3,name:"other_participants",kind:"message",T:bf,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:P6,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:_6},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:m6},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:E_,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}]),g_e=pe.makeMessageType("livekit.ReconnectResponse",()=>[{no:1,name:"ice_servers",kind:"message",T:P6,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:_6},{no:3,name:"server_info",kind:"message",T:m6},{no:4,name:"last_message_seq",kind:"scalar",T:13}]),KT=pe.makeMessageType("livekit.TrackPublishedResponse",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:Eh}]),v_e=pe.makeMessageType("livekit.TrackUnpublishedResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),ed=pe.makeMessageType("livekit.SessionDescription",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9},{no:3,name:"id",kind:"scalar",T:13},{no:4,name:"mid_to_track_id",kind:"map",K:9,V:{kind:"scalar",T:9}}]),y_e=pe.makeMessageType("livekit.ParticipantUpdate",()=>[{no:1,name:"participants",kind:"message",T:bf,repeated:!0}]),Ub=pe.makeMessageType("livekit.UpdateSubscription",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:p6,repeated:!0}]),C6=pe.makeMessageType("livekit.UpdateDataSubscription",()=>[{no:1,name:"updates",kind:"message",T:k6,repeated:!0}]),k6=pe.makeMessageType("livekit.UpdateDataSubscription.Update",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"options",kind:"message",T:i_e}],{localName:"UpdateDataSubscription_Update"}),S6=pe.makeMessageType("livekit.UpdateTrackSettings",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:pe.getEnumType(UT)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}]),YT=pe.makeMessageType("livekit.UpdateLocalAudioTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:pe.getEnumType(hi),repeated:!0}]),T6=pe.makeMessageType("livekit.UpdateLocalVideoTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}]),jb=pe.makeMessageType("livekit.LeaveRequest",()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:pe.getEnumType(Zo)},{no:3,name:"action",kind:"enum",T:pe.getEnumType(Gh)},{no:4,name:"regions",kind:"message",T:I_e}]),Gh=pe.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),E6=pe.makeMessageType("livekit.UpdateVideoLayers",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:ql,repeated:!0}]),XT=pe.makeMessageType("livekit.UpdateParticipantMetadata",()=>[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}]),P6=pe.makeMessageType("livekit.ICEServer",()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]),__e=pe.makeMessageType("livekit.SpeakersChanged",()=>[{no:1,name:"speakers",kind:"message",T:d6,repeated:!0}]),b_e=pe.makeMessageType("livekit.RoomUpdate",()=>[{no:1,name:"room",kind:"message",T:Lb}]),x_e=pe.makeMessageType("livekit.ConnectionQualityInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:pe.getEnumType(Fm)},{no:3,name:"score",kind:"scalar",T:2}]),w_e=pe.makeMessageType("livekit.ConnectionQualityUpdate",()=>[{no:1,name:"updates",kind:"message",T:x_e,repeated:!0}]),C_e=pe.makeMessageType("livekit.StreamStateInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:pe.getEnumType(Ak)}]),k_e=pe.makeMessageType("livekit.StreamStateUpdate",()=>[{no:1,name:"stream_states",kind:"message",T:C_e,repeated:!0}]),JT=pe.makeMessageType("livekit.SubscribedQuality",()=>[{no:1,name:"quality",kind:"enum",T:pe.getEnumType(UT)},{no:2,name:"enabled",kind:"scalar",T:8}]),S_e=pe.makeMessageType("livekit.SubscribedCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:JT,repeated:!0}]),T_e=pe.makeMessageType("livekit.SubscribedQualityUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:JT,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:S_e,repeated:!0}]),E_e=pe.makeMessageType("livekit.SubscribedAudioCodecUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_audio_codecs",kind:"message",T:u_e,repeated:!0}]),R6=pe.makeMessageType("livekit.TrackPermission",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}]),A6=pe.makeMessageType("livekit.SubscriptionPermission",()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:R6,repeated:!0}]),P_e=pe.makeMessageType("livekit.SubscriptionPermissionUpdate",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}]),R_e=pe.makeMessageType("livekit.RoomMovedResponse",()=>[{no:1,name:"room",kind:"message",T:Lb},{no:2,name:"token",kind:"scalar",T:9},{no:3,name:"participant",kind:"message",T:bf},{no:4,name:"other_participants",kind:"message",T:bf,repeated:!0}]),QT=pe.makeMessageType("livekit.SyncState",()=>[{no:1,name:"answer",kind:"message",T:ed},{no:2,name:"subscription",kind:"message",T:Ub},{no:3,name:"publish_tracks",kind:"message",T:KT,repeated:!0},{no:4,name:"data_channels",kind:"message",T:O6,repeated:!0},{no:5,name:"offer",kind:"message",T:ed},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0},{no:7,name:"datachannel_receive_states",kind:"message",T:I6,repeated:!0},{no:8,name:"publish_data_tracks",kind:"message",T:VT,repeated:!0}]),I6=pe.makeMessageType("livekit.DataChannelReceiveState",()=>[{no:1,name:"publisher_sid",kind:"scalar",T:9},{no:2,name:"last_seq",kind:"scalar",T:13}]),O6=pe.makeMessageType("livekit.DataChannelInfo",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:pe.getEnumType(Ho)}]),Tc=pe.makeMessageType("livekit.SimulateScenario",()=>[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:pe.getEnumType(l_e),oneof:"scenario"},{no:6,name
vendor: 68,168 bytes, lines 3890-3924
3890:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}]),M6=pe.makeMessageType("livekit.Ping",()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}]),A_e=pe.makeMessageType("livekit.Pong",()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}]),I_e=pe.makeMessageType("livekit.RegionSettings",()=>[{no:1,name:"regions",kind:"message",T:O_e,repeated:!0}]),O_e=pe.makeMessageType("livekit.RegionInfo",()=>[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}]),M_e=pe.makeMessageType("livekit.SubscriptionResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:pe.getEnumType(e_e)}]),D_e=pe.makeMessageType("livekit.RequestResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:pe.getEnumType(Ud)},{no:3,name:"message",kind:"scalar",T:9},{no:4,name:"trickle",kind:"message",T:$b,oneof:"request"},{no:5,name:"add_track",kind:"message",T:Dg,oneof:"request"},{no:6,name:"mute",kind:"message",T:Bb,oneof:"request"},{no:7,name:"update_metadata",kind:"message",T:XT,oneof:"request"},{no:8,name:"update_audio_track",kind:"message",T:YT,oneof:"request"},{no:9,name:"update_video_track",kind:"message",T:T6,oneof:"request"},{no:10,name:"publish_data_track",kind:"message",T:HT,oneof:"request"},{no:11,name:"unpublish_data_track",kind:"message",T:GT,oneof:"request"}]),Ud=pe.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"},{no:4,name:"QUEUED"},{no:5,name:"UNSUPPORTED_TYPE"},{no:6,name:"UNCLASSIFIED_ERROR"},{no:7,name:"INVALID_HANDLE"},{no:8,name:"INVALID_NAME"},{no:9,name:"DUPLICATE_HANDLE"},{no:10,name:"DUPLICATE_NAME"}]),N_e=pe.makeMessageType("livekit.TrackSubscribed",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),D6=pe.makeMessageType("livekit.ConnectionSettings",()=>[{no:1,name:"auto_subscribe",kind:"scalar",T:8},{no:2,name:"adaptive_stream",kind:"scalar",T:8},{no:3,name:"subscriber_allow_pause",kind:"scalar",T:8,opt:!0},{no:4,name:"disable_ice_lite",kind:"scalar",T:8},{no:5,name:"auto_subscribe_data_track",kind:"scalar",T:8,opt:!0}]),L_e=pe.makeMessageType("livekit.JoinRequest",()=>[{no:1,name:"client_info",kind:"message",T:v6},{no:2,name:"connection_settings",kind:"message",T:D6},{no:3,name:"metadata",kind:"scalar",T:9},{no:4,name:"participant_attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:5,name:"add_track_requests",kind:"message",T:Dg,repeated:!0},{no:6,name:"publisher_offer",kind:"message",T:ed},{no:7,name:"reconnect",kind:"scalar",T:8},{no:8,name:"reconnect_reason",kind:"enum",T:pe.getEnumType(Dd)},{no:9,name:"participant_sid",kind:"scalar",T:9},{no:10,name:"sync_state",kind:"message",T:QT}]),F_e=pe.makeMessageType("livekit.WrappedJoinRequest",()=>[{no:1,name:"compression",kind:"enum",T:pe.getEnumType(Ok)},{no:2,name:"join_request",kind:"scalar",T:12}]),Ok=pe.makeEnum("livekit.WrappedJoinRequest.Compression",[{no:0,name:"NONE"},{no:1,name:"GZIP"}]),$_e=pe.makeMessageType("livekit.MediaSectionsRequirement",()=>[{no:1,name:"num_audios",kind:"scalar",T:13},{no:2,name:"num_videos",kind:"scalar",T:13}]);function B_e(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var yy={exports:{}},U_e=yy.exports,AI;function j_e(){return AI||(AI=1,function(n){(function(e,t){n.exports?n.exports=t():e.log=t()})(U_e,function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],a={},s=null;function o(v,y){var b=v[y];if(typeof b.bind=="function")return b.bind(v);try{return Function.prototype.bind.call(b,v)}catch{return function(){return Function.prototype.apply.apply(b,[v,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(v){return v==="debug"&&(v="log"),typeof console===t?!1:v==="trace"&&r?c:console[v]!==void 0?o(console,v):console.log!==void 0?o(console,"log"):e}function l(){for(var v=this.getLevel(),y=0;y<i.length;y++){var b=i[y];this[b]=y<v?e:this.methodFactory(b,v,this.name)}if(this.log=this.debug,typeof console===t&&v<this.levels.SILENT)return"No console available for logging"}function d(v){return function(){typeof console!==t&&(l.call(this),this[v].apply(this,arguments))}}function h(v,y,b){return u(v)||d.apply(this,arguments)}function p(v,y){var b=this,x,S,w,k="loglevel";typeof v=="string"?k+=":"+v:typeof v=="symbol"&&(k=void 0);function E(j){var L=(i[j]||"silent").toUpperCase();if(!(typeof window===t||!k)){try{window.localStorage[k]=L;return}catch{}try{window.document.cookie=encodeURIComponent(k)+"="+L+";"}catch{}}}function I(){var j;if(!(typeof window===t||!k)){try{j=window.localStorage[k]}catch{}if(typeof j===t)try{var L=window.document.cookie,B=encodeURIComponent(k),V=L.indexOf(B+"=");V!==-1&&(j=/^([^;]+)/.exec(L.slice(V+B.length+1))[1])}catch{}return b.levels[j]===void 0&&(j=void 0),j}}function P(){if(!(typeof window===t||!k)){try{window.localStorage.removeItem(k)}catch{}try{window.document.cookie=encodeURIComponent(k)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function A(j){var L=j;if(typeof L=="string"&&b.levels[L.toUpperCase()]!==void 0&&(L=b.levels[L.toUpperCase()]),typeof L=="number"&&L>=0&&L<=b.levels.SILENT)return L;throw new TypeError("log.setLevel() called with invalid level: "+j)}b.name=v,b.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},b.methodFactory=y||h,b.getLevel=function(){return w??S??x},b.setLevel=function(j,L){return w=A(j),L!==!1&&E(w),l.call(b)},b.setDefaultLevel=function(j){S=A(j),I()||b.setLevel(j,!1)},b.resetLevel=function(){w=null,P(),l.call(b)},b.enableAll=function(j){b.setLevel(b.levels.TRACE,j)},b.disableAll=function(j){b.setLevel(b.levels.SILENT,j)},b.rebuild=function(){if(s!==b&&(x=A(s.getLevel())),l.call(b),s===b)for(var j in a)a[j].rebuild()},x=A(s?s.getLevel():"WARN");var N=I();N!=null&&(w=A(N)),l.call(b)}s=new p,s.getLogger=function(y){if(typeof y!="symbol"&&typeof y!="string"||y==="")throw new TypeError("You must supply a name when creating a logger.");var b=a[y];return b||(b=a[y]=new p(y,s.methodFactory)),b};var g=typeof window!==t?window.log:void 0;return s.noConflict=function(){return typeof window!==t&&window.log===s&&(window.log=g),s},s.getLoggers=function(){return a},s.default=s,s})}(yy)),yy.exports}var qb=j_e(),Mk;(function(n){n[n.trace=0]="trace",n[n.debug=1]="debug",n[n.info=2]="info",n[n.warn=3]="warn",n[n.error=4]="error",n[n.silent=5]="silent"})(Mk||(Mk={}));var yi;(function(n){n.Default="livekit",n.Room="livekit-room",n.TokenSource="livekit-token-source",n.Participant="livekit-participant",n.Track="livekit-track",n.Publication="livekit-track-publication",n.Engine="livekit-engine",n.Signal="livekit-signal",n.PCManager="livekit-pc-manager",n.PCTransport="livekit-pc-transport",n.E2EE="lk-e2ee",n.DataTracks="livekit-data-tracks"})(yi||(yi={}));let qt=qb.getLogger(yi.Default);Object.values(yi).map(n=>qb.getLogger(n));qt.setDefaultLevel(Mk.info);function Ha(n,e){const t=qb.getLogger(n);return t.setDefaultLevel(qt.getLevel()),e?q_e(t,e):t}function q_e(n,e){const t=i=>(a,s)=>{const o=e(),c=o||s?Object.assign(Object.assign({},o),s):void 0;n[i](a,c)},r=Object.create(n);return r.trace=t("trace"),r.debug=t("debug"),r.info=t("info"),r.warn=t("warn"),r.error=t("error"),r}const z_e=qb.getLogger(yi.E2EE),km=7e3,W_e=[0,300,2*2*300,3*3*300,4*4*300,km,km,km,km,km];class H_e{constructor(e){this._retryDelays=e!==void 0?[...e]:W_e}nextRetryDelayInMs(e){if(e.retryCount>=this._retryDelays.length)return null;const t=this._retryDelays[e.retryCount];return e.retryCount<=1?t:t+Math.random()*1e3}}function V_e(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function Q(n,e,t,r){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(l){try{u(r.next(l))}catch(d){s(d)}}function c(l){try{u(r.throw(l))}catch(d){s(d)}}function u(l){l.done?a(l.value):i(l.value).then(o,c)}u((r=r.apply(n,e||[])).next())})}function II(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function fp(n){return this instanceof fp?(this.v=n,this):new fp(n)}function G_e(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,a=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(p){return function(g){return Promise.resolve(g).then(p,d)}}function o(p,g){r[p]&&(i[p]=function(v){return new Promise(function(y,b){a.push([p,v,y,b])>1||c(p,v)})},g&&(i[p]=g(i[p])))}function c(p,g){try{u(r[p](g))}catch(v){h(a[0][3],v)}}function u(p){p.value instanceof fp?Promise.resolve(p.value.v).then(l,d):h(a[0][2],p)}function l(p){c("next",p)}function d(p){c("throw",p)}function h(p,g){p(g),a.shift(),a.length&&c(a[0][0],a[0][1])}}function K_e(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,a){e[i]=n[i]?function(s){return(t=!t)?{value:fp(n[i](s)),done:!1}:a?a(s):s}:a}}function Vo(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof II=="function"?II(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(a){t[a]=n[a]&&function(s){return new Promise(function(o,c){s=n[a](s),i(o,c,s.done,s.value)})}}function i(a,s,o,c){Promise.resolve(c).then(function(u){a({value:u,done:o})},s)}}var j0={exports:{}},OI;function Y_e(){if(OI)return j0.exports;OI=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(k,E,I){return Function.prototype.apply.call(k,E,I)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(k){return Object.getOwnPropertyNames(k).concat(Object.getOwnPropertySymbols(k))}:t=function(k){return Object.getOwnPropertyNames(k)};function r(w){console&&console.warn&&console.warn(w)}var i=Number.isNaN||function(k){return k!==k};function a(){a.init.call(this)}j0.exports=a,j0.exports.once=b,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function o(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(w){if(typeof w!="number"||w<0||i(w))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+w+".");s=w}}),a.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(k){if(typeof k!="number"||k<0||i(k))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+k+".");return this._maxListeners=k,this};function c(w){return w._maxListeners===void 0?a.defaultMaxListeners:w._maxListeners}a.prototype.getMaxListeners=function(){return c(this)},a.prototype.emit=function(k){for(var E=[],I=1;I<arguments.length;I++)E.push(arguments[I]);var P=k==="error",A=this._events;if(A!==void 0)P=P&&A.error===void 0;else if(!P)return!1;if(P){var N;if(E.length>0&&(N=E[0]),N instanceof Error)throw N;var j=new Error("Unhandled error."+(N?" ("+N.message+")":""));throw j.context=N,j}var L=A[k];if(L===void 0)return!1;if(typeof L=="function")e(L,this,E);else for(var B=L.length,V=g(L,B),I=0;I<B;++I)e(V[I],this,E);return!0};function u(w,k,E,I){var P,A,N;if(o(E),A=w._events,A===void 0?(A=w._events=Object.create(null),w._eventsCount=0):(A.newListener!==void 0&&(w.emit("newListener",k,E.listener?E.listener:E),A=w._events),N=A[k]),N===void 0)N=A[k]=E,++w._eventsCount;else if(typeof N=="function"?N=A[k]=I?[E,N]:[N,E]:I?N.unshift(E):N.push(E),P=c(w),P>0&&N.length>P&&!N.warned){N.warned=!0;var j=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(k)+" listeners added. Use emitter.setMaxListeners() to increase limit");j.name="MaxListenersExceededWarning",j.emitter=w,j.type=k,j.count=N.length,r(j)}return w}a.prototype.addListener=function(k,E){return u(this,k,E,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(k,E){return u(this,k,E,!0)};function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(w,k,E){var I={fired:!1,wrapFn:void 0,target:w,type:k,listener:E},P=l.bind(I);return P.listener=E,I.wrapFn=P,P}a.prototype.once=function(k,E){return o(E),this.on(k,d(this,k,E)),this},a.prototype.prependOnceListener=function(k,E){return o(E),this.prependListener(k,d(this,k,E)),this},a.prototype.removeListener=function(k,E){var I,P,A,N,j;if(o(E),P=this._events,P===void 0)return this;if(I=P[k],I===void 0)return this;if(I===E||I.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete P[k],P.removeListener&&this.emit("removeListener",k,I.listener||E));else if(typeof I!="function"){for(A=-1,N=I.length-1;N>=0;N--)if(I[N]===E||I[N].listener===E){j=I[N].listener,A=N;break}if(A<0)return this;A===0?I.shift():v(I,A),I.length===1&&(P[k]=I[0]),P.removeListener!==void 0&&this.emit("removeListener",k,j||E)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(k){var E,I,P;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[k]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[k]),this;if(arguments.length===0){var A=Object.keys(I),N;for(P=0;P<A.length;++P)N=A[P],N!=="removeListener"&&this.removeAllListeners(N);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(E=I[k],typeof E=="function")this.removeListener(k,E);else if(E!==void 0)for(P=E.length-1;P>=0;P--)this.removeListener(k,E[P]);return this};function h(w,k,E){var I=w._events;if(I===void 0)return[];var P=I[k];return P===void 0?[]:typeof P=="function"?E?[P.listener||P]:[P]:E?y(P):g(P,P.length)}a.prototype.listeners=function(k){return h(this,k,!0)},a.prototype.rawListeners=function(k){return h(this,k,!1)},a.listenerCount=function(w,k){return typeof w.listenerCount=="function"?w.listenerCount(k):p.call(w,k)},a.prototype.listenerCount=p;function p(w){var k=this._events;if(k!==void 0){var E=k[w];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function g(w,k){for(var E=new Array(k),I=0;I<k;++I)E[I]=w[I];return E}function v(w,k){for(;k+1<w.length;k++)w[k]=w[k+1];w.pop()}function y(w){for(var k=new Array(w.length),E=0;E<k.length;++E)k[E]=w[E].listener||w[E];return k}function b(w,k){return new Promise(function(E,I){function P(N){w.removeListener(k,A),I(N)}function A(){typeof w.removeListener=="function"&&w.removeListener("error",P),E([].slice.call(arguments))}S(w,k,A,{once:!0}),k!=="error"&&x(w,P,{once:!0})})}function x(w,k,E){typeof w.on=="function"&&S(w,"error",k,E)}function S(w,k,E,I){if(typeof w.on=="function")I.once?w.once(k,E):w.on(k,E);else if(typeof w.addEventListener=="function")w.addEventListener(k,function P(A){I.once&&w.removeEventListener(k,P),E(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof w)}return j0.exports}var xo=Y_e();let N6=!0,L6=!0;function $m(n,e,t){const r=n.match(e);return r&&r.length>=t&&parseFloat(r[t],10)}function Nf(n,e,t){if(!n.RTCPeerConnection)return;if(!Object.getOwnPropertyDescriptor(EventTarget.prototype,"addEventListener").writable){ZT("Unable to polyfill events");return}const i=n.RTCPeerConnection.prototype,a=i.addEventListener;i.addEventListener=function(o,c){if(o!==e)return a.apply(this,arguments);const u=l=>{const d=t(l);d&&(c.handleEvent?c.handleEvent(d):c(d))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(c,u),a.apply(this,[o,u])};const s=i.removeEventListener;i.removeEventListener=function(o,c){if(o!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(c))return s.apply(this,arguments);const u=this._eventMap[e].get(c);return this._eventMap[e].delete(c),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,u])},Object.defineProperty(i,"on"+e,{get(){return this["_on"+e]},set(o){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),o&&this.addEventListener(e,this["_on"+e]=o)},enumerable:!0,configurable:!0})}function X_e(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):(N6=n,n?"adapter.js logging disabled":"adapter.js logging enabled")}function J_e(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):(L6=!n,"adapter.js deprecation warnings "+(n?"disabled":"enabled"))}function ZT(){if(typeof window=="object"){if(N6)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function eE(n,e){L6&&console.warn(n+" is deprecated, please use "+e+" instead.")}function Q_e(n){const e={browser:null,version:null};if(typeof n>"u"||!n.navigator||!n.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:t}=n;if(t.userAgentData&&t.userAgentData.brands){const r=t.userAgentData.brands.find(i=>i.brand==="Chromium");if(r)return{browser:"chrome",version:parseInt(r.version,10)}}if(t.mozGetUserMedia)e.browser="firefox",e.version=parseInt($m(t.userAgent,/Firefox\/(\d+)\./,1));else if(t.webkitGetUserMedia||n.isSecureContext===!1&&n.webkitRTCPeerConnection)e.browser="chrome",e.version=parseInt($m(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2))||null;else if(n.RTCPeerConnection&&t.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=parseInt($m(t.userAgent,/AppleWebKit\/(\d+)\./,1)),e.supportsUnifiedPlan=n.RTCRtpTransceiver&&"currentDirection"in n.RTCRtpTransceiver.prototype,e._safariVersion=$m(t.userAgent,/Version\/(\d+(\.?\d+))/,1);else return e.browser="Not a supported browser.",e;return e}function MI(n){return Object.prototype.toString.call(n)==="[object Object]"}function F6(n){return MI(n)?Object.keys(n).reduce(function(e,t){const r=MI(n[t]),i=r?F6(n[t]):n[t],a=r&&!Object.keys(i).length;return i===void 0||a?e:Object.assign(e,{[t]:i})},{}):n}function Dk(n,e,t){!e||t.has(e.id)||(t.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?Dk(n,n.get(e[r]),t):r.endsWith("Ids")&&e[r].forEach(i=>{Dk(n,n.get(i),t)})}))}function DI(n,e,t){const r=t?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const a=[];return n.forEach(s=>{s.type==="track"&&s.trackIdentifier===e.id&&a.push(s)}),a.forEach(s=>{n.forEach(o=>{o.type===r&&o.trackId===s.id&&Dk(n,o,i)})}),i}const NI=ZT;function $6(n,e){const t=n&&n.navigator;if(!t.mediaDevices)return;const r=function(o){if(typeof o!="object"||o.mandatory||o.optional)return o;const c={};return Object.keys(o).forEach(u=>{if(u==="require"||u==="advanced"||u==="mediaSource")return;const l=typeof o[u]=="object"?o[u]:{ideal:o[u]};l.exact!==void 0&&typeof l.exact=="number"&&(l.min=l.max=l.exact);const d=function(h,p){return h?h+p.charAt(0).toUpperCase()+p.slice(1):p==="deviceId"?"sourceId":p};if(l.ideal!==void 0){c.optional=c.optional||[];let h={};typeof l.ideal=="number"?(h[d("min",u)]=l.ideal,c.optional.push(h),h={},h[d("max",u)]=l.ideal,c.optional.push(h)):(h[d("",u)]=l.ideal,c.optional.push(h))}l.exact!==void 0&&typeof l.exact!="number"?(c.mandatory=c.mandatory||{},c.mandatory[d("",u)]=l.exact):["min","max"].forEach(h=>{l[h]!==void 0&&(c.mandatory=c.mandatory||{},c.mandatory[d(h,u)]=l[h])})}),o.advanced&&(c.optional=(c.optional||[]).concat(o.advanced)),c},i=function(o,c){if(e.version>=61)return c(o);if(o=JSON.parse(JSON.stringify(o)),o&&typeof o.audio=="object"){const u=function(l,d,h){d in l&&!(h in l)&&(l[h]=l[d],delete l[d])};o=JSON.parse(JSON.stringify(o)),u(o.audio,"autoGainControl","googAutoGainControl"),u(o.audio,"noiseSuppression","googNoiseSuppression"),o.audio=r(o.audio)}if(o&&typeof o.video=="object"){let u=o.video.facingMode;u=u&&(typeof u=="object"?u:{ideal:u});const l=e.version<66;if(u&&(u.exact==="user"||u.exact==="environment"||u.ideal==="user"||u.ideal==="environment")&&!(t.mediaDevices.getSupportedConstraints&&t.mediaDevices.getSupportedConstraints().facingMode&&!l)){delete o.video.facingMode;let d;if(u.exact==="environment"||u.ideal==="environment"?d=["back","rear"]:(u.exact==="user"||u.ideal==="user")&&(d=["front"]),d)return t.mediaDevices.enumerateDevices().then(h=>{h=h.filter(g=>g.kind==="videoinput");let p=h.find(g=>d.some(v=>g.label.toLowerCase().includes(v)));return!p&&h.length&&d.includes("back")&&(p=h[h.length-1]),p&&(o.video.deviceId=u.exact?{exact:p.deviceId}:{ideal:p.deviceId}),o.video=r(o.video),NI("chrome: "+JSON.stringify(o)),c(o)})}o.video=r(o.video)}return NI("chrome: "+JSON.stringify(o)),c(o)},a=function(o){return e.version>=64?o:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[o.name]||o.name,message:o.message,constraint:o.constraint||o.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},s=function(o,c,u){i(o,l=>{t.webkitGetUserMedia(l,c,d=>{u&&u(a(d))})})};if(t.getUserMedia=s.bind(t),t.mediaDevices.getUserMedia){const o=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(c){return i(c,u=>o(u).then(l=>{if(u.audio&&!l.getAudioTracks().length||u.video&&!l.getVideoTracks().length)throw l.getTracks().forEach(d=>{d.stop()}),new DOMException("","NotFoundError");return l},l=>Promise.reject(a(l))))}}}function B6(n){n.MediaStream=n.MediaStream||n.webkitMediaStream}function U6(n,e){if(!(e.version>102))if(typeof n=="object"&&n.RTCPeerConnection&&!("ontrack"in n.RTCPeerConnection.prototype)){Object.defineProperty(n.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(r){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=r)},enumerable:!0,configurable:!0});const t=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=i=>{i.stream.addEventListener("addtrack",a=>{let s;n.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(c=>c.track&&c.track.id===a.track.id):s={track:a.track};const o=new Event("track");o.track=a.track,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)}),i.stream.getTracks().forEach(a=>{let s;n.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(c=>c.track&&c.track.id===a.id):s={track:a};const o=new Event("track");o.track=a,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Nf(n,"track",t=>(t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t))}function j6(n){if(typeof n=="object"&&n.RTCPeerConnection&&!("getSenders"in n.RTCPeerConnection.prototype)&&"createDTMFSender"in n.RTCPeerConnection.prototype){const e=function(i,a){return{track:a,get dtmf(){return this._dtmf===void 0&&(a.kind==="audio"?this._dtmf=i.createDTMFSender(a):this._dtmf=null),this._dtmf},_pc:i}};if(!n.RTCPeerConnection.prototype.getSenders){n.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(o,c){let u=i.apply(this,arguments);return u||(u=e(this,o),this._senders.push(u)),u};const a=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(o){a.apply(this,arguments);const c=this._senders.indexOf(o);c!==-1&&this._senders.splice(c,1)}}const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(a){this._senders=this._senders||[],t.apply(this,[a]),a.getTracks().forEach(s=>{this._senders.push(e(this,s))})};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(a){this._senders=this._senders||[],r.apply(this,[a]),a.getTracks().forEach(s=>{const o=this._senders.find(c=>c.track===s);o&&this._senders.splice(this._senders.indexOf(o),1)})}}else if(typeof n=="object"&&n.RTCPeerConnection&&"getSenders"in n.RTCPeerConnection.prototype&&"createDTMFSender"in n.RTCPeerConnection.prototype&&n.RTCRtpSender&&!("dtmf"in n.RTCRtpSender.prototype)){const e=n.RTCPeerConnection.prototype.getSenders;n.RTCPeerConnection.prototype.getSenders=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r},Object.defineProperty(n.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function q6(n,e){if(e.version>=67||!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender&&n.RTCRtpReceiver))return;if(!("getStats"in n.RTCRtpSender.prototype)){const r=n.RTCPeerConnection.prototype.getSenders;r&&(n.RTCPeerConnection.prototype.getSenders=function(){const s=r.apply(this,[]);return s.forEach(o=>o._pc=this),s});const i=n.RTCPeerConnection.prototype.addTrack;i&&(n.RTCPeerConnection.prototype.addTrack=function(){const s=i.apply(this,arguments);return s._pc=this,s}),n.RTCRtpSender.prototype.getStats=function(){const s=this;return this._pc.getStats().then(o=>DI(o,s.track,!0))}}if(!("getStats"in n.RTCRtpReceiver.prototype)){const r=n.RTCPeerConnection.prototype.getReceivers;r&&(n.RTCPeerConnection.prototype.getReceivers=function(){const a=r.apply(this,[]);return a.forEach(s=>s._pc=this),a}),Nf(n,"track",i=>(i.receiver._pc=i.srcElement,i)),n.RTCRtpReceiver.prototype.getStats=function(){const a=this;return this._pc.getStats().then(s=>DI(s,a.track,!1))}}if(!("getStats"in n.RTCRtpSender.prototype&&"getStats"in n.RTCRtpReceiver.prototype))return;const t=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof n.MediaStreamTrack){const i=arguments[0];let a,s,o;return this.getSenders().forEach(c=>{c.track===i&&(a?o=!0:a=c)}),this.getReceivers().forEach(c=>(c.track===i&&(s?o=!0:s=c),c.track===i)),o||a&&s?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):a?a.getStats():s?s.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function z6(n){n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(s=>this._shimmedLocalStreams[s][0])};const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(s,o){if(!o)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const c=e.apply(this,arguments);return this._shimmedLocalStreams[o.id]?this._shimmedLocalStreams[o.id].indexOf(c)===-1&&this._shimmedLocalStreams[o.id].push(c):this._shimmedLocalStreams[o.id]=[o,c],c};const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(s){this._shimmedLocalStreams=this._shimmedLocalStreams||{},s.getTracks().forEach(u=>{if(this.getSenders().find(d=>d.track===u))throw new DOMException("Track already exists.","InvalidAccessError")});const o=this.getSenders();t.apply(this,arguments);const c=this.getSenders().filter(u=>o.indexOf(u)===-1);this._shimmedLocalStreams[s.id]=[s].concat(c)};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],r.apply(this,arguments)};const i=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},s&&Object.keys(this._shimmedLocalStreams).forEach(o=>{const c=this._shimmedLocalStreams[o].indexOf(s);c!==-1&&this._shimmedLocalStreams[o].splice(c,1),this._shimmedLocalStreams[o].length===1&&delete this._shimmedLocalStreams[o]}),i.apply(this,arguments)}}function W6(n,e){if(!n.RTCPeerConnection)return;if(n.RTCPeerConnection.prototype.addTrack&&e.version>=65)return z6(n);const t=n.RTCPeerConnection.prototype.getLocalStreams;n.RTCPeerConnection.prototype.getLocalStreams=function(){const l=t.apply(this);return this._reverseStreams=this._reverseStreams||{},l.map(d=>this._reverseStreams[d.id])};const r=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(l){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},l.getTracks().forEach(d=>{if(this.getSenders().find(p=>p.track===d))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[l.id]){const d=new n.MediaStream(l.getTracks());this._streams[l.id]=d,this._reverseStreams[d.id]=l,l=d}r.apply(this,[l])};const i=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(l){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[l.id]||l]),delete this._reverseStreams[this._streams[l.id]?this._streams[l.id].id:l.id],delete this._streams[l.id]},n.RTCPeerConnection.prototype.addTrack=function(l,d){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const h=[].slice.call(arguments,1);if(h.length!==1||!h[0].getTracks().find(v=>v===l))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(v=>v.track===l))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const g=this._streams[d.id];if(g)g.addTrack(l),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const v=new n.MediaStream([l]);this._streams[d.id]=v,this._reverseStreams[v.id]=d,this.addStream(v)}return this.getSenders().find(v=>v.track===l)};function a(u,l){let d=l.sdp;return Object.keys(u._reverseStreams||[]).forEach(h=>{const p=u._reverseStreams[h],g=u._streams[p.id];d=d.replace(new RegExp(g.id,"g"),p.id)}),new RTCSessionDescription({type:l.type,sdp:d})}function s(u,l){let d=l.sdp;return Object.keys(u._reverseStreams||[]).forEach(h=>{const p=u._reverseStreams[h],g=u._streams[p.id];d=d.replace(new RegExp(p.id,"g"),g.id)}),new RTCSessionDescription({type:l.type,sdp:d})}["createOffer","createAnswer"].forEach(function(u){const l=n.RTCPeerConnection.prototype[u],d={[u](){const h=arguments;return arguments.length&&typeof arguments[0]=="function"?l.apply(this,[g=>{const v=a(this,g);h[0].apply(null,[v])},g=>{h[1]&&h[1].apply(null,g)},arguments[2]]):l.apply(this,arguments).then(g=>a(this,g))}};n.RTCPeerConnection.prototype[u]=d[u]});const o=n.RTCPeerConnection.prototype.setLocalDescription;n.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?o.apply(this,arguments):(arguments[0]=s(this,arguments[0]),o.apply(this,arguments))};const c=Object.getOwnPropertyDescriptor(n.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(n.RTCPeerConnection.prototype,"localDescription",{get(){const u=c.get.apply(this);return u.type===""?u:a(this,u)}}),n.RTCPeerConnection.prototype.removeTrack=function(l){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!l._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(l._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let h;Object.keys(this._streams).forEach(p=>{this._streams[p].getTracks().find(v=>l.track===v)&&(h=this._streams[p])}),h&&(h.getTracks().length===1?this.removeStream(this._reverseStreams[h.id]):h.removeTrack(l.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Nk(n,e){!n.RTCPeerConnection&&n.webkitRTCPeerConnection&&(n.RTCPeerConnection=n.webkitRTCPeerConnection),n.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const r=n.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new(t==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};n.RTCPeerConnection.prototype[t]=i[t]})}function H6(n,e){e.version>102||Nf(n,"negotiationneeded",t=>{const r=t.target;if(!((e.version<72||r.getConfiguration&&r.getConfiguration().sdpSemantics==="plan-b")&&r.signalingState!=="stable"))return t})}var LI=Object.freeze({__proto__:null,fixNegotiationNeeded:H6,shimAddTrackRemoveTrack:W6,shimAddTrackRemoveTrackWithNative:z6,shimGetSendersWithDtmf:j6,shimGetUserMedia:$6,shimMediaStream:B6,shimOnTrack:U6,shimPeerConnection:Nk,shimSenderReceiverGetStats:q6});function V6(n,e){const t=n&&n.navigator,r=n&&n.MediaStreamTrack;if(t.getUserMedia=function(i,a,s){eE("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),t.mediaDevices.getUserMedia(i).then(a,s)},!(e.version>55&&"autoGainControl"in t.mediaDevices.getSupportedConstraints())){const i=function(s,o,c){o in s&&!(c in s)&&(s[c]=s[o],delete s[o])},a=t.mediaDevices.getUserMedia.bind(t.mediaDevices);if(t.mediaDevices.getUserMedia=function(s){return typeof s=="object"&&typeof s.audio=="object"&&(s=JSON.parse(JSON.stringify(s)),i(s.audio,"autoGainControl","mozAutoGainControl"),i(s.audio,"noiseSuppression","mozNoiseSuppression")),a(s)},r&&r.prototype.getSettings){const s=r.prototype.getSettings;r.prototype.getSettings=function(){const o=s.apply(this,arguments);return i(o,"mozAutoGainControl","autoGainControl"),i(o,"mozNoiseSuppression","noiseSuppression"),o}}if(r&&r.prototype.applyConstraints){const s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(o){return this.kind==="audio"&&typeof o=="object"&&(o=JSON.parse(JSON.stringify(o)),i(o,"autoGainControl","mozAutoGainControl"),i(o,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[o])}}}}function Z_e(n,e){n.navigator.mediaDevices&&"getDisplayMedia"in n.navigator.mediaDevices||n.navigator.mediaDevices&&(n.navigator.mediaDevices.getDisplayMedia=function(r){if(!(r&&r.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return r.video===!0?r.video={mediaSource:e}:r.video.mediaSource=e,n.navigator.mediaDevices.getUserMedia(r)})}function G6(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Lk(n,e){typeof n!="object"||!(n.RTCPeerConnection||n.mozRTCPeerConnection)||(!n.RTCPeerConnection&&n.mozRTCPeerConnection&&(n.RTCPeerConnection=n.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const r=n.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new(t==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};n.RTCPeerConnection.prototype[t]=i[t]}))}function K6(n,e){if(typeof n!="object"||!(n.RTCPeerConnection||n.mozRTCPeerConnection)||e.version>=151)return;const t={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){const[a,s,o]=arguments;return this.signalingState==="closed"?Promise.resolve(new Map):r.apply(this,[a||null]).then(c=>{if(e.version<53&&!s)try{c.forEach(u=>{u.type=t[u.type]||u.type})}catch(u){if(u.name!=="TypeError")throw u;c.forEach((l,d)=>{c.set(d,Object.assign({},l,{type:t[l.type]||l.type}))})}return c}).then(s,o)}}function Y6(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpSender.prototype)return;const e=n.RTCPeerConnection.prototype.getSenders;e&&(n.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(a=>a._pc=this),i});const t=n.RTCPeerConnection.prototype.addTrack;t&&(n.RTCPeerConnection.prototype.addTrack=function(){const i=t.apply(this,arguments);return i._pc=this,i}),n.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function X6(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpReceiver.prototype)return;const e=n.RTCPeerConnection.prototype.getReceivers;e&&(n.RTCPeerConnection.prototype.getReceivers=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r}),Nf(n,"track",t=>(t.receiver._pc=t.srcElement,t)),n.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function J6(n){!n.RTCPeerConnection||"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){eE("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&t.getTracks().includes(r.track)&&this.removeTrack(r)})})}function Q6(n){n.DataChannel&&!n.RTCDataChannel&&(n.RTCDataChannel=n.DataChannel)}function Z6(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.addTransceiver;e&&(n.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let r=arguments[1]&&arguments[1].sendEncodings;r===void 0&&(r=[]),r=[...r];const i=r.length>0;i&&r.forEach(s=>{if("rid"in s&&!/^[a-z0-9]{0,16}$/i.test(s.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in s&&!(parseFloat(s.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in s&&!(parseFloat(s.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const a=e.apply(this,arguments);if(i){const{sender:s}=a,o=s.getParameters();(!("encodings"in o)||o.encodings.length===1&&Object.keys(o.encodings[0]).length===0)&&(o.encodings=r,s.sendEncodings=r,this.setParametersPromises.push(s.setParameters(o).then(()=>{delete s.sendEncodings}).catch(()=>{delete s.sendEncodings})))}return a})}function e$(n){if(!(typeof n=="object"&&n.RTCRtpSender))return;const e=n.RTCRtpSender.prototype.getParameters;e&&(n.RTCRtpSender.prototype.getParameters=function(){const r=e.apply(this,arguments);return"encodings"in r||(r.encodings=[].concat(this.sendEncodings||[{}])),r})}function t$(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function n$(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createAnswer;n.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}var FI=Object.freeze({__proto__:null,shimAddTransceiver:Z6,shimCreateAnswer:n$,shimCreateOffer:t$,shimGetDisplayMedia:Z_e,shimGetParameters:e$,shimGetStats:K6,shimGetUserMedia:V6,shimOnTrack:G6,shimPeerConnection:Lk,shimRTCDataChannel:Q6,shimReceiverGetStats:X6,shimRemoveStream:J6,shimSenderGetStats:Y6});function r$(n){if(!(typeof n!="object"||!n.RTCPeerConnection)){if("getLocalStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in n.RTCPeerConnection.prototype)){const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addStream=function(r){this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(i=>e.call(this,i,r)),r.getVideoTracks().forEach(i=>e.call(this,i,r))},n.RTCPeerConnection.prototype.addTrack=function(r){for(var i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];return a&&a.forEach(o=>{this._localStreams?this._localStreams.includes(o)||this._localStreams.push(o):this._localStreams=[o]}),e.apply(this,arguments)}}"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const r=this._localStreams.indexOf(t);if(r===-1)return;this._localStreams.splice(r,1);const i=t.getTracks();this.getSenders().forEach(a=>{i.includes(a.track)&&this.removeTrack(a)})})}}function i$(n){if(!(typeof n!="object"||!n.RTCPeerConnection)&&("getRemoteStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in n.RTCPeerConnection.prototype))){Object.defineProperty(n.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(t){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=r=>{r.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const a=new Event("addstream");a.stream=i,this.dispatchEvent(a)})})}});const e=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){const r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(a=>{if(r._remoteStreams||(r._remoteStreams=[]),r._remoteStreams.indexOf(a)>=0)return;r._remoteStreams.push(a);const s=new Event("addstream");s.stream=a,r.dispatchEvent(s)})}),e.apply(r,arguments)}}}function a$(n){if(typeof n!="object"||!n.RTCPeerConnection)return;const e=n.RTCPeerConnection.prototype,t=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,a=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(u,l){const d=arguments.length>=2?arguments[2]:arguments[0],h=t.apply(this,[d]);return l?(h.then(u,l),Promise.resolve()):h},e.createAnswer=function(u,l){const d=arguments.length>=2?arguments[2]:arguments[0],h=r.apply(this,[d]);return l?(h.then(u,l),Promise.resolve()):h};let o=function(c,u,l){const d=i.apply(this,[c]);return l?(d.then(u,l),Promise.resolve()):d};e.setLocalDescription=o,o=function(c,u,l){const d=a.apply(this,[c]);return l?(d.then(u,l),Promise.resolve()):d},e.setRemoteDescription=o,o=function(c,u,l){const d=s.apply(this,[c]);return l?(d.then(u,l),Promise.resolve()):d},e.addIceCandidate=o}function s$(n){const e=n&&n.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const t=e.mediaDevices,r=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=i=>r(o$(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,i,a){e.mediaDevices.getUserMedia(r).then(i,a)}).bind(e))}function o$(n){return n&&n.video!==void 0?Object.assign({},n,{video:F6(n.video)}):n}function c$(n){if(!n.RTCPeerConnection)return;const e=n.RTCPeerConnection;n.RTCPeerConnection=function(r,i){if(r&&r.iceServers){const a=[];for(let s=0;s<r.iceServers.length;s++){let o=r.iceServers[s];o.urls===void 0&&o.url?(eE("RTCIceServer.url","RTCIceServer.urls"),o=JSON.parse(JSON.stringify(o)),o.urls=o.url,delete o.url,a.push(o)):a.push(r.iceServers[s])}r.iceServers=a}return new e(r,i)},n.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(n.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function u$(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function l$(n){const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio<"u"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);const i=this.getTransceivers().find(s=>s.receiver.track.kind==="audio");r.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo<"u"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);const a=this.getTransceivers().find(s=>s.receiver.track.kind==="video");r.offerToReceiveVideo===!1&&a?a.direction==="sendrecv"?a.setDirection?a.setDirection("sendonly"):a.direction="sendonly":a.direction==="recvonly"&&(a.setDirection?a.setDirection("inactive"):a.direction="inactive"):r.offerToReceiveVideo===!0&&!a&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function d$(n){typeof n!="object"||n.AudioContext||(n.AudioContext=n.webkitAudioContext)}var $I=Object.freeze({__proto__:null,shimAudioContext:d$,shimCallbacksAPI:a$,shimConstraints:o$,shimCreateOfferLegacy:l$,shimGetUserMedia:s$,shimLocalStreamsAPI:r$,shimRTCIceServerUrls:c$,shimRemoteStreamsAPI:i$,shimTrackEventTransceiver:u$}),zw={exports:{}},BI;function ebe(){return BI||(BI=1,function(n){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split(` 3891`).map(r=>r.trim())},e.splitSections=function(t){return t.split(` 3892m=`).map((i,a)=>(a>0?"m="+i:i).trim()+`\r 3893`)},e.getDescription=function(t){const r=e.splitSections(t);return r&&r[0]},e.getMediaSections=function(t){const r=e.splitSections(t);return r.shift(),r},e.matchPrefix=function(t,r){return e.splitLines(t).filter(i=>i.indexOf(r)===0)},e.parseCandidate=function(t){let r;t.indexOf("a=candidate:")===0?r=t.substring(12).split(" "):r=t.substring(10).split(" ");const i={foundation:r[0],component:{1:"rtp",2:"rtcp"}[r[1]]||r[1],protocol:r[2].toLowerCase(),priority:parseInt(r[3],10),ip:r[4],address:r[4],port:parseInt(r[5],10),type:r[7]};for(let a=8;a<r.length;a+=2)switch(r[a]){case"raddr":i.relatedAddress=r[a+1];break;case"rport":i.relatedPort=parseInt(r[a+1],10);break;case"tcptype":i.tcpType=r[a+1];break;case"ufrag":i.ufrag=r[a+1],i.usernameFragment=r[a+1];break;default:i[r[a]]===void 0&&(i[r[a]]=r[a+1]);break}return i},e.writeCandidate=function(t){const r=[];r.push(t.foundation);const i=t.component;i==="rtp"?r.push(1):i==="rtcp"?r.push(2):r.push(i),r.push(t.protocol.toUpperCase()),r.push(t.priority),r.push(t.address||t.ip),r.push(t.port);const a=t.type;return r.push("typ"),r.push(a),a!=="host"&&t.relatedAddress&&t.relatedPort!==void 0&&(r.push("raddr"),r.push(t.relatedAddress),r.push("rport"),r.push(t.relatedPort)),t.tcpType&&t.protocol.toLowerCase()==="tcp"&&(r.push("tcptype"),r.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(r.push("ufrag"),r.push(t.usernameFragment||t.ufrag)),"candidate:"+r.join(" ")},e.parseIceOptions=function(t){return t.substring(14).split(" ")},e.parseRtpMap=function(t){let r=t.substring(9).split(" ");const i={payloadType:parseInt(r.shift(),10)};return r=r[0].split("/"),i.name=r[0],i.clockRate=parseInt(r[1],10),i.channels=r.length===3?parseInt(r[2],10):1,i.numChannels=i.channels,i},e.writeRtpMap=function(t){let r=t.payloadType;t.preferredPayloadType!==void 0&&(r=t.preferredPayloadType);const i=t.channels||t.numChannels||1;return"a=rtpmap:"+r+" "+t.name+"/"+t.clockRate+(i!==1?"/"+i:"")+`\r 3894`},e.parseExtmap=function(t){const r=t.substring(9).split(" ");return{id:parseInt(r[0],10),direction:r[0].indexOf("/")>0?r[0].split("/")[1]:"sendrecv",uri:r[1],attributes:r.slice(2).join(" ")}},e.writeExtmap=function(t){return"a=extmap:"+(t.id||t.preferredId)+(t.direction&&t.direction!=="sendrecv"?"/"+t.direction:"")+" "+t.uri+(t.attributes?" "+t.attributes:"")+`\r 3895`},e.parseFmtp=function(t){const r={};let i;const a=t.substring(t.indexOf(" ")+1).split(";");for(let s=0;s<a.length;s++)i=a[s].trim().split("="),r[i[0].trim()]=i[1];return r},e.writeFmtp=function(t){let r="",i=t.payloadType;if(t.preferredPayloadType!==void 0&&(i=t.preferredPayloadType),t.parameters&&Object.keys(t.parameters).length){const a=[];Object.keys(t.parameters).forEach(s=>{t.parameters[s]!==void 0?a.push(s+"="+t.parameters[s]):a.push(s)}),r+="a=fmtp:"+i+" "+a.join(";")+`\r 3896`}return r},e.parseRtcpFb=function(t){const r=t.substring(t.indexOf(" ")+1).split(" ");return{type:r.shift(),parameter:r.join(" ")}},e.writeRtcpFb=function(t){let r="",i=t.payloadType;return t.preferredPayloadType!==void 0&&(i=t.preferredPayloadType),t.rtcpFeedback&&t.rtcpFeedback.length&&t.rtcpFeedback.forEach(a=>{r+="a=rtcp-fb:"+i+" "+a.type+(a.parameter&&a.parameter.length?" "+a.parameter:"")+`\r 3897`}),r},e.parseSsrcMedia=function(t){const r=t.indexOf(" "),i={ssrc:parseInt(t.substring(7,r),10)},a=t.indexOf(":",r);return a>-1?(i.attribute=t.substring(r+1,a),i.value=t.substring(a+1)):i.attribute=t.substring(r+1),i},e.parseSsrcGroup=function(t){const r=t.substring(13).split(" ");return{semantics:r.shift(),ssrcs:r.map(i=>parseInt(i,10))}},e.getMid=function(t){const r=e.matchPrefix(t,"a=mid:")[0];if(r)return r.substring(6)},e.parseFingerprint=function(t){const r=t.substring(14).split(" ");return{algorithm:r[0].toLowerCase(),value:r[1].toUpperCase()}},e.getDtlsParameters=function(t,r){return{role:"auto",fingerprints:e.matchPrefix(t+r,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(t,r){let i="a=setup:"+r+`\r 3898`;return t.fingerprints.forEach(a=>{i+="a=fingerprint:"+a.algorithm+" "+a.value+`\r 3899`}),i},e.parseCryptoLine=function(t){const r=t.substring(9).split(" ");return{tag:parseInt(r[0],10),cryptoSuite:r[1],keyParams:r[2],sessionParams:r.slice(3)}},e.writeCryptoLine=function(t){return"a=crypto:"+t.tag+" "+t.cryptoSuite+" "+(typeof t.keyParams=="object"?e.writeCryptoKeyParams(t.keyParams):t.keyParams)+(t.sessionParams?" "+t.sessionParams.join(" "):"")+`\r 3900`},e.parseCryptoKeyParams=function(t){if(t.indexOf("inline:")!==0)return null;const r=t.substring(7).split("|");return{keyMethod:"inline",keySalt:r[0],lifeTime:r[1],mkiValue:r[2]?r[2].split(":")[0]:void 0,mkiLength:r[2]?r[2].split(":")[1]:void 0}},e.writeCryptoKeyParams=function(t){return t.keyMethod+":"+t.keySalt+(t.lifeTime?"|"+t.lifeTime:"")+(t.mkiValue&&t.mkiLength?"|"+t.mkiValue+":"+t.mkiLength:"")},e.getCryptoParameters=function(t,r){return e.matchPrefix(t+r,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(t,r){const i=e.matchPrefix(t+r,"a=ice-ufrag:")[0],a=e.matchPrefix(t+r,"a=ice-pwd:")[0];return i&&a?{usernameFragment:i.substring(12),password:a.substring(10)}:null},e.writeIceParameters=function(t){let r="a=ice-ufrag:"+t.usernameFragment+`\r 3901a=ice-pwd:`+t.password+`\r 3902`;return t.iceLite&&(r+=`a=ice-lite\r 3903`),r},e.parseRtpParameters=function(t){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},a=e.splitLines(t)[0].split(" ");r.profile=a[2];for(let o=3;o<a.length;o++){const c=a[o],u=e.matchPrefix(t,"a=rtpmap:"+c+" ")[0];if(u){const l=e.parseRtpMap(u),d=e.matchPrefix(t,"a=fmtp:"+c+" ");switch(l.parameters=d.length?e.parseFmtp(d[0]):{},l.rtcpFeedback=e.matchPrefix(t,"a=rtcp-fb:"+c+" ").map(e.parseRtcpFb),r.codecs.push(l),l.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(l.name.toUpperCase());break}}}e.matchPrefix(t,"a=extmap:").forEach(o=>{r.headerExtensions.push(e.parseExtmap(o))});const s=e.matchPrefix(t,"a=rtcp-fb:* ").map(e.parseRtcpFb);return r.codecs.forEach(o=>{s.forEach(c=>{o.rtcpFeedback.find(l=>l.type===c.type&&l.parameter===c.parameter)||o.rtcpFeedback.push(c)})}),r},e.writeRtpDescription=function(t,r){let i="";i+="m="+t+" ",i+=r.codecs.length>0?"9":"0",i+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",i+=r.codecs.map(s=>s.preferredPayloadType!==void 0?s.preferredPayloadType:s.payloadType).join(" ")+`\r 3904`,i+=`c=IN IP4 0.0.0.0\r 3905`,i+=`a=rtcp:9 IN IP4 0.0.0.0\r 3906`,r.codecs.forEach(s=>{i+=e.writeRtpMap(s),i+=e.writeFmtp(s),i+=e.writeRtcpFb(s)});let a=0;return r.codecs.forEach(s=>{s.maxptime>a&&(a=s.maxptime)}),a>0&&(i+="a=maxptime:"+a+`\r 3907`),r.headerExtensions&&r.headerExtensions.forEach(s=>{i+=e.writeExtmap(s)}),i},e.parseRtpEncodingParameters=function(t){const r=[],i=e.parseRtpParameters(t),a=i.fecMechanisms.indexOf("RED")!==-1,s=i.fecMechanisms.indexOf("ULPFEC")!==-1,o=e.matchPrefix(t,"a=ssrc:").map(h=>e.parseSsrcMedia(h)).filter(h=>h.attribute==="cname"),c=o.length>0&&o[0].ssrc;let u;const l=e.matchPrefix(t,"a=ssrc-group:FID").map(h=>h.substring(17).split(" ").map(g=>parseInt(g,10)));l.length>0&&l[0].length>1&&l[0][0]===c&&(u=l[0][1]),i.codecs.forEach(h=>{if(h.name.toUpperCase()==="RTX"&&h.parameters.apt){let p={ssrc:c,codecPayloadType:parseInt(h.parameters.apt,10)};c&&u&&(p.rtx={ssrc:u}),r.push(p),a&&(p=JSON.parse(JSON.stringify(p)),p.fec={ssrc:c,mechanism:s?"red+ulpfec":"red"},r.push(p))}}),r.length===0&&c&&r.push({ssrc:c});let d=e.matchPrefix(t,"b=");return d.length&&(d[0].indexOf("b=TIAS:")===0?d=parseInt(d[0].substring(7),10):d[0].indexOf("b=AS:")===0?d=parseInt(d[0].substring(5),10)*1e3*.95-50*40*8:d=void 0,r.forEach(h=>{h.maxBitrate=d})),r},e.parseRtcpParameters=function(t){const r={},i=e.matchPrefix(t,"a=ssrc:").map(o=>e.parseSsrcMedia(o)).filter(o=>o.attribute==="cname")[0];i&&(r.cname=i.value,r.ssrc=i.ssrc);const a=e.matchPrefix(t,"a=rtcp-rsize");r.reducedSize=a.length>0,r.compound=a.length===0;const s=e.matchPrefix(t,"a=rtcp-mux");return r.mux=s.length>0,r},e.writeRtcpParameters=function(t){let r="";return t.reducedSize&&(r+=`a=rtcp-rsize\r 3908`),t.mux&&(r+=`a=rtcp-mux\r 3909`),t.ssrc!==void 0&&t.cname&&(r+="a=ssrc:"+t.ssrc+" cname:"+t.cname+`\r 3910`),r},e.parseMsid=function(t){let r;const i=e.matchPrefix(t,"a=msid:");if(i.length===1)return r=i[0].substring(7).split(" "),{stream:r[0],track:r[1]};const a=e.matchPrefix(t,"a=ssrc:").map(s=>e.parseSsrcMedia(s)).filter(s=>s.attribute==="msid");if(a.length>0)return r=a[0].value.split(" "),{stream:r[0],track:r[1]}},e.parseSctpDescription=function(t){const r=e.parseMLine(t),i=e.matchPrefix(t,"a=max-message-size:");let a;i.length>0&&(a=parseInt(i[0].substring(19),10)),isNaN(a)&&(a=65536);const s=e.matchPrefix(t,"a=sctp-port:");if(s.length>0)return{port:parseInt(s[0].substring(12),10),protocol:r.fmt,maxMessageSize:a};const o=e.matchPrefix(t,"a=sctpmap:");if(o.length>0){const c=o[0].substring(10).split(" ");return{port:parseInt(c[0],10),protocol:c[1],maxMessageSize:a}}},e.writeSctpDescription=function(t,r){let i=[];return t.protocol!=="DTLS/SCTP"?i=["m="+t.kind+" 9 "+t.protocol+" "+r.protocol+`\r 3911`,`c=IN IP4 0.0.0.0\r 3912`,"a=sctp-port:"+r.port+`\r 3913`]:i=["m="+t.kind+" 9 "+t.protocol+" "+r.port+`\r 3914`,`c=IN IP4 0.0.0.0\r 3915`,"a=sctpmap:"+r.port+" "+r.protocol+` 65535\r 3916`],r.maxMessageSize!==void 0&&i.push("a=max-message-size:"+r.maxMessageSize+`\r 3917`),i.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(t,r,i){let a;const s=r!==void 0?r:2;return t?a=t:a=e.generateSessionId(),`v=0\r 3918o=`+(i||"thisisadapterortc")+" "+a+" "+s+` IN IP4 127.0.0.1\r 3919s=-\r 3920t=0 0\r 3921`},e.getDirection=function(t,r){const i=e.splitLines(t);for(let a=0;a<i.length;a++)switch(i[a]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[a].substring(2)}return r?e.getDirection(r):"sendrecv"},e.getKind=function(t){return e.splitLines(t)[0].split(" ")[0].substring(2)},e.isRejected=function(t){return t.split(" ",2)[1]==="0"},e.parseMLine=function(t){const i=e.splitLines(t)[0].substring(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},e.parseOLine=function(t){const i=e.matchPrefix(t,"o=")[0].substring(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},e.isValidSDP=function(t){if(typeof t!="string"||t.length===0)return!1;const r=e.splitLines(t);for(let i=0;i<r.length;i++)if(r[i].length<2||r[i].charAt(1)!=="=")return!1;return!0},n.exports=e}(zw)),zw.exports}var f$=ebe(),Kh=B_e(f$),tbe=iye({__proto__:null,default:Kh},[f$]);function _y(n){if(!n.RTCIceCandidate||n.RTCIceCandidate&&"foundation"in n.RTCIceCandidate.prototype)return;const e=n.RTCIceCandidate;n.RTCIceCandidate=function(r){if(typeof r=="object"&&r.candidate&&r.candidate.indexOf("a=")===0&&(r=JSON.parse(JSON.stringify(r)),r.candidate=r.candidate.substring(2)),r.candidate&&r.candidate.length){const i=new e(r),a=Kh.parseCandidate(r.candidate);for(const s in a)s in i||Object.defineProperty(i,s,{value:a[s]});return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new e(r)},n.RTCIceCandidate.prototype=e.prototype,Nf(n,"icecandidate",t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new n.RTCIceCandidate(t.candidate),writable:"false"}),t))}function Fk(n){!n.RTCIceCandidate||n.RTCIceCandidate&&"relayProtocol"in n.RTCIceCandidate.prototype||Nf(n,"icecandidate",e=>{if(e.candidate){const t=Kh.parseCandidate(e.candidate.candidate);t.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e})}function by(n,e){if(!n.RTCPeerConnection)return;"sctp"in n.RTCPeerConnection.prototype||Object.defineProperty(n.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const t=function(o){if(!o||!o.sdp)return!1;const c=Kh.splitSections(o.sdp);return c.shift(),c.some(u=>{const l=Kh.parseMLine(u);return l&&l.kind==="application"&&l.protocol.indexOf("SCTP")!==-1})},r=function(o){const c=o.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(c===null||c.length<2)return-1;const u=parseInt(c[1],10);return u!==u?-1:u},i=function(o){let c=65536;return e.browser==="firefox"&&(e.version<57?o===-1?c=16384:c=2147483637:e.version<60?c=e.version===57?65535:65536:c=2147483637),c},a=function(o,c){let u=65536;e.browser==="firefox"&&e.version===57&&(u=65535);const l=Kh.matchPrefix(o.sdp,"a=max-message-size:");return l.length>0?u=parseInt(l[0].substring(19),10):e.browser==="firefox"&&c!==-1&&(u=2147483637),u},s=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,e.browser==="chrome"&&e.version>=76){const{sdpSemantics:c}=this.getConfiguration();c==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(t(arguments[0])){const c=r(arguments[0]),u=i(c),l=a(arguments[0],c);let d;u===0&&l===0?d=Number.POSITIVE_INFINITY:u===0||l===0?d=Math.max(u,l):d=Math.min(u,l);const h={};Object.defineProperty(h,"maxMessageSize",{get(){return d}}),this._sctp=h}return s.apply(this,arguments)}}function xy(n,e){if(!(n.RTCPeerConnection&&"createDataChannel"in n.RTCPeerConnection.prototype)||e.browser==="chrome"&&e.version>149||e.browser==="firefox"&&e.version>60)return;function t(i,a){const s=i.send;i.send=function(){const c=arguments[0],u=c.length||c.size||c.byteLength;if(i.readyState==="open"&&a.sctp&&u>a.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+a.sctp.maxMessageSize+" bytes)");return s.apply(i,arguments)}}const r=n.RTCPeerConnection.prototype.createDataChannel;n.RTCPeerConnection.prototype.createDataChannel=function(){const a=r.apply(this,arguments);return t(a,this),a},Nf(n,"datachannel",i=>(t(i.channel,i.target),i))}function $k(n){if(!n.RTCPeerConnection||"connectionState"in n.RTCPeerConnection.prototype)return;const e=n.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(t){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),t&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=t)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(t=>{const r=e[t];e[t]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=i=>{const a=i.target;if(a._lastConnectionState!==a.connectionState){a._lastConnectionState=a.connectionState;const s=new Event("connectionstatechange",i);a.dispatchEvent(s)}return i},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}})}function Bk(n,e){if(!n.RTCPeerConnection||e.browser==="chrome"&&e.version>=71||e.browser==="safari"&&e._safariVersion>=13.1)return;const t=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(i){if(i&&i.sdp&&i.sdp.indexOf(` 3922a=extmap-allow-mixed`)!==-1){const a=i.sdp.split(` 3923`).filter(s=>s.trim()!=="a=extmap-allow-mixed").join(` 3924`);n.RTCSessionDescription&&i instanceof n.RTCSessionDescription?arguments[0]=new n.RTCSessionDescription({type:i.type,sdp:a}):i.sdp=a}return t.apply(this,arguments)}}function wy(n,e){if(!(n.RTCPeerConnection&&n.RTCPeerConnection.prototype))return;const t=n.RTCPeerConnection.prototype.addIceCandidate;!t||t.length===0||(n.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&e.version<78||e.browser==="firefox"&&e.version<68||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Cy(n,e){if(!(n.RTCPeerConnection&&n.RTCPeerConnection.prototype))return;const t=n.RTCPeerConnection.prototype.setLocalDescription;!t||t.length===0||(n.RTCPeerConnection.prototype.setLocalDescription=function(){let i=arguments[0]||{};if(typeof i!="object"||i.type&&i.sdp)return t.apply(this,arguments);if(i={type:i.type,sdp:i.sdp},!i.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":i.type="offer";break;default:i.type="answer";break}return i.sdp||i.type!=="offer"&&i.type!=="answer"?t.apply(this,[i]):(i.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(s=>t.apply(this,[s]))})}var nbe=Object.freeze({__proto__:null,removeExtmapAllowMixed:Bk,shimAddIceCandidateNullOrEmpty:wy,shimConnectionState:$k,shimMaxMessageSize:by,shimParameterlessSetLocalDescription:Cy,shimRTCIceCandidate:_y,shimRTCIceCandidateRelayProtocol:Fk,shimSendThrowTypeError:xy});function rbe(){let{window:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const t=ZT,r=Q_e(n),i={browserDetails:r,commonShim:nbe,extractVersion:$m,disableLog:X_e,disableWarnings:J_e,sdp:tbe};switch(r.browser){case"chrome":if(!LI||!Nk||!e.shimChrome)return t("Chrome shim is not included in this adapter release."),i;if(r.version===null)return t("Chrome shim can not determine version, not shimming."),i;t("adapter.js shimming chrome."),i.browserShim=LI,wy(n,r),Cy(n),$6(n,r),B6(n),Nk(n,r),U6(n,r),W6(n,r),j6(n),q6(n,r),H6(n,r),_y(n),Fk(n),$k(n),by(n,r),xy(n,r),Bk(n,r);break;case"firefox":if(!FI||!Lk||!e.shimFirefox)return t("Firefox shim is not included in this adapter release."),i;t("adapter.js shimming firefox."),i.browserShim=FI,wy(n,r),Cy(n),V6(n,r),Lk(n,r),K6(n,r),G6(n),J6(n),Y6(n),X6(n),Q6(n),Z6(n),e$(n),t$(n),n$(n),_y(n),$k(n),by(n,r),xy(n,r);break;case"safari":if(!$I||!e.shimSafari)return t("Safari shim is not included in this adapter release."),i;t("adapter.js shimming safari."),i.browserShim=$I,wy(n,r),Cy(n),c$(n),l$(n),a$(n),r$(n),i$(n),u$(n),s$(n),d$(n),_y(n),Fk(n),by(n,r),xy(n,r),Bk(n,r);break;default:t("Unsupported browser!");break}return i}rbe({window:typeof window>"u"?void 0:window});var Uk,h$;class Yi extends(h$=Promise){constructor(e){super(e)}catch(e){return super.catch(e)}static reject(e){return super.reject(e)}static all(e){return super.all(e)}static race(e){return super.race(e)}}Uk=Yi;Yi.resolve=n=>Reflect.get(h$,"resolve",Uk).call(Uk,n);const ibe=/version\/(\d+(\.?_?\d+)+)/i;let Ww;function ba(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(typeof navigator>"u")return;const t=navigator.userAgent.toLowerCase();if(Ww===void 0||e){const r=abe.find(i=>{let{test:a}=i;return a.test(t)});Ww=r==null?void 0:r.describe(t)}return Ww}const abe=[{test:/firefox|iceweasel|fxios/i,describe(n){return{name:"Firefox",version:ky(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,n),os:n.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:Hw(n)}}},{test:/chrom|crios|crmo/i,describe(n){return{name:"Chrome",version:ky(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,n),os:n.toLowerCase().includes("crios")?"iOS":void 0,osVersion:Hw(n)}}},{test:/safari|applewebkit/i,describe(n){return{name:"Safari",version:ky(ibe,n),os:n.includes("mobile/")?"iOS":"macOS",osVersion:Hw(n)}}}];function ky(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const r=e.match(n);return r&&r.length>=t&&r[t]||""}function Hw(n){return n.includes("mac os")?ky(/\(.+?(\d+_\d+(:?_\d+)?)/,n,1).replace(/_/g,"."):void 0}var sbe="2.18.9";const obe=sbe,cbe=16;class fd extends Error{constructor(e,t,r){super(t||"an error has occurred"),this.name="LiveKitError",this.code=e,typeof(r==null?void 0:r.cause)<"u"&&(this.cause=r==null?void 0:r.cause)}}class wo extends fd{}var Fn;(function(n){n[n.NotAllowed=0]="NotAllowed",n[n.ServerUnreachable=1]="ServerUnreachable",n[n.InternalError=2]="InternalError",n[n.Cancelled=3]="Cancelled",n[n.LeaveRequest=4]="LeaveRequest",n[n.Timeout=5]="Timeout",n[n.WebSocket=6]="WebSocket",n[n.ServiceNotFound=7]="ServiceNotFound"})(Fn||(Fn={}));
3924class pt extends wo{constructor(e,t,r,i){super(1,e),this.name="ConnectionError",this.status=r,this.reason=t,this.context=i,this.reasonName=Fn[t]}static notAllowed(e,t,r){return new pt(e,Fn.NotAllowed,t,r)}static timeout(e){return new pt(e,Fn.Timeout)}static leaveRequest(e,t){return new pt(e,Fn.LeaveRequest,void 0,t)}static internal(e,t){return new pt(e,Fn.InternalError,void 0,t)}static cancelled(e){return new pt(e,Fn.Cancelled)}static serverUnreachable(e,t){return new pt(e,Fn.ServerUnreachable,t)}static websocket(e,t,r){return new pt(e,Fn.WebSocket,t,r)}static serviceNotFound(e,t){return new pt(e,Fn.ServiceNotFound,void 0,t)}}class tE extends fd{constructor(e){super(21,e??"device is unsupported"),this.name="DeviceUnsupportedError"}}class ju extends fd{constructor(e){super(20,e??"track is invalid"),this.name="TrackInvalidError"}}class ube extends fd{constructor(e){super(10,e??"unsupported server"),this.name="UnsupportedServer"}}class dr extends fd{constructor(e){super(12,e??"unexpected connection state"),this.name="UnexpectedConnectionState"}}class rf extends fd{constructor(e){super(13,e??"unable to negotiate"),this.name="NegotiationError"}}class UI extends fd{constructor(e,t){super(15,e),this.name="PublishTrackError",this.status=t}}class jI extends wo{constructor(e,t){super(15,e),this.name="SignalRequestError",this.reason=t,this.reasonName=typeof t=="string"?t:Ud[t]}}var ma;(function(n){n[n.AlreadyOpened=0]="AlreadyOpened",n[n.AbnormalEnd=1]="AbnormalEnd",n[n.DecodeFailed=2]="DecodeFailed",n[n.LengthExceeded=3]="LengthExceeded",n[n.Incomplete=4]="Incomplete",n[n.HandlerAlreadyRegistered=7]="HandlerAlreadyRegistered",n[n.EncryptionTypeMismatch=8]="EncryptionTypeMismatch"})(ma||(ma={}));class ro extends wo{constructor(e,t){super(16,e),this.name="DataStreamError",this.reason=t,this.reasonName=ma[t]}}class lh extends fd{constructor(e){super(18,e),this.name="SignalReconnectError"}}var O_;(function(n){n.PermissionDenied="PermissionDenied",n.NotFound="NotFound",n.DeviceInUse="DeviceInUse",n.Other="Other"})(O_||(O_={}));(function(n){function e(t){if(t&&"name"in t)return t.name==="NotFoundError"||t.name==="DevicesNotFoundError"?n.NotFound:t.name==="NotAllowedError"||t.name==="PermissionDeniedError"?n.PermissionDenied:t.name==="NotReadableError"||t.name==="TrackStartError"?n.DeviceInUse:n.Other}n.getFailure=e})(O_||(O_={}));class Vr{}Vr.setTimeout=function(){return setTimeout(...arguments)};Vr.setInterval=function(){return setInterval(...arguments)};Vr.clearTimeout=function(){return clearTimeout(...arguments)};Vr.clearInterval=function(){return clearInterval(...arguments)};var Me;(function(n){n.Connected="connected",n.Reconnecting="reconnecting",n.SignalReconnecting="signalReconnecting",n.Reconnected="reconnected",n.Disconnected="disconnected",n.ConnectionStateChanged="connectionStateChanged",n.Moved="moved",n.MediaDevicesChanged="mediaDevicesChanged",n.ParticipantConnected="participantConnected",n.ParticipantDisconnected="participantDisconnected",n.TrackPublished="trackPublished",n.TrackSubscribed="trackSubscribed",n.TrackSubscriptionFailed="trackSubscriptionFailed",n.TrackUnpublished="trackUnpublished",n.TrackUnsubscribed="trackUnsubscribed",n.TrackMuted="trackMuted",n.TrackUnmuted="trackUnmuted",n.LocalTrackPublished="localTrackPublished",n.LocalTrackUnpublished="localTrackUnpublished",n.LocalAudioSilenceDetected="localAudioSilenceDetected",n.ActiveSpeakersChanged="activeSpeakersChanged",n.ParticipantMetadataChanged="participantMetadataChanged",n.ParticipantNameChanged="participantNameChanged",n.ParticipantAttributesChanged="participantAttributesChanged",n.ParticipantActive="participantActive",n.RoomMetadataChanged="roomMetadataChanged",n.DataReceived="dataReceived",n.SipDTMFReceived="sipDTMFReceived",n.TranscriptionReceived="transcriptionReceived",n.ConnectionQualityChanged="connectionQualityChanged",n.TrackStreamStateChanged="trackStreamStateChanged",n.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",n.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",n.AudioPlaybackStatusChanged="audioPlaybackChanged",n.VideoPlaybackStatusChanged="videoPlaybackChanged",n.MediaDevicesError="mediaDevicesError",n.ParticipantPermissionsChanged="participantPermissionsChanged",n.SignalConnected="signalConnected",n.RecordingStatusChanged="recordingStatusChanged",n.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",n.EncryptionError="encryptionError",n.DCBufferStatusChanged="dcBufferStatusChanged",n.ActiveDeviceChanged="activeDeviceChanged",n.ChatMessage="chatMessage",n.LocalTrackSubscribed="localTrackSubscribed",n.MetricsReceived="metricsReceived",n.DataTrackPublished="dataTrackPublished",n.DataTrackUnpublished="dataTrackUnpublished",n.LocalDataTrackPublished="localDataTrackPublished",n.LocalDataTrackUnpublished="localDataTrackUnpublished"})(Me||(Me={}));var Ve;(function(n){n.TrackPublished="trackPublished",n.TrackSubscribed="trackSubscribed",n.TrackSubscriptionFailed="trackSubscriptionFailed",n.TrackUnpublished="trackUnpublished",n.TrackUnsubscribed="trackUnsubscribed",n.TrackMuted="trackMuted",n.TrackUnmuted="trackUnmuted",n.LocalTrackPublished="localTrackPublished",n.LocalTrackUnpublished="localTrackUnpublished",n.LocalTrackCpuConstrained="localTrackCpuConstrained",n.LocalSenderCreated="localSenderCreated",
3924n.ParticipantMetadataChanged="participantMetadataChanged",n.ParticipantNameChanged="participantNameChanged",n.DataReceived="dataReceived",n.SipDTMFReceived="sipDTMFReceived",n.TranscriptionReceived="transcriptionReceived",n.IsSpeakingChanged="isSpeakingChanged",n.ConnectionQualityChanged="connectionQualityChanged",n.TrackStreamStateChanged="trackStreamStateChanged",n.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",n.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",n.TrackCpuConstrained="trackCpuConstrained",n.MediaDevicesError="mediaDevicesError",n.AudioStreamAcquired="audioStreamAcquired",n.ParticipantPermissionsChanged="participantPermissionsChanged",n.PCTrackAdded="pcTrackAdded",n.AttributesChanged="attributesChanged",n.LocalTrackSubscribed="localTrackSubscribed",n.ChatMessage="chatMessage",n.Active="active"})(Ve||(Ve={}));var Ue;(function(n){n.TransportsCreated="transportsCreated",n.Connected="connected",n.Disconnected="disconnected",n.Resuming="resuming",n.Resumed="resumed",n.Restarting="restarting",n.Restarted="restarted",n.SignalResumed="signalResumed",n.SignalRestarted="signalRestarted",n.Closing="closing",n.MediaTrackAdded="mediaTrackAdded",n.ActiveSpeakersUpdate="activeSpeakersUpdate",n.DataPacketReceived="dataPacketReceived",n.RTPVideoMapUpdate="rtpVideoMapUpdate",n.DCBufferStatusChanged="dcBufferStatusChanged",n.ParticipantUpdate="participantUpdate",n.RoomUpdate="roomUpdate",n.SpeakersChanged="speakersChanged",n.StreamStateChanged="streamStateChanged",n.ConnectionQualityUpdate="connectionQualityUpdate",n.SubscriptionError="subscriptionError",n.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",n.RemoteMute="remoteMute",n.SubscribedQualityUpdate="subscribedQualityUpdate",n.LocalTrackUnpublished="localTrackUnpublished",n.LocalTrackSubscribed="localTrackSubscribed",n.Offline="offline",n.SignalRequestResponse="signalRequestResponse",n.SignalConnected="signalConnected",n.RoomMoved="roomMoved",n.PublishDataTrackResponse="publishDataTrackResponse",n.UnPublishDataTrackResponse="unPublishDataTrackResponse",n.DataTrackSubscriberHandles="dataTrackSubscriberHandles",n.DataTrackPacketReceived="dataTrackPacketReceived",n.Joined="joined",n.TokenRefreshed="tokenRefreshed",n.ServerRegionsReported="serverRegionsReported"})(Ue||(Ue={}));var We;(function(n){n.Message="message",n.Muted="muted",n.Unmuted="unmuted",n.Restarted="restarted",n.Ended="ended",n.Subscribed="subscribed",n.Unsubscribed="unsubscribed",n.CpuConstrained="cpuConstrained",n.UpdateSettings="updateSettings",n.UpdateSubscription="updateSubscription",n.AudioPlaybackStarted="audioPlaybackStarted",n.AudioPlaybackFailed="audioPlaybackFailed",n.AudioSilenceDetected="audioSilenceDetected",n.VisibilityChanged="visibilityChanged",n.VideoDimensionsChanged="videoDimensionsChanged",n.VideoPlaybackStarted="videoPlaybackStarted",n.VideoPlaybackFailed="videoPlaybackFailed",n.ElementAttached="elementAttached",n.ElementDetached="elementDetached",n.UpstreamPaused="upstreamPaused",n.UpstreamResumed="upstreamResumed",n.SubscriptionPermissionChanged="subscriptionPermissionChanged",n.SubscriptionStatusChanged="subscriptionStatusChanged",n.SubscriptionFailed="subscriptionFailed",n.TrackProcessorUpdate="trackProcessorUpdate",n.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",n.TranscriptionReceived="transcriptionReceived",n.TimeSyncUpdate="timeSyncUpdate",n.PreConnectBufferFlushed="preConnectBufferFlushed"})(We||(We={}));function lbe(n){return typeof n>"u"?n:typeof structuredClone=="function"?typeof n=="object"&&n!==null?structuredClone(Object.assign({},n)):structuredClone(n):JSON.parse(JSON.stringify(n))}class An{constructor(e,t,r,i,a){if(typeof e=="object")this.width=e.width,this.height=e.height,this.aspectRatio=e.aspectRatio,this.encoding={maxBitrate:e.maxBitrate,maxFramerate:e.maxFramerate,priority:e.priority};else if(t!==void 0&&r!==void 0)this.width=e,this.height=t,this.aspectRatio=e/t,this.encoding={maxBitrate:r,maxFramerate:i,priority:a};else throw new TypeError("Unsupported options: provide at least width, height and maxBitrate")}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}const dbe=["vp8","h264"],fbe=["vp8","h264","vp9","av1","h265"];function p$(n){return!!dbe.find(e=>e===n)}const hbe=p$;var qI;(function(n){n[n.PREFER_REGRESSION=0]="PREFER_REGRESSION",n[n.SIMULCAST=1]="SIMULCAST",n[n.REGRESSION=2]="REGRESSION"})(qI||(qI={}));var Ng;(function(n){n.telephone={maxBitrate:12e3}
vendor: 9,091 bytes, line 3924
3924,n.speech={maxBitrate:24e3},n.music={maxBitrate:48e3},n.musicStereo={maxBitrate:64e3},n.musicHighQuality={maxBitrate:96e3},n.musicHighQualityStereo={maxBitrate:128e3}})(Ng||(Ng={}));const Lg={h90:new An(160,90,9e4,20),h180:new An(320,180,16e4,20),h216:new An(384,216,18e4,20),h360:new An(640,360,45e4,20),h540:new An(960,540,8e5,25),h720:new An(1280,720,17e5,30),h1080:new An(1920,1080,3e6,30),h1440:new An(2560,1440,5e6,30),h2160:new An(3840,2160,8e6,30)},jk={h120:new An(160,120,7e4,20),h180:new An(240,180,125e3,20),h240:new An(320,240,14e4,20),h360:new An(480,360,33e4,20),h480:new An(640,480,5e5,20),h540:new An(720,540,6e5,25),h720:new An(960,720,13e5,30),h1080:new An(1440,1080,23e5,30),h1440:new An(1920,1440,38e5,30)},nE={h360fps3:new An(640,360,2e5,3,"medium"),h360fps15:new An(640,360,4e5,15,"medium"),h720fps5:new An(1280,720,8e5,5,"medium"),h720fps15:new An(1280,720,15e5,15,"medium"),h720fps30:new An(1280,720,2e6,30,"medium"),h1080fps15:new An(1920,1080,25e5,15,"medium"),h1080fps30:new An(1920,1080,5e6,30,"medium"),original:new An(0,0,7e6,30,"medium")};function m$(n,e,t){var r,i,a,s;const{optionsWithoutProcessor:o,audioProcessor:c,videoProcessor:u}=y$(n??{}),l=e==null?void 0:e.processor,d=t==null?void 0:t.processor,h=o??{};return h.audio===!0&&(h.audio={}),h.video===!0&&(h.video={}),h.audio&&(qk(h.audio,e),(r=(a=h.audio).deviceId)!==null&&r!==void 0||(a.deviceId={ideal:"default"}),(c||l)&&(h.audio.processor=c??l)),h.video&&(qk(h.video,t),(i=(s=h.video).deviceId)!==null&&i!==void 0||(s.deviceId={ideal:"default"}),(u||d)&&(h.video.processor=u??d)),h}function qk(n,e){return Object.keys(e).forEach(t=>{n[t]===void 0&&(n[t]=e[t])}),n}function rE(n){var e,t,r,i;const a={};if(n.video)if(typeof n.video=="object"){const s={},o=s,c=n.video;Object.keys(c).forEach(u=>{switch(u){case"resolution":qk(o,c.resolution);break;default:o[u]=c[u]}}),a.video=s,(e=(r=a.video).deviceId)!==null&&e!==void 0||(r.deviceId={ideal:"default"})}else a.video=n.video?{deviceId:{ideal:"default"}}:!1;else a.video=!1;return n.audio?typeof n.audio=="object"?(a.audio=n.audio,(t=(i=a.audio).deviceId)!==null&&t!==void 0||(i.deviceId={ideal:"default"})):a.audio={deviceId:{ideal:"default"}}:a.audio=!1,a}function g$(n){return Q(this,arguments,void 0,function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200;return function*(){const r=v$();if(r){const i=r.createAnalyser();i.fftSize=2048;const a=i.frequencyBinCount,s=new Uint8Array(a);r.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(i),yield Ji(t),i.getByteTimeDomainData(s);const c=s.some(u=>u!==128&&u!==0);return r.close(),!c}return!1}()})}function v$(){var n;const e=typeof window<"u"&&(window.AudioContext||window.webkitAudioContext);if(e){const t=new e({latencyHint:"interactive"});if(t.state==="suspended"&&typeof window<"u"&&(!((n=window.document)===null||n===void 0)&&n.body)){const r=()=>Q(this,void 0,void 0,function*(){var i;try{t.state==="suspended"&&(yield t.resume())}catch(a){console.warn("Error trying to auto-resume audio context",a)}finally{(i=window.document.body)===null||i===void 0||i.removeEventListener("click",r)}});t.addEventListener("statechange",()=>{var i;t.state==="closed"&&((i=window.document.body)===null||i===void 0||i.removeEventListener("click",r))}),window.document.body.addEventListener("click",r)}return t}}function pbe(n){return n==="audioinput"?Ae.Source.Microphone:n==="videoinput"?Ae.Source.Camera:Ae.Source.Unknown}function zk(n){return n===Ae.Source.Microphone?"audioinput":n===Ae.Source.Camera?"videoinput":void 0}function mbe(n){var e,t;let r=(e=n.video)!==null&&e!==void 0?e:!0;return n.resolution&&n.resolution.width>0&&n.resolution.height>0&&(r=typeof r=="boolean"?{}:r,xf()?r=Object.assign(Object.assign({},r),{width:{max:n.resolution.width},height:{max:n.resolution.height},frameRate:n.resolution.frameRate}):r=Object.assign(Object.assign({},r),{width:{ideal:n.resolution.width},height:{ideal:n.resolution.height},frameRate:n.resolution.frameRate})),{audio:(t=n.audio)!==null&&t!==void 0?t:!1,video:r,controller:n.controller,selfBrowserSurface:n.selfBrowserSurface,surfaceSwitching:n.surfaceSwitching,systemAudio:n.systemAudio,preferCurrentTab:n.preferCurrentTab}}function ng(n){return n.split("/")[1].toLowerCase()}function gbe(n){const e=[];return n.forEach(t=>{t.track!==void 0&&e.push(new KT({cid:t.track.mediaStreamID,track:t.trackInfo}))}),e}function en(n){return"mediaStreamTrack"in n?{trackID:n.sid,source:n.source,muted:n.isMuted,enabled:n.mediaStreamTrack.enabled,kind:n.kind,streamID:n.mediaStreamID,streamTrackID:n.mediaStreamTrack.id}:{trackID:n.trackSid,enabled:n.isEnabled,muted:n.isMuted,trackInfo:Object.assign({mimeType:n.mimeType,name:n.trackName,encrypted:n.isEncrypted,kind:n.kind,source:n.source},n.track?en(n.track):{})}}function vbe(){return typeof RTCRtpReceiver<"u"&&"getSynchronizationSources"in RTCRtpReceiver}function ybe(n,e){var t;n===void 0&&(n={}),e===void 0&&(e={});const r=[...Object.keys(e),...Object.keys(n)],i={};for(const a of r)n[a]!==e[a]&&(i[a]=(t=e[a])!==null&&t!==void 0?t:"");return i}function y$(n){const e=Object.assign({},n);let t,r;return typeof e.audio=="object"&&e.audio.processor&&(t=e.audio.processor,e.audio=Object.assign(Object.assign({},e.audio),{processor:void 0})),typeof e.video=="object"&&e.video.processor&&(r=e.video.processor,e.video=Object.assign(Object.assign({},e.video),{processor:void 0})),{audioProcessor:t,videoProcessor:r,optionsWithoutProcessor:lbe(e)}}function _be(n){switch(n){case zr.CAMERA:return Ae.Source.Camera;case zr.MICROPHONE:return Ae.Source.Microphone;case zr.SCREEN_SHARE:return Ae.Source.ScreenShare;case zr.SCREEN_SHARE_AUDIO:return Ae.Source.ScreenShareAudio;default:return Ae.Source.Unknown}}function zI(n,e){return n.width*n.height<e.width*e.height}function bbe(n,e){var t;return(t=n.layers)===null||t===void 0?void 0:t.find(r=>r.quality===e)}const xbe=5e3,Sm=[];var bs;(function(n){n[n.LOW=0]="LOW",n[n.MEDIUM=1]="MEDIUM",n[n.HIGH=2]="HIGH"})(bs||(bs={}));class Ae extends xo.EventEmitter{get streamState(){return this._streamState}setStreamState(e){this._streamState=e}constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i;super(),this.attachedElements=[],this.isMuted=!1,this._streamState=Ae.StreamState.Active,this.isInBackground=!1,this._currentBitrate=0,this.log=qt,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),document.visibilityState==="hidden"?this.backgroundTimeout=setTimeout(()=>this.handleAppVisibilityChanged(),xbe):this.handleAppVisibilityChanged()},this.log=Ha((i=r.loggerName)!==null&&i!==void 0?i:yi.Track),this.loggerContextCb=r.loggerContextCb,this.setMaxListeners(100),this.kind=t,this._mediaStreamTrack=e,this._mediaStreamID=e.id,this.source=Ae.Source.Unknown}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),en(this))}get currentBitrate(){return this._currentBitrate}get mediaStreamTrack(){return this._mediaStreamTrack}get mediaStreamID(){return this._mediaStreamID}attach(e){let t="audio";this.kind===Ae.Kind.Video&&(t="video"),this.attachedElements.length===0&&this.kind===Ae.Kind.Video&&this.addAppVisibilityListener(),e||(t==="audio"&&(Sm.forEach(a=>{a.parentElement===null&&!e&&(e=a)}),e&&Sm.splice(Sm.indexOf(e),1)),e||(e=document.createElement(t))),this.attachedElements.includes(e)||this.attachedElements.push(e),Ph(this.mediaStreamTrack,e);const r=e.srcObject.getTracks(),i=r.some(a=>a.kind==="audio");return e.play().then(()=>{this.emit(i?We.AudioPlaybackStarted:We.VideoPlaybackStarted)}).catch(a=>{a.name==="NotAllowedError"?this.emit(i?We.AudioPlaybackFailed:We.VideoPlaybackFailed,a):a.name==="AbortError"?qt.debug("".concat(i?"audio":"video"," playback aborted, likely due to new play request")):qt.warn("could not playback ".concat(i?"audio":"video"),a),i&&e&&r.some(s=>s.kind==="video")&&a.name==="NotAllowedError"&&(e.muted=!0,e.play().catch(()=>{}))}),this.emit(We.ElementAttached,e),e}detach(e){try{if(e){Yh(this.mediaStreamTrack,e);const r=this.attachedElements.indexOf(e);return r>=0&&(this.attachedElements.splice(r,1),this.recycleElement(e),this.emit(We.ElementDetached,e)),e}const t=[];return this.attachedElements.forEach(r=>{Yh(this.mediaStreamTrack,r),t.push(r),this.recycleElement(r),this.emit(We.ElementDetached,r)}),this.attachedElements=[],t}finally{this.attachedElements.length===0&&this.removeAppVisibilityListener()}}stop(){this.stopMonitor(),this._mediaStreamTrack.stop()}enable(){this._mediaStreamTrack.enabled=!0}disable(){this._mediaStreamTrack.enabled=!1}stopMonitor(){this.monitorInterval&&clearInterval(this.monitorInterval),this.timeSyncHandle&&cancelAnimationFrame(this.timeSyncHandle)}updateLoggerOptions(e){e.loggerName&&(this.log=Ha(e.loggerName)),e.loggerContextCb&&(this.loggerContextCb=e.loggerContextCb)}recycleElement(e){if(e instanceof HTMLAudioElement){let t=!0;e.pause(),Sm.forEach(r=>{r.parentElement||(t=!1)}),t&&Sm.push(e)}}handleAppVisibilityChanged(){return Q(this,void 0,void 0,function*(){this.isInBackgroun
3924d=document.visibilityState==="hidden",!this.isInBackground&&this.kind===Ae.Kind.Video&&setTimeout(()=>this.attachedElements.forEach(e=>e.play().catch(()=>{})),0)})}addAppVisibilityListener(){Fa()?(this.isInBackground=document.visibilityState==="hidden",document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){Fa()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function Ph(n,e){let t;e.srcObject instanceof MediaStream?t=e.srcObject:t=new MediaStream;let r;n.kind==="audio"?r=t.getAudioTracks():r=t.getVideoTracks(),r.includes(n)||(r.forEach(i=>{t.removeTrack(i)}),t.addTrack(n)),(!xf()||!(e instanceof HTMLVideoElement))&&(e.autoplay=!0),e.muted=t.getAudioTracks().length===0,e instanceof HTMLVideoElement&&(e.playsInline=!0),e.srcObject!==t&&(e.srcObject=t,(xf()||hp())&&e instanceof HTMLVideoElement&&setTimeout(()=>{e.srcObject=t,e.play().catch(()=>{})},0))}function Yh(n,e){if(e.srcObject instanceof MediaStream){const t=e.srcObject;t.removeTrack(n),t.getTracks().length>0?e.srcObject=t:e.srcObject=null}}(function(n){let e;(function(u){u.Audio="audio",u.Video="video",u.Unknown="unknown"})(e=n.Kind||(n.Kind={}));let t;(function(u){u.Camera="camera",u.Microphone="microphone",u.ScreenShare="screen_share",u.ScreenShareAudio="screen_share_audio",u.Unknown="unknown"})(t=n.Source||(n.Source={}));let r;(function(u){u.Active="active",u.Paused="paused",u.Unknown="unknown"})(r=n.StreamState||(n.StreamState={}));function i(u){switch(u){case e.Audio:return Wo.AUDIO;case e.Video:return Wo.VIDEO;default:return Wo.DATA}}n.kindToProto=i;function a(u){switch(u){case Wo.AUDIO:return e.Audio;case Wo.VIDEO:return e.Video;default:return e.Unknown}}n.kindFromProto=a;function s(u){switch(u){case t.Camera:return zr.CAMERA;case t.Microphone:return zr.MICROPHONE;case t.ScreenShare:return zr.SCREEN_SHARE;case t.ScreenShareAudio:return zr.SCREEN_SHARE_AUDIO;default:return zr.UNKNOWN}}n.sourceToProto=s;function o(u){switch(u){case zr.CAMERA:return t.Camera;case zr.MICROPHONE:return t.Microphone;case zr.SCREEN_SHARE:return t.ScreenShare;case zr.SCREEN_SHARE_AUDIO:return t.ScreenShareAudio;default:return t.Unknown}}n.sourceFromProto=o;function c(u){switch(u){case Ak.ACTIVE:return r.Active;case Ak.PAUSED:return r.Paused;default:return r.Unknown}}n.streamStateFromProto=c})(Ae||(Ae={}));const wbe="|",WI="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function Cbe(n){const e=n.split(wbe);return e.length>1?[e[0],n.substr(e[0].length+1)]:[n,""]}function Ji(n){return new Yi(e=>Vr.setTimeout(e,n))}function Wk(){return"addTransceiver"in RTCPeerConnection.prototype}function Hk(){return"addTrack"in RTCPeerConnection.prototype}function kbe(){if(!("getCapabilities"in RTCRtpSender)||xf()||hp())return!1;const n=RTCRtpSender.getCapabilities("video");let e=!1;if(n){for(const t of n.codecs)if(t.mimeType.toLowerCase()==="video/av1"){e=!0;break}}return e}function Sbe(){if(!("getCapabilities"in RTCRtpSender)||hp())return!1;if(xf()){const t=ba();if(t!=null&&t.version&&Zc(t.version,"16")<0||(t==null?void 0:t.os)==="iOS"&&(t!=null&&t.osVersion)&&Zc(t.osVersion,"16")<0)return!1}const n=RTCRtpSender.getCapabilities("video");let e=!1;if(n){for(const t of n.codecs)if(t.mimeType.toLowerCase()==="video/vp9"){e=!0;break}}return e}function Go(n){return n==="av1"||n==="vp9"}function Vk(n){return!document||Fg()?!1:(n||(n=document.createElement("audio")),"setSinkId"in n)}function Tbe(){return typeof RTCPeerConnection>"u"?!1:Wk()||Hk()}function hp(){var n;return((n=ba())===null||n===void 0?void 0:n.name)==="Firefox"}function HI(){const n=ba();return!!n&&n.name==="Chrome"&&n.os!=="iOS"}function xf(){var n;return((n=ba())===null||n===void 0?void 0:n.name)==="Safari"}function Fg(){const n=ba();return(n==null?void 0:n.name)==="Safari"||(n==null?void 0:n.os)==="iOS"}function Ebe(){const n=ba();return(n==null?void 0:n.name)==="Safari"&&n.version.startsWith("17.")||(n==null?void 0:n.os)==="iOS"&&!!(n!=null&&n.osVersion)&&Zc(n.osVersion,"17")>=0}function Pbe(n){return n||(n=ba()),(n==null?void 0:n.name)==="Safari"&&Zc(n.version,"18.3")>0||(n==null?void 0:n.os)==="iOS"&&!!(n!=null&&n.osVersion)&&Zc(n.osVersion,"18.3")>0}function _$(){var n,e;return Fa()?(e=(n=navigator.userAgentData)===null||n===void 0?void 0:n.mobile)!==null&&e!==void 0?e:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent):!1}function Rbe(){const n=ba(),e="17.2";if(n)return n.name!=="Safari"&&n.os!=="iOS"||n.os==="iOS"&&n.osVersion&&Zc(n.osVersion,e)>=0?!0:n.name==="Safari"&&Zc(n.version,e)>=0}function Fa(){return typeof document<"u"}function Qc(){return navigator.product=="ReactNative"}function pp(n){return n.hostname.endsWith(".livekit.cloud")||n.hostname.endsWith(".livekit.run")}function Vw(n){return pp(n)?n.hostname.split(".")[0]:null}function b$(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function x$(){if(!Qc())return;let n=b$();if(n)return n.platform}
vendor: 4,313 bytes, line 3924
3924function VI(){if(Fa())return window.devicePixelRatio;if(Qc()){let n=b$();if(n)return n.devicePixelRatio}return 1}function Zc(n,e){const t=n.split("."),r=e.split("."),i=Math.min(t.length,r.length);for(let a=0;a<i;++a){const s=parseInt(t[a],10),o=parseInt(r[a],10);if(s>o)return 1;if(s<o)return-1;if(a===i-1&&s===o)return 0}return n===""&&e!==""?-1:e===""?1:t.length==r.length?0:t.length<r.length?-1:1}function Abe(n){for(const e of n)e.target.handleResize(e)}function Ibe(n){for(const e of n)e.target.handleVisibilityChanged(e)}let Gw=null;const GI=()=>(Gw||(Gw=new ResizeObserver(Abe)),Gw);let Kw=null;const KI=()=>(Kw||(Kw=new IntersectionObserver(Ibe,{root:null,rootMargin:"0px"})),Kw);function Obe(){var n;const e=new v6({sdk:y6.JS,protocol:cbe,version:obe});return Qc()&&(e.os=(n=x$())!==null&&n!==void 0?n:""),e}function YI(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:16,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const i=document.createElement("canvas");i.width=n,i.height=e;const a=i.getContext("2d");a==null||a.fillRect(0,0,i.width,i.height),r&&a&&(a.beginPath(),a.arc(n/2,e/2,50,0,Math.PI*2,!0),a.closePath(),a.fillStyle="grey",a.fill());const s=i.captureStream(),[o]=s.getTracks();if(!o)throw Error("Could not get empty media stream video track");return o.enabled=t,o}let Tm;function Yw(){if(!Tm){const n=new AudioContext,e=n.createOscillator(),t=n.createGain();t.gain.setValueAtTime(0,0);const r=n.createMediaStreamDestination();if(e.connect(t),t.connect(r),e.start(),[Tm]=r.stream.getAudioTracks(),!Tm)throw Error("Could not get empty media stream audio track");Tm.enabled=!1}return Tm.clone()}class Ai{get isResolved(){return this._isResolved}constructor(e,t){this._isResolved=!1,this.onFinally=t,this.promise=new Promise((r,i)=>Q(this,void 0,void 0,function*(){this.resolve=r,this.reject=i,e&&(yield e(r,i))})).finally(()=>{var r;this._isResolved=!0,(r=this.onFinally)===null||r===void 0||r.call(this)})}}function Mbe(n){return fbe.includes(n)}function af(n){if(typeof n=="string"||typeof n=="number")return n;if(Array.isArray(n))return n[0];if(n.exact!==void 0)return Array.isArray(n.exact)?n.exact[0]:n.exact;if(n.ideal!==void 0)return Array.isArray(n.ideal)?n.ideal[0]:n.ideal;throw Error("could not unwrap constraint")}function Dbe(n){return n.startsWith("http")?n.replace(/^(http)/,"ws"):n}function $g(n){return n.startsWith("ws")?n.replace(/^(ws)/,"http"):n}function Nbe(n,e){return n.segments.map(t=>{let{id:r,text:i,language:a,startTime:s,endTime:o,final:c}=t;var u;const l=(u=e.get(r))!==null&&u!==void 0?u:Date.now(),d=Date.now();return c?e.delete(r):e.set(r,l),{id:r,text:i,startTime:Number.parseInt(s.toString()),endTime:Number.parseInt(o.toString()),final:c,language:a,firstReceivedTime:l,lastReceivedTime:d}})}function Lbe(n){const{id:e,timestamp:t,message:r,editTimestamp:i}=n;return{id:e,timestamp:Number.parseInt(t.toString()),editTimestamp:i?Number.parseInt(i.toString()):void 0,message:r}}function XI(n){switch(n.reason){case Fn.LeaveRequest:return n.context;case Fn.Cancelled:return Zo.CLIENT_INITIATED;case Fn.NotAllowed:return Zo.USER_REJECTED;case Fn.ServerUnreachable:return Zo.JOIN_FAILURE;default:return Zo.UNKNOWN_REASON}}function Sy(n){return n!==void 0?Number(n):void 0}function Nd(n){return n!==void 0?BigInt(n):void 0}function Xh(n){return!!n&&!(n instanceof MediaStreamTrack)&&n.isLocal}function Yc(n){return!!n&&n.kind==Ae.Kind.Audio}function hd(n){return!!n&&n.kind==Ae.Kind.Video}function Pu(n){return Xh(n)&&hd(n)}function Iu(n){return Xh(n)&&Yc(n)}function Gk(n){return!!n&&!n.isLocal}function Fbe(n){return!!n&&!n.isLocal}function Xw(n){return Gk(n)&&hd(n)}function $be(n){return n.isLocal}function Bbe(n,e){const t=[];let r=new TextEncoder().encode(n);for(;r.length>e;){let i=e;for(;i>0;){const a=r[i];if(a!==void 0&&(a&192)!==128)break;i--}t.push(r.slice(0,i)),r=r.slice(i)}return r.length>0&&t.push(r),t}function Ube(n){var e;const t=n.get("Cache-Control");if(t){const r=(e=t.match(/(?:^|[,\s])max-age=(\d+)/))===null||e===void 0?void 0:e[1];if(r)return parseInt(r,10)}}function Kk(){return typeof CompressionStream<"u"}function jbe(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;
3924const r=qbe(n,e);return t?r:iE(r,"v1")}function qbe(n,e){const t=new URL(Dbe(n));return e.forEach((r,i)=>{t.searchParams.set(i,r)}),iE(t,"rtc")}function zbe(n){const e=new URL($g(n));return iE(e,"validate")}function w$(n){return n.endsWith("/")?n:"".concat(n,"/")}function iE(n,e){return n.pathname="".concat(w$(n.pathname)).concat(e),n}function JI(n){if(typeof n=="string")return RI.fromJson(JSON.parse(n),{ignoreUnknownFields:!0});if(n instanceof ArrayBuffer)return RI.fromBinary(new Uint8Array(n));throw new Error("could not decode websocket message: ".concat(typeof n))}function Wbe(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Unknown reason";if(!(n instanceof AbortSignal))return e;const t=n.reason;switch(typeof t){case"string":return t;case"object":return t instanceof Error?t.message:e;default:return"toString"in t?t.toString():e}}const Hbe=10,Em="lk_e2ee",Vbe="LKFrameEncryptionKey",Gbe={sharedKey:!1,ratchetSalt:Vbe,ratchetWindowSize:8,failureTolerance:Hbe,keyringSize:16,keySize:128};var zl;(function(n){n.SetKey="setKey",n.RatchetRequest="ratchetRequest",n.KeyRatcheted="keyRatcheted"})(zl||(zl={}));var QI;(function(n){n.KeyRatcheted="keyRatcheted"})(QI||(QI={}));var Ol;(function(n){n.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",n.EncryptionError="encryptionError"})(Ol||(Ol={}));var ZI;(function(n){n.Error="cryptorError"})(ZI||(ZI={}));function Kbe(){return Ybe()||Yk()}function Yk(){return typeof window.RTCRtpScriptTransform<"u"}function Ybe(){return typeof window.RTCRtpSender<"u"&&typeof window.RTCRtpSender.prototype.createEncodedStreams<"u"}function Xbe(n){var e,t,r,i,a;if(((e=n.value)===null||e===void 0?void 0:e.case)!=="sipDtmf"&&((t=n.value)===null||t===void 0?void 0:t.case)!=="metrics"&&((r=n.value)===null||r===void 0?void 0:r.case)!=="speaker"&&((i=n.value)===null||i===void 0?void 0:i.case)!=="transcription"&&((a=n.value)===null||a===void 0?void 0:a.case)!=="encryptedPacket")return new l6({value:n.value})}class xDe extends xo.EventEmitter{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.latestManuallySetKeyIndex=0,this.onKeyRatcheted=(t,r,i)=>{qt.debug("key ratcheted event received",{ratchetResult:t,participantId:r,keyIndex:i})},this.keyInfoMap=new Map,this.options=Object.assign(Object.assign({},Gbe),e),this.on(zl.KeyRatcheted,this.onKeyRatcheted)}onSetEncryptionKey(e,t,r){const i={key:e,participantIdentity:t,keyIndex:r};if(!this.options.sharedKey&&!t)throw new Error("participant identity needs to be passed for encryption key if sharedKey option is false");this.keyInfoMap.set("".concat(t??"shared","-").concat(r??0),i),r!==void 0&&(this.latestManuallySetKeyIndex=r),this.emit(zl.SetKey,i,r!==void 0)}getKeys(){return Array.from(this.keyInfoMap.values())}getLatestManuallySetKeyIndex(){return this.latestManuallySetKeyIndex}getOptions(){return this.options}ratchetKey(e,t){this.emit(zl.RatchetRequest,e,t)}}var eO;(function(n){n[n.InvalidKey=0]="InvalidKey",n[n.MissingKey=1]="MissingKey",n[n.InternalError=2]="InternalError"})(eO||(eO={}));class Jbe extends xo.EventEmitter{constructor(e,t){super(),this.decryptDataRequests=new Map,this.encryptDataRequests=new Map,this.onWorkerMessage=r=>{var i,a;const{kind:s,data:o}=r.data;switch(s){case"error":if(qt.error(o.error.message),o.uuid){const l=this.decryptDataRequests.get(o.uuid);if(l!=null&&l.reject){l.reject(o.error);break}const d=this.encryptDataRequests.get(o.uuid);if(d!=null&&d.reject){d.reject(o.error);break}}this.emit(Ol.EncryptionError,o.error,o.participantIdentity);break;case"initAck":o.enabled&&this.keyProvider.getKeys().forEach(l=>{this.postKey(l,!1)});break;case"enable":if(o.enabled&&this.keyProvider.getKeys().forEach(l=>{this.postKey(l,!1)}),this.encryptionEnabled!==o.enabled&&o.participantIdentity===((i=this.room)===null||i===void 0?void 0:i.localParticipant.identity))this.emit(Ol.ParticipantEncryptionStatusChanged,o.enabled,this.room.localParticipant),this.encryptionEnabled=o.enabled;else if(o.participantIdentity){const l=(a=this.room)===null||a===void 0?void 0:a.getParticipantByIdentity(o.participantIdentity);if(!l)throw TypeError("couldn't set encryption status, participant not found".concat(o.participantIdentity));
3924this.emit(Ol.ParticipantEncryptionStatusChanged,o.enabled,l)}break;case"ratchetKey":this.keyProvider.emit(zl.KeyRatcheted,o.ratchetResult,o.participantIdentity,o.keyIndex);break;case"decryptDataResponse":const c=this.decryptDataRequests.get(o.uuid);c!=null&&c.resolve&&c.resolve(o);break;case"encryptDataResponse":const u=this.encryptDataRequests.get(o.uuid);u!=null&&u.resolve&&u.resolve(o);break}},this.onWorkerError=r=>{qt.error("e2ee worker encountered an error:",{error:r.error}),this.emit(Ol.EncryptionError,r.error,void 0)},this.keyProvider=e.keyProvider,this.worker=e.worker,this.encryptionEnabled=!1,this.dataChannelEncryptionEnabled=t}get isEnabled(){return this.encryptionEnabled}get isDataChannelEncryptionEnabled(){return this.isEnabled&&this.dataChannelEncryptionEnabled}setup(e){if(!Kbe())throw new tE("tried to setup end-to-end encryption on an unsupported browser");if(qt.info("setting up e2ee"),e!==this.room){this.room=e,this.setupEventListeners(e,this.keyProvider);const t={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:z_e.getLevel()}};this.worker&&(qt.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(t))}}setParticipantCryptorEnabled(e,t){qt.debug("set e2ee to ".concat(e," for participant ").concat(t)),this.postEnable(e,t)}setSifTrailer(e){!e||e.length===0?qt.warn("ignoring server sent trailer as it's empty"):this.postSifTrailer(e)}setupEngine(e){e.on(Ue.RTPVideoMapUpdate,t=>{this.postRTPMap(t)})}setupEventListeners(e,t){e.on(Me.TrackPublished,(r,i)=>this.setParticipantCryptorEnabled(r.trackInfo.encryption!==Bn.NONE,i.identity)),e.on(Me.ConnectionStateChanged,r=>
3924{r===yn.Connected&&e.remoteParticipants.forEach(i=>{i.trackPublications.forEach(a=>{this.setParticipantCryptorEnabled(a.trackInfo.encryption!==Bn.NONE,i.identity)})})}).on(Me.TrackUnsubscribed,(r,i,a)=>{var s;const o={kind:"removeTransform",data:{participantIdentity:a.identity,trackId:r.mediaStreamID}};(s=this.worker)===null||s===void 0||s.postMessage(o)}).on(Me.TrackSubscribed,(r,i,a)=>{this.setupE2EEReceiver(r,a.identity,i.trackInfo)}).on(Me.SignalConnected,()=>{if(!this.room)throw new TypeError("expected room to be present on signal connect");const r=t.getLatestManuallySetKeyIndex();t.getKeys().forEach(i=>{var a;this.postKey(i,r===((a=i.keyIndex)!==null&&a!==void 0?a:0))}),this.setParticipantCryptorEnabled(this.room.localParticipant.isE2EEEnabled,this.room.localParticipant.identity)}),e.localParticipant.on(Ve.LocalSenderCreated,(r,i)=>Q(this,void 0,void 0,function*(){this.setupE2EESender(i,r)})),e.localParticipant.on(Ve.LocalTrackPublished,r=>{if(!hd(r.track)||!Fg())return;const i={kind:"updateCodec",data:{trackId:r.track.mediaStreamID,codec:ng(r.trackInfo.codecs[0].mimeType),participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(i)}),t.on(zl.SetKey,(r,i)=>this.postKey(r,i??!0)).on(zl.RatchetRequest,(r,i)=>this.postRatchetRequest(r,i))}encryptData(e){return Q(this,void 0,void 0,function*(){if(!this.worker)throw Error("could not encrypt data, worker is missing");const t=crypto.randomUUID(),r={kind:"encryptDataRequest",data:{uuid:t,payload:e,participantIdentity:this.room.localParticipant.identity}},i=new Ai;return i.onFinally=()=>{this.encryptDataRequests.delete(t)},this.encryptDataRequests.set(t,i),this.worker.postMessage(r),i.promise})}handleEncryptedData(e,t,r,i){if(!this.worker)throw Error("could not handle encrypted data, worker is missing");const a=crypto.randomUUID(),s={kind:"decryptDataRequest",data:{uuid:a,payload:e,iv:t,participantIdentity:r,keyIndex:i}},o=new Ai;return o.onFinally=()=>{this.decryptDataRequests.delete(a)},this.decryptDataRequests.set(a,o),this.worker.postMessage(s),o.promise}postRatchetRequest(e,t){if(!this.worker)throw Error("could not ratchet key, worker is missing");const r={kind:"ratchetRequest",data:{participantIdentity:e,keyIndex:t}};this.worker.postMessage(r)}postKey(e,t){let{key:r,participantIdentity:i,keyIndex:a}=e;var s;if(!this.worker)throw Error("could not set key, worker is missing");const o={kind:"setKey",data:{participantIdentity:i,isPublisher:i===((s=this.room)===null||s===void 0?void 0:s.localParticipant.identity),key:r,keyIndex:a,updateCurrentKeyIndex:t}};this.worker.postMessage(o)}postEnable(e,t){if(this.worker){const r={kind:"enable",data:{enabled:e,participantIdentity:t}};this.worker.postMessage(r)}else throw new ReferenceError("failed to enable e2ee, worker is not ready")}postRTPMap(e){var t;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(!((t=this.room)===null||t===void 0)&&t.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");const r={kind:"setRTPMap",data:{map:e,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(r)}postSifTrailer(e){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");const t={kind:"setSifTrailer",data:{trailer:e}};this.worker.postMessage(t)}setupE2EEReceiver(e,t,r){if(e.receiver){if(!(r!=null&&r.mimeType)||r.mimeType==="")throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(e.receiver,e.mediaStreamID,t,e.kind==="video"?ng(r.mimeType):void 0)}}setupE2EESender(e,t){if(!Xh(e)||!t){t||qt.warn("early return because sender is not ready");return}this.handleSender(t,e.mediaStreamID,void 0)}handleReceiver(e,t,r,i){return Q(this,void 0,void 0,function*(){if(this.worker){if(Yk()&&!HI()){const a={kind:"decode",participantIdentity:r,trackId:t,codec:i};e.transform=new RTCRtpScriptTransform(this.worker,a)}else{if(Em in e&&i){const c={kind:"updateCodec",data:{trackId:t,codec:i,participantIdentity:r}};this.worker.postMessage(c);return}let a=e.writableStream,s=e.readableStream;if(!a||!s){const c=e.createEncodedStreams();e.writableStream=c.writable,a=c.writable,e.readableStream=c.readable,s=c.readable}const o={kind:"decode",data:{readableStream:s,writableStream:a,trackId:t,codec:i,participantIdentity:r,isReuse:Em in e}};this.worker.postMessage(o,[s,a])}e[Em]=!0}})}handleSender(e,t,r){var i;if(!(Em in e||!this.worker)){if(!(!((i=this.room)===null||i===void 0)&&i.localParticipant.identity)||this.room.localParticipant.identity==="")throw TypeError("local identity needs to be known in order to set up encrypted sender");if(Yk()&&!HI()){qt.info("initialize script transform");const a={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:t,codec:r};e.transform=new RTCRtpScriptTransform(this.worker,a)}else{qt.info("initialize encoded streams");const a=e.createEncodedStreams(),s={kind:"encode",data:{readableStream:a.readable,writableStream:a.writable,codec:r,trackId:t,participantIdentity:this.room.localParticipant.identity,isReuse:!1}};this.worker.postMessage(s,[a.readable,a.writable])}e[Em]=!0}}}const Qbe=500,Zbe=15e3;class Jh{constructor(){this.failedConnectionAttempts=new Map,this.backOffPromises=new Map}static getInstance(){return this._instance||(this._instance=new Jh),this._instance}addFailedConnectionAttempt(e){var t;
3924const r=new URL(e),i=Vw(r);if(!i)return;let a=(t=this.failedConnectionAttempts.get(i))!==null&&t!==void 0?t:0;this.failedConnectionAttempts.set(i,a+1),this.backOffPromises.set(i,Ji(Math.min(Qbe*Math.pow(2,a),Zbe)))}getBackOffPromise(e){const t=new URL(e),r=t&&Vw(t);return r&&this.backOffPromises.get(r)||Promise.resolve()}resetFailedConnectionAttempts(e){const t=new URL(e),r=t&&Vw(t);r&&(this.failedConnectionAttempts.set(r,0),this.backOffPromises.set(r,Promise.resolve()))}resetAll(){this.backOffPromises.clear(),this.failedConnectionAttempts.clear()}}Jh._instance=null;const Jw="default";class pi{constructor(){this._previousDevices=[]}static getInstance(){return this.instance===void 0&&(this.instance=new pi),this.instance}get previousDevices(){return this._previousDevices}getDevices(e){return Q(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var a;if(((a=pi.userMediaPromiseMap)===null||a===void 0?void 0:a.size)>0){qt.debug("awaiting getUserMedia promise");try{t?yield pi.userMediaPromiseMap.get(t):yield Promise.all(pi.userMediaPromiseMap.values())}catch{qt.warn("error waiting for media permissons")}}let s=yield navigator.mediaDevices.enumerateDevices();if(i&&!(xf()&&r.hasDeviceInUse(t))&&(s.filter(c=>c.kind===t).length===0||s.some(c=>{const u=c.label==="",l=t?c.kind===t:!0;return u&&l}))){const c={video:t!=="audioinput"&&t!=="audiooutput",audio:t!=="videoinput"&&{deviceId:{ideal:"default"}}},u=yield navigator.mediaDevices.getUserMedia(c);s=yield navigator.mediaDevices.enumerateDevices(),u.getTracks().forEach(l=>{l.stop()})}return r._previousDevices=s,t&&(s=s.filter(o=>o.kind===t)),s}()})}normalizeDeviceId(e,t,r){return Q(this,void 0,void 0,function*(){if(t!==Jw)return t;const i=yield this.getDevices(e),a=i.find(o=>o.deviceId===Jw);if(!a){qt.warn("could not reliably determine default device");return}const s=i.find(o=>o.deviceId!==Jw&&o.groupId===(r??a.groupId));if(!s){qt.warn("could not reliably determine default device");return}return s==null?void 0:s.deviceId})}hasDeviceInUse(e){return e?pi.userMediaPromiseMap.has(e):pi.userMediaPromiseMap.size>0}}pi.mediaDeviceKinds=["audioinput","audiooutput","videoinput"];pi.userMediaPromiseMap=new Map;const aE=65535,C$=4294967295;class ec{static u16(e){return new ec(e,aE)}static u32(e){return new ec(e,C$)}constructor(e,t){if(this.value=e,e<0)throw new Error("WrapAroundUnsignedInt: cannot faithfully represent an integer smaller than 0");if(t>Number.MAX_SAFE_INTEGER)throw new Error("WrapAroundUnsignedInt: cannot faithfully represent an integer bigger than MAX_SAFE_INTEGER.");this.maxSize=t,this.clamp()}clamp(){for(;this.value>this.maxSize;)this.value-=this.maxSize+1;for(;this.value<0;)this.value+=this.maxSize+1}clone(){return new ec(this.value,this.maxSize)}update(e){this.value=e(this.value),this.clamp()}increment(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.update(t=>t+e)}decrement(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.update(t=>t-e)}getThenIncrement(){const e=this.value;return this.increment(),new ec(e,this.maxSize)}isBefore(e){const t=this.value>>>0,i=(e.value>>>0)-t>>>0;return i!==0&&i<this.maxSize+1}}class Qh{static fromRtpTicks(e){return new Qh(e,9e4)}static rtpRandom(){const e=Math.round(Math.random()*C$);return Qh.fromRtpTicks(e)}constructor(e,t){this.timestamp=ec.u32(e),this.rateInHz=t}asTicks(){return this.timestamp.value}clone(){return new Qh(this.timestamp.value,this.rateInHz)}wrappingAdd(e){this.timestamp.increment(e)}isBefore(e){return this.timestamp.isBefore(e.timestamp)}}class jd{constructor(e,t,r){this.epoch=t,this.base=r,this.previous=r.clone(),this.rateInHz=e}static startingNow(e,t){return new jd(t,new Date,e)}static startingAtTime(e,t,r){return new jd(r,e,t)}static rtpStartingNow(e){return jd.startingNow(e,9e4)}static rtpStartingAtTime(e,t){return jd.startingAtTime(e,t,9e4)}now(){return this.at(new Date)}at(e){let t=e.getTime()-this.epoch.getTime(),r=jd.durationInMsToTicks(t,this.rateInHz),i=this.base.clone();return i.wrappingAdd(r),i.isBefore(this.previous)&&(i=this.previous),this.previous=i.clone(),i.clone()}static durationInMsToTicks(e,t){let i=(e*1e6*t+5e8)/1e9;return Math.round(i)}}function sE(n){if(n instanceof DataView)return n;if(n instanceof ArrayBuffer)return new DataView(n);if(n instanceof Uint8Array)return new DataView(n.buffer,n.byteOffset,n.byteLength);throw new Error("Error coercing ".concat(n," to DataView - input was not DataView, ArrayBuffer, or Uint8Array."))}var sf;(function(n){n[n.Reserved=0]="Reserved",n[n.TooLarge=1]="TooLarge"})(sf||(sf={}));class mp extends wo{constructor(e,t){super(19,e),this.name="DataTrackHandleError",this.reason=t,this.reasonName=sf[t]}isReason(e){return this.reason===e}static tooLarge(){return new mp("Value too large to be a valid track handle",sf.TooLarge)}static reserved(e){return new mp("0x".concat(e.toString(16)," is a reserved value."),sf.Reserved)}}const e1e={fromNumber(n){if(n===0)throw mp.reserved(n);if(n>aE)throw mp.tooLarge();return n}};class t1e{constructor(){this.value=0}get(){return this.value+=1,this.value>aE?null:this.value}reset(){this.value=0}}const M_={from(n){return{sid:n.sid,pubHandle:n.pubHandle,name:n.name,usesE2ee:n.encryption!==Bn.NONE}},toProtobuf(n){return new Fb({sid:n.sid,pubHandle:n.pubHandle,name:n.name,encryption:n.usesE2ee?Bn.GCM:Bn.NONE})}};var rg;(function(n){n[n.WAITING=0]="WAITING",n[n.RUNNING=1]="RUNNING",n[n.COMPLETED=2]="COMPLETED"})(rg||(rg={}));
3924class n1e{constructor(){this.pendingTasks=new Map,this.taskMutex=new Ii,this.nextTaskIndex=0}run(e){return Q(this,void 0,void 0,function*(){const t={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:rg.WAITING};this.pendingTasks.set(t.id,t);const r=yield this.taskMutex.lock();try{return t.executedAt=Date.now(),t.status=rg.RUNNING,yield e()}finally{t.status=rg.COMPLETED,this.pendingTasks.delete(t.id),r()}})}flush(){return Q(this,void 0,void 0,function*(){return this.run(()=>Q(this,void 0,void 0,function*(){}))})}snapshot(){return Array.from(this.pendingTasks.values())}}class r1e{get readyState(){return this.ws.readyState}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r,i;if(!((r=t.signal)===null||r===void 0)&&r.aborted)throw new DOMException("This operation was aborted","AbortError");this.url=e;const a=new WebSocket(e,(i=t.protocols)!==null&&i!==void 0?i:[]);a.binaryType="arraybuffer",this.ws=a;const s=function(){let{closeCode:o,reason:c}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return a.close(o,c)};this.opened=new Yi((o,c)=>{const u=()=>{c(pt.websocket("Encountered websocket error during connection establishment"))};a.onopen=()=>{o({readable:new ReadableStream({start(l){a.onmessage=d=>{let{data:h}=d;return l.enqueue(h)},a.onerror=d=>l.error(d)},cancel:s}),writable:new WritableStream({write(l){a.send(l)},abort(){a.close()},close:s}),protocol:a.protocol,extensions:a.extensions}),a.removeEventListener("error",u)},a.addEventListener("error",u)}),this.closed=new Yi((o,c)=>{const u=()=>Q(this,void 0,void 0,function*(){const l=new Yi(h=>{a.readyState!==WebSocket.CLOSED&&a.addEventListener("close",p=>{h(p)},{once:!0})}),d=yield Yi.race([Ji(250),l]);d?o(d):c(pt.websocket("Encountered unspecified websocket error without a timely close event"))});a.onclose=l=>{let{code:d,reason:h}=l;o({closeCode:d,reason:h}),a.removeEventListener("error",u)},a.addEventListener("error",u)}),t.signal&&(t.signal.onabort=()=>a.close()),this.close=s}}const i1e=["syncState","trickle","offer","answer","simulate","leave"];function a1e(n){const e=i1e.indexOf(n.case)>=0;return qt.trace("request allowed to bypass queue:",{canPass:e,req:n}),e}var Nn;(function(n){n[n.CONNECTING=0]="CONNECTING",n[n.CONNECTED=1]="CONNECTED",n[n.RECONNECTING=2]="RECONNECTING",n[n.DISCONNECTING=3]="DISCONNECTING",n[n.DISCONNECTED=4]="DISCONNECTED"})(Nn||(Nn={}));const s1e=250;class oE{get currentState(){return this.state}get isDisconnected(){return this.state===Nn.DISCONNECTING||this.state===Nn.DISCONNECTED}get isEstablishingConnection(){return this.state===Nn.CONNECTING||this.state===Nn.RECONNECTING}getNextRequestId(){return this._requestId+=1,this._requestId}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r;this.rtt=0,this.state=Nn.DISCONNECTED,this.log=qt,this._requestId=0,this.useV0SignalPath=!1,this.resetCallbacks=()=>{this.onAnswer=void 0,this.onLeave=void 0,this.onLocalTrackPublished=void 0,this.onLocalTrackUnpublished=void 0,this.onNegotiateRequested=void 0,this.onOffer=void 0,this.onRemoteMuteChanged=void 0,this.onSubscribedQualityUpdate=void 0,this.onTokenRefresh=void 0,this.onTrickle=void 0,this.onClose=void 0,this.onMediaSectionsRequirement=void 0},this.loggerContextCb=t.loggerContextCb,this.log=Ha((r=t.loggerName)!==null&&r!==void 0?r:yi.Signal,()=>this.logContext),this.useJSON=e,this.requestQueue=new n1e,this.queuedRequests=[],this.closingLock=new Ii,this.connectionLock=new Ii,this.state=Nn.DISCONNECTED}get logContext(){var e,t;return(t=(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this))!==null&&t!==void 0?t:{}}join(e,t,r,i){return Q(this,arguments,void 0,function(a,s,o,c){var u=this;let l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,d=arguments.length>5?arguments[5]:void 0;return function*(){return u.state=Nn.CONNECTING,u.options=o,yield u.connect(a,s,o,c,l,d)}()})}reconnect(e,t,r,i){return Q(this,void 0,void 0,function*(){if(!this.options){this.log.warn("attempted to reconnect without signal options being set, ignoring");return}return this.state=Nn.RECONNECTING,this.clearPingInterval(),yield this.connect(e,t,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:r,reconnectReason:i}),void 0,this.useV0SignalPath)})}
3924connect(e,t,r,i){return Q(this,arguments,void 0,function(a,s,o,c){var u=this;let l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,d=arguments.length>5?arguments[5]:void 0;return function*(){const h=yield u.connectionLock.lock();u.connectOptions=o,u.useV0SignalPath=l;const p=Obe(),g=l?o1e(s,p,o):yield c1e(s,p,o,d),v=jbe(a,g,l).toString(),y=zbe(v).toString();return new Promise((b,x)=>Q(u,void 0,void 0,function*(){var S,w;try{let k=!1;const E=j=>Q(this,void 0,void 0,function*(){if(k)return;k=!0;const L=j instanceof Event?j.currentTarget:j,B=Wbe(L,"Abort handler called");this.streamWriter&&!this.isDisconnected?this.sendLeave().then(()=>this.close(B)).catch(V=>{this.log.error(V),this.close()}):this.close(),I(),x(pt.cancelled(B))});c==null||c.addEventListener("abort",E);const I=()=>{clearTimeout(P),c==null||c.removeEventListener("abort",E)},P=setTimeout(()=>{E(pt.timeout("room connection has timed out (signal)"))},o.websocketTimeout),A=(j,L)=>{this.handleSignalConnected(j,P,L)},N=new URL(v);N.searchParams.has("access_token")&&N.searchParams.set("access_token","<redacted>"),this.log.info("signal connecting to ".concat(N),{reconnect:o.reconnect,reconnectReason:o.reconnectReason}),this.ws&&(yield this.close(!1)),this.ws=new r1e(v);try{this.ws.closed.then(se=>{var ie;this.isEstablishingConnection&&x(pt.internal("Websocket got closed during a (re)connection attempt: ".concat(se.reason))),se.closeCode!==1e3&&(this.log.warn("websocket closed",{reason:se.reason,code:se.closeCode,wasClean:se.closeCode===1e3,state:this.state}),this.state===Nn.CONNECTED&&this.handleOnClose((ie=se.reason)!==null&&ie!==void 0?ie:"Unexpected WS error"))}).catch(se=>{this.isEstablishingConnection&&x(pt.internal("Websocket error during a (re)connection attempt: ".concat(se)))});const j=yield this.ws.opened.catch(se=>Q(this,void 0,void 0,function*(){if(this.state!==Nn.CONNECTED){this.state=Nn.DISCONNECTED,clearTimeout(P);const ie=yield this.handleConnectionError(se,y);x(ie);return}this.handleWSError(se),x(se)}));if(clearTimeout(P),!j)return;const L=j.readable.getReader();this.streamWriter=j.writable.getWriter();const B=yield L.read();if(L.releaseLock(),!B.value)throw pt.internal("no message received as first message");const V=JI(B.value),X=this.validateFirstMessage(V,(S=o.reconnect)!==null&&S!==void 0?S:!1);if(!X.isValid){x(X.error);return}((w=V.message)===null||w===void 0?void 0:w.case)==="join"&&(this.pingTimeoutDuration=V.message.value.pingTimeout,this.pingIntervalDuration=V.message.value.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&this.log.debug("ping config",{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration}),this.onJoined&&this.onJoined(V.message.value));const ne=X.shouldProcessFirstMessage?V:void 0;A(j,ne),b(X.response)}catch(j){x(j)}finally{I()}}finally{h()}}))}()})}startReadingLoop(e,t){return Q(this,void 0,void 0,function*(){for(t&&this.handleSignalResponse(t);;){this.signalLatency&&(yield Ji(this.signalLatency));const{done:r,value:i}=yield e.read();if(r)break;const a=JI(i);
3924this.handleSignalResponse(a)}})}close(){return Q(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Close method called on signal client";return function*(){if([Nn.DISCONNECTING||Nn.DISCONNECTED].includes(e.state)){e.log.debug("ignoring signal close as it's already in disconnecting state");return}const i=yield e.closingLock.lock();try{if(e.clearPingInterval(),t&&(e.state=Nn.DISCONNECTING),e.ws){e.ws.close({closeCode:1e3,reason:r});const a=e.ws.closed;e.ws=void 0,e.streamWriter=void 0,yield Promise.race([a,Ji(s1e)])}}catch(a){e.log.debug("websocket error while closing",{error:a})}finally{t&&(e.state=Nn.DISCONNECTED),i()}}()})}sendOffer(e,t){this.log.debug("sending offer",{offerSdp:e.sdp}),this.sendRequest({case:"offer",value:qd(e,t)})}sendAnswer(e,t){return this.log.debug("sending answer",{answerSdp:e.sdp}),this.sendRequest({case:"answer",value:qd(e,t)})}sendIceCandidate(e,t){return this.log.debug("sending ice candidate",{candidate:e}),this.sendRequest({case:"trickle",value:new $b({candidateInit:JSON.stringify(e),target:t})})}sendMuteTrack(e,t){return this.sendRequest({case:"mute",value:new Bb({sid:e,muted:t})})}sendAddTrack(e){return this.sendRequest({case:"addTrack",value:e})}sendUpdateLocalMetadata(e,t){return Q(this,arguments,void 0,function(r,i){var a=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){const o=a.getNextRequestId();return yield a.sendRequest({case:"updateMetadata",value:new XT({requestId:o,metadata:r,name:i,attributes:s})}),o}()})}sendUpdateTrackSettings(e){this.sendRequest({case:"trackSetting",value:e})}sendUpdateSubscription(e){return this.sendRequest({case:"subscription",value:e})}sendSyncState(e){return this.sendRequest({case:"syncState",value:e})}sendUpdateVideoLayers(e,t){return this.sendRequest({case:"updateLayers",value:new E6({trackSid:e,layers:t})})}sendUpdateSubscriptionPermissions(e,t){return this.sendRequest({case:"subscriptionPermission",value:new A6({allParticipants:e,trackPermissions:t})})}sendSimulateScenario(e){return this.sendRequest({case:"simulate",value:e})}sendPing(){return Promise.all([this.sendRequest({case:"ping",value:ir.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new M6({timestamp:ir.parse(Date.now()),rtt:ir.parse(this.rtt)})})])}sendUpdateLocalAudioTrack(e,t){return this.sendRequest({case:"updateAudioTrack",value:new YT({trackSid:e,features:t})})}sendLeave(){return this.sendRequest({case:"leave",value:new jb({reason:Zo.CLIENT_INITIATED,action:Gh.DISCONNECT})})}sendPublishDataTrackRequest(e,t,r){return this.sendRequest({case:"publishDataTrackRequest",value:new HT({pubHandle:e,name:t,encryption:r?Bn.GCM:Bn.NONE})})}sendUnPublishDataTrackRequest(e){return this.sendRequest({case:"unpublishDataTrackRequest",value:new GT({pubHandle:e})})}sendUpdateDataSubscription(e,t){return this.sendRequest({case:"updateDataSubscription",value:new C6({updates:[new k6({trackSid:e,subscribe:t})]})})}sendRequest(e){return Q(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function*(){if(!i&&!a1e(t)&&r.state===Nn.RECONNECTING){r.queuedRequests.push(()=>Q(r,void 0,void 0,function*(){yield this.sendRequest(t,!0)}));return}if(i||(yield r.requestQueue.flush()),r.signalLatency&&(yield Ji(r.signalLatency)),r.isDisconnected){r.log.debug("skipping signal request (type: ".concat(t.case,") - SignalClient disconnected"));return}if(!r.streamWriter){r.log.error("cannot send signal request before connected, type: ".concat(t==null?void 0:t.case));return}const s=new d_e({message:t});try{r.useJSON?yield r.streamWriter.write(s.toJsonString()):yield r.streamWriter.write(s.toBinary())}catch(o){r.log.error("error sending signal message",{error:o})}}()})}handleSignalResponse(e){var t,r;const i=e.message;if(i==null){this.log.debug("received unsupported message");return}let a=!1;if(i.case==="answer"){const s=tO(i.value);this.onAnswer&&this.onAnswer(s,i.value.id,i.value.midToTrackId)}else if(i.case==="offer"){const s=tO(i.value);this.onOffer&&this.onOffer(s,i.value.id,i.value.midToTrackId)}else if(i.case==="trickle"){const s=JSON.parse(i.value.candidateInit);this.onTrickle&&this.onTrickle(s,i.value.target)}else i.case==="update"?this.onParticipantUpdate&&this.onParticipantUpdate((t=i.value.participants)!==null&&t!==void 0?t:[]):i.case==="trackPublished"?this.onLocalTrackPublished&&this.onLocalTrackPublished(i.value):i.case==="speakersChanged"?this.onSpeakersChanged&&this.onSpeakersChanged((r=i.value.speakers)!==null&&r!==void 0?r:[]):i.case==="leave"?this.onLeave&&this.onLeave(i.value):i.case==="mute"?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(i.value.sid,i.value.muted):i.case==="roomUpdate"?this.onRoomUpdate&&i.value.room&&this.onRoomUpdate(i.value.room):i.case==="connectionQuality"?this.onConnectionQuality&&this.onConnectionQuality(i.value):i.case==="streamStateUpdate"?this.onStreamStateUpdate&&this.onStreamStateUpdate(i.value):i.case==="subscribedQualityUpdate"?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(i.value):i.case==="subscriptionPermissionUpdate"?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(i.value):i.case==="refreshToken"?this.onTokenRefresh&&this.onTokenRefresh(i.value):i.case==="trackUnpublished"?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(i.value):i.case==="subscriptionResponse"?this.onSubscriptionError&&this.onSubscriptionError(i.value):i.case==="pong"||(i.case==="pongResp"?(this.rtt=Date.now()-Number.parseInt(i.value.lastPingTimestamp.toString()),this.resetPingTimeout(),a=!0):i.case==="requestResponse"?this.onRequestResponse&&this.onRequestResponse(i.value):i.case==="trackSubscribed"?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(i.value.trackSid):i.case==="roomMoved"?(this.onTokenRefresh&&this.onTokenRefresh(i.value.token),this.onRoomMoved&&this.onRoomMoved(i.value)):i.case==="mediaSectionsRequirement"?this.onMediaSectionsRequirement&&this.onMediaSectionsRequirement
3924(i.value):i.case==="publishDataTrackResponse"?this.onPublishDataTrackResponse&&this.onPublishDataTrackResponse(i.value):i.case==="unpublishDataTrackResponse"?this.onUnPublishDataTrackResponse&&this.onUnPublishDataTrackResponse(i.value):i.case==="dataTrackSubscriberHandles"?this.onDataTrackSubscriberHandles&&this.onDataTrackSubscriberHandles(i.value):this.log.debug("unsupported message",{msgCase:i.case}));a||this.resetPingTimeout()}setReconnected(){for(;this.queuedRequests.length>0;){const e=this.queuedRequests.shift();e&&this.requestQueue.run(e)}}handleOnClose(e){return Q(this,void 0,void 0,function*(){if(this.state===Nn.DISCONNECTED)return;const t=this.onClose;yield this.close(void 0,e),this.log.info("websocket connection closed: ".concat(e),{reason:e}),t&&t(e)})}handleWSError(e){this.log.error("websocket error",{error:e})}resetPingTimeout(){if(this.clearPingTimeout(),!this.pingTimeoutDuration){this.log.warn("ping timeout duration not set");return}this.pingTimeout=Vr.setTimeout(()=>{this.log.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-this.pingTimeoutDuration*1e3).toUTCString())),this.handleOnClose("ping timeout")},this.pingTimeoutDuration*1e3)}clearPingTimeout(){this.pingTimeout&&Vr.clearTimeout(this.pingTimeout)}startPingInterval(){if(this.clearPingInterval(),this.resetPingTimeout(),!this.pingIntervalDuration){this.log.warn("ping interval duration not set");return}this.log.debug("start ping interval"),this.pingInterval=Vr.setInterval(()=>{this.sendPing()},this.pingIntervalDuration*1e3)}clearPingInterval(){this.log.debug("clearing ping interval"),this.clearPingTimeout(),this.pingInterval&&Vr.clearInterval(this.pingInterval)}handleSignalConnected(e,t,r){this.state=Nn.CONNECTED,this.log.info("signal connected"),clearTimeout(t),this.startPingInterval(),this.startReadingLoop(e.readable.getReader(),r)}validateFirstMessage(e,t){var r,i,a,s,o;return((r=e.message)===null||r===void 0?void 0:r.case)==="join"?{isValid:!0,response:e.message.value}:this.state===Nn.RECONNECTING&&((i=e.message)===null||i===void 0?void 0:i.case)!=="leave"?((a=e.message)===null||a===void 0?void 0:a.case)==="reconnect"?{isValid:!0,response:e.message.value}:(this.log.debug("declaring signal reconnected without reconnect response received"),{isValid:!0,response:void 0,shouldProcessFirstMessage:!0}):this.isEstablishingConnection&&((s=e.message)===null||s===void 0?void 0:s.case)==="leave"?{isValid:!1,error:pt.leaveRequest("Received leave request while trying to (re)connect",e.message.value.reason)}:t?{isValid:!1,error:pt.internal("Unexpected first message")}:{isValid:!1,error:pt.internal("did not receive join response, got ".concat((o=e.message)===null||o===void 0?void 0:o.case," instead"))}}handleConnectionError(e,t){return Q(this,void 0,void 0,function*(){try{const r=yield fetch(t);switch(r.status){case 404:const i=yield r.text();return i.includes("requested room does not exist")?pt.notAllowed(i,r.status):pt.serviceNotFound("v1 RTC path not found. Consider upgrading your LiveKit server version","v0-rtc");case 401:case 403:const a=yield r.text();return pt.notAllowed(a,r.status);default:break}return e instanceof pt?e:pt.internal("Encountered unknown websocket error during connection: ".concat(e),{status:r.status,statusText:r.statusText})}catch(r){return r instanceof pt?r:pt.serverUnreachable(r instanceof Error?r.message:"server was not reachable")}})}}function tO(n){const e={type:"offer",sdp:n.sdp};switch(n.type){case"answer":case"offer":case"pranswer":case"rollback":e.type=n.type;break}return e}function qd(n,e){return new ed({sdp:n.sdp,type:n.type,id:e})}function o1e(n,e,t){var r;const i=new URLSearchParams;return i.set("access_token",n),t.reconnect&&(i.set("reconnect","1"),t.sid&&i.set("sid",t.sid)),i.set("auto_subscribe",t.autoSubscribe?"1":"0"),i.set("sdk",Qc()?"reactnative":"js"),i.set("version",e.version),i.set("protocol",e.protocol.toString()),e.deviceModel&&i.set("device_model",e.deviceModel),e.os&&i.set("os",e.os),e.osVersion&&i.set("os_version",e.osVersion),e.browser&&i.set("browser",e.browser),e.browserVersion&&i.set("browser_version",e.browserVersion),t.adaptiveStream&&i.set("adaptive_stream","1"),t.reconnectReason&&i.set("reconnect_reason",t.reconnectReason.toString()),!((r=navigator.connection)===null||r===void 0)&&r.type&&i.set("network",navigator.connection.type),i}function c1e(n,e,t,r){return Q(this,void 0,void 0,function*(){const i=new URLSearchParams;i.set("access_token",n);const a=new L_e({clientInfo:e,connectionSettings:new D6({autoSubscribe:!!t.autoSubscribe,adaptiveStream:!!t.adaptiveStream}),reconnect:!!t.reconnect,participantSid:t.sid?t.sid:void 0,publisherOffer:r});t.reconnectReason&&(a.reconnectReason=t.reconnectReason);const s=a.toBinary();let o,c;if(Kk()){const h=new CompressionStream("gzip"),p=h.writable.getWriter();p.write(new Uint8Array(s)),p.close();const g=[],v=h.readable.getReader();for(;;){const{done:S,value:w}=yield v.read();if(S)break;g.push(w)}const y=g.reduce((S,w)=>S+w.length,0),b=new Uint8Array(y);let x=0;for(const S of g)b.set(S,x),x+=S.length;o=b,c=Ok.GZIP}else o=s,c=Ok.NONE;const l=new F_e({joinRequest:o,compression:c}).toBinary(),d=h=>{const p=Array.from(h,g=>String.fromCodePoint(g)).join("");return btoa(p)};return i.set("join_request",d(l).replace(/\+/g,"-").replace(/\//g,"_")),i})}class nO{constructor(){this.buffer=[],this._totalSize=0}push(e){this.buffer.push(e),this._totalSize+=e.data.byteLength}pop(){const e=this.buffer.shift();return e&&(this._totalSize-=e.data.byteLength),e}getAll(){return this.buffer.slice()}popToSequence(e){for(;this.buffer.length>0&&this.buffer[0].sequence<=e;)this.pop()}alignBufferedAmount(e){for(;this.buffer.length>0;){const t=this.buffer[0];if(this._totalSize-t.data.byteLength<=e)break;this.pop()}}get length(){return this.buffer.length}}class u1e{constructor(e){this._map=new Map,this._lastCleanup=0,this.ttl=e}set(e,t){const r=Date.now();r-this._lastCleanup>this.ttl/2&&this.cleanup();const i=r+this.ttl;return this._map.set(e,{value:t,expiresAt:i}),this}get(e){const t=this._map.get(e);if(t){if(t.expiresAt<Date.now()){this._map.delete(e);return}return t.value}}has(e){const t=this._map.get(e);return t?t.expiresAt<Date.now()?(this._map.delete(e),!1):!0:!1}delete(e){return this._map.delete(e)}clear(){this._map.clear()}cleanup(){const e=Date.now();for(const[t,r]of this._map.entries())r.expiresAt<e&&this._map.delete(t);this._lastCleanup=e}get size(){return this.cleanup(),this._map.size}forEach(e){this.cleanup();for(const[t,r]of this._map.entries())r.expiresAt>=Date.now()&&e(r.value,t,this.asValueMap())}map(e){this.cleanup();const t=[],r=this.asValueMap();for(const[i,a]of r.entries())t.push(e(a,i,r));return t}asValueMap(){const e=new Map;for(const[t,r]of this._map.entries())r.expiresAt>=Date.now()&&e.set(t,r.value);return e}}var Fo={},Qw={},Zw={exports:{}},rO;function cE(){if(rO)return Zw.exports;rO=1;var n=Zw.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return e.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return e.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S
3924*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return e.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=e.raddr!=null?" raddr %s rport %d":"%v%v",t+=e.tcptype!=null?" tcptype %s":"%v",e.generation!=null&&(t+=" generation %d"),t+=e["network-id"]!=null?" network-id %d":"%v",t+=e["network-cost"]!=null?" network-cost %d":"%v",t}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return e.attribute!=null&&(t+=" %s",e.value!=null&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return e.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"}
vendor: 3,627 bytes, line 3924
3924,{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(e.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=e.id!=null?"id=%s %s":"%v%s",t+=e.mediaClockValue!=null?"=%s":"",t+=e.rateNumerator!=null?" rate=%s":"",t+=e.rateDenominator!=null?"/%s":"",t}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(n).forEach(function(e){var t=n[e];t.forEach(function(r){r.reg||(r.reg=/(.*)/),r.format||(r.format="%s")})}),Zw.exports}var iO;function l1e(){return iO||(iO=1,function(n){var e=function(o){return String(Number(o))===o?Number(o):o},t=function(o,c,u,l){if(l&&!u)c[l]=e(o[1]);else for(var d=0;d<u.length;d+=1)o[d+1]!=null&&(c[u[d]]=e(o[d+1]))},r=function(o,c,u){var l=o.name&&o.names;o.push&&!c[o.push]?c[o.push]=[]:l&&!c[o.name]&&(c[o.name]={});var d=o.push?{}:l?c[o.name]:c;t(u.match(o.reg),d,o.names,o.name),o.push&&c[o.push].push(d)},i=cE(),a=RegExp.prototype.test.bind(/^([a-z])=(.*)/);n.parse=function(o){var c={},u=[],l=c;return o.split(/(\r\n|\r|\n)/).filter(a).forEach(function(d){var h=d[0],p=d.slice(2);h==="m"&&(u.push({rtp:[],fmtp:[]}),l=u[u.length-1]);for(var g=0;g<(i[h]||[]).length;g+=1){var v=i[h][g];if(v.reg.test(p))return r(v,l,p)}}),c.media=u,c};var s=function(o,c){var u=c.split(/=(.+)/,2);return u.length===2?o[u[0]]=e(u[1]):u.length===1&&c.length>1&&(o[u[0]]=void 0),o};n.parseParams=function(o){return o.split(/;\s?/).reduce(s,{})},n.parseFmtpConfig=n.parseParams,n.parsePayloads=function(o){return o.toString().split(" ").map(Number)},n.parseRemoteCandidates=function(o){for(var c=[],u=o.split(" ").map(e),l=0;l<u.length;l+=3)c.push({component:u[l],ip:u[l+1],port:u[l+2]});return c},n.parseImageAttributes=function(o){return o.split(" ").map(function(c){return c.substring(1,c.length-1).split(",").reduce(s,{})})},n.parseSimulcastStreamList=function(o){return o.split(";").map(function(c){return c.split(",").map(function(u){var l,d=!1;return u[0]!=="~"?l=e(u):(l=e(u.substring(1,u.length)),d=!0),{scid:l,paused:d}})})}}(Qw)),Qw}var eC,aO;function d1e(){if(aO)return eC;aO=1;var n=cE(),e=/%[sdv%]/g,t=function(s){var o=1,c=arguments,u=c.length;return s.replace(e,function(l){if(o>=u)return l;var d=c[o];switch(o+=1,l){case"%%":return"%";case"%s":return String(d);case"%d":return Number(d);case"%v":return""}})},r=function(s,o,c){var u=o.format instanceof Function?o.format(o.push?c:c[o.name]):o.format,l=[s+"="+u];if(o.names)for(var d=0;d<o.names.length;d+=1){var h=o.names[d];o.name?l.push(c[o.name][h]):l.push(c[o.names[d]])}else l.push(c[o.name]);return t.apply(null,l)},i=["v","o","s","i","u","e","p","c","b","t","r","z","a"],a=["i","c","b","a"];return eC=function(s,o){o=o||{},s.version==null&&(s.version=0),s.name==null&&(s.name=" "),s.media.forEach(function(d){d.payloads==null&&(d.payloads="")});var c=o.outerOrder||i,u=o.innerOrder||a,l=[];return c.forEach(function(d){n[d].forEach(function(h){h.name in s&&s[h.name]!=null?l.push(r(d,h,s)):h.push in s&&s[h.push]!=null&&s[h.push].forEac
3924h(function(p){l.push(r(d,h,p))})})}),s.media.forEach(function(d){l.push(r("m",n.m[0],d)),u.forEach(function(h){n[h].forEach(function(p){p.name in d&&d[p.name]!=null?l.push(r(h,p,d)):p.push in d&&d[p.push]!=null&&d[p.push].forEach(function(g){l.push(r(h,p,g))})})})}),l.join(`\r 3925`)+`\r 3926`},eC}var sO;function f1e(){if(sO)return Fo;sO=1;var n=l1e(),e=d1e(),t=cE();return Fo.grammar=t,Fo.write=e,Fo.parse=n.parse,Fo.parseParams=n.parseParams,Fo.parseFmtpConfig=n.parseFmtpConfig,Fo.parsePayloads=n.parsePayloads,Fo.parseRemoteCandidates=n.parseRemoteCandidates,Fo.parseImageAttributes=n.parseImageAttributes,Fo.parseSimulcastStreamList=n.parseSimulcastStreamList,Fo}var eo=f1e();function uE(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:50,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r,i;let a;const s=(r=t.isImmediate)!==null&&r!==void 0?r:!1,o=(i=t.callback)!==null&&i!==void 0?i:!1,c=t.maxWait;let u=Date.now(),l=[];function d(){if(c!==void 0){const p=Date.now()-u;if(p+e>=c)return c-p}return e}const h=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];const y=this;return new Promise((b,x)=>{const S=function(){if(a=void 0,u=Date.now(),!s){const k=n.apply(y,g);o&&o(k),l.forEach(E=>{let{resolve:I}=E;return I(k)}),l=[]}},w=s&&a===void 0;if(a!==void 0&&Vr.clearTimeout(a),a=Vr.setTimeout(S,d()),w){const k=n.apply(y,g);return o&&o(k),b(k)}l.push({resolve:b,reject:x})})};return h.cancel=function(p){a!==void 0&&Vr.clearTimeout(a),l.forEach(g=>{let{reject:v}=g;return v(p)}),l=[]},h}const h1e=.7,p1e=20,Yd={NegotiationStarted:"negotiationStarted",NegotiationComplete:"negotiationComplete",OfferAnswered:"offerAnswered",RTPVideoPayloadTypes:"rtpVideoPayloadTypes"};class oO extends xo.EventEmitter{get pc(){return this._pc||(this._pc=this.createPC()),this._pc}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r;super(),this.log=qt,this.ddExtID=0,this.latestOfferId=0,this.latestAcknowledgedOfferId=0,this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate=!1,this.trackBitrates=[],this.remoteStereoMids=[],this.remoteNackMids=[],this.negotiate=uE(i=>Q(this,void 0,void 0,function*(){this.emit(Yd.NegotiationStarted);try{yield this.createAndSendOffer()}catch(a){if(i)i(a);else throw a}}),p1e),this.close=()=>{this._pc&&(this.pendingInitialOffer=void 0,this._pc.close(),this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.ondatachannel=null,this._pc.onnegotiationneeded=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ondatachannel=null,this._pc.ontrack=null,this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc=null)},this.log=Ha((r=t.loggerName)!==null&&r!==void 0?r:yi.PCTransport),this.loggerOptions=t,this.config=e,this._pc=this.createPC(),this.offerLock=new Ii}createPC(){const e=new RTCPeerConnection(this.config);return e.onicecandidate=t=>{var r;t.candidate&&((r=this.onIceCandidate)===null||r===void 0||r.call(this,t.candidate))},e.onicecandidateerror=t=>{var r;(r=this.onIceCandidateError)===null||r===void 0||r.call(this,t)},e.oniceconnectionstatechange=()=>{var t;(t=this.onIceConnectionStateChange)===null||t===void 0||t.call(this,e.iceConnectionState)},e.onsignalingstatechange=()=>{var t;(t=this.onSignalingStatechange)===null||t===void 0||t.call(this,e.signalingState)},e.onconnectionstatechange=()=>{var t;(t=this.onConnectionStateChange)===null||t===void 0||t.call(this,e.connectionState)},e.ondatachannel=t=>{var r;(r=this.onDataChannel)===null||r===void 0||r.call(this,t)},e.ontrack=t=>{var r;(r=this.onTrack)===null||r===void 0||r.call(this,t)},e}get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions).loggerContextCb)===null||t===void 0?void 0:t.call(e))}get isICEConnected(){return this._pc!==null&&(this.pc.iceConnectionState==="connected"||this.pc.iceConnectionState==="completed")}addIceCandidate(e){return Q(this,void 0,void 0,function*(){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(e);this.pendingCandidates.push(e)})}setRemoteDescription(e,t){return Q(this,void 0,void 0,function*(){var r,i;if(e.type==="answer"&&this.latestOfferId>0&&t>0&&t!==this.latestOfferId)return this.log.warn("ignoring answer for old offer",Object.assign(Object.assign({},this.logContext),{offerId:t,latestOfferId:this.latestOfferId})),!1;let a;if(e.type==="offer"){let{stereoMids:s,nackMids:o}=m1e(e);this.remoteStereoMids=s,this.remoteNackMids=o}else if(e.type==="answer"){if(this.pendingInitialOffer&&this._pc){const o=this.pendingInitialOffer;this.pendingInitialOffer=void 0;const c=eo.parse((r=o.sdp)!==null&&r!==void 0?r:"");
3926c.media.forEach(u=>{q0(u)}),this.log.debug("setting pending initial offer before processing answer",this.logContext),yield this.setMungedSDP(o,eo.write(c))}const s=eo.parse((i=e.sdp)!==null&&i!==void 0?i:"");s.media.forEach(o=>{const c=lE(o.mid);o.type==="audio"&&this.trackBitrates.some(u=>{if(!u.transceiver||c!=u.transceiver.mid)return!1;let l=0;if(o.rtp.some(h=>h.codec.toUpperCase()===u.codec.toUpperCase()?(l=h.payload,!0):!1),l===0)return!0;let d=!1;for(const h of o.fmtp)if(h.payload===l){h.config=h.config.split(";").filter(p=>!p.includes("maxaveragebitrate")).join(";"),u.maxbr>0&&(h.config+=";maxaveragebitrate=".concat(u.maxbr*1e3)),d=!0;break}return d||u.maxbr>0&&o.fmtp.push({payload:l,config:"maxaveragebitrate=".concat(u.maxbr*1e3)}),!0})}),a=eo.write(s)}return yield this.setMungedSDP(e,a,!0),this.pendingCandidates.forEach(s=>{this.pc.addIceCandidate(s)}),this.pendingCandidates=[],this.restartingIce=!1,e.type==="answer"&&(this.latestAcknowledgedOfferId=t,this.emit(Yd.OfferAnswered,t)),this.renegotiate?(this.renegotiate=!1,yield this.createAndSendOffer()):e.type==="answer"&&(this.emit
3926(Yd.NegotiationComplete),e.sdp&&eo.parse(e.sdp).media.forEach(o=>{o.type==="video"&&this.emit(Yd.RTPVideoPayloadTypes,o.rtp)})),!0})}createInitialOffer(){return Q(this,void 0,void 0,function*(){var e;const t=yield this.offerLock.lock();try{if(this.pc.signalingState!=="stable"){this.log.warn("signaling state is not stable, cannot create initial offer",this.logContext);return}const r=this.latestOfferId+1;this.latestOfferId=r;const i=yield this.pc.createOffer();this.pendingInitialOffer={sdp:i.sdp,type:i.type};const a=eo.parse((e=i.sdp)!==null&&e!==void 0?e:"");return a.media.forEach(s=>{q0(s)}),i.sdp=eo.write(a),{offer:i,offerId:r}}finally{t()}})}createAndSendOffer(e){return Q(this,void 0,void 0,function*(){var t;const r=yield this.offerLock.lock();try{if(this.onOffer===void 0)return;if(e!=null&&e.iceRestart&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),this._pc&&(this._pc.signalingState==="have-local-offer"||this.pendingInitialOffer)){const o=this._pc.remoteDescription;if(e!=null&&e.iceRestart&&o)yield this._pc.setRemoteDescription(o);else{this.renegotiate=!0,this.log.debug("requesting renegotiation",Object.assign({},this.logContext));return}}else if(!this._pc||this._pc.signalingState==="closed"){this.log.warn("could not createOffer with closed peer connection",this.logContext);return}this.log.debug("starting to negotiate",this.logContext);const i=this.latestOfferId+1;this.latestOfferId=i;const a=yield this.pc.createOffer(e);this.log.debug("original offer",Object.assign({sdp:a.sdp},this.logContext));const s=eo.parse((t=a.sdp)!==null&&t!==void 0?t:"");if(s.media.forEach(o=>{q0(o),o.type==="audio"?cO(o,["all"],[]):o.type==="video"&&this.trackBitrates.some(c=>{if(!o.msid||!c.cid||!o.msid.includes(c.cid))return!1;let u=0;if(o.rtp.some(d=>d.codec.toUpperCase()===c.codec.toUpperCase()?(u=d.payload,!0):!1),u===0||(Go(c.codec)&&!xf()&&this.ensureVideoDDExtensionForSVC(o,s),!Go(c.codec)))return!0;const l=Math.round(c.maxbr*h1e);for(const d of o.fmtp)if(d.payload===u){d.config.includes("x-google-start-bitrate")||(d.config+=";x-google-start-bitrate=".concat(l));break}return!0})}),this.latestOfferId>i){this.log.warn("latestOfferId mismatch",Object.assign(Object.assign({},this.logContext),{latestOfferId:this.latestOfferId,offerId:i}));return}yield this.setMungedSDP(a,eo.write(s)),this.onOffer(a,this.latestOfferId)}finally{r()}})}createAndSetAnswer(){return Q(this,void 0,void 0,function*(){var e;const t=yield this.pc.createAnswer(),r=eo.parse((e=t.sdp)!==null&&e!==void 0?e:"");return r.media.forEach(i=>{q0(i),i.type==="audio"&&cO(i,this.remoteStereoMids,this.remoteNackMids)}),yield this.setMungedSDP(t,eo.write(r)),t})}createDataChannel(e,t){return this.pc.createDataChannel(e,t)}addTransceiver(e,t){return this.pc.addTransceiver(e,t)}addTransceiverOfKind(e,t){return this.pc.addTransceiver(e,t)}addTrack(e){if(!this._pc)throw new dr("PC closed, cannot add track");return this._pc.addTrack(e)}setTrackCodecBitrate(e){this.trackBitrates.push(e)}setConfiguration(e){var t;if(!this._pc)throw new dr("PC closed, cannot configure");return(t=this._pc)===null||t===void 0?void 0:t.setConfiguration(e)}canRemoveTrack(){var e;return!!(!((e=this._pc)===null||e===void 0)&&e.removeTrack)}removeTrack(e){var t;return(t=this._pc)===null||t===void 0?void 0:t.removeTrack(e)}getConnectionState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.connectionState)!==null&&t!==void 0?t:"closed"}getICEConnectionState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.iceConnectionState)!==null&&t!==void 0?t:"closed"}getSignallingState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.signalingState)!==null&&t!==void 0?t:"closed"}getTransceivers(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.getTransceivers())!==null&&t!==void 0?t:[]}getSenders(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.getSenders())!==null&&t!==void 0?t:[]}getLocalDescription(){var e;return(e=this._pc)===null||e===void 0?void 0:e.localDescription}getRemoteDescription(){var e;return(e=this.pc)===null||e===void 0?void 0:e.remoteDescription}getStats(){return this.pc.getStats()}getConnectedAddress(){return Q(this,void 0,void 0,function*(){var e;if(!this._pc)return;let t="";const r=new Map,i=new Map;
3926if((yield this._pc.getStats()).forEach(o=>{switch(o.type){case"transport":t=o.selectedCandidatePairId;break;case"candidate-pair":t===""&&o.selected&&(t=o.id),r.set(o.id,o);break;case"remote-candidate":i.set(o.id,"".concat(o.address,":").concat(o.port));break}}),t==="")return;const s=(e=r.get(t))===null||e===void 0?void 0:e.remoteCandidateId;if(s!==void 0)return i.get(s)})}setMungedSDP(e,t,r){return Q(this,void 0,void 0,function*(){var i,a;const s=e.sdp;if(t){e.sdp=t;try{this.log.debug("setting munged ".concat(r?"remote":"local"," description"),this.logContext),r?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e);return}catch(o){this.log.warn("not able to set ".concat(e.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:o,mungedSdp:t,originalSdp:s})),e.sdp=s}}try{r?yield(i=this._pc)===null||i===void 0?void 0:i.setRemoteDescription(e):yield(a=this._pc)===null||a===void 0?void 0:a.setLocalDescription(e)}catch(o){let c="unknown error";o instanceof Error?c=o.message:typeof o=="string"&&(c=o);const u={error:c,sdp:e.sdp};throw t&&t!==s&&(u.mungedSdp=t),!r&&this.pc.remoteDescription&&(u.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(e.type),Object.assign(Object.assign({},this.logContext),{fields:u})),new rf(c)}})}ensureVideoDDExtensionForSVC(e,t){var r,i;if(!((r=e.ext)===null||r===void 0?void 0:r.some(s=>s.uri===WI))){if(this.ddExtID===0){let s=0;t.media.forEach(o=>{var c;(c=o.ext)===null||c===void 0||c.forEach(u=>{u.value>s&&(s=u.value)})}),this.ddExtID=s+1}(i=e.ext)===null||i===void 0||i.push({value:this.ddExtID,uri:WI})}}}function cO(n,e,t){const r=lE(n.mid);let i=0;n.rtp.some(a=>a.codec==="opus"?(i=a.payload,!0):!1),i>0&&(n.rtcpFb||(n.rtcpFb=[]),t.includes(r)&&!n.rtcpFb.some(a=>a.payload===i&&a.type==="nack")&&n.rtcpFb.push({payload:i,type:"nack"}),(e.includes(r)||e.length===1&&e[0]==="all")&&n.fmtp.some(a=>a.payload===i?(a.config.includes("stereo=1")||(a.config+=";stereo=1"),!0):!1))}function m1e(n){var e;const t=[],r=[],i=eo.parse((e=n.sdp)!==null&&e!==void 0?e:"");let a=0;return i.media.forEach(s=>{var o;const c=lE(s.mid);s.type==="audio"&&(s.rtp.some(u=>u.codec==="opus"?(a=u.payload,!0):!1),!((o=s.rtcpFb)===null||o===void 0)&&o.some(u=>u.payload===a&&u.type==="nack")&&r.push(c),s.fmtp.some(u=>u.payload===a?(u.config.includes("sprop-stereo=1")&&t.push(c),!0):!1))}),{stereoMids:t,nackMids:r}}function q0(n){if(n.connection){const e=n.connection.ip.indexOf(":")>=0;(n.connection.version===4&&e||n.connection.version===6&&!e)&&(n.connection.ip="0.0.0.0",n.connection.version=4)}}function lE(n){return typeof n=="number"?n.toFixed(0):n}const Xk="vp8",g1e={audioPreset:Ng.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:nE.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:Xk,backupCodec:!0,preConnectBuffer:!1},k$={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},S$={deviceId:{ideal:"default"},resolution:Lg.h720.resolution},v1e={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new H_e,disconnectOnPageLeave:!0,webAudioMix:!1,singlePeerConnection:!0},dE={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};var hr;(function(n){n[n.NEW=0]="NEW",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED",n[n.FAILED=3]="FAILED",n[n.CLOSING=4]="CLOSING",n[n.CLOSED=5]="CLOSED"})(hr||(hr={}));class uO{get needsPublisher(){return this.isPublisherConnectionRequired}get needsSubscriber(){return this.isSubscriberConnectionRequired}get currentState(){return this.state}get mode(){return this._mode}constructor(e,t,r){var i;this.peerConnectionTimeout=dE.peerConnectionTimeout,this.log=qt,this.updateState=()=>{var a,s;const o=this.state,c=this.requiredTransports.map(u=>u.getConnectionState());c.every(u=>u==="connected")?this.state=hr.CONNECTED:c.some(u=>u==="failed")?this.state=hr.FAILED:c.some(u=>u==="connecting")?this.state=hr.CONNECTING:c.every(u=>u==="closed")?this.state=hr.CLOSED:c.some(u=>u==="closed")?this.state=hr.CLOSING:c.every(u=>u==="new")&&(this.state=hr.NEW),o!==this.state&&(this.log.debug("pc state change: from ".concat(hr[o]," to ").concat(hr[this.state]),this.logContext),(a=this.onStateChange)===null||a===void 0||a.call(this,this.state,this.publisher.getConnectionState(),(s=this.subscriber)===null||s===void 0?void 0:s.getConnectionState()))},this.log=Ha((i=t.loggerName)!==null&&i!==void 0?i:yi.PCManager),this.loggerOptions=t,this.isPublisherConnectionRequired=e!=="subscriber-primary",this.isSubscriberConnectionRequired=e==="subscriber-primary",this.publisher=new oO(r,t),this._mode=e,e!=="publisher-only"&&(this.subscriber=new oO(r,t),this.subscriber.onConnectionStateChange=this.updateState,this.subscriber.onIceConnectionStateChange=this.updateState,this.subscriber.onSignalingStatechange=this.updateState,this.subscriber.onIceCandidate=a=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,a,Ho.SUBSCRIBER)},this.subscriber.onDataChannel=a=>{var s;(s=this.onDataChannel)===null||s===void 0||s.call(this,a)},this.subscriber.onTrack=a=>{var s;(s=this.onTrack)===null||s===void 0||s.call(this,a)}),this.publisher.onConnectionStateChange=this.updateState,this.publisher.onIceConnectionStateChange=this.updateState,this.publisher.onSignalingStatechange=this.updateState,this.publisher.onIceCandidate=a=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,a,Ho.PUBLISHER)},this.publisher.onTrack=a=>{var s;(s=this.onTrack)===null||s===void 0||s.call(this,a)},this.publisher.onOffer=(a,s)=>{var o;(o=this.onPublisherOffer)===null||o===void 0||o.call(this,a,s)},this.state=hr.NEW,this.connectionLock=new Ii,this.remoteOfferLock=new Ii}get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions).loggerContextCb)===null||t===void 0?void 0:t.call(e))}requirePublisher(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isPublisherConnectionRequired=e,this.updateState()}createAndSendPublisherOffer(e){return this.publisher.createAndSendOffer(e)}setPublisherAnswer(e,t){return this.publisher.setRemoteDescription(e,t)}removeTrack(e){return this.publisher.removeTrack(e)}close(){return Q(this,void 0,void 0,function*(){var e;if(this.publisher&&this.publisher.getSignallingState()!=="closed"){const t=this.publisher;for(const r of t.getSenders())try{t.canRemoveTrack()&&t.removeTrack(r)}catch(i){this.log.warn("could not removeTrack",Object.assign(Object.assign({},this.logContext),{error:i}))}}yield Promise.all([this.publisher.close(),(e=this.subscriber)===null||e===void 0?void 0:e.close()]),this.updateState()})}triggerIceRestart(){return Q(this,void 0,void 0,function*(){this.subscriber&&(this.subscriber.restartingIce=!0),this.needsPublisher&&(yield this.createAndSendPublisherOffer({iceRestart:!0}))})}addIceCandidate(e,t){return Q(this,void 0,void 0,function*(){var r;t===Ho.PUBLISHER?yield this.publisher.addIceCandidate(e):yield(r=this.subscriber)===null||r===void 0?void 0:r.addIceCandidate(e)})}createSubscriberAnswerFromOffer(e,t){return Q(this,void 0,void 0,function*(){var r,i,a;this.log.debug("received server offer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,signalingState:(r=this.subscriber)===null||r===void 0?void 0:r.getSignallingState().toString()}));const s=yield this.remoteOfferLock.lock();try{return(yield(i=this.subscriber)===null||i===void 0?void 0:i.setRemoteDescription(e,t))?yield(a=this.subscriber)===null||a===void 0?void 0:a.createAndSetAnswer():void 0}finally{s()}})}updateConfiguration(e,t){var r;this.publisher.setConfiguration(e),(r=this.subscriber)===null||r===void 0||r.setConfiguration(e),t&&this.triggerIceRestart()}ensurePCTransportConnection(e,t){return Q(this,void 0,void 0,function*(){var r;const i=yield this.connectionLock.lock();try{this.isPublisherConnectionRequired&&this.publisher.getConnectionState()!=="connected"&&this.publisher.getConnectionState()!=="connecting"&&(this.log.debug("negotiation required, start negotiating",this.logContext),this.publisher.negotiate()),yield Promise.all((r=this.requiredTransports)===null||r===void 0?void 0:r.map(a=>
3926this.ensureTransportConnected(a,e,t)))}finally{i()}})}negotiate(e){return Q(this,void 0,void 0,function*(){return new Yi((t,r)=>{const i=this.publisher.latestOfferId;if(this.publisher.latestAcknowledgedOfferId>i){this.log.debug("negotiation already handled in more recent acknowledged offer",this.logContext),t();return}let a=!1;const s=()=>{a||(a=!0,clearTimeout(u),this.publisher.off(Yd.OfferAnswered,o),e.signal.removeEventListener("abort",c))},o=l=>{l>i&&(s(),t())},c=()=>{s(),r(new rf("negotiation aborted"))},u=setTimeout(()=>{s(),r(new rf("negotiation timed out"))},this.peerConnectionTimeout);e.signal.addEventListener("abort",c),this.publisher.on(Yd.OfferAnswered,o),this.publisher.negotiate(l=>{s(),l instanceof Error?r(l):r(new Error(String(l)))})})})}addPublisherTransceiver(e,t){return this.publisher.addTransceiver(e,t)}addPublisherTransceiverOfKind(e,t){return this.publisher.addTransceiverOfKind(e,t)}getMidForReceiver(e){const r=(this.subscriber?this.subscriber.getTransceivers():this.publisher.getTransceivers()).find(i=>i.receiver===e);return r==null?void 0:r.mid}addPublisherTrack(e){return this.publisher.addTrack(e)}createPublisherDataChannel(e,t){return this.publisher.createDataChannel(e,t)}getConnectedAddress(e){return e===Ho.PUBLISHER?this.publisher.getConnectedAddress():e===Ho.SUBSCRIBER?this.publisher.getConnectedAddress():this.requiredTransports[0].getConnectedAddress()}get requiredTransports(){const e=[];return this.isPublisherConnectionRequired&&e.push(this.publisher),this.isSubscriberConnectionRequired&&this.subscriber&&e.push(this.subscriber),e}ensureTransportConnected(e,t){return Q(this,arguments,void 0,function(r,i){var a=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.peerConnectionTimeout;return function*(){if(r.getConnectionState()!=="connected")return new Promise((c,u)=>Q(a,void 0,void 0,function*(){const l=()=>{this.log.warn("abort transport connection",this.logContext),Vr.clearTimeout(d),u(pt.cancelled("room connection has been cancelled"))};i!=null&&i.signal.aborted&&l(),i==null||i.signal.addEventListener("abort",l);const d=Vr.setTimeout(()=>{i==null||i.signal.removeEventListener("abort",l),u(pt.internal("could not establish pc connection"))},s);for(;this.state!==hr.CONNECTED;)if(yield Ji(50),i!=null&&i.signal.aborted){u(pt.cancelled("room connection has been cancelled"));return}Vr.clearTimeout(d),i==null||i.signal.removeEventListener("abort",l),c()}))}()})}}class kr extends Error{constructor(e,t,r){super(t),this.code=e,this.message=lO(t,kr.MAX_MESSAGE_BYTES),this.data=r?lO(r,kr.MAX_DATA_BYTES):void 0}static fromProto(e){return new kr(e.code,e.message,e.data)}toProto(){return new h6({code:this.code,message:this.message,data:this.data})}static builtIn(e,t){return new kr(kr.ErrorCode[e],kr.ErrorMessage[e],t)}}kr.MAX_MESSAGE_BYTES=256;kr.MAX_DATA_BYTES=15360;kr.ErrorCode={APPLICATION_ERROR:1500,CONNECTION_TIMEOUT:1501,RESPONSE_TIMEOUT:1502,RECIPIENT_DISCONNECTED:1503,RESPONSE_PAYLOAD_TOO_LARGE:1504,SEND_FAILED:1505,UNSUPPORTED_METHOD:1400,RECIPIENT_NOT_FOUND:1401,REQUEST_PAYLOAD_TOO_LARGE:1402,UNSUPPORTED_SERVER:1403,UNSUPPORTED_VERSION:1404};kr.ErrorMessage={APPLICATION_ERROR:"Application error in method handler",CONNECTION_TIMEOUT:"Connection timeout",RESPONSE_TIMEOUT:"Response timeout",RECIPIENT_DISCONNECTED:"Recipient disconnected",RESPONSE_PAYLOAD_TOO_LARGE:"Response payload too large",SEND_FAILED:"Failed to send",UNSUPPORTED_METHOD:"Method not supported at destination",RECIPIENT_NOT_FOUND:"Recipient not found",REQUEST_PAYLOAD_TOO_LARGE:"Request payload too large",UNSUPPORTED_SERVER:"RPC not supported by server",UNSUPPORTED_VERSION:"Unsupported RPC version"};const T$=15360;function fE(n){return new TextEncoder().encode(n).length}function lO(n,e){if(fE(n)<=e)return n;let t=0,r=n.length;const i=new TextEncoder;for(;t<r;){const a=Math.floor((t+r+1)/2);i.encode(n.slice(0,a)).length<=e?t=a:r=a-1}return n.slice(0,t)}const hE=2e3;function zb(n,e){if(!e)return 0;let t,r;return"bytesReceived"in n?(t=n.bytesReceived,r=e.bytesReceived):"bytesSent"in n&&(t=n.bytesSent,r=e.bytesSent),t===void 0||r===void 0||n.timestamp===void 0||e.timestamp===void 0?0:(t-r)*8*1e3/(n.timestamp-e.timestamp)}const pE=typeof MediaRecorder<"u";class y1e{constructor(){throw new Error("MediaRecorder is not available in this environment")}}const _1e=pE?MediaRecorder:y1e;class b1e extends _1e{constructor(e,t){if(!pE)throw new Error("MediaRecorder is not available in this environment");super(new MediaStream([e.mediaStreamTrack]),t);let r,i;const a=()=>i===void 0,s=()=>{this.removeEventListener("dataavailable",r),this.removeEventListener("stop",s),this.removeEventListener("error",o),i==null||i.close(),i=void 0},o=c=>{i==null||i.error(c),this.removeEventListener("dataavailable",r),this.removeEventListener("stop",s),this.removeEventListener("error",o),i=void 0};this.byteStream=new ReadableStream({start:c=>{i=c,r=u=>Q(this,void 0,void 0,function*(){let l;if(u.data.arrayBuffer){const d=yield u.data.arrayBuffer();l=new Uint8Array(d)}else if(u.data.byteArray)l=u.data.byteArray;else throw new Error("no data available!");a()||c.enqueue(l)}),this.addEventListener("dataavailable",r)},cancel:()=>{s()}}),this.addEventListener("stop",s),this.addEventListener("error",o)}}function x1e(){return pE}const w1e=1e3,C1e=1e4;class E$ extends Ae{get sender(){return this._sender}set sender(e){this._sender=e}get constraints(){return this._constraints}get hasPreConnectBuffer(){return!!this.localTrackRecorder}constructor(e,t,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,a=arguments.length>4?arguments[4]:void 0;super(e,t,a),this.manuallyStopped=!1,this.pendingDeviceChange=!1,this._isUpstreamPaused=!1,this.handleTrackMuteEvent=()=>this.debouncedTrackMuteHandler().catch(()=>this.log.debug("track mute bounce got cancelled by an unmute event",this.logContext)),this.debouncedTrackMuteHandler=uE(()=>Q(this,void 0,void 0,function*(){yield this.pauseUpstream()}),5e3),this.handleTrackUnmuteEvent=()=>Q(this,void 0,void 0,function*(){this.debouncedTrackMuteHandler.cancel("unmute"),yield this.resumeUpstream()}),this.handleEnded=()=>
vendor: 10,557 bytes, line 3926
3926{this.isInBackground&&(this.reacquireTrack=!0),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),this.emit(We.Ended,this)},this.reacquireTrack=!1,this.providedByUser=i,this.muteLock=new Ii,this.pauseUpstreamLock=new Ii,this.trackChangeLock=new Ii,this.trackChangeLock.lock().then(s=>Q(this,void 0,void 0,function*(){try{yield this.setMediaStreamTrack(e,!0)}finally{s()}})),this._constraints=e.getConstraints(),r&&(this._constraints=r)}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==Ae.Kind.Video)return;const{width:e,height:t}=this._mediaStreamTrack.getSettings();if(e&&t)return{width:e,height:t}}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}get mediaStreamTrack(){var e,t;return(t=(e=this.processor)===null||e===void 0?void 0:e.processedTrack)!==null&&t!==void 0?t:this._mediaStreamTrack}get isLocal(){return!0}getSourceTrackSettings(){return this._mediaStreamTrack.getSettings()}setMediaStreamTrack(e,t,r){return Q(this,void 0,void 0,function*(){var i;if(e===this._mediaStreamTrack&&!t)return;this._mediaStreamTrack&&(this.attachedElements.forEach(s=>{Yh(this._mediaStreamTrack,s)}),this.debouncedTrackMuteHandler.cancel("new-track"),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent)),this.mediaStream=new MediaStream([e]),e&&(e.addEventListener("ended",this.handleEnded),e.addEventListener("mute",this.handleTrackMuteEvent),e.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=e.getConstraints());let a;if(this.processor&&e){if(this.log.debug("restarting processor",this.logContext),this.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");this.processorElement&&(Ph(e,this.processorElement),this.processorElement.muted=!0),yield this.processor.restart({track:e,kind:this.kind,element:this.processorElement,localTrack:this}),a=this.processor.processedTrack}this.sender&&((i=this.sender.transport)===null||i===void 0?void 0:i.state)!=="closed"&&(yield this.sender.replaceTrack(a??e)),!this.providedByUser&&this._mediaStreamTrack!==e&&this._mediaStreamTrack.stop(),this._mediaStreamTrack=e,e&&(this._mediaStreamTrack.enabled=r?!0:!this.isMuted,yield this.resumeUpstream(),this.attachedElements.forEach(s=>{Ph(a??e,s)}))})}waitForDimensions(){return Q(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w1e;return function*(){var r;if(e.kind===Ae.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");((r=ba())===null||r===void 0?void 0:r.os)==="iOS"&&(yield Ji(10));const i=Date.now();for(;Date.now()-i<t;){const a=e.dimensions;if(a)return a;yield Ji(50)}throw new ju("unable to get track dimensions after timeout")}()})}setDeviceId(e){return Q(this,void 0,void 0,function*(){return this._constraints.deviceId===e&&this._mediaStreamTrack.getSettings().deviceId===af(e)?!0:(this._constraints.deviceId=e,this.isMuted?(this.pendingDeviceChange=!0,!0):(yield this.restartTrack(),af(e)===this._mediaStreamTrack.getSettings().deviceId))})}getDeviceId(){return Q(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){if(e.source===Ae.Source.ScreenShare)return;const{deviceId:r,groupId:i}=e._mediaStreamTrack.getSettings(),a=e.kind===Ae.Kind.Audio?"audioinput":"videoinput";return t?pi.getInstance().normalizeDeviceId(a,r,i):r}()})}mute(){return Q(this,void 0,void 0,function*(){return this.setTrackMuted(!0),this})}unmute(){return Q(this,void 0,void 0,function*(){return this.setTrackMuted(!1),this})}replaceTrack(e,t){return Q(this,void 0,void 0,function*(){const r=yield this.trackChangeLock.lock();try{if(!this.sender)throw new ju("unable to replace an unpublished track");let i,a;typeof t=="boolean"?i=t:t!==void 0&&(i=t.userProvidedTrack,a=t.stopProcessor),this.providedByUser=i??!0,this.log.debug("replace MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(e),a&&this.processor&&(yield this.internalStopProcessor())}finally{r()}return yield this.onSenderTrackSwapped(),this})}onSenderTrackSwapped(){return Q(this,void 0,void 0,function*(){})}restart(e,t){return Q(this,void 0,void 0,function*(){this.manuallyStopped=!1;const r=yield this.trackChangeLock.lock();try{e||(e=this._constraints);const{deviceId:i,facingMode:a}=e,s=V_e(e,["deviceId","facingMode"]);this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:e}));const o={audio:!1,video:!1};this.kind===Ae.Kind.Video?o.video=i||a?{deviceId:i,facingMode:a}:!0:o.audio=i?Object.assign({deviceId:i},s):!0,this.attachedElements.forEach(l=>{Yh(this.mediaStreamTrack,l)}),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const u=(yield navigator.mediaDevices.getUserMedia(o)).getTracks()[0];return this.kind===Ae.Kind.Video&&(yield u.applyConstraints(s)),u.addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(u,!1,t),this._constraints=e,this.pendingDeviceChange=!1,this.emit(We.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),this}finally{r()}})}setTrackMuted(e){this.log.debug("setting ".concat(this.kind," track ").concat(e?"muted":"unmuted"),this.logContext),!(this.isMuted===e&&this._mediaStreamTrack.enabled!==e)&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?We.Muted:We.Unmuted,this))}get needsReAcquisition(){return this._mediaStreamTrack.readyState!=="live"||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Q(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),_$()&&(this.log.debug("visibility changed, is in Background: ".concat(this.isInBackground),this.logContext),!this.isInBackground&&this.needsReAcquisition&&!this.isUserProvided&&!this.isMuted&&(this.log.debug("track needs to be reacquired, restarting ".concat(this.source),this.logContext),yield this.restart(),this.reacquireTrack=!1))})}stop(){var e;this.manuallyStopped=!0,super.stop(),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),(e=this.processor)===null||e===void 0||e.destroy(),this.processor=void 0}pauseUpstream(){return Q(this,void 0,void 0,function*(){var e;const t=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!0)return;if(!this.sender){this.log.warn("unable to pause upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!0,this.emit(We.UpstreamPaused,this);const r=ba();if((r==null?void 0:r.name)==="Safari"&&Zc(r.version,"12.0")<0)throw new tE("pauseUpstream is not supported on Safari < 12.");((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(null))}finally{t()}})}resumeUpstream(){return Q(this,void 0,void 0,function*(){var e;const t=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!1)return;if(!this.sender){this.log.warn("unable to resume upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!1,this.emit(We.UpstreamResumed,this),((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(this.mediaStreamTrack))}finally{t()}})}getRTCStatsReport(){return Q(this,void 0,void 0,function*(){var e;return!((e=this.sender)===null||e===void 0)&&e.getStats?yield this.sender.getStats():void 0})}setProcessor(e){return Q(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var a;const s=yield r.trackChangeLock.lock();try{r.log.debug("setting up processor",r.logContext);const o=document.createElement(r.kind),c={kind:r.kind,track:r._mediaStreamTrack,element:o,audioContext:r.audioContext,localTrack:r};if(yield t.init(c),r.log.debug("processor initialized",r.logContext),r.processor&&(yield r.internalStopProcessor()),r.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");if(Ph(r._mediaStreamTrack,o),o.muted=!0,o.play().catch(u=>{u instanceof DOMException&&u.name==="AbortError"?(r.log.warn("failed to play processor element, retrying",Object.assign(Object.assign({},r.logContext),{error:u})),setTimeout(()=>{o.play().catch(l=>{r.log.error("failed to play processor element",Object.assign(Object.assign({},r.logContext),{err:l}))})},100)):r.log.error("failed to play processor element",Object.assign(Object.assign({},r.logContext),{error:u}))}),r.processor=t,r.processorElement=o,r.processor.processedTrack){for(const u of r.attachedElements)u!==r.processorElement&&i&&(Yh(r._mediaStreamTrack,u),Ph(r.processor.processedTrack,u));yield(a=r.sender)===null||a===void 0?void 0:a.replaceTrack(r.processor.processedTrack)}r.emit(We.TrackProcessorUpdate,r.processor)}finally{s()}yield r.onSenderTrackSwapped()}()})}getProcessor(){return this.processor}stopProcessor(){return Q(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){const r=yield e.trackChangeLock.lock();try{yield e.internalStopProcessor(t)}finally{r()}yield e.onSenderTrackSwapped()}()})}internalStopProcessor(){return Q(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var r,i;e.processor&&(e.log.debug("stopping processor",e.logContext),(r=e.processor.processedTrack)===null||r===void 0||r.stop(),yield e.processor.destroy(),e.processor=void 0,t||((i=e.processorElement)===null||i===void 0||i.remove(),e.processorElement=void 0),yield e._mediaStreamTrack.applyConstraints(e._constraints),yield e.setMediaStreamTrack(e._mediaStreamTrack,!0),e.emit(We.TrackProcessorUpdate))}()})}startPreConnectBuffer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:100;if(!x1e()){this.log.warn("MediaRecorder is not available, cannot start prec
3926onnect buffer",this.logContext);return}if(this.localTrackRecorder){this.log.warn("preconnect buffer already started");return}else{let t="audio/webm;codecs=opus";MediaRecorder.isTypeSupported(t)||(t="video/mp4"),this.localTrackRecorder=new b1e(this,{mimeType:t})}this.localTrackRecorder.start(e),this.autoStopPreConnectBuffer=setTimeout(()=>{this.log.warn("preconnect buffer timed out, stopping recording automatically",this.logContext),this.stopPreConnectBuffer()},C1e)}stopPreConnectBuffer(){clearTimeout(this.autoStopPreConnectBuffer),this.localTrackRecorder&&(this.localTrackRecorder.stop(),this.localTrackRecorder=void 0)}getPreConnectBuffer(){var e;return(e=this.localTrackRecorder)===null||e===void 0?void 0:e.byteStream}getPreConnectBufferMimeType(){var e;return(e=this.localTrackRecorder)===null||e===void 0?void 0:e.mimeType}}class D_ extends E${get enhancedNoiseCancellation(){return this.isKrispNoiseFilterEnabled}constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;super(e,Ae.Kind.Audio,t,r,a),this.stopOnMute=!1,this.isKrispNoiseFilterEnabled=!1,this.monitorSender=()=>Q(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let s;try{s=yield this.getSenderStats()}catch(o){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:o}));return}s&&this.prevStats&&(this._currentBitrate=zb(s,this.prevStats)),this.prevStats=s}),this.handleKrispNoiseFilterEnable=()=>{this.isKrispNoiseFilterEnabled=!0,this.log.debug("Krisp noise filter enabled",this.logContext),this.emit(We.AudioTrackFeatureUpdate,this,hi.TF_ENHANCED_NOISE_CANCELLATION,!0)},this.handleKrispNoiseFilterDisable=()=>{this.isKrispNoiseFilterEnabled=!1,this.log.debug("Krisp noise filter disabled",this.logContext),this.emit(We.AudioTrackFeatureUpdate,this,hi.TF_ENHANCED_NOISE_CANCELLATION,!1)},this.audioContext=i,this.checkForSilence()}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return Q(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===Ae.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{t()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return Q(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.source===Ae.Source.Microphone&&(this.stopOnMute||this._mediaStreamTrack.readyState==="ended"||this.pendingDeviceChange)&&!this.isUserProvided&&(this.log.debug("reacquiring mic track",this.logContext),yield this.restart(void 0,!0)),yield e.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{t()}})}restartTrack(e){return Q(this,void 0,void 0,function*(){let t;if(e){const r=rE({audio:e});typeof r.audio!="boolean"&&(t=r.audio)}yield this.restart(t)})}restart(e,t){const r=Object.create(null,{restart:{get:()=>super.restart}});return Q(this,void 0,void 0,function*(){const i=yield r.restart.call(this,e,t);return this.checkForSilence(),i})}startMonitor(){Fa()&&(this.monitorInterval||(this.monitorInterval=setInterval(()=>{this.monitorSender()},hE)))}setProcessor(e){return Q(this,void 0,void 0,function*(){var t;const r=yield this.trackChangeLock.lock();try{if(!Qc()&&!this.audioContext)throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");this.processor&&(yield this.internalStopProcessor());const i={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext,localTrack:this};this.log.debug("setting up audio processor ".concat(e.name),this.logContext),yield e.init(i),this.processor=e,this.processor.processedTrack&&(yield(t=this.sender)===null||t===void 0?void 0:t.replaceTrack(this.processor.processedTrack),this.processor.processedTrack.addEventListener("enable-lk-krisp-noise-filter",this.handleKrispNoiseFilterEnable),this.processor.processedTrack.addEventListener("disable-lk-krisp-noise-filter",this.handleKrispNoiseFilterDisable)),this.emit
vendor: 11,107 bytes, line 3926
3926(We.TrackProcessorUpdate,this.processor)}finally{r()}})}setAudioContext(e){this.audioContext=e}getSenderStats(){return Q(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return;const t=yield this.sender.getStats();let r;return t.forEach(i=>{i.type==="outbound-rtp"&&(r={type:"audio",streamId:i.id,packetsSent:i.packetsSent,packetsLost:i.packetsLost,bytesSent:i.bytesSent,timestamp:i.timestamp,roundTripTime:i.roundTripTime,jitter:i.jitter})}),r})}checkForSilence(){return Q(this,void 0,void 0,function*(){const e=yield g$(this);return e&&(this.isMuted||this.log.debug("silence detected on local audio track",this.logContext),this.emit(We.AudioSilenceDetected)),e})}}function k1e(n,e,t){switch(n.kind){case"audio":return new D_(n,e,!1,void 0,t);case"video":return new L_(n,e,!1,t);default:throw new ju("unsupported track type: ".concat(n.kind))}}const S1e=Object.values(Lg),T1e=Object.values(jk),E1e=Object.values(nE),P1e=[Lg.h180,Lg.h360],R1e=[jk.h180,jk.h360],A1e=n=>[{scaleResolutionDownBy:2,fps:n.encoding.maxFramerate}].map(t=>{var r,i;return new An(Math.floor(n.width/t.scaleResolutionDownBy),Math.floor(n.height/t.scaleResolutionDownBy),Math.max(15e4,Math.floor(n.encoding.maxBitrate/(Math.pow(t.scaleResolutionDownBy,2)*(((r=n.encoding.maxFramerate)!==null&&r!==void 0?r:30)/((i=t.fps)!==null&&i!==void 0?i:30))))),t.fps,n.encoding.priority)}),Jk=["q","h","f"];function N_(n,e,t,r){var i,a;let s=r==null?void 0:r.videoEncoding;n&&(s=r==null?void 0:r.screenShareEncoding);const o=r==null?void 0:r.simulcast,c=r==null?void 0:r.scalabilityMode,u=r==null?void 0:r.videoCodec;if(!s&&!o&&!c||!e||!t)return[{}];s||(s=I1e(n,e,t,u),qt.debug("using video encoding",s));const l=s.maxFramerate,d=new An(e,t,s.maxBitrate,s.maxFramerate,s.priority);if(c&&Go(u)){const g=new R$(c),v=[];if(g.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(c));const y=ba();if(Fg()||Qc()||(y==null?void 0:y.name)==="Chrome"&&Zc(y==null?void 0:y.version,"113")<0){const b=g.suffix=="h"?2:3,x=Pbe(y);for(let S=0;S<g.spatial;S+=1)v.push({rid:Jk[2-S],maxBitrate:s.maxBitrate/Math.pow(b,S),maxFramerate:d.encoding.maxFramerate,scaleResolutionDownBy:x?Math.pow(2,S):void 0});v[0].scalabilityMode=c}else v.push({maxBitrate:s.maxBitrate,maxFramerate:d.encoding.maxFramerate,scalabilityMode:c});return d.encoding.priority&&(v[0].priority=d.encoding.priority,v[0].networkPriority=d.encoding.priority),qt.debug("using svc encoding",{encodings:v}),v}if(!o)return[s];let h=[];n?h=(i=fO(r==null?void 0:r.screenShareSimulcastLayers))!==null&&i!==void 0?i:dO(n,d):h=(a=fO(r==null?void 0:r.videoSimulcastLayers))!==null&&a!==void 0?a:dO(n,d);let p;if(h.length>0){const g=h[0];h.length>1&&([,p]=h);const v=Math.max(e,t);if(v>=960&&p)return tC(e,t,[g,p,d],l);if(v>=480)return tC(e,t,[g,d],l)}return tC(e,t,[d])}function P$(n,e,t){var r,i,a,s;if(!t.backupCodec||t.backupCodec===!0||t.backupCodec.codec===t.videoCodec)return;e!==t.backupCodec.codec&&qt.warn("requested a different codec than specified as backup",{serverRequested:e,backup:t.backupCodec.codec}),t.videoCodec=e,t.videoEncoding=t.backupCodec.encoding;const o=n.mediaStreamTrack.getSettings(),c=(r=o.width)!==null&&r!==void 0?r:(i=n.dimensions)===null||i===void 0?void 0:i.width,u=(a=o.height)!==null&&a!==void 0?a:(s=n.dimensions)===null||s===void 0?void 0:s.height;return n.source===Ae.Source.ScreenShare&&t.simulcast&&(t.simulcast=!1),N_(n.source===Ae.Source.ScreenShare,c,u,t)}function I1e(n,e,t,r){const i=O1e(n,e,t);let{encoding:a}=i[0];const s=Math.max(e,t);for(let o=0;o<i.length;o+=1){const c=i[o];if(a=c.encoding,c.width>=s)break}if(r)switch(r){case"av1":case"h265":a=Object.assign({},a),a.maxBitrate=a.maxBitrate*.7;break;case"vp9":a=Object.assign({},a),a.maxBitrate=a.maxBitrate*.85;break}return a}function O1e(n,e,t){if(n)return E1e;const r=e>t?e/t:t/e;return Math.abs(r-16/9)<Math.abs(r-4/3)?S1e:T1e}function dO(n,e){if(n)return A1e(e);const{width:t,height:r}=e,i=t>r?t/r:r/t;return Math.abs(i-16/9)<Math.abs(i-4/3)?P1e:R1e}function tC(n,e,t,r){const i=[];if(t.forEach((a,s)=>{if(s>=Jk.length)return;const o=Math.min(n,e),u={rid:Jk[s],scaleResolutionDownBy:Math.max(1,o/Math.min(a.width,a.height)),maxBitrate:a.encoding.maxBitrate},l=r&&a.encoding.maxFramerate?Math.min(r,a.encoding.maxFramerate):a.encoding.maxFramerate;l&&(u.maxFramerate=l);const d=ba(),h=(d==null?void 0:d.name)==="Firefox"&&d.os!=="iOS"||s===0;a.encoding.priority&&h&&(u.priority=a.encoding.priority,u.networkPriority=a.encoding.priority),i.push(u)}),Qc()&&x$()==="ios"){let a;i.forEach(o=>{a?o.maxFramerate&&o.maxFramerate>a&&(a=o.maxFramerate):a=o.maxFramerate});let s=!0;i.forEach(o=>{var c;o.maxFramerate!=a&&(s&&(s=!1,qt.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),qt.info('Setting framerate of encoding "'.concat((c=o.rid)!==null&&c!==void 0?c:"",'" to ').concat(a)),o.maxFramerate=a)})}return i}function fO(n){if(n)return n.sort((e,t)=>{const{encoding:r}=e,{encoding:i}=t;return r.maxBitrate>i.maxBitrate?1:r.maxBitrate<i.maxBitrate?-1:r.maxBitrate===i.maxBitrate&&r.maxFramerate&&i.maxFramerate?r.maxFramerate>i.maxFramerate?1:-1:0})}class R${constructor(e){const t=e.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!t)throw new Error("invalid scalability mode");if(this.spatial=parseInt(t[1]),this.temporal=parseInt(t[2]),t.length>3)switch(t[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=t[3]}}toString(){var e;return"L".concat(this.spatial,"T").concat(this.temporal).concat((e=this.suffix)!==null&&e!==void 0?e:"")}}function M1e(n){return n.source===Ae.Source.ScreenShare||n.constraints.height&&af(n.constraints.height)>=1080?"maintain-resolution":"balanced"}const D1e=5e3;class L_ extends E${get sender(){return this._sender}set sender(e){this._sender=e,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0;super(e,Ae.Kind.Video,t,r,i),this.simulcastCodecs=new Map,this.degradationPreference="balanced",this.isCpuConstrained=!1,this.optimizeForPerformance=!1,this.monitorSender=()=>Q(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let a;try{a=yield this.getSenderStats()}catch(c){this.log.error("could not get video sender stats",Object.assign(Object.assign({},this.logContext),{error:c}));return}const s=new Map(a.map(c=>[c.rid,c])),o=a.some(c=>c.qualityLimitationReason==="cpu");if(o!==this.isCpuConstrained&&(this.isCpuConstrained=o,this.isCpuConstrained&&this.emit(We.CpuConstrained)),this.prevStats){let c=0;s.forEach((u,l)=>{var d;const h=(d=this.prevStats)===null||d===void 0?void 0:d.get(l);c+=zb(u,h)}),this._currentBitrate=c}this.prevStats=s}),this.senderLock=new Ii}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(e){var t;if(this.signalClient=e,!Fa())return;const r=(t=this.sender)===null||t===void 0?void 0:t.getParameters();r&&(this.encodings=r.encodings),!this.monitorInterval&&(this.monitorInterval=setInterval(()=>{this.monitorSender()},hE))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach(e=>{e.mediaStreamTrack.stop()}),super.stop()}pauseUpstream(){const e=Object.create(null,{pauseUpstream:{get:()=>super.pauseUpstream}});return Q(this,void 0,void 0,function*(){var t,r,i,a,s;yield e.pauseUpstream.call(this);try{for(var o=!0,c=Vo(this.simulcastCodecs.values()),u;u=yield c.next(),t=u.done,!t;o=!0)a=u.value,o=!1,yield(s=a.sender)===null||s===void 0?void 0:s.replaceTrack(null)}catch(l){r={error:l}}finally{try{!o&&!t&&(i=c.return)&&(yield i.call(c))}finally{if(r)throw r.error}}})}resumeUpstream(){const e=Object.create(null,{resumeUpstream:{get:()=>super.resumeUpstream}});return Q(this,void 0,void 0,function*(){var t,r,i,a,s;yield e.resumeUpstream.call(this);try{for(var o=!0,c=Vo(this.simulcastCodecs.values()),u;u=yield c.next(),t=u.done,!t;o=!0){a=u.value,o=!1;const l=a;yield(s=l.sender)===null||s===void 0?void 0:s.replaceTrack(l.mediaStreamTrack)}}catch(l){r={error:l}}finally{try{!o&&!t&&(i=c.return)&&(yield i.call(c))}finally{if(r)throw r.error}}})}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return Q(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===Ae.Source.Camera&&!this.isUserProvided&&(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{t()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return Q(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.source===Ae.Source.Camera&&!this.isUserProvided&&(this.log.debug("reacquiring camera track",this.logContext),yield this.restart(void 0,!0)),yield e.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{t()}})}setTrackMuted(e){super.setTrackMuted(e);for(const t of this.simulcastCodecs.values())t.mediaStreamTrack.enabled=!e}getSenderStats(){return Q(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return[];const t=[],r=yield this.sender.getStats();return r.forEach(i=>{var a;if(i.type==="outbound-rtp"){const s={type:"video",streamId:i.id,frameHeight:i.frameHeight,frameWidth:i.frameWidth,framesPerSecond:i.framesPerSecond,framesSent:i.framesSent,firCount:i.firCount,pliCount:i.pliCount,nackCount:i.nackCount,packetsSent:i.packetsSent,bytesSent:i.bytesSent,qualityLimitationReason:i.qualityLimitationReason,qualityLimitationDurations:i.qualityLimitationDurations,qualityLimitationResolutionChanges:i.qualityLimitationResolutionChanges,rid:(a=i.rid)!==null&&a!==void 0?a:i.id,retransmittedPacketsSent:i.retransmittedPacketsSent,targetBitrate:i.targetBitrate,timestamp:i.timestamp},o=r.get(i.remoteId);o&&(s.jitter=o.jitter,s.packetsLost=o.packetsLost,s.roundTripTime=o.roundTripTime),t.push(s)}}),t.sort((i,a)=>{var s,o;return((s=a.frameWidth)!==null&&s!==void 0?s:0)-((o=i.frameWidth)!==null&&o!==void 0?o:0)}),t})}setPublishingQuality(e){const t=[];for(let r=bs.LOW;r<=bs.HIGH;r+=1)t.push(new JT({quality:r,enabled:r<=e}));this.log.debug("setting publishing quality. max quality ".concat(e),this.logContext),this.setPublishingLayers(Go(this.codec),t)}restartTrack(e){return Q(this,void 0,void 0,function*(){var t,r,i,a,s;let o;if(e){const d=rE({video:e});typeof d.video!="boolean"&&(o=d.video)}yield this.restart(o),this.isCpuConstrained=!1;try{for(var c=!0,u=Vo(this.simulcastCodecs.values()),l;l=yield u.next(),t=l.done,!t;c=!0){a=l.value,c=!1;const d=a;d.sender&&((s=d.sender.transport)===null||s===void 0?void 0:s.state)!=="closed"&&(d.mediaStreamTrack=this.mediaStreamTrack.clone(),yield d.sender.replaceTrack(d.mediaStreamTrack))}}catch(d){r={error:d}}finally{try{!c&&!t&&(i=u.return)&&(yield i.call(u))}finally{if(r)throw r.error}}yield this.onSenderTrackSwapped()})}onSenderTrackSwapped(){return Q(this,void 0,void 0,function*(){yield this.refreshSen
3926derEncodings()})}refreshSenderEncodings(){return Q(this,void 0,void 0,function*(){var e;if(!this.sender||!this.publishOptions||this.optimizeForPerformance)return;const t=yield this.senderLock.lock();try{let r;try{r=yield this.waitForDimensions()}catch(s){this.log.warn("could not determine new track dimensions, skipping encoding recompute",Object.assign(Object.assign({},this.logContext),{error:s}));return}if(this.lastEncodedDimensions&&this.lastEncodedDimensions.width===r.width&&this.lastEncodedDimensions.height===r.height)return;const i=this.source===Ae.Source.ScreenShare,a=N_(i,r.width,r.height,Object.assign({},this.publishOptions));yield this.applyEncodingsToSender(this.sender,a),this.encodings=a,this.lastEncodedDimensions=r;for(const[s,o]of this.simulcastCodecs){if(!o.sender||((e=o.sender.transport)===null||e===void 0?void 0:e.state)==="closed"||!p$(s))continue;const c=Object.assign({},this.publishOptions),u=P$(this,s,c);u&&(yield this.applyEncodingsToSender(o.sender,u),o.encodings=u)}}catch(r){this.log.warn("failed to apply recomputed encodings",Object.assign(Object.assign({},this.logContext),{error:r}))}finally{t()}})}applyEncodingsToSender(e,t){return Q(this,void 0,void 0,function*(){const r=e.getParameters();!r.encodings||r.encodings.length!==t.length||(r.encodings.forEac
3926h((i,a)=>{if(i.active===!1)return;const s=t[a];s.scaleResolutionDownBy!==void 0&&(i.scaleResolutionDownBy=s.scaleResolutionDownBy),s.maxBitrate!==void 0&&(i.maxBitrate=s.maxBitrate),s.maxFramerate!==void 0&&(i.maxFramerate=s.maxFramerate),s.priority!==void 0&&(i.priority=s.priority,i.networkPriority=s.priority)}),this.log.debug("updating sender encodings after track restart",Object.assign(Object.assign({},this.logContext),{encodings:r.encodings})),yield e.setParameters(r))})}setProcessor(e){const t=Object.create(null,{setProcessor:{get:()=>super.setProcessor}});return Q(this,arguments,void 0,function(r){var i=this;let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var s,o,c,u,l,d;if(yield t.setProcessor.call(i,r,a),!((l=i.processor)===null||l===void 0)&&l.processedTrack)try{for(var h=!0,p=Vo(i.simulcastCodecs.values()),g;g=yield p.next(),s=g.done,!s;h=!0)u=g.value,h=!1,yield(d=u.sender)===null||d===void 0?void 0:d.replaceTrack(i.processor.processedTrack)}catch(v){o={error:v}}finally{try{!h&&!s&&(c=p.return)&&(yield c.call(p))}finally{if(o)throw o.error}}}()})}setDegradationPreference(e){return Q(this,void 0,void 0,function*(){if(this.degradationPreference=e,this.sender)try{this.log.debug("setting degradationPreference to ".concat(e),this.logContext);const t=this.sender.getParameters();t.degradationPreference=e,this.sender.setParameters(t)}catch(t){this.log.warn("failed to set degradationPreference",Object.assign({error:t},this.logContext))}})}addSimulcastTrack(e,t){if(this.simulcastCodecs.has(e)){this.log.error("".concat(e," already added, skipping adding simulcast codec"),this.logContext);return}const r={codec:e,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:t};return this.simulcastCodecs.set(e,r),r}setSimulcastTrackSender(e,t){const r=this.simulcastCodecs.get(e);r&&(r.sender=t,setTimeout(()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)},D1e))}setPublishingCodecs(e){return Q(this,void 0,void 0,function*(){var t,r,i,a,s,o,c;if(this.log.debug("setting publishing codecs",Object.assign(Object.assign({},this.logContext),{codecs:e,currentCodec:this.codec})),!this.codec&&e.length>0)return yield this.setPublishingLayers(Go(e[0].codec),e[0].qualities),[];this.subscribedCodecs=e;const u=[];try{for(t=!0,r=Vo(e);i=yield r.next(),a=i.done,!a;t=!0){c=i.value,t=!1;const l=c;if(!this.codec||this.codec===l.codec)yield this.setPublishingLayers(Go(l.codec),l.qualities);else{const d=this.simulcastCodecs.get(l.codec);if(this.log.debug("try setPublishingCodec for ".concat(l.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:d})),!d||!d.sender){for(const h of l.qualities)if(h.enabled){u.push(l.codec);break}}else d.encodings&&(this.log.debug("try setPublishingLayersForSender ".concat(l.codec),this.logContext),yield hO(d.sender,d.encodings,l.qualities,this.senderLock,Go(l.codec),this.log,this.logContext))}}}catch(l){s={error:l}}finally{try{!t&&!a&&(o=r.return)&&(yield o.call(r))}finally{if(s)throw s.error}}return u})}setPublishingLayers(e,t){return Q(this,void 0,void 0,function*(){if(this.optimizeForPerformance){this.log.info("skipping setPublishingLayers due to optimized publishing performance",Object.assign(Object.assign({},this.logContext),{qualities:t}));return}this.log.debug("setting publishing layers",Object.assign(Object.assign({},this.logContext),{qualities:t})),!(!this.sender||!this.encodings)&&(yield hO(this.sender,this.encodings,t,this.senderLock,e,this.log,this.logContext))})}prioritizePerformance(){return Q(this,void 0,void 0,function*(){if(!this.sender)throw new Error("sender not found");const e=yield this.senderLock.lock();try{this.optimizeForPerformance=!0;const t=this.sender.getParameters();t.encodings=t.encodings.map((r,i)=>{var a;return Object.assign(Object.assign({},r),{active:i===0,scaleResolutionDownBy:Math.max(1,Math.ceil(((a=this.mediaStreamTrack.getSettings().height)!==null&&a!==void 0?a:360)/360)),scalabilityMode:i===0&&Go(this.codec)?"L1T3":void 0,maxFramerate:i===0?15:0,maxBitrate:i===0?r.maxBitrate:0})}),this.log.debug("setting performance optimised encodings",Object.assign(Object.assign({},this.logContext),{encodings:t.encodings})),this.encodings=t.encodings,yield this.sender.setParameters(t)}catch(t){this.log.error("failed to set performance optimised encodings",Object.assign(Object.assign({},this.logContext),{error:t})),this.optimizeForPerformance=!1}finally{e()}})}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Q(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),_$()&&this.isInBackgroun
3926d&&this.source===Ae.Source.Camera&&(this._mediaStreamTrack.enabled=!1)})}}function hO(n,e,t,r,i,a,s){return Q(this,void 0,void 0,function*(){const o=yield r.lock();a.debug("setPublishingLayersForSender",Object.assign(Object.assign({},s),{sender:n,qualities:t,senderEncodings:e}));try{const c=n.getParameters(),{encodings:u}=c;if(!u)return;if(u.length!==e.length){a.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},s),{encodings:u,senderEncodings:e}));return}let l=!1;!1&&u[0].scalabilityMode||(i&&t.some(p=>p.enabled)&&t.forEach(p=>p.enabled=!0),u.forEach((h,p)=>{var g;let v=(g=h.rid)!==null&&g!==void 0?g:"";v===""&&(v="q");const y=A$(v),b=t.find(x=>x.quality===y);b&&h.active!==b.enabled&&(l=!0,h.active=b.enabled,a.debug("setting layer ".concat(b.quality," to ").concat(h.active?"enabled":"disabled"),s),hp()&&(b.enabled?(h.scaleResolutionDownBy=e[p].scaleResolutionDownBy,h.maxBitrate=e[p].maxBitrate,h.maxFrameRate=e[p].maxFrameRate):(h.scaleResolutionDownBy=4,h.maxBitrate=10,h.maxFrameRate=2)))})),l&&(c.encodings=u,a.debug("setting encodings",Object.assign(Object.assign({},s),{encodings:c.encodings})),yield n.setParameters(c))}finally{o()}})}function A$(n){switch(n){case"f":return bs.HIGH;case"h":return bs.MEDIUM;case"q":return bs.LOW;default:return bs.HIGH}}function pO(n,e,t,r){if(!t)return[new ql({quality:bs.HIGH,width:n,height:e,bitrate:0,ssrc:0})];if(r){const i=t[0].scalabilityMode,a=new R$(i),s=[],o=a.suffix=="h"?1.5:2,c=a.suffix=="h"?2:3;for(let u=0;u<a.spatial;u+=1)s.push(new ql({quality:Math.min(bs.HIGH,a.spatial-1)-u,width:Math.ceil(n/Math.pow(o,u)),height:Math.ceil(e/Math.pow(o,u)),bitrate:t[0].maxBitrate?Math.ceil(t[0].maxBitrate/Math.pow(c,u)):0,ssrc:0}));return s}return t.map(i=>{var a,s,o;const c=(a=i.scaleResolutionDownBy)!==null&&a!==void 0?a:1;let u=A$((s=i.rid)!==null&&s!==void 0?s:"");return new ql({quality:u,width:Math.ceil(n/c),height:Math.ceil(e/c),bitrate:(o=i.maxBitrate)!==null&&o!==void 0?o:0,ssrc:0})})}const mO="_lossy",gO="_reliable",vO="_data_track",N1e=2*1e3,nC="leave-reconnect",L1e=3e4,F1e=8*1024,$1e=256*1024,B1e=3,U1e=3;var to;(function(n){n[n.New=0]="New",n[n.Connected=1]="Connected",n[n.Disconnected=2]="Disconnected",n[n.Reconnecting=3]="Reconnecting",n[n.Closed=4]="Closed"})(to||(to={}));var Vt;(function(n){n[n.RELIABLE=0]="RELIABLE",n[n.LOSSY=1]="LOSSY",n[n.DATA_TRACK_LOSSY=2]="DATA_TRACK_LOSSY"})(Vt||(Vt={}));class j1e extends xo.EventEmitter{get isClosed(){return this._isClosed}get isNewlyCreated(){return this._isNewlyCreated}get pendingReconnect(){return!!this.reconnectTimeout}constructor(e){var t;super(),this.options=e,this.rtcConfig={},this.peerConnectionTimeout=dE.peerConnectionTimeout,this.fullReconnectOnNext=!1,this.latestRemoteOfferId=0,this.subscriberPrimary=!1,this.pcState=to.New,this._isClosed=!0,this._isNewlyCreated=!0,this.pendingTrackResolvers={},this.reconnectAttempts=0,this.reconnectStart=0,this.attemptingReconnect=!1,this.joinAttempts=0,this.maxJoinAttempts=1,this.shouldFailNext=!1,this.shouldFailOnV1Path=!1,this.log=qt,this.reliableDataSequence=1,this.reliableMessageBuffer=new nO,this.reliableReceivedState=new u1e(L1e),this.lossyDataStatCurrentBytes=0,this.lossyDataStatByterate=0,this.lossyDataDropCount=0,this.midToTrackId={},this.isWaitingForNetworkReconnect=!1,this.bufferStatusLowClosingFuture=new Ai,this.handleDataChannel=r=>Q(this,[r],void 0,function(i){var a=this;let{channel:s}=i;return function*(){if(!s)return;let o;if(s.label===gO)a.reliableDCSub=s,o=a.handleDataMessage;else if(s.label===mO)a.lossyDCSub=s,o=a.handleDataMessage;else if(s.label===vO)a.dataTrackDCSub=s,o=a.handleDataTrackMessage;else return;a.log.debug("on data channel ".concat(s.id,", ").concat(s.label)),s.onmessage=o}()}),this.handleDataMessage=r=>Q(this,void 0,void 0,function*(){var i,a,s,o,c;const u=yield this.dataProcessLock.lock();try{let l;if(r.data instanceof ArrayBuffer)l=r.data;else if(r.data instanceof Blob)l=yield r.data.arrayBuffer();else{this.log.error("unsupported data type",{data:r.data});return}const d=ga.fromBinary(new Uint8Array(l));if(d.sequence>0&&d.participantSid!==""){const h=this.reliableReceivedState.get(d.participantSid);if(h&&d.sequence<=h)return;this.reliableReceivedState.set(d.participantSid,d.sequence)}if(((i=d.value)===null||i===void 0?void 0:i.case)==="speaker")this.emit
3926(Ue.ActiveSpeakersUpdate,d.value.value.speakers);else if(((a=d.value)===null||a===void 0?void 0:a.case)==="encryptedPacket"){if(!this.e2eeManager){this.log.error("Received encrypted packet but E2EE not set up");return}const h=yield(s=this.e2eeManager)===null||s===void 0?void 0:s.handleEncryptedData(d.value.value.encryptedValue,d.value.value.iv,d.participantIdentity,d.value.value.keyIndex),p=l6.fromBinary(h.payload),g=new ga({value:p.value,participantIdentity:d.participantIdentity,participantSid:d.participantSid});((o=g.value)===null||o===void 0?void 0:o.case)==="user"&&yO(g,g.value.value),this.emit(Ue.DataPacketReceived,g,d.value.value.encryptionType)}else((c=d.value)===null||c===void 0?void 0:c.case)==="user"&&yO(d,d.value.value),this.emit(Ue.DataPacketReceived,d,Bn.NONE)}finally{u()}}),this.handleDataTrackMessage=r=>Q(this,void 0,void 0,function*(){let i;if(r.data instanceof ArrayBuffer)i=r.data;else if(r.data instanceof Blob)i=yield r.data.arrayBuffer();else{this.log.error("unsupported data type",{data:r.data});return}this.emit("dataTrackPacketReceived",new Uint8Array(i))}),this.handleDataError=r=>{const a=r.currentTarget.maxRetransmits===0?"lossy":"reliable";if(r instanceof ErrorEvent&&r.error){const{error:s}=r.error;this.log.error("DataChannel error on ".concat(a,": ").concat(r.message),{error:s})}else this.log.error("Unknown DataChannel error on ".concat(a),{event:r})},this.handleBufferedAmountLow=r=>{this.updateAndEmitDCBufferStatus(r)},this.handleDisconnect=(r,i)=>{if(this._isClosed)return;this.log.warn("".concat(r," disconnected")),this.reconnectAttempts===0&&(this.reconnectStart=Date.now());const a=c=>{this.log.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(c,"ms. giving up")),this.emit(Ue.Disconnected),this.close()},s=Date.now()-this.reconnectStart;let o=this.getNextRetryDelay({elapsedMs:s,retryCount:this.reconnectAttempts});if(o===null){a(s);return}r===nC&&(o=0),this.log.debug("reconnecting in ".concat(o,"ms")),this.clearReconnectTimeout(),this.token&&this.emit(Ue.TokenRefreshed,this.token),this.reconnectTimeout=Vr.setTimeout(()=>this.attemptReconnect(i).finally(()=>this.reconnectTimeout=void 0),o)},this.waitForRestarted=()=>new Promise((r,i)=>{this.pcState===to.Connected&&r();const a=()=>{this.off(Ue.Disconnected,s),r()},s=()=>{this.off(Ue.Restarted,a),i()};this.once(Ue.Restarted,a),this.once(Ue.Disconnected,s)}),this.updateAndEmitDCBufferStatus=r=>{if(r===Vt.RELIABLE){const a=this.dataChannelForKind(r);a&&this.reliableMessageBuffer.alignBufferedAmount(a.bufferedAmount)}const i=this.isBufferStatusLow(r);typeof i<"u"&&i!==this.dcBufferStatus.get(r)&&(this.dcBufferStatus.set(r,i),this.emit(Ue.DCBufferStatusChanged,i,r))},this.isBufferStatusLow=r=>{const i=this.dataChannelForKind(r);if(i)return i.bufferedAmount<=i.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>Q(this,void 0,void 0,function*(){!this.url||!(yield fetch($g(this.url),{method:"HEAD"}).then(i=>i.ok).catch(()=>!1))||(this.log.info("detected network reconnected"),(this.client.currentState===Nn.RECONNECTING||this.isWaitingForNetworkReconnect&&this.client.currentState===Nn.CONNECTED)&&(this.clearReconnectTimeout(),this.attemptReconnect(Dd.RR_SIGNAL_DISCONNECTED),this.isWaitingForNetworkReconnect=!1))}),this.handleBrowserOffline=()=>Q(this,void 0,void 0,function*(){if(this.url)try{yield Promise.race([fetch($g(this.url),{method:"HEAD"}),Ji(4e3).then(()=>Promise.reject())])}catch{window.navigator.onLine===!1&&(this.log.info("detected network interruption"),this.isWaitingForNetworkReconnect=!0)}}),this.log=Ha((t=e.loggerName)!==null&&t!==void 0?t:yi.Engine,()=>this.logContext),this.loggerOptions={loggerName:e.loggerName,loggerContextCb:()=>this.logContext},this.client=new oE(void 0,this.loggerOptions),this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.closingLock=new Ii,this.dataProcessLock=new Ii,this.dcBufferStatus=new Map([[Vt.RELIABLE,!0],[Vt.LOSSY,!0],[Vt.DATA_TRACK_LOSSY,!0]]),this.client.onParticipantUpdate=r=>this.emit(Ue.ParticipantUpdate,r),this.client.onConnectionQuality=r=>
3926this.emit(Ue.ConnectionQualityUpdate,r),this.client.onRoomUpdate=r=>this.emit(Ue.RoomUpdate,r),this.client.onSubscriptionError=r=>this.emit(Ue.SubscriptionError,r),this.client.onSubscriptionPermissionUpdate=r=>this.emit(Ue.SubscriptionPermissionUpdate,r),this.client.onSpeakersChanged=r=>this.emit(Ue.SpeakersChanged,r),this.client.onStreamStateUpdate=r=>this.emit(Ue.StreamStateChanged,r),this.client.onRequestResponse=r=>this.emit(Ue.SignalRequestResponse,r),this.client.onParticipantUpdate=r=>this.emit(Ue.ParticipantUpdate,r),this.client.onJoined=r=>this.emit(Ue.Joined,r),this.on(Ue.Closing,()=>{var r,i;(i=(r=this.bufferStatusLowClosingFuture).reject)===null||i===void 0||i.call(r,new dr("engine closed"))}),this.bufferStatusLowClosingFuture.promise.catch(()=>{})}get logContext(){var e,t,r,i,a,s;return{room:(t=(e=this.latestJoinResponse)===null||e===void 0?void 0:e.room)===null||t===void 0?void 0:t.name,roomID:(i=(r=this.latestJoinResponse)===null||r===void 0?void 0:r.room)===null||i===void 0?void 0:i.sid,participant:(s=(a=this.latestJoinResponse)===null||a===void 0?void 0:a.participant)===null||s===void 0?void 0:s.identity,participantID:this.participantSid}}join(e,t,r,i){return Q(this,arguments,void 0,function(a,s,o,c){var u=this;let l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;return function*(){var d,h,p;u._isNewlyCreated=!1,u.url=a,u.token=s,u.signalOpts=o,u.maxJoinAttempts=o.maxRetries;try{u.joinAttempts+=1,u.setupSignalClientCallbacks();let g;if(!l&&Kk()){u.pcManager||(yield u.configure(),u.createDataChannels(),u.addMediaSections(B1e,U1e));const b=yield(d=u.pcManager)===null||d===void 0?void 0:d.publisher.createInitialOffer();b&&(g=qd(b.offer,b.offerId))}if(c!=null&&c.aborted)throw pt.cancelled("Connection aborted");if(!l&&u.shouldFailOnV1Path)throw u.shouldFailOnV1Path=!1,pt.serviceNotFound("Simulated v1 path failure","v0-rtc");const v=yield u.client.join(a,s,o,c,l,g);u._isClosed=!1,u.latestJoinResponse=v,u.participantSid=(h=v.participant)===null||h===void 0?void 0:h.sid,u.subscriberPrimary=v.subscriberPrimary,!l&&Kk()?(p=u.pcManager)===null||p===void 0||p.updateConfiguration(u.makeRTCConfiguration(v)):(u.pcManager||(yield u.configure(v,!l)),(!u.subscriberPrimary||v.fastPublish)&&u.negotiate().catch(b=>{u.log.error(b)})),u.registerOnLineListener(),u.clientConfiguration=v.clientConfiguration,u.emit(Ue.SignalConnected,v);let y=v.serverInfo;return y||(y={version:v.serverVersion,region:v.serverRegion}),u.log.info("connected to Livekit Server ".concat(Object.entries(y).map(b=>{let[x,S]=b;return"".concat(x,": ").concat(S)}).join(", "))),{joinResponse:v,serverInfo:y}}catch(g){if(g instanceof pt){if(g.reason===Fn.ServerUnreachable){if(u.log.warn("Couldn't connect to server, attempt ".concat(u.joinAttempts," of ").concat(u.maxJoinAttempts)),u.joinAttempts<u.maxJoinAttempts)return u.join(a,s,o,c,l)}else if(g.reason===Fn.ServiceNotFound)return u.log.warn("Initial connection failed: ".concat(g.message," â Retrying")),u.pcManager&&(u.pcManager.onStateChange=void 0,yield u.cleanupPeerConnections()),u.join(a,s,o,c,!0)}throw g}}()})}close(){return Q(this,void 0,void 0,function*(){const e=yield this.closingLock.lock();if(this.isClosed){e();return}try{this._isClosed=!0,this.joinAttempts=0,this.emit(Ue.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),this.cleanupLossyDataStats(),yield this.cleanupPeerConnections(),yield this.cleanupClient()}finally{e()}})}cleanupPeerConnections(){return Q(this,void 0,void 0,function*(){var e;yield(e=this.pcManager)===null||e===void 0?void 0:e.close(),this.pcManager=void 0;const t=r=>{r&&(r.close(),r.onbufferedamountlow=null,r.onclose=null,r.onclosing=null,r.onerror=null,r.onmessage=null,r.onopen=null)};t(this.lossyDC),t(this.lossyDCSub),t(this.reliableDC),t(this.reliableDCSub),t(this.dataTrackDC),t(this.dataTrackDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0,this.dataTrackDC=void 0,this.dataTrackDCSub=void 0,this.reliableMessageBuffer=new nO,this.reliableDataSequence=1,this.reliableReceivedState.clear()})}cleanupLossyDataStats(){this.lossyDataStatByterate=0,this.lossyDataStatCurrentBytes=0,this.lossyDataStatInterval&&(clearInterval(this.lossyDataStatInterval),this.lossyDataStatInterval=void 0),this.lossyDataDropCount=0}cleanupClient(){return Q(this,void 0,void 0,function*(){yield this.client.close(),this.client.resetCallbacks();for(const e of Object.keys(this.pendingTrackResolvers))this.pendingTrackResolvers[e].reject();this.pendingTrackResolvers={}})}addTrack(e){if(this.pendingTrackResolvers[e.cid])throw new ju("a track with the same ID has already been published");return new Promise((t,r)=>{const i=setTimeout(()=>{delete this.pendingTrackResolvers[e.cid],r(pt.timeout("publication of local track timed out, no response from server"))},1e4);this.pendingTrackResolvers[e.cid]={resolve:a=>{clearTimeout(i),t(a)},reject:()=>{clearTimeout(i),r(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(e)})}removeTrack(e){if(e.track&&this.pendingTrackResolvers[e.track.id]){const{reject:t}=this.pendingTrackResolvers[e.track.id];t&&t(),delete this.pendingTrackResolvers[e.track.id]}try{return this.pcManager.removeTrack(e),!0}catch(t){this.log.warn("failed to remove track",{error:t})}return!1}updateMuteStatus(e,t){this.client.sendMuteTrack(e,t)}get dataSubscriberReadyState(){var e;return(e=this.reliableDCSub)===null||e===void 0?void 0:e.readyState}getConnectedServerAddress(){return Q(this,void 0,void 0,function*(){var e;return(e=this.pcManager)===null||e===void 0?void 0:e.getConnectedAddress()})}setRegionStrategy(e){this.regionStrategy=e}configure(e,t){return Q(this,void 0,void 0,function*(){var r;if(!(this.pcManager&&this.pcManager.currentState!==hr.NEW)){if(e){this.participantSid=(r=e.participant)===null||r===void 0?void 0:r.sid;const i=this.makeRTCConfiguration(e);this.pcManager=new uO(t?"publisher-only":e.subscriberPrimary?"subscriber-primary":"publisher-primary",this.loggerOptions,i)}else{const i=this.makeRTCConfiguration();this.pcManager=new uO("publisher-only",this.loggerOptions,i)}
3926this.emit(Ue.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=(i,a)=>{this.client.sendIceCandidate(i,a)},this.pcManager.onPublisherOffer=(i,a)=>{this.client.sendOffer(i,a)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=(i,a,s)=>Q(this,void 0,void 0,function*(){if(this.log.debug("primary PC state changed ".concat(i)),["closed","disconnected","failed"].includes(a)&&(this.publisherConnectionPromise=void 0),i===hr.CONNECTED){const u=this.pcState===to.New;this.pcState=to.Connected,u&&this.emit(Ue.Connected,this.latestJoinResponse)}else i===hr.FAILED&&(this.pcState===to.Connected||this.pcState===to.Reconnecting)&&(this.pcState=to.Disconnected,this.handleDisconnect("peerconnection failed",s==="failed"?Dd.RR_SUBSCRIBER_FAILED:Dd.RR_PUBLISHER_FAILED));const o=this.client.isDisconnected||this.client.currentState===Nn.RECONNECTING,c=[hr.FAILED,hr.CLOSING,hr.CLOSED].includes(i);o&&c&&!this._isClosed&&this.emit(Ue.Offline)}),this.pcManager.onTrack=i=>{i.streams.length!==0&&this.emit(Ue.MediaTrackAdded,i.track,i.streams[0],i.receiver)}}})}setupSignalClientCallbacks(){this.client.onAnswer=(e,t,r)=>Q(this,void 0,void 0,function*(){this.pcManager&&(this.log.debug("received server answer",{RTCSdpType:e.type,sdp:e.sdp,midToTrackId:r}),this.midToTrackId=r,yield this.pcManager.setPublisherAnswer(e,t))}),this.client.onTrickle=(e,t)=>{this.pcManager&&(this.log.debug("got ICE candidate from peer",{candidate:e,target:t}),this.pcManager.addIceCandidate(e,t))},this.client.onOffer=(e,t,r)=>Q(this,void 0,void 0,function*(){if(this.latestRemoteOfferId=t,!this.pcManager)return;this.midToTrackId=r;const i=yield this.pcManager.createSubscriberAnswerFromOffer(e,t);i&&this.client.sendAnswer(i,t)}),this.client.onLocalTrackPublished=e=>{var t;if(this.log.debug("received trackPublishedResponse",{cid:e.cid,track:(t=e.track)===null||t===void 0?void 0:t.sid}),!this.pendingTrackResolvers[e.cid]){this.log.error("missing track resolver for ".concat(e.cid),{cid:e.cid});return}const{resolve:r}=this.pendingTrackResolvers[e.cid];delete this.pendingTrackResolvers[e.cid],r(e.track)},this.client.onLocalTrackUnpublished=e=>{this.emit(Ue.LocalTrackUnpublished,e)},this.client.onLocalTrackSubscribed=e=>{this.emit(Ue.LocalTrackSubscribed,e)},this.client.onTokenRefresh=e=>{this.token=e,this.emit(Ue.TokenRefreshed,e)},this.client.onRemoteMuteChanged=(e,t)=>{this.emit(Ue.RemoteMute,e,t)},this.client.onSubscribedQualityUpdate=e=>{this.emit(Ue.SubscribedQualityUpdate,e)},this.client.onRoomMoved=e=>{var t;this.participantSid=(t=e.participant)===null||t===void 0?void 0:t.sid,this.latestJoinResponse&&(this.latestJoinResponse.room=e.room),this.emit(Ue.RoomMoved,e)},this.client.onMediaSectionsRequirement=e=>{this.addMediaSections(e.numAudios,e.numVideos),this.negotiate()},this.client.onPublishDataTrackResponse=e=>{this.emit(Ue.PublishDataTrackResponse,e)},this.client.onUnPublishDataTrackResponse=e=>{this.emit(Ue.UnPublishDataTrackResponse,e)},this.client.onDataTrackSubscriberHandles=e=>{this.emit(Ue.DataTrackSubscriberHandles,e)},this.client.onClose=()=>{this.handleDisconnect("signal",Dd.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=e=>{switch(this.log.info("client leave request received (action=".concat(e==null?void 0:e.action,")"),{reason:e==null?void 0:e.reason}),e.regions&&(this.log.debug("updating regions"),this.emit(Ue.ServerRegionsReported,e.regions)),e.action){case Gh.DISCONNECT:this.emit(Ue.Disconnected,e==null?void 0:e.reason),this.close();break;case Gh.RECONNECT:this.fullReconnectOnNext=!0,this.handleDisconnect(nC);break;case Gh.RESUME:this.handleDisconnect(nC)}}}makeRTCConfiguration(e){var t;const r=Object.assign({},this.rtcConfig);if(!((t=this.signalOpts)===null||t===void 0)&&t.e2eeEnabled&&(this.log.debug("E2EE - setting up transports with insertable streams"),r.encodedInsertableStreams=!0),r.sdpSemantics="unified-plan",r.continualGatheringPolicy="gather_continually",!e)return r;if(e.iceServers&&!r.iceServers){const i=[];e.iceServers.forEach(a=>{const s={urls:a.urls};a.username&&(s.username=a.username),a.credential&&(s.credential=
3926a.credential),i.push(s)}),r.iceServers=i}return e.clientConfiguration&&e.clientConfiguration.forceRelay===Og.ENABLED&&(r.iceTransportPolicy="relay"),r}addMediaSections(e,t){var r,i;const a={direction:"recvonly"};for(let s=0;s<e;s++)(r=this.pcManager)===null||r===void 0||r.addPublisherTransceiverOfKind("audio",a);for(let s=0;s<t;s++)(i=this.pcManager)===null||i===void 0||i.addPublisherTransceiverOfKind("video",a)}createDataChannels(){this.pcManager&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.dataTrackDC&&(this.dataTrackDC.onmessage=null,this.dataTrackDC.onerror=null),this.lossyDC=this.pcManager.createPublisherDataChannel(mO,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(gO,{ordered:!0}),this.dataTrackDC=this.pcManager.createPublisherDataChannel(vO,{ordered:!1,maxRetransmits:0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.dataTrackDC.onmessage=this.handleDataTrackMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.dataTrackDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.dataTrackDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=()=>this.handleBufferedAmountLow(Vt.LOSSY),this.reliableDC.onbufferedamountlow=()=>this.handleBufferedAmountLow(Vt.RELIABLE),this.dataTrackDC.onbufferedamountlow=()=>this.handleBufferedAmountLow(Vt.DATA_TRACK_LOSSY),this.cleanupLossyDataStats(),this.lossyDataStatInterval=setInterval(()=>{this.lossyDataStatByterate=this.lossyDataStatCurrentBytes,this.lossyDataStatCurrentBytes=0;const e=this.dataChannelForKind(Vt.LOSSY);if(e){const t=this.lossyDataStatByterate/10;e.bufferedAmountLowThreshold=Math.min(Math.max(t,F1e),$1e)}},1e3))}createSender(e,t,r){return Q(this,void 0,void 0,function*(){if(Wk())return yield this.createTransceiverRTCRtpSender(e,t,r);if(Hk())return this.log.warn("using add-track fallback"),yield this.createRTCRtpSender(e.mediaStreamTrack);throw new dr("Required webRTC APIs not supported on this device")})}createSimulcastSender(e,t,r,i){return Q(this,void 0,void 0,function*(){if(Wk())return this.createSimulcastTransceiverSender(e,t,r,i);if(Hk())return this.log.debug("using add-track fallback"),this.createRTCRtpSender(e.mediaStreamTrack);throw new dr("Cannot stream on this device")})}createTransceiverRTCRtpSender(e,t,r){return Q(this,void 0,void 0,function*(){if(!this.pcManager)throw new dr("publisher is closed");const i=[];e.mediaStream&&i.push(e.mediaStream),hd(e)&&(e.codec=t.videoCodec);const a={direction:"sendonly",streams:i};return r&&(a.sendEncodings=r),(yield this.pcManager.addPublisherTransceiver(e.mediaStreamTrack,a)).sender})}createSimulcastTransceiverSender(e,t,r,i){return Q(this,void 0,void 0,function*(){if(!this.pcManager)throw new dr("publisher is closed");const a={direction:"sendonly"};i&&(a.sendEncodings=i);const s=yield this.pcManager.addPublisherTransceiver(t.mediaStreamTrack,a);if(r.videoCodec)return e.setSimulcastTrackSender(r.videoCodec,s.sender),s.sender})}createRTCRtpSender(e){return Q(this,void 0,void 0,function*(){if(!this.pcManager)throw new dr("publisher is closed");return this.pcManager.addPublisherTrack(e)})}attemptReconnect(e){return Q(this,void 0,void 0,function*(){var t,r,i;if(!this._isClosed){if(this.attemptingReconnect){this.log.warn("already attempting reconnect, returning early");return}(((t=this.clientConfiguration)===null||t===void 0?void 0:t.resumeConnection)===Og.DISABLED||((i=(r=this.pcManager)===null||r===void 0?void 0:r.currentState)!==null&&i!==void 0?i:hr.NEW)===hr.NEW)&&(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?yield this.restartConnection():yield this.resumeConnection(e),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(a){this.reconnectAttempts+=1;let s=!0;a instanceof dr?(this.log.debug("received unrecoverable error",{error:a}),s=!1):a instanceof lh||(this.fullReconnectOnNext=!0),s?this.handleDisconnect("reconnect",Dd.RR_UNKNOWN):(this.log.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up")),this.emit
vendor: 2,254 bytes, line 3926
3926(Ue.Disconnected),yield this.close())}finally{this.attemptingReconnect=!1}}})}getNextRetryDelay(e){try{return this.reconnectPolicy.nextRetryDelayInMs(e)}catch(t){this.log.warn("encountered error in reconnect policy",{error:t})}return null}restartConnection(e){return Q(this,void 0,void 0,function*(){var t,r,i;try{if(!this.url||!this.token)throw new dr("could not reconnect, url or token not saved");this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts)),this.emit(Ue.Restarting),this.client.isDisconnected||(yield this.client.sendLeave()),yield this.cleanupPeerConnections(),yield this.cleanupClient();let a;try{if(!this.signalOpts)throw this.log.warn("attempted connection restart, without signal options present"),new lh;a=(yield this.join(e??this.url,this.token,this.signalOpts,void 0,!this.options.singlePeerConnection)).joinResponse}catch(s){throw s instanceof pt&&s.reason===Fn.NotAllowed?new dr("could not reconnect, token might be expired"):new lh}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(this.client.setReconnected(),this.emit(Ue.SignalRestarted,a),yield this.waitForPCReconnected(),this.client.currentState!==Nn.CONNECTED)throw new lh("Signal connection got severed during reconnect");(t=this.regionStrategy)===null||t===void 0||t.resetAttempts(),this.emit(Ue.Restarted)}catch(a){const s=yield(r=this.regionStrategy)===null||r===void 0?void 0:r.getNextUrl();if(s){yield this.restartConnection(s);return}else throw(i=this.regionStrategy)===null||i===void 0||i.resetAttempts(),a}})}resumeConnection(e){return Q(this,void 0,void 0,function*(){var t;if(!this.url||!this.token)throw new dr("could not reconnect, url or token not saved");if(!this.pcManager)throw new dr("publisher and subscriber connections unset");this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts)),this.emit(Ue.Resuming);let r;try{this.setupSignalClientCallbacks(),r=yield this.client.reconnect(this.url,this.token,this.participantSid,e)}catch(i){let a="";throw i instanceof Error&&(a=i.message,this.log.error(i.message,{error:i})),i instanceof pt&&i.reason===Fn.NotAllowed?new dr("could not reconnect, token might be expired"):i instanceof pt&&i.reason===Fn.LeaveRequest?i:new lh(a)}
3926if(this.emit(Ue.SignalResumed),r){const i=this.makeRTCConfiguration(r);this.pcManager.updateConfiguration(i),this.latestJoinResponse&&(this.latestJoinResponse.serverInfo=r.serverInfo)}else this.log.warn("Did not receive reconnect response");if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(yield this.pcManager.triggerIceRestart(),yield this.waitForPCReconnected(),this.client.currentState!==Nn.CONNECTED)throw new lh("Signal connection got severed during reconnect");this.client.setReconnected(),((t=this.reliableDC)===null||t===void 0?void 0:t.readyState)==="open"&&this.reliableDC.id===null&&this.createDataChannels(),r!=null&&r.lastMessageSeq&&this.resendReliableMessagesForResume(r.lastMessageSeq),this.emit(Ue.Resumed)})}waitForPCInitialConnection(e,t){return Q(this,void 0,void 0,function*(){if(!this.pcManager)throw new dr("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(t,e)})}waitForPCReconnected(){return Q(this,void 0,void 0,function*(){this.pcState=to.Reconnecting,this.log.debug("waiting for peer connection to reconnect");try{if(yield Ji(N1e),!this.pcManager)throw new dr("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout),this.pcState=to.Connected}catch(e){throw this.pcState=to.Disconnected,pt.internal("could not establish PC connection, ".concat(e.message))}})}publishRpcResponse(e,t,r,i){return Q(this,void 0,void 0,function*(){const a=new ga({destinationIdentities:[e],kind:Kd.RELIABLE,value:{case:"rpcResponse",value:new WT({requestId:t,value:i?{case:"error",value:i.toProto()}:{case:"payload",value:r??""}})}});yield this.sendDataPacket(a,Vt.RELIABLE)})}publishRpcAck(e,t){return Q(this,void 0,void 0,function*(){const r=new ga({destinationIdentities:[e],kind:Kd.RELIABLE,value:{case:"rpcAck",value:new zT({requestId:t})}});yield this.sendDataPacket(r,Vt.RELIABLE)})}sendDataPacket(e,t){return Q(this,void 0,void 0,function*(){if(yield this.ensurePublisherConnected(t),this.e2eeManager&&this.e2eeManager.isDataChannelEncryptionEnabled){const i=Xbe(e);if(i){const a=yield this.e2eeManager.encryptData(i.toBinary());e.value={case:"encryptedPacket",value:new u6({encryptedValue:a.payload,iv:a.iv,keyIndex:a.keyIndex})}}}t===Vt.RELIABLE&&(e.sequence=this.reliableDataSequence,this.reliableDataSequence+=1);const r=e.toBinary();switch(t){case Vt.LOSSY:case Vt.DATA_TRACK_LOSSY:return this.sendLossyBytes(r,t);case Vt.RELIABLE:const i=this.dataChannelForKind(t);if(i){if(yield this.waitForBufferStatusLow(t),this.reliableMessageBuffer.push({data:r,sequence:e.sequence}),this.attemptingReconnect)return;i.send(r)}this.updateAndEmitDCBufferStatus(t);break}})}sendLossyBytes(e,t){return Q(this,arguments,void 0,function(r,i){var a=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"drop";return function*(){yield a.ensurePublisherConnected(i);const o=a.dataChannelForKind(i);if(o){if(!a.isBufferStatusLow(i))switch(s){case"wait":yield a.waitForBufferStatusLow(i);break;case"drop":a.lossyDataDropCount+=1,a.lossyDataDropCount%100===0&&a.log.warn("dropping lossy data channel messages, total dropped: ".concat(a.lossyDataDropCount));return}if(a.lossyDataStatCurrentBytes+=r.byteLength,a.attemptingReconnect)return;o.send(r)}a.updateAndEmitDCBufferStatus(i)}()})}resendReliableMessagesForResume(e){return Q(this,void 0,void 0,function*(){yield this.ensurePublisherConnected(Vt.RELIABLE);const t=this.dataChannelForKind(Vt.RELIABLE);t&&(this.reliableMessageBuffer.popToSequence(e),this.reliableMessageBuffer.getAll().forEach(r=>{t.send(r.data)})),this.updateAndEmitDCBufferStatus(Vt.RELIABLE)})}waitForBufferStatusLow(e){return Q(this,void 0,void 0,function*(){return new Yi((t,r)=>Q(this,void 0,void 0,function*(){if(this.isClosed&&r(new dr("engine closed")),this.isBufferStatusLow(e))t();else{const i=this.dataChannelForKind(e);if(!i){r(new dr("DataChannel not found, kind: ".concat(e)));return}this.bufferStatusLowClosingFuture.promise.catch(a=>r(a)),i.addEventListener("bufferedamountlow",()=>t(),{once:!0})}}))})}ensureDataTransportConnected(e){return Q(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.subscriberPrimary;return function*(){var a;if(!r.pcManager)throw new dr("PC manager is closed");const s=i?r.pcManager.subscriber:r.pcManager.publisher,o=i?"Subscriber":"Publisher";if(!s)throw pt.internal("".concat(o," connection not set"));let c=!1;!i&&!r.dataChannelForKind(t,i)&&(r.createDataChannels(),c=!0),!c&&!i&&!r.pcManager.publisher.isICEConnected&&r.pcManager.publisher.getICEConnectionState()!=="checking"&&(c=!0),c&&r.negotiate().catch(d=>{r.log.error(d)});const u=r.dataChannelForKind(t,i);if((u==null?void 0:u.readyState)==="open")return;const l=new Date().getTime()+r.peerConnectionTimeout;for(;new Date().getTime()<l;){if(s.isICEConnected&&((a=r.dataChannelForKind(t,i))===null||a===void 0?void 0:a.readyState)==="open")return;yield Ji(50)}throw pt.internal("could not establish ".concat(o," connection, state: ").concat(s.getICEConnectionState()))}()})}ensurePublisherConnected(e){return Q(this,void 0,void 0,function*(){this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(e,!1)),yield this.publisherConnectionPromise})}verifyTransport(){return!(!this.pcManager||![hr.CONNECTING,hr.CONNECTED].includes(this.pcManager.currentState)||!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}negotiate(){return Q(this,void 0,void 0,function*(){return new Yi((e,t)=>Q(this,void 0,void 0,function*(){if(!this.pcManager){t(new rf("PC manager is closed"));return}this.pcManager.requirePublisher(),this.pcManager.publisher.getTransceivers().length==0&&!this.lossyDC&&!this.reliableDC&&!this.dataTrackDC&&this.createDataChannels();const r=new AbortController,i=()=>{r.abort(),this.log.debug("engine disconnected while negotiation was ongoing"),e()};this.isClosed&&t(new rf("cannot negotiate on closed engine")),this.on(Ue.Closing,i),this.on(Ue.Restarting,i),this.pcManager.publisher.once(Yd.RTPVideoPayloadTypes,a=>{const s=new Map;a.forEach(o=>{const c=o.codec.toLowerCase();Mbe(c)&&s.set(o.payload,c)}
3926),this.emit(Ue.RTPVideoMapUpdate,s)});try{yield this.pcManager.negotiate(r),e()}catch(a){if(r.signal.aborted){e();return}a instanceof rf&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",Dd.RR_UNKNOWN),a instanceof Error?t(a):t(new Error(String(a)))}finally{this.off(Ue.Closing,i),this.off(Ue.Restarting,i)}}))})}dataChannelForKind(e,t){switch(e){case Vt.RELIABLE:return t?this.reliableDCSub:this.reliableDC;case Vt.LOSSY:return t?this.lossyDCSub:this.lossyDC;case Vt.DATA_TRACK_LOSSY:return t?this.dataTrackDCSub:this.dataTrackDC}}sendSyncState(e,t,r){var i,a,s,o;if(!this.pcManager){this.log.warn("sync state cannot be sent without peer connection setup");return}const c=this.pcManager.publisher.getLocalDescription(),u=this.pcManager.publisher.getRemoteDescription(),l=(i=this.pcManager.subscriber)===null||i===void 0?void 0:i.getRemoteDescription(),d=(a=this.pcManager.subscriber)===null||a===void 0?void 0:a.getLocalDescription(),h=(o=(s=this.signalOpts)===null||s===void 0?void 0:s.autoSubscribe)!==null&&o!==void 0?o:!0,p=new Array,g=new Array;e.forEach(v=>{v.isDesired!==h&&p.push(v.trackSid),v.isEnabled||g.push(v.trackSid)}),this.client.sendSyncState(new QT({answer:this.pcManager.mode==="publisher-only"?u?qd({sdp:u.sdp,type:u.type}):void 0:d?qd({sdp:d.sdp,type:d.type}):void 0,offer:this.pcManager.mode==="publisher-only"?c?qd({sdp:c.sdp,type:c.type}):void 0:l?qd({sdp:l.sdp,type:l.type}):void 0,subscription:new Ub({trackSids:p,subscribe:!h,participantTracks:[]}),publishTracks:gbe(t),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:g,datachannelReceiveStates:this.reliableReceivedState.map((v,y)=>new I6({publisherSid:y,lastSeq:v})),publishDataTracks:r.map(v=>new VT({info:M_.toProtobuf(v)}))}))}failNext(){this.shouldFailNext=!0}failNextV1Path(){this.shouldFailOnV1Path=!0}dataChannelsInfo(){const e=[],t=(r,i)=>{(r==null?void 0:r.id)!==void 0&&r.id!==null&&e.push(new O6({label:r.label,id:r.id,target:i}))};return t(this.dataChannelForKind(Vt.LOSSY),Ho.PUBLISHER),t(this.dataChannelForKind(Vt.RELIABLE),Ho.PUBLISHER),t(this.dataChannelForKind(Vt.LOSSY,!0),Ho.SUBSCRIBER),t(this.dataChannelForKind(Vt.RELIABLE,!0),Ho.SUBSCRIBER),e}clearReconnectTimeout(){this.reconnectTimeout&&Vr.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){Fa()&&(window.addEventListener("online",this.handleBrowserOnLine),window.addEventListener("offline",this.handleBrowserOffline))}deregisterOnLineListener(){Fa()&&(window.removeEventListener("online",this.handleBrowserOnLine),window.removeEventListener("offline",this.handleBrowserOffline))}getTrackIdForReceiver(e){var t;const r=(t=this.pcManager)===null||t===void 0?void 0:t.getMidForReceiver(e);if(r){const i=Object.entries(this.midToTrackId).find(a=>{let[s]=a;return s===r});if(i)return i[1]}}}function yO(n,e){const t=n.participantIdentity?n.participantIdentity:e.participantIdentity;n.participantIdentity=t,e.participantIdentity=t;const r=n.destinationIdentities.length!==0?n.destinationIdentities:e.destinationIdentities;n.destinationIdentities=r,e.destinationIdentities=r}const Qk=5e3,q1e=3e4;class un{static fetchRegionSettings(e,t,r){return Q(this,void 0,void 0,function*(){const i=yield un.fetchLock.lock();try{const a=yield fetch("".concat(z1e(e),"/regions"),{headers:{authorization:"Bearer ".concat(t)},signal:r});if(a.ok){const s=Ube(a.headers),o=s?s*1e3:Qk;return{regionSettings:yield a.json(),updatedAtInMs:Date.now(),maxAgeInMs:o}}else throw a.status===401?pt.notAllowed("Could not fetch region settings: ".concat(a.statusText),a.status):pt.internal("Could not fetch region settings: ".concat(a.statusText))}catch(a){throw a instanceof pt?a:r!=null&&r.aborted?pt.cancelled("Region fetching was aborted"):pt.serverUnreachable("Could not fetch region settings, ".concat(a instanceof Error?"".concat(a.name,": ").concat(a.message):a))}finally{i()}})}static scheduleRefetch(e,t,r){return Q(this,void 0,void 0,function*(){const i=un.settingsTimeouts.get(e.hostname);clearTimeout(i),un.settingsTimeouts.set(e.hostname,setTimeout(()=>Q(this,void 0,void 0,function*(){try{const a=yield un.fetchRegionSettings(e,t);un.updateCachedRegionSettings(e,t,a)}catch(a){if(a instanceof pt&&a.reason===Fn.NotAllowed){qt.debug("token is not val
3926id, cancelling auto region refresh");return}qt.debug("auto refetching of region settings failed",{error:a}),un.scheduleRefetch(e,t,r)}}),r))})}static updateCachedRegionSettings(e,t,r){un.cache.set(e.hostname,r),un.scheduleRefetch(e,t,r.maxAgeInMs)}static stopRefetch(e){const t=un.settingsTimeouts.get(e);t&&(clearTimeout(t),un.settingsTimeouts.delete(e))}static scheduleCleanup(e){let t=un.connectionTrackers.get(e);t&&(t.cleanupTimeout&&clearTimeout(t.cleanupTimeout),t.cleanupTimeout=setTimeout(()=>{const r=un.connectionTrackers.get(e);r&&r.connectionCount===0&&(qt.debug("stopping region refetch after disconnect delay",{hostname:e}),un.stopRefetch(e)),r&&(r.cleanupTimeout=void 0)},q1e))}static cancelCleanup(e){const t=un.connectionTrackers.get(e);t!=null&&t.cleanupTimeout&&(clearTimeout(t.cleanupTimeout),t.cleanupTimeout=void 0)}notifyConnected(){const e=this.serverUrl.hostname;let t=un.connectionTrackers.get(e);t||(t={connectionCount:0},un.connectionTrackers.set(e,t)),t.connectionCount++,un.cancelCleanup(e)}notifyDisconnected(){const e=this.serverUrl.hostname,t=un.connectionTrackers.get(e);t&&(t.connectionCount=Math.max(0,t.connectionCount-1),t.connectionCount===0&&un.scheduleCleanup(e))}constructor(e,t){this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=t}updateToken(e){var t;this.token=e;const r=this.getServerUrl(),i=un.cache.get(r.hostname);un.scheduleRefetch(this.serverUrl,this.token,(t=i==null?void 0:i.maxAgeInMs)!==null&&t!==void 0?t:Qk)}isCloud(){return pp(this.serverUrl)}getServerUrl(){return this.serverUrl}fetchRegionSettings(e){return Q(this,void 0,void 0,function*(){return un.fetchRegionSettings(this.serverUrl,this.token,e)})}getNextBestRegionUrl(e){return Q(this,void 0,void 0,function*(){if(!this.isCloud())throw Error("region availability is only supported for LiveKit Cloud domains");let t=un.cache.get(this.serverUrl.hostname);(!t||Date.now()-t.updatedAtInMs>t.maxAgeInMs)&&(t=yield this.fetchRegionSettings(e),un.updateCachedRegionSettings(this.serverUrl,this.token,t));const r=t.regionSettings.regions.filter(i=>!this.attemptedRegions.find(a=>a.url===i.url));if(r.length>0){const i=r[0];return this.attemptedRegions.push(i),qt.debug("next region: ".concat(i.region)),i.url}else return null})}resetAttempts(){this.attemptedRegions=[]}setServerReportedRegions(e){un.updateCachedRegionSettings(this.serverUrl,this.token,e)}}un.cache=new Map;un.settingsTimeouts=new Map;un.connectionTrackers=new Map;un.fetchLock=new Ii;function z1e(n){return"".concat(n.protocol.replace("ws","http"),"//").concat(n.host,"/settings")}class I${get info(){return this._info}validateBytesReceived(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!(typeof this.totalByteSize!="number"||this.totalByteSize===0)){if(e&&this.bytesReceived<this.totalByteSize)throw new ro("Not enough chunk(s) received - expected ".concat(this.totalByteSize," bytes of data total, only received ").concat(this.bytesReceived," bytes"),ma.Incomplete);if(this.bytesReceived>this.totalByteSize)throw new ro("Extra chunk(s) received - expected ".concat(this.totalByteSize," bytes of data total, received ").concat(this.bytesReceived," bytes"),ma.LengthExceeded)}}constructor(e,t,r){this.reader=t,this.totalByteSize=r,this._info=e,this.bytesReceived=0}}class W1e extends I${handleChunkReceived(e){var t;this.bytesReceived+=e.content.byteLength,this.validateBytesReceived();const r=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(t=this.onProgress)===null||t===void 0||t.call(this,r)}[Symbol.asyncIterator](){const e=this.reader.getReader();e.closed.catch(()=>{});const t=()=>{e.releaseLock(),this.signal=void 0};return{next:()=>Q(this,void 0,void 0,function*(){try{const r=this.signal;if(r!=null&&r.aborted)throw r.reason;const i=yield new Promise((a,s)=>{if(r){const o=()=>s(r.reason);r.addEventListener("abort",o,{once:!0}),e.read().then(a,s).finally(()=>{r.removeEventListener("abort",o)})}else e.read().then(a,s)});return i.done?(this.validateBytesReceived(!0),{done:!0,value:void 0}):(this.handleChunkReceived(i.value),{done:!1,value:i.value.content})}catch(r){throw t(),r}}),return(){return Q(this,void 0,void 0,function*(){return t(),{done:!0,value:void 0}})}}}withAbortSignal(e){return this.signal=e,this}readAll(){return Q(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function*(){var r,i,a,s;let o=new Set;const c=t.signal?e.withAbortSignal(t.signal):e;try{for(var u=!0,l=Vo(c),d;d=yield l.next(),r=d.done,!r;u=!0){s=d.value,u=!1;const h=s;o.add(h)}}catch(h){i={error:h}}finally{try{!u&&!r&&(a=l.return)&&(yield a.call(l))}finally{if(i)throw i.error}}return Array.from(o)}()})}}class H1e extends I${constructor(e,t,r){super(e,t,r),this.receivedChunks=new Map}handleChunkReceived(e){var t;const r=Sy(e.chunkIndex),i=this.receivedChunks.get(r);if(i&&i.version>e.version)return;this.receivedChunks.set(r,e),this.bytesReceived+=e.content.byteLength,this.validateBytesReceived();const a=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(t=this.onProgress)===null||t===void 0||t.call(this,a)}[Symbol.asyncIterator](){const e=this.reader.getReader();e.closed.catch(()=>{});const t=new TextDecoder("utf-8",{fatal:!0}),r=this.signal,i=()=>{e.releaseLock(),this.signal=void 0};return{next:()=>Q(this,void 0,void 0,function*(){try{if(r!=null&&r.aborted)throw r.reason;const a=yield new Promise((s,o)=>
3926{if(r){const c=()=>o(r.reason);r.addEventListener("abort",c,{once:!0}),e.read().then(s,o).finally(()=>{r.removeEventListener("abort",c)})}else e.read().then(s,o)});if(a.done)return this.validateBytesReceived(!0),{done:!0,value:void 0};{this.handleChunkReceived(a.value);let s;try{s=t.decode(a.value.content)}catch(o){throw new ro("Cannot decode datastream chunk ".concat(a.value.chunkIndex," as text: ").concat(o),ma.DecodeFailed)}return{done:!1,value:s}}}catch(a){throw i(),a}}),return(){return Q(this,void 0,void 0,function*(){return i(),{done:!0,value:void 0}})}}}withAbortSignal(e){return this.signal=e,this}readAll(){return Q(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function*(){var r,i,a,s;let o="";const c=t.signal?e.withAbortSignal(t.signal):e;try{for(var u=!0,l=Vo(c),d;d=yield l.next(),r=d.done,!r;u=!0)s=d.value,u=!1,o+=s}catch(h){i={error:h}}finally{try{!u&&!r&&(a=l.return)&&(yield a.call(l))}finally{if(i)throw i.error}}return o}()})}}class V1e{constructor(){this.log=qt,this.byteStreamControllers=new Map,this.textStreamControllers=new Map,this.byteStreamHandlers=new Map,this.textStreamHandlers=new Map,this.isConnected=!1,this.bufferedPackets=[]}setConnected(e){this.isConnected=e,e&&this.flushBufferedPackets()}flushBufferedPackets(){const e=this.bufferedPackets;this.bufferedPackets=[];for(const{packet:t,encryptionType:r}of e)this.handleDataStreamPacket(t,r)}registerTextStreamHandler(e,t){if(this.textStreamHandlers.has(e))throw new ro('A text stream handler for topic "'.concat(e,'" has already been set.'),ma.HandlerAlreadyRegistered);this.textStreamHandlers.set(e,t)}unregisterTextStreamHandler(e){this.textStreamHandlers.delete(e)}registerByteStreamHandler(e,t){if(this.byteStreamHandlers.has(e))throw new ro('A byte stream handler for topic "'.concat(e,'" has already been set.'),ma.HandlerAlreadyRegistered);this.byteStreamHandlers.set(e,t)}unregisterByteStreamHandler(e){this.byteStreamHandlers.delete(e)}clearControllers(){this.byteStreamControllers.clear(),this.textStreamControllers.clear(),this.bufferedPackets=[]}validateParticipantHasNoActiveDataStreams(e){const t=Array.from(this.textStreamControllers.entries()).filter(i=>i[1].sendingParticipantIdentity===e),r=Array.from(this.byteStreamControllers.entries()).filter(i=>i[1].sendingParticipantIdentity===e);if(t.length>0||r.length>0){const i=new ro("Participant ".concat(e," unexpectedly disconnected in the middle of sending data"),ma.AbnormalEnd);for(const[a,s]of r)s.controller.error(i),this.byteStreamControllers.delete(a);for(const[a,s]of t)s.controller.error(i),this.textStreamControllers.delete(a)}}handleDataStreamPacket(e,t){if(!this.isConnected){this.bufferedPackets.push({packet:e,encryptionType:t});return}switch(e.value.case){case"streamHeader":return this.handleStreamHeader(e.value.value,e.participantIdentity,t);case"streamChunk":return this.handleStreamChunk(e.value.value,t);case"streamTrailer":return this.handleStreamTrailer(e.value.value,t);default:throw new Error('DataPacket of value "'.concat(e.value.case,'" is not data stream related!'))}}handleStreamHeader(e,t,r){var i;if(e.contentHeader.case==="byteHeader"){const a=this.byteStreamHandlers.get(e.topic);if(!a){this.log.debug("ignoring incoming byte stream due to no handler for topic",e.topic);return}let s;const o={id:e.streamId,name:(i=e.contentHeader.value.name)!==null&&i!==void 0?i:"unknown",mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Sy(e.timestamp),attributes:e.attributes,encryptionType:r},c=new ReadableStream({start:u=>{if(s=u,this.textStreamControllers.has(e.streamId))throw new ro("A data stream read is already in progress for a stream with id ".concat(e.streamId,"."),ma.AlreadyOpened);this.byteStreamControllers.set(e.streamId,{info:o,controller:s,startTime:Date.now(),sendingParticipantIdentity:t})}});a(new W1e(o,c,Sy(e.totalLength)),{identity:t})}else if(e.contentHeader.case==="textHeader"){const a=this.textStreamHandlers.get(e.topic);if(!a){this.log.debug("ignoring incoming text stream due to no handler for topic",e.topic);return}let s;const o={id:e.streamId,mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Number(e.timestamp),attributes:e.attributes,encryptionType:r,attachedStreamIds:e.contentHeader.value.attachedStreamIds},c=new ReadableStream({start:u=>{if(s=u,this.textStreamControllers.has(e.streamId))throw new ro("A data stream read is already in progress for a stream with i
3926d ".concat(e.streamId,"."),ma.AlreadyOpened);this.textStreamControllers.set(e.streamId,{info:o,controller:s,startTime:Date.now(),sendingParticipantIdentity:t})}});a(new H1e(o,c,Sy(e.totalLength)),{identity:t})}}handleStreamChunk(e,t){const r=this.byteStreamControllers.get(e.streamId);r&&(r.info.encryptionType!==t?(r.controller.error(new ro("Encryption type mismatch for stream ".concat(e.streamId,". Expected ").concat(t,", got ").concat(r.info.encryptionType),ma.EncryptionTypeMismatch)),this.byteStreamControllers.delete(e.streamId)):e.content.length>0&&r.controller.enqueue(e));const i=this.textStreamControllers.get(e.streamId);i&&(i.info.encryptionType!==t?(i.controller.error(new ro("Encryption type mismatch for stream ".concat(e.streamId,". Expected ").concat(t,", got ").concat(i.info.encryptionType),ma.EncryptionTypeMismatch)),this.textStreamControllers.delete(e.streamId)):e.content.length>0&&i.controller.enqueue(e))}handleStreamTrailer(e,t){const r=this.textStreamControllers.get(e.streamId);r&&(r.info.encryptionType!==t?r.controller.error(new ro("Encryption type mismatch for stream ".concat(e.streamId,". Expected ").concat(t,", got ").concat(r.info.encryptionType),ma.EncryptionTypeMismatch)):(r.info.attributes=Object.assign(Object.assign({},r.info.attributes),e.attributes),r.controller.close(),this.textStreamControllers.delete(e.streamId)));const i=this.byteStreamControllers.get(e.streamId);i&&(i.info.encryptionType!==t?i.controller.error(new ro("Encryption type mismatch for stream ".concat(e.streamId,". Expected ").concat(t,", got ").concat(i.info.encryptionType),ma.EncryptionTypeMismatch)):(i.info.attributes=Object.assign(Object.assign({},i.info.attributes),e.attributes),i.controller.close()),this.byteStreamControllers.delete(e.streamId))}}class O${constructor(e,t,r){this.writableStream=e,this.defaultWriter=e.getWriter(),this.onClose=r,this.info=t}write(e){return this.defaultWriter.write(e)}close(){return Q(this,void 0,void 0,function*(){var e;yield this.defaultWriter.close(),this.defaultWriter.releaseLock(),(e=this.onClose)===null||e===void 0||e.call(this)})}}class G1e extends O${}class K1e extends O${}const _O=15e3;class Y1e{constructor(e,t){this.engine=e,this.log=t}setupEngine(e){this.engine=e}sendText(e,t){return Q(this,void 0,void 0,function*(){var r;const i=crypto.randomUUID(),s=new TextEncoder().encode(e).byteLength,o=(r=t==null?void 0:t.attachments)===null||r===void 0?void 0:r.map(()=>crypto.randomUUID()),c=new Array(o?o.length+1:1).fill(0),u=(d,h)=>{var p;c[h]=d;const g=c.reduce((v,y)=>v+y,0);(p=t==null?void 0:t.onProgress)===null||p===void 0||p.call(t,g)},l=yield this.streamText({streamId:i,totalSize:s,destinationIdentities:t==null?void 0:t.destinationIdentities,topic:t==null?void 0:t.topic,attachedStreamIds:o,attributes:t==null?void 0:t.attributes});return yield l.write(e),u(1,0),yield l.close(),t!=null&&t.attachments&&o&&(yield Promise.all(t.attachments.map((d,h)=>Q(this,void 0,void 0,function*(){return this._sendFile(o[h],d,{topic:t.topic,mimeType:d.type,onProgress:p=>{u(p,h+1)}})})))),l.info})}streamText(e){return Q(this,void 0,void 0,function*(){var t,r,i;const a=(t=e==null?void 0:e.streamId)!==null&&t!==void 0?t:crypto.randomUUID(),s={id:a,mimeType:"text/plain",timestamp:Date.now(),topic:(r=e==null?void 0:e.topic)!==null&&r!==void 0?r:"",size:e==null?void 0:e.totalSize,attributes:e==null?void 0:e.attributes,encryptionType:!((i=this.engine.e2eeManager)===null||i===void 0)&&i.isDataChannelEncryptionEnabled?Bn.GCM:Bn.NONE,attachedStreamIds:e==null?void 0:e.attachedStreamIds},o=new R_({streamId:a,mimeType:s.mimeType,topic:s.topic,timestamp:Nd(s.timestamp),totalLength:Nd(s.size),attributes:s.attributes,contentHeader:{case:"textHeader",value:new x6({version:e==null?void 0:e.version,attachedStreamIds:s.attachedStreamIds,replyToStreamId:e==null?void 0:e.replyToStreamId,operationType:(e==null?void 0:e.type)==="update"?Rk.UPDATE:Rk.CREATE})}}),c=e==null?void 0:e.destinationIdentities,u=new ga({destinationIdentities:c,value:{case:"streamHeader",value:o}});yield this.engine.sendDataPacket(u,Vt.RELIABLE);let l=0;const d=this.engine,h=new WritableStream({write(v){return Q(this,void 0,void 0,function*(){for(const y of Bbe(v,_O)){const b=new A_({content:y,streamId:a,chunkIndex:Nd(l)}),x=new ga({destinationIdentities:c,value:{case:"streamChunk",value:b}});yield d.sendDataPacket(x,Vt.RELIABLE),l+=1}})},close(){return Q(this,void 0,void 0,function*(){const v=new I_({streamId:a}),y=new ga({destinationIdentities:c,value:{case:"streamTrailer",value:v}});yield d.sendDataPacket(y,Vt.RELIABLE)})},abort(v){console.log("Sink error:",v)}});let p=()=>Q(this,void 0,void 0,function*(){yield g.close()});d.once(Ue.Closing,p);const g=new G1e(h,s,()=>this.engine.off(Ue.Closing,p));return g})}sendFile(e,t){return Q(this,void 0,void 0,function*(){const r=crypto.randomUUID();return yield this._sendFile(r,e,t),{id:r}})}_sendFile(e,t,r){return Q(this,void 0,void 0,function*(){var i;const a=yield this.streamBytes({streamId:e,totalSize:t.size,name:t.name,mimeType:(i=r==null?void 0:r.mimeType)!==null&&i!==void 0?i:t.type,topic:r==null?void 0:r.topic,destinationIdentities:r==null?void 0:r.destinationIdentities}),s=t.stream().getReader();for(;;){const{done:o,value:c}=yield s.read();if(o)break;yield a.write(c)}return yield a.close(),a.info})}streamBytes(e){return Q(this,void 0,void 0,function*(){var t,r,i,a,s;const o=(t=e==null?void 0:e.streamId)!==null&&t!==void 0?t:crypto.randomUUID(),c=e==null?void 0:e.destinationIdentities,u={id:o,mimeType:(r=e==null?void 0:e.mimeType)!==null&&r!==void 0?r:"application/octet-stream",topic:(i=e==null?void 0:e.topic)!==null&&i!==void 0?i:"",timestamp:Date.now(),attributes:e==null?void 0:e.attributes,size:e==null?void 0:e.totalSize,name:(a=e==null?void 0:e.name)!==null&&a!==void 0?a:"unknown",encryptionType:!((s=this.engine.e2eeManager)===null||s===void 0)&&s.isDataChannelEncryptionEnabled?Bn.GCM:Bn.NONE},l=new R_({totalLength:Nd(u.size),mimeType:u.mimeType,streamId:o,topic:u.topic,timestamp:Nd(Date.now()),attributes:u.attributes,contentHeader:{case:"byteHeader",value:new w6({name:u.name})}}),d=new ga({destinationIdentities:c,value:{case:"streamHeader",value:l}});yield this.engine.sendDataPacket(d,Vt.RELIABLE);let h=0;const p=new Ii,g=this.engine,v=this.log,y=new WritableStream({write(x){return Q(this,void 0,void 0,function*(){const S=yield p.lock();let w=0;try{for(;w<x.byteLength;){const k=x.slice(w,w+_O),E=new ga({destinationIdentities:c,value:{case:"streamChunk",value:new A_({content:k,streamId:o,chunkIndex:Nd(h)})}});yield g.sendDataPacket(E,Vt.RELIABLE),h+=1,w+=k.byteLength}}finally{S()}})},close(){return Q(this,void 0,void 0,function*(){const x=new I_({streamId:o}),S=new ga({destinationIdentities:c,value:{case:"streamTrailer",value:x}});yield g.sendDataPacket(S,Vt.RELIABLE)})},abort(x){v.error("Sink error:",x)}});return new K1e(y,u)})}}function M$(n){if(n.length===0)return new AbortController().signal;if(n.length===1)return n[0];for(const i of n)if(i.aborted)return i;const e=new AbortController,t=Array(n.length),r=()=>{for(const i of t)i()};
3926return n.forEach((i,a)=>{const s=()=>{e.abort(i.reason),r()};i.addEventListener("abort",s),t[a]=()=>i.removeEventListener("abort",s)}),e.signal}function D$(n){const e=new AbortController;return setTimeout(()=>{e.abort(new DOMException("signal timed out after ".concat(n," ms"),"TimeoutError"))},n),e.signal}const Sr=1,Ru=2,bO=4,X1e=8,xO=0,wO=12,CO=5,J1e=7,kO=3,Q1e=3,SO=2,TO=1,EO=0,PO=3,z0=2,RO=2,Z1e=1,exe=0;var Du;(function(n){n[n.TooShort=0]="TooShort",n[n.HeaderOverrun=1]="HeaderOverrun",n[n.MissingExtWords=2]="MissingExtWords",n[n.UnsupportedVersion=3]="UnsupportedVersion",n[n.InvalidHandle=4]="InvalidHandle",n[n.MalformedExt=5]="MalformedExt"})(Du||(Du={}));class va extends wo{constructor(e,t,r){super(19,e,r),this.name="DataTrackDeserializeError",this.reason=t,this.reasonName=Du[t]}static tooShort(){return new va("Too short to contain a valid header",Du.TooShort)}static headerOverrun(){return new va("Header exceeds total packet length",Du.HeaderOverrun)}static missingExtWords(){return new va("Extension word indicator is missing",Du.MissingExtWords)}static unsupportedVersion(e){return new va("Unsupported version ".concat(e),Du.UnsupportedVersion)}static invalidHandle(e){return new va("invalid track handle: ".concat(e.message),Du.InvalidHandle,{cause:e})}static malformedExt(e){return new va("Extension with tag ".concat(e," is malformed"),Du.MalformedExt)}}var ig;(function(n){n[n.TooSmallForHeader=0]="TooSmallForHeader",n[n.TooSmallForPayload=1]="TooSmallForPayload"})(ig||(ig={}));class Bg extends wo{constructor(e,t,r){super(19,e,r),this.name="DataTrackSerializeError",this.reason=t,this.reasonName=ig[t]}static tooSmallForHeader(){return new Bg("Buffer cannot fit header",ig.TooSmallForHeader)}static tooSmallForPayload(){return new Bg("Buffer cannot fit payload",ig.TooSmallForPayload)}}class Wb{toBinary(){const e=this.toBinaryLengthBytes(),t=new ArrayBuffer(e),r=new DataView(t),i=this.toBinaryInto(r);if(e!==i)throw new Error("".concat(this.constructor.name,".toBinary: written bytes (").concat(i," bytes) not equal to allocated array buffer length (").concat(e," bytes)."));return new Uint8Array(t)}}var gp;(function(n){n[n.UserTimestamp=2]="UserTimestamp",n[n.E2ee=1]="E2ee"})(gp||(gp={}));class N$ extends Wb{}class Ko extends N${constructor(e){super(),this.timestamp=e}toBinaryLengthBytes(){return Sr+Sr+Ko.lengthBytes}toBinaryInto(e){let t=0;e.setUint8(t,Ko.tag),t+=Sr,e.setUint8(t,Ko.lengthBytes),t+=Sr,e.setBigUint64(t,this.timestamp),t+=X1e;const r=this.toBinaryLengthBytes();if(t!==r)throw new Error("DataTrackUserTimestampExtension.toBinaryInto: Wrote ".concat(t," bytes but expected length was ").concat(r," bytes"));return t}toJSON(){return{tag:Ko.tag,lengthBytes:Ko.lengthBytes,timestamp:this.timestamp}}}Ko.tag=gp.UserTimestamp;Ko.lengthBytes=8;class Yo extends N${constructor(e,t){super(),this.keyIndex=e,this.iv=t}toBinaryLengthBytes(){return Sr+Sr+Yo.lengthBytes}toBinaryInto(e){let t=0;e.setUint8(t,Yo.tag),t+=Sr,e.setUint8(t,Yo.lengthBytes),t+=Sr,e.setUint8(t,this.keyIndex),t+=Sr;for(let i=0;i<this.iv.length;i+=1)e.setUint8(t,this.iv[i]),t+=Sr;const r=this.toBinaryLengthBytes();if(t!==r)throw new Error("DataTrackE2eeExtension.toBinaryInto: Wrote ".concat(t," bytes but expected length was ").concat(r," bytes"));return t}toJSON(){return{tag:Yo.tag,lengthBytes:Yo.lengthBytes,keyIndex:this.keyIndex,iv:this.iv}}}Yo.tag=gp.E2ee;Yo.lengthBytes=13;class Zh extends Wb{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.userTimestamp=e.userTimestamp,this.e2ee=e.e2ee}toBinaryLengthBytes(){let e=0;return this.userTimestamp&&(e+=this.userTimestamp.toBinaryLengthBytes()),this.e2ee&&(e+=this.e2ee.toBinaryLengthBytes()),e}toBinaryInto(e){let t=0;if(this.e2ee){const i=this.e2ee.toBinaryInto(e);t+=i}if(this.userTimestamp){const i=this.userTimestamp.toBinaryInto(new DataView(e.buffer,e.byteOffset+t));t+=i}const r=this.toBinaryLengthBytes();if(t!==r)throw new Error("DataTrackExtensions.toBinaryInto: Wrote ".concat(t," bytes but expected length was ").concat(r," bytes"));return t}static fromBinary(e){const t=sE(e);let r,i,a=0;for(;t.byteLength-a>=Sr+Sr;){const s=t.getUint8(a);a+=Sr;const o=t.getUint8(a);if(a+=Sr,s!==exe)switch(s){case gp.UserTimestamp:if(t.byteLength-a<Ko.lengthBytes)throw va.malformedExt(s);r=new Ko(t.getBigUint64(a)),a+=o;break;case gp.E2ee:if(t.byteLength-a<Yo.lengthBytes)throw va.malformedExt(s);const c=t.getUint8(a),u=new Uint8Array(12);for(let l=0;l<u.length;l+=1){let d=a;d+=Sr,d+=l*Sr,u[l]=t.getUint8(d)}i=new Yo(c,u),a+=o;break;default:if(t.byteLength-a<o)throw va.malformedExt(s);a+=o;break}}return[new Zh({userTimestamp:r,e2ee:i}),t.byteLength]}toJSON(){var e,t,r,i;return{userTimestamp:(t=(e=this.userTimestamp)===null||e===void 0?void 0:e.toJSON())!==null&&t!==void 0?t:null,e2ee:(i=(r=this.e2ee)===null||r===void 0?void 0:r.toJSON())!==null&&i!==void 0?i:null}}}const L$={from(n){return{payload:n.payload,extensions:new Zh({userTimestamp:n.userTimestamp?new Ko(n.userTimestamp):void 0})}},lossyIntoFrame(n){var e;return{payload:n.payload,userTimestamp:(e=n.extensions.userTimestamp)===null||e===void 0?void 0:e.timestamp}}},F$=Symbol.for("lk.track"),$$=Symbol.for("lk.data-track");
3926class B${constructor(e,t,r){this.trackSymbol=F$,this.isLocal=!1,this.typeSymbol=$$,this.info=e,this.manager=t,this.publisherIdentity=r.publisherIdentity}subscribe(e){try{const[t,r]=this.manager.openSubscriptionStream(this.info.sid,e==null?void 0:e.signal,e==null?void 0:e.bufferSize);return r.catch(()=>{}),t}catch(t){throw t}}}class Ug extends Wb{constructor(e){var t;super(),this.marker=e.marker,this.trackHandle=e.trackHandle,this.sequence=e.sequence,this.frameNumber=e.frameNumber,this.timestamp=e.timestamp,this.extensions=(t=e.extensions)!==null&&t!==void 0?t:new Zh}extensionsMetrics(){const e=this.extensions.toBinaryLengthBytes(),t=Math.ceil((z0+e)/4),r=t*4-z0-e;return{lengthBytes:e,lengthWords:t,paddingLengthBytes:r}}toBinaryLengthBytes(){const{lengthBytes:e,paddingLengthBytes:t}=this.extensionsMetrics();let r=wO;return e>0&&(r+=z0+e+t),r}toBinaryInto(e){if(e.byteLength<this.toBinaryLengthBytes())throw Bg.tooSmallForHeader();let t=xO<<CO,r;switch(this.marker){case nr.Inter:r=EO;break;case nr.Final:r=TO;break;case nr.Start:r=SO;break;case nr.Single:r=PO;break}t|=r<<kO;const{lengthBytes:i,lengthWords:a,paddingLengthBytes:s}=this.extensionsMetrics();i>0&&(t|=1<<RO);let o=0;if(e.setUint8(o,t),o+=Sr,e.setUint8(o,0),o+=Sr,e.setUint16(o,this.trackHandle),o+=Ru,e.setUint16(o,this.sequence.value),o+=Ru,e.setUint16(o,this.frameNumber.value),o+=Ru,e.setUint32(o,this.timestamp.asTicks()),o+=bO,i>0){const u=a-1;e.setUint16(o,u),o+=Ru;const l=this.extensions.toBinaryInto(new DataView(e.buffer,e.byteOffset+o));o+=l;for(let d=0;d<s;d+=1)e.setUint8(o,0),o+=Sr}const c=this.toBinaryLengthBytes();if(o!==c)throw new Error("DataTrackPacketHeader.toBinaryInto: Wrote ".concat(o," bytes but expected length was ").concat(c," bytes"));return c}static fromBinary(e){const t=sE(e);if(t.byteLength<wO)throw va.tooShort();let r=0;const i=t.getUint8(r);r+=Sr;const a=i>>CO&J1e;if(a>xO)throw va.unsupportedVersion(a);let s;switch(i>>kO&Q1e){case SO:s=nr.Start;break;case TO:s=nr.Final;break;case PO:s=nr.Single;break;case EO:default:s=nr.Inter;break}const o=(i>>RO&Z1e)>0;r+=Sr;let c;try{c=e1e.fromNumber(t.getUint16(r))}catch(p){throw p instanceof mp&&(p.isReason(sf.Reserved)||p.isReason(sf.TooLarge))?va.invalidHandle(p):p}r+=Ru;const u=ec.u16(t.getUint16(r));r+=Ru;const l=ec.u16(t.getUint16(r));r+=Ru;const d=Qh.fromRtpTicks(t.getUint32(r));r+=bO;let h=new Zh;if(o){if(t.byteLength-r<Ru)throw va.missingExtWords();let p=t.getUint16(r);r+=Ru;let v=4*(p+1)-z0;if(r+v>t.byteLength)throw va.headerOverrun();let y=new DataView(t.buffer,t.byteOffset+r,v);const[b,x]=Zh.fromBinary(y);h=b,r+=x}return[new Ug({marker:s,trackHandle:c,sequence:u,frameNumber:l,timestamp:d,extensions:h}),r]}toJSON(){return{marker:this.marker,trackHandle:this.trackHandle,sequence:this.sequence.value,frameNumber:this.frameNumber.value,timestamp:this.timestamp.asTicks(),extensions:this.extensions.toJSON()}}}var nr;(function(n){n[n.Start=0]="Start",n[n.Inter=1]="Inter",n[n.Final=2]="Final",n[n.Single=3]="Single"})(nr||(nr={}));class Hb extends Wb{constructor(e,t){super(),this.header=e,this.payload=t}toBinaryLengthBytes(){return this.header.toBinaryLengthBytes()+this.payload.byteLength}toBinaryInto(e){let t=0;const r=this.header.toBinaryInto(e);if(t+=r,e.byteLength-t<this.payload.byteLength)throw Bg.tooSmallForPayload();for(let a=0;a<this.payload.length;a+=1)e.setUint8(t,this.payload[a]),t+=Sr;const i=this.toBinaryLengthBytes();if(t!==i)throw new Error("DataTrackPacket.toBinaryInto: Wrote ".concat(t," bytes but expected length was ").concat(i," bytes"));return i}static fromBinary(e){const t=sE(e),[r,i]=Ug.fromBinary(t),a=t.buffer.slice(t.byteOffset+i,t.byteOffset+t.byteLength);return[new Hb(r,new Uint8Array(a)),t.byteLength]}toJSON(){return{header:this.header.toJSON(),payload:this.payload}}}const rC=Ha(yi.DataTracks);
3926class qo extends wo{constructor(e,t,r,i){super(19,"Frame ".concat(r," dropped: ").concat(e),i),this.name="DataTrackDepacketizerDropError",this.reason=t,this.reasonName=zd[t],this.frameNumber=r}static interrupted(e,t){return new qo("Interrupted by the start of a new frame ".concat(t),zd.Interrupted,e)}static unknownFrame(e){return new qo("Initial packet was never received.",zd.UnknownFrame,e)}static bufferFull(e){return new qo("Reorder buffer is full.",zd.BufferFull,e)}static incomplete(e,t,r){return new qo("Not all packets received before final packet. Received ".concat(t," packets, expected ").concat(r," packets."),zd.Incomplete,e)}}var zd;(function(n){n[n.Interrupted=0]="Interrupted",n[n.UnknownFrame=1]="UnknownFrame",n[n.BufferFull=2]="BufferFull",n[n.Incomplete=3]="Incomplete"})(zd||(zd={}));class Vb{constructor(){this.partial=null}push(e,t){switch(e.header.marker){case nr.Single:return this.frameFromSingle(e,t);case nr.Start:return this.beginPartial(e,t);case nr.Inter:case nr.Final:return this.pushToPartial(e)}}reset(){this.partial=null}frameFromSingle(e,t){if(e.header.marker!==nr.Single)throw new Error("Depacketizer.frameFromSingle: packet.header.marker was not FrameMarker.Single, found ".concat(e.header.marker,"."));if(this.partial)if(t!=null&&t.errorOnPartialFrames){const r=this.partial.frameNumber;throw this.reset(),qo.interrupted(r,e.header.frameNumber.value)}else rC.warn("Data track frame ".concat(this.partial.frameNumber," was interrupted by the start of a new frame, dropping."));return this.reset(),{payload:e.payload,extensions:e.header.extensions}}beginPartial(e,t){if(e.header.marker!==nr.Start)throw new Error("Depacketizer.beginPartial: packet.header.marker was not FrameMarker.Start, found ".concat(e.header.marker,"."));if(this.partial)if(t!=null&&t.errorOnPartialFrames){const i=this.partial.frameNumber;throw this.reset(),qo.interrupted(i,e.header.frameNumber.value)}else rC.warn("Data track frame ".concat(this.partial.frameNumber," was interrupted by the start of a new frame ").concat(e.header.frameNumber.value,", dropping."));this.reset();const r=e.header.sequence;return this.partial={frameNumber:e.header.frameNumber.value,startSequence:r,extensions:e.header.extensions,payloads:new Map([[r.value,e.payload]])},null}pushToPartial(e){if(e.header.marker!==nr.Inter&&e.header.marker!==nr.Final)throw new Error("Depacketizer.pushToPartial: packet.header.marker was not FrameMarker.Inter or FrameMarker.Final, found ".concat(e.header.marker,"."));if(!this.partial)throw this.reset(),qo.unknownFrame(e.header.frameNumber.value);if(e.header.frameNumber.value!==this.partial.frameNumber){const t=this.partial.frameNumber;throw this.reset(),qo.interrupted(t,e.header.frameNumber.value)}if(this.partial.payloads.size>=Vb.MAX_BUFFER_PACKETS){const t=this.partial.frameNumber;throw this.reset(),qo.bufferFull(t)}return this.partial.payloads.has(e.header.sequence.value)&&rC.warn("Data track frame ".concat(this.partial.frameNumber," received duplicate packet for sequence ").concat(e.header.sequence.value,", so replacing with newly received packet.")),this.partial.payloads.set(e.header.sequence.value,e.payload),e.header.marker===nr.Final?this.finalize(this.partial,e.header.sequence.value):null}finalize(e,t){const r=e.payloads.size;let i=0;for(const c of e.payloads.values())i+=c.length;const a=new Uint8Array(i);let s=e.startSequence.clone(),o=0;for(;;){const c=e.payloads.get(s.value);if(!c)break;e.payloads.delete(s.value);const u=a.length-o;if(c.length>u)throw new Error("Depacketizer.finalize: Expected at least ".concat(c.length," more bytes left in the payload buffer, only got ").concat(u," bytes."));if(a.set(c,o),o+=c.length,s.value!=t){s.increment();continue}return this.reset(),{payload:a,extensions:e.extensions}}throw this.reset(),qo.incomplete(e.frameNumber,r,t-e.startSequence.value+1)}}Vb.MAX_BUFFER_PACKETS=128;var Wd;(function(n){n[n.Unpublished=0]="Unpublished",n[n.Timeout=1]="Timeout",n[n.Disconnected=2]="Disconnected",n[n.Cancelled=4]="Cancelled"})(Wd||(Wd={}));class Oa extends wo{constructor(e,t,r){super(22,e,r),this.name="DataTrackSubscribeError",this.reason=t,this.reasonName=Wd[t]}static unpublished(){return new Oa("The track has been unpublished and is no longer available",Wd.Unpublished)}static timeout(){return new Oa("Request to subscribe to data track t
3926imed-out",Wd.Timeout)}static disconnected(){return new Oa("Cannot subscribe to data track when disconnected",Wd.Disconnected)}static cancelled(){return new Oa("Subscription to data track cancelled by caller",Wd.Cancelled)}}const iC=Ha(yi.DataTracks);class txe{constructor(e){var t;const r=e.e2eeManager!==null;if(e.info.usesE2ee!==r)throw new Error("IncomingDataTrackPipeline: DataTrackInfo.usesE2ee must match presence of decryptionProvider");const i=new Vb;this.publisherIdentity=e.publisherIdentity,this.e2eeManager=(t=e.e2eeManager)!==null&&t!==void 0?t:null,this.depacketizer=i}updateE2eeManager(e){this.e2eeManager=e}processPacket(e){return Q(this,void 0,void 0,function*(){const t=this.depacketize(e);if(!t)return null;const r=yield this.decryptIfNeeded(t);return r||null})}depacketize(e){let t;try{t=this.depacketizer.push(e)}catch(r){return iC.warn("Data frame depacketize error: ".concat(r)),null}return t}decryptIfNeeded(e){return Q(this,void 0,void 0,function*(){var t,r;const i=this.e2eeManager;if(!i)return e;const a=(r=(t=e.extensions)===null||t===void 0?void 0:t.e2ee)!==null&&r!==void 0?r:null;if(!a)return iC.error("Missing E2EE meta"),null;let s;try{s=yield i.handleEncryptedData(e.payload,a.iv,this.publisherIdentity,a.keyIndex)}catch(o){return iC.error("Error decrypting packet: ".concat(o)),null}return e.payload=s.payload,e})}}const ji=Ha(yi.DataTracks),nxe=1e4,rxe=16;class ixe extends xo.EventEmitter{constructor(e){var t;super(),this.descriptors=new Map,this.subscriptionHandles=new Map,this.e2eeManager=(t=e==null?void 0:e.e2eeManager)!==null&&t!==void 0?t:null}updateE2eeManager(e){this.e2eeManager=e;for(const t of this.descriptors.values())t.subscription.type==="active"&&t.subscription.pipeline.updateE2eeManager(e)}openSubscriptionStream(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:rxe,i=null;const a=new Ai,s=()=>{t==null||t.removeEventListener("abort",c)},o=()=>{if(s(),!i){ji.warn("ReadableStream subscribed to ".concat(e," was not started."));return}const l=this.descriptors.get(e);if(!l){ji.warn("Unknown track ".concat(e,", skipping cancel..."));return}if(l.subscription.type!=="active"){ji.warn("Subscription for track ".concat(e," is not active, skipping cancel..."));return}l.subscription.streamControllers.delete(i),l.subscription.streamControllers.size===0&&this.unSubscribeRequest(l.info.sid)},c=()=>{var l;if(!i)return;const d=this.descriptors.get(e);(d==null?void 0:d.subscription.type)==="active"&&d.subscription.streamControllers.delete(i),i.error(Oa.cancelled()),(l=a.reject)===null||l===void 0||l.call(a,Oa.cancelled()),o()};return[new ReadableStream({start:l=>{i=l,this.subscribeRequest(e,t).then(()=>Q(this,void 0,void 0,function*(){var d,h,p;const g=this.descriptors.get(e);if(!g){ji.error("Unknown track ".concat(e));const v=Oa.disconnected();l.error(v),(d=a.reject)===null||d===void 0||d.call(a,v);return}if(g.subscription.type!=="active"){ji.error("Subscription for track ".concat(e," is not active"));const v=Oa.disconnected();l.error(v),(h=a.reject)===null||h===void 0||h.call(a,v);return}if(t!=null&&t.aborted){c();return}t==null||t.addEventListener("abort",c),g.subscription.streamControllers.set(l,s),(p=a.resolve)===null||p===void 0||p.call(a)})).catch(d=>{var h;l.error(d),(h=a.reject)===null||h===void 0||h.call(a,d)})},cancel:()=>{o()}},new CountQueuingStrategy({highWaterMark:r})),a.promise]}subscribeRequest(e,t){return Q(this,void 0,void 0,function*(){const r=this.descriptors.get(e);if(!r)throw new Error("Cannot subscribe to unknown track");const i=(a,s,o)=>Q(this,void 0,void 0,function*(){if(a.subscription.type==="active")return;if(a.subscription.type!=="pending")throw new Error("Descriptor for track ".concat(e," is not pending, found ").concat(a.subscription.type));const c=M$([s,o].filter(d=>typeof d<"u")),u=new Ai;a.subscription.completionFuture.promise.then(()=>{var d;return(d=u.resolve)===null||d===void 0?void 0:d.call(u)}).catch(d=>{var h;return(h=u.reject)===null||h===void 0?void 0:h.call(u,d)});const l=()=>{var d;if(a.subscription.type==="pending"){if(a.subscription.pendingRequestCount-=1,o!=null&&o.aborted){a.subscription.cancel();return}if(a.subscription.pendingRequestCount<=0){a.subscription.cancel();return}(d=u.reject)===null||d===void 0||d.call(u,Oa.cancelled())}};c.aborted&&l(),c.addEventListener("abort",l),yield u.promise,c.removeEventListener("abort",l)});switch(r.subscription.type){case"none":{r.subscription={type:"pending",completionFuture:new Ai,pendingRequestCount:1,cancel:()=>{var s,o;const c=r.subscription;r.subscription={type:"none"}
3926,this.emit("sfuUpdateSubscription",{sid:e,subscribe:!1}),c.type==="pending"&&((o=(s=c.completionFuture).reject)===null||o===void 0||o.call(s,a.aborted?Oa.timeout():Oa.cancelled()))}},this.emit("sfuUpdateSubscription",{sid:e,subscribe:!0});const a=D$(nxe);yield i(r,t,a);return}case"pending":{r.subscription.pendingRequestCount+=1,yield i(r,t);return}case"active":return}})}querySubscribed(){return Q(this,void 0,void 0,function*(){return Array.from(this.descriptors.values()).filter(t=>t.subscription.type==="active").map(t=>[t.info,t.publisherIdentity])})}unSubscribeRequest(e){var t;const r=this.descriptors.get(e);if(!r)throw new Error("Cannot subscribe to unknown track");if(r.subscription.type!=="active"){ji.warn("Unexpected descriptor state in unSubscribeRequest, expected active, found ".concat((t=r.subscription)===null||t===void 0?void 0:t.type));return}this.closeStreamControllers(r.subscription.streamControllers,e);const i=r.subscription;r.subscription={type:"none"},this.subscriptionHandles.delete(i.subcriptionHandle),this.emit("sfuUpdateSubscription",{sid:e,subscribe:!1})}closeStreamControllers(e,t){for(const[r,i]of e){i();try{r.close()}catch(a){ji.warn("Failed to close readable stream for track ".concat(t,": ").concat(a))}}}receiveSfuPublicationUpdates(e){return Q(this,void 0,void 0,function*(){if(e.size===0)return;const t=new Map;for(const[r,i]of e.entries()){const a=new Set;for(const s of i)a.add(s.sid),!this.descriptors.has(s.sid)&&(yield this.handleTrackPublished(r,s));t.set(r,a)}for(const[r,i]of t.entries()){let s=Array.from(this.descriptors.entries()).filter(o=>{let[c,u]=o;return u.publisherIdentity===r}).map(o=>{let[c]=o;return c}).filter(o=>!i.has(o));for(const o of s)this.handleTrackUnpublished(o)}})}queryPublications(){return Q(this,void 0,void 0,function*(){return Array.from(this.descriptors.values()).map(e=>e.info)})}handleTrackPublished(e,t){return Q(this,void 0,void 0,function*(){if(this.descriptors.has(t.sid)){ji.error("Existing descriptor for track ".concat(t.sid));return}let r={info:t,publisherIdentity:e,subscription:{type:"none"}};this.descriptors.set(r.info.sid,r);const i=new B$(r.info,this,{publisherIdentity:e});this.emit("trackPublished",{track:i})})}handleTrackUnpublished(e){const t=this.descriptors.get(e);if(!t){ji.error("Unknown track ".concat(e));return}this.descriptors.delete(e),t.subscription.type==="active"&&(this.closeStreamControllers(t.subscription.streamControllers,e),this.subscriptionHandles.delete(t.subscription.subcriptionHandle)),this.emit("trackUnpublished",{sid:e,publisherIdentity:t.publisherIdentity})}receivedSfuSubscriberHandles(e){for(const[t,r]of e.entries())this.registerSubscriberHandle(t,r)}registerSubscriberHandle(e,t){var r,i;const a=this.descriptors.get(t);if(!a){ji.error("Unknown track ".concat(t));return}switch(a.subscription.type){case"none":{ji.warn("No subscription for ".concat(t));return}case"active":{a.subscription.subcriptionHandle=e,this.subscriptionHandles.set(e,t);return}case"pending":{const s=new txe({info:a.info,publisherIdentity:a.publisherIdentity,e2eeManager:this.e2eeManager}),o=a.subscription;a.subscription={type:"active",subcriptionHandle:e,pipeline:s,streamControllers:new Map},this.subscriptionHandles.set(e,t),(i=(r=o.completionFuture).resolve)===null||i===void 0||i.call(r)}}}packetReceived(e){return Q(this,void 0,void 0,function*(){let t;try{[t]=Hb.fromBinary(e)}catch(s){ji.error("Failed to deserialize packet: ".concat(s));return}const r=this.subscriptionHandles.get(t.header.trackHandle);if(!r){ji.warn("Unknown subscriber handle ".concat(t.header.trackHandle));return}const i=this.descriptors.get(r);if(!i){ji.error("Missing descriptor for track ".concat(r));return}if(i.subscription.type!=="active"){ji.warn("Received packet for track ".concat(r," without active subscription"));return}const a=yield i.subscription.pipeline.processPacket(t);if(a)for(const s of i.subscription.streamControllers.keys()){if(s.desiredSize!==null&&s.desiredSize<=0){ji.warn("Cannot send frame to subscribers: readable stream is full (desiredSize is ".concat(s.desiredSize,"). To increase this threshold, set a higher 'options.highWaterMark' when calling .subscribe()."));continue}const o=L$.lossyIntoFrame(a);s.enqueue(o)}})}resendSubscriptionUpdates(){for(const[e,t]of this.descriptors)t.subscription.type!=="none"&&this.emit
3926("sfuUpdateSubscription",{sid:e,subscribe:!0})}handleRemoteParticipantDisconnected(e){var t,r;for(const i of this.descriptors.values())if(i.publisherIdentity===e)switch(i.subscription.type){case"none":break;case"pending":(r=(t=i.subscription.completionFuture).reject)===null||r===void 0||r.call(t,Oa.disconnected());break;case"active":this.unSubscribeRequest(i.info.sid);break}}reset(){var e,t;for(const r of this.descriptors.values())this.emit("trackUnpublished",{sid:r.info.sid,publisherIdentity:r.publisherIdentity}),r.subscription.type==="pending"&&((t=(e=r.subscription.completionFuture).reject)===null||t===void 0||t.call(e,Oa.disconnected())),r.subscription.type==="active"&&this.closeStreamControllers(r.subscription.streamControllers,r.info.sid);this.descriptors.clear(),this.subscriptionHandles.clear()}}class Gb extends wo{constructor(e,t,r){super(19,e,r),this.name="DataTrackPacketizerError",this.reason=t,this.reasonName=F_[t]}static mtuTooShort(){return new Gb("MTU is too short to send frame",F_.MtuTooShort)}}var F_;(function(n){n[n.MtuTooShort=0]="MtuTooShort"})(F_||(F_={}));class mE{constructor(e,t){this.sequence=ec.u16(0),this.frameNumber=ec.u16(0),this.clock=jd.rtpStartingNow(Qh.rtpRandom()),this.handle=e,this.mtuSizeBytes=t}static computeFrameMarker(e,t){return t<=1?nr.Single:e===0?nr.Start:e===t-1?nr.Final:nr.Inter}*packetize(e,t){var r;const i=this.frameNumber.getThenIncrement(),a={marker:nr.Inter,trackHandle:this.handle,sequence:ec.u16(0),frameNumber:i,timestamp:(r=t==null?void 0:t.now)!==null&&r!==void 0?r:this.clock.now(),extensions:e.extensions},s=new Ug(a).toBinaryLengthBytes();if(s>=this.mtuSizeBytes)throw Gb.mtuTooShort();const o=this.mtuSizeBytes-s,c=Math.ceil(e.payload.byteLength/o);for(let u=0,l=0;l<e.payload.byteLength;[u,l]=[u+1,l+o]){const d=this.sequence.getThenIncrement(),h=new Ug(Object.assign(Object.assign({},a),{marker:mE.computeFrameMarker(u,c),sequence:d})),p=Math.min(o,e.payload.byteLength-l),g=new Uint8Array(e.payload.buffer,e.payload.byteOffset+l,p);yield new Hb(h,g)}}}var Bo;(function(n){n[n.NotAllowed=0]="NotAllowed",n[n.DuplicateName=1]="DuplicateName",n[n.Timeout=2]="Timeout",n[n.LimitReached=3]="LimitReached",n[n.Disconnected=4]="Disconnected",n[n.Cancelled=5]="Cancelled",n[n.InvalidName=6]="InvalidName",n[n.Unknown=7]="Unknown"})(Bo||(Bo={}));class ni extends wo{constructor(e,t,r){super(21,e,r),this.name="DataTrackPublishError",this.reason=t,this.reasonName=Bo[t],this.rawMessage=r==null?void 0:r.rawMessage}static notAllowed(e){return new ni("Data track publishing unauthorized",Bo.NotAllowed,{rawMessage:e})}static duplicateName(e){return new ni("Track name already taken",Bo.DuplicateName,{rawMessage:e})}static invalidName(e){return new ni("Track name is invalid",Bo.InvalidName,{rawMessage:e})}static timeout(){return new ni("Publish data track timed-out. Does the LiveKit server support data tracks?",Bo.Timeout)}static limitReached(e){return new ni("Data track publication limit reached",Bo.LimitReached,{rawMessage:e})}static unknown(e,t){return new ni("Received RequestResponse for publishDataTrack, but reason was unrecognised (".concat(e,", ").concat(t,")"),Bo.Unknown)}static disconnected(){return new ni("Room disconnected",Bo.Disconnected)}static cancelled(){return new ni("Publish data track cancelled by caller",Bo.Cancelled)}}var ag;(function(n){n[n.TrackUnpublished=0]="TrackUnpublished",n[n.Dropped=1]="Dropped"})(ag||(ag={}));class Ml extends wo{constructor(e,t,r){super(22,e,r),this.name="DataTrackPushFrameError",this.reason=t,this.reasonName=ag[t]}static trackUnpublished(){return new Ml("Track is no longer published",ag.TrackUnpublished)}static dropped(e){return new Ml("Frame was dropped",ag.Dropped,{cause:e})}}var sg;(function(n){n[n.Packetizer=0]="Packetizer",n[n.Encryption=1]="Encryption"})(sg||(sg={}));class jg extends wo{constructor(e,t,r){super(21,e,r),this.name="DataTrackOutgoingPipelineError",this.reason=t,this.reasonName=sg[t]}static packetizer(e){return new jg("Error packetizing frame",sg.Packetizer,{cause:e})}static encryption(e){return new jg("Error encrypting frame",sg.Encryption,{cause:e})}}
3926class Kb{constructor(e,t){this.trackSymbol=F$,this.isLocal=!0,this.typeSymbol=$$,this.handle=null,this.log=qt,this.flushedFuture=new Ai,this.isFlushed=!0,this.handleManagerReset=()=>{var r,i;(i=(r=this.flushedFuture).resolve)===null||i===void 0||i.call(r),this.manager.off("packetsFlushedChange",this.handleManagerPacketsFlushedChange),this.manager.off("reset",this.handleManagerReset)},this.handleManagerPacketsFlushedChange=r=>{var i,a;this.isFlushed=r.isFlushed,r.isFlushed&&((a=(i=this.flushedFuture).resolve)===null||a===void 0||a.call(i),this.flushedFuture=new Ai)},this.options=e,this.manager=t,this.log=Ha(yi.DataTracks),this.manager.on("packetsFlushedChange",this.handleManagerPacketsFlushedChange),this.manager.on("reset",this.handleManagerReset)}static withExplicitHandle(e,t,r){const i=new Kb(e,t);return i.handle=r,i}get info(){const e=this.descriptor;if((e==null?void 0:e.type)==="active")return e.info}get descriptor(){return this.handle?this.manager.getDescriptor(this.handle):null}publish(e){return Q(this,void 0,void 0,function*(){try{this.handle=yield this.manager.publishRequest(this.options,e)}catch(t){throw t}})}isPublished(){var e;return((e=this.descriptor)===null||e===void 0?void 0:e.type)==="active"&&this.descriptor.publishState!=="unpublished"}tryPush(e){if(!this.handle)throw Ml.trackUnpublished();const t=L$.from(e);try{return this.manager.tryProcessAndSend(this.handle,t)}catch(r){throw r}}flush(){return Q(this,void 0,void 0,function*(){if(!this.isFlushed)return this.flushedFuture.promise})}unpublish(){return Q(this,void 0,void 0,function*(){if(!this.handle){qt.warn('Data track "'.concat(this.options.name,'" is not published, so unpublishing has no effect.'));return}try{yield this.manager.unpublishRequest(this.handle)}catch(e){throw e}})}}class Yb{constructor(e){this.e2eeManager=e.e2eeManager,this.packetizer=new mE(e.info.pubHandle,Yb.TRANSPORT_MTU_BYTES)}updateE2eeManager(e){this.e2eeManager=e}processFrame(e){return G_e(this,arguments,function*(){const r=yield fp(this.encryptIfNeeded(e));try{yield fp(yield*K_e(Vo(this.packetizer.packetize(r))))}catch(i){throw i instanceof Gb?jg.packetizer(i):i}})}encryptIfNeeded(e){return Q(this,void 0,void 0,function*(){if(!this.e2eeManager)return e;let t;try{t=yield this.e2eeManager.encryptData(e.payload)}catch(r){throw jg.encryption(r)}return e.payload=t.payload,e.extensions.e2ee=new Yo(t.keyIndex,t.iv),e})}}Yb.TRANSPORT_MTU_BYTES=16e3;const Sc=Ha(yi.DataTracks),AO={pending(){return{type:"pending",completionFuture:new Ai}},active(n,e){return{type:"active",info:n,publishState:"published",pipeline:new Yb({info:n,e2eeManager:e}),unpublishingFuture:new Ai}}},axe=1e4;class gE extends xo.EventEmitter{constructor(e){var t;super(),this.handleAllocator=new t1e,this.descriptors=new Map,this.inFlightPacketCounter=new Map,this.e2eeManager=(t=e==null?void 0:e.e2eeManager)!==null&&t!==void 0?t:null}static withDescriptors(e){const t=new gE;return t.descriptors=e,t}updateE2eeManager(e){this.e2eeManager=e;for(const t of this.descriptors.values())t.type==="active"&&t.pipeline.updateE2eeManager(e)}getDescriptor(e){var t;return(t=this.descriptors.get(e))!==null&&t!==void 0?t:null}tryProcessAndSend(e,t){return Q(this,void 0,void 0,function*(){var r,i,a,s,o;const c=this.getDescriptor(e);if((c==null?void 0:c.type)!=="active"||c.publishState==="unpublished")throw Ml.trackUnpublished();if(c.publishState==="republishing")throw Ml.dropped("Data track republishing");try{try{for(var u=!0,l=Vo(c.pipeline.processFrame(t)),d;d=yield l.next(),r=d.done,!r;u=!0){s=d.value,u=!1;const h=s,p=(o=this.inFlightPacketCounter.get(e))!==null&&o!==void 0?o:0;this.inFlightPacketCounter.set(e,p+1),p===0&&this.emit("packetsFlushedChange",{handle:e,isFlushed:!1}),this.emit("packetAvailable",{handle:e,bytes:h.toBinary()})}}catch(h){i={error:h}}finally{try{!u&&!r&&(a=l.return)&&(yield a.call(l))}finally{if(i)throw i.error}}}catch(h){throw Ml.dropped(h)}})}handlePacketSendComplete(e){var t;let i=((t=this.inFlightPacketCounter.get(e))!==null&&t!==void 0?t:0)-1;i<0&&(Sc.warn("OutgoingDataTrackManager.handlePacketSendComplete: inFlightPacketCounter was decremented below 0 (got ".concat(this.inFlightPacketCounter," - resetting to 0. Were more packets send than were emitted?")),i=0),this.inFlightPacketCounter.set(e,i),i===0&&this.emit
3926("packetsFlushedChange",{handle:e,isFlushed:!0})}publishRequest(e,t){return Q(this,void 0,void 0,function*(){const r=this.handleAllocator.get();if(!r)throw ni.limitReached();const i=D$(axe),a=t?M$([t,i]):i;if(this.descriptors.has(r))throw new Error("Descriptor for handle already exists");const s=AO.pending();this.descriptors.set(r,s);const o=()=>{var c,u;const l=this.descriptors.get(r);if(!l){Sc.warn("No descriptor for ".concat(r));return}this.descriptors.delete(r),this.emit("sfuUnpublishRequest",{handle:r}),l.type==="pending"&&((u=(c=l.completionFuture).reject)===null||u===void 0||u.call(c,i.aborted?ni.timeout():ni.cancelled()))};return a.aborted?(o(),s.completionFuture.promise.then(()=>r)):(a.addEventListener("abort",o),this.emit("sfuPublishRequest",{handle:r,name:e.name,usesE2ee:this.e2eeManager!==null}),yield s.completionFuture.promise,a.removeEventListener("abort",o),this.emit("trackPublished",{track:Kb.withExplicitHandle(e,this,r)}),r)})}queryPublished(){return Array.from(this.descriptors.values()).filter(t=>t.type==="active").map(t=>t.info)}unpublishRequest(e){return Q(this,void 0,void 0,function*(){const t=this.descriptors.get(e);if(!t){Sc.warn("No descriptor for ".concat(e));return}if(t.type!=="active"){Sc.warn("Track ".concat(e," not active"));return}this.emit("sfuUnpublishRequest",{handle:e}),yield t.unpublishingFuture.promise,this.inFlightPacketCounter.delete(e),this.emit("trackUnpublished",{sid:t.info.sid})})}receivedSfuPublishResponse(e,t){var r,i,a,s;const o=this.descriptors.get(e);if(!o){Sc.warn("No descriptor for ".concat(e));return}switch(this.descriptors.delete(e),o.type){case"pending":{if(t.type==="ok"){const c=t.data,u=c.usesE2ee?this.e2eeManager:null;this.descriptors.set(c.pubHandle,AO.active(c,u)),(i=(r=o.completionFuture).resolve)===null||i===void 0||i.call(r)}else(s=(a=o.completionFuture).reject)===null||s===void 0||s.call(a,t.error);return}case"active":{if(o.publishState!=="republishing"){Sc.warn("Track ".concat(e," already active"));return}if(t.type==="error"){Sc.warn("Republish failed for track ".concat(e));return}Sc.debug("Track ".concat(e," republished")),o.info.sid=t.data.sid,o.publishState="published",this.descriptors.set(o.info.pubHandle,o)}}}receivedSfuUnpublishResponse(e){var t,r;const i=this.descriptors.get(e);if(!i){Sc.warn("No descriptor for ".concat(e));return}if(this.descriptors.delete(e),i.type!=="active"){Sc.warn("Track ".concat(e," not active"));return}i.publishState="unpublished",(r=(t=i.unpublishingFuture).resolve)===null||r===void 0||r.call(t)}sfuWillRepublishTracks(){var e,t;for(const[r,i]of this.descriptors.entries())switch(i.type){case"pending":this.descriptors.delete(r),(t=(e=i.completionFuture).reject)===null||t===void 0||t.call(e,ni.disconnected());break;case"active":i.publishState="republishing",this.emit("sfuPublishRequest",{handle:i.info.pubHandle,name:i.info.name,usesE2ee:i.info.usesE2ee})}}reset(){return Q(this,void 0,void 0,function*(){var e,t,r,i;this.handleAllocator.reset();for(const a of this.descriptors.values())switch(a.type){case"pending":(t=(e=a.completionFuture).reject)===null||t===void 0||t.call(e,ni.disconnected());break;case"active":(i=(r=a.unpublishingFuture).resolve)===null||i===void 0||i.call(r),yield this.unpublishRequest(a.info.pubHandle);break}this.descriptors.clear(),this.inFlightPacketCounter.clear(),this.emit("reset")})}}class U$ extends Ae{constructor(e,t,r,i,a){super(e,r,a),this.sid=t,this.receiver=i}get isLocal(){return!1}setMuted(e){this.isMuted!==e&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?We.Muted:We.Unmuted,this))}setMediaStream(e){this.mediaStream=e;const t=r=>{r.track===this._mediaStreamTrack&&(e.removeEventListener("removetrack",t),this.receiver&&"playoutDelayHint"in this.receiver&&(this.receiver.playoutDelayHint=void 0),this.receiver=void 0,this._currentBitrate=0,this.emit(We.Ended,this))};e.addEventListener("removetrack",t)}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}getRTCStatsReport(){return Q(this,void 0,void 0,function*(){var e;return!((e=this.receiver)===null||e===void 0)&&e.getStats?yield this.receiver.getStats():void 0})}setPlayoutDelay(e){this.receiver?"playoutDelayHint"in this.receiver?this.receiver.playoutDelayHint=e:this.log.warn("Playout delay not supported in this browser"):this.log.warn("Cannot set playout delay, track already ended")}getPlayoutDelay(){if(this.receiver){if("playoutDelayHint"in this.receiver)return this.receiver.playoutDelayHint;this.log.warn("Playout delay not supported in this browser")}else this.log.warn("Cannot get playout delay, track already ended");return 0}startMonitor(){this.monitorInterval||(this.monitorInterval=setInterval(()=>this.monitorReceiver(),hE)),vbe()&&this.registerTimeSyncUpdate()}registerTimeSyncUpdate(){const e=()=>{var t;this.timeSyncHandle=requestAnimationFrame(()=>e());const r=(t=this.receiver)===null||t===void 0?void 0:t.getSynchronizationSources()[0];if(r){const{timestamp:i,rtpTimestamp:a}=r;
vendor: 19,874 bytes, line 3926
3926a&&this.rtpTimestamp!==a&&(this.emit(We.TimeSyncUpdate,{timestamp:i,rtpTimestamp:a}),this.rtpTimestamp=a)}};e()}}class sxe extends U${constructor(e,t,r,i,a,s){super(e,t,Ae.Kind.Audio,r,s),this.monitorReceiver=()=>Q(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const o=yield this.getReceiverStats();o&&this.prevStats&&this.receiver&&(this._currentBitrate=zb(o,this.prevStats)),this.prevStats=o}),this.audioContext=i,this.webAudioPluginNodes=[],a&&(this.sinkId=a.deviceId)}setVolume(e){var t;for(const r of this.attachedElements)this.audioContext?(t=this.gainNode)===null||t===void 0||t.gain.setTargetAtTime(e,0,.1):r.volume=e;Qc()&&this._mediaStreamTrack._setVolume(e),this.elementVolume=e}getVolume(){if(this.elementVolume)return this.elementVolume;if(Qc())return 1;let e=0;return this.attachedElements.forEach(t=>{t.volume>e&&(e=t.volume)}),e}setSinkId(e){return Q(this,void 0,void 0,function*(){this.sinkId=e,yield Promise.all(this.attachedElements.map(t=>{if(Vk(t))return t.setSinkId(e)}))})}attach(e){const t=this.attachedElements.length===0;return e?super.attach(e):e=super.attach(),this.sinkId&&Vk(e)&&e.setSinkId(this.sinkId).catch(r=>{this.log.error("Failed to set sink id on remote audio track",r,this.logContext)}),this.audioContext&&t&&(this.log.debug("using audio context mapping",this.logContext),this.connectWebAudio(this.audioContext,e),e.volume=0,e.muted=!0),this.elementVolume&&this.setVolume(this.elementVolume),e}detach(e){let t;return e?(t=super.detach(e),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(t=super.detach(),this.disconnectWebAudio()),t}setAudioContext(e){this.audioContext=e,e&&this.attachedElements.length>0?this.connectWebAudio(e,this.attachedElements[0]):e||this.disconnectWebAudio()}setWebAudioPlugins(e){this.webAudioPluginNodes=e,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}connectWebAudio(e,t){this.disconnectWebAudio(),this.sourceNode=e.createMediaStreamSource(t.srcObject);let r=this.sourceNode;this.webAudioPluginNodes.forEach(i=>{r.connect(i),r=i}),this.gainNode=e.createGain(),r.connect(this.gainNode),this.gainNode.connect(e.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),e.state!=="running"&&e.resume().then(()=>{e.state!=="running"&&this.emit(We.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))}).catch(i=>{this.emit(We.AudioPlaybackFailed,i)})}disconnectWebAudio(){var e,t;(e=this.gainNode)===null||e===void 0||e.disconnect(),(t=this.sourceNode)===null||t===void 0||t.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}getReceiverStats(){return Q(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let t;return e.forEach(r=>{r.type==="inbound-rtp"&&(t={type:"audio",streamId:r.id,timestamp:r.timestamp,jitter:r.jitter,bytesReceived:r.bytesReceived,concealedSamples:r.concealedSamples,concealmentEvents:r.concealmentEvents,silentConcealedSamples:r.silentConcealedSamples,silentConcealmentEvents:r.silentConcealmentEvents,totalAudioEnergy:r.totalAudioEnergy,totalSamplesDuration:r.totalSamplesDuration})}),t})}}const aC=100;class oxe extends U${constructor(e,t,r,i,a){super(e,t,Ae.Kind.Video,r,a),this.elementInfos=[],this.monitorReceiver=()=>Q(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const s=yield this.getReceiverStats();s&&this.prevStats&&this.receiver&&(this._currentBitrate=zb(s,this.prevStats)),this.prevStats=s}),this.debouncedHandleResize=uE(()=>{this.updateDimensions()},aC),this.adaptiveStreamSettings=i}get isAdaptiveStream(){return this.adaptiveStreamSettings!==void 0}setStreamState(e){super.setStreamState(e),this.log.debug("setStreamState",e),this.isAdaptiveStream&&e===Ae.StreamState.Active&&this.updateVisibility()}get mediaStreamTrack(){return this._mediaStreamTrack}setMuted(e){super.setMuted(e),this.attachedElements.forEach(t=>{e?Yh(this._mediaStreamTrack,t):Ph(this._mediaStreamTrack,t)})}attach(e){if(e?super.attach(e):e=super.attach(),this.adaptiveStreamSettings&&this.elementInfos.find(t=>t.element===e)===void 0){const t=new cxe(e);this.observeElementInfo(t)}return e}observeElementInfo(e){this.adaptiveStreamSettings&&this.elementInfos.find(t=>t===e)===void 0?(e.handleResize=()=>{this.debouncedHandleResize()},e.handleVisibilityChanged=()=>{this.updateVisibility()},this.elementInfos.push(e),e.observe(),this.debouncedHandleResize(),this.updateVisibility()):this.log.warn("visibility resize observer not triggered",this.logContext)}stopObservingElementInfo(e){if(!this.isAdaptiveStream){this.log.warn("stopObservingElementInfo ignored",this.logContext);return}const t=this.elementInfos.filter(r=>r===e);for(const r of t)r.stopObserving();this.elementInfos=this.elementInfos.filter(r=>r!==e),this.updateVisibility(),this.debouncedHandleResize()}detach(e){let t=[];if(e)return this.stopObservingElement(e),super.detach(e);t=super.detach();for(const r of t)this.stopObservingElement(r);return t}getDecoderImplementation(){var e;return(e=this.prevStats)===null||e===void 0?void 0:e.decoderImplementation}getReceiverStats(){return Q(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let t,r="",i=new Map;return e.forEach(a=>{a.type==="inbound-rtp"?(r=a.codecId,t={type:"video",streamId:a.id,framesDecoded:a.framesDecoded,framesDropped:a.framesDropped,framesReceived:a.framesReceived,packetsReceived:a.packetsReceived,packetsLost:a.packetsLost,frameWidth:a.frameWidth,frameHeight:a.frameHeight,pliCount:a.pliCount,firCount:a.firCount,nackCount:a.nackCount,jitter:a.jitter,timestamp:a.timestamp,bytesReceived:a.bytesReceived,decoderImplementation:a.decoderImplementation}):a.type==="codec"&&i.set(a.id,a)}),t&&r!==""&&i.get(r)&&(t.mimeType=i.get(r).mimeType),t})}stopObservingElement(e){const t=this.elementInfos.filter(r=>r.element===e);for(const r of t)this.stopObservingElementInfo(r)}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Q(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),this.isAdaptiveStream&&this.updateVisibility()})}updateVisibility(e){var t,r;const i=this.elementInfos.reduce((c,u)=>Math.max(c,u.visibilityChangedAt||0),0),a=!((r=(t=this.adaptiveStreamSettings)===null||t===void 0?void 0:t.pauseVideoInBackground)!==null&&r!==void 0)||r?this.isInBackground:!1,s=this.elementInfos.some(c=>c.pictureInPicture),o=this.elementInfos.some(c=>c.visible)&&!a||s;if(!(this.lastVisible===o&&!e)){if(!o&&Date.now()-i<aC){Vr.setTimeout(()=>{this.updateVisibility()},aC);return}this.lastVisible=o,this.emit(We.VisibilityChanged,o,this)}}updateDimensions(){var e,t;let r=0,i=0;const a=this.getPixelDensity();for(const s of this.elementInfos){const o=s.width()*a,c=s.height()*a;o+c>r+i&&(r=o,i=c)}((e=this.lastDimensions)===null||e===void 0?void 0:e.width)===r&&((t=this.lastDimensions)===null||t===void 0?void 0:t.height)===i||(this.lastDimensions={width:r,height:i},this.emit(We.VideoDimensionsChanged,this.lastDimensions,this))}getPixelDensity(){var e;const t=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pixelDensity;return t==="screen"?VI():t||(VI()>2?2:1)}}class cxe{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(e,t){this.onVisibilityChanged=r=>{var i;const{target:a,isIntersecting:s}=r;a===this.element&&(this.isIntersecting=s,this.isPiP=Pm(this.element),this.visibilityChangedAt=Date.now(),(i=this.handleVisibilityChanged)===null||i===void 0||i.call(this))},this.onEnterPiP=()=>{var r,i;(i=(r=window.documentPictureInPicture)===null||r===void 0?void 0:r.window)===null||i===void 0||i.addEventListener("pagehide",this.onLeavePiP),queueMicrotask(()=>{requestAnimationFrame(()=>{var a;this.isPiP=Pm(this.element),(a=this.handleVisibilityChanged)===null||a===void 0||a.call(this)})})},this.onLeavePiP=()=>{var r;this.isPiP=Pm(this.element),(r=this.handleVisibilityChanged)===null||r===void 0||r.call(this)},this.element=e,this.isIntersecting=t??Zk(e),this.isPiP=Fa()&&Pm(e),this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){var e,t,r;this.isIntersecting=Zk(this.element),this.isPiP=Pm(this.element),this.element.handleResize=()=>{var i;(i=this.handleResize)===null||i===void 0||i.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,KI().observe(this.element),GI().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP),(e=window.documentPictureInPicture)===null||e===void 0||e.addEventListener("enter",this.onEnterPiP),(r=(t=window.documentPictureInPicture)===null||t===void 0?void 0:t.window)===null||r===void 0||r.addEventListener("pagehide",this.onLeavePiP)}stopObserving(){var e,t,r,i,a;(e=KI())===null||e===void 0||e.unobserve(this.element),(t=GI())===null||t===void 0||t.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP),(r=window.documentPictureInPicture)===null||r===void 0||r.removeEventListener("enter",this.onEnterPiP),(a=(i=window.documentPictureInPicture)===null||i===void 0?void 0:i.window)===null||a===void 0||a.removeEventListener("pagehide",this.onLeavePiP)}}function Pm(n){var e,t;return document.pictureInPictureElement===n?!0:!((e=window.documentPictureInPicture)===null||e===void 0)&&e.window?Zk(n,(t=window.documentPictureInPicture)===null||t===void 0?void 0:t.window):!1}function Zk(n,e){const t=e||window;let r=n.offsetTop,i=n.offsetLeft;const a=n.offsetWidth,s=n.offsetHeight,{hidden:o}=n,{display:c}=getComputedStyle(n);for(;n.offsetParent;)n=n.offsetParent,r+=n.offsetTop,i+=n.offsetLeft;return r<t.pageYOffset+t.innerHeight&&i<t.pageXOffset+t.innerWidth&&r+s>t.pageYOffset&&i+a>t.pageXOffset&&!o&&c!=="none"}class Lu extends xo.EventEmitter{constructor(e,t,r,i){var a;super(),this.metadataMuted=!1,this.encryption=Bn.NONE,this.log=qt,this.handleMuted=()=>{this.emit(We.Muted)},this.handleUnmuted=()=>{this.emit(We.Unmuted)},this.log=Ha((a=i==null?void 0:i.loggerName)!==null&&a!==void 0?a:yi.Publication),this.loggerContextCb=this.loggerContextCb,this.setMaxListeners(100),this.kind=e,this.trackSid=t,this.trackName=r,this.source=Ae.Source.Unknown}setTrack(e){this.track&&(this.track.off(We.Muted,this.handleMuted),this.track.off(We.Unmuted,this.handleUnmuted)),this.track=e,e&&(e.on(We.Muted,this.handleMuted),e.on(We.Unmuted,this.handleUnmuted))}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),en(this))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return this.track!==void 0}get isEncrypted(){return this.encryption!==Bn.NONE}get audioTrack(){if(Yc(this.track))return this.track}get videoTrack(){if(hd(this.track))return this.track}updateInfo(e){this.trackSid=e.sid,this.trackName=e.name,this.source=Ae.sourceFromProto(e.source),this.mimeType=e.mimeType,this.kind===Ae.Kind.Video&&e.width>0&&(this.dimensions={width:e.width,height:e.height},this.simulcasted=e.simulcast),this.encryption=e.encryption,this.trackInfo=e,this.log.debug("update publication info",Object.assign(Object.assign({},this.logContext),{info:e}))}}(function(n){(function(e){e.Desired="desired",e.Subscribed="subscribed",e.Unsubscribed="unsubscribed"})(n.SubscriptionStatus||(n.SubscriptionStatus={})),function(e){e.Allowed="allowed",e.NotAllowed="not_allowed"}(n.PermissionStatus||(n.PermissionStatus={}))})(Lu||(Lu={}));class e2 extends Lu{get isUpstreamPaused(){var e;return(e=this.track)===null||e===void 0?void 0:e.isUpstreamPaused}constructor(e,t,r,i){super(e,t.sid,t.name,i),this.track=void 0,this.handleTrackEnded=()=>{this.emit(We.Ended)},this.handleCpuConstrained=()=>{this.track&&hd(this.track)&&this.emit(We.CpuConstrained,this.track)},this.updateInfo(t),this.setTrack(r)}setTrack(e){this.track&&(this.track.off(We.Ended,this.handleTrackEnded),this.track.off(We.CpuConstrained,this.handleCpuConstrained)),super.setTrack(e),e&&(e.on(We.Ended,this.handleTrackEnded),e.on(We.CpuConstrained,this.handleCpuConstrained))}get isMuted(){return this.track?this.track.isMuted:super.isMuted}get audioTrack(){return super.audioTrack}get videoTrack(){return super.videoTrack}get isLocal(){return!0}mute(){return Q(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.mute()})}unmute(){return Q(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.unmute()})}pauseUpstream(){return Q(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.pauseUpstream()})}resumeUpstream(){return Q(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.resumeUpstream()})}getTrackFeatures(){var e;if(Yc(this.track)){const t=this.track.getSourceTrackSettings(),r=new Set;return t.autoGainControl&&r.add(hi.TF_AUTO_GAIN_CONTROL),t.echoCancellation&&r.add(hi.TF_ECHO_CANCELLATION),t.noiseSuppression&&r.add(hi.TF_NOISE_SUPPRESSION),t.channelCount&&t.channelCount>1&&r.add(hi.TF_STEREO),!((e=this.options)===null||e===void 0)&&e.dtx||r.add(hi.TF_NO_DTX),this.track.enhancedNoiseCancellation&&r.add(hi.TF_ENHANCED_NOISE_CANCELLATION),Array.from(r.values())}else return[]}}function Xb(n,e){return Q(this,void 0,void 0,function*(){n??(n={});let t=!1;const{audioProcessor:r,videoProcessor:i,optionsWithoutProcessor:a}=y$(n);let s=a.audio,o=a.video;if(r&&typeof a.audio=="object"&&(a.audio.processor=r),i&&typeof a.video=="object"&&(a.video.processor=i),n.audio&&typeof a.audio=="object"&&typeof a.audio.deviceId=="string"){const d=a.audio.deviceId;a.audio.deviceId={exact:d},t=!0,s=Object.assign(Object.assign({},a.audio),{deviceId:{ideal:d}})}if(a.video&&typeof a.video=="object"&&typeof a.video.deviceId=="string"){const d=a.video.deviceId;a.video.deviceId={exact:d},t=!0,o=Object.assign(Object.assign({},a.video),{deviceId:{ideal:d}})}a.audio===!0?a.audio={deviceId:"default"}:typeof a.audio=="object"&&a.audio!==null&&(a.audio=Object.assign(Object.assign({},a.audio),{deviceId:a.audio.deviceId||"default"})),a.video===!0?a.video={deviceId:"default"}:typeof a.video=="object"&&!a.video.deviceId&&(a.video.deviceId="default");const c=m$(a,k$,S$),u=rE(c),l=navigator.mediaDevices.getUserMedia(u);a.audio&&(pi.userMediaPromiseMap.set("audioinput",l),l.catch(()=>pi.userMediaPromiseMap.delete("audioinput"))),a.video&&(pi.userMediaPromiseMap.set("videoinput",l),l.catch(()=>pi.userMediaPromiseMap.delete("videoinput")));try{const d=yield l;return yield Promise.all(d.getTracks().map(h=>Q(this,void 0,void 0,function*(){const p=h.kind==="audio";let g=p?c.audio:c.video;(typeof g=="boolean"||!g)&&(g={});let v;const y=p?u.audio:u.video;typeof y!="boolean"&&(v=y);const b=h.getSettings().deviceId;v!=null&&v.deviceId&&af(v.deviceId)!==b?v.deviceId=b:v||(v={deviceId:b});const x=k1e(h,v,e);return x.kind===Ae.Kind.Video?x.source=Ae.Source.Camera:x.kind===Ae.Kind.Audio&&(x.source=Ae.Source.Microphone),x.mediaStream=d,Yc(x)&&r?yield x.setProcessor(r):hd(x)&&i&&(yield x.setProcessor(i)),x})))}catch(d){if(!t)throw d;return Xb(Object.assign(Object.assign({},n),{audio:s,video:o}),e)}})}function uxe(n){return Q(this,void 0,void 0,function*(){return(yield Xb({audio:!1,video:!0}))[0]})}function lxe(n){return Q(this,void 0,void 0,function*(){return(yield Xb({audio:!0,video:!1}))[0]})}var co;(function(n){n.Excellent="excellent",n.Good="good",n.Poor="poor",n.Lost="lost",n.Unknown="unknown"})(co||(co={}));function dxe(n){switch(n){case Fm.EXCELLENT:return co.Excellent;case Fm.GOOD:return co.Good;case Fm.POOR:return co.Poor;case Fm.LOST:return co.Lost;default:return co.Unknown}}class j$ extends xo.EventEmitter{get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions)===null||e===void 0?void 0:e.loggerContextCb)===null||t===void 0?void 0:t.call(e))}get isEncrypted(){return this.trackPublications.size>0&&Array.from(this.trackPublications.values()).every(e=>e.isEncrypted)}get isAgent(){var e;return((e=this.permissions)===null||e===void 0?void 0:e.agent)||this.kind===Mg.AGENT}get isActive(){var e;return((e=this.participantInfo)===null||e===void 0?void 0:e.state)===Vh.ACTIVE}get kind(){return this._kind}get attributes(){return Object.freeze(Object.assign({},this._attributes))}constructor(e,t,r,i,a,s){let o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:Mg.STANDARD;var c;super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=co.Unknown,this.log=qt,this.loggerOptions=s,this.log=Ha((c=s==null?void 0:s.loggerName)!==null&&c!==void 0?c:yi.Participant,()=>this.logContext),this.setMaxListeners(100),this.sid=e,this.identity=t,this.name=r,this.metadata=i,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this._kind=o,this._attributes=a??{}}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(e){for(const[,t]of this.trackPublications)if(t.source===e)return t}getTrackPublicationByName(e){for(const[,t]of this.trackPublications)if(t.trackName===e)return t}waitUntilActive(){return this.isActive?Promise.resolve():this.activeFuture?this.activeFuture.promise:(this.activeFuture=new Ai,this.once(Ve.Active,()=>{var e,t;(t=(e=this.activeFuture)===null||e===void 0?void 0:e.resolve)===null||t===void 0||t.call(e),this.activeFuture=void 0}),this.activeFuture.promise)}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var e;const t=this.getTrackPublication(Ae.Source.Camera);return!(!((e=t==null?void 0:t.isMuted)!==null&&e!==void 0)||e)}get isMicrophoneEnabled(){var e;const t=this.getTrackPublication(Ae.Source.Microphone);return!(!((e=t==null?void 0:t.isMuted)!==null&&e!==void 0)||e)}get isScreenShareEnabled(){return!!this.getTrackPublication(Ae.Source.ScreenShare)}get isLocal(){return!1}get joinedAt(){return this.participantInfo?new Date(Number.parseInt(this.participantInfo.joinedAt.toString())*1e3):new Date}updateInfo(e){var t;return this.participantInfo&&this.participantInfo.sid===e.sid&&this.participantInfo.version>e.version?!1:(this.identity=e.identity,this.sid=e.sid,this._setName(e.name),this._setMetadata(e.metadata),this._setAttributes(e.attributes),e.state===Vh.ACTIVE&&((t=this.participantInfo)===null||t===void 0?void 0:t.state)!==Vh.ACTIVE&&this.emit(Ve.Active),e.permission&&this.setPermissions(e.permission),this.participantInfo=e,!0)}_setMetadata(e){const t=this.metadata!==e,r=this.metadata;this.metadata=e,t&&this.emit(Ve.ParticipantMetadataChanged,r)}_setName(e){const t=this.name!==e;this.name=e,t&&this.emit(Ve.ParticipantNameChanged,e)}_setAttributes(e){const t=ybe(this.attributes,e);this._attributes=e,Object.keys(t).length>0&&this.emit(Ve.AttributesChanged,t)}setPermissions(e){var t,r,i,a,s,o;const c=this.permissions,u=e.canPublish!==((t=this.permissions)===null||t===void 0?void 0:t.canPublish)||e.canSubscribe!==((r=this.permissions)===null||r===void 0?void 0:r.canSubscribe)||e.canPublishData!==((i=this.permissions)===null||i===void 0?void 0:i.canPublishData)||e.hidden!==((a=this.permissions)===null||a===void 0?void 0:a.hidden)||e.recorder!==((s=this.permissions)===null||s===void 0?void 0:s.recorder)||e.canPublishSources.length!==this.permissions.canPublishSources.length||e.canPublishSources.some((l,d)=>{var h;return l!==((h=this.permissions)===null||h===void 0?void 0:h.canPublishSources[d])})||e.canSubscribeMetrics!==((o=this.permissions)===null||o===void 0?void 0:o.canSubscribeMetrics);
3926return this.permissions=e,u&&this.emit(Ve.ParticipantPermissionsChanged,c),u}setIsSpeaking(e){e!==this.isSpeaking&&(this.isSpeaking=e,e&&(this.lastSpokeAt=new Date),this.emit(Ve.IsSpeakingChanged,e))}setConnectionQuality(e){const t=this._connectionQuality;this._connectionQuality=dxe(e),t!==this._connectionQuality&&this.emit(Ve.ConnectionQualityChanged,this._connectionQuality)}setDisconnected(){var e,t;this.activeFuture&&((t=(e=this.activeFuture).reject)===null||t===void 0||t.call(e,new Error("Participant disconnected")),this.activeFuture=void 0)}setAudioContext(e){this.audioContext=e,this.audioTrackPublications.forEach(t=>Yc(t.track)&&t.track.setAudioContext(e))}addTrackPublication(e){e.on(We.Muted,()=>{this.emit(Ve.TrackMuted,e)}),e.on(We.Unmuted,()=>{this.emit(Ve.TrackUnmuted,e)});const t=e;switch(t.track&&(t.track.sid=e.trackSid),this.trackPublications.set(e.trackSid,e),e.kind){case Ae.Kind.Audio:this.audioTrackPublications.set(e.trackSid,e);break;case Ae.Kind.Video:this.videoTrackPublications.set(e.trackSid,e);break}}}function fxe(n){var e,t,r;if(!n.participantSid&&!n.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new R6({participantIdentity:(e=n.participantIdentity)!==null&&e!==void 0?e:"",participantSid:(t=n.participantSid)!==null&&t!==void 0?t:"",allTracks:(r=n.allowAll)!==null&&r!==void 0?r:!1,trackSids:n.allowedTrackSids||[]})}class hxe extends j${constructor(e,t,r,i,a,s,o){super(e,t,void 0,void 0,void 0,{loggerName:i.loggerName,loggerContextCb:()=>this.engine.logContext}),this.pendingPublishing=new Set,this.pendingPublishPromises=new Map,this.participantTrackPermissions=[],this.allParticipantsAllowedToSubscribe=!0,this.encryptionType=Bn.NONE,this.e2eeStateMutex=new Ii,this.enabledPublishVideoCodecs=[],this.pendingAcks=new Map,this.pendingResponses=new Map,this.handleReconnecting=()=>{this.reconnectFuture||(this.reconnectFuture=new Ai)},this.handleReconnected=()=>{var c,u;(u=(c=this.reconnectFuture)===null||c===void 0?void 0:c.resolve)===null||u===void 0||u.call(c),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleClosing=()=>{var c,u,l,d,h,p;this.reconnectFuture&&(this.reconnectFuture.promise.catch(g=>this.log.warn(g.message)),(u=(c=this.reconnectFuture)===null||c===void 0?void 0:c.reject)===null||u===void 0||u.call(c,new Error("Got disconnected during reconnection attempt")),this.reconnectFuture=void 0),this.signalConnectedFuture&&((d=(l=this.signalConnectedFuture).reject)===null||d===void 0||d.call(l,new Error("Got disconnected without signal connected")),this.signalConnectedFuture=void 0),(p=(h=this.activeAgentFuture)===null||h===void 0?void 0:h.reject)===null||p===void 0||p.call(h,new Error("Got disconnected without active agent present")),this.activeAgentFuture=void 0,this.firstActiveAgent=void 0},this.handleSignalConnected=c=>{var u,l;c.participant&&this.updateInfo(c.participant),this.signalConnectedFuture||(this.signalConnectedFuture=new Ai),(l=(u=this.signalConnectedFuture).resolve)===null||l===void 0||l.call(u)},this.handleSignalRequestResponse=c=>{const{requestId:u,reason:l,message:d}=c,h=this.pendingSignalRequests.get(u);switch(h&&(l!==Ud.OK&&h.reject(new jI(d,l)),this.pendingSignalRequests.delete(u)),c.request.case){case"publishDataTrack":{let p;switch(c.reason){case Ud.NOT_ALLOWED:p=ni.notAllowed(c.message);break;case Ud.DUPLICATE_NAME:p=ni.duplicateName(c.message);break;case Ud.INVALID_NAME:p=ni.invalidName(c.message);break;case Ud.LIMIT_EXCEEDED:p=ni.limitReached(c.message);break;default:p=ni.unknown(c.reason,c.message);return}this.roomOutgoingDataTrackManager.receivedSfuPublishResponse(c.request.value.pubHandle,{type:"error",error:p});break}}},this.handleDataPacket=c=>{switch(c.value.case){case"rpcResponse":let u=c.value.value,l=null,d=null;u.value.case==="payload"?l=u.value.value:u.value.case==="error"&&(d=kr.fromProto(u.value.value)),this.handleIncomingRpcResponse(u.requestId,l,d);break;case"rpcAck":let h=c.value.value;this.handleIncomingRpcAck(h.requestId);break}},this.updateTrackSubscriptionPermissions=()=>{this.log.debug("updating track subscription permissions",{allParticipantsAllowed:this.allParticipantsAllowedToSubscribe,participantTrackPermissions:this.participantTrackPermissions}),this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe,this.participantTrackPermissions.map(c=>fxe(c)))},this.onTrackUnmuted=c=>{this.onTrackMuted(c,c.isUpstreamPaused)},this.onTrackMuted=(c,u)=>{if(u===void 0&&(u=!0),!c.sid){this.log.error("could not update mute status for unpublished track",en(c));return}this.engine.updateMuteStatus(c.sid,u)},this.onTrackUpstreamPaused=c=>{this.log.debug("upstream paused",en(c)),this.onTrackMuted(c,!0)},this.onTrackUpstreamResumed=c=>{this.log.debug("upstream resumed",en(c)),this.onTrackMuted(c,c.isMuted)},this.onTrackFeatureUpdate=c=>{const u=this.audioTrackPublications.get(c.sid);if(!u){this.log.warn("Could not update local audio track settings, missing publication for track ".concat(c.sid));return}this.engine.client.sendUpdateLocalAudioTrack(u.trackSid,u.getTrackFeatures())},this.onTrackCpuConstrained=(c,u)=>
vendor: 4,212 bytes, line 3926
3926{this.log.debug("track cpu constrained",en(u)),this.emit(Ve.LocalTrackCpuConstrained,c,u)},this.handleSubscribedQualityUpdate=c=>Q(this,void 0,void 0,function*(){var u,l,d,h,p;if(!(!((p=this.roomOptions)===null||p===void 0)&&p.dynacast))return;const g=this.videoTrackPublications.get(c.trackSid);if(!g){this.log.warn("received subscribed quality update for unknown track",{trackSid:c.trackSid});return}if(!g.videoTrack)return;const v=yield g.videoTrack.setPublishingCodecs(c.subscribedCodecs);try{for(var y=!0,b=Vo(v),x;x=yield b.next(),u=x.done,!u;y=!0){h=x.value,y=!1;const S=h;hbe(S)&&(this.log.debug("publish ".concat(S," for ").concat(g.videoTrack.sid),en(g)),yield this.publishAdditionalCodecForTrack(g.videoTrack,S,g.options))}}catch(S){l={error:S}}finally{try{!y&&!u&&(d=b.return)&&(yield d.call(b))}finally{if(l)throw l.error}}}),this.handleLocalTrackUnpublished=c=>{const u=this.trackPublications.get(c.trackSid);if(!u){this.log.warn("received unpublished event for unknown track",{trackSid:c.trackSid});return}this.unpublishTrack(u.track)},this.handleTrackEnded=c=>Q(this,void 0,void 0,function*(){if(c.source===Ae.Source.ScreenShare||c.source===Ae.Source.ScreenShareAudio)this.log.debug("unpublishing local track due to TrackEnded",en(c)),this.unpublishTrack(c);else if(c.isUserProvided)yield c.mute();else if(Iu(c)||Pu(c))try{if(Fa())try{const u=yield navigator==null?void 0:navigator.permissions.query({name:c.source===Ae.Source.Camera?"camera":"microphone"});if(u&&u.state==="denied")throw this.log.warn("user has revoked access to ".concat(c.source),en(c)),u.onchange=()=>{u.state!=="denied"&&(c.isMuted||c.restartTrack(),u.onchange=null)},new Error("GetUserMedia Permission denied")}catch{}c.isMuted||(this.log.debug("track ended, attempting to use a different device",en(c)),Iu(c)?yield c.restartTrack({deviceId:"default"}):yield c.restartTrack())}catch{this.log.warn("could not restart track, muting instead",en(c)),yield c.mute()}}),this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this.engine=r,this.roomOptions=i,this.setupEngine(r),this.activeDeviceMap=new Map([["audioinput","default"],["videoinput","default"],["audiooutput","default"]]),this.pendingSignalRequests=new Map,this.rpcHandlers=a,this.roomOutgoingDataStreamManager=s,this.roomOutgoingDataTrackManager=o}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}get isE2EEEnabled(){return this.encryptionType!==Bn.NONE}getTrackPublication(e){const t=super.getTrackPublication(e);if(t)return t}getTrackPublicationByName(e){const t=super.getTrackPublicationByName(e);if(t)return t}setupEngine(e){var t;this.engine=e,this.engine.on(Ue.RemoteMute,(r,i)=>{const a=this.trackPublications.get(r);!a||!a.track||(i?a.mute():a.unmute())}),!((t=this.signalConnectedFuture)===null||t===void 0)&&t.isResolved&&(this.signalConnectedFuture=void 0),this.engine.on(Ue.Connected,this.handleReconnected).on(Ue.SignalConnected,this.handleSignalConnected).on(Ue.SignalRestarted,this.handleReconnected).on(Ue.SignalResumed,this.handleReconnected).on(Ue.Restarting,this.handleReconnecting).on(Ue.Resuming,this.handleReconnecting).on(Ue.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(Ue.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(Ue.Closing,this.handleClosing).on(Ue.SignalRequestResponse,this.handleSignalRequestResponse).on(Ue.DataPacketReceived,this.handleDataPacket)}setMetadata(e){return Q(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({metadata:e})})}setName(e){return Q(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({name:e})})}setAttributes(e){return Q(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({attributes:e})})}requestMetadataUpdate(e){return Q(this,arguments,void 0,function(t){var r=this;let{metadata:i,name:a,attributes:s}=t;return function*(){return new Yi((o,c)=>Q(r,void 0,void 0,function*(){var u,l;try{let d=!1;const h=yield this.engine.client.sendUpdateLocalMetadata((u=i??this.metadata)!==null&&u!==void 0?u:"",(l=a??this.name)!==null&&l!==void 0?l:"",s),p=performance.now();for(this.pendingSignalRequests.set(h,{resolve:o,reject:g=>{c(g),d=!0}
3926,values:{name:a,metadata:i,attributes:s}});performance.now()-p<5e3&&!d;){if((!a||this.name===a)&&(!i||this.metadata===i)&&(!s||Object.entries(s).every(g=>{let[v,y]=g;return this.attributes[v]===y||y===""&&!this.attributes[v]}))){this.pendingSignalRequests.delete(h),o();return}yield Ji(50)}c(new jI("Request to update local metadata timed out","TimeoutError"))}catch(d){d instanceof Error?c(d):c(new Error(String(d)))}}))}()})}setCameraEnabled(e,t,r){return this.setTrackEnabled(Ae.Source.Camera,e,t,r)}setMicrophoneEnabled(e,t,r){return this.setTrackEnabled(Ae.Source.Microphone,e,t,r)}setScreenShareEnabled(e,t,r){return this.setTrackEnabled(Ae.Source.ScreenShare,e,t,r)}setE2EEEnabled(e){return Q(this,void 0,void 0,function*(){const t=yield this.e2eeStateMutex.lock();try{if(this.encryptionType=e?Bn.GCM:Bn.NONE,yield Promise.all(this.pendingPublishPromises.values()),this.trackPublications.size===0||Array.from(this.trackPublications.values()).every(r=>r.isEncrypted===e))return;yield this.republishAllTracks(void 0,!1)}finally{t()}})}setTrackEnabled(e,t,r,i){return Q(this,void 0,void 0,function*(){var a,s;this.log.debug("setTrackEnabled",{source:e,enabled:t}),this.republishPromise&&(yield this.republishPromise);let o=this.getTrackPublication(e);if(t)if(o)yield o.unmute();else{let c;if(this.pendingPublishing.has(e)){const u=yield this.waitForPendingPublicationOfSource(e);return u||this.log.info("waiting for pending publication promise timed out",{source:e}),yield u==null?void 0:u.unmute(),u}this.pendingPublishing.add(e);try{switch(e){case Ae.Source.Camera:c=yield this.createTracks({video:(a=r)!==null&&a!==void 0?a:!0});break;case Ae.Source.Microphone:c=yield this.createTracks({audio:(s=r)!==null&&s!==void 0?s:!0});break;case Ae.Source.ScreenShare:c=yield this.createScreenTracks(Object.assign({},r));break;default:throw new ju(e)}}catch(u){throw c==null||c.forEach(l=>{l.stop()}),u instanceof Error&&this.emit(Ve.MediaDevicesError,u,zk(e)),this.pendingPublishing.delete(e),u}for(const u of c){const l=Object.assign(Object.assign({},this.roomOptions.publishDefaults),r);e===Ae.Source.Microphone&&Yc(u)&&l.preConnectBuffer&&(this.log.info("starting preconnect buffer for microphone"),u.startPreConnectBuffer())}try{const u=[];for(const d of c)this.log.info("publishing track",en(d)),u.push(this.publishTrack(d,i));[o]=yield Promise.all(u)}catch(u){throw c==null||c.forEach(l=>{l.stop()}),u}finally{this.pendingPublishing.delete(e)}}else if(!(o!=null&&o.track)&&this.pendingPublishing.has(e)&&(o=yield this.waitForPendingPublicationOfSource(e),o||this.log.info("waiting for pending publication promise timed out",{source:e})),o&&o.track)if(e===Ae.Source.ScreenShare){const c=[this.unpublishTrack(o.track)],u=this.getTrackPublication(Ae.Source.ScreenShareAudio);u&&u.track&&c.push(this.unpublishTrack(u.track)),[o]=yield Promise.all(c)}else yield o.mute();return o})}enableCameraAndMicrophone(){return Q(this,void 0,void 0,function*(){if(!(this.pendingPublishing.has(Ae.Source.Camera)||this.pendingPublishing.has(Ae.Source.Microphone))){this.pendingPublishing.add(Ae.Source.Camera),this.pendingPublishing.add(Ae.Source.Microphone);try{const e=yield this.createTracks({audio:!0,video:!0});yield Promise.all(e.map(t=>this.publishTrack(t)))}finally{this.pendingPublishing.delete(Ae.Source.Camera),this.pendingPublishing.delete(Ae.Source.Microphone)}}})}createTracks(e){return Q(this,void 0,void 0,function*(){var t,r;e??(e={});const i=m$(e,(t=this.roomOptions)===null||t===void 0?void 0:t.audioCaptureDefaults,(r=this.roomOptions)===null||r===void 0?void 0:r.videoCaptureDefaults);try{return(yield Xb(i,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext})).map(o=>(Yc(o)&&(this.microphoneError=void 0,o.setAudioContext(this.audioContext),o.source=Ae.Source.Microphone,this.emit(Ve.AudioStreamAcquired)),hd(o)&&(this.cameraError=void 0,o.source=Ae.Source.Camera),o))}catch(a){throw a instanceof Error&&(e.audio&&(this.microphoneError=a),e.video&&(this.cameraError=a)),a}})}createScreenTracks(e){return Q(this,void 0,void 0,function*(){if(e===void 0&&(e={}),navigator.mediaDevices.getDisplayMedia===void 0)throw new tE("getDisplayMedia not supported");e.resolution===void 0&&!Ebe()&&(e.resolution=nE.h1080fps30.resolution);const t=mbe(e),r=yield navigator.mediaDevices.getDisplayMedia(t),i=r.getVideoTracks();if(i.length===0)throw new ju("no video track found");const a=new L_(i[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});a.source=Ae.Source.ScreenShare,e.contentHint&&(a.mediaStreamTrack.contentHint=e.contentHint);const s=[a];if(r.getAudioTracks().length>
39260){this.emit(Ve.AudioStreamAcquired);const o=new D_(r.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});o.source=Ae.Source.ScreenShareAudio,s.push(o)}return s})}publishTrack(e,t){return Q(this,void 0,void 0,function*(){return this.publishOrRepublishTrack(e,t)})}waitForNextEngineRestart(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:15e3;return new Promise((t,r)=>{const i=()=>{clearTimeout(o),this.engine.off(Ue.Restarted,a),this.engine.off(Ue.Closing,s)},a=()=>{i(),t()},s=()=>{i(),r(new Error("engine closed before restart completed"))},o=setTimeout(()=>{i(),r(new Error("timed out waiting for engine restart"))},e);this.engine.once(Ue.Restarted,a),this.engine.once(Ue.Closing,s)})}publishOrRepublishTrack(e,t){return Q(this,arguments,void 0,function(r,i){var a=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return function*(){var c,u,l,d;Iu(r)&&r.setAudioContext(a.audioContext),yield(c=a.reconnectFuture)===null||c===void 0?void 0:c.promise,a.republishPromise&&!s&&(yield a.republishPromise),Xh(r)&&a.pendingPublishPromises.has(r)&&(yield a.pendingPublishPromises.get(r));let h;if(r instanceof MediaStreamTrack)h=r.getConstraints();else{h=r.constraints;let x;switch(r.source){case Ae.Source.Microphone:x="audioinput";break;case Ae.Source.Camera:x="videoinput"}x&&a.activeDeviceMap.has(x)&&(h=Object.assign(Object.assign({},h),{deviceId:a.activeDeviceMap.get(x)}))}if(r instanceof MediaStreamTrack)switch(r.kind){case"audio":r=new D_(r,h,!0,a.audioContext,{loggerName:a.roomOptions.loggerName,loggerContextCb:()=>a.logContext});break;case"video":r=new L_(r,h,!0,{loggerName:a.roomOptions.loggerName,loggerContextCb:()=>a.logContext});break;default:throw new ju("unsupported MediaStreamTrack kind ".concat(r.kind))}else r.updateLoggerOptions({loggerName:a.roomOptions.loggerName,loggerContextCb:()=>a.logContext});let p;if(a.trackPublications.forEach(x=>{x.track&&x.track===r&&(p=x)}),p)return a.log.warn("track has already been published, skipping",en(p)),p;const g=Object.assign(Object.assign({},a.roomOptions.publishDefaults),i),v="channelCount"in r.mediaStreamTrack.getSettings()&&r.mediaStreamTrack.getSettings().channelCount===2||r.mediaStreamTrack.getConstraints().channelCount===2,y=(u=g.forceStereo)!==null&&u!==void 0?u:v;y&&(g.dtx===void 0&&a.log.debug("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",en(r)),g.red===void 0&&a.log.debug("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),(l=g.dtx)!==null&&l!==void 0||(g.dtx=!1),(d=g.red)!==null&&d!==void 0||(g.red=!1)),!Rbe()&&a.roomOptions.e2ee&&(a.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2"),g.simulcast=!1),g.source&&(r.source=g.source);const b=new Promise((x,S)=>Q(a,void 0,void 0,function*(){try{if(this.engine.client.currentState!==Nn.CONNECTED){this.log.debug("deferring track publication until signal is connected",{track:en(r)});let w=!1;const k=setTimeout(()=>{w=!0,r.stop(),S(new UI("publishing rejected as engine not connected within timeout",408))},15e3);if(yield this.waitUntilEngineConnected(),clearTimeout(k),w)return;const E=yield this.publish(r,g,y);x(E)}else try{const w=yield this.publish(r,g,y);x(w)}catch(w){S(w)}}catch(w){S(w)}}));a.pendingPublishPromises.set(r,b);try{return yield b}catch(x){if(!o&&x instanceof rf)return a.log.warn("negotiation due to track publish failed, retrying after reconnect",{error:x}),a.pendingPublishPromises.delete(r),yield a.waitForNextEngineRestart(),yield a.publishOrRepublishTrack(r,i,s,!0);throw x}finally{a.pendingPublishPromises.delete(r)}}()})}waitUntilEngineConnected(){return this.signalConnectedFuture||(this.signalConnectedFuture=new Ai),this.signalConnectedFuture.promise}hasPermissionsToPublish(e){if(!this.permissions)return this.log.warn("no permissions present for publishing track",en(e)),!1;const{canPublish:t,canPublishSources:r}=this.permissions;return t&&(r.length===0||r.map(i=>_be(i)).includes(e.source))?!0:(this.log.warn("insufficient permissions to publish",en(e)),!1)}publish(e,t,r){return Q(this,void 0,void 0,function*(){var i,a,s,o,c,u,l,d,h,p;if(!this.hasPermissionsToPublish(e))throw new UI("failed to publish track, insufficient permissions",403);Array.from(this.trackPublications.values()).find(A=>Xh(e)&&A.source===e.source)&&e.source!==Ae.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(e.source),en(e)),t.stopMicTrackOnMute&&Yc(e)&&(e.stopOnMute=!0),e.source===Ae.Source.ScreenShare&&hp()&&(t.simulcast=!1),t.videoCodec==="av1"&&!kbe()&&(t.videoCodec=void 0),t.videoCodec==="vp9"&&!Sbe()&&(t.videoCodec=void 0),t.videoCodec===void 0&&(t.videoCodec=Xk),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some(A=>t.videoCodec===ng(A.mime))||(t.videoCodec=ng(this.enabledPublishVideoCodecs[0].mime)));const v=t.videoCodec;e.on(We.Muted,this.onTrackMuted),e.on(We.Unmuted,this.onTrackUnmuted),e.on(We.Ended,this.handleTrackEnded),e.on(We.UpstreamPaused,this.onTrackUpstreamPaused),e.on(We.UpstreamResumed,this.onTrackUpstreamResumed),e.on(We.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate);const y=[],b=!(!((i=t.dtx)!==null&&i!==void 0)||i),x=e.getSourceTrackSettings();x.autoGainControl&&y.push(hi.TF_AUTO_GAIN_CONTROL),x.echoCancellation&&y.push(hi.TF_ECHO_CANCELLATION),x.noiseSuppression&&y.push(hi.TF_NOISE_SUPPRESSION),x.channelCount&&x.channelCount>1&&y.push(hi.TF_STEREO),b&&y.push(hi.TF_NO_DTX),Iu(e)&&e.hasPreConnectBuffer&&y.push(hi.TF_PRECONNECT_BUFFER);const S=new Dg({cid:e.mediaStreamTrack.id,name:t.name,type:Ae.kindToProto(e.kind),muted:e.isMuted,source:Ae.sourceToProto(e.source),disableDtx:b,encryption:this.encryptionType,stereo:r,disableRed:this.isE2EEEnabled||!(!((a=t.red)!==null&&a!==void 0)||a),stream:t==null?void 0:t.stream,backupCodecPolicy:t==null?void 0:t.backupCodecPolicy,audioFeatures:y});let w;if(e.kind===Ae.Kind.Video){let A={width:0,height:0};try{A=yield e.waitForDimensions()}catch{const j=(o=(s=this.roomOptions.videoCaptureDefaults)===null||s===void 0?void 0:s.resolution)!==null&&o!==void 0?o:Lg.h720.resolution;A={width:j.width,height:j.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign({},en(e)),{dims:A}))}S.width=A.width,S.height=A.height,Pu(e)&&(Go(v)&&(e.source===Ae.Source.ScreenShare&&(t.scalabilityMode="L1T3","contentHint"in e.mediaStreamTrack&&(e.mediaStreamTrack.contentHint="motion",this.log.debug("forcing contentHint to motion for screenshare with SVC codecs",en(e)))),t.scalabilityMode=(c=t.scalabilityMode)!==null&&c!==void 0?c:"L3T3_KEY"),S.simulcastCodecs=[new Ik({codec:v,cid:e.mediaStreamTrack.id})],t.backupCodec===!0&&(t.backupCodec={codec:Xk}
3926),t.backupCodec&&v!==t.backupCodec.codec&&S.encryption===Bn.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),S.simulcastCodecs.push(new Ik({codec:t.backupCodec.codec,cid:""})))),w=N_(e.source===Ae.Source.ScreenShare,S.width,S.height,t),S.layers=pO(S.width,S.height,w,Go(t.videoCodec))}else e.kind===Ae.Kind.Audio&&(w=[{maxBitrate:(u=t.audioPreset)===null||u===void 0?void 0:u.maxBitrate,priority:(d=(l=t.audioPreset)===null||l===void 0?void 0:l.priority)!==null&&d!==void 0?d:"high",networkPriority:(p=(h=t.audioPreset)===null||h===void 0?void 0:h.priority)!==null&&p!==void 0?p:"high"}]);if(!this.engine||this.engine.isClosed)throw new dr("cannot publish track when not connected");const k=()=>Q(this,void 0,void 0,function*(){var A,N,j;if(!this.engine.pcManager)throw new dr("pcManager is not ready");if(e.sender=yield this.engine.createSender(e,t,w),this.emit(Ve.LocalSenderCreated,e.sender,e),Pu(e)&&((A=t.degradationPreference)!==null&&A!==void 0||(t.degradationPreference=M1e(e)),e.setDegradationPreference(t.degradationPreference)),w)if(hp()&&e.kind===Ae.Kind.Audio){let L;for(const B of this.engine.pcManager.publisher.getTransceivers())if(B.sender===e.sender){L=B;break}L&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:L,codec:"opus",maxbr:!((N=w[0])===null||N===void 0)&&N.maxBitrate?w[0].maxBitrate/1e3:0})}else e.codec&&Go(e.codec)&&(!((j=w[0])===null||j===void 0)&&j.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:S.cid,codec:e.codec,maxbr:w[0].maxBitrate/1e3});yield this.engine.negotiate()});let E;const I=new Promise((A,N)=>Q(this,void 0,void 0,function*(){var j;try{E=yield this.engine.addTrack(S),A(E)}catch(L){if(e.sender&&(!((j=this.engine.pcManager)===null||j===void 0)&&j.publisher)){try{this.engine.pcManager.publisher.removeTrack(e.sender)}catch(B){this.log.error(B)}yield this.engine.negotiate().catch(B=>{this.log.error("failed to negotiate after removing track due to failed add track request",Object.assign(Object.assign({},en(e)),{error:B}))})}N(L)}}));if(this.enabledPublishVideoCodecs.length>0)E=(yield Promise.all([I,k()]))[0];else{E=yield I;let A;if(E.codecs.forEach(N=>{A===void 0&&(A=N.mimeType)}),A&&e.kind===Ae.Kind.Video){const N=ng(A);N!==v&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign({}
3926,en(e)),{codec:N})),t.videoCodec=N,w=N_(e.source===Ae.Source.ScreenShare,S.width,S.height,t))}yield k()}const P=new e2(e.kind,E,e,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});if(P.on(We.CpuConstrained,A=>this.onTrackCpuConstrained(A,P)),P.options=t,e.sid=E.sid,Pu(e)&&(e.publishOptions=t,S.width&&S.height&&(e.lastEncodedDimensions={width:S.width,height:S.height})),this.log.debug("publishing ".concat(e.kind," with encodings"),{encodings:w,trackInfo:E}),Pu(e)?e.startMonitor(this.engine.client):Iu(e)&&e.startMonitor(),this.addTrackPublication(P),this.emit(Ve.LocalTrackPublished,P),Iu(e)&&E.audioFeatures.includes(hi.TF_PRECONNECT_BUFFER)){const A=e.getPreConnectBuffer(),N=e.getPreConnectBufferMimeType();this.on(Ve.LocalTrackSubscribed,j=>{if(j.trackSid===E.sid){if(!e.hasPreConnectBuffer){this.log.warn("subscribe event came to late, buffer already closed");return}this.log.debug("finished recording preconnect buffer",en(e)),e.stopPreConnectBuffer()}}),A&&new Promise((L,B)=>Q(this,void 0,void 0,function*(){var V,X,ne,se,ie,de;try{this.log.debug("waiting for agent",en(e));const Fe=setTimeout(()=>{B(new Error("agent not active within 10 seconds"))},1e4),Ge=yield this.waitUntilActiveAgentPresent();clearTimeout(Fe),this.log.debug("sending preconnect buffer",en(e));const Ie=yield this.streamBytes({name:"preconnect-buffer",mimeType:N,topic:"lk.agent.pre-connect-audio-buffer",destinationIdentities:[Ge.identity],attributes:{trackId:P.trackSid,sampleRate:String((ie=x.sampleRate)!==null&&ie!==void 0?ie:"48000"),channels:String((de=x.channelCount)!==null&&de!==void 0?de:"1")}});try{for(var ue=!0,Ce=Vo(A),we;we=yield Ce.next(),V=we.done,!V;ue=!0){se=we.value,ue=!1;const He=se;yield Ie.write(He)}}catch(He){X={error:He}}finally{try{!ue&&!V&&(ne=Ce.return)&&(yield ne.call(Ce))}finally{if(X)throw X.error}}yield Ie.close(),L()}catch(Fe){B(Fe)}})).then(()=>{this.log.debug("preconnect buffer sent successfully",en(e))}).catch(L=>{this.log.error("error sending preconnect buffer",Object.assign(Object.assign({},en(e)),{error:L}))})}return P})}get isLocal(){return!0}publishAdditionalCodecForTrack(e,t,r){return Q(this,void 0,void 0,function*(){var i;if(this.encryptionType!==Bn.NONE)return;let a;if(this.trackPublications.forEach(p=>{p.track&&p.track===e&&(a=p)}),!a)throw new ju("track is not published");if(!Pu(e))throw new ju("track is not a video track");const s=Object.assign(Object.assign({},(i=this.roomOptions)===null||i===void 0?void 0:i.publishDefaults),r),o=P$(e,t,s);if(!o){this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",en(e));return}const c=e.addSimulcastTrack(t,o);if(!c)return;const u=new Dg({cid:c.mediaStreamTrack.id,type:Ae.kindToProto(e.kind),muted:e.isMuted,source:Ae.sourceToProto(e.source),sid:e.sid,simulcastCodecs:[{codec:s.videoCodec,cid:c.mediaStreamTrack.id}]});if(u.layers=pO(u.width,u.height,o),!this.engine||this.engine.isClosed)throw new dr("cannot publish track when not connected");const l=()=>Q(this,void 0,void 0,function*(){yield this.engine.createSimulcastSender(e,c,s,o),yield this.engine.negotiate()}),h=(yield Promise.all([this.engine.addTrack(u),l()]))[0];this.log.debug("published ".concat(t," for track ").concat(e.sid),{encodings:o,trackInfo:h})})}unpublishTrack(e,t){return Q(this,void 0,void 0,function*(){var r,i;if(Xh(e)){const u=this.pendingPublishPromises.get(e);u&&(this.log.debug("awaiting publish promise before attempting to unpublish",en(e)),yield u)}const a=this.getPublicationForTrack(e),s=a?en(a):void 0;if(this.log.info("unpublishing track",s),!a||!a.track){this.log.warn("track was not unpublished because no publication was found",s);return}e=a.track,e.off(We.Muted,this.onTrackMuted),e.off(We.Unmuted,this.onTrackUnmuted),e.off(We.Ended,this.handleTrackEnded),e.off(We.UpstreamPaused,this.onTrackUpstreamPaused),e.off(We.UpstreamResumed,this.onTrackUpstreamResumed),e.off(We.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),t===void 0&&(t=(i=(r=this.roomOptions)===null||r===void 0?void 0:r.stopLocalTrackOnUnpublish)!==null&&i!==void 0?i:!0),t?e.stop():e.stopMonitor();let o=!1;const c=e.sender;if(e.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<hr.FAILED&&c)try{for(const u of this.engine.pcManager.publisher.getTransceivers())u.sender===c&&(u.direction="inactive",o=!0);try{o=this.engine.removeTrack(c)}catch(u){this.log.warn(u),o=!0}
3926if(Pu(e)){for(const[,u]of e.simulcastCodecs)if(u.sender){try{o=this.engine.removeTrack(u.sender)}catch(l){this.log.warn(l),o=!0}u.sender=void 0}e.simulcastCodecs.clear()}}catch(u){this.log.warn("failed to unpublish track",Object.assign(Object.assign({},s),{error:u}))}switch(this.trackPublications.delete(a.trackSid),a.kind){case Ae.Kind.Audio:this.audioTrackPublications.delete(a.trackSid);break;case Ae.Kind.Video:this.videoTrackPublications.delete(a.trackSid);break}return this.emit(Ve.LocalTrackUnpublished,a),a.setTrack(void 0),o&&(yield this.engine.negotiate()),a})}unpublishTracks(e){return Q(this,void 0,void 0,function*(){return(yield Promise.all(e.map(r=>this.unpublishTrack(r)))).filter(r=>!!r)})}republishAllTracks(e){return Q(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){r.republishPromise&&(yield r.republishPromise),r.republishPromise=new Yi((a,s)=>Q(r,void 0,void 0,function*(){try{const o=[];this.trackPublications.forEach(c=>{c.track&&(t&&(c.options=Object.assign(Object.assign({},c.options),t)),o.push(c))}),yield Promise.all(o.map(c=>Q(this,void 0,void 0,function*(){const u=c.track;yield this.unpublishTrack(u,!1),i&&!u.isMuted&&u.source!==Ae.Source.ScreenShare&&u.source!==Ae.Source.ScreenShareAudio&&(Iu(u)||Pu(u))&&!u.isUserProvided&&(this.log.debug("restarting existing track",{track:c.trackSid}),yield u.restartTrack()),yield this.publishOrRepublishTrack(u,c.options,!0)}))),a()}catch(o){o instanceof Error?s(o):s(new Error(String(o)))}finally{this.republishPromise=void 0}})),yield r.republishPromise}()})}publishData(e){return Q(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){const a=i.reliable?Vt.RELIABLE:Vt.LOSSY,s=i.reliable?Kd.RELIABLE:Kd.LOSSY,o=i.destinationIdentities,c=i.topic;let u=new jT({participantIdentity:r.identity,payload:t,destinationIdentities:o,topic:c});const l=new ga({kind:s,value:{case:"user",value:u}});yield r.engine.sendDataPacket(l,a)}()})}publishDtmf(e,t){return Q(this,void 0,void 0,function*(){const r=new ga({kind:Kd.RELIABLE,value:{case:"sipDtmf",value:new f6({code:e,digit:t})}});yield this.engine.sendDataPacket(r,Vt.RELIABLE)})}sendChatMessage(e,t){return Q(this,void 0,void 0,function*(){const r={id:crypto.randomUUID(),message:e,timestamp:Date.now(),attachedFiles:t==null?void 0:t.attachments},i=new ga({value:{case:"chatMessage",value:new P_(Object.assign(Object.assign({},r),{timestamp:ir.parse(r.timestamp)}))}});return yield this.engine.sendDataPacket(i,Vt.RELIABLE),this.emit(Ve.ChatMessage,r),r})}editChatMessage(e,t){return Q(this,void 0,void 0,function*(){const r=Object.assign(Object.assign({},t),{message:e,editTimestamp:Date.now()}),i=new ga({value:{case:"chatMessage",value:new P_(Object.assign(Object.assign({},r),{timestamp:ir.parse(r.timestamp),editTimestamp:ir.parse(r.editTimestamp)}))}});return yield this.engine.sendDataPacket(i,Vt.RELIABLE),this.emit(Ve.ChatMessage,r),r})}sendText(e,t){return Q(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.sendText(e,t)})}streamText(e){return Q(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.streamText(e)})}sendFile(e,t){return Q(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.sendFile(e,t)})}streamBytes(e){return Q(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.streamBytes(e)})}performRpc(e){let{destinationIdentity:t,method:r,payload:i,responseTimeout:a=15e3}=e;const s=7e3,o=s+1e3;return new Yi((c,u)=>Q(this,void 0,void 0,function*(){var l,d,h,p;if(fE(i)>T$){u(kr.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));return}if(!((d=(l=this.engine.latestJoinResponse)===null||l===void 0?void 0:l.serverInfo)===null||d===void 0)&&d.version&&Zc((p=(h=this.engine.latestJoinResponse)===null||h===void 0?void 0:h.serverInfo)===null||p===void 0?void 0:p.version,"1.8.0")<0){u(kr.builtIn("UNSUPPORTED_SERVER"));return}const g=Math.max(a,o),v=crypto.randomUUID();yield this.publishRpcRequest(t,v,r,i,g);const y=setTimeout(()=>{this.pendingAcks.delete(v),u(kr.builtIn("CONNECTION_TIMEOUT")),this.pendingResponses.delete(v),clearTimeout(b)},s);this.pendingAcks.set(v,{resolve:()=>{clearTimeout(y)},participantIdentity:t});const b=setTimeout(()=>{this.pendingResponses.delete(v),u(kr.builtIn("RESPONSE_TIMEOUT"))},a);this.pendingResponses.set(v,{resolve:(x,S)=>{clearTimeout(b),this.pendingAcks.has(v)&&(this.log.warn("RPC response received before ack",v),this.pendingAcks.delete(v),clearTimeout(y)),S?u(S):c(x??"")},participantIdentity:t})}))}
3926registerRpcMethod(e,t){this.rpcHandlers.has(e)&&this.log.warn("you're overriding the RPC handler for method ".concat(e,", in the future this will throw an error")),this.rpcHandlers.set(e,t)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setTrackSubscriptionPermissions(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];this.participantTrackPermissions=t,this.allParticipantsAllowedToSubscribe=e,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}handleIncomingRpcAck(e){const t=this.pendingAcks.get(e);t?(t.resolve(),this.pendingAcks.delete(e)):console.error("Ack received for unexpected RPC request",e)}handleIncomingRpcResponse(e,t,r){const i=this.pendingResponses.get(e);i?(i.resolve(t,r),this.pendingResponses.delete(e)):console.error("Response received for unexpected RPC request",e)}publishRpcRequest(e,t,r,i,a){return Q(this,void 0,void 0,function*(){const s=new ga({destinationIdentities:[e],kind:Kd.RELIABLE,value:{case:"rpcRequest",value:new qT({id:t,method:r,payload:i,responseTimeoutMs:a,version:1})}});yield this.engine.sendDataPacket(s,Vt.RELIABLE)})}handleParticipantDisconnected(e){for(const[t,{participantIdentity:r}]of this.pendingAcks)r===e&&this.pendingAcks.delete(t);for(const[t,{participantIdentity:r,resolve:i}]of this.pendingResponses)r===e&&(i(null,kr.builtIn("RECIPIENT_DISCONNECTED")),this.pendingResponses.delete(t))}setEnabledPublishCodecs(e){this.enabledPublishVideoCodecs=e.filter(t=>t.mime.split("/")[0].toLowerCase()==="video")}updateInfo(e){return super.updateInfo(e)?(e.tracks.forEach(t=>{var r,i;const a=this.trackPublications.get(t.sid);if(a){const s=a.isMuted||((i=(r=a.track)===null||r===void 0?void 0:r.isUpstreamPaused)!==null&&i!==void 0?i:!1);s!==t.muted&&(this.log.debug("updating server mute state after reconcile",Object.assign(Object.assign({},en(a)),{mutedOnServer:s})),this.engine.client.sendMuteTrack(t.sid,s))}}),!0):!1}setActiveAgent(e){var t,r,i,a;this.firstActiveAgent=e,e&&!this.firstActiveAgent&&(this.firstActiveAgent=e),e?(r=(t=this.activeAgentFuture)===null||t===void 0?void 0:t.resolve)===null||r===void 0||r.call(t,e):(a=(i=this.activeAgentFuture)===null||i===void 0?void 0:i.reject)===null||a===void 0||a.call(i,new Error("Agent disconnected")),this.activeAgentFuture=void 0}waitUntilActiveAgentPresent(){return this.firstActiveAgent?Promise.resolve(this.firstActiveAgent):(this.activeAgentFuture||(this.activeAgentFuture=new Ai),this.activeAgentFuture.promise)}getPublicationForTrack(e){let t;return this.trackPublications.forEach(r=>{const i=r.track;i&&(e instanceof MediaStreamTrack?(Iu(i)||Pu(i))&&i.mediaStreamTrack===e&&(t=r):e===i&&(t=r))}),t}waitForPendingPublicationOfSource(e){return Q(this,void 0,void 0,function*(){const r=Date.now();for(;Date.now()<r+1e4;){const i=Array.from(this.pendingPublishPromises.entries()).find(a=>{let[s]=a;return s.source===e});if(i)return i[1];yield Ji(20)}})}publishDataTrack(e){return Q(this,void 0,void 0,function*(){const t=new Kb(e,this.roomOutgoingDataTrackManager);return yield t.publish(),t})}}class IO extends DOMException{constructor(e,t){super(e,"AbortError"),this.reason=t}}class pxe extends Map{constructor(){super(...arguments),this.pending=new Map}set(e,t){var r,i;super.set(e,t);const a=(r=this.pending)===null||r===void 0?void 0:r.get(e);if(a){for(const s of a)s.isResolved||(i=s.resolve)===null||i===void 0||i.call(s,t);this.pending.delete(e)}return this}get[Symbol.toStringTag](){return"DeferrableMap"}getDeferred(e,t){return Q(this,void 0,void 0,function*(){const r=this.get(e);if(typeof r<"u")return r;if(t!=null&&t.aborted)throw new IO("The operation was aborted.",t.reason);const i=new Ai(void 0,()=>{const s=this.pending.get(e);if(!s)return;const o=s.indexOf(i);o!==-1&&s.splice(o,1),s.length===0&&this.pending.delete(e)}),a=this.pending.get(e);if(a?a.push(i):this.pending.set(e,[i]),t){const s=()=>{var o;i.isResolved||(o=i.reject)===null||o===void 0||o.call(i,new IO("The operation was aborted.",t.reason))};t.addEventListener("abort",s,{once:!0}),i.promise.finally(()=>{t.removeEventListener("abort",s)})}return i.promise})}}
3926class mxe extends Lu{constructor(e,t,r,i){super(e,t.sid,t.name,i),this.track=void 0,this.allowed=!0,this.requestedDisabled=void 0,this.visible=!0,this.handleEnded=a=>{this.setTrack(void 0),this.emit(We.Ended,a)},this.handleVisibilityChange=a=>{this.log.debug("adaptivestream video visibility ".concat(this.trackSid,", visible=").concat(a),this.logContext),this.visible=a,this.emitTrackUpdate()},this.handleVideoDimensionsChange=a=>{this.log.debug("adaptivestream video dimensions ".concat(a.width,"x").concat(a.height),this.logContext),this.videoDimensionsAdaptiveStream=a,this.emitTrackUpdate()},this.subscribed=r,this.updateInfo(t)}setSubscribed(e){const t=this.subscriptionStatus,r=this.permissionStatus;this.subscribed=e,e&&(this.allowed=!0);const i=new Ub({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new p6({participantSid:"",trackSids:[this.trackSid]})]});this.emit(We.UpdateSubscription,i),this.emitSubscriptionUpdateIfChanged(t),this.emitPermissionUpdateIfChanged(r)}get subscriptionStatus(){return this.subscribed===!1?Lu.SubscriptionStatus.Unsubscribed:super.isSubscribed?Lu.SubscriptionStatus.Subscribed:Lu.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?Lu.PermissionStatus.Allowed:Lu.PermissionStatus.NotAllowed}get isSubscribed(){return this.subscribed===!1?!1:super.isSubscribed}get isDesired(){return this.subscribed!==!1}get isEnabled(){return this.requestedDisabled!==void 0?!this.requestedDisabled:this.isAdaptiveStream?this.visible:!0}get isLocal(){return!1}setEnabled(e){!this.isManualOperationAllowed()||this.requestedDisabled===!e||(this.requestedDisabled=!e,this.emitTrackUpdate())}setVideoQuality(e){!this.isManualOperationAllowed()||this.requestedMaxQuality===e||(this.requestedMaxQuality=e,this.requestedVideoDimensions=void 0,this.emitTrackUpdate())}setVideoDimensions(e){var t,r;this.isManualOperationAllowed()&&(((t=this.requestedVideoDimensions)===null||t===void 0?void 0:t.width)===e.width&&((r=this.requestedVideoDimensions)===null||r===void 0?void 0:r.height)===e.height||(Xw(this.track)&&(this.requestedVideoDimensions=e),this.requestedMaxQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&Xw(this.track)&&this.fps!==e&&(this.fps=e,this.emitTrackUpdate())}get videoQuality(){var e;return(e=this.requestedMaxQuality)!==null&&e!==void 0?e:bs.HIGH}setTrack(e){const t=this.subscriptionStatus,r=this.permissionStatus,i=this.track;i!==e&&(i&&(i.off(We.VideoDimensionsChanged,this.handleVideoDimensionsChange),i.off(We.VisibilityChanged,this.handleVisibilityChange),i.off(We.Ended,this.handleEnded),i.detach(),i.stopMonitor(),this.emit(We.Unsubscribed,i)),super.setTrack(e),e&&(e.sid=this.trackSid,e.on(We.VideoDimensionsChanged,this.handleVideoDimensionsChange),e.on(We.VisibilityChanged,this.handleVisibilityChange),e.on(We.Ended,this.handleEnded),this.emit(We.Subscribed,e)),this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(t))}setAllowed(e){const t=this.subscriptionStatus,r=this.permissionStatus;this.allowed=e,this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(t)}setSubscriptionError(e){this.emit(We.SubscriptionFailed,e)}updateInfo(e){super.updateInfo(e);const t=this.metadataMuted;this.metadataMuted=e.muted,this.track?this.track.setMuted(e.muted):t!==e.muted&&this.emit(e.muted?We.Muted:We.Unmuted)}emitSubscriptionUpdateIfChanged(e){const t=this.subscriptionStatus;e!==t&&this.emit(We.SubscriptionStatusChanged,t,e)}emitPermissionUpdateIfChanged(e){this.permissionStatus!==e&&this.emit(We.SubscriptionPermissionChanged,this.permissionStatus,e)}isManualOperationAllowed(){return this.isDesired?!0:(this.log.warn("cannot update track settings when not subscribed",this.logContext),!1)}get isAdaptiveStream(){return Xw(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=new S6({trackSids:[this.trackSid],disabled:!this.isEnabled,fps:this.fps});if(this.kind===Ae.Kind.Video){let t=this.requestedVideoDimensions;if(this.videoDimensionsAdaptiveStream!==void 0)if(t)zI(this.videoDimensionsAdaptiveStream,t)&&(this.log.debug("using adaptive stream dimensions instead of requested",Object.assign(Object.assign({},this.logContext),this.videoDimensionsAdaptiveStream)),t=this.videoDimensionsAdaptiveStream);else if(this.requestedMaxQuality!==void 0&&this.trackInfo){const r=bbe(this.trackInfo,this.requestedMaxQuality);r&&zI(this.videoDimensionsAdaptiveStream,r)&&(this.log.debug("using adaptive stream dimensions instead of max quality layer",Object.assign(Object.assign({},this.logContext),this.videoDimensionsAdaptiveStream)),t=this.videoDimensionsAdaptiveStream)}else this.log.debug("using adaptive stream dimensions",Object.assign(Object.assign({},this.logContext),this.videoDimensionsAdaptiveStream)),t=this.videoDimensionsAdaptiveStream;t?(e.width=Math.ceil(t.width),e.height=Math.ceil(t.height)):this.requestedMaxQuality!==void 0?(this.log.debug("using requested max quality",Object.assign(Object.assign({},this.logContext),{quality:this.requestedMaxQuality})),e.quality=this.requestedMaxQuality):(this.log.debug("using default qual
3926ity",Object.assign(Object.assign({},this.logContext),{quality:bs.HIGH})),e.quality=bs.HIGH)}this.emit(We.UpdateSettings,e)}}class $_ extends j${static fromParticipantInfo(e,t,r,i){return new $_(e,t.sid,t.identity,t.name,t.metadata,t.attributes,r,t.kind,t.dataTracks.map(a=>{const s=M_.from(a);return new B$(s,i,{publisherIdentity:t.identity})}))}get logContext(){return Object.assign(Object.assign({},super.logContext),{remoteParticipantID:this.sid,remoteParticipant:this.identity})}constructor(e,t,r,i,a,s,o){let c=arguments.length>7&&arguments[7]!==void 0?arguments[7]:Mg.STANDARD,u=arguments.length>8&&arguments[8]!==void 0?arguments[8]:[];super(t,r||"",i,a,s,o,c),this.signalClient=e,this.trackPublications=new Map,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.dataTracks=new pxe(u.map(l=>[l.info.name,l])),this.volumeMap=new Map}addTrackPublication(e){super.addTrackPublication(e),e.on(We.UpdateSettings,t=>{this.log.debug("send update settings",Object.assign(Object.assign(Object.assign({},this.logContext),en(e)),{settings:t})),this.signalClient.sendUpdateTrackSettings(t)}),e.on(We.UpdateSubscription,t=>{t.participantTracks.forEach(r=>{r.participantSid=this.sid}),this.signalClient.sendUpdateSubscription(t)}),e.on(We.SubscriptionPermissionChanged,t=>{this.emit(Ve.TrackSubscriptionPermissionChanged,e,t)}),e.on(We.SubscriptionStatusChanged,t=>{this.emit(Ve.TrackSubscriptionStatusChanged,e,t)}),e.on(We.Subscribed,t=>{this.emit(Ve.TrackSubscribed,t,e)}),e.on(We.Unsubscribed,t=>{this.emit(Ve.TrackUnsubscribed,t,e)}),e.on(We.SubscriptionFailed,t=>{this.emit(Ve.TrackSubscriptionFailed,e.trackSid,t)})}getTrackPublication(e){const t=super.getTrackPublication(e);if(t)return t}getTrackPublicationByName(e){const t=super.getTrackPublicationByName(e);if(t)return t}setVolume(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ae.Source.Microphone;this.volumeMap.set(t,e);const r=this.getTrackPublication(t);r&&r.track&&r.track.setVolume(e)}getVolume(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ae.Source.Microphone;const t=this.getTrackPublication(e);return t&&t.track?t.track.getVolume():this.volumeMap.get(e)}addSubscribedMediaTrack(e,t,r,i,a,s){let o=this.getTrackPublicationBySid(t);if(o||t.startsWith("TR")||this.trackPublications.forEach(l=>{!o&&e.kind===l.kind.toString()&&(o=l)}),!o){if(s===0){this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:t})),this.emit(Ve.TrackSubscriptionFailed,t);return}s===void 0&&(s=20),setTimeout(()=>{this.addSubscribedMediaTrack(e,t,r,i,a,s-1)},150);return}if(e.readyState==="ended"){this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",Object.assign(Object.assign({},this.logContext),en(o))),this.emit(Ve.TrackSubscriptionFailed,t);return}const c=e.kind==="video";let u;return c?u=new oxe(e,t,i,a):u=new sxe(e,t,i,this.audioContext,this.audioOutput),u.source=o.source,u.isMuted=o.isMuted,u.setMediaStream(r),u.start(),o.setTrack(u),this.volumeMap.has(o.source)&&Gk(u)&&Yc(u)&&u.setVolume(this.volumeMap.get(o.source)),o}get hasMetadata(){return!!this.participantInfo}getTrackPublicationBySid(e){return this.trackPublications.get(e)}updateInfo(e){if(!super.updateInfo(e))return!1;const t=new Map,r=new Map;return e.tracks.forEach(i=>{var a,s;let o=this.getTrackPublicationBySid(i.sid);if(o)o.updateInfo(i);else{const c=Ae.kindFromProto(i.type);if(!c)return;o=new mxe(c,i,(a=this.signalClient.connectOptions)===null||a===void 0?void 0:a.autoSubscribe,{loggerContextCb:()=>this.logContext,loggerName:(s=this.loggerOptions)===null||s===void 0?void 0:s.loggerName}),o.updateInfo(i),r.set(i.sid,o);const u=Array.from(this.trackPublications.values()).find(l=>l.source===(o==null?void 0:o.source));u&&o.source!==Ae.Source.Unknown&&this.log.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(o.source),Object.assign(Object.assign({},this.logContext),{oldTrack:en(u),newTrack:en(o)})),this.addTrackPublication(o)}t.set(i.sid,o)}),this.trackPublications.forEach(i=>
3926{t.has(i.trackSid)||(this.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},this.logContext),en(i))),this.unpublishTrack(i.trackSid,!0))}),r.forEach(i=>{this.emit(Ve.TrackPublished,i)}),!0}unpublishTrack(e,t){const r=this.trackPublications.get(e);if(!r)return;const{track:i}=r;switch(i&&(i.stop(),r.setTrack(void 0)),this.trackPublications.delete(e),r.kind){case Ae.Kind.Audio:this.audioTrackPublications.delete(e);break;case Ae.Kind.Video:this.videoTrackPublications.delete(e);break}t&&this.emit(Ve.TrackUnpublished,r)}setAudioOutput(e){return Q(this,void 0,void 0,function*(){this.audioOutput=e;const t=[];this.audioTrackPublications.forEach(r=>{var i;Yc(r.track)&&Gk(r.track)&&t.push(r.track.setSinkId((i=e.deviceId)!==null&&i!==void 0?i:"default"))}),yield Promise.all(t)})}addRemoteDataTrack(e){this.dataTracks.set(e.info.name,e)}removeRemoteDataTrack(e){for(const[t,r]of this.dataTracks.entries())e===r.info.sid&&this.dataTracks.delete(t)}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:e,args:r})),super.emit(e,...r)}}var yn;(function(n){n.Disconnected="disconnected",n.Connecting="connecting",n.Connected="connected",n.Reconnecting="reconnecting",n.SignalReconnecting="signalReconnecting"})(yn||(yn={}));const gxe=4*1e3;class wf extends xo.EventEmitter{get hasE2EESetup(){return this.e2eeManager!==void 0}constructor(e){var t,r,i,a,s,o,c;if(super(),t=this,this.state=yn.Disconnected,this.activeSpeakers=[],this.isE2EEEnabled=!1,this.audioEnabled=!0,this.e2eeStateMutex=new Ii,this.isVideoPlaybackBlocked=!1,this.log=qt,this.bufferedEvents=[],this.isResuming=!1,this.rpcHandlers=new Map,this.connect=(u,l,d)=>Q(this,void 0,void 0,function*(){var h;if(!Tbe())throw Qc()?Error("WebRTC isn't detected, have you called registerGlobals?"):Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");const p=yield this.disconnectLock.lock();if(this.state===yn.Connected)return this.log.info("already connected to room ".concat(this.name)),p(),Promise.resolve();if(this.connectFuture)return p(),this.connectFuture.promise;this.setAndEmitConnectionState(yn.Connecting),((h=this.regionUrlProvider)===null||h===void 0?void 0:h.getServerUrl().toString())!==w$(u)&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),pp(new URL(u))&&(this.regionUrlProvider===void 0?this.regionUrlProvider=new un(u,l):this.regionUrlProvider.updateToken(l),this.regionUrlProvider.fetchRegionSettings().then(y=>{var b;(b=this.regionUrlProvider)===null||b===void 0||b.setServerReportedRegions(y)}).catch(y=>{this.log.warn("could not fetch region settings",{error:y})}));const g=(y,b,x)=>Q(this,void 0,void 0,function*(){var S,w;this.abortController&&this.abortController.abort();const k=new AbortController;this.abortController=k,p==null||p();try{if(yield Jh.getInstance().getBackOffPromise(u),k.signal.aborted)throw pt.cancelled("Connection attempt aborted");yield this.attemptConnection(x??u,l,d,k),this.abortController=void 0,y()}catch(E){if(this.regionUrlProvider&&E instanceof pt&&E.reason!==Fn.Cancelled&&E.reason!==Fn.NotAllowed){let I=null;try{this.log.debug("Fetching next region"),I=yield this.regionUrlProvider.getNextBestRegionUrl((S=this.abortController)===null||S===void 0?void 0:S.signal)}catch(P){if(P instanceof pt&&(P.status===401||P.reason===Fn.Cancelled)){this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),b(P);return}}[Fn.InternalError,Fn.ServerUnreachable,Fn.Timeout].includes(E.reason)&&(this.log.debug("Adding failed connection attempt to back off"),Jh.getInstance().addFailedConnectionAttempt(u)),I&&!(!((w=this.abortController)===null||w===void 0)&&w.signal.aborted)?(this.log.info("Initial connection failed with ConnectionError: ".concat(E.message,". Retrying with another region: ").concat(I)),this.recreateEngine(!0),yield g(y,b,I)):(this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,XI(E)),b(E))}else{let I=Zo.UNKNOWN_REASON;E instanceof pt&&(I=XI(E)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,I),b(E)}}}),v=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new Ai((y,b)=>{g(y,b,v)},()=>{this.clearConnectionFutures()}),this.connectFuture.promise}),this.connectSignal=(u,l,d,h,p,g)=>Q(this,void 0,void 0,function*(){const{joinResponse:v,serverInfo:y}=yield d.join(u,l,{autoSubscribe:h.autoSubscribe,adaptiveStream:typeof p.adaptiveStream=="object"?!0:p.adaptiveStream,maxRetries:h.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:h.websocketTimeout},g.signal,!p.singlePeerConnection);if(this.serverInfo=y,!y.version)throw new ube("unknown server version");return y.version==="0.15.1"&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version"),p.dynacast=!1),v}),this.applyJoinResponse=u=>{const l=u.participant;if(this.localParticipant.sid=l.sid,this.localParticipant.identity=l.identity,this.localParticipant.setEnabledPublishCodecs(u.enabledPublishCodecs),this.e2eeManager)try{this.e2eeManager.setSifTrailer(u.sifTrailer)}catch(d){this.log.error(d instanceof Error?d.message:"Could not set SifTrailer",{error:d})}this.handleParticipantUpdates([l,...u.otherParticipants]),u.room&&this.handleRoomUpdate(u.room)},this.attemptConnection=(u,l,d,h)=>Q(this,void 0,void 0,function*(){var p,g;this.state===yn.Reconnecting||this.isResuming||!((p=this.engine)===null||p===void 0)&&p.pendingReconnect?(this.log.info("Reconnection attempt replaced by new connection attempt"),this.recreateEngine(!0)):this.maybeCreateEngine(),!((g=this.regionUrlProvider)===null||g===void 0)&&g.isCloud()&&this.engine.setRegionStrategy(this.createRegionStrategy()),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},dE),d),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const v=yield this.connectSignal(u,l,this.engine,this.connOptions,this.options,h);this.applyJoinResponse(v),this.setupLocalParticipantEvents(),this.emit
3926(Me.SignalConnected)}catch(v){yield this.engine.close(),this.recreateEngine();const y=h.signal.aborted?pt.cancelled("Signal connection aborted"):pt.serverUnreachable("could not establish signal connection");throw v instanceof Error&&(y.message="".concat(y.message,": ").concat(v.message)),v instanceof pt&&(y.reason=v.reason,y.status=v.status),this.log.debug("error trying to establish signal connection",{error:v}),y}if(h.signal.aborted)throw yield this.engine.close(),this.recreateEngine(),pt.cancelled("Connection attempt aborted");try{yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,h)}catch(v){throw yield this.engine.close(),this.recreateEngine(),v}Fa()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),Fa()&&window.addEventListener("freeze",this.onPageLeave),this.setAndEmitConnectionState(yn.Connected),this.emit(Me.Connected),Jh.getInstance().resetFailedConnectionAttempts(u),this.registerConnectionReconcile(),this.regionUrlProvider&&this.regionUrlProvider.notifyConnected()}),this.disconnect=function(){for(var u=arguments.length,l=new Array(u),d=0;d<u;d++)l[d]=arguments[d];return Q(t,[...l],void 0,function(){var h=this;let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var g,v,y;const b=yield h.disconnectLock.lock();try{if(h.state===yn.Disconnected){h.log.debug("already disconnected");return}if(h.log.info("disconnect from room"),h.state===yn.Connecting||h.state===yn.Reconnecting||h.isResuming){const x="Abort connection attempt due to user initiated disconnect";h.log.warn(x),(g=h.abortController)===null||g===void 0||g.abort(x),(y=(v=h.connectFuture)===null||v===void 0?void 0:v.reject)===null||y===void 0||y.call(v,pt.cancelled("Client initiated disconnect")),h.connectFuture=void 0}h.engine&&(h.engine.client.isDisconnected||(yield h.engine.client.sendLeave()),yield h.engine.close()),h.handleDisconnect(p,Zo.CLIENT_INITIATED),h.engine=void 0}finally{b()}}()})},this.onPageLeave=()=>Q(this,void 0,void 0,function*(){this.log.info("Page leave detected, disconnecting"),yield this.disconnect()}),this.startAudio=()=>Q(this,void 0,void 0,function*(){const u=[],l=ba();if(l&&l.os==="iOS"){const d="livekit-dummy-audio-el";let h=document.getElementById(d);if(!h){h=document.createElement("audio"),h.id=d,h.autoplay=!0,h.hidden=!0;const p=Yw();p.enabled=!0;const g=new MediaStream([p]);h.srcObject=g,document.addEventListener("visibilitychange",()=>{h&&(h.srcObject=document.hidden?null:g,document.hidden||(this.log.debug("page visible again, triggering startAudio to resume playback and update playback status"),this.startAudio()))}),document.body.append(h),this.once(Me.Disconnected,()=>{h==null||h.remove(),h=null})}u.push(h)}
3926this.remoteParticipants.forEach(d=>{d.audioTrackPublications.forEach(h=>{h.track&&h.track.attachedElements.forEach(p=>{u.push(p)})})});try{yield Promise.all([this.acquireAudioContext(),...u.map(d=>(d.muted=!1,d.play()))]),this.handleAudioPlaybackStarted()}catch(d){throw this.handleAudioPlaybackFailed(d),d}}),this.startVideo=()=>Q(this,void 0,void 0,function*(){const u=[];for(const l of this.remoteParticipants.values())l.videoTrackPublications.forEach(d=>{var h;(h=d.track)===null||h===void 0||h.attachedElements.forEach(p=>{u.includes(p)||u.push(p)})});yield Promise.all(u.map(l=>l.play())).then(()=>{this.handleVideoPlaybackStarted()}).catch(l=>{l.name==="NotAllowedError"?this.handleVideoPlaybackFailed():this.log.warn("Resuming video playback failed, make sure you call `startVideo` directly in a user gesture handler")})}),this.handleRestarting=()=>{this.clearConnectionReconcile(),this.isResuming=!1;for(const u of this.remoteParticipants.values())this.handleParticipantDisconnected(u.identity,u);this.setAndEmitConnectionState(yn.Reconnecting)&&this.emit(Me.Reconnecting)},this.handleRestarted=()=>{this.outgoingDataTrackManager.sfuWillRepublishTracks(),this.incomingDataTrackManager.resendSubscriptionUpdates()},this.handleSignalRestarted=u=>Q(this,void 0,void 0,function*(){this.log.debug("signal reconnected to server, region ".concat(u.serverRegion),{region:u.serverRegion}),this.bufferedEvents=[],this.applyJoinResponse(u);try{yield this.localParticipant.republishAllTracks(void 0,!0)}catch(l){this.log.error("error trying to re-publish tracks after reconnection",{error:l})}try{yield this.engine.waitForRestarted(),this.log.debug("fully reconnected to server",{region:u.serverRegion})}catch{return}this.setAndEmitConnectionState(yn.Connected),this.emit(Me.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents()}),this.handleParticipantUpdates=u=>{var l;for(const h of u){if(h.identity===this.localParticipant.identity){this.localParticipant.updateInfo(h);continue}h.identity===""&&(h.identity=(l=this.sidToIdentity.get(h.sid))!==null&&l!==void 0?l:"");let p=this.remoteParticipants.get(h.identity);h.state===Vh.DISCONNECTED?this.handleParticipantDisconnected(h.identity,p):p=this.getOrCreateParticipant(h.identity,h)}const d=new Map(u.filter(h=>h.identity!==this.localParticipant.identity).map(h=>[h.identity,h.dataTracks.map(p=>M_.from(p))]));this.incomingDataTrackManager.receiveSfuPublicationUpdates(d)},this.handleActiveSpeakersUpdate=u=>{const l=[],d={};u.forEach(h=>{if(d[h.sid]=!0,h.sid===this.localParticipant.sid)this.localParticipant.audioLevel=h.level,this.localParticipant.setIsSpeaking(!0),l.push(this.localParticipant);else{const p=this.getRemoteParticipantBySid(h.sid);p&&(p.audioLevel=h.level,p.setIsSpeaking(!0),l.push(p))}}),d[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.remoteParticipants.forEac
vendor: 4,253 bytes, line 3926
3926h(h=>{d[h.sid]||(h.audioLevel=0,h.setIsSpeaking(!1))}),this.activeSpeakers=l,this.emitWhenConnected(Me.ActiveSpeakersChanged,l)},this.handleSpeakersChanged=u=>{const l=new Map;this.activeSpeakers.forEach(h=>{const p=this.remoteParticipants.get(h.identity);p&&p.sid!==h.sid||l.set(h.sid,h)}),u.forEach(h=>{let p=this.getRemoteParticipantBySid(h.sid);h.sid===this.localParticipant.sid&&(p=this.localParticipant),p&&(p.audioLevel=h.level,p.setIsSpeaking(h.active),h.active?l.set(h.sid,p):l.delete(h.sid))});const d=Array.from(l.values());d.sort((h,p)=>p.audioLevel-h.audioLevel),this.activeSpeakers=d,this.emitWhenConnected(Me.ActiveSpeakersChanged,d)},this.handleStreamStateUpdate=u=>{u.streamStates.forEach(l=>{const d=this.getRemoteParticipantBySid(l.participantSid);if(!d)return;const h=d.getTrackPublicationBySid(l.trackSid);if(!h||!h.track)return;const p=Ae.streamStateFromProto(l.state);h.track.setStreamState(p),p!==h.track.streamState&&(d.emit(Ve.TrackStreamStateChanged,h,h.track.streamState),this.emitWhenConnected(Me.TrackStreamStateChanged,h,h.track.streamState,d))})},this.handleSubscriptionPermissionUpdate=u=>{const l=this.getRemoteParticipantBySid(u.participantSid);if(!l)return;const d=l.getTrackPublicationBySid(u.trackSid);d&&d.setAllowed(u.allowed)},this.handleSubscriptionError=u=>{const l=Array.from(this.remoteParticipants.values()).find(h=>h.trackPublications.has(u.trackSid));if(!l)return;const d=l.getTrackPublicationBySid(u.trackSid);d&&d.setSubscriptionError(u.err)},this.handleDataPacket=(u,l)=>{const d=this.remoteParticipants.get(u.participantIdentity);if(u.value.case==="user")this.handleUserPacket(d,u.value.value,u.kind,l);else if(u.value.case==="transcription")this.handleTranscription(d,u.value.value);else if(u.value.case==="sipDtmf")this.handleSipDtmf(d,u.value.value);else if(u.value.case==="chatMessage")this.handleChatMessage(d,u.value.value);else if(u.value.case==="metrics")this.handleMetrics(u.value.value,d);else if(u.value.case==="streamHeader"||u.value.case==="streamChunk"||u.value.case==="streamTrailer")this.handleDataStream(u,l);else if(u.value.case==="rpcRequest"){const h=u.value.value;this.handleIncomingRpcRequest(u.participantIdentity,h.id,h.method,h.payload,h.responseTimeoutMs,h.version)}},this.handleUserPacket=(u,l,d,h)=>{this.emit(Me.DataReceived,l.payload,u,d,l.topic,h),u==null||u.emit(Ve.DataReceived,l.payload,d,h)},this.handleSipDtmf=(u,l)=>{this.emit(Me.SipDTMFReceived,l,u),u==null||u.emit(Ve.SipDTMFReceived,l)},this.handleTranscription=(u,l)=>{const d=l.transcribedParticipantIdentity===this.localParticipant.identity?this.localParticipant:this.getParticipantByIdentity(l.transcribedParticipantIdentity),h=d==null?void 0:d.trackPublications.get(l.trackId),p=Nbe(l,this.transcriptionReceivedTimes);h==null||h.emit(We.TranscriptionReceived,p),d==null||d.emit(Ve.TranscriptionReceived,p,h),this.emit(Me.TranscriptionReceived,p,d,h)},this.handleChatMessage=(u,l)=>{const d=Lbe(l);this.emit(Me.ChatMessage,d,u)},this.handleMetrics=(u,l)=>{this.emit(Me.MetricsReceived,u,l)},this.handleDataStream=(u,l)=>{this.incomingDataStreamManager.handleDataStreamPacket(u,l)},this.bufferedSegments=new Map,this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(Me.AudioPlaybackStatusChanged,!0))},this.handleAudioPlaybackFailed=u=>{this.log.warn("could not playback audio",{error:u}),this.canPlaybackAudio&&(this.audioEnabled=!1,this.emit(Me.AudioPlaybackStatusChanged,!1))},this.handleVideoPlaybackStarted=()=>{this.isVideoPlaybackBlocked&&(this.isVideoPlaybackBlocked=!1,this.emit(Me.VideoPlaybackStatusChanged,!0))},this.handleVideoPlaybackFailed=()=>{this.isVideoPlaybackBlocked||(this.isVideoPlaybackBlocked=!0,this.emit(Me.VideoPlaybackStatusChanged,!1))},this.handleDeviceChange=()=>Q(this,void 0,void 0,function*(){var u;((u=ba())===null||u===void 0?void 0:u.os)!=="iOS"&&(yield this.selectDefaultDevices()),this.emit(Me.MediaDevicesChanged)}),this.handleRoomUpdate=u=>{const l=this.roomInfo;this.roomInfo=u,l&&l.metadata!==u.metadata&&this.emitWhenConnected(Me.RoomMetadataChanged,u.metadata),(l==null?void 0:l.activeRecording)!==u.activeRecording&&this.emitWhenConnected(Me.RecordingStatusChanged,u.activeRecording)},this.handleConnectionQualityUpdate=u=>
3926{u.updates.forEach(l=>{if(l.participantSid===this.localParticipant.sid){this.localParticipant.setConnectionQuality(l.quality);return}const d=this.getRemoteParticipantBySid(l.participantSid);d&&d.setConnectionQuality(l.quality)})},this.onLocalParticipantMetadataChanged=u=>{this.emit(Me.ParticipantMetadataChanged,u,this.localParticipant)},this.onLocalParticipantNameChanged=u=>{this.emit(Me.ParticipantNameChanged,u,this.localParticipant)},this.onLocalAttributesChanged=u=>{this.emit(Me.ParticipantAttributesChanged,u,this.localParticipant)},this.onLocalTrackMuted=u=>{this.emit(Me.TrackMuted,u,this.localParticipant)},this.onLocalTrackUnmuted=u=>{this.emit(Me.TrackUnmuted,u,this.localParticipant)},this.onTrackProcessorUpdate=u=>{var l;(l=u==null?void 0:u.onPublish)===null||l===void 0||l.call(u,this)},this.onLocalTrackPublished=u=>Q(this,void 0,void 0,function*(){var l,d,h,p,g,v;(l=u.track)===null||l===void 0||l.on(We.TrackProcessorUpdate,this.onTrackProcessorUpdate),(d=u.track)===null||d===void 0||d.on(We.Restarted,this.onLocalTrackRestarted),(g=(p=(h=u.track)===null||h===void 0?void 0:h.getProcessor())===null||p===void 0?void 0:p.onPublish)===null||g===void 0||g.call(p,this),this.emit(Me.LocalTrackPublished,u,this.localParticipant),Iu(u.track)&&(yield u.track.checkForSilence())&&this.emit(Me.LocalAudioSilenceDetected,u);const y=yield(v=u.track)===null||v===void 0?void 0:v.getDeviceId(!1),b=zk(u.source);b&&y&&y!==this.localParticipant.activeDeviceMap.get(b)&&(this.localParticipant.activeDeviceMap.set(b,y),this.emit(Me.ActiveDeviceChanged,b,y))}),this.onLocalTrackUnpublished=u=>{var l,d;(l=u.track)===null||l===void 0||l.off(We.TrackProcessorUpdate,this.onTrackProcessorUpdate),(d=u.track)===null||d===void 0||d.off(We.Restarted,this.onLocalTrackRestarted),this.emit(Me.LocalTrackUnpublished,u,this.localParticipant)},this.onLocalTrackRestarted=u=>Q(this,void 0,void 0,function*(){const l=yield u.getDeviceId(!1),d=zk(u.source);d&&l&&l!==this.localParticipant.activeDeviceMap.get(d)&&(this.log.debug("local track restarted, setting ".concat(d," ").concat(l," active")),this.localParticipant.activeDeviceMap.set(d,l),this.emit(Me.ActiveDeviceChanged,d,l))}),this.onLocalConnectionQualityChanged=u=>{this.emit(Me.ConnectionQualityChanged,u,this.localParticipant)},this.onMediaDevicesError=(u,l)=>{this.emit(Me.MediaDevicesError,u,l)},this.onLocalParticipantPermissionsChanged=u=>{this.emit(Me.ParticipantPermissionsChanged,u,this.localParticipant)},this.onLocalChatMessageSent=u=>{this.emit(Me.ChatMessage,u,this.localParticipant)},this.setMaxListeners(100),this.remoteParticipants=new Map,this.sidToIdentity=new Map,this.options=Object.assign(Object.assign({},v1e),e),this.log=Ha((r=this.options.loggerName)!==null&&r!==void 0?r:yi.Room,()=>this.logContext),this.transcriptionReceivedTimes=new Map,this.options.audioCaptureDefaults=Object.assign(Object.assign({},k$),e==null?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},S$),e==null?void 0:e.videoCaptureDefaults),this.options.publishDefaults=Object.assign(Object.assign({},g1e),e==null?void 0:e.publishDefaults),this.maybeCreateEngine(),this.incomingDataStreamManager=new V1e,this.outgoingDataStreamManager=new Y1e(this.engine,this.log),this.incomingDataTrackManager=new ixe({e2eeManager:this.e2eeManager}),this.incomingDataTrackManager.on("sfuUpdateSubscription",u=>{this.engine.client.sendUpdateDataSubscription(u.sid,u.subscribe)}).on("trackPublished",u=>{var l;u.track.publisherIdentity!==this.localParticipant.identity&&(this.emit(Me.DataTrackPublished,u.track),(l=this.remoteParticipants.get(u.track.publisherIdentity))===null||l===void 0||l.addRemoteDataTrack(u.track))}).on("trackUnpublished",u=>{var l;u.publisherIdentity!==this.localParticipant.identity&&(this.emit(Me.DataTrackUnpublished,u.sid),(l=this.remoteParticipants.get(u.publisherIdentity))===null||l===void 0||l.removeRemoteDataTrack(u.sid))}),this.outgoingDataTrackManager=new gE({e2eeManager:this.e2eeManager}),this.outgoingDataTrackManager.on("sfuPublishRequest",u=>{this.engine.client.sendPublishDataTrackRequest(u.handle,u.name,u.usesE2ee)}).on("sfuUnpublishRequest",u=>{this.engine.client.sendUnPublishDataTrackRequest(u.handle)}).on("trackPublished",u=>
3926{this.emit(Me.LocalDataTrackPublished,u.track)}).on("trackUnpublished",u=>{this.emit(Me.LocalDataTrackUnpublished,u.sid)}).on("packetAvailable",u=>{let{handle:l,bytes:d}=u;this.engine.sendLossyBytes(d,Vt.DATA_TRACK_LOSSY,"wait").finally(()=>this.outgoingDataTrackManager.handlePacketSendComplete(l))}),this.disconnectLock=new Ii,this.localParticipant=new hxe("","",this.engine,this.options,this.rpcHandlers,this.outgoingDataStreamManager,this.outgoingDataTrackManager),(this.options.e2ee||this.options.encryption)&&this.setupE2EE(),this.engine.e2eeManager=this.e2eeManager,this.incomingDataTrackManager.updateE2eeManager((i=this.e2eeManager)!==null&&i!==void 0?i:null),this.outgoingDataTrackManager.updateE2eeManager((a=this.e2eeManager)!==null&&a!==void 0?a:null),this.options.videoCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("videoinput",af(this.options.videoCaptureDefaults.deviceId)),this.options.audioCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("audioinput",af(this.options.audioCaptureDefaults.deviceId)),!((s=this.options.audioOutput)===null||s===void 0)&&s.deviceId&&this.switchActiveDevice("audiooutput",af(this.options.audioOutput.deviceId)).catch(u=>this.log.warn("Could not set audio output: ".concat(u.message))),Fa()){const u=new AbortController;(c=(o=navigator.mediaDevices)===null||o===void 0?void 0:o.addEventListener)===null||c===void 0||c.call(o,"devicechange",this.handleDeviceChange,{signal:u.signal}),wf.cleanupRegistry&&wf.cleanupRegistry.register(this,()=>{u.abort()})}}registerTextStreamHandler(e,t){return this.incomingDataStreamManager.registerTextStreamHandler(e,t)}unregisterTextStreamHandler(e){return this.incomingDataStreamManager.unregisterTextStreamHandler(e)}registerByteStreamHandler(e,t){return this.incomingDataStreamManager.registerByteStreamHandler(e,t)}unregisterByteStreamHandler(e){return this.incomingDataStreamManager.unregisterByteStreamHandler(e)}registerRpcMethod(e,t){if(this.rpcHandlers.has(e))throw Error("RPC handler already registered for method ".concat(e,", unregisterRpcMethod before trying to register again"));this.rpcHandlers.set(e,t)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setE2EEEnabled(e){return Q(this,void 0,void 0,function*(){const t=yield this.e2eeStateMutex.lock();try{if(this.e2eeManager)this.isE2EEEnabled!==e&&(yield this.localParticipant.setE2EEEnabled(e),this.localParticipant.identity!==""&&this.e2eeManager.setParticipantCryptorEnabled(e,this.localParticipant.identity));else throw Error("e2ee not configured, please set e2ee settings within the room options")}finally{t()}})}setupE2EE(){var e,t;const r=!!this.options.encryption,i=this.options.encryption||this.options.e2ee;i&&("e2eeManager"in i?(this.e2eeManager=i.e2eeManager,this.e2eeManager.isDataChannelEncryptionEnabled=r):this.e2eeManager=new Jbe(i,r),this.e2eeManager.on(Ol.ParticipantEncryptionStatusChanged,(a,s)=>{$be(s)&&(this.isE2EEEnabled=a),this.emit(Me.ParticipantEncryptionStatusChanged,a,s)}),this.e2eeManager.on(Ol.EncryptionError,(a,s)=>{const o=s?this.getParticipantByIdentity(s):void 0;this.emit(Me.EncryptionError,a,o)}),(e=this.e2eeManager)===null||e===void 0||e.setup(this),(t=this.e2eeManager)===null||t===void 0||t.setupEngine(this.engine))}get logContext(){var e,t,r;return{room:this.name,roomID:(e=this.roomInfo)===null||e===void 0?void 0:e.sid,participant:(t=this.localParticipant)===null||t===void 0?void 0:t.identity,participantID:(r=this.localParticipant)===null||r===void 0?void 0:r.sid}}get isRecording(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.activeRecording)!==null&&t!==void 0?t:!1}getSid(){return this.state===yn.Disconnected?Yi.resolve(""):this.roomInfo&&this.roomInfo.sid!==""?Yi.resolve(this.roomInfo.sid):new Yi((e,t)=>{const r=i=>{i.sid!==""&&(this.engine.off(Ue.RoomUpdate,r),e(i.sid))};this.engine.on(Ue.RoomUpdate,r),this.once(Me.Disconnected,()=>{this.engine.off(Ue.RoomUpdate,r),t(new dr("Room disconnected before room server id was available"))})})}get name(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:""}get metadata(){var e;return(e=this.roomInfo)===null||e===void 0?void 0:e.metadata}get numParticipants(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.numParticipants)!==null&&t!==void 0?t:0}get numPublishers(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.numPublishers)!==null&&t!==void 0?t:0}maybeCreateEngine(){this.engine&&(this.engine.isNewlyCreated||!this.engine.isClosed)||(this.engine=new j1e(this.options),this.engine.e2eeManager=this.e2eeManager,this.engine.on(Ue.ParticipantUpdate,this.handleParticipantUpdates).on(Ue.RoomUpdate,this.handleRoomUpdate).on(Ue.SpeakersChanged,this.handleSpeakersChanged).on(Ue.
3926StreamStateChanged,this.handleStreamStateUpdate).on(Ue.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(Ue.SubscriptionError,this.handleSubscriptionError).on(Ue.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(Ue.MediaTrackAdded,(e,t,r)=>{this.onTrackAdded(e,t,r)}).on(Ue.Disconnected,e=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,e)}).on(Ue.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(Ue.DataPacketReceived,this.handleDataPacket).on(Ue.Resuming,()=>{this.clearConnectionReconcile(),this.isResuming=!0,this.log.debug("Resuming signal connection"),this.setAndEmitConnectionState(yn.SignalReconnecting)&&this.emit(Me.SignalReconnecting)}).on(Ue.Resumed,()=>{this.registerConnectionReconcile(),this.isResuming=!1,this.log.debug("Resumed signal connection"),this.updateSubscriptions(),this.emitBufferedEvents(),this.setAndEmitConnectionState(yn.Connected)&&this.emit(Me.Reconnected)}).on(Ue.SignalResumed,()=>{this.bufferedEvents=[],(this.state===yn.Reconnecting||this.isResuming)&&this.sendSyncState()}).on(Ue.Restarting,this.handleRestarting).on(Ue.Restarted,this.handleRestarted).on(Ue.SignalRestarted,this.handleSignalRestarted).on(Ue.Offline,()=>{this.setAndEmitConnectionState(yn.Reconnecting)&&this.emit(Me.Reconnecting)}).on(Ue.DCBufferStatusChanged,(e,t)=>{this.emit(Me.DCBufferStatusChanged,e,t)}).on(Ue.LocalTrackSubscribed,e=>{this.handleLocalTrackSubscribed(e)}).on(Ue.RoomMoved,e=>{this.log.debug("room moved",e),e.room&&this.handleRoomUpdate(e.room),this.remoteParticipants.forEac
3926h((t,r)=>{this.handleParticipantDisconnected(r,t)}),this.emit(Me.Moved,e.room.name),e.participant?this.handleParticipantUpdates([e.participant,...e.otherParticipants]):this.handleParticipantUpdates(e.otherParticipants)}).on(Ue.PublishDataTrackResponse,e=>{if(!e.info){this.log.warn("received PublishDataTrackResponse, but event.info was ".concat(e.info,", so skipping."));return}this.outgoingDataTrackManager.receivedSfuPublishResponse(e.info.pubHandle,{type:"ok",data:{sid:e.info.sid,pubHandle:e.info.pubHandle,name:e.info.name,usesE2ee:e.info.encryption!==Bn.NONE}})}).on(Ue.UnPublishDataTrackResponse,e=>{if(!e.info){this.log.warn("received UnPublishDataTrackResponse, but event.info was ".concat(e.info,", so skipping."));return}this.outgoingDataTrackManager.receivedSfuUnpublishResponse(e.info.pubHandle)}).on(Ue.DataTrackSubscriberHandles,e=>{const t=new Map(Object.entries(e.subHandles).map(r=>{let[i,a]=r;return[parseInt(i,10),a.trackSid]}));this.incomingDataTrackManager.receivedSfuSubscriberHandles(t)}).on(Ue.DataTrackPacketReceived,e=>{try{this.incomingDataTrackManager.packetReceived(e)}catch(t){throw t}}).on(Ue.Joined,e=>{const t=new Map(e.otherParticipants.map(r=>[r.identity,r.dataTracks.map(i=>M_.from(i))]));this.incomingDataTrackManager.receiveSfuPublicationUpdates(t)}).on(Ue.TokenRefreshed,e=>{var t;(t=this.regionUrlProvider)===null||t===void 0||t.updateToken(e)}).on(Ue.ServerRegionsReported,e=>{var t;(t=this.regionUrlProvider)===null||t===void 0||t.setServerReportedRegions({regionSettings:e,updatedAtInMs:Date.now(),maxAgeInMs:Qk})}),this.localParticipant&&this.localParticipant.setupEngine(this.engine),this.e2eeManager&&this.e2eeManager.setupEngine(this.engine),this.outgoingDataStreamManager&&this.outgoingDataStreamManager.setupEngine(this.engine))}createRegionStrategy(){return{getNextUrl:e=>Q(this,void 0,void 0,function*(){return this.regionUrlProvider?this.regionUrlProvider.getNextBestRegionUrl(e):null}),resetAttempts:()=>{var e;return(e=this.regionUrlProvider)===null||e===void 0?void 0:e.resetAttempts()}}}static getLocalDevices(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return pi.getInstance().getDevices(e,t)}prepareConnection(e,t){return Q(this,void 0,void 0,function*(){if(this.state===yn.Disconnected){this.log.debug("prepareConnection to ".concat(e));try{if(pp(new URL(e))&&t){this.regionUrlProvider=new un(e,t);const r=yield this.regionUrlProvider.getNextBestRegionUrl();r&&this.state===yn.Disconnected&&(this.regionUrl=r,yield fetch($g(r),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(r)))}else yield fetch($g(e),{method:"HEAD"})}catch(r){this.log.warn("could not prepare connection",{error:r})}}})}getParticipantByIdentity(e){return this.localParticipant.identity===e?this.localParticipant:this.remoteParticipants.get(e)}clearConnectionFutures(){this.connectFuture=void 0}simulateScenario(e,t){return Q(this,void 0,void 0,function*(){let r=()=>Q(this,void 0,void 0,function*(){}),i;switch(e){case"signal-reconnect":yield this.engine.client.handleOnClose("simulate disconnect");break;case"fail-on-v1-path":this.engine.failNextV1Path();break;case"speaker":i=new Tc({scenario:{case:"speakerUpdate",value:3}});break;case"node-failure":i=new Tc({scenario:{case:"nodeFailure",value:!0}});break;case"server-leave":i=new Tc({scenario:{case:"serverLeave",value:!0}});break;case"migration":i=new Tc({scenario:{case:"migration",value:!0}});break;case"resume-reconnect":this.engine.failNext(),yield this.engine.client.handleOnClose("simulate resume-disconnect");break;case"disconnect-signal-on-resume":r=()=>Q(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new Tc({scenario:{case:"disconnectSignalOnResume",value:!0}});break;case"disconnect-signal-on-resume-no-messages":r=()=>Q(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new Tc({scenario:{case:"disconnectSignalOnResumeNoMessages",value:!0}});break;case"full-reconnect":this.engine.fullReconnectOnNext=!0,yield this.engine.client.handleOnClose("simulate full-reconnect");break;case"force-tcp":case"force-tls":i=new Tc({scenario:{case:"switchCandidateProtocol",value:e==="force-tls"?2:1}}),r=()=>Q(this,void 0,void 0,function*(){const a=this.engine.client.onLeave;a&&a(new jb({reason:Zo.CLIENT_INITIATED,action:Gh.RECONNECT}))});break;case"subscriber-bandwidth":if(t===void 0||typeof t!="number")throw new Error("subscriber-bandwidth requires a number as argument");i=new Tc({scenario:{case:"subscriberBandwidth",value:Nd(t)}});break;case"leave-full-reconnect":i=new Tc({scenario:{case:"leaveRequestFullReconnect",value:!0}})}i&&(yield this.engine.client.sendSimulateScenario(i),yield r())})}get canPlaybackAudio(){return this.audioEnabled}get canPlaybackVideo(){return!this.isVideoPlaybackBlocked}getActiveDevice(e){return this.localParticipant.activeDeviceMap.get(e)}switchActiveDevice(e,t){return Q(this,arguments,void 0,function(r,i){var a=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function*(){var o,c,u,l,d,h,p;let g=!0,v=!1;const y=s?{exact:i}:i;if(r==="audioinput"){v=a.localParticipant.audioTrackPublications.size===0;const b=(o=a.getActiveDevice(r))!==null&&o!==void 0?o:a.options.audioCaptureDefaults.deviceId;a.options.audioCaptureDefaults.deviceId=y;const x=Array.from(a.localParticipant.audioTrackPublications.values()).filter(w=>w.source===Ae.Source.Microphone);try{g=(yield Promise.all(x.map(w=>{var k;return(k=w.audioTrack)===null||k===void 0?void 0:k.setDeviceId(y)}))).every(w=>w===!0)}catch(w){throw a.options.audioCaptureDefaults.deviceId=b,w}const S=x.some(w=>{var k,E;return(E=(k=w.track)===null||k===void 0?void 0:k.isMuted)!==null&&E!==void 0?E:!1});g&&S&&(v=!0)}else if(r==="videoinput"){v=a.localParticipant.videoTrackPublications.size===0;const b=(c=a.getActiveDevice(r))!==null&&c!==void 0?c:a.options.videoCaptureDefaults.deviceId;a.options.videoCaptureDefaults.deviceId=y;const x=Array.from(a.localParticipant.videoTrackPublications.values()).filter(w=>w.source===Ae.Source.Camera);try{g=(yield Promise.all(x.map(w=>{var k;return(k=w.videoTrack)===null||k===void 0?void 0:k.setDeviceId(y)}))).every(w=>w===!0)}catch(w){throw a.options.videoCaptureDefaults.deviceId=b,w}const S=x.some(w=>{var k,E;return(E=(k=w.track)===null||k===void 0?void 0:k.isMuted)!==null&&E!==void 0?E:!1});g&&S&&(v=!0)}else if(r==="audiooutput"){if(v=!0,!Vk()&&!a.options.webAudioMix||a.options.webAudioMix&&a.audioContext&&!("setSinkId"in a.audioContext))throw new Error("cannot switch audio output, the current browser does not support it");a.options.webAudioMix&&(i=(u=yield pi.getInstance().normalizeDeviceId("audiooutput",i))!==null&&u!==void 0?u:""),(l=(p=a.options).audioOutput)!==null&&l!==void 0||(p.audioOutput={});const b=(d=a.getActiveDevice(r))!==null&&d!==void 0?d:a.options.audioOutput.deviceId;a.options.audioOutput.deviceId=i;try{a.options.webAudioMix&&((h=a.audioContext)===null||h===void 0||h.setSinkId(i)),yield Promise.all(Array.from(a.remoteParticipants.values()).map(x=>x.setAudioOutput({deviceId:i})))}catch(x){throw a.options.audioOutput.deviceId=b,x}}return v&&(a.localParticipant.activeDeviceMap.set(r,i),a.emit(Me.ActiveDeviceChanged,r,i)),g}()})}setupLocalParticipantEvents(){this.localParticipant.on(Ve.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(Ve.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(Ve.AttributesChanged,this.onLocalAttributesChanged).on(Ve.TrackMuted,this.onLocalTrackMuted).on(Ve.TrackUnmuted,this.onLocalTrackUnmuted).on(Ve.LocalTrackPublished,this.onLocalTrackPublished).on(Ve.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(Ve.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(Ve.MediaDevicesError,this.onMediaDevicesError).on(Ve.AudioStreamAcquired,this.startAudio).on(Ve.ChatMessage,this.onLocalChatMessageSent).on(Ve.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}recreateEngine(e){const t=this.engine;e&&t&&!t.client.isDisconnected?t.client.sendLeave().finally(()=>t.close()):t==null||t.close(),this.engine=void 0,this.isResuming=!1,this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.bufferedEvents=[],this.maybeCreateEngine()}onTrackAdded(e,t,r){if(this.state===yn.Connecting||this.state===yn.Reconnecting){const d=()=>{this.log.debug("deferring on track for later",{mediaTrackId:e.id,mediaStreamId:t.id,tracksInStream:t.getTracks().map(p=>p.id)}),this.onTrackAdded(e,t,r),h()},h=()=>{this.off(Me.Reconnected,d),this.off(Me.Connected,d),this.off(Me.Disconnected,h)};this.once(Me.Reconnected,d),this.once(Me.Connected,d),this.once(Me.Disconnected,h);return}if(this.state===yn.Disconnected){this.log.warn("skipping incoming track after Room disconnected");return}if(e.readyState==="ended"){this.log.debug("skipping incoming track as it already ended");return}const i=Cbe(t.id),a=i[0];let s=i[1],o=e.id;if(s&&s.startsWith("TR")&&(o=s),a===this.localParticipant.sid){this.log.warn("tried to create RemoteParticipant for local participant");return}const c=Array.from(this.remoteParticipants.values()).find(d=>d.sid===a);if(!c){a.startsWith("PA")&&this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(a));return}if(!o.startsWith("TR")){const d=this.engine.getTrackIdForReceiver(r);
3926if(!d){this.log.error("Tried to add a track whose 'sid' could not be found for a participant, that's not present. Sid: ".concat(a));return}o=d}o.startsWith("TR")||this.log.warn("Tried to add a track whose 'sid' could not be determined for a participant, that's not present. Sid: ".concat(a,", streamId: ").concat(s,", trackId: ").concat(o),{remoteParticipantID:a,streamId:s,trackId:o});let u;this.options.adaptiveStream&&(typeof this.options.adaptiveStream=="object"?u=this.options.adaptiveStream:u={});const l=c.addSubscribedMediaTrack(e,o,t,r,u);l!=null&&l.isEncrypted&&!this.e2eeManager&&this.emit(Me.EncryptionError,new Error("Encrypted ".concat(l.source," track received from participant ").concat(c.sid,", but room does not have encryption enabled!")))}handleLocalTrackSubscribed(e){const t=()=>this.localParticipant.getTrackPublications().find(c=>{let{trackSid:u}=c;return u===e}),r=t();if(r){this.emitLocalTrackSubscribed(r);return}this.log.debug("deferring LocalTrackSubscribed, publication not yet available",{subscribedSid:e});const i=1e4;let a;const s=c=>{c.trackSid===e&&(o(),this.emitLocalTrackSubscribed(c))},o=()=>{clearTimeout(a),this.localParticipant.off(Ve.LocalTrackPublished,s),this.off(Me.Disconnected,o)};this.localParticipant.on(Ve.LocalTrackPublished,s),this.once(Me.Disconnected,o),a=setTimeout(()=>{o();const c=t();c?this.emitLocalTrackSubscribed(c):this.log.warn("could not find local track publication for LocalTrackSubscribed event after timeout",{subscribedSid:e})},i)}emitLocalTrackSubscribed(e){this.localParticipant.emit(Ve.LocalTrackSubscribed,e),this.emitWhenConnected(Me.LocalTrackSubscribed,e,this.localParticipant)}handleDisconnect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1?arguments[1]:void 0;var r,i;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.incomingDataStreamManager.clearControllers(),this.incomingDataTrackManager.reset(),this.outgoingDataTrackManager.reset(),this.state!==yn.Disconnected){this.regionUrl=void 0,this.regionUrlProvider&&this.regionUrlProvider.notifyDisconnected();
vendor: 25,898 bytes, line 3926
3926try{this.remoteParticipants.forEach(a=>{a.trackPublications.forEach(s=>{a.unpublishTrack(s.trackSid)})}),this.localParticipant.trackPublications.forEach(a=>{var s,o,c;a.track&&this.localParticipant.unpublishTrack(a.track,e),e?((s=a.track)===null||s===void 0||s.detach(),(o=a.track)===null||o===void 0||o.stop()):(c=a.track)===null||c===void 0||c.stopMonitor()}),this.localParticipant.off(Ve.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(Ve.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(Ve.AttributesChanged,this.onLocalAttributesChanged).off(Ve.TrackMuted,this.onLocalTrackMuted).off(Ve.TrackUnmuted,this.onLocalTrackUnmuted).off(Ve.LocalTrackPublished,this.onLocalTrackPublished).off(Ve.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(Ve.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(Ve.MediaDevicesError,this.onMediaDevicesError).off(Ve.AudioStreamAcquired,this.startAudio).off(Ve.ChatMessage,this.onLocalChatMessageSent).off(Ve.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.trackPublications.clear(),this.localParticipant.videoTrackPublications.clear(),this.localParticipant.audioTrackPublications.clear(),this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.activeSpeakers=[],this.audioContext&&typeof this.options.webAudioMix=="boolean"&&(this.audioContext.close(),this.audioContext=void 0),Fa()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),(i=(r=navigator.mediaDevices)===null||r===void 0?void 0:r.removeEventListener)===null||i===void 0||i.call(r,"devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(yn.Disconnected),this.emit(Me.Disconnected,t)}}}handleParticipantDisconnected(e,t){var r;this.remoteParticipants.delete(e),t&&(this.incomingDataStreamManager.validateParticipantHasNoActiveDataStreams(e),this.incomingDataTrackManager.handleRemoteParticipantDisconnected(e),t.trackPublications.forEach(i=>{t.unpublishTrack(i.trackSid,!0)}),this.emit(Me.ParticipantDisconnected,t),t.setDisconnected(),(r=this.localParticipant)===null||r===void 0||r.handleParticipantDisconnected(t.identity))}handleIncomingRpcRequest(e,t,r,i,a,s){return Q(this,void 0,void 0,function*(){if(yield this.engine.publishRpcAck(e,t),s!==1){yield this.engine.publishRpcResponse(e,t,null,kr.builtIn("UNSUPPORTED_VERSION"));return}const o=this.rpcHandlers.get(r);if(!o){yield this.engine.publishRpcResponse(e,t,null,kr.builtIn("UNSUPPORTED_METHOD"));return}let c=null,u=null;try{const l=yield o({requestId:t,callerIdentity:e,payload:i,responseTimeout:a});fE(l)>T$?(c=kr.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"),this.log.warn("RPC Response payload too large for ".concat(r))):u=l}catch(l){l instanceof kr?c=l:(this.log.warn("Uncaught error returned by RPC handler for ".concat(r,". Returning APPLICATION_ERROR instead."),l),c=kr.builtIn("APPLICATION_ERROR"))}yield this.engine.publishRpcResponse(e,t,u,c)})}selectDefaultDevices(){return Q(this,void 0,void 0,function*(){var e,t,r;const i=pi.getInstance().previousDevices,a=yield pi.getInstance().getDevices(void 0,!1),s=ba();if((s==null?void 0:s.name)==="Chrome"&&s.os!=="iOS")for(let c of a){const u=i.find(l=>l.deviceId===c.deviceId);u&&u.label!==""&&u.kind===c.kind&&u.label!==c.label&&this.getActiveDevice(c.kind)==="default"&&this.emit(Me.ActiveDeviceChanged,c.kind,c.deviceId)}const o=["audiooutput","audioinput","videoinput"];for(let c of o){const u=pbe(c),l=this.localParticipant.getTrackPublication(u);if(l&&(!((e=l.track)===null||e===void 0)&&e.isUserProvided))continue;const d=a.filter(p=>p.kind===c),h=this.getActiveDevice(c);if(h===((t=i.filter(p=>p.kind===c)[0])===null||t===void 0?void 0:t.deviceId)&&d.length>0&&((r=d[0])===null||r===void 0?void 0:r.deviceId)!==h){yield this.switchActiveDevice(c,d[0].deviceId);continue}c==="audioinput"&&!Fg()||c==="videoinput"||d.length>0&&!d.find(p=>p.deviceId===this.getActiveDevice(c))&&(c!=="audiooutput"||!Fg())&&(yield this.switchActiveDevice(c,d[0].deviceId))}})}acquireAudioContext(){return Q(this,void 0,void 0,function*(){var e,t;if(typeof this.options.webAudioMix!="boolean"&&this.options.webAudioMix.audioContext?this.audioContext=this.options.webAudioMix.audioContext:(!this.audioContext||this.audioContext.state==="closed")&&(this.audioContext=(e=v$())!==null&&e!==void 0?e:void 0),this.options.webAudioMix&&this.remoteParticipants.forEach(i=>i.setAudioContext(this.audioContext)),this.localParticipant.setAudioContext(this.audioContext),this.audioContext&&this.audioContext.state==="suspended")try{yield Promise.race([this.audioContext.resume(),Ji(200)])}catch(i){this.log.warn("Could not resume audio context",{error:i})}const r=((t=this.audioContext)===null||t===void 0?void 0:t.state)==="running";r!==this.canPlaybackAudio&&(this.audioEnabled=r,this.emit(Me.AudioPlaybackStatusChanged,r))})}createParticipant(e,t){var r;let i;return t?i=$_.fromParticipantInfo(this.engine.client,t,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName},this.incomingDataTrackManager):i=new $_(this.engine.client,"",e,void 0,void 0,void 0,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}),this.options.webAudioMix&&i.setAudioContext(this.audioContext),!((r=this.options.audioOutput)===null||r===void 0)&&r.deviceId&&i.setAudioOutput(this.options.audioOutput).catch(a=>this.log.warn("Could not set audio output: ".concat(a.message))),i}getOrCreateParticipant(e,t){if(this.remoteParticipants.has(e)){const i=this.remoteParticipants.get(e);return t&&i.updateInfo(t)&&this.sidToIdentity.set(t.sid,t.identity),i}const r=this.createParticipant(e,t);return this.remoteParticipants.set(e,r),this.sidToIdentity.set(t.sid,t.identity),this.emitWhenConnected(Me.ParticipantConnected,r),r.on(Ve.TrackPublished,i=>{this.emitWhenConnected(Me.TrackPublished,i,r)}).on(Ve.TrackSubscribed,(i,a)=>{i.kind===Ae.Kind.Audio?(i.on(We.AudioPlaybackStarted,this.handleAudioPlaybackStarted),i.on(We.AudioPlaybackFailed,this.handleAudioPlaybackFailed)):i.kind===Ae.Kind.Video&&(i.on(We.VideoPlaybackFailed,this.handleVideoPlaybackFailed),i.on(We.VideoPlaybackStarted,this.handleVideoPlaybackStarted)),this.emitWhenConnected(Me.TrackSubscribed,i,a,r)}).on(Ve.TrackUnpublished,i=>{this.emit(Me.TrackUnpublished,i,r)}).on(Ve.TrackUnsubscribed,(i,a)=>{this.emit(Me.TrackUnsubscribed,i,a,r)}).on(Ve.TrackMuted,i=>{this.emitWhenConnected(Me.TrackMuted,i,r)}).on(Ve.TrackUnmuted,i=>{this.emitWhenConnected(Me.TrackUnmuted,i,r)}).on(Ve.ParticipantMetadataChanged,i=>{this.emitWhenConnected(Me.ParticipantMetadataChanged,i,r)}).on(Ve.ParticipantNameChanged,i=>{this.emitWhenConnected(Me.ParticipantNameChanged,i,r)}).on(Ve.AttributesChanged,i=>{this.emitWhenConnected(Me.ParticipantAttributesChanged,i,r)}).on(Ve.ConnectionQualityChanged,i=>{this.emitWhenConnected(Me.ConnectionQualityChanged,i,r)}).on(Ve.ParticipantPermissionsChanged,i=>{this.emitWhenConnected(Me.ParticipantPermissionsChanged,i,r)}).on(Ve.TrackSubscriptionStatusChanged,(i,a)=>{this.emitWhenConnected(Me.TrackSubscriptionStatusChanged,i,a,r)}).on(Ve.TrackSubscriptionFailed,(i,a)=>{this.emit(Me.TrackSubscriptionFailed,i,r,a)}).on(Ve.TrackSubscriptionPermissionChanged,(i,a)=>{this.emitWhenConnected(Me.TrackSubscriptionPermissionChanged,i,a,r)}).on(Ve.Active,()=>{this.emitWhenConnected(Me.ParticipantActive,r),r.kind===Mg.AGENT&&this.localParticipant.setActiveAgent(r)}),t&&r.updateInfo(t),r}sendSyncState(){const e=Array.from(this.remoteParticipants.values()).reduce((i,a)=>(i.push(...a.getTrackPublications()),i),[]),t=this.localParticipant.getTrackPublications(),r=this.outgoingDataTrackManager.queryPublished();this.engine.sendSyncState(e,t,r)}updateSubscriptions(){for(const e of this.remoteParticipants.values())for(const t of e.videoTrackPublications.values())t.isSubscribed&&Fbe(t)&&t.emitTrackUpdate()}getRemoteParticipantBySid(e){const t=this.sidToIdentity.get(e);if(t)return this.remoteParticipants.get(t)}registerConnectionReconcile(){this.clearConnectionReconcile();let e=0;this.connectionReconcileInterval=Vr.setInterval(()=>{!this.engine||this.engine.isClosed||!this.engine.verifyTransport()?(e++,this.log.warn("detected connection state mismatch",{numFailures:e,engine:this.engine?{closed:this.engine.isClosed,transportsConnectedOrConnecting:this.engine.verifyTransport()}:void 0}),e>=3&&(this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,Zo.STATE_MISMATCH))):e=0},gxe)}clearConnectionReconcile(){this.connectionReconcileInterval&&Vr.clearInterval(this.connectionReconcileInterval)}setAndEmitConnectionState(e){return e===this.state?!1:(this.log.info("connection state changed: ".concat(this.state," -> ").concat(e)),this.state=e,this.incomingDataStreamManager.setConnected(e===yn.Connected),this.emit(Me.ConnectionStateChanged,this.state),!0)}emitBufferedEvents(){this.bufferedEvents.forEach(e=>{let[t,r]=e;this.emit(t,...r)}),this.bufferedEvents=[]}emitWhenConnected(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(this.state===yn.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([e,r]);else if(this.state===yn.Connected)return this.emit(e,...r);return!1}simulateParticipants(e){return Q(this,void 0,void 0,function*(){var t,r,i,a;const s=Object.assign({audio:!0,video:!0,useRealTracks:!1},e.publish),o=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},e.participants);if(this.handleDisconnect(),this.roomInfo=new Lb({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:ir.parse(new Date().getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new bf({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(Me.SignalConnected),this.emit(Me.Connected),this.setAndEmitConnectionState(yn.Connected),s.video){const c=new e2(Ae.Kind.Video,new Eh({source:zr.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:Wo.AUDIO,name:"video-dummy"}),new L_(s.useRealTracks&&(!((t=window.navigator.mediaDevices)===null||t===void 0)&&t.getUserMedia)?(yield window.navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0]:YI(160*((r=o.aspectRatios[0])!==null&&r!==void 0?r:1),160,!0,!0),void 0,!1,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(c),this.localParticipant.emit(Ve.LocalTrackPublished,c)}if(s.audio){const c=new e2(Ae.Kind.Audio,new Eh({source:zr.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:Wo.AUDIO}),new D_(s.useRealTracks&&(!((i=navigator.mediaDevices)===null||i===void 0)&&i.getUserMedia)?(yield navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0]:Yw(),void 0,!1,this.audioContext,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(c),this.localParticipant.emit(Ve.LocalTrackPublished,c)}for(let c=0;c<o.count-1;c+=1){let u=new bf({sid:Math.floor(Math.random()*1e4).toString(),identity:"simulated-".concat(c),state:Vh.ACTIVE,tracks:[],joinedAt:ir.parse(Date.now())});const l=this.getOrCreateParticipant(u.identity,u);if(o.video){const d=YI(160*((a=o.aspectRatios[c%o.aspectRatios.length])!==null&&a!==void 0?a:1),160,!1,!0),h=new Eh({source:zr.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:Wo.AUDIO});l.addSubscribedMediaTrack(d,h.sid,new MediaStream([d]),new RTCRtpReceiver),u.tracks=[...u.tracks,h]}if(o.audio){const d=Yw(),h=new Eh({source:zr.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:Wo.AUDIO});l.addSubscribedMediaTrack(d,h.sid,new MediaStream([d]),new RTCRtpReceiver),u.tracks=[...u.tracks,h]}l.updateInfo(u)}})}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(e!==Me.ActiveSpeakersChanged&&e!==Me.TranscriptionReceived){const a=q$(r).filter(s=>s!==void 0);(e===Me.TrackSubscribed||e===Me.TrackUnsubscribed)&&this.log.trace("subscribe trace: ".concat(e),{event:e,args:a}),this.log.debug("room event ".concat(e),{event:e,args:a})}return super.emit(e,...r)}}wf.cleanupRegistry=typeof FinalizationRegistry<"u"&&new FinalizationRegistry(n=>{n()});function q$(n){return n.map(e=>{if(e)return Array.isArray(e)?q$(e):typeof e=="object"?"logContext"in e?e.logContext:void 0:e})}var Uo;(function(n){n[n.IDLE=0]="IDLE",n[n.RUNNING=1]="RUNNING",n[n.SKIPPED=2]="SKIPPED",n[n.SUCCESS=3]="SUCCESS",n[n.FAILED=4]="FAILED"})(Uo||(Uo={}));class pd extends xo.EventEmitter{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.status=Uo.IDLE,this.logs=[],this.options={},this.url=e,this.token=t,this.name=this.constructor.name,this.room=new wf(r.roomOptions),this.connectOptions=r.connectOptions,this.options=r}run(e){return Q(this,void 0,void 0,function*(){if(this.status!==Uo.IDLE)throw Error("check is running already");this.setStatus(Uo.RUNNING);try{yield this.perform()}catch(t){t instanceof Error&&(this.options.errorsAsWarnings?this.appendWarning(t.message):this.appendError(t.message))}return yield this.disconnect(),yield new Promise(t=>setTimeout(t,500)),this.status!==Uo.SKIPPED&&this.setStatus(this.isSuccess()?Uo.SUCCESS:Uo.FAILED),e&&e(),this.getInfo()})}isSuccess(){return!this.logs.some(e=>e.level==="error")}connect(e){return Q(this,void 0,void 0,function*(){return this.room.state===yn.Connected?this.room:(e||(e=this.url),yield this.room.connect(e,this.token,this.connectOptions),this.room)})}disconnect(){return Q(this,void 0,void 0,function*(){this.room&&this.room.state!==yn.Disconnected&&(yield this.room.disconnect(),yield new Promise(e=>setTimeout(e,500)))})}skip(){this.setStatus(Uo.SKIPPED)}switchProtocol(e){return Q(this,void 0,void 0,function*(){let t=!1,r=!1;if(this.room.on(Me.Reconnecting,()=>{t=!0}),this.room.once(Me.Reconnected,()=>{r=!0}),this.room.simulateScenario("force-".concat(e)),yield new Promise(a=>setTimeout(a,1e3)),!t)return;const i=Date.now()+1e4;for(;Date.now()<i;){if(r)return;yield Ji(100)}throw new Error("Could not reconnect using ".concat(e," protocol after 10 seconds"))})}appendMessage(e){this.logs.push({level:"info",message:e}),this.emit("update",this.getInfo())}appendWarning(e){this.logs.push({level:"warning",message:e}),this.emit("update",this.getInfo())}appendError(e){this.logs.push({level:"error",message:e}),this.emit("update",this.getInfo())}setStatus(e){this.status=e,this.emit("update",this.getInfo())}get engine(){var e;return(e=this.room)===null||e===void 0?void 0:e.engine}getInfo(){return{logs:this.logs,name:this.name,status:this.status,description:this.description}}}class vxe extends pd{get description(){return"Cloud regions"}perform(){return Q(this,void 0,void 0,function*(){const e=new un(this.url,this.token);if(!e.isCloud()){this.skip();return}const t=[],r=new Set;for(let a=0;a<3;a++){const s=yield e.getNextBestRegionUrl();if(!s)break;if(r.has(s))continue;r.add(s);const o=yield this.checkCloudRegion(s);this.appendMessage("".concat(o.region," RTT: ").concat(o.rtt,"ms, duration: ").concat(o.duration,"ms")),t.push(o)}t.sort((a,s)=>(a.duration-s.duration)*.5+(a.rtt-s.rtt)*.5);const i=t[0];this.bestStats=i,this.appendMessage("best Cloud region: ".concat(i.region))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkCloudRegion(e){return Q(this,void 0,void 0,function*(){var t,r;yield this.connect(e),this.options.protocol==="tcp"&&(yield this.switchProtocol("tcp"));const i=(t=this.room.serverInfo)===null||t===void 0?void 0:t.region;if(!i)throw new Error("Region not found");const a=yield this.room.localParticipant.streamText({topic:"test"}),s=1e3,c=1e6/s,u="A".repeat(s),l=Date.now();for(let g=0;g<c;g++)yield a.write(u);yield a.close();const d=Date.now(),h=yield(r=this.room.engine.pcManager)===null||r===void 0?void 0:r.publisher.getStats(),p={region:i,rtt:1e4,duration:d-l};return h==null||h.forEach(g=>{g.type==="candidate-pair"&&g.nominated&&(p.rtt=g.currentRoundTripTime*1e3)}),yield this.disconnect(),p})}}const sC=1e4;class yxe extends pd{get description(){return"Connection via UDP vs TCP"}perform(){return Q(this,void 0,void 0,function*(){const e=yield this.checkConnectionProtocol("udp"),t=yield this.checkConnectionProtocol("tcp");this.bestStats=e,e.qualityLimitationDurations.bandwidth-t.qualityLimitationDurations.bandwidth>.5||(e.packetsLost-t.packetsLost)/e.packetsSent>.01?(this.appendMessage("best connection quality via tcp"),this.bestStats=t):this.appendMessage("best connection quality via udp");const r=this.bestStats;this.appendMessage("upstream bitrate: ".concat((r.bitrateTotal/r.count/1e3/1e3).toFixed(2)," mbps")),this.appendMessage("RTT: ".concat((r.rttTotal/r.count*1e3).toFixed(2)," ms")),this.appendMessage("jitter: ".concat((r.jitterTotal/r.count*1e3).toFixed(2)," ms")),r.packetsLost>0&&this.appendWarning("packets lost: ".concat((r.packetsLost/r.packetsSent*100).toFixed(2),"%")),r.qualityLimitationDurations.bandwidth>1&&this.appendWarning("bandwidth limited ".concat((r.qualityLimitationDurations.bandwidth/(sC/1e3)*100).toFixed(2),"%")),r.qualityLimitationDurations.cpu>0&&this.appendWarning("cpu limited ".concat((r.qualityLimitationDurations.cpu/(sC/1e3)*100).toFixed(2),"%"))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkConnectionProtocol(e){return Q(this,void 0,void 0,function*(){yield this.connect(),e==="tcp"?yield this.switchProtocol("tcp"):yield this.switchProtocol("udp");const t=document.createElement("canvas");t.width=1280,t.height=720;const r=t.getContext("2d");if(!r)throw new Error("Could not get canvas context");let i=0;const a=()=>{i=(i+1)%360,r.fillStyle="hsl(".concat(i,", 100%, 50%)"),r.fillRect(0,0,t.width,t.height),requestAnimationFrame(a)};a();const o=t.captureStream(30).getVideoTracks()[0],u=(yield this.room.localParticipant.publishTrack(o,{simulcast:!1,degradationPreference:"maintain-resolution",videoEncoding:{maxBitrate:2e6}})).track,l={protocol:e,packetsLost:0,packetsSent:0,qualityLimitationDurations:{},rttTotal:0,jitterTotal:0,bitrateTotal:0,count:0},d=setInterval(()=>Q(this,void 0,void 0,function*(){const h=yield u.getRTCStatsReport();h==null||h.forEach(p=>{p.type==="outbound-rtp"?(l.packetsSent=p.packetsSent,l.qualityLimitationDurations=p.qualityLimitationDurations,l.bitrateTotal+=p.targetBitrate,l.count++):p.type==="remote-inbound-rtp"&&(l.packetsLost=p.packetsLost,l.rttTotal+=p.roundTripTime,l.jitterTotal+=p.jitter)})}),1e3);return yield new Promise(h=>setTimeout(h,sC)),clearInterval(d),o.stop(),t.remove(),yield this.disconnect(),l})}}class _xe extends pd{get description(){return"Can publish audio"}perform(){return Q(this,void 0,void 0,function*(){var e;const t=yield this.connect(),r=yield lxe();if(yield g$(r,1e3))throw new Error("unable to detect audio from microphone");this.appendMessage("detected audio from microphone"),t.localParticipant.publishTrack(r),yield new Promise(o=>setTimeout(o,3e3));const a=yield(e=r.sender)===null||e===void 0?void 0:e.getStats();if(!a)throw new Error("Could not get RTCStats");let s=0;if(a.forEach(o=>{o.type==="outbound-rtp"&&(o.kind==="audio"||!o.kind&&o.mediaType==="audio")&&(s=o.packetsSent)}),s===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(s," audio packets"))})}}class bxe extends pd{get description(){return"Can publish video"}perform(){return Q(this,void 0,void 0,function*(){var e;const t=yield this.connect(),r=yield uxe();yield this.checkForVideo(r.mediaStreamTrack),t.localParticipant.publishTrack(r),yield new Promise(s=>setTimeout(s,5e3));const i=yield(e=r.sender)===null||e===void 0?void 0:e.getStats();if(!i)throw new Error("Could not get RTCStats");let a=0;if(i.forEach(s=>{s.type==="outbound-rtp"&&(s.kind==="video"||!s.kind&&s.mediaType==="video")&&(a+=s.packetsSent)}),a===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(a," video packets"))})}checkForVideo(e){return Q(this,void 0,void 0,function*(){const t=new MediaStream;t.addTrack(e.clone());const r=document.createElement("video");r.srcObject=t,r.muted=!0,r.autoplay=!0,r.playsInline=!0,r.setAttribute("playsinline","true"),document.body.appendChild(r),yield new Promise(i=>{r.onplay=()=>{setTimeout(()=>{var a,s,o,c;const u=document.createElement("canvas"),l=e.getSettings(),d=(s=(a=l.width)!==null&&a!==void 0?a:r.videoWidth)!==null&&s!==void 0?s:1280,h=(c=(o=l.height)!==null&&o!==void 0?o:r.videoHeight)!==null&&c!==void 0?c:720;u.width=d,u.height=h;const p=u.getContext("2d");p.drawImage(r,0,0);const v=p.getImageData(0,0,u.width,u.height).data;let y=!0;for(let b=0;b<v.length;b+=4)if(v[b]!==0||v[b+1]!==0||v[b+2]!==0){y=!1;break}y?this.appendError("camera appears to be producing only black frames"):this.appendMessage("received video frames"),i()},1e3)},r.play()}),t.getTracks().forEach(i=>i.stop()),r.remove()})}}class xxe extends pd{get description(){return"Resuming connection after interruption"}perform(){return Q(this,void 0,void 0,function*(){var e;const t=yield this.connect();let r=!1,i=!1,a;const s=new Promise(u=>{setTimeout(u,5e3),a=u}),o=()=>{r=!0};t.on(Me.SignalReconnecting,o).on(Me.Reconnecting,o).on(Me.Reconnected,()=>{i=!0,a(!0)}),(e=t.engine.client.ws)===null||e===void 0||e.close();const c=t.engine.client.onClose;if(c&&c(""),yield s,r){if(!i||t.state!==yn.Connected)throw this.appendWarning("reconnection is only possible in Redis-based configurations"),new Error("Not able to reconnect")}else throw new Error("Did not attempt to reconnect")})}}class wxe extends pd{get description(){return"Can connect via TURN"}perform(){return Q(this,void 0,void 0,function*(){var e,t,r;pp(new URL(this.url))&&(this.appendMessage("Using region specific url"),this.url=(e=yield new un(this.url,this.token).getNextBestRegionUrl())!==null&&e!==void 0?e:this.url);const i=new oE,a=yield i.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3},void 0,!0);let s=!1,o=!1,c=!1;for(let u of a.iceServers)for(let l of u.urls)l.startsWith("turn:")?(o=!0,c=!0):l.startsWith("turns:")&&(o=!0,c=!0,s=!0),l.startsWith("stun:")&&(c=!0);c?o&&!s&&this.appendWarning("TURN is configured server side, but TURN/TLS is unavailable."):this.appendWarning("No STUN servers configured on server side."),yield i.close(),!((r=(t=this.connectOptions)===null||t===void 0?void 0:t.rtcConfig)===null||r===void 0)&&r.iceServers||o?yield this.room.connect(this.url,this.token,{rtcConfig:{iceTransportPolicy:"relay"}}):(this.appendWarning("No TURN servers configured."),this.skip(),yield new Promise(u=>setTimeout(u,0)))})}}class Cxe extends pd{get description(){return"Establishing WebRTC connection"}perform(){return Q(this,void 0,void 0,function*(){let e=!1,t=!1;this.room.on(Me.SignalConnected,()=>{var r;const i=this.room.engine.client.onTrickle;this.room.engine.client.onTrickle=(a,s)=>{if(a.candidate){const o=new RTCIceCandidate(a);let c="".concat(o.protocol," ").concat(o.address,":").concat(o.port," ").concat(o.type);o.address&&(kxe(o.address)?c+=" (private)":o.protocol==="tcp"&&o.tcpType==="passive"?(e=!0,c+=" (passive)"):o.protocol==="udp"&&(t=!0)),this.appendMessage(c)}i&&i(a,s)},!((r=this.room.engine.pcManager)===null||r===void 0)&&r.subscriber&&(this.room.engine.pcManager.subscriber.onIceCandidateError=a=>{a instanceof RTCPeerConnectionIceErrorEvent&&this.appendWarning("error with ICE candidate: ".concat(a.errorCode," ").concat(a.errorText," ").concat(a.url))})});try{yield this.connect(),qt.info("now the room is connected")}catch(r){throw this.appendWarning("ports need to be open on firewall in order to connect."),r}e||this.appendWarning("Server is not configured for ICE/TCP"),t||this.appendWarning("No public IPv4 UDP candidates were found. Your server is likely not configured correctly")})}}function kxe(n){const e=n.split(".");if(e.length===4){if(e[0]==="10")return!0;if(e[0]==="192"&&e[1]==="168")return!0;if(e[0]==="172"){const t=parseInt(e[1],10);if(t>=16&&t<=31)return!0}}return!1}class Sxe extends pd{get description(){return"Connecting to signal connection via WebSocket"}perform(){return Q(this,void 0,void 0,function*(){var e,t,r;(this.url.startsWith("ws:")||this.url.startsWith("http:"))&&this.appendWarning("Server is insecure, clients may block connections to it");let i=new oE,a;try{a=yield i.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3},void 0,!0)}catch(s){if(pp(new URL(this.url))){this.appendMessage("Initial connection failed with error ".concat(s.message,". Retrying with region fallback"));const c=yield new un(this.url,this.token).getNextBestRegionUrl();c&&(a=yield i.join(c,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3},void 0,!0),this.appendMessage("Fallback to region worked. To avoid initial connections failing, ensure you're calling room.prepareConnection() ahead of time"))}}a?(this.appendMessage("Connected to server, version ".concat(a.serverVersion,".")),((e=a.serverInfo)===null||e===void 0?void 0:e.edition)===g6.Cloud&&(!((t=a.serverInfo)===null||t===void 0)&&t.region)&&this.appendMessage("LiveKit Cloud: ".concat((r=a.serverInfo)===null||r===void 0?void 0:r.region))):this.appendError("Websocket connection could not be established"),yield i.close()})}}class wDe extends xo.EventEmitter{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.options={},this.checkResults=new Map,this.url=e,this.token=t,this.options=r}getNextCheckId(){const e=this.checkResults.size;return this.checkResults.set(e,{logs:[],status:Uo.IDLE,name:"",description:""}),e}
3926updateCheck(e,t){this.checkResults.set(e,t),this.emit("checkUpdate",e,t)}isSuccess(){return Array.from(this.checkResults.values()).every(e=>e.status!==Uo.FAILED)}getResults(){return Array.from(this.checkResults.values())}createAndRunCheck(e){return Q(this,void 0,void 0,function*(){const t=this.getNextCheckId(),r=new e(this.url,this.token,this.options),i=s=>{this.updateCheck(t,s)};r.on("update",i);const a=yield r.run();return r.off("update",i),a})}checkWebsocket(){return Q(this,void 0,void 0,function*(){return this.createAndRunCheck(Sxe)})}checkWebRTC(){return Q(this,void 0,void 0,function*(){return this.createAndRunCheck(Cxe)})}checkTURN(){return Q(this,void 0,void 0,function*(){return this.createAndRunCheck(wxe)})}checkReconnect(){return Q(this,void 0,void 0,function*(){return this.createAndRunCheck(xxe)})}checkPublishAudio(){return Q(this,void 0,void 0,function*(){return this.createAndRunCheck(_xe)})}checkPublishVideo(){return Q(this,void 0,void 0,function*(){return this.createAndRunCheck(bxe)})}checkConnectionProtocol(){return Q(this,void 0,void 0,function*(){const e=yield this.createAndRunCheck(yxe);if(e.data&&"protocol"in e.data){const t=e.data;this.options.protocol=t.protocol}return e})}checkCloudRegion(){return Q(this,void 0,void 0,function*(){return this.createAndRunCheck(vxe)})}}function nn(n,e,t){return(e=Exe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Txe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Exe(n){var e=Txe(n,"string");return typeof e=="symbol"?e:e+""}new TextEncoder;new TextDecoder;class xa extends Error{constructor(e,t){var r;super(e,t),nn(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}}nn(xa,"code","ERR_JOSE_GENERIC");class Pxe extends xa{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(e,{cause:{claim:r,reason:i,payload:t}}),nn(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),nn(this,"claim",void 0),nn(this,"reason",void 0),nn(this,"payload",void 0),this.claim=r,this.reason=i,this.payload=t}}nn(Pxe,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class Rxe extends xa{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(e,{cause:{claim:r,reason:i,payload:t}}),nn(this,"code","ERR_JWT_EXPIRED"),nn(this,"claim",void 0),nn(this,"reason",void 0),nn(this,"payload",void 0),this.claim=r,this.reason=i,this.payload=t}}nn(Rxe,"code","ERR_JWT_EXPIRED");class Axe extends xa{constructor(){super(...arguments),nn(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}nn(Axe,"code","ERR_JOSE_ALG_NOT_ALLOWED");class Ixe extends xa{constructor(){super(...arguments),nn(this,"code","ERR_JOSE_NOT_SUPPORTED")}}nn(Ixe,"code","ERR_JOSE_NOT_SUPPORTED");class Oxe extends xa{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"decryption operation failed",t=arguments.length>1?arguments[1]:void 0;super(e,t),nn(this,"code","ERR_JWE_DECRYPTION_FAILED")}}nn(Oxe,"code","ERR_JWE_DECRYPTION_FAILED");class Mxe extends xa{constructor(){super(...arguments),nn(this,"code","ERR_JWE_INVALID")}}nn(Mxe,"code","ERR_JWE_INVALID");class Dxe extends xa{constructor(){super(...arguments),nn(this,"code","ERR_JWS_INVALID")}}nn(Dxe,"code","ERR_JWS_INVALID");class Nxe extends xa{constructor(){super(...arguments),nn(this,"code","ERR_JWT_INVALID")}}
3926nn(Nxe,"code","ERR_JWT_INVALID");class Lxe extends xa{constructor(){super(...arguments),nn(this,"code","ERR_JWK_INVALID")}}nn(Lxe,"code","ERR_JWK_INVALID");class Fxe extends xa{constructor(){super(...arguments),nn(this,"code","ERR_JWKS_INVALID")}}nn(Fxe,"code","ERR_JWKS_INVALID");class $xe extends xa{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"no applicable key found in the JSON Web Key Set",t=arguments.length>1?arguments[1]:void 0;super(e,t),nn(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}nn($xe,"code","ERR_JWKS_NO_MATCHING_KEY");class Bxe extends xa{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"multiple matching keys found in the JSON Web Key Set",t=arguments.length>1?arguments[1]:void 0;super(e,t),nn(this,Symbol.asyncIterator,void 0),nn(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}nn(Bxe,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class Uxe extends xa{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"request timed out",t=arguments.length>1?arguments[1]:void 0;super(e,t),nn(this,"code","ERR_JWKS_TIMEOUT")}}
3926nn(Uxe,"code","ERR_JWKS_TIMEOUT");class jxe extends xa{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"signature verification failed",t=arguments.length>1?arguments[1]:void 0;super(e,t),nn(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}nn(jxe,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const qxe={name:"CommentaryBroadcast",components:{AdminLayout:Gt},props:{game:{type:Object,required:!0},livekitHost:{type:String,required:!0},embedUrl:{type:String,required:!0}},data(){return{mics:[],selectedDeviceId:"",room:null,connecting:!1,connected:!1,reconnecting:!1,muted:!1,levelPct:0,errorMessage:"",audioContext:null,analyser:null,sourceNode:null,rafId:null,copied:"",listenerCount:0,connectionQuality:"unknown",startedAt:null,elapsedMs:0,elapsedTimer:null,showStats:!1,stats:{bitrate:null,packetLoss:null,jitter:null,rtt:null},statsTimer:null,prevStatsSample:null}},computed:{embedSnippet(){return`<iframe src="${this.embedUrl}" style="width:100%;max-width:480px;height:180px;border:0" allow="autoplay"></iframe>`},statusLabel(){return this.reconnecting?this.$trans("pages.commentary.common.reconnecting"):this.connected?this.muted?this.$trans("pages.commentary.broadcast.status_live_muted"):this.$trans("pages.commentary.broadcast.status_live"):this.connecting?this.$trans("pages.commentary.common.connecting"):this.$trans("pages.commentary.broadcast.status_off_air")},statusColor(){return this.reconnecting?"text-yellow-600":this.connected?this.muted?"text-yellow-600":"text-green-600":"text-gray-600"},qualityLabel(){return this.$trans(`pages.commentary.broadcast.quality_${this.connectionQuality}`)},qualityDotColor(){switch(this.connectionQuality){case"excellent":return"bg-green-500";case"good":return"bg-green-400";case"poor":return"bg-yellow-500";case"lost":return"bg-red-500";default:return"bg-gray-300"}},elapsedLabel(){const n=Math.floor(this.elapsedMs/1e3),e=Math.floor(n/3600),t=Math.floor(n%3600/60),r=n%60,i=a=>String(a).padStart(2,"0");return e>0?`${e}:${i(t)}:${i(r)}`:`${i(t)}:${i(r)}`}},mounted(){this.refreshDevices()},beforeDestroy(){this.disconnect()},methods:{async copy(n,e){try{await navigator.clipboard.writeText(n),this.copied=e,setTimeout(()=>{this.copied===e&&(this.copied="")},2e3)}catch{this.errorMessage=this.$trans("pages.commentary.broadcast.copy_failed")}},async refreshDevices(){try{(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(t=>t.stop());const e=await navigator.mediaDevices.enumerateDevices();this.mics=e.filter(t=>t.kind==="audioinput"),!this.selectedDeviceId&&this.mics.length&&(this.selectedDeviceId=this.mics[0].deviceId)}catch(n){this.errorMessage=this.$trans("pages.commentary.broadcast.mic_error",{error:n.message||n})}},async connect(){var n,e;this.errorMessage="",this.connecting=!0;try{const{data:t}=await axios.post(route("admin.commentary.token.broadcast",this.game.id)),r=t.token,i=new wf({adaptiveStream:!1,dynacast:!1,publishDefaults:{audioPreset:Ng.speech,red:!0,dtx:!0}});i.on(Me.Reconnecting,()=>{this.reconnecting=!0}).on(Me.Reconnected,()=>{this.reconnecting=!1}).on(Me.Disconnected,()=>{this.handleDisconnected()}).on(Me.ParticipantConnected,this.updateListenerCount).on(Me.ParticipantDisconnected,this.updateListenerCount).on(Me.ConnectionQualityChanged,(a,s)=>{s===i.localParticipant&&(this.connectionQuality=this.mapQuality(a))}),await i.connect(this.livekitHost,r),await i.localParticipant.setMicrophoneEnabled(!0,this.selectedDeviceId?{deviceId:this.selectedDeviceId}:void 0,{audioPreset:Ng.speech,red:!0,dtx:!0}),this.room=i,this.connected=!0,this.listenerCount=i.remoteParticipants.size,this.connectionQuality=this.mapQuality(i.localParticipant.connectionQuality),this.startedAt=Date.now(),this.elapsedMs=0,this.elapsedTimer=setInterval(()=>{this.startedAt&&(this.elapsedMs=Date.now()-this.startedAt)},1e3),this.statsTimer=setInterval(this.pollStats,2e3),this.startMeter()}catch(t){this.errorMessage=this.$trans("pages.commentary.common.connection_failed",{error:((e=(n=t==null?void 0:t.response)==null?void 0:n.data)==null?void 0:e.message)||t.message||t}),this.cleanup()}finally{this.connecting=!1}},async toggleMute(){if(!this.room)return;const n=this.room.localParticipant.getTrackPublication?this.room.localParticipant.getTrackPublication("microphone"):null,e=!this.muted;try{n&&n.track?e?await n.track.mute():await n.track.unmute():await this.room.localParticipant.setMicrophoneEnabled(!e),this.muted=e}catch(t){this.errorMessage=this.$trans("pages.commentary.broadcast.mute_failed",{error:t.message||t})}},async disconnect(){const n=this.connected;if(this.room)try{await this.room.disconnect()}catch{}if(this.handleDisconnected(),n)try{await axios.post(route("admin.commentary.broadcast.end",this.game.id))}catch{}},handleDisconnected(){this.connected=!1,this.reconnecting=!1,this.muted=!1,this.cleanup()},cleanup(){this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.elapsedTimer&&(clearInterval(this.elapsedTimer),this.elapsedTimer=null),this.statsTimer&&(clearInterval(this.statsTimer),this.statsTimer=null);try{this.sourceNode&&this.sourceNode.disconnect()}catch{}try{this.analyser&&this.analyser.disconnect()}catch{}try{this.audioContext&&this.audioContext.close()}catch{}this.sourceNode=null,this.analyser=null,this.audioContext=null,this.levelPct=0,this.listenerCount=0,this.connectionQuality="unknown",this.startedAt=null,this.elapsedMs=0,this.stats={bitrate:null,packetLoss:null,jitter:null,rtt:null},this.prevStatsSample=null,this.room=null},updateListenerCount(){this.room&&(this.listenerCount=this.room.remoteParticipants.size)},mapQuality(n){return n===co.Excellent?"excellent":n===co.Good?"good":n===co.Poor?"poor":n===co.Lost?"lost":"unknown"},async pollStats(){if(!this.room)return;const n=this.room.localParticipant.getTrackPublication?this.room.localParticipant.getTrackPublication("microphone"):null,e=n==null?void 0:n.track;if(!(!e||typeof e.getRTCStatsReport!="function"))try{const t=await e.getRTCStatsReport();let r,i,a;if(t.forEach(s=>{s.type==="outbound-rtp"&&s.kind==="audio"?r=s:s.type==="remote-inbound-rtp"&&s.kind==="audio"?i=s:s.type==="candidate-pair"&&s.nominated&&s.state==="succeeded"&&(a=s)}),r){const s=r.timestamp,o=r.bytesSent||0;if(this.prevStatsSample){const c=(s-this.prevStatsSample.timestamp)/1e3;c>0&&(this.stats.bitrate=Math.round((o-this.prevStatsSample.bytes)*8/1e3/c))}this.prevStatsSample={timestamp:s,bytes:o}}i&&(i.jitter!=null&&(this.stats.jitter=Math.round(i.jitter*1e3)),typeof i.fractionLost=="number"?this.stats.packetLoss=Number((i.fractionLost*100).toFixed(1)):typeof i.packetsLost=="number"&&(r!=null&&r.packetsSent)&&(this.stats.packetLoss=Number((i.packetsLost/r.packetsSent*100).toFixed(1))),i.roundTripTime!=null&&(this.stats.rtt=Math.round(i.roundTripTime*1e3))),this.stats.rtt==null&&(a==null?void 0:a.currentRoundTripTime)!=null&&(this.stats.rtt=Math.round(a.currentRoundTripTime*1e3))}catch{}},startMeter(){var a;if(!this.room)return;const n=this.room.localParticipant.getTrackPublication?this.room.localParticipant.getTrackPublication("microphone"):null,e=(a=n==null?void 0:n.track)==null?void 0:a.mediaStreamTrack;if(!e)return;this.audioContext=new(window.AudioContext||window.webkitAudioContext);const t=new MediaStream([e]);this.sourceNode=this.audioContext.createMediaStreamSource(t),this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=512,this.sourceNode.connect(this.analyser);
3926const r=new Uint8Array(this.analyser.frequencyBinCount),i=()=>{if(!this.analyser)return;this.analyser.getByteTimeDomainData(r);let s=0;for(let o=0;o<r.length;o++){const c=Math.abs(r[o]-128);c>s&&(s=c)}this.levelPct=Math.min(100,Math.round(s/128*140)),this.rafId=requestAnimationFrame(i)};this.rafId=requestAnimationFrame(i)}}};var zxe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("pages.commentary.broadcast.header"))+" ")])]},proxy:!0}])},[t("div",{staticClass:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-8 space-y-6"},[t("div",{staticClass:"bg-white shadow-sm p-6 space-y-4"},[t("div",[t("div",{staticClass:"text-sm text-gray-500"},[e._v(e._s(e.$trans("pages.commentary.common.match")))]),t("div",{staticClass:"text-lg font-semibold text-fck-blue"},[e._v(" "+e._s(e.game.home_team||e.$trans("pages.commentary.common.home"))+" vs "+e._s(e.game.away_team||e.$trans("pages.commentary.common.away"))+" ")]),t("div",{staticClass:"text-sm text-gray-500"},[e._v(e._s(e.$trans("pages.commentary.broadcast.room"))+": commentary-"+e._s(e.game.id))])]),t("div",[t("label",{staticClass:"block text-sm font-medium text-gray-700 mb-1"},[e._v(e._s(e.$trans("pages.commentary.broadcast.microphone")))]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.selectedDeviceId,expression:"selectedDeviceId"}],staticClass:"block w-full border-gray-300 shadow-sm focus:border-fck-blue focus:ring-fck-blue text-sm",attrs:{disabled:e.connected||e.connecting},on:{change:function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.selectedDeviceId=r.target.multiple?i:i[0]}}},e._l(e.mics,function(r){return t("option",{key:r.deviceId,domProps:{value:r.deviceId}},[e._v(" "+e._s(r.label||e.$trans("pages.commentary.broadcast.microphone_fallback",{id:(r.deviceId||"").slice(0,6)}))+" ")])}),0),e.mics.length===0?t("p",{staticClass:"mt-1 text-xs text-gray-500"},[e._v(" "+e._s(e.$trans("pages.commentary.broadcast.no_microphones"))+" ")]):e._e(),t("button",{staticClass:"mt-2 text-xs text-fck-blue hover:underline",attrs:{type:"button"},on:{click:e.refreshDevices}},[e._v(" "+e._s(e.$trans("pages.commentary.broadcast.refresh_devices"))+" ")])]),t("div",[t("div",{staticClass:"text-sm font-medium text-gray-700 mb-1"},[e._v(e._s(e.$trans("pages.commentary.broadcast.input_level")))]),t("div",{staticClass:"h-3 w-full bg-gray-200 overflow-hidden"},[t("div",{staticClass:"h-3 bg-fck-blue transition-[width] duration-75",style:{width:e.levelPct+"%"}})])]),t("div",{staticClass:"flex items-center justify-between"},[t("div",{staticClass:"text-sm"},[e._v(" "+e._s(e.$trans("pages.commentary.common.status"))+": "),t("span",{staticClass:"font-semibold",class:e.statusColor},[e._v(e._s(e.statusLabel))])]),t("div",{staticClass:"flex gap-2"},[e.connected?e._e():t("button",{staticClass:"bg-fck-blue text-white py-2 px-4 text-sm font-semibold hover:bg-gray-900 disabled:opacity-50",attrs:{type:"button",disabled:e.connecting},on:{click:e.connect}},[e._v(" "+e._s(e.connecting?e.$trans("pages.commentary.common.connecting"):e.$trans("pages.commentary.broadcast.go_live"))+" ")]),e.connected?t("button",{staticClass:"bg-white text-fck-blue ring-1 ring-fck-blue py-2 px-4 text-sm font-semibold hover:bg-gray-50",attrs:{type:"button"},on:{click:e.toggleMute}},[e._v(" "+e._s(e.muted?e.$trans("pages.commentary.common.unmute"):e.$trans("pages.commentary.common.mute"))+" ")]):e._e(),e.connected?t("button",{staticClass:"bg-red-600 text-white py-2 px-4 text-sm font-semibold hover:bg-red-700",attrs:{type:"button"},on:{click:e.disconnect}},[e._v(" "+e._s(e.$trans("pages.commentary.broadcast.end_broadcast"))+" ")]):e._e()])]),e.connected?t("div",{staticClass:"grid grid-cols-3 gap-3 text-sm pt-2 border-t border-gray-100"},[t("div",[t("div",{staticClass:"text-xs text-gray-500"},[e._v(e._s(e.$trans("pages.commentary.broadcast.listeners")))]),t("div",{staticClass:"text-lg font-semibold text-fck-blue"},[e._v(e._s(e.listenerCount))])]),t("div",[t("div",{staticClass:"text-xs text-gray-500"},[e._v(e._s(e.$trans("pages.commentary.broadcast.connection_quality")))]),t("div",{staticClass:"flex items-center gap-2 mt-1"},[t("span",{staticClass:"inline-block w-3 h-3 rounded-full",class:e.qualityDotColor}),t("span",{staticClass:"text-sm"},[e._v(e._s(e.qualityLabel))])])]),t("div",[t("div",{staticClass:"text-xs text-gray-500"},[e._v(e._s(e.$trans("pages.commentary.broadcast.live_for")))]),t("div",{staticClass:"text-lg font-semibold tabular-nums"}
3926,[e._v(e._s(e.elapsedLabel))])])]):e._e(),e.connected?t("div",{staticClass:"pt-2"},[t("button",{staticClass:"text-xs text-fck-blue hover:underline",attrs:{type:"button"},on:{click:function(r){e.showStats=!e.showStats}}},[e._v(" "+e._s(e.showStats?e.$trans("pages.commentary.broadcast.details_hide"):e.$trans("pages.commentary.broadcast.details_show"))+" ")]),e.showStats?t("dl",{staticClass:"mt-2 grid grid-cols-2 gap-x-4 gap-y-1 text-xs text-gray-700"},[t("dt",{staticClass:"text-gray-500"},[e._v(e._s(e.$trans("pages.commentary.broadcast.bitrate")))]),t("dd",{staticClass:"tabular-nums"},[e._v(e._s(e.stats.bitrate!=null?e.stats.bitrate+" kbps":"â"))]),t("dt",{staticClass:"text-gray-500"},[e._v(e._s(e.$trans("pages.commentary.broadcast.packet_loss")))]),t("dd",{staticClass:"tabular-nums"},[e._v(e._s(e.stats.packetLoss!=null?e.stats.packetLoss+" %":"â"))]),t("dt",{staticClass:"text-gray-500"},[e._v(e._s(e.$trans("pages.commentary.broadcast.jitter")))]),t("dd",{staticClass:"tabular-nums"},[e._v(e._s(e.stats.jitter!=null?e.stats.jitter+" ms":"â"))]),t("dt",{staticClass:"text-gray-500"},[e._v(e._s(e.$trans("pages.commentary.broadcast.rtt")))]),t("dd",{staticClass:"tabular-nums"},[e._v(e._s(e.stats.rtt!=null?e.stats.rtt+" ms":"â"))])]):e._e()]):e._e(),e.errorMessage?t("div",{staticClass:"text-sm text-red-600"},[e._v(e._s(e.errorMessage))]):e._e()]),t("div",{staticClass:"bg-white shadow-sm p-6 space-y-3"},[t("div",{staticClass:"text-sm font-medium text-gray-700"},[e._v(e._s(e.$trans("pages.commentary.broadcast.embed_label")))]),t("pre",{staticClass:"text-xs bg-gray-50 p-3 overflow-x-auto whitespace-pre-wrap break-all border border-gray-200"},[e._v(e._s(e.embedSnippet))]),t("div",{staticClass:"flex gap-2"},[t("button",{staticClass:"bg-fck-blue text-white py-2 px-4 text-sm font-semibold hover:bg-gray-900",attrs:{type:"button"},on:{click:function(r){return e.copy(e.embedSnippet,"html")}}},[e._v(" "+e._s(e.copied==="html"?e.$trans("pages.commentary.common.copied"):e.$trans("pages.commentary.broadcast.copy_embed_html"))+" ")]),t("button",{staticClass:"bg-white text-fck-blue ring-1 ring-fck-blue py-2 px-4 text-sm font-semibold hover:bg-gray-50",attrs:{type:"button"},on:{click:function(r){return e.copy(e.embedUrl,"url")}}},[e._v(" "+e._s(e.copied==="url"?e.$trans("pages.commentary.common.copied"):e.$trans("pages.commentary.broadcast.copy_url_only"))+" ")])])])])])},Wxe=[],Hxe=ve(qxe,zxe,Wxe,!1,null,null);const Vxe=Hxe.exports,Gxe=Object.freeze(Object.defineProperty({__proto__:null,default:Vxe},Symbol.toStringTag,{value:"Module"})),Kxe={name:"CommentaryBroadcasts",components:{AdminLayout:Gt},props:{matches:{type:Array,required:!0},embedBaseUrl:{type:String,required:!0}},data(){return{copiedId:null}},methods:{formatKickoff(n){if(!n)return"";try{return new Date(n).toLocaleString()}catch{return n}},async copyEmbed(n){const t=`<iframe src="${`${this.embedBaseUrl}/${n}`}" style="width:100%;max-width:480px;height:180px;border:0" allow="autoplay"></iframe>`;try{await navigator.clipboard.writeText(t),this.copiedId=n,setTimeout(()=>{this.copiedId===n&&(this.copiedId=null)},2e3)}catch{}}}};var Yxe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("pages.commentary.broadcasts.header"))+" ")])]},proxy:!0}])},[t("div",{staticClass:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-8"},[t("div",{staticClass:"bg-white shadow-sm"},[e.matches.length===0?t("div",{staticClass:"p-6 text-gray-500 text-sm"},[e._v(" "+e._s(e.$trans("pages.commentary.broadcasts.no_matches"))+" ")]):t("ul",{staticClass:"divide-y divide-gray-100"},e._l(e.matches,function(r){return t("li",{key:r.id,staticClass:"p-4 flex items-center justify-between gap-4"},[t("div",[t("div",{staticClass:"text-fck-blue font-semibold"},[e._v(" "+e._s(r.home_team||e.$trans("pages.commentary.common.home"))+" vs "+e._s(r.away_team||e.$trans("pages.commentary.common.away"))+" ")]),t("div",{staticClass:"text-xs text-gray-500"},[e._v(" "+e._s(e.formatKickoff(r.kickoff_at))+" ")])]),t("div",{staticClass:"flex gap-2"},[t("button",{staticClass:"bg-white text-fck-blue ring-1 ring-fck-blue py-2 px-3 text-xs font-semibold hover:bg-gray-50",attrs:{type:"button"},on:{click:function(i){return e.copyEmbed(r.id)}}},[e._v(" "+e._s(e.copiedId===r.id?e.$trans("pages.commentary.common.copied"):e.$trans("pages.commentary.broadcasts.copy_embed"))+" ")]),t("inertia-link",{staticClass:"bg-fck-blue text-white py-2 px-4 text-sm font-semibold hover:bg-gray-900",attrs:{href:e.route("admin.commentary.broadcast",r.id)}},[e._v(" "+e._s(e.$trans("pages.commentary.broadcasts.go_live"))+" ")])],1)])}),0)])])])},Xxe=[],Jxe=ve(Kxe,Yxe,Xxe,!1,null,null);const Qxe=Jxe.exports,Zxe=Object.freeze(Object.defineProperty({__proto__:null,default:Qxe},Symbol.toStringTag,{value:"Module"})),ewe="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA",twe={name:"CommentaryPlayer",components:{AppLayout:ta},props:{game:{type:Object,required:!0},livekitHost:{type:String,required:!0},embed:{type:Boolean,default:!1},tokenUrl:{type:String,required:!0},statusUrl:{type:String,required:!0},broadcastLive:{type:Boolean,default:!1}},data(){return{room:null,connecting:!1,connected:!1,reconnecting:!1,muted:!1,volume:1,hasAudio:!1,attachedElements:[],primedAudioEl:null,errorMessage:"",onAir:this.broadcastLive,statusTimer:null,playbackBlocked:!1,diagnostics:[],playbackProbe:null,debug:typeof window<"u"&&/[?&]debug=1/.test(window.location.search),copied:!1,wakeLockSupported:typeof navigator<"u"&&"wakeLock"in navigator,keepScreenOn:!1,wakeLockSentinel:null}},computed:{diagnosticsText(){return this.diagnostics.map(n=>`${n.at} ${n.message}${n.detail?" "+JSON.stringify(n.detail):""}`).join(` 3927`)},isOnAir(){return this.connected?this.hasAudio:this.onAir},kickoffLabel(){return this.game.kickoff_at?new Date(this.game.kickoff_at).toLocaleStr
3927ing("da-DK",{dateStyle:"short",timeStyle:"short",hour12:!1}):""},statusLabel(){return this.reconnecting?this.$trans("pages.commentary.common.reconnecting"):this.connecting?this.$trans("pages.commentary.common.connecting"):this.connected?this.hasAudio?this.muted?this.$trans("pages.commentary.player.status_listening_muted"):this.$trans("pages.commentary.player.status_listening"):this.$trans("pages.commentary.player.status_waiting"):this.$trans("pages.commentary.player.status_off")},statusColor(){return this.reconnecting?"text-yellow-600":this.connected&&this.hasAudio?this.muted?"text-yellow-600":"text-green-600":"text-gray-600"}},mounted(){document.addEventListener("visibilitychange",this.handleVisibilityChange),this.pollStatus(),this.statusTimer=setInterval(()=>{!this.connected&&!this.connecting&&this.pollStatus()},2e4)},beforeDestroy(){this.statusTimer&&clearInterval(this.statusTimer),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.releaseWakeLock(),this.stop()},methods:{async pollStatus(){try{const{data:n}=await axios.get(this.statusUrl);this.onAir=!!n.live}catch{}},async start(){var t,r,i;this.errorMessage="",this.diagnostics=[],this.diag("listen tapped",{ua:navigator.userAgent});const n=new wf({adaptiveStream:!1,dynacast:!1});n.on(Me.TrackSubscribed,this.onTrackSubscribed).on(Me.TrackUnsubscribed,this.onTrackUnsubscribed).on(Me.TrackPublished,(a,s)=>{this.diag("TrackPublished",{participant:s&&s.identity,source:a&&a.source,subscribed:a&&a.isSubscribed}),this.requestSubscription(a,s)}).on(Me.ConnectionStateChanged,a=>{this.diag("ConnectionStateChanged",{state:a})}).on(Me.Reconnecting,()=>{this.reconnecting=!0,this.diag("Reconnecting")}).on(Me.Reconnected,()=>{this.reconnecting=!1,this.diag("Reconnected"),this.ensureSubscribed(n)}).on(Me.Disconnected,a=>{this.diag("Disconnected",{reason:a===void 0?null:String(a)}),this.handleDisconnected()}).on(Me.AudioPlaybackStatusChanged,()=>{this.playbackBlocked=!n.canPlaybackAudio,this.diag("AudioPlaybackStatusChanged",{canPlaybackAudio:n.canPlaybackAudio})}),this.primeAudioElement();const e=n.startAudio().then(()=>{this.diag("startAudio resolved (in gesture)",{canPlaybackAudio:n.canPlaybackAudio})}).catch(a=>{this.diag("startAudio rejected (in gesture)",{error:(a==null?void 0:a.name)||String(a)})});this.room=n,this.connecting=!0;try{this.diag("fetching token",{url:this.tokenUrl});const{data:a}=await axios.post(this.tokenUrl),s=a.token;this.diag("token ok",{room:a.room,host:a.host}),await n.connect(this.livekitHost,s),this.diag("room connected",{state:n.state,remoteParticipants:n.remoteParticipants?n.remoteParticipants.size:-1,canPlaybackAudio:n.canPlaybackAudio}),this.logRemoteState(n),this.ensureSubscribed(n),await e;try{await n.startAudio(),this.diag("startAudio resolved (post-connect)",{canPlaybackAudio:n.canPlaybackAudio})}catch(o){this.diag("startAudio rejected (post-connect)",{error:(o==null?void 0:o.name)||String(o)})}this.playbackBlocked=!n.canPlaybackAudio,this.playbackBlocked&&this.diag("PLAYBACK BLOCKED â showing enable-sound button"),this.connected=!0}catch(a){const s=[];(t=a==null?void 0:a.response)!=null&&t.status&&s.push(`HTTP ${a.response.status}`);const o=(i=(r=a==null?void 0:a.response)==null?void 0:r.data)==null?void 0:i.message;o?s.push(o):a!=null&&a.message?s.push(a.message):a!=null&&a.name?s.push(a.name):s.push(String(a));const c=s.join(" â ")||"unknown";console.error("Commentary connect failed:",a),this.diag("connect failed",{error:c}),this.errorMessage=this.$trans("pages.commentary.common.connection_failed",{error:c}),this.cleanup()}finally{this.connecting=!1}},onTrackSubscribed(n,e,t){if(this.diag("TrackSubscribed",{kind:n.kind,source:e&&e.source,participant:t&&t.identity,isSubscribed:e&&e.isSubscribed,trackMuted:e&&e.isMuted}),n.kind!==Ae.Kind.Audio)return;const r=this.primedAudioEl;this.primedAudioEl=null;let i;if(r)r.removeAttribute("src"),i=n.attach(r),this.diag("attached to primed element");else{i=n.attach();const s=this.$refs.audioContainer;s&&s.appendChild(i),this.diag("attached to fresh element (no primed element left)")}i.muted=this.muted,i.volume=this.volume,this.attachedElements.push({track:n,el:i}),this.hasAudio=!0,this.diag("audio element attached",{paused:i.paused,muted:i.muted,volume:i.volume,readyState:i.readyState,inDocument:!!i.isConnected,tracks:i.srcObject&&i.srcObject.getAudioTracks?i.srcObject.getAudioTracks().length:-1});const a=i.play();
3927a&&typeof a.catch=="function"&&a.then(()=>this.diag("element play() resolved")).catch(s=>{this.diag("element play() REJECTED",{error:(s==null?void 0:s.name)||String(s)}),this.playbackBlocked=!0}),this.probePlayback(i)},primeAudioElement(){if(!this.primedAudioEl)try{const n=document.createElement("audio");n.setAttribute("playsinline",""),n.playsInline=!0,n.autoplay=!0,n.muted=!1,n.src=ewe;const e=this.$refs.audioContainer;e&&e.appendChild(n),this.primedAudioEl=n;const t=n.play();t&&typeof t.catch=="function"&&t.then(()=>this.diag("audio element primed (in gesture)")).catch(r=>this.diag("audio element prime REJECTED",{error:(r==null?void 0:r.name)||String(r)}))}catch(n){this.diag("audio element prime failed",{error:(n==null?void 0:n.name)||String(n)})}},ensureSubscribed(n){(n&&n.remoteParticipants?Array.from(n.remoteParticipants.values()):[]).forEach(t=>{(t.trackPublications?Array.from(t.trackPublications.values()):[]).forEach(i=>this.requestSubscription(i,t))})},requestSubscription(n,e){if(!(!n||n.kind!==Ae.Kind.Audio)&&!n.isSubscribed&&typeof n.setSubscribed=="function"){this.diag("requesting subscription",{participant:e&&e.identity,source:n.source});try{n.setSubscribed(!0)}catch(t){this.diag("setSubscribed failed",{error:(t==null?void 0:t.name)||String(t)})}}},probePlayback(n){const e=n.currentTime;this.playbackProbe&&clearTimeout(this.playbackProbe),this.playbackProbe=setTimeout(()=>{const t=n.currentTime>e;this.diag(t?"playback advancing":"PLAYBACK NOT ADVANCING",{paused:n.paused,currentTime:Number(n.currentTime.toFixed(2)),muted:n.muted,volume:n.volume,canPlaybackAudio:this.room?this.room.canPlaybackAudio:null}),!t&&(n.paused||this.room&&!this.room.canPlaybackAudio)&&(this.playbackBlocked=!0)},1500)},async enableAudio(){if(this.room){this.diag("enable-sound tapped");try{await this.room.startAudio(),this.playbackBlocked=!this.room.canPlaybackAudio,this.diag("startAudio resolved (button)",{canPlaybackAudio:this.room.canPlaybackAudio})}catch(n){this.diag("startAudio rejected (button)",{error:(n==null?void 0:n.name)||String(n)})}this.attachedElements.forEach(({el:n})=>{if(!n)return;const e=n.play();e&&typeof e.catch=="function"&&e.then(()=>this.diag("element play() resolved")).catch(t=>this.diag("element play() REJECTED",{error:(t==null?void 0:t.name)||String(t)})),this.probePlayback(n)})}},logRemoteState(n){const e=n.remoteParticipants?Array.from(n.remoteParticipants.values()):[];if(e.length===0){this.diag("NO REMOTE PARTICIPANTS â nobody is broadcasting");return}e.forEach(t=>{const r=t.trackPublications?Array.from(t.trackPublications.values()):[];this.diag("remote participant",{identity:t.identity,publications:r.length,audio:r.filter(i=>i.kind===Ae.Kind.Audio).map(i=>({source:i.source,subscribed:i.isSubscribed,muted:i.isMuted}))})})},async copyDiagnostics(){try{await navigator.clipboard.writeText(this.diagnosticsText),this.copied=!0,setTimeout(()=>{this.copied=!1},2e3)}catch{}},async toggleKeepScreenOn(){this.keepScreenOn=!this.keepScreenOn,this.keepScreenOn?await this.acquireWakeLock():await this.releaseWakeLock()},async acquireWakeLock(){if(!(!this.wakeLockSupported||this.wakeLockSentinel))try{this.wakeLockSentinel=await navigator.wakeLock.request("screen"),this.wakeLockSentinel.addEventListener("release",()=>{this.wakeLockSentinel=null,this.diag("wake lock released by browser")}),this.diag("wake lock acquired")}catch(n){this.keepScreenOn=!1,this.wakeLockSentinel=null,this.diag("wake lock rejected",{error:(n==null?void 0:n.name)||String(n)})}},async releaseWakeLock(){if(!this.wakeLockSentinel)return;const n=this.wakeLockSentinel;this.wakeLockSentinel=null;try{await n.release(),this.diag("wake lock released")}catch{}},handleVisibilityChange(){document.visibilityState==="visible"&&(!this.keepScreenOn||this.wakeLockSentinel||this.acquireWakeLock())},diag(n,e){const t={at:new Date().toISOString().slice(11,23),message:n,detail:e||null};this.diagnostics.push(t),this.diagnostics.length>60&&this.diagnostics.shift(),console.log("[commentary]",n,e||"")},onTrackUnsubscribed(n){if(n.kind!==Ae.Kind.Audio)return;const e=this.attachedElements.findIndex(t=>t.track===n);if(e!==-1){const{el:t}=this.attachedElements[e];try{n.detach()}catch{}t&&!this.primedAudioEl?(this.primedAudioEl=t,this.diag("audio element retained for re-subscribe")):t&&t.remove(),this.attachedElements.splice(e,1)}this.hasAudio=this.attachedElements.length>0},toggleMute(){this.muted=!this.muted,this.applyVolume()},setVolume(n){this.volume=Math.max(0,Math.min(1,n)),this.volume>0&&this.muted&&(this.muted=!1),this.applyVolume()}
3927,applyVolume(){this.attachedElements.forEach(({track:n,el:e})=>{if(e&&(e.muted=this.muted,e.volume=this.volume),typeof n.setVolume=="function")try{n.setVolume(this.muted?0:this.volume)}catch{}})},async stop(){if(this.room)try{await this.room.disconnect()}catch{}this.handleDisconnected()},handleDisconnected(){this.connected=!1,this.reconnecting=!1,this.hasAudio=!1,this.cleanup()},cleanup(){if(this.playbackProbe&&(clearTimeout(this.playbackProbe),this.playbackProbe=null),this.playbackBlocked=!1,this.attachedElements.forEach(({track:n})=>{try{n.detach().forEach(e=>e.remove())}catch{}}),this.attachedElements=[],this.primedAudioEl){try{this.primedAudioEl.pause()}catch{}try{this.primedAudioEl.remove()}catch{}this.primedAudioEl=null}this.room=null}}};var nwe=function(){var e=this,t=e._self._c;return e.embed?t("div",{staticClass:"min-h-screen bg-white p-4 space-y-4"},[t("div",[t("div",{staticClass:"text-sm text-gray-500"},[e._v(e._s(e.$trans("pages.commentary.common.match")))]),t("div",{staticClass:"text-lg font-semibold text-fck-blue"},[e._v(" "+e._s(e.game.home_team||e.$trans("pages.commentary.common.home"))+" vs "+e._s(e.game.away_team||e.$trans("pages.commentary.common.away"))+" ")]),e.kickoffLabel?t("div",{staticClass:"text-sm text-gray-500"},[e._v(e._s(e.kickoffLabel))]):e._e()]),t("div",{staticClass:"space-y-1",attrs:{role:"status","aria-live":"polite"}},[t("div",{staticClass:"text-sm flex items-center gap-2"},[t("span",{staticClass:"inline-block w-2.5 h-2.5 rounded-full flex-shrink-0",class:e.isOnAir?"bg-red-600":"bg-gray-300",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"font-semibold",class:e.isOnAir?"text-red-700":"text-gray-600"},[e._v(" "+e._s(e.isOnAir?e.$trans("pages.commentary.player.on_air"):e.$trans("pages.commentary.player.off_air"))+" ")])]),t("div",{staticClass:"text-sm"},[e._v(" "+e._s(e.$trans("pages.commentary.player.your_status"))+": "),t("span",{staticClass:"font-semibold",class:e.statusColor},[e._v(e._s(e.statusLabel))])])]),e.connected?e._e():t("button",{staticClass:"w-full bg-fck-blue text-white py-3 px-4 text-base font-semibold hover:bg-gray-900 disabled:opacity-50",attrs:{type:"button",disabled:e.connecting},on:{click:e.start}},[e._v(" "+e._s(e.connecting?e.$trans("pages.commentary.common.connecting"):e.$trans("pages.commentary.player.listen"))+" ")]),e.connected&&e.playbackBlocked?t("div",{staticClass:"border-2 border-red-600 bg-red-50 p-3 space-y-2",attrs:{role:"alert"}},[t("p",{staticClass:"text-sm font-semibold text-red-800 m-0"},[e._v(" "+e._s(e.$trans("pages.commentary.player.enable_sound_hint"))+" ")]),t("button",{staticClass:"w-full bg-red-600 text-white py-3 px-4 text-base font-semibold hover:bg-red-700",attrs:{type:"button"},on:{click:e.enableAudio}},[e._v(" "+e._s(e.$trans("pages.commentary.player.enable_sound"))+" ")])]):e._e(),e.connected&&!e.hasAudio?t("div",{staticClass:"text-sm text-gray-600 italic"},[e._v(" "+e._s(e.$trans("pages.commentary.player.not_live"))+" ")]):e._e(),e.connected?t("div",{staticClass:"space-y-3"},[t("div",{staticClass:"flex items-center gap-3"},[t("button",{staticClass:"bg-white text-fck-blue ring-1 ring-fck-blue py-2 px-4 text-sm font-semibold hover:bg-gray-50",attrs:{type:"button"},on:{click:e.toggleMute}},[e._v(" "+e._s(e.muted?e.$trans("pages.commentary.common.unmute"):e.$trans("pages.commentary.common.mute"))+" ")]),t("button",{staticClass:"bg-gray-100 text-gray-700 py-2 px-4 text-sm font-semibold hover:bg-gray-200",attrs:{type:"button"},on:{click:e.stop}},[e._v(" "+e._s(e.$trans("pages.commentary.player.stop"))+" ")])]),t("div",[t("label",{staticClass:"block text-xs text-gray-600 mb-1"},[e._v(e._s(e.$trans("pages.commentary.player.volume")))]),t("input",{staticClass:"w-full",attrs:{type:"range",min:"0",max:"100"},domProps:{value:Math.round(e.volume*100)},on:{input:function(r){e.setVolume(Number(r.target.value)/100)}}})])]):e._e(),e.wakeLockSupported?t("button",{staticClass:"w-full py-2 px-4 text-sm font-semibold border",class:e.keepScreenOn?"bg-fck-blue text-white border-fck-blue":"bg-white text-fck-blue border-fck-blue hover:bg-gray-50",attrs:{type:"button","aria-pressed":e.keepScreenOn?"true":"false"},on:{click:e.toggleKeepScreenOn}},[e._v(" "+e._s(e.keepScreenOn?e.$trans("pages.commentary.player.screen_on_active"):e.$trans("pages.commentary.player.screen_on"))+" ")]):e._e(
3927),e.errorMessage?t("div",{staticClass:"text-sm text-red-600"},[e._v(e._s(e.errorMessage))]):e._e(),e.debug?t("div",{staticClass:"mt-4 border border-gray-300 bg-gray-50 p-2"},[t("div",{staticClass:"flex items-center justify-between mb-1"},[t("span",{staticClass:"text-xs font-semibold text-gray-700"},[e._v("Diagnostics")]),t("button",{staticClass:"text-xs underline text-fck-blue",attrs:{type:"button"},on:{click:e.copyDiagnostics}},[e._v(e._s(e.copied?"Kopieret":"Kopiér"))])]),t("pre",{staticClass:"text-[10px] leading-tight text-gray-800 whitespace-pre-wrap break-all max-h-64 overflow-y-auto"},[e._v(e._s(e.diagnosticsText))])]):e._e(),t("div",{ref:"audioContainer",staticStyle:{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0 0 0 0)"},attrs:{"aria-hidden":"true"}})]):t("app-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("pages.commentary.player.header"))+" ")])]},proxy:!0}],null,!1,3755202944)},[t("div",{staticClass:"max-w-md mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-8"},[t("div",{staticClass:"bg-white shadow-sm p-6 space-y-4"},[t("div",[t("div",{staticClass:"text-sm text-gray-500"},[e._v(e._s(e.$trans("pages.commentary.common.match")))]),t("div",{staticClass:"text-lg font-semibold text-fck-blue"},[e._v(" "+e._s(e.game.home_team||e.$trans("pages.commentary.common.home"))+" vs "+e._s(e.game.away_team||e.$trans("pages.commentary.common.away"))+" ")]),e.kickoffLabel?t("div",{staticClass:"text-sm text-gray-500"},[e._v(e._s(e.kickoffLabel))]):e._e()]),t("div",{staticClass:"space-y-1",attrs:{role:"status","aria-live":"polite"}},[t("div",{staticClass:"text-sm flex items-center gap-2"},[t("span",{staticClass:"inline-block w-2.5 h-2.5 rounded-full flex-shrink-0",class:e.isOnAir?"bg-red-600":"bg-gray-300",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"font-semibold",class:e.isOnAir?"text-red-700":"text-gray-600"},[e._v(" "+e._s(e.isOnAir?e.$trans("pages.commentary.player.on_air"):e.$trans("pages.commentary.player.off_air"))+" ")])]),t("div",{staticClass:"text-sm"},[e._v(" "+e._s(e.$trans("pages.commentary.player.your_status"))+": "),t("span",{staticClass:"font-semibold",class:e.statusColor},[e._v(e._s(e.statusLabel))])])]),e.connected?e._e():t("button",{staticClass:"w-full bg-fck-blue text-white py-3 px-4 text-base font-semibold hover:bg-gray-900 disabled:opacity-50",attrs:{type:"button",disabled:e.connecting},on:{click:e.start}},[e._v(" "+e._s(e.connecting?e.$trans("pages.commentary.common.connecting"):e.$trans("pages.commentary.player.listen"))+" ")]),e.connected&&e.playbackBlocked?t("div",{staticClass:"border-2 border-red-600 bg-red-50 p-3 space-y-2",attrs:{role:"alert"}},[t("p",{staticClass:"text-sm font-semibold text-red-800 m-0"},[e._v(" "+e._s(e.$trans("pages.commentary.player.enable_sound_hint"))+" ")]),t("button",{staticClass:"w-full bg-red-600 text-white py-3 px-4 text-base font-semibold hover:bg-red-700",attrs:{type:"button"},on:{click:e.enableAudio}},[e._v(" "+e._s(e.$trans("pages.commentary.player.enable_sound"))+" ")])]):e._e(),e.connected&&!e.hasAudio?t("div",{staticClass:"text-sm text-gray-600 italic"},[e._v(" "+e._s(e.$trans("pages.commentary.player.not_live"))+" ")]):e._e(),e.connected?t("div",{staticClass:"space-y-3"},[t("div",{staticClass:"flex items-center gap-3"},[t("button",{staticClass:"bg-white text-fck-blue ring-1 ring-fck-blue py-2 px-4 text-sm font-semibold hover:bg-gray-50",attrs:{type:"button"},on:{click:e.toggleMute}},[e._v(" "+e._s(e.muted?e.$trans("pages.commentary.common.unmute"):e.$trans("pages.commentary.common.mute"))+" ")]),t("button",{staticClass:"bg-gray-100 text-gray-700 py-2 px-4 text-sm font-semibold hover:bg-gray-200",attrs:{type:"button"},on:{click:e.stop}},[e._v(" "+e._s(e.$trans("pages.commentary.player.stop"))+" ")])]),t("div",[t("label",{staticClass:"block text-xs text-gray-600 mb-1"},[e._v(e._s(e.$trans("pages.commentary.player.volume")))]),t("input",{staticClass:"w-full",attrs:{type:"range",min:"0",max:"100"},domProps:{value:Math.round(e.volume*100)},on:{input:function(r){e.setVolume(Number(r.target.value)/100)}}}
3927)])]):e._e(),e.wakeLockSupported?t("button",{staticClass:"w-full py-2 px-4 text-sm font-semibold border",class:e.keepScreenOn?"bg-fck-blue text-white border-fck-blue":"bg-white text-fck-blue border-fck-blue hover:bg-gray-50",attrs:{type:"button","aria-pressed":e.keepScreenOn?"true":"false"},on:{click:e.toggleKeepScreenOn}},[e._v(" "+e._s(e.keepScreenOn?e.$trans("pages.commentary.player.screen_on_active"):e.$trans("pages.commentary.player.screen_on"))+" ")]):e._e(),e.errorMessage?t("div",{staticClass:"text-sm text-red-600"},[e._v(e._s(e.errorMessage))]):e._e()]),e.debug?t("div",{staticClass:"mt-4 border border-gray-300 bg-gray-50 p-2"},[t("div",{staticClass:"flex items-center justify-between mb-1"},[t("span",{staticClass:"text-xs font-semibold text-gray-700"},[e._v("Diagnostics")]),t("button",{staticClass:"text-xs underline text-fck-blue",attrs:{type:"button"},on:{click:e.copyDiagnostics}},[e._v(e._s(e.copied?"Kopieret":"Kopiér"))])]),t("pre",{staticClass:"text-[10px] leading-tight text-gray-800 whitespace-pre-wrap break-all max-h-64 overflow-y-auto"},[e._v(e._s(e.diagnosticsText))])]):e._e(),t("div",{ref:"audioContainer",staticStyle:{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0 0 0 0)"},attrs:{"aria-hidden":"true"}})])])},rwe=[],iwe=ve(twe,nwe,rwe,!1,null,null);const awe=iwe.exports,swe=Object.freeze(Object.defineProperty({__proto__:null,default:awe},Symbol.toStringTag,{value:"Module"})),owe={props:{companies:{type:Object,required:!0},filters:{type:Object,default:()=>({})}},components:{AdminLayout:Gt,JetPagination:Rp},created(){this.fetchCompanies=this.debounce(this.fetchCompanies,300),this.search=this.filters.search||"",this.statusFilter=this.filters.status||"all"},data(){return{search:"",statusFilter:"all",fetching:!1}},methods:{async fetchCompanies(){this.fetching=!0,await this.$inertia.get(route("admin.companies.index"),{search:this.search,status:this.statusFilter},{preserveState:!0,preserveScroll:!0,replace:!0}),this.fetching=!1},formatDate(n){return n?new Date(n).toLocaleDateString("da-DK",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-"},debounce(n,e,t){let r;return function(){const i=this,a=arguments,s=function(){r=null,t||n.apply(i,a)},o=t&&!r;clearTimeout(r),r=setTimeout(s,e),o&&n.apply(i,a)}}}};var cwe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"flex flex-row justify-between"},[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" Virksomheder ")]),t("div",{staticClass:"flex flew-row justify-center items-center gap-4"},[e.fetching?t("svg",{staticClass:"animate-spin w-6 h-6 mr-3",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}})]):e._e(),t("select",{directives:[{name:"model",rawName:"v-model",value:e.statusFilter,expression:"statusFilter"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm text-sm",on:{change:[function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.statusFilter=r.target.multiple?i:i[0]},e.fetchCompanies]}},[t("option",{attrs:{value:"all"}},[e._v("Alle")]),t("option",{attrs:{value:"active"}},[e._v("Aktive partnere")]),t("option",{attrs:{value:"with_tickets"}},[e._v("Med billetkonto")])]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm block w-64",attrs:{type:"text",placeholder:"Søg virksomheder..."},domProps:{value:e.search},on:{input:[function(r){r.target.composing||(e.search=r.target.value)},e.fetchCompanies]}})])])]},proxy:!0},{key:"footer",fn:function(){return[e.companies.data.length>0?t("jet-pagination",{attrs:{total:e.companies.total,per_page:e.companies.per_page,current_page:e.companies.current_page,last_page:e.companies.last_page,first_page_url:e.companies.first_page_url,last_page_url:e.companies.last_page_url,next_page_url:e.companies.next_page_url,prev_page_url:e.companies.prev_page_url,path:e.companies.path,from:e.companies.from,to:e.companies.to,data:e.companies.data,search:e.search}}
3927):e._e()]},proxy:!0}])},[t("div",{staticClass:"flex flex-col flex-grow shadow-lg bg-white rounded mt-4 max-h"},[t("table",{staticClass:"min-w-full divide-y divide-gray-200"},[t("thead",{staticClass:"bg-gray-50"},[t("tr",[t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Virksomhed ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" CVR ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Status ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Billetkonto ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Sidst synkroniseret ")]),t("th",{staticClass:"relative px-4 py-3",attrs:{scope:"col"}},[t("span",{staticClass:"sr-only"},[e._v("Handlinger")])])])]),t("tbody",{staticClass:"bg-white divide-y divide-gray-200"},[e._l(e.companies.data,function(r){return t("tr",{key:r.id},[t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[t("div",{staticClass:"text-sm font-medium text-gray-900"},[e._v(e._s(r.name))]),t("div",{staticClass:"text-sm text-gray-500"},[e._v(e._s(r.country))])]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},[e._v(" "+e._s(r.cvr_number||"-")+" ")]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[r.buying_status==="active"?t("span",{staticClass:"px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800"},[e._v(" Aktiv ")]):t("span",{staticClass:"px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800"},[e._v(" "+e._s(r.buying_status||"Ukendt")+" ")])]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[r.roboticket_id?t("span",{staticClass:"px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800"},[e._v(" "+e._s(r.roboticket_id)+" ")]):t("span",{staticClass:"text-sm text-gray-400"},[e._v("-")])]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},[e._v(" "+e._s(e.formatDate(r.synced_at))+" ")]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium"},[t("inertia-link",{staticClass:"text-indigo-600 hover:text-indigo-900 hover:underline",attrs:{href:e.route("admin.companies.show",r.id)}},[e._v(" Vis ")])],1)])}),e.companies.data.length===0?t("tr",[t("td",{staticClass:"px-6 py-4",attrs:{colspan:"6"}},[t("div",{staticClass:"flex flex-row justify-center items-center py-8"},[t("svg",{staticClass:"h-10 w-10 text-gray-400 mr-3",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"}})]),t("p",{staticClass:"text-sm font-medium text-gray-500"},[e.search?t("span",[e._v('Ingen virksomheder fundet for "'+e._s(e.search)+'"')]):t("span",[e._v("Ingen virksomheder fundet")])])])])]):e._e()],2)])])])},uwe=[],lwe=ve(owe,cwe,uwe,!1,null,null);const dwe=lwe.exports,fwe=Object.freeze(Object.defineProperty({__proto__:null,default:dwe},Symbol.toStringTag,{value:"Module"})),hwe={props:{company:{type:Object,required:!0},contacts:{type:Array,default:()=>[]},deals:{type:Array,default:()=>[]}},components:{AdminLayout:Gt},data(){return{expandedDeals:[]}},computed:{hasInvoiceAddress(){return this.company.invoice_address1||this.company.invoice_address2||this.company.invoice_zipcode||this.company.invoice_city}},methods:{formatDate(n){return n?new Date(n).toLocaleDateString("da-DK",{year:"numeric",month:"long",day:"numeric"}):"-"},formatDateTime(n){return n?new Date(n).toLocaleDateString("da-DK",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-"},formatCurrency(n){return n==null?"-":new Intl.NumberFormat("da-DK",{style:"currency",currency:"DKK",minimumFractionDigits:0,maximumFractionDigits:0}).format(n)},toggleDealProducts(n){const e=this.expandedDeals.indexOf(n);e===-1?this.expandedDeals.push(n):this.expandedDeals.splice(e,1)},isDealCurrentlyActive(n){if(!n.agreement_start||!n.agreement_end)return n.is_active;const e=new Date,t=new Date(n.agreement_start),r=new Date(n.agreement_end);return t<=e&&e<=r},isDealExpired(n){return n.agreement_end?new Date>new Date(n.agreement_end):!1},isDealPending(n){return n.agreement_start?new Date<new Date(n.agreement_start):!1},getDealStatusText(n){return this.isDealCurrentlyActive(n)?"Aktiv":this.isDealExpired(n)?"Udløbet":this.isDealPending(n)?"Kommende":n.deal_status_text||"Ukendt"},getDealStatusBadgeClass(n){return this.isDealCurrentlyActive(n)?"px-2 py-0.5 text-xs font-medium rounded bg-green-100 text-green-700":this.isDealExpired(n)?"px-2 py-0.5 text-xs font-medium rounded bg-gray-100 text-gray-600":this.isDealPending(n)?"px-2 py-0.5 text-xs font-medium rounded bg-blue-100 text-blue-700":"px-2 py-0.5 text-xs font-medium rounded bg-gray-100 text-gray-600"},getDealBorderClass(n){return this.isDealCurrentlyActive(n)?"border-green-200":this.isDealExpired(n)?"border-gray-200 opacity-75":this.isDealPending(n)?"border-blue-200":"border-gray-200"},getDealHeaderClass(n){return this.isDealCurrentlyActive(n)?"bg-green-50":this.isDealPending(n)?"bg-blue-50":""}}};var pwe=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"flex flex-row justify-between items-center"},[t("div",{staticClass:"flex items-center gap-4"},[t("inertia-link",{staticClass:"text-gray-500 hover:text-gray-700",attrs:{href:e.route("admin.companies.index")}},[t("svg",{staticClass:"w-6 h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}})])]),t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(e._s(e.company.name))])],1),t("div",{staticClass:"flex items-center gap-2"},[e.company.buying_status==="active"?t("span",{staticClass:"px-3 py-1 inline-flex text-sm font-semibold rounded-full bg-green-100 text-green-800"},[e._v(" Aktiv partner ")]):t("span",{staticClass:"px-3 py-1 inline-flex text-sm font-semibold rounded-full bg-gray-100 text-gray-800"},[e._v(" "+e._s(e.company.buying_status||"Ukendt status")+" ")])])])]},proxy:!0}])},[t("div",{staticClass:"md:mx-auto my-5 p-5 max-w-7xl px-4 sm:px-6 lg:px-8"},[t("div",{staticClass:"md:flex no-wrap md:-mx-2"},[t("div",{staticClass:"w-full md:w-4/12 md:mx-2"},[t("div",{staticClass:"bg-white p-5 border-t-4 border-fck-blue shadow-sm rounded-sm"},[t("div",{staticClass:"flex items-center space-x-2 font-semibold text-gray-900 leading-8 mb-4"},[t("svg",{staticClass:"w-5 h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 6.75h.75m-.75 3h.75m-.75 3h.75m3-6h.75m-.75 3h.75m-.75 3h.75M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H2
39271m-3.75 3.75h.008v.008h-.008v-.008Zm0 3h.008v.008h-.008v-.008Zm0 3h.008v.008h-.008v-.008Z"}})]),t("span",{staticClass:"text-lg font-bold tracking-wide"},[e._v("Virksomhedsinfo")])]),t("ul",{staticClass:"text-gray-600 divide-y"},[t("li",{staticClass:"flex flex-col py-2"},[t("span",{staticClass:"text-xs text-gray-500 uppercase"},[e._v("Navn")]),t("span",{staticClass:"font-medium"},[e._v(e._s(e.company.name))])]),e.company.cvr_number?t("li",{staticClass:"flex flex-col py-2"},[t("span",{staticClass:"text-xs text-gray-500 uppercase"},[e._v("CVR")]),t("span",{staticClass:"font-medium"},[e._v(e._s(e.company.cvr_number))])]):e._e(),e.company.country?t("li",{staticClass:"flex flex-col py-2"},[t("span",{staticClass:"text-xs text-gray-500 uppercase"},[e._v("Land")]),t("span",{staticClass:"font-medium"},[e._v(e._s(e.company.country))])]):e._e(),e.company.partner_level?t("li",{staticClass:"flex flex-col py-2"},[t("span",{staticClass:"text-xs text-gray-500 uppercase"},[e._v("Partner niveau")]),t("span",{staticClass:"font-medium"},[e._v(e._s(e.company.partner_level))])]):e._e(),e.company.partner_since?t("li",{staticClass:"flex flex-col py-2"},[t("span",{staticClass:"text-xs text-gray-500 uppercase"},[e._v("Partner siden")]),t("span",{staticClass:"font-medium"},[e._v(e._s(e.formatDate(e.company.partner_since)))])]):e._e(),t("li",{staticClass:"flex flex-col py-2"},[t("span",{staticClass:"text-xs text-gray-500 uppercase"},[e._v("Lime ID")]),t("span",{staticClass:"font-medium text-gray-500"},[e._v(e._s(e.company.lime_id))])])])]),t("div",{staticClass:"bg-white p-5 shadow-sm rounded-sm mt-4"},[t("div",{staticClass:"flex items-center space-x-2 font-semibold text-gray-900 leading-8 mb-4"},[t("svg",{staticClass:"w-5 h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 6v.75m0 3v.75m0 3v.75m0 3V18m-9-5.25h5.25M7.5 15h3M3.375 5.25c-.621 0-1.125.504-1.125 1.125v3.026a2.999 2.999 0 0 1 0 5.198v3.026c0 .621.504 1.125 1.125 1.125h17.25c.621 0 1.125-.504 1.125-1.125v-3.026a2.999 2.999 0 0 1 0-5.198V6.375c0-.621-.504-1.125-1.125-1.125H3.375Z"}})]),t("span",{staticClass:"text-lg font-bold tracking-wide"},[e._v("Billetkonto")])]),e.company.roboticket_id?t("div",{staticClass:"text-gray-600"},[t("div",{staticClass:"flex items-center gap-2 mb-2"},[t("span",{staticClass:"px-2 py-1 text-xs font-semibold rounded bg-blue-100 text-blue-800"},[e._v("Tilsluttet")])]),t("p",{staticClass:"text-sm"},[e._v("Roboticket ID: "),t("span",{staticClass:"font-mono"},[e._v(e._s(e.company.roboticket_id))])])]):t("div",{staticClass:"text-gray-500 text-sm"},[t("p",[e._v("Ingen billetkonto tilsluttet")])])]),e.hasInvoiceAddress?t("div",{staticClass:"bg-white p-5 shadow-sm rounded-sm mt-4"},[t("div",{staticClass:"flex items-center space-x-2 font-semibold text-gray-900 leading-8 mb-4"},[t("svg",{staticClass:"w-5 h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}}),t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"}})]),t("span",{staticClass:"text-lg font-bold tracking-wide"},[e._v("Faktureringsadresse")])]),t("div",{staticClass:"text-gray-600 text-sm"},[e.company.invoice_address1?t("p",[e._v(e._s(e.company.invoice_address1))]):e._e(),e.company.invoice_address2?t("p",[e._v(e._s(e.company.invoice_address2))]):e._e(),e.company.invoice_zipcode||e.company.invoice_city?t("p",[e._v(" "+e._s(e.company.invoice_zipcode)+" "+e._s(e.company.invoice_city)+" ")]):e._e()])]):e._e(),t("div",{staticClass:"bg-gray-50 p-4 rounded-sm mt-4 text-xs text-gray-500"},[t("p",[e._v("Sidst synkroniseret: "+e._s(e.formatDateTime(e.company.synced_at)))])])]),t("div",{staticClass:"w-full md:w-8/12 md:mx-2 mt-4 md:mt-0"},[t("div",{staticClass:"bg-white p-5 shadow-sm rounded-sm"},[t("div",{staticClass:"flex items-center justify-between mb-4"},[t("div",{staticClass:"flex items-center space-x-2 font-semibold text-gray-900 leading-8"},[t("svg",{staticClass:"w-5 h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"}})]),t("span",{staticClass:"text-lg font-bold tracking-wide"},[e._v("Kontaktpersoner")])]),t("span",{staticClass:"text-sm text-gray-500"},[e._v(e._s(e.contacts.length)+" kontakt(er)")])]),e.contacts.length===0?t("div",{staticClass:"text-gray-500 text-sm py-8 text-center"},[t("svg",{staticClass:"w-12 h-12 mx-auto mb-3 text-gray-300",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"}})]),t("p",[e._v("Ingen kontaktpersoner fundet")])]):t("div",{staticClass:"space-y-4"},e._l(e.contacts,function(r){return t("div",{key:r.id,staticClass:"border rounded-lg p-4",class:{"border-gray-200":!r.inactive,"border-red-200 bg-red-50":r.inactive}},[t("div",{staticClass:"flex items-start justify-between"},[t("div",{staticClass:"flex-1"},[t("div",{staticClass:"flex items-center gap-2 mb-1"},[t("h3",{staticClass:"font-semibold text-gray-900"},[e._v(" "+e._s(r.name||`${r.firstname} ${r.lastname}`)+" ")]),r.inactive?t("span",{staticClass:"px-2 py-0.5 text-xs font-medium rounded bg-red-100 text-red-700"}
3927,[e._v(" Inaktiv ")]):e._e()]),r.position?t("p",{staticClass:"text-sm text-gray-600 mb-2"},[e._v(e._s(r.position))]):e._e(),t("div",{staticClass:"text-sm text-gray-500 space-y-1"},[r.email?t("p",{staticClass:"flex items-center gap-2"},[t("svg",{staticClass:"w-4 h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"}})]),e._v(" "+e._s(r.email)+" ")]):e._e(),r.phone?t("p",{staticClass:"flex items-center gap-2"},[t("svg",{staticClass:"w-4 h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 0 0 2.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 0 1-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 0 0-1.091-.852H4.5A2.25 2.25 0 0 0 2.25 4.5v2.25Z"}})]),e._v(" "+e._s(r.phone)+" ")]):e._e(),r.mobilephone?t("p",{staticClass:"flex items-center gap-2"},[t("svg",{staticClass:"w-4 h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 1.5H8.25A2.25 2.25 0 0 0 6 3.75v16.5a2.25 2.25 0 0 0 2.25 2.25h7.5A2.25 2.25 0 0 0 18 20.25V3.75a2.25 2.25 0 0 0-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3"}})]),e._v(" "+e._s(r.mobilephone)+" ")]):e._e()]),r.roles&&r.roles.length>0?t("div",{staticClass:"mt-3"},[t("div",{staticClass:"flex flex-wrap gap-1"},e._l(r.roles,function(i){return t("span",{key:i.id,staticClass:"px-2 py-0.5 text-xs font-medium rounded bg-purple-100 text-purple-700"},[e._v(" "+e._s(i.role_name||`Rolle #${i.lime_role_id}`)+" ")])}),0)]):e._e()]),t("div",{staticClass:"ml-4"},[r.matched_user?t("div",{staticClass:"text-right"},[t("span",{staticClass:"px-2 py-1 text-xs font-semibold rounded bg-green-100 text-green-800 mb-2 inline-block"},[e._v(" FCK Profil ")]),t("inertia-link",{staticClass:"block text-sm text-indigo-600 hover:text-indigo-900 hover:underline",attrs:{href:e.route("admin.users.show",r.matched_user.id)}},[e._v(" "+e._s(r.matched_user.firstname)+" "+e._s(r.matched_user.lastname)+" ")])],1):t("div",{staticClass:"text-right"},[t("span",{staticClass:"px-2 py-1 text-xs font-medium rounded bg-gray-100 text-gray-500"},[e._v(" Ingen FCK Profil ")])])])])])}),0)]),t("div",{staticClass:"bg-white p-5 shadow-sm rounded-sm mt-4"},[t("div",{staticClass:"flex items-center justify-between mb-4"},[t("div",{staticClass:"flex items-center space-x-2 font-semibold text-gray-900 leading-8"},[t("svg",{staticClass:"w-5 h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}})]),t("span",{staticClass:"text-lg font-bold tracking-wide"},[e._v("Aftaler")])]),t("span",{staticClass:"text-sm text-gray-500"},[e._v(e._s(e.deals.length)+" aftale(r)")])]),e.deals.length===0?t("div",{staticClass:"text-gray-500 text-sm py-8 text-center"},[t("svg",{staticClass:"w-12 h-12 mx-auto mb-3 text-gray-300",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}})]),t("p",[e._v("Ingen aftaler fundet")])]):t("div",{staticClass:"space-y-4"},e._l(e.deals,function(r){return t("div",{key:r.id,staticClass:"border rounded-lg overflow-hidden",class:e.getDealBorderClass(r)},[t("div",{staticClass:"p-4",class:e.getDealHeaderClass(r)},[t("div",{staticClass:"flex items-start justify-between"},[t("div",{staticClass:"flex-1"},[t("div",{staticClass:"flex items-center gap-2 mb-1"},[t("h3",{staticClass:"font-semibold text-gray-900"},[e._v(e._s(r.name))]),t("span",{class:e.getDealStatusBadgeClass(r)},[e._v(" "+e._s(e.getDealStatusText(r))+" ")])]),t("div",{staticClass:"text-sm text-gray-600 space-y-1"},[r.deal_type_text?t("p",{staticClass:"flex items-center gap-2"},[t("svg",{staticClass:"w-4 h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z"}}),t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 6h.008v.008H6V6Z"}}
3927)]),e._v(" "+e._s(r.deal_type_text)+" ")]):e._e(),r.agreement_start||r.agreement_end?t("p",{staticClass:"flex items-center gap-2"},[t("svg",{staticClass:"w-4 h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"}})]),e._v(" "+e._s(e.formatDate(r.agreement_start))+" â "+e._s(e.formatDate(r.agreement_end))+" ")]):e._e(),r.contract_id?t("p",{staticClass:"flex items-center gap-2"},[t("svg",{staticClass:"w-4 h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5-3.9 19.5m-2.1-19.5-3.9 19.5"}})]),e._v(" Kontrakt: "+e._s(r.contract_id)+" ")]):e._e()])]),t("div",{staticClass:"text-right ml-4"},[r.value?t("p",{staticClass:"text-lg font-bold text-gray-900"},[e._v(" "+e._s(e.formatCurrency(r.value))+" ")]):e._e(),r.deal_status_text?t("p",{staticClass:"text-xs text-gray-500"},[e._v(" "+e._s(r.deal_status_text)+" ")]):e._e()])])]),r.products&&r.products.length>0?t("div",{staticClass:"border-t bg-gray-50"},[t("button",{staticClass:"w-full px-4 py-2 flex items-center justify-between text-sm text-gray-600 hover:bg-gray-100 transition-colors",on:{click:function(i){return e.toggleDealProducts(r.id)}}},[t("span",{staticClass:"flex items-center gap-2"},[t("svg",{staticClass:"w-4 h-4",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"}})]),e._v(" "+e._s(r.products.length)+" produkt(er) ")]),t("svg",{staticClass:"w-4 h-4 transition-transform",class:{"rotate-180":e.expandedDeals.includes(r.id)},attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}})])]),e.expandedDeals.includes(r.id)?t("div",{staticClass:"px-4 pb-4"},[t("table",{staticClass:"w-full text-sm"},[t("thead",[t("tr",{staticClass:"text-xs text-gray-500 uppercase"},[t("th",{staticClass:"text-left py-2"},[e._v("Produkt")]),t("th",{staticClass:"text-right py-2"},[e._v("Antal")]),t("th",{staticClass:"text-right py-2"},[e._v("Pris")]),t("th",{staticClass:"text-right py-2"},[e._v("Total")])])]),t("tbody",{staticClass:"divide-y divide-gray-200"},e._l(r.products,function(i){return t("tr",{key:i.id,class:{"opacity-50":i.inactive}},[t("td",{staticClass:"py-2"},[t("div",{staticClass:"font-medium text-gray-900"},[e._v(e._s(i.article_name||"Ukendt produkt"))]),i.description?t("div",{staticClass:"text-xs text-gray-500 truncate max-w-xs"},[e._v(e._s(i.description))]):e._e(),i.season?t("div",{staticClass:"text-xs text-gray-400"},[e._v("Sæson: "+e._s(i.season))]):e._e()]),t("td",{staticClass:"text-right py-2 text-gray-600"},[e._v(" "+e._s(i.amount)+" "+e._s(i.unit||"stk")+" ")]),t("td",{staticClass:"text-right py-2 text-gray-600"},[e._v(" "+e._s(e.formatCurrency(i.price_per_piece))+" ")]),t("td",{staticClass:"text-right py-2 font-medium text-gray-900"},[e._v(" "+e._s(e.formatCurrency(i.total_value_with_discount||i.total_value))+" ")])])}),0)])]):e._e()]):e._e()])}),0)])])])])])},mwe=[],gwe=ve(hwe,pwe,mwe,!1,null,null);const vwe=gwe.exports,ywe=Object.freeze(Object.defineProperty({__proto__:null,default:vwe},Symbol.toStringTag,{value:"Module"})),_we={};var bwe=function(){var e=this,t=e._self._c;return t("img",{attrs:{src:"/img/logo.png"}})},xwe=[],wwe=ve(_we,bwe,xwe,!1,null,null);const Cwe=wwe.exports,kwe={components:{JetApplicationLogo:Cwe}};var Swe=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"p-6 sm:px-20 bg-white border-b border-gray-200"},[t("div",{staticClass:"mt-8 text-2xl"},[t("h1",{staticClass:"uppercase"},[e._v(e._s(e.$trans("dashboard.profile.title")))]),t("p",{staticClass:"text-gray-500 mt-6"},[e._v(e._s(e.$trans("dashboard.profile.text")))])])]),t("div",{staticClass:"bg-gray-200 bg-opacity-25 grid grid-cols-1 md:grid-cols-2"},[t("div",{staticClass:"p-6"},[t("div",{staticClass:"flex flex-row"},[t("div",{staticClass:"flex mr-2 mt-0.5"},[t("svg",{staticClass:"w-8 h-8 text-fck-blue",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z"}})])]),t("div",{staticClass:"flex flex-col"},[t("h4",{staticClass:"m-0"},[e._v(" "+e._s(e.$trans("dashboard.tickets.title"))+" ")]),t("p",[e._v(" "+e._s(e.$trans("dashboard.tickets.text"))+" ")]),t("a",{attrs:{href:e.route("redirect.tickets"),target:"_blank"}},[t("div",{staticClass:"mt-3 flex items-center text-sm font-semibold text-fck-blue"},[t("div",[e._v(e._s(e.$trans("dashboard.tickets.linktext")))]),t("div",{staticClass:"ml-1 text-fck-blue"},[t("svg",{staticClass:"w-4 h-4",attrs:{viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])])])])])]),t("div",{staticClass:"p-6 border-t border-gray-200 md:border-t-0 md:border-l"},[t("div",{staticClass:"flex flex-row"},[t("div",{staticClass:"flex mr-2 mt-0.5"},[t("svg",{staticClass:"h-8 w-8 text-fck-blue",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9"}})])]),t("div",{staticClass:"flex flex-col"},[t("h4",{staticClass:"m-0"},[e._v(" "+e._s(e.$trans("dashboard.fanshop.title"))+" ")]),t("p",[e._v(" "+e._s(e.$trans("dashboard.fanshop.text"))+" ")]),t("a",{attrs:{href:e.route("redirect.webshop"),target:"_blank"}},[t("div",{staticClass:"mt-3 flex items-center text-sm font-semibold text-fck-blue"},[t("div",[e._v(e._s(e.$trans("dashboard.fanshop.linktext")))]),t("div",{staticClass:"ml-1 text-fck-blue"},[t("svg",{staticClass:"w-4 h-4",attrs:{viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])])])])])]),t("div",{staticClass:"p-6 border-t border-gray-200"},[t("div",{staticClass:"flex flex-row"},[t("div",{staticClass:"flex mr-2 mt-0.5"},[t("svg",{staticClass:"h-8 w-8 text-fck-blue",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"}})])]),t("div",{staticClass:"flex flex-col"},[t("h4",{staticClass:"m-0"},[e._v(" "+e._s(e.$trans("dashboard.marketing.title"))+" ")]),t("p",[e._v(" "+e._s(e.$trans("dashboard.marketing.text"))+" ")]),t("a",{attrs:{href:`${e.route("profile.show")}#permissions-form`}},[t("div",{staticClass:"mt-3 flex items-center text-sm font-semibold text-fck-blue"},[t("div",[e._v(e._s(e.$trans("dashboard.marketing.linktext")))]),t("div",{staticClass:"ml-1 text-fck-blue"},[t("svg",{staticClass:"w-4 h-4",attrs:{viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])])])])])]),t("div",{staticClass:"p-6 border-t border-gray-200 md:border-l"},[t("div",{staticClass:"flex flex-row"},[t("div",{staticClass:"flex mr-2 mt-0.5"},[t("svg",{staticClass:"h-8 w-8 text-fck-blue",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"}})])]),t("div",{staticClass:"flex flex-col"},[t("h4",{staticClass:"m-0"},[e._v(" "+e._s(e.$trans("dashboard.news.title"))+" ")]),t("p",[e._v(" "+e._s(e.$trans("dashboard.news.text"))+" ")]),t("a",{attrs:{href:"https://fck.dk",target:"_blank"}},[t("div",{staticClass:"mt-3 flex items-center text-sm font-semibold text-fck-blue"},[t("div",[e._v(e._s(e.$trans("dashboard.news.linktext")))]),t("div",{staticClass:"ml-1 text-fck-blue"},[t("svg",{staticClass:"w-4 h-4",attrs:{viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])])])])])])])])},Twe=[],Ewe=ve(kwe,Swe,Twe,!1,null,null);const Pwe=Ewe.exports,Rwe={props:["id"],components:{AppLayout:ta},data(){return{tickets:[],fetching:!0}},created(){this.getTickets()},computed:{activeTickets(){return this.tickets.filter(n=>Le(n.EventDate).isAfter(Le())&&n.Status===1)}},methods:{formatDate(n){return Le(n).format("DD/MM/YYYY HH:mm")},getTickets(){this.fetching=!0;const n=this.id?`/admin/users/${this.id}/get-tickets`:"/user/get-tickets";return axios.get(n).then(e=>{this.tickets=(e==null?void 0:e.data)||[],this.fetching=!1})}}};var Awe=function(){var e=this,t=e._self._c;return t("div",[t("div",{},[t("h1",{staticClass:"border-l-4 border-fck-blue text-2xl pl-2 line normal-case leading-lg font-black mb-3"},[e._v(e._s(e.$trans("pages.tickets.tickets")))])]),e.fetching?t("div",{staticClass:"grid sm:grid-cols-2 gap-6 mb-6"},e._l(3,function(r){return t("div",{key:r,staticClass:"bg-white rounded-lg overflow-hidden shadow-sm border border-gray-100"},[t("div",{staticClass:"p-4 space-y-3"},[t("div",{staticClass:"h-6 bg-gray-200 rounded animate-pulse w-3/4"}),t("div",{staticClass:"grid grid-cols-2 gap-4 pt-2"},e._l(4,function(i){return t("div",{key:i,staticClass:"space-y-2"},[t("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-1/2"}),t("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-3/4"})])}),0)]),e._m(0,!0)])}),0):e.activeTickets.length>0?t("div",{staticClass:"grid sm:grid-cols-2 gap-6 mb-6"},e._l(e.activeTickets,function(r){return t("div",{key:r.Id,staticClass:"bg-white rounded-lg overflow-hidden shadow-sm transition-shadow duration-300 hover:shadow-lg border border-gray-100"},[t("div",{staticClass:"p-4"},[t("h3",{staticClass:"font-sans text-lg text-[#002D62] font-bold mb-4"},[e._v(" "+e._s(r.EventName)+" ")]),t("div",{staticClass:"grid grid-cols-2 gap-4 font-text text-sm"},[t("div",[t("p",{staticClass:"text-gray-500"},[e._v(e._s(e.$trans("pages.tickets.entrance")))]),t("p",{staticClass:"font-medium text-gray-900"},[e._v(e._s(r.EntranceText)+" - "+e._s(r.Platform))])]),t("div",[t("p",{staticClass:"text-gray-500"},[e._v(e._s(e.$trans("pages.tickets.date")))]),t("p",{staticClass:"font-medium text-gray-900"},[e._v(e._s(e.formatDate(r.EventDate)))])]),t("div",[t("p",{staticClass:"text-gray-500"},[e._v(e._s(e.$trans("pages.tickets.row")))]),t("p",{staticClass:"font-medium text-gray-900"},[e._v(e._s(r.SeatRow))])]),t("div",[t("p",{staticClass:"text-gray-500"},[e._v(e._s(e.$trans("pages.tickets.seat")))]),t("p",{staticClass:"font-medium text-gray-900"},[e._v(e._s(r.SeatNumber))])])])]),t("div",{staticClass:"px-4 py-3 bg-gray-50 flex items-center justify-between"},[t("div",{staticClass:"flex items-center space-x-4"},[t("a",{staticClass:"flex items-center space-x-2 font-sans text-sm font-bold text-[#002D62] hover:text-blue-700",attrs:{href:r.MobileUrl}},[t("svg",{staticClass:"h-5 w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"}})]),t("span",[e._v(e._s(e.$trans("pages.tickets.getmobileticket")))])]),r.PdfUrl?t("a",{staticClass:"flex items-center space-x-2 font-sans text-sm font-bold text-[#002D62] hover:text-blue-700",attrs:{href:r.PdfUrl}},[t("svg",{staticClass:"h-5 w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"}}
3927)]),t("span",[e._v("PDF")])]):e._e()]),t("span",{staticClass:"text-sm text-gray-500 font-medium"},[e._v(" #"+e._s(r.TicketNumber)+" ")])])])}),0):t("div",{staticClass:"text-center py-12 mb-6"},[t("svg",{staticClass:"mx-auto h-12 w-12 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z"}})]),t("h3",{staticClass:"mt-2 text-lg font-medium text-gray-900"},[e._v(e._s(e.$trans("pages.tickets.notickets")))]),t("p",{staticClass:"mt-1 text-sm text-gray-500"},[e._v(e._s(e.$trans("pages.tickets.buytickets")))]),t("div",{staticClass:"mt-6"},[t("a",{staticClass:"inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-[#002D62] hover:bg-blue-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",attrs:{href:"/redirect/tickets"}},[e._v(" "+e._s(e.$trans("pages.tickets.buyticketscta"))+" ")])])])])},Iwe=[function(){var n=this,e=n._self._c;return e("div",{staticClass:"px-4 py-3 bg-gray-50 flex justify-between"},[e("div",{staticClass:"flex space-x-4"},[e("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-24"}),e("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-16"})]),e("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-20"})])}],Owe=ve(Rwe,Awe,Iwe,!1,null,null);const vE=Owe.exports,Mwe={name:"SkeletonWidget"};var Dwe=function(){var e=this;return e._self._c,e._m(0)},Nwe=[function(){var n=this,e=n._self._c;return e("div",{staticClass:"bg-white p-6 shadow-lg flex flex-col justify-between"},[e("div",[e("div",{staticClass:"h-6 bg-gray-300 rounded mb-4 w-2/3 shimmer"}),n._v(" "),e("div",{staticClass:"flex flex-col"},[e("div",{staticClass:"h-10 bg-gray-300 rounded mb-2 w-full shimmer"}),n._v(" "),e("div",{staticClass:"h-4 bg-gray-300 rounded mb-2 w-1/2 shimmer"}),n._v(" "),e("div",{staticClass:"divide-y divide-gray-300"},[e("div",{staticClass:"flex flex-col justify-between py-2"},[e("div",{staticClass:"h-6 bg-gray-300 rounded mb-2 w-3/4 shimmer"})])])])]),e("div",[e("div",{staticClass:"mt-2"},[e("div",{staticClass:"flex flex-row items-center"},[e("div",{staticClass:"h-6 bg-gray-300 rounded w-1/4 shimmer"})])])])])}],Lwe=ve(Mwe,Dwe,Nwe,!1,null,"dfadeca4");const Lf=Lwe.exports,Fwe={name:"SeasonticketWidget",components:{SkeletonWidget:Lf},props:{seasonTickets:{type:[Array,null],default:null},loading:{type:Boolean,default:!0}},computed:{isLoading(){return this.loading||!this.seasonTickets},filteredSeasonTickets(){if(!this.seasonTickets)return[];const n=new Date;return this.seasonTickets.map(e=>{const t=Object.values(e.games||{}).filter(r=>new Date(r.Date)>n).sort((r,i)=>new Date(r.Date)-new Date(i.Date));return{...e,games:t}}).filter(e=>e.games.length>0)}}};var $we=function(){var r;var e=this,t=e._self._c;return e.isLoading?t("SkeletonWidget"):((r=e.filteredSeasonTickets)==null?void 0:r.length)>0?t("div",{staticClass:"bg-white p-6 shadow-lg flex flex-col justify-between"},[t("div",[t("h2",{staticClass:"text-xl font-semibold mb-4"},[e._v(e._s(e.$trans("pages.widgets.seasonticket")))]),e._l(e.filteredSeasonTickets,function(i){return t("div",{staticClass:"flex flex-col"},[t("h3",{staticClass:"text-4xl text-fck-blue"},[e._v(e._s(i.SeasonTicketName))]),t("p",{staticClass:"text-sm text-gray-500 -mb-2"},[e._v(e._s(e.$trans("pages.widgets.upcomingmatches")))]),t("div",{staticClass:"divide-y divide-gray-300"},e._l(i.games,function(a){return t("div",{staticClass:"flex flex-col justify-between py-2 py-2:first-of-child"},[t("p",{staticClass:"font-bold text-lg"},[e._v(e._s(a.Name))]),t("div",{staticClass:"flex flex-row justify-between"},[t("p",{staticClass:"text-sm text-gray-500"},[e._v(e._s(a.Date))]),a.StatusInt===4?t("p",{staticClass:"text-sm text-red-300"},[e._v(e._s(e.$trans("pages.widgets.converted")))]):e._e()])])}),0)])})],2),t("div",[t("inertia-link",{staticClass:"mt-2",attrs:{href:"/user/tickets"}},[t("div",{staticClass:"flex flex-row items-center"},[e._v(" "+e._s(e.$trans("pages.widgets.gotoseasonticket"))+" "),t("span",{staticClass:"ml-1 text-fck-blue"},[t("svg",{staticClass:"w-4 h-4",attrs:{viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z","clip-rule":"evenodd"}}
3927)])])])])],1)]):e._e()},Bwe=[],Uwe=ve(Fwe,$we,Bwe,!1,null,null);const jwe=Uwe.exports,qwe={name:"AwaycardWidget",components:{SkeletonWidget:Lf},props:{awaycard:{type:Object,required:!1}},mounted(){setTimeout(()=>{this.isLoading=!1},1e3)},data(){return{isLoading:!0}}};var zwe=function(){var e=this,t=e._self._c;return e.isLoading?t("SkeletonWidget"):e.awaycard?t("div",{staticClass:"bg-white p-6 shadow-lg flex flex-col justify-between"},[t("div",{},[t("h2",{staticClass:"text-xl font-semibold mb-4"},[e._v(e._s(e.$trans("pages.widgets.awaymembership")))]),e.awaycard.is_approved?t("p",{staticClass:"text-4xl font-bold text-fck-blue flex flex-row items-center"},[e._v(e._s(e.$trans("pages.widgets.active"))+" "),t("svg",{staticClass:"size-6 ml-2",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 0 1-1.043 3.296 3.745 3.745 0 0 1-3.296 1.043A3.745 3.745 0 0 1 12 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 0 1-3.296-1.043 3.745 3.745 0 0 1-1.043-3.296A3.745 3.745 0 0 1 3 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 0 1 1.043-3.296 3.746 3.746 0 0 1 3.296-1.043A3.746 3.746 0 0 1 12 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 0 1 3.296 1.043 3.746 3.746 0 0 1 1.043 3.296A3.745 3.745 0 0 1 21 12Z"}})])]):e._e(),!e.awaycard.is_paid&&!e.awaycard.is_approved?t("p",{staticClass:"text-4xl font-bold text-fck-blue"},[e._v(e._s(e.$trans("pages.widgets.awaitingpayment")))]):e._e(),e.awaycard.is_paid&&!e.awaycard.is_approved?t("p",{staticClass:"text-4xl font-bold text-fck-blue"},[e._v(e._s(e.$trans("pages.widgets.awaitingapproval")))]):e._e(),t("p",{staticClass:"text-sm text-gray-500"},[e._v(e._s(e.$trans("pages.widgets.status")))])]),t("inertia-link",{staticClass:"mt-2",attrs:{href:"/user/fck-away"}},[t("div",{staticClass:"flex flex-row items-center text-gray-700"},[e._v(" "+e._s(e.$trans("pages.widgets.awaylink"))+" "),t("span",{staticClass:"ml-1 text-fck-blue"},[t("svg",{staticClass:"w-4 h-4",attrs:{viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])])])],1):e._e()},Wwe=[],Hwe=ve(qwe,zwe,Wwe,!1,null,null);const Vwe=Hwe.exports,Gwe={name:"TicketWidget",components:{SkeletonWidget:Lf},props:{tickets:{type:[Array,null],default:null},loading:{type:Boolean,default:!0}},computed:{isLoading(){return this.loading||!this.tickets},filteredTickets(){if(!this.tickets)return[];const n=new Date;return this.tickets.filter(e=>new Date(e.EventDate)>n&&e.Status===1)}}};var Kwe=function(){var e=this,t=e._self._c;return e.isLoading?t("SkeletonWidget"):t("div",{staticClass:"bg-white p-6 shadow-lg flex flex-col justify-between"},[t("div",{staticClass:"mb-4"},[t("h2",{staticClass:"text-xl font-semibold mb-4"},[e._v(e._s(e.$trans("pages.widgets.ticketstitle")))]),t("p",{staticClass:"text-4xl font-bold text-fck-blue"},[e._v(e._s(e.$trans("pages.widgets.tickets",{args:{count:e.filteredTickets.length},pluralize:!0})))]),t("div",{staticClass:"divide-y divide-gray-300"},[e._l(e.filteredTickets,function(r){return t("div",{staticClass:"flex flex-col py-2"},[t("p",{staticClass:"font-bold text-lg"},[e._v(e._s(r.EventName))]),t("p",{staticClass:"text-sm text-gray-500"},[e._v(e._s(r.EventDate))]),t("p",{},[e._v(e._s(e.$trans("pages.widgets.entrance"))+": "+e._s(r.EntranceText))]),t("p",{},[e._v(e._s(e.$trans("pages.widgets.sector"))+": "+e._s(r.SectorName)+" | "+e._s(e.$trans("pages.widgets.row"))+": "+e._s(r.SeatRow)+" | "+e._s(e.$trans("pages.widgets.seat"))+": "+e._s(r.SeatNumber))]),t("div",{})])}),e.filteredTickets.length===0?t("div",{staticClass:"flex flex-col py-2"},[t("p",{staticClass:"text-gray-600"},[e._v(e._s(e.$trans("pages.widgets.notickets")))])]):e._e()],2)]),e.filteredTickets.length>0?t("div",[t("inertia-link",{staticClass:"mt-2",attrs:{href:"/user/tickets"}},[t("div",{staticClass:"flex flex-row items-center"},[e._v(" "+e._s(e.$trans("pages.widgets.gototickets"))+" "),t("span",{staticClass:"ml-1 text-fck-blue"},[t("svg",{staticClass:"w-4 h-4",attrs:{viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z","clip-rule":"evenodd"}}
3927)])])])])],1):t("div",{staticClass:"flex"},[t("a",{staticClass:"mt-2 bg-fck-blue px-4 py-2",attrs:{href:"/redirect/tickets"}},[t("div",{staticClass:"flex flex-row items-center text-white text-xl font-bold uppercase tracking-wide"},[e._v(" "+e._s(e.$trans("pages.widgets.buytickets"))+" "),t("span",{staticClass:"ml-1 text-white"},[t("svg",{staticClass:"w-4 h-4",attrs:{viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])])])])])},Ywe=[],Xwe=ve(Gwe,Kwe,Ywe,!1,null,null);const Jwe=Xwe.exports,Qwe={};var Zwe=function(){var e=this;return e._self._c,e._m(0)},eCe=[function(){var n=this,e=n._self._c;return e("div",{staticClass:"bg-white p-6 shadow-lg"},[e("h2",{staticClass:"text-xl font-semibold mb-4"},[n._v("Marketing Permissions")]),e("p",{staticClass:"text-4xl font-bold text-indigo-600"},[n._v("Enabled")]),e("p",{staticClass:"text-sm text-gray-500"},[n._v("You are subscribed to our newsletters and promotions.")]),e("button",{staticClass:"mt-4 bg-blue-600 text-white py-2 px-4 rounded hover:bg-blue-700"},[n._v(" Manage Preferences ")])])}],tCe=ve(Qwe,Zwe,eCe,!1,null,null);const nCe=tCe.exports,rCe={name:"FanshopWidget",components:{SkeletonWidget:Lf},props:{orders:{type:[Object,null],default:null},loading:{type:Boolean,default:!0}},computed:{isLoading(){return this.loading||!this.orders},orderList(){var n;return((n=this.orders)==null?void 0:n.orders)||[]},latestOrder(){return this.orderList[0]||null}}};var iCe=function(){var e=this,t=e._self._c;return e.isLoading?t("SkeletonWidget"):t("div",{staticClass:"bg-white p-6 shadow-lg"},[t("h2",{staticClass:"text-xl font-semibold mb-4"},[e._v(" Fanshop ")]),t("p",{staticClass:"text-4xl font-bold text-fck-blue"},[e._v(e._s(e.$trans("pages.widgets.orders",{args:{count:e.orderList.length},pluralize:!0})))]),e.orderList.length>0?t("div",{},[t("p",{staticClass:"text-sm text-gray-700 mt-4"},[e._v(e._s(e.$trans("pages.widgets.latestorder")))]),t("div",{staticClass:"flex flex-col divide-y"},[t("table",{staticClass:"table table-auto"},[t("thead",[t("tr",[t("th",{staticClass:"text-left"},[e._v(e._s(e.$trans("pages.widgets.ordernumber")))]),t("th",{staticClass:"text-left"},[e._v(e._s(e.$trans("pages.widgets.latestorder")))]),t("th",{staticClass:"text-left"},[e._v(e._s(e.$trans("pages.widgets.status")))])])]),t("tbody",{staticClass:"divide-y"},[t("tr",[t("td",{},[e._v(e._s(e.latestOrder.name))]),t("td",{},[e._v(e._s(new Date(e.latestOrder.created_at).toLocaleDateString("da-DK")))]),t("td",{},[e._v(e._s(e.latestOrder.fulfillment_status&&e.$trans(`pages.fanshop.${e.latestOrder.fulfillment_status}`)))])])])])])]):t("div",{staticClass:"mt-2"},[t("p",{staticClass:"mb-2 text-gray-600"},[e._v(e._s(e.$trans("pages.widgets.fanshopvp1")))])]),t("a",{attrs:{href:"/redirect/webshop"}},[t("div",{staticClass:"flex flex-row items-center text-gray-700 mt-4"},[e._v(" "+e._s(e.$trans("pages.widgets.fanshoplogin"))+" "),t("span",{staticClass:"ml-1 text-fck-blue"},[t("svg",{staticClass:"w-4 h-4",attrs:{viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])])])])},aCe=[],sCe=ve(rCe,iCe,aCe,!1,null,null);const oCe=sCe.exports,cCe={name:"PlusWidget",components:{SkeletonWidget:Lf},data(){return{isLoading:!0}},mounted(){setTimeout(()=>{this.isLoading=!1},1e3)}};var uCe=function(){var e=this,t=e._self._c;return e.isLoading?t("SkeletonWidget"):t("div",{staticClass:"bg-white p-6 shadow-lg flex flex-col justify-between"},[t("div",{staticClass:"mb-4"},[t("h2",{staticClass:"text-xl font-semibold mb-4"},[e._v(e._s(e.$trans("pages.widgets.plusaccess")))]),e.$page.props.hasValidSubscription?t("div",{},[t("p",{staticClass:"text-4xl font-bold text-fck-blue flex flex-row items-center"},[e._v(e._s(e.$trans("pages.widgets.active"))+" "),t("svg",{staticClass:"size-6 ml-2",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 0 1-1.043 3.296 3.745 3.745 0 0 1-3.296 1.043A3.745 3.745 0 0 1 12 21c-1.268 0-2.39-.63
3927-3.068-1.593a3.746 3.746 0 0 1-3.296-1.043 3.745 3.745 0 0 1-1.043-3.296A3.745 3.745 0 0 1 3 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 0 1 1.043-3.296 3.746 3.746 0 0 1 3.296-1.043A3.746 3.746 0 0 1 12 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 0 1 3.296 1.043 3.746 3.746 0 0 1 1.043 3.296A3.745 3.745 0 0 1 21 12Z"}})])]),t("p",{staticClass:"text-sm text-gray-500"},[e._v(e._s(e.$trans("pages.widgets.status")))]),t("p",{staticClass:"mt-2 text-gray-600"},[e._v(e._s(e.$trans("pages.widgets.plusaccesstext")))])]):t("div",[t("p",{staticClass:"text-4xl font-bold text-fck-blue"},[e._v(e._s(e.$trans("pages.widgets.inactive")))]),t("p",{staticClass:"mt-2 text-gray-800 flex flex-row items-center"},[e._v(e._s(e.$trans("pages.widgets.only",{args:{count:69}}))+" ")]),t("ul",{staticClass:"list-disc mt-1 pl-4 text-gray-800"},[t("li",{staticClass:"text-sm"},[e._v(e._s(e.$trans("pages.widgets.plusaccessvp1")))]),t("li",{staticClass:"text-sm"},[e._v(e._s(e.$trans("pages.widgets.plusaccessvp2")))]),t("li",{staticClass:"text-sm"},[e._v(e._s(e.$trans("pages.widgets.plusaccessvp3")))])])])]),e.$page.props.hasValidSubscription?t("div",{staticClass:"flex"},[e.$page.props.hasValidSubscription?t("a",{staticClass:"mt-2",attrs:{href:"https://tv.fck.dk"}},[t("div",{staticClass:"flex flex-row items-center text-gray-700"},[e._v(" "+e._s(e.$trans("pages.widgets.gototv"))+" "),t("span",{staticClass:"ml-1 text-fck-blue"},[t("svg",{staticClass:"w-4 h-4",attrs:{viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])])]):e._e()]):t("div",{staticClass:"flex"},[t("a",{staticClass:"mt-2 bg-fck-blue px-4 py-2 shrink",attrs:{href:`/redirect/tickets?redirect_url=${encodeURIComponent("https://billet.fck.dk/Merchandises/Buy?id=1032")}`}},[t("div",{staticClass:"flex flex-row items-center text-white text-xl font-bold uppercase tracking-wide"},[e._v(" "+e._s(e.$trans("pages.widgets.buy"))+" "),t("span",{staticClass:"ml-1 text-white"},[t("svg",{staticClass:"w-4 h-4",attrs:{viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])])])])])},lCe=[],dCe=ve(cCe,uCe,lCe,!1,null,null);const fCe=dCe.exports,hCe={name:"MembershipWidget",components:{SkeletonWidget:Lf},props:{memberships:{type:[Object,null],default:null},loading:{type:Boolean,default:!0}},computed:{isLoading(){return this.loading||!this.memberships},membershipList(){var n;return((n=this.memberships)==null?void 0:n.Result)||[]}}};var pCe=function(){var e=this,t=e._self._c;return e.isLoading?t("SkeletonWidget"):e.membershipList.length>0?t("div",{staticClass:"bg-white p-6 shadow-lg flex flex-col justify-between"},[t("div",[t("h2",{staticClass:"text-xl font-semibold mb-4"},[e._v(e._s(e.$trans("pages.widgets.membership")))]),e._l(e.membershipList,function(r){return t("div",{staticClass:"flex flex-col"},[t("h3",{staticClass:"text-4xl text-fck-blue"},[e._v(e._s(r))]),t("p",{staticClass:"text-sm text-gray-500 -mb-2"},[e._v(e._s(e.$trans("pages.widgets.active")))])])})],2)]):e._e()},mCe=[],gCe=ve(hCe,pCe,mCe,!1,null,null);const vCe=gCe.exports,yCe={components:{AppLayout:ta,Dashboard:Pwe,Tickets:vE,SeasonticketWidget:jwe,AwaycardWidget:Vwe,TicketWidget:Jwe,PermissionWidget:nCe,FanshopWidget:oCe,PlusWidget:fCe,MembershipWidget:vCe,SkeletonWidget:Lf},props:{tickets:{type:[Array,null],default:null},memberships:{type:[Object,null],default:null},seasonTickets:{type:[Array,null],default:null},orders:{type:[Object,null],default:null}},mounted(){this.$inertia.reload({only:["tickets","memberships","seasonTickets","orders"]})}};var _Ce=function(){var e=this,t=e._self._c;return t("app-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" Dashboard ")])]},proxy:!0}])},[t("div",{staticClass:"sm:pt-6 lg:pt-8"}
3927,[t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8"},[t("div",{staticClass:"container mx-auto py-3 sm:py-0 grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3 sm:gap-6 lg:gap-8"},[t("PlusWidget"),t("AwaycardWidget",{attrs:{awaycard:e.$page.props.user.away_application}}),t("SeasonticketWidget",{attrs:{"season-tickets":e.seasonTickets,loading:!e.seasonTickets}}),t("MembershipWidget",{attrs:{memberships:e.memberships,loading:!e.memberships}}),t("TicketWidget",{attrs:{tickets:e.tickets,loading:!e.tickets}}),t("FanshopWidget",{attrs:{orders:e.orders,loading:!e.orders}})],1)])])])},bCe=[],xCe=ve(yCe,_Ce,bCe,!1,null,null);const wCe=xCe.exports,CCe=Object.freeze(Object.defineProperty({__proto__:null,default:wCe},Symbol.toStringTag,{value:"Module"})),kCe={computed:{currentYear(){return new Date().getFullYear()}}};var SCe=function(){var e=this,t=e._self._c;return t("footer",{staticClass:"bg-gray-900",attrs:{"aria-labelledby":"footer-heading"}},[t("h2",{staticClass:"sr-only",attrs:{id:"footer-heading"}},[e._v("Footer")]),t("div",{staticClass:"mx-auto max-w-7xl px-6 pb-8 pt-16 sm:pt-24 lg:px-8 lg:pt-32"},[t("div",{staticClass:"xl:grid xl:grid-cols-3 xl:gap-8"},[t("img",{staticClass:"mt-2 mx-auto max-h-32",attrs:{src:"/img/FCK_Profil_White.svg"}}),t("div",{staticClass:"mt-16 grid grid-cols-2 gap-8 xl:col-span-2 xl:mt-0"},[t("div",{staticClass:"md:grid md:grid-cols-2 md:gap-8"},[t("div",[t("h3",{staticClass:"text-sm font-semibold leading-6 text-white"},[e._v(e._s(e.$trans("pages.frontpage.teams")))]),t("ul",{staticClass:"mt-6 space-y-4",attrs:{role:"list"}},[t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk/holdet"}},[e._v(e._s(e.$trans("pages.frontpage.teamsMen")))])]),t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk/kvindeholdet/nyheder"}},[e._v(e._s(e.$trans("pages.frontpage.teamsWomen")))])]),t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk/talentafdelingen"}},[e._v(e._s(e.$trans("pages.frontpage.teamsU19")))])])])]),t("div",{staticClass:"mt-10 md:mt-0"},[t("h3",{staticClass:"text-sm font-semibold leading-6 text-white"},[e._v(e._s(e.$trans("pages.frontpage.matches")))]),t("ul",{staticClass:"mt-6 space-y-4",attrs:{role:"list"}},[t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk/kommende-kampe"}},[e._v(e._s(e.$trans("pages.frontpage.upcomingMatches")))])]),t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk/kampe?season=11600&tournament=All&team=All&player=All"}},[e._v(e._s(e.$trans("pages.frontpage.results")))])]),t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk/ligatabel"}},[e._v(e._s(e.$trans("pages.frontpage.table")))])])])])]),t("div",{staticClass:"md:grid md:grid-cols-2 md:gap-8"},[t("div",[t("h3",{staticClass:"text-sm font-semibold leading-6 text-white"},[e._v(e._s(e.$trans("pages.frontpage.tickets")))]),t("ul",{staticClass:"mt-6 space-y-4",attrs:{role:"list"}},[t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://billet.fck.dk/"}},[e._v(e._s(e.$trans("pages.frontpage.buytickets")))])]),t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk/billetinfo"}},[e._v(e._s(e.$trans("pages.frontpage.ticketinfo")))])]),t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk/plus"}},[e._v(e._s(e.$trans("pages.frontpage.fckplus")))])]),t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk/abonnement"}},[e._v(e._s(e.$trans("pages.frontpage.subscription")))])]),t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk/abonnement"}},[e._v(e._s(e.$trans("pages.frontpage.seasonticket")))])])])]),t("div",{staticClass:"mt-10 md:mt-0"},[t("h3",{staticClass:"text-sm font-semibold leading-6 text-white"},[e._v(e._s(e.$trans("pages.frontpage.about")))]),t("ul",{staticClass:"mt-6 space-y-4",attrs:{role:"list"}},[t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk"}},[e._v(e._s(e.$trans("pages.frontpage.newstitle")))])]),t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk/partner"}},[e._v(e._s(e.$trans("pages.frontpage.partner")))])]),t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk/presse"}},[e._v(e._s(e.$trans("pages.frontpage.press")))])]),t("li",[t("a",{staticClass:"text-sm leading-6 text-gray-300 hover:text-white",attrs:{href:"https://www.fck.dk/indhold/kontakt"}},[e._v(e._s(e.$trans("pages.frontpage.contact")))])])])])])])]),t("div",{staticClass:"mt-8 border-t border-white/10 pt-8 md:flex md:items-center md:justify-between"},[t("div",{staticClass:"flex space-x-6 md:order-2"},[t("a",{staticClass:"text-gray-500 hover:text-gray-400",attrs:{href:"https://www.facebook.com/FCKobenhavn/"}},[t("span",{staticClass:"sr-only"},[e._v("Facebook")]),t("svg",{staticClass:"h-6 w-6",attrs:{fill:"
3927currentColor",viewBox:"0 0 24 24","aria-hidden":"true"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z","clip-rule":"evenodd"}})])]),t("a",{staticClass:"text-gray-500 hover:text-gray-400",attrs:{href:"https://www.instagram.com/fc_kobenhavn"}},[t("span",{staticClass:"sr-only"},[e._v("Instagram")]),t("svg",{staticClass:"h-6 w-6",attrs:{fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z","clip-rule":"evenodd"}})])]),t("a",{staticClass:"text-gray-500 hover:text-gray-400",attrs:{href:"https://x.com/FCKobenhavn/"}},[t("span",{staticClass:"sr-only"},[e._v("X")]),t("svg",{staticClass:"h-6 w-6",attrs:{fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"}},[t("path",{attrs:{d:"M13.6823 10.6218L20.2391 3H18.6854L12.9921 9.61788L8.44486 3H3.2002L10.0765 13.0074L3.2002 21H4.75404L10.7663 14.0113L15.5685 21H20.8131L13.6819 10.6218H13.6823ZM11.5541 13.0956L10.8574 12.0991L5.31391 4.16971H7.70053L12.1742 10.5689L12.8709 11.5655L18.6861 19.8835H16.2995L11.5541 13.096V13.0956Z"}})])]),t("a",{staticClass:"text-gray-500 hover:text-gray-400",attrs:{href:"https://www.youtube.com/channel/UCgJOiX4YYaOtZAiArRPixxw"}},[t("span",{staticClass:"sr-only"},[e._v("YouTube")]),t("svg",{staticClass:"h-6 w-6",attrs:{fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M19.812 5.418c.861.23 1.538.907 1.768 1.768C21.998 8.746 22 12 22 12s0 3.255-.418 4.814a2.504 2.504 0 0 1-1.768 1.768c-1.56.419-7.814.419-7.814.419s-6.255 0-7.814-.419a2.505 2.505 0 0 1-1.768-1.768C2 15.255 2 12 2 12s0-3.255.417-4.814a2.507 2.507 0 0 1 1.768-1.768C5.744 5 11.998 5 11.998 5s6.255 0 7.814.418ZM15.194 12 10 15V9l5.194 3Z","clip-rule":"evenodd"}})])])]),t("p",{staticClass:"mt-8 text-xs leading-5 text-gray-400 md:order-1 md:mt-0"},[e._v("© "+e._s(e.currentYear)+" FC København")])])])])},TCe=[],ECe=ve(kCe,SCe,TCe,!1,null,null);const z$=ECe.exports,PCe={components:{Footer:z$},props:{canLogin:Boolean,canRegister:Boolean,laravelVersion:String,phpVersion:String,user:Object},name:"Plus",data(){return{openFaq:null,faqs:["whatIs","howToGet","seasonTicket","pricing","content","cancel"]}},methods:{toggleFaq(n){this.openFaq=this.openFaq===n?null:n}}};var RCe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"min-h-screen bg-gray-100"},[t("div",{staticClass:"relative isolate overflow-hidden background-welcome"},[t("div",{staticClass:"mx-auto max-w-3xl py-32 sm:py-48"},[t("div",{staticClass:"mb-8 flex justify-center hidden lg.visible"},[t("div",{staticClass:"relative mx-4 sm:mx-0 text-center text-balance px-3 py-1 text-sm leading-6 ring-1 ring-fck-blue/10 hover:ring-fck-blue/20"},[e._v(" "+e._s(e.$trans("pages.frontpage.news"))+" "),t("a",{staticClass:"font-semibold text-fck-blue",attrs:{href:"https://www.fck.dk/nyhed/fck-away-flytter-til-fck-profil-goer-dig-klar-til-din-naeste-udekamp"}},[t("span",{staticClass:"absolute inset-0",attrs:{"aria-hidden":"true"}}),e._v(e._s(e.$trans("pages.frontpage.newsReadMore"))),t("span",{attrs:{"aria-hidden":"true"}},[e._v("â")])])])]),t("div",{staticClass:"text-center"},[t("div",{staticClass:"flex flex-col items-center justify-center space-x-2 mb-6"},[t("img",{staticClass:"h-14 w-14 mb-6",attrs:{src:"/img/FCK_Logo_symbol_RGB_Blue.png",alt:"FCK Logo"}}),t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v(e._s(e.$trans("pages.plus.hero.title")))])]),t("p",{staticClass:"mx-2 mt-6 leading-8",domProps:{innerHTML:e._s(e.$trans("pages.plus.hero.subtitle"))}}),t("div",{staticClass:"mt-6 flex flex-col items-center justify-center gap-x-6"},[e.user?t("a",{staticClass:"bg-fck-secondary px-3.5 py-2.5 text-sm font-semibold text-white bg-fck-blue shadow-sm hover:bg-gray-900 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-400 text-balance",attrs:{href:"/redirect/tickets?redirect_url=https://billet.fck.dk/Merchandises/Buy?id=1032"}},[e._v(e._s(e.$trans("pages.plus.hero.ctaloggedin")))]):t("a",{staticClass:"bg-fck-secondary px-3.5 py-2.5 text-sm font-semibold text-white bg-fck-blue shadow-sm hover:bg-gray-900 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-400 text-balance",attrs:{href:"/redirect/tickets?redirect_url=https://billet.fck.dk/Merchandises/Buy?id=1032"}},[e._v(e._s(e.$trans("pages.plus.hero.cta")))]),t("a",{staticClass:"text-sm font-semibold leading-6 text-fck-blue mt-2",attrs:{href:"#features"}},[e._v(e._s(e.$trans("pages.plus.hero.learnMore"))),t("span",{attrs:{"aria-hidden":"true"}},[e._v("â")])])])])])]),t("section",{staticClass:"bg-white py-24 sm:py-32"},[t("div",{staticClass:"mx-auto max-w-7xl px-6 lg:px-8"},[t("div",{staticClass:"mx-auto max-w-2xl text-center"},[t("h2",{staticClass:"text-3xl font-black tracking-tight text-fck-blue sm:text-4xl uppercase font-sans"},[e._v(" "+e._s(e.$trans("pages.plus.steps.title"))+" ")]),t("p",{staticClass:"mt-6 text-lg leading-8 text-gray-600"},[e._v(" "+e._s(e.$trans("pages.plus.steps.subtitle"))+" ")])]),t("div",{staticClass:"mx-auto mt-16 max-w-5xl"},[t("div",{staticClass:"grid grid-cols-1 gap-8 md:grid-cols-3"},[t("div",{staticClass:"text-center"},[t("div",{staticClass:"mx-auto flex h-20 w-20 items-center justify-center rounded-full bg-fck-blue mb-6"},[t("span",{staticClass:"text-3xl font-black text-white"},[e._v(e._s(e.$trans("pages.plus.steps.step1.number")))])]),t("h3",{staticClass:"text-xl font-bold text-fck-blue font-sans uppercase mb-4"},[e._v(" "+e._s(e.$trans("pages.plus.steps.step1.title"))+" ")]),t("p",{staticClass:"text-gray-600"},[e._v(" "+e._s(e.$trans("pages.plus.steps.step1.description"))+" ")])]),t("div",{staticClass:"text-center"},[t("div",{staticClass:"mx-auto flex h-20 w-20 items-center justify-center rounded-full bg-fck-blue mb-6"},[t("span",{staticClass:"text-3xl font-black text-white"},[e._v(e._s(e.$trans("pages.plus.steps.step2.number")))])]),t("h3",{staticClass:"text-xl font-bold text-fck-blue font-sans uppercase mb-4"},[e._v(" "+e._s(e.$trans("pages.plus.steps.step2.title"))+" ")]),t("p",{staticClass:"text-gray-600"},[e._v(" "+e._s(e.$trans("pages.plus.steps.step2.description"))+" ")])]),t("div",{staticClass:"text-center"},[t("div",{staticClass:"mx-auto flex h-20 w-20 items-center justify-center rounded-full bg-fck-blue mb-6"},[t("span",{staticClass:"text-3xl font-black text-white"},[e._v(e._s(e.$trans("pages.plus.steps.step3.number")))])]),t("h3",{staticClass:"text-xl font-bold text-fck-blue font-sans uppercase mb-4"},[e._v(" "+e._s(e.$trans("pages.plus.steps.step3.title"))+" ")]),t("p",{staticClass:"text-gray-600"},[e._v(" "+e._s(e.$trans("pages.plus.steps.step3.description"))+" ")])])])])])]),t("section",{staticClass:"py-24 sm:py-32"},[t("a",{attrs:{name:"features"}}),t("div",{staticClass:"mx-auto max-w-7xl px-6 lg:px-8"},[t("div",{staticClass:"mx-auto max-w-2xl text-center mb-16"},[t("h2",{staticClass:"text-3xl font-black tracking-tight text-fck-blue sm:text-4xl uppercase font-sans"}
3927,[e._v(" "+e._s(e.$trans("pages.plus.benefits.title"))+" ")]),t("p",{staticClass:"mt-6 text-lg leading-8 text-gray-600"},[e._v(" "+e._s(e.$trans("pages.plus.benefits.subtitle"))+" ")])]),t("div",{staticClass:"space-y-16"},[t("div",{staticClass:"grid grid-cols-1 gap-8 lg:grid-cols-2 lg:gap-16 items-center"},[t("div",{staticClass:"lg:order-2"},[t("div",{staticClass:"flex items-center mb-6"},[t("div",{staticClass:"h-12 w-12 bg-fck-blue flex items-center justify-center mr-4"},[t("svg",{staticClass:"h-6 w-6 text-white",attrs:{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}})])]),t("h3",{staticClass:"text-2xl font-bold text-fck-blue font-sans uppercase"},[e._v(" "+e._s(e.$trans("pages.plus.video.title"))+" ")])]),t("p",{staticClass:"text-gray-600 mb-6"},[e._v(" "+e._s(e.$trans("pages.plus.video.description"))+" ")]),t("div",{staticClass:"bg-fck-pale-blue p-4"},[t("p",{staticClass:"text-fck-blue font-semibold"},[e._v(" "+e._s(e.$trans("pages.plus.video.platforms"))+" ")])])]),e._m(0)]),t("div",{staticClass:"grid grid-cols-1 gap-8 lg:grid-cols-2 lg:gap-16 items-center"},[t("div",[t("div",{staticClass:"flex items-center mb-6"},[t("div",{staticClass:"h-12 w-12 bg-fck-blue flex items-center justify-center mr-4"},[t("svg",{staticClass:"h-6 w-6 text-white",attrs:{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 6v.75m0 3v.75m0 3v.75m0 3V18m-9-5.25h5.25M7.5 15h3M3.375 5.25c-.621 0-1.125.504-1.125 1.125v3.026a2.999 2.999 0 0 1 0 5.198v3.026c0 .621.504 1.125 1.125 1.125h17.25c.621 0 1.125-.504 1.125-1.125v-3.026a2.999 2.999 0 0 1 0-5.198V6.375c0-.621-.504-1.125-1.125-1.125H3.375Z"}})])]),t("h3",{staticClass:"text-2xl font-bold text-fck-blue font-sans uppercase"},[e._v(" "+e._s(e.$trans("pages.plus.benefits.tickets.title"))+" ")])]),t("p",{staticClass:"text-gray-600 mb-6"},[e._v(" "+e._s(e.$trans("pages.plus.benefits.tickets.description"))+" ")]),t("ul",{staticClass:"space-y-3"},[t("li",{staticClass:"flex items-start"},[t("svg",{staticClass:"mt-1 h-5 w-5 flex-shrink-0 text-fck-blue",attrs:{fill:"currentColor",viewBox:"0 0 20 20"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"}})]),t("span",{staticClass:"ml-3 text-gray-600"},[e._v(e._s(e.$trans("pages.plus.benefits.tickets.feature1")))])]),t("li",{staticClass:"flex items-start"},[t("svg",{staticClass:"mt-1 h-5 w-5 flex-shrink-0 text-fck-blue",attrs:{fill:"currentColor",viewBox:"0 0 20 20"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"}})]),t("span",{staticClass:"ml-3 text-gray-600"},[e._v(e._s(e.$trans("pages.plus.benefits.tickets.feature2")))])]),t("li",{staticClass:"flex items-start"},[t("svg",{staticClass:"mt-1 h-5 w-5 flex-shrink-0 text-fck-blue",attrs:{fill:"currentColor",viewBox:"0 0 20 20"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"}})]),t("span",{staticClass:"ml-3 text-gray-600"},[e._v(e._s(e.$trans("pages.plus.benefits.tickets.feature3")))])])])]),e._m(1)]),t("div",{staticClass:"grid grid-cols-1 gap-8 lg:grid-cols-2 lg:gap-16 items-center"},[t("div",{staticClass:"lg:order-2"},[t("div",{staticClass:"flex items-center mb-6"},[t("div",{staticClass:"h-12 w-12 bg-fck-blue flex items-center justify-center mr-4"},[t("svg",{staticClass:"h-6 w-6 text-white",attrs:{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5
3927h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}})])]),t("h3",{staticClass:"text-2xl font-bold text-fck-blue font-sans uppercase"},[e._v(" "+e._s(e.$trans("pages.plus.benefits.fanshop.title"))+" ")])]),t("p",{staticClass:"text-gray-600 mb-6"},[e._v(" "+e._s(e.$trans("pages.plus.benefits.fanshop.description"))+" ")]),t("div",{staticClass:"bg-fck-pale-blue p-4"},[t("p",{staticClass:"text-fck-blue font-semibold"},[e._v(" "+e._s(e.$trans("pages.plus.benefits.fanshop.locations"))+" ")])])]),e._m(2)]),t("p",{staticClass:"text-center text-gray-500"},[e._v(e._s(e.$trans("pages.plus.hero.alternative")))])])])]),t("section",{staticClass:"bg-fck-pale-blue py-24 sm:py-32"},[t("div",{staticClass:"mx-auto max-w-7xl px-6 lg:px-8"},[t("div",{staticClass:"mx-auto max-w-2xl text-center"},[t("h2",{staticClass:"text-3xl font-black tracking-tight text-fck-blue sm:text-4xl uppercase font-sans"},[e._v(" "+e._s(e.$trans("pages.plus.faq.title"))+" ")])]),t("div",{staticClass:"mx-auto mt-16 max-w-4xl"},[t("div",{staticClass:"space-y-8"},e._l(e.faqs,function(r,i){return t("div",{key:i,staticClass:"bg-white p-6 shadow-sm"},[t("button",{staticClass:"flex w-full items-center justify-between text-left",on:{click:function(a){return e.toggleFaq(i)}}},[t("h3",{staticClass:"text-lg font-semibold text-fck-blue"},[e._v(" "+e._s(e.$trans(`pages.plus.faq.items.${r}.question`))+" ")]),t("svg",{staticClass:"h-5 w-5 text-fck-blue transition-transform",class:{"rotate-180":e.openFaq===i},attrs:{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"}})])]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.openFaq===i,expression:"openFaq === index"}],staticClass:"mt-4 text-gray-600",domProps:{innerHTML:e._s(e.$trans(`pages.plus.faq.items.${r}.answer`))}})])}),0)])])]),t("section",{staticClass:"bg-fck-blue py-24 sm:py-32"},[t("div",{staticClass:"mx-auto max-w-7xl px-6 lg:px-8"},[t("div",{staticClass:"mx-auto max-w-2xl text-center"},[t("h2",{staticClass:"text-3xl font-black tracking-tight text-white sm:text-4xl uppercase font-sans"},[e._v(" "+e._s(e.$trans("pages.plus.cta.title"))+" ")]),t("p",{staticClass:"mt-6 text-lg leading-8 text-fck-white/90"},[e._v(" "+e._s(e.$trans("pages.plus.cta.subtitle"))+" ")]),t("div",{staticClass:"mt-10 flex items-center justify-center gap-x-6"},[t("a",{staticClass:"bg-white px-3.5 py-2.5 text-sm text-fck-blue font-semibold shadow-sm hover:bg-white/90 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white",attrs:{href:"/redirect/tickets?redirect_url=https://billet.fck.dk/Merchandises/Buy?id=1032"}},[e._v(" "+e._s(e.$trans("pages.plus.cta.primary"))+" ")]),t("a",{staticClass:"text-sm font-semibold leading-6 text-white",attrs:{href:"/dashboard"}},[e._v(" "+e._s(e.$trans("pages.plus.cta.secondary"))),t("span",{attrs:{"aria-hidden":"true"}},[e._v("â")])])])])])]),t("Footer")],1)},ACe=[function(){var n=this,e=n._self._c;return e("div",{staticClass:"lg:order-1 relative"},[e("img",{staticClass:"w-full h-auto shadow-lg",attrs:{src:"/img/Foto_Videoindhold26.jpg",alt:"Video"}})])},function(){var n=this,e=n._self._c;return e("div",{staticClass:"relative"},[e("img",{attrs:{src:"/img/Foto_Billetrabat.jpg",alt:"billetrabat"}})])},function(){var n=this,e=n._self._c;return e("div",{staticClass:"lg:order-1 relative"},[e("img",{staticClass:"w-full h-auto shadow-lg",attrs:{src:"/img/Foto_Fanshopbillet.jpg",alt:"Fanshop"}})])}],ICe=ve(PCe,RCe,ACe,!1,null,"c8667dc1");const OCe=ICe.exports,MCe=Object.freeze(Object.defineProperty({__proto__:null,default:OCe},Symbol.toStringTag,{value:"Module"})),DCe={props:["policy"],components:{JetAuthenticationCardLogo:cl}};var NCe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"font-sans text-gray-900 antialiased"},[t("div",{staticClass:"pt-4 bg-gray-100"},[t("div",{staticClass:"min-h-screen flex flex-col items-center pt-6 sm:pt-0"},[t("div",[t("jet-authentication-card-logo")],1),t("div",{staticClass:"w-full sm:max-w-2xl mt-6 p-6 bg-white shadow-md overflow-hidden sm:rou
3927nded-lg prose",domProps:{innerHTML:e._s(e.policy)}})])])])},LCe=[],FCe=ve(DCe,NCe,LCe,!1,null,null);const $Ce=FCe.exports,BCe=Object.freeze(Object.defineProperty({__proto__:null,default:$Ce},Symbol.toStringTag,{value:"Module"}));var yE={},Jb={},wa={};Object.defineProperty(wa,"__esModule",{value:!0});function UCe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}var jCe=function n(e,t){UCe(this,n),this.data=e,this.text=t.text||e,this.options=t};wa.default=jCe;Object.defineProperty(Jb,"__esModule",{value:!0});Jb.CODE39=void 0;var qCe=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),zCe=wa,WCe=HCe(zCe);function HCe(n){return n&&n.__esModule?n:{default:n}}function VCe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function GCe(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function KCe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var YCe=function(n){KCe(e,n);function e(t,r){return VCe(this,e),t=t.toUpperCase(),r.mod43&&(t+=QCe(ZCe(t))),GCe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return qCe(e,[{key:"encode",value:function(){for(var r=oC("*"),i=0;i<this.data.length;i++)r+=oC(this.data[i])+"0";return r+=oC("*"),{data:r,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),e}(WCe.default),W$=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],XCe=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function oC(n){return JCe(H$(n))}function JCe(n){return XCe[n].toString(2)}function QCe(n){return W$[n]}function H$(n){return W$.indexOf(n)}function ZCe(n){for(var e=0,t=0;t<n.length;t++)e+=H$(n[t]);return e=e%43,e}Jb.CODE39=YCe;var jc={},_E={},Up={},Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});var Rm;function cC(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var V$=Xn.SET_A=0,G$=Xn.SET_B=1,K$=Xn.SET_C=2;Xn.SHIFT=98;var eke=Xn.START_A=103,tke=Xn.START_B=104,nke=Xn.START_C=105;Xn.MODULO=103;Xn.STOP=106;Xn.FNC1=207;Xn.SET_BY_CODE=(Rm={},cC(Rm,eke,V$),cC(Rm,tke,G$),cC(Rm,nke,K$),Rm);Xn.SWAP={101:V$,100:G$,99:K$};Xn.A_START_CHAR="Ã";Xn.B_START_CHAR="Ã";Xn.C_START_CHAR="Ã";Xn.A_CHARS="[\0-_Ã-Ã]";Xn.B_CHARS="[ -�Ã-Ã]";Xn.C_CHARS="(Ã*[0-9]{2}Ã*)";Xn.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011];Object.defineProperty(Up,"__esModule",{value:!0});var rke=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];
3927i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),ike=wa,ake=ske(ike),us=Xn;function ske(n){return n&&n.__esModule?n:{default:n}}function oke(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function cke(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function uke(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var lke=function(n){uke(e,n);function e(t,r){oke(this,e);var i=cke(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.substring(1),r));return i.bytes=t.split("").map(function(a){return a.charCodeAt(0)}),i}return rke(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var r=this.bytes,i=r.shift()-105,a=us.SET_BY_CODE[i];if(a===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&r.unshift(us.FNC1);var s=e.next(r,1,a);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(i)+s.result+e.getBar((s.checksum+i)%us.MODULO)+e.getBar(us.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var r=this.options.ean128||!1;return typeof r=="string"&&(r=r.toLowerCase()==="true"),r}}],[{key:"getBar",value:function(r){return us.BARS[r]?us.BARS[r].toString():""}},{key:"correctIndex",value:function(r,i){if(i===us.SET_A){var a=r.shift();return a<32?a+64:a-32}else return i===us.SET_B?r.shift()-32:(r.shift()-48)*10+r.shift()-48}},{key:"next",value:function(r,i,a){if(!r.length)return{result:"",checksum:0};var s=void 0,o=void 0;if(r[0]>=200){o=r.shift()-105;var c=us.SWAP[o];c!==void 0?s=e.next(r,i+1,c):((a===us.SET_A||a===us.SET_B)&&o===us.SHIFT&&(r[0]=a===us.SET_A?r[0]>95?r[0]-96:r[0]:r[0]<32?r[0]+96:r[0]),s=e.next(r,i+1,a))}else o=e.correctIndex(r,a),s=e.next(r,i+1,a);var u=e.getBar(o),l=o*i;return{result:u+s.result,checksum:l+s.checksum}}}]),e}(ake.default);Up.default=lke;var bE={};Object.defineProperty(bE,"__esModule",{value:!0});var Wl=Xn,Y$=function(e){return e.match(new RegExp("^"+Wl.A_CHARS+"*"))[0].length},X$=function(e){return e.match(new RegExp("^"+Wl.B_CHARS+"*"))[0].length},J$=function(e){return e.match(new RegExp("^"+Wl.C_CHARS+"*"))[0]};function xE(n,e){var t=e?Wl.A_CHARS:Wl.B_CHARS,r=n.match(new RegExp("^("+t+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(r)return r[1]+"Ã"+Q$(n.substring(r[1].length));var i=n.match(new RegExp("^"+t+"+"))[0];return i.length===n.length?n:i+String.fromCharCode(e?205:206)+xE(n.substring(i.length),!e)}function Q$(n){var e=J$(n),t=e.length;if(t===n.length)return n;n=n.substring(t);var r=Y$(n)>=X$(n);return e+String.fromCharCode(r?206:205)+xE(n,r)}bE.default=function(n){var e=void 0,t=J$(n).length;if(t>=2)e=Wl.C_START_CHAR+Q$(n);else{var r=Y$(n)>X$(n);e=(r?Wl.A_START_CHAR:Wl.B_START_CHAR)+xE(n,r)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(i,a){return"Ã"+a})};Object.defineProperty(_E,"__esModule",{value:!0});var dke=Up,fke=Z$(dke),hke=bE,pke=Z$(hke);function Z$(n){return n&&n.__esModule?n:{default:n}}function mke(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function uC(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function gke(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var vke=function(n){gke(e,n);function e(t,r){if(mke(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(t))var i=uC(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,pke.default)(t),r));else var i=uC(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return uC(i)}return e}(fke.default);_E.default=vke;var wE={};Object.defineProperty(wE,"__esModule",{value:!0});var yke=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];
3927i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),_ke=Up,bke=xke(_ke),OO=Xn;function xke(n){return n&&n.__esModule?n:{default:n}}function wke(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Cke(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function kke(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var Ske=function(n){kke(e,n);function e(t,r){return wke(this,e),Cke(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,OO.A_START_CHAR+t,r))}return yke(e,[{key:"valid",value:function(){return new RegExp("^"+OO.A_CHARS+"+$").test(this.data)}}]),e}(bke.default);wE.default=Ske;var CE={};Object.defineProperty(CE,"__esModule",{value:!0});var Tke=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),Eke=Up,Pke=Rke(Eke),MO=Xn;function Rke(n){return n&&n.__esModule?n:{default:n}}function Ake(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Ike(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function Oke(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var Mke=function(n){Oke(e,n);function e(t,r){return Ake(this,e),Ike(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,MO.B_START_CHAR+t,r))}return Tke(e,[{key:"valid",value:function(){return new RegExp("^"+MO.B_CHARS+"+$").test(this.data)}}]),e}(Pke.default);CE.default=Mke;var kE={};Object.defineProperty(kE,"__esModule",{value:!0});var Dke=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),Nke=Up,Lke=Fke(Nke),DO=Xn;function Fke(n){return n&&n.__esModule?n:{default:n}}function $ke(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Bke(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function Uke(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var jke=function(n){Uke(e,n);function e(t,r){return $ke(this,e),Bke(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,DO.C_START_CHAR+t,r))}return Dke(e,[{key:"valid",value:function(){return new RegExp("^"+DO.C_CHARS+"+$").test(this.data)}}]),e}(Lke.default);kE.default=jke;Object.defineProperty(jc,"__esModule",{value:!0});jc.CODE128C=jc.CODE128B=jc.CODE128A=jc.CODE128=void 0;var qke=_E,zke=Qb(qke),Wke=wE,Hke=Qb(Wke),Vke=CE,Gke=Qb(Vke),Kke=kE,Yke=Qb(Kke);function Qb(n){return n&&n.__esModule?n:{default:n}}jc.CODE128=zke.default;jc.CODE128A=Hke.default;jc.CODE128B=Gke.default;jc.CODE128C=Yke.default;var Na={},SE={},Co={};Object.defineProperty(Co,"__esModule",{value:!0});Co.SIDE_BIN="101";Co.MIDDLE_BIN="01010";Co.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]};
3927Co.EAN2_STRUCTURE=["LL","LG","GL","GG"];Co.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"];Co.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"];var Zb={},Ff={};Object.defineProperty(Ff,"__esModule",{value:!0});var Xke=Co,Jke=function(e,t,r){var i=e.split("").map(function(s,o){return Xke.BINARIES[t[o]]}).map(function(s,o){return s?s[e[o]]:""});if(r){var a=e.length-1;i=i.map(function(s,o){return o<a?s+r:s})}return i.join("")};Ff.default=Jke;Object.defineProperty(Zb,"__esModule",{value:!0});var Qke=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),dh=Co,Zke=Ff,NO=eB(Zke),e2e=wa,t2e=eB(e2e);function eB(n){return n&&n.__esModule?n:{default:n}}function n2e(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function r2e(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function i2e(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var a2e=function(n){i2e(e,n);function e(t,r){n2e(this,e);var i=r2e(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return i.fontSize=!r.flat&&r.fontSize>r.width*10?r.width*10:r.fontSize,i.guardHeight=r.height+i.fontSize/2+r.textMargin,i}return Qke(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(r,i){return this.text.substr(r,i)}},{key:"leftEncode",value:function(r,i){return(0,NO.default)(r,i)}},{key:"rightText",value:function(r,i){return this.text.substr(r,i)}},{key:"rightEncode",value:function(r,i){return(0,NO.default)(r,i)}},{key:"encodeGuarded",value:function(){var r={fontSize:this.fontSize},i={height:this.guardHeight};return[{data:dh.SIDE_BIN,options:i},{data:this.leftEncode(),text:this.leftText(),options:r},{data:dh.MIDDLE_BIN,options:i},{data:this.rightEncode(),text:this.rightText(),options:r},{data:dh.SIDE_BIN,options:i}]}},{key:"encodeFlat",value:function(){var r=[dh.SIDE_BIN,this.leftEncode(),dh.MIDDLE_BIN,this.rightEncode(),dh.SIDE_BIN];return{data:r.join(""),text:this.text}}}]),e}(t2e.default);Zb.default=a2e;Object.defineProperty(SE,"__esModule",{value:!0});var s2e=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),Am=function n(e,t,r){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:n(a,t,r)}else{if("value"in i)return i.value;var s=i.get;return s===void 0?void 0:s.call(r)}},o2e=Co,c2e=Zb,u2e=l2e(c2e);function l2e(n){return n&&n.__esModule?n:{default:n}}function d2e(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function f2e(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function h2e(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var LO=function(e){var t=e.substr(0,12).split("").map(function(r){return+r}).reduce(function(r,i,a){return a%2?r+i*3:r+i},0);return(10-t%10)%10},p2e=function(n){h2e(e,n);function e(t,r){d2e(this,e),t.search(/^[0-9]{12}$/)!==-1&&(t+=LO(t));var i=f2e(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return i.lastChar=r.lastChar,i}return s2e(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===LO(this.data)}},{key:"leftText",value:function(){return Am(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var r=this.data.substr(1,6),i=o2e.EAN13_STRUCTURE[this.data[0]];return Am(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,r,i)}},{key:"rightText",value:function(){return Am(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var r=this.data.substr(7,6);return Am(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,r,"RRRRRR")}},{key:"encodeGuarded",value:function(){var r=Am(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(r.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(r.push({data:"00"}),r.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),r}}]),e}(u2e.default);SE.default=p2e;var TE={};Object.defineProperty(TE,"__esModule",{value:!0});var m2e=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];
3927i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),W0=function n(e,t,r){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:n(a,t,r)}else{if("value"in i)return i.value;var s=i.get;return s===void 0?void 0:s.call(r)}},g2e=Zb,v2e=y2e(g2e);function y2e(n){return n&&n.__esModule?n:{default:n}}function _2e(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function b2e(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function x2e(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var FO=function(e){var t=e.substr(0,7).split("").map(function(r){return+r}).reduce(function(r,i,a){return a%2?r+i:r+i*3},0);return(10-t%10)%10},w2e=function(n){x2e(e,n);function e(t,r){return _2e(this,e),t.search(/^[0-9]{7}$/)!==-1&&(t+=FO(t)),b2e(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return m2e(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===FO(this.data)}},{key:"leftText",value:function(){return W0(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var r=this.data.substr(0,4);return W0(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,r,"LLLL")}},{key:"rightText",value:function(){return W0(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var r=this.data.substr(4,4);return W0(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,r,"RRRR")}}]),e}(v2e.default);TE.default=w2e;var EE={};Object.defineProperty(EE,"__esModule",{value:!0});var C2e=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),k2e=Co,S2e=Ff,T2e=tB(S2e),E2e=wa,P2e=tB(E2e);function tB(n){return n&&n.__esModule?n:{default:n}}function R2e(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function A2e(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function I2e(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var O2e=function(e){var t=e.split("").map(function(r){return+r}).reduce(function(r,i,a){return a%2?r+i*9:r+i*3},0);return t%10},M2e=function(n){I2e(e,n);function e(t,r){return R2e(this,e),A2e(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return C2e(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var r=k2e.EAN5_STRUCTURE[O2e(this.data)];return{data:"1011"+(0,T2e.default)(this.data,r,"01"),text:this.text}}}]),e}(P2e.default);EE.default=M2e;var PE={};Object.defineProperty(PE,"__esModule",{value:!0});var D2e=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),N2e=Co,L2e=Ff,F2e=nB(L2e),$2e=wa,B2e=nB($2e);function nB(n){return n&&n.__esModule?n:{default:n}}function U2e(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function j2e(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function q2e(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var z2e=function(n){q2e(e,n);function e(t,r){return U2e(this,e),j2e(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return D2e(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var r=N2e.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,F2e.default)(this.data,r,"01"),text:this.text}}}]),e}(B2e.default);PE.default=z2e;var yv={};
3927Object.defineProperty(yv,"__esModule",{value:!0});var W2e=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}();yv.checksum=t2;var H2e=Ff,fh=rB(H2e),V2e=wa,G2e=rB(V2e);function rB(n){return n&&n.__esModule?n:{default:n}}function K2e(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Y2e(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function X2e(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var J2e=function(n){X2e(e,n);function e(t,r){K2e(this,e),t.search(/^[0-9]{11}$/)!==-1&&(t+=t2(t));var i=Y2e(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return i.displayValue=r.displayValue,r.fontSize>r.width*10?i.fontSize=r.width*10:i.fontSize=r.fontSize,i.guardHeight=r.height+i.fontSize/2+r.textMargin,i}return W2e(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==t2(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var r="";return r+="101",r+=(0,fh.default)(this.data.substr(0,6),"LLLLLL"),r+="01010",r+=(0,fh.default)(this.data.substr(6,6),"RRRRRR"),r+="101",{data:r,text:this.text}}},{key:"guardedEncoding",value:function(){var r=[];return this.displayValue&&r.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),r.push({data:"101"+(0,fh.default)(this.data[0],"L"),options:{height:this.guardHeight}}),r.push({data:(0,fh.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),r.push({data:"01010",options:{height:this.guardHeight}}),r.push({data:(0,fh.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),r.push({data:(0,fh.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&r.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),r}}]),e}(G2e.default);function t2(n){var e=0,t;for(t=1;t<11;t+=2)e+=parseInt(n[t]);for(t=0;t<11;t+=2)e+=parseInt(n[t])*3;return(10-e%10)%10}yv.default=J2e;var RE={};Object.defineProperty(RE,"__esModule",{value:!0});var Q2e=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),Z2e=Ff,eSe=iB(Z2e),tSe=wa,nSe=iB(tSe),rSe=yv;function iB(n){return n&&n.__esModule?n:{default:n}}function iSe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function lC(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function aSe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var sSe=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],oSe=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],cSe=function(n){aSe(e,n);function e(t,r){iSe(this,e);var i=lC(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));if(i.isValid=!1,t.search(/^[0-9]{6}$/)!==-1)i.middleDigits=t,i.upcA=$O(t,"0"),i.text=r.text||""+i.upcA[0]+t+i.upcA[i.upcA.length-1],i.isValid=!0;else if(t.search(/^[01][0-9]{7}$/)!==-1)if(i.middleDigits=t.substring(1,t.length-1),i.upcA=$O(i.middleDigits,t[0]),i.upcA[i.upcA.length-1]===t[t.length-1])i.isValid=!0;else return lC(i);else return lC(i);return i.displayValue=r.displayValue,r.fontSize>
3927r.width*10?i.fontSize=r.width*10:i.fontSize=r.fontSize,i.guardHeight=r.height+i.fontSize/2+r.textMargin,i}return Q2e(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var r="";return r+="101",r+=this.encodeMiddleDigits(),r+="010101",{data:r,text:this.text}}},{key:"guardedEncoding",value:function(){var r=[];return this.displayValue&&r.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),r.push({data:"101",options:{height:this.guardHeight}}),r.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),r.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&r.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),r}},{key:"encodeMiddleDigits",value:function(){var r=this.upcA[0],i=this.upcA[this.upcA.length-1],a=oSe[parseInt(i)][parseInt(r)];return(0,eSe.default)(this.middleDigits,a)}}]),e}(nSe.default);function $O(n,e){for(var t=parseInt(n[n.length-1]),r=sSe[t],i="",a=0,s=0;s<r.length;s++){var o=r[s];o==="X"?i+=n[a++]:i+=o}return i=""+e+i,""+i+(0,rSe.checksum)(i)}RE.default=cSe;Object.defineProperty(Na,"__esModule",{value:!0});Na.UPCE=Na.UPC=Na.EAN2=Na.EAN5=Na.EAN8=Na.EAN13=void 0;var uSe=SE,lSe=jp(uSe),dSe=TE,fSe=jp(dSe),hSe=EE,pSe=jp(hSe),mSe=PE,gSe=jp(mSe),vSe=yv,ySe=jp(vSe),_Se=RE,bSe=jp(_Se);function jp(n){return n&&n.__esModule?n:{default:n}}Na.EAN13=lSe.default;Na.EAN8=fSe.default;Na.EAN5=pSe.default;Na.EAN2=gSe.default;Na.UPC=ySe.default;Na.UPCE=bSe.default;var vp={},e1={},_v={};
3927Object.defineProperty(_v,"__esModule",{value:!0});_v.START_BIN="1010";_v.END_BIN="11101";_v.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"];Object.defineProperty(e1,"__esModule",{value:!0});var xSe=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),H0=_v,wSe=wa,CSe=kSe(wSe);function kSe(n){return n&&n.__esModule?n:{default:n}}function SSe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function TSe(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function ESe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var PSe=function(n){ESe(e,n);function e(){return SSe(this,e),TSe(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return xSe(e,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var r=this,i=this.data.match(/.{2}/g).map(function(a){return r.encodePair(a)}).join("");return{data:H0.START_BIN+i+H0.END_BIN,text:this.text}}},{key:"encodePair",value:function(r){var i=H0.BINARIES[r[1]];return H0.BINARIES[r[0]].split("").map(function(a,s){return(a==="1"?"111":"1")+(i[s]==="1"?"000":"0")}).join("")}}]),e}(CSe.default);e1.default=PSe;var AE={};Object.defineProperty(AE,"__esModule",{value:!0});var RSe=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),ASe=e1,ISe=OSe(ASe);function OSe(n){return n&&n.__esModule?n:{default:n}}function MSe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function DSe(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function NSe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var BO=function(e){var t=e.substr(0,13).split("").map(function(r){return parseInt(r,10)}).reduce(function(r,i,a){return r+i*(3-a%2*2)},0);return Math.ceil(t/10)*10-t},LSe=function(n){NSe(e,n);function e(t,r){return MSe(this,e),t.search(/^[0-9]{13}$/)!==-1&&(t+=BO(t)),DSe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return RSe(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===BO(this.data)}}]),e}(ISe.default);AE.default=LSe;Object.defineProperty(vp,"__esModule",{value:!0});vp.ITF14=vp.ITF=void 0;var FSe=e1,$Se=aB(FSe),BSe=AE,USe=aB(BSe);function aB(n){return n&&n.__esModule?n:{default:n}}vp.ITF=$Se.default;vp.ITF14=USe.default;var uo={},$f={};Object.defineProperty($f,"__esModule",{value:!0});var jSe=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),qSe=wa,zSe=WSe(qSe);function WSe(n){return n&&n.__esModule?n:{default:n}}function HSe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function VSe(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function GSe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var KSe=function(n){GSe(e,n);function e(t,r){return HSe(this,e),VSe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return jSe(e,[{key:"encode",value:function(){for(var r="110",i=0;i<this.data.length;i++){var a=parseInt(this.data[i]),s=a.toString(2);s=YSe(s,4-s.length);for(var o=0;o<s.length;o++)r+=s[o]=="0"?"100":"110"}return r+="1001",{data:r,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),e}(zSe.default);function YSe(n,e){for(var t=0;t<e;t++)n="0"+n;return n}$f.default=KSe;var IE={},Bf={};
3927Object.defineProperty(Bf,"__esModule",{value:!0});Bf.mod10=XSe;Bf.mod11=JSe;function XSe(n){for(var e=0,t=0;t<n.length;t++){var r=parseInt(n[t]);(t+n.length)%2===0?e+=r:e+=r*2%10+Math.floor(r*2/10)}return(10-e%10)%10}function JSe(n){for(var e=0,t=[2,3,4,5,6,7],r=0;r<n.length;r++){var i=parseInt(n[n.length-1-r]);e+=t[r%t.length]*i}return(11-e%11)%11}Object.defineProperty(IE,"__esModule",{value:!0});var QSe=$f,ZSe=tTe(QSe),eTe=Bf;function tTe(n){return n&&n.__esModule?n:{default:n}}function nTe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function rTe(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function iTe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var aTe=function(n){iTe(e,n);function e(t,r){return nTe(this,e),rTe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,eTe.mod10)(t),r))}return e}(ZSe.default);IE.default=aTe;var OE={};Object.defineProperty(OE,"__esModule",{value:!0});var sTe=$f,oTe=uTe(sTe),cTe=Bf;function uTe(n){return n&&n.__esModule?n:{default:n}}function lTe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function dTe(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function fTe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var hTe=function(n){fTe(e,n);function e(t,r){return lTe(this,e),dTe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,cTe.mod11)(t),r))}return e}(oTe.default);OE.default=hTe;var ME={};Object.defineProperty(ME,"__esModule",{value:!0});var pTe=$f,mTe=gTe(pTe),UO=Bf;function gTe(n){return n&&n.__esModule?n:{default:n}}function vTe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function yTe(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function _Te(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var bTe=function(n){_Te(e,n);function e(t,r){return vTe(this,e),t+=(0,UO.mod10)(t),t+=(0,UO.mod10)(t),yTe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return e}(mTe.default);ME.default=bTe;var DE={};Object.defineProperty(DE,"__esModule",{value:!0});var xTe=$f,wTe=CTe(xTe),jO=Bf;function CTe(n){return n&&n.__esModule?n:{default:n}}function kTe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function STe(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function TTe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var ETe=function(n){TTe(e,n);function e(t,r){return kTe(this,e),t+=(0,jO.mod11)(t),t+=(0,jO.mod10)(t),STe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return e}(wTe.default);DE.default=ETe;Object.defineProperty(uo,"__esModule",{value:!0});uo.MSI1110=uo.MSI1010=uo.MSI11=uo.MSI10=uo.MSI=void 0;var PTe=$f,RTe=bv(PTe),ATe=IE,ITe=bv(ATe),OTe=OE,MTe=bv(OTe),DTe=ME,NTe=bv(DTe),LTe=DE,FTe=bv(LTe);function bv(n){return n&&n.__esModule?n:{default:n}}uo.MSI=RTe.default;uo.MSI10=ITe.default;uo.MSI11=MTe.default;uo.MSI1010=NTe.default;uo.MSI1110=FTe.default;var t1={};Object.defineProperty(t1,"__esModule",{value:!0});t1.pharmacode=void 0;var $Te=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];
3927i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),BTe=wa,UTe=jTe(BTe);function jTe(n){return n&&n.__esModule?n:{default:n}}function qTe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function zTe(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function WTe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var HTe=function(n){WTe(e,n);function e(t,r){qTe(this,e);var i=zTe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return i.number=parseInt(t,10),i}return $Te(e,[{key:"encode",value:function(){for(var r=this.number,i="";!isNaN(r)&&r!=0;)r%2===0?(i="11100"+i,r=(r-2)/2):(i="100"+i,r=(r-1)/2);return i=i.slice(0,-2),{data:i,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(UTe.default);t1.pharmacode=HTe;var n1={};Object.defineProperty(n1,"__esModule",{value:!0});n1.codabar=void 0;var VTe=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),GTe=wa,KTe=YTe(GTe);function YTe(n){return n&&n.__esModule?n:{default:n}}function XTe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function JTe(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function QTe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var ZTe=function(n){QTe(e,n);function e(t,r){XTe(this,e),t.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(t="A"+t+"A");var i=JTe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),r));return i.text=i.options.text||i.text.replace(/[A-D]/g,""),i}return VTe(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var r=[],i=this.getEncodings(),a=0;a<this.data.length;a++)r.push(i[this.data.charAt(a)]),a!==this.data.length-1&&r.push("0");return{text:this.text,data:r.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e}(KTe.default);n1.codabar=ZTe;var yp={},r1={},xv={};Object.defineProperty(xv,"__esModule",{value:!0});xv.SYMBOLS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","ÿ"];xv.BINARIES=["100010100","101001000","101000100","101000010","100101000","100100100","100100010","101010000","100010010","100001010","110101000","110100100","110100010","110010100","110010010","110001010","101101000","101100100","101100010","100110100","100011010","101011000","101001100","101000110","100101100","100010110","110110100","110110010","110101100","110100110","110010110","110011010","101101100","101100110","100110110","100111010","100101110","111010100","111010010","111001010","101101110","101110110","110101110","100100110","111011010","111010110","100110010","101011110"];xv.MULTI_SYMBOLS={"\0":["(%)","U"],"�":["($)","A"],"�":["($)","B"],"�":["($)","C"],"�":["($)","D"],"�":["($)","E"],"�":["($)","F"],"\x07":["($)","G"],"\b":["($)","H"]," ":["($)","I"],"\n":["($)","J"],"\v":["($)","K"],"\f":["($)","L"],"\r":["($)","M"],"�":["($)","N"],"�":["($)","O"],"�":["($)","P"],"�":["($)","Q"],"�":["($)","R"],"�":["($)","S"],"�":["($)","T"],"�":["($)","U"],"�":["($)","V"],"�":["($)","W"],"�":["($)","X"],"�":["($)","Y"],"�":["($)","Z"],"\x1B":["(%)","A"],"�":["(%)","B"],"�":["(%)","C"],"�":["(%)","D"],"�":["(%)","E"],"!":["(/)","A"],'"':["(/)","B"],"#":["(/)","C"],"&":["(/)","F"],"'"
3927:["(/)","G"],"(":["(/)","H"],")":["(/)","I"],"*":["(/)","J"],",":["(/)","L"],":":["(/)","Z"],";":["(%)","F"],"<":["(%)","G"],"=":["(%)","H"],">":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"�":["(%)","T"]};Object.defineProperty(r1,"__esModule",{value:!0});var eEe=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),V0=xv,tEe=wa,nEe=rEe(tEe);function rEe(n){return n&&n.__esModule?n:{default:n}}function iEe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function aEe(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function sEe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var oEe=function(n){sEe(e,n);function e(t,r){return iEe(this,e),aEe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return eEe(e,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var r=this.data.split("").flatMap(function(o){return V0.MULTI_SYMBOLS[o]||o}),i=r.map(function(o){return e.getEncoding(o)}).join(""),a=e.checksum(r,20),s=e.checksum(r.concat(a),15);return{text:this.text,data:e.getEncoding("ÿ")+i+e.getEncoding(a)+e.getEncoding(s)+e.getEncoding("ÿ")+"1"}}}],[{key:"getEncoding",value:function(r){return V0.BINARIES[e.symbolValue(r)]}},{key:"getSymbol",value:function(r){return V0.SYMBOLS[r]}},{key:"symbolValue",value:function(r){return V0.SYMBOLS.indexOf(r)}},{key:"checksum",value:function(r,i){var a=r.slice().reverse().reduce(function(s,o,c){var u=c%i+1;return s+e.symbolValue(o)*u},0);return e.getSymbol(a%47)}}]),e}(nEe.default);r1.default=oEe;var NE={};Object.defineProperty(NE,"__esModule",{value:!0});var cEe=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),uEe=r1,lEe=dEe(uEe);function dEe(n){return n&&n.__esModule?n:{default:n}}function fEe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function hEe(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function pEe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var mEe=function(n){pEe(e,n);function e(t,r){return fEe(this,e),hEe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return cEe(e,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),e}(lEe.default);NE.default=mEe;Object.defineProperty(yp,"__esModule",{value:!0});yp.CODE93FullASCII=yp.CODE93=void 0;var gEe=r1,vEe=sB(gEe),yEe=NE,_Ee=sB(yEe);function sB(n){return n&&n.__esModule?n:{default:n}}yp.CODE93=vEe.default;yp.CODE93FullASCII=_Ee.default;var i1={};Object.defineProperty(i1,"__esModule",{value:!0});i1.GenericBarcode=void 0;var bEe=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];
3927i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),xEe=wa,wEe=CEe(xEe);function CEe(n){return n&&n.__esModule?n:{default:n}}function kEe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function SEe(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function TEe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var EEe=function(n){TEe(e,n);function e(t,r){return kEe(this,e),SEe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r))}return bEe(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(wEe.default);i1.GenericBarcode=EEe;Object.defineProperty(yE,"__esModule",{value:!0});var PEe=Jb,G0=jc,hh=Na,qO=vp,Im=uo,REe=t1,AEe=n1,zO=yp,IEe=i1;yE.default={CODE39:PEe.CODE39,CODE128:G0.CODE128,CODE128A:G0.CODE128A,CODE128B:G0.CODE128B,CODE128C:G0.CODE128C,EAN13:hh.EAN13,EAN8:hh.EAN8,EAN5:hh.EAN5,EAN2:hh.EAN2,UPC:hh.UPC,UPCE:hh.UPCE,ITF14:qO.ITF14,ITF:qO.ITF,MSI:Im.MSI,MSI10:Im.MSI10,MSI11:Im.MSI11,MSI1010:Im.MSI1010,MSI1110:Im.MSI1110,pharmacode:REe.pharmacode,codabar:AEe.codabar,CODE93:zO.CODE93,CODE93FullASCII:zO.CODE93FullASCII,GenericBarcode:IEe.GenericBarcode};var qp={};Object.defineProperty(qp,"__esModule",{value:!0});var OEe=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n};qp.default=function(n,e){return OEe({},n,e)};var LE={};Object.defineProperty(LE,"__esModule",{value:!0});LE.default=MEe;function MEe(n){var e=[];function t(r){if(Array.isArray(r))for(var i=0;i<r.length;i++)t(r[i]);else r.text=r.text||"",r.data=r.data||"",e.push(r)}return t(n),e}var FE={};Object.defineProperty(FE,"__esModule",{value:!0});FE.default=DEe;function DEe(n){return n.marginTop=n.marginTop||n.margin,n.marginBottom=n.marginBottom||n.margin,n.marginRight=n.marginRight||n.margin,n.marginLeft=n.marginLeft||n.margin,n}var $E={},BE={},a1={};Object.defineProperty(a1,"__esModule",{value:!0});a1.default=NEe;function NEe(n){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var t in e)e.hasOwnProperty(t)&&(t=e[t],typeof n[t]=="string"&&(n[t]=parseInt(n[t],10)));return typeof n.displayValue=="string"&&(n.displayValue=n.displayValue!="false"),n}var s1={};Object.defineProperty(s1,"__esModule",{value:!0});var LEe={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};s1.default=LEe;Object.defineProperty(BE,"__esModule",{value:!0});var FEe=a1,$Ee=oB(FEe),BEe=s1,WO=oB(BEe);function oB(n){return n&&n.__esModule?n:{default:n}}function UEe(n){var e={};for(var t in WO.default)WO.default.hasOwnProperty(t)&&(n.hasAttribute("jsbarcode-"+t.toLowerCase())&&(e[t]=n.getAttribute("jsbarcode-"+t.toLowerCase())),n.hasAttribute("data-"+t.toLowerCase())&&(e[t]=n.getAttribute("data-"+t.toLowerCase())));return e.value=n.getAttribute("jsbarcode-value")||n.getAttribute("data-value"),e=(0,$Ee.default)(e),e}BE.default=UEe;var UE={},jE={},ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.getTotalWidthOfEncodings=ms.calculateEncodingAttributes=ms.getBarcodePadding=ms.getEncodingHeight=ms.getMaximumHeightOfEncodings=void 0;var jEe=qp,qEe=zEe(jEe);function zEe(n){return n&&n.__esModule?n:{default:n}}function cB(n,e){return e.height+(e.displayValue&&n.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function uB(n,e,t){if(t.displayValue&&e<n){if(t.textAlign=="center")return Math.floor((n-e)/2);if(t.textAlign=="left")return 0;if(t.textAlign=="right")return Math.floor(n-e)}return 0}function WEe(n,e,t){for(var r=0;r<n.length;r++){var i=n[r],a=(0,qEe.default)(e,i.options),s;a.displayValue?s=GEe(i.text,a,t):s=0;var o=i.data.length*a.width;i.width=Math.ceil(Math.max(s,o)),i.height=cB(i,a),i.barcodePadding=uB(s,o,a)}}function HEe(n){for(var e=0,t=0;t<n.length;t++)e+=n[t].width;return e}function VEe(n){for(var e=0,t=0;t<n.length;t++)n[t].height>e&&(e=n[t].height);return e}function GEe(n,e,t){var r;if(t)r=t;else if(typeof document<"u")r=document.createElement("canvas").getContext("2d");else return 0;r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var i=r.measureText(n);if(!i)return 0;var a=i.width;return a}ms.getMaximumHeightOfEncodings=VEe;ms.getEncodingHeight=cB;ms.getBarcodePadding=uB;ms.calculateEncodingAttributes=WEe;ms.getTotalWidthOfEncodings=HEe;Object.defineProperty(jE,"__esModule",{value:!0});var KEe=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];
3927i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),YEe=qp,XEe=JEe(YEe),dC=ms;function JEe(n){return n&&n.__esModule?n:{default:n}}function QEe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}var ZEe=function(){function n(e,t,r){QEe(this,n),this.canvas=e,this.encodings=t,this.options=r}return KEe(n,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t<this.encodings.length;t++){var r=(0,XEe.default)(this.options,this.encodings[t].options);this.drawCanvasBarcode(r,this.encodings[t]),this.drawCanvasText(r,this.encodings[t]),this.moveCanvasDrawing(this.encodings[t])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var t=this.canvas.getContext("2d");t.save(),(0,dC.calculateEncodingAttributes)(this.encodings,this.options,t);var r=(0,dC.getTotalWidthOfEncodings)(this.encodings),i=(0,dC.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=r+this.options.marginLeft+this.options.marginRight,this.canvas.height=i,t.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(t.fillStyle=this.options.background,t.fillRect(0,0,this.canvas.width,this.canvas.height)),t.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(t,r){var i=this.canvas.getContext("2d"),a=r.data,s;t.textPosition=="top"?s=t.marginTop+t.fontSize+t.textMargin:s=t.marginTop,i.fillStyle=t.lineColor;for(var o=0;o<a.length;o++){var c=o*t.width+r.barcodePadding;a[o]==="1"?i.fillRect(c,s,t.width,t.height):a[o]&&i.fillRect(c,s,t.width,t.height*a[o])}}},{key:"drawCanvasText",value:function(t,r){var i=this.canvas.getContext("2d"),a=t.fontOptions+" "+t.fontSize+"px "+t.font;if(t.displayValue){var s,o;t.textPosition=="top"?o=t.marginTop+t.fontSize-t.textMargin:o=t.height+t.textMargin+t.marginTop+t.fontSize,i.font=a,t.textAlign=="left"||r.barcodePadding>0?(s=0,i.textAlign="left"):t.textAlign=="right"?(s=r.width-1,i.textAlign="right"):(s=r.width/2,i.textAlign="center"),i.fillText(r.text,s,o)}}},{key:"moveCanvasDrawing",value:function(t){var r=this.canvas.getContext("2d");r.translate(t.width,0)}},{key:"restoreCanvas",value:function(){var t=this.canvas.getContext("2d");t.restore()}}]),n}();jE.default=ZEe;var qE={};Object.defineProperty(qE,"__esModule",{value:!0});var ePe=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),tPe=qp,nPe=rPe(tPe),fC=ms;function rPe(n){return n&&n.__esModule?n:{default:n}}function iPe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}var K0="http://www.w3.org/2000/svg",aPe=function(){function n(e,t,r){iPe(this,n),this.svg=e,this.encodings=t,this.options=r,this.document=r.xmlDocument||document}return ePe(n,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var r=0;r<this.encodings.length;r++){var i=this.encodings[r],a=(0,nPe.default)(this.options,i.options),s=this.createGroup(t,a.marginTop,this.svg);this.setGroupOptions(s,a),this.drawSvgBarcode(s,a,i),this.drawSVGText(s,a,i),t+=i.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,fC.calculateEncodingAttributes)(this.encodings,this.options);var t=(0,fC.getTotalWidthOfEncodings)(this.encodings),r=(0,fC.getMaximumHeightOfEncodings)(this.encodings),i=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(i,r),this.options.background&&this.drawRect(0,0,i,r,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(t,r,i){var a=i.data,s;r.textPosition=="top"?s=r.fontSize+r.textMargin:s=0;for(var o=0,c=0,u=0;u<a.length;u++)c=u*r.width+i.barcodePadding,a[u]==="1"?o++:o>0&&(this.drawRect(c-r.width*o,s,r.width*o,r.height,t),o=0);o>0&&this.drawRect(c-r.width*(o-1),s,r.width*o,r.height,t)}},{key:"drawSVGText",value:function(t,r,i){var a=this.document.createElementNS(K0,"text");if(r.displayValue){var s,o;a.setAttribute("style","font:"+r.fontOptions+" "+r.fontSize+"px "+r.font),r.textPosition=="top"?o=r.fontSize-r.textMargin:o=r.height+r.textMargin+r.fontSize,r.textAlign=="left"||i.barcodePadding>0?(s=0,a.setAttribute("text-anchor","start")):r.textAlign=="right"?(s=i.width-1,a.setAttribute("text-anchor","end")):(s=i.width/2,a.setAttribute("text-anchor","middle")),a.setAttribute("x",s),a.setAttribute("y",o),a.appendChild(this.document.createTextNode(i.text)),t.appendChild(a)}}},{key:"setSvgAttributes",value:function(t,r){var i=this.svg;i.setAttribute("width",t+"px"),i.setAttribute("height",r+"px"),i.setAttribute("x","0px"),i.setAttribute("y","0px"),i.setAttribute("viewBox","0 0 "+t+" "+r),i.setAttribute("xmlns",K0),i.setAttribute("version","1.1"),i.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(t,r,i){var a=this.document.createElementNS(K0,"g");return a.setAttribute("transform","translate("+t+", "+r+")"),i.appendChild(a),a}},{key:"setGroupOptions",value:function(t,r){t.setAttribute("style","fill:"+r.lineColor+";")}},{key:"drawRect",value:function(t,r,i,a,s){var o=this.document.createElementNS(K0,"rect");return o.setAttribute("x",t),o.setAttribute("y",r),o.setAttribute("width",i),o.setAttribute("height",a),s.appendChild(o),o}}]),n}();qE.default=aPe;var zE={};Object.defineProperty(zE,"__esModule",{value:!0});var sPe=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];
3927i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}();function oPe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}var cPe=function(){function n(e,t,r){oPe(this,n),this.object=e,this.encodings=t,this.options=r}return sPe(n,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),n}();zE.default=cPe;Object.defineProperty(UE,"__esModule",{value:!0});var uPe=jE,lPe=WE(uPe),dPe=qE,fPe=WE(dPe),hPe=zE,pPe=WE(hPe);function WE(n){return n&&n.__esModule?n:{default:n}}UE.default={CanvasRenderer:lPe.default,SVGRenderer:fPe.default,ObjectRenderer:pPe.default};var zp={};Object.defineProperty(zp,"__esModule",{value:!0});function HE(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function VE(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function GE(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var mPe=function(n){GE(e,n);function e(t,r){HE(this,e);var i=VE(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.name="InvalidInputException",i.symbology=t,i.input=r,i.message='"'+i.input+'" is not a valid input for '+i.symbology,i}return e}(Error),gPe=function(n){GE(e,n);function e(){HE(this,e);var t=VE(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="InvalidElementException",t.message="Not supported type to render on",t}return e}(Error),vPe=function(n){GE(e,n);function e(){HE(this,e);var t=VE(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="NoElementException",t.message="No element to render on.",t}return e}(Error);zp.InvalidInputException=mPe;zp.InvalidElementException=gPe;zp.NoElementException=vPe;Object.defineProperty($E,"__esModule",{value:!0});var yPe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},_Pe=BE,n2=lB(_Pe),bPe=UE,Bm=lB(bPe),xPe=zp;function lB(n){return n&&n.__esModule?n:{default:n}}function KE(n){if(typeof n=="string")return wPe(n);if(Array.isArray(n)){for(var e=[],t=0;t<n.length;t++)e.push(KE(n[t]));return e}else{if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLImageElement)return CPe(n);if(n&&n.nodeName&&n.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&n instanceof SVGElement)return{element:n,options:(0,n2.default)(n),renderer:Bm.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement)return{element:n,options:(0,n2.default)(n),renderer:Bm.default.CanvasRenderer};if(n&&n.getContext)return{element:n,renderer:Bm.default.CanvasRenderer};if(n&&(typeof n>"u"?"undefined":yPe(n))==="object"&&!n.nodeName)return{element:n,renderer:Bm.default.ObjectRenderer};throw new xPe.InvalidElementException}}function wPe(n){var e=document.querySelectorAll(n);if(e.length!==0){for(var t=[],r=0;r<e.length;r++)t.push(KE(e[r]));return t}}function CPe(n){var e=document.createElement("canvas");return{element:e,options:(0,n2.default)(n),renderer:Bm.default.CanvasRenderer,afterRender:function(){n.setAttribute("src",e.toDataURL())}}}$E.default=KE;var YE={};Object.defineProperty(YE,"__esModule",{value:!0});var kPe=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}();function SPe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}var TPe=function(){function n(e){SPe(this,n),this.api=e}return kPe(n,[{key:"handleCatch",value:function(t){if(t.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw t.message;else throw t;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(t){try{var r=t.apply(void 0,arguments);return this.api._options.valid(!0),r}catch(i){return this.handleCatch(i),this.api}}}]),n}();YE.default=TPe;var EPe=yE,of=md(EPe),PPe=qp,wv=md(PPe),RPe=LE,dB=md(RPe),APe=FE,HO=md(APe),IPe=$E,OPe=md(IPe),MPe=a1,DPe=md(MPe),NPe=YE,LPe=md(NPe),fB=zp,FPe=s1,hB=md(FPe);function md(n){return n&&n.__esModule?n:{default:n}}var Ku=function(){},o1=function(e,t,r){var i=new Ku;if(typeof e>"u")throw Error("No element to render on was provided.");return i._renderProperties=(0,OPe.default)(e),i._encodings=[],i._options=hB.default,i._errorHandler=new LPe.default(i),typeof t<"u"&&(r=r||{},r.format||(r.format=mB()),i.options(r)[r.format](t,r).render()),i};o1.getModule=function(n){return of.default[n]};for(var VO in of.default)of.default.hasOwnProperty(VO)&&$Pe(of.default,VO);function $Pe(n,e){Ku.prototype[e]=Ku.prototype[e.toUpperCase()]=Ku.prototype[e.toLowerCase()]=function(t,r){var i=this;return i._errorHandler.wrapBarcodeCall(function(){r.text=typeof r.text>"u"?void 0:""+r.text;var a=(0,wv.default)(i._options,r);a=(0,DPe.default)(a);var s=n[e],o=pB(t,s,a);return i._encodings.push(o),i})}}function pB(n,e,t){n=""+n;var r=new e(n,t);if(!r.valid())throw new fB.InvalidInputException(r.constructor.name,n);var i=r.encode();i=(0,dB.default)(i);for(var a=0;a<i.length;a++)i[a].options=(0,wv.default)(t,i[a].options);return i}function mB(){return of.default.CODE128?"CODE128":Object.keys(of.default)[0]}Ku.prototype.options=function(n){return this._options=(0,wv.default)(this._options,n),this};Ku.prototype.blank=function(n){var e=new Array(n+1).join("0");return this._encodings.push({data:e}),this};Ku.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var n;
3927for(var e in this._renderProperties){n=this._renderProperties[e];var t=(0,wv.default)(this._options,n.options);t.format=="auto"&&(t.format=mB()),this._errorHandler.wrapBarcodeCall(function(){var r=t.value,i=of.default[t.format.toUpperCase()],a=pB(r,i,t);r2(n,a,t)})}}};Ku.prototype.render=function(){if(!this._renderProperties)throw new fB.NoElementException;if(Array.isArray(this._renderProperties))for(var n=0;n<this._renderProperties.length;n++)r2(this._renderProperties[n],this._encodings,this._options);else r2(this._renderProperties,this._encodings,this._options);return this};Ku.prototype._defaults=hB.default;function r2(n,e,t){e=(0,dB.default)(e);for(var r=0;r<e.length;r++)e[r].options=(0,wv.default)(t,e[r].options),(0,HO.default)(e[r].options);(0,HO.default)(t);var i=n.renderer,a=new i(n.element,e,t);a.render(),n.afterRender&&n.afterRender()}typeof window<"u"&&(window.JsBarcode=o1);typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(n,e){var t=[];return jQuery(this).each(function(){t.push(this)}),o1(t,n,e)});var BPe=o1,UPe=BPe,jPe={render:function(n){return n("div",[n(this.elementTag,{style:{display:this.valid?void 0:"none"},class:["vue-barcode-element"]}),n("div",{style:{display:this.valid?"none":void 0}},this.$slots.default)])},props:{value:[String,Number],format:[String],width:[String,Number],height:[String,Number],displayValue:{type:[String,Boolean],default:!0},text:[String,Number],fontOptions:[String],font:[String],textAlign:[String],textPosition:[String],textMargin:[String,Number],fontSize:[String,Number],background:[String],lineColor:[String],margin:[String,Number],marginTop:[String,Number],marginBottom:[String,Number],marginLeft:[String,Number],marginRight:[String,Number],flat:[Boolean],ean128:[String,Boolean],elementTag:{type:String,default:"svg",validator:function(n){return["canvas","svg","img"].indexOf(n)!==-1}}},mounted:function(){this.$watch("$props",GO,{deep:!0,immediate:!0}),GO.call(this)},data:function(){return{valid:!0}}};function GO(){var n=this,e={format:this.format,width:this.width,height:this.height,displayValue:this.displayValue,text:this.text,fontOptions:this.fontOptions,font:this.font,textAlign:this.textAlign,textPosition:this.textPosition,textMargin:this.textMargin,fontSize:this.fontSize,background:this.background,lineColor:this.lineColor,margin:this.margin,marginTop:this.marginTop,marginBottom:this.marginBottom,marginLeft:this.marginLeft,marginRight:this.marginRight,flat:this.flat,ean128:this.ean128,valid:function(t){n.valid=t},elementTag:this.elementTag};qPe(e),UPe(this.$el.querySelector(".vue-barcode-element"),String(this.value),e)}function qPe(n){for(var e in n)n.hasOwnProperty(e)&&n[e]===void 0&&delete n[e]}var zPe=jPe;const XE=id(zPe),WPe={props:["id","user","quarantines"],components:{AppLayout:ta,JetInput:Rn,JetLabel:Un,JetSecondaryButton:Br,JetButton:mn,JetActionMessage:tu,JetCheckbox:Pp,barcode:XE,JetInputError:ea},async mounted(){var e,t,r,i,a,s,o,c,u,l,d,h,p,g;const n=this.quarantines||[];if(this.quarantine=n.some(v=>Le(v.expire_at).isAfter(Le())),this.activeQuarantines=n.filter(v=>Le(v.expire_at).isAfter(Le())),this.user.away_application===null&&(this.step=0),((t=(e=this.user)==null?void 0:e.away_application)==null?void 0:t.photo)!==null&&((i=(r=this.user)==null?void 0:r.away_application)==null?void 0:i.is_paid)===0&&((s=(a=this.user)==null?void 0:a.away_application)==null?void 0:s.is_approved)===0&&(this.step=2),((c=(o=this.user)==null?void 0:o.away_application)==null?void 0:c.photo)!==null&&((l=(u=this.user)==null?void 0:u.away_application)==null?void 0:l.is_paid)===1&&((h=(d=this.user)==null?void 0:d.away_application)==null?void 0:h.is_approved)===0&&(this.step=3),((g=(p=this.user)==null?void 0:p.away_application)==null?void 0:g.is_approved)===1&&(this.step=4),this.step<2)try{await Promise.all([Nr.ssdMobilenetv1.loadFromUri("/models"),Nr.faceLandmark68Net.loadFromUri("/models"),Nr.faceRecognitionNet.loadFromUri("/models")]),this.modelsLoaded=!0}catch(v){console.error("Error loading face-api.js models:",v)}},data(){return{form:this.$inertia.form({_method:"POST",photo:null,consent:!1}
3927),photoPreview:null,step:0,loading:!1,faceDetectionStarted:!1,faceDetectionFinished:!1,faces:0,interval:null,isFetching:!1,quarantine:!1,activeQuarantines:[]}},watch:{step(n){n===2&&this.refreshPaymentStatus(this.user.away_application)}},methods:{async refreshPaymentStatus(n){this.isFetching=!0;try{(await(await fetch("/user/fck-away/check-payment",{method:"GET",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').getAttribute("content")}})).json()).hasAwayPayment&&(this.step=3)}catch(e){this.isFetching=!1,console.error(e)}this.isFetching=!1},createAwayApplication(){this.form.post(route("user.fckaway.store"),{errorBag:"updateProfileInformation",preserveScroll:!0}),this.step=2},updateProfileInformation(){this.$refs.photo&&(this.form.photo=this.$refs.photo.files[0]),this.form.post(route("user.fckaway.store"),{errorBag:"updateProfileInformation",preserveScroll:!0})},selectNewPhoto(){this.$refs.photo.click()},async updatePhotoPreview(){try{if(this.faceDetectionFinished=!1,this.photoPreview=null,this.loading=!0,!document.getElementById("photo"))throw new Error("Element with id 'photo' not found.");const e=this.$refs.photo.files[0];if(!e)throw new Error("No file selected.");if(!this.modelsLoaded)try{await Promise.all([Nr.ssdMobilenetv1.loadFromUri("/models"),Nr.faceLandmark68Net.loadFromUri("/models"),Nr.faceRecognitionNet.loadFromUri("/models")]),this.modelsLoaded=!0}catch(t){console.error("Error loading face-api.js models:",t)}this.faceDetectionStarted=!0,await this.cropFaces(e)}catch(n){console.error(n.message),this.loading=!1}},async preprocessImage(n){return new Promise((e,t)=>{const r=new Image;r.onload=()=>{const i=r.src;try{const{width:s,height:o}=r;let c=s,u=o;if(s>1280||o>1280){const h=s/o;s>o?(c=1280,u=1280/h):(u=1280,c=1280*h)}const l=document.createElement("canvas");l.width=c,l.height=u;const d=l.getContext("2d");d.imageSmoothingEnabled=!0,d.imageSmoothingQuality="high",d.drawImage(r,0,0,c,u),l.toBlob(h=>{URL.revokeObjectURL(i),h?e(h):t(new Error("Failed to create processed image blob"))},"image/jpeg",.85)}catch(a){URL.revokeObjectURL(i),t(a)}},r.onerror=()=>{URL.revokeObjectURL(r.src),t(new Error("Failed to load image for preprocessing"))},r.src=URL.createObjectURL(n)})},async cropFaces(n){try{const e=await this.preprocessImage(n),t=await oL(e),r=fv(t);let i={width:t.width,height:t.height};uL(r,i);const a=await FL(t).withFaceLandmarks().withFaceDescriptors();if(this.faceDetectionFinished=!0,this.faceDetectionStarted=!1,this.faces=a.length,a.length!==1)throw new Error("No face or multiple faces detected.");const[s]=a.sort((d,h)=>h.detection.score-d.detection.score),o=this.getCroppedImageData(t,s,i);this.photoPreview=o.dataUrl;const c=this.dataURLtoFile(o.dataUrl,"photo.jpg"),u=new DataTransfer;u.items.add(c);const l=document.querySelector("#photo");l.files=u.files,this.form.photo=c,this.loading=!1}catch(e){console.error(e.message),this.loading=!1}},getCroppedImageData(n,e,t){const r=.7782101167315175,i=2,a=300,{cropX:s,cropY:o,paddedWidth:c,paddedHeight:u}=this.cropToAspectRatio(e,t,r,i),l=a/r,d=document.createElement("canvas");return d.width=c,d.height=u,d.getContext("2d").drawImage(n,s,o,c,u,0,0,c,u),{dataUrl:d.toDataURL("image/jpeg",.4),width:a,height:l}},cropToAspectRatio(n,e,t=1/1.285,r=1.2){const{x:i,y:a,width:s,height:o}=n.detection.box;let c=s*r,u=c/t;const l=e.width,d=e.height;let h=Math.max(0,i+(s-c)/2),p=Math.max(0,a+(o-u)/2);return c=Math.min(c,l-h),u=Math.min(u,d-p),{cropX:h,cropY:p,paddedWidth:c,paddedHeight:u}},deletePhoto(){this.$inertia.delete(route("current-user-photo.destroy"),{preserveScroll:!0,onSuccess:()=>this.photoPreview=null})},dataURLtoFile(n,e){const t=n.split(","),r=t[0].match(/:(.*?);/)[1],i=atob(t[t.length-1]);let a=i.length;const s=new Uint8Array(a);for(;a--;)s[a]=i.charCodeAt(a);return new File([s],e,{type:r})}},computed:{years(){return Le().diff(Le(this.user.birthday,"DD-MM-YYYY"),"years")},quarantineAmount(){return this.quarantines.map(n=>Le(n.expire_at).isAfter(Le())).length}}};var HPe=function(){var e=this,t=e._self._c;return t("app-layout",[this.quarantine?t("div",{staticClass:"flex flex-col items-center justify-center min-h-full flex-1 px-4"},[t("svg",{staticClass:"w-24",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"}})]),t("p",{staticClass:"text-2xl font-bold text-center mt-4"},[e._v(e._s(e.$trans("pages.away.activeQuarantine")))]),t("div",{staticClass:"flex flex-col mt-4"},e._l(this.activeQuarantines,function(r){return t("p",{staticClass:"text-md"},[e._v(" "+e._s(e.$trans("pages.away.quarantineExpires"))+" "+e._s(r.expire_at)+" ")])}),0)]):t("div",{staticClass:"text-white flex flex-col min-h-full flex-1",class:{"background-fck":this.step>=0}}
3927,[e.step===0?t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8 flex flex-col justify-center items-center h-full"},[t("h1",{staticClass:"text-3xl mb-3 mt-6 sm:mt-16 md:mt-24 lg:mt-32 text-center"},[e._v(e._s(e.$trans("pages.away.slide0title"))+" ")]),t("p",{staticClass:"text-center px-4 mb-3 md:mb-24 lg:mb-32"},[e._v(e._s(e.$trans("pages.away.slide0text")))]),t("div",{staticClass:"grid grid-cols-1 lg:grid-cols-3 lg:gap-4 text-white mb-3"},[t("div",{staticClass:"flex flex-col items-center"},[t("svg",{staticClass:"w-12 h-12 md:w-20 md:h-20",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}})]),t("h4",{staticClass:"text-center uppercase my-2"},[e._v(" "+e._s(e.$trans("pages.away.slide0step1title"))+" ")]),t("p",{staticClass:"px-4"},[e._v(e._s(e.$trans("pages.away.slide0step1text")))])]),t("div",{staticClass:"flex flex-col items-center"},[t("svg",{staticClass:"w-12 h-12 md:w-20 md:h-20",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Z"}})]),t("h4",{staticClass:"text-center uppercase my-2"},[e._v(" "+e._s(e.$trans("pages.away.slide0step2title"))+" ")]),t("p",{staticClass:"px-4"},[e._v(e._s(e.$trans("pages.away.slide0step2text")))])]),t("div",{staticClass:"flex flex-col items-center"},[t("svg",{staticClass:"w-12 h-12 md:w-20 md:h-20",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11.35 3.836c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m8.9-4.414c.376.023.75.05 1.124.08 1.131.094 1.976 1.057 1.976 2.192V16.5A2.25 2.25 0 0 1 18 18.75h-2.25m-7.5-10.5H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V18.75m-7.5-10.5h6.375c.621 0 1.125.504 1.125 1.125v9.375m-8.25-3 1.5 1.5 3-3.75"}})]),t("h4",{staticClass:"text-center uppercase my-2"},[e._v(" "+e._s(e.$trans("pages.away.slide0step3title"))+" ")]),t("p",{staticClass:"px-4"},[e._v(e._s(e.$trans("pages.away.slide0step4text")))])])]),t("jet-label",{attrs:{for:"consent"}},[t("div",{staticClass:"flex mb-2 justify-center items-center"},[t("jet-checkbox",{attrs:{name:"consent",id:"consent"},model:{value:e.form.consent,callback:function(r){e.$set(e.form,"consent",r)},expression:"form.consent"}}),t("div",{staticClass:"ml-2 consent-text text-white hover:text-gray-200 consent-text"},[e._v(" "+e._s(e.$trans("pages.away.acceptTerms"))+" "),t("a",{staticClass:"text-sm text-white hover:text-gray-200 consent-text underline",attrs:{target:"_blank",href:e.route("agreements.index")}},[e._v(" "+e._s(e.$trans("pages.away.acceptLink"))+" ")]),e._v(" "+e._s(e.$trans("pages.away.acceptTerms2"))+" ")])],1)]),t("button",{staticClass:"mb-8 mt-2 inline-flex items-center px-4 py-2 bg-white border border-transparent rounded-md font-semibold text-xs text-gray-700 hover:text-white active:text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray transition ease-in-out duration-150",class:{"disabled cursor-not-allowed":!e.form.consent},attrs:{disabled:!e.form.consent},on:{click:function(r){e.step++}}}
3927,[e._v(e._s(e.$trans("pages.away.slide0cta")))])],1):e._e(),e.step==1?t("div",[t("form",[t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8 flex flex-col justify-center items-center h-full"},[t("h1",{staticClass:"text-3xl mb-3 mt-6 sm:mt-16 md:mt-24 lg:mt-32 text-center"},[e._v(" "+e._s(e.$trans("pages.away.slide1title")))]),t("p",{staticClass:"text-center px-4 mb-3"},[e._v(e._s(e.$trans("pages.away.slide1text")))]),t("div",{staticClass:"lg:mt-8 bg-gray-900 mx-auto border-2 border-dashed mx-4 min-h-60 rounded-lg p-2 h-full w-full"},[t("div",{staticClass:"flex flex-col items-center h-full"},[t("div",[!this.faceDetectionStarted&&!this.faceDetectionFinished?t("h4",{staticClass:"text-white text-center"},[e._v(" "+e._s(e.$trans("pages.away.slide1waiting")))]):e._e(),this.faceDetectionStarted&&!this.faceDetectionFinished?t("h4",{staticClass:"text-white text-center"},[e._v(" "+e._s(e.$trans("pages.away.slide1check")))]):e._e(),!this.faceDetectionStarted&&this.faceDetectionFinished&&this.faces===1?t("h4",{staticClass:"text-white text-center"},[e._v(" "+e._s(e.$trans("pages.away.slide1custom")))]):e._e(),this.faces!==1&&this.faceDetectionFinished?t("h4",{staticClass:"text-white text-center"},[e._v(" "+e._s(e.$trans("pages.away.slide1rejected")))]):e._e(),this.faceDetectionFinished?e._e():t("p",{staticClass:"text-center mt-2"},[e._v(e._s(e.$trans("pages.away.slide1info"))+" ")]),this.faces!==1&&this.faceDetectionFinished?t("p",{staticClass:"text-center mt-2"},[e._v(e._s(e.$trans("pages.away.slide1rejectedtext")))]):e._e()]),!this.faceDetectionStarted&&this.faceDetectionFinished&&this.faces===1?t("p",{staticClass:"text-center mt-2"},[e._v(e._s(e.$trans("pages.away.slide1approved")))]):e._e(),t("div",{staticClass:"bg-gray-300 min-w-[300px] min-h-[386px] rounded-lg flex items-center justify-center",attrs:{id:"photoselection"}},[e.photoPreview?t("img",{staticClass:"aspect-ratio-1/1.28 md:max-w-md",attrs:{id:"preview-image",src:e.photoPreview,alt:"Profile Picture"}}):e._e(),!this.faceDetectionStarted&&!this.faceDetectionFinished?t("svg",{staticClass:"text-gray-500 h-32",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"}})]):e._e(),this.faceDetectionFinished&&this.faces!==1?t("svg",{staticClass:"text-gray-500 h-32",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}})]):e._e(),this.faceDetectionStarted&&!this.faceDetectionFinished?t("svg",{staticClass:"text-gray-500 h-32 animate-spin",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}})]):e._e()]),t("input",{ref:"photo",staticClass:"hidden",attrs:{id:"photo",type:"file"},on:{change:e.updatePhotoPreview}}),t("div",{staticClass:"flex flew-row justify-center"},[t("jet-secondary-button",{staticClass:"mt-2",attrs:{type:"button"},nativeOn:{click:function(r){return r.preventDefault(),e.selectNewPhoto.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("pages.away.slide1picknewimage"))+" ")]),this.photoPreview?t("jet-button",{staticClass:"ml-2 mt-2",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing},nativeOn:{click:function(r){return r.preventDefault(),e.createAwayApplication.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("pages.away.slide1saveimage")))]):e._e()],1)])])])])]):e._e(
3927),e.step===2?t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8 flex flex-col justify-center items-center"},[t("h1",{staticClass:"text-3xl mb-3 mt-6 sm:mt-16 md:mt-24 lg:mt-32 text-center"},[e._v(" "+e._s(e.$trans("pages.away.slide2title"))+" ")]),e.isFetching?t("div",{staticClass:"flex flex-row justify-center items-center"},[t("p",[e._v("Tjekker betaling ")]),t("svg",{staticClass:"size-6 text-grey-500 ml-1.5",class:{"animate-spin":e.isFetching},attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}})])]):e._e(),t("p",{staticClass:"text-center px-4 mb-3"},[e._v(e._s(e.$trans("pages.away.slide2text")))]),t("a",{staticClass:"my-2 inline-flex items-center px-4 py-2 bg-white border border-transparent rounded-md font-semibold text-xs text-gray-700 hover:text-white active:text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray transition ease-in-out duration-150",attrs:{href:`/redirect/tickets?redirect_url=${encodeURIComponent("https://billet.fck.dk/Merchandises/Buy?id=2253")}`}},[e._v(e._s(e.$trans("pages.away.slide2cta")))])]):e._e(),e.step===3?t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8 flex flex-col justify-center items-center"},[t("h1",{staticClass:"text-3xl mb-3 mt-6 sm:mt-16 md:mt-24 lg:mt-32 text-center"},[e._v(" "+e._s(e.$trans("pages.away.slide3title"))+" ")]),t("p",{staticClass:"text-center px-4 mb-3"},[e._v(e._s(e.$trans("pages.away.slide3text")))])]):e._e(),e.step===4?t("div",{staticClass:"bg-gray-100 max-w-7xl mx-auto sm:px-6 lg:px-8 flex flex-1"},[t("div",{staticClass:"flex flex-col items-center flex-nowrap justify-start flex-1"},[t("div",{staticClass:"flex-grow-0 flex-shrink order-none justify-center items-center flex flex-col"},[t("div",{staticClass:"flex flex-row justify-center items-center"},[t("span",{staticClass:"relative flex h-4 w-4 mr-2"},[t("span",{staticClass:"animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-800 opacity-75"}),t("span",{staticClass:"relative inline-flex rounded-full h-4 w-4 bg-blue-900"})]),t("h2",{staticClass:"text-center text-black text-lg font-bold"},[e._v(e._s(e.user.firstname)+" "+e._s(e.user.lastname))])]),t("p",{staticClass:"text-center text-gray-600"},[e._v(e._s(e.user.birthday))])]),t("barcode",{attrs:{value:e.user.away_application.id,height:"50px",displayValue:"false"}}),t("div",{staticClass:"flex flex-grow-0 flex-shrink order-none justify-center items-center"},[t("img",{staticClass:"aspect-ratio-1/1.28 md:max-w-md",attrs:{src:e.user.away_application.photo,alt:"Profile Picture"}})])],1)]):e._e()])])},VPe=[],GPe=ve(WPe,HPe,VPe,!1,null,null);const KPe=GPe.exports,YPe=Object.freeze(Object.defineProperty({__proto__:null,default:KPe},Symbol.toStringTag,{value:"Module"})),XPe={components:{JetActionSection:Tp,JetDangerButton:vo,JetDialogModal:Ep,JetInput:Rn,JetInputError:ea,JetSecondaryButton:Br},data(){return{confirmingUserDeletion:!1,form:this.$inertia.form({password:""})}},computed:{connectedSystems(){const n=this.$page.props.user||{},e=[{key:"profile",name:this.$trans("users.delete.systemProfile"),detail:this.$trans("users.delete.systemProfileDetail")}];return n.roboticket_id&&e.push({key:"roboticket",name:this.$trans("users.delete.systemRoboticket"),detail:this.$trans("users.delete.systemRoboticketDetail")}),n.shopify_customer_id&&e.push({key:"shopify",name:this.$trans("users.delete.systemShopify"),detail:this.$trans("users.delete.systemShopifyDetail")}),n.agillic_id&&e.push({key:"agillic",name:this.$trans("users.delete.systemAgillic"),detail:this.$trans("users.delete.systemAgillicDetail")}),e}},methods:{confirmUserDeletion(){this.confirmingUserDeletion=!0,setTimeout(()=>this.$refs.password.focus(),250)},deleteUser(){this.form.delete(route("current-user.destroy"),{preserveScroll:!0,onSuccess:()=>this.closeModal(),onError:()=>this.$refs.password.focus(),onFinish:()=>this.form.reset()})},closeModal(){this.confirmingUserDeletion=!1,this.form.reset()}}};var JPe=function(){var e=this,t=e._self._c;return t("jet-action-section",{scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.$trans("users.delete.title"))+" ")]},proxy:!0},{key:"description",fn:function(){return[e._v(" "+e._s(e.$trans("users.delete.description"))+" ")]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"max-w-xl text-sm text-gray-600"},[e._v(" "+e._s(e.$trans("users.delete.explanation"))+" ")]),t("div",{staticClass:"mt-5"},[t("jet-danger-button",{nativeOn:{click:function(r){return e.confirmUserDeletion.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("users.delete.delete"))+" ")])],1),t("jet-dialog-modal",{attrs:{show:e.confirmingUserDeletion},on:{close:e.closeModal},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.$trans("users.delete.title"))+" ")]},proxy:!0},{key:"content",fn:function(){return[t("p",{staticClass:"text-sm text-gray-600 m-0"},[e._v(" "+e._s(e.connectedSystems.length>
39271?e.$trans("users.delete.systemsIntro"):e.$trans("users.delete.systemsNone"))+" ")]),t("ul",{staticClass:"mt-3 border rounded divide-y"},e._l(e.connectedSystems,function(r){return t("li",{key:r.key,staticClass:"px-3 py-2"},[t("span",{staticClass:"block text-sm font-bold text-gray-800"},[e._v(e._s(r.name))]),t("span",{staticClass:"block text-sm text-gray-500"},[e._v(e._s(r.detail))])])}),0),t("p",{staticClass:"mt-3 text-sm text-gray-500 m-0"},[e._v(" "+e._s(e.$trans("users.delete.retention"))+" ")]),t("p",{staticClass:"mt-3 text-sm font-bold text-red-700 m-0"},[e._v(" "+e._s(e.$trans("users.delete.irreversible"))+" ")]),t("div",{staticClass:"mt-4 text-sm text-gray-600"},[e._v(" "+e._s(e.$trans("users.delete.modalConfirm"))+" ")]),t("div",{staticClass:"mt-2"},[t("jet-input",{ref:"password",staticClass:"mt-1 block w-3/4",attrs:{type:"password",placeholder:e.$trans("users.delete.modalPlaceholder")},nativeOn:{keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.deleteUser.apply(null,arguments)}},model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.password}})],1)]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){return e.closeModal.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("users.delete.modalCancel"))+" ")]),t("jet-danger-button",{staticClass:"ml-2",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing},nativeOn:{click:function(r){return e.deleteUser.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("users.delete.delete"))+" ")])]},proxy:!0}])})]},proxy:!0}])})},QPe=[],ZPe=ve(XPe,JPe,QPe,!1,null,null);const gB=ZPe.exports,eRe=Object.freeze(Object.defineProperty({__proto__:null,default:gB},Symbol.toStringTag,{value:"Module"}));var ri={},gd={},c1={};Object.defineProperty(c1,"__esModule",{value:!0});var tRe=function(){function n(){}return n}();c1.default=tRe;var B_=Fr&&Fr.__assign||function(){return B_=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},B_.apply(this,arguments)},nRe=Fr&&Fr.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(gd,"__esModule",{value:!0});gd.trans=vB;gd.__=iRe;gd.transChoice=aRe;gd.setLocale=sRe;gd.getLocale=oRe;gd.locales=cRe;var $o=nRe(c1);function rRe(n,e){if(!n)throw e}var Cv=function(){function n(){$o.default.locale=Matice.locale,$o.default.fallbackLocale=Matice.fallbackLocale,$o.default.locales=Object.keys(Matice.translations)}return Object.defineProperty(n,"instance",{get:function(){return n._instance===void 0&&(n._instance=new n),n._instance},enumerable:!1,configurable:!0}),n.prototype.setLocale=function(e){$o.default.locale=e},n.prototype.getLocale=function(){return $o.default.locale},n.prototype.locales=function(){return $o.default.locales},n.prototype.translations=function(e){e===void 0&&(e=$o.default.locale);var t=Matice.translations;if(t===void 0)console.warn("Matice Translation not found. For Matice-js to work, make sure to add @translations blade directive in your view. Usually insert the directive in app.layout."),t=[];else if(t=t[e],t===void 0)throw"Locale [".concat(e,"] does not exist.");return t},n.prototype.trans=function(e,t,r){r===void 0&&(r={args:{},pluralize:!1});var i=r.args||{},a=this.findSentence(e,t,r.locale);return r.pluralize&&(rRe(typeof i.count=="number","On pluralization, the argument `count` must be a number and non-null."),a=this.pluralize(a,i.count)),Object.keys(i).forEac
3927h(function(s){a=a.replace(new RegExp(":"+s,"g"),i[s])}),a},n.prototype.pluralize=function(e,t){var r=e.split("|");r.length>=3?r=[r[0],r[1],r[2]]:r.length===2?r=[r[0],r[0],r[1]]:r=[r[0],r[0],r[0]];for(var i=[],a=/^(\[(\s*\d+\s*)+,(\s*(\d+|\*)\s*)])|({\s*\d+\s*})/,s=0;s<r.length;s++){var o=r[s],c=o.match(a);c===null&&(r[s]="{".concat(s,"} ").concat(r[s]),c=[r[s]]);var u=c[0].replace(/[\[{]/,""),l=u.split(new RegExp("(?<=\\d),"),2).map(function(v){var y=Number.parseInt(v.trim());return Number.isInteger(y)?y:t+1});r[s]=o=o.replace(a,""),i.push(l.length==1?{min:l[0],max:l[0],part:o}:{min:l[0],max:l[1],part:o})}var d=!1;if(t<=0)e=r[0];else{for(var h=0,p=i;h<p.length;h++){var g=p[h];if(t>=g.min&&t<=g.max){e=g.part,d=!0;break}}d||(e=r[r.length-1])}return e},n.prototype.findSentence=function(e,t,r,i){r===void 0&&(r=$o.default.locale),i===void 0&&(i=!1);for(var a=this.translations(r),s=a,o=i?e.split("."):[e],c=0,u=o;c<u.length;c++){var l=u[c];if(typeof s=="object"&&l in s)s=s[l];else{if(!i)return this.findSentence(e,t,r,!0);if(r!==$o.default.fallbackLocale)return this.findSentence(e,t,$o.default.fallbackLocale);if(t)return e;throw'Translation key not found : "'.concat(e,'" -> Exactly "').concat(l,'" not found')}}return s.toString()},n}();function vB(n,e){return e===void 0&&(e={args:{},pluralize:!1}),Cv.instance.trans(n,!1,e)}function iRe(n,e){return e===void 0&&(e={args:{},pluralize:!1}),Cv.instance.trans(n,!0,e)}function aRe(n,e,t,r){return t===void 0&&(t={}),r===void 0&&(r=$o.default.locale),vB(n,{args:B_(B_({},t),{count:e}),pluralize:!0,locale:r})}function sRe(n){Cv.instance.setLocale(n)}function oRe(){return Cv.instance.getLocale()}function cRe(){return Cv.instance.locales()}(function(n){var e=Fr&&Fr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(n,"__esModule",{value:!0}),n.MaticeLocalizationConfig=n.transChoice=n.locales=n.getLocale=n.setLocale=n.__=n.trans=void 0;var t=gd;Object.defineProperty(n,"trans",{enumerable:!0,get:function(){return t.trans}}),Object.defineProperty(n,"__",{enumerable:!0,get:function(){return t.__}}),Object.defineProperty(n,"setLocale",{enumerable:!0,get:function(){return t.setLocale}}),Object.defineProperty(n,"getLocale",{enumerable:!0,get:function(){return t.getLocale}}),Object.defineProperty(n,"locales",{enumerable:!0,get:function(){return t.locales}}),Object.defineProperty(n,"transChoice",{enumerable:!0,get:function(){return t.transChoice}});var r=c1;Object.defineProperty(n,"MaticeLocalizationConfig",{enumerable:!0,get:function(){return e(r).default}})})(ri);const uRe={props:["sessions"],components:{JetActionMessage:tu,JetActionSection:Tp,JetButton:mn,JetDialogModal:Ep,JetInput:Rn,JetInputError:ea,JetSecondaryButton:Br},data(){return{confirmingLogout:!1,form:this.$inertia.form({password:""})}},methods:{confirmLogout(){this.confirmingLogout=!0,setTimeout(()=>this.$refs.password.focus(),250)},logoutOtherBrowserSessions(){this.form.delete(route("other-browser-sessions.destroy"),{preserveScroll:!0,onSuccess:()=>this.closeModal(),onError:()=>this.$refs.password.focus(),onFinish:()=>this.form.reset()})},closeModal(){this.confirmingLogout=!1,this.form.reset()}}};var lRe=function(){var e=this,t=e._self._c;return t("jet-action-section",{scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.$trans("users.browser.title"))+" ")]},proxy:!0},{key:"description",fn:function(){return[e._v(" "+e._s(e.$trans("users.browser.description"))+" ")]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"max-w-xl text-sm text-gray-600"},[e._v(" "+e._s(e.$trans("users.browser.explanation"))+" ")]),e.sessions.length>0?t("div",{staticClass:"mt-5 space-y-6"},e._l(e.sessions,function(r,i){return t("div",{key:i,staticClass:"flex items-center"},[t("div",[r.agent.is_desktop?t("svg",{staticClass:"w-8 h-8 text-gray-500",attrs:{fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"}})]):t("svg",{staticClass:"w-8 h-8 text-gray-500",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}},[t("path",{attrs:{d:"M0 0h24v24H0z",stroke:"none"}}),t("rect",{attrs:{x:"7",y:"4",width:"10",height:"16",rx:"1"}}),t("path",{attrs:{d:"M11 5h2M12 17v.01"}})])]),t("div",{staticClass:"ml-3"},[t("div",{staticClass:"text-sm text-gray-600"},[e._v(" "+e._s(r.agent.platform)+" - "+e._s(r.agent.browser)+" ")]),t("div",[t("div",{staticClass:"text-xs text-gray-500"},[e._v(" "+e._s(r.ip_address)+", "),r.is_current_device?t("span",{staticClass:"text-green-500 font-semibold"},[e._v("Denne enhed")]):t("span",[e._v(e._s(e.$trans("users.browser.lastActive"))+" "+e._s(r.last_active))])])])])])}
3927),0):e._e(),t("div",{staticClass:"flex items-center mt-5"},[t("jet-button",{nativeOn:{click:function(r){return e.confirmLogout.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("users.browser.logout"))+" ")]),t("jet-action-message",{staticClass:"ml-3",attrs:{on:e.form.recentlySuccessful}},[e._v(" Done. ")])],1),t("jet-dialog-modal",{attrs:{show:e.confirmingLogout},on:{close:e.closeModal},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.$trans("users.browser.logout"))+" ")]},proxy:!0},{key:"content",fn:function(){return[e._v(" "+e._s(e.$trans("users.browser.confirm"))+" "),t("div",{staticClass:"mt-4"},[t("jet-input",{ref:"password",staticClass:"mt-1 block w-3/4",attrs:{type:"password",placeholder:e.$trans("users.browser.password")},nativeOn:{keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.logoutOtherBrowserSessions.apply(null,arguments)}},model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.password}})],1)]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){return e.closeModal.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("users.browser.cancel"))+" ")]),t("jet-button",{staticClass:"ml-2",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing},nativeOn:{click:function(r){return e.logoutOtherBrowserSessions.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("users.browser.logout"))+" ")])]},proxy:!0}])})]},proxy:!0}])})},dRe=[],fRe=ve(uRe,lRe,dRe,!1,null,null);const yB=fRe.exports,hRe=Object.freeze(Object.defineProperty({__proto__:null,default:yB},Symbol.toStringTag,{value:"Module"})),pRe={components:{JetSectionTitle:S2}};var mRe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"md:grid md:grid-cols-3 md:gap-6"},[t("jet-section-title",{scopedSlots:e._u([{key:"title",fn:function(){return[e._t("title")]},proxy:!0},{key:"description",fn:function(){return[e._t("description")]},proxy:!0}],null,!0)}),e._t("content")],2)},gRe=[],vRe=ve(pRe,mRe,gRe,!1,null,null);const _B=vRe.exports,yRe={props:{title:{default:ri.trans("jetstream.confirmsPassword.title")},content:{default:ri.trans("jetstream.confirmsPassword.content")},button:{default:ri.trans("jetstream.confirmsPassword.button")}},components:{JetButton:mn,JetDialogModal:Ep,JetInput:Rn,JetInputError:ea,JetSecondaryButton:Br},data(){return{confirmingPassword:!1,form:{password:"",error:""}}},methods:{startConfirmingPassword(){axios.get(route("password.confirmation")).then(n=>{n.data.confirmed?this.$emit("confirmed"):(this.confirmingPassword=!0,setTimeout(()=>this.$refs.password.focus(),250))})},confirmPassword(){this.form.processing=!0,axios.post(route("password.confirm"),{password:this.form.password}).then(()=>{this.form.processing=!1,this.closeModal(),this.$nextTick(()=>this.$emit("confirmed"))}).catch(n=>{this.form.processing=!1,this.form.error=n.response.data.errors.password[0],this.$refs.password.focus()})},closeModal(){this.confirmingPassword=!1,this.form.password="",this.form.error=""}}};var _Re=function(){var e=this,t=e._self._c;return t("span",[t("span",{on:{click:e.startConfirmingPassword}},[e._t("default")],2),t("jet-dialog-modal",{attrs:{show:e.confirmingPassword},on:{close:e.closeModal},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.title)+" ")]},proxy:!0},{key:"content",fn:function(){return[e._v(" "+e._s(e.content)+" "),t("div",{staticClass:"mt-4"},[t("jet-input",{ref:"password",staticClass:"mt-1 block w-3/4",attrs:{type:"password",placeholder:"Password"},nativeOn:{keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.confirmPassword.apply(null,arguments)}},model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.error}})],1)]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){return e.closeModal.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("jetstream.confirmsPassword.cancel"))+" ")]),t("jet-button",{staticClass:"ml-2",class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing},nativeOn:{click:function(r){return e.confirmPassword.apply(null,arguments)}}},[e._v(" "+e._s(e.button)+" ")])]},proxy:!0}])})],1)},bRe=[],xRe=ve(yRe,_Re,bRe,!1,null,null);const kv=xRe.exports,wRe={name:"jet-toggle",props:["id","value","label","description","disabled","locked"],components:{},methods:{focus(){this.$refs.input.focus()},update(n){this.$emit("input",n.target.checked)}}};var CRe=function(){var e=this,t=e._self._c;return t("div",{},[t("div",{staticClass:"flex items-center justify-between w-full"},[t("div",{staticClass:"text-lg font-medium text-gray-900 font-regular"},[e._v(" "+e._s(e.label)+" ")]),t("label",{staticClass:"flex items-center cursor-pointer",class:e.locked?"cursor-not-allowed":"cursor-pointer",attrs:{for:e.id}},[t("div",{staticClass:"relative"},[t("input",{staticClass:"sr-only",attrs:{type:"checkbox",id:e.id,disabled:e.disabled},domProps:{checked:e.value,value:e.value},on:{input:e.update}}),t("div",{staticClass:"block bg-gray-600 w-14 h-8 rounded-full"}),t("div",{staticClass:"dot absolute left-1 top-1 bg-white w-6 h-6 rounded-full transition"},[e.locked?t("svg",{staticStyle:{width:"80%"},attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2.5 -2 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z","clip-rule":"evenodd"}}
3927)]):e._e()])])])]),t("div",{staticClass:"mt-1"},[e._t("default"),e._v(" "+e._s(e.description&&e.description)+" ")],2)])},kRe=[],SRe=ve(wRe,CRe,kRe,!1,null,null);const u1=SRe.exports,TRe={name:"PermissionCategory",props:{id:{type:String,required:!0},title:{type:String,required:!0},description:{type:String,default:""},emailEnabled:{type:Boolean,default:!1},appEnabled:{type:Boolean,default:!1},smsEnabled:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},computed:{hasAnyChannel(){return this.emailEnabled||this.appEnabled||this.smsEnabled}},methods:{toggleAllChannels(n){const e=n.target.checked;this.$emit("toggle-all",e)}}};var ERe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"py-4"},[t("div",{staticClass:"flex items-start justify-between"},[t("div",{staticClass:"flex-1 pr-4"},[t("h5",{staticClass:"font-regular font-medium tracking-normal text-base"},[e._v(e._s(e.title))]),t("p",{staticClass:"text-sm text-gray-500 mt-1"},[e._v(e._s(e.description))])]),t("label",{staticClass:"flex items-center flex-shrink-0",class:e.disabled?"cursor-not-allowed opacity-50":"cursor-pointer",attrs:{for:e.id+"-toggle"}},[t("div",{staticClass:"relative"},[t("input",{staticClass:"sr-only",attrs:{type:"checkbox",id:e.id+"-toggle",disabled:e.disabled},domProps:{checked:e.hasAnyChannel},on:{change:e.toggleAllChannels}}),t("div",{staticClass:"block bg-gray-600 w-14 h-8 rounded-full"}),t("div",{staticClass:"dot absolute left-1 top-1 w-6 h-6 rounded-full transition",class:e.hasAnyChannel?"translate-x-full bg-green-500":"bg-white"})])])]),t("div",{staticClass:"flex gap-3 mt-4",class:e.disabled?"opacity-50 pointer-events-none":""},[t("button",{staticClass:"channel-btn",class:e.emailEnabled?"channel-btn--active":"channel-btn--inactive",attrs:{type:"button",disabled:e.disabled},on:{click:function(r){return e.$emit("update:email",!e.emailEnabled)}}},[e.emailEnabled?t("svg",{staticClass:"icon-check",attrs:{fill:"currentColor",viewBox:"0 0 20 20"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"}})]):t("span",{staticClass:"icon-circle"}),t("span",[e._v("E-mail")])]),t("button",{staticClass:"channel-btn",class:e.appEnabled?"channel-btn--active":"channel-btn--inactive",attrs:{type:"button",disabled:e.disabled},on:{click:function(r){return e.$emit("update:app",!e.appEnabled)}}},[e.appEnabled?t("svg",{staticClass:"icon-check",attrs:{fill:"currentColor",viewBox:"0 0 20 20"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"}})]):t("span",{staticClass:"icon-circle"}),t("span",[e._v("App")])]),t("button",{staticClass:"channel-btn",class:e.smsEnabled?"channel-btn--active":"channel-btn--inactive",attrs:{type:"button",disabled:e.disabled},on:{click:function(r){return e.$emit("update:sms",!e.smsEnabled)}}},[e.smsEnabled?t("svg",{staticClass:"icon-check",attrs:{fill:"currentColor",viewBox:"0 0 20 20"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"}})]):t("span",{staticClass:"icon-circle"}),t("span",[e._v("SMS")])])])])},PRe=[],RRe=ve(TRe,ERe,PRe,!1,null,"cf615d6c");const ARe=RRe.exports,IRe={props:["users"],components:{JetActionSection:Tp,JetActionSectionNoBox:_B,JetButton:mn,JetConfirmsPassword:kv,JetDangerButton:vo,JetSecondaryButton:Br,JetToggle:u1,JetConfirmationModal:kf,PermissionCategory:ARe},data(){return{ready:!1,fetching:!1,confirmingUserUnsubscribe:!1,permissions:{MARKETING_CONSENT:null,MARKETING_CONSENT_LAST_UPDATED:null,MARKETING_CONSENT_LATEST_SOURCE:null,MARKETING_CONSENT_OPT_IN_TIME:null,PRIVACY_POLICY:null,PRIVACY_POLICY_LAST_UPDATED:null,PRIVACY_POLICY_LATEST_SOURCE:null,PRIVACY_POLICY_OPT_IN_TIME:null,GENERAL_PERMISSION:null,GENERAL_PERMISSION_LAST_UPDATED:null,GENERAL_PERMISSION_LATEST_SOURCE:null,GENERAL_PERMISSION_OPT_IN_TIME:null,GENERAL_PERMISSION_SIGNUP_SOURCE:null,GENERAL_PERMISSION_APP:null,G
3927ENERAL_PERMISSION_APP_LAST_UPDATED:null,GENERAL_PERMISSION_APP_LATEST_SOURCE:null,GENERAL_PERMISSION_APP_OPT_IN_TIME:null,GENERAL_PERMISSION_APP_SIGNUP_SOURCE:null,GENERAL_PERMISSION_SMS:null,GENERAL_PERMISSION_SMS_LAST_UPDATED:null,GENERAL_PERMISSION_SMS_LATEST_SOURCE:null,GENERAL_PERMISSION_SMS_OPT_IN_TIME:null,GENERAL_PERMISSION_SMS_SIGNUP_SOURCE:null,FANSHOP_PERMISSION:null,FANSHOP_PERMISSION_LAST_UPDATED:null,FANSHOP_PERMISSION_LATEST_SOURCE:null,FANSHOP_PERMISSION_OPT_IN_TIME:null,FANSHOP_PERMISSION_SIGNUP_SOURCE:null,FANSHOP_PERMISSION_APP:null,FANSHOP_PERMISSION_APP_LAST_UPDATED:null,FANSHOP_PERMISSION_APP_LATEST_SOURCE:null,FANSHOP_PERMISSION_APP_OPT_IN_TIME:null,FANSHOP_PERMISSION_APP_SIGNUP_SOURCE:null,FANSHOP_PERMISSION_SMS:null,FANSHOP_PERMISSION_SMS_LAST_UPDATED:null,FANSHOP_PERMISSION_SMS_LATEST_SOURCE:null,FANSHOP_PERMISSION_SMS_OPT_IN_TIME:null,FANSHOP_PERMISSION_SMS_SIGNUP_SOURCE:null,YOUTH_PERMISSION:null,YOUTH_PERMISSION_LAST_UPDATED:null,YOUTH_PERMISSION_LATEST_SOURCE:null,YOUTH_PERMISSION_OPT_IN_TIME:null,YOUTH_PERMISSION_SIGNUP_SOURCE:null,YOUTH_PERMISSION_APP:null,YOUTH_PERMISSION_APP_LAST_UPDATED:null,YOUTH_PERMISSION_APP_LATEST_SOURCE:null,YOUTH_PERMISSION_APP_OPT_IN_TIME:null,YOUTH_PERMISSION_APP_SIGNUP_SOURCE:null,YOUTH_PERMISSION_SMS:null,YOUTH_PERMISSION_SMS_LAST_UPDATED:null,YOUTH_PERMISSION_SMS_LATEST_SOURCE:null,YOUTH_PERMISSION_SMS_OPT_IN_TIME:null,YOUTH_PERMISSION_SMS_SIGNUP_SOURCE:null,FANPANEL_PERMISSION:null,FANPANEL_PERMISSION_LAST_UPDATED:null,FANPANEL_PERMISSION_LATEST_SOURCE:null,FANPANEL_PERMISSION_OPT_IN_TIME:null,FANPANEL_PERMISSION_SIGNUP_SOURCE:null,FANPANEL_PERMISSION_APP:null,FANPANEL_PERMISSION_APP_LAST_UPDATED:null,FANPANEL_PERMISSION_APP_LATEST_SOURCE:null,FANPANEL_PERMISSION_APP_OPT_IN_TIME:null,FANPANEL_PERMISSION_APP_SIGNUP_SOURCE:null,FANPANEL_PERMISSION_SMS:null,FANPANEL_PERMISSION_SMS_LAST_UPDATED:null,FANPANEL_PERMISSION_SMS_LATEST_SOURCE:null,FANPANEL_PERMISSION_SMS_OPT_IN_TIME:null,FANPANEL_PERMISSION_SMS_SIGNUP_SOURCE:null,PARTNER_PERMISSION:null,PARTNER_PERMISSION_LAST_UPDATED:null,PARTNER_PERMISSION_LATEST_SOURCE:null,PARTNER_PERMISSION_OPT_IN_TIME:null,PARTNER_PERMISSION_SIGNUP_SOURCE:null,PARTNER_PERMISSION_APP:null,PARTNER_PERMISSION_APP_LAST_UPDATED:null,PARTNER_PERMISSION_APP_LATEST_SOURCE:null,PARTNER_PERMISSION_APP_OPT_IN_TIME:null,PARTNER_PERMISSION_APP_SIGNUP_SOURCE:null,PARTNER_PERMISSION_SMS:null,PARTNER_PERMISSION_SMS_LAST_UPDATED:null,PARTNER_PERMISSION_SMS_LATEST_SOURCE:null,PARTNER_PERMISSION_SMS_OPT_IN_TIME:null,PARTNER_PERMISSION_SMS_SIGNUP_SOURCE:null,TEAM_PREFERENCE_MENS:null,TEAM_PREFERENCE_WOMENS:null,TEAM_PREFERENCE_TALENT:null,LANGUAGE:null,COMPLAINT:null,COMPLAINT_DATE:null,COMPLAINT_WITHDRAWN:null}}},created(){this.getPermissions()},methods:{confirmUserUnsubscribe(){this.confirmingUserUnsubscribe=!0},closeModal(){this.confirmingUserUnsubscribe=!1},isCurrentUser(){var n;return this.users.id===((n=this.$page.props.user)==null?void 0:n.id)},getPermissions(){this.fetching=!0;const n=this.isCurrentUser()?"/user/permissions":`/admin/users/${this.users.id}/permissions`;return axios.get(n).then(e=>{this.permissions=e.data.personData,this.fetching=!1}).then(()=>{this.ready=!0})},unsubscribe(){this.fetching=!0;const n=this.isCurrentUser()?"/user/permissions/unsubscribe":`/admin/users/${this.users.id}/permissions/unsubscribe`;return axios.get(n).then(e=>{this.permissions=e.data.personData,this.fetching=!1,this.ready=!0,this.closeModal()}).catch(e=>{this.ready=!0})},setPermissions(n,e){this.fetching=!0;var t={signUp:!1};if(this.ready){this.ready=!1;var r=`${e}_OPT_IN_TIME`,i=this.permissions[r];t.value=n,t.permissionType=e,i===null&&n===!0&&(t.signUp=!0);const a=this.isCurrentUser()?"/user/permissions":`/admin/users/${this.users.id}/permissions`;return axios.put(a,t).then(s=>{Object.keys(s.data.personData).forEach(o=>{this.permissions[o]=s.data.personData[o]}),this.ready=!0}).catch(s=>{this.ready=!0})}},async toggleAllChannels(n,e){if(!this.ready)return;const t=[n,`${n}_APP`,`${n}_SMS`],r=[];for(const a of t){if(this.permissions[a]===e)continue;const s=`${a}_OPT_IN_TIME`,o=this.permissions[s];r.push({value:e,permissionType:a,signUp:o===null&&e===!0})}if(r.length===0)return;this.ready=!1,this.fetching=!0;const i=this.isCurrentUser()?"/user/permissions":`/admin/users/${this.users.id}/permissions`;try{const a=await axios.put(i,{permissions:r});
3927Object.keys(a.data.personData).forEach(s=>{this.permissions[s]=a.data.personData[s]}),await this.$nextTick()}catch(a){console.error(`Failed to update ${n} channels:`,a)}this.fetching=!1,this.ready=!0}},watch:{"permissions.MARKETING_CONSENT":function(n,e){this.setPermissions(n,"MARKETING_CONSENT")},"permissions.GENERAL_PERMISSION":function(n,e){this.setPermissions(n,"GENERAL_PERMISSION")},"permissions.GENERAL_PERMISSION_APP":function(n,e){this.setPermissions(n,"GENERAL_PERMISSION_APP")},"permissions.GENERAL_PERMISSION_SMS":function(n,e){this.setPermissions(n,"GENERAL_PERMISSION_SMS")},"permissions.FANSHOP_PERMISSION":function(n,e){this.setPermissions(n,"FANSHOP_PERMISSION")},"permissions.FANSHOP_PERMISSION_APP":function(n,e){this.setPermissions(n,"FANSHOP_PERMISSION_APP")},"permissions.FANSHOP_PERMISSION_SMS":function(n,e){this.setPermissions(n,"FANSHOP_PERMISSION_SMS")},"permissions.YOUTH_PERMISSION":function(n,e){this.setPermissions(n,"YOUTH_PERMISSION")},"permissions.YOUTH_PERMISSION_APP":function(n,e){this.setPermissions(n,"YOUTH_PERMISSION_APP")},"permissions.YOUTH_PERMISSION_SMS":function(n,e){this.setPermissions(n,"YOUTH_PERMISSION_SMS")},"permissions.FANPANEL_PERMISSION":function(n,e){this.setPermissions(n,"FANPANEL_PERMISSION")},"permissions.FANPANEL_PERMISSION_APP":function(n,e){this.setPermissions(n,"FANPANEL_PERMISSION_APP")},"permissions.FANPANEL_PERMISSION_SMS":function(n,e){this.setPermissions(n,"FANPANEL_PERMISSION_SMS")},"permissions.PARTNER_PERMISSION":function(n,e){this.setPermissions(n,"PARTNER_PERMISSION")},"permissions.PARTNER_PERMISSION_APP":function(n,e){this.setPermissions(n,"PARTNER_PERMISSION_APP")},"permissions.PARTNER_PERMISSION_SMS":function(n,e){this.setPermissions(n,"PARTNER_PERMISSION_SMS")},"permissions.TEAM_PREFERENCE_MENS":function(n,e){this.setPermissions(n,"TEAM_PREFERENCE_MENS")},"permissions.TEAM_PREFERENCE_WOMENS":function(n,e){this.setPermissions(n,"TEAM_PREFERENCE_WOMENS")},"permissions.TEAM_PREFERENCE_TALENT":function(n,e){this.setPermissions(n,"TEAM_PREFERENCE_TALENT")},"permissions.LANGUAGE":function(n,e){this.setPermissions(n,"LANGUAGE")}}};var ORe=function(){var e=this,t=e._self._c;return t("jet-action-section-no-box",{scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.$trans("users.permission.title"))+" ")]},proxy:!0},{key:"description",fn:function(){return[e._v(" "+e._s(e.$trans("users.permission.description"))+" ")]},proxy:!0},{key:"content",fn:function(){var r,i;return[t("div",{staticClass:"mt-5 md:mt-0 md:col-span-2"},[t("div",{staticClass:"px-4 py-5 sm:p-6 bg-white shadow-xl sm:rounded-lg"},[t("div",{staticClass:"max-w-xl"},[t("h4",{staticClass:"text-lg font-medium text-gray-900 font-regular"},[e._v(" "+e._s(e.$trans("users.permission.teamPreferencesTitle"))+" ")]),t("p",{staticClass:"text-sm text-gray-500 mb-4"},[e._v(e._s(e.$trans("users.permission.teamPreferencesDescription")))]),t("div",{staticClass:"space-y-4"},[t("jet-toggle",{attrs:{id:"team-mens",label:e.$trans("users.permission.teamMens")},model:{value:e.permissions.TEAM_PREFERENCE_MENS,callback:function(a){e.$set(e.permissions,"TEAM_PREFERENCE_MENS",a)},expression:"permissions.TEAM_PREFERENCE_MENS"}}),t("jet-toggle",{attrs:{id:"team-womens",label:e.$trans("users.permission.teamWomens")},model:{value:e.permissions.TEAM_PREFERENCE_WOMENS,callback:function(a){e.$set(e.permissions,"TEAM_PREFERENCE_WOMENS",a)},expression:"permissions.TEAM_PREFERENCE_WOMENS"}}),t("jet-toggle",{attrs:{id:"team-talent",label:e.$trans("users.permission.teamTalent")},model:{value:e.permissions.TEAM_PREFERENCE_TALENT,callback:function(a){e.$set(e.permissions,"TEAM_PREFERENCE_TALENT",a)},expression:"permissions.TEAM_PREFERENCE_TALENT"}})],1)])]),t("div",{staticClass:"mt-5 px-4 py-5 sm:p-6 bg-white shadow-xl sm:rounded-lg"},[t("div",{staticClass:"max-w-xl"},[t("h4",{staticClass:"text-lg font-medium text-gray-900 font-regular"},[e._v(" "+e._s(e.$trans("users.permission.languagePreferenceTitle"))+" ")]),t("p",{staticClass:"text-sm text-gray-500 mb-4"},[e._v(e._s(e.$trans("users.permission.languagePreferenceDescription")))]),t("div",[t("label",{staticClass:"block text-sm font-medium text-gray-700 mb-1",attrs:{for:"language"}},[e._v(" "+e._s(e.$trans("users.permission.languageLabel"))+" ")]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.permissions.LANGUAGE,expression:"permissions.LANGUAGE"}],staticClass:"mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-fck-blue focus:border-fck-blue sm:text-sm rounded-md",attrs:{id:"language"},on:{change:function(a){var s=Array.prototype.filter.call(a.target.options,function(o){return o.selected}).map(function(o){var c="_value"in o?o._value:o.value;return c});e.$set(e.permissions,"LANGUAGE",a.target.multiple?s:s[0])}}},[t("option",{attrs:{value:"da-DK"}},[e._v(e._s(e.$trans("users.permission.languageDanish")))]),t("option",{attrs:{value:"en-GB"}},[e._v(e._s(e.$trans("users.permission.languageEnglish")))])])])])]),t("div",{staticClass:"mt-5 px-4 py-5 sm:p-6 bg-white shadow-xl sm:rounded-lg"},[t("div",{staticClass:"max-w-xl"},[t("h4",{staticClass:"text-lg font-medium text-gray-900 font-regular"},[e._v(" "+e._s(e.$trans("users.permission.communicationPreferencesTitle"))+" ")]),t("p",{staticClass:"text-sm text-gray-500 mb-4"},[e._v(e._s(e.$trans("users.permission.communicationPreferencesDescription")))]),t("div",{staticClass:"space-y-4"},[t("div",{staticClass:"bg-gray-50 rounded-xl p-4"},[t("PermissionCategory",{attrs:{id:"general",title:e.$trans("users.permission.generalTitle"),description:e.$trans("users.permission.generalDescription"),"email-enabled":e.permissions.GENERAL_PERMISSION,"app-enabled":e.permissions.GENERAL_PERMISSION_APP,"sms-enabled":e.permissions.GENERAL_PERMISSION_SMS,disabled:!e.permissions.MARKETING_CONSENT},on:{"update:email":a=>e.permissions.GENERAL_PERMISSION=a,"update:app":a=>e.permissions.GENERAL_PERMISSION_APP=a,"update:sms":a=>e.permissions.GENERAL_PERMISSION_SMS=a,"toggle-all":a=>e.toggleAllChannels("GENERAL_PERMISSION",a)}}
3927)],1),t("div",{staticClass:"bg-gray-50 rounded-xl p-4"},[t("PermissionCategory",{attrs:{id:"fanshop",title:e.$trans("users.permission.fanshopTitle"),description:e.$trans("users.permission.fanshopDescription"),"email-enabled":e.permissions.FANSHOP_PERMISSION,"app-enabled":e.permissions.FANSHOP_PERMISSION_APP,"sms-enabled":e.permissions.FANSHOP_PERMISSION_SMS,disabled:!e.permissions.MARKETING_CONSENT},on:{"update:email":a=>e.permissions.FANSHOP_PERMISSION=a,"update:app":a=>e.permissions.FANSHOP_PERMISSION_APP=a,"update:sms":a=>e.permissions.FANSHOP_PERMISSION_SMS=a,"toggle-all":a=>e.toggleAllChannels("FANSHOP_PERMISSION",a)}})],1),t("div",{staticClass:"bg-gray-50 rounded-xl p-4"},[t("PermissionCategory",{attrs:{id:"youth",title:e.$trans("users.permission.youthTitle"),description:e.$trans("users.permission.youthDescription"),"email-enabled":e.permissions.YOUTH_PERMISSION,"app-enabled":e.permissions.YOUTH_PERMISSION_APP,"sms-enabled":e.permissions.YOUTH_PERMISSION_SMS,disabled:!e.permissions.MARKETING_CONSENT},on:{"update:email":a=>e.permissions.YOUTH_PERMISSION=a,"update:app":a=>e.permissions.YOUTH_PERMISSION_APP=a,"update:sms":a=>e.permissions.YOUTH_PERMISSION_SMS=a,"toggle-all":a=>e.toggleAllChannels("YOUTH_PERMISSION",a)}})],1),t("div",{staticClass:"bg-gray-50 rounded-xl p-4"},[t("PermissionCategory",{attrs:{id:"fanpanel",title:e.$trans("users.permission.fanpanelTitle"),description:e.$trans("users.permission.fanpanelDescription"),"email-enabled":e.permissions.FANPANEL_PERMISSION,"app-enabled":e.permissions.FANPANEL_PERMISSION_APP,"sms-enabled":e.permissions.FANPANEL_PERMISSION_SMS,disabled:!e.permissions.MARKETING_CONSENT},on:{"update:email":a=>e.permissions.FANPANEL_PERMISSION=a,"update:app":a=>e.permissions.FANPANEL_PERMISSION_APP=a,"update:sms":a=>e.permissions.FANPANEL_PERMISSION_SMS=a,"toggle-all":a=>e.toggleAllChannels("FANPANEL_PERMISSION",a)}})],1),(i=(r=e.$page.props.user)==null?void 0:r.roles)!=null&&i.some(a=>a.name==="Partner")?t("div",{staticClass:"bg-gray-50 rounded-xl p-4"},[t("PermissionCategory",{attrs:{id:"partner",title:e.$trans("users.permission.partnerTitle"),description:e.$trans("users.permission.partnerDescription"),"email-enabled":e.permissions.PARTNER_PERMISSION,"app-enabled":e.permissions.PARTNER_PERMISSION_APP,"sms-enabled":e.permissions.PARTNER_PERMISSION_SMS,disabled:!e.permissions.MARKETING_CONSENT},on:{"update:email":a=>e.permissions.PARTNER_PERMISSION=a,"update:app":a=>e.permissions.PARTNER_PERMISSION_APP=a,"update:sms":a=>e.permissions.PARTNER_PERMISSION_SMS=a,"toggle-all":a=>e.toggleAllChannels("PARTNER_PERMISSION",a)}})],1):e._e()])])]),t("div",{staticClass:"mt-5 px-4 py-5 sm:p-6 bg-white shadow-xl sm:rounded-lg"},[t("div",{staticClass:"max-w-xl"},[t("jet-toggle",{staticClass:"mt-4",attrs:{id:"consent",label:e.$trans("users.permission.consentTitle")},model:{value:e.permissions.MARKETING_CONSENT,callback:function(a){e.$set(e.permissions,"MARKETING_CONSENT",a)},expression:"permissions.MARKETING_CONSENT"}},[t("p",{staticClass:"text-sm text-gray-600"},[e._v(" "+e._s(e.$trans("pages.register.agree2"))+" "),t("a",{staticClass:"underline text-sm text-gray-600 hover:text-gray-900 consent-text",attrs:{target:"_blank",href:"https://www.fck.dk/samtykke"}},[e._v(e._s(e.$trans("pages.register.consent")))]),e._v(". "+e._s(e.$trans("pages.register.agree3"))+" ")])]),t("a",{staticClass:"mt-4 text-sm text-gray-600 hover:text-gray-900",staticStyle:{display:"flex","align-items":"center"},attrs:{href:"https://www.fck.dk/privatlivspolitik",target:"_blank"}},[e._v(" Link: "+e._s(e.$trans("users.permission.privacyTitle"))+" "),t("svg",{staticClass:"h-4 w-4 ml-1",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}}),t("path",{attrs:{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}})])]),e.permissions.COMPLAINT?t("div",{staticClass:"bg-red-100 border-t-4 border-red-500 rounded-b text-red-900 px-4 py-3 shadow-md mt-6",attrs:{role:"alert"}},[t("div",{staticClass:"flex"},[t("div",{staticClass:"py-1"},[t("svg",{staticClass:"fill-current h-6 w-6 text-red-500 mr-4",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[t("path",{attrs:{d:"M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM9 11V9h2v6H9v-4zm0-6h2v2H9V5z"}})])]),t("div",[t("p",{staticClass:"text-sm"},[e._v(e._s(e.$trans("users.permission.complaintText")))])])])]):e._e(
3927)],1)]),t("div",{staticClass:"mt-5 px-4 py-5 sm:p-6 bg-white shadow-xl sm:rounded-lg"},[t("div",{staticClass:"max-w-xl text-sm text-gray-600"},[t("h4",{staticClass:"text-lg font-medium text-gray-900 font-regular"},[e._v(e._s(e.$trans("users.permission.unsubscribeTitle")))]),t("p",{staticClass:"mb-5"},[e._v(e._s(e.$trans("users.permission.unsubscribeDescription")))]),t("jet-danger-button",{on:{close:e.closeModal},nativeOn:{click:function(a){return e.confirmUserUnsubscribe.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("users.permission.unsubscribeButton"))+" ")]),t("jet-confirmation-modal",{attrs:{show:e.confirmingUserUnsubscribe},on:{close:function(a){e.confirmingUserUnsubscribe=!1}},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.$trans("users.permission.unsubscribeTitle"))+" ")]},proxy:!0},{key:"content",fn:function(){return[e._v(" "+e._s(e.$trans("users.permission.unsubscribeDescription"))+" ")]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(a){e.confirmingUserUnsubscribe=!1}}},[e._v(" "+e._s(e.$trans("users.permission.unsubscribeCancelButton"))+" ")]),t("jet-danger-button",{staticClass:"ml-2",nativeOn:{click:function(a){return e.unsubscribe.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("users.permission.unsubscribeButton"))+" ")])]},proxy:!0}])})],1)])])]},proxy:!0}])})},MRe=[],DRe=ve(IRe,ORe,MRe,!1,null,null);const JE=DRe.exports,NRe=Object.freeze(Object.defineProperty({__proto__:null,default:JE},Symbol.toStringTag,{value:"Module"})),LRe={props:{usageStats:{type:[Object,Array],default:null},error:{type:String,default:null},seasonTicketId:{type:String,default:null},id:{type:[String,Number],default:null}},data(){return{localUsageStats:this.usageStats,fetching:!1,localError:this.error,expandedSeasons:{}}},created(){!this.usageStats&&!this.error&&this.loadUsageStats()},computed:{currentUsageStats(){return this.localUsageStats||this.usageStats},currentError(){return this.localError||this.error},isArrayData(){return Array.isArray(this.currentUsageStats)},aggregatedStats(){if(!this.currentUsageStats)return null;if(this.isArrayData){let n=0,e=0;const t=[],r=[],i=new Map;
3927this.currentUsageStats.forEach(s=>{const o=s.usage_stats;if(Array.isArray(o)){let c=0,u=0;o.forEach(l=>{c+=l.total_games||0,u+=l.attended_games||0,i.has(l.season)||i.set(l.season,{season:l.season,total_games:0,attended_games:0});const d=i.get(l.season);d.total_games+=l.total_games||0,d.attended_games+=l.attended_games||0,l.games&&Array.isArray(l.games)&&r.push(...l.games.map(h=>({...h,season:l.season,season_ticket_name:s.season_ticket_name})))}),n+=c,e+=u,t.push({id:s.season_ticket_id,name:s.season_ticket_name,total_games:c,attended:u,missed:c-u,section:"Season Ticket"})}else o&&typeof o=="object"&&(n+=o.total_games||0,e+=o.attended_games||0,t.push({id:s.season_ticket_id,name:s.season_ticket_name,total_games:o.total_games||0,attended:o.attended_games||0,missed:(o.total_games||0)-(o.attended_games||0),section:"Season Ticket"}),o.games&&Array.isArray(o.games)&&r.push(...o.games.map(c=>({...c,season_ticket_name:s.season_ticket_name}))))});const a=Array.from(i.values()).map(s=>({...s,usage_percentage:s.total_games>0?Math.round(s.attended_games/s.total_games*100):0}));return{total_games:n,games_attended:e,season_tickets:t,recent_games:r.slice(-10),seasons:a.sort((s,o)=>s.season.localeCompare(o.season))}}else if(Array.isArray(this.currentUsageStats)){let n=0,e=0;const t=[];
3927return this.currentUsageStats.forEach(r=>{n+=r.total_games||0,e+=r.attended_games||0,r.games&&Array.isArray(r.games)&&t.push(...r.games.map(i=>({...i,season:r.season})))}),{total_games:n,games_attended:e,games:t,seasons:this.currentUsageStats.map(r=>({season:r.season,total_games:r.total_games,attended_games:r.attended_games,usage_percentage:r.usage_percentage}))}}else return this.currentUsageStats},usagePercentage(){const n=this.aggregatedStats;return!n||!n.total_games?0:Math.round(n.games_attended/n.total_games*100)},allGames(){if(!this.currentUsageStats)return[];let n=[];return this.isArrayData?this.currentUsageStats.forEach(e=>{const t=e.usage_stats;Array.isArray(t)?t.forEach(r=>{r.games&&Array.isArray(r.games)&&n.push(...r.games.map(i=>({...i,season:r.season,season_ticket_name:e.season_ticket_name})))}):t&&t.games&&n.push(...t.games.map(r=>({...r,season_ticket_name:e.season_ticket_name})))}):Array.isArray(this.currentUsageStats)?this.currentUsageStats.forEach(e=>{e.games&&Array.isArray(e.games)&&n.push(...e.games.map(t=>({...t,season:e.season})))}):this.currentUsageStats.games&&(n=[...this.currentUsageStats.games]),n.sort((e,t)=>new Date(t.date)-new Date(e.date))},gamesBySeason(){const n=this.allGames;if(!n||n.length===0)return[];const e={};return n.forEach(t=>{const r=t.season||"Unknown";e[r]||(e[r]={season:r,games:[],attended:0,total:0}),e[r].games.push(t),!t.is_future&&t.attended!==null&&(e[r].total++,t.attended&&e[r].attended++)}),Object.values(e).map(t=>({...t,percentage:t.total>0?Math.round(t.attended/t.total*100):0})).sort((t,r)=>r.season.localeCompare(t.season))}},methods:{async loadUsageStats(){var n,e;this.fetching=!0,this.localError=null;try{let t;this.id?t=this.seasonTicketId?`/admin/users/${this.id}/season-ticket-usage/${this.seasonTicketId}`:`/admin/users/${this.id}/season-ticket-usage`:t=this.seasonTicketId?`/user/season-ticket-usage/${this.seasonTicketId}`:"/user/season-ticket-usage";const r=await axios.get(t);r.data.success?this.localUsageStats=r.data.usage_stats:this.localError=r.data.error||"Failed to load usage statistics"}catch(t){this.localError=((e=(n=t.response)==null?void 0:n.data)==null?void 0:e.error)||"Failed to load usage statistics"}finally{this.fetching=!1}},getTicketUsagePercentage(n){return n.total_games?Math.round(n.attended/n.total_games*100):0},formatDate(n){return Le(n).format("DD/MM/YYYY")},getBadgeClass(n){return n.is_future?n.case==="cancelled_early"||n.case==="cancelled_late"||n.case==="converted_cancelled"?"bg-orange-100 text-orange-800":n.case==="converted_to_ticket"?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800":n.case==="cancelled_early"?"bg-green-100 text-green-800":n.case==="cancelled_late"?"bg-red-100 text-red-800":n.attended?"bg-green-100 text-green-800":"bg-red-100 text-red-800"},toggleSeason(n){this.$set(this.expandedSeasons,n,!this.expandedSeasons[n])},isSeasonExpanded(n,e){return this.expandedSeasons[n]!==void 0?this.expandedSeasons[n]:e===0},getBadgeText(n){return n.case==="cancelled_early"?this.$trans("pages.tickets.cancelled_early"):n.case==="cancelled_late"?this.$trans("pages.tickets.cancelled_late"):n.case==="converted_cancelled"?this.$trans("pages.tickets.converted_cancelled"):n.case==="converted_to_ticket"?this.$trans("pages.tickets.converted_ticket"):this.$trans("pages.tickets.upcoming")}}};var FRe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mb-6"},[t("h1",{staticClass:"border-l-4 border-fck-blue text-2xl pl-2 line normal-case leading-lg font-black mb-3"},[e._v(e._s(e.$trans("pages.tickets.usage_statistics")))]),t("div",{staticClass:"bg-white overflow-hidden shadow-sm border border-gray-100 rounded-lg"},[e.fetching?t("div",{staticClass:"p-6"},[t("div",{staticClass:"animate-pulse"},[t("div",{staticClass:"h-6 bg-gray-200 rounded w-1/3 mb-4"}),t("div",{staticClass:"grid grid-cols-1 md:grid-cols-3 gap-4"},e._l(3,function(r){return t("div",{key:r,staticClass:"bg-gray-100 rounded-lg p-4"},[t("div",{staticClass:"h-4 bg-gray-200 rounded w-1/2 mb-2"}),t("div",{staticClass:"h-8 bg-gray-200 rounded w-3/4"})])}),0)])]):e.aggregatedStats?t("div",{staticClass:"p-4"},[e.gamesBySeason&&e.gamesBySeason.length>0?t("div",{},[t("h4",{staticClass:"text-md font-semibold text-gray-900 mb-4"},[e._v(e._s(e.$trans("pages.tickets.games_list")))]),t("div",{staticClass:"space-y-3"},e._l(e.gamesBySeason,function(r,i){return t("div",{key:r.season,staticClass:"bg-white shadow overflow-hidden sm:rou
3927nded-md border border-gray-200"},[t("button",{staticClass:"w-full px-6 py-4 flex items-center justify-between bg-gray-50 hover:bg-gray-100 transition-colors cursor-pointer",on:{click:function(a){return e.toggleSeason(r.season)}}},[t("div",{staticClass:"flex items-center space-x-3"},[t("svg",{staticClass:"w-5 h-5 text-gray-500 transition-transform duration-200",class:{"rotate-90":e.isSeasonExpanded(r.season,i)},attrs:{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"}})]),t("h5",{staticClass:"text-sm font-semibold text-gray-900"},[e._v("Season "+e._s(r.season))])]),t("div",{staticClass:"flex items-center space-x-4"},[t("span",{staticClass:"text-xs text-gray-500"},[e._v(" "+e._s(r.attended)+"/"+e._s(r.total)+" "+e._s(e.$trans("pages.tickets.attended").toLowerCase())+" ")]),t("span",{staticClass:"text-xs font-medium px-2 py-1 rounded-full",class:r.percentage>=50?"bg-green-100 text-green-800":"bg-red-100 text-red-800"},[e._v(" "+e._s(r.percentage)+"% ")])])]),t("ul",{directives:[{name:"show",rawName:"v-show",value:e.isSeasonExpanded(r.season,i),expression:"isSeasonExpanded(seasonGroup.season, index)"}],staticClass:"divide-y divide-gray-200"},e._l(r.games,function(a){return t("li",{key:a.id,staticClass:"px-4 sm:px-6 py-4 hover:bg-gray-50"},[t("div",{staticClass:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2"},[t("div",{staticClass:"flex items-start sm:items-center space-x-3 sm:space-x-4"},[t("div",{staticClass:"flex-shrink-0 mt-1.5 sm:mt-0"},[t("div",{staticClass:"w-3 h-3 rounded-full",class:a.is_future?"bg-gray-400":a.attended?"bg-green-500":"bg-red-500"})]),t("div",{staticClass:"flex-1 min-w-0"},[t("p",{staticClass:"text-sm font-medium text-gray-900"},[e._v(" "+e._s(a.name)+" ")]),t("p",{staticClass:"text-sm text-gray-500"},[e._v(" "+e._s(e.formatDate(a.date))+" ")]),t("p",{staticClass:"text-xs text-gray-400"},[e._v(" "+e._s(a.season_ticket_name)+" ")])])]),t("div",{staticClass:"flex items-center justify-between sm:justify-end gap-3 flex-wrap pl-6 sm:pl-0"},[t("div",{staticClass:"text-xs text-gray-500"},[a.case==="regular_attendance"?t("span",{staticClass:"text-green-600"},[e._v(" "+e._s(a.is_future?e.$trans("pages.tickets.upcoming")+" - ":"")+e._s(e.$trans("pages.tickets.season_ticket_used"))+" ")]):a.case==="converted_to_ticket"?t("span",{staticClass:"text-blue-600"},[e._v(" "+e._s(a.is_future?e.$trans("pages.tickets.upcoming")+" - ":"")+e._s(e.$trans("pages.tickets.converted_ticket"))+" ")]):a.case==="converted_cancelled"?t("span",{staticClass:"text-green-600"},[e._v(" "+e._s(a.is_future?e.$trans("pages.tickets.upcoming")+" - ":"")+e._s(e.$trans("pages.tickets.converted_cancelled"))+" ")]):a.case==="cancelled_early"?t("span",{staticClass:"text-gray-600"},[e._v(" "+e._s(a.is_future?e.$trans("pages.tickets.upcoming")+" - ":"")+e._s(e.$trans("pages.tickets.cancelled_early"))+" ")]):a.case==="cancelled_late"?t("span",{staticClass:"text-red-600"},[e._v(" "+e._s(a.is_future?e.$trans("pages.tickets.upcoming")+" - ":"")+e._s(e.$trans("pages.tickets.cancelled_late"))+" ")]):a.case==="other"?t("span",{staticClass:"text-gray-600"},[e._v(" "+e._s(a.is_future?e.$trans("pages.tickets.upcoming")+" - ":"")+e._s(e.$trans("pages.tickets.not_attended"))+" ")]):t("span",{staticClass:"text-blue-500"},[e._v(" "+e._s(e.$trans("pages.tickets.upcoming"))+" ")])]),t("span",{staticClass:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium whitespace-nowrap flex-shrink-0",class:e.getBadgeClass(a)},[a.is_future?t("span",[e._v(e._s(e.getBadgeText(a)))]):a.case==="cancelled_early"?t("span",[e._v(e._s(e.$trans("pages.tickets.attended")))]):a.case==="cancelled_late"?t("span",[e._v(e._s(e.$trans("pages.tickets.missed")))]):t("span",[e._v(e._s(a.attended?e.$trans("pages.tickets.attended"):e.$trans("pages.tickets.missed")))])])])])])}),0)])}),0)]):e._e()]):e.currentError?t("div",{staticClass:"p-6 text-center"},[t("div",{staticClass:"text-red-600 mb-2"},[t("svg",{staticClass:"w-12 h-12 mx-auto mb-4",attrs:{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-9 2a9 9 0 1118 0 9 9 0 01-18 0z"}})])]),t("h3",{staticClass:"text-lg font-medium text-gray-900 mb-2"},[e._v(e._s(e.$trans("pages.tickets.error_loading_stats")))]),t("p",{staticClass:"text-sm text-gray-600 mb-4"},[e._v(e._s(e.currentError))]),t("button",{staticClass:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-[#002D62] hover:bg-blue-900",on:{click:e.loadUsageStats}},[e._v(" "+e._s(e.$trans("pages.tickets.retry"))+" ")])]):t("div",{staticClass:"p-6 text-center"},[t("svg",{staticClass:"w-12 h-12 mx-auto mb-4 text-gray-400",attrs:{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v4"}})]),t("h3",{staticClass:"text-lg font-medium text-gray-900 mb-2"},[e._v(e._s(e.$trans("pages.tickets.no_usage_data")))]),t("p",{staticClass:"text-sm text-gray-600"},[e._v(e._s(e.$trans("pages.tickets.no_usage_data_description")))])])])])},$Re=[],BRe=ve(LRe,FRe,$Re,!1,null,"df6776ba");const QE=BRe.exports,URe={components:{AppLayout:ta,SeasonTicketUsageStats:QE}};var jRe=function(){var e=this,t=e._self._c;return t("app-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"},[t("h2",{staticClass:"font-sans text-2xl text-[#002D62] leading-10 font-bold"},[e._v(" "+e._s(e.$trans("pages.tickets.usage_statistics"))+" ")])])]},proxy:!0}])},[t("div",{staticClass:"py-8"},[t("div",{staticClass:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"},[t("div",{staticClass:"space-y-6"},[t("season-ticket-usage-stats")],1)])])])},qRe=[],zRe=ve(URe,jRe,qRe,!1,null,null);const WRe=zRe.exports,HRe=Object.freeze(Object.defineProperty({__proto__:null,default:WRe},Symbol.toStringTag,{value:"Module"})),VRe={components:{JetActionSection:Tp,JetButton:mn,JetConfirmsPassword:kv,JetDangerButton:vo,JetSecondaryButton:Br},data(){return{enabling:!1,disabling:!1,qrCode:null,recoveryCodes:[]}},methods:{enableTwoFactorAuthentication(){this.enabling=!0,this.$inertia.post("/user/two-factor-authentication",{},{preserveScroll:!0,onSuccess:()=>Promise.all([this.showQrCode(),this.showRecoveryCodes()]),onFinish:()=>this.enabling=!1})},showQrCode(){return axios.get("/user/two-factor-qr-code").then(n=>{this.qrCode=n.data.svg})},showRecoveryCodes(){return axios.get("/user/two-factor-recovery-codes").then(n=>{this.recoveryCodes=n.data})},regenerateRecoveryCodes(){axios.post("/user/two-factor-recovery-codes").then(n=>{this.showRecoveryCodes()})},disableTwoFactorAuthentication(){this.disabling=!0,this.$inertia.delete("/user/two-factor-authentication",{preserveScroll:!0,onSuccess:()=>this.disabling=!1})}},computed:{twoFactorEnabled(){return!this.enabling&&this.$page.props.user.two_factor_enabled}}};var GRe=function(){var e=this,t=e._self._c;return t("jet-action-section",{scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" To-faktor godkendelse ")]},proxy:!0},{key:"description",fn:function(){return[e._v(" Få ekstra sikkerhed på din konto ved at aktivere to-faktor godkendelse. ")]},proxy:!0}
3927,{key:"content",fn:function(){return[e.twoFactorEnabled?t("h3",{staticClass:"text-lg font-medium text-gray-900"},[e._v(" Du har slået to-faktor godkendelse til. ")]):t("h3",{staticClass:"text-lg font-medium text-gray-900"},[e._v(" Du har slået to-faktor godkendelse fra. ")]),t("div",{staticClass:"mt-3 max-w-xl text-sm text-gray-600"},[t("p",[e._v(" Når to-faktor godkendelse er slået til, vil du blive bedt om at indtaste en sikker, unik engangskode når du logger ind. Du kan finde denne engangskode i din to-faktor app på din telefon. ")])]),e.twoFactorEnabled?t("div",[e.qrCode?t("div",[t("div",{staticClass:"mt-4 max-w-xl text-sm text-gray-600"},[t("p",{staticClass:"font-semibold"},[e._v(" To faktor er nu slået til. Scan den følgende QR code med din to-faktor app på in telefon. ")])]),t("div",{staticClass:"mt-4 dark:p-4 dark:w-56 dark:bg-white",domProps:{innerHTML:e._s(e.qrCode)}})]):e._e(),e.recoveryCodes.length>0?t("div",[t("div",{staticClass:"mt-4 max-w-xl text-sm text-gray-600"},[t("p",{staticClass:"font-semibold"},[e._v(" Gem disse gendannelseskoder i en password manager eller i et dokument du kan finde igen. Du kan bruge disse til at gendanne adgangen til din konto i tilfælde af at du skulle miste din telefon med to-faktor app. ")])]),t("div",{staticClass:"grid gap-1 max-w-xl mt-4 px-4 py-4 font-mono text-sm bg-gray-100 rounded-lg"},e._l(e.recoveryCodes,function(r){return t("div",{key:r},[e._v(" "+e._s(r)+" ")])}),0)]):e._e()]):e._e(),t("div",{staticClass:"mt-5"},[e.twoFactorEnabled?t("div",[t("jet-confirms-password",{on:{confirmed:e.regenerateRecoveryCodes}},[e.recoveryCodes.length>0?t("jet-secondary-button",{staticClass:"mr-3"},[e._v(" Regenerer gendannelseskoder ")]):e._e()],1),t("jet-confirms-password",{on:{confirmed:e.showRecoveryCodes}},[e.recoveryCodes.length===0?t("jet-secondary-button",{staticClass:"mr-3"},[e._v(" Vis gendannelskoder ")]):e._e()],1),t("jet-confirms-password",{on:{confirmed:e.disableTwoFactorAuthentication}},[t("jet-danger-button",{class:{"opacity-25":e.disabling},attrs:{disabled:e.disabling}},[e._v(" Slå fra ")])],1)],1):t("div",[t("jet-confirms-password",{on:{confirmed:e.enableTwoFactorAuthentication}},[t("jet-button",{class:{"opacity-25":e.enabling},attrs:{type:"button",disabled:e.enabling}},[e._v(" Slå til ")])],1)],1)])]},proxy:!0}])})},KRe=[],YRe=ve(VRe,GRe,KRe,!1,null,null);const bB=YRe.exports,XRe=Object.freeze(Object.defineProperty({__proto__:null,default:bB},Symbol.toStringTag,{value:"Module"})),JRe={components:{JetActionMessage:tu,JetButton:mn,JetFormSection:rd,JetInput:Rn,JetInputError:ea,JetLabel:Un,JetPassword:Ob,JetPasswordConfirmation:Mb},data(){return{form:this.$inertia.form({current_password:"",password:"",password_confirmation:""})}},methods:{updatePassword(){this.form.put(route("user-password.update"),{errorBag:"updatePassword",preserveScroll:!0,onSuccess:()=>this.form.reset(),onError:()=>{var n,e,t,r;this.form.errors.password&&(this.form.reset("password","password_confirmation"),(e=(n=this.$refs.password)==null?void 0:n.focus)==null||e.call(n)),this.form.errors.current_password&&(this.form.reset("current_password"),(r=(t=this.$refs.current_password)==null?void 0:t.focus)==null||r.call(t))}})}}};var QRe=function(){var e=this,t=e._self._c;return t("jet-form-section",{on:{submitted:e.updatePassword},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.$trans("users.password.title"))+" ")]},proxy:!0},{key:"description",fn:function(){return[e._v(" "+e._s(e.$trans("users.password.description"))+" ")]},proxy:!0},{key:"form",fn:function(){return[t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"current_password",value:e.$trans("users.password.current")}}),t("jet-input",{ref:"current_password",staticClass:"mt-1 block w-full",attrs:{id:"current_password",type:"password",autocomplete:"current-password"},model:{value:e.form.current_password,callback:function(r){e.$set(e.form,"current_password",r)},expression:"form.current_password"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.current_password}})],1),t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-password",{attrs:{label:e.$trans("users.password.new")},model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}}),t("jet-password-confirmation",{attrs:{password:e.form.password,label:e.$trans("users.password.confirm")},model:{value:e.form.password_confirmation,callback:function(r){e.$set(e.form,"password_confirmation",r)},expression:"form.password_confirmation"}})],1)]},proxy:!0},{key:"actions",fn:function(){return[t("jet-action-message",{staticClass:"mr-3",attrs:{on:e.form.recentlySuccessful}},[e._v(" "+e._s(e.$trans("users.users.saved"))+" ")]),t("jet-button",{class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("users.users.save"))+" ")])]},proxy:!0}])})},ZRe=[],eAe=ve(JRe,QRe,ZRe,!1,null,null);const xB=eAe.exports,tAe=Object.freeze(Object.defineProperty({__proto__:null,default:xB},Symbol.toStringTag,{value:"Module"})),nAe={components:{JetActionMessage:tu,JetButton:mn,JetFormSection:rd,JetInput:Rn,JetInputError:ea,JetLabel:Un,JetSecondaryButton:Br,JetPhone:MT},props:["user"],data(){return{form:this.$inertia.form({_method:"PUT",firstname:this.user.firstname,lastname:this.user.lastname,birthday:this.user.birthday,phone:this.user.phone,country_code:this.user.country_code,email:this.user.email,photo:null}),photoPreview:null}},methods:{phoneUpdate({countryCallingCode:n,nationalNumber:e}){this.form.phone=e,this.form.country_code=n},updateProfileInformation(){this.$refs.photo&&(this.form.photo=this.$refs.photo.files[0]),this.form.post(route("user-profile-information.update"),{errorBag:"updateProfileInformation",preserveScroll:!0})},selectNewPhoto(){this.$refs.photo.click()},updatePhotoPreview(){const n=new FileReader;n.onload=e=>{this.photoPreview=e.target.result},n.readAsDataURL(this.$refs.photo.files[0])},deletePhoto(){this.$inertia.delete(route("current-user-photo.destroy"),{preserveScroll:!0,onSuccess:()=>this.photoPreview=null})}}};var rAe=function(){var e=this,t=e._self._c;return t("jet-form-section",{on:{submitted:e.updateProfileInformation},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.$trans("users.profile.title"))+" ")]},proxy:!0},{key:"description",fn:function(){return[e._v(" "+e._s(e.$trans("users.profile.description"))+" ")]},proxy:!0},{key:"form",fn:function(){return[e.$page.props.jetstream.managesProfilePhotos?t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("input",{ref:"photo",staticClass:"hidden",attrs:{type:"file"},on:{change:e.updatePhotoPreview}}),t("jet-label",{attrs:{for:"photo",value:"Photo"}}),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.ph
3927otoPreview,expression:"! photoPreview"}],staticClass:"mt-2"},[t("img",{staticClass:"rounded-full h-20 w-20 object-cover",attrs:{src:e.user.profile_photo_url,alt:e.user.name}})]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.photoPreview,expression:"photoPreview"}],staticClass:"mt-2"},[t("span",{staticClass:"block rounded-full w-20 h-20",style:"background-size: cover; background-repeat: no-repeat; background-position: center center; background-image: url('"+e.photoPreview+"');"})]),t("jet-secondary-button",{staticClass:"mt-2 mr-2",attrs:{type:"button"},nativeOn:{click:function(r){return r.preventDefault(),e.selectNewPhoto.apply(null,arguments)}}},[e._v(" Vælg et nyt billede ")]),e.user.profile_photo_path?t("jet-secondary-button",{staticClass:"mt-2",attrs:{type:"button"},nativeOn:{click:function(r){return r.preventDefault(),e.deletePhoto.apply(null,arguments)}}},[e._v(" Fjern billede ")]):e._e(),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.photo}})],1):e._e(),t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"firstname",value:e.$trans("users.profile.firstname")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"firstname",type:"text",autocomplete:"firstname"},model:{value:e.form.firstname,callback:function(r){e.$set(e.form,"firstname",r)},expression:"form.firstname"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.firstname}})],1),t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"lastname",value:e.$trans("users.profile.lastname")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"lastname",type:"text",autocomplete:"lastname"},model:{value:e.form.lastname,callback:function(r){e.$set(e.form,"lastname",r)},expression:"form.lastname"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.lastname}})],1),t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"birthday",value:e.$trans("users.profile.birthday")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"birthday",type:"date",autocomplete:"birthday"},model:{value:e.form.birthday,callback:function(r){e.$set(e.form,"birthday",r)},expression:"form.birthday"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.birthday}})],1),t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"phone",value:e.$trans("users.profile.phone")}}),t("jet-phone",{staticClass:"mt-1 block w-full border-0 p-0",attrs:{id:"phone",type:"text",initNumber:e.form.phone,initCountry:e.form.country_code},on:{change:e.phoneUpdate}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.phone}})],1),t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"email",value:"Email"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"email",type:"email"},model:{value:e.form.email,callback:function(r){e.$set(e.form,"email",r)},expression:"form.email"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.email}})],1)]},proxy:!0},{key:"actions",fn:function(){return[t("jet-action-message",{staticClass:"mr-3",attrs:{on:e.form.recentlySuccessful}},[e._v(" "+e._s(e.$trans("users.users.saved"))+" ")]),t("jet-button",{class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("users.users.save"))+" ")])]},proxy:!0}])})},iAe=[],aAe=ve(nAe,rAe,iAe,!1,null,null);const wB=aAe.exports,sAe=Object.freeze(Object.defineProperty({__proto__:null,default:wB},Symbol.toStringTag,{value:"Module"})),KO={subpremise:"short_name",street_number:"short_name",route:"long_name",locality:"long_name",administrative_area_level_1:"short_name",administrative_area_level_2:"long_name",country:"long_name",postal_code:"short_name"},oAe=["locality","administrative_area_level_3"],cAe=["locality","sublocality","postal_code","country","administrative_area_level_1","administrative_area_level_2"],uAe=["address_components","adr_address","alt_id","formatted_address","geometry","icon","id","name","business_status","photo","place_id","scope","type","url","utc_offset_minutes","vicinity"],lAe={name:"VueGoogleAutocomplete",props:{id:{type:String,required:!0},classname:String,placeholder:{type:String,default:"Start typing"},disabled:{type:Boolean,default:!1},types:{type:String,default:"address"},fields:{type:Array,default:function(){return uAe}},country:{type:[String,Array],default:null},enableGeolocation:{type:Boolean,default:!1},geolocationOptions:{type:Object,default:null}},data(){return{autocomplete:null,autocompleteText:"",geolocation:{geocoder:null,loc:null,position:null}}},watch:{autocompleteText:function(n,e){this.$emit("inputChange",{newVal:n,oldVal:e},this.id)},country:function(n,e){this.autocomplete.setComponentRestrictions({country:this.country===null?[]:this.country})}},mounted:function(){const n={};this.types&&(n.types=[this.types]),this.country&&(n.componentRestrictions={country:this.country}),this.autocomplete=new google.maps.places.Autocomplete(document.getElementById(this.id),n),this.autocomplete.setFields(this.fields),this.autocomplete.addListener("place_changed",this.onPlaceChanged)},methods:{onPlaceChanged(){let n=this.autocomplete.getPlace();if(!n.geometry){this.$emit("no-results-found",n,this.id);return}n.address_components!==void 0&&(this.$emit("placechanged",this.formatResult(n),n,this.id),this.autocompleteText=document.getElementById(this.id).value,this.onChange())},onFocus(){this.biasAutocompleteLocation(),this.$emit("focus")},onBlur(){this.$emit("blur")},onChange(){this.$emit("change",this.autocompleteText)},onKeyPress(n){this.$emit("keypress",n)},onKeyUp(n){this.$emit("keyup",n)},clear(){this.autocompleteText=""},focus(){this.$refs.autocomplete.focus()},blur(){this.$refs.autocomplete.blur()},update(n){this.autocompleteText=n},updateCoordinates(n){!n&&!(n.lat||n.lng)||(this.geolocation.geocoder||(this.geolocation.geocoder=new google.maps.Geocoder),this.geolocation.geocoder.geocode({location:n},(e,t)=>{t==="OK"?(e=this.filterGeocodeResultTypes(e),e[0]?(this.$emit("placechanged",this.formatResult(e[0]),e[0],this.id),this.update(e[0].formatted_address)):this.$emit("error","no result for provided coordinates")):this.$emit("error","error getting address from coords")}))},geolocate(){this.updateGeolocation((n,e)=>{this.updateCoordinates(n)})},updateGeolocation(n=null){if(navigator.geolocation){let e={};this.geolocationOptions&&Object.assign(e,this.geolocationOptions),navigator.geolocation.getCurrentPosition(t=>{let r={lat:t.coords.latitude,lng:t.coords.longitude};this.geolocation.loc=r,this.geolocation.position=t,n&&n(r,t)},t=>{this.$emit("error","Cannot get Coordinates from navigator",t)},e)}},biasAutocompleteLocation(){this.enableGeolocation&&this.updateGeolocation((n,e)=>{let t=new google.maps.Circle({center:n,radius:e.coords.accuracy});this.autocomplete.setBounds(t.getBounds())})},formatResult(n){let e={};for(let t=0;t<n.address_components.length;t++){let r=n.address_components[t].types[0];if(KO[r]){let i=n.address_components[t][KO[r]];e[r]=i}}return e.latitude=n.geometry.location.lat(),e.longitude=n.geometry.location.lng(),e}
3927,filterGeocodeResultTypes(n){if(!n||!this.types)return n;let e=[],t=[this.types];t.includes("(cities)")&&(t=t.concat(oAe)),t.includes("(regions)")&&(t=t.concat(cAe));for(let r of n)for(let i of r.types)if(t.includes(i)){e.push(r);break}return e}}};var dAe=function(){var e=this,t=e._self._c;return t("input",{directives:[{name:"model",rawName:"v-model",value:e.autocompleteText,expression:"autocompleteText"}],ref:"autocomplete",class:e.classname,attrs:{type:"text",id:e.id,placeholder:e.placeholder,disabled:e.disabled},domProps:{value:e.autocompleteText},on:{focus:function(r){return e.onFocus()},blur:function(r){return e.onBlur()},change:e.onChange,keypress:e.onKeyPress,keyup:e.onKeyUp,input:function(r){r.target.composing||(e.autocompleteText=r.target.value)}}})},fAe=[],hAe=ve(lAe,dAe,fAe,!1,null,null);const pAe=hAe.exports,mAe={components:{JetActionMessage:tu,JetButton:mn,JetFormSection:rd,JetInput:Rn,JetInputError:ea,JetLabel:Un,JetSecondaryButton:Br,SectionBorder:T2,VueGoogleAutocomplete:pAe},props:["user","redirectTo"],data(){return{form:this.$inertia.form({_method:"PUT",id:this.user.id,street:this.user.street,housenumber:this.user.housenumber,side:this.user.side,zipcode:this.user.zipcode,city:this.user.city,country:this.user.country,redirectTo:this.redirectTo||null}),allCountries:["Afghanistan","Netherlands Antilles","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua and Barbuda","Argentina","Armenia","Aruba","Australia","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Bouvet Island","Brazil","British Indian Ocean Territory","Brunei Darussalam","Bulgaria","Burkina Faso","Myanmar","Burundi","Cambodia","Cameroon","Serbia and Montenegro","Canada","Cayman Islands","Central African Republic","Chile","Christmas Island","Cocos (Keeling) Islands","Colombia","Comoros","Congo","Congo, The Democratic Republic of the","Cook Islands","Costa Rica","Cuba","Curaçao","Cyprus","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","Cote D'Ivoire","El Salvador","Eritrea","Estonia","Ethiopia","Falkland Islands (Malvinas)","Fiji","Philippines","Finland","United Arab Emirates","France","French Guiana","French Polynesia","French Southern Territories","Faroe Islands","Gabon","Gambia","Georgia","Ghana","Gibraltar","Grenada","Greece","Greenland","Guadeloupe","Guam","Guatemala","Guernsey","Guinea","Guinea-Bissau","Guyana","Haiti","Heard Island and Mcdonald Islands","Honduras","Hong Kong","Belarus","Isle of Man","India","Indonesia","Iraq","Iran, Islam
3927ic Republic Of","Ireland","Iceland","Israel","Italy","Jamaica","Japan","Jersey","Virgin Islands, British","Virgin Islands, US","Jordan","Bonaire, Sint Eustatius and Saba","Cape Verde","Kazakhstan","Kenya","China","Kyrgyzstan","Kiribati","Croatia","Kuwait","Lao People's Democratic Republic","Latvia","Lesotho","Lebanon","Liberia","Libyan Arab Jamahiriya","Liechtenstein","Lithuania","Luxembourg","Macao","Madagascar","Macedonia, The Former Yugoslav Republic of","Malawi","Malaysia","Maldives","Mali","Malta","Morocco","Marshall Islands","Martinique","Mauritania","Mauritius","Mayotte","Mexico","Micronesia, Federated States of","Moldova, Republic of","Monaco","Mongolia","Montenegro","Montserrat","Mozambique","Namibia","Nauru","Netherlands","Nepal","New Zealand","Nicaragua","Niger","Nigeria","Niue","Korea, Democratic Peoples Republic of","Northern Mariana Islands","Norfolk Island","Norway","New Caledonia","Oman","Pakistan","Palau","Palestinian Territory, Occupied","Panama","Papua New Guinea","Paraguay","Peru","Pitcairn","Poland","Portugal","Puerto Rico","Qatar","Reunion","Romania","Russian Federation","RWANDA","Saint Helena","Saint Barthélemy","Saint Kitts and Nevis","Saint Lucia","Saint Martin","Saint Pierre and Miquelon","Saint Vincent and the Grenadines","Solomon Islands","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Sint Maarten","Slovakia","Slovenia","Somalia","Spain","Sri Lanka","United Kingdom","Sudan","Suriname","Svalbard and Jan Mayen","Sweden","Switzerland","Swaziland","Syrian Arab Republic","South Africa","South Georgia and the South Sandwich Islands","Korea, Republic of","South Sudan","Taiwan, Province of China","Tajikistan","Tanzania, United Republic of","Thailand","Togo","Tokelau","Tonga","Trinidad and Tobago","Chad","Czech Republic","Tunisia","Turkey","Turkmenistan","Turks and Caicos Islands","Germany","Tuvalu","Uganda","Ukraine","Hungary","Uruguay","United States","United States Minor Outlying Islands","Uzbekistan","Vanuatu","Holy See (Vatican City State)","Venezuela","Western Sahara","Viet Nam","Wallis and Futuna","Yemen","Zambia","Zimbabwe","Equatorial Guinea","Austria","Timor-Leste","Ã
land Islands"],addressPlaceholder:this.user.street||this.user.housenumber||this.user.zipcode||this.user.city?`${this.user.street} ${this.user.housenumber}${!!this.user.side==""?",":" "+this.user.side+","} ${this.user.zipcode} ${this.user.city}`:ri.trans("users.address.address2"),hidden:!0,googleMapsLoaded:!1,googleMapsError:!1,isGoogleReady:!1}},computed:{sortedCountries(){return this.allCountries.slice().sort((n,e)=>{const t=this.$trans(`countries.${n}`).toLowerCase(),r=this.$trans(`countries.${e}`).toLowerCase();return t.localeCompare(r)})},showGoogleAutocomplete(){return!this.googleMapsError}},created(){this.initGoogleMaps()},methods:{async initGoogleMaps(){try{if(window.google&&window.google.maps&&window.google.maps.places){this.googleMapsLoaded=!0,this.isGoogleReady=!0;return}let n="AIzaSyA1nMWkII3kuMerkZQnOFLLj8Uo39vhuNU";await new Promise((e,t)=>{const r=document.createElement("script");r.src=`https://maps.googleapis.com/maps/api/js?key=${n}&libraries=places`,r.async=!0,r.defer=!0,r.onload=()=>{this.googleMapsLoaded=!0,this.isGoogleReady=!0,e()},r.onerror=i=>{this.googleMapsError=!0,this.hidden=!1,console.error("Google Maps failed to load:",i),t(i)},document.head.appendChild(r)})}catch(n){console.error("Error initializing Google Maps:",n),this.googleMapsError=!0,this.hidden=!1}},updateAdressInformation(){this.form.put(route("user-address-information.update"),{errorBag:"updateAdressInformation",preserveScroll:!0})},getAddressData(n){if(this.isGoogleReady)try{this.hidden=!1,this.address=n,this.form.street=n.route||"",this.form.housenumber=n.street_number||"",this.form.zipcode=n.postal_code||"",this.form.city=n.locality||"",this.form.side="";let e="";(navigator.language||"en-GB")==="da-DK"?e=Object.keys(this.countryList).find(r=>this.countryList[r]===n.country):e=n.country,this.form.country=e||""}catch(e){console.error("Error processing address data:",e),this.hidden=!1}},selectFirstResult(n){if(this.isGoogleReady)try{if(this.hidden=!1,!window.google||!window.google.maps){console.error("Google Maps not loaded");return}if(!n||!n.target||typeof n.target.dispatchEvent!="function"){console.error("Invalid event target for Google Maps autocomplete");return}const e=new KeyboardEvent("keydown",{key:"ArrowDown",code:"ArrowDown",keyCode:40,which:40,bubbles:!0}),t=new KeyboardEvent("keydown",{key:"Enter",code:"Enter",keyCode:13,which:13,bubbles:!0});n.target.dispatchEvent(e),n.target.dispatchEvent(t)}catch(e){console.error("Error selecting first result:",e),this.hidden=!1}}}};var gAe=function(){var e=this,t=e._self._c;return t("jet-form-section",{on:{submitted:e.updateAdressInformation},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.$trans("users.address.title"))+" ")]},proxy:!0},{key:"description",fn:function(){return[e._v(" "+e._s(e.$trans("users.address.description"))+" ")]},proxy:!0},{key:"form",fn:function(){return[e.showGoogleAutocomplete?t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{value:e.$trans("users.address.address")}}
3927),e.isGoogleReady?t("vue-google-autocomplete",{attrs:{id:"map",classname:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",placeholder:e.addressPlaceholder,onfocus:"this.setAttribute('autocomplete', 'disable-autocomplete');"},on:{placechanged:e.getAddressData,keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:(r.preventDefault(),e.selectFirstResult.apply(null,arguments))}},nativeOn:{keypress:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:(r.preventDefault(),e.selectFirstResult.apply(null,arguments))}}}):t("div",{staticClass:"mt-1"},[t("jet-input",{staticClass:"block w-full",attrs:{type:"text",disabled:"",value:e.$trans("users.address.loading")}})],1),t("p",{staticClass:"text-gray-500 mt-2 text-sm underline cursor-pointer",on:{click:function(r){e.hidden=!1}}},[e._v(" "+e._s(e.$trans("users.address.manual"))+" ")])],1):e._e(),t("div",{class:{"col-span-6":!0,"sm:col-span-4":!0,hidden:e.hidden}},[t("jet-label",{attrs:{for:"street",value:e.$trans("users.address.street")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"street",type:"text"},model:{value:e.form.street,callback:function(r){e.$set(e.form,"street",r)},expression:"form.street"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.street}})],1),t("div",{class:{"col-span-6":!0,"sm:col-span-4":!0,hidden:e.hidden}},[t("jet-label",{attrs:{for:"housenumber",value:e.$trans("users.address.housenumber")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"housenumber",type:"text"},model:{value:e.form.housenumber,callback:function(r){e.$set(e.form,"housenumber",r)},expression:"form.housenumber"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.housenumber}})],1),t("div",{class:{"col-span-6":!0,"sm:col-span-4":!0,hidden:e.hidden}},[t("jet-label",{attrs:{for:"side",value:e.$trans("users.address.side")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"side",type:"text"},model:{value:e.form.side,callback:function(r){e.$set(e.form,"side",r)},expression:"form.side"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.side}})],1),t("div",{class:{"col-span-6":!0,"sm:col-span-4":!0,hidden:e.hidden}},[t("jet-label",{attrs:{for:"zipcode",value:e.$trans("users.address.zip")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"zipcode",type:"text"},model:{value:e.form.zipcode,callback:function(r){e.$set(e.form,"zipcode",r)},expression:"form.zipcode"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.zipcode}})],1),t("div",{class:{"col-span-6":!0,"sm:col-span-4":!0,hidden:e.hidden}},[t("jet-label",{attrs:{for:"city",value:e.$trans("users.address.city")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"city",type:"text"},model:{value:e.form.city,callback:function(r){e.$set(e.form,"city",r)},expression:"form.city"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.city}})],1),t("div",{class:{"col-span-6":!0,"sm:col-span-4":!0,hidden:e.hidden}},[t("jet-label",{attrs:{for:"country",value:e.$trans("users.address.country")}}),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.country,expression:"form.country"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",on:{change:function(r){var i=Array.prototype.filter.call(r.target.options,function(a){return a.selected}).map(function(a){var s="_value"in a?a._value:a.value;return s});e.$set(e.form,"country",r.target.multiple?i:i[0])}}},e._l(e.sortedCountries,function(r){return t("option",{key:r,domProps:{value:r}},[e._v(" "+e._s(e.$trans(`countries.${r}`))+" ")])}),0),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.country}})],1)]},proxy:!0},{key:"actions",fn:function(){return[t("jet-action-message",{staticClass:"mr-3",attrs:{on:e.form.recentlySuccessful}},[e._v(" "+e._s(e.$trans("users.users.saved"))+" ")]),t("jet-button",{class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("users.users.save"))+" ")])]},proxy:!0}])})},vAe=[],yAe=ve(mAe,gAe,vAe,!1,null,null);const ZE=yAe.exports,_Ae={props:["sessions","userId"],components:{AppLayout:ta,DeleteUserForm:gB,JetSectionBorder:T2,LogoutOtherBrowserSessionsForm:yB,TwoFactorAuthenticationForm:bB,UpdatePasswordForm:xB,UpdateProfileInformationForm:wB,UpdateAddressInformationForm:ZE,PermissionsForm:JE}};var bAe=function(){var e=this,t=e._self._c;return t("app-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("users.users.settings"))+" ")])]},proxy:!0}])},[t("div",[t("div",{staticClass:"max-w-7xl mx-auto py-10 sm:px-6 lg:px-8"},[e.$page.props.jetstream.canUpdateProfileInformation?t("div",[t("update-profile-information-form",{attrs:{user:e.$page.props.user}}
3927),t("jet-section-border")],1):e._e(),e.$page.props.jetstream.canUpdateProfileInformation?t("div",[t("update-address-information-form",{staticClass:"anchor",attrs:{id:"address-form",user:e.$page.props.user}}),t("jet-section-border")],1):e._e(),e.$page.props.jetstream.canUpdatePassword?t("div",[t("update-password-form",{staticClass:"mt-10 sm:mt-0"}),t("jet-section-border")],1):e._e(),t("div",[t("permissions-form",{staticClass:"mt-10 sm:mt-0 anchor",attrs:{users:e.$page.props.user,id:"permissions-form"}}),t("jet-section-border")],1),e.$page.props.jetstream.canManageTwoFactorAuthentication?t("div",[t("two-factor-authentication-form",{staticClass:"mt-10 sm:mt-0"}),t("jet-section-border")],1):e._e(),t("logout-other-browser-sessions-form",{staticClass:"mt-10 sm:mt-0",attrs:{sessions:e.sessions}}),e.$page.props.jetstream.hasAccountDeletionFeatures?[t("jet-section-border"),t("delete-user-form",{staticClass:"mt-10 sm:mt-0"})]:e._e()],2)])])},xAe=[],wAe=ve(_Ae,bAe,xAe,!1,null,null);const CAe=wAe.exports,kAe=Object.freeze(Object.defineProperty({__proto__:null,default:CAe},Symbol.toStringTag,{value:"Module"})),SAe={props:["id"],components:{AppLayout:ta},data(){return{seasonTickets:[],fetching:!0}},created(){this.getTickets()},methods:{getTickets(){this.fetching=!0;const n=this.id?`/admin/users/${this.id}/get-season-tickets`:"/user/get-season-tickets";return axios.get(n).then(e=>{this.seasonTickets=e.data,this.fetching=!1})}},computed:{activeTickets(){return this.seasonTickets.filter(n=>n.Status===1&&["Sektion 12 billet-abonnement","Familietribune billet-abonnement","Sektion 12 kort-abonnement","C-tribunen kort-abonnement","C-Tribunekort 2026/2027","Kort-abonnement langside","Premium 26/27","Platin 2026/2027"].includes(n.SeasonTicketName))}}};var TAe=function(){var e=this,t=e._self._c;return t("div",[t("div",{},[t("h1",{staticClass:"border-l-4 border-fck-blue text-2xl pl-2 line normal-case leading-lg font-black mb-3"},[e._v(e._s(e.$trans("pages.tickets.seasonticket")))])]),e.fetching?t("div",{staticClass:"grid sm:grid-cols-2 gap-6 mb-6"},e._l(2,function(r){return t("div",{key:r,staticClass:"bg-white overflow-hidden shadow-sm border border-gray-100"},[t("div",{staticClass:"relative",staticStyle:{"aspect-ratio":"1.586 / 1"}},[t("div",{staticClass:"absolute inset-0 bg-gray-200 animate-pulse rounded-lg"}),t("div",{staticClass:"relative p-6 space-y-3"},[t("div",{staticClass:"h-6 bg-gray-300/50 backdrop-blur-sm rounded animate-pulse w-3/4"}),t("div",{staticClass:"grid grid-cols-2 gap-4 pt-2"},e._l(4,function(i){return t("div",{key:i,staticClass:"space-y-2"},[t("div",{staticClass:"h-4 bg-gray-300/50 backdrop-blur-sm rounded animate-pulse w-1/2"}),t("div",{staticClass:"h-4 bg-gray-300/50 backdrop-blur-sm rounded animate-pulse w-3/4"})])}),0)])]),e._m(0,!0)])}),0):e.activeTickets.length>0?t("div",{staticClass:"grid sm:grid-cols-2 gap-6 mb-6"},e._l(e.activeTickets,function(r){return t("div",{key:r.id,staticClass:"bg-white p-4 overflow-hidden shadow-sm transition-shadow duration-300 hover:shadow-lg border border-gray-100"},[t("div",{staticClass:"relative",staticStyle:{"aspect-ratio":"1.7676 / 1"}},[e._m(1,!0),t("div",{staticClass:"flex items-end h-full relative p-4"},[t("h3",{staticClass:"font-sans text-lg text-white font-bold m-0"},[e._v(" "+e._s(r.SeasonTicketName)+" ")])])]),t("div",{staticClass:"px-4 py-3 bg-gray-50 flex items-center justify-between"},[t("a",{staticClass:"flex items-center space-x-2 font-sans text-sm font-bold text-[#002D62] hover:text-blue-700",attrs:{href:r.MobileUrl}},[t("svg",{staticClass:"h-5 w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"}})]),t("span",[e._v(e._s(e.$trans("pages.tickets.getmobileseasonticket")))])]),t("span",{staticClass:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800"},[e._v(" "+e._s(e.$trans("pages.tickets.active"))+" ")])])])}),0):t("div",{staticClass:"text-center py-12"},[t("svg",{staticClass:"mx-auto h-12 w-12 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z"}})]),t("h3",{staticClass:"mt-2 text-lg font-medium text-gray-900"},[e._v(e._s(e.$trans("pages.tickets.noseason")))]),t("p",{staticClass:"mt-1 text-sm text-gray-500"},[e._v(e._s(e.$trans("pages.tickets.buyseason")))]),t("div",{staticClass:"mt-6"},[t("a",{staticClass:"inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-[#002D62] hover:bg-blue-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",attrs:{href:"/redirect/tickets"}},[e._v(" "+e._s(e.$trans("pages.tickets.buyseasoncta"))+" ")])])])])},EAe=[function(){var n=this,e=n._self._c;return e("div",{staticClass:"px-4 py-3 bg-gray-50 flex justify-between"},[e("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-48"}),e("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-24"})])},function(){var n=this,e=n._self._c;return e("div",{staticClass:"absolute inset-0"},[e("img",{staticClass:"w-full h-full object-cover",attrs:{src:"/img/kort.png",alt:"Season Ticket Backgroun
3927d"}})])}],PAe=ve(SAe,TAe,EAe,!1,null,null);const CB=PAe.exports,RAe={props:["id"],components:{AppLayout:ta},data(){return{friends:[],fetching:!0}},created(){this.getFriends()},methods:{getFriends(){this.fetching=!0;const n=this.id?`/admin/users/${this.id}/get-friends`:"/user/get-friends";return axios.get(n).then(e=>{var t;this.friends=((t=e==null?void 0:e.data)==null?void 0:t.Result)||[],this.fetching=!1})}}};var AAe=function(){var e=this,t=e._self._c;return t("div",[t("div",{},[t("h1",{staticClass:"border-l-4 border-fck-blue text-2xl pl-2 line normal-case leading-lg font-black mb-6"},[e._v(e._s(e.$trans("pages.tickets.friends")))])]),e.fetching?t("div",{staticClass:"grid sm:grid-cols-2 gap-6"},e._l(2,function(r){return t("div",{key:r,staticClass:"bg-white overflow-hidden shadow-sm border border-gray-100"},[t("div",{staticClass:"p-4 space-y-3"},[t("div",{staticClass:"h-6 bg-gray-200 rounded animate-pulse w-3/4"}),t("div",{staticClass:"grid grid-cols-2 gap-4 pt-2"},e._l(2,function(i){return t("div",{key:i,staticClass:"space-y-2"},[t("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-1/2"}),t("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-3/4"})])}),0)]),e._m(0,!0)])}),0):e.friends.length>0?t("div",{staticClass:"grid sm:grid-cols-2 gap-6"},e._l(e.friends,function(r){return t("div",{key:r.Id,staticClass:"bg-white overflow-hidden shadow-sm transition-shadow duration-300 hover:shadow-lg border border-gray-100"},[t("div",{staticClass:"p-4"},[t("h3",{staticClass:"font-sans text-lg text-[#002D62] font-bold mb-4"},[e._v(" "+e._s(r.FirstName)+" "+e._s(r.LastName)+" ")]),t("div",{staticClass:"grid grid-cols-2 gap-4 font-text text-sm"},[t("div",[t("p",{staticClass:"text-gray-500"},[e._v(e._s(e.$trans("pages.tickets.email")))]),t("p",{staticClass:"font-medium text-gray-900"},[e._v(e._s(r.Identifier))])]),t("div",[t("p",{staticClass:"text-gray-500"},[e._v(e._s(e.$trans("pages.tickets.phone")))]),t("p",{staticClass:"font-medium text-gray-900"},[e._v(e._s(r.PhoneNumber||"-"))])])])]),t("div",{staticClass:"px-4 py-3 bg-gray-50 flex items-center justify-between"},[t("span",{staticClass:"text-sm text-gray-500 font-medium"},[e._v(" #"+e._s(r.Id)+" ")]),t("span",{staticClass:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800"},[e._v(" "+e._s(e.$trans("pages.tickets.friends"))+" ")])])])}),0):t("div",{staticClass:"text-center py-12"},[t("svg",{staticClass:"mx-auto h-12 w-12 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}})]),t("h3",{staticClass:"mt-2 text-lg font-medium text-gray-900"},[e._v(e._s(e.$trans("pages.tickets.nofriends")))]),t("p",{staticClass:"mt-1 text-sm text-gray-500"},[e._v(e._s(e.$trans("pages.tickets.addfriends")))]),t("div",{staticClass:"mt-6"},[t("a",{staticClass:"inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-[#002D62] hover:bg-blue-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",attrs:{href:"/redirect/tickets"}},[e._v(" "+e._s(e.$trans("pages.tickets.addfriendscta"))+" ")])])])])},IAe=[function(){var n=this,e=n._self._c;return e("div",{staticClass:"px-4 py-3 bg-gray-50 flex justify-between"},[e("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-24"}),e("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-20"})])}],OAe=ve(RAe,AAe,IAe,!1,null,null);const MAe=OAe.exports,DAe={created(){this.getFriends()},props:["id"],components:{AppLayout:ta},data(){return{ticketUser:{},fetching:!0,currentNumber:0,targetNumber:0,animationSpeed:6}},methods:{getFriends(){this.fetching=!0;let n;return this.id?n=`/admin/users/${this.id}/get-user`:n="/user/get-user",axios.get(n).then(e=>{var t;this.ticketUser=(t=e==null?void 0:e.data)==null?void 0:t.Result,this.fetching=!1,this.ticketUser&&setTimeout(()=>{var r;((r=this.ticketUser)==null?void 0:r.Points)>0&&(this.targetNumber=this.ticketUser.Points,this.animateNumber())},1e3)}).then(()=>{})},animateNumber(){const n=()=>
3927{if(this.currentNumber<this.targetNumber){let e=Math.ceil(this.targetNumber/100);this.currentNumber+=e,setTimeout(n,this.animationSpeed)}else this.currentNumber=this.targetNumber};n()}}};var NAe=function(){var e=this,t=e._self._c;return t("div",[t("div",{},[t("h1",{staticClass:"border-l-4 border-fck-blue text-2xl pl-2 line normal-case leading-lg font-black mb-6"},[e._v(e._s(e.$trans("pages.tickets.profile")))])]),e.$page.props.user.roboticket_id?t("div",{},[t("div",{staticClass:"bg-white p-4 flex flex-col justify-center items-center"},[t("div",{staticClass:"flex flex-col items-center justify-center"},[t("p",{staticClass:"font-sans text-5xl mb-1"},[e._v(e._s(e.currentNumber||0))]),t("p",{staticClass:"font-text text-sm"},[e._v(e._s(e.$trans("pages.tickets.loyalty")))])])])]):e._e()])},LAe=[],FAe=ve(DAe,NAe,LAe,!1,null,null);const $Ae=FAe.exports,BAe={props:["id"],components:{AppLayout:ta},data(){return{memberships:[],fetching:!0}},created(){this.getTickets()},methods:{getTickets(){this.fetching=!0;const n=this.id?`/admin/users/${this.id}/get-memberships`:"/user/get-memberships";return axios.get(n).then(e=>{var t;this.memberships=((t=e==null?void 0:e.data)==null?void 0:t.Result)||[],this.fetching=!1})}}};var UAe=function(){var e=this,t=e._self._c;return t("div",[t("div",{},[t("h1",{staticClass:"border-l-4 border-fck-blue text-2xl pl-2 line normal-case leading-lg font-black mb-3"},[e._v(e._s(e.$trans("pages.tickets.subscriptions")))])]),e.fetching?t("div",{staticClass:"grid sm:grid-cols-2 gap-6 mb-6"},e._l(2,function(r){return t("div",{key:r,staticClass:"bg-white overflow-hidden shadow-sm border border-gray-100"},[t("div",{staticClass:"p-4 space-y-3"},[t("div",{staticClass:"h-6 bg-gray-200 rounded animate-pulse w-3/4"}),t("div",{staticClass:"grid grid-cols-2 gap-4 pt-2"},e._l(2,function(i){return t("div",{key:i,staticClass:"space-y-2"},[t("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-1/2"}),t("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-3/4"})])}),0)]),e._m(0,!0)])}),0):e.memberships.length>0?t("div",{staticClass:"grid sm:grid-cols-2 gap-6 mb-6"},e._l(e.memberships,function(r){return t("div",{key:r,staticClass:"bg-white overflow-hidden shadow-sm transition-shadow duration-300 hover:shadow-lg border border-gray-100"},[t("div",{staticClass:"p-4"},[t("h3",{staticClass:"font-sans text-lg text-[#002D62] font-bold mb-4"},[e._v(" "+e._s(r)+" ")]),t("div",{staticClass:"grid grid-cols-2 gap-4 font-text text-sm"},[t("div",[t("p",{staticClass:"text-gray-500"},[e._v(e._s(e.$trans("pages.tickets.type")))]),t("p",{staticClass:"font-medium text-gray-900"},[e._v(e._s(e.$trans("pages.tickets.membership")))])]),t("div",[t("p",{staticClass:"text-gray-500"},[e._v(e._s(e.$trans("pages.tickets.status")))]),t("p",{staticClass:"font-medium text-gray-900"},[e._v(e._s(e.$trans("pages.tickets.active")))])])])]),t("div",{staticClass:"px-4 py-3 bg-gray-50 flex items-center justify-between"},[t("a",{staticClass:"flex items-center space-x-2 font-sans text-sm font-bold text-[#002D62] hover:text-blue-700",attrs:{href:"/redirect/tickets"}},[t("svg",{staticClass:"h-5 w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}}),t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"}})]),t("span",[e._v(e._s(e.$trans("pages.tickets.viewdetails")))])]),t("span",{staticClass:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-purple-100 text-purple-800"},[e._v(" "+e._s(e.$trans("pages.tickets.membership"))+" ")])])])}),0):t("div",{staticClass:"text-center py-12 mb-6"},[t("svg",{staticClass:"mx-auto h-12 w-12 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"}})]),t("h3",{staticClass:"mt-2 text-lg font-medium text-gray-900"},[e._v(e._s(e.$trans("pages.tickets.nomemberships")))]),t("p",{staticClass:"mt-1 text-sm text-gray-500"},[e._v(e._s(e.$trans("pages.tickets.buymembership")))]),t("div",{staticClass:"mt-6"},[t("a",{staticClass:"inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-[#002D62] hover:bg-blue-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",attrs:{href:"/redirect/tickets"}},[e._v(" "+e._s(e.$trans("pages.tickets.buymembershipcta"))+" ")])])])])},jAe=[function(){var n=this,e=n._self._c;return e("div",{staticClass:"px-4 py-3 bg-gray-50 flex justify-between"},[e("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-24"}),e("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-20"})])}],qAe=ve(BAe,UAe,jAe,!1,null,null);const kB=qAe.exports,zAe={props:["id"],components:{AppLayout:ta,SeasonTickets:CB,Tickets:vE,Friends:MAe,TicketUser:$Ae,VueBarcode:XE,Memberships:kB,SeasonTicketUsageStats:QE}};var WAe=function(){var e=this,t=e._self._c;return t("app-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"},[t("h2",{staticClass:"font-sans text-2xl text-[#002D62] leading-10 font-bold"},[e._v(" "+e._s(e.$trans("dashboard.tickets.title"))+" ")])])]},proxy:!0}])},[t("div",{staticClass:"py-8"},[t("div",{staticClass:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"},[t("div",{staticClass:"space-y-6"},[t("ticket-user"),t("div",{staticClass:"md:h-24"}),t("tickets"),t("div",{staticClass:"md:h-24"}),t("season-tickets"),t("div",{staticClass:"md:h-24"}),t("season-ticket-usage-stats"),t("div",{staticClass:"md:h-24"}),t("memberships"),t("div",{staticClass:"md:h-24"}),t("friends")],1)])])])}
3927,HAe=[],VAe=ve(zAe,WAe,HAe,!1,null,null);const GAe=VAe.exports,KAe=Object.freeze(Object.defineProperty({__proto__:null,default:GAe},Symbol.toStringTag,{value:"Module"})),YAe={props:["id"],components:{AppLayout:ta},mounted(){this.orders.length||this.getOrders()},watch:{id:{handler(n,e){n!==e&&this.getOrders()}}},data(){return{orders:[],fetching:!1}},computed:{formattedTime:function(n){return Le(n).format("D-M-YYYY")}},methods:{getOrders(){this.fetching=!0;let n;return this.id?n=`/admin/users/${this.id}/webshop/orders`:n="webshop/orders",this.fetching=!0,axios.get(n).then(e=>{this.fetching=!1,this.orders=e.data.orders})},formattedDate:function(n){return Le(n).format("D/M-YYYY")}}};var XAe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"bg-white p-3 overflow-hidden shadow-lg transition duration-500 hover:shadow-xl sm:rounded-lg mb-6 lg:mb-8"},[t("div",{staticClass:"flex items-center space-x-2 font-semibold text-gray-900 leading-8 mb-3"},[t("span",[t("svg",{staticClass:"h-6 w-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}})])]),t("span",{staticClass:"text-2xl font-bold tracking-wide"},[e._v(e._s(e.$trans("pages.fanshop.receipts")))])]),e.orders.length>0?t("div",[t("table",{staticClass:"webshop-orders-table table-auto w-full"},[t("thead",[t("tr",[t("th",{staticClass:"webshop-orders-header text-left text-xs md:text-base"},[e._v(e._s(e.$trans("pages.fanshop.ordernumber")))]),t("th",{staticClass:"webshop-orders-header text-left text-xs md:text-base"},[e._v(e._s(e.$trans("pages.fanshop.date")))]),t("th",{staticClass:"webshop-orders-header text-left text-xs md:text-base"},[e._v(e._s(e.$trans("pages.fanshop.paymentstatus")))]),t("th",{staticClass:"webshop-orders-header text-left text-xs md:text-base"},[e._v(e._s(e.$trans("pages.fanshop.fulfillmentstatus")))]),t("th",{staticClass:"webshop-orders-header text-left text-xs md:text-base"},[e._v(e._s(e.$trans("pages.fanshop.amount")))])])]),t("tbody",e._l(e.orders,function(r,i){return t("a",{key:r.id,staticClass:"webshop-orders-link",class:i%2==0?"even-row":"odd-row",attrs:{href:r.order_status_url}},[t("td",{staticClass:"webshop-orders-cell text-xs md:text-base"},[e._v(e._s(r.order_number))]),t("td",{staticClass:"webshop-orders-cell text-xs md:text-base"},[e._v(e._s(e.formattedDate(r.created_at)))]),t("td",{staticClass:"webshop-orders-cell text-xs md:text-base"},[e._v(e._s(r.financial_status&&e.$trans(`pages.fanshop.${r.financial_status}`)))]),t("td",{staticClass:"webshop-orders-cell text-xs md:text-base"},[e._v(e._s(r.fulfillment_status&&e.$trans(`pages.fanshop.${r.fulfillment_status}`)))]),t("td",{staticClass:"webshop-orders-cell text-xs md:text-base"},[e._v(e._s(r.current_total_price)+" "+e._s(r.currency))])])}),0)])]):this.fetching?t("div",[t("svg",{staticClass:"animate-spin h-5 w-5 mr-3",attrs:{viewBox:"0 0 24 24"}},[e._v(" Â ")])]):t("div",[t("p",[e._v(e._s(e.$trans("pages.fanshop.noorders")))])])])},JAe=[],QAe=ve(YAe,XAe,JAe,!1,null,null);const SB=QAe.exports,ZAe={props:["id"],components:{AppLayout:ta,QrcodeVue:DT,WebshopOrders:SB}};var e3e=function(){var e=this,t=e._self._c;return t("app-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" FCK Fanshop ")])]},proxy:!0}])},[t("div",{staticClass:"pt-6 lg:pt-8"},[t("div",{staticClass:"max-w-7xl mx-auto sm:px-6 lg:px-8"},[t("webshop-orders")],1)])])},t3e=[],n3e=ve(ZAe,e3e,t3e,!1,null,null);const r3e=n3e.exports,i3e=Object.freeze(Object.defineProperty({__proto__:null,default:r3e},Symbol.toStringTag,{value:"Module"})),a3e={props:["terms"],components:{JetAuthenticationCardLogo:cl}};var s3e=function(){var e=this,t=e._self._c;return t("div",{staticClass:"font-sans text-gray-900 antialiased"},[t("div",{staticClass:"pt-4 bg-gray-100"},[t("div",{staticClass:"min-h-screen flex flex-col items-center pt-6 sm:pt-0"},[t("div",[t("jet-authentication-card-logo")],1),t("div",{staticClass:"w-full sm:max-w-2xl mt-6 p-6 bg-white shadow-md overflow-hidden sm:rou
3927nded-lg prose",domProps:{innerHTML:e._s(e.terms)}})])])])},o3e=[],c3e=ve(a3e,s3e,o3e,!1,null,null);const u3e=c3e.exports,l3e=Object.freeze(Object.defineProperty({__proto__:null,default:u3e},Symbol.toStringTag,{value:"Module"})),d3e={props:["users"],components:{AppLayout:ta,UpdateAddressInformationForm:ZE}};var f3e=function(){var e=this,t=e._self._c;return t("app-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("pages.users.updateAddressTitle"))+" ")])]},proxy:!0}])},[t("div",[t("div",{staticClass:"max-w-7xl mx-auto sm:p-6 lg:p-8"},[t("div",{staticClass:"bg-blue-100 border-l-4 border-blue-500 text-blue-700 p-4",attrs:{role:"alert"}},[t("p",{staticClass:"font-bold"},[e._v(e._s(e.$trans("pages.users.updateAddressTitle")))]),t("p",[e._v(e._s(e.$trans("pages.users.updateAddressText")))])]),t("div",{staticClass:"sm:pt-6 lg:pt-8"},[t("update-address-information-form",{attrs:{user:e.users,redirectTo:"dashboard"}})],1)])])])},h3e=[],p3e=ve(d3e,f3e,h3e,!1,null,null);const m3e=p3e.exports,g3e=Object.freeze(Object.defineProperty({__proto__:null,default:m3e},Symbol.toStringTag,{value:"Module"})),v3e={components:{JetActionSection:Tp,JetConfirmationModal:kf,JetDangerButton:vo,JetSecondaryButton:Br},props:{users:{type:Object,required:!0}},data(){return{confirmingUserDeletion:!1,processing:!1,purge:[]}},computed:{connectedSystems(){const n=this.users||{},e=[];return n.roboticket_id&&e.push({key:"roboticket",name:ri.trans("users.delete.systemRoboticket"),detail:ri.trans("users.users.delete_account_detail_roboticket")}),n.shopify_customer_id&&e.push({key:"shopify",name:ri.trans("users.delete.systemShopify"),detail:ri.trans("users.users.delete_account_detail_shopify")}),n.agillic_id&&e.push({key:"agillic",name:ri.trans("users.delete.systemAgillic"),detail:ri.trans("users.users.delete_account_detail_agillic")}),e}},methods:{$trans(n){return ri.trans(n)},confirmUserDeletion(){this.confirmingUserDeletion=!0},closeModal(){this.confirmingUserDeletion=!1,this.purge=[]},selectAll(){this.purge=this.connectedSystems.map(n=>n.key)},clearAll(){this.purge=[]},deleteUser(){this.processing=!0,this.$inertia.delete(this.route("admin.users.destroy",this.users.id),{preserveScroll:!0,only:[],data:{purge:this.purge},onSuccess:()=>{this.$inertia.visit(this.route("admin.users.index"))},onError:()=>{this.processing=!1},onFinish:()=>{this.processing=!1,this.confirmingUserDeletion=!1}})},route(){return window.route.apply(window,arguments)}}};var y3e=function(){var e=this,t=e._self._c;return t("jet-action-section",{scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.$trans("users.users.delete_account"))+" ")]},proxy:!0},{key:"description",fn:function(){return[e._v(" "+e._s(e.$trans("users.users.delete_account_description"))+" ")]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"max-w-xl text-sm text-gray-600"},[e._v(" "+e._s(e.$trans("users.users.delete_account_warning"))+" ")]),t("div",{staticClass:"mt-5"},[t("jet-danger-button",{nativeOn:{click:function(r){return e.confirmUserDeletion.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("users.users.delete_account_button"))+" ")])],1),t("jet-confirmation-modal",{attrs:{show:e.confirmingUserDeletion},on:{close:e.closeModal},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.$trans("users.users.delete_account_modal_title"))+" ")]},proxy:!0},{key:"content",fn:function(){return[t("p",{staticClass:"text-sm text-gray-600 m-0"},[e._v(" "+e._s(e.$trans("users.users.delete_account_modal_description"))+" ")]),t("div",{staticClass:"mt-4"},[t("h4",{staticClass:"font-bold text-sm text-gray-800 m-0"},[e._v(" "+e._s(e.$trans("users.users.delete_account_systems_title"))+" ")]),e.connectedSystems.length===0?t("p",{staticClass:"mt-1 text-sm text-gray-500 m-0"},[e._v(" "+e._s(e.$trans("users.users.delete_account_systems_none"))+" ")]):[t("p",{staticClass:"mt-1 text-sm text-gray-500 m-0"},[e._v(" "+e._s(e.$trans("users.users.delete_account_systems_intro"))+" ")]),e._l(e.connectedSystems,function(r){return t("label",{key:r.key,staticClass:"flex items-start gap-2 mt-2"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.purge,expression:"purge"}],staticClass:"mt-1",attrs:{type:"checkbox"},domProps:{value:r.key,checked:Array.isArray(e.purge)?e._i(e.purge,r.key)>-1:e.purge},on:{change:function(i){var a=e.purge,s=i.target,o=!!s.checked;if(Array.isArray(a)){var c=r.key,u=e._i(a,c);s.checked?u<0&&(e.purge=a.concat([c])):u>-1&&(e.purge=a.slice(0,u).concat(a.slice(u+1)))}else e.purge=o}}}),t("span",{staticClass:"text-sm"},[t("span",{staticClass:"font-bold text-gray-800"},[e._v(e._s(r.name))]),t("span",{staticClass:"block text-gray-500"},[e._v(e._s(r.detail))])])])}),t("div",{staticClass:"mt-2 flex gap-3"},[t("button",{staticClass:"text-sm text-fck-blue underline",attrs:{type:"button"},on:{click:e.selectAll}},[e._v(" "+e._s(e.$trans("users.users.delete_account_select_all"))+" ")]),t("button",{staticClass:"text-sm text-fck-blue underline",attrs:{type:"button"},on:{click:e.clearAll}},[e._v(" "+e._s(e.$trans("users.users.delete_account_clear"))+" ")])]),e.purge.length?t("p",{staticClass:"mt-3 text-sm font-bold text-red-700 m-0"},[e._v(" "+e._s(e.$trans("users.users.delete_account_systems_warning"))+" ")]):e._e(
3927)]],2)]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){return e.closeModal.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("users.users.cancel"))+" ")]),t("jet-danger-button",{staticClass:"ml-3",class:{"opacity-25":e.processing},attrs:{disabled:e.processing},nativeOn:{click:function(r){return e.deleteUser.apply(null,arguments)}}},[e._v(" "+e._s(e.$trans("users.users.delete_account_confirm"))+" ")])]},proxy:!0}])})]},proxy:!0}])})},_3e=[],b3e=ve(v3e,y3e,_3e,!1,null,null);const TB=b3e.exports,x3e=Object.freeze(Object.defineProperty({__proto__:null,default:TB},Symbol.toStringTag,{value:"Module"})),w3e={components:{JetActionMessage:tu,JetButton:mn,JetFormSection:rd,JetInput:Rn,JetInputError:ea,JetLabel:Un,JetSecondaryButton:Br,JetPhone:MT},props:["users"],data(){return{form:this.$inertia.form({_method:"PUT",firstname:this.users.firstname,lastname:this.users.lastname,birthday:this.users.birthday,phone:this.users.phone,country_code:this.users.country_code,email:this.users.email,photo:null}),photoPreview:null}},methods:{updateUserInformation(){this.form.post(route("admin.users.update",this.users.id),{errorBag:"updateUserInformation",preserveScroll:!0})},phoneUpdate({countryCallingCode:n,nationalNumber:e}){this.form.phone=e,this.form.country_code=n}}};var C3e=function(){var e=this,t=e._self._c;return t("jet-form-section",{on:{submitted:e.updateUserInformation},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.$trans("users.profile.title"))+" ")]},proxy:!0},{key:"description",fn:function(){return[e._v(" "+e._s(e.$trans("users.profile.description"))+" ")]},proxy:!0},{key:"form",fn:function(){return[t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"firstname",value:e.$trans("users.profile.firstname")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"firstname",type:"text",autocomplete:"firstname"},model:{value:e.form.firstname,callback:function(r){e.$set(e.form,"firstname",r)},expression:"form.firstname"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.firstname}})],1),t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"lastname",value:e.$trans("users.profile.lastname")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"lastname",type:"text",autocomplete:"lastname"},model:{value:e.form.lastname,callback:function(r){e.$set(e.form,"lastname",r)},expression:"form.lastname"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.lastname}})],1),t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"birthday",value:e.$trans("users.profile.birthday")}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"birthday",type:"date",autocomplete:"birthday"},model:{value:e.form.birthday,callback:function(r){e.$set(e.form,"birthday",r)},expression:"form.birthday"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.birthday}})],1),t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"phone",value:e.$trans("users.profile.phone")}}),t("jet-phone",{staticClass:"mt-1 block w-full border-0 p-0",attrs:{id:"phone",type:"text",initNumber:e.form.phone,initCountry:e.form.country_code},on:{change:e.phoneUpdate}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.phone}})],1),t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"email",value:"Email"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"email",type:"email"},model:{value:e.form.email,callback:function(r){e.$set(e.form,"email",r)},expression:"form.email"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.email}})],1)]},proxy:!0},{key:"actions",fn:function(){return[t("jet-action-message",{staticClass:"mr-3",attrs:{on:e.form.recentlySuccessful}},[e._v(" Saved. ")]),t("jet-button",{class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" "+e._s(e.$trans("users.users.save"))+" ")])]},proxy:!0}])})},k3e=[],S3e=ve(w3e,C3e,k3e,!1,null,null);const EB=S3e.exports,T3e=Object.freeze(Object.defineProperty({__proto__:null,default:EB},Symbol.toStringTag,{value:"Module"})),E3e={props:[],components:{JetFormSection:rd,JetButton:mn,JetConfirmsPassword:kv,JetDangerButton:vo,JetSecondaryButton:Br,JetToggle:u1,JetInput:Rn,JetLabel:Un,JetActionMessage:tu,JetPassword:Ob,JetPasswordConfirmation:Mb},props:["users"],data(){return{form:this.$inertia.form({_method:"PUT",password:"",password_confirmation:""})}},watch:{isFetching:function(n,e){},"form.password":function(n,e){}},created(){},methods:{updatePassword(){return this.form.put(route("admin.users.updatePassword",this.users.id),{errorBag:"updateUserInformation",preserveScroll:!0})}}};var P3e=function(){var e=this,t=e._self._c;return t("jet-form-section",{on:{submitted:e.updatePassword},scopedSlots:e._u([{key:"title",fn:function(){return[e._v("Adgangskode")]},proxy:!0},{key:"description",fn:function(){return[e._v(" Her kan du sætte en ny adgangskode for brugeren. ")]},proxy:!0},{key:"form",fn:function(){return[t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-password",{attrs:{label:"Adgangskode"},model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}}),t("jet-password-confirmation",{attrs:{password:e.form.password,label:"Bekræft adgangskode"},model:{value:e.form.password_confirmation,callback:function(r){e.$set(e.form,"password_confirmation",r)},expression:"form.password_confirmation"}})],1),t("div",{staticClass:"mt-5"})]},proxy:!0},{key:"actions",fn:function(){return[t("jet-action-message",{staticClass:"mr-3",attrs:{on:e.form.recentlySuccessful}},[e._v(" Saved. ")]),t("jet-button",{class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" Save ")])]},proxy:!0}])})},R3e=[],A3e=ve(E3e,P3e,R3e,!1,null,null);const PB=A3e.exports,I3e=Object.freeze(Object.defineProperty({__proto__:null,default:PB},Symbol.toStringTag,{value:"Module"})),O3e={props:["users","roles"],components:{JetFormSection:rd,JetButton:mn,JetConfirmsPassword:kv,JetDangerButton:vo,JetSecondaryButton:Br,JetToggle:u1,JetInput:Rn,JetLabel:Un,JetActionMessage:tu,JetActionSectionNoBox:_B},data(){return{form:this.$inertia.form({_method:"PUT",roles:this.roles.map(n=>({id:n.id,name:n.name,checked:this.users.roles.some(e=>e.id===n.id)}))}),recentlySuccessful:!1}},computed:{isAdmin(){var n,e;return((e=(n=this.$page.props.user)==null?void 0:n.roles)==null?void 0:e.some(t=>t.name==="Admin"))||!1},availableRoles(){return this.isAdmin?this.form.roles:this.form.roles.filter(n=>{var r,i;if(n.checked)return!0;const t=`roles.assign.${n.name.toLowerCase().replace("+","-plus").replace(" ","-")}`;return((i=(r=this.$page.props.user)==null?void 0:r.permissions)==null?void 0:i.some(a=>a.name===t))||!1})}},methods:{canModifyRole(n){var r,i;if(this.isAdmin)return!0;const t=`roles.assign.${n.toLowerCase().replace("+","-plus").replace(" ","-")}`;return((i=(r=this.$page.props.user)==null?void 0:r.permissions)==null?void 0:i.some(a=>a.name===t))||!1},getRoleDescription(n){return{Admin:"Fuld adgang til alle funktioner i systemet",Support:"Adgang til kundeservice funktioner og brugeradministration",Security:"Adgang til sikkerhedsfunktioner og karantæner","FCK+":"FCK+ medlemskab med særlige fordele",Tester:"Adgang til at teste nye funktioner",Fanshop:"Adgang til fanshop administration",Partner:"Partner adgang med særlige rettigheder","Quarantine Viewer":"Kan kun se karantæneliste og karantæner"}[n]||""},updateRole(n,e){n.checked=e,this.$inertia.put(`/admin/users/${this.users.id}/roles`,{_method:"PUT",roles:this.form.roles.map(t=>({id:t.id,name:t.name,checked:t.id===n.id?e:t.checked}))},{preserveScroll:!0,onSuccess:()=>{this.recentlySuccessful=!0,setTimeout(()=>{this.recentlySuccessful=!1},2e3)}})}}};var M3e=function(){var e=this,t=e._self._c;return t("jet-action-section-no-box",{scopedSlots:e._u([{key:"title",fn:function(){return[e._v("Roller")]},proxy:!0},{key:"description",fn:function(){return[e._v(" Her kan du styre hvilke roller en bruger skal have. ")]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"text-sm text-gray-600 md:col-span-2 px-4 py-5 sm:p-6 bg-white shadow-xl sm:rounded-lg"},[t("h4",{staticClass:"text-lg font-medium font-bold text-gray-700 mb-2"},[e._v("Roller")]),e._l(e.availableRoles,function(r,i){return t("div",{key:r.id},[t("div",{staticClass:"flex items-center justify-between"},[t("div",[t("div",{staticClass:"font-medium text-gray-900"},[e._v(e._s(r.name))]),t("div",{staticClass:"text-sm text-gray-500"},[e._v(e._s(e.getRoleDescription(r.name)))])]),t("jet-toggle",{attrs:{id:r.name,value:r.checked,disabled:!e.canModifyRole(r.name)},on:{input:a=>e.updateRole(r,a)}}
3927)],1),i<e.availableRoles.length-1?t("hr",{staticClass:"my-5"}):e._e()])}),t("jet-action-message",{staticClass:"mr-3 mt-2",attrs:{on:e.recentlySuccessful}},[e._v(" Gemt. ")])],2)]},proxy:!0}])})},D3e=[],N3e=ve(O3e,M3e,D3e,!1,null,null);const RB=N3e.exports,L3e=Object.freeze(Object.defineProperty({__proto__:null,default:RB},Symbol.toStringTag,{value:"Module"})),F3e={props:["users"],components:{JetFormSection:rd,JetButton:mn,JetConfirmsPassword:kv,JetDangerButton:vo,JetSecondaryButton:Br,JetToggle:u1,JetInput:Rn,JetLabel:Un,JetActionMessage:tu,JetInputError:ea},data(){return{form:this.$inertia.form({_method:"PUT",roboticket_id:this.users.roboticket_id,roboticket_account_id:this.users.roboticket_account_id,shopify_customer_id:this.users.shopify_customer_id,agillic_id:this.users.agillic_id}),isLoaded:!1}},watch:{users:{deep:!0,handler(n){this.form.roboticket_id=n.roboticket_id||null,this.form.roboticket_account_id=n.roboticket_account_id||null,this.form.shopify_customer_id=n.shopify_customer_id||null,this.form.agillic_id=n.agillic_id||null}}},methods:{updateExternalIds(){this.form.post(route("admin.users.update-external-ids",this.users.id),{errorBag:"updateExternalIds",preserveScroll:!0})}}};var $3e=function(){var e=this,t=e._self._c;return t("jet-form-section",{on:{submitted:e.updateExternalIds},scopedSlots:e._u([{key:"title",fn:function(){return[e._v("Externe forbindelser")]},proxy:!0},{key:"description",fn:function(){return[e._v(" Her kan du rette ID'er til eksterne systemer. ")]},proxy:!0},{key:"form",fn:function(){return[t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"roboticket_id",value:"Roboticket ID"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"roboticket_id",type:"number"},model:{value:e.users.roboticket_id,callback:function(r){e.$set(e.users,"roboticket_id",r)},expression:"users.roboticket_id"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.roboticket_id}})],1),t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"roboticket_account_id",value:"Roboticket Account ID"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"roboticket_account_id",type:"number"},model:{value:e.users.roboticket_account_id,callback:function(r){e.$set(e.users,"roboticket_account_id",r)},expression:"users.roboticket_account_id"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.roboticket_account_id}})],1),t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"shopify_customer_id",value:"Shopify Customer ID"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"shopify_customer_id",type:"number"},model:{value:e.users.shopify_customer_id,callback:function(r){e.$set(e.users,"shopify_customer_id",r)},expression:"users.shopify_customer_id"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.shopify_customer_id}})],1),t("div",{staticClass:"col-span-6 sm:col-span-4"},[t("jet-label",{attrs:{for:"agillic_id",value:"Agillic ID"}}),t("jet-input",{staticClass:"mt-1 block w-full",attrs:{id:"agillic_id",type:"text"},model:{value:e.users.agillic_id,callback:function(r){e.$set(e.users,"agillic_id",r)},expression:"users.agillic_id"}}),t("jet-input-error",{staticClass:"mt-2",attrs:{message:e.form.errors.agillic_id}})],1)]},proxy:!0},{key:"actions",fn:function(){return[t("jet-action-message",{staticClass:"mr-3",attrs:{on:e.form.recentlySuccessful}},[e._v(" Saved. ")]),t("jet-button",{class:{"opacity-25":e.form.processing},attrs:{disabled:e.form.processing}},[e._v(" Save ")])]},proxy:!0}])})},B3e=[],U3e=ve(F3e,$3e,B3e,!1,null,null);const AB=U3e.exports,j3e=Object.freeze(Object.defineProperty({__proto__:null,default:AB},Symbol.toStringTag,{value:"Module"})),q3e={props:["users"],components:{AdminLayout:Gt,UpdateUserInformationForm:EB,PermissionsForm:JE,UpdateAddressInformationForm:ZE,UpdateUserPassword:PB,UpdateUserRoles:RB,UpdateExternalProfiles:AB,DeleteUserForm:TB}};var z3e=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("users.users.edit"))+" "+e._s(e.users.firstname)+" "+e._s(e.users.lastname)+" ")])]},proxy:!0}])},[t("div",[t("div",{staticClass:"max-w-7xl mx-auto py-10 sm:px-6 lg:px-8"},[t("update-user-information-form",{attrs:{users:e.users}})],1),t("div",{staticClass:"max-w-7xl mx-auto py-10 sm:px-6 lg:px-8"},[t("update-external-profiles",{attrs:{users:e.users}})],1),t("div",{staticClass:"max-w-7xl mx-auto py-10 sm:px-6 lg:px-8"}
3927,[t("update-address-information-form",{attrs:{user:e.users}})],1),t("div",{staticClass:"max-w-7xl mx-auto py-10 sm:px-6 lg:px-8"},[t("update-user-password",{attrs:{users:e.users}})],1),t("div",{staticClass:"max-w-7xl mx-auto py-10 sm:px-6 lg:px-8"},[t("permissions-form",{attrs:{users:e.users}})],1),e.$page.props.user.roles.some(r=>r.name==="Admin")||e.$page.props.user.permissions.some(r=>["roles.assign.admin","roles.assign.support","roles.assign.security","roles.assign.fck-plus","roles.assign.tester","roles.assign.fanshop"].includes(r.name))?t("div",{staticClass:"max-w-7xl mx-auto py-10 sm:px-6 lg:px-8"},[t("update-user-roles",{attrs:{users:e.users,roles:e.$page.props.roles}})],1):e._e(),e.$page.props.user.permissions.some(r=>r.name==="users.delete")?t("div",{staticClass:"max-w-7xl mx-auto py-10 sm:px-6 lg:px-8"},[t("delete-user-form",{attrs:{users:e.users}})],1):e._e()])])},W3e=[],H3e=ve(q3e,z3e,W3e,!1,null,null);const V3e=H3e.exports,G3e=Object.freeze(Object.defineProperty({__proto__:null,default:V3e},Symbol.toStringTag,{value:"Module"})),K3e={props:{users:{type:Object,required:!0}},components:{AdminLayout:Gt,JetPagination:Rp},created(){this.fetchUsers=this.debounce(this.fetchUsers,300)},data(){return{search:"",fetching:!1}},methods:{async fetchUsers(){this.fetching=!0,await this.$inertia.get("/admin/users",{search:this.search},{preserveState:!0,preserveScroll:!0,replace:!0}),this.fetching=!1},debounce(n,e,t){let r;return function(){const i=this,a=arguments,s=function(){r=null,t||n.apply(i,a)},o=t&&!r;clearTimeout(r),r=setTimeout(s,e),o&&n.apply(i,a)}}}};var Y3e=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"flex flex-row justify-between"},[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v(" "+e._s(e.$trans("pages.users.users"))+" ")]),t("div",{staticClass:"flex flew-row justify-center items-center"},[e.fetching?t("svg",{staticClass:"animate-spin w-6 h-6 mr-3",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}})]):e._e(),t("input",{directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],staticClass:"border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full",attrs:{type:"text",placeholder:"Search users..."},domProps:{value:e.search},on:{input:[function(r){r.target.composing||(e.search=r.target.value)},e.fetchUsers]}})])])]},proxy:!0},{key:"footer",fn:function(){return[e.users.data.length>0?t("jet-pagination",{attrs:{total:e.users.total,per_page:e.users.per_page,current_page:e.users.current_page,last_page:e.users.last_page,first_page_url:e.users.first_page_url,last_page_url:e.users.last_page_url,next_page_url:e.users.next_page_url,prev_page_url:e.users.prev_page_url,path:e.users.path,from:e.users.from,to:e.users.to,data:e.users.data,search:e.search}}):e._e()]},proxy:!0}])},[t("div",{staticClass:"flex flex-col flex-grow shadow-lg bg-white rounded mt-4 max-h"},[t("table",{staticClass:"min-w-full divide-y divide-gray-200"},[t("thead",{staticClass:"bg-gray-50"},[t("tr",[t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" "+e._s(e.$trans("pages.users.name"))+" ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" Email ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" "+e._s(e.$trans("pages.users.status"))+" ")]),t("th",{staticClass:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",attrs:{scope:"col"}},[e._v(" "+e._s(e.$trans("pages.users.role"))+" ")]),t("th",{staticClass:"relative px-4 py-3",attrs:{scope:"col"}},[t("span",{staticClass:"sr-only"},[e._v(e._s(e.$trans("pages.users.edit")))])])])]),t("tbody",{staticClass:"bg-white divide-y divide-gray-200"},[e._l(e.users.data,function(r){return t("tr",{key:r.id},[t("td",{staticClass:"px-4 py-4 whitespace-nowrap"},[e._v(" "+e._s(r.firstname)+" "+e._s(r.lastname)+" ")]),t("td",[e._v(" "+e._s(r.email)+" ")]),r.email_verified_at?t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[t("span",{staticClass:"px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800"},[e._v("Active")])]):t("td",{staticClass:"px-6 py-4 whitespace-nowrap"},[t("span",{staticClass:"px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800"},[e._v("Email not verified")])]),t("td",{},[e._v(" "+e._s(r.roles.map(i=>i.name).join(", "))+" ")]),t("td",{staticClass:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium"},[t("a",{staticClass:"text-indigo-600 hover:text-indigo-900 hover:underline",attrs:{href:`/admin/users/${r.id}`}},[e._v(e._s(e.$trans("pages.users.show"))+" ")]),t("span",[e._v("|")]),t("a",{staticClass:"text-indigo-600 hover:text-indigo-900 hover:underline",attrs:{href:`/admin/users/${r.id}/edit`}},[e._v(e._s(e.$trans("pages.users.edit")))])])])}),e.users.data.length==0?t("tr",[t("td",{staticClass:"px-4 py-4",attrs:{colspan:"5"}},[t("div",{staticClass:"flex flex-row justify-center items-center"},[t("svg",{staticClass:"h-10 w-10",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"}})]),t("p",{staticClass:"text-sm font-medium text-gray-900"},[e._v(e._s(`"${this.search}
3927"`)+" "+e._s(e.$trans("pages.users.noResults")))])])])]):e._e()],2)])])])},X3e=[],J3e=ve(K3e,Y3e,X3e,!1,null,null);const Q3e=J3e.exports,Z3e=Object.freeze(Object.defineProperty({__proto__:null,default:Q3e},Symbol.toStringTag,{value:"Module"})),e4e={name:"AppTokens",props:{id:{type:Number,required:!0}},data(){return{tokens:[]}},mounted(){this.getAppTokens()},methods:{async getAppTokens(){this.fetching=!0;try{let e=await(await fetch(`/admin/users/${this.id}/app-tokens`,{method:"GET",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').getAttribute("content")}})).json();e.tokens.sort((t,r)=>new Date(r.last_used_at)-new Date(t.last_used_at)),this.tokens=e.tokens.slice(0,5)}catch(n){console.error(n)}this.fetching=!1},getHumanTime(n){let e=navigator.language||"da-DK";return Le(n).locale(e).fromNow()}}};var t4e=function(){var e=this,t=e._self._c;return t("div",{staticClass:"bg-white p-3 overflow-hidden shadow-lg transition duration-500 hover:shadow-xl sm:rounded-lg mb-6 lg:mb-8 flex flex-col"},[t("div",{staticClass:"flex items-center space-x-2 font-semibold text-gray-900 leading-8 mb-3"},[t("span",{attrs:{clas:"text-green-500"}},[t("svg",{staticClass:"w-6 h-6",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 1.5H8.25A2.25 2.25 0 0 0 6 3.75v16.5a2.25 2.25 0 0 0 2.25 2.25h7.5A2.25 2.25 0 0 0 18 20.25V3.75a2.25 2.25 0 0 0-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3"}})])]),t("span",{staticClass:"text-2xl font-black tracking-wide"},[e._v("Apps")])]),t("div",{staticClass:"grid flex flex-col divide-y"},e._l(e.tokens,function(r){return t("div",{staticClass:"py-2"},[t("h2",{staticClass:"text-xl uppercase"},[e._v(e._s(r.name))]),t("p",{staticClass:"text-sm"},[e._v("Sidst online ")]),t("p",{staticClass:"text-xs"},[e._v(e._s(e.getHumanTime(r.last_used_at))+" ("+e._s(new Date(r.last_used_at).toLocaleDateString("da-DK"))+" "+e._s(new Date(r.last_used_at).toLocaleTimeString("da-DK"))+") ")]),t("p",{staticClass:"text-sm"},[e._v("Første login")]),t("p",{staticClass:"text-xs"},[e._v(e._s(e.getHumanTime(r.created_at))+" ("+e._s(new Date(r.created_at).toLocaleDateString("da-DK"))+" "+e._s(new Date(r.created_at).toLocaleTimeString("da-DK"))+")")])])}),0)])},n4e=[],r4e=ve(e4e,t4e,n4e,!1,null,null);const i4e=r4e.exports,a4e={props:["id"],data(){return{fetching:!0,roboticketId:null,chain:{},lastKnown:null,closedWorld:!1,setIsFresh:!1,entitlements:[]}},created(){this.getEntitlements()},computed:{chainSteps(){return[{key:"cached",label:"Gemt svar",explanation:"læses først og kortslutter alt nedenfor",value:this.chain.cached===void 0?null:this.chain.cached},{key:"role_fckplus",label:"FCK+ rolle",explanation:"tildelt manuelt, uafhængigt af Roboticket",value:!!this.chain.role_fckplus},{key:"internal_email",label:"Intern e-mail",explanation:"@fck.dk eller @parken.dk",value:!!this.chain.internal_email},{key:"partner_entitled",label:"Partner",explanation:"fra Airtable via den daglige partners:sync",value:!!this.chain.partner_entitled},{key:"local_set",label:"Lokalt rettighedssæt",explanation:"aktivt produkt der giver adgang, se tabellen nedenfor",value:!!this.chain.local_set}]},decidingStep(){const n=this.chainSteps.find(e=>e.value===!0);return n?n.key:null}},methods:{getEntitlements(){return this.fetching=!0,axios.get(`/admin/users/${this.id}/entitlements`).then(n=>{const e=(n==null?void 0:n.data)||{};this.roboticketId=e.roboticket_id??null,this.chain=e.chain||{},this.lastKnown=e.last_known??null,this.closedWorld=!!e.closed_world,this.setIsFresh=!!e.set_is_fresh,this.entitlements=e.entitlements||[]}).finally(()=>{this.fetching=!1})},sourceLabel(n){return{event:"mp-server",rebuild:"genopbygning",refresh:"manuelt opslag"}[n]||n},formatDate(n){return n?Le(n).format("D-M-YYYY HH:mm"):"â"}}};var s4e=function(){var e=this,t=e._self._c;return t("div",[e._m(0),e.fetching?t("div",{staticClass:"bg-white shadow-sm border border-gray-100 p-4 space-y-3 mb-6"},e._l(3,function(r){return t("div",{key:r,staticClass:"h-4 bg-gray-200 rounded animate-pulse",class:r===1?"w-1/2":"w-3/4"})}),0):t("div",{staticClass:"bg-white shadow-sm border border-gray-100 mb-6"},[t("div",{staticClass:"p-4"},[t("p",{staticClass:"text-sm text-gray-500 mb-3"},[e._v(" Første grønne linje er den, der afgør adgangen. Alt under den bliver aldrig læst. ")
3927]),t("ol",{staticClass:"text-sm divide-y divide-gray-100"},e._l(e.chainSteps,function(r){return t("li",{key:r.key,staticClass:"flex items-start gap-3 py-2"},[t("span",{staticClass:"mt-0.5 w-2 h-2 rounded-full flex-shrink-0",class:r.value===!0?"bg-green-500":r.value===!1?"bg-gray-300":"bg-amber-400"}),t("span",{staticClass:"flex-1"},[t("span",{class:{"font-bold":r.key===e.decidingStep}},[e._v(e._s(r.label))]),t("span",{staticClass:"text-gray-500"},[e._v(" â "+e._s(r.explanation))])]),t("span",{staticClass:"font-mono text-xs",class:r.value===!0?"text-green-700":"text-gray-500"},[e._v(" "+e._s(r.value===null?"ikke sat":r.value?"ja":"nej")+" ")])])}),0)]),t("div",{staticClass:"px-4 py-3 bg-gray-50 border-t border-gray-100 text-sm flex flex-wrap gap-x-6 gap-y-1"},[t("span",[t("span",{staticClass:"text-gray-500"},[e._v("Roboticket-ID:")]),t("span",{staticClass:"font-mono"},[e._v(e._s(e.roboticketId||"â"))])]),t("span",[t("span",{staticClass:"text-gray-500"},[e._v("Sidst kendte svar:")]),e._v(" "+e._s(e.lastKnown===null?"ikke sat":e.lastKnown?"ja":"nej")+" ")]),t("span",[t("span",{staticClass:"text-gray-500"},[e._v("Lokalt sæt:")]),e._v(" "+e._s(e.closedWorld?"afgør adgangen":"kun skygge")+", "+e._s(e.setIsFresh?"frisk":"forældet")+" ")])]),e.entitlements.length?t("div",{staticClass:"overflow-x-auto border-t border-gray-100"},[t("table",{staticClass:"min-w-full divide-y divide-gray-200 text-sm"},[e._m(1),t("tbody",{staticClass:"divide-y divide-gray-100"},e._l(e.entitlements,function(r){return t("tr",{key:r.product,class:{"text-gray-400":!r.active}},[t("td",{staticClass:"px-4 py-2 font-mono whitespace-nowrap"},[e._v(e._s(r.product))]),t("td",{staticClass:"px-4 py-2"},[e._v(e._s(r.product_name||"â"))]),t("td",{staticClass:"px-4 py-2"},[e._v(e._s(r.active?"ja":"nej"))]),t("td",{staticClass:"px-4 py-2"},[r.grants?t("span",{staticClass:"text-green-700"},[e._v("ja")]):t("span",{staticClass:"text-gray-500"},[e._v("nej")])]),t("td",{staticClass:"px-4 py-2"},[e._v(e._s(e.sourceLabel(r.source)))]),t("td",{staticClass:"px-4 py-2 whitespace-nowrap"},[e._v(e._s(e.formatDate(r.last_applied_at)))])])}),0)])]):e.roboticketId?t("p",{staticClass:"px-4 py-3 border-t border-gray-100 text-sm text-gray-500"},[e._v(" Ingen rettigheder registreret for dette Roboticket-ID. Er købet lige gennemført, kan hændelsen fra Roboticket stadig være undervejs â den hentes senest ved næste timekørsel. ")]):t("p",{staticClass:"px-4 py-3 border-t border-gray-100 text-sm text-gray-500"},[e._v(" Brugeren har intet Roboticket-ID, sÃ¥ der findes ingen rettigheder at slÃ¥ op. ")])])])},o4e=[function(){var n=this,e=n._self._c;return e("div",[e("h1",{staticClass:"border-l-4 border-fck-blue text-2xl pl-2 line normal-case leading-lg font-black mb-3"},[n._v(" FCK+ adgang ")])])},function(){var n=this,e=n._self._c;return e("thead",{staticClass:"bg-gray-50"},[e("tr",[e("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[n._v("Produkt")]),e("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[n._v("Navn")]),e("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[n._v("Aktiv")]),e("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[n._v("Giver adgang")]),e("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[n._v("Kilde")]),e("th",{staticClass:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase"},[n._v("Opdateret")])])])}],c4e=ve(a4e,s4e,o4e,!1,null,null);const u4e=c4e.exports,l4e={components:{JetDialogModal:Ep,JetSecondaryButton:Br,JetButton:mn},props:{id:{required:!0}},data(){return{showing:!1,fetching:!1,saving:!1,status:null,result:null,email:null,stored:{roboticket_id:null,roboticket_account_id:null},remote:null,conflict:null}},computed:{comparison(){const n=this.remote||{};return[{field:"roboticket_id",label:"Roboticket_user_id",stored:this.stored.roboticket_id,remote:n.roboticket_id??null,changed:this.stored.roboticket_id!==(n.roboticket_id??null)},{field:"roboticket_account_id",label:"Roboticket_account_id",stored:this.stored.roboticket_account_id,remote:n.roboticket_account_id??null,changed:this.stored.roboticket_account_id!==(n.roboticket_account_id??null)}]}},methods:{open(){this.showing=!0,this.result=null,this.lookup()},close(){this.showing=!1},display(n){return n==null||n===""?"â":n},lookup(){return this.fetching=!0,this.result=null,axios.get(`/admin/users/${this.id}/roboticket-account`).then(n=>{const e=(n==null?void 0:n.data)||{};this.status=e.status,this.email=e.email,this.stored=e.stored||{roboticket_id:null,roboticket_account_id:null},this.remote=e.remote,this.conflict=e.conflict}).catch(()=>{this.status="unavailable"}).finally(()=>{this.fetching=!1})},applyChange(){if(this.remote)return this.saving=!0,axios.post(`/admin/users/${this.id}/roboticket-account`,{roboticket_id:this.remote.roboticket_id,roboticket_account_id:this.remote.roboticket_account_id}).then(n=>{const e=(n==null?void 0:n.data)||{};this.result=e.status,e.status==="linked"&&(this.stored=e.stored||this.stored,this.status="match",this.$inertia.reload({preserveScroll:!0}),this.$emit("linked",this.stored))}).catch(n=>{var t;const e=((t=n==null?void 0:n.response)==null?void 0:t.data)||{};e.status==="changed"?(this.result="changed",this.remote=e.remote||this.remote):e.status==="conflict"?(this.conflict=e.conflict,this.result=null):this.result="error"}).finally(()=>{this.saving=!1})}}};var d4e=function(){var e=this,t=e._self._c;return t("div",[t("button",{staticClass:"w-full mt-2 border border-fck-blue text-fck-blue text-sm py-2 px-3 rounded hover:bg-blue-50 transition",attrs:{type:"button"},on:{click:e.open}},[e._v(" Tjek Roboticket-tilknytning ")]),t("jet-dialog-modal",{attrs:{show:e.showing},on:{close:e.close},scopedSlots:e._u([{key:"title",fn:function(){return[e._v("Roboticket-tilknytning")]},proxy:!0},{key:"content",fn:function(){return[t("p",{staticClass:"text-sm text-gray-600"},[e._v(" SlÃ¥r "),t("span",{staticClass:"font-semibold"},[e._v(e._s(e.email||"brugeren"))]),e._v(" op hos Roboticket og sammenligner med de ID'er, der er gemt her. ")]),t("dl",{staticClass:"mt-4 grid grid-cols-2 gap-x-4 gap-y-1 text-sm"},[t("dt",{staticClass:"text-gray-500"},[e._v("Roboticket_user_id")]),t("dd",{staticClass:"font-mono"},[e._v(e._s(e.display(e.stored.roboticket_id)))]),t("dt",{staticClass:"text-gray-500"},[e._v("Roboticket_account_id")]),t("dd",{staticClass:"font-mono"},[e._v(e._s(e.display(e.stored.roboticket_account_id)))])]),e.fetching?t("div",{staticClass:"mt-5 flex items-center text-sm text-gray-500"},[t("svg",{staticClass:"animate-spin h-4 w-4 mr-2",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[t("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}
3927),t("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"}})]),e._v(" Henter fra Roboticket⦠")]):[e.status==="match"?t("div",{staticClass:"mt-5 rounded bg-green-50 border border-green-200 p-3"},[t("p",{staticClass:"text-sm text-green-800"},[e._v(" Roboticket returnerer de samme ID'er. Der er ikke noget at opdatere. ")])]):e.status==="not_found"?t("div",{staticClass:"mt-5 rounded bg-gray-50 border border-gray-200 p-3"},[t("p",{staticClass:"text-sm text-gray-700"},[e._v(" Roboticket har ingen konto pÃ¥ denne email. De gemte ID'er er urørt. ")])]):e.status==="no_email"?t("div",{staticClass:"mt-5 rounded bg-gray-50 border border-gray-200 p-3"},[t("p",{staticClass:"text-sm text-gray-700"},[e._v(" Profilen har ingen email, sÃ¥ der er intet at slÃ¥ op pÃ¥. ")])]):e.status==="unavailable"?t("div",{staticClass:"mt-5 rounded bg-red-50 border border-red-200 p-3"},[t("p",{staticClass:"text-sm text-red-800"},[e._v(" Kunne ikke fÃ¥ svar fra Roboticket. Det betyder ikke, at kontoen mangler â prøv igen om lidt. ")])]):e.status==="differs"?t("div",{staticClass:"mt-5"},[t("table",{staticClass:"w-full text-sm"},[t("thead",[t("tr",{staticClass:"text-left text-xs uppercase tracking-wide text-gray-500"},[t("th",{staticClass:"py-1 font-medium"},[e._v("Felt")]),t("th",{staticClass:"py-1 font-medium"},[e._v("I FCK Profil")]),t("th",{staticClass:"py-1 font-medium"},[e._v("Hos Roboticket")])])]),t("tbody",e._l(e.comparison,function(r){return t("tr",{key:r.field,staticClass:"border-t border-gray-100"},[t("td",{staticClass:"py-2 text-gray-600"},[e._v(e._s(r.label))]),t("td",{staticClass:"py-2 font-mono"},[e._v(e._s(e.display(r.stored)))]),t("td",{staticClass:"py-2 font-mono",class:r.changed?"text-fck-blue font-semibold":""},[e._v(" "+e._s(e.display(r.remote))+" ")])])}),0)]),e.remote&&(e.remote.name||e.remote.member_id)?t("p",{staticClass:"mt-3 text-xs text-gray-500"},[e._v(" Roboticket-kontoen tilhører "),e.remote.name?t("span",{staticClass:"font-semibold"},[e._v(e._s(e.remote.name))]):e._e(),e.remote.member_id?t("span",[e._v(" (medlemsnr. "+e._s(e.remote.member_id)+")")]):e._e(),e._v(". ")]):e._e(),e.conflict?t("div",{staticClass:"mt-4 rounded bg-yellow-50 border border-yellow-200 p-3"},[t("p",{staticClass:"text-sm text-yellow-900"},[t("span",{staticClass:"font-semibold"},[e._v(e._s(e.conflict.name||"En anden profil"))]),e.conflict.email?t("span",[e._v(" ("+e._s(e.conflict.email)+")")]):e._e(),e._v(" bruger allerede disse ID'er. To profiler pÃ¥ én Roboticket-konto giver begge den samme adgang, sÃ¥ tilknytningen skal ryddes op der først. ")]),t("inertia-link",{staticClass:"mt-2 inline-block text-sm underline text-yellow-900",attrs:{href:`/admin/users/${e.conflict.id}`}},[e._v(" Ã
bn profilen ")])],1):e._e()]):e._e(),e.result==="linked"?t("div",{staticClass:"mt-4 rounded bg-green-50 border border-green-200 p-3"},[t("p",{staticClass:"text-sm text-green-800"},[e._v(" ID'erne er opdateret. Abonnements-svaret for brugeren er nulstillet, sÃ¥ det beregnes forfra ved næste opslag. ")])]):e.result==="changed"?t("div",{staticClass:"mt-4 rounded bg-yellow-50 border border-yellow-200 p-3"},[t("p",{staticClass:"text-sm text-yellow-900"},[e._v(" Roboticket svarer nu noget andet, end det der stod pÃ¥ skærmen. Intet er skrevet â slÃ¥ op igen. ")])]):e.result==="error"?t("div",{staticClass:"mt-4 rounded bg-red-50 border border-red-200 p-3"},[t("p",{staticClass:"text-sm text-red-800"},[e._v("Opdateringen fejlede. Intet er ændret.")])]):e._e()]]},proxy:!0},{key:"footer",fn:function(){return[t("jet-secondary-button",{nativeOn:{click:function(r){return e.close.apply(null,arguments)}}},[e._v(" "+e._s(e.result==="linked"?"Luk":"Annullér")+" ")]),e.status==="differs"&&!e.conflict&&e.result!=="linked"?t("jet-button",{staticClass:"ml-2",class:{"opacity-25":e.saving},attrs:{disabled:e.saving},nativeOn:{click:function(r){return e.applyChange.apply(null,arguments)}}},[e._v(" "+e._s(e.saving?"Opdatererâ¦":"Opdatér i FCK Profil")+" ")]):e.status==="unavailable"?t("jet-button",{staticClass:"ml-2",attrs:{disabled:e.fetching},nativeOn:{click:function(r){return e.lookup.apply(null,arguments)}}}
3927,[e._v(" Prøv igen ")]):e._e()]},proxy:!0}])})],1)},f4e=[],h4e=ve(l4e,d4e,f4e,!1,null,null);const p4e=h4e.exports,m4e={name:"AwayScans",props:{id:{type:[Number,String],required:!0},autoload:{type:Boolean,default:!0}},data(){return{scans:[],loading:!1,error:null}},mounted(){this.autoload&&this.fetchScans()},computed:{sortedScans(){return[...this.scans].sort((n,e)=>Le(e.created_at).valueOf()-Le(n.created_at).valueOf())}},methods:{formatDate(n){return Le(n).format("DD/MM/YYYY")},formatTime(n){return Le(n).format("HH:mm")},async fetchScans(){this.loading=!0,this.error=null;try{const n=await fetch(route("admin.fck-away.scan.user-scans",this.id));if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);this.scans=await n.json()}catch(n){console.error("Error fetching scans:",n),this.error="Failed to load scans. Please try again."}finally{this.loading=!1}}}};var g4e=function(){var e=this,t=e._self._c;return t("div",{staticClass:"bg-white p-3 overflow-hidden shadow-lg transition duration-500 hover:shadow-xl sm:rounded-lg mb-6 lg:mb-8"},[t("div",{staticClass:"p-6"},[t("div",{staticClass:"flex justify-between items-center mb-4"},[t("h3",{staticClass:"text-lg font-medium text-gray-900"},[e._v("Away Game Scans")]),t("div",{staticClass:"flex items-center space-x-2"},[e.loading?t("svg",{staticClass:"animate-spin h-5 w-5 text-gray-500",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[t("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]):t("button",{staticClass:"p-1 text-gray-400 hover:text-gray-500 focus:outline-none",on:{click:e.fetchScans}},[t("svg",{staticClass:"h-5 w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z","clip-rule":"evenodd"}})])]),t("span",{staticClass:"px-3 py-1 text-sm rounded-full",class:e.scans.length?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"},[e._v(" "+e._s(e.scans.length)+" "+e._s(e.scans.length===1?"scan":"scans")+" ")])])]),e.error?t("div",{staticClass:"rounded-md bg-red-50 p-4 mb-4"},[t("div",{staticClass:"flex"},[t("div",{staticClass:"flex-shrink-0"},[t("svg",{staticClass:"h-5 w-5 text-red-400",attrs:{viewBox:"0 0 20 20",fill:"currentColor"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"}})])]),t("div",{staticClass:"ml-3"},[t("h3",{staticClass:"text-sm font-medium text-red-800"},[e._v("Error loading scans")]),t("div",{staticClass:"mt-2 text-sm text-red-700"},[t("p",[e._v(e._s(e.error))])])])])]):e._e(),e.loading&&!e.scans.length?t("div",{staticClass:"text-center py-12"},[t("svg",{staticClass:"animate-spin h-8 w-8 mx-auto text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[t("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t("p",{staticClass:"mt-2 text-sm text-gray-500"},[e._v("Loading scans...")])]):e.scans.length===0?t("div",{staticClass:"text-center py-8"},[t("svg",{staticClass:"mx-auto h-12 w-12 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"}})]),t("h3",{staticClass:"mt-2 text-sm font-medium text-gray-900"},[e._v("No scans yet")]),t("p",{staticClass:"mt-1 text-sm text-gray-500"},[e._v("This user hasn't been scanned at any away games yet.")])]):t("div",{staticClass:"mt-2"},[t("div",{staticClass:"overflow-hidden shadow ring-1 ring-black ring-opacity-5 sm:rou
3927nded-lg"},[t("table",{staticClass:"min-w-full divide-y divide-gray-300"},[e._m(0),t("tbody",{staticClass:"divide-y divide-gray-200 bg-white"},e._l(e.sortedScans,function(r){return t("tr",{key:r.id,staticClass:"hover:bg-gray-50"},[t("td",{staticClass:"whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6"},[t("div",{staticClass:"font-medium text-gray-900"},[e._v(" "+e._s(r.game.home_team.name)+" - "+e._s(r.game.away_team.name)+" ")])]),t("td",{staticClass:"whitespace-nowrap px-3 py-4 text-sm text-gray-500"},[e._v(" "+e._s(e.formatDate(r.game.kickoff_at))+" ")]),t("td",{staticClass:"whitespace-nowrap px-3 py-4 text-sm text-gray-500"},[e._v(" "+e._s(r.game.home_team.stadium)+" ")]),t("td",{staticClass:"whitespace-nowrap px-3 py-4 text-sm text-gray-500"},[e._v(" "+e._s(e.formatTime(r.created_at))+" ")])])}),0)])])])])])},v4e=[function(){var n=this,e=n._self._c;return e("thead",{staticClass:"bg-gray-50"},[e("tr",[e("th",{staticClass:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6",attrs:{scope:"col"}},[n._v("Game")]),e("th",{staticClass:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900",attrs:{scope:"col"}},[n._v("Date")]),e("th",{staticClass:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900",attrs:{scope:"col"}},[n._v("Stadium")]),e("th",{staticClass:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900",attrs:{scope:"col"}},[n._v("Scan Time")])])])}],y4e=ve(m4e,g4e,v4e,!1,null,null);const _4e=y4e.exports,b4e={name:"VideoViews",props:{id:{type:Number,required:!0}},data(){return{videoViews:[],totalViews:0,loading:!1,error:null}},mounted(){this.getVideoViews()},methods:{async getVideoViews(){this.loading=!0,this.error=null;try{const n=await fetch(`/admin/users/${this.id}/video-views`,{method:"GET",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').getAttribute("content")}}),e=await n.json();if(!n.ok)throw new Error(e.message||"Failed to fetch video views");if(e.success)this.videoViews=e.data.views||[],this.totalViews=e.data.total_count||0;else throw new Error(e.message||"Failed to fetch video views")}catch(n){console.error("Error fetching video views:",n),this.error="Kunne ikke hente videovisninger"}finally{this.loading=!1}},calculateWatchTime(n,e){if(!n||!e)return"N/A";const t=Le(n),r=Le(e);if(!t.isValid()||!r.isValid())return"N/A";const i=r.diff(t,"seconds");return i<=0?"0s":this.formatWatchTime(i)},calculateTotalWatchTime(){return this.videoViews.reduce((n,e)=>{if(!e.view_start||!e.view_end)return n;const t=Le(e.view_start),r=Le(e.view_end);if(!t.isValid()||!r.isValid())return n;const i=r.diff(t,"seconds");return n+(i>0?i:0)},0)},formatWatchTime(n){if(!n||n===0)return"0s";const e=Math.floor(n/3600),t=Math.floor(n%3600/60),r=Math.floor(n%60);return e>0?`${e}t ${t}m ${r}s`:t>0?`${t}m ${r}s`:`${r}s`},formatDateTime(n){return n?Le(n).format("DD/MM/YYYY HH:mm"):"N/A"}}};var x4e=function(){var e=this,t=e._self._c;return t("div",[e._m(0),e.loading?t("div",{staticClass:"grid sm:grid-cols-2 gap-6 mb-6"},e._l(4,function(r){return t("div",{key:r,staticClass:"bg-white rounded-lg overflow-hidden shadow-sm border border-gray-100"},[t("div",{staticClass:"p-4 space-y-3"},[t("div",{staticClass:"h-6 bg-gray-200 rounded animate-pulse w-3/4"}),t("div",{staticClass:"grid grid-cols-2 gap-4 pt-2"},e._l(4,function(i){return t("div",{key:i,staticClass:"space-y-2"},[t("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-1/2"}),t("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-3/4"})])}),0)]),e._m(1,!0)])}),0):e.error?t("div",{staticClass:"text-center py-8"},[t("div",{staticClass:"text-red-500 mb-2"},[t("svg",{staticClass:"w-8 h-8 mx-auto",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"}})])]),t("p",{staticClass:"text-red-600"},[e._v(e._s(e.error))])]):!e.videoViews||e.videoViews.length===0?t("div",{staticClass:"text-center py-12 mb-6"},[t("svg",{staticClass:"mx-auto h-12 w-12 text-gray-400",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z"}})]),t("h3",{staticClass:"mt-2 text-lg font-medium text-gray-900"},[e._v("Ingen videovisninger")]),t("p",{staticClass:"mt-1 text-sm text-gray-500"},[e._v("Denne bruger har ikke set videoer i de seneste 30 dage")])]):e.videoViews&&e.videoViews.length>0?t("div",{staticClass:"mb-4 p-4 bg-blue-50 border border-blue-200 rounded-lg"},[t("div",{staticClass:"grid grid-cols-2 gap-4 text-center"},[t("div",[t("p",{staticClass:"text-2xl font-bold text-[#002D62]"},[e._v(e._s(e.totalViews))]),t("p",{staticClass:"text-sm text-gray-600"},[e._v("Total visninger")])]),t("div",[t("p",{staticClass:"text-2xl font-bold text-[#002D62]"},[e._v(e._s(e.formatWatchTime(e.calculateTotalWatchTime())))]),t("p",{staticClass:"text-sm text-gray-600"}
3927,[e._v("Total seertid")])])])]):e._e(),e.videoViews&&e.videoViews.length>0?t("div",{staticClass:"bg-white rounded-lg border border-gray-200 overflow-hidden mb-6"},[t("div",{staticClass:"divide-y divide-gray-200"},e._l(e.videoViews,function(r){return t("div",{key:r.id,staticClass:"px-6 py-4 hover:bg-gray-50 transition-colors duration-150"},[t("div",{staticClass:"flex justify-between items-start mb-3"},[t("h3",{staticClass:"text-lg font-semibold text-[#002D62] flex-1 pr-4"},[e._v(" "+e._s(r.video_title)+" ")]),t("div",{staticClass:"flex items-center space-x-2"},[r.playback_failure?t("span",{staticClass:"text-xs bg-red-100 text-red-800 px-2 py-1 rounded-full"},[e._v(" Fejl ")]):e._e(),t("span",{staticClass:"text-sm text-gray-400"},[e._v(" #"+e._s(r.id.slice(-8))+" ")])])]),t("div",{staticClass:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm"},[t("div",[t("span",{staticClass:"text-gray-500 font-medium"},[e._v("Start:")]),t("span",{staticClass:"ml-1 text-gray-900"},[e._v(e._s(e.formatDateTime(r.view_start)))])]),r.view_end?t("div",[t("span",{staticClass:"text-gray-500 font-medium"},[e._v("Slut:")]),t("span",{staticClass:"ml-1 text-gray-900"},[e._v(e._s(e.formatDateTime(r.view_end)))])]):e._e(),t("div",[t("span",{staticClass:"text-gray-500 font-medium"},[e._v("Seertid:")]),t("span",{staticClass:"ml-1 text-gray-900"},[e._v(e._s(e.calculateWatchTime(r.view_start,r.view_end)))])]),t("div",[t("span",{staticClass:"text-gray-500 font-medium"},[e._v("Land:")]),t("span",{staticClass:"ml-1 text-gray-900"},[e._v(e._s(r.country_code||"N/A"))])])]),r.viewer_os_family||r.viewer_application_name?t("div",{staticClass:"mt-2 flex items-center space-x-4 text-sm text-gray-600"},[r.viewer_os_family?t("span",[t("strong",[e._v("OS:")]),e._v(" "+e._s(r.viewer_os_family)+" ")]):e._e(),r.viewer_application_name?t("span",[t("strong",[e._v("App:")]),e._v(" "+e._s(r.viewer_application_name)+" ")]):e._e(),r.viewer_device_name?t("span",[t("strong",[e._v("Enhed:")]),e._v(" "+e._s(r.viewer_device_name)+" ")]):e._e()]):e._e()])}),0)]):e._e()])},w4e=[function(){var n=this,e=n._self._c;return e("div",{},[e("h1",{staticClass:"border-l-4 border-fck-blue text-2xl pl-2 line normal-case leading-lg font-black mb-3"},[n._v("Video Views (30 dage)")])])},function(){var n=this,e=n._self._c;return e("div",{staticClass:"px-4 py-3 bg-gray-50 flex justify-between"},[e("div",{staticClass:"flex space-x-4"},[e("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-24"}),e("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-16"})]),e("div",{staticClass:"h-4 bg-gray-200 rounded animate-pulse w-20"})])}],C4e=ve(b4e,x4e,w4e,!1,null,null);const k4e=C4e.exports,S4e={props:["sessions","users"],components:{AdminLayout:Gt,Barcode:XE,Tickets:vE,SeasonTickets:CB,WebshopOrders:SB,Memberships:kB,AppTokens:i4e,UserEntitlements:u4e,RoboticketAccountModal:p4e,AwayScans:_4e,VideoViews:k4e,SeasonTicketUsageStats:QE},data(){return{refreshing:!1}},methods:{refreshSubscription(){this.refreshing=!0,this.$inertia.post(this.route("admin.users.refresh-subscription",this.users.id),{},{preserveScroll:!0,onFinish:()=>{this.refreshing=!1}})}},computed:{flash:function(){return this.$page.props.flash},formattedDate:function(){return Le(this.users.created_at).format("D-M-YYYY")},formattedAwayDate:function(){return Le(this.users.away_application.created_at).format("D-M-YYYY")}}};var T4e=function(){var e=this,t=e._self._c;return t("admin-layout",{scopedSlots:e._u([{key:"header",fn:function(){return[t("h2",{staticClass:"font-bold text-xl text-gray-800 leading-tight m-0"},[e._v("Profil")]),t("a",{attrs:{href:`${e.users.id}/edit`}},[e._v("Rediger profil")])]},proxy:!0}])},[t("div",{staticClass:"md:mx-auto my-5 p-5 max-w-7xl px-4 sm:px-6 lg:px-8"},[t("div",{staticClass:"md:flex no-wrap md:-mx-2"},[t("div",{staticClass:"w-full md:w-3/12 md:mx-2"},[t("div",{staticClass:"bg-white p-3 border-t-4 border-fck-blue"},[e.users.away_application?t("div",{staticClass:"flex justify-center"},[e.users.away_application.photo?t("img",{staticClass:"h-full w-full object-cover object-center",attrs:{src:e.users.away_application.photo,alt:"Away photo"}}
3927):e._e()]):e._e(),t("h1",{staticClass:"text-gray-900 text-center font-bold text-xl leading-8 my-1"},[e._v(" "+e._s(e.users.firstname)+" "+e._s(e.users.lastname)+" ")]),t("ul",{staticClass:"bg-gray-100 text-gray-600 py-2 px-3 mt-3 divide-y shadow-sm"},[t("li",{staticClass:"flex flex-col py-1"},[t("span",{staticClass:"font-bold"},[e._v("Status")]),e.users.email_verified_at?t("span",{},[t("span",{staticClass:"bg-green-500 py-1 px-2 rounded text-white text-sm"},[e._v("Active")])]):e._e(),e.users.email_verified_at?e._e():t("span",{},[t("span",{staticClass:"bg-red-500 py-1 px-2 rounded text-white text-sm"},[e._v("Email not verified")])])]),t("li",{staticClass:"flex flex-col"},[t("span",{staticClass:"font-bold"},[e._v("FCK Profil ID")]),t("span",{},[e._v(e._s(e.users.id)+" ")])]),t("li",{staticClass:"flex flex-col"},[t("span",{staticClass:"font-bold"},[e._v("FCK Profil siden")]),t("span",{},[e._v(e._s(e.formattedDate)+" ")])]),e.users.away_application?t("li",{staticClass:"flex flex-col"},[t("span",{staticClass:"font-bold"},[e._v("Awaymedlem siden")]),t("span",{},[e._v(e._s(e.formattedAwayDate)+" ")])]):e._e(),e.users.away_application?t("li",{staticClass:"flex flex-col"},[t("span",{staticClass:"font-bold"},[e._v("Awaymedlem ID")]),t("span",{},[e._v(e._s(e.users.away_application.id)+" ")])]):e._e(),e.users.roboticket_id?t("li",{staticClass:"flex flex-col"},[t("span",{staticClass:"font-bold"},[e._v("Roboticket_user_id")]),t("span",{},[e._v(e._s(e.users.roboticket_id)+" ")])]):e._e(),e.users.roboticket_account_id?t("li",{staticClass:"flex flex-col"},[t("span",{staticClass:"font-bold"},[e._v("Roboticket_account_id")]),t("span",{},[e._v(e._s(e.users.roboticket_account_id)+" ")])]):e._e(),e.users.agillic_id?t("li",{staticClass:"flex flex-col"},[t("span",{staticClass:"font-bold"},[e._v("Agillic_id")]),t("span",{},[e._v(e._s(e.users.agillic_id)+" ")])]):e._e(),e.users.shopify_customer_id?t("li",{staticClass:"flex flex-col"},[t("span",{staticClass:"font-bold"},[e._v("Shopify_customer_id")]),t("span",{},[e._v(e._s(e.users.shopify_customer_id)+" ")])]):e._e(),t("li",{staticClass:"flex flex-col"},[t("span",{staticClass:"font-bold"},[e._v("FCK+")]),t("span",{},[e._v(e._s(e.users.hasValidSubscription)+" ")])])]),e.users.roboticket_id?t("div",{staticClass:"mt-3"},[t("button",{staticClass:"w-full bg-fck-blue text-white text-sm py-2 px-3 rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-blue-900 transition",attrs:{type:"button",disabled:e.refreshing},on:{click:e.refreshSubscription}},[e._v(" "+e._s(e.refreshing?"Henter fra Roboticketâ¦":"Opdatér abonnement")+" ")]),e.flash?t("p",{staticClass:"mt-2 text-sm",class:e.flash.type==="error"?"text-red-600":"text-green-700"},[e._v(" "+e._s(e.flash.message)+" ")]):e._e()]):e._e(),t("roboticket-account-modal",{attrs:{id:e.users.id}})],1),t("div",{staticClass:"my-4"},[t("app-tokens",{attrs:{id:e.users.id}})],1)]),t("div",{staticClass:"w-full md:w-9/12"},[t("div",{staticClass:"mb-6"},[t("user-entitlements",{attrs:{id:e.users.id}})],1),t("div",{staticClass:"bg-white p-3 shadow-sm rounded-sm"},[t("div",{staticClass:"flex items-center space-x-2 font-semibold text-gray-900 leading-8"},[t("span",{attrs:{clas:"text-green-500"}},[t("svg",{staticClass:"h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"}})])]),t("span",{staticClass:"text-2xl font-bold tracking-wide"},[e._v("Info")])]),t("div",{staticClass:"text-gray-700"},[t("div",{staticClass:"grid md:grid-cols-2 text-sm"},[t("div",{staticClass:"grid grid-cols-2"},[t("div",{staticClass:"px-4 py-2 font-semibold"},[e._v("Fornavn")]),t("div",{staticClass:"px-4 py-2"},[e._v(e._s(e.users.firstname))])]),t("div",{staticClass:"grid grid-cols-2"},[t("div",{staticClass:"px-4 py-2 font-semibold"},[e._v("Efternavn")]),t("div",{staticClass:"px-4 py-2"},[e._v(e._s(e.users.lastname))])]),t("div",{staticClass:"grid grid-cols-2"},[t("div",{staticClass:"px-4 py-2 font-semibold"},[e._v("Fødselsdag")]),t("div",{staticClass:"px-4 py-2"},[e._v(e._s(e.users.birthday))])]),t("div",{staticClass:"grid grid-cols-2"},[t("div",{staticClass:"px-4 py-2 font-semibold"},[e._v("Mobil")]),t("div",{staticClass:"px-4 py-2"},[e._v(e._s(e.users.phone))])]),t("div",{staticClass:"grid grid-cols-2"},[t("div",{staticClass:"px-4 py-2 font-semibold"},[e._v("Email")]),t("div",{staticClass:"px-4 py-2"},[e._v(e._s(e.users.email))])]),t("div",{staticClass:"grid grid-cols-2"},[t("div",{staticClass:"px-4 py-2 font-semibold"},[e._v("Addresse")]),t("div",{staticClass:"px-4 py-2"},[e._v(" "+e._s(e.users.street)+" "+e._s(e.users.housenumber)+" "+e._s(e.users.side)+" "+e._s(e.users.zipcode)+" "+e._s(e.users.city)+" ")])])])])]),t("div",{staticClass:"my-2"}),t("season-tickets",{attrs:{id:e.users.id}}),t("season-ticket-usage-stats",{attrs:{id:e.users.id}}),t("memberships",{attrs:{id:e.users.id}}),t("tickets",{attrs:{id:e.users.id}}),t("away-scans",{attrs:{id:e.users.id}}),t("video-views",{attrs:{id:e.users.id}}),e.users.shopify_customer_id?t("webshop-orders",{attrs:{id:e.users.id}}
3927):e._e()],1)])])])},E4e=[],P4e=ve(S4e,T4e,E4e,!1,null,null);const R4e=P4e.exports,A4e=Object.freeze(Object.defineProperty({__proto__:null,default:R4e},Symbol.toStringTag,{value:"Module"})),I4e={components:{LoginForm:Db,Footer:z$},props:{canLogin:Boolean,canRegister:Boolean,laravelVersion:String,phpVersion:String,user:Object},computed:{currentYear(){return new Date().getFullYear()}}};var O4e=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"relative isolate overflow-hidden background-welcome"},[e.user?t("div",{staticClass:"absolute text-right right-8 top-8"},[e._v(" Hey "+e._s(e.user.firstname)+", "+e._s(e.$trans("pages.frontpage.loggedIn"))+" "),t("a",{staticClass:"font-bold underline",attrs:{href:"/dashboard"}},[e._v("link")])]):e._e(),t("div",{staticClass:"mx-auto max-w-2xl py-32 sm:py-48"},[t("div",{staticClass:"mb-8 flex justify-center"},[t("div",{staticClass:"relative mx-4 sm:mx-0 text-center text-balance rounded-full px-3 py-1 text-sm leading-6 ring-1 ring-fck-blue/10 hover:ring-fck-blue/20"},[e._v(" "+e._s(e.$trans("pages.frontpage.news"))+" "),t("a",{staticClass:"font-semibold text-fck-blue",attrs:{href:"https://www.fck.dk/nyhed/kom-helt-taet-paa-klubben-over-vinteren-med-fck"}},[t("span",{staticClass:"absolute inset-0",attrs:{"aria-hidden":"true"}}),e._v(e._s(e.$trans("pages.frontpage.newsReadMore"))),t("span",{attrs:{"aria-hidden":"true"}},[e._v("â")])])])]),t("div",{staticClass:"text-center"},[t("div",{staticClass:"flex flex-row items-center justify-center space-x-2 mb-6"},[t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v("FCK")]),t("img",{staticClass:"h-14 w-14",attrs:{src:"/img/FCK_Logo_symbol_RGB_Blue.png",alt:"FCK Logo"}}),t("h1",{staticClass:"text-fck-blue text-6xl"},[e._v(e._s(e.$trans("pages.login.profile")))])]),t("p",{staticClass:"mx-2 mt-6 leading-8"},[e._v(e._s(e.$trans("pages.frontpage.vp1")))]),t("div",{staticClass:"mt-10 flex items-center justify-center gap-x-6"},[t("a",{staticClass:"bg-fck-secondary px-3.5 py-2.5 text-sm font-semibold text-white bg-fck-blue shadow-sm hover:bg-gray-900 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-400",attrs:{href:"/login"}},[e._v(e._s(e.$trans("pages.frontpage.vp1Login")))]),t("a",{staticClass:"text-sm font-semibold leading-6 text-fck-blue",attrs:{href:"/register"}},[e._v(e._s(e.$trans("pages.frontpage.vp1Register"))),t("span",{attrs:{"aria-hidden":"true"}},[e._v("â")])])])])])]),t("div",{staticClass:"flex flex-col md:flex-row bg-zinc-800 md:bg-gradient-to-r md:from-black md:to-zinc-800"},[t("div",{staticClass:"w-full md:w-1/2 px-10 py-20 md:py-32 lg:py-48 xl:py-72 flex flex-col"},[t("h2",{staticClass:"text-3xl sm:text-4xl text-white text-center md:text-right uppercase font-black text-balance"},[e._v(" "+e._s(e.$trans("pages.frontpage.vp2Title")))]),t("p",{staticClass:"mt-10 text-center max-w-prose md:text-right text-white text-balance md:place-self-end md:justify-self-end"},[e._v(" "+e._s(e.$trans("pages.frontpage.vp2Text")))]),t("div",{staticClass:"flex flex-row gap-4 justify-center md:justify-end mt-6"},[t("div",{staticClass:"flex mt-3 w-48 h-14 bg-black text-white rounded-xl items-center justify-center"},[t("div",{staticClass:"mr-3"},[t("svg",{attrs:{viewBox:"0 0 384 512",width:"30"}},[t("path",{attrs:{fill:"currentColor",d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"}})])]),e._m(0)]),t("div",{staticClass:"flex mt-3 w-48 h-14 bg-black text-white rounded-lg items-center justify-center"},[t("div",{staticClass:"mr-3"},[t("svg",{attrs:{viewBox:"30 336.7 120.9 129.2",width:"30"}},[t("path",{attrs:{fill:"#FFD400",d:"M119.2,421.2c15.3-8.4,27-14.8,28-15.3c3.2-1.7,6.5-6.2,0-9.7 c-2.1-1.1-13.4-7.3-28-15.3l-20.1,20.2L119.2,421.2z"}}),t("path",{attrs:{fill:"#FF3333",d:"M99.1,401.1l-64.2,64.7c1.5,0.2,3.2-0.2,5.2-1.3 c4.2-2.3,48.8-26.7,79.1-43.3L99.1,401.1L99.1,401.1z"}}),t("path",{attrs:{fill:"#48FF48",d:"M99.1,401.1l20.1-20.2c0,0-74.6-40.7-79.1-43.1 c-1.7-1-3.6-1.3-5.3-1L99.1,401.1z"}}),t("path",{attrs:{fill:"#3BCCFF",d:"M99.1,401.1l-64.3-64.3c-2.6,0.6-4.8,2.9-4.8,7.6 c0,7.5,0,107.5,0,113.8c0,4.3,1.7,7.4,4.9,7.7L99.1,401.1z"}})])]),e._m(1)])])]),t("div",{staticClass:"w-full md:w-1/2 bg-cover bg-center h-64 md:h-auto",style:{backgroundImage:"url(/img/App_Videounivers.jpg)"}})]),t("div",{staticClass:"flex flex-col-reverse md:flex-row bg-zinc-100"},[t("div",{staticClass:"w-full md:w-1/2 bg-cover bg-center h-64 md:h-auto",style:{backgroundImage:"url(/img/fanshop.jpg)"}}),t("div",{staticClass:"w-full md:w-1/2 px-10 py-20 md:py-32 lg:py-48 xl:py-72 flex flex-col"},[t("h2",{staticClass:"text-3xl sm:text-4xl text-center md:text-left uppercase font-black text-fck-blue text-balance"},[e._v(" "+e._s(e.$trans("pages.frontpage.vp3Title")))]),t("p",{staticClass:"mt-4 text-center max-w-prose md:text-left text-balance md:place-self-start md:justify-self-start"},[e._v(" "+e._s(e.$trans("pages.frontpage.vp3Text")))])])]),t("div",{staticClass:"flex flex-col md:flex-row bg-fck-blue"},[t("div",{staticClass:"w-full md:w-1/2 px-10 py-20 md:py-32 lg:py-48 xl:py-72 flex flex-col"},[t("h2",{staticClass:"text-3xl sm:text-4xl text-white text-center md:text-right uppercase font-black text-balance"},[e._v(" "+e._s(e.$trans("pages.frontpage.vp4Title")))]),t("p",{staticClass:"mt-4 text-center max-w-prose md:text-right text-white text-balance md:place-self-end md:justify-self-end"},[e._v(" "+e._s(e.$trans("pages.frontpage.vp4Text")))])]),t("div",{staticClass:"w-full md:w-1/2 bg-fck-blue bg-blend-soft-light bg-cover bg-center h-64 md:h-auto",style:{backgroundImage:"url(/img/billetter.jpg)"}})]),t("Footer")],1)},M4e=[function(){var n=this,e=n._self._c;return e("div",[e("div",{staticClass:"text-xs"},[n._v("Download on the")]),e("div",{staticClass:"text-2xl font-semibold font-sans -mt-1"},[n._v("App Store")])])},function(){var n=this,e=n._self._c;return e("div",[e("div",{staticClass:"text-xs"},[n._v("GET IT ON")]),e("div",{staticClass:"text-xl font-semibold font-sans -mt-1"},[n._v("Google Play")])])}],D4e=ve(I4e,O4e,M4e,!1,null,"30cdd766");const N4e=D4e.exports,L4e=Object.freeze(Object.defineProperty({__proto__:null,default:N4e},Symbol.toStringTag,{value:"Module"}));window._=gV;window.axios=WX;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";function Ty(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ty=function(e){return typeof e}:Ty=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ty(n)}function F4e(n){return $4e(n)||B4e(n)||U4e()}function $4e(n){if(Array.isArray(n)){for(var e=0,t=new Array(n.length);e<n.length;e++)t[e]=n[e];return t}}function B4e(n){if(Symbol.iterator in Object(n)||Object.prototype.toString.call(n)==="[object Arguments]")return Array.from(n)}function U4e(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var Y0=typeof window<"u";function j4e(n){return Array.isArray(n)||Ty(n)==="object"?Object.freeze(n):n}function q4e(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n.reduce(function(t,r){var i=r.passengers[0],a=typeof i=="function"?i(e):r.passengers;return t.concat(a)},[])}function z4e(n,e){return n.map(function(t,r){return[r,t]}).sort(function(t,r){return e(t[1],r[1])||t[0]-r[0]}).map(function(t){return t[1]})}function YO(n,e){return e.reduce(function(t,r){return n.hasOwnProperty(r)&&(t[r]=n[r]),t},{})}var IB={},W4e={},H4e={},V4e=pn.extend({data:function(){return{transports:IB,targets:W4e,sources:H4e,trackInstances:Y0}},methods:{open:function(e){if(Y0){var t=e.to,r=e.from,i=e.passengers,a=e.order,s=a===void 0?1/0:a;if(!(!t||!r||!i)){var o={to:t,from:r,passengers:j4e(i),order:s},c=Object.keys(this.transports);c.indexOf(t)===-1&&pn.set(this.transports,t,[]);var u=this.$_getTransportIndex(o),l=this.transports[t].slice(0);u===-1?l.push(o):l[u]=o,this.transports[t]=z4e(l,function(d,h){return d.order-h.order})}}},close:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=e.to,i=e.from;if(!(!r||!i&&t===!1)&&this.transports[r])if(t)this.transports[r]=[];else{var a=this.$_getTransportIndex(e);if(a>=0){var s=this.transports[r].slice(0);s.splice(a,1),this.transports[r]=s}}},registerTarget:function(e,t,r){Y0&&(this.trackInstances&&!r&&this.targets[e]&&console.warn("[portal-vue]: Target ".concat(e," already exists")),this.$set(this.targets,e,Object.freeze([t])))},unregisterTarget:function(e){this.$delete(this.targets,e)},registerSource:function(e,t,r){Y0&&(this.trackInstances&&!r&&this.sources[e]&&console.warn("[portal-vue]: source ".concat(e," already exists")),this.$set(this.sources,e,Object.freeze([t])))},unregisterSource:function(e){this.$delete(this.sources,e)},hasTarget:function(e){return!!(this.targets[e]&&this.targets[e][0])},hasSource:function(e){return!!(this.sources[e]&&this.sources[e][0])},hasContentFor:function(e){return!!this.transports[e]&&!!this.transports[e].length},$_getTransportIndex:function(e){var t=e.to,r=e.from;for(var i in this.transports[t])if(this.transports[t][i].from===r)return+i;return-1}}}),Xo=new V4e(IB),G4e=1,OB=pn.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(G4e++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(Math.random()*1e7))}}},created:function(){var e=this;
3927this.$nextTick(function(){Xo.registerSource(e.name,e)})},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){Xo.unregisterSource(this.name),this.clear()},watch:{to:function(e,t){t&&t!==e&&this.clear(t),this.sendUpdate()}},methods:{clear:function(e){var t={from:this.name,to:e||this.to};Xo.close(t)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(e){return typeof e=="function"?e(this.slotProps):e},sendUpdate:function(){var e=this.normalizeSlots();if(e){var t={from:this.name,to:this.to,passengers:F4e(e),order:this.order};Xo.open(t)}else this.clear()}},render:function(e){var t=this.$slots.default||this.$scopedSlots.default||[],r=this.tag;return t&&this.disabled?t.length<=1&&this.slim?this.normalizeOwnChildren(t)[0]:e(r,[this.normalizeOwnChildren(t)]):this.slim?e():e(r,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),MB=pn.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:Xo.transports,firstRender:!0}},created:function(){var e=this;this.$nextTick(function(){Xo.registerTarget(e.name,e)})},watch:{ownTransports:function(){this.$emit("change",this.children().length>0)},name:function(e,t){Xo.unregisterTarget(t),Xo.registerTarget(e,this)}},mounted:function(){var e=this;this.transition&&this.$nextTick(function(){e.firstRender=!1})},beforeDestroy:function(){Xo.unregisterTarget(this.name)},computed:{ownTransports:function(){var e=this.transports[this.name]||[];return this.multiple?e:e.length===0?[]:[e[e.length-1]]},passengers:function(){return q4e(this.ownTransports,this.slotProps)}},methods:{children:function(){return this.passengers.length!==0?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var e=this.slim&&!this.transition;return e&&this.children().length>1&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),e}},render:function(e){var t=this.noWrapper(),r=this.children(),i=this.transition||this.tag;return t?r[0]:this.slim&&!i?e():e(i,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},r)}}),K4e=0,Y4e=["disabled","name","order","slim","slotProps","tag","to"],X4e=["multiple","transition"],J4e=pn.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(K4e++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(Math.random()*1e7))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){if(!(typeof document>"u")){var e=document.querySelector(this.mountTo);if(!e){console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"));return}var t=this.$props;if(Xo.targets[t.name]){t.bail?console.warn("[portal-vue]: Target ".concat(t.name,` is already mounted. 3928 Aborting because 'bail: true' is set`)):this.portalTarget=Xo.targets[t.name];return}var r=t.append;if(r){var i=typeof r=="string"?r:"DIV",a=document.createElement(i);e.appendChild(a),e=a}var s=YO(this.$props,X4e);s.slim=this.targetSlim,s.tag=this.targetTag,s.slotProps=this.targetSlotProps,s.name=this.to,this.portalTarget=new MB({el:e,parent:this.$parent||this,propsData:s})}},beforeDestroy:function(){var e=this.portalTarget;if(this.append){var t=e.$el;t.parentNode.removeChild(t)}
3928e.$destroy()},render:function(e){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),e();if(!this.$scopedSlots.manual){var t=YO(this.$props,Y4e);return e(OB,{props:t,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}var r=this.$scopedSlots.manual({to:this.to});return Array.isArray(r)&&(r=r[0]),r||e()}});function Q4e(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};n.component(e.portalName||"Portal",OB),n.component(e.portalTargetName||"PortalTarget",MB),n.component(e.MountingPortalName||"MountingPortal",J4e)}var Z4e={install:Q4e};function Nu(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function DB(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}/*! 3929 * GSAP 3.13.0 3930 * https://gsap.com 3931 * 3932 * @license Copyright 2008-2025, GreenSock. All rights reserved. 3933 * Subject to the terms at https://gsap.com/standard-license 3934 * @author: Jack Doyle, [email protected] 3935*/var Cs={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},_p={duration:.5,overwrite:!1,delay:0},eP,Oi,rr,fo=1e8,$n=1/fo,i2=Math.PI*2,eIe=i2/4,tIe=0,NB=Math.sqrt,nIe=Math.cos,rIe=Math.sin,_i=function(e){return typeof e=="string"},Tr=function(e){return typeof e=="function"},Ju=function(e){return typeof e=="number"},tP=function(e){return typeof e>"u"},eu=function(e){return typeof e=="object"},Ba=function(e){return e!==!1},nP=function(){return typeof window<"u"},X0=function(e){return Tr(e)||_i(e)},LB=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Qi=Array.isArray,a2=/(?:-?\.?\d|\.)+/gi,FB=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Rh=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,hC=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,$B=/[+-]=-?[.\d]+/,BB=/[^,'"\[\]\s]+/gi,iIe=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,pr,Ac,s2,rP,Ts={},U_={},UB,jB=function(e){return(U_=bp(e,Ts))&&Va},iP=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},qg=function(e,t){return!t&&console.warn(e)},qB=function(e,t){return e&&(Ts[e]=t)&&U_&&(U_[e]=t)||Ts},zg=function(){return 0},aIe={suppressEvents:!0,isStart:!0,kill:!1},Ey={suppressEvents:!0,kill:!1},sIe={suppressEvents:!0},aP={},Hl=[],o2={},zB,fs={},pC={},XO=30,Py=[],sP="",oP=function(e){var t=e[0],r,i;if(eu(t)||Tr(t)||(e=[e]),!(r=(t._gsap||{}).harness)){for(i=Py.length;i--&&!Py[i].targetTest(t););r=Py[i]}for(i=e.length;i--;)e[i]&&(e[i]._gsap||(e[i]._gsap=new hU(e[i],r)))||e.splice(i,1);return e},cf=function(e){return e._gsap||oP(ho(e))[0]._gsap},WB=function(e,t,r){return(r=e[t])&&Tr(r)?e[t]():tP(r)&&e.getAttribute&&e.getAttribute(t)||r},Ua=function(e,t){return(e=e.split(",")).forEach(t)||e},Mr=function(e){return Math.round(e*1e5)/1e5||0},Wr=function(e){return Math.round(e*1e7)/1e7||0},ep=function(e,t){var r=t.charAt(0),i=parseFloat(t.substr(2));return e=parseFloat(e),r==="+"?e+i:r==="-"?e-i:r==="*"?e*i:e/i},oIe=function(e,t){for(var r=t.length,i=0;e.indexOf(t[i])<0&&++i<r;);return i<r},j_=function(){var e=Hl.length,t=Hl.slice(0),r,i;for(o2={},Hl.length=0,r=0;r<e;r++)i=t[r],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},cP=function(e){return!!(e._initted||e._startAt||e.add)},HB=function(e,t,r,i){Hl.length&&!Oi&&j_(),e.render(t,r,!!(Oi&&t<0&&cP(e))),Hl.length&&!Oi&&j_()},VB=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(BB).length<2?t:_i(e)?e.trim():e},GB=function(e){return e},Es=function(e,t){for(var r in t)r in e||(e[r]=t[r]);return e},cIe=function(e){return function(t,r){for(var i in r)i in t||i==="duration"&&e||i==="ease"||(t[i]=r[i])}},bp=function(e,t){for(var r in t)e[r]=t[r];return e},JO=function n(e,t){for(var r in t)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=eu(t[r])?n(e[r]||(e[r]={}),t[r]):t[r]);return e},q_=function(e,t){var r={},i;for(i in e)i in t||(r[i]=e[i]);return r},og=function(e){var t=e.parent||pr,r=e.keyframes?cIe(Qi(e.keyframes)):Es;if(Ba(e.inherit))for(;t;)r(e,t.vars.defaults),t=t.parent||t._dp;return e},uIe=function(e,t){for(var r=e.length,i=r===t.length;i&&r--&&e[r]===t[r];);return r<0},KB=function(e,t,r,i,a){var s=e[i],o;
vendor: 2,662 bytes, line 3935
3935if(a)for(o=t[a];s&&s[a]>o;)s=s._prev;return s?(t._next=s._next,s._next=t):(t._next=e[r],e[r]=t),t._next?t._next._prev=t:e[i]=t,t._prev=s,t.parent=t._dp=e,t},l1=function(e,t,r,i){r===void 0&&(r="_first"),i===void 0&&(i="_last");var a=t._prev,s=t._next;a?a._next=s:e[r]===t&&(e[r]=s),s?s._prev=a:e[i]===t&&(e[i]=a),t._next=t._prev=t.parent=null},td=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},uf=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},lIe=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},c2=function(e,t,r,i){return e._startAt&&(Oi?e._startAt.revert(Ey):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,i))},dIe=function n(e){return!e||e._ts&&n(e.parent)},QO=function(e){return e._repeat?xp(e._tTime,e=e.duration()+e._rDelay)*e:0},xp=function(e,t){var r=Math.floor(e=Wr(e/t));return e&&r===e?r-1:r},z_=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},d1=function(e){return e._end=Wr(e._start+(e._tDur/Math.abs(e._ts||e._rts||$n)||0))},f1=function(e,t){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Wr(r._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),d1(e),r._dirty||uf(r,e)),e},YB=function(e,t){var r;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(r=z_(e.rawTime(),t),(!t._dur||Sv(0,t.totalDuration(),r)-t._tTime>$n)&&t.render(r,!0)),uf(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(r=e;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-$n}},Fc=function(e,t,r,i){return t.parent&&td(t),t._start=Wr((Ju(r)?r:r||e!==pr?no(e,r,t):e._time)+t._delay),t._end=Wr(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),KB(e,t,"_first","_last",e._sort?"_start":0),u2(t)||(e._recent=t),i||YB(e,t),e._ts<0&&f1(e,e._tTime),e},XB=function(e,t){return(Ts.ScrollTrigger||iP("scrollTrigger",t))&&Ts.ScrollTrigger.create(t,e)},JB=function(e,t,r,i,a){if(lP(e,t,a),!e._initted)return 1;if(!r&&e._pt&&!Oi&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&zB!==gs.frame)return Hl.push(e),e._lazy=[a,i],1},fIe=function n(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||n(t))},u2=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},hIe=function(e,t,r,i){var a=e.ratio,s=t<0||!t&&(!e._start&&fIe(e)&&!(!e._initted&&u2(e))||(e._ts<0||e._dp._ts<0)&&!u2(e))?0:1,o=e._rDelay,c=0,u,l,d;if(o&&e._repeat&&(c=Sv(0,e._tDur,t),l=xp(c,o),e._yoyo&&l&1&&(s=1-s),l!==xp(e._tTime,o)&&(a=1-s,e.vars.repeatRefresh&&e._initted&&e.invali
3935date())),s!==a||Oi||i||e._zTime===$n||!t&&e._zTime){if(!e._initted&&JB(e,t,i,r,c))return;for(d=e._zTime,e._zTime=t||(r?$n:0),r||(r=t&&!d),e.ratio=s,e._from&&(s=1-s),e._time=0,e._tTime=c,u=e._pt;u;)u.r(s,u.d),u=u._next;t<0&&c2(e,t,r,!0),e._onUpdate&&!r&&xs(e,"onUpdate"),c&&e._repeat&&!r&&e.parent&&xs(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===s&&(s&&td(e,1),!r&&!Oi&&(xs(e,s?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},pIe=function(e,t,r){var i;if(r>t)for(i=e._first;i&&i._start<=r;){if(i.data==="isPause"&&i._start>t)return i;i=i._next}else for(i=e._last;i&&i._start>=r;){if(i.data==="isPause"&&i._start<t)return i;i=i._prev}},wp=function(e,t,r,i){var a=e._repeat,s=Wr(t)||0,o=e._tTime/e._tDur;return o&&!i&&(e._time*=s/e._dur),e._dur=s,e._tDur=a?a<0?1e10:Wr(s*(a+1)+e._rDelay*a):s,o>0&&!i&&f1(e,e._tTime=e._tDur*o),e.parent&&d1(e),r||uf(e.parent,e),e},ZO=function(e){return e instanceof ya?uf(e):wp(e,e._dur)},mIe={_start:0,endTime:zg,totalDuration:zg},no=function n(e,t,r){var i=e.labels,a=e._recent||mIe,s=e.duration()>=fo?a.endTime(!1):e._dur,o,c,u;return _i(t)&&(isNaN(t)||t in i)?(c=t.charAt(0),u=t.substr(-1)==="%",o=t.indexOf("="),c==="<"||c===">"?(o>=0&&(t=t.replace(/=/,"")),(c==="<"?a._start:a.endTime(a._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(o<0?a:r).totalDuration()/100:1)):o<0?(t in i||(i[t]=s),i[t]):(c=parseFloat(t.charAt(o-1)+t.substr(o+1)),u&&r&&(c=c/100*(Qi(r)?r[0]:r).totalDuration()),o>1?n(e,t.substr(0,o-1),r)+c:s+c)):t==null?s:+t},cg=function(e,t,r){var i=Ju(t[1]),a=(i?2:1)+(e<2?0:1),s=t[a],o,c;if(i&&(s.duration=t[1]),s.parent=r,e){for(o=s,c=r;c&&!("immediateRender"in o);)o=c.vars.defaults||{},c=Ba(c.vars.inherit)&&c.parent;s.immediateRender=Ba(o.immediateRender),e<2?s.runBackwards=1:s.startAt=t[a-1]}return new Dr(t[0],s,t[a+1])},vd=function(e,t){return e||e===0?t(e):t},Sv=function(e,t,r){return r<e?e:r>t?t:r},Vi=function(e,t){return!_i(e)||!(t=iIe.exec(e))?"":t[1]},gIe=function(e,t,r){return vd(r,function(i){return Sv(e,t,i)})},l2=[].slice,QB=function(e,t){return e&&eu(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&eu(e[0]))&&!e.nodeType&&e!==Ac},vIe=function(e,t,r){return r===void 0&&(r=[]),e.forEach(function(i){var a;return _i(i)&&!t||QB(i,1)?(a=r).push.apply(a,ho(i)):r.push(i)})||r},ho=function(e,t,r){return rr&&!t&&rr.selector?rr.selector(e):_i(e)&&!r&&(s2||!Cp())?l2.call((t||rP).querySelectorAll(e),0):Qi(e)?vIe(e,r):QB(e)?l2.call(e,0):e?[e]:[]},d2=function(e){return e=ho(e)[0]||qg("Invalid scope")||{},function(t){var r=e.current||e.nativeElement||e;return ho(t,r.querySelectorAll?r:r===e?qg("Invalid scope")||rP.createElement("div"):e)}},ZB=function(e){return e.sort(function(){return .5-Math.random()})},eU=function(e){if(Tr(e))return e;var t=eu(e)?e:{each:e},r=lf(t.ease),i=t.from||0,a=parseFloat(t.base)||0,s={},o=i>0&&i<1,c=isNaN(i)||o,u=t.axis,l=i,d=i;return _i(i)?l=d={center:.5,edges:.5,end:1}[i]||0:!o&&c&&(l=i[0],d=i[1]),function(h,p,g){var v=(g||t).length,y=s[v],b,x,S,w,k,E,I,P,A;if(!y){if(A=t.grid==="auto"?0:(t.grid||[1,fo])[1],!A){for(I=-fo;I<(I=g[A++].getBoundingClientRect().left)&&A<v;);A<v&&A--}for(y=s[v]=[],b=c?Math.min(A,v)*l-.5:i%A,x=A===fo?0:c?v*d/A-.5:i/A|0,I=0,P=fo,E=0;E<v;E++)S=E%A-b,w=x-(E/A|0),y[E]=k=u?Math.abs(u==="y"?w:S):NB(S*S+w*w),k>I&&(I=k),k<P&&(P=k);i==="random"&&ZB(y),y.max=I-P,y.min=P,y.v=v=(parseFloat(t.amount)||parseFloat(t.each)*(A>v?v-1:u?u==="y"?v/A:A:Math.max(A,v/A))||0)*(i==="edges"?-1:1),y.b=v<0?a-v:a,y.u=Vi(t.amount||t.each)||0,r=r&&v<0?lU(r):r}return v=(y[h]-y.min)/y.max||0,Wr(y.b+(r?r(v):v)*y.v)+y.u}},f2=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var i=Wr(Math.round(parseFloat(r)/e)*e*t);return(i-i%1)/t+(Ju(r)?0:Vi(r))}},tU=function(e,t){var r=Qi(e),i,a;return!r&&eu(e)&&(i=r=e.radius||fo,e.values?(e=ho(e.values),(a=!Ju(e[0]))&&(i*=i)):e=f2(e.increment)),vd(t,r?Tr(e)?function(s){return a=e(s),Math.abs(a-s)<=i?a:s}:function(s){for(var o=parseFloat(a?s.x:s),c=parseFloat(a?s.y:0),u=fo,l=0,d=e.length,h,p;d--;)a?(h=e[d].x-o,p=e[d].y-c,h=h*h+p*p):h=Math.abs(e[d]-o),h<u&&(u=h,l=d);return l=!i||u<=i?e[l]:s,a||l===s||Ju(s)?l:l+Vi(s)}:f2(e))},nU=function(e,t,r,i){return vd(Qi(e)?!t:r===!0?!!(r=0):!i,function(){return Qi(e)?e[~~(Math.random()*e.length)]:(r=r||1e-5)&&(i=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((e-r/2+Math.random()*(t-e+r*.99))/r)*r*i)/i})},yIe=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(i){return t.reduce(function(a,s){return s(a)},i)}},_Ie=function(e,t){return function(r){return e(parseFloat(r))+(t||Vi(r))}},bIe=function(e,t,r){return iU(e,t,0,1,r)},rU=function(e,t,r){return vd(r,function(i){return e[~~t(i)]})},xIe=function n(e,t,r){var i=t-e;return Qi(e)?rU(e,n(0,e.length),t):vd(r,function(a){return(i+(a-e)%i)%i+e})},wIe=function n(e,t,r){var i=t-e,a=i*2;return Qi(e)?rU(e,n(0,e.length-1),t):vd(r,function(s){return s=(a+(s-e)%a)%a||0,e+(s>i?a-s:s)})},Wg=function(e){for(var t=0,r="",i,a,s,o;~(i=e.indexOf("random(",t));)s=e.indexOf(")",i),o=e.charAt(i+7)==="[",a=e.substr(i+7,s-i-7).match(o?BB:a2),r+=e.substr(t,
3935i-t)+nU(o?a:+a[0],o?0:+a[1],+a[2]||1e-5),t=s+1;return r+e.substr(t,e.length-t)},iU=function(e,t,r,i,a){var s=t-e,o=i-r;return vd(a,function(c){return r+((c-e)/s*o||0)})},CIe=function n(e,t,r,i){var a=isNaN(e+t)?0:function(p){return(1-p)*e+p*t};if(!a){var s=_i(e),o={},c,u,l,d,h;if(r===!0&&(i=1)&&(r=null),s)e={p:e},t={p:t};else if(Qi(e)&&!Qi(t)){for(l=[],d=e.length,h=d-2,u=1;u<d;u++)l.push(n(e[u-1],e[u]));d--,a=function(g){g*=d;var v=Math.min(h,~~g);return l[v](g-v)},r=t}else i||(e=bp(Qi(e)?[]:{},e));if(!l){for(c in t)uP.call(o,e,c,"get",t[c]);a=function(g){return hP(g,o)||(s?e.p:e)}}}return vd(r,a)},eM=function(e,t,r){var i=e.labels,a=fo,s,o,c;for(s in i)o=i[s]-t,o<0==!!r&&o&&a>(o=Math.abs(o))&&(c=s,a=o);return c},xs=function(e,t,r){var i=e.vars,a=i[t],s=rr,o=e._ctx,c,u,l;if(a)return c=i[t+"Params"],u=i.callbackScope||e,r&&Hl.length&&j_(),o&&(rr=o),l=c?a.apply(u,c):a.call(u),rr=s,l},Um=function(e){return td(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Oi),e.progress()<1&&xs(e,"onInterrupt"),e},Ah,aU=[],sU=function(e){if(e)if(e=!e.name&&e.default||e,nP()||e.headless){var t=e.name,r=Tr(e),i=t&&!r&&e.init?function(){this._props=[]}:e,a={init:zg,render:hP,add:uP,kill:BIe,modifier:$Ie,rawVars:0},s={targetTest:0,get:0,getSetter:fP,aliases:{},register:0};if(Cp(),e!==i){if(fs[t])return;Es(i,Es(q_(e,a),s)),bp(i.prototype,bp(a,q_(e,s))),fs[i.prop=t]=i,e.targetTest&&(Py.push(i),aP[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}qB(t,i),e.register&&e.register(Va,i,ja)}else aU.push(e)},Ln=255,jm={aqua:[0,Ln,Ln],lime:[0,Ln,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ln],navy:[0,0,128],white:[Ln,Ln,Ln],olive:[128,128,0],yellow:[Ln,Ln,0],orange:[Ln,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ln,0,0],pink:[Ln,192,203],cyan:[0,Ln,Ln],transparent:[Ln,Ln,Ln,0]},mC=function(e,t,r){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(r-t)*e*6:e<.5?r:e*3<2?t+(r-t)*(2/3-e)*6:t)*Ln+.5|0},oU=function(e,t,r){var i=e?Ju(e)?[e>>16,e>>8&Ln,e&Ln]:0:jm.black,a,s,o,c,u,l,d,h,p,g;if(!i){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),jm[e])i=jm[e];else if(e.charAt(0)==="#"){if(e.length<6&&(a=e.charAt(1),s=e.charAt(2),o=e.charAt(3),e="#"+a+a+s+s+o+o+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return i=parseInt(e.substr(1,6),16),[i>>16,i>>8&Ln,i&Ln,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),i=[e>>16,e>>8&Ln,e&Ln]}else if(e.substr(0,3)==="hsl"){if(i=g=e.match(a2),!t)c=+i[0]%360/360,u=+i[1]/100,l=+i[2]/100,s=l<=.5?l*(u+1):l+u-l*u,a=l*2-s,i.length>3&&(i[3]*=1),i[0]=mC(c+1/3,a,s),i[1]=mC(c,a,s),i[2]=mC(c-1/3,a,s);else if(~e.indexOf("="))return i=e.match(FB),r&&i.length<4&&(i[3]=1),i}else i=e.match(a2)||jm.transparent;i=i.map(Number)}return t&&!g&&(a=i[0]/Ln,s=i[1]/Ln,o=i[2]/Ln,d=Math.max(a,s,o),h=Math.min(a,s,o),l=(d+h)/2,d===h?c=u=0:(p=d-h,u=l>.5?p/(2-d-h):p/(d+h),c=d===a?(s-o)/p+(s<o?6:0):d===s?(o-a)/p+2:(a-s)/p+4,c*=60),i[0]=~~(c+.5),i[1]=~~(u*100+.5),i[2]=~~(l*100+.5)),r&&i.length<4&&(i[3]=1),i},cU=function(e){var t=[],r=[],i=-1;return e.split(Vl).forEach(function(a){var s=a.match(Rh)||[];t.push.apply(t,s),r.push(i+=s.length+1)}),t.c=r,t},tM=function(e,t,r){var i="",a=(e+i).match(Vl),s=t?"hsla(":"rgba(",o=0,c,u,l,d;if(!a)return e;if(a=a.map(function(h){return(h=oU(h,t,1))&&s+(t?h[0]+","+h[1]+"%,"+h[2]+"%,"+h[3]:h.join(","))+")"}),r&&(l=cU(e),c=r.c,c.join(i)!==l.c.join(i)))for(u=e.replace(Vl,"1").split(Rh),d=u.length-1;o<d;o++)i+=u[o]+(~c.indexOf(o)?a.shift()||s+"0,0,0,0)":(l.length?l:a.length?a:r).shift());if(!u)for(u=e.split(Vl),d=u.length-1;o<d;o++)i+=u[o]+a[o];return i+u[d]},Vl=function(){var n="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in jm)n+="|"+e+"\\b";return new RegExp(n+")","gi")}(),kIe=/hsl[a]?\(/,uU=function(e){var t=e.join(" "),r;if(Vl.lastIndex=0,Vl.test(t))return r=kIe.test(t),e[1]=tM(e[1],r),e[0]=tM(e[0],r,cU(e[1])),!0},Hg,gs=function(){var n=Date.now,e=500,t=33,r=n(),i=r,a=1e3/240,s=a,o=[],c,u,l,d,h,p,g=function v(y){var b=n()-i,x=y===!0,S,w,k,E;if((b>e||b<0)&&(r+=b-t),i+=b,k=i-r,S=k-s,(S>0||x)&&(E=++d.frame,h=k-d.time*1e3,d.time=k=k/1e3,s+=S+(S>=a?4:a-S),w=1),x||(c=u(v)),w)for(p=0;p<o.length;p++)o[p](k,h,E,y)};return d={time:0,frame:0,tick:function(){g(!0)},deltaRatio:function(y){return h/(1e3/(y||60))},wake:function(){UB&&(!s2&&nP()&&(Ac=s2=window,rP=Ac.document||{},Ts.gsap=Va,(Ac.gsapVersions||(Ac.gsapVersions=[])).push(Va.version),jB(U_||Ac.GreenSockGlobals||!Ac.gsap&&Ac||{}),aU.forEach(sU)),l=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&d.sleep(),u=l||function(y){return setTimeout(y,s-d.time*1e3+1|0)},Hg=1,g(2))},sleep:function(){(l?cancelAnimationFrame:clearTimeout)(c),Hg=0,u=zg},lagSmoothing:function(y,b){e=y||1/0,t=Math.min(b||33,e)},fps:function(y){a=1e3/(y||240),s=d.time*1e3+a},add:function(y,b,x){var S=b?function(w,k,E,I){y(w,k,E,I),d.remove(S)}:y;return d.remove(y),o[x?"unshift":"push"](S),Cp(),S},remove:function(y,b){~(b=o.indexOf(y))&&o.splice(b,1)&&p>=b&&p--},_listeners:o},d}(),Cp=function(){return!Hg&&gs.wake()},ln={},SIe=/^[\d.\-M][\d.\-,\s]/,TIe=/["']/g,EIe=function(e){for(var t={},r=e.substr(1,e.length-3).split(":"),i=r[0],a=1,s=r.length,o,c,u;a<s;a++)c=r[a],o=a!==s-1?c.lastIndexOf(","):c.length,u=c.substr(0,o),t[i]=isNaN(u)?u.replace(TIe,"").trim():+u,i=c.substr(o+1).trim();return t},PIe=function(e){var t=e.indexOf("(")+1,r=e.indexOf(")"),i=e.indexOf("(",t);return e.substring(t,~i&&i<r?e.indexOf(")",r+1):r)},RIe=function(e){var t=(e+"").split("("),r=ln[t[0]];return r&&t.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[EIe(t[1])]:PIe(e).split(",").map(VB)):ln._CE&&SIe.test(e)?ln._CE("",e):r},lU=function(e){return function(t){return 1-e(1-t)}},dU=function n(e,t){for(var r=e._first,i;r;)r instanceof ya?n(r,t):r.vars.yoyoEase&&(!r._yoyo||!r._repeat)&&r._yoyo!==t&&(r.timeline?n(r.timeline,t):(i=r._ease,r._ease=r._yEase,r._yEase=i,r._yoyo=t)),r=r._next},lf=function(e,t){return e&&(Tr(e)?e:ln[e]||RIe(e))||t},Uf=function(e,t,r,i){r===void 0&&(r=function(c){return 1-t(1-c)}),i===void 0&&(i=function(c){return c<.5?t(c*2)/2:1-t((1-c)*2)/2});var a={easeIn:t,easeOut:r,easeInOut:i},s;return Ua(e,function(o){ln[o]=Ts[o]=a,ln[s=o.toLowerCase()]=r;for(var c in a)ln[s+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=ln[o+"."+c]=a[c]}),a},fU=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},gC=function n(e,t,r){var i=t>=1?t:1,a=(r||(e?.3:.45))/(t<1?t:1),s=a/i2*(Math.asin(1/i)||0),o=function(l){return l===1?1:i*Math.pow(2,-10*l)*rIe((l-s)*a)+1},c=e==="out"?o:e==="in"?function(u){return 1-o(1-u)}:fU(o);return a=i2/a,c.config=function(u,l){return n(e,u,l)},c}
3935,vC=function n(e,t){t===void 0&&(t=1.70158);var r=function(s){return s?--s*s*((t+1)*s+t)+1:0},i=e==="out"?r:e==="in"?function(a){return 1-r(1-a)}:fU(r);return i.config=function(a){return n(e,a)},i};Ua("Linear,Quad,Cubic,Quart,Quint,Strong",function(n,e){var t=e<5?e+1:e;Uf(n+",Power"+(t-1),e?function(r){return Math.pow(r,t)}:function(r){return r},function(r){return 1-Math.pow(1-r,t)},function(r){return r<.5?Math.pow(r*2,t)/2:1-Math.pow((1-r)*2,t)/2})});ln.Linear.easeNone=ln.none=ln.Linear.easeIn;Uf("Elastic",gC("in"),gC("out"),gC());(function(n,e){var t=1/e,r=2*t,i=2.5*t,a=function(o){return o<t?n*o*o:o<r?n*Math.pow(o-1.5/e,2)+.75:o<i?n*(o-=2.25/e)*o+.9375:n*Math.pow(o-2.625/e,2)+.984375};Uf("Bounce",function(s){return 1-a(1-s)},a)})(7.5625,2.75);Uf("Expo",function(n){return Math.pow(2,10*(n-1))*n+n*n*n*n*n*n*(1-n)});Uf("Circ",function(n){return-(NB(1-n*n)-1)});Uf("Sine",function(n){return n===1?1:-nIe(n*eIe)+1});Uf("Back",vC("in"),vC("out"),vC());ln.SteppedEase=ln.steps=Ts.SteppedEase={config:function(e,t){e===void 0&&(e=1);var r=1/e,i=e+(t?0:1),a=t?1:0,s=1-$n;return function(o){return((i*Sv(0,s,o)|0)+a)*r}}};_p.ease=ln["quad.out"];Ua("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(n){return sP+=n+","+n+"Params,"});var hU=function(e,t){this.id=tIe++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:WB,this.set=t?t.getSetter:fP},Vg=function(){function n(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,wp(this,+t.duration,1,1),this.data=t.data,rr&&(this._ctx=rr,rr.data.push(this)),Hg||gs.wake()}var e=n.prototype;return e.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},e.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},e.totalDuration=function(r){return arguments.length?(this._dirty=0,wp(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,i){if(Cp(),!arguments.length)return this._tTime;var a=this._dp;if(a&&a.smoothChildTiming&&this._ts){for(f1(this,r),!a._dp||a.parent||YB(a,this);a&&a.parent;)a.parent._time!==a._start+(a._ts>=0?a._tTime/a._ts:(a.totalDuration()-a._tTime)/-a._ts)&&a.totalTime(a._tTime,!0),a=a.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&Fc(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===$n||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),HB(this,r,i)),this},e.time=function(r,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+QO(this))%(this._dur+this._rDelay)||(r?this._dur:0),i):this._time},e.totalProgress=function(r,i){return arguments.length?this.totalTime(this.totalDuration()*r,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(r,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+QO(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(r,i){var a=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*a,i):this._repeat?xp(this._tTime,a)+1:1},e.timeScale=function(r,i){if(!arguments.length)return this._rts===-$n?0:this._rts;if(this._rts===r)return this;var a=this.parent&&this._ts?z_(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-$n?0:this._rts,this.totalTime(Sv(-Math.abs(this._delay),this.totalDuration(),a),i!==!1),d1(this),lIe(this)},e.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Cp(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==$n&&(this._tTime-=$n)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=r;var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&Fc(i,this,r-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Ba(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(r){var i=this.parent||this._dp;return i?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?z_(i.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=sIe);var i=Oi;return Oi=r,cP(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),Oi=i,this},e.globalTime=function(r){for(var i=this,a=arguments.length?r:i.rawTime();i;
3935)a=i._start+a/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(r):a},e.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,ZO(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var i=this._time;return this._rDelay=r,ZO(this),i?this.time(i):this}return this._rDelay},e.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},e.seek=function(r,i){return this.totalTime(no(this,r),Ba(i))},e.restart=function(r,i){return this.play().totalTime(r?-this._delay:0,Ba(i)),this._dur||(this._zTime=-$n),this},e.play=function(r,i){return r!=null&&this.seek(r,i),this.reversed(!1).paused(!1)},e.reverse=function(r,i){return r!=null&&this.seek(r||this.totalDuration(),i),this.reversed(!0).paused(!1)},e.pause=function(r,i){return r!=null&&this.seek(r,i),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-$n:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-$n,this},e.isActive=function(){var r=this.parent||this._dp,i=this._start,a;return!!(!r||this._ts&&this._initted&&r.isActive()&&(a=r.rawTime(!0))>=i&&a<this.endTime(!0)-$n)},e.eventCallback=function(r,i,a){var s=this.vars;return arguments.length>1?(i?(s[r]=i,a&&(s[r+"Params"]=a),r==="onUpdate"&&(this._onUpdate=i)):delete s[r],this):s[r]},e.then=function(r){var i=this;return new Promise(function(a){var s=Tr(r)?r:GB,o=function(){var u=i.then;i.then=null,Tr(s)&&(s=s(i))&&(s.then||s===i)&&(i.then=u),a(s),i.then=u};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?o():i._prom=o})},e.kill=function(){Um(this)},n}();Es(Vg.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-$n,_prom:0,_ps:!1,_rts:1});var ya=function(n){DB(e,n);function e(r,i){var a;return r===void 0&&(r={}),a=n.call(this,r)||this,a.labels={},a.smoothChildTiming=!!r.smoothChildTiming,a.autoRemoveChildren=!!r.autoRemoveChildren,a._sort=Ba(r.sortChildren),pr&&Fc(r.parent||pr,Nu(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),r.scrollTrigger&&XB(Nu(a),r.scrollTrigger),a}var t=e.prototype;return t.to=function(i,a,s){return cg(0,arguments,this),this},t.from=function(i,a,s){return cg(1,arguments,this),this},t.fromTo=function(i,a,s,o){return cg(2,arguments,this),this},t.set=function(i,a,s){return a.duration=0,a.parent=this,og(a).repeatDelay||(a.repeat=0),a.immediateRender=!!a.immediateRender,new Dr(i,a,no(this,s),1),this},t.call=function(i,a,s){return Fc(this,Dr.delayedCall(0,i,a),s)},t.staggerTo=function(i,a,s,o,c,u,l){return s.duration=a,s.stagger=s.stagger||o,s.onComplete=u,s.onCompleteParams=l,s.parent=this,new Dr(i,s,no(this,c)),this},t.staggerFrom=function(i,a,s,o,c,u,l){return s.runBackwards=1,og(s).immediateRender=Ba(s.immediateRender),this.staggerTo(i,a,s,o,c,u,l)},t.staggerFromTo=function(i,a,s,o,c,u,l,d){return o.startAt=s,og(o).immediateRender=Ba(o.immediateRender),this.staggerTo(i,a,o,c,u,l,d)},t.render=function(i,a,s){var o=this._time,c=this._dirty?this.totalDuration():this._tDur,u=this._dur,l=i<=0?0:Wr(i),d=this._zTime<0!=i<0&&(this._initted||!u),h,p,g,v,y,b,x,S,w,k,E,I;if(this!==pr&&l>c&&i>=0&&(l=c),l!==this._tTime||s||d){if(o!==this._time&&u&&(l+=this._time-o,i+=this._time-o),h=l,w=this._start,S=this._ts,b=!S,d&&(u||(o=this._zTime),(i||!a)&&(this._zTime=i)),this._repeat){if(E=this._yoyo,y=u+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(y*100+i,a,s);if(h=Wr(l%y),l===c?(v=this._repeat,h=u):(k=Wr(l/y),v=~~k,v&&v===k&&(h=u,v--),h>u&&(h=u)),k=xp(this._tTime,y),!o&&this._tTime&&k!==v&&this._tTime-k*y-this._dur<=0&&(k=v),E&&v&1&&(h=u-h,I=1),v!==k&&!this._lock){var P=E&&k&1,A=P===(E&&v&1);if(v<k&&(P=!P),o=P?0:l%u?u:l,this._lock=1,this.render(o||(I?0:Wr(v*y)),a,!u)._lock=0,this._tTime=l,!a&&this.parent&&xs(this,"onRepeat"),this.vars.repeatRefresh&&!I&&(this.invalidate()._lock=1),o&&o!==this._time||b!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,c=this._tDur,A&&(this._lock=2,o=P?u:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!I&&this.invalidate()),this._lock=0,!this._ts&&!b)return this;dU(this,I)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(x=pIe(this,Wr(o),Wr(h)),x&&(l-=h-(h=x._start))),this._tTime=l,this._time=h,this._act=!S,this._initted||(this._onUpdate=this.vars.onUp
3935date,this._initted=1,this._zTime=i,o=0),!o&&l&&!a&&!k&&(xs(this,"onStart"),this._tTime!==l))return this;if(h>=o&&i>=0)for(p=this._first;p;){if(g=p._next,(p._act||h>=p._start)&&p._ts&&x!==p){if(p.parent!==this)return this.render(i,a,s);if(p.render(p._ts>0?(h-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(h-p._start)*p._ts,a,s),h!==this._time||!this._ts&&!b){x=0,g&&(l+=this._zTime=-$n);break}}p=g}else{p=this._last;for(var N=i<0?i:h;p;){if(g=p._prev,(p._act||N<=p._end)&&p._ts&&x!==p){if(p.parent!==this)return this.render(i,a,s);if(p.render(p._ts>0?(N-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(N-p._start)*p._ts,a,s||Oi&&cP(p)),h!==this._time||!this._ts&&!b){x=0,g&&(l+=this._zTime=N?-$n:$n);break}}p=g}}if(x&&!a&&(this.pause(),x.render(h>=o?0:-$n)._zTime=h>=o?1:-1,this._ts))return this._start=w,d1(this),this.render(i,a,s);this._onUpdate&&!a&&xs(this,"onUpdate",!0),(l===c&&this._tTime>=this.totalDuration()||!l&&o)&&(w===this._start||Math.abs(S)!==Math.abs(this._ts))&&(this._lock||((i||!u)&&(l===c&&this._ts>0||!l&&this._ts<0)&&td(this,1),!a&&!(i<0&&!o)&&(l||o||!c)&&(xs(this,l===c&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(l<c&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(i,a){var s=this;if(Ju(a)||(a=no(this,a,i)),!(i instanceof Vg)){if(Qi(i))return i.forEach(function(o){return s.add(o,a)}),this;if(_i(i))return this.addLabel(i,a);if(Tr(i))i=Dr.delayedCall(0,i);else return this}return this!==i?Fc(this,i,a):this},t.getChildren=function(i,a,s,o){i===void 0&&(i=!0),a===void 0&&(a=!0),s===void 0&&(s=!0),o===void 0&&(o=-fo);for(var c=[],u=this._first;u;)u._start>=o&&(u instanceof Dr?a&&c.push(u):(s&&c.push(u),i&&c.push.apply(c,u.getChildren(!0,a,s)))),u=u._next;return c},t.getById=function(i){for(var a=this.getChildren(1,1,1),s=a.length;s--;)if(a[s].vars.id===i)return a[s]},t.remove=function(i){return _i(i)?this.removeLabel(i):Tr(i)?this.killTweensOf(i):(i.parent===this&&l1(this,i),i===this._recent&&(this._recent=this._last),uf(this))},t.totalTime=function(i,a){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Wr(gs.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),n.prototype.totalTime.call(this,i,a),this._forcing=0,this):this._tTime},t.addLabel=function(i,a){return this.labels[i]=no(this,a),this},t.removeLabel=function(i){return delete this.labels[i],this},t.addPause=function(i,a,s){var o=Dr.delayedCall(0,a||zg,s);return o.data="isPause",this._hasPause=1,Fc(this,o,no(this,i))},t.removePause=function(i){var a=this._first;for(i=no(this,i);a;)a._start===i&&a.data==="isPause"&&td(a),a=a._next},t.killTweensOf=function(i,a,s){for(var o=this.getTweensOf(i,s),c=o.length;c--;)Dl!==o[c]&&o[c].kill(i,a);return this},t.getTweensOf=function(i,a){for(var s=[],o=ho(i),c=this._first,u=Ju(a),l;c;)c instanceof Dr?oIe(c._targets,o)&&(u?(!Dl||c._initted&&c._ts)&&c.globalTime(0)<=a&&c.globalTime(c.totalDuration())>a:!a||c.isActive())&&s.push(c):(l=c.getTweensOf(o,a)).length&&s.push.apply(s,l),c=c._next;return s},t.tweenTo=function(i,a){a=a||{};var s=this,o=no(s,i),c=a,u=c.startAt,l=c.onStart,d=c.onStartParams,h=c.immediateRender,p,g=Dr.to(s,Es({ease:a.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:a.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale())||$n,onStart:function(){if(s.pause(),!p){var y=a.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale());g._dur!==y&&wp(g,y,0,1).render(g._time,!0,!0),p=1}l&&l.apply(g,d||[])}},a));return h?g.render(0):g},t.tweenFromTo=function(i,a,s){return this.tweenTo(a,Es({startAt:{time:no(this,i)}},s))},t.recent=function(){return this._recent},t.nextLabel=function(i){return i===void 0&&(i=this._time),eM(this,no(this,i))},t.previousLabel=function(i){return i===void 0&&(i=this._time),eM(this,no(this,i),1)},t.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+$n)},t.shiftChildren=function(i,a,s){s===void 0&&(s=0);for(var o=this._first,c=this.labels,u;o;)o._start>=s&&(o._start+=i,o._end+=i),o=o._next;if(a)for(u in c)c[u]>=s&&(c[u]+=i);return uf(this)},t.invalidate=function(i){var a=this._first;for(this._lock=0;a;)a.invalidate(i),a=a._next;return n.prototype.invalidate.call(this,i)},t.clear=function(i){i===void 0&&(i=!0);for(var a=this._first,s;a;)s=a._next,this.remove(a),a=s;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),uf(this)},t.totalDuration=function(i){var a=0,s=this,o=s._last,c=fo,u,l,d;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-i:i));if(s._dirty){for(d=s.parent;o;)u=o._prev,o._dirty&&o.totalDuration(),l=o._start,l>c&&s._sort&&o._ts&&!s._lock?(s._lock=1,Fc(s,o,l-o._delay,1)._lock=0):c=l,l<0&&o._ts&&(a-=l,(!d&&!s._dp||d&&d.smoothChildTiming)&&(s._start+=l/s._ts,s._time-=l,s._tTime-=l),s.shiftChildren(-l,!1,-1/0),c=0),o._end>a&&o._ts&&(a=o._end),o=u;wp(s,s===pr&&s._time>a?s._time:a,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(i){if(pr._ts&&(HB(pr,z_(i,pr)),zB=gs.frame),gs.frame>=XO){XO+=Cs.autoSleep||120;var a=pr._first;if((!a||!a._ts)&&Cs.autoSleep&&gs._listeners.length<2){for(;a&&!a._ts;)a=a._next;a||gs.sleep()}}},e}(Vg);Es(ya.prototype,{_lock:0,_hasPause:0,_forcing:0});var AIe=function(e,t,r,i,a,s,o){var c=new ja(this._pt,e,t,0,1,_U,null,a),u=0,l=0,d,h,p,g,v,y,b,x;for(c.b=r,c.e=i,r+="",i+="",(b=~i.indexOf("random("))&&(i=Wg(i)),s&&(x=[r,i],s(x,e,t),r=x[0],i=x[1]),h=r.match(hC)||[];d=hC.exec(i);)g=d[0],v=i.substring(u,d.index),p?p=(p+1)%5:v.substr(-5)==="rgba("&&(p=1),g!==h[l++]&&(y=parseFloat(h[l-1])||0,c._pt={_next:c._pt,p:v||l===1?v:",",s:y,c:g.charAt(1)==="="?ep(y,g)-y:parseFloat(g)-y,m:p&&p<4?Math.round:0},u=hC.lastIndex);return c.c=u<i.length?i.substring(u,i.length):"",c.fp=o,($B.test(i)||b)&&(c.e=0),this._pt=c,c},uP=function(e,t,r,i,a,s,o,c,u,l){Tr(i)&&(i=i(a||0,e,s));var d=e[t],h=r!=="get"?r:Tr(d)?u?e[t.indexOf("set")||!Tr(e["get"+t.substr(3)])?t:"get"+t.substr(3)](u):e[t]():d,p=Tr(d)?u?NIe:vU:dP,g;if(_i(i)&&(~i.indexOf("random(")&&(i=Wg(i)),i.charAt(1)==="="&&(g=ep(h,i)+(Vi(h)||0),(g||g===0)&&(i=g))),!l||h!==i||h2)return!isNaN(h*i)&&i!==""?(g=new ja(this._pt,e,t,+h||0,i-(h||0),typeof d=="boolean"?FIe:yU,0,p),u&&(g.fp=u),o&&g.modifier(o,this,e),this._pt=g):(!d&&!(t in e)&&iP(t,i),AIe.call(this,e,t,h,i,p,c||Cs.stringFilter,u))},IIe=function(e,t,r,i,a){if(Tr(e)&&(e=ug(e,a,t,r,i)),!eu(e)||e.style&&e.nodeType||Qi(e)||LB(e))return _i(e)?ug(e,a,t,r,i):e;var s={},o;for(o in e)s[o]=ug(e[o],a,t,r,i);return s},pU=function(e,t,r,i,a,s){var o,c,u,l;if(fs[e]&&(o=new fs[e]).init(a,o.rawVars?t[e]:IIe(t[e],i,a,s,r),r,i,s)!==!1&&(r._pt=c=new ja(r._pt,a,e,0,1,o.render,o,0,o.priority),r!==Ah))for(u=r._ptLookup[r._targets.indexOf(a)],l=o._props.length;l--;)u[o._props[l]]=c;return o},Dl,h2,lP=function n(e,t,r){var i=e.vars,a=i.ease,s=i.startAt,o=i.immediateRender,c=i.lazy,u=i.onUpdate,l=i.runBackwards,d=i.yoyoEase,h=i.keyframes,p=i.autoRevert,g=e._dur,v=e._startAt,y=e._targets,b=e.parent,x=b&&b.data==="nested"?b.vars.targets:y,S=e._overwrite==="auto"&&!eP,w=e.timeline,k,E,I,P,A,N,j,L,B,V,X,ne,se;if(w&&(!h||!a)&&(a="none"),e._ease=lf(a,_p.ease),e._yEase=d?lU(lf(d===!0?a:d,_p.ease)):0,d&&e._yoyo&&!e._repeat&&(d=e._yEase,e._yEase=e._ease,e._ease=d),e._from=!w&&!!i.runBackwards,!w||h&&!i.stagger){if(L=y[0]?cf(y[0]).harness:0,ne=L&&i[L.prop],k=q_(i,aP),v&&(v._zTime<0&&v.progress(1),t<0&&l&&o&&!p?v.render(-1,!0):v.revert(l&&g?Ey:aIe),v._lazy=0),s){if(td(e._startAt=Dr.set(y,Es({data:"isStart",overwrite:!1,parent:b,immediateRender:!0,lazy:!v&&Ba(c),startAt:null,delay:0,onUpdate:u&&function(){return xs(e,"onUpdate")},stagger:0}
3935,s))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Oi||!o&&!p)&&e._startAt.revert(Ey),o&&g&&t<=0&&r<=0){t&&(e._zTime=t);return}}else if(l&&g&&!v){if(t&&(o=!1),I=Es({overwrite:!1,data:"isFromStart",lazy:o&&!v&&Ba(c),immediateRender:o,stagger:0,parent:b},k),ne&&(I[L.prop]=ne),td(e._startAt=Dr.set(y,I)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Oi?e._startAt.revert(Ey):e._startAt.render(-1,!0)),e._zTime=t,!o)n(e._startAt,$n,$n);else if(!t)return}for(e._pt=e._ptCache=0,c=g&&Ba(c)||c&&!g,E=0;E<y.length;E++){if(A=y[E],j=A._gsap||oP(y)[E]._gsap,e._ptLookup[E]=V={},o2[j.id]&&Hl.length&&j_(),X=x===y?E:x.indexOf(A),L&&(B=new L).init(A,ne||k,e,X,x)!==!1&&(e._pt=P=new ja(e._pt,A,B.name,0,1,B.render,B,0,B.priority),B._props.forEach(function(ie){V[ie]=P}),B.priority&&(N=1)),!L||ne)for(I in k)fs[I]&&(B=pU(I,k,e,X,A,x))?B.priority&&(N=1):V[I]=P=uP.call(e,A,I,"get",k[I],X,x,0,i.stringFilter);e._op&&e._op[E]&&e.kill(A,e._op[E]),S&&e._pt&&(Dl=e,pr.killTweensOf(A,V,e.globalTime(t)),se=!e.parent,Dl=0),e._pt&&c&&(o2[j.id]=1)}N&&bU(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!se,h&&t<=0&&w.render(fo,!0,!0)},OIe=function(e,t,r,i,a,s,o,c){var u=(e._pt&&e._ptCache||(e._ptCache={}))[t],l,d,h,p;if(!u)for(u=e._ptCache[t]=[],h=e._ptLookup,p=e._targets.length;p--;){if(l=h[p][t],l&&l.d&&l.d._pt)for(l=l.d._pt;l&&l.p!==t&&l.fp!==t;)l=l._next;if(!l)return h2=1,e.vars[t]="+=0",lP(e,o),h2=0,c?qg(t+" not eligible for reset"):1;u.push(l)}for(p=u.length;p--;)d=u[p],l=d._pt||d,l.s=(i||i===0)&&!a?i:l.s+(i||0)+s*l.c,l.c=r-l.s,d.e&&(d.e=Mr(r)+Vi(d.e)),d.b&&(d.b=l.s+Vi(d.b))},MIe=function(e,t){var r=e[0]?cf(e[0]).harness:0,i=r&&r.aliases,a,s,o,c;if(!i)return t;a=bp({},t);for(s in i)if(s in a)for(c=i[s].split(","),o=c.length;o--;)a[c[o]]=a[s];return a},DIe=function(e,t,r,i){var a=t.ease||i||"power1.inOut",s,o;if(Qi(t))o=r[e]||(r[e]=[]),t.forEach(function(c,u){return o.push({t:u/(t.length-1)*100,v:c,e:a})});else for(s in t)o=r[s]||(r[s]=[]),s==="ease"||o.push({t:parseFloat(e),v:t[s],e:a})},ug=function(e,t,r,i,a){return Tr(e)?e.call(t,r,i,a):_i(e)&&~e.indexOf("random(")?Wg(e):e},mU=sP+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",gU={};Ua(mU+",id,stagger,delay,duration,paused,scrollTrigger",function(n){return gU[n]=1});var Dr=function(n){DB(e,n);function e(r,i,a,s){var o;typeof i=="number"&&(a.duration=i,i=a,a=null),o=n.call(this,s?i:og(i))||this;var c=o.vars,u=c.duration,l=c.delay,d=c.immediateRender,h=c.stagger,p=c.overwrite,g=c.keyframes,v=c.defaults,y=c.scrollTrigger,b=c.yoyoEase,x=i.parent||pr,S=(Qi(r)||LB(r)?Ju(r[0]):"length"in i)?[r]:ho(r),w,k,E,I,P,A,N,j;if(o._targets=S.length?oP(S):qg("GSAP target "+r+" not found. https://gsap.com",!Cs.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=p,g||h||X0(u)||X0(l)){if(i=o.vars,w=o.timeline=new ya({data:"nested",defaults:v||{},targets:x&&x.data==="nested"?x.vars.targets:S}),w.kill(),w.parent=w._dp=Nu(o),w._start=0,h||X0(u)||X0(l)){if(I=S.length,N=h&&eU(h),eu(h))for(P in h)~mU.indexOf(P)&&(j||(j={}),j[P]=h[P]);for(k=0;k<I;k++)E=q_(i,gU),E.stagger=0,b&&(E.yoyoEase=b),j&&bp(E,j),A=S[k],E.duration=+ug(u,Nu(o),k,A,S),E.delay=(+ug(l,Nu(o),k,A,S)||0)-o._delay,!h&&I===1&&E.delay&&(o._delay=l=E.delay,o._start+=l,E.delay=0),w.to(A,E,N?N(k,A,S):0),w._ease=ln.none;w.duration()?u=l=0:o.timeline=0}else if(g){og(Es(w.vars.defaults,{ease:"none"})),w._ease=lf(g.ease||i.ease||"none");var L=0,B,V,X;if(Qi(g))g.forEach(function(ne){return w.to(S,ne,">")}),w.duration();else{E={};for(P in g)P==="ease"||P==="easeEach"||DIe(P,g[P],E,g.easeEach);for(P in E)for(B=E[P].sort(function(ne,se){return ne.t-se.t}),L=0,k=0;k<B.length;k++)V=B[k],X={ease:V.e,duration:(V.t-(k?B[k-1].t:0))/100*u},X[P]=V.v,w.to(S,X,L),L+=X.duration;w.duration()<u&&w.to({},{duration:u-w.duration()})}}u||o.duration(u=w.duration())}else o.timeline=0;return p===!0&&!eP&&(Dl=Nu(o),pr.killTweensOf(S),Dl=0),Fc(x,Nu(o),a),i.reversed&&o.reverse(),i.paused&&o.paused(!0),(d||!u&&!g&&o._start===Wr(x._time)&&Ba(d)&&dIe(Nu(o))&&x.data!=="nested")&&(o._tTime=-$n,o.render(Math.max(0,-l)||0)),y&&XB(Nu(o),y),o}var t=e.prototype;return t.render=function(i,a,s){var o=this._time,c=this._tDur,u=this._dur,l=i<0,d=i>c-$n&&!l?c:i<$n?0:i,h,p,g,v,y,b,x,S,w;if(!u)hIe(this,i,a,s);else if(d!==this._tTime||!i||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==l||this._lazy){if
3935(h=d,S=this.timeline,this._repeat){if(v=u+this._rDelay,this._repeat<-1&&l)return this.totalTime(v*100+i,a,s);if(h=Wr(d%v),d===c?(g=this._repeat,h=u):(y=Wr(d/v),g=~~y,g&&g===y?(h=u,g--):h>u&&(h=u)),b=this._yoyo&&g&1,b&&(w=this._yEase,h=u-h),y=xp(this._tTime,v),h===o&&!s&&this._initted&&g===y)return this._tTime=d,this;g!==y&&(S&&this._yEase&&dU(S,b),this.vars.repeatRefresh&&!b&&!this._lock&&h!==v&&this._initted&&(this._lock=s=1,this.render(Wr(v*g),!0).invalidate()._lock=0))}if(!this._initted){if(JB(this,l?i:h,s,a,d))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&g!==y))return this;if(u!==this._dur)return this.render(i,a,s)}if(this._tTime=d,this._time=h,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=x=(w||this._ease)(h/u),this._from&&(this.ratio=x=1-x),!o&&d&&!a&&!y&&(xs(this,"onStart"),this._tTime!==d))return this;for(p=this._pt;p;)p.r(x,p.d),p=p._next;S&&S.render(i<0?i:S._dur*S._ease(h/this._dur),a,s)||this._startAt&&(this._zTime=i),this._onUpdate&&!a&&(l&&c2(this,i,a,s),xs(this,"onUpdate")),this._repeat&&g!==y&&this.vars.onRepeat&&!a&&this.parent&&xs(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(l&&!this._onUpdate&&c2(this,i,!0,!0),(i||!u)&&(d===this._tDur&&this._ts>
39350||!d&&this._ts<0)&&td(this,1),!a&&!(l&&!o)&&(d||o||b)&&(xs(this,d===c?"onComplete":"onReverseComplete",!0),this._prom&&!(d<c&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),n.prototype.invalidate.call(this,i)},t.resetTo=function(i,a,s,o,c){Hg||gs.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),l;return this._initted||lP(this,u),l=this._ease(u/this._dur),OIe(this,i,a,s,o,l,u,c)?this.resetTo(i,a,s,o,1):(f1(this,0),this.parent||KB(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(i,a){if(a===void 0&&(a="all"),!i&&(!a||a==="all"))return this._lazy=this._pt=0,this.parent?Um(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Oi),this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(i,a,Dl&&Dl.vars.overwrite!==!0)._first||Um(this),this.parent&&s!==this.timeline.totalDuration()&&wp(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,c=i?ho(i):o,u=this._ptLookup,l=this._pt,d,h,p,g,v,y,b;if((!a||a==="all")&&uIe(o,c))return a==="all"&&(this._pt=0),Um(this);for(d=this._op=this._op||[],a!=="all"&&(_i(a)&&(v={},Ua(a,function(x){return v[x]=1}),a=v),a=MIe(o,a)),b=o.length;b--;)if(~c.indexOf(o[b])){h=u[b],a==="all"?(d[b]=a,g=h,p={}):(p=d[b]=d[b]||{},g=a);for(v in g)y=h&&h[v],y&&((!("kill"in y.d)||y.d.kill(v)===!0)&&l1(this,y,"_pt"),delete h[v]),p!=="all"&&(p[v]=1)}return this._initted&&!this._pt&&l&&Um(this),this},e.to=function(i,a){return new e(i,a,arguments[2])},e.from=function(i,a){return cg(1,arguments)},e.delayedCall=function(i,a,s,o){return new e(a,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:a,onReverseComplete:a,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},e.fromTo=function(i,a,s){return cg(2,arguments)},e.set=function(i,a){return a.duration=0,a.repeatDelay||(a.repeat=0),new e(i,a)},e.killTweensOf=function(i,a,s){return pr.killTweensOf(i,a,s)},e}(Vg);Es(Dr.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Ua("staggerTo,staggerFrom,staggerFromTo",function(n){Dr[n]=function(){var e=new ya,t=l2.call(arguments,0);return t.splice(n==="staggerFromTo"?5:4,0,0),e[n].apply(e,t)}});var dP=function(e,t,r){return e[t]=r},vU=function(e,t,r){return e[t](r)},NIe=function(e,t,r,i){return e[t](i.fp,r)},LIe=function(e,t,r){return e.setAttribute(t,r)},fP=function(e,t){return Tr(e[t])?vU:tP(e[t])&&e.setAttribute?LIe:dP},yU=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},FIe=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},_U=function(e,t){var r=t._pt,i="";if(!e&&t.b)i=t.b;else if(e===1&&t.e)i=t.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*e):Math.round((r.s+r.c*e)*1e4)/1e4)+i,r=r._next;i+=t.c}t.set(t.t,t.p,i,t)},hP=function(e,t){for(var r=t._pt;r;)r.r(e,r.d),r=r._next},$Ie=function(e,t,r,i){for(var a=this._pt,s;a;)s=a._next,a.p===i&&a.modifier(e,t,r),a=s},BIe=function(e){for(var t=this._pt,r,i;t;)i=t._next,t.p===e&&!t.op||t.op===e?l1(this,t,"_pt"):t.dep||(r=1),t=i;return!r},UIe=function(e,t,r,i){i.mSet(e,t,i.m.call(i.tween,r,i.mt),i)},bU=function(e){for(var t=e._pt,r,i,a,s;t;){for(r=t._next,i=a;i&&i.pr>t.pr;)i=i._next;(t._prev=i?i._prev:s)?t._prev._next=t:a=t,(t._next=i)?i._prev=t:s=t,t=r}e._pt=a},ja=function(){function n(t,r,i,a,s,o,c,u,l){this.t=r,this.s=a,this.c=s,this.p=i,this.r=o||yU,this.d=c||this,this.set=u||dP,this.pr=l||0,this._next=t,t&&(t._prev=this)}var e=n.prototype;return e.modifier=function(r,i,a){this.mSet=this.mSet||this.set,this.set=UIe,this.m=r,this.mt=a,this.tween=i},n}();Ua(sP+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(n){return aP[n]=1});Ts.TweenMax=Ts.TweenLite=Dr;Ts.TimelineLite=Ts.TimelineMax=ya;
3935pr=new ya({sortChildren:!1,defaults:_p,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Cs.stringFilter=uU;var df=[],Ry={},jIe=[],nM=0,qIe=0,yC=function(e){return(Ry[e]||jIe).map(function(t){return t()})},p2=function(){var e=Date.now(),t=[];e-nM>2&&(yC("matchMediaInit"),df.forEach(function(r){var i=r.queries,a=r.conditions,s,o,c,u;for(o in i)s=Ac.matchMedia(i[o]).matches,s&&(c=1),s!==a[o]&&(a[o]=s,u=1);u&&(r.revert(),c&&t.push(r))}),yC("matchMediaRevert"),t.forEach(function(r){return r.onMatch(r,function(i){return r.add(null,i)})}),nM=e,yC("matchMedia"))},xU=function(){function n(t,r){this.selector=r&&d2(r),this.data=[],this._r=[],this.isReverted=!1,this.id=qIe++,t&&this.add(t)}var e=n.prototype;return e.add=function(r,i,a){Tr(r)&&(a=i,i=r,r=Tr);var s=this,o=function(){var u=rr,l=s.selector,d;return u&&u!==s&&u.data.push(s),a&&(s.selector=d2(a)),rr=s,d=i.apply(s,arguments),Tr(d)&&s._r.push(d),rr=u,s.selector=l,s.isReverted=!1,d};return s.last=o,r===Tr?o(s,function(c){return s.add(null,c)}):r?s[r]=o:o},e.ignore=function(r){var i=rr;rr=null,r(this),rr=i},e.getTweens=function(){var r=[];return this.data.forEach(function(i){return i instanceof n?r.push.apply(r,i.getTweens()):i instanceof Dr&&!(i.parent&&i.parent.data==="nested")&&r.push(i)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,i){var a=this;if(r?function(){for(var o=a.getTweens(),c=a.data.length,u;c--;)u=a.data[c],u.data==="isFlip"&&(u.revert(),u.getChildren(!0,!0,!1).forEach(function(l){return o.splice(o.indexOf(l),1)}));for(o.map(function(l){return{g:l._dur||l._delay||l._sat&&!l._sat.vars.immediateRender?l.globalTime(0):-1/0,t:l}}).sort(function(l,d){return d.g-l.g||-1/0}).forEach(function(l){return l.t.revert(r)}),c=a.data.length;c--;)u=a.data[c],u instanceof ya?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof Dr)&&u.revert&&u.revert(r);a._r.forEach(function(l){return l(r,a)}),a.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),i)for(var s=df.length;s--;)df[s].id===this.id&&df.splice(s,1)},e.revert=function(r){this.kill(r||{})},n}(),zIe=function(){function n(t){this.contexts=[],this.scope=t,rr&&rr.data.push(this)}var e=n.prototype;return e.add=function(r,i,a){eu(r)||(r={matches:r});var s=new xU(0,a||this.scope),o=s.conditions={},c,u,l;rr&&!s.selector&&(s.selector=rr.selector),this.contexts.push(s),i=s.add("onMatch",i),s.queries=r;for(u in r)u==="all"?l=1:(c=Ac.matchMedia(r[u]),c&&(df.indexOf(s)<0&&df.push(s),(o[u]=c.matches)&&(l=1),c.addListener?c.addListener(p2):c.addEventListener("change",p2)));return l&&i(s,function(d){return s.add(null,d)}),this},e.revert=function(r){this.kill(r||{})}
vendor: 1,644 bytes, line 3935
3935,e.kill=function(r){this.contexts.forEach(function(i){return i.kill(r,!0)})},n}(),W_={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.forEach(function(i){return sU(i)})},timeline:function(e){return new ya(e)},getTweensOf:function(e,t){return pr.getTweensOf(e,t)},getProperty:function(e,t,r,i){_i(e)&&(e=ho(e)[0]);var a=cf(e||{}).get,s=r?GB:VB;return r==="native"&&(r=""),e&&(t?s((fs[t]&&fs[t].get||a)(e,t,r,i)):function(o,c,u){return s((fs[o]&&fs[o].get||a)(e,o,c,u))})},quickSetter:function(e,t,r){if(e=ho(e),e.length>1){var i=e.map(function(l){return Va.quickSetter(l,t,r)}),a=i.length;return function(l){for(var d=a;d--;)i[d](l)}}e=e[0]||{};var s=fs[t],o=cf(e),c=o.harness&&(o.harness.aliases||{})[t]||t,u=s?function(l){var d=new s;Ah._pt=0,d.init(e,r?l+r:l,Ah,0,[e]),d.render(1,d),Ah._pt&&hP(1,Ah)}:o.set(e,c);return s?u:function(l){return u(e,c,r?l+r:l,o,1)}},quickTo:function(e,t,r){var i,a=Va.to(e,Es((i={},i[t]="+=0.1",i.paused=!0,i.stagger=0,i),r||{})),s=function(c,u,l){return a.resetTo(t,c,u,l)};return s.tween=a,s},isTweening:function(e){return pr.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=lf(e.ease,_p.ease)),JO(_p,e||{})},config:function(e){return JO(Cs,e||{})},registerEffect:function(e){var t=e.name,r=e.effect,i=e.plugins,a=e.defaults,s=e.extendTimeline;(i||"").split(",").forEach(function(o){return o&&!fs[o]&&!Ts[o]&&qg(t+" effect requires "+o+" plugin.")}),pC[t]=function(o,c,u){return r(ho(o),Es(c||{},a),u)},s&&(ya.prototype[t]=function(o,c,u){return this.add(pC[t](o,eu(c)?c:(u=c)&&{},this),u)})},registerEase:function(e,t){ln[e]=lf(t)}
3935,parseEase:function(e,t){return arguments.length?lf(e,t):ln},getById:function(e){return pr.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var r=new ya(e),i,a;for(r.smoothChildTiming=Ba(e.smoothChildTiming),pr.remove(r),r._dp=0,r._time=r._tTime=pr._time,i=pr._first;i;)a=i._next,(t||!(!i._dur&&i instanceof Dr&&i.vars.onComplete===i._targets[0]))&&Fc(r,i,i._start-i._delay),i=a;return Fc(pr,r,0),r},context:function(e,t){return e?new xU(e,t):rr},matchMedia:function(e){return new zIe(e)},matchMediaRefresh:function(){return df.forEach(function(e){var t=e.conditions,r,i;for(i in t)t[i]&&(t[i]=!1,r=1);r&&e.revert()})||p2()},addEventListener:function(e,t){var r=Ry[e]||(Ry[e]=[]);~r.indexOf(t)||r.push(t)},removeEventListener:function(e,t){var r=Ry[e],i=r&&r.indexOf(t);i>=0&&r.splice(i,1)},utils:{wrap:xIe,wrapYoyo:wIe,distribute:eU,random:nU,snap:tU,normalize:bIe,getUnit:Vi,clamp:gIe,splitColor:oU,toArray:ho,selector:d2,mapRange:iU,pipe:yIe,unitize:_Ie,interpolate:CIe,shuffle:ZB},install:jB,effects:pC,ticker:gs,updateRoot:ya.updateRoot,plugins:fs,globalTimeline:pr,core:{PropTween:ja,globals:qB,Tween:Dr,Timeline:ya,Animation:Vg,getCache:cf,_removeLinkedListItem:l1,reverting:function(){return Oi},context:function(e){return e&&rr&&(rr.data.push(e),e._ctx=rr),rr},suppressOverwrites:function(e){return eP=e}}};Ua("to,from,fromTo,delayedCall,set,killTweensOf",function(n){return W_[n]=Dr[n]});gs.add(ya.updateRoot);Ah=W_.to({},{duration:0});var WIe=function(e,t){for(var r=e._pt;r&&r.p!==t&&r.op!==t&&r.fp!==t;)r=r._next;return r},HIe=function(e,t){var r=e._targets,i,a,s;for(i in t)for(a=r.length;a--;)s=e._ptLookup[a][i],s&&(s=s.d)&&(s._pt&&(s=WIe(s,i)),s&&s.modifier&&s.modifier(t[i],e,r[a],i))},_C=function(e,t){return{name:e,headless:1,rawVars:1,init:function(i,a,s){s._onInit=function(o){var c,u;if(_i(a)&&(c={},Ua(a,function(l){return c[l]=1}),a=c),t){c={};for(u in a)c[u]=t(a[u]);a=c}HIe(o,a)}}}},Va=W_.registerPlugin({name:"attr",init:function(e,t,r,i,a){var s,o,c;this.tween=r;for(s in t)c=e.getAttribute(s)||"",o=this.add(e,"setAttribute",(c||0)+"",t[s],i,a,0,0,s),o.op=s,o.b=c,this._props.push(s)},render:function(e,t){for(var r=t._pt;r;)Oi?r.set(r.t,r.p,r.b,r):r.r(e,r.d),r=r._next}},{name:"endArray",headless:1,init:function(e,t){for(var r=t.length;r--;)this.add(e,r,e[r]||0,t[r],0,0,0,0,0,1)}},_C("roundProps",f2),_C("modifiers"),_C("snap",tU))||W_;Dr.version=ya.version=Va.version="3.13.0";UB=1;nP()&&Cp();ln.Power0;ln.Power1;ln.Power2;ln.Power3;ln.Power4;ln.Linear;ln.Quad;ln.Cubic;ln.Quart;ln.Quint;ln.Strong;ln.Elastic;ln.Back;ln.SteppedEase;ln.Bounce;ln.Sine;ln.Expo;ln.Circ;/*! 3936 * CSSPlugin 3.13.0 3937 * https://gsap.com 3938 * 3939 * Copyright 2008-2025, GreenSock. All rights reserved. 3940 * Subject to the terms at https://gsap.com/standard-license 3941 * @author: Jack Doyle, [email protected] 3942*/var rM,Nl,tp,pP,Xd,iM,mP,VIe=function(){return typeof window<"u"},Qu={},Ld=180/Math.PI,np=Math.PI/180,ph=Math.atan2,aM=1e8,gP=/([A-Z])/g,GIe=/(left|right|width|margin|padding|x)/i,KIe=/[\s,\(]\S/,qc={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},m2=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},YIe=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},XIe=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},JIe=function(e,t){var r=t.s+t.c*e;t.set(t.t,t.p,~~(r+(r<0?-.5:.5))+t.u,t)},wU=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},CU=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},QIe=function(e,t,r){return e.style[t]=r},ZIe=function(e,t,r){return e.style.setProperty(t,r)},eOe=function(e,t,r){return e._gsap[t]=r},tOe=function(e,t,r){return e._gsap.scaleX=e._gsap.scaleY=r},nOe=function(e,t,r,i,a){var s=e._gsap;s.scaleX=s.scaleY=r,s.renderTransform(a,s)},rOe=function(e,t,r,i,a){var s=e._gsap;s[t]=r,s.renderTransform(a,s)},gr="transform",qa=gr+"Origin",iOe=function n(e,t){var r=this,i=this.target,a=i.style,s=i._gsap;if(e in Qu&&a){if(this.tfm=this.tfm||{},e!=="transform")e=qc[e]||e,~e.indexOf(",")?e.split(",").forEach(function(o){return r.tfm[o]=Fu(i,o)}):this.tfm[e]=s.x?s[e]:Fu(i,e),e===qa&&(this.tfm.zOrigin=s.zOrigin);else return qc.transform.split(",").forEach(function(o){return n.call(r,o,t)});if(this.props.indexOf(gr)>=0)return;s.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(qa,t,"")),e=gr}(a||t)&&this.props.push(e,t,a[e])},kU=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},aOe=function(){var e=this.props,t=this.target,r=t.style,i=t._gsap,a,s;for(a=0;a<e.length;a+=3)e[a+1]?e[a+1]===2?t[e[a]](e[a+2]):t[e[a]]=e[a+2]:e[a+2]?r[e[a]]=e[a+2]:r.removeProperty(e[a].substr(0,2)==="--"?e[a]:e[a].replace(gP,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)i[s]=this.tfm[s];i.svg&&(i.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),a=mP(),(!a||!a.isStart)&&!r[gr]&&(kU(r),i.zOrigin&&r[qa]&&(r[qa]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},SU=function(e,t){var r={target:e,props:[],revert:aOe,save:iOe};return e._gsap||Va.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(i){return r.s
3942ave(i)}),r},TU,g2=function(e,t){var r=Nl.createElementNS?Nl.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Nl.createElement(e);return r&&r.style?r:Nl.createElement(e)},po=function n(e,t,r){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(gP,"-$1").toLowerCase())||i.getPropertyValue(t)||!r&&n(e,kp(t)||t,1)||""},sM="O,Moz,ms,Ms,Webkit".split(","),kp=function(e,t,r){var i=t||Xd,a=i.style,s=5;if(e in a&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);s--&&!(sM[s]+e in a););return s<0?null:(s===3?"ms":s>=0?sM[s]:"")+e},v2=function(){VIe()&&window.document&&(rM=window,Nl=rM.document,tp=Nl.documentElement,Xd=g2("div")||{style:{}},g2("div"),gr=kp(gr),qa=gr+"Origin",Xd.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",TU=!!kp("perspective"),mP=Va.core.reverting,pP=1)},oM=function(e){var t=e.ownerSVGElement,r=g2("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=e.cloneNode(!0),a;i.style.display="block",r.appendChild(i),tp.appendChild(r);try{a=i.getBBox()}catch{}return r.removeChild(i),tp.removeChild(r),a},cM=function(e,t){for(var r=t.length;r--;)if(e.hasAttribute(t[r]))return e.getAttribute(t[r])},EU=function(e){var t,r;try{t=e.getBBox()}catch{t=oM(e),r=1}return t&&(t.width||t.height)||r||(t=oM(e)),t&&!t.width&&!t.x&&!t.y?{x:+cM(e,["x","cx","x1"])||0,y:+cM(e,["y","cy","y1"])||0,width:0,height:0}:t},PU=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&EU(e))},Cf=function(e,t){if(t){var r=e.style,i;t in Qu&&t!==qa&&(t=gr),r.removeProperty?(i=t.substr(0,2),(i==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),r.removeProperty(i==="--"?t:t.replace(gP,"-$1").toLowerCase())):r.removeAttribute(t)}},Ll=function(e,t,r,i,a,s){var o=new ja(e._pt,t,r,0,1,s?CU:wU);return e._pt=o,o.b=i,o.e=a,e._props.push(r),o},uM={deg:1,rad:1,turn:1},sOe={grid:1,flex:1},nd=function n(e,t,r,i){var a=parseFloat(r)||0,s=(r+"").trim().substr((a+"").length)||"px",o=Xd.style,c=GIe.test(t),u=e.tagName.toLowerCase()==="svg",l=(u?"client":"offset")+(c?"Width":"Height"),d=100,h=i==="px",p=i==="%",g,v,y,b;if(i===s||!a||uM[i]||uM[s])return a;if(s!=="px"&&!h&&(a=n(e,t,r,"px")),b=e.getCTM&&PU(e),(p||s==="%")&&(Qu[t]||~t.indexOf("adius")))return g=b?e.getBBox()[c?"width":"height"]:e[l],Mr(p?a/g*d:a/100*g);if(o[c?"width":"height"]=d+(h?s:i),v=i!=="rem"&&~t.indexOf("adius")||i==="em"&&e.appendChild&&!u?e:e.parentNode,b&&(v=(e.ownerSVGElement||{}).parentNode),(!v||v===Nl||!v.appendChild)&&(v=Nl.body),y=v._gsap,y&&p&&y.width&&c&&y.time===gs.time&&!y.uncache)return Mr(a/y.width*d);if(p&&(t==="height"||t==="width")){var x=e.style[t];e.style[t]=d+i,g=e[l],x?e.style[t]=x:Cf(e,t)}else(p||s==="%")&&!sOe[po(v,"display")]&&(o.position=po(e,"position")),v===e&&(o.position="static"),v.appendChild(Xd),g=Xd[l],v.removeChild(Xd),o.position="absolute";return c&&p&&(y=cf(v),y.time=gs.time,y.width=v[l]),Mr(h?g*a/d:g&&a?d/g*a:0)},Fu=function(e,t,r,i){var a;return pP||v2(),t in qc&&t!=="transform"&&(t=qc[t],~t.indexOf(",")&&(t=t.split(",")[0])),Qu[t]&&t!=="transform"?(a=Kg(e,i),a=t!=="transformOrigin"?a[t]:a.svg?a.origin:V_(po(e,qa))+" "+a.zOrigin+"px"):(a=e.style[t],(!a||a==="auto"||i||~(a+"").indexOf("calc("))&&(a=H_[t]&&H_[t](e,t,r)||po(e,t)||WB(e,t)||(t==="opacity"?1:0))),r&&!~(a+"").trim().indexOf(" ")?nd(e,t,a,r)+r:a},oOe=function(e,t,r,i){if(!r||r==="none"){var a=kp(t,e,1),s=a&&po(e,a,1);s&&s!==r?(t=a,r=s):t==="borderColor"&&(r=po(e,"borderTopColor"))}var o=new ja(this._pt,e.style,t,0,1,_U),c=0,u=0,l,d,h,p,g,v,y,b,x,S,w,k;if(o.b=r,o.e=i,r+="",i+="",i.substring(0,6)==="var(--"&&(i=po(e,i.substring(4,i.indexOf(")")))),i==="auto"&&(v=e.style[t],e.style[t]=i,i=po(e,t)||i,v?e.style[t]=v:Cf(e,t)),l=[r,i],uU(l),r=l[0],i=l[1],h=r.match(Rh)||[],k=i.match(Rh)||[],k.length){for(;d=Rh.exec(i);)y=d[0],x=i.substring(c,d.index),g?g=(g+1)%5:(x.substr(-5)==="rgba("||x.substr(-5)==="hsla(")&&(g=1),y!==(v=h[u++]||"")&&(p=parseFloat(v)||0,w=v.substr((p+"").length),y.charAt(1)==="="&&(y=ep(p,y)+w),b=parseFloat(y),S=y.substr((b+"").length),c=Rh.lastIndex-S.length,S||(S=S||Cs.units[t]||w,c===i.length&&(i+=S,o.e+=S)),w!==S&&(p=nd(e,t,v,S)||0),o._pt={_next:o._pt,p:x||u===1?x:",",s:p,c:b-p,m:g&&g<4||t==="zIndex"?Math.round:0});o.c=c<i.length?i.substring(c,i.length):""}else o.r=t==="display"&&i==="none"?CU:wU;return $B.test(i)&&(o.e=0),this._pt=o,o},lM={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},cOe=function(e){var t=e.split(" "),r=t[0],i=t[1]||"50%";return(r==="top"||r==="bottom"||i==="left"||i==="right")&&(e=r,r=i,i=e),t[0]=lM[r]||r,t[1]=lM[i]||i,t.join(" ")}
3942,uOe=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var r=t.t,i=r.style,a=t.u,s=r._gsap,o,c,u;if(a==="all"||a===!0)i.cssText="",c=1;else for(a=a.split(","),u=a.length;--u>-1;)o=a[u],Qu[o]&&(c=1,o=o==="transformOrigin"?qa:gr),Cf(r,o);c&&(Cf(r,gr),s&&(s.svg&&r.removeAttribute("transform"),i.scale=i.rotate=i.translate="none",Kg(r,1),s.uncache=1,kU(i)))}},H_={clearProps:function(e,t,r,i,a){if(a.data!=="isFromStart"){var s=e._pt=new ja(e._pt,t,r,0,0,uOe);return s.u=i,s.pr=-10,s.tween=a,e._props.push(r),1}}},Gg=[1,0,0,1,0,0],RU={},AU=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},dM=function(e){var t=po(e,gr);return AU(t)?Gg:t.substr(7).match(FB).map(Mr)},vP=function(e,t){var r=e._gsap||cf(e),i=e.style,a=dM(e),s,o,c,u;return r.svg&&e.getAttribute("transform")?(c=e.transform.baseVal.consolidate().matrix,a=[c.a,c.b,c.c,c.d,c.e,c.f],a.join(",")==="1,0,0,1,0,0"?Gg:a):(a===Gg&&!e.offsetParent&&e!==tp&&!r.svg&&(c=i.display,i.display="block",s=e.parentNode,(!s||!e.offsetParent&&!e.getBoundingClientRect().width)&&(u=1,o=e.nextElementSibling,tp.appendChild(e)),a=dM(e),c?i.display=c:Cf(e,"display"),u&&(o?s.insertBefore(e,o):s?s.appendChild(e):tp.removeChild(e))),t&&a.length>6?[a[0],a[1],a[4],a[5],a[12],a[13]]:a)},y2=function(e,t,r,i,a,s){var o=e._gsap,c=a||vP(e,!0),u=o.xOrigin||0,l=o.yOrigin||0,d=o.xOffset||0,h=o.yOffset||0,p=c[0],g=c[1],v=c[2],y=c[3],b=c[4],x=c[5],S=t.split(" "),w=parseFloat(S[0])||0,k=parseFloat(S[1])||0,E,I,P,A;r?c!==Gg&&(I=p*y-g*v)&&(P=w*(y/I)+k*(-v/I)+(v*x-y*b)/I,A=w*(-g/I)+k*(p/I)-(p*x-g*b)/I,w=P,k=A):(E=EU(e),w=E.x+(~S[0].indexOf("%")?w/100*E.width:w),k=E.y+(~(S[1]||S[0]).indexOf("%")?k/100*E.height:k)),i||i!==!1&&o.smooth?(b=w-u,x=k-l,o.xOffset=d+(b*p+x*v)-b,o.yOffset=h+(b*g+x*y)-x):o.xOffset=o.yOffset=0,o.xOrigin=w,o.yOrigin=k,o.smooth=!!i,o.origin=t,o.originIsAbsolute=!!r,e.style[qa]="0px 0px",s&&(Ll(s,o,"xOrigin",u,w),Ll(s,o,"yOrigin",l,k),Ll(s,o,"xOffset",d,o.xOffset),Ll(s,o,"yOffset",h,o.yOffset)),e.setAttribute("data-svg-origin",w+" "+k)},Kg=function(e,t){var r=e._gsap||new hU(e);if("x"in r&&!t&&!r.uncache)return r;var i=e.style,a=r.scaleX<0,s="px",o="deg",c=getComputedStyle(e),u=po(e,qa)||"0",l,d,h,p,g,v,y,b,x,S,w,k,E,I,P,A,N,j,L,B,V,X,ne,se,ie,de,ue,Ce,we,Fe,Ge,Ie;return l=d=h=v=y=b=x=S=w=0,p=g=1,r.svg=!!(e.getCTM&&PU(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(i[gr]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[gr]!=="none"?c[gr]:"")),i.scale=i.rotate=i.translate="none"),I=vP(e,r.svg),r.svg&&(r.uncache?(ie=e.getBBox(),u=r.xOrigin-ie.x+"px "+(r.yOrigin-ie.y)+"px",se=""):se=!t&&e.getAttribute("data-svg-origin"),y2(e,se||u,!!se||r.originIsAbsolute,r.smooth!==!1,I)),k=r.xOrigin||0,E=r.yOrigin||0,I!==Gg&&(j=I[0],L=I[1],B=I[2],V=I[3],l=X=I[4],d=ne=I[5],I.length===6?(p=Math.sqrt(j*j+L*L),g=Math.sqrt(V*V+B*B),v=j||L?ph(L,j)*Ld:0,x=B||V?ph(B,V)*Ld+v:0,x&&(g*=Math.abs(Math.cos(x*np))),r.svg&&(l-=k-(k*j+E*B),d-=E-(k*L+E*V))):(Ie=I[6],Fe=I[7],ue=I[8],Ce=I[9],we=I[10],Ge=I[11],l=I[12],d=I[13],h=I[14],P=ph(Ie,we),y=P*Ld,P&&(A=Math.cos(-P),N=Math.sin(-P),se=X*A+ue*N,ie=ne*A+Ce*N,de=Ie*A+we*N,ue=X*-N+ue*A,Ce=ne*-N+Ce*A,we=Ie*-N+we*A,Ge=Fe*-N+Ge*A,X=se,ne=ie,Ie=de),P=ph(-B,we),b=P*Ld,P&&(A=Math.cos(-P),N=Math.sin(-P),se=j*A-ue*N,ie=L*A-Ce*N,de=B*A-we*N,Ge=V*N+Ge*A,j=se,L=ie,B=de),P=ph(L,j),v=P*Ld,P&&(A=Math.cos(P),N=Math.sin(P),se=j*A+L*N,ie=X*A+ne*N,L=L*A-j*N,ne=ne*A-X*N,j=se,X=ie),y&&Math.abs(y)+Math.abs(v)>359.9&&(y=v=0,b=180-b),p=Mr(Math.sqrt(j*j+L*L+B*B)),g=Mr(Math.sqrt(ne*ne+Ie*Ie)),P=ph(X,ne),x=Math.abs(P)>2e-4?P*Ld:0,w=Ge?1/(Ge<0?-Ge:Ge):0),r.svg&&(se=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!AU(po(e,gr)),se&&e.setAttribute("transform",se))),Math.abs(x)>90&&Math.abs(x)<270&&(a?(p*=-1,x+=v<=0?180:-180,v+=v<=0?180:-180):(g*=-1,x+=x<=0?180:-180)),t=t||r.uncache,r.x=l-((r.xPercent=l&&(!t&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-l)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+s,r.y=d-((r.yPercent=d&&(!t&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-d)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+s,r.z=h+s,r.scaleX=Mr(p),r.scaleY=Mr(g),r.rotation=Mr(v)+o,r.rotationX=Mr(y)+o,r.rotationY=Mr(b)+o,r.skewX=x+o,r.skewY=S+o,r.transformPerspective=w+s,(r.zOrigin=parseFloat(u.split(" ")[2])||!t&&r.zOrigin||0)&&(i[qa]=V_(u)),r.xOffset=r.yOffset=0,r.force3D=Cs.force3D,r.renderTransform=r.svg?dOe:TU?IU:lOe,r.uncache=0,r},V_=function(e){return(e=e.split(" "))[0]+" "+e[1]},bC=function(e,t,r){var i=Vi(t);return Mr(parseFloat(t)+parseFloat(nd(e,"x",r+"px",i)))+i},lOe=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,IU(e,t)},Ad="0deg",Om="0px",Id=") ",IU=function(e,t){var r=t||this,i=r.xPercent,a=r.yPercent,s=r.x,o=r.y,c=r.z,u=r.rotation,l=r.rotationY,d=r.rotationX,h=r.skewX,p=r.skewY,g=r.scaleX,v=r.scaleY,y=r.transformPerspective,b=r.force3D,x=r.target,S=r.zOrigin,w="",k=b==="auto"&&e&&e!==1||b===!0;
3942if(S&&(d!==Ad||l!==Ad)){var E=parseFloat(l)*np,I=Math.sin(E),P=Math.cos(E),A;E=parseFloat(d)*np,A=Math.cos(E),s=bC(x,s,I*A*-S),o=bC(x,o,-Math.sin(E)*-S),c=bC(x,c,P*A*-S+S)}y!==Om&&(w+="perspective("+y+Id),(i||a)&&(w+="translate("+i+"%, "+a+"%) "),(k||s!==Om||o!==Om||c!==Om)&&(w+=c!==Om||k?"translate3d("+s+", "+o+", "+c+") ":"translate("+s+", "+o+Id),u!==Ad&&(w+="rotate("+u+Id),l!==Ad&&(w+="rotateY("+l+Id),d!==Ad&&(w+="rotateX("+d+Id),(h!==Ad||p!==Ad)&&(w+="skew("+h+", "+p+Id),(g!==1||v!==1)&&(w+="scale("+g+", "+v+Id),x.style[gr]=w||"translate(0, 0)"},dOe=function(e,t){var r=t||this,i=r.xPercent,a=r.yPercent,s=r.x,o=r.y,c=r.rotation,u=r.skewX,l=r.skewY,d=r.scaleX,h=r.scaleY,p=r.target,g=r.xOrigin,v=r.yOrigin,y=r.xOffset,b=r.yOffset,x=r.forceCSS,S=parseFloat(s),w=parseFloat(o),k,E,I,P,A;c=parseFloat(c),u=parseFloat(u),l=parseFloat(l),l&&(l=parseFloat(l),u+=l,c+=l),c||u?(c*=np,u*=np,k=Math.cos(c)*d,E=Math.sin(c)*d,I=Math.sin(c-u)*-h,P=Math.cos(c-u)*h,u&&(l*=np,A=Math.tan(u-l),A=Math.sqrt(1+A*A),I*=A,P*=A,l&&(A=Math.tan(l),A=Math.sqrt(1+A*A),k*=A,E*=A)),k=Mr(k),E=Mr(E),I=Mr(I),P=Mr(P)):(k=d,P=h,E=I=0),(S&&!~(s+"").indexOf("px")||w&&!~(o+"").indexOf("px"))&&(S=nd(p,"x",s,"px"),w=nd(p,"y",o,"px")),(g||v||y||b)&&(S=Mr(S+g-(g*k+v*I)+y),w=Mr(w+v-(g*E+v*P)+b)),(i||a)&&(A=p.getBBox(),S=Mr(S+i/100*A.width),w=Mr(w+a/100*A.height)),A="matrix("+k+","+E+","+I+","+P+","+S+","+w+")",p.setAttribute("transform",A),x&&(p.style[gr]=A)},fOe=function(e,t,r,i,a){var s=360,o=_i(a),c=parseFloat(a)*(o&&~a.indexOf("rad")?Ld:1),u=c-i,l=i+u+"deg",d,h;return o&&(d=a.split("_")[1],d==="short"&&(u%=s,u!==u%(s/2)&&(u+=u<0?s:-s)),d==="cw"&&u<0?u=(u+s*aM)%s-~~(u/s)*s:d==="ccw"&&u>0&&(u=(u-s*aM)%s-~~(u/s)*s)),e._pt=h=new ja(e._pt,t,r,i,u,YIe),h.e=l,h.u="deg",e._props.push(r),h},fM=function(e,t){for(var r in t)e[r]=t[r];return e},hOe=function(e,t,r){var i=fM({},r._gsap),a="perspective,force3D,transformOrigin,svgOrigin",s=r.style,o,c,u,l,d,h,p,g;i.svg?(u=r.getAttribute("transform"),r.setAttribute("transform",""),s[gr]=t,o=Kg(r,1),Cf(r,gr),r.setAttribute("transform",u)):(u=getComputedStyle(r)[gr],s[gr]=t,o=Kg(r,1),s[gr]=u);for(c in Qu)u=i[c],l=o[c],u!==l&&a.indexOf(c)<0&&(p=Vi(u),g=Vi(l),d=p!==g?nd(r,c,u,g):parseFloat(u),h=parseFloat(l),e._pt=new ja(e._pt,o,c,d,h-d,m2),e._pt.u=g||0,e._props.push(c));fM(o,i)};Ua("padding,margin,Width,Radius",function(n,e){var t="Top",r="Right",i="Bottom",a="Left",s=(e<3?[t,r,i,a]:[t+a,t+r,i+r,i+a]).map(function(o){return e<2?n+o:"border"+o+n});H_[e>1?"border"+n:n]=function(o,c,u,l,d){var h,p;if(arguments.length<4)return h=s.map(function(g){return Fu(o,g,u)}),p=h.join(" "),p.split(h[0]).length===5?h[0]:p;h=(l+"").split(" "),p={},s.forEach(function(g,v){return p[g]=h[v]=h[v]||h[(v-1)/2|0]}),o.init(c,p,d)}});var OU={name:"css",register:v2,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,r,i,a){var s=this._props,o=e.style,c=r.vars.startAt,u,l,d,h,p,g,v,y,b,x,S,w,k,E,I,P;pP||v2(),this.styles=this.styles||SU(e),P=this.styles.props,this.tween=r;for(v in t)if(v!=="autoRound"&&(l=t[v],!(fs[v]&&pU(v,t,r,i,e,a)))){if(p=typeof l,g=H_[v],p==="function"&&(l=l.call(r,i,e,a),p=typeof l),p==="string"&&~l.indexOf("random(")&&(l=Wg(l)),g)g(this,e,v,l,r)&&(I=1);else if(v.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(v)+"").trim(),l+="",Vl.lastIndex=0,Vl.test(u)||(y=Vi(u),b=Vi(l)),b?y!==b&&(u=nd(e,v,u,b)+b):y&&(l+=y),this.add(o,"setProperty",u,l,i,a,0,0,v),s.push(v),P.push(v,0,o[v]);else if(p!=="undefined"){if(c&&v in c?(u=typeof c[v]=="function"?c[v].call(r,i,e,a):c[v],_i(u)&&~u.indexOf("random(")&&(u=Wg(u)),Vi(u+"")||u==="auto"||(u+=Cs.units[v]||Vi(Fu(e,v))||""),(u+"").charAt(1)==="="&&(u=Fu(e,v))):u=Fu(e,v),h=parseFloat(u),x=p==="string"&&l.charAt(1)==="="&&l.substr(0,2),x&&(l=l.substr(2)),d=parseFloat(l),v in qc&&(v==="autoAlpha"&&(h===1&&Fu(e,"visibility")==="hidden"&&d&&(h=0),P.push("visibility",0,o.visibility),Ll(this,o,"visibility",h?"inherit":"hidden",d?"inherit":"hidden",!d)),v!=="scale"&&v!=="transform"&&(v=qc[v],~v.indexOf(",")&&(v=v.split(",")[0]))),S=v in Qu,S){if(this.styles.save(v),p==="string"&&l.substring(0,6)==="var(--"&&(l=po(e,l.substring(4,l.indexOf(")"))),d=parseFloat(l)),w||(k=e._gsap,k.renderTransform&&!t.parseTransform||Kg(e,t.parseTransform),E=t.smoothOrigin!==!1&&k.smooth,w=this._pt=new ja(this._pt,o,gr,0,1,k.renderTransform,k,0,-1),w.dep=1),v==="scale")this._pt=new ja(this._pt,k,"scaleY",k.scaleY,(x?ep(k.scaleY,x+d):d)-k.scaleY||0,m2),this._pt.u=0,s.push("scaleY",v),v+="X";else if(v==="transformOrigin"){P.push(qa,0,o[qa]),l=cOe(l),k.svg?y2(e,l,0,E,0,this):(b=parseFloat(l.split(" ")[2])||0,b!==k.zOrigin&&Ll(this,k,"zOrigin",k.zOrigin,b),Ll(this,o,v,V_(u),V_(l)));continue}else if(v==="svgOrigin"){y2(e,l,1,E,0,this);continue}else if(v in RU){fOe(this,k,v,h,x?ep(h,x+l):l);continue}else if(v==="smoothOrigin"){Ll(this,k,"smooth",k.smooth,l);continue}else if(v==="force3D"){k[v]=l;continue}else if(v==="transform"){hOe(this,l,e);continue}}else v in o||(v=kp(v)||v);if(S||(d||d===0)&&(h||h===0)&&!KIe.test(l)&&v in o)y=(u+"").substr((h+"").length),d||(d=0),b=Vi(l)||(v in Cs.units?Cs.units[v]:y),y!==b&&(h=nd(e,v,u,b)),this._pt=new ja(this._pt,S?k:o,v,h,(x?ep(h,x+d):d)-h,!S&&(b==="px"||v==="zIndex")&&t.autoRound!==!1?JIe:m2),this._pt.u=b||0,y!==b&&b!=="%"&&(this._pt.b=u,this._pt.r=XIe);else if(v in o)oOe.call(this,e,v,u,x?x+l:l);else if(v in e)this.add(e,v,u||e[v],x?x+l:l,i,a);else if(v!=="parseTransform"){iP(v,l);continue}S||(v in o?P.push(v,0,o[v]):typeof e[v]=="function"?P.push(v,2,e[v]()):P.push(v,1,u||e[v])),s.push(v)}}I&&bU(this)},render:function(e,t){if(t.tween._time||!mP())for(var r=t._pt;r;)r.r(e,r.d),r=r._next;else t.styles.revert()},get:Fu,aliases:qc,getSetter:function(e,t,r){var i=qc[t];return i&&i.indexOf(",")<0&&(t=i),t in Qu&&t!==qa&&(e._gsap.x||Fu(e,"x"))?r&&iM===r?t==="scale"?tOe:eOe:(iM=r||{})&&(t==="scale"?nOe:rOe):e.style&&!tP(e.style[t])?QIe:~t.indexOf("-")?ZIe:fP(e,t)},core:{_removeProperty:Cf,_getMatrix:vP}};Va.utils.checkPrefix=kp;Va.core.getStyleSaver=SU;(function(n,e,t,r){var i=Ua(n+","+e+","+t,function(a){Qu[a]=1});Ua(e,function(a){Cs.units[a]="deg",RU[a]=1}
3942),qc[i[13]]=n+","+e,Ua(r,function(a){var s=a.split(":");qc[s[1]]=i[s[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");Ua("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(n){Cs.units[n]="px"});Va.registerPlugin(OU);var pOe=Va.registerPlugin(OU)||Va;pOe.core.Tween;const mOe=n=>n.replace(/[^.]/g,"").length,gOe={name:"number",props:{from:{type:[Number,String],default:0},to:{type:[Number,String],required:!0,default:0},format:{type:Function,default:n=>parseInt(n)},duration:{type:Number,default:1},easing:{type:String,default:"Power1.easeOut"},delay:{type:Number,default:0},tag:{type:String,default:"span"},animationPaused:Boolean},data(){return{fromProp:this.from}},computed:{tweenedNumber(){return this.format(this.fromProp)}},methods:{tween(n){const e=this,t=Dr.to(e.$data,e.duration,{fromProp:n,paused:e.animationPaused,ease:e.easeCheck(),onStart:()=>e.$emit("start"),onComplete:()=>e.$emit("complete"),onUpdate:()=>e.$emit("update"),delay:e.delay});e.tween.tLite=t},play(){this.tween.tLite.play()},pause(){this.tween.tLite.pause()},restart(){this.tween.tLite.restart()},easeCheck(){const n=this;if(mOe(n.easing)!==1)throw new Error('Invalid ease type. (eg. easing="Power1.easeOut")');return n.easing}},watch:{to(n){this.tween(n)}},mounted(){this.tween(this.to)}};var vOe=function(){var e=this,t=e._self._c;return t(e.tag,{tag:"component"},[e._v(" "+e._s(e.tweenedNumber)+" ")])},yOe=[],_Oe=ve(gOe,vOe,yOe,!1,null,null);const bOe=_Oe.exports,xOe={install:function(n){n.component("number",bOe)}};typeof window<"u"&&window.Vue&&window.Vue.use(xOe);var MU={exports:{}};(function(n,e){(function(t){n.exports=t()})(function(){var t=["navigation","request","process","log","user","state","error","manual"],r=function(O,U,W){for(var q=W,Z=0,ge=O.length;Z<ge;Z++)q=U(q,O[Z],Z,O);return q},i=function(O,U){return r(O,function(W,q,Z,ge){return U(q,Z,ge)?W.concat(q):W},[])},a=function(O,U){return r(O,function(W,q,Z,ge){return W===!0||q===U},!1)},s=function(O){return Object.prototype.toString.call(O)==="[object Array]"},o=!{toString:null}.propertyIsEnumerable("toString"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(O){var U=[],W;for(W in O)Object.prototype.hasOwnProperty.call(O,W)&&U.push(W);if(!o)return U;for(var q=0,Z=c.length;q<Z;q++)Object.prototype.hasOwnProperty.call(O,c[q])&&U.push(c[q]);return U},l=function(O,U){return O===void 0&&(O=1),function(W){return typeof W=="number"&&parseInt(""+W,10)===W&&W>=O&&W<=U}},d=function(O){return typeof O=="function"||s(O)&&i(O,function(U){return typeof U=="function"}).length===O.length},h=function(O){return typeof O=="string"&&!!O.length},p={},g=function(){return{unhandledExceptions:!0,unhandledRejections:!0}};p.schema={apiKey:{defaultValue:function(){return null},message:"is required",validate:h},appVersion:{defaultValue:function(){},message:"should be a string",validate:function(O){return O===void 0||h(O)}},appType:{defaultValue:function(){},message:"should be a string",validate:function(O){return O===void 0||h(O)}},autoDetectErrors:{defaultValue:function(){return!0},message:"should be true|false",validate:function(O){return O===!0||O===!1}},enabledErrorTypes:{defaultValue:function(){return g()},message:"should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }",allowPartialObject:!0,validate:function(O){if(typeof O!="object"||!O)return!1;var U=u(O),W=u(g());return!(i(U,function(q){return a(W,q)}).length<U.length||i(u(O),function(q){return typeof O[q]!="boolean"}).length>0)}},onError:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:d},onSession:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:d},onBreadcrumb:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:d},endpoints:{defaultValue:function(O){return typeof O>"u"?{notify:"https://notify.bugsnag.com",sessions:"https://sessions.bugsnag.com"}:{notify:null,sessions:null}}
3942,message:"should be an object containing endpoint URLs { notify, sessions }",validate:function(O){return O&&typeof O=="object"&&h(O.notify)&&h(O.sessions)&&i(u(O),function(U){return!a(["notify","sessions"],U)}).length===0}},autoTrackSessions:{defaultValue:function(O){return!0},message:"should be true|false",validate:function(O){return O===!0||O===!1}},enabledReleaseStages:{defaultValue:function(){return null},message:"should be an array of strings",validate:function(O){return O===null||s(O)&&i(O,function(U){return typeof U=="string"}).length===O.length}},releaseStage:{defaultValue:function(){return"production"},message:"should be a string",validate:function(O){return typeof O=="string"&&O.length}},maxBreadcrumbs:{defaultValue:function(){return 25},message:"should be a number â¤100",validate:function(O){return l(0,100)(O)}},enabledBreadcrumbTypes:{defaultValue:function(){return t},message:"should be null or a list of available breadcrumb types ("+t.join(",")+")",validate:function(O){return O===null||s(O)&&r(O,function(U,W){return U===!1?U:a(t,W)},!0)}},context:{defaultValue:function(){},message:"should be a string",validate:function(O){return O===void 0||typeof O=="string"}},user:{defaultValue:function(){return{}},message:"should be an object with { id, email, name } properties",validate:function(O){return O===null||O&&r(u(O),function(U,W){return U&&a(["id","email","name"],W)},!0)}},metadata:{defaultValue:function(){return{}},message:"should be an object",validate:function(O){return typeof O=="object"&&O!==null}},logger:{defaultValue:function(){},message:"should be null or an object with methods { debug, info, warn, error }",validate:function(O){return!O||O&&r(["debug","info","warn","error"],function(U,W){return U&&typeof O[W]=="function"},!0)}},redactedKeys:{defaultValue:function(){return["password"]},message:"should be an array of strings|regexes",validate:function(O){return s(O)&&O.length===i(O,function(U){return typeof U=="string"||U&&typeof U.test=="function"}).length}},plugins:{defaultValue:function(){return[]},message:"should be an array of plugin objects",validate:function(O){return s(O)&&O.length===i(O,function(U){return U&&typeof U=="object"&&typeof U.load=="function"}).length}},featureFlags:{defaultValue:function(){return[]},message:'should be an array of objects that have a "name" property',validate:function(O){return s(O)&&O.length===i(O,function(U){return U&&typeof U=="object"&&typeof U.name=="string"}).length}},reportUnhandledPromiseRejectionsAsHandled:{defaultValue:function(){return!1},message:"should be true|false",validate:function(O){return O===!0||O===!1}},sendPayloadChecksums:{defaultValue:function(){return!1},message:"should be true|false",validate:function(O){return O===!0||O===!1}}};var v=function(O){for(var U=1;U<arguments.length;U++){var W=arguments[U];for(var q in W)Object.prototype.hasOwnProperty.call(W,q)&&(O[q]=W[q])}return O},y=function(O,U){return r(O,function(W,q,Z,ge){return W.concat(U(q,Z,ge))},[])};function b(){return b=Object.assign?Object.assign.bind():function(O){for(var U=1;U<arguments.length;U++){var W=arguments[U];for(var q in W)({}).hasOwnProperty.call(W,q)&&(O[q]=W[q])}return O},b.apply(null,arguments)}var x=p.schema,S={releaseStage:v({},x.releaseStage,{defaultValue:function(){return/^localhost(:\d+)?$/.test(window.location.host)?"development":"production"}}),appType:b({},x.appType,{defaultValue:function(){return"browser"}}),logger:v({},x.logger,{defaultValue:function(){return typeof console<"u"&&typeof console.debug=="function"?w():void 0}})},w=function(){var O={},U=console.log;return y(["debug","info","warn","error"],function(W){var q=console[W];O[W]=typeof q=="function"?q.bind(console,"[bugsnag]"):U.bind(console,"[bugsnag]")}),O},k=function(){function O(W,q,Z,ge){ge===void 0&&(ge=new Date),this.type=Z,this.message=W,this.metadata=q,this.timestamp=ge}var U=O.prototype;return U.toJSON=function(){return{type:this.type,name:this.message,timestamp:this.timestamp,metaData:this.metadata}},O}(),E=k,I={};(function(O,U){typeof I=="object"?I=U():O.StackFrame=U()})(this,function(){function O(Oe){return!isNaN(parseFloat(Oe))&&isFinite(Oe)}function U(Oe){return Oe.charAt(0).toUpperCase()+Oe.substring(1)}function W(Oe){return function(){return this[Oe]}}
3942var q=["isConstructor","isEval","isNative","isToplevel"],Z=["columnNumber","lineNumber"],ge=["fileName","functionName","source"],me=["args"],$e=["evalOrigin"],oe=q.concat(Z,ge,me,$e);function T(Oe){if(Oe)for(var Re=0;Re<oe.length;Re++)Oe[oe[Re]]!==void 0&&this["set"+U(oe[Re])](Oe[oe[Re]])}T.prototype={getArgs:function(){return this.args},setArgs:function(Oe){if(Object.prototype.toString.call(Oe)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=Oe},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(Oe){if(Oe instanceof T)this.evalOrigin=Oe;else if(Oe instanceof Object)this.evalOrigin=new T(Oe);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var Oe=this.getFileName()||"",Re=this.getLineNumber()||"",Qe=this.getColumnNumber()||"",je=this.getFunctionName()||"";return this.getIsEval()?Oe?"[eval] ("+Oe+":"+Re+":"+Qe+")":"[eval]:"+Re+":"+Qe:je?je+" ("+Oe+":"+Re+":"+Qe+")":Oe+":"+Re+":"+Qe}},T.fromString=function(Re){var Qe=Re.indexOf("("),je=Re.lastIndexOf(")"),it=Re.substring(0,Qe),Xe=Re.substring(Qe+1,je).split(","),Tt=Re.substring(je+1);if(Tt.indexOf("@")===0)var Mt=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(Tt,""),bt=Mt[1],gn=Mt[2],Yt=Mt[3];return new T({functionName:it,args:Xe||void 0,fileName:bt,lineNumber:gn||void 0,columnNumber:Yt||void 0})};for(var $=0;$<q.length;$++)T.prototype["get"+U(q[$])]=W(q[$]),T.prototype["set"+U(q[$])]=function(Oe){return function(Re){this[Oe]=!!Re}}(q[$]);for(var Y=0;Y<Z.length;Y++)T.prototype["get"+U(Z[Y])]=W(Z[Y]),T.prototype["set"+U(Z[Y])]=function(Oe){return function(Re){if(!O(Re))throw new TypeError(Oe+" must be a Number");this[Oe]=Number(Re)}}(Z[Y]);for(var le=0;le<ge.length;le++)T.prototype["get"+U(ge[le])]=W(ge[le]),T.prototype["set"+U(ge[le])]=function(Oe){return function(Re){this[Oe]=String(Re)}}(ge[le]);return T});var P={};(function(O,U){typeof P=="object"?P=U(I):O.StackGenerator=U(O.StackFrame)})(this,function(O){return{backtrace:function(W){var q=[],Z=10;typeof W=="object"&&typeof W.maxStackSize=="number"&&(Z=W.maxStackSize);for(var ge=arguments.callee;ge&&q.length<Z&&ge.arguments;){for(var me=new Array(ge.arguments.length),$e=0;$e<me.length;++$e)me[$e]=ge.arguments[$e];/function(?:\s+([\w$]+))+\s*\(/.test(ge.toString())?q.push(new O({functionName:RegExp.$1||void 0,args:me})):q.push(new O({args:me}));try{ge=ge.caller}catch{break}}return q}}});var A={};(function(O,U){typeof A=="object"?A=U(I):O.ErrorStackParser=U(O.StackFrame)})(this,function(U){var W=/(^|@)\S+:\d+/,q=/^\s*at .*(\S+:\d+|\(native\))/m,Z=/^(eval@)?(\[native code])?$/;return{parse:function(me){if(typeof me.stacktrace<"u"||typeof me["opera#sourceloc"]<"u")return this.parseOpera(me);if(me.stack&&me.stack.match(q))return this.parseV8OrIE(me);if(me.stack)return this.parseFFOrSafari(me);throw new Error("Cannot parse given Error object")},extractLocation:function(me){if(me.indexOf(":")===-1)return[me];var $e=/(.+?)(?::(\d+))?(?::(\d+))?$/,oe=$e.exec(me.replace(/[()]/g,""));return[oe[1],oe[2]||void 0,oe[3]||void 0]},parseV8OrIE:function(me){var $e=me.stack.split(` 3943`).filter(function(oe){return!!oe.match(q)},this);return $e.map(function(oe){oe.indexOf("(eval ")>-1&&(oe=oe.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var T=oe.replace(/^\s+/,"").replace(/\(eval code/g,"("),$=T.match(/ (\((.+):(\d+):(\d+)\)$)/);T=$?T.replace($[0],""):T;var Y=T.split(/\s+/).slice(1),le=this.extractLocation($?$[1]:Y.pop()),Oe=Y.join(" ")||void 0,Re=["eval","<anonymous>"].indexOf(le[0])>-1?void 0:le[0];return new U({functionName:Oe,fileName:Re,lineNumber:le[1],columnNumber:le[2],source:oe})},this)},parseFFOrSafari:function(me){var $e=me.stack.split(` 3944`).filter(function(oe){return!oe.match(Z)},this);return $e.map(function(oe){if(oe.indexOf(" > eval")>-1&&(oe=oe.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),oe.indexOf("@")===-1&&oe.indexOf(":")===-1)return new U({functionName:oe});var T=/((.*".+"[^@]*)?[^@]*)(?:@)/,$=oe.match(T),Y=$&&$[1]?$[1]:void 0,le=this.extractLocation(oe.replace(T,""));return new U({functionName:Y,fileName:le[0],lineNumber:le[1],columnNumber:le[2],source:oe})},this)},parseOpera:function(me){return!me.stacktrace||me.message.indexOf(` 3945`)>-1&&me.message.split(` 3946`).length>me.stacktrace.split(` 3947`).length?this.parseOpera9(me):me.stack?this.parseOpera11(me):this.parseOpera10(me)},parseOpera9:function(me){for(var $e=/Line (\d+).*script (?:in )?(\S+)/i,oe=me.message.split(` 3948`),T=[],$=2,Y=oe.length;$<Y;$+=2){var le=$e.exec(oe[$]);le&&T.push(new U({fileName:le[2],lineNumber:le[1],source:oe[$]}
vendor: 7,029 bytes, lines 3948-3950
3948))}return T},parseOpera10:function(me){for(var $e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,oe=me.stacktrace.split(` 3949`),T=[],$=0,Y=oe.length;$<Y;$+=2){var le=$e.exec(oe[$]);le&&T.push(new U({functionName:le[3]||void 0,fileName:le[2],lineNumber:le[1],source:oe[$]}))}return T},parseOpera11:function(me){var $e=me.stack.split(` 3950`).filter(function(oe){return!!oe.match(W)&&!oe.match(/^Error created at/)},this);return $e.map(function(oe){var T=oe.split("@"),$=this.extractLocation(T.pop()),Y=T.shift()||"",le=Y.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,Oe;Y.match(/\(([^)]*)\)/)&&(Oe=Y.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var Re=Oe===void 0||Oe==="[arguments not available]"?void 0:Oe.split(",");return new U({functionName:le,args:Re,fileName:$[0],lineNumber:$[1],columnNumber:$[2],source:oe})},this)}}});var N=A,j=function(O,U,W,q){var Z=q&&q.redactedKeys?q.redactedKeys:[],ge=q&&q.redactedPaths?q.redactedPaths:[];return JSON.stringify(Fe(O,Z,ge),U,W)},L=20,B=25e3,V=8,X="...";function ne(O){return O instanceof Error||/^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(O))}function se(O){return"[Throws: "+(O?O.message:"?")+"]"}function ie(O,U){for(var W=0,q=O.length;W<q;W++)if(O[W]===U)return!0;return!1}function de(O,U){for(var W=0,q=O.length;W<q;W++)if(U.indexOf(O[W])===0)return!0;return!1}function ue(O,U){for(var W=0,q=O.length;W<q;W++)if(typeof O[W]=="string"&&O[W].toLowerCase()===U.toLowerCase()||O[W]&&typeof O[W].test=="function"&&O[W].test(U))return!0;return!1}function Ce(O){return Object.prototype.toString.call(O)==="[object Array]"}function we(O,U){try{return O[U]}catch(W){return se(W)}}function Fe(O,U,W){var q=[],Z=0;function ge(me,$e){function oe(){return $e.length>V&&Z>B}if(Z++,$e.length>L||oe())return X;if(me===null||typeof me!="object")return me;if(ie(q,me))return"[Circular]";if(q.push(me),typeof me.toJSON=="function")try{Z--;var T=ge(me.toJSON(),$e);return q.pop(),T}catch(it){return se(it)}var $=ne(me);if($){Z--;var Y=ge({name:me.name,message:me.message},$e);return q.pop(),Y}if(Ce(me)){for(var le=[],Oe=0,Re=me.length;Oe<Re;Oe++){if(oe()){le.push(X);break}le.push(ge(me[Oe],$e.concat("[]")))}return q.pop(),le}var Qe={};try{for(var je in me)if(Object.prototype.hasOwnProperty.call(me,je)){if(de(W,$e.join("."))&&ue(U,je)){Qe[je]="[REDACTED]";continue}if(oe()){Qe[je]=X;break}Qe[je]=ge(we(me,je),$e.concat(je))}}catch{}return q.pop(),Qe}return ge(O,[])}function Ge(O,U,W,q){if(typeof W=="string"){q===void 0?q=null:q!==null&&typeof q!="string"&&(q=j(q));var Z=U[W];if(typeof Z=="number"){O[Z]={name:W,variant:q};return}O.push({name:W,variant:q}),U[W]=O.length-1}}function Ie(O,U,W){if(s(U)){for(var q=0;q<U.length;++q){var Z=U[q];Z===null||typeof Z!="object"||Ge(O,W,Z.name,Z.variant)}return O}}function He(O){return y(i(O,Boolean),function(U){var W=U.name,q=U.variant,Z={featureFlag:W};return typeof q=="string"&&(Z.variant=q),Z})}function ot(O,U,W){var q=U[W];typeof q=="number"&&(O[q]=null,delete U[W])}var Je={add:Ge,clear:ot,merge:Ie,toEventApi:He},et=function(O){return!!O&&(!!O.stack||!!O.stacktrace||!!O["opera#sourceloc"])&&typeof(O.stack||O.stacktrace||O["opera#sourceloc"])=="string"&&O.stack!==O.name+": "+O.message},Ut=_t;function _t(O){switch(Object.prototype.toString.call(O)){case"[object Error]":return!0;case"[object Exception]":return!0;case"[object DOMException]":return!0;default:return O instanceof Error}}var mt=Ut,wt=function(O,U,W,q){var Z;if(U){var ge;if(W===null)return Ct(O,U);typeof W=="object"&&(ge=W),typeof W=="string"&&(ge=(Z={},Z[W]=q,Z)),ge&&(U==="__proto__"||U==="constructor"||U==="prototype"||(O[U]||(O[U]={}),O[U]=v({},O[U],ge)))}},Kt=function(O,U,W){if(typeof U=="string"){if(!W)return O[U];if(O[U])return O[U][W]}},Ct=function(O,U,W){if(typeof U=="string"){if(!W){delete O[U];return}U==="__proto__"||U==="constructor"||U==="prototype"||O[U]&&delete O[U][W]}},kt={add:wt,get:Kt,clear:Ct};function jn(){return jn=Object.assign?Object.assign.bind():function(O){for(var U=1;U<arguments.length;U++){var W=arguments[U];for(var q in W)({}).hasOwnProperty.call(W,q)&&(O[q]=W[q])}return O},jn.apply(null,arguments)}var zt=function(){function O(W,q,Z,ge,me){Z===void 0&&(Z=[]),ge===void 0&&(ge=On()),this.apiKey=void 0,this.context=void 0,this.groupingHash=void 0,this.originalError=me,this._handledState=ge,this.severity=this._handledState.severity,this.unhandled=this._handledState.unhandled,this.app={},this.device={},this.request={},this.breadcrumbs=[],this.threads=[],this._metadata={},this._features=[],this._featuresIndex={},this._user={},this._session=void 0,this._correlation=void 0,this.errors=[xn(W,q,O.__type,Z)]}var U=O.prototype;return U.addMetadata=function(q,Z,ge){return kt.add(this._metadata,q,Z,ge)},U.setTraceCorrelation=function(q,Z){typeof q=="string"&&(this._correlation=jn({traceId:q},typeof Z=="string"?{spanId:Z}:{}))},U.getMetadata=function(q,Z){return kt.get(this._metadata,q,Z)},U.clearMetadata=function(q,Z){return kt.clear(this._metadata,q,Z)},U.addFeatureFlag=function(q,Z){Z===void 0&&(Z=null),Je.add(this._features,this._featuresIndex,q,Z)},U.addFeatureFlags=function(q){Je.merge(this._features,q,this._featuresIndex)},U.getFeatureFlags=function(){return Je.toEventApi(this._features)},U.clearFeatureFlag=function(q){Je.clear(this._features,this._featuresIndex,q)},U.clearFeatureFlags=function(){this._features=[],this._featuresIndex={}},U.getUser=function(){return this._user},U.setUser=function(q,Z,ge){this._user={id:q,email:Z,name:ge}},U.toJSON=function(){return{payloadVersion:"4",exceptions:y(this.errors,function(q){return v({},q,{message:q.errorMessage})}),severity:this.severity,unhandled:this._handledState.unhandled,severityReason:this._handledState.severityReason,app:this.app,device:this.device,request:this.request,breadcrumbs:this.breadcrumbs,context:this.context,groupingHash:this.groupingHash,metaData:this._metadata,user:this._user,session:this._session,featureFlags:this.getFeatureFlags(),correlation:this._correlation}},O}(),qn=function(O){var U={file:O.fileName,method:_r(O.functionName),lineNumber:O.lineNumber,columnNumber:O.columnNumber,code:void 0,inProject:void 0};return U.lineNumber>-1&&!U.file&&!U.method&&(U.file="global code"),U},_r=function(O){return/^global code$/i.test(O)?"global code":O},On=function(){return{unhandled:!1,severity:"warning",severityReason:{type:"handledException"}}},hn=function(O){return typeof O=="string"?O:""};function xn(O,U,W,q){return{errorClass:hn(O),errorMessage:hn(U),type:W,stacktrace:r(q,function(Z,ge){var me=qn(ge);try{return JSON.stringify(me)==="{}"?Z:Z.concat(me)}catch{return Z}},[])}}function kn(O){return O.cause?[O].concat(kn(O.cause)):[O]}zt.getStacktrace=function(O,U,W){if(et(O))return N.parse(O).slice(U);try{return i(P.backtrace(),function(q){return(q.functionName||"").indexOf("StackGenerator$$")===-1}).slice(1+W)}catch{return[]}},zt.create=function(O,U,W,q,Z,ge){Z===void 0&&(Z=0);var me=Er(O,U,q,ge),$e=me[0],oe=me[1],T;try{var $=zt.getStacktrace($e,oe>0?1+oe+Z:0,1+Z);
3950T=new zt($e.name,$e.message,$,W,O)}catch{T=new zt($e.name,$e.message,[],W,O)}if($e.name==="InvalidError"&&T.addMetadata(""+q,"non-error parameter",St(O)),$e.cause){var Y,le=kn($e).slice(1),Oe=y(le,function(Re){var Qe=mt(Re)&&et(Re)?N.parse(Re):[],je=Er(Re,!0,"error cause"),it=je[0];return it.name==="InvalidError"&&T.addMetadata("error cause",St(Re)),xn(it.name,it.message,zt.__type,Qe)});(Y=T.errors).push.apply(Y,Oe)}return T};var St=function(O){return O===null?"null":O===void 0?"undefined":O},Er=function(O,U,W,q){var Z,ge=0,me=function($e){var oe=W==="error cause"?"was":"received";q&&q.warn(W+" "+oe+' a non-error: "'+$e+'"');var T=new Error(W+" "+oe+' a non-error. See "'+W+'" tab for more detail.');return T.name="InvalidError",T};if(!U)mt(O)?Z=O:(Z=me(typeof O),ge+=2);else switch(typeof O){case"string":case"number":case"boolean":Z=new Error(String(O)),ge+=1;break;case"function":Z=me("function"),ge+=2;break;case"object":O!==null&&mt(O)?Z=O:O!==null&&Jn(O)?(Z=new Error(O.message||O.errorMessage),Z.name=O.name||O.errorClass,ge+=1):(Z=me(O===null?"null":"unsupported object"),ge+=2);break;default:Z=me("nothing"),ge+=2}if(!et(Z))try{throw Z}catch($e){et($e)&&(Z=$e,ge=1)}return[Z,ge]};zt.__type="browserjs";var Jn=function(O){return(typeof O.name=="string"||typeof O.errorClass=="string")&&(typeof O.message=="string"||typeof O.errorMessage=="string")},rn=zt,sr=function(O,U,W){var q=0,Z=function(){if(q>=O.length)return W(null,!0);U(O[q],function(ge,me){if(ge)return W(ge);if(me===!1)return W(null,!1);q++,Z()})};Z()},Qn=function(O,U,W,q){var Z=function(ge,me){if(typeof ge!="function")return me(null);try{if(ge.length!==2){var $e=ge(U);return $e&&typeof $e.then=="function"?$e.then(function(oe){return setTimeout(function(){return me(null,oe)})},function(oe){setTimeout(function(){return W(oe),me(null,!0)})}):me(null,$e)}ge(U,function(oe,T){if(oe)return W(oe),me(null);me(null,T)})}catch(oe){W(oe),me(null)}};sr(O,Z,q)},Pr=function(O,U,W,q){for(var Z=!1,ge=O.slice();!Z&&ge.length;)try{Z=ge.pop()(U)===!1}catch(me){q.error("Error occurred in "+W+" callback, continuing anywayâ¦"),q.error(me)}return Z},Gr=function(U,W){var q="000000000"+U;return q.substr(q.length-W)},gt=typeof window=="object"?window:self,Rt=0;for(var Wt in gt)Object.hasOwnProperty.call(gt,Wt)&&Rt++;var Di=navigator.mimeTypes?navigator.mimeTypes.length:0,Kr=Gr((Di+navigator.userAgent.length).toString(36)+Rt.toString(36),4),Ni=function(){return Kr},Yr=function(U){return typeof U=="string"&&/^c[a-z0-9]{20,32}$/.test(U)},Zn=0,Ya=4,br=36,Xa=Math.pow(br,Ya);function na(){return Gr((Math.random()*Xa<<0).toString(br),Ya)}function Os(){return Zn=Zn<Xa?Zn:0,Zn++,Zn-1}function Ca(){var O="c",U=new Date().getTime().toString(br),W=Gr(Os().toString(br),Ya),q=Ni(),Z=na()+na();return O+U+W+q+Z}Ca.fingerprint=Ni,Ca.isCuid=Yr;var Ja=Ca,ra=function(){function O(){this.id=Ja(),this.startedAt=new Date,this._handled=0,this._unhandled=0,this._user={},this.app={},this.device={}}var U=O.prototype;return U.getUser=function(){return this._user},U.setUser=function(q,Z,ge){this._user={id:q,email:Z,name:ge}},U.toJSON=function(){return{id:this.id,startedAt:this.startedAt,events:{handled:this._handled,unhandled:this._unhandled}}},U._track=function(q){this[q._handledState.unhandled?"_unhandled":"_handled"]+=1},O}(),Ms=ra,ia=Je.add,Ds=Je.clear,Qa=Je.merge,dc="00000",Ns="https://notify.insighthub.smartbear.com",ko="https://sessions.insighthub.smartbear.com",Sn=function(){},cu=function(){function O(W,q,Z,ge){var me=this;q===void 0&&(q=p.schema),Z===void 0&&(Z=[]),this._notifier=ge,this._config={},this._schema=q,this._delivery={sendSession:Sn,sendEvent:Sn},this._logger={debug:Sn,info:Sn,warn:Sn,error:Sn},this._plugins={},this._breadcrumbs=[],this._session=null,this._metadata={},this._featuresIndex={},this._features=[],this._context=void 0,this._user={},this._cbs={e:[],s:[],sp:[],b:[]},this.Client=O,this.Event=rn,this.Breadcrumb=E,this.Session=Ms,this._config=this._configure(W,Z),y(Z.concat(this._config.plugins),function(T){T&&me._loadPlugin(T)}),this._depth=1;var $e=this,oe=this.notify;this.notify=function(){return oe.apply($e,arguments)}}var U=O.prototype;return U.addMetadata=function(q,Z,ge){return kt.add(this._metadata,q,Z,ge)},U.getMetadata=function(q,Z){return kt.get(this._metadata,q,Z)},U.clearMetadata=function(q,Z){return kt.clear(this._metadata,q,Z)},U.addFeatureFlag=function(q,Z){Z===void 0&&(Z=null),ia(this._features,this._featuresIndex,q,Z)},U.addFeatureFlags=function(q){Qa(this._features,q,this._featuresIndex)},U.clearFeatureFlag=function(q){Ds(this._features,this._featuresIndex,q)},U.clearFeatureFlags=function(){this._features=[],this._featuresIndex={}},U.getContext=function(){return this._context},U.setContext=function(q){this._context=q},U._configure=function(q,Z){var ge=r(Z,function(T,$){return $&&$.configSchema?v({},T,$.configSchema):T},this._schema);q.endpoints||(q.sendPayloadChecksums="sendPayloadChecksums"in q?q.sendPayloadChecksums:!0);var me=r(u(ge),function(T,$){var Y=ge[$].defaultValue(q[$]);if(q[$]!==void 0){var le=ge[$].validate(q[$]);le?ge[$].allowPartialObject?T.config[$]=v(Y,q[$]):T.config[$]=q[$]:(T.errors[$]=ge[$].message,T.config[$]=Y)}else T.config[$]=Y;return T},{errors:{},config:{}}),$e=me.errors,oe=me.config;if(ge.apiKey){if(!oe.apiKey)throw new Error("No Bugsnag API Key set");/^[0-9a-f]{32}$/i.test(oe.apiKey)||($e.apiKey="should be a string of 32 hexadecimal characters"),q.endpoints===void 0&&oe.apiKey.startsWith(dc)&&(oe.endpoints={notify:Ns,sessions:ko})}return this._metadata=v({},oe.metadata),Qa(this._features,oe.featureFlags,this._featuresIndex),this._user=v({},oe.user),this._context=oe.context,oe.logger&&(this._logger=oe.logger),oe.onError&&(this._cbs.e=this._cbs.e.concat(oe.onError)),oe.onBreadcrumb&&(this._cbs.b=this._cbs.b.concat(oe.onBreadcrumb)),oe.onSession&&(this._cbs.s=this._cbs.s.concat(oe.onSession)),u($e).length&&this._logger.warn(uu($e,q)),oe},U.getUser=function(){return this._user},U.setUser=function(q,Z,ge){this._user={id:q,email:Z,name:ge}},U._loadPlugin=function(q){var Z=q.load(this);q.name&&(this._plugins["~"+q.name+"~"]=Z)},U.getPlugin=function(q){return this._plugins["~"+q+"~"]},U._setDelivery=function(q){this._delivery=q(this)},U.startSession=function(){var q=new Ms;q.app.releaseStage=this._config.releaseStage,q.app.version=this._config.appVersion,q.app.type=this._config.appType,q._user=v({},this._user);var Z=Pr(this._cbs.s,q,"onSession",this._logger);return Z?(this._logger.debug("Session not started due to onSession callback"),this):this._sessionDelegate.startSession(this,q)},U.addOnError=function(q,Z){Z===void 0&&(Z=!1),this._cbs.e[Z?"unshift":"push"](q)},U.removeOnError=function(q){this._cbs.e=i(this._cbs.e,function(Z){return Z!==q})},U._addOnSessionPayload=function(q){this._cbs.sp.push(q)},U.addOnSession=function(q){this._cbs.s.push(q)},U.removeOnSession=function(q){this._cbs.s=i(this._cbs.s,function(Z){return Z!==q})},U.addOnBreadcrumb=function(q,Z){Z===void 0&&(Z=!1),this._cbs.b[Z?"unshift":"push"](q)},U.removeOnBreadcrumb=function(q){this._cbs.b=i(this._cbs.b,function(Z){return Z!==q})},U.pauseSession=function(){return this._sessionDelegate.pauseSession(this)},U.resumeSession=function(){return this._sessionDelegate.resumeSession(this)},U.leaveBreadcrumb=function(q,Z,ge){if(q=typeof q=="string"?q:"",ge=typeof ge=="string"&&a(t,ge)?ge:"manual",Z=typeof Z=="object"&&Z!==null?Z:{},!!q){var me=new E(q,Z,ge),$e=Pr(this._cbs.b,me,"onBreadcrumb",this._logger);if($e){this._logger.debug("Breadcrumb not attached due to onBreadcrumb callback");return}this._breadcrumbs.push(me),this._breadcrumbs.length>this._config.maxBreadcrumbs&&(this._breadcrumbs=this._breadcrumbs.slice(this._breadcrumbs.length-this._config.maxBreadcrumbs))}},U._isBreadcrumbTypeEnabled=function(q){var Z=this._config.enabledBreadcrumbTypes;return Z===null||a(Z,q)},U.notify=function(q,Z,ge){ge===void 0&&(ge=Sn);var me=rn.create(q,!0,void 0,"notify()",this._depth+1,this._logger);this._notify(me,Z,ge)},U._notify=function(q,Z,ge){var me=this;if(ge===void 0&&(ge=Sn),q.app=v({},q.app,{releaseStage:this._config.releaseStage,version:this._config.appVersion,type:this._config.appType}),q.context=q.context||this._context,q._metadata=v({},q._metadata,this._metadata),q._user=v({},q._user,this._user),q.breadcrumbs=this._breadcrumbs.slice(),Qa(q._features,this._features,q._featuresIndex),this._config.enabledReleaseStages!==null&&!a(this._config.enabledReleaseStages,this._config.releaseStage))return this._logger.warn("Event not sent due to releaseStage/enabledReleaseStages configuration"),ge(null,q);var $e=q.severity,oe=function($){me._logger.error("Error occurred in onError callback, continuing anywayâ¦"),me._logger.error($)},T=[].concat(this._cbs.e).concat(Z);Qn(T,q,oe,function($,Y){if($&&oe($),!Y)return me._logger.debug("Event not sent due to onError callback"),ge(null,q);me._isBreadcrumbTypeEnabled("error")&&O.prototype.leaveBreadcrumb.call(me,q.errors[0].errorClass,{errorClass:q.errors[0].errorClass,errorMessage:q.errors[0].errorMessage,severity:q.severity},"error"),$e!==q.severity&&(q._handledState.severityReason={type:"userCallbackSetSeverity"}),q.unhandled!==q._handledState.unhandled&&(q._handledState.severityReason.unhandledOverrid
3950den=!0,q._handledState.unhandled=q.unhandled),me._session&&(me._session._track(q),q._session=me._session),me._delivery.sendEvent({apiKey:q.apiKey||me._config.apiKey,notifier:me._notifier,events:[q]},function(le){return ge(le,q)})})},O}(),uu=function(O,U){var W=new Error(`Invalid configuration 3951`+y(u(O),function(q){return" - "+q+" "+O[q]+", got "+lu(U[q])}).join(` 3952 3953`));return W},lu=function(O){switch(typeof O){case"string":case"number":case"object":return JSON.stringify(O);default:return String(O)}},Za=cu,Ur={},or=["events.[].metaData","events.[].breadcrumbs.[].metaData","events.[].request"];Ur.event=function(O,U){var W=j(O,null,null,{redactedPaths:or,redactedKeys:U});return W.length>1e6&&(O.events[0]._metadata={notifier:`WARNING! 3954Serialized payload was `+W.length/1e6+`MB (limit = 1MB) 3955metadata was removed`},W=j(O,null,null,{redactedPaths:or,redactedKeys:U})),W},Ur.session=function(O,U){var W=j(O,null,null);return W};var Ls={};Ls=function(O,U){return U===void 0&&(U=window),{sendEvent:function(W,q){if(q===void 0&&(q=function(){}),O._config.endpoints.notify===null){var Z=new Error("Event not sent due to incomplete endpoint configuration");return q(Z)}var ge=fc(O._config,"notify","4",U),me=Ur.event(W,O._config.redactedKeys),$e=new U.XDomainRequest;$e.onload=function(){q(null)},$e.onerror=function(){var oe=new Error("Event failed to send");O._logger.error("Event failed to sendâ¦",oe),me.length>1e6&&O._logger.warn("Event oversized ("+(me.length/1e6).toFixed(2)+" MB)"),q(oe)},$e.open("POST",ge),setTimeout(function(){try{$e.send(me)}catch(oe){O._logger.error(oe),q(oe)}},0)},sendSession:function(W,q){if(q===void 0&&(q=function(){}),O._config.endpoints.sessions===null){var Z=new Error("Session not sent due to incomplete endpoint configuration");return q(Z)}var ge=fc(O._config,"sessions","1",U),me=new U.XDomainRequest;me.onload=function(){q(null)},me.open("POST",ge),setTimeout(function(){try{me.send(Ur.session(W,O._config.redactedKeys))}catch($e){O._logger.error($e),q($e)}},0)}}};var fc=function(O,U,W,q){var Z=JSON.parse(JSON.stringify(new Date)),ge=So(O.endpoints[U],q.location.protocol);return ge+"?apiKey="+encodeURIComponent(O.apiKey)+"&payloadVersion="+W+"&sentAt="+encodeURIComponent(Z)},So=Ls._matchPageProtocol=function(O,U){return U==="http:"?O.replace(/^https:/,"http:"):O};function Fs(O,U){if(O.isSecureContext&&O.crypto&&O.crypto.subtle&&O.crypto.subtle.digest&&typeof TextEncoder=="function"){var W=new TextEncoder().encode(U);return O.crypto.subtle.digest("SHA-1",W).then(function(q){var Z=Array.from(new Uint8Array(q)),ge=Z.map(function(me){return me.toString(16).padStart(2,"0")}).join("");return"sha1 "+ge})}return Promise.resolve()}var du=function(O,U){return U===void 0&&(U=window),{sendEvent:function(W,q){q===void 0&&(q=function(){});try{var Z=O._config.endpoints.notify;if(Z===null){var ge=new Error("Event not sent due to incomplete endpoint configuration");return q(ge)}var me=new U.XMLHttpRequest,$e=Ur.event(W,O._config.redactedKeys);me.onreadystatechange=function(){if(me.readyState===U.XMLHttpRequest.DONE){var oe=me.status;if(oe===0||oe>=400){var T=new Error("Request failed with status "+oe);O._logger.error("Event failed to sendâ¦",T),$e.length>1e6&&O._logger.warn("Event oversized ("+($e.length/1e6).toFixed(2)+" MB)"),q(T)}else q(null)}},me.open("POST",Z),me.setRequestHeader("Content-Type","application/json"),me.setRequestHeader("Bugsnag-Api-Key",W.apiKey||O._config.apiKey),me.setRequestHeader("Bugsnag-Payload-Version","4"),me.setRequestHeader("Bugsnag-Sent-At",new Date().toISOString()),O._config.sendPayloadChecksums&&typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1?Fs(U,$e).then(function(oe){oe&&me.setRequestHeader("Bugsnag-Integrity",oe),me.send($e)}).catch(function(oe){O._logger.error(oe),me.send($e)}):me.send($e)}catch(oe){O._logger.error(oe)}},sendSession:function(W,q){q===void 0&&(q=function(){});try{var Z=O._config.endpoints.sessions;if(Z===null){var ge=new Error("Session not sent due to incomplete endpoint configuration");return q(ge)}var me=new U.XMLHttpRequest,$e=Ur.session(W,O._config.redactedKeys);me.onreadystatechange=function(){if(me.readyState===U.XMLHttpRequest.DONE){var oe=me.status;if(oe===0||oe>=400){var T=new Error("Request failed with status "+oe);O._logger.error("Session failed to sendâ¦",T),q(T)}else q(null)}},me.open("POST",Z),me.setRequestHeader("Content-Type","application/json"),me.setRequestHeader("Bugsnag-Api-Key",O._config.apiKey),me.setRequestHeader("Bugsnag-Payload-Version","1"),me.setRequestHeader("Bugsnag-Sent-At",new Date().toISOString()),O._config.sendPayloadChecksums&&typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1?Fs(U,$e).then(function(oe){oe&&me.setRequestHeader("Bugsnag-Integrity",oe),me.send($e)}).catch(function(oe){O._logger.error(oe),me.send($e)}):me.send($e)}catch(oe){O._logger.error(oe)}}}},Rr=new Date,fu=function(){Rr=new Date},$s={name:"appDuration",load:function(O){return O.addOnError(function(U){var W=new Date;U.app.duration=W-Rr},!0),{reset:fu}}},To=function(O){return O===void 0&&(O=window),{load:function(U){U.addOnError(function(W){W.context===void 0&&(W.context=O.location.pathname)},!0)}}},es="bugsnag-anonymous-id",hu=function(O){try{var U=O.localStorage,W=U.getItem(es);return W&&/^c[a-z0-9]{20,32}$/.test(W)||(W=Ja(),U.setItem(es,W)),W}catch{}},Bs=function(O,U){return O===void 0&&(O=navigator),U===void 0&&(U=window),{load:function(W){var q={locale:O.browserLanguage||O.systemLanguage||O.userLanguage||O.language,userAgent:O.userAgent};U&&U.screen&&U.screen.orientation&&U.screen.orientation.type?q.orientation=U.screen.orientation.type:U&&U.document&&(q.orientation=U.document.documentElement.clientWidth>U.document.documentElement.clientHeight?"landscape":"portrait"),W._config.generateAnonymousId&&(q.id=hu(U)),W.addOnSession(function(Z){Z.device=v({},Z.device,q),W._config.collectUserIp||Eo(Z)}),W.addOnError(function(Z){Z.device=v({},Z.device,q,{time:new Date}),W._config.collectUserIp||Eo(Z)},!0)},configSchema:{generateAnonymousId:{validate:function(W){return W===!0||W===!1},defaultValue:function(){return!0},message:"should be true|false"}}}},Eo=function(O){var U=O.getUser();(!U||!U.id)&&O.setUser(O.device.id)},ts=function(O){return O===void 0&&(O=window),{load:function(U){U.addOnError(function(W){W.request&&W.request.url||(W.request=v({},W.request,{url:O.location.href}))},!0)}}},Vn={load:function(O){O._sessionDelegate=ns}},ns={startSession:function(O,U){var W=O;return W._session=U,W._pausedSession=null,W._config.enabledReleaseStages!==null&&!a(W._config.enabledReleaseStages,W._config.releaseStage)?(W._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration"),W):(W._delivery.sendSession({notifier:W._notifier,device:U.device,app:U.app,sessions:[{id:U.id,startedAt:U.startedAt,user:U._user}]}),W)},resumeSession:function(O){return O._session?O:O._pausedSession?(O._session=O._pausedSession,O._pausedSession=null,O):O.startSession()},pauseSession:function(O){O._pausedSession=O._session,O._session=null}},aa={load:function(O){O._config.collectUserIp||O.addOnError(function(U){U._user&&typeof U._user.id>"u"&&delete U._user.id,U._user=v({id:"[REDACTED]"},U._user),U.request=v({clientIp:"[REDACTED]"},U.request)})},configSchema:{collectUserIp:{defaultValue:function(){return!0},message:"should be true|false",validate:function(O){return O===!0||O===!1}}}},Us={};
3955Us.load=function(O){var U=/^(local-)?dev(elopment)?$/.test(O._config.releaseStage);U||!O._isBreadcrumbTypeEnabled("log")||y(pu,function(W){var q=console[W];console[W]=function(){for(var Z=arguments.length,ge=new Array(Z),me=0;me<Z;me++)ge[me]=arguments[me];O.leaveBreadcrumb("Console output",r(ge,function($e,oe,T){var $="[Unknown value]";try{$=String(oe)}catch{}if($==="[object Object]")try{$=JSON.stringify(oe)}catch{}return $e["["+T+"]"]=$,$e},{severity:W.indexOf("group")===0?"log":W}),"log"),q.apply(console,ge)},console[W]._restore=function(){console[W]=q}})};var pu=i(["log","debug","info","warn","error"],function(O){return typeof console<"u"&&typeof console[O]=="function"}),hc=200,Po=5e5,rs=function(O,U){return O===void 0&&(O=document),U===void 0&&(U=window),{load:function(W){if(!W._config.trackInlineScripts)return;var q=U.location.href,Z="",ge=!!O.attachEvent,me=ge?O.readyState==="complete":O.readyState!=="loading",$e=function(){return O.documentElement.outerHTML};Z=$e();var oe=O.onreadystatechange;O.onreadystatechange=function(){O.readyState==="interactive"&&(Z=$e(),me=!0);try{oe.apply(this,arguments)}catch{}};var T=null,$=function(je){T=je},Y=function(){var je=O.currentScript||T;if(!je&&!me){var it=O.scripts||O.getElementsByTagName("script");je=it[it.length-1]}return je},le=function(je){(!me||!Z)&&(Z=$e());var it=["<!-- DOC START -->"].concat(Z.split(` 3956`)),Xe=je-1,Tt=Math.max(Xe-3,0),Mt=Math.min(Xe+3,it.length);return r(it.slice(Tt,Mt),function(bt,gn,Yt){return bt[Tt+1+Yt]=gn.length<=hc?gn:gn.substr(0,hc),bt},{})};W.addOnError(function(je){je.errors[0].stacktrace=i(je.errors[0].stacktrace,function(bt){return!/__trace__$/.test(bt.method)});var it=je.errors[0].stacktrace[0],Xe=function(bt){return bt.replace(/#.*$/,"").replace(/\?.*$/,"")};if(!(it&&it.file&&Xe(it.file)!==Xe(q))){var Tt=Y();if(Tt){var Mt=Tt.innerHTML;je.addMetadata("script","content",Mt.length<=Po?Mt:Mt.substr(0,Po)),it&&it.lineNumber&&(it.code=le(it.lineNumber))}}},!0);var Oe=y(["setTimeout","setInterval","setImmediate","requestAnimationFrame"],function(je){return Li(U,je,function(it){return Qe(it,function(Xe){return{get:function(){return Xe[0]},replace:function(Tt){Xe[0]=Tt}}})})}),Re=Oe[0];y(["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],function(je){!U[je]||!U[je].prototype||!Object.prototype.hasOwnProperty.call(U[je].prototype,"addEventListener")||(Li(U[je].prototype,"addEventListener",function(it){return Qe(it,Fi)}),Li(U[je].prototype,"removeEventListener",function(it){return Qe(it,Fi,!0)}))});function Qe(je,it,Xe){return Xe===void 0&&(Xe=!1),function(){var Tt=[].slice.call(arguments);try{var Mt=it(Tt),bt=Mt.get();if(Xe&&je.apply(this,Tt),typeof bt!="function")return je.apply(this,Tt);if(bt.__trace__)Mt.replace(bt.__trace__);else{var gn=Y();bt.__trace__=function(){$(gn),Re(function(){$(null)},0);var ca=bt.apply(this,arguments);return $(null),ca},bt.__trace__.__trace__=bt.__trace__,Mt.replace(bt.__trace__)}}catch{}if(je.apply)return je.apply(this,Tt);switch(Tt.length){case 1:return je(Tt[0]);case 2:return je(Tt[0],Tt[1]);default:return je()}}}},configSchema:{trackInlineScripts:{validate:function(W){return W===!0||W===!1},defaultValue:function(){return!0},message:"should be true|false"}}}};function Li(O,U,W){var q=O[U];if(!q)return q;var Z=W(q);return O[U]=Z,q}function Fi(O){var U=!!O[1]&&typeof O[1].handleEvent=="function";return{get:function(){return U?O[1].handleEvent:O[1]},replace:function(W){U?O[1].handleEvent=W:O[1]=W}}}var pc=function(O){return O===void 0&&(O=window),{load:function(U){"addEventListener"in O&&U._isBreadcrumbTypeEnabled("user")&&O.addEventListener("click",function(W){var q,Z;try{q=sa(W.target),Z=oa(W.target,O)}catch{q="[hidden]",Z="[hidden]",U._logger.error("Cross domain error when tracking click event. See docs: https://tinyurl.com/yy3rn63z")}U.leaveBreadcrumb("UI click",{targetText:q,targetSelector:Z},"user")},!0)}}},js=/^\s*([^\s][\s\S]{0,139}[^\s])?\s*/;function sa(O){var U=O.textContent||O.innerText||"";return!U&&(O.type==="submit"||O.type==="button")&&(U=O.value),U=U.replace(js,"$1"),U.length>140?U.slice(0,135)+"(...)":U}
3956function oa(O,U){var W=[O.tagName];if(O.id&&W.push("#"+O.id),O.className&&O.className.length&&W.push("."+O.className.split(" ").join(".")),!U.document.querySelectorAll||!Array.prototype.indexOf)return W.join("");try{if(U.document.querySelectorAll(W.join("")).length===1)return W.join("")}catch{return W.join("")}if(O.parentNode.childNodes.length>1){var q=Array.prototype.indexOf.call(O.parentNode.childNodes,O)+1;W.push(":nth-child("+q+")")}return U.document.querySelectorAll(W.join("")).length===1?W.join(""):O.parentNode?oa(O.parentNode,U)+" > "+W.join(""):W.join("")}var mc={};mc=function(O){O===void 0&&(O=window);var U={load:function(W){if("addEventListener"in O&&W._isBreadcrumbTypeEnabled("navigation")){var q=function(Z){return function(){return W.leaveBreadcrumb(Z,{},"navigation")}};O.addEventListener("pagehide",q("Page hidden"),!0),O.addEventListener("pageshow",q("Page shown"),!0),O.addEventListener("load",q("Page loaded"),!0),O.document.addEventListener("DOMContentLoaded",q("DOMContentLoaded"),!0),O.addEventListener("load",function(){return O.addEventListener("popstate",q("Navigated back"),!0)}),O.addEventListener("hashchange",function(Z){var ge=Z.oldURL?{from:wi(Z.oldURL,O),to:wi(Z.newURL,O),state:gc(O)}:{to:wi(O.location.href,O)};W.leaveBreadcrumb("Hash changed",ge,"navigation")},!0),O.history.pushState&&zs(W,O.history,"pushState",O,!0),O.history.replaceState&&zs(W,O.history,"replaceState",O)}}};return U};var wi=function(O,U){var W=U.document.createElement("A");return W.href=O,""+W.pathname+W.search+W.hash},qs=function(O,U,W,q){var Z=wi(O.location.href,O);return{title:W,state:U,prevState:gc(O),to:q||Z,from:Z}},zs=function(O,U,W,q,Z){Z===void 0&&(Z=!1);var ge=U[W];U[W]=function(me,$e,oe){O.leaveBreadcrumb("History "+W,qs(q,me,$e,oe),"navigation"),Z&&typeof O.resetEventCount=="function"&&O.resetEventCount(),ge.apply(U,[me,$e].concat(oe!==void 0?oe:[]))}},gc=function(O){try{return O.history.state}catch{}},Xr="request",Jr=function(O,U){O===void 0&&(O=[]),U===void 0&&(U=window);var W={load:function(q){if(!q._isBreadcrumbTypeEnabled("request"))return;var Z=[q._config.endpoints.notify,q._config.endpoints.sessions].concat(O);ge(),oe();function ge(){if(!(!("addEventListener"in U.XMLHttpRequest.prototype)||!("WeakMap"in U))){var Y=new WeakMap,le=new WeakMap,Oe=U.XMLHttpRequest.prototype.open;U.XMLHttpRequest.prototype.open=function(je,it){this&&Y.set(this,{method:je,url:it}),Oe.apply(this,arguments)};var Re=U.XMLHttpRequest.prototype.send;U.XMLHttpRequest.prototype.send=function(je){var it=this,Xe=Y.get(this);if(Xe){var Tt=le.get(this);Tt&&(this.removeEventListener("load",Tt.load),this.removeEventListener("error",Tt.error));var Mt=new Date,bt=function(){return $e(Xe.method,Xe.url,jr(Mt))},gn=function(){return me(Xe.method,Xe.url,it.status,jr(Mt))};this.addEventListener("load",gn),this.addEventListener("error",bt),this&&le.set(this,{load:gn,error:bt})}Re.apply(this,arguments)}}}function me(Y,le,Oe,Re){if(le===void 0){q._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.");return}if(!(typeof le=="string"&&a(Z,le.replace(/\?.*$/,"")))){var Qe={status:Oe,method:String(Y),url:String(le),duration:Re};Oe>=400?q.leaveBreadcrumb("XMLHttpRequest failed",Qe,Xr):q.leaveBreadcrumb("XMLHttpRequest succeeded",Qe,Xr)}}function $e(Y,le,Oe){if(le===void 0){q._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.");return}typeof le=="string"&&a(Z,le.replace(/\?.*$/,""))||q.leaveBreadcrumb("XMLHttpRequest error",{method:String(Y),url:String(le),duration:Oe},Xr)}function oe(){if(!(!("fetch"in U)||U.fetch.polyfill)){var Y=U.fetch;U.fetch=function(){var Oe=arguments,Re=arguments[0],Qe=arguments[1],je,it=null;return Re&&typeof Re=="object"?(it=Re.url,Qe&&"method"in Qe?je=Qe.method:Re&&"method"in Re&&(je=Re.method)):(it=Re,Qe&&"method"in Qe&&(je=Qe.method)),je===void 0&&(je="GET"),new Promise(function(Xe,Tt){var Mt=new Date;Y.apply(void 0,Oe).then(function(bt){T(bt,je,it,jr(Mt)),Xe(bt)}).catch(function(bt){$(je,it,jr(Mt)),Tt(bt)})})}}}var T=function(Y,le,Oe,Re){var Qe={method:String(le),status:Y.status,url:String(Oe),duration:Re};Y.status>=400?q.leaveBreadcrumb("fetch() failed",Qe,Xr):q.leaveBreadcrumb("fetch() succeeded",Qe,Xr)},$=function(Y,le,Oe){q.leaveBreadcrumb("fetch() error",{method:String(Y),url:String(le),duration:Oe},Xr)}}};return W},jr=function(O){return O&&new Date-O},qr={load:function(O){var U=0;O.addOnError(function(W){if(U>=O._config.maxEvents)return O._logger.warn("Cancelling event send due to maxEvents per session limit of "+O._config.maxEvents+" being reached"),!1;U++}),O.resetEventCount=function(){U=0}},configSchema:{maxEvents:{defaultValue:function(){return 10},message:"should be a positive integer â¤100",validate:function(O){return l(1,100)(O)}}}},ka={};ka={load:function(O){O.addOnError(function(U){var W=r(U.errors,function(q,Z){return q.concat(Z.stacktrace)},[]);y(W,function(q){q.file=cr(q.file)})})}};var cr=ka._strip=function(O){return typeof O=="string"?O.replace(/\?.*$/,"").replace(/#.*$/,""):O},mu=function(O,U){return O===void 0&&(O=window),U===void 0&&(U="window onerror"),{load:function(W){if(!W._config.autoDetectErrors||!W._config.enabledErrorTypes.unhandledExceptions)return;function q(ge,me,$e,oe,T){if($e===0&&/Script error\.?/.test(ge))W._logger.warn("Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/yy3rn63z");else{var $={severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},Y;if(T)Y=W.Event.create(T,!0,$,U,1),Ro(Y.errors[0].stacktrace,me,$e,oe);else if(typeof ge=="object"&&ge!==null&&(!me||typeof me!="string")&&!$e&&!oe&&!T){var le=ge.type?"Event: "+ge.type:"Error",Oe=ge.message||ge.detail||"";Y=W.Event.create({name:le,message:Oe},!0,$,U,1),Y.originalError=ge,Y.addMetadata(U,{event:ge,extraParameters:me})}else Y=W.Event.create(ge,!0,$,U,1),Ro(Y.errors[0].stacktrace,me,$e,oe);W._notify(Y)}typeof Z=="function"&&Z.apply(this,arguments)}var Z=O.onerror;O.onerror=q}}},Ro=function(O,U,W,q){O[0]||O.push({});var Z=O[0];!Z.file&&typeof U=="string"&&(Z.file=U),!Z.lineNumber&&Ws(W)&&(Z.lineNumber=W),Z.columnNumber||(Ws(q)?Z.columnNumber=q:window.event&&Ws(window.event.errorCharacter)&&(Z.columnNumber=window.event.errorCharacter))},Ws=function(O){return typeof O=="number"&&String.call(O)!=="NaN"},vc=function(O){O===void 0&&(O=window);var U={load:function(W){if(!(!W._config.autoDetectErrors||!W._config.enabledErrorTypes.unhandledRejections)){var q=function(Z){var ge=Z.reason,me=!1;try{Z.detail&&Z.detail.reason&&(ge=Z.detail.reason,me=!0)}catch{}
3956var $e=!W._config.reportUnhandledPromiseRejectionsAsHandled,oe=W.Event.create(ge,!1,{severity:"error",unhandled:$e,severityReason:{type:"unhandledPromiseRejection"}},"unhandledrejection handler",1,W._logger);me&&y(oe.errors[0].stacktrace,Hs(ge)),W._notify(oe,function(T){if(mt(T.originalError)&&!T.originalError.stack){var $;T.addMetadata("unhandledRejection handler",($={},$[Object.prototype.toString.call(T.originalError)]={name:T.originalError.name,message:T.originalError.message,code:T.originalError.code},$))}})};"addEventListener"in O?O.addEventListener("unhandledrejection",q):O.onunhandledrejection=function(Z,ge){q({detail:{reason:Z,promise:ge}})}}}};return U},Hs=function(O){return function(U){U.file!==O.toString()&&U.method&&(U.method=U.method.replace(/^\s+/,""))}},Mn={},Ao="Bugsnag JavaScript",yc="8.4.0",is="https://github.com/bugsnag/bugsnag-js",Io=v({},p.schema,S),zn={_client:null,createClient:function(O){typeof O=="string"&&(O={apiKey:O}),O||(O={});var U=[$s,Bs(),To(),ts(),qr,Vn,aa,ka,mu(),vc(),mc(),pc(),Jr(),Us,rs()],W=new Za(O,Io,U,{name:Ao,version:yc,url:is});return W._setDelivery(window.XDomainRequest?Ls:du),W._logger.debug("Loaded!"),W.leaveBreadcrumb("Bugsnag loaded",{},"state"),W._config.autoTrackSessions?W.startSession():W},start:function(O){return zn._client?(zn._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."),zn._client):(zn._client=zn.createClient(O),zn._client)},isStarted:function(){return zn._client!=null}};return y(["resetEventCount"].concat(u(Za.prototype)),function(O){/^_/.test(O)||(zn[O]=function(){if(!zn._client)return console.log("Bugsnag."+O+"() was called before Bugsnag.start()");zn._client._depth+=1;var U=zn._client[O].apply(zn._client,arguments);return zn._client._depth-=1,U})}),Mn=zn,Mn.Client=Za,Mn.Event=rn,Mn.Session=Ms,Mn.Breadcrumb=E,Mn.default=zn,Mn})})(MU);var wOe=MU.exports,COe=wOe;const hM=id(COe);var DU={exports:{}};(function(n,e){(function(t){n.exports=t()})(function(){var t=this,r,i=function(g,v){var y=g.config.errorHandler,b=function(x,S,w){var k={severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},E=v.Event.create(x,!0,k,"vue error handler",1),I=typeof w=="string"&&w.indexOf("runtime-")>0?w.split("runtime-")[1]:w,P=c[I]||w;E.addMetadata("vue",{errorInfo:P,component:S?a(S):void 0,props:S&&S.$options?S.$options.propsData:void 0}),v._notify(E),typeof console<"u"&&typeof console.error=="function"&&console.error(x),typeof y=="function"&&y.call(t,x,S,w)};g.config.errorHandler=b};function a(g){return g.$parent===null?"App":g.$options&&g.$options.name?g.$options.name:"Anonymous"}var s={BEFORE_CREATE:"bc",CREATED:"c",BEFORE_MOUNT:"bm",MOUNTED:"m",BEFORE_UPDATE:"bu",UPDATED:"u",BEFORE_UNMOUNT:"bum",UNMOUNTED:"um",DEACTIVATED:"da",ACTIVATED:"a",RENDER_TRIGGERED:"rtg",RENDER_TRACKED:"rtc",ERROR_CAPTURED:"ec",SERVER_PREFETCH:"sp"},o={SETUP_FUNCTION:0,RENDER_FUNCTION:1,WATCH_GETTER:2,WATCH_CALLBACK:3,WATCH_CLEANUP:4,NATIVE_EVENT_HANDLER:5,COMPONENT_EVENT_HANDLER:6,VNODE_HOOK:7,DIRECTIVE_HOOK:8,TRANSITION_HOOK:9,APP_ERROR_HANDLER:10,APP_WARN_HANDLER:11,FUNCTION_REF:12,ASYNC_COMPONENT_LOADER:13,SCHEDULER:14},c=(r={},r[s.SERVER_PREFETCH]="serverPrefetch hook",r[s.BEFORE_CREATE]="beforeCreate hook",r[s.CREATED]="created hook",r[s.BEFORE_MOUNT]="beforeMount hook",r[s.MOUNTED]="mounted hook",r[s.BEFORE_UPDATE]="beforeUpdate hook",r[s.UPDATED]="updated",r[s.BEFORE_UNMOUNT]="beforeUnmount hook",r[s.UNMOUNTED]="unmounted hook",r[s.ACTIVATED]="activated hook",r[s.DEACTIVATED]="deactivated hook",r[s.ERROR_CAPTURED]="errorCaptured hook",r[s.RENDER_TRACKED]="renderTracked hook",r[s.RENDER_TRIGGERED]="renderTriggered hook",r[o.SETUP_FUNCTION]="setup function",r[o.RENDER_FUNCTION]="render function",r[o.WATCH_GETTER]="watcher getter",r[o.WATCH_CALLBACK]="watcher callback",r[o.WATCH_CLEANUP]="watcher cleanup function",r[o.NATIVE_EVENT_HANDLER]="native event handler",r[o.COMPONENT_EVENT_HANDLER]="component event handler",r[o.VNODE_HOOK]="vnode hook",r[o.DIRECTIVE_HOOK]="directive hook",r[o.TRANSITION_HOOK]="transition hook",r[o.APP_ERROR_HANDLER]="app errorHandler",r[o.APP_WARN_HANDLER]="app warnHandler",r[o.FUNCTION_REF]="ref function",r[o.ASYNC_COMPONENT_LOADER]="async component loader",r[o.SCHEDULER]="scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core .",r),u={},l=this;u=function(g,v){var y=g.config.errorHandler,b=function(x,S,w){var k={severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},E=v.Event.create(x,!0,k,"vue error handler",1);E.addMetadata("vue",{errorInfo:w,component:S?d(S,!0):void 0,props:S?S.$options.propsData:void 0}),v._notify(E),typeof console<"u"&&typeof console.error=="function"&&console.error(x),typeof y=="function"&&y.call(l,x,S,w)};g.config.errorHandler=b};var d=function(g,v){if(g.$root===g)return"<Root>";var y=typeof g=="function"&&g.cid!=null?g.options:g._isVue?g.$options||g.constructor.options:g||{},b=y.name||y._componentTag,x=y.__file;if(!b&&x){var S=x.match(/([^/\\]+)\.vue$/);b=S&&S[1]}return(b?"<"+h(b)+">":"<Anonymous>")+(x&&v!==!1?" at "+x:"")},h=u.classify=function(g){return g.replace(/(?:^|[-_])(\w)/g,function(v){return v.toUpperCase()}).replace(/[-_]/g,"")},p={};return p=function(){function g(){var y=typeof window<"u"&&window.Vue;if(this.name="vue",this.lazy=arguments.length===0&&!y,!this.lazy&&(this.Vue=(arguments.length<=0?void 0:arguments[0])||y,!this.Vue))throw new Error("@bugsnag/plugin-vue reference to `Vue` was undefined")}var v=g.prototype;return v.load=function(b){return this.Vue&&this.Vue.config?(u(this.Vue,b),{installVueErrorHandler:function(){return b._logger.warn("installVueErrorHandler() was called unnecessarily")}}):{install:function(x){x||b._logger.error(new Error("@bugsnag/plugin-vue reference to Vue `app` was undefined")),i(x,b)},installVueErrorHandler:function(x){x||b._logger.error(new Error("@bugsnag/plugin-vue reference to `Vue` was undefined")),u(x,b)}}},g}(),p.default=p,p})})(DU);var kOe=DU.exports;const SOe=id(kOe),pM=128,NU=1024,mM=1e4,LU=1e3,gM=1e4,FU=128,vM=1e3,TOe={attributeStringValueLimit:NU,attributeArrayLe
3956ngthLimit:LU,attributeCountLimit:FU},EOe={attributeStringValueLimit:1/0,attributeArrayLengthLimit:1/0,attributeCountLimit:1/0},Ih=n=>n===!0||n===!1,lc=n=>!!n&&typeof n=="object"&&!Array.isArray(n),zc=n=>typeof n=="number"&&Number.isFinite(n)&&!Number.isNaN(n),h1=n=>typeof n=="string",rp=n=>h1(n)&&n.length>0,POe=n=>lc(n)&&typeof n.debug=="function"&&typeof n.info=="function"&&typeof n.warn=="function"&&typeof n.error=="function",ROe=n=>Array.isArray(n)&&n.every(rp),AOe=n=>Array.isArray(n)&&n.every(e=>rp(e)||e instanceof RegExp);function IOe(n){return lc(n)&&zc(n.value)&&zc(n.time)}const OOe=n=>lc(n)&&typeof n.id=="string"&&typeof n.traceId=="string"&&typeof n.isValid=="function"&&typeof n.samplingRate=="number"&&typeof n.samplingProbability=="number",$U=n=>lc(n)&&typeof n.id=="string"&&typeof n.traceId=="string";function MOe(n){return zc(n)||n instanceof Date}function DOe(n){return lc(n)&&typeof n.install=="function"&&typeof n.start=="function"}function NOe(n){return Array.isArray(n)&&n.every(e=>DOe(e))}function yM(n){return Array.isArray(n)&&n.every(e=>typeof e=="function")}function LOe(n,e){const t=n.length,r=n.slice(0,e),i=r.length;return`${r} *** ${t-i} CHARS TRUNCATED`}class BU{get droppedAttributesCount(){return this._droppedAttributesCount}
3956constructor(e,t,r,i){this._droppedAttributesCount=0,this.attributes=e,this.spanAttributeLimits=t,this.spanName=r,this.logger=i}validateAttribute(e,t){if(typeof t=="string"&&t.length>this.spanAttributeLimits.attributeStringValueLimit&&(this.attributes.set(e,LOe(t,this.spanAttributeLimits.attributeStringValueLimit)),this.logger.warn(`Span attribute ${e} in span ${this.spanName} was truncated as the string exceeds the ${this.spanAttributeLimits.attributeStringValueLimit} character limit set by attributeStringValueLimit.`)),Array.isArray(t)&&t.length>this.spanAttributeLimits.attributeArrayLengthLimit){const r=t.slice(0,this.spanAttributeLimits.attributeArrayLengthLimit);this.attributes.set(e,r),this.logger.warn(`Span attribute ${e} in span ${this.spanName} was truncated as the array exceeds the ${this.spanAttributeLimits.attributeArrayLengthLimit} element limit set by attributeArrayLengthLimit.`)}}set(e,t){typeof e=="string"&&(typeof t=="string"||typeof t=="boolean"||zc(t)||Array.isArray(t))&&this.attributes.set(e,t)}setCustom(e,t){if(typeof e=="string"&&(typeof t=="string"||typeof t=="boolean"||zc(t)||Array.isArray(t))){if(!this.attributes.has(e)&&this.attributes.size>=this.spanAttributeLimits.attributeCountLimit){this._droppedAttributesCount++,this.logger.warn(`Span attribute ${e} in span ${this.spanName} was dropped as the number of attributes exceeds the ${this.spanAttributeLimits.attributeCountLimit} attribute limit set by attributeCountLimit.`);return}if(e.length>pM){this._droppedAttributesCount++,this.logger.warn(`Span attribute ${e} in span ${this.spanName} was dropped as the key length exceeds the ${pM} character fixed limit.`);return}this.attributes.set(e,t)}}remove(e){this.attributes.delete(e)}toJson(){return Array.from(this.attributes).forEach(([e,t])=>{this.validateAttribute(e,t)}),Array.from(this.attributes).map(([e,t])=>UOe(e,t))}toObject(){return Object.fromEntries(this.attributes)}}class FOe extends BU{constructor(e,t,r,i,a,s){const o=new Map([["deployment.environment",e],["telemetry.sdk.name",i],["telemetry.sdk.version",a],["service.name",r]]);t.length>0&&o.set("service.version",t),super(o,EOe,"resource-attributes",s)}}function $Oe(n){switch(typeof n){case"number":return Number.isNaN(n)||!Number.isFinite(n)?void 0:Number.isInteger(n)?{intValue:`${n}`}:{doubleValue:n};case"boolean":return{boolValue:n};case"string":return{stringValue:n}}}function BOe(n){return n.map(e=>$Oe(e)).filter(e=>typeof e<"u")}function UOe(n,e){switch(typeof e){case"number":return Number.isNaN(e)||!Number.isFinite(e)?void 0:n!=="bugsnag.sampling.p"&&Number.isInteger(e)?{key:n,value:{intValue:`${e}`}}:{key:n,value:{doubleValue:e}};case"boolean":return{key:n,value:{boolValue:e}};case"string":return{key:n,value:{stringValue:e}};case"object":if(Array.isArray(e)){const t=BOe(e);return{key:n,value:{arrayValue:t.length>0?{values:t}:{}}}}return;default:return}}const jOe=1e6;function UU(n){return Math.round(n*jOe)}const _2={appVersion:{defaultValue:"",message:"should be a string",validate:rp},endpoint:{defaultValue:"https://otlp.bugsnag.com/v1/traces",message:"should be a string",validate:rp},apiKey:{defaultValue:"",message:"should be a 32 character hexadecimal string",validate:n=>h1(n)&&/^[a-f0-9]{32}$/.test(n)},logger:{defaultValue:{debug(n){console.debug(n)},info(n){console.info(n)},warn(n){console.warn(n)},error(n){console.error(n)}},message:"should be a Logger object",validate:POe},releaseStage:{defaultValue:"production",message:"should be a string",validate:rp},enabledReleaseStages:{defaultValue:null,message:"should be an array of strings",validate:n=>n===null||ROe(n)},plugins:{defaultValue:[],message:"should be an array of plugin objects",validate:NOe},bugsnag:{defaultValue:void 0,message:"should be an instance of Bugsnag",validate:n=>lc(n)&&typeof n.addOnError=="function"},samplingProbability:{defaultValue:void 0,message:"should be a number between 0 and 1",validate:n=>n===void 0||zc(n)&&n>=0&&n<=1},onSpanStart:{defaultValue:void 0,message:"should be an array of functions",validate:yM},onSpanEnd:{defaultValue:void 0,message:"should be an array of functions",validate:yM},attributeStringValueLimit:{defaultValue:NU,message:`should be a number between 1 and ${mM}`,validate:n=>zc(n)&&n>0&&n<=mM}
3956,attributeArrayLengthLimit:{defaultValue:LU,message:`should be a number between 1 and ${gM}`,validate:n=>zc(n)&&n>0&&n<=gM},attributeCountLimit:{defaultValue:FU,message:`should be a number between 1 and ${vM}`,validate:n=>zc(n)&&n>0&&n<=vM}};function qOe(n,e){if(typeof n=="string"&&(n={apiKey:n}),!lc(n)||!h1(n.apiKey)||n.apiKey.length===0)throw new Error("No Bugsnag API Key set");let t="";const r={};for(const i of Object.keys(e))Object.prototype.hasOwnProperty.call(n,i)?e[i].validate(n[i])?r[i]=n[i]:(t+=` 3957 - ${i} ${e[i].message}, got ${typeof n[i]}`,r[i]=e[i].defaultValue):r[i]=e[i].defaultValue;return r.apiKey=n.apiKey,r.maximumBatchSize=n.maximumBatchSize||100,r.batchInactivityTimeoutMs=n.batchInactivityTimeoutMs||30*1e3,t.length>0&&r.logger.warn(`Invalid configuration${t}`),r}class zOe{constructor(){this.events=[]}add(e,t){this.events.push({name:e,time:t})}toJson(e){return this.events.map(({name:t,time:r})=>({name:t,timeUnixNano:e.toUnixTimestampNanoseconds(r)}))}}function jU(n){let e=0;for(let t=0;t<n.length/8;t++){const r=t*8,i=Number.parseInt(n.slice(r,r+8),16);e=(e^i)>>>0}return e}const WOe=60*60*1e3;function HOe(n,e){return{name:n.name,kind:n.kind,spanId:n.id,traceId:n.traceId,parentSpanId:n.parentSpanId,...n.attributes.droppedAttributesCount>0?{droppedAttributesCount:n.attributes.droppedAttributesCount}:{},startTimeUnixNano:e.toUnixTimestampNanoseconds(n.startTime),endTimeUnixNano:e.toUnixTimestampNanoseconds(n.endTime),attributes:n.attributes.toJson(),events:n.events.toJson(e)}}function VOe(n){return{get id(){return n.id},get traceId(){return n.traceId},get samplingRate(){return n.samplingRate},get samplingProbability(){return n.samplingProbability.raw},get name(){return n.name},isValid:()=>!1,end:()=>{},setAttribute:(e,t)=>{n.attributes.setCustom(e,t)}}}async function GOe(n,e,t){if(!t||t.length===0)return!0;const r=VOe(n),i=performance.now();let a=!0;for(const s of t)try{let o=s(r);if(typeof o.then=="function"&&(o=await o),o===!1){a=!1;break}}catch(o){e.error("Error in onSpanEnd callback: "+o)}if(a){const s=UU(performance.now()-i);r.setAttribute("bugsnag.span.callbacks_duration",s)}return a}class KOe{constructor(e,t,r,i,a,s,o,c){this.kind=3,this.events=new zOe,this.id=e,this.traceId=t,this.parentSpanId=c,this.name=r,this.startTime=i,this.attributes=a,this.samplingRate=jU(this.traceId),this.samplingProbability=o,this.clock=s}addEvent(e,t){this.events.add(e,t)}setAttribute(e,t){this.attributes.set(e,t)}setCustomAttribute(e,t){this.attributes.setCustom(e,t)}end(e,t){this.endTime=e;let r=t;return this.attributes.set("bugsnag.sampling.p",r.raw),{id:this.id,name:this.name,kind:this.kind,traceId:this.traceId,startTime:this.startTime,attributes:this.attributes,events:this.events,samplingRate:this.samplingRate,endTime:e,get samplingProbability(){return r},set samplingProbability(i){r=i,this.attributes.set("bugsnag.sampling.p",r.raw)},parentSpanId:this.parentSpanId}}isValid(){return this.endTime===void 0&&this.startTime>this.clock.now()-WOe}}const qU={startTime:{message:"should be a number or Date",getDefaultValue:()=>{},validate:MOe},parentContext:{message:"should be a ParentContext",getDefaultValue:()=>{},validate:n=>n===null||$U(n)},makeCurrentContext:{message:"should be true|false",getDefaultValue:()=>{},validate:Ih},isFirstClass:{message:"should be true|false",getDefaultValue:()=>{},validate:Ih}};class YOe{constructor(e,t,r,i,a,s){this.spans=[],this.timeout=null,this.flushQueue=Promise.resolve(),this.delivery=e,this.configuration=t,this.retryQueue=r,this.sampler=i,this.probabilityManager=a,this.encoder=s,this.flush=this.flush.bind(this)}stop(){this.timeout!==null&&(clearTimeout(this.timeout),this.timeout=null)}start(){this.stop(),this.timeout=setTimeout(this.flush,this.configuration.batchInactivityTimeoutMs)}add(e){this.configuration.enabledReleaseStages&&!this.configuration.enabledReleaseStages.includes(this.configuration.releaseStage)||(this.spans.push(e),this.spans.length>=this.configuration.maximumBatchSize?this.flush():this.start())}async flush(){this.stop(),this.flushQueue=this.flushQueue.then(async()=>{const e=await this.prepareBatch();if(!e)return;const t=await this.encoder.encode(e),r=Date.now();try{const i=await this.delivery.send(t);switch(i.samplingProbability!==void 0&&this.probabilityManager.setProbability(i.samplingProbability),i.state){case"success":this.retryQueue.flush();break;case"failure-discard":this.configuration.logger.warn("delivery failed");break;case"failure-retryable":this.configuration.logger.info("delivery failed, adding to retry queue"),this.retryQueue.add(t,r);break;default:i.state}}catch{this.configuration.logger.warn("delivery failed")}}),await this.flushQueue}async prepareBatch(){if(this.spans.length===0)return;await this.probabilityManager.ensureFreshProbability();const e=[],t=this.sampler.spanProbability;for(const r of this.spans)r.samplingProbability.raw>t.raw&&(r.samplingProbability=t),this.sampler.sample(r)&&await GOe(r,this.configuration.logger,this.configuration.onSpanEnd)&&e.push(r);if(this.spans=[],e.length!==0)return e}}class XOe{constructor(e,t,r){this.clock=e,this.configuration=t,this.resourceAttributeSource=r}async encode(e){const t=await this.resourceAttributeSource(this.configuration),r=Array(e.length);for(let a=0;a<e.length;++a)r[a]=HOe(e[a],this.clock);return{body:{resourceSpans:[{resource:{attributes:t.toJson()},scopeSpans:[{spans:r}]}]},headers:{"Bugsnag-Api-Key":this.configuration.apiKey,"Content-Type":"application/json",...this.configuration.samplingProbability!==void 0?{}:{"Bugsnag-Span-Sampling":this.generateSamplingHeader(e)}}}}generateSamplingHeader(e){if(e.length===0)return"1:0";const t=Object.create(null);for(const a of e){const s=t[a.samplingProbability.raw]||0;t[a.samplingProbability.raw]=s+1}const r=Object.keys(t),i=Array(r.length);for(let a=0;a<r.length;++a){const s=r[a];i[a]=`${s}:${t[s]}`}return i.join(";")}}const JOe=new Set([402,407,408,429]);function QOe(n){return n>=200&&n<300?"success":n>=400&&n<500&&!JOe.has(n)?"failure-discard":"failure-retryable"}class yP{static async create(e,t){return e.probability=t,new yP(e,t)}constructor(e,t){this.sampler=e,this.samplingProbability=t}setProbability(e){return Promise.resolve()}ensureFreshProbability(){return Promise.resolve()}}const lg={NORMAL:5e4};class b2{constructor(e){this.items=[],e&&(this.items=e,this.sort())}add(e,t){return this.items.some(r=>r.item===e)?!1:(this.items.push({item:e,priority:t}),this.sort(),!0)}addAll(e){let t=!1;for(const r of e)this.items.some(i=>i.item===r.item)||(this.items.push(r),t=!0);return t&&this.sort(),t}*[Symbol.iterator](){for(const e of this.items)yield e.item}sort(){this.items.sort((e,t)=>
3957t.priority-e.priority)}}class _M{constructor(e,t){this.configuration=e,this.clock=t,this.onSpanStartCallbacks=[],this.onSpanEndCallbacks=[],this.spanControlProviders=[]}addOnSpanStartCallback(e,t=lg.NORMAL){this.onSpanStartCallbacks.push({item:e,priority:t})}addOnSpanEndCallback(e,t=lg.NORMAL){this.onSpanEndCallbacks.push({item:e,priority:t})}addSpanControlProvider(e,t=lg.NORMAL){this.spanControlProviders.push({item:e,priority:t})}mergeFrom(e){this.onSpanStartCallbacks.push(...e.onSpanStartCallbacks),this.onSpanEndCallbacks.push(...e.onSpanEndCallbacks),this.spanControlProviders.push(...e.spanControlProviders)}}class ZOe{constructor(){this.plugins=[],this.installedPlugins=new Set}addPlugins(e){this.plugins.push(...e)}installPlugins(e,t){this.logger=e.logger;const r=new _M(e,t);for(const i of this.plugins)if(!this.installedPlugins.has(i))try{const a=new _M(e,t);i.install(a),r.mergeFrom(a),this.installedPlugins.add(i)}catch(a){this.logger&&this.logger.error(`Plugin ${i.constructor.name} failed to install: ${a}`)}return r}startPlugins(){for(const e of this.installedPlugins)try{e.start()}catch(t){this.logger&&this.logger.error(`Plugin ${e.constructor.name} failed to start: ${t}`)}}getPlugin(e){for(const t of this.installedPlugins)if(t instanceof e)return t}}const eMe=30*1e3;class tMe{constructor(e,t){this.delivery=e,this.payload={body:{resourceSpans:[]},headers:{"Bugsnag-Api-Key":t,"Content-Type":"application/json","Bugsnag-Span-Sampling":"1.0:0"}}}async getNewProbability(){for(;;){const e=await this.delivery.send(this.payload);if(e.samplingProbability!==void 0)return e.samplingProbability;await this.timeBetweenRetries()}}timeBetweenRetries(){return new Promise(e=>{setTimeout(e,eMe)})}}const bM=24*60*60*1e3;class _P{static async create(e,t,r){const i=await e.load("bugsnag-sampling-probability");let a;return i===void 0?(t.probability=1,a=0):(i.time<Date.now()-bM,t.probability=i.value,a=i.time),new _P(e,t,r,a)}
3957constructor(e,t,r,i){this.outstandingFreshnessCheck=void 0,this.persistence=e,this.sampler=t,this.probabilityFetcher=r,this.lastProbabilityTime=i,this.ensureFreshProbability()}setProbability(e){return this.lastProbabilityTime=Date.now(),this.sampler.probability=e,this.persistence.save("bugsnag-sampling-probability",{value:e,time:this.lastProbabilityTime})}ensureFreshProbability(){return this.outstandingFreshnessCheck?this.outstandingFreshnessCheck:Date.now()-this.lastProbabilityTime>=bM?(this.outstandingFreshnessCheck=this.probabilityFetcher.getNewProbability().then(e=>{this.setProbability(e),this.outstandingFreshnessCheck=void 0}),this.outstandingFreshnessCheck):Promise.resolve()}}class nMe{constructor(){this.spans=[]}add(e){this.spans.push(e)}}function x2(n){return Math.floor(n*4294967295)}class rMe{constructor(e){this._probability=e,this.scaledProbability=x2(e)}get probability(){return this._probability}set probability(e){this._probability=e,this.scaledProbability=x2(e)}get spanProbability(){return{raw:this._probability,scaled:this.scaledProbability}}sample(e){return e.samplingRate<=e.samplingProbability.scaled}shouldSample(e){return e<=this.spanProbability.scaled}}function iMe(n,e){return n===e?!0:n!==void 0&&e!==void 0?n.id===e.id&&n.traceId===e.traceId:!1}class aMe{constructor(e,t=[]){this.isInForeground=!0,this.onBackgroundStateChange=r=>{this.isInForeground=r==="in-foreground",this.contextStack.length=0},this.contextStack=t,e.onStateChange(this.onBackgroundStateChange)}*[Symbol.iterator](){for(let e=this.contextStack.length-1;e>=0;--e)yield this.contextStack[e]}push(e){e.isValid()&&this.isInForeground&&this.contextStack.push(e)}pop(e){iMe(e,this.current)&&this.contextStack.pop(),this.removeClosedContexts()}get first(){return this.removeClosedContexts(),this.contextStack.length>0?this.contextStack[0]:void 0}get current(){return this.removeClosedContexts(),this.contextStack.length>0?this.contextStack[this.contextStack.length-1]:void 0}removeClosedContexts(){for(;this.contextStack.length>0&&this.contextStack[this.contextStack.length-1].isValid()===!1;)this.contextStack.pop()}}class sMe{constructor(){this.providers=new b2}addProvider(e,t){this.providers.add(e,t)}addProviders(e){this.providers.addAll(e)}getSpanControls(e){for(const t of this.providers){const r=t.getSpanControls(e);if(r)return r}return null}}function w2(n,e){return zc(e)?e:e instanceof Date?n.convert(e):n.now()}const xM=-1;class oMe{constructor(e,t,r,i,a,s,o,c){this.spanAttributeLimits=TOe,this.openSpans=new WeakSet,this.isInForeground=!0,this.onBackgroundStateChange=u=>{this.isInForeground=u==="in-foreground",this.openSpans=new WeakSet},this.processor=e,this.sampler=t,this.idGenerator=r,this.spanAttributesSource=i,this.clock=a,this.logger=o,this.spanContextStorage=c,s.onStateChange(this.onBackgroundStateChange)}startSpan(e,t){t.parentContext=$U(t.parentContext)||t.parentContext===null?t.parentContext:this.spanContextStorage.current;const r=new BU(new Map,this.spanAttributeLimits,e,this.logger);typeof t.isFirstClass=="boolean"&&r.set("bugsnag.span.first_class",t.isFirstClass);const i=this.createSpanInternal(e,t,r);return this.isInForeground&&(this.openSpans.add(i),t.makeCurrentContext!==!1&&this.spanContextStorage.push(i)),this.onSpanStart(i),i}onSpanStart(e){if(this.onSpanStartCallbacks){const t=this.toPublicApi(e);for(const r of this.onSpanStartCallbacks)try{r(t)}catch(i){this.logger.error("Error in onSpanStart callback: "+i)}}}createSpanInternal(e,t,r){const i=w2(this.clock,t.startTime),a=this.idGenerator.generate(64),s=t.parentContext?t.parentContext.id:void 0,o=t.parentContext?t.parentContext.traceId:this.idGenerator.generate(128);return new KOe(a,o,e,i,r,this.clock,this.sampler.probability,s)}startNetworkSpan(e){const t=`[HTTP/${e.method.toUpperCase()}]`,r=this.validateSpanOptions(t,e),i=this.startSpan(r.name,{...r.options,makeCurrentContext:!1});return i.setAttribute("bugsnag.span.category","network"),i.setAttribute("http.method",e.method),i.setAttribute("http.url",e.url),i}configure(e){this.logger=e.logger,this.spanAttributesSource.configure(e),this.spanAttributeLimits={attributeArrayLe
3957ngthLimit:e.attributeArrayLengthLimit,attributeCountLimit:e.attributeCountLimit,attributeStringValueLimit:e.attributeStringValueLimit},this.onSpanStartCallbacks=e.onSpanStart,this.onSpanEndCallbacks=e.onSpanEnd}reprocessEarlySpans(e){for(const t of this.processor.spans)e.add(t);this.processor=e}endSpan(e,t,r){this.spanContextStorage.pop(e);const i=!this.openSpans.delete(e),a=e.isValid();if(i&&!a&&this.logger.warn("Attempted to end a Span which is no longer valid."),i||!a||t===xM){this.discardSpan(e);return}for(const[s,o]of Object.entries(r||{}))e.setAttribute(s,o);this.spanAttributesSource.requestAttributes(e),this.sendForProcessing(e,t)}discardSpan(e){e.end(xM,this.sampler.spanProbability)}sendForProcessing(e,t){const r=e.end(t,this.sampler.spanProbability);this.sampler.sample(r)&&this.processor.add(r)}toPublicApi(e){return{get id(){return e.id},get traceId(){return e.traceId},get samplingRate(){return e.samplingRate},get samplingProbability(){return e.samplingProbability},get name(){return e.name},isValid:()=>e.isValid(),setAttribute:(t,r)=>{e.setCustomAttribute(t,r)},end:t=>{const r=w2(this.clock,t);this.endSpan(e,r)}}}validateSpanOptions(e,t,r=qU){let i="";const a={};if(typeof e!="string"&&(i+=` 3958 - name should be a string, got ${typeof e}`,e=String(e)),t!==void 0&&!lc(t))i+=` 3959 - options is not an object`;else{const s=t||{};for(const o of Object.keys(r))Object.prototype.hasOwnProperty.call(s,o)&&s[o]!==void 0?r[o].validate(s[o])?a[o]=s[o]:(i+=` 3960 - ${o} ${r[o].message}, got ${typeof s[o]}`,a[o]=r[o].getDefaultValue(s[o])):a[o]=r[o].getDefaultValue(s[o])}return i.length>0&&this.logger.warn(`Invalid span options${i}`),{name:e,options:a}}}let zU="starting";function WU(){return zU}function G_(n){zU=n}function cMe(n){const e="00000",t="https://otlp.insighthub.smartbear.com/v1/traces",r=new nMe,i=n.spanContextStorage||new aMe(n.backgroundingListener);let a=n.schema.logger.defaultValue;G_("starting");const s=new rMe(1),o=n.spanFactory||oMe,c=new o(r,s,n.idGenerator,n.spanAttributesSource,n.clock,n.backgroundingListener,a,i),u=new sMe,l=new ZOe;return l.addPlugins(n.plugins(c,i)),{start:d=>{const h=qOe(d,n.schema);if(h.endpoint===_2.endpoint.defaultValue&&(h.apiKey.startsWith(e)?h.endpoint=t:h.endpoint=h.endpoint.replace("https://",`https://${h.apiKey}.`)),h.bugsnag&&typeof h.bugsnag.Event.prototype.setTraceCorrelation=="function"&&h.bugsnag.Client){const x=h.bugsnag.Client.prototype._notify;h.bugsnag.Client.prototype._notify=function(...S){const w=i.current;w&&typeof S[0].setTraceCorrelation=="function"&&S[0].setTraceCorrelation(w.traceId,w.id),x.apply(this,S)}}l.addPlugins(h.plugins);const p=l.installPlugins(h,n.clock);u.addProviders(p.spanControlProviders);const g=new b2(p.onSpanStartCallbacks),v=new b2(p.onSpanEndCallbacks);h.onSpanStart&&g.addAll(h.onSpanStart.map(x=>({item:x,priority:lg.NORMAL}))),h.onSpanEnd&&v.addAll(h.onSpanEnd.map(x=>({item:x,priority:lg.NORMAL}))),h.onSpanStart=Array.from(g),h.onSpanEnd=Array.from(v),c.configure(h);const y=n.deliveryFactory(h.endpoint);(h.samplingProbability===void 0?_P.create(n.persistence,s,new tMe(y,h.apiKey)):yP.create(s,h.samplingProbability)).then(x=>{const S=new YOe(y,h,n.retryQueueFactory(y,h.retryQueueMaxSize),s,x,new XOe(n.clock,h,n.resourceAttributesSource));c.reprocessEarlySpans(S),n.backgroundingListener.onStateChange(w=>{S.flush(),w==="in-foreground"&&x.ensureFreshProbability()}),a=h.logger}),l.startPlugins()},startSpan:(d,h)=>{const p=c.validateSpanOptions(d,h),g=c.startSpan(p.name,p.options);return g.setAttribute("bugsnag.span.category","custom"),c.toPublicApi(g)},startNetworkSpan:d=>{const h=c.startNetworkSpan(d);return{...c.toPublicApi(h),end:v=>{c.endSpan(h,w2(n.clock,v.endTime),{"http.status_code":v.status})}}},getPlugin:d=>l.getPlugin(d),getSpanControls:d=>u.getSpanControls(d),get currentSpanContext(){return i.current},get appState(){return WU()},...n.platformExtensions&&n.platformExtensions(c,i)}}function uMe(){const n=()=>{};return{start:n,startSpan:()=>({id:"",traceId:"",end:n,isValid:()=>!1}),currentSpanContext:void 0}}function C2(n,e){var t="000000000"+n;return t.substr(t.length-e)}var wM=typeof window=="object"?window:self,HU=0;for(var lMe in wM)Object.hasOwnProperty.call(wM,lMe)&&HU++;var dMe=navigator.mimeTypes?navigator.mimeTypes.length:0,fMe=C2((dMe+navigator.userAgent.length).toString(36)+HU.toString(36),4);function hMe(){return fMe}function pMe(n){return typeof n=="string"&&/^c[a-z0-9]{20,32}$/.test(n)}function mMe(n){const r=Math.pow(36,4);let i=0;function a(){return C2((Math.random()*r<<0).toString(36),4)}function s(){return i=i<r?i:0,i++,i-1}function o(){var c="c",u=new Date().getTime().toString(36),l=C2(s().toString(36),4),d=n(),h=a()+a();return c+u+l+d+h}return o.fingerprint=n,o.isCuid=pMe,o}const VU=mMe(hMe),{isCuid:gMe}=VU;class vMe{constructor(){this.persistedItems=new Map}async load(e){return this.persistedItems.get(e)}async save(e,t){this.persistedItems.set(e,t)}}function yMe(n,e){switch(n){case"bugsnag-sampling-probability":{const t=JSON.parse(e);return IOe(t)?t:void 0}case"bugsnag-anonymous-id":return gMe(e)?e:void 0}}const _Me=24*60*6e4;class bMe{constructor(e,t){this.delivery=e,this.retryQueueMaxSize=t,this.requestQueue=Promise.resolve(),this.payloads=[]}add(e,t){this.payloads.push({payload:e,time:t});let r=this.payloads.reduce((i,{payload:a})=>i+CM(a),0);for(;r>this.retryQueueMaxSize;){const i=this.payloads.shift();if(!i)break;r-=CM(i.payload)}}async flush(){if(this.payloads.length===0)return;const e=this.payloads;this.payloads=[],this.requestQueue=this.requestQueue.then(async()=>{for(const{payload:t,time:r}of e)if(!(Date.now()>=r+_Me))try{const{state:i}=await this.delivery.send(t);switch(i){case"success":case"failure-discard":break;case"failure-retryable":this.add(t,r);break;default:}}catch{}}),await this.requestQueue}}function CM(n){let e=0;for(let t=0;t<n.body.resourceSpans.length;++t){const r=n.body.resourceSpans[t].scopeSpans;for(let i=0;i<r.length;++i)e+=r[i].spans.length}return e}const xMe=/^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9]{2}$/;
3960class K_{constructor(e){this.id=e.id,this.traceId=e.traceId}encodeAsTraceParent(){return K_.toTraceParentString(this)}static parseTraceParent(e){const t=xMe.exec(e);if(!t)return;const[,r,i]=t;return new K_({id:i,traceId:r})}static toTraceParentString(e){let t=!0;if(OOe(e)){const r=x2(e.samplingProbability);t=e.samplingRate<=r}return`00-${e.traceId}-${e.id}-${t?"01":"00"}`}}function wMe(n){const e=n.get("Bugsnag-Sampling-Probability");if(typeof e!="string")return;const t=Number.parseFloat(e);if(!(Number.isNaN(t)||t<0||t>1))return t}function CMe(n,e,t){let r=!1;return t&&t.onStateChange(i=>{r=i==="in-background"}),function(a){return{async send(s){const o=JSON.stringify(s.body);s.headers["Bugsnag-Sent-At"]=e.date().toISOString();try{const c=await n(a,{method:"POST",keepalive:r,body:o,headers:s.headers});return{state:QOe(c.status),samplingProbability:wMe(c.headers)}}catch{return o.length>1e6?{state:"failure-discard"}:{state:"failure-retryable"}}}}}}function bP(n){return n}function kMe(n){return typeof n=="function"}class GU{constructor(){this.callbacks=[]}onStart(e){this.callbacks.push(e)}start(e){const t=[];for(const r of this.callbacks){const i=r(e);i&&t.push(i)}return{onRequestEnd:r=>{for(const i of t)i&&i.onRequestEnd&&i.onRequestEnd(r)},extraRequestHeaders:t.map(r=>{if(r&&r.extraRequestHeaders)return r.extraRequestHeaders}).filter(SMe)}}}function SMe(n){return n!==void 0}function xP(n,e){if(n.indexOf("https://")===0||n.indexOf("http://")===0)return n;try{const t=new URL(n,e).href;return!n.endsWith("/")&&t.endsWith("/")?t.slice(0,-1):t}catch{return n}}function TMe(n,e,t,r){const i=KU(e),a=i?e.url:String(e),s=!!t&&t.method||i&&e.method||"GET";return{url:xP(a,r),method:s,startTime:n,type:"fetch"}}function KU(n){return!!n&&typeof n=="object"&&!(n instanceof URL)}function EMe(n){return!!n&&typeof n=="object"&&n instanceof Headers}function PMe(n,e){const t=new GU,r=n.fetch;return n.fetch=function(a,s){const o=TMe(e.now(),a,s,n.document&&n.document.baseURI),{onRequestEnd:c,extraRequestHeaders:u}=t.start(o),l=RMe(a,s,u);return r.call(this,l[0],l[1]).then(d=>(c({status:d.status,endTime:e.now(),state:"success"}),d)).catch(d=>{throw c({error:d,endTime:e.now(),state:"error"}),d})},t}function RMe(n,e,t){if(!t)return[n,e];const r=t.reduce((i,a)=>({...i,...a}),{});return KU(n)&&(!e||!e.headers)?AMe(r,n):e=IMe(r,e),[n,e]}function AMe(n,e){for(const[t,r]of Object.entries(n))e.headers.has(t)||e.headers.set(t,r)}function IMe(n,e){if(e||(e={}),EMe(e.headers)){for(const[t,r]of Object.entries(n))e.headers.has(t)||e.headers.set(t,r);return e}else return{...e,headers:{...n,...e.headers}}}function OMe(n,e,t){const r=new GU,i=new WeakMap,a=new WeakMap,s=n.prototype.open;n.prototype.open=function(u,l,...d){i.set(this,{method:u,url:xP(String(l),t&&t.baseURI)}),s.call(this,u,l,...d)};const o=n.prototype.send;return n.prototype.send=function(u){const l=i.get(this);if(l){const d=a.get(this);d&&this.removeEventListener("readystatechange",d);const{onRequestEnd:h,extraRequestHeaders:p}=r.start({type:"xmlhttprequest",method:l.method,url:l.url,startTime:e.now()});if(p)for(const v of p)for(const[y,b]of Object.entries(v))this.setRequestHeader(y,b);const g=v=>{if(this.readyState===n.DONE&&h){const y=this.status>0?{endTime:e.now(),status:this.status,state:"success"}:{endTime:e.now(),state:"error"};h(y)}};this.addEventListener("readystatechange",g),a.set(this,g)}o.call(this,u)},r}const Sp={referrer:!0,title:!0,url:!0};function YU(n){return{...Sp,...n}}function MMe(n){const e=["undefined","boolean"],t=Object.keys(Sp);return lc(n)&&t.every(r=>e.includes(typeof n[r]))}function DMe(n,e){return n===void 0||e===void 0||n===0&&e===0}const NMe=(n,e,t,r)=>{function i(o,c,u){if(DMe(c,u))return;const l=n.startSpan(`[PageLoadPhase/${o}]${t}`,{startTime:c,parentContext:r,makeCurrentContext:!1});l.setAttribute("bugsnag.span.category","page_load_phase"),l.setAttribute("bugsnag.phase",o),n.endSpan(l,u)}const a=e.getEntriesByType("navigation"),s=Array.isArray(a)&&a[0];if(s){i("Unload",s.unloadEventStart,s.unloadEventEnd),i("Redirect",s.redirectStart,s.redirectEnd),i("LoadFromCache",s.fetchStart,s.domainLookupStart),i("DNSLookup",s.domainLookupStart,s.domainLookupEnd);const o=s.secureConnectionStart||s.connectEnd;i("TCPHandshake",s.connectStart,o),i("TLS",s.secureConnectionStart,s.connectEnd),i("HTTPRequest",s.requestStart,s.responseStart),i("HTTPResponse",s.responseStart,s.responseEnd),i("DomContentLoadedEvent",s.domContentLoadedEventStart,s.domContentLoadedEventEnd),i("LoadEvent",s.loadEventStart,s.loadEventEnd)}},ff=n=>n.pathname||"/",LMe=()=>class{constructor(e=ff){this.resolveRoute=e}listenForRouteChanges(e){}},FMe=(n,e)=>class{constructor(r=ff){this.resolveRoute=r}listenForRouteChanges(r){addEventListener("popstate",a=>{const s=new URL(e.href),o=r(s,"popstate");n(c=>{o.end(c)})});const i=history.pushState;history.pushState=function(...a){const s=a[2];if(s){const o=new URL(xP(s.toString(),document.baseURI)),c=r(o,"pushState");n(u=>{c.end(u)})}i.apply(this,a)}}};
3960class $Me{constructor(e,t,r,i,a,s,o){this.wasBackgrounded=!1,this.enabled=!1,this.routeResolver=ff,this.sendPageAttributes=Sp,this.document=e,this.location=t,this.spanFactory=r,this.webVitals=i,this.onSettle=a,this.performance=o,s.onStateChange(c=>{!this.wasBackgrounded&&c==="in-background"&&(this.wasBackgrounded=!0)})}install(e){if(!e.configuration.autoInstrumentFullPageLoads||this.wasBackgrounded)return;const{routingProvider:t,sendPageAttributes:r}=e.configuration;t&&(this.routeResolver=t.resolveRoute),r&&(this.sendPageAttributes=r),this.enabled=!0}start(){if(!this.enabled)return;let e=null;const t=document.querySelector('meta[name="traceparent"]');if(t!==null&&t.getAttribute("content")){const s=t.getAttribute("content"),[,o,c]=s.split("-");e={traceId:o,id:c}}const r=this.spanFactory.startSpan("[FullPageLoad]",{startTime:0,parentContext:e}),i=YU(this.sendPageAttributes||Sp),a=new URL(this.location.href);this.onSettle(s=>{if(this.wasBackgrounded)return;const o=this.routeResolver(a)||ff(a);r.name+=o,NMe(this.spanFactory,this.performance,o,r),r.setAttribute("bugsnag.span.category","full_page_load"),r.setAttribute("bugsnag.browser.page.route",o),i.referrer&&r.setAttribute("bugsnag.browser.page.referrer",this.document.referrer),i.title&&r.setAttribute("bugsnag.browser.page.title",this.document.title),i.url&&r.setAttribute("bugsnag.browser.page.url",a.toString()),this.webVitals.attachTo(r),this.spanFactory.endSpan(r,s),WU()==="starting"&&G_("ready")})}}const BMe=["http://","https://","/","./","../"];
3960class UMe{constructor(e,t,r,i){this.spanFactory=e,this.spanContextStorage=t,this.fetchTracker=r,this.xhrTracker=i,this.configEndpoint="",this.networkRequestCallback=bP,this.logger={debug:console.debug,warn:console.warn,info:console.info,error:console.error},this.enabled=!1,this.trackRequest=a=>{if(!this.shouldTrackRequest(a))return;const s=!1,o={url:a.url,type:a.type,propagateTraceContext:s},c=this.networkRequestCallback(o);if(!c)return{onRequestEnd:void 0,extraRequestHeaders:void 0};if(c.propagateTraceContext===void 0&&(c.propagateTraceContext=s),!c.url)return{onRequestEnd:void 0,extraRequestHeaders:c.propagateTraceContext?this.getExtraRequestHeaders():void 0};if(typeof c.url!="string"){this.logger.warn(`expected url to be a string following network request callback, got ${typeof c.url}`);return}const u=this.spanFactory.startNetworkSpan({method:a.method,startTime:a.startTime,url:c.url});return{onRequestEnd:l=>{l.state==="success"&&this.spanFactory.endSpan(u,l.endTime,{"http.status_code":l.status})},extraRequestHeaders:c.propagateTraceContext?this.getExtraRequestHeaders(u):void 0}}}install(e){if(!e.configuration.autoInstrumentNetworkRequests)return;const{endpoint:t,logger:r,networkRequestCallback:i}=e.configuration;r&&(this.logger=r),t&&(this.configEndpoint=t),i&&(this.networkRequestCallback=i),this.enabled=!0}start(){this.enabled&&(this.xhrTracker.onStart(this.trackRequest),this.fetchTracker.onStart(this.trackRequest))}shouldTrackRequest(e){return e.url!==this.configEndpoint&&BMe.some(t=>e.url.startsWith(t))}getExtraRequestHeaders(e=this.spanContextStorage.current){const t={};return e&&(t.traceparent=K_.toTraceParentString(e),t.tracestate=jMe(e.traceId)),t}}function jMe(n){return`sb=v:1;r32:${jU(n)}`}function qMe(n){switch(n){case"":return;case"http/1.0":return"1.0";case"http/1.1":return"1.1";case"h2":case"h2c":return"2.0";case"h3":return"3.0";case"spdy/1":case"spdy/2":case"spdy/3":return"SPDY";default:return n}}function zMe(n){return n&&Array.isArray(n.supportedEntryTypes)&&n.supportedEntryTypes.includes("resource")}class WMe{constructor(e,t,r){this.spanFactory=e,this.spanContextStorage=t,this.PerformanceObserverClass=r,this.enabled=!1,this.logger={debug:console.debug,warn:console.warn,info:console.info,error:console.error},this.networkRequestCallback=bP}install(e){if(!zMe(this.PerformanceObserverClass))return;const{logger:t,networkRequestCallback:r}=e.configuration;t&&(this.logger=t),r&&(this.networkRequestCallback=r),this.enabled=!0}start(){if(!this.enabled)return;const e=new this.PerformanceObserverClass(t=>{const r=t.getEntries();for(const i of r){if(i.initiatorType==="fetch"||i.initiatorType==="xmlhttprequest")continue;const a=this.spanContextStorage.first;if(a){const s=this.networkRequestCallback({url:i.name,type:i.initiatorType});if(!s)return;if(typeof s.url!="string"){this.logger.warn(`expected url to be a string following network request callback, got ${typeof s.url}`);return}let o="";try{const l=new URL(s.url);l.search="",o=l.href}catch{this.logger.warn(`Unable to parse URL returned from networkRequestCallback: ${s.url}`);return}const c=this.spanFactory.startSpan(`[ResourceLoad]${o}`,{parentContext:a,startTime:i.startTime,makeCurrentContext:!1});c.setAttribute("bugsnag.span.category","resource_load"),c.setAttribute("http.url",s.url);const u=qMe(i.nextHopProtocol);u&&c.setAttribute("http.flavor",u),i.encodedBodySize&&i.decodedBodySize&&(c.setAttribute("http.response_content_length",i.encodedBodySize),c.setAttribute("http.response_content_length_uncompressed",i.decodedBodySize)),i.responseStatus&&c.setAttribute("http.status_code",i.responseStatus),this.spanFactory.endSpan(c,i.responseEnd)}}});try{e.observe({type:"resource",buffered:!0})}catch{this.logger.warn("Unable to get previous resource loads as buffered observer not supported, only showing resource loads from this point on"),e.observe({entryTypes:["resource"]})}}}const{startTime:HMe,parentContext:VMe,makeCurrentContext:GMe}=qU,KMe={startTime:HMe,parentContext:VMe,makeCurrentContext:GMe,trigger:{getDefaultValue:n=>String(n),message:"should be a string",validate:h1}};class YMe{constructor(e,t,r){this.spanFactory=e,this.location=t,this.document=r,this.enabled=!1,this.sendPageAttributes=Sp,this.logger={debug:console.debug,warn:console.warn,info:console.info,error:console.error}}install(e){if(!e.configuration.autoInstrumentRouteChanges)return;const{logger:t,routingProvider:r,sendPageAttributes:i}=e.configuration;t&&(this.logger=t),r&&(this.routingProvider=r),i&&(this.sendPageAttributes=i),this.enabled=!0}start(){var e,t;if(!this.enabled)return;
3960const r=new URL(this.location.href);let i=((e=this.routingProvider)===null||e===void 0?void 0:e.resolveRoute(r))||ff(r);const a=YU(this.sendPageAttributes);(t=this.routingProvider)===null||t===void 0||t.listenForRouteChanges((s,o,c)=>{var u;let l;if(s instanceof URL)l=s;else try{const v=String(s);l=new URL(v)}catch{return this.logger.warn(`Invalid span options 3961 - url should be a URL`),{id:"",name:"",traceId:"",samplingRate:0,samplingProbability:0,isValid:()=>!1,setAttribute:()=>{},end:()=>{}}}G_("navigating");const d={...c,trigger:o},h=this.spanFactory.validateSpanOptions("[RouteChange]",d,KMe),p=((u=this.routingProvider)===null||u===void 0?void 0:u.resolveRoute(l))||ff(l);h.name+=p;const g=this.spanFactory.startSpan(h.name,h.options);return g.setAttribute("bugsnag.span.category","route_change"),g.setAttribute("bugsnag.browser.page.route",p),g.setAttribute("bugsnag.browser.page.previous_route",i),g.setAttribute("bugsnag.browser.page.route_change.trigger",h.options.trigger),a.url&&g.setAttribute("bugsnag.browser.page.url",s.toString()),i=p,{get id(){return g.id},get traceId(){return g.traceId},get samplingRate(){return g.samplingRate},get samplingProbability(){return g.samplingProbability},get name(){return g.name},isValid:g.isValid,setAttribute:g.setAttribute,end:v=>{var y;const b=lc(v)?v:{endTime:v};if(a.title&&g.setAttribute("bugsnag.browser.page.title",this.document.title),b.url){const x=XMe(b.url),S=((y=this.routingProvider)===null||y===void 0?void 0:y.resolveRoute(x))||ff(x);g.name=`[RouteChange]${S}`,g.setAttribute("bugsnag.browser.page.route",S),i=S,a.url&&g.setAttribute("bugsnag.browser.page.url",x.toString())}this.spanFactory.toPublicApi(g).end(b.endTime),G_("ready")}}})}}function XMe(n){return typeof n=="string"?new URL(n):n}function JMe(n){const e=[];let t=n.document.visibilityState==="hidden"?"in-background":"in-foreground";const r={onStateChange(a){e.push(a),t==="in-background"&&a(t)}},i=a=>{if(t!==a){t=a;for(const s of e)s(t)}};return n.document.addEventListener("visibilitychange",function(){const a=n.document.visibilityState==="hidden"?"in-background":"in-foreground";i(a)}),n.addEventListener("pagehide",function(){i("in-background")}),n.addEventListener("pageshow",function(){i("in-foreground")}),r}const QMe=3e5;function kM(n,e){return Math.abs(Date.now()-(n+e.now()))>QMe?Date.now()-e.now():n}function ZMe(n,e){const t=n.timeOrigin===void 0?n.timing.navigationStart:n.timeOrigin;let r=kM(t,n);e.onStateChange(a=>{a==="in-foreground"&&(r=kM(r,n))});const i=a=>UU(r+a);return{now:()=>n.now(),date:()=>new Date(r+n.now()),convert:a=>a.getTime()-r,toUnixNanoseconds:i,toUnixTimestampNanoseconds:a=>i(a).toString()}}const eDe=n=>lc(n)&&typeof n.resolveRoute=="function"&&typeof n.listenForRouteChanges=="function";function tDe(n,e){return{..._2,releaseStage:{..._2.releaseStage,defaultValue:n==="localhost"?"development":"production"},autoInstrumentFullPageLoads:{defaultValue:!0,message:"should be true|false",validate:Ih},autoInstrumentNetworkRequests:{defaultValue:!0,message:"should be true|false",validate:Ih},autoInstrumentRouteChanges:{defaultValue:!0,message:"should be true|false",validate:Ih},generateAnonymousId:{defaultValue:!0,message:"should be true|false",validate:Ih},routingProvider:{defaultValue:e,message:"should be a routing provider",validate:eDe},settleIgnoreUrls:{defaultValue:[],message:"should be an array of string|RegExp",validate:AOe},networkRequestCallback:{defaultValue:bP,message:"should be a function",validate:kMe},sendPageAttributes:{defaultValue:Sp,message:"should be an object",validate:MMe},serviceName:{defaultValue:"unknown_service",message:"should be a string",validate:rp}}}function nDe(n){const e=n.toString(16);return e.length===1?"0"+e:e}const rDe={generate(n){const e=new Uint8Array(n/8),t=window.crypto.getRandomValues(e);return Array.from(t).map(nDe).join("")}};class p1{constructor(e){this.settled=!1,this.callbacks=new Set,this.clock=e}subscribe(e){this.callbacks.add(e),this.isSettled()&&e(this.clock.now())}unsubscribe(e){this.callbacks.delete(e)}isSettled(){return this.settled}settle(e){this.settled=!0;
3961for(const t of this.callbacks)t(e)}}class iDe extends p1{constructor(e,t){super(e),this.timeout=void 0,new MutationObserver(()=>{this.restart()}).observe(t,{subtree:!0,childList:!0,characterData:!0}),this.restart()}restart(){clearTimeout(this.timeout),this.settled=!1;const e=this.clock.now();this.timeout=setTimeout(()=>{this.settle(e)},100)}}function aDe(n){return!!n&&n.entryType==="navigation"}class sDe extends p1{constructor(e,t,r,i){super(e),i.readyState==="complete"?setTimeout(()=>{this.settleUsingPerformance(r)},0):t("load",()=>{setTimeout(()=>{this.settleUsingPerformance(r)},0)})}settleUsingPerformance(e){const t=this.clock.now(),r=typeof e.getEntriesByType=="function"?e.getEntriesByType("navigation")[0]:void 0;let i=0;aDe(r)?i=r.loadEventEnd:e.timing&&(i=e.timing.loadEventEnd-e.timing.navigationStart),(i<=0||i>t)&&(i=t),this.settle(i)}}class SM extends p1{constructor(e,t){super(e),this.timeout=void 0,this.urlsToIgnore=[],this.outstandingRequests=0,this.settled=!0,t.onStart(this.onRequestStart.bind(this))}setUrlsToIgnore(e){this.urlsToIgnore=e}onRequestStart(e){if(!this.shouldIgnoreUrl(e.url))return clearTimeout(this.timeout),this.settled=!1,++this.outstandingRequests,{onRequestEnd:t=>{if(--this.outstandingRequests===0){const r=this.clock.now();this.timeout=setTimeout(()=>{this.settle(r)},100)}}}}shouldIgnoreUrl(e){return this.urlsToIgnore.some(t=>t.test(e))}}class oDe extends p1{constructor(e,t){super(e),this.settlers=t;for(const r of t)r.subscribe(i=>{this.settlersAreSettled()?this.settle(i):this.settled=!1})}isSettled(){return super.isSettled()&&this.settlersAreSettled()}settlersAreSettled(){for(const e of this.settlers)if(!e.isSettled())return!1;return!0}}const cDe=60*1e3;function uDe(){const n=()=>{};return n.install=()=>{},n.start=()=>{},n}function lDe(n,e,t,r,i){const a=new iDe(n,e.document),s=new SM(n,t),o=new SM(n,r),c=new sDe(n,e.addEventListener,i,e.document),u=new oDe(n,[a,c,s,o]);function l(d){const h=y=>{clearTimeout(p),u.unsubscribe(h),d(y)},p=setTimeout(()=>{const y=n.now();u.unsubscribe(h),d(y)},cDe),g=u.isSettled()?100:0,v=n.now();setTimeout(()=>{u.isSettled()?h(v):u.subscribe(h)},g)}return l.install=function(d){const h=[];d.configuration.endpoint&&h.push(RegExp(d.configuration.endpoint)),d.configuration.settleIgnoreUrls&&h.push(...d.configuration.settleIgnoreUrls.map(p=>typeof p=="string"?RegExp(p):p)),s.setUrlsToIgnore(h),o.setUrlsToIgnore(h)},l.start=function(){},l}function dDe(n){try{if(n.localStorage)return new hDe(n.localStorage)}catch{}return new vMe}function fDe(n,e){switch(n){case"bugsnag-sampling-probability":return JSON.stringify(e);case"bugsnag-anonymous-id":return e;default:return n}}class hDe{constructor(e){this.storage=e}async load(e){try{const t=this.storage.getItem(e);if(t)return yMe(e,t)}catch{}}async save(e,t){try{this.storage.setItem(e,fDe(e,t))}catch{}}}function pDe(n,e){let t,r;return function(a){const s=new FOe(a.releaseStage,a.appVersion,a.serviceName,"bugsnag.performance.browser","2.14.0",a.logger);if(s.set("browser.user_agent",n.userAgent),n.userAgentData&&(s.set("browser.platform",n.userAgentData.platform),s.set("browser.mobile",n.userAgentData.mobile)),a.generateAnonymousId)if(t||(t=e.load("bugsnag-anonymous-id").then(o=>{const c=o||VU();return o||e.save("bugsnag-anonymous-id",c),r=c,r})),r)s.set("device.id",r);else return t.then(o=>(s.set("device.id",o),s));return Promise.resolve(s)}}const mDe=n=>{const e={url:{name:"bugsnag.browser.page.url",getValue:()=>n.location.href,permitted:!1},title:{name:"bugsnag.browser.page.title",getValue:()=>n.title,permitted:!1}};return{configure(t){e.title.permitted=t.sendPageAttributes.title||!1,e.url.permitted=t.sendPageAttributes.url||!1},requestAttributes(t){for(const r of Object.values(e))r.permitted&&t.setAttribute(r.name,r.getValue())}}};class gDe{constructor(e,t,r){if(this.performance=e,this.clock=t,this.observers=[],r&&Array.isArray(r.supportedEntryTypes)){const i=r.supportedEntryTypes;i.includes("largest-contentful-paint")&&this.observeLargestContentfulPaint(r),i.includes("layout-shift")&&this.observeLayoutShift(r)}}attachTo(e){const t=this.firstContentfulPaint();t&&e.addEvent("fcp",t);const r=this.timeToFirstByte();r&&e.addEvent("ttfb",r);const i=this.firstInputDelay();i&&(e.addEvent("fid_start",i.start),e.addEvent("fid_end",i.end)),this.cumulativeLayoutShift&&e.setAttribute("bugsnag.metrics.cls",this.cumulativeLayoutShift),this.largestContentfulPaint&&e.addEvent("lcp",this.largestContentfulPaint);for(const a of this.observers)a.disconnect()}firstContentfulPaint(){const e=this.performance.getEntriesByName("first-contentful-paint","paint"),t=Array.isArray(e)&&e[0];if(t)return t.startTime}timeToFirstByte(){const e=this.performance.getEntriesByType("navigation"),t=Array.isArray(e)&&e[0];let r;if(t?r=t.responseStart:r=this.performance.timing.responseStart-this.performance.timing.navigationStart,r>0&&r<=this.clock.now())return r}firstInputDelay(){const e=this.performance.getEntriesByType("first-input"),t=Array.isArray(e)&&e[0];if(t)return{start:t.startTime,end:t.processingStart}}observeLargestContentfulPaint(e){const t=new e(r=>{const i=r.getEntries();i.length>0&&(this.largestContentfulPaint=i[i.length-1].startTime)});t.observe({type:"largest-contentful-paint",buffered:!0}),this.observers.push(t)}observeLayoutShift(e){let t;const r=new e(i=>{for(const a of i.getEntries())a.hadRecentInput||(t&&a.startTime-t.previousStartTime<1e3&&a.startTime-t.firstStartTime<5e3?(t.value+=a.value,t.previousStartTime=a.startTime):t={value:a.value,firstStartTime:a.startTime,previousStartTime:a.startTime});t&&(this.cumulativeLayoutShift===void 0||t.value>this.cumulativeLayoutShift)&&(this.cumulativeLayoutShift=t.value)});r.observe({type:"layout-shift",buffered:!0}),this.observers.push(r)}}let Mm,xC,k2;if(typeof window>"u"||typeof document>"u")Mm=uDe(),xC=LMe(),k2=uMe();else{const n=JMe(window),e=mDe(document),t=ZMe(performance,n),r=dDe(window),i=pDe(navigator,r),a=PMe(window,t),s=OMe(XMLHttpRequest,t,document),o=new gDe(performance,t,window.PerformanceObserver);Mm=lDe(t,window,a,s,performance),xC=FMe(Mm,window.location),k2=cMe({backgroundingListener:n,clock:t,resourceAttributesSource:i,spanAttributesSource:e,deliveryFactory:CMe(window.fetch,t,n),idGenerator:rDe,schema:tDe(window.location.hostname,new xC),plugins:(c,u)=>[Mm,new $Me(document,window.location,c,o,Mm,n,performance),new WMe(c,u,window.PerformanceObserver),new UMe(c,u,a,s),new YMe(c,window.location,document)],persistence:r,retryQueueFactory:(c,u)=>new bMe(c,u)})}const vDe=k2;{hM.start({apiKey:"22d201d20259173f98fef3f15f005499",appVersion:"db07f087418bf16e5fc4f25e5f3e92bd144e06de",plugins:[new SOe],collectUserIp:!1,enabledReleaseStages:["production"]}),vDe.start({apiKey:"22d201d20259173f98fef3f15f005499",appVersion:"db07f087418bf16e5fc4f25e5f3e92bd144e06de",enabledReleaseStages:["production"]});const n=hM.getPlugin("vue");n&&n.installVueErrorHandler(pn)}pn.mixin({methods:{route,$trans:ri.trans,$__:ri.__,$transChoice:ri.transChoice,$setLocale(n){ri.set
3961Locale(n),this.$forceUpdate()},$locale(){},$locales(){return ri.locales()}}});pn.use(tee);pn.use(Z4e);pn.component("inertia-link",oS);navigator.language==="da"||navigator.language==="da-DK"?ri.setLocale("da-DK"):ri.setLocale("en");const yDe=Object.assign({"./Pages/API/ApiTokenManager.vue":xH,"./Pages/API/Index.vue":tV,"./Pages/Admin/ActivityLog/Index.vue":wV,"./Pages/Admin/ApiKeys/Create.vue":oee,"./Pages/Admin/ApiKeys/Index.vue":hee,"./Pages/Admin/Away/Applications/ApplicationRow.vue":Wce,"./Pages/Admin/Away/Applications/Index.vue":Xce,"./Pages/Admin/Away/Applications/UpdateImage.vue":Bce,"./Pages/Admin/Away/Game/Create.vue":rhe,"./Pages/Admin/Away/Game/Edit.vue":uhe,"./Pages/Admin/Away/Game/Index.vue":mhe,"./Pages/Admin/Away/Game/Show.vue":xhe,"./Pages/Admin/Away/Quarantine/Create.vue":Ihe,"./Pages/Admin/Away/Quarantine/DownloadImagesModal.vue":sV,"./Pages/Admin/Away/Quarantine/Edit.vue":Fhe,"./Pages/Admin/Away/Quarantine/Index.vue":zhe,"./Pages/Admin/Away/Quarantine/Show.vue":Yhe,"./Pages/Admin/Away/Scan/Index.vue":tpe,"./Pages/Admin/Away/Scan/Show.vue":ope,"./Pages/Admin/Away/Season/Create.vue":qpe,"./Pages/Admin/Away/Season/Index.vue":Kpe,"./Pages/Admin/Away/Team/Create.vue":eme,"./Pages/Admin/Away/Team/Index.vue":sme,"./Pages/Admin/Away/Tournament/Create.vue":fme,"./Pages/Admin/Away/Tournament/Index.vue":yme,"./Pages/Admin/Dashboard.vue":kme,"./Pages/Admin/DesignBoard.vue":Ame,"./Pages/Admin/EcashLookup.vue":Ume,"./Pages/Admin/Entitlements/Index.vue":Vme,"./Pages/Admin/Exports/Subscriptions.vue":Qme,"./Pages/Admin/FckAway.vue":ige,"./Pages/Admin/LiveUsers.vue":kge,"./Pages/Admin/Roles/Create.vue":Age,"./Pages/Admin/Roles/Edit.vue":Lge,"./Pages/Admin/Roles/Index.vue":qge,"./Pages/Admin/Statistics.vue":Zge,"./Pages/Admin/VideoSessions/Index.vue":ave,"./Pages/AgreementForm.vue":dve,"./Pages/Agreements.vue":wve,"./Pages/Auth/ConfirmPassword.vue":Pve,"./Pages/Auth/ForgotPassword.vue":Bve,"./Pages/Auth/Login.vue":Yve,"./Pages/Auth/Register.vue":s0e,"./Pages/Auth/ResetPassword.vue":v0e,"./Pages/Auth/TicketsLogin.vue":C0e,"./Pages/Auth/TwoFactorChallenge.vue":R0e,"./Pages/Auth/VerifyEmail.vue":U0e,"./Pages/Auth/WebshopLogin.vue":V0e,"./Pages/Auth/Welcome.vue":rye,"./Pages/Commentary/Broadcast.vue":Gxe,"./Pages/Commentary/Broadcasts.vue":Zxe,"./Pages/Commentary/Player.vue":swe,"./Pages/Companies/Index.vue":fwe,"./Pages/Companies/Show.vue":ywe,"./Pages/Dashboard.vue":CCe,"./Pages/Plus.vue":MCe,"./Pages/PrivacyPolicy.vue":BCe,"./Pages/Profile/Away.vue":YPe,"./Pages/Profile/DeleteUserForm.vue":eRe,"./Pages/Profile/LogoutOtherBrowserSessionsForm.vue":hRe,"./Pages/Profile/PermissionsForm.vue":NRe,"./Pages/Profile/SeasonTicketUsage.vue":HRe,"./Pages/Profile/Show.vue":kAe,"./Pages/Profile/Tickets.vue":KAe,"./Pages/Profile/TwoFactorAuthenticationForm.vue":XRe,"./Pages/Profile/UpdatePasswordForm.vue":tAe,"./Pages/Profile/UpdateProfileInformationForm.vue":sAe,"./Pages/Profile/Webshop.vue":i3e,"./Pages/TermsOfService.vue":l3e,"./Pages/UpdateAddressGate.vue":g3e,"./Pages/Users/DeleteUserForm.vue":x3e,"./Pages/Users/Edit.vue":G3e,"./Pages/Users/Index.vue":Z3e,"./Pages/Users/Show.vue":A4e,"./Pages/Users/UpdateExternalProfiles.vue":j3e,"./Pages/Users/UpdateUserInformationForm.vue":T3e,"./Pages/Users/UpdateUserPassword.vue":I3e,"./Pages/Users/UpdateUserRoles.vue":L3e,"./Pages/Welcome.vue":L4e}),TM=document.getElementById("app");new pn({render:n=>n(eee,{props:{initialPage:JSON.parse(TM.dataset.page),resolveComponent:e=>{const t=yDe[`./Pages/${e}.vue`];if(!t)throw new Error(`Page not found: ${e}`);return t.default}}})}).$mount(TM)});export default _De();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.