Current section
Files
Jump to
Current section
Files
priv/static/js/app.js
/*! For license information please see app.js.LICENSE.txt */
!function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/js/",n(n.s=10)}([,,function(t,e,n){var i;(function(r,o){"use strict";!function(){for(var t=0,e=["ms","moz","webkit","o"],n=0;n<e.length&&!r.requestAnimationFrame;++n)r.requestAnimationFrame=r[e[n]+"RequestAnimationFrame"],r.cancelAnimationFrame=r[e[n]+"CancelAnimationFrame"]||r[e[n]+"CancelRequestAnimationFrame"];r.requestAnimationFrame||(r.requestAnimationFrame=function(e,n){var i=(new Date).getTime(),o=Math.max(0,16-(i-t)),s=r.setTimeout((function(){e(i+o)}),o);return t=i+o,s}),r.cancelAnimationFrame||(r.cancelAnimationFrame=function(t){clearTimeout(t)})}();var s,a,l,u,h,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=function(){s.width=r.innerWidth,s.height=5*c.barThickness;var t=s.getContext("2d");t.shadowBlur=c.shadowBlur,t.shadowColor=c.shadowColor;var e=t.createLinearGradient(0,0,s.width,0);for(var n in c.barColors)e.addColorStop(n,c.barColors[n]);t.lineWidth=c.barThickness,t.beginPath(),t.moveTo(0,c.barThickness/2),t.lineTo(Math.ceil(u*s.width),c.barThickness/2),t.strokeStyle=e,t.stroke()},f={config:function(t){for(var e in t)c.hasOwnProperty(e)&&(c[e]=t[e])},show:function(){var t,e,n,i;h||(h=!0,null!==l&&r.cancelAnimationFrame(l),s||((i=(s=o.createElement("canvas")).style).position="fixed",i.top=i.left=i.right=i.margin=i.padding=0,i.zIndex=100001,i.display="none",c.className&&s.classList.add(c.className),o.body.appendChild(s),e="resize",n=d,(t=r).addEventListener?t.addEventListener(e,n,!1):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n),s.style.opacity=1,s.style.display="block",f.progress(0),c.autoRun&&function t(){a=r.requestAnimationFrame(t),f.progress("+"+.05*Math.pow(1-Math.sqrt(u),2))}())},progress:function(t){return void 0===t||("string"==typeof t&&(t=(t.indexOf("+")>=0||t.indexOf("-")>=0?u:0)+parseFloat(t)),u=t>1?1:t,d()),u},hide:function(){h&&(h=!1,null!=a&&(r.cancelAnimationFrame(a),a=null),function t(){if(f.progress("+.1")>=1&&(s.style.opacity-=.05,s.style.opacity<=.05))return s.style.display="none",void(l=null);l=r.requestAnimationFrame(t)}())}};"object"==typeof t.exports?t.exports=f:void 0===(i=function(){return f}.call(e,n,e,t))||(t.exports=i)}).call(this,window,document)},,,,,,,,function(t,e,n){t.exports=n(13)},function(t,e,n){},function(t,e,n){"use strict";!function(){var t=function(){if("function"==typeof window.CustomEvent)return window.CustomEvent;function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}return t.prototype=window.Event.prototype,t}();function e(t,e){var n=document.createElement("input");return n.type="hidden",n.name=t,n.value=e,n}function n(t,n){var i=t.getAttribute("data-to"),r=e("_method",t.getAttribute("data-method")),o=e("_csrf_token",t.getAttribute("data-csrf")),s=document.createElement("form"),a=t.getAttribute("target");s.method="get"===t.getAttribute("data-method")?"get":"post",s.action=i,s.style.display="hidden",a?s.target=a:n&&(s.target="_blank"),s.appendChild(o),s.appendChild(r),document.body.appendChild(s),s.submit()}window.addEventListener("click",(function(e){var i=e.target;if(!e.defaultPrevented)for(;i&&i.getAttribute;){var r=new t("phoenix.link.click",{bubbles:!0,cancelable:!0});if(!i.dispatchEvent(r))return e.preventDefault(),e.stopImmediatePropagation(),!1;if(i.getAttribute("data-method"))return n(i,e.metaKey||e.shiftKey),e.preventDefault(),!1;i=i.parentNode}}),!1),window.addEventListener("phoenix.link.click",(function(t){var e=t.target.getAttribute("data-confirm");e&&!window.confirm(e)&&t.preventDefault()}),!1)}()},function(t,e,n){"use strict";n.r(e);n(11),n(12);var i=t=>{if("function"==typeof t)return t;return function(){return t}},r="undefined"!=typeof self?self:null,o="undefined"!=typeof window?window:null,s=r||o||void 0,a=0,l=1,u=2,h=3,c="closed",d="errored",f="joined",p="joining",g="leaving",m="phx_close",v="phx_error",y="phx_join",b="phx_reply",w="phx_leave",_="longpoll",k="websocket",C=4,x=class{constructor(t,e,n,i){this.channel=t,this.event=e,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=i,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:t,response:e,_ref:n}){this.recHooks.filter(e=>e.status===t).forEach(t=>t.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},E=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},A=class{static request(t,e,n,i,r,o,a){if(s.XDomainRequest){let n=new s.XDomainRequest;this.xdomainRequest(n,t,e,i,r,o,a)}else{let l=new s.XMLHttpRequest;this.xhrRequest(l,t,e,n,i,r,o,a)}}static xdomainRequest(t,e,n,i,r,o,s){t.timeout=r,t.open(e,n),t.onload=()=>{let e=this.parseJSON(t.responseText);s&&s(e)},o&&(t.ontimeout=o),t.onprogress=()=>{},t.send(i)}static xhrRequest(t,e,n,i,r,o,s,a){t.open(e,n,!0),t.timeout=o,t.setRequestHeader("Content-Type",i),t.onerror=()=>{a&&a(null)},t.onreadystatechange=()=>{if(t.readyState===C&&a){let e=this.parseJSON(t.responseText);a(e)}},s&&(t.ontimeout=s),t.send(r)}static parseJSON(t){if(!t||""===t)return null;try{return JSON.parse(t)}catch(e){return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let n=[];for(var i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let r=e?`${e}[${i}]`:i,o=t[i];"object"==typeof o?n.push(this.serialize(o,r)):n.push(encodeURIComponent(r)+"="+encodeURIComponent(o))}return n.join("&")}static appendParams(t,e){if(0===Object.keys(e).length)return t;let n=t.match(/\?/)?"&":"?";return`${t}${n}${this.serialize(e)}`}},S=class{constructor(t){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=a,this.poll()}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+k),"$1/"+_)}endpointURL(){return A.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(){this.close(),this.readyState=a}ontimeout(){this.onerror("timeout"),this.closeAndRetry()}poll(){this.readyState!==l&&this.readyState!==a||A.request("GET",this.endpointURL(),"application/json",null,this.timeout,this.ontimeout.bind(this),t=>{if(t){var{status:e,token:n,messages:i}=t;this.token=n}else e=0;switch(e){case 200:i.forEach(t=>{setTimeout(()=>{this.onmessage({data:t})},0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=l,this.onopen(),this.poll();break;case 403:this.onerror(),this.close();break;case 0:case 500:this.onerror(),this.closeAndRetry();break;default:throw new Error("unhandled poll status "+e)}})}send(t){A.request("POST",this.endpointURL(),"application/json",t,this.timeout,this.onerror.bind(this,"timeout"),t=>{t&&200===t.status||(this.onerror(t&&t.status),this.closeAndRetry())})}close(t,e){this.readyState=h,this.onclose()}},T={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(n))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[n,i,r,o,s]=JSON.parse(t);return e({join_ref:n,ref:i,topic:r,event:o,payload:s})}},binaryEncode(t){let{join_ref:e,ref:n,event:i,topic:r,payload:o}=t,s=this.META_LENGTH+e.length+n.length+r.length+i.length,a=new ArrayBuffer(this.HEADER_LENGTH+s),l=new DataView(a),u=0;l.setUint8(u++,this.KINDS.push),l.setUint8(u++,e.length),l.setUint8(u++,n.length),l.setUint8(u++,r.length),l.setUint8(u++,i.length),Array.from(e,t=>l.setUint8(u++,t.charCodeAt(0))),Array.from(n,t=>l.setUint8(u++,t.charCodeAt(0))),Array.from(r,t=>l.setUint8(u++,t.charCodeAt(0))),Array.from(i,t=>l.setUint8(u++,t.charCodeAt(0)));var h=new Uint8Array(a.byteLength+o.byteLength);return h.set(new Uint8Array(a),0),h.set(new Uint8Array(o),a.byteLength),h.buffer},binaryDecode(t){let e=new DataView(t),n=e.getUint8(0),i=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(t,e,i);case this.KINDS.reply:return this.decodeReply(t,e,i);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,i)}},decodePush(t,e,n){let i=e.getUint8(1),r=e.getUint8(2),o=e.getUint8(3),s=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(t.slice(s,s+i));s+=i;let l=n.decode(t.slice(s,s+r));s+=r;let u=n.decode(t.slice(s,s+o));return s+=o,{join_ref:a,ref:null,topic:l,event:u,payload:t.slice(s,t.byteLength)}},decodeReply(t,e,n){let i=e.getUint8(1),r=e.getUint8(2),o=e.getUint8(3),s=e.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=n.decode(t.slice(a,a+i));a+=i;let u=n.decode(t.slice(a,a+r));a+=r;let h=n.decode(t.slice(a,a+o));a+=o;let c=n.decode(t.slice(a,a+s));a+=s;let d=t.slice(a,t.byteLength);return{join_ref:l,ref:u,topic:h,event:b,payload:{status:c,response:d}}},decodeBroadcast(t,e,n){let i=e.getUint8(1),r=e.getUint8(2),o=this.HEADER_LENGTH+2,s=n.decode(t.slice(o,o+i));o+=i;let a=n.decode(t.slice(o,o+r));return o+=r,{join_ref:null,ref:null,topic:s,event:a,payload:t.slice(o,t.byteLength)}}},M=n(2),L=n.n(M),D=[1e3,3e3],P=["phx-click-loading","phx-change-loading","phx-submit-loading","phx-keydown-loading","phx-keyup-loading","phx-blur-loading","phx-focus-loading"],N="data-phx-component",R="data-phx-ref",I="data-phx-upload-ref",U="data-phx-parent-id",O="data-phx-root-id",j=["text","textarea","number","email","password","search","tel","url","date","time"],F=["checkbox","radio"],H="data-phx-session",$=`[${H}]`,B="data-phx-static",q={debounce:300,throttle:300},V="d",J="s",z="e",Y="r",W="t",X=(t,e)=>console.error&&console.error(t,e),G=t=>{let e=typeof t;return"number"===e||"string"===e&&/^(0|[1-9]\d*)$/.test(t)};var K,Z=t=>"function"==typeof t?t:function(){return t},Q=t=>JSON.parse(JSON.stringify(t)),tt=(t,e,n)=>{do{if(t.matches(`[${e}]`))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType&&!(n&&n.isSameNode(t)||t.matches($)));return null},et=t=>null!==t&&"object"==typeof t&&!(t instanceof Array),nt=t=>{for(let e in t)return!1;return!0},it=(t,e)=>t&&e(t),rt=function(t,e,n,i){t.forEach(t=>{new class{constructor(t,e,n){this.liveSocket=n,this.entry=t,this.offset=0,this.chunkSize=e,this.chunkTimer=null,this.uploadChannel=n.channel("lvu:"+t.ref,{token:t.metadata()})}error(t){clearTimeout(this.chunkTimer),this.uploadChannel.leave(),this.entry.error(t)}upload(){this.uploadChannel.onError(t=>this.error(t)),this.uploadChannel.join().receive("ok",t=>this.readNextChunk()).receive("error",t=>this.error(t))}isDone(){return this.offset>=this.entry.file.size}readNextChunk(){let t=new window.FileReader,e=this.entry.file.slice(this.offset,this.chunkSize+this.offset);t.onload=t=>{if(null!==t.target.error)return X("Read error: "+t.target.error);this.offset+=t.target.result.byteLength,this.pushChunk(t.target.result)},t.readAsArrayBuffer(e)}pushChunk(t){this.uploadChannel.isJoined()&&this.uploadChannel.push("chunk",t).receive("ok",()=>{this.entry.progress(this.offset/this.entry.file.size*100),this.isDone()||(this.chunkTimer=setTimeout(()=>this.readNextChunk(),this.liveSocket.getLatencySim()||0))})}}(t,n.config.chunk_size,i).upload()})},ot={canPushState:()=>void 0!==history.pushState,dropLocal(t,e,n){return t.removeItem(this.localKey(e,n))},updateLocal(t,e,n,i,r){let o=this.getLocal(t,e,n),s=this.localKey(e,n),a=null===o?i:r(o);return t.setItem(s,JSON.stringify(a)),a},getLocal(t,e,n){return JSON.parse(t.getItem(this.localKey(e,n)))},updateCurrentState(t){this.canPushState()&&history.replaceState(t(history.state||{}),"",window.location.href)},pushState(t,e,n){if(this.canPushState()){if(n!==window.location.href){if("redirect"==e.type&&e.scroll){let t=history.state||{};t.scroll=e.scroll,history.replaceState(t,"",window.location.href)}delete e.scroll,history[t+"State"](e,"",n||null);let i=this.getHashTargetEl(window.location.hash);i?i.scrollIntoView():"redirect"===e.type&&window.scroll(0,0)}}else this.redirect(n)},setCookie(t,e){document.cookie=`${t}=${e}`},getCookie:t=>document.cookie.replace(new RegExp(`(?:(?:^|.*;s*)${t}s*=s*([^;]*).*$)|^.*$`),"$1"),redirect(t,e){e&&ot.setCookie("__phoenix_flash__",e+"; max-age=60000; path=/"),window.location=t},localKey:(t,e)=>`${t}-${e}`,getHashTargetEl(t){let e=t.toString().substring(1);if(""!==e)return document.getElementById(e)||document.querySelector(`a[name="${e}"]`)}},st=ot,at={byId:t=>document.getElementById(t)||X("no id found for "+t),removeClass(t,e){t.classList.remove(e),0===t.classList.length&&t.removeAttribute("class")},all(t,e,n){if(!t)return[];let i=Array.from(t.querySelectorAll(e));return n?i.forEach(n):i},childNodeLength(t){let e=document.createElement("template");return e.innerHTML=t,e.content.childElementCount},isUploadInput:t=>"file"===t.type&&null!==t.getAttribute(I),findUploadInputs(t){return this.all(t,`input[type="file"][${I}]`)},findComponentNodeList(t,e){return this.filterWithinSameLiveView(this.all(t,`[${N}="${e}"]`),t)},isPhxDestroyed:t=>!(!t.id||!at.private(t,"destroyed")),markPhxChildDestroyed(t){this.isPhxChild(t)&&t.setAttribute(H,""),this.putPrivate(t,"destroyed",!0)},findPhxChildrenInFragment(t,e){let n=document.createElement("template");return n.innerHTML=t,this.findPhxChildren(n.content,e)},isIgnored:(t,e)=>"ignore"===(t.getAttribute(e)||t.getAttribute("data-phx-update")),isPhxUpdate:(t,e,n)=>t.getAttribute&&n.indexOf(t.getAttribute(e))>=0,findPhxChildren(t,e){return this.all(t,`${$}[${U}="${e}"]`)},findParentCIDs(t,e){let n=new Set(e);return e.reduce((e,n)=>{let i=`[${N}="${n}"] [${N}]`;return this.filterWithinSameLiveView(this.all(t,i),t).map(t=>parseInt(t.getAttribute(N))).forEach(t=>e.delete(t)),e},n)},filterWithinSameLiveView(t,e){return e.querySelector($)?t.filter(t=>this.withinSameLiveView(t,e)):t},withinSameLiveView(t,e){for(;t=t.parentNode;){if(t.isSameNode(e))return!0;if(null!==t.getAttribute(H))return!1}},private:(t,e)=>t.phxPrivate&&t.phxPrivate[e],deletePrivate(t,e){t.phxPrivate&&delete t.phxPrivate[e]},putPrivate(t,e,n){t.phxPrivate||(t.phxPrivate={}),t.phxPrivate[e]=n},updatePrivate(t,e,n,i){let r=this.private(t,e);void 0===r?this.putPrivate(t,e,i(n)):this.putPrivate(t,e,i(r))},copyPrivates(t,e){e.phxPrivate&&(t.phxPrivate=e.phxPrivate)},putTitle(t){let e=document.querySelector("title"),{prefix:n,suffix:i}=e.dataset;document.title=`${n||""}${t}${i||""}`},debounce(t,e,n,i,r,o,s){let a=t.getAttribute(n),l=t.getAttribute(r);""===a&&(a=i),""===l&&(l=o);let u=a||l;switch(u){case null:return s();case"blur":return void(this.once(t,"debounce-blur")&&t.addEventListener("blur",()=>s()));default:let n=parseInt(u),i=()=>l?this.deletePrivate(t,"throttled"):s(),r=this.incCycle(t,"debounce-trigger",i);if(isNaN(n))return X("invalid throttle/debounce value: "+u);if(l){let i=!1;if("keydown"===e.type){let n=this.private(t,"debounce-prev-key");this.putPrivate(t,"debounce-prev-key",e.key),i=n!==e.key}if(!i&&this.private(t,"throttled"))return!1;s(),this.putPrivate(t,"throttled",!0),setTimeout(()=>this.triggerCycle(t,"debounce-trigger"),n)}else setTimeout(()=>this.triggerCycle(t,"debounce-trigger",r),n);let o=t.form;o&&this.once(o,"bind-debounce")&&o.addEventListener("submit",()=>{Array.from(new FormData(o).entries(),([t])=>{let e=o.querySelector(`[name="${t}"]`);this.incCycle(e,"debounce-trigger"),this.deletePrivate(e,"throttled")})}),this.once(t,"bind-debounce")&&t.addEventListener("blur",()=>this.triggerCycle(t,"debounce-trigger"))}},triggerCycle(t,e,n){let[i,r]=this.private(t,e);n||(n=i),n===i&&(this.incCycle(t,e),r())},once(t,e){return!0!==this.private(t,e)&&(this.putPrivate(t,e,!0),!0)},incCycle(t,e,n=function(){}){let[i]=this.private(t,e)||[0,n];return i++,this.putPrivate(t,e,[i,n]),i},discardError(t,e,n){let i=e.getAttribute&&e.getAttribute(n),r=i&&t.querySelector(`[id="${i}"], [name="${i}"]`);r&&(this.private(r,"phx-has-focused")||this.private(r.form,"phx-has-submitted")||e.classList.add("phx-no-feedback"))},showError(t,e){(t.id||t.name)&&this.all(t.form,`[${e}="${t.id}"], [${e}="${t.name}"]`,t=>{this.removeClass(t,"phx-no-feedback")})},isPhxChild:t=>t.getAttribute&&t.getAttribute(U),firstPhxChild(t){return this.isPhxChild(t)?t:this.all(t,`[${U}]`)[0]},dispatchEvent(t,e,n={}){let i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t.dispatchEvent(i)},cloneNode(t,e){if(void 0===e)return t.cloneNode(!0);{let n=t.cloneNode(!1);return n.innerHTML=e,n}},mergeAttrs(t,e,n={}){let i=n.exclude||[],r=n.isIgnored,o=e.attributes;for(let n=o.length-1;n>=0;n--){let r=o[n].name;i.indexOf(r)<0&&t.setAttribute(r,e.getAttribute(r))}let s=t.attributes;for(let n=s.length-1;n>=0;n--){let i=s[n].name;r?i.startsWith("data-")&&!e.hasAttribute(i)&&t.removeAttribute(i):e.hasAttribute(i)||t.removeAttribute(i)}},mergeFocusedInput(t,e){t instanceof HTMLSelectElement||at.mergeAttrs(t,e,{except:["value"]}),e.readOnly?t.setAttribute("readonly",!0):t.removeAttribute("readonly")},hasSelectionRange:t=>t.setSelectionRange&&("text"===t.type||"textarea"===t.type),restoreFocus(t,e,n){if(!at.isTextualInput(t))return;let i=t.matches(":focus");t.readOnly&&t.blur(),i||t.focus(),this.hasSelectionRange(t)&&t.setSelectionRange(e,n)},isFormInput:t=>/^(?:input|select|textarea)$/i.test(t.tagName)&&"button"!==t.type,syncAttrsToProps(t){t instanceof HTMLInputElement&&F.indexOf(t.type.toLocaleLowerCase())>=0&&(t.checked=null!==t.getAttribute("checked"))},isTextualInput:t=>j.indexOf(t.type)>=0,isNowTriggerFormExternal:(t,e)=>t.getAttribute&&null!==t.getAttribute(e),syncPendingRef(t,e,n){let i=t.getAttribute(R);return null===i||(at.isFormInput(t)||null!==t.getAttribute(n)?(at.isUploadInput(t)&&at.mergeAttrs(t,e,{isIgnored:!0}),at.putPrivate(t,R,e),!1):(P.forEach(n=>{t.classList.contains(n)&&e.classList.add(n)}),e.setAttribute(R,i),!0))},cleanChildNodes(t,e){if(at.isPhxUpdate(t,e,["append","prepend"])){let e=[];t.childNodes.forEach(t=>{if(!t.id){t.nodeType===Node.TEXT_NODE&&""===t.nodeValue.trim()||X(`only HTML element tags with an id are allowed inside containers with phx-update.\n\nremoving illegal node: "${(t.outerHTML||t.nodeValue).trim()}"\n\n`),e.push(t)}}),e.forEach(t=>t.remove())}},replaceRootContainer(t,e,n){let i=new Set(["id",H,B,"data-phx-main",O]);if(t.tagName.toLowerCase()===e.toLowerCase())return Array.from(t.attributes).filter(t=>!i.has(t.name.toLowerCase())).forEach(e=>t.removeAttribute(e.name)),Object.keys(n).filter(t=>!i.has(t.toLowerCase())).forEach(e=>t.setAttribute(e,n[e])),t;{let r=document.createElement(e);return Object.keys(n).forEach(t=>r.setAttribute(t,n[t])),i.forEach(e=>r.setAttribute(e,t.getAttribute(e))),r.innerHTML=t.innerHTML,t.replaceWith(r),r}},getSticky(t,e,n){let i=(at.private(t,"sticky")||[]).find(([t])=>e===t);if(i){let[t,e,n]=i;return n}return"function"==typeof n?n():n},deleteSticky(t,e){this.updatePrivate(t,"sticky",[],t=>t.filter(([t,n])=>t!==e))},putSticky(t,e,n){let i=n(t);this.updatePrivate(t,"sticky",[],t=>{let r=t.findIndex(([t])=>e===t);return r>=0?t[r]=[e,n,i]:t.push([e,n,i]),t})},applyStickyOperations(t){let e=at.private(t,"sticky");e&&e.forEach(([e,n,i])=>this.putSticky(t,e,n))}},lt=at,ut=class{static isActive(t,e){let n=void 0===e._phxRef,i=t.getAttribute("data-phx-active-refs").split(",").indexOf(ct.genFileRef(e))>=0;return e.size>0&&(n||i)}static isPreflighted(t,e){return t.getAttribute("data-phx-preflighted-refs").split(",").indexOf(ct.genFileRef(e))>=0&&this.isActive(t,e)}constructor(t,e,n){this.ref=ct.genFileRef(e),this.fileEl=t,this.file=e,this.view=n,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("phx:live-file:updated",this._onElUpdated)}metadata(){return this.meta}progress(t){this._progress=Math.floor(t),this._progress>this._lastProgressSent&&(this._progress>=100?(this._progress=100,this._lastProgressSent=100,this._isDone=!0,this.view.pushFileProgress(this.fileEl,this.ref,100,()=>{ct.untrackFile(this.fileEl,this.file),this._onDone()})):(this._lastProgressSent=this._progress,this.view.pushFileProgress(this.fileEl,this.ref,this._progress)))}cancel(){this._isCancelled=!0,this._isDone=!0,this._onDone()}isDone(){return this._isDone}error(t="failed"){this.view.pushFileProgress(this.fileEl,this.ref,{error:t}),ct.clearFiles(this.fileEl)}onDone(t){this._onDone=()=>{this.fileEl.removeEventListener("phx:live-file:updated",this._onElUpdated),t()}}onElUpdated(){-1===this.fileEl.getAttribute("data-phx-active-refs").split(",").indexOf(this.ref)&&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(t){if(this.meta.uploader){let e=t[this.meta.uploader]||X("no uploader configured for "+this.meta.uploader);return{name:this.meta.uploader,callback:e}}return{name:"channel",callback:rt}}zipPostFlight(t){this.meta=t.entries[this.ref],this.meta||X("no preflight upload response returned with ref "+this.ref,{input:this.fileEl,response:t})}},ht=0,ct=class{static genFileRef(t){let e=t._phxRef;return void 0!==e?e:(t._phxRef=(ht++).toString(),t._phxRef)}static getEntryDataURL(t,e,n){let i=this.activeFiles(t).find(t=>this.genFileRef(t)===e);n(URL.createObjectURL(i))}static hasUploadsInProgress(t){let e=0;return lt.findUploadInputs(t).forEach(t=>{t.getAttribute("data-phx-preflighted-refs")!==t.getAttribute("data-phx-done-refs")&&e++}),e>0}static serializeUploads(t){let e=this.activeFiles(t),n={};return e.forEach(e=>{let i={path:t.name},r=t.getAttribute(I);n[r]=n[r]||[],i.ref=this.genFileRef(e),i.name=e.name||i.ref,i.type=e.type,i.size=e.size,n[r].push(i)}),n}static clearFiles(t){t.value=null,t.removeAttribute(I),lt.putPrivate(t,"files",[])}static untrackFile(t,e){lt.putPrivate(t,"files",lt.private(t,"files").filter(t=>!Object.is(t,e)))}static trackFiles(t,e){if(null!==t.getAttribute("multiple")){let n=e.filter(e=>!this.activeFiles(t).find(t=>Object.is(t,e)));lt.putPrivate(t,"files",this.activeFiles(t).concat(n)),t.value=null}else lt.putPrivate(t,"files",e)}static activeFileInputs(t){let e=lt.findUploadInputs(t);return Array.from(e).filter(t=>t.files&&this.activeFiles(t).length>0)}static activeFiles(t){return(lt.private(t,"files")||[]).filter(e=>ut.isActive(t,e))}static inputsAwaitingPreflight(t){let e=lt.findUploadInputs(t);return Array.from(e).filter(t=>this.filesAwaitingPreflight(t).length>0)}static filesAwaitingPreflight(t){return this.activeFiles(t).filter(e=>!ut.isPreflighted(t,e))}constructor(t,e,n){this.view=e,this.onComplete=n,this._entries=Array.from(ct.filesAwaitingPreflight(t)||[]).map(n=>new ut(t,n,e)),this.numEntriesInProgress=this._entries.length}entries(){return this._entries}initAdapterUpload(t,e,n){this._entries=this._entries.map(e=>(e.zipPostFlight(t),e.onDone(()=>{this.numEntriesInProgress--,0===this.numEntriesInProgress&&this.onComplete()}),e));let i=this._entries.reduce((t,e)=>{let{name:i,callback:r}=e.uploader(n.uploaders);return t[i]=t[i]||{callback:r,entries:[]},t[i].entries.push(e),t},{});for(let r in i){let{callback:o,entries:s}=i[r];o(s,e,t,n)}}},dt={LiveFileUpload:{activeRefs(){return this.el.getAttribute("data-phx-active-refs")},preflightedRefs(){return this.el.getAttribute("data-phx-preflighted-refs")},mounted(){this.preflightedWas=this.preflightedRefs()},updated(){let t=this.preflightedRefs();this.preflightedWas!==t&&(this.preflightedWas=t,""===t&&this.__view.cancelSubmit(this.el.form)),""===this.activeRefs()&&(this.el.value=null),this.el.dispatchEvent(new CustomEvent("phx:live-file:updated"))}},LiveImgPreview:{mounted(){this.ref=this.el.getAttribute("data-phx-entry-ref"),this.inputEl=document.getElementById(this.el.getAttribute(I)),ct.getEntryDataURL(this.inputEl,this.ref,t=>{this.url=t,this.el.src=t})},destroyed(){URL.revokeObjectURL(this.url)}}};var ft="undefined"==typeof document?void 0:document,pt=!!ft&&"content"in ft.createElement("template"),gt=!!ft&&ft.createRange&&"createContextualFragment"in ft.createRange();function mt(t){return t=t.trim(),pt?function(t){var e=ft.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}(t):gt?function(t){return K||(K=ft.createRange()).selectNode(ft.body),K.createContextualFragment(t).childNodes[0]}(t):function(t){var e=ft.createElement("body");return e.innerHTML=t,e.childNodes[0]}(t)}function vt(t,e){var n,i,r=t.nodeName,o=e.nodeName;return r===o||(n=r.charCodeAt(0),i=o.charCodeAt(0),n<=90&&i>=97?r===o.toUpperCase():i<=90&&n>=97&&o===r.toUpperCase())}function yt(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n))}var bt={OPTION:function(t,e){var n=t.parentNode;if(n){var i=n.nodeName.toUpperCase();"OPTGROUP"===i&&(i=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==i||n.hasAttribute("multiple")||(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),n.selectedIndex=-1)}yt(t,e,"selected")},INPUT:function(t,e){yt(t,e,"checked"),yt(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;t.value!==n&&(t.value=n);var i=t.firstChild;if(i){var r=i.nodeValue;if(r==n||!n&&r==t.placeholder)return;i.nodeValue=n}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var n,i,r=-1,o=0,s=t.firstChild;s;)if("OPTGROUP"===(i=s.nodeName&&s.nodeName.toUpperCase()))s=(n=s).firstChild;else{if("OPTION"===i){if(s.hasAttribute("selected")){r=o;break}o++}!(s=s.nextSibling)&&n&&(s=n.nextSibling,n=null)}t.selectedIndex=r}}};function wt(){}function _t(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}var kt,Ct=(kt=function(t,e){var n,i,r,o,s=e.attributes;if(11!==e.nodeType&&11!==t.nodeType){for(var a=s.length-1;a>=0;a--)i=(n=s[a]).name,r=n.namespaceURI,o=n.value,r?(i=n.localName||i,t.getAttributeNS(r,i)!==o&&("xmlns"===n.prefix&&(i=n.name),t.setAttributeNS(r,i,o))):t.getAttribute(i)!==o&&t.setAttribute(i,o);for(var l=t.attributes,u=l.length-1;u>=0;u--)i=(n=l[u]).name,(r=n.namespaceURI)?(i=n.localName||i,e.hasAttributeNS(r,i)||t.removeAttributeNS(r,i)):e.hasAttribute(i)||t.removeAttribute(i)}},function(t,e,n){if(n||(n={}),"string"==typeof e)if("#document"===t.nodeName||"HTML"===t.nodeName||"BODY"===t.nodeName){var i=e;(e=ft.createElement("html")).innerHTML=i}else e=mt(e);var r=n.getNodeKey||_t,o=n.onBeforeNodeAdded||wt,s=n.onNodeAdded||wt,a=n.onBeforeElUpdated||wt,l=n.onElUpdated||wt,u=n.onBeforeNodeDiscarded||wt,h=n.onNodeDiscarded||wt,c=n.onBeforeElChildrenUpdated||wt,d=!0===n.childrenOnly,f=Object.create(null),p=[];function g(t){p.push(t)}function m(t,e,n){!1!==u(t)&&(e&&e.removeChild(t),h(t),function t(e,n){if(1===e.nodeType)for(var i=e.firstChild;i;){var o=void 0;n&&(o=r(i))?g(o):(h(i),i.firstChild&&t(i,n)),i=i.nextSibling}}(t,n))}function v(t){s(t);for(var e=t.firstChild;e;){var n=e.nextSibling,i=r(e);if(i){var o=f[i];o&&vt(e,o)?(e.parentNode.replaceChild(o,e),y(o,e)):v(e)}else v(e);e=n}}function y(t,e,n){var i=r(e);if(i&&delete f[i],!n){if(!1===a(t,e))return;if(kt(t,e),l(t),!1===c(t,e))return}"TEXTAREA"!==t.nodeName?function(t,e){var n,i,s,a,l,u=e.firstChild,h=t.firstChild;t:for(;u;){for(a=u.nextSibling,n=r(u);h;){if(s=h.nextSibling,u.isSameNode&&u.isSameNode(h)){u=a,h=s;continue t}i=r(h);var c=h.nodeType,d=void 0;if(c===u.nodeType&&(1===c?(n?n!==i&&((l=f[n])?s===l?d=!1:(t.insertBefore(l,h),i?g(i):m(h,t,!0),h=l):d=!1):i&&(d=!1),(d=!1!==d&&vt(h,u))&&y(h,u)):3!==c&&8!=c||(d=!0,h.nodeValue!==u.nodeValue&&(h.nodeValue=u.nodeValue))),d){u=a,h=s;continue t}i?g(i):m(h,t,!0),h=s}if(n&&(l=f[n])&&vt(l,u))t.appendChild(l),y(l,u);else{var p=o(u);!1!==p&&(p&&(u=p),u.actualize&&(u=u.actualize(t.ownerDocument||ft)),t.appendChild(u),v(u))}u=a,h=s}!function(t,e,n){for(;e;){var i=e.nextSibling;(n=r(e))?g(n):m(e,t,!0),e=i}}(t,h,i);var b=bt[t.nodeName];b&&b(t,e)}(t,e):bt.TEXTAREA(t,e)}!function t(e){if(1===e.nodeType||11===e.nodeType)for(var n=e.firstChild;n;){var i=r(n);i&&(f[i]=n),t(n),n=n.nextSibling}}(t);var b,w,_=t,k=_.nodeType,C=e.nodeType;if(!d)if(1===k)1===C?vt(t,e)||(h(t),_=function(t,e){for(var n=t.firstChild;n;){var i=n.nextSibling;e.appendChild(n),n=i}return e}(t,(b=e.nodeName,(w=e.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==w?ft.createElementNS(w,b):ft.createElement(b)))):_=e;else if(3===k||8===k){if(C===k)return _.nodeValue!==e.nodeValue&&(_.nodeValue=e.nodeValue),_;_=e}if(_===e)h(t);else{if(e.isSameNode&&e.isSameNode(_))return;if(y(_,e,d),p)for(var x=0,E=p.length;x<E;x++){var A=f[p[x]];A&&m(A,A.parentNode,!1)}}return!d&&_!==t&&t.parentNode&&(_.actualize&&(_=_.actualize(t.ownerDocument||ft)),t.parentNode.replaceChild(_,t)),_}),xt=class{static patchEl(t,e,n){Ct(t,e,{childrenOnly:!1,onBeforeElUpdated:(t,e)=>{if(n&&n.isSameNode(t)&<.isFormInput(t))return lt.mergeFocusedInput(t,e),!1}})}constructor(t,e,n,i,r){this.view=t,this.liveSocket=t.liveSocket,this.container=e,this.id=n,this.rootID=t.root.id,this.html=i,this.targetCID=r,this.cidPatch=G(this.targetCID),this.callbacks={beforeadded:[],beforeupdated:[],beforephxChildAdded:[],afteradded:[],afterupdated:[],afterdiscarded:[],afterphxChildAdded:[],aftertransitionsDiscarded:[]}}before(t,e){this.callbacks["before"+t].push(e)}after(t,e){this.callbacks["after"+t].push(e)}trackBefore(t,...e){this.callbacks["before"+t].forEach(t=>t(...e))}trackAfter(t,...e){this.callbacks["after"+t].forEach(t=>t(...e))}markPrunableContentForRemoval(){lt.all(this.container,"[phx-update=append] > *, [phx-update=prepend] > *",t=>{t.setAttribute("data-phx-prune","")})}perform(){let{view:t,liveSocket:e,container:n,html:i}=this,r=this.isCIDPatch()?this.targetCIDContainer(i):n;if(this.isCIDPatch()&&!r)return;let o=e.getActiveElement(),{selectionStart:s,selectionEnd:a}=o&<.hasSelectionRange(o)?o:{},l=e.binding("update"),u=e.binding("feedback-for"),h=e.binding("disable-with"),c=e.binding("trigger-action"),d=e.binding("remove"),f=[],p=[],g=[],m=[],v=null,y=e.time("premorph container prep",()=>this.buildDiffHTML(n,i,l,r));return this.trackBefore("added",n),this.trackBefore("updated",n,n),e.time("morphdom",()=>{Ct(r,y,{childrenOnly:null===r.getAttribute(N),getNodeKey:t=>lt.isPhxDestroyed(t)?null:t.id,onBeforeNodeAdded:t=>(this.trackBefore("added",t),t),onNodeAdded:e=>{e instanceof HTMLImageElement&&e.srcset?e.srcset=e.srcset:e instanceof HTMLVideoElement&&e.autoplay&&e.play(),lt.isNowTriggerFormExternal(e,c)&&(v=e),lt.discardError(r,e,u),lt.isPhxChild(e)&&t.ownsElement(e)&&this.trackAfter("phxChildAdded",e),f.push(e)},onNodeDiscarded:t=>{lt.isPhxChild(t)&&e.destroyViewByEl(t),this.trackAfter("discarded",t)},onBeforeNodeDiscarded:t=>!(!t.getAttribute||null===t.getAttribute("data-phx-prune"))||(null===t.parentNode||!lt.isPhxUpdate(t.parentNode,l,["append","prepend"])||!t.id)&&(t.getAttribute&&t.getAttribute(d)?(m.push(t),!1):!this.skipCIDSibling(t)),onElUpdated:t=>{lt.isNowTriggerFormExternal(t,c)&&(v=t),p.push(t)},onBeforeElUpdated:(t,e)=>{if(lt.cleanChildNodes(e,l),this.skipCIDSibling(e))return!1;if(lt.isIgnored(t,l))return this.trackBefore("updated",t,e),lt.mergeAttrs(t,e,{isIgnored:!0}),p.push(t),lt.applyStickyOperations(t),!1;if("number"===t.type&&t.validity&&t.validity.badInput)return!1;if(!lt.syncPendingRef(t,e,h))return lt.isUploadInput(t)&&(this.trackBefore("updated",t,e),p.push(t)),lt.applyStickyOperations(t),!1;if(lt.isPhxChild(e)){let n=t.getAttribute(H);return lt.mergeAttrs(t,e,{exclude:[B]}),""!==n&&t.setAttribute(H,n),t.setAttribute(O,this.rootID),lt.applyStickyOperations(t),!1}return lt.copyPrivates(e,t),lt.discardError(r,e,u),o&&t.isSameNode(o)&<.isFormInput(t)?(this.trackBefore("updated",t,e),lt.mergeFocusedInput(t,e),lt.syncAttrsToProps(t),p.push(t),lt.applyStickyOperations(t),!1):(lt.isPhxUpdate(e,l,["append","prepend"])&&g.push(new class{constructor(t,e,n){let i=new Set,r=new Set([...e.children].map(t=>t.id)),o=[];Array.from(t.children).forEach(t=>{if(t.id&&(i.add(t.id),r.has(t.id))){let e=t.previousElementSibling&&t.previousElementSibling.id;o.push({elementId:t.id,previousElementId:e})}}),this.containerId=e.id,this.updateType=n,this.elementsToModify=o,this.elementIdsToAdd=[...r].filter(t=>!i.has(t))}perform(){let t=lt.byId(this.containerId);this.elementsToModify.forEach(e=>{e.previousElementId?it(document.getElementById(e.previousElementId),t=>{it(document.getElementById(e.elementId),e=>{e.previousElementSibling&&e.previousElementSibling.id==t.id||t.insertAdjacentElement("afterend",e)})}):it(document.getElementById(e.elementId),e=>{null==e.previousElementSibling||t.insertAdjacentElement("afterbegin",e)})}),"prepend"==this.updateType&&this.elementIdsToAdd.reverse().forEach(e=>{it(document.getElementById(e),e=>t.insertAdjacentElement("afterbegin",e))})}}(t,e,e.getAttribute(l))),lt.syncAttrsToProps(e),lt.applyStickyOperations(e),this.trackBefore("updated",t,e),!0)}})}),e.isDebugEnabled()&&function(){let t=new Set,e=document.querySelectorAll("*[id]");for(let n=0,i=e.length;n<i;n++)t.has(e[n].id)?console.error(`Multiple IDs detected: ${e[n].id}. Ensure unique element ids.`):t.add(e[n].id)}(),g.length>0&&e.time("post-morph append/prepend restoration",()=>{g.forEach(t=>t.perform())}),e.silenceEvents(()=>lt.restoreFocus(o,s,a)),lt.dispatchEvent(document,"phx:update"),f.forEach(t=>this.trackAfter("added",t)),p.forEach(t=>this.trackAfter("updated",t)),m.length>0&&(e.transitionRemoves(m),e.requestDOMUpdate(()=>{m.forEach(t=>{let n=lt.firstPhxChild(t);n&&e.destroyViewByEl(n),t.remove()}),this.trackAfter("transitionsDiscarded",m)})),v&&(e.disconnect(),v.submit()),!0}isCIDPatch(){return this.cidPatch}skipCIDSibling(t){return t.nodeType===Node.ELEMENT_NODE&&null!==t.getAttribute("data-phx-skip")}targetCIDContainer(t){if(!this.isCIDPatch())return;let[e,...n]=lt.findComponentNodeList(this.container,this.targetCID);return 0===n.length&&1===lt.childNodeLength(t)?e:e&&e.parentNode}buildDiffHTML(t,e,n,i){let r=this.isCIDPatch(),o=r&&i.getAttribute(N)===this.targetCID.toString();if(!r||o)return e;{let t=null,n=document.createElement("template");t=lt.cloneNode(i);let[r,...o]=lt.findComponentNodeList(t,this.targetCID);return n.innerHTML=e,o.forEach(t=>t.remove()),Array.from(t.childNodes).forEach(t=>{t.id&&t.nodeType===Node.ELEMENT_NODE&&t.getAttribute(N)!==this.targetCID.toString()&&(t.setAttribute("data-phx-skip",""),t.innerHTML="")}),Array.from(n.content.childNodes).forEach(e=>t.insertBefore(e,r)),r.remove(),t.outerHTML}}},Et=class{static extract(t){let{[Y]:e,[z]:n,[W]:i}=t;return delete t[Y],delete t[z],delete t[W],{diff:t,title:i,reply:e||null,events:n||[]}}constructor(t,e){this.viewId=t,this.rendered={},this.mergeDiff(e)}parentViewId(){return this.viewId}toString(t){return this.recursiveToString(this.rendered,this.rendered.c,t)}recursiveToString(t,e=t.c,n){let i={buffer:"",components:e,onlyCids:n=n?new Set(n):null};return this.toOutputBuffer(t,null,i),i.buffer}componentCIDs(t){return Object.keys(t.c||{}).map(t=>parseInt(t))}isComponentOnlyDiff(t){return!!t.c&&1===Object.keys(t).length}getComponent(t,e){return t.c[e]}mergeDiff(t){let e=t.c,n={};if(delete t.c,this.rendered=this.mutableMerge(this.rendered,t),this.rendered.c=this.rendered.c||{},e){let i=this.rendered.c;for(let t in e)e[t]=this.cachedFindComponent(t,e[t],i,e,n);for(let t in e)i[t]=e[t];t.c=e}}cachedFindComponent(t,e,n,i,r){if(r[t])return r[t];{let o,s,a=e[J];if(G(a)){let t;t=a>0?this.cachedFindComponent(a,i[a],n,i,r):n[-a],s=t[J],o=this.cloneMerge(t,e),o[J]=s}else o=void 0!==e[J]?e:this.cloneMerge(n[t]||{},e);return r[t]=o,o}}mutableMerge(t,e){return void 0!==e[J]?e:(this.doMutableMerge(t,e),t)}doMutableMerge(t,e){for(let n in e){let i=e[n],r=t[n];et(i)&&void 0===i[J]&&et(r)?this.doMutableMerge(r,i):t[n]=i}}cloneMerge(t,e){let n={...t,...e};for(let i in n){let r=e[i],o=t[i];et(r)&&void 0===r[J]&&et(o)&&(n[i]=this.cloneMerge(o,r))}return n}componentToString(t){return this.recursiveCIDToString(this.rendered.c,t)}pruneCIDs(t){t.forEach(t=>delete this.rendered.c[t])}get(){return this.rendered}isNewFingerprint(t={}){return!!t[J]}templateStatic(t,e){return"number"==typeof t?e[t]:t}toOutputBuffer(t,e,n){if(t[V])return this.comprehensionToBuffer(t,e,n);let{[J]:i}=t;i=this.templateStatic(i,e),n.buffer+=i[0];for(let r=1;r<i.length;r++)this.dynamicToBuffer(t[r-1],e,n),n.buffer+=i[r]}comprehensionToBuffer(t,e,n){let{[V]:i,[J]:r}=t;r=this.templateStatic(r,e);let o=t.p;for(let t=0;t<i.length;t++){let e=i[t];n.buffer+=r[0];for(let t=1;t<r.length;t++)this.dynamicToBuffer(e[t-1],o,n),n.buffer+=r[t]}}dynamicToBuffer(t,e,n){"number"==typeof t?n.buffer+=this.recursiveCIDToString(n.components,t,n.onlyCids):et(t)?this.toOutputBuffer(t,e,n):n.buffer+=t}recursiveCIDToString(t,e,n){let i=t[e]||X("no component for CID "+e,t),r=document.createElement("template");r.innerHTML=this.recursiveToString(i,t,n);let o=r.content,s=n&&!n.has(e),[a,l]=Array.from(o.childNodes).reduce(([t,n],i,o)=>i.nodeType===Node.ELEMENT_NODE?i.getAttribute(N)?[t,!0]:(i.setAttribute(N,e),i.id||(i.id=`${this.parentViewId()}-${e}-${o}`),s&&(i.setAttribute("data-phx-skip",""),i.innerHTML=""),[!0,n]):""!==i.nodeValue.trim()?(X(`only HTML element tags are allowed at the root of components.\n\ngot: "${i.nodeValue.trim()}"\n\nwithin:\n`,r.innerHTML.trim()),i.replaceWith(this.createSpan(i.nodeValue,e)),[!0,n]):(i.remove(),[t,n]),[!1,!1]);return a||l?!a&&l?(X("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):r.innerHTML:(X("expected at least one HTML element tag inside a component, but the component is empty:\n",r.innerHTML.trim()),this.createSpan("",e).outerHTML)}createSpan(t,e){let n=document.createElement("span");return n.innerText=t,n.setAttribute(N,e),n}},At=1,St=class{static makeID(){return At++}static elementID(t){return t.phxHookId}constructor(t,e,n){this.__view=t,this.__liveSocket=t.liveSocket,this.__callbacks=n,this.__listeners=new Set,this.__isDisconnected=!1,this.el=e,this.el.phxHookId=this.constructor.makeID();for(let t in this.__callbacks)this[t]=this.__callbacks[t]}__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(t,e={},n=function(){}){return this.__view.pushHookEvent(null,t,e,n)}pushEventTo(t,e,n={},i=function(){}){return this.__view.withinTargets(t,(t,r)=>t.pushHookEvent(r,e,n,i))}handleEvent(t,e){let n=(n,i)=>i?t:e(n.detail);return window.addEventListener("phx:"+t,n),this.__listeners.add(n),n}removeHandleEvent(t){let e=t(null,!0);window.removeEventListener("phx:"+e,t),this.__listeners.delete(t)}upload(t,e){return this.__view.dispatchUploads(t,e)}uploadTo(t,e,n){return this.__view.withinTargets(t,t=>t.dispatchUploads(e,n))}__cleanup__(){this.__listeners.forEach(t=>this.removeHandleEvent(t))}},Tt={exec(t,e,n,i,r){let[o,s]=r||[null,{}];("["===e.charAt(0)?JSON.parse(e):[[o,s]]).forEach(([r,a])=>{r===o&&s.data&&(a.data=Object.assign(a.data||{},s.data)),this["exec_"+r](t,e,n,i,a)})},isVisible(t){let e=window.getComputedStyle(t);return!(0===e.opacity||"none"===e.display)},exec_dispatch(t,e,n,i,{to:r,event:o,detail:s}){r?lt.all(document,r,t=>lt.dispatchEvent(t,o,s)):lt.dispatchEvent(i,o,s)},exec_push(t,e,n,i,r){let{event:o,data:s,target:a,page_loading:l,loading:u,value:h}=r,c={page_loading:!!l,loading:u,value:h},d="change"===t?i.form:i,f=a||d.getAttribute(n.binding("target"))||d;n.withinTargets(f,(n,a)=>{if("change"===t){let{newCid:t,_target:s,callback:l}=r;s&&(c._target=s),n.pushInput(i,a,t,o||e,c,l)}else"submit"===t?n.submitForm(i,a,o||e,c):n.pushEvent(t,i,a,o||e,s,c)})},exec_add_class(t,e,n,i,{to:r,names:o,transition:s,time:a}){r?lt.all(document,r,t=>this.addOrRemoveClasses(t,o,[],s,a,n)):this.addOrRemoveClasses(i,o,[],s,n)},exec_remove_class(t,e,n,i,{to:r,names:o,transition:s,time:a}){r?lt.all(document,r,t=>this.addOrRemoveClasses(t,[],o,s,a,n)):this.addOrRemoveClasses(i,[],o,s,a,n)},exec_transition(t,e,n,i,{time:r,to:o,transition:s}){let a=o?lt.all(document,o):[i],[l,u,h]=s;a.forEach(t=>{n.transition(r,()=>this.addOrRemoveClasses(t,l.concat(u),[]),()=>this.addOrRemoveClasses(t,h,l.concat(u)))})},exec_toggle(t,e,n,i,{to:r,display:o,ins:s,outs:a,time:l}){r?lt.all(document,r,e=>this.toggle(t,n,e,o,s,a,l)):this.toggle(t,n,i,o,s,a,l)},exec_show(t,e,n,i,{to:r,display:o,transition:s,time:a}){r?lt.all(document,r,e=>this.show(t,n,e,o,s,a)):this.show(t,n,i,s,a)},exec_hide(t,e,n,i,{to:r,display:o,transition:s,time:a}){r?lt.all(document,r,e=>this.hide(t,n,e,o,s,a)):this.hide(t,n,i,o,s,a)},show(t,e,n,i,r,o){this.isVisible(n)||this.toggle(t,e,n,i,r,null,o)},hide(t,e,n,i,r,o){this.isVisible(n)&&this.toggle(t,e,n,i,null,r,o)},toggle(t,e,n,i,r,o,s){let[a,l,u]=r||[[],[],[]],[h,c,d]=o||[[],[],[]];if(a.length>0||h.length>0)if(this.isVisible(n)){let t=()=>{this.addOrRemoveClasses(n,c,a.concat(l).concat(u)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(n,h,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(n,d,c))})};e.transition(s,t,()=>{this.addOrRemoveClasses(n,[],h.concat(d)),lt.putSticky(n,"toggle",t=>t.style.display="none")})}else{if("remove"===t)return;let r=()=>{this.addOrRemoveClasses(n,l,h.concat(c).concat(d)),lt.putSticky(n,"toggle",t=>t.style.display=i||"block"),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(n,a,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(n,u,l))})};e.transition(s,r,()=>{this.addOrRemoveClasses(n,[],a.concat(u))})}else{let t=this.isVisible(n)?"none":i||"block";lt.putSticky(n,"toggle",e=>e.style.display=t)}},addOrRemoveClasses(t,e,n,i,r,o){let[s,a,l]=i||[[],[],[]];if(s.length>0){let i=()=>this.addOrRemoveClasses(t,a.concat(s),[]),u=()=>this.addOrRemoveClasses(t,e.concat(l),n.concat(s).concat(a));return o.transition(r,i,u)}window.requestAnimationFrame(()=>{let[i,r]=lt.getSticky(t,"classes",[[],[]]),o=e.filter(e=>i.indexOf(e)<0&&!t.classList.contains(e)),s=n.filter(e=>r.indexOf(e)<0&&t.classList.contains(e)),a=i.filter(t=>n.indexOf(t)<0).concat(o),l=r.filter(t=>e.indexOf(t)<0).concat(s);lt.putSticky(t,"classes",t=>(t.classList.remove(...l),t.classList.add(...a),[a,l]))})},hasAllClasses:(t,e)=>e.every(e=>t.classList.contains(e)),isToggledOut(t,e){return!this.isVisible(t)||this.hasAllClasses(t,e)}},Mt=(t,e={})=>{let n=new FormData(t),i=[];n.forEach((t,e,n)=>{t instanceof File&&i.push(e)}),i.forEach(t=>n.delete(t));let r=new URLSearchParams;for(let[t,e]of n.entries())r.append(t,e);for(let t in e)r.append(t,e[t]);return r.toString()},Lt=class{constructor(t,e,n,i){this.liveSocket=e,this.flash=i,this.parent=n,this.root=n?n.root:this,this.el=t,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(t){t&&t()},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(t){this.href=t}setRedirect(t){this.redirect=!0,this.href=t}isMain(){return this.liveSocket.main===this}connectParams(){let t=this.liveSocket.params(this.el),e=lt.all(document,`[${this.binding("track-static")}]`).map(t=>t.src||t.href).filter(t=>"string"==typeof t);return e.length>0&&(t._track_static=e),t._mounts=this.joinCount,t}isConnected(){return this.channel.canPush()}getSession(){return this.el.getAttribute(H)}getStatic(){let t=this.el.getAttribute(B);return""===t?null:t}destroy(t=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 e=()=>{t();for(let t in this.viewHooks)this.destroyHook(this.viewHooks[t])};lt.markPhxChildDestroyed(this.el),this.log("destroyed",()=>["the child has been removed from the parent"]),this.channel.leave().receive("ok",e).receive("error",e).receive("timeout",e)}setContainerClasses(...t){this.el.classList.remove("phx-connected","phx-loading","phx-error"),this.el.classList.add(...t)}showLoader(t){if(clearTimeout(this.loaderTimer),t)this.loaderTimer=setTimeout(()=>this.showLoader(),t);else{for(let t in this.viewHooks)this.viewHooks[t].__disconnected();this.setContainerClasses("phx-loading")}}hideLoader(){clearTimeout(this.loaderTimer),this.setContainerClasses("phx-connected")}triggerReconnected(){for(let t in this.viewHooks)this.viewHooks[t].__reconnected()}log(t,e){this.liveSocket.log(this,t,e)}transition(t,e,n=function(){}){this.liveSocket.transition(t,e,n)}withinTargets(t,e){if(t instanceof HTMLElement||t instanceof SVGElement)return this.liveSocket.owner(t,n=>e(n,t));if(G(t)){0===lt.findComponentNodeList(this.el,t).length?X("no component found matching phx-target of "+t):e(this,parseInt(t))}else{let n=Array.from(document.querySelectorAll(t));0===n.length&&X(`nothing found matching the phx-target selector "${t}"`),n.forEach(t=>this.liveSocket.owner(t,n=>e(n,t)))}}applyDiff(t,e,n){this.log(t,()=>["",Q(e)]);let{diff:i,reply:r,events:o,title:s}=Et.extract(e);return s&<.putTitle(s),n({diff:i,reply:r,events:o}),r}onJoin(t){let{rendered:e,container:n}=t;if(n){let[t,e]=n;this.el=lt.replaceRootContainer(this.el,t,e)}this.childJoins=0,this.joinPending=!0,this.flash=null,st.dropLocal(this.liveSocket.localStorage,window.location.pathname,"consecutive-reloads"),this.applyDiff("mount",e,({diff:e,events:n})=>{this.rendered=new Et(this.id,e);let i=this.renderContainer(null,"join");this.dropPendingRefs();let r=this.formsForRecovery(i);this.joinCount++,r.length>0?r.forEach(([t,e,o],s)=>{this.pushFormRecovery(t,o,t=>{s===r.length-1&&this.onJoinComplete(t,i,n)})}):this.onJoinComplete(t,i,n)})}dropPendingRefs(){lt.all(this.el,`[${R}]`,t=>t.removeAttribute(R))}onJoinComplete({live_patch:t},e,n){if(this.joinCount>1||this.parent&&!this.parent.isJoinPending())return this.applyJoinPatch(t,e,n);0===lt.findPhxChildrenInFragment(e,this.id).filter(t=>{let e=t.id&&this.el.querySelector(`[id="${t.id}"]`),n=e&&e.getAttribute(B);return n&&t.setAttribute(B,n),this.joinChild(t)}).length?this.parent?(this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(t,e,n)]),this.parent.ackJoin(this)):(this.onAllChildJoinsComplete(),this.applyJoinPatch(t,e,n)):this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(t,e,n)])}attachTrueDocEl(){this.el=lt.byId(this.id),this.el.setAttribute(O,this.root.id)}applyJoinPatch(t,e,n){this.attachTrueDocEl();let i=new xt(this,this.el,this.id,e,null);if(i.markPrunableContentForRemoval(),this.performPatch(i,!1),this.joinNewChildren(),lt.all(this.el,`[${this.binding("hook")}], [data-phx-hook]`,t=>{let e=this.addHook(t);e&&e.__mounted()}),this.joinPending=!1,this.liveSocket.dispatchEvents(n),this.applyPendingUpdates(),t){let{kind:e,to:n}=t;this.liveSocket.historyPatch(n,e)}this.hideLoader(),this.joinCount>1&&this.triggerReconnected(),this.stopCallback()}triggerBeforeUpdateHook(t,e){this.liveSocket.triggerDOM("onBeforeElUpdated",[t,e]);let n=this.getHook(t),i=n&<.isIgnored(t,this.binding("update"));if(n&&!t.isEqualNode(e)&&(!i||(r=t.dataset,o=e.dataset,JSON.stringify(r)!==JSON.stringify(o))))return n.__beforeUpdate(),n;var r,o}performPatch(t,e){let n=[],i=!1,r=new Set;return t.after("added",t=>{this.liveSocket.triggerDOM("onNodeAdded",[t]);let e=this.addHook(t);e&&e.__mounted()}),t.after("phxChildAdded",t=>i=!0),t.before("updated",(t,e)=>{this.triggerBeforeUpdateHook(t,e)&&r.add(t.id)}),t.after("updated",t=>{r.has(t.id)&&this.getHook(t).__updated()}),t.after("discarded",t=>{t.nodeType===Node.ELEMENT_NODE&&n.push(t)}),t.after("transitionsDiscarded",t=>this.afterElementsRemoved(t,e)),t.perform(),this.afterElementsRemoved(n,e),i}afterElementsRemoved(t,e){let n=[];t.forEach(t=>{lt.all(t,`[${N}]`).concat(t).forEach(t=>{let e=this.componentID(t);G(e)&&-1===n.indexOf(e)&&n.push(e);let i=this.getHook(t);i&&this.destroyHook(i)})}),e&&this.maybePushComponentsDestroyed(n)}joinNewChildren(){lt.findPhxChildren(this.el,this.id).forEach(t=>this.joinChild(t))}getChildById(t){return this.root.children[this.id][t]}getDescendentByEl(t){return t.id===this.id?this:this.children[t.getAttribute(U)][t.id]}destroyDescendent(t){for(let e in this.root.children)for(let n in this.root.children[e])if(n===t)return this.root.children[e][n].destroy()}joinChild(t){if(!this.getChildById(t.id)){let e=new Lt(t,this.liveSocket,this);return this.root.children[this.id][e.id]=e,e.join(),this.childJoins++,!0}}isJoinPending(){return this.joinPending}ackJoin(t){this.childJoins--,0===this.childJoins&&(this.parent?this.parent.ackJoin(this):this.onAllChildJoinsComplete())}onAllChildJoinsComplete(){this.joinCallback(()=>{this.pendingJoinOps.forEach(([t,e])=>{t.isDestroyed()||e()}),this.pendingJoinOps=[]})}update(t,e){if(this.isJoinPending()||this.liveSocket.hasPendingLink())return this.pendingDiffs.push({diff:t,events:e});this.rendered.mergeDiff(t);let n=!1;this.rendered.isComponentOnlyDiff(t)?this.liveSocket.time("component patch complete",()=>{lt.findParentCIDs(this.el,this.rendered.componentCIDs(t)).forEach(e=>{this.componentPatch(this.rendered.getComponent(t,e),e)&&(n=!0)})}):nt(t)||this.liveSocket.time("full patch complete",()=>{let e=this.renderContainer(t,"update"),i=new xt(this,this.el,this.id,e,null);n=this.performPatch(i,!0)}),this.liveSocket.dispatchEvents(e),n&&this.joinNewChildren()}renderContainer(t,e){return this.liveSocket.time(`toString diff (${e})`,()=>{let e=this.el.tagName,n=t?this.rendered.componentCIDs(t).concat(this.pruningCIDs):null;return`<${e}>${this.rendered.toString(n)}</${e}>`})}componentPatch(t,e){if(nt(t))return!1;let n=this.rendered.componentToString(e),i=new xt(this,this.el,this.id,n,e);return this.performPatch(i,!0)}getHook(t){return this.viewHooks[St.elementID(t)]}addHook(t){if(St.elementID(t)||!t.getAttribute)return;let e=t.getAttribute("data-phx-hook")||t.getAttribute(this.binding("hook"));if(e&&!this.ownsElement(t))return;let n=this.liveSocket.getHookCallbacks(e);if(n){t.id||X(`no DOM ID for hook "${e}". Hooks require a unique ID on each element.`,t);let i=new St(this,t,n);return this.viewHooks[St.elementID(i.el)]=i,i}null!==e&&X(`unknown hook found for "${e}"`,t)}destroyHook(t){t.__destroyed(),t.__cleanup__(),delete this.viewHooks[St.elementID(t.el)]}applyPendingUpdates(){this.pendingDiffs.forEach(({diff:t,events:e})=>this.update(t,e)),this.pendingDiffs=[]}onChannel(t,e){this.liveSocket.onChannel(this.channel,t,t=>{this.isJoinPending()?this.root.pendingJoinOps.push([this,()=>e(t)]):this.liveSocket.requestDOMUpdate(()=>e(t))})}bindChannel(){this.liveSocket.onChannel(this.channel,"diff",t=>{this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",t,({diff:t,events:e})=>this.update(t,e))})}),this.onChannel("redirect",({to:t,flash:e})=>this.onRedirect({to:t,flash:e})),this.onChannel("live_patch",t=>this.onLivePatch(t)),this.onChannel("live_redirect",t=>this.onLiveRedirect(t)),this.channel.onError(t=>this.onError(t)),this.channel.onClose(t=>this.onClose(t))}destroyAllChildren(){for(let t in this.root.children[this.id])this.getChildById(t).destroy()}onLiveRedirect(t){let{to:e,kind:n,flash:i}=t,r=this.expandURL(e);this.liveSocket.historyRedirect(r,n,i)}onLivePatch(t){let{to:e,kind:n}=t;this.href=this.expandURL(e),this.liveSocket.historyPatch(e,n)}expandURL(t){return t.startsWith("/")?`${window.location.protocol}//${window.location.host}${t}`:t}onRedirect({to:t,flash:e}){this.liveSocket.redirect(t,e)}isDestroyed(){return this.destroyed}join(t){this.parent||(this.stopCallback=this.liveSocket.withPageLoading({to:this.href,kind:"initial"})),this.joinCallback=e=>{e=e||function(){},t?t(this.joinCount,e):e()},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(t){return"unauthorized"===t.reason||"stale"===t.reason?(this.log("error",()=>["unauthorized live_redirect. Falling back to page request",t]),this.onRedirect({to:this.href})):((t.redirect||t.live_redirect)&&(this.joinPending=!1,this.channel.leave()),t.redirect?this.onRedirect(t.redirect):t.live_redirect?this.onLiveRedirect(t.live_redirect):(this.log("error",()=>["unable to join",t]),this.liveSocket.reloadWithJitter(this)))}onClose(t){if(!this.isDestroyed()){if(this.isJoinPending()&&"hidden"!==document.visibilityState||this.liveSocket.hasPendingLink()&&"leave"!==t)return this.liveSocket.reloadWithJitter(this);this.destroyAllChildren(),this.liveSocket.dropActiveElement(this),document.activeElement&&document.activeElement.blur(),this.liveSocket.isUnloaded()&&this.showLoader(200)}}onError(t){this.onClose(t),this.log("error",()=>["view crashed",t]),this.liveSocket.isUnloaded()||this.displayError()}displayError(){this.isMain()&<.dispatchEvent(window,"phx:page-loading-start",{to:this.href,kind:"error"}),this.showLoader(),this.setContainerClasses("phx-loading","phx-error")}pushWithReply(t,e,n,i=function(){}){if(!this.isConnected())return;let[r,[o],s]=t?t():[null,[],{}],a=function(){};return(s.page_loading||o&&null!==o.getAttribute(this.binding("page-loading")))&&(a=this.liveSocket.withPageLoading({kind:"element",target:o})),"number"!=typeof n.cid&&delete n.cid,this.liveSocket.wrapPush(this,{timeout:!0},()=>this.channel.push(e,n,3e4).receive("ok",t=>{this.liveSocket.requestDOMUpdate(()=>{let e=null;null!==r&&this.undoRefs(r),t.diff&&(e=this.applyDiff("update",t.diff,({diff:t,events:e})=>{this.update(t,e)})),t.redirect&&this.onRedirect(t.redirect),t.live_patch&&this.onLivePatch(t.live_patch),t.live_redirect&&this.onLiveRedirect(t.live_redirect),a(),i(t,e)})}))}undoRefs(t){lt.all(this.el,`[${R}="${t}"]`,t=>{let e=t.getAttribute("data-phx-disabled");t.removeAttribute(R),null!==t.getAttribute("data-phx-readonly")&&(t.readOnly=!1,t.removeAttribute("data-phx-readonly")),null!==e&&(t.disabled="true"===e,t.removeAttribute("data-phx-disabled")),P.forEach(e=>lt.removeClass(t,e));let n=t.getAttribute("data-phx-disable-with-restore");null!==n&&(t.innerText=n,t.removeAttribute("data-phx-disable-with-restore"));let i=lt.private(t,R);if(i){let e=this.triggerBeforeUpdateHook(t,i);xt.patchEl(t,i,this.liveSocket.getActiveElement()),e&&e.__updated(),lt.deletePrivate(t,R)}})}putRef(t,e,n={}){let i=this.ref++,r=this.binding("disable-with");return n.loading&&(t=t.concat(lt.all(document,n.loading))),t.forEach(t=>{t.classList.add(`phx-${e}-loading`),t.setAttribute(R,i);let n=t.getAttribute(r);null!==n&&(t.getAttribute("data-phx-disable-with-restore")||t.setAttribute("data-phx-disable-with-restore",t.innerText),t.innerText=n)}),[i,t,n]}componentID(t){let e=t.getAttribute&&t.getAttribute(N);return e?parseInt(e):null}targetComponentID(t,e){if(G(e))return e;let n=t.getAttribute(this.binding("target"));return G(n)?parseInt(n):e&&null!==n?this.closestComponentID(e):null}closestComponentID(t){return G(t)?t:t?it(t.closest(`[${N}]`),t=>this.ownsElement(t)&&this.componentID(t)):null}pushHookEvent(t,e,n,i){if(!this.isConnected())return this.log("hook",()=>["unable to push hook event. LiveView not connected",e,n]),!1;let[r,o,s]=this.putRef([],"hook");return this.pushWithReply(()=>[r,o,s],"event",{type:"hook",event:e,value:n,cid:this.closestComponentID(t)},(t,e)=>i(e,r)),r}extractMeta(t,e,n){let i=this.binding("value-");for(let n=0;n<t.attributes.length;n++){e||(e={});let r=t.attributes[n].name;r.startsWith(i)&&(e[r.replace(i,"")]=t.getAttribute(r))}if(void 0!==t.value&&(e||(e={}),e.value=t.value,"INPUT"===t.tagName&&F.indexOf(t.type)>=0&&!t.checked&&delete e.value),n){e||(e={});for(let t in n)e[t]=n[t]}return e}pushEvent(t,e,n,i,r,o={}){this.pushWithReply(()=>this.putRef([e],t,o),"event",{type:t,event:i,value:this.extractMeta(e,r,o.value),cid:this.targetComponentID(e,n)})}pushFileProgress(t,e,n,i=function(){}){this.liveSocket.withinOwners(t.form,(r,o)=>{r.pushWithReply(null,"progress",{event:t.getAttribute(r.binding("progress")),ref:t.getAttribute(I),entry_ref:e,progress:n,cid:r.targetComponentID(t.form,o)},i)})}pushInput(t,e,n,i,r,o){let s,a=G(n)?n:this.targetComponentID(t.form,e),l=()=>this.putRef([t,t.form],"change",r),u=Mt(t.form,{_target:r._target});lt.isUploadInput(t)&&t.files&&t.files.length>0&&ct.trackFiles(t,Array.from(t.files)),s=ct.serializeUploads(t);let h={type:"form",event:i,value:u,uploads:s,cid:a};this.pushWithReply(l,"event",h,n=>{if(lt.showError(t,this.liveSocket.binding("feedback-for")),lt.isUploadInput(t)&&null!==t.getAttribute("data-phx-auto-upload")){if(ct.filesAwaitingPreflight(t).length>0){let[i,r]=l();this.uploadFiles(t.form,e,i,a,e=>{o&&o(n),this.triggerAwaitingSubmit(t.form)})}}else o&&o(n)})}triggerAwaitingSubmit(t){let e=this.getScheduledSubmit(t);if(e){let[n,i,r,o]=e;this.cancelSubmit(t),o()}}getScheduledSubmit(t){return this.formSubmits.find(([e,n,i,r])=>e.isSameNode(t))}scheduleSubmit(t,e,n,i){if(this.getScheduledSubmit(t))return!0;this.formSubmits.push([t,e,n,i])}cancelSubmit(t){this.formSubmits=this.formSubmits.filter(([e,n,i])=>!e.isSameNode(t)||(this.undoRefs(n),!1))}pushFormSubmit(t,e,n,i,r){let o=t=>!(tt(t,this.binding("update")+"=ignore",t.form)||tt(t,"data-phx-update=ignore",t.form)),s=t=>t.hasAttribute(this.binding("disable-with")),a=t=>"BUTTON"==t.tagName,l=t=>["INPUT","TEXTAREA","SELECT"].includes(t.tagName),u=()=>{let e=Array.from(t.elements),n=e.filter(s),r=e.filter(a).filter(o),u=e.filter(l).filter(o);return r.forEach(t=>{t.setAttribute("data-phx-disabled",t.disabled),t.disabled=!0}),u.forEach(t=>{t.setAttribute("data-phx-readonly",t.readOnly),t.readOnly=!0,t.files&&(t.setAttribute("data-phx-disabled",t.disabled),t.disabled=!0)}),t.setAttribute(this.binding("page-loading"),""),this.putRef([t].concat(n).concat(r).concat(u),"submit",i)},h=this.targetComponentID(t,e);if(ct.hasUploadsInProgress(t)){let[o,s]=u(),a=()=>this.pushFormSubmit(t,e,n,i,r);return this.scheduleSubmit(t,o,i,a)}if(ct.inputsAwaitingPreflight(t).length>0){let[o,s]=u(),a=()=>[o,s,i];this.uploadFiles(t,e,o,h,e=>{let i=Mt(t,{});this.pushWithReply(a,"event",{type:"form",event:n,value:i,cid:h},r)})}else{let e=Mt(t);this.pushWithReply(u,"event",{type:"form",event:n,value:e,cid:h},r)}}uploadFiles(t,e,n,i,r){let o=this.joinCount,s=ct.activeFileInputs(t),a=s.length;s.forEach(t=>{let i=new ct(t,this,()=>{a--,0===a&&r()});this.uploaders[t]=i;let s=i.entries().map(t=>t.toPreflightPayload()),l={ref:t.getAttribute(I),entries:s,cid:this.targetComponentID(t.form,e)};this.log("upload",()=>["sending preflight request",l]),this.pushWithReply(null,"allow_upload",l,t=>{if(this.log("upload",()=>["got preflight response",t]),t.error){this.undoRefs(n);let[e,i]=t.error;this.log("upload",()=>["error for entry "+e,i])}else{let e=t=>{this.channel.onError(()=>{this.joinCount===o&&t()})};i.initAdapterUpload(t,e,this.liveSocket)}})})}dispatchUploads(t,e){let n=lt.findUploadInputs(this.el).filter(e=>e.name===t);0===n.length?X(`no live file inputs found matching the name "${t}"`):n.length>1?X(`duplicate live file inputs found matching the name "${t}"`):lt.dispatchEvent(n[0],"track-uploads",{files:e})}pushFormRecovery(t,e,n){this.liveSocket.withinOwners(t,(i,r)=>{let o=t.elements[0],s=t.getAttribute(this.binding("auto-recover"))||t.getAttribute(this.binding("change"));Tt.exec("change",s,i,o,["push",{_target:o.name,newCid:e,callback:n}])})}pushLinkPatch(t,e,n){let i=this.liveSocket.setPendingLink(t),r=e?()=>this.putRef([e],"click"):null;this.pushWithReply(r,"live_patch",{url:t},e=>{this.liveSocket.requestDOMUpdate(()=>{e.link_redirect?this.liveSocket.replaceMain(t,null,n,i):(this.liveSocket.commitPendingLink(i)&&(this.href=t),this.applyPendingUpdates(),n&&n(i))})}).receive("timeout",()=>this.liveSocket.redirect(window.location.href))}formsForRecovery(t){if(0===this.joinCount)return[];let e=this.binding("change"),n=document.createElement("template");return n.innerHTML=t,lt.all(this.el,`form[${e}]`).filter(t=>t.id&&this.ownsElement(t)).filter(t=>t.elements.length>0).filter(t=>"ignore"!==t.getAttribute(this.binding("auto-recover"))).map(t=>{let i=n.content.querySelector(`form[id="${t.id}"][${e}="${t.getAttribute(e)}"]`);return i?[t,i,this.targetComponentID(i)]:[t,null,null]}).filter(([t,e,n])=>e)}maybePushComponentsDestroyed(t){let e=t.filter(t=>0===lt.findComponentNodeList(this.el,t).length);e.length>0&&(this.pruningCIDs.push(...e),this.pushWithReply(null,"cids_will_destroy",{cids:e},()=>{this.pruningCIDs=this.pruningCIDs.filter(t=>-1!==e.indexOf(t));let t=e.filter(t=>0===lt.findComponentNodeList(this.el,t).length);t.length>0&&this.pushWithReply(null,"cids_destroyed",{cids:t},t=>{this.rendered.pruneCIDs(t.cids)})}))}ownsElement(t){return t.getAttribute(U)===this.id||it(t.closest($),t=>t.id)===this.id}submitForm(t,e,n,i={}){lt.putPrivate(t,"phx-has-submitted",!0),this.liveSocket.blurActiveElement(this),this.pushFormSubmit(t,e,n,i,()=>{this.liveSocket.restorePreviouslyActiveFocus()})}binding(t){return this.liveSocket.binding(t)}},Dt=class{constructor(){this.transitions=new Set,this.pendingOps=[],this.reset()}reset(){this.transitions.forEach(t=>{cancelTimeout(t),this.transitions.delete(t)}),this.flushPendingOps()}after(t){0===this.size()?t():this.pushPendingOp(t)}addTransition(t,e,n){e();let i=setTimeout(()=>{this.transitions.delete(i),n(),0===this.size()&&this.flushPendingOps()},t);this.transitions.add(i)}pushPendingOp(t){this.pendingOps.push(t)}size(){return this.transitions.size}flushPendingOps(){this.pendingOps.forEach(t=>t()),this.pendingOps=[]}},Pt=function(t){return t};function Nt(t){return"translate("+t+",0)"}function Rt(t){return"translate(0,"+t+")"}function It(t){return e=>+t(e)}function Ut(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function Ot(){return!this.__axis}function jt(t,e){var n=[],i=null,r=null,o=6,s=6,a=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,u=1===t||4===t?-1:1,h=4===t||2===t?"x":"y",c=1===t||3===t?Nt:Rt;function d(d){var f=null==i?e.ticks?e.ticks.apply(e,n):e.domain():i,p=null==r?e.tickFormat?e.tickFormat.apply(e,n):Pt:r,g=Math.max(o,0)+a,m=e.range(),v=+m[0]+l,y=+m[m.length-1]+l,b=(e.bandwidth?Ut:It)(e.copy(),l),w=d.selection?d.selection():d,_=w.selectAll(".domain").data([null]),k=w.selectAll(".tick").data(f,e).order(),C=k.exit(),x=k.enter().append("g").attr("class","tick"),E=k.select("line"),A=k.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(x),E=E.merge(x.append("line").attr("stroke","currentColor").attr(h+"2",u*o)),A=A.merge(x.append("text").attr("fill","currentColor").attr(h,u*g).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),d!==w&&(_=_.transition(d),k=k.transition(d),E=E.transition(d),A=A.transition(d),C=C.transition(d).attr("opacity",1e-6).attr("transform",(function(t){return isFinite(t=b(t))?c(t+l):this.getAttribute("transform")})),x.attr("opacity",1e-6).attr("transform",(function(t){var e=this.parentNode.__axis;return c((e&&isFinite(e=e(t))?e:b(t))+l)}))),C.remove(),_.attr("d",4===t||2===t?s?"M"+u*s+","+v+"H"+l+"V"+y+"H"+u*s:"M"+l+","+v+"V"+y:s?"M"+v+","+u*s+"V"+l+"H"+y+"V"+u*s:"M"+v+","+l+"H"+y),k.attr("opacity",1).attr("transform",(function(t){return c(b(t)+l)})),E.attr(h+"2",u*o),A.attr(h,u*g).text(p),w.filter(Ot).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),w.each((function(){this.__axis=b}))}return d.scale=function(t){return arguments.length?(e=t,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),d):n.slice()},d.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),d):i&&i.slice()},d.tickFormat=function(t){return arguments.length?(r=t,d):r},d.tickSize=function(t){return arguments.length?(o=s=+t,d):o},d.tickSizeInner=function(t){return arguments.length?(o=+t,d):o},d.tickSizeOuter=function(t){return arguments.length?(s=+t,d):s},d.tickPadding=function(t){return arguments.length?(a=+t,d):a},d.offset=function(t){return arguments.length?(l=+t,d):l},d}function Ft(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ht(t){let e=t,n=t,i=t;function r(t,e,r=0,o=t.length){if(r<o){if(0!==n(e,e))return o;do{const n=r+o>>>1;i(t[n],e)<0?r=n+1:o=n}while(r<o)}return r}return 1===t.length&&(e=(e,n)=>t(e)-n,n=Ft,i=(e,n)=>Ft(t(e),n)),{left:r,center:function(t,n,i=0,o=t.length){const s=r(t,n,i,o-1);return s>i&&e(t[s-1],n)>-e(t[s],n)?s-1:s},right:function(t,e,r=0,o=t.length){if(r<o){if(0!==n(e,e))return o;do{const n=r+o>>>1;i(t[n],e)<=0?r=n+1:o=n}while(r<o)}return r}}}var $t=Math.sqrt(50),Bt=Math.sqrt(10),qt=Math.sqrt(2);function Vt(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),o=i/Math.pow(10,r);return r>=0?(o>=$t?10:o>=Bt?5:o>=qt?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=$t?10:o>=Bt?5:o>=qt?2:1)}function Jt(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;return o>=$t?r*=10:o>=Bt?r*=5:o>=qt&&(r*=2),e<t?-r:r}var zt=new Date,Yt=new Date;function Wt(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=function(e){return t(e=new Date(+e)),e},r.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},r.round=function(t){var e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},r.range=function(n,i,o){var s,a=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return a;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(s<n&&n<i);return a},r.filter=function(n){return Wt((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););}))},n&&(r.count=function(e,i){return zt.setTime(+e),Yt.setTime(+i),t(zt),t(Yt),Math.floor(n(zt,Yt))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var Xt=Wt((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));Xt.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Wt((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):Xt:null};var Gt=Xt,Kt=(Xt.range,Wt((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()}))),Zt=Kt,Qt=(Kt.range,Wt((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()}))),te=Qt,ee=(Qt.range,Wt((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()}))),ne=ee,ie=(ee.range,Wt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5,t=>t.getDate()-1)),re=ie;ie.range;function oe(t){return Wt((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var se=oe(0),ae=oe(1),le=oe(2),ue=oe(3),he=oe(4),ce=oe(5),de=oe(6),fe=(se.range,ae.range,le.range,ue.range,he.range,ce.range,de.range,Wt((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))),pe=fe,ge=(fe.range,Wt((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()})));ge.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Wt((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var me=ge,ve=(ge.range,Wt((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()}))),ye=ve,be=(ve.range,Wt((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()}))),we=be,_e=(be.range,Wt((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}))),ke=_e;_e.range;function Ce(t){return Wt((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var xe=Ce(0),Ee=Ce(1),Ae=Ce(2),Se=Ce(3),Te=Ce(4),Me=Ce(5),Le=Ce(6),De=(xe.range,Ee.range,Ae.range,Se.range,Te.range,Me.range,Le.range,Wt((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()}))),Pe=De,Ne=(De.range,Wt((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));Ne.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Wt((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var Re=Ne;Ne.range;function Ie(t,e,n,i,r,o){const s=[[Zt,1,1e3],[Zt,5,5e3],[Zt,15,15e3],[Zt,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[r,1,36e5],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,864e5],[i,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function a(e,n,i){const r=Math.abs(n-e)/i,o=Ht(([,,t])=>t).right(s,r);if(o===s.length)return t.every(Jt(e/31536e6,n/31536e6,i));if(0===o)return Gt.every(Math.max(Jt(e,n,i),1));const[a,l]=s[r/s[o-1][2]<s[o][2]/r?o-1:o];return a.every(l)}return[function(t,e,n){const i=e<t;i&&([t,e]=[e,t]);const r=n&&"function"==typeof n.range?n:a(t,e,n),o=r?r.range(t,+e+1):[];return i?o.reverse():o},a]}const[Ue,Oe]=Ie(Re,Pe,xe,ke,we,ye),[je,Fe]=Ie(me,pe,se,re,ne,te);function He(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function $e(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Be(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var qe,Ve,Je={"-":"",_:" ",0:"0"},ze=/^\s*\d+/,Ye=/^%/,We=/[\\^$*+?|[\]().{}]/g;function Xe(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function Ge(t){return t.replace(We,"\\$&")}function Ke(t){return new RegExp("^(?:"+t.map(Ge).join("|")+")","i")}function Ze(t){return new Map(t.map((t,e)=>[t.toLowerCase(),e]))}function Qe(t,e,n){var i=ze.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function tn(t,e,n){var i=ze.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function en(t,e,n){var i=ze.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function nn(t,e,n){var i=ze.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function rn(t,e,n){var i=ze.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function on(t,e,n){var i=ze.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function sn(t,e,n){var i=ze.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function an(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function ln(t,e,n){var i=ze.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function un(t,e,n){var i=ze.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function hn(t,e,n){var i=ze.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function cn(t,e,n){var i=ze.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function dn(t,e,n){var i=ze.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function fn(t,e,n){var i=ze.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function pn(t,e,n){var i=ze.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function gn(t,e,n){var i=ze.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function mn(t,e,n){var i=ze.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function vn(t,e,n){var i=Ye.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function yn(t,e,n){var i=ze.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function bn(t,e,n){var i=ze.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function wn(t,e){return Xe(t.getDate(),e,2)}function _n(t,e){return Xe(t.getHours(),e,2)}function kn(t,e){return Xe(t.getHours()%12||12,e,2)}function Cn(t,e){return Xe(1+re.count(me(t),t),e,3)}function xn(t,e){return Xe(t.getMilliseconds(),e,3)}function En(t,e){return xn(t,e)+"000"}function An(t,e){return Xe(t.getMonth()+1,e,2)}function Sn(t,e){return Xe(t.getMinutes(),e,2)}function Tn(t,e){return Xe(t.getSeconds(),e,2)}function Mn(t){var e=t.getDay();return 0===e?7:e}function Ln(t,e){return Xe(se.count(me(t)-1,t),e,2)}function Dn(t){var e=t.getDay();return e>=4||0===e?he(t):he.ceil(t)}function Pn(t,e){return t=Dn(t),Xe(he.count(me(t),t)+(4===me(t).getDay()),e,2)}function Nn(t){return t.getDay()}function Rn(t,e){return Xe(ae.count(me(t)-1,t),e,2)}function In(t,e){return Xe(t.getFullYear()%100,e,2)}function Un(t,e){return Xe((t=Dn(t)).getFullYear()%100,e,2)}function On(t,e){return Xe(t.getFullYear()%1e4,e,4)}function jn(t,e){var n=t.getDay();return Xe((t=n>=4||0===n?he(t):he.ceil(t)).getFullYear()%1e4,e,4)}function Fn(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Xe(e/60|0,"0",2)+Xe(e%60,"0",2)}function Hn(t,e){return Xe(t.getUTCDate(),e,2)}function $n(t,e){return Xe(t.getUTCHours(),e,2)}function Bn(t,e){return Xe(t.getUTCHours()%12||12,e,2)}function qn(t,e){return Xe(1+ke.count(Re(t),t),e,3)}function Vn(t,e){return Xe(t.getUTCMilliseconds(),e,3)}function Jn(t,e){return Vn(t,e)+"000"}function zn(t,e){return Xe(t.getUTCMonth()+1,e,2)}function Yn(t,e){return Xe(t.getUTCMinutes(),e,2)}function Wn(t,e){return Xe(t.getUTCSeconds(),e,2)}function Xn(t){var e=t.getUTCDay();return 0===e?7:e}function Gn(t,e){return Xe(xe.count(Re(t)-1,t),e,2)}function Kn(t){var e=t.getUTCDay();return e>=4||0===e?Te(t):Te.ceil(t)}function Zn(t,e){return t=Kn(t),Xe(Te.count(Re(t),t)+(4===Re(t).getUTCDay()),e,2)}function Qn(t){return t.getUTCDay()}function ti(t,e){return Xe(Ee.count(Re(t)-1,t),e,2)}function ei(t,e){return Xe(t.getUTCFullYear()%100,e,2)}function ni(t,e){return Xe((t=Kn(t)).getUTCFullYear()%100,e,2)}function ii(t,e){return Xe(t.getUTCFullYear()%1e4,e,4)}function ri(t,e){var n=t.getUTCDay();return Xe((t=n>=4||0===n?Te(t):Te.ceil(t)).getUTCFullYear()%1e4,e,4)}function oi(){return"+0000"}function si(){return"%"}function ai(t){return+t}function li(t){return Math.floor(+t/1e3)}qe=function(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,s=t.shortDays,a=t.months,l=t.shortMonths,u=Ke(r),h=Ze(r),c=Ke(o),d=Ze(o),f=Ke(s),p=Ze(s),g=Ke(a),m=Ze(a),v=Ke(l),y=Ze(l),b={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:wn,e:wn,f:En,g:Un,G:jn,H:_n,I:kn,j:Cn,L:xn,m:An,M:Sn,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ai,s:li,S:Tn,u:Mn,U:Ln,V:Pn,w:Nn,W:Rn,x:null,X:null,y:In,Y:On,Z:Fn,"%":si},w={a:function(t){return s[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Hn,e:Hn,f:Jn,g:ni,G:ri,H:$n,I:Bn,j:qn,L:Vn,m:zn,M:Yn,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ai,s:li,S:Wn,u:Xn,U:Gn,V:Zn,w:Qn,W:ti,x:null,X:null,y:ei,Y:ii,Z:oi,"%":si},_={a:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=v.exec(e.slice(n));return i?(t.m=y.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return x(t,e,n,i)},d:hn,e:hn,f:mn,g:sn,G:on,H:dn,I:dn,j:cn,L:gn,m:un,M:fn,p:function(t,e,n){var i=u.exec(e.slice(n));return i?(t.p=h.get(i[0].toLowerCase()),n+i[0].length):-1},q:ln,Q:yn,s:bn,S:pn,u:tn,U:en,V:nn,w:Qe,W:rn,x:function(t,e,i){return x(t,n,e,i)},X:function(t,e,n){return x(t,i,e,n)},y:sn,Y:on,Z:an,"%":vn};function k(t,e){return function(n){var i,r,o,s=[],a=-1,l=0,u=t.length;for(n instanceof Date||(n=new Date(+n));++a<u;)37===t.charCodeAt(a)&&(s.push(t.slice(l,a)),null!=(r=Je[i=t.charAt(++a)])?i=t.charAt(++a):r="e"===i?" ":"0",(o=e[i])&&(i=o(n,r)),s.push(i),l=a+1);return s.push(t.slice(l,a)),s.join("")}}function C(t,e){return function(n){var i,r,o=Be(1900,void 0,1);if(x(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=$e(Be(o.y,0,1))).getUTCDay(),i=r>4||0===r?Ee.ceil(i):Ee(i),i=ke.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=He(Be(o.y,0,1))).getDay(),i=r>4||0===r?ae.ceil(i):ae(i),i=re.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?$e(Be(o.y,0,1)).getUTCDay():He(Be(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,$e(o)):He(o)}}function x(t,e,n,i){for(var r,o,s=0,a=e.length,l=n.length;s<a;){if(i>=l)return-1;if(37===(r=e.charCodeAt(s++))){if(r=e.charAt(s++),!(o=_[r in Je?e.charAt(s++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=k(n,b),b.X=k(i,b),b.c=k(e,b),w.x=k(n,w),w.X=k(i,w),w.c=k(e,w),{format:function(t){var e=k(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=C(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=k(t+="",w);return e.toString=function(){return t},e},utcParse:function(t){var e=C(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),Ve=qe.format,qe.parse,qe.utcFormat,qe.utcParse;const ui=Ht(Ft),hi=ui.right;ui.left,Ht((function(t){return null===t?NaN:+t})).center;var ci=hi,di=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function fi(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function pi(){}var gi="\\s*([+-]?\\d+)\\s*",mi="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",vi="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yi=/^#([0-9a-f]{3,8})$/,bi=new RegExp("^rgb\\("+[gi,gi,gi]+"\\)$"),wi=new RegExp("^rgb\\("+[vi,vi,vi]+"\\)$"),_i=new RegExp("^rgba\\("+[gi,gi,gi,mi]+"\\)$"),ki=new RegExp("^rgba\\("+[vi,vi,vi,mi]+"\\)$"),Ci=new RegExp("^hsl\\("+[mi,vi,vi]+"\\)$"),xi=new RegExp("^hsla\\("+[mi,vi,vi,mi]+"\\)$"),Ei={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ai(){return this.rgb().formatHex()}function Si(){return this.rgb().formatRgb()}function Ti(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=yi.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Mi(e):3===n?new Ni(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Li(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Li(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=bi.exec(t))?new Ni(e[1],e[2],e[3],1):(e=wi.exec(t))?new Ni(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=_i.exec(t))?Li(e[1],e[2],e[3],e[4]):(e=ki.exec(t))?Li(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ci.exec(t))?Oi(e[1],e[2]/100,e[3]/100,1):(e=xi.exec(t))?Oi(e[1],e[2]/100,e[3]/100,e[4]):Ei.hasOwnProperty(t)?Mi(Ei[t]):"transparent"===t?new Ni(NaN,NaN,NaN,0):null}function Mi(t){return new Ni(t>>16&255,t>>8&255,255&t,1)}function Li(t,e,n,i){return i<=0&&(t=e=n=NaN),new Ni(t,e,n,i)}function Di(t){return t instanceof pi||(t=Ti(t)),t?new Ni((t=t.rgb()).r,t.g,t.b,t.opacity):new Ni}function Pi(t,e,n,i){return 1===arguments.length?Di(t):new Ni(t,e,n,null==i?1:i)}function Ni(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Ri(){return"#"+Ui(this.r)+Ui(this.g)+Ui(this.b)}function Ii(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ui(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Oi(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Fi(t,e,n,i)}function ji(t){if(t instanceof Fi)return new Fi(t.h,t.s,t.l,t.opacity);if(t instanceof pi||(t=Ti(t)),!t)return new Fi;if(t instanceof Fi)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=e===o?(n-i)/a+6*(n<i):n===o?(i-e)/a+2:(e-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new Fi(s,a,l,t.opacity)}function Fi(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Hi(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function $i(t,e,n,i,r){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*n+(1+3*t+3*o-3*s)*i+s*r)/6}di(pi,Ti,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Ai,formatHex:Ai,formatHsl:function(){return ji(this).formatHsl()},formatRgb:Si,toString:Si}),di(Ni,Pi,fi(pi,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ni(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ni(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ri,formatHex:Ri,formatRgb:Ii,toString:Ii})),di(Fi,(function(t,e,n,i){return 1===arguments.length?ji(t):new Fi(t,e,n,null==i?1:i)}),fi(pi,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Fi(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Fi(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Ni(Hi(t>=240?t-240:t+120,r,i),Hi(t,r,i),Hi(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Bi=t=>()=>t;function qi(t,e){return function(n){return t+n*e}}function Vi(t){return 1==(t=+t)?Ji:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Bi(isNaN(e)?n:e)}}function Ji(t,e){var n=e-t;return n?qi(t,n):Bi(isNaN(t)?e:t)}var zi=function t(e){var n=Vi(e);function i(t,e){var i=n((t=Pi(t)).r,(e=Pi(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),s=Ji(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function Yi(t){return function(e){var n,i,r=e.length,o=new Array(r),s=new Array(r),a=new Array(r);for(n=0;n<r;++n)i=Pi(e[n]),o[n]=i.r||0,s[n]=i.g||0,a[n]=i.b||0;return o=t(o),s=t(s),a=t(a),i.opacity=1,function(t){return i.r=o(t),i.g=s(t),i.b=a(t),i+""}}}Yi((function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),r=t[i],o=t[i+1],s=i>0?t[i-1]:2*r-o,a=i<e-1?t[i+2]:2*o-r;return $i((n-i/e)*e,s,r,o,a)}})),Yi((function(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),r=t[(i+e-1)%e],o=t[i%e],s=t[(i+1)%e],a=t[(i+2)%e];return $i((n-i/e)*e,r,o,s,a)}}));var Wi=function(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(o){for(n=0;n<i;++n)r[n]=t[n]*(1-o)+e[n]*o;return r}};function Xi(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Gi(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,o=new Array(r),s=new Array(i);for(n=0;n<r;++n)o[n]=ir(t[n],e[n]);for(;n<i;++n)s[n]=e[n];return function(t){for(n=0;n<r;++n)s[n]=o[n](t);return s}}var Ki=function(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}},Zi=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},Qi=function(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=ir(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}},tr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,er=new RegExp(tr.source,"g");var nr=function(t,e){var n,i,r,o=tr.lastIndex=er.lastIndex=0,s=-1,a=[],l=[];for(t+="",e+="";(n=tr.exec(t))&&(i=er.exec(e));)(r=i.index)>o&&(r=e.slice(o,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:Zi(n,i)})),o=er.lastIndex;return o<e.length&&(r=e.slice(o),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)a[(n=l[i]).i]=n.x(t);return a.join("")})},ir=function(t,e){var n,i=typeof e;return null==e||"boolean"===i?Bi(e):("number"===i?Zi:"string"===i?(n=Ti(e))?(e=n,zi):nr:e instanceof Ti?zi:e instanceof Date?Ki:Xi(e)?Wi:Array.isArray(e)?Gi:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Qi:Zi)(t,e)},rr=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}};function or(t){return+t}var sr=[0,1];function ar(t){return t}function lr(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function ur(t,e,n){var i=t[0],r=t[1],o=e[0],s=e[1];return r<i?(i=lr(r,i),o=n(s,o)):(i=lr(i,r),o=n(o,s)),function(t){return o(i(t))}}function hr(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),s=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<i;)r[s]=lr(t[s],t[s+1]),o[s]=n(e[s],e[s+1]);return function(e){var n=ci(t,e,1,i)-1;return o[n](r[n](e))}}function cr(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function dr(){var t,e,n,i,r,o,s=sr,a=sr,l=ir,u=ar;function h(){var t,e,n,l=Math.min(s.length,a.length);return u!==ar&&(t=s[0],e=s[l-1],t>e&&(n=t,t=e,e=n),u=function(n){return Math.max(t,Math.min(e,n))}),i=l>2?hr:ur,r=o=null,c}function c(e){return null==e||isNaN(e=+e)?n:(r||(r=i(s.map(t),a,l)))(t(u(e)))}return c.invert=function(n){return u(e((o||(o=i(a,s.map(t),Zi)))(n)))},c.domain=function(t){return arguments.length?(s=Array.from(t,or),h()):s.slice()},c.range=function(t){return arguments.length?(a=Array.from(t),h()):a.slice()},c.rangeRound=function(t){return a=Array.from(t),l=rr,h()},c.clamp=function(t){return arguments.length?(u=!!t||ar,h()):u!==ar},c.interpolate=function(t){return arguments.length?(l=t,h()):l},c.unknown=function(t){return arguments.length?(n=t,c):n},function(n,i){return t=n,e=i,h()}}function fr(){return dr()(ar,ar)}function pr(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function gr(t){return new Date(t)}function mr(t){return t instanceof Date?+t:+new Date(+t)}function vr(t,e,n,i,r,o,s,a,l,u){var h=fr(),c=h.invert,d=h.domain,f=u(".%L"),p=u(":%S"),g=u("%I:%M"),m=u("%I %p"),v=u("%a %d"),y=u("%b %d"),b=u("%B"),w=u("%Y");function _(t){return(l(t)<t?f:a(t)<t?p:s(t)<t?g:o(t)<t?m:i(t)<t?r(t)<t?v:y:n(t)<t?b:w)(t)}return h.invert=function(t){return new Date(c(t))},h.domain=function(t){return arguments.length?d(Array.from(t,mr)):d().map(gr)},h.ticks=function(e){var n=d();return t(n[0],n[n.length-1],null==e?10:e)},h.tickFormat=function(t,e){return null==e?_:u(e)},h.nice=function(t){var n=d();return t&&"function"==typeof t.range||(t=e(n[0],n[n.length-1],null==t?10:t)),t?d(function(t,e){var n,i=0,r=(t=t.slice()).length-1,o=t[i],s=t[r];return s<o&&(n=i,i=r,r=n,n=o,o=s,s=n),t[i]=e.floor(o),t[r]=e.ceil(s),t}(n,t)):h},h.copy=function(){return cr(h,vr(t,e,n,i,r,o,s,a,l,u))},h}var yr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function br(t){if(!(e=yr.exec(t)))throw new Error("invalid format: "+t);var e;return new wr({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function wr(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}br.prototype=wr.prototype,wr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};function _r(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}var kr,Cr,xr,Er,Ar=function(t){return(t=_r(Math.abs(t)))?t[1]:NaN},Sr=function(t,e){var n=_r(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")},Tr={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Sr(100*t,e),r:Sr,s:function(t,e){var n=_r(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(kr=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+_r(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)},Mr=function(t){return t},Lr=Array.prototype.map,Dr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],Pr=function(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?Mr:(e=Lr.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,o=[],s=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[s=(s+1)%e.length];return o.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",s=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?Mr:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Lr.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",u=void 0===t.minus?"−":t.minus+"",h=void 0===t.nan?"NaN":t.nan+"";function c(t){var e=(t=br(t)).fill,n=t.align,c=t.sign,d=t.symbol,f=t.zero,p=t.width,g=t.comma,m=t.precision,v=t.trim,y=t.type;"n"===y?(g=!0,y="g"):Tr[y]||(void 0===m&&(m=12),v=!0,y="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var b="$"===d?r:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===d?o:/[%p]/.test(y)?l:"",_=Tr[y],k=/[defgprs%]/.test(y);function C(t){var r,o,l,d=b,C=w;if("c"===y)C=_(t)+C,t="";else{var x=(t=+t)<0||1/t<0;if(t=isNaN(t)?h:_(Math.abs(t),m),v&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),x&&0==+t&&"+"!==c&&(x=!1),d=(x?"("===c?c:u:"-"===c||"("===c?"":c)+d,C=("s"===y?Dr[8+kr/3]:"")+C+(x&&"("===c?")":""),k)for(r=-1,o=t.length;++r<o;)if(48>(l=t.charCodeAt(r))||l>57){C=(46===l?s+t.slice(r+1):t.slice(r))+C,t=t.slice(0,r);break}}g&&!f&&(t=i(t,1/0));var E=d.length+t.length+C.length,A=E<p?new Array(p-E+1).join(e):"";switch(g&&f&&(t=i(A+t,A.length?p-C.length:1/0),A=""),n){case"<":t=d+t+C+A;break;case"=":t=d+A+t+C;break;case"^":t=A.slice(0,E=A.length>>1)+d+t+C+A.slice(E);break;default:t=A+d+t+C}return a(t)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),C.toString=function(){return t+""},C}return{format:c,formatPrefix:function(t,e){var n=c(((t=br(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Ar(e)/3))),r=Math.pow(10,-i),o=Dr[8+i/3];return function(t){return n(r*t)+o}}}};!function(t){Cr=Pr(t),xr=Cr.format,Er=Cr.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});function Nr(t,e,n,i){var r,o=Jt(t,e,n);switch((i=br(null==i?",f":i)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ar(e)/3)))-Ar(Math.abs(t)))}(o,s))||(i.precision=r),Er(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ar(e)-Ar(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-Ar(Math.abs(t)))}(o))||(i.precision=r-2*("%"===i.type))}return xr(i)}function Rr(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){var i,r,o,s,a=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((i=e<t)&&(r=t,t=e,e=r),0===(s=Vt(t,e,n))||!isFinite(s))return[];if(s>0){let n=Math.round(t/s),i=Math.round(e/s);for(n*s<t&&++n,i*s>e&&--i,o=new Array(r=i-n+1);++a<r;)o[a]=(n+a)*s}else{s=-s;let n=Math.round(t*s),i=Math.round(e*s);for(n/s<t&&++n,i/s>e&&--i,o=new Array(r=i-n+1);++a<r;)o[a]=(n+a)/s}return i&&o.reverse(),o}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return Nr(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,o=e(),s=0,a=o.length-1,l=o[s],u=o[a],h=10;for(u<l&&(r=l,l=u,u=r,r=s,s=a,a=r);h-- >0;){if((r=Vt(l,u,n))===i)return o[s]=l,o[a]=u,e(o);if(r>0)l=Math.floor(l/r)*r,u=Math.ceil(u/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,u=Math.floor(u*r)/r}i=r}return t},t}function Ir(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}const Ur=Math.PI,Or=2*Ur,jr=Or-1e-6;function Fr(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Hr(){return new Fr}Fr.prototype=Hr.prototype={constructor:Fr,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var o=this._x1,s=this._y1,a=n-t,l=i-e,u=o-t,h=s-e,c=u*u+h*h;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(c>1e-6)if(Math.abs(h*a-l*u)>1e-6&&r){var d=n-o,f=i-s,p=a*a+l*l,g=d*d+f*f,m=Math.sqrt(p),v=Math.sqrt(c),y=r*Math.tan((Ur-Math.acos((p+c-g)/(2*m*v)))/2),b=y/v,w=y/m;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+r+","+r+",0,0,"+ +(h*d>u*f)+","+(this._x1=t+w*a)+","+(this._y1=e+w*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,o){t=+t,e=+e,o=!!o;var s=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+s,u=e+a,h=1^o,c=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-u)>1e-6)&&(this._+="L"+l+","+u),n&&(c<0&&(c=c%Or+Or),c>jr?this._+="A"+n+","+n+",0,1,"+h+","+(t-s)+","+(e-a)+"A"+n+","+n+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):c>1e-6&&(this._+="A"+n+","+n+",0,"+ +(c>=Ur)+","+h+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var $r=Hr,Br=(Array.prototype.slice,function(t){return function(){return t}});function qr(t){this._context=t}qr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Vr=function(t){return new qr(t)};function Jr(t){return t[0]}function zr(t){return t[1]}var Yr=function(t,e){var n=Br(!0),i=null,r=Vr,o=null;function s(s){var a,l,u,h=(s=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(s)).length,c=!1;for(null==i&&(o=r(u=$r())),a=0;a<=h;++a)!(a<h&&n(l=s[a],a,s))===c&&((c=!c)?o.lineStart():o.lineEnd()),c&&o.point(+t(l,a,s),+e(l,a,s));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?Jr:Br(t),e="function"==typeof e?e:void 0===e?zr:Br(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Br(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Br(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:Br(!!t),s):n},s.curve=function(t){return arguments.length?(r=t,null!=i&&(o=r(i)),s):r},s.context=function(t){return arguments.length?(null==t?i=o=null:o=r(i=t),s):i},s};function Wr(){}var Xr=function(t){return null==t?Wr:function(){return this.querySelector(t)}};function Gr(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function Kr(){return[]}var Zr=function(t){return null==t?Kr:function(){return this.querySelectorAll(t)}};var Qr=function(t){return function(){return this.matches(t)}};function to(t){return function(e){return e.matches(t)}}var eo=Array.prototype.find;function no(){return this.firstElementChild}var io=Array.prototype.filter;function ro(){return Array.from(this.children)}var oo=function(t){return new Array(t.length)};function so(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}so.prototype={constructor:so,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var ao=function(t){return function(){return t}};function lo(t,e,n,i,r,o){for(var s,a=0,l=e.length,u=o.length;a<u;++a)(s=e[a])?(s.__data__=o[a],i[a]=s):n[a]=new so(t,o[a]);for(;a<l;++a)(s=e[a])&&(r[a]=s)}function uo(t,e,n,i,r,o,s){var a,l,u,h=new Map,c=e.length,d=o.length,f=new Array(c);for(a=0;a<c;++a)(l=e[a])&&(f[a]=u=s.call(l,l.__data__,a,e)+"",h.has(u)?r[a]=l:h.set(u,l));for(a=0;a<d;++a)u=s.call(t,o[a],a,o)+"",(l=h.get(u))?(i[a]=l,l.__data__=o[a],h.delete(u)):n[a]=new so(t,o[a]);for(a=0;a<c;++a)(l=e[a])&&h.get(f[a])===l&&(r[a]=l)}function ho(t){return t.__data__}function co(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function fo(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var po="http://www.w3.org/1999/xhtml",go={svg:"http://www.w3.org/2000/svg",xhtml:po,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},mo=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),go.hasOwnProperty(e)?{space:go[e],local:t}:t};function vo(t){return function(){this.removeAttribute(t)}}function yo(t){return function(){this.removeAttributeNS(t.space,t.local)}}function bo(t,e){return function(){this.setAttribute(t,e)}}function wo(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function _o(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function ko(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var Co=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function xo(t){return function(){this.style.removeProperty(t)}}function Eo(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Ao(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function So(t,e){return t.style.getPropertyValue(e)||Co(t).getComputedStyle(t,null).getPropertyValue(e)}function To(t){return function(){delete this[t]}}function Mo(t,e){return function(){this[t]=e}}function Lo(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Do(t){return t.trim().split(/^|\s+/)}function Po(t){return t.classList||new No(t)}function No(t){this._node=t,this._names=Do(t.getAttribute("class")||"")}function Ro(t,e){for(var n=Po(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function Io(t,e){for(var n=Po(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function Uo(t){return function(){Ro(this,t)}}function Oo(t){return function(){Io(this,t)}}function jo(t,e){return function(){(e.apply(this,arguments)?Ro:Io)(this,t)}}No.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Fo(){this.textContent=""}function Ho(t){return function(){this.textContent=t}}function $o(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Bo(){this.innerHTML=""}function qo(t){return function(){this.innerHTML=t}}function Vo(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function Jo(){this.nextSibling&&this.parentNode.appendChild(this)}function zo(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yo(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===po&&e.documentElement.namespaceURI===po?e.createElement(t):e.createElementNS(n,t)}}function Wo(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var Xo=function(t){var e=mo(t);return(e.local?Wo:Yo)(e)};function Go(){return null}function Ko(){var t=this.parentNode;t&&t.removeChild(this)}function Zo(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Qo(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ts(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function es(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,o=e.length;i<o;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function ns(t,e,n){return function(){var i,r=this.__on,o=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),void(i.value=e);this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function is(t,e,n){var i=Co(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function rs(t,e){return function(){return is(this,t,e)}}function os(t,e){return function(){return is(this,t,e.apply(this,arguments))}}var ss=[null];function as(t,e){this._groups=t,this._parents=e}function ls(){return new as([[document.documentElement]],ss)}as.prototype=ls.prototype={constructor:as,select:function(t){"function"!=typeof t&&(t=Xr(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s,a=e[r],l=a.length,u=i[r]=new Array(l),h=0;h<l;++h)(o=a[h])&&(s=t.call(o,o.__data__,h,a))&&("__data__"in o&&(s.__data__=o.__data__),u[h]=s);return new as(i,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return Gr(t.apply(this,arguments))}}(t):Zr(t);for(var e=this._groups,n=e.length,i=[],r=[],o=0;o<n;++o)for(var s,a=e[o],l=a.length,u=0;u<l;++u)(s=a[u])&&(i.push(t.call(s,s.__data__,u,a)),r.push(s));return new as(i,r)},selectChild:function(t){return this.select(null==t?no:function(t){return function(){return eo.call(this.children,t)}}("function"==typeof t?t:to(t)))},selectChildren:function(t){return this.selectAll(null==t?ro:function(t){return function(){return io.call(this.children,t)}}("function"==typeof t?t:to(t)))},filter:function(t){"function"!=typeof t&&(t=Qr(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,l=i[r]=[],u=0;u<a;++u)(o=s[u])&&t.call(o,o.__data__,u,s)&&l.push(o);return new as(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,ho);var n=e?uo:lo,i=this._parents,r=this._groups;"function"!=typeof t&&(t=ao(t));for(var o=r.length,s=new Array(o),a=new Array(o),l=new Array(o),u=0;u<o;++u){var h=i[u],c=r[u],d=c.length,f=co(t.call(h,h&&h.__data__,u,i)),p=f.length,g=a[u]=new Array(p),m=s[u]=new Array(p),v=l[u]=new Array(d);n(h,c,g,m,v,f,e);for(var y,b,w=0,_=0;w<p;++w)if(y=g[w]){for(w>=_&&(_=w+1);!(b=m[_])&&++_<p;);y._next=b||null}}return(s=new as(s,i))._enter=a,s._exit=l,s},enter:function(){return new as(this._enter||this._groups.map(oo),this._parents)},exit:function(){return new as(this._exit||this._groups.map(oo),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,o=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?o.remove():n(o),i&&r?i.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,o=i.length,s=Math.min(r,o),a=new Array(r),l=0;l<s;++l)for(var u,h=n[l],c=i[l],d=h.length,f=a[l]=new Array(d),p=0;p<d;++p)(u=h[p]||c[p])&&(f[p]=u);for(;l<r;++l)a[l]=n[l];return new as(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],o=r.length-1,s=r[o];--o>=0;)(i=r[o])&&(s&&4^i.compareDocumentPosition(s)&&s.parentNode.insertBefore(i,s),s=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=fo);for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var s,a=n[o],l=a.length,u=r[o]=new Array(l),h=0;h<l;++h)(s=a[h])&&(u[h]=s);u.sort(e)}return new as(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length;r<o;++r){var s=i[r];if(s)return s}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,o=e[n],s=0,a=o.length;s<a;++s)(r=o[s])&&t.call(r,r.__data__,s,o);return this},attr:function(t,e){var n=mo(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?yo:vo:"function"==typeof e?n.local?ko:_o:n.local?wo:bo)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?xo:"function"==typeof e?Ao:Eo)(t,e,null==n?"":n)):So(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?To:"function"==typeof e?Lo:Mo)(t,e)):this.node()[t]},classed:function(t,e){var n=Do(t+"");if(arguments.length<2){for(var i=Po(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?jo:e?Uo:Oo)(n,e))},text:function(t){return arguments.length?this.each(null==t?Fo:("function"==typeof t?$o:Ho)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Bo:("function"==typeof t?Vo:qo)(t)):this.node().innerHTML},raise:function(){return this.each(Jo)},lower:function(){return this.each(zo)},append:function(t){var e="function"==typeof t?t:Xo(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:Xo(t),i=null==e?Go:"function"==typeof e?e:Xr(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each(Ko)},clone:function(t){return this.select(t?Qo:Zo)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,o=ts(t+""),s=o.length;if(!(arguments.length<2)){for(a=e?ns:es,i=0;i<s;++i)this.each(a(o[i],e,n));return this}var a=this.node().__on;if(a)for(var l,u=0,h=a.length;u<h;++u)for(i=0,l=a[u];i<s;++i)if((r=o[i]).type===l.type&&r.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?os:rs)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,r=t[e],o=0,s=r.length;o<s;++o)(i=r[o])&&(yield i)}};var us=ls,hs={value:()=>{}};function cs(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new ds(i)}function ds(t){this._=t}function fs(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",i=t.indexOf(".");if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function ps(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function gs(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=hs,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}ds.prototype=cs.prototype={constructor:ds,on:function(t,e){var n,i=this._,r=fs(t+"",i),o=-1,s=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=r[o]).type)i[n]=gs(i[n],t.name,e);else if(null==e)for(n in i)i[n]=gs(i[n],t.name,null);return this}for(;++o<s;)if((n=(t=r[o]).type)&&(n=ps(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ds(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(i=this._[t]).length;o<n;++o)i[o].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};var ms,vs,ys=cs,bs=0,ws=0,_s=0,ks=0,Cs=0,xs=0,Es="object"==typeof performance&&performance.now?performance:Date,As="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ss(){return Cs||(As(Ts),Cs=Es.now()+xs)}function Ts(){Cs=0}function Ms(){this._call=this._time=this._next=null}function Ls(t,e,n){var i=new Ms;return i.restart(t,e,n),i}function Ds(){Cs=(ks=Es.now())+xs,bs=ws=0;try{!function(){Ss(),++bs;for(var t,e=ms;e;)(t=Cs-e._time)>=0&&e._call.call(void 0,t),e=e._next;--bs}()}finally{bs=0,function(){var t,e,n=ms,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:ms=e);vs=t,Ns(i)}(),Cs=0}}function Ps(){var t=Es.now(),e=t-ks;e>1e3&&(xs-=e,ks=t)}function Ns(t){bs||(ws&&(ws=clearTimeout(ws)),t-Cs>24?(t<1/0&&(ws=setTimeout(Ds,t-Es.now()-xs)),_s&&(_s=clearInterval(_s))):(_s||(ks=Es.now(),_s=setInterval(Ps,1e3)),bs=1,As(Ds)))}Ms.prototype=Ls.prototype={constructor:Ms,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Ss():+n)+(null==e?0:+e),this._next||vs===this||(vs?vs._next=this:ms=this,vs=this),this._call=t,this._time=n,Ns()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ns())}};var Rs=function(t,e,n){var i=new Ms;return e=null==e?0:+e,i.restart(n=>{i.stop(),t(n+e)},e,n),i},Is=ys("start","end","cancel","interrupt"),Us=[],Os=function(t,e,n,i,r,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function o(l){var u,h,c,d;if(1!==n.state)return a();for(u in r)if((d=r[u]).name===n.name){if(3===d.state)return Rs(o);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[u]):+u<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[u])}if(Rs((function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(l))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(c=n.tween.length),u=0,h=-1;u<c;++u)(d=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++h]=d);i.length=h+1}}function s(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(a),n.state=5,1),o=-1,s=i.length;++o<s;)i[o].call(t,r);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),a())}function a(){for(var i in n.state=6,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=Ls((function(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}),0,n.time)}(t,n,{name:e,index:i,group:r,on:Is,tween:Us,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})};function js(t,e){var n=Hs(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function Fs(t,e){var n=Hs(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Hs(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var $s,Bs=180/Math.PI,qs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},Vs=function(t,e,n,i,r,o){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:r,translateY:o,rotate:Math.atan2(e,t)*Bs,skewX:Math.atan(l)*Bs,scaleX:s,scaleY:a}};function Js(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}return function(o,s){var a=[],l=[];return o=t(o),s=t(s),function(t,i,r,o,s,a){if(t!==r||i!==o){var l=s.push("translate(",null,e,null,n);a.push({i:l-4,x:Zi(t,r)},{i:l-2,x:Zi(i,o)})}else(r||o)&&s.push("translate("+r+e+o+n)}(o.translateX,o.translateY,s.translateX,s.translateY,a,l),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:Zi(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(o.rotate,s.rotate,a,l),function(t,e,n,o){t!==e?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:Zi(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(o.skewX,s.skewX,a,l),function(t,e,n,i,o,s){if(t!==n||e!==i){var a=o.push(r(o)+"scale(",null,",",null,")");s.push({i:a-4,x:Zi(t,n)},{i:a-2,x:Zi(e,i)})}else 1===n&&1===i||o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,l),o=s=null,function(t){for(var e,n=-1,i=l.length;++n<i;)a[(e=l[n]).i]=e.x(t);return a.join("")}}}var zs=Js((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?qs:Vs(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Ys=Js((function(t){return null==t?qs:($s||($s=document.createElementNS("http://www.w3.org/2000/svg","g")),$s.setAttribute("transform",t),(t=$s.transform.baseVal.consolidate())?(t=t.matrix,Vs(t.a,t.b,t.c,t.d,t.e,t.f)):qs)}),", ",")",")");function Ws(t,e){var n,i;return function(){var r=Fs(this,t),o=r.tween;if(o!==n)for(var s=0,a=(i=n=o).length;s<a;++s)if(i[s].name===e){(i=i.slice()).splice(s,1);break}r.tween=i}}function Xs(t,e,n){var i,r;if("function"!=typeof n)throw new Error;return function(){var o=Fs(this,t),s=o.tween;if(s!==i){r=(i=s).slice();for(var a={name:e,value:n},l=0,u=r.length;l<u;++l)if(r[l].name===e){r[l]=a;break}l===u&&r.push(a)}o.tween=r}}function Gs(t,e,n){var i=t._id;return t.each((function(){var t=Fs(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Hs(t,i).value[e]}}var Ks=function(t,e){var n;return("number"==typeof e?Zi:e instanceof Ti?zi:(n=Ti(e))?(e=n,zi):nr)(t,e)};function Zs(t){return function(){this.removeAttribute(t)}}function Qs(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ta(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttribute(t);return s===o?null:s===i?r:r=e(i=s,n)}}function ea(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===i?r:r=e(i=s,n)}}function na(t,e,n){var i,r,o;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttribute(t))===(a=l+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,l));this.removeAttribute(t)}}function ia(t,e,n){var i,r,o;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,l));this.removeAttributeNS(t.space,t.local)}}function ra(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function oa(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function sa(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&oa(t,r)),n}return r._value=e,r}function aa(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&ra(t,r)),n}return r._value=e,r}function la(t,e){return function(){js(this,t).delay=+e.apply(this,arguments)}}function ua(t,e){return e=+e,function(){js(this,t).delay=e}}function ha(t,e){return function(){Fs(this,t).duration=+e.apply(this,arguments)}}function ca(t,e){return e=+e,function(){Fs(this,t).duration=e}}function da(t,e){if("function"!=typeof e)throw new Error;return function(){Fs(this,t).ease=e}}function fa(t,e,n){var i,r,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?js:Fs;return function(){var s=o(this,t),a=s.on;a!==i&&(r=(i=a).copy()).on(e,n),s.on=r}}var pa=us.prototype.constructor;function ga(t){return function(){this.style.removeProperty(t)}}function ma(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function va(t,e,n){var i,r;function o(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&ma(t,o,n)),i}return o._value=e,o}function ya(t){return function(e){this.textContent=t.call(this,e)}}function ba(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&ya(i)),e}return i._value=t,i}var wa=0;function _a(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function ka(){return++wa}var Ca=us.prototype;_a.prototype=function(t){return us().transition(t)}.prototype={constructor:_a,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Xr(t));for(var i=this._groups,r=i.length,o=new Array(r),s=0;s<r;++s)for(var a,l,u=i[s],h=u.length,c=o[s]=new Array(h),d=0;d<h;++d)(a=u[d])&&(l=t.call(a,a.__data__,d,u))&&("__data__"in a&&(l.__data__=a.__data__),c[d]=l,Os(c[d],e,n,d,c,Hs(a,n)));return new _a(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Zr(t));for(var i=this._groups,r=i.length,o=[],s=[],a=0;a<r;++a)for(var l,u=i[a],h=u.length,c=0;c<h;++c)if(l=u[c]){for(var d,f=t.call(l,l.__data__,c,u),p=Hs(l,n),g=0,m=f.length;g<m;++g)(d=f[g])&&Os(d,e,n,g,f,p);o.push(f),s.push(l)}return new _a(o,s,e,n)},selectChild:Ca.selectChild,selectChildren:Ca.selectChildren,filter:function(t){"function"!=typeof t&&(t=Qr(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,l=i[r]=[],u=0;u<a;++u)(o=s[u])&&t.call(o,o.__data__,u,s)&&l.push(o);return new _a(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,o=Math.min(i,r),s=new Array(i),a=0;a<o;++a)for(var l,u=e[a],h=n[a],c=u.length,d=s[a]=new Array(c),f=0;f<c;++f)(l=u[f]||h[f])&&(d[f]=l);for(;a<i;++a)s[a]=e[a];return new _a(s,this._parents,this._name,this._id)},selection:function(){return new pa(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=ka(),i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],l=a.length,u=0;u<l;++u)if(s=a[u]){var h=Hs(s,e);Os(s,t,n,u,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new _a(i,this._parents,t,n)},call:Ca.call,nodes:Ca.nodes,node:Ca.node,size:Ca.size,empty:Ca.empty,each:Ca.each,on:function(t,e){var n=this._id;return arguments.length<2?Hs(this.node(),n).on.on(t):this.each(fa(n,t,e))},attr:function(t,e){var n=mo(t),i="transform"===n?Ys:Ks;return this.attrTween(t,"function"==typeof e?(n.local?ia:na)(n,i,Gs(this,"attr."+t,e)):null==e?(n.local?Qs:Zs)(n):(n.local?ea:ta)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=mo(t);return this.tween(n,(i.local?sa:aa)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?zs:Ks;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var o=So(this,t),s=(this.style.removeProperty(t),So(this,t));return o===s?null:o===n&&s===i?r:r=e(n=o,i=s)}}(t,i)).on("end.style."+t,ga(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,o;return function(){var s=So(this,t),a=n(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=So(this,t)),s===l?null:s===i&&l===r?o:(r=l,o=e(i=s,a))}}(t,i,Gs(this,"style."+t,e))).each(function(t,e){var n,i,r,o,s="style."+e,a="end."+s;return function(){var l=Fs(this,t),u=l.on,h=null==l.value[s]?o||(o=ga(e)):void 0;u===n&&r===h||(i=(n=u).copy()).on(a,r=h),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,o=n+"";return function(){var s=So(this,t);return s===o?null:s===i?r:r=e(i=s,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,va(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Gs(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,ba(t))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=Hs(this.node(),n).tween,o=0,s=r.length;o<s;++o)if((i=r[o]).name===t)return i.value;return null}return this.each((null==e?Ws:Xs)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?la:ua)(e,t)):Hs(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?ha:ca)(e,t)):Hs(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(da(e,t)):Hs(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;Fs(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,i=n._id,r=n.size();return new Promise((function(o,s){var a={value:s},l={value:function(){0==--r&&o()}};n.each((function(){var n=Fs(this,i),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),n.on=e})),0===r&&o()}))},[Symbol.iterator]:Ca[Symbol.iterator]};var xa={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Ea(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Aa(t){var e,n=10,i=20,r=30,o=40,s=t.clientWidth,a=(e=t,"string"==typeof e?new as([[document.querySelector(e)]],[document.documentElement]):new as([[e]],ss)).append("svg").attr("viewBox",[0,0,s,250]),l=a.append("g").attr("transform","translate(0,".concat(250-r,")")),u=a.append("g").attr("transform","translate(".concat(o,", 0)")),h=a.append("path").attr("fill","none").attr("stroke","#007200").attr("stroke-width",1.5).attr("stroke-linejoin","round").attr("stroke-linecap","round"),c=a.append("path").attr("fill","none").attr("stroke","#dc3545").attr("stroke-width",1.5).attr("stroke-linejoin","round").attr("stroke-linecap","round");return function(t){var e=function(){return pr.apply(vr(je,Fe,me,pe,se,re,ne,te,Zt,Ve).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}().domain(function(t,e){let n,i;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=i=e):(n>e&&(n=e),i<e&&(i=e)));else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(void 0===n?o>=o&&(n=i=o):(n>o&&(n=o),i<o&&(i=o)))}return[n,i]}(t,(function(t){return t.date}))).range([o,s-i]),a=jt(3,e),d=function t(){var e=fr();return e.copy=function(){return cr(e,t())},pr.apply(e,arguments),Rr(e)}().domain([0,Ir(t,(function(t){return Ir([t.processed,t.failed])}))]).range([250-r,n]).nice(),f=function(t){return jt(4,t)}(d).ticks(7),p=Yr().x((function(t){return e(t.date)})).defined((function(t){return t.defined})).y((function(t){return d(t.failed)})),g=Yr().x((function(t){return e(t.date)})).defined((function(t){return t.defined})).y((function(t){return d(t.processed)}));l.call(a),u.call(f),h.datum(t).attr("d",g),c.datum(t).attr("d",p)}}us.prototype.interrupt=function(t){return this.each((function(){!function(t,e){var n,i,r,o=t.__transition,s=!0;if(o){for(r in e=null==e?null:e+"",o)(n=o[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[r]):s=!1;s&&delete t.__transition}}(this,t)}))},us.prototype.transition=function(t){var e,n;t instanceof _a?(e=t._id,t=t._name):(e=ka(),(n=xa).time=Ss(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],l=a.length,u=0;u<l;++u)(s=a[u])&&Os(s,t,e,u,a,n||Ea(s,e));return new _a(i,this._parents,t,e)};var Sa={mounted:function(){for(var t=[],e=Number(this.el.dataset.tick),n=new Date,i=0;i<150;i++)t.unshift({date:n,processed:0,failed:0,defined:!1}),n=new Date(n-e);var r=Aa(this.el);r(t),this.handleEvent("append-point",(function(e){var n=e.processed,i=e.failed;t.shift(),t.push({date:new Date,processed:n,failed:i,defined:!0}),r(t)}))}},Ta={mounted:function(){var t=[],e=Aa(this.el);e(t),this.handleEvent("replace-points",(function(n){var i=n.points;t=i.map((function(t){return t.date=new Date(t.date),t.defined=!0,t})),e(t)}))}},Ma={mounted:function(){var t=this;this.el.addEventListener("change",(function(e){var n=Number(e.target.value);localStorage.setItem("refresh_interval",n),t.pushEventTo("#stats","refresh-interval",{interval:n})}));var e=Number(localStorage.getItem("refresh_interval"))||5;this.el.value=e,t.pushEventTo("#stats","refresh-interval",{interval:e})}};function La(t){return(La="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Da={mounted:function(){var t=this.el.textContent.trim();this.el.innerText=function(t){if("object"!=La(window.Intl)||"function"!=typeof window.Intl.RelativeTimeFormat)return t;var e,n=(new Date(t)-new Date)/1e3,i=Math.abs(n);return i<60?e="second":i<3600?(e="minute",n/=60):i<216e3?(e="hour",n/=3600):(e="day",n/=216e3),new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(Math.round(n),e)}(t)}},Pa=document.querySelector("meta[name='csrf-token']").getAttribute("content"),Na=new class{constructor(t,e,n={}){if(this.unloaded=!1,!e||"Object"===e.constructor.name)throw new Error('\n a phoenix Socket must be provided as the second argument to the LiveSocket constructor. For example:\n\n import {Socket} from "phoenix"\n import LiveSocket from "phoenix_live_view"\n let liveSocket = new LiveSocket("/live", Socket, {...})\n ');this.socket=new e(t,n),this.bindingPrefix=n.bindingPrefix||"phx-",this.opts=n,this.params=Z(n.params||{}),this.viewLogger=n.viewLogger,this.metadataCallbacks=n.metadata||{},this.defaults=Object.assign(Q(q),n.defaults||{}),this.activeElement=null,this.prevActive=null,this.silenced=!1,this.main=null,this.linkRef=1,this.roots={},this.href=window.location.href,this.pendingLink=null,this.currentLocation=Q(window.location),this.hooks=n.hooks||{},this.uploaders=n.uploaders||{},this.loaderTimeout=n.loaderTimeout||1,this.localStorage=n.localStorage||window.localStorage,this.sessionStorage=n.sessionStorage||window.sessionStorage,this.boundTopLevelEvents=!1,this.domCallbacks=Object.assign({onNodeAdded:Z(),onBeforeElUpdated:Z()},n.dom||{}),this.transitions=new Dt,window.addEventListener("pagehide",t=>{this.unloaded=!0}),this.socket.onOpen(()=>{this.isUnloaded()&&window.location.reload()})}isProfileEnabled(){return"true"===this.sessionStorage.getItem("phx:live-socket:profiling")}isDebugEnabled(){return"true"===this.sessionStorage.getItem("phx:live-socket:debug")}enableDebug(){this.sessionStorage.setItem("phx:live-socket:debug","true")}enableProfiling(){this.sessionStorage.setItem("phx:live-socket:profiling","true")}disableDebug(){this.sessionStorage.removeItem("phx:live-socket:debug")}disableProfiling(){this.sessionStorage.removeItem("phx:live-socket:profiling")}enableLatencySim(t){this.enableDebug(),console.log("latency simulator enabled for the duration of this browser session. Call disableLatencySim() to disable"),this.sessionStorage.setItem("phx:live-socket:latency-sim",t)}disableLatencySim(){this.sessionStorage.removeItem("phx:live-socket:latency-sim")}getLatencySim(){let t=this.sessionStorage.getItem("phx:live-socket:latency-sim");return t?parseInt(t):null}getSocket(){return this.socket}connect(){let t=()=>{this.joinRootViews()&&(this.bindTopLevelEvents(),this.socket.connect())};["complete","loaded","interactive"].indexOf(document.readyState)>=0?t():document.addEventListener("DOMContentLoaded",()=>t())}disconnect(t){this.socket.disconnect(t)}execJS(t,e,n=null){this.owner(t,i=>Tt.exec(n,e,i,t))}triggerDOM(t,e){this.domCallbacks[t](...e)}time(t,e){if(!this.isProfileEnabled()||!console.time)return e();console.time(t);let n=e();return console.timeEnd(t),n}log(t,e,n){if(this.viewLogger){let[i,r]=n();this.viewLogger(t,e,i,r)}else if(this.isDebugEnabled()){let[i,r]=n();((t,e,n,i)=>{t.liveSocket.isDebugEnabled()&&console.log(`${t.id} ${e}: ${n} - `,i)})(t,e,i,r)}}requestDOMUpdate(t){this.transitions.after(t)}transition(t,e,n=function(){}){this.transitions.addTransition(t,e,n)}onChannel(t,e,n){t.on(e,t=>{let e=this.getLatencySim();e?(console.log(`simulating ${e}ms of latency from server to client`),setTimeout(()=>n(t),e)):n(t)})}wrapPush(t,e,n){let i=this.getLatencySim(),r=t.joinCount;if(!i)return e.timeout?n().receive("timeout",()=>{t.joinCount!==r||t.isDestroyed()||this.reloadWithJitter(t,()=>{this.log(t,"timeout",()=>["received timeout while communicating with server. Falling back to hard refresh for recovery"])})}):n();console.log(`simulating ${i}ms of latency from client to server`);let o={receives:[],receive(t,e){this.receives.push([t,e])}};return setTimeout(()=>{t.isDestroyed()||o.receives.reduce((t,[e,n])=>t.receive(e,n),n())},i),o}reloadWithJitter(t,e){t.destroy(),this.disconnect();let[n,i]=D,r=Math.floor(Math.random()*(i-n+1))+n,o=st.updateLocal(this.localStorage,window.location.pathname,"consecutive-reloads",0,t=>t+1);e?e():this.log(t,"join",()=>[`encountered ${o} consecutive reloads`]),o>10&&(this.log(t,"join",()=>["exceeded 10 consecutive reloads. Entering failsafe mode"]),r=3e4),setTimeout(()=>{this.hasPendingLink()?window.location=this.pendingLink:window.location.reload()},r)}getHookCallbacks(t){return t&&t.startsWith("Phoenix.")?dt[t.split(".")[1]]:this.hooks[t]}isUnloaded(){return this.unloaded}isConnected(){return this.socket.isConnected()}getBindingPrefix(){return this.bindingPrefix}binding(t){return`${this.getBindingPrefix()}${t}`}channel(t,e){return this.socket.channel(t,e)}joinRootViews(){let t=!1;return lt.all(document,`${$}:not([${U}])`,e=>{if(!this.getRootById(e.id)){let t=this.newRootView(e);t.setHref(this.getHref()),t.join(),e.getAttribute("data-phx-main")&&(this.main=t)}t=!0}),t}redirect(t,e){this.disconnect(),st.redirect(t,e)}replaceMain(t,e,n=null,i=this.setPendingLink(t)){let r=this.main.el,o=lt.cloneNode(r,"");this.main.showLoader(this.loaderTimeout),this.main.destroy(),this.main=this.newRootView(o,e),this.main.setRedirect(t),this.transitionRemoves(),this.main.join((t,e)=>{1===t&&this.commitPendingLink(i)&&this.requestDOMUpdate(()=>{r.replaceWith(o),n&&n(),e()})})}transitionRemoves(t){let e=this.binding("remove");(t=t||lt.all(document,`[${e}]`)).forEach(t=>{document.body.contains(t)&&this.execJS(t,t.getAttribute(e),"remove")})}isPhxView(t){return t.getAttribute&&null!==t.getAttribute(H)}newRootView(t,e){let n=new Lt(t,this,null,e);return this.roots[n.id]=n,n}owner(t,e){let n=it(t.closest($),t=>this.getViewByEl(t))||this.main;n&&e(n)}withinOwners(t,e){this.owner(t,n=>e(n,t))}getViewByEl(t){let e=t.getAttribute(O);return it(this.getRootById(e),e=>e.getDescendentByEl(t))}getRootById(t){return this.roots[t]}destroyAllViews(){for(let t in this.roots)this.roots[t].destroy(),delete this.roots[t]}destroyViewByEl(t){let e=this.getRootById(t.getAttribute(O));e&&e.destroyDescendent(t.id)}setActiveElement(t){if(this.activeElement===t)return;this.activeElement=t;let e=()=>{t===this.activeElement&&(this.activeElement=null),t.removeEventListener("mouseup",this),t.removeEventListener("touchend",this)};t.addEventListener("mouseup",e),t.addEventListener("touchend",e)}getActiveElement(){return document.activeElement===document.body?this.activeElement||document.activeElement:document.activeElement||document.body}dropActiveElement(t){this.prevActive&&t.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,document.body.addEventListener("click",(function(){})),window.addEventListener("pageshow",t=>{t.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"},(t,e,n,i,r,o)=>{let s=i.getAttribute(this.binding("key")),a=t.key&&t.key.toLowerCase();if(s&&s.toLowerCase()!==a)return;let l={key:t.key,...this.eventMeta(e,t,i)};Tt.exec(e,r,n,i,["push",{data:l}])}),this.bind({blur:"focusout",focus:"focusin"},(t,e,n,i,r,o)=>{if(!o){let o={key:t.key,...this.eventMeta(e,t,i)};Tt.exec(e,r,n,i,["push",{data:o}])}}),this.bind({blur:"blur",focus:"focus"},(t,e,n,i,r,o,s)=>{if("window"===s){let r=this.eventMeta(e,t,i);Tt.exec(e,o,n,i,["push",{data:r}])}}),window.addEventListener("dragover",t=>t.preventDefault()),window.addEventListener("drop",t=>{t.preventDefault();let e=it(tt(t.target,this.binding("drop-target")),t=>t.getAttribute(this.binding("drop-target"))),n=e&&document.getElementById(e),i=Array.from(t.dataTransfer.files||[]);n&&!n.disabled&&0!==i.length&&n.files instanceof FileList&&(ct.trackFiles(n,i),n.dispatchEvent(new Event("input",{bubbles:!0})))}),this.on("track-uploads",t=>{let e=t.target;if(!lt.isUploadInput(e))return;let n=Array.from(t.detail.files||[]).filter(t=>t instanceof File||t instanceof Blob);ct.trackFiles(e,n),e.dispatchEvent(new Event("input",{bubbles:!0}))}))}eventMeta(t,e,n){let i=this.metadataCallbacks[t];return i?i(e,n):{}}setPendingLink(t){return this.linkRef++,this.pendingLink=t,this.linkRef}commitPendingLink(t){return this.linkRef===t&&(this.href=this.pendingLink,this.pendingLink=null,!0)}getHref(){return this.href}hasPendingLink(){return!!this.pendingLink}bind(t,e){for(let n in t){let i=t[n];this.on(i,t=>{let i=this.binding(n),r=this.binding("window-"+n),o=t.target.getAttribute&&t.target.getAttribute(i);o?this.debounce(t.target,t,()=>{this.withinOwners(t.target,i=>{e(t,n,i,t.target,o,null)})}):lt.all(document,`[${r}]`,i=>{let o=i.getAttribute(r);this.debounce(i,t,()=>{this.withinOwners(i,r=>{e(t,n,r,i,o,"window")})})})})}}bindClicks(){this.bindClick("click","click",!1),this.bindClick("mousedown","capture-click",!0)}bindClick(t,e,n){let i=this.binding(e);window.addEventListener(t,t=>{if(!this.isConnected())return;let e=null;n?e=t.target.matches(`[${i}]`)?t.target:t.target.querySelector(`[${i}]`):(e=tt(t.target,i),this.dispatchClickAway(t));let r=e&&e.getAttribute(i);r&&("#"===e.getAttribute("href")&&t.preventDefault(),this.debounce(e,t,()=>{this.withinOwners(e,n=>{Tt.exec("click",r,n,e,["push",{data:this.eventMeta("click",t,e)}])})}))},n)}dispatchClickAway(t){let e=this.binding("click-away");lt.all(document,`[${e}]`,n=>{n.isSameNode(t.target)||n.contains(t.target)||this.withinOwners(t.target,i=>{let r=n.getAttribute(e);Tt.isVisible(n)&&Tt.exec("click",r,i,t.target,["push",{data:this.eventMeta("click",t,t.target)}])})})}bindNav(){if(!st.canPushState())return;history.scrollRestoration&&(history.scrollRestoration="manual");let t=null;window.addEventListener("scroll",e=>{clearTimeout(t),t=setTimeout(()=>{st.updateCurrentState(t=>Object.assign(t,{scroll:window.scrollY}))},100)}),window.addEventListener("popstate",t=>{if(!this.registerNewLocation(window.location))return;let{type:e,id:n,root:i,scroll:r}=t.state||{},o=window.location.href;this.requestDOMUpdate(()=>{this.main.isConnected()&&"patch"===e&&n===this.main.id?this.main.pushLinkPatch(o,null):this.replaceMain(o,null,()=>{i&&this.replaceRootHistory(),"number"==typeof r&&setTimeout(()=>{window.scrollTo(0,r)},0)})})},!1),window.addEventListener("click",t=>{let e=tt(t.target,"data-phx-link"),n=e&&e.getAttribute("data-phx-link"),i=t.metaKey||t.ctrlKey||1===t.button;if(!n||!this.isConnected()||!this.main||i)return;let r=e.href,o=e.getAttribute("data-phx-link-state");t.preventDefault(),this.pendingLink!==r&&this.requestDOMUpdate(()=>{if("patch"===n)this.pushHistoryPatch(r,o,e);else{if("redirect"!==n)throw new Error('expected data-phx-link to be "patch" or "redirect", got: '+n);this.historyRedirect(r,o)}})},!1)}dispatchEvent(t,e={}){lt.dispatchEvent(window,"phx:"+t,e)}dispatchEvents(t){t.forEach(([t,e])=>this.dispatchEvent(t,e))}withPageLoading(t,e){lt.dispatchEvent(window,"phx:page-loading-start",t);let n=()=>lt.dispatchEvent(window,"phx:page-loading-stop",t);return e?e(n):n}pushHistoryPatch(t,e,n){this.withPageLoading({to:t,kind:"patch"},i=>{this.main.pushLinkPatch(t,n,n=>{this.historyPatch(t,e,n),i()})})}historyPatch(t,e,n=this.setPendingLink(t)){this.commitPendingLink(n)&&(st.pushState(e,{type:"patch",id:this.main.id},t),this.registerNewLocation(window.location))}historyRedirect(t,e,n){let i=window.scrollY;this.withPageLoading({to:t,kind:"redirect"},r=>{this.replaceMain(t,n,()=>{st.pushState(e,{type:"redirect",id:this.main.id,scroll:i},t),this.registerNewLocation(window.location),r()})})}replaceRootHistory(){st.pushState("replace",{root:!0,type:"patch",id:this.main.id})}registerNewLocation(t){let{pathname:e,search:n}=this.currentLocation;return e+n!==t.pathname+t.search&&(this.currentLocation=Q(t),!0)}bindForms(){let t=0;this.on("submit",t=>{let e=t.target.getAttribute(this.binding("submit"));e&&(t.preventDefault(),t.target.disabled=!0,this.withinOwners(t.target,n=>{Tt.exec("submit",e,n,t.target,["push",{}])}))},!1);for(let e of["change","input"])this.on(e,n=>{let i=n.target,r=i.form&&i.form.getAttribute(this.binding("change"));if(!r)return;if("number"===i.type&&i.validity&&i.validity.badInput)return;let o=t;t++;let{at:s,type:a}=lt.private(i,"prev-iteration")||{};s===o-1&&e!==a||(lt.putPrivate(i,"prev-iteration",{at:o,type:e}),this.debounce(i,n,()=>{this.withinOwners(i.form,t=>{lt.putPrivate(i,"phx-has-focused",!0),lt.isTextualInput(i)||this.setActiveElement(i),Tt.exec("change",r,t,i,["push",{_target:n.target.name}])})}))},!1)}debounce(t,e,n){let i=this.binding("debounce"),r=this.binding("throttle"),o=this.defaults.debounce.toString(),s=this.defaults.throttle.toString();lt.debounce(t,e,i,o,r,s,n)}silenceEvents(t){this.silenced=!0,t(),this.silenced=!1}on(t,e){window.addEventListener(t,t=>{this.silenced||e(t)})}}("/live",class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=e.timeout||1e4,this.transport=e.transport||s.WebSocket||S,this.establishedConnections=0,this.defaultEncoder=T.encode.bind(T),this.defaultDecoder=T.decode.bind(T),this.closeWasClean=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.transport!==S?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;o&&o.addEventListener&&(o.addEventListener("pagehide",t=>{this.conn&&(this.disconnect(),n=this.connectClock)}),o.addEventListener("pageshow",t=>{n===this.connectClock&&(n=null,this.connect())})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.rejoinAfterMs=t=>e.rejoinAfterMs?e.rejoinAfterMs(t):[1e3,2e3,5e3][t-1]||1e4,this.reconnectAfterMs=t=>e.reconnectAfterMs?e.reconnectAfterMs(t):[10,50,100,150,200,250,500,1e3,2e3][t-1]||5e3,this.logger=e.logger||null,this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=i(e.params||{}),this.endPoint=`${t}/${k}`,this.vsn=e.vsn||"2.0.0",this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new E(()=>{this.teardown(()=>this.connect())},this.reconnectAfterMs)}replaceTransport(t){this.disconnect(),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=A.appendParams(A.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==t.charAt(0)?t:"/"===t.charAt(1)?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,n){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.teardown(t,e,n)}connect(t){this.connectClock++,t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=i(t)),this.conn||(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(t,e,n){this.logger(t,e,n)}hasLogger(){return null!==this.logger}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onConnOpen(){this.hasLogger()&&this.log("transport","connected to "+this.endPointURL()),this.closeWasClean=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,t])=>t())}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.abnormalClose("heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,clearTimeout(this.heartbeatTimer),setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,n){if(!this.conn)return t&&t();this.waitForBufferDone(()=>{this.conn&&(e?this.conn.close(e,n||""):this.conn.close()),this.waitForSocketClosed(()=>{this.conn&&(this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e=1){5!==e&&this.conn&&this.conn.bufferedAmount?setTimeout(()=>{this.waitForBufferDone(t,e+1)},150*e):t()}waitForSocketClosed(t,e=1){5!==e&&this.conn&&this.conn.readyState!==h?setTimeout(()=>{this.waitForSocketClosed(t,e+1)},150*e):t()}onConnClose(t){let e=t&&t.code;this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),clearTimeout(this.heartbeatTimer),this.closeWasClean||1e3===e||this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,e])=>e(t))}onConnError(t){this.hasLogger()&&this.log("transport",t);let e=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,i])=>{i(t,e,n)}),(e===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(v)})}connectionState(){switch(this.conn&&this.conn.readyState){case a:return"connecting";case l:return"open";case u:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e.joinRef()!==t.joinRef())}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([e])=>-1===t.indexOf(e))}channel(t,e={}){let n=new class{constructor(t,e,n){this.state=c,this.topic=t,this.params=i(e||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new x(this,y,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new E(()=>{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=f,this.rejoinTimer.reset(),this.pushBuffer.forEach(t=>t.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=d,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=c,this.socket.remove(this)}),this.onError(t=>{this.socket.hasLogger()&&this.socket.log("channel","error "+this.topic,t),this.isJoining()&&this.joinPush.reset(),this.state=d,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 x(this,w,i({}),this.timeout).send(),this.state=d,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(b,(t,e)=>{this.trigger(this.replyEventName(e),t)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(t){this.on(m,t)}onError(t){return this.on(v,e=>t(e))}on(t,e){let n=this.bindingRef++;return this.bindings.push({event:t,ref:n,callback:e}),n}off(t,e){this.bindings=this.bindings.filter(n=>!(n.event===t&&(void 0===e||e===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,n=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let i=new x(this,t,(function(){return e}),n);return this.canPush()?i.send():(i.startTimeout(),this.pushBuffer.push(i)),i}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=g;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel","leave "+this.topic),this.trigger(m,"leave")},n=new x(this,w,i({}),t);return n.receive("ok",()=>e()).receive("timeout",()=>e()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(t,e,n){return e}isMember(t,e,n,i){return this.topic===t&&(!i||i===this.joinRef()||(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:n,joinRef:i}),!1))}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=p,this.joinPush.resend(t))}trigger(t,e,n,i){let r=this.onMessage(t,e,n,i);if(e&&!r)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let o=this.bindings.filter(e=>e.event===t);for(let t=0;t<o.length;t++){o[t].callback(r,n,i||this.joinRef())}}replyEventName(t){return"chan_reply_"+t}isClosed(){return this.state===c}isErrored(){return this.state===d}isJoined(){return this.state===f}isJoining(){return this.state===p}isLeaving(){return this.state===g}}(t,e,this);return this.channels.push(n),n}push(t){if(this.hasLogger()){let{topic:e,event:n,payload:i,ref:r,join_ref:o}=t;this.log("push",`${e} ${n} (${o}, ${r})`,i)}this.isConnected()?this.encode(t,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(t,t=>this.conn.send(t)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs))}abnormalClose(t){this.closeWasClean=!1,this.isConnected()&&this.conn.close(1e3,t)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,t=>{let{topic:e,event:n,payload:i,ref:r,join_ref:o}=t;r&&r===this.pendingHeartbeatRef&&(clearTimeout(this.heartbeatTimer),this.pendingHeartbeatRef=null,setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${i.status||""} ${e} ${n} ${r&&"("+r+")"||""}`,i);for(let t=0;t<this.channels.length;t++){const s=this.channels[t];s.isMember(e,n,i,o)&&s.trigger(n,i,r,o)}for(let e=0;e<this.stateChangeCallbacks.message.length;e++){let[,n]=this.stateChangeCallbacks.message[e];n(t)}})}leaveOpenTopic(t){let e=this.channels.find(e=>e.topic===t&&(e.isJoined()||e.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}},{params:{_csrf_token:Pa},hooks:{Table:{mounted:function(){var t=this.el,e=t.querySelector(".js-hidden-submit"),n=t.querySelector(".js-submit-button");t.querySelector(".js-select-all-rows").addEventListener("change",(function(){var e=this;t.querySelectorAll(".js-select-row").forEach((function(t){t.checked=e.checked}))})),t.querySelectorAll(".js-action").forEach((function(t){t.addEventListener("click",(function(){e.value=this.dataset.name,n.click()}))}))}},RealtimePlot:Sa,HistoricalPlot:Ta,Refresh:Ma,Timestamp:Da}});L.a.config({barColors:{0:"#B5179E"},shadowColor:"rgba(0, 0, 0, .3)"}),window.addEventListener("phx:page-loading-start",(function(t){return L.a.show()})),window.addEventListener("phx:page-loading-stop",(function(t){return L.a.hide()})),Na.connect(),window.liveSocket=Na}]);