Current section

Files

Jump to
supabase_surface priv static js supabase_surface.js
Raw

priv/static/js/supabase_surface.js

/*! For license information please see supabase_surface.js.LICENSE.txt */
var supabase_surface=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/js/",n(n.s=5)}([function(e,t,n){var i;(function(r,o){"use strict";!function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n<t.length&&!r.requestAnimationFrame;++n)r.requestAnimationFrame=r[t[n]+"RequestAnimationFrame"],r.cancelAnimationFrame=r[t[n]+"CancelAnimationFrame"]||r[t[n]+"CancelRequestAnimationFrame"];r.requestAnimationFrame||(r.requestAnimationFrame=function(t,n){var i=(new Date).getTime(),o=Math.max(0,16-(i-e)),a=r.setTimeout((function(){t(i+o)}),o);return e=i+o,a}),r.cancelAnimationFrame||(r.cancelAnimationFrame=function(e){clearTimeout(e)})}();var a,s,u,c,l,d={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},h=function(){a.width=r.innerWidth,a.height=5*d.barThickness;var e=a.getContext("2d");e.shadowBlur=d.shadowBlur,e.shadowColor=d.shadowColor;var t=e.createLinearGradient(0,0,a.width,0);for(var n in d.barColors)t.addColorStop(n,d.barColors[n]);e.lineWidth=d.barThickness,e.beginPath(),e.moveTo(0,d.barThickness/2),e.lineTo(Math.ceil(c*a.width),d.barThickness/2),e.strokeStyle=t,e.stroke()},f={config:function(e){for(var t in e)d.hasOwnProperty(t)&&(d[t]=e[t])},show:function(){var e,t,n,i;l||(l=!0,null!==u&&r.cancelAnimationFrame(u),a||((i=(a=o.createElement("canvas")).style).position="fixed",i.top=i.left=i.right=i.margin=i.padding=0,i.zIndex=100001,i.display="none",d.className&&a.classList.add(d.className),o.body.appendChild(a),t="resize",n=h,(e=r).addEventListener?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n),a.style.opacity=1,a.style.display="block",f.progress(0),d.autoRun&&function e(){s=r.requestAnimationFrame(e),f.progress("+"+.05*Math.pow(1-Math.sqrt(c),2))}())},progress:function(e){return void 0===e||("string"==typeof e&&(e=(e.indexOf("+")>=0||e.indexOf("-")>=0?c:0)+parseFloat(e)),c=e>1?1:e,h()),c},hide:function(){l&&(l=!1,null!=s&&(r.cancelAnimationFrame(s),s=null),function e(){if(f.progress("+.1")>=1&&(a.style.opacity-=.05,a.style.opacity<=.05))return a.style.display="none",void(u=null);u=r.requestAnimationFrame(e)}())}};"object"==typeof e.exports?e.exports=f:void 0===(i=function(){return f}.call(t,n,t,e))||(e.exports=i)}).call(this,window,document)},function(e,t,n){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){"use strict";n.r(t);var i,r="undefined"==typeof document?void 0:document,o=!!r&&"content"in r.createElement("template"),a=!!r&&r.createRange&&"createContextualFragment"in r.createRange();function s(e){return e=e.trim(),o?function(e){var t=r.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(e):a?function(e){return i||(i=r.createRange()).selectNode(r.body),i.createContextualFragment(e).childNodes[0]}(e):function(e){var t=r.createElement("body");return t.innerHTML=e,t.childNodes[0]}(e)}function u(e,t){var n,i,r=e.nodeName,o=t.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 c(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var l={OPTION:function(e,t){var n=e.parentNode;if(n){var i=n.nodeName.toUpperCase();"OPTGROUP"===i&&(i=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==i||n.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}c(e,t,"selected")},INPUT:function(e,t){c(e,t,"checked"),c(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var i=e.firstChild;if(i){var r=i.nodeValue;if(r==n||!n&&r==e.placeholder)return;i.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n,i,r=-1,o=0,a=e.firstChild;a;)if("OPTGROUP"===(i=a.nodeName&&a.nodeName.toUpperCase()))a=(n=a).firstChild;else{if("OPTION"===i){if(a.hasAttribute("selected")){r=o;break}o++}!(a=a.nextSibling)&&n&&(a=n.nextSibling,n=null)}e.selectedIndex=r}}};function d(){}function h(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}var f=function(e){return function(t,n,i){if(i||(i={}),"string"==typeof n)if("#document"===t.nodeName||"HTML"===t.nodeName||"BODY"===t.nodeName){var o=n;(n=r.createElement("html")).innerHTML=o}else n=s(n);var a=i.getNodeKey||h,c=i.onBeforeNodeAdded||d,f=i.onNodeAdded||d,v=i.onBeforeElUpdated||d,p=i.onElUpdated||d,m=i.onBeforeNodeDiscarded||d,g=i.onNodeDiscarded||d,y=i.onBeforeElChildrenUpdated||d,b=!0===i.childrenOnly,k=Object.create(null),w=[];function x(e){w.push(e)}function E(e,t,n){!1!==m(e)&&(t&&t.removeChild(e),g(e),function e(t,n){if(1===t.nodeType)for(var i=t.firstChild;i;){var r=void 0;n&&(r=a(i))?x(r):(g(i),i.firstChild&&e(i,n)),i=i.nextSibling}}(e,n))}function A(e){f(e);for(var t=e.firstChild;t;){var n=t.nextSibling,i=a(t);if(i){var r=k[i];r&&u(t,r)?(t.parentNode.replaceChild(r,t),S(r,t)):A(t)}else A(t);t=n}}function S(t,n,i){var o=a(n);if(o&&delete k[o],!i){if(!1===v(t,n))return;if(e(t,n),p(t),!1===y(t,n))return}"TEXTAREA"!==t.nodeName?function(e,t){var n,i,o,s,d,h=t.firstChild,f=e.firstChild;e:for(;h;){for(s=h.nextSibling,n=a(h);f;){if(o=f.nextSibling,h.isSameNode&&h.isSameNode(f)){h=s,f=o;continue e}i=a(f);var v=f.nodeType,p=void 0;if(v===h.nodeType&&(1===v?(n?n!==i&&((d=k[n])?o===d?p=!1:(e.insertBefore(d,f),i?x(i):E(f,e,!0),f=d):p=!1):i&&(p=!1),(p=!1!==p&&u(f,h))&&S(f,h)):3!==v&&8!=v||(p=!0,f.nodeValue!==h.nodeValue&&(f.nodeValue=h.nodeValue))),p){h=s,f=o;continue e}i?x(i):E(f,e,!0),f=o}if(n&&(d=k[n])&&u(d,h))e.appendChild(d),S(d,h);else{var m=c(h);!1!==m&&(m&&(h=m),h.actualize&&(h=h.actualize(e.ownerDocument||r)),e.appendChild(h),A(h))}h=s,f=o}!function(e,t,n){for(;t;){var i=t.nextSibling;(n=a(t))?x(n):E(t,e,!0),t=i}}(e,f,i);var g=l[e.nodeName];g&&g(e,t)}(t,n):l.TEXTAREA(t,n)}!function e(t){if(1===t.nodeType||11===t.nodeType)for(var n=t.firstChild;n;){var i=a(n);i&&(k[i]=n),e(n),n=n.nextSibling}}(t);var _=t,C=_.nodeType,P=n.nodeType;if(!b)if(1===C)1===P?u(t,n)||(g(t),_=function(e,t){for(var n=e.firstChild;n;){var i=n.nextSibling;t.appendChild(n),n=i}return t}(t,function(e,t){return t&&"http://www.w3.org/1999/xhtml"!==t?r.createElementNS(t,e):r.createElement(e)}(n.nodeName,n.namespaceURI))):_=n;else if(3===C||8===C){if(P===C)return _.nodeValue!==n.nodeValue&&(_.nodeValue=n.nodeValue),_;_=n}if(_===n)g(t);else{if(n.isSameNode&&n.isSameNode(_))return;if(S(_,n,b),w)for(var L=0,O=w.length;L<O;L++){var T=k[w[L]];T&&E(T,T.parentNode,!1)}}return!b&&_!==t&&t.parentNode&&(_.actualize&&(_=_.actualize(t.ownerDocument||r)),t.parentNode.replaceChild(_,t)),_}}((function(e,t){var n,i,r,o,a=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var s=a.length-1;s>=0;s--)i=(n=a[s]).name,r=n.namespaceURI,o=n.value,r?(i=n.localName||i,e.getAttributeNS(r,i)!==o&&("xmlns"===n.prefix&&(i=n.name),e.setAttributeNS(r,i,o))):e.getAttribute(i)!==o&&e.setAttribute(i,o);for(var u=e.attributes,c=u.length-1;c>=0;c--)i=(n=u[c]).name,(r=n.namespaceURI)?(i=n.localName||i,t.hasAttributeNS(r,i)||e.removeAttributeNS(r,i)):t.hasAttribute(i)||e.removeAttribute(i)}}));function v(e){return x(e)||m(e)||E(e)||w()}function p(e){return function(e){if(Array.isArray(e))return A(e)}(e)||m(e)||E(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(e,t){return x(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}}(e,t)||E(e,t)||w()}function w(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(e){if(Array.isArray(e))return e}function E(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function C(e,t,n){return t&&_(e.prototype,t),n&&_(e,n),e}function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"debug",(function(){return B})),n.d(t,"Rendered",(function(){return te})),n.d(t,"LiveSocket",(function(){return ne})),n.d(t,"Browser",(function(){return ie})),n.d(t,"DOM",(function(){return re})),n.d(t,"View",(function(){return se}));var L=[1e3,3e3],O="data-phx-view",T=["phx-click-loading","phx-change-loading","phx-submit-loading","phx-keydown-loading","phx-keyup-loading","phx-blur-loading","phx-focus-loading"],D="data-phx-component",I="data-phx-ref",N="data-phx-upload-ref",R="[".concat(O,"]"),j=["text","textarea","number","email","password","search","tel","url","date","time"],F=["checkbox","radio"],M="phx-",H={debounce:300,throttle:300},U=function(e,t){return console.error&&console.error(e,t)},B=function(e,t,n,i){e.liveSocket.isDebugEnabled()&&console.log("".concat(e.id," ").concat(t,": ").concat(n," - "),i)},$=function(e){return"function"==typeof e?e:function(){return e}},z=function(e){return JSON.parse(JSON.stringify(e))},J=function(e,t,n){do{if(e.matches("[".concat(t,"]")))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType&&!(n&&n.isSameNode(e)||e.matches(R)));return null},V=function(e){return null!==e&&"object"===P(e)&&!(e instanceof Array)},q=function(e){for(var t in e)return!1;return!0},W=function(e,t){return e&&t(e)},K=function(){function e(t,n,i){S(this,e),this.ref=Y.genFileRef(n),this.fileEl=t,this.file=n,this.view=i,this.meta=null,this._isCancelled=!1,this._isDone=!1,this._progress=0,this._lastProgressSent=-1,this._onDone=function(){}}return C(e,null,[{key:"isActive",value:function(e,t){var n=void 0===t._phxRef,i=e.getAttribute("data-phx-active-refs").split(",").indexOf(Y.genFileRef(t))>=0;return t.size>0&&(n||i)}},{key:"isPreflighted",value:function(e,t){return e.getAttribute("data-phx-preflighted-refs").split(",").indexOf(Y.genFileRef(t))>=0&&this.isActive(e,t)}}]),C(e,[{key:"metadata",value:function(){return this.meta}},{key:"progress",value:function(e){var t=this;this._progress=Math.floor(e),this._progress>this._lastProgressSent&&(this._progress>=100?(this._progress=100,this._lastProgressSent=100,this._isDone=!0,this.view.pushFileProgress(this.fileEl,this.ref,100,(function(){Y.untrackFile(t.fileEl,t.file),t._onDone()}))):(this._lastProgressSent=this._progress,this.view.pushFileProgress(this.fileEl,this.ref,this._progress)))}},{key:"cancel",value:function(){this._isCancelled=!0,this._isDone=!0,this._onDone()}},{key:"isDone",value:function(){return this._isDone}},{key:"error",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"failed";Y.clearFiles(this.fileEl),this.view.pushFileProgress(this.fileEl,this.ref,{error:e})}},{key:"onDone",value:function(e){this._onDone=e}},{key:"toPreflightPayload",value:function(){return{last_modified:this.file.lastModified,name:this.file.name,size:this.file.size,type:this.file.type,ref:this.ref}}},{key:"uploader",value:function(e){if(this.meta.uploader){var t=e[this.meta.uploader]||U("no uploader configured for ".concat(this.meta.uploader));return{name:this.meta.uploader,callback:t}}return{name:"channel",callback:Z}}},{key:"zipPostFlight",value:function(e){this.meta=e.entries[this.ref],this.meta||U("no preflight upload response returned with ref ".concat(this.ref),{input:this.fileEl,response:e})}}]),e}(),G={LiveFileUpload:{preflightedRefs:function(){return this.el.getAttribute("data-phx-preflighted-refs")},mounted:function(){this.preflightedWas=this.preflightedRefs()},updated:function(){var e=this.preflightedRefs();this.preflightedWas!==e&&(this.preflightedWas=e,""===e&&this.__view.cancelSubmit(this.el.form))}}};G.LiveImgPreview={mounted:function(){var e=this;this.ref=this.el.getAttribute("data-phx-entry-ref"),this.inputEl=document.getElementById(this.el.getAttribute(N)),Y.getEntryDataURL(this.inputEl,this.ref,(function(t){return e.el.src=t}))}};var X=0,Y=function(){function e(t,n,i){S(this,e),this.view=n,this.onComplete=i,this._entries=Array.from(e.filesAwaitingPreflight(t)||[]).map((function(e){return new K(t,e,n)})),this.numEntriesInProgress=this._entries.length}return C(e,null,[{key:"genFileRef",value:function(e){var t=e._phxRef;return void 0!==t?t:(e._phxRef=(X++).toString(),e._phxRef)}},{key:"getEntryDataURL",value:function(e,t,n){var i=this,r=this.activeFiles(e).find((function(e){return i.genFileRef(e)===t})),o=new FileReader;o.onload=function(e){return n(e.target.result)},o.readAsDataURL(r)}},{key:"hasUploadsInProgress",value:function(e){var t=0;return re.findUploadInputs(e).forEach((function(e){e.getAttribute("data-phx-preflighted-refs")!==e.getAttribute("data-phx-done-refs")&&t++})),t>0}},{key:"serializeUploads",value:function(e){var t=this,n={};return this.activeFiles(e,"serialize").forEach((function(i){var r={path:e.name},o=e.getAttribute(N);n[o]=n[o]||[],r.ref=t.genFileRef(i),r.name=i.name,r.type=i.type,r.size=i.size,n[o].push(r)})),n}},{key:"clearFiles",value:function(e){e.value=null,e.removeAttribute(N),re.putPrivate(e,"files",[])}},{key:"untrackFile",value:function(e,t){re.putPrivate(e,"files",re.private(e,"files").filter((function(e){return!Object.is(e,t)})))}},{key:"trackFiles",value:function(e,t){var n=this;if(null!==e.getAttribute("multiple")){var i=t.filter((function(t){return!n.activeFiles(e).find((function(e){return Object.is(e,t)}))}));re.putPrivate(e,"files",this.activeFiles(e).concat(i)),e.value=null}else re.putPrivate(e,"files",t)}},{key:"activeFileInputs",value:function(e){var t=this,n=re.findUploadInputs(e);return Array.from(n).filter((function(e){return e.files&&t.activeFiles(e).length>0}))}},{key:"activeFiles",value:function(e){return(re.private(e,"files")||[]).filter((function(t){return K.isActive(e,t)}))}},{key:"inputsAwaitingPreflight",value:function(e){var t=this,n=re.findUploadInputs(e);return Array.from(n).filter((function(e){return t.filesAwaitingPreflight(e).length>0}))}},{key:"filesAwaitingPreflight",value:function(e){return this.activeFiles(e).filter((function(t){return!K.isPreflighted(e,t)}))}}]),C(e,[{key:"entries",value:function(){return this._entries}},{key:"initAdapterUpload",value:function(e,t,n){var i=this;this._entries=this._entries.map((function(t){return t.zipPostFlight(e),t.onDone((function(){i.numEntriesInProgress--,0===i.numEntriesInProgress&&i.onComplete()})),t}));var r=this._entries.reduce((function(e,t){var i=t.uploader(n.uploaders),r=i.name,o=i.callback;return e[r]=e[r]||{callback:o,entries:[]},e[r].entries.push(t),e}),{});for(var o in r){var a=r[o];(0,a.callback)(a.entries,t,e,n)}}}]),e}(),Z=function(e,t,n,i){e.forEach((function(e){new Q(e,n.config.chunk_size,i).upload()}))},Q=function(){function e(t,n,i){S(this,e),this.liveSocket=i,this.entry=t,this.offset=0,this.chunkSize=n,this.chunkTimer=null,this.uploadChannel=i.channel("lvu:".concat(t.ref),{token:t.metadata()})}return C(e,[{key:"error",value:function(e){clearTimeout(this.chunkTimer),this.uploadChannel.leave(),this.entry.error(e)}},{key:"upload",value:function(){var e=this;this.uploadChannel.onError((function(t){return e.error(t)})),this.uploadChannel.join().receive("ok",(function(t){return e.readNextChunk()})).receive("error",(function(t){return e.error(t)}))}},{key:"isDone",value:function(){return this.offset>=this.entry.file.size}},{key:"readNextChunk",value:function(){var e=this,t=new window.FileReader,n=this.entry.file.slice(this.offset,this.chunkSize+this.offset);t.onload=function(t){if(null!==t.target.error)return U("Read error: "+t.target.error);e.offset+=t.target.result.byteLength,e.pushChunk(t.target.result)},t.readAsArrayBuffer(n)}},{key:"pushChunk",value:function(e){var t=this;this.uploadChannel.isJoined()&&this.uploadChannel.push("chunk",e).receive("ok",(function(){t.entry.progress(t.offset/t.entry.file.size*100),t.isDone()||(t.chunkTimer=setTimeout((function(){return t.readNextChunk()}),t.liveSocket.getLatencySim()||0))}))}}]),e}(),ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new FormData(e),i=[];n.forEach((function(e,t,n){e instanceof File&&i.push(t)})),i.forEach((function(e){return n.delete(e)}));var r,o=new URLSearchParams,a=function(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=E(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,r,o=!0,a=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return o=e.done,e},e:function(e){a=!0,r=e},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw r}}}}(n.entries());try{for(a.s();!(r=a.n()).done;){var s=k(r.value,2),u=s[0],c=s[1];o.append(u,c)}}catch(e){a.e(e)}finally{a.f()}for(var l in t)o.append(l,t[l]);return o.toString()},te=function(){function e(t,n){S(this,e),this.viewId=t,this.rendered={},this.mergeDiff(n)}return C(e,null,[{key:"extract",value:function(e){var t=e.r,n=e.e,i=e.t;return delete e.r,delete e.e,delete e.t,{diff:e,title:i,reply:t||null,events:n||[]}}}]),C(e,[{key:"parentViewId",value:function(){return this.viewId}},{key:"toString",value:function(e){return this.recursiveToString(this.rendered,this.rendered.c,e)}},{key:"recursiveToString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.c,n=arguments.length>2?arguments[2]:void 0,i={buffer:"",components:t,onlyCids:n=n?new Set(n):null};return this.toOutputBuffer(e,i),i.buffer}},{key:"componentCIDs",value:function(e){return Object.keys(e.c||{}).map((function(e){return parseInt(e)}))}},{key:"isComponentOnlyDiff",value:function(e){return!!e.c&&1===Object.keys(e).length}},{key:"getComponent",value:function(e,t){return e.c[t]}},{key:"mergeDiff",value:function(e){var t=e.c,n={};if(delete e.c,this.rendered=this.mutableMerge(this.rendered,e),this.rendered.c=this.rendered.c||{},t){var i=this.rendered.c;for(var r in t)t[r]=this.cachedFindComponent(r,t[r],i,t,n);for(var o in t)i[o]=t[o];e.c=t}}},{key:"cachedFindComponent",value:function(e,t,n,i,r){if(r[e])return r[e];var o,a,s,u=t.s;return"number"==typeof u?(a=(s=u>0?this.cachedFindComponent(u,i[u],n,i,r):n[-u]).s,(o=this.cloneMerge(s,t)).s=a):o=void 0!==t.s?t:this.cloneMerge(n[e]||{},t),r[e]=o,o}},{key:"mutableMerge",value:function(e,t){return void 0!==t.s?t:(this.doMutableMerge(e,t),e)}},{key:"doMutableMerge",value:function(e,t){for(var n in t){var i=t[n],r=e[n];V(i)&&void 0===i.s&&V(r)?this.doMutableMerge(r,i):e[n]=i}}},{key:"cloneMerge",value:function(e,t){var n=y(y({},e),t);for(var i in n){var r=t[i],o=e[i];V(r)&&void 0===r.s&&V(o)&&(n[i]=this.cloneMerge(o,r))}return n}},{key:"componentToString",value:function(e){return this.recursiveCIDToString(this.rendered.c,e)}},{key:"pruneCIDs",value:function(e){var t=this;e.forEach((function(e){return delete t.rendered.c[e]}))}},{key:"get",value:function(){return this.rendered}},{key:"isNewFingerprint",value:function(){return!!(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).s}},{key:"toOutputBuffer",value:function(e,t){if(e.d)return this.comprehensionToBuffer(e,t);var n=e.s;t.buffer+=n[0];for(var i=1;i<n.length;i++)this.dynamicToBuffer(e[i-1],t),t.buffer+=n[i]}},{key:"comprehensionToBuffer",value:function(e,t){for(var n=e.d,i=e.s,r=0;r<n.length;r++){var o=n[r];t.buffer+=i[0];for(var a=1;a<i.length;a++)this.dynamicToBuffer(o[a-1],t),t.buffer+=i[a]}}},{key:"dynamicToBuffer",value:function(e,t){"number"==typeof e?t.buffer+=this.recursiveCIDToString(t.components,e,t.onlyCids):V(e)?this.toOutputBuffer(e,t):t.buffer+=e}},{key:"recursiveCIDToString",value:function(e,t,n){var i=this,r=e[t]||U("no component for CID ".concat(t),e),o=document.createElement("template");o.innerHTML=this.recursiveToString(r,e,n);var a=o.content,s=n&&!n.has(t),u=k(Array.from(a.childNodes).reduce((function(e,n,r){var a=k(e,2),u=a[0],c=a[1];return n.nodeType===Node.ELEMENT_NODE?n.getAttribute(D)?[u,!0]:(n.setAttribute(D,t),n.id||(n.id="".concat(i.parentViewId(),"-").concat(t,"-").concat(r)),s&&(n.setAttribute("data-phx-skip",""),n.innerHTML=""),[!0,c]):""!==n.nodeValue.trim()?(U("only HTML element tags are allowed at the root of components.\n\n"+'got: "'.concat(n.nodeValue.trim(),'"\n\n')+"within:\n",o.innerHTML.trim()),n.replaceWith(i.createSpan(n.nodeValue,t)),[!0,c]):(n.remove(),[u,c])}),[!1,!1]),2),c=u[0],l=u[1];return c||l?!c&&l?(U("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.",o.innerHTML.trim()),o.innerHTML):o.innerHTML:(U("expected at least one HTML element tag inside a component, but the component is empty:\n",o.innerHTML.trim()),this.createSpan("",t).outerHTML)}},{key:"createSpan",value:function(e,t){var n=document.createElement("span");return n.innerText=e,n.setAttribute(D,t),n}}]),e}(),ne=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(S(this,e),this.unloaded=!1,!n||"Object"===n.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 n(t,r),this.bindingPrefix=r.bindingPrefix||M,this.opts=r,this.params=$(r.params||{}),this.viewLogger=r.viewLogger,this.metadataCallbacks=r.metadata||{},this.defaults=Object.assign(z(H),r.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=z(window.location),this.hooks=r.hooks||{},this.uploaders=r.uploaders||{},this.loaderTimeout=r.loaderTimeout||1,this.localStorage=r.localStorage||window.localStorage,this.sessionStorage=r.sessionStorage||window.sessionStorage,this.boundTopLevelEvents=!1,this.domCallbacks=Object.assign({onNodeAdded:$(),onBeforeElUpdated:$()},r.dom||{}),window.addEventListener("pagehide",(function(e){i.unloaded=!0})),this.socket.onOpen((function(){i.isUnloaded()&&window.location.reload()}))}return C(e,[{key:"isProfileEnabled",value:function(){return"true"===this.sessionStorage.getItem("phx:live-socket:profiling")}},{key:"isDebugEnabled",value:function(){return"true"===this.sessionStorage.getItem("phx:live-socket:debug")}},{key:"enableDebug",value:function(){this.sessionStorage.setItem("phx:live-socket:debug","true")}},{key:"enableProfiling",value:function(){this.sessionStorage.setItem("phx:live-socket:profiling","true")}},{key:"disableDebug",value:function(){this.sessionStorage.removeItem("phx:live-socket:debug")}},{key:"disableProfiling",value:function(){this.sessionStorage.removeItem("phx:live-socket:profiling")}},{key:"enableLatencySim",value:function(e){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",e)}},{key:"disableLatencySim",value:function(){this.sessionStorage.removeItem("phx:live-socket:latency-sim")}},{key:"getLatencySim",value:function(){var e=this.sessionStorage.getItem("phx:live-socket:latency-sim");return e?parseInt(e):null}},{key:"getSocket",value:function(){return this.socket}},{key:"connect",value:function(){var e=this,t=function(){e.joinRootViews()&&(e.bindTopLevelEvents(),e.socket.connect())};["complete","loaded","interactive"].indexOf(document.readyState)>=0?t():document.addEventListener("DOMContentLoaded",(function(){return t()}))}},{key:"disconnect",value:function(e){this.socket.disconnect(e)}},{key:"triggerDOM",value:function(e,t){var n;(n=this.domCallbacks)[e].apply(n,p(t))}},{key:"time",value:function(e,t){if(!this.isProfileEnabled()||!console.time)return t();console.time(e);var n=t();return console.timeEnd(e),n}},{key:"log",value:function(e,t,n){if(this.viewLogger){var i=k(n(),2),r=i[0],o=i[1];this.viewLogger(e,t,r,o)}else if(this.isDebugEnabled()){var a=k(n(),2),s=a[0],u=a[1];B(e,t,s,u)}}},{key:"onChannel",value:function(e,t,n){var i=this;e.on(t,(function(e){var t=i.getLatencySim();t?(console.log("simulating ".concat(t,"ms of latency from server to client")),setTimeout((function(){return n(e)}),t)):n(e)}))}},{key:"wrapPush",value:function(e,t,n){var i=this,r=this.getLatencySim(),o=e.joinCount;if(!r)return t.timeout?n().receive("timeout",(function(){e.joinCount===o&&i.reloadWithJitter(e,(function(){i.log(e,"timeout",(function(){return["received timeout while communicating with server. Falling back to hard refresh for recovery"]}))}))})):n();console.log("simulating ".concat(r,"ms of latency from client to server"));var a={receives:[],receive:function(e,t){this.receives.push([e,t])}};return setTimeout((function(){a.receives.reduce((function(e,t){var n=k(t,2),i=n[0],r=n[1];return e.receive(i,r)}),n())}),r),a}},{key:"reloadWithJitter",value:function(e,t){var n=this;e.destroy(),this.disconnect();var i=L[0],r=L[1],o=Math.floor(Math.random()*(r-i+1))+i,a=ie.updateLocal(this.localStorage,e.name(),"consecutive-reloads",0,(function(e){return e+1}));t?t():this.log(e,"join",(function(){return["encountered ".concat(a," consecutive reloads")]})),a>10&&(this.log(e,"join",(function(){return["exceeded ".concat(10," consecutive reloads. Entering failsafe mode")]})),o=3e4),setTimeout((function(){n.hasPendingLink()?window.location=n.pendingLink:window.location.reload()}),o)}},{key:"getHookCallbacks",value:function(e){return e&&e.startsWith("Phoenix.")?G[e.split(".")[1]]:this.hooks[e]}},{key:"isUnloaded",value:function(){return this.unloaded}},{key:"isConnected",value:function(){return this.socket.isConnected()}},{key:"getBindingPrefix",value:function(){return this.bindingPrefix}},{key:"binding",value:function(e){return"".concat(this.getBindingPrefix()).concat(e)}},{key:"channel",value:function(e,t){return this.socket.channel(e,t)}},{key:"joinRootViews",value:function(){var e=this,t=!1;return re.all(document,"".concat(R,":not([").concat("data-phx-parent-id","])"),(function(n){if(!e.getRootById(n.id)){var i=e.joinRootView(n,e.getHref());e.root=e.root||i,n.getAttribute("data-phx-main")&&(e.main=i)}t=!0})),t}},{key:"redirect",value:function(e,t){this.disconnect(),ie.redirect(e,t)}},{key:"replaceMain",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.setPendingLink(e),o=this.main.el;this.main.showLoader(this.loaderTimeout),this.main.destroy(),ie.fetchPage(e,(function(a,s){if(200!==a)return n.redirect(e);var u=document.createElement("template");u.innerHTML=s;var c=u.content.childNodes[0];if(!c||!n.isPhxView(c))return n.redirect(e);n.joinRootView(c,e,t,(function(e,t){1===t&&(n.commitPendingLink(r)?(o.replaceWith(e.el),n.main=e,i&&i()):e.destroy())}))}))}},{key:"isPhxView",value:function(e){return e.getAttribute&&null!==e.getAttribute(O)}},{key:"joinRootView",value:function(e,t,n,i){var r=new se(e,this,null,t,n);return this.roots[r.id]=r,r.join(i),r}},{key:"owner",value:function(e,t){var n=this,i=W(e.closest(R),(function(e){return n.getViewByEl(e)}));i&&t(i)}},{key:"withinOwners",value:function(e,t){var n=this;this.owner(e,(function(i){var r=e.getAttribute(n.binding("target"));null===r?t(i,e):i.withinTargets(r,t)}))}},{key:"getViewByEl",value:function(e){var t=e.getAttribute("data-phx-root-id");return W(this.getRootById(t),(function(t){return t.getDescendentByEl(e)}))}},{key:"getRootById",value:function(e){return this.roots[e]}},{key:"destroyAllViews",value:function(){for(var e in this.roots)this.roots[e].destroy(),delete this.roots[e]}},{key:"destroyViewByEl",value:function(e){var t=this.getRootById(e.getAttribute("data-phx-root-id"));t&&t.destroyDescendent(e.id)}},{key:"setActiveElement",value:function(e){var t=this;if(this.activeElement!==e){this.activeElement=e;var n=function(){e===t.activeElement&&(t.activeElement=null),e.removeEventListener("mouseup",t),e.removeEventListener("touchend",t)};e.addEventListener("mouseup",n),e.addEventListener("touchend",n)}}},{key:"getActiveElement",value:function(){return document.activeElement===document.body?this.activeElement||document.activeElement:document.activeElement||document.body}},{key:"dropActiveElement",value:function(e){this.prevActive&&e.ownsElement(this.prevActive)&&(this.prevActive=null)}},{key:"restorePreviouslyActiveFocus",value:function(){this.prevActive&&this.prevActive!==document.body&&this.prevActive.focus()}},{key:"blurActiveElement",value:function(){this.prevActive=this.getActiveElement(),this.prevActive!==document.body&&this.prevActive.blur()}},{key:"bindTopLevelEvents",value:function(){var e=this;this.boundTopLevelEvents||(this.boundTopLevelEvents=!0,document.body.addEventListener("click",(function(){})),window.addEventListener("pageshow",(function(t){t.persisted&&(e.getSocket().disconnect(),e.withPageLoading({to:window.location.href,kind:"redirect"}),window.location.reload())}),!0),this.bindClicks(),this.bindNav(),this.bindForms(),this.bind({keyup:"keyup",keydown:"keydown"},(function(t,n,i,r,o,a,s){var u=r.getAttribute(e.binding("key")),c=t.key&&t.key.toLowerCase();u&&u.toLowerCase()!==c||i.pushKey(r,o,n,a,y({key:t.key},e.eventMeta(n,t,r)))})),this.bind({blur:"focusout",focus:"focusin"},(function(t,n,i,r,o,a,s){s||i.pushEvent(n,r,o,a,e.eventMeta(n,t,r))})),this.bind({blur:"blur",focus:"focus"},(function(t,n,i,r,o,a,s){s&&"window"!==!s&&i.pushEvent(n,r,o,a,e.eventMeta(n,t,r))})),window.addEventListener("dragover",(function(e){return e.preventDefault()})),window.addEventListener("drop",(function(t){t.preventDefault();var n=W(J(t.target,e.binding("drop-target")),(function(t){return t.getAttribute(e.binding("drop-target"))})),i=n&&document.getElementById(n),r=Array.from(t.dataTransfer.files||[]);i&&!i.disabled&&0!==r.length&&i.files instanceof FileList&&(Y.trackFiles(i,r),i.dispatchEvent(new Event("input",{bubbles:!0})))})))}},{key:"eventMeta",value:function(e,t,n){var i=this.metadataCallbacks[e];return i?i(t,n):{}}},{key:"setPendingLink",value:function(e){return this.linkRef++,this.pendingLink=e,this.linkRef}},{key:"commitPendingLink",value:function(e){return this.linkRef===e&&(this.href=this.pendingLink,this.pendingLink=null,!0)}},{key:"getHref",value:function(){return this.href}},{key:"hasPendingLink",value:function(){return!!this.pendingLink}},{key:"bind",value:function(e,t){var n=this,i=function(i){var r=e[i];n.on(r,(function(e){var r=n.binding(i),o=n.binding("window-".concat(i)),a=e.target.getAttribute&&e.target.getAttribute(r);a?n.debounce(e.target,e,(function(){n.withinOwners(e.target,(function(n,r){t(e,i,n,e.target,r,a,null)}))})):re.all(document,"[".concat(o,"]"),(function(r){var a=r.getAttribute(o);n.debounce(r,e,(function(){n.withinOwners(r,(function(n,o){t(e,i,n,r,o,a,"window")}))}))}))}))};for(var r in e)i(r)}},{key:"bindClicks",value:function(){this.bindClick("click","click",!1),this.bindClick("mousedown","capture-click",!0)}},{key:"bindClick",value:function(e,t,n){var i=this,r=this.binding(t);window.addEventListener(e,(function(e){if(i.isConnected()){var t=null,o=(t=n?e.target.matches("[".concat(r,"]"))?e.target:e.target.querySelector("[".concat(r,"]")):J(e.target,r))&&t.getAttribute(r);o&&("#"===t.getAttribute("href")&&e.preventDefault(),i.debounce(t,e,(function(){i.withinOwners(t,(function(n,r){n.pushEvent("click",t,r,o,i.eventMeta("click",e,t))}))})))}}),n)}},{key:"bindNav",value:function(){var e=this;if(ie.canPushState()){history.scrollRestoration&&(history.scrollRestoration="manual");var t=null;window.addEventListener("scroll",(function(e){clearTimeout(t),t=setTimeout((function(){ie.updateCurrentState((function(e){return Object.assign(e,{scroll:window.scrollY})}))}),100)})),window.addEventListener("popstate",(function(t){if(e.registerNewLocation(window.location)){var n=t.state||{},i=n.type,r=n.id,o=n.root,a=n.scroll,s=window.location.href;e.main.isConnected()&&"patch"===i&&r===e.main.id?e.main.pushLinkPatch(s,null):e.replaceMain(s,null,(function(){o&&e.replaceRootHistory(),"number"==typeof a&&setTimeout((function(){window.scrollTo(0,a)}),0)}))}}),!1),window.addEventListener("click",(function(t){var n=J(t.target,"data-phx-link"),i=n&&n.getAttribute("data-phx-link"),r=t.metaKey||t.ctrlKey||1===t.button;if(i&&e.isConnected()&&e.main&&!r){var o=n.href,a=n.getAttribute("data-phx-link-state");if(t.preventDefault(),e.pendingLink!==o)if("patch"===i)e.pushHistoryPatch(o,a,n);else{if("redirect"!==i)throw new Error("expected ".concat("data-phx-link",' to be "patch" or "redirect", got: ').concat(i));e.historyRedirect(o,a)}}}),!1)}}},{key:"withPageLoading",value:function(e,t){re.dispatchEvent(window,"phx:page-loading-start",e);var n=function(){return re.dispatchEvent(window,"phx:page-loading-stop",e)};return t?t(n):n}},{key:"pushHistoryPatch",value:function(e,t,n){var i=this;this.withPageLoading({to:e,kind:"patch"},(function(r){i.main.pushLinkPatch(e,n,(function(n){i.historyPatch(e,t,n),r()}))}))}},{key:"historyPatch",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.setPendingLink(e);this.commitPendingLink(n)&&(ie.pushState(t,{type:"patch",id:this.main.id},e),this.registerNewLocation(window.location))}},{key:"historyRedirect",value:function(e,t,n){var i=this,r=window.scrollY;this.withPageLoading({to:e,kind:"redirect"},(function(o){i.replaceMain(e,n,(function(){ie.pushState(t,{type:"redirect",id:i.main.id,scroll:r},e),i.registerNewLocation(window.location),o()}))}))}},{key:"replaceRootHistory",value:function(){ie.pushState("replace",{root:!0,type:"patch",id:this.main.id})}},{key:"registerNewLocation",value:function(e){var t=this.currentLocation;return t.pathname+t.search!==e.pathname+e.search&&(this.currentLocation=z(e),!0)}},{key:"bindForms",value:function(){var e=this,t=0;this.on("submit",(function(t){var n=t.target.getAttribute(e.binding("submit"));n&&(t.preventDefault(),t.target.disabled=!0,e.withinOwners(t.target,(function(e,i){return e.submitForm(t.target,i,n)})))}),!1);for(var n=function(){var n=r[i];e.on(n,(function(i){var r=i.target,o=r.form&&r.form.getAttribute(e.binding("change"));if(o&&("number"!==r.type||!r.validity||!r.validity.badInput)){var a=t;t++;var s=re.private(r,"prev-iteration")||{},u=s.at,c=s.type;u===a-1&&n!==c||(re.putPrivate(r,"prev-iteration",{at:a,type:n}),e.debounce(r,i,(function(){e.withinOwners(r.form,(function(t,n){re.putPrivate(r,"phx-has-focused",!0),re.isTextualInput(r)||e.setActiveElement(r),t.pushInput(r,n,o,i.target)}))})))}}),!1)},i=0,r=["change","input"];i<r.length;i++)n()}},{key:"debounce",value:function(e,t,n){var i=this.binding("debounce"),r=this.binding("throttle"),o=this.defaults.debounce.toString(),a=this.defaults.throttle.toString();re.debounce(e,t,i,o,r,a,n)}},{key:"silenceEvents",value:function(e){this.silenced=!0,e(),this.silenced=!1}},{key:"on",value:function(e,t){var n=this;window.addEventListener(e,(function(e){n.silenced||t(e)}))}}]),e}(),ie={canPushState:function(){return void 0!==history.pushState},dropLocal:function(e,t,n){return e.removeItem(this.localKey(t,n))},updateLocal:function(e,t,n,i,r){var o=this.getLocal(e,t,n),a=this.localKey(t,n),s=null===o?i:r(o);return e.setItem(a,JSON.stringify(s)),s},getLocal:function(e,t,n){return JSON.parse(e.getItem(this.localKey(t,n)))},fetchPage:function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.timeout=3e4,n.setRequestHeader("content-type","text/html"),n.setRequestHeader("cache-control","max-age=0, no-cache, no-store, must-revalidate, post-check=0, pre-check=0"),n.setRequestHeader("x-requested-with","live-link"),n.onerror=function(){return t(400)},n.ontimeout=function(){return t(504)},n.onreadystatechange=function(){if(4===n.readyState){var i=new URL(e),r=i.pathname+i.search,o=W(n.getResponseHeader("x-response-url")||n.responseURL,(function(e){return new URL(e)})),a=o?o.pathname+o.search:null;return"live-link"!==n.getResponseHeader("x-requested-with")?t(400):null===o||a!=r?t(302):200!==n.status?t(n.status):void t(200,n.responseText)}},n.send()},updateCurrentState:function(e){this.canPushState()&&history.replaceState(e(history.state||{}),"",window.location.href)},pushState:function(e,t,n){if(this.canPushState()){if(n!==window.location.href){if("redirect"==t.type&&t.scroll){var i=history.state||{};i.scroll=t.scroll,history.replaceState(i,"",window.location.href)}delete t.scroll,history[e+"State"](t,"",n||null);var r=this.getHashTargetEl(window.location.hash);r?r.scrollIntoView():"redirect"===t.type&&window.scroll(0,0)}}else this.redirect(n)},setCookie:function(e,t){document.cookie="".concat(e,"=").concat(t)},getCookie:function(e){return document.cookie.replace(new RegExp("(?:(?:^|.*;s*)".concat(e,"s*=s*([^;]*).*$)|^.*$")),"$1")},redirect:function(e,t){t&&ie.setCookie("__phoenix_flash__",t+"; max-age=60000; path=/"),window.location=e},localKey:function(e,t){return"".concat(e,"-").concat(t)},getHashTargetEl:function(e){var t=e.toString().substring(1);if(""!==t)return document.getElementById(t)||document.querySelector('a[name="'.concat(t,'"]'))}},re={byId:function(e){return document.getElementById(e)||U("no id found for ".concat(e))},removeClass:function(e,t){e.classList.remove(t),0===e.classList.length&&e.removeAttribute("class")},all:function(e,t,n){var i=Array.from(e.querySelectorAll(t));return n?i.forEach(n):i},childNodeLength:function(e){var t=document.createElement("template");return t.innerHTML=e,t.content.childElementCount},isUploadInput:function(e){return"file"===e.type&&null!==e.getAttribute(N)},findUploadInputs:function(e){return this.all(e,'input[type="file"]['.concat(N,"]"))},findComponentNodeList:function(e,t){return this.filterWithinSameLiveView(this.all(e,"[".concat(D,'="').concat(t,'"]')),e)},isPhxDestroyed:function(e){return!(!e.id||!re.private(e,"destroyed"))},markPhxChildDestroyed:function(e){e.setAttribute("data-phx-session",""),this.putPrivate(e,"destroyed",!0)},findPhxChildrenInFragment:function(e,t){var n=document.createElement("template");return n.innerHTML=e,this.findPhxChildren(n.content,t)},isIgnored:function(e,t){return"ignore"===(e.getAttribute(t)||e.getAttribute("data-phx-update"))},isPhxUpdate:function(e,t,n){return e.getAttribute&&n.indexOf(e.getAttribute(t))>=0},findPhxChildren:function(e,t){return this.all(e,"".concat(R,"[").concat("data-phx-parent-id",'="').concat(t,'"]'))},findParentCIDs:function(e,t){var n=this,i=new Set(t);return t.reduce((function(t,i){var r="[".concat(D,'="').concat(i,'"] [').concat(D,"]");return n.filterWithinSameLiveView(n.all(e,r),e).map((function(e){return parseInt(e.getAttribute(D))})).forEach((function(e){return t.delete(e)})),t}),i)},filterWithinSameLiveView:function(e,t){var n=this;return t.querySelector(R)?e.filter((function(e){return n.withinSameLiveView(e,t)})):e},withinSameLiveView:function(e,t){for(;e=e.parentNode;){if(e.isSameNode(t))return!0;if(e.getAttribute(O))return!1}},private:function(e,t){return e.phxPrivate&&e.phxPrivate[t]},deletePrivate:function(e,t){e.phxPrivate&&delete e.phxPrivate[t]},putPrivate:function(e,t,n){e.phxPrivate||(e.phxPrivate={}),e.phxPrivate[t]=n},copyPrivates:function(e,t){t.phxPrivate&&(e.phxPrivate=z(t.phxPrivate))},putTitle:function(e){var t=document.querySelector("title").dataset,n=t.prefix,i=t.suffix;document.title="".concat(n||"").concat(e).concat(i||"")},debounce:function(e,t,n,i,r,o,a){var s=this,u=e.getAttribute(n),c=e.getAttribute(r);""===u&&(u=i),""===c&&(c=o);var l=u||c;switch(l){case null:return a();case"blur":return void(this.once(e,"debounce-blur")&&e.addEventListener("blur",(function(){return a()})));default:var d=parseInt(l),h=this.incCycle(e,"debounce-trigger",(function(){return c?s.deletePrivate(e,"throttled"):a()}));if(isNaN(d))return U("invalid throttle/debounce value: ".concat(l));if(c){var f=!1;if("keydown"===t.type){var v=this.private(e,"debounce-prev-key");this.putPrivate(e,"debounce-prev-key",t.key),f=v!==t.key}if(!f&&this.private(e,"throttled"))return!1;a(),this.putPrivate(e,"throttled",!0),setTimeout((function(){return s.triggerCycle(e,"debounce-trigger")}),d)}else setTimeout((function(){return s.triggerCycle(e,"debounce-trigger",h)}),d);var p=e.form;p&&this.once(p,"bind-debounce")&&p.addEventListener("submit",(function(e){Array.from(new FormData(p).entries(),(function(e){var t=k(e,2),n=t[0],i=(t[1],p.querySelector('[name="'.concat(n,'"]')));s.incCycle(i,"debounce-trigger"),s.deletePrivate(i,"throttled")}))})),this.once(e,"bind-debounce")&&e.addEventListener("blur",(function(t){return s.triggerCycle(e,"debounce-trigger")}))}},triggerCycle:function(e,t,n){var i=k(this.private(e,t),2),r=i[0],o=i[1];n||(n=r),n===r&&(this.incCycle(e,t),o())},once:function(e,t){return!0!==this.private(e,t)&&(this.putPrivate(e,t,!0),!0)},incCycle:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=k(this.private(e,t)||[0,n],2),r=i[0];return i[1],r++,this.putPrivate(e,t,[r,n]),r},discardError:function(e,t,n){var i=t.getAttribute&&t.getAttribute(n),r=i&&e.querySelector('[id="'.concat(i,'"], [name="').concat(i,'"]'));r&&(this.private(r,"phx-has-focused")||this.private(r.form,"phx-has-submitted")||t.classList.add("phx-no-feedback"))},showError:function(e,t){var n=this;(e.id||e.name)&&this.all(e.form,"[".concat(t,'="').concat(e.id,'"], [').concat(t,'="').concat(e.name,'"]'),(function(e){n.removeClass(e,"phx-no-feedback")}))},isPhxChild:function(e){return e.getAttribute&&e.getAttribute("data-phx-parent-id")},dispatchEvent:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e.dispatchEvent(i)},cloneNode:function(e,t){if(void 0===t)return e.cloneNode(!0);var n=e.cloneNode(!1);return n.innerHTML=t,n},mergeAttrs:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.exclude||[],r=n.isIgnored,o=t.attributes,a=o.length-1;a>=0;a--){var s=o[a].name;i.indexOf(s)<0&&e.setAttribute(s,t.getAttribute(s))}for(var u=e.attributes,c=u.length-1;c>=0;c--){var l=u[c].name;r?l.startsWith("data-")&&!t.hasAttribute(l)&&e.removeAttribute(l):t.hasAttribute(l)||e.removeAttribute(l)}},mergeFocusedInput:function(e,t){e instanceof HTMLSelectElement||re.mergeAttrs(e,t,{except:["value"]}),t.readOnly?e.setAttribute("readonly",!0):e.removeAttribute("readonly")},hasSelectionRange:function(e){return e.setSelectionRange&&("text"===e.type||"textarea"===e.type)},restoreFocus:function(e,t,n){if(re.isTextualInput(e)){var i=e.matches(":focus");e.readOnly&&e.blur(),i||e.focus(),this.hasSelectionRange(e)&&e.setSelectionRange(t,n)}},isFormInput:function(e){return/^(?:input|select|textarea)$/i.test(e.tagName)&&"button"!==e.type},syncAttrsToProps:function(e){e instanceof HTMLInputElement&&F.indexOf(e.type.toLocaleLowerCase())>=0&&(e.checked=null!==e.getAttribute("checked"))},isTextualInput:function(e){return j.indexOf(e.type)>=0},isNowTriggerFormExternal:function(e,t){return e.getAttribute&&null!==e.getAttribute(t)},syncPendingRef:function(e,t,n){var i=e.getAttribute(I);return null===i||(re.isFormInput(e)||null!==e.getAttribute(n)?(re.isUploadInput(e)&&re.mergeAttrs(e,t,{isIgnored:!0}),re.putPrivate(e,I,t),!1):(T.forEach((function(n){e.classList.contains(n)&&t.classList.add(n)})),t.setAttribute(I,i),!0))},cleanChildNodes:function(e,t){if(re.isPhxUpdate(e,t,["append","prepend"])){var n=[];e.childNodes.forEach((function(e){e.id||(e.nodeType===Node.TEXT_NODE&&""===e.nodeValue.trim()||U("only HTML element tags with an id are allowed inside containers with phx-update.\n\n"+'removing illegal node: "'.concat((e.outerHTML||e.nodeValue).trim(),'"\n\n')),n.push(e))})),n.forEach((function(e){return e.remove()}))}}},oe=function(){function e(t,n,i){S(this,e);var r=new Set,o=new Set(p(n.children).map((function(e){return e.id}))),a=[];Array.from(t.children).forEach((function(e){if(e.id&&(r.add(e.id),o.has(e.id))){var t=e.previousElementSibling&&e.previousElementSibling.id;a.push({elementId:e.id,previousElementId:t})}})),this.containerId=n.id,this.updateType=i,this.elementsToModify=a,this.elementIdsToAdd=p(o).filter((function(e){return!r.has(e)}))}return C(e,[{key:"perform",value:function(){var e=re.byId(this.containerId);this.elementsToModify.forEach((function(t){t.previousElementId?W(document.getElementById(t.previousElementId),(function(e){W(document.getElementById(t.elementId),(function(t){t.previousElementSibling&&t.previousElementSibling.id==e.id||e.insertAdjacentElement("afterend",t)}))})):W(document.getElementById(t.elementId),(function(t){null==t.previousElementSibling||e.insertAdjacentElement("afterbegin",t)}))})),"prepend"==this.updateType&&this.elementIdsToAdd.reverse().forEach((function(t){W(document.getElementById(t),(function(t){return e.insertAdjacentElement("afterbegin",t)}))}))}}]),e}(),ae=function(){function e(t,n,i,r,o){S(this,e),this.view=t,this.liveSocket=t.liveSocket,this.container=n,this.id=i,this.rootID=t.root.id,this.html=r,this.targetCID=o,this.cidPatch="number"==typeof this.targetCID,this.callbacks={beforeadded:[],beforeupdated:[],beforephxChildAdded:[],afteradded:[],afterupdated:[],afterdiscarded:[],afterphxChildAdded:[]}}return C(e,null,[{key:"patchEl",value:function(e,t,n){f(e,t,{childrenOnly:!1,onBeforeElUpdated:function(e,t){if(n&&n.isSameNode(e)&&re.isFormInput(e))return re.mergeFocusedInput(e,t),!1}})}}]),C(e,[{key:"before",value:function(e,t){this.callbacks["before".concat(e)].push(t)}},{key:"after",value:function(e,t){this.callbacks["after".concat(e)].push(t)}},{key:"trackBefore",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];this.callbacks["before".concat(e)].forEach((function(e){return e.apply(void 0,n)}))}},{key:"trackAfter",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];this.callbacks["after".concat(e)].forEach((function(e){return e.apply(void 0,n)}))}},{key:"markPrunableContentForRemoval",value:function(){re.all(this.container,"[phx-update=append] > *, [phx-update=prepend] > *",(function(e){e.setAttribute("data-phx-remove","")}))}},{key:"perform",value:function(){var e=this,t=this.view,n=this.liveSocket,i=this.container,r=this.html,o=this.isCIDPatch()?this.targetCIDContainer(r):i;if(!this.isCIDPatch()||o){var a=n.getActiveElement(),s=a&&re.hasSelectionRange(a)?a:{},u=s.selectionStart,c=s.selectionEnd,l=n.binding("update"),d=n.binding("feedback-for"),h=n.binding("disable-with"),v=n.binding("trigger-action"),p=[],m=[],g=[],y=null,b=n.time("premorph container prep",(function(){return e.buildDiffHTML(i,r,l,o)}));return this.trackBefore("added",i),this.trackBefore("updated",i,i),n.time("morphdom",(function(){f(o,b,{childrenOnly:null===o.getAttribute(D),getNodeKey:function(e){return re.isPhxDestroyed(e)?null:e.id},onBeforeNodeAdded:function(t){return re.discardError(o,t,d),e.trackBefore("added",t),t},onNodeAdded:function(n){re.isNowTriggerFormExternal(n,v)&&(y=n),re.isPhxChild(n)&&t.ownsElement(n)&&e.trackAfter("phxChildAdded",n),p.push(n)},onNodeDiscarded:function(t){re.isPhxChild(t)&&n.destroyViewByEl(t),e.trackAfter("discarded",t)},onBeforeNodeDiscarded:function(t){return!((!t.getAttribute||null===t.getAttribute("data-phx-remove"))&&(null!==t.parentNode&&re.isPhxUpdate(t.parentNode,l,["append","prepend"])&&t.id||e.skipCIDSibling(t)))},onElUpdated:function(e){re.isNowTriggerFormExternal(e,v)&&(y=e),m.push(e)},onBeforeElUpdated:function(t,n){if(re.cleanChildNodes(n,l),e.skipCIDSibling(n))return!1;if(re.isIgnored(t,l))return e.trackBefore("updated",t,n),re.mergeAttrs(t,n,{isIgnored:!0}),m.push(t),!1;if("number"===t.type&&t.validity&&t.validity.badInput)return!1;if(!re.syncPendingRef(t,n,h))return re.isUploadInput(t)&&(e.trackBefore("updated",t,n),m.push(t)),!1;if(re.isPhxChild(n)){var i=t.getAttribute("data-phx-session");return re.mergeAttrs(t,n,{exclude:["data-phx-static"]}),""!==i&&t.setAttribute("data-phx-session",i),t.setAttribute("data-phx-root-id",e.rootID),!1}return re.copyPrivates(n,t),re.discardError(o,n,d),a&&t.isSameNode(a)&&re.isFormInput(t)&&!e.forceFocusedSelectUpdate(t,n)?(e.trackBefore("updated",t,n),re.mergeFocusedInput(t,n),re.syncAttrsToProps(t),m.push(t),!1):(re.isPhxUpdate(n,l,["append","prepend"])&&g.push(new oe(t,n,n.getAttribute(l))),re.syncAttrsToProps(n),e.trackBefore("updated",t,n),!0)}})})),n.isDebugEnabled()&&function(){for(var e=new Set,t=document.querySelectorAll("*[id]"),n=0,i=t.length;n<i;n++)e.has(t[n].id)?console.error("Multiple IDs detected: ".concat(t[n].id,". Ensure unique element ids.")):e.add(t[n].id)}(),g.length>0&&n.time("post-morph append/prepend restoration",(function(){g.forEach((function(e){return e.perform()}))})),n.silenceEvents((function(){return re.restoreFocus(a,u,c)})),re.dispatchEvent(document,"phx:update"),p.forEach((function(t){return e.trackAfter("added",t)})),m.forEach((function(t){return e.trackAfter("updated",t)})),y&&(n.disconnect(),y.submit()),!0}}},{key:"forceFocusedSelectUpdate",value:function(e,t){var n=["select","select-one","select-multiple"].find((function(t){return t===e.type}));return!0===e.multiple||n&&e.innerHTML!=t.innerHTML}},{key:"isCIDPatch",value:function(){return this.cidPatch}},{key:"skipCIDSibling",value:function(e){return e.nodeType===Node.ELEMENT_NODE&&null!==e.getAttribute("data-phx-skip")}},{key:"targetCIDContainer",value:function(e){if(this.isCIDPatch()){var t=v(re.findComponentNodeList(this.container,this.targetCID)),n=t[0];return 0===t.slice(1).length&&1===re.childNodeLength(e)?n:n&&n.parentNode}}},{key:"buildDiffHTML",value:function(e,t,n,i){var r=this,o=this.isCIDPatch(),a=o&&i.getAttribute(D)===this.targetCID.toString();if(!o||a)return t;var s=null,u=document.createElement("template");s=re.cloneNode(i);var c=v(re.findComponentNodeList(s,this.targetCID)),l=c[0],d=c.slice(1);return u.innerHTML=t,d.forEach((function(e){return e.remove()})),Array.from(s.childNodes).forEach((function(e){e.id&&e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(D)!==r.targetCID.toString()&&(e.setAttribute("data-phx-skip",""),e.innerHTML="")})),Array.from(u.content.childNodes).forEach((function(e){return s.insertBefore(e,l)})),l.remove(),s.outerHTML}}]),e}(),se=function(){function e(t,n,i,r,o){var a=this;S(this,e),this.liveSocket=n,this.flash=o,this.parent=i,this.root=i?i.root:this,this.el=t,this.id=this.el.id,this.view=this.el.getAttribute(O),this.ref=0,this.childJoins=0,this.loaderTimer=null,this.pendingDiffs=[],this.pruningCIDs=[],this.href=r,this.joinCount=this.parent?this.parent.joinCount-1:0,this.joinPending=!0,this.destroyed=!1,this.joinCallback=function(){},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:".concat(this.id),(function(){return{url:a.href,params:a.connectParams(),session:a.getSession(),static:a.getStatic(),flash:a.flash}})),this.showLoader(this.liveSocket.loaderTimeout),this.bindChannel()}return C(e,[{key:"isMain",value:function(){return this.liveSocket.main===this}},{key:"connectParams",value:function(){var e=this.liveSocket.params(this.view),t=re.all(document,"[".concat(this.binding("track-static"),"]")).map((function(e){return e.src||e.href})).filter((function(e){return"string"==typeof e}));return t.length>0&&(e._track_static=t),e._mounts=this.joinCount,e}},{key:"name",value:function(){return this.view}},{key:"isConnected",value:function(){return this.channel.canPush()}},{key:"getSession",value:function(){return this.el.getAttribute("data-phx-session")}},{key:"getStatic",value:function(){var e=this.el.getAttribute("data-phx-static");return""===e?null:e}},{key:"destroy",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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);var n=function(){for(var n in t(),e.viewHooks)e.destroyHook(e.viewHooks[n])};re.markPhxChildDestroyed(this.el),this.log("destroyed",(function(){return["the child has been removed from the parent"]})),this.channel.leave().receive("ok",n).receive("error",n).receive("timeout",n)}},{key:"setContainerClasses",value:function(){var e;this.el.classList.remove("phx-connected","phx-disconnected","phx-error"),(e=this.el.classList).add.apply(e,arguments)}},{key:"isLoading",value:function(){return this.el.classList.contains("phx-disconnected")}},{key:"showLoader",value:function(e){var t=this;if(clearTimeout(this.loaderTimer),e)this.loaderTimer=setTimeout((function(){return t.showLoader()}),e);else{for(var n in this.viewHooks)this.viewHooks[n].__disconnected();this.setContainerClasses("phx-disconnected")}}},{key:"hideLoader",value:function(){clearTimeout(this.loaderTimer),this.setContainerClasses("phx-connected")}},{key:"triggerReconnected",value:function(){for(var e in this.viewHooks)this.viewHooks[e].__reconnected()}},{key:"log",value:function(e,t){this.liveSocket.log(this,e,t)}},{key:"withinTargets",value:function(e,t){var n=this;if(e instanceof HTMLElement)return this.liveSocket.owner(e,(function(n){return t(n,e)}));if(/^(0|[1-9]\d*)$/.test(e)){var i=re.findComponentNodeList(this.el,e);0===i.length?U("no component found matching phx-target of ".concat(e)):t(this,i[0])}else{var r=Array.from(document.querySelectorAll(e));0===r.length&&U('nothing found matching the phx-target selector "'.concat(e,'"')),r.forEach((function(e){return n.liveSocket.owner(e,(function(n){return t(n,e)}))}))}}},{key:"applyDiff",value:function(e,t,n){this.log(e,(function(){return["",z(t)]}));var i=te.extract(t),r=i.diff,o=i.reply,a=i.events,s=i.title;return s&&re.putTitle(s),n({diff:r,reply:o,events:a}),o}},{key:"onJoin",value:function(e){var t=this,n=e.rendered;this.childJoins=0,this.joinPending=!0,this.flash=null,ie.dropLocal(this.liveSocket.localStorage,this.name(),"consecutive-reloads"),this.applyDiff("mount",n,(function(n){var i=n.diff,r=n.events;t.rendered=new te(t.id,i);var o=t.renderContainer(null,"join");t.dropPendingRefs();var a=t.formsForRecovery(o);t.joinCount++,a.length>0?a.forEach((function(e,n){t.pushFormRecovery(e,(function(e){n===a.length-1&&t.onJoinComplete(e,o,r)}))})):t.onJoinComplete(e,o,r)}))}},{key:"dropPendingRefs",value:function(){re.all(this.el,"[".concat(I,"]"),(function(e){return e.removeAttribute(I)}))}},{key:"onJoinComplete",value:function(e,t,n){var i=this,r=e.live_patch;if(this.joinCount>1||this.parent&&!this.parent.isJoinPending())return this.applyJoinPatch(r,t,n);0===re.findPhxChildrenInFragment(t,this.id).filter((function(e){var t=e.id&&i.el.querySelector("#".concat(e.id)),n=t&&t.getAttribute("data-phx-static");return n&&e.setAttribute("data-phx-static",n),i.joinChild(e)})).length?this.parent?(this.root.pendingJoinOps.push([this,function(){return i.applyJoinPatch(r,t,n)}]),this.parent.ackJoin(this)):(this.onAllChildJoinsComplete(),this.applyJoinPatch(r,t,n)):this.root.pendingJoinOps.push([this,function(){return i.applyJoinPatch(r,t,n)}])}},{key:"attachTrueDocEl",value:function(){this.el=re.byId(this.id),this.el.setAttribute("data-phx-root-id",this.root.id)}},{key:"dispatchEvents",value:function(e){e.forEach((function(e){var t=k(e,2),n=t[0],i=t[1];window.dispatchEvent(new CustomEvent("phx:hook:".concat(n),{detail:i}))}))}},{key:"applyJoinPatch",value:function(e,t,n){var i=this;this.attachTrueDocEl();var r=new ae(this,this.el,this.id,t,null);if(r.markPrunableContentForRemoval(),this.performPatch(r,!1),this.joinNewChildren(),re.all(this.el,"[".concat(this.binding("hook"),"], [data-phx-").concat("hook","]"),(function(e){var t=i.addHook(e);t&&t.__mounted()})),this.joinPending=!1,this.dispatchEvents(n),this.applyPendingUpdates(),e){var o=e.kind,a=e.to;this.liveSocket.historyPatch(a,o)}this.hideLoader(),this.joinCount>1&&this.triggerReconnected(),this.stopCallback()}},{key:"triggerBeforeUpdateHook",value:function(e,t){this.liveSocket.triggerDOM("onBeforeElUpdated",[e,t]);var n=this.getHook(e),i=n&&re.isIgnored(e,this.binding("update"));if(n&&!e.isEqualNode(t)&&(!i||!function(e,t){return JSON.stringify(e)===JSON.stringify(t)}(e.dataset,t.dataset)))return n.__beforeUpdate(),n}},{key:"performPatch",value:function(e,t){var n=this,i=[],r=!1,o=new Set;return e.after("added",(function(e){n.liveSocket.triggerDOM("onNodeAdded",[e]);var t=n.addHook(e);t&&t.__mounted()})),e.after("phxChildAdded",(function(e){return r=!0})),e.before("updated",(function(e,t){n.triggerBeforeUpdateHook(e,t)&&o.add(e.id)})),e.after("updated",(function(e){o.has(e.id)&&n.getHook(e).__updated()})),e.after("discarded",(function(e){var t=n.componentID(e);"number"==typeof t&&-1===i.indexOf(t)&&i.push(t);var r=n.getHook(e);r&&n.destroyHook(r)})),e.perform(),t&&this.maybePushComponentsDestroyed(i),r}},{key:"joinNewChildren",value:function(){var e=this;re.findPhxChildren(this.el,this.id).forEach((function(t){return e.joinChild(t)}))}},{key:"getChildById",value:function(e){return this.root.children[this.id][e]}},{key:"getDescendentByEl",value:function(e){return e.id===this.id?this:this.children[e.getAttribute("data-phx-parent-id")][e.id]}},{key:"destroyDescendent",value:function(e){for(var t in this.root.children)for(var n in this.root.children[t])if(n===e)return this.root.children[t][n].destroy()}},{key:"joinChild",value:function(t){if(!this.getChildById(t.id)){var n=new e(t,this.liveSocket,this);return this.root.children[this.id][n.id]=n,n.join(),this.childJoins++,!0}}},{key:"isJoinPending",value:function(){return this.joinPending}},{key:"ackJoin",value:function(e){this.childJoins--,0===this.childJoins&&(this.parent?this.parent.ackJoin(this):this.onAllChildJoinsComplete())}},{key:"onAllChildJoinsComplete",value:function(){this.joinCallback(),this.pendingJoinOps.forEach((function(e){var t=k(e,2),n=t[0],i=t[1];n.isDestroyed()||i()})),this.pendingJoinOps=[]}},{key:"update",value:function(e,t){var n=this;if(this.isJoinPending()||this.liveSocket.hasPendingLink())return this.pendingDiffs.push({diff:e,events:t});this.rendered.mergeDiff(e);var i=!1;this.rendered.isComponentOnlyDiff(e)?this.liveSocket.time("component patch complete",(function(){re.findParentCIDs(n.el,n.rendered.componentCIDs(e)).forEach((function(t){n.componentPatch(n.rendered.getComponent(e,t),t)&&(i=!0)}))})):q(e)||this.liveSocket.time("full patch complete",(function(){var t=n.renderContainer(e,"update"),r=new ae(n,n.el,n.id,t,null);i=n.performPatch(r,!0)})),this.dispatchEvents(t),i&&this.joinNewChildren()}},{key:"renderContainer",value:function(e,t){var n=this;return this.liveSocket.time("toString diff (".concat(t,")"),(function(){var t=n.el.tagName,i=e?n.rendered.componentCIDs(e).concat(n.pruningCIDs):null,r=n.rendered.toString(i);return"<".concat(t,">").concat(r,"</").concat(t,">")}))}},{key:"componentPatch",value:function(e,t){if(q(e))return!1;var n=this.rendered.componentToString(t),i=new ae(this,this.el,this.id,n,t);return this.performPatch(i,!0)}},{key:"getHook",value:function(e){return this.viewHooks[ce.elementID(e)]}},{key:"addHook",value:function(e){if(!ce.elementID(e)&&e.getAttribute){var t=e.getAttribute("data-phx-".concat("hook"))||e.getAttribute(this.binding("hook"));if(!t||this.ownsElement(e)){var n=this.liveSocket.getHookCallbacks(t);if(n){e.id||U('no DOM ID for hook "'.concat(t,'". Hooks require a unique ID on each element.'),e);var i=new ce(this,e,n);return this.viewHooks[ce.elementID(i.el)]=i,i}null!==t&&U('unknown hook found for "'.concat(t,'"'),e)}}}},{key:"destroyHook",value:function(e){e.__destroyed(),e.__cleanup__(),delete this.viewHooks[ce.elementID(e.el)]}},{key:"applyPendingUpdates",value:function(){var e=this;this.pendingDiffs.forEach((function(t){var n=t.diff,i=t.events;return e.update(n,i)})),this.pendingDiffs=[]}},{key:"onChannel",value:function(e,t){var n=this;this.liveSocket.onChannel(this.channel,e,(function(e){n.isJoinPending()?n.root.pendingJoinOps.push([n,function(){return t(e)}]):t(e)}))}},{key:"bindChannel",value:function(){var e=this;this.liveSocket.onChannel(this.channel,"diff",(function(t){e.applyDiff("update",t,(function(t){var n=t.diff,i=t.events;return e.update(n,i)}))})),this.onChannel("redirect",(function(t){var n=t.to,i=t.flash;return e.onRedirect({to:n,flash:i})})),this.onChannel("live_patch",(function(t){return e.onLivePatch(t)})),this.onChannel("live_redirect",(function(t){return e.onLiveRedirect(t)})),this.channel.onError((function(t){return e.onError(t)})),this.channel.onClose((function(t){return e.onClose(t)}))}},{key:"destroyAllChildren",value:function(){for(var e in this.root.children[this.id])this.getChildById(e).destroy()}},{key:"onLiveRedirect",value:function(e){var t=e.to,n=e.kind,i=e.flash,r=this.expandURL(t);this.liveSocket.historyRedirect(r,n,i)}},{key:"onLivePatch",value:function(e){var t=e.to,n=e.kind;this.href=this.expandURL(t),this.liveSocket.historyPatch(t,n)}},{key:"expandURL",value:function(e){return e.startsWith("/")?"".concat(window.location.protocol,"//").concat(window.location.host).concat(e):e}},{key:"onRedirect",value:function(e){var t=e.to,n=e.flash;this.liveSocket.redirect(t,n)}},{key:"isDestroyed",value:function(){return this.destroyed}},{key:"join",value:function(e){var t=this;this.parent||(this.stopCallback=this.liveSocket.withPageLoading({to:this.href,kind:"initial"})),this.joinCallback=function(){return e&&e(t,t.joinCount)},this.liveSocket.wrapPush(this,{timeout:!1},(function(){return t.channel.join().receive("ok",(function(e){return t.onJoin(e)})).receive("error",(function(e){return t.onJoinError(e)})).receive("timeout",(function(){return t.onJoinError({reason:"timeout"})}))}))}},{key:"onJoinError",value:function(e){return(e.redirect||e.live_redirect)&&(this.joinPending=!1,this.channel.leave()),e.redirect?this.onRedirect(e.redirect):e.live_redirect?this.onLiveRedirect(e.live_redirect):(this.log("error",(function(){return["unable to join",e]})),this.liveSocket.reloadWithJitter(this))}},{key:"onClose",value:function(e){if(!this.isDestroyed()){if(this.isJoinPending()&&"hidden"!==document.visibilityState||this.liveSocket.hasPendingLink()&&"leave"!==e)return this.liveSocket.reloadWithJitter(this);this.destroyAllChildren(),this.liveSocket.dropActiveElement(this),document.activeElement&&document.activeElement.blur(),this.liveSocket.isUnloaded()&&this.showLoader(200)}}},{key:"onError",value:function(e){this.onClose(e),this.log("error",(function(){return["view crashed",e]})),this.liveSocket.isUnloaded()||this.displayError()}},{key:"displayError",value:function(){this.isMain()&&re.dispatchEvent(window,"phx:page-loading-start",{to:this.href,kind:"error"}),this.showLoader(),this.setContainerClasses("phx-disconnected","phx-error")}},{key:"pushWithReply",value:function(e,t,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){};if(this.isConnected()){var o=k(e?e():[null,[]],2),a=o[0],s=k(o[1],1)[0],u=function(){};return s&&null!==s.getAttribute(this.binding("page-loading"))&&(u=this.liveSocket.withPageLoading({kind:"element",target:s})),"number"!=typeof n.cid&&delete n.cid,this.liveSocket.wrapPush(this,{timeout:!0},(function(){return i.channel.push(t,n,3e4).receive("ok",(function(e){var t=null;null!==a&&i.undoRefs(a),e.diff&&(t=i.applyDiff("update",e.diff,(function(e){var t=e.diff,n=e.events;i.update(t,n)}))),e.redirect&&i.onRedirect(e.redirect),e.live_patch&&i.onLivePatch(e.live_patch),e.live_redirect&&i.onLiveRedirect(e.live_redirect),u(),r(e,t)}))}))}}},{key:"undoRefs",value:function(e){var t=this;re.all(this.el,"[".concat(I,'="').concat(e,'"]'),(function(e){e.removeAttribute(I),null!==e.getAttribute("data-phx-readonly")&&(e.readOnly=!1,e.removeAttribute("data-phx-readonly")),null!==e.getAttribute("data-phx-disabled")&&(e.disabled=!1,e.removeAttribute("data-phx-disabled")),T.forEach((function(t){return re.removeClass(e,t)}));var n=e.getAttribute("data-phx-disable-with-restore");null!==n&&(e.innerText=n,e.removeAttribute("data-phx-disable-with-restore"));var i=re.private(e,I);if(i){var r=t.triggerBeforeUpdateHook(e,i);ae.patchEl(e,i,t.liveSocket.getActiveElement()),r&&r.__updated(),re.deletePrivate(e,I)}}))}},{key:"putRef",value:function(e,t){var n=this.ref++,i=this.binding("disable-with");return e.forEach((function(e){e.classList.add("phx-".concat(t,"-loading")),e.setAttribute(I,n);var r=e.getAttribute(i);null!==r&&(e.getAttribute("data-phx-disable-with-restore")||e.setAttribute("data-phx-disable-with-restore",e.innerText),e.innerText=r)})),[n,e]}},{key:"componentID",value:function(e){var t=e.getAttribute&&e.getAttribute(D);return t?parseInt(t):null}},{key:"targetComponentID",value:function(e,t){return e.getAttribute(this.binding("target"))?this.closestComponentID(t):null}},{key:"closestComponentID",value:function(e){var t=this;return e?W(e.closest("[".concat(D,"]")),(function(e){return t.ownsElement(e)&&t.componentID(e)})):null}},{key:"pushHookEvent",value:function(e,t,n,i){if(!this.isConnected())return this.log("hook",(function(){return["unable to push hook event. LiveView not connected",t,n]})),!1;var r=k(this.putRef([],"hook"),2),o=r[0],a=r[1];return this.pushWithReply((function(){return[o,a]}),"event",{type:"hook",event:t,value:n,cid:this.closestComponentID(e)},(function(e,t){return i(t,o)})),o}},{key:"extractMeta",value:function(e,t){for(var n=this.binding("value-"),i=0;i<e.attributes.length;i++){var r=e.attributes[i].name;r.startsWith(n)&&(t[r.replace(n,"")]=e.getAttribute(r))}return void 0!==e.value&&(t.value=e.value,"INPUT"===e.tagName&&F.indexOf(e.type)>=0&&!e.checked&&delete t.value),t}},{key:"pushEvent",value:function(e,t,n,i,r){var o=this;this.pushWithReply((function(){return o.putRef([t],e)}),"event",{type:e,event:i,value:this.extractMeta(t,r),cid:this.targetComponentID(t,n)})}},{key:"pushKey",value:function(e,t,n,i,r){var o=this;this.pushWithReply((function(){return o.putRef([e],n)}),"event",{type:n,event:i,value:this.extractMeta(e,r),cid:this.targetComponentID(e,t)})}},{key:"pushFileProgress",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){};this.liveSocket.withinOwners(e.form,(function(r,o){r.pushWithReply(null,"progress",{event:e.getAttribute(r.binding("progress")),ref:e.getAttribute(N),entry_ref:t,progress:n,cid:r.targetComponentID(e.form,o)},i)}))}},{key:"pushInput",value:function(e,t,n,i,r){var o=this,a=this.targetComponentID(e.form,t),s=function(){return o.putRef([e,e.form],"change")},u=ee(e.form,{_target:i.name});e.files&&e.files.length>0&&Y.trackFiles(e,Array.from(e.files));var c={type:"form",event:n,value:u,uploads:Y.serializeUploads(e),cid:a};this.pushWithReply(s,"event",c,(function(n){if(re.showError(e,o.liveSocket.binding("feedback-for")),re.isUploadInput(e)&&null!==e.getAttribute("data-phx-auto-upload")){if(Y.filesAwaitingPreflight(e).length>0){var i=k(s(),2),u=i[0];i[1],o.uploadFiles(e.form,t,u,a,(function(t){r&&r(n),o.triggerAwaitingSubmit(e.form)}))}}else r&&r(n)}))}},{key:"triggerAwaitingSubmit",value:function(e){var t=this.getScheduledSubmit(e);if(t){var n=k(t,3),i=(n[0],n[1],n[2]);this.cancelSubmit(e),i()}}},{key:"getScheduledSubmit",value:function(e){return this.formSubmits.find((function(t){var n=k(t,2),i=n[0];return n[1],i.isSameNode(e)}))}},{key:"scheduleSubmit",value:function(e,t,n){if(this.getScheduledSubmit(e))return!0;this.formSubmits.push([e,t,n])}},{key:"cancelSubmit",value:function(e){var t=this;this.formSubmits=this.formSubmits.filter((function(n){var i=k(n,3),r=i[0],o=i[1];return i[2],!r.isSameNode(e)||(t.undoRefs(o),!1)}))}},{key:"pushFormSubmit",value:function(e,t,n,i){var r=this,o=function(e){return!(J(e,"".concat(r.binding("update"),"=ignore"),e.form)||J(e,"data-phx-update=ignore",e.form))},a=function(e){return e.hasAttribute(r.binding("disable-with"))},s=function(e){return"BUTTON"==e.tagName},u=function(e){return["INPUT","TEXTAREA","SELECT"].includes(e.tagName)},c=function(){var t=Array.from(e.elements),n=t.filter(a),i=t.filter(s).filter(o),c=t.filter(u).filter(o);return i.forEach((function(e){e.setAttribute("data-phx-disabled",e.disabled),e.disabled=!0})),c.forEach((function(e){e.setAttribute("data-phx-readonly",e.readOnly),e.readOnly=!0,e.files&&(e.setAttribute("data-phx-disabled",e.disabled),e.disabled=!0)})),e.setAttribute(r.binding("page-loading"),""),r.putRef([e].concat(n).concat(i).concat(c),"submit")},l=this.targetComponentID(e,t);if(Y.hasUploadsInProgress(e)){var d=k(c(),2),h=d[0];return d[1],this.scheduleSubmit(e,h,(function(){return r.pushFormSubmit(e,t,n,i)}))}if(Y.inputsAwaitingPreflight(e).length>0){var f=k(c(),2),v=f[0],p=f[1],m=function(){return[v,p]};this.uploadFiles(e,t,v,l,(function(t){var o=ee(e,{});r.pushWithReply(m,"event",{type:"form",event:n,value:o,cid:l},i)}))}else{var g=ee(e);this.pushWithReply(c,"event",{type:"form",event:n,value:g,cid:l},i)}}},{key:"uploadFiles",value:function(e,t,n,i,r){var o=this,a=this.joinCount;Y.activeFileInputs(e).forEach((function(e){var i=new Y(e,o,r);o.uploaders[e]=i;var s=i.entries().map((function(e){return e.toPreflightPayload()})),u={ref:e.getAttribute(N),entries:s,cid:o.targetComponentID(e.form,t)};o.log("upload",(function(){return["sending preflight request",u]})),o.pushWithReply(null,"allow_upload",u,(function(e){if(o.log("upload",(function(){return["got preflight response",e]})),e.error){o.undoRefs(n);var t=k(e.error,2),r=t[0],s=t[1];o.log("upload",(function(){return["error for entry ".concat(r),s]}))}else i.initAdapterUpload(e,(function(e){o.channel.onError((function(){o.joinCount===a&&e()}))}),o.liveSocket)}))}))}},{key:"pushFormRecovery",value:function(e,t){var n=this;this.liveSocket.withinOwners(e,(function(i,r){var o=e.elements[0],a=e.getAttribute(n.binding("auto-recover"))||e.getAttribute(n.binding("change"));i.pushInput(o,r,a,o,t)}))}},{key:"pushLinkPatch",value:function(e,t,n){var i=this,r=this.liveSocket.setPendingLink(e),o=t?function(){return i.putRef([t],"click")}:null;this.pushWithReply(o,"link",{url:e},(function(t){t.link_redirect?i.liveSocket.replaceMain(e,null,n,r):(i.liveSocket.commitPendingLink(r)&&(i.href=e),i.applyPendingUpdates(),n&&n(r))})).receive("timeout",(function(){return i.liveSocket.redirect(window.location.href)}))}},{key:"formsForRecovery",value:function(e){var t=this;if(0===this.joinCount)return[];var n=this.binding("change"),i=document.createElement("template");return i.innerHTML=e,re.all(this.el,"form[".concat(n,"]")).filter((function(e){return t.ownsElement(e)})).filter((function(e){return e.elements.length>0})).filter((function(e){return"ignore"!==e.getAttribute(t.binding("auto-recover"))})).filter((function(e){return i.content.querySelector("form[".concat(n,'="').concat(e.getAttribute(n),'"]'))}))}},{key:"maybePushComponentsDestroyed",value:function(e){var t,n=this,i=e.filter((function(e){return 0===re.findComponentNodeList(n.el,e).length}));i.length>0&&((t=this.pruningCIDs).push.apply(t,p(i)),this.pushWithReply(null,"cids_will_destroy",{cids:i},(function(){n.pruningCIDs=n.pruningCIDs.filter((function(e){return-1!==i.indexOf(e)}));var e=i.filter((function(e){return 0===re.findComponentNodeList(n.el,e).length}));e.length>0&&n.pushWithReply(null,"cids_destroyed",{cids:e},(function(e){n.rendered.pruneCIDs(e.cids)}))})))}},{key:"ownsElement",value:function(e){return e.getAttribute("data-phx-parent-id")===this.id||W(e.closest(R),(function(e){return e.id}))===this.id}},{key:"submitForm",value:function(e,t,n){var i=this;re.putPrivate(e,"phx-has-submitted",!0),this.liveSocket.blurActiveElement(this),this.pushFormSubmit(e,t,n,(function(){i.liveSocket.restorePreviouslyActiveFocus()}))}},{key:"binding",value:function(e){return this.liveSocket.binding(e)}}]),e}(),ue=1,ce=function(){function e(t,n,i){for(var r in S(this,e),this.__view=t,this.__liveSocket=t.liveSocket,this.__callbacks=i,this.__listeners=new Set,this.__isDisconnected=!1,this.el=n,this.viewName=t.name(),this.el.phxHookId=this.constructor.makeID(),this.__callbacks)this[r]=this.__callbacks[r]}return C(e,null,[{key:"makeID",value:function(){return ue++}},{key:"elementID",value:function(e){return e.phxHookId}}]),C(e,[{key:"__mounted",value:function(){this.mounted&&this.mounted()}},{key:"__updated",value:function(){this.updated&&this.updated()}},{key:"__beforeUpdate",value:function(){this.beforeUpdate&&this.beforeUpdate()}},{key:"__destroyed",value:function(){this.destroyed&&this.destroyed()}},{key:"__reconnected",value:function(){this.__isDisconnected&&(this.__isDisconnected=!1,this.reconnected&&this.reconnected())}},{key:"__disconnected",value:function(){this.__isDisconnected=!0,this.disconnected&&this.disconnected()}},{key:"pushEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};return this.__view.pushHookEvent(null,e,t,n)}},{key:"pushEventTo",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){};return this.__view.withinTargets(e,(function(e,r){return e.pushHookEvent(r,t,n,i)}))}},{key:"handleEvent",value:function(e,t){var n=function(n,i){return i?e:t(n.detail)};return window.addEventListener("phx:hook:".concat(e),n),this.__listeners.add(n),n}},{key:"removeHandleEvent",value:function(e){var t=e(null,!0);window.removeEventListener("phx:hook:".concat(t),e),this.__listeners.delete(e)}},{key:"__cleanup__",value:function(){var e=this;this.__listeners.forEach((function(t){return e.removeHandleEvent(t)}))}}]),e}();t.default=ne},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(function(t){t.Phoenix||(t.Phoenix={}),e.exports=t.Phoenix.LiveView=n(0)}).call(this,n(1))}])},function(e,t,n){},function(e,t,n){e.exports=function(){"use strict";function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function n(n){for(var i=1;i<arguments.length;i++){var r=null!=arguments[i]?arguments[i]:{};i%2?t(Object(r),!0).forEach((function(t){e(n,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function i(e){return Array.from(new Set(e))}function r(){return navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")}function o(e,t){return e==t}function a(e,t){"template"!==e.tagName.toLowerCase()?console.warn(`Alpine: [${t}] directive should only be added to <template> tags. See https://github.com/alpinejs/alpine#${t}`):1!==e.content.childElementCount&&console.warn(`Alpine: <template> tag with [${t}] encountered with an unexpected number of root elements. Make sure <template> has a single root element. `)}function s(e){return e.toLowerCase().replace(/-(\w)/g,(e,t)=>t.toUpperCase())}function u(e,t){var n;return function(){var i=this,r=arguments,o=function(){n=null,e.apply(i,r)};clearTimeout(n),n=setTimeout(o,t)}}const c=(e,t,n)=>{if(console.warn(`Alpine Error: "${n}"\n\nExpression: "${t}"\nElement:`,e),!r())throw Object.assign(n,{el:e,expression:t}),n};function l(e,{el:t,expression:n}){try{const i=e();return i instanceof Promise?i.catch(e=>c(t,n,e)):i}catch(e){c(t,n,e)}}function d(e,t,n,i={}){return l(()=>"function"==typeof t?t.call(n):new Function(["$data",...Object.keys(i)],`var __alpine_result; with($data) { __alpine_result = ${t} }; return __alpine_result`)(n,...Object.values(i)),{el:e,expression:t})}const h=/^x-(on|bind|data|text|html|model|if|for|show|cloak|transition|ref|spread)\b/;function f(e){const t=m(e.name);return h.test(t)}function v(e,t,n){let i=Array.from(e.attributes).filter(f).map(p),r=i.filter(e=>"spread"===e.type)[0];if(r){let n=d(e,r.expression,t.$data);i=i.concat(Object.entries(n).map(([e,t])=>p({name:e,value:t})))}return n?i.filter(e=>e.type===n):function(e){let t=["bind","model","show","catch-all"];return e.sort((e,n)=>{let i=-1===t.indexOf(e.type)?"catch-all":e.type,r=-1===t.indexOf(n.type)?"catch-all":n.type;return t.indexOf(i)-t.indexOf(r)})}(i)}function p({name:e,value:t}){const n=m(e),i=n.match(h),r=n.match(/:([a-zA-Z0-9\-:]+)/),o=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[];return{type:i?i[1]:null,value:r?r[1]:null,modifiers:o.map(e=>e.replace(".","")),expression:t}}function m(e){return e.startsWith("@")?e.replace("@","x-on:"):e.startsWith(":")?e.replace(":","x-bind:"):e}function g(e,t=Boolean){return e.split(" ").filter(t)}function y(e,t,n,i,r=!1){if(r)return t();if(e.__x_transition&&"in"===e.__x_transition.type)return;const o=v(e,i,"transition"),a=v(e,i,"show")[0];if(a&&a.modifiers.includes("transition")){let i=a.modifiers;if(i.includes("out")&&!i.includes("in"))return t();const r=i.includes("in")&&i.includes("out");i=r?i.filter((e,t)=>t<i.indexOf("out")):i,function(e,t,n,i){const r={duration:k(t,"duration",150),origin:k(t,"origin","center"),first:{opacity:0,scale:k(t,"scale",95)},second:{opacity:1,scale:100}};w(e,t,n,()=>{},i,r,"in")}(e,i,t,n)}else o.some(e=>["enter","enter-start","enter-end"].includes(e.value))?function(e,t,n,i,r){const o=g(x((n.find(e=>"enter"===e.value)||{expression:""}).expression,e,t)),a=g(x((n.find(e=>"enter-start"===e.value)||{expression:""}).expression,e,t)),s=g(x((n.find(e=>"enter-end"===e.value)||{expression:""}).expression,e,t));E(e,o,a,s,i,()=>{},"in",r)}(e,i,o,t,n):t()}function b(e,t,n,i,r=!1){if(r)return t();if(e.__x_transition&&"out"===e.__x_transition.type)return;const o=v(e,i,"transition"),a=v(e,i,"show")[0];if(a&&a.modifiers.includes("transition")){let i=a.modifiers;if(i.includes("in")&&!i.includes("out"))return t();const r=i.includes("in")&&i.includes("out");i=r?i.filter((e,t)=>t>i.indexOf("out")):i,function(e,t,n,i,r){const o={duration:n?k(t,"duration",150):k(t,"duration",150)/2,origin:k(t,"origin","center"),first:{opacity:1,scale:100},second:{opacity:0,scale:k(t,"scale",95)}};w(e,t,()=>{},i,r,o,"out")}(e,i,r,t,n)}else o.some(e=>["leave","leave-start","leave-end"].includes(e.value))?function(e,t,n,i,r){const o=g(x((n.find(e=>"leave"===e.value)||{expression:""}).expression,e,t)),a=g(x((n.find(e=>"leave-start"===e.value)||{expression:""}).expression,e,t)),s=g(x((n.find(e=>"leave-end"===e.value)||{expression:""}).expression,e,t));E(e,o,a,s,()=>{},i,"out",r)}(e,i,o,t,n):t()}function k(e,t,n){if(-1===e.indexOf(t))return n;const i=e[e.indexOf(t)+1];if(!i)return n;if("scale"===t&&!S(i))return n;if("duration"===t){let e=i.match(/([0-9]+)ms/);if(e)return e[1]}return"origin"===t&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[i,e[e.indexOf(t)+2]].join(" "):i}function w(e,t,n,i,r,o,a){e.__x_transition&&e.__x_transition.cancel&&e.__x_transition.cancel();const s=e.style.opacity,u=e.style.transform,c=e.style.transformOrigin,l=!t.includes("opacity")&&!t.includes("scale"),d=l||t.includes("opacity"),h=l||t.includes("scale"),f={start(){d&&(e.style.opacity=o.first.opacity),h&&(e.style.transform=`scale(${o.first.scale/100})`)},during(){h&&(e.style.transformOrigin=o.origin),e.style.transitionProperty=[d?"opacity":"",h?"transform":""].join(" ").trim(),e.style.transitionDuration=o.duration/1e3+"s",e.style.transitionTimingFunction="cubic-bezier(0.4, 0.0, 0.2, 1)"},show(){n()},end(){d&&(e.style.opacity=o.second.opacity),h&&(e.style.transform=`scale(${o.second.scale/100})`)},hide(){i()},cleanup(){d&&(e.style.opacity=s),h&&(e.style.transform=u),h&&(e.style.transformOrigin=c),e.style.transitionProperty=null,e.style.transitionDuration=null,e.style.transitionTimingFunction=null}};A(e,f,a,r)}const x=(e,t,n)=>"function"==typeof e?n.evaluateReturnExpression(t,e):e;function E(e,t,n,i,r,o,a,s){e.__x_transition&&e.__x_transition.cancel&&e.__x_transition.cancel();const u=e.__x_original_classes||[],c={start(){e.classList.add(...n)},during(){e.classList.add(...t)},show(){r()},end(){e.classList.remove(...n.filter(e=>!u.includes(e))),e.classList.add(...i)},hide(){o()},cleanup(){e.classList.remove(...t.filter(e=>!u.includes(e))),e.classList.remove(...i.filter(e=>!u.includes(e)))}};A(e,c,a,s)}function A(e,t,n,i){const r=_(()=>{t.hide(),e.isConnected&&t.cleanup(),delete e.__x_transition});e.__x_transition={type:n,cancel:_(()=>{i("cancelled"),r()}),finish:r,nextFrame:null},t.start(),t.during(),e.__x_transition.nextFrame=requestAnimationFrame(()=>{let n=1e3*Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""));0===n&&(n=1e3*Number(getComputedStyle(e).animationDuration.replace("s",""))),t.show(),e.__x_transition.nextFrame=requestAnimationFrame(()=>{t.end(),setTimeout(e.__x_transition.finish,n)})})}function S(e){return!Array.isArray(e)&&!isNaN(e)}function _(e){let t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}function C(e,t,i,r,o){a(t,"x-for");let s=P("function"==typeof i?e.evaluateReturnExpression(t,i):i),u=function(e,t,n,i){let r=v(t,e,"if")[0];if(r&&!e.evaluateReturnExpression(t,r.expression))return[];let o=e.evaluateReturnExpression(t,n.items,i);return S(o)&&o>=0&&(o=Array.from(Array(o).keys(),e=>e+1)),o}(e,t,s,o),c=t;u.forEach((i,a)=>{let l=function(e,t,i,r,o){let a=o?n({},o):{};return a[e.item]=t,e.index&&(a[e.index]=i),e.collection&&(a[e.collection]=r),a}(s,i,a,u,o()),d=function(e,t,n,i){let r=v(t,e,"bind").filter(e=>"key"===e.value)[0];return r?e.evaluateReturnExpression(t,r.expression,()=>i):n}(e,t,a,l),h=function(e,t){if(!e)return;if(void 0===e.__x_for_key)return;if(e.__x_for_key===t)return e;let n=e;for(;n;){if(n.__x_for_key===t)return n.parentElement.insertBefore(n,e);n=!(!n.nextElementSibling||void 0===n.nextElementSibling.__x_for_key)&&n.nextElementSibling}}(c.nextElementSibling,d);h?(delete h.__x_for_key,h.__x_for=l,e.updateElements(h,()=>h.__x_for)):(h=function(e,t){let n=document.importNode(e.content,!0);return t.parentElement.insertBefore(n,t.nextElementSibling),t.nextElementSibling}(t,c),y(h,()=>{},()=>{},e,r),h.__x_for=l,e.initializeElements(h,()=>h.__x_for)),c=h,c.__x_for_key=d}),function(e,t){for(var n=!(!e.nextElementSibling||void 0===e.nextElementSibling.__x_for_key)&&e.nextElementSibling;n;){let e=n,i=n.nextElementSibling;b(n,()=>{e.remove()},()=>{},t),n=!(!i||void 0===i.__x_for_key)&&i}}(c,e)}function P(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,n=String(e).match(/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/);if(!n)return;let i={};i.items=n[2].trim();let r=n[1].trim().replace(/^\(|\)$/g,""),o=r.match(t);return o?(i.item=r.replace(t,"").trim(),i.index=o[1].trim(),o[2]&&(i.collection=o[2].trim())):i.item=r,i}function L(e,t,n,r,a,u,c){var l=e.evaluateReturnExpression(t,r,a);if("value"===n){if(pe.ignoreFocusedForValueBinding&&document.activeElement.isSameNode(t))return;if(void 0===l&&String(r).match(/\./)&&(l=""),"radio"===t.type)void 0===t.attributes.value&&"bind"===u?t.value=l:"bind"!==u&&(t.checked=o(t.value,l));else if("checkbox"===t.type)"boolean"==typeof l||[null,void 0].includes(l)||"bind"!==u?"bind"!==u&&(Array.isArray(l)?t.checked=l.some(e=>o(e,t.value)):t.checked=!!l):t.value=String(l);else if("SELECT"===t.tagName)!function(e,t){const n=[].concat(t).map(e=>e+"");Array.from(e.options).forEach(e=>{e.selected=n.includes(e.value||e.text)})}(t,l);else{if(t.value===l)return;t.value=l}}else if("class"===n)if(Array.isArray(l)){const e=t.__x_original_classes||[];t.setAttribute("class",i(e.concat(l)).join(" "))}else if("object"==typeof l)Object.keys(l).sort((e,t)=>l[e]-l[t]).forEach(e=>{l[e]?g(e).forEach(e=>t.classList.add(e)):g(e).forEach(e=>t.classList.remove(e))});else{const e=t.__x_original_classes||[],n=l?g(l):[];t.setAttribute("class",i(e.concat(n)).join(" "))}else n=c.includes("camel")?s(n):n,[null,void 0,!1].includes(l)?t.removeAttribute(n):function(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}(n)?O(t,n,n):O(t,n,l)}function O(e,t,n){e.getAttribute(t)!=n&&e.setAttribute(t,n)}function T(e,t,n,i,r,o={}){const a={passive:i.includes("passive")};let c,l;if(i.includes("camel")&&(n=s(n)),i.includes("away")?(l=document,c=s=>{t.contains(s.target)||t.offsetWidth<1&&t.offsetHeight<1||(D(e,r,s,o),i.includes("once")&&document.removeEventListener(n,c,a))}):(l=i.includes("window")?window:i.includes("document")?document:t,c=s=>{l!==window&&l!==document||document.body.contains(t)?function(e){return["keydown","keyup"].includes(e)}(n)&&function(e,t){let n=t.filter(e=>!["window","document","prevent","stop"].includes(e));if(n.includes("debounce")){let e=n.indexOf("debounce");n.splice(e,S((n[e+1]||"invalid-wait").split("ms")[0])?2:1)}if(0===n.length)return!1;if(1===n.length&&n[0]===I(e.key))return!1;const i=["ctrl","shift","alt","meta","cmd","super"].filter(e=>n.includes(e));return n=n.filter(e=>!i.includes(e)),!(i.length>0&&i.filter(t=>("cmd"!==t&&"super"!==t||(t="meta"),e[t+"Key"])).length===i.length&&n[0]===I(e.key))}(s,i)||(i.includes("prevent")&&s.preventDefault(),i.includes("stop")&&s.stopPropagation(),i.includes("self")&&s.target!==t)||D(e,r,s,o).then(e=>{!1===e?s.preventDefault():i.includes("once")&&l.removeEventListener(n,c,a)}):l.removeEventListener(n,c,a)}),i.includes("debounce")){let e=i[i.indexOf("debounce")+1]||"invalid-wait",t=S(e.split("ms")[0])?Number(e.split("ms")[0]):250;c=u(c,t)}l.addEventListener(n,c,a)}function D(e,t,i,r){return e.evaluateCommandExpression(i.target,t,()=>n(n({},r()),{},{$event:i}))}function I(e){switch(e){case"/":return"slash";case" ":case"Spacebar":return"space";default:return e&&e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}}function N(e,t,n){return"radio"===e.type&&(e.hasAttribute("name")||e.setAttribute("name",n)),(n,i)=>{if(n instanceof CustomEvent&&n.detail)return n.detail;if("checkbox"===e.type){if(Array.isArray(i)){const e=t.includes("number")?R(n.target.value):n.target.value;return n.target.checked?i.concat([e]):i.filter(t=>!o(t,e))}return n.target.checked}if("select"===e.tagName.toLowerCase()&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(e=>R(e.value||e.text)):Array.from(n.target.selectedOptions).map(e=>e.value||e.text);{const e=n.target.value;return t.includes("number")?R(e):t.includes("trim")?e.trim():e}}}function R(e){const t=e?parseFloat(e):null;return S(t)?t:e}const{isArray:j}=Array,{getPrototypeOf:F,create:M,defineProperty:H,defineProperties:U,isExtensible:B,getOwnPropertyDescriptor:$,getOwnPropertyNames:z,getOwnPropertySymbols:J,preventExtensions:V,hasOwnProperty:q}=Object,{push:W,concat:K,map:G}=Array.prototype;function X(e){return void 0===e}function Y(e){return"function"==typeof e}const Z=new WeakMap;function Q(e,t){Z.set(e,t)}const ee=e=>Z.get(e)||e;function te(e,t){return e.valueIsObservable(t)?e.getProxy(t):t}function ne(e,t,n){K.call(z(n),J(n)).forEach(i=>{let r=$(n,i);r.configurable||(r=he(e,r,te)),H(t,i,r)}),V(t)}class ie{constructor(e,t){this.originalTarget=t,this.membrane=e}get(e,t){const{originalTarget:n,membrane:i}=this,r=n[t],{valueObserved:o}=i;return o(n,t),i.getProxy(r)}set(e,t,n){const{originalTarget:i,membrane:{valueMutated:r}}=this;return i[t]!==n?(i[t]=n,r(i,t)):"length"===t&&j(i)&&r(i,t),!0}deleteProperty(e,t){const{originalTarget:n,membrane:{valueMutated:i}}=this;return delete n[t],i(n,t),!0}apply(e,t,n){}construct(e,t,n){}has(e,t){const{originalTarget:n,membrane:{valueObserved:i}}=this;return i(n,t),t in n}ownKeys(e){const{originalTarget:t}=this;return K.call(z(t),J(t))}isExtensible(e){const t=B(e);if(!t)return t;const{originalTarget:n,membrane:i}=this,r=B(n);return r||ne(i,e,n),r}setPrototypeOf(e,t){}getPrototypeOf(e){const{originalTarget:t}=this;return F(t)}getOwnPropertyDescriptor(e,t){const{originalTarget:n,membrane:i}=this,{valueObserved:r}=this.membrane;r(n,t);let o=$(n,t);if(X(o))return o;const a=$(e,t);return X(a)?(o=he(i,o,te),o.configurable||H(e,t,o),o):a}preventExtensions(e){const{originalTarget:t,membrane:n}=this;return ne(n,e,t),V(t),!0}defineProperty(e,t,n){const{originalTarget:i,membrane:r}=this,{valueMutated:o}=r,{configurable:a}=n;if(q.call(n,"writable")&&!q.call(n,"value")){const e=$(i,t);n.value=e.value}return H(i,t,function(e){return q.call(e,"value")&&(e.value=ee(e.value)),e}(n)),!1===a&&H(e,t,he(r,n,te)),o(i,t),!0}}function re(e,t){return e.valueIsObservable(t)?e.getReadOnlyProxy(t):t}class oe{constructor(e,t){this.originalTarget=t,this.membrane=e}get(e,t){const{membrane:n,originalTarget:i}=this,r=i[t],{valueObserved:o}=n;return o(i,t),n.getReadOnlyProxy(r)}set(e,t,n){return!1}deleteProperty(e,t){return!1}apply(e,t,n){}construct(e,t,n){}has(e,t){const{originalTarget:n,membrane:{valueObserved:i}}=this;return i(n,t),t in n}ownKeys(e){const{originalTarget:t}=this;return K.call(z(t),J(t))}setPrototypeOf(e,t){}getOwnPropertyDescriptor(e,t){const{originalTarget:n,membrane:i}=this,{valueObserved:r}=i;r(n,t);let o=$(n,t);if(X(o))return o;const a=$(e,t);return X(a)?(o=he(i,o,re),q.call(o,"set")&&(o.set=void 0),o.configurable||H(e,t,o),o):a}preventExtensions(e){return!1}defineProperty(e,t,n){return!1}}function ae(e){let t=void 0;return j(e)?t=[]:"object"==typeof e&&(t={}),t}const se=Object.prototype;function ue(e){if(null===e)return!1;if("object"!=typeof e)return!1;if(j(e))return!0;const t=F(e);return t===se||null===t||null===F(t)}const ce=(e,t)=>{},le=(e,t)=>{},de=e=>e;function he(e,t,n){const{set:i,get:r}=t;return q.call(t,"value")?t.value=n(e,t.value):(X(r)||(t.get=function(){return n(e,r.call(ee(this)))}),X(i)||(t.set=function(t){i.call(ee(this),e.unwrapProxy(t))})),t}class fe{constructor(e){if(this.valueDistortion=de,this.valueMutated=le,this.valueObserved=ce,this.valueIsObservable=ue,this.objectGraph=new WeakMap,!X(e)){const{valueDistortion:t,valueMutated:n,valueObserved:i,valueIsObservable:r}=e;this.valueDistortion=Y(t)?t:de,this.valueMutated=Y(n)?n:le,this.valueObserved=Y(i)?i:ce,this.valueIsObservable=Y(r)?r:ue}}getProxy(e){const t=ee(e),n=this.valueDistortion(t);if(this.valueIsObservable(n)){const i=this.getReactiveState(t,n);return i.readOnly===e?e:i.reactive}return n}getReadOnlyProxy(e){e=ee(e);const t=this.valueDistortion(e);return this.valueIsObservable(t)?this.getReactiveState(e,t).readOnly:t}unwrapProxy(e){return ee(e)}getReactiveState(e,t){const{objectGraph:n}=this;let i=n.get(t);if(i)return i;const r=this;return i={get reactive(){const n=new ie(r,t),i=new Proxy(ae(t),n);return Q(i,e),H(this,"reactive",{value:i}),i},get readOnly(){const n=new oe(r,t),i=new Proxy(ae(t),n);return Q(i,e),H(this,"readOnly",{value:i}),i}},n.set(t,i),i}}class ve{constructor(e,t=null){this.$el=e;const n=this.$el.getAttribute("x-data"),i=""===n?"{}":n,r=this.$el.getAttribute("x-init");let o={$el:this.$el},a=t?t.$el:this.$el;Object.entries(pe.magicProperties).forEach(([e,t])=>{Object.defineProperty(o,"$"+e,{get:function(){return t(a)}})}),this.unobservedData=t?t.getUnobservedData():d(e,i,o);let{membrane:s,data:u}=this.wrapDataInObservable(this.unobservedData);var c;this.$data=u,this.membrane=s,this.unobservedData.$el=this.$el,this.unobservedData.$refs=this.getRefsProxy(),this.nextTickStack=[],this.unobservedData.$nextTick=e=>{this.nextTickStack.push(e)},this.watchers={},this.unobservedData.$watch=(e,t)=>{this.watchers[e]||(this.watchers[e]=[]),this.watchers[e].push(t)},Object.entries(pe.magicProperties).forEach(([e,t])=>{Object.defineProperty(this.unobservedData,"$"+e,{get:function(){return t(a,this.$el)}})}),this.showDirectiveStack=[],this.showDirectiveLastElement,t||pe.onBeforeComponentInitializeds.forEach(e=>e(this)),r&&!t&&(this.pauseReactivity=!0,c=this.evaluateReturnExpression(this.$el,r),this.pauseReactivity=!1),this.initializeElements(this.$el,()=>{},t),this.listenForNewElementsToInitialize(),"function"==typeof c&&c.call(this.$data),t||setTimeout(()=>{pe.onComponentInitializeds.forEach(e=>e(this))},0)}getUnobservedData(){return function(e,t){let n=e.unwrapProxy(t),i={};return Object.keys(n).forEach(e=>{["$el","$refs","$nextTick","$watch"].includes(e)||(i[e]=n[e])}),i}(this.membrane,this.$data)}wrapDataInObservable(e){var t=this;let n=u((function(){t.updateElements(t.$el)}),0);return function(e,t){let n=new fe({valueMutated(e,n){t(e,n)}});return{data:n.getProxy(e),membrane:n}}(e,(e,i)=>{t.watchers[i]?t.watchers[i].forEach(t=>t(e[i])):Array.isArray(e)?Object.keys(t.watchers).forEach(n=>{let r=n.split(".");"length"!==i&&r.reduce((i,r)=>(Object.is(e,i[r])&&t.watchers[n].forEach(t=>t(e)),i[r]),t.unobservedData)}):Object.keys(t.watchers).filter(e=>e.includes(".")).forEach(n=>{let r=n.split(".");i===r[r.length-1]&&r.reduce((r,o)=>(Object.is(e,r)&&t.watchers[n].forEach(t=>t(e[i])),r[o]),t.unobservedData)}),t.pauseReactivity||n()})}walkAndSkipNestedComponents(e,t,n=(()=>{})){!function e(t,n){if(!1===n(t))return;let i=t.firstElementChild;for(;i;)e(i,n),i=i.nextElementSibling}(e,e=>e.hasAttribute("x-data")&&!e.isSameNode(this.$el)?(e.__x||n(e),!1):t(e))}initializeElements(e,t=(()=>{}),n=!1){this.walkAndSkipNestedComponents(e,e=>void 0===e.__x_for_key&&void 0===e.__x_inserted_me&&void this.initializeElement(e,t,!n),e=>{n||(e.__x=new ve(e))}),this.executeAndClearRemainingShowDirectiveStack(),this.executeAndClearNextTickStack(e)}initializeElement(e,t,n=!0){e.hasAttribute("class")&&v(e,this).length>0&&(e.__x_original_classes=g(e.getAttribute("class"))),n&&this.registerListeners(e,t),this.resolveBoundAttributes(e,!0,t)}updateElements(e,t=(()=>{})){this.walkAndSkipNestedComponents(e,e=>{if(void 0!==e.__x_for_key&&!e.isSameNode(this.$el))return!1;this.updateElement(e,t)},e=>{e.__x=new ve(e)}),this.executeAndClearRemainingShowDirectiveStack(),this.executeAndClearNextTickStack(e)}executeAndClearNextTickStack(e){e===this.$el&&this.nextTickStack.length>0&&requestAnimationFrame(()=>{for(;this.nextTickStack.length>0;)this.nextTickStack.shift()()})}executeAndClearRemainingShowDirectiveStack(){this.showDirectiveStack.reverse().map(e=>new Promise((t,n)=>{e(t,n)})).reduce((e,t)=>e.then(()=>t.then(e=>{e()})),Promise.resolve(()=>{})).catch(e=>{if("cancelled"!==e)throw e}),this.showDirectiveStack=[],this.showDirectiveLastElement=void 0}updateElement(e,t){this.resolveBoundAttributes(e,!1,t)}registerListeners(e,t){v(e,this).forEach(({type:i,value:r,modifiers:o,expression:a})=>{switch(i){case"on":T(this,e,r,o,a,t);break;case"model":!function(e,t,i,r,o){var a="select"===t.tagName.toLowerCase()||["checkbox","radio"].includes(t.type)||i.includes("lazy")?"change":"input";T(e,t,a,i,`${r} = rightSideOfExpression($event, ${r})`,()=>n(n({},o()),{},{rightSideOfExpression:N(t,i,r)}))}(this,e,o,a,t)}})}resolveBoundAttributes(e,t=!1,n){let i=v(e,this);i.forEach(({type:r,value:o,modifiers:s,expression:u})=>{switch(r){case"model":L(this,e,"value",u,n,r,s);break;case"bind":if("template"===e.tagName.toLowerCase()&&"key"===o)return;L(this,e,o,u,n,r,s);break;case"text":var c=this.evaluateReturnExpression(e,u,n);!function(e,t,n){void 0===t&&String(n).match(/\./)&&(t=""),e.textContent=t}(e,c,u);break;case"html":!function(e,t,n,i){t.innerHTML=e.evaluateReturnExpression(t,n,i)}(this,e,u,n);break;case"show":c=this.evaluateReturnExpression(e,u,n),function(e,t,n,i,r=!1){const o=()=>{t.style.display="none",t.__x_is_shown=!1},a=()=>{1===t.style.length&&"none"===t.style.display?t.removeAttribute("style"):t.style.removeProperty("display"),t.__x_is_shown=!0};if(!0===r)return void(n?a():o());const s=(i,r)=>{n?(("none"===t.style.display||t.__x_transition)&&y(t,()=>{a()},r,e),i(()=>{})):"none"!==t.style.display?b(t,()=>{i(()=>{o()})},r,e):i(()=>{})};i.includes("immediate")?s(e=>e(),()=>{}):(e.showDirectiveLastElement&&!e.showDirectiveLastElement.contains(t)&&e.executeAndClearRemainingShowDirectiveStack(),e.showDirectiveStack.push(s),e.showDirectiveLastElement=t)}(this,e,c,s,t);break;case"if":if(i.some(e=>"for"===e.type))return;c=this.evaluateReturnExpression(e,u,n),function(e,t,n,i,r){a(t,"x-if");const o=t.nextElementSibling&&!0===t.nextElementSibling.__x_inserted_me;if(!n||o&&!t.__x_transition)!n&&o&&b(t.nextElementSibling,()=>{t.nextElementSibling.remove()},()=>{},e,i);else{const n=document.importNode(t.content,!0);t.parentElement.insertBefore(n,t.nextElementSibling),y(t.nextElementSibling,()=>{},()=>{},e,i),e.initializeElements(t.nextElementSibling,r),t.nextElementSibling.__x_inserted_me=!0}}(this,e,c,t,n);break;case"for":C(this,e,u,t,n);break;case"cloak":e.removeAttribute("x-cloak")}})}evaluateReturnExpression(e,t,i=(()=>{})){return d(e,t,this.$data,n(n({},i()),{},{$dispatch:this.getDispatchFunction(e)}))}evaluateCommandExpression(e,t,i=(()=>{})){return function(e,t,n,i={}){return l(()=>{if("function"==typeof t)return Promise.resolve(t.call(n,i.$event));let e=Function;if(e=Object.getPrototypeOf((async function(){})).constructor,Object.keys(n).includes(t)){let e=new Function(["dataContext",...Object.keys(i)],`with(dataContext) { return ${t} }`)(n,...Object.values(i));return"function"==typeof e?Promise.resolve(e.call(n,i.$event)):Promise.resolve()}return Promise.resolve(new e(["dataContext",...Object.keys(i)],`with(dataContext) { ${t} }`)(n,...Object.values(i)))},{el:e,expression:t})}(e,t,this.$data,n(n({},i()),{},{$dispatch:this.getDispatchFunction(e)}))}getDispatchFunction(e){return(t,n={})=>{e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0}))}}listenForNewElementsToInitialize(){const e=this.$el;new MutationObserver(e=>{for(let t=0;t<e.length;t++){const n=e[t].target.closest("[x-data]");if(n&&n.isSameNode(this.$el)){if("attributes"===e[t].type&&"x-data"===e[t].attributeName){const n=e[t].target.getAttribute("x-data")||"{}",i=d(this.$el,n,{$el:this.$el});Object.keys(i).forEach(e=>{this.$data[e]!==i[e]&&(this.$data[e]=i[e])})}e[t].addedNodes.length>0&&e[t].addedNodes.forEach(e=>{1!==e.nodeType||e.__x_inserted_me||(!e.matches("[x-data]")||e.__x?this.initializeElements(e):e.__x=new ve(e))})}}}).observe(e,{childList:!0,attributes:!0,subtree:!0})}getRefsProxy(){var e=this;return new Proxy({},{get(t,n){return"$isAlpineProxy"===n||(e.walkAndSkipNestedComponents(e.$el,e=>{e.hasAttribute("x-ref")&&e.getAttribute("x-ref")===n&&(i=e)}),i);var i}})}}const pe={version:"2.8.2",pauseMutationObserver:!1,magicProperties:{},onComponentInitializeds:[],onBeforeComponentInitializeds:[],ignoreFocusedForValueBinding:!1,start:async function(){r()||await new Promise(e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",e):e()}),this.discoverComponents(e=>{this.initializeComponent(e)}),document.addEventListener("turbolinks:load",()=>{this.discoverUninitializedComponents(e=>{this.initializeComponent(e)})}),this.listenForNewUninitializedComponentsAtRunTime()},discoverComponents:function(e){document.querySelectorAll("[x-data]").forEach(t=>{e(t)})},discoverUninitializedComponents:function(e,t=null){const n=(t||document).querySelectorAll("[x-data]");Array.from(n).filter(e=>void 0===e.__x).forEach(t=>{e(t)})},listenForNewUninitializedComponentsAtRunTime:function(){const e=document.querySelector("body");new MutationObserver(e=>{if(!this.pauseMutationObserver)for(let t=0;t<e.length;t++)e[t].addedNodes.length>0&&e[t].addedNodes.forEach(e=>{1===e.nodeType&&(e.parentElement&&e.parentElement.closest("[x-data]")||this.discoverUninitializedComponents(e=>{this.initializeComponent(e)},e.parentElement))})}).observe(e,{childList:!0,attributes:!0,subtree:!0})},initializeComponent:function(e){if(!e.__x)try{e.__x=new ve(e)}catch(e){setTimeout(()=>{throw e},0)}},clone:function(e,t){t.__x||(t.__x=new ve(t,e))},addMagicProperty:function(e,t){this.magicProperties[e]=t},onComponentInitialized:function(e){this.onComponentInitializeds.push(e)},onBeforeComponentInitialized:function(e){this.onBeforeComponentInitializeds.push(e)}};return r()||(window.Alpine=pe,window.deferLoadingAlpine?window.deferLoadingAlpine((function(){window.Alpine.start()})):window.Alpine.start()),pe}()},function(e,t,n){"use strict";!function(){var e=function(){if("function"==typeof window.CustomEvent)return window.CustomEvent;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}return e.prototype=window.Event.prototype,e}();function t(e,t){var n=document.createElement("input");return n.type="hidden",n.name=e,n.value=t,n}function n(e){var n=e.getAttribute("data-to"),i=t("_method",e.getAttribute("data-method")),r=t("_csrf_token",e.getAttribute("data-csrf")),o=document.createElement("form"),a=e.getAttribute("target");o.method="get"===e.getAttribute("data-method")?"get":"post",o.action=n,o.style.display="hidden",a&&(o.target=a),o.appendChild(r),o.appendChild(i),document.body.appendChild(o),o.submit()}window.addEventListener("click",(function(t){for(var i=t.target;i&&i.getAttribute;){var r=new e("phoenix.link.click",{bubbles:!0,cancelable:!0});if(!i.dispatchEvent(r))return t.preventDefault(),t.stopImmediatePropagation(),!1;if(i.getAttribute("data-method"))return n(i),t.preventDefault(),!1;i=i.parentNode}}),!1),window.addEventListener("phoenix.link.click",(function(e){var t=e.target.getAttribute("data-confirm");t&&!window.confirm(t)&&e.preventDefault()}),!1)}()},function(e,t,n){"use strict";n.r(t),n.d(t,"Hooks",(function(){return u}));var i={};n.r(i),n.d(i,"SupabaseAuth",(function(){return s}));n(2),n(3),n(4);var r=n(0),o=n.n(r),a=n(1),s={redirectUrl:function(){return this.el.dataset.redirectUrl},sessionUrl:function(){return this.el.dataset.sessionUrl},parseHash:function(e){var t={};return new URLSearchParams(e.slice(1)).forEach((function(e,n){return t[n]=e})),t},setSession:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];fetch(this.sessionUrl(),{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}).then((function(e){n&&a.Browser.redirect(t.redirectUrl())}))},mounted:function(){var e=this;if(this.el.dataset.magicLink&&window.location.hash){var t=this.parseHash(window.location.hash);t.access_token&&t.refresh_token&&this.setSession(t,"recovery"!=t.type),"recovery"===t.type&&this.pushEventTo(this.el,"recovery",t)}this.handleEvent("sign-in",(function(t){return e.setSession(t,!0)}))}};var u=Object.assign(function(e,t){var n={};return Object.keys(e).map((function(i){n["".concat(t,"#").concat(i)]=e[i]})),n}(i,"SupabaseSurface.Components.Auth"));o.a.config({barColors:{0:"#29d"},shadowColor:"rgba(0, 0, 0, .3)"}),window.addEventListener("phx:page-loading-start",(function(e){return o.a.show()})),window.addEventListener("phx:page-loading-stop",(function(e){return o.a.hide()}))}]);