1import{a as Pr}from"./chunk-YN7MYJVN.js";import{a as Cr,b as Tr,c as Ar,d as Lr,e as _r,f as Ir}from"./chunk-TN6EREC2.js";import{a as Xn,c as td}from"./chunk-5TBO732O.js";var ql=Xn(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.regionAPIs=void 0;Mn.regionAPIs=new Map([["us","https://api-iam.intercom.io"],["eu","https://api-iam.eu.intercom.io"],["ap","https://api-iam.au.intercom.io"]])});var Vl=Xn(pt=>{"use strict";var Mp=pt&&pt.__awaiter||function(e,t,i,n){function s(r){return r instanceof i?r:new i(function(o){o(r)})}return new(i||(i=Promise))(function(r,o){function a(c){try{d(n.next(c))}catch(u){o(u)}}function l(c){try{d(n.throw(c))}catch(u){o(u)}}function d(c){c.done?r(c.value):s(c.value).then(a,l)}d((n=n.apply(e,t||[])).next())})};Object.defineProperty(pt,"__esModule",{value:!0});pt.ref=pt.init=void 0;var jl="_intercom_npm_loader",Fi=function(){Fi.loaderQueue(arguments)};Fi.q=[];Fi.loaderQueue=function(e){Fi.q.push(e)};var Dn=function(e){var t,i,n=document;if(!n.getElementById(jl)){var s=n.createElement("script");s.type="text/javascript",s.async=!0,s.id=jl,s.src=e||"https://widget.intercom.io/widget/"+((t=window.intercomSettings)===null||t===void 0?void 0:t.app_id);var r=n.getElementsByTagName("script")[0];(i=r.parentNode)===null||i===void 0||i.insertBefore(s,r)}},Ul=()=>document.readyState==="complete"||document.readyState==="interactive",Dp=(...e)=>Mp(void 0,[...e],void 0,function*(t={}){var i=window,n=i.Intercom;i.intercomSettings&&(i.intercomSettings.installation_type="npm-package"),typeof n=="function"?(n("reattach_activator"),n("update",i.intercomSettings)):(i.Intercom=Fi,Ul()?Dn(t.widgetUrl):(document.addEventListener("readystatechange",function(){Ul()&&Dn(t.widgetUrl)}),i.attachEvent?i.attachEvent("onload",()=>Dn(t.widgetUrl)):i.addEventListener("load",()=>Dn(t.widgetUrl),!1)))});pt.init=Dp;pt.ref=void 0});var zl=Xn(I=>{"use strict";var Hp=I&&I.__rest||function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(i[n[s]]=e[n[s]]);return i};Object.defineProperty(I,"__esModule",{value:!0});I.startConversation=I.hideNotifications=I.onUserEmailSupplied=I.showConversation=I.showTicket=I.startChecklist=I.startSurvey=I.showNews=I.showArticle=I.startTour=I.whoami=I.getVisitorId=I.trackEvent=I.onUnreadCountChange=I.onShow=I.onHide=I.showNewMessage=I.showMessages=I.showSpace=I.show=I.hide=I.update=I.shutdown=I.boot=I.Intercom=void 0;var $p=ql(),Wl=Vl(),X=(e,...t)=>{if(typeof window!==void 0&&window.Intercom)return window.Intercom(e,...t);console.warn("Please ensure Intercom is setup and running on client-side!")},Np=e=>{if(typeof e!="object"){console.warn("Intercom initialiser called with invalid parameters.");return}let{region:t="us",widgetUrl:i}=e,n=Hp(e,["region","widgetUrl"]);typeof window<"u"&&!Wl.ref&&(window.intercomSettings=Object.assign(Object.assign({},n),{api_base:$p.regionAPIs.get(t)}),(0,Wl.init)({widgetUrl:i}))};I.Intercom=Np;I.default=I.Intercom;var Fp=e=>X("boot",e);I.boot=Fp;var Bp=()=>X("shutdown");I.shutdown=Bp;var qp=e=>X("update",e);I.update=qp;var jp=()=>X("hide");I.hide=jp;var Up=()=>X("show");I.show=Up;var Vp=e=>X("showSpace",e);I.showSpace=Vp;var Wp=()=>X("showMessages");I.showMessages=Wp;var zp=e=>X("showNewMessage",e);I.showNewMessage=zp;var Jp=e=>X("onHide",e);I.onHide=Jp;var Xp=e=>X("onShow",e);I.onShow=Xp;var Kp=e=>X("onUnreadCountChange",e);I.onUnreadCountChange=Kp;var Gp=(...e)=>X("trackEvent",...e);I.trackEvent=Gp;var Yp=()=>X("getVisitorId");I.getVisitorId=Yp;var Qp=()=>X("whoami");I.whoami=Qp;var Zp=e=>X("startTour",e);I.startTour=Zp;var ef=e=>X("showArticle",e);I.showArticle=ef;var tf=e=>X("showNews",e);I.showNews=tf;var nf=e=>X("startSurvey",e);I.startSurvey=nf;var sf=e=>X("startChecklist",e);I.startChecklist=sf;var rf=e=>X("showTicket",e);I.showTicket=rf;var of=e=>X("showConversation",e);I.showConversation=of;var af=e=>X("onUserEmailSupplied",e);I.onUserEmailSupplied=af;var lf=e=>X("hideNotifications",e);I.hideNotifications=lf;var cf=e=>X("startConversation",e);I.startConversation=cf});(function(){var e=t();function t(){if(typeof window.CustomEvent=="function")return window.CustomEvent;function s(r,o){o=o||{bubbles:!1,cancelable:!1,detail:void 0};var a=document.createEvent("CustomEvent");return a.initCustomEvent(r,o.bubbles,o.cancelable,o.detail),a}return s.prototype=window.Event.prototype,s}function i(s,r){var o=document.createElement("input");return o.type="hidden",o.name=s,o.value=r,o}function n(s,r){var o=s.getAttribute("data-to"),a=i("_method",s.getAttribute("data-method")),l=i("_csrf_token",s.getAttribute("data-csrf")),d=document.createElement("form"),c=document.createElement("input"),u=s.getAttribute("target");d.method=s.getAttribute("data-method")==="get"?"get":"post",d.action=o,d.style.display="none",u?d.target=u:r&&(d.target="_blank"),d.appendChild(l),d.appendChild(a),document.body.appendChild(d),c.type="submit",d.appendChild(c),c.click()}window.addEventListener("click",function(s){var r=s.target;if(!s.defaultPrevented)for(;r&&r.getAttribute;){var o=new e("phoenix.link.click",{bubbles:!0,cancelable:!0});if(!r.dispatchEvent(o))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 Wt=e=>typeof e=="function"?e:function(){return e},id=typeof self<"u"?self:null,Re=typeof window<"u"?window:null,qe=id||Re||globalThis,nd="2.0.0",je={connecting:0,open:1,closing:2,closed:3},sd=100,rd=1e4,od=1e3,ke={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Ye={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Kn={longpoll:"longpoll",websocket:"websocket"},ad={complete:4},Gn="base64url.bearer.phx.",tn=class{constructor(e,t,i,n){this.channel=e,this.event=t,this.payload=i||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHo
vendor: 13,846 bytes, lines 1-2
1oks=[],this.sent=!1}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:e,response:t,_ref:i}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.cancelRefEvent(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},Rr=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},ld=class{constructor(e,t,i){this.state=ke.closed,this.topic=e,this.params=Wt(t||{}),this.socket=i,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new tn(this,Ye.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Rr(()=>{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=ke.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=ke.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=ke.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=ke.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 tn(this,Ye.leave,Wt({}),this.timeout).send(),this.state=ke.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Ye.reply,(n,s)=>{this.trigger(this.replyEventName(s),n)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(e){this.on(Ye.close,e)}onError(e){return this.on(Ye.error,t=>e(t))}on(e,t){let i=this.bindingRef++;return this.bindings.push({event:e,ref:i,callback:t}),i}off(e,t){this.bindings=this.bindings.filter(i=>!(i.event===e&&(typeof t>"u"||t===i.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,i=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new tn(this,e,function(){return t},i);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=ke.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Ye.close,"leave")},i=new tn(this,Ye.leave,Wt({}),e);return i.receive("ok",()=>t()).receive("timeout",()=>t()),i.send(),this.canPush()||i.trigger("ok",{}),i}onMessage(e,t,i){return t}isMember(e,t,i,n){return this.topic!==e?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:i,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=ke.joining,this.joinPush.resend(e))}trigger(e,t,i,n){let s=this.onMessage(e,t,i,n);if(t&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let r=this.bindings.filter(o=>o.event===e);for(let o=0;o<r.length;o++)r[o].callback(s,i,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===ke.closed}isErrored(){return this.state===ke.errored}isJoined(){return this.state===ke.joined}isJoining(){return this.state===ke.joining}isLeaving(){return this.state===ke.leaving}},sn=class{static request(e,t,i,n,s,r,o){if(qe.XDomainRequest){let a=new qe.XDomainRequest;return this.xdomainRequest(a,e,t,n,s,r,o)}else if(qe.XMLHttpRequest){let a=new qe.XMLHttpRequest;return this.xhrRequest(a,e,t,i,n,s,r,o)}else{if(qe.fetch&&qe.AbortController)return this.fetchRequest(e,t,i,n,s,r,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,i,n,s,r,o){let a={method:e,headers:i,body:n},l=null;if(s){l=new AbortController;let d=setTimeout(()=>l.abort(),s);a.signal=l.signal}return qe.fetch(t,a).then(d=>d.text()).then(d=>this.parseJSON(d)).then(d=>o&&o(d)).catch(d=>{d.name==="AbortError"&&r?r():o&&o(null)}),l}static xdomainRequest(e,t,i,n,s,r,o){return e.timeout=s,e.open(t,i),e.onload=()=>{let a=this.parseJSON(e.responseText);o&&o(a)},r&&(e.ontimeout=r),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,i,n,s,r,o,a){e.open(t,i,!0),e.timeout=r;for(let[l,d]of Object.entries(n))e.setRequestHeader(l,d);return e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(e.readyState===ad.complete&&a){let l=this.parseJSON(e.responseText);a(l)}},o&&(e.ontimeout=o),e.send(s),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let i=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let s=t?`${t}[${n}]`:n,r=e[n];typeof r=="object"?i.push(this.serialize(r,s)):i.push(encodeURIComponent(s)+"="+encodeURIComponent(r))}return i.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let i=e.match(/\?/)?"&":"?";return`${e}${i}${this.serialize(t)}`}},cd=e=>{let t="",i=new Uint8Array(e),n=i.byteLength;for(let s=0;s<n;s++)t+=String.fromCharCode(i[s]);return btoa(t)},Vt=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Gn)&&(this.authToken=atob(t[1].slice(Gn.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(e),this.readyState=je.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Kn.websocket),"$1/"+Kn.longpoll)}endpointURL(){return sn.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,i){this.close(e,t,i),this.readyState=je.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===je.open||this.readyState===je.connecting}poll(){let e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:i,token:n,messages:s}=t;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=je.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(e){typeof e!="string"&&(e=cd(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e,t=0){this.awaitingBatchAck=!0;let i=t+sd,n=e.slice(t,i);this.ajax("POST",{"Content-Type":"application/x-ndjson"},n.join(` 2`),()=>this.ontimeout(),s=>{!s||s.status!==200?(this.awaitingBatchAck=!1,this.onerror(s&&s.status),this.closeAndRetry(1011,"internal server error",!1)):i<e.length?this.batchSend(e,i):this.batchBuffer.length>0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1})}close(e,t,i){for(let s of this.reqs)s.abort();this.readyState=je.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:i});this.batchBuffer=[],this.awaitingBatchAck=!1,clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,i,n,s){let r,o=()=>{this.reqs.delete(r),n()};r=sn.request(e,this.endpointURL(),t,i,this.timeout,o,a=>{this.reqs.delete(r),this.isActive()&&s(a)}),this.reqs.add(r)}};var nn={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let i=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(i))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[i,n,s,r,o]=JSON.parse(e);return t({join_ref:i,ref:n,topic:s,event:r,payload:o})}},binaryEncode(e){let{join_ref:t,ref:i,event:n,topic:s,payload:r}=e,o=new TextEncoder,a=o.encode(t),l=o.encode(i),d=o.encode(s),c=o.encode(n);this.assertFieldSize(a.byteLength,"join_ref"),this.assertFieldSize(l.byteLength,"ref"),this.assertFieldSize(d.byteLength,"topic"),this.assertFieldSize(c.byteLength,"event");let u=this.META_LENGTH+a.byteLength+l.byteLength+d.byteLength+c.byteLength,m=new ArrayBuffer(this.HEADER_LENGTH+u),p=new Uint8Array(m),h=new DataView(m),g=0;h.setUint8(g++,this.KINDS.push),h.setUint8(g++,a.byteLength),h.setUint8(g++,l.byteLength),h.setUint8(g++,d.byteLength),h.setUint8(g++,c.byteLength),p.set(a,g),g+=a.byteLength,p.set(l,g),g+=l.byteLength,p.set(d,g),g+=d.byteLength,p.set(c,g),g+=c.byteLength;var y=new Uint8Array(m.byteLength+r.byteLength);return y.set(p,0),y.set(new Uint8Array(r),m.byteLength),y.buffer},assertFieldSize(e,t){if(e>255)throw new Error(`unable to convert ${t} to binary: must be less than or equal to 255 bytes, but is ${e} bytes`)},binaryDecode(e){let t=new DataView(e),i=t.getUint8(0),n=new TextDecoder;switch(i){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,i){let n=t.getUint8(1),s=t.getUint8(2),r=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=i.decode(e.slice(o,o+n));o=o+n;let l=i.decode(e.slice(o,o+s));o=o+s;let d=i.decode(e.slice(o,o+r));o=o+r;let c=e.slice(o,e.byteLength);return{join_ref:a,ref:null,topic:l,event:d,payload:c}},decodeReply(e,t,i){let n=t.getUint8(1),s=t.getUint8(2),r=t.getUint8(3),o=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=i.decode(e.slice(a,a+n));a=a+n;let d=i.decode(e.slice(a,a+s));a=a+s;let c=i.decode(e.slice(a,a+r));a=a+r;let u=i.decode(e.slice(a,a+o));a=a+o;let m=e.slice(a,e.byteLength),p={status:u,response:m};return{join_ref:l,ref:d,topic:c,event:Ye.reply,payload:p}},decodeBroadcast(e,t,i){let n=t.getUint8(1),s=t.getUint8(2),r=this.HEADER_LENGTH+2,o=i.decode(e.slice(r,r+n));r=r+n;let a=i.decode(e.slice(r,r+s));r=r+s;let l=e.slice(r,e.byteLength);return{join_ref:null,ref:null,topic:o,event:a,payload:l}}},Or=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||rd,this.transport=t.transport||qe.WebSocket||Vt,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||qe&&qe.sessionStorage,this.establishedConnections=0,this.defaultEncoder=nn.encode.bind(nn),this.defaultDecoder=nn.decode.bind(nn),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==Vt?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let i=null;Re&&Re.addEventListener&&(Re.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),i=this.connectClock)}),Re.addEventListener("pageshow",n=>{i===this.connectClock&&(i=null,this.connect())}),Re.addEventListener("visibilitychange",()=>{this.handleVisibilityChange()}),Re.document&&Re.document.addEventListener("resume",()=>{this.handleVisibilityChange()})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=n=>t.rejoinAfterMs?t.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>t.reconnectAfterMs?t.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(n,s,r)=>
2{console.log(`${n}: ${s}`,r)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Wt(t.params||{}),this.endPoint=`${e}/${Kn.websocket}`,this.vsn=t.vsn||nd,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Rr(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(()=>this.connect())},this.reconnectAfterMs),this.authToken=t.authToken&&Wt(t.authToken)}get pageHidden(){return Re&&Re.document?Re.document.visibilityState==="hidden":!1}handleVisibilityChange(){this.pageHidden||!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect())}getLongPollTransport(){return Vt}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=sn.appendParams(sn.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,i){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,i)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Wt(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Vt?this.connectWithF
2allback(Vt,this.longPollFallbackMs):this.transportConnect())}log(e,t,i){this.logger&&this.logger(e,t,i)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),i=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(s=>{s.ref===t&&(this.off([n]),e(Date.now()-i))});return!0}transportName(e){switch(e){case Vt:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Gn}${btoa(this.authToken()).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let i=!1,n=!0,s,r,o=this.transportName(e),a=l=>{this.log("transport",`falling back to ${o}...`,l),this.off([s,r]),n=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return a("memorized");this.fallbackTimer=setTimeout(a,t),r=this.onError(l=>{this.log("transport","error",l),n&&!i&&(clearTimeout(this.fallbackTimer),a(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(i=!0,!n){let l=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${l}`,"true"),this.log("transport",`established ${l} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,t),this.ping(l=>{this.log("transport","connected to primary after",l),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(([,e])=>e())}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError("heartbeat_timeout"),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),od,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,i){if(!this.conn)return e&&e();let n=this.conn;this.waitForBufferDone(n,()=>{t?n.close(t,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),e&&e()})})}waitForBufferDone(e,t,i=1){if(i===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,i+1)},150*i)}waitForSocketClosed(e,t,i=1){if(i===5||e.readyState===je.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,i+1)},150*i)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{});let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError("connection_closed"),this.clearHeartbeats(),!this.closeWasClean&&t!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,i])=>i(e))}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,i=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,n])=>{n(e,t,i)}),(t===this.transport||i>0)&&this.triggerChanError("connection_error")}
2triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(Ye.error,{source:"transport",reason:e})})}connectionState(){switch(this.conn&&this.conn.readyState){case je.connecting:return"connecting";case je.open:return"open";case je.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([i])=>e.indexOf(i)===-1)}channel(e,t={}){let i=new ld(e,t,this);return this.channels.push(i),i}push(e){if(this.hasLogger()){let{topic:t,event:i,payload:n,ref:s,join_ref:r}=e;this.log("push",`${t} ${i} (${r}, ${s})`,n)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:i,event:n,payload:s,ref:r,join_ref:o}=t;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 a=0;a<this.channels.length;a++){let l=this.channels[a];l.isMember(i,n,s,o)&&l.trigger(n,s,r,o)}for(let a=0;a<this.stateChangeCallbacks.message.length;a++){let[,l]=this.stateChangeCallbacks.message[a];l(t)}})}leaveOpenTopic(e){let t=this.channels.find(i=>i.topic===e&&(i.isJoined()||i.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};var lo="consecutive-reloads",dd=10,hd=5e3,ud=1e4,pd=3e4,co=["phx-click-loading","phx-change-loading","phx-submit-loading","phx-keydown-loading","phx-keyup-loading","phx-blur-loading","phx-focus-loading","phx-hook-loading"],Yn="phx-drop-target-active",Oe="data-phx-component",Gt="data-phx-view",Qn="data-phx-link",fd="track-static",Mr="data-phx-link-state",Yt="data-phx-ref-loading",Le="data-phx-ref-src",G="data-phx-ref-lock",Dr="phx-pending-refs",ho="track-uploads",Ze="data-phx-upload-ref",ms="data-phx-preflighted-refs",md="data-phx-done-refs",uo="data-phx-error-refs",rn="drop-target",os="data-phx-active-refs",hn="phx:live-file:updated",po="data-phx-skip",as="data-phx-id",Hr="data-phx-prune",$r="phx-connected",yt="phx-loading",zt="phx-error",Nr="phx-client-error",vi="phx-server-error",Tt="data-phx-parent-id",gs="data-phx-main",Qe="data-phx-root-id",ls="viewport-top",cs="viewport-bottom",gd="viewport-overrun-target",vd="trigger-action",mn="phx-has-focused",bd=["text","textarea","number","email","password","search","tel","url","date","time","datetime-local","color","range"],fo=["checkbox","radio"],Ci="phx-has-submitted",ze="data-phx-session",Ti=`[${ze}]`,ds="data-phx-sticky",Ct="data-phx-static",hs="data-phx-readonly",Xt="data-phx-disabled",Fr="disable-with",gn="data-phx-disable-with-restore",wt="hook",yd="debounce",wd="throttle",vn="update",Sd="patch-focused",un="stream",bi="data-phx-stream",vs="data-phx-portal",At="data-phx-teleported",dt="data-phx-teleported-src",pn="data-phx-runtime-hook",Ed="data-phx-pid",xd="key",Ue="phxPrivate",Br="auto-recover",qr="no-unused-field",on="phx:live-socket:debug",Zn="phx:live-socket:profiling",es="phx:live-socket:latency-sim",an="phx:nav-history-position",kd="progress",jr="mounted",Ur="__phoenix_reload_status__",Cd=1,ts=3,Td=200,Ad=500,Ld="phx-",_d=3e4,yi="debounce-trigger",wi="throttled",Vr="debounce-prev-key",Id={debounce:300,throttle:300},Wr=[Yt,Le,G],Ce="s",is="r",ue="c",z="k",Ve="kc",zr="km",Jr="e",Xr="r",Kr="t",at="p",Jt="stream",Pd="phx:live-view:diagnostic",Rd=1,Od=class{constructor(e,t,i){let{chunk_size:n,chunk_timeout:s}
2=t;this.liveSocket=i,this.entry=e,this.offset=0,this.chunkSize=n,this.chunkTimeout=s,this.chunkTimer=null,this.errored=!1,this.uploadChannel=i.channel(`lvu:${e.ref}`,{token:e.metadata()})}error(e){this.errored||(this.entry.view.cancelSubmit(this.entry.fileEl.form),this.uploadChannel.leave(),this.errored=!0,this.chunkTimer!=null&&clearTimeout(this.chunkTimer),e!=="writer_error"&&this.entry.error(e))}upload(){this.uploadChannel.onError(e=>this.error(e)),this.uploadChannel.join().receive("ok",e=>this.readNextChunk()).receive("error",({reason:e})=>this.error(e))}isDone(){return this.offset>=this.entry.file.size}readNextChunk(){let e=new window.FileReader,t=this.entry.file.slice(this.offset,this.chunkSize+this.offset);e.onload=i=>{if(i.target?.error===null)this.offset+=i.target.result.byteLength,this.pushChunk(i.target.result);else return this.entry.view.logError("upload.read-failed","Read error: "+i.target?.error,{entry:this.entry,offset:this.offset})},e.readAsArrayBuffer(t)}pushChunk(e){this.uploadChannel.isJoined()&&this.uploadChannel.push("chunk",e,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:t})=>this.error(t))}},mo=e=>{window.dispatchEvent(new CustomEvent(Pd,{detail:{version:Rd,...e}}))},We=(e,t,i,n)=>{console.error&&console.error(t,i),mo({level:"error",code:e,message:t,metadata:i,...n})},Gr=(e,t)=>{let i;try{i=new URL(e,window.location.href)}catch{throw new Error(`expected ${t} destination to be a valid URL, got: ${e}`)}if(i.origin!==window.location.origin)throw new Error(`cannot ${t} to "${e}" because its origin does not match the current origin "${window.location.origin}". Use window.location directly for cross-origin navigation.`)},ct=e=>{let t=typeof e;return t==="number"||t==="string"&&/^(0|[1-9]\d*)$/.test(e)};function Md(e=We){let t=new Map,i=document.querySelectorAll("*[id]");for(let n=0,s=i.length;n<s;n++){let r=i[n].id,o=t.get(r);o?e("dom.duplicate-id",`Multiple IDs detected: ${r}. Ensure unique element ids.`,{id:r,elements:[o,i[n]]},{attribution:"app"}):t.set(r,i[n])}}function Dd(e,t=We){let i=new Set;Object.keys(e).forEach(n=>{let s=document.getElementById(n);s&&s.parentElement&&s.parentElement.getAttribute("phx-update")!=="stream"&&i.add(s.parentElement)}),i.forEach(n=>{let s=n.id;t("dom.invalid-stream-container",`The stream container with id "${s}" is missing the phx-update="stream" attribute. Ensure it is set for streams to work properly.`,{id:s,container:n},{attribution:"app"})})}var Hd=(e,t,i,n)=>{e.liveSocket.isDebugEnabled()&&console.log(`${e.id} ${t}: ${i} - `,n)},Si=e=>typeof e=="function"?e:function(){return e},fn=e=>JSON.parse(JSON.stringify(e)),go=e=>"structuredClone"in window?structuredClone(e):JSON.parse(JSON.stringify(e)),kt=(e,t,i)=>{let n=e;do{if(n.matches(`[${t}]`)&&!("disabled"in n&&n.disabled))return n;n=n.parentElement}while(n!==null&&n.nodeType===1&&!(i&&i.isSameNode(n)||n.matches(Ti)));return null},St=e=>e!==null&&typeof e=="object"&&!(e instanceof Array),$d=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Yr=e=>{for(let t in e)return!1;return!0},Kt=(e,t)=>e&&t(e),Nd=function(e,t,i,n){e.forEach(s=>{new Od(s,i.config,n).upload()})},Fd=e=>{if(e.dataTransfer.types){for(let t=0;t<e.dataTransfer.types.length;t++)if(e.dataTransfer.types[t]==="Files")return!0}return!1},Bd={canPushState(){return typeof history.pushState<"u"},dropLocal(e,t,i){return e.removeItem(this.localKey(t,i))},updateLocal(e,t,i,n,s){let r=this.getLocal(e,t,i),o=this.localKey(t,i),a=r===null?n:s(r);return e.setItem(o,JSON.stringify(a)),a},getLocal(e,t,i){return JSON.parse(e.getItem(this.localKey(t,i)))},updateCurrentState(e){this.canPushState()&&history.replaceState(e(history.state||{}),"",window.location.href)},pushState(e,t,i){if(this.canPushState()){if(i!==window.location.href){if(t.type=="redirect"&&t.scroll){let n=history.state||{};n.scroll=t.scroll,history.replaceState(n,"",window.location.href)}delete t.scroll,history[e+"State"](t,"",i||null),window.requestAnimationFrame(()=>{let n=this.getHashTargetEl(window.location.hash);n?n.scrollIntoView():t.type==="redirect"&&window.scroll(0,0)})}}else i&&this.redirect(i)}
2,setCookie(e,t,i){let n=typeof i=="number"?` max-age=${i};`:"";document.cookie=`${e}=${t};${n} path=/`},getCookie(e){return document.cookie.replace(new RegExp(`(?:(?:^|.*;s*)${e}s*=s*([^;]*).*$)|^.*$`),"$1")},deleteCookie(e){document.cookie=`${e}=; max-age=-1; path=/`},redirect(e,t=null,i=n=>{window.location.href=n}){t&&this.setCookie("__phoenix_flash__",t,60),i(e)},localKey(e,t){return`${e}-${t}`},getHashTargetEl(e){let t=e.toString().substring(1);if(t!=="")return document.getElementById(t)||document.querySelector(`a[name="${t}"]`)}},we=Bd,xt={byId(e){return document.getElementById(e)||We("dom.element-not-found",`no id found for ${e}`,{id:e},{attribution:"internal"})},elementFromTarget(e){return e instanceof Node?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null},removeClass(e,t){e.classList.remove(t),e.classList.length===0&&e.removeAttribute("class")},all(e,t,i){if(!e)return[];let n=Array.from(e.querySelectorAll(t));return i&&n.forEach(i),n},childNodeLength(e){let t=document.createElement("template");return t.innerHTML=e,t.content.childElementCount},isUploadInput(e){return e.type==="file"&&e.getAttribute(Ze)!==null},isAutoUpload(e){return e.hasAttribute("data-phx-auto-upload")},findUploadInputs(e){let t=e.id,i=this.all(document,`input[type="file"][${Ze}][form="${t}"]`);return this.all(e,`input[type="file"][${Ze}]`).concat(i)},findComponent(e,t,i=document){return i.querySelector(`[${Gt}="${e}"][${Oe}="${t}"]`)},getComponent(e,t,i=document){let n=this.findComponent(e,t,i);if(!n)throw new Error(`no component found matching viewId ${e} and cid ${t}`);return n},isPhxDestroyed(e){return!!(e.id&&xt.private(e,"destroyed"))},wantsNewTab(e){let t=e.ctrlKey||e.shiftKey||e.metaKey||e.button&&e.button===1,i=e.target instanceof HTMLAnchorElement&&e.target.hasAttribute("download"),n=e.target.hasAttribute("target")&&e.target.getAttribute("target").toLowerCase()==="_blank",s=e.target.hasAttribute("target")&&!e.target.getAttribute("target").startsWith("_");return t||n||i||s},isUnloadableFormSubmit(e){return e.target&&e.target.getAttribute("method")==="dialog"||e.submitter&&e.submitter.getAttribute("formmethod")==="dialog"?!1:!e.defaultPrevented&&!this.wantsNewTab(e)},isNewPageClick(e,t){let i=e.target instanceof HTMLAnchorElement?e.target.getAttribute("href"):null,n;if(e.defaultPrevented||i===null||this.wantsNewTab(e)||i.startsWith("mailto:")||i.startsWith("tel:")||e.target.isContentEditable)return!1;try{n=new URL(i)}catch{try{n=new URL(i,t)}catch{return!0}}return n.host===t.host&&n.protocol===t.protocol&&n.pathname===t.pathname&&n.search===t.search?n.hash===""&&!n.href.endsWith("#"):n.protocol.startsWith("http")},markPhxChildDestroyed(e){this.isPhxChild(e)&&e.setAttribute(ze,""),this.putPrivate(e,"destroyed",!0)},findPhxChildrenInFragment(e,t){let i=document.createElement("template");return i.innerHTML=e,this.findPhxChildren(i.content,t)},isIgnored(e,t){return(e.getAttribute(t)||e.getAttribute("data-phx-update"))==="ignore"},isPhxUpdate(e,t,i){return e.getAttribute&&i.indexOf(e.getAttribute(t))>=0},findPhxSticky(e){return this.all(e,`[${ds}]`)},findPhxChildren(e,t){return this.all(e,`${Ti}[${Tt}="${t}"]`)},findExistingParentCIDs(e,t){let i=new Set,n=new Set;return t.forEach(s=>{this.all(document,`[${Gt}="${e}"][${Oe}="${s}"]`).forEach(r=>{i.add(s),this.all(r,`[${Gt}="${e}"][${Oe}]`).map(o=>parseInt(o.getAttribute(Oe))).forEach(o=>n.add(o))})}),n.forEach(s=>i.delete(s)),i},private(e,t){return e[Ue]&&e[Ue][t]},deletePrivate(e,t){e[Ue]&&delete e[Ue][t]},putPrivate(e,t,i){e[Ue]||(e[Ue]={}),e[Ue][t]=i},updatePrivate(e,t,i,n){let s=this.private(e,t);s===void 0?this.putPrivate(e,t,n(i)):this.putPrivate(e,t,n(s))},syncPendingAttrs(e,t){e.hasAttribute(Le)&&(co.forEach(i=>{e.classList.contains(i)&&t.classList.add(i)}),Wr.filter(i=>e.hasAttribute(i)).forEach(i=>{t.setAttribute(i,e.getAttribute(i))}))},copyPrivates(e,t){t[Ue]&&(e[Ue]=t[Ue])},putTitle(e){let t=document.querySelector("title");if(t){let{prefix:i,suffix:n,default:s}=t.dataset,r=typeof e!="string"||e.trim()==="";if(r&&typeof s!="string")return;let o=r?s:e;document.title=`${i||""}${o||""}${n||""}`}else document.title=e},debounce(e,t,i,n,s,r,o,a){let l=e.getAttribute(i),d=e.getAttribute(s);l===""&&(l=n),d===""&&(d=r);let c=l||d;switch(c){case null:return a();case"blur":this.incCycle(e,"debounce-blur-cycle",()=>{o()&&a()}),this.once(e,"debounce-blur")&&e.addEventListener("blur",()=>this.triggerCycle(e,"debounce-blur-cycle"));return;default:let u=parseInt(c),m=()=>d?this.deletePrivate(e,wi):a(),p=this.incCycle(e,yi,m);
2if(isNaN(u))return We("dom.invalid-debounce",`invalid throttle/debounce value: ${c}`,{el:e,value:c},{attribution:"app"});if(d){let g=!1;if(t.type==="keydown"){let y=this.private(e,Vr);this.putPrivate(e,Vr,t.key),g=y!==t.key}if(!g&&this.private(e,wi))return!1;{a();let y=setTimeout(()=>{o()&&this.triggerCycle(e,yi)},u);this.putPrivate(e,wi,y)}}else setTimeout(()=>{o()&&this.triggerCycle(e,yi,p)},u);let h=e.form;h&&this.once(h,"bind-debounce")&&h.addEventListener("submit",()=>{Array.from(new FormData(h).entries(),([g])=>{let y=h.elements.namedItem(g),E=y instanceof RadioNodeList?y[0]:y;E&&(this.incCycle(E,yi),this.deletePrivate(E,wi))})}),this.once(e,"bind-debounce")&&e.addEventListener("blur",()=>{clearTimeout(this.private(e,wi)),o()&&this.triggerCycle(e,yi)})}},triggerCycle(e,t,i){let[n,s]=this.private(e,t);i||(i=n),i===n&&(this.incCycle(e,t),s())},once(e,t){return this.private(e,t)===!0?!1:(this.putPrivate(e,t,!0),!0)},incCycle(e,t,i=function(){}){let[n]=this.private(e,t)||[0,i];return n++,this.putPrivate(e,t,[n,i]),n},maintainPrivateHooks(e,t,i,n){e.hasAttribute&&e.hasAttribute("data-phx-hook")&&!t.hasAttribute("data-phx-hook")&&t.setAttribute("data-phx-hook",e.getAttribute("data-phx-hook")),t.hasAttribute&&(t.hasAttribute(i)||t.hasAttribute(n))&&t.setAttribute("data-phx-hook","Phoenix.InfiniteScroll")},putCustomElHook(e,t){e.isConnected?e.setAttribute("data-phx-hook",""):We("hook.non-connected-element",` 3 hook attached to non-connected DOM element 4 ensure you are calling createHook within your connectedCallback. ${e.outerHTML} 5 `,{el:e},{attribution:"app"}),this.putPrivate(e,"custom-el-hook",t)},getCustomElHook(e){return this.private(e,"custom-el-hook")},isUsedInput(e){return e.nodeType===Node.ELEMENT_NODE&&(this.private(e,mn)||this.private(e,Ci))},resetForm(e){Array.from(e.elements).forEach(t=>{this.deletePrivate(t,mn),this.deletePrivate(t,Ci)})},isPhxChild(e){return e.getAttribute&&e.getAttribute(Tt)},isPhxSticky(e){return e.getAttribute&&e.getAttribute(ds)!==null},isChildOfAny(e,t){return!!t.find(i=>i.contains(e))},firstPhxChild(e){return this.isPhxChild(e)?e:this.all(e,`[${Tt}]`)[0]},isPortalTemplate(e){return e.tagName==="TEMPLATE"&&e.hasAttribute(vs)},closestViewEl(e){let t=e.closest(`[${At}],${Ti}`);return t?t.hasAttribute(At)?this.byId(t.getAttribute(At)):t.hasAttribute(ze)?t:null:null},dispatchEvent(e,t,i={}){let n=!0;e.nodeName==="INPUT"&&e.type==="file"&&t==="click"&&(n=!1);let o={bubbles:i.bubbles===void 0?n:!!i.bubbles,cancelable:!0,detail:i.detail||{}},a=t==="click"?new MouseEvent("click",o):new CustomEvent(t,o);return e.dispatchEvent(a)},cloneNode(e,t){if(typeof t>"u")return e.cloneNode(!0);{let i=e.cloneNode(!1);return i.innerHTML=t,i}},mergeAttrs(e,t,i={}){let n=new Set(i.exclude||[]),s=i.isIgnored,r=t.attributes;for(let a=r.length-1;a>=0;a--){let l=r[a].name;if(n.has(l)){if(l==="value"){let d=t.value??t.getAttribute(l);e.value===d&&e.setAttribute("value",t.getAttribute(l))}}else{let d=t.getAttribute(l);e.getAttribute(l)!==d&&(!s||s&&l.startsWith("data-"))&&e.setAttribute(l,d)}}let o=e.attributes;for(let a=o.length-1;a>=0;a--){let l=o[a].name;s?l.startsWith("data-")&&!t.hasAttribute(l)&&!Wr.includes(l)&&e.removeAttribute(l):t.hasAttribute(l)||e.removeAttribute(l)}},mergeFocusedInput(e,t){e instanceof HTMLSelectElement||xt.mergeAttrs(e,t,{exclude:["value"]}),t.readOnly?e.setAttribute("readonly",!0):e.removeAttribute("readonly")},hasSelectionRange(e){return e.setSelectionRange&&(e.type==="text"||e.type==="textarea")},restoreFocus(e,t,i){if(e instanceof HTMLSelectElement&&e.focus(),!xt.isTextualInput(e))return;e.matches(":focus")||e.focus(),this.hasSelectionRange(e)&&e.setSelectionRange(t,i)},isEditableInput(e){return this.isFormAssociated(e)&&!(e instanceof HTMLButtonElement)&&!(e instanceof HTMLInputElement&&e.type==="button")},isFormAssociated(e){if(!(e instanceof HTMLElement))return!1;if(e.localName){let t=customElements.get(e.localName);if(t)return t.formAssociated===!0}return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement},syncAttrsToProps(e){e instanceof HTMLInputElement&&fo.indexOf(e.type.toLocaleLowerCase())>=0&&(e.checked=e.getAttribute("checked")!==null)},isTextualInput(e){return bd.indexOf(e.type)>=0}
5,isNowTriggerFormExternal(e,t){return e.getAttribute&&e.getAttribute(t)!==null&&document.body.contains(e)},cleanChildNodes(e,t,i=We){if(xt.isPhxUpdate(e,t,["append","prepend",un])){let n=[];e.childNodes.forEach(s=>{(!("id"in s)||!s.id)&&(!(s.nodeType===Node.TEXT_NODE&&s.nodeValue&&s.nodeValue.trim()==="")&&s.nodeType!==Node.COMMENT_NODE&&i("dom.invalid-phx-update-child",`only HTML element tags with an id are allowed inside containers with phx-update. 6 7removing illegal node: "${("outerHTML"in s&&s.outerHTML||s.nodeValue||"").trim()}" 8 9`,{container:e,childNode:s,phxUpdate:t},{attribution:"app"}),n.push(s))}),n.forEach(s=>s.remove())}},replaceRootContainer(e,t,i){let n=new Set(["id",ze,Ct,gs,Qe]);if(e.tagName.toLowerCase()===t.toLowerCase())return Array.from(e.attributes).filter(s=>!n.has(s.name.toLowerCase())).forEach(s=>e.removeAttribute(s.name)),Object.keys(i).filter(s=>!n.has(s.toLowerCase())).forEach(s=>e.setAttribute(s,i[s])),e;{let s=document.createElement(t);return Object.keys(i).forEach(r=>s.setAttribute(r,i[r])),n.forEach(r=>{let o=e.getAttribute(r);o!==null&&s.setAttribute(r,o)}),s.innerHTML=e.innerHTML,e.replaceWith(s),s}},getSticky(e,t,i){let n=(xt.private(e,"sticky")||[]).find(([s])=>t===s);if(n){let[s,r,o]=n;return o}else return typeof i=="function"?i():i},deleteSticky(e,t){this.updatePrivate(e,"sticky",[],i=>i.filter(([n,s])=>n!==t))},putSticky(e,t,i){let n=i(e);this.updatePrivate(e,"sticky",[],s=>{let r=s.findIndex(([o])=>t===o);return r>=0?s[r]=[t,i,n]:s.push([t,i,n]),s})},applyStickyOperations(e){let t=xt.private(e,"sticky");t&&t.forEach(([i,n,s])=>this.putSticky(e,i,n))},isLocked(e){return e.hasAttribute&&e.hasAttribute(G)},attributeIgnored(e,t){return t.some(i=>e.name==i||i==="*"||i.includes("*")&&e.name.match(i)!=null)}},v=xt,Ei=class{static isActive(e,t){let i=t._phxRef,n=i===void 0,s=e.getAttribute(os).split(","),r=!n&&s.indexOf(i)>=0;return t.size>0&&(n||r)}static isPreflighted(e,t){return e.getAttribute(ms).split(",").indexOf(re.genFileRef(t))>=0&&this.isActive(e,t)}static isPreflightInProgress(e){return e._preflightInProgress===!0}static markPreflightInProgress(e){e._preflightInProgress=!0}constructor(e,t,i,n){this.ref=re.genFileRef(t),this.fileEl=e,this.file=t,this.view=i,this.meta=null,this._isCancelled=!1,this._isDone=!1,this._progress=0,this._lastProgressSent=-1,this._onCancel=function(){},this._onDone=function(){},this._onElUpdated=this.onElUpdated.bind(this),this.fileEl.addEventListener(hn,this._onElUpdated),this.autoUpload=n}metadata(){return this.meta}progress(e){this._progress=Math.floor(e),this._progress>this._lastProgressSent&&(this._progress>=100?(this._progress=100,this._lastProgressSent=100,this._isDone=!0,this.view.pushFileProgress(this.fileEl,this.ref,100,()=>{re.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;try{this._onCancel()}finally{this._onDone()}}isDone(){return this._isDone}error(e="failed"){this.fileEl.removeEventListener(hn,this._onElUpdated),this.view.pushFileProgress(this.fileEl,this.ref,{error:e}),this.isAutoUpload()||re.clearFiles(this.fileEl)}isAutoUpload(){return this.autoUpload}onCancel(e){this.isCancelled()?e():this._onCancel=e}onDone(e){this._onDone=()=>{this.fileEl.removeEventListener(hn,this._onElUpdated),e()}}onElUpdated(){this.fileEl.getAttribute(os).split(",").indexOf(this.ref)===-1&&(re.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(e){if(this.meta.uploader){let t=e[this.meta.uploader]||this.view.logError("upload.missing-uploader",`no uploader configured for ${this.meta.uploader}`,{uploader:this.meta.uploader,uploaders:e});return{name:this.meta.uploader,callback:t}}else return{name:"channel",callback:Nd}}zipPostFlight(e){this.meta=e.entries[this.ref],this.meta||this.view.logError("upload.missing-preflight-response",`no preflight upload response returned with ref ${this.ref}`,{ref:this.ref,input:this.fileEl,response:e},{attribution:"internal"})}},qd=0,re=class us{static genFileRef(t){let i=t._phxRef;return i!==void 0?i:(t._phxRef=(qd++).toString(),t._phxRef)}static getEntryDataURL(t,i){let n=this.activeFiles(t).find(s=>this.genFileRef(s)===i);return n?URL.createObjectURL(n):null}static hasUploadsInProgress(t){let i=0;
9return v.findUploadInputs(t).forEach(n=>{n.getAttribute(ms)!==n.getAttribute(md)&&i++}),i>0}static hasUploadErrors(t){return v.findUploadInputs(t).some(i=>(i.getAttribute(uo)||"")!=="")}static serializeUploads(t){let i=this.activeFiles(t),n={};return i.forEach(s=>{let r={path:t.name},o=t.getAttribute(Ze);n[o]=n[o]||[],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[o].push(r)}),n}static clearFiles(t){t.value=null,t.removeAttribute(Ze),v.putPrivate(t,"files",[])}static untrackFile(t,i){v.putPrivate(t,"files",v.private(t,"files").filter(n=>!Object.is(n,i)))}static trackFiles(t,i,n){if(t.getAttribute("multiple")!==null){let s=i.filter(r=>!this.activeFiles(t).find(o=>Object.is(o,r)));v.updatePrivate(t,"files",[],r=>r.concat(s)),t.value=""}else n&&n.files.length>0&&(t.files=n.files),v.putPrivate(t,"files",i)}static activeFileInputs(t){let i=v.findUploadInputs(t);return Array.from(i).filter(n=>n.files&&this.activeFiles(n).length>0)}static activeFiles(t){return(v.private(t,"files")||[]).filter(i=>Ei.isActive(t,i))}static inputsAwaitingPreflight(t){let i=v.findUploadInputs(t);return Array.from(i).filter(n=>this.filesAwaitingPreflight(n).length>0)}static filesAwaitingPreflight(t){return this.activeFiles(t).filter(i=>!Ei.isPreflighted(t,i)&&!Ei.isPreflightInProgress(i))}static markPreflightInProgress(t){t.forEach(i=>Ei.markPreflightInProgress(i.file))}constructor(t,i,n){this.autoUpload=v.isAutoUpload(t),this.view=i,this.onComplete=n,this._entries=Array.from(us.filesAwaitingPreflight(t)||[]).map(s=>new Ei(t,s,i,this.autoUpload)),us.markPreflightInProgress(this._entries),this.numEntriesInProgress=this._entries.length}isAutoUpload(){return this.autoUpload}entries(){return this._entries}cancel(){this._entries.filter(t=>!t.isDone()).forEach(t=>t.cancel())}initAdapterUpload(t,i,n){this._entries=this._entries.map(r=>(r.isCancelled()?(this.numEntriesInProgress--,this.numEntriesInProgress===0&&this.onComplete()):(r.zipPostFlight(t),r.onDone(()=>{this.numEntriesInProgress--,this.numEntriesInProgress===0&&this.onComplete()})),r));let s=this._entries.reduce((r,o)=>{if(!o.meta)return r;let{name:a,callback:l}=o.uploader(n.uploaders);return r[a]=r[a]||{callback:l,entries:[]},r[a].entries.push(o),r},{});for(let r in s){let{callback:o,entries:a}=s[r];o(a,i,t,n)}}},jd={anyOf(e,t){return t.some(i=>e instanceof i)},isFocusable(e,t=!1){return e instanceof HTMLAnchorElement&&e.rel!=="ignore"||e instanceof HTMLAreaElement&&e.href!==void 0||!("disabled"in e&&e.disabled)&&this.anyOf(e,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLButtonElement])||e instanceof HTMLIFrameElement||e instanceof HTMLElement&&e.tabIndex>=0&&e.getAttribute("aria-hidden")!=="true"||!t&&e.getAttribute("tabindex")!==null&&e.getAttribute("aria-hidden")!=="true"},attemptFocus(e,t=!1){if(this.isFocusable(e,t))try{e.focus()}catch{}return!!document.activeElement&&document.activeElement.isSameNode(e)},focusFirstInteractive(e){let t=e.firstElementChild;for(;t;){if(this.attemptFocus(t,!0)||this.focusFirstInteractive(t))return!0;t=t.nextElementSibling}return!1},focusFirst(e){let t=e.firstElementChild;for(;t;){if(this.attemptFocus(t)||this.focusFirst(t))return!0;t=t.nextElementSibling}return!1},focusLast(e){let t=e.lastElementChild;for(;t;){if(this.attemptFocus(t)||this.focusLast(t))return!0;t=t.previousElementSibling}return!1}},Te=jd,vo=e=>["HTML","BODY"].indexOf(e.nodeName.toUpperCase())>=0?null:["scroll","auto"].indexOf(getComputedStyle(e).overflowY)>=0?e:vo(e.parentElement),Qr=e=>e?e.scrollTop:document.documentElement.scrollTop||document.body.scrollTop,bs=e=>e?e.getBoundingClientRect().bottom:window.innerHeight||document.documentElement.clientHeight,ys=e=>e?e.getBoundingClientRect().top:0,Ud=(e,t)=>{let i=e.getBoundingClientRect();return Math.ceil(i.top)>=ys(t)&&Math.floor(i.top)<=bs(t)},Vd=(e,t)=>{let i=e.getBoundingClientRect();return Math.ceil(i.bottom)>=ys(t)&&Math.floor(i.bottom)<=bs(t)},Zr=(e,t)=>{let i=e.getBoundingClientRect();return Math.ceil(i.top)>=ys(t)&&Math.floor(i.top)<=bs(t)},Wd={mounted(){this.scrollContainer=vo(this.el);let e=Qr(this.scrollContainer),t=!1,i=500,n=null,s=this.throttle(i,(a,l)=>{n=()=>!0,this.liveSocket.js().push(this.el,a,{value:{id:l.id,_overran:!0},callback:()=>{n=null}})}),r=this.throttle(i,(a,l)=>{n=()=>l.scrollIntoView({block:"start"}),this.liveSocket.js().push(this.el,a,{value:{id:l.id},callback:()=>{n=null,window.requestAnimationFrame(()=>{Zr(l,this.scrollContainer)||l.scrollIntoView({block:"start"})})}})}),o=this.throttle(i,(a,l)=>{n=()=>l.scrollIntoView({block:"end"}),this.liveSocket.js().push(this.el,a,{value:{id:l.id},callback:()=>{n=null,window.requestAnimationFrame(()=>{Zr(l,this.scrollContainer)||l.scrollIntoView({block:"end"})})}})});this.throttles=[s,r,o],this.onScroll=a=>{let l=Qr(this.scrollContainer);if(n)return e=l,n();let d=this.findOverrunTarget(),c=this.el.getAttribute(this.liveSocket.b
9inding("viewport-top")),u=this.el.getAttribute(this.liveSocket.binding("viewport-bottom")),m=this.el.lastElementChild,p=this.el.firstElementChild,h=l<e,g=l>e;h&&c&&!t&&d.top>=0?(t=!0,s(c,p)):g&&t&&d.top<=0&&(t=!1),c&&h&&p&&Ud(p,this.scrollContainer)?r(c,p):u&&g&&m&&Vd(m,this.scrollContainer)&&o(u,m),e=l},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.throttles?.forEach(e=>e.cancel()),this.throttles=null,this.scrollContainer?this.scrollContainer.removeEventListener("scroll",this.onScroll):window.removeEventListener("scroll",this.onScroll)},throttle(e,t){let i=0,n=null,s=(...r)=>{let o=Date.now(),a=e-(o-i);a<=0||a>e?(n!==null&&(clearTimeout(n),n=null),i=o,t(...r)):n===null&&(n=setTimeout(()=>{i=Date.now(),n=null,t(...r)},a))};return s.cancel=()=>{n!==null&&(clearTimeout(n),n=null)},s},findOverrunTarget(){let e,t=this.el.getAttribute(this.liveSocket.binding(gd));if(t){let i=document.getElementById(t);if(i)e=i.getBoundingClientRect();else throw new Error("did not find element with id "+t)}else e=this.el.getBoundingClientRect();return e}},zd={activeRefs(){return this.el.getAttribute(os)},preflightedRefs(){return this.el.getAttribute(ms)},errorRefs(){return this.el.getAttribute(uo)||""},hasSelectedFiles(){return(this.el.files?.length||0)>0||re.activeFiles(this.el).length>0||this.activeRefs()!==""||this.errorRefs()!==""},maybeRemoveRequired(){this.hasSelectedFiles()&&this.el.removeAttribute("required")},mounted(){this.js().ignoreAttributes(this.el,["value"]),this.preflightedWas=this.preflightedRefs(),this.errorRefsWas=this.errorRefs(),this.el.addEventListener("input",()=>this.maybeRemoveRequired()),this.maybeRemoveRequired()},updated(){let e=this.preflightedRefs(),t=this.errorRefs();this.errorRefsWas!==t&&(this.errorRefsWas=t,t!==""&&this.__view().cancelSubmit(this.el.form)),this.preflightedWas!==e&&(this.preflightedWas=e,e===""&&this.__view().cancelSubmit(this.el.form)),this.activeRefs()===""&&(this.el.value=""),this.maybeRemoveRequired(),this.el.dispatchEvent(new CustomEvent(hn))}},Jd={mounted(){this.ref=this.el.getAttribute("data-phx-entry-ref"),this.inputEl=document.getElementById(this.el.getAttribute(Ze)),this.url=re.getEntryDataURL(this.inputEl,this.ref),this.el.src=this.url},destroyed(){URL.revokeObjectURL(this.url)}},Xd={LiveFileUpload:zd,LiveImgPreview:Jd,FocusWrap:{mounted(){this.focusStart=this.el.firstElementChild,this.focusEnd=this.el.lastElementChild,this.focusStart.addEventListener("focus",e=>{if(!e.relatedTarget||!this.el.contains(e.relatedTarget)){let t=e.target.nextElementSibling;Te.attemptFocus(t)||Te.focusFirst(t)}else Te.focusLast(this.el)}),this.focusEnd.addEventListener("focus",e=>{if(!e.relatedTarget||!this.el.contains(e.relatedTarget)){let t=e.target.previousElementSibling;Te.attemptFocus(t)||Te.focusLast(t)}else Te.focusFirst(this.el)}),this.el.contains(document.activeElement)||(this.el.addEventListener("phx:show-end",()=>this.el.focus()),window.getComputedStyle(this.el).display!=="none"&&Te.focusFirst(this.el))}},InfiniteScroll:Wd},Kd=Xd,ps=class{static onUnlock(e,t){if(!v.isLocked(e)&&!e.closest(`[${G}]`))return t();let i=e.closest(`[${G}]`),n=i.closest(`[${G}]`).getAttribute(G);i.addEventListener(`phx:undo-lock:${n}`,()=>{t()},{once:!0})}constructor(e){this.el=e,this.loadingRef=e.hasAttribute(Yt)?parseInt(e.getAttribute(Yt),10):null,this.lockRef=e.hasAttribute(G)?parseInt(e.getAttribute(G),10):null}maybeUndo(e,t,i){if(!this.isWithin(e)){v.updatePrivate(this.el,Dr,[],n=>(n.push(e),n));return}this.undoLocks(e,t,i),this.undoLoading(e,t),v.updatePrivate(this.el,Dr,[],n=>n.filter(s=>{let r={detail:{ref:s,event:t},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>e})),this.isFullyResolvedBy(e)&&this.el.removeAttribute(Le)}isWithin(e){return!(this.loadingRef!==null&&this.loadingRef>e&&this.lockRef!==null&&this.lockRef>e)}undoLocks(e,t,i){if(!this.isLockUndoneBy(e))return;let n=v.private(this.el,G);n&&(i(n),v.deletePrivate(this.el,G)),this.el.removeAttribute(G);let s={detail:{ref:e,event:t},bubbles:!0,cancelable:!1};this.el.dispatchEvent(new CustomEvent(`phx:undo-lock:${this.lockRef}`,s))}undoLoading(e,t){if(!this.isLoadingUndoneBy(e)){this.canUndoLoading(e)&&this.el.classList.contains("phx-submit-loading")&&this.el.classList.remove("phx-change-loading");return}if(this.canUndoLoading(e)){this.el.removeAttribute(Yt);let i=this.el.getAttribute(Xt),n=this.el.getAttribute(hs);n!==null&&"readOnly"in this.el&&(this.el.readOnly=n==="true",this.el.removeAttribute(hs)),i!==null&&"disabled"in this.el&&(this.el.disabled=i==="true",this.el.removeAttribute(Xt));let s=this.el.getAttribute(gn);s!==null&&(this.el.textContent=s,this.el.removeAttribute(gn));
9let r={detail:{ref:e,event:t},bubbles:!0,cancelable:!1};this.el.dispatchEvent(new CustomEvent(`phx:undo-loading:${this.loadingRef}`,r))}co.forEach(i=>{(i!=="phx-submit-loading"||this.canUndoLoading(e))&&v.removeClass(this.el,i)})}isLoadingUndoneBy(e){return this.loadingRef===null?!1:this.loadingRef<=e}isLockUndoneBy(e){return this.lockRef===null?!1:this.lockRef<=e}isFullyResolvedBy(e){return(this.loadingRef===null||this.loadingRef<=e)&&(this.lockRef===null||this.lockRef<=e)}canUndoLoading(e){return this.lockRef===null||this.lockRef<=e}},Gd=class{constructor(e,t,i){let n=new Set,s=new Set([...t.children].map(o=>o.id)),r=[];Array.from(e.children).forEach(o=>{if(o.id&&(n.add(o.id),s.has(o.id))){let a=o.previousElementSibling&&o.previousElementSibling.id;r.push({elementId:o.id,previousElementId:a})}}),this.containerId=t.id,this.updateType=i,this.elementsToModify=r,this.elementIdsToAdd=[...s].filter(o=>!n.has(o))}perform(){let e=v.byId(this.containerId);e&&(this.elementsToModify.forEach(t=>{t.previousElementId?Kt(document.getElementById(t.previousElementId),i=>{Kt(document.getElementById(t.elementId),n=>{n.previousElementSibling&&n.previousElementSibling.id==i.id||i.insertAdjacentElement("afterend",n)})}):Kt(document.getElementById(t.elementId),i=>{i.previousElementSibling==null||e.insertAdjacentElement("afterbegin",i)})}),this.updateType=="prepend"&&this.elementIdsToAdd.reverse().forEach(t=>{Kt(document.getElementById(t),i=>e.insertAdjacentElement("afterbegin",i))}))}},eo=11;function Yd(e,t){var i=t.attributes,n,s,r,o,a;if(!(t.nodeType===eo||e.nodeType===eo)){for(var l=i.length-1;l>=0;l--)n=i[l],s=n.name,r=n.namespaceURI,o=n.value,r?(s=n.localName||s,a=e.getAttributeNS(r,s),a!==o&&(n.prefix==="xmlns"&&(s=n.name),e.setAttributeNS(r,s,o))):(a=e.getAttribute(s),a!==o&&e.setAttribute(s,o));for(var d=e.attributes,c=d.length-1;c>=0;c--)n=d[c],s=n.name,r=n.namespaceURI,r?(s=n.localName||s,t.hasAttributeNS(r,s)||e.removeAttributeNS(r,s)):t.hasAttribute(s)||e.removeAttribute(s)}}var ln,Qd="http://www.w3.org/1999/xhtml",fe=typeof document>"u"?void 0:document,Zd=!!fe&&"content"in fe.createElement("template"),eh=!!fe&&fe.createRange&&"createContextualFragment"in fe.createRange();function th(e){var t=fe.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function ih(e){ln||(ln=fe.createRange(),ln.selectNode(fe.body));var t=ln.createContextualFragment(e);return t.childNodes[0]}function nh(e){var t=fe.createElement("body");return t.innerHTML=e,t.childNodes[0]}function sh(e){return e=e.trim(),Zd?th(e):eh?ih(e):nh(e)}function cn(e,t){var i=e.nodeName,n=t.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 rh(e,t){return!t||t===Qd?fe.createElement(e):fe.createElementNS(t,e)}function oh(e,t){for(var i=e.firstChild;i;){var n=i.nextSibling;t.appendChild(i),i=n}return t}function ns(e,t,i){e[i]!==t[i]&&(e[i]=t[i],e[i]?e.setAttribute(i,""):e.removeAttribute(i))}var to={OPTION:function(e,t){var i=e.parentNode;if(i){var n=i.nodeName.toUpperCase();n==="OPTGROUP"&&(i=i.parentNode,n=i&&i.nodeName.toUpperCase()),n==="SELECT"&&!i.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),i.selectedIndex=-1)}ns(e,t,"selected")},INPUT:function(e,t){ns(e,t,"checked"),ns(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var i=t.value;e.value!==i&&(e.value=i);var n=e.firstChild;if(n){var s=n.nodeValue;if(s==i||!i&&s==e.placeholder)return;n.nodeValue=i}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var i=-1,n=0,s=e.firstChild,r,o;s;)if(o=s.nodeName&&s.nodeName.toUpperCase(),o==="OPTGROUP")r=s,s=r.firstChild,s||(s=r.nextSibling,r=null);else{if(o==="OPTION"){if(s.hasAttribute("selected")){i=n;break}n++}s=s.nextSibling,!s&&r&&(s=r.nextSibling,r=null)}e.selectedIndex=i}}},xi=1,io=11,no=3,so=8;function lt(){}function ah(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function lh(e){return function(i,n,s){if(s||(s={}),typeof n=="string")if(i.nodeName==="#document"||i.nodeName==="HTML"){var r=n;n=fe.createElement("html"),n.innerHTML=r}else if(i.nodeName==="BODY"){var o=n;n=fe.createElement("html"),n.innerHTML=o;var a=n.querySelector("body");a&&(n=a)}else n=sh(n);else n.nodeType===io&&(n=n.firstElementChild);var l=s.getNodeKey||ah,d=s.onBeforeNodeAdded||lt,c=s.onNodeAdded||lt,u=s.onBeforeElUpdated||lt,m=s.onElUpdated||lt,p=s.onBeforeNodeDiscarded||lt,h=s.onNodeDiscarded||lt,g=s.onBeforeElChildrenUpdated||lt,y=s.skipFromChildren||lt,E=s.addChild||function(_,P){return _.appendChild(P)},T=s.childrenOnly===!0,C=s.keyedRoot===!0,f=Object.create(null),x=[];function S(_){x.push(_)}function A(_,P){if(_.nodeType===xi)for(var F=_.firstChild;F;){var D=void 0;P&&(D=l(F))?S(D):(h(F),F.firstChild&&A(F,P)),F=F.nextSibling}}function O(_,P,F){p(_)!==!1&&(P&&P.removeChild(_),h(_),A(_,F))}function b(_){if(_.nodeType===xi||_.nodeType===io)for(var P=_.firstChild;P;){var F=l(P);F&&(f[F]=P),b(P),P=P.nextSibling}}b(i);function k(_){c(_);for(var P=_.firstChild;P;){var F=P.nextSibling,D=l(P);if(D){var $=f[D];$&&cn(P,$)?(P.parentNode.replaceChild($,P),H($,P)):k(P)}else k(P);P=F}}function N(_,P,F){for(;P;){var D=P.nextSibling;(F=l(P))?S(F):O(P,_,!0),P=D}}function H(_,P,F){var D=l(P);if(D&&delete f[D],!F){var $=u(_,P);if($===!1||($ instanceof HTMLElement&&(_=$,b(_)),e(_,P),m(_),g(_,P)===!1))return}_.nodeName!=="TEXTAREA"?M(_,P):to.TEXTAREA(_,P)}function M(_,P){var F=y(_,P),D=P.firstChild,$=_.firstChild,ce,se,Ee,ye,me;e:for(;D;){for(ye=D.nextSibling,ce=l(D);!F&&$;){if(Ee=$.nextSibling,D.isSameNode&&D.isSameNode($)){D=ye,$=Ee;continue e}se=l($);var xe=$.nodeType,ge=void 0;if(xe===D.nodeType&&(xe===xi?(ce?ce!==se&&((me=f[ce])?Ee===me?ge=!1:(_.insertBefore(me,$),se?S(se):O($,_,!0),$=me,se=l($)):ge=!1):se&&(ge=!1),ge=ge!==!1&&cn($,D),ge&&H($,D)):(xe===no||xe==so)&&(ge=!0,$.nodeValue!==D.nodeValue&&($.nodeValue=D.nodeValue))),ge){D=ye,$=Ee;continue e}se?S(se):O($,_,!0),$=Ee}if(ce&&(me=f[ce])&&cn(me,D))F||E(_,me),H(me,D);else{var st=d(D);st!==!1&&(st&&(D=st),D.actualize&&(D=D.actualize(_.ownerDocument||fe)),E(_,D),k(D))}D=ye,$=Ee}N(_,$,se);var rt=to[_.nodeName];rt&&rt(_,P)}function K(){for(var _=0,P=x.length;_<P;_++){var F=f[x[_]];F&&O(F,F.parentNode,!1)}}if(C&&!T){var Y=l(i),ne=l(n);if((Y||ne)&&Y!==ne)return n.actualize&&(n=n.actualize(i.ownerDocument||fe)),h(i),i.parentNode&&i.parentNode.replaceChild(n,i),k(n),A(i,!1),K(),n}var q=i,Q=q.nodeType,Se=n.nodeType;if(!T){if(Q===xi)Se===xi?cn(i,n)||(h(i),q=oh(i,rh(n.nodeName,n.namespaceURI))):q=n;else if(Q===no||Q===so){if(Se===Q)return q.nodeValue!==n.nodeValue&&(q.nodeValue=n.nodeValue),q;q=n}}if(q===n)h(i);else{if(n.isSameNode&&n.isSameNode(q))return;H(q,n,T),K()}return!T&&q!==i&&i.parentNode&&(q.actualize&&(q=q.actualize(i.ownerDocument||fe)),i.parentNode.replaceChild(q,i)),q}}var ch=lh(Yd),fs=ch,dn=class{constructor(e,t,i,n,s,r={}){this.view=e,this.liveSocket=e.liveSocket,this.container=t,this.rootID=e.root.i
9d,this.html=i,this.streams=n,this.streamInserts={},this.streamComponentRestore={},this.targetCID=s,this.pendingRemoves=[],this.phxRemove=this.liveSocket.binding("remove"),this.targetContainer=s?v.getComponent(this.view.id,s):t,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(e){this.beforeUpdatedCallbacks.push(e)}afterAdded(e){this.afterAddedCallbacks.push(e)}afterUpdated(e){this.afterUpdatedCallbacks.push(e)}afterPhxChildAdded(e){this.afterPhxChildAddedCallbacks.push(e)}afterDiscarded(e){this.afterDiscardedCallbacks.push(e)}afterTransitionsDiscarded(e){this.afterTransitionsDiscardedCallbacks.push(e)}markPrunableContentForRemoval(){let e=this.liveSocket.binding(vn);v.all(this.container,`[${e}=append] > *, [${e}=prepend] > *`,t=>{t.setAttribute(Hr,"")})}perform(e){let{view:t,liveSocket:i,html:n,container:s}=this,r=(x,S,A,O)=>t.logError(x,S,A,O),o=this.targetContainer;if(this.targetCID){let x=o.closest(`[${G}]`);if(x&&!x.isSameNode(o)){let S=v.private(x,G);
9if(S&&(o=S.querySelector(`[data-phx-component="${this.targetCID}"]`),!o))return}}let a=i.getActiveElement(),{selectionStart:l,selectionEnd:d}=a&&v.hasSelectionRange(a)?a:{},c=i.binding(vn),u=i.binding(ls),m=i.binding(cs),p=i.binding(vd),h=i.binding(Sd),g=[],y=[],E=[],T=[],C=null,f=(x,S,A=this.withChildren)=>{let O={childrenOnly:x.getAttribute(Oe)===null&&!A,keyedRoot:x.getAttribute(Oe)!=null,getNodeKey:b=>!(b instanceof Element)||v.isPhxDestroyed(b)?null:e?b.id:v.private(b,"clientsideIdAttribute")?b.getAttribute(as):b.id||b.getAttribute(as),skipFromChildren:b=>b.getAttribute(c)===un,addChild:(b,k)=>{let{ref:N,streamAt:H}=this.getStreamInsert(k);if(N===void 0)return b.appendChild(k);if(this.setStreamRef(k,N),H===0)b.insertAdjacentElement("afterbegin",k);else if(H===-1){let M=b.lastElementChild;if(M&&!M.hasAttribute(bi)){let K=Array.from(b.children).find(Y=>!Y.hasAttribute(bi));b.insertBefore(k,K??null)}else b.appendChild(k)}else if(H>0){let M=Array.from(b.children)[H];b.insertBefore(k,M)}},onBeforeNodeAdded:b=>{if(!(b instanceof Element))return b;if(this.getStreamInsert(b)?.updateOnly&&!this.streamComponentRestore[b.id])return!1;v.maintainPrivateHooks(b,b,u,m);let k=b;return this.streamComponentRestore[b.id]&&(k=this.streamComponentRestore[b.id],delete this.streamComponentRestore[b.id],f(k,b,!0)),k},onNodeAdded:b=>{if(!(b instanceof Element)){g.push(b);return}this.maybeReOrderStream(b,!0),v.isPortalTemplate(b)&&T.push(()=>this.teleport(b,f)),b instanceof HTMLImageElement&&b.srcset?b.srcset=b.srcset:b instanceof HTMLVideoElement&&b.autoplay&&b.play(),v.isNowTriggerFormExternal(b,p)&&(C=b),(v.isPhxChild(b)&&t.ownsElement(b)||v.isPhxSticky(b)&&t.ownsElement(b.parentNode))&&this.trackAfterPhxChildAdded(b),b.nodeName==="SCRIPT"&&b.hasAttribute(pn)&&(b=this.handleRuntimeHook(b,S)),g.push(b)},onNodeDiscarded:b=>this.onNodeDiscarded(b),onBeforeNodeDiscarded:b=>{if(!(b instanceof Element)||b.getAttribute(Hr)!==null)return!0;if(b.parentElement!==null&&b.id&&v.isPhxUpdate(b.parentElement,c,[un,"append","prepend"])||b.getAttribute(At)||this.maybePendingRemove(b)||this.skipCIDSibling(b))return!1;if(v.isPortalTemplate(b)){let k=document.getElementById(b.content.firstElementChild?.id||"");k&&(k.remove(),O.onNodeDiscarded(k),this.view.dropPortalElementId(k.id))}return!0},onElUpdated:b=>{v.isNowTriggerFormExternal(b,p)&&(C=b),y.push(b),this.maybeReOrderStream(b,!1)},onBeforeElUpdated:(b,k)=>{v.syncPendingAttrs(b,k),v.maintainPrivateHooks(b,k,u,m),v.cleanChildNodes(k,c,r);let N=a&&b.isSameNode(a)&&v.isEditableInput(b),H=N&&this.isChangedSelect(b,k);if(this.skipCIDSibling(k))return this.maybeCloneLockedElement(b,N),this.copyNestedPrivateLock(b,k),this.maybeReOrderStream(b),!1;if(v.isPhxSticky(b))return[ze,Ct,Qe].map(M=>[M,b.getAttribute(M),k.getAttribute(M)]).forEach(([M,K,Y])=>{Y&&K!==Y&&b.setAttribute(M,Y)}),!1;if(v.isIgnored(b,c)||b.form&&b.form.isSameNode(C))return this.trackBeforeUpdated(b,k),v.mergeAttrs(b,k,{isIgnored:v.isIgnored(b,c)}),y.push(b),v.applyStickyOperations(b),!1;if(b.type==="number"&&b.validity&&b.validity.badInput)return!1;if(b=this.maybeCloneLockedElement(b,N),v.isPhxChild(k)){let M=b.getAttribute(ze);return v.mergeAttrs(b,k,{exclude:[Ct]}),M!==""&&b.setAttribute(ze,M),b.setAttribute(Qe,this.rootID),v.applyStickyOperations(b),!1}return this.copyNestedPrivateLock(b,k),v.copyPrivates(k,b),v.isPortalTemplate(k)?(T.push(()=>this.teleport(k,f)),b.content.replaceChildren(k.content.cloneNode(!0)),!1):N&&b.type!=="hidden"&&!H&&!k.hasAttribute(h)?(this.trackBeforeUpdated(b,k),v.mergeFocusedInput(b,k),v.syncAttrsToProps(b),y.push(b),v.applyStickyOperations(b),!1):(H&&b.blur(),v.isPhxUpdate(k,c,["append","prepend"])&&E.push(new Gd(b,k,k.getAttribute(c))),v.syncAttrsToProps(k),v.applyStickyOperations(k),this.trackBeforeUpdated(b,k),b)}};fs(x,S,O)};if(this.trackBeforeUpdated(s,s),i.time("morphdom",()=>{this.streams.forEach(([S,A,O,b])=>{A.forEach(([k,N,H,M])=>{this.streamInserts[k]={ref:S,streamAt:N,limit:H,reset:b,updateOnly:M}}),b!==void 0&&v.all(document,`[${bi}="${S}"]`,k=>{this.removeStreamChildElement(k)}),O.forEach(k=>{let N=document.getElementById(k);N&&this.removeStreamChildElement(N)})}),e&&v.all(this.container,`[${c}=${un}]`).filter(S=>
9this.view.ownsElement(S)).forEach(S=>{Array.from(S.children).forEach(A=>{this.removeStreamChildElement(A,!0)})}),f(o,n);let x=0;for(;T.length>0&&x<5;){let S=T.slice();T=[],S.forEach(A=>A()),x++}this.view.portalElementIds.forEach(S=>{let A=document.getElementById(S);if(A){let O=A.getAttribute(dt);O&&(document.getElementById(O)||(A.remove(),this.onNodeDiscarded(A),this.view.dropPortalElementId(S)))}})}),i.isDebugEnabled()&&(Md(r),Dd(this.streamInserts,r),Array.from(document.querySelectorAll("input[name=id]")).forEach(x=>{x instanceof HTMLInputElement&&x.form&&r("dom.form-input-name-id",`Detected an input with name="id" inside a form! This will cause problems when patching the DOM. 10`,{el:x},{attribution:"app"})})),E.length>0&&i.time("post-morph append/prepend restoration",()=>{E.forEach(x=>x.perform())}),i.silenceEvents(()=>v.restoreFocus(a,l,d)),v.dispatchEvent(document,"phx:update"),g.forEach(x=>this.trackAfterAdded(x)),y.forEach(x=>this.trackAfterUpdated(x)),this.transitionPendingRemoves(),C){i.unload();let x=v.private(C,"submitter");if(x&&x.name&&o.contains(x)){let S=document.createElement("input");S.type="hidden";let A=x.getAttribute("form");A&&S.setAttribute("form",A),S.name=x.name,S.value=x.value,x.parentElement.insertBefore(S,x)}Object.getPrototypeOf(C).submit.call(C)}return!0}trackBeforeUpdated(e,t){this.beforeUpdatedCallbacks.forEach(i=>i(e,t))}trackAfterAdded(e){this.afterAddedCallbacks.forEach(t=>t(e))}trackAfterUpdated(e){this.afterUpdatedCallbacks.forEach(t=>t(e))}trackAfterPhxChildAdded(e){this.afterPhxChildAddedCallbacks.forEach(t=>t(e))}trackAfterDiscarded(e){this.afterDiscardedCallbacks.forEach(t=>t(e))}trackAfterTransitionsDiscarded(e){this.afterTransitionsDiscardedCallbacks.forEach(t=>t(e))}onNodeDiscarded(e){(v.isPhxChild(e)||v.isPhxSticky(e))&&this.liveSocket.destroyViewByEl(e),this.trackAfterDiscarded(e)}maybePendingRemove(e){return e.getAttribute&&e.getAttribute(this.phxRemove)!==null?(this.pendingRemoves.push(e),!0):!1}removeStreamChildElement(e,t=!1){!t&&!this.view.ownsElement(e)||(this.streamInserts[e.id]?(this.streamComponentRestore[e.id]=e,e.remove()):this.maybePendingRemove(e)||(e.remove(),this.onNodeDiscarded(e)))}getStreamInsert(e){return(e.id?this.streamInserts[e.id]:{})||{}}setStreamRef(e,t){v.putSticky(e,bi,i=>i.setAttribute(bi,t))}maybeReOrderStream(e,t=!1){let{ref:i,streamAt:n,reset:s}=this.getStreamInsert(e);if(n!==void 0&&(this.setStreamRef(e,i),!(!s&&!t)&&e.parentElement)){if(n===0)this.moveOrInsertBefore(e.parentElement,e,e.parentElement.firstElementChild);else if(n>0){let r=Array.from(e.parentElement.children),o=r.indexOf(e);if(n>=r.length-1)this.moveOrInsertBefore(e.parentElement,e,null);else{let a=r[n];o>n?this.moveOrInsertBefore(e.parentElement,e,a):this.moveOrInsertBefore(e.parentElement,e,a.nextElementSibling)}}this.maybeLimitStream(e)}}moveOrInsertBefore(e,t,i){if(typeof e.moveBefore=="function")try{e.moveBefore(t,i);return}catch{}e.insertBefore(t,i)}maybeLimitStream(e){let{limit:t}=this.getStreamInsert(e);if(t!==null){let i=Array.from(e.parentElement.children);t<0&&i.length>t*-1?i.slice(0,i.length+t).forEach(n=>this.removeStreamChildElement(n)):t>=0&&i.length>t&&i.slice(t).forEach(n=>this.removeStreamChildElement(n))}}transitionPendingRemoves(){let{pendingRemoves:e,liveSocket:t}=this;e.length>0&&t.transitionRemoves(e,this.view,()=>{e.forEach(i=>{let n=v.firstPhxChild(i);n&&t.destroyViewByEl(n),i.remove()}),this.trackAfterTransitionsDiscarded(e)})}isChangedSelect(e,t){return!(e instanceof HTMLSelectElement)||e.multiple?!1:e.options.length!==t.options.length?!0:(t.value=e.value,!e.isEqualNode(t))}skipCIDSibling(e){return e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute(po)}maybeCloneLockedElement(e,t){if(!e.hasAttribute(Le))return e;let i=new ps(e);if(!e.hasAttribute(G)||this.undoRef!==null&&i.isLockUndoneBy(this.undoRef))return e;v.applyStickyOperations(e);let n=e.hasAttribute(G)?v.private(e,G)||e.cloneNode(!0):null;return n?(v.putPrivate(e,G,n),t?e:n):e}copyNestedPrivateLock(e,t){this.undoRef===null||!v.private(t,G)||v.putPrivate(e,G,v.private(t,G))}indexOf(e,t){return Array.from(e.children).indexOf(t)}teleport(e,t){let i=e.getAttribute(vs),n=document.querySelector(i);if(!n)throw new Error("portal target with selector "+i+" not found");let s=e.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),o;r?(n.contains(r)||n.appendChild(r),o=r):(o=document.createElement(s.tagName),n.appendChild(o)),s.setAttribute(At,this.view.id),s.setAttribute(dt,e.id),t(o,s,!0),s.removeAttribute(At),s.removeAttribute(dt),this.view.pushPortalElementId(s.id)}handleRuntimeHook(e,t){let i=e.getAttribute(pn),n=e.hasAttribute("nonce")?e.getAttribute("nonce"):null;if(e.hasAttribute("nonce")){let r=document.createElement("template");r.innerHTML=t,n=r.content.querySelector(`script[${pn}="${CSS.escape(i)}"]`)?.getAttribute("nonce")??null}let s=document.createElement("script");return s.textContent=e.textContent,v.mergeAttrs(s,e,{isIgnored:!1}),n&&(s.nonce=n),e.replaceWith(s),s}},dh=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),hh=new Set(["'",'"']),bo=(e,t,i)=>{let n,s,r,o,a,l,d,c,u=e.match(/^(\s*(?:<!--.*?-->\s*)*)<([^\s\/>]+)/);if(u===null)throw new Error(`malformed html ${e}`);for(n=u[0].length,r=u[1],a=u[2],l=n,n;n<e.length&&e.charAt(n)!==">";n++)if(e.charAt(n)==="="){let h=e.slice(n-3,n)===" id";n++;let g=e.charAt(n);if(hh.has(g)){let y=n;for(n++,n;n<e.length&&e.charAt(n)!==g;n++);if(h){d=e.slice(y+1,n);break}}}let m=e.length-1;for(s=!1;m>=r.length+a.length;){let h=e.charAt(m);
10if(s)h==="-"&&e.slice(m-3,m)==="<!-"?(s=!1,m-=4):m-=1;else if(h===">"&&e.slice(m-2,m)==="--")s=!0,m-=3;else{if(h===">")break;m-=1}}o=e.slice(m+1,e.length);let p=Object.keys(t).map(h=>t[h]===!0?h:`${h}="${t[h]}"`).join(" ");if(i){let h=d?` id="${d}"`:"";dh.has(a)?c=`<${a}${h}${p===""?"":" "}${p}/>`:c=`<${a}${h}${p===""?"":" "}${p}></${a}>`}else{let h=e.slice(l,m+1);c=`<${a}${p===""?"":" "}${p}${h}`}return[c,r,o]},bn=class{constructor(e,t){this.html="",this.pending=[]}get length(){let e=this.html.length;for(let t=0;t<this.pending.length;t++)e+=this.pending[t].length;return e}write(e){this.html+=e}toString(){return this.html}beginRoot(){this.pending.push(this.html),this.html=""}endRoot(e,t){let[i,n,s]=bo(this.html,e,t);this.html=this.pending.pop()+n+i+s}enter(e,t,i){}exit(){}beginKeyedEntry(e){}endKeyedEntry(){}},ss=Symbol("all changed"),uh=class extends bn{constructor(e,t){super(e,t),this.frames=[],this.cursors=[],this.diff=this.cursorFor(e,t)}static preMerge(e){return go(e)}cursorFor(e,t){if(e)return t===null?e:e[ue]&&e[ue][t]}onEnter(e){}onExit(e){}currentDiff(){return this.cursors.length>0?this.cursors[this.cursors.length-1]:this.diff}enter(e,t,i){let n=this.diffFor(this.currentDiff(),t),s={node:e,index:t,statics:i,changed:n!==void 0};this.cursors.push(n),this.frames.push(s),this.onEnter(s)}exit(){this.cursors.pop(),this.onExit(this.frames.pop())}beginKeyedEntry(e){this.cursors.push(this.keyedEntry(this.currentDiff(),e))}endKeyedEntry(){this.cursors.pop()}keyedEntry(e,t){let i=this.diffFor(e,z);if(i===ss||i===void 0)return i;let n=i[t];return Array.isArray(n)?n[1]:typeof n=="number"?void 0:n}diffFor(e,t){if(e!=null)return e===ss||e[Ce]!==void 0?ss:e[t]}},ro=class{static extract(e){let{[Xr]:t,[Jr]:i,[Kr]:n}=e;return delete e[Xr],delete e[Jr],delete e[Kr],{diff:e,title:n,reply:t||null,events:i||[]}}constructor(e,t,i=()=>bn){this.viewId=e,this.rendered={},this.magicId=0,this.bufferClass=i,this.initialMerge=!0,this.mergeDiff(t),this.initialMerge=!1}parentViewId(){return this.viewId}toString(e){let{buffer:t,streams:i}=this.recursiveToString(this.rendered,this.rendered[ue],e,!0,{},null);return{buffer:t,streams:i}}recursiveToString(e,t=e[ue],i,n,s,r){i=i?new Set(i):null;let o=this.bufferClass(),[a,l]=this.bufferPreMerge,d=new o(a===o?l:void 0,r),c={buffer:d,components:t,onlyCids:i,streams:new Set};return this.toOutputBuffer(e,null,c,n,s),{buffer:d.toString(),streams:c.streams}}componentCIDs(e){return Object.keys(e[ue]||{}).map(t=>parseInt(t))}isComponentOnlyDiff(e){return e[ue]?Object.keys(e).length===1:!1}getComponent(e,t){return e[ue][t]}resetRender(e){this.rendered[ue][e]&&(this.rendered[ue][e].reset=!0)}mergeDiff(e){let t=this.bufferClass();this.bufferPreMerge=[t,!this.initialMerge&&t.preMerge?t.preMerge(e):void 0];let i=e[ue],n={};if(delete e[ue],this.rendered=this.mutableMerge(this.rendered,e),this.rendered[ue]=this.rendered[ue]||{},i){let s=this.rendered[ue];for(let r in i)i[r]=this.cachedFindComponent(r,i[r],s,i,n);for(let r in i)s[r]=i[r];e[ue]=i}}cachedFindComponent(e,t,i,n,s){if(s[e])return s[e];{let r,o,a=t[Ce];if(ct(a)){let l;a>0?l=this.cachedFindComponent(a,n[a],i,n,s):l=i[-a],o=l[Ce],r=this.cloneMerge(l,t,!0),r[Ce]=o}else r=t[Ce]!==void 0||i[e]===void 0?t:this.cloneMerge(i[e],t,!1);return s[e]=r,r}}mutableMerge(e,t){return t[Ce]!==void 0?t:(this.doMutableMerge(e,t),e)}doMutableMerge(e,t){if(t[z])this.mergeKeyed(e,t);else for(let i in t){let n=t[i],s=e[i];St(n)&&n[Ce]===void 0&&St(s)?this.doMutableMerge(s,n):e[i]=n}e[is]&&(e.newRender=!0)}clone(e){return go(e)}mergeKeyed(e,t){let i=t[z][zr]&&this.clone(e);if(Object.entries(t[z]).forEach(([n,s])=>{if(!(n===Ve||n===zr))if(Array.isArray(s)){let[r,o]=s;e[z][n]=i[z][r],this.doMutableMerge(e[z][n],o)}else if(typeof s=="number"){let r=s;e[z][n]=i[z][r]}else typeof s=="object"&&(e[z][n]||(e[z][n]={}),this.doMutableMerge(e[z][n],s))}),t[z][Ve]<e[z][Ve])for(let n=t[z][Ve];n<e[z][Ve];n++)delete e[z][n];e[z][Ve]=t[z][Ve],t[Jt]&&(e[Jt]=t[Jt]),t[at]&&(e[at]=t[at])}cloneMerge(e,t,i){let n;if(t[z])n=this.clone(e),this.mergeKeyed(n,t),i&&this.pruneInternalIds(n);else{n={...e,...t};for(let s in n){let r=t[s],o=e[s];St(r)&&r[Ce]===void 0&&St(o)?n[s]=this.cloneMerge(o,r,i):r===void 0&&St(o)&&(n[s]=this.cloneMerge(o,{},i))}}return i?this.deleteInternalIds(n):e[is]&&(n.newRender=!0),n}pruneInternalIds(e){for(let t in e)St(e[t])&&this.pruneInternalIds(e[t]);this.deleteInternalIds(e)}deleteInternalIds(e){delete e.magicId,delete e.newRender}componentToString(e){let{buffer:t,streams:i}=this.recursiveCIDToString(this.rendered[ue],e,null),[n,s,r]=bo(t,{});return{buffer:n,streams:i}}pruneCIDs(e){e.forEach(t=>delete this.rendered[ue][t])}get(){return this.rendered}isNewFingerprint(e={}){return!!e[Ce]}templateStatic(e,t){return typeof e=="number"?t[e]:e}nextMagicID(){return this.magicId++,`m${this.magicId}-${this.parentViewId()}`}toOutputBuffer(e,t,i,n,s={}){if(e[z])return this.comprehensionToBuffer(e,t,i,n);e[at]&&(t=e[at],delete e[at]);let{[Ce]:r}=e;r=this.templateStatic(r,t),e[Ce]=r;let o=e[is];if(o&&i.buffer.beginRoot(),n&&o&&!e.magicId&&(e.newRender=!0,e.magicId=this.nextMagicID()),this.dynamicsToBuffer(e,r,t,i,n),o){let a=!1,l;n||e.magicId?(a=n&&!e.newRender,l={[as]:e.magicId,...s}):l=s,a&&(l[po]=!0),i.buffer.endRoot(l,a),e.newRender=!1}}dynamicsToBuffer(e,t,i,n,s){let r=n.buffer;for(let o=0;o<t.length-1;o++)r.write(t[o]),r.enter(e,o,t),this.dynamicToBuffer(e[o],i,n,s),r.exit();r.write(t[t.length-1])}
10comprehensionToBuffer(e,t,i,n){let s=t||e[at],r=this.templateStatic(e[Ce],t);e[Ce]=r,delete e[at];for(let o=0;o<e[z][Ve];o++)i.buffer.beginKeyedEntry(o),this.dynamicsToBuffer(e[z][o],r,s,i,n),i.buffer.endKeyedEntry();if(e[Jt]){let o=e[Jt],[a,l,d,c]=o||[null,{},[],null];o!==void 0&&(e[z][Ve]>0||d.length>0||c)&&(delete e[Jt],e[z]={[Ve]:0},i.streams.add(o))}}dynamicToBuffer(e,t,i,n){if(typeof e=="number"){let{buffer:s,streams:r}=this.recursiveCIDToString(i.components,e,i.onlyCids);i.buffer.write(s),i.streams=new Set([...i.streams,...r])}else St(e)?this.toOutputBuffer(e,t,i,n,{}):i.buffer.write(e)}recursiveCIDToString(e,t,i){if(e[t]){let n=e[t],s={[Oe]:t,[Gt]:this.viewId},r=i&&!i.has(t);n.newRender=!r,n.magicId=`c${t}-${this.parentViewId()}`;let o=!n.reset,{buffer:a,streams:l}=this.recursiveToString(n,e,i,o,s,t);return delete n.reset,{buffer:a,streams:l}}else throw We("render.missing-component",`no component for CID ${t}`,{cid:t,components:e},{viewId:this.viewId,attribution:"internal"}),new Error("Cannot continue render due to missing component: "+t)}},ki=[],oo=200,ph={exec(e,t,i,n,s,r){let[o,a]=r||[null,{callback:r&&r.callback}];(Array.isArray(i)?i:typeof i=="string"&&i.startsWith("[")?JSON.parse(i):[[o,a]]).forEach(([d,c])=>{d===o&&(c={...a,...c},c.callback=c.callback||a.callback),this.filterToEls(n.liveSocket,s,c).forEach(u=>{this[`exec_${d}`](e,t,i,n,s,u,c)})})},isVisible(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length>0)},isInViewport(e){let t=e.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth;return t.right>0&&t.bottom>0&&t.left<n&&t.top<i},exec_exec(e,t,i,n,s,r,{attr:o,to:a}){let l=r.getAttribute(o);if(!l)throw new Error(`expected ${o} to contain JS command on "${a}"`);n.liveSocket.execJS(r,l,t)},exec_dispatch(e,t,i,n,s,r,{event:o,detail:a,bubbles:l,blocking:d}){if(a=a||{},a.dispatcher=s,d){let c=new Promise((u,m)=>{a.done=u});n.liveSocket.asyncTransition(c)}v.dispatchEvent(r,o,{detail:a,bubbles:l})},exec_push(e,t,i,n,s,r,o){let{event:a,data:l,target:d,page_loading:c,loading:u,value:m,dispatcher:p,callback:h}=o,g={loading:u,value:m,target:d,page_loading:!!c,originalEvent:e},y=t==="change"&&p?p:s,E=d||y.getAttribute(n.binding("target"))||y,T=(C,f)=>{if(C.isConnected())if(t==="change"){let{newCid:x,_target:S}=o;S=S||(v.isFormAssociated(s)?s.name:void 0),S&&(g._target=S),C.pushInput(s,f,x,a||i,g,h)}else if(t==="submit"){let{submitter:x}=o;C.submitForm(s,f,a||i,x,g,h)}else C.pushEvent(t,s,f,a||i,l,g,h)};o.targetView&&o.targetCtx?T(o.targetView,o.targetCtx):n.withinTargets(E,T)},exec_navigate(e,t,i,n,s,r,{href:o,replace:a}){n.liveSocket.historyRedirect(e,o,a?"replace":"push",null,s)},exec_patch(e,t,i,n,s,r,{href:o,replace:a}){n.liveSocket.pushHistoryPatch(e,o,a?"replace":"push",s)},exec_focus(e,t,i,n,s,r){Te.attemptFocus(r),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>Te.attemptFocus(r))})},exec_focus_first(e,t,i,n,s,r){Te.focusFirstInteractive(r)||Te.focusFirst(r),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>Te.focusFirstInteractive(r)||Te.focusFirst(r))})},exec_push_focus(e,t,i,n,s,r){n.isDestroyed()||ki.push({el:r||s,view:n})},exec_pop_focus(e,t,i,n,s,r){if(n.isDestroyed())return;let o=ki.pop();if(o){let{el:a}=o;a.focus(),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>a.focus())})}},dropFocus(e){let t=0;for(let i=ki.length-1;i>=0;i--)ki[i].view===e&&(ki.splice(i,1),t++);return t},exec_add_class(e,t,i,n,s,r,{names:o,transition:a,time:l,blocking:d}){this.addOrRemoveClasses(r,o,[],a,l,n,d)},exec_remove_class(e,t,i,n,s,r,{names:o,transition:a,time:l,blocking:d}){this.addOrRemoveClasses(r,[],o,a,l,n,d)},exec_toggle_class(e,t,i,n,s,r,{names:o,transition:a,time:l,blocking:d}){this.toggleClasses(r,o,a,l,n,d)},exec_toggle_attr(e,t,i,n,s,r,{attr:[o,a,l]}){this.toggleAttr(r,o,a,l)},exec_ignore_attrs(e,t,i,n,s,r,{attrs:o}){this.ignoreAttrs(r,o)},exec_transition(e,t,i,n,s,r,{time:o,transition:a,blocking:l}){this.addOrRemoveClasses(r,[],[],a,o,n,l)},exec_toggle(e,t,i,n,s,r,{display:o,ins:a,outs:l,time:d,blocking:c}){this.toggle(t,n,r,o,a,l,d,c)},exec_show(e,t,i,n,s,r,{display:o,transition:a,time:l,blocking:d}){this.show(t,n,r,o,a,l,d)},exec_hide(e,t,i,n,s,r,{display:o,transition:a,time:l,blocking:d}){this.hide(t,n,r,o,a,l,d)},exec_set_attr(e,t,i,n,s,r,{attr:[o,a]}){this.setOrRemoveAttrs(r,[[o,a]],[])},exec_remove_attr(e,t,i,n,s,r,{attr:o}){this.setOrRemoveAttrs(r,[],[o])},ignoreAttrs(e,t){v.putPrivate(e,"JS:ignore_attrs",{apply:(i,n)=>
10{let s=Array.from(i.attributes),r=s.map(o=>o.name);Array.from(n.attributes).filter(o=>!r.includes(o.name)).forEach(o=>{v.attributeIgnored(o,t)&&n.removeAttribute(o.name)}),s.forEach(o=>{v.attributeIgnored(o,t)&&n.setAttribute(o.name,o.value)})}})},onBeforeElUpdated(e,t){let i=v.private(e,"JS:ignore_attrs");i&&i.apply(e,t)},show(e,t,i,n,s,r,o){this.isVisible(i)||this.toggle(e,t,i,n,s,null,r,o)},hide(e,t,i,n,s,r,o){this.isVisible(i)&&this.toggle(e,t,i,n,null,s,r,o)},toggle(e,t,i,n,s,r,o,a){o=o??oo;let[l,d,c]=s||[[],[],[]],[u,m,p]=r||[[],[],[]];if(l.length>0||u.length>0)if(this.isVisible(i)){let h=()=>{this.addOrRemoveClasses(i,m,l.concat(d).concat(c)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(i,u,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(i,p,m))})},g=()=>{this.addOrRemoveClasses(i,[],u.concat(p)),v.putSticky(i,"toggle",y=>y.style.display="none"),i.dispatchEvent(new Event("phx:hide-end"))};i.dispatchEvent(new Event("phx:hide-start")),a===!1?(h(),setTimeout(g,o)):t.transition(o,h,g)}else{if(e==="remove")return;let h=()=>{this.addOrRemoveClasses(i,d,u.concat(m).concat(p));let y=n||this.defaultDisplay(i);window.requestAnimationFrame(()=>{this.addOrRemoveClasses(i,l,[]),window.requestAnimationFrame(()=>{v.putSticky(i,"toggle",E=>E.style.display=y),this.addOrRemoveClasses(i,c,d)})})},g=()=>{this.addOrRemoveClasses(i,[],l.concat(c)),i.dispatchEvent(new Event("phx:show-end"))};i.dispatchEvent(new Event("phx:show-start")),a===!1?(h(),setTimeout(g,o)):t.transition(o,h,g)}else this.isVisible(i)?window.requestAnimationFrame(()=>{i.dispatchEvent(new Event("phx:hide-start")),v.putSticky(i,"toggle",h=>h.style.display="none"),i.dispatchEvent(new Event("phx:hide-end"))}):window.requestAnimationFrame(()=>{i.dispatchEvent(new Event("phx:show-start"));let h=n||this.defaultDisplay(i);v.putSticky(i,"toggle",g=>g.style.display=h),i.dispatchEvent(new Event("phx:show-end"))})},toggleClasses(e,t,i,n,s,r){window.requestAnimationFrame(()=>{let[o,a]=v.getSticky(e,"classes",[[],[]]),l=t.filter(c=>o.indexOf(c)<0&&!e.classList.contains(c)),d=t.filter(c=>a.indexOf(c)<0&&e.classList.contains(c));this.addOrRemoveClasses(e,l,d,i,n,s,r)})},toggleAttr(e,t,i,n){e.hasAttribute(t)?n!==void 0?e.getAttribute(t)===i?this.setOrRemoveAttrs(e,[[t,n]],[]):this.setOrRemoveAttrs(e,[[t,i]],[]):this.setOrRemoveAttrs(e,[],[t]):this.setOrRemoveAttrs(e,[[t,i]],[])},addOrRemoveClasses(e,t,i,n,s,r,o){s=s??oo;let[a,l,d]=n||[[],[],[]];if(a.length>0){let c=()=>{this.addOrRemoveClasses(e,l,[].concat(a).concat(d)),window.requestAnimationFrame(()=>{this.addOrRemoveClasses(e,a,[]),window.requestAnimationFrame(()=>this.addOrRemoveClasses(e,d,l))})},u=()=>this.addOrRemoveClasses(e,t.concat(d),i.concat(a).concat(l));o===!1?(c(),setTimeout(u,s)):r.transition(s,c,u);return}window.requestAnimationFrame(()=>{let[c,u]=v.getSticky(e,"classes",[[],[]]),m=t.filter(y=>c.indexOf(y)<0&&!e.classList.contains(y)),p=i.filter(y=>u.indexOf(y)<0&&e.classList.contains(y)),h=c.filter(y=>i.indexOf(y)<0).concat(m),g=u.filter(y=>t.indexOf(y)<0).concat(p);v.putSticky(e,"classes",y=>(y.classList.remove(...g),y.classList.add(...h),[h,g]))})},setOrRemoveAttrs(e,t,i){let[n,s]=v.getSticky(e,"attrs",[[],[]]),r=t.map(([l,d])=>l).concat(i),o=n.filter(([l,d])=>!r.includes(l)).concat(t),a=s.filter(l=>!r.includes(l)).concat(i);t.some(([l,d])=>l==="id"&&e.getAttribute("id")!==d)&&v.putPrivate(e,"clientsideIdAttribute",!0),v.putSticky(e,"attrs",l=>
10(a.forEach(d=>l.removeAttribute(d)),o.forEach(([d,c])=>l.setAttribute(d,c)),[o,a]))},hasAllClasses(e,t){return t.every(i=>e.classList.contains(i))},isToggledOut(e,t){return!this.isVisible(e)||this.hasAllClasses(e,t)},filterToEls(e,t,{to:i}){let n=()=>{if(typeof i=="string")return document.querySelectorAll(i);if(i.closest){let s=t.closest(i.closest);return s?[s]:[]}else if(i.inner)return t.querySelectorAll(i.inner)};return i?e.jsQuerySelectorAll(t,i,n):[t]},defaultDisplay(e){return{tr:"table-row",td:"table-cell"}[e.tagName.toLowerCase()]||"block"},transitionClasses(e){if(!e)return null;let[t,i,n]=Array.isArray(e)?e:[e.split(" "),[],[]];return t=Array.isArray(t)?t:t.split(" "),i=Array.isArray(i)?i:i.split(" "),n=Array.isArray(n)?n:n.split(" "),[t,i,n]}},B=ph,yo=(e,t)=>({exec(i,n){e.execJS(i,n,t)},show(i,n={}){let s=e.owner(i);B.show(t,s,i,n.display,B.transitionClasses(n.transition),n.time,n.blocking)},hide(i,n={}){let s=e.owner(i);B.hide(t,s,i,null,B.transitionClasses(n.transition),n.time,n.blocking)},toggle(i,n={}){let s=e.owner(i),r=B.transitionClasses(n.in),o=B.transitionClasses(n.out);B.toggle(t,s,i,n.display,r,o,n.time,n.blocking)},addClass(i,n,s={}){let r=Array.isArray(n)?n:n.split(" "),o=e.owner(i);B.addOrRemoveClasses(i,r,[],B.transitionClasses(s.transition),s.time,o,s.blocking)},removeClass(i,n,s={}){let r=Array.isArray(n)?n:n.split(" "),o=e.owner(i);B.addOrRemoveClasses(i,[],r,B.transitionClasses(s.transition),s.time,o,s.blocking)},toggleClass(i,n,s={}){let r=Array.isArray(n)?n:n.split(" "),o=e.owner(i);B.toggleClasses(i,r,B.transitionClasses(s.transition),s.time,o,s.blocking)},transition(i,n,s={}){let r=e.owner(i);B.addOrRemoveClasses(i,[],[],B.transitionClasses(n),s.time,r,s.blocking)},setAttribute(i,n,s){B.setOrRemoveAttrs(i,[[n,s]],[])},removeAttribute(i,n){B.setOrRemoveAttrs(i,[],[n])},toggleAttribute(i,n,s,r){B.toggleAttr(i,n,s,r)},push(i,n,s={}){e.withinOwners(i,r=>{let o=s.value||{};delete s.value;let a=new CustomEvent("phx:exec",{detail:{sourceElement:i}});B.exec(a,t,n,r,i,["push",{data:o,...s}])})},navigate(i,n={}){Gr(i,"navigate");let s=new CustomEvent("phx:exec");e.historyRedirect(s,i,n.replace?"replace":"push",null,null)},patch(i,n={}){Gr(i,"patch");let s=new CustomEvent("phx:exec");e.pushHistoryPatch(s,i,n.replace?"replace":"push",null)},ignoreAttributes(i,n){B.ignoreAttrs(i,Array.isArray(n)?n:[n])}}),rs="hookId",ao="deadHook",fh=1,Et=class wo{get liveSocket(){return this.__liveSocket()}static makeID(){return fh++}static elementID(t){return v.private(t,rs)}static deadHook(t){return v.private(t,ao)===!0}constructor(t,i,n){if(this.el=i,this.__attachView(t),this.__listeners=new Set,this.__isDisconnected=!1,v.putPrivate(this.el,rs,wo.makeID()),t&&t.isDead&&v.putPrivate(this.el,ao,!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 o in n)Object.prototype.hasOwnProperty.call(n,o)&&(this[o]=n[o],s.has(o)&&console.warn(`Hook object for element #${i.id} overwrites core property '${o}'!`));["mounted","beforeUpdate","updated","destroyed","disconnected","reconnected"].forEach(o=>{n[o]&&typeof n[o]=="function"&&(this[o]=n[o])})}}__attachView(t){t?(this.__view=()=>t,this.__liveSocket=()=>t.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(t){}updated(){}destroyed(){}disconnected(){}reconnected(){}__mounted(){this.mounted()}__updated(){this.updated()}__beforeUpdate(t){this.beforeUpdate(t)}__destroyed(){this.destroyed(),v.deletePrivate(this.el,rs)}__reconnected(){this.__isDisconnected&&(this.__isDisconnected=!1,this.reconnected())}__disconnected(){this.__isDisconnected=!0,this.disconnected()}js(){return{...yo(this.__view().liveSocket,"hook"),exec:t=>{this.__view().liveSocket.execJS(this.el,t,"hook")}}}pushEvent(t,i,n){let s=this.__view().pushHookEvent(this.el,null,t,i||{});if(n===void 0)return s.then(({reply:r})=>r);s.then(({reply:r,ref:o})=>n(r,o),()=>{})}pushEventTo(t,i,n,s){if(s===void 0){let r=[];this.__view().withinTargets(t,(a,l)=>{r.push({view:a,targetCtx:l})});let o=r.map(({view:a,targetCtx:l})=>a.pushHookEvent(this.el,l,i,n||{}));return Promise.allSettled(o)}this.__view().withinTargets(t,(r,o)=>{r.pushHookEvent(this.el,o,i,n||{}).then(({reply:a,ref:l})=>s(a,l),()=>{})})}handleEvent(t,i){let n={event:t,callback:s=>i(s.detail)};return window.addEventListener(`phx:${t}`,n.callback),this.__listeners.add(n),n}removeHandleEvent(t){window.removeEventListener(`phx:${t.event}`,t.callback),this.__listeners.delete(t)}upload(t,i){return this.__view().dispatchUploads(null,t,i)}uploadTo(t,i,n){return this.__view().withinTargets(t,(s,r)=>{s.dispatchUploads(r,i,n)})}
10__cleanup__(){this.__listeners.forEach(t=>this.removeHandleEvent(t))}},mh=(e,t)=>{let i=e.endsWith("[]"),n=i?e.slice(0,-2):e;return n=n.replace(/([^\[\]]+)(\]?$)/,`${t}$1$2`),i&&(n+="[]"),n},gh=class So{static closestView(t){let i=t.closest(Ti);return i?v.private(i,"view"):null}constructor(t,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=t;let o=v.private(this.el,"view");if(o!==void 0&&o.isDead!==!0)throw this.logError("view.duplicate-binding",`The DOM element for this view has already been bound to a view. 11 12 An element can only ever be associated with a single view! 13 Please ensure that you are not trying to initialize multiple LiveSockets on the same page. 14 This could happen if you're accidentally trying to render your root layout more than once. 15 Ensure that the template set on the LiveView is different than the root layout. 16 `,{view:o},{attribution:"app"}),new Error("Cannot bind multiple views to the same DOM element.");v.putPrivate(this.el,"view",this),this.id=this.el.id,this.el.setAttribute(Qe,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.activeUploaders=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(a){a&&a()},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 a=this.href&&this.expandURL(this.href);return{redirect:this.redirect?a:void 0,url:this.redirect?void 0:a||void 0,params:this.connectParams(r),session:this.getSession(),static:this.getStatic(),flash:this.flash??void 0,sticky:this.el.hasAttribute(ds)}}),this.portalElementIds=new Set}setHref(t){this.href=t}setRedirect(t){this.redirect=!0,this.href=t}isMain(){return this.el.hasAttribute(gs)}connectParams(t){let i=this.liveSocket.params(this.el),n=v.all(document,`[${this.binding(fd)}]`).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=t??void 0,this.joinAttempts++,i}isConnected(){return this.channel.canPush()}getSession(){return this.el.getAttribute(ze)}getStatic(){let t=this.el.getAttribute(Ct);return t===""?null:t}destroy(t=function(){}){B.dropFocus(this),this.destroyAllChildren(),this.destroyPortalElements(),this.destroyed=!0,this.activeUploaders.forEach(n=>n.cancel()),this.activeUploaders.clear(),v.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=()=>{t();for(let n in this.viewHooks)this.destroyHook(this.viewHooks[n])};v.markPhxChildDestroyed(this.el),this.log("destroyed",()=>["the child has been removed from the parent"],{code:"view.child-destroyed"}),this.channel.leave().receive("ok",i).receive("error",i).receive("timeout",i)}setContainerClasses(...t){this.el.classList.remove($r,yt,zt,Nr,vi),this.el.classList.add(...t)}showLoader(t){if(this.loaderTimer!=null&&clearTimeout(this.loaderTimer),t)this.loaderTimer=setTimeout(()=>this.showLoader(),t);else{for(let i in this.viewHooks)this.viewHooks[i].__disconnected();this.setContainerClasses(yt)}}execAll(t){v.all(this.el,`[${t}]`,i=>this.liveSocket.execJS(i,i.getAttribute(t)))}hideLoader(){this.loaderTimer!=null&&clearTimeout(this.loaderTimer),this.disconnectedTimer!=null&&clearTimeout(this.disconnectedTimer),this.setContainerClasses($r),this.execAll(this.binding("connected"))}triggerReconnected(){for(let t in this.viewHooks)this.viewHooks[t].__reconnected()}log(t,i,n){this.liveSocket.log(this,t,i,n)}logError(t,i,n,s={attribution:"unknown"}){We(t,i,n,{viewId:this.id??this.el.id,...s})}transition(t,i,n=function(){}){this.liveSocket.transition(t,i,n)}withinTargets(t,i,n=document){if(t instanceof HTMLElement||t instanceof SVGElement)return this.liveSocket.owner(t,s=>i(s,t));if(ct(t))v.findComponent(this.id,t,n)?i(this,typeof t=="number"?t:parseInt(t)):this.logError("event.missing-component-target",`no component found matching phx-target of ${t}`,{target:t});else{let s=Array.from(n.querySelectorAll(t));s.length===0&&this.logError("event.missing-selector-target",`nothing found matching the phx-target selector "${t}"`,{target:t},{attribution:"app"}
16),s.forEach(r=>this.liveSocket.owner(r,o=>i(o,r)))}}applyDiff(t,i,n){let s=fn(i);this.log(t,()=>["received diff",s],{code:`view.diff-${t}`,metadata:()=>({diff:s})});let{diff:r,reply:o,events:a,title:l}=ro.extract(i),d=a.reduce((u,m)=>(m.length===3&&m[2]==!0?u.pre.push(m.slice(0,-1)):u.post.push(m),u),{pre:[],post:[]});this.liveSocket.dispatchEvents(d.pre);let c=()=>{n({diff:r,reply:o,events:d.post}),(typeof l=="string"||t=="mount"&&this.isMain())&&window.requestAnimationFrame(()=>v.putTitle(l))};"onDocumentPatch"in this.liveSocket.domCallbacks?this.liveSocket.triggerDOM("onDocumentPatch",[c]):c()}onJoin(t){let{rendered:i,container:n,liveview_version:s,pid:r}=t;if(n){let[o,a]=n;this.el=v.replaceRootContainer(this.el,o,a),v.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&&we.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(Ed,r),we.dropLocal(this.liveSocket.localStorage,window.location.pathname,lo),this.applyDiff("mount",i,({diff:o,events:a})=>{this.rendered=new ro(this.id,o,()=>this.liveSocket.RenderingBuffer);let[l,d]=this.renderContainer(null,"join");this.dropPendingRefs(),this.joinCount++,this.joinAttempts=0,this.maybeRecoverForms(l,()=>{this.onJoinComplete(t,l,d,a)})})}dropPendingRefs(){v.all(document,`[${Le}="${this.refSrc()}"]`,t=>{t.removeAttribute(Yt),t.removeAttribute(Le),t.removeAttribute(G)})}onJoinComplete({live_patch:t},i,n,s){if(this.joinCount>1||this.parent&&!this.parent.isJoinPending())return this.applyJoinPatch(t,i,n,s);v.findPhxChildrenInFragment(i,this.id).filter(o=>{let a=o.id&&this.el.querySelector(`[id="${o.id}"]`),l=a&&a.getAttribute(Ct);return l&&o.setAttribute(Ct,l),a&&a.setAttribute(Qe,this.root.id),this.joinChild(o)}).length===0?this.parent?(this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(t,i,n,s)]),this.parent.ackJoin(this)):(this.onAllChildJoinsComplete(),this.applyJoinPatch(t,i,n,s)):this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(t,i,n,s)])}attachTrueDocEl(){let t=v.byId(this.id);if(!t)throw new Error("unable to find root element for view");this.el=t,v.putPrivate(this.el,"view",this),this.el.setAttribute(Qe,this.root.id)}execNewMounted(t=document){let i=this.binding(ls),n=this.binding(cs);this.all(t,`[${i}], [${n}]`,s=>{v.maintainPrivateHooks(s,s,i,n),this.maybeAddNewHook(s)}),this.all(t,`[${this.binding(wt)}], [data-phx-${wt}]`,s=>{this.maybeAddNewHook(s)}),this.all(t,`[${this.binding(jr)}]`,s=>{this.maybeMounted(s)})}all(t,i,n){v.all(t,i,s=>{this.ownsElement(s)&&n(s)})}applyJoinPatch(t,i,n,s){this.joinCount>1&&this.pendingJoinOps.length&&(this.pendingJoinOps.forEach(o=>typeof o=="function"&&o()),this.pendingJoinOps=[]),this.attachTrueDocEl();let r=new dn(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(),t){let{kind:o,to:a}=t;this.liveSocket.historyPatch(a,o)}this.hideLoader(),this.joinCount>1&&this.triggerReconnected(),this.stopCallback()}triggerBeforeUpdateHook(t,i){this.liveSocket.triggerDOM("onBeforeElUpdated",[t,i]);let n=this.getHook(t),s=n&&v.isIgnored(t,this.binding(vn));if(n&&!t.isEqualNode(i)&&!(s&&$d(t.dataset,i.dataset)))return n.__beforeUpdate(i),n}maybeMounted(t){let i=t.getAttribute(this.binding(jr)),n=i&&v.private(t,"mounted");i&&!n&&(this.liveSocket.execJS(t,i),v.putPrivate(t,"mounted",!0))}maybeAddNewHook(t){let i=this.addHook(t);i&&i.__mounted()}performPatch(t,i,n=!1){let s=[],r=!1,o=new Set,a=new Set;this.liveSocket.triggerDOM("onPatchStart",[t.targetContainer]),t.afterAdded(c=>{this.liveSocket.triggerDOM("onNodeAdded",[c]);let u=this.binding(ls),m=this.binding(cs);v.maintainPrivateHooks(c,c,u,m),this.maybeAddNewHook(c),c.getAttribute&&this.maybeMounted(c)}),t.afterPhxChildAdded(c=>{v.isPhxSticky(c)?this.liveSocket.joinRootViews():r=!0});
16let l=this.binding(wt),d=`data-phx-${wt}`;return t.beforeUpdated((c,u)=>{let m=this.triggerBeforeUpdateHook(c,u);m?c.hasAttribute(l)&&c.getAttribute(l)!==u.getAttribute(l)?(this.destroyHook(m),u.getAttribute(l)&&a.add(u.id)):o.add(c.id):u.id&&u.getAttribute&&!this.getHook(c)&&(u.getAttribute(l)||u.getAttribute(d))&&a.add(u.id),B.onBeforeElUpdated(c,u)}),t.afterUpdated(c=>{if(o.has(c.id)){let u=this.getHook(c);u&&u.__updated()}else a.has(c.id)&&this.maybeAddNewHook(c)}),t.afterDiscarded(c=>{c.nodeType===Node.ELEMENT_NODE&&s.push(c)}),t.afterTransitionsDiscarded(c=>this.afterElementsRemoved(c,i)),t.perform(n),this.afterElementsRemoved(s,i),this.liveSocket.triggerDOM("onPatchEnd",[t.targetContainer]),r}afterElementsRemoved(t,i){let n=[];t.forEach(s=>{let r=v.all(s,`[${Gt}="${this.id}"][${Oe}]`),o=v.all(s,`[${this.binding(wt)}], [data-phx-hook]`);r.concat(s).forEach(a=>{let l=this.componentID(a);ct(l)&&n.indexOf(l)===-1&&a.getAttribute(Gt)===this.id&&n.push(l)}),o.concat(s).forEach(a=>{let l=this.getHook(a);l&&this.destroyHook(l)})}),i&&this.maybePushComponentsDestroyed(n)}joinNewChildren(){v.findPhxChildren(document,this.id).forEach(t=>this.joinChild(t))}maybeRecoverForms(t,i){let n=this.binding("change"),s=this.root.formsForRecovery,r=document.createElement("template");if(r.innerHTML=t,!r.content.firstElementChild)return i();v.all(r.content,`[${vs}]`).forEach(l=>{l instanceof HTMLTemplateElement&&r.content.firstElementChild?.appendChild(l.content.firstElementChild)});let o=r.content.firstElementChild;o.id=this.id,o.setAttribute(Qe,this.root.id),o.setAttribute(ze,this.getSession()),o.setAttribute(Ct,this.getStatic()??""),this.parent&&o.setAttribute(Tt,this.parent.id),v.putPrivate(o,"view",this);let a=v.all(r.content,"form").filter(l=>l.id&&s[l.id]).filter(l=>!this.pendingForms.has(l.id)).filter(l=>s[l.id].getAttribute(n)===l.getAttribute(n)).map(l=>[s[l.id],l]);if(a.length===0)return i();a.forEach(([l,d],c)=>{this.pendingForms.add(d.id),this.pushFormRecovery(l,d,r.content.firstElementChild,()=>{this.pendingForms.delete(d.id),c===a.length-1&&i()})})}getChildById(t){return this.root.children[this.id][t]}getDescendentByEl(t){return t.id===this.id?this:this.children&&this.children[t.getAttribute(Tt)]?.[t.id]}destroyDescendent(t){for(let i in this.root.children)for(let n in this.root.children[i])if(n===t)return this.root.children[i][n].destroy()}joinChild(t){if(!this.getChildById(t.id)){let n=new So(t,this.liveSocket,this);return this.root.children[this.id][n.id]=n,n.join(),this.childJoins++,!0}}isJoinPending(){return this.joinPending}ackJoin(t){this.childJoins--,this.childJoins===0&&(this.parent?this.parent.ackJoin(this):this.onAllChildJoinsComplete())}onAllChildJoinsComplete(){this.pendingForms.clear(),this.formsForRecovery={},this.joinCallback(()=>{this.pendingJoinOps.forEach(([t,i])=>{t.isDestroyed()||i()}),this.pendingJoinOps=[]})}update(t,i,n=!1){if(this.isJoinPending()||this.liveSocket.hasPendingLink()&&this.root.isMain())return n||this.pendingDiffs.push({diff:t,events:i,joinCount:this.joinCount}),!1;this.rendered.mergeDiff(t);let s=!1;return this.rendered.isComponentOnlyDiff(t)?this.liveSocket.time("component patch complete",()=>{v.findExistingParentCIDs(this.id,this.rendered.componentCIDs(t)).forEach(o=>{this.componentPatch(this.rendered.getComponent(t,o),o)&&(s=!0)})}):Yr(t)||this.liveSocket.time("full patch complete",()=>{let[r,o]=this.renderContainer(t,"update"),a=new dn(this,this.el,r,o,null);s=this.performPatch(a,!0)}),this.liveSocket.dispatchEvents(i),s&&this.joinNewChildren(),!0}renderContainer(t,i){return this.liveSocket.time(`toString diff (${i})`,()=>{let n=this.el.tagName,s=t?this.rendered.componentCIDs(t):null,{buffer:r,streams:o}=this.rendered.toString(s);return[`<${n}>${r}</${n}>`,o]})}componentPatch(t,i){if(Yr(t))return!1;let{buffer:n,streams:s}=this.rendered.componentToString(i),r=new dn(this,this.el,n,s,i);return this.performPatch(r,!0)}getHook(t){return this.viewHooks[Et.elementID(t)]}addHook(t){let i=Et.elementID(t);if(!(t.getAttribute&&!this.ownsElement(t)))if(i&&!this.viewHooks[i]){if(Et.deadHook(t))return;let n=v.getCustomElHook(t)||this.logError("hook.custom-element-missing-hook",`no hook foun
16d for custom element: ${t.id}`,{el:t},{attribution:"app"});return this.viewHooks[i]=n,n.__attachView(this),n}else{if(i||!t.getAttribute)return;{let n=t.getAttribute(`data-phx-${wt}`)||t.getAttribute(this.binding(wt));if(!n)return;let s=this.liveSocket.getHookDefinition(n);if(s){if(!t.id){this.logError("hook.missing-id",`no DOM ID for hook "${n}". Hooks require a unique ID on each element.`,{el:t,hookName:n},{attribution:"app"});return}let r;try{if(typeof s=="function"&&s.prototype instanceof Et)r=new s(this,t);else if(typeof s=="object"&&s!==null)r=new Et(this,t,s);else{this.logError("hook.invalid-definition",`Invalid hook definition for "${n}". Expected a class extending ViewHook or an object definition.`,{el:t,hookName:n},{attribution:"app"});return}}catch(o){let a=o instanceof Error?o.message:String(o);this.logError("hook.creation-failed",`Failed to create hook "${n}": ${a}`,{el:t,hookName:n,error:o},{attribution:"app"});return}return this.viewHooks[Et.elementID(r.el)]=r,r}else n!==null&&this.logError("hook.unknown",`unknown hook foun
16d for "${n}"`,{el:t,hookName:n},{attribution:"app"})}}}destroyHook(t){let i=Et.elementID(t.el);t.__destroyed(),t.__cleanup__(),delete this.viewHooks[i]}applyPendingUpdates(){this.pendingDiffs=this.pendingDiffs.filter(({diff:t,events:i,joinCount:n})=>n!==this.joinCount?(this.log("update",()=>["discarded diff from previous join",t],{code:"view.stale-diff-discarded",metadata:()=>({joinCount:n,currentJoinCount:this.joinCount})}),!1):!this.update(t,i,!0)),this.eachChild(t=>t.applyPendingUpdates())}eachChild(t){let i=this.root.children[this.id]||{};for(let n in i)t(this.getChildById(n))}onChannel(t,i){this.liveSocket.onChannel(this.channel,t,n=>{this.isJoinPending()&&!["redirect","live_redirect"].includes(t)?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",t=>{this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",t,({diff:i,events:n})=>this.update(i,n))})}),this.onChannel("redirect",({to:t,flash:i})=>this.onRedirect({to:t,flash:i})),this.onChannel("live_patch",t=>this.onLivePatch(t)),this.onChannel("live_redirect",t=>this.onLiveRedirect(t)),this.channel.onError(t=>this.onError(t)),this.channel.onClose(t=>this.onClose(t))}destroyAllChildren(){this.eachChild(t=>t.destroy())}onLiveRedirect(t){let{to:i,kind:n,flash:s}=t,r=this.expandURL(i),o=new CustomEvent("phx:server-navigate",{detail:{to:i,kind:n,flash:s}});this.liveSocket.historyRedirect(o,r,n,s)}onLivePatch(t){let{to:i,kind:n}=t;this.href=this.expandURL(i),this.liveSocket.historyPatch(i,n)}expandURL(t){return t.startsWith("/")?`${window.location.protocol}//${window.location.host}${t}`:t}onRedirect({to:t,flash:i,reloadToken:n}){this.liveSocket.redirect(t,i??null,n??null)}isDestroyed(){return this.destroyed}joinDead(){this.isDead=!0}join(t){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(){},t?t(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(t){if(t.events&&this.liveSocket.dispatchEvents(t.events),t.reason==="reload"){this.log("error",()=>[`failed mount with ${t.status}. Falling back to page reload`,t],{code:"view.mount-reload",level:"error",metadata:()=>({status:t.status}),context:{attribution:"app"}}),this.onRedirect({to:this.liveSocket.main.href,reloadToken:t.token});return}else if(t.reason==="unauthorized"||t.reason==="stale"){this.log("error",()=>["unauthorized live_redirect. Falling back to page request",t],{code:"view.unauthorized-live-redirect",level:"error",metadata:()=>({reason:t.reason}),context:{attribution:"app"}}),this.onRedirect({to:this.liveSocket.main.href,flash:this.flash});return}if((t.redirect||t.live_redirect)&&(this.joinPending=!1,this.channel.leave()),t.redirect)return this.onRedirect(t.redirect);if(t.live_redirect)return this.onLiveRedirect(t.live_redirect);let i=t.reason==="timeout",n=i||t.source==="transport"?"network":"app";if(this.log("error",()=>[i?"join timed out":"unable to join",t],{code:i?"view.join-timeout":"view.join-failed",level:"error",metadata:()=>i?{error:t}:{response:t},context:{attribution:n}}),this.isMain())this.displayError([yt,zt,vi],{unstructuredError:t,errorKind:"server"}),this.liveSocket.isConnected()&&this.liveSocket.reloadWithJitter(this);else{if(this.joinAttempts>=ts){this.root.displayError([yt,zt,vi],{unstructuredError:t,errorKind:"server"}),this.log("error",()=>[`giving up trying to mount after ${ts} tries`,t],{code:"view.mount-attempts-exhausted",level:"error",metadata:()=>({attempts:ts,response:t})}),this.destroy();return}let s=v.byId(this.el.id);s?(v.mergeAttrs(s,this.el),this.displayError([yt,zt,vi],{unstructuredError:t,errorKind:"server"}),this.el=s):this.destroy()}}onClose(t){if(!this.isDestroyed()){if(this.isMain()&&this.liveSocket.hasPendingLink()&&t!=="leave")return this.liveSocket.reloadWithJitter(this);this.destroyAllChildren(),this.liveSocket.dropActiveElement(this),this.liveSocket.isUnloaded()&&this.showLoader(Td)}}onError(t){this.onClose(t),this.liveSocket.isConnected()&&this.log("error",()=>["view crashed",t],{code:"view.crashed",level:"error",metadata:()=>({reason:t}),context:{attribution:"app"}}),this.liveSocket.isUnloaded()||(this.liveSocket.isConnected()?this.displayError([yt,zt,vi],{unstructuredError:t,errorKind:"server"}):this.displayError([yt,zt,Nr],{unstructuredError:t,errorKind:"client"}))}displayError(t,i={}){this.isMain()&&v.dispatchEvent(window,"phx:page-loading-start",{detail:{to:this.href,kind:"error",...i}}),this.showLoader(),this.setContainerClasses(...t),this.delayedDisconnected()}delayedDisconnected(){this.disconnectedTimer=setTimeout(()=>{this.execAll(this.binding("disconnected"))},this.liveSocket.disconnectedTimeout)}wrapPush(t,i){let n=this.liveSocket.getLatencySim(),s=n?r=>setTimeout(()=>!this.isDestroyed()&&r(),n):r=>!this.isDestroyed()&&r();s(()=>{t().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(t,i,n){if(!this.isConnected())return Promise.resolve({type:"error",error:"no connection",context:{attribution:"network"}});let[s,[r],o]=t?t({payload:n}):[null,[],{}],a=this.joinCount,l=function(){};return o.page_loading&&(l=this.liveSocket.withPageLoading({kind:"element",target:r})),typeof n.cid!="number"&&delete n.cid,new Promise(d=>{this.wrapPush(()=>this.channel.push(i,n,_d),{ok:c=>{s!==null&&(this.lastAckRef=s);let u=m=>{c.redirect&&this.onRedirect(c.redirect),c.live_patch&&this.onLivePatch(c.live_patch),c.live_redirect&&this.onLiveRedirect(c.live_redirect),l(),d({type:"ok",resp:c,reply:m,ref:s})};c.diff?this.liveSocket.requestDOMUpdate(()=>{this.applyDiff("update",c.diff,({diff:m,reply:p,events:h})=>{s!==null&&this.undoRefs(s,n.event),this.update(m,h),u(p)})}):(s!==null&&this.undoRefs(s,n.event),u(null))},error:c=>{l(),d({type:"error",error:`failed with reason: ${JSON.stringify(c)}`,context:{attribution:"app"}})},timeout:()=>{l(),d({type:"error",error:"push timeout",context:{attribution:"network"}}),this.joinCount===a&&this.liveSocket.reloadWithJitter(this,()=>{this.log("timeout",()=>["received timeout while communicating with server. Falling back to hard refresh for recovery"],{code:"view.push-timeout-recovery",level:"error",context:{attribution:"network"}})})}})})}undoRefs(t,i,n){if(!this.isConnected())return;let s=`[${Le}="${this.refSrc()}"]`;n?(n=new Set(n),v.all(document,s,r=>{n&&!n.has(r)||(v.all(r,s,o=>this.undoElRef(o,t,i)),this.undoElRef(r,t,i))})):v.all(document,s,r=>this.undoElRef(r,t,i))}undoElRef(t,i,n){new ps(t).maybeUndo(i,n,r=>{let o=new dn(this,t,r,new Set,null,{undoRef:i}),a=this.performPatch(o,!0);v.all(t,`[${Le}="${this.refSrc()}"]`,l=>this.undoElRef(l,i,n)),a&&this.joinNewChildren()})}refSrc(){return this.el.id}putRef(t,i,n,s={}){let r=this.ref++,o=this.binding(Fr);if(s.loading){let a=v.all(document,s.loading).map(l=>({el:l,lock:!0,loading:!0}));t=t.concat(a)}for(let{el:a,lock:l,loading:d}of t){if(!l&&!d)throw new Error("putRef requires lock or loading");if(a.setAttribute(Le,this.refSrc()),d&&a.setAttribute(Yt,r.toString()),l&&a.setAttribute(G,r.toString()),!d||s.submitter&&!(a===s.submitter||a===s.form))continue;let c=new Promise(h=>{a.addEventListener(`phx:undo-lock:${r}`,()=>h(p),{once:!0})}),u=new Promise(h=>{a.addEventListener(`phx:undo-loading:${r}`,()=>h(p),{once:!0})});a.classList.add(`phx-${n}-loading`);let m=a.getAttribute(o);m!==null&&(a.getAttribute(gn)||a.setAttribute(gn,a.textContent||""),m!==""&&(a.textContent=m),a.setAttribute(Xt,a.getAttribute(Xt)||("disabled"in a?String(a.disabled):"")),a.setAttribute("disabled",""));let p={event:i,eventType:n,ref:r,isLoading:d,isLocked:l,lockElements:t.filter(({lock:h})=>h).map(({el:h})=>h),loadingElements:t.filter(({loading:h})=>h).map(({el:h})=>h),unlock:h=>{h=Array.isArray(h)?h:[h],this.undoRefs(r,i,h)},lockComplete:c,loadingComplete:u,lock:h=>new Promise(g=>
16{if(this.isAcked(r))return g(p);h.setAttribute(G,r),h.setAttribute(Le,this.refSrc()),h.addEventListener(`phx:undo-lock:${r}`,()=>g(p),{once:!0})})};s.payload&&(p.payload=s.payload),s.target&&(p.target=s.target),s.originalEvent&&(p.originalEvent=s.originalEvent),a.dispatchEvent(new CustomEvent("phx:push",{detail:p,bubbles:!0,cancelable:!1})),i&&a.dispatchEvent(new CustomEvent(`phx:push:${i}`,{detail:p,bubbles:!0,cancelable:!1}))}return[r,t.map(({el:a})=>a),s]}isAcked(t){return this.lastAckRef!==null&&this.lastAckRef>=t}componentID(t){let i=t.getAttribute&&t.getAttribute(Oe);return i?parseInt(i):null}targetComponentID(t,i,n={}){if(ct(i))return i;let s=n.target||t.getAttribute(this.binding("target"));return ct(s)?typeof s=="number"?s:parseInt(s):i&&(s!==null||n.target)?this.closestComponentID(i):null}closestComponentID(t){return ct(t)?t:t?Kt(t.closest(`[${Oe}],[${dt}]`),i=>{if(i.hasAttribute(Oe))return this.ownsElement(i)&&this.componentID(i);if(i.hasAttribute(dt)){let n=v.byId(i.getAttribute(dt));return this.closestComponentID(n)}}):null}pushHookEvent(t,i,n,s){if(!this.isConnected())return this.log("hook",()=>["unable to push hook event. LiveView not connected",{event:n,payload:s}],{code:"hook.push-disconnected",metadata:()=>({event:n,payload:s}),context:{attribution:"network"}}),Promise.reject(new Error("unable to push hook event. LiveView not connected"));let r=()=>this.putRef([{el:t,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(o=>{if(o.type==="error")throw new Error("Failed to push hook event: "+o.error);return{reply:o.reply,ref:o.ref}})}extractMeta(t,i,n){let s=this.binding("value-");for(let r=0;r<t.attributes.length;r++){i||(i={});let o=t.attributes[r].name;o.startsWith(s)&&(i[o.replace(s,"")]=t.getAttribute(o))}if(t.value!==void 0&&!(t instanceof HTMLFormElement)&&(i||(i={}),i.value=t.value,t.tagName==="INPUT"&&fo.indexOf(t.type)>=0&&!t.checked&&delete i.value),n){i||(i={});for(let r in n)i[r]=n[r]}return i}serializeForm(t,i={},n=[]){let{submitter:s}=i,r;if(s&&s.name){let m=document.createElement("input");m.type="hidden";let p=s.getAttribute("form");p&&m.setAttribute("form",p),m.name=s.name,m.value=s.value,s.parentElement.insertBefore(m,s),r=m}let o=new FormData(t),a=[];o.forEach((m,p,h)=>{m instanceof File&&a.push(p)}),a.forEach(m=>o.delete(m));let l=new URLSearchParams,{inputsUnused:d,onlyHiddenInputs:c}=Array.from(t.elements).reduce((m,p)=>{if(!v.isFormAssociated(p))return m;let{inputsUnused:h,onlyHiddenInputs:g}=m,y=p.name;if(!y)return m;h[y]===void 0&&(h[y]=!0),g[y]===void 0&&(g[y]=!0);let E=p.hasAttribute(this.binding(qr)),T=v.private(p,mn)||v.private(p,Ci)||E,C=p.type==="hidden";return h[y]=h[y]&&!T,g[y]=g[y]&&C,m},{inputsUnused:{},onlyHiddenInputs:{}}),u=t.hasAttribute(this.binding(qr));for(let[m,p]of o.entries())if(n.length===0||n.indexOf(m)>=0){let h=d[m],g=c[m];!u&&h&&!(s&&s.name==m)&&!g&&l.append(mh(m,"_unused_"),""),typeof p=="string"&&l.append(m,p)}return s&&r&&s.parentElement.removeChild(r),l.toString()}pushEvent(t,i,n,s,r,o={},a){this.pushWithReply(l=>this.putRef([{el:i,loading:!0,lock:!0}],s,t,{...o,payload:l?.payload}),"event",{type:t,event:s,value:this.extractMeta(i,r,o.value),cid:this.targetComponentID(i,n,o)}).then(l=>{l.type==="ok"?a&&a(l.reply):this.logError("event.push-failed","Failed to push event",{error:l.error,type:t,phxEvent:s,el:i},l.context)})}pushFileProgress(t,i,n,s=function(){}){this.liveSocket.withinOwners(t.form,(r,o)=>{r.pushWithReply(null,"progress",{event:t.getAttribute(r.binding(kd)),ref:t.getAttribute(Ze),entry_ref:i,progress:n,cid:r.targetComponentID(t.form,o)}).then(a=>{a.type==="ok"?s():r.logError("upload.progress-push-failed","Failed to push file progress",{error:a.error,fileEl:t,entryRef:i,progress:n},a.context)})})}pushInput(t,i,n,s,r,o){if(!t.form)throw new Error("form events require the input to be inside a form");let a,l=ct(n)?n:this.targetComponentID(t.form,i,r),d=h=>this.putRef([{el:t,loading:!0,lock:!0},{el:t.form,loading:!0,lock:!0}],s,"change",{...r,payload:h?.payload}),c,u=this.extractMeta(t.form,{},r.value),m={};t instanceof HTMLButtonElement&&(m.submitter=t),t.getAttribute(this.binding("change"))?c=this.serializeForm(t.form,m,[t.name]):c=this.serializeForm(t.form,m),v.isUploadInput(t)&&t.files&&t.files.length>0&&re.trackFiles(t,Array.from(t.files)),a=re.serializeUploads(t);let p={type:"form",event:s,value:c,meta:{_target:r._target||"undefined",...u},uploads:a,cid:l};this.pushWithReply(d,"event",p).then(h=>{h.type==="ok"?v.isUploadInput(t)&&v.isAutoUpload(t)?ps.onUnlock(t,()=>{if(re.filesAwaitingPreflight(t).length>0){let[g,y]=d();this.undoRefs(g,s,[t.form]),this.uploadFiles(t.form,s,i,g,l,E=>{o&&o(h.resp),this.triggerAwaitingSubmit(t.form,s),this.undoRefs(g,s)})}}):o&&o(h.resp):this.logError("event.input-push-failed","Failed to push input event",{error:h.error,
16inputEl:t,phxEvent:s},h.context)})}triggerAwaitingSubmit(t,i){let n=this.getScheduledSubmit(t);if(n){let[s,r,o,a]=n;this.cancelSubmit(t,i),a()}}getScheduledSubmit(t){return this.formSubmits.find(([i,n,s,r])=>i.isSameNode(t))}scheduleSubmit(t,i,n,s){if(this.getScheduledSubmit(t))return!0;this.formSubmits.push([t,i,n,s])}cancelSubmit(t,i){this.formSubmits=this.formSubmits.filter(([n,s,r,o])=>n.isSameNode(t)?(this.undoRefs(s,i),!1):!0)}disableForm(t,i,n={}){let s=h=>!(kt(h,`${this.binding(vn)}=ignore`,h.form)||kt(h,"data-phx-update=ignore",h.form)),r=h=>h.hasAttribute(this.binding(Fr)),o=h=>h.tagName=="BUTTON",a=h=>["INPUT","TEXTAREA"].includes(h.tagName),l=Array.from(t.elements),d=l.filter(r),c=l.filter(o).filter(s),u=l.filter(a).filter(s);c.forEach(h=>{h.setAttribute(Xt,h.disabled.toString()),h.disabled=!0}),u.forEach(h=>{h.setAttribute(hs,h.readOnly.toString()),h.readOnly=!0,h instanceof HTMLInputElement&&h.files&&(h.setAttribute(Xt,h.disabled.toString()),h.disabled=!0)});let m=d.concat(c).concat(u).map(h=>({el:h,loading:!0,lock:!0})),p=[{el:t,loading:!0,lock:!1},...m].reverse();return this.putRef(p,i,"submit",n)}pushFormSubmit(t,i,n,s,r,o){let a=d=>this.disableForm(t,n,{...r,form:t,payload:d?.payload,submitter:s});v.putPrivate(t,"submitter",s);let l=this.targetComponentID(t,i);if(re.hasUploadErrors(t))return this.cancelSubmit(t,n);if(re.hasUploadsInProgress(t)){let[d,c]=a(),u=()=>this.pushFormSubmit(t,i,n,s,r,o);return this.scheduleSubmit(t,d,r,u)}else if(re.inputsAwaitingPreflight(t).length>0){let[d,c]=a(),u=()=>[d,c,r];this.uploadFiles(t,n,i,d,l,m=>{if(re.inputsAwaitingPreflight(t).length>0)return this.undoRefs(d,n);let p=this.extractMeta(t,{},r.value),h=this.serializeForm(t,{submitter:s});this.pushWithReply(u,"event",{type:"form",event:n,value:h,meta:p,cid:l}).then(g=>{g.type==="ok"?o(g.resp):this.logError("event.submit-push-failed","Failed to push form submit",{error:g.error,phxEvent:n,formEl:t},g.context)})})}else if(!(t.hasAttribute(Le)&&t.classList.contains("phx-submit-loading"))){let d=this.extractMeta(t,{},r.value),c=this.serializeForm(t,{submitter:s});this.pushWithReply(a,"event",{type:"form",event:n,value:c,meta:d,cid:l}).then(u=>{u.type==="ok"?o(u.resp):this.logError("event.submit-push-failed","Failed to push form submit",{error:u.error,phxEvent:n,formEl:t},u.context)})}}uploadFiles(t,i,n,s,r,o){let a=this.joinCount,l=re.activeFileInputs(t),d=l.length;l.forEach(c=>{let u=new re(c,this,()=>{this.activeUploaders.delete(u),d--,d===0&&o()});this.activeUploaders.add(u);let m=u.entries().map(h=>h.toPreflightPayload());if(m.length===0){this.activeUploaders.delete(u),d--;return}let p={ref:c.getAttribute(Ze),entries:m,cid:this.targetComponentID(c.form,n)};this.log("upload",()=>["sending preflight request",p],{code:"upload.preflight-request",metadata:()=>({payload:p})}),this.pushWithReply(null,"allow_upload",p).then(h=>{if(h.type==="ok")if(this.log("upload",()=>["got preflight response",h.resp],{code:"upload.preflight-response",metadata:()=>({response:h.resp})}),u.entries().forEach(g=>{h.resp.entries&&!h.resp.entries[g.ref]&&this.handleFailedEntryPreflight(g.ref,"failed preflight",u)}),h.resp.error||Object.keys(h.resp.entries).length===0)this.undoRefs(s,i),(h.resp.error||[]).map(([y,E])=>{this.handleFailedEntryPreflight(y,E,u)}),this.activeUploaders.delete(u);else{let g=y=>{this.channel.onError(()=>{this.joinCount===a&&y()})};u.initAdapterUpload(h.resp,g,this.liveSocket)}else this.activeUploaders.delete(u),this.logError("upload.push-failed","Failed to push upload",{error:h.error,phxEvent:i,formEl:t},h.context)})})}handleFailedEntryPreflight(t,i,n){if(n.isAutoUpload()){let s=n.entries().find(r=>r.ref===t.toString());s&&s.cancel()}else n.entries().map(s=>s.cancel());this.log("upload",()=>[`error for entry ${t}`,i],{code:"upload.preflight-rejected",metadata:()=>({uploadRef:t,reason:i})})}dispatchUploads(t,i,n){let s=this.targetCtxElement(t)||this.el,r=v.findUploadInputs(s).filter(o=>o.name===i);r.length===0?this.logError("upload.input-not-found",`no live file inputs found matching the name "${i}"`,{name:i},{attribution:"app"}):r.length>1?this.logError("upload.duplicate-input",`duplicate live file inputs found matching the name "${i}"`,{name:i,inputs:r},{attribution:"app"}):v.dispatchEvent(r[0],ho,{detail:{files:n}})}targetCtxElement(t){return ct(t)?v.findComponent(this.id,t):t||null}pushFormRecovery(t,i,n,s){let r=this.binding("change"),o=i.getAttribute(this.binding("target"))||i,a=i.getAttribute(this.binding(Br))||i.getAttribute(this.binding("change")),l=Array.from(t.elements).filter(u=>v.isFormAssociated(u)&&u.name&&!u.hasAttribute(r));if(l.length===0){s();return}l.forEach(u=>u.hasAttribute(Ze)&&re.clearFiles(u));let d=l.find(u=>u.type!=="hidden")||l[0],c=0;this.withinTargets(o,(u,m)=>{let p=this.targetComponentID(i,m);c++;let h=new CustomEvent("phx:form-recovery",{detail:{sourceElement:t}});B.exec(h,"change",a,this,d,["push",{_target:d.name,targetView:u,targetCtx:m,newCid:p,callback:()=>{c--,c===0&&s()}}])},n)}pushLinkPatch(t,i,n,s){let r=this.liveSocket.setPendingLink(i),o=t.isTrusted&&t.type!=="popstate",a=n?()=>this.putRef([{el:n,loading:o,lock:!0}],null,"click"):null,l=()=>this.liveSocket.redirect(window.location.href,null,null),d=i.startsWith("/")?`${location.protocol}//${location.host}${i}`:i;this.pushWithReply(a,"live_patch",{url:d}).then(c=>{c.type==="ok"?this.liveSocket.requestDOMUpdate(()=>{if(c.resp.link_redirect)this.liveSocket.replaceMain(i,null,s,r);else{if(c.resp.redirect)return;this.liveSocket.commitPendingLink(r)&&(this.href=i),this.applyPendingUpdates(),s&&s(r)}}):l()})}getFormsForRecovery(){if(this.joinCount===0)return{};let t=this.binding("change");
16return v.all(document,`#${CSS.escape(this.id)} form[${t}], [${At}="${CSS.escape(this.id)}"] form[${t}]`).filter(i=>i instanceof HTMLFormElement).filter(i=>i.id).filter(i=>i.elements.length>0).filter(i=>i.getAttribute(this.binding(Br))!=="ignore").map(i=>{let n=i.cloneNode(!0);fs(n,i,{onBeforeElUpdated:(r,o)=>(v.copyPrivates(r,o),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 o=r.cloneNode(!0);fs(o,r),v.copyPrivates(o,r),o.removeAttribute("form"),n.appendChild(o)}),n}).reduce((i,n)=>(i[n.id]=n,i),{})}maybePushComponentsDestroyed(t){let i=t.filter(s=>v.findComponent(this.id,s)===null),n=(s,r)=>{this.isDestroyed()||this.logError("component.destroy-push-failed","Failed to push components destroyed",{error:s.error,cids:r},s.context)};i.length>0&&(i.forEach(s=>this.rendered.resetRender(s)),this.pushWithReply(null,"cids_will_destroy",{cids:i}).then(s=>{s.type==="ok"?this.liveSocket.requestDOMUpdate(()=>{let r=i.filter(o=>v.findComponent(this.id,o)===null);r.length>0&&this.pushWithReply(null,"cids_destroyed",{cids:r}).then(o=>{o.type==="ok"?this.rendered.pruneCIDs(o.resp.cids):n(o,r)})}):n(s,i)}))}ownsElement(t){let i=v.closestViewEl(t);return t.getAttribute(Tt)===this.id||i&&i.id===this.id||!i&&this.isDead}submitForm(t,i,n,s,r={}){v.putPrivate(t,Ci,!0),Array.from(t.elements).forEach(a=>v.putPrivate(a,Ci,!0)),this.liveSocket.blurActiveElement(),this.pushFormSubmit(t,i,n,s,r,()=>{this.liveSocket.restorePreviouslyActiveFocus()})}binding(t){return this.liveSocket.binding(t)}pushPortalElementId(t){this.portalElementIds.add(t)}dropPortalElementId(t){this.portalElementIds.delete(t)}destroyPortalElements(){this.liveSocket.unloaded||this.portalElementIds.forEach(t=>{let i=document.getElementById(t);i&&i.remove()})}},vh=Object.freeze({RenderingBuffer:bn,ReportingBuffer:uh});var Eo=class{constructor(e,t,i={}){if(this.unloaded=!1,this.buffers=vh,!t||t.constructor.name==="Object")throw new Error(` 17 a phoenix Socket must be provided as the second argument to the LiveSocket constructor. For example: 18 19 import {Socket} from "phoenix" 20 import {LiveSocket} from "phoenix_live_view" 21 let liveSocket = new LiveSocket("/live", Socket, {...}) 22 `);this.socket=new t(e,i),this.bindingPrefix=i.bindingPrefix||Ld,this.params=Si(i.params||{}),this.viewLogger=i.viewLogger,this.metadataCallbacks=i.metadata||{},this.defaults=Object.assign(fn(Id),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=fn(window.location),this.hooks=i.hooks||{},this.uploaders=i.uploaders||{},this.RenderingBuffer=bn,this.loaderTimeout=i.loaderTimeout||Cd,this.disconnectedTimeout=i.disconnectedTimeout||Ad,this.reloadWithJitterTimer=null,this.maxReloads=i.maxReloads||dd,this.reloadJitterMin=i.reloadJitterMin||hd,this.reloadJitterMax=i.reloadJitterMax||ud,this.failsafeJitter=i.failsafeJitter||pd,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.cascadePhxRemoveOnNavigation=i.cascadePhxRemoveOnNavigation??!0,this.serverCloseRef=null,this.domCallbacks=Object.assign({jsQuerySelectorAll:null,onPatchStart:Si(),onPatchEnd:Si(),onNodeAdded:Si(),onBeforeElUpdated:Si()},i.dom||{}),this.transitions=new bh,this.currentHistoryPosition=parseInt(this.sessionStorage.getItem(an)||"0")||0,window.addEventListener("pagehide",n=>{this.unloaded=!0}),this.socket.onOpen(()=>{this.isUnloaded()&&window.location.reload()})}version(){return"1.2.11"}isProfileEnabled(){return this.sessionStorage.getItem(Zn)==="true"}attachDebugBuffer(e){let t=this.RenderingBuffer;return this.RenderingBuffer=e,t}isDebugEnabled(){return this.sessionStorage.getItem(on)==="true"}isDebugDisabled(){return this.sessionStorage.getItem(on)==="false"}enableDebug(){this.sessionStorage.setItem(on,"true")}enableProfiling(){this.sessionStorage.setItem(Zn,"true")}disableDebug(){this.sessionStorage.setItem(on,"false")}disableProfiling(){this.sessionStorage.removeItem(Zn)}enableLatencySim(e){this.enableDebug(),console.log("latency simulator enabled for the duration of this browser session. Call disableLatencySim() to disable"),this.sessionStorage.setItem(es,e.toString())}disableLatencySim(){this.sessionStorage.removeItem(es)}getLatencySim(){let e=this.sessionStorage.getItem(es);return e?parseInt(e):null}getSocket(){return this.socket}connect(){let e=window.location.hostname.toLowerCase();(e==="localhost"||e.endsWith(".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(e){this.reloadWithJitterTimer!=null&&clearTimeout(this.reloadWithJitterTimer),this.serverCloseRef&&(this.socket.off([this.serverCloseRef]),this.serverCloseRef=null),this.socket.disconnect(e)}replaceTransport(e){this.reloadWithJitterTimer!=null&&clearTimeout(this.reloadWithJitterTimer),this.socket.replaceTransport(e),this.connect()}execJS(e,t,i=null){let n=new CustomEvent("phx:exec",{detail:{sourceElement:e}});this.owner(e,s=>B.exec(n,i,t,s,e))}js(){return yo(this,"js")}unload(){this.unloaded||(this.main&&this.isConnected()&&this.log(this.main,"socket",()=>["disconnect for page nav"],{code:"socket.page-navigation-disconnect"}),this.unloaded=!0,this.destroyAllViews(),this.disconnect())}triggerDOM(e,t){this.domCallbacks[e](...t)}time(e,t){if(!this.isProfileEnabled()||!console.time)return t();console.time(e);let i=t();return console.timeEnd(e),i}log(e,t,i,n){let s=this.isDebugEnabled(),r=n?.level??"debug",o=!!n&&(r!=="debug"||s);if(!this.viewLogger&&!s&&!o)return;let[a,l]=i();this.viewLogger?this.viewLogger(e,t,a,l):s&&Hd(e,t,a,l),o&&n&&mo({level:r,code:n.code,message:a,viewId:e.id,metadata:n.metadata?.(),...n.context||{attribution:"unknown"}})}requestDOMUpdate(e){this.transitions.after(e)}asyncTransition(e){this.transitions.addAsyncTransition(e)}transition(e,t,i=function(){}){this.transitions.addTransition(e,t,i)}
22onChannel(e,t,i){e.on(t,n=>{let s=this.getLatencySim();s?setTimeout(()=>i(n),s):i(n)})}reloadWithJitter(e,t){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=we.updateLocal(this.localStorage,window.location.pathname,lo,0,o=>o+1);r>=this.maxReloads&&(s=this.failsafeJitter),this.reloadWithJitterTimer=setTimeout(()=>{e.isDestroyed()||e.isConnected()||(e.destroy(),t?t():this.log(e,"join",()=>[`encountered ${r} consecutive reloads`],{code:"view.reload-attempts",metadata:()=>({tries:r})}),r>=this.maxReloads&&this.log(e,"join",()=>[`exceeded ${this.maxReloads} consecutive reloads. Entering failsafe mode`],{code:"view.reload-failsafe",level:"error",metadata:()=>({tries:r,maxReloads:this.maxReloads})}),this.pendingLink!==null?window.location.href=this.pendingLink:window.location.reload())},s)}getHookDefinition(e){if(e)return this.maybeInternalHook(e)||this.hooks[e]||this.maybeRuntimeHook(e)}maybeInternalHook(e){return e&&e.startsWith("Phoenix.")&&Kd[e.split(".")[1]]}maybeRuntimeHook(e){let t=document.querySelector(`script[${pn}="${CSS.escape(e)}"]`);if(!t)return;let i=window[`phx_hook_${e}`];if(!i||typeof i!="function"){We("hook.runtime-not-function","a runtime hook must be a function",{runtimeHook:t,name:e},{attribution:"app"});return}let n=i();if(n&&(typeof n=="object"||typeof n=="function"))return n;We("hook.runtime-invalid-return","runtime hook must return an object with hook callbacks or an instance of ViewHook",{runtimeHook:t,name:e},{attribution:"app"})}isUnloaded(){return this.unloaded}isConnected(){return this.socket.isConnected()}getBindingPrefix(){return this.bindingPrefix}binding(e){return`${this.getBindingPrefix()}${e}`}channel(e,t){return this.socket.channel(e,t)}joinDeadView(){let e=document.body;if(e&&!this.isPhxView(e)&&!this.isPhxView(document.firstElementChild)){let t=this.newRootView(e);t.setHref(this.getHref()),t.joinDead(),this.main||(this.main=t),window.requestAnimationFrame(()=>{t.execNewMounted(),this.maybeScroll(history.state?.scroll)})}}joinRootViews(){let e=!1;return v.all(document,`${Ti}:not([${Tt}])`,t=>{if(!this.getRootById(t.id)){let i=this.newRootView(t);v.isPhxSticky(t)||i.setHref(this.getHref()),i.join(),t.hasAttribute(gs)&&(this.main=i)}e=!0}),e}redirect(e,t,i){i&&we.setCookie(Ur,i,60),this.unload(),we.redirect(e,t)}replaceMain(e,t,i=null,n=this.setPendingLink(e)){if(!this.main)return;let s=this.currentLocation.href;this.outgoingMainEl=this.outgoingMainEl||this.main.el;let r=v.findPhxSticky(document)||[],o=this.phxRemoveElementsForNavigation(this.outgoingMainEl,r),a=v.cloneNode(this.outgoingMainEl,""),l=this.main;l.showLoader(this.loaderTimeout),l.destroy(),this.main=this.newRootView(a,t,s),this.main.setRedirect(e),this.transitionRemoves(o,l),this.main.join((d,c)=>{d===1&&this.commitPendingLink(n)&&this.requestDOMUpdate(()=>{o.forEach(u=>{u.isSameNode(this.outgoingMainEl)||u.remove()}),r.forEach(u=>a.appendChild(u)),this.outgoingMainEl.replaceWith(a),this.outgoingMainEl=null,i&&i(n),c()})})}phxRemoveElementsForNavigation(e,t=v.findPhxSticky(document)||[]){let i=`[${this.binding("remove")}]`;return(this.cascadePhxRemoveOnNavigation?[e,...v.all(e,i)]:[e]).filter(s=>s.matches(i)&&!v.isChildOfAny(s,t))}transitionRemoves(e,t,i){let n=this.binding("remove"),s=r=>{r.preventDefault(),r.stopImmediatePropagation()};e.forEach(r=>{for(let a of this.boundEventNames)r.addEventListener(a,s,!0);let o=new CustomEvent("phx:exec",{detail:{sourceElement:r}});B.exec(o,"remove",r.getAttribute(n),t,r)}),this.requestDOMUpdate(()=>{e.forEach(r=>{for(let o of this.boundEventNames)r.removeEventListener(o,s,!0)}),i&&i()})}isPhxView(e){return e.getAttribute&&e.getAttribute(ze)!==null}newRootView(e,t,i){let n=new gh(e,this,null,t,i);return this.roots[n.id]=n,n}owner(e,t){let i,n=v.closestViewEl(e);if(n)i=v.private(n,"view");else{if(!e.isConnected)return null;i=this.main}return i&&t?t(i):i}withinOwners(e,t){this.owner(e,i=>t(i,e))}getViewByEl(e){let t=e.getAttribute(Qe);return Kt(this.getRootById(t),i=>i.getDescendentByEl(e))}getRootById(e){return this.roots[e]}destroyAllViews(){for(let e in this.roots)this.roots[e].destroy(),delete this.roots[e];this.main=null}destroyViewByEl(e){let t=this.getRootById(e.getAttribute(Qe));t&&t.id===e.id?(t.destroy(),delete this.roots[t.id]):t&&t.destroyDescendent(e.id)}getActiveElement(){return document.activeElement}dropActiveElement(e){this.prevActive&&e.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:e}={}){if(this.serverCloseRef===null&&(this.serverCloseRef=this.socket.onClose(i=>{if(i&&i.code===1e3&&this.main)return this.reloadWithJitter(this.main)})),this.boundTopLevelEvents)return;this.boundTopLevelEvents=!0,document.body.addEventListener("click",function(){}),window.addEventListener("pageshow",i=>{i.persisted&&(this.getSocket().disconnect(),this.withPageLoading({to:window.location.href,kind:"redirect"}),window.location.reload())},!0),e||this.bindNav(),this.bindClicks(),e||this.bindForms(),this.bind({keyup:"keyup",keydown:"keydown"},(i,n,s,r,o,a)=>{let l=r.getAttribute(this.binding(xd)),d=i.key&&i.key.toLowerCase();if(l&&l.toLowerCase()!==d)return;let c={key:i.key,...this.eventMeta(n,i,r)};B.exec(i,n,o,s,r,["push",{data:c}])}
22),this.bind({blur:"focusout",focus:"focusin"},(i,n,s,r,o,a)=>{if(!a){let l={...this.eventMeta(n,i,r)};B.exec(i,n,o,s,r,["push",{data:l}])}}),this.bind({blur:"blur",focus:"focus"},(i,n,s,r,o,a)=>{if(a==="window"){let l=this.eventMeta(n,i,r);B.exec(i,n,o,s,r,["push",{data:l}])}}),this.on("dragover",i=>i.preventDefault());let t=new WeakMap;this.on("dragenter",i=>{let n=i.target&&v.elementFromTarget(i.target);if(!n)return;let s=kt(n,this.binding(rn));if(!(!s||!(s instanceof HTMLElement))&&Fd(i)){let r=(t.get(s)||0)+1;t.set(s,r),r===1&&this.js().addClass(s,Yn)}}),this.on("dragleave",i=>{let n=i.target&&v.elementFromTarget(i.target);if(!n)return;let s=kt(n,this.binding(rn));if(!s||!(s instanceof HTMLElement))return;let r=t.get(s);r!==void 0&&(r>1?t.set(s,r-1):(t.delete(s),this.js().removeClass(s,Yn)))}),this.on("drop",i=>{let n=i.target&&v.elementFromTarget(i.target);if(!n)return;i.preventDefault();let s=kt(n,this.binding(rn));if(!s||!(s instanceof HTMLElement)||(t.delete(s),this.js().removeClass(s,Yn),!i.dataTransfer))return;let r=s.getAttribute(this.binding(rn)),o=r&&document.getElementById(r),a=Array.from(i.dataTransfer.files||[]);!o||!(o instanceof HTMLInputElement)||o.disabled||a.length===0||!(o.files instanceof FileList)||(re.trackFiles(o,a,i.dataTransfer),o.dispatchEvent(new Event("input",{bubbles:!0})))}),this.on(ho,i=>{let n=i.target&&v.elementFromTarget(i.target);if(!v.isUploadInput(n))return;let s=Array.from(i.detail.files||[]).filter(r=>r instanceof File||r instanceof Blob);re.trackFiles(n,s),n.dispatchEvent(new Event("input",{bubbles:!0}))})}eventMeta(e,t,i){let n=this.metadataCallbacks[e];return n?n(t,i):{}}setPendingLink(e){return this.linkRef++,this.pendingLink=e,this.resetReloadStatus(),this.linkRef}resetReloadStatus(){we.deleteCookie(Ur)}commitPendingLink(e){return this.linkRef!==e?!1:(this.pendingLink!==null&&(this.href=this.pendingLink,this.pendingLink=null),!0)}getHref(){return this.href}hasPendingLink(){return!!this.pendingLink}bind(e,t){for(let i in e){let n=e[i];this.on(n,s=>{let r=this.binding(i),o=this.binding(`window-${i}`),a=s.target instanceof Element&&s.target.getAttribute(r);s.target instanceof Element&&(a?this.debounce(s.target,s,n,()=>{this.withinOwners(s.target,l=>{t(s,i,l,s.target,a,null)})}):v.all(document,`[${o}]`,l=>{let d=l.getAttribute(o);this.debounce(l,s,n,()=>{this.withinOwners(l,c=>{t(s,i,c,l,d,"window")})})}))})}}bindClicks(){this.on("mousedown",e=>this.clickStartedAtTarget=e.target),this.bindClick()}bindClick(){let e=this.binding("click");window.addEventListener("click",t=>{let i=t.target&&v.elementFromTarget(t.target);if(!i)return;t.detail===0&&(this.clickStartedAtTarget=i);let n=this.clickStartedAtTarget||i;if(i=kt(i,e),this.dispatchClickAway(t,n),this.clickStartedAtTarget=null,!i)return;let s=i.getAttribute(e);if(!s){v.isNewPageClick(t,window.location)&&this.unload();return}i.getAttribute("href")==="#"&&t.preventDefault(),!i.hasAttribute(Le)&&this.debounce(i,t,"click",()=>{this.withinOwners(i,r=>{B.exec(t,"click",s,r,i,["push",{data:this.eventMeta("click",t,i)}])})})},!1)}dispatchClickAway(e,t){let i=this.binding("click-away"),n=t.closest(`[${dt}]`),s=n&&v.byId(n.getAttribute(dt));v.all(document,`[${i}]`,r=>{let o=t;n&&!n.contains(r)&&(o=s),r.isSameNode(o)||r.contains(o)||!B.isVisible(t)||this.withinOwners(r,a=>{let l=r.getAttribute(i);B.isVisible(r)&&B.isInViewport(r)&&B.exec(e,"click",l,a,r,["push",{data:this.eventMeta("click",e,e.target)}])})})}bindNav(){if(!we.canPushState())return;history.scrollRestoration&&(history.scrollRestoration="manual");let e=null;window.addEventListener("scroll",t=>{e!=null&&clearTimeout(e),e=setTimeout(()=>{we.updateCurrentState(i=>Object.assign(i,{scroll:window.scrollY}))},100)}),window.addEventListener("popstate",t=>{if(!this.isNewLocation(window.location))return;let{type:i,backType:n,id:s,scroll:r,position:o}=t.state||{},a=window.location.href,l=o>this.currentHistoryPosition,d=l?i:n||i,u={href:a,patch:d==="patch",pop:!0,direction:l?"forward":"backward"};if(!this.dispatchBeforeNavigate(u)){l?history.back():history.forward();return}this.registerNewLocation(window.location),this.currentHistoryPosition=o||0,this.sessionStorage.setItem(an,this.currentHistoryPosition.toString()),v.dispatchEvent(window,"phx:navigate",{detail:u}),this.requestDOMUpdate(()=>{let m=()=>{this.maybeScroll(r)};this.main&&this.main.isConnected()&&d==="patch"&&s===this.main.id?this.main.pushLinkPatch(t,a,null,m):this.replaceMain(a,null,m)})},!1),window.addEventListener("click",t=>{let i=t.target&&v.elementFromTarget(t.target);if(!i)return;let n=kt(i,Qn),s=n&&n.getAttribute(Qn);if(!s||!this.isConnected()||!this.main||v.wantsNewTab(t))return;let r=n.href instanceof SVGAnimatedString?n.href.baseVal:n.href,o=n.getAttribute(Mr);if(o!=="replace"&&o!=="push")throw new Error(`expected ${Mr} to be "replace" or "push", got: ${o}`);if(s!=="patch"&&s!=="redirect")throw new Error(`expected ${Qn} to be "patch" or "redirect", got: ${s}`);if(t.preventDefault(),t.stopImmediatePropagation(),this.pendingLink===r)return;let a={href:r,patch:s==="patch",pop:!1,direction:"forward"},l=n.getAttribute(this.binding("click")),d=()=>{l&&this.requestDOMUpdate(()=>this.execJS(n,l,"click"))};if(!this.dispatchBeforeNavigate(a)){d();return}this.requestDOMUpdate(()=>{s==="patch"?this.pushHistoryPatch(t,r,o,n):this.historyRedirect(t,r,o,null,n),d()})},!1)}maybeScroll(e){typeof e=="number"&&requestAnimationFrame(()=>{window.scrollTo(0,e)})}dispatchEvent(e,t={}){v.dispatchEvent(window,`phx:${e}`,{detail:t})}dispatchEvents(e){e.forEach(([t,i])=>this.dispatchEvent(t,i))}withPageLoading(e,t){v.dispatchEvent(window,"phx:page-loading-start",{detail:e});let i=()=>
22v.dispatchEvent(window,"phx:page-loading-stop",{detail:e});return t?t(i):i}dispatchBeforeNavigate(e){return v.dispatchEvent(window,"phx:before-navigate",{detail:e})}pushHistoryPatch(e,t,i,n){if(!this.isConnected()||!(this.main&&this.main.isMain()))return we.redirect(t);this.withPageLoading({to:t,kind:"patch"},s=>{this.main.pushLinkPatch(e,t,n,r=>{this.historyPatch(t,i,r),s()})})}historyPatch(e,t,i=this.setPendingLink(e)){this.commitPendingLink(i)&&(this.currentHistoryPosition++,this.sessionStorage.setItem(an,this.currentHistoryPosition.toString()),we.updateCurrentState(n=>({...n,backType:"patch"})),we.pushState(t,{type:"patch",id:this.main.id,position:this.currentHistoryPosition},e),v.dispatchEvent(window,"phx:navigate",{detail:{patch:!0,href:e,pop:!1,direction:"forward"}}),this.registerNewLocation(window.location))}historyRedirect(e,t,i,n,s){let r=s&&e.isTrusted&&e.type!=="popstate";if(r&&s.classList.add("phx-click-loading"),!this.isConnected()||!(this.main&&this.main.isMain()))return we.redirect(t,n);if(/^\/$|^\/[^\/]+.*$/.test(t)){let{protocol:a,host:l}=window.location;t=`${a}//${l}${t}`}let o=window.scrollY;this.withPageLoading({to:t,kind:"redirect"},a=>{this.replaceMain(t,n,l=>{l===this.linkRef&&(this.currentHistoryPosition++,this.sessionStorage.setItem(an,this.currentHistoryPosition.toString()),we.updateCurrentState(d=>({...d,backType:"redirect"})),we.pushState(i,{type:"redirect",id:this.main.id,scroll:o,position:this.currentHistoryPosition},t),v.dispatchEvent(window,"phx:navigate",{detail:{href:t,patch:!1,pop:!1,direction:"forward"}}),this.registerNewLocation(window.location)),r&&s.classList.remove("phx-click-loading"),a()})})}registerNewLocation(e){return this.isNewLocation(e)?(this.currentLocation=fn(e),!0):!1}isNewLocation(e){let{pathname:t,search:i}=this.currentLocation;return t+i!==e.pathname+e.search}bindForms(){let e=0,t=!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"));!t&&s&&!n&&(t=!0,i.preventDefault(),this.withinOwners(i.target,r=>{r.disableForm(i.target,s),window.requestAnimationFrame(()=>{v.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){v.isUnloadableFormSubmit(i)&&this.unload();return}i.preventDefault(),this.withinOwners(i.target,s=>{B.exec(i,"submit",n,s,i.target,["push",{submitter:i.submitter}])})});for(let i of["change","input"])this.on(i,n=>{if(!v.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 p=`composition-listener-${i}`;v.private(s,p)||(v.putPrivate(s,p,!0),s.addEventListener("compositionend",()=>{s.dispatchEvent(new Event(i,{bubbles:!0})),v.deletePrivate(s,p)},{once:!0}));return}let o=s.getAttribute(r),a=s.form&&s.form.getAttribute(r),l=o||a;if(!l||s.type==="number"&&s.validity&&s.validity.badInput)return;let d=o?s:s.form,c=e;e++;let{at:u,type:m}=v.private(s,"prev-iteration")||{};u===c-1&&i==="change"&&m==="input"||(v.putPrivate(s,"prev-iteration",{at:c,type:i}),this.debounce(s,n,i,()=>{this.withinOwners(d,p=>{v.putPrivate(s,mn,!0),B.exec(n,"change",l,p,s,["push",{_target:s.name,dispatcher:d}])})}))});this.on("reset",i=>{let n=i.target;v.resetForm(n);let s=Array.from(n.elements).find(r=>"type"in r&&r.type==="reset");s&&window.requestAnimationFrame(()=>{s.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!1}))})})}debounce(e,t,i,n){if(i==="blur"||i==="focusout")return n();let s=this.binding(yd),r=this.binding(wd),o=this.defaults.debounce.toString(),a=this.defaults.throttle.toString();this.withinOwners(e,l=>{let d=()=>!l.isDestroyed()&&document.body.contains(e);v.debounce(e,t,s,o,r,a,d,()=>{n()})})}silenceEvents(e){this.silenced=!0,e(),this.silenced=!1}on(e,t){this.boundEventNames.add(e),window.addEventListener(e,i=>{this.silenced||t(i)})}jsQuerySelectorAll(e,t,i){let n=this.domCallbacks.jsQuerySelectorAll;return n?n(e,t,i):i()}},bh=class{constructor(){this.transitions=new Set,this.promises=new Set,this.pendingOps=[]}
22reset(){this.transitions.forEach(e=>{clearTimeout(e),this.transitions.delete(e)}),this.promises.clear(),this.flushPendingOps()}after(e){this.size()===0?e():this.pushPendingOp(e)}addTransition(e,t,i){t();let n=setTimeout(()=>{this.transitions.delete(n),i(),this.flushPendingOps()},e);this.transitions.add(n)}addAsyncTransition(e){this.promises.add(e),e.then(()=>{this.promises.delete(e),this.flushPendingOps()})}pushPendingOp(e){this.pendingOps.push(e)}size(){return this.transitions.size+this.promises.size}flushPendingOps(){if(this.size()>0)return;let e=this.pendingOps.shift();e&&(e(),this.flushPendingOps())}};var yh={init(){let e=!1,t=null,i=()=>document.getElementById("drawer-panel"),n=()=>{let l=i();return l?.dataset.component==="chat"?l:null},s=l=>{l.scrollTo(l.scrollX,l.scrollHeight)},r=l=>l.scrollHeight-l.scrollTop-l.clientHeight<=50,o=new MutationObserver(()=>{let l=i();!e||!l||l.dataset.component!=="chat"||s(l)}),a=l=>{t!==l&&(o.disconnect(),o.observe(l,{childList:!0,subtree:!0}),t=l)};document.addEventListener("scroll",l=>{l.target?.id==="drawer-panel"&&(e=r(l.target),a(l.target))},!0),window.addEventListener("phx:app-drawer:scrollToPosition",({detail
22:{scroll_top:l}})=>{let d=n();d&&(e=!1,requestAnimationFrame(()=>d.scrollTo(d.scrollX,l)))}),window.addEventListener("phx:app-drawer:scrollBottom",()=>{let l=n();l&&(s(l),e=!0,a(l))}),window.addEventListener("phx:app-drawer:scrollTop",()=>{let l=n();l&&(e=!1,requestAnimationFrame(()=>l.scrollTo(l.scrollX,0)))}),document.addEventListener("app-drawer:opened",()=>{window.Intercom?.("update",{hide_default_launcher:!0})}),document.addEventListener("app-drawer:closed",()=>{window.updateIntercom?.()}),document.addEventListener("notifications-panel:toggled",()=>{if(window.innerWidth>=600)return;let l=document.getElementById("notifications-panel-container");!l||getComputedStyle(l).display==="none"?window.Intercom?.("update",{hide_default_launcher:!0}):window.updateIntercom?.()})}},xo=yh;var wh="chat_input_container",ko="message[context]",Sh={mounted(){this.handler=this.injectMetadata.bind(this),window.addEventListener("submit",this.handler,{capture:!0})},destroyed(){window.removeEventListener("submit",this.handler,{capture:!0})},injectMetadata(e){let t=e.target;if(!(t instanceof HTMLFormElement)||t.id!==wh)return;let i={};try{i=JSON.parse(this.el.dataset.aiContext||"{}")}catch{i={}}let n=i.page||{};i.page={...n,data:{...n.data||{},url:window.location.pathname+window.location.search}};let s=t.querySelector(`input[name="${ko}"]`);s||(s=document.createElement("input"),s.type="hidden",s.name=ko,t.appendChild(s)),s.value=JSON.stringify({page_context:i,message_context:{}})}},Co=Sh;var ws="cas_gpa_state",Eh={mounted(){let e=localStorage.getItem(ws);e&&(localStorage.removeItem(ws),this.pushEvent("restore-state",{state:e})),this.handleEvent("cas-gpa:save-state",({state:t})=>{localStorage.setItem(ws,t)})}},To=Eh;var xh="chat_input_container",kh='input[name="message[message_text]"]',Ch={mounted(){this.handler=this.send.bind(this),this.el.addEventListener("click",this.handler)},destroyed(){this.el.removeEventListener("click",this.handler)},send(e){e.preventDefault();let t=document.getElementById(xh),i=t?.querySelector(kh);!t||!i||(i.value=this.el.dataset.prompt||"",t.requestSubmit())}},Ao=Ch;var Th={mounted(){this.start()},destroyed(){this.stop()},start(){let e=JSON.parse(this.el.dataset.labels||"[]"),t=this.el.querySelector("[data-label]");if(!t||e.length===0)return;for(let s=e.length-1;s>0;s--){let r=Math.floor(Math.random()*(s+1));[e[s],e[r]]=[e[r],e[s]]}let i=0,n=()=>{t.textContent=e[i%e.length],i++};this.timeout=setTimeout(()=>{n(),this.interval=setInterval(n,2500)},500)},stop(){this.timeout&&clearTimeout(this.timeout),this.interval&&clearInterval(this.interval)}},Lo=Th;var Ah="#ai-coach-live",Lh={mounted(){this.handler=this.send.bind(this),this.el.addEventListener("click",this.handler)},destroyed(){this.el.removeEventListener("click",this.handler)},send(e){let t=Ss(this.el.dataset.prompt,""),i=Ss(this.el.dataset.context,{}),n=Ss(this.el.dataset.messageContext,{}),s=this.el.dataset.agent||null;i.page={...i.page||{},url:window.location.pathname+window.location.search};let r={page_context:i,message_context:n};s&&(r.target_agent=s),this.pushEventTo(Ah,"ask",{prompt:t,context:r});let o=document.getElementById("ai-coach-live-inner");o&&o.dataset.openChat&&this.liveSocket.execJS(o,o.dataset.openChat)}};function Ss(e,t){if(!e)return t;try{return JSON.parse(e)}catch{return t}}var _o=Lh;var Io={},_h=["chat","notebook"],Ih={mounted(){this.panel=this.el.querySelector("#drawer-panel"),this.pendingScrollPos=void 0,this.panel.addEventListener("scroll",()=>{if(this.el.dataset.hidden==="true")return;let e=this.panel.dataset.component;e&&(Io[e]=this.panel.scrollTop)}),this.resizeObserver=new ResizeObserver(debounce(()=>{this.pendingScrollPos!==void 0&&(this.panel.scrollTo({top:this.pendingScrollPos,behavior:"instant"}),this.pendingScrollPos=void 0)},200)),this.resizeObserver.observe(this.panel),this._onPageLoadingStop=e=>{e.detail?.kind==="redirect"&&this.js().removeAttribute(this.panel,"data-full-width"),this.scrollToSavedPosition(!0)},window.addEventListener("phx:page-loading-stop",this._onPageLoadingStop),this.updated()},updated(){this.el.dataset.hidden==="true"?this.liveSocket.execJS(this.panel,this.panel.getAttribute("data-close")):this.shouldSkipOpenAnimation()?(this.liveSocket.execJS(this.panel,this.panel.getAttribute("data-open-no-animation")),this.scrollToSavedPosition(!1)):(this.liveSocket.execJS(this.panel,this.panel.getAttribute("data-open")),this.scrollToSavedPosition(!1))},destroyed(){this.resizeObserver.disconnect(),window.removeEventListener("phx:page-loading-stop",this._onPageLoadingStop)},scrollToSavedPosition(e=!1){let t=this.panel.dataset.component;if(!_h.includes(t))return;let i=Io[t];
22i!==void 0&&(this.pendingScrollPos=i,e&&window.requestAnimationFrame(()=>{this.panel.scrollTo({top:this.pendingScrollPos,behavior:"instant"}),this.pendingScrollPos=void 0}))},shouldSkipOpenAnimation(){return this.el.dataset.skipOpenAnimation==="true"}},Po=Ih;var Ro={mounted(){this.scroller=this.el.querySelector("[data-item-nav]"),this.columns=Array.from(this.el.querySelectorAll("[data-nav-item]")),!(!this.scroller||this.columns.length===0)&&(this.onScroll=()=>this.sync(),this.scroller.addEventListener("scroll",this.onScroll,{passive:!0}),this.observer=new ResizeObserver(()=>this.sync()),this.observer.observe(this.scroller),this.observer.observe(this.columns[0]),this.el.addEventListener("click",e=>{let t=e.target.closest("[data-nav-step]");t&&this.step(Number(t.dataset.navStep))}),this.columns.forEach((e,t)=>{e.addEventListener("click",i=>{t===this.active()||i.target.closest("a, button")||(i.preventDefault(),this.scrollTo(t))})}),this.sync())},destroyed(){this.scroller&&this.onScroll&&this.scroller.removeEventListener("scroll",this.onScroll),this.observer&&this.observer.disconnect()},active(){let e=this.scroller.scrollLeft+this.scroller.clientWidth/2,t=0,i=1/0;return this.columns.forEach((n,s)=>{let r=n.offsetLeft+n.offsetWidth/2,o=Math.abs(r-e);o<i&&(i=o,t=s)}),t},scrollTo(e){let t=this.columns[Math.max(0,Math.min(e,this.columns.length-1))],i=t.offsetLeft-(this.scroller.clientWidth-t.offsetWidth)/2;this.scroller.scrollTo({left:i,behavior:"smooth"})},step(e){this.scrollTo(this.active()+e)},sync(){let e=this.scroller.scrollWidth>this.scroller.clientWidth,t=this.active();this.columns.forEach((i,n)=>{i.classList.toggle("opacity-50",e&&n!==t)})}};var Oo={mounted(){this.items=Array.from(this.el.querySelectorAll("[data-proximity-item]")),this.items.length!==0&&(this.reduced=window.matchMedia("(prefers-reduced-motion: reduce)").matches,!this.reduced&&(this.measure(),this.onMove=e=>this.schedule(e),this.onLeave=()=>this.reset(),this.onResize=()=>this.measure(),this.el.addEventListener("pointermove",this.onMove),this.el.addEventListener("pointerleave",this.onLeave),window.addEventListener("resize",this.onResize)))},updated(){this.items=Array.from(this.el.querySelectorAll("[data-proximity-item]")),this.reduced||this.measure()},destroyed(){this.onMove&&this.el.removeEventListener("pointermove",this.onMove),this.onLeave&&this.el.removeEventListener("pointerleave",this.onLeave),this.onResize&&window.removeEventListener("resize",this.onResize),this.frame&&cancelAnimationFrame(this.frame)},measure(){this.centers=this.items.map(e=>({x:e.offsetLeft+e.offsetWidth/2,y:e.offsetTop+e.offsetHeight/2}))},schedule(e){if(this.el.dataset.proximityPaused)return this.reset();this.frame||(this.frame=requestAnimationFrame(()=>{this.frame=null;let t=this.el.getBoundingClientRect();this.apply(e.clientX-t.left,e.clientY-t.top)}))},apply(e,t){let i=this.centers.map(n=>{let s=Math.hypot(n.x-e,n.y-t);if(s>=130)return 0;let r=1-s/130;return r*r});if(i.every(n=>n===0))return this.reset();this.items.forEach((n,s)=>{let r=this.centers[s];if(!r)return;let o=0,a=0;if(this.centers.forEach((l,d)=>{if(d===s||i[d]===0)return;let c=r.x-l.x,u=r.y-l.y,m=Math.hypot(c,u);if(m===0||m>190)return;let p=i[d]*(1-m/190)*32;o+=c/m*p,a+=u/m*p}),i[s]===0&&o===0&&a===0)return this.settle(n);this.transform(n,o,a,1+.4*i[s],Math.round(i[s]*10))})},transform(e,t,i,n,s){e.style.transition="none",e.style.transform=`translate(${t.toFixed(2)}px, ${i.toFixed(2)}px) scale(${n.toFixed(3)})`,e.style.zIndex=s},settle(e){e.style.transform&&(e.style.transition="transform 0.25s ease-out",e.style.transform="",e.style.zIndex="")},reset(){this.frame&&(cancelAnimationFrame(this.frame),this.frame=null),this.items.forEach(e=>this.settle(e))}};var Mo={mounted(){this.place()},updated(){this.place()}
22,place(){let e=document.querySelector(`[data-proximity-item][data-slot="${this.el.dataset.slot}"]`),t=this.el.offsetParent;if(!e||!t)return;let i=e.offsetWidth/2,n=e.offsetHeight/2;for(let s=e;s&&s!==t;s=s.offsetParent)i+=s.offsetLeft,n+=s.offsetTop;this.el.style.setProperty("--card-x",`${Math.round(i)}px`),this.el.style.setProperty("--card-y",`${Math.round(n)}px`)}};var Do={mounted(){this.options=this.getOptions(),this.options.enabled&&(this.instance=new Es(this.el,this.liveSocket))},destroyed(){this.options.enabled&&this.instance.destroyEvents()},updated(){this.options.enabled&&this.instance.updateHeight()},getOptions(){return{enabled:this.el.dataset.autoHeightEnabled==="true"}}},Es=class{throttle=100;lastUpdated=0;marginBottom=20;distanceThreshold=20;observer;autoCleanup=!1;liveSocket;targetElement;constructor(t,i,n={}){this.targetElement=t,this.liveSocket=i,Object.assign(this,n),this.targetElement||console.warn("AutoHeight: Target element not found."),this.updateHeight(),this.setupEvents()}setupEvents(){window.addEventListener("resize",this.updateHeight.bind(this)),this.observer=new MutationObserver(()=>{let t=this.isElementVisible();switch(!0){case t:return this.updateHeight();case(!t&&this.autoCleanup&&this.lastUpdated!==0):return this.destroyEvents()}}),this.observer.observe(this.targetElement,{attributes:!0,attributeFilter:["class","style"]})}destroyEvents(){window.removeEventListener("resize",this.updateHeight.bind(this)),this.observer&&this.observer.disconnect()}updateHeight(){if(!this.targetElement||!this.isElementVisible())return;let t=Date.now();t-this.lastUpdated<this.throttle||(this.lastUpdated=t,requestAnimationFrame(()=>{let i=this.getDistanceToViewportBottom(),n=this.targetElement?.style.height;this.targetElement.style.height="auto";let s=this.targetElement.scrollHeight,r=Math.min(i,s),o=parseFloat(this.targetElement?.style.height)||0;if(this.shouldSkipHeightUpdate(o,r))this.targetElement.style.height=n;else{let a=this.targetElement.getAttribute("style")||"",l=this.updateHeightInStyleString(a,r),d=JSON.stringify([["set_attr",{attr:["style",l]}]]);this.liveSocket.execJSHookPush(this.targetElement,d)}}))}getDistanceToViewportBottom(){if(!this.targetElement)return;let t=this.targetElement?.getBoundingClientRect();if(t.width===0&&t.height===0)return;let i=window.innerHeight;return Math.max(0,i-t.top-this.marginBottom)}shouldSkipHeightUpdate(t,i){return Math.abs(i-t)<this.distanceThreshold}isElementVisible(){return this.targetElement.offsetWidth>0||this.targetElement.offsetHeight>0||this.targetElement.getClientRects().length>0}updateHeightInStyleString(t,i){let n=t.split(";").reduce((s,r)=>{let[o,a]=r.split(":").map(l=>l.trim());return o&&(s[o]=a),s},{});return n.height=`${i}px`,Object.entries(n).map(([s,r])=>`${s}: ${r}`).join("; ")}};var Ph="https://assets.calendly.com/assets/external/widget.css",Rh="https://assets.calendly.com/assets/external/widget.js";function Oh(e){return new Promise((t,i)=>{if(document.querySelector(`script[src="${e}"]`))return t();let n=document.createElement("script");n.src=e,n.async=!0,n.onload=t,n.onerror=i,document.head.appendChild(n)})}function Mh(e){if(document.querySelector(`link[href="${e}"]`))return;let t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t)}var Dh={async mounted(){let e=this.el.dataset.url;if(!e){console.error("CalendlyEmbed: data-url is required");return}Mh(Ph),await Oh(Rh),window.Calendly.initInlineWidget({url:e,parentElement:this.el,resize:!0})},destroyed(){this.el.innerHTML=""}},Ho=Dh;var $o={mounted(){console.log(this.el.id),this.slideLeftButton=this.el.querySelector(`#${this.el.id}-slide-left`),this.slideRightButton=this.el.querySelector(`#${this.el.id}-slide-right`),this.content=this.el.querySelector(`#${this.el.id}-content`),this.content.addEventListener("scroll",()=>this.toggleButtonsVisibility()),this.slideLeftButton.addEventListener("click",()=>this.content.scrollLeft-=200),this.slideRightButton.addEventListener("click",()=>this.content.scrollLeft+=200),this.toggleButtonsVisibility()},toggleButtonsVisibility(){let e=this.content.scrollWidth-this.content.clientWidth;this.content.scrollLeft===0?this.slideLeftButton.style.visibility="hidden":this.slideLeftButton.style.visibility="visible",this.content.scrollLeft>=e?this.slideRightButton.style.visibility="hidden":this.slideRightButton.style.visibility="visible"}};
22var Hh={mounted(){let e=document.getElementById("drawer-panel");e&&(this._panel=e,this._save=()=>{this.pushEventTo("#chats-restore","save_restore_scroll",{scroll_top:e.scrollTop})},this._onScroll=window.debounce(this._save,300),e.addEventListener("scroll",this._onScroll))},destroyed(){this._panel&&this._onScroll&&this._panel.removeEventListener("scroll",this._onScroll)}},No=Hh;var xs=null;async function Ai(){return xs||(xs=import("./echarts-UWRXDYLX.js").then(e=>{let t=e.default||e;return t.registerTheme("app-dark",{backgroundColor:"transparent",textStyle:{color:"#cbd5e1"},legend:{textStyle:{color:"#cbd5e1"}},categoryAxis:{axisLabel:{color:"#94a3b8"},axisLine:{lineStyle:{color:"rgba(255,255,255,0.12)"}},splitLine:{lineStyle:{color:"rgba(255,255,255,0.06)"}},axisTick:{lineStyle:{color:"rgba(255,255,255,0.12)"}}},valueAxis:{axisLabel:{color:"#94a3b8"},axisLine:{lineStyle:{color:"rgba(255,255,255,0.12)"}},splitLine:{lineStyle:{color:"rgba(255,255,255,0.06)"}},axisTick:{lineStyle:{color:"rgba(255,255,255,0.12)"}}}}),t})),xs}function Fo(e){return e?new Date(e+"T12:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):""}var $h={shortenDollars:e=>`${Math.round(e/1e3)}k`,percentSuffix:e=>`${e}%`,kpiShortenDollars:e=>{let t=e/100;return Math.abs(t)>=1e6?`$${(t/1e6).toFixed(1)}M`:Math.abs(t)>=1e3?`$${Math.round(t/1e3)}k`:`$${Math.round(t)}`}},Nh={sectionProgress:e=>{let t=e[0].data;if(t.value===void 0)return"";let i=t.pt_equivalent?`<div class="flex flex-col"> 23 <span class="font-sans font-semibold uppercase text-xs text-content-base">Actual PT<br />equivalent</span> 24 <span class="font-sans text-content-base text-base font-bold -mt-0.5">${t.pt_equivalent}</span> 25 </div>`:"",n=t.br_pt_equivalent&&t.blind_reviewed?`<div class="flex flex-col"> 26 <span class="font-sans font-semibold uppercase text-xs text-review-base">BR PT<br />equivalent</span> 27 <span class="font-sans text-review-base text-base font-bold -mt-0.5">${t.br_pt_equivalent}</span> 28 </div>`:"";return` 29 <div class="p-3 border-2 rounded-xl shadow-sm bg-surface-base"> 30 <div class="flex flex-col gap-1"> 31 <div class="flex flex-row gap-1 items-center"> 32 <a 33 href="${t.results_url}" 34 class="font-sans text-base font-semibold text-button-primary-default hover:text-button-primary-hover" 35 > 36 ${t.section_canonical_id} 37 </a> 38 <span class="font-sans text-content-muted text-base"> 39 ${["preptest","import_manual","import_lawhub","import_classic"].includes(t.practice_source)?"PrepTest":"Section"} 40 </span> 41 </div> 42 <span class="font-sans text-content-muted text-base leading-[1]">${t.practice_completed_at}</span> 43 </div> 44 <div class="w-full h-[2px] bg-border-default my-2"></div> 45 <div class="flex gap-5"> 46 <div class="flex flex-col"> 47 <span class="font-sans text-content-focus text-3xl font-bold">${t.section_score}</span> 48 <span class="font-sans font-semibold uppercase text-content-secondary text-xs"> 49 ${t.actual_correct}/${t.total_questions}<br />correct 50 </span> 51 </div> 52 <div class="flex flex-col gap-2"> 53 <div class="flex flex-col mt-2.5 gap-1"> 54 <span class="${t.blind_reviewed?"text-review-base":"text-content-secondary"} font-accent uppercase leading-[0]">Blind review</span> 55 <div class="space-x-1"> 56 <span class="font-sans ${t.blind_reviewed?"text-review-base":"text-content-secondary"} text-base font-bold"> 57 ${t.blind_reviewed?t.section_blind_review_score:"\u2014"} 58 </span> 59 <span class="font-sans font-semibold text-content-secondary text-xs"> 60 ${t.blind_reviewed?`${t.blind_review_correct}/${t.total_questions}`:""} 61 </span> 62 </div> 63 </div> 64 ${i} 65 ${n} 66 </div> 67 </div> 68 </div> 69 `},drillProgress:e=>{let t=e[0].data;if(t.value===void 0)return"";let i=t.section_type==="LR"?"bg-lr-base":"bg-rc-base",n=t.pt_equivalent?`<div class="flex flex-col">
70 <span class="font-sans font-semibold uppercase text-xs text-content-base">Actual PT<br />equivalent</span> 71 <span class="font-sans text-content-base text-base font-bold -mt-0.5">${t.pt_equivalent}</span> 72 </div>`:"",s=t.br_pt_equivalent&&t.blind_reviewed?`<div class="flex flex-col"> 73 <span class="font-sans font-semibold uppercase text-xs text-review-base">BR PT<br />equivalent</span> 74 <span class="font-sans text-review-base text-base font-bold -mt-0.5">${t.br_pt_equivalent}</span> 75 </div>`:"";return` 76 <div class="p-3 border-2 rounded-xl shadow-sm bg-surface-base"> 77 <div class="flex flex-col gap-1" style="max-width: 170px;"> 78 <span class="text-xxs w-fit text-content-invert font-semibold px-2 py-1 rounded-xl ${i}">${t.section_type}</span> 79 <a 80 href="${t.results_url}" 81 class="font-sans text-base font-semibold text-button-primary-default hover:text-button-primary-hover leading-[1] inline-block text-ellipsis overflow-hidden" 82 > 83 ${t.title} 84 </a> 85 <span class="font-sans text-content-muted text-base leading-[1]">${t.completed_at}</span> 86 </div> 87 <div class="w-full h-[2px] bg-border-default my-2"></div> 88 <div class="flex gap-5"> 89 <div class="flex flex-col"> 90 <span class="font-sans text-content-focus text-3xl font-bold">${t.actual}%</span> 91 <span class="font-sans font-semibold uppercase text-content-secondary text-xs"> 92 ${t.actual_correct}/${t.questions_count}<br />correct 93 </span> 94 </div> 95 <div class="flex flex-col gap-2"> 96 <div class="flex flex-col mt-2.5 gap-1"> 97 <span class="${t.blind_reviewed?"text-review-base":"text-content-secondary"} font-accent uppercase leading-[0]">Blind review</span> 98 <div class="space-x-1"> 99 <span class="font-sans ${t.blind_reviewed?"text-review-base":"text-content-secondary"} text-base font-bold"> 100 ${t.blind_reviewed?`${t.br}%`:"\u2014"} 101 </span> 102 <span class="font-sans font-semibold text-content-secondary text-xs"> 103 ${t.br_correct}/${t.questions_count} 104 </span> 105 </div> 106 </div> 107 ${n} 108 ${s} 109 </div> 110 </div> 111 </div> 112 `},lsatGpaScatter:e=>{let t=e.data;return` 113 <div class="bg-surface-base border-2 rounded-xl shadow-sm flex flex-col font-sans"> 114 <div class="flex flex-col gap-xs p-3"> 115 <div class="flex flex-row gap-md items-center mb-2"> 116 <img src="${t.avatar_url}" alt="${t.username}" class="size-6 rounded-full"> 117 <div class="text-content-focus font-semibold text-lg">${t.username}</div> 118 </div> 119 <p class="text-xs text-content-secondary"><span class="font-semibold">LSAT:</span> <span class="text-content-focus font-bold">${t.value[1]}</span></p> 120 <p class="text-xs text-content-secondary"><span class="font-semibold">GPA:</span> <span class="text-content-focus font-bold">${t.value[0]}</span></p> 121 <p class="text-xs text-content-secondary"><span class="font-semibold">URM:</span> ${t.is_urm}</p> 122 <p class="text-xs text-content-secondary"><span class="font-semibold">Decision:</span> ${t.decision}</p> 123 <p class="text-xs text-content-secondary"><span class="font-semibold">Decision date:</span> ${t.decision_date}</p> 124 </div> 125 <div class="flex p-3 bg-surface-neutral justify-end"> 126 <a href="${t.profile_url}" class="primary-link text-primary-base text-sm font-medium flex items-center"> 127 View profile 128 <span class="ui-pro-chevron-right size-5"></span> 129 </a> 130 </div> 131 </div> 132 `},dollarYoY:e=>{let t=e.filter(i=>(typeof i.data=="object"?i.data?.value:i.data)!=null).map(i=>{let n=typeof i.data=="object",s=n?i.data.value:i.data,r=n&&i.data.date?Fo(i.data.date):"",o=r?`${i.seriesName} (${r})`:i.seriesName,a=(s/100).toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0});return` 133 <span class="inline-block size-2.5 rounded-[4px]" style="background-color:${i.color}"></span>
134 <span class="pl-1">${o}:</span> 135 <span class="font-bold text-base">${a}</span> 136 `});return t.length?`<div class="p-2">${t.join("<br/>")}</div>`:""},subscriptionsYoY:e=>{let t=e.filter(i=>i.data?.value!=null).map(i=>{let n=i.data?.date?Fo(i.data.date):"",s=n?`${i.seriesName}: (${n})`:`${i.seriesName}`;return` 137 <span class="inline-block size-2.5 rounded-[4px]" style="background-color:${i.color}"></span> 138 <span class="pl-1">${s}:</span> 139 <span class="font-bold text-base">${i.value.toLocaleString()}</span> 140 `});return t.length?`<div class="p-2">${t.join("<br/>")}</div>`:""},preptestProgress:e=>{let t=e[0].data;return t.value===void 0?"":` 141 <div class="p-3 border-2 rounded-xl shadow-sm bg-surface-base"> 142 <div class="flex flex-col gap-1"> 143 ${t.show_link?`<a 144 href="${t.results_url}" 145 class="font-sans text-base font-semibold text-button-primary-default hover:text-button-primary-hover leading-[1]" 146 > 147 ${t.pt} 148 </a>`:`<span class="font-sans text-base font-semibold text-content-base leading-[1]">${t.pt}</span>`} 149 <span class="font-sans text-content-muted text-base leading-[1]">${t.completed_at}</span> 150 </div> 151 <div class="w-full h-[2px] bg-border-default my-2"></div> 152 <div class="flex gap-5"> 153 <div class="flex flex-col"> 154 <span class="font-sans text-content-focus text-3xl font-bold">${t.actual}</span> 155 <span class="font-sans font-semibold uppercase text-content-secondary text-xs"> 156 ${t.actual_correct}/${t.total_questions}<br />correct 157 </span> 158 </div> 159 <div class="flex flex-col mt-2.5 gap-1"> 160 <span class="${t.blind_reviewed?"text-review-base":"text-content-secondary"} font-accent uppercase leading-[0]">Blind review</span> 161 <div class="space-x-1"> 162 <span class="font-sans ${t.blind_reviewed?"text-review-base":"text-content-secondary"} text-base font-bold"> 163 ${t.blind_reviewed?t.br:"\u2014"} 164 </span> 165 <span class="font-sans font-semibold text-content-secondary text-xs"> 166 ${t.blind_reviewed?`${t.blind_review_correct}/${t.total_questions}`:""} 167 </span> 168 </div> 169 </div> 170 </div> 171 </div> 172 `},tagScoreProgress:e=>{let t=e[0].data;if(t.value===void 0||t.answered_count===0)return"";let i=t.tag_score!==null?`<span class="font-serif text-lg font-semibold text-content-base leading-[1.2]">${t.tag_score} TagScore</span>`:'<span class="font-serif text-lg font-semibold text-content-muted leading-[1.2]">No estimate</span>';return` 173 <div class="p-3 border-2 rounded-xl shadow-sm bg-surface-base"> 174 <div class="flex flex-col gap-1"> 175 <span class="font-sans font-medium uppercase text-content-secondary text-xs leading-[1.25]">${t.date}</span> 176 ${i} 177 <span class="font-sans text-content-base text-base font-medium leading-[1.5]">${t.accuracy}% accuracy</span> 178 <span class="font-sans text-content-muted text-base leading-[1.5]">${t.correct_count}/${t.answered_count} correct</span> 179 </div> 180 </div> 181 `},labBucket:e=>{let t=e?.data;if(!t)return"";if(t.pt_title!==void 0)return` 182 <div class="p-3 border-2 rounded-xl shadow-sm bg-surface-base"> 183 <div class="font-sans text-base font-semibold text-content-base leading-[1.25]">${ks(t.pt_title)}</div> 184 <div class="font-sans text-content-muted text-base leading-[1.25]">${t.pt_date}</div> 185 <div class="w-full h-[2px] bg-border-default my-2"></div> 186 <div class="flex flex-col"> 187 <span class="font-sans text-content-focus text-3xl font-bold">${t.pt_score}</span> 188 <span class="font-sans font-semibold uppercase text-content-secondary text-xs">actual score</span> 189 </div> 190 </div> 191 `;if(t.actual===void 0)return"";let i=[["50% CI",t.ci_50],["90% CI",t.ci_90]].filter(([,n])=>n).map(([n,s])=>{let r=s.high-s.low;return`<div class="font-sans text-content-secondary text-xs mt-0.5">${n} ${s.low}\u2013${s.high} (${r})</div>`}).join("");return` 192 <div class="p-3 border-2 rounded-xl shadow-sm bg-surface-base"> 193 <div class="font-sans text-content-muted text-base leading-[1.25]">${t.week_label}</div> 194 <div class="w-full h-[2px] bg-border-default my-2"></div> 195 <div class="flex gap-5"> 196 <div class="flex flex-col">
197 <span class="font-sans text-content-focus text-3xl font-bold">${t.actual}</span> 198 <span class="font-sans font-semibold uppercase text-content-secondary text-xs"> 199 ${t.item_count} questions 200 </span> 201 ${i} 202 </div> 203 <div class="flex flex-col mt-2.5 gap-1"> 204 <span class="text-review-base font-accent uppercase leading-[0]">Blind review</span> 205 <span class="font-sans text-review-base text-base font-bold">${t.br??"\u2014"}</span> 206 </div> 207 </div> 208 ${Fh(t.practices)} 209 </div> 210 `},schoolPercentTooltip:e=>{let t=e[0]?.axisValue,i=e.filter(n=>n.value!=null).map(n=>` 211 <div class="flex items-center gap-2 text-sm"> 212 <span class="inline-block size-2.5 rounded-full shrink-0" style="background-color:${n.color}"></span> 213 <span class="text-content-secondary grow">${n.seriesName}</span> 214 <span class="font-bold text-content-focus">${n.value}%</span> 215 </div>`).join("");return` 216 <div class="p-3 border-2 rounded-xl shadow-sm bg-surface-base font-sans min-w-[180px]"> 217 <div class="text-content-muted text-sm mb-2">${t}</div> 218 ${i} 219 </div>`},schoolRankingTooltip:e=>{let t=e[0]?.axisValue,i=e.filter(n=>n.value!=null).map(n=>` 220 <div class="flex items-center gap-2 text-sm"> 221 <span class="inline-block size-2.5 rounded-full shrink-0" style="background-color:${n.color}"></span> 222 <span class="text-content-secondary grow">${n.seriesName}</span> 223 <span class="font-bold text-content-focus">#${n.value}</span> 224 </div>`).join("");return` 225 <div class="p-3 border-2 rounded-xl shadow-sm bg-surface-base font-sans min-w-[180px]"> 226 <div class="text-content-muted text-sm mb-2">${t}</div> 227 ${i} 228 </div>`},schoolNumberTooltip:e=>{let t=e[0]?.axisValue,i=e.filter(n=>n.value!=null).map(n=>` 229 <div class="flex items-center gap-2 text-sm"> 230 <span class="inline-block size-2.5 rounded-full shrink-0" style="background-color:${n.color}"></span> 231 <span class="text-content-secondary grow">${n.seriesName}</span> 232 <span class="font-bold text-content-focus">${n.value}</span> 233 </div>`).join("");return` 234 <div class="p-3 border-2 rounded-xl shadow-sm bg-surface-base font-sans min-w-[180px]"> 235 <div class="text-content-muted text-sm mb-2">${t}</div> 236 ${i} 237 </div>`},chancesTooltip:e=>{let t=e[0]?.axisValue,i=e.filter(n=>n.value!=null).map(n=>` 238 <div class="flex items-center gap-2 text-sm"> 239 <span class="inline-block size-2.5 rounded-full shrink-0" style="background-color:${n.color}"></span> 240 <span class="text-content-secondary grow">${n.seriesName}</span> 241 <span class="font-bold text-content-focus">${n.value}%</span> 242 </div>`).join("");return` 243 <div class="p-3 border-2 rounded-xl shadow-sm bg-surface-base font-sans min-w-[180px]"> 244 <div class="text-content-muted text-sm mb-2">LSAT ${t}</div> 245 ${i} 246 </div>`},tuitionTooltip:e=>{let t=e[0]?.axisValue,i=e.filter(n=>n.value!=null).map(n=>{let s=n.value.toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0});return` 247 <div class="flex items-center gap-2 text-sm"> 248 <span class="inline-block size-2.5 rounded-full shrink-0" style="background-color:${n.color}"></span> 249 <span class="text-content-secondary grow">${n.seriesName||"Tuition"}</span> 250 <span class="font-bold text-content-focus">${s}</span> 251 </div>`}).join("");return` 252 <div class="p-3 border-2 rounded-xl shadow-sm bg-surface-base font-sans min-w-[180px]"> 253 <div class="text-content-muted text-sm mb-2">${t}</div> 254 ${i} 255 </div>`}};function ks(e){return String(e??"").replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}function Fh(e){return e?.length?` 256 <div class="w-full h-[2px] bg-border-default my-2"></div> 257 <div class="flex flex-wrap gap-x-3 gap-y-1 max-w-64 max-h-24 min-h-0 overflow-y-auto">${e.map(i=>`<a href="${ks(i.url)}" class="font-sans text-primary-base text-xs underline underline-offset-2 hover:text-primary-hover">${ks(i.name)}</a>`).join("")}</div> 258 `:""}var Bh={ciBand:(e,t,i)=>{if(e.dataIndex!==0)return;let n=i.data?.[0]?.points;if(!Array.isArray(n)||n.length===0)return;if(n.length===1){let[o,a,l]=n[0],d=Math.max(t.size([1,0])[0]*.15,2),c=t.coord([o,l]),u=t.coord([o,a]);return{type:"polygon",shape:{points:[[c[0]-d,c[1]],[c[0]+d,c[1]],[u[0]+d,u[1]],[u[0]-d,u[1]]]},style:t.style({stroke:null}),silent:!0}}let s=n.map(([o,,a])=>t.coord([o,a])),r=n.map(([o,a])=>t.coord([o,a])).reverse();return{type:"polygon",shape:{points:s.concat(r)},style:t.style({stroke:null}),silent:!0}}},Bo={async mounted(){let e=await Ai(),t=JSON.parse(this.el.dataset.chartOptions);this._chart=e.init(this.el,window.isDarkMode?"app-dark":null),window.addEventListener(`phx:${this.el.id}:option`,i=>{this.setOptions(this._chart,i.detail)}),window.addEventListener(`phx:${this.el.id}:action`,i=>
258{this._chart.dispatchAction(i.detail)}),new ResizeObserver(debounce(()=>this._chart.resize(),200)).observe(this.el),this._onThemeChanged=()=>{let i=JSON.parse(this.el.dataset.chartOptions);this._chart.dispose(),this._chart=e.init(this.el,window.isDarkMode?"app-dark":null),this.setOptions(this._chart,i)},window.addEventListener("theme-changed",this._onThemeChanged),this.setOptions(this._chart,t)},async updated(){let e=await Ai();this._chart||(this._chart=e.getInstanceByDom(this.el));let t=JSON.parse(this.el.dataset.chartOptions);this.setOptions(this._chart,t)},destroyed(){window.removeEventListener("theme-changed",this._onThemeChanged)},setOptions(e,t){t.tooltip&&(t.tooltip.enterable?(t.tooltip.confine??=!1,t.tooltip.position??="top"):t.tooltip.confine??=!0),t.backgroundColor??="transparent";let i=t?.tooltip?.formatter;if(typeof i=="string"&&i.startsWith("fn:")){let s=t.tooltip.formatter.split("fn:")[1];t.tooltip.formatter=Nh[s]}let n=t?.yAxis?.axisLabel?.formatter;if(typeof n=="string"&&n.startsWith("fn:")){let s=n.split("fn:")[1];t.yAxis.axisLabel.formatter=$h[s]}for(let s of t.series||[])if(typeof s.renderItem=="string"&&s.renderItem.startsWith("fn:")){let r=s.renderItem.split("fn:")[1],o=Bh[r];s.renderItem=(a,l)=>o(a,l,s)}e.setOption(t,{notMerge:!0})}};var Wo="http://www.w3.org/2000/svg",Ts=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};function Me(e,t,i,n,s){return{type:"path",ops:yn(e,t,i,n,s)}}function zo(e,t,i){let n=(e||[]).length;if(n>2){let s=[];for(let r=0;r<n-1;r++)s.push(...yn(e[r][0],e[r][1],e[r+1][0],e[r+1][1],i));return t&&s.push(...yn(e[n-1][0],e[n-1][1],e[0][0],e[0][1],i)),{type:"path",ops:s}}return n===2?Me(e[0][0],e[0][1],e[1][0],e[1][1],i):{type:"path",ops:[]}}function qh(e,t,i,n,s){return(function(r,o){return zo(r,!0,o)})([[e,t],[e+i,t],[e+i,t+n],[e,t+n]],s)}function qo(e,t,i,n,s){return(function(r,o,a,l){let[d,c]=Vo(l.increment,r,o,l.rx,l.ry,1,l.increment*As(.1,As(.4,1,a),a),a),u=Uo(d,null,a);if(!a.disableMultiStroke){let[m]=Vo(l.increment,r,o,l.rx,l.ry,1.5,0,a),p=Uo(m,null,a);u=u.concat(p)}return{estimatedPoints:c,opset:{type:"path",ops:u}}})(e,t,s,(function(r,o,a){let l=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(r/2,2)+Math.pow(o/2,2))/2)),d=Math.max(a.curveStepCount,a.curveStepCount/Math.sqrt(200)*l),c=2*Math.PI/d,u=Math.abs(r/2),m=Math.abs(o/2),p=1-a.curveFitting;return u+=ee(u*p,a),m+=ee(m*p,a),{increment:c,rx:u,ry:m}})(i,n,s)).opset}function Jo(e){return e.randomizer||(e.randomizer=new Ts(e.seed||0)),e.randomizer.next()}function As(e,t,i,n=1){return i.roughness*n*(Jo(i)*(t-e)+e)}function ee(e,t,i=1){return As(-e,e,t,i)}function yn(e,t,i,n,s,r=!1){let o=r?s.disableMultiStrokeFill:s.disableMultiStroke,a=jo(e,t,i,n,s,!0,!1);if(o)return a;let l=jo(e,t,i,n,s,!0,!0);return a.concat(l)}function jo(e,t,i,n,s,r,o){let a=Math.pow(e-i,2)+Math.pow(t-n,2),l=Math.sqrt(a),d=1;d=l<200?1:l>500?.4:-.0016668*l+1.233334;let c=s.maxRandomnessOffset||0;c*c*100>a&&(c=l/10);let u=c/2,m=.2+.2*Jo(s),p=s.bowing*s.maxRandomnessOffset*(n-t)/200,h=s.bowing*s.maxRandomnessOffset*(e-i)/200;p=ee(p,s,d),h=ee(h,s,d);let g=[],y=()=>ee(u,s,d),E=()=>ee(c,s,d);return r&&(o?g.push({op:"move",data:[e+y(),t+y()]}):g.push({op:"move",data:[e+ee(c,s,d),t+ee(c,s,d)]})),o?g.push({op:"bcurveTo",data:[p+e+(i-e)*m+y(),h+t+(n-t)*m+y(),p+e+2*(i-e)*m+y(),h+t+2*(n-t)*m+y(),i+y(),n+y()]}):g.push({op:"bcurveTo",data:[p+e+(i-e)*m+E(),h+t+(n-t)*m+E(),p+e+2*(i-e)*m+E(),h+t+2*(n-t)*m+E(),i+E(),n+E()]}),g}function Uo(e,t,i){let n=e.length,s=[];if(n>3){let r=[],o=1-i.curveTightness;s.push({op:"move",data:[e[1][0],e[1][1]]});for(let a=1;a+2<n;a++){let l=e[a];r[0]=[l[0],l[1]],r[1]=[l[0]+(o*e[a+1][0]-o*e[a-1][0])/6,l[1]+(o*e[a+1][1]-o*e[a-1][1])/6],r[2]=[e[a+1][0]+(o*e[a][0]-o*e[a+2][0])/6,e[a+1][1]+(o*e[a][1]-o*e[a+2][1])/6],r[3]=[e[a+1][0],e[a+1][1]],s.push({op:"bcurveTo",data:[r[1][0],r[1][1],r[2][0],r[2][1],r[3][0],r[3][1]]})}if(t&&t.length===2){let a=i.maxRandomnessOffset;s.push({op:"lineTo",data:[t[0]+ee(a,i),t[1]+ee(a,i)]})}}else n===3?(s.push({op:"move",data:[e[1][0],e[1][1]]}),s.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):n===2&&s.push(...yn(e[0][0],e[0][1],e[1][0],e[1][1],i));return s}function Vo(e,t,i,n,s,r,o,a){let l=[],d=[],c=ee(.5,a)-Math.PI/2;d.push([ee(r,a)+t+.9*n*Math.cos(c-e),ee(r,a)+i+.9*s*Math.sin(c-e)]);for(let u=c;u<2*Math.PI+c-.01;u+=e){let m=[ee(r,a)+t+n*Math.cos(u),ee(r,a)+i+s*Math.sin(u)];l.push(m),d.push(m)}return d.push([ee(r,a)+t+n*Math.cos(c+2*Math.PI+.5*o),ee(r,a)+i+s*Math.sin(c+2*Math.PI+.5*o)]),d.push([ee(r,a)+t+.98*n*Math.cos(c+o),ee(r,a)+i+.98*s*Math.sin(c+o)]),d.push([ee(r,a)+t+.9*n*Math.cos(c+.5*o),ee(r,a)+i+.9*s*Math.sin(c+.5*o)]),[d,l]}function Cs(e,t){return{maxRandomnessOffset:2,roughness:e==="highlight"?3:1.5,bowing:1,stroke:"#000",strokeWidth:1.5,curveTightness:0,curveFitting:.95,curveStepCount:6,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,combineNestedSvgPaths:!1,disableMultiStroke:e!=="double",disableMultiStrokeFill:!1,seed:t}}function jh(e,t,i,n,s,r){let o=[],a=i.strokeWidth||2,l=(function(p){let h=p.padding;if(h||h===0){if(typeof h=="number")return[h,h,h,h];if(Array.isArray(h)){let g=h;if(g.length)switch(g.length){case 4:return[...g];case 1:return[g[0],g[0],g[0],g[0]];case 2:return[...g,...g];case 3:return[...g,g[1]];default:return[g[0],g[1],g[2],g[3]]}}}return[5,5,5,5]})(i),d=i.animate===void 0||!!i.animate,c=i.iterations||2,u=i.rtl?1:0,m=Cs("single",r);switch(i.type){case"underline":{let p=t.y+t.h+l[2];for(let h=u;h<c+u;h++)h%2?o.push(Me(t.x+t.w,p,t.x,p,m)):o.push(Me(t.x,p,t.x+t.w,p,m));break}case"strike-through":{let p=t.y+t.h/2;for(let h=u;h<c+u;h++)h%2?o.push(Me(t.x+t.w,p,t.x,p,m)):o.push(Me(t.x,p,t.x+t.w,p,m));break}case"box":{let p=t.x-l[3],h=t.y-l[0],g=t.w+(l[1]+l[3]),y=t.h+(l[0]+l[2]);for(let E=0;E<c;
258E++)o.push(qh(p,h,g,y,m));break}case"bracket":{let p=Array.isArray(i.brackets)?i.brackets:i.brackets?[i.brackets]:["right"],h=t.x-2*l[3],g=t.x+t.w+2*l[1],y=t.y-2*l[0],E=t.y+t.h+2*l[2];for(let T of p){let C;switch(T){case"bottom":C=[[h,t.y+t.h],[h,E],[g,E],[g,t.y+t.h]];break;case"top":C=[[h,t.y],[h,y],[g,y],[g,t.y]];break;case"left":C=[[t.x,y],[h,y],[h,E],[t.x,E]];break;case"right":C=[[t.x+t.w,y],[g,y],[g,E],[t.x+t.w,E]]}C&&o.push(zo(C,!1,m))}break}case"crossed-off":{let p=t.x,h=t.y,g=p+t.w,y=h+t.h;for(let E=u;E<c+u;E++)E%2?o.push(Me(g,y,p,h,m)):o.push(Me(p,h,g,y,m));for(let E=u;E<c+u;E++)E%2?o.push(Me(p,y,g,h,m)):o.push(Me(g,h,p,y,m));break}case"circle":{let p=Cs("double",r),h=t.w+(l[1]+l[3]),g=t.h+(l[0]+l[2]),y=t.x-l[3]+h/2,E=t.y-l[0]+g/2,T=Math.floor(c/2),C=c-2*T;for(let f=0;f<T;f++)o.push(qo(y,E,h,g,p));for(let f=0;f<C;f++)o.push(qo(y,E,h,g,m));break}case"highlight":{let p=Cs("highlight",r);a=.95*t.h;let h=t.y+t.h/2;for(let g=u;g<c+u;g++)g%2?o.push(Me(t.x+t.w,h,t.x,h,p)):o.push(Me(t.x,h,t.x+t.w,h,p));break}}if(o.length){let p=(function(T){let C=[];for(let f of T){let x="";for(let S of f.ops){let A=S.data;switch(S.op){case"move":x.trim()&&C.push(x.trim()),x=`M${A[0]} ${A[1]} `;break;case"bcurveTo":x+=`C${A[0]} ${A[1]}, ${A[2]} ${A[3]}, ${A[4]} ${A[5]} `;break;case"lineTo":x+=`L${A[0]} ${A[1]} `}}x.trim()&&C.push(x.trim())}return C})(o),h=[],g=[],y=0,E=(T,C,f)=>T.setAttribute(C,f);for(let T of p){let C=document.createElementNS(Wo,"path");if(E(C,"d",T),E(C,"fill","none"),E(C,"stroke",i.color||"currentColor"),E(C,"stroke-width",""+a),d){let f=C.getTotalLength();h.push(f),y+=f}e.appendChild(C),g.push(C)}if(d){let T=0;for(let C=0;C<g.length;C++){let f=g[C],x=h[C],S=y?s*(x/y):0,A=n+T,O=f.style;O.strokeDashoffset=""+x,O.strokeDasharray=""+x,O.animation=`rough-notation-dash ${S}ms ease-out ${A}ms forwards`,T+=S}}}}var Ls=class{constructor(t,i){this._state="unattached",this._resizing=!1,this._seed=Math.floor(Math.random()*2**31),this._lastSizes=[],this._animationDelay=0,this._resizeListener=()=>{this._resizing||(this._resizing=!0,setTimeout(()=>{this._resizing=!1,this._state==="showing"&&this.haveRectsChanged()&&this.show()},400))},this._e=t,this._config=JSON.parse(JSON.stringify(i)),this.attach()}get animate(){return this._config.animate}set animate(t){this._config.animate=t}get animationDuration(){return this._config.animationDuration}set animationDuration(t){this._config.animationDuration=t}get iterations(){return this._config.iterations}set iterations(t){this._config.iterations=t}get color(){return this._config.color}set color(t){this._config.color!==t&&(this._config.color=t,this.refresh())}get strokeWidth(){return this._config.strokeWidth}set strokeWidth(t){this._config.strokeWidth!==t&&(this._config.strokeWidth=t,this.refresh())}get padding(){return this._config.padding}set padding(t){this._config.padding!==t&&(this._config.padding=t,this.refresh())}attach(){if(this._state==="unattached"&&this._e.parentElement){(function(){if(!window.__rno_kf_s){let s=window.__rno_kf_s=document.createElement("style");s.textContent="@keyframes rough-notation-dash { to { stroke-dashoffset: 0; } }",document.head.appendChild(s)}})();let t=this._svg=document.createElementNS(Wo,"svg");t.setAttribute("class","rough-annotation");let i=t.style;i.position="absolute",i.top="0",i.left="0",i.overflow="visible",i.pointerEvents="none",i.width="100px",i.height="100px";let n=this._config.type==="highlight";if(this._e.insertAdjacentElement(n?"beforebegin":"afterend",t),this._state="not-showing",n){let s=window.getComputedStyle(this._e).position;(!s||s==="static")&&(this._e.style.position="relative")}this.attachListeners()}}detachListeners(){window.removeEventListener("resize",this._resizeListener),this._ro&&this._ro.unobserve(this._e)}attachListeners(){this.detachListeners(),window.addEventListener("resize",this._resizeListener,{passive:!0}),!this._ro&&"ResizeObserver"in window&&(this._ro=new window.ResizeObserver(t=>{for(let i of t)i.contentRect&&this._resizeListener()})),this._ro&&this._ro.observe(this._e)}haveRectsChanged(){if(this._lastSizes.length){let t=this.rects();if(t.length!==this._lastSizes.length)return!0;for(let i=0;i<t.length;i++)if(!this.isSameRect(t[i],this._lastSizes[i]))return!0}return!1}isSameRect(t,i){let n=(s,r)=>Math.round(s)===Math.round(r);return n(t.x,i.x)&&n(t.y,i.y)&&n(t.w,i.w)&&n(t.h,i.h)}isShowing(){return this._state!=="not-showing"}refresh(){this.isShowing()&&!this.pendingRefresh&&(this.pendingRefresh=Promise.resolve().then(()=>{this.isShowing()&&this.show(),delete this.pendingRefresh}))}show(){switch(this._state){case"unattached":break;case"showing":this.hide(),this._svg&&this.render(this._svg,!0);break;case"not-showing":this.attach(),this._svg&&this.render(this._svg,!1)}}
258hide(){if(this._svg)for(;this._svg.lastChild;)this._svg.removeChild(this._svg.lastChild);this._state="not-showing"}remove(){this._svg&&this._svg.parentElement&&this._svg.parentElement.removeChild(this._svg),this._svg=void 0,this._state="unattached",this.detachListeners()}render(t,i){var n;let s=this._config;i&&(s=JSON.parse(JSON.stringify(this._config)),s.animate=!1);let r=this.rects(),o=0;r.forEach(d=>o+=d.w);let a=s.animationDuration||800,l=0;for(let d=0;d<r.length;d++){let c=a*(r[d].w/o);jh(t,r[d],s,l+this._animationDelay,c,(n=s?.seed)!==null&&n!==void 0?n:this._seed),l+=c}this._lastSizes=r,this._state="showing"}rects(){let t=[];if(this._svg)if(this._config.multiline){let i=this._e.getClientRects();for(let n=0;n<i.length;n++)t.push(this.svgRect(this._svg,i[n]))}else t.push(this.svgRect(this._svg,this._e.getBoundingClientRect()));return t}svgRect(t,i){let n=t.getBoundingClientRect(),s=i;return{x:(s.x||s.left)-(n.x||n.left),y:(s.y||s.top)-(n.y||n.top),w:s.width,h:s.height}}};function wn(e,t){return new Ls(e,t)}var Uh={mounted(){let e=this.el.closest("[id^=comment-wrapper-]");this.annotation=wn(e,{type:"bracket",brackets:["left"],color:"#DB2777",strokeWidth:2,animate:!0}),this.annotation.show(),this.timer=setTimeout(()=>this.fade(),4e3)},fade(){let e=this.el.parentElement?.querySelector(":scope > svg.rough-annotation");e&&(e.style.transition="opacity 0.5s ease-out",e.style.opacity="0"),this.timer=setTimeout(()=>this.annotation.remove(),500)},destroyed(){clearTimeout(this.timer),this.annotation.remove()}},Xo=Uh;function Ko(e){return e?new Date(e+"T12:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):""}function Qt(e){return(e/100).toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0})}var Vh={kpiShortenDollars:e=>{let t=e/100;return Math.abs(t)>=1e6?`$${(t/1e6).toFixed(1)}M`:Math.abs(t)>=1e3?`$${Math.round(t/1e3)}k`:`$${Math.round(t)}`},percentSuffix:e=>`${e}%`,absoluteNumber:e=>Math.abs(e).toLocaleString()},Go={appendPct:e=>`${e}%`,absoluteNumber:e=>Math.abs(e).toLocaleString(),dollarCents:Qt,dollarsShort:e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(e)};function Wh(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(e)}var zh={dollars:e=>{let t=e[0]?.axisValue,i=e.filter(n=>n.value!=null).map(n=>` 259 <div class="flex items-center gap-2 text-sm"> 260 <span class="inline-block size-2.5 rounded-full" style="background-color:${n.color}"></span> 261 <span class="grow">${n.seriesName}</span> 262 <span class="font-bold tabular-nums">${Wh(n.value)}</span> 263 </div> 264 `).join("");return` 265 <div class="p-2 space-y-1.5 min-w-44"> 266 <div class="text-xs text-content-muted">${t}</div> 267 ${i} 268 </div> 269 `},dollarYoY:e=>{let t=e.filter(i=>(typeof i.data=="object"?i.data?.value:i.data)!=null).map(i=>{let n=typeof i.data=="object",s=n?i.data.value:i.data,r=n&&i.data.date?Ko(i.data.date):"",o=r?`${i.seriesName} (${r})`:i.seriesName,a=Qt(s),l=` 270 <div> 271 <span class="inline-block size-2.5 rounded-[4px]" style="background-color:${i.color}"></span> 272 <span class="pl-1">${o}:</span> 273 <span class="font-bold text-base font-mono">${a}</span> 274 </div> 275 `;if(n&&i.data.gross!=null){let u=i.data.gross,m=i.data.tax||0,p=i.data.refund||0,h=(g,y)=>` 276 <div class="flex justify-between gap-6"> 277 <span>${g}</span> 278 <span class="font-mono">${y}</span> 279 </div> 280 `;return` 281 ${l} 282 <div class="pl-4.5 text-sm text-content-secondary space-y-0.5"> 283 ${h("Gross revenue",Qt(u))} 284 ${h("Taxes",Qt(-m))} 285 ${h("Refunds",Qt(-p))} 286 </div> 287 `}let d=n?i.data.discount:null,c=d!=null&&d>0?`<div class="pl-4.5 __text-sm italic font-medium text-content-secondary"> 288 Before discounts: <span class="font-mono">${Qt(s+d)}</span> 289 </div>`:"";return` 290 ${l} 291 ${c} 292 `});return t.length?`<div class="p-2 space-y-1">${t.join("")}</div>`:""},subscriptionsYoY:e=>{let t=e.filter(i=>i.data?.value!=null).map(i=>{let n=i.data?.date?Ko(i.data.date):"",s=n?`${i.seriesName}: (${n})`:`${i.seriesName}`;return`
293 <span class="inline-block size-2.5 rounded-[4px]" style="background-color:${i.color}"></span> 294 <span class="pl-1">${s}:</span> 295 <span class="font-bold text-base">${i.value.toLocaleString()}</span> 296 `});return t.length?`<div class="p-2">${t.join("<br/>")}</div>`:""},subscriptionMovement:e=>{let t=e?.[0]?.axisValueLabel||"",i=e.filter(s=>s.data!=null).map(s=>{let r=s.data,o=Math.abs(r?.value??0),l=(Array.isArray(r?.breakdown)?r.breakdown:[]).map(([d,c])=>` 297 <div class="flex justify-between gap-4 text-base"> 298 <span class="font-medium">${d}</span> 299 <span class="font-bold">${Number(c).toLocaleString()}</span> 300 </div> 301 `).join("");return` 302 <div class="mt-2"> 303 <div class="flex items-center gap-2 text-base"> 304 <span class="inline-block size-3 rounded-[3px]" style="background-color:${s.color}"></span> 305 <span class="font-semibold">${s.seriesName}</span> 306 <span class="ml-auto font-bold">${o.toLocaleString()}</span> 307 </div> 308 ${l?`<div class="mt-1 pl-5">${l}</div>`:""} 309 </div> 310 `}).join("");return`<div class="p-2 min-w-[240px]">${t?`<div class="font-semibold text-lg">${t}</div>`:""}${i}</div>`},cohortRetention:e=>{let t=Array.isArray(e.data)?e.data:e.data?.value;if(!t||t[2]==null||t[2]<0)return"";let i=t[2],n=t[3],s=t[4];return` 311 <div class="p-2 font-sans"> 312 <div class="font-semibold text-base">${e.name}</div> 313 <div class="mt-1"> 314 <span class="font-bold text-base">${i}%</span> 315 <span class="text-content-muted text-sm">(${n}/${s} users)</span> 316 </div> 317 </div> 318 `}},Jh={cohortRetentionLabel:e=>{let i=(Array.isArray(e.data)?e.data:e.data?.value)?.[2];return i!=null&&i>=0?`${Math.round(i)}%`:""}};function Xh(e){if(!e?.tooltip)return;let t=window.isDarkMode;e.tooltip={backgroundColor:t?"rgba(23, 23, 23, 0.5)":"rgba(255, 255, 255, 0.5)",borderColor:t?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.08)",textStyle:t?{color:"#cbd5e1"}:{},extraCssText:"backdrop-filter: blur(4px) saturate(1.5); -webkit-backdrop-filter: blur(4px) saturate(1.5);"+(t?"text-shadow: 0 0 2px rgba(0, 0, 0, 1), 0 0 4px rgba(0, 0, 0, 1), 0 0 10px rgba(0, 0, 0, 0.8);":"text-shadow: 0 0 2px rgba(255, 255, 255, 1), 0 0 4px rgba(255, 255, 255, 1), 0 0 10px rgba(255, 255, 255, 0.8);"),...e.tooltip}}function Kh(e){let t=e?.tooltip?.formatter;typeof t=="string"&&t.startsWith("fn:")&&(e.tooltip.formatter=zh[t.split("fn:")[1]]);let i=e?.tooltip?.valueFormatter;typeof i=="string"&&i.startsWith("fn:")&&(e.tooltip.valueFormatter=Go[i.split("fn:")[1]]);let n=Array.isArray(e?.yAxis)?e.yAxis:e?.yAxis?[e.yAxis]:[];for(let s of n){let r=s?.axisLabel?.formatter;typeof r=="string"&&r.startsWith("fn:")&&(s.axisLabel.formatter=V
318h[r.split("fn:")[1]])}if(e?.series)for(let s of e.series){let r=s?.tooltip?.valueFormatter;typeof r=="string"&&r.startsWith("fn:")&&(s.tooltip.valueFormatter=Go[r.split("fn:")[1]]);let o=s?.label?.formatter;typeof o=="string"&&o.startsWith("fn:")&&(s.label.formatter=Jh[o.split("fn:")[1]])}}var Yo={async mounted(){this._echarts=await Ai(),this._options=JSON.parse(this.el.dataset.chartOptions),this.initChart();let e;new ResizeObserver(debounce(()=>{clearTimeout(e),e=setTimeout(()=>this._chart.resize(),150)},200)).observe(this.el),this._onThemeChanged=()=>{this._chart.dispose(),this.initChart()},window.addEventListener("theme-changed",this._onThemeChanged),this.handleEvent(`chart-options:${this.el.id}`,({options:t})=>{this._options=t,this.applyOptions()})},initChart(){this._chart=this._echarts.init(this.el,window.isDarkMode?"app-dark":null),this._chart.on("legendselectchanged",e=>{let t=this.el.dataset.phxTarget;t?this.pushEventTo(t,"legend_changed",{selected:e.selected}):this.pushEvent("legend_changed",{selected:e.selected})}),this.applyOptions()},applyOptions(){let e=structuredClone(this._options);Xh(e),Kh(e),this._chart.setOption(e,{notMerge:!0})},destroyed(){window.removeEventListener("theme-changed",this._onThemeChanged)}};var Gh={mounted(){this.el.addEventListener("click",e=>{navigator.clipboard.writeText(e.target.dataset.copy).then(()=>{this.tempText("Copied!",2e3)}).catch(i=>{this.tempText("Error!",2e3),console.error("Failed to copy text: ",i.message)})})},tempText(e,t){let i=this.el.textContent;i!==e&&(this.el.textContent=e,setTimeout(()=>{this.el.textContent=i},t))}},Qo=Gh;var Yh={mounted(){let e=this.el.dataset.imgId;if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)){this.el.hidden=!0;return}this.el.addEventListener("click",async()=>{try{let i=document.getElementById(e);if(!i)return;let s=await(await fetch(i.src)).blob();await navigator.clipboard.write([new ClipboardItem({[s.type]:s})]),this.tempText("Image copied!",2e3)}catch(i){console.error("Failed to copy image:",i),this.tempText("Error copying image!",2e3)}})},tempText(e,t){let i=this.el.textContent;i!==e&&(this.el.textContent=e,setTimeout(()=>{this.el.textContent=i},t))}},Zo=Yh;var Qh={mounted(){this.el.addEventListener("click",()=>{let e=this.el.dataset.copy;navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e).then(()=>this.pushEvent("link_copied",{})).catch(()=>this.fallbackCopy(e)):this.fallbackCopy(e)})},fallbackCopy(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),this.pushEvent("link_copied",{})}catch(i){console.error("Failed to copy link: ",i.message)}document.body.removeChild(t)}},ea=Qh;var Zh={mounted(){this.handleEvent("flash_row",({dom_id:e})=>{let t=document.getElementById(e);t&&(t.classList.add("highlight-table-row"),requestAnimationFrame(()=>{t.classList.remove("highlight-table-row"),t.classList.add("highlight-table-row-fade-out")}),setTimeout(()=>{t.classList.remove("highlight-table-row-fade-out")},200))})}},ta=Zh;var eu={mounted(){this.el.addEventListener("keydown",e=>{e.which===13&&e.preventDefault()})}},ia=eu;var tu={mounted(){let e=this.el.dataset.imgId,t=this.el.dataset.filename;this.el.addEventListener("click",()=>{let n=document.getElementById(e).src,s=document.createElement("a");s.href=n,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s)})}},na=tu;var sa="input:not([disabled]):not([hidden]), button:not([disabled]), a[data-dropdown-item]",ra={mounted(){window.requestAnimationFrame(this.setup.bind(this))},setup(){this.isSetup||(this.isSetup=!0,this.trigger=this.el.querySelector(`#${this.el.id}-trigger`),this.floating=this.el.querySelector(`#${this.el.id}-floating`),this.content=this.el.querySelector(`#${this.el.id}-content`),this.footer=this.el.querySelector(`#${this.el.id}-footer`),this.coverTrigger=this.el.dataset.coverTrigger,this.preferredPlacement=this.el.dataset.preferredPlacement,this.cleanup=null,this.observer=null,this.observer=new MutationObserver(()=>{let e=getComputedStyle(this.floating).display!=="none";if(this.el.toggleAttribute("data-open",e),e&&this.cleanup===null){this.cleanup=Cr(this.trigger,this.floating,this.updatePosition.bind(this)),window.addEventListener("keydown",this.closeOnEscHandler);let t=document.querySelector(`#${this.content.id} .selected-option`);t&&requestAnimationFrame(()=>{this.content.scrollTo({top:t.offsetTop,behavior:"instant"})});let i=sa,n=t?t.querySelector(i):this.content.querySelector(i);n&&requestAnimationFrame(()=>n.focus());let s=this.el.dataset.onOpen;s&&requestAnimationFrame(()=>{this.js().exec(s)})}!e&&this.cleanup!==null&&(this.cleanup(),this.cleanup=null,window.removeEventListener("keydown",this.closeOnEscHandler))}),this.observer.observe(this.floating,{attributes:!0,attributeFilter:["class","style"]}),this.content.addEventListener("pointerdown",()=>{this.prevScroll=this.content.scrollTop,this.scrollFromPointer=!0,clearTimeout(this.scrollFromPointerTimer),this.scrollFromPointerTimer=setTimeout(()=>{this.scrollFromPointer=!1},500)},!0),this.closeOnEscHandler=e=>{e.key==="Escape"&&(e.preventDefault(),this.js().exec(this.el.dataset.toggle))},this.handleKeyboardShortcuts())},beforeUpdate(){this.isSetup&&(this.scrollFromPointer||(this.prevScroll=this.content.scrollTop))},updated(){this.isSetup&&(this.el.toggleAttribute("data-open",getComputedStyle(this.floating).display!=="none"),this.updatePosition().then(()=>{this.content.scrollTo({top:this.prevScroll,behavior:"instant"}),this.scrollFromPointer=!1,clearTimeout(this.scrollFromPointerTimer)}))},destroyed(){this.isSetup&&(this.observer.disconnect(),window.removeEventListener("keydown",this.escapeHandler),clearTimeout(this.scrollFromPointerTimer),this.cleanup!==null&&this.cleanup())},updatePosition(){let e=this.content,t=this.footer;return Ir(this.trigger,this.floating,{placement:this.preferredPlacement,middleware:[Lr(),Ar(),Tr({mainAxis:this.coverTrigger==="true"?-this.trigger.offsetHeight:8}),_r({apply({availableWidth:i,availableHeight:n,elements:s}){let r=Math.max(56,n);if(Object.assign(s.floating.style,{maxWidth:`${Math.max(0,i)}px`,maxHeight:`${r}px`}),t){let o=r*.25;Object.assign(t.style,{maxHeight:`${o}px`}),Object.assign(e.style,{maxHeight:`${r-o}px`})}},padding:{top:80,bottom:16,left:16,right:16}})]}).then(({x:i,y:n})=>{Object.assign(this.floating.style,{left:`${i}px`,top:`${n}px`})})},handleKeyboardShortcuts(){let e=this.floating,t=!1;e.addEventListener("mousemove",()=>t=!0),e.addEventListener("mouseenter",i=>{if(!t)return;let n=document.activeElement;if(n&&n.tagName==="INPUT"&&(n.type==="text"||n.type==="number")&&e.contains(n))return;let s=i.target.closest("label")?.querySelector("input:not([disabled]), button:not([disabled])"),r=i.target.closest("button:not([disabled])"),o=i.target.closest("a[data-dropdown-item]");if(s){s.focus();return}
318if(r){r.focus();return}if(o){o.focus();return}},!0),e.addEventListener("keydown",i=>{if(t=!1,i.key==="Enter"){if(document.activeElement?.matches("a[data-dropdown-item]"))return;i.preventDefault(),document.activeElement?.closest("label, button")?.click();return}if(i.key==="ArrowDown"||i.key==="ArrowUp"||i.key==="Tab"){let n=[...e.querySelectorAll(sa)],s=n.indexOf(document.activeElement);if(s===-1)return;let r=i.key==="ArrowDown"||i.key==="Tab"&&!i.shiftKey;i.preventDefault();let o=r?Math.min(s+1,n.length-1):Math.max(s-1,0);o!==s&&(n[o].focus(),(n[o].closest("label")||n[o]).scrollIntoView({block:"nearest"}))}},!0)}};var iu={mounted(){this.checkPosition=this.checkPosition.bind(this),this.checkSize=this.checkSize.bind(this),this.observer=new MutationObserver(e=>{e.forEach(t=>{t.type==="attributes"&&t.attributeName==="class"&&!this.isHidden(this.el)&&(this.el.style.transform="",this.el.style.maxHeight="",this.el.style.overflowY="",requestAnimationFrame(()=>{this.checkSize(),this.checkPosition()}))})}),this.observer.observe(this.el,{attributes:!0,attributeFilter:["class"]})},getContainer(){return document.getElementById(this.el.dataset.containerId)||document.body},destroyed(){this.observer&&this.observer.disconnect()},isHidden(e){return window.getComputedStyle(e).display==="none"},checkPosition(){if(this.isHidden(this.el))return;let e=this.getContainer(this.el),t=this.el.getBoundingClientRect(),i=e.getBoundingClientRect(),n=0,s=0;i.top>t.top&&(n=Math.abs(i.top-t.top)+10),i.bottom<t.bottom&&(n=-Math.abs(i.bottom-t.bottom)-10),i.left>t.left&&(s=Math.abs(i.left-t.left)+10),i.right<t.right&&(s=-Math.abs(i.right-t.right)-10),(n!==0||s!==0)&&(this.el.style.transform=`translate(${s}px, ${n}px)`)},checkSize(){if(this.isHidden(this.el))return;let e=this.getContainer(this.el),t=this.el.getBoundingClientRect(),i=e.getBoundingClientRect();i.width<t.width&&(this.el.style.maxWidth=`${i.width}px`),i.height<t.height&&(this.el.style.maxHeight=`${i.height}px`)}},oa=iu;var nu={mounted(){let e=this.el.querySelector(".slider-min"),t=this.el.querySelector(".slider-max"),i=this.el.querySelector(".slider-range"),n=this.el.querySelector(".min-number-input"),s=this.el.querySelector(".max-number-input"),r=parseFloat(this.el.dataset.minGap),o=parseFloat(e.min),a=parseFloat(e.max),l=()=>{let d=parseFloat(e.value),c=parseFloat(t.value),u=(d-o)/(a-o)*100,m=(c-o)/(a-o)*100;i.style.left=`${u}%`,i.style.width=`${m-u}%`};e.addEventListener("input",d=>{d.stopPropagation();let c=parseFloat(e.value),u=parseFloat(t.value);u-c<r&&(e.value=u-r),n.value=e.value,l()}),e.addEventListener("change",d=>{d.stopPropagation(),n.dispatchEvent(new Event("input",{bubbles:!0})),n.dispatchEvent(new Event("blur",{bubbles:!0}))}),t.addEventListener("input",d=>{d.stopPropagation();let c=parseFloat(e.value);parseFloat(t.value)-c<r&&(t.value=c+r),s.value=t.value,l()}),t.addEventListener("change",d=>{d.stopPropagation(),s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("blur",{bubbles:!0}))}),n.addEventListener("input",d=>{let c=parseFloat(n.value);parseFloat(t.value)-c>=r&&c>=o&&(e.value=c,l())}),s.addEventListener("input",d=>{let c=parseFloat(e.value),u=parseFloat(s.value);u-c>=r&&u<=a&&(t.value=u,l())}),n.addEventListener("blur",d=>{let c=parseFloat(n.value),u=parseFloat(t.value);(Number.isNaN(c)||c<o)&&(c=o),u-c<r&&(c=u-r),e.value=c,n.value=c,l()}),s.addEventListener("blur",d=>{let c=parseFloat(e.value),u=parseFloat(s.value);(Number.isNaN(u)||u>a)&&(u=a),u-c<r&&(u=c+r),t.value=u,s.value=u,l()}),l()}},aa=nu;var su={mounted(){this.span=this.el.querySelector("#time-elapsed-span"),this.setTime()},updated(){this.setTime()},destroyed(){clearInterval(this.interval)},setTime(){let e=parseInt(this.el.dataset.elapsed,10),t=Date.now();this.interval&&clearInterval(this.interval),this.interval=setInterval(()=>{let i=Date.now(),n=new Date(null),s=e+(i-t)/1e3;n.setSeconds(s),this.span.textContent=n.toISOString().slice(11,19)},50)}},la=su;var ru={mounted(){this.handleEvent("schedule_flash_dismiss",()=>{clearTimeout(this.timer),this.scheduleTimer()})},destroyed(){clearTimeout(this.timer)},scheduleTimer(){this.timer=setTimeout(()=>{this.liveSocket.execJS(this.el,this.el.getAttribute("phx-click"))},3e3)}},ca=ru;var ou={mounted(){this.fullscreenTarget=null,this.onToggle=()=>{let e=this.target();this.el.dataset.fullscreen==="true"?e.requestFullscreen?.().then(()=>{this.fullscreenTarget=e},()=>{}):document.fullscreenElement===e&&document.exitFullscreen().catch(()=>{})},this.el.addEventListener("fullscreen:toggle",this.onToggle),this.onFullscreenChange=()=>{!this.fullscreenTarget||document.fullscreenElement||(this.fullscreenTarget=null,this.el.dataset.fullscreen==="true"&&this.setFullscreen(!1))},document.addEventListener("fullscreenchange",this.onFullscreenChange)},destroyed(){document.removeEventListener("fullscreenchange",this.onFullscreenChange),this.fullscreenTarget&&document.fullscreenElement===this.fullscreenTarget&&document.exitFullscreen().catch(()=>{}),this.fullscreenTarget=null},target(){let e=this.el.dataset.fullscreenTarget;return e&&this.el.closest(e)||this.el},setFullscreen(e){let t=this.js();t.setAttribute(this.el,"data-fullscreen",String(e)),document.querySelectorAll("[data-fullscreen-switch]").forEach(i=>
vendor: 17,648 bytes, line 318
318{t.setAttribute(i,"aria-checked",String(e))})}},da=ou;var Z="top",oe="bottom",ie="right",te="left",Sn="auto",ht=[Z,oe,ie,te],et="start",Lt="end",ha="clippingParents",En="viewport",Zt="popper",ua="reference",_s=ht.reduce(function(e,t){return e.concat([t+"-"+et,t+"-"+Lt])},[]),xn=[].concat(ht,[Sn]).reduce(function(e,t){return e.concat([t,t+"-"+et,t+"-"+Lt])},[]),au="beforeRead",lu="read",cu="afterRead",du="beforeMain",hu="main",uu="afterMain",pu="beforeWrite",fu="write",mu="afterWrite",pa=[au,lu,cu,du,hu,uu,pu,fu,mu];function de(e){return e?(e.nodeName||"").toLowerCase():null}function J(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function _e(e){var t=J(e).Element;return e instanceof t||e instanceof Element}function ae(e){var t=J(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function ei(e){if(typeof ShadowRoot>"u")return!1;var t=J(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function gu(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var n=t.styles[i]||{},s=t.attributes[i]||{},r=t.elements[i];!ae(r)||!de(r)||(Object.assign(r.style,n),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function vu(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(n){var s=t.elements[n],r=t.attributes[n]||{},o=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:i[n]),a=o.reduce(function(l,d){return l[d]="",l},{});!ae(s)||!de(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}var Li={name:"applyStyles",enabled:!0,phase:"write",fn:gu,effect:vu,requires:["computeStyles"]};function he(e){return e.split("-")[0]}var De=Math.max,_t=Math.min,tt=Math.round;function ti(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function _i(){return!/^((?!chrome|android).)*safari/i.test(ti())}function Ie(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var n=e.getBoundingClientRect(),s=1,r=1;t&&ae(e)&&(s=e.offsetWidth>0&&tt(n.width)/e.offsetWidth||1,r=e.offsetHeight>0&&tt(n.height)/e.offsetHeight||1);var o=_e(e)?J(e):window,a=o.visualViewport,l=!_i()&&i,d=(n.left+(l&&a?a.offsetLeft:0))/s,c=(n.top+(l&&a?a.offsetTop:0))/r,u=n.width/s,m=n.height/r;return{width:u,height:m,top:c,right:d+u,bottom:c+m,left:d,x:d,y:c}}function It(e){var t=Ie(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function Ii(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&ei(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function be(e){return J(e).getComputedStyle(e)}function Is(e){return["table","td","th"].indexOf(de(e))>=0}function pe(e){return((_e(e)?e.ownerDocument:e.document)||window.document).documentElement}function it(e){return de(e)==="html"?e:e.assignedSlot||e.parentNode||(ei(e)?e.host:null)||pe(e)}function fa(e){return!ae(e)||be(e).position==="fixed"?null:e.offsetParent}function bu(e){var t=/firefox/i.test(ti()),i=/Trident/i.test(ti());if(i&&ae(e)){var n=be(e);if(n.position==="fixed")return null}var s=it(e);for(ei(s)&&(s=s.host);ae(s)&&["html","body"].indexOf(de(s))<0;){var r=be(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function He(e){for(var t=J(e),i=fa(e);i&&Is(i)&&be(i).position==="static";)i=fa(i);return i&&(de(i)==="html"||de(i)==="body"&&be(i).position==="static")?t:i||bu(e)||t}function Pt(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Rt(e,t,i){return De(e,_t(t,i))}function ma(e,t,i){var n=Rt(e,t,i);return n>i?i:n}function Pi(){return{top:0,right:0,bottom:0,left:0}}function Ri(e){return Object.assign({},Pi(),e)}function Oi(e,t){return t.reduce(function(i,n){return i[n]=e,i},{})}var yu=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,Ri(typeof t!="number"?t:Oi(t,ht))};function wu(e){var t,i=e.state,n=e.name,s=e.options,r=i.elements.arrow,o=i.modifiersData.popperOffsets,a=he(i.placement),l=Pt(a),d=[te,ie].indexOf(a)>=0,c=d?"height":"width";if(!(!r||!o)){var u=yu(s.padding,i),m=It(r),p=l==="y"?Z:te,h=l==="y"?oe:ie,g=i.rects.reference[c]+i.rects.reference[l]-o[l]-i.rects.popper[c],y=o[l]-i.rects.reference[l],E=He(r),T=E?l==="y"?E.clientHeight||0:E.clientWidth||0:0,C=g/2-y/2,f=u[p],x=T-m[c]-u[h],S=T/2-m[c]/2+C,A=Rt(f,S,x),O=l;i.modifiersData[n]=(t={},t[O]=A,t.centerOffset=A-S,t)}}function Su(e){var t=e.state,i=e.options,n=i.element,s=n===void 0?"[data-popper-arrow]":n;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||Ii(t.elements.popper,s)&&(t.elements.arrow=s))}var ga={name:"arrow",enabled:!0,phase:"main",fn:wu,effect:Su,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Pe(e){return e.split("-")[1]}var Eu={top:"auto",right:"auto",bottom:"auto",left:"auto"};function xu(e,t){var i=e.x,n=e.y,s=t.devicePixelRatio||1;return{x:tt(i*s)/s||0,y:tt(n*s)/s||0}}function va(e){var t,i=e.popper,n=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,d=e.adaptive,c=e.roundOffsets,u=e.isFixed,m=o.x,p=m===void 0?0:m,h=o.y,g=h===void 0?0:h,y=typeof c=="function"?c({x:p,y:g}):{x:p,y:g};p=y.x,g=y.y;var E=o.hasOwnProperty("x"),T=o.hasOwnProperty("y"),C=te,f=Z,x=window;if(d){var S=He(i),A="clientHeight",O="clientWidth";if(S===J(i)&&(S=pe(i),be(S).position!=="static"&&a==="absolute"&&(A="scrollHeight",O="scrollWidth")),S=S,s===Z||(s===te||s===ie)&&r===Lt){f=oe;var b=u&&S===x&&x.visualViewport?x.visualViewport.height:S[A];g-=b-n.height,g*=l?1:-1}if(s===te||(s===Z||s===oe)&&r===Lt){C=ie;var k=u&&S===x&&x.visualViewport?x.visualViewport.width:S[O];p-=k-n.width,p*=l?1:-1}}var N=Object.assign({position:a},d&&Eu),H=c===!0?xu({x:p,y:g},J(i)):{x:p,y:g};if(p=H.x,g=H.y,l){var M;return Object.assign({},N,(M={},M[f]=T?"0":"",M[C]=E?"0":"",M.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",M))}return Object.assign({},N,(t={},t[f]=T?g+"px":"",t[C]=E?p+"px":"",t.transform="",t))}function ku(e){var t=e.state,i=e.options,n=i.gpuAcceleration,s=n===void 0?!0:n,r=i.adaptive,o=r===void 0?!0:r,a=i.roundOffsets,l=a===void 0?!0:a,d={placement:he(t.placement),variation:Pe(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,va(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,va(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var ba={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ku,data:{}};var kn={passive:!0};function Cu(e){var t=e.state,i=e.instance,n=e.options,s=n.scroll,r=s===void 0?!0:s,o=n.resize,a=o===void 0?!0:o,l=J(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&d.forEach(function(c){c.addEventListener("scroll",i.update,kn)}),a&&l.addEventListener("resize",i.update,kn),function(){r&&d.forEach(function(c){c.removeEventListener("scroll",i.update,kn)}),a&&l.removeEventListener("resize",i.update,kn)}}var ya={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Cu,data:{}};var Tu={left:"right",right:"left",bottom:"top",top:"bottom"};function ii(e){return e.replace(/left|right|bottom|top/g,function(t){return Tu[t]})}var Au={start:"end",end:"start"};function Cn(e){return e.replace(/start|end/g,function(t){return Au[t]})}function Ot(e){var t=J(e),i=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:i,scrollTop:n}}function Mt(e){return Ie(pe(e)).left+Ot(e).scrollLeft}function Ps(e,t){var i=J(e),n=pe(e),s=i.visualViewport,r=n.clientWidth,o=n.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var d=_i();(d||!d&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+Mt(e),y:l}}function Rs(e){var t,i=pe(e),n=Ot(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=De(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=De(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Mt(e),l=-n.scrollTop;return be(s||i).direction==="rtl"&&(a+=De(i.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function Dt(e){var t=be(e),i=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Tn(e){return["html","body","#document"].indexOf(de(e))>=0?e.ownerDocument.body:ae(e)&&Dt(e)?e:Tn(it(e))}function ut(e,t){var i;t===void 0&&(t=[]);var n=Tn(e),s=n===((i=e.ownerDocument)==null?void 0:i.body),r=J(n),o=s?[r].concat(r.visualViewport||[],Dt(n)?n:[]):n,a=t.concat(o);return s?a:a.concat(ut(it(o)))}function ni(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Lu(e,t){var i=Ie(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function wa(e,t,i){return t===En?ni(Ps(e,i)):_e(t)?Lu(t,i):ni(Rs(pe(e)))}function _u(e){var t=ut(it(e)),i=["absolute","fixed"].indexOf(be(e).position)>=0,n=i&&ae(e)?He(e):e;return _e(n)?t.filter(function(s){return _e(s)&&Ii(s,n)&&de(s)!=="body"}):[]}function Os(e,t,i,n){var s=t==="clippingParents"?_u(e):[].concat(t),r=[].concat(s,[i]),o=r[0],a=r.reduce(function(l,d){var c=wa(e,d,n);return l.top=De(c.top,l.top),l.right=_t(c.right,l.right),l.bottom=_t(c.bottom,l.bottom),l.left=De(c.left,l.left),l},wa(e,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Mi(e){var t=e.reference,i=e.element,n=e.placement,s=n?he(n):null,r=n?Pe(n):null,o=t.x+t.width/2-i.width/2,a=t.y+t.height/2-i.height/2,l;switch(s){case Z:l={x:o,y:t.y-i.height};break;case oe:l={x:o,y:t.y+t.height};break;case ie:l={x:t.x+t.width,y:a};break;case te:l={x:t.x-i.width,y:a};break;default:l={x:t.x,y:t.y}}var d=s?Pt(s):null;if(d!=null){var c=d==="y"?"height":"width";switch(r){case et:l[d]=l[d]-(t[c]/2-i[c]/2);break;case Lt:l[d]=l[d]+(t[c]/2-i[c]/2);break;default:}}return l}function $e(e,t){t===void 0&&(t={});var i=t,n=i.placement,s=n===void 0?e.placement:n,r=i.strategy,o=r===void 0?e.strategy:r,a=i.boundary,l=a===void 0?ha:a,d=i.rootBoundary,c=d===void 0?En:d,u=i.elementContext,m=u===void 0?Zt:u,p=i.altBoundary,h=p===void 0?!1:p,g=i.padding,y=g===void 0?0:g,E=Ri(typeof y!="number"?y:Oi(y,ht)),T=m===Zt?ua:Zt,C=e.rects.popper,f=e.elements[h?T:m],x=Os(_e(f)?f:f.contextElement||pe(e.elements.popper),l,c,o),S=Ie(e.elements.reference),A=Mi({reference:S,element:C,strategy:"absolute",placement:s}),O=ni(Object.assign({},C,A)),b=m===Zt?O:S,k={top:x.top-b.top+E.top,bottom:b.bottom-x.bottom+E.bottom,left:x.left-b.left+E.left,right:b.right-x.right+E.right},N=e.modifiersData.offset;if(m===Zt&&N){var H=N[s];Object.keys(k).forEach(function(M){var K=[ie,oe].indexOf(M)>=0?1:-1,Y=[Z,oe].indexOf(M)>=0?"y":"x";k[M]+=H[Y]*K})}return k}function Ms(e,t){t===void 0&&(t={});var i=t,n=i.placement,s=i.boundary,r=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,d=l===void 0?xn:l,c=Pe(n),u=c?a?_s:_s.filter(function(h){return Pe(h)===c}):ht,m=u.filter(function(h){return d.indexOf(h)>=0});m.length===0&&(m=u);var p=m.reduce(function(h,g){return h[g]=$e(e,{placement:g,boundary:s,rootBoundary:r,padding:o})[he(g)],h},{});return Object.keys(p).sort(function(h,g){return p[h]-p[g]})}function Iu(e){if(he(e)===Sn)return[];var t=ii(e);return[Cn(e),t,Cn(t)]}function Pu(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var s=i.mainAxis,r=s===void 0?!0:s,o=i.altAxis,a=o===void 0?!0:o,l=i.fallbackPlacements,d=i.padding,c=i.boundary,u=i.rootBoundary,m=i.altBoundary,p=i.flipVariations,h=p===void 0?!0:p,g=i.allowedAutoPlacements,y=t.options.placement,E=he(y),T=E===y,C=l||(T||!h?[ii(y)]:Iu(y)),f=[y].concat(C).reduce(function($,ce){return $.concat(he(ce)===Sn?Ms(t,{placement:ce,boundary:c,rootBoundary:u,padding:d,flipVariations:h,allowedAutoPlacements:g}):ce)},[]),x=t.rects.reference,S=t.rects.popper,A=new Map,O=!0,b=f[0],k=0;k<f.length;k++){var N=f[k],H=he(N),M=Pe(N)===et,K=[Z,oe].indexOf(H)>=0,Y=K?"width":"height",ne=$e(t,{placement:N,boundary:c,rootBoundary:u,altBoundary:m,padding:d}),q=K?M?ie:te:M?oe:Z;x[Y]>S[Y]&&(q=ii(q));var Q=ii(q),Se=[];if(r&&Se.push(ne[H]<=0),a&&Se.push(ne[q]<=0,ne[Q]<=0),Se.every(function($){return $})){b=N,O=!1;break}A.set(N,Se)}if(O)for(var _=h?3:1,P=function(ce){var se=f.find(function(Ee){var ye=A.get(Ee);if(ye)return ye.slice(0,ce).every(function(me){return me})});if(se)return b=se,"break"},F=_;F>0;F--){var D=P(F);if(D==="break")break}t.placement!==b&&(t.modifiersData[n]._skip=!0,t.placement=b,t.reset=!0)}}var Sa={name:"flip",enabled:!0,phase:"main",fn:Pu,requiresIfExists:["offset"],data:{_skip:!1}};function Ea(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function xa(e){return[Z,ie,oe,te].some(function(t){return e[t]>=0})}function Ru(e){var t=e.state,i=e.name,n=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=$e(t,{elementContext:"reference"}),a=$e(t,{altBoundary:!0}),l=Ea(o,n),d=Ea(a,s,r),c=xa(l),u=xa(d);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:c,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":u})}var ka={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ru};function Ou(e,t,i){var n=he(e),s=[te,Z].indexOf(n)>=0?-1:1,r=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[te,ie].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}function Mu(e){var t=e.state,i=e.options,n=e.name,s=i.offset,r=s===void 0?[0,0]:s,o=xn.reduce(function(c,u){return c[u]=Ou(u,t.rects,r),c},{}),a=o[t.placement],l=a.x,d=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=d),t.modifiersData[n]=o}var Ca={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Mu};function Du(e){var t=e.state,i=e.name;t.modifiersData[i]=Mi({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Ta={name:"popperOffsets",enabled:!0,phase:"read",fn:Du,data:{}};function Ds(e){return e==="x"?"y":"x"}function Hu(e){var t=e.state,i=e.options,n=e.name,s=i.mainAxis,r=s===void 0?!0:s,o=i.altAxis,a=o===void 0?!1:o,l=i.boundary,d=i.rootBoundary,c=i.altBoundary,u=i.padding,m=i.tether,p=m===void 0?!0:m,h=i.tetherOffset,g=h===void 0?0:h,y=$e(t,{boundary:l,rootBoundary:d,padding:u,altBoundary:c}),E=he(t.placement),T=Pe(t.placement),C=!T,f=Pt(E),x=Ds(f),S=t.modifiersData.popperOffsets,A=t.rects.reference,O=t.rects.popper,b=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,k=typeof b=="number"?{mainAxis:b,altAxis:b}:Object.assign({mainAxis:0,altAxis:0},b),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,H={x:0,y:0};if(S){if(r){var M,K=f==="y"?Z:te,Y=f==="y"?oe:ie,ne=f==="y"?"height":"width",q=S[f],Q=q+y[K],Se=q-y[Y],_=p?-O[ne]/2:0,P=T===et?A[ne]:O[ne],F=T===et?-O[ne]:-A[ne],D=t.elements.arrow,$=p&&D?It(D):{width:0,height:0},ce=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Pi(),se=ce[K],Ee=ce[Y],ye=Rt(0,A[ne],$[ne]),me=C?A[ne]/2-_-ye-se-k.mainAxis:P-ye-se-k.mainAxis,xe=C?-A[ne]/2+_+ye+Ee+k.mainAxis:F+ye+Ee+k.mainAxis,ge=t.elements.arrow&&He(t.elements.arrow),st=ge?f==="y"?ge.clientTop||0:ge.clientLeft||0:0,rt=(M=N?.[f])!=null?M:0,Wi=q+me-rt-st,zi=q+xe-rt,pi=Rt(p?_t(Q,Wi):Q,q,p?De(Se,zi):Se);S[f]=pi,H[f]=pi-q}if(a){var fi,Ji=f==="x"?Z:te,Xi=f==="x"?oe:ie,Ge=S[x],ot=x==="y"?"height":"width",mi=Ge+y[Ji],vt=Ge-y[Xi],gi=[Z,te].indexOf(E)!==-1,Ki=(fi=N?.[x])!=null?fi:0,Gi=gi?mi:Ge-A[ot]-O[ot]-Ki+k.altAxis,Yi=gi?Ge+A[ot]+O[ot]-Ki-k.altAxis:vt,Qi=p&&gi?ma(Gi,Ge,Yi):Rt(p?Gi:mi,Ge,p?Yi:vt);S[x]=Qi,H[x]=Qi-Ge}t.modifiersData[n]=H}}var Aa={name:"preventOverflow",enabled:!0,phase:"main",fn:Hu,requiresIfExists:["offset"]};function Hs(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function $s(e){return e===J(e)||!ae(e)?Ot(e):Hs(e)}function $u(e){var t=e.getBoundingClientRect(),i=tt(t.width)/e.offsetWidth||1,n=tt(t.height)/e.offsetHeight||1;return i!==1||n!==1}function Ns(e,t,i){i===void 0&&(i=!1);var n=ae(t),s=ae(t)&&$u(t),r=pe(t),o=Ie(e,s,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&((de(t)!=="body"||Dt(r))&&(a=$s(t)),ae(t)?(l=Ie(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=Mt(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Nu(e){var t=new Map,i=new Set,n=[];e.forEach(function(r){t.set(r.name,r)});function s(r){i.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);
vendor: 7,988 bytes, line 318
318o.forEach(function(a){if(!i.has(a)){var l=t.get(a);l&&s(l)}}),n.push(r)}return e.forEach(function(r){i.has(r.name)||s(r)}),n}function Fs(e){var t=Nu(e);return pa.reduce(function(i,n){return i.concat(t.filter(function(s){return s.phase===n}))},[])}function Bs(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function qs(e){var t=e.reduce(function(i,n){var s=i[n.name];return i[n.name]=s?Object.assign({},s,n,{options:Object.assign({},s.options,n.options),data:Object.assign({},s.data,n.data)}):n,i},{});return Object.keys(t).map(function(i){return t[i]})}var La={placement:"bottom",modifiers:[],strategy:"absolute"};function _a(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function Ia(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,n=i===void 0?[]:i,s=t.defaultOptions,r=s===void 0?La:s;return function(a,l,d){d===void 0&&(d=r);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},La,r),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},u=[],m=!1,p={state:c,setOptions:function(E){var T=typeof E=="function"?E(c.options):E;g(),c.options=Object.assign({},r,c.options,T),c.scrollParents={reference:_e(a)?ut(a):a.contextElement?ut(a.contextElement):[],popper:ut(l)};var C=Fs(qs([].concat(n,c.options.modifiers)));return c.orderedModifiers=C.filter(function(f){return f.enabled}),h(),p.update()},forceUpdate:function(){if(!m){var E=c.elements,T=E.reference,C=E.popper;if(_a(T,C)){c.rects={reference:Ns(T,He(C),c.options.strategy==="fixed"),popper:It(C)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(k){return c.modifiersData[k.name]=Object.assign({},k.data)});for(var f=0;f<c.orderedModifiers.length;f++){if(c.reset===!0){c.reset=!1,f=-1;continue}var x=c.orderedModifiers[f],S=x.fn,A=x.options,O=A===void 0?{}:A,b=x.name;typeof S=="function"&&(c=S({state:c,options:O,name:b,instance:p})||c)}}}},update:Bs(function(){return new Promise(function(y){p.forceUpdate(),y(c)})}),destroy:function(){g(),m=!0}};if(!_a(a,l))return p;p.setOptions(d).then(function(y){!m&&d.onFirstUpdate&&d.onFirstUpdate(y)});function h(){c.orderedModifiers.forEach(function(y){var E=y.name,T=y.options,C=T===void 0?{}:T,f=y.effect;if(typeof f=="function"){var x=f({state:c,name:E,instance:p,options:C}),S=function(){};u.push(x||S)}})}function g(){u.forEach(function(y){return y()}),u=[]}return p}}var Fu=[ya,Ta,ba,Li,Ca,Sa,Aa,ga,ka],js=Ia({defaultModifiers:Fu});var Bu="tippy-box",Ba="tippy-content",qu="tippy-backdrop",qa="tippy-arrow",ja="tippy-svg-arrow",Ht={passive:!0,capture:!0},Ua=function(){return document.body};function Us(e,t,i){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(i)?i[t]:i)}return e}function Gs(e,t){var i={}.toString.call(e);return i.indexOf("[object")===0&&i.indexOf(t+"]")>-1}function Va(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Pa(e,t){if(t===0)return e;var i;return function(n){clearTimeout(i),i=setTimeout(function(){e(n)},t)}}function ju(e){return e.split(/\s+/).filter(Boolean)}function si(e){return[].concat(e)}function Ra(e,t){e.indexOf(t)===-1&&e.push(t)}function Uu(e){return e.filter(function(t,i){return e.indexOf(t)===i})}function Vu(e){return e.split("-")[0]}function _n(e){return[].slice.call(e)}function Oa(e){return Object.keys(e).reduce(function(t,i){return e[i]!==void 0&&(t[i]=e[i]),t},{})}function Di(){return document.createElement("div")}function In(e){return["Element","Fragment"].some(function(t){return Gs(e,t)})}function Wu(e){return Gs(e,"NodeList")}function Wa(e){return Gs(e,"MouseEvent")}function zu(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function Ju(e){return In(e)?[e]:Wu(e)?_n(e):Array.isArray(e)?e:_n(document.querySelectorAll(e))}function Vs(e,t){e.forEach(function(i){i&&(i.style.transitionDuration=t+"ms")})}function Ma(e,t){e.forEach(function(i){i&&i.setAttribute("data-state",t)})}function za(e){var t,i=si(e),n=i[0];return n!=null&&(t=n.ownerDocument)!=null&&t.body?n.ownerDocument:document}function Xu(e,t){var i=t.clientX,n=t.clientY;return e.every(function(s){var r=s.popperRect,o=s.popperState,a=s.props,l=a.interactiveBorder,d=Vu(o.placement),c=o.modifiersData.offset;if(!c)return!0;var u=d==="bottom"?c.top.y:0,m=d==="top"?c.bottom.y:0,p=d==="right"?c.left.x:0,h=d==="left"?c.right.x:0,g=r.top-n+u>l,y=n-r.bottom-m>l,E=r.left-i+p>l,T=i-r.right-h>l;return g||y||E||T})}function Ws(e,t,i){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(s){e[n](s,i)})}function Da(e,t){for(var i=t;i;){var n;if(e.contains(i))return!0;i=i.getRootNode==null||(n=i.getRootNode())==null?void 0:n.host}return!1}var Je={isTouch:!1},Ha=0;function Ku(){Je.isTouch||(Je.isTouch=!0,window.performance&&document.addEventListener("mousemove",Ja))}function Ja(){var e=performance.now();e-Ha<20&&(Je.isTouch=!1,document.removeEventListener("mousemove",Ja)),Ha=e}function Gu(){var e=document.activeElement;if(zu(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function Yu(){document.addEventListener("touchstart",Ku,Ht),window.addEventListener("blur",Gu)}var Qu=typeof window<"u"&&typeof document<"u",Zu=Qu?!!window.msCrypto:!1;var ep={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tp={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ne=Object.assign({appendTo:Ua,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},ep,tp),ip=Object.keys(Ne),np=function(t){var i=Object.keys(t);i.forEach(function(n){Ne[n]=t[n]})};function Xa(e){var t=e.plugins||[],i=t.reduce(function(n,s){var r=s.name,o=s.defaultValue;if(r){var a;n[r]=e[r]!==void 0?e[r]:(a=Ne[r])!=null?a:o}return n},{});return Object.assign({},e,i)}function sp(e,t){var i=t?Object.keys(Xa(Object.assign({},Ne,{plugins:t}))):ip,n=i.reduce(function(s,r){var o=(e.getAttribute("data-tippy-"+r)||"").trim();if(!o)return s;if(r==="content")s[r]=o;else try{s[r]=JSON.parse(o)}catch{s[r]=o}return s},{});return n}function $a(e,t){var i=Object.assign({},t,{content:Va(t.content,[e])},t.ignoreAttributes?{}:sp(e,t.plugins));return i.aria=Object.assign({},Ne.aria,i.aria),i.aria={expanded:i.aria.expanded==="auto"?t.interactive:i.aria.expanded,content:i.aria.content==="auto"?t.interactive?null:"describedby":i.aria.content},i}var rp=function(){return"innerHTML"};function Js(e,t){e[rp()]=t}function Na(e){var t=Di();return e===!0?t.className=qa:(t.className=ja,In(e)?t.appendChild(e):Js(t,e)),t}function Fa(e,t){In(t.content)?(Js(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Js(e,t.content):e.textContent=t.content)}function Xs(e){var t=e.firstElementChild,i=_n(t.children);return{box:t,content:i.find(function(n){return n.classList.contains(Ba)}),arrow:i.find(function(n){return n.classList.contains(qa)||n.classList.contains(ja)}),backdrop:i.find(function(n){return n.classList.contains(qu)})}}function Ka(e){var t=Di(),i=Di();i.className=Bu,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=Di();n.className=Ba,n.setAttribute("data-state","hidden"),Fa(n,e.props),t.appendChild(i),i.appendChild(n),s(e.props,e.props);function s(r,o){var a=Xs(t),l=a.box,d=a.content,c=a.arrow;o.theme?l.setAttribute("data-theme",o.theme):l.removeAttribute("data-theme"),typeof o.animation=="str
318ing"?l.setAttribute("data-animation",o.animation):l.removeAttribute("data-animation"),o.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?l.setAttribute("role",o.role):l.removeAttribute("role"),(r.content!==o.content||r.allowHTML!==o.allowHTML)&&Fa(d,e.props),o.arrow?c?r.arrow!==o.arrow&&(l.removeChild(c),l.appendChild(Na(o.arrow))):l.appendChild(Na(o.arrow)):c&&l.removeChild(c)}return{popper:t,onUpdate:s}}Ka.$$tippy=!0;var op=1,An=[],zs=[];function ap(e,t){var i=$a(e,Object.assign({},Ne,Xa(Oa(t)))),n,s,r,o=!1,a=!1,l=!1,d=!1,c,u,m,p=[],h=Pa(Wi,i.interactiveDebounce),g,y=op++,E=null,T=Uu(i.plugins),C={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},f={id:y,reference:e,popper:Di(),popperInstance:E,props:i,state:C,plugins:T,clearDelayTimeouts:Gi,setProps:Yi,setContent:Qi,show:Kc,hide:Gc,hideWithInteractivity:Yc,enable:gi,disable:Ki,unmount:Qc,destroy:Zc};if(!i.render)return f;var x=i.render(f),S=x.popper,A=x.onUpdate;S.setAttribute("data-tippy-root",""),S.id="tippy-"+f.id,f.popper=S,e._tippy=f,S._tippy=f;var O=T.map(function(w){return w.fn(f)}),b=e.hasAttribute("aria-expanded");return ge(),_(),q(),Q("onCreate",[f]),i.showOnCreate&&mi(),S.addEventListener("mouseenter",function(){f.props.interactive&&f.state.isVisible&&f.clearDelayTimeouts()}),S.addEventListener("mouseleave",function(){f.props.interactive&&f.props.trigger.indexOf("mouseenter")>=0&&K().addEventListener("mousemove",h)}),f;function k(){var w=f.props.touch;return Array.isArray(w)?w:[w,0]}function N(){return k()[0]==="hold"}function H(){var w;return!!((w=f.props.render)!=null&&w.$$tippy)}function M(){return g||e}function K(){var w=M().parentNode;return w?za(w):document}function Y(){return Xs(S)}function ne(w){return f.state.isMounted&&!f.state.isVisible||Je.isTouch||c&&c.type==="focus"?0:Us(f.props.delay,w?0:1,Ne.delay)}function q(w){w===void 0&&(w=!1),S.style.pointerEvents=f.props.interactive&&!w?"":"none",S.style.zIndex=""+f.props.zIndex}function Q(w,L,R){if(R===void 0&&(R=!0),O.forEach(function(j){j[w]&&j[w].apply(j,L)}),R){var V;(V=f.props)[w].apply(V,L)}}function Se(){var w=f.props.aria;if(w.content){var L="aria-"+w.content,R=S.id,V=si(f.props.triggerTarget||e);V.forEach(function(j){var ve=j.getAttribute(L);if(f.state.isVisible)j.setAttribute(L,ve?ve+" "+R:R);else{var Ae=ve&&ve.replace(R,"").trim();Ae?j.setAttribute(L,Ae):j.removeAttribute(L)}})}}function _(){if(!(b||!f.props.aria.expanded)){var w=si(f.props.triggerTarget||e);w.forEach(function(L){f.props.interactive?L.setAttribute("aria-expanded",f.state.isVisible&&L===M()?"true":"false"):L.removeAttribute("aria-expanded")})}}function P(){K().removeEventListener("mousemove",h),An=An.filter(function(w){return w!==h})}function F(w){if(!(Je.isTouch&&(l||w.type==="mousedown"))){var L=w.composedPath&&w.composedPath()[0]||w.target;if(!(f.props.interactive&&Da(S,L))){if(si(f.props.triggerTarget||e).some(function(R){return Da(R,L)})){if(Je.isTouch||f.state.isVisible&&f.props.trigger.indexOf("click")>=0)return}else Q("onClickOutside",[f,w]);f.props.hideOnClick===!0&&(f.clearDelayTimeouts(),f.hide(),a=!0,setTimeout(function(){a=!1}),f.state.isMounted||se())}}}function D(){l=!0}function $(){l=!1}function ce(){var w=K();w.addEventListener("mousedown",F,!0),w.addEventListener("touchend",F,Ht),w.addEventListener("touchstart",$,Ht),w.addEventListener("touchmove",D,Ht)}function se(){var w=K();w.removeEventListener("mousedown",F,!0),w.removeEventListener("touchend",F,Ht),w.removeEventListener("touchstart",$,Ht),w.removeEventListener("touchmove",D,Ht)}function Ee(w,L){me(w,function(){!f.state.isVisible&&S.parentNode&&S.parentNode.contains(S)&&L()})}function ye(w,L){me(w,L)}function me(w,L){var R=Y().box;function V(j){j.target===R&&(Ws(R,"remove",V),L())}if(w===0)return L();Ws(R,"remove",u),Ws(R,"add",V),u=V}function xe(w,L,R){R===void 0&&(R=!1);var V=si(f.props.triggerTarget||e);V.forEach(function(j){j.addEventListener(w,L,R),p.push({node:j,eventType:w,handler:L,options:R})})}function ge(){N()&&(xe("touchstart",rt,{passive:!0}),xe("touchend",zi,{passive:!0})),ju(f.props.trigger).forEach(function(w){if(w!=="manual")switch(xe(w,rt),w){case"mouseenter":xe("mou
318seleave",zi);break;case"focus":xe(Zu?"focusout":"blur",pi);break;case"focusin":xe("focusout",pi);break}})}function st(){p.forEach(function(w){var L=w.node,R=w.eventType,V=w.handler,j=w.options;L.removeEventListener(R,V,j)}),p=[]}function rt(w){var L,R=!1;if(!(!f.state.isEnabled||fi(w)||a)){var V=((L=c)==null?void 0:L.type)==="focus";c=w,g=w.currentTarget,_(),!f.state.isVisible&&Wa(w)&&An.forEach(function(j){return j(w)}),w.type==="click"&&(f.props.trigger.indexOf("mouseenter")<0||o)&&f.props.hideOnClick!==!1&&f.state.isVisible?R=!0:mi(w),w.type==="click"&&(o=!R),R&&!V&&vt(w)}}function Wi(w){var L=w.target,R=M().contains(L)||S.contains(L);if(!(w.type==="mousemove"&&R)){var V=ot().concat(S).map(function(j){var ve,Ae=j._tippy,jt=(ve=Ae.popperInstance)==null?void 0:ve.state;return jt?{popperRect:j.getBoundingClientRect(),popperState:jt,props:i}:null}).filter(Boolean);Xu(V,w)&&(P(),vt(w))}}function zi(w){var L=fi(w)||f.props.trigger.indexOf("click")>=0&&o;if(!L){if(f.props.interactive){f.hideWithInteractivity(w);return}vt(w)}}function pi(w){f.props.trigger.indexOf("focusin")<0&&w.target!==M()||f.props.interactive&&w.relatedTarget&&S.contains(w.relatedTarget)||vt(w)}function fi(w){return Je.isTouch?N()!==w.type.indexOf("touch")>=0:!1}function Ji(){Xi();var w=f.props,L=w.popperOptions,R=w.placement,V=w.offset,j=w.getReferenceClientRect,ve=w.moveTransition,Ae=H()?Xs(S).arrow:null,jt=j?{getBoundingClientRect:j,contextElement:j.contextElement||M()}:e,kr={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Zi){var Ut=Zi.state;if(H()){var ed=Y(),Jn=ed.box;["placement","reference-hidden","escaped"].forEach(function(en){en==="placement"?Jn.setAttribute("data-placement",Ut.placement):Ut.attributes.popper["data-popper-"+en]?Jn.setAttribute("data-"+en,""):Jn.removeAttribute("data-"+en)}),Ut.attributes.popper={}}}},bt=[{name:"offset",options:{offset:V}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ve}},kr];H()&&Ae&&bt.push({name:"arrow",options:{element:Ae,padding:3}}),bt.push.apply(bt,L?.modifiers||[]),f.popperInstance=js(jt,S,Object.assign({},L,{placement:R,onFirstUpdate:m,modifiers:bt}))}function Xi(){f.popperInstance&&(f.popperInstance.destroy(),f.popperInstance=null)}function Ge(){var w=f.props.appendTo,L,R=M();f.props.interactive&&w===Ua||w==="parent"?L=R.parentNode:L=Va(w,[R]),L.contains(S)||L.appendChild(S),f.state.isMounted=!0,Ji()}function ot(){return _n(S.querySelectorAll("[data-tippy-root]"))}function mi(w){f.clearDelayTimeouts(),w&&Q("onTrigger",[f,w]),ce();var L=ne(!0),R=k(),V=R[0],j=R[1];Je.isTouch&&V==="hold"&&j&&(L=j),L?n=setTimeout(function(){f.show()},L):f.show()}function vt(w){if(f.clearDelayTimeouts(),Q("onUntrigger",[f,w]),!f.state.isVisible){se();return}if(!(f.props.trigger.indexOf("mouseenter")>=0&&f.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(w.type)>=0&&o)){var L=ne(!1);L?s=setTimeout(function(){f.state.isVisible&&f.hide()},L):r=requestAnimationFrame(function(){f.hide()})}}function gi(){f.state.isEnabled=!0}function Ki(){f.hide(),f.state.isEnabled=!1}function Gi(){clearTimeout(n),clearTimeout(s),cancelAnimationFrame(r)}function Yi(w){if(!f.state.isDestroyed){Q("onBeforeUpdate",[f,w]),st();var L=f.props,R=$a(e,Object.assign({},L,Oa(w),{ignoreAttributes:!0}));f.props=R,ge(),L.interactiveDebounce!==R.interactiveDebounce&&(P(),h=Pa(Wi,R.interactiveDebounce)),L.triggerTarget&&!R.triggerTarget?si(L.triggerTarget).forEach(function(V){V.removeAttribute("aria-expanded")}):R.triggerTarget&&e.removeAttribute("aria-expanded"),_(),q(),A&&A(L,R),f.popperInstance&&(Ji(),ot().forEach(function(V){requestAnimationFrame(V._tippy.popperInstance.forceUpdate)})),Q("onAfterUpdate",[f,w])}}function Qi(w){f.setProps({content:w})}function Kc(){var w=f.state.isVisible,L=f.state.isDestroyed,R=!f.state.isEnabled,V=Je.isTouch&&!f.props.touch,j=Us(f.props.duration,0,Ne.duration);if(!(w||L||R||V)&&!M().hasAttribute("disabled")&&(Q("onShow",[f],!1),f.props.onShow(f)!==!1)){if(f.state.isVisible=!0,H()&&(S.style.visibility="visible"),q(),ce(),f.state.isMounted||(S.style.transition="none"),H()){var ve=Y(),Ae=ve.box,jt=ve.content;Vs([Ae,jt],0)}m=function(){var bt;if(!(!f.state.isVisible||d)){if(d=!0,S.offsetHeight,S.style.transition=f.props.moveTransition,H()&&f.props.animation){var zn=Y(),Zi=zn.box,Ut=zn.content;Vs([Zi,Ut],j),Ma([Zi,Ut],"visible")}Se(),_(),Ra(zs,f),(bt=f.popperInstance)==null||bt.forceUpdate(),Q("onMount",[f]),f.props.animation&&H()&&ye(j,function(){f.state.isShown=!0,Q("onShown",[f])})}},Ge()}}function Gc(){var w=!f.state.isVisible,L=f.state.isDestroyed,R=!f.state.isEnabled,V=Us(f.props.duration,1,Ne.duration);
318if(!(w||L||R)&&(Q("onHide",[f],!1),f.props.onHide(f)!==!1)){if(f.state.isVisible=!1,f.state.isShown=!1,d=!1,o=!1,H()&&(S.style.visibility="hidden"),P(),se(),q(!0),H()){var j=Y(),ve=j.box,Ae=j.content;f.props.animation&&(Vs([ve,Ae],V),Ma([ve,Ae],"hidden"))}Se(),_(),f.props.animation?H()&&Ee(V,f.unmount):f.unmount()}}function Yc(w){K().addEventListener("mousemove",h),Ra(An,h),h(w)}function Qc(){f.state.isVisible&&f.hide(),f.state.isMounted&&(Xi(),ot().forEach(function(w){w._tippy.unmount()}),S.parentNode&&S.parentNode.removeChild(S),zs=zs.filter(function(w){return w!==f}),f.state.isMounted=!1,Q("onHidden",[f]))}function Zc(){f.state.isDestroyed||(f.clearDelayTimeouts(),f.unmount(),st(),delete e._tippy,f.state.isDestroyed=!0,Q("onDestroy",[f]))}}function Hi(e,t){t===void 0&&(t={});var i=Ne.plugins.concat(t.plugins||[]);Yu();var n=Object.assign({},t,{plugins:i}),s=Ju(e);if(0)var r,o;var a=s.reduce(function(l,d){var c=d&&ap(d,n);return c&&l.push(c),l},[]);return In(e)?a[0]:a}Hi.defaultProps=Ne;Hi.setDefaultProps=np;Hi.currentInput=Je;var Iw=Object.assign({},Li,{effect:function(t){var i=t.state,n={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(i.elements.popper.style,n.popper),i.styles=n,i.elements.arrow&&Object.assign(i.elements.arrow.style,n.arrow)}});var Ks={clientX:0,clientY:0},Ln=[];function Ga(e){var t=e.clientX,i=e.clientY;Ks={clientX:t,clientY:i}}function lp(e){e.addEventListener("mousemove",Ga)}function cp(e){e.removeEventListener("mousemove",Ga)}var Ya={name:"followCursor",defaultValue:!1,fn:function(t){var i=t.reference,n=za(t.props.triggerTarget||i),s=!1,r=!1,o=!0,a=t.props;function l(){return t.props.followCursor==="initial"&&t.state.isVisible}function d(){n.addEventListener("mousemove",m)}function c(){n.removeEventListener("mousemove",m)}function u(){s=!0,t.setProps({getReferenceClientRect:null}),s=!1}function m(g){var y=g.target?i.contains(g.target):!0,E=t.props.followCursor,T=g.clientX,C=g.clientY,f=i.getBoundingClientRect(),x=T-f.left,S=C-f.top;(y||!t.props.interactive)&&t.setProps({getReferenceClientRect:function(){var O=i.getBoundingClientRect(),b=T,k=C;E==="initial"&&(b=O.left+x,k=O.top+S);var N=E==="horizontal"?O.top:k,H=E==="vertical"?O.right:b,M=E==="horizontal"?O.bottom:k,K=E==="vertical"?O.left:b;return{width:H-K,height:M-N,top:N,right:H,bottom:M,left:K}}})}function p(){t.props.followCursor&&(Ln.push({instance:t,doc:n}),lp(n))}function h(){Ln=Ln.filter(function(g){return g.instance!==t}),Ln.filter(function(g){return g.doc===n}).length===0&&cp(n)}return{onCreate:p,onDestroy:h,onBeforeUpdate:function(){a=t.props},onAfterUpdate:function(y,E){var T=E.followCursor;s||T!==void 0&&a.followCursor!==T&&(h(),T?(p(),t.state.isMounted&&!r&&!l()&&d()):(c(),u()))},onMount:function(){t.props.followCursor&&!r&&(o&&(m(Ks),o=!1),l()||d())},onTrigger:function(y,E){Wa(E)&&(Ks={clientX:E.clientX,clientY:E.clientY}),r=E.type==="focus"},onHidden:function(){t.props.followCursor&&(u(),c(),o=!0)}}}};Hi.setDefaultProps({render:Ka});var $i=Hi;var dp={mounted(){this.instances=[],this.initialized=!1,this.tooltipElements=Array.from(this.getElements(this.el)),this.setupTooltipHover(),this.el.hasAttribute("tooltip-lazy-init")?this.setupLazyInit():this.init()},updated(){this.el.hasAttribute("tooltip-skip-update")||!this.initialized||this.instances.forEach(e=>{this.updateTooltipContent(e)})},destroyed(){this.teardownLazyInit(),this.teardownTooltipHover(),this.instances.forEach(e=>{e.destroy()})},init(){if(this.initialized)return;this.initialized=!0,this.teardownLazyInit(),this.instances=$i(this.tooltipElements,{touch:!this.el.hasAttribute("tooltip-disable-touch"),inertia:!0,allowHTML:!0,ignoreAttributes:!0,interactive:!this.el.hasAttribute("tooltip-non-interactive"),aria:{expanded:!1},appendTo:()=>this.el.hasAttribute("tooltip-append-to")?document.querySelector(this.el.getAttribute("tooltip-append-to")):document.body,followCursor:this.el.getAttribute("tooltip-follow-cursor"),plugins:[Ya],onShow(t){let n=t.reference.closest("[phx-hook=HasTooltip]")?.getAttribute("tooltip-disable-if");if(n&&document.querySelector(n))return!1;t.popper.querySelector(".ss-close-tippy")&&t.popper.querySelector(".ss-close-tippy").addEventListener("click",()=>{t.hide()})},onHide(t){t.popper.querySelector(".ss-close-tippy")&&t.popper.querySelector(".ss-close-tippy").removeEventListener("click",()=>{t.hide()})},onHidden(t){let i=t.reference.closest("[phx-hook=HasTooltip]");i?.hasAttribute("tooltip-nocache")&&i.removeAttribute("lazy-tooltip-loaded")},onMount(t){let i=t.reference.closest("[data-dt-color-scheme]");t.popper.parentElement?.closest("[data-dt-color-scheme]")?t.popper.removeAttribute("data-dt-color-scheme"):i&&t.popper.setAttribute("data-dt-color-scheme",i.getAttribute("data-dt-color-scheme")),e(t.popper)},theme:this.el.getAttribute("tooltip-theme"),placement:this.el.getAttribute("tooltip-placement")||"top",delay:[this.el.hasAttribute("tooltip-show-delay")?Number(this.el.getAttribute("tooltip-show-delay")):400,this.el.hasAttribute("tooltip-hide-delay")?Number(this.el.getAttribute("tooltip-hide-delay")):400],content:t=>this.getTooltipContent(t)});function e(t){let i=t.querySelector("[truncatable-content]");if(!i||!s(i))return;t.querySelector("[data-show-on-truncate-content]")?.classList.remove("hidden");function s(r){return r.scrollHeight>r.clientHeight}}},setupTooltipHover(){this.el.hasAttribute("tooltip-hover")&&(this.tooltipHoverListener=e=>{if(this.el.hasAttribute("lazy-tooltip-loaded"))return;let t=this.el.getAttribute("phx-target"),i=this.el.getAttribute("tooltip-hover"),n=this.el.getAttribute("tooltip-hover-value"),s=this.el.getAttribute("tooltip-hover-trigger");t?this.pushEventTo(t,i,{value:n,trigger:s}):this.pushEvent(i,{value:n,trigger:s})},this.el.addEventListener("mouseenter",this.tooltipHoverListener))},teardownTooltipHover(){this.tooltipHoverListener&&(this.el.removeEventListener("mouseenter",this.tooltipHoverListener),this.tooltipHoverListener=null)}
318,setupLazyInit(){this.lazyInitListeners=this.tooltipElements.flatMap(e=>{let t=()=>{this.init(),this.showTooltip(e)};return e.addEventListener("mouseenter",t),e.addEventListener("focus",t),[{element:e,eventName:"mouseenter",handler:t},{element:e,eventName:"focus",handler:t}]})},teardownLazyInit(){this.lazyInitListeners&&(this.lazyInitListeners.forEach(({element:e,eventName:t,handler:i})=>{e.removeEventListener(t,i)}),this.lazyInitListeners=null)},showTooltip(e){this.instances.find(i=>i.reference===e)?.show()},updateTooltipContent(e){let t=this.getTooltipContent(e.reference);e.setContent(t)},getTooltipContent(e){let t=e.closest("[phx-hook=HasTooltip]");if(t?.hasAttribute("tooltip-content"))return t.getAttribute("tooltip-content");if(t?.hasAttribute("tooltip-content-id")){let i=t.getAttribute("tooltip-content-id");return document.querySelector(`[tooltip-id=${i}]`)?.innerHTML||""}return""},getElements(e){return e.hasAttribute("tooltipV2")?[e.children[0]]:e.hasAttribute("tooltip-multi-target")?e.querySelectorAll("[tooltip-target]"):[e]}},Qa=dp;var Za={mounted(){this.played=!1,new IntersectionObserver(([e])=>{e.isIntersecting&&e.intersectionRatio===1&&!this.played&&(this.el.play(),this.played=!0)},{threshold:1}).observe(this.el)}};var hp={mounted(){this.currentRow=null,this.handleKeydown=this.handleKeydown.bind(this),this.el.addEventListener("click",e=>{let t=e.target.closest("button[data-import-option]");if(t)this.selectOption(t);else{let i=e.target.closest("[data-row]");i&&this.selectRow(i)}}),document.addEventListener("keydown",this.handleKeydown)},getNextRow(e){let i=Array.from(this.el.querySelectorAll("[data-row]")).map(s=>parseInt(s.dataset.position,10)).sort((s,r)=>s-r),n=i.indexOf(e);if(n!==-1&&n<i.length-1){let s=n+1,r=i[s];return this.el.querySelector(`[data-row][data-position="${r}"]`)}return null},getPreviousRow(e){let i=Array.from(this.el.querySelectorAll("[data-row]")).map(s=>parseInt(s.dataset.position,10)).sort((s,r)=>s-r),n=i.indexOf(e);if(n>0){let s=n-1,r=i[s];return this.el.querySelector(`[data-row][data-position="${r}"]`)}return null},handleKeydown(e){if(!this.currentRow){let i=this.el.querySelector("[data-row]");i&&this.selectRow(i);return}let t=parseInt(this.currentRow.dataset.position,10);if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault();let i=e.key==="ArrowDown"?this.getNextRow(t):this.getPreviousRow(t);
318i&&this.selectRow(i)}else if(e.key==="Enter"||e.key===" "){e.preventDefault();let i=this.getNextRow(t);i&&this.selectRow(i)}else if(/^[1-5a-e]$/i.test(e.key)){e.preventDefault();let i=e.key.match(/\d/)?String.fromCharCode(96+parseInt(e.key,10)):e.key.toLowerCase(),n=this.currentRow.querySelector(`button[data-letter="${i}"]`);n&&this.selectOptionViaKeyboard(n)}else if(e.key==="Delete"||e.key==="Backspace"){e.preventDefault();let i=this.currentRow.querySelector('button[data-selected="true"]');i&&(i.dataset.selected="false",this.pushEvent("deselect",{item_id:i.dataset.importItem,option_id:i.dataset.importOption,position:parseInt(this.currentRow.dataset.position,10)}))}},selectOption(e){let t=e.closest("[data-row]"),i=e.dataset.importItem;if(e.dataset.selected==="true")this.pushEvent("deselect",{item_id:i,letter:e.dataset.letter,position:parseInt(t.dataset.position,10)});else{t.querySelectorAll("button").forEach(s=>{s.dataset.selected="false"}),e.dataset.selected="true";let n=parseInt(t.dataset.position,10);this.pushEvent("select",{item_id:i,letter:e.dataset.letter,position:n}),this.selectRow(t)}},selectOptionViaKeyboard(e){let t=e.closest("[data-row]"),i=e.dataset.importItem;t.querySelectorAll("button").forEach(o=>{o.dataset.selected="false"}),e.dataset.selected="true",this.selectRow(t);let n=parseInt(t.dataset.position,10),s=this.getNextRow(n),r=s?parseInt(s.dataset.position,10):null;this.pushEvent("select",{item_id:i,letter:e.dataset.letter,position:r}),s&&this.selectRow(s)},selectRow(e){this.el.querySelectorAll("[data-row]").forEach(t=>{t.dataset.selected="false"}),e.dataset.selected="true",this.currentRow=e,e.scrollIntoView({behavior:"smooth",block:"nearest"})},destroyed(){document.removeEventListener("keydown",this.handleKeydown)}},el=hp;var up={mounted(){let e=this.el.dataset.scrollContainer?document.querySelector(this.el.dataset.scrollContainer):null,t=this.el.dataset.rootMargin||"0px 0px 800px 0px";this.pending=!1,this.observer=new IntersectionObserver(i=>this.loadMore(i),{root:e,rootMargin:t,threshold:0}),this.observer.observe(this.el)},loadMore(e){this.pending||!e.some(t=>t.isIntersecting)||(this.pending=!0,this.watchdog=setTimeout(()=>this.loadComplete(),1e4),this.mutationObserver=new MutationObserver(()=>this.loadComplete()),this.el.parentElement&&this.mutationObserver.observe(this.el.parentElement,{childList:!0,subtree:!0}),this.js().exec(this.el.getAttribute("phx-click")))},updated(){this.pending&&this.loadComplete()},loadComplete(){clearTimeout(this.watchdog),this.mutationObserver?.disconnect(),this.mutationObserver=null,this.pending=!1,this.observer.unobserve(this.el),this.observer.observe(this.el)},beforeDestroy(){clearTimeout(this.watchdog),this.mutationObserver?.disconnect(),this.observer.unobserve(this.el)}},tl=up;var il={mounted(){this.mainContainer=document.querySelector("#main-container"),this.navbar=document.querySelector("#navbar"),this.drawerBg=this.el.querySelector(`#${this.el.id}-bg`),this.drawerContainer=this.el.querySelector(`#${this.el.id}-container`),this.mainContainer&&new ResizeObserver(debounce(this.handleResize.bind(this),200)).observe(this.mainContainer)},updated(){this.handleResize()},handleResize(){let e=document.querySelector("#drawer-panel"),t=e!=null&&e.offsetWidth>0&&e.offsetWidth!==document.body.offsetWidth,i=parseFloat(getComputedStyle(this.navbar).zIndex);t?this.drawerBg.style.zIndex=i-1:this.drawerBg.style.zIndex=i+1,this.drawerBg.style.maxWidth=getComputedStyle(this.mainContainer).width,this.drawerContainer.style.maxWidth=getComputedStyle(this.mainContainer).width,this.mainContainer.offsetWidth>=parseInt(this.el.dataset.hideMinWidth,10)&&(this.el.style.display="none",this.liveSocket.execJS(this.el,this.el.dataset.cancel))}};var pp={mounted(){let e=this.el.dataset.scrollContainer?document.querySelector(this.el.dataset.scrollContainer):null,t=this.el.dataset.rootMargin||"0px 0px 800px 0px";this.observer=new IntersectionObserver(i=>{i.some(n=>n.isIntersecting)&&this.js().exec(this.el.getAttribute("phx-click"))},{root:e,rootMargin:t,threshold:0}),this.observer.observe(this.el)},beforeDestroy(){this.observer.unobserve(this.el)}},nl=pp;var fp={updated(){function e(n,s){let r=n._tippy;r&&r.setContent(s.innerHTML)}let t=`[tooltip-hover-trigger=${this.el.getAttribute("trigger-id")}]`;document.querySelectorAll(t).forEach(n=>
318{n.setAttribute("lazy-tooltip-loaded",!0),n.hasAttribute("tooltip-multi-target")?n.querySelectorAll("[tooltip-target]").forEach(s=>{e(s,this.el)}):e(n,this.el)})}},sl=fp;var rl={mounted(){let e=window.location.pathname+window.location.hash;/^\/discussion\/#\/.+/.test(e)&&(window.location.href=`https://classic.7sage.com${e}`)}};var mp={taggedEls:[],mounted(){this.mountFlashcards(this.el),this.mountQuiz(this.el),this.addHighlightOnHoverListeners(this.el)},addHighlightOnHoverListeners(e){this.taggedEls=Array.from(e.querySelectorAll("[data-highlight-id]")),this.taggedEls.forEach(t=>{let i=t.dataset.highlightId;this.addMouseEnterHighlightListener(t,i),this.addMouseLeaveHighlightListener(t,i)})},mountFlashcards(e){let t=Array.from(e.querySelectorAll("card"));t.sort(()=>Math.random()-.5).forEach(n=>{n.parentNode.appendChild(n)}),t.forEach(n=>{let s=document.createElement("card-inner");s.appendChild(n.querySelector("front")),s.appendChild(n.querySelector("back")),n.appendChild(s)})},mountQuiz(e){let t=e.querySelector("quiz");if(!t)return;t.querySelectorAll("question").forEach(s=>{s.dataset.originalText=s.innerText,s.contentEditable=!0;let r=document.createElement("div");r.classList.add("relative"),s.parentNode.replaceChild(r,s),r.appendChild(s);let o=document.createElement("span");o.classList.add("hero-arrow-path","tool","h-6","w-6","opacity-20","hover:opacity-75","active:opacity-100","cursor-pointer","px-2","absolute","top-[10px]","right-[10px]"),o.addEventListener("click",()=>{s.innerText=s.dataset.originalText}),r.appendChild(o)}),t.querySelectorAll("answer").forEach(s=>{s.classList.add("border-2","rounded-lg","px-6","py-3","m-6","bg-surface-base","hidden");let r=document.createElement("button");r.classList.add("block","px-4"),r.innerHTML="Answer",r.addEventListener("click",()=>{s.classList.toggle("hidden")}),t.insertBefore(r,s)})},addMouseEnterHighlightListener(e,t){e.addEventListener("mouseenter",()=>{this.taggedEls.filter(n=>n.dataset.highlightId===t).forEach(n=>{n.classList.add("bg-lesson-highlight")})})},addMouseLeaveHighlightListener(e,t){e.addEventListener("mouseout",()=>{this.taggedEls.filter(n=>n.dataset.highlightId===t).forEach(n=>{n.classList.remove("bg-lesson-highlight")})})}},ol=mp;var al="animate-mobile-menu-open",ll="animate-mobile-menu-close";var Ys=!1,cl={mounted(){Ys&&(Ys=!1,this.el.classList.add(al),this.el.addEventListener("animationend",()=>this.el.classList.remove(al),{once:!0}));let e=this.el.querySelector("#current-lesson");if(!e)return;let t=e.nextElementSibling||e;requestAnimationFrame(()=>{let i=t.getBoundingClientRect().top-this.el.getBoundingClientRect().top;this.el.scrollTop+=i-this.el.clientHeight/2+t.offsetHeight/2})}},dl={mounted(){this.el.addEventListener("click",()=>{let e=document.getElementById("sidebar");if(!e){Ys=!0,this.pushEvent("toggle-sidebar");return}if(e.classList.contains(ll))return;let t=!1,i=()=>{t||(t=!0,this.pushEvent("toggle-sidebar"))};e.classList.add(ll),e.addEventListener("animationend",i,{once:!0}),setTimeout(i,400)})}};var gp={mounted(){this.toggleFade(),this.el.querySelectorAll("img").forEach(e=>{e.complete||e.addEventListener("load",()=>this.toggleFade(),{once:!0})})},updated(){this.toggleFade()},toggleFade(){this.el.scrollHeight>this.el.clientHeight?this.el.classList.add("listing-body-overflow"):this.el.classList.remove("listing-body-overflow")}},hl=gp;var vp={mounted(){this.deadline=parseInt(this.el.dataset.deadline,10),this.span=this.el.querySelector("[data-countdown]"),this.render(),this.interval=setInterval(()=>this.render(),1e3)},updated(){this.deadline=parseInt(this.el.dataset.deadline,10),this.span=this.el.querySelector("[data-countdown]"),this.render()},destroyed(){this.interval&&clearInterval(this.interval)},render(){let e=this.deadline-Date.now();if(e<=0){this.interval&&clearInterval(this.interval),window.location.reload();return}if(!this.span)return;let t=Math.floor(e/1e3),i=Math.floor(t/3600),n=Math.floor(t%3600/60),s=t%60,r=o=>String(o).padStart(2,"0");this.span.textContent=`${r(i)}:${r(n)}:${r(s)}`}},ul=vp;var pl={mounted(){this.el.addEventListener("click",this.handler.bind(this),!0)},destroyed(){this.el.removeEventListener("click",this.handler.bind(this),!0)},handler(e){if(e.defaultPrevented)return;e.preventDefault(),e.stopImmediatePropagation();let t=this.getPhxEventName();t?.startsWith("[")&&this.liveSocket.execJS(this.el,t,"click")},getPhxEventName(){return this.el.getAttribute(this.liveSocket.b
318inding("click"))}};var Qs=null;async function Pn(){return Qs||(Qs=import("./plotly-basic-EOHUFJVR.js").then(e=>e.default)),Qs}var fl={async mounted(){let e=JSON.parse(this.el.dataset.chartOptions),t=this.el.dataset.enableHoverHighlight==="true";await this.createPlotlyChart(e,t)},async createPlotlyChart(e,t){let i=await Pn(),{data:n,layout:s,config:r}=e;i.newPlot(this.el,n,s,r),t&&this.setupHoverEvents(),this.resizePending=!1;let o=()=>{this.resizePending||(this.resizePending=!0,requestAnimationFrame(()=>{i.Plots.resize(this.el),this.resizePending=!1}))};this.resizeObserver=new ResizeObserver(debounce(o,200)),this.resizeObserver.observe(this.el)},setupHoverEvents(){this.cleanupHoverEvents(),this.originalOpacities=this.el.data.map(i=>i.opacity),this.originalMarkerSizes=this.el.data.map(i=>i.marker.size),this.highlightedCurve=null,this.hoverAnimationFrame=null,this.unhoverAnimationFrame=null;let e=async i=>{let n=i.points[0].curveNumber;this.originalOpacities[n]===1&&(this.hoverAnimationFrame&&cancelAnimationFrame(this.hoverAnimationFrame),this.hoverAnimationFrame=requestAnimationFrame(()=>{this.highlightSeries(n),this.hoverAnimationFrame=null}))},t=async()=>{this.unhoverAnimationFrame&&cancelAnimationFrame(this.unhoverAnimationFrame),this.unhoverAnimationFrame=requestAnimationFrame(()=>{this.resetSeriesOpacity(),this.unhoverAnimationFrame=null})};this.el.on("plotly_hover",e),this.el.on("plotly_unhover",t),this.hoverHandler=e,this.unhoverHandler=t},cleanupHoverEvents(){this.hoverAnimationFrame&&(cancelAnimationFrame(this.hoverAnimationFrame),this.hoverAnimationFrame=null),this.unhoverAnimationFrame&&(cancelAnimationFrame(this.unhoverAnimationFrame),this.unhoverAnimationFrame=null),this.hoverHandler&&(this.el.removeListener("plotly_hover",this.hoverHandler),this.hoverHandler=null),this.unhoverHandler&&(this.el.removeListener("plotly_unhover",this.unhoverHandler),this.unhoverHandler=null)},highlightSeries(e){this.highlightedCurve=e,this.el.querySelectorAll(".scatterlayer .trace").forEach((n,s)=>{n.style.opacity=s===e?"1":"0.15"});let i=document.querySelector("[data-school-rows]");i&&i.querySelectorAll("[data-school-index]").forEach((n,s)=>{n.style.opacity=s===e?"1":"0.15"})},resetSeriesOpacity(){this.highlightedCurve=null,this.el.querySelectorAll(".scatterlayer .trace").forEach(i=>{i.style.opacity=""});let t=document.querySelector("[data-school-rows]");t&&t.querySelectorAll("[data-school-index]").forEach(i=>{i.style.opacity=""})},async updated(){let e=await Pn(),t=JSON.parse(this.el.dataset.chartOptions),i=this.el.dataset.enableHoverHighlight==="true";requestAnimationFrame(()=>{e.react(this.el,t.data,t.layout,t.config),i&&this.setupHoverEvents()})},async setOptions(e){let t=await Pn(),{data:i,layout:n,config:s}=e,r=this.el.dataset.enableHoverHighlight==="true";requestAnimationFrame(()=>{t.react(this.el,i,n,s||{}),r&&this.setupHoverEvents()})},async destroyed(){this.cleanupHoverEvents(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),(await Pn()).purge(this.el)}};var bp={mounted(){this.handleToggle=e=>{e.newState==="open"&&this.positionMenu()},this.handleReposition=()=>{this.el.matches(":popover-open")&&this.positionMenu()},this.el.addEventListener("toggle",this.handleToggle),window.addEventListener("resize",this.handleReposition),window.addEventListener("scroll",this.handleReposition,!0)},positionMenu(){let e=document.querySelector(`[popovertarget="${CSS.escape(this.el.id)}"]`);if(!e)return;let t=e.getBoundingClientRect(),i=this.el.getBoundingClientRect(),n=8,s=t.bottom+n,r=t.right-i.width;s+i.height>window.innerHeight-n&&(s=Math.max(n,t.top-i.height-n)),r<n&&(r=n),Object.assign(this.el.style,{position:"fixed",inset:"auto",margin:"0",top:`${s}px`,left:`${r}px`})},destroyed(){this.el.removeEventListener("toggle",this.handleToggle),window.removeEventListener("resize",this.handleReposition),window.removeEventListener("scroll",this.handleReposition,!0)}},ml=bp;var gl={mounted(){this.lastClickedSortButton=null,this.lastClickedSortButtonRectTop=null,this.el.querySelectorAll("[data-questions-table-component-sort-button]").forEach(e
318=>{e.addEventListener("click",()=>{this.lastClickedSortButton=e,this.lastClickedSortButtonRectTop=e.getBoundingClientRect().top})})},updated(){if(this.lastClickedSortButton&&this.lastClickedSortButtonRectTop){let e=this.lastClickedSortButton.getBoundingClientRect().top;window.scrollBy(0,e-this.lastClickedSortButtonRectTop),this.lastClickedSortButton=null,this.lastClickedSortButtonRectTop=null}}};var yp={mounted(){this.trackUsers=new Set([]),this.onlineUsers=new Set([]),this.trackedUsers=new Set([]),this.el.addEventListener("track",this.trackUser.bind(this)),this.handleEvent("online",this.handleOnline.bind(this)),setInterval(this.syncServer.bind(this),200)},syncServer(){let e=this.trackUsers.difference(this.trackedUsers);e.size>0&&(this.pushEvent("track",{user_ids:e.values().toArray()}),this.trackedUsers=this.trackedUsers.union(e))},handleOnline({user_id:e,online:t}){t?this.onlineUsers.add(e):this.onlineUsers.delete(e),this.updateOnlineIndicator(e)},trackUser({detail:{user_id:e}}){this.trackUsers.add(e),this.updateOnlineIndicator(e)},updateOnlineIndicator(e){execJS(document.querySelectorAll(`.user-online-${e}`),this.onlineUsers.has(e)?"data-online":"data-offline")}},vl=yp;var bl=e=>{let t=Math.max(0,Math.floor(e||0)),i=Math.floor(t/3600),n=Math.floor(t%3600/60),s=String(t%60).padStart(2,"0");return i>0?`${i}:${String(n).padStart(2,"0")}:${s}`:`${n}:${s}`},yl=e=>{let t=Math.max(0,Math.floor(e||0)),i=Math.floor(t/3600),n=Math.floor(t%3600/60),s=t%60,r=[];return i&&r.push(`${i} hour${i===1?"":"s"}`),n&&r.push(`${n} minute${n===1?"":"s"}`),r.push(`${s} second${s===1?"":"s"}`),r.join(" ")},wp={mounted(){let e=t=>this.el.querySelector(`[data-role="${t}"]`);this.audio=e("audio"),this.toggle=e("toggle"),this.playIcon=e("play-icon"),this.pauseIcon=e("pause-icon"),this.loadingIcon=e("loading-icon"),this.seek=e("seek"),this.current=e("current"),this.duration=e("duration"),this.error=e("error"),this.knownDuration=parseFloat(this.el.dataset.duration)||0,this.dragging=!1,this.on(this.toggle,"click",()=>this.togglePlayback()),this.on(this.seek,"input",()=>{this.dragging=!0,this.render(parseFloat(this.seek.value))}),this.on(this.seek,"change",()=>{this.dragging=!1,this.audio.currentTime=parseFloat(this.seek.value)}),this.on(this.audio,"play",()=>this.renderPlaying(!0)),this.on(this.audio,"pause",()=>this.renderPlaying(!1)),this.on(this.audio,"waiting",()=>this.renderLoading(!0)),this.on(this.audio,"playing",()=>this.renderLoading(!1)),this.on(this.audio,"canplay",()=>this.renderLoading(!1)),this.on(this.audio,"ended",()=>this.renderPlaying(!1)),this.on(this.audio,"durationchange",()=>this.render()),this.on(this.audio,"timeupdate",()=>{this.dragging||this.render()}),this.on(this.audio,"error",()=>{this.renderLoading(!1),this.renderPlaying(!1),this.error.hidden=!1}),this.render()},destroyed(){this.audio.pause(),this.audio.removeAttribute("src"),this.audio.load()},on(e,t,i){e.addEventListener(t,i)},async togglePlayback(){if(!this.audio.paused){this.audio.pause();return}this.error.hidden=!0,this.renderLoading(!0);try{await this.audio.play()}catch(e){e.name!=="AbortError"&&(this.renderPlaying(!1),this.error.hidden=!1)}finally{this.audio.readyState>=HTMLMediaElement.HAVE_FUTURE_DATA&&this.renderLoading(!1)}},totalDuration(){let e=this.audio.duration;return Number.isFinite(e)&&e>0?e:this.knownDuration},render(e=this.audio.currentTime){let t=this.totalDuration(),i=t>0?e/t*100:0;this.seek.max=t,this.seek.value=e,this.seek.style.setProperty("--slider-filled",`${i}%`),this.seek.setAttribute("aria-valuetext",`${yl(e)} of ${yl(t)}`),this.current.textContent=bl(e),this.duration.textContent=bl(t)},renderPlaying(e){this.playIcon.hidden=e,this.pauseIcon.hidden=!e,this.toggle.setAttribute("aria-label",e?"Pause":"Play")},renderLoading(e){this.loadingIcon.hidden=!e,this.toggle.setAttribute("aria-busy",e),e?(this.playIcon.hidden=!0,this.pauseIcon.hidden=!0):this.renderPlaying(!this.audio.paused)}},wl=wp;var Sl=()=>window.print(),Sp={mounted(){this.el.addEventListener("click",Sl)},destroyed(){this.el.removeEventListener("click",Sl)}},El=Sp;var xl={mounted(){let e=document.querySelector("#drawer-panel");this.el.addEventListener("click",t=>{e&&e.dataset.component==="notebook"&&e.offsetWidth>0&&e.offsetWidth!==document.body.offsetWidth&&(this.pushEventTo("#app-drawer","set-entity",{id:this.el.dataset.entityRef}),t.stopPropagation())})}};var kl={mounted(){this.touchOnly=window.matchMedia("(hover: none)"),this.el.addEventListener("click",e=>{if(e.pointerType==="touch"||this.touchOnly.matches){e.preventDefault(),e.stopPropagation();return}let t=this.el.getAttribute("for");
318if(t){let i=document.getElementById(t);i&&i.type==="radio"&&(e.preventDefault(),i.checked=!i.checked,i.dispatchEvent(new Event("change",{bubbles:!0})))}})}};var Cl={mounted(){this.el.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault()})}};var Tl=!1;function Ep(){if(Tl||window.grecaptcha)return;Tl=!0,window.__recaptchaReady=()=>window.dispatchEvent(new Event("grecaptcha-ready"));let e=document.createElement("script");e.src="https://www.google.com/recaptcha/api.js?render=explicit&onload=__recaptchaReady",document.head.appendChild(e)}var Al={mounted(){let e=this.el.closest("form");if(!e)return;Ep(),this.form=e,this.siteKey=this.el.dataset.siteKey,this.widgetId=null,this.boundHandleSubmit=this.handleSubmit.bind(this);let t=e.querySelector('input[name="recaptcha_token"]');t||(t=document.createElement("input"),t.type="hidden",t.name="recaptcha_token",e.appendChild(t)),window.grecaptcha?.ready?window.grecaptcha.ready(()=>{this.renderWidget()}):window.addEventListener("grecaptcha-ready",()=>{window.grecaptcha?.ready?window.grecaptcha.ready(()=>{this.renderWidget()}):this.renderWidget()}),e.addEventListener("submit",this.boundHandleSubmit,!0)},destroyed(){this.widgetId!==null&&window.grecaptcha&&window.grecaptcha.reset(this.widgetId),this.form&&this.form.removeEventListener("submit",this.boundHandleSubmit,!0)},renderWidget(){if(!window.grecaptcha||!this.siteKey||this.widgetId!==null)return;let e=this.form.querySelector('input[name="recaptcha_token"]');this.widgetId=window.grecaptcha.render(this.el,{sitekey:this.siteKey,size:"invisible",badge:"bottomleft",callback:t=>{e.value=t,requestAnimationFrame(()=>this.triggerSubmit())},"expired-callback":()=>{e.value=""},"error-callback":t=>{e.value=""}})},handleSubmit(e){e.target.querySelector('input[name="recaptcha_token"]')?.value||!window.grecaptcha||!this.siteKey||this.widgetId===null||(e.preventDefault(),e.stopImmediatePropagation(),window.grecaptcha.ready(()=>{window.grecaptcha.execute(this.widgetId).catch(n=>{console.error("[reCAPTCHA] Execute error:",n)})}))},triggerSubmit(){if(this.form){if(typeof this.form.requestSubmit=="function"){this.form.requestSubmit();return}this.form.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0}))}}};var xp={mounted(){this.previousValue=this.el.dataset.value,this.render(this.previousValue,null),this.observer=new MutationObserver(()=>{let e=this.el.dataset.value;e!==this.previousValue&&(this.render(e,this.previousValue),this.previousValue=e)}),this.observer.observe(this.el,{attributes:!0,attributeFilter:["data-value"]})},destroyed(){this.observer.disconnect()},render(e,t){let i=e.split(""),n=t?t.split(""):i.map(()=>"0");this.el.innerHTML="";let s=document.createElement("div");s.style.display="inline-flex",s.style.height="1em",s.style.alignItems="flex-start",i.forEach((r,o)=>{let a=!Number.isNaN(parseInt(r,10)),l=n[o]??"0",d=document.createElement("div");if(d.style.position="relative",d.style.height="1em",d.style.display="inline-block",a){d.style.width="0.65em",d.style.overflow="hidden";let c=document.createElement("div");c.style.position="absolute",c.style.transition=t?"top 0.5s ease-in-out":"none";let u=parseInt(r,10),m=Number.isNaN(parseInt(l,10))?0:parseInt(l,10);for(let p=0;p<=9;p++){let h=document.createElement("span");h.textContent=p,h.style.display="block",h.style.height="1em",h.style.lineHeight="1em",c.appendChild(h)}c.style.top=`${m*-1}em`,d.appendChild(c),setTimeout(()=>{c.style.top=`${u*-1}em`},10)}else{let c=document.createElement("span");c.textContent=r,c.style.height="1em",c.style.lineHeight="1em",c.style.display="inline-block",d.appendChild(c)}s.appendChild(d)}),this.el.appendChild(s),this.animateColor(e,t)},animateColor(e,t){if(t===null||parseFloat(e)===parseFloat(t))return;let i=parseFloat(e)>parseFloat(t)?this.el.dataset.increaseClass:this.el.dataset.decreaseClass;i&&(this.cancelColorAnimation(),this.el.classList.add(i),this.currentColorClass=i,this.colorTimer=setTimeout(()=>this.fadeOutColorClass(),600))},cancelColorAnimation(){clearTimeout(this.colorTimer),clearTimeout(this.cleanupTimer),this.el.classList.remove("transition-colors","duration-500"),this.currentColorClass&&(this.el.classList.remove(this.currentColorClass),this.currentColorClass=null)},fadeOutColorClass(){let e=this.currentColorClass;this.currentColorClass=null,this.el.classList.add("transition-colors","duration-500"),this.el.offsetHeight,this.el.classList.remove(e),this.cleanupTimer=setTimeout(()=>this.el.classList.remove("transition-colors","duration-500"),500)}},Ll=xp;var kp={mounted(){window.requestAnimationFrame(this.doSetup.bind(this))},doSetup(){this.target=this.el.dataset.target==="self"?this.el:this.el.querySelector("[data-rough-notation-type]");let e=this.addAnnotation();this.target.dataset.roughNotationShowOn==="load"&&(e.show(),window.addEventListener("resize",this.debounce(t=>{e.show()}))),this.target.dataset.roughNotationShowOn==="viewport"&&new IntersectionObserver(([t])=>{t.isIntersecting&&t.intersectionRatio===1&&!this.played&&(e.show(),window.addEventListener("resize",this.debounce(i=>{e.show()})))},{threshold:1}).observe(this.target),this._onThemeChanged=()=>{this.annotation.remove(),this.addAnnotation(!1).show()},window.addEventListener("theme-changed",this._onThemeChanged)},addAnnotation(e){let t=this.target.dataset.roughNotationColorDark,i=this.target.dataset.roughNotationColor,n=window.isDarkMode&&t?t:i;return this.annotation=wn(this.target,{seed:this.target.dataset.roughNotationSeed,type:this.target.dataset.roughNotationType,color:n,animate:e??this.target.dataset.roughNotationAnimate==="true",iterations:1,multiline:!0}),this.annotation},debounce(e){var t;return i=>{t&&clearTimeout(t),t=setTimeout(e,100,i)}},destroyed(){window.removeEventListener("theme-changed",this._onThemeChanged)}},_l=kp;var Cp={mounted(){this.scrollKey=this.el.dataset.key,this.scrollKey&&(this.preserveOnNavigation=this.el.dataset.preserveOnNavigation==="true",this.el.addEventListener("scroll",()=>{(!this.preserveOnNavigation||this.positionBeforePageLoading==null)&&sessionStorage.setItem(this.scrollKey,this.el.scrollTop)}),this.preserveOnNavigation&&(this.positionBeforePageLoading=null,this.handlePageLoadingStart=()=>{this.positionBeforePageLoading=this.el.scrollTop},this.handlePageLoadingStop=()=>{let e=this.positionBeforePageLoading??sessionStorage.getItem(this.scrollKey);this.positionBeforePageLoading=null,this.scroll(e),cancelAnimationFrame(this.restoreFrame),this.restoreFrame=requestAnimationFrame(()=>this.scroll(e))},window.addEventListener("phx:page-loading-start",this.handlePageLoadingStart),window.addEventListener("phx:page-loading-stop",this.handlePageLoadingStop)),this.scroll())},updated(){this.scrollKey&&this.scroll()},scroll(e=sessionStorage.getItem(this.scrollKey)){e!=null&&this.el.scrollTo({top:parseInt(e,10),behavior:"instant"})},destroyed(){this.preserveOnNavigation&&(cancelAnimationFrame(this.restoreFrame),window.removeEventListener("phx:page-loading-start",this.handlePageLoadingStart),window.removeEventListener("phx:page-loading-stop",this.handlePageLoadingStop)),this.el.dataset.clearOnDestroy==="true"&&sessionStorage.removeItem(this.scrollKey)}},Il=Cp;var Tp={mounted(){this.initializeCurrencyMasks(),this.initializeNegotiatedCheckbox()},updated(){this.initializeCurrencyMasks(),this.initializeNegotiatedCheckbox()},initializeCurrencyMasks(){this.el.querySelectorAll("[data-currency-hidden]").forEach(t=>{let i=t.dataset.currencyHidden;if(!i)return;let n=this.el.querySelector(`[data-currency-display="${i}"]`);if(!n||n.dataset.maskInitialized)return;n.dataset.maskInitialized="true";let s=r=>!r||r==="0"?"":Math.round(parseInt(r,10)/100).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");n.addEventListener("input",()=>{let r=n.value.replace(/\D/g,"");if(r==="")t.value="",n.value="";else{let o=parseInt(r,10)*100;t.value=o,n.value=s(o.toString())}}),t.value&&(n.value=s(t.value))})},initializeNegotiatedCheckbox(){let e=this.el.querySelector("[data-negotiated-checkbox]");if(!e)return;let t=e.dataset.negotiatedTarget;if(!t)return;let i=document.getElementById(t);if(!i)return;let n=()=>{e.checked?i.classList.remove("hidden"):i.classList.add("hidden")};e.dataset.listenerAttached||(e.addEventListener("change",n),e.dataset.listenerAttached="true"),n()}},Pl=Tp;var Ap={mounted(){this.currentHoveredId=null,this.loadSvgChart()},updated(){this.initializeHoverListeners()},destroyed(){this.removeHoverListeners()},loadSvgChart(){fetch("/images/admissions/law_school_rankings_chart.svg").then(e=>e.text()).then(e=>{let t=document.createElement("div");t.innerHTML=e;let i=t.querySelector("svg");t.querySelectorAll("script").forEach(r=>{r.remove()}),i.attributes.removeNamedItem("width"),i.attributes.removeNamedItem("height");let s=this.el.querySelector(".chart-container");
318s?s.appendChild(i):this.el.innerHTML=e,this.initializeHoverListeners()}).catch(e=>{console.error("Error loading SVG:",e);let t=this.el.querySelector(".chart-container"),i="<p>Error loading chart. Please try refreshing the page.</p>";t?t.innerHTML=i:this.el.innerHTML=i})},initializeHoverListeners(){this.removeHoverListeners(),this.addHoverListeners(".school-row"),this.addHoverListeners(".line-hit"),this.addHoverListeners(".circle-group");let e=this.el.querySelector("svg");e&&(this.svgMouseLeaveHandler=()=>{this.setHover(null),this.currentHoveredId=null},e.addEventListener("mouseleave",this.svgMouseLeaveHandler))},removeHoverListeners(){if(this.mouseEnterHandlers&&this.mouseEnterHandlers.forEach(({element:e,handler:t})=>{e.removeEventListener("mouseenter",t)}),this.mouseLeaveHandlers&&this.mouseLeaveHandlers.forEach(({element:e,handler:t})=>{e.removeEventListener("mouseleave",t)}),this.svgMouseLeaveHandler){let e=this.el.querySelector("svg");e&&e.removeEventListener("mouseleave",this.svgMouseLeaveHandler)}this.mouseEnterHandlers=[],this.mouseLeaveHandlers=[]},setHover(e){if(this.el.querySelectorAll(".aux-hover-below").forEach(o=>{o.classList.remove("aux-hover-below")}),this.el.querySelectorAll(".aux-hover-above").forEach(o=>{o.classList.remove("aux-hover-above")}),this.el.querySelectorAll(".highlight").forEach(o=>{o.classList.remove("highlight")}),this.el.querySelectorAll(".highlight-bg").forEach(o=>{o.style.display="none"}),this.el.querySelectorAll(".circle-group").forEach(o=>{o.style.display="none"}),this.el.querySelectorAll(".highlight-text").forEach(o=>{o.classList.remove("highlight-text")}),this.el.querySelectorAll(".aux-bg-above").forEach(o=>{o.style.display="none"}),this.el.querySelectorAll(".aux-bg-below").forEach(o=>{o.style.display="none"}),!e)return;let t=parseInt(e.replace("school",""),10);if(t<this.el.querySelectorAll(".school-row").length-1){let o=`school${t+1}`,a=this.el.querySelector(`.line[data-school-id="${o}"]`);a&&(a.classList.add("aux-hover-below"),a.parentNode.appendChild(a));let l=this.el.querySelector(`.aux-bg-below[data-school-id="${e}"]`);l&&(l.style.display="inline")}if(t>0){let o=`school${t-1}`,a=this.el.querySelector(`.line[data-school-id="${o}"]`);a&&(a.classList.add("aux-hover-above"),a.parentNode.appendChild(a));let l=this.el.querySelector(`.aux-bg-above[data-school-id="${e}"]`);l&&(l.style.display="inline")}let i=this.el.querySelector(`.line[data-school-id="${e}"]`);i&&(i.classList.add("highlight"),i.parentNode.appendChild(i)),this.el.querySelectorAll(".circle-group").forEach(o=>{o.style.display="none"}),this.el.querySelectorAll(`.circle-group[data-school-id="${e}"]`).forEach(o=>{o.style.display="inline",o.parentNode.appendChild(o)}),this.el.querySelectorAll(".highlight-bg").forEach(o=>{o.style.display="none"});let n=this.el.querySelector(`.highlight-bg[data-school-id="${e}"]`);n&&(n.style.display="inline");let s=this.el.querySelector(`.school-row[data-school-id="${e}"] .school`);s&&s.classList.add("highlight-text");let r=this.el.querySelector(`.school-row[data-school-id="${e}"] .rownum`);r&&r.classList.add("highlight-text")},addHoverListeners(e){this.mouseEnterHandlers||(this.mouseEnterHandlers=[]),this.mouseLeaveHandlers||(this.mouseLeaveHandlers=[]),this.el.querySelectorAll(e).forEach(t=>{let i=()=>{let s=t.getAttribute("data-school-id");this.setHover(null),this.currentHoveredId!==s&&(this.setHover(s),this.currentHoveredId=s)},n=()=>{this.setHover(null),this.currentHoveredId=null};t.addEventListener("mouseenter",i),t.addEventListener("mouseleave",n),this.mouseEnterHandlers.push({element:t,handler:i}),this.mouseLeaveHandlers.push({element:t,handler:n})})}},Rl=Ap;var Ol={mounted(){this.chartId=this.el.dataset.chartId,this.mouseenterHandler=e=>{let t=e.target.closest("[data-school-index]");if(!t||t.contains(e.relatedTarget))return;let i=parseInt(t.dataset.schoolIndex,10),n=document.getElementById(this.chartId);if(!n||!n.data||!n.data[i])return;let s=n.data[i],r=s.y.findIndex(o=>o!=null);r!==-1&&n.emit("plotly_hover",{points:[{curveNumber:i,pointNumber:r,data:s,fullData:s}]})},this.mouseleaveHandler=e=>{let t=e.target.closest("[data-school-index]");if(!t||t.contains(e.relatedTarget))return;let i=document.getElementById(this.chartId);i&&i.emit("plotly_unhover",{})},this.el.addEventListener("mouseenter",this.mouseenterHandler,!0),this.el.addEventListener("mouseleave",this.mouseleaveHandler,!0)},destroyed(){this.mouseenterHandler&&(this.el.removeEventListener("mouseenter",this.mouseenterHandler,!0),this.mouseenterHandler=null),this.mouseleaveHandler&&(this.el.removeEventListener("mouseleave",this.mouseleaveHandler,!0),this.mouseleaveHandler=null)}};var Zs=class{constructor(){this.initExistingInputs(),this.setupInputListener(),this.setupObserver()}updateSlider(t){let i=parseFloat(t.value),n=parseFloat(t.min||0),s=parseFloat(t.max||100),r=(i-n)/(s-n)*100;t.style.setProperty("--slider-filled",`${r}%`)}initInput(t){t.dataset.initialized||(this.updateSlider(t),t.dataset.initialized="true")}
318initExistingInputs(){document.querySelectorAll('input[type="range"]').forEach(t=>{this.initInput(t)})}setupInputListener(){document.addEventListener("input",t=>{t.target.type==="range"&&requestAnimationFrame(()=>this.updateSlider(t.target))})}setupObserver(){new MutationObserver(i=>{i.forEach(n=>{n.type==="childList"&&n.addedNodes.forEach(s=>{s.nodeType===1&&(s.matches('input[type="range"]')&&this.initInput(s),s.querySelectorAll('input[type="range"]').forEach(r=>{this.initInput(r)}))})})}).observe(document.body,{childList:!0,subtree:!0})}},$t=new Zs;var Ml={mounted(){this.slider=this.el,this.scoreDisplay=document.getElementById("predicted-score-display"),this.detailsDisplay=document.getElementById("predicted-details"),this.sectionsCount=parseInt(this.el.dataset.sections,10),this.experimentalSections=parseInt(this.el.dataset.experimentalSections,10),this.totalQuestions=parseInt(this.el.dataset.totalQuestions,10),this.totalQuestionsScored=parseInt(this.el.dataset.totalQuestionsScored,10),this.practiceType=this.el.dataset.practiceType||"preptest",this.lsacScores=JSON.parse(this.el.dataset.lsacScores||"{}"),$t.updateSlider(this.el),this.slider.addEventListener("input",e=>{this.updateUI(e.target.value),this.syncWithServer(e.target.value),$t.updateSlider(this.el)}),this.slider.addEventListener("mouseup",e=>{this.updateUI(e.target.value),this.syncWithServer(e.target.value)}),this.slider.addEventListener("touchend",e=>{this.updateUI(e.target.value),this.syncWithServer(e.target.value)}),this.slider.addEventListener("blur",e=>{this.syncWithServer(e.target.value)})},updated(){$t.updateSlider(this.el)},updateUI(e){let t=Math.abs(parseInt(e,10)),i=document.getElementById("predicted-score-display"),n=document.getElementById("predicted-details");if(i&&n){let s,r;switch(this.practiceType){case"preptest":{s=this.preptestScaledScore(t).toString();let o=t/this.sectionsCount;r=`${t} questions incorrect \xB7 About ${o.toFixed()} per section`;break}case"section":s=t===0?"0":`-${t}`,r=`${t} questions incorrect`;break;case"drill":{let a=(this.totalQuestions-t)/this.totalQuestions*100;s=`${Math.round(a)}%`,r=`${t} questions incorrect`;break}default:s="---",r=" "}i.dataset.value=s,n.textContent=r}},preptestScaledScore(e){if(Object.values(this.lsacScores).length===0)return Math.max(120,180-Math.round(e*1.5));let t=this.sectionsCount-this.experimentalSections,i=e/this.sectionsCount,n=Math.round(i*t),s=this.totalQuestionsScored-n;return this.lsacScores[s.toString()]},syncWithServer(e){this.pushEventTo(this.el,"slider_interacted",{value:e})}};var Lp={prevXScroll:void 0,mounted(){Dl(this.el,"mount"),this.saveScroll=this.saveScroll.bind(this),this.saveScroll(),this.el.addEventListener("scroll",this.saveScroll)},destroyed(){this.el.removeEventListener("scroll",this.saveScroll)},updated(){this.el.scrollTo(this.prevXScroll,0),Dl(this.el,"update")},saveScroll(){this.prevXScroll=this.el.scrollLeft}};function Dl(e,t){let{scrollOn:i="mount",scrollInline:n="nearest",scrollBlock:s="start",scrollBehavior:r="auto",scrollId:o}=e.dataset;if(!i.split(",").map(d=>d.trim()).includes(t))return;let l=e.querySelector(`#${o}`);l&&requestAnimationFrame(()=>{l.scrollIntoView({inline:n,block:s,behavior:r})})}var Hl=Lp;var Ni={},_p=(e,t)=>{e.forEach(i=>{let n=i.target.getAttribute("phx-scroll-in"),s=i.target.getAttribute("phx-scroll-out");i.isIntersecting&&n&&liveSocket.execJS(i.target,n,"click"),!i.isIntersecting&&s&&liveSocket.execJS(i.target,s,"click")})},Ip={mounted(){let e=this.el.dataset.scrollObserverRootId;Ni[e]===void 0&&(Ni[e]=new IntersectionObserver(_p,{root:document.getElementById(e),trackVisibility:!0,delay:100})),Ni[e].observe(this.el)},destroyed(){let e=this.el.dataset.scrollObserverRootId;Ni[e]&&Ni[e].unobserve(this.el)}},$l=Ip;var Pp={mounted(){let e=document.querySelector('meta[name="csrf-token"]').getAttribute("content");this.handleEvent("session:store",t=>{fetch("/session",{keepalive:!0,method:"POST",headers:{"Content-Type":"application/json","X-CSRF-Token":e},body:JSON.stringify(t)})})}},Nl=Pp;var Rp={mounted(){this.el.addEventListener("click",async e=>{this.shareToDiscussions()})},async shareToDiscussions(){let e=document.getElementById(this.el.dataset.imgId);if(e){let t=await this.uploadImage(e);this.redirectToDiscussions(t,this.el.dataset.preptestScore,this.el.dataset.preptestName)}},async uploadImage(e){let i=await(await fetch(e.src)).blob(),n=new File([i],"preptest-result.png",{type:"image/png"});return(await Pr.performUpload(n,r=>{})).url},redirectToDiscussions(e,t,i){let n=this.buildQueryParams(e,t,i);window.location.href=`/discussion/new?${n}`},buildQueryParams(e,t,i){let n=JSON.stringify({type:"doc",content:[{type:"paragraph",content:[{type:"image",attrs:{src:e}}]}]}),s=`I just scored a ${t} on ${i}.`;return`new_post_content=${encodeURIComponent(n)}&new_post_title=${encodeURIComponent(s)}`}},Fl=Rp;var Rn=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);var Op={mounted(){let e=this.el.dataset.key;if(!e)return;let t=new Set((this.el.dataset.modifiers||"").split(" ").filter(
318Boolean));this.handler=i=>{i.target.matches("input, textarea, select, [contenteditable]")||i.target.closest("[aria-modal='true']")||i.key===e&&t.has("shift")===i.shiftKey&&t.has("cmd")===(Rn?i.metaKey:i.ctrlKey)&&t.has("alt")===i.altKey&&(i.preventDefault(),this.el.click())},document.addEventListener("keydown",this.handler)},destroyed(){this.handler&&document.removeEventListener("keydown",this.handler)}},Bl=Op;function On(e){let t=new RegExp(`(?:^|; )${encodeURIComponent(e)}=([^;]*)`),i=document.cookie.match(t);return i?decodeURIComponent(i[1]):""}var ft=td(zl());var Jl=document.getElementById("serverData").dataset,ri=class{static getKey(t){if(Object.hasOwn(Jl,t))return Jl[t]}};var le=class e{static userId=null;static userHash=null;static emailAddress=null;static impersonating=!1;static initialize(){let t=document.getElementById("serverData").dataset;e.userId=t.user_id,e.userHash=t.intercom_user_hash,e.emailAddress=t.user_email,e.impersonating=t.impersonating==="true"}};var df=ri.getKey("intercom_app_id"),Xe=class e{static isInitialized=!1;static initialize(){if(e.isInitialized)return;let t={app_id:df,user_hash:le.userHash,user_id:le.userId};(0,ft.Intercom)(t),e.isInitialized=!0,e.updateSettings()}static update(){e.isInitialized&&(e.updateSettings(),(0,ft.update)())}static reset(){!window.Intercom||!e.isInitialized||(setTimeout(()=>(0,ft.shutdown)(),700),setTimeout(()=>{e.updateSettings(),(0,ft.boot)(window.intercomSettings)},1e3))}static updateSettings(){if(!e.isInitialized)return;let t=window.intercomSettings||{},i=!le.userId,n=["/self-study/pricing","/admissions-consulting","/tutoring","/group-classes"],r=[`/u/${le.userId}/recommendations`,...n].some(d=>window.location.pathname.includes(d)),o=n,a=window.location.pathname==="/"||o.some(d=>window.location.pathname.includes(d)),l=!(i?a:r);window.intercomSettings={...t,custom_launcher_selector:".intercom-custom-launcher",hide_default_launcher:l}}};window.updateIntercom=()=>{Xe.update()};var hf=ri.getKey("posthog_api_key"),Hn="ph_identified",mt=class e{static isInitialized=!1;static initialize(){if(e.isInitialized)return;e.posthog_js();let i=localStorage.getItem(Hn)&&le.userId?le.userId:On("ss_anonymous_id");posthog.init(hf,{api_host:"https://us.i.posthog.com",defaults:"2025-11-30",person_profiles:"always",capture_pageview:!1,bootstrap:{distinctID:i},autocapture:{dom_event_allowlist:["click"],css_selector_allowlist:["[data-ph-autocapture]"]}}),posthog.capture("$pageview",{$current_url:window.location.href}),e.isInitialized=!0}static update(t){posthog.capture("$pageview",{$current_url:t})}static identify(){e.isInitialized&&(localStorage.getItem(Hn)||(posthog.identify(le.userId,{email:le.emailAddress}),localStorage.setItem(Hn,"true")))}static reset(){e.isInitialized&&(localStorage.removeItem(Hn),posthog.reset())}static posthog_js(){((t,i)=>{var n,s,r,o;i.__SV||window.posthog?.__loaded||(window.posthog=i,i._i=[],i.init=(a,l,d)=>{function c(m,p){var h=p.split(".");h.length===2&&(m=m[h[0]],p=h[1]),m[p]=function(){m.push([p].concat(Array.prototype.slice.call(arguments,0)))}}(r=t.createElement("script")).type="text/javascript",r.crossOrigin="anonymous",r.async=!0,r.src=`${l.api_host.replace(".i.posthog.com","-assets.i.posthog.com")}/static/array.js`,(o=t.getElementsByTagName("script")[0]).parentNode.insertBefore(r,o);var u=i;for(d!==void 0?u=i[d]=[]:d="posthog",u.people=u.people||[],u.toString=m=>{var p="posthog";return d!=="posthog"&&(p+=`.${d}`),m||(p+=" (stub)"),p},u.people.toString=()=>`${u.toString(1)}.people (stub)`,n="init Rr Mr fi Cr Ar ci Tr Fr capture Mi calculateEventProperties Lr register register_once register_for_session unregister unregister_for_session Hr getFeatureFlag getFeatureFlagPayload isFeatureEnabled reloadFeatureFlags updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures on onFeatureFlags onSurveysLoaded onSessionId getSurveys getActiveMatchingSurveys renderSurvey displaySurvey canRenderSurvey canRenderSurveyAsync identify setPersonProperties group resetGroups setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags reset get_distinct_id getGroups get_session_id get_session_replay_url alias set_config startSessionRecording stopSessionRecording sessionRecordingStarted captureException loadToolbar get_property getSessionProperty Ur jr createPersonProfile zr kr Br opt_in_capturing opt_out_capturing has_opted_in_capturing has_opted_out_capturing get_explicit_consent_status is_capturing clear_opt_in_out_capturing Dr debug M Nr getPageViewId captureTraceFeedback captureTraceMetric $r".split(" "),s=0;s<n.length;s++)c(u,n[s]);i._i.push([a,l,d])},i.__SV=1)})(document,window.posthog||[])}};var oi=class e{static initialize(){le.initialize(),!le.impersonating&&(mt.initialize(),e.startIntercom(),e.shouldReset()&&e.reset(),e.
318identify())}static startIntercom(){let t=["pointerdown","keydown","touchstart"],i=()=>{t.forEach(n=>window.removeEventListener(n,i,!0)),Xe.initialize()};t.forEach(n=>window.addEventListener(n,i,!0)),"requestIdleCallback"in window?window.requestIdleCallback(i,{timeout:3e3}):setTimeout(i,3e3)}static update(t){le.impersonating||(mt.update(t),Xe.update(),e.shouldReset()&&e.reset())}static identify(){le.impersonating||le.userId&&mt.identify()}static reset(){Xe.reset(),mt.reset()}static shouldReset(){if(new URLSearchParams(window.location.search).get("logged-out")==="true")return!0;let i=On("ajs_user_id"),n=le.userId;return i&&!n}};var Kl=(e,...t)=>()=>{Xe.initialize(),window.Intercom?.(e,...t)},Xl=Kl("show"),uf={mounted(){this.el.addEventListener("click",Xl)},destroyed(){this.el.removeEventListener("click",Xl)}},Gl={mounted(){this.show=Kl("showNewMessage",this.el.dataset.message),this.el.addEventListener("click",this.show)},destroyed(){this.el.removeEventListener("click",this.show)}},Yl=uf;var pf={mounted(){this.currentHighlightedQuote=null,this.setupQuoteHandlers()},updated(){this.setupQuoteHandlers(),this.currentHighlightedQuote&&this.handleQuoteClick(this.currentHighlightedQuote,!1)},setupQuoteHandlers(){this.el.querySelectorAll("highlight-quote").forEach(t=>{t.removeEventListener("click",t._clickHandler),t._clickHandler=i=>{i.preventDefault(),this.handleQuoteClick(t)},t.addEventListener("click",t._clickHandler)})},handleQuoteClick(e,t=!0){let i=e.getAttribute("text");if(!i)return;let n=this.el.getAttribute("data-highlight-class"),s=this.el.querySelectorAll(`.${n}`).length>0;this.currentHighlightedQuote===e&&s?this.removeHighlights():(this.removeHighlights(),this.currentHighlightedQuote=e,this.createHighlights(i),e.classList.add("highlight-quote-selected"),t&&this.scrollToFirstHighlight())},createHighlights(e){let t=this.el.getAttribute("data-highlight-query"),i=this.el.getAttribute("data-highlight-class");if(!t||!i)return;let n=document.querySelectorAll(t);Array.from(n).filter(r=>!Array.from(n).some(o=>o!==r&&r.contains(o))).forEach(r=>{this.highlightTextInElement(r,e,i)})},highlightTextInElement(e,t,i){let n=this.normalizeTextWithMapping(t),s=[],r={acceptNode:g=>g.parentElement.closest('[role="summary"], [data-snippet-highlight-ignore="true"]')?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,r,!1),a,l="";for(;a=o.nextNode();){let g=l.length,y=a.textContent;l+=y,s.push({node:a,startPos:g,endPos:l.length,text:y})}let d=this.normalizeTextWithMapping(l),c=this.buildPositionMap(l,d.normalizedText,d.changes),u=n.normalizedText.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s*"),m=new RegExp(u,"g"),p=[],h;for(;(h=m.exec(d.normalizedText))!==null;){let g=h.index,y=h.index+h[0].length,E=c.normalizedToOriginal[g],T=c.normalizedToOriginal[y-1]+1;E!==void 0&&T!==void 0&&p.push({start:E,end:T})}p.forEach(g=>{this.createHighlightRange(s,g.start,g.end,i)})},buildPositionMap(e,t,i){let n=[],s=[],r=0;for(let o=0;o<e.length;o++){n[o]=r;let a=i.find(l=>l.index===o);if(a){let l=1+a.delta;for(let d=0;d<l;d++)s[r+d]=o;r+=l}else s[r]=o,r++}return{originalToNormalized:n,normalizedToOriginal:s}},createHighlightRange(e,t,i,n){e.filter(r=>!(i<=r.startPos||t>=r.endPos)).forEach(r=>{let o=Math.max(0,t-r.startPos),a=Math.min(r.text.length,i-r.startPos);if(o>=a)return;let l=document.createRange();if(l.setStart(r.node,o),l.setEnd(r.node,a),l.collapsed||!l.toString().trim())return;let d=document.createElement("span");d.className=n;let c=l.extractContents();c.textContent.trim()&&(d.appendChild(c),l.insertNode(d))})},scrollToFirstHighlight(){let e=this.el.getAttribute("data-highlight-class"),t=this.el.querySelectorAll(`.${e}`);if(t.length===0)return;let i=t[0],n=this.el.getAttribute("data-highlight-query"),s=document.querySelector(n);s&&setTimeout(()=>{if(this.isScrollable(s)){this.scrollElementToCenter(s,i);return}let r=s.parentElement;for(;r&&r!==document.body;){if(this.isScrollable(r)){this.scrollElementToCenter(r,i);return}r=r.parentElement}let o=i.getBoundingClientRect(),a=window.scrollY+o.top-window.innerHeight/2;window.scrollTo({top:a,behavior:"smooth"})},10)},isScrollable(e){return e.scrollHeight>e.clientHeight},scrollElementToCenter(e,t){let i=e.getBoundingClientRect(),s=t.getBoundingClientRect().top-i.top,o=e.scrollTop+s-i.height/2;e.scrollTo({top:o,behavior:"smooth"})},removeHighlights(){let e=this.el.getAttribute("data-highlight-class");this.el.querySelectorAll(`.${e}`).forEach(n=>{let s=n.parentNode;for(;n.firstChild;)s.insertBefore(n.firstChild,n);s.removeChild(n),s.normalize()}),this.el.querySelectorAll("highlight-quote").forEach(n=>
318{n.classList.remove("highlight-quote-selected")}),this.currentHighlightedQuote=null},normalizeTextWithMapping(e){let t=[],i=e;return[...e.matchAll(/\u2026/g)].forEach(a=>{t.push({index:a.index,delta:2})}),[...e.matchAll(/\*/g)].forEach(a=>{t.push({index:a.index,delta:-1})}),[...e.matchAll(/\\/g)].forEach(a=>{t.push({index:a.index,delta:-1})}),[...e.matchAll(/[\n\r]/g)].forEach(a=>{t.push({index:a.index,delta:-1})}),t.sort((a,l)=>a.index-l.index),i=i.replace(/\u2026/g,"...").replace(/\*/g,"").replace(/\\/g,"").replace(/[\n\r]/g,"").replace(/[\u2018\u2019\u201A\u201B\u2039\u203A]/g,"'").replace(/[\u201C\u201D\u201E\u201F\u00AB\u00BB]/g,'"').replace(/[\u2010\u2011\u2012\u2013\u2014\u2015]/g,"-").replace(/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g," ").toLowerCase(),{normalizedText:i,changes:t}}},Ql=pf;var ff={mounted(){this.index=0,this.onKeydown=e=>this.handleKeydown(e),window.addEventListener("keydown",this.onKeydown),this.panel().addEventListener("phx:show-end",()=>{this.index=0,this.select(this.index),this.input().select()}),this.el.addEventListener("click",e=>{e.metaKey||e.ctrlKey||e.target.closest("[data-spotlight-result]")&&(this.clear(),this.hide())}),this.el.addEventListener("mousemove",e=>{let t=e.target.closest("[data-spotlight-result]");if(!t)return;let i=this.results().indexOf(t);i!==-1&&i!==this.index&&this.select(i,{scroll:!1})}),this.select(this.index)},updated(){this.index=0,this.select(this.index)},destroyed(){window.removeEventListener("keydown",this.onKeydown)},panel(){return this.el.querySelector("#spotlight")},input(){return this.el.querySelector("#spotlight-input")},results(){return Array.from(this.el.querySelectorAll("[data-spotlight-result]"))},markSection(e){let t=e.dataset.spotlightSection,i=Array.from(this.el.querySelectorAll("[data-spotlight-hint]")),n=i.find(s=>s.dataset.spotlightHint===t)||i[0];i.forEach(s=>{s.classList.toggle("hidden",s!==n),s.classList.toggle("flex",s===n)})},sectionStart(e,t,i){let n=e[t].dataset.spotlightSection,s=[];e.forEach((o,a)=>{o.dataset.spotlightSection!==e[a-1]?.dataset.spotlightSection&&s.push({section:o.dataset.spotlightSection,index:a})});let r=s.findIndex(o=>o.section===n);return s[(r+i+s.length)%s.length].index},open(){return window.getComputedStyle(this.panel()).display!=="none"},show(){this.liveSocket.execJS(document.activeElement||this.el,this.panel().dataset.show)},hide(){this.liveSocket.execJS(this.panel(),this.panel().dataset.hide)},clear(){this.input().value="",this.pushEvent("search",{query:""})},select(e,{scroll:t=!0}={}){let i=this.results();if(i.length===0)return;this.index=(e+i.length)%i.length,i.forEach((s,r)=>{let o=r===this.index;s.toggleAttribute("data-spotlight-active",o),s.setAttribute("aria-selected",o?"true":"false")});let n=i[this.index];t&&n.scrollIntoView({block:"nearest"}),this.input().setAttribute("aria-activedescendant",n.id),this.markSection(n)},handleKeydown(e){if(e.key.toLowerCase()==="k"&&(Rn?e.metaKey:e.ctrlKey)&&!e.altKey){e.preventDefault(),this.open()?this.hide():this.show();return}if(this.open())switch(e.key){case"ArrowDown":e.preventDefault(),this.select(this.index+1);break;case"ArrowUp":e.preventDefault(),this.select(this.index-1);break;case"Tab":{let t=this.results();if(t.length===0)break;e.preventDefault(),this.select(this.sectionStart(t,this.index,e.shiftKey?-1:1));break}case"Enter":{e.preventDefault();let t=this.results()[this.index];t&&t.click();break}case"Escape":e.preventDefault(),this.hide();break}}},Zl=ff;var ec={mounted(){import("./sortable.esm-VPWDBXB4.js").then(({default:e})=>{this.Sortable=e,this.initSortable()})},updated(){this.destroySortable(),this.initSortable()},destroyed(){this.destroySortable()},destroySortable(){this.sortableInstance&&(this.sortableInstance.destroy(),this.sortableInstance=null)},initSortable(){if(!this.Sortable||this.sortableInstance)return;let e=this.el.dataset;if(e.sortable==="false")return;let t=this.el.querySelector(`#${e.rowsContainerId}`);!t||t.children.length===0||(this.sortableInstance=new this.Sortable(t,{handle:e.handleSelector,animation:150,onEnd:()=>{let i=Array.from(t.children).map(n=>n.dataset[e.idAttribute]);this.pushEvent(e.eventName,{ids:i})}}))}};var mf={mounted(){if(!(this.el.dataset.autoShow==="true"))return;let t=this.el.querySelector(`#${this.el.dataset.popoverId}`);if(!t)return;setTimeout(()=>window.liveSocket.execJS(t,t.dataset.show),1e3);let i=this.el.querySelector(".streak-day-today");i&&(i.classList.add("streak-day-pending"),setTimeout(()=>{i.classList.remove("streak-day-pending"),i.classList.add("animate-streak-pulse"),i.addEventListener("animationend",()=>i.classList.remove("animate-streak-pulse"),{once:!0})},1800))}},tc=mf;var gf={mounted(){this.labels=this.el.querySelectorAll(".star-label"),this.updateStars(),this.labels.forEac
318h((e,t)=>{e.addEventListener("mouseenter",()=>{this.fillStars(t+1)})}),this.el.addEventListener("mouseleave",()=>{this.updateStars()}),this.labels.forEach(e=>{e.addEventListener("click",()=>{setTimeout(()=>this.updateStars(),10)})})},updateStars(){let e=this.el.querySelector("input:checked"),t=e?parseInt(e.value,10):0;this.fillStars(t)},fillStars(e){this.labels.forEach((t,i)=>{let n=t.querySelector(".star-outline"),s=t.querySelector(".star-solid");i<e?(n.classList.add("hidden"),s.classList.remove("hidden")):(n.classList.remove("hidden"),s.classList.add("hidden"))})}},ic=gf;var vf={mounted(){let e=parseFloat(this.el.dataset.min),t=parseFloat(this.el.dataset.max),i=parseFloat(this.el.dataset.step),n=this.el.dataset.required==="true",s=this.el.querySelector("input"),r=this.el.querySelector(".decrease-stepper"),o=this.el.querySelector(".increase-stepper");s.addEventListener("blur",a=>{let l=parseFloat(a.target.value);if(n&&Number.isNaN(l)){a.target.value=e;return}Number.isInteger(i)&&!Number.isInteger(l)&&(a.target.value=Math.trunc(l)),e&&l<e&&(a.target.value=e),t&&l>t&&(a.target.value=t)}),r.addEventListener("click",a=>{let l=parseFloat(s.value);e&&l-i<e?s.value=e:s.value=this.sanitizeFloat(l-i),this.dispatchChange(s)}),o.addEventListener("click",a=>{let l=parseFloat(s.value);t&&l+i>t?s.value=t:s.value=this.sanitizeFloat(l+i),this.dispatchChange(s)}),this.el.addEventListener("set-value",a=>{s.value=a.detail.value,this.dispatchChange(s)})},sanitizeFloat(e){return Number(e.toFixed(2)).toString()},dispatchChange(e){e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new Event("blur",{bubbles:!0}))}},nc=vf;var sc="https://js.stripe.com/basil/stripe.js",oc={async mounted(){try{await Ef(),this.stripe=window.Stripe(this.el.dataset.publishableKey)}catch(e){this.reportInitFailure(e);return}this.el.addEventListener("disable_submit_button",()=>this.setSubmitting(!0)),this.handleEvent("enable_submit_button",()=>this.setSubmitting(!1)),this.handleEvent("stripe:refresh_session",()=>this.refreshSession()),this.handleEvent("stripe:submit",()=>this.confirm({})),await this.initCheckout()},destroyed(){this.teardown()},async initCheckout(){let e=this.el.dataset.clientSecret;if(this.setLoading(),!(!e||!this.stripe))try{let t=await this.stripe.initCheckout({fetchClientSecret:async()=>e,elementsOptions:{appearance:Sf()}});this.teardown(),this.checkout=t,t.on("change",i=>this.renderSummary(i)),this.renderSummary(t),this.paymentElement=t.createPaymentElement({layout:{type:"tabs"},wallets:{link:"never",applePay:"never",googlePay:"never"},terms:{card:"never"},fields:{billingDetails:{address:"auto"}}}),this.paymentElement.mount(this.el.querySelector("#payment-element")),this.expressElement=t.createExpressCheckoutElement(),this.expressElement.mount(this.el.querySelector("#express-checkout-element")),this.expressElement.on("availablepaymentmethodschange",({paymentMethods:i})=>{i&&this.el.querySelector("#express-checkout-container")?.classList.remove("hidden")}),this.expressElement.on("confirm",async i=>{let{ok:n}=await this.pushEvent("ece_submit",{});n&&await this.confirm({expressCheckoutConfirmEvent:i})}),this.togglePaymentLoading(!1),this.setSubmitting(!1)}catch(t){this.reportInitFailure(t)}},reportInitFailure(e){this.pushEvent("stripe:init_failed",{message:String(e?.message||e)})},async confirm(e){if(!this.checkout)return;let{error:t}=await this.checkout.confirm(e);t&&this.setSubmitting(!1)},async refreshSession(){if(this.checkout){this.setSubmitting(!0);try{if((await this.checkout.runServerUpdate(async()=>{}))?.type==="error")throw new Error("the session could not be refreshed")}catch(e){console.error("[checkout] could not refresh the session",e),this.renderSummary(this.checkout)}finally{this.setSubmitting(!1)}}},teardown(){for(let e of[this.paymentElement,this.expressElement])try{e?.unmount()}catch{}this.paymentElement=null,this.expressElement=null,this.checkout=null},renderSummary(e){if(!e)return;let t=e.total||{};this.fillAmount('[data-stripe="subtotal"]',t.subtotal),this.fillAmount('[data-stripe="total"]',t.total),this.renderDiscount(e),this.renderTax(e)},renderDiscount(e){let t=(e.total||{}).discount,i=wf(t);this.toggleRow('[data-stripe="discount-row"]',i),i&&(this.setText('[data-stripe="discount"]',"-"+$n(t)),this.setText('[data-stripe="discount-label"]',yf(e.discountAmounts)))},renderTax(e){let t=e.total||{};if((e.tax||{}).status!=="ready"){this.el.ownerDocument.querySelector('[data-stripe="tax"]')?.classList.add("str
318ipe-skeleton");return}this.fillAmount('[data-stripe="tax"]',t.taxExclusive??t.taxInclusive??0)},toggleRow(e,t){let i=this.el.ownerDocument.querySelector(e);i&&(i.classList.toggle("hidden",!t),i.classList.toggle("flex",t))},setText(e,t){let i=this.el.ownerDocument.querySelector(e);i&&(i.textContent=t,i.classList.remove("stripe-skeleton"))},setLoading(){for(let e of["subtotal","tax","total"]){let t=this.el.ownerDocument.querySelector(`[data-stripe="${e}"]`);t&&t.classList.add("stripe-skeleton")}this.togglePaymentLoading(!0),this.setSubmitting(!0)},togglePaymentLoading(e){this.el.querySelector("#payment-form-loading")?.classList.toggle("hidden",!e)},fillAmount(e,t){if(t==null)return;let i=this.el.ownerDocument.querySelector(e);i&&(i.textContent=$n(t),i.classList.remove("stripe-skeleton"))},setSubmitting(e){let t=this.el.querySelector("#subscribe-btn");t&&(t.disabled=e,e?(t.querySelector("#subscribe-btn-text")?.classList.add("hidden"),t.querySelector("#subscribe-btn-spinner")?.classList.remove("hidden")):(t.querySelector("#subscribe-btn-text")?.classList.remove("hidden"),t.querySelector("#subscribe-btn-spinner")?.classList.add("hidden")))}},bf=new Intl.NumberFormat("en-US",{style:"currency",currency:"usd"});function $n(e){if(e==null)return"\u2014";if(typeof e=="string")return rc(e);if(typeof e=="number")return rc(bf.format(e/100));if(typeof e=="object"){if(e.amount!=null)return $n(e.amount);if(e.minorUnitsAmount!=null)return $n(e.minorUnitsAmount)}return"\u2014"}function rc(e){return e.replace(/\.00$/,"")}function yf(e){let t=(e||[])[0]?.recurring;return t?.type==="forever"?"Discount":t?.type==="repeating"&&t.durationInMonths>1?`Discount (first ${t.durationInMonths} months)`:"1st month discount"}function wf(e){if(e==null)return!1;if(typeof e=="number")return e!==0;let t=typeof e=="object"?e.amount??e.minorUnitsAmount:e;return/[1-9]/.test(String(t??""))}function Sf(){return window.isDarkMode?{disableAnimations:!0,inputs:"condensed",theme:"night",labels:"above",variables:{colorPrimary:"#40a7cf",colorBackground:"#1d2939",colorText:"#ffffff",colorTextSecondary:"#eaecf0",colorTextPlaceholder:"#d0d5dd",colorDanger:"#f97066",borderRadius:"12px"},rules:{".Input":{border:"2px solid #3f4957",boxShadow:"none"},".Input:focus":{border:"2px solid #40a7cf",boxShadow:"none"},".Label":{fontWeight:"600",color:"#ffffff"},".Tab":{border:"2px solid #3f4957",boxShadow:"none"},".Tab--selected":{border:"2px solid #40a7cf",boxShadow:"none"}}}:{disableAnimations:!0,inputs:"condensed",theme:"stripe",labels:"above",variables:{colorPrimary:"#1f799c",colorBackground:"#ffffff",colorText:"#344054",colorTextSecondary:"#667085",colorTextPlaceholder:"#98a2b3",colorDanger:"#f97066",borderRadius:"12px"},rules:{".Input":{border:"2px solid #e3e5e8",boxShadow:"none"},".Input:focus":{border:"2px solid #1f799c",boxShadow:"none"},".Label":{fontWeight:"600",color:"#344054"},".Tab":{border:"2px solid #e3e5e8",boxShadow:"none"},".Tab--selected":{border:"2px solid #1f799c",boxShadow:"none"}}}}function Ef(){if(window.Stripe)return Promise.resolve();let e=document.querySelector(`script[src="${sc}"]`);if(e)return e._loadPromise||Promise.resolve();let t=document.createElement("script");return t.src=sc,t._loadPromise=new Promise((i,n)=>{t.onload=i,t.onerror=n}),document.head.appendChild(t),t._loadPromise}var ac={mounted(){window.requestAnimationFrame(this.setup.bind(this))},setup(){this.nav=this.el.querySelector("nav"),this.selectedTab=this.el.querySelector("div[role='tab'][aria-selected]"),this.slideLeftButton=this.el.querySelector(`#${this.el.id}-slide-left`),this.slideRightButton=this.el.querySelector(`#${this.el.id}-slide-right`),this.nav.addEventListener("scroll",()=>this.toggleButtonsVisibility()),new ResizeObserver(debounce(()=>{this.toggleButtonsVisibility(),this.scrollIntoSelectedTab()},200)).observe(this.el),this.slideLeftButton.addEventListener("click",()=>this.nav.scrollLeft-=120),this.slideRightButton.addEventListener("click",()=>this.nav.scrollLeft+=120),this.toggleButtonsVisibility()},hasEnoughRenderingSpace(){return this.nav.scrollWidth<=this.el.clientWidth},scrollIntoSelectedTab(){if(this.hasEnoughRenderingSpace()){this.nav.scrollLeft=0;return}this.selectedTab.scrollIntoView({block:"center",inline:"center",behavior:"instant"})},toggleButtonsVisibility(){if(this.hasEnoughRenderingSpace()){this.slideLeftButton.style.visibility="hidden",this.slideRightButton.style.visibility="hidden";return}let e=this.nav.scrollWidth-this.nav.clientWidth;this.nav.scrollLeft===0?this.slideLeftButton.style.visibility="hidden":this.slideLeftButton.style.visibility="visible",this.nav.scrollLeft>=e?this.slideRightButton.style.visibility="hidden":this.slideRightButton.style.visibility="visible"}};var xf={mounted(){this.el.addEventListener("dt:nav:switch",e=>this.switchTo(e.detail.id)),this.scrollToCurrent()},updated(){this.scrollToCurrent()},reconnected(){this.scrollToCurrent()},switchTo(e){for(let i of this.el.querySelectorAll("[data-current]"))i.removeAttribute("data-current"),i.removeAttribute("aria-current");let t=document.getElementById(e);t&&(t.setAttribute("data-current","true"),t.setAttribute("aria-current","page"),t.scrollIntoView({block:"nearest",inline:"nearest"}))},scrollToCurrent(){this.el.querySelector("[data-current]")?.scrollIntoView({block:"nearest",inline:"nearest"})}},lc=xf;var kf={mounted(){this.start=null,this.dragged=!1,this.clickCount=0,this.lastDownAt=0,this.onPointerDown=e=>{let t=e.timeStamp-this.lastDownAt<500&&this.start&&Math.hypot(e.clientX-this.start.x,e.clientY-this.start.y)<=5;this.clickCount=t?this.clickCount+1:1,this.lastDownAt=e.timeStamp,this.start={x:e.clientX,y:e.clientY},this.dragged=!1},this.onPointerUp=e=>{let t=this.start&&Math.hypot(e.clientX-this.start.x,e.clientY-this.start.y)>5;!t&&this.clickCount<=1&&this.hasSelection()&&window.getSelection().removeAllRanges(),this.dragged=t},this.onClick=e=>{let t=this.el.dataset.clickEvent;t&&(e.detail>1||this.dragged||this.hasSelection()||(this.el.scrollIntoView({block:"nearest"}),!e.target.closest("button")&&this.pushEvent(t,{letter:this.el.dataset.letter,option:this.el.dataset.option})))},this.el.addEventListener("pointerdown",this.onPointerDown),this.el.addEventListener("pointerup",this.onPointerUp),this.el.addEventListener("click",this.onClick)},hasSelection(){let e=window.getSelection();return e&&!e.isCollapsed&&e.toString().trim()!==""}},cc=kf;var Cf={mounted(){let e=this.el.dataset.event,t=parseInt(this.el.dataset.interval||"5000",10);e&&(this.interval=setInterval(()=>{this.pushEventTo(this.el,e,{})},t))},destroyed(){this.interval&&clearInterval(this.interval)}},dc=Cf;var Tf={mounted(){this.selectInputs(),this.accommodationMultiplier=this.getAccommodationMultiplier(),this.listenToPreSetClicks(),this.listenToAdjustmentStepperEvents(),this.listenToTimeStepperEvents(),this.initFormattedSeconds(),this.markSelectedOption(),this.timeStepperTouched=!1},updated(){this.updateCheckMark(),this.syncTimeStepperDisplay()},syncTimeStepperDisplay(){let e=this.el.querySelector("[data-time-limit-custom-time]");
318if(!e||this.selectedOptionId===e.id||this.timeStepperTouched)return;let t=parseInt(e.dataset.seconds,10);t>0&&(this.timeLimitTimeStepperSecondsInput.value=t,this.applyFormattedSeconds(t))},selectInputs(){this.timeLimitAdjustmentInput=this.el.querySelector("input[data-time-limit-adjustment-input]"),this.timeLimitOptionInput=this.el.querySelector("input[data-time-limit-option-input]"),this.timeLimitSecondsInput=this.el.querySelector("input[data-time-limit-seconds-input]"),this.timeLimitAdjustmentStepperInput=this.el.querySelector("input[data-time-limit-adjustment-stepper-input]"),this.timeLimitTimeStepperInput=this.el.querySelector("input[data-time-limit-time-stepper-input]"),this.timeLimitTimeStepperSecondsInput=this.el.querySelector("input[data-time-limit-time-seconds-stepper-input]")},listenToPreSetClicks(){this.el.querySelectorAll("[data-time-limit-pre-set]").forEach(e=>{e.addEventListener("click",t=>{this.timeStepperTouched=!1;let{timeLimitAdjustment:i,timeLimitOption:n,timeLimitSeconds:s}=e.dataset;this.updateTimeLimit(i,n,s),this.selectedOptionId=e.id,this.updateCheckMark()})})},listenToAdjustmentStepperEvents(){let e=this.el.querySelector("[data-time-limit-custom-adjustment]"),{min:t,max:i}=this.timeLimitAdjustmentStepperInput.dataset;this.timeLimitAdjustmentStepperInput.addEventListener("click",n=>{n.stopPropagation()}),e.addEventListener("click",n=>{this.timeStepperTouched=!1;let s=parseFloat(this.timeLimitAdjustmentStepperInput.value)||0;this.updateTimeLimit(s/100,"custom",""),this.selectedOptionId=e.id,this.updateCheckMark(),this.closeDropdown()}),this.el.querySelector("[data-decrease-adjustment-stepper]").addEventListener("click",n=>{let s=parseFloat(this.timeLimitAdjustmentStepperInput.value)||0,r=Math.max(t,s-1);this.timeLimitAdjustmentStepperInput.value=r,this.selectedOptionId=n.target.dataset.optionId,this.updateTimeLimit(r/100,"custom",""),this.selectedOptionId=e.id,this.updateCheckMark(),n.stopPropagation()}),this.el.querySelector("[data-increase-adjustment-stepper]").addEventListener("click",n=>{let s=parseFloat(this.timeLimitAdjustmentStepperInput.value)||0,r=Math.min(i,s+1);this.timeLimitAdjustmentStepperInput.value=r,this.selectedOptionId=n.target.dataset.optionId,this.updateTimeLimit(r/100,"custom",""),this.selectedOptionId=e.id,this.updateCheckMark(),n.stopPropagation()}),this.timeLimitAdjustmentStepperInput.addEventListener("blur",n=>{let s=parseFloat(n.target.value)||0;s=Math.max(t,s),s=Math.min(i,s),n.target.value=s,this.updateTimeLimit(s/100,"custom","")}),this.timeLimitAdjustmentStepperInput.addEventListener("input",n=>{n.stopPropagation()})},getMinSeconds(){let e=this.el.querySelector("[data-time-limit-custom-time]");return parseInt(e?.dataset.minSeconds,10)||0},getAccommodationMultiplier(){let e=this.el.querySelector("[data-time-limit-custom-time]"),t=parseFloat(e?.dataset.accommodationMultiplier);return Number.isFinite(t)&&t>0?t:1},listenToTimeStepperEvents(){let e=this.el.querySelector("[data-time-limit-custom-time]");this.timeLimitTimeStepperInput.addEventListener("click",t=>{t.stopPropagation()}),e.addEventListener("click",t=>{this.timeStepperTouched=!0;let i=parseFloat(this.timeLimitTimeStepperSecondsInput.value)||0;this.updateTimeLimit(1,"custom",i),this.selectedOptionId=e.id,this.updateCheckMark(),this.closeDropdown()}),this.timeLimitTimeStepperInput.addEventListener("input",t=>{this.timeStepperTouched=!0,this.handleTimeInputChange(t)}),this.timeLimitTimeStepperInput.addEventListener("blur",t=>{this.handleTimeInputBlur(t),this.updateTimeLimit(1,"custom",this.timeLimitTimeStepperSecondsInput.value)}),this.timeLimitTimeStepperInput.addEventListener("keydown",t=>{this.handleTimeInputKeyDown(t)}),this.el.querySelector("[data-decrease-time-stepper]").addEventListener("click",t=>{this.timeStepperTouched=!0;let i=parseInt(this.timeLimitTimeStepperSecondsInput.value,10)||0,n=Math.max(this.getMinSeconds(),i-1);this.timeLimitTimeStepperSecondsInput.value=n,this.applyFormattedSeconds(n),this.updateTimeLimit(1,"custom",this.timeLimitTimeStepperSecondsInput.value),this.selectedOptionId=e.id,this.updateCheckMark(),t.stopPropagation()}),this.el.querySelector("[data-increase-time-stepper]").addEventListener("click",t=>{this.timeStepperTouched=!0;let i=parseInt(this.timeLimitTimeStepperSecondsInput.value,10)||0,s=Math.min(i+1,5999);this.timeLimitTimeStepperSecondsInput.value=s,this.applyFormattedSeconds(s),this.updateTimeLimit(1,"custom",this.timeLimitTimeStepperSecondsInput.value),this.selectedOptionId=e.id,this.updateCheckMark(),t.stopPropagation()})},applyFormattedSeconds(e){let t=Math.round((parseInt(e,10)||0)*this.accommodationMultiplier),i=Math.floor(t/60).toString().padStart(2,"0"),n=(t%60).toString().padStart(2,"0"),s=`${i}:${n}`;this.timeLimitTimeStepperInput.value=s,this.timeLimitTimeStepperInput.dataset.lastValid=s},handleTimeInputChange(e){let t=e.target,i=t.selectionStart,n=t.value,s,r=t.value.replace(/\D/g,"");if(r.length<=2){if(t.value=r,n.length!==r.length){let u=Math.max(0,i-1);t.setSelectionRange(u,u)}return}let o=r.slice(-2),a=r.slice(0,-2)||"0",l=`${a}:${o}`,d=a.length,c=Array.from(t.value).slice(0,i).filter(u=>/\d/.test(u)).length;c<=a.length?s=c:s=d+1+(c-a.length),t.value=l,t.setSelectionRange(s,s)},handleTimeInputBlur(e){let i=e.target.value.replace(/\D/g,"").padStart(4,"0"),n=i.slice(0,2),s=i.slice(2,4),r=parseInt(n,10),o=parseInt(s,10),a=Math.floor(o/60);r+=a,a>0&&(o=o%60);let l=r*60+o,d=Math.round(l/this.accommodationMultiplier),c=this.getMinSeconds();d<c&&(d=c),this.timeLimitTimeStepperSecondsInput.value=d,this.applyFormattedSeconds(d)},handleTimeInputKeyDown(e){let t=e.target,i=t.value,n=t.selectionStart;if(e.key==="Backspace"&&i[n-1]===":"){t.value=i.slice(0,n-1)+i.slice(n),t.setSelectionRange(n-1,n-1);return}if(e.key==="Delete"&&i[n]===":"){t.value=i.slice(0,n)+i.slice(n+1),t.setSelectionRange(n,n);return}},initFormattedSeconds(){let e=this.timeLimitTimeStepperSecondsInput.value;this.applyFormattedSeconds(e)},closeDropdown(){let e=this.el.dataset.id,t=document.getElementById(e);t&&window.liveSocket.execJS(t,t.dataset.toggle,"click")},updateTimeLimit(e,t,i){this.timeLimitAdjustmentInput.value=e,this.timeLimitOptionInput.value=t,this.timeLimitSecondsInput.value=i,this.timeLimitAdjustmentInput.dispatchEvent(new Event("input",{bubbles:!0})),this.timeLimitAdjustmentInput.dispatchEvent(new Event("change",{bubbles:!0}))},markSelectedOption(){let e=this.el.dataset.id,t=this.timeLimitAdjustmentInput.value,i=this.timeLimitOptionInput.value;if(parseInt(this.timeLimitSecondsInput.value,10)){let o=document.getElementById(`${e}-time-stepper-option`);this.selectedOptionId=o.id,this.updateCheckMark();return}let s=document.getElementById(`${e}-${i}-${t}`);if(s){this.selectedOptionId=s.id,this.updateCheckMark();return}let r=document.getElementById(`${e}-adjustment-stepper-option`);this.selectedOptionId=r.id,this.updateCheckMark()},updateCheckMark(){if(!this.selectedOptionId)return;let e=document.getElementById(this.selectedOptionId);this.el.querySelectorAll("[data-check-mark]").forEach(t=>{t.classList.add("invisible")}),e.querySelector("[data-check-mark]").classList.remove("invisible")}},hc=Tf;var Af={mounted(){this.setTime()},destroyed(){clearInterval(this.interval)},setTime(){let e=parseInt(this.el.dataset.breakDuration,10),t=Date.now();this.interval&&clearInterval(this.interval),this.interval=setInterval(()=>{let i=Date.now(),n=new Date(null),s=this.getDiff(e,i,t);s<=0?(this.animatePracticeButton(),setTimeout(()=>{this.liveSocket.execJS(this.el,this.el.dataset.onResume)},1500)):(n.setMilliseconds(s),this.el.querySelector("span[data-time-span]").textContent=this.formatTime(n),this.el.querySelector("div[data-progress-bar]").style.width=`${s/e*100}%`)},50)},animatePracticeButton(){let e=document.querySelector("[data-practice-button]");e&&(e.classList.add("!duration-1000","!transition-all","!ease-in-out"),e.classList.remove("ss-button--gray-outline","!border-transparent","ss-button--disabled"),e.classList.add("ss-button--primary"))},getDiff(e,t,i){return e-(t-i)},formatTime(e){let i=e.toISOString().slice(11,19),[n,s,r]=i.split(":");return`${s}:${r}`}},uc=Af;var Lf='[phx-hook="Timer"]',er="timer:sync",tr="timer:trigger_sync";var pc=0,_f={mounted(){this.direction=this.el.dataset.direction,this.limit=parseInt(this.el.dataset.limit,10),this.milliseconds=parseInt(this.el.dataset.milliseconds,
31810),this.anchor=Date.now(),this.timerSpan=this.el.querySelector("[data-timer-span]"),this.pushComplete=this.el.dataset.pushComplete!=="false",this.warningButton=this.el.closest("[data-warning]"),this.fiveMinuteWarningShown=!1,this.completed=!1,this.onSync=({detail:e})=>this.sync(e.milliseconds,e.anchor),this.onTriggerSync=()=>this.resyncIfLeader(1e3),window.addEventListener(er,this.onSync),window.addEventListener(tr,this.onTriggerSync),this.interval=setInterval(()=>this.tick(),250),this.tick(),window.dispatchEvent(new CustomEvent(tr))},reconnected(){this.resyncIfLeader(1e3)},leader(){return document.querySelector(Lf)===this.el},resyncIfLeader(e){!this.leader()||Date.now()-pc<e||(pc=Date.now(),this.pushEvent("timer:recalculate",{},t=>{let i=parseInt(t.milliseconds,10);if(Number.isNaN(i))return;let n={milliseconds:i,anchor:Date.now()};window.dispatchEvent(new CustomEvent(er,{detail:n}))}))},sync(e,t){this.milliseconds=e,this.anchor=t},tick(){let e=Date.now(),t=this.diffFor(e);if(this.resyncIfLeader(3e4),t<=0){this.complete();return}this.timerSpan&&(this.timerSpan.textContent=this.format(t)),this.updateWarning(t),this.maybeShowFiveMinuteWarning(t)},diffFor(e){let t=e-this.anchor;return this.direction==="down"?this.milliseconds-t:this.milliseconds+t},complete(){this.completed||(this.completed=!0,this.stop(),this.pushComplete&&(document.querySelectorAll("[id^='dt-option-']").forEach(e=>{e.removeAttribute("data-click-event"),e.querySelectorAll("button").forEach(t=>t.disabled=!0)}),this.pushEvent("timer:complete",{})))},updateWarning(e){this.direction!=="down"||!this.warningButton||(this.warningButton.dataset.warning=e<3e5?"true":"false")},maybeShowFiveMinuteWarning(e){if(!(this.direction!=="down"||!this.pushComplete||this.fiveMinuteWarningShown)&&this.limit>=9e5&&e<=3e5&&e>=225e3){this.fiveMinuteWarningShown=!0;let t=document.getElementById("five-minutes-remaining-prompt-outer");t&&this.liveSocket.execJS(t,t.getAttribute("data-show"))}},format(e){let t=Math.floor(e/1e3),i=Math.floor(t/3600),n=Math.floor(t%3600/60),s=t%60,r=o=>String(o).padStart(2,"0");return`${r(i)}:${r(n)}:${r(s)}`.replace(/^00:/,"")},stop(){this.interval&&(clearInterval(this.interval),this.interval=null)},destroyed(){this.stop(),window.removeEventListener(er,this.onSync),window.removeEventListener(tr,this.onTriggerSync)}},fc=_f;var If={mounted(){let e=document.getElementById(this.el.dataset.contentId),t=document.getElementById(this.el.dataset.buttonId);e.scrollHeight>e.clientHeight?t.classList.remove("hidden"):t.classList.add("hidden")}},mc=If;var Pf={mounted(){this.isToolbarClick=!1,this.el.addEventListener("mousedown",()=>{this.isToolbarClick=!0}),document.addEventListener("mouseup",()=>{setTimeout(()=>{this.isToolbarClick=!1},10)}),this.el.addEventListener("toolbar:check-visibility",()=>{if(this.isToolbarClick)return;let e=this.el.dataset.focused==="true",t=this.el.dataset.hasContent==="true";e||t?this.el.classList.remove("hidden"):this.el.classList.add("hidden")})}},gc=Pf;var vc={mounted(){this.el.addEventListener("input",()=>{let e=this.el.value.replace(/\D/g,""),t=parseInt(this.el.getAttribute("min")||"1",10),i=parseInt(this.el.getAttribute("max")||"50",10);e!==""?(e=Math.min(i,Math.max(t,parseInt(e,10))),this.el.value=e):this.el.value=""})}};var Rf={mounted(){this.input=this.el.querySelector("input[type=text]"),this.active=0,this.el.addEventListener("mousedown",t=>{t.target.closest("[data-option], [data-chip]")&&t.preventDefault()}),this.el.addEventListener("click",t=>{t.target.closest("[data-option]")&&(this.input.value=""),t.target.closest("[data-option], [data-chip]")&&this.input.focus()},!0),this.el.addEventListener("mouseover",t=>{let i=t.target.closest("[data-option]");i&&this.setActive(this.options().indexOf(i))}),this.input.addEventListener("keydown",t=>{if(t.key==="ArrowDown")t.preventDefault(),this.setActive(this.active+1);else if(t.key==="ArrowUp")t.preventDefault(),this.setActive(this.active-1);else if(t.key==="Enter")t.preventDefault(),this.options()[this.active]?.click();else if(t.key==="Backspace"&&this.input.value===""){let i=this.el.querySelectorAll("[data-chip] input");i[i.length-1]?.click()}});let e=()=>{let t=this.dropdown();t&&this.js().show(t)};this.input.addEventListener("input",e),this.input.addEventListener("focus",e),this.setActive(0)},updated(){this.setActive(0)},dropdown(){return document.getElementById(`${this.el.id}-dropdown`)},options(){return[...this.el.querySelectorAll("[data-option]")]},setActive(e){let t=this.options();this.active=Math.max(0,Math.min(e,t.length-1)),t.forEach((i,n)=>i.toggleAttribute("data-active",n===this.active)),t[this.active]?.scrollIntoView({block:"nearest"})}},bc=Rf;var Of={mounted(){this.el.dataset.playerId!==void 0&&(this.currentCue=null,this.player=null,this.unsubscribe=null,this.isAutoScrollEnabled=!0,this.isAutoScrolling=!1,this.isVisible=!this.el.classList.contains("hidden"),this.cues=[],this.transcriptContainer=this.el.querySelector("[data-transcript-container]"),this.enableAutoScrollButton=this.el.querySelector("[data-enable-autoscroll]"),this.transcriptContainer?.addEventListener("scroll",()=>{this.isAutoScrolling||(this.isAutoScrollEnabled=!1,this.updateButtonVisibility())}),this.enableAutoScrollButton?.addEventListener("click",()=>{this.enableAutoScroll()}),this.transcriptContainer?.addEventListener("click",e=>{let t=e.target.closest("[data-cue]"),i=t&&parseFloat(t.dataset.start);this.player&&i!=null&&!isNaN(i)&&(this.player.currentTime=i,this.isAutoScrollEnabled=!0,this.updateButtonVisibility())}),this.el.addEventListener("toggle-transcript",()=>{this.toggle()}),this.wireCues())},updated(){this.wireCues()},wireCues(){this.cues=Array.from(this.el.querySelectorAll("[data-cue]")),this.player&&this.updateActiveCue(this.player.currentTime)},connectToPlayer(){let e=this.el.dataset.playerId,t=document.getElementById(e);if(!t){setTimeout(()=>this.connectToPlayer(),100);return}let i=t.querySelector("media-player");if(!i||typeof i.subscribe!="function"){setTimeout(()=>this.connectToPlayer(),100);return}this.player=i,this.unsubscribe=i.subscribe(({currentTime:n})=>{this.updateActiveCue(n)})},updateActiveCue(e){let t=this.cues.find(i=>{let n=parseFloat(i.dataset.start),s=parseFloat(i.dataset.end);return e>=n&&e<s});t!==this.currentCue&&(this.currentCue&&delete this.currentCue.dataset.active,t&&(t.dataset.active="",this.isAutoScrollEnabled&&this.scrollCueIntoView(t)),this.currentCue=t||null)},scrollCueIntoView(e){if(!this.transcriptContainer)return;this.isAutoScrolling=!0;let t=this.transcriptContainer.getBoundingClientRect(),i=e.getBoundingClientRect(),n=this.transcriptContainer.scrollTop,r
318=i.top-t.top+n-t.height/2+i.height/2;this.transcriptContainer.scrollTo({top:r,behavior:"smooth"});let o=()=>{this.isAutoScrolling=!1,this.transcriptContainer?.removeEventListener("scrollend",o)};this.transcriptContainer.addEventListener("scrollend",o,{once:!0})},updateButtonVisibility(){this.enableAutoScrollButton&&(this.isAutoScrollEnabled?this.enableAutoScrollButton.classList.add("hidden"):this.enableAutoScrollButton.classList.remove("hidden"))},enableAutoScroll(){this.isAutoScrollEnabled=!0,this.updateButtonVisibility(),this.currentCue&&this.scrollCueIntoView(this.currentCue)},toggle(){this.unsubscribe===null&&this.connectToPlayer(),this.isVisible=!this.isVisible,this.isVisible?(this.el.classList.remove("hidden"),this.isAutoScrollEnabled=!0,this.updateButtonVisibility(),this.currentCue&&window.requestAnimationFrame(()=>{this.scrollCueIntoView(this.currentCue)})):this.el.classList.add("hidden")},destroyed(){this.unsubscribe&&this.unsubscribe()}},yc=Of;var Mf="mediaPlayerSettings",Df="7sage-video-resume:";function Hf(e){let t=e?.src;if(typeof t!="string"||t.length===0)return null;let i;try{i=new URL(t).pathname}catch{return null}let n=i.replace(/\.4k\.mp4$/i,"").replace(/\.mp4$/i,"");return`${Df}${n}`}function wc(e){class t extends e{onChange(n,s,r){super.onChange(n,Hf(n),Mf)}setTime(n,s){return s?super.setTime(-1,!0):super.setTime(n,s??!1)}}return new t}var ir=null;async function Sc(){return ir||(ir=Promise.all([import("./vidstack-player-MC7B2VLS.js"),import("./vidstack-player-ui-JSOTF4ZK.js"),import("./vidstack-icons-DWA3CYAH.js"),import("./vidstack-U6BLIFHX.js")]).then(e=>e[3])),ir}async function $f(){return(await Sc()).TextTrack}var Nn={},Nf={async mounted(){let e=await Sc(),t=this.el.querySelector("media-player");this.setKeyShortcuts(t),this.processSources(t),this.setResumeStorage(t,e);let i=this.el.querySelector("[data-speed-label]");i.innerHTML=`${t.playbackRate}x`,t.addEventListener("rate-change",({detail:s})=>{i.innerHTML=`${s}x`});let n=this.el.dataset.trackPlayEvent;if(n){let s=!1;t.addEventListener("play",()=>{s||(this.pushEvent(n,{video_id:this.el.id}),s=!0)})}t.subscribe(s=>{if(t.duration>0){this.processVTT(t);return}}),t.startLoading(),t.startLoadingPoster(),Nn[this.el.id]=t,this.setupContainerFullscreen(),this.handleEvent("video:vote:update",s=>{this.updateVoteBadge(s)})},destroyed(){delete Nn[this.el.id],this.onFullscreenChange&&document.removeEventListener("fullscreenchange",this.onFullscreenChange)},setupContainerFullscreen(){if(this.container=this.el.closest("[data-video-container]")??this.el,!(document.fullscreenEnabled&&typeof this.container.requestFullscreen=="function"))return;let t=i=>{i.preventDefault(),i.stopImmediatePropagation(),this.toggleContainerFullscreen()};this.el.addEventListener("media-enter-fullscreen-request",t,{capture:!0}),this.el.addEventListener("media-exit-fullscreen-request",t,{capture:!0}),this.onFullscreenChange=()=>{let i=document.fullscreenElement===this.container;this.container.toggleAttribute("data-fullscreen",i),this.el.querySelector("media-player")?.toggleAttribute("data-fullscreen",i)},document.addEventListener("fullscreenchange",this.onFullscreenChange)},toggleContainerFullscreen(){document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.container.requestFullscreen().catch(()=>{})},processSources(e){let t=this.el.querySelectorAll("source"),i=[];for(let n=0;n<t.length;n++)i.push({src:t[n].src,type:t[n].type,width:this.is_4k(t[n])?3840:1920,height:this.is_4k(t[n])?2160:1080});e.src=i},setResumeStorage(e,t){let i=t?.LocalMediaStorage;if(i)try{e.storage=wc(i)}catch(n){console.error("Failed to set video resume storage",n)}},setKeyShortcuts(e){let t=e.querySelector("media-speed-radio-group")?.rates??[1];e.keyShortcuts={togglePaused:"k Space",toggleMuted:"m",toggleFullscreen:"f",togglePictureInPicture:"i",toggleCaptions:"c",volumeUp:"ArrowUp",volumeDown:"ArrowDown",speedUp:{keys:["Shift+>","."],onKeyDown({player:i,remote:n}){let s=i.playbackRate,r=t.find(o=>o>s);r&&n.changePlaybackRate(r)}},slowDown:{keys:["Shift+<",","],onKeyDown({player:i,remote:n}){let s=i.playbackRate,r=[...t].reverse().find(o=>o<s);r&&n.changePlaybackRate(r)}},seekBackward:{keys:["j","J"],onKeyDown({player:i,remote:n}){n.seek(i.currentTime-10)}},seekForward:{keys:["l","L"],onKeyDown({player:i,remote:n}){n.seek(i.currentTime+10)}},seekBackward5s:{keys:["ArrowLeft"],onKeyDown({player:i,remote:n}){n.seek(i.currentTime-5)}},seekForward5s:{keys:["ArrowRight"],onKeyDown({player:i,remote:n}){n.seek(i.currentTime+5)}}}},is_4k(e){return e.src.split("?")[0].includes(".4k.")},async processVTT(e){let t=Array.from(e.textTracks).find(c=>c&&c.kind==="chapters");if(!t)return;let i=this.formatTime(e.duration),r=(await(await fetch(t.src)).text()).replace("99:59:59.000",i),o=new Blob([r],{type:"text/vtt"}),a=URL.createObjectURL(o),l=await $f(),d=new l({src:a,kind:"chapters",default:!0});e.textTracks.remove(t),e.textTracks.add(d)},formatTime(e){let t=Math.floor(e/3600),i=Math.floor(e%3600/60),n=Math.floor(e%60),s=Math.floor(e%1*1e3);return t.toString().padStart(2,"0")+":"+i.toString().padStart(2,"0")+":"+n.toString().padStart(2,"0")+"."+s.toString().padStart(3,"0")},updateVoteBadge(e){let t=document.getElementById(e.vote_badge_id);if(!t)return;let i=t.querySelector(`#${e.vote_badge_id}-vote-up`),n=t.querySelector(`#${e.vote_badge_id}-vote-down`);t.dataset.voted=String(e.voted!==null),i.classList.remove("text-button-primary-default","hover:text-button-gray-hover"),i.classList.add("text-neutral-light","hover:text-neutral-base"),n.classList.remove("text-button-primary-default","hover:text-button-gray-hover"),n.classList.add("text-neutral-light","hover:text-neutral-base"),e.voted===1?(i.classList.remove("text-neutral-light","hover:text-neutral-base"),i.classList.add("text-button-primary-default","hover:text-button-gray-hover")):e.voted===-1&&(n.classList.remove("text-neutral-light","hover:text-neutral-base"),n.classList.add("text-button-primary-default","hover:text-button-gray-hover"))}};window.addEventListener("phx:videos:pause",e=>
318{Object.keys(Nn).forEach(t=>{Nn[t].pause()})});var Ec=Nf;var Ff="/assets/audio/workletProcessor.js",Bf="/assets/audio/rnnoise.wasm",qf="/assets/audio/rnnoise_simd.wasm";var Fn=null;function xc(){return Fn||(Fn=import("./dist-IKPEEEZP.js").then(async({RnnoiseWorkletNode:e,loadRnnoise:t})=>{let i=await t({url:Bf,simdUrl:qf});return{RnnoiseWorkletNode:e,wasmBinary:i}}).catch(e=>{throw Fn=null,e})),Fn}function kc(){xc().catch(()=>{})}function Cc(){return 48e3}async function Tc(e){let{RnnoiseWorkletNode:t,wasmBinary:i}=await xc();return await e.audioWorklet.addModule(Ff),new t(e,{maxChannels:1,wasmBinary:i})}var jf={check(e,t,i,n){let s,r,o=setInterval(async()=>{if(e.getSettings().displaySurface!=="browser")return i(),!1;let l=document.querySelector("#tab-id-pixel"),[d,c,u]=JSON.parse(l.dataset.rgb),p=await new ImageCapture(e).grabFrame(),g=new OffscreenCanvas(1,1).getContext("2d");g.imageSmoothingEnabled=!1,g.drawImage(p,0,0,1,1,0,0,1,1);let[y,E,T]=g.getImageData(0,0,1,1).data,C=document.querySelector("#bitmap-debug");if(C){let x=C.getContext("2d");C.width=p.width,C.height=p.height,x.imageSmoothingEnabled=!1,x.drawImage(p,0,0)}let f=document.querySelector("#bitmap-debug2");if(f){let x=f.getContext("2d");f.width=p.width,f.height=p.height,x.imageSmoothingEnabled=!1,x.drawImage(p,0,p.height-1,1,1,0,0,p.width,p.height)}Math.abs(y-d)<3&&Math.abs(E-c)<3&&Math.abs(T-u)<3?s=!0:s=!1,s!==r&&(s?(r=!0,t()):(r=!1,i()),r=s)},n);e.addEventListener("ended",()=>clearInterval(o))},cancelCheck(e){clearInterval(e)}},Ac=jf;var nr=class{constructor(t){this.audioContext=new AudioContext;let i=this.audioContext.createMediaStreamDestination();this.outputEl=t.outputEl,this.outputEl.srcObject=i.stream,this.samples={},Object.keys(t.samples).forEach(async n=>{let s=t.samples[n],o=await(await fetch(s.src)).arrayBuffer();this.samples[n]=await this.audioContext.decodeAudioData(o)})}play(t,i=100){this.outputEl.play();let n=this.audioContext.createBufferSource(),s=this.audioContext.createGain();s.gain.value=i/100,n.buffer=this.samples[t],n.connect(s),s.connect(this.audioContext.destination),n.start()}},Lc=nr;var sr=class{constructor(){this.audioContext=new AudioContext,this.intervals=[]}close(){this.audioContext.close(),this.audioContext=null,this.intervals.forEach(clearInterval),this.intervals=[]}analyse(t,i){let n=this.audioContext.createAnalyser();n.smoothingTimeConstant=.4,n.fftSize=2048;let s=n.frequencyBinCount,r=this.audioContext.sampleRate/2/s,o=Math.floor(300/r),a=Math.ceil(3400/r);this.audioContext.createMediaStreamSource(t).connect(n);let d=setInterval(()=>{let c=n.frequencyBinCount,u=new Uint8Array(c);n.getByteFrequencyData(u);let p=u.slice(o,a).reduce((h,g)=>g>60?h+1:h,0);i(p>5)},200);this.intervals.push(d)}},rr=sr;var Uf=!0,or=(e,t)=>{let i=document.createElement("div");i.dataset.stream_id=t.id,i.classList.add("relative"),i.classList.add("size-full");let n=document.createElement(e.kind);n.srcObject=t,n.autoplay=!0,n.classList.add("size-full"),n.classList.add("bg-black"),n.addEventListener("pause",n.play);let s=()=>{n.parentNode&&n.parentNode.removeChild(n)};return e.addEventListener("ended",s),e.addEventListener("7sage_ended",s),t.addEventListener("removetrack",s),e.onmute=r=>{n.play()},i.appendChild(n),i},Vf=e=>{try{return JSON.parse(e)}catch{return null}},Nt,U,ar=!1,W={audio:[],camera:[],screen:[]},Ft=[],Bn=[],Bt,gt,lr,qn,Bi,cr="pc_connected";window.DebugStudyRooms=!1;var Wf=e=>{["iceconnectionstatechange","connectionstatechange","signalingstatechange","icegatheringstatechange","icecandidate","icecandidateerror"].forEach(t=>{DebugStudyRooms&&e.addEventListener(t,i=>{let n=new Date().toISOString(),s={connectionState:i.target.connectionState,iceConnectionState:i.target.iceConnectionState,iceGatheringState:i.target.iceGatheringState,signalingState:i.target.signalingState};console.log(`[PC] ${n} ${t}: ${JSON.stringify(s)}`)})})},zf=()=>typeof RestrictionTarget<"u"&&typeof RestrictionTarget.fromElement=="function";setInterval(async()=>{U&&DebugStudyRooms&&(await U.getStats()).forEach(t=>{t.type==="candidate-pair"&&t.selected&&console.log("Active pair:",t.localCandidateId,t.remoteCandidateId,"RTT:",t.currentRoundTripTime,"lost:",t.packetsLost),t.type==="inbound-rtp"&&console.log("Inbound RTP",t.kind,"jitter:",t.jitter,"lost:",t.packetsLost,"decoded:",t.framesDecoded),t.type==="outbound-rtp"&&console.log("Outbound RTP",t.kind,"sent:",t.packetsSent,"bytes:",t.bytesSent)})},2e3);var Jf={async mounted(){this.el.dataset.debug==="true"&&(window.DebugStudyRooms=!0),this.el.addEventListener("toggle-screen-share",this.toggleScreenSharing.bind(this)),this.el.addEventListener("toggle-camera-share",this.toggleCameraSharing.bind(this)),this.el.addEventListener("toggle-mute",this.toggleMute.bind(this)),document.addEventListener("init-video",e=>this.initMedia(e.target)),this.handleEvent("voice:join",this.join.bind(this)),this.handleEvent("voice:rejoin",this.rejoin.bind(this)),this.handleEvent("voice:recover_state",this.recoverState.bind(this)),this.handleEvent("voice:leave",this.leave.bind(this)),this.handleEvent("voice:offer",this.offerAnswer.bind(this)),this.handleEvent("voice:answer",this.offerAnswer.bind(this)),this.handleEvent("voice:ice_candidate",this.onIceCandidate.bind(this)),this.handleEvent("voice:track_removed",this.trackRemoved.bind(this)),this.handleEvent("voice:sync_client_state",this.syncCl
318ientState.bind(this)),this.handleEvent("voice:mute",this.mute.bind(this)),this.handleEvent("voice:other_joined",this.otherJoined.bind(this)),this.handleEvent("voice:other_left",this.otherLeft.bind(this)),this.handleEvent("voice:check_can_screenshare",this.checkCanScreenshare.bind(this)),this.handleEvent("voice:stream_info",this.streamInfo.bind(this)),this.handleEvent("voice:cursor_share",this.cursorShare.bind(this)),await this.initSounds(),setInterval(()=>this.sendConnectedAnalytics(6e4),6e4),setInterval(()=>this.setReconnectHelper(),1e3),this.triggerReconnectHelper(),kc()},sendConnectedAnalytics(e){U&&U.connectionState==="connected"&&this.pushEvent("analytics_connected",{connected_time_ms:e})},setReconnectHelper(){if(document.querySelector("[data-voice-channel]")&&U&&U.connectionState==="connected"){let{voiceChannel:e,voiceChannelTitle:t,voiceChannelTitleClick:i,voiceChannelChatId:n}=document.querySelector("[data-voice-channel]")?.dataset;sessionStorage.setItem(cr,JSON.stringify({voiceChannel:e,voiceChannelTitle:t,voiceChannelTitleClick:i,voiceChannelChatId:n,lastConnected:new Date}))}else sessionStorage.removeItem(cr)},triggerReconnectHelper(){let e=new Date,t=Vf(sessionStorage.getItem(cr));if(t&&!isNaN(new Date(t.lastConnected))){let i=new Date(t.lastConnected),{voiceChannel:n,voiceChannelTitle:s,voiceChannelTitleClick:r,voiceChannelChatId:o}=t;e-i<1e4&&this.pushEvent("trigger-reconnect-help",{channel:n,channel_title:s,channel_title_click:r,chat_id:o})}},async initSounds(){let e={};document.querySelectorAll("audio[data-chime-id]").forEach(t=>{e[t.dataset.chimeId]=t}),this.sounds=new Lc({outputEl:document.querySelector("#chime-player"),samples:e})},stopPeerConn(){Object.values(W).flat().forEach(({track:e})=>{e.stop()}),Bt&&Bt.close(),Bt=null,gt&>.destroy(),gt=null,document.querySelectorAll("[data-video-container], [data-audio-container], [data-camera-container]").forEach(e=>{e.childNodes.forEach(t=>{e.removeChild(t)})}),this.stopCameraSharing("disconnecting"),this.stopScreenSharing("disconnecting"),W={audio:[],camera:[],screen:[]},Ft=[],U&&(this.sounds.play("self-left"),U.close(),U=null),this.setReconnectHelper()},resetPeerConn(){this.makingOffer=!1,this.isSettingRemoteAnswerPending=!1;let e=JSON.parse(this.el.dataset.iceServers);U&&U.close(),U=new RTCPeerConnection({iceServers:e}),Wf(U),U.addEventListener("track",({track:t,streams:[i]})=>{let n;Ft.push({track:t,stream:i}),t.kind==="video"||t.kind==="audio"&&this.analyseTalking(i),this.initMedia()}),U.addEventListener("icecandidate",({candidate:t})=>{this.pushEventTo(this.el,"ice-candidate",{candidate:t})}),U.addEventListener("connectionstatechange",t=>{console.log(`connection state change: ${U.connectionState}`),U.connectionState==="connected"&&this.isMuted()&&this.pushEvent("muted"),U.connectionState==="failed"&&this.stopPeerConn()}),U.addEventListener("negotiationneeded",async()=>{try{this.makingOffer=!0,await U.setLocalDescription(),this.pushEventTo(this.el,"offer",{description:U.localDescription})}catch(t){console.error(t)}finally{this.makingOffer=!1}})},destroyed(){this.stopPeerConn()},setupTalkingCallback(){let e=!1;return t=>{e!=t&&(U.connectionState==="connected"?(this.pushEvent("talking",{talking:t}),e=t):(this.pushEvent("talking",{talking:!1}),e=!1))}},setupTalkingTimeCallback(){let e=!1,t=null;return i=>{e!=i&&(e=i,U.connectionState==="connected"?i?t=new Date:(this.pushEvent("analytics_talking",{talking_time_ms:new Date-t}),t=null):(e=!1,t=null))}},async acquireAudioStream(){Nt||(Nt=new AudioContext({sampleRate:Cc()})),await Nt.resume();let e=await navigator.mediaDevices.getUserMedia({audio:{noiseSuppression:!1,echoCancellation:!0,autoGainControl:!0}}),t=Nt.createMediaStreamSource(e),i=this.getAudioCompressor(),n=Nt.createMediaStreamDestination();t.connect(i);try{gt=await Tc(Nt),i.connect(gt),gt.connect(n)}catch(s){console.error("Noise suppressor unavailable, falling back to browser noise suppression",s),gt.destroy(),gt=!1;try{await e.getAudioTracks()[0].applyConstraints({noiseSuppression:!0})}catch(r){console.error("Could not enable browser noise suppression either",r)}i.connect(n)}return n.stream},getAudioCompressor(){let e=Nt.createDynamicsCompressor();return e.threshold.value=-24,e.knee.value=20,e.ratio.value=4,e.attack.value=.003,e.release.value=.25,e},async join(e){this.stopPeerConn(),this.resetPeerConn(),Bt=new rr;let t=await this.acquireAudioStream(),i=this.setupTalkingCallback(),n=this.setupTalkingTimeC
318allback();this.analyseTalking(t,r=>{i(r),n(r)}),this.sounds.play("self-joined");let s=e.participants_count>=4;for(let r of t.getTracks())s&&(r.enabled=!1),W.audio.push({track:r,stream:t}),await U.addTrack(r,t),this.pushEvent("stream_info",{type:"audio",id:t.id})},async rejoin(){Bt.close(),Bt=new rr,this.resetPeerConn(),this.sounds.play("self-joined"),this.initMedia(),W.audio.forEach(({track:e,stream:t})=>{this.analyseTalking(t)}),await Promise.all(Object.values(W).flat().map(({track:e,stream:t})=>U.addTrack(e,t)))},async recoverState(){this.triggerMutedCallbacks(),this.triggerScreenSharingCallbacks(),this.triggerCameraSharingCallbacks(),this.initMedia()},async leave(){this.stopPeerConn()},analyseTalking(e,t=()=>{}){Bt.analyse(e,i=>{t(i),i?execJS(document.querySelectorAll(`.voice-channel-talking-${e.id}`),"data-talking"):execJS(document.querySelectorAll(`.voice-channel-talking-${e.id}`),"data-not-talking")})},otherJoined(e){this.sounds.play("other-joined",this.calculateVolume(e.participants_count))},otherLeft(e){this.sounds.play("other-left",this.calculateVolume(e.participants_count))},calculateVolume(e){return e>8?0:e>4?31.6:100},checkCanScreenshare(){navigator.mediaDevices?.getDisplayMedia||execJS(document.querySelectorAll(".voice-channel-wrapper[data-disable-screensharing]"),"data-disable-screensharing")},streamInfo({stream_info:e}){Bn=e,this.initMedia()},setupCursorShare(e,t){let n=e.querySelector("video");n.addEventListener("mousemove",r=>this.cursorMoved(r,n,t));let s=setInterval(()=>{if(qn&&(this.pushEvent("mousemove",qn),qn=null),Bi){let r=document.querySelector("[data-cursor][data-own-cursor]");this.moveCursor(r,Bi.x,Bi.y),Bi=null}e.isConnected||clearInterval(s)},1e3/20)},cursorMoved(e,t,i){W.screen.find(p=>p.stream.id===i.id)||(Bi={x:e.clientX,y:e.clientY});let{videoHeight:n,videoWidth:s}=t,{width:r,height:o}=t.getBoundingClientRect();if(!s||!n)return null;let a=s/n,l=r/o,d,c;a>l?(d=r,c=r/a):(c=o,d=o*a);let u=(r-d)/2,m=(o-c)/2;qn={stream_id:i.id,height:c,width:d,offsetX:e.offsetX-u,offsetY:e.offsetY-m}},cursorShare({cursor_share:e}){let t=document.querySelector("#cursor-share-surface"),i,n;if(W.screen.find(c=>c.stream.id===e.stream_id)&&lr)i=window,n=this.getVisiblePageBounds();else for(let c of document.querySelectorAll(`[data-stream_id='${e.stream_id}']`))c.checkVisibility()&&!i&&(i=c,n=i.getBoundingClientRect());if(!n)return;let s,r,o;n.width/e.width>n.height/e.height?(s=n.height/e.height,r=(n.width-e.width*s)/2,o=0):(s=n.width/e.width,r=0,o=(n.height-e.height*s)/2);let a=s*e.offsetX+n.left+r+window.scrollX,l=s*e.offsetY+n.top+o+window.scrollY,d=document.querySelector(`[data-cursor][data-user-id='${e.user_id}']`);this.moveCursor(d,a,l)},moveCursor(e,t,i){e.style.setProperty("--x",`${t}px`),e.style.setProperty("--y",`${i}px`),e.style.setProperty("--opacity",1),clearTimeout(e._idleTimer),e._idleTimer=setTimeout(()=>e.style.setProperty("--opacity",0),1e3)},getVisiblePageBounds(){return{top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight,x:0,y:0}},getContainers(e,t){let i=[...e.querySelectorAll(t)];return e instanceof Element&&e.matches(t)&&i.unshift(e),i},async initMedia(e=document){let t=W.screen.concat(Ft.filter(({stream:n})=>Bn.find(s=>n.id===s.id&&s.type==="screen")));this.getContainers(e,"[data-video-container]").forEach(n=>{n.childNodes.forEach(s=>{n.removeChild(s)}),t.forEach(({track:s,stream:r})=>{let o=or(s,r);this.setupCursorShare(o,r),n.appendChild(o)})}),W.camera.concat(Ft).forEach(({track:n,stream:s})=>{let r=Bn.find(o=>s.id===o.id&&o.type==="camera");r&&this.getContainers(e,`[data-camera-container='${r.user_id}']`).forEach(o=>{o.childNodes.forEach(l=>{o.removeChild(l)});let a=or(n,s);o.appendChild(a)})});let i=Ft.filter(({stream:n})=>Bn.find(s=>n.id===s.id&&s.type==="audio"));this.getContainers(e,"[data-audio-container]").forEach(n=>{n.childNodes.forEach(s=>{n.removeChild(s)}
318),i.forEach(({track:s,stream:r})=>{let o=or(s,r);n.appendChild(o)})})},stopCameraSharing(e){W.camera.length>0&&this.pushEvent("analytics_camera_sharing",{reason:e,sharing:!1}),W.camera.forEach(this.stopStream.bind(this)),execJS(document.querySelectorAll(".voice-channel-wrapper[data-not-camerasharing]"),"data-not-camerasharing")},stopScreenSharing(e){W.screen.length>0&&this.pushEvent("analytics_screen_sharing",{reason:e,sharing:!1}),W.screen.forEach(this.stopStream.bind(this)),execJS(document.querySelectorAll(".voice-channel-wrapper[data-not-screensharing]"),"data-not-screensharing")},stopStream({stream:e,track:t}){t.stop(),t.dispatchEvent(new Event("7sage_ended")),W.audio=W.audio.filter(({stream:i})=>i.id!=e.id),W.screen=W.screen.filter(({stream:i})=>i.id!=e.id),W.camera=W.camera.filter(({stream:i})=>i.id!=e.id),this.pushEvent("stopped-streaming",{stream_id:e.id})},async toggleCameraSharing(){if(this.isCameraSharing())this.stopCameraSharing("toggled");else{let e=await navigator.mediaDevices.getUserMedia({video:!0});for(let t of e.getTracks())W.camera.push({track:t,stream:e}),t.addEventListener("ended",()=>this.stopCameraSharing("stream_ended_browser")),await U.addTrack(t,e),this.pushEvent("stream_info",{type:"camera",id:e.id}),this.pushEvent("analytics_camera_sharing",{sharing:!0})}this.triggerCameraSharingCallbacks()},async toggleScreenSharing(){if(this.isScreenSharing())this.stopScreenSharing("toggled");else{let e=await navigator.mediaDevices.getDisplayMedia({video:!0,selfBrowserSurface:"include"});for(let t of e.getTracks()){let i=!1;this.pushEvent("stream_info",{type:"screen",id:e.id}),this.pushEvent("analytics_screen_sharing",{sharing:!0}),Ac.check(t,async()=>{if(lr=!0,!i&&zf()){i=!0;let n=document.querySelector("#main-surface"),s=await RestrictionTarget.fromElement(n);await t.restrictTo(s)}},()=>{lr=!1},1e3),W.screen.push({track:t,stream:e}),t.addEventListener("ended",()=>this.stopScreenSharing("stream_ended_browser")),await U.addTrack(t,e)}}this.triggerScreenSharingCallbacks()},isMuted(){for(let{track:e}of W.audio)return!e.enabled;return ar},isCameraSharing(){return W.camera.some(({track:e})=>e.readyState==="live")},isScreenSharing(){return W.screen.some(({track:e})=>e.readyState==="live")},async mute(){ar=!0;for(let{track:e}of W.audio)e.enabled=!1;this.pushEvent("muted"),this.triggerMutedCallbacks()},async toggleMute(){ar=!this.isMuted();let e=this.isMuted();for(let{track:t}of W.audio)t.enabled=e;e?this.pushEvent("not-muted"):this.pushEvent("muted"),this.triggerMutedCallbacks()},async syncClientState(){this.triggerMutedCallbacks(),this.triggerScreenSharingCallbacks(),this.triggerCameraSharingCallbacks()},triggerMutedCallbacks(){this.isMuted()?execJS(document.querySelectorAll(".voice-channel-wrapper[data-muted]"),"data-muted"):execJS(document.querySelectorAll(".voice-channel-wrapper[data-not-muted]"),"data-not-muted")},triggerCameraSharingCallbacks(){this.isCameraSharing()?execJS(document.querySelectorAll(".voice-channel-wrapper[data-camerasharing]"),"data-camerasharing"):execJS(document.querySelectorAll(".voice-channel-wrapper[data-not-camerasharing]"),"data-not-camerasharing")},triggerScreenSharingCallbacks(){this.isScreenSharing()?execJS(document.querySelectorAll(".voice-channel-wrapper[data-screensharing]"),"data-screensharing"):execJS(document.querySelectorAll(".voice-channel-wrapper[data-not-screensharing]"),"data-not-screensharing")},async trackRemoved({stream_ids:e}){e.forEach(t=>
318{W.screen.forEach(({stream:n,track:s})=>{n.id===t&&this.stopScreenSharing("bumped_when_someone_else_shared")}),W.camera.forEach(({stream:n,track:s})=>{n.id===t&&this.stopCameraSharing("bumped_when_someone_else_shared")}),Ft=Ft.filter(({stream:n})=>n.id!==t),document.querySelectorAll(`[data-stream_id='${t}']`).forEach(n=>{n.remove()})})},async offerAnswer({description:e}){try{let t=!this.makingOffer&&(U.signalingState==="stable"||this.isSettingRemoteAnswerPending),i=e.type==="offer"&&!t;if(!Uf&&i)return;this.isSettingRemoteAnswerPending=e.type==="answer",await U.setRemoteDescription(e),this.isSettingRemoteAnswerPending=!1,e.type==="offer"&&(await U.setLocalDescription(),this.pushEventTo(this.el,"answer",{description:U.localDescription}))}catch(t){console.error(t)}},async onIceCandidate({candidate:e}){await U.addIceCandidate(e)}},_c=Jf;var Xf={mounted(){this.onMessage=e=>{if(e.source!==this.el.contentWindow)return;let t=e.data;if(!t||t.type!=="widget-resize")return;let i=Math.ceil(Number(t.height));i>0&&(this.el.style.height=`${i}px`)},window.addEventListener("message",this.onMessage),this.el.contentWindow.postMessage({type:"widget-request-height"},"*")},destroyed(){window.removeEventListener("message",this.onMessage)}},Ic=Xf;var dr="game-saves",Pc="game-settings",Kf={mounted(){this.iframe=this.el.querySelector("iframe"),this.onMessage=e=>{if(!this.iframe||e.source!==this.iframe.contentWindow)return;let t=e.data;if(t){if(t.type==="game-settings"){t.action==="get"&&this.sendSettings(),t.action==="set"&&this.storeSettings(t);return}if(t.type==="game-save"){t.action==="get"&&this.sendSave(),t.action==="set"&&this.storeSave(t.save),t.action==="clear"&&this.storeSave(null);return}t.type==="game-event"&&this.pushEvent("game_event",{event:t.event,payload:t.payload||{}})}},this.onVisibility=()=>this.pushEvent("game_visibility",{hidden:document.hidden}),this.onLoad=()=>{this.sendSettings(),this.sendSave()},window.addEventListener("message",this.onMessage),document.addEventListener("visibilitychange",this.onVisibility),this.iframe&&this.iframe.addEventListener("load",this.onLoad),this.onLoad()},sendSettings(){if(!this.iframe||!this.iframe.contentWindow)return;let{games:e={},...t}=this.readSettings();this.iframe.contentWindow.postMessage({type:"game-settings",shared:t,game:e[this.el.dataset.gameId]||{}},"*")},storeSettings({shared:e,game:t}){if(!e&&!t)return;let{games:i={},...n}=this.readSettings(),s={...n,...e};s.games=t?{...i,[this.el.dataset.gameId]:t}:i;try{localStorage.setItem(Pc,JSON.stringify(s))}catch{}},readSettings(){return this.readStored(Pc)},sendSave(){if(!this.iframe||!this.iframe.contentWindow)return;let e=this.readStored(dr)[this.el.dataset.gameId]||null;this.iframe.contentWindow.postMessage({type:"game-save",save:e},"*")},storeSave(e){let t=this.readStored(dr);e&&typeof e=="object"?t[this.el.dataset.gameId]=e:delete t[this.el.dataset.gameId];try{localStorage.setItem(dr,JSON.stringify(t))}catch{}},readStored(e){try{let t=JSON.parse(localStorage.getItem(e));return t&&typeof t=="object"?t:{}}catch{return{}}},destroyed(){window.removeEventListener("message",this.onMessage),document.removeEventListener("visibilitychange",this.onVisibility),this.iframe&&this.iframe.removeEventListener("load",this.onLoad)}},Rc=Kf;function Fe(e){return{mounted(){e().then(({default:t})=>{this.__lazyHookDestroyed||(Object.assign(this,t),t.mounted?.call(this))}).catch(t=>console.error("Failed to load hook",t))},destroyed(){this.__lazyHookDestroyed=!0}}}var Gf=Fe(()=>import("./analytics_date_range_picker-E4CGQ5OS.js")),Yf=Fe(()=>import("./annotations-CEMENMTJ.js")),Qf=Fe(()=>import("./as_image-63VGPFUD.js")),Zf=Fe(()=>import("./chat_message-5ZWVJ2CT.js")),em=Fe(()=>import("./editor_input-DHN65A26.js")),tm=Fe(()=>import("./emoji_picker-OEP3XONS.js")),im=Fe(()=>import("./flatpickr-DI7BKWNE.js")),nm=Fe(()=>import("./search_highlights-FNHJWYZL.js")),sm=Fe(()=>import("./typeform-2OV3PZBG.js")),rm={AnalyticsDateRangePicker:Gf,AiContext:Co,CasGpaState:To,AiCoachStarterPrompt:Ao,AiCoachThinkingLabel:Lo,AskAi:_o,AppDrawer:Po,Annotations:Yf,FlashAutoDismiss:ca,AutoHeight:Do,AsImage:Qf,Carousel:$o,CalendlyEmbed:Ho,
318ChatMessage:Zf,ChatSave:No,Chart:Bo,CommentBracket:Xo,KpiChart:Yo,PlotlyChart:fl,PopoverMenu:ml,Copy:Qo,CopyImage:Zo,CopyLink:ea,DecisionsTrackerFlash:ta,DisableSubmitEnter:ia,DownloadImage:na,Flatpickr:im,Fullscreen:da,Dropdown:ra,DropdownPosition:oa,DualRangeSlider:aa,EditorInput:em,Elapsed:la,EmojiPicker:tm,HasTooltip:Qa,HomeCurriculumAnimation:Za,ImportManual:el,InfiniteScroll:tl,InnerDrawer:il,IntersectionTrigger:nl,LazyTooltipContent:sl,Lesson:ol,LessonSidebar:cl,LessonSidebarToggle:dl,ListingBodyFade:hl,LsacGrantCountdown:ul,OptimisticUpdate:pl,PracticeResultsComponent:gl,PresenceTracker:vl,Recaptcha:Al,PodcastPlayer:wl,PrintPage:El,QuestionInfoDrawerNotebookButton:xl,QuestionTableFilterLabel:kl,QuestionsTableTagsWrapper:Cl,RedirectToClassicDiscussion:rl,RollingNumber:Ll,RoughNotation:_l,SaveScrollPosition:Il,SchoolHover:Rl,SchoolRankingHover:Ol,ScholarshipForm:Pl,ScorePredictionSlider:Ml,ScrolledIntoView:$l,ScrollIntoView:Hl,SearchHighlight:nm,Session:Nl,SharePreptestResult:Fl,Shortcut:Bl,Sortable:ec,StreakMenu:tc,ShowIntercom:Yl,ShowIntercomNewMessage:Gl,SnippetHighlighter:Ql,Spotlight:Zl,StarRating:ic,StepperInput:nc,SubscriptionCustomCheckoutLive:oc,TabsSlider:ac,TesterNavScroll:lc,TesterOptionClick:cc,Tick:dc,TimedBreakTimer:uc,TimeLimitComponent:hc,Timer:fc,ToggleClampButton:mc,ToolbarVisibility:gc,TutoringCustomPriceCardInputMask:vc,TypeformHook:sm,UserSearch:bc,VideoTranscriptSidebar:yc,Vidstack:Ec,VoiceChannel:_c,WidgetIframe:Ic,GameBridge:Rc,WallNav:Ro,HomeTestimonialGridAnimation:Oo,HomeTestimonialCard:Mo},Oc=rm;var Mc={};var om=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Dc=()=>{let e=null,t=()=>{if(!e)return;let{querySelector:n,highlightTarget:s,highlightClass:r,behavior:o="smooth",block:a="center",inline:l="nearest"}=e.detail||{},d=n?document.querySelector(n):e.target;if(!d)return;let c=s&&(d.querySelector(s)||d);c&&c.classList.remove(r),om(()=>{d.scrollIntoView({block:a,inline:l,behavior:o}),c&&c.classList.add(r)}),e=null},i=n=>{e=n,t(),n.detail?.querySelector&&setTimeout(()=>{e===n&&(e=null)},3e3)};window.addEventListener("app:scrollTo",i),window.addEventListener("phx:scrollTo",i),window.addEventListener("phx:update",t)};var am={essayFeedback:e=>` 319 <div class="flex flex-col gap-3 p-3"> 320 <div class="flex items-center gap-1.5"> 321 <img 322 src="https://ik.imagekit.io/7sage/essays/review-committee.jpg?tr=cm-pad_resize,bg-ffffff00,w-20,h-20" 323 class="size-5 rounded-full object-cover" 324 /> 325 <div class="text-content-base text-md font-semibold"> 326 7Sage Admissions Committee feedback 327 </div> 328 </div> 329 <div class="text-base text-content-secondary">${e.getAttribute("tooltip-content")}</div> 330 </div> 331 `};function hr(){let e=document.querySelectorAll("[has-tooltip]:not([tooltip-formatter])");$i(e,{inertia:!0,allowHTML:!0,interactive:!0,content:i=>{if(i.hasAttribute("tooltip-content"))return i.getAttribute("tooltip-content");if(i.hasAttribute("tooltip-content-id")){let n=i.getAttribute("tooltip-content-id");return document.querySelector(`[tooltip-id=${n}]`)?.innerHTML||""}return""}}),document.querySelectorAll("[has-tooltip][tooltip-formatter]").forEach(i=>{let n=i.getAttribute("tooltip-theme");$i(i,{inertia:!0,allowHTML:!0,interactive:!0,appendTo:()=>document.body,placement:"auto",maxWidth:500,theme:n,content:s=>{let r=s.getAttribute("tooltip-formatter"),o=am[r];return o?o(s):s.getAttribute("tooltip-content")||""}})})}var Ke=document.getElementById("confirm_dialog"),jn="data-confirm-resolved";document.body.addEventListener("phoenix.link.click",e=>{e.stopPropagation();var t=e.target.getAttribute("data-confirm"),i=e.target.getAttribute("data-confirm-html"),n=e.target.getAttribute("data-confirm-title"),s=e.target.getAttribute("data-confirm-action"),r=e.target.getAttribute("data-confirm-button-class"),o=e.target.getAttribute("data-backdrop-click-capture");
331if(!(!t&&!i)){if(e.target?.hasAttribute(jn)){e.target.removeAttribute(jn);return}if(e.preventDefault(),e.target?.setAttribute(jn,""),Ke.returnValue="cancel",i?Ke.querySelector("[data-ref='message']").innerHTML=i:Ke.querySelector("[data-ref='message']").innerText=t,n&&(Ke.querySelector("[data-ref='title']").innerText=n),s&&(Ke.querySelector("[data-ref='confirm']").innerText=s),r){let a=Ke.querySelector("[data-ref='confirm']");a.dataset.confirmButtonClass&&a.classList.remove(a.dataset.confirmButtonClass),a.classList.add(r),a.dataset.confirmButtonClass=r}o&&Ke.setAttribute("data-backdrop-click-capture",!0),Ke.showModal(),Ke.addEventListener("close",({target:a})=>{a.returnValue==="confirm"?e.target?.click():e.target?.removeAttribute(jn),Ke.removeAttribute("data-backdrop-click-capture")},{once:!0})}},!1);window.addEventListener("click",e=>{let t=e.target.closest("dialog#confirm_dialog");if(t){if(e.target.tagName==="BUTTON"){e.stopPropagation();return}t.hasAttribute("data-backdrop-click-capture")&&(e.preventDefault(),e.stopPropagation())}},!0);var Hc=!1,qi=document.getElementById("static-changed-banner");qi&&(qi.querySelector("[data-refresh]").addEventListener("click",()=>window.location.reload()),qi.querySelector("[data-dismiss]").addEventListener("click",()=>{Hc=!0,qi.classList.add("hidden")}),window.addEventListener("phx:static-changed",()=>{Hc||qi.classList.remove("hidden")}));var ur=class e{static instance=null;callbacks;processedMessages;injectedObject={};constructor(){e.instance||(e.instance=this,this.callbacks=new Map,this.processedMessages=new Set,this.setupMessageListener(),window.addEventListener("phx:user-settings-changed",()=>this.sendMessage("USER_SETTINGS_CHANGED")))}getInjectedObject(){try{return JSON.parse(window.ReactNativeWebView.injectedObjectJson())}catch{return{}}}getDeviceInformation(){let{device:t={}}=this.getInjectedObject();return t}setupMessageListener(){document.addEventListener("message",this.handleMessage.bind(this)),window.addEventListener("message",this.handleMessage.bind(this))}handleMessage(t){try{let i=JSON.parse(t.data),n=JSON.stringify(i);if(this.processedMessages.has(n))return;this.processedMessages.add(n),this.scheduleMessageForDeletion(n),this.onMessageReceived(i.type,i.payload)}catch{}}onMessageReceived(t,i){switch(t){case"NAVIGATE":this.handleNavigate(i);break;case"OPEN_CHAT":this.handleOpenChat(i);break;case"RECONNECT":window.liveSocket&&window.liveSocket.connect();break;case"OPEN_INTERCOM":this.handleOpenIntercom();break;default:console.error("Unknown message type:",t);break}}handleNavigate(t){if(t.path)try{window.liveSocket&&window.liveSocket.isConnected()?(window.history.pushState({},"",t.path),window.dispatchEvent(new PopStateEvent("popstate"))):window.location.assign(t.path)}catch(i){console.error("Navigation error:",i)}}handleOpenChat(t){if(!t.chat_id)return;let i=document.getElementById("app-drawer-live");i&&window.liveSocket&&window.liveSocket.isConnected()?window.liveSocket.js().push(i,"open-chat",{value:{action:"open_chat",chat_id:t.chat_id}}):t.link&&this.handleNavigate({path:t.link})}handleOpenIntercom(){typeof window.Intercom=="function"?window.Intercom("show"):console.warn("Intercom is not available")}isWebView(){return typeof window.ReactNativeWebView<"u"}sendMessage(t,i={}){this.isWebView()&&window.ReactNativeWebView.postMessage(JSON.stringify({type:t,payload:i}))}scheduleMessageForDeletion(t){setTimeout(()=>this.processedMessages.delete(t),5e3)}},ji=new ur;var lm=e=>e.tagName==="DIALOG"?e.open:e.style.display==="block";function $c(){let e=new Set;for(let t of document.querySelectorAll("[data-scroll-lock]"))lm(t)&&e.add(t.dataset.scrollLock);for(let t of["overlay","drawer-panel","notifications-panel"])document.body.classList.toggle(`${t}-open`,e.has(t))}var pr=!1;function cm(){pr||(pr=!0,queueMicrotask(()=>{pr=!1,$c()}))}function dm(e){if(e.type==="attributes")return e.target.nodeType===1&&e.target.hasAttribute("data-scroll-lock");for(let t of[e.addedNodes,e.removedNodes])for(let i of t)if(i.nodeType===1&&(i.hasAttribute("data-scroll-lock")||i.querySelector("[data-scroll-lock]")))return!0;return!1}function Nc(){$c(),new MutationObserver(e=>{for(let t of e)if(dm(t)){cm();return}}).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","open"]})}var ai=new WeakSet,nt=new Set,Ui={navigating:!1};function li(e){let t=e.dataset.shift;if(t===void 0)return null;if(e.__shiftSpecRaw===t)return e.__shiftSpec;e.__shiftSpecRaw=t;try{return e.__shiftSpec=JSON.parse(t)}catch{return e.__shiftSpec=null}}function Be(e){if(e.offsetParent===null&&e!==document.body&&e!==document.documentElement&&getComputedStyle(e).position!=="fixed")return null;let t=0,i=0,n=e;for(;n;)t+=n.offsetTop||0,i+=n.offsetLeft||0,n=n.offsetParent;let s=0,r=0,o=e.parentElement;for(;o;)s+=o.offsetTop||0,r+=o.offsetLeft||0,o=o.offsetParent;return{top:t,left:i,width:e.offsetWidth,height:e.offsetHeight,localTop:t-s,localLeft:i-r,parent:e.parentElement}}var ci;function hm(){return ci!==void 0||(ci=typeof IntersectionObserver>"u"?null:new IntersectionObserver(e=>{for(let t of e){let i=t.target;if(i.__shiftOnscreen=t.isIntersecting,t.isIntersecting&&!i.__shiftTransitioning){let n=Be(i);n&&(i.__shiftLayout=n)}}}
331,{rootMargin:"100% 0px 100% 0px"})),ci}function Fc(e){let t=hm();t&&t.observe(e)}function Bc(e){ci&&ci.unobserve(e)}function Un(e){if(e.__shiftOnscreen!==void 0)return e.__shiftOnscreen===!1;let t=window.innerHeight||document.documentElement.clientHeight||0,i=e.getBoundingClientRect();return i.bottom<-t||i.top>t+t}function qc(e){let t=e.stiffness??170,i=e.damping??22,n=e.mass??1,s=1/240,r=4,o=.001,a=1440,l=1,d=0,c=[0],u=0;for(;u<a;){let m=(-t*l-i*d)/n;if(d+=m*s,l+=d*s,u+=1,u%r===0&&c.push(1-l),Math.abs(l)<o&&Math.abs(d)<o)break}return u%r!==0&&c.push(1-l),{progress:c,durationMs:u*s*1e3}}var um=.3,pm={x:"translateX",y:"translateY",z:"translateZ",scale:"scale",scaleX:"scaleX",scaleY:"scaleY",rotate:"rotate",rotateX:"rotateX",rotateY:"rotateY",skewX:"skewX",skewY:"skewY"},fm={x:"px",y:"px",z:"px",rotate:"deg",rotateX:"deg",rotateY:"deg",skewX:"deg",skewY:"deg"},mm=new Set(["height","width","top","left","right","bottom","paddingTop","paddingBottom","paddingLeft","paddingRight","marginTop","marginBottom","marginLeft","marginRight","borderTopWidth","borderBottomWidth","borderLeftWidth","borderRightWidth","fontSize","lineHeight"]),gm={height:["paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"],width:["paddingLeft","paddingRight","marginLeft","marginRight","borderLeftWidth","borderRightWidth"]},di={opacity:1,x:0,y:0,z:0,scale:1,scaleX:1,scaleY:1,rotate:0,rotateX:0,rotateY:0,skewX:0,skewY:0},vm={enter:"cubic-bezier(0.22, 1, 0.36, 1)",exit:"cubic-bezier(0.4, 0, 0.2, 1)",layout:"cubic-bezier(0.4, 0, 0.2, 1)"};function hi(e,t,i,n){let s=getComputedStyle(i);for(let r of gm[n])r in e||(e[r]=0),r in t||(t[r]=parseFloat(s[r])||0)}function Vi(e){let t={},i=[];for(let n in e){let s=pm[n];if(s){let r=e[n],o=fm[n]||"",a=typeof r=="number"&&o?`${r}${o}`:r;i.push(`${s}(${a})`)}else mm.has(n)&&typeof e[n]=="number"?t[n]=`${e[n]}px`:t[n]=e[n]}return i.length&&(t.transform=i.join(" ")),t}function fr(e={},t){return{duration:(e.duration??um)*1e3,delay:(e.delay??0)*1e3,easing:e.easing??vm[t]??"ease",fill:"both"}}function qt(e,t,i={},n){if(i.type==="spring"){let{progress:s,durationMs:r}=qc(i),o=new Set([...Object.keys(e),...Object.keys(t)]);return{keyframes:s.map(l=>{let d={};for(let c of o){let u=e[c],m=t[c];d[c]=typeof u=="number"&&typeof m=="number"?u+(m-u)*l:m}return Vi(d)}),options:{duration:r,delay:(i.delay??0)*1e3,easing:"linear",fill:"both"}}}return{keyframes:[Vi(e),Vi(t)],options:fr(i,n)}}function Vn(e){if(ai.has(e))return;ai.add(e),nt.add(e),Fc(e);let t=li(e);t&&(mr.push({el:e,spec:t}),gr||(gr=!0,queueMicrotask(bm)))}var mr=[],gr=!1;function bm(){gr=!1;let t=mr.splice(0,mr.length).map(({el:i,spec:n})=>ym(i,n)).filter(Boolean);for(let i of t)wm(i)}function ym(e,t){let i=Be(e);if(i&&(e.__shiftLayout=i),e.parentElement&&(e.__shiftSiblingIndex=[...e.parentElement.children].indexOf(e),e.parentElement.__shiftLastEnterMs=performance.now()),Un(e))return null;let s=!(t.disable||[]).includes("fade"),r=t.initial?{...t.initial}:{},o=t.animate?{...t.animate}:{};s&&("opacity"in r||(r.opacity=0),"opacity"in o||(o.opacity=1));for(let l in r)l in o||(l==="height"?o[l]=e.offsetHeight:l==="width"?o[l]=e.offsetWidth:l in di&&(o[l]=di[l]));"height"in r&&hi(r,o,e,"height"),"width"in r&&hi(r,o,e,"width");let a="height"in r||"width"in r||"height"in o||"width"in o;return a&&(r.overflow="hidden",o.overflow="hidden"),Object.keys(r).length===0&&Object.keys(o).length===0?null:{el:e,spec:t,initial:r,animate:o,hasSize:a}}function wm({el:e,spec:t,initial:i,animate:n,hasSize:s}){let r;if(Object.keys(i).length>0&&Object.keys(n).length>0){let{keyframes:o,options:a}=qt(i,n,t.transition,"enter");r=e.animate(o,a)}else if(Object.keys(n).length>0)r=e.animate([Vi(n)],fr(t.transition,"enter"));else return;s&&(e.__shiftTransitioning=!0,r.addEventListener("finish",()=>{e.__shiftTransitioning=!1,e.__shiftLayout=Be(e),r.cancel()}),r.addEventListener("cancel",()=>{e.__shiftTransitioning=!1}))}function jc(e){if(Ui.navigating)return;let t=li(e);if(!t)return;let n=!(t.disable||[]).includes("fade"),s=t.exit?{...t.exit}:{};
331if(n&&!("opacity"in s)&&(s.opacity=0),Object.keys(s).length===0||Un(e))return;let r="height"in s||"width"in s;if(e.__shiftTransitioning=!0,r){br.push({el:e,spec:t,exitMap:s}),yr||(yr=!0,queueMicrotask(Sm));return}Wc(),Em(e,t,r)&&_m(e),Vc(Uc(e,t,s))}var br=[],yr=!1;function Sm(){yr=!1;let e=br.splice(0,br.length);Wc();let t=e.map(({el:i,spec:n,exitMap:s})=>Uc(i,n,s));for(let i of t)Vc(i),i.el.parentElement&&Cm(i.el.parentElement)}function Uc(e,t,i){return{el:e,spec:t,exitMap:i,from:xm(e,i),cellPlans:km(e,i)}}function Vc({el:e,spec:t,from:i,exitMap:n,cellPlans:s}){let{keyframes:r,options:o}=qt(i,n,t.transition,"exit");e.animate(r,o);for(let{cell:a,from:l,to:d}of s){let c=qt(l,d,t.transition,"exit");a.animate(c.keyframes,c.options)}}function Em(e,t,i){if(i)return!1;let n=e.parentElement;if(!n)return!1;let s=Array.from(n.children).some(a=>a!==e&&a.hasAttribute("data-shift")&&!ai.has(a)),r=performance.now()-(n.__shiftLastEnterMs||0)<100,o=t.pin_exit===!0&&Tm(e);return s||r||o}function xm(e,t){let i={};for(let n of Object.keys(t))n==="height"?i[n]=e.offsetHeight:n==="width"?i[n]=e.offsetWidth:n in di?i[n]=di[n]:i[n]=0;return("height"in t||"width"in t)&&(i.overflow="hidden",t.overflow="hidden","height"in t&&hi(t,i,e,"height"),"width"in t&&hi(t,i,e,"width")),i}function km(e,t){if(!("height"in t))return[];if(getComputedStyle(e).display!=="table-row")return[];let i=[];for(let n of e.children){if(n.tagName!=="TD"&&n.tagName!=="TH")continue;let s=getComputedStyle(n);i.push({cell:n,from:{paddingTop:parseFloat(s.paddingTop)||0,paddingBottom:parseFloat(s.paddingBottom)||0,fontSize:parseFloat(s.fontSize)||0,lineHeight:s.lineHeight==="normal"?(parseFloat(s.fontSize)||0)*1.2:parseFloat(s.lineHeight)||0,overflow:"hidden"},to:{paddingTop:0,paddingBottom:0,fontSize:0,lineHeight:0,overflow:"hidden"}})}return i}var vr=new Set;function Cm(e){if(vr.has(e))return;vr.add(e);let t=()=>{if([...e.children].some(n=>n.__shiftTransitioning&&n.hasAttribute("data-shift"))&&e.isConnected){Am(e),requestAnimationFrame(t);return}vr.delete(e),e.isConnected&&Lm(e)};requestAnimationFrame(t)}function Tm(e){let t=e.nextElementSibling;for(;t;){if(t.hasAttribute("data-shift")&&ai.has(t)&&!t.__shiftTransitioning)return!0;t=t.nextElementSibling}return!1}function Am(e){if(e)for(let t of e.children)t.hasAttribute("data-shift")&&t.isConnected&&(t.__shiftTransitioning||t.__shiftOnscreen!==!1&&(t.__shiftLayout=Be(t)))}function Lm(e){if(e)for(let t of e.children)t.hasAttribute("data-shift")&&(t.__shiftTransitioning||(t.__shiftLayout=null))}function Wc(){for(let e of nt){if(!e.__shiftTransitioning||typeof e.__shiftSiblingIndex!="number")continue;let t=e.parentElement;if(!t)continue;let i=[...t.children].indexOf(e),n=e.__shiftSiblingIndex;if(i===-1||i===n)continue;if(n>=t.children.length){t.lastElementChild!==e&&t.appendChild(e);continue}let s=t.children[n];s!==e&&t.insertBefore(e,s)}}function _m(e){let t=e.__shiftLayout;t&&(e.style.position="fixed",e.style.top=t.top-(window.scrollY||0)+"px",e.style.left=t.left-(window.scrollX||0)+"px",e.style.width=t.width+"px",e.style.height=t.height+"px",e.style.margin="0")}function zc(){let e=[];for(let t of nt){if(!t.isConnected){nt.delete(t),Bc(t);continue}if(t.__shiftTransitioning||t.__shiftOnscreen===!1)continue;let i=li(t);if(!i)continue;let n=t.__shiftLayout,s=Be(t);if(!s||(t.__shiftLayout=s,t.parentElement&&(t.__shiftSiblingIndex=[...t.parentElement.children].indexOf(t)),!n))continue;let r=i.disable||[],o=n.left-s.left,a=n.top-s.top,l=s.width-n.width,d=s.height-n.height,c=(n.localLeft??n.left)-(s.localLeft??s.left),u=(n.localTop??n.top)-(s.localTop??s.top),m=n.parent!==s.parent,p=!r.includes("position")&&(m||Math.abs(c)>1||Math.abs(u)>1),h=!r.includes("size")&&(Math.abs(l)>1||Math.abs(d)>1);(p||h)&&e.push({el:t,dx:o,dy:a,prevW:n.width,prevH:n.height,newW:s.width,newH:s.height,animatePos:p,animateSize:h,spec:i})}for(let t of e){t.el.__shiftFlip&&t.el.__shiftFlip.cancel();let i={},n={};t.animatePos&&(i.x=t.dx,i.y=t.dy,n.x=0,n.y=0),t.animateSize&&(i.width=t.prevW,i.height=t.prevH,n.width=t.newW,n.height=t.newH,i.overflow="hidden",n.overflow="hidden");let{keyframes:s,options:r}=qt(i,n,t.spec.transition,"layout"),o=t.el.animate(s,r);o.addEventListener("finish",()=>o.cancel()),t.el.__shiftFlip=o}}function Im(e){e.nodeType===Node.ELEMENT_NODE&&(e.matches("[data-shift]")&&(Vn(e),Er(e)),e.querySelectorAll("[data-shift]").forEach(t=>{Vn(t),Er(t)}))}var wr=!1;function Pm(){wr||(wr=!0,requestAnimationFrame(()=>{wr=!1,zc()}))}var Sr;function Er(e){Sr&&Sr.observe(e)}
331function Jc(){Sr=new IntersectionObserver(t=>{for(let i of t){let n=i.target;if(!i.isIntersecting||n.__shiftLayout)continue;let s=Be(n);s&&(n.__shiftLayout=s)}},{threshold:0}),document.querySelectorAll("[data-shift]").forEach(t=>{Vn(t),Er(t)}),new MutationObserver(t=>{for(let i of t)for(let n of i.addedNodes)Im(n);Pm()}).observe(document.body,{childList:!0,subtree:!0}),document.addEventListener("shift:exit",t=>jc(t.target)),window.addEventListener("phx:page-loading-start",t=>{if(t.detail?.kind==="redirect"){Ui.navigating=!0;for(let i of document.querySelectorAll("[data-shift][phx-remove]"))i.closest("[phx-sticky]")||i.removeAttribute("phx-remove")}}),window.addEventListener("phx:page-loading-stop",()=>{Ui.navigating=!1});let e=!1;window.addEventListener("resize",()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;for(let t of nt)t.isConnected&&(t.__shiftTransitioning||(t.__shiftLayout=Be(t)))}))})}window.debounce=(e,t)=>{let i;return(...n)=>{clearTimeout(i),i=setTimeout(()=>e(...n),t)}};window.HAS_MAIN_PAGE_LOADED=!0;var Xc=document.querySelector("meta[name='full-stylesheet']");if(Xc){let e=document.createElement("link");e.rel="stylesheet",e.href=Xc.content,document.head.appendChild(e)}window.addEventListener("phx:set-theme",({detail:e})=>{document.documentElement.classList.toggle("dark",e.dark)});window.isDarkMode=document.documentElement.classList.contains("dark");new MutationObserver(()=>{let e=window.isDarkMode;window.isDarkMode=document.documentElement.classList.contains("dark"),window.isDarkMode!==e&&window.dispatchEvent(new CustomEvent("theme-changed"))}).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]});Jc();Nc();hr();Dc();$t.initExistingInputs();xo.init();/iPad|iPhone|iPod/.test(navigator.userAgent)&&document.documentElement.classList.add("ios");var Rm=document.querySelector("meta[name='csrf-token']").getAttribute("content"),Wn=sessionStorage.getItem("tabId");Wn==null&&(Wn=crypto.randomUUID(),sessionStorage.setItem("tabId",Wn));function Om(e){let t=[100,200,500,1e3,2500,5e3,1e4][e-1]||15e3,i=Mm(75,125)/100;return t*i}function Mm(e,t){let i=Math.ceil(e),n=Math.floor(t);return Math.floor(Math.random()*(n-i)+i)}var xr=new Eo("/live",Or,{hooks:{...Oc,...Mc},dom:{onBeforeElUpdated:(e,t)=>{["DETAILS"].indexOf(e.tagName)>=0&&Array.from(e.attributes).forEach(i=>{t.setAttribute(i.name,i.value)}),e.tagName==="TEXTAREA"&&e.style.height&&(t.style.height=e.style.height)}},params:{_locale:Intl.NumberFormat().resolvedOptions().locale,_timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,_csrf_token:Rm,_device:ji.getDeviceInformation(),tab_id:Wn},longPollFallbackMs:window.location.hostname==="dev.7sage.com"?!1:2500,reconnectAfterMs:Om,timeout:3e4}),ui=null;window.addEventListener("phx:page-loading-start",e=>{ui||(ui=setTimeout(()=>{document.getElementById("phx-loading-bar")?.classList.add("active"),ui=null},500))});window.addEventListener("phx:page-loading-stop",e=>{ui&&(clearTimeout(ui),ui=null),document.getElementById("phx-loading-bar")?.classList.remove("active"),hr(),location.hash!==""&&(location.href=location.hash),$t.initExistingInputs()});window.addEventListener("phx:focus",e=>{let t=document.getElementById(e.detail.id);t&&t.focus()});window.addEventListener("phx:scrollToTop",e=>{window.scrollTo(0,0)});window.addEventListener("phx:scroll-to-activity",({detail:{activity_id:e}})=>{requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({behavior:"smooth",block:"start"})})});window.addEventListener("phx:new-tab",({detail:{url:e,title:t}})=>{if(ji.isWebView()){let i=t;if(!i)try{i=new URL(e,window.location.href).hostname}catch{i="7Sage"}ji.sendMessage("OPEN_SHEET",{title:i,url:e});return}window.open(e,"_blank")?.focus()});window.execJS=(e,t)=>{e.forEach(i=>{let n=i.getAttribute(t);n&&xr.execJS(i,n,"click")})};window.addEventListener("phx:js-exec",e=>{execJS(document.querySelectorAll(e.detail.to),e.detail.attr)});window.addEventListener("phx:app:webview_message",e=>{ji.sendMessage(e.detail.type,e.detail.payload)});window.addEventListener("app:clearInputs",e=>{let t=document.querySelectorAll(e.detail.target);t.forEach(s=>{s.type==="text"&&(s.value=""),s.type==="checkbox"&&(s.checked=!1),s.type==="radio"&&(s.checked=!1),s.tagName==="SELECT"&&(s.value="")}
331);let i=new Event("change",{bubbles:!0}),n=t.item(0);n&&n.dispatchEvent(i)});window.addEventListener("app:moveUnder",e=>{let{id:t,target_id:i}=e.detail,n=document.getElementById(t),s=document.getElementById(i);n&&s&&window.requestAnimationFrame(()=>{let r=n.getBoundingClientRect(),o=s.getBoundingClientRect();top_difference=o.bottom-r.top,left_difference=o.left-r.left,n.style.top=`${Math.round(n.style.top+top_difference)}px`,n.style.left=`${Math.round(n.style.left+left_difference)}px`})});"serviceWorker"in navigator&&(window.addEventListener("load",()=>{navigator.serviceWorker.register("/service-worker.js")}),navigator.serviceWorker.addEventListener("message",e=>{e.data.type}),navigator.serviceWorker.ready.then(e=>{e.active.postMessage("check-for-update")}));xr.connect();window.liveSocket=xr;oi.initialize();window.addEventListener("phx:navigate",({detail:{href:e}})=>window.requestAnimationFrame(()=>window.requestAnimationFrame(()=>oi.update(e))));
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.