PageSourceSearch

https://sampol.be/assets/js/app-19bbbdcff7e93efb3bb613d22fa74796.js?vsn=d

js sampol.be collected 2026-10-01 11:50:28 UTC 195,765 bytes, 30 lines download raw bytes

1(()=>{var Qs=Object.create;var qn=Object.defineProperty;var Zs=Object.getOwnPropertyDescriptor;var er=Object.getOwnPropertyNames;var tr=Object.getPrototypeOf,ir=Object.prototype.hasOwnProperty;var zn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var nr=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of er(e))!ir.call(t,s)&&s!==i&&qn(t,s,{get:()=>e[s],enumerable:!(n=Zs(e,s))||n.enumerable});return t};var Kn=(t,e,i)=>(i=t!=null?Qs(tr(t)):{},nr(e||!t||!t.__esModule?qn(i,"default",{value:t,enumerable:!0}):i,t));var Us=zn(($s,Wi)=>{(function(t,e){"use strict";var i,n,s,r=null,a=null,h=null,d=function(E,m,S){E.addEventListener?E.addEventListener(m,S,!1):E.attachEvent?E.attachEvent("on"+m,S):E["on"+m]=S},p={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},A=function(){i.width=t.innerWidth,i.height=p.barThickness*5;var E=i.getContext("2d");E.shadowBlur=p.shadowBlur,E.shadowColor=p.shadowColor;var m=E.createLinearGradient(0,0,i.width,0);for(var S in p.barColors)m.addColorStop(S,p.barColors[S]);E.lineWidth=p.barThickness,E.beginPath(),E.moveTo(0,p.barThickness/2),E.lineTo(Math.ceil(n*i.width),p.barThickness/2),E.strokeStyle=m,E.stroke()},C=function(){i=e.createElement("canvas");var E=i.style;E.position="fixed",E.top=E.left=E.right=E.margin=E.padding=0,E.zIndex=100001,E.display="none",p.className&&i.classList.add(p.className),d(t,"resize",A)},T={config:function(E){for(var m in E)p.hasOwnProperty(m)&&(p[m]=E[m])},show:function(E){if(!s)if(E){if(h)return;h=setTimeout(()=>T.show(),E)}else s=!0,a!==null&&t.cancelAnimationFrame(a),i||C(),i.parentElement||e.body.appendChild(i),i.style.opacity=1,i.style.display="block",T.progress(0),p.autoRun&&function m(){r=t.requestAnimationFrame(m),T.progress("+"+.05*Math.pow(1-Math.sqrt(n),2))}()},progress:function(E){return typeof E>"u"||(typeof E=="string"&&(E=(E.indexOf("+")>=0||E.indexOf("-")>=0?n:0)+parseFloat(E)),n=E>1?1:E,A()),n},hide:function(){clearTimeout(h),h=null,s&&(s=!1,r!=null&&(t.cancelAnimationFrame(r),r=null),function E(){if(T.progress("+.1")>=1&&(i.style.opacity-=.05,i.style.opacity<=.05)){i.style.display="none",a=null;return}a=t.requestAnimationFrame(E)}())}};typeof Wi=="object"&&typeof Wi.exports=="object"?Wi.exports=T:typeof define=="function"&&define.amd?define(function(){return T}):this.topbar=T}).call($s,window,document)});var Bs=zn((In,On)=>{(function(t,e){typeof In=="object"&&typeof On<"u"?On.exports=e():typeof define=="function"&&define.amd?define(e):(t=t||self).Sortable=e()})(In,function(){"use strict";function t(o,l){var c,f=Object.keys(o);return Object.getOwnPropertySymbols&&(c=Object.getOwnPropertySymbols(o),l&&(c=c.filter(function(u){return Object.getOwnPropertyDescriptor(o,u).enumerable})),f.push.apply(f,c)),f}function e(o){for(var l=1;l<arguments.length;l++){var c=arguments[l]!=null?arguments[l]:{};l%2?t(Object(c),!0).forEach(function(f){var u,v;u=o,f=c[v=f],v in u?Object.defineProperty(u,v,{value:f,enumerable:!0,configurable:!0,writable:!0}):u[v]=f}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(c)):t(Object(c)).forEach(function(f){Object.defineProperty(o,f,Object.getOwnPropertyDescriptor(c,f))})}return o}function i(o){return(i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l})(o)}function n(){return(n=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var c,f=arguments[l];for(c in f)Object.prototype.hasOwnProperty.call(f,c)&&(o[c]=f[c])}return o}).apply(this,arguments)}function s(o,l){if(o==null)return{};var c,f=function(y,b){if(y==null)return{};for(var k,x={},D=Object.keys(y),X=0;X<D.length;X++)k=D[X],0<=b.indexOf(k)||(x[k]=y[k]);return x}(o,l);if(Object.getOwnPropertySymbols)for(var u=Object.getOwnPropertySymbols(o),v=0;v<u.length;v++)c=u[v],0<=l.indexOf(c)||Object.prototype.propertyIsEnumerable.call(o,c)&&(f[c]=o[c]);return f}function r(o){return function(l){if(Array.isArray(l))return a(l)}(o)||function(l){if(typeof Symbol<"u"&&l[Symbol.iterator]!=null||l["@@iterator"]!=null)return Array.from(l)}
1(o)||function(l,c){if(l){if(typeof l=="string")return a(l,c);var f=Object.prototype.toString.call(l).slice(8,-1);return(f=f==="Object"&&l.constructor?l.constructor.name:f)==="Map"||f==="Set"?Array.from(l):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?a(l,c):void 0}}(o)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function a(o,l){(l==null||l>o.length)&&(l=o.length);for(var c=0,f=new Array(l);c<l;c++)f[c]=o[c];return f}function h(o){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(o)}var d=h(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),p=h(/Edge/i),A=h(/firefox/i),C=h(/safari/i)&&!h(/chrome/i)&&!h(/android/i),T=h(/iP(ad|od|hone)/i),Kt=h(/chrome/i)&&h(/android/i),E={capture:!1,passive:!1};function m(o,l,c){o.addEventListener(l,c,!d&&E)}function S(o,l,c){o.removeEventListener(l,c,!d&&E)}function L(o,l){if(l&&(l[0]===">"&&(l=l.substring(1)),o))try{if(o.matches)return o.matches(l);if(o.msMatchesSelector)return o.msMatchesSelector(l);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(l)}catch{return}}function V(o,l,c,f){if(o){c=c||document;do if(l!=null&&(l[0]!==">"||o.parentNode===c)&&L(o,l)||f&&o===c)return o;while(o!==c&&(o=(u=o).host&&u!==document&&u.host.nodeType?u.host:u.parentNode))}var u;return null}var pe,M=/\s+/g;function I(o,l,c){var f;o&&l&&(o.classList?o.classList[c?"add":"remove"](l):(f=(" "+o.className+" ").replace(M," ").replace(" "+l+" "," "),o.className=(f+(c?" "+l:"")).replace(M," ")))}function _(o,l,c){var f=o&&o.style;if(f){if(c===void 0)return document.defaultView&&document.defaultView.getComputedStyle?c=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(c=o.currentStyle),l===void 0?c:c[l];f[l=l in f||l.indexOf("webkit")!==-1?l:"-webkit-"+l]=c+(typeof c=="string"?"":"px")}}function ne(o,l){var c="";if(typeof o=="string")c=o;else do var f=_(o,"transform");while(f&&f!=="none"&&(c=f+" "+c),!l&&(o=o.parentNode));var u=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return u&&new u(c)}function w(o,l,c){if(o){var f=o.getElementsByTagName(l),u=0,v=f.length;if(c)for(;u<v;u++)c(f[u],u);return f}return[]}function R(){var o=document.scrollingElement;return o||document.documentElement}function j(o,l,c,f,u){if(o.getBoundingClientRect||o===window){var v,y,b,k,x,D,X=o!==window&&o.parentNode&&o!==R()?(y=(v=o.getBoundingClientRect()).top,b=v.left,k=v.bottom,x=v.right,D=v.height,v.width):(b=y=0,k=window.innerHeight,x=window.innerWidth,D=window.innerHeight,window.innerWidth);if((l||c)&&o!==window&&(u=u||o.parentNode,!d))do if(u&&u.getBoundingClientRect&&(_(u,"transform")!=="none"||c&&_(u,"position")!=="static")){var re=u.getBoundingClientRect();y-=re.top+parseInt(_(u,"border-top-width")),b-=re.left+parseInt(_(u,"border-left-width")),k=y+v.height,x=b+v.width;break}while(u=u.parentNode);return f&&o!==window&&(f=(l=ne(u||o))&&l.a,o=l&&l.d,l&&(k=(y/=o)+(D/=o),x=(b/=f)+(X/=f))),{top:y,left:b,bottom:k,right:x,width:X,height:D}}}function Ce(o,l,c){for(var f=He(o,!0),u=j(o)[l];f;){var v=j(f)[c];if(!(c==="top"||c==="left"?v<=u:u<=v))return f;if(f===R())break;f=He(f,!1)}return!1}function Y(o,l,c,f){for(var u=0,v=0,y=o.children;v<y.length;){if(y[v].style.display!=="none"&&y[v]!==O.ghost&&(f||y[v]!==O.dragged)&&V(y[v],c.draggable,o,!1)){if(u===l)return y[v];u++}v++}return null}function Qe(o,l){for(var c=o.lastElementChild;c&&(c===O.ghost||_(c,"display")==="none"||l&&!L(c,l));)c=c.previousElementSibling;return c||null}function N(o,l){var c=0;if(!o||!o.parentNode)return-1;for(;o=o.previousElementSibling;)o.nodeName.toUpperCase()==="TEMPLATE"||o===O.clone||l&&!L(o,l)||c++;return c}function mt(o){var l=0,c=0,f=R();if(o)do var v=ne(o),u=v.a,v=v.d;while(l+=o.scrollLeft*u,c+=o.scrollTop*v,o!==f&&(o=o.parentNode));return[l,c]}function He(o,l){if(!o||!o.getBoundingClientRect)return R();var c=o,f=!1;do if(c.clientWidth<c.scrollWidth||c.clientHeight<c.scrollHeight){var u=_(c);if(c.clientWidth<c.scrollWidth&&(u.overflowX=="auto"||u.overflowX=="scroll")||c.clientHeight<c.scrollHeight&&(u.overflowY=="auto"||u.overflowY=="scroll")){if(!c.getBoundingClientRect||c===document.body)return R();if(f||l)return c;f=!0}}while(c=c.parentNode);return R()}function gt(o,l){return Math.round(o.top)===Math.round(l.top)&&Math.round(o.left)===Math.round(l.left)&&Math.round(o.height)===Math.round(l.height)&&Math.round(o.width)===Math.round(l.width)}function ci(o,l){return function(){var c;
vendor: 5,888 bytes, line 2
2pe||((c=arguments).length===1?o.call(this,c[0]):o.apply(this,c),pe=setTimeout(function(){pe=void 0},l))}}function Pt(o,l,c){o.scrollLeft+=l,o.scrollTop+=c}function H(o){var l=window.Polymer,c=window.jQuery||window.Zepto;return l&&l.dom?l.dom(o).cloneNode(!0):c?c(o).clone(!0)[0]:o.cloneNode(!0)}function F(o,l){_(o,"position","absolute"),_(o,"top",l.top),_(o,"left",l.left),_(o,"width",l.width),_(o,"height",l.height)}function ee(o){_(o,"position",""),_(o,"top",""),_(o,"left",""),_(o,"width",""),_(o,"height","")}function J(o,l,c){var f={};return Array.from(o.children).forEach(function(u){var v;V(u,l.draggable,o,!1)&&!u.animated&&u!==c&&(v=j(u),f.left=Math.min((u=f.left)!==null&&u!==void 0?u:1/0,v.left),f.top=Math.min((u=f.top)!==null&&u!==void 0?u:1/0,v.top),f.right=Math.max((u=f.right)!==null&&u!==void 0?u:-1/0,v.right),f.bottom=Math.max((u=f.bottom)!==null&&u!==void 0?u:-1/0,v.bottom))}),f.width=f.right-f.left,f.height=f.bottom-f.top,f.x=f.left,f.y=f.top,f}var $="Sortable"+new Date().getTime();function rt(){var o,l=[];return{captureAnimationState:function(){l=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(c){var f,u;_(c,"display")!=="none"&&c!==O.ghost&&(l.push({target:c,rect:j(c)}),f=e({},l[l.length-1].rect),!c.thisAnimationDuration||(u=ne(c,!0))&&(f.top-=u.f,f.left-=u.e),c.fromRect=f)})},addAnimationState:function(c){l.push(c)},removeAnimationState:function(c){l.splice(function(f,u){for(var v in f)if(f.hasOwnProperty(v)){for(var y in u)if(u.hasOwnProperty(y)&&u[y]===f[v][y])return Number(v)}return-1}(l,{target:c}),1)},animateAll:function(c){var f=this;if(!this.options.animation)return clearTimeout(o),void(typeof c=="function"&&c());var u=!1,v=0;l.forEach(function(y){var b=0,k=y.target,x=k.fromRect,D=j(k),X=k.prevFromRect,re=k.prevToRect,q=y.rect,W=ne(k,!0);W&&(D.top-=W.f,D.left-=W.e),k.toRect=D,k.thisAnimationDuration&&gt(X,D)&&!gt(x,D)&&(q.top-D.top)/(q.left-D.left)==(x.top-D.top)/(x.left-D.left)&&(y=q,W=X,X=re,re=f.options,b=Math.sqrt(Math.pow(W.top-y.top,2)+Math.pow(W.left-y.left,2))/Math.sqrt(Math.pow(W.top-X.top,2)+Math.pow(W.left-X.left,2))*re.animation),gt(D,x)||(k.prevFromRect=x,k.prevToRect=D,b=b||f.options.animation,f.animate(k,q,D,b)),b&&(u=!0,v=Math.max(v,b),clearTimeout(k.animationResetTimer),k.animationResetTimer=setTimeout(function(){k.animationTime=0,k.prevFromRect=null,k.fromRect=null,k.prevToRect=null,k.thisAnimationDuration=null},b),k.thisAnimationDuration=b)}),clearTimeout(o),u?o=setTimeout(function(){typeof c=="function"&&c()},v):typeof c=="function"&&c(),l=[]},animate:function(c,f,u,v){var y,b;v&&(_(c,"transition",""),_(c,"transform",""),y=(b=ne(this.el))&&b.a,b=b&&b.d,y=(f.left-u.left)/(y||1),b=(f.top-u.top)/(b||1),c.animatingX=!!y,c.animatingY=!!b,_(c,"transform","translate3d("+y+"px,"+b+"px,0)"),this.forRepaintDummy=c.offsetWidth,_(c,"transition","transform "+v+"ms"+(this.options.easing?" "+this.options.easing:"")),_(c,"transform","translate3d(0,0,0)"),typeof c.animated=="number"&&clearTimeout(c.animated),c.animated=setTimeout(function(){_(c,"transition",""),_(c,"transform",""),c.animated=!1,c.animatingX=!1,c.animatingY=!1},v))}}}var be=[],Be={initializeByDefault:!0},je={mount:function(o){for(var l in Be)!Be.hasOwnProperty(l)||l in o||(o[l]=Be[l]);be.forEach(function(c){if(c.pluginName===o.pluginName)throw"Sortable: Cannot mount plugin ".concat(o.pluginName," more than once")}),be.push(o)},pluginEvent:function(o,l,c){var f=this;this.eventCanceled=!1,c.cancel=function(){f.eventCanceled=!0};var u=o+"Global";be.forEach(function(v){l[v.pluginName]&&(l[v.pluginName][u]&&l[v.pluginName][u](e({sortable:l},c)),l.options[v.pluginName]&&l[v.pluginName][o]&&l[v.pluginName][o](e({sortable:l},c)))})},initializePlugins:function(o,l,c,f){for(var u in be.forEach(function(y){var b=y.pluginName;(o.options[b]||y.initializeByDefault)&&((y=new y(o,l,o.options)).sortable=o,y.options=o.options,o[b]=y,n(c,y.defaults))}),o.options){var v;o.options.hasOwnProperty(u)&&(v=this.modifyOption(o,u,o.options[u]))!==void 0&&(o.options[u]=v)}},getEventProperties:function(o,l){var c={};return be.forEach(function(f){typeof f.eventProperties=="function"&&n(c,f.eventProperties.call(l[f.pluginName],o))}),c},modifyOption:function(o,l,c){var f;return be.forEach(function(u){o[u.pluginName]&&u.optionListeners&&typeof u.optionListeners[l]=="function"&&(f=u.optionListeners[l].call(o[u.pluginName],c))}),f}};function Te(o){var l=o.sortable,c=o.rootEl,f=o.name,u=o.targetEl,v=o.cloneEl,y=o.toEl,b=o.fromEl,k=o.oldIndex,x=o.newIndex,D=o.oldDraggableIndex,X=o.newDraggableIndex,re=o.originalEvent,q=o.putSortable,W=o.extraEventProperties;if(l=l||c&&c[$]){var Q,oe=l.options,o="on"+f.charAt(0).toUpperCase()+f.substr(1);!window.CustomEvent||d||p?(Q=document.createEvent("Event")).initEvent(f,!0,!0):Q=new CustomEvent(f,{bubbles:!0,cancelable:!0}),Q.to=y||c,Q.from=b||c,Q.item=u||c,Q.clone=v,Q.oldIndex=k,Q.newIndex=x,Q.oldDraggableIndex=D,Q.newDraggableIndex=X,Q.originalEvent=re,Q.pullMode=q?q.lastPutMode:void 0;var we,K=e(e({},W),je.getEventProperties(f,l));for(we in K)Q[we]=K[we];c&&c.dispatchEvent(Q),oe[o]&&oe[o].call(l,Q)}}function me(o,l){var c=(f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).evt,f=s(f,Xe);je.pluginEvent.bind(O)(o,l,e({dragEl:P,parentEl:de,ghostEl:B,rootEl:se,nextEl:vt,lastDownEl:di,cloneEl:ue,cloneHidden:ot,dragStarted:Vt,putSortable:Ae,activeSortable:O.active,originalEvent:c,oldIndex:xt,oldDraggableIndex:Xt,newIndex:xe,newDraggableIndex:at,hideGhostForTarget:jn,unhideGhostForTarget:Xn,cloneNowHidden:function(){ot=!0},cloneNowShown:function(){ot=!1},dispatchSortableEvent:function(u){ge({sortable:l,name:u,originalEvent:c})}},f))}var Xe=["evt"];function ge(o){Te(e({putSortable:Ae,cloneEl:ue,targetEl:P,rootEl:se,oldIndex:xt,oldDraggableIndex:Xt,newIndex:xe,newDraggableIndex:at},o))}var P,de,B,se,vt,di,ue,ot,xt,xe,Xt,at,ui,Ae,bt,Ne,Ki,Gi,Hn,Nn,Vt,Rt,Jt,f
2i,ye,Lt=!1,pi=!1,mi=[],Wt=!1,gi=!1,Yi=[],Qi=!1,vi=[],bi=typeof document<"u",yi=T,Fn=p||d?"cssFloat":"float",Js=bi&&!Kt&&!T&&"draggable"in document.createElement("div"),$n=function(){if(bi){if(d)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),Un=function(x,l){var c=_(x),f=parseInt(c.width)-parseInt(c.paddingLeft)-parseInt(c.paddingRight)-parseInt(c.borderLeftWidth)-parseInt(c.borderRightWidth),u=Y(x,0,l),v=Y(x,1,l),y=u&&_(u),b=v&&_(v),k=y&&parseInt(y.marginLeft)+parseInt(y.marginRight)+j(u).width,x=b&&parseInt(b.marginLeft)+parseInt(b.marginRight)+j(v).width;return c.display==="flex"?c.flexDirection==="column"||c.flexDirection==="column-reverse"?"vertical":"horizontal":c.display==="grid"?c.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal":u&&y.float&&y.float!=="none"?(l=y.float==="left"?"left":"right",!v||b.clear!=="both"&&b.clear!==l?"horizontal":"vertical"):u&&(y.display==="block"||y.display==="flex"||y.display==="table"||y.display==="grid"||f<=k&&c[Fn]==="none"||v&&c[Fn]==="none"&&f<k+x)?"vertical":"horizontal"},Bn=function(o){function l(u,v){return function(y,b,k,x){var D=y.options.group.name&&b.options.group.name&&y.options.group.name===b.options.group.name;return u==null&&(v||D)?!0:u==null||u===!1?!1:v&&u==="clone"?u:typeof u=="function"?l(u(y,b,k,x),v)(y,b,k,x):(b=(v?y:b).options.group.name,u===!0||typeof u=="string"&&u===b||u.join&&-1<u.indexOf(b))}}var c={},f=o.group;f&&i(f)=="object"||(f={name:f}),c.name=f.name,c.checkPull=l(f.pull,!0),c.checkPut=l(f.put),c.revertClone=f.revertClone,o.group=c},jn=function(){!$n&&B&&_(B,"display","none")},Xn=function(){!$n&&B&&_(B,"display","")};bi&&!Kt&&document.addEventListener("click",function(o){if(pi)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),pi=!1},!0);function yt(o){if(P){o=o.touches?o.touches[0]:o;var l=(u=o.clientX,v=o.clientY,mi.some(function(b){var k=b[$].options.emptyInsertThreshold;if(k&&!Qe(b)){var x=j(b),D=u>=x.left-k&&u<=x.right+k,k=v>=x.top-k&&v<=x.bottom+k;return D&&k?y=b:void 0}}),y);if(l){var c,f={};for(c in o)o.hasOwnProperty(c)&&(f[c]=o[c]);f.target=f.rootEl=l,f.preventDefault=void 0,f.stopPropagation=void 0,l[$]._onDragOver(f)}}var u,v,y}function Ws(o){P&&P.parentNode[$]._isOutsideThisEl(o.target)}function O(o,l){if(!o||!o.nodeType||o.nodeType!==1)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));this.el=o,this.options=l=n({},l),o[$]=this;var c,f,u={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(o.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Un(o,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(v,y){v.setData("Text",y.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:O.supportPointer!==!1&&"PointerEvent"in window&&!C,emptyInsertThreshold:5};for(c in je.initializePlugins(this,o,u),u)c in l||(l[c]=u[c]);for(f in Bn(l),this)f.charAt(0)==="_"&&typeof this[f]=="function"&&(this[f]=this[f].bind(this));this.nativeDraggable=!l.forceFallback&&Js,this.nativeDraggable&&(this.options.touchStartThreshold=1),l.supportPointer?m(o,"pointerdown",this._onTapStart):(m(o,"mousedown",this._onTapStart),m(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(m(o,"dragover",this),m(o,"dragenter",this)),mi.push(this.el),l.store&&l.store.get&&this.sort(l.store.get(this)||[]),n(this,rt())}function wi(o,l,c,f,u,v,y,b){var k,x,D=o[$],X=D.options.onMove;return!window.CustomEvent||d||p?(k=document.createEvent("Event")).initEvent("move",!0,!0):k=new CustomEvent("move",{bubbles:!0,cancelable:!0}),k.to=l,k.from=o,k.dragged=c,k.draggedRect=f,k.related=u||l,k.relatedRect=v||j(l),k.willInsertAfter=b,k.originalEvent=y,o.dispatchEvent(k),x=X?X.call(D,k,y):x}function Zi(o){o.draggable=!1}function qs(){Qi=!1}function Ei(o){return setTimeout(o,0)}function en(o){return clearTimeout(o)}O.prototype={constructor:O,_isOutsideThisEl:function(o){this.el.contains(o)||o===this.el||(Rt=null)},_getDirection:function(o,l){return typeof this.options.direction=="function"?this.options.direction.call(this,o,l,P):this.options.direction}
vendor: 4,208 bytes, line 2
2,_onTapStart:function(o){if(o.cancelable){var l=this,c=this.el,f=this.options,u=f.preventOnFilter,v=o.type,y=o.touches&&o.touches[0]||o.pointerType&&o.pointerType==="touch"&&o,b=(y||o).target,k=o.target.shadowRoot&&(o.path&&o.path[0]||o.composedPath&&o.composedPath()[0])||b,x=f.filter;if(function(D){vi.length=0;for(var X=D.getElementsByTagName("input"),re=X.length;re--;){var q=X[re];q.checked&&vi.push(q)}}(c),!P&&!(/mousedown|pointerdown/.test(v)&&o.button!==0||f.disabled)&&!k.isContentEditable&&(this.nativeDraggable||!C||!b||b.tagName.toUpperCase()!=="SELECT")&&!((b=V(b,f.draggable,c,!1))&&b.animated||di===b)){if(xt=N(b),Xt=N(b,f.draggable),typeof x=="function"){if(x.call(this,o,b,this))return ge({sortable:l,rootEl:k,name:"filter",targetEl:b,toEl:c,fromEl:c}),me("filter",l,{evt:o}),void(u&&o.cancelable&&o.preventDefault())}else if(x=x&&x.split(",").some(function(D){if(D=V(k,D.trim(),c,!1))return ge({sortable:l,rootEl:D,name:"filter",targetEl:b,fromEl:c,toEl:c}),me("filter",l,{evt:o}),!0}))return void(u&&o.cancelable&&o.preventDefault());f.handle&&!V(k,f.handle,c,!1)||this._prepareDragStart(o,y,b)}}},_prepareDragStart:function(o,l,c){var f,u=this,v=u.el,y=u.options,b=v.ownerDocument;c&&!P&&c.parentNode===v&&(f=j(c),se=v,de=(P=c).parentNode,vt=P.nextSibling,di=c,ui=y.group,bt={target:O.dragged=P,clientX:(l||o).clientX,clientY:(l||o).clientY},Hn=bt.clientX-f.left,Nn=bt.clientY-f.top,this._lastX=(l||o).clientX,this._lastY=(l||o).clientY,P.style["will-change"]="all",f=function(){me("delayEnded",u,{evt:o}),O.eventCanceled?u._onDrop():(u._disableDelayedDragEvents(),!A&&u.nativeDraggable&&(P.draggable=!0),u._triggerDragStart(o,l),ge({sortable:u,name:"choose",originalEvent:o}),I(P,y.chosenClass,!0))},y.ignore.split(",").forEach(function(k){w(P,k.trim(),Zi)}),m(b,"dragover",yt),m(b,"mousemove",yt),m(b,"touchmove",yt),m(b,"mouseup",u._onDrop),m(b,"touchend",u._onDrop),m(b,"touchcancel",u._onDrop),A&&this.nativeDraggable&&(this.options.touchStartThreshold=4,P.draggable=!0),me("delayStart",this,{evt:o}),!y.delay||y.delayOnTouchOnly&&!l||this.nativeDraggable&&(p||d)?f():O.eventCanceled?this._onDrop():(m(b,"mouseup",u._disableDelayedDrag),m(b,"touchend",u._disableDelayedDrag),m(b,"touchcancel",u._disableDelayedDrag),m(b,"mousemove",u._delayedDragTouchMoveHandler),m(b,"touchmove",u._delayedDragTouchMoveHandler),y.supportPointer&&m(b,"pointermove",u._delayedDragTouchMoveHandler),u._dragStartTimer=setTimeout(f,y.delay)))},_delayedDragTouchMoveHandler:function(o){o=o.touches?o.touches[0]:o,Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){P&&Zi(P),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var o=this.el.ownerDocument;S(o,"mouseup",this._disableDelayedDrag),S(o,"touchend",this._disableDelayedDrag),S(o,"touchcancel",this._disableDelayedDrag),S(o,"mousemove",this._delayedDragTouchMoveHandler),S(o,"touchmove",this._delayedDragTouchMoveHandler),S(o,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(o,l){l=l||o.pointerType=="touch"&&o,!this.nativeDraggable||l?this.options.supportPointer?m(document,"pointermove",this._onTouchMove):m(document,l?"touchmove":"mousemove",this._onTouchMove):(m(P,"dragend",this),m(se,"dragstart",this._onDragStart));try{document.selection?Ei(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(o,l){var c;Lt=!1,se&&P?(me("dragStarted",this,{evt:l}),this.nativeDraggable&&m(document,"dragover",Ws),c=this.options,o||I(P,c.dragClass,!1),I(P,c.ghostClass,!0),O.active=this,o&&this._appendGhost(),ge({sortable:this,name:"start",originalEvent:l})):this._nulling()},_emulateDragOver:function(){if(Ne){this._lastX=Ne.clientX,this._lastY=Ne.clientY,jn();for(var o=document.elementFromPoint(Ne.clientX,Ne.clientY),l=o;o&&o.shadowRoot&&(o=o.shadowRoot.elementFromPoint(Ne.clientX,Ne.clientY))!==l;)l=o;if(P.parentNode[$]._isOutsideThisEl(o),l)do if(l[$]&&l[$]._onDragOver({clientX:Ne.clientX,clientY:Ne.clientY,target:o,rootEl:l}
vendor: 7,106 bytes, line 2
2)&&!this.options.dragoverBubble)break;while(l=(o=l).parentNode);Xn()}},_onTouchMove:function(o){if(bt){var v=this.options,l=v.fallbackTolerance,c=v.fallbackOffset,f=o.touches?o.touches[0]:o,u=B&&ne(B,!0),y=B&&u&&u.a,b=B&&u&&u.d,v=yi&&ye&&mt(ye),y=(f.clientX-bt.clientX+c.x)/(y||1)+(v?v[0]-Yi[0]:0)/(y||1),b=(f.clientY-bt.clientY+c.y)/(b||1)+(v?v[1]-Yi[1]:0)/(b||1);if(!O.active&&!Lt){if(l&&Math.max(Math.abs(f.clientX-this._lastX),Math.abs(f.clientY-this._lastY))<l)return;this._onDragStart(o,!0)}B&&(u?(u.e+=y-(Ki||0),u.f+=b-(Gi||0)):u={a:1,b:0,c:0,d:1,e:y,f:b},u="matrix(".concat(u.a,",").concat(u.b,",").concat(u.c,",").concat(u.d,",").concat(u.e,",").concat(u.f,")"),_(B,"webkitTransform",u),_(B,"mozTransform",u),_(B,"msTransform",u),_(B,"transform",u),Ki=y,Gi=b,Ne=f),o.cancelable&&o.preventDefault()}},_appendGhost:function(){if(!B){var o=this.options.fallbackOnBody?document.body:se,l=j(P,!0,yi,!0,o),c=this.options;if(yi){for(ye=o;_(ye,"position")==="static"&&_(ye,"transform")==="none"&&ye!==document;)ye=ye.parentNode;ye!==document.body&&ye!==document.documentElement?(ye===document&&(ye=R()),l.top+=ye.scrollTop,l.left+=ye.scrollLeft):ye=R(),Yi=mt(ye)}I(B=P.cloneNode(!0),c.ghostClass,!1),I(B,c.fallbackClass,!0),I(B,c.dragClass,!0),_(B,"transition",""),_(B,"transform",""),_(B,"box-sizing","border-box"),_(B,"margin",0),_(B,"top",l.top),_(B,"left",l.left),_(B,"width",l.width),_(B,"height",l.height),_(B,"opacity","0.8"),_(B,"position",yi?"absolute":"fixed"),_(B,"zIndex","100000"),_(B,"pointerEvents","none"),O.ghost=B,o.appendChild(B),_(B,"transform-origin",Hn/parseInt(B.style.width)*100+"% "+Nn/parseInt(B.style.height)*100+"%")}},_onDragStart:function(o,l){var c=this,f=o.dataTransfer,u=c.options;me("dragStart",this,{evt:o}),O.eventCanceled?this._onDrop():(me("setupClone",this),O.eventCanceled||((ue=H(P)).removeAttribute("id"),ue.draggable=!1,ue.style["will-change"]="",this._hideClone(),I(ue,this.options.chosenClass,!1),O.clone=ue),c.cloneId=Ei(function(){me("clone",c),O.eventCanceled||(c.options.removeCloneOnHide||se.insertBefore(ue,P),c._hideClone(),ge({sortable:c,name:"clone"}))}),l||I(P,u.dragClass,!0),l?(pi=!0,c._loopId=setInterval(c._emulateDragOver,50)):(S(document,"mouseup",c._onDrop),S(document,"touchend",c._onDrop),S(document,"touchcancel",c._onDrop),f&&(f.effectAllowed="move",u.setData&&u.setData.call(c,f,P)),m(document,"drop",c),_(P,"transform","translateZ(0)")),Lt=!0,c._dragStartId=Ei(c._dragStarted.bind(c,l,o)),m(document,"selectstart",c),Vt=!0,C&&_(document.body,"user-select","none"))},_onDragOver:function(o){var l,c,f,u,v,y=this.el,b=o.target,k=this.options,x=k.group,D=O.active,X=ui===x,re=k.sort,q=Ae||D,W=this,Q=!1;if(!Qi){if(o.preventDefault!==void 0&&o.cancelable&&o.preventDefault(),b=V(b,k.draggable,y,!0),Ze("dragOver"),O.eventCanceled)return Q;if(P.contains(o.target)||b.animated&&b.animatingX&&b.animatingY||W._ignoreWhileAnimating===b)return Ve(!1);if(pi=!1,D&&!k.disabled&&(X?re||(c=de!==se):Ae===this||(this.lastPutMode=ui.checkPull(this,D,P,o))&&x.checkPut(this,D,P,o))){if(f=this._getDirection(o,b)==="vertical",l=j(P),Ze("dragOverValid"),O.eventCanceled)return Q;if(c)return de=se,wt(),this._hideClone(),Ze("revert"),O.eventCanceled||(vt?se.insertBefore(P,vt):se.appendChild(P)),Ve(!0);var oe=Qe(y,k.draggable);if(oe&&(G=o,x=f,le=j(Qe((Z=this).el,Z.options.draggable)),Z=J(Z.el,Z.options,B),!(x?G.clientX>Z.right+10||G.clientY>le.bottom&&G.clientX>le.left:G.clientY>Z.bottom+10||G.clientX>le.right&&G.clientY>le.top)||oe.animated)){if(oe&&(u=o,v=f,ae=j(Y((Ee=this).el,0,Ee.options,!0)),Ee=J(Ee.el,Ee.options,B),v?u.clientX<Ee.left-10||u.clientY<ae.top&&u.clientX<ae.right:u.clientY<Ee.top-10||u.clientY<ae.bottom&&u.clientX<ae.left)){var we=Y(y,0,k,!0);if(we===P)return Ve(!1);if(Le=j(b=we),wi(se,y,P,l,b,Le,o,!1)!==!1)return wt(),y.insertBefore(P,we),de=y,_i(),Ve(!0)}else if(b.parentNode===y){var K,Ue,lt,Le=j(b),Z=P.parentNode!==y,G=(G=P.animated&&P.toRect||l,le=b.animated&&b.toRect||Le,Ee=(v=f)?G.left:G.top,u=v?G.right:G.bottom,ae=v?G.width:G.height,we=v?le.left:le.top,G=v?le.right:le.bottom,le=v?le.width:le.height,!(Ee===we||u===G||Ee+ae/2===we+le/2)),Ee=f?"top":"left",ae=Ce(b,"top","top")||Ce(P,"top","top"),we=ae?ae.scrollTop:void 0;if(Rt!==b&&(Ue=Le[Ee],Wt=!1,gi=!G&&k.invertSwap||Z),(K=function(ct,Pi,Je,tt,hn,xi,Wn,Gs){var et=tt?ct.clientY:ct.clientX,ht=tt?Je.height:Je.width,ct=tt?Je.top:Je.left,tt=tt?Je.bottom:Je.right,Je=!1;if(!Wn){if(Gs&&fi<ht*hn){if(Wt=!Wt&&(Jt===1?ct+ht*xi/2<et:et<tt-ht*xi/2)?!0:Wt)Je=!0;else if(Jt===1?et<ct+fi:tt-fi<et)return-Jt}else if(ct+ht*(1-hn)/2<et&&et<tt-ht*(1-hn)/2)return function(Ys){return N(P)<N(Ys)?1:-1}(Pi)}return(Je=Je||Wn)&&(et<ct+ht*xi/2||tt-ht*xi/2<et)?ct+ht/2<et?1:-1:0}(o,b,Le,f,G?1:k.swapThreshold,k.invertedSwapThreshold==null?k.swapThreshold:k.invertedSwapThreshold,gi,Rt===b))!==0)for(var Ti=N(P);(lt=de.children[Ti-=K])&&(_(lt,"display")==="none"||lt===B););if(K===0||lt===b)return Ve(!1);Jt=K;var le=(Rt=b).nextElementSibling,Z=!1,G=wi(se,y,P,l,b,Le,o,Z=K===1);if(G!==!1)return G!==1&&G!==-1||(Z=G===1),Qi=!0,setTimeout(qs,30),wt(),Z&&!le?y.appendChild(P):b.parentNode.insertBefore(P,Z?le:b),ae&&Pt(ae,0,we-ae.scrollTop),de=P.parentNode,Ue===void 0||gi||(fi=Math.abs(Ue-j(b)[Ee])),_i(),Ve(!0)}}else{if(oe===P)return Ve(!1);if((b=oe&&y===o.target?oe:b)&&(Le=j(b)),wi(se,y,P,l,b,Le,o,!!b)!==!1)return wt(),oe&&oe.nextSibling?y.insertBefore(P,oe.nextSibling):y.appendChild(P),de=y,_i(),Ve(!0)}if(y.contains(P))return Ve(!1)}return!1}function Ze(Zt,zs){me(Zt,W,e({evt:o,isOwner:X,axis:f?"vertical":"horizontal",revert:c,dragRect:l,targetRect:Le,canSort:re,fromSortable:q,target:b,completed:Ve,onMove:function(Pi,Ks){return wi(se,y,P,l,Pi,j(Pi),o,Ks)},changed:_i},zs))}function wt(){Ze("dragOverAnimationCapture"),W.captureAnimationState(),W!==q&&q.captureAnimationState()}function Ve(Zt){return Ze("dragOverCompleted",{insertion:Zt}),Zt&&(X?D._hideClone():D._showClone(W),W!==q&&(I(P,(Ae||D).options.ghostClass,!1),I(P,k.ghostClass,!0)),Ae!==W&&W!==O.active?Ae=W:W===O.active&&Ae&&(Ae=null),q===W&&(W._ignoreWhileAnimating=b),W.animateAll(function(){Ze("dragOverAnimationComplete"),W._ignoreWhileAnimating=null}),W!==q&&(q.animateAll(),q._ignoreWhileAnimating=null)),(b===P&&!P.animated||b===y&&!b.animated)&&(Rt=null),k.dragoverBubble||o.rootEl||b===document||(P.parentNode[$]._isOutsideThisEl(o.target),Zt||yt(o)),!k.dragoverBubble&&o.stopPropagation&&o.stopPropagation(),Q=!0}function _i(){xe=N(P),at=N(P,k.draggable),ge({sortable:W,name:"change",toEl:y,newIndex:xe,newDraggableIndex:at,originalEvent:o})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){S(document,"mousemove",this._onTouchMove),S(document,"touchmove",this._onTouchMove),S(document,"pointermove",this._onTouchMove),S(document,"dragover",yt),S(document,"mousemove",yt),S(document,"touchmove",yt)},_offUpEvents:function(){var o=this.el.ownerDocument;S(o,"mouseup",this._onDrop),S(o,"touchend",this._onDrop),S(o,"pointerup",this._onDrop),S(o,"touchcancel",this._onDrop),S(document,"selectstart",this)},_onDrop:function(o){var l=this.el,c=this.options;xe=N(P),at=N(P,c.draggable),me("drop",this,{evt:o}
vendor: 4,313 bytes, line 2
2),de=P&&P.parentNode,xe=N(P),at=N(P,c.draggable),O.eventCanceled||(Wt=gi=Lt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),en(this.cloneId),en(this._dragStartId),this.nativeDraggable&&(S(document,"drop",this),S(l,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),C&&_(document.body,"user-select",""),_(P,"transform",""),o&&(Vt&&(o.cancelable&&o.preventDefault(),c.dropBubble||o.stopPropagation()),B&&B.parentNode&&B.parentNode.removeChild(B),(se===de||Ae&&Ae.lastPutMode!=="clone")&&ue&&ue.parentNode&&ue.parentNode.removeChild(ue),P&&(this.nativeDraggable&&S(P,"dragend",this),Zi(P),P.style["will-change"]="",Vt&&!Lt&&I(P,(Ae||this).options.ghostClass,!1),I(P,this.options.chosenClass,!1),ge({sortable:this,name:"unchoose",toEl:de,newIndex:null,newDraggableIndex:null,originalEvent:o}),se!==de?(0<=xe&&(ge({rootEl:de,name:"add",toEl:de,fromEl:se,originalEvent:o}),ge({sortable:this,name:"remove",toEl:de,originalEvent:o}),ge({rootEl:de,name:"sort",toEl:de,fromEl:se,originalEvent:o}),ge({sortable:this,name:"sort",toEl:de,originalEvent:o})),Ae&&Ae.save()):xe!==xt&&0<=xe&&(ge({sortable:this,name:"update",toEl:de,originalEvent:o}),ge({sortable:this,name:"sort",toEl:de,originalEvent:o})),O.active&&(xe!=null&&xe!==-1||(xe=xt,at=Xt),ge({sortable:this,name:"end",toEl:de,originalEvent:o}),this.save())))),this._nulling()},_nulling:function(){me("nulling",this),se=P=de=B=vt=ue=di=ot=bt=Ne=Vt=xe=at=xt=Xt=Rt=Jt=Ae=ui=O.dragged=O.ghost=O.clone=O.active=null,vi.forEach(function(o){o.checked=!0}),vi.length=Ki=Gi=0},handleEvent:function(o){switch(o.type){case"drop":case"dragend":this._onDrop(o);break;case"dragenter":case"dragover":P&&(this._onDragOver(o),function(l){l.dataTransfer&&(l.dataTransfer.dropEffect="move"),l.cancelable&&l.preventDefault()}(o));break;case"selectstart":o.preventDefault()}},toArray:function(){for(var o,l=[],c=this.el.children,f=0,u=c.length,v=this.options;f<u;f++)V(o=c[f],v.draggable,this.el,!1)&&l.push(o.getAttribute(v.dataIdAttr)||function(y){for(var b=y.tagName+y.className+y.src+y.href+y.textContent,k=b.length,x=0;k--;)x+=b.charCodeAt(k);return x.toString(36)}(o));return l},sort:function(o,l){var c={},f=this.el;this.toArray().forEach(function(u,v){v=f.children[v],V(v,this.options.draggable,f,!1)&&(c[u]=v)},this),l&&this.captureAnimationState(),o.forEach(function(u){c[u]&&(f.removeChild(c[u]),f.appendChild(c[u]))}),l&&this.animateAll()},save:function(){var o=this.options.store;o&&o.set&&o.set(this)},closest:function(o,l){return V(o,l||this.options.draggable,this.el,!1)},option:function(o,l){var c=this.options;if(l===void 0)return c[o];var f=je.modifyOption(this,o,l);c[o]=f!==void 0?f:l,o==="group"&&Bn(c)},destroy:function(){me("destroy",this);var o=this.el;o[$]=null,S(o,"mousedown",this._onTapStart),S(o,"touchstart",this._onTapStart),S(o,"pointerdown",this._onTapStart),this.nativeDraggable&&(S(o,"dragover",this),S(o,"dragenter",this)),Array.prototype.forEach.call(o.querySelectorAll("[draggable]"),function(l){l.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),mi.splice(mi.indexOf(this.el),1),this.el=o=null},_hideClone:function(){ot||(me("hideClone",this),O.eventCanceled||(_(ue,"display","none"),this.options.removeCloneOnHide&&ue.parentNode&&ue.parentNode.removeChild(ue),ot=!0))},_showClone:function(o){o.lastPutMode==="clone"?ot&&(me("showClone",this),O.eventCanceled||(P.parentNode!=se||this.options.group.revertClone?vt?se.insertBefore(ue,vt):se.appendChild(ue):se.insertBefore(ue,P),this.options.group.revertClone&&this.animate(P,ue),_(ue,"display",""),ot=!1)):this._hideClone()}},bi&&m(document,"touchmove",function(o){(O.active||Lt)&&o.cancelable&&o.preventDefault()}),O.utils={on:m,off:S,css:_,find:w,is:function(o,l){return!!V(o,l,o,!1)},extend:function(o,l){if(o&&l)for(var c in l)l.hasOwnProperty(c)&&(o[c]=l[c]);return o},throttle:ci,closest:V,toggleClass:I,clone:H,index:N,nextTick:Ei,cancelNextTick:en,detectDirection:Un,getChild:Y},O.get=function(o){return o[$]},O.mount=function(){for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];(l=l[0].constructor===Array?l[0]:l).forEach(function(f){if(!f.prototype||!f.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(f));f.utils&&(O.utils=e(e({}
vendor: 6,091 bytes, line 2
2,O.utils),f.utils)),je.mount(f)})},O.create=function(o,l){return new O(o,l)};var qt,tn,nn,sn,Ai,zt,fe=[],rn=!(O.version="1.15.2");function Si(){fe.forEach(function(o){clearInterval(o.pid)}),fe=[]}function Vn(){clearInterval(zt)}var Fe,on=ci(function(o,l,c,f){if(l.scroll){var u,v=(o.touches?o.touches[0]:o).clientX,y=(o.touches?o.touches[0]:o).clientY,b=l.scrollSensitivity,k=l.scrollSpeed,x=R(),D=!1;tn!==c&&(tn=c,Si(),qt=l.scroll,u=l.scrollFn,qt===!0&&(qt=He(c,!0)));var X=0,re=qt;do{var q=re,Z=j(q),W=Z.top,Q=Z.bottom,oe=Z.left,we=Z.right,K=Z.width,Ue=Z.height,lt=void 0,Ti=void 0,Le=q.scrollWidth,Ee=q.scrollHeight,ae=_(q),le=q.scrollLeft,Z=q.scrollTop,Ti=q===x?(lt=K<Le&&(ae.overflowX==="auto"||ae.overflowX==="scroll"||ae.overflowX==="visible"),Ue<Ee&&(ae.overflowY==="auto"||ae.overflowY==="scroll"||ae.overflowY==="visible")):(lt=K<Le&&(ae.overflowX==="auto"||ae.overflowX==="scroll"),Ue<Ee&&(ae.overflowY==="auto"||ae.overflowY==="scroll")),le=lt&&(Math.abs(we-v)<=b&&le+K<Le)-(Math.abs(oe-v)<=b&&!!le),Z=Ti&&(Math.abs(Q-y)<=b&&Z+Ue<Ee)-(Math.abs(W-y)<=b&&!!Z);if(!fe[X])for(var G=0;G<=X;G++)fe[G]||(fe[G]={});fe[X].vx==le&&fe[X].vy==Z&&fe[X].el===q||(fe[X].el=q,fe[X].vx=le,fe[X].vy=Z,clearInterval(fe[X].pid),le==0&&Z==0||(D=!0,fe[X].pid=setInterval(function(){f&&this.layer===0&&O.active._onTouchMove(Ai);var Ze=fe[this.layer].vy?fe[this.layer].vy*k:0,wt=fe[this.layer].vx?fe[this.layer].vx*k:0;typeof u=="function"&&u.call(O.dragged.parentNode[$],wt,Ze,o,Ai,fe[this.layer].el)!=="continue"||Pt(fe[this.layer].el,wt,Ze)}.bind({layer:X}),24))),X++}while(l.bubbleScroll&&re!==x&&(re=He(re,!1)));rn=D}},30),Kt=function(b){var l=b.originalEvent,c=b.putSortable,f=b.dragEl,u=b.activeSortable,v=b.dispatchSortableEvent,y=b.hideGhostForTarget,b=b.unhideGhostForTarget;l&&(u=c||u,y(),l=l.changedTouches&&l.changedTouches.length?l.changedTouches[0]:l,l=document.elementFromPoint(l.clientX,l.clientY),b(),u&&!u.el.contains(l)&&(v("spill"),this.onSpill({dragEl:f,putSortable:c})))};function an(){}function ln(){}an.prototype={startIndex:null,dragStart:function(o){o=o.oldDraggableIndex,this.startIndex=o},onSpill:function(o){var l=o.dragEl,c=o.putSortable;this.sortable.captureAnimationState(),c&&c.captureAnimationState(),o=Y(this.sortable.el,this.startIndex,this.options),o?this.sortable.el.insertBefore(l,o):this.sortable.el.appendChild(l),this.sortable.animateAll(),c&&c.animateAll()},drop:Kt},n(an,{pluginName:"revertOnSpill"}),ln.prototype={onSpill:function(c){var l=c.dragEl,c=c.putSortable||this.sortable;c.captureAnimationState(),l.parentNode&&l.parentNode.removeChild(l),c.animateAll()},drop:Kt},n(ln,{pluginName:"removeOnSpill"});var Gt,$e,te,Yt,ki,U=[],Re=[],Qt=!1,_e=!1,Dt=!1;function Jn(o,l){Re.forEach(function(c,f){f=l.children[c.sortableIndex+(o?Number(f):0)],f?l.insertBefore(c,f):l.appendChild(c)})}function Ci(){U.forEach(function(o){o!==te&&o.parentNode&&o.parentNode.removeChild(o)})}return O.mount(new function(){function o(){for(var l in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)l.charAt(0)==="_"&&typeof this[l]=="function"&&(this[l]=this[l].bind(this))}return o.prototype={dragStarted:function(l){l=l.originalEvent,this.sortable.nativeDraggable?m(document,"dragover",this._handleAutoScroll):this.options.supportPointer?m(document,"pointermove",this._handleFallbackAutoScroll):l.touches?m(document,"touchmove",this._handleFallbackAutoScroll):m(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(l){l=l.originalEvent,this.options.dragOverBubble||l.rootEl||this._handleAutoScroll(l)},drop:function(){this.sortable.nativeDraggable?S(document,"dragover",this._handleAutoScroll):(S(document,"pointermove",this._handleFallbackAutoScroll),S(document,"touchmove",this._handleFallbackAutoScroll),S(document,"mousemove",this._handleFallbackAutoScroll)),Vn(),Si(),clearTimeout(pe),pe=void 0},nulling:function(){Ai=tn=qt=rn=zt=nn=sn=null,fe.length=0},_handleFallbackAutoScroll:function(l){this._handleAutoScroll(l,!0)},_handleAutoScroll:function(l,c){var f,u=this,v=(l.touches?l.touches[0]:l).clientX,y=(l.touches?l.touches[0]:l).clientY,b=document.elementFromPoint(v,y);Ai=l,c||this.options.forceAutoScrollFallback||p||d||C?(on(l,this.options,b,c),f=He(b,!0),!rn||zt&&v===nn&&y===sn||(zt&&Vn(),zt=setInterval(function(){var k=He(document.elementFromPoint(v,y),!0);k!==f&&(f=k,Si()),on(l,u.options,k,c)},10),nn=v,sn=y)):this.options.bubbleScroll&&He(b,!0)!==R()?on(l,this.options,He(b,!1),!1):Si()}},n(o,{pluginName:"scroll",initializeByDefault:!0})}),O.mount(ln,an),O.mount(new function(){function o(){this.defaults={swapClass:"sortable-swap-highlight"}}return o.prototype={dragStart:function(l){l=l.dragEl,Fe=l},dragOverValid:function(l){var c=l.completed,f=l.target,u=l.onMove,v=l.activeSortable,y=l.changed,b=l.cancel;v.options.swap&&(l=this.sortable.el,v=this.options,f&&f!==l&&(l=Fe,Fe=u(f)!==!1?(I(f,v.swapClass,!0),f):null,l&&l!==Fe&&I(l,v.swapClass,!1)),y(),c(!0),b())},drop:function(l){var c,f,u=l.activeSortable,v=l.putSortable,y=l.dragEl,b=v||this.sortable,k=this.options;Fe&&I(Fe,k.swapClass,!1),Fe&&(k.swap||v&&v.options.swap)&&y!==Fe&&(b.captureAnimationState(),b!==u&&u.captureAnimationState(),f=Fe,l=(c=y).parentNode,k=f.parentNode,l&&k&&!l.isEqualNode(f)&&!k.isEqualNode(c)&&(v=N(c),y=N(f),l.isEqualNode(k)&&v<y&&y++,l.insertBefore(f,l.children[v]),k.insertBefore(c,k.children[y])),b.animateAll(),b!==u&&u.animateAll())},nulling:function(){Fe=null}},n(o,{pluginName:"swap",eventProperties:function(){return{swapItem:Fe}}})}),O.mount(new function(){function o(l){for(var c in this)c.charAt(0)==="_"&&typeof this[c]=="function"&&(this[c]=this[c].bind(this));l.options.avoidImplicitDeselect||(l.options.supportPointer?m(document,"pointerup",this._deselectMultiDrag):(m(document,"mouseup",this._deselectMultiDrag),m(document,"touchend",this._deselectMultiDrag))),m(document,"keydown",this._checkKeyDown),m(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(f,u){var v="";
vendor: 4,145 bytes, line 2
2U.length&&$e===l?U.forEach(function(y,b){v+=(b?", ":"")+y.textContent}):v=u.textContent,f.setData("Text",v)}}}return o.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(l){l=l.dragEl,te=l},delayEnded:function(){this.isMultiDrag=~U.indexOf(te)},setupClone:function(f){var c=f.sortable,f=f.cancel;if(this.isMultiDrag){for(var u=0;u<U.length;u++)Re.push(H(U[u])),Re[u].sortableIndex=U[u].sortableIndex,Re[u].draggable=!1,Re[u].style["will-change"]="",I(Re[u],this.options.selectedClass,!1),U[u]===te&&I(Re[u],this.options.chosenClass,!1);c._hideClone(),f()}},clone:function(v){var c=v.sortable,f=v.rootEl,u=v.dispatchSortableEvent,v=v.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||U.length&&$e===c&&(Jn(!0,f),u("clone"),v()))},showClone:function(u){var c=u.cloneNowShown,f=u.rootEl,u=u.cancel;this.isMultiDrag&&(Jn(!1,f),Re.forEach(function(v){_(v,"display","")}),c(),ki=!1,u())},hideClone:function(u){var c=this,f=(u.sortable,u.cloneNowHidden),u=u.cancel;this.isMultiDrag&&(Re.forEach(function(v){_(v,"display","none"),c.options.removeCloneOnHide&&v.parentNode&&v.parentNode.removeChild(v)}),f(),ki=!0,u())},dragStartGlobal:function(l){l.sortable,!this.isMultiDrag&&$e&&$e.multiDrag._deselectMultiDrag(),U.forEach(function(c){c.sortableIndex=N(c)}),U=U.sort(function(c,f){return c.sortableIndex-f.sortableIndex}),Dt=!0},dragStarted:function(u){var c,f=this,u=u.sortable;this.isMultiDrag&&(this.options.sort&&(u.captureAnimationState(),this.options.animation&&(U.forEach(function(v){v!==te&&_(v,"position","absolute")}),c=j(te,!1,!0,!0),U.forEach(function(v){v!==te&&F(v,c)}),Qt=_e=!0)),u.animateAll(function(){Qt=_e=!1,f.options.animation&&U.forEach(function(v){ee(v)}),f.options.sort&&Ci()}))},dragOver:function(u){var c=u.target,f=u.completed,u=u.cancel;_e&&~U.indexOf(c)&&(f(!1),u())},revert:function(l){var c,f,u=l.fromSortable,v=l.rootEl,y=l.sortable,b=l.dragRect;1<U.length&&(U.forEach(function(k){y.addAnimationState({target:k,rect:_e?j(k):b}),ee(k),k.fromRect=b,u.removeAnimationState(k)}),_e=!1,c=!this.options.removeCloneOnHide,f=v,U.forEach(function(k,x){x=f.children[k.sortableIndex+(c?Number(x):0)],x?f.insertBefore(k,x):f.appendChild(k)}))},dragOverCompleted:function(x){var c,f=x.sortable,u=x.isOwner,v=x.insertion,y=x.activeSortable,b=x.parentEl,k=x.putSortable,x=this.options;v&&(u&&y._hideClone(),Qt=!1,x.animation&&1<U.length&&(_e||!u&&!y.options.sort&&!k)&&(c=j(te,!1,!0,!0),U.forEach(function(D){D!==te&&(F(D,c),b.appendChild(D))}),_e=!0),u||(_e||Ci(),1<U.length?(u=ki,y._showClone(f),y.options.animation&&!ki&&u&&Re.forEach(function(D){y.addAnimationState({target:D,rect:Yt}),D.fromRect=Yt,D.thisAnimationDuration=null})):y._showClone(f)))},dragOverAnimationCapture:function(u){var c=u.dragRect,f=u.isOwner,u=u.activeSortable;U.forEach(function(v){v.thisAnimationDuration=null}),u.options.animation&&!f&&u.multiDrag.isMultiDrag&&(Yt=n({},c),c=ne(te,!0),Yt.top-=c.f,Yt.left-=c.e)},dragOverAnimationComplete:function(){_e&&(_e=!1,Ci())},drop:function(l){var c=l.originalEvent,f=l.rootEl,u=l.parentEl,v=l.sortable,y=l.dispatchSortableEvent,b=l.oldIndex,k=l.putSortable,x=k||this.sortable;if(c){var D,X,re,q=this.options,W=u.children;if(!Dt)if(q.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),I(te,q.selectedClass,!~U.indexOf(te)),~U.indexOf(te))U.splice(U.indexOf(te),1),Gt=null,Te({sortable:v,rootEl:f,name:"deselect",targetEl:te,originalEvent:c});else{if(U.push(te),Te({sortable:v,rootEl:f,name:"select",targetEl:te,originalEvent:c}),c.shiftKey&&Gt&&v.el.contains(Gt)){var Q=N(Gt),l=N(te);if(~Q&&~l&&Q!==l)for(var oe,we=Q<l?(oe=Q,l):(oe=l,Q+1);oe<we;oe++)~U.indexOf(W[oe])||(I(W[oe],q.selectedClass,!0),U.push(W[oe]),Te({sortable:v,rootEl:f,name:"select",targetEl:W[oe],originalEvent:c}))}else Gt=te;$e=x}Dt&&this.isMultiDrag&&(_e=!1,(u[$].options.sort||u!==f)&&1<U.length&&(D=j(te),X=N(te,":not(."+this.options.selectedClass+")"),!Qt&&q.animation&&(te.thisAnimationDuration=null),x.captureAnimationState(),Qt||(q.animation&&(te.fromRect=D,U.forEach(function(K){var Ue;K.thisAnimationDuration=null,K!==te&&(Ue=_e?j(K):D,K.fromRect=Ue,x.addAnimationState({target:K,rect:Ue}))}
2)),Ci(),U.forEach(function(K){W[X]?u.insertBefore(K,W[X]):u.appendChild(K),X++}),b===N(te)&&(re=!1,U.forEach(function(K){K.sortableIndex!==N(K)&&(re=!0)}),re&&(y("update"),y("sort")))),U.forEach(function(K){ee(K)}),x.animateAll()),$e=x),(f===u||k&&k.lastPutMode!=="clone")&&Re.forEach(function(K){K.parentNode&&K.parentNode.removeChild(K)})}},nullingGlobal:function(){this.isMultiDrag=Dt=!1,Re.length=0},destroyGlobal:function(){this._deselectMultiDrag(),S(document,"pointerup",this._deselectMultiDrag),S(document,"mouseup",this._deselectMultiDrag),S(document,"touchend",this._deselectMultiDrag),S(document,"keydown",this._checkKeyDown),S(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(l){if(!(Dt!==void 0&&Dt||$e!==this.sortable||l&&V(l.target,this.options.draggable,this.sortable.el,!1)||l&&l.button!==0))for(;U.length;){var c=U[0];I(c,this.options.selectedClass,!1),U.shift(),Te({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:c,originalEvent:l})}},_checkKeyDown:function(l){l.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(l){l.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},n(o,{pluginName:"multiDrag",utils:{select:function(l){var c=l.parentNode[$];c&&c.options.multiDrag&&!~U.indexOf(l)&&($e&&$e!==c&&($e.multiDrag._deselectMultiDrag(),$e=c),I(l,c.options.selectedClass,!0),U.push(l))},deselect:function(l){var c=l.parentNode[$],f=U.indexOf(l);c&&c.options.multiDrag&&~f&&(I(l,c.options.selectedClass,!1),U.splice(f,1))}},eventProperties:function(){var l=this,c=[],f=[];return U.forEach(function(u){var v;c.push({multiDragElement:u,index:u.sortableIndex}),v=_e&&u!==te?-1:_e?N(u,":not(."+l.options.selectedClass+")"):N(u),f.push({multiDragElement:u,index:v})}),{items:r(U),clones:[].concat(Re),oldIndicies:c,newIndicies:f}},optionListeners:{multiDragKey:function(l){return(l=l.toLowerCase())==="ctrl"?l="Control":1<l.length&&(l=l.charAt(0).toUpperCase()+l.substr(1)),l}}})}),O})});(function(){var t=e();function e(){if(typeof window.CustomEvent=="function")return window.CustomEvent;function s(r,a){a=a||{bubbles:!1,cancelable:!1,detail:void 0};var h=document.createEvent("CustomEvent");return h.initCustomEvent(r,a.bubbles,a.cancelable,a.detail),h}return s.prototype=window.Event.prototype,s}function i(s,r){var a=document.createElement("input");return a.type="hidden",a.name=s,a.value=r,a}function n(s,r){var a=s.getAttribute("data-to"),h=i("_method",s.getAttribute("data-method")),d=i("_csrf_token",s.getAttribute("data-csrf")),p=document.createElement("form"),A=document.createElement("input"),C=s.getAttribute("target");p.method=s.getAttribute("data-method")==="get"?"get":"post",p.action=a,p.style.display="none",C?p.target=C:r&&(p.target="_blank"),p.appendChild(d),p.appendChild(h),document.body.appendChild(p),A.type="submit",p.appendChild(A),A.click()}window.addEventListener("click",function(s){var r=s.target;if(!s.defaultPrevented)for(;r&&r.getAttribute;){var a=new t("phoenix.link.click",{bubbles:!0,cancelable:!0});if(!r.dispatchEvent(a))return s.preventDefault(),s.stopImmediatePropagation(),!1;if(r.getAttribute("data-method")&&r.getAttribute("data-to"))return n(r,s.metaKey||s.shiftKey),s.preventDefault(),!1;r=r.parentNode}},!1),window.addEventListener("phoenix.link.click",function(s){var r=s.target.getAttribute("data-confirm");r&&!window.confirm(r)&&s.preventDefault()},!1)})();var Mt=t=>typeof t=="function"?t:function(){return t},sr=typeof self<"u"?self:null,Ot=typeof window<"u"?window:null,We=sr||Ot||globalThis,rr="2.0.0",qe={connecting:0,open:1,closing:2,closed:3},or=100,ar=1e4,lr=1e3,De={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},it={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},cn={longpoll:"longpoll",websocket:"websocket"},hr={complete:4},dn="base64url.bearer.phx.",Ri=class{constructor(t,e,i,n){this.channel=t,this.event=e,this.payload=i||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,j
vendor: 15,025 bytes, lines 2-3
2oin_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:t,response:e,_ref:i}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},Gn=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},cr=class{constructor(t,e,i){this.state=De.closed,this.topic=t,this.params=Mt(e||{}),this.socket=i,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Ri(this,it.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Gn(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=De.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=De.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=De.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=De.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new Ri(this,it.leave,Mt({}),this.timeout).send(),this.state=De.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(it.reply,(n,s)=>{this.trigger(this.replyEventName(s),n)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(t){this.on(it.close,t)}onError(t){return this.on(it.error,e=>t(e))}on(t,e){let i=this.bindingRef++;return this.bindings.push({event:t,ref:i,callback:e}),i}off(t,e){this.bindings=this.bindings.filter(i=>!(i.event===t&&(typeof e>"u"||e===i.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,i=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new Ri(this,t,function(){return e},i);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=De.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(it.close,"leave")},i=new Ri(this,it.leave,Mt({}),t);return i.receive("ok",()=>e()).receive("timeout",()=>e()),i.send(),this.canPush()||i.trigger("ok",{}),i}onMessage(t,e,i){return e}isMember(t,e,i,n){return this.topic!==t?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:i,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=De.joining,this.joinPush.resend(t))}trigger(t,e,i,n){let s=this.onMessage(t,e,i,n);if(e&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let r=this.bindings.filter(a=>a.event===t);for(let a=0;a<r.length;a++)r[a].callback(s,i,n||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===De.closed}isErrored(){return this.state===De.errored}isJoined(){return this.state===De.joined}isJoining(){return this.state===De.joining}isLeaving(){return this.state===De.leaving}},Di=class{static request(t,e,i,n,s,r,a){if(We.XDomainRequest){let h=new We.XDomainRequest;return this.xdomainRequest(h,t,e,n,s,r,a)}else if(We.XMLHttpRequest){let h=new We.XMLHttpRequest;return this.xhrRequest(h,t,e,i,n,s,r,a)}else{if(We.fetch&&We.AbortController)return this.fetchRequest(t,e,i,n,s,r,a);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,i,n,s,r,a){let h={method:t,headers:i,body:n},d=null;if(s){d=new AbortController;let p=setTimeout(()=>d.abort(),s);h.signal=d.signal}return We.fetch(e,h).then(p=>p.text()).then(p=>this.parseJSON(p)).then(p=>a&&a(p)).catch(p=>{p.name==="AbortError"&&r?r():a&&a(null)}),d}static xdomainRequest(t,e,i,n,s,r,a){return t.timeout=s,t.open(e,i),t.onload=()=>{let h=this.parseJSON(t.responseText);a&&a(h)},r&&(t.ontimeout=r),t.onprogress=()=>{},t.send(n),t}static xhrRequest(t,e,i,n,s,r,a,h){t.open(e,i,!0),t.timeout=r;for(let[d,p]of Object.entries(n))t.setRequestHeader(d,p);return t.onerror=()=>h&&h(null),t.onreadystatechange=()=>{if(t.readyState===hr.complete&&h){let d=this.parseJSON(t.responseText);h(d)}},a&&(t.ontimeout=a),t.send(s),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let i=[];for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s=e?`${e}[${n}]`:n,r=t[n];typeof r=="object"?i.push(this.serialize(r,s)):i.push(encodeURIComponent(s)+"="+encodeURIComponent(r))}return i.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let i=t.match(/\?/)?"&":"?";return`${t}${i}${this.serialize(e)}`}},dr=t=>{let e="",i=new Uint8Array(t),n=i.byteLength;for(let s=0;s<n;s++)e+=String.fromCharCode(i[s]);return btoa(e)},It=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(dn)&&(this.authToken=atob(e[1].slice(dn.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=qe.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+cn.websocket),"$1/"+cn.longpoll)}endpointURL(){return Di.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,i){this.close(t,e,i),this.readyState=qe.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===qe.open||this.readyState===qe.connecting}poll(){let t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:i,token:n,messages:s}=e;if(i===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else i=0;switch(i){case 200:s.forEach(r=>{setTimeout(()=>this.onmessage({data:r}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=qe.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${i}`)}})}send(t){typeof t!="string"&&(t=dr(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t,e=0){this.awaitingBatchAck=!0;let i=e+or,n=t.slice(e,i);this.ajax("POST",{"Content-Type":"application/x-ndjson"},n.join(`
3`),()=>this.onerror("timeout"),s=>{!s||s.status!==200?(this.awaitingBatchAck=!1,this.onerror(s&&s.status),this.closeAndRetry(1011,"internal server error",!1)):i<t.length?this.batchSend(t,i):this.batchBuffer.length>0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1})}close(t,e,i){for(let s of this.reqs)s.abort();this.readyState=qe.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:i});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(t,e,i,n,s){let r,a=()=>{this.reqs.delete(r),n()};r=Di.request(t,this.endpointURL(),e,i,this.timeout,a,h=>{this.reqs.delete(r),this.isActive()&&s(h)}),this.reqs.add(r)}};var Li={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let i=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(i))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[i,n,s,r,a]=JSON.parse(t);return e({join_ref:i,ref:n,topic:s,event:r,payload:a})}},binaryEncode(t){let{join_ref:e,ref:i,event:n,topic:s,payload:r}=t,a=new TextEncoder,h=a.encode(e),d=a.encode(i),p=a.encode(s),A=a.encode(n);this.assertFieldSize(h.byteLength,"join_ref"),this.assertFieldSize(d.byteLength,"ref"),this.assertFieldSize(p.byteLength,"topic"),this.assertFieldSize(A.byteLength,"event");let C=this.META_LENGTH+h.byteLength+d.byteLength+p.byteLength+A.byteLength,T=new ArrayBuffer(this.HEADER_LENGTH+C),E=new Uint8Array(T),m=new DataView(T),S=0;m.setUint8(S++,this.KINDS.push),m.setUint8(S++,h.byteLength),m.setUint8(S++,d.byteLength),m.setUint8(S++,p.byteLength),m.setUint8(S++,A.byteLength),E.set(h,S),S+=h.byteLength,E.set(d,S),S+=d.byteLength,E.set(p,S),S+=p.byteLength,E.set(A,S),S+=A.byteLength;var L=new Uint8Array(T.byteLength+r.byteLength);return L.set(E,0),L.set(new Uint8Array(r),T.byteLength),L.buffer},assertFieldSize(t,e){if(t>255)throw new Error(`unable to convert ${e} to binary: must be less than or equal to 255 bytes, but is ${t} bytes`)},binaryDecode(t){let e=new DataView(t),i=e.getUint8(0),n=new TextDecoder;switch(i){case this.KINDS.push:return this.decodePush(t,e,n);case this.KINDS.reply:return this.decodeReply(t,e,n);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,n)}},decodePush(t,e,i){let n=e.getUint8(1),s=e.getUint8(2),r=e.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,h=i.decode(t.slice(a,a+n));a=a+n;let d=i.decode(t.slice(a,a+s));a=a+s;let p=i.decode(t.slice(a,a+r));a=a+r;let A=t.slice(a,t.byteLength);return{join_ref:h,ref:null,topic:d,event:p,payload:A}},decodeReply(t,e,i){let n=e.getUint8(1),s=e.getUint8(2),r=e.getUint8(3),a=e.getUint8(4),h=this.HEADER_LENGTH+this.META_LENGTH,d=i.decode(t.slice(h,h+n));h=h+n;let p=i.decode(t.slice(h,h+s));h=h+s;let A=i.decode(t.slice(h,h+r));h=h+r;let C=i.decode(t.slice(h,h+a));h=h+a;let T=t.slice(h,t.byteLength),E={status:C,response:T};return{join_ref:d,ref:p,topic:A,event:it.reply,payload:E}},decodeBroadcast(t,e,i){let n=e.getUint8(1),s=e.getUint8(2),r=this.HEADER_LENGTH+2,a=i.decode(t.slice(r,r+n));r=r+n;let h=i.decode(t.slice(r,r+s));r=r+s;let d=t.slice(r,t.byteLength);return{join_ref:null,ref:null,topic:a,event:h,payload:d}}},Yn=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||ar,this.transport=e.transport||We.WebSocket||It,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=e.sessionStorage||We&&We.sessionStorage,this.establishedConnections=0,this.defaultEncoder=Li.encode.bind(Li),this.defaultDecoder=Li.decode.bind(Li),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.transport!==It?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let i=null;Ot&&Ot.addEventListener&&(Ot.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),i=this.connectClock)}),Ot.addEventListener("pageshow",n=>{i===this.connectClock&&(i=null,this.connect())}),Ot.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.rejoinAfterMs=n=>e.rejoinAfterMs?e.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>e.reconnectAfterMs?e.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(n,s,r)=>{console.log(`${n}: ${s}`,r)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=Mt(e.params||{}),this.endPoint=`${t}/${cn.websocket}`,this.vsn=e.vsn||rr,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Gn(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(()=>this.connect())},this.reconnectAfterMs),this.authToken=e.authToken&&Mt(e.authToken)}getLongPollTransport(){return It}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=Di.appendParams(Di.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,i){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,i)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Mt(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==It?this.connectWithF
vendor: 4,273 bytes, line 3
3allback(It,this.longPollFallbackMs):this.transportConnect())}log(t,e,i){this.logger&&this.logger(t,e,i)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),i=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let n=this.onMessage(s=>{s.ref===e&&(this.off([n]),t(Date.now()-i))});return!0}transportName(t){switch(t){case It:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${dn}${btoa(this.authToken()).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let i=!1,n=!0,s,r,a=this.transportName(t),h=d=>{this.log("transport",`falling back to ${a}...`,d),this.off([s,r]),n=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return h("memorized");this.fallbackTimer=setTimeout(h,e),r=this.onError(d=>{this.log("transport","error",d),n&&!i&&(clearTimeout(this.fallbackTimer),h(d))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(i=!0,!n){let d=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${d}`,"true"),this.log("transport",`established ${d} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(h,e),this.ping(d=>{this.log("transport","connected to primary after",d),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transportName(this.transport)} connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,t])=>t())}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),lr,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,i){if(!this.conn)return t&&t();let n=this.conn;this.waitForBufferDone(n,()=>{e?n.close(e,i||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,i=1){if(i===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,i+1)},150*i)}waitForSocketClosed(t,e,i=1){if(i===5||t.readyState===qe.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,i+1)},150*i)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{});let e=t&&t.code;this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),this.clearHeartbeats(),!this.closeWasClean&&e!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,i])=>i(t))}onConnError(t){this.hasLogger()&&this.log("transport","error",t);let e=this.transport,i=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,n])=>{n(t,e,i)}),(e===this.transport||i>0)&&this.triggerChanError()}
vendor: 4,120 bytes, line 3
3triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(it.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case qe.connecting:return"connecting";case qe.open:return"open";case qe.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([i])=>t.indexOf(i)===-1)}channel(t,e={}){let i=new cr(t,e,this);return this.channels.push(i),i}push(t){if(this.hasLogger()){let{topic:e,event:i,payload:n,ref:s,join_ref:r}=t;this.log("push",`${e} ${i} (${r}, ${s})`,n)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:i,event:n,payload:s,ref:r,join_ref:a}=e;r&&r===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${s.status||""} ${i} ${n} ${r&&"("+r+")"||""}`,s);for(let h=0;h<this.channels.length;h++){let d=this.channels[h];d.isMember(i,n,s,a)&&d.trigger(n,s,r,a)}for(let h=0;h<this.stateChangeCallbacks.message.length;h++){let[,d]=this.stateChangeCallbacks.message[h];d(e)}})}leaveOpenTopic(t){let e=this.channels.find(i=>i.topic===t&&(i.isJoined()||i.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};var Ps="consecutive-reloads",ur=10,fr=5e3,pr=1e4,mr=3e4,xs=["phx-click-loading","phx-change-loading","phx-submit-loading","phx-keydown-loading","phx-keyup-loading","phx-blur-loading","phx-focus-loading","phx-hook-loading"],un="phx-drop-target-active",Ge="data-phx-component",Bt="data-phx-view",fn="data-phx-link",gr="track-static",Qn="data-phx-link-state",jt="data-phx-ref-loading",Me="data-phx-ref-src",ce="data-phx-ref-lock",Zn="phx-pending-refs",Rs="track-uploads",st="data-phx-upload-ref",Pn="data-phx-preflighted-refs",vr="data-phx-done-refs",Ii="drop-target",yn="data-phx-active-refs",$i="phx:live-file:updated",Ls="data-phx-skip",wn="data-phx-id",es="data-phx-prune",ts="phx-connected",Et="phx-loading",Ht="phx-error",is="phx-client-error",ei="phx-server-error",Tt="data-phx-parent-id",xn="data-phx-main",nt="data-phx-root-id",En="viewport-top",An="viewport-bottom",br="viewport-overrun-target",yr="trigger-action",Xi="phx-has-focused",wr=["text","textarea","number","email","password","search","tel","url","date","time","datetime-local","color","range"],Ds=["checkbox","radio"],li="phx-has-submitted",Ye="data-phx-session",hi=`[${Ye}]`,Sn="data-phx-sticky",Ct="data-phx-static",kn="data-phx-readonly",$t="data-phx-disabled",ns="disable-with",Vi="data-phx-disable-with-restore",ti="hook",Er="debounce",Ar="throttle",Ji="update",Ui="stream",ii="data-phx-stream",Rn="data-phx-portal",_t="data-phx-teleported",pt="data-phx-teleported-src",Bi="data-phx-runtime-hook",Sr="data-phx-pid",kr="key",ze="phxPrivate",ss="auto-recover",rs="no-unused-field",Oi="phx:live-socket:debug",pn="phx:live-socket:profiling",mn="phx:live-socket:latency-sim",Mi="phx:nav-history-position",Cr="progress",os="mounted",as="__phoenix_reload_status__",Tr=1,ls=3,_r=200,Pr=500,xr="phx-",Rr=3e4,ni="debounce-trigger",si="throttled",hs="debounce-prev-key",Lr={debounce:300,throttle:300},cs=[jt,Me,ce],Oe="s",gn="r",Se="c",he="k",Ke="kc",ds="e",us="r",fs="t",dt="p",Nt="stream",Dr=class{constructor(t,e,i){let{chunk_size:n,chunk_timeout:s}
3=e;this.liveSocket=i,this.entry=t,this.offset=0,this.chunkSize=n,this.chunkTimeout=s,this.chunkTimer=null,this.errored=!1,this.uploadChannel=i.channel(`lvu:${t.ref}`,{token:t.metadata()})}error(t){this.errored||(this.uploadChannel.leave(),this.errored=!0,this.chunkTimer!=null&&clearTimeout(this.chunkTimer),this.entry.error(t))}upload(){this.uploadChannel.onError(t=>this.error(t)),this.uploadChannel.join().receive("ok",t=>this.readNextChunk()).receive("error",({reason:t})=>this.error(t))}isDone(){return this.offset>=this.entry.file.size}readNextChunk(){let t=new window.FileReader,e=this.entry.file.slice(this.offset,this.chunkSize+this.offset);t.onload=i=>{if(i.target?.error===null)this.offset+=i.target.result.byteLength,this.pushChunk(i.target.result);else return ie("Read error: "+i.target?.error)},t.readAsArrayBuffer(e)}pushChunk(t){this.uploadChannel.isJoined()&&this.uploadChannel.push("chunk",t,this.chunkTimeout).receive("ok",()=>{this.entry.progress(this.offset/this.entry.file.size*100),this.isDone()||(this.chunkTimer=setTimeout(()=>this.readNextChunk(),this.liveSocket.getLatencySim()||0))}).receive("error",({reason:e})=>this.error(e))}},ie=(t,e)=>console.error&&console.error(t,e),ps=(t,e)=>{let i;try{i=new URL(t,window.location.href)}catch{throw new Error(`expected ${e} destination to be a valid URL, got: ${t}`)}if(i.origin!==window.location.origin)throw new Error(`cannot ${e} to "${t}" because its origin does not match the current origin "${window.location.origin}". Use window.location directly for cross-origin navigation.`)},ft=t=>{let e=typeof t;return e==="number"||e==="string"&&/^(0|[1-9]\d*)$/.test(t)};function Ir(){let t=new Set,e=document.querySelectorAll("*[id]");for(let i=0,n=e.length;i<n;i++)t.has(e[i].id)?console.error(`Multiple IDs detected: ${e[i].id}. Ensure unique element ids.`):t.add(e[i].id)}function Or(t){let e=new Set;Object.keys(t).forEach(i=>{let n=document.getElementById(i);n&&n.parentElement&&n.parentElement.getAttribute("phx-update")!=="stream"&&e.add(`The stream container with id "${n.parentElement.id}" is missing the phx-update="stream" attribute. Ensure it is set for streams to work properly.`)}),e.forEach(i=>console.error(i))}var Mr=(t,e,i,n)=>{t.liveSocket.isDebugEnabled()&&console.log(`${t.id} ${e}: ${i} - `,n)},ri=t=>typeof t=="function"?t:function(){return t},ji=t=>JSON.parse(JSON.stringify(t)),kt=(t,e,i)=>{let n=t;do{if(n.matches(`[${e}]`)&&!("disabled"in n&&n.disabled))return n;n=n.parentElement}while(n!==null&&n.nodeType===1&&!(i&&i.isSameNode(n)||n.matches(hi)));return null},Ft=t=>t!==null&&typeof t=="object"&&!(t instanceof Array),Hr=(t,e)=>JSON.stringify(t)===JSON.stringify(e),ms=t=>{for(let e in t)return!1;return!0},Ut=(t,e)=>t&&e(t),Nr=function(t,e,i,n){t.forEach(s=>{new Dr(s,i.config,n).upload()})},Fr=t=>{if(t.dataTransfer.types){for(let e=0;e<t.dataTransfer.types.length;e++)if(t.dataTransfer.types[e]==="Files")return!0}return!1},$r={canPushState(){return typeof history.pushState<"u"},dropLocal(t,e,i){return t.removeItem(this.localKey(e,i))},updateLocal(t,e,i,n,s){let r=this.getLocal(t,e,i),a=this.localKey(e,i),h=r===null?n:s(r);return t.setItem(a,JSON.stringify(h)),h},getLocal(t,e,i){return JSON.parse(t.getItem(this.localKey(e,i)))},updateCurrentState(t){this.canPushState()&&history.replaceState(t(history.state||{}),"",window.location.href)},pushState(t,e,i){if(this.canPushState()){if(i!==window.location.href){if(e.type=="redirect"&&e.scroll){let n=history.state||{};n.scroll=e.scroll,history.replaceState(n,"",window.location.href)}delete e.scroll,history[t+"State"](e,"",i||null),window.requestAnimationFrame(()=>{let n=this.getHashTargetEl(window.location.hash);n?n.scrollIntoView():e.type==="redirect"&&window.scroll(0,0)})}}else i&&this.redirect(i)},setCookie(t,e,i){let n=typeof i=="number"?` max-age=${i};`:"";document.cookie=`${t}=${e};${n} path=/`},getCookie(t){return document.cookie.replace(new RegExp(`(?:(?:^|.*;s*)${t}s*=s*([^;]*).*$)|^.*$`),"$1")},deleteCookie(t){document.cookie=`${t}=; max-age=-1; path=/`},redirect(t,e=null,i=n=>{window.location.href=n}){e&&this.setCookie("__phoenix_flash__",e,60),i(t)},localKey(t,e){return`${t}-${e}`},getHashTargetEl(t){let e=t.toString().substring(1);if(e!=="")return document.getElementById(e)||document.querySelector(`a[name="${e}"]`)}},Pe=$r,St={byId(t){return document.getElementById(t)||ie(`no id found for ${t}`)},elementFromTarget(t){return t instanceof Node?t.nodeType===Node.ELEMENT_NODE?t:t.parentElement:null},removeClass(t,e){t.classList.remove(e),t.classList.length===0&&t.removeAttribute("class")},all(t,e,i){if(!t)return[];let n=Array.from(t.querySelectorAll(e));
3return i&&n.forEach(i),n},childNodeLength(t){let e=document.createElement("template");return e.innerHTML=t,e.content.childElementCount},isUploadInput(t){return t.type==="file"&&t.getAttribute(st)!==null},isAutoUpload(t){return t.hasAttribute("data-phx-auto-upload")},findUploadInputs(t){let e=t.id,i=this.all(document,`input[type="file"][${st}][form="${e}"]`);return this.all(t,`input[type="file"][${st}]`).concat(i)},findComponent(t,e,i=document){return i.querySelector(`[${Bt}="${t}"][${Ge}="${e}"]`)},getComponent(t,e,i=document){let n=this.findComponent(t,e,i);if(!n)throw new Error(`no component found matching viewId ${t} and cid ${e}`);return n},isPhxDestroyed(t){return!!(t.id&&St.private(t,"destroyed"))},wantsNewTab(t){let e=t.ctrlKey||t.shiftKey||t.metaKey||t.button&&t.button===1,i=t.target instanceof HTMLAnchorElement&&t.target.hasAttribute("download"),n=t.target.hasAttribute("target")&&t.target.getAttribute("target").toLowerCase()==="_blank",s=t.target.hasAttribute("target")&&!t.target.getAttribute("target").startsWith("_");return e||n||i||s},isUnloadableFormSubmit(t){return t.target&&t.target.getAttribute("method")==="dialog"||t.submitter&&t.submitter.getAttribute("formmethod")==="dialog"?!1:!t.defaultPrevented&&!this.wantsNewTab(t)},isNewPageClick(t,e){let i=t.target instanceof HTMLAnchorElement?t.target.getAttribute("href"):null,n;if(t.defaultPrevented||i===null||this.wantsNewTab(t)||i.startsWith("mailto:")||i.startsWith("tel:")||t.target.isContentEditable)return!1;try{n=new URL(i)}catch{try{n=new URL(i,e)}catch{return!0}}return n.host===e.host&&n.protocol===e.protocol&&n.pathname===e.pathname&&n.search===e.search?n.hash===""&&!n.href.endsWith("#"):n.protocol.startsWith("http")},markPhxChildDestroyed(t){this.isPhxChild(t)&&t.setAttribute(Ye,""),this.putPrivate(t,"de
3stroyed",!0)},findPhxChildrenInFragment(t,e){let i=document.createElement("template");return i.innerHTML=t,this.findPhxChildren(i.content,e)},isIgnored(t,e){return(t.getAttribute(e)||t.getAttribute("data-phx-update"))==="ignore"},isPhxUpdate(t,e,i){return t.getAttribute&&i.indexOf(t.getAttribute(e))>=0},findPhxSticky(t){return this.all(t,`[${Sn}]`)},findPhxChildren(t,e){return this.all(t,`${hi}[${Tt}="${e}"]`)},findExistingParentCIDs(t,e){let i=new Set,n=new Set;return e.forEach(s=>{this.all(document,`[${Bt}="${t}"][${Ge}="${s}"]`).forEach(r=>{i.add(s),this.all(r,`[${Bt}="${t}"][${Ge}]`).map(a=>parseInt(a.getAttribute(Ge))).forEach(a=>n.add(a))})}),n.forEach(s=>i.delete(s)),i},private(t,e){return t[ze]&&t[ze][e]},deletePrivate(t,e){t[ze]&&delete t[ze][e]},putPrivate(t,e,i){t[ze]||(t[ze]={}),t[ze][e]=i},updatePrivate(t,e,i,n){let s=this.private(t,e);s===void 0?this.putPrivate(t,e,n(i)):this.putPrivate(t,e,n(s))},syncPendingAttrs(t,e){t.hasAttribute(Me)&&(xs.forEach(i=>{t.classList.contains(i)&&e.classList.add(i)}),cs.filter(i=>t.hasAttribute(i)).forEach(i=>{e.setAttribute(i,t.getAttribute(i))}))},copyPrivates(t,e){e[ze]&&(t[ze]=e[ze])},putTitle(t){let e=document.querySelector("title");if(e){let{prefix:i,suffix:n,default:s}=e.dataset,r=typeof t!="string"||t.trim()==="";if(r&&typeof s!="string")return;let a=r?s:t;document.title=`${i||""}${a||""}${n||""}`}else document.title=t},debounce(t,e,i,n,s,r,a,h){let d=t.getAttribute(i),p=t.getAttribute(s);d===""&&(d=n),p===""&&(p=r);let A=d||p;switch(A){case null:return h();case"blur":this.incCycle(t,"debounce-blur-cycle",()=>{a()&&h()}),this.once(t,"debounce-blur")&&t.addEventListener("blur",()=>this.triggerCycle(t,"debounce-blur-cycle"));return;default:let C=parseInt(A),T=()=>p?this.deletePrivate(t,si):h(),E=this.incCycle(t,ni,T);if(isNaN(C))return ie(`invalid throttle/debounce value: ${A}`);if(p){let S=!1;if(e.type==="keydown"){let L=this.private(t,hs);this.putPrivate(t,hs,e.key),S=L!==e.key}if(!S&&this.private(t,si))return!1;{h();let L=setTimeout(()=>{a()&&this.triggerCycle(t,ni)},C);this.putPrivate(t,si,L)}}else setTimeout(()=>{a()&&this.triggerCycle(t,ni,E)},C);let m=t.form;m&&this.once(m,"bind-debounce")&&m.addEventListener("submit",()=>{Array.from(new FormData(m).entries(),([S])=>{let L=m.elements.namedItem(S),V=L instanceof RadioNodeList?L[0]:L;V&&(this.incCycle(V,ni),this.deletePrivate(V,si))})}),this.once(t,"bind-debounce")&&t.addEventListener("blur",()=>{clearTimeout(this.private(t,si)),a()&&this.triggerCycle(t,ni)})}},triggerCycle(t,e,i){let[n,s]=this.private(t,e);i||(i=n),i===n&&(this.incCycle(t,e),s())},once(t,e){return this.private(t,e)===!0?!1:(this.putPrivate(t,e,!0),!0)},incCycle(t,e,i=function(){}){let[n]=this.private(t,e)||[0,i];return n++,this.putPrivate(t,e,[n,i]),n},maintainPrivateHooks(t,e,i,n){t.hasAttribute&&t.hasAttribute("data-phx-hook")&&!e.hasAttribute("data-phx-hook")&&e.setAttribute("data-phx-hook",t.getAttribute("data-phx-hook")),e.hasAttribute&&(e.hasAttribute(i)||e.hasAttribute(n))&&e.setAttribute("data-phx-hook","Phoenix.InfiniteScroll")},putCustomElHook(t,e){t.isConnected?t.setAttribute("data-phx-hook",""):console.error(`
4        hook attached to non-connected DOM element
5        ensure you are calling createHook within your connectedCallback. ${t.outerHTML}
6      `),this.putPrivate(t,"custom-el-hook",e)},getCustomElHook(t){return this.private(t,"custom-el-hook")},isUsedInput(t){return t.nodeType===Node.ELEMENT_NODE&&(this.private(t,Xi)||this.private(t,li))},resetForm(t){Array.from(t.elements).forEach(e=>{this.deletePrivate(e,Xi),this.deletePrivate(e,li)})},isPhxChild(t){return t.getAttribute&&t.getAttribute(Tt)},isPhxSticky(t){return t.getAttribute&&t.getAttribute(Sn)!==null},isChildOfAny(t,e){return!!e.find(i=>i.contains(t))},firstPhxChild(t){return this.isPhxChild(t)?t:this.all(t,`[${Tt}]`)[0]},isPortalTemplate(t){return t.tagName==="TEMPLATE"&&t.hasAttribute(Rn)},closestViewEl(t){let e=t.closest(`[${_t}],${hi}`);return e?e.hasAttribute(_t)?this.byId(e.getAttribute(_t)):e.hasAttribute(Ye)?e:null:null},dispatchEvent(t,e,i={}){let n=!0;t.nodeName==="INPUT"&&t.type==="file"&&e==="click"&&(n=!1);let a={bubbles:i.bubbles===void 0?n:!!i.bubbles,cancelable:!0,detail:i.detail||{}},h=e==="click"?new MouseEvent("click",a):new CustomEvent(e,a);t.dispatchEvent(h)},cloneNode(t,e){if(typeof e>"u")return t.cloneNode(!0);{let i=t.cloneNode(!1);return i.innerHTML=e,i}},mergeAttrs(t,e,i={}){let n=new Set(i.exclude||[]),s=i.isIgnored,r=e.attributes;for(let h=r.length-1;h>=0;h--){let d=r[h].name;if(n.has(d)){if(d==="value"){let p=e.value??e.getAttribute(d);t.value===p&&t.setAttribute("value",e.getAttribute(d))}}else{let p=e.getAttribute(d);t.getAttribute(d)!==p&&(!s||s&&d.startsWith("data-"))&&t.setAttribute(d,p)}}let a=t.attributes;for(let h=a.length-1;h>=0;h--){let d=a[h].name;s?d.startsWith("data-")&&!e.hasAttribute(d)&&!cs.includes(d)&&t.removeAttribute(d):e.hasAttribute(d)||t.removeAttribute(d)}},mergeFocusedInput(t,e){t instanceof HTMLSelectElement||St.mergeAttrs(t,e,{exclude:["value"]}),e.readOnly?t.setAttribute("readonly",!0):t.removeAttribute("readonly")},hasSelectionRange(t){return t.setSelectionRange&&(t.type==="text"||t.type==="textarea")},restoreFocus(t,e,i){if(t instanceof HTMLSelectElement&&t.focus(),!St.isTextualInput(t))return;
6t.matches(":focus")||t.focus(),this.hasSelectionRange(t)&&t.setSelectionRange(e,i)},isEditableInput(t){return this.isFormAssociated(t)&&!(t instanceof HTMLButtonElement)&&!(t instanceof HTMLInputElement&&t.type==="button")},isFormAssociated(t){if(!(t instanceof HTMLElement))return!1;if(t.localName){let e=customElements.get(t.localName);if(e)return e.formAssociated===!0}return t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLButtonElement},syncAttrsToProps(t){t instanceof HTMLInputElement&&Ds.indexOf(t.type.toLocaleLowerCase())>=0&&(t.checked=t.getAttribute("checked")!==null)},isTextualInput(t){return wr.indexOf(t.type)>=0},isNowTriggerFormExternal(t,e){return t.getAttribute&&t.getAttribute(e)!==null&&document.body.contains(t)},cleanChildNodes(t,e){if(St.isPhxUpdate(t,e,["append","prepend",Ui])){let i=[];t.childNodes.forEach(n=>{(!("id"in n)||!n.id)&&(!(n.nodeType===Node.TEXT_NODE&&n.nodeValue&&n.nodeValue.trim()==="")&&n.nodeType!==Node.COMMENT_NODE&&ie(`only HTML element tags with an id are allowed inside containers with phx-update.
7
8removing illegal node: "${("outerHTML"in n&&n.outerHTML||n.nodeValue||"").trim()}"
9
10`),i.push(n))}
10),i.forEach(n=>n.remove())}},replaceRootContainer(t,e,i){let n=new Set(["id",Ye,Ct,xn,nt]);if(t.tagName.toLowerCase()===e.toLowerCase())return Array.from(t.attributes).filter(s=>!n.has(s.name.toLowerCase())).forEach(s=>t.removeAttribute(s.name)),Object.keys(i).filter(s=>!n.has(s.toLowerCase())).forEach(s=>t.setAttribute(s,i[s])),t;{let s=document.createElement(e);return Object.keys(i).forEach(r=>s.setAttribute(r,i[r])),n.forEach(r=>{let a=t.getAttribute(r);a!==null&&s.setAttribute(r,a)}),s.innerHTML=t.innerHTML,t.replaceWith(s),s}},getSticky(t,e,i){let n=(St.private(t,"sticky")||[]).find(([s])=>e===s);if(n){let[s,r,a]=n;return a}else return typeof i=="function"?i():i},deleteSticky(t,e){this.updatePrivate(t,"sticky",[],i=>i.filter(([n,s])=>n!==e))},putSticky(t,e,i){let n=i(t);this.updatePrivate(t,"sticky",[],s=>{let r=s.findIndex(([a])=>e===a);return r>=0?s[r]=[e,i,n]:s.push([e,i,n]),s})},applyStickyOperations(t){let e=St.private(t,"sticky");e&&e.forEach(([i,n,s])=>this.putSticky(t,i,n))},isLocked(t){return t.hasAttribute&&t.hasAttribute(ce)},attributeIgnored(t,e){return e.some(i=>t.name==i||i==="*"||i.includes("*")&&t.name.match(i)!=null)}},g=St,oi=class{static isActive(t,e){let i=e._phxRef===void 0,s=t.getAttribute(yn).split(",").indexOf(ve.genFileRef(e))>=0;return e.size>0&&(i||s)}static isPreflighted(t,e){return t.getAttribute(Pn).split(",").indexOf(ve.genFileRef(e))>=0&&this.isActive(t,e)}static isPreflightInProgress(t){return t._preflightInProgress===!0}static markPreflightInProgress(t){t._preflightInProgress=!0}constructor(t,e,i,n){this.ref=ve.genFileRef(e),this.fileEl=t,this.file=e,this.view=i,this.meta=null,this._isCancelled=!1,this._isDone=!1,this._progress=0,this._lastProgressSent=-1,this._onDone=function(){},this._onElUpdated=this.onElUpdated.bind(this),this.fileEl.addEventListener($i,this._onElUpdated),this.autoUpload=n}metadata(){return this.meta}progress(t){this._progress=Math.floor(t),this._progress>this._lastProgressSent&&(this._progress>=100?(this._progress=100,this._lastProgressSent=100,this._isDone=!0,this.view.pushFileProgress(this.fileEl,this.ref,100,()=>{ve.untrackFile(this.fileEl,this.file),this._onDone()})):(this._lastProgressSent=this._progress,this.view.pushFileProgress(this.fileEl,this.ref,this._progress)))}isCancelled(){return this._isCancelled}cancel(){this.file._preflightInProgress=!1,this._isCancelled=!0,this._isDone=!0,this._onDone()}isDone(){return this._isDone}error(t="failed"){this.fileEl.removeEventListener($i,this._onElUpdated),this.view.pushFileProgress(this.fileEl,this.ref,{error:t}),this.isAutoUpload()||ve.clearFiles(this.fileEl)}isAutoUpload(){return this.autoUpload}onDone(t){this._onDone=()=>{this.fileEl.removeEventListener($i,this._onElUpdated),t()}}onElUpdated(){this.fileEl.getAttribute(yn).split(",").indexOf(this.ref)===-1&&(ve.untrackFile(this.fileEl,this.file),this.cancel())}toPreflightPayload(){return{last_modified:this.file.lastModified,name:this.file.name,relative_path:this.file.webkitRelativePath,size:this.file.size,type:this.file.type,ref:this.ref,meta:typeof this.file.meta=="function"?this.file.meta():void 0}}uploader(t){if(this.meta.uploader){let e=t[this.meta.uploader]||ie(`no uploader configured for ${this.meta.uploader}`);return{name:this.meta.uploader,callback:e}}else return{name:"channel",callback:Nr}}zipPostFlight(t){this.meta=t.entries[this.ref],this.meta||ie(`no preflight upload response returned with ref ${this.ref}`,{input:this.fileEl,response:t})}},Ur=0,ve=class Cn{static genFileRef(e){let i=e._phxRef;return i!==void 0?i:(e._phxRef=(Ur++).toString(),e._phxRef)}static getEntryDataURL(e,i){let n=this.activeFiles(e).find(s=>this.genFileRef(s)===i);return n?URL.createObjectURL(n):null}static hasUploadsInProgress(e){let i=0;return g.findUploadInputs(e).forEach(n=>{n.getAttribute(Pn)!==n.getAttribute(vr)&&i++}),i>0}static serializeUploads(e){let i=this.activeFiles(e),n={};return i.forEach(s=>{let r={path:e.name},a=e.getAttribute(st);n[a]=n[a]||[],r.ref=this.genFileRef(s),r.last_modified=s.lastModified,r.name=s.name||r.ref,r.relative_path=s.webkitRelativePath,r.type=s.type,r.size=s.size,typeof s.meta=="function"&&(r.meta=s.meta()),n[a].push(r)}),n}static clearFiles(e){e.value=null,e.removeAttribute(st),g.putPrivate(e,"files",[])}static untrackFile(e,i){g.putPrivate(e,"files",g.private(e,"files").filter(n=>!Object.is(n,i)))}static trackFiles(e,i,n){if(e.getAttribute("multiple")!==null){let s=i.filter(r=>!this.activeFiles(e).find(a=>Object.is(a,r)));g.updatePrivate(e,"files",[],r=>r.concat(s)),e.value=""}else n&&n.files.length>0&&(e.files=n.files),g.putPrivate(e,"files",i)}
10static activeFileInputs(e){let i=g.findUploadInputs(e);return Array.from(i).filter(n=>n.files&&this.activeFiles(n).length>0)}static activeFiles(e){return(g.private(e,"files")||[]).filter(i=>oi.isActive(e,i))}static inputsAwaitingPreflight(e){let i=g.findUploadInputs(e);return Array.from(i).filter(n=>this.filesAwaitingPreflight(n).length>0)}static filesAwaitingPreflight(e){return this.activeFiles(e).filter(i=>!oi.isPreflighted(e,i)&&!oi.isPreflightInProgress(i))}static markPreflightInProgress(e){e.forEach(i=>oi.markPreflightInProgress(i.file))}constructor(e,i,n){this.autoUpload=g.isAutoUpload(e),this.view=i,this.onComplete=n,this._entries=Array.from(Cn.filesAwaitingPreflight(e)||[]).map(s=>new oi(e,s,i,this.autoUpload)),Cn.markPreflightInProgress(this._entries),this.numEntriesInProgress=this._entries.length}isAutoUpload(){return this.autoUpload}entries(){return this._entries}initAdapterUpload(e,i,n){this._entries=this._entries.map(r=>(r.isCancelled()?(this.numEntriesInProgress--,this.numEntriesInProgress===0&&this.onComplete()):(r.zipPostFlight(e),r.onDone(()=>{this.numEntriesInProgress--,this.numEntriesInProgress===0&&this.onComplete()})),r));let s=this._entries.reduce((r,a)=>{if(!a.meta)return r;let{name:h,callback:d}=a.uploader(n.uploaders);return r[h]=r[h]||{callback:d,entries:[]},r[h].entries.push(a),r},{});for(let r in s){let{callback:a,entries:h}=s[r];a(h,i,e,n)}}},Br={anyOf(t,e){return e.some(i=>t instanceof i)},isFocusable(t,e=!1){return t instanceof HTMLAnchorElement&&t.rel!=="ignore"||t instanceof HTMLAreaElement&&t.href!==void 0||!("disabled"in t&&t.disabled)&&this.anyOf(t,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLButtonElement])||t instanceof HTMLIFrameElement||t instanceof HTMLElement&&t.tabIndex>=0&&t.getAttribute("aria-hidden")!=="true"||!e&&t.getAttribute("tabindex")!==null&&t.getAttribute("aria-hidden")!=="true"},attemptFocus(t,e=!1){if(this.isFocusable(t,e))try{t.focus()}catch{}return!!document.activeElement&&document.activeElement.isSameNode(t)},focusFirstInteractive(t){let e=t.firstElementChild;for(;e;){if(this.attemptFocus(e,!0)||this.focusFirstInteractive(e))return!0;e=e.nextElementSibling}return!1},focusFirst(t){let e=t.firstElementChild;for(;e;){if(this.attemptFocus(e)||this.focusFirst(e))return!0;e=e.nextElementSibling}return!1},focusLast(t){let e=t.lastElementChild;for(;e;){if(this.attemptFocus(e)||this.focusLast(e))return!0;e=e.previousElementSibling}return!1}},Ie=Br,Is=t=>["HTML","BODY"].indexOf(t.nodeName.toUpperCase())>=0?null:["scroll","auto"].indexOf(getComputedStyle(t).overflowY)>=0?t:Is(t.parentElement),gs=t=>t?t.scrollTop:document.documentElement.scrollTop||document.body.scrollTop,Ln=t=>t?t.getBoundingClientRect().bottom:window.innerHeight||document.documentElement.clientHeight,Dn=t=>t?t.getBoundingClientRect().top:0,jr=(t,e)=>{let i=t.getBoundingClientRect();return Math.ceil(i.top)>=Dn(e)&&Math.floor(i.top)<=Ln(e)},Xr=(t,e)=>{let i=t.getBoundingClientRect();return Math.ceil(i.bottom)>=Dn(e)&&Math.floor(i.bottom)<=Ln(e)},vs=(t,e)=>{let i=t.getBoundingClientRect();return Math.ceil(i.top)>=Dn(e)&&Math.floor(i.top)<=Ln(e)},Vr={mounted(){this.scrollContainer=Is(this.el);let t=gs(this.scrollContainer),e=!1,i=500,n=null,s=this.throttle(i,(h,d)=>{n=()=>!0,this.liveSocket.js().push(this.el,h,{value:{id:d.id,_overran:!0},callback:()=>{n=null}})}),r=this.throttle(i,(h,d)=>{n=()=>d.scrollIntoView({block:"start"}),this.liveSocket.js().push(this.el,h,{value:{id:d.id},callback:()=>{n=null,window.requestAnimationFrame(()=>{vs(d,this.scrollContainer)||d.scrollIntoView({block:"start"})})}})}),a=this.throttle(i,(h,d)=>{n=()=>d.scrollIntoView({block:"end"}),this.liveSocket.js().push(this.el,h,{value:{id:d.id},callback:()=>{n=null,window.requestAnimationFrame(()=>{vs(d,this.scrollContainer)||d.scrollIntoView({block:"end"})})}})});this.onScroll=h=>{let d=gs(this.scrollContainer);if(n)return t=d,n();let p=this.findOverrunTarget(),A=this.el.getAttribute(this.liveSocket.binding("viewport-top")),C=this.el.getAttribute(this.liveSocket.binding("viewport-bottom")),T=this.el.lastElementChild,E=this.el.firstElementChild,m=d<t,S=d>t;m&&A&&!e&&p.top>=0?(e=!0,s(A,E)):S&&e&&p.top<=0&&(e=!1),A&&m&&E&&jr(E,this.scrollContainer)?r(A,E):C&&S&&T&&Xr(T,this.scrollContainer)&&a(C,T),t=d},this.scrollContainer?this.scrollContainer.addEventListener("scroll",this.onScroll):window.addEventListener("scroll",this.onScroll)},updated(){this.scrollContainer&&!this.scrollContainer.isConnected&&(this.destroyed(),this.mounted())},destroyed(){this.scrollContainer?this.scrollContainer.removeEventListener("scroll",this.onScroll):window.removeEventListener("scroll",this.onScroll)},throttle(t,e){let i=0,n;return(...s)=>{let r=Date.now(),a=t-(r-i);a<=0||a>t?(n&&(clearTimeout(n),n=null),i=r,e(...s)):n||(n=setTimeout(()=>{i=Date.now(),n=null,e(...s)},a))}},findOverrunTarget(){let t,e=this.el.getAttribute(this.liveSocket.b
10inding(br));if(e){let i=document.getElementById(e);if(i)t=i.getBoundingClientRect();else throw new Error("did not find element with id "+e)}else t=this.el.getBoundingClientRect();return t}},Jr={activeRefs(){return this.el.getAttribute(yn)},preflightedRefs(){return this.el.getAttribute(Pn)},mounted(){this.js().ignoreAttributes(this.el,["value"]),this.preflightedWas=this.preflightedRefs()},updated(){let t=this.preflightedRefs();this.preflightedWas!==t&&(this.preflightedWas=t,t===""&&this.__view().cancelSubmit(this.el.form)),this.activeRefs()===""&&(this.el.value=""),this.el.dispatchEvent(new CustomEvent($i))}},Wr={mounted(){this.ref=this.el.getAttribute("data-phx-entry-ref"),this.inputEl=document.getElementById(this.el.getAttribute(st)),this.url=ve.getEntryDataURL(this.inputEl,this.ref),this.el.src=this.url},destroyed(){URL.revokeObjectURL(this.url)}},qr={LiveFileUpload:Jr,LiveImgPreview:Wr,FocusWrap:{mounted(){this.focusStart=this.el.firstElementChild,this.focusEnd=this.el.lastElementChild,this.focusStart.addEventListener("focus",t=>{if(!t.relatedTarget||!this.el.contains(t.relatedTarget)){let e=t.target.nextElementSibling;Ie.attemptFocus(e)||Ie.focusFirst(e)}else Ie.focusLast(this.el)}),this.focusEnd.addEventListener("focus",t=>{if(!t.relatedTarget||!this.el.contains(t.relatedTarget)){let e=t.target.previousElementSibling;Ie.attemptFocus(e)||Ie.focusLast(e)}else Ie.focusFirst(this.el)}),this.el.contains(document.activeElement)||(this.el.addEventListener("phx:show-end",()=>this.el.focus()),window.getComputedStyle(this.el).display!=="none"&&Ie.focusFirst(this.el))}},InfiniteScroll:Vr},zr=qr,Tn=class{static onUnlock(t,e){if(!g.isLocked(t)&&!t.closest(`[${ce}]`))return e();let i=t.closest(`[${ce}]`),n=i.closest(`[${ce}]`).getAttribute(ce);i.addEventListener(`phx:undo-lock:${n}`,()=>{e()},{once:!0})}constructor(t){this.el=t,this.loadingRef=t.hasAttribute(jt)?parseInt(t.getAttribute(jt),10):null,this.lockRef=t.hasAttribute(ce)?parseInt(t.getAttribute(ce),10):null}maybeUndo(t,e,i){if(!this.isWithin(t)){g.updatePrivate(this.el,Zn,[],n=>(n.push(t),n));return}this.undoLocks(t,e,i),this.undoLoading(t,e),g.updatePrivate(this.el,Zn,[],n=>n.filter(s=>{let r={detail:{ref:s,event:e},bubbles:!0,cancelable:!1};return this.loadingRef&&this.loadingRef>s&&this.el.dispatchEvent(new CustomEvent(`phx:undo-loading:${s}`,r)),this.lockRef&&this.lockRef>s&&this.el.dispatchEvent(new CustomEvent(`phx:undo-lock:${s}`,r)),s>t})),this.isFullyResolvedBy(t)&&this.el.removeAttribute(Me)}isWithin(t){return!(this.loadingRef!==null&&this.loadingRef>t&&this.lockRef!==null&&this.lockRef>t)}undoLocks(t,e,i){if(!this.isLockUndoneBy(t))return;let n=g.private(this.el,ce);n&&(i(n),g.deletePrivate(this.el,ce)),this.el.removeAttribute(ce);let s={detail:{ref:t,event:e},bubbles:!0,cancelable:!1};this.el.dispatchEvent(new CustomEvent(`phx:undo-lock:${this.lockRef}`,s))}undoLoading(t,e){if(!this.isLoadingUndoneBy(t)){this.canUndoLoading(t)&&this.el.classList.contains("phx-submit-loading")&&this.el.classList.remove("phx-change-loading");return}if(this.canUndoLoading(t)){this.el.removeAttribute(jt);let i=this.el.getAttribute($t),n=this.el.getAttribute(kn);n!==null&&"readOnly"in this.el&&(this.el.readOnly=n==="true",this.el.removeAttribute(kn)),i!==null&&"disabled"in this.el&&(this.el.disabled=i==="true",this.el.removeAttribute($t));let s=this.el.getAttribute(Vi);s!==null&&(this.el.textContent=s,this.el.removeAttribute(Vi));let r={detail:{ref:t,event:e},bubbles:!0,cancelable:!1};this.el.dispatchEvent(new CustomEvent(`phx:undo-loading:${this.loadingRef}`,r))}xs.forEach(i=>{(i!=="phx-submit-loading"||this.canUndoLoading(t))&&g.removeClass(this.el,i)})}isLoadingUndoneBy(t){return this.loadingRef===null?!1:this.loadingRef<=t}isLockUndoneBy(t){return this.lockRef===null?!1:this.lockRef<=t}isFullyResolvedBy(t){return(this.loadingRef===null||this.loadingRef<=t)&&(this.lockRef===null||this.lockRef<=t)}canUndoLoading(t){return this.lockRef===null||this.lockRef<=t}},Kr=class{constructor(t,e,i){let n=new Set,s=new Set([...e.children].map(a=>a.id)),r=[];Array.from(t.children).forEach(a=>{if(a.id&&(n.add(a.id),s.has(a.id))){let h=a.previousElementSibling&&a.previousElementSibling.id;r.push({elementId:a.id,previousElementId:h})}}),this.containerId=e.id,this.updateType=i,this.elementsToModify=r,this.elementIdsToAdd=[...s].filter(a=>!n.has(a))}perform(){let t=g.byId(this.containerId);
vendor: 4,836 bytes, line 10
10t&&(this.elementsToModify.forEach(e=>{e.previousElementId?Ut(document.getElementById(e.previousElementId),i=>{Ut(document.getElementById(e.elementId),n=>{n.previousElementSibling&&n.previousElementSibling.id==i.id||i.insertAdjacentElement("afterend",n)})}):Ut(document.getElementById(e.elementId),i=>{i.previousElementSibling==null||t.insertAdjacentElement("afterbegin",i)})}),this.updateType=="prepend"&&this.elementIdsToAdd.reverse().forEach(e=>{Ut(document.getElementById(e),i=>t.insertAdjacentElement("afterbegin",i))}))}},bs=11;function Gr(t,e){var i=e.attributes,n,s,r,a,h;if(!(e.nodeType===bs||t.nodeType===bs)){for(var d=i.length-1;d>=0;d--)n=i[d],s=n.name,r=n.namespaceURI,a=n.value,r?(s=n.localName||s,h=t.getAttributeNS(r,s),h!==a&&(n.prefix==="xmlns"&&(s=n.name),t.setAttributeNS(r,s,a))):(h=t.getAttribute(s),h!==a&&t.setAttribute(s,a));for(var p=t.attributes,A=p.length-1;A>=0;A--)n=p[A],s=n.name,r=n.namespaceURI,r?(s=n.localName||s,e.hasAttributeNS(r,s)||t.removeAttributeNS(r,s)):e.hasAttribute(s)||t.removeAttribute(s)}}var Hi,Yr="http://www.w3.org/1999/xhtml",ke=typeof document>"u"?void 0:document,Qr=!!ke&&"content"in ke.createElement("template"),Zr=!!ke&&ke.createRange&&"createContextualFragment"in ke.createRange();function eo(t){var e=ke.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}function to(t){Hi||(Hi=ke.createRange(),Hi.selectNode(ke.body));var e=Hi.createContextualFragment(t);return e.childNodes[0]}function io(t){var e=ke.createElement("body");return e.innerHTML=t,e.childNodes[0]}function no(t){return t=t.trim(),Qr?eo(t):Zr?to(t):io(t)}function Ni(t,e){var i=t.nodeName,n=e.nodeName,s,r;return i===n?!0:(s=i.charCodeAt(0),r=n.charCodeAt(0),s<=90&&r>=97?i===n.toUpperCase():r<=90&&s>=97?n===i.toUpperCase():!1)}function so(t,e){return!e||e===Yr?ke.createElement(t):ke.createElementNS(e,t)}function ro(t,e){for(var i=t.firstChild;i;){var n=i.nextSibling;e.appendChild(i),i=n}return e}function vn(t,e,i){t[i]!==e[i]&&(t[i]=e[i],t[i]?t.setAttribute(i,""):t.removeAttribute(i))}var ys={OPTION:function(t,e){var i=t.parentNode;if(i){var n=i.nodeName.toUpperCase();n==="OPTGROUP"&&(i=i.parentNode,n=i&&i.nodeName.toUpperCase()),n==="SELECT"&&!i.hasAttribute("multiple")&&(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),i.selectedIndex=-1)}vn(t,e,"selected")},INPUT:function(t,e){vn(t,e,"checked"),vn(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var i=e.value;t.value!==i&&(t.value=i);var n=t.firstChild;if(n){var s=n.nodeValue;if(s==i||!i&&s==t.placeholder)return;n.nodeValue=i}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var i=-1,n=0,s=t.firstChild,r,a;s;)if(a=s.nodeName&&s.nodeName.toUpperCase(),a==="OPTGROUP")r=s,s=r.firstChild,s||(s=r.nextSibling,r=null);else{if(a==="OPTION"){if(s.hasAttribute("selected")){i=n;break}n++}s=s.nextSibling,!s&&r&&(s=r.nextSibling,r=null)}t.selectedIndex=i}}},ai=1,ws=11,Es=3,As=8;function ut(){}function oo(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}function ao(t){return function(i,n,s){if(s||(s={}),typeof n=="string")if(i.nodeName==="#document"||i.nodeName==="HTML"){var r=n;n=ke.createElement("html"),n.innerHTML=r}else if(i.nodeName==="BODY"){var a=n;n=ke.createElement("html"),n.innerHTML=a;var h=n.querySelector("body");h&&(n=h)}else n=no(n);else n.nodeType===ws&&(n=n.firstElementChild);var d=s.getNodeKey||oo,p=s.onBeforeNodeAdded||ut,A=s.onNodeAdded||ut,C=s.onBeforeElUpdated||ut,T=s.onElUpdated||ut,E=s.onBeforeNodeDiscarded||ut,m=s.onNodeDiscarded||ut,S=s.onBeforeElChildrenUpdated||ut,L=s.skipFromChildren||ut,V=s.addChild||function(H,F){return H.appendChild(F)},pe=s.childrenOnly===!0,M=Object.create(null),I=[];function _(H){I.push(H)}function ne(H,F){if(H.nodeType===ai)for(var ee=H.firstChild;ee;){var J=void 0;F&&(J=d(ee))?_(J):(m(ee),ee.firstChild&&ne(ee,F)),ee=ee.nextSibling}}function w(H,F,ee){E(H)!==!1&&(F&&F.removeChild(H),m(H),ne(H,ee))}function R(H){if(H.nodeType===ai||H.nodeType===ws)for(var F=H.firstChild;F;){var ee=d(F);ee&&(M[ee]=F),R(F),F=F.nextSibling}}R(i);function j(H){A(H);for(var F=H.firstChild;F;){var ee=F.nextSibling,J=d(F);if(J){var $=M[J];$&&Ni(F,$)?(F.parentNode.replaceChild($,F),Y($,F)):j(F)}else j(F);F=ee}}function Ce(H,F,ee){for(;F;){var J=F.nextSibling;(ee=d(F))?_(ee):w(F,H,!0),F=J}}function Y(H,F,ee){var J=d(F);if(J&&delete M[J],!ee){var $=C(H,F);if($===!1||($ instanceof HTMLElement&&(H=$,R(H)),t(H,F),T(H),S(H,F)===!1))return}H.nodeName!=="TEXTAREA"?Qe(H,F):ys.TEXTAREA(H,F)}function Qe(H,F){var ee=L(H,F),J=F.firstChild,$=H.firstChild,rt,be,Be,je,Te;e:for(;J;){for(je=J.nextSibling,rt=d(J);!ee&&$;){if(Be=$.nextSibling,J.isSameNode&&J.isSameNode($)){J=je,$=Be;continue e}be=d($);var me=$.nodeType,Xe=void 0;
10if(me===J.nodeType&&(me===ai?(rt?rt!==be&&((Te=M[rt])?Be===Te?Xe=!1:(H.insertBefore(Te,$),be?_(be):w($,H,!0),$=Te,be=d($)):Xe=!1):be&&(Xe=!1),Xe=Xe!==!1&&Ni($,J),Xe&&Y($,J)):(me===Es||me==As)&&(Xe=!0,$.nodeValue!==J.nodeValue&&($.nodeValue=J.nodeValue))),Xe){J=je,$=Be;continue e}be?_(be):w($,H,!0),$=Be}if(rt&&(Te=M[rt])&&Ni(Te,J))ee||V(H,Te),Y(Te,J);else{var ge=p(J);ge!==!1&&(ge&&(J=ge),J.actualize&&(J=J.actualize(H.ownerDocument||ke)),V(H,J),j(J))}J=je,$=Be}Ce(H,$,be);var P=ys[H.nodeName];P&&P(H,F)}var N=i,mt=N.nodeType,He=n.nodeType;if(!pe){if(mt===ai)He===ai?Ni(i,n)||(m(i),N=ro(i,so(n.nodeName,n.namespaceURI))):N=n;else if(mt===Es||mt===As){if(He===mt)return N.nodeValue!==n.nodeValue&&(N.nodeValue=n.nodeValue),N;N=n}}if(N===n)m(i);else{if(n.isSameNode&&n.isSameNode(N))return;if(Y(N,n,pe),I)for(var gt=0,ci=I.length;gt<ci;gt++){var Pt=M[I[gt]];Pt&&w(Pt,Pt.parentNode,!1)}}return!pe&&N!==i&&i.parentNode&&(N.actualize&&(N=N.actualize(i.ownerDocument||ke)),i.parentNode.replaceChild(N,i)),N}}var lo=ao(Gr),_n=lo,Fi=class{constructor(t,e,i,n,s,r={}){this.view=t,this.liveSocket=t.liveSocket,this.container=e,this.rootID=t.root.id,this.html=i,this.streams=n,this.streamInserts={},this.streamComponentRestore={},this.targetCID=s,this.pendingRemoves=[],this.phxRemove=this.liveSocket.binding("remove"),this.targetContainer=s?g.getComponent(this.view.id,s):e,this.beforeUpdatedCallbacks=[],this.afterAddedCallbacks=[],this.afterUpdatedCallbacks=[],this.afterPhxChildAddedCallbacks=[],this.afterDiscardedCallbacks=[],this.afterTransitionsDiscardedCallbacks=[],this.withChildren=r.withChildren||r.undoRef!==void 0||!1,this.undoRef=r.undoRef??null}beforeUpdated(t){this.beforeUpdatedCallbacks.push(t)}afterAdded(t){this.afterAddedCallbacks.push(t)}afterUpdated(t){this.afterUpdatedCallbacks.push(t)}afterPhxChildAdded(t){this.afterPhxChildAddedCallbacks.push(t)}afterDiscarded(t){this.afterDiscardedCallbacks.push(t)}afterTransitionsDiscarded(t){this.afterTransitionsDiscardedCallbacks.push(t)}markPrunableContentForRemoval(){let t=this.liveSocket.binding(Ji);g.all(this.container,`[${t}=append] > *, [${t}=prepend] > *`,e=>{e.setAttribute(es,"")})}perform(t){let{view:e,liveSocket:i,html:n,container:s}=this,r=this.targetContainer;if(this.targetCID){let M=r.closest(`[${ce}]`);if(M&&!M.isSameNode(r)){let I=g.private(M,ce);
10if(I&&(r=I.querySelector(`[data-phx-component="${this.targetCID}"]`),!r))return}}let a=i.getActiveElement(),{selectionStart:h,selectionEnd:d}=a&&g.hasSelectionRange(a)?a:{},p=i.binding(Ji),A=i.binding(En),C=i.binding(An),T=i.binding(yr),E=[],m=[],S=[],L=[],V=null,pe=(M,I,_=this.withChildren)=>{let ne={childrenOnly:M.getAttribute(Ge)===null&&!_,getNodeKey:w=>!(w instanceof Element)||g.isPhxDestroyed(w)?null:t?w.id:g.private(w,"clientsideIdAttribute")?w.getAttribute(wn):w.id||w.getAttribute(wn),skipFromChildren:w=>w.getAttribute(p)===Ui,addChild:(w,R)=>{let{ref:j,streamAt:Ce}=this.getStreamInsert(R);if(j===void 0)return w.appendChild(R);if(this.setStreamRef(R,j),Ce===0)w.insertAdjacentElement("afterbegin",R);else if(Ce===-1){let Y=w.lastElementChild;if(Y&&!Y.hasAttribute(ii)){let Qe=Array.from(w.children).find(N=>!N.hasAttribute(ii));w.insertBefore(R,Qe??null)}else w.appendChild(R)}else if(Ce>0){let Y=Array.from(w.children)[Ce];w.insertBefore(R,Y)}},onBeforeNodeAdded:w=>{if(!(w instanceof Element))return w;if(this.getStreamInsert(w)?.updateOnly&&!this.streamComponentRestore[w.id])return!1;g.maintainPrivateHooks(w,w,A,C);let R=w;return this.streamComponentRestore[w.id]&&(R=this.streamComponentRestore[w.id],delete this.streamComponentRestore[w.id],pe(R,w,!0)),R},onNodeAdded:w=>{if(!(w instanceof Element)){E.push(w);return}this.maybeReOrderStream(w,!0),g.isPortalTemplate(w)&&L.push(()=>this.teleport(w,pe)),w instanceof HTMLImageElement&&w.srcset?w.srcset=w.srcset:w instanceof HTMLVideoElement&&w.autoplay&&w.play(),g.isNowTriggerFormExternal(w,T)&&(V=w),(g.isPhxChild(w)&&e.ownsElement(w)||g.isPhxSticky(w)&&e.ownsElement(w.parentNode))&&this.trackAfterPhxChildAdded(w),w.nodeName==="SCRIPT"&&w.hasAttribute(Bi)&&this.handleRuntimeHook(w,I),E.push(w)},onNodeDiscarded:w=>this.onNodeDiscarded(w),onBeforeNodeDiscarded:w=>{if(!(w instanceof Element)||w.getAttribute(es)!==null)return!0;if(w.parentElement!==null&&w.id&&g.isPhxUpdate(w.parentElement,p,[Ui,"append","prepend"])||w.getAttribute(_t)||this.maybePendingRemove(w)||this.skipCIDSibling(w))return!1;if(g.isPortalTemplate(w)){let R=document.getElementById(w.content.firstElementChild?.id||"");R&&(R.remove(),ne.onNodeDiscarded(R),this.view.dropPortalElementId(R.id))}return!0},onElUpdated:w=>{g.isNowTriggerFormExternal(w,T)&&(V=w),m.push(w),this.maybeReOrderStream(w,!1)},onBeforeElUpdated:(w,R)=>{if(w.id&&w.isSameNode(M)&&w.id!==R.id)return ne.onNodeDiscarded(w),w.replaceWith(R),ne.onNodeAdded(R);g.syncPendingAttrs(w,R),g.maintainPrivateHooks(w,R,A,C),g.cleanChildNodes(R,p);let j=a&&w.isSameNode(a)&&g.isEditableInput(w),Ce=j&&this.isChangedSelect(w,R);if(this.skipCIDSibling(R))return this.maybeCloneLockedElement(w,j),this.copyNestedPrivateLock(w,R),this.maybeReOrderStream(w),!1;if(g.isPhxSticky(w))return[Ye,Ct,nt].map(Y=>[Y,w.getAttribute(Y),R.getAttribute(Y)]).forEach(([Y,Qe,N])=>{N&&Qe!==N&&w.setAttribute(Y,N)}),!1;if(g.isIgnored(w,p)||w.form&&w.form.isSameNode(V))return this.trackBeforeUpdated(w,R),g.mergeAttrs(w,R,{isIgnored:g.isIgnored(w,p)}),m.push(w),g.applyStickyOperations(w),!1;if(w.type==="number"&&w.validity&&w.validity.badInput)return!1;if(w=this.maybeCloneLockedElement(w,j),g.isPhxChild(R)){let Y=w.getAttribute(Ye);return g.mergeAttrs(w,R,{exclude:[Ct]}),Y!==""&&w.setAttribute(Ye,Y),w.setAttribute(nt,this.rootID),g.applyStickyOperations(w),!1}return this.copyNestedPrivateLock(w,R),g.copyPrivates(R,w),g.isPortalTemplate(R)?(L.push(()=>this.teleport(R,pe)),w.content.replaceChildren(R.content.cloneNode(!0)),!1):j&&w.type!=="hidden"&&!Ce?(this.trackBeforeUpdated(w,R),g.mergeFocusedInput(w,R),g.syncAttrsToProps(w),m.push(w),g.applyStickyOperations(w),!1):(Ce&&w.blur(),g.isPhxUpdate(R,p,["append","prepend"])&&S.push(new Kr(w,R,R.getAttribute(p))),g.syncAttrsToProps(R),g.applyStickyOperations(R),this.trackBeforeUpdated(w,R),w)}};_n(M,I,ne)};if(this.trackBeforeUpdated(s,s),i.time("morphdom",()=>{this.streams.forEach(([I,_,ne,w])=>{_.forEach(([R,j,Ce,Y])=>{this.streamInserts[R]={ref:I,streamAt:j,limit:Ce,reset:w,updateOnly:Y}}),w!==void 0&&g.all(document,`[${ii}="${I}"]`,R=>{this.removeStreamChildElement(R)}),ne.forEach(R=>{let j=document.getElementById(R);j&&this.removeStreamChildElement(j)})}),t&&g.all(this.container,`[${p}=${Ui}]`).filter(I=>
10this.view.ownsElement(I)).forEach(I=>{Array.from(I.children).forEach(_=>{this.removeStreamChildElement(_,!0)})}),pe(r,n);let M=0;for(;L.length>0&&M<5;){let I=L.slice();L=[],I.forEach(_=>_()),M++}this.view.portalElementIds.forEach(I=>{let _=document.getElementById(I);if(_){let ne=_.getAttribute(pt);ne&&(document.getElementById(ne)||(_.remove(),this.onNodeDiscarded(_),this.view.dropPortalElementId(I)))}})}),i.isDebugEnabled()&&(Ir(),Or(this.streamInserts),Array.from(document.querySelectorAll("input[name=id]")).forEach(M=>{M instanceof HTMLInputElement&&M.form&&console.error(`Detected an input with name="id" inside a form! This will cause problems when patching the DOM.
11`,M)})),S.length>0&&i.time("post-morph append/prepend restoration",()=>{S.forEach(M=>M.perform())}),i.silenceEvents(()=>g.restoreFocus(a,h,d)),g.dispatchEvent(document,"phx:update"),E.forEach(M=>this.trackAfterAdded(M)),m.forEach(M=>this.trackAfterUpdated(M)),this.transitionPendingRemoves(),V){i.unload();let M=g.private(V,"submitter");if(M&&M.name&&r.contains(M)){let I=document.createElement("input");I.type="hidden";let _=M.getAttribute("form");_&&I.setAttribute("form",_),I.name=M.name,I.value=M.value,M.parentElement.insertBefore(I,M)}Object.getPrototypeOf(V).submit.call(V)}return!0}trackBeforeUpdated(t,e){this.beforeUpdatedCallbacks.forEach(i=>i(t,e))}trackAfterAdded(t){this.afterAddedCallbacks.forEach(e=>e(t))}trackAfterUpdated(t){this.afterUpdatedCallbacks.forEach(e=>e(t))}trackAfterPhxChildAdded(t){this.afterPhxChildAddedCallbacks.forEach(e=>e(t))}trackAfterDiscarded(t){this.afterDiscardedCallbacks.forEach(e=>e(t))}trackAfterTransitionsDiscarded(t){this.afterTransitionsDiscardedCallbacks.forEach(e=>e(t))}onNodeDiscarded(t){(g.isPhxChild(t)||g.isPhxSticky(t))&&this.liveSocket.destroyViewByEl(t),this.trackAfterDiscarded(t)}maybePendingRemove(t){return t.getAttribute&&t.getAttribute(this.phxRemove)!==null?(this.pendingRemoves.push(t),!0):!1}removeStreamChildElement(t,e=!1){!e&&!this.view.ownsElement(t)||(this.streamInserts[t.id]?(this.streamComponentRestore[t.id]=t,t.remove()):this.maybePendingRemove(t)||(t.remove(),this.onNodeDiscarded(t)))}getStreamInsert(t){return(t.id?this.streamInserts[t.id]:{})||{}}setStreamRef(t,e){g.putSticky(t,ii,i=>i.setAttribute(ii,e))}maybeReOrderStream(t,e=!1){let{ref:i,streamAt:n,reset:s}=this.getStreamInsert(t);if(n!==void 0&&(this.setStreamRef(t,i),!(!s&&!e)&&t.parentElement)){if(n===0)this.moveOrInsertBefore(t.parentElement,t,t.parentElement.firstElementChild);else if(n>0){let r=Array.from(t.parentElement.children),a=r.indexOf(t);if(n>=r.length-1)this.moveOrInsertBefore(t.parentElement,t,null);else{let h=r[n];a>n?this.moveOrInsertBefore(t.parentElement,t,h):this.moveOrInsertBefore(t.parentElement,t,h.nextElementSibling)}}this.maybeLimitStream(t)}}moveOrInsertBefore(t,e,i){if(typeof t.moveBefore=="function")try{t.moveBefore(e,i);return}catch{}t.insertBefore(e,i)}maybeLimitStream(t){let{limit:e}=this.getStreamInsert(t);if(e!==null){let i=Array.from(t.parentElement.children);e<0&&i.length>e*-1?i.slice(0,i.length+e).forEach(n=>this.removeStreamChildElement(n)):e>=0&&i.length>e&&i.slice(e).forEach(n=>this.removeStreamChildElement(n))}}transitionPendingRemoves(){let{pendingRemoves:t,liveSocket:e}=this;t.length>0&&e.transitionRemoves(t,this.view,()=>{t.forEach(i=>{let n=g.firstPhxChild(i);n&&e.destroyViewByEl(n),i.remove()}),this.trackAfterTransitionsDiscarded(t)})}isChangedSelect(t,e){return!(t instanceof HTMLSelectElement)||t.multiple?!1:t.options.length!==e.options.length?!0:(e.value=t.value,!t.isEqualNode(e))}skipCIDSibling(t){return t.nodeType===Node.ELEMENT_NODE&&t.hasAttribute(Ls)}maybeCloneLockedElement(t,e){if(!t.hasAttribute(Me))return t;let i=new Tn(t);if(!t.hasAttribute(ce)||this.undoRef!==null&&i.isLockUndoneBy(this.undoRef))return t;g.applyStickyOperations(t);let n=t.hasAttribute(ce)?g.private(t,ce)||t.cloneNode(!0):null;return n?(g.putPrivate(t,ce,n),e?t:n):t}copyNestedPrivateLock(t,e){this.undoRef===null||!g.private(e,ce)||g.putPrivate(t,ce,g.private(e,ce))}indexOf(t,e){return Array.from(t.children).indexOf(e)}teleport(t,e){let i=t.getAttribute(Rn),n=document.querySelector(i);if(!n)throw new Error("portal target with selector "+i+" not found");let s=t.content.firstElementChild;if(this.skipCIDSibling(s))return;if(!s?.id)throw new Error("phx-portal template must have a single root element with ID!");let r=document.getElementById(s.id),a;r?(n.contains(r)||n.appendChild(r),a=r):(a=document.createElement(s.tagName),n.appendChild(a)),s.setAttribute(_t,this.view.id),s.setAttribute(pt,t.id),e(a,s,!0),s.removeAttribute(_t),s.removeAttribute(pt),this.view.pushPortalElementId(s.id)}handleRuntimeHook(t,e){let i=t.getAttribute(Bi),n=t.hasAttribute("nonce")?t.getAttribute("nonce"):null;if(t.hasAttribute("nonce")){let r=document.createElement("template");r.innerHTML=e,n=r.content.querySelector(`script[${Bi}="${CSS.escape(i)}"]`)?.getAttribute("nonce")??null}let s=document.createElement("script");s.textContent=t.textContent,g.mergeAttrs(s,t,{isIgnored:!1}),n&&(s.nonce=n),t.replaceWith(s),t=s}},ho=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),co=new Set(["'",'"']),Ss=(t,e,i)=>{let n=0,s=!1,r,a,h,d,p,A,C=t.match(/^(\s*(?:<!--.*?-->\s*)*)<([^\s\/>]+)/);if(C===null)throw new Error(`malformed html ${t}`);for(n=C[0].length,r=C[1],h=C[2],d=n,n;n<t.length&&t.charAt(n)!==">";n++)if(t.charAt(n)==="="){let m=t.slice(n-3,n)===" id";n++;let S=t.charAt(n);if(co.has(S)){let L=n;for(n++,n;n<t.length&&t.charAt(n)!==S;n++);if(m){p=t.slice(L+1,n);break}}}let T=t.length-1;for(s=!1;T>=r.length+h.length;){let m=t.charAt(T);if(s)m==="-"&&t.slice(T-3,T)==="<!-"?(s=!1,T-=4):T-=1;else if(m===">"&&t.slice(T-2,T)==="--")s=!0,T-=3;else{if(m===">")break;T-=1}}a=t.slice(T+1,t.length);let E=Object.keys(e).map(m=>e[m]===!0?m:`${m}="${e[m]}"`).join(" ");if(i){let m=p?` id="${p}"`:"";ho.has(h)?A=`<${h}${m}${E===""?"":" "}${E}/>`:A=`<${h}${m}${E===""?"":" "}${E}></${h}>`}else{let m=t.slice(d,T+1);A=`<${h}${E===""?"":" "}${E}${m}`}return[A,r,a]},ks=class{static extract(t){let{[us]:e,[ds]:i,[fs]:n}=t;return delete t[us],delete t[ds],delete t[fs],{diff:t,title:n,reply:e||null,events:i||[]}}constructor(t,e){this.viewId=t,this.rendered={},this.magicId=0,this.mergeDiff(e)}parentViewId(){return this.viewId}toString(t){let{buffer:e,streams:i}=this.recursiveToString(this.rendered,this.rendered[Se],t,!0,{});return{buffer:e,streams:i}}recursiveToString(t,e=t[Se],i,n,s){i=i?new Set(i):null;let r={buffer:"",components:e,onlyCids:i,streams:new Set};return this.toOutputBuffer(t,null,r,n,s),{buffer:r.buffer,streams:r.streams}}componentCIDs(t){return Object.keys(t[Se]||{}).map(e=>parseInt(e))}isComponentOnlyDiff(t){return t[Se]?Object.keys(t).length===1:!1}getComponent(t,e){return t[Se][e]}resetRender(t){this.rendered[Se][t]&&(this.rendered[Se][t].reset=!0)}mergeDiff(t){let e=t[Se],i={};if(delete t[Se],this.rendered=this.mutableMerge(this.rendered,t),this.rendered[Se]=this.rendered[Se]||{},e){let n=this.rendered[Se];for(let s in e)e[s]=this.cachedFindComponent(s,e[s],n,e,i);for(let s in e)n[s]=e[s];t[Se]=e}}cachedFindComponent(t,e,i,n,s){if(s[t])return s[t];{let r,a,h=e[Oe];if(ft(h)){let d;h>0?d=this.cachedFindComponent(h,n[h],i,n,s):d=i[-h],a=d[Oe],r=this.cloneMerge(d,e,!0),r[Oe]=a}else r=e[Oe]!==void 0||i[t]===void 0?e:this.cloneMerge(i[t],e,!1);return s[t]=r,r}}mutableMerge(t,e){return e[Oe]!==void 0?e:(this.doMutableMerge(t,e),t)}
11doMutableMerge(t,e){if(e[he])this.mergeKeyed(t,e);else for(let i in e){let n=e[i],s=t[i];Ft(n)&&n[Oe]===void 0&&Ft(s)?this.doMutableMerge(s,n):t[i]=n}t[gn]&&(t.newRender=!0)}clone(t){return"structuredClone"in window?structuredClone(t):JSON.parse(JSON.stringify(t))}mergeKeyed(t,e){let i=this.clone(t);if(Object.entries(e[he]).forEach(([n,s])=>{if(n!==Ke)if(Array.isArray(s)){let[r,a]=s;t[he][n]=i[he][r],this.doMutableMerge(t[he][n],a)}else if(typeof s=="number"){let r=s;t[he][n]=i[he][r]}else typeof s=="object"&&(t[he][n]||(t[he][n]={}),this.doMutableMerge(t[he][n],s))}),e[he][Ke]<t[he][Ke])for(let n=e[he][Ke];n<t[he][Ke];n++)delete t[he][n];t[he][Ke]=e[he][Ke],e[Nt]&&(t[Nt]=e[Nt]),e[dt]&&(t[dt]=e[dt])}cloneMerge(t,e,i){let n;if(e[he])n=this.clone(t),this.mergeKeyed(n,e);else{n={...t,...e};for(let s in n){let r=e[s],a=t[s];Ft(r)&&r[Oe]===void 0&&Ft(a)?n[s]=this.cloneMerge(a,r,i):r===void 0&&Ft(a)&&(n[s]=this.cloneMerge(a,{},i))}}return i?(delete n.magicId,delete n.newRender):t[gn]&&(n.newRender=!0),n}componentToString(t){let{buffer:e,streams:i}=this.recursiveCIDToString(this.rendered[Se],t,null),[n,s,r]=Ss(e,{});return{buffer:n,streams:i}}pruneCIDs(t){t.forEach(e=>delete this.rendered[Se][e])}get(){return this.rendered}isNewFingerprint(t={}){return!!t[Oe]}templateStatic(t,e){return typeof t=="number"?e[t]:t}nextMagicID(){return this.magicId++,`m${this.magicId}-${this.parentViewId()}`}toOutputBuffer(t,e,i,n,s={}){if(t[he])return this.comprehensionToBuffer(t,e,i,n);t[dt]&&(e=t[dt],delete t[dt]);let{[Oe]:r}=t;r=this.templateStatic(r,e),t[Oe]=r;let a=t[gn],h=i.buffer;a&&(i.buffer=""),n&&a&&!t.magicId&&(t.newRender=!0,t.magicId=this.nextMagicID()),i.buffer+=r[0];for(let d=1;d<r.length;d++)this.dynamicToBuffer(t[d-1],e,i,n),i.buffer+=r[d];if(a){let d=!1,p;n||t.magicId?(d=n&&!t.newRender,p={[wn]:t.magicId,...s}):p=s,d&&(p[Ls]=!0);let[A,C,T]=Ss(i.buffer,p,d);t.newRender=!1,i.buffer=h+C+A+T}}comprehensionToBuffer(t,e,i,n){let s=e||t[dt],r=this.templateStatic(t[Oe],e);t[Oe]=r,delete t[dt];for(let a=0;a<t[he][Ke];a++){i.buffer+=r[0];for(let h=1;h<r.length;h++)this.dynamicToBuffer(t[he][a][h-1],s,i,n),i.buffer+=r[h]}if(t[Nt]){let a=t[Nt],[h,d,p,A]=a||[null,{},[],null];a!==void 0&&(t[he][Ke]>0||p.length>0||A)&&(delete t[Nt],t[he]={[Ke]:0},i.streams.add(a))}}dynamicToBuffer(t,e,i,n){if(typeof t=="number"){let{buffer:s,streams:r}=this.recursiveCIDToString(i.components,t,i.onlyCids);i.buffer+=s,i.streams=new Set([...i.streams,...r])}else Ft(t)?this.toOutputBuffer(t,e,i,n,{}):i.buffer+=t}recursiveCIDToString(t,e,i){let n=t[e]||ie(`no component for CID ${e}`,t),s={[Ge]:e,[Bt]:this.viewId},r=i&&!i.has(e);n.newRender=!r,n.magicId=`c${e}-${this.parentViewId()}`;let a=!n.reset,{buffer:h,streams:d}=this.recursiveToString(n,t,i,a,s);return delete n.reset,{buffer:h,streams:d}}},Cs=[],Ts=200,uo={exec(t,e,i,n,s,r){let[a,h]=r||[null,{callback:r&&r.callback}];(Array.isArray(i)?i:typeof i=="string"&&i.startsWith("[")?JSON.parse(i):[[a,h]]).forEach(([p,A])=>{p===a&&(A={...h,...A},A.callback=A.callback||h.callback),this.filterToEls(n.liveSocket,s,A).forEach(C=>{this[`exec_${p}`](t,e,i,n,s,C,A)})})},isVisible(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length>0)},isInViewport(t){let e=t.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth;return e.right>0&&e.bottom>0&&e.left<n&&e.top<i},exec_exec(t,e,i,n,s,r,{attr:a,to:h}){let d=r.getAttribute(a);if(!d)throw new Error(`expected ${a} to contain JS command on "${h}"`);n.liveSocket.execJS(r,d,e)},exec_dispatch(t,e,i,n,s,r,{event:a,detail:h,bubbles:d,blocking:p}){if(h=h||{},h.dispatcher=s,p){let A=new Promise((C,T)=>{h.done=C});n.liveSocket.asyncTransition(A)}g.dispatchEvent(r,a,{detail:h,bubbles:d})},exec_push(t,e,i,n,s,r,a){let{event:h,data:d,target:p,page_loading:A,loading:C,value:T,dispatcher:E,callback:m}=a,S={loading:C,value:T,target:p,page_loading:!!A,originalEvent:t},L=e==="change"&&E?E:s,V=p||L.getAttribute(n.binding("target"))||L,pe=(M,I)=>{if(M.isConnected())if(e==="change"){let{newCid:_,_target:ne}=a;ne=ne||(g.isFormAssociated(s)?s.name:void 0),ne&&(S._target=ne),M.pushInput(s,I,_,h||i,S,m)}else if(e==="submit"){let{submitter:_}=a;M.submitForm(s,I,h||i,_,S,m)}else M.pushEvent(e,s,I,h||i,d,S,m)};a.targetView&&a.targetCtx?pe(a.targetView,a.targetCtx):n.withinTargets(V,pe)},exec_navigate(t,e,i,n,s,r,{href:a,replace:h}){n.liveSocket.historyRedirect(t,a,h?"replace":"push",null,s)},exec_patch(t,e,i,n,s,r,{href:a,replace:h}){n.liveSocket.pushHistoryPatch(t,a,h?"replace":"push",s)},exec_focus(t,e,i,n,s,r){Ie.attemptFocus(r),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>Ie.attemptFocus(r))})},exec_focus_first(t,e,i,n,s,r){Ie.focusFirstInteractive(r)||Ie.focusFirst(r),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>Ie.focusFirstInteractive(r)||Ie.focusFirst(r))})},exec_push_focus(t,e,i,n,s,r){Cs.push(r||s)},exec_pop_focus(t,e,i,n,s,r){let a=Cs.pop();a&&(a.focus(),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>a.focus())}))},exec_add_class(t,e,i,n,s,r,{names:a,transition:h,time:d,blocking:p}){this.addOrRemoveClasses(r,a,[],h,d,n,p)},exec_remove_class(t,e,i,n,s,r,{names:a,transition:h,time:d,blocking:p}){this.addOrRemoveClasses(r,[],a,h,d,n,p)},exec_toggle_class(t,e,i,n,s,r,{names:a,transition:h,time:d,blocking:p}){this.toggleClasses(r,a,h,d,n,p)},exec_toggle_attr(t,e,i,n,s,r,{attr:[a,h,d]}){this.toggleAttr(r,a,h,d)},exec_ignore_attrs(t,e,i,n,s,r,{attrs:a}){this.ignoreAttrs(r,a)}
11,exec_transition(t,e,i,n,s,r,{time:a,transition:h,blocking:d}){this.addOrRemoveClasses(r,[],[],h,a,n,d)},exec_toggle(t,e,i,n,s,r,{display:a,ins:h,outs:d,time:p,blocking:A}){this.toggle(e,n,r,a,h,d,p,A)},exec_show(t,e,i,n,s,r,{display:a,transition:h,time:d,blocking:p}){this.show(e,n,r,a,h,d,p)},exec_hide(t,e,i,n,s,r,{display:a,transition:h,time:d,blocking:p}){this.hide(e,n,r,a,h,d,p)},exec_set_attr(t,e,i,n,s,r,{attr:[a,h]}){this.setOrRemoveAttrs(r,[[a,h]],[])},exec_remove_attr(t,e,i,n,s,r,{attr:a}){this.setOrRemoveAttrs(r,[],[a])},ignoreAttrs(t,e){g.putPrivate(t,"JS:ignore_attrs",{apply:(i,n)=>{let s=Array.from(i.attributes),r=s.map(a=>a.name);Array.from(n.attributes).filter(a=>!r.includes(a.name)).forEach(a=>{g.attributeIgnored(a,e)&&n.removeAttribute(a.name)}),s.forEach(a=>{g.attributeIgnored(a,e)&&n.setAttribute(a.name,a.value)})}})},onBeforeElUpdated(t,e){let i=g.private(t,"JS:ignore_attrs");i&&i.apply(t,e)},show(t,e,i,n,s,r,a){this.isVisible(i)||this.toggle(t,e,i,n,s,null,r,a)},hide(t,e,i,n,s,r,a){this.isVisible(i)&&this.toggle(t,e,i,n,null,s,r,a)},toggle(t,e,i,n,s,r,a,h){a=a||Ts;let[d,p,A]=s||[[],[],[]],[C,T,E]=r||[[],[],[]];if(d.length>0||C.length>0)if(this.isVisible(i)){let m=()=>{this.addOrRemoveClasses(i,T,d.concat(p).concat(A)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(i,C,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(i,E,T))})},S=()=>{this.addOrRemoveClasses(i,[],C.concat(E)),g.putSticky(i,"toggle",L=>L.style.display="none"),i.dispatchEvent(new Event("phx:hide-end"))};i.dispatchEvent(new Event("phx:hide-start")),h===!1?(m(),setTimeout(S,a)):e.transition(a,m,S)}else{if(t==="remove")return;let m=()=>{this.addOrRemoveClasses(i,p,C.concat(T).concat(E));let L=n||this.defaultDisplay(i);window.requestAnimationFrame(()=>{this.addOrRemoveClasses(i,d,[]),window.requestAnimationFrame(()=>{g.putSticky(i,"toggle",V=>V.style.display=L),this.addOrRemoveClasses(i,A,p)})})},S=()=>{this.addOrRemoveClasses(i,[],d.concat(A)),i.dispatchEvent(new Event("phx:show-end"))};i.dispatchEvent(new Event("phx:show-start")),h===!1?(m(),setTimeout(S,a)):e.transition(a,m,S)}else this.isVisible(i)?window.requestAnimationFrame(()=>{i.dispatchEvent(new Event("phx:hide-start")),g.putSticky(i,"toggle",m=>m.style.display="none"),i.dispatchEvent(new Event("phx:hide-end"))}):window.requestAnimationFrame(()=>{i.dispatchEvent(new Event("phx:show-start"));let m=n||this.defaultDisplay(i);g.putSticky(i,"toggle",S=>S.style.display=m),i.dispatchEvent(new Event("phx:show-end"))})},toggleClasses(t,e,i,n,s,r){window.requestAnimationFrame(()=>{let[a,h]=g.getSticky(t,"classes",[[],[]]),d=e.filter(A=>a.indexOf(A)<0&&!t.classList.contains(A)),p=e.filter(A=>h.indexOf(A)<0&&t.classList.contains(A));this.addOrRemoveClasses(t,d,p,i,n,s,r)})},toggleAttr(t,e,i,n){t.hasAttribute(e)?n!==void 0?t.getAttribute(e)===i?this.setOrRemoveAttrs(t,[[e,n]],[]):this.setOrRemoveAttrs(t,[[e,i]],[]):this.setOrRemoveAttrs(t,[],[e]):this.setOrRemoveAttrs(t,[[e,i]],[])},addOrRemoveClasses(t,e,i,n,s,r,a){s=s||Ts;let[h,d,p]=n||[[],[],[]];if(h.length>0){let A=()=>{this.addOrRemoveClasses(t,d,[].concat(h).concat(p)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(t,h,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(t,p,d))})},C=()=>this.addOrRemoveClasses(t,e.concat(p),i.concat(h).concat(d));a===!1?(A(),setTimeout(C,s)):r.transition(s,A,C);return}window.requestAnimationFrame(()=>{let[A,C]=g.getSticky(t,"classes",[[],[]]),T=e.filter(L=>A.indexOf(L)<0&&!t.classList.contains(L)),E=i.filter(L=>C.indexOf(L)<0&&t.classList.contains(L)),m=A.filter(L=>i.indexOf(L)<0).concat(T),S=C.filter(L=>e.indexOf(L)<0).concat(E);g.putSticky(t,"classes",L=>(L.classList.remove(...S),L.classList.add(...m),[m,S]))})},setOrRemoveAttrs(t,e,i){let[n,s]=g.getSticky(t,"attrs",[[],[]]),r=e.map(([d,p])=>d).concat(i),a=n.filter(([d,p])=>!r.includes(d)).concat(e),h=s.filter(d=>!r.includes(d)).concat(i);e.some(([d,p])=>d==="id"&&t.getAttribute("id")!==p)&&g.putPrivate(t,"clientsideIdAttribute",!0),g.putSticky(t,"attrs",d=>(h.forEach(p=>d.removeAttribute(p)),a.forEach(([p,A])=>d.setAttribute(p,A)),[a,h]))},hasAllClasses(t,e){return e.every(i=>t.classList.contains(i))},isToggledOut(t,e){return!this.isVisible(t)||this.hasAllClasses(t,e)},filterToEls(t,e,{to:i}){let n=()=>
11{if(typeof i=="string")return document.querySelectorAll(i);if(i.closest){let s=e.closest(i.closest);return s?[s]:[]}else if(i.inner)return e.querySelectorAll(i.inner)};return i?t.jsQuerySelectorAll(e,i,n):[e]},defaultDisplay(t){return{tr:"table-row",td:"table-cell"}[t.tagName.toLowerCase()]||"block"},transitionClasses(t){if(!t)return null;let[e,i,n]=Array.isArray(t)?t:[t.split(" "),[],[]];return e=Array.isArray(e)?e:e.split(" "),i=Array.isArray(i)?i:i.split(" "),n=Array.isArray(n)?n:n.split(" "),[e,i,n]}},z=uo,Os=(t,e)=>({exec(i,n){t.execJS(i,n,e)},show(i,n={}){let s=t.owner(i);z.show(e,s,i,n.display,z.transitionClasses(n.transition),n.time,n.blocking)},hide(i,n={}){let s=t.owner(i);z.hide(e,s,i,null,z.transitionClasses(n.transition),n.time,n.blocking)},toggle(i,n={}){let s=t.owner(i),r=z.transitionClasses(n.in),a=z.transitionClasses(n.out);z.toggle(e,s,i,n.display,r,a,n.time,n.blocking)},addClass(i,n,s={}){let r=Array.isArray(n)?n:n.split(" "),a=t.owner(i);z.addOrRemoveClasses(i,r,[],z.transitionClasses(s.transition),s.time,a,s.blocking)},removeClass(i,n,s={}){let r=Array.isArray(n)?n:n.split(" "),a=t.owner(i);z.addOrRemoveClasses(i,[],r,z.transitionClasses(s.transition),s.time,a,s.blocking)},toggleClass(i,n,s={}){let r=Array.isArray(n)?n:n.split(" "),a=t.owner(i);z.toggleClasses(i,r,z.transitionClasses(s.transition),s.time,a,s.blocking)},transition(i,n,s={}){let r=t.owner(i);z.addOrRemoveClasses(i,[],[],z.transitionClasses(n),s.time,r,s.blocking)},setAttribute(i,n,s){z.setOrRemoveAttrs(i,[[n,s]],[])},removeAttribute(i,n){z.setOrRemoveAttrs(i,[],[n])},toggleAttribute(i,n,s,r){z.toggleAttr(i,n,s,r)},push(i,n,s={}){t.withinOwners(i,r=>{let a=s.value||{};delete s.value;let h=new CustomEvent("phx:exec",{detail:{sourceElement:i}});z.exec(h,e,n,r,i,["push",{data:a,...s}])})},navigate(i,n={}){ps(i,"navigate");let s=new CustomEvent("phx:exec");t.historyRedirect(s,i,n.replace?"replace":"push",null,null)},patch(i,n={}){ps(i,"patch");let s=new CustomEvent("phx:exec");t.pushHistoryPatch(s,i,n.replace?"replace":"push",null)},ignoreAttributes(i,n){z.ignoreAttrs(i,Array.isArray(n)?n:[n])}}),bn="hookId",_s="deadHook",fo=1,At=class Ms{get liveSocket(){return this.__liveSocket()}static makeID(){return fo++}static elementID(e){return g.private(e,bn)}static deadHook(e){return g.private(e,_s)===!0}constructor(e,i,n){if(this.el=i,this.__attachView(e),this.__listeners=new Set,this.__isDisconnected=!1,g.putPrivate(this.el,bn,Ms.makeID()),e&&e.isDead&&g.putPrivate(this.el,_s,!0),n){let s=new Set(["el","liveSocket","__view","__listeners","__isDisconnected","constructor","js","pushEvent","pushEventTo","handleEvent","removeHandleEvent","upload","uploadTo","__mounted","__updated","__beforeUpdate","__destroyed","__reconnected","__disconnected","__cleanup__"]);for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(this[a]=n[a],s.has(a)&&console.warn(`Hook object for element #${i.id} overwrites core property '${a}'!`));["mounted","beforeUpdate","updated","destroyed","disconnected","reconnected"].forEach(a=>{n[a]&&typeof n[a]=="function"&&(this[a]=n[a])})}}__attachView(e){e?(this.__view=()=>e,this.__liveSocket=()=>e.liveSocket):(this.__view=()=>{throw new Error(`hook not yet attached to a live view: ${this.el.outerHTML}`)},this.__liveSocket=()=>{throw new Error(`hook not yet attached to a live view: ${this.el.outerHTML}`)})}mounted(){}beforeUpdate(){}updated(){}destroyed(){}disconnected(){}reconnected(){}__mounted(){this.mounted()}__updated(){this.updated()}__beforeUpdate(){this.beforeUpdate()}__destroyed(){this.destroyed(),g.deletePrivate(this.el,bn)}__reconnected(){this.__isDisconnected&&(this.__isDisconnected=!1,this.reconnected())}__disconnected(){this.__isDisconnected=!0,this.disconnected()}js(){return{...Os(this.__view().liveSocket,"hook"),exec:e=>{this.__view().liveSocket.execJS(this.el,e,"hook")}}}pushEvent(e,i,n){let s=this.__view().pushHookEvent(this.el,null,e,i||{});if(n===void 0)return s.then(({reply:r})=>r);s.then(({reply:r,ref:a})=>n(r,a)).catch(()=>{})}pushEventTo(e,i,n,s){if(s===void 0){let r=[];this.__view().withinTargets(e,(h,d)=>{r.push({view:h,targetCtx:d})});let a=r.map(({view:h,targetCtx:d})=>h.pushHookEvent(this.el,d,i,n||{}));return Promise.allSettled(a)}this.__view().withinTargets(e,(r,a)=>{r.pushHookEvent(this.el,a,i,n||{}).then(({reply:h,ref:d})=>s(h,d)).catch(()=>{})})}handleEvent(e,i){let n={event:e,callback:s=>i(s.detail)};return window.addEventListener(`phx:${e}`,n.callback),this.__listeners.add(n),n}removeHandleEvent(e){window.removeEventListener(`phx:${e.event}`,e.callback),this.__listeners.delete(e)}upload(e,i){return this.__view().dispatchUploads(null,e,i)}uploadTo(e,i,n){return this.__view().withinTargets(e,(s,r)=>{s.dispatchUploads(r,i,n)})}
11__cleanup__(){this.__listeners.forEach(e=>this.removeHandleEvent(e))}},po=(t,e)=>{let i=t.endsWith("[]"),n=i?t.slice(0,-2):t;return n=n.replace(/([^\[\]]+)(\]?$)/,`${e}$1$2`),i&&(n+="[]"),n},mo=class Hs{static closestView(e){let i=e.closest(hi);return i?g.private(i,"view"):null}constructor(e,i,n,s=null,r=null){this.rendered=null,this.isDead=!1,this.liveSocket=i,this.flash=s,this.parent=n,this.root=n?n.root:this,this.el=e;let a=g.private(this.el,"view");if(a!==void 0&&a.isDead!==!0)throw ie(`The DOM element for this view has already been bound to a view.
12
13        An element can only ever be associated with a single view!
14        Please ensure that you are not trying to initialize multiple LiveSockets on the same page.
15        This could happen if you're accidentally trying to render your root layout more than once.
16        Ensure that the template set on the LiveView is different than the root layout.
17      `,{view:a}),new Error("Cannot bind multiple views to the same DOM element.");g.putPrivate(this.el,"view",this),this.id=this.el.id,this.el.setAttribute(nt,this.root.id),this.ref=0,this.lastAckRef=null,this.childJoins=0,this.loaderTimer=null,this.disconnectedTimer=null,this.pendingDiffs=[],this.pendingForms=new Set,this.redirect=!1,this.href=null,this.joinCount=this.parent?this.parent.joinCount-1:0,this.joinAttempts=0,this.joinPending=!0,this.destroyed=!1,this.joinCallback=function(h){h&&h()},this.stopCallback=function(){},this.pendingJoinOps=[],this.viewHooks={},this.formSubmits=[],this.children=this.parent?null:{},this.root.children[this.id]={},this.formsForRecovery={},this.channel=this.liveSocket.channel(`lv:${this.id}`,()=>{let h=this.href&&this.expandURL(this.href);return{redirect:this.redirect?h:void 0,url:this.redirect?void 0:h||void 0,params:this.connectParams(r),session:this.getSession(),static:this.getStatic(),flash:this.flash??void 0,sticky:this.el.hasAttribute(Sn)}}),this.portalElementIds=new Set}setHref(e){this.href=e}setRedirect(e){this.redirect=!0,this.href=e}isMain(){return this.el.hasAttribute(xn)}connectParams(e){let i=this.liveSocket.params(this.el),n=g.all(document,`[${this.binding(gr)}]`).map(s=>"src"in s&&s.src||"href"in s&&s.href).filter(s=>typeof s=="string");return n.length>0&&(i._track_static=n),i._mounts=this.joinCount,i._mount_attempts=this.joinAttempts,i._live_referer=e??void 0,this.joinAttempts++,i}isConnected(){return this.channel.canPush()}getSession(){return this.el.getAttribute(Ye)}getStatic(){let e=this.el.getAttribute(Ct);return e===""?null:e}destroy(e=function(){}){this.destroyAllChildren(),this.destroyPortalElements(),this.destroyed=!0,g.deletePrivate(this.el,"view"),delete this.root.children[this.id],this.parent&&delete this.root.children[this.parent.id][this.id],this.loaderTimer!=null&&clearTimeout(this.loaderTimer);let i=()=>{e();for(let n in this.viewHooks)this.destroyHook(this.viewHooks[n])};g.markPhxChildDestroyed(this.el),this.log("destroyed",()=>["the child has been removed from the parent"]),this.channel.leave().receive("ok",i).receive("error",i).receive("timeout",i)}setContainerClasses(...e){this.el.classList.remove(ts,Et,Ht,is,ei),this.el.classList.add(...e)}showLoader(e){if(this.loaderTimer!=null&&clearTimeout(this.loaderTimer),e)this.loaderTimer=setTimeout(()=>this.showLoader(),e);else{for(let i in this.viewHooks)this.viewHooks[i].__disconnected();this.setContainerClasses(Et)}}execAll(e){g.all(this.el,`[${e}]`,i=>this.liveSocket.execJS(i,i.getAttribute(e)))}hideLoader(){this.loaderTimer!=null&&clearTimeout(this.loaderTimer),this.disconnectedTimer!=null&&clearTimeout(this.disconnectedTimer),this.setContainerClasses(ts),this.execAll(this.binding("connected"))}triggerReconnected(){for(let e in this.viewHooks)this.viewHooks[e].__reconnected()}log(e,i){this.liveSocket.log(this,e,i)}transition(e,i,n=function(){}){this.liveSocket.transition(e,i,n)}withinTargets(e,i,n=document){if(e instanceof HTMLElement||e instanceof SVGElement)return this.liveSocket.owner(e,s=>i(s,e));if(ft(e))g.findComponent(this.id,e,n)?i(this,typeof e=="number"?e:parseInt(e)):ie(`no component found matching phx-target of ${e}`);else{let s=Array.from(n.querySelectorAll(e));s.length===0&&ie(`nothing found matching the phx-target selector "${e}
17"`),s.forEach(r=>this.liveSocket.owner(r,a=>i(a,r)))}}applyDiff(e,i,n){this.log(e,()=>["",ji(i)]);let{diff:s,reply:r,events:a,title:h}=ks.extract(i),d=a.reduce((A,C)=>(C.length===3&&C[2]==!0?A.pre.push(C.slice(0,-1)):A.post.push(C),A),{pre:[],post:[]});this.liveSocket.dispatchEvents(d.pre);let p=()=>{n({diff:s,reply:r,events:d.post}),(typeof h=="string"||e=="mount"&&this.isMain())&&window.requestAnimationFrame(()=>g.putTitle(h))};"onDocumentPatch"in this.liveSocket.domCallbacks?this.liveSocket.triggerDOM("onDocumentPatch",[p]):p()}onJoin(e){let{rendered:i,container:n,liveview_version:s,pid:r}=e;if(n){let[a,h]=n;this.el=g.replaceRootContainer(this.el,a,h),g.putPrivate(this.el,"view",this)}this.childJoins=0,this.joinPending=!0,this.flash=null,this.root===this&&(this.formsForRecovery=this.getFormsForRecovery()),this.isMain()&&window.history.state===null&&Pe.pushState("replace",{type:"patch",id:this.id,position:this.liveSocket.currentHistoryPosition}),s!==this.liveSocket.version()&&console.warn(`LiveView asset version mismatch. JavaScript version ${this.liveSocket.version()} vs. server ${s}. To avoid issues, please ensure that your assets use the same version as the server.`),r&&this.el.setAttribute(Sr,r),Pe.dropLocal(this.liveSocket.localStorage,window.location.pathname,Ps),this.applyDiff("mount",i,({diff:a,events:h})=>{this.rendered=new ks(this.id,a);let[d,p]=this.renderContainer(null,"join");this.dropPendingRefs(),this.joinCount++,this.joinAttempts=0,this.maybeRecoverForms(d,()=>{this.onJoinComplete(e,d,p,h)})})}dropPendingRefs(){g.all(document,`[${Me}="${this.refSrc()}"]`,e=>{e.removeAttribute(jt),e.removeAttribute(Me),e.removeAttribute(ce)})}onJoinComplete({live_patch:e},i,n,s){if(this.joinCount>1||this.parent&&!this.parent.isJoinPending())return this.applyJoinPatch(e,i,n,s);g.findPhxChildrenInFragment(i,this.id).filter(a=>{let h=a.id&&this.el.querySelector(`[id="${a.id}"]`),d=h&&h.getAttribute(Ct);return d&&a.setAttribute(Ct,d),h&&h.setAttribute(nt,this.root.id),this.joinChild(a)}).length===0?this.parent?(this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(e,i,n,s)]),this.parent.ackJoin(this)):(this.onAllChildJoinsComplete(),this.applyJoinPatch(e,i,n,s)):this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(e,i,n,s)])}attachTrueDocEl(){let e=g.byId(this.id);if(!e)throw new Error("unable to find root element for view");this.el=e,g.putPrivate(this.el,"view",this),this.el.setAttribute(nt,this.root.id)}execNewMounted(e=document){let i=this.binding(En),n=this.binding(An);this.all(e,`[${i}], [${n}]`,s=>{g.maintainPrivateHooks(s,s,i,n),this.maybeAddNewHook(s)}),this.all(e,`[${this.binding(ti)}], [data-phx-${ti}]`,s=>{this.maybeAddNewHook(s)}),this.all(e,`[${this.binding(os)}]`,s=>{this.maybeMounted(s)})}all(e,i,n){g.all(e,i,s=>{this.ownsElement(s)&&n(s)})}applyJoinPatch(e,i,n,s){this.joinCount>1&&this.pendingJoinOps.length&&(this.pendingJoinOps.forEach(a=>typeof a=="function"&&a()),this.pendingJoinOps=[]),this.attachTrueDocEl();let r=new Fi(this,this.el,i,n,null);if(r.markPrunableContentForRemoval(),this.performPatch(r,!1,!0),this.joinNewChildren(),this.execNewMounted(),this.joinPending=!1,this.liveSocket.dispatchEvents(s),this.applyPendingUpdates(),e){let{kind:a,to:h}=e;this.liveSocket.historyPatch(h,a)}this.hideLoader(),this.joinCount>1&&this.triggerReconnected(),this.stopCallback()}triggerBeforeUpdateHook(e,i){this.liveSocket.triggerDOM("onBeforeElUpdated",[e,i]);let n=this.getHook(e),s=n&&g.isIgnored(e,this.binding(Ji));if(n&&!e.isEqualNode(i)&&!(s&&Hr(e.dataset,i.dataset)))return n.__beforeUpdate(),n}maybeMounted(e){let i=e.getAttribute(this.binding(os)),n=i&&g.private(e,"mounted");i&&!n&&(this.liveSocket.execJS(e,i),g.putPrivate(e,"mounted",!0))}maybeAddNewHook(e){let i=this.addHook(e);i&&i.__mounted()}performPatch(e,i,n=!1){let s=[],r=!1,a=new Set;return this.liveSocket.triggerDOM("onPatchStart",[e.targetContainer]),e.afterAdded(h=>{this.liveSocket.triggerDOM("onNodeAdded",[h]);let d=this.binding(En),p=this.binding(An);g.maintainPrivateHooks(h,h,d,p),this.maybeAddNewHook(h),h.getAttribute&&this.maybeMounted(h)}),e.afterPhxChildAdded(h=>{g.isPhxSticky(h)?this.liveSocket.joinRootViews():r=!0}),e.beforeUpdated((h,d)=>{this.triggerBeforeUpdateHook(h,d)&&a.add(h.id),z.onBeforeElUpdated(h,d)}),e.afterUpdated(h=>{if(a.has(h.id)){let d=this.getHook(h);d&&d.__updated()}}),e.afterDiscarded(h=>{h.nodeType===Node.ELEMENT_NODE&&s.push(h)}),e.afterTransitionsDiscarded(h=>
17this.afterElementsRemoved(h,i)),e.perform(n),this.afterElementsRemoved(s,i),this.liveSocket.triggerDOM("onPatchEnd",[e.targetContainer]),r}afterElementsRemoved(e,i){let n=[];e.forEach(s=>{let r=g.all(s,`[${Bt}="${this.id}"][${Ge}]`),a=g.all(s,`[${this.binding(ti)}], [data-phx-hook]`);r.concat(s).forEach(h=>{let d=this.componentID(h);ft(d)&&n.indexOf(d)===-1&&h.getAttribute(Bt)===this.id&&n.push(d)}),a.concat(s).forEach(h=>{let d=this.getHook(h);d&&this.destroyHook(d)})}),i&&this.maybePushComponentsDestroyed(n)}joinNewChildren(){g.findPhxChildren(document,this.id).forEach(e=>this.joinChild(e))}maybeRecoverForms(e,i){let n=this.binding("change"),s=this.root.formsForRecovery,r=document.createElement("template");if(r.innerHTML=e,!r.content.firstElementChild)return;g.all(r.content,`[${Rn}]`).forEach(d=>{d instanceof HTMLTemplateElement&&r.content.firstElementChild?.appendChild(d.content.firstElementChild)});let a=r.content.firstElementChild;a.id=this.id,a.setAttribute(nt,this.root.id),a.setAttribute(Ye,this.getSession()),a.setAttribute(Ct,this.getStatic()??""),this.parent&&a.setAttribute(Tt,this.parent.id),g.putPrivate(a,"view",this);let h=g.all(r.content,"form").filter(d=>d.id&&s[d.id]).filter(d=>!this.pendingForms.has(d.id)).filter(d=>s[d.id].getAttribute(n)===d.getAttribute(n)).map(d=>[s[d.id],d]);if(h.length===0)return i();h.forEach(([d,p],A)=>{this.pendingForms.add(p.id),this.pushFormRecovery(d,p,r.content.firstElementChild,()=>{this.pendingForms.delete(p.id),A===h.length-1&&i()})})}getChildById(e){return this.root.children[this.id][e]}
17getDescendentByEl(e){return e.id===this.id?this:this.children&&this.children[e.getAttribute(Tt)]?.[e.id]}destroyDescendent(e){for(let i in this.root.children)for(let n in this.root.children[i])if(n===e)return this.root.children[i][n].destroy()}joinChild(e){if(!this.getChildById(e.id)){let n=new Hs(e,this.liveSocket,this);return this.root.children[this.id][n.id]=n,n.join(),this.childJoins++,!0}}isJoinPending(){return this.joinPending}ackJoin(e){this.childJoins--,this.childJoins===0&&(this.parent?this.parent.ackJoin(this):this.onAllChildJoinsComplete())}onAllChildJoinsComplete(){this.pendingForms.clear(),this.formsForRecovery={},this.joinCallback(()=>{this.pendingJoinOps.forEach(([e,i])=>{e.isDestroyed()||i()}),this.pendingJoinOps=[]})}update(e,i,n=!1){if(this.isJoinPending()||this.liveSocket.hasPendingLink()&&this.root.isMain())return n||this.pendingDiffs.push({diff:e,events:i}),!1;this.rendered.mergeDiff(e);let s=!1;return this.rendered.isComponentOnlyDiff(e)?this.liveSocket.time("component patch complete",()=>{g.findExistingParentCIDs(this.id,this.rendered.componentCIDs(e)).forEach(a=>{this.componentPatch(this.rendered.getComponent(e,a),a)&&(s=!0)})}):ms(e)||this.liveSocket.time("full patch complete",()=>{let[r,a]=this.renderContainer(e,"update"),h=new Fi(this,this.el,r,a,null);s=this.performPatch(h,!0)}),this.liveSocket.dispatchEvents(i),s&&this.joinNewChildren(),!0}renderContainer(e,i){return this.liveSocket.time(`toString diff (${i})`,()=>{let n=this.el.tagName,s=e?this.rendered.componentCIDs(e):null,{buffer:r,streams:a}=this.rendered.toString(s);return[`<${n}>${r}</${n}>`,a]})}componentPatch(e,i){if(ms(e))return!1;let{buffer:n,streams:s}=this.rendered.componentToString(i),r=new Fi(this,this.el,n,s,i);return this.performPatch(r,!0)}getHook(e){return this.viewHooks[At.elementID(e)]}addHook(e){let i=At.elementID(e);if(!(e.getAttribute&&!this.ownsElement(e)))if(i&&!this.viewHooks[i]){if(At.deadHook(e))return;let n=g.getCustomElHook(e)||ie(`no hook found for custom element: ${e.id}`);return this.viewHooks[i]=n,n.__attachView(this),n}else{if(i||!e.getAttribute)return;{let n=e.getAttribute(`data-phx-${ti}`)||e.getAttribute(this.binding(ti));if(!n)return;let s=this.liveSocket.getHookDefinition(n);if(s){if(!e.id){ie(`no DOM ID for hook "${n}". Hooks require a unique ID on each element.`,e);return}let r;try{if(typeof s=="function"&&s.prototype instanceof At)r=new s(this,e);else if(typeof s=="object"&&s!==null)r=new At(this,e,s);else{ie(`Invalid hook definition for "${n}". Expected a class extending ViewHook or an object definition.`,e);return}}catch(a){let h=a instanceof Error?a.message:String(a);ie(`Failed to create hook "${n}": ${h}`,e);return}return this.viewHooks[At.elementID(r.el)]=r,r}
17else n!==null&&ie(`unknown hook found for "${n}"`,e)}}}destroyHook(e){let i=At.elementID(e.el);e.__destroyed(),e.__cleanup__(),delete this.viewHooks[i]}applyPendingUpdates(){this.pendingDiffs=this.pendingDiffs.filter(({diff:e,events:i})=>!this.update(e,i,!0)),this.eachChild(e=>e.applyPendingUpdates())}eachChild(e){let i=this.root.children[this.id]||{};for(let n in i)e(this.getChildById(n))}onChannel(e,i){this.liveSocket.onChannel(this.channel,e,n=>{this.isJoinPending()?this.joinCount>1?this.pendingJoinOps.push(()=>i(n)):this.root.pendingJoinOps.push([this,()=>i(n)]):this.liveSocket.requestDOMUpdate(()=>i(n))})}bindChannel(){this.liveSocket.onChannel(this.channel,"diff",e=>{this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",e,({diff:i,events:n})=>this.update(i,n))})}),this.onChannel("redirect",({to:e,flash:i})=>this.onRedirect({to:e,flash:i})),this.onChannel("live_patch",e=>this.onLivePatch(e)),this.onChannel("live_redirect",e=>this.onLiveRedirect(e)),this.channel.onError(e=>this.onError(e)),this.channel.onClose(e=>this.onClose(e))}destroyAllChildren(){this.eachChild(e=>e.destroy())}onLiveRedirect(e){let{to:i,kind:n,flash:s}=e,r=this.expandURL(i),a=new CustomEvent("phx:server-navigate",{detail:{to:i,kind:n,flash:s}});this.liveSocket.historyRedirect(a,r,n,s)}onLivePatch(e){let{to:i,kind:n}=e;this.href=this.expandURL(i),this.liveSocket.historyPatch(i,n)}expandURL(e){return e.startsWith("/")?`${window.location.protocol}//${window.location.host}${e}`:e}onRedirect({to:e,flash:i,reloadToken:n}){this.liveSocket.redirect(e,i??null,n??null)}isDestroyed(){return this.destroyed}joinDead(){this.isDead=!0}join(e){this.showLoader(this.liveSocket.loaderTimeout),this.bindChannel(),this.isMain()&&(this.stopCallback=this.liveSocket.withPageLoading({to:this.href,kind:"initial"})),this.joinCallback=i=>{i=i||function(){},e?e(this.joinCount,i):i()},this.wrapPush(()=>this.channel.join(),{ok:i=>this.liveSocket.requestDOMUpdate(()=>this.onJoin(i)),error:i=>this.onJoinError(i),timeout:()=>this.onJoinError({reason:"timeout"})})}onJoinError(e){if(e.events&&this.liveSocket.dispatchEvents(e.events),e.reason==="reload"){this.log("error",()=>[`failed mount with ${e.status}. Falling back to page reload`,e]),this.onRedirect({to:this.liveSocket.main.href,reloadToken:e.token});return}else if(e.reason==="unauthorized"||e.reason==="stale"){this.log("error",()=>["unauthorized live_redirect. Falling back to page request",e]),this.onRedirect({to:this.liveSocket.main.href,flash:this.flash});return}if((e.redirect||e.live_redirect)&&(this.joinPending=!1,this.channel.leave()),e.redirect)return this.onRedirect(e.redirect);if(e.live_redirect)return this.onLiveRedirect(e.live_redirect);if(this.log("error",()=>["unable to join",e]),this.isMain())this.displayError([Et,Ht,ei],{unstructuredError:e,errorKind:"server"}),this.liveSocket.isConnected()&&this.liveSocket.reloadWithJitter(this);else{this.joinAttempts>=ls&&(this.root.displayError([Et,Ht,ei],{unstructuredError:e,errorKind:"server"}),this.log("error",()=>[`giving up trying to mount after ${ls} tries`,e]),this.destroy());let i=g.byId(this.el.id);i?(g.mergeAttrs(i,this.el),this.displayError([Et,Ht,ei],{unstructuredError:e,errorKind:"server"}),this.el=i):this.destroy()}}onClose(e){if(!this.isDestroyed()){if(this.isMain()&&this.liveSocket.hasPendingLink()&&e!=="leave")return this.liveSocket.reloadWithJitter(this);this.destroyAllChildren(),this.liveSocket.dropActiveElement(this),this.liveSocket.isUnloaded()&&this.showLoader(_r)}}onError(e){this.onClose(e),this.liveSocket.isConnected()&&this.log("error",()=>["view crashed",e]),this.liveSocket.isUnloaded()||(this.liveSocket.isConnected()?this.displayError([Et,Ht,ei],{unstructuredError:e,errorKind:"server"}):this.displayError([Et,Ht,is],{unstructuredError:e,errorKind:"client"}))}displayError(e,i={}){this.isMain()&&g.dispatchEvent(window,"phx:page-loading-start",{detail:{to:this.href,kind:"error",...i}}),this.showLoader(),this.setContainerClasses(...e),this.delayedDisconnected()}delayedDisconnected(){this.disconnectedTimer=setTimeout(()=>{this.execAll(this.binding("disconnected"))},this.liveSocket.disconnectedTimeout)}wrapPush(e,i){let n=this.liveSocket.getLatencySim(),s=n?r=>setTimeout(()=>!this.isDestroyed()&&r(),n):r=>!this.isDestroyed()&&r();s(()=>{e().receive("ok",r=>s(()=>i.ok&&i.ok(r))).receive("error",r=>s(()=>i.error&&i.error(r))).receive("timeout",()=>s(()=>i.timeout&&i.timeout()))})}pushWithReply(e,i,n){if(!this.isConnected())return Promise.reject(new Error("no connection"));let[s,[r],a]=e?e({payload:n}):[null,[],{}],h=this.joinCount,d=function(){};return a.page_loading&&(d=this.liveSocket.withPageLoading({kind:"element",target:r})),typeof n.cid!="number"&&delete n.cid,new Promise((p,A)=>{this.wrapPush(()=>this.channel.push(i,n,Rr),{ok:C=>{s!==null&&(this.lastAckRef=s);let T=E=>{C.redirect&&this.onRedirect(C.redirect),C.live_patch&&this.onLivePatch(C.live_patch),C.live_redirect&&this.onLiveRedirect(C.live_redirect),d(),p({resp:C,reply:E,ref:s})};C.diff?this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",C.diff,({diff:E,reply:m,events:S})=>{s!==null&&this.undoRefs(s,n.event),this.update(E,S),T(m)})}):(s!==null&&this.undoRefs(s,n.event),T(null))},error:C=>A(new Error(`failed with reason: ${JSON.stringify(C)}`)),timeout:()=>{A(new Error("timeout")),this.joinCount===h&&this.liveSocket.reloadWithJitter(this,()=>{this.log("timeout",()=>["received timeout while communicating with server. Falling back to hard refresh for recovery"])})}})})}undoRefs(e,i,n){if(!this.isConnected())return;let s=`[${Me}="${this.refSrc()}"]`;n?(n=new Set(n),g.all(document,s,r=>{n&&!n.has(r)||(g.all(r,s,a=>this.undoElRef(a,e,i)),this.undoElRef(r,e,i))}
17)):g.all(document,s,r=>this.undoElRef(r,e,i))}undoElRef(e,i,n){new Tn(e).maybeUndo(i,n,r=>{let a=new Fi(this,e,r,new Set,null,{undoRef:i}),h=this.performPatch(a,!0);g.all(e,`[${Me}="${this.refSrc()}"]`,d=>this.undoElRef(d,i,n)),h&&this.joinNewChildren()})}refSrc(){return this.el.id}putRef(e,i,n,s={}){let r=this.ref++,a=this.binding(ns);if(s.loading){let h=g.all(document,s.loading).map(d=>({el:d,lock:!0,loading:!0}));e=e.concat(h)}for(let{el:h,lock:d,loading:p}of e){if(!d&&!p)throw new Error("putRef requires lock or loading");if(h.setAttribute(Me,this.refSrc()),p&&h.setAttribute(jt,r.toString()),d&&h.setAttribute(ce,r.toString()),!p||s.submitter&&!(h===s.submitter||h===s.form))continue;let A=new Promise(m=>{h.addEventListener(`phx:undo-lock:${r}`,()=>m(E),{once:!0})}),C=new Promise(m=>{h.addEventListener(`phx:undo-loading:${r}`,()=>m(E),{once:!0})});h.classList.add(`phx-${n}-loading`);let T=h.getAttribute(a);T!==null&&(h.getAttribute(Vi)||h.setAttribute(Vi,h.textContent||""),T!==""&&(h.textContent=T),h.setAttribute($t,h.getAttribute($t)||("disabled"in h?String(h.disabled):"")),h.setAttribute("disabled",""));let E={event:i,eventType:n,ref:r,isLoading:p,isLocked:d,lockElements:e.filter(({lock:m})=>m).map(({el:m})=>m),loadingElements:e.filter(({loading:m})=>m).map(({el:m})=>m),unlock:m=>{m=Array.isArray(m)?m:[m],this.undoRefs(r,i,m)},lockComplete:A,loadingComplete:C,lock:m=>
17new Promise(S=>{if(this.isAcked(r))return S(E);m.setAttribute(ce,r),m.setAttribute(Me,this.refSrc()),m.addEventListener(`phx:lock-stop:${r}`,()=>S(E),{once:!0})})};s.payload&&(E.payload=s.payload),s.target&&(E.target=s.target),s.originalEvent&&(E.originalEvent=s.originalEvent),h.dispatchEvent(new CustomEvent("phx:push",{detail:E,bubbles:!0,cancelable:!1})),i&&h.dispatchEvent(new CustomEvent(`phx:push:${i}`,{detail:E,bubbles:!0,cancelable:!1}))}return[r,e.map(({el:h})=>h),s]}isAcked(e){return this.lastAckRef!==null&&this.lastAckRef>=e}componentID(e){let i=e.getAttribute&&e.getAttribute(Ge);return i?parseInt(i):null}targetComponentID(e,i,n={}){if(ft(i))return i;let s=n.target||e.getAttribute(this.binding("target"));return ft(s)?typeof s=="number"?s:parseInt(s):i&&(s!==null||n.target)?this.closestComponentID(i):null}closestComponentID(e){return ft(e)?e:e?Ut(e.closest(`[${Ge}],[${pt}]`),i=>{if(i.hasAttribute(Ge))return this.ownsElement(i)&&this.componentID(i);if(i.hasAttribute(pt)){let n=g.byId(i.getAttribute(pt));return this.closestComponentID(n)}}):null}pushHookEvent(e,i,n,s){if(!this.isConnected())return this.log("hook",()=>["unable to push hook event. LiveView not connected",n,s]),Promise.reject(new Error("unable to push hook event. LiveView not connected"));let r=()=>this.putRef([{el:e,loading:!0,lock:!0}],n,"hook",{payload:s,target:i});return this.pushWithReply(r,"event",{type:"hook",event:n,value:s,cid:this.closestComponentID(i)}).then(({resp:a,reply:h,ref:d})=>({reply:h,ref:d}))}extractMeta(e,i,n){let s=this.binding("value-");for(let r=0;r<e.attributes.length;r++){i||(i={});let a=e.attributes[r].name;a.startsWith(s)&&(i[a.replace(s,"")]=e.getAttribute(a))}if(e.value!==void 0&&!(e instanceof HTMLFormElement)&&(i||(i={}),i.value=e.value,e.tagName==="INPUT"&&Ds.indexOf(e.type)>=0&&!e.checked&&delete i.value),n){i||(i={});for(let r in n)i[r]=n[r]}return i}serializeForm(e,i={},n=[]){let{submitter:s}=i,r;if(s&&s.name){let T=document.createElement("input");T.type="hidden";let E=s.getAttribute("form");E&&T.setAttribute("form",E),T.name=s.name,T.value=s.value,s.parentElement.insertBefore(T,s),r=T}let a=new FormData(e),h=[];a.forEach((T,E,m)=>{T instanceof File&&h.push(E)}),h.forEach(T=>a.delete(T));let d=new URLSearchParams,{inputsUnused:p,onlyHiddenInputs:A}=Array.from(e.elements).reduce((T,E)=>{if(!g.isFormAssociated(E))return T;let{inputsUnused:m,onlyHiddenInputs:S}=T,L=E.name;if(!L)return T;m[L]===void 0&&(m[L]=!0),S[L]===void 0&&(S[L]=!0);let V=E.hasAttribute(this.binding(rs)),pe=g.private(E,Xi)||g.private(E,li)||V,M=E.type==="hidden";return m[L]=m[L]&&!pe,S[L]=S[L]&&M,T},{inputsUnused:{},onlyHiddenInputs:{}}),C=e.hasAttribute(this.binding(rs));for(let[T,E]of a.entries())if(n.length===0||n.indexOf(T)>=0){let m=p[T],S=A[T];!C&&m&&!(s&&s.name==T)&&!S&&d.append(po(T,"_unused_"),""),typeof E=="string"&&d.append(T,E)}return s&&r&&s.parentElement.removeChild(r),d.toString()}pushEvent(e,i,n,s,r,a={},h){this.pushWithReply(d=>this.putRef([{el:i,loading:!0,lock:!0}],s,e,{...a,payload:d?.payload}),"event",{type:e,event:s,value:this.extractMeta(i,r,a.value),cid:this.targetComponentID(i,n,a)}).then(({reply:d})=>h&&h(d)).catch(d=>ie("Failed to push event",d))}pushFileProgress(e,i,n,s=function(){}){this.liveSocket.withinOwners(e.form,(r,a)=>{r.pushWithReply(null,"progress",{event:e.getAttribute(r.binding(Cr)),ref:e.getAttribute(st),entry_ref:i,progress:n,cid:r.targetComponentID(e.form,a)}).then(()=>s()).catch(h=>ie("Failed to push file progress",h))})}pushInput(e,i,n,s,r,a){if(!e.form)throw new Error("form events require the input to be inside a form");let h,d=ft(n)?n:this.targetComponentID(e.form,i,r),p=m=>this.putRef([{el:e,loading:!0,lock:!0},{el:e.form,loading:!0,lock:!0}],s,"change",{...r,payload:m?.payload}),A,C=this.extractMeta(e.form,{},r.value),T={};e instanceof HTMLButtonElement&&(T.submitter=e),e.getAttribute(this.binding("change"))?A=this.serializeForm(e.form,T,[e.name]):A=this.serializeForm(e.form,T),g.isUploadInput(e)&&e.files&&e.files.length>0&&ve.trackFiles(e,Array.from(e.files)),h=ve.serializeUploads(e);let E={type:"form",event:s,value:A,meta:{_target:r._target||"undefined",...C},uploads:h,cid:d};this.pushWithReply(p,"event",E).then(({resp:m})=>{g.isUploadInput(e)&&g.isAutoUpload(e)?Tn.onUnlock(e,()=>{if(ve.filesAwaitingPreflight(e).length>0){let[S,L]=p();this.undoRefs(S,s,[e.form]),this.uploadFiles(e.form,s,i,S,d,V=>{a&&a(m),this.triggerAwaitingSubmit(e.form,s),this.undoRefs(S,s)})}}):a&&a(m)}).catch(m=>ie("Failed to push input event",m))}triggerAwaitingSubmit(e,i){let n=this.getScheduledSubmit(e);
17if(n){let[s,r,a,h]=n;this.cancelSubmit(e,i),h()}}getScheduledSubmit(e){return this.formSubmits.find(([i,n,s,r])=>i.isSameNode(e))}scheduleSubmit(e,i,n,s){if(this.getScheduledSubmit(e))return!0;this.formSubmits.push([e,i,n,s])}cancelSubmit(e,i){this.formSubmits=this.formSubmits.filter(([n,s,r,a])=>n.isSameNode(e)?(this.undoRefs(s,i),!1):!0)}disableForm(e,i,n={}){let s=m=>!(kt(m,`${this.binding(Ji)}=ignore`,m.form)||kt(m,"data-phx-update=ignore",m.form)),r=m=>m.hasAttribute(this.binding(ns)),a=m=>m.tagName=="BUTTON",h=m=>["INPUT","TEXTAREA"].includes(m.tagName),d=Array.from(e.elements),p=d.filter(r),A=d.filter(a).filter(s),C=d.filter(h).filter(s);A.forEach(m=>{m.setAttribute($t,m.disabled.toString()),m.disabled=!0}),C.forEach(m=>{m.setAttribute(kn,m.readOnly.toString()),m.readOnly=!0,m instanceof HTMLInputElement&&m.files&&(m.setAttribute($t,m.disabled.toString()),m.disabled=!0)});let T=p.concat(A).concat(C).map(m=>({el:m,loading:!0,lock:!0})),E=[{el:e,loading:!0,lock:!1},...T].reverse();return this.putRef(E,i,"submit",n)}pushFormSubmit(e,i,n,s,r,a){let h=p=>this.disableForm(e,n,{...r,form:e,payload:p?.payload,submitter:s});g.putPrivate(e,"submitter",s);let d=this.targetComponentID(e,i);if(ve.hasUploadsInProgress(e)){let[p,A]=h(),C=()=>this.pushFormSubmit(e,i,n,s,r,a);return this.scheduleSubmit(e,p,r,C)}else if(ve.inputsAwaitingPreflight(e).length>0){let[p,A]=h(),C=()=>[p,A,r];this.uploadFiles(e,n,i,p,d,T=>{if(ve.inputsAwaitingPreflight(e).length>0)return this.undoRefs(p,n);let E=this.extractMeta(e,{},r.value),m=this.serializeForm(e,{submitter:s});this.pushWithReply(C,"event",{type:"form",event:n,value:m,meta:E,cid:d}).then(({resp:S})=>a(S)).catch(S=>ie("Failed to push form submit",S))})}else if(!(e.hasAttribute(Me)&&e.classList.contains("phx-submit-loading"))){let p=this.extractMeta(e,{},r.value),A=this.serializeForm(e,{submitter:s});this.pushWithReply(h,"event",{type:"form",event:n,value:A,meta:p,cid:d}).then(({resp:C})=>a(C)).catch(C=>ie("Failed to push form submit",C))}}uploadFiles(e,i,n,s,r,a){let h=this.joinCount,d=ve.activeFileInputs(e),p=d.length;d.forEach(A=>{let C=new ve(A,this,()=>{p--,p===0&&a()}),T=C.entries().map(m=>m.toPreflightPayload());if(T.length===0){p--;return}let E={ref:A.getAttribute(st),entries:T,cid:this.targetComponentID(A.form,n)};this.log("upload",()=>["sending preflight request",E]),this.pushWithReply(null,"allow_upload",E).then(({resp:m})=>{if(this.log("upload",()=>["got preflight response",m]),C.entries().forEach(S=>{m.entries&&!m.entries[S.ref]&&this.handleFailedEntryPreflight(S.ref,"failed preflight",C)}),m.error||Object.keys(m.entries).length===0)this.undoRefs(s,i),(m.error||[]).map(([L,V])=>{this.handleFailedEntryPreflight(L,V,C)});else{let S=L=>{this.channel.onError(()=>{this.joinCount===h&&L()})};C.initAdapterUpload(m,S,this.liveSocket)}}).catch(m=>ie("Failed to push upload",m))})}handleFailedEntryPreflight(e,i,n){if(n.isAutoUpload()){let s=n.entries().find(r=>r.ref===e.toString());s&&s.cancel()}else n.entries().map(s=>s.cancel());this.log("upload",()=>[`error for entry ${e}`,i])}dispatchUploads(e,i,n){let s=this.targetCtxElement(e)||this.el,r=g.findUploadInputs(s).filter(a=>a.name===i);r.length===0?ie(`no live file inputs found matching the name "${i}"`):r.length>1?ie(`duplicate live file inputs found matching the name "${i}"`):g.dispatchEvent(r[0],Rs,{detail:{files:n}})}targetCtxElement(e){return ft(e)?g.findComponent(this.id,e):e||null}pushFormRecovery(e,i,n,s){let r=this.binding("change"),a=i.getAttribute(this.binding("target"))||i,h=i.getAttribute(this.binding(ss))||i.getAttribute(this.binding("change")),d=Array.from(e.elements).filter(C=>g.isFormAssociated(C)&&C.name&&!C.hasAttribute(r));if(d.length===0){s();return}d.forEach(C=>C.hasAttribute(st)&&ve.clearFiles(C));let p=d.find(C=>C.type!=="hidden")||d[0],A=0;this.withinTargets(a,(C,T)=>{let E=this.targetComponentID(i,T);A++;let m=new CustomEvent("phx:form-recovery",{detail:{sourceElement:e}});z.exec(m,"change",h,this,p,["push",{_target:p.name,targetView:C,targetCtx:T,newCid:E,callback:()=>{A--,A===0&&s()}}])},n)}pushLinkPatch(e,i,n,s){let r=this.liveSocket.setPendingLink(i),a=e.isTrusted&&e.type!=="popstate",h=n?()=>this.putRef([{el:n,loading:a,lock:!0}],null,"click"):null,d=()=>this.liveSocket.redirect(window.location.href,null,null),p=i.startsWith("/")?`${location.protocol}//${location.host}${i}`:i;this.pushWithReply(h,"live_patch",{url:p}).then(({resp:A})=>{this.liveSocket.requestDOMUpdate(()=>{if(A.link_redirect)this.liveSocket.replaceMain(i,null,s,r);else{if(A.redirect)return;this.liveSocket.commitPendingLink(r)&&(this.href=i),this.applyPendingUpdates(),s&&s(r)}})},({error:A,timeout:C})=>d())}getFormsForRecovery(){if(this.joinCount===0)return{};let e=this.binding("change");
17return g.all(document,`#${CSS.escape(this.id)} form[${e}], [${_t}="${CSS.escape(this.id)}"] form[${e}]`).filter(i=>i instanceof HTMLFormElement).filter(i=>i.id).filter(i=>i.elements.length>0).filter(i=>i.getAttribute(this.binding(ss))!=="ignore").map(i=>{let n=i.cloneNode(!0);_n(n,i,{onBeforeElUpdated:(r,a)=>(g.copyPrivates(r,a),r.getAttribute("form")===i.id&&r.parentNode?(r.parentNode.removeChild(r),!1):!0)});let s=document.querySelectorAll(`[form="${CSS.escape(i.id)}"]`);return Array.from(s).forEach(r=>{let a=r.cloneNode(!0);_n(a,r),g.copyPrivates(a,r),a.removeAttribute("form"),n.appendChild(a)}),n}).reduce((i,n)=>(i[n.id]=n,i),{})}maybePushComponentsDestroyed(e){let i=e.filter(s=>g.findComponent(this.id,s)===null),n=s=>{this.isDestroyed()||ie("Failed to push components destroyed",s)};i.length>0&&(i.forEach(s=>this.rendered.resetRender(s)),this.pushWithReply(null,"cids_will_destroy",{cids:i}).then(()=>{this.liveSocket.requestDOMUpdate(()=>{let s=i.filter(r=>g.findComponent(this.id,r)===null);s.length>0&&this.pushWithReply(null,"cids_destroyed",{cids:s}).then(({resp:r})=>{this.rendered.pruneCIDs(r.cids)}).catch(n)})}).catch(n))}ownsElement(e){let i=g.closestViewEl(e);return e.getAttribute(Tt)===this.id||i&&i.id===this.id||!i&&this.isDead}submitForm(e,i,n,s,r={}){g.putPrivate(e,li,!0),Array.from(e.elements).forEach(h=>g.putPrivate(h,li,!0)),this.liveSocket.blurActiveElement(),this.pushFormSubmit(e,i,n,s,r,()=>{this.liveSocket.restorePreviouslyActiveFocus()})}binding(e){return this.liveSocket.binding(e)}pushPortalElementId(e){this.portalElementIds.add(e)}dropPortalElementId(e){this.portalElementIds.delete(e)}destroyPortalElements(){this.liveSocket.unloaded||this.portalElementIds.forEach(e=>{let i=document.getElementById(e);i&&i.remove()})}};var Ns=class{constructor(t,e,i={}){if(this.unloaded=!1,!e||e.constructor.name==="Object")throw new Error(`
18      a phoenix Socket must be provided as the second argument to the LiveSocket constructor. For example:
19
20          import {Socket} from "phoenix"
21          import {LiveSocket} from "phoenix_live_view"
22          let liveSocket = new LiveSocket("/live", Socket, {...})
23      `);this.socket=new e(t,i),this.bindingPrefix=i.bindingPrefix||xr,this.params=ri(i.params||{}),this.viewLogger=i.viewLogger,this.metadataCallbacks=i.metadata||{},this.defaults=Object.assign(ji(Lr),i.defaults||{}),this.prevActive=null,this.silenced=!1,this.main=null,this.outgoingMainEl=null,this.clickStartedAtTarget=null,this.linkRef=1,this.roots={},this.href=window.location.href,this.pendingLink=null,this.currentLocation=ji(window.location),this.hooks=i.hooks||{},this.uploaders=i.uploaders||{},this.loaderTimeout=i.loaderTimeout||Tr,this.disconnectedTimeout=i.disconnectedTimeout||Pr,this.reloadWithJitterTimer=null,this.maxReloads=i.maxReloads||ur,this.reloadJitterMin=i.reloadJitterMin||fr,this.reloadJitterMax=i.reloadJitterMax||pr,this.failsafeJitter=i.failsafeJitter||mr,this.localStorage=i.localStorage||window.localStorage,this.sessionStorage=i.sessionStorage||window.sessionStorage,this.boundTopLevelEvents=!1,this.boundEventNames=new Set,this.blockPhxChangeWhileComposing=i.blockPhxChangeWhileComposing||!1,this.serverCloseRef=null,this.domCallbacks=Object.assign({jsQuerySelectorAll:null,onPatchStart:ri(),onPatchEnd:ri(),onNodeAdded:ri(),onBeforeElUpdated:ri()},i.dom||{}),this.transitions=new go,this.currentHistoryPosition=parseInt(this.sessionStorage.getItem(Mi)||"0")||0,window.addEventListener("pagehide",n=>{this.unloaded=!0}),this.socket.onOpen(()=>{this.isUnloaded()&&window.location.reload()})}version(){return"1.2.7"}isProfileEnabled(){return this.sessionStorage.getItem(pn)==="true"}isDebugEnabled(){return this.sessionStorage.getItem(Oi)==="true"}isDebugDisabled(){return this.sessionStorage.getItem(Oi)==="false"}enableDebug(){this.sessionStorage.setItem(Oi,"true")}enableProfiling(){this.sessionStorage.setItem(pn,"true")}disableDebug(){this.sessionStorage.setItem(Oi,"false")}disableProfiling(){this.sessionStorage.removeItem(pn)}enableLatencySim(t){this.enableDebug(),console.log("latency simulator enabled for the duration of this browser session. Call disableLatencySim() to disable"),this.sessionStorage.setItem(mn,t.toString())}disableLatencySim(){this.sessionStorage.removeItem(mn)}getLatencySim(){let t=this.sessionStorage.getItem(mn);return t?parseInt(t):null}getSocket(){return this.socket}connect(){window.location.hostname==="localhost"&&!this.isDebugDisabled()&&this.enableDebug();let t=()=>{this.resetReloadStatus(),this.joinRootViews()?(this.bindTopLevelEvents(),this.socket.connect()):this.main?this.socket.connect():this.bindTopLevelEvents({dead:!0}),this.joinDeadView()};["complete","loaded","interactive"].indexOf(document.readyState)>=0?t():document.addEventListener("DOMContentLoaded",()=>t())}disconnect(t){this.reloadWithJitterTimer!=null&&clearTimeout(this.reloadWithJitterTimer),this.serverCloseRef&&(this.socket.off([this.serverCloseRef]),this.serverCloseRef=null),this.socket.disconnect(t)}replaceTransport(t){this.reloadWithJitterTimer!=null&&clearTimeout(this.reloadWithJitterTimer),this.socket.replaceTransport(t),this.connect()}execJS(t,e,i=null){let n=new CustomEvent("phx:exec",{detail:{sourceElement:t}});this.owner(t,s=>z.exec(n,i,e,s,t))}js(){return Os(this,"js")}unload(){this.unloaded||(this.main&&this.isConnected()&&this.log(this.main,"socket",()=>["disconnect for page nav"]),this.unloaded=!0,this.destroyAllViews(),this.disconnect())}triggerDOM(t,e){this.domCallbacks[t](...e)}time(t,e){if(!this.isProfileEnabled()||!console.time)return e();console.time(t);let i=e();return console.timeEnd(t),i}log(t,e,i){if(this.viewLogger){let[n,s]=i();this.viewLogger(t,e,n,s)}else if(this.isDebugEnabled()){let[n,s]=i();Mr(t,e,n,s)}}requestDOMUpdate(t){this.transitions.after(t)}asyncTransition(t){this.transitions.addAsyncTransition(t)}
23transition(t,e,i=function(){}){this.transitions.addTransition(t,e,i)}onChannel(t,e,i){t.on(e,n=>{let s=this.getLatencySim();s?setTimeout(()=>i(n),s):i(n)})}reloadWithJitter(t,e){this.reloadWithJitterTimer!=null&&clearTimeout(this.reloadWithJitterTimer),this.disconnect();let i=this.reloadJitterMin,n=this.reloadJitterMax,s=Math.floor(Math.random()*(n-i+1))+i,r=Pe.updateLocal(this.localStorage,window.location.pathname,Ps,0,a=>a+1);r>=this.maxReloads&&(s=this.failsafeJitter),this.reloadWithJitterTimer=setTimeout(()=>{t.isDestroyed()||t.isConnected()||(t.destroy(),e?e():this.log(t,"join",()=>[`encountered ${r} consecutive reloads`]),r>=this.maxReloads&&this.log(t,"join",()=>[`exceeded ${this.maxReloads} consecutive reloads. Entering failsafe mode`]),this.pendingLink!==null?window.location.href=this.pendingLink:window.location.reload())},s)}getHookDefinition(t){if(t)return this.maybeInternalHook(t)||this.hooks[t]||this.maybeRuntimeHook(t)}maybeInternalHook(t){return t&&t.startsWith("Phoenix.")&&zr[t.split(".")[1]]}maybeRuntimeHook(t){let e=document.querySelector(`script[${Bi}="${CSS.escape(t)}"]`);if(!e)return;let i=window[`phx_hook_${t}`];if(!i||typeof i!="function"){ie("a runtime hook must be a function",e);return}let n=i();if(n&&(typeof n=="object"||typeof n=="function"))return n;ie("runtime hook must return an object with hook callbacks or an instance of ViewHook",e)}isUnloaded(){return this.unloaded}isConnected(){return this.socket.isConnected()}getBindingPrefix(){return this.bindingPrefix}binding(t){return`${this.getBindingPrefix()}${t}`}channel(t,e){return this.socket.channel(t,e)}joinDeadView(){let t=document.body;if(t&&!this.isPhxView(t)&&!this.isPhxView(document.firstElementChild)){let e=this.newRootView(t);e.setHref(this.getHref()),e.joinDead(),this.main||(this.main=e),window.requestAnimationFrame(()=>{e.execNewMounted(),this.maybeScroll(history.state?.scroll)})}}joinRootViews(){let t=!1;return g.all(document,`${hi}:not([${Tt}])`,e=>{if(!this.getRootById(e.id)){let i=this.newRootView(e);g.isPhxSticky(e)||i.setHref(this.getHref()),i.join(),e.hasAttribute(xn)&&(this.main=i)}t=!0}),t}redirect(t,e,i){i&&Pe.setCookie(as,i,60),this.unload(),Pe.redirect(t,e)}replaceMain(t,e,i=null,n=this.setPendingLink(t)){if(!this.main)return;let s=this.currentLocation.href;this.outgoingMainEl=this.outgoingMainEl||this.main.el;let r=g.findPhxSticky(document)||[],a=g.all(this.outgoingMainEl,`[${this.binding("remove")}]`).filter(p=>!g.isChildOfAny(p,r)),h=g.cloneNode(this.outgoingMainEl,""),d=this.main;d.showLoader(this.loaderTimeout),d.destroy(),this.main=this.newRootView(h,e,s),this.main.setRedirect(t),this.transitionRemoves(a,d),this.main.join((p,A)=>{p===1&&this.commitPendingLink(n)&&this.requestDOMUpdate(()=>{a.forEach(C=>C.remove()),r.forEach(C=>h.appendChild(C)),this.outgoingMainEl.replaceWith(h),this.outgoingMainEl=null,i&&i(n),A()})})}transitionRemoves(t,e,i){let n=this.binding("remove"),s=r=>{r.preventDefault(),r.stopImmediatePropagation()};t.forEach(r=>{for(let h of this.boundEventNames)r.addEventListener(h,s,!0);let a=new CustomEvent("phx:exec",{detail:{sourceElement:r}});z.exec(a,"remove",r.getAttribute(n),e,r)}),this.requestDOMUpdate(()=>{t.forEach(r=>{for(let a of this.boundEventNames)r.removeEventListener(a,s,!0)}),i&&i()})}isPhxView(t){return t.getAttribute&&t.getAttribute(Ye)!==null}newRootView(t,e,i){let n=new mo(t,this,null,e,i);return this.roots[n.id]=n,n}owner(t,e){let i,n=g.closestViewEl(t);if(n)i=g.private(n,"view");else{if(!t.isConnected)return null;i=this.main}return i&&e?e(i):i}withinOwners(t,e){this.owner(t,i=>e(i,t))}getViewByEl(t){let e=t.getAttribute(nt);return Ut(this.getRootById(e),i=>i.getDescendentByEl(t))}getRootById(t){return this.roots[t]}destroyAllViews(){for(let t in this.roots)this.roots[t].destroy(),delete this.roots[t];this.main=null}destroyViewByEl(t){let e=this.getRootById(t.getAttribute(nt));e&&e.id===t.id?(e.destroy(),delete this.roots[e.id]):e&&e.destroyDescendent(t.id)}getActiveElement(){return document.activeElement}dropActiveElement(t){this.prevActive&&t.ownsElement(this.prevActive)&&(this.prevActive=null)}restorePreviouslyActiveFocus(){this.prevActive&&this.prevActive!==document.body&&this.prevActive instanceof HTMLElement&&this.prevActive.focus()}blurActiveElement(){this.prevActive=this.getActiveElement(),this.prevActive!==document.body&&this.prevActive instanceof HTMLElement&&this.prevActive.blur()}bindTopLevelEvents({dead:t}={}){this.boundTopLevelEvents||(this.boundTopLevelEvents=!0,this.serverCloseRef=this.socket.onClose(e=>{if(e&&e.code===1e3&&this.main)return this.reloadWithJitter(this.main)}),document.body.addEventListener("click",function(){}),window.addEventListener("pageshow",e=>{e.persisted&&(this.getSocket().disconnect(),this.withPageLoading({to:window.location.href,kind:"redirect"}),window.location.reload())},!0),t||this.bindNav(),this.bindClicks(),t||this.bindForms(),this.bind({keyup:"keyup",keydown:"keydown"},(e,i,n,s,r,a)=>{let h=s.getAttribute(this.binding(kr)),d=e.key&&e.key.toLowerCase();if(h&&h.toLowerCase()!==d)return;let p={key:e.key,...this.eventMeta(i,e,s)};z.exec(e,i,r,n,s,["push",{data:p}])}
23),this.bind({blur:"focusout",focus:"focusin"},(e,i,n,s,r,a)=>{if(!a){let h={...this.eventMeta(i,e,s)};z.exec(e,i,r,n,s,["push",{data:h}])}}),this.bind({blur:"blur",focus:"focus"},(e,i,n,s,r,a)=>{if(a==="window"){let h=this.eventMeta(i,e,s);z.exec(e,i,r,n,s,["push",{data:h}])}}),this.on("dragover",e=>e.preventDefault()),this.on("dragenter",e=>{let i=e.target&&g.elementFromTarget(e.target);if(!i)return;let n=kt(i,this.binding(Ii));!n||!(n instanceof HTMLElement)||Fr(e)&&this.js().addClass(n,un)}),this.on("dragleave",e=>{let i=e.target&&g.elementFromTarget(e.target);if(!i)return;let n=kt(i,this.binding(Ii));if(!n||!(n instanceof HTMLElement))return;let s=n.getBoundingClientRect();(e.clientX<=s.left||e.clientX>=s.right||e.clientY<=s.top||e.clientY>=s.bottom)&&this.js().removeClass(n,un)}),this.on("drop",e=>{let i=e.target&&g.elementFromTarget(e.target);if(!i)return;e.preventDefault();let n=kt(i,this.binding(Ii));if(!n||!(n instanceof HTMLElement)||(this.js().removeClass(n,un),!e.dataTransfer))return;let s=n.getAttribute(this.binding(Ii)),r=s&&document.getElementById(s),a=Array.from(e.dataTransfer.files||[]);!r||!(r instanceof HTMLInputElement)||r.disabled||a.length===0||!(r.files instanceof FileList)||(ve.trackFiles(r,a,e.dataTransfer),r.dispatchEvent(new Event("input",{bubbles:!0})))}),this.on(Rs,e=>{let i=e.target&&g.elementFromTarget(e.target);if(!g.isUploadInput(i))return;let n=Array.from(e.detail.files||[]).filter(s=>s instanceof File||s instanceof Blob);ve.trackFiles(i,n),i.dispatchEvent(new Event("input",{bubbles:!0}))}))}eventMeta(t,e,i){let n=this.metadataCallbacks[t];return n?n(e,i):{}}setPendingLink(t){return this.linkRef++,this.pendingLink=t,this.resetReloadStatus(),this.linkRef}resetReloadStatus(){Pe.deleteCookie(as)}commitPendingLink(t){return this.linkRef!==t?!1:(this.pendingLink!==null&&(this.href=this.pendingLink,this.pendingLink=null),!0)}getHref(){return this.href}hasPendingLink(){return!!this.pendingLink}bind(t,e){for(let i in t){let n=t[i];this.on(n,s=>{let r=this.binding(i),a=this.binding(`window-${i}`),h=s.target instanceof Element&&s.target.getAttribute(r);s.target instanceof Element&&(h?this.debounce(s.target,s,n,()=>{this.withinOwners(s.target,d=>{e(s,i,d,s.target,h,null)})}):g.all(document,`[${a}]`,d=>{let p=d.getAttribute(a);this.debounce(d,s,n,()=>{this.withinOwners(d,A=>{e(s,i,A,d,p,"window")})})}))})}}bindClicks(){this.on("mousedown",t=>this.clickStartedAtTarget=t.target),this.bindClick()}bindClick(){let t=this.binding("click");window.addEventListener("click",e=>{let i=e.target&&g.elementFromTarget(e.target);if(!i)return;e.detail===0&&(this.clickStartedAtTarget=i);let n=this.clickStartedAtTarget||i;if(i=kt(i,t),this.dispatchClickAway(e,n),this.clickStartedAtTarget=null,!i)return;let s=i.getAttribute(t);if(!s){g.isNewPageClick(e,window.location)&&this.unload();return}i.getAttribute("href")==="#"&&e.preventDefault(),!i.hasAttribute(Me)&&this.debounce(i,e,"click",()=>{this.withinOwners(i,r=>{z.exec(e,"click",s,r,i,["push",{data:this.eventMeta("click",e,i)}])})})},!1)}dispatchClickAway(t,e){let i=this.binding("click-away"),n=e.closest(`[${pt}]`),s=n&&g.byId(n.getAttribute(pt));g.all(document,`[${i}]`,r=>{let a=e;n&&!n.contains(r)&&(a=s),r.isSameNode(a)||r.contains(a)||!z.isVisible(e)||this.withinOwners(r,h=>{let d=r.getAttribute(i);z.isVisible(r)&&z.isInViewport(r)&&z.exec(t,"click",d,h,r,["push",{data:this.eventMeta("click",t,t.target)}])})})}bindNav(){if(!Pe.canPushState())return;history.scrollRestoration&&(history.scrollRestoration="manual");let t=null;window.addEventListener("scroll",e=>{t!=null&&clearTimeout(t),t=setTimeout(()=>{Pe.updateCurrentState(i=>Object.assign(i,{scroll:window.scrollY}))},100)}),window.addEventListener("popstate",e=>{if(!this.registerNewLocation(window.location))return;let{type:i,backType:n,id:s,scroll:r,position:a}=e.state||{},h=window.location.href,d=a>this.currentHistoryPosition,p=d?i:n||i;this.currentHistoryPosition=a||0,this.sessionStorage.setItem(Mi,this.currentHistoryPosition.toString()),g.dispatchEvent(window,"phx:navigate",{detail:{href:h,patch:p==="patch",pop:!0,direction:d?"forward":"backward"}}),this.requestDOMUpdate(()=>{let A=()=>{this.maybeScroll(r)};this.main&&this.main.isConnected()&&p==="patch"&&s===this.main.id?this.main.pushLinkPatch(e,h,null,A):this.replaceMain(h,null,A)})},!1),window.addEventListener("click",e=>{let i=e.target&&g.elementFromTarget(e.target);if(!i)return;
23let n=kt(i,fn),s=n&&n.getAttribute(fn);if(!s||!this.isConnected()||!this.main||g.wantsNewTab(e))return;let r=n.href instanceof SVGAnimatedString?n.href.baseVal:n.href,a=n.getAttribute(Qn);if(a!=="replace"&&a!=="push")throw new Error(`expected ${Qn} to be "replace" or "push", got: ${a}`);e.preventDefault(),e.stopImmediatePropagation(),this.pendingLink!==r&&this.requestDOMUpdate(()=>{if(s==="patch")this.pushHistoryPatch(e,r,a,n);else if(s==="redirect")this.historyRedirect(e,r,a,null,n);else throw new Error(`expected ${fn} to be "patch" or "redirect", got: ${s}`);let h=n.getAttribute(this.binding("click"));h&&this.requestDOMUpdate(()=>this.execJS(n,h,"click"))})},!1)}maybeScroll(t){typeof t=="number"&&requestAnimationFrame(()=>{window.scrollTo(0,t)})}dispatchEvent(t,e={}){g.dispatchEvent(window,`phx:${t}`,{detail:e})}dispatchEvents(t){t.forEach(([e,i])=>this.dispatchEvent(e,i))}withPageLoading(t,e){g.dispatchEvent(window,"phx:page-loading-start",{detail:t});let i=()=>g.dispatchEvent(window,"phx:page-loading-stop",{detail:t});return e?e(i):i}pushHistoryPatch(t,e,i,n){if(!this.isConnected()||!(this.main&&this.main.isMain()))return Pe.redirect(e);this.withPageLoading({to:e,kind:"patch"},s=>{this.main.pushLinkPatch(t,e,n,r=>{this.historyPatch(e,i,r),s()})})}historyPatch(t,e,i=this.setPendingLink(t)){this.commitPendingLink(i)&&(this.currentHistoryPosition++,this.sessionStorage.setItem(Mi,this.currentHistoryPosition.toString()),Pe.updateCurrentState(n=>({...n,backType:"patch"})),Pe.pushState(e,{type:"patch",id:this.main.id,position:this.currentHistoryPosition},t),g.dispatchEvent(window,"phx:navigate",{detail:{patch:!0,href:t,pop:!1,direction:"forward"}}),this.registerNewLocation(window.location))}historyRedirect(t,e,i,n,s){let r=s&&t.isTrusted&&t.type!=="popstate";if(r&&s.classList.add("phx-click-loading"),!this.isConnected()||!(this.main&&this.main.isMain()))return Pe.redirect(e,n);if(/^\/$|^\/[^\/]+.*$/.test(e)){let{protocol:h,host:d}=window.location;e=`${h}//${d}${e}`}let a=window.scrollY;this.withPageLoading({to:e,kind:"redirect"},h=>{this.replaceMain(e,n,d=>{d===this.linkRef&&(this.currentHistoryPosition++,this.sessionStorage.setItem(Mi,this.currentHistoryPosition.toString()),Pe.updateCurrentState(p=>({...p,backType:"redirect"})),Pe.pushState(i,{type:"redirect",id:this.main.id,scroll:a,position:this.currentHistoryPosition},e),g.dispatchEvent(window,"phx:navigate",{detail:{href:e,patch:!1,pop:!1,direction:"forward"}}),this.registerNewLocation(window.location)),r&&s.classList.remove("phx-click-loading"),h()})})}registerNewLocation(t){let{pathname:e,search:i}=this.currentLocation;return e+i===t.pathname+t.search?!1:(this.currentLocation=ji(t),!0)}bindForms(){let t=0,e=!1;this.on("submit",i=>{if(!(i.target instanceof HTMLFormElement))return;let n=i.target.getAttribute(this.binding("submit")),s=i.target.getAttribute(this.binding("change"));!e&&s&&!n&&(e=!0,i.preventDefault(),this.withinOwners(i.target,r=>{r.disableForm(i.target),window.requestAnimationFrame(()=>{g.isUnloadableFormSubmit(i)&&this.unload(),i.target.submit()})}))}),this.on("submit",i=>{if(!(i.target instanceof HTMLFormElement))return;let n=i.target.getAttribute(this.binding("submit"));if(!n){g.isUnloadableFormSubmit(i)&&this.unload();return}i.preventDefault(),i.target.disabled=!0,this.withinOwners(i.target,s=>{z.exec(i,"submit",n,s,i.target,["push",{submitter:i.submitter}])})});for(let i of["change","input"])this.on(i,n=>{if(!g.isFormAssociated(n.target))return;if(n instanceof CustomEvent&&n.target.form===void 0){if(n.detail&&n.detail.dispatcher)throw new Error(`dispatching a custom ${i} event is only supported on input elements inside a form`);return}let s=n.target,r=this.binding("change");if(this.blockPhxChangeWhileComposing&&n instanceof InputEvent&&n.isComposing){let E=`composition-listener-${i}`;g.private(s,E)||(g.putPrivate(s,E,!0),s.addEventListener("compositionend",()=>{s.dispatchEvent(new Event(i,{bubbles:!0})),g.deletePrivate(s,E)},{once:!0}));return}let a=s.getAttribute(r),h=s.form&&s.form.getAttribute(r),d=a||h;if(!d||s.type==="number"&&s.validity&&s.validity.badInput)return;let p=a?s:s.form,A=t;t++;let{at:C,type:T}=g.private(s,"prev-iteration")||{};C===A-1&&i==="change"&&T==="input"||(g.putPrivate(s,"prev-iteration",{at:A,type:i}),this.debounce(s,n,i,()=>{this.withinOwners(p,E=>{g.putPrivate(s,Xi,!0),z.exec(n,"change",d,E,s,["push",{_target:s.name,dispatcher:p}])})}))});this.on("reset",i=>{let n=i.target;g.resetForm(n);let s=Array.from(n.elements).find(r=>
23"type"in r&&r.type==="reset");s&&window.requestAnimationFrame(()=>{s.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!1}))})})}debounce(t,e,i,n){if(i==="blur"||i==="focusout")return n();let s=this.binding(Er),r=this.binding(Ar),a=this.defaults.debounce.toString(),h=this.defaults.throttle.toString();this.withinOwners(t,d=>{let p=()=>!d.isDestroyed()&&document.body.contains(t);g.debounce(t,e,s,a,r,h,p,()=>{n()})})}silenceEvents(t){this.silenced=!0,t(),this.silenced=!1}on(t,e){this.boundEventNames.add(t),window.addEventListener(t,i=>{this.silenced||e(i)})}jsQuerySelectorAll(t,e,i){let n=this.domCallbacks.jsQuerySelectorAll;return n?n(t,e,i):i()}},go=class{constructor(){this.transitions=new Set,this.promises=new Set,this.pendingOps=[]}reset(){this.transitions.forEach(t=>{clearTimeout(t),this.transitions.delete(t)}),this.promises.clear(),this.flushPendingOps()}after(t){this.size()===0?t():this.pushPendingOp(t)}addTransition(t,e,i){e();let n=setTimeout(()=>{this.transitions.delete(n),i(),this.flushPendingOps()},t);this.transitions.add(n)}addAsyncTransition(t){this.promises.add(t),t.then(()=>{this.promises.delete(t),this.flushPendingOps()})}pushPendingOp(t){this.pendingOps.push(t)}size(){return this.transitions.size+this.promises.size}flushPendingOps(){if(this.size()>0)return;let t=this.pendingOps.shift();t&&(t(),this.flushPendingOps())}};var Fs={};var zi=Kn(Us()),Mn=Kn(Bs());document.addEventListener("DOMContentLoaded",()=>{let t=document.getElementById("site-menu"),e=document.getElementById("menu-toggle"),i=document.getElementById("close-menu"),n=document.getElementById("menu-backdrop");if(!t)return;n||(n=document.createElement("div"),n.id="menu-backdrop",document.body.appendChild(n)),requestAnimationFrame(()=>{t.classList.add("ready")});let s=h=>{h.preventDefault(),t.classList.add("opened"),n.classList.add("visible"),document.body.style.overflow="hidden"},r=h=>{h.preventDefault(),t.classList.remove("opened"),n.classList.remove("visible"),document.body.style.overflow=""};e&&e.addEventListener("click",s),i&&i.addEventListener("click",r),n&&n.addEventListener("click",r),document.addEventListener("keydown",h=>{h.key==="Escape"&&t.classList.contains("opened")&&(t.classList.remove("opened"),n.classList.remove("visible"),document.body.style.overflow="")}),t.querySelectorAll("ul a").forEach(h=>{h.addEventListener("click",()=>{t.classList.remove("opened"),n.classList.remove("visible"),document.body.style.overflow=""})})});document.addEventListener("DOMContentLoaded",()=>{let t=document.getElementById("user-menu"),e=document.getElementById("user-toggle"),i=document.getElementById("close-user-menu"),n=document.getElementById("user-menu-backdrop");if(!t)return;n||(n=document.createElement("div"),n.id="user-menu-backdrop",document.body.appendChild(n)),requestAnimationFrame(()=>{t.classList.add("ready")});let s=h=>{h.preventDefault(),t.classList.add("opened"),n.classList.add("visible"),document.body.style.overflow="hidden"},r=h=>{h.preventDefault(),t.classList.remove("opened"),n.classList.remove("visible"),document.body.style.overflow=""};e&&e.addEventListener("click",s),i&&i.addEventListener("click",r),n&&n.addEventListener("click",r),document.addEventListener("keydown",h=>{h.key==="Escape"&&t.classList.contains("opened")&&(t.classList.remove("opened"),n.classList.remove("visible"),document.body.style.overflow="")});let a=()=>{window.location.hash==="#user-menu"?(t.classList.add("opened"),n.classList.add("visible"),document.body.style.overflow="hidden"):window.location.hash==="#close-user-menu"&&(t.classList.remove("opened"),n.classList.remove("visible"),document.body.style.overflow="",history.replaceState(null,null," "))};a(),window.addEventListener("hashchange",a)});function js(){let e=new URLSearchParams(window.location.search).get("from_date");if(e){let i=encodeURIComponent(e);document.querySelectorAll('img[src="/cover"]').forEach(r=>{r.src=`/cover?from_date=${i}`}),document.querySelectorAll('a[href="/latest"], a[href="/latest/"]').forEach(r=>{r.href=`/latest?from_date=${i}`})}}document.addEventListener("DOMContentLoaded",js);window.addEventListener("phx:page-loading-stop",js);var Xs={mounted(){this.toggleSidebar=()=>{let t=document.querySelector(".main-nav"),e=document.querySelector(".sidebar-overlay");t&&e&&(t.classList.toggle("mobile-open"),e.classList.toggle("show"))},this.el.addEventListener("click",this.toggleSidebar)},destroyed(){this.toggleSidebar&&this.el.removeEventListener("click",this.toggleSidebar)}};window.Sortable=Mn.default;var vo={SidebarToggle:Xs,Sortable:{mounted(){new Mn.default(this.el,{animation:150,delay:100,handle:"[data-handle]",dragClass:"drag-item",ghostClass:"drag-ghost",forceFallback:!0,onEnd:t=>{this.pushEventTo(this.el,"reorder",{old:t.oldIndex,new:t.newIndex})}})}},CollectionSort:{mounted(){let t=this.el.dataset.rearrange==="true";this.sortable=new window.Sortable(this.el,{group:"collections",animation:150,ghostClass:"opacity-50",dragClass:"shadow-xl",forceFallback:!1,fallbackOnBody:!0,swapThreshold:.65,disabled:!t,onEnd:e=>{let i=e.item.dataset.id,n=e.from.dataset.group,s=e.to.dataset.group,r=e.newIndex,a=Array.from(e.to.children).map(h=>({id:parseInt(h.dataset.id),active:h.dataset.active==="true"}));this.pushEvent("reorder_collections",{item_id:parseInt(i),from_group:n,to_group:s,new_index:r,items:a})}})},updated(){let t=this.el.dataset.rearrange==="true";
23this.sortable&&this.sortable.option("disabled",!t)},destroyed(){this.sortable&&this.sortable.destroy()}},ArticleForm:{mounted(){this.handleEvent("populate-article-data",t=>{let e=this.el.id.includes("giant")?"giant":"readmore",i=document.getElementById(`field-url-${e}`),n=document.getElementById(`field-title-${e}`),s=document.getElementById(`field-author-${e}`),r=document.getElementById(`field-interviewee-${e}`),a=document.getElementById(`field-abstract-${e}`),h=document.getElementById(`field-photo-${e}`),d=document.getElementById(`field-collection-${e}`);if(i&&(i.value=t.url||""),n&&(n.value=t.title||""),s&&(s.value=t.author||""),r&&(r.value=t.interviewee||""),a&&(a.value=t.abstract||""),h){h.value=t.photo||"";let p=new Event("input",{bubbles:!0});h.dispatchEvent(p)}})}},ListItemSort:{mounted(){this.sortable=new window.Sortable(this.el,{animation:150,handle:"[data-handle]",ghostClass:"opacity-50",dragClass:"shadow-xl",onEnd:t=>{this.updateFieldNames()}})},updateFieldNames(){Array.from(this.el.children).forEach((e,i)=>{if(e.classList.contains("border-dashed"))return;e.setAttribute("data-item-index",i);let n=e.querySelector(".text-xs.font-medium.text-gray-500");n&&(n.textContent=`Item ${i+1}`),e.querySelectorAll('input[name^="item_"]').forEach(r=>{let a=r.name.split("_").pop();r.name=`item_${i}_${a}`})})},destroyed(){this.sortable&&this.sortable.destroy()}},FeatureSort:{mounted(){let t=this.el.dataset.rearrange==="true";this.sortable=new window.Sortable(this.el,{animation:150,ghostClass:"opacity-50",dragClass:"shadow-xl",disabled:!t,forceFallback:!0,fallbackOnBody:!0,swapThreshold:.65,onEnd:e=>{let i=e.item.dataset.featureId,n=Array.from(this.el.children).map((s,r)=>({id:parseInt(s.dataset.featureId),position:r}));this.pushEvent("reorder_features",{feature_id:parseInt(i),features:n})}})},updated(){let t=this.el.dataset.rearrange==="true";this.sortable&&this.sortable.option("disabled",!t)},destroyed(){this.sortable&&this.sortable.destroy()}},RelatedArticleSort:{mounted(){this.sortable=new window.Sortable(this.el,{animation:150,handle:"[data-handle]",ghostClass:"opacity-50",dragClass:"shadow-xl",onEnd:t=>{let e=Array.from(this.el.children).map((i,n)=>({id:parseInt(i.dataset.linkId),position:n}));this.pushEvent("reorder_related_articles",{items:e})}})},destroyed(){this.sortable&&this.sortable.destroy()}},ContributorSort:{mounted(){this.sortable=new window.Sortable(this.el,{animation:150,handle:"[data-handle]",ghostClass:"opacity-50",dragClass:"shadow-xl",onEnd:t=>{let e=Array.from(this.el.children).map((i,n)=>({id:parseInt(i.dataset.contributorId),position:n}));this.pushEvent("reorder_contributors",{items:e})}})},destroyed(){this.sortable&&this.sortable.destroy()}},ImagePreview:{mounted(){this.el.addEventListener("input",t=>{let e=t.target.value,i=this.el.dataset.previewTarget,n=document.getElementById(i);if(n&&e){let s=n.tagName==="IMG"?n:n.querySelector("img");s&&(s.src=e,n.tagName!=="IMG"&&n.classList.remove("hidden"))}else n&&n.tagName!=="IMG"&&n.classList.add("hidden")})}},IframeResizer:{mounted(){let t=this.el.previousElementSibling,e=this.el.nextElementSibling,i=0,n=0,s=r=>{let a=document.querySelectorAll('[phx-hook="ResizePreview"]'),h;r<579?h="resize-mobile":r<1104?h="resize-tablet":h="resize-desktop",a.forEach(p=>{p.classList.remove("bg-indigo-600","text-white","hover:bg-indigo-700"),p.classList.add("bg-white","text-gray-700","hover:bg-gray-50")});let d=document.getElementById(h);d&&(d.classList.remove("bg-white","text-gray-700","hover:bg-gray-50"),d.classList.add("bg-indigo-600","text-white","hover:bg-indigo-700"))};this.mouseDownHandler=r=>{i=r.clientX,n=t.getBoundingClientRect().width,document.addEventListener("mousemove",this.mouseMoveHandler),document.addEventListener("mouseup",this.mouseUpHandler)},this.mouseMoveHandler=r=>{let a=r.clientX-i,h=(n+a)*100/this.el.parentNode.getBoundingClientRect().width;t.style.width=`${h}%`,this.el.style.cursor="col-resize",document.body.style.cursor="col-resize",t.style.userSelect="none",t.style.pointerEvents="none",e.style.userSelect="none",e.style.pointerEvents="none"},this.mouseUpHandler=()=>{this.el.style.removeProperty("cursor"),document.body.style.removeProperty("cursor"),t.style.removeProperty("user-select"),t.style.removeProperty("pointer-events"),e.style.removeProperty("user-select"),e.style.removeProperty("pointer-events"),document.removeEventListener("mousemove",this.mouseMoveHandler),document.removeEventListener("mouseup",this.mouseUpHandler);let r=t.getBoundingClientRect().width;s(r)},this.el.addEventListener("mousedown",this.mouseDownHandler)},destroyed(){this.mouseDownHandler&&this.el.removeEventListener("mousedown",this.mouseDownHandler)}},ColorPicker:{mounted(){let t=this.el.dataset.target,e=document.getElementById(t);this.el.addEventListener("input",()=>{if(e){e.value=this.el.value;let i=new Event("input",{bubbles:!0});e.dispatchEvent(i)}}),e&&e.addEventListener("input",()=>{e.value.match(/^#[0-9A-Fa-f]{6}$/)&&(this.el.value=e.value)})}},ResizePreview:{mounted(){if(this.el.dataset.default==="true"){let t=parseInt(this.el.dataset.width),e=document.getElementById("preview-frame");e&&(e.style.width=`${t}px`)}this.el.addEventListener("click",()=>{let t=parseInt(this.el.dataset.width),e=document.getElementById("preview-frame");e&&(e.style.width=`${t}px`),document.querySelectorAll('[phx-hook="ResizePreview"]').forEach(i=>
23{i.classList.remove("bg-indigo-600","text-white","hover:bg-indigo-700"),i.classList.add("bg-white","text-gray-700","hover:bg-gray-50")}),this.el.classList.remove("bg-white","text-gray-700","hover:bg-gray-50"),this.el.classList.add("bg-indigo-600","text-white","hover:bg-indigo-700")})}}},bo=document.querySelector("meta[name='csrf-token']").getAttribute("content"),Vs=new Ns("/live",Yn,{longPollFallbackMs:2500,params:{_csrf_token:bo},hooks:{...Fs,...vo}});zi.default.config({barColors:{0:"#29d"},shadowColor:"rgba(0, 0, 0, .3)"});window.addEventListener("phx:page-loading-start",t=>zi.default.show(300));window.addEventListener("phx:page-loading-stop",t=>{zi.default.hide(),window.fathom&&window.fathom.trackPageview()});window.addEventListener("phx:copy",t=>{let e=t.detail.text;navigator.clipboard&&navigator.clipboard.writeText(e).then(()=>{let i=t.target,n=i.textContent;i.textContent="Gekopieerd!",setTimeout(()=>{i.textContent=n},1500)})});document.addEventListener("dragover",t=>{t.target.matches("textarea, input[type=text], [contenteditable=true]")&&t.stopImmediatePropagation()},!0);document.addEventListener("drop",t=>{t.target.matches("textarea, input[type=text], [contenteditable=true]")&&t.stopImmediatePropagation()},!0);Vs.connect();window.liveSocket=Vs;window.addEventListener("phx:scroll-top",()=>{(document.querySelector("main.overflow-auto")||document.scrollingElement)?.scrollTo(0,0)});document.addEventListener("click",t=>{t.target.closest("#logo-container")&&window.location.pathname==="/"&&(t.preventDefault(),window.scrollTo({top:0,behavior:"smooth"}))});document.addEventListener("click",t=>{t.target.closest("a[data-from-homepage]")&&window.history.replaceState({...window.history.state,scroll:0},"",window.location.href)});var qi=document.querySelector("body > header"),yo=60,wo=20;qi&&window.addEventListener("scroll",()=>{let t=window.pageYOffset||document.documentElement.scrollTop,e=qi.classList.contains("scrolled");!e&&t>yo?qi.classList.add("scrolled"):e&&t<wo&&qi.classList.remove("scrolled")},{passive:!0});})();
24/**
25 * @license MIT
26 * topbar 3.0.0
27 * http://buunguyen.github.io/topbar
28 * Copyright (c) 2024 Buu Nguyen
29 */
30/*! Sortable 1.15.2 - MIT | git://github.com/SortableJS/Sortable.git */

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.