shift73k/priv/static/assets/app-0219437518c49e2ce7636ddbcb242015.js

82 lines
146 KiB
JavaScript

(function(){var e=t();function t(){if(typeof window.CustomEvent=="function")return window.CustomEvent;function r(s,o){o=o||{bubbles:!1,cancelable:!1,detail:void 0};var a=document.createEvent("CustomEvent");return a.initCustomEvent(s,o.bubbles,o.cancelable,o.detail),a}return r.prototype=window.Event.prototype,r}function i(r,s){var o=document.createElement("input");return o.type="hidden",o.name=r,o.value=s,o}function n(r,s){var o=r.getAttribute("data-to"),a=i("_method",r.getAttribute("data-method")),l=i("_csrf_token",r.getAttribute("data-csrf")),c=document.createElement("form"),d=r.getAttribute("target");c.method=r.getAttribute("data-method")==="get"?"get":"post",c.action=o,c.style.display="hidden",d?c.target=d:s&&(c.target="_blank"),c.appendChild(l),c.appendChild(a),document.body.appendChild(c),c.submit()}window.addEventListener("click",function(r){var s=r.target;if(!r.defaultPrevented)for(;s&&s.getAttribute;){var o=new e("phoenix.link.click",{bubbles:!0,cancelable:!0});if(!s.dispatchEvent(o))return r.preventDefault(),r.stopImmediatePropagation(),!1;if(s.getAttribute("data-method"))return n(s,r.metaKey||r.shiftKey),r.preventDefault(),!1;s=s.parentNode}},!1),window.addEventListener("phoenix.link.click",function(r){var s=r.target.getAttribute("data-confirm");s&&!window.confirm(s)&&r.preventDefault()},!1)})();var tt=e=>typeof e=="function"?e:function(){return e},nr=typeof self<"u"?self:null,et=typeof window<"u"?window:null,it=nr||et||it,rr="2.0.0",_e={connecting:0,open:1,closing:2,closed:3},sr=1e4,or=1e3,se={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},we={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},ii={longpoll:"longpoll",websocket:"websocket"},ar={complete:4},ut=class{constructor(e,t,i,n){this.channel=e,this.event=t,this.payload=i||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(e){this.timeout=e,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(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:e,response:t,_ref:i}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(t))}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,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},_n=class{constructor(e,t){this.callback=e,this.timerCalc=t,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))}},lr=class{constructor(e,t,i){this.state=se.closed,this.topic=e,this.params=tt(t||{}),this.socket=i,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new ut(this,we.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new _n(()=>{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=se.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=se.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=se.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=se.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 ut(this,we.leave,tt({}),this.timeout).send(),this.state=se.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(we.reply,(n,r)=>{this.trigger(this.replyEventName(r),n)})}join(e=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=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(e){this.on(we.close,e)}onError(e){return this.on(we.error,t=>e(t))}on(e,t){let i=this.bindingRef++;return this.bindings.push({event:e,ref:i,callback:t}),i}off(e,t){this.bindings=this.bindings.filter(i=>!(i.event===e&&(typeof t>"u"||t===i.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,i=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new ut(this,e,function(){return t},i);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=se.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(we.close,"leave")},i=new ut(this,we.leave,tt({}),e);return i.receive("ok",()=>t()).receive("timeout",()=>t()),i.send(),this.canPush()||i.trigger("ok",{}),i}onMessage(e,t,i){return t}isMember(e,t,i,n){return this.topic!==e?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:i,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=se.joining,this.joinPush.resend(e))}trigger(e,t,i,n){let r=this.onMessage(e,t,i,n);if(t&&!r)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let s=this.bindings.filter(o=>o.event===e);for(let o=0;o<s.length;o++)s[o].callback(r,i,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===se.closed}isErrored(){return this.state===se.errored}isJoined(){return this.state===se.joined}isJoining(){return this.state===se.joining}isLeaving(){return this.state===se.leaving}},kt=class{static request(e,t,i,n,r,s,o){if(it.XDomainRequest){let a=new it.XDomainRequest;return this.xdomainRequest(a,e,t,n,r,s,o)}else{let a=new it.XMLHttpRequest;return this.xhrRequest(a,e,t,i,n,r,s,o)}}static xdomainRequest(e,t,i,n,r,s,o){return e.timeout=r,e.open(t,i),e.onload=()=>{let a=this.parseJSON(e.responseText);o&&o(a)},s&&(e.ontimeout=s),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,i,n,r,s,o,a){return e.open(t,i,!0),e.timeout=s,e.setRequestHeader("Content-Type",n),e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(e.readyState===ar.complete&&a){let l=this.parseJSON(e.responseText);a(l)}},o&&(e.ontimeout=o),e.send(r),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let i=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=t?`${t}[${n}]`:n,s=e[n];typeof s=="object"?i.push(this.serialize(s,r)):i.push(encodeURIComponent(r)+"="+encodeURIComponent(s))}return i.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let i=e.match(/\?/)?"&":"?";return`${e}${i}${this.serialize(t)}`}},Ht=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=_e.connecting,this.poll()}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+ii.websocket),"$1/"+ii.longpoll)}endpointURL(){return kt.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,i){this.close(e,t,i),this.readyState=_e.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===_e.open||this.readyState===_e.connecting}poll(){this.ajax("GET",null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:i,messages:n}=e;this.token=i}else t=0;switch(t){case 200:n.forEach(r=>{setTimeout(()=>this.onmessage({data:r}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=_e.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 ${t}`)}})}send(e){this.ajax("POST",e,()=>this.onerror("timeout"),t=>{(!t||t.status!==200)&&(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1))})}close(e,t,i){for(let r of this.reqs)r.abort();this.readyState=_e.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:i});typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,i,n){let r,s=()=>{this.reqs.delete(r),i()};r=kt.request(e,this.endpointURL(),"application/json",t,this.timeout,s,o=>{this.reqs.delete(r),this.isActive()&&n(o)}),this.reqs.add(r)}},ft={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let i=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(i))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[i,n,r,s,o]=JSON.parse(e);return t({join_ref:i,ref:n,topic:r,event:s,payload:o})}},binaryEncode(e){let{join_ref:t,ref:i,event:n,topic:r,payload:s}=e,o=this.META_LENGTH+t.length+i.length+r.length+n.length,a=new ArrayBuffer(this.HEADER_LENGTH+o),l=new DataView(a),c=0;l.setUint8(c++,this.KINDS.push),l.setUint8(c++,t.length),l.setUint8(c++,i.length),l.setUint8(c++,r.length),l.setUint8(c++,n.length),Array.from(t,h=>l.setUint8(c++,h.charCodeAt(0))),Array.from(i,h=>l.setUint8(c++,h.charCodeAt(0))),Array.from(r,h=>l.setUint8(c++,h.charCodeAt(0))),Array.from(n,h=>l.setUint8(c++,h.charCodeAt(0)));var d=new Uint8Array(a.byteLength+s.byteLength);return d.set(new Uint8Array(a),0),d.set(new Uint8Array(s),a.byteLength),d.buffer},binaryDecode(e){let t=new DataView(e),i=t.getUint8(0),n=new TextDecoder;switch(i){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,i){let n=t.getUint8(1),r=t.getUint8(2),s=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=i.decode(e.slice(o,o+n));o=o+n;let l=i.decode(e.slice(o,o+r));o=o+r;let c=i.decode(e.slice(o,o+s));o=o+s;let d=e.slice(o,e.byteLength);return{join_ref:a,ref:null,topic:l,event:c,payload:d}},decodeReply(e,t,i){let n=t.getUint8(1),r=t.getUint8(2),s=t.getUint8(3),o=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=i.decode(e.slice(a,a+n));a=a+n;let c=i.decode(e.slice(a,a+r));a=a+r;let d=i.decode(e.slice(a,a+s));a=a+s;let h=i.decode(e.slice(a,a+o));a=a+o;let g=e.slice(a,e.byteLength),u={status:h,response:g};return{join_ref:l,ref:c,topic:d,event:we.reply,payload:u}},decodeBroadcast(e,t,i){let n=t.getUint8(1),r=t.getUint8(2),s=this.HEADER_LENGTH+2,o=i.decode(e.slice(s,s+n));s=s+n;let a=i.decode(e.slice(s,s+r));s=s+r;let l=e.slice(s,e.byteLength);return{join_ref:null,ref:null,topic:o,event:a,payload:l}}},cr=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||sr,this.transport=t.transport||it.WebSocket||Ht,this.establishedConnections=0,this.defaultEncoder=ft.encode.bind(ft),this.defaultDecoder=ft.decode.bind(ft),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==Ht?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let i=null;et&&et.addEventListener&&(et.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),i=this.connectClock)}),et.addEventListener("pageshow",n=>{i===this.connectClock&&(i=null,this.connect())})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=n=>t.rejoinAfterMs?t.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>t.reconnectAfterMs?t.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=t.logger||null,this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=tt(t.params||{}),this.endPoint=`${e}/${ii.websocket}`,this.vsn=t.vsn||rr,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new _n(()=>{this.teardown(()=>this.connect())},this.reconnectAfterMs)}getLongPollTransport(){return Ht}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.sendBuffer=[],this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=kt.appendParams(kt.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,i){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.teardown(e,t,i)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=tt(e)),!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=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t))}log(e,t,i){this.logger(e,t,i)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),i=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(r=>{r.ref===t&&(this.off([n]),e(Date.now()-i))});return!0}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(([,e])=>e())}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.abnormalClose("heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,clearTimeout(this.heartbeatTimer),setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,i){if(!this.conn)return e&&e();this.waitForBufferDone(()=>{this.conn&&(t?this.conn.close(t,i||""):this.conn.close()),this.waitForSocketClosed(()=>{this.conn&&(this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t=1){if(t===5||!this.conn||!this.conn.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(e,t+1)},150*t)}waitForSocketClosed(e,t=1){if(t===5||!this.conn||this.conn.readyState===_e.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(e,t+1)},150*t)}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),clearTimeout(this.heartbeatTimer),!this.closeWasClean&&t!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,i])=>i(e))}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,i=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,n])=>{n(e,t,i)}),(t===this.transport||i>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(we.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case _e.connecting:return"connecting";case _e.open:return"open";case _e.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t.joinRef()!==e.joinRef())}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([i])=>e.indexOf(i)===-1)}channel(e,t={}){let i=new lr(e,t,this);return this.channels.push(i),i}push(e){if(this.hasLogger()){let{topic:t,event:i,payload:n,ref:r,join_ref:s}=e;this.log("push",`${t} ${i} (${s}, ${r})`,n)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs))}abnormalClose(e){this.closeWasClean=!1,this.isConnected()&&this.conn.close(or,e)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:i,event:n,payload:r,ref:s,join_ref:o}=t;s&&s===this.pendingHeartbeatRef&&(clearTimeout(this.heartbeatTimer),this.pendingHeartbeatRef=null,setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${i} ${n} ${s&&"("+s+")"||""}`,r);for(let a=0;a<this.channels.length;a++){const l=this.channels[a];!l.isMember(i,n,r,o)||l.trigger(n,r,s,o)}for(let a=0;a<this.stateChangeCallbacks.message.length;a++){let[,l]=this.stateChangeCallbacks.message[a];l(t)}})}leaveOpenTopic(e){let t=this.channels.find(i=>i.topic===e&&(i.isJoined()||i.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}},Z=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hr(e){var t=e.default;if(typeof t=="function"){var i=function(){return t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}),i}var yn={exports:{}};/**
* @license MIT
* topbar 1.0.0, 2021-01-06
* http://buunguyen.github.io/topbar
* Copyright (c) 2021 Buu Nguyen
*/(function(e){(function(t,i){(function(){for(var h=0,g=["ms","moz","webkit","o"],u=0;u<g.length&&!t.requestAnimationFrame;++u)t.requestAnimationFrame=t[g[u]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[g[u]+"CancelAnimationFrame"]||t[g[u]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(b,m){var y=new Date().getTime(),S=Math.max(0,16-(y-h)),N=t.setTimeout(function(){b(y+S)},S);return h=y+S,N}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(b){clearTimeout(b)})})();function n(){r.width=t.innerWidth,r.height=5*c.barThickness;var h=r.getContext("2d");h.shadowBlur=c.shadowBlur,h.shadowColor=c.shadowColor;var g,u=h.createLinearGradient(0,0,r.width,0);for(g in c.barColors)u.addColorStop(g,c.barColors[g]);h.lineWidth=c.barThickness,h.beginPath(),h.moveTo(0,c.barThickness/2),h.lineTo(Math.ceil(a*r.width),c.barThickness/2),h.strokeStyle=u,h.stroke()}var r,s,o,a,l,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},d={config:function(h){for(var g in h)c.hasOwnProperty(g)&&(c[g]=h[g])},show:function(){var h,g,u;l||(l=!0,o!==null&&t.cancelAnimationFrame(o),r||((u=(r=i.createElement("canvas")).style).position="fixed",u.top=u.left=u.right=u.margin=u.padding=0,u.zIndex=100001,u.display="none",c.className&&r.classList.add(c.className),i.body.appendChild(r),h="resize",g=n,(u=t).addEventListener?u.addEventListener(h,g,!1):u.attachEvent?u.attachEvent("on"+h,g):u["on"+h]=g),r.style.opacity=1,r.style.display="block",d.progress(0),c.autoRun&&function b(){s=t.requestAnimationFrame(b),d.progress("+"+.05*Math.pow(1-Math.sqrt(a),2))}())},progress:function(h){return h===void 0||(typeof h=="string"&&(h=(0<=h.indexOf("+")||0<=h.indexOf("-")?a:0)+parseFloat(h)),a=1<h?1:h,n()),a},hide:function(){l&&(l=!1,s!=null&&(t.cancelAnimationFrame(s),s=null),function h(){return 1<=d.progress("+.1")&&(r.style.opacity-=.05,r.style.opacity<=.05)?(r.style.display="none",void(o=null)):void(o=t.requestAnimationFrame(h))}())}};e.exports=d}).call(Z,window,document)})(yn);const ui=yn.exports;var En="consecutive-reloads",dr=10,ur=5e3,fr=1e4,pr=3e4,An=["phx-click-loading","phx-change-loading","phx-submit-loading","phx-keydown-loading","phx-keyup-loading","phx-blur-loading","phx-focus-loading"],ae="data-phx-component",$t="data-phx-link",gr="track-static",mr="data-phx-link-state",be="data-phx-ref",Re="data-phx-ref-src",wn="track-uploads",Ie="data-phx-upload-ref",fi="data-phx-preflighted-refs",vr="data-phx-done-refs",xi="drop-target",ni="data-phx-active-refs",ri="phx:live-file:updated",si="data-phx-skip",Ri="data-phx-prune",Ni="page-loading",Ii="phx-connected",jt="phx-loading",Mi="phx-no-feedback",Hi="phx-error",je="data-phx-parent-id",pi="data-phx-main",at="data-phx-root-id",br="trigger-action",oi="feedback-for",Cn="phx-has-focused",_r=["text","textarea","number","email","password","search","tel","url","date","time","datetime-local","color","range"],Tn=["checkbox","radio"],Sn="phx-has-submitted",De="data-phx-session",Be=`[${De}]`,$i="data-phx-sticky",nt="data-phx-static",Bt="data-phx-readonly",pt="data-phx-disabled",ai="disable-with",gt="data-phx-disable-with-restore",ze="hook",yr="debounce",Er="throttle",li="update",Ar="key",ge="phxPrivate",ji="auto-recover",mt="phx:live-socket:debug",Ft="phx:live-socket:profiling",Ut="phx:live-socket:latency-sim",wr="progress",Cr=1,Tr=200,Sr="phx-",kr=3e4,Ye="debounce-trigger",vt="throttled",Bi="debounce-prev-key",Or={debounce:300,throttle:300},Fi="d",me="s",oe="c",Ui="e",Vi="r",Wi="t",Dr="p",Lr=class{constructor(e,t,i){this.liveSocket=i,this.entry=e,this.offset=0,this.chunkSize=t,this.chunkTimer=null,this.uploadChannel=i.channel(`lvu:${e.ref}`,{token:e.metadata()})}error(e){clearTimeout(this.chunkTimer),this.uploadChannel.leave(),this.entry.error(e)}upload(){this.uploadChannel.onError(e=>this.error(e)),this.uploadChannel.join().receive("ok",e=>this.readNextChunk()).receive("error",e=>this.error(e))}isDone(){return this.offset>=this.entry.file.size}readNextChunk(){let e=new window.FileReader,t=this.entry.file.slice(this.offset,this.chunkSize+this.offset);e.onload=i=>{if(i.target.error===null)this.offset+=i.target.result.byteLength,this.pushChunk(i.target.result);else return Q("Read error: "+i.target.error)},e.readAsArrayBuffer(t)}pushChunk(e){!this.uploadChannel.isJoined()||this.uploadChannel.push("chunk",e).receive("ok",()=>{this.entry.progress(this.offset/this.entry.file.size*100),this.isDone()||(this.chunkTimer=setTimeout(()=>this.readNextChunk(),this.liveSocket.getLatencySim()||0))})}},Q=(e,t)=>console.error&&console.error(e,t),Oe=e=>{let t=typeof e;return t==="number"||t==="string"&&/^(0|[1-9]\d*)$/.test(e)};function Pr(){let e=new Set,t=document.querySelectorAll("*[id]");for(let i=0,n=t.length;i<n;i++)e.has(t[i].id)?console.error(`Multiple IDs detected: ${t[i].id}. Ensure unique element ids.`):e.add(t[i].id)}var xr=(e,t,i,n)=>{e.liveSocket.isDebugEnabled()&&console.log(`${e.id} ${t}: ${i} - `,n)},Vt=e=>typeof e=="function"?e:function(){return e},Tt=e=>JSON.parse(JSON.stringify(e)),rt=(e,t,i)=>{do{if(e.matches(`[${t}]`))return e;e=e.parentElement||e.parentNode}while(e!==null&&e.nodeType===1&&!(i&&i.isSameNode(e)||e.matches(Be)));return null},Ge=e=>e!==null&&typeof e=="object"&&!(e instanceof Array),Rr=(e,t)=>JSON.stringify(e)===JSON.stringify(t),qi=e=>{for(let t in e)return!1;return!0},Ce=(e,t)=>e&&t(e),Nr=function(e,t,i,n){e.forEach(r=>{new Lr(r,i.config.chunk_size,n).upload()})},kn={canPushState(){return typeof history.pushState<"u"},dropLocal(e,t,i){return e.removeItem(this.localKey(t,i))},updateLocal(e,t,i,n,r){let s=this.getLocal(e,t,i),o=this.localKey(t,i),a=s===null?n:r(s);return e.setItem(o,JSON.stringify(a)),a},getLocal(e,t,i){return JSON.parse(e.getItem(this.localKey(t,i)))},updateCurrentState(e){!this.canPushState()||history.replaceState(e(history.state||{}),"",window.location.href)},pushState(e,t,i){if(this.canPushState()){if(i!==window.location.href){if(t.type=="redirect"&&t.scroll){let r=history.state||{};r.scroll=t.scroll,history.replaceState(r,"",window.location.href)}delete t.scroll,history[e+"State"](t,"",i||null);let n=this.getHashTargetEl(window.location.hash);n?n.scrollIntoView():t.type==="redirect"&&window.scroll(0,0)}}else this.redirect(i)},setCookie(e,t){document.cookie=`${e}=${t}`},getCookie(e){return document.cookie.replace(new RegExp(`(?:(?:^|.*;s*)${e}s*=s*([^;]*).*$)|^.*$`),"$1")},redirect(e,t){t&&kn.setCookie("__phoenix_flash__",t+"; max-age=60000; path=/"),window.location=e},localKey(e,t){return`${e}-${t}`},getHashTargetEl(e){let t=e.toString().substring(1);if(t!=="")return document.getElementById(t)||document.querySelector(`a[name="${t}"]`)}},ke=kn,fe={byId(e){return document.getElementById(e)||Q(`no id found for ${e}`)},removeClass(e,t){e.classList.remove(t),e.classList.length===0&&e.removeAttribute("class")},all(e,t,i){if(!e)return[];let n=Array.from(e.querySelectorAll(t));return i?n.forEach(i):n},childNodeLength(e){let t=document.createElement("template");return t.innerHTML=e,t.content.childElementCount},isUploadInput(e){return e.type==="file"&&e.getAttribute(Ie)!==null},findUploadInputs(e){return this.all(e,`input[type="file"][${Ie}]`)},findComponentNodeList(e,t){return this.filterWithinSameLiveView(this.all(e,`[${ae}="${t}"]`),e)},isPhxDestroyed(e){return!!(e.id&&fe.private(e,"destroyed"))},markPhxChildDestroyed(e){this.isPhxChild(e)&&e.setAttribute(De,""),this.putPrivate(e,"destroyed",!0)},findPhxChildrenInFragment(e,t){let i=document.createElement("template");return i.innerHTML=e,this.findPhxChildren(i.content,t)},isIgnored(e,t){return(e.getAttribute(t)||e.getAttribute("data-phx-update"))==="ignore"},isPhxUpdate(e,t,i){return e.getAttribute&&i.indexOf(e.getAttribute(t))>=0},findPhxSticky(e){return this.all(e,`[${$i}]`)},findPhxChildren(e,t){return this.all(e,`${Be}[${je}="${t}"]`)},findParentCIDs(e,t){let i=new Set(t);return t.reduce((n,r)=>{let s=`[${ae}="${r}"] [${ae}]`;return this.filterWithinSameLiveView(this.all(e,s),e).map(o=>parseInt(o.getAttribute(ae))).forEach(o=>n.delete(o)),n},i)},filterWithinSameLiveView(e,t){return t.querySelector(Be)?e.filter(i=>this.withinSameLiveView(i,t)):e},withinSameLiveView(e,t){for(;e=e.parentNode;){if(e.isSameNode(t))return!0;if(e.getAttribute(De)!==null)return!1}},private(e,t){return e[ge]&&e[ge][t]},deletePrivate(e,t){e[ge]&&delete e[ge][t]},putPrivate(e,t,i){e[ge]||(e[ge]={}),e[ge][t]=i},updatePrivate(e,t,i,n){let r=this.private(e,t);r===void 0?this.putPrivate(e,t,n(i)):this.putPrivate(e,t,n(r))},copyPrivates(e,t){t[ge]&&(e[ge]=t[ge])},putTitle(e){let t=document.querySelector("title"),{prefix:i,suffix:n}=t.dataset;document.title=`${i||""}${e}${n||""}`},debounce(e,t,i,n,r,s,o,a){let l=e.getAttribute(i),c=e.getAttribute(r);l===""&&(l=n),c===""&&(c=s);let d=l||c;switch(d){case null:return a();case"blur":this.once(e,"debounce-blur")&&e.addEventListener("blur",()=>a());return;default:let h=parseInt(d),g=()=>c?this.deletePrivate(e,vt):a(),u=this.incCycle(e,Ye,g);if(isNaN(h))return Q(`invalid throttle/debounce value: ${d}`);if(c){let m=!1;if(t.type==="keydown"){let y=this.private(e,Bi);this.putPrivate(e,Bi,t.key),m=y!==t.key}if(!m&&this.private(e,vt))return!1;a(),this.putPrivate(e,vt,!0),setTimeout(()=>{o()&&this.triggerCycle(e,Ye)},h)}else setTimeout(()=>{o()&&this.triggerCycle(e,Ye,u)},h);let b=e.form;b&&this.once(b,"bind-debounce")&&b.addEventListener("submit",()=>{Array.from(new FormData(b).entries(),([m])=>{let y=b.querySelector(`[name="${m}"]`);this.incCycle(y,Ye),this.deletePrivate(y,vt)})}),this.once(e,"bind-debounce")&&e.addEventListener("blur",()=>this.triggerCycle(e,Ye))}},triggerCycle(e,t,i){let[n,r]=this.private(e,t);i||(i=n),i===n&&(this.incCycle(e,t),r())},once(e,t){return this.private(e,t)===!0?!1:(this.putPrivate(e,t,!0),!0)},incCycle(e,t,i=function(){}){let[n]=this.private(e,t)||[0,i];return n++,this.putPrivate(e,t,[n,i]),n},discardError(e,t,i){let n=t.getAttribute&&t.getAttribute(i),r=n&&e.querySelector(`[id="${n}"], [name="${n}"]`);!r||this.private(r,Cn)||this.private(r.form,Sn)||t.classList.add(Mi)},showError(e,t){(e.id||e.name)&&this.all(e.form,`[${t}="${e.id}"], [${t}="${e.name}"]`,i=>{this.removeClass(i,Mi)})},isPhxChild(e){return e.getAttribute&&e.getAttribute(je)},isPhxSticky(e){return e.getAttribute&&e.getAttribute($i)!==null},firstPhxChild(e){return this.isPhxChild(e)?e:this.all(e,`[${je}]`)[0]},dispatchEvent(e,t,i={}){let r={bubbles:i.bubbles===void 0?!0:!!i.bubbles,cancelable:!0,detail:i.detail||{}},s=t==="click"?new MouseEvent("click",r):new CustomEvent(t,r);e.dispatchEvent(s)},cloneNode(e,t){if(typeof t>"u")return e.cloneNode(!0);{let i=e.cloneNode(!1);return i.innerHTML=t,i}},mergeAttrs(e,t,i={}){let n=i.exclude||[],r=i.isIgnored,s=t.attributes;for(let a=s.length-1;a>=0;a--){let l=s[a].name;n.indexOf(l)<0&&e.setAttribute(l,t.getAttribute(l))}let o=e.attributes;for(let a=o.length-1;a>=0;a--){let l=o[a].name;r?l.startsWith("data-")&&!t.hasAttribute(l)&&e.removeAttribute(l):t.hasAttribute(l)||e.removeAttribute(l)}},mergeFocusedInput(e,t){e instanceof HTMLSelectElement||fe.mergeAttrs(e,t,{exclude:["value"]}),t.readOnly?e.setAttribute("readonly",!0):e.removeAttribute("readonly")},hasSelectionRange(e){return e.setSelectionRange&&(e.type==="text"||e.type==="textarea")},restoreFocus(e,t,i){if(!fe.isTextualInput(e))return;let n=e.matches(":focus");e.readOnly&&e.blur(),n||e.focus(),this.hasSelectionRange(e)&&e.setSelectionRange(t,i)},isFormInput(e){return/^(?:input|select|textarea)$/i.test(e.tagName)&&e.type!=="button"},syncAttrsToProps(e){e instanceof HTMLInputElement&&Tn.indexOf(e.type.toLocaleLowerCase())>=0&&(e.checked=e.getAttribute("checked")!==null)},isTextualInput(e){return _r.indexOf(e.type)>=0},isNowTriggerFormExternal(e,t){return e.getAttribute&&e.getAttribute(t)!==null},syncPendingRef(e,t,i){let n=e.getAttribute(be);if(n===null)return!0;let r=e.getAttribute(Re);return fe.isFormInput(e)||e.getAttribute(i)!==null?(fe.isUploadInput(e)&&fe.mergeAttrs(e,t,{isIgnored:!0}),fe.putPrivate(e,be,t),!1):(An.forEach(s=>{e.classList.contains(s)&&t.classList.add(s)}),t.setAttribute(be,n),t.setAttribute(Re,r),!0)},cleanChildNodes(e,t){if(fe.isPhxUpdate(e,t,["append","prepend"])){let i=[];e.childNodes.forEach(n=>{n.id||(n.nodeType===Node.TEXT_NODE&&n.nodeValue.trim()===""||Q(`only HTML element tags with an id are allowed inside containers with phx-update.
removing illegal node: "${(n.outerHTML||n.nodeValue).trim()}"
`),i.push(n))}),i.forEach(n=>n.remove())}},replaceRootContainer(e,t,i){let n=new Set(["id",De,nt,pi,at]);if(e.tagName.toLowerCase()===t.toLowerCase())return Array.from(e.attributes).filter(r=>!n.has(r.name.toLowerCase())).forEach(r=>e.removeAttribute(r.name)),Object.keys(i).filter(r=>!n.has(r.toLowerCase())).forEach(r=>e.setAttribute(r,i[r])),e;{let r=document.createElement(t);return Object.keys(i).forEach(s=>r.setAttribute(s,i[s])),n.forEach(s=>r.setAttribute(s,e.getAttribute(s))),r.innerHTML=e.innerHTML,e.replaceWith(r),r}},getSticky(e,t,i){let n=(fe.private(e,"sticky")||[]).find(([r])=>t===r);if(n){let[r,s,o]=n;return o}else return typeof i=="function"?i():i},deleteSticky(e,t){this.updatePrivate(e,"sticky",[],i=>i.filter(([n,r])=>n!==t))},putSticky(e,t,i){let n=i(e);this.updatePrivate(e,"sticky",[],r=>{let s=r.findIndex(([o])=>t===o);return s>=0?r[s]=[t,i,n]:r.push([t,i,n]),r})},applyStickyOperations(e){let t=fe.private(e,"sticky");!t||t.forEach(([i,n,r])=>this.putSticky(e,i,n))}},_=fe,Wt=class{static isActive(e,t){let i=t._phxRef===void 0,r=e.getAttribute(ni).split(",").indexOf(G.genFileRef(t))>=0;return t.size>0&&(i||r)}static isPreflighted(e,t){return e.getAttribute(fi).split(",").indexOf(G.genFileRef(t))>=0&&this.isActive(e,t)}constructor(e,t,i){this.ref=G.genFileRef(t),this.fileEl=e,this.file=t,this.view=i,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(ri,this._onElUpdated)}metadata(){return this.meta}progress(e){this._progress=Math.floor(e),this._progress>this._lastProgressSent&&(this._progress>=100?(this._progress=100,this._lastProgressSent=100,this._isDone=!0,this.view.pushFileProgress(this.fileEl,this.ref,100,()=>{G.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(e="failed"){this.view.pushFileProgress(this.fileEl,this.ref,{error:e}),G.clearFiles(this.fileEl)}onDone(e){this._onDone=()=>{this.fileEl.removeEventListener(ri,this._onElUpdated),e()}}onElUpdated(){this.fileEl.getAttribute(ni).split(",").indexOf(this.ref)===-1&&this.cancel()}toPreflightPayload(){return{last_modified:this.file.lastModified,name:this.file.name,size:this.file.size,type:this.file.type,ref:this.ref}}uploader(e){if(this.meta.uploader){let t=e[this.meta.uploader]||Q(`no uploader configured for ${this.meta.uploader}`);return{name:this.meta.uploader,callback:t}}else return{name:"channel",callback:Nr}}zipPostFlight(e){this.meta=e.entries[this.ref],this.meta||Q(`no preflight upload response returned with ref ${this.ref}`,{input:this.fileEl,response:e})}},Ir=0,G=class{static genFileRef(e){let t=e._phxRef;return t!==void 0?t:(e._phxRef=(Ir++).toString(),e._phxRef)}static getEntryDataURL(e,t,i){let n=this.activeFiles(e).find(r=>this.genFileRef(r)===t);i(URL.createObjectURL(n))}static hasUploadsInProgress(e){let t=0;return _.findUploadInputs(e).forEach(i=>{i.getAttribute(fi)!==i.getAttribute(vr)&&t++}),t>0}static serializeUploads(e){let t=this.activeFiles(e),i={};return t.forEach(n=>{let r={path:e.name},s=e.getAttribute(Ie);i[s]=i[s]||[],r.ref=this.genFileRef(n),r.name=n.name||r.ref,r.type=n.type,r.size=n.size,i[s].push(r)}),i}static clearFiles(e){e.value=null,e.removeAttribute(Ie),_.putPrivate(e,"files",[])}static untrackFile(e,t){_.putPrivate(e,"files",_.private(e,"files").filter(i=>!Object.is(i,t)))}static trackFiles(e,t){if(e.getAttribute("multiple")!==null){let i=t.filter(n=>!this.activeFiles(e).find(r=>Object.is(r,n)));_.putPrivate(e,"files",this.activeFiles(e).concat(i)),e.value=null}else _.putPrivate(e,"files",t)}static activeFileInputs(e){let t=_.findUploadInputs(e);return Array.from(t).filter(i=>i.files&&this.activeFiles(i).length>0)}static activeFiles(e){return(_.private(e,"files")||[]).filter(t=>Wt.isActive(e,t))}static inputsAwaitingPreflight(e){let t=_.findUploadInputs(e);return Array.from(t).filter(i=>this.filesAwaitingPreflight(i).length>0)}static filesAwaitingPreflight(e){return this.activeFiles(e).filter(t=>!Wt.isPreflighted(e,t))}constructor(e,t,i){this.view=t,this.onComplete=i,this._entries=Array.from(G.filesAwaitingPreflight(e)||[]).map(n=>new Wt(e,n,t)),this.numEntriesInProgress=this._entries.length}entries(){return this._entries}initAdapterUpload(e,t,i){this._entries=this._entries.map(r=>(r.zipPostFlight(e),r.onDone(()=>{this.numEntriesInProgress--,this.numEntriesInProgress===0&&this.onComplete()}),r));let n=this._entries.reduce((r,s)=>{let{name:o,callback:a}=s.uploader(i.uploaders);return r[o]=r[o]||{callback:a,entries:[]},r[o].entries.push(s),r},{});for(let r in n){let{callback:s,entries:o}=n[r];s(o,t,e,i)}}},Mr={LiveFileUpload:{activeRefs(){return this.el.getAttribute(ni)},preflightedRefs(){return this.el.getAttribute(fi)},mounted(){this.preflightedWas=this.preflightedRefs()},updated(){let e=this.preflightedRefs();this.preflightedWas!==e&&(this.preflightedWas=e,e===""&&this.__view.cancelSubmit(this.el.form)),this.activeRefs()===""&&(this.el.value=null),this.el.dispatchEvent(new CustomEvent(ri))}},LiveImgPreview:{mounted(){this.ref=this.el.getAttribute("data-phx-entry-ref"),this.inputEl=document.getElementById(this.el.getAttribute(Ie)),G.getEntryDataURL(this.inputEl,this.ref,e=>{this.url=e,this.el.src=e})},destroyed(){URL.revokeObjectURL(this.url)}}},Hr=Mr,$r=class{constructor(e,t,i){let n=new Set,r=new Set([...t.children].map(o=>o.id)),s=[];Array.from(e.children).forEach(o=>{if(o.id&&(n.add(o.id),r.has(o.id))){let a=o.previousElementSibling&&o.previousElementSibling.id;s.push({elementId:o.id,previousElementId:a})}}),this.containerId=t.id,this.updateType=i,this.elementsToModify=s,this.elementIdsToAdd=[...r].filter(o=>!n.has(o))}perform(){let e=_.byId(this.containerId);this.elementsToModify.forEach(t=>{t.previousElementId?Ce(document.getElementById(t.previousElementId),i=>{Ce(document.getElementById(t.elementId),n=>{n.previousElementSibling&&n.previousElementSibling.id==i.id||i.insertAdjacentElement("afterend",n)})}):Ce(document.getElementById(t.elementId),i=>{i.previousElementSibling==null||e.insertAdjacentElement("afterbegin",i)})}),this.updateType=="prepend"&&this.elementIdsToAdd.reverse().forEach(t=>{Ce(document.getElementById(t),i=>e.insertAdjacentElement("afterbegin",i))})}},Ki=11;function jr(e,t){var i=t.attributes,n,r,s,o,a;if(!(t.nodeType===Ki||e.nodeType===Ki)){for(var l=i.length-1;l>=0;l--)n=i[l],r=n.name,s=n.namespaceURI,o=n.value,s?(r=n.localName||r,a=e.getAttributeNS(s,r),a!==o&&(n.prefix==="xmlns"&&(r=n.name),e.setAttributeNS(s,r,o))):(a=e.getAttribute(r),a!==o&&e.setAttribute(r,o));for(var c=e.attributes,d=c.length-1;d>=0;d--)n=c[d],r=n.name,s=n.namespaceURI,s?(r=n.localName||r,t.hasAttributeNS(s,r)||e.removeAttributeNS(s,r)):t.hasAttribute(r)||e.removeAttribute(r)}}var bt,Br="http://www.w3.org/1999/xhtml",re=typeof document>"u"?void 0:document,Fr=!!re&&"content"in re.createElement("template"),Ur=!!re&&re.createRange&&"createContextualFragment"in re.createRange();function Vr(e){var t=re.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function Wr(e){bt||(bt=re.createRange(),bt.selectNode(re.body));var t=bt.createContextualFragment(e);return t.childNodes[0]}function qr(e){var t=re.createElement("body");return t.innerHTML=e,t.childNodes[0]}function Kr(e){return e=e.trim(),Fr?Vr(e):Ur?Wr(e):qr(e)}function _t(e,t){var i=e.nodeName,n=t.nodeName,r,s;return i===n?!0:(r=i.charCodeAt(0),s=n.charCodeAt(0),r<=90&&s>=97?i===n.toUpperCase():s<=90&&r>=97?n===i.toUpperCase():!1)}function Jr(e,t){return!t||t===Br?re.createElement(e):re.createElementNS(t,e)}function Xr(e,t){for(var i=e.firstChild;i;){var n=i.nextSibling;t.appendChild(i),i=n}return t}function qt(e,t,i){e[i]!==t[i]&&(e[i]=t[i],e[i]?e.setAttribute(i,""):e.removeAttribute(i))}var Ji={OPTION:function(e,t){var i=e.parentNode;if(i){var n=i.nodeName.toUpperCase();n==="OPTGROUP"&&(i=i.parentNode,n=i&&i.nodeName.toUpperCase()),n==="SELECT"&&!i.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),i.selectedIndex=-1)}qt(e,t,"selected")},INPUT:function(e,t){qt(e,t,"checked"),qt(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var i=t.value;e.value!==i&&(e.value=i);var n=e.firstChild;if(n){var r=n.nodeValue;if(r==i||!i&&r==e.placeholder)return;n.nodeValue=i}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var i=-1,n=0,r=e.firstChild,s,o;r;)if(o=r.nodeName&&r.nodeName.toUpperCase(),o==="OPTGROUP")s=r,r=s.firstChild;else{if(o==="OPTION"){if(r.hasAttribute("selected")){i=n;break}n++}r=r.nextSibling,!r&&s&&(r=s.nextSibling,s=null)}e.selectedIndex=i}}},Qe=1,zr=11,Xi=3,zi=8;function xe(){}function Yr(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function Gr(e){return function(i,n,r){if(r||(r={}),typeof n=="string")if(i.nodeName==="#document"||i.nodeName==="HTML"||i.nodeName==="BODY"){var s=n;n=re.createElement("html"),n.innerHTML=s}else n=Kr(n);var o=r.getNodeKey||Yr,a=r.onBeforeNodeAdded||xe,l=r.onNodeAdded||xe,c=r.onBeforeElUpdated||xe,d=r.onElUpdated||xe,h=r.onBeforeNodeDiscarded||xe,g=r.onNodeDiscarded||xe,u=r.onBeforeElChildrenUpdated||xe,b=r.childrenOnly===!0,m=Object.create(null),y=[];function S(T){y.push(T)}function N(T,w){if(T.nodeType===Qe)for(var v=T.firstChild;v;){var D=void 0;w&&(D=o(v))?S(D):(g(v),v.firstChild&&N(v,w)),v=v.nextSibling}}function f(T,w,v){h(T)!==!1&&(w&&w.removeChild(T),g(T),N(T,v))}function A(T){if(T.nodeType===Qe||T.nodeType===zr)for(var w=T.firstChild;w;){var v=o(w);v&&(m[v]=w),A(w),w=w.nextSibling}}A(i);function P(T){l(T);for(var w=T.firstChild;w;){var v=w.nextSibling,D=o(w);if(D){var M=m[D];M&&_t(w,M)?(w.parentNode.replaceChild(M,w),C(M,w)):P(w)}else P(w);w=v}}function E(T,w,v){for(;w;){var D=w.nextSibling;(v=o(w))?S(v):f(w,T,!0),w=D}}function C(T,w,v){var D=o(w);D&&delete m[D],!(!v&&(c(T,w)===!1||(e(T,w),d(T),u(T,w)===!1)))&&(T.nodeName!=="TEXTAREA"?x(T,w):Ji.TEXTAREA(T,w))}function x(T,w){var v=w.firstChild,D=T.firstChild,M,F,B,J,V;e:for(;v;){for(J=v.nextSibling,M=o(v);D;){if(B=D.nextSibling,v.isSameNode&&v.isSameNode(D)){v=J,D=B;continue e}F=o(D);var ee=D.nodeType,U=void 0;if(ee===v.nodeType&&(ee===Qe?(M?M!==F&&((V=m[M])?B===V?U=!1:(T.insertBefore(V,D),F?S(F):f(D,T,!0),D=V):U=!1):F&&(U=!1),U=U!==!1&&_t(D,v),U&&C(D,v)):(ee===Xi||ee==zi)&&(U=!0,D.nodeValue!==v.nodeValue&&(D.nodeValue=v.nodeValue))),U){v=J,D=B;continue e}F?S(F):f(D,T,!0),D=B}if(M&&(V=m[M])&&_t(V,v))T.appendChild(V),C(V,v);else{var K=a(v);K!==!1&&(K&&(v=K),v.actualize&&(v=v.actualize(T.ownerDocument||re)),T.appendChild(v),P(v))}v=J,D=B}E(T,D,F);var $=Ji[T.nodeName];$&&$(T,w)}var k=i,I=k.nodeType,H=n.nodeType;if(!b){if(I===Qe)H===Qe?_t(i,n)||(g(i),k=Xr(i,Jr(n.nodeName,n.namespaceURI))):k=n;else if(I===Xi||I===zi){if(H===I)return k.nodeValue!==n.nodeValue&&(k.nodeValue=n.nodeValue),k;k=n}}if(k===n)g(i);else{if(n.isSameNode&&n.isSameNode(k))return;if(C(k,n,b),y)for(var p=0,O=y.length;p<O;p++){var R=m[y[p]];R&&f(R,R.parentNode,!1)}}return!b&&k!==i&&i.parentNode&&(k.actualize&&(k=k.actualize(i.ownerDocument||re)),i.parentNode.replaceChild(k,i)),k}}var Qr=Gr(jr),Yi=Qr,yt=class{static patchEl(e,t,i){Yi(e,t,{childrenOnly:!1,onBeforeElUpdated:(n,r)=>{if(i&&i.isSameNode(n)&&_.isFormInput(n))return _.mergeFocusedInput(n,r),!1}})}constructor(e,t,i,n,r){this.view=e,this.liveSocket=e.liveSocket,this.container=t,this.id=i,this.rootID=e.root.id,this.html=n,this.targetCID=r,this.cidPatch=Oe(this.targetCID),this.callbacks={beforeadded:[],beforeupdated:[],beforephxChildAdded:[],afteradded:[],afterupdated:[],afterdiscarded:[],afterphxChildAdded:[],aftertransitionsDiscarded:[]}}before(e,t){this.callbacks[`before${e}`].push(t)}after(e,t){this.callbacks[`after${e}`].push(t)}trackBefore(e,...t){this.callbacks[`before${e}`].forEach(i=>i(...t))}trackAfter(e,...t){this.callbacks[`after${e}`].forEach(i=>i(...t))}markPrunableContentForRemoval(){_.all(this.container,"[phx-update=append] > *, [phx-update=prepend] > *",e=>{e.setAttribute(Ri,"")})}perform(){let{view:e,liveSocket:t,container:i,html:n}=this,r=this.isCIDPatch()?this.targetCIDContainer(n):i;if(this.isCIDPatch()&&!r)return;let s=t.getActiveElement(),{selectionStart:o,selectionEnd:a}=s&&_.hasSelectionRange(s)?s:{},l=t.binding(li),c=t.binding(oi),d=t.binding(ai),h=t.binding(br),g=t.binding("remove"),u=[],b=[],m=[],y=[],S=null,N=t.time("premorph container prep",()=>this.buildDiffHTML(i,n,l,r));return this.trackBefore("added",i),this.trackBefore("updated",i,i),t.time("morphdom",()=>{Yi(r,N,{childrenOnly:r.getAttribute(ae)===null,getNodeKey:f=>_.isPhxDestroyed(f)?null:f.id,onBeforeNodeAdded:f=>(this.trackBefore("added",f),f),onNodeAdded:f=>{f instanceof HTMLImageElement&&f.srcset?f.srcset=f.srcset:f instanceof HTMLVideoElement&&f.autoplay&&f.play(),_.isNowTriggerFormExternal(f,h)&&(S=f),_.discardError(r,f,c),(_.isPhxChild(f)&&e.ownsElement(f)||_.isPhxSticky(f)&&e.ownsElement(f.parentNode))&&this.trackAfter("phxChildAdded",f),u.push(f)},onNodeDiscarded:f=>{(_.isPhxChild(f)||_.isPhxSticky(f))&&t.destroyViewByEl(f),this.trackAfter("discarded",f)},onBeforeNodeDiscarded:f=>f.getAttribute&&f.getAttribute(Ri)!==null?!0:f.parentNode!==null&&_.isPhxUpdate(f.parentNode,l,["append","prepend"])&&f.id?!1:f.getAttribute&&f.getAttribute(g)?(y.push(f),!1):!this.skipCIDSibling(f),onElUpdated:f=>{_.isNowTriggerFormExternal(f,h)&&(S=f),b.push(f)},onBeforeElUpdated:(f,A)=>{if(_.cleanChildNodes(A,l),this.skipCIDSibling(A)||_.isPhxSticky(f))return!1;if(_.isIgnored(f,l))return this.trackBefore("updated",f,A),_.mergeAttrs(f,A,{isIgnored:!0}),b.push(f),_.applyStickyOperations(f),!1;if(f.type==="number"&&f.validity&&f.validity.badInput)return!1;if(!_.syncPendingRef(f,A,d))return _.isUploadInput(f)&&(this.trackBefore("updated",f,A),b.push(f)),_.applyStickyOperations(f),!1;if(_.isPhxChild(A)){let E=f.getAttribute(De);return _.mergeAttrs(f,A,{exclude:[nt]}),E!==""&&f.setAttribute(De,E),f.setAttribute(at,this.rootID),_.applyStickyOperations(f),!1}return _.copyPrivates(A,f),_.discardError(r,A,c),s&&f.isSameNode(s)&&_.isFormInput(f)?(this.trackBefore("updated",f,A),_.mergeFocusedInput(f,A),_.syncAttrsToProps(f),b.push(f),_.applyStickyOperations(f),!1):(_.isPhxUpdate(A,l,["append","prepend"])&&m.push(new $r(f,A,A.getAttribute(l))),_.syncAttrsToProps(A),_.applyStickyOperations(A),this.trackBefore("updated",f,A),!0)}})}),t.isDebugEnabled()&&Pr(),m.length>0&&t.time("post-morph append/prepend restoration",()=>{m.forEach(f=>f.perform())}),t.silenceEvents(()=>_.restoreFocus(s,o,a)),_.dispatchEvent(document,"phx:update"),u.forEach(f=>this.trackAfter("added",f)),b.forEach(f=>this.trackAfter("updated",f)),y.length>0&&(t.transitionRemoves(y),t.requestDOMUpdate(()=>{y.forEach(f=>{let A=_.firstPhxChild(f);A&&t.destroyViewByEl(A),f.remove()}),this.trackAfter("transitionsDiscarded",y)})),S&&(t.disconnect(),S.submit()),!0}isCIDPatch(){return this.cidPatch}skipCIDSibling(e){return e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(si)!==null}targetCIDContainer(e){if(!this.isCIDPatch())return;let[t,...i]=_.findComponentNodeList(this.container,this.targetCID);return i.length===0&&_.childNodeLength(e)===1?t:t&&t.parentNode}buildDiffHTML(e,t,i,n){let r=this.isCIDPatch(),s=r&&n.getAttribute(ae)===this.targetCID.toString();if(!r||s)return t;{let o=null,a=document.createElement("template");o=_.cloneNode(n);let[l,...c]=_.findComponentNodeList(o,this.targetCID);return a.innerHTML=t,c.forEach(d=>d.remove()),Array.from(o.childNodes).forEach(d=>{d.id&&d.nodeType===Node.ELEMENT_NODE&&d.getAttribute(ae)!==this.targetCID.toString()&&(d.setAttribute(si,""),d.innerHTML="")}),Array.from(a.content.childNodes).forEach(d=>o.insertBefore(d,l)),l.remove(),o.outerHTML}}},Gi=class{static extract(e){let{[Vi]:t,[Ui]:i,[Wi]:n}=e;return delete e[Vi],delete e[Ui],delete e[Wi],{diff:e,title:n,reply:t||null,events:i||[]}}constructor(e,t){this.viewId=e,this.rendered={},this.mergeDiff(t)}parentViewId(){return this.viewId}toString(e){return this.recursiveToString(this.rendered,this.rendered[oe],e)}recursiveToString(e,t=e[oe],i){i=i?new Set(i):null;let n={buffer:"",components:t,onlyCids:i};return this.toOutputBuffer(e,null,n),n.buffer}componentCIDs(e){return Object.keys(e[oe]||{}).map(t=>parseInt(t))}isComponentOnlyDiff(e){return e[oe]?Object.keys(e).length===1:!1}getComponent(e,t){return e[oe][t]}mergeDiff(e){let t=e[oe],i={};if(delete e[oe],this.rendered=this.mutableMerge(this.rendered,e),this.rendered[oe]=this.rendered[oe]||{},t){let n=this.rendered[oe];for(let r in t)t[r]=this.cachedFindComponent(r,t[r],n,t,i);for(let r in t)n[r]=t[r];e[oe]=t}}cachedFindComponent(e,t,i,n,r){if(r[e])return r[e];{let s,o,a=t[me];if(Oe(a)){let l;a>0?l=this.cachedFindComponent(a,n[a],i,n,r):l=i[-a],o=l[me],s=this.cloneMerge(l,t),s[me]=o}else s=t[me]!==void 0?t:this.cloneMerge(i[e]||{},t);return r[e]=s,s}}mutableMerge(e,t){return t[me]!==void 0?t:(this.doMutableMerge(e,t),e)}doMutableMerge(e,t){for(let i in t){let n=t[i],r=e[i];Ge(n)&&n[me]===void 0&&Ge(r)?this.doMutableMerge(r,n):e[i]=n}}cloneMerge(e,t){let i={...e,...t};for(let n in i){let r=t[n],s=e[n];Ge(r)&&r[me]===void 0&&Ge(s)&&(i[n]=this.cloneMerge(s,r))}return i}componentToString(e){return this.recursiveCIDToString(this.rendered[oe],e)}pruneCIDs(e){e.forEach(t=>delete this.rendered[oe][t])}get(){return this.rendered}isNewFingerprint(e={}){return!!e[me]}templateStatic(e,t){return typeof e=="number"?t[e]:e}toOutputBuffer(e,t,i){if(e[Fi])return this.comprehensionToBuffer(e,t,i);let{[me]:n}=e;n=this.templateStatic(n,t),i.buffer+=n[0];for(let r=1;r<n.length;r++)this.dynamicToBuffer(e[r-1],t,i),i.buffer+=n[r]}comprehensionToBuffer(e,t,i){let{[Fi]:n,[me]:r}=e;r=this.templateStatic(r,t);let s=t||e[Dr];for(let o=0;o<n.length;o++){let a=n[o];i.buffer+=r[0];for(let l=1;l<r.length;l++)this.dynamicToBuffer(a[l-1],s,i),i.buffer+=r[l]}}dynamicToBuffer(e,t,i){typeof e=="number"?i.buffer+=this.recursiveCIDToString(i.components,e,i.onlyCids):Ge(e)?this.toOutputBuffer(e,t,i):i.buffer+=e}recursiveCIDToString(e,t,i){let n=e[t]||Q(`no component for CID ${t}`,e),r=document.createElement("template");r.innerHTML=this.recursiveToString(n,e,i);let s=r.content,o=i&&!i.has(t),[a,l]=Array.from(s.childNodes).reduce(([c,d],h,g)=>h.nodeType===Node.ELEMENT_NODE?h.getAttribute(ae)?[c,!0]:(h.setAttribute(ae,t),h.id||(h.id=`${this.parentViewId()}-${t}-${g}`),o&&(h.setAttribute(si,""),h.innerHTML=""),[!0,d]):h.nodeValue.trim()!==""?(Q(`only HTML element tags are allowed at the root of components.
got: "${h.nodeValue.trim()}"
within:
`,r.innerHTML.trim()),h.replaceWith(this.createSpan(h.nodeValue,t)),[!0,d]):(h.remove(),[c,d]),[!1,!1]);return!a&&!l?(Q(`expected at least one HTML element tag inside a component, but the component is empty:
`,r.innerHTML.trim()),this.createSpan("",t).outerHTML):(!a&&l&&Q("expected at least one HTML element tag directly inside a component, but only subcomponents were found. A component must render at least one HTML tag directly inside itself.",r.innerHTML.trim()),r.innerHTML)}createSpan(e,t){let i=document.createElement("span");return i.innerText=e,i.setAttribute(ae,t),i}},Zr=1,Ze=class{static makeID(){return Zr++}static elementID(e){return e.phxHookId}constructor(e,t,i){this.__view=e,this.liveSocket=e.liveSocket,this.__callbacks=i,this.__listeners=new Set,this.__isDisconnected=!1,this.el=t,this.el.phxHookId=this.constructor.makeID();for(let n in this.__callbacks)this[n]=this.__callbacks[n]}__mounted(){this.mounted&&this.mounted()}__updated(){this.updated&&this.updated()}__beforeUpdate(){this.beforeUpdate&&this.beforeUpdate()}__destroyed(){this.destroyed&&this.destroyed()}__reconnected(){this.__isDisconnected&&(this.__isDisconnected=!1,this.reconnected&&this.reconnected())}__disconnected(){this.__isDisconnected=!0,this.disconnected&&this.disconnected()}pushEvent(e,t={},i=function(){}){return this.__view.pushHookEvent(null,e,t,i)}pushEventTo(e,t,i={},n=function(){}){return this.__view.withinTargets(e,(r,s)=>r.pushHookEvent(s,t,i,n))}handleEvent(e,t){let i=(n,r)=>r?e:t(n.detail);return window.addEventListener(`phx:${e}`,i),this.__listeners.add(i),i}removeHandleEvent(e){let t=e(null,!0);window.removeEventListener(`phx:${t}`,e),this.__listeners.delete(e)}upload(e,t){return this.__view.dispatchUploads(e,t)}uploadTo(e,t,i){return this.__view.withinTargets(e,n=>n.dispatchUploads(t,i))}__cleanup__(){this.__listeners.forEach(e=>this.removeHandleEvent(e))}},es={exec(e,t,i,n,r){let[s,o]=r||[null,{}];(t.charAt(0)==="["?JSON.parse(t):[[s,o]]).forEach(([l,c])=>{l===s&&o.data&&(c.data=Object.assign(c.data||{},o.data)),this.filterToEls(n,c).forEach(d=>{this[`exec_${l}`](e,t,i,n,d,c)})})},isVisible(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length>0)},exec_dispatch(e,t,i,n,r,{to:s,event:o,detail:a,bubbles:l}){a=a||{},a.dispatcher=n,_.dispatchEvent(r,o,{detail:a,bubbles:l})},exec_push(e,t,i,n,r,s){if(!i.isConnected())return;let{event:o,data:a,target:l,page_loading:c,loading:d,value:h,dispatcher:g}=s,u={loading:d,value:h,target:l,page_loading:!!c},b=e==="change"&&g?g:n,m=l||b.getAttribute(i.binding("target"))||b;i.withinTargets(m,(y,S)=>{if(e==="change"){let{newCid:N,_target:f,callback:A}=s;f=f||(n instanceof HTMLInputElement?n.name:void 0),f&&(u._target=f),y.pushInput(n,S,N,o||t,u,A)}else e==="submit"?y.submitForm(n,S,o||t,u):y.pushEvent(e,n,S,o||t,a,u)})},exec_add_class(e,t,i,n,r,{names:s,transition:o,time:a}){this.addOrRemoveClasses(r,s,[],o,a,i)},exec_remove_class(e,t,i,n,r,{names:s,transition:o,time:a}){this.addOrRemoveClasses(r,[],s,o,a,i)},exec_transition(e,t,i,n,r,{time:s,transition:o}){let[a,l,c]=o,d=()=>this.addOrRemoveClasses(r,a.concat(l),[]),h=()=>this.addOrRemoveClasses(r,c,a.concat(l));i.transition(s,d,h)},exec_toggle(e,t,i,n,r,{display:s,ins:o,outs:a,time:l}){this.toggle(e,i,r,s,o,a,l)},exec_show(e,t,i,n,r,{display:s,transition:o,time:a}){this.show(e,i,r,s,o,a)},exec_hide(e,t,i,n,r,{display:s,transition:o,time:a}){this.hide(e,i,r,s,o,a)},exec_set_attr(e,t,i,n,r,{attr:[s,o]}){this.setOrRemoveAttrs(r,[[s,o]],[])},exec_remove_attr(e,t,i,n,r,{attr:s}){this.setOrRemoveAttrs(r,[],[s])},show(e,t,i,n,r,s){this.isVisible(i)||this.toggle(e,t,i,n,r,null,s)},hide(e,t,i,n,r,s){this.isVisible(i)&&this.toggle(e,t,i,n,null,r,s)},toggle(e,t,i,n,r,s,o){let[a,l,c]=r||[[],[],[]],[d,h,g]=s||[[],[],[]];if(a.length>0||d.length>0)if(this.isVisible(i)){let u=()=>{this.addOrRemoveClasses(i,h,a.concat(l).concat(c)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(i,d,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(i,g,h))})};i.dispatchEvent(new Event("phx:hide-start")),t.transition(o,u,()=>{this.addOrRemoveClasses(i,[],d.concat(g)),_.putSticky(i,"toggle",b=>b.style.display="none"),i.dispatchEvent(new Event("phx:hide-end"))})}else{if(e==="remove")return;let u=()=>{this.addOrRemoveClasses(i,l,d.concat(h).concat(g)),_.putSticky(i,"toggle",b=>b.style.display=n||"block"),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(i,a,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(i,c,l))})};i.dispatchEvent(new Event("phx:show-start")),t.transition(o,u,()=>{this.addOrRemoveClasses(i,[],a.concat(c)),i.dispatchEvent(new Event("phx:show-end"))})}else this.isVisible(i)?window.requestAnimationFrame(()=>{i.dispatchEvent(new Event("phx:hide-start")),_.putSticky(i,"toggle",u=>u.style.display="none"),i.dispatchEvent(new Event("phx:hide-end"))}):window.requestAnimationFrame(()=>{i.dispatchEvent(new Event("phx:show-start")),_.putSticky(i,"toggle",u=>u.style.display=n||"block"),i.dispatchEvent(new Event("phx:show-end"))})},addOrRemoveClasses(e,t,i,n,r,s){let[o,a,l]=n||[[],[],[]];if(o.length>0){let c=()=>this.addOrRemoveClasses(e,a.concat(o),[]),d=()=>this.addOrRemoveClasses(e,t.concat(l),i.concat(o).concat(a));return s.transition(r,c,d)}window.requestAnimationFrame(()=>{let[c,d]=_.getSticky(e,"classes",[[],[]]),h=t.filter(m=>c.indexOf(m)<0&&!e.classList.contains(m)),g=i.filter(m=>d.indexOf(m)<0&&e.classList.contains(m)),u=c.filter(m=>i.indexOf(m)<0).concat(h),b=d.filter(m=>t.indexOf(m)<0).concat(g);_.putSticky(e,"classes",m=>(m.classList.remove(...b),m.classList.add(...u),[u,b]))})},setOrRemoveAttrs(e,t,i){let[n,r]=_.getSticky(e,"attrs",[[],[]]),s=t.map(([l,c])=>l).concat(i),o=n.filter(([l,c])=>!s.includes(l)).concat(t),a=r.filter(l=>!s.includes(l)).concat(i);_.putSticky(e,"attrs",l=>(a.forEach(c=>l.removeAttribute(c)),o.forEach(([c,d])=>l.setAttribute(c,d)),[o,a]))},hasAllClasses(e,t){return t.every(i=>e.classList.contains(i))},isToggledOut(e,t){return!this.isVisible(e)||this.hasAllClasses(e,t)},filterToEls(e,{to:t}){return t?_.all(document,t):[e]}},ve=es,Et=(e,t,i=[])=>{let n=new FormData(e),r=[];n.forEach((o,a,l)=>{o instanceof File&&r.push(a)}),r.forEach(o=>n.delete(o));let s=new URLSearchParams;for(let[o,a]of n.entries())(i.length===0||i.indexOf(o)>=0)&&s.append(o,a);for(let o in t)s.append(o,t[o]);return s.toString()},On=class{constructor(e,t,i,n){this.liveSocket=t,this.flash=n,this.parent=i,this.root=i?i.root:this,this.el=e,this.id=this.el.id,this.ref=0,this.childJoins=0,this.loaderTimer=null,this.pendingDiffs=[],this.pruningCIDs=[],this.redirect=!1,this.href=null,this.joinCount=this.parent?this.parent.joinCount-1:0,this.joinPending=!0,this.destroyed=!1,this.joinCallback=function(r){r&&r()},this.stopCallback=function(){},this.pendingJoinOps=this.parent?null:[],this.viewHooks={},this.uploaders={},this.formSubmits=[],this.children=this.parent?null:{},this.root.children[this.id]={},this.channel=this.liveSocket.channel(`lv:${this.id}`,()=>({redirect:this.redirect?this.href:void 0,url:this.redirect?void 0:this.href||void 0,params:this.connectParams(),session:this.getSession(),static:this.getStatic(),flash:this.flash})),this.showLoader(this.liveSocket.loaderTimeout),this.bindChannel()}setHref(e){this.href=e}setRedirect(e){this.redirect=!0,this.href=e}isMain(){return this.el.getAttribute(pi)!==null}connectParams(){let e=this.liveSocket.params(this.el),t=_.all(document,`[${this.binding(gr)}]`).map(i=>i.src||i.href).filter(i=>typeof i=="string");return t.length>0&&(e._track_static=t),e._mounts=this.joinCount,e}isConnected(){return this.channel.canPush()}getSession(){return this.el.getAttribute(De)}getStatic(){let e=this.el.getAttribute(nt);return e===""?null:e}destroy(e=function(){}){this.destroyAllChildren(),this.destroyed=!0,delete this.root.children[this.id],this.parent&&delete this.root.children[this.parent.id][this.id],clearTimeout(this.loaderTimer);let t=()=>{e();for(let i in this.viewHooks)this.destroyHook(this.viewHooks[i])};_.markPhxChildDestroyed(this.el),this.log("destroyed",()=>["the child has been removed from the parent"]),this.channel.leave().receive("ok",t).receive("error",t).receive("timeout",t)}setContainerClasses(...e){this.el.classList.remove(Ii,jt,Hi),this.el.classList.add(...e)}showLoader(e){if(clearTimeout(this.loaderTimer),e)this.loaderTimer=setTimeout(()=>this.showLoader(),e);else{for(let t in this.viewHooks)this.viewHooks[t].__disconnected();this.setContainerClasses(jt)}}hideLoader(){clearTimeout(this.loaderTimer),this.setContainerClasses(Ii)}triggerReconnected(){for(let e in this.viewHooks)this.viewHooks[e].__reconnected()}log(e,t){this.liveSocket.log(this,e,t)}transition(e,t,i=function(){}){this.liveSocket.transition(e,t,i)}withinTargets(e,t){if(e instanceof HTMLElement||e instanceof SVGElement)return this.liveSocket.owner(e,i=>t(i,e));if(Oe(e))_.findComponentNodeList(this.el,e).length===0?Q(`no component found matching phx-target of ${e}`):t(this,parseInt(e));else{let i=Array.from(document.querySelectorAll(e));i.length===0&&Q(`nothing found matching the phx-target selector "${e}"`),i.forEach(n=>this.liveSocket.owner(n,r=>t(r,n)))}}applyDiff(e,t,i){this.log(e,()=>["",Tt(t)]);let{diff:n,reply:r,events:s,title:o}=Gi.extract(t);return o&&_.putTitle(o),i({diff:n,reply:r,events:s}),r}onJoin(e){let{rendered:t,container:i}=e;if(i){let[n,r]=i;this.el=_.replaceRootContainer(this.el,n,r)}this.childJoins=0,this.joinPending=!0,this.flash=null,ke.dropLocal(this.liveSocket.localStorage,window.location.pathname,En),this.applyDiff("mount",t,({diff:n,events:r})=>{this.rendered=new Gi(this.id,n);let s=this.renderContainer(null,"join");this.dropPendingRefs();let o=this.formsForRecovery(s);this.joinCount++,o.length>0?o.forEach(([a,l,c],d)=>{this.pushFormRecovery(a,c,h=>{d===o.length-1&&this.onJoinComplete(h,s,r)})}):this.onJoinComplete(e,s,r)})}dropPendingRefs(){_.all(document,`[${Re}="${this.id}"][${be}]`,e=>{e.removeAttribute(be),e.removeAttribute(Re)})}onJoinComplete({live_patch:e},t,i){if(this.joinCount>1||this.parent&&!this.parent.isJoinPending())return this.applyJoinPatch(e,t,i);_.findPhxChildrenInFragment(t,this.id).filter(r=>{let s=r.id&&this.el.querySelector(`[id="${r.id}"]`),o=s&&s.getAttribute(nt);return o&&r.setAttribute(nt,o),this.joinChild(r)}).length===0?this.parent?(this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(e,t,i)]),this.parent.ackJoin(this)):(this.onAllChildJoinsComplete(),this.applyJoinPatch(e,t,i)):this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(e,t,i)])}attachTrueDocEl(){this.el=_.byId(this.id),this.el.setAttribute(at,this.root.id)}applyJoinPatch(e,t,i){this.attachTrueDocEl();let n=new yt(this,this.el,this.id,t,null);if(n.markPrunableContentForRemoval(),this.performPatch(n,!1),this.joinNewChildren(),_.all(this.el,`[${this.binding(ze)}], [data-phx-${ze}]`,r=>{let s=this.addHook(r);s&&s.__mounted()}),this.joinPending=!1,this.liveSocket.dispatchEvents(i),this.applyPendingUpdates(),e){let{kind:r,to:s}=e;this.liveSocket.historyPatch(s,r)}this.hideLoader(),this.joinCount>1&&this.triggerReconnected(),this.stopCallback()}triggerBeforeUpdateHook(e,t){this.liveSocket.triggerDOM("onBeforeElUpdated",[e,t]);let i=this.getHook(e),n=i&&_.isIgnored(e,this.binding(li));if(i&&!e.isEqualNode(t)&&!(n&&Rr(e.dataset,t.dataset)))return i.__beforeUpdate(),i}performPatch(e,t){let i=[],n=!1,r=new Set;return e.after("added",s=>{this.liveSocket.triggerDOM("onNodeAdded",[s]);let o=this.addHook(s);o&&o.__mounted()}),e.after("phxChildAdded",s=>{_.isPhxSticky(s)?this.liveSocket.joinRootViews():n=!0}),e.before("updated",(s,o)=>{this.triggerBeforeUpdateHook(s,o)&&r.add(s.id)}),e.after("updated",s=>{r.has(s.id)&&this.getHook(s).__updated()}),e.after("discarded",s=>{s.nodeType===Node.ELEMENT_NODE&&i.push(s)}),e.after("transitionsDiscarded",s=>this.afterElementsRemoved(s,t)),e.perform(),this.afterElementsRemoved(i,t),n}afterElementsRemoved(e,t){let i=[];e.forEach(n=>{let r=_.all(n,`[${ae}]`),s=_.all(n,`[${this.binding(ze)}]`);r.concat(n).forEach(o=>{let a=this.componentID(o);Oe(a)&&i.indexOf(a)===-1&&i.push(a)}),s.concat(n).forEach(o=>{let a=this.getHook(o);a&&this.destroyHook(a)})}),t&&this.maybePushComponentsDestroyed(i)}joinNewChildren(){_.findPhxChildren(this.el,this.id).forEach(e=>this.joinChild(e))}getChildById(e){return this.root.children[this.id][e]}getDescendentByEl(e){return e.id===this.id?this:this.children[e.getAttribute(je)][e.id]}destroyDescendent(e){for(let t in this.root.children)for(let i in this.root.children[t])if(i===e)return this.root.children[t][i].destroy()}joinChild(e){if(!this.getChildById(e.id)){let i=new On(e,this.liveSocket,this);return this.root.children[this.id][i.id]=i,i.join(),this.childJoins++,!0}}isJoinPending(){return this.joinPending}ackJoin(e){this.childJoins--,this.childJoins===0&&(this.parent?this.parent.ackJoin(this):this.onAllChildJoinsComplete())}onAllChildJoinsComplete(){this.joinCallback(()=>{this.pendingJoinOps.forEach(([e,t])=>{e.isDestroyed()||t()}),this.pendingJoinOps=[]})}update(e,t){if(this.isJoinPending()||this.liveSocket.hasPendingLink()&&!_.isPhxSticky(this.el))return this.pendingDiffs.push({diff:e,events:t});this.rendered.mergeDiff(e);let i=!1;this.rendered.isComponentOnlyDiff(e)?this.liveSocket.time("component patch complete",()=>{_.findParentCIDs(this.el,this.rendered.componentCIDs(e)).forEach(r=>{this.componentPatch(this.rendered.getComponent(e,r),r)&&(i=!0)})}):qi(e)||this.liveSocket.time("full patch complete",()=>{let n=this.renderContainer(e,"update"),r=new yt(this,this.el,this.id,n,null);i=this.performPatch(r,!0)}),this.liveSocket.dispatchEvents(t),i&&this.joinNewChildren()}renderContainer(e,t){return this.liveSocket.time(`toString diff (${t})`,()=>{let i=this.el.tagName,n=e?this.rendered.componentCIDs(e).concat(this.pruningCIDs):null,r=this.rendered.toString(n);return`<${i}>${r}</${i}>`})}componentPatch(e,t){if(qi(e))return!1;let i=this.rendered.componentToString(t),n=new yt(this,this.el,this.id,i,t);return this.performPatch(n,!0)}getHook(e){return this.viewHooks[Ze.elementID(e)]}addHook(e){if(Ze.elementID(e)||!e.getAttribute)return;let t=e.getAttribute(`data-phx-${ze}`)||e.getAttribute(this.binding(ze));if(t&&!this.ownsElement(e))return;let i=this.liveSocket.getHookCallbacks(t);if(i){e.id||Q(`no DOM ID for hook "${t}". Hooks require a unique ID on each element.`,e);let n=new Ze(this,e,i);return this.viewHooks[Ze.elementID(n.el)]=n,n}else t!==null&&Q(`unknown hook found for "${t}"`,e)}destroyHook(e){e.__destroyed(),e.__cleanup__(),delete this.viewHooks[Ze.elementID(e.el)]}applyPendingUpdates(){this.pendingDiffs.forEach(({diff:e,events:t})=>this.update(e,t)),this.pendingDiffs=[]}onChannel(e,t){this.liveSocket.onChannel(this.channel,e,i=>{this.isJoinPending()?this.root.pendingJoinOps.push([this,()=>t(i)]):this.liveSocket.requestDOMUpdate(()=>t(i))})}bindChannel(){this.liveSocket.onChannel(this.channel,"diff",e=>{this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",e,({diff:t,events:i})=>this.update(t,i))})}),this.onChannel("redirect",({to:e,flash:t})=>this.onRedirect({to:e,flash:t})),this.onChannel("live_patch",e=>this.onLivePatch(e)),this.onChannel("live_redirect",e=>this.onLiveRedirect(e)),this.channel.onError(e=>this.onError(e)),this.channel.onClose(e=>this.onClose(e))}destroyAllChildren(){for(let e in this.root.children[this.id])this.getChildById(e).destroy()}onLiveRedirect(e){let{to:t,kind:i,flash:n}=e,r=this.expandURL(t);this.liveSocket.historyRedirect(r,i,n)}onLivePatch(e){let{to:t,kind:i}=e;this.href=this.expandURL(t),this.liveSocket.historyPatch(t,i)}expandURL(e){return e.startsWith("/")?`${window.location.protocol}//${window.location.host}${e}`:e}onRedirect({to:e,flash:t}){this.liveSocket.redirect(e,t)}isDestroyed(){return this.destroyed}join(e){this.isMain()&&(this.stopCallback=this.liveSocket.withPageLoading({to:this.href,kind:"initial"})),this.joinCallback=t=>{t=t||function(){},e?e(this.joinCount,t):t()},this.liveSocket.wrapPush(this,{timeout:!1},()=>this.channel.join().receive("ok",t=>{this.isDestroyed()||this.liveSocket.requestDOMUpdate(()=>this.onJoin(t))}).receive("error",t=>!this.isDestroyed()&&this.onJoinError(t)).receive("timeout",()=>!this.isDestroyed()&&this.onJoinError({reason:"timeout"})))}onJoinError(e){if(e.reason==="unauthorized"||e.reason==="stale")return this.log("error",()=>["unauthorized live_redirect. Falling back to page request",e]),this.onRedirect({to:this.href});if((e.redirect||e.live_redirect)&&(this.joinPending=!1,this.channel.leave()),e.redirect)return this.onRedirect(e.redirect);if(e.live_redirect)return this.onLiveRedirect(e.live_redirect);this.log("error",()=>["unable to join",e]),this.liveSocket.isConnected()&&this.liveSocket.reloadWithJitter(this)}onClose(e){if(!this.isDestroyed()){if(this.liveSocket.hasPendingLink()&&e!=="leave")return this.liveSocket.reloadWithJitter(this);this.destroyAllChildren(),this.liveSocket.dropActiveElement(this),document.activeElement&&document.activeElement.blur(),this.liveSocket.isUnloaded()&&this.showLoader(Tr)}}onError(e){this.onClose(e),this.liveSocket.isConnected()&&this.log("error",()=>["view crashed",e]),this.liveSocket.isUnloaded()||this.displayError()}displayError(){this.isMain()&&_.dispatchEvent(window,"phx:page-loading-start",{detail:{to:this.href,kind:"error"}}),this.showLoader(),this.setContainerClasses(jt,Hi)}pushWithReply(e,t,i,n=function(){}){if(!this.isConnected())return;let[r,[s],o]=e?e():[null,[],{}],a=function(){};return(o.page_loading||s&&s.getAttribute(this.binding(Ni))!==null)&&(a=this.liveSocket.withPageLoading({kind:"element",target:s})),typeof i.cid!="number"&&delete i.cid,this.liveSocket.wrapPush(this,{timeout:!0},()=>this.channel.push(t,i,kr).receive("ok",l=>{r!==null&&this.undoRefs(r);let c=d=>{l.redirect&&this.onRedirect(l.redirect),l.live_patch&&this.onLivePatch(l.live_patch),l.live_redirect&&this.onLiveRedirect(l.live_redirect),a(),n(l,d)};l.diff?this.liveSocket.requestDOMUpdate(()=>{let d=this.applyDiff("update",l.diff,({diff:h,events:g})=>{this.update(h,g)});c(d)}):c(null)}))}undoRefs(e){_.all(document,`[${Re}="${this.id}"][${be}="${e}"]`,t=>{let i=t.getAttribute(pt);t.removeAttribute(be),t.removeAttribute(Re),t.getAttribute(Bt)!==null&&(t.readOnly=!1,t.removeAttribute(Bt)),i!==null&&(t.disabled=i==="true",t.removeAttribute(pt)),An.forEach(s=>_.removeClass(t,s));let n=t.getAttribute(gt);n!==null&&(t.innerText=n,t.removeAttribute(gt));let r=_.private(t,be);if(r){let s=this.triggerBeforeUpdateHook(t,r);yt.patchEl(t,r,this.liveSocket.getActiveElement()),s&&s.__updated(),_.deletePrivate(t,be)}})}putRef(e,t,i={}){let n=this.ref++,r=this.binding(ai);return i.loading&&(e=e.concat(_.all(document,i.loading))),e.forEach(s=>{s.classList.add(`phx-${t}-loading`),s.setAttribute(be,n),s.setAttribute(Re,this.el.id);let o=s.getAttribute(r);o!==null&&(s.getAttribute(gt)||s.setAttribute(gt,s.innerText),o!==""&&(s.innerText=o),s.setAttribute("disabled",""))}),[n,e,i]}componentID(e){let t=e.getAttribute&&e.getAttribute(ae);return t?parseInt(t):null}targetComponentID(e,t,i={}){if(Oe(t))return t;let n=e.getAttribute(this.binding("target"));return Oe(n)?parseInt(n):t&&(n!==null||i.target)?this.closestComponentID(t):null}closestComponentID(e){return Oe(e)?e:e?Ce(e.closest(`[${ae}]`),t=>this.ownsElement(t)&&this.componentID(t)):null}pushHookEvent(e,t,i,n){if(!this.isConnected())return this.log("hook",()=>["unable to push hook event. LiveView not connected",t,i]),!1;let[r,s,o]=this.putRef([],"hook");return this.pushWithReply(()=>[r,s,o],"event",{type:"hook",event:t,value:i,cid:this.closestComponentID(e)},(a,l)=>n(l,r)),r}extractMeta(e,t,i){let n=this.binding("value-");for(let r=0;r<e.attributes.length;r++){t||(t={});let s=e.attributes[r].name;s.startsWith(n)&&(t[s.replace(n,"")]=e.getAttribute(s))}if(e.value!==void 0&&(t||(t={}),t.value=e.value,e.tagName==="INPUT"&&Tn.indexOf(e.type)>=0&&!e.checked&&delete t.value),i){t||(t={});for(let r in i)t[r]=i[r]}return t}pushEvent(e,t,i,n,r,s={}){this.pushWithReply(()=>this.putRef([t],e,s),"event",{type:e,event:n,value:this.extractMeta(t,r,s.value),cid:this.targetComponentID(t,i,s)})}pushFileProgress(e,t,i,n=function(){}){this.liveSocket.withinOwners(e.form,(r,s)=>{r.pushWithReply(null,"progress",{event:e.getAttribute(r.binding(wr)),ref:e.getAttribute(Ie),entry_ref:t,progress:i,cid:r.targetComponentID(e.form,s)},n)})}pushInput(e,t,i,n,r,s){let o,a=Oe(i)?i:this.targetComponentID(e.form,t),l=()=>this.putRef([e,e.form],"change",r),c;e.getAttribute(this.binding("change"))?c=Et(e.form,{_target:r._target},[e.name]):c=Et(e.form,{_target:r._target}),_.isUploadInput(e)&&e.files&&e.files.length>0&&G.trackFiles(e,Array.from(e.files)),o=G.serializeUploads(e);let d={type:"form",event:n,value:c,uploads:o,cid:a};this.pushWithReply(l,"event",d,h=>{if(_.showError(e,this.liveSocket.binding(oi)),_.isUploadInput(e)&&e.getAttribute("data-phx-auto-upload")!==null){if(G.filesAwaitingPreflight(e).length>0){let[g,u]=l();this.uploadFiles(e.form,t,g,a,b=>{s&&s(h),this.triggerAwaitingSubmit(e.form)})}}else s&&s(h)})}triggerAwaitingSubmit(e){let t=this.getScheduledSubmit(e);if(t){let[i,n,r,s]=t;this.cancelSubmit(e),s()}}getScheduledSubmit(e){return this.formSubmits.find(([t,i,n,r])=>t.isSameNode(e))}scheduleSubmit(e,t,i,n){if(this.getScheduledSubmit(e))return!0;this.formSubmits.push([e,t,i,n])}cancelSubmit(e){this.formSubmits=this.formSubmits.filter(([t,i,n])=>t.isSameNode(e)?(this.undoRefs(i),!1):!0)}pushFormSubmit(e,t,i,n,r){let s=h=>!(rt(h,`${this.binding(li)}=ignore`,h.form)||rt(h,"data-phx-update=ignore",h.form)),o=h=>h.hasAttribute(this.binding(ai)),a=h=>h.tagName=="BUTTON",l=h=>["INPUT","TEXTAREA","SELECT"].includes(h.tagName),c=()=>{let h=Array.from(e.elements),g=h.filter(o),u=h.filter(a).filter(s),b=h.filter(l).filter(s);return u.forEach(m=>{m.setAttribute(pt,m.disabled),m.disabled=!0}),b.forEach(m=>{m.setAttribute(Bt,m.readOnly),m.readOnly=!0,m.files&&(m.setAttribute(pt,m.disabled),m.disabled=!0)}),e.setAttribute(this.binding(Ni),""),this.putRef([e].concat(g).concat(u).concat(b),"submit",n)},d=this.targetComponentID(e,t);if(G.hasUploadsInProgress(e)){let[h,g]=c(),u=()=>this.pushFormSubmit(e,t,i,n,r);return this.scheduleSubmit(e,h,n,u)}else if(G.inputsAwaitingPreflight(e).length>0){let[h,g]=c(),u=()=>[h,g,n];this.uploadFiles(e,t,h,d,b=>{let m=Et(e,{});this.pushWithReply(u,"event",{type:"form",event:i,value:m,cid:d},r)})}else{let h=Et(e,{});this.pushWithReply(c,"event",{type:"form",event:i,value:h,cid:d},r)}}uploadFiles(e,t,i,n,r){let s=this.joinCount,o=G.activeFileInputs(e),a=o.length;o.forEach(l=>{let c=new G(l,this,()=>{a--,a===0&&r()});this.uploaders[l]=c;let d=c.entries().map(g=>g.toPreflightPayload()),h={ref:l.getAttribute(Ie),entries:d,cid:this.targetComponentID(l.form,t)};this.log("upload",()=>["sending preflight request",h]),this.pushWithReply(null,"allow_upload",h,g=>{if(this.log("upload",()=>["got preflight response",g]),g.error){this.undoRefs(i);let[u,b]=g.error;this.log("upload",()=>[`error for entry ${u}`,b])}else{let u=b=>{this.channel.onError(()=>{this.joinCount===s&&b()})};c.initAdapterUpload(g,u,this.liveSocket)}})})}dispatchUploads(e,t){let i=_.findUploadInputs(this.el).filter(n=>n.name===e);i.length===0?Q(`no live file inputs found matching the name "${e}"`):i.length>1?Q(`duplicate live file inputs found matching the name "${e}"`):_.dispatchEvent(i[0],wn,{detail:{files:t}})}pushFormRecovery(e,t,i){this.liveSocket.withinOwners(e,(n,r)=>{let s=e.elements[0],o=e.getAttribute(this.binding(ji))||e.getAttribute(this.binding("change"));ve.exec("change",o,n,s,["push",{_target:s.name,newCid:t,callback:i}])})}pushLinkPatch(e,t,i){let n=this.liveSocket.setPendingLink(e),r=t?()=>this.putRef([t],"click"):null,s=()=>this.liveSocket.redirect(window.location.href),o=this.pushWithReply(r,"live_patch",{url:e},a=>{this.liveSocket.requestDOMUpdate(()=>{a.link_redirect?this.liveSocket.replaceMain(e,null,i,n):(this.liveSocket.commitPendingLink(n)&&(this.href=e),this.applyPendingUpdates(),i&&i(n))})});o?o.receive("timeout",s):s()}formsForRecovery(e){if(this.joinCount===0)return[];let t=this.binding("change"),i=document.createElement("template");return i.innerHTML=e,_.all(this.el,`form[${t}]`).filter(n=>n.id&&this.ownsElement(n)).filter(n=>n.elements.length>0).filter(n=>n.getAttribute(this.binding(ji))!=="ignore").map(n=>{let r=i.content.querySelector(`form[id="${n.id}"][${t}="${n.getAttribute(t)}"]`);return r?[n,r,this.targetComponentID(r)]:[n,null,null]}).filter(([n,r,s])=>r)}maybePushComponentsDestroyed(e){let t=e.filter(i=>_.findComponentNodeList(this.el,i).length===0);t.length>0&&(this.pruningCIDs.push(...t),this.pushWithReply(null,"cids_will_destroy",{cids:t},()=>{this.pruningCIDs=this.pruningCIDs.filter(n=>t.indexOf(n)!==-1);let i=t.filter(n=>_.findComponentNodeList(this.el,n).length===0);i.length>0&&this.pushWithReply(null,"cids_destroyed",{cids:i},n=>{this.rendered.pruneCIDs(n.cids)})}))}ownsElement(e){return e.getAttribute(je)===this.id||Ce(e.closest(Be),t=>t.id)===this.id}submitForm(e,t,i,n={}){_.putPrivate(e,Sn,!0);let r=this.liveSocket.binding(oi),s=Array.from(e.elements);this.liveSocket.blurActiveElement(this),this.pushFormSubmit(e,t,i,n,()=>{s.forEach(o=>_.showError(o,r)),this.liveSocket.restorePreviouslyActiveFocus()})}binding(e){return this.liveSocket.binding(e)}},ts=class{constructor(e,t,i={}){if(this.unloaded=!1,!t||t.constructor.name==="Object")throw new Error(`
a phoenix Socket must be provided as the second argument to the LiveSocket constructor. For example:
import {Socket} from "phoenix"
import {LiveSocket} from "phoenix_live_view"
let liveSocket = new LiveSocket("/live", Socket, {...})
`);this.socket=new t(e,i),this.bindingPrefix=i.bindingPrefix||Sr,this.opts=i,this.params=Vt(i.params||{}),this.viewLogger=i.viewLogger,this.metadataCallbacks=i.metadata||{},this.defaults=Object.assign(Tt(Or),i.defaults||{}),this.activeElement=null,this.prevActive=null,this.silenced=!1,this.main=null,this.outgoingMainEl=null,this.clickStartedAtTarget=null,this.linkRef=1,this.roots={},this.href=window.location.href,this.pendingLink=null,this.currentLocation=Tt(window.location),this.hooks=i.hooks||{},this.uploaders=i.uploaders||{},this.loaderTimeout=i.loaderTimeout||Cr,this.reloadWithJitterTimer=null,this.maxReloads=i.maxReloads||dr,this.reloadJitterMin=i.reloadJitterMin||ur,this.reloadJitterMax=i.reloadJitterMax||fr,this.failsafeJitter=i.failsafeJitter||pr,this.localStorage=i.localStorage||window.localStorage,this.sessionStorage=i.sessionStorage||window.sessionStorage,this.boundTopLevelEvents=!1,this.domCallbacks=Object.assign({onNodeAdded:Vt(),onBeforeElUpdated:Vt()},i.dom||{}),this.transitions=new is,window.addEventListener("pagehide",n=>{this.unloaded=!0}),this.socket.onOpen(()=>{this.isUnloaded()&&window.location.reload()})}isProfileEnabled(){return this.sessionStorage.getItem(Ft)==="true"}isDebugEnabled(){return this.sessionStorage.getItem(mt)==="true"}isDebugDisabled(){return this.sessionStorage.getItem(mt)==="false"}enableDebug(){this.sessionStorage.setItem(mt,"true")}enableProfiling(){this.sessionStorage.setItem(Ft,"true")}disableDebug(){this.sessionStorage.setItem(mt,"false")}disableProfiling(){this.sessionStorage.removeItem(Ft)}enableLatencySim(e){this.enableDebug(),console.log("latency simulator enabled for the duration of this browser session. Call disableLatencySim() to disable"),this.sessionStorage.setItem(Ut,e)}disableLatencySim(){this.sessionStorage.removeItem(Ut)}getLatencySim(){let e=this.sessionStorage.getItem(Ut);return e?parseInt(e):null}getSocket(){return this.socket}connect(){window.location.hostname==="localhost"&&!this.isDebugDisabled()&&this.enableDebug();let e=()=>{this.joinRootViews()?(this.bindTopLevelEvents(),this.socket.connect()):this.main&&this.socket.connect()};["complete","loaded","interactive"].indexOf(document.readyState)>=0?e():document.addEventListener("DOMContentLoaded",()=>e())}disconnect(e){clearTimeout(this.reloadWithJitterTimer),this.socket.disconnect(e)}replaceTransport(e){clearTimeout(this.reloadWithJitterTimer),this.socket.replaceTransport(e),this.connect()}execJS(e,t,i=null){this.owner(e,n=>ve.exec(i,t,n,e))}triggerDOM(e,t){this.domCallbacks[e](...t)}time(e,t){if(!this.isProfileEnabled()||!console.time)return t();console.time(e);let i=t();return console.timeEnd(e),i}log(e,t,i){if(this.viewLogger){let[n,r]=i();this.viewLogger(e,t,n,r)}else if(this.isDebugEnabled()){let[n,r]=i();xr(e,t,n,r)}}requestDOMUpdate(e){this.transitions.after(e)}transition(e,t,i=function(){}){this.transitions.addTransition(e,t,i)}onChannel(e,t,i){e.on(t,n=>{let r=this.getLatencySim();r?(console.log(`simulating ${r}ms of latency from server to client`),setTimeout(()=>i(n),r)):i(n)})}wrapPush(e,t,i){let n=this.getLatencySim(),r=e.joinCount;if(!n)return this.isConnected()&&t.timeout?i().receive("timeout",()=>{e.joinCount===r&&!e.isDestroyed()&&this.reloadWithJitter(e,()=>{this.log(e,"timeout",()=>["received timeout while communicating with server. Falling back to hard refresh for recovery"])})}):i();console.log(`simulating ${n}ms of latency from client to server`);let s={receives:[],receive(o,a){this.receives.push([o,a])}};return setTimeout(()=>{e.isDestroyed()||s.receives.reduce((o,[a,l])=>o.receive(a,l),i())},n),s}reloadWithJitter(e,t){clearTimeout(this.reloadWithJitterTimer),this.disconnect();let i=this.reloadJitterMin,n=this.reloadJitterMax,r=Math.floor(Math.random()*(n-i+1))+i,s=ke.updateLocal(this.localStorage,window.location.pathname,En,0,o=>o+1);s>this.maxReloads&&(r=this.failsafeJitter),this.reloadWithJitterTimer=setTimeout(()=>{e.isDestroyed()||e.isConnected()||(e.destroy(),t?t():this.log(e,"join",()=>[`encountered ${s} consecutive reloads`]),s>this.maxReloads&&this.log(e,"join",()=>[`exceeded ${this.maxReloads} consecutive reloads. Entering failsafe mode`]),this.hasPendingLink()?window.location=this.pendingLink:window.location.reload())},r)}getHookCallbacks(e){return e&&e.startsWith("Phoenix.")?Hr[e.split(".")[1]]:this.hooks[e]}isUnloaded(){return this.unloaded}isConnected(){return this.socket.isConnected()}getBindingPrefix(){return this.bindingPrefix}binding(e){return`${this.getBindingPrefix()}${e}`}channel(e,t){return this.socket.channel(e,t)}joinRootViews(){let e=!1;return _.all(document,`${Be}:not([${je}])`,t=>{if(!this.getRootById(t.id)){let i=this.newRootView(t);i.setHref(this.getHref()),i.join(),t.getAttribute(pi)&&(this.main=i)}e=!0}),e}redirect(e,t){this.disconnect(),ke.redirect(e,t)}replaceMain(e,t,i=null,n=this.setPendingLink(e)){this.outgoingMainEl=this.outgoingMainEl||this.main.el;let r=_.cloneNode(this.outgoingMainEl,"");this.main.showLoader(this.loaderTimeout),this.main.destroy(),this.main=this.newRootView(r,t),this.main.setRedirect(e),this.transitionRemoves(),this.main.join((s,o)=>{s===1&&this.commitPendingLink(n)&&this.requestDOMUpdate(()=>{_.findPhxSticky(document).forEach(a=>r.appendChild(a)),this.outgoingMainEl.replaceWith(r),this.outgoingMainEl=null,i&&requestAnimationFrame(i),o()})})}transitionRemoves(e){let t=this.binding("remove");e=e||_.all(document,`[${t}]`),e.forEach(i=>{document.body.contains(i)&&this.execJS(i,i.getAttribute(t),"remove")})}isPhxView(e){return e.getAttribute&&e.getAttribute(De)!==null}newRootView(e,t){let i=new On(e,this,null,t);return this.roots[i.id]=i,i}owner(e,t){let i=Ce(e.closest(Be),n=>this.getViewByEl(n))||this.main;i&&t(i)}withinOwners(e,t){this.owner(e,i=>t(i,e))}getViewByEl(e){let t=e.getAttribute(at);return Ce(this.getRootById(t),i=>i.getDescendentByEl(e))}getRootById(e){return this.roots[e]}destroyAllViews(){for(let e in this.roots)this.roots[e].destroy(),delete this.roots[e];this.main=null}destroyViewByEl(e){let t=this.getRootById(e.getAttribute(at));t&&t.id===e.id?(t.destroy(),delete this.roots[t.id]):t&&t.destroyDescendent(e.id)}setActiveElement(e){if(this.activeElement===e)return;this.activeElement=e;let t=()=>{e===this.activeElement&&(this.activeElement=null),e.removeEventListener("mouseup",this),e.removeEventListener("touchend",this)};e.addEventListener("mouseup",t),e.addEventListener("touchend",t)}getActiveElement(){return document.activeElement===document.body?this.activeElement||document.activeElement:document.activeElement||document.body}dropActiveElement(e){this.prevActive&&e.ownsElement(this.prevActive)&&(this.prevActive=null)}restorePreviouslyActiveFocus(){this.prevActive&&this.prevActive!==document.body&&this.prevActive.focus()}blurActiveElement(){this.prevActive=this.getActiveElement(),this.prevActive!==document.body&&this.prevActive.blur()}bindTopLevelEvents(){this.boundTopLevelEvents||(this.boundTopLevelEvents=!0,this.socket.onClose(e=>{e&&e.code===1e3&&this.main&&this.reloadWithJitter(this.main)}),document.body.addEventListener("click",function(){}),window.addEventListener("pageshow",e=>{e.persisted&&(this.getSocket().disconnect(),this.withPageLoading({to:window.location.href,kind:"redirect"}),window.location.reload())},!0),this.bindNav(),this.bindClicks(),this.bindForms(),this.bind({keyup:"keyup",keydown:"keydown"},(e,t,i,n,r,s)=>{let o=n.getAttribute(this.binding(Ar)),a=e.key&&e.key.toLowerCase();if(o&&o.toLowerCase()!==a)return;let l={key:e.key,...this.eventMeta(t,e,n)};ve.exec(t,r,i,n,["push",{data:l}])}),this.bind({blur:"focusout",focus:"focusin"},(e,t,i,n,r,s)=>{if(!s){let o={key:e.key,...this.eventMeta(t,e,n)};ve.exec(t,r,i,n,["push",{data:o}])}}),this.bind({blur:"blur",focus:"focus"},(e,t,i,n,r,s,o)=>{if(o==="window"){let a=this.eventMeta(t,e,n);ve.exec(t,s,i,n,["push",{data:a}])}}),window.addEventListener("dragover",e=>e.preventDefault()),window.addEventListener("drop",e=>{e.preventDefault();let t=Ce(rt(e.target,this.binding(xi)),r=>r.getAttribute(this.binding(xi))),i=t&&document.getElementById(t),n=Array.from(e.dataTransfer.files||[]);!i||i.disabled||n.length===0||!(i.files instanceof FileList)||(G.trackFiles(i,n),i.dispatchEvent(new Event("input",{bubbles:!0})))}),this.on(wn,e=>{let t=e.target;if(!_.isUploadInput(t))return;let i=Array.from(e.detail.files||[]).filter(n=>n instanceof File||n instanceof Blob);G.trackFiles(t,i),t.dispatchEvent(new Event("input",{bubbles:!0}))}))}eventMeta(e,t,i){let n=this.metadataCallbacks[e];return n?n(t,i):{}}setPendingLink(e){return this.linkRef++,this.pendingLink=e,this.linkRef}commitPendingLink(e){return this.linkRef!==e?!1:(this.href=this.pendingLink,this.pendingLink=null,!0)}getHref(){return this.href}hasPendingLink(){return!!this.pendingLink}bind(e,t){for(let i in e){let n=e[i];this.on(n,r=>{let s=this.binding(i),o=this.binding(`window-${i}`),a=r.target.getAttribute&&r.target.getAttribute(s);a?this.debounce(r.target,r,n,()=>{this.withinOwners(r.target,l=>{t(r,i,l,r.target,a,null)})}):_.all(document,`[${o}]`,l=>{let c=l.getAttribute(o);this.debounce(l,r,n,()=>{this.withinOwners(l,d=>{t(r,i,d,l,c,"window")})})})})}}bindClicks(){window.addEventListener("mousedown",e=>this.clickStartedAtTarget=e.target),this.bindClick("click","click",!1),this.bindClick("mousedown","capture-click",!0)}bindClick(e,t,i){let n=this.binding(t);window.addEventListener(e,r=>{let s=null;if(i)s=r.target.matches(`[${n}]`)?r.target:r.target.querySelector(`[${n}]`);else{let a=this.clickStartedAtTarget||r.target;s=rt(a,n),this.dispatchClickAway(r,a),this.clickStartedAtTarget=null}let o=s&&s.getAttribute(n);!o||(s.getAttribute("href")==="#"&&r.preventDefault(),this.debounce(s,r,"click",()=>{this.withinOwners(s,a=>{ve.exec("click",o,a,s,["push",{data:this.eventMeta("click",r,s)}])})}))},i)}dispatchClickAway(e,t){let i=this.binding("click-away");_.all(document,`[${i}]`,n=>{n.isSameNode(t)||n.contains(t)||this.withinOwners(e.target,r=>{let s=n.getAttribute(i);ve.isVisible(n)&&ve.exec("click",s,r,n,["push",{data:this.eventMeta("click",e,e.target)}])})})}bindNav(){if(!ke.canPushState())return;history.scrollRestoration&&(history.scrollRestoration="manual");let e=null;window.addEventListener("scroll",t=>{clearTimeout(e),e=setTimeout(()=>{ke.updateCurrentState(i=>Object.assign(i,{scroll:window.scrollY}))},100)}),window.addEventListener("popstate",t=>{if(!this.registerNewLocation(window.location))return;let{type:i,id:n,root:r,scroll:s}=t.state||{},o=window.location.href;this.requestDOMUpdate(()=>{this.main.isConnected()&&i==="patch"&&n===this.main.id?this.main.pushLinkPatch(o,null):this.replaceMain(o,null,()=>{r&&this.replaceRootHistory(),typeof s=="number"&&setTimeout(()=>{window.scrollTo(0,s)},0)})})},!1),window.addEventListener("click",t=>{let i=rt(t.target,$t),n=i&&i.getAttribute($t),r=t.metaKey||t.ctrlKey||t.button===1;if(!n||!this.isConnected()||!this.main||r)return;let s=i.href,o=i.getAttribute(mr);t.preventDefault(),t.stopImmediatePropagation(),this.pendingLink!==s&&this.requestDOMUpdate(()=>{if(n==="patch")this.pushHistoryPatch(s,o,i);else if(n==="redirect")this.historyRedirect(s,o);else throw new Error(`expected ${$t} to be "patch" or "redirect", got: ${n}`)})},!1)}dispatchEvent(e,t={}){_.dispatchEvent(window,`phx:${e}`,{detail:t})}dispatchEvents(e){e.forEach(([t,i])=>this.dispatchEvent(t,i))}withPageLoading(e,t){_.dispatchEvent(window,"phx:page-loading-start",{detail:e});let i=()=>_.dispatchEvent(window,"phx:page-loading-stop",{detail:e});return t?t(i):i}pushHistoryPatch(e,t,i){this.withPageLoading({to:e,kind:"patch"},n=>{this.main.pushLinkPatch(e,i,r=>{this.historyPatch(e,t,r),n()})})}historyPatch(e,t,i=this.setPendingLink(e)){!this.commitPendingLink(i)||(ke.pushState(t,{type:"patch",id:this.main.id},e),this.registerNewLocation(window.location))}historyRedirect(e,t,i){let n=window.scrollY;this.withPageLoading({to:e,kind:"redirect"},r=>{this.replaceMain(e,i,()=>{ke.pushState(t,{type:"redirect",id:this.main.id,scroll:n},e),this.registerNewLocation(window.location),r()})})}replaceRootHistory(){ke.pushState("replace",{root:!0,type:"patch",id:this.main.id})}registerNewLocation(e){let{pathname:t,search:i}=this.currentLocation;return t+i===e.pathname+e.search?!1:(this.currentLocation=Tt(e),!0)}bindForms(){let e=0;this.on("submit",t=>{let i=t.target.getAttribute(this.binding("submit"));!i||(t.preventDefault(),t.target.disabled=!0,this.withinOwners(t.target,n=>{ve.exec("submit",i,n,t.target,["push",{}])}))},!1);for(let t of["change","input"])this.on(t,i=>{let n=this.binding("change"),r=i.target,s=r.getAttribute(n),o=r.form&&r.form.getAttribute(n),a=s||o;if(!a||r.type==="number"&&r.validity&&r.validity.badInput)return;let l=s?r:r.form,c=e;e++;let{at:d,type:h}=_.private(r,"prev-iteration")||{};d===c-1&&t!==h||(_.putPrivate(r,"prev-iteration",{at:c,type:t}),this.debounce(r,i,t,()=>{this.withinOwners(l,g=>{_.putPrivate(r,Cn,!0),_.isTextualInput(r)||this.setActiveElement(r),ve.exec("change",a,g,r,["push",{_target:i.target.name,dispatcher:l}])})}))},!1)}debounce(e,t,i,n){if(i==="blur"||i==="focusout")return n();let r=this.binding(yr),s=this.binding(Er),o=this.defaults.debounce.toString(),a=this.defaults.throttle.toString();this.withinOwners(e,l=>{let c=()=>!l.isDestroyed()&&document.body.contains(e);_.debounce(e,t,r,o,s,a,c,()=>{n()})})}silenceEvents(e){this.silenced=!0,e(),this.silenced=!1}on(e,t){window.addEventListener(e,i=>{this.silenced||t(i)})}},is=class{constructor(){this.transitions=new Set,this.pendingOps=[],this.reset()}reset(){this.transitions.forEach(e=>{cancelTimeout(e),this.transitions.delete(e)}),this.flushPendingOps()}after(e){this.size()===0?e():this.pushPendingOp(e)}addTransition(e,t,i){t();let n=setTimeout(()=>{this.transitions.delete(n),i(),this.size()===0&&this.flushPendingOps()},e);this.transitions.add(n)}pushPendingOp(e){this.pendingOps.push(e)}size(){return this.transitions.size}flushPendingOps(){this.pendingOps.forEach(e=>e()),this.pendingOps=[]}},ns={exports:{}},At={exports:{}};/*!
* Bootstrap index.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var Qi;function pe(){return Qi||(Qi=1,function(e,t){(function(i,n){n(t)})(Z,function(i){const s="transitionend",o=p=>p==null?`${p}`:Object.prototype.toString.call(p).match(/\s([a-z]+)/i)[1].toLowerCase(),a=p=>{do p+=Math.floor(Math.random()*1e6);while(document.getElementById(p));return p},l=p=>{let O=p.getAttribute("data-bs-target");if(!O||O==="#"){let R=p.getAttribute("href");if(!R||!R.includes("#")&&!R.startsWith("."))return null;R.includes("#")&&!R.startsWith("#")&&(R=`#${R.split("#")[1]}`),O=R&&R!=="#"?R.trim():null}return O},c=p=>{const O=l(p);return O&&document.querySelector(O)?O:null},d=p=>{const O=l(p);return O?document.querySelector(O):null},h=p=>{if(!p)return 0;let{transitionDuration:O,transitionDelay:R}=window.getComputedStyle(p);const T=Number.parseFloat(O),w=Number.parseFloat(R);return!T&&!w?0:(O=O.split(",")[0],R=R.split(",")[0],(Number.parseFloat(O)+Number.parseFloat(R))*1e3)},g=p=>{p.dispatchEvent(new Event(s))},u=p=>!p||typeof p!="object"?!1:(typeof p.jquery<"u"&&(p=p[0]),typeof p.nodeType<"u"),b=p=>u(p)?p.jquery?p[0]:p:typeof p=="string"&&p.length>0?document.querySelector(p):null,m=p=>{if(!u(p)||p.getClientRects().length===0)return!1;const O=getComputedStyle(p).getPropertyValue("visibility")==="visible",R=p.closest("details:not([open])");if(!R)return O;if(R!==p){const T=p.closest("summary");if(T&&T.parentNode!==R||T===null)return!1}return O},y=p=>!p||p.nodeType!==Node.ELEMENT_NODE||p.classList.contains("disabled")?!0:typeof p.disabled<"u"?p.disabled:p.hasAttribute("disabled")&&p.getAttribute("disabled")!=="false",S=p=>{if(!document.documentElement.attachShadow)return null;if(typeof p.getRootNode=="function"){const O=p.getRootNode();return O instanceof ShadowRoot?O:null}return p instanceof ShadowRoot?p:p.parentNode?S(p.parentNode):null},N=()=>{},f=p=>{p.offsetHeight},A=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,P=[],E=p=>{document.readyState==="loading"?(P.length||document.addEventListener("DOMContentLoaded",()=>{for(const O of P)O()}),P.push(p)):p()},C=()=>document.documentElement.dir==="rtl",x=p=>{E(()=>{const O=A();if(O){const R=p.NAME,T=O.fn[R];O.fn[R]=p.jQueryInterface,O.fn[R].Constructor=p,O.fn[R].noConflict=()=>(O.fn[R]=T,p.jQueryInterface)}})},k=p=>{typeof p=="function"&&p()},I=(p,O,R=!0)=>{if(!R){k(p);return}const T=5,w=h(O)+T;let v=!1;const D=({target:M})=>{M===O&&(v=!0,O.removeEventListener(s,D),k(p))};O.addEventListener(s,D),setTimeout(()=>{v||g(O)},w)},H=(p,O,R,T)=>{const w=p.length;let v=p.indexOf(O);return v===-1?!R&&T?p[w-1]:p[0]:(v+=R?1:-1,T&&(v=(v+w)%w),p[Math.max(0,Math.min(v,w-1))])};i.defineJQueryPlugin=x,i.execute=k,i.executeAfterTransition=I,i.findShadowRoot=S,i.getElement=b,i.getElementFromSelector=d,i.getNextActiveElement=H,i.getSelectorFromElement=c,i.getTransitionDurationFromElement=h,i.getUID=a,i.getjQuery=A,i.isDisabled=y,i.isElement=u,i.isRTL=C,i.isVisible=m,i.noop=N,i.onDOMContentLoaded=E,i.reflow=f,i.toType=o,i.triggerTransitionEnd=g,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})}(At,At.exports)),At.exports}var Kt={exports:{}};/*!
* Bootstrap event-handler.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var Zi;function Le(){return Zi||(Zi=1,function(e,t){(function(i,n){e.exports=n(pe())})(Z,function(i){const n=/[^.]*(?=\..*)\.|.*/,r=/\..*/,s=/::\d+$/,o={};let a=1;const l={mouseenter:"mouseover",mouseleave:"mouseout"},c=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function d(E,C){return C&&`${C}::${a++}`||E.uidEvent||a++}function h(E){const C=d(E);return E.uidEvent=C,o[C]=o[C]||{},o[C]}function g(E,C){return function x(k){return P(k,{delegateTarget:E}),x.oneOff&&A.off(E,k.type,C),C.apply(E,[k])}}function u(E,C,x){return function k(I){const H=E.querySelectorAll(C);for(let{target:p}=I;p&&p!==this;p=p.parentNode)for(const O of H)if(O===p)return P(I,{delegateTarget:p}),k.oneOff&&A.off(E,I.type,C,x),x.apply(p,[I])}}function b(E,C,x=null){return Object.values(E).find(k=>k.callable===C&&k.delegationSelector===x)}function m(E,C,x){const k=typeof C=="string",I=k?x:C||x;let H=f(E);return c.has(H)||(H=E),[k,I,H]}function y(E,C,x,k,I){if(typeof C!="string"||!E)return;let[H,p,O]=m(C,x,k);C in l&&(p=(F=>function(B){if(!B.relatedTarget||B.relatedTarget!==B.delegateTarget&&!B.delegateTarget.contains(B.relatedTarget))return F.call(this,B)})(p));const R=h(E),T=R[O]||(R[O]={}),w=b(T,p,H?x:null);if(w){w.oneOff=w.oneOff&&I;return}const v=d(p,C.replace(n,"")),D=H?u(E,x,p):g(E,p);D.delegationSelector=H?x:null,D.callable=p,D.oneOff=I,D.uidEvent=v,T[v]=D,E.addEventListener(O,D,H)}function S(E,C,x,k,I){const H=b(C[x],k,I);!H||(E.removeEventListener(x,H,Boolean(I)),delete C[x][H.uidEvent])}function N(E,C,x,k){const I=C[x]||{};for(const H of Object.keys(I))if(H.includes(k)){const p=I[H];S(E,C,x,p.callable,p.delegationSelector)}}function f(E){return E=E.replace(r,""),l[E]||E}const A={on(E,C,x,k){y(E,C,x,k,!1)},one(E,C,x,k){y(E,C,x,k,!0)},off(E,C,x,k){if(typeof C!="string"||!E)return;const[I,H,p]=m(C,x,k),O=p!==C,R=h(E),T=R[p]||{},w=C.startsWith(".");if(typeof H<"u"){if(!Object.keys(T).length)return;S(E,R,p,H,I?x:null);return}if(w)for(const v of Object.keys(R))N(E,R,v,C.slice(1));for(const v of Object.keys(T)){const D=v.replace(s,"");if(!O||C.includes(D)){const M=T[v];S(E,R,p,M.callable,M.delegationSelector)}}},trigger(E,C,x){if(typeof C!="string"||!E)return null;const k=i.getjQuery(),I=f(C),H=C!==I;let p=null,O=!0,R=!0,T=!1;H&&k&&(p=k.Event(C,x),k(E).trigger(p),O=!p.isPropagationStopped(),R=!p.isImmediatePropagationStopped(),T=p.isDefaultPrevented());let w=new Event(C,{bubbles:O,cancelable:!0});return w=P(w,x),T&&w.preventDefault(),R&&E.dispatchEvent(w),w.defaultPrevented&&p&&p.preventDefault(),w}};function P(E,C){for(const[x,k]of Object.entries(C||{}))try{E[x]=k}catch{Object.defineProperty(E,x,{configurable:!0,get(){return k}})}return E}return A})}(Kt)),Kt.exports}var Jt={exports:{}},Xt={exports:{}};/*!
* Bootstrap data.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var en;function rs(){return en||(en=1,function(e,t){(function(i,n){e.exports=n()})(Z,function(){const i=new Map;return{set(r,s,o){i.has(r)||i.set(r,new Map);const a=i.get(r);if(!a.has(s)&&a.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(a.keys())[0]}.`);return}a.set(s,o)},get(r,s){return i.has(r)&&i.get(r).get(s)||null},remove(r,s){if(!i.has(r))return;const o=i.get(r);o.delete(s),o.size===0&&i.delete(r)}}})}(Xt)),Xt.exports}var zt={exports:{}},Yt={exports:{}};/*!
* Bootstrap manipulator.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var tn;function gi(){return tn||(tn=1,function(e,t){(function(i,n){e.exports=n()})(Z,function(){function i(s){if(s==="true")return!0;if(s==="false")return!1;if(s===Number(s).toString())return Number(s);if(s===""||s==="null")return null;if(typeof s!="string")return s;try{return JSON.parse(decodeURIComponent(s))}catch{return s}}function n(s){return s.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}return{setDataAttribute(s,o,a){s.setAttribute(`data-bs-${n(o)}`,a)},removeDataAttribute(s,o){s.removeAttribute(`data-bs-${n(o)}`)},getDataAttributes(s){if(!s)return{};const o={},a=Object.keys(s.dataset).filter(l=>l.startsWith("bs")&&!l.startsWith("bsConfig"));for(const l of a){let c=l.replace(/^bs/,"");c=c.charAt(0).toLowerCase()+c.slice(1,c.length),o[c]=i(s.dataset[l])}return o},getDataAttribute(s,o){return i(s.getAttribute(`data-bs-${n(o)}`))}}})}(Yt)),Yt.exports}/*!
* Bootstrap config.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var nn;function mi(){return nn||(nn=1,function(e,t){(function(i,n){e.exports=n(pe(),gi())})(Z,function(i,n){const s=(a=>a&&typeof a=="object"&&"default"in a?a:{default:a})(n);class o{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(l){return l=this._mergeConfigObj(l),l=this._configAfterMerge(l),this._typeCheckConfig(l),l}_configAfterMerge(l){return l}_mergeConfigObj(l,c){const d=i.isElement(c)?s.default.getDataAttribute(c,"config"):{};return{...this.constructor.Default,...typeof d=="object"?d:{},...i.isElement(c)?s.default.getDataAttributes(c):{},...typeof l=="object"?l:{}}}_typeCheckConfig(l,c=this.constructor.DefaultType){for(const d of Object.keys(c)){const h=c[d],g=l[d],u=i.isElement(g)?"element":i.toType(g);if(!new RegExp(h).test(u))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${d}" provided type "${u}" but expected type "${h}".`)}}}return o})}(zt)),zt.exports}/*!
* Bootstrap base-component.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var rn;function Dt(){return rn||(rn=1,function(e,t){(function(i,n){e.exports=n(rs(),pe(),Le(),mi())})(Z,function(i,n,r,s){const o=g=>g&&typeof g=="object"&&"default"in g?g:{default:g},a=o(i),l=o(r),c=o(s),d="5.2.0";class h extends c.default{constructor(u,b){super(),u=n.getElement(u),u&&(this._element=u,this._config=this._getConfig(b),a.default.set(this._element,this.constructor.DATA_KEY,this))}dispose(){a.default.remove(this._element,this.constructor.DATA_KEY),l.default.off(this._element,this.constructor.EVENT_KEY);for(const u of Object.getOwnPropertyNames(this))this[u]=null}_queueCallback(u,b,m=!0){n.executeAfterTransition(u,b,m)}_getConfig(u){return u=this._mergeConfigObj(u,this._element),u=this._configAfterMerge(u),this._typeCheckConfig(u),u}static getInstance(u){return a.default.get(n.getElement(u),this.DATA_KEY)}static getOrCreateInstance(u,b={}){return this.getInstance(u)||new this(u,typeof b=="object"?b:null)}static get VERSION(){return d}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(u){return`${u}${this.EVENT_KEY}`}}return h})}(Jt)),Jt.exports}var wt={exports:{}};/*!
* Bootstrap component-functions.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var sn;function Dn(){return sn||(sn=1,function(e,t){(function(i,n){n(t,Le(),pe())})(Z,function(i,n,r){const o=(l=>l&&typeof l=="object"&&"default"in l?l:{default:l})(n),a=(l,c="hide")=>{const d=`click.dismiss${l.EVENT_KEY}`,h=l.NAME;o.default.on(document,d,`[data-bs-dismiss="${h}"]`,function(g){if(["A","AREA"].includes(this.tagName)&&g.preventDefault(),r.isDisabled(this))return;const u=r.getElementFromSelector(this)||this.closest(`.${h}`);l.getOrCreateInstance(u)[c]()})};i.enableDismissTrigger=a,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})}(wt,wt.exports)),wt.exports}/*!
* Bootstrap alert.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/(function(e,t){(function(i,n){e.exports=n(pe(),Le(),Dt(),Dn())})(Z,function(i,n,r,s){const o=S=>S&&typeof S=="object"&&"default"in S?S:{default:S},a=o(n),l=o(r),c="alert",h=".bs.alert",g=`close${h}`,u=`closed${h}`,b="fade",m="show";class y extends l.default{static get NAME(){return c}close(){if(a.default.trigger(this._element,g).defaultPrevented)return;this._element.classList.remove(m);const f=this._element.classList.contains(b);this._queueCallback(()=>this._destroyElement(),this._element,f)}_destroyElement(){this._element.remove(),a.default.trigger(this._element,u),this.dispose()}static jQueryInterface(N){return this.each(function(){const f=y.getOrCreateInstance(this);if(typeof N=="string"){if(f[N]===void 0||N.startsWith("_")||N==="constructor")throw new TypeError(`No method named "${N}"`);f[N](this)}})}}return s.enableDismissTrigger(y,"close"),i.defineJQueryPlugin(y),y})})(ns);var Ln={exports:{}},Gt={exports:{}};/*!
* Bootstrap selector-engine.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var on;function lt(){return on||(on=1,function(e,t){(function(i,n){e.exports=n(pe())})(Z,function(i){return{find(r,s=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(s,r))},findOne(r,s=document.documentElement){return Element.prototype.querySelector.call(s,r)},children(r,s){return[].concat(...r.children).filter(o=>o.matches(s))},parents(r,s){const o=[];let a=r.parentNode.closest(s);for(;a;)o.push(a),a=a.parentNode.closest(s);return o},prev(r,s){let o=r.previousElementSibling;for(;o;){if(o.matches(s))return[o];o=o.previousElementSibling}return[]},next(r,s){let o=r.nextElementSibling;for(;o;){if(o.matches(s))return[o];o=o.nextElementSibling}return[]},focusableChildren(r){const s=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(o=>`${o}:not([tabindex^="-"])`).join(",");return this.find(s,r).filter(o=>!i.isDisabled(o)&&i.isVisible(o))}}})}(Gt)),Gt.exports}/*!
* Bootstrap collapse.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/(function(e,t){(function(i,n){e.exports=n(pe(),Le(),lt(),Dt())})(Z,function(i,n,r,s){const o=w=>w&&typeof w=="object"&&"default"in w?w:{default:w},a=o(n),l=o(r),c=o(s),d="collapse",g=".bs.collapse",u=".data-api",b=`show${g}`,m=`shown${g}`,y=`hide${g}`,S=`hidden${g}`,N=`click${g}${u}`,f="show",A="collapse",P="collapsing",E="collapsed",C=`:scope .${A} .${A}`,x="collapse-horizontal",k="width",I="height",H=".collapse.show, .collapse.collapsing",p='[data-bs-toggle="collapse"]',O={parent:null,toggle:!0},R={parent:"(null|element)",toggle:"boolean"};class T extends c.default{constructor(v,D){super(v,D),this._isTransitioning=!1,this._triggerArray=[];const M=l.default.find(p);for(const F of M){const B=i.getSelectorFromElement(F),J=l.default.find(B).filter(V=>V===this._element);B!==null&&J.length&&this._triggerArray.push(F)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return O}static get DefaultType(){return R}static get NAME(){return d}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let v=[];if(this._config.parent&&(v=this._getFirstLevelChildren(H).filter(V=>V!==this._element).map(V=>T.getOrCreateInstance(V,{toggle:!1}))),v.length&&v[0]._isTransitioning||a.default.trigger(this._element,b).defaultPrevented)return;for(const V of v)V.hide();const M=this._getDimension();this._element.classList.remove(A),this._element.classList.add(P),this._element.style[M]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const F=()=>{this._isTransitioning=!1,this._element.classList.remove(P),this._element.classList.add(A,f),this._element.style[M]="",a.default.trigger(this._element,m)},J=`scroll${M[0].toUpperCase()+M.slice(1)}`;this._queueCallback(F,this._element,!0),this._element.style[M]=`${this._element[J]}px`}hide(){if(this._isTransitioning||!this._isShown()||a.default.trigger(this._element,y).defaultPrevented)return;const D=this._getDimension();this._element.style[D]=`${this._element.getBoundingClientRect()[D]}px`,i.reflow(this._element),this._element.classList.add(P),this._element.classList.remove(A,f);for(const F of this._triggerArray){const B=i.getElementFromSelector(F);B&&!this._isShown(B)&&this._addAriaAndCollapsedClass([F],!1)}this._isTransitioning=!0;const M=()=>{this._isTransitioning=!1,this._element.classList.remove(P),this._element.classList.add(A),a.default.trigger(this._element,S)};this._element.style[D]="",this._queueCallback(M,this._element,!0)}_isShown(v=this._element){return v.classList.contains(f)}_configAfterMerge(v){return v.toggle=Boolean(v.toggle),v.parent=i.getElement(v.parent),v}_getDimension(){return this._element.classList.contains(x)?k:I}_initializeChildren(){if(!this._config.parent)return;const v=this._getFirstLevelChildren(p);for(const D of v){const M=i.getElementFromSelector(D);M&&this._addAriaAndCollapsedClass([D],this._isShown(M))}}_getFirstLevelChildren(v){const D=l.default.find(C,this._config.parent);return l.default.find(v,this._config.parent).filter(M=>!D.includes(M))}_addAriaAndCollapsedClass(v,D){if(!!v.length)for(const M of v)M.classList.toggle(E,!D),M.setAttribute("aria-expanded",D)}static jQueryInterface(v){const D={};return typeof v=="string"&&/show|hide/.test(v)&&(D.toggle=!1),this.each(function(){const M=T.getOrCreateInstance(this,D);if(typeof v=="string"){if(typeof M[v]>"u")throw new TypeError(`No method named "${v}"`);M[v]()}})}}return a.default.on(document,N,p,function(w){(w.target.tagName==="A"||w.delegateTarget&&w.delegateTarget.tagName==="A")&&w.preventDefault();const v=i.getSelectorFromElement(this),D=l.default.find(v);for(const M of D)T.getOrCreateInstance(M,{toggle:!1}).toggle()}),i.defineJQueryPlugin(T),T})})(Ln);const ss=Ln.exports;var os={exports:{}},te="top",le="bottom",ce="right",ie="left",Lt="auto",Ke=[te,le,ce,ie],Me="start",Fe="end",Pn="clippingParents",vi="viewport",$e="popper",xn="reference",ci=Ke.reduce(function(e,t){return e.concat([t+"-"+Me,t+"-"+Fe])},[]),bi=[].concat(Ke,[Lt]).reduce(function(e,t){return e.concat([t,t+"-"+Me,t+"-"+Fe])},[]),Rn="beforeRead",Nn="read",In="afterRead",Mn="beforeMain",Hn="main",$n="afterMain",jn="beforeWrite",Bn="write",Fn="afterWrite",Un=[Rn,Nn,In,Mn,Hn,$n,jn,Bn,Fn];function Ee(e){return e?(e.nodeName||"").toLowerCase():null}function de(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function He(e){var t=de(e).Element;return e instanceof t||e instanceof Element}function he(e){var t=de(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function _i(e){if(typeof ShadowRoot>"u")return!1;var t=de(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function as(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var n=t.styles[i]||{},r=t.attributes[i]||{},s=t.elements[i];!he(s)||!Ee(s)||(Object.assign(s.style,n),Object.keys(r).forEach(function(o){var a=r[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function ls(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(n){var r=t.elements[n],s=t.attributes[n]||{},o=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:i[n]),a=o.reduce(function(l,c){return l[c]="",l},{});!he(r)||!Ee(r)||(Object.assign(r.style,a),Object.keys(s).forEach(function(l){r.removeAttribute(l)}))})}}const yi={name:"applyStyles",enabled:!0,phase:"write",fn:as,effect:ls,requires:["computeStyles"]};function ye(e){return e.split("-")[0]}var Ne=Math.max,Ot=Math.min,Ue=Math.round;function hi(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Vn(){return!/^((?!chrome|android).)*safari/i.test(hi())}function Ve(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var n=e.getBoundingClientRect(),r=1,s=1;t&&he(e)&&(r=e.offsetWidth>0&&Ue(n.width)/e.offsetWidth||1,s=e.offsetHeight>0&&Ue(n.height)/e.offsetHeight||1);var o=He(e)?de(e):window,a=o.visualViewport,l=!Vn()&&i,c=(n.left+(l&&a?a.offsetLeft:0))/r,d=(n.top+(l&&a?a.offsetTop:0))/s,h=n.width/r,g=n.height/s;return{width:h,height:g,top:d,right:c+h,bottom:d+g,left:c,x:c,y:d}}function Ei(e){var t=Ve(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function Wn(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&_i(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Te(e){return de(e).getComputedStyle(e)}function cs(e){return["table","td","th"].indexOf(Ee(e))>=0}function Pe(e){return((He(e)?e.ownerDocument:e.document)||window.document).documentElement}function Pt(e){return Ee(e)==="html"?e:e.assignedSlot||e.parentNode||(_i(e)?e.host:null)||Pe(e)}function an(e){return!he(e)||Te(e).position==="fixed"?null:e.offsetParent}function hs(e){var t=/firefox/i.test(hi()),i=/Trident/i.test(hi());if(i&&he(e)){var n=Te(e);if(n.position==="fixed")return null}var r=Pt(e);for(_i(r)&&(r=r.host);he(r)&&["html","body"].indexOf(Ee(r))<0;){var s=Te(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function ct(e){for(var t=de(e),i=an(e);i&&cs(i)&&Te(i).position==="static";)i=an(i);return i&&(Ee(i)==="html"||Ee(i)==="body"&&Te(i).position==="static")?t:i||hs(e)||t}function Ai(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function st(e,t,i){return Ne(e,Ot(t,i))}function ds(e,t,i){var n=st(e,t,i);return n>i?i:n}function qn(){return{top:0,right:0,bottom:0,left:0}}function Kn(e){return Object.assign({},qn(),e)}function Jn(e,t){return t.reduce(function(i,n){return i[n]=e,i},{})}var us=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,Kn(typeof t!="number"?t:Jn(t,Ke))};function fs(e){var t,i=e.state,n=e.name,r=e.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,a=ye(i.placement),l=Ai(a),c=[ie,ce].indexOf(a)>=0,d=c?"height":"width";if(!(!s||!o)){var h=us(r.padding,i),g=Ei(s),u=l==="y"?te:ie,b=l==="y"?le:ce,m=i.rects.reference[d]+i.rects.reference[l]-o[l]-i.rects.popper[d],y=o[l]-i.rects.reference[l],S=ct(s),N=S?l==="y"?S.clientHeight||0:S.clientWidth||0:0,f=m/2-y/2,A=h[u],P=N-g[d]-h[b],E=N/2-g[d]/2+f,C=st(A,E,P),x=l;i.modifiersData[n]=(t={},t[x]=C,t.centerOffset=C-E,t)}}function ps(e){var t=e.state,i=e.options,n=i.element,r=n===void 0?"[data-popper-arrow]":n;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||!Wn(t.elements.popper,r)||(t.elements.arrow=r))}const Xn={name:"arrow",enabled:!0,phase:"main",fn:fs,effect:ps,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function We(e){return e.split("-")[1]}var gs={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ms(e){var t=e.x,i=e.y,n=window,r=n.devicePixelRatio||1;return{x:Ue(t*r)/r||0,y:Ue(i*r)/r||0}}function ln(e){var t,i=e.popper,n=e.popperRect,r=e.placement,s=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,h=e.isFixed,g=o.x,u=g===void 0?0:g,b=o.y,m=b===void 0?0:b,y=typeof d=="function"?d({x:u,y:m}):{x:u,y:m};u=y.x,m=y.y;var S=o.hasOwnProperty("x"),N=o.hasOwnProperty("y"),f=ie,A=te,P=window;if(c){var E=ct(i),C="clientHeight",x="clientWidth";if(E===de(i)&&(E=Pe(i),Te(E).position!=="static"&&a==="absolute"&&(C="scrollHeight",x="scrollWidth")),E=E,r===te||(r===ie||r===ce)&&s===Fe){A=le;var k=h&&E===P&&P.visualViewport?P.visualViewport.height:E[C];m-=k-n.height,m*=l?1:-1}if(r===ie||(r===te||r===le)&&s===Fe){f=ce;var I=h&&E===P&&P.visualViewport?P.visualViewport.width:E[x];u-=I-n.width,u*=l?1:-1}}var H=Object.assign({position:a},c&&gs),p=d===!0?ms({x:u,y:m}):{x:u,y:m};if(u=p.x,m=p.y,l){var O;return Object.assign({},H,(O={},O[A]=N?"0":"",O[f]=S?"0":"",O.transform=(P.devicePixelRatio||1)<=1?"translate("+u+"px, "+m+"px)":"translate3d("+u+"px, "+m+"px, 0)",O))}return Object.assign({},H,(t={},t[A]=N?m+"px":"",t[f]=S?u+"px":"",t.transform="",t))}function vs(e){var t=e.state,i=e.options,n=i.gpuAcceleration,r=n===void 0?!0:n,s=i.adaptive,o=s===void 0?!0:s,a=i.roundOffsets,l=a===void 0?!0:a,c={placement:ye(t.placement),variation:We(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,ln(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ln(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const wi={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:vs,data:{}};var Ct={passive:!0};function bs(e){var t=e.state,i=e.instance,n=e.options,r=n.scroll,s=r===void 0?!0:r,o=n.resize,a=o===void 0?!0:o,l=de(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",i.update,Ct)}),a&&l.addEventListener("resize",i.update,Ct),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",i.update,Ct)}),a&&l.removeEventListener("resize",i.update,Ct)}}const Ci={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:bs,data:{}};var _s={left:"right",right:"left",bottom:"top",top:"bottom"};function St(e){return e.replace(/left|right|bottom|top/g,function(t){return _s[t]})}var ys={start:"end",end:"start"};function cn(e){return e.replace(/start|end/g,function(t){return ys[t]})}function Ti(e){var t=de(e),i=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:i,scrollTop:n}}function Si(e){return Ve(Pe(e)).left+Ti(e).scrollLeft}function Es(e,t){var i=de(e),n=Pe(e),r=i.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;var c=Vn();(c||!c&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:o,x:a+Si(e),y:l}}function As(e){var t,i=Pe(e),n=Ti(e),r=(t=e.ownerDocument)==null?void 0:t.body,s=Ne(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Ne(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+Si(e),l=-n.scrollTop;return Te(r||i).direction==="rtl"&&(a+=Ne(i.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function ki(e){var t=Te(e),i=t.overflow,n=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function zn(e){return["html","body","#document"].indexOf(Ee(e))>=0?e.ownerDocument.body:he(e)&&ki(e)?e:zn(Pt(e))}function ot(e,t){var i;t===void 0&&(t=[]);var n=zn(e),r=n===((i=e.ownerDocument)==null?void 0:i.body),s=de(n),o=r?[s].concat(s.visualViewport||[],ki(n)?n:[]):n,a=t.concat(o);return r?a:a.concat(ot(Pt(o)))}function di(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ws(e,t){var i=Ve(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function hn(e,t,i){return t===vi?di(Es(e,i)):He(t)?ws(t,i):di(As(Pe(e)))}function Cs(e){var t=ot(Pt(e)),i=["absolute","fixed"].indexOf(Te(e).position)>=0,n=i&&he(e)?ct(e):e;return He(n)?t.filter(function(r){return He(r)&&Wn(r,n)&&Ee(r)!=="body"}):[]}function Ts(e,t,i,n){var r=t==="clippingParents"?Cs(e):[].concat(t),s=[].concat(r,[i]),o=s[0],a=s.reduce(function(l,c){var d=hn(e,c,n);return l.top=Ne(d.top,l.top),l.right=Ot(d.right,l.right),l.bottom=Ot(d.bottom,l.bottom),l.left=Ne(d.left,l.left),l},hn(e,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Yn(e){var t=e.reference,i=e.element,n=e.placement,r=n?ye(n):null,s=n?We(n):null,o=t.x+t.width/2-i.width/2,a=t.y+t.height/2-i.height/2,l;switch(r){case te:l={x:o,y:t.y-i.height};break;case le:l={x:o,y:t.y+t.height};break;case ce:l={x:t.x+t.width,y:a};break;case ie:l={x:t.x-i.width,y:a};break;default:l={x:t.x,y:t.y}}var c=r?Ai(r):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case Me:l[c]=l[c]-(t[d]/2-i[d]/2);break;case Fe:l[c]=l[c]+(t[d]/2-i[d]/2);break}}return l}function qe(e,t){t===void 0&&(t={});var i=t,n=i.placement,r=n===void 0?e.placement:n,s=i.strategy,o=s===void 0?e.strategy:s,a=i.boundary,l=a===void 0?Pn:a,c=i.rootBoundary,d=c===void 0?vi:c,h=i.elementContext,g=h===void 0?$e:h,u=i.altBoundary,b=u===void 0?!1:u,m=i.padding,y=m===void 0?0:m,S=Kn(typeof y!="number"?y:Jn(y,Ke)),N=g===$e?xn:$e,f=e.rects.popper,A=e.elements[b?N:g],P=Ts(He(A)?A:A.contextElement||Pe(e.elements.popper),l,d,o),E=Ve(e.elements.reference),C=Yn({reference:E,element:f,strategy:"absolute",placement:r}),x=di(Object.assign({},f,C)),k=g===$e?x:E,I={top:P.top-k.top+S.top,bottom:k.bottom-P.bottom+S.bottom,left:P.left-k.left+S.left,right:k.right-P.right+S.right},H=e.modifiersData.offset;if(g===$e&&H){var p=H[r];Object.keys(I).forEach(function(O){var R=[ce,le].indexOf(O)>=0?1:-1,T=[te,le].indexOf(O)>=0?"y":"x";I[O]+=p[T]*R})}return I}function Ss(e,t){t===void 0&&(t={});var i=t,n=i.placement,r=i.boundary,s=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?bi:l,d=We(n),h=d?a?ci:ci.filter(function(b){return We(b)===d}):Ke,g=h.filter(function(b){return c.indexOf(b)>=0});g.length===0&&(g=h);var u=g.reduce(function(b,m){return b[m]=qe(e,{placement:m,boundary:r,rootBoundary:s,padding:o})[ye(m)],b},{});return Object.keys(u).sort(function(b,m){return u[b]-u[m]})}function ks(e){if(ye(e)===Lt)return[];var t=St(e);return[cn(e),t,cn(t)]}function Os(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var r=i.mainAxis,s=r===void 0?!0:r,o=i.altAxis,a=o===void 0?!0:o,l=i.fallbackPlacements,c=i.padding,d=i.boundary,h=i.rootBoundary,g=i.altBoundary,u=i.flipVariations,b=u===void 0?!0:u,m=i.allowedAutoPlacements,y=t.options.placement,S=ye(y),N=S===y,f=l||(N||!b?[St(y)]:ks(y)),A=[y].concat(f).reduce(function(ee,U){return ee.concat(ye(U)===Lt?Ss(t,{placement:U,boundary:d,rootBoundary:h,padding:c,flipVariations:b,allowedAutoPlacements:m}):U)},[]),P=t.rects.reference,E=t.rects.popper,C=new Map,x=!0,k=A[0],I=0;I<A.length;I++){var H=A[I],p=ye(H),O=We(H)===Me,R=[te,le].indexOf(p)>=0,T=R?"width":"height",w=qe(t,{placement:H,boundary:d,rootBoundary:h,altBoundary:g,padding:c}),v=R?O?ce:ie:O?le:te;P[T]>E[T]&&(v=St(v));var D=St(v),M=[];if(s&&M.push(w[p]<=0),a&&M.push(w[v]<=0,w[D]<=0),M.every(function(ee){return ee})){k=H,x=!1;break}C.set(H,M)}if(x)for(var F=b?3:1,B=function(U){var K=A.find(function($){var W=C.get($);if(W)return W.slice(0,U).every(function(z){return z})});if(K)return k=K,"break"},J=F;J>0;J--){var V=B(J);if(V==="break")break}t.placement!==k&&(t.modifiersData[n]._skip=!0,t.placement=k,t.reset=!0)}}const Gn={name:"flip",enabled:!0,phase:"main",fn:Os,requiresIfExists:["offset"],data:{_skip:!1}};function dn(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function un(e){return[te,ce,le,ie].some(function(t){return e[t]>=0})}function Ds(e){var t=e.state,i=e.name,n=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,o=qe(t,{elementContext:"reference"}),a=qe(t,{altBoundary:!0}),l=dn(o,n),c=dn(a,r,s),d=un(l),h=un(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const Qn={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ds};function Ls(e,t,i){var n=ye(e),r=[ie,te].indexOf(n)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[ie,ce].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}function Ps(e){var t=e.state,i=e.options,n=e.name,r=i.offset,s=r===void 0?[0,0]:r,o=bi.reduce(function(d,h){return d[h]=Ls(h,t.rects,s),d},{}),a=o[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=o}const Zn={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ps};function xs(e){var t=e.state,i=e.name;t.modifiersData[i]=Yn({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Oi={name:"popperOffsets",enabled:!0,phase:"read",fn:xs,data:{}};function Rs(e){return e==="x"?"y":"x"}function Ns(e){var t=e.state,i=e.options,n=e.name,r=i.mainAxis,s=r===void 0?!0:r,o=i.altAxis,a=o===void 0?!1:o,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,h=i.padding,g=i.tether,u=g===void 0?!0:g,b=i.tetherOffset,m=b===void 0?0:b,y=qe(t,{boundary:l,rootBoundary:c,padding:h,altBoundary:d}),S=ye(t.placement),N=We(t.placement),f=!N,A=Ai(S),P=Rs(A),E=t.modifiersData.popperOffsets,C=t.rects.reference,x=t.rects.popper,k=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,I=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),H=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,p={x:0,y:0};if(!!E){if(s){var O,R=A==="y"?te:ie,T=A==="y"?le:ce,w=A==="y"?"height":"width",v=E[A],D=v+y[R],M=v-y[T],F=u?-x[w]/2:0,B=N===Me?C[w]:x[w],J=N===Me?-x[w]:-C[w],V=t.elements.arrow,ee=u&&V?Ei(V):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:qn(),K=U[R],$=U[T],W=st(0,C[w],ee[w]),z=f?C[w]/2-F-W-K-I.mainAxis:B-W-K-I.mainAxis,Ae=f?-C[w]/2+F+W+$+I.mainAxis:J+W+$+I.mainAxis,Je=t.elements.arrow&&ct(t.elements.arrow),Nt=Je?A==="y"?Je.clientTop||0:Je.clientLeft||0:0,ht=(O=H?.[A])!=null?O:0,It=v+z-ht-Nt,Mt=v+Ae-ht,dt=st(u?Ot(D,It):D,v,u?Ne(M,Mt):M);E[A]=dt,p[A]=dt-v}if(a){var ne,X=A==="x"?te:ie,L=A==="x"?le:ce,j=E[P],q=P==="y"?"height":"width",Y=j+y[X],Se=j-y[L],ue=[te,ie].indexOf(S)!==-1,Xe=(ne=H?.[P])!=null?ne:0,Di=ue?Y:j-C[q]-x[q]-Xe+I.altAxis,Li=ue?j+C[q]+x[q]-Xe-I.altAxis:Se,Pi=u&&ue?ds(Di,j,Li):st(u?Di:Y,j,u?Li:Se);E[P]=Pi,p[P]=Pi-j}t.modifiersData[n]=p}}const er={name:"preventOverflow",enabled:!0,phase:"main",fn:Ns,requiresIfExists:["offset"]};function Is(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ms(e){return e===de(e)||!he(e)?Ti(e):Is(e)}function Hs(e){var t=e.getBoundingClientRect(),i=Ue(t.width)/e.offsetWidth||1,n=Ue(t.height)/e.offsetHeight||1;return i!==1||n!==1}function $s(e,t,i){i===void 0&&(i=!1);var n=he(t),r=he(t)&&Hs(t),s=Pe(t),o=Ve(e,r,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&((Ee(t)!=="body"||ki(s))&&(a=Ms(t)),he(t)?(l=Ve(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=Si(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function js(e){var t=new Map,i=new Set,n=[];e.forEach(function(s){t.set(s.name,s)});function r(s){i.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!i.has(a)){var l=t.get(a);l&&r(l)}}),n.push(s)}return e.forEach(function(s){i.has(s.name)||r(s)}),n}function Bs(e){var t=js(e);return Un.reduce(function(i,n){return i.concat(t.filter(function(r){return r.phase===n}))},[])}function Fs(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function Us(e){var t=e.reduce(function(i,n){var r=i[n.name];return i[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,i},{});return Object.keys(t).map(function(i){return t[i]})}var fn={placement:"bottom",modifiers:[],strategy:"absolute"};function pn(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function xt(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,n=i===void 0?[]:i,r=t.defaultOptions,s=r===void 0?fn:r;return function(a,l,c){c===void 0&&(c=s);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},fn,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},h=[],g=!1,u={state:d,setOptions:function(S){var N=typeof S=="function"?S(d.options):S;m(),d.options=Object.assign({},s,d.options,N),d.scrollParents={reference:He(a)?ot(a):a.contextElement?ot(a.contextElement):[],popper:ot(l)};var f=Bs(Us([].concat(n,d.options.modifiers)));return d.orderedModifiers=f.filter(function(A){return A.enabled}),b(),u.update()},forceUpdate:function(){if(!g){var S=d.elements,N=S.reference,f=S.popper;if(!!pn(N,f)){d.rects={reference:$s(N,ct(f),d.options.strategy==="fixed"),popper:Ei(f)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(I){return d.modifiersData[I.name]=Object.assign({},I.data)});for(var A=0;A<d.orderedModifiers.length;A++){if(d.reset===!0){d.reset=!1,A=-1;continue}var P=d.orderedModifiers[A],E=P.fn,C=P.options,x=C===void 0?{}:C,k=P.name;typeof E=="function"&&(d=E({state:d,options:x,name:k,instance:u})||d)}}}},update:Fs(function(){return new Promise(function(y){u.forceUpdate(),y(d)})}),destroy:function(){m(),g=!0}};if(!pn(a,l))return u;u.setOptions(c).then(function(y){!g&&c.onFirstUpdate&&c.onFirstUpdate(y)});function b(){d.orderedModifiers.forEach(function(y){var S=y.name,N=y.options,f=N===void 0?{}:N,A=y.effect;if(typeof A=="function"){var P=A({state:d,name:S,instance:u,options:f}),E=function(){};h.push(P||E)}})}function m(){h.forEach(function(y){return y()}),h=[]}return u}}var Vs=xt(),Ws=[Ci,Oi,wi,yi],qs=xt({defaultModifiers:Ws}),Ks=[Ci,Oi,wi,yi,Zn,Gn,er,Xn,Qn],Js=xt({defaultModifiers:Ks});const Xs=Object.freeze(Object.defineProperty({__proto__:null,popperGenerator:xt,detectOverflow:qe,createPopperBase:Vs,createPopper:Js,createPopperLite:qs,top:te,bottom:le,right:ce,left:ie,auto:Lt,basePlacements:Ke,start:Me,end:Fe,clippingParents:Pn,viewport:vi,popper:$e,reference:xn,variationPlacements:ci,placements:bi,beforeRead:Rn,read:Nn,afterRead:In,beforeMain:Mn,main:Hn,afterMain:$n,beforeWrite:jn,write:Bn,afterWrite:Fn,modifierPhases:Un,applyStyles:yi,arrow:Xn,computeStyles:wi,eventListeners:Ci,flip:Gn,hide:Qn,offset:Zn,popperOffsets:Oi,preventOverflow:er},Symbol.toStringTag,{value:"Module"})),zs=hr(Xs);/*!
* Bootstrap dropdown.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/(function(e,t){(function(i,n){e.exports=n(zs,pe(),Le(),gi(),lt(),Dt())})(Z,function(i,n,r,s,o,a){const l=X=>X&&typeof X=="object"&&"default"in X?X:{default:X};function c(X){if(X&&X.__esModule)return X;const L=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(X){for(const j in X)if(j!=="default"){const q=Object.getOwnPropertyDescriptor(X,j);Object.defineProperty(L,j,q.get?q:{enumerable:!0,get:()=>X[j]})}}return L.default=X,Object.freeze(L)}const d=c(i),h=l(r),g=l(s),u=l(o),b=l(a),m="dropdown",S=".bs.dropdown",N=".data-api",f="Escape",A="Tab",P="ArrowUp",E="ArrowDown",C=2,x=`hide${S}`,k=`hidden${S}`,I=`show${S}`,H=`shown${S}`,p=`click${S}${N}`,O=`keydown${S}${N}`,R=`keyup${S}${N}`,T="show",w="dropup",v="dropend",D="dropstart",M="dropup-center",F="dropdown-center",B='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',J=`${B}.${T}`,V=".dropdown-menu",ee=".navbar",U=".navbar-nav",K=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",$=n.isRTL()?"top-end":"top-start",W=n.isRTL()?"top-start":"top-end",z=n.isRTL()?"bottom-end":"bottom-start",Ae=n.isRTL()?"bottom-start":"bottom-end",Je=n.isRTL()?"left-start":"right-start",Nt=n.isRTL()?"right-start":"left-start",ht="top",It="bottom",Mt={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},dt={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class ne extends b.default{constructor(L,j){super(L,j),this._popper=null,this._parent=this._element.parentNode,this._menu=u.default.findOne(V,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Mt}static get DefaultType(){return dt}static get NAME(){return m}toggle(){return this._isShown()?this.hide():this.show()}show(){if(n.isDisabled(this._element)||this._isShown())return;const L={relatedTarget:this._element};if(!h.default.trigger(this._element,I,L).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(U))for(const q of[].concat(...document.body.children))h.default.on(q,"mouseover",n.noop);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(T),this._element.classList.add(T),h.default.trigger(this._element,H,L)}}hide(){if(n.isDisabled(this._element)||!this._isShown())return;const L={relatedTarget:this._element};this._completeHide(L)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(L){if(!h.default.trigger(this._element,x,L).defaultPrevented){if("ontouchstart"in document.documentElement)for(const q of[].concat(...document.body.children))h.default.off(q,"mouseover",n.noop);this._popper&&this._popper.destroy(),this._menu.classList.remove(T),this._element.classList.remove(T),this._element.setAttribute("aria-expanded","false"),g.default.removeDataAttribute(this._menu,"popper"),h.default.trigger(this._element,k,L)}}_getConfig(L){if(L=super._getConfig(L),typeof L.reference=="object"&&!n.isElement(L.reference)&&typeof L.reference.getBoundingClientRect!="function")throw new TypeError(`${m.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return L}_createPopper(){if(typeof d>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let L=this._element;this._config.reference==="parent"?L=this._parent:n.isElement(this._config.reference)?L=n.getElement(this._config.reference):typeof this._config.reference=="object"&&(L=this._config.reference);const j=this._getPopperConfig();this._popper=d.createPopper(L,this._menu,j)}_isShown(){return this._menu.classList.contains(T)}_getPlacement(){const L=this._parent;if(L.classList.contains(v))return Je;if(L.classList.contains(D))return Nt;if(L.classList.contains(M))return ht;if(L.classList.contains(F))return It;const j=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return L.classList.contains(w)?j?W:$:j?Ae:z}_detectNavbar(){return this._element.closest(ee)!==null}_getOffset(){const{offset:L}=this._config;return typeof L=="string"?L.split(",").map(j=>Number.parseInt(j,10)):typeof L=="function"?j=>L(j,this._element):L}_getPopperConfig(){const L={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(g.default.setDataAttribute(this._menu,"popper","static"),L.modifiers=[{name:"applyStyles",enabled:!1}]),{...L,...typeof this._config.popperConfig=="function"?this._config.popperConfig(L):this._config.popperConfig}}_selectMenuItem({key:L,target:j}){const q=u.default.find(K,this._menu).filter(Y=>n.isVisible(Y));!q.length||n.getNextActiveElement(q,j,L===E,!q.includes(j)).focus()}static jQueryInterface(L){return this.each(function(){const j=ne.getOrCreateInstance(this,L);if(typeof L=="string"){if(typeof j[L]>"u")throw new TypeError(`No method named "${L}"`);j[L]()}})}static clearMenus(L){if(L.button===C||L.type==="keyup"&&L.key!==A)return;const j=u.default.find(J);for(const q of j){const Y=ne.getInstance(q);if(!Y||Y._config.autoClose===!1)continue;const Se=L.composedPath(),ue=Se.includes(Y._menu);if(Se.includes(Y._element)||Y._config.autoClose==="inside"&&!ue||Y._config.autoClose==="outside"&&ue||Y._menu.contains(L.target)&&(L.type==="keyup"&&L.key===A||/input|select|option|textarea|form/i.test(L.target.tagName)))continue;const Xe={relatedTarget:Y._element};L.type==="click"&&(Xe.clickEvent=L),Y._completeHide(Xe)}}static dataApiKeydownHandler(L){const j=/input|textarea/i.test(L.target.tagName),q=L.key===f,Y=[P,E].includes(L.key);if(!Y&&!q||j&&!q)return;L.preventDefault();const Se=u.default.findOne(B,L.delegateTarget.parentNode),ue=ne.getOrCreateInstance(Se);if(Y){L.stopPropagation(),ue.show(),ue._selectMenuItem(L);return}ue._isShown()&&(L.stopPropagation(),ue.hide(),Se.focus())}}return h.default.on(document,O,B,ne.dataApiKeydownHandler),h.default.on(document,O,V,ne.dataApiKeydownHandler),h.default.on(document,p,ne.clearMenus),h.default.on(document,R,ne.clearMenus),h.default.on(document,p,B,function(X){X.preventDefault(),ne.getOrCreateInstance(this).toggle()}),n.defineJQueryPlugin(ne),ne})})(os);const gn=document.getElementById("navbarSupportedContentToggler"),Qt=document.getElementById("navbarSupportedContent");Qt!=null&&(Qt.addEventListener("show.bs.collapse",()=>{console.log("opening navbar content"),gn.classList.toggle("is-active")}),Qt.addEventListener("hide.bs.collapse",()=>{console.log("closing navbar content"),gn.classList.toggle("is-active")}));let Ys=document.querySelectorAll(".needs-validation");Array.prototype.slice.call(Ys).forEach(function(e){e.addEventListener("submit",function(t){e.checkValidity()||(t.preventDefault(),t.stopPropagation(),e.classList.add("was-validated"))},!1)});const Gs={mounted(){this.el.addEventListener("closed.bs.alert",()=>{this.pushEvent("lv:clear-flash",this.el.dataset)})}};var tr={exports:{}},Zt={exports:{}};/*!
* Bootstrap scrollbar.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var mn;function Qs(){return mn||(mn=1,function(e,t){(function(i,n){e.exports=n(lt(),gi(),pe())})(Z,function(i,n,r){const s=u=>u&&typeof u=="object"&&"default"in u?u:{default:u},o=s(i),a=s(n),l=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",c=".sticky-top",d="padding-right",h="margin-right";class g{constructor(){this._element=document.body}getWidth(){const b=document.documentElement.clientWidth;return Math.abs(window.innerWidth-b)}hide(){const b=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,d,m=>m+b),this._setElementAttributes(l,d,m=>m+b),this._setElementAttributes(c,h,m=>m-b)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,d),this._resetElementAttributes(l,d),this._resetElementAttributes(c,h)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(b,m,y){const S=this.getWidth(),N=f=>{if(f!==this._element&&window.innerWidth>f.clientWidth+S)return;this._saveInitialAttribute(f,m);const A=window.getComputedStyle(f).getPropertyValue(m);f.style.setProperty(m,`${y(Number.parseFloat(A))}px`)};this._applyManipulationCallback(b,N)}_saveInitialAttribute(b,m){const y=b.style.getPropertyValue(m);y&&a.default.setDataAttribute(b,m,y)}_resetElementAttributes(b,m){const y=S=>{const N=a.default.getDataAttribute(S,m);if(N===null){S.style.removeProperty(m);return}a.default.removeDataAttribute(S,m),S.style.setProperty(m,N)};this._applyManipulationCallback(b,y)}_applyManipulationCallback(b,m){if(r.isElement(b)){m(b);return}for(const y of o.default.find(b,this._element))m(y)}}return g})}(Zt)),Zt.exports}var ei={exports:{}};/*!
* Bootstrap backdrop.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var vn;function Zs(){return vn||(vn=1,function(e,t){(function(i,n){e.exports=n(Le(),pe(),mi())})(Z,function(i,n,r){const s=m=>m&&typeof m=="object"&&"default"in m?m:{default:m},o=s(i),a=s(r),l="backdrop",c="fade",d="show",h=`mousedown.bs.${l}`,g={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},u={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class b extends a.default{constructor(y){super(),this._config=this._getConfig(y),this._isAppended=!1,this._element=null}static get Default(){return g}static get DefaultType(){return u}static get NAME(){return l}show(y){if(!this._config.isVisible){n.execute(y);return}this._append();const S=this._getElement();this._config.isAnimated&&n.reflow(S),S.classList.add(d),this._emulateAnimation(()=>{n.execute(y)})}hide(y){if(!this._config.isVisible){n.execute(y);return}this._getElement().classList.remove(d),this._emulateAnimation(()=>{this.dispose(),n.execute(y)})}dispose(){!this._isAppended||(o.default.off(this._element,h),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const y=document.createElement("div");y.className=this._config.className,this._config.isAnimated&&y.classList.add(c),this._element=y}return this._element}_configAfterMerge(y){return y.rootElement=n.getElement(y.rootElement),y}_append(){if(this._isAppended)return;const y=this._getElement();this._config.rootElement.append(y),o.default.on(y,h,()=>{n.execute(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(y){n.executeAfterTransition(y,this._getElement(),this._config.isAnimated)}}return b})}(ei)),ei.exports}var ti={exports:{}};/*!
* Bootstrap focustrap.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/var bn;function eo(){return bn||(bn=1,function(e,t){(function(i,n){e.exports=n(Le(),lt(),mi())})(Z,function(i,n,r){const s=A=>A&&typeof A=="object"&&"default"in A?A:{default:A},o=s(i),a=s(n),l=s(r),c="focustrap",h=".bs.focustrap",g=`focusin${h}`,u=`keydown.tab${h}`,b="Tab",m="forward",y="backward",S={autofocus:!0,trapElement:null},N={autofocus:"boolean",trapElement:"element"};class f extends l.default{constructor(P){super(),this._config=this._getConfig(P),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return S}static get DefaultType(){return N}static get NAME(){return c}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),o.default.off(document,h),o.default.on(document,g,P=>this._handleFocusin(P)),o.default.on(document,u,P=>this._handleKeydown(P)),this._isActive=!0)}deactivate(){!this._isActive||(this._isActive=!1,o.default.off(document,h))}_handleFocusin(P){const{trapElement:E}=this._config;if(P.target===document||P.target===E||E.contains(P.target))return;const C=a.default.focusableChildren(E);C.length===0?E.focus():this._lastTabNavDirection===y?C[C.length-1].focus():C[0].focus()}_handleKeydown(P){P.key===b&&(this._lastTabNavDirection=P.shiftKey?y:m)}}return f})}(ti)),ti.exports}/*!
* Bootstrap modal.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/(function(e,t){(function(i,n){e.exports=n(pe(),Le(),lt(),Qs(),Dt(),Zs(),eo(),Dn())})(Z,function(i,n,r,s,o,a,l,c){const d=K=>K&&typeof K=="object"&&"default"in K?K:{default:K},h=d(n),g=d(r),u=d(s),b=d(o),m=d(a),y=d(l),S="modal",f=".bs.modal",A=".data-api",P="Escape",E=`hide${f}`,C=`hidePrevented${f}`,x=`hidden${f}`,k=`show${f}`,I=`shown${f}`,H=`resize${f}`,p=`mousedown.dismiss${f}`,O=`keydown.dismiss${f}`,R=`click${f}${A}`,T="modal-open",w="fade",v="show",D="modal-static",M=".modal.show",F=".modal-dialog",B=".modal-body",J='[data-bs-toggle="modal"]',V={backdrop:!0,focus:!0,keyboard:!0},ee={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class U extends b.default{constructor($,W){super($,W),this._dialog=g.default.findOne(F,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new u.default,this._addEventListeners()}static get Default(){return V}static get DefaultType(){return ee}static get NAME(){return S}toggle($){return this._isShown?this.hide():this.show($)}show($){this._isShown||this._isTransitioning||h.default.trigger(this._element,k,{relatedTarget:$}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(T),this._adjustDialog(),this._backdrop.show(()=>this._showElement($)))}hide(){!this._isShown||this._isTransitioning||h.default.trigger(this._element,E).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(v),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){for(const $ of[window,this._dialog])h.default.off($,f);this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new m.default({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new y.default({trapElement:this._element})}_showElement($){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const W=g.default.findOne(B,this._dialog);W&&(W.scrollTop=0),i.reflow(this._element),this._element.classList.add(v);const z=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,h.default.trigger(this._element,I,{relatedTarget:$})};this._queueCallback(z,this._dialog,this._isAnimated())}_addEventListeners(){h.default.on(this._element,O,$=>{if($.key===P){if(this._config.keyboard){$.preventDefault(),this.hide();return}this._triggerBackdropTransition()}}),h.default.on(window,H,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),h.default.on(this._element,p,$=>{if($.target===$.currentTarget){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(T),this._resetAdjustments(),this._scrollBar.reset(),h.default.trigger(this._element,x)})}_isAnimated(){return this._element.classList.contains(w)}_triggerBackdropTransition(){if(h.default.trigger(this._element,C).defaultPrevented)return;const W=this._element.scrollHeight>document.documentElement.clientHeight,z=this._element.style.overflowY;z==="hidden"||this._element.classList.contains(D)||(W||(this._element.style.overflowY="hidden"),this._element.classList.add(D),this._queueCallback(()=>{this._element.classList.remove(D),this._queueCallback(()=>{this._element.style.overflowY=z},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const $=this._element.scrollHeight>document.documentElement.clientHeight,W=this._scrollBar.getWidth(),z=W>0;if(z&&!$){const Ae=i.isRTL()?"paddingLeft":"paddingRight";this._element.style[Ae]=`${W}px`}if(!z&&$){const Ae=i.isRTL()?"paddingRight":"paddingLeft";this._element.style[Ae]=`${W}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface($,W){return this.each(function(){const z=U.getOrCreateInstance(this,$);if(typeof $=="string"){if(typeof z[$]>"u")throw new TypeError(`No method named "${$}"`);z[$](W)}})}}return h.default.on(document,R,J,function(K){const $=i.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&K.preventDefault(),h.default.one($,k,Ae=>{Ae.defaultPrevented||h.default.one($,x,()=>{i.isVisible(this)&&this.focus()})});const W=g.default.findOne(M);W&&U.getInstance(W).hide(),U.getOrCreateInstance($).toggle(this)}),c.enableDismissTrigger(U),i.defineJQueryPlugin(U),U})})(tr);const to=tr.exports,io={mounted(){const e=new to(this.el);e.show(),this.el.addEventListener("hidden.bs.modal",t=>{this.pushEventTo(`#${this.el.getAttribute("id")}`,"close",{}),e.dispose()}),this.handleEvent("modal-please-hide",t=>{e.hide()})},destroyed(){const e=document.querySelector(".modal-backdrop");e&&e.parentElement.removeChild(e)}},no={mounted(){const e=new ss(this.el,{toggle:!1});this.handleEvent("toggle-template-details",({targetId:t})=>{this.el.id==t&&e.toggle()}),this.el.addEventListener("shown.bs.collapse",t=>{this.pushEvent("collapse-shown",{target_id:t.target.id})}),this.el.addEventListener("hidden.bs.collapse",t=>{this.pushEvent("collapse-hidden",{target_id:t.target.id})})}};let Rt={};Rt.AlertRemover=Gs;Rt.BsModal=io;Rt.BsCollapse=no;let ro=document.querySelector("meta[name='csrf-token']").getAttribute("content"),ir=new ts("/live",cr,{params:{_csrf_token:ro},hooks:Rt});ui.config({barColors:{0:"#29d"},shadowColor:"rgba(0, 0, 0, .3)"});window.addEventListener("phx:page-loading-start",e=>ui.show());window.addEventListener("phx:page-loading-stop",e=>ui.hide());ir.connect();window.liveSocket=ir;