import{a as Al}from"./chunk-BZUL2CAN.js";import{a as ne,b as Be,c as wa,d as Kx,e as qr,f as ps,g as su,h as _l,i as Nt}from"./chunk-3V74GZ4F.js";var o6=ps((Yce,n6)=>{"use strict";var Vd=Object.prototype.hasOwnProperty,i6=Object.prototype.toString,Gk=Object.defineProperty,Kk=Object.getOwnPropertyDescriptor,Jk=function(e){return typeof Array.isArray=="function"?Array.isArray(e):i6.call(e)==="[object Array]"},e6=function(e){if(!e||i6.call(e)!=="[object Object]")return!1;var r=Vd.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Vd.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!i)return!1;var n;for(n in e);return typeof n=="undefined"||Vd.call(e,n)},t6=function(e,r){Gk&&r.name==="__proto__"?Gk(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},r6=function(e,r){if(r==="__proto__")if(Vd.call(e,r)){if(Kk)return Kk(e,r).value}else return;return e[r]};n6.exports=function t(){var e,r,i,n,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l{});var xO=ps((wO,DR)=>{(function(t,e){typeof wO=="object"?DR.exports=wO=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(wO,function(){var t=t||function(e,r){var i;if(typeof window!="undefined"&&window.crypto&&(i=window.crypto),typeof self!="undefined"&&self.crypto&&(i=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window!="undefined"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global!="undefined"&&global.crypto&&(i=global.crypto),!i&&typeof wa=="function")try{i=MR()}catch(k){}var n=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch(k){}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch(k){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function k(){}return function(C){var R;return k.prototype=C,R=new k,k.prototype=null,R}}(),s={},a=s.lib={},l=a.Base=function(){return{extend:function(k){var C=o(this);return k&&C.mixIn(k),(!C.hasOwnProperty("init")||this.init===C.init)&&(C.init=function(){C.$super.init.apply(this,arguments)}),C.init.prototype=C,C.$super=this,C},create:function(){var k=this.extend();return k.init.apply(k,arguments),k},init:function(){},mixIn:function(k){for(var C in k)k.hasOwnProperty(C)&&(this[C]=k[C]);k.hasOwnProperty("toString")&&(this.toString=k.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),c=a.WordArray=l.extend({init:function(k,C){k=this.words=k||[],C!=r?this.sigBytes=C:this.sigBytes=k.length*4},toString:function(k){return(k||f).stringify(this)},concat:function(k){var C=this.words,R=k.words,Q=this.sigBytes,z=k.sigBytes;if(this.clamp(),Q%4)for(var L=0;L>>2]>>>24-L%4*8&255;C[Q+L>>>2]|=Z<<24-(Q+L)%4*8}else for(var re=0;re>>2]=R[re>>>2];return this.sigBytes+=z,this},clamp:function(){var k=this.words,C=this.sigBytes;k[C>>>2]&=4294967295<<32-C%4*8,k.length=e.ceil(C/4)},clone:function(){var k=l.clone.call(this);return k.words=this.words.slice(0),k},random:function(k){for(var C=[],R=0;R>>2]>>>24-z%4*8&255;Q.push((L>>>4).toString(16)),Q.push((L&15).toString(16))}return Q.join("")},parse:function(k){for(var C=k.length,R=[],Q=0;Q>>3]|=parseInt(k.substr(Q,2),16)<<24-Q%8*4;return new c.init(R,C/2)}},d=u.Latin1={stringify:function(k){for(var C=k.words,R=k.sigBytes,Q=[],z=0;z>>2]>>>24-z%4*8&255;Q.push(String.fromCharCode(L))}return Q.join("")},parse:function(k){for(var C=k.length,R=[],Q=0;Q>>2]|=(k.charCodeAt(Q)&255)<<24-Q%4*8;return new c.init(R,C)}},p=u.Utf8={stringify:function(k){try{return decodeURIComponent(escape(d.stringify(k)))}catch(C){throw new Error("Malformed UTF-8 data")}},parse:function(k){return d.parse(unescape(encodeURIComponent(k)))}},O=a.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(k){typeof k=="string"&&(k=p.parse(k)),this._data.concat(k),this._nDataBytes+=k.sigBytes},_process:function(k){var C,R=this._data,Q=R.words,z=R.sigBytes,L=this.blockSize,Z=L*4,re=z/Z;k?re=e.ceil(re):re=e.max((re|0)-this._minBufferSize,0);var H=re*L,q=e.min(H*4,z);if(H){for(var oe=0;oe{(function(t,e){typeof kO=="object"?UR.exports=kO=e(xO()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(kO,function(t){return function(e){var r=t,i=r.lib,n=i.WordArray,o=i.Hasher,s=r.algo,a=[];(function(){for(var p=0;p<64;p++)a[p]=e.abs(e.sin(p+1))*4294967296|0})();var l=s.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(p,O){for(var w=0;w<16;w++){var x=O+w,k=p[x];p[x]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}var C=this._hash.words,R=p[O+0],Q=p[O+1],z=p[O+2],L=p[O+3],Z=p[O+4],re=p[O+5],H=p[O+6],q=p[O+7],oe=p[O+8],pe=p[O+9],fe=p[O+10],ge=p[O+11],ve=p[O+12],Qe=p[O+13],se=p[O+14],he=p[O+15],K=C[0],_=C[1],G=C[2],ae=C[3];K=c(K,_,G,ae,R,7,a[0]),ae=c(ae,K,_,G,Q,12,a[1]),G=c(G,ae,K,_,z,17,a[2]),_=c(_,G,ae,K,L,22,a[3]),K=c(K,_,G,ae,Z,7,a[4]),ae=c(ae,K,_,G,re,12,a[5]),G=c(G,ae,K,_,H,17,a[6]),_=c(_,G,ae,K,q,22,a[7]),K=c(K,_,G,ae,oe,7,a[8]),ae=c(ae,K,_,G,pe,12,a[9]),G=c(G,ae,K,_,fe,17,a[10]),_=c(_,G,ae,K,ge,22,a[11]),K=c(K,_,G,ae,ve,7,a[12]),ae=c(ae,K,_,G,Qe,12,a[13]),G=c(G,ae,K,_,se,17,a[14]),_=c(_,G,ae,K,he,22,a[15]),K=u(K,_,G,ae,Q,5,a[16]),ae=u(ae,K,_,G,H,9,a[17]),G=u(G,ae,K,_,ge,14,a[18]),_=u(_,G,ae,K,R,20,a[19]),K=u(K,_,G,ae,re,5,a[20]),ae=u(ae,K,_,G,fe,9,a[21]),G=u(G,ae,K,_,he,14,a[22]),_=u(_,G,ae,K,Z,20,a[23]),K=u(K,_,G,ae,pe,5,a[24]),ae=u(ae,K,_,G,se,9,a[25]),G=u(G,ae,K,_,L,14,a[26]),_=u(_,G,ae,K,oe,20,a[27]),K=u(K,_,G,ae,Qe,5,a[28]),ae=u(ae,K,_,G,z,9,a[29]),G=u(G,ae,K,_,q,14,a[30]),_=u(_,G,ae,K,ve,20,a[31]),K=f(K,_,G,ae,re,4,a[32]),ae=f(ae,K,_,G,oe,11,a[33]),G=f(G,ae,K,_,ge,16,a[34]),_=f(_,G,ae,K,se,23,a[35]),K=f(K,_,G,ae,Q,4,a[36]),ae=f(ae,K,_,G,Z,11,a[37]),G=f(G,ae,K,_,q,16,a[38]),_=f(_,G,ae,K,fe,23,a[39]),K=f(K,_,G,ae,Qe,4,a[40]),ae=f(ae,K,_,G,R,11,a[41]),G=f(G,ae,K,_,L,16,a[42]),_=f(_,G,ae,K,H,23,a[43]),K=f(K,_,G,ae,pe,4,a[44]),ae=f(ae,K,_,G,ve,11,a[45]),G=f(G,ae,K,_,he,16,a[46]),_=f(_,G,ae,K,z,23,a[47]),K=d(K,_,G,ae,R,6,a[48]),ae=d(ae,K,_,G,q,10,a[49]),G=d(G,ae,K,_,se,15,a[50]),_=d(_,G,ae,K,re,21,a[51]),K=d(K,_,G,ae,ve,6,a[52]),ae=d(ae,K,_,G,L,10,a[53]),G=d(G,ae,K,_,fe,15,a[54]),_=d(_,G,ae,K,Q,21,a[55]),K=d(K,_,G,ae,oe,6,a[56]),ae=d(ae,K,_,G,he,10,a[57]),G=d(G,ae,K,_,H,15,a[58]),_=d(_,G,ae,K,Qe,21,a[59]),K=d(K,_,G,ae,Z,6,a[60]),ae=d(ae,K,_,G,ge,10,a[61]),G=d(G,ae,K,_,z,15,a[62]),_=d(_,G,ae,K,pe,21,a[63]),C[0]=C[0]+K|0,C[1]=C[1]+_|0,C[2]=C[2]+G|0,C[3]=C[3]+ae|0},_doFinalize:function(){var p=this._data,O=p.words,w=this._nDataBytes*8,x=p.sigBytes*8;O[x>>>5]|=128<<24-x%32;var k=e.floor(w/4294967296),C=w;O[(x+64>>>9<<4)+15]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360,O[(x+64>>>9<<4)+14]=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,p.sigBytes=(O.length+1)*4,this._process();for(var R=this._hash,Q=R.words,z=0;z<4;z++){var L=Q[z];Q[z]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return R},clone:function(){var p=o.clone.call(this);return p._hash=this._hash.clone(),p}});function c(p,O,w,x,k,C,R){var Q=p+(O&w|~O&x)+k+R;return(Q<>>32-C)+O}function u(p,O,w,x,k,C,R){var Q=p+(O&x|w&~x)+k+R;return(Q<>>32-C)+O}function f(p,O,w,x,k,C,R){var Q=p+(O^w^x)+k+R;return(Q<>>32-C)+O}function d(p,O,w,x,k,C,R){var Q=p+(w^(O|~x))+k+R;return(Q<>>32-C)+O}r.MD5=o._createHelper(l),r.HmacMD5=o._createHmacHelper(l)}(Math),t.MD5})});var BR=ps((SO,jR)=>{(function(t,e){typeof SO=="object"?jR.exports=SO=e(xO()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(SO,function(t){return function(e){var r=t,i=r.lib,n=i.WordArray,o=i.Hasher,s=r.algo,a=[],l=[];(function(){function f(w){for(var x=e.sqrt(w),k=2;k<=x;k++)if(!(w%k))return!1;return!0}function d(w){return(w-(w|0))*4294967296|0}for(var p=2,O=0;O<64;)f(p)&&(O<8&&(a[O]=d(e.pow(p,1/2))),l[O]=d(e.pow(p,1/3)),O++),p++})();var c=[],u=s.SHA256=o.extend({_doReset:function(){this._hash=new n.init(a.slice(0))},_doProcessBlock:function(f,d){for(var p=this._hash.words,O=p[0],w=p[1],x=p[2],k=p[3],C=p[4],R=p[5],Q=p[6],z=p[7],L=0;L<64;L++){if(L<16)c[L]=f[d+L]|0;else{var Z=c[L-15],re=(Z<<25|Z>>>7)^(Z<<14|Z>>>18)^Z>>>3,H=c[L-2],q=(H<<15|H>>>17)^(H<<13|H>>>19)^H>>>10;c[L]=re+c[L-7]+q+c[L-16]}var oe=C&R^~C&Q,pe=O&w^O&x^w&x,fe=(O<<30|O>>>2)^(O<<19|O>>>13)^(O<<10|O>>>22),ge=(C<<26|C>>>6)^(C<<21|C>>>11)^(C<<7|C>>>25),ve=z+ge+oe+l[L]+c[L],Qe=fe+pe;z=Q,Q=R,R=C,C=k+ve|0,k=x,x=w,w=O,O=ve+Qe|0}p[0]=p[0]+O|0,p[1]=p[1]+w|0,p[2]=p[2]+x|0,p[3]=p[3]+k|0,p[4]=p[4]+C|0,p[5]=p[5]+R|0,p[6]=p[6]+Q|0,p[7]=p[7]+z|0},_doFinalize:function(){var f=this._data,d=f.words,p=this._nDataBytes*8,O=f.sigBytes*8;return d[O>>>5]|=128<<24-O%32,d[(O+64>>>9<<4)+14]=e.floor(p/4294967296),d[(O+64>>>9<<4)+15]=p,f.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var f=o.clone.call(this);return f._hash=this._hash.clone(),f}});r.SHA256=o._createHelper(u),r.HmacSHA256=o._createHmacHelper(u)}(Math),t.SHA256})});var qR=ps((TO,VR)=>{(function(t,e){typeof TO=="object"?VR.exports=TO=e(xO()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(TO,function(t){return function(){var e=t,r=e.lib,i=r.WordArray,n=e.enc,o=n.Base64={stringify:function(a){var l=a.words,c=a.sigBytes,u=this._map;a.clamp();for(var f=[],d=0;d>>2]>>>24-d%4*8&255,O=l[d+1>>>2]>>>24-(d+1)%4*8&255,w=l[d+2>>>2]>>>24-(d+2)%4*8&255,x=p<<16|O<<8|w,k=0;k<4&&d+k*.75>>6*(3-k)&63));var C=u.charAt(64);if(C)for(;f.length%4;)f.push(C);return f.join("")},parse:function(a){var l=a.length,c=this._map,u=this._reverseMap;if(!u){u=this._reverseMap=[];for(var f=0;f>>6-d%4*2,w=p|O;u[f>>>2]|=w<<24-f%4*8,f++}return i.create(u,f)}}(),t.enc.Base64})});var TL=ps((SL,vx)=>{(function(t){if(typeof SL=="object"&&typeof vx!="undefined")vx.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window!="undefined"?e=window:typeof global!="undefined"?e=global:typeof self!="undefined"?e=self:e=this,e.HyperList=t()}})(function(){var t,e,r;return function(){function i(n,o,s){function a(u,f){if(!o[u]){if(!n[u]){var d=typeof wa=="function"&&wa;if(!f&&d)return d(u,!0);if(l)return l(u,!0);var p=new Error("Cannot find module '"+u+"'");throw p.code="MODULE_NOT_FOUND",p}var O=o[u]={exports:{}};n[u][0].call(O.exports,function(w){var x=n[u][1][w];return a(x||w)},O,O.exports,i,n,o,s)}return o[u].exports}for(var l=typeof wa=="function"&&wa,c=0;cx._averageHeight){var Z=x._renderChunk();x._lastRepaint=Q,Z!==!1&&typeof k.afterRender=="function"&&k.afterRender()}}};C()}return s(p,[{key:"destroy",value:function(){window.cancelAnimationFrame(this._renderAnimationFrame)}},{key:"refresh",value:function(w,x){var k;if(Object.assign(this._config,c,x),!w||w.nodeType!==1)throw new Error("HyperList requires a valid DOM Node container");this._element=w;var C=this._config,R=this._scroller||C.scroller||document.createElement(C.scrollerTagName||"tr");if(typeof C.useFragment!="boolean"&&(this._config.useFragment=!0),!C.generate)throw new Error("Missing required `generate` function");if(!u(C.total))throw new Error("Invalid required `total` value, expected number");if(!Array.isArray(C.itemHeight)&&!u(C.itemHeight))throw new Error("\n Invalid required `itemHeight` value, expected number or array\n ".trim());u(C.itemHeight)?this._itemHeights=Array(C.total).fill(C.itemHeight):this._itemHeights=C.itemHeight,Object.keys(c).filter(function(Qe){return Qe in C}).forEach(function(Qe){var se=C[Qe],he=u(se);if(se&&typeof se!="string"&&typeof se!="number"){var K="Invalid optional `"+Qe+"`, expected string or number";throw new Error(K)}else he&&(C[Qe]=se+"px")});var Q=!!C.horizontal,z=C[Q?"width":"height"];if(z){var L=u(z),Z=L?!1:z.slice(-1)==="%",re=L?z:parseInt(z.replace(/px|%/,""),10),H=window[Q?"innerWidth":"innerHeight"];Z?this._containerSize=H*re/100:this._containerSize=u(z)?z:re}var q=C.scrollContainer,oe=C.itemHeight*C.total,pe=this._maxElementHeight;oe>pe&&console.warn(["HyperList: The maximum element height",pe+"px has","been exceeded; please reduce your item height."].join(" "));var fe={width:""+C.width,height:q?oe+"px":""+C.height,overflow:q?"none":"auto",position:"relative"};p.mergeStyle(w,fe),q&&p.mergeStyle(C.scrollContainer,{overflow:"auto"});var ge=(k={opacity:"0",position:"absolute"},a(k,Q?"height":"width","1px"),a(k,Q?"width":"height",oe+"px"),k);p.mergeStyle(R,ge),this._scroller||w.appendChild(R);var ve=this._computeScrollPadding();this._scrollPaddingBottom=ve.bottom,this._scrollPaddingTop=ve.top,this._scroller=R,this._scrollHeight=this._computeScrollHeight(),this._itemPositions=this._itemPositions||Array(C.total).fill(0),this._computePositions(0),this._renderChunk(this._lastRepaint!==null),typeof C.afterRender=="function"&&C.afterRender()}},{key:"_getRow",value:function(w){var x=this._config,k=x.generate(w),C=k.height;if(C!==void 0&&u(C)?(k=k.element,C!==this._itemHeights[w]&&(this._itemHeights[w]=C,this._computePositions(w),this._scrollHeight=this._computeScrollHeight(w))):C=this._itemHeights[w],!k||k.nodeType!==1)throw new Error("Generator did not return a DOM Node for index: "+w);f(k,x.rowClassName||"vrow");var R=this._itemPositions[w]+this._scrollPaddingTop;return p.mergeStyle(k,a({position:"absolute"},x.horizontal?"left":"top",R+"px")),k}},{key:"_getScrollPosition",value:function(){var w=this._config;return typeof w.overrideScrollPosition=="function"?w.overrideScrollPosition():this._element[w.horizontal?"scrollLeft":"scrollTop"]}},{key:"_renderChunk",value:function(w){var x=this._config,k=this._element,C=this._getScrollPosition(),R=x.total,Q=x.reverse?this._getReverseFrom(C):this._getFrom(C)-1;if((Q<0||Q-this._screenItemsLen<0)&&(Q=0),!w&&this._lastFrom===Q)return!1;this._lastFrom=Q;var z=Q+this._cachedItemsLen;(z>R||z+this._cachedItemsLen>R)&&(z=R);var L=x.useFragment?document.createDocumentFragment():[],Z=this._scroller;L[x.useFragment?"appendChild":"push"](Z);for(var re=Q;re0&&arguments[0]!==void 0?arguments[0]:1,x=this._config,k=x.total,C=x.reverse;w<1&&!C&&(w=1);for(var R=w;R0&&this._itemPositions[x]{(function(t,e){"use strict";function r(){i.width=t.innerWidth,i.height=5*c.barThickness;var f=i.getContext("2d");f.shadowBlur=c.shadowBlur,f.shadowColor=c.shadowColor;var d,p=f.createLinearGradient(0,0,i.width,0);for(d in c.barColors)p.addColorStop(d,c.barColors[d]);f.lineWidth=c.barThickness,f.beginPath(),f.moveTo(0,c.barThickness/2),f.lineTo(Math.ceil(n*i.width),c.barThickness/2),f.strokeStyle=p,f.stroke()}var i,n,o,s=null,a=null,l=null,c={autoRun:!0,barThickness:3,barColors:{0:"rgba(26, 188, 156, .9)",".25":"rgba(52, 152, 219, .9)",".50":"rgba(241, 196, 15, .9)",".75":"rgba(230, 126, 34, .9)","1.0":"rgba(211, 84, 0, .9)"},shadowBlur:10,shadowColor:"rgba(0, 0, 0, .6)",className:null},u={config:function(f){for(var d in f)c.hasOwnProperty(d)&&(c[d]=f[d])},show:function(f){var d,p;o||(f?l=l||setTimeout(()=>u.show(),f):(o=!0,a!==null&&t.cancelAnimationFrame(a),i||((p=(i=e.createElement("canvas")).style).position="fixed",p.top=p.left=p.right=p.margin=p.padding=0,p.zIndex=100001,p.display="none",c.className&&i.classList.add(c.className),e.body.appendChild(i),d="resize",f=r,(p=t).addEventListener?p.addEventListener(d,f,!1):p.attachEvent?p.attachEvent("on"+d,f):p["on"+d]=f),i.style.opacity=1,i.style.display="block",u.progress(0),c.autoRun&&function O(){s=t.requestAnimationFrame(O),u.progress("+"+.05*Math.pow(1-Math.sqrt(n),2))}()))},progress:function(f){return f===void 0||(typeof f=="string"&&(f=(0<=f.indexOf("+")||0<=f.indexOf("-")?n:0)+parseFloat(f)),n=1typeof t=="function"?t:function(){return t},vz=typeof self!="undefined"?self:null,au=typeof window!="undefined"?window:null,cu=vz||au||cu,wz="2.0.0",Nn={connecting:0,open:1,closing:2,closed:3},xz=1e4,kz=1e3,_i={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},vo={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},e1={longpoll:"longpoll",websocket:"websocket"},Sz={complete:4},wd=class{constructor(t,e,r,i){this.channel=t,this.event=e,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=i,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:t,response:e,_ref:r}){this.recHooks.filter(i=>i.status===t).forEach(i=>i.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},Jx=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},Tz=class{constructor(t,e,r){this.state=_i.closed,this.topic=t,this.params=lu(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new wd(this,vo.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Jx(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=_i.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>i.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=_i.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=_i.closed,this.socket.remove(this)}),this.onError(i=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,i),this.isJoining()&&this.joinPush.reset(),this.state=_i.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new wd(this,vo.leave,lu({}),this.timeout).send(),this.state=_i.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(vo.reply,(i,n)=>{this.trigger(this.replyEventName(n),i)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(t){this.on(vo.close,t)}onError(t){return this.on(vo.error,e=>t(e))}on(t,e){let r=this.bindingRef++;return this.bindings.push({event:t,ref:r,callback:e}),r}off(t,e){this.bindings=this.bindings.filter(r=>!(r.event===t&&(typeof e=="undefined"||e===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,r=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let i=new wd(this,t,function(){return e},r);return this.canPush()?i.send():(i.startTimeout(),this.pushBuffer.push(i)),i}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=_i.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(vo.close,"leave")},r=new wd(this,vo.leave,lu({}),t);return r.receive("ok",()=>e()).receive("timeout",()=>e()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(t,e,r){return e}isMember(t,e,r,i){return this.topic!==t?!1:i&&i!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:r,joinRef:i}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=_i.joining,this.joinPush.resend(t))}trigger(t,e,r,i){let n=this.onMessage(t,e,r,i);if(e&&!n)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let o=this.bindings.filter(s=>s.event===t);for(let s=0;s{let a=this.parseJSON(t.responseText);s&&s(a)},o&&(t.ontimeout=o),t.onprogress=()=>{},t.send(i),t}static xhrRequest(t,e,r,i,n,o,s,a){return t.open(e,r,!0),t.timeout=o,t.setRequestHeader("Content-Type",i),t.onerror=()=>a&&a(null),t.onreadystatechange=()=>{if(t.readyState===Sz.complete&&a){let l=this.parseJSON(t.responseText);a(l)}},s&&(t.ontimeout=s),t.send(n),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch(e){return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let r=[];for(var i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let n=e?`${e}[${i}]`:i,o=t[i];typeof o=="object"?r.push(this.serialize(o,n)):r.push(encodeURIComponent(n)+"="+encodeURIComponent(o))}return r.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let r=t.match(/\?/)?"&":"?";return`${t}${r}${this.serialize(e)}`}},Ez=t=>{let e="",r=new Uint8Array(t),i=r.byteLength;for(let n=0;nthis.ontimeout(),t=>{if(t){var{status:e,token:r,messages:i}=t;this.token=r}else e=0;switch(e){case 200:i.forEach(n=>{setTimeout(()=>this.onmessage({data:n}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Nn.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${e}`)}})}send(t){typeof t!="string"&&(t=Ez(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST","application/x-ndjson",t.join(` `),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,r){for(let n of this.reqs)n.abort();this.readyState=Nn.closed;let i=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent!="undefined"?this.onclose(new CloseEvent("close",i)):this.onclose(i)}ajax(t,e,r,i,n){let o,s=()=>{this.reqs.delete(o),i()};o=kd.request(t,this.endpointURL(),e,r,this.timeout,s,a=>{this.reqs.delete(o),this.isActive()&&n(a)}),this.reqs.add(o)}};var xd={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(r))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[r,i,n,o,s]=JSON.parse(t);return e({join_ref:r,ref:i,topic:n,event:o,payload:s})}},binaryEncode(t){let{join_ref:e,ref:r,event:i,topic:n,payload:o}=t,s=this.META_LENGTH+e.length+r.length+n.length+i.length,a=new ArrayBuffer(this.HEADER_LENGTH+s),l=new DataView(a),c=0;l.setUint8(c++,this.KINDS.push),l.setUint8(c++,e.length),l.setUint8(c++,r.length),l.setUint8(c++,n.length),l.setUint8(c++,i.length),Array.from(e,f=>l.setUint8(c++,f.charCodeAt(0))),Array.from(r,f=>l.setUint8(c++,f.charCodeAt(0))),Array.from(n,f=>l.setUint8(c++,f.charCodeAt(0))),Array.from(i,f=>l.setUint8(c++,f.charCodeAt(0)));var u=new Uint8Array(a.byteLength+o.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(o),a.byteLength),u.buffer},binaryDecode(t){let e=new DataView(t),r=e.getUint8(0),i=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(t,e,i);case this.KINDS.reply:return this.decodeReply(t,e,i);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,i)}},decodePush(t,e,r){let i=e.getUint8(1),n=e.getUint8(2),o=e.getUint8(3),s=this.HEADER_LENGTH+this.META_LENGTH-1,a=r.decode(t.slice(s,s+i));s=s+i;let l=r.decode(t.slice(s,s+n));s=s+n;let c=r.decode(t.slice(s,s+o));s=s+o;let u=t.slice(s,t.byteLength);return{join_ref:a,ref:null,topic:l,event:c,payload:u}},decodeReply(t,e,r){let i=e.getUint8(1),n=e.getUint8(2),o=e.getUint8(3),s=e.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=r.decode(t.slice(a,a+i));a=a+i;let c=r.decode(t.slice(a,a+n));a=a+n;let u=r.decode(t.slice(a,a+o));a=a+o;let f=r.decode(t.slice(a,a+s));a=a+s;let d=t.slice(a,t.byteLength),p={status:f,response:d};return{join_ref:l,ref:c,topic:u,event:vo.reply,payload:p}},decodeBroadcast(t,e,r){let i=e.getUint8(1),n=e.getUint8(2),o=this.HEADER_LENGTH+2,s=r.decode(t.slice(o,o+i));o=o+i;let a=r.decode(t.slice(o,o+n));o=o+n;let l=t.slice(o,t.byteLength);return{join_ref:null,ref:null,topic:s,event:a,payload:l}}},Sd=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=e.timeout||xz,this.transport=e.transport||cu.WebSocket||Jg,this.establishedConnections=0,this.defaultEncoder=xd.encode.bind(xd),this.defaultDecoder=xd.decode.bind(xd),this.closeWasClean=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.transport!==Jg?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;au&&au.addEventListener&&(au.addEventListener("pagehide",i=>{this.conn&&(this.disconnect(),r=this.connectClock)}),au.addEventListener("pageshow",i=>{r===this.connectClock&&(r=null,this.connect())})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.rejoinAfterMs=i=>e.rejoinAfterMs?e.rejoinAfterMs(i):[1e3,2e3,5e3][i-1]||1e4,this.reconnectAfterMs=i=>e.reconnectAfterMs?e.reconnectAfterMs(i):[10,50,100,150,200,250,500,1e3,2e3][i-1]||5e3,this.logger=e.logger||null,this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=lu(e.params||{}),this.endPoint=`${t}/${e1.websocket}`,this.vsn=e.vsn||wz,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Jx(()=>{this.teardown(()=>this.connect())},this.reconnectAfterMs)}getLongPollTransport(){return Jg}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.sendBuffer=[],this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=kd.appendParams(kd.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,r){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.teardown(t,e,r)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=lu(t)),!this.conn&&(this.connectClock++,this.closeWasClean=!1,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e))}log(t,e,r){this.logger(t,e,r)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let i=this.onMessage(n=>{n.ref===e&&(this.off([i]),t(Date.now()-r))});return!0}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,t])=>t())}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),kz,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,r){if(!this.conn)return t&&t();this.waitForBufferDone(()=>{this.conn&&(e?this.conn.close(e,r||""):this.conn.close()),this.waitForSocketClosed(()=>{this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e=1){if(e===5||!this.conn||!this.conn.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(t,e+1)},150*e)}waitForSocketClosed(t,e=1){if(e===5||!this.conn||this.conn.readyState===Nn.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(t,e+1)},150*e)}onConnClose(t){let e=t&&t.code;this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),this.clearHeartbeats(),!this.closeWasClean&&e!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,r])=>r(t))}onConnError(t){this.hasLogger()&&this.log("transport",t);let e=this.transport,r=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,i])=>{i(t,e,r)}),(e===this.transport||r>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(vo.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case Nn.connecting:return"connecting";case Nn.open:return"open";case Nn.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e.joinRef()!==t.joinRef())}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([r])=>t.indexOf(r)===-1)}channel(t,e={}){let r=new Tz(t,e,this);return this.channels.push(r),r}push(t){if(this.hasLogger()){let{topic:e,event:r,payload:i,ref:n,join_ref:o}=t;this.log("push",`${e} ${r} (${o}, ${n})`,i)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:r,event:i,payload:n,ref:o,join_ref:s}=e;o&&o===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${n.status||""} ${r} ${i} ${o&&"("+o+")"||""}`,n);for(let a=0;ar.topic===t&&(r.isJoined()||r.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};var Sk="consecutive-reloads",Cz=10,Pz=5e3,Qz=1e4,_z=3e4,Tk=["phx-click-loading","phx-change-loading","phx-submit-loading","phx-keydown-loading","phx-keyup-loading","phx-blur-loading","phx-focus-loading"],xo="data-phx-component",t1="data-phx-link",Az="track-static",Rz="data-phx-link-state",Hi="data-phx-ref",xa="data-phx-ref-src",Ek="track-uploads",gs="data-phx-upload-ref",p1="data-phx-preflighted-refs",$z="data-phx-done-refs",ek="drop-target",f1="data-phx-active-refs",zd="phx:live-file:updated",Ck="data-phx-skip",Pk="data-phx-id",tk="data-phx-prune",rk="page-loading",ik="phx-connected",uu="phx-loading",r1="phx-no-feedback",Td="phx-error",nk="phx-client-error",i1="phx-server-error",Rl="data-phx-parent-id",m1="data-phx-main",yu="data-phx-root-id",Qk="viewport-top",_k="viewport-bottom",Xz="trigger-action",Dd="feedback-for",h1="phx-has-focused",Iz=["text","textarea","number","email","password","search","tel","url","date","time","datetime-local","color","range"],Ak=["checkbox","radio"],Ud="phx-has-submitted",bs="data-phx-session",Xl=`[${bs}]`,ok="data-phx-sticky",gu="data-phx-static",n1="data-phx-readonly",Ed="data-phx-disabled",d1="disable-with",Cd="data-phx-disable-with-restore",fu="hook",Lz="debounce",zz="throttle",Nd="update",Pd="stream",hu="data-phx-stream",Mz="key",jn="phxPrivate",sk="auto-recover",Qd="phx:live-socket:debug",o1="phx:live-socket:profiling",s1="phx:live-socket:latency-sim",Dz="progress",ak="mounted",Uz=1,Nz=200,jz="phx-",Bz=3e4,du="debounce-trigger",_d="throttled",lk="debounce-prev-key",Vz={debounce:300,throttle:300},Ad="d",Bn="s",a1="r",Ai="c",ck="e",uk="r",fk="t",qz="p",hk="stream",Fz=class{constructor(t,e,r){this.liveSocket=r,this.entry=t,this.offset=0,this.chunkSize=e,this.chunkTimer=null,this.errored=!1,this.uploadChannel=r.channel(`lvu:${t.ref}`,{token:t.metadata()})}error(t){this.errored||(this.uploadChannel.leave(),this.errored=!0,clearTimeout(this.chunkTimer),this.entry.error(t))}upload(){this.uploadChannel.onError(t=>this.error(t)),this.uploadChannel.join().receive("ok",t=>this.readNextChunk()).receive("error",t=>this.error(t))}isDone(){return this.offset>=this.entry.file.size}readNextChunk(){let t=new window.FileReader,e=this.entry.file.slice(this.offset,this.chunkSize+this.offset);t.onload=r=>{if(r.target.error===null)this.offset+=r.target.result.byteLength,this.pushChunk(r.target.result);else return Ri("Read error: "+r.target.error)},t.readAsArrayBuffer(e)}pushChunk(t){this.uploadChannel.isJoined()&&this.uploadChannel.push("chunk",t).receive("ok",()=>{this.entry.progress(this.offset/this.entry.file.size*100),this.isDone()||(this.chunkTimer=setTimeout(()=>this.readNextChunk(),this.liveSocket.getLatencySim()||0))}).receive("error",({reason:e})=>this.error(e))}},Ri=(t,e)=>console.error&&console.error(t,e),wo=t=>{let e=typeof t;return e==="number"||e==="string"&&/^(0|[1-9]\d*)$/.test(t)};function Wz(){let t=new Set,e=document.querySelectorAll("*[id]");for(let r=0,i=e.length;r{t.liveSocket.isDebugEnabled()&&console.log(`${t.id} ${e}: ${r} - `,i)},l1=t=>typeof t=="function"?t:function(){return t},Md=t=>JSON.parse(JSON.stringify(t)),bu=(t,e,r)=>{do{if(t.matches(`[${e}]`)&&!t.disabled)return t;t=t.parentElement||t.parentNode}while(t!==null&&t.nodeType===1&&!(r&&r.isSameNode(t)||t.matches(Xl)));return null},pu=t=>t!==null&&typeof t=="object"&&!(t instanceof Array),Yz=(t,e)=>JSON.stringify(t)===JSON.stringify(e),dk=t=>{for(let e in t)return!1;return!0},Os=(t,e)=>t&&e(t),Hz=function(t,e,r,i){t.forEach(n=>{new Fz(n,r.config.chunk_size,i).upload()})},Rk={canPushState(){return typeof history.pushState!="undefined"},dropLocal(t,e,r){return t.removeItem(this.localKey(e,r))},updateLocal(t,e,r,i,n){let o=this.getLocal(t,e,r),s=this.localKey(e,r),a=o===null?i:n(o);return t.setItem(s,JSON.stringify(a)),a},getLocal(t,e,r){return JSON.parse(t.getItem(this.localKey(e,r)))},updateCurrentState(t){this.canPushState()&&history.replaceState(t(history.state||{}),"",window.location.href)},pushState(t,e,r){if(this.canPushState()){if(r!==window.location.href){if(e.type=="redirect"&&e.scroll){let n=history.state||{};n.scroll=e.scroll,history.replaceState(n,"",window.location.href)}delete e.scroll,history[t+"State"](e,"",r||null);let i=this.getHashTargetEl(window.location.hash);i?i.scrollIntoView():e.type==="redirect"&&window.scroll(0,0)}}else this.redirect(r)},setCookie(t,e){document.cookie=`${t}=${e}`},getCookie(t){return document.cookie.replace(new RegExp(`(?:(?:^|.*;s*)${t}s*=s*([^;]*).*$)|^.*$`),"$1")},redirect(t,e){e&&Rk.setCookie("__phoenix_flash__",e+"; max-age=60000; path=/"),window.location=t},localKey(t,e){return`${t}-${e}`},getHashTargetEl(t){let e=t.toString().substring(1);if(e!=="")return document.getElementById(e)||document.querySelector(`a[name="${e}"]`)}},Vn=Rk,Zi={byId(t){return document.getElementById(t)||Ri(`no id found for ${t}`)},removeClass(t,e){t.classList.remove(e),t.classList.length===0&&t.removeAttribute("class")},all(t,e,r){if(!t)return[];let i=Array.from(t.querySelectorAll(e));return r?i.forEach(r):i},childNodeLength(t){let e=document.createElement("template");return e.innerHTML=t,e.content.childElementCount},isUploadInput(t){return t.type==="file"&&t.getAttribute(gs)!==null},isAutoUpload(t){return t.hasAttribute("data-phx-auto-upload")},findUploadInputs(t){return this.all(t,`input[type="file"][${gs}]`)},findComponentNodeList(t,e){return this.filterWithinSameLiveView(this.all(t,`[${xo}="${e}"]`),t)},isPhxDestroyed(t){return!!(t.id&&Zi.private(t,"destroyed"))},wantsNewTab(t){let e=t.ctrlKey||t.shiftKey||t.metaKey||t.button&&t.button===1,r=t.target instanceof HTMLAnchorElement&&t.target.hasAttribute("download"),i=t.target.hasAttribute("target")&&t.target.getAttribute("target").toLowerCase()==="_blank";return e||i||r},isUnloadableFormSubmit(t){return t.target&&t.target.getAttribute("method")==="dialog"||t.submitter&&t.submitter.getAttribute("formmethod")==="dialog"?!1:!t.defaultPrevented&&!this.wantsNewTab(t)},isNewPageClick(t,e){let r=t.target instanceof HTMLAnchorElement?t.target.getAttribute("href"):null,i;if(t.defaultPrevented||r===null||this.wantsNewTab(t)||r.startsWith("mailto:")||r.startsWith("tel:")||t.target.isContentEditable)return!1;try{i=new URL(r)}catch(n){try{i=new URL(r,e)}catch(o){return!0}}return i.host===e.host&&i.protocol===e.protocol&&i.pathname===e.pathname&&i.search===e.search?i.hash===""&&!i.href.endsWith("#"):i.protocol.startsWith("http")},markPhxChildDestroyed(t){this.isPhxChild(t)&&t.setAttribute(bs,""),this.putPrivate(t,"destroyed",!0)},findPhxChildrenInFragment(t,e){let r=document.createElement("template");return r.innerHTML=t,this.findPhxChildren(r.content,e)},isIgnored(t,e){return(t.getAttribute(e)||t.getAttribute("data-phx-update"))==="ignore"},isPhxUpdate(t,e,r){return t.getAttribute&&r.indexOf(t.getAttribute(e))>=0},findPhxSticky(t){return this.all(t,`[${ok}]`)},findPhxChildren(t,e){return this.all(t,`${Xl}[${Rl}="${e}"]`)},findParentCIDs(t,e){let r=new Set(e),i=e.reduce((n,o)=>{let s=`[${xo}="${o}"] [${xo}]`;return this.filterWithinSameLiveView(this.all(t,s),t).map(a=>parseInt(a.getAttribute(xo))).forEach(a=>n.delete(a)),n},r);return i.size===0?new Set(e):i},filterWithinSameLiveView(t,e){return e.querySelector(Xl)?t.filter(r=>this.withinSameLiveView(r,e)):t},withinSameLiveView(t,e){for(;t=t.parentNode;){if(t.isSameNode(e))return!0;if(t.getAttribute(bs)!==null)return!1}},private(t,e){return t[jn]&&t[jn][e]},deletePrivate(t,e){t[jn]&&delete t[jn][e]},putPrivate(t,e,r){t[jn]||(t[jn]={}),t[jn][e]=r},updatePrivate(t,e,r,i){let n=this.private(t,e);n===void 0?this.putPrivate(t,e,i(r)):this.putPrivate(t,e,i(n))},copyPrivates(t,e){e[jn]&&(t[jn]=e[jn])},putTitle(t){let e=document.querySelector("title");if(e){let{prefix:r,suffix:i}=e.dataset;document.title=`${r||""}${t}${i||""}`}else document.title=t},debounce(t,e,r,i,n,o,s,a){let l=t.getAttribute(r),c=t.getAttribute(n);l===""&&(l=i),c===""&&(c=o);let u=l||c;switch(u){case null:return a();case"blur":this.once(t,"debounce-blur")&&t.addEventListener("blur",()=>a());return;default:let f=parseInt(u),d=()=>c?this.deletePrivate(t,_d):a(),p=this.incCycle(t,du,d);if(isNaN(f))return Ri(`invalid throttle/debounce value: ${u}`);if(c){let w=!1;if(e.type==="keydown"){let x=this.private(t,lk);this.putPrivate(t,lk,e.key),w=x!==e.key}if(!w&&this.private(t,_d))return!1;a(),this.putPrivate(t,_d,!0),setTimeout(()=>{s()&&this.triggerCycle(t,du)},f)}else setTimeout(()=>{s()&&this.triggerCycle(t,du,p)},f);let O=t.form;O&&this.once(O,"bind-debounce")&&O.addEventListener("submit",()=>{Array.from(new FormData(O).entries(),([w])=>{let x=O.querySelector(`[name="${w}"]`);this.incCycle(x,du),this.deletePrivate(x,_d)})}),this.once(t,"bind-debounce")&&t.addEventListener("blur",()=>this.triggerCycle(t,du))}},triggerCycle(t,e,r){let[i,n]=this.private(t,e);r||(r=i),r===i&&(this.incCycle(t,e),n())},once(t,e){return this.private(t,e)===!0?!1:(this.putPrivate(t,e,!0),!0)},incCycle(t,e,r=function(){}){let[i]=this.private(t,e)||[0,r];return i++,this.putPrivate(t,e,[i,r]),i},maybeAddPrivateHooks(t,e,r){t.hasAttribute&&(t.hasAttribute(e)||t.hasAttribute(r))&&t.setAttribute("data-phx-hook","Phoenix.InfiniteScroll")},maybeHideFeedback(t,e,r){let i=[];if(e.forEach(n=>{this.private(n,h1)||this.private(n,Ud)||(i.push(n.name),n.name.endsWith("[]")&&i.push(n.name.slice(0,-2)))}),i.length>0){let n=i.map(o=>`[${r}="${o}"]`).join(", ");Zi.all(t,n,o=>o.classList.add(r1))}},resetForm(t,e){Array.from(t.elements).forEach(r=>{let i=`[${e}="${r.id}"], [${e}="${r.name}"], [${e}="${r.name.replace(/\[\]$/,"")}"]`;this.deletePrivate(r,h1),this.deletePrivate(r,Ud),this.all(document,i,n=>{n.classList.add(r1)})})},showError(t,e){(t.id||t.name)&&this.all(t.form,`[${e}="${t.id}"], [${e}="${t.name}"]`,r=>{this.removeClass(r,r1)})},isPhxChild(t){return t.getAttribute&&t.getAttribute(Rl)},isPhxSticky(t){return t.getAttribute&&t.getAttribute(ok)!==null},firstPhxChild(t){return this.isPhxChild(t)?t:this.all(t,`[${Rl}]`)[0]},dispatchEvent(t,e,r={}){let n={bubbles:r.bubbles===void 0?!0:!!r.bubbles,cancelable:!0,detail:r.detail||{}},o=e==="click"?new MouseEvent("click",n):new CustomEvent(e,n);t.dispatchEvent(o)},cloneNode(t,e){if(typeof e=="undefined")return t.cloneNode(!0);{let r=t.cloneNode(!1);return r.innerHTML=e,r}},mergeAttrs(t,e,r={}){let i=r.exclude||[],n=r.isIgnored,o=e.attributes;for(let a=o.length-1;a>=0;a--){let l=o[a].name;i.indexOf(l)<0&&t.setAttribute(l,e.getAttribute(l))}let s=t.attributes;for(let a=s.length-1;a>=0;a--){let l=s[a].name;n?l.startsWith("data-")&&!e.hasAttribute(l)&&t.removeAttribute(l):e.hasAttribute(l)||t.removeAttribute(l)}},mergeFocusedInput(t,e){t instanceof HTMLSelectElement||Zi.mergeAttrs(t,e,{exclude:["value"]}),e.readOnly?t.setAttribute("readonly",!0):t.removeAttribute("readonly")},hasSelectionRange(t){return t.setSelectionRange&&(t.type==="text"||t.type==="textarea")},restoreFocus(t,e,r){if(!Zi.isTextualInput(t))return;let i=t.matches(":focus");t.readOnly&&t.blur(),i||t.focus(),this.hasSelectionRange(t)&&t.setSelectionRange(e,r)},isFormInput(t){return/^(?:input|select|textarea)$/i.test(t.tagName)&&t.type!=="button"},syncAttrsToProps(t){t instanceof HTMLInputElement&&Ak.indexOf(t.type.toLocaleLowerCase())>=0&&(t.checked=t.getAttribute("checked")!==null)},isTextualInput(t){return Iz.indexOf(t.type)>=0},isNowTriggerFormExternal(t,e){return t.getAttribute&&t.getAttribute(e)!==null},syncPendingRef(t,e,r){let i=t.getAttribute(Hi);if(i===null)return!0;let n=t.getAttribute(xa);return Zi.isFormInput(t)||t.getAttribute(r)!==null?(Zi.isUploadInput(t)&&Zi.mergeAttrs(t,e,{isIgnored:!0}),Zi.putPrivate(t,Hi,e),!1):(Tk.forEach(o=>{t.classList.contains(o)&&e.classList.add(o)}),e.setAttribute(Hi,i),e.setAttribute(xa,n),!0)},cleanChildNodes(t,e){if(Zi.isPhxUpdate(t,e,["append","prepend"])){let r=[];t.childNodes.forEach(i=>{i.id||(i.nodeType===Node.TEXT_NODE&&i.nodeValue.trim()===""||Ri(`only HTML element tags with an id are allowed inside containers with phx-update. removing illegal node: "${(i.outerHTML||i.nodeValue).trim()}" `),r.push(i))}),r.forEach(i=>i.remove())}},replaceRootContainer(t,e,r){let i=new Set(["id",bs,gu,m1,yu]);if(t.tagName.toLowerCase()===e.toLowerCase())return Array.from(t.attributes).filter(n=>!i.has(n.name.toLowerCase())).forEach(n=>t.removeAttribute(n.name)),Object.keys(r).filter(n=>!i.has(n.toLowerCase())).forEach(n=>t.setAttribute(n,r[n])),t;{let n=document.createElement(e);return Object.keys(r).forEach(o=>n.setAttribute(o,r[o])),i.forEach(o=>n.setAttribute(o,t.getAttribute(o))),n.innerHTML=t.innerHTML,t.replaceWith(n),n}},getSticky(t,e,r){let i=(Zi.private(t,"sticky")||[]).find(([n])=>e===n);if(i){let[n,o,s]=i;return s}else return typeof r=="function"?r():r},deleteSticky(t,e){this.updatePrivate(t,"sticky",[],r=>r.filter(([i,n])=>i!==e))},putSticky(t,e,r){let i=r(t);this.updatePrivate(t,"sticky",[],n=>{let o=n.findIndex(([s])=>e===s);return o>=0?n[o]=[e,r,i]:n.push([e,r,i]),n})},applyStickyOperations(t){let e=Zi.private(t,"sticky");e&&e.forEach(([r,i,n])=>this.putSticky(t,r,i))}},de=Zi,c1=class{static isActive(t,e){let r=e._phxRef===void 0,n=t.getAttribute(f1).split(",").indexOf(Rr.genFileRef(e))>=0;return e.size>0&&(r||n)}static isPreflighted(t,e){return t.getAttribute(p1).split(",").indexOf(Rr.genFileRef(e))>=0&&this.isActive(t,e)}constructor(t,e,r){this.ref=Rr.genFileRef(e),this.fileEl=t,this.file=e,this.view=r,this.meta=null,this._isCancelled=!1,this._isDone=!1,this._progress=0,this._lastProgressSent=-1,this._onDone=function(){},this._onElUpdated=this.onElUpdated.bind(this),this.fileEl.addEventListener(zd,this._onElUpdated)}metadata(){return this.meta}progress(t){this._progress=Math.floor(t),this._progress>this._lastProgressSent&&(this._progress>=100?(this._progress=100,this._lastProgressSent=100,this._isDone=!0,this.view.pushFileProgress(this.fileEl,this.ref,100,()=>{Rr.untrackFile(this.fileEl,this.file),this._onDone()})):(this._lastProgressSent=this._progress,this.view.pushFileProgress(this.fileEl,this.ref,this._progress)))}cancel(){this._isCancelled=!0,this._isDone=!0,this._onDone()}isDone(){return this._isDone}error(t="failed"){this.fileEl.removeEventListener(zd,this._onElUpdated),this.view.pushFileProgress(this.fileEl,this.ref,{error:t}),de.isAutoUpload(this.fileEl)||Rr.clearFiles(this.fileEl)}onDone(t){this._onDone=()=>{this.fileEl.removeEventListener(zd,this._onElUpdated),t()}}onElUpdated(){this.fileEl.getAttribute(f1).split(",").indexOf(this.ref)===-1&&this.cancel()}toPreflightPayload(){return{last_modified:this.file.lastModified,name:this.file.name,relative_path:this.file.webkitRelativePath,size:this.file.size,type:this.file.type,ref:this.ref,meta:typeof this.file.meta=="function"?this.file.meta():void 0}}uploader(t){if(this.meta.uploader){let e=t[this.meta.uploader]||Ri(`no uploader configured for ${this.meta.uploader}`);return{name:this.meta.uploader,callback:e}}else return{name:"channel",callback:Hz}}zipPostFlight(t){this.meta=t.entries[this.ref],this.meta||Ri(`no preflight upload response returned with ref ${this.ref}`,{input:this.fileEl,response:t})}},Gz=0,Rr=class{static genFileRef(t){let e=t._phxRef;return e!==void 0?e:(t._phxRef=(Gz++).toString(),t._phxRef)}static getEntryDataURL(t,e,r){let i=this.activeFiles(t).find(n=>this.genFileRef(n)===e);r(URL.createObjectURL(i))}static hasUploadsInProgress(t){let e=0;return de.findUploadInputs(t).forEach(r=>{r.getAttribute(p1)!==r.getAttribute($z)&&e++}),e>0}static serializeUploads(t){let e=this.activeFiles(t),r={};return e.forEach(i=>{let n={path:t.name},o=t.getAttribute(gs);r[o]=r[o]||[],n.ref=this.genFileRef(i),n.last_modified=i.lastModified,n.name=i.name||n.ref,n.relative_path=i.webkitRelativePath,n.type=i.type,n.size=i.size,typeof i.meta=="function"&&(n.meta=i.meta()),r[o].push(n)}),r}static clearFiles(t){t.value=null,t.removeAttribute(gs),de.putPrivate(t,"files",[])}static untrackFile(t,e){de.putPrivate(t,"files",de.private(t,"files").filter(r=>!Object.is(r,e)))}static trackFiles(t,e,r){if(t.getAttribute("multiple")!==null){let i=e.filter(n=>!this.activeFiles(t).find(o=>Object.is(o,n)));de.putPrivate(t,"files",this.activeFiles(t).concat(i)),t.value=null}else r&&r.files.length>0&&(t.files=r.files),de.putPrivate(t,"files",e)}static activeFileInputs(t){let e=de.findUploadInputs(t);return Array.from(e).filter(r=>r.files&&this.activeFiles(r).length>0)}static activeFiles(t){return(de.private(t,"files")||[]).filter(e=>c1.isActive(t,e))}static inputsAwaitingPreflight(t){let e=de.findUploadInputs(t);return Array.from(e).filter(r=>this.filesAwaitingPreflight(r).length>0)}static filesAwaitingPreflight(t){return this.activeFiles(t).filter(e=>!c1.isPreflighted(t,e))}constructor(t,e,r){this.view=e,this.onComplete=r,this._entries=Array.from(Rr.filesAwaitingPreflight(t)||[]).map(i=>new c1(t,i,e)),this.numEntriesInProgress=this._entries.length}entries(){return this._entries}initAdapterUpload(t,e,r){this._entries=this._entries.map(n=>(n.zipPostFlight(t),n.onDone(()=>{this.numEntriesInProgress--,this.numEntriesInProgress===0&&this.onComplete()}),n));let i=this._entries.reduce((n,o)=>{if(!o.meta)return n;let{name:s,callback:a}=o.uploader(r.uploaders);return n[s]=n[s]||{callback:a,entries:[]},n[s].entries.push(o),n},{});for(let n in i){let{callback:o,entries:s}=i[n];o(s,e,t,r)}}},Kz={focusMain(){let t=document.querySelector("main h1, main, h1");if(t){let e=t.tabIndex;t.tabIndex=-1,t.focus(),t.tabIndex=e}},anyOf(t,e){return e.find(r=>t instanceof r)},isFocusable(t,e){return t instanceof HTMLAnchorElement&&t.rel!=="ignore"||t instanceof HTMLAreaElement&&t.href!==void 0||!t.disabled&&this.anyOf(t,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLButtonElement])||t instanceof HTMLIFrameElement||t.tabIndex>0||!e&&t.getAttribute("tabindex")!==null&&t.getAttribute("aria-hidden")!=="true"},attemptFocus(t,e){if(this.isFocusable(t,e))try{t.focus()}catch(r){}return!!document.activeElement&&document.activeElement.isSameNode(t)},focusFirstInteractive(t){let e=t.firstElementChild;for(;e;){if(this.attemptFocus(e,!0)||this.focusFirstInteractive(e,!0))return!0;e=e.nextElementSibling}},focusFirst(t){let e=t.firstElementChild;for(;e;){if(this.attemptFocus(e)||this.focusFirst(e))return!0;e=e.nextElementSibling}},focusLast(t){let e=t.lastElementChild;for(;e;){if(this.attemptFocus(e)||this.focusLast(e))return!0;e=e.previousElementSibling}}},$l=Kz,$k={LiveFileUpload:{activeRefs(){return this.el.getAttribute(f1)},preflightedRefs(){return this.el.getAttribute(p1)},mounted(){this.preflightedWas=this.preflightedRefs()},updated(){let t=this.preflightedRefs();this.preflightedWas!==t&&(this.preflightedWas=t,t===""&&this.__view.cancelSubmit(this.el.form)),this.activeRefs()===""&&(this.el.value=null),this.el.dispatchEvent(new CustomEvent(zd))}},LiveImgPreview:{mounted(){this.ref=this.el.getAttribute("data-phx-entry-ref"),this.inputEl=document.getElementById(this.el.getAttribute(gs)),Rr.getEntryDataURL(this.inputEl,this.ref,t=>{this.url=t,this.el.src=t})},destroyed(){URL.revokeObjectURL(this.url)}},FocusWrap:{mounted(){this.focusStart=this.el.firstElementChild,this.focusEnd=this.el.lastElementChild,this.focusStart.addEventListener("focus",()=>$l.focusLast(this.el)),this.focusEnd.addEventListener("focus",()=>$l.focusFirst(this.el)),this.el.addEventListener("phx:show-end",()=>this.el.focus()),window.getComputedStyle(this.el).display!=="none"&&$l.focusFirst(this.el)}}},pk=()=>document.documentElement.scrollTop||document.body.scrollTop,O1=()=>window.innerHeight||document.documentElement.clientHeight,Jz=t=>{let e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.top<=O1()},eM=t=>{let e=t.getBoundingClientRect();return e.right>=0&&e.left>=0&&e.bottom<=O1()},mk=t=>{let e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.top<=O1()};$k.InfiniteScroll={mounted(){let t=pk(),e=!1,r=500,i=null,n=this.throttle(r,(a,l)=>{i=()=>!0,this.liveSocket.execJSHookPush(this.el,a,{id:l.id,_overran:!0},()=>{i=null})}),o=this.throttle(r,(a,l)=>{i=()=>l.scrollIntoView({block:"start"}),this.liveSocket.execJSHookPush(this.el,a,{id:l.id},()=>{i=null,mk(l)||l.scrollIntoView({block:"start"})})}),s=this.throttle(r,(a,l)=>{i=()=>l.scrollIntoView({block:"end"}),this.liveSocket.execJSHookPush(this.el,a,{id:l.id},()=>{i=null,mk(l)||l.scrollIntoView({block:"end"})})});this.onScroll=a=>{let l=pk();if(i)return t=l,i();let c=this.el.getBoundingClientRect(),u=this.el.getAttribute(this.liveSocket.binding("viewport-top")),f=this.el.getAttribute(this.liveSocket.binding("viewport-bottom")),d=this.el.lastElementChild,p=this.el.firstElementChild,O=lt;O&&u&&!e&&c.top>=0?(e=!0,n(u,p)):w&&e&&c.top<=0&&(e=!1),u&&O&&Jz(p)?o(u,p):f&&w&&eM(d)&&s(f,d),t=l},window.addEventListener("scroll",this.onScroll)},destroyed(){window.removeEventListener("scroll",this.onScroll)},throttle(t,e){let r=0,i;return(...n)=>{let o=Date.now(),s=t-(o-r);s<=0||s>t?(i&&(clearTimeout(i),i=null),r=o,e(...n)):i||(i=setTimeout(()=>{r=Date.now(),i=null,e(...n)},s))}}};var tM=$k,rM=class{constructor(t,e,r){let i=new Set,n=new Set([...e.children].map(s=>s.id)),o=[];Array.from(t.children).forEach(s=>{if(s.id&&(i.add(s.id),n.has(s.id))){let a=s.previousElementSibling&&s.previousElementSibling.id;o.push({elementId:s.id,previousElementId:a})}}),this.containerId=e.id,this.updateType=r,this.elementsToModify=o,this.elementIdsToAdd=[...n].filter(s=>!i.has(s))}perform(){let t=de.byId(this.containerId);this.elementsToModify.forEach(e=>{e.previousElementId?Os(document.getElementById(e.previousElementId),r=>{Os(document.getElementById(e.elementId),i=>{i.previousElementSibling&&i.previousElementSibling.id==r.id||r.insertAdjacentElement("afterend",i)})}):Os(document.getElementById(e.elementId),r=>{r.previousElementSibling==null||t.insertAdjacentElement("afterbegin",r)})}),this.updateType=="prepend"&&this.elementIdsToAdd.reverse().forEach(e=>{Os(document.getElementById(e),r=>t.insertAdjacentElement("afterbegin",r))})}},Ok=11;function iM(t,e){var r=e.attributes,i,n,o,s,a;if(!(e.nodeType===Ok||t.nodeType===Ok)){for(var l=r.length-1;l>=0;l--)i=r[l],n=i.name,o=i.namespaceURI,s=i.value,o?(n=i.localName||n,a=t.getAttributeNS(o,n),a!==s&&(i.prefix==="xmlns"&&(n=i.name),t.setAttributeNS(o,n,s))):(a=t.getAttribute(n),a!==s&&t.setAttribute(n,s));for(var c=t.attributes,u=c.length-1;u>=0;u--)i=c[u],n=i.name,o=i.namespaceURI,o?(n=i.localName||n,e.hasAttributeNS(o,n)||t.removeAttributeNS(o,n)):e.hasAttribute(n)||t.removeAttribute(n)}}var Rd,nM="http://www.w3.org/1999/xhtml",gi=typeof document=="undefined"?void 0:document,oM=!!gi&&"content"in gi.createElement("template"),sM=!!gi&&gi.createRange&&"createContextualFragment"in gi.createRange();function aM(t){var e=gi.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}function lM(t){Rd||(Rd=gi.createRange(),Rd.selectNode(gi.body));var e=Rd.createContextualFragment(t);return e.childNodes[0]}function cM(t){var e=gi.createElement("body");return e.innerHTML=t,e.childNodes[0]}function uM(t){return t=t.trim(),oM?aM(t):sM?lM(t):cM(t)}function $d(t,e){var r=t.nodeName,i=e.nodeName,n,o;return r===i?!0:(n=r.charCodeAt(0),o=i.charCodeAt(0),n<=90&&o>=97?r===i.toUpperCase():o<=90&&n>=97?i===r.toUpperCase():!1)}function fM(t,e){return!e||e===nM?gi.createElement(t):gi.createElementNS(e,t)}function hM(t,e){for(var r=t.firstChild;r;){var i=r.nextSibling;e.appendChild(r),r=i}return e}function u1(t,e,r){t[r]!==e[r]&&(t[r]=e[r],t[r]?t.setAttribute(r,""):t.removeAttribute(r))}var gk={OPTION:function(t,e){var r=t.parentNode;if(r){var i=r.nodeName.toUpperCase();i==="OPTGROUP"&&(r=r.parentNode,i=r&&r.nodeName.toUpperCase()),i==="SELECT"&&!r.hasAttribute("multiple")&&(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),r.selectedIndex=-1)}u1(t,e,"selected")},INPUT:function(t,e){u1(t,e,"checked"),u1(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var r=e.value;t.value!==r&&(t.value=r);var i=t.firstChild;if(i){var n=i.nodeValue;if(n==r||!r&&n==t.placeholder)return;i.nodeValue=r}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var r=-1,i=0,n=t.firstChild,o,s;n;)if(s=n.nodeName&&n.nodeName.toUpperCase(),s==="OPTGROUP")o=n,n=o.firstChild;else{if(s==="OPTION"){if(n.hasAttribute("selected")){r=i;break}i++}n=n.nextSibling,!n&&o&&(n=o.nextSibling,o=null)}t.selectedIndex=r}}},mu=1,bk=11,yk=3,vk=8;function ms(){}function dM(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}function pM(t){return function(r,i,n){if(n||(n={}),typeof i=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"||r.nodeName==="BODY"){var o=i;i=gi.createElement("html"),i.innerHTML=o}else i=uM(i);else i.nodeType===bk&&(i=i.firstElementChild);var s=n.getNodeKey||dM,a=n.onBeforeNodeAdded||ms,l=n.onNodeAdded||ms,c=n.onBeforeElUpdated||ms,u=n.onElUpdated||ms,f=n.onBeforeNodeDiscarded||ms,d=n.onNodeDiscarded||ms,p=n.onBeforeElChildrenUpdated||ms,O=n.skipFromChildren||ms,w=n.addChild||function(se,he){return se.appendChild(he)},x=n.childrenOnly===!0,k=Object.create(null),C=[];function R(se){C.push(se)}function Q(se,he){if(se.nodeType===mu)for(var K=se.firstChild;K;){var _=void 0;he&&(_=s(K))?R(_):(d(K),K.firstChild&&Q(K,he)),K=K.nextSibling}}function z(se,he,K){f(se)!==!1&&(he&&he.removeChild(se),d(se),Q(se,K))}function L(se){if(se.nodeType===mu||se.nodeType===bk)for(var he=se.firstChild;he;){var K=s(he);K&&(k[K]=he),L(he),he=he.nextSibling}}L(r);function Z(se){l(se);for(var he=se.firstChild;he;){var K=he.nextSibling,_=s(he);if(_){var G=k[_];G&&$d(he,G)?(he.parentNode.replaceChild(G,he),H(G,he)):Z(he)}else Z(he);he=K}}function re(se,he,K){for(;he;){var _=he.nextSibling;(K=s(he))?R(K):z(he,se,!0),he=_}}function H(se,he,K){var _=s(he);_&&delete k[_],!(!K&&(c(se,he)===!1||(t(se,he),u(se),p(se,he)===!1)))&&(se.nodeName!=="TEXTAREA"?q(se,he):gk.TEXTAREA(se,he))}function q(se,he){var K=O(se,he),_=he.firstChild,G=se.firstChild,ae,j,Je,at,st;e:for(;_;){for(at=_.nextSibling,ae=s(_);!K&&G;){if(Je=G.nextSibling,_.isSameNode&&_.isSameNode(G)){_=at,G=Je;continue e}j=s(G);var Ce=G.nodeType,Ze=void 0;if(Ce===_.nodeType&&(Ce===mu?(ae?ae!==j&&((st=k[ae])?Je===st?Ze=!1:(se.insertBefore(st,G),j?R(j):z(G,se,!0),G=st):Ze=!1):j&&(Ze=!1),Ze=Ze!==!1&&$d(G,_),Ze&&H(G,_)):(Ce===yk||Ce==vk)&&(Ze=!0,G.nodeValue!==_.nodeValue&&(G.nodeValue=_.nodeValue))),Ze){_=at,G=Je;continue e}j?R(j):z(G,se,!0),G=Je}if(ae&&(st=k[ae])&&$d(st,_))K||w(se,st),H(st,_);else{var Xt=a(_);Xt!==!1&&(Xt&&(_=Xt),_.actualize&&(_=_.actualize(se.ownerDocument||gi)),w(se,_),Z(_))}_=at,G=Je}re(se,G,j);var ct=gk[se.nodeName];ct&&ct(se,he)}var oe=r,pe=oe.nodeType,fe=i.nodeType;if(!x){if(pe===mu)fe===mu?$d(r,i)||(d(r),oe=hM(r,fM(i.nodeName,i.namespaceURI))):oe=i;else if(pe===yk||pe===vk){if(fe===pe)return oe.nodeValue!==i.nodeValue&&(oe.nodeValue=i.nodeValue),oe;oe=i}}if(oe===i)d(r);else{if(i.isSameNode&&i.isSameNode(oe))return;if(H(oe,i,x),C)for(var ge=0,ve=C.length;ge{if(r&&r.isSameNode(i)&&de.isFormInput(i))return de.mergeFocusedInput(i,n),!1}})}constructor(t,e,r,i,n,o){this.view=t,this.liveSocket=t.liveSocket,this.container=e,this.id=r,this.rootID=t.root.id,this.html=i,this.streams=n,this.streamInserts={},this.targetCID=o,this.cidPatch=wo(this.targetCID),this.pendingRemoves=[],this.phxRemove=this.liveSocket.binding("remove"),this.callbacks={beforeadded:[],beforeupdated:[],beforephxChildAdded:[],afteradded:[],afterupdated:[],afterdiscarded:[],afterphxChildAdded:[],aftertransitionsDiscarded:[]}}before(t,e){this.callbacks[`before${t}`].push(e)}after(t,e){this.callbacks[`after${t}`].push(e)}trackBefore(t,...e){this.callbacks[`before${t}`].forEach(r=>r(...e))}trackAfter(t,...e){this.callbacks[`after${t}`].forEach(r=>r(...e))}markPrunableContentForRemoval(){let t=this.liveSocket.binding(Nd);de.all(this.container,`[${t}=${Pd}]`,e=>e.innerHTML=""),de.all(this.container,`[${t}=append] > *, [${t}=prepend] > *`,e=>{e.setAttribute(tk,"")})}perform(t){let{view:e,liveSocket:r,container:i,html:n}=this,o=this.isCIDPatch()?this.targetCIDContainer(n):i;if(this.isCIDPatch()&&!o)return;let s=r.getActiveElement(),{selectionStart:a,selectionEnd:l}=s&&de.hasSelectionRange(s)?s:{},c=r.binding(Nd),u=r.binding(Dd),f=r.binding(d1),d=r.binding(Qk),p=r.binding(_k),O=r.binding(Xz),w=[],x=[],k=[],C=[],R=null;return this.trackBefore("added",i),this.trackBefore("updated",i,i),r.time("morphdom",()=>{this.streams.forEach(([Q,z,L,Z])=>{Object.entries(z).forEach(([re,[H,q]])=>{this.streamInserts[re]={ref:Q,streamAt:H,limit:q,resetKept:!1}}),Z!==void 0&&de.all(i,`[${hu}="${Q}"]`,re=>{z[re.id]?this.streamInserts[re.id].resetKept=!0:this.removeStreamChildElement(re)}),L.forEach(re=>{let H=i.querySelector(`[id="${re}"]`);H&&this.removeStreamChildElement(H)})}),wk(o,n,{childrenOnly:o.getAttribute(xo)===null,getNodeKey:Q=>de.isPhxDestroyed(Q)?null:t?Q.id:Q.id||Q.getAttribute&&Q.getAttribute(Pk),skipFromChildren:Q=>Q.getAttribute(c)===Pd,addChild:(Q,z)=>{let{ref:L,streamAt:Z,limit:re}=this.getStreamInsert(z);if(L===void 0)return Q.appendChild(z);if(de.putSticky(z,hu,oe=>oe.setAttribute(hu,L)),Z===0)Q.insertAdjacentElement("afterbegin",z);else if(Z===-1)Q.appendChild(z);else if(Z>0){let oe=Array.from(Q.children)[Z];Q.insertBefore(z,oe)}let H=re!==null&&Array.from(Q.children),q=[];re&&re<0&&H.length>re*-1?q=H.slice(0,H.length+re):re&&re>=0&&H.length>re&&(q=H.slice(re)),q.forEach(oe=>{this.streamInserts[oe.id]||this.removeStreamChildElement(oe)})},onBeforeNodeAdded:Q=>(de.maybeAddPrivateHooks(Q,d,p),this.trackBefore("added",Q),Q),onNodeAdded:Q=>{Q.getAttribute&&this.maybeReOrderStream(Q),Q instanceof HTMLImageElement&&Q.srcset?Q.srcset=Q.srcset:Q instanceof HTMLVideoElement&&Q.autoplay&&Q.play(),de.isNowTriggerFormExternal(Q,O)&&(R=Q),Q.getAttribute&&Q.getAttribute("name")&&de.isFormInput(Q)&&x.push(Q),(de.isPhxChild(Q)&&e.ownsElement(Q)||de.isPhxSticky(Q)&&e.ownsElement(Q.parentNode))&&this.trackAfter("phxChildAdded",Q),w.push(Q)},onBeforeElChildrenUpdated:(Q,z)=>{if(Q.getAttribute(c)===Pd){let L=Array.from(z.children).map(Z=>Z.id);Array.from(Q.children).filter(Z=>{let{resetKept:re}=this.getStreamInsert(Z);return re}).sort((Z,re)=>{let H=L.indexOf(Z.id),q=L.indexOf(re.id);return H===q?0:HQ.appendChild(Z))}},onNodeDiscarded:Q=>this.onNodeDiscarded(Q),onBeforeNodeDiscarded:Q=>Q.getAttribute&&Q.getAttribute(tk)!==null?!0:!(Q.parentElement!==null&&Q.id&&de.isPhxUpdate(Q.parentElement,c,[Pd,"append","prepend"])||this.maybePendingRemove(Q)||this.skipCIDSibling(Q)),onElUpdated:Q=>{de.isNowTriggerFormExternal(Q,O)&&(R=Q),k.push(Q),this.maybeReOrderStream(Q)},onBeforeElUpdated:(Q,z)=>{if(de.maybeAddPrivateHooks(z,d,p),de.cleanChildNodes(z,c),this.skipCIDSibling(z)||de.isPhxSticky(Q))return!1;if(de.isIgnored(Q,c)||Q.form&&Q.form.isSameNode(R))return this.trackBefore("updated",Q,z),de.mergeAttrs(Q,z,{isIgnored:!0}),k.push(Q),de.applyStickyOperations(Q),!1;if(Q.type==="number"&&Q.validity&&Q.validity.badInput)return!1;if(!de.syncPendingRef(Q,z,f))return de.isUploadInput(Q)&&(this.trackBefore("updated",Q,z),k.push(Q)),de.applyStickyOperations(Q),!1;if(de.isPhxChild(z)){let Z=Q.getAttribute(bs);return de.mergeAttrs(Q,z,{exclude:[gu]}),Z!==""&&Q.setAttribute(bs,Z),Q.setAttribute(yu,this.rootID),de.applyStickyOperations(Q),!1}return de.copyPrivates(z,Q),s&&Q.isSameNode(s)&&de.isFormInput(Q)&&Q.type!=="hidden"?(this.trackBefore("updated",Q,z),de.mergeFocusedInput(Q,z),de.syncAttrsToProps(Q),k.push(Q),de.applyStickyOperations(Q),x.push(Q),!1):(de.isPhxUpdate(z,c,["append","prepend"])&&C.push(new rM(Q,z,z.getAttribute(c))),de.syncAttrsToProps(z),de.applyStickyOperations(z),z.getAttribute("name")&&de.isFormInput(z)&&x.push(z),this.trackBefore("updated",Q,z),!0)}})}),r.isDebugEnabled()&&Wz(),C.length>0&&r.time("post-morph append/prepend restoration",()=>{C.forEach(Q=>Q.perform())}),de.maybeHideFeedback(o,x,u),r.silenceEvents(()=>de.restoreFocus(s,a,l)),de.dispatchEvent(document,"phx:update"),w.forEach(Q=>this.trackAfter("added",Q)),k.forEach(Q=>this.trackAfter("updated",Q)),this.transitionPendingRemoves(),R&&(r.unload(),Object.getPrototypeOf(R).submit.call(R)),!0}onNodeDiscarded(t){(de.isPhxChild(t)||de.isPhxSticky(t))&&this.liveSocket.destroyViewByEl(t),this.trackAfter("discarded",t)}maybePendingRemove(t){return t.getAttribute&&t.getAttribute(this.phxRemove)!==null?(this.pendingRemoves.push(t),!0):!1}removeStreamChildElement(t){this.maybePendingRemove(t)||(t.remove(),this.onNodeDiscarded(t))}getStreamInsert(t){return(t.id?this.streamInserts[t.id]:{})||{}}maybeReOrderStream(t){let{ref:e,streamAt:r,limit:i}=this.getStreamInsert(t);if(r!==void 0){if(de.putSticky(t,hu,n=>n.setAttribute(hu,e)),r===0)t.parentElement.insertBefore(t,t.parentElement.firstElementChild);else if(r>0){let n=Array.from(t.parentElement.children),o=n.indexOf(t);if(r>=n.length-1)t.parentElement.appendChild(t);else{let s=n[r];o>r?t.parentElement.insertBefore(t,s):t.parentElement.insertBefore(t,s.nextElementSibling)}}}}transitionPendingRemoves(){let{pendingRemoves:t,liveSocket:e}=this;t.length>0&&(e.transitionRemoves(t),e.requestDOMUpdate(()=>{t.forEach(r=>{let i=de.firstPhxChild(r);i&&e.destroyViewByEl(i),r.remove()}),this.trackAfter("transitionsDiscarded",t)}))}isCIDPatch(){return this.cidPatch}skipCIDSibling(t){return t.nodeType===Node.ELEMENT_NODE&&t.hasAttribute(Ck)}targetCIDContainer(t){if(!this.isCIDPatch())return;let[e,...r]=de.findComponentNodeList(this.container,this.targetCID);return r.length===0&&de.childNodeLength(t)===1?e:e&&e.parentNode}indexOf(t,e){return Array.from(t.children).indexOf(e)}},OM=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),gM=new Set([">","/"," ",` `," ","\r"]),bM=new Set(["'",'"']),xk=(t,e,r)=>{let i=0,n=!1,o,s,a,l,c,u;for(;i"?(n=!1,i+=3):i++;else if(p==="<"&&t.slice(i,i+4)==="` to close comments"},abruptDoctypePublicIdentifier:{reason:"Unexpected abruptly closed public identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:"Unexpected abruptly closed system identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:"Unexpected non-digit at start of numeric character reference",description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:"Unexpected CDATA section in HTML",description:"Unexpected `` in ``",description:"Unexpected text character `%c`. Only use text in `