1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_spa/papaparse.min-CLfTknQe.js","_spa/vendor-stagetimerio-BeI8GIcA.js"])))=>i.map(i=>d[i]); 2/*! 3 * @stagetimerio/client v3.5.9 4 * Copyright(c) 2026 Lukas Hermann <[email protected]> 5 * All rights reserved. 6 * 7 * Unauthorized copying of this file, via any medium is strictly prohibited. 8 * Proprietary and confidential. 9 * 10 * For licenses information, see https://stagetimer.io/licenses/THIRD-PARTY-LICENSES.txt 11 */ 12var iu=Object.defineProperty,ru=Object.defineProperties;var uu=Object.getOwnPropertyDescriptors;var nl=Object.getOwnPropertySymbols;var Uo=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable;var ns=(e,l,s)=>l in e?iu(e,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[l]=s,Q=(e,l)=>{for(var s in l||(l={}))Uo.call(l,s)&&ns(e,s,l[s]);if(nl)for(var s of nl(l))Lo.call(l,s)&&ns(e,s,l[s]);return e},re=(e,l)=>ru(e,uu(l));var an=(e,l)=>{var s={};for(var t in e)Uo.call(e,t)&&l.indexOf(t)<0&&(s[t]=e[t]);if(e!=null&&nl)for(var t of nl(e))l.indexOf(t)<0&&Lo.call(e,t)&&(s[t]=e[t]);return s};var ut=(e,l,s)=>ns(e,typeof l!="symbol"?l+"":l,s);var le=(e,l,s)=>new Promise((t,a)=>{var o=p=>{try{r(s.next(p))}catch(d){a(d)}},i=p=>{try{r(s.throw(p))}catch(d){a(d)}},r=p=>p.done?t(p.value):Promise.resolve(p.value).then(o,i);r((s=s.apply(e,l)).next())});import{e as O,X as x,k as $,g as n,F as ee,a0 as ge,N as $e,af as g,as as me,am as An,L as j,o as v,au as Be,i as N,h as Z,$ as F,ad as du,ab as q,a2 as pe,a1 as Ke,
12S as De,ar as L,al as ft,ah as Fl,q as cu,ag as Ro,ap as Te,Q as Qe,ac as Js,n as U,z as je,a3 as Ct,D as eo,B as Gn,a4 as gi,W as Bl,a as to,at as Re,Z as ht,K as dt,ak as Mt,I as Rt,V as Rs,m as mu,u as pu,T as fu,l as bu,aj as vu,Y as ls}from"./vendor-deprecated-zwPrZ2Sr.js";import{i as gu,_ as hu,a as xu,g as wu,b as yu,u as ku,c as $u,f as Ao}from"./OutputViewRoot-CqSkvhMM.js";import{_ as It,C as Le,P as Su}from"./LicenseAlert-5ewqVN5d.js";import{g as hi,t as rn,d as Xe,b as Cu,u as no}from"./getBackgroundStyles-BuOgX8V6.js";import{M as be,l as ue,ah as ce,k as J,ac as Ge,N as Xt,ab as Ie,z as ln,T as st,P as ot,p as Mu,t as Tu,_ as tt,c as Dn,u as vn,x as rt,R as Vt,s as zu,r as jt,G as xi,Z as wi,o as Iu,B as Kt,e as Lt,C as Ou,Q as gn,g as Du,ai as yi,af as _e,E as ki,a4 as Eu,a0 as $i,a9 as _o,ag as et,D as Pt,L as fn,ad as Me,v as Si,H as Uu,a2 as Ci,i as As,J as Lu}from"./vendor-stagetimerio-BeI8GIcA.js";import{bh as Pl,g as Oe,bL as Mi,aJ as Ot,a8 as At,F as pt,bj as en,ah as lo,q as _t,ci as se,b0 as sn,ax as kt,cA as wt,bl as Ti,cw as Fe,aG as Ru,c1 as Au,aW as _n,bE as so,i as zi,l as Ii,cB as kn,O as ze,a5 as _s,bb as Oi,bc as _u,bv as nt,by as oo,cC as Nl,R as Fu,U as Bu,Q as Pu,cq as Di,cz as Nu,e as zt,ao as Hu,a3 as Vu,aV as Ei,ac as ju,d as Fs,cv as ao,b2 as qu,aN as Xn,ap as Cl,b4 as Wu,a$ as Ui,bD as io,cm as Gu,bf as Li,bu as Ri,av as Hl,c3 as Xu,c5 as Yu,bP as ro,bQ as Fn,aB as ll,_ as Ku,cu as Ai,aA as Zu,j as Bs,cD as Yn,ai as Vl,aq as _i,aL as Fi,aK as Qu,bi as Ju,b6 as Bi,u as ed,B as td,cG as nd,as as ld,aj as sd,bd as Pi,cs as od,bK as Ni,bG as xl,bF as Hi,bk as ad,bA as Mn,cp as id,K as rd,bx as Vi,c6 as ud,m as Fo,bw as ji,br as uo,x as Bo,w as Po,af as co,a2 as mo,cF as qi,aa as po,b9 as fo,aZ as dd,Y as Ml,V as Tl,ag as Bn,ar as Kn,ct as Wi,am as Pn,$ as cd,X as Gi,bm as md,bt as pd,ay as fd,aM as bd,Z as vd,aI as No,f as Xi,bX as gd,b$ as hd,c9 as xd,ca as wd,c0 as yd,bV as kd,c7 as $d,b8 as Sd,b1 as bo,ba as Yi,W as Cd,aP as Ps,aO as Ns,J as Md,bT as Td,n as zd,aX as Id,I as Od,L as Dd,S as Ed,E as Ud,a as Ki,cx as Ld}from"./index-DhgQlO9p.js";import{_ as on,s as Hs,a as Rd}from"./MessageSection-2lqJY3Yc.js";import{_ as Y}from"./InfoTooltip-rIBa4EHp.js";import{_ as Zn,a as Zi}from"./TimezoneSelect-PCbF9B61.js";import{D as vo,a as Ad,u as _d,C as go,m as Tt,S as Fd}from"./platform-DLGrPJTy.js";import{_ as $t}from"./DropdownMenu-G77oxxos.js";import{a as de}from"./axiosDecorator-D_ABx8lm.js";import{u as Bd}from"./fontLoader-yViJ6UfM.js";import{_ as Qi}from"./TimerStartStopBtn-DICve3kH.js";import{f as Ji,b as zl,a as Pd,_ as ho}from"./index.es-DHiDn7rp.js";import{_ as Nd,a as Hd}from"./ClientOptionsDropdown-BGYusnl0.js";import{_ as jl}from"./TimerLabel-Ct4sSS5G.js";import{M as Vd}from"./MuteButton-BDrcpRom.js";import{_ as jd}from"./RoomProgress-RQQXj5ZO.js";import{_ as qd}from"./TimerFormattedDuration-BXlB-rRx.js";import{u as Wd,b as Gd,o as Xd,f as Yd,s as Kd,a as Zd,p as Ee}from"./vendor-pricing-BDdy1Nfx.js";import{i as er}from"./index.es-BgUmZzRw.js";import{b as tr,a as Qd,c as Jd}from"./upperFirst-BsyB8OpQ.js";import{B as Nn}from"./ButtonHalo-DrJ7PhV4.js";import{C as Ho}from"./sum-CaheswU8.js";import{_ as ec,a as tc,V as nc}from"./ViewerRoot-CP_Nfvq1.js";import{c as Il}from"./copyToClipboard-B2D38vJK.js";import{Q as lc}from"./qrcode.vue.esm-D96eyYLH.js";import"./DebouncedInput-DAWO1d_E.js";import"./useTransparentBody-N0LYTq9D.js";import"./vendor-diagnostics-BpSKGMaQ.js";import"./vendor-firebase-Qj1NtgVp.js";import"./index-D_xhMClR.js";import"./FullLogo-E04y1WyN.js";import"./ViewerProgressBar-DuzQMwLt.js";const sc="/spa-assets/cross-white.svg";function nr(e){const l=O(()=>e.value[0]),s=O(()=>e.value[1]),t=O(()=>e.value[0]*2),a=O(()=>e.value[1]*2),o=O(()=>100/t.value),i=O(()=>100/a.value),r=O(()=>100/l.value),p=O(()=>100/s.value),d=O(()=>{const b=[];for(let c=1;c<l.value;c++)for(let w=1;w<s.value;w++)b.push({id:`${c}-${w}`,x:c/l.value*100,y:w/s.value*100});return b});function f(b,c){return Math.round(b/c)*c}function u(b){return b/100}function m(b){return Math.round(b*100)}return{columns:t,rows:a,gridCellWidth:o,gridCellHeight:i,originalGridCellWidth:r,originalGridCellHeight:p,gridIntersections:d,snapToGri
12d:f,toPct:u,fromPct:m}}const Hn={[be.TIMER]:{name:"Timer",description:"Countdown timer display",minDimensions:{w:4,h:2},defaultDimensions:{w:12,h:4}},[be.PROGRESS_BAR]:{name:"Progress Bar",description:"Visual progress bar indicator for the current timer",minDimensions:{w:4,h:1},defaultDimensions:{w:16,h:2}},[be.PROGRESS_RING]:{name:"Progress Ring",description:"Visual progress ring indicator for the current timer",minDimensions:{w:4,h:4},defaultDimensions:{w:6,h:6}},[be.TIME_OF_DAY]:{name:"Time of Day (Clock)",description:"Real-time clock display",minDimensions:{w:4,h:1},defaultDimensions:{w:12,h:3}},[be.MESSAGE]:{name:"Message",description:"Live message that auto-resizes to fill container",minDimensions:{w:4,h:2},defaultDimensions:{w:16,h:8}},[be.TIMER_MESSAGE_COMBO]:{name:"Timer/Message Combo",description:"Combined timer and message display in one element",minDimensions:{w:6,h:4},defaultDimensions:{w:18,h:12}},[be.TEXT]:{name:"Text",description:"Static text content with customizable styling",minDimensions:{w:4,h:1},defaultDimensions:{w:20,h:3}},[be.IMAGE]:{name:"Image",description:"Static image component",minDimensions:{w:2,h:2},defaultDimensions:{w:8,h:8}},[be.IFRAME]:{name:"Website (iFrame)",description:"Embed external websites and web content",minDimensions:{w:10,h:6},defaultDimensions:{w:16,h:12}},[be.TRANSPORT_CONTROL]:{name:"Transport Control",description:"Interactive timer controls",minDimensions:{w:20,h:3},defaultDimensions:{w:26,h:6}},[be.MODERATOR]:{name:"Message Moderator",description:"Interactive message control interface for managing and displaying messages",minDimensions:{w:12,h:8},defaultDimensions:{w:24,h:12}},[be.AGENDA]:{name:"Agenda",description:"Event schedule overview",minDimensions:{w:12,h:8},defaultDimensions:{w:24,h:12}},[be.ON_AIR]:{name:"On Air Indicator",description:"Visual indicator showing when timer is running",minDimensions:{w:1,h:1},defaultDimensions:{w:6,h:2}},[be.QR_CODE]:{name:"QR Code",description:"Generate QR codes for URLs and information",minDimensions:{w:3,h:3},defaultDimensions:{w:10,h:10}}};function lr(e){var l;return(l=Hn[e])==null?void 0:l.name}function oc(e){var l,s;return(s=(l=Hn[e])==null?void 0:l.minDimensions)!=null?s:{w:6,h:4}}function ac(e){var l,s,t,a;return(a=(t=(l=Hn[e])==null?void 0:l.defaultDimensions)!=null?t:(s=Hn[e])==null?void 0:s.minDimensions)!=null?a:{w:8,h:5}}const ic={class:"absolute z-0 inset-0 pointer-events-none select-none"},rc={class:"absolute z-0 inset-0 pointer-events-none select-none"},uc={class:"absolute -top-1 -bottom-1 w-[2px] bg-blue-400",style:{left:"calc(50% - 1px)"}},dc={class:"absolute -left-1 -right-1 h-[2px] bg-blue-400",style:{to
12p:"calc(50% - 1px)"}},cc=["onPointerdown","onClick"],Vo=1,mc={__name:"OutputEditorGrid",props:{elements:{type:Array,default:()=>[]},selectedId:{type:String,default:null},hoveredId:{type:String,default:null},settings:{type:Object,required:!0},dimensions:{type:Array,default:()=>[32,18]},showBlackoutPreview:Boolean},emits:["update:element","update:selectedId"],setup(e,{emit:l}){const s=F(),t=F(!1),a=F(null),o=F({x:0,y:0}),i=F({x:0,y:0,w:0,h:0}),r=F({x:0,y:0,w:0,h:0}),p=O(()=>c.elements.slice().reverse()),d=F(!1),f=F(!1),u=F(!1),m=O(()=>c.elements.find(H=>H._id===c.selectedId)),b=l,c=e,{gridCellWidth:w,gridCellHeight:h,gridIntersections:y,snapToGrid:S,toPct:D,fromPct:k}=nr(du(()=>c.dimensions));function M(H){return{left:`${D(H.x)}%`,top:`${D(H.y)}%`,width:`${D(H.w)}%`,height:`${D(H.h)}%`}}function I(H,G,ne,V){const X=H+ne/2,ae=G+V/2,Se=50,W=50,B=Math.abs(X-Se)<=Vo,ie=Math.abs(ae-W)<=Vo;return{isVerticalCentered:B,isHorizontalCentered:ie}}function R(H){a.value=H,T(i,H),T(r,H)}function T(H,{x:G,y:ne,w:V,h:X}){H.value.x=D(G),H.value.y=D(ne),H.value.w=D(V),H.value.h=D(X)}function C(H){const G=["INPUT","TEXTAREA","BUTTON","SELECT"],ne=["btn-ctrl","input-ctrl"];let V=H;for(;V&&V!==s.value;){if(G.includes(V.tagName)||ne.some(X=>{var ae;return(ae=V.classList)==null?void 0:ae.contains(X)})||V.hasAttribute("contenteditable"))return!0;V=V.parentElement}return!1}function E(H,G){t.value||C(H.target)||(b("update:selectedId",G._id),R(G),o.value={x:H.clientX,y:H.clientY},H.target.setPointerCapture(H.pointerId),H.preventDefault())}function _(H,G){b("update:selectedId",G._id),R(G),t.value=!0,o.value={x:H.clientX,y:H.clientY},H.target.setPointerCapture(H.pointerId),H.preventDefault()}function P(H,G){t.value||(b("update:selectedId",G._id),H.stopPropagation())}function A(H){H.target===s.value&&b("update:selectedId",null)}function z(H){if(!a.value)return;u.value=!0;const G=s.value;if(!G)return;const ne=G.getBoundingClientRect(),V=H.clientX-o.value.x,X=H.clientY-o.value.y,ae=V/ne.width*100,Se=X/ne.height*100;let W,B,ie,xe;if(t.value){ie=i.value.w+ae,xe=i.value.h+Se;const{w:Ql,h:Jl}=oc(a.value.type),es=Math.max(Ql*w.value,.5*w.value),ts=Math.max(Jl*h.value,.5*h.value);ie=Math.max(es,S(ie,w.value)),xe=Math.max(ts,S(xe,h.value)),ie=Math.min(ie,100-i.value.x),xe=Math.min(xe,100-i.value.y),W=i.value.x,B=i.value.y}else W=i.value.x+ae,B=i.value.y+Se,W=S(W,w.value),B=S(B,h.value),W=Math.max(0,Math.min(W,100-i.value.w)),B=Math.max(0,Math.min(B,100-i.value.h)),ie=i.value.w,xe=i.value.h;const we={x:k(r.value.x),y:k(r.value.y),w:k(r.value.w),h:k(r.value.h)},Ae={x:k(W),y:k(B),w:k(ie),h:k(xe)},fe=({x:Ql,y:Jl,w:es,h:ts})=>[Ql,Jl,es,ts].join("-"),te=fe(we)===fe(Ae),{isVerticalCentered:We,isHorizontalCentered:ye}=I(W,B,ie,xe);d.value=We&&!t.value,f.value=ye&&!t.value,te||(T(r,Ae),b("update:element",Q(Q({},a.value),Ae)))}function K(H){a.value&&H.target.releasePointerCapture&&H.target.releasePointerCapture(H.pointerId),a.value=null,t.value=!1,d.value=!1,f.value=!1,u.value=!1}return(H,G)=>(x(),$("div",{class:"relative w-full h-full overflow-hidden p-[2px] rounded border border-neutral-700 bg-neutral-900",style:$e(g(hi)(c.settings.background,{editMode:!0}))},[n("div",{ref_key:"containerRef",ref:s,class:"relative w-full h-full",onPointermove:z,onPointerup:K,onPointercancel:K,onPointerleave:K,onClick:A},[n("div",ic,[(x(!0),$(ee,null,ge(g(y),ne=>(x(),$("img",{key:ne.id,src:sc,class:"absolute opacity-30",style:$e({left:`calc(${ne.x}% - 1%)`,top:`calc(${ne.y}% - 1%)`,width:"2%",height:"2%"})},null,4))),128))]),n("div",rc,[me(n("div",uc,null,512),[[An,d.value]]),me(n("div",dc,null,512),[[An,f.value]])]),(x(!0),$(ee,null,ge(p.value,(ne,V)=>(x(),$("div",{key:ne._id,class:j(["group absolute rounded-sm select-none transition-[ring-color,ring-width] hover:ring-2 hover:ring-blue-400 hover:bg-black/25 overflow-hidden",{"curs
12or-move":!t.value,"ring-2 !ring-blue-500 !bg-black/40":e.hoveredId===ne._id&&e.selectedId!==ne._id&&!u.value,hidden:e.showBlackoutPreview&&g(gu)(c.settings.blackout,c.settings.background)}]),style:$e(re(Q({},M(ne)),{"z-index":V+1})),onPointerdown:X=>E(X,ne),onClick:X=>P(X,ne)},[v(hu,{element:ne,"element-idx":p.value.length-1-V},null,8,["element","element-idx"])],46,cc))),128)),m.value?(x(),$("div",{key:0,class:j(["absolute rounded-sm select-none ring-2 ring-blue-400 pointer-events-none transition-colors duration-150",{"bg-black/40":u.value}]),style:$e(re(Q({},M(m.value)),{"z-index":1e3}))},[n("div",{class:"absolute z-10 bottom-0 right-0 w-4 h-4 text-blue-400 cursor-se-resize pointer-events-auto",onPointerdown:G[0]||(G[0]=Be(ne=>_(ne,m.value),["stop"]))},[...G[1]||(G[1]=[n("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n("rect",{x:"9",y:"5",width:"2",height:"6",rx:"1",fill:"currentcolor"}),n("rect",{x:"11",y:"9",width:"2",height:"6",rx:"1",transform:"rotate(90 11 9)",fill:"currentcolor"})],-1)])],32)],6)):N("",!0)],544),e.showBlackoutPreview?(x(),Z(xu,{key:0,settings:c.settings.blackout,"output-background":c.settings.background,"edit-mode":!0},null,8,["settings","output-background"])):N("",!0)],4))}},pc={class:"table-ctrl w-full"},fc={class:"text-sm pl-2"},bc={class:"text-sm pl-2"},vc={class:"text-sm pl-2"},gc={class:"text-sm pl-2"},hc={__name:"OutputSettings",props:{settings:{type:Object,required:!0}},emits:["open:settings"],setup(e,{emit:l}){const s=l,t=e,a=O(()=>{var i,r;return((r=(i=t.settings)==null?void 0:i.typefaces)==null?void 0:r.length)||0});function o(i,r){return wu(i,r,{editMode:!0})}return(i,r)=>(x(),$("div",null,[n("table",pc,[n("tbody",null,[n("tr",null,[r[4]||(r[4]=n("th",null,"Aspect Ratio",-1)),n("td",fc,[n("button",{class:"btn-ctrl h-7 w-36 font-mono",onClick:r[0]||(r[0]=p=>s("open:settings","aspectRatio"))},q(t.settings.aspectRatio.w)+":"+q(t.settings.aspectRatio.h),1)])]),n("tr",null,[r[6]||(r[6]=n("th",null,"Background",-1)),n("td",bc,[n("button",{class:"group flex items-center btn-ctrl p-0 h-7 w-36 overflow-hidden",onClick:r[1]||(r[1]=p=>s("open:settings","background"))},[n("div",{class:"flex-none w-10 h-full bg-neutral-900 border-r border-neutral-600 group-hover:border-neutral-400 transition-colors",style:$e(g(hi)(t.settings.background,{editMode:!0}))},null,4),r[5]||(r[5]=n("span",{class:"text-left px-2"}," Change ",-1))])])]),n("tr",null,[r[8]||(r[8]=n("th",null,"Blackout",-1)),n("td",vc,[n("button",{class:"group flex items-center btn-ctrl p-0 h-7 w-36 overflow-hidden",onClick:r[2]||(r[2]=p=>s("open:settings","blackout"))},[n("div",{class:"flex-none w-10 h-full border-r border-neutral-600 group-hover:border-neutral-400 transition-colors",style:$e(o(t.settings.blackout,t.settings.background))},null,4),r[7]||(r[7]=n("span",{class:"text-left px-2"}," Customize ",-1))])])]),n("tr",null,[r[9]||(r[9]=n("th",null,"Fonts",-1)),n("td",gc,[n("button",{class:"btn-ctrl h-7 w-36",onClick:r[3]||(r[3]=p=>s("open:settings","fonts"))}," Manage Fonts"+q(a.value>0?` (${a.value})`:""),1)])])])])]))}},xc={class:"flex flex-col gap-3 border border-neutral-600 bg-neutral-800 rounded p-3 overflow-y-auto scroll-stable"},wc={class:"flex-none flex items-center gap-2 -mr-1 -mt-1"},yc={class:"flex-1 min-w-0 truncate font-semibold text-neutral-500"},kc={class:"flex-1"},$c={class:"flex-none flex justify-end gap-2"},$n={__name:"AsideFrame",props:{title:{type:String,default:"Edit"},confirmable:Boolean},emits:["close","confirm"],setup(e,{emit:l}){const s=l,t=e;return(a,o)=>{const i=pe("FaIcon");return x(),$("div",xc,[n("div",wc,[n("h3",yc,q(t.title),1),n("button",{class:"flex-none btn-ctrl !border-transparent !bg-transparent text-neutral-500 p-0 h-8 w-8",onClick:o[0]||(o[0]=r=>s("close"))},[v(i,{icon:g(Pl),"fixed-width":""},null,8,["icon"])])]),n("div",kc,[Ke(a.$slots,"default")]),n("div",$c,[a.$slots.footer?Ke(a.$slots,"footer",{key:0}):(x(),$(ee,{key:1},[n("button",{class:"btn-ctrl h-7 py-0 text-sm",onClick:o[1]||(o[1]=r=>s("close"))},q(e.confirmable?"Cancel":"Close"),1),e.confirmable?(x(),$("button",{key:0,class:"btn-ctrl h-7 py-0 text-sm !bg-teal-800 border-teal-600 !text-white",onClick:o[2]||(o[2]=r=>s("confirm"))}," Confirm ")):N("",!0)],64))])])}}},Sc={class:"space-y-2"},Cc={class:"grid grid-cols-2 gap-2"},Mc=["onClick"],Tc={class:"text-white"},zc={class:"space-y-2 mt-6"},Ic={class:"flex items-center gap-3"},Oc={class:"flex-1"},Dc={class:"flex-1"},Ec={key:0,class:"text-xs text-red-400"},Uc={key:1,class:"text-xs text-neutral-500"},Lc={class:"space-y-2 mt-6"},Rc={class:"flex items-start gap-3"},Ac={__name:"AspectRatioAside",props:{aspectRatio:{type:Object,default:()=>({w:16,h:9,enforce:!0})}},emits:["close","update:aspectRatio"],setup(e,{emit:l}){const s=l,t=e,a=[{name:"Widescreen",w:16,h:9},{name:"Phone Landscape",w:800,h:360},{name:"Ultrawide",w:21,h:9},{name:"Phone Protrait",w:360,h:800},{name:"Cinema",w:235,h:100},{name:"Tablet Landscape",w:1024,h:768},{name:"Fullscreen",w:4,h:3},{name:"Tablet Protrait",w:768,h:1024},{name:"Square",w:1,h:1},{name:"Desktop",w:1920,h:1080}],o=F(16),i=F(9),r=F(!0),p=F(!1),d=O(()=>a.find(b=>b.w===o.value&&b.h===i.value)),f=b=>{var c;return((c=d.value)==null?void 0:c.name)===b.name};function u(b){o.value=b.w,i.value=b.h,p.value=!1}De(()=>{var c;const b=t.aspectRatio||{w:16,h:9};o.value=b.w,i.value=b.h,r.value=(c=b.enforce)!=null?c:!0,p.value=!1});function m(){if(o.value<=0||i.value<=0||!Number.isInteger(o.value)||!Number.isInteger(i.value)){p.value=!0;return}s("update:aspectRatio",{w:o.value,h:i.value,enforce:r.value}),s("close")}return(b,c)=>(x(),Z($n,{title:"Select Aspect Ratio",confirmable:"",onClose:c[3]||(c[3]=w=>
12s("close")),onConfirm:m},{default:L(()=>[n("div",Sc,[c[4]||(c[4]=n("h4",{class:"text-sm font-semibold text-neutral-400"},"Presets",-1)),n("div",Cc,[(x(),$(ee,null,ge(a,w=>n("button",{key:w.name,class:j(["btn-ctrl text-xs h-8 text-neutral-600 space-x-1 text-left",{"text-white bg-neutral-600 border-neutral-400 hover:!border-white":f(w)}]),onClick:h=>u(w)},[n("span",Tc,q(w.name),1),n("span",null,q(w.w)+":"+q(w.h),1)],10,Mc)),64))])]),n("div",zc,[c[8]||(c[8]=n("h4",{class:"text-sm font-semibold text-neutral-400"},"Custom",-1)),n("div",Ic,[n("div",Oc,[c[5]||(c[5]=n("label",{class:"block text-xs text-neutral-500 mb-1"},"Width",-1)),me(n("input",{"onUpdate:modelValue":c[0]||(c[0]=w=>o.value=w),type:"number",min:"1",step:"1",class:j(["input-ctrl text-sm h-10 w-full",{"ring-1 ring-red-500":p.value}]),placeholder:"16"},null,2),[[ft,o.value,void 0,{number:!0}]])]),c[7]||(c[7]=n("div",{class:"text-neutral-500 mt-6"},"Ã",-1)),n("div",Dc,[c[6]||(c[6]=n("label",{class:"block text-xs text-neutral-500 mb-1"},"Height",-1)),me(n("input",{"onUpdate:modelValue":c[1]||(c[1]=w=>i.value=w),type:"number",min:"1",step:"1",class:j(["input-ctrl text-sm h-10 w-full",{"ring-1 ring-red-500":p.value}]),placeholder:"9"},null,2),[[ft,i.value,void 0,{number:!0}]])])]),p.value?(x(),$("p",Ec," Please enter positive numbers for both width and height. ")):(x(),$("p",Uc," Enter positive numbers. These define the width-to-height relationship for scaling. "))]),n("div",Lc,[c[10]||(c[10]=n("h4",{class:"text-sm font-semibold text-neutral-400"},"Enforce",-1)),n("div",Rc,[me(n("input",{id:"enforce-aspect-ratio","onUpdate:modelValue":c[2]||(c[2]=w=>r.value=w),type:"checkbox",class:"mt-0.5 w-5 h-5 rounded"},null,512),[[Fl,r.value]]),c[9]||(c[9]=n("div",{class:"flex-1"},[n("label",{for:"enforce-aspect-ratio",class:"text-sm font-medium text-neutral-300 cursor-pointer"}," Enforce aspect ratio on output "),n("p",{class:"text-xs text-neutral-500 mt-1"}," When enabled, the fullscreen output will maintain the exact aspect ratio with letterboxing if needed. Disable this for screens
12with unknown dimensions (smartphones) or older browsers (OBS Studio) that may not handle fixed aspect ratios properly. ")],-1))])])]),_:1}))}},_c=Oe(Ac,[["__scopeId","data-v-763f5123"]]),Fc={class:"space-x-2 whitespace-nowrap"},Bc=["value","disabled","data-label"],Pc=["value","disabled"],he={__name:"InputSelect",props:{modelValue:{type:[String,Number,Boolean],default:void 0},options:{type:Array,default:()=>[]},label:{type:String,default:""},width:{type:String,default:"auto"},size:{type:String,default:"md",validate:e=>["xs","sm","md","lg"].includes(e)},selectClass:{type:[Object,Array,String],default:"py-2"},dataLabel:{type:String,default:void 0},defaultValue:{type:[String,Number,Boolean],default:void 0},disabled:Boolean},emits:["update:modelValue"],setup(e,{emit:l}){const s="a"+Mi(10),t=l,a=e,o=O(()=>a.options.map(f=>f.value)),i=O(()=>o.value.includes(a.modelValue)?p(a.modelValue):o.value.includes(a.defaultValue)?p(a.defaultValue):p(a.modelValue));function r(f){t("update:modelValue",d(f.target.value))}function p(f){return f===null?"__null__":f===void 0?"__undefined__":String(f)}function d(f){if(f==="__null__")return null;if(f!=="__undefined__")return f==="true"?!0:f==="false"?!1:!isNaN(f)&&!isNaN(parseFloat(f))?parseFloat(f):f}return(f,u)=>(x(),$("div",Fc,[a.label?(x(),$("label",{key:0,for:s,class:j({"opacity-50":e.disabled})},q(e.label),3)):N("",!0),n("select",{id:s,value:i.value,class:j(["input-ctrl pr-8 cursor-pointer disabled:text-neutral-500 disabled:cursor-not-allowed",[{"text-xs":e.size==="xs","text-sm":e.size==="sm","text-base":e.size==="md","text-lg":e.size==="lg"},e.selectClass]]),style:$e({width:e.width}),disabled:e.disabled,"data-label":e.dataLabel,onChange:r},[(x(!0),$(ee,null,ge(e.options,m=>(x(),$("option",{key:p(m.value),value:p(m.value),disabled:m.disabled},q(m.label),9,Pc))),128))],46,Bc)]))}};function zn(e,l){let s=e.length,t,a,o=!1,i=!1;Array.isArray(e[0])?t=e:(t=[e],s=t.length,o=!0),Array.isArray(l[0])?a=l:(a=l.length>0?l.map(f=>[f]):[[]],i=!0);let r=a[0].length,p=a[0].map((f,u)=>a.map(m=>m[u])),d=t.map(f=>p.map(u=>{let m=0;if(!Array.isArray(f)){for(let b of u)m+=f*b;return m}for(let b=0;b<f.length;b++)m+=f[b]*(u[b]||0);return m}));return s===1&&o&&(d=d[0]),r===1&&i?s===1&&o?d[0]:d.map(f=>f[0]):d}function ss(e,l){return e[0]*l[0]+e[1]*l[1]+e[2]*l[2]}function Pe(e,l,s=[0,0,0]){const t=ss(e,l[0]),a=ss(e,l[1]),o=ss(e,l[2]);return s[0]=t,s[1]=a,s[2]=o,s}function Sn(e){return Nt(e)==="string"}function Nt(e){return(Object.prototype.toString.call(e).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function xo(e,{precision:l=16,unit:s}){return Ce(e)?"none":(e=+wo(e,l),e+(s!=null?s:""))}function Ce(e){return e===null}function He(e){return Ce(e)?0:e}function wo(e,l){if(e===0)return 0;let s=~~e,t=0;s&&l&&(t=~~Math.log10(Math.abs(s))+1);const a=10**(l-t);return Math.floor(e*a+.5)/a}function Vn(e,l,s){return isNaN(e)?l:isNaN(l)?e:e+(l-e)*s}function sr(e,l,s){return(s-e)/(l-e)}function Vs(e,l,s){return!e||!l||e===l||e[0]===l[0]&&e[1]===l[1]||isNaN(s)||s===null?s:Vn(l[0],l[1],sr(e[0],e[1],s))}function ql(e,l,s){return Math.max(Math.min(s,l),e)}function Wl(e,l){return Math.sign(e)===Math.sign(l)?e:-e}function Ve(e,l){return Wl(Math.abs(e)**l,e)}function yo(e,l){return l===0?0:e/l}function or(e,l,s=0,t=e.length){for(;s<t;){const a=s+t>>1;e[a]<l?s=a+1:t=a}return s}function hn(e,l){var t;if(e instanceof l)return!0;const s=l.name;for(;e;){const a=Object.getPrototypeOf(e),o=(t=a==null?void 0:a.constructor)==null?void 0:t.name;if(o===s)return!0;if(!o||o==="Object")return!1;e=a}return!1}var Nc=Object.freeze({__proto__:null,bisectLeft:or,clamp:ql,copySign:Wl,interpolate:Vn,interpolateInv:sr,isInstance:hn,isNone:Ce,isString:Sn,mapRange:Vs,multiplyMatrices:zn,multiply_v3_m3x3:Pe,serializeNumber:xo,skipNone:He,spow:Ve,toPrecision:wo,type:Nt,zdiv:yo});class Hc{add(l,s,t){if(typeof arguments[0]!="string"){for(var l in arguments[0])this.add(l,arguments[0][l],arguments[1]);return}(Array.isArray(l)?l:[l]).forEach(function(a){this[a]=this[a]||[],s&&this[a][t?"unshift":"push"](s)},this)}run(l,s){this[l]=this[l]||[],this[l].forEach(function(t){t.call(s&&s.context?s.context:s,s)})}}const qt=new Hc;var bt={gamut_mapping:"css",precision:5,deltaE:"76",verbose:"production".toLowerCase()!=="test",warn:function(l){var s,t;this.verbose&&((t=(s=globalThis==null?void 0:globalThis.console)==null?void 0:s.warn)==null||t.call(s,l))}};
12class jo{constructor(l,s){ut(this,"type");ut(this,"coordMeta");ut(this,"coordRange");ut(this,"range");var t;if(typeof l=="object"&&(this.coordMeta=l),s&&(this.coordMeta=s,this.coordRange=(t=s.range)!=null?t:s.refRange),typeof l=="string"){let a=l.trim().match(new RegExp("^(?<type><[a-z]+>)(\\[(?<min>-?[.\\d]+),\\s*(?<max>-?[.\\d]+)\\])?$"));if(!a)throw new TypeError(`Cannot parse ${l} as a type definition.`);this.type=a.groups.type;let{min:o,max:i}=a.groups;(o||i)&&(this.range=[+o,+i])}}get computedRange(){return this.range?this.range:this.type==="<percentage>"?this.percentageRange():this.type==="<angle>"?[0,360]:null}get unit(){return this.type==="<percentage>"?"%":this.type==="<angle>"?"deg":""}resolve(l){if(this.type==="<angle>")return l;let s=this.computedRange,t=this.coordRange;return this.type==="<percentage>"&&(t!=null||(t=this.percentageRange())),Vs(s,t,l)}serialize(l,s){let t=this.type==="<percentage>"?this.percentageRange(100):this.computedRange,a=this.unit;return l=Vs(this.coordRange,t,l),xo(l,{unit:a,precision:s})}toString(){let l=this.type;if(this.range){let[s="",t=""]=this.range;l+=`[${s},${t}]`}return l}percentageRange(l=1){let s;return this.coordMeta&&this.coordMeta.range||this.coordRange&&this.coordRange[0]>=0?s=[0,1]:s=[-1,1],[s[0]*l,s[1]*l]}static get(l,s){return hn(l,this)?l:new this(l,s)}}const os=Symbol("instance");class Ol{constructor(l,s=l.space){ut(this,"type");ut(this,"name");ut(this,"spaceCoords");ut(this,"coords");ut(this,"id");ut(this,"alpha");l[os]=this,this.type="function",this.name="color",Object.assign(this,l),this.space=s,this.type!=="custom"&&(this.spaceCoords=Object.values(s.coords),this.coords||(this.coords=this.spaceCoords.map(t=>{let a=["<number>","<percentage>"];return t.type==="angle"&&a.push("<angle>"),a})),this.coords=this.coords.map((t,a)=>{let o=this.spaceCoords[a];return typeof t=="string"&&(t=t.trim().split(/\s*\|\s*/)),t.map(i=>jo.get(i,o))}))}serializeCoords(l,s,t){return t=l.map((a,o)=>{var i;return jo.get((i=t==null?void 0:t[o])!=null?i:this.coords[o][0],this.spaceCoords[o])}),l.map((a,o)=>t[o].serialize(a,s))}coerceCoords(l,s){return Object.entries(this.space.coords).map(([t,a],o)=>{var d;let i=l[o];if(Ce(i)||isNaN(i))return i;let r=s[o],p=this.coords[o].find(f=>f.type==r);if(!p){let f=a.name||t;throw new TypeError(`${(d=r!=null?r:i==null?void 0:i.raw)!=null?d:i} not allowed for ${f} in ${this.name}()`)}return i=p.resolve(i),p.range&&(s[o]=p.toString()),i})}canSerialize(){return this.type==="function"||this.serialize}parse(l){return null}static get(l,...s){return!l||hn(l,this)?l:l[os]?l[os]:new Ol(l,...s)}}const at={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function js(e){return Array.isArray(e)?e:at[e]}function Dl(e,l,s,t={}){if(e=js(e),l=js(l),!e||!l)throw new TypeError(`Missing white point to convert ${e?"":"from"}${!e&&!l?"/":""}${l?"":"to"}`);if(e===l)return s;let a={W1:e,W2:l,XYZ:s,options:t};if(qt.run("chromatic-adaptation-start",a),a.M||(a.W1===at.D65&&a.W2===at.D50?a.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:a.W1===at.D50&&a.W2===at.D65&&(a.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),qt.run("chromatic-adaptation-end",a),a.M)return Pe(a.XYZ,a.M);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}function ar(e,l){var o,i,r,p;let s={str:(o=String(e))==null?void 0:o.trim(),options:l};if(qt.run("parse-start",s),s.color)return s.color;s.parsed=jc(s.str);let t,a=s.options?(i=s.options.parseMeta)!=null?i:s.options.meta:null;if(s.parsed){let d=s.parsed.name,f,u,m=s.parsed.args,b=m.map((h,y)=>{var S;return(S=s.parsed.argMeta[y])==null?void 0:S.type});if(d==="color"){let h=m.shift();b.shift();let y=h.startsWith("--")?h.substring(2):`--${h}`,S=[h,y];if(f=oe.findFormat({name:d,id:S,type:"function"}),!f){let D,k=h in oe.registry?h:y;
12if(k in oe.registry){let M=(p=(r=oe.registry[k].formats)==null?void 0:r.color)==null?void 0:p.id;M&&(D=`Did you mean ${e.replace("color("+h,"color("+M)}?`)}throw new TypeError(`Cannot parse ${s.str}. `+(D!=null?D:"Missing a plugin?"))}u=f.space,f.id.startsWith("--")&&!h.startsWith("--")&&bt.warn(`${u.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${f.id}) instead of color(${h}).`),h.startsWith("--")&&!f.id.startsWith("--")&&bt.warn(`${u.name} is a standard space and supported in the CSS spec. Use color(${f.id}) instead of prefixed color(${h}).`)}else f=oe.findFormat({name:d,type:"function"}),u=f.space;a&&Object.assign(a,{format:f,formatId:f.name,types:b,commas:s.parsed.commas});let c=1;s.parsed.lastAlpha&&(c=s.parsed.args.pop(),a&&(a.alphaType=b.pop()));let w=f.coords.length;if(m.length!==w)throw new TypeError(`Expected ${w} coordinates for ${u.id} in ${s.str}), got ${m.length}`);m=f.coerceCoords(m,b),t={spaceId:u.id,coords:m,alpha:c}}else e:for(let d of oe.all)for(let f in d.formats){let u=d.formats[f];if(u.type!=="custom"||u.test&&!u.test(s.str))continue;let m=d.getFormat(u),b=m.parse(s.str);if(b){a&&Object.assign(a,{format:m,formatId:f}),t=b;break e}}if(!t)throw new TypeError(`Could not parse ${e} as a color. Missing a plugin?`);return t.alpha=Ce(t.alpha)?t.alpha:t.alpha===void 0?1:ql(0,t.alpha,1),t}const ir={"%":.01,deg:1,grad:.9,rad:180/Math.PI,turn:360},El={function:/^([a-z]+)\(((?:calc\(NaN\)|.)+?)\)$/i,number:/^([-+]?(?:[0-9]*\.)?[0-9]+(e[-+]?[0-9]+)?)$/i,unitValue:RegExp(`(${Object.keys(ir).join("|")})$`),singleArgument:/\/?\s*(none|NaN|calc\(NaN\)|[-+\w.]+(?:%|deg|g?rad|turn)?)/g};function Vc(e){var a;let l={},s=(a=e.match(El.unitValue))==null?void 0:a[0],t=l.raw=e;return s?(l.type=s==="%"?"<percentage>":"<angle>",l.unit=s,l.unitless=Number(t.slice(0,-s.length)),t=l.unitless*ir[s]):El.number.test(t)?(t=Number(t),l.type="<number>"):t==="none"?t=null:t==="NaN"||t==="calc(NaN)"?(t=NaN,l.type="<number>"):l.type="<ident>",{value:t,meta:l}}function jc(e){if(!e)return;e=e.trim();let l=e.match(El.function);if(l){let s=[],t=[],a=!1,o=l[1].toLowerCase(),i=l[2].replace(El.singleArgument,(r,p)=>{let{value:d,meta:f}=Vc(p);return(r.startsWith("/")||o!=="color"&&s.length===3)&&(a=!0),s.push(d),t.push(f),""});return{name:o,args:s,argMeta:t,lastAlpha:a,commas:i.includes(","),rawName:l[1],rawArgs:l[2]}}}function ve(e,l){if(Array.isArray(e))return e.map(t=>ve(t,l));if(!e)throw new TypeError("Empty color reference");Sn(e)&&(e=ar(e,l));let s=e.space||e.spaceId;return typeof s=="string"&&(e.space=oe.get(s)),e.alpha===void 0&&(e.alpha=1),e}const qc=75e-6,it=class it{constructor(l){var a,o,i,r,p,d;this.id=l.id,this.name=l.name,this.base=l.base?it.get(l.base):null,this.aliases=l.aliases,this.base&&(this.fromBase=l.fromBase,this.toBase=l.toBase);let s=(a=l.coords)!=null?a:this.base.coords;for(let f in s)"name"in s[f]||(s[f].name=f);this.coords=s;let t=(i=(o=l.white)!=null?o:this.base.white)!=null?i:"D65";this.white=js(t),this.formats=(r=l.formats)!=null?r:{};for(let f in this.formats){let u=this.formats[f];u.type||(u.type="function"),u.name||(u.name=f)}(p=this.formats.color)!=null&&p.id||(this.formats.color=re(Q({},(d=this.formats.color)!=null?d:{}),{id:l.cssId||this.id})),l.gamutSpace?this.gamutSpace=l.gamutSpace==="self"?this:it.get(l.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(f,u)=>!0),this.referred=l.referred,Object.defineProperty(this,"path",{value:Wc(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),qt.run("colorspace-init-end",this)}inGamut(l,{epsilon:s=qc}={}){if(!this.equals(this.gamutSpace))return l=this.to(this.gamutSpace,l),this.gamutSpace.inGamut(l,{epsilon:s});let t=Object.values(this.coords);return l.every((a,o)=>{let i=t[o];if(i.type!=="angle"&&i.range){if(Ce(a))return!0;let[r,p]=i.range;return(r===void 0||a>=r-s)&&(p===void 0||a<=p+s)}return!0})}get isUnbounded(){return Object.values(this.coords).every(l=>!("range"in l))}get cssId(){var l,s;return((s=(l=this.formats)==null?void 0:l.color)==null?void 0:s.id)||this.id}get isPolar(){for(let l in this.coords)if(this.coords[l].type==="angle")return!0;return!1}getFormat(l){if(!l)return null;l==="default"?l=Object.values(this.formats)[0]:typeof l=="string"&&(l=this.formats[l]);let s=Ol.get(l,this);return s!==l&&l.name in this.formats&&(this.formats[l.name]=s),s}equals(l){return l?this===l||this.id===l||this.id===l.id:!1}to(l,s){if(arguments.length===1){const r=ve(l);[l,s]=[r.space,r.coords]}if(l=it.get(l),this.equals(l))return s;s=s.map(r=>Ce(r)?0:r);let t=this.path,a=l.path,o,i;for(let r=0;r<t.length&&t[r].equals(a[r]);r++)o=t[r],i=r;if(!o)throw new Error(`Cannot convert between color spaces ${this} and ${l}: no connection space was found`);for(let r=t.length-1;r>i;r--)s=t[r].toBase(s);for(let r=i+1;r<a.length;r++)s=a[r].fromBase(s);return s}from(l,s){if(arguments.length===1){const t=ve(l);[l,s]=[t.space,t.coords]}return l=it.get(l),l.to(this,s)}toString(){return`${this.name} (${this.id})`}getMinCoords(){var s;let l=[];for(let t in this.coords){let a=this.coords[t],o=a.range||a.refRange;l.push((s=o==null?void 0:o.min)!=null?s:0)}return l}static get all(){return[...new Set(Object.values(it.registry))]}static register(l,s){if(arguments.length===1&&(s=arguments[0],l=s.id),s=this.get(s),this.registry[l]&&this.registry[l]!==s)throw new Error(`Duplicate color space registration: '${l}'`);if(this.registry[l]=s,arguments.length===1&&s.aliases)for(let t of s.aliases)this.register(t,s);return s}static get(l,...s){if(!l||hn(l,this))return l;if(Nt(l)==="string"){let a=it.registry[l.toLowerCase()];if(!a)throw new TypeError(`No color space found with id = "${l}"`);return a}if(s.length)return it.get(...s);throw new TypeError(`${l} is not a valid color space`)}static findFormat(l,s=it.all){var t,a;if(!l)return null;typeof l=="string"&&(l={name:l});for(let o of s)for(let[i,r]of Object.entries(o.formats)){(t=r.name)!=null||(r.name=i),(a=r.type)!=null||(r.type="function");let p=(!l.name||r.name===l.name)&&(!l.type||r.type===l.type);if(l.id){let d=r.ids||[r.id],f=Array.isArray(l.id)?l.id:[l.id];p&&(p=f.some(u=>d.includes(u)))}if(p){let d=Ol.get(r,o);return d!==r&&(o.formats[r.name]=d),d}}return null}
12static resolveCoord(l,s){var p;let t=Nt(l),a,o;if(t==="string"?l.includes(".")?[a,o]=l.split("."):[a,o]=[,l]:Array.isArray(l)?[a,o]=l:(a=l.space,o=l.coordId),a=it.get(a),a||(a=s),!a)throw new TypeError(`Cannot resolve coordinate reference ${l}: No color space specified and relative references are not allowed here`);if(t=Nt(o),t==="number"||t==="string"&&o>=0){let d=Object.entries(a.coords)[o];if(d)return Q({space:a,id:d[0],index:o},d[1])}a=it.get(a);let i=o.toLowerCase(),r=0;for(let d in a.coords){let f=a.coords[d];if(d.toLowerCase()===i||((p=f.name)==null?void 0:p.toLowerCase())===i)return Q({space:a,id:d,index:r},f);r++}throw new TypeError(`No "${o}" coordinate found in ${a.name}. Its coordinates are: ${Object.keys(a.coords).join(", ")}`)}};ut(it,"registry",{}),ut(it,"DEFAULT_FORMAT",{type:"functions",name:"color"});let oe=it;function Wc(e){let l=[e];for(let s=e;s=s.base;)l.push(s);return l}var Ze=new oe({id:"xyz-d65",name:"XYZ D65",coords:{x:{refRange:[0,1],name:"X"},y:{refRange:[0,1],name:"Y"},z:{refRange:[0,1],name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});class Je extends oe{constructor(l){var s,t,a;l.coords||(l.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),l.base||(l.base=Ze),l.toXYZ_M&&l.fromXYZ_M&&((s=l.toBase)!=null||(l.toBase=o=>{let i=Pe(o,l.toXYZ_M);return this.white!==this.base.white&&(i=Dl(this.white,this.base.white,i)),i}),(t=l.fromBase)!=null||(l.fromBase=o=>(o=Dl(this.base.white,this.white,o),Pe(o,l.fromXYZ_M)))),(a=l.referred)!=null||(l.referred="display"),super(l)}}function rr(e,l={}){if(Array.isArray(e))return e.map(d=>rr(d,l));let p=l,{cssProperty:s="background-color",element:t}=p,a=an(p,["cssProperty","element"]),o=null;try{return ve(e,a)}catch(d){o=d}let{CSS:i,getComputedStyle:r}=globalThis;if(Sn(e)&&t&&i&&r&&i.supports(s,e)){let d=t.style[s];e!==d&&(t.style[s]=e);let f=r(t).getPropertyValue(s);if(e!==d&&(t.style[s]=d),f!==e)try{return ve(f,a)}catch(u){o=u}else o={message:"Color value is a valid CSS color, but it could not be resolved :("}}return l.errorMeta&&(l.errorMeta.error=o),null}function Qn(e,l){e=ve(e);let s=oe.get(l,l==null?void 0:l.space),t=l==null?void 0:l.precision,a;return!s||e.space.equals(s)?a=e.coords.slice():a=s.from(e),t===void 0?a:a.map(o=>wo(o,t))}function ct(e,l){var o;if(e=ve(e),l==="alpha")return(o=e.alpha)!=null?o:1;let{space:s,index:t}=oe.resolveCoord(l,e.space);return Qn(e,s)[t]}function ko(e,l,s,t){return e=ve(e),Array.isArray(l)&&([l,s,t]=[e.space,l,s]),l=oe.get(l),e.coords=l===e.space?s.slice():l.to(e.space,s),t!==void 0&&(e.alpha=t),e}ko.returns="color";function Ft(e,l,s){if(e=ve(e),arguments.length===2&&Nt(arguments[1])==="object"){let t=arguments[1];for(let a in t)Ft(e,a,t[a])}else if(typeof s=="function"&&(s=s(ct(e,l))),l==="alpha")e.alpha=s;else{let{space:t,index:a}=oe.resolveCoord(l,e.space),o=Qn(e,t);o[a]=s,ko(e,t,o)}return e}Ft.returns="color";var $o=new oe({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Ze,fromBase:e=>Dl(Ze.white,"D50",e),toBase:e=>Dl("D50",Ze.white,e)});const Gc=216/24389,qo=24/116,sl=24389/27;let as=at.D50;var mt=new oe({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:as,base:$o,fromBase(e){let s=e.map((i,r)=>i/as[r]).map(i=>i>Gc?Math.cbrt(i):(sl*i+16)/116),t=116*s[1]-16,a=500*(s[0]-s[1]),o=200*(s[1]-s[2]);return[t,a,o]},toBase(e){let[l,s,t]=e,a=[];return a[1]=(l+16)/116,a[0]=s/500+a[1],a[2]=a[1]-t/200,[a[0]>qo?Math.pow(a[0],3):(116*a[0]-16)/sl,e[0]>8?Math.pow((e[0]+16)/116,3):e[0]/sl,a[2]>qo?Math.pow(a[2],3):(116*a[2]-16)/sl].map((i,r)=>i*as[r])},formats:{lab:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});function xt(e){return typeof e!="number"?e:(e%360+360)%360}function ur(e,l){let[s,t]=l,a=Ce(s),o=Ce(t);if(a&&o)return[s,t];if(a?s=t:o&&(t=s),e==="raw")return l;s=xt(s),t=xt(t);let i=t-s;return e==="increasing"?i<0&&(t+=360):e==="decreasing"?i>0&&(s+=360):e==="longer"?-180<i&&i<180&&(i>0?s+=360:t+=360):e==="shorter"&&(i>180?s+=360:i<-180&&(t+=360)),[s,t]}var vt=new oe({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:mt,fromBase(e){if(this.ε===void 0){let r=Object.values(this.base.coords)[1].refRange,p=r[1]-r[0];this.ε=p/1e5}let[l,s,t]=e,a=Math.abs(s)<this.ε&&Math.abs(t)<this.ε,o=a?null:xt(Math.atan2(t,s)*180/Math.PI),i=a?0:Math.sqrt(s**2+t**2);return[l,i,o]},toBase(e){let[l,s,t]=e,a=null,o=null;return Ce(t)||(s=s<0?0:s,a=s*Math.cos(t*Math.PI/180),o=s*Math.sin(t*Math.PI/180)
12),[l,a,o]},formats:{lch:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}});const Wo=25**7,Ul=Math.PI,Go=180/Ul,un=Ul/180;function Xo(e){const l=e*e;return l*l*l*e}function dr(e,l,{kL:s=1,kC:t=1,kH:a=1}={}){[e,l]=ve([e,l]);let[o,i,r]=mt.from(e),p=vt.from(mt,[o,i,r])[1],[d,f,u]=mt.from(l),m=vt.from(mt,[d,f,u])[1];p<0&&(p=0),m<0&&(m=0);let b=(p+m)/2,c=Xo(b),w=.5*(1-Math.sqrt(c/(c+Wo))),h=(1+w)*i,y=(1+w)*f,S=Math.sqrt(h**2+r**2),D=Math.sqrt(y**2+u**2),k=h===0&&r===0?0:Math.atan2(r,h),M=y===0&&u===0?0:Math.atan2(u,y);k<0&&(k+=2*Ul),M<0&&(M+=2*Ul),k*=Go,M*=Go;let I=d-o,R=D-S,T=M-k,C=k+M,E=Math.abs(T),_;S*D===0?_=0:E<=180?_=T:T>180?_=T-360:T<-180?_=T+360:bt.warn("the unthinkable has happened");let P=2*Math.sqrt(D*S)*Math.sin(_*un/2),A=(o+d)/2,z=(S+D)/2,K=Xo(z),H;S*D===0?H=C:E<=180?H=C/2:C<360?H=(C+360)/2:H=(C-360)/2;let G=(A-50)**2,ne=1+.015*G/Math.sqrt(20+G),V=1+.045*z,X=1;X-=.17*Math.cos((H-30)*un),X+=.24*Math.cos(2*H*un),X+=.32*Math.cos((3*H+6)*un),X-=.2*Math.cos((4*H-63)*un);let ae=1+.015*z*X,Se=30*Math.exp(-1*((H-275)/25)**2),W=2*Math.sqrt(K/(K+Wo)),B=-1*Math.sin(2*Se*un)*W,ie=(I/(s*ne))**2;return ie+=(R/(t*V))**2,ie+=(P/(a*ae))**2,ie+=B*(R/(t*V))*(P/(a*ae)),Math.sqrt(ie)}const Xc=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],Yc=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],Kc=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],Ht=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]];var St=new oe({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Ze,fromBase(e){let l=Pe(e,Xc);return l[0]=Math.cbrt(l[0]),l[1]=Math.cbrt(l[1]),l[2]=Math.cbrt(l[2]),Pe(l,Kc,l)},toBase(e){let l=Pe(e,Ht);return l[0]=l[0]**3,l[1]=l[1]**3,l[2]=l[2]**3,Pe(l,Yc,l)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});function qs(e,l){[e,l]=ve([e,l]);let[s,t,a]=St.from(e),[o,i,r]=St.from(l),p=s-o,d=t-i,f=a-r;return Math.sqrt(p**2+d**2+f**2)}const Zc=75e-6;function Qt(e,l,{epsilon:s=Zc}={}){e=ve(e),l||(l=e.space),l=oe.get(l);let t=e.coords;return l!==e.space&&(t=l.from(e)),l.inGamut(t,{epsilon:s})}function xn(e){return{space:e.space,coords:e.coords.slice(),alpha:e.alpha}}function cr(e,l,s="lab"){s=oe.get(s);let t=s.from(e),a=s.from(l);return Math.sqrt(t.reduce((o,i,r)=>{let p=a[r];return Ce(i)||Ce(p)?o:o+(p-i)**2},0))}function Qc(e,l){return cr(e,l,"lab")}const Jc=Math.PI,Yo=Jc/180;function em(e,l,{l:s=2,c:t=1}={}){[e,l]=ve([e,l]);let[a,o,i]=mt.from(e),[,r,p]=vt.from(mt,[a,o,i]),[d,f,u]=mt.from(l),m=vt.from(mt,[d,f,u])[1];r<0&&(r=0),m<0&&(m=0);let b=a-d,c=r-m,w=o-f,h=i-u,y=w**2+h**2-c**2,S=.511;a>=16&&(S=.040975*a/(1+.01765*a));let D=.0638*r/(1+.0131*r)+.638,k;Ce(p)&&(p=0),p>=164&&p<=345?k=.56+Math.abs(.2*Math.cos((p+168)*Yo)):k=.36+Math.abs(.4*Math.cos((p+35)*Yo));let M=Math.pow(r,4),I=Math.sqrt(M/(M+1900)),R=D*(I*k+1-I),T=(b/(s*S))**2;return T+=(c/(t*D))**2,T+=y/R**2,Math.sqrt(T)}const Ko=203;var So=new oe({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:Ze,fromBase(e){return e.map(l=>l*Ko)},toBase(e){return e.map(l=>l/Ko)}});const ol=1.15,al=.66,Zo=2610/2**14,tm=2**14/2610,Qo=3424/2**12,Jo=2413/2**7,ea=2392/2**7,nm=1.7*2523/2**5,ta=2**5/(1.7*2523),il=-.56,is=16295499532821565e-27,lm=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],sm=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],om=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],am=[[1,.13860504327153927,.05804731615611883],[1,-.1386050432715393,-.058047316156118904],[1,-.09601924202631895,-.811891896056039]];var mr=new oe({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.21,.21]},bz:{refRange:[-.21,.21]}},base:So,fromBase(e){let[l,s,t]=e,a=ol*l-(ol-1)*t,o=al*s-(al-1)*l,r=Pe([a,o,t],lm).map(function(m){let b=Qo+Jo*Ve(m/1e4,Zo),c=1+ea*Ve(m/1e4,Zo);return Ve(b/c,nm)}),[p,d,f]=Pe(r,om);return[(1+il)*p/(1+il*p)-is,d,f]},toBase(e){let[l,s,t]=e,a=(l+is)/(1+il-il*(l+is)),i=Pe([a,s,t],am).map(function(m){let b=Qo-Ve(m,ta),c=ea*Ve(m,ta)-Jo;return 1e4*Ve(b/c,tm)}),[r,p,d]=Pe(i,sm),f=(r+(ol-1)*d)/ol,u=(p+(al-1)*f)/al;return[f,u,d]},formats:{jzazbz:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}}),Ws=new oe({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,.26],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:mr,fromBase:vt.fromBase,toBase:vt.toBase,formats:{jzczhz:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}});function im(e,l){[e,l]=ve([e,l]);let[s,t,a]=Ws.from(e),[o,i,r]=Ws.from(l),p=s-o,d=t-i;Ce(a)&&Ce(r)?(a=0,r=0):Ce(a)?a=r:Ce(r)&&(r=a);
12let f=a-r,u=2*Math.sqrt(t*i)*Math.sin(f/2*(Math.PI/180));return Math.sqrt(p**2+d**2+u**2)}const pr=3424/4096,fr=2413/128,br=2392/128,na=2610/16384,rm=2523/32,um=16384/2610,la=32/2523,dm=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],cm=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],mm=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],pm=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]];var Gs=new oe({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:So,fromBase(e){let l=Pe(e,dm);return fm(l)},toBase(e){let l=bm(e);return Pe(l,pm)},formats:{ictcp:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});function fm(e){let l=e.map(function(s){let t=pr+fr*(s/1e4)**na,a=1+br*(s/1e4)**na;return(t/a)**rm});return Pe(l,cm)}function bm(e){return Pe(e,mm).map(function(t){let a=Math.max(t**la-pr,0),o=fr-br*t**la;return 1e4*(a/o)**um})}function vm(e,l){[e,l]=ve([e,l]);let[s,t,a]=Gs.from(e),[o,i,r]=Gs.from(l);return 720*Math.sqrt((s-o)**2+.25*(t-i)**2+(a-r)**2)}function gm(e,l){[e,l]=ve([e,l]);let s=2,[t,a,o]=St.from(e),[i,r,p]=St.from(l),d=t-i,f=s*(a-r),u=s*(o-p);return Math.sqrt(d**2+f**2+u**2)}const hm=at.D65,vr=.42,sa=1/vr,rs=2*Math.PI,gr=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],xm=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],wm=[[460,451,288],[460,-891,-261],[460,-220,-6300]],ym={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},Yt={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},km=180/Math.PI,oa=Math.PI/180;function hr(e,l){return e.map(t=>{const a=Ve(l*Math.abs(t)*.01,vr);return 400*Wl(a,t)/(a+27.13)})}function $m(e,l){const s=100/l*27.13**sa;return e.map(t=>{const a=Math.abs(t);return Wl(s*Ve(a/(400-a),sa),t)})}function Sm(e){let l=xt(e);l<=Yt.h[0]&&(l+=360);const s=or(Yt.h,l)-1,[t,a]=Yt.h.slice(s,s+2),[o,i]=Yt.e.slice(s,s+2),r=Yt.H[s],p=(l-t)/o;return r+100*p/(p+(a-l)/i)}function Cm(e){let l=(e%400+400)%400;const s=Math.floor(.01*l);l=l%100;const[t,a]=Yt.h.slice(s,s+2),[o,i]=Yt.e.slice(s,s+2);return xt((l*(i*t-o*a)-100*t*i)/(l*(i-o)-100*i))}function xr(e,l,s,t,a){const o={};o.discounting=a,o.refWhite=e,o.surround=t;const i=e.map(h=>h*100);o.la=l,o.yb=s;const r=i[1],p=Pe(i,gr);let d=ym[o.surround];const f=d[0];o.c=d[1],o.nc=d[2];const m=(1/(5*o.la+1))**4;o.fl=m*o.la+.1*(1-m)*(1-m)*Math.cbrt(5*o.la),o.flRoot=o.fl**.25,o.n=o.yb/r,o.z=1.48+Math.sqrt(o.n),o.nbb=.725*o.n**-.2,o.ncb=o.nbb;const b=Math.max(Math.min(f*(1-1/3.6*Math.exp((-o.la-42)/92)),1),0);o.dRgb=p.map(h=>Vn(1,r/h,b)),o.dRgbInv=o.dRgb.map(h=>1/h);const c=p.map((h,y)=>h*o.dRgb[y]),w=hr(c,o.fl);return o.aW=o.nbb*(2*w[0]+w[1]+.05*w[2]),o}const aa=xr(hm,64/Math.PI*.2,20,"average",!1);function Xs(e,l){if(!(e.J!==void 0^e.Q!==void 0))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(e.C!==void 0^e.M!==void 0^e.s!==void 0))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(e.h!==void 0^e.H!==void 0))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(e.J===0||e.Q===0)return[0,0,0];let s=0;e.h!==void 0?s=xt(e.h)*oa:s=Cm(e.H)*oa;const t=Math.cos(s),a=Math.sin(s);let o=0;e.J!==void 0?o=Ve(e.J,1/2)*.1:e.Q!==void 0&&(o=.25*l.c*e.Q/((l.aW+4)*l.flRoot));let i=0;e.C!==void 0?i=e.C/o:e.M!==void 0?i=e.M/l.flRoot/o:e.s!==void 0&&(i=4e-4*e.s**2*(l.aW+4)/l.c);const r=Ve(i*Math.pow(1.64-Math.pow(.29,l.n),-.73),10/9),p=.25*(Math.cos(s+2)+3.8),d=l.aW*Ve(o,2/l.c/l.z),f=5e4/13*l.nc*l.ncb*p,u=d/l.nbb,m=23*(u+.305)*yo(r,23*f+r*(11*t+108*a)),b=m*t,c=m*a,w=$m(Pe([u,b,c],wm).map(h=>h*1/1403),l.fl);return Pe(w.map((h,y)=>h*l.dRgbInv[y]),xm).map(h=>h/100)}function wr(e,l){const s=e.map(D=>D*100),t=hr(Pe(s,gr).map((D,k)=>D*l.dRgb[k]),l.fl),a=t[0]+(-12*t[1]+t[2])/11,o=(t[0]+t[1]-2*t[2])/9,i=(Math.atan2(o,a)%rs+rs)%rs,r=.25*(Math.cos(i+2)+3.8),p=5e4/13*l.nc*l.ncb*yo(r*Math.sqrt(a**2+o**2),t[0]+t[1]+1.05*t[2]+.305),d=Ve(p,.9)*
12Math.pow(1.64-Math.pow(.29,l.n),.73),f=l.nbb*(2*t[0]+t[1]+.05*t[2]),u=Ve(f/l.aW,.5*l.c*l.z),m=100*Ve(u,2),b=4/l.c*u*(l.aW+4)*l.flRoot,c=d*u,w=c*l.flRoot,h=xt(i*km),y=Sm(h),S=50*Ve(l.c*d/(l.aW+4),1/2);return{J:m,C:c,h,s:S,Q:b,M:w,H:y}}var Mm=new oe({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Ze,fromBase(e){this.ε===void 0&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);const l=wr(e,aa),s=Math.abs(l.M)<this.ε;return[l.J,s?0:l.M,s?null:l.h]},toBase(e){return Xs({J:e[0],M:e[1],h:e[2]},aa)}});const Tm=at.D65,zm=216/24389,yr=24389/27;function Im(e){return 116*(e>zm?Math.cbrt(e):(yr*e+16)/116)-16}function Ys(e){return e>8?Math.pow((e+16)/116,3):e/yr}function Om(e,l){let[s,t,a]=e,o=[],i=0;if(a===0)return[0,0,0];let r=Ys(a);a>0?i=.00379058511492914*a**2+.608983189401032*a+.9155088574762233:i=9514440756550361e-21*a**2+.08693057439788597*a-21.928975842194614;const p=2e-12,d=15;let f=0,u=1/0;for(;f<=d;){o=Xs({J:i,C:t,h:s},l);const m=Math.abs(o[1]-r);if(m<u){if(m<=p)return o;u=m}i=i-(o[1]-r)*i/(2*o[1]),f+=1}return Xs({J:i,C:t,h:s},l)}function Dm(e,l){const s=Im(e[1]);if(s===0)return[0,0,0];const t=wr(e,Co);return[xt(t.h),t.C,s]}const Co=xr(Tm,200/Math.PI*Ys(50),Ys(50)*100,"average",!1);var jn=new oe({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:Ze,fromBase(e){this.ε===void 0&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);let l=Dm(e);return l[1]<this.ε&&(l[1]=0,l[0]=null),l},toBase(e){return Om(e,Co)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});const Em=Math.PI/180,ia=[1,.007,.0228];function ra(e){e[1]<0&&(e=jn.fromBase(jn.toBase(e)));const l=Math.log(Math.max(1+ia[2]*e[1]*Co.flRoot,1))/ia[2],s=e[0]*Em,t=l*Math.cos(s),a=l*Math.sin(s);return[e[2],t,a]}function Um(e,l){[e,l]=ve([e,l]);let[s,t,a]=ra(jn.from(e)),[o,i,r]=ra(jn.from(l));return Math.sqrt((s-o)**2+(t-i)**2+(a-r)**2)}var wn={deltaE76:Qc,deltaECMC:em,deltaE2000:dr,deltaEJz:im,deltaEITP:vm,deltaEOK:qs,deltaEOK2:gm,deltaEHCT:Um};function Lm(e){const l=e?Math.floor(Math.log10(Math.abs(e))):0;return Math.max(parseFloat(`1e${l-2}`),1e-6)}const ua={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function Wt(e,{method:l=bt.gamut_mapping,space:s=void 0,deltaEMethod:t="",jnd:a=2,blackWhiteClamp:o=void 0}={}){if(e=ve(e),Sn(arguments[1])?s=arguments[1]:s||(s=e.space),s=oe.get(s),Qt(e,s,{epsilon:0}))return e;let i;if(l==="css")i=Rm(e,{space:s});else{if(l!=="clip"&&!Qt(e,s)){Object.prototype.hasOwnProperty.call(ua,l)&&({method:l,jnd:a,deltaEMethod:t,blackWhiteClamp:o}=ua[l]);let r=dr;if(t!==""){for(let d in wn)if("deltae"+t.toLowerCase()===d.toLowerCase()){r=wn[d];break}}a===0&&(a=1e-16);let p=Wt(Ue(e,s),{method:"clip",space:s});if(r(e,p)>a){if(o&&Object.keys(o).length===3){let S=oe.resolveCoord(o.channel),D=ct(Ue(e,S.space),S.id);if(Ce(D)&&(D=0),D>=o.max)return Ue({space:"xyz-d65",coords:at.D65},e.space);if(D<=o.min)return Ue({space:"xyz-d65",coords:[0,0,0]},e.space)}let d=oe.resolveCoord(l),f=d.space,u=d.id,m=Ue(e,f);m.coords.forEach((S,D)=>{Ce(S)&&(m.coords[D]=0)});let c=(d.range||d.refRange)[0],w=Lm(a),h=c,y=ct(m,u);for(;y-h>w;){let S=xn(m);S=Wt(S,{space:s,method:"clip"}),r(m,S)-a<w?h=ct(m,u):y=ct(m,u),Ft(m,u,(h+y)/2)}i=Ue(m,s)}else i=p}else i=Ue(e,s);if(l==="clip"||!Qt(i,s,{epsilon:0})){let r=Object.values(s.coords).map(p=>p.range||[]);i.coords=i.coords.map((p,d)=>{let[f,u]=r[d];return f!==void 0&&(p=Math.max(f,p)),u!==void 0&&(p=Math.min(p,u)),p})}}return s!==e.space&&(i=Ue(i,e.space)),e.coords=i.coords,e}Wt.returns="color";const da={WHITE:{space:St,coords:[1,0,0],alpha:1},BLACK:{space:St,coords:[0,0,0],alpha:1}};function Rm(e,{space:l}={}){e=ve(e),l||(l=e.space),l=oe.get(l);const a=oe.get("oklch");if(l.isUnbounded)return Ue(e,l);const o=Ue(e,a);let i=o.coords[0];if(i>=1){const c=Ue(da.WHITE,l);return c.alpha=e.alpha,Ue(c,l)}if(i<=0){const c=Ue(da.BLACK,l);return c.alpha=e.alpha,Ue(c,l)}if(Qt(o,l,{epsilon:0}))return Ue(o,l);function r(c){const w=Ue(c,l),h=Object.values(l.coords);return w.coords=w.coords.map((y,S)=>{if("range"in h[S]){const[D,k]=h[S].range;return ql(D,y,k)}return y}),w}let p=0,d=o.coords[1],f=!0,u=xn(o),m=r(u),b=qs(m,u);if(b<.02)return m;for(;d-p>1e-4;){const c=(p+d)/2;if(u.coords[1]=c,f&&Qt(u,l,{epsilon:0}))p=c;else if(m=r(u),b=qs(m,u),b<.02){if(.02-b<1e-4)break;f=!1,p=c}else d=c}return m}function Ue(e,l,{inGamut:s}={}){e=ve(e),l=oe.get(l);let t=l.from(e),a={space:l,coords:t,alpha:e.alpha};return s&&(a=Wt(a,s===!0?void 0:s)),a}Ue.returns="color";function En(e,l={}){var b,c,w,h;let{precision:s=bt.precision,format:t,inGamut:a=!0,coords:o,alph
12a:i,commas:r}=l,p,d=ve(e),f=t,u=d.parseMeta;u&&!t&&(u.format.canSerialize()&&(t=u.format,f=u.formatId),o!=null||(o=u.types),i!=null||(i=u.alphaType),r!=null||(r=u.commas)),f&&(t=(b=d.space.getFormat(t))!=null?b:oe.findFormat(f)),t||(t=(c=d.space.getFormat("default"))!=null?c:oe.DEFAULT_FORMAT,f=t.name),t&&t.space&&t.space!==d.space&&(d=Ue(d,t.space));let m=d.coords.slice();if(a||(a=t.toGamut),a&&!Qt(d)&&(m=Wt(xn(d),a===!0?void 0:a).coords),t.type==="custom")if(t.serialize)p=t.serialize(m,d.alpha,l);else throw new TypeError(`format ${f} can only be used to parse colors, not for serialization`);else{let y=t.name||"color",S=t.serializeCoords(m,s,o);if(y==="color"){let R=t.id||((w=t.ids)==null?void 0:w[0])||d.space.cssId||d.space.id;S.unshift(R)}let D=d.alpha;i!==void 0&&typeof i!="object"&&(i=typeof i=="string"?{type:i}:{include:i});let k=(h=i==null?void 0:i.type)!=null?h:"<number>",M=(i==null?void 0:i.include)===!0||t.alpha===!0||(i==null?void 0:i.include)!==!1&&t.alpha!==!1&&D<1,I="";if(r!=null||(r=t.commas),M){if(s!==null){let R;k==="<percentage>"&&(R="%",D*=100),D=xo(D,{precision:s,unit:R})}I=`${r?",":" /"} ${D}`}p=`${y}(${S.join(r?", ":" ")}${I})`}return p}const Am=[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],_m=[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]];var qn=new Je({id:"rec2020-linear",cssId:"--rec2020-linear",name:"Linear REC.2020",white:"D65",toXYZ_M:Am,fromXYZ_M:_m}),kr=new Je({id:"rec2020",name:"REC.2020",base:qn,toBase(e){return e.map(function(l){let s=l<0?-1:1,t=l*s;return s*Math.pow(t,2.4)})},fromBase(e){return e.map(function(l){let s=l<0?-1:1,t=l*s;return s*Math.pow(t,1/2.4)})}});const Fm=[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],Bm=[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]];var $r=new Je({id:"p3-linear",cssId:"display-p3-linear",name:"Linear P3",white:"D65",toXYZ_M:Fm,fromXYZ_M:Bm});const Pm=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],qe=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]];var Sr=new Je({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:Pm,fromXYZ_M:qe}),ca={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let ma=Array(3).fill("<percentage> | <number>[0, 255]"),pa=Array(3).fill("<number>[0, 255]");var tn=new Je({id:"srgb",name:"sRGB",base:Sr,fromBase:e=>e.map(l=>{let s=l<0?-1:1,t=l*s;return t>.0031308?s*(1.055*t**(1/2.4)-.055):12.92*l}),toBase:e=>e.map(l=>{let s=l<0?-1:1,t=l*s;return t<=.04045?l/12.92:s*((t+.055)/1.055)**2.4}),formats:{rgb:{coords:ma},rgb_number:{name:"rgb",commas:!0,coords:pa,alpha:!1},color:{},rgba:{coords:ma,commas:!0,alpha:!0},rgba_number:{name:"rgba",commas:!0,coords:pa},hex:{type:"custom",toGamut:!0,test:e=>/^#(([a-f0-9]{2}){3,4}|[a-f0-9]{3,4})$/i.test(e),parse(e){e.length<=5&&(e=e.replace(/[a-f0-9]/gi,"$&$&"));let l=[];return e.replace(/[a-f0-9]{2}/gi,s=>{l.push(parseInt(s,16)/255)}),{spaceId:"srgb",coords:l.slice(0,3),alpha:l.slice(3)[0]}},serialize:(e,l,{collapse:s=!0,alpha:t}={})=>{(t!==!1&&l<1||t===!0)&&e.push(l),e=e.map(i=>Math.round(i*255));let a=s&&e.every(i=>i%17===0);return"#"+e.map(i=>a?(i/17).toString(16):i.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:e=>/^[a-z]+$/i.test(e),parse(e){e=e.toLowerCase();let l={spaceId:"srgb",coords:null,alpha:1};if(e==="transparent"?(l.coords=ca.black,l.alpha=0):l.coords=ca[e],l.coords)return l}}}}),Cr=new Je({id:"p3",cssId:"display-p3",name:"P3",base:$r,fromBase:tn.fromBase,toBase:tn.toBase});bt.display_space=tn;let us;if(typeof CSS!="undefined"&&CSS.supports)for(let e of[mt,kr,Cr]){let l=e.getMinCoords(),t=En({space:e,coords:l,alpha:1});if(CSS.supports("color",t)){bt.display_space=e;break}}function Nm(e,t={}){var a=t,{space:l=bt.display_space}=a,s=an(a,["space"]);e=ve(e);let o=En(e,s);if(typeof CSS=="undefined"||CSS.supports("color",o)||!bt.display_space)o=new String(o),o.color=e;else{let i=e;if((e.coords.some(Ce)||Ce(e.alpha))&&!(us!=null?us:us=CSS.supports("color","hsl(none 50% 50%)"))&&(i=xn(e),i.coords=i.coords.map(He),i.alpha=He(i.alpha),o=En(i,s),CSS.supports("color",o)))return o=new String(o),o.color=i,o;i=Ue(i,l),o=new String(En(i,s)),o.color=i}return o}function Hm(e,l,{space:s,hue:t="shorter"}={}){e=ve(e),s||(s=e.space),s=oe.get(s);let a=Object.values(s.coords);[e,l]=[e,l].map(d=>Ue(d,s));let[o,i]=[e,l].map(d=>d.coords),r=o.map((d,f)=>{let u=a[f],m=i[f];return u.type==="angle"&&([d,m]=ur(t,[d,m])),fa(d,m)}),p=fa(e.alpha,l.alpha);
12return{space:s,coords:r,alpha:p}}function fa(e,l){return Ce(e)||Ce(l)?e===l?null:0:e-l}function Vm(e,l){return e=ve(e),l=ve(l),e.space===l.space&&e.alpha===l.alpha&&e.coords.every((s,t)=>s===l.coords[t])}function Gt(e){return ct(e,[Ze,"y"])}function Mr(e,l){Ft(e,[Ze,"y"],l)}function jm(e){Object.defineProperty(e.prototype,"luminance",{get(){return Gt(this)},set(l){Mr(this,l)}})}var qm=Object.freeze({__proto__:null,getLuminance:Gt,register:jm,setLuminance:Mr});function Wm(e,l){e=ve(e),l=ve(l);let s=Math.max(Gt(e),0),t=Math.max(Gt(l),0);return t>s&&([s,t]=[t,s]),(s+.05)/(t+.05)}const Gm=.56,Xm=.57,Ym=.62,Km=.65,ba=.022,Zm=1.414,Qm=.1,Jm=5e-4,ep=1.14,va=.027,tp=1.14;function ga(e){return e>=ba?e:e+(ba-e)**Zm}function dn(e){let l=e<0?-1:1,s=Math.abs(e);return l*Math.pow(s,2.4)}function np(e,l){l=ve(l),e=ve(e);let s,t,a,o,i,r;l=Ue(l,"srgb"),[o,i,r]=l.coords.map(b=>Ce(b)?0:b);let p=dn(o)*.2126729+dn(i)*.7151522+dn(r)*.072175;e=Ue(e,"srgb"),[o,i,r]=e.coords.map(b=>Ce(b)?0:b);let d=dn(o)*.2126729+dn(i)*.7151522+dn(r)*.072175,f=ga(p),u=ga(d),m=u>f;return Math.abs(u-f)<Jm?t=0:m?(s=u**Gm-f**Xm,t=s*ep):(s=u**Km-f**Ym,t=s*tp),Math.abs(t)<Qm?a=0:t>0?a=t-va:a=t+va,a*100}function lp(e,l){e=ve(e),l=ve(l);let s=Math.max(Gt(e),0),t=Math.max(Gt(l),0);t>s&&([s,t]=[t,s]);let a=s+t;return a===0?0:(s-t)/a}const sp=5e4;function op(e,l){e=ve(e),l=ve(l);let s=Math.max(Gt(e),0),t=Math.max(Gt(l),0);return t>s&&([s,t]=[t,s]),t===0?sp:(s-t)/t}function ap(e,l){e=ve(e),l=ve(l);let s=ct(e,[mt,"l"]),t=ct(l,[mt,"l"]);return Math.abs(s-t)}const ip=216/24389,ha=24/116,rl=24389/27;let ds=at.D65;var Ks=new oe({id:"lab-d65",name:"Lab D65",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:ds,base:Ze,fromBase(e){let s=e.map((t,a)=>t/ds[a]).map(t=>t>ip?Math.cbrt(t):(rl*t+16)/116);return[116*s[1]-16,500*(s[0]-s[1]),200*(s[1]-s[2])]},toBase(e){let l=[];return l[1]=(e[0]+16)/116,l[0]=e[1]/500+l[1],l[2]=l[1]-e[2]/200,[l[0]>ha?Math.pow(l[0],3):(116*l[0]-16)/rl,e[0]>8?Math.pow((e[0]+16)/116,3):e[0]/rl,l[2]>ha?Math.pow(l[2],3):(116*l[2]-16)/rl].map((t,a)=>t*ds[a])},formats:{"lab-d65":{coords:["<number> | <percentage>","<number> | <percentage>","<number> | <percentage>"]}}});const cs=Math.pow(5,.5)*.5+.5;function rp(e,l){e=ve(e),l=ve(l);let s=ct(e,[Ks,"l"]),t=ct(l,[Ks,"l"]),a=Math.abs(Math.pow(s,cs)-Math.pow(t,cs)),o=Math.pow(a,1/cs)*Math.SQRT2-40;return o<7.5?0:o}var wl=Object.freeze({__proto__:null,contrastAPCA:np,contrastDeltaPhi:rp,contrastLstar:ap,contrastMichelson:lp,contrastWCAG21:Wm,contrastWeber:op});function up(e,l,s){Sn(s)&&(s={algorithm:s}
12);let o=s||{},{algorithm:t}=o,a=an(o,["algorithm"]);if(!t){let i=Object.keys(wl).map(r=>r.replace(/^contrast/,"")).join(", ");throw new TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${i}`)}e=ve(e),l=ve(l);for(let i in wl)if("contrast"+t.toLowerCase()===i.toLowerCase())return wl[i](e,l,a);throw new TypeError(`Unknown contrast algorithm: ${t}`)}function Gl(e){let[l,s,t]=Qn(e,Ze),a=l+15*s+3*t;return[4*l/a,9*s/a]}function Tr(e){let[l,s,t]=Qn(e,Ze),a=l+s+t;return[l/a,s/a]}function dp(e){Object.defineProperty(e.prototype,"uv",{get(){return Gl(this)}}),Object.defineProperty(e.prototype,"xy",{get(){return Tr(this)}})}var cp=Object.freeze({__proto__:null,register:dp,uv:Gl,xy:Tr});function In(e,l,s={}){Sn(s)&&(s={method:s});let o=s,{method:t=bt.deltaE}=o,a=an(o,["method"]);for(let i in wn)if("deltae"+t.toLowerCase()===i.toLowerCase())return wn[i](e,l,a);throw new TypeError(`Unknown deltaE method: ${t}`)}function zr(e,l=.25){let t=[oe.get("oklch","lch"),"l"];return Ft(e,t,a=>a*(1+l))}function Ir(e,l=.25){let t=[oe.get("oklch","lch"),"l"];return Ft(e,t,a=>a*(1-l))}zr.returns="color";Ir.returns="color";var mp=Object.freeze({__proto__:null,darken:Ir,lighten:zr});function Or(e,l,s,t={}){return[e,l]=[ve(e),ve(l)],Nt(s)==="object"&&([s,t]=[.5,s]),Jn(e,l,t)(s!=null?s:.5)}function Dr(e,l,s={}){let t;Mo(e)&&([t,s]=[e,l],[e,l]=t.rangeArgs.colors);let m=s,{maxDeltaE:a,deltaEMethod:o,steps:i=2,maxSteps:r=1e3}=m,p=an(m,["maxDeltaE","deltaEMethod","steps","maxSteps"]);t||([e,l]=[ve(e),ve(l)],t=Jn(e,l,p));let d=In(e,l),f=a>0?Math.max(i,Math.ceil(d/a)+1):i,u=[];if(r!==void 0&&(f=Math.min(f,r)),f===1)u=[{p:.5,color:t(.5)}];else{let b=1/(f-1);u=Array.from({length:f},(c,w)=>{let h=w*b;return{p:h,color:t(h)}})}if(a>0){let b=u.reduce((c,w,h)=>{if(h===0)return 0;let y=In(w.color,u[h-1].color,o);return Math.max(c,y)},0);for(;b>a;){b=0;for(let c=1;c<u.length&&u.length<r;c++){let w=u[c-1],h=u[c],y=(h.p+w.p)/2,S=t(y);b=Math.max(b,In(S,w.color),In(S,h.color)),u.splice(c,0,{p:y,color:t(y)}),c++}}}return u=u.map(b=>b.color),u}function Jn(e,l,s={}){if(Mo(e)){let[p,d]=[e,l];return Jn(...p.rangeArgs.colors,Q(Q({},p.rangeArgs.options),d))}let{space:t,outputSpace:a,progression:o,premultiplied:i}=s;e=ve(e),l=ve(l),e=xn(e),l=xn(l);let r={colors:[e,l],options:s};if(t?t=oe.get(t):t=oe.registry[bt.interpolationSpace]||e.space,a=a?oe.get(a):t,e=Ue(e,t),l=Ue(l,t),e=Wt(e),l=Wt(l),t.coords.h&&t.coords.h.type==="angle"){let p=s.hue=s.hue||"shorter",d=[t,"h"],[f,u]=[ct(e,d),ct(l,d)];Ce(f)&&!Ce(u)?f=u:Ce(u)&&!Ce(f)&&(u=f),[f,u]=ur(p,[f,u]),Ft(e,d,f),Ft(l,d,u)}return i&&(e.coords=e.coords.map(p=>p*e.alpha),l.coords=l.coords.map(p=>p*l.alpha)),Object.assign(p=>{p=o?o(p):p;let d=e.coords.map((m,b)=>{let c=l.coords[b];return Vn(m,c,p)}),f=Vn(e.alpha,l.alpha,p),u={space:t,coords:d,alpha:f};return i&&(u.coords=u.coords.map(m=>m/f)),a!==t&&(u=Ue(u,a)),u},{rangeArgs:r})}function Mo(e){return Nt(e)==="function"&&!!e.rangeArgs}bt.interpolationSpace="lab";function pp(e){e.defineFunction("mix",Or,{returns:"color"}),e.defineFunction("range",Jn,{returns:"function<color>"}),e.defineFunction("steps",Dr,{returns:"array<color>"})}var fp=Object.freeze({__proto__:null,isRange:Mo,mix:Or,range:Jn,register:pp,steps:Dr}),bp=new oe({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:tn,fromBase:e=>{let l=Math.max(...e),s=Math.min(...e),[t,a,o]=e,[i,r,p]=[null,0,(s+l)/2],d=l-s;if(d!==0){switch(r=p===0||p===1?0:(l-p)/Math.min(p,1-p),l){case t:i=(a-o)/d+(a<o?6:0);break;case a:i=(o-t)/d+2;break;case o:i=(t-a)/d+4}i=i*60}return r<0&&(i+=180,r=Math.abs(r)),i>=360&&(i-=360),[i,r*100,p*100]},toBase:e=>{let[l,s,t]=e;l=l%360,l<0&&(l+=360),s/=100,t/=100;function a(o){let i=(o+l/30)%12,r=s*Math.min(t,1-t);return t-r*Math.max(-1,Math.min(i-3,9-i,1))}return[a(0),a(8),a(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]},hsla:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"],commas:!0,alpha:!0}}}
12),Er=new oe({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:tn,fromBase(e){let l=Math.max(...e),s=Math.min(...e),[t,a,o]=e,[i,r,p]=[null,0,l],d=l-s;if(d!==0){switch(l){case t:i=(a-o)/d+(a<o?6:0);break;case a:i=(o-t)/d+2;break;case o:i=(t-a)/d+4}i=i*60}return p&&(r=d/p),i>=360&&(i-=360),[i,r*100,p*100]},toBase(e){let[l,s,t]=e;l=l%360,l<0&&(l+=360),s/=100,t/=100;function a(o){let i=(o+l/60)%6;return t-t*s*Math.max(0,Math.min(i,4-i,1))}return[a(5),a(3),a(1)]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),vp=new oe({id:"hwb",name:"HWB",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},w:{range:[0,100],name:"Whiteness"},b:{range:[0,100],name:"Blackness"}},base:Er,fromBase(e){let[l,s,t]=e;return[l,t*(100-s)/100,100-t]},toBase(e){let[l,s,t]=e;s/=100,t/=100;let a=s+t;if(a>=1){let r=s/a;return[l,0,r*100]}let o=1-t,i=o===0?0:1-s/o;return[l,i*100,o*100]},formats:{hwb:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});const gp=[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],hp=[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]];var Ur=new Je({id:"a98rgb-linear",cssId:"--a98-rgb-linear",name:"Linear Adobe® 98 RGB compatible",white:"D65",toXYZ_M:gp,fromXYZ_M:hp}),xp=new Je({id:"a98rgb",cssId:"a98-rgb",name:"Adobe® 98 RGB compatible",base:Ur,toBase:e=>e.map(l=>Math.pow(Math.abs(l),563/256)*Math.sign(l)),fromBase:e=>e.map(l=>Math.pow(Math.abs(l),256/563)*Math.sign(l))});const wp=[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],yp=[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]];var Lr=new Je({id:"prophoto-linear",cssId:"--prophoto-rgb-linear",name:"Linear ProPhoto",white:"D50",base:$o,toXYZ_M:wp,fromXYZ_M:yp});const kp=1/512,$p=16/512;var Sp=new Je({id:"prophoto",cssId:"prophoto-rgb",name:"ProPhoto",base:Lr,toBase(e){return e.map(l=>{let s=l<0?-1:1,t=l*s;return t<$p?l/16:s*t**1.8})},fromBase(e){return e.map(l=>{let s=l<0?-1:1,t=l*s;return t>=kp?s*t**(1/1.8):16*l})}});const ul=1.09929682680944,xa=.018053968510807;var Cp=new Je({id:"--rec2020-oetf",name:"REC.2020_Scene_Referred",base:qn,referred:"scene",toBase(e){return e.map(function(l){let s=l<0?-1:1,t=l*s;return t<xa*4.5?l/4.5:s*Math.pow((t+ul-1)/ul,1/.45)})},fromBase(e){return e.map(function(l){let s=l<0?-1:1,t=l*s;return t>=xa?s*(ul*Math.pow(t,.45)-(ul-1)):4.5*l})}}),Mp=new oe({id:"oklch",name:"OkLCh",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:St,fromBase:vt.fromBase,toBase:vt.toBase,formats:{oklch:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}});const yn=2*Math.PI,Ll=[[4.076741636075958,-3.307711539258063,.2309699031821043],[-1.2684379732850315,2.609757349287688,-.341319376002657],[-.0041960761386756,-.7034186179359362,1.7076146940746117]],Rl=[[[-1.8817031,-.80936501],[1.19086277,1.76576728,.59662641,.75515197,.56771245]],[[1.8144408,-1.19445267],[.73956515,-.45954404,.08285427,.12541073,-.14503204]],[[.13110758,1.81333971],[1.35733652,-.00915799,-1.1513021,-.50559606,.00692167]]],ms=Number.MAX_VALUE,Un=.206,To=.03,On=(1+Un)/(1+To);function Ye(e,l){let s=e.length;if(s!==l.length)throw new Error(`Vectors of size ${s} and ${l.length} are not aligned`);let t=0;return e.forEach((a,o)=>{t+=a*l[o]}),t}function Ln(e){return .5*(On*e-Un+Math.sqrt((On*e-Un)*(On*e-Un)+4*To*On*e))}function bn(e){return(e**2+Un*e)/(On*(e+To))}function zo(e){let[l,s]=e;return[s/l,s/(1-l)]}function Tp(e,l){let s=.11516993+1/(7.4477897+4.1590124*l+e*(-2.19557347+1.75198401*l+e*(-2.13704948-10.02301043*l+e*(-4.24894561+5.38770819*l+4.69891013*e)))),t=.11239642+1/(1.
126132032-.68124379*l+e*(.40370612+.90148123*l+e*(-.27087943+.6122399*l+e*(.00299215-.45399568*l-.14661872*e))));return[s,t]}function Io(e,l){let s=Pe(e,Ht);return s[0]=s[0]**3,s[1]=s[1]**3,s[2]=s[2]**3,Pe(s,l,s)}function Xl(e,l,s,t){let a=Ip(e,l,s,t),o=Io([1,a*e,a*l],s),i=Ve(1/Math.max(...o),1/3),r=i*a;return[i,r]}function zp(e,l,s,t,a,o,i,r){let p;if(r===void 0&&(r=Xl(e,l,o,i)),(s-a)*r[1]-(r[0]-a)*t<=0)p=r[1]*a/(t*r[0]+r[1]*(a-s));else{p=r[1]*(a-1)/(t*(r[0]-1)+r[1]*(a-s));let d=s-a,f=t,u=Ye(Ht[0].slice(1),[e,l]),m=Ye(Ht[1].slice(1),[e,l]),b=Ye(Ht[2].slice(1),[e,l]),c=d+f*u,w=d+f*m,h=d+f*b,y=a*(1-p)+p*s,S=p*t,D=y+S*u,k=y+S*m,M=y+S*b,I=D**3,R=k**3,T=M**3,C=3*c*D**2,E=3*w*k**2,_=3*h*M**2,P=6*c**2*D,A=6*w**2*k,z=6*h**2*M,K=Ye(o[0],[I,R,T])-1,H=Ye(o[0],[C,E,_]),G=Ye(o[0],[P,A,z]),ne=H/(H*H-.5*K*G),V=-K*ne,X=Ye(o[1],[I,R,T])-1,ae=Ye(o[1],[C,E,_]),Se=Ye(o[1],[P,A,z]),W=ae/(ae*ae-.5*X*Se),B=-X*W,ie=Ye(o[2],[I,R,T])-1,xe=Ye(o[2],[C,E,_]),we=Ye(o[2],[P,A,z]),Ae=xe/(xe*xe-.5*ie*we),fe=-ie*Ae;V=ne>=0?V:ms,B=W>=0?B:ms,fe=Ae>=0?fe:ms,p+=Math.min(V,Math.min(B,fe))}return p}function Rr(e,l,s){let[t,a,o]=e,i=Xl(a,o,l,s),r=zp(a,o,t,1,t,l,s,i),p=zo(i),d=r/Math.min(t*p[0],(1-t)*p[1]),f=Tp(a,o),u=t*f[0],m=(1-t)*f[1],b=.9*d*Math.sqrt(Math.sqrt(1/(1/u**4+1/m**4)));return u=t*.4,m=(1-t)*.8,[Math.sqrt(1/(1/u**2+1/m**2)),b,r]}function Ip(e,l,s,t){let a,o,i,r,p,d,f,u;Ye(t[0][0],[e,l])>1?([a,o,i,r,p]=t[0][1],[d,f,u]=s[0]):Ye(t[1][0],[e,l])>1?([a,o,i,r,p]=t[1][1],[d,f,u]=s[1]):([a,o,i,r,p]=t[2][1],[d,f,u]=s[2]);let m=a+o*e+i*l+r*e**2+p*e*l,b=Ye(Ht[0].slice(1),[e,l]),c=Ye(Ht[1].slice(1),[e,l]),w=Ye(Ht[2].slice(1),[e,l]),h=1+m*b,y=1+m*c,S=1+m*w,D=h**3,k=y**3,M=S**3,I=3*b*h**2,R=3*c*y**2,T=3*w*S**2,C=6*b**2*h,E=6*c**2*y,_=6*w**2*S,P=d*D+f*k+u*M,A=d*I+f*R+u*T,z=d*C+f*E+u*_;return m=m-P*A/(A**2-.5*P*z),m}function Op(e,l,s){let[t,a,o]=e,i=bn(o),r=null,p=null;if(t=xt(t)/360,i!==0&&i!==1&&a!==0){let d=Math.cos(yn*t),f=Math.sin(yn*t),[u,m,b]=Rr([i,d,f],l,s),c=.8,w=1.25,h,y,S,D;a<c?(h=w*a,y=0,S=c*u,D=1-S/m):(h=5*(a-.8),y=m,S=.2*m**2*1.25**2/u,D=1-S/(b-m));let k=y+h*S/(1-D*h);r=k*d,p=k*f}return[i,r,p]}function Dp(e,l,s){let t=1e-7,a=1e-4,o=e[0],i=0,r=Ln(o),p=Math.sqrt(e[1]**2+e[2]**2),d=.5+Math.atan2(-e[2],-e[1])/yn;if(r!==0&&r!==1&&p!==0){let u=e[1]/p,m=e[2]/p,[b,c,w]=Rr([o,u,m],l,s),h=.8,y=1.25,S,D,k,M;p<c?(D=h*b,k=1-D/c,M=p/(D+k*p),i=M*h):(S=c,D=.2*c**2*y**2/b,k=1-D/(w-c),M=(p-S)/(D+k*(p-S)),i=h+.2*M)}const f=Math.abs(i)<a;return f||r===0||Math.abs(1-r)<t?(d=null,f||(i=0)):d=xt(d*360),[d,i,r]}var Ep=new oe({id:"okhsl",name:"Okhsl",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,1],name:"Saturation"},l:{range:[0,1],name:"Lightness"}},base:St,gamutSpace:"self",fromBase(e){return Dp(e,Ll,Rl)},toBase(e){return Op(e,Ll,Rl)},formats:{color:{id:"--okhsl",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),Ar=new oe({id:"oklrab",name:"Oklrab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:St,fromBase(e){return[Ln(e[0]),e[1],e[2]]},toBase(e){return[bn(e[0]),e[1],e[2]]},formats:{color:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),Up=new oe({id:"oklrch",name:"Oklrch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:Ar,fromBase:vt.fromBase,toBase:vt.toBase,formats:{color:{coords:["<percentage> | <number>","<number> | <percentage>[0,1]","<number> | <angle>"]}}});function Lp(e,l,s){let[t,a,o]=e;t=xt(t)/360;let i=bn(o),r=null,p=null;if(i!==0&&a!==0){let d=Math.cos(yn*t),f=Math.sin(yn*t),u=Xl(d,f,l,s),[m,b]=zo(u),c=.5,w=1-c/m,h=1-a*c/(c+b-b*w*a),y=a*b*c/(c+b-b*w*a);i=o*h;let S=o*y,D=bn(h),k=y*D/h,M=bn(i);S=S*M/i,i=M;let[I,R,T]=Io([D,d*k,f*k],l),C=Ve(1/Math.max(Math.max(I,R),Math.max(T,0)),1/3);i=i*C,S=S*C,r=S*d,p=S*f}return[i,r,p]}function Rp(e,l,s){let t=1e-4,a=e[0],o=0,i=Ln(a),r=Math.sqrt(e[1]**2+e[2]**2),p=.5+Math.atan2(-e[2],-e[1])/yn;if(a!==0&&a!==1&&r!==0){let d=e[1]/r,f=e[2]/r,u=Xl(d,f,l,s),[m,b]=zo(u),c=.5,w=1-c/m,h=b/(r+a*b),y=h*a,S=h*r,D=bn(y),k=S*D/y,[M,I,R]=Io([D,d*k,f*k],l),T=Ve(1/Math.max(Math.max(M,I),Math.max(R,0)),1/3);a=a/T,r=r/T,r=r*Ln(a)/a,a=Ln(a),i=a/y,o=(c+b)*S/(b*c+b*w*S)}return Math.abs(o)<t||i===0?p=null:p=xt(p*360),[p,o,i]}var Ap=new oe({id:"okhsv",name:"Okhsv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,1],name:"Saturation"},v:{range:[0,1],name:"Value"}}
vendor: 2,124 bytes, line 12
12,base:St,gamutSpace:"self",fromBase(e){return Rp(e,Ll,Rl)},toBase(e){return Lp(e,Ll,Rl)},formats:{color:{id:"--okhsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});let _r=at.D65;const _p=216/24389,wa=24389/27,[ya,ka]=Gl({space:Ze,coords:_r});var Fr=new oe({id:"luv",name:"Luv",coords:{l:{refRange:[0,100],name:"Lightness"},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:_r,base:Ze,fromBase(e){let l=[He(e[0]),He(e[1]),He(e[2])],s=l[1],[t,a]=Gl({space:Ze,coords:l});if(!Number.isFinite(t)||!Number.isFinite(a))return[0,0,0];let o=s<=_p?wa*s:116*Math.cbrt(s)-16;return[o,13*o*(t-ya),13*o*(a-ka)]},toBase(e){let[l,s,t]=e;if(l===0||Ce(l))return[0,0,0];s=He(s),t=He(t);let a=s/(13*l)+ya,o=t/(13*l)+ka,i=l<=8?l/wa:Math.pow((l+16)/116,3);return[i*(9*a/(4*o)),i,i*((12-3*a-20*o)/(4*o))]},formats:{color:{id:"--luv",coords:["<number> | <percentage>","<number> | <percentage>","<number> | <percentage>"]}}}),Oo=new oe({id:"lchuv",name:"LChuv",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,220],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Fr,fromBase:vt.fromBase,toBase:vt.toBase,formats:{color:{id:"--lchuv",coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}});const Fp=216/24389,Bp=24389/27,$a=qe[0][0],Sa=qe[0][1],ps=qe[0][2],Ca=qe[1][0],Ma=qe[1][1],fs=qe[1][2],Ta=qe[2][0],za=qe[2][1],bs=qe[2][2];function cn(e,l,s){const t=l/(Math.sin(s)-e*Math.cos(s));return t<0?1/0:t}function Al(e){const l=Math.pow(e+16,3)/1560896,s=l>Fp?l:e/Bp,t=s*(284517*$a-94839*ps),a=s*(838422*ps+769860*Sa+731718*$a),o=s*(632260*ps-126452*Sa),i=s*(284517*Ca-94839*fs),r=s*(838422*fs+769860*Ma+731718*Ca),p=s*(632260*fs-126452*Ma),d=s*(284517*Ta-94839*bs),f=s*(838422*bs+769860*za+731718*Ta),u=s*(632260*bs-126452*za);return{r0s:t/o,r0i:a*e/o,r1s:t/(o+126452),r1i:(a-769860)*e/(o+126452),g0s:i/p,g0i:r*e/p,g1s:i/(p+126452),g1i:(r-769860)*e/(p+126452),b0s:d/u,b0i:f*e/u,b1s:d/(u+126452),b1i:(f-769860)*e/(u+126452)}}function Ia(e,l){const s=l/360*Math.PI*2,t=cn(e.r0s,e.r0i,s),a=cn(e.r1s,e.r1i,s),o=cn(e.g0s,e.g0i,s),i=cn(e.g1s,e.g1i,s),r
12=cn(e.b0s,e.b0i,s),p=cn(e.b1s,e.b1i,s);return Math.min(t,a,o,i,r,p)}var Pp=new oe({id:"hsluv",name:"HSLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:Oo,gamutSpace:tn,fromBase(e){let[l,s,t]=[He(e[0]),He(e[1]),He(e[2])],a;if(l>99.9999999)a=0,l=100;else if(l<1e-8)a=0,l=0;else{let o=Al(l),i=Ia(o,t);a=s/i*100}return[t,a,l]},toBase(e){let[l,s,t]=[He(e[0]),He(e[1]),He(e[2])],a;if(t>99.9999999)t=100,a=0;else if(t<1e-8)t=0,a=0;else{let o=Al(t);a=Ia(o,l)/100*s}return[t,a,l]},formats:{color:{id:"--hsluv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});qe[0][0];qe[0][1];qe[0][2];qe[1][0];qe[1][1];qe[1][2];qe[2][0];qe[2][1];qe[2][2];function mn(e,l){return Math.abs(l)/Math.sqrt(Math.pow(e,2)+1)}function Oa(e){let l=mn(e.r0s,e.r0i),s=mn(e.r1s,e.r1i),t=mn(e.g0s,e.g0i),a=mn(e.g1s,e.g1i),o=mn(e.b0s,e.b0i),i=mn(e.b1s,e.b1i);return Math.min(l,s,t,a,o,i)}var Np=new oe({id:"hpluv",name:"HPLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:Oo,gamutSpace:"self",fromBase(e){let[l,s,t]=[He(e[0]),He(e[1]),He(e[2])],a;if(l>99.9999999)a=0,l=100;else if(l<1e-8)a=0,l=0;else{let o=Al(l),i=Oa(o);a=s/i*100}return[t,a,l]},toBase(e){let[l,s,t]=[He(e[0]),He(e[1]),He(e[2])],a;if(t>99.9999999)t=100,a=0;else if(t<1e-8)t=0,a=0;else{let o=Al(t);a=Oa(o)/100*s}return[t,a,l]},formats:{color:{id:"--hpluv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),Do=new Je({id:"rec2100-linear",name:"Linear REC.2100",white:"D65",toBase:qn.toBase,fromBase:qn.fromBase});const Da=203,Ea=2610/2**14,Hp=2**14/2610,Vp=2523/2**5,Ua=2**5/2523,La=3424/2**12,Ra=2413/2**7,Aa=2392/2**7;var jp=new Je({id:"rec2100pq",cssId:"rec2100-pq",name:"REC.2100-PQ",base:Do,toBase(e){return e.map(function(l){return(Math.max(l**Ua-La,0)/(Ra-Aa*l**Ua))**Hp*1e4/Da})},fromBase(e){return e.map(function(l){let s=Math.max(l*Da/1e4,0),t=La+Ra*s**Ea,a=1+Aa*s**Ea;return(t/a)**Vp})}});const _a=.17883277,Fa=.28466892,Ba=.55991073,vs=3.7743;var qp=new Je({id:"rec2100hlg",cssId:"rec2100-hlg",name:"REC.2100-HLG",referred:"scene",base:Do,toBase(e){return e.map(function(l){return l<=.5?l**2/3*vs:(Math.exp((l-Ba)/_a)+Fa)/12*vs})},fromBase(e){return e.map(function(l){return l/=vs,l<=1/12?Ve(3*l,.5):_a*Math.log(12*l-Fa)+Ba})}});const Br={};qt.add("chromatic-adaptation-start",e=>{e.options.method&&(e.M=Pr(e.W1,e.W2,e.options.method))});qt.add("chromatic-adaptation-end",e=>{e.M||(e.M=Pr(e.W1,e.W2,e.options.method))});function Yl({id:e,toCone_M:l,fromCone_M:s}){Br[e]=arguments[0]}function Pr(e,l,s="Bradford"){let t=Br[s],[a,o,i]=zn(t.toCone_M,e),[r,p,d]=zn(t.toCone_M,l),f=[[r/a,0,0],[0,p/o,0],[0,0,d/i]],u=zn(f,t.toCone_M);return zn(t.fromCone_M,u)}Yl({id:"von Kries",toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]});Yl({id:"Bradford",toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]});Yl({id:"CAT02",toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]});Yl({id:"CAT16",toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]});Object.assign(at,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]});at.ACES=[.32168/.33767,1,(1-.32168-.33767)/.33767];const Wp=[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],Gp=[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]];var Nr=new Je({id:"acescg",cssId:"--acescg",name:"ACEScg",coords:{r:{range:[0,65504],name:"Red"},g:{range:[0,65504],name:"Green"},b:{range:[0,65504],name:"Blue"}},referred:"scene",white:at.ACES,toXYZ_M:Wp,fromXYZ_M:Gp});const dl=2**-16,gs=-.35828683,cl=(Math.log2(65504)+9.72)/17.52;var Xp=new Je({id:"acescc",cssId:"--acescc",name:"ACEScc",coords:{r:{range:[gs,cl],name:"Red"},g:{range:[gs,cl],name:"Green"},b:{range:[gs,cl],name:"Blue"}},referred:"scene",base:Nr,toBase(e){const l=-.3013698630136986;return e.map(function(s){return s<=l?(2**(s*17.52-9.72)-dl)*2:s<cl?2**(s*17.52-9.72):65504})}
12,fromBase(e){return e.map(function(l){return l<=0?(Math.log2(dl)+9.72)/17.52:l<dl?(Math.log2(dl+l*.5)+9.72)/17.52:(Math.log2(l)+9.72)/17.52})}}),Pa=Object.freeze({__proto__:null,A98RGB:xp,A98RGB_Linear:Ur,ACEScc:Xp,ACEScg:Nr,CAM16_JMh:Mm,HCT:jn,HPLuv:Np,HSL:bp,HSLuv:Pp,HSV:Er,HWB:vp,ICTCP:Gs,JzCzHz:Ws,Jzazbz:mr,LCH:vt,LCHuv:Oo,Lab:mt,Lab_D65:Ks,Luv:Fr,OKLCH:Mp,OKLab:St,OKLrCH:Up,OKLrab:Ar,Okhsl:Ep,Okhsv:Ap,P3:Cr,P3_Linear:$r,ProPhoto:Sp,ProPhoto_Linear:Lr,REC_2020:kr,REC_2020_Linear:qn,REC_2020_Scene_Referred:Cp,REC_2100_HLG:qp,REC_2100_Linear:Do,REC_2100_PQ:jp,XYZ_ABS_D65:So,XYZ_D50:$o,XYZ_D65:Ze,sRGB:tn,sRGB_Linear:Sr});class ke{constructor(...l){let s;if(l.length===1){let i={};typeof l[0]=="object"&&Object.getPrototypeOf(l[0]).constructor===Object&&(l[0]=Q({},l[0])),s=ve(l[0],{parseMeta:i}),i.format&&(this.parseMeta=i)}let t,a,o;s?(t=s.space||s.spaceId,a=s.coords,o=s.alpha):[t,a,o]=l,Object.defineProperty(this,"space",{value:oe.get(t),writable:!1,enumerable:!0,configurable:!0}),this.coords=a?a.slice():[0,0,0],this.alpha=Ce(o)?o:o===void 0?1:ql(0,o,1);for(let i in this.space.coords)Object.defineProperty(this,i,{get:()=>this.get(i),set:r=>this.set(i,r)})}get spaceId(){return this.space.id}clone(){return new ke(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...l){let s=Nm(this,...l);return s.color=new ke(s.color),s}static get(l,...s){return hn(l,this)?l:new ke(l,...s)}static try(l,s){if(hn(l,this))return l;let t=rr(l,s);return t?new ke(t):null}static defineFunction(l,s,t=s){let{instance:a=!0,returns:o}=t,i=function(...r){let p=s(...r);if(o==="color")p=ke.get(p);else if(o==="function<color>"){let d=p;p=function(...f){let u=d(...f);return ke.get(u)},Object.assign(p,d)}else o==="array<color>"&&(p=p.map(d=>ke.get(d)));return p};l in ke||(ke[l]=i),a&&(ke.prototype[l]=function(...r){return i(this,...r)})}static defineFunctions(l){for(let s in l)ke.defineFunction(s,l[s],l[s])}static extend(l){if(l.register)l.register(ke);else for(let s in l)ke.defineFunction(s,l[s])}}ke.defineFunctions({get:ct,getAll:Qn,set:Ft,setAll:ko,to:Ue,equals:Vm,inGamut:Qt,toGamut:Wt,distance:cr,deltas:Hm,toString:En});Object.assign(ke,{util:Nc,hooks:qt,WHITES:at,Space:oe,spaces:oe.registry,parse:ar,defaults:bt});for(let e of Object.keys(Pa))oe.register(Pa[e]);for(let e in oe.registry)Zs(e,oe.registry[e]);qt.add("colorspace-init-end",e=>{var l;Zs(e.id,e),(l=e.aliases)==null||l.forEach(s=>{Zs(s,e)})});function Zs(e,l){let s=e.replace(/-/g,"_");Object.defineProperty(ke.prototype,s,{get(){let t=this.getAll(e);if(typeof Proxy=="undefined")return t;let a=new Proxy(t,{has:((o,i)=>{try{return oe.resolveCoord([l,i]),!0}catch(r){}return Reflect.has(o,i)}),get:(o,i,r)=>{if(i&&typeof i!="symbol"&&!(i in o)&&i in a){let{index:p}=oe.resolveCoord([l,i]);if(p>=0)return o[p]}return Reflect.get(o,i,r)},set:(o,i,r,p)=>{if(i&&typeof i!="symbol"&&!(i in o)||Number(i)>=0){let{index:d}=oe.resolveCoord([l,i]);if(d>=0)return o[d]=r,this.setAll(e,o),!0}return Reflect.set(o,i,r,p)}});return a},set(t){this.setAll(e,t)},configurable:!0,enumerable:!0})}ke.extend(wn);ke.extend({deltaE:In});Object.assign(ke,{deltaEMethods:wn});ke.extend(mp);ke.extend({contrast:up});ke.extend(cp);ke.extend(qm);ke.extend(fp);ke.extend(wl);function Jt(e,l,s){return Math.max(l,Math.min(e,s))}function ml(e,{format:l="srgb",alpha:s=!0}={format:"srgb",alpha:!0}){const t={alpha:s};l==="srgb"?t.format={name:"rgb",coords:["<number>[0, 255]","<number>[0, 255]","<number>[0, 255]"]}:l==="hex"&&(t.format="hex",t.collapse=!0);const a=l==="hex"?"srgb":l;return e.to(a).toString(t).replace(/none/g,"0")}function Na(e,l,s){const t=e.getBoundingClientRect(),a=l-t.left,o=s-t.top;return{x:t.width===0?0:Jt(a/t.width*100,0,100),y:t.height===0?0:Jt((1-o/t.height)*100,0,100)}}const Yp={deg:1,grad:.9,rad:180/Math.PI,turn:360};function Kp(){const e=Bt(Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,1);return{from(l){const s=l.match(/deg|g?rad|turn$/);if(s===null)return e.from(l);const t=s[0];return e.from(l.slice(0,-t.length))*Yp[t]}}}function Bt(e,l,s){return{from(t){if(t.endsWith("%")){const a=t.slice(0,-1);return a.endsWith(".")?NaN:Jt(Number(a),0,100)*s/100}return t.endsWith(".")?NaN:Jt(Number(t),e,l)}}}const Ha=5,Zp=Bt(0,1,1),pl=Kp(),pn=Bt(0,100,100),Va=Bt(-125,125,1),Qp=Bt(0,150,1),ja=Bt(0,1,1),qa=Bt(-.4,.4,1),Jp=Bt(0,.4,1),hs=Bt(0,255,255),xs={channel:"alpha",label:"Alpha",preferredType:"<number>",from:Zp.from},Wa={hsl:[{channel:"h",label:"H",preferredType:"<number>",from:pl.from},{channel:"s",label:"S",preferredType:"<percentage>",from:pn.from},{channel:"l",label:"L",preferredType:"<percentage>",from:pn.from}],hwb:[{channel:"h",label:"H",preferredType:"<number>",from:pl.from},{channel:"w",label:"W",preferredType:"<percentage>",from:pn.from},{channel:"b",label:"B",preferredType:"<percentage>",from:pn.from}],lab:[{channel:"l",label:"L",preferredType:"<percentage>",from:pn.from},{channel:"a",label:"a",preferredType:"<number>",from:Va.from},{channel:"b",label:"b",preferredType:"<number>",from:Va.from}],lch:[{channel:"l",label:"L",preferredType:"<percentage>",from:pn.from},{channel:"c",label:"C",preferredType:"<number>",from:Qp.from},{channel:"h",label:"H",preferredType:"<number>",from:pl.from}],oklab:[{channel:"l",label:"L",preferredType:"<percentage>",from:ja.from},{channel:"a",label:"a",preferredType:"<number>",from:qa.from},{channel:"b",label:"b",preferredType:"<number>",from:qa.from}],oklch:[{channel:"l",label:"L",preferredType:"<percentage>",from:ja.from},{channel:"c",label:"C",preferredType:"<number>",from:Jp.from},{channel:"h",label:"H",preferredType:"<number>",from:pl.from}],srgb:[{channel:"r",label:"R",preferredType:"<number>",from:hs.from},{channel:"g",label:"G",preferredType:"<number>",from:hs.from},{channel:"b",label:"B",preferredType:"<number>",from:hs.from}]},ef={class:"vacp-range-input-group"},tf=["for"],nf={class:"vacp-range-input-label-text vacp-range-input-label-text--hue"},lf=["id","value"],sf=["for"],of={class:"vacp-range-input-label-text vacp-range-input-label-text--alpha"},af=["id","value"],rf={class:"vacp-actions"},uf={class:"vacp-color-inputs"},df={class:"vacp-color-input-group"},cf=["for"],mf=["id","value"],pf=["id","for"],ff={class:"vacp-color-input-label-text"},bf=["id","value"],Kl=cu({__name:"ColorPicker",props:{color:{default:"#ffffffff"},copy:{type:Function},id:{default:"color-picker"},visibleFormats:{default:()=>["hex","hsl","hwb","srgb"]},defaultFormat:{default:"hsl"},alphaChannel:{default:"show"}},emits:["color-change","color-copy"],setup(e,{expose:l,emit:s}){const t=s;l({copyColor:C,switchFormat:m});const a=Ro("colorPicker"),o=Ro("colorSpaceRef");let i=!1;const r=F(e.visibleFormats.includes(e.defaultFormat)?e.defaultFormat:e.visibleFormats[0]),p=F(new ke("srgb",[1,1,1],1
12)),d=O(function(){const P=r.value,A=p.value.space.getFormat("default").coords;return Wa[P].map(({channel:z,label:K,preferredType:H},G)=>{var X,ae;const ne=p.value.to(P);ne.toGamut();const V=A[G];return{value:((X=V.find(({type:Se})=>Se===H))!=null?X:V.at(0)).serialize((ae=ne.coords[G])!=null?ae:0,Ha),channel:z,label:K}}).concat(e.alphaChannel==="show"?[{value:p.value.alpha.toPrecision(Ha).replace(/\.?0+$/,""),channel:xs.channel,label:xs.label}]:[])}),f=O(function(){return ml(p.value,{format:"hex",alpha:e.alphaChannel==="show"})}),u=O(function(){const P=p.value.to("hsv");return P.toGamut(),P});Te(()=>e.color,k,{immediate:!0}),De(function(){document.addEventListener("pointermove",h,{passive:!1}),document.addEventListener("touchmove",y,{passive:!1}),document.addEventListener("pointerup",w),document.addEventListener("touchend",w)}),Qe(function(){document.removeEventListener("pointermove",h),document.removeEventListener("touchmove",y),document.removeEventListener("pointerup",w),document.removeEventListener("touchend",w)});function m(){const P=(e.visibleFormats.findIndex(A=>A===r.value)+1)%e.visibleFormats.length;r.value=e.visibleFormats[P]}function b(P){i=!0,h(P)}function c(P){i=!0,y(P)}function w(){i=!1}function h(P){P.buttons!==1||!i||!(o.value instanceof HTMLElement)||S(Na(o.value,P.clientX,P.clientY))}function y(P){if(!i||!(o.value instanceof HTMLElement))return;P.preventDefault();const A=P.touches[0];S(Na(o.value,A.clientX,A.clientY))}function S({x:P,y:A}){var K;const z=p.value.to("hsv");z.toGamut(),T(new ke("hsv",[(K=z.h)!=null?K:0,P,A],p.value.alpha))}function D(P){var ae,Se;if(!["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"].includes(P.key))return;P.preventDefault();const A=["ArrowLeft","ArrowDown"].includes(P.key)?-1:1,z=["ArrowLeft","ArrowRight"].includes(P.key)?"s":"v",K=P.shiftKey?10:1,H=p.value.to("hsv");H.toGamut();const G=(ae=H.s)!=null?ae:0,ne=(Se=H.v)!=null?Se:0,V=z==="s"?Jt(G+A*K,0,100):G,X=z==="v"?Jt(ne+A*K,0,100):ne;S({x:V,y:X})}function k(P){let A;try{A=P instanceof ke?P:new ke(P)}catch(z){if(z instanceof TypeError)return;throw z}T(A)}function M(P,A){var ne,V,X;const z=P.currentTarget,K=A==="alpha"?Number(z.value):p.value.alpha,H=p.value.to("hsl");H.toGamut();const G=A==="h"?Number(z.value):(ne=H.h)!=null?ne:0;T(new ke("hsl",[G,(V=H.s)!=null?V:0,(X=H.l)!=null?X:0],K))}function I(P){const A=P.target;/^#(([A-F0-9]{2}){3,4}|[A-F0-9]{3,4})$/i.test(A.value)&&k(A.value)}function R(){const P=r.value,A=Wa[P].concat(e.alphaChannel==="show"?[xs]:[]).map(({channel:K,from:H})=>{const G=a.value.querySelector(`input[id="${e.id}-color-${P}-${K}"]`);return H(G.value)});if(A.some(K=>Number.isNaN(K)))return;const z=A.slice(0,3);T(new ke(P,z,A[3]))}function T(P){Math.abs(p.value.distance(P))<Number.EPSILON&&p.value.alpha===P.alpha||(p.value=P,t("color-change",E()))}function C(){return le(this,null,function*(){const P=ml(p.value,{format:r.value,alpha:e.alphaChannel==="show"});yield(e.copy?e.copy:A=>window.navigator.clipboard.writeText(A))(P),t("color-copy",E())})}function E(){return{color:Js(p.value),cssColor:ml(p.value,{format:r.value,alpha:e.alphaChannel==="show"})}}function _(P){if(!["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"].includes(P.key)||!P.shiftKey)return;const A=P.currentTarget,z=Number(A.step),K=["ArrowLeft","ArrowDown"].includes(P.key)?-1:1,H=Number(A.value)+K*z*10,G=Jt(H,Number(A.min),Number(A.max));A.value=String(G-K*z)}return(P,A)=>{var z;return x(),$("div",{ref_key:"colorPicker",ref:a,class:"vacp-color-picker",style:$e(`--vacp-color: ${g(ml)(p.value,{format:"hsl",alpha:!1})}`)},[n("div",{ref:"colorSpaceRef",class:"vacp-color-space",style:$e(`position: relative; background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent); background-color: hsl(${u.value.h} 100% 50%)`),onPointerdown:b,onTouchstart:c},[n("div",{ref:"thumb",class:"vacp-color-space-thumb",tabindex:"0","aria-label":"Color space thumb",style:$e(`box-sizing: border-box; position: absolute; left: ${u.value.s}%; bottom: ${u.value.v}%;`),onKeydown:D},null,36)],36),n("div",ef,[n("label",{class:"vacp-range-input-label vacp-range-input-label--hue",for:`${e.id}-hue-slider`},[n("span",nf,[Ke(P.$slots,"hue-range-input-label",{},()=>[A[2]||(A[2]=U("Hue",-1))])]),n("input",{id:`${e.id}-hue-slider`,class:"vacp-range-input vacp-range-input--hue",value:(z=p.value.to("hsl").toGamut().h)!=null?z:0,type:"range",min:"0",max:"360",step:"1",onKeydown:_,onInput:A[0]||(A[0]=K=>M(K,"h"))},null,40,lf)],8,tf),e.alphaChannel==="show"?(x(),$("label",{key:0,class:"vacp-range-input-label vacp-range-input-label--alpha",for:`${e.id}-alpha-slider`},[n("span",of,[Ke(P.$slots,"alpha-range-input-label",{},()=>[A[3]||(A[3]=U("Alpha",-1))])]),n("input",{id:`${e.id}-alpha-slider`,class:"vacp-range-input vacp-range-input--alpha",value:p.value.alpha,type:"range",min:"0",max:"1",step:"0.01",onKeydown:_,onInput:A[1]||(A[1]=K=>M(K,"alpha"))},null,40,af)],8,sf)):N("",!0)]),n("div",rf,[n("button",{class:"vacp-copy-button",type:"button",onClick:C},[Ke(P.$slots,"copy-button",{},()=>[A[4]||(A[4]=n("span",{class:"vacp-visually-hidden"},"Copy color",-1)),A[5]||(A[5]=n("svg",{class:"vacp-icon",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"24",height:"24",viewBox:"0 0 32 32"},[n("path",{d:"M25.313 28v-18.688h-14.625v18.688h14.625zM25.313 6.688c1.438 0 2.688 1.188 2.688 2.625v18.688c0 1.438-1.25 2.688-2.688 2.688h-14.625c-1.438 0-2.688-1.25-2.688-2.688v-18.688c0-1.438 1.25-2.625 2.688-2.625h14.625zM21.313 1.313v2.688h-16v18.688h-2.625v-18.688c0-1.438 1.188-2.688 2.625-2.688h16z",fill:"
12currentColor"})],-1))])]),Ke(P.$slots,"actions")]),n("div",uf,[n("div",df,[r.value==="hex"?(x(),$("label",{key:0,class:"vacp-color-input-label",for:`${e.id}-color-hex`},[A[6]||(A[6]=n("span",{class:"vacp-color-input-label-text"}," Hex ",-1)),n("input",{id:`${e.id}-color-hex`,class:"vacp-color-input",type:"text",value:f.value,onChange:I},null,40,mf)],8,cf)):(x(!0),$(ee,{key:1},ge(d.value,({value:K,channel:H,label:G})=>(x(),$("label",{id:`${e.id}-color-${r.value}-${H}-label`,key:`${e.id}-color-${r.value}-${H}-label`,class:"vacp-color-input-label",for:`${e.id}-color-${r.value}-${H}`},[n("span",ff,q(G),1),n("input",{id:`${e.id}-color-${r.value}-${H}`,class:"vacp-color-input",type:"text",value:K,onChange:R},null,40,bf)],8,pf))),128))]),e.visibleFormats.length>1?(x(),$("button",{key:0,class:"vacp-format-switch-button",type:"button",onClick:m},[Ke(P.$slots,"format-switch-button",{},()=>[A[7]||(A[7]=n("span",{class:"vacp-visually-hidden"},"Switch format",-1)),A[8]||(A[8]=n("svg",{class:"vacp-icon","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"15"},[n("path",{d:"M8 15l5-5-1-1-4 2-4-2-1 1zm4-9l1-1-5-5-5 5 1 1 4-2z",fill:"currentColor"})],-1))])])):N("",!0)])],4)}}}),vf={class:"flex gap-2 mt-2 mb-6"},gf={key:1,class:"w-full table-fixed table-ctrl"},hf={key:2,class:"flex items-start gap-3 text-sm font-light"},xf={__name:"BackgroundAside",props:{background:{type:Object,default:()=>({color:null,imageUrl:null,size:null,position:null})}},emits:["close","update:background"],setup(e,{emit:l}){const s=je("outputId"),t=l,a=e,o=F("color"),i=F(null),r=F(null),p=[{value:"contain",label:"Contain"},{value:"cover",label:"Cover"},{value:"100% 100%",label:"Stretch"}],d=[{value:"center",label:"Center"},{value:"top",label:"Top"},{value:"bottom",label:"Bottom"},{value:"left",label:"Left"},{value:"right",label:"Right"}];De(()=>{a.background.color==="transparent"?o.value="transparent":a.background.imageUrl?(o.value="image",i.value=a.background.imageUrl):(o.value="color",r.value=a.background.color||"#1C1918")});function f(b){b.color&&(r.value=b.color),b.imageUrl&&(i.value=b.imageUrl),t("update:background",Q(Q({},a.background),b))}function u(b){o.value=b,b==="color"?f({color:r.value,imageUrl:null}):b==="image"&&i.value?f({imageUrl:i.value}):b==="transparent"&&f({color:null,imageUrl:null})}function m(b){i.value=b||null,f({imageUrl:b||null})}return(b,c)=>{const w=pe("FaIcon");return x(),Z($n,{title:"Customize Background",onClose:c[6]||(c[6]=h=>t("close"))},{default:L(()=>[n("div",vf,[n("button",{type:"button",class:j(["flex-1 btn-ctrl h-10 text-sm",{"bg-neutral-600 border-neutral-400 hover:!border-white":o.value==="color"}]),onClick:c[0]||(c[0]=h=>u("color"))}," Color ",2),n("button",{type:"button",class:j(["flex-1 btn-ctrl h-10 text-sm",{"bg-neutral-600 border-neutral-400 hover:!border-white":o.value==="image"}]),onClick:c[1]||(c[1]=h=>u("image"))}," Image ",2),n("button",{type:"button",class:j(["flex-1 btn-ctrl h-10 text-sm",{"bg-neutral-600 border-neutral-400 hover:!border-white":o.value==="transparent"}]),onClick:c[2]||(c[2]=h=>u("transparent"))}," Transparent ",2)]),o.value==="color"?(x(),Z(g(Kl),{key:0,color:a.background.color||"#1C1918","visible-formats":["hex"],"default-format":"hex","alpha-channel":"hide",onColorChange:c[3]||(c[3]=({cssColor:h})=>f({color:h}))},null,8,["color"])):N("",!0),o.value==="image"?(x(),$("table",gf,[n("tbody",null,[n("tr",null,[c[7]||(c[7]=n("th",null,"Image",-1)),n("td",null,[v(on,{class:"!h-32",img:i.value,"file-formats":["JPG","PNG","WEBP"],"base-path":"images/","post-url":`/files/for-output/${g(s)}`,"image-size":"cover","onUpdate:img":m},null,8,["img","post-url"])])]),n("tr",null,[c[8]||(c[8]=n("th",null,"Size",-1)),n("td",null,[v(he,{"model-value":a.background.size||"cover",size:"xs",width:"100%",options:p,"onUpdate:modelValue":c[4]||(c[4]=h=>f({size:h}))},null,8,["model-value"])])]),n("tr",null,[c[9]||(c[9]=n("th",null,"Position",-1)),n("td",null,[v(he,{"model-value":a.background.position||"center",size:"xs",width:"100%",options:d,disabled:!["contain","cover"].includes(a.background.size||"cover"),"onUpdate:modelValue":c[5]||(c[5]=h=>f({position:h}
12))},null,8,["model-value","disabled"])])])])])):N("",!0),o.value==="transparent"?(x(),$("div",hf,[v(w,{icon:g(Ot),class:"flex-none text-neutral-700 mt-0.5",size:"lg"},null,8,["icon"]),c[10]||(c[10]=n("div",{class:"space-y-1"},[n("h4",{class:"text-base text-neutral-300 font-semibold"}," Transparent background "),n("p",null,[U(" Perfect for use with OBS Studio, streaming software, or when overlaying on other content. "),n("br"),n("a",{href:"/docs/integration-with-obs-studio/",target:"_blank",class:"text-blue-400 hover:text-blue-300 underline"}," Learn more about OBS integration â ")])],-1))])):N("",!0)]),_:1})}}},wf=Oe(xf,[["__scopeId","data-v-7836fbfc"]]),yf=["disabled","data-label"],kf={key:0},$f={key:0,class:"absolute rounded bg-neutral-900/80 px-1.5 top-1/2 right-1 -translate-y-1/2 text-green-500","aria-live":"polite"},Sf={__name:"FormCheckbox",props:{modelValue:Boolean,description:{type:String,default:""},size:{type:String,default:"md",validator:e=>["sm","md","lg"].includes(e)},dataLabel:{type:String,default:void 0},inputClass:{type:String,default:""},labelClass:{type:String,default:""},disabled:Boolean,loading:Boolean,saved:Boolean},emits:["update:modelValue"],setup(e,{emit:l}){const s=l,t=e,a=O({get:()=>t.modelValue,set:o=>{t.disabled||s("update:modelValue",o)}});return(o,i)=>{const r=pe("FaIcon"),p=Ct("tooltip");return x(),$("label",{class:j(["relative flex gap-px items-center text-neutral-300 h-7",{"border-neutral-600":!a.value,"border-teal-500":a.value,"opacity-50":e.disabled}])},[n("div",{class:j(["flex-none input-ctrl p-0 w-7 h-7 text-center rounded-r-none grid place-content-center",[t.inputClass,{"bg-animated from-neutral-900 to-white/5":e.loading}]])},[me(n("input",{"onUpdate:modelValue":i[0]||(i[0]=d=>a.value=d),type:"checkbox",disabled:e.disabled,class:j(["rounded inline-block",{"w-3 h-3":e.size==="sm","w-4 h-4":e.size==="md","w-8 h-8":e.size==="lg"}]),"data-label":e.dataLabel},null,10,yf),[[Fl,a.value]])],2),n("div",{class:j(["flex-1 min-w-0 input-ctrl py-0 px-2 h-7 leading-7 text-left rounded-l-none",[t.labelClass,{"bg-animated from-neutral-900 to-white/5":e.loading}]])},[n("span",null,[Ke(o.$slots,"default",{},void 0,!0)]),e.description?me((x(),$("span",kf,[v(r,{icon:g(Ot),class:"cursor-pointer text-neutral-600 hover:text-neutral-400",size:"sm"},null,8,["icon"])])),[[p,e.description]]):N("",!0)],2),e.saved?(x(),$("div",$f,[v(r,{icon:g(At),size:"xs"},null,8,["icon"]),i[1]||(i[1]=n("span",{class:"sr-only"},"Branding setting saved",-1))])):N("",!0)],2)}}},Ne=Oe(Sf,[["__scopeId","data-v-1acc5040"]]),Cf={class:"flex flex-col space-y-2"},Cn={__name:"CustomizeFontInput",props:{modelValue:{type:Object,required:!0},disabled:Boolean,customFonts:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:l}){const s=l,t=e;function a(i,r){s("update:modelValue",re(Q({},t.modelValue),{[i]:r}))}const o=O(()=>{const i=[],r=Object.values(ue.fonts).map(p=>({value:p,label:p}));return Array.isArray(t.customFonts)&&t.customFonts.length>0&&(t.customFonts.forEach(p=>{i.push({value:p.name,label:p.name})}),i.push({value:"---",label:"---",disabled:!0})),[...i,...r]});return(i,r)=>(x(),$("div",Cf,[v(he,{"data-label":"select-font",class:"w-full","select-class":"h-7",width:"100%",size:"xs",disabled:t.disabled,options:o.value,"model-value":t.modelValue.fontFamily,"onUpdate:modelValue":r[0]||(r[0]=p=>a("fontFamily",p))},null,8,["disabled","options","model-value"])]))}},Mf=["disabled"],Tf={__name:"ColorDot",props:{color:{type:String,default:"#FFFFFF"},disabled:Boolean},emits:["update:color"],setup(e,{emit:l}){const s=l,t=e;return(a,o)=>(x(),Z(g(eo),{distance:6,placement:"left"},{popper:L(()=>[v(g(Kl),{color:e.color,"visible-formats":["hex"],"default-format":"hex","alpha-channel":"hide",onColorChange:o[0]||(o[0]=({cssColor:i})=>s("update:color",i))},null,8,["color"])]),default:L(()=>[n("button",{class:j(["block w-7 h-7 rounded text-neutral-700 ring-current",{"hover:text-blue-400 hover:ring-2":!t.disabled,"opacity-50":t.disabled}]),style:$e({"background-color":t.color,"box-shadow":"0 0 .3em rgba(0,0,0,.3) inset"}),disabled:t.disabled},null,14,Mf)]),_:1}))}},lt=Oe(Tf,[["__scopeId","data-v-09a896ee"]]),zf={class:"flex text-xs gap-3"},If={key:0,class:"flex gap-px"},Of=["disabled"],Df=["disabled"],Ef={key:1,class:"flex gap-px"},Uf=["disabled"],Lf=["disabled"],Rf=["disabled"],el={__name:"CustomizeFontStyleInput",props:{fontWeight:{type:Number,default:void 0},fontItalic:{type:Boolean,default:void 0},hideItalic:Boolean,fontSize:{type:String,default:void 0},color:{type:[String,Array],default:void 0},disabled:Boolean},emits:["update:fontWeight","update:fontItalic","update:fontSize","update:color"],setup(e,{emit:l}){const{fontWeights:s,fontSizes:t}=ue,a=l,o=e;function i(u,m){const b=[...o.color];b[u]=m,a("update:color",b)}function r(){const u=o.fontWeight===s.SEMIBOLD?s.REGULAR:s.SEMIBOLD;a("update:fontWeight",u)}function p(){a("update:fontItalic",!o.fontItalic)}const d=O(()=>{const u=o.fontWeight===s.SEMIBOLD,m=o.fontItalic!==void 0&&!o.hideItalic;return{"!bg-white !text-black":u,"rounded-r-none":m}}),f=O(()=>{const u=o.fontItalic,m=o.fontWeight!==void 0;return{"!bg-white !text-black":u,"rounded-l-none":m}});return(u,m)=>(x(),$("div",zf,[o.fontWeight!==void 0||o.fontItalic!==void 0&&!o.hideItalic?(x(),$("div",If,[o.fontWeight!==void 0?(x(),$("button",{key:0,class:j(["flex-none btn-ctrl bg-neutral-900 border-0 h-7 w-7 p-0 font-semibold",[d.value,{"opacity-50":o.disabled}]]),disabled:o.disabled,onClick:r}," B ",10,Of)):N("",!0),o.fontItalic!==void 0&&!o.hideItalic?(x(),$("button",{key:1,class:j(["flex-none btn-ctrl bg-neutral-900 border-0 h-7 w-7 p-0 italic font-mono font-semibold",[f.value,{"opacity-50":o.disabled}]]),disabled:o.disabled,onClick:p}," I ",10,Df)):N("",!0)])):N("",!0),o.fontSize!==void 0?(x(),$("div",Ef,[n("button",{class:j(["flex-none btn-ctrl bg-neutral-900 border-0 rounded-r-none h-7 w-7 p-0",{"!bg-white !text-black":o.fontSize===g(t).SM,"opacity-50":o.disabled}]),style:{"font-size":"10px"},disabled:o.disabled,onClick:m[0]||(m[0]=b=>
12a("update:fontSize",g(t).SM))}," A ",10,Uf),n("button",{class:j(["flex-none btn-ctrl bg-neutral-900 border-0 rounded-none h-7 w-7 p-0",{"!bg-white !text-black":o.fontSize===g(t).MD,"opacity-50":o.disabled}]),style:{"font-size":"14px"},disabled:o.disabled,onClick:m[1]||(m[1]=b=>a("update:fontSize",g(t).MD))}," A ",10,Lf),n("button",{class:j(["flex-none btn-ctrl bg-neutral-900 border-0 rounded-l-none h-7 w-7 p-0",{"!bg-white !text-black":o.fontSize===g(t).LG,"opacity-50":o.disabled}]),style:{"font-size":"18px"},disabled:o.disabled,onClick:m[2]||(m[2]=b=>a("update:fontSize",g(t).LG))}," A ",10,Rf)])):N("",!0),o.color!==void 0?(x(),$(ee,{key:2},[Array.isArray(o.color)?(x(!0),$(ee,{key:0},ge(o.color,(b,c)=>(x(),Z(lt,{key:c,color:b,disabled:o.disabled,"onUpdate:color":w=>i(c,w)},null,8,["color","disabled","onUpdate:color"]))),128)):(x(),Z(lt,{key:1,color:o.color,disabled:o.disabled,"onUpdate:color":m[3]||(m[3]=b=>a("update:color",b))},null,8,["color","disabled"]))],64)):N("",!0)]))}};function tl(e,l){const s=O({get:()=>e.settings.textContrast||rn.NONE,set:a=>l("textContrast",a)}),t=[{value:rn.NONE,label:"None"},{value:rn.DROP_SHADOW_HARD,label:"Drop Shadow (Hard)"},{value:rn.DROP_SHADOW_SOFT,label:"Drop Shadow (Soft)"},{value:rn.OUTLINE_HARD,label:"Outline (Hard)"},{value:rn.OUTLINE_SOFT,label:"Outline (Soft)"}];return{textContrast:s,textContrastOptions:t}}const yt={[J.DHHMMSS]:"1:17:30:59 (d:hh:mm:ss)",[J.DHHMMSSF]:"1:17:30:59.5 (d:hh:mm:ss.S)",[J.HHHMMSS]:"41:30:59 (hhh:mm:ss)",[J.HHHMMSSF]:"41:30:59.5 (hhh:mm:ss.S)",[J.MMMSS]:"230:59 (mmm:ss)",[J.MMMSSF]:"230:59.5 (mmm:ss:S)",[J.SSS]:"92 (sss)",[J.SSSF]:"92.5 (sss:S)",[J.L_D]:"2d",[J.L_DH]:"1d 18h",[J.L_DHM]:"1d 17h 30m",[J.L_DHMS]:"1d 17h 30m 59s",[J.L_HMS]:"41h 30m 59s",[J.L_MS]:"230m 59s",[J.L_S]:"92s"},nn={[ce.AUTO]:"Auto (with seconds)",[ce.AUTO_HHMM]:"Auto (without seconds)",[ce.HHMMSS]:"19:05:21",[ce.HHMM]:"19:05",[ce.HHMMSS_AM]:"7:05:21 PM",[ce.HHMM_AM]:"7:05 PM",[ce.HHMMSS_12H]:"7:05:21 (12h w/o AM/PM)",[ce.HHMM_12H]:"7:05 (12h w/o AM/PM)"},Zt={[Ge.CONTINUE]:"Continue counting past 0:00",[Ge.STOP]:"Stop counting at 0:00",[Ge.HIDE]:"Hide timer at 0:00"},Ga={[Xt.PLUS]:"Plus (+0:01)",[Xt.MINUS]:"Minus (-0:01)"},Af={class:"table-ctrl w-full"},_f={class:"whitespace-nowrap"},Ff={class:"whitespace-nowrap"},Bf={class:"whitespace-nowrap"},Pf={class:"whitespace-nowrap"},Nf={class:"flex gap-3"},Hf=["disabled"],Vf=["disabled"],jf=["disabled"],qf={class:"whitespace-nowrap"},Wf={class:"whitespace-nowrap"},Gf={class:"space-y-2"},Zl={__name:"TodSettings",props:{settings:{type:Object,default:()=>Xe[be.TIME_OF_DAY]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const{fonts:s,fontWeights:t,fontSizes:a}=ue,o=je("typefaces",[]),i=je("timezone",null),r=je("todFormat",ce.AUTO),p=l,d=e;function f(I,R){const T=re(Q({},d.settings),{[I]:R});p("update:settings",T)}const u=O(()=>d.settings.todFormat||null),m=O(()=>({fontFamily:d.settings.fontFamily||s.IBM_PLEX_MONO})),b=O(()=>d.settings.fontWeight||t.REGULAR),c=O(()=>d.settings.fontSize||a.MD),w=O(()=>d.settings.color||"#fff"),h=O(()=>d.settings.align||"center"),y=O(()=>d.settings.timezone||null),{textContrast:S,textContrastOptions:D}=tl(d,f),k=O({get:()=>d.settings.showTzAbbr||!1,set:I=>f("showTzAbbr",I)}),M=[{value:null,label:"Room Default: "+nn[r.value]},{value:"divider",label:"---",disabled:!0},...[ce.AUTO,ce.AUTO_HHMM,ce.HHMMSS,ce.HHMM,ce.HHMMSS_AM,ce.HHMM_AM,ce.HHMMSS_12H,ce.HHMM_12H].map(I=>({value:I,label:nn[I]}))];return(I,R)=>(x(),$("table",Af,[n("tbody",null,[n("tr",null,[n("th",_f,[v(Y,{tooltip:"Choose how the time of day is displayed (12-hour vs 24-hour format, with or without seconds)."},{default:L(()=>[...R[11]||(R[11]=[U(" Format ",-1)])]),_:1})]),n("td",null,[v(he,{"data-label":"customize-tod-format","select-class":"h-7 w-full",size:"xs",width:"100%",disabled:d.disabled,options:M,"model-value":u.value,"onUpdate:modelValue":R[0]||(R[0]=T=>f("todFormat",T))},null,8,["disabled","model-value"])])]),n("tr",null,[n("th",Ff,[v(Y,{tooltip:"Select the font family for the time of day display."},{default:L(()=>[...R[12]||(R[12]=[U(" Font ",-1)])]),_:1})]),n("td",null,[v(Cn,{"data-label":"customize-tod-font",disabled:d.disabled,"custom-fonts":g(o),"model-value":m.value,"onUpdate:modelValue":R[1]||(R[1]=T
12=>f("fontFamily",T.fontFamily))},null,8,["disabled","custom-fonts","model-value"])])]),n("tr",null,[n("th",Bf,[v(Y,{tooltip:"Customize the visual appearance of the time display including font weight, size, and color."},{default:L(()=>[...R[13]||(R[13]=[U(" Styling ",-1)])]),_:1})]),n("td",null,[v(el,{"data-label":"customize-tod-styling","add-timer-styles":"","hide-italic":"",disabled:d.disabled,"font-weight":b.value,"font-size":c.value,color:w.value,"onUpdate:fontWeight":R[2]||(R[2]=T=>f("fontWeight",T)),"onUpdate:fontSize":R[3]||(R[3]=T=>f("fontSize",T)),"onUpdate:color":R[4]||(R[4]=T=>f("color",T))},null,8,["disabled","font-weight","font-size","color"])])]),n("tr",null,[n("th",Pf,[v(Y,{tooltip:"Set the horizontal alignment of the time display."},{default:L(()=>[...R[14]||(R[14]=[U(" Align ",-1)])]),_:1})]),n("td",null,[n("div",Nf,[n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":h.value==="left","opacity-50":d.disabled}]),disabled:d.disabled,onClick:R[5]||(R[5]=T=>f("align","left"))}," Left ",10,Hf),n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":h.value==="center","opacity-50":d.disabled}]),disabled:d.disabled,onClick:R[6]||(R[6]=T=>f("align","center"))}," Center ",10,Vf),n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":h.value==="right","opacity-50":d.disabled}]),disabled:d.disabled,onClick:R[7]||(R[7]=T=>f("align","right"))}," Right ",10,jf)])])]),n("tr",null,[n("th",qf,[v(Y,{tooltip:"Add visual effects to improve text readability against backgrounds."},{default:L(()=>[...R[15]||(R[15]=[U(" Contrast ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:g(S),"onUpdate:modelValue":R[8]||(R[8]=T=>Gn(S)?S.value=T:null),size:"xs","select-class":"h-7 w-full",width:"100%",options:g(D),disabled:d.disabled},null,8,["modelValue","options","disabled"])])]),n("tr",null,[n("th",Wf,[v(Y,{tooltip:"Override the output's timezone for this specific element."},{default:L(()=>[...R[16]||(R[16]=[U(" Timezone ",-1)])]),_:1})]),n("td",Gf,[v(Zn,{"model-value":y.value,class:"h-7 w-full text-xs border-0 rounded",disabled:d.disabled,"room-default":g(i),dark:"","onUpdate:modelValue":R[9]||(R[9]=T=>f("timezone",T))},null,8,["model-value","disabled","room-default"]),v(Ne,{modelValue:k.value,"onUpdate:modelValue":R[10]||(R[10]=T=>k.value=T),class:"h-7 w-full text-xs","data-label":"cb-show-tz-abbr"},{default:L(()=>[...R[17]||(R[17]=[U(" Show timezone abbreviation ",-1)])]),_:1},8,["modelValue"])])])])]))}},Xf={class:"grid grid-cols-2 gap-2 mt-2 mb-6"},Yf={key:1,class:"w-full table-fixed table-ctrl"},Kf={key:2,class:"flex items-start gap-3 text-sm font-light"},Zf={key:3,class:"flex items-start gap-3 text-sm font-light"},Qf={class:"mt-8 pt-6 border-t border-neutral-700"},Jf={class:"mt-8 pt-6 border-t border-neutral-700 text-xs"},e0={__name:"BlackoutAside",props:{blackout:{type:Object,default:()=>Cu},showPreview:Boolean},emits:["close","update:blackout","update:preview"],setup(e,{emit:l}){const s=je("outputId"),t=l,a=e,o=F("color"),i=F(null),r=F(null),p=[{value:"contain",label:"Contain"},{value:"cover",label:"Cover"},{value:"100% 100%",label:"Stretch"}],d=[{value:"center",label:"Center"},{value:"top",label:"Top"},{value:"bottom",label:"Bottom"},{value:"left",label:"Left"},{value:"right",label:"Right"}];De(()=>{const y=a.blackout.style||"color";o.value=y,a.blackout.imageUrl&&(i.value=a.blackout.imageUrl),a.blackout.color?r.value=a.blackout.color:r.value="#000000",a.showPreview||t("update:preview",!0)});function f(y){y.color&&(r.value=y.color),y.imageUrl!==void 0&&(i.value=y.imageUrl),t("update:blackout",Q(Q({},a.blackout),y))}function u(y){switch(o.value=y,y){case"color":f({style:"color",color:r.value||"#000000",imageUrl:null});break;case"image":f({style:"image",imageUrl:i.value});break;case"background":f({style:"background"});break;case"transparent":f({style:"transparent"});break}}function m(y){i.value=y||null,f({imageUrl:y||null})}const b=O({get:()=>{var y;return((y=a.blackout.tod)==null?void 0:y.show)||!1},set:y=>c({show:y}
12)});function c(y){const S=Q(Q({},a.blackout.tod),y);f({tod:S})}const w=O({get:()=>a.showPreview,set:y=>t("update:preview",y)});function h(){a.showPreview&&t("update:preview",!1),t("close")}return(y,S)=>{const D=pe("FaIcon");return x(),Z($n,{title:"Customize Blackout",onClose:h},{default:L(()=>[n("div",Xf,[n("button",{type:"button",class:j(["btn-ctrl h-10 text-sm",{"bg-neutral-600 border-neutral-400 hover:!border-white":o.value==="color"}]),onClick:S[0]||(S[0]=k=>u("color"))}," Color ",2),n("button",{type:"button",class:j(["btn-ctrl h-10 text-sm",{"bg-neutral-600 border-neutral-400 hover:!border-white":o.value==="image"}]),onClick:S[1]||(S[1]=k=>u("image"))}," Image ",2),n("button",{type:"button",class:j(["btn-ctrl h-10 text-sm",{"bg-neutral-600 border-neutral-400 hover:!border-white":o.value==="transparent"}]),onClick:S[2]||(S[2]=k=>u("transparent"))}," Transparent ",2),n("button",{type:"button",class:j(["btn-ctrl h-10 text-sm",{"bg-neutral-600 border-neutral-400 hover:!border-white":o.value==="background"}]),onClick:S[3]||(S[3]=k=>u("background"))}," Use Background ",2)]),o.value==="color"?(x(),Z(g(Kl),{key:0,color:a.blackout.color||"#000000","visible-formats":["hex"],"default-format":"hex","alpha-channel":"hide",onColorChange:S[4]||(S[4]=({cssColor:k})=>f({color:k}))},null,8,["color"])):N("",!0),o.value==="image"?(x(),$("table",Yf,[n("tbody",null,[n("tr",null,[S[9]||(S[9]=n("th",null,"Image",-1)),n("td",null,[v(on,{class:"!h-32",img:i.value,"file-formats":["JPG","PNG","WEBP"],"base-path":"images/","post-url":`/files/for-output/${g(s)}`,"image-size":"cover","onUpdate:img":m},null,8,["img","post-url"])])]),n("tr",null,[S[10]||(S[10]=n("th",null,"Size",-1)),n("td",null,[v(he,{"model-value":a.blackout.imageSize||"cover",size:"xs",width:"100%",options:p,"onUpdate:modelValue":S[5]||(S[5]=k=>f({imageSize:k}))},null,8,["model-value"])])]),n("tr",null,[S[11]||(S[11]=n("th",null,"Position",-1)),n("td",null,[v(he,{"model-value":a.blackout.imagePosition||"center",size:"xs",width:"100%",options:d,disabled:!["contain","cover"].includes(a.blackout.imageSize||"cover"),"onUpdate:modelValue":S[6]||(S[6]=k=>f({imagePosition:k}))},null,8,["model-value","disabled"])])])])])):N("",!0),o.value==="background"?(x(),$("div",Kf,[v(D,{icon:g(Ot),class:"flex-none text-neutral-700 mt-0.5",size:"lg"},null,8,["icon"]),S[12]||(S[12]=n("div",{class:"space-y-1"},[n("h4",{class:"text-base text-neutral-300 font-semibold"}," Use current background "),n("p",null," Blackout will show the same background as configured for this output. If the background is transparent, the blackout will also be transparent. ")],-1))])):N("",!0),o.value==="transparent"?(x(),$("div",Zf,[v(D,{icon:g(Ot),class:"flex-none text-neutral-700 mt-0.5",size:"lg"},null,8,["icon"]),S[13]||(S[13]=n("div",{class:"space-y-1"},[n("h4",{class:"text-base text-neutral-300 font-semibold"}," Transparent blackout "),n("p",null," Blackout will be fully transparent regardless of the output background. Useful for overlay setups (e.g. NDI, vMix, OBS). ")],-1))])):N("",!0),n("div",Qf,[S[15]||(S[15]=n("h4",{class:"text-base text-neutral-300 font-semibold mb-4"}," Time of Day Display ",-1)),v(Ne,{modelValue:b.value,"onUpdate:modelValue":S[7]||(S[7]=k=>b.value=k),class:"mb-4 text-xs","data-label":"cb-blackout-show-tod"},{default:L(()=>[...S[14]||(S[14]=[U(" Show time of day during blackout ",-1)])]),_:1},8,["modelValue"]),b.value?(x(),Z(Zl,{key:0,settings:a.blackout.tod,"onUpdate:settings":c},null,8,["settings"])):N("",!0)]),n("div",Jf,[v(Ne,{modelValue:w.value,"onUpdate:modelValue":S[8]||(S[8]=k=>w.value=k),"data-label":"cb-blackout-preview"},{default:L(()=>[...S[16]||(S[16]=[U(" Preview blackout (local only) ",-1)])]),_:1},8,["modelValue"])])]),_:1})}}},t0=Oe(e0,[["__scopeId","data-v-50e02dd9"]]),n0={class:"bg-neutral-900 rounded px-3 py-2"},l0={key:0,class:"text-xs"},s0={key:1,class:"text-xs"},o0={class:"text-neutral-500"},Eo={__name:"ExperimentalAlert",props:{asTooltip:{type:[Boolean,String],default:!1}},setup(e){const l=e;return(s,t)=>{const a=Ct("tooltip");return me((x(),$("div",n0,[n("div",{class:j(["flex items-center gap-2 text-neutral-300 text-xs",{"hover:text-white cursor-default":l.asTooltip}])},[v(g(pt),{icon:g(Ot),size:"sm"},null,8,["icon"]),l.asTooltip?(x(),$("p",l0," Experimental Feature ")):(x(),$("p",s0,[t[3]||(t[3]=n("strong",null,"Experimental Feature: ",-1)),n("span",o0,[Ke(s.$slots,"default"),t[0]||(t[0]=U(" Please report bugs and suggestions to ",-1)),t[1]||(t[1]=n("a",{href:"mailto:[email protected]",class:"link text-current"},"[email protected]",-1)),t[2]||(t[2]=U(".",-1))])]))],2)])),[[a,l.asTooltip?[l.asTooltip,"Please report bugs and suggestions to [email protected]"].join(" "):void 0]])}}},a0={class:"space-y-4"},i0={key:0,class:"table-ctrl w-full"},r0={class:"flex grow"},u0={class:"text-sm"},d0={class:"ml-auto"},c0=["onClick"],m0={class:"text-sm text-neutral-500"},p0=["disabled"],f0=["disabled"],b0={class:"ml-2"},v0={key:1,class:"text-sm"},g0=3*1024*1024,h0={__name:"ManageFontsAside",props:{typefaces:{type:Array,default:()=>[]},disabled:Boolean},emits:["update:typefaces","close"],setup(e,{emit:l}){const s=l,t=e,a=je("outputId"),o=F(null),i=F(0),r=F(!1),p=O({get:()=>t.typefaces||[],set:u=>s("update:typefaces",u)});function d(u){return le(this,null,function*(){const[m]=u.target.files;if(!m)return;if(u.target.value="",m.size>g0){o.value=new Error(`Font file size exceeds 3MB limit (${(m.size/1024/1024).toFixed(2)}MB)`);return}const b=new FormData;b.append("path","typefaces/"),b.append("file",m),r.value=!0,o.value=null;try{const{data:c}=yield se({method:"post",url:`/files/for-output/${a.value}`,data:b,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:({loaded:h,total:y})=>{i.value=Math.round(h/y*100)}}),w=m.name.split(".").slice(0,-1).join(".");p.value=[...p.value,{name:w,url:c}]}catch(c){o.value=c}finally{r.value=!1,i.value=0}})}function f(u){p.value=p.value.filter(m=>m._id!==u)}return(u,m)=>{const b=Ct("tooltip");return x(),Z($n,{title:"Manage Fonts",onClose:m[1]||(m[1]=c=>s("close"))},{default:L(()=>{var c,w;return[n("div",a0,[(c=p.value)!=null&&c.length?(x(),$("table",i0,[n("tbody",null,[(x(!0),$(ee,null,ge(p.value,(h,y)=>(x(),$("tr",{key:h._id,class:"flex items-center"},[n("th",null,"Font #"+q(y+1),1),n("td",r0,[n("p",u0,q(h.name||"Unknown font"),1),n("div",d0,[me((x(),$("button",{class:"btn-ctrl text-xs text-neutral-500 h-full",onClick:S=>f(h._id)},[v(g(pt),{icon:g(en),size:"xs"},null,8,["icon"])],8,c0)),[[b,"Remove"]])])])]))),128))])])):N("",!0),me(n("p",m0," No custom fonts yet. ",512),[[An,!((w=p.value)!=null&&w.length)]]),n("div",null,[n("input",{ref:"fileInput",type:"file",class:"sr-only",accept:"font/otf,font/ttf,font/woff,font/woff2,.otf,.ttf,.woff,.woff2",disabled:e.disabled||r.value,onChange:d},null,40,p0),n("button",{type:"button",class:"btn-ctrl h-7",disabled:e.disabled||r.value,onClick:m[0]||(m[0]=()=>u.$refs.fileInput.click())},[v(g(pt),{icon:g(lo),size:"xs"},null,8,["icon"]),n("span",b0,q(r.value?`Uploading... ${i.value}%`:"Upload Font"),1)],8,f0)]),o.value?(x(),$("div",v0,[v(_t,{error:o.value},null,8,["error"])])):N("",!0),m[3]||(m[3]=n("p",{class:"text-xs text-neutral-400 bg-neutral-900 rounded p-3 mb-2"},"Upload custom fonts to use in your output elements. Supported formats: TTF, OTF, WOFF, WOFF2. Maximum file size: 3MB.",-1)),v(Eo,null,{default:L(()=>[...m[2]||(m[2]=[n("p",null,"Some fonts may not display properly in countdown timers. If you encounter issues, please report them.",-1)])]),_:1})])]}),_:1})}}},x0={class:"space-y-3"},w0=["data-label","onClick"],y0={class:"flex-1"},k0={class:"text-white"},$0={class:"text-xs text-neutral-500"},S0={class:"flex-none btn-ctrl p-0 w-8 h-8 leading-8 group-hover:border-white group-hover:text-white"},C0={__name:"AddElementAside",emits:["close","add:element"],setup(e,{emit:l}){const s=l;function t(a){s("add:element",a),s("close")}return(a,o)=>
12(x(),Z($n,{title:"Add Element",onClose:o[0]||(o[0]=i=>s("close"))},{default:L(()=>[n("div",x0,[(x(!0),$(ee,null,ge(g(Hn),(i,r)=>(x(),$("button",{key:r,class:"group flex items-center rounded text-left w-full py-2","data-label":`add-element-${r}`,onClick:p=>t(r)},[n("div",y0,[n("div",k0,q(i.name),1),n("div",$0,q(i.description),1)]),n("div",S0,[v(g(pt),{icon:g(sn),class:"-translate-y-px"},null,8,["icon"])])],8,w0))),128))])]),_:1}))}},M0={class:"table-ctrl w-full"},T0={class:"whitespace-nowrap"},z0=["disabled"],I0={class:"text-right"},O0={class:"inline-block text-xs text-neutral-500 underline",href:"/docs/messages/#using-placeholders",target:"_blank"},D0={class:"whitespace-nowrap"},E0={class:"whitespace-nowrap"},U0={class:"whitespace-nowrap"},L0={class:"flex gap-3"},R0=["disabled"],A0=["disabled"],_0=["disabled"],F0={class:"whitespace-nowrap"},B0={class:"whitespace-nowrap"},P0={__name:"TextSettings",props:{settings:{type:Object,default:()=>Xe[be.TEXT]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const{fonts:s,fontWeights:t,fontSizes:a}=ue,o=l,i=e,r=je("typefaces",[]),p=F(i.settings.text||"");Te(()=>i.settings.text,D=>{p.value=D});function d(D,k){const M=re(Q({},i.settings),{[D]:k});o("update:settings",M)}const f=O(()=>({fontFamily:i.settings.fontFamily||s.IBM_PLEX_MONO})),u=O(()=>i.settings.fontWeight||t.REGULAR),m=O(()=>i.settings.fontItalic||!1),b=O(()=>i.settings.fontSize||a.MD),c=O(()=>i.settings.color||"#fff"),w=O(()=>i.settings.align||"center"),h=O(()=>{var D;return(D=i.settings.allowWrap)!=null?D:!0}),{textContrast:y,textContrastOptions:S}=tl(i,d);return(D,k)=>(x(),$("table",M0,[n("tbody",null,[n("tr",null,[n("th",T0,[v(Y,{tooltip:"Enter the text to display. Use dynamic placeholders like `$NEXT_TITLE` to show live information from your rundown."},{default:L(()=>[...k[12]||(k[12]=[U(" Text ",-1)])]),_:1})]),n("td",null,[me(n("textarea",{"onUpdate:modelValue":k[0]||(k[0]=M=>p.value=M),type:"text",class:"input-ctrl text-sm w-full py-2",placeholder:"Enter text",rows:"5",disabled:i.disabled,onInput:k[1]||(k[1]=M=>d("text",M.target.value))},null,40,z0),[[ft,p.value]]),n("div",I0,[n("a",O0,[k[13]||(k[13]=U(" Available placeholders ",-1)),v(g(pt),{icon:g(kt),size:"sm"},null,8,["icon"])])])])]),n("tr",null,[n("th",D0,[v(Y,{tooltip:"Select the font family for the text display."},{default:L(()=>[...k[14]||(k[14]=[U(" Font ",-1)])]),_:1})]),n("td",null,[v(Cn,{"data-label":"customize-text-font",disabled:i.disabled,"custom-fonts":g(r),"model-value":f.value,"onUpdate:modelValue":k[2]||(k[2]=M=>d("fontFamily",M.fontFamily))},null,8,["disabled","custom-fonts","model-value"])])]),n("tr",null,[n("th",E0,[v(Y,{tooltip:"Customize the visual appearance of the text including font weight, size, and color."},{default:L(()=>[...k[15]||(k[15]=[U(" Styling ",-1)])]),_:1})]),n("td",null,[v(el,{"data-label":"customize-tod-styling",disabled:i.disabled,"font-weight":u.value,"font-italic":m.value,"font-size":b.value,color:c.value,"onUpdate:fontWeight":k[3]||(k[3]=M=>d("fontWeight",M)),"onUpdate:fontItalic":k[4]||(k[4]=M=>d("fontItalic",M)),"onUpdate:fontSize":k[5]||(k[5]=M=>d("fontSize",M)),"onUpdate:color":k[6]||(k[6]=M=>d("color",M))},null,8,["disabled","font-weight","font-italic","font-size","color"])])]),n("tr",null,[n("th",U0,[v(Y,{tooltip:"Set the horizontal alignment of the text on screen."},{default:L(()=>[...k[16]||(k[16]=[U(" Align ",-1)])]),_:1})]),n("td",null,[n("div",L0,[n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":w.value==="left","opacity-50":i.disabled}]),disabled:i.disabled,onClick:k[7]||(k[7]=M=>d("align","left"))}," Left ",10,R0),n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":w.value==="center","opacity-50":i.disabled}]),disabled:i.disabled,onClick:k[8]||(k[8]=M=>d("align","center"))}," Center ",10,A0),n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":w.value==="right","opacity-50":i.disabled}]),disabled:i.disabled,onClick:k[9]||(k[9]=M=>d("align","right"))}
12," Right ",10,_0)])])]),n("tr",null,[n("th",F0,[v(Y,{tooltip:"Control how text wraps within the container. When disabled, text will scale down to fit without breaking lines."},{default:L(()=>[...k[17]||(k[17]=[U(" Wrapping ",-1)])]),_:1})]),n("td",null,[v(Ne,{"model-value":h.value,class:"h-7 w-full text-xs",disabled:i.disabled,"onUpdate:modelValue":k[10]||(k[10]=M=>d("allowWrap",M))},{default:L(()=>[...k[18]||(k[18]=[U(" Allow automatic line breaks ",-1)])]),_:1},8,["model-value","disabled"])])]),n("tr",null,[n("th",B0,[v(Y,{tooltip:"Add visual effects to improve text readability against backgrounds."},{default:L(()=>[...k[19]||(k[19]=[U(" Contrast ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:g(y),"onUpdate:modelValue":k[11]||(k[11]=M=>Gn(y)?y.value=M:null),size:"xs","select-class":"h-7 w-full",width:"100%",options:g(S),disabled:i.disabled},null,8,["modelValue","options","disabled"])])])])]))}},N0={class:"table-ctrl w-full"},H0={class:"whitespace-nowrap"},V0={class:"whitespace-nowrap"},j0={class:"whitespace-nowrap"},q0={class:"whitespace-nowrap"},W0={__name:"ImageSettings",props:{settings:{type:Object,default:()=>Xe[be.IMAGE]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=je("outputId"),t=l,a=e,o=O({get:()=>a.settings.size,set:u=>f("size",u)}),i=O({get:()=>a.settings.position,set:u=>f("position",u)}),r=O({get:()=>a.settings.rounded||!1,set:u=>f("rounded",u)}),p=[{value:"contain",label:"Contain"},{value:"cover",label:"Cover"},{value:"100% 100%",label:"Stretch"}],d=[{value:"center",label:"Center"},{value:"top",label:"Top"},{value:"bottom",label:"Bottom"},{value:"left",label:"Left"},{value:"right",label:"Right"}];function f(u,m){t("update:settings",re(Q({},a.settings),{[u]:m}))}return(u,m)=>(x(),$("table",N0,[n("tbody",null,[n("tr",null,[n("th",H0,[v(Y,{tooltip:"Upload an image to display. Supported formats: JPG, PNG, WEBP, SVG."},{default:L(()=>[...m[4]||(m[4]=[U(" Image ",-1)])]),_:1})]),n("td",null,[v(on,{class:"!h-32","data-label":"customize-image-upload","file-formats":["JPG","PNG","WEBP","SVG"],"base-path":"images/","post-url":`/files/for-output/${g(s)}`,"image-size":"contain",disabled:e.disabled,img:a.settings.image,"onUpdate:img":m[0]||(m[0]=b=>f("image",b))},null,8,["post-url","disabled","img"])])]),n("tr",null,[n("th",V0,[v(Y,{tooltip:"Choose how the image fits within its container: `contain` (fit without cropping), `cover` (fill area, may crop), or `stretch` (distort to fill)."},{default:L(()=>[...m[5]||(m[5]=[U(" Size ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:o.value,"onUpdate:modelValue":m[1]||(m[1]=b=>o.value=b),size:"xs","select-class":"h-7 w-full",width:"100%",options:p,disabled:e.disabled},null,8,["modelValue","disabled"])])]),n("tr",null,[n("th",j0,[v(Y,{tooltip:"Set the position of the image within its container when using contain or cover sizing."},{default:L(()=>[...m[6]||(m[6]=[U(" Position ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:i.value,"onUpdate:modelValue":m[2]||(m[2]=b=>i.value=b),size:"xs","select-class":"h-7 w-full",width:"100%",options:d,disabled:e.disabled||!["contain","cover"].includes(o.value)},null,8,["modelValue","disabled"])])]),n("tr",null,[n("th",q0,[v(Y,{tooltip:"Add rounded corners to the image display."},{default:L(()=>[...m[7]||(m[7]=[U(" Corners ",-1)])]),_:1})]),n("td",null,[v(Ne,{modelValue:r.value,"onUpdate:modelValue":m[3]||(m[3]=b=>r.value=b),class:"h-7 w-full text-xs",disabled:e.disabled},{default:L(()=>[...m[8]||(m[8]=[U(" Enable rounded corners ",-1)])]),_:1},8,["modelValue","disabled"])])])])]))}},G0={class:"table-ctrl w-full"},X0={class:"whitespace-nowrap"},Y0=["disabled"],K0={class:"whitespace-nowrap"},Z0={class:"whitespace-nowrap"},Q0=["value","disabled"],J0={class:"whitespace-nowrap"},e1={key:0,class:"mt-2 p-2 text-xs bg-orange-900/50 text-orange-400 rounded"},t1={key:0},n1={class:"whitespace-nowrap"},l1={key:0,class:"mt-3 text-xs text-neutral-400"},s1={__name:"IframeSettings",props:{settings:{type:Object,default:()=>Xe[be.IFRAME]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=l,t=e,a=F(t.settings.src||""),o=F(t.settings.title||"Embedded Website");Te(()=>t.settings.src,b=>{a.value=b||""}),Te(()=>t.settings.title,b=>{o.value=b||"Embedded Website"});function i(b,c){const w=re(Q({},t.settings),{[b]:c});s("update:settings",w)}const r=O(()=>t.settings.scale||100),p=[{value:200,label:"200%"},{value:150,label:"150%"},{value:100,label:"100% (Normal)"},{value:75,label:"75%"},{value:50,label:"50%"},{value:33,label:"33%"},{value:25,label:"25%"}],d=O(()=>t.settings.scrollY||0),f=O(()=>t.settings.refreshInterval||0),u=[{value:0,label:"Never (Recommended)"},{value:6e4,label:"Every 1 minute"},{value:3e5,label:"Every 5 minutes"},{value:12e5,label:"Every 20 minutes"}],m=O(()=>t.settings.useScreenshot||!1);return(b,c)=>(x(),$(ee,null,[n("table",G0,[n("tbody",null,[n("tr",null,[n("th",X0,[v(Y,{tooltip:"Enter the full URL of the website to embed. Must start with http:// or https://"},{default:L(()=>[...c[7]||(c[7]=[U(" URL ",-1)])]),_:1})]),n("td",null,[me(n("input",{"onUpdate:modelValue":c[0]||(c[0]=w=>a.value=w),type:"url",class:"input-ctrl text-xs h-7 w-full",placeholder:"https://example.com",disabled:t.disabled,onInput:c[1]||(c[1]=w=>i("src",w.target.value)),onFocus:c[2]||(c[2]=w=>w.target.select())},null,40,Y0),[[ft,a.value]])])]),n("tr",null,[n("th",K0,[v(Y,{tooltip:"Scale the website content. Useful for fitting more content or making text larger."},{default:L(()=>[...c[8]||(c[8]=[U(" Scale ",-1)])]),_:1})]),n("td",null,[v(he,{"model-value":r.value,size:"xs","select-class":"h-7 w-full",width:"100%",options:p,disabled:t.disabled,"onUpdate:modelValue":c[3]||(c[3]=w=>
12i("scale",w))},null,8,["model-value","disabled"])])]),n("tr",null,[n("th",Z0,[v(Y,{tooltip:"Scroll down the page by this many pixels before displaying. Useful for skipping headers or navigation bars."},{default:L(()=>[...c[9]||(c[9]=[U(" Scroll ",-1)])]),_:1})]),n("td",null,[n("input",{type:"number",class:"input-ctrl text-xs h-7 w-full",value:d.value,min:0,step:50,disabled:t.disabled,onInput:c[4]||(c[4]=w=>i("scrollY",Math.max(0,parseInt(w.target.value)||0)))},null,40,Q0)])]),n("tr",null,[n("th",J0,[v(Y,{tooltip:"Automatically refresh the website at regular intervals. Warning: This performs a full page reload."},{default:L(()=>[...c[10]||(c[10]=[U(" Refresh ",-1)])]),_:1})]),n("td",null,[v(he,{"model-value":f.value,size:"xs","select-class":"h-7 w-full",width:"100%",options:u,disabled:t.disabled,"onUpdate:modelValue":c[5]||(c[5]=w=>i("refreshInterval",w))},null,8,["model-value","disabled"]),f.value>0?(x(),$("div",e1,[...c[11]||(c[11]=[n("strong",null,"â ï¸ Warning:",-1),U(" Auto-refresh performs a full page reload and may be disruptive during live shows. Use with caution. ",-1)])])):N("",!0)])]),(x(),$("tr",t1,[n("th",n1,[v(Y,{tooltip:"Use a screenshot instead of a live iframe. Works for sites that block embedding."},{default:L(()=>[...c[12]||(c[12]=[U(" Screenshot ",-1)])]),_:1})]),n("td",null,[v(Ne,{"model-value":m.value,class:"h-7 w-full text-xs",disabled:t.disabled,"onUpdate:modelValue":c[6]||(c[6]=w=>i("useScreenshot",w))},{default:L(()=>[...c[13]||(c[13]=[U(" Use screenshot image ",-1)])]),_:1},8,["model-value","disabled"])])]))])]),m.value?N("",!0):(x(),$("div",l1,[...c[14]||(c[14]=[U(" ð¡ ",-1),n("strong",null,"Tip:",-1),U(" Some websites prevent embedding. Enable the Screenshot option to display them as an image instead. ",-1)])]))],64))}},o1={class:"table-ctrl w-full"},a1={class:"whitespace-nowrap"},i1={class:"whitespace-nowrap"},r1={class:"whitespace-nowrap"},u1={class:"whitespace-nowrap"},d1={class:"flex gap-3"},c1=["disabled"],m1=["disabled"],p1=["disabled"],f1={class:"whitespace-nowrap"},b1={class:"whitespace-nowrap"},Hr={__name:"CdCuSettingsPartial",props:{settings:{type:Object,default:()=>Xe[be.TIME_OF_DAY]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const{fonts:s,fontWeights:t,fontSizes:a}=ue,o=je("countdownFormat",J.HHHMMSS),i=je("behavior",Ge.CONTINUE),r=je("typefaces",[]),p=l,d=e;function f(T,C){const E=re(Q({},d.settings),{[T]:C});p("update:settings",E)}const u=O(()=>d.settings.countdownFormat||null),m=O(()=>({fontFamily:d.settings.fontFamily||s.IBM_PLEX_MONO})),b=O(()=>d.settings.fontWeight||t.REGULAR),c=O(()=>d.settings.fontSize||a.MD),w=O(()=>d.settings.color||["#fff","#e9a23b","#dd524c"]),h=O(()=>d.settings.align||"center"),y=O(()=>d.settings.behavior||null),{textContrast:S,textContrastOptions:D}=tl(d,f),k=[J.DHHMMSS,J.DHHMMSSF,J.HHHMMSS,J.HHHMMSSF,J.MMMSS,J.MMMSSF,J.SSS,J.SSSF],M=[J.L_D,J.L_DH,J.L_DHM,J.L_DHMS,J.L_HMS,J.L_MS,J.L_S],I=[{value:null,label:"Room Default: "+yt[o.value]},{value:"divider",label:"---",disabled:!0},...k.map(T=>({value:T,label:yt[T]})),{value:"divider",label:"---",disabled:!0},...M.map(T=>({value:T,label:yt[T]}))],R=[{value:null,label:"Room Default: "+Zt[i.value]},{value:"divider",label:"---",disabled:!0},{value:Ge.CONTINUE,label:Zt[Ge.CONTINUE]},{value:Ge.STOP,label:Zt[Ge.STOP]},{value:Ge.HIDE,label:Zt[Ge.HIDE]}];return(T,C)=>(x(),$("table",o1,[n("tbody",null,[n("tr",null,[n("th",a1,[v(Y,{tooltip:"Choose how the countdown/count-up time is displayed (with days, hours, minutes, seconds, and decimal precision)."},{default:L(()=>[...C[10]||(C[10]=[U(" Format ",-1)])]),_:1})]),n("td",null,[v(he,{"select-class":"h-7 w-full",size:"xs",width:"100%",disabled:d.disabled,options:I,"model-value":u.value,"onUpdate:modelValue":C[0]||(C[0]=E=>f("countdownFormat",E))},null,8,["disabled","model-value"])])]),n("tr",null,[n("th",i1,[v(Y,{tooltip:"Select the font family for the countdown/count-up display."},{default:L(()=>[...C[11]||(C[11]=[U(" Font ",-1)])]),_:1})]),n("td",null,[v(Cn,{disabled:d.disabled,"custom-fonts":g(r),"model-value":m.value,"onUpdate:modelValue":C[1]||(C[1]=E=>f("fontFamily",E.fontFamily))},null,8,["disabled","custom-fonts","model-value"])])]),n("tr",null,[n("th",r1,[v(Y,{tooltip:"
12Customize the visual appearance including font weight, size, and colors. The three colors represent: normal time, yellow wrap-up warning, and red wrap-up warning."},{default:L(()=>[...C[12]||(C[12]=[U(" Styling ",-1)])]),_:1})]),n("td",null,[v(el,{"hide-italic":"",disabled:d.disabled,"font-weight":b.value,"font-size":c.value,color:w.value,"onUpdate:fontWeight":C[2]||(C[2]=E=>f("fontWeight",E)),"onUpdate:fontSize":C[3]||(C[3]=E=>f("fontSize",E)),"onUpdate:color":C[4]||(C[4]=E=>f("color",E))},null,8,["disabled","font-weight","font-size","color"])])]),n("tr",null,[n("th",u1,[v(Y,{tooltip:"Set the horizontal alignment of the timer display."},{default:L(()=>[...C[13]||(C[13]=[U(" Align ",-1)])]),_:1})]),n("td",null,[n("div",d1,[n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":h.value==="left","opacity-50":d.disabled}]),disabled:d.disabled,onClick:C[5]||(C[5]=E=>f("align","left"))}," Left ",10,c1),n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":h.value==="center","opacity-50":d.disabled}]),disabled:d.disabled,onClick:C[6]||(C[6]=E=>f("align","center"))}," Center ",10,m1),n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":h.value==="right","opacity-50":d.disabled}]),disabled:d.disabled,onClick:C[7]||(C[7]=E=>f("align","right"))}," Right ",10,p1)])])]),n("tr",null,[n("th",f1,[v(Y,{tooltip:"Add visual effects to improve text readability against backgrounds."},{default:L(()=>[...C[14]||(C[14]=[U(" Contrast ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:g(S),"onUpdate:modelValue":C[8]||(C[8]=E=>Gn(S)?S.value=E:null),size:"xs","select-class":"h-7 w-full",width:"100%",options:g(D),disabled:d.disabled},null,8,["modelValue","options","disabled"])])]),n("tr",null,[n("th",b1,[v(Y,{tooltip:"Choose what happens when the timer reaches 0:00."},{default:L(()=>[...C[15]||(C[15]=[U(" Behavior ",-1)])]),_:1})]),n("td",null,[v(he,{size:"xs","select-class":"h-7 w-full",width:"100%",disabled:d.disabled,options:R,"model-value":y.value,"onUpdate:modelValue":C[9]||(C[9]=E=>f("behavior",E))},null,8,["disabled","model-value"])])])])]))}},v1={key:0,class:"mb-3 bg-neutral-800/50 border border-neutral-700 rounded px-3 py-2 text-neutral-400 text-xs flex items-start gap-2"},Vr={__name:"TodNotice",props:{settings:{type:Object,required:!0},elementType:{type:String,required:!0}},setup(e){const l=e,s=wt(),t=O(()=>{const i=l.settings||{},r=Xe[l.elementType].tod;return i.todFormat!==r.todFormat||i.color!==r.color||i.fontFamily!==r.fontFamily||i.fontWeight!==r.fontWeight||i.fontSize!==r.fontSize||i.timezone!==r.timezone||i.showTzAbbr!==r.showTzAbbr||i.textContrast!==r.textContrast}),a=O(()=>{var r;const i=(r=s.active)==null?void 0:r.appearance;return[Ie.TOD,Ie.COUNTDOWN_TOD,Ie.COUNTUP_TOD].includes(i)}),o=O(()=>t.value&&!a.value);return(i,r)=>o.value?(x(),$("div",v1,[v(g(pt),{icon:g(Ot),size:"xs",class:"mt-0.5 flex-shrink-0 opacity-60"},null,8,["icon"]),r[0]||(r[0]=n("p",null,` Time of Day settings are configured but won't be visible with the current timer appearance. Change the appearance to include "Time of Day" to see these settings in action. `,-1))])):N("",!0)}},g1={class:"font-semibold text-neutral-500 mt-4 mb-2"},h1={class:"font-semibold text-neutral-500 mt-4 mb-2"},x1={__name:"TimerSettings",props:{settings:{type:Object,default:()=>Xe[be.TIMER]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=l,t=e;function a(o,i){const r=re(Q({},t.settings),{[o]:i});s("update:settings",r)}return(o,i)=>(x(),$(ee,null,[n("h4",g1,[v(Y,{tooltip:"Configure how the countdown or count-up timer appears when displayed on screen."},{default:L(()=>[...i[2]||(i[2]=[U(" Countdown / Count Up ",-1)])]),_:1})]),v(Hr,{class:"mb-3",settings:t.settings.timer,disabled:t.disabled,"onUpdate:settings":i[0]||(i[0]=r=>a("timer",r))},null,8,["settings","disabled"]),i[4]||(i[4]=n("hr",{class:"border-neutral-700 mb-3"},null,-1)),n("h4",h1,[v(Y,{tooltip:"Configure how the current time of day appears when displayed. To preview these settings, set the timer's appearance to include `Time of Day` (ToD)."},{default:L(()=>[...i[3]||(i[3]=[U(" Time of Day (Clock) ",-1)])]),_:1})]),v(Vr,{settings:t.settings.tod,"element-type":g(be).TIMER},null,8,["settings","element-type"]),v(Zl,{settings:t.settings.tod,disabled:t.disabled,"onUpdate:settings":i[1]||(i[1]=r=>a("tod",r))},null,8,["settings","disabled"])],64))}},w1={class:"table-ctrl w-full"},y1={class:"whitespace-nowrap"},k1={class:"whitespace-nowrap"},$1={class:"whitespace-nowrap"},S1={class:"flex gap-3"},C1=["disabled"],M1=["disabled"],T1=["disabled"],z1={class:"whitespace-nowrap"},jr={__name:"MessageSettings",props:{settings:{type:Object,default:()=>Xe[be.MESSAGE]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const{fonts:s,fontSizes:t}=ue,a=l,o=e,i=je("typefaces",[]);function r(w,h){const y=re(Q({},o.settings),{[w]:h});a("update:settings",y)}function p(w){const h=re(Q({},o.settings),{colorWhite:w[0]||"#fff",colorGreen:w[1]||"#5ec269",colorRed:w[2]||"#dd524c"});a("update:settings",h)}const d=O(()=>({fontFamily:o.settings.fontFamily||s.INTER})),f=O(()=>o.settings.fontSize||t.MD),u=O(()=>[o.settings.colorWhite||"#fff",o.settings.colorGreen||"#5ec269",o.settings.colorRed||"#dd524c"]),m=O(()=>o.settings.align||"left"),{textContrast:b,textContrastOptions:c}=tl(o,r);return(w,h)=>(x(),$(ee,null,[n("table",w1,[n("tbody",null,[n("tr",null,[n("th",y1,[v(Y,{tooltip:"Select the font family for message display."},{default:L(()=>[...h[6]||(h[6]=[U(" Font ",-1)])]),_:1})]),n("td",null,[v(Cn,{"data-label":"customize-message-font",disabled:o.disabled,"custom-fonts":g(i),"model-value":d.value,"onUpdate:modelValue":h[0]||(h[0]=y=>r("fontFamily",y.fontFamily))},null,8,["disabled","custom-fonts","model-value"])])]),n("tr",null,[n("th",k1,[v(Y,{tooltip:"
12Customize the visual appearance including font size and the three available message colors (white, green, red)."},{default:L(()=>[...h[7]||(h[7]=[U(" Styling ",-1)])]),_:1})]),n("td",null,[v(el,{"data-label":"customize-message-styling",disabled:o.disabled,"hide-font-weight":"","hide-italic":"","font-size":f.value,color:u.value,"onUpdate:fontSize":h[1]||(h[1]=y=>r("fontSize",y)),"onUpdate:color":p},null,8,["disabled","font-size","color"])])]),n("tr",null,[n("th",$1,[v(Y,{tooltip:"Set the horizontal alignment of the text on screen."},{default:L(()=>[...h[8]||(h[8]=[U(" Align ",-1)])]),_:1})]),n("td",null,[n("div",S1,[n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":m.value==="left","opacity-50":o.disabled}]),disabled:o.disabled,onClick:h[2]||(h[2]=y=>r("align","left"))}," Left ",10,C1),n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":m.value==="center","opacity-50":o.disabled}]),disabled:o.disabled,onClick:h[3]||(h[3]=y=>r("align","center"))}," Center ",10,M1),n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":m.value==="right","opacity-50":o.disabled}]),disabled:o.disabled,onClick:h[4]||(h[4]=y=>r("align","right"))}," Right ",10,T1)])])]),n("tr",null,[n("th",z1,[v(Y,{tooltip:"Add visual effects to improve text readability against backgrounds."},{default:L(()=>[...h[9]||(h[9]=[U(" Contrast ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:g(b),"onUpdate:modelValue":h[5]||(h[5]=y=>Gn(b)?b.value=y:null),size:"xs","select-class":"h-7 w-full",width:"100%",options:g(c),disabled:o.disabled},null,8,["modelValue","options","disabled"])])])])]),h[10]||(h[10]=n("div",{class:"mt-3 text-xs text-neutral-400"},[U(" ð¡ "),n("strong",null,"Tip:"),U(" Show a message from the controller to see it in the preview above. ")],-1))],64))}},I1={class:"font-semibold text-neutral-500 mt-4 mb-2"},O1={class:"font-semibold text-neutral-500 mt-4 mb-2"},D1={class:"font-semibold text-neutral-500 mt-4 mb-2"},E1={__name:"TimerMessageComboSettings",props:{settings:{type:Object,default:()=>Xe[be.TIMER_MESSAGE_COMBO]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=l,t=e;function a(o,i){const r=re(Q({},t.settings),{[o]:i});s("update:settings",r)}return(o,i)=>(x(),$(ee,null,[n("h4",I1,[v(Y,{tooltip:"Configure how the countdown or count-up timer appears when displayed on screen."},{default:L(()=>[...i[3]||(i[3]=[U(" Countdown / Count Up ",-1)])]),_:1})]),v(Hr,{class:"mb-3",settings:t.settings.timer,disabled:t.disabled,"onUpdate:settings":i[0]||(i[0]=r=>a("timer",r))},null,8,["settings","disabled"]),i[6]||(i[6]=n("hr",{class:"border-neutral-700 mb-3"},null,-1)),n("h4",O1,[v(Y,{tooltip:"Configure how the current time of day appears when displayed. To preview these settings, set the timer's appearance to include `Time of Day` (ToD)."},{default:L(()=>[...i[4]||(i[4]=[U(" Time of Day (Clock) ",-1)])]),_:1})]),v(Vr,{settings:t.settings.tod,"element-type":g(be).TIMER_MESSAGE_COMBO},null,8,["settings","element-type"]),v(Zl,{class:"mb-3",settings:t.settings.tod,disabled:t.disabled,"onUpdate:settings":i[1]||(i[1]=r=>a("tod",r))},null,8,["settings","disabled"]),i[7]||(i[7]=n("hr",{class:"border-neutral-700 mb-3"},null,-1)),n("h4",D1,[v(Y,{tooltip:"Configure the appearance and styling of messages displayed on screen."},{default:L(()=>[...i[5]||(i[5]=[U(" Messages ",-1)])]),_:1})]),v(jr,{settings:t.settings.message,disabled:t.disabled,"onUpdate:settings":i[2]||(i[2]=r=>a("message",r))},null,8,["settings","disabled"])],64))}},U1={class:"table-ctrl w-full"},L1={class:"whitespace-nowrap"},R1={class:"flex gap-3 text-xs"},A1={class:"whitespace-nowrap"},_1={class:"flex gap-3"},F1={__name:"ProgressBarSettings",props:{settings:{type:Object,default:()=>Xe[be.PROGRESS_BAR]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=l,t=e;function a(u,m){s("update:settings",re(Q({},t.settings),{[u]:m}))}function o(u,m){const b=[...r.value];b[u]=m,a("color",b)}function i(u,m){const b=[...d.value];b[u]=m,a("playheadColor",b)}const r=O(()=>
12t.settings.color||["#fff","#e9a23b","#dd524c"]),p=O(()=>t.settings.playheadShape||"triangle"),d=O(()=>t.settings.playheadColor||["#fff","#000"]),f=[{value:"triangle-a",label:"Triangle A"},{value:"triangle-b",label:"Triangle B"},{value:"circle-a",label:"Circle A"},{value:"circle-b",label:"Circle B"},{value:"traditional-a",label:"Traditional A"},{value:"traditional-b",label:"Traditional B"},{value:"none",label:"None"}];return(u,m)=>(x(),$("table",U1,[n("tbody",null,[n("tr",null,[n("th",L1,[v(Y,{tooltip:"Set the colors for progress bar segments: `normal` time (green), `yellow` wra-up time, and `red` wrap-up time."},{default:L(()=>[...m[1]||(m[1]=[U(" Colors ",-1)])]),_:1})]),n("td",null,[n("div",R1,[(x(!0),$(ee,null,ge(r.value,(b,c)=>(x(),Z(lt,{key:c,color:b,disabled:t.disabled,"onUpdate:color":w=>o(c,w)},null,8,["color","disabled","onUpdate:color"]))),128))])])]),n("tr",null,[n("th",A1,[v(Y,{tooltip:"Choose the shape, fill and stroke colors of the playhead indicator that shows the current progress position."},{default:L(()=>[...m[2]||(m[2]=[U(" Playhead ",-1)])]),_:1})]),n("td",_1,[v(he,{"data-label":"playhead-shape",class:"flex-1","select-class":"h-7 w-full",size:"xs",width:"100%",disabled:t.disabled,options:f,"model-value":p.value,"onUpdate:modelValue":m[0]||(m[0]=b=>a("playheadShape",b))},null,8,["disabled","model-value"]),(x(!0),$(ee,null,ge(d.value,(b,c)=>(x(),Z(lt,{key:"dot-"+c,class:"flex-none",color:b,disabled:t.disabled,"onUpdate:color":w=>i(c,w)},null,8,["color","disabled","onUpdate:color"]))),128))])])])]))}},B1={class:"table-ctrl w-full"},P1={class:"whitespace-nowrap"},N1={class:"flex gap-3 text-xs"},H1={class:"whitespace-nowrap"},V1={class:"flex items-center gap-3"},j1=["disabled","value"],q1={__name:"ProgressRingSettings",props:{settings:{type:Object,default:()=>Xe[be.PROGRESS_RING]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=l,t=e;function a(f,u){s("update:settings",re(Q({},t.settings),{[f]:u}))}function o(f,u){const m=[...i.value];m[f]=u,a("color",m)}const i=O(()=>t.settings.color||["#22C55D","#F59E0C","#EF4444"]),r=O(()=>t.settings.strokeWidth||4),p=O(()=>t.settings.lineCap||"round"),d=[{value:"round",label:"Round Caps"},{value:"butt",label:"Square Caps"}];return(f,u)=>(x(),$("table",B1,[n("tbody",null,[n("tr",null,[n("th",P1,[v(Y,{tooltip:"Set the colors for progress ring segments: `normal` time (green), `yellow` wrap-up time, and `red` wrap-up time."},{default:L(()=>[...u[2]||(u[2]=[U(" Colors ",-1)])]),_:1})]),n("td",null,[n("div",N1,[(x(!0),$(ee,null,ge(i.value,(m,b)=>(x(),Z(lt,{key:b,color:m,disabled:t.disabled,"onUpdate:color":c=>o(b,c)},null,8,["color","disabled","onUpdate:color"]))),128))])])]),n("tr",null,[n("th",H1,[v(Y,{tooltip:"Adjust the thickness and cap style of the progress ring stroke."},{default:L(()=>[...u[3]||(u[3]=[U(" Stroke ",-1)])]),_:1})]),n("td",V1,[v(he,{"data-label":"line-cap",class:"flex-1 w-1/2","select-class":"h-7 w-full",size:"xs",width:"100%",disabled:t.disabled,options:d,"model-value":p.value,"onUpdate:modelValue":u[0]||(u[0]=m=>a("lineCap",m))},null,8,["disabled","model-value"]),n("input",{type:"range",class:"flex-1 w-1/2 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer slider",min:1,max:7,step:.5,disabled:t.disabled,value:r.value,onInput:u[1]||(u[1]=m=>a("strokeWidth",Number(m.target.value)))},null,40,j1)])])])]))}},W1={class:"font-semibold text-neutral-500 mt-4 mb-2"},G1={class:"table-ctrl w-full mb-3"},X1={class:"whitespace-nowrap"},Y1={class:"grid grid-cols-4 gap-1"},K1=["disabled","onClick"],Z1={class:"whitespace-nowrap"},Q1={class:"grid grid-cols-4 gap-1"},J1=["disabled","onClick"],eb={class:"font-semibold text-neutral-500 mt-4 mb-2"},tb={class:"table-ctrl w-full mb-3"},nb={class:"space-y-2"},lb={class:"font-semibold text-neutral-500 mt-4 mb-2"},sb={class:"table-ctrl w-full mb-3"},ob={class:"whitespace-nowrap"},ab={class:"font-semibold text-neutral-500 mt-4 mb-2"},ib={class:"table-ctrl w-full"},rb={class:"whitespace-nowrap"},ub={class:"whitespace-nowrap"},db={class:"space-y-2"},cb={__name:"TransportControlSettings",props:{settings:{type:Object,default:()=>Xe[be.TRANSPORT_CONTROL]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=je("countdownFormat",J.HHHMMSS),t=je("todFormat",ce.AUTO),a=je("timezone",null),o=e,i=l,r={subtract:["-1s","-5s","-10s","-20s","-30s","-1m","-2m","-5m"],add:["+1s","+5s","+10s","+20s","+30s","+1m","+2m","+5m"]}
12,p=O(()=>o.settings.leftTweakButtons||["-1m"]),d=O(()=>o.settings.rightTweakButtons||["+1m"]),f=O(()=>o.settings.countdownFormat||null),u=O(()=>o.settings.todFormat||null),m=O(()=>o.settings.timezone||null),b=O({get:()=>o.settings.showProgressBar!==!1,set:T=>D("showProgressBar",T)}),c=O({get:()=>o.settings.showTimer!==!1,set:T=>{D("showTimer",T)}}),w=O({get:()=>o.settings.showTimeOfDay!==!1,set:T=>D("showTimeOfDay",T)}),h=O({get:()=>o.settings.showTimezone!==!1,set:T=>D("showTimezone",T)});function y(T){if(o.disabled)return;const C=[...p.value],E=C.indexOf(T);E>-1?C.splice(E,1):C.length<3&&(C.push(T),C.sort((_,P)=>r.subtract.indexOf(P)-r.subtract.indexOf(_))),D("leftTweakButtons",C)}function S(T){if(o.disabled)return;const C=[...d.value],E=C.indexOf(T);E>-1?C.splice(E,1):C.length<3&&(C.push(T),C.sort((_,P)=>r.add.indexOf(_)-r.add.indexOf(P))),D("rightTweakButtons",C)}function D(T,C){const E=re(Q({},o.settings),{[T]:C});i("update:settings",E)}const k=[J.DHHMMSS,J.DHHMMSSF,J.HHHMMSS,J.HHHMMSSF,J.MMMSS,J.MMMSSF,J.SSS,J.SSSF],M=[J.L_D,J.L_DH,J.L_DHM,J.L_DHMS,J.L_HMS,J.L_MS,J.L_S],I=[{value:null,label:"Room Default: "+yt[s.value]},{value:"divider",label:"---",disabled:!0},...k.map(T=>({value:T,label:yt[T]})),{value:"divider",label:"---",disabled:!0},...M.map(T=>({value:T,label:yt[T]}))],R=[{value:null,label:"Room Default: "+nn[t.value]},{value:"divider",label:"---",disabled:!0},...[ce.AUTO,ce.AUTO_HHMM,ce.HHMMSS,ce.HHMM,ce.HHMMSS_AM,ce.HHMM_AM,ce.HHMMSS_12H,ce.HHMM_12H].map(T=>({value:T,label:nn[T]}))];return(T,C)=>(x(),$(ee,null,[n("h4",W1,[v(Y,{tooltip:"Configure transport control buttons for adjusting timer values by preset amounts."},{default:L(()=>[...C[7]||(C[7]=[U(" Tweak Buttons ",-1)])]),_:1})]),n("table",G1,[n("tbody",null,[n("tr",null,[n("th",X1,[v(Y,{tooltip:"Choose which tweak buttons appear on the left side (subtract time). Maximum 3 buttons."},{default:L(()=>[...C[8]||(C[8]=[U(" Subtract ",-1)])]),_:1})]),n("td",null,[n("div",Y1,[(x(!0),$(ee,null,ge(r.subtract,E=>(x(),$("button",{key:E,class:j(["btn-ctrl h-7 text-xs py-0",{"text-white bg-blue-600 border-blue-500 hover:!border-blue-300":p.value.includes(E)}]),disabled:!p.value.includes(E)&&p.value.length>=3||o.disabled,onClick:_=>y(E)},q(E),11,K1))),128))])])]),n("tr",null,[n("th",Z1,[v(Y,{tooltip:"Choose which tweak buttons appear on the right side (add time). Maximum 3 buttons."},{default:L(()=>[...C[9]||(C[9]=[U(" Add ",-1)])]),_:1})]),n("td",null,[n("div",Q1,[(x(!0),$(ee,null,ge(r.add,E=>(x(),$("button",{key:E,class:j(["btn-ctrl h-7 text-xs py-0",{"text-white bg-blue-600 border-blue-500 hover:!border-blue-300":d.value.includes(E)}]),disabled:!d.value.includes(E)&&d.value.length>=3||o.disabled,onClick:_=>S(E)},q(E),11,J1))),128))])])])])]),C[21]||(C[21]=n("hr",{class:"border-neutral-700 mb-3"},null,-1)),n("h4",eb,[v(Y,{tooltip:"Configure which visual elements are displayed in the transport control interface."},{default:L(()=>[...C[10]||(C[10]=[U(" Display Options ",-1)])]),_:1})]),n("table",tb,[n("tbody",null,[n("tr",null,[C[14]||(C[14]=n("th",{class:"whitespace-nowrap"},"Display",-1)),n("td",null,[n("div",nb,[v(Ne,{modelValue:w.value,"onUpdate:modelValue":C[0]||(C[0]=E=>w.value=E),disabled:o.disabled,class:"h-7 w-full text-xs"},{default:L(()=>[...C[11]||(C[11]=[U(" Show Time of Day ",-1)])]),_:1},8,["modelValue","disabled"]),v(Ne,{modelValue:c.value,"onUpdate:modelValue":C[1]||(C[1]=E=>c.value=E),disabled:o.disabled,class:"h-7 w-full text-xs"},{default:L(()=>[...C[12]||(C[12]=[U(" Show Timer ",-1)])]),_:1},8,["modelValue","disabled"]),v(Ne,{modelValue:b.value,"onUpdate:modelValue":C[2]||(C[2]=E=>b.value=E),disabled:o.disabled,class:"h-7 w-full text-xs"},{default:L(()=>[...C[13]||(C[13]=[U(" Show Progress Bar ",-1)])]),_:1},8,["modelValue","disabled"])])])])])]),C[22]||(C[22]=n("hr",{class:"border-neutral-700 mb-3"},null,-1)),n("h4",lb,[v(Y,{tooltip:"Configure how the countdown timer appears when displayed on screen."},{default:L(()=>[...C[15]||(C[15]=[U(" Countdown ",-1)])]),_:1})]),n("table",sb,[n("tbody",null,[n("tr",null,[n("th",ob,[v(Y,{tooltip:"Choose how the countdown timer is displayed (with hours, minutes, seconds, and decimal precision)."},{default:L(()=>[...C[16]||(C[16]=[U(" Format ",-1)])]),_:1})]),n("td",null,[v(he,{"select-class":"h-7 w-full",size:"xs",width:"100%",disabled:o.disabled,options:I,"model-value":f.value,"onUpdate:modelValue":C[3]||(C[3]=E=>D("countdownFormat",E))},null,8,["disabled","model-value"])])])])]),C[23]||(C[23]=n("hr",{class:"border-neutral-700 mb-3"}
12,null,-1)),n("h4",ab,[v(Y,{tooltip:"Configure how the current time of day appears when displayed."},{default:L(()=>[...C[17]||(C[17]=[U(" Clock ",-1)])]),_:1})]),n("table",ib,[n("tbody",null,[n("tr",null,[n("th",rb,[v(Y,{tooltip:"Choose how the time of day is displayed (12-hour vs 24-hour format, with or without seconds)."},{default:L(()=>[...C[18]||(C[18]=[U(" Format ",-1)])]),_:1})]),n("td",null,[v(he,{"select-class":"h-7 w-full",size:"xs",width:"100%",disabled:!w.value||o.disabled,options:R,"model-value":u.value,"onUpdate:modelValue":C[4]||(C[4]=E=>D("todFormat",E))},null,8,["disabled","model-value"])])]),n("tr",null,[n("th",ub,[v(Y,{tooltip:"Override the output's timezone for the time of day display in this element."},{default:L(()=>[...C[19]||(C[19]=[U(" Timezone ",-1)])]),_:1})]),n("td",db,[v(Zn,{"model-value":m.value,class:"h-7 w-full text-xs border-0 rounded",disabled:!w.value||o.disabled,"room-default":g(a),dark:"","onUpdate:modelValue":C[5]||(C[5]=E=>D("timezone",E))},null,8,["model-value","disabled","room-default"]),v(Ne,{modelValue:h.value,"onUpdate:modelValue":C[6]||(C[6]=E=>h.value=E),disabled:!w.value||o.disabled,class:"h-7 w-full text-xs"},{default:L(()=>[...C[20]||(C[20]=[U(" Show timezone abbreviation ",-1)])]),_:1},8,["modelValue","disabled"])])])])])],64))}},mb=Oe(cb,[["__scopeId","data-v-ddd4313c"]]),pb={class:"font-semibold mb-3"},fb={class:"table-ctrl w-full mb-3"},bb={class:"space-y-2"},vb={__name:"ModeratorSettings",props:{settings:{type:Object,default:()=>Xe[be.MODERATOR]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=e,t=l,a=O({get:()=>s.settings.showHeader!==!1,set:r=>i("showHeader",r)}),o=O({get:()=>s.settings.showAddButton!==!1,set:r=>i("showAddButton",r)});function i(r,p){const d=re(Q({},s.settings),{[r]:p});t("update:settings",d)}return(r,p)=>(x(),$(ee,null,[n("h4",pb,[v(Y,{tooltip:"Configure which control buttons are visible in the rendered output."},{default:L(()=>[...p[2]||(p[2]=[U(" Button Visibility ",-1)])]),_:1})]),n("table",fb,[n("tbody",null,[n("tr",null,[p[5]||(p[5]=n("th",{class:"whitespace-nowrap"},"Display",-1)),n("td",null,[n("div",bb,[v(Ne,{modelValue:a.value,"onUpdate:modelValue":p[0]||(p[0]=d=>a.value=d),disabled:s.disabled,class:"h-7 w-full text-xs"},{default:L(()=>[...p[3]||(p[3]=[U(" Show Header ",-1)])]),_:1},8,["modelValue","disabled"]),v(Ne,{modelValue:o.value,"onUpdate:modelValue":p[1]||(p[1]=d=>o.value=d),disabled:s.disabled,class:"h-7 w-full text-xs"},{default:L(()=>[...p[4]||(p[4]=[U(" Show Add Message Button ",-1)])]),_:1},8,["modelValue","disabled"])])])])])])],64))}},gb={class:"table-ctrl w-full"},hb={class:"whitespace-nowrap"},xb={class:"grid grid-cols-2 gap-2"},wb={class:"flex items-center space-x-2"},yb=["checked","disabled"],kb={class:"flex items-center space-x-2"},$b=["checked","disabled"],Sb={class:"flex items-center space-x-2"},Cb=["checked","disabled"],Mb={class:"flex items-center space-x-2"},Tb=["checked","disabled"],zb={class:"whitespace-nowrap"},Ib={class:"space-y-2"},Ob={class:"flex items-center space-x-2"},Db=["checked","disabled"],Eb={class:"flex items-center space-x-2"},Ub=["checked","disabled"],Lb={class:"whitespace-nowrap"},Rb={class:"whitespace-nowrap"},Ab={class:"whitespace-nowrap"},_b={class:"flex items-baseline gap-3 whitespace-nowrap",cellspan:"2"},Fb=["disabled"],Bb={class:"flex items-center gap-3"},Pb={class:"flex items-center gap-2"},Nb={class:"flex items-center gap-2"},Hb={class:"whitespace-nowrap"},Vb={class:"flex items-center gap-3"},jb={class:"flex items-center gap-2"},qb={class:"flex items-center gap-2"},Wb={class:"whitespace-nowrap"},Gb={class:"flex items-center gap-3"},Xb={class:"flex items-center gap-2"},Yb={class:"flex items-center gap-2"},Kb={__name:"AgendaSettings",props:{settings:{type:Object,default:()=>Xe[be.AGENDA]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const{fonts:s,fontWeights:t}=ue,a=l,o=e,i=je("typefaces",[]);function r(w,h){const y=re(Q({},o.settings),{[w]:h});a("update:settings",y)}const p=Xe[be.AGENDA];function d(){const w=re(Q({},o.settings),{colorDefault:p.colorDefault,colorActive:p.colorActive,colorActiveRunning:p.colorActiveRunning,textColorDefault:p.textColorDefault,textColorActive:p.textColorActive,textColorActiveRunning:p.textColorActiveRunning});a("update:settings",w)}const f=O(()=>({fontFamily:o.settings.fontFamily||s.INTER})),u=O({get:()=>o.settings.fontWeight||t.REGULAR,set:w=>r("fontWeight",w)}),m=O(()=>[{value:t.LIGHT,label:"Light"},{value:t.REGULAR,label:"Regular"},{value:t.MEDIUM,label:"Medium"},{value:t.SEMIBOLD,label:"Semibold"},{value:t.BOLD,label:"Bold"}]),{textContrast:b,textContrastOptions:c}=tl(o,r);return(w,h)=>(x(),$("table",gb,[n("tbody",null,[n("tr",null,[n("th",hb,[v(Y,{tooltip:"
12Configure what information to display for each agenda item"},{default:L(()=>[...h[15]||(h[15]=[U(" Display ",-1)])]),_:1})]),n("td",null,[n("div",xb,[n("label",wb,[n("input",{type:"checkbox",checked:e.settings.showStartEnd,disabled:e.disabled,onChange:h[0]||(h[0]=y=>r("showStartEnd",y.target.checked))},null,40,yb),h[16]||(h[16]=n("span",{class:"text-xs"},"Start/End",-1))]),n("label",kb,[n("input",{type:"checkbox",checked:e.settings.showDuration,disabled:e.disabled,onChange:h[1]||(h[1]=y=>r("showDuration",y.target.checked))},null,40,$b),h[17]||(h[17]=n("span",{class:"text-xs"},"Duration",-1))]),n("label",Sb,[n("input",{type:"checkbox",checked:e.settings.showNotes,disabled:e.disabled,onChange:h[2]||(h[2]=y=>r("showNotes",y.target.checked))},null,40,Cb),h[18]||(h[18]=n("span",{class:"text-xs"},"Notes",-1))]),n("label",Mb,[n("input",{type:"checkbox",checked:e.settings.showLabels,disabled:e.disabled,onChange:h[3]||(h[3]=y=>r("showLabels",y.target.checked))},null,40,Tb),h[19]||(h[19]=n("span",{class:"text-xs"},"Labels",-1))])])])]),n("tr",null,[n("th",zb,[v(Y,{tooltip:"Configure scrolling behavior for the agenda"},{default:L(()=>[...h[20]||(h[20]=[U(" Scrolling ",-1)])]),_:1})]),n("td",null,[n("div",Ib,[n("label",Ob,[n("input",{type:"checkbox",checked:e.settings.autoScrollToActive,disabled:e.disabled,onChange:h[4]||(h[4]=y=>r("autoScrollToActive",y.target.checked))},null,40,Db),h[21]||(h[21]=n("span",{class:"text-xs"},"Auto-scroll to active",-1))]),n("label",Eb,[n("input",{type:"checkbox",checked:e.settings.showScrollbar,disabled:e.disabled,onChange:h[5]||(h[5]=y=>r("showScrollbar",y.target.checked))},null,40,Ub),h[22]||(h[22]=n("span",{class:"text-xs"},"Show scrollbar",-1))])])])]),h[37]||(h[37]=n("tr",null,[n("th",{class:"whitespace-nowrap",cellspan:"2"},[n("h4",{class:"font-semibold text-neutral-500 mt-4 mb-2"}," Typography ")])],-1)),n("tr",null,[n("th",Lb,[v(Y,{tooltip:"Select the font family for the agenda display"},{default:L(()=>[...h[23]||(h[23]=[U(" Font ",-1)])]),_:1})]),n("td",null,[v(Cn,{"data-label":"customize-agenda-font",disabled:e.disabled,"custom-fonts":g(i),"model-value":f.value,"onUpdate:modelValue":h[6]||(h[6]=y=>r("fontFamily",y.fontFamily))},null,8,["disabled","custom-fonts","model-value"])])]),n("tr",null,[n("th",Rb,[v(Y,{tooltip:"Select the font weight for the agenda text"},{default:L(()=>[...h[24]||(h[24]=[U(" Weight ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:u.value,"onUpdate:modelValue":h[7]||(h[7]=y=>u.value=y),size:"xs","select-class":"h-7 w-full",width:"100%",options:m.value,disabled:e.disabled},null,8,["modelValue","options","disabled"])])]),n("tr",null,[n("th",Ab,[v(Y,{tooltip:"Add visual effects to improve text readability against backgrounds"},{default:L(()=>[...h[25]||(h[25]=[U(" Contrast ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:g(b),"onUpdate:modelValue":h[8]||(h[8]=y=>Gn(b)?b.value=y:null),size:"xs","select-class":"h-7 w-full",width:"100%",options:g(c),disabled:e.disabled},null,8,["modelValue","options","disabled"])])]),n("tr",null,[n("th",_b,[h[27]||(h[27]=n("h4",{class:"font-semibold text-neutral-500 mt-4 mb-2 flex items-center justify-between"}," Colors ",-1)),n("button",{class:j(["rounded hover:text-neutral-400 px-1",{"opacity-50 cursor-not-allowed":e.disabled}]),disabled:e.disabled,onClick:d},[v(g(pt),{icon:g(Ti),size:"xs",class:"mr-0.5"},null,8,["icon"]),h[26]||(h[26]=U(" Reset ",-1))],10,Fb)])]),n("tr",null,[n("th",null,[v(Y,{tooltip:"Colors for default (non-active) agenda items"},{default:L(()=>[...h[28]||(h[28]=[U(" Default ",-1)])]),_:1})]),n("td",null,[n("div",Bb,[n("div",Pb,[h[29]||(h[29]=n("label",{class:"text-xs text-neutral-400"},"BG",-1)),v(lt,{color:e.settings.colorDefault,disabled:e.disabled,"onUpdate:color":h[9]||(h[9]=y=>r("colorDefault",y))},null,8,["color","disabled"])]),n("div",Nb,[h[30]||(h[30]=n("label",{class:"text-xs text-neutral-400"},"Text",-1)),v(lt,{color:e.settings.textColorDefault,disabled:e.disabled,"onUpdate:color":h[10]||(h[10]=y=>r("textColorDefault",y))},null,8,["color","disabled"])])])])]),n("tr",null,[n("th",Hb,[v(Y,{tooltip:"Colors for the active timer (not running)"},{default:L(()=>[...h[31]||(h[31]=[U(" Active ",-1)])]),_:1})]),n("td",null,[n("div",Vb,[n("div",jb,[h[32]||(h[32]=n("label",{class:"text-xs text-neutral-400"},"BG",-1)),v(lt,{color:e.settings.colorActive,disabled:e.disabled,"onUpdate:color":h[11]||(h[11]=y=>r("colorActive",y))},null,8,["color","disabled"])]),n("div",qb,[h[33]||(h[33]=n("label",{class:"text-xs text-neutral-400"},"Text",-1)),v(lt,{color:e.settings.textColorActive,disabled:e.disabled,"onUpdate:color":h[12]||(h[12]=y=>r("textColorActive",y))},null,8,["color","disabled"])])])])]),n("tr",null,[n("th",Wb,[v(Y,{tooltip:"
12Colors for the active timer while it is running"},{default:L(()=>[...h[34]||(h[34]=[U(" Running ",-1)])]),_:1})]),n("td",null,[n("div",Gb,[n("div",Xb,[h[35]||(h[35]=n("label",{class:"text-xs text-neutral-400"},"BG",-1)),v(lt,{color:e.settings.colorActiveRunning,disabled:e.disabled,"onUpdate:color":h[13]||(h[13]=y=>r("colorActiveRunning",y))},null,8,["color","disabled"])]),n("div",Yb,[h[36]||(h[36]=n("label",{class:"text-xs text-neutral-400"},"Text",-1)),v(lt,{color:e.settings.textColorActiveRunning,disabled:e.disabled,"onUpdate:color":h[14]||(h[14]=y=>r("textColorActiveRunning",y))},null,8,["color","disabled"])])])])])])]))}},Zb={class:"table-ctrl w-full"},Qb={class:"whitespace-nowrap !w-32 !pr-3"},Jb={class:"whitespace-nowrap !w-32 !pr-3"},ev={class:"flex gap-2"},tv=["disabled","onClick"],nv={class:"whitespace-nowrap !w-32 !pr-3"},lv={class:"whitespace-nowrap !w-32 !pr-3"},sv={class:"whitespace-nowrap !w-32 !pr-3"},ov={class:"whitespace-nowrap !w-32 !pr-3"},av={class:"whitespace-nowrap !w-32 !pr-3"},iv=["disabled"],rv={key:0},uv={class:"whitespace-nowrap !w-32 !pr-3"},dv={class:"flex gap-2"},cv=["disabled","onClick"],mv={key:1},pv={class:"whitespace-nowrap !w-32 !pr-3"},fv={key:2},bv={class:"whitespace-nowrap !w-32 !pr-3"},vv={__name:"OnAirSettings",props:{settings:{type:Object,required:!0},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const{fonts:s,fontWeights:t,fontSizes:a}=ue,o=l,i=e,r=je("typefaces",[]);function p(T,C){o("update:settings",re(Q({},i.settings),{[T]:C}))}const d=O(()=>{var T;return(T=i.settings.followTimer)!=null?T:!1}),f=O(()=>i.settings.color||"#ef4444"),u=O(()=>i.settings.inactiveColor||"#6b7280"),m=O(()=>{var T;return(T=i.settings.enablePulse)!=null?T:!0}),b=O(()=>{var T;return(T=i.settings.hideWhenInactive)!=null?T:!1}),c=O(()=>i.settings.textLabel||""),w=O(()=>i.settings.textPosition||"right"),h=O(()=>i.settings.textColor||"#ffffff"),y=O(()=>i.settings.fontWeight||t.BOLD),S=O(()=>i.settings.fontItalic||!1),D=O(()=>i.settings.fontSize||a.MD),k=O(()=>({fontFamily:i.settings.fontFamily||s.INTER})),M=[{value:"left",label:"Left"},{value:"right",label:"Right"},{value:"top",label:"Top"},{value:"bottom",label:"Bottom"}],I=[{value:"small",label:"Small"},{value:"medium",label:"Medium"},{value:"large",label:"Large"}],R=O(()=>i.settings.sizePreset||"medium");return(T,C)=>(x(),$("table",Zb,[n("tbody",null,[n("tr",null,[n("th",Qb,[v(Y,{tooltip:"Also activate the indicator when any timer is running. The room's on-air toggle and timer state can both activate the indicator."},{default:L(()=>[...C[12]||(C[12]=[U(" Follow Timer ",-1)])]),_:1})]),n("td",null,[v(Ne,{"model-value":d.value,disabled:i.disabled,class:"h-7 w-full text-xs","onUpdate:modelValue":C[0]||(C[0]=E=>p("followTimer",E))},{default:L(()=>[...C[13]||(C[13]=[U(" Activate when timer is running ",-1)])]),_:1},8,["model-value","disabled"])])]),n("tr",null,[n("th",Jb,[v(Y,{tooltip:"Choose a size preset for the indicator: small, medium, or large."},{default:L(()=>[...C[14]||(C[14]=[U(" Size Preset ",-1)])]),_:1})]),n("td",null,[n("div",ev,[(x(),$(ee,null,ge(I,E=>n("button",{key:E.value,class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":R.value===E.value,"opacity-50":i.disabled}]),disabled:i.disabled,onClick:_=>p("sizePreset",E.value)},q(E.label),11,tv)),64))])])]),n("tr",null,[n("th",nv,[v(Y,{tooltip:"Color of the indicator dot when timer is running."},{default:L(()=>[...C[15]||(C[15]=[U(" Active Color ",-1)])]),_:1})]),n("td",null,[v(lt,{color:f.value,disabled:i.disabled,"onUpdate:color":C[1]||(C[1]=E=>p("color",E))},null,8,["color","disabled"])])]),n("tr",null,[n("th",lv,[v(Y,{tooltip:"Color of the indicator dot when timer is not running."},{default:L(()=>[...C[16]||(C[16]=[U(" Inactive Color ",-1)])]),_:1})]),n("td",null,[v(lt,{color:u.value,disabled:i.disabled,"onUpdate:color":C[2]||(C[2]=E=>p("inactiveColor",E))},null,8,["color","disabled"])])]),n("tr",null,[n("th",sv,[v(Y,{tooltip:"Enable pulsing animation when timer is running."},{default:L(()=>[...C[17]||(C[17]=[U(" Pulse Animation ",-1)])]),_:1})]),n("td",null,[v(Ne,{"model-value":m.value,disabled:i.disabled,class:"h-7 w-full text-xs","onUpdate:modelValue":C[3]||(C[3]=E=>p("enablePulse",E))},{default:L(()=>[...C[18]||(C[18]=[U(" Enable pulsing glow effect ",-1)])]),_:1},8,["model-value","disabled"])])]),n("tr",null,[n("th",ov,[v(Y,{tooltip:"Hide the indicator completely when timer is not running."},{default:L(()=>[...C[19]||(C[19]=[U(" Hide When Inactive ",-1)])]),_:1})]),n("td",null,[v(Ne,{"model-value":b.value,disabled:i.disabled,class:"h-7 w-full text-xs","onUpdate:modelValue":C[4]||(C[4]=E=>p("hideWhenInactive",E))},{default:L(()=>[...C[20]||(C[20]=[U(" Hide when not active ",-1)])]),_:1},8,["model-value","disabled"])])]),n("tr",null,[n("th",av,[v(Y,{tooltip:"Optional text label to display alongside the indicator (e.g., 'ON AIR', 'LIVE', 'REC')."},{default:L(()=>[...C[21]||(C[21]=[U(" Text Label ",-1)])]),_:1})]),n("td",null,[me(n("input",{"onUpdate:modelValue":C[5]||(C[5]=E=>c.value=E),type:"text",class:"input-ctrl text-xs w-full h-7",placeholder:"ON AIR",disabled:i.disabled,onInput:C[6]||(C[6]=E=>p("textLabel",E.target.value))},null,40,iv),[[ft,c.value]])])]),c.value?(x(),$("tr",rv,[n("th",uv,[v(Y,{tooltip:"Position of the text label relative to the indicator dot."},{default:L(()=>[...C[22]||(C[22]=[U(" Label Position ",-1)])]),_:1})]),n("td",null,[n("div",dv,[(x(),$(ee,null,ge(M,E=>n("button",{key:E.value,class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":w.value===E.value,"opacity-50":i.disabled}]),disabled:i.disabled,onClick:_=>p("textPosition",E.value)},q(E.label),11,cv)),64))])])])):N("",!0),c.value?(x(),$("tr",mv,[n("th",pv,[v(Y,{tooltip:"Select the font family for the text label."},{default:L(()=>[...C[23]||(C[23]=[U(" Label Font ",-1)])]),_:1})]),n("td",null,[v(Cn,{"data-label":"customize-on-air-font",disabled:i.disabled,"custom-fonts":g(r),"model-value":k.value,"onUpdate:modelValue":C[7]||(C[7]=E=>p("fontFamily",E.fontFamily))},null,8,["disabled","custom-fonts","model-value"])])])):N("",!0),c.value?(x(),$("tr",fv,[n("th",bv,[v(Y,{tooltip:"
12Customize the appearance of the text label including font weight, size, and color."},{default:L(()=>[...C[24]||(C[24]=[U(" Label Styling ",-1)])]),_:1})]),n("td",null,[v(el,{"data-label":"customize-on-air-styling",disabled:i.disabled,"font-weight":y.value,"font-italic":S.value,"font-size":D.value,color:h.value,"onUpdate:fontWeight":C[8]||(C[8]=E=>p("fontWeight",E)),"onUpdate:fontItalic":C[9]||(C[9]=E=>p("fontItalic",E)),"onUpdate:fontSize":C[10]||(C[10]=E=>p("fontSize",E)),"onUpdate:color":C[11]||(C[11]=E=>p("textColor",E))},null,8,["disabled","font-weight","font-italic","font-size","color"])])])):N("",!0)])]))}},gv={class:"table-ctrl w-full"},hv={class:"whitespace-nowrap !w-32 !pr-3"},xv={class:"flex gap-2"},wv=["disabled"],yv=["disabled"],kv={class:"whitespace-nowrap !w-32 !pr-3"},$v=["placeholder","disabled","readonly"],Sv={key:0,class:"mt-1 text-xs text-red-400"},Cv={class:"whitespace-nowrap !w-32 !pr-3"},Mv={class:"whitespace-nowrap !w-32 !pr-3"},Tv={class:"whitespace-nowrap !w-32 !pr-3"},zv={key:0},Iv={class:"whitespace-nowrap !w-32 !pr-3"},Ov={class:"flex gap-2"},Dv=["disabled"],Ev=["disabled"],Uv={key:1},Lv={class:"whitespace-nowrap !w-32 !pr-3"},Rv={key:2},Av={class:"whitespace-nowrap !w-32 !pr-3"},_v={class:"whitespace-nowrap !w-32 !pr-3"},Fv={class:"whitespace-nowrap !w-32 !pr-3"},Bv={__name:"QrCodeSettings",props:{settings:{type:Object,default:()=>Xe[be.QR_CODE]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=l,t=e,a=je("outputId"),o=Fe(),i=O(()=>o._id);function r(A,z){const K=re(Q({},t.settings),{[A]:z});s("update:settings",K)}const p=O(()=>t.settings.mode||"custom"),d=F(t.settings.customUrl||""),f=O(()=>t.settings.backgroundColor||"#ffffff"),u=O(()=>t.settings.foregroundColor||"#000000"),m=O(()=>t.settings.errorCorrection||"M"),b=O(()=>{var A;return(A=t.settings.margin)!=null?A:4}),c=O(()=>t.settings.logoEnabled||!1),w=O(()=>t.settings.logoType||"stagetimer"),h=O(()=>t.settings.logoImage||""),y=O(()=>t.settings.logoSize||20),S=O(()=>c.value),D=O(()=>S.value?"H":m.value),k=O(()=>i.value?`${window.location.origin}/q/${i.value}`:""),M=O({get(){return p.value==="submitQuestions"?k.value:d.value},set(A){p.value==="custom"&&(d.value=A)}});Te(()=>t.settings.customUrl,A=>{d.value=A||""});const I=F("");function R(A){if(!A)return"URL is required";try{const z=new URL(A);return["http:","https:"].includes(z.protocol)?"":"URL must start with http:// or https://"}catch(z){return"Invalid URL format"}}function T(A){const z=A.target.value;d.value=z,I.value=z?R(z):"",r("customUrl",z)}function C(A){const z={mode:A};A==="custom"&&(I.value=d.value?R(d.value):""),s("update:settings",Q(Q({},t.settings),z))}const E=[{value:"L",label:"L - Low (7%)"},{value:"M",label:"M - Medium (15%)"},{value:"Q",label:"Q - Quartile (25%)"},{value:"H",label:"H - High (30%)"}],_=[{value:0,label:"None"},{value:4,label:"Standard"},{value:8,label:"Large"}],P=[{value:10,label:"10% - Small"},{value:15,label:"15%"},{value:20,label:"20% - Recommended"},{value:25,label:"25%"},{value:30,label:"30% - Maximum"}];return(A,z)=>(x(),$("table",gv,[n("tbody",null,[n("tr",null,[n("th",hv,[v(Y,{tooltip:"Choose between Submit Questions link (auto-generated) or custom URL input."},{default:L(()=>[...z[12]||(z[12]=[U(" QR Code Type ",-1)])]),_:1})]),n("td",null,[n("div",xv,[n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":p.value==="submitQuestions","opacity-50":t.disabled}]),disabled:t.disabled,onClick:z[0]||(z[0]=K=>C("submitQuestions"))}," Submit Questions ",10,wv),n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":p.value==="custom","opacity-50":t.disabled}]),disabled:t.disabled,onClick:z[1]||(z[1]=K=>C("custom"))}," Custom URL ",10,yv)])])]),n("tr",null,[n("th",kv,[v(Y,{tooltip:p.value==="submitQuestions"?"Auto-generated link to your room's Submit Questions page.":"Enter any URL to encode in the QR code. Must start with http:// or https://"},{default:L(()=>[U(q(p.value==="submitQuestions"?"Generated URL":"Custom URL"),1)]),_:1},8,["tooltip"])]),n("td",null,[me(n("input",{"onUpdate:modelValue":z[2]||(z[2]=K=>M.value=K),type:"url",class:j(["input-ctrl text-xs h-7 w-full",{"border-red-500":I.value}]),placeholder:p.value==="submitQuestions"?"":"https://example.com",disabled:t.disabled||p.value==="submitQuestions",readonly:p.value==="submitQuestions",onInput:T},null,42,$v),[[ft,M.value]]),I.value&&p.value==="custom"?(x(),$("div",Sv,q(I.value),1)):N("",!0)])]),n("tr",null,[n("th",Cv,[v(Y,{tooltip:"Backgroun
12d color of the QR code."},{default:L(()=>[...z[13]||(z[13]=[U(" Background Color ",-1)])]),_:1})]),n("td",null,[v(lt,{color:f.value,disabled:t.disabled,"onUpdate:color":z[3]||(z[3]=K=>r("backgroundColor",K))},null,8,["color","disabled"])])]),n("tr",null,[n("th",Mv,[v(Y,{tooltip:"Foreground color of the QR code modules. Ensure sufficient contrast with background for reliable scanning."},{default:L(()=>[...z[14]||(z[14]=[U(" Foreground Color ",-1)])]),_:1})]),n("td",null,[v(lt,{color:u.value,disabled:t.disabled,"onUpdate:color":z[4]||(z[4]=K=>r("foregroundColor",K))},null,8,["color","disabled"])])]),n("tr",null,[n("th",Tv,[v(Y,{tooltip:"Add a logo in the center of the QR code. Logo size should not exceed 30% for reliable scanning."},{default:L(()=>[...z[15]||(z[15]=[U(" Show Logo ",-1)])]),_:1})]),n("td",null,[v(Ne,{"model-value":c.value,class:"text-xs",disabled:t.disabled,"onUpdate:modelValue":z[5]||(z[5]=K=>r("logoEnabled",K))},{default:L(()=>[...z[16]||(z[16]=[U(" Show logo in QR code ",-1)])]),_:1},8,["model-value","disabled"])])]),c.value?(x(),$("tr",zv,[n("th",Iv,[v(Y,{tooltip:"Choose between Stagetimer logo or a custom image URL."},{default:L(()=>[...z[17]||(z[17]=[U(" Logo Type ",-1)])]),_:1})]),n("td",null,[n("div",Ov,[n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":w.value==="stagetimer","opacity-50":t.disabled}]),disabled:t.disabled,onClick:z[6]||(z[6]=K=>r("logoType","stagetimer"))}," Stagetimer Logo ",10,Dv),n("button",{class:j(["flex-1 btn-ctrl text-xs bg-neutral-900 border-0 h-7 p-0",{"!bg-white !text-black":w.value==="custom","opacity-50":t.disabled}]),disabled:t.disabled,onClick:z[7]||(z[7]=K=>r("logoType","custom"))}," Custom ",10,Ev)])])])):N("",!0),c.value&&w.value==="custom"?(x(),$("tr",Uv,[n("th",Lv,[v(Y,{tooltip:"Upload an image to use as the logo. Image will be automatically centered. Supported formats: JPG, PNG, WEBP, SVG."},{default:L(()=>[...z[18]||(z[18]=[U(" Logo Image ",-1)])]),_:1})]),n("td",null,[v(on,{"data-label":"qr-code-logo-upload","file-formats":["JPG","PNG","WEBP","SVG"],"base-path":"images/","post-url":`/files/for-output/${g(a)}`,"image-size":"contain",disabled:t.disabled,img:h.value,"onUpdate:img":z[8]||(z[8]=K=>r("logoImage",K))},null,8,["post-url","disabled","img"])])])):N("",!0),c.value?(x(),$("tr",Rv,[n("th",Av,[v(Y,{tooltip:"Size of the logo as percentage of QR code. Keep under 30% for reliable scanning."},{default:L(()=>[...z[19]||(z[19]=[U(" Logo Size ",-1)])]),_:1})]),n("td",null,[v(he,{"model-value":y.value,size:"xs","select-class":"h-7 w-full",width:"100%",options:P,disabled:t.disabled,"onUpdate:modelValue":z[9]||(z[9]=K=>r("logoSize",K))},null,8,["model-value","disabled"])])])):N("",!0),n("tr",null,[n("th",_v,[v(Y,{tooltip:c.value?"Error correction automatically set to H (30%) when logo is enabled for reliable scanning.":"Error correction level. Higher levels can recover from more damage but create denser QR codes. L=7%, M=15%, Q=25%, H=30% recovery."},{default:L(()=>[...z[20]||(z[20]=[U(" Error Correction ",-1)])]),_:1},8,["tooltip"])]),n("td",null,[v(he,{"model-value":D.value,size:"xs","select-class":"h-7 w-full",width:"100%",options:E,disabled:t.disabled||c.value,"onUpdate:modelValue":z[10]||(z[10]=K=>r("errorCorrection",K))},null,8,["model-value","disabled"])])]),n("tr",null,[n("th",Fv,[v(Y,{tooltip:"Size of the quiet zone (white space) around the QR code."},{default:L(()=>[...z[21]||(z[21]=[U(" Margin ",-1)])]),_:1})]),n("td",null,[v(he,{"model-value":b.value,size:"xs","select-class":"h-7 w-full",width:"100%",options:_,disabled:t.disabled,"onUpdate:modelValue":z[11]||(z[11]=K=>r("margin",K))},null,8,["model-value","disabled"])])])])]))}},Pv={__name:"ElementSettings",props:{element:{type:Object,required:!0},disabled:Boolean},emits:["update:element"],setup(e,{emit:l}){const s=l,t=e,a={[be.IMAGE]:W0,[be.IFRAME]:s1,[be.PROGRESS_BAR]:F1,[be.PROGRESS_RING]:q1,[be.TEXT]:P0,[be.TIME_OF_DAY]:Zl,[be.TIMER_MESSAGE_COMBO]:E1,[be.TIMER]:x1,[be.MESSAGE]:jr,[be.TRANSPORT_CONTROL]:mb,[be.MODERATOR]:vb,[be.AGENDA]:Kb,[be.ON_AIR]:vv,[be.QR_CODE]:Bv},o=O(()=>Object.assign({}
12,Xe[t.element.type],t.element.settings));return(i,r)=>a[t.element.type]?(x(),Z(gi(a[t.element.type]),{key:0,settings:o.value,"onUpdate:settings":r[0]||(r[0]=p=>s("update:element",re(Q({},e.element),{settings:p})))},null,40,["settings"])):(x(),$(ee,{key:1},[U(" No settings available for this element. ")],64))}},Nv=["id"],Hv={class:"drag-handle flex-none rounded-l w-8 bg-neutral-700 hover:bg-neutral-600"},Vv=["onClick","onMouseenter"],jv={__name:"CustomizeElementsList",props:{elements:{type:Array,default:()=>[]},selectedId:{type:String,default:null}},emits:["update:element","update:selectedId","reorder:elements","update:hoveredId"],setup(e,{emit:l}){const s=F(!1),t=l,a=e;return(o,i)=>(x(),Z(g(vo),{ref:"dragableRef",class:"space-y-3","model-value":a.elements,"item-key":"_id","component-data":{name:"list-fade"},handle:".drag-handle",onStart:i[1]||(i[1]=r=>s.value=r.oldIndex),onEnd:i[2]||(i[2]=r=>s.value=null),"onUpdate:modelValue":i[3]||(i[3]=r=>t("reorder:elements",r))},{item:L(({element:r,index:p})=>[(x(),$("div",{id:r._id,key:r._id,class:j(["flex gap-0.5 w-full min-h-8 rounded",{"ring-2 ring-offset-2 ring-offset-neutral-800 ring-blue-400":e.selectedId===r._id||s.value===p}])},[n("button",Hv,[v(g(pt),{icon:g(Ru),"fixed-width":"",size:"sm"},null,8,["icon"])]),n("button",{class:"flex-1 rounded-r bg-neutral-700 hover:bg-neutral-600 text-left px-2 py-1",onClick:d=>t("update:selectedId",r._id),onMouseenter:d=>t("update:hoveredId",r._id),onMouseleave:i[0]||(i[0]=d=>t("update:hoveredId",null))},q(g(lr)(r.type)),41,Vv)],10,Nv))]),_:1},8,["model-value"]))}};function qv(e,l=32){const[s,t]=e;if(s<=0||t<=0)throw new Error("Aspect ratio values must be positive");const a=Math.max(s,t),o=l/a,i=Math.round(s*o),r=Math.round(t*o);return[i,r]}var ws,Xa;function Wv(){if(Xa)return ws;Xa=1;var e=Au(),l=1,s=4;function t(a){return e(a,l|s)}return ws=t,ws}var Gv=Wv();const Ya=ln(Gv),Xv={class:"grid grid-cols-[1fr_400px] h-full"},Yv={class:"h-full px-3 flex flex-col justify-center gap-2 overflow-hidden"},Kv={key:0,class:"flex-none"},Zv={class:"flex-1 min-h-0 min-w-0"},Qv={class:"relative h-full min-h-0"},Jv={class:"h-full flex flex-col min-h-0"},eg={class:"flex-none flex items-center px-3 my-2"},tg={class:"flex-none flex items-center gap-4 p-3"},ng={class:"grow text-xs text-neutral-500 truncate"},lg=["disabled"],sg=["disabled"],og={key:0},ag={key:1},qr={__name:"CustomizeModal",props:{output:{type:Object,default:null},open:Boolean,loading:Boolean},emits:["update:open","update:output"],setup(e,{emit:l}){const s=Fe(),t=F(null),a=O(()=>{var H;return((H=t.value)==null?void 0:H.settings.aspectRatio)||{w:16,h:9}}),o=O(()=>qv([a.value.w,a.value.h])),i=F(null),r=F(null),p=F(null),d=F(!1),f=O(()=>!zi(c.output,t.value)),u=F(!1),m=F(!1),b=l,c=e;no(O(()=>s.get),O(()=>t.value),{editMode:!0});const{gridCellWidth:w,gridCellHeight:h,fromPct:y}=nr(o);function S(){t.value=Ya(c.output),i.value=null}De(()=>S());const D=O(()=>{var G;if(!((G=t.value)!=null&&G.elements))return new Map;const H=new Map;return t.value.elements.forEach((ne,V)=>{H.set(ne._id,V)}),H}),k=O(()=>{var G;const H=D.value.get(i.value);return(G=t.value)==null?void 0:G.elements[H]});function M(H){var Se;if(!((Se=t.value)!=null&&Se.elements))return;const G="tmp-"+Mi(),ne=1,V=1;let{w:X,h:ae}=ac(H);t.value.elements.unshift({_id:G,id:G,type:H,x:y(ne*w.value),y:y(V*h.value),w:y(X*w.value),h:y(ae*h.value),settings:Q({},Xe[H])}),i.value=G}function I(H){const G=D.value.get(H._id);G!==void 0&&(t.value.elements[G]=H)}function R(H){i.value=null,t.value.elements=t.value.elements.filter(G=>G._id!==H)}function T(H){var G;(G=t.value)!=null&&G.elements&&(t.value.elements=H)}function C(H,G){var ne;(ne=t.value)!=null&&ne.settings&&(t.value.settings[H]=G)}function E(){return le(this,null,function*(){var G;const H=Ya(t.value);H.elements=((G=H.elements)==null?void 0:G.map(ne=>{var V;return(V=ne._id)!=null&&V.startsWith("tmp-")?Ii(ne,"_id"):ne}))||[],b("update:output",{output:H,resolve:()=>{S(),u.value=!0,setTimeout(()=>u.value=!1,3e3)}})})}const _=O(()=>{var H,G,ne;return(H=c.output)!=null&&H.updatedAt?Mu(Date.now(),(G=c.output)==null?void 0:G.updatedAt)<1?"Saved just now":t.value&&`Last saved ${Tu((ne=c.output)==null?void 0:ne.updatedAt,{addSuffix:!0})}`:""});function P(H){if(H){b("update:open",!0);return}f.value?m.value=!0:b("update:open",!1)}function A(){f.value?m.value=!0:b("update:open",!1)}function z(){m.value=!1,b("update:open",!1)}function K(H){so(H)||(H.key==="Delete"||H.key==="Backspace")&&i.value&&(H.preventDefault(),H.stopPropagation(),R(i.value))}return Te(()=>c.open&&i.value,H=>{H?window.addEventListener("keydown",K):window.removeEventListener("keydown",K)}),Bl(()=>window.removeEventListener("keydown",K)),(H,G)=>{var ne;return x(),$(ee,null,[v(Le,{open:c.open,title:`Customize Output "${(ne=e.output)==null?void 0:ne.name}"`,"data-label":"modal-output-links",icon:g(_n),closable:"","body-flush":"","hide-footer":"","body-class":"grow !p-3 min-h-0","width-class":"max-w-screen-2xl h-[calc(100vh-4rem)] max-h-[800px] flex flex-col","onUpdate:open":P,onShow:S},{default:L(()=>{var V;return[n("div",Xv,[n("div",Yv,[g(st)(g(s).plan,g(ot).CUSTOM_THEMING)?N("",!0):(x(),$("div",Kv,[v(It,{plan:"Premium"},{default:L(()=>[...G[20]||(G[20]=[U(" Customizing an output requires a license. ",-1)])]),_:1})])),n("div",Zv,[n("div",{class:j(["flex items-center justify-center max-w-full max-h-full w-auto h-full mx-auto",{"opacity-60 pointer-events-none":!g(st)(g(s).plan,g(ot).CUSTOM_THEMING)}]),style:$e({"aspect-ratio":`${o.value[0]}/${o.value[1]}`})},[n("div",{class:"max-w-full max-h-full w-full h-auto",style:$e({"aspect-ratio":`${o.value[0]}/${o.value[1]}`})},[t.value?(x(),Z(mc,{key:0,"selected-id":i.value,"onUpdate:selectedId":G[0]||(G[0]=X=>i.value=X),"hovered-id":r.value,elements:t.value.elements,settings:t.value.settings,dimensions:o.value,"show-blackout-preview":d.value,"onUpdate:element":I},null,8,["selected-id","hovered-id","elements","settings","dimensions","show-blackout-preview"])):N("",!0)],4)],6)])]),n("aside",Qv,[n("div",Jv,[n("div",{class:j(["flex-1 min-h-0 overflow-auto",{"opacity-60 pointer-events-none":!g(st)(g(s).plan,g(ot).CUSTOM_THEMING)}])},[G[23]||(G[23]=n("h3",{class:"flex-none font-semibold text-neutral-500 px-3"}," Settings ",-1)),t.value?(x(),Z(hc,{key:0,settings:t.value.settings,"onUpdate:settings":G[1]||(G[1]=X=>t.value.settings=X),class:"flex-none px-3 py-1","onOpen:settings":G[2]||(G[2]=X=>p.value=X)},null,8,["settings"])):N("",!0),n("div",eg,[G[22]||(G[22]=n("h3",{class:"flex-1 font-semibold text-neutral-500"}
12," Elements ",-1)),n("button",{class:"btn-ctrl py-0 h-7","data-label":"btn-add-element",onClick:G[3]||(G[3]=X=>p.value="add-element")},[v(g(pt),{icon:g(sn),size:"xs"},null,8,["icon"]),G[21]||(G[21]=U(" Add ",-1))])]),v(jv,{"selected-id":i.value,"onUpdate:selectedId":G[4]||(G[4]=X=>i.value=X),"hovered-id":r.value,"onUpdate:hoveredId":G[5]||(G[5]=X=>r.value=X),class:"flex-1 overflow-y-auto min-h-0 px-3 py-1 focus:ring-0 scroll-stable",tabindex:"-1",elements:(V=t.value)==null?void 0:V.elements,"onUpdate:element":I,"onReorder:elements":T},null,8,["selected-id","hovered-id","elements"])],2),n("div",tg,[n("div",ng,q(_.value),1),n("button",{"data-label":"customize-btn-discard",class:"flex-none btn-ctrl h-8 py-0",disabled:e.loading,onClick:A},q(f.value?"Discard":"Close"),9,lg),n("button",{"data-label":"customize-btn-save",class:j(["flex-none btn-ctrl h-8 py-0 px-6 !bg-teal-800 border-teal-600 !text-white",{"hover:!border-teal-300":!e.loading,"bg-animated from-teal-900 to-teal-800":e.loading}]),disabled:e.loading,onClick:E},[u.value?(x(),$("span",og,[v(g(pt),{icon:g(At),size:"sm"},null,8,["icon"]),G[24]||(G[24]=U(" Saved",-1))])):(x(),$("span",ag,"Save"))],10,sg)])]),k.value?(x(),Z($n,{key:k.value._id,title:`Edit ${g(lr)(k.value.type)}`,class:"absolute z-10 inset-0 -top-12",onClose:G[8]||(G[8]=X=>i.value=null)},{footer:L(()=>[n("button",{class:"flex-none text-sm text-neutral-500 hover:text-neutral-400",title:"Remove Element",onClick:G[6]||(G[6]=X=>R(k.value._id))},[v(g(pt),{icon:g(en),"fixed-width":"",size:"sm"},null,8,["icon"]),G[25]||(G[25]=U(" Remove Element ",-1))]),G[26]||(G[26]=n("span",{class:"grow"},null,-1)),n("button",{class:"flex-none btn-ctrl h-7 py-0 text-sm","data-label":"element-settings-close",onClick:G[7]||(G[7]=X=>i.value=null)}," Close ")]),default:L(()=>[v(Pv,{element:k.value,"onUpdate:element":I},null,8,["element"])]),_:1},8,["title"])):N("",!0),p.value==="aspectRatio"?(x(),Z(_c,{key:1,class:"absolute z-10 inset-0 -top-12","aspect-ratio":t.value.settings.aspectRatio,"onUpdate:aspectRatio":G[9]||(G[9]=X=>C("aspectRatio",X)),onClose:G[10]||(G[10]=X=>p.value=null)},null,8,["aspect-ratio"])):N("",!0),p.value==="background"?(x(),Z(wf,{key:2,class:"absolute z-10 inset-0 -top-12",background:t.value.settings.background,"onUpdate:background":G[11]||(G[11]=X=>C("background",X)),onClose:G[12]||(G[12]=X=>p.value=null)},null,8,["background"])):N("",!0),p.value==="blackout"?(x(),Z(t0,{key:3,class:"absolute z-10 inset-0 -top-12",blackout:t.value.settings.blackout,"show-preview":d.value,"onUpdate:blackout":G[13]||(G[13]=X=>C("blackout",X)),"onUpdate:preview":G[14]||(G[14]=X=>d.value=X),onClose:G[15]||(G[15]=X=>p.value=null)},null,8,["blackout","show-preview"])):N("",!0),p.value==="fonts"?(x(),Z(h0,{key:4,class:"absolute z-10 inset-0 -top-12",typefaces:t.value.settings.typefaces,"onUpdate:typefaces":G[16]||(G[16]=X=>C("typefaces",X)),onClose:G[17]||(G[17]=X=>p.value=null)},null,8,["typefaces"])):N("",!0),p.value==="add-element"?(x(),Z(C0,{key:5,class:"absolute z-10 inset-0 -top-12","onAdd:element":M,onClose:G[18]||(G[18]=X=>p.value=null)})):N("",!0)])])]}),_:1},8,["open","title","icon"]),v(Le,{open:m.value,"onUpdate:open":G[19]||(G[19]=V=>m.value=V),title:"Discard Changes","data-label":"modal-discard-changes",icon:g(_n),"confirm-label":"Discard Changes","confirm-class":"text-red-500 hover:bg-red-900 hover:!border-red-600",closable:"",onConfirm:z},{default:L(()=>[...G[27]||(G[27]=[U(" You have unsaved changes. Are you sure you want to discard them? ",-1)])]),_:1},8,["open","icon"])],64)}}};var yl={exports:{}},ys={exports:{}};var Ka;function ig(){return Ka||(Ka=1,(function(e){(function(l,s){e.exports?e.exports=s():l.getSize=s()})(window,function(){function s(i){let r=parseFloat(i);return i.indexOf("%")==-1&&!isNaN(r)&&r}let t=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];function a(){let i={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};return t.forEach(r=>{i[r]=0}),i}function o(i){if(typeof i=="string"&&(i=document.querySelector(i)),!(i&&typeof i=="object"&&i.nodeType))return;let p=getComputedStyle(i);if(p.display=="none")return a();let d={};d.width=i.offsetWidth,d.height=i.offsetHeight;let f=d.isBorderBox=p.boxSizing=="border-box";t.forEach(D=>{let k=p[D],M=parseFloat(k);d[D]=isNaN(M)?0:M});let u=d.paddingLeft+d.paddingRight,m=d.paddingTop+d.paddingBottom,b=d.marginLeft+d.marginRight,c=d.marginTop+d.marginBottom,w=d.borderLeftWidth+d.borderRightWidth,h=d.borderTopWidth+d.borderBottomWidth,y=s(p.width);y!==!1&&(d.width=y+(f?0:u+w));let S=s(p.height);return S!==!1&&(d.height=S+(f?0:m+h)),d.innerWidth=d.width-(u+w),d.innerHeight=d.height-(m+h),d.outerWidth=d.width+b,d.outerHeight=d.height+c,d}return o}
12)})(ys)),ys.exports}var kl={exports:{}},$l={exports:{}},rg=$l.exports,Za;function ug(){return Za||(Za=1,(function(e){(function(l,s){e.exports?e.exports=s():l.EvEmitter=s()})(typeof window!="undefined"?window:rg,function(){function l(){}let s=l.prototype;return s.on=function(t,a){if(!t||!a)return this;let o=this._events=this._events||{},i=o[t]=o[t]||[];return i.includes(a)||i.push(a),this},s.once=function(t,a){if(!t||!a)return this;this.on(t,a);let o=this._onceEvents=this._onceEvents||{},i=o[t]=o[t]||{};return i[a]=!0,this},s.off=function(t,a){let o=this._events&&this._events[t];if(!o||!o.length)return this;let i=o.indexOf(a);return i!=-1&&o.splice(i,1),this},s.emitEvent=function(t,a){let o=this._events&&this._events[t];if(!o||!o.length)return this;o=o.slice(0),a=a||[];let i=this._onceEvents&&this._onceEvents[t];for(let r of o)i&&i[r]&&(this.off(t,r),delete i[r]),r.apply(this,a);return this},s.allOff=function(){return delete this._events,delete this._onceEvents,this},l})})($l)),$l.exports}var dg=kl.exports,Qa;function cg(){return Qa||(Qa=1,(function(e){(function(l,s){e.exports?e.exports=s(l,ug()):l.Unidragger=s(l,l.EvEmitter)})(typeof window!="undefined"?window:dg,function(s,t){function a(){}let o=a.prototype=Object.create(t.prototype);o.handleEvent=function(f){let u="on"+f.type;this[u]&&this[u](f)};let i,r;"ontouchstart"in s?(i="touchstart",r=["touchmove","touchend","touchcancel"]):s.PointerEvent?(i="pointerdown",r=["pointermove","pointerup","pointercancel"]):(i="mousedown",r=["mousemove","mouseup"]),o.touchActionValue="none",o.bindHandles=function(){this._bindHandles("addEventListener",this.touchActionValue)},o.unbindHandles=function(){this._bindHandles("removeEventListener","")},o._bindHandles=function(f,u){this.handles.forEach(m=>{m[f](i,this),m[f]("click",this),s.PointerEvent&&(m.style.touchAction=u)})},o.bindActivePointerEvents=function(){r.forEach(f=>{s.addEventListener(f,this)})},o.unbindActivePointerEvents=function(){r.forEach(f=>{s.removeEventListener(f,this)})},o.withPointer=function(f,u){u.pointerId===this.pointerIdentifier&&this[f](u,u)},o.withTouch=function(f,u){let m;for(let b of u.changedTouches)b.identifier===this.pointerIdentifier&&(m=b);m&&this[f](u,m)},o.onmousedown=function(f){this.pointerDown(f,f)},o.ontouchstart=function(f){this.pointerDown(f,f.changedTouches[0])},o.onpointerdown=function(f){this.pointerDown(f,f)};const p=["TEXTAREA","INPUT","SELECT","OPTION"],d=["radio","checkbox","button","submit","image","file"];return o.pointerDown=function(f,u){let m=p.includes(f.target.nodeName),b=d.includes(f.target.type),c=!m||b;!this.isPointerDown&&!f.button&&c&&(this.isPointerDown=!0,this.pointerIdentifier=u.pointerId!==void 0?u.pointerId:u.identifier,this.pointerDownPointer={pageX:u.pageX,pageY:u.pageY},this.bindActivePointerEvents(),this.emitEvent("pointerDown",[f,u]))},o.onmousemove=function(f){this.pointerMove(f,f)},o.onpointermove=function(f){this.withPointer("pointerMove",f)},o.ontouchmove=function(f){this.withTouch("pointerMove",f)},o.pointerMove=function(f,u){let m={x:u.pageX-this.pointerDownPointer.pageX,y:u.pageY-this.pointerDownPointer.pageY};this.emitEvent("pointerMove",[f,u,m]),!this.isDragging&&this.hasDragStarted(m)&&this.dragStart(f,u),this.isDragging&&this.dragMove(f,u,m)},o.hasDragStarted=function(f){return Math.abs(f.x)>3||Math.abs(f.y)>3}
12,o.dragStart=function(f,u){this.isDragging=!0,this.isPreventingClicks=!0,this.emitEvent("dragStart",[f,u])},o.dragMove=function(f,u,m){this.emitEvent("dragMove",[f,u,m])},o.onmouseup=function(f){this.pointerUp(f,f)},o.onpointerup=function(f){this.withPointer("pointerUp",f)},o.ontouchend=function(f){this.withTouch("pointerUp",f)},o.pointerUp=function(f,u){this.pointerDone(),this.emitEvent("pointerUp",[f,u]),this.isDragging?this.dragEnd(f,u):this.staticClick(f,u)},o.dragEnd=function(f,u){this.isDragging=!1,setTimeout(()=>delete this.isPreventingClicks),this.emitEvent("dragEnd",[f,u])},o.pointerDone=function(){this.isPointerDown=!1,delete this.pointerIdentifier,this.unbindActivePointerEvents(),this.emitEvent("pointerDone")},o.onpointercancel=function(f){this.withPointer("pointerCancel",f)},o.ontouchcancel=function(f){this.withTouch("pointerCancel",f)},o.pointerCancel=function(f,u){this.pointerDone(),this.emitEvent("pointerCancel",[f,u])},o.onclick=function(f){this.isPreventingClicks&&f.preventDefault()},o.staticClick=function(f,u){let m=f.type==="mouseup";m&&this.isIgnoringMouseUp||(this.emitEvent("staticClick",[f,u]),m&&(this.isIgnoringMouseUp=!0,setTimeout(()=>{delete this.isIgnoringMouseUp},400)))},a})})(kl)),kl.exports}var mg=yl.exports,Ja;function pg(){return Ja||(Ja=1,(function(e){(function(l,s){e.exports?e.exports=s(l,ig(),cg()):l.Draggabilly=s(l,l.getSize,l.Unidragger)})(typeof window!="undefined"?window:mg,function(s,t,a){function o(){}let i=s.jQuery;function r(c,w){this.element=typeof c=="string"?document.querySelector(c):c,i&&(this.$element=i(this.element)),this.options={},this.option(w),this._create()}let p=r.prototype=Object.create(a.prototype);p.option=function(c){this.options=Q(Q({},this.options),c)};const d=["relative","absolute","fixed"];p._create=function(){this.position={},this._getPosition(),this.startPoint={x:0,y:0},this.dragPoint={x:0,y:0},this.startPosition=Q({},this.position);let c=getComputedStyle(this.element);d.includes(c.position)||(this.element.style.position="relative"),this.on("pointerDown",this.handlePointerDown),this.on("pointerUp",this.handlePointerUp),this.on("dragStart",this.handleDragStart),this.on("dragMove",this.handleDragMove),this.on("dragEnd",this.handleDragEnd),this.setHandles(),this.enable()},p.setHandles=function(){let{handle:c}=this.options;typeof c=="string"?this.handles=this.element.querySelectorAll(c):typeof c=="object"&&c.length?this.handles=c:c instanceof HTMLElement?this.handles=[c]:this.handles=[this.element]};const f=["dragStart","dragMove","dragEnd"];let u=p.emitEvent;p.emitEvent=function(c,w){if(!this.isEnabled&&f.includes(c))return;u.call(this,c,w);let y=s.jQuery;if(!y||!this.$element)return;let S,D=w;w&&w[0]instanceof Event&&([S,...D]=w);let M=y.Event(S);M.type=c,this.$element.trigger(M,D)},p._getPosition=function(){let c=getComputedStyle(this.element),w=this._getPositionCoord(c.left,"width"),h=this._getPositionCoord(c.top,"height");this.position.x=isNaN(w)?0:w,this.position.y=isNaN(h)?0:h,this._addTransformPosition(c)},p._getPositionCoord=function(c,w){if(c.includes("%")){let h=t(this.element.parentNode);return h?parseFloat(c)/100*h[w]:0}return parseInt(c,10)},p._addTransformPosition=function(c){let w=c.transform;if(!w.startsWith("matrix"))return;let h=w.split(","),y=w.startsWith("matrix3d")?12:4,S=parseInt(h[y],10),D=parseInt(h[y+1],10);this.position.x+=S,this.position.y+=D},p.handlePointerDown=function(c,w){this.isEnabled&&(this.pointerDownPointer={pageX:w.pageX,pageY:w.pageY},c.preventDefault(),document.activeElement.blur(),this.bindActivePointerEvents(c),this.element.classList.add("is-pointer-down"))},p.handleDragStart=function(){this.isEnabled&&(this._getPosition(),this.measureContainment(),this.startPosition.x=this.position.x,this.startPosition.y=this.position.y,this.setLeftTop(),this.dragPoint.x=0,this.dragPoint.y=0,this.element.classList.add("is-dragging"),this.animate())},p.measureContainment=function(){let c=this.getContainer();if(!c)return;let w=t(this.element),h=t(c),{borderLeftWidth:y,borderRightWidth:S,borderTopWidth:D,borderBottomWidth:k}=h,M=this.element.getBoundingClientRect(),I=c.getBoundingClientRect(),R=y+S,T=D+k,C=this.relativeStartPosition={x:M.left-(I.left+y),y:M.top-(I.top+D)};this.containSize={width:h.width-R-C.x-w.width,height:h.height-T-C.y-w.height}},p.getContainer=function(){let c=this.options.containment;return c?c instanceof HTMLElement?c:typeof c=="string"?document.querySelector(c):this.element.parentNode:void 0},p.handleDragMove=function(c,w,h){if(!this.isEnabled)return;let y=h.x,S=h.y,D=this.options.grid,k=D&&D[0],M=D&&D[1];y=m(y,k),S=m(S,M),y=this.containDrag("x",y,k),S=this.containDrag("y",S,M),y=this.options.axis=="y"?0:y,S=this.options.axis=="x"?0:S,this.position.x=this.startPosition.x+y,this.position.y=this.startPosition.y+S,this.dragPoint.x=y,this.dragPoint.y=S};function m(c,w,h){return w?(h=h||"round",Math[h](c/w)*w):c}p.containDrag=function(c,w,h){if(!this.options.containment)return w;let y=c=="x"?"width":"height",S=this.relativeStartPosition[c],D=m(-S,h,"ceil"),k=this.containSize[y];return k=m(k,h,"floor"),Math.max(D,Math.min(k,w))},p.handlePointerUp=function(){this.element.classList.remove("is-pointer-down")},p.handleDragEnd=function(){this.isEnabled&&(this.element.style.transform="",this.setLeftTop(),this.element.classList.remove("is-dragging"))},p.animate=function(){this.isDragging&&(this.positionDrag(),requestAnimationFrame(()=>this.animate()))},p.setLeftTop=function(){let{x:c,y:w}=this.position;this.element.style.left=`${c}px`,this.element.style.top=`${w}px`},p.positionDrag=function(){let{x:c,y:w}=this.dragPoint;this.element.style.transform=`translate3d(${c}
12px, ${w}px, 0)`},p.setPosition=function(c,w){this.position.x=c,this.position.y=w,this.setLeftTop()},p.enable=function(){this.isEnabled||(this.isEnabled=!0,this.bindHandles())},p.disable=function(){this.isEnabled&&(this.isEnabled=!1,this.isDragging&&this.dragEnd(),this.unbindHandles())};const b=["transform","left","top","position"];return p.destroy=function(){this.disable(),b.forEach(c=>{this.element.style[c]=""}),this.unbindHandles(),this.$element&&this.$element.removeData("draggabilly")},p._init=o,i&&i.bridget&&i.bridget("draggabilly",r),r})})(yl)),yl.exports}var fg=pg();const bg=ln(fg),vg={class:"flex mb-1"},gg={class:"grow basis-1 flex items-center"},hg={class:"flex-none flex items-center gap-2"},xg={class:"h-full"},wg={class:"absolute bottom-0 w-full h-1 bg-green-900"},ei=16,yg=40,kg={__name:"TransportTimeline",setup(e){const l=Fe(),s=kn(),t=F(),a=F(),o=F(),i=F(!1),r=F(!1),p=F(0),d=F(0),f=F(0),u=F(!1);let m=null;De(()=>{m=new bg(o.value,{axis:"x",containment:t.value}),m.on("dragStart",()=>{i.value=!0}),m.on("dragMove",(A,z,K)=>{p.value=tt(S.value+K.x,0,f.value)}),m.on("dragEnd",()=>{i.value=!1,E(p.value),p.value=0})}),Bd(t,b,{immediate:!0});function b(){var A;f.value=((A=t.value)==null?void 0:A.clientWidth)-ei,c()}function c(){i.value||u.value||m==null||m.setPosition(S.value,0)}Te(()=>s.moment.real.left,c);const w=O(()=>i.value||r.value||d.value>0),h=O(()=>{if(!w.value)return null;const A=i.value?p.value:d.value;return _(A,f.value,s.total)}),y=O(()=>{const A=1-s.moment.real.left/(s.moment.real.total||1);return Dn(tt(A,0,1)*100,2)}),S=O(()=>{const A=Math.max(f.value,0);return Math.max(Math.round(A*y.value/100),0)}),D=O(()=>{const A=s.moment.real.yellow/(s.moment.real.total||1);return Dn(tt(A,0,1)*100,2)}),k=O(()=>{const A=s.moment.real.red/(s.moment.real.total||1);return Dn(tt(A,0,1)*100,2)}),M=O(()=>{if(f.value<=0||s.total===0)return[];const A=[1e3,5e3,1e4,15e3,3e4,6e4,15e4,3e5,6e5,9e5,18e5,36e5,72e5,144e5,288e5,864e5],z=f.value/s.total,K=yg/z,H=Math.min(...A.filter(ne=>ne>K)),G=Math.max(Math.ceil(s.total/H),0);return Array(G).fill().map((ne,V)=>{const X=Math.ceil(s.total-V*H);return{time:X,label:vn(X),x:Math.ceil(V*H*z)}})});function I(){r.value=!0,document.addEventListener("mouseup",R,{once:!0})}function R(){r.value=!1,E(d.value)}function T(){r.value||(d.value=0)}function C(A){var ne,V;const z=A.clientX,K=(ne=t.value)==null?void 0:ne.getBoundingClientRect(),H=(V=o.value)==null?void 0:V.getBoundingClientRect();let G=z-K.left-ei/2;r.value?m==null||m.setPosition(G,0):(z<K.left||K.right<z||H.left<z&&z<H.right)&&(G=0),d.value=G}function E(A){return le(this,null,function*(){const z=_(A,f.value,s.total),K=-1*s.moment.real.left,H=s.total-s.moment.real.left,G=z-s.moment.real.left,ne=tt(G,K,H);yield de(se.post(`/rooms/${l.pid}/move-playhead`,{timeDelta:ne}),(V,X)=>s.set(V,X),()=>u.value=!0,()=>u.value=!1),c()})}function _(A,z,K){const H=(1-A/z)*K;return Math.round(H/1e3)*1e3}function P(){return le(this,null,function*(){yield de(se.patch(`/rooms/${l.pid}/settings`,{onAir:!l.onAir}),(A,z)=>l.updateSettings(A,z))})}return(A,z)=>(x(),$("div",null,[n("div",vg,[n("div",gg,[n("button",{class:j(["text-[0.6rem] font-semibold transition-colors whitespace-nowrap border border-current rounded bg-neutral-900 px-1",{"text-red-500 hover:text-red-300 glow-sm":g(l).onAir,"text-neutral-600 hover:text-neutral-400":!g(l).onAir}]),title:"Toggle on-air indicator",onClick:P}," ON AIR ",2)]),n("div",hg,[v(Ad,{active:g(s).running&&!w.value,pending:w.value,size:"md"},null,8,["active","pending"]),v(yu,{"override-ms":h.value,"show-warped":!0},null,8,["override-ms"])]),z[0]||(z[0]=n("div",{class:"grow basis-1"},null,-1))]),n("div",{class:j(["relative h-9 border rounded border-neutral-600 overflow-hidden",{"bg-neutral-800":!u.value,"bg-animated from-neutral-800 to-neutral-700 pointer-events-none":u.value}])},[n("div",xg,[(x(!0),$(ee,null,ge(M.value,(K,H)=>(x(),$("div",{key:H,class:"absolute top-0 h-full w-1/5 text-xs text-neutral-500 border-l border-white/20 pl-1",style:$e({left:`${K.x-1}px`})},q(K.label),5))),128))]),n("div",wg,[n("div",{class:"absolute right-0 inset-y-0 bg-amber-900",style:$e({width:`${D.value}%`})},null,4),n("div",{class:"absolute right-0 inset-y-0 bg-red-900",style:$e({width:`${k.value}%`})},null,4),n("div",{class:"bg-green-500 h-full",style:$e({clipPath:`inset(0 0 0 ${y.value}%)`})},[n("div",{class:"absolute right-0 bg-amber-500 h-full",style:$e({width:`${D.value}%`})},null,4),n("div",{class:"absolute right-0 bg-red-500 h-full",style:$e({width:`${k.value}%`})},null,4)],4)]),n("div",{ref_key:"playheadContainerRef",ref:t,class:"absolute -left-[8px] -right-[8px] top-0 bottom-0 z-10",onMousedown:I,onMouseleave:T,onMousemove:C}
12,[me(n("div",{ref_key:"hoverlineRef",ref:a,class:"absolute h-full left-0 border-l border-white/40 -z-10",style:$e({transform:`translateX(${d.value+8}px)`})},null,4),[[An,d.value]]),n("div",{ref_key:"playheadRef",ref:o,class:"relative h-full w-[16px] cursor-col-resize z-20",style:{backgroundImage:"url(/spa-assets/playhead.svg)",backgroundSize:"cover"}},null,512)],544)],2)]))}},Wr="PREVIOUS",Gr="NEXT",Xr="PLAY_PAUSE",Yr="TOGGLE_BLACKOUT",Kr="TOGGLE_ON_AIR",Zr="FLASH_3X",$g={class:"relative flex justify-center gap-2"},Sg={key:0,class:"absolute -top-7 inset-x-0 flex justify-center z-20 pointer-events-none"},Cg={class:"px-2 py-0.5 rounded bg-teal-600 text-white text-xs font-mono whitespace-nowrap"},Mg={class:"btngroup flex-auto max-w-[100px]"},Tg=["title","disabled"],zg=["disabled"],Ig={class:"btngroup flex-auto max-w-[100px]"},Og={__name:"TransportControls",setup(e){const l=Fe(),s=kn(),t=wt(),a=O(()=>!!t.loading.length),o=O(()=>{var k;return(k=t.active)==null?void 0:k._id}),i=O(()=>{var k;return!!(t.previous||((k=s.moment)==null?void 0:k.countup)!==0)}),r=O(()=>{var M,I;const k=t.itemIds.findIndex(R=>{var T;return((T=t.active)==null?void 0:T._id)===R});return!(k<0||((M=l.limits)==null?void 0:M.timers)!==-1&&k>((I=l.limits)==null?void 0:I.timers)-1)}),p=O(()=>{var M,I;if(!t.next)return!1;const k=t.itemIds.findIndex(R=>{var T;return((T=t.active)==null?void 0:T._id)===R});return!(k>t.count-2||((M=l.limits)==null?void 0:M.timers)!==-1&&k>((I=l.limits)==null?void 0:I.timers)-2)}),d=[{label:"- 1s",click:()=>S("- 1s")},{label:"- 10s",click:()=>S("- 10s")},{label:"- 30s",click:()=>S("- 30s")},{label:"- 1m",click:()=>S("-1m")},{label:"- 5m",click:()=>S("-5m")},{label:"- 10m",click:()=>S("-10m")},{label:"- 20m",click:()=>S("-20m")},{label:"- 30m",click:()=>S("-30m")}],f=[{label:"+ 1s",click:()=>S("+1s")},{label:"+ 10s",click:()=>S("+10s")},{label:"+ 30s",click:()=>S("+30s")},{label:"+ 1m",click:()=>S("+1m")},{label:"+ 5m",click:()=>S("+5m")},{label:"+ 10m",click:()=>S("+10m")},{label:"+ 20m",click:()=>S("+20m")},{label:"+ 30m",click:()=>S("+30m")}];function u(){var k,M;i.value&&(s.moment.left!==s.moment.total||s.running?b((k=t.active)==null?void 0:k._id):b((M=t.previous)==null?void 0:M._id))}function m(){var k,M;p.value&&(s.running?c((k=t.next)==null?void 0:k._id):b((M=t.next)==null?void 0:M._id))}const b=k=>le(null,null,function*(){return de(se.post(`/rooms/${l.pid}/timers/${k}/reset`),(M,I)=>s.set(M,I),()=>t.loadingStart(k),()=>t.loadingResolve(k))}),c=k=>le(null,null,function*(){return de(se.post(`/rooms/${l.pid}/timers/${k}/start`),(M,I)=>s.set(M,I),()=>t.loadingStart(k),()=>t.loadingResolve(k))}),w=k=>le(null,null,function*(){return de(se.post(`/rooms/${l.pid}/timers/${k}/stop`),(M,I)=>s.set(M,I),()=>t.loadingStart(k),()=>t.loadingResolve(k))}),y=ku((k,M)=>le(null,null,function*(){return de(se.post(`/rooms/${l.pid}/timers/${k}/tweak`,{milliseconds:M}),(I,R)=>{s.set(I.timeset,R),t.setOne(I.timer,R)},()=>t.loadingStart(k),()=>t.loadingResolve(k))}));function S(k){var M;(M=t.active)!=null&&M._id&&y.tweak(t.active._id,k)}function D(k){switch(k){case Wr:return u();case Gr:return m();case Xr:s.running?w(o.value):c(o.value);break}}return De(()=>{ze.$on("shortcut",D)}),Qe(()=>{ze.$off("shortcut",D)}),(k,M)=>{var R;const I=pe("FaIcon");return x(),$("section",$g,[v(to,{name:"fadeup"},{default:L(()=>[g(y).isPending.value?(x(),$("div",Sg,[n("div",Cg,q(g(y).pendingLabel.value),1)])):N("",!0)]),_:1}),n("div",Mg,[v($t,{items:d,"button-class":"btn-ctrl !rounded-r-none p-0 h-9 w-7","button-label":"sub-min-dropdown","dropdown-class":"!min-w-[80px]",dark:"","hide-caret":""},{default:L(()=>[v(I,{icon:g(_s),size:"sm"},null,8,["icon"])]),_:1}),n("button",{class:"flex-auto btn-ctrl p-0 h-9 z-10",type:"button","data-label":"btn-sub-1-min",title:"Subtract 1 minutes",onClick:M[0]||(M[0]=T=>S("-1m"))}," -1m ")]),n("button",{class:j(["flex-auto btn-ctrl p-0 h-9 w-9 max-w-[80px]",{"bg-animated from-neutral-800 to-neutral-700":a.value}]),"data-label":"btn-master-prev",title:((R=g(s).moment)==null?void 0:R.left)===0?"Go to previous timer":"Reset current timer",disabled:!i.value||a.value,onClick:u},[v(I,{icon:g(Oi),size:"sm"},null,8,["icon"])],10,Tg),v(Qi,{class:"flex-auto !w-14","data-label":"btn-master-start-stop",t
12itle:g(s).running?"Pause current timer":"Start current timer",running:g(s).running,disabled:!r.value,loading:a.value,onStart:M[1]||(M[1]=T=>c(o.value)),onStop:M[2]||(M[2]=T=>w(o.value))},null,8,["title","running","disabled","loading"]),n("button",{class:j(["flex-auto btn-ctrl p-0 h-9 w-9 max-w-[80px]",{"bg-animated from-neutral-800 to-neutral-700":a.value}]),"data-label":"btn-master-next",title:"Go to next timer",disabled:!p.value||a.value,onClick:m},[v(I,{icon:g(_u),size:"sm"},null,8,["icon"])],10,zg),n("div",Ig,[n("button",{class:"flex-auto btn-ctrl p-0 h-9 z-10",type:"button","data-label":"btn-add-1-min",title:"Add 1 minutes",onClick:M[3]||(M[3]=T=>S("+1m"))}," +1m "),v($t,{items:f,"button-class":"btn-ctrl !rounded-l-none p-0 h-9 w-7","button-label":"add-min-dropdown","dropdown-class":"!min-w-[80px]",align:"right",dark:"","hide-caret":""},{default:L(()=>[v(I,{icon:g(_s),size:"sm"},null,8,["icon"])]),_:1})])])}}},Dg={key:0,class:"text-neutral-400"},Eg={key:1,class:"text-neutral-400"},Ug={class:"text-teal-400"},Lg={class:"hover:underline",href:"/docs/timers/#timezones",target:"_blank"},Rg={__name:"TimezoneModal",props:{now:{type:Number,default:Date.now()},timezone:{type:String,default:null},todFormat:{type:String,default:ce.AUTO},open:Boolean,busy:Boolean,forced:Boolean},emits:["update:open","update:timezone"],setup(e,{emit:l}){const s=F(null),t=F(null),a=l,o=e,i=O({get:()=>s.value||null,set:d=>s.value=d||null});function r(){t.value=oo()||"UTC",s.value=o.timezone,o.forced&&!s.value&&(s.value=t.value)}function p(d){d.preventDefault(),a("update:timezone",s.value)}return(d,f)=>{const u=pe("FaIcon");return x(),Z(Le,{open:o.open,busy:o.busy,icon:g(Ji),title:"Select Timezone","body-class":"font-light space-y-6 pb-7","width-class":"max-w-xl",closable:!o.forced,"hide-cancel":o.forced,"onUpdate:open":f[1]||(f[1]=m=>a("update:open",m)),onShow:r,onConfirm:p},{default:L(()=>[v(Zn,{modelValue:i.value,"onUpdate:modelValue":f[0]||(f[0]=m=>i.value=m),class:"h-10 w-full bg-neutral-900",dark:""},null,8,["modelValue"]),s.value?(x(),$("p",Dg,[f[2]||(f[2]=U(" This room's timezone is ",-1)),n("strong",null,q(g(rt)(s.value,"city")),1),U(" ("+q(g(rt)(s.value,"offset"))+" "+q(g(rt)(s.value,"long"))+"), "+q(g(nt)(new Date(o.now),{todFormat:o.todFormat,seconds:"never",timezone:s.value}))+" current time. ",1)])):N("",!0),t.value?(x(),$("p",Eg,[f[3]||(f[3]=U(" Your browser is in ",-1)),n("strong",null,q(g(rt)(t.value,"city")),1),U(" ("+q(g(rt)(t.value,"offset"))+" "+q(g(rt)(t.value,"long"))+"), "+q(g(nt)(new Date(o.now),{todFormat:o.todFormat,seconds:"never",timezone:t.value}))+" current time. ",1)])):N("",!0),n("p",Ug,[n("a",Lg,[f[4]||(f[4]=U(" Read more about timezones in Stagetimer ",-1)),v(u,{icon:g(kt),size:"xs"},null,8,["icon"])])])]),_:1},8,["open","busy","icon","closable","hide-cancel"])}}};function Ag(e,l){return e!=null&&e.start?Vt(e.start,{timezone:l}):null}function _g(e,l){return e!=null&&e.finish?Vt(e.finish,{timezone:l}):null}function Fg(e,l,s){return!(e!=null&&e.explicitStart)||l.left===l.total?null:Vt(l.kickoff,{timezone:s})}function Bg(e,l,s){return!(e!=null&&e.explicitStart)||l.left===l.total?null:l.left<0?new Date:Vt(l.deadline,{timezone:s})}function Pg(e){var l;return((l=e==null?void 0:e[0])==null?void 0:l.start)||null}function Ng(e){var l;return((l=e==null?void 0:e[e.length-1])==null?void 0:l.finish)||null}function Hg(){return null}function Vg(e,l){const s=e==null?void 0:e[e.length-1];return(s==null?void 0:s.delay)===0||!(s!=null&&s.finish)?null:s.explicitFinish?s.finish.getTime():Vt(s.finish.getTime()+s.delay,{timezone:l})}const fl={plannedCueStart:Ag,plannedCueFinish:_g,actualCueStart:Fg,actualCueFinish:Bg,plannedEventStart:Pg,plannedEventFinish:Ng,actualEventStart:Hg,actualEventFinish:Vg},jg={class:"flex items-center justify-center"},qg={class:"flex-none flex items-center space-x-2 px-2"},Wg={class:"font-mono font-light"}
12,Gg={class:"flex-shrink min-w-0 whitespace-nowrap"},Xg=["title"],Yg={class:"flex items-stretch"},Kg=["disabled"],Zg={class:"flex-auto overflow-hidden"},Qg={class:"flex-1 text-center px-3"},Jg={class:"flex-1 text-center px-3"},eh={class:"flex-1 text-center px-3"},th={class:"flex-1 text-center px-3"},nh=["disabled"],lh={class:"flex items-center justify-center space-x-2"},Qr={__name:"TransportMonitor",setup(e){const l=Fe(),s=kn(),t=Nl(),a=O(()=>({timezone:l.settings.timezone,todFormat:l.settings.todFormat})),o=F(!1),i=F(0),r=()=>{o.value=!o.value,i.value=0},p=O(()=>fl.plannedCueFinish(t.current,l.settings.timezone)),d=O(()=>fl.actualCueFinish(t.current,s.moment,l.settings.timezone)),f=O(()=>d.value?d.value-p.value:0),u=O(()=>fl.plannedEventFinish(t.all,l.settings.timezone)),m=O(()=>fl.actualEventFinish(t.all,l.settings.timezone)),b=O(()=>m.value?m.value-u.value:0);function c(M,I){return I?`Planned: ${nt(M,a.value)}<br>Actual: ${nt(I,a.value)}`:`Finishes ${nt(M,a.value)}`}function w(M,I){var T;if(!((T=t.current)!=null&&T.explicitStart))return"(Add a start time to see over/under time)";if(!I)return"Finishes on time";const R=M-I>0?"earlier":"later";return`Finishes ${zu(M,I)} ${R} than planned`}const h=F(!1),y=F(!1),S=F(!1),D=M=>le(null,null,function*(){return de(se.patch(`/rooms/${l.pid}/settings`,{timezone:M}),(I,R)=>{l.updateSettings(I,R),h.value=!1,S.value=!1},()=>y.value=!0,()=>y.value=!1)});function k({forced:M=!1}={}){h.value=!0,S.value=M}return De(()=>ze.$on("open-modal:timezone",k)),Qe(()=>ze.$off("open-modal:timezone",k)),De(()=>{l.settings.timezone||k({forced:!0})}),(M,I)=>{const R=pe("FaIcon"),T=Ct("tooltip");return x(),$("section",null,[n("header",jg,[I[4]||(I[4]=n("span",{class:"flex-none w-4 border-t border-neutral-700 mx-2"},null,-1)),n("div",qg,[v(R,{icon:g(Ji),size:"xs"},null,8,["icon"]),n("span",Wg,q(g(nt)(new Date(g(s).now),a.value)),1)]),n("div",Gg,[n("button",{title:`Timezone: ${g(rt)(g(l).settings.timezone,"city")} - ${g(rt)(g(l).settings.timezone,"long")}`,class:"btn text-neutral-500 hover:text-white hover:bg-neutral-700 text-xs font-light px-2 py-px max-w-full overflow-hidden text-ellipsis",onClick:I[0]||(I[0]=C=>h.value=!h.value)},[g(l).settings.timezone?g(l).settings.timezone==="UTC"?(x(),$(ee,{key:1},[U(" UTC ")],64)):(x(),$(ee,{key:2},[U(q(g(rt)(g(l).settings.timezone,"city"))+" ("+q(g(rt)(g(l).settings.timezone,"abbr"))+") ",1)],64)):(x(),$(ee,{key:0},[U(" (Timezone not set) ")],64))],8,Xg)]),I[5]||(I[5]=n("span",{class:"flex-none w-4 border-t border-neutral-700 mx-2"},null,-1))]),n("div",Yg,[n("button",{class:j(["btn p-0 w-8 flex-none",{"text-neutral-400":i.value===1,"text-neutral-700":i.value===0,invisible:o.value}]),disabled:i.value===0,onClick:I[1]||(I[1]=C=>i.value=0)},[v(R,{icon:g(Fu)},null,8,["icon"])],10,Kg),n("div",Zg,[n("div",{class:j(["",{"flex transition-transform":!o.value,"-translate-x-1/2":i.value===1&&!o.value}]),style:$e({width:`${o.value?100:200}%`})},[n("div",{class:j(["flex gap-2 leading-tight py-2",{"w-1/2":!o.value}])},[me((x(),$("div",Qg,[I[6]||(I[6]=n("p",{class:"text-xs text-neutral-500"},"Cue finish",-1)),n("p",{class:j(["font-mono font-light",{"text-xs":f.value!==0}])},q(p.value?g(nt)(p.value,a.value):"--:--"),3),f.value!==0?(x(),$("p",{key:0,class:j(["font-mono leading-none",{"text-green-400":f.value<0,"text-red-400":f.value>0}])},q(d.value?g(nt)(d.value,a.value):"--:--"),3)):N("",!0)])),[[T,{content:c(p.value,d.value),html:!0}]]),me((x(),$("div",Jg,[I[7]||(I[7]=n("p",{class:"text-xs text-neutral-500"},"Over/Under",-1)),n("p",{class:j(["inline-block font-mono font-light",{"text-green-400":f.value<0,"text-red-400":f.value>0}])},q(f.value?g(vn)(Math.abs(f.value)):"â"),3)])),[[T,w(p.value,d.value)]])],2),n("div",{class:j(["flex gap-2 leading-tight py-2",{"w-1/2":!o.value}])},[me((x(),$("div",eh,[I[8]||(I[8]=n("p",{class:"text-xs text-neutral-500"},"Event finish",-1)),n("p",{class:j(["inline-block font-mono font-light",{"text-xs":b.value!==0}])},q(u.value?g(nt)(u.value,a.value):"--:--"),3),b.value!==0?(x(),$("p",{key:0,class:j(["font-mono leading-none",{"text-green-400":b.value<0,"text-red-400":b.value>0}])},q(m.value?g(nt)(m.value,a.value):"--:--"),3)):N("",!0)])),[[T,{content:c(u.value,m.value),html:!0}]]),me((x(),$("div",th,[I[9]||(I[9]=n("p",{class:"text-xs text-neutral-500"},"Over",-1)),n("p",{class:j(["inline-block font-mono font-light",{"text-green-400":b.value<0,"text-red-400":b.value>0}])},q(b.value?g(vn)(Math.abs(b.value)):"â"),3)])),[[T,w(u.value,m.value)]])],2)],6)]),n("button",{class:j(["btn p-0 w-8 flex-none",{"text-neutral-400":i.value===0,"text-neutral-700":i.value===1,invisible:o.value}]),disabled:i.value===1,onClick:I[2]||(I[2]=C=>i.value=1)},[v(R,{icon:g(Bu)},null,8,["icon"])],10,nh)]),n("footer",lh,[I[10]||(I[10]=n("span",{class:"w-4 border-t border-neutral-700"},null,-1)),n("button",{class:"btn text-neutral-400 p-0 w-6 h-6",onClick:r},[v(R,{class:j({"rotate-180":o.value}),icon:g(Pu)},null,8,["class","icon"])]),I[11]||(I[11]=n("span",{class:"w-4 border-t border-neutral-700"},null,-1))]),v(Rg,{open:h.value,"onUpdate:open":I[3]||(I[3]=C=>
12h.value=C),timezone:g(l).settings.timezone,"tod-format":g(l).settings.todFormat,now:g(s).now,busy:y.value,forced:S.value,"onUpdate:timezone":D},null,8,["open","timezone","tod-format","now","busy","forced"])])}}},sh={class:"px-6 py-4 space-y-4 min-h-[400px] max-h-[60vh] overflow-y-auto"},oh={key:0,class:"text-center py-8"},ah={class:"text-sm font-semibold text-neutral-400 px-2"},ih={class:"divide-y divide-neutral-700 border border-neutral-700 rounded"},rh={class:"flex items-center"},uh={class:"flex-shrink-0 text-neutral-500 text-sm text-center font-mono w-8"},dh={class:"flex-grow min-w-0 mx-3"},ch={class:"flex items-center gap-2"},mh={key:0,class:"text-white font-medium truncate"},ph={key:1,class:"text-neutral-400 truncate"},fh={key:2,class:"text-yellow-500",title:"Owner"},bh={key:3,class:"badge badge-sm px-1"},vh={key:4,class:"badge badge-sm px-1"},gh={key:5,class:"badge badge-sm px-1 bg-red-600 text-red-100"},hh={class:"text-xs text-neutral-500"},xh={key:0},wh={key:1},yh={key:3},kh={key:4,class:"text-xs text-neutral-500"},$h={key:0,class:"flex-shrink-0 text-xs text-neutral-500"},Sh={class:"flex-shrink-0"},Ch={key:0,class:"space-y-2"},Mh={class:"text-sm font-semibold text-neutral-400 px-2"},Th={class:"divide-y divide-neutral-700 border border-neutral-700 rounded"},zh={class:"flex items-center"},Ih={class:"flex-shrink-0 text-neutral-500 text-sm text-center font-mono w-8"},Oh={class:"flex-grow min-w-0 mx-3"},Dh={class:"flex items-center gap-2"},Eh={class:"text-white font-medium truncate"},Uh={class:"text-xs text-neutral-500"},Lh={class:"flex items-center gap-4 px-6 py-4 text-sm"},Rh=["disabled"],Ah=["disabled"],_h={__name:"DeviceListModal",props:{open:{type:Boolean,required:!0},identifyingClients:{type:Object,default:()=>({})}},emits:["update:open","rename","identify","force-reload","kick","force-reload-all","kick-all"],setup(e,{emit:l}){const t=e,a=l,o=Di(),i=Fe(),r=Nu(),p=O(()=>{var T;return((T=i.limits)==null?void 0:T.devices)||-1}),d=O(()=>o.items.filter(T=>T.id!==o.myId&&T.type!=="ndi").length),f=O(()=>{const T=new Set(o.items.filter(C=>C.type==="ndi").map(C=>C.outputId));return o.ndiItems.filter(C=>!T.has(C.outputId))}),u=O(()=>{const T=[];let C=0;return Object.entries(o.itemsByOutput).forEach(([E,_])=>{const P=_.map(A=>re(Q({},A),{globalIndex:++C}));T.push({groupName:E,devices:P})}),T}),m=F(r.getNow());let b;function c(){clearInterval(b),m.value=r.getNow(),b=setInterval(()=>{m.value=r.getNow()},1e3)}function w(){clearInterval(b)}Qe(()=>{clearInterval(b)});function h(T){return o.heartbeats[T.socketId]||null}function y(T){const C=h(T);if(!C)return"green";const E=m.value-C;return E<=4e4?"green":E<=12e4?"yellow":"red"}function S(T){const C=y(T);return C==="green"?"text-emerald-500":C==="yellow"?"text-yellow-500":"text-red-500"}function D(T){const C=h(T);if(!C)return"";const E=Math.round((m.value-C)/1e3);return E<=5?"last seen just now":E<60?`last seen ${E}s ago`:`last seen ${Math.floor(E/60)}m ago`}function k(T){return T.transport==="polling"?"Fallback mode. This device's network blocked the instant (WebSocket) connection, so it checks for updates every few seconds instead. Not the optimal mode, but it still works fine. Force-reload the device to retry the instant connection.":"Live connection. Updates are pushed to this device instantly. This is the normal, optimal mode."}function M(T){if(!T.connectedAt)return"";const C=Math.round((m.value-T.connectedAt)/1e3);if(C<60)return`connected ${C}s`;const E=Math.floor(C/60);return E<60?`connected ${E}m`:`connected ${Math.floor(E/60)}h`}function I(T){return h(T)?`<span class="font-mono">${D(T)}</span>`:'<span class="font-mono">No heartbeat data yet</span>'}function R(T){const C=Math.floor(T/60),E=T%60;return C>0&&E>0?`${C}m ${E}s`:C>0?`${C}m`:`${E}s`}return(T,C)=>{const E=pe("FaIcon"),_=Ct("tooltip");return x(),Z(Le,{open:t.open,title:`Live Connections (${g(o).count}${p.value!==-1?"/"+p.value:""})`,icon:g(Ei),closable:"","hide-footer":"","body-flush":"","width-class":"max-w-3xl","data-label":"modal-device-list","onUpdate:open":C[3]||(C[3]=P=>a("update:open",P)),onShow:c,onHide:w},{footer:L(()=>[n("div",Lh,[n("button",{class:"text-neutral-500 enabled:hover:text-red-400 enabled:hover:underline disabled:text-neutral-700",disabled:d.value===0,title:"Disconnect every connected device except this one","data-label":"btn-kick-all",onClick:C[0]||(C[0]=P=>a("kick-all"))}," Kick all ",8,Rh),n("button",{class:"text-neutral-500 enabled:hover:text-neutral-300 enabled:hover:underline disabled:text-neutral-700",disabled:d.value===0,title:"Reload every connected device except this one","data-label":"btn-force-reload-all",onClick:C[1]||(C[1]=P=>a("force-reload-all"))}," Force reload all ",8,Ah),C[8]||(C[8]=n("div",{class:"flex-grow"},null,-1)),n("button",{class:"btn-ctrl h-8 px-6 hover:bg-neutral-700","data-label":"btn-close-device-list",onClick:C[2]||(C[2]=P=>a("update:open",!1))}
12," Close ")])]),default:L(()=>[n("div",sh,[Object.keys(g(o).itemsByOutput).length===0?(x(),$("div",oh,[v(zt,{size:"sm"}),C[4]||(C[4]=n("p",{class:"text-neutral-500 mt-2"},"Waiting for devices to connect",-1))])):(x(),$(ee,{key:1},[(x(!0),$(ee,null,ge(u.value,P=>(x(),$("div",{key:P.groupName,class:"space-y-2"},[n("h3",ah,q(P.groupName)+" ("+q(P.devices.length)+") ",1),n("div",ih,[(x(!0),$(ee,null,ge(P.devices,A=>(x(),$("div",{key:A.id,class:"p-2 hover:bg-neutral-750 transition-colors"},[n("div",rh,[n("div",uh," #"+q(A.globalIndex),1),me(n("div",{class:j(["flex-shrink-0 w-2 h-2 bg-current glow-sm animate-pulse rounded-full ml-1",S(A)])},null,2),[[_,{content:I(A),html:!0}]]),n("div",dh,[n("div",ch,[A.identifier?(x(),$("span",mh,q(A.identifier),1)):(x(),$("span",ph," Device "+q(A.id.substring(0,8)),1)),g(i).team&&A.uid&&A.uid in g(i).team.members?(x(),$("span",fh,[v(E,{icon:g(Hu),size:"xs"},null,8,["icon"])])):N("",!0),A.type==="ndi"?(x(),$("span",bh," NDI ")):N("",!0),A.id===g(o).myId?(x(),$("span",vh," You ")):N("",!0),A.superadmin?me((x(),$("span",gh,[...C[5]||(C[5]=[U(" Superadmin ",-1)])])),[[_,"Stagetimer staff connected for debugging â doesn't count toward the device limit"]]):N("",!0)]),n("div",hh,[A.type==="ndi"?(x(),$("span",xh,q(A.receiverCount)+" "+q(A.receiverCount===1?"receiver":"receivers"),1)):(x(),$("span",wh," ID: "+q(A.id.substring(0,8)),1)),A.type!=="ndi"&&A.transport?me((x(),$("span",{key:2,class:j(A.transport==="polling"?"text-amber-500":"")},[U(" · "+q(A.transport),1)],2)),[[_,k(A)]]):N("",!0),A.type!=="ndi"&&M(A)?(x(),$("span",yh," · "+q(M(A)),1)):N("",!0),y(A)!=="green"?(x(),$("span",kh," · "+q(D(A)),1)):N("",!0)])]),A.delay?me((x(),$("div",$h,[U(q(R(A.delay))+" delay ",1)])),[[_,{delay:300,content:"This output shows timer updates on a delay"}]]):N("",!0),n("div",Sh,[v(Nd,{client:A,"is-me":A.id===g(o).myId,identifying:!!t.identifyingClients[A.id],"disable-rename":A.type==="ndi","disable-identify":A.id===g(o).myId,"disable-kick":A.id===g(o).myId||A.type==="ndi","disable-force-reload":A.id===g(o).myId||A.type==="ndi",onRename:z=>a("rename",A.id,A.identifier),onIdentify:z=>a("identify",A.id),onForceReload:z=>a("force-reload",A.id),onKick:z=>a("kick",A.id)},null,8,["client","is-me","identifying","disable-rename","disable-identify","disable-kick","disable-force-reload","onRename","onIdentify","onForceReload","onKick"])])])]))),128))])]))),128)),f.value.length>0?(x(),$("div",Ch,[n("h3",Mh," NDI ("+q(f.value.length)+") ",1),n("div",Th,[(x(!0),$(ee,null,ge(f.value,P=>(x(),$("div",{key:P.id,class:"p-2"},[n("div",zh,[n("div",Ih,[v(E,{icon:g(Vu),size:"xs"},null,8,["icon"])]),C[7]||(C[7]=n("div",{class:"flex-shrink-0 w-2 h-2 bg-current glow-sm animate-pulse rounded-full ml-1 text-emerald-500"},null,-1)),n("div",Oh,[n("div",Dh,[n("span",Eh,q(P.outputName),1),C[6]||(C[6]=n("span",{class:"badge badge-sm bg-sky-600 text-sky-100"}," NDI ",-1))]),n("div",Uh,q(P.receiverCount)+" "+q(P.receiverCount===1?"receiver":"receivers"),1)])])]))),128))])])):N("",!0)],64))])]),_:1},8,["open","title","icon"])}}},Fh={class:"flex-grow text-left ml-2 text-white"},Bh={key:0},Ph={key:0,class:"px-3 pb-2"},Nh={class:"text-neutral-200"},Hh=["onKeyup"],Jr={__name:"RoomClients",props:{listenEvents:Boolean},setup(e){const l=e,s=Di(),t=Fe(),a=F(),o=F(!1),i=F(!1),r=F(null),p=F(""),d=F(""),f=F(!1),u=F(null),m=O(()=>{var _;return((_=t.limits)==null?void 0:_.devices)||-1}),b=O(()=>m.value!==-1&&s.count>=m.value);function c(_,P){r.value=_,p.value=P,d.value=P,i.value=!0}function w(){u.value=null,dt(()=>{var _;return(_=a.value)==null?void 0:_.focus()})}function h(_){_.preventDefault(),de(se.post(`/rooms/${t.pid}/clients/${r.value}/rename`,{name:p.value}),({clientId:P,name:A})=>{s.myId===P&&Fs.rename(A),_.confirm()},()=>f.value=r.value,()=>f.value=!1,P=>u.value=P)}const y=ht({}),S=_=>{const P=!y[_];de(se.post(`/rooms/${t.pid}/clients/${_}/identify`,{identifying:P}),()=>{y[_]=P,P||delete y[_]},()=>f.value=_,()=>f.value=!1)},D=_=>de(se.post(`/rooms/${t.pid}/clients/${_}/force-reload`),()=>f.value=_,()=>f.value=!1),k=_=>de(se.post(`/rooms/${t.pid}/clients/${_}/kick`),()=>f.value=_,()=>f.value=!1),M=F(null),I=O({get:()=>M.value!==null,set:_=>{_||(M.value=null)}}),R=O(()=>s.items.filter(_=>_.id!==s.myId&&_.type!=="ndi").length),T=O(()=>{const _=`${R.value} ${R.value===1?"device":"devices"}`;return M.value==="kick"?{title:`Kick all ${_}?`,confirmLabel:"Kick all",body:`This disconnects every connected device except this one. They'll be shown the "kicked" screen.`}:M.value==="reload"?{title:`Force-reload all ${_}?`,confirmLabel:"Reload all",body:"This force-reloads every connected device except this one, retrying the live (WebSocket) connection."}:{}});function C(_){_.preventDefault();const P=M.value==="kick"?`/rooms/${t.pid}/clients/kick-all`:`/rooms/${t.pid}/clients/force-reload-all`;de(se.post(P,{exceptClientId:s.myId}),()=>_.confirm(),()=>f.value=!0,()=>f.value=!1)}function E(){o.value=!0}return De(()=>{l.listenEvents&&ze.$on("open-modal:devices",E),s.startHealthTicker()}),Qe(()=>{l.listenEvents&&ze.$off("open-modal:devices",E),s.stopHealthTicker()}),(_,P)=>{const A=pe("FaIcon");return x(),$("section",null,[n("button",{class:"btn flex items-center w-full bg-neutral-800 border border-neutral-800 hover:border-neutral-600",title:"Click to see all live connections","data-label":"btn-open-device-list",onClick:P[0]||(P[0]=z=>o.value=!0)},[P[7]||(P[7]=n("h3",{class:"text-white"},"Live Connections",-1)),n("div",Fh,[n("span",null,q(g(s).count),1),m.value!==-1?(x(),$("span",Bh,"/"+q(m.value),1)):N("",!0)]),g(s).worstHealth!=="green"?(x(),$("span",{key:0,class:j(["inline-block w-1.5 h-1.5 rounded-full glow-sm bg-current animate-pulse mr-2",g(s).worstHealth==="red"?"text-red-500":"text-yellow-500"])},null,2)):N("",!0),v(A,{class:"text-neutral-400",icon:g(ju),size:"xs"},null,8,["icon"])]),b.value?(x(),$("div",Ph,[v(It,null,{default:L(()=>[U(" Connecting more than "+q(m.value)+" devices requires a license upgrade. ",1)]),_:1})])):N("",!0),v(_h,{open:o.value,"onUpdate:open":P[1]||(P[1]=z=>o.value=z),"identifying-clients":y,onRename:c,onIdentify:S,onForceReload:D,onKick:k,onForceReloadAll:P[2]||(P[2]=z=>M.value="reload"),onKickAll:P[3]||(P[3]=z=>M.value="kick")},null,8,["open","identifying-clients"]),v(Le,{open:I.value,"onUpdate:open":P[4]||(P[4]=z=>I.value=z),title:T.value.title,"width-class":"max-w-xl",closable:"",busy:!!f.value,"confirm-label":T.value.confirmLabel,"confirm-class":M.value==="kick"?"text-red-500 hover:bg-red-900 hover:!border-red-600":"",onConfirm:C},{default:L(()=>[n("p",Nh,q(T.value.body),1)]),_:1},8,["open","title","busy","confirm-label","confirm-class"]),v(Le,{open:i.value,"onUpdate:open":P[6]||(P[6]=z=>i.value=z),title:"Rename connected device","width-class":"max-w-xl",closable:"",busy:!!f.value,"disable-confirm":p.value.trim()===d.value,onShow:w,onConfirm:h},{default:L(({confirm:z})=>
12[me(n("input",{ref_key:"renameInputRef",ref:a,"onUpdate:modelValue":P[5]||(P[5]=K=>p.value=K),class:"input-ctrl w-full h-9",placeholder:"Leave empty to reset",onKeyup:Re(z,["enter"])},null,40,Hh),[[ft,p.value]]),v(_t,{class:"mt-3",error:u.value},null,8,["error"])]),_:1},8,["open","busy","disable-confirm"])])}}},Vh={class:"controller-subheader px-3"},jh={class:"flex items-center space-x-2 whitespace-nowrap"},qh={class:"controller-scroll px-3 pb-6 pt-1.5 -mt-1.5 space-y-6"},Wh={class:"relative overflow-hidden pointer-events-none w-full h-[210px] md:h-[210px] lg:h-[210px]"},Gh={key:1,class:"absolute inset-0 flex items-center justify-center text-neutral-500 text-sm"},Xh={class:"text-center p-4"},Yh={key:0,class:"absolute left-0 top-0 right-0 bg-gradient-to-b from-black/80 via-black/80 to-black/0 pointer-events-auto p-2 pb-5"},Kh={class:"flex gap-2 items-center"},Zh=["value"],Qh=["href"],Jh={__name:"ControllerAside",emits:["output-modal"],setup(e,{emit:l}){const s=ao(),t=Fe(),a=l,o=[{icon:qu,label:"Where did the customizer go?",click:()=>ze.$emit("open-modal:legacy-migration")},{icon:Xn,label:"Legacy Links",click:()=>ze.$emit("open-modal:legacy-links")},{icon:_n,label:"Legacy Customizer",click:()=>ze.$emit("open-modal:legacy-customize")}],i=F(!1),r=F(""),p=F(!1),d=F(!1);function f(h){return le(this,arguments,function*({output:c,resolve:w}){yield de(se.put(`/outputs/${c._id}`,c),(y,S)=>s.setOne(y,S),()=>d.value=c._id,()=>d.value=!1),w()})}const u=O(()=>{if(!s.list.length)return null;if(s.previewId){const h=s.getById(s.previewId);if(h)return h}const c=s.list.find(h=>h.type==="output_viewer");if(c)return c;const w=s.list.find(h=>h.name==="Viewer");return w||s.list[0]});no(O(()=>t.get),u,{editMode:!1}),Te(u,c=>{c&&(!s.previewId||!s.getById(s.previewId))&&(s.previewId=c._id)},{immediate:!0});const m=O(()=>({width:`${100/.25}%`,height:`${100/.25}%`,transform:`scale(${.25})`,transformOrigin:"0 0"}));function b(c){return le(this,null,function*(){if(!c){r.value="";return}const w=new URL(`output/${c._id}/`,window.location.origin);w.searchParams.set("v","2");try{const h=yield se.get(`/outputs/${c._id}/signature`,{params:{str:w.pathname+w.search}});h.data?w.searchParams.set("signature",h.data):w.searchParams.delete("v"),r.value=w.toString()}catch(h){console.error("Failed to generate output URL:",h),r.value=w.toString()}})}return Te(u,b,{immediate:!0}),(c,w)=>{const h=pe("FaIcon");return x(),$("div",null,[n("header",Vh,[n("div",jh,[w[8]||(w[8]=n("h2",{class:"flex-auto"},"Dashboard",-1)),v($t,{items:o,"dropdown-class":"text-sm","button-label":"btn-legacy-dropdown","button-class":"btn-ctrl text-sm p-0 h-
127 w-7",align:"left",dark:"",teleport:""}),n("button",{class:"btn py-0 px-3 h-7 text-sm bg-white hover:bg-neutral-800 focus:bg-neutral-800 text-neutral-800 hover:text-white focus:text-white border border-white hover:border-neutral-600 focus:border-white focus:ring-0",title:"Manage output links","data-label":"btn-output-links",onClick:w[0]||(w[0]=y=>a("output-modal"))},[v(h,{icon:g(Cl),class:"!align-baseline",size:"xs","fixed-width":""},null,8,["icon"]),w[7]||(w[7]=U(" Output Links ",-1))])])]),n("div",qh,[n("div",{class:"border border-neutral-700 rounded overflow-hidden bg-placeholder-dark relative group","data-label":"output-preview",onMouseenter:w[4]||(w[4]=y=>i.value=!0),onMouseleave:w[5]||(w[5]=y=>i.value=!1)},[n("div",Wh,[u.value?(x(),$("div",{key:0,class:"absolute inset-0",style:$e(m.value)},[v($u,{output:u.value,embedded:!0},null,8,["output"])],4)):(x(),$("div",Gh,[n("div",Xh,[v(h,{icon:g(Cl),size:"2x",class:"mb-2 opacity-50"},null,8,["icon"]),w[9]||(w[9]=n("p",null,"No outputs available",-1)),w[10]||(w[10]=n("p",{class:"text-xs mt-1"},'Click "Output Links" to create one',-1))])])),v(to,{name:"fade"},{default:L(()=>[i.value&&u.value?(x(),$("div",Yh,[n("div",Kh,[w[11]||(w[11]=n("span",{class:"flex-none text-xs uppercase font-semibold text-neutral-400"}," Preview: ",-1)),me(n("select",{"onUpdate:modelValue":w[1]||(w[1]=y=>g(s).previewId=y),class:"flex-1 btn-ctrl h-7 text-sm text-left",title:"Select output to preview",onClick:w[2]||(w[2]=Be(()=>{},["stop"]))},[(x(!0),$(ee,null,ge(g(s).list,y=>(x(),$("option",{key:y._id,value:y._id},q(y.name),9,Zh))),128))],512),[[Mt,g(s).previewId]]),n("button",{class:"flex-none btn-ctrl p-0 h-7 w-7 text-center",title:"Customize output",onClick:w[3]||(w[3]=y=>p.value=!0)},[v(h,{icon:g(_n),size:"xs","fixed-width":""},null,8,["icon"])]),u.value&&r.value?(x(),$("a",{key:0,href:r.value,target:"_blank",class:"flex-none btn-ctrl p-0 h-7 w-7 leading-7 text-center",title:"Open output in new tab"},[v(h,{icon:g(kt),size:"xs","fixed-width":""},null,8,["icon"])],8,Qh)):N("",!0)])])):N("",!0)]),_:1})])],32),v(kg,{class:"!mt-1"}),v(Og),v(Qr,{class:"hidden lg:block"}),v(Jr,{class:"hidden lg:block"})]),v(qr,{open:p.value,"onUpdate:open":w[6]||(w[6]=y=>p.value=y),output:u.value,loading:d.value,"onUpdate:output":f},null,8,["open","output","loading"])])}}},e2={class:"table-settings"},t2={class:"w-full"},n2=["value"],l2={class:"flex gap-1 w-full"},s2=["value"],o2=["disabled"],a2=["disabled"],i2=["value"],r2=["href"],u2={class:"text-xs text-neutral-400 text-center"},d2={__name:"ApiModal",props:{roomPid:{type:String,required:!0},open:Boolean,permission:Boolean,isOwner:Boolean},emits:["update:open"],setup(e,{emit:l}){const s=Fe(),t=l,a=e,o=F(!0),i=F("");function r(){i.value="",de(se.get(`/rooms/${s.pid}/api-key`),m=>i.value=m.apiKey||"",()=>o.value=!0,()=>o.value=!1)}const p=O(()=>`https://stagetimer.io/docs/api-v1/?room_id=${a.roomPid}&api_key=${i.value||"YOUR_API_KEY"}&base_url=${d.value}`),d=O(()=>{let m="https://api.stagetimer.io/";return m.startsWith("/")&&(m=new URL(m,window.location.origin)),new URL("v1/",m)});function f(){!a.permission||!a.isOwner||de(se.post(`/rooms/${s.pid}/generate-api-key`),(m,b)=>{s.setSecrets(m,b),i.value=m.apiKey||""},()=>o.value=!0,()=>o.value=!1)}function u(){!a.permission||!a.isOwner||de(se.post(`/rooms/${s.pid}/rotate-api-key`),(m,b)=>{s.setSecrets(m,b),i.value=m.apiKey||""},()=>o.value=!0,()=>o.value=!1)}return(m,b)=>{const c=pe("FaIcon"),w=pe("router-link");return x(),Z(Le,{open:e.open,icon:g(Ui),title:"API",closable:"","hide-footer":"","body-class":"font-light space-y-4","data-label":"modal-controller-api","onUpdate:open":b[4]||(b[4]=h=>t("update:open",h)),onShow:r},{default:L(()=>[e.permission?e.isOwner?N("",!0):(x(),Z(zl,{key:1},{default:L(()=>[...b[6]||(b[6]=[U(" Only the room owner can generate an API Key. ",-1)])]),_:1})):(x(),Z(It,{key:0,plan:"Pro"},{default:L(()=>[...b[5]||(b[5]=[U(" Use of the API requires a license. ",-1)])]),_:1})),b[15]||(b[15]=n("p",null," To use the API generate an API key for this room. The documentation lists all available endpoints. ",-1)),n("table",e2,[n("tbody",null,[n("tr",null,[b[7]||(b[7]=n("th",{class:"h-10 whitespace-nowrap"}," Room ID ",-1)),n("td",t2,[n("input",{value:e.roomPid,class:"input-ctrl h-9 w-full",readonly:"",onClick:b[0]||(b[0]=h=>h.target.select())},null,8,n2)])]),n("tr",null,[b[10]||(b[10]=n("th",{class:"h-10 whitespace-nowrap"}," API Key ",-1)),n("td",l2,[o.value?(x(),$("div",{key:0,class:j(["input-ctrl h-9 leading-9 text-white/50 w-full",{"bg-animated from-neutral-900 to-white/5":o.value}])}
12,[...b[8]||(b[8]=[n("span",null,"Loading ...",-1)])],2)):i.value?(x(),$(ee,{key:1},[n("input",{class:"grow input-ctrl h-9 w-full",value:i.value,readonly:"",onClick:b[1]||(b[1]=h=>h.target.select())},null,8,s2),n("button",{class:"flex-none btn-ctrl w-9 h-9 p-0",title:"Generate new API key",disabled:!e.permission||!e.isOwner,onClick:Be(u,["stop"])},[v(c,{icon:g(Wu),size:"sm"},null,8,["icon"])],8,o2)],64)):(x(),$("button",{key:2,class:"btn-ctrl h-9 py-0","data-label":"btn-generate-api-key",disabled:!e.permission||!e.isOwner,onClick:Be(f,["stop"])},[v(c,{icon:g(sn),size:"xs",class:"mr-2"},null,8,["icon"]),b[9]||(b[9]=n("span",null,"Generate API Key",-1))],8,a2))])]),n("tr",null,[b[11]||(b[11]=n("th",{class:"h-10 whitespace-nowrap"}," API URL ",-1)),n("td",null,[n("input",{value:d.value,class:"input-ctrl h-9 w-full",readonly:"",onClick:b[2]||(b[2]=h=>h.target.select())},null,8,i2)])])])]),n("a",{href:p.value,target:"_blank",class:"btn-ctrl py-1 text-center w-full"},[b[12]||(b[12]=U(" API Documentation ",-1)),v(c,{icon:g(kt),size:"sm",class:"ml-1"},null,8,["icon"])],8,r2),n("div",u2,[v(c,{icon:g(Ot),size:"sm",class:"mr-1"},null,8,["icon"]),b[14]||(b[14]=U(" You can also use a team API key for all rooms. ",-1)),v(w,{to:{name:"dashboard",params:{teamId:g(s).teamId}},class:"text-blue-400 hover:underline",onClick:b[3]||(b[3]=h=>t("update:open",!1))},{default:L(()=>[...b[13]||(b[13]=[U(" Manage in Dashboard ",-1)])]),_:1},8,["to"])])]),_:1},8,["open","icon"])}}},c2={class:"flex items-start space-x-2 font-mono text-sm"},m2=["datetime"],p2={class:"whitespace-nowrap text-yellow-200"},f2=["innerHTML"],b2={__name:"LogMessage",props:{log:{type:Object,required:!0}},setup(e){const l=e,s=O(()=>{const o=new Date(l.log.createdAt);let i=jt(o,io()?"hh:mm:ss aa":"HH:mm:ss");return xi(o,new Date)||(i=jt(o,"yyyy-MM-dd")+" "+i),i}),t=O(()=>{const o=l.log.subject;return(o==null?void 0:o.name)||(o==null?void 0:o.displayName)||(o==null?void 0:o.email)||"Unknown user"}),a=O(()=>Gu(l.log.action));return(o,i)=>(x(),$("div",c2,[n("time",{class:"whitespace-nowrap text-teal-600",datetime:e.log.createdAt},q(s.value),9,m2),n("span",p2,q(t.value),1),n("span",{class:"flex-auto truncate",innerHTML:a.value},null,8,f2)]))}},v2=Oe(b2,[["__scopeId","data-v-d4b23d12"]]),g2={class:"text-center space-x-2"},h2={key:0,class:"flex items-center text-teal-600 space-x-2"},x2={key:0,class:"flex items-center text-teal-600 space-x-2"},w2={class:"font-mono text-sm"},y2={class:"text-center"},ti=50,k2={__name:"LogsModal",props:{roomPid:{type:String,required:!0},open:Boolean},emits:["update:open"],setup(e,{emit:l}){const s=l,t=e,a=F([]),o=F(!1),i=F(null),r=F(!1);function p(){return le(this,null,function*(){a.value=[],r.value=!1,yield d(),dt(()=>ze.$emit("modal/scroll-to-bottom"))})}function d(){return le(this,null,function*(){o.value=!0,i.value=null;try{const{data:b}=yield se.get(`/rooms/${t.roomPid}/logs`,{params:{limit:ti,skip:a.value.length}});a.value.unshift(...b.reverse()),b.length<ti&&(r.value=!0)}catch(b){i.value=b}finally{o.value=!1}})}function f(){return le(this,null,function*(){o.value=!0,i.value=null;try{const{data:b}=yield se.get(`/rooms/${t.roomPid}/logs/export`,{params:{hour12:io()}}),c=document.createElement("a");c.href="data:text/plain;charset=utf-8,"+encodeURI(b),c.target="_blank",c.download=`logs-${t.roomPid}-${jt(new Date,"yyyy-MM-dd")}.txt`,c.click()}catch(b){b.value=b;return}finally{o.value=!1}})}const u=(b,c)=>xi(new Date(b.createdAt),new Date(c.createdAt)),m=b=>Ri(new Date(b.createdAt));return(b,c)=>(x(),Z(Le,{open:e.open,icon:g(Li),title:"Logs",closable:"","hide-footer":"","body-class":"font-light space-y-4","width-class":"max-w-5xl","onUpdate:open":c[1]||(c[1]=w=>b.$emit("update:open",w)),onShow:p},{default:L(()=>[n("div",g2,[r.value?N("",!0):(x(),$(ee,{key:0},[o.value?(x(),Z(zt,{key:0,inline:"",light:"",size:"sm"})):(x(),$("button",{key:1,type:"button",class:"btn-ctrl h-8",onClick:Be(d,["stop"])}," Load more ... "))],64)),n("button",{class:"btn-ctrl h-8",type:"button",onClick:f}," Export as file ")]),v(_t,{error:i.value},null,8,["error"]),n("ul",null,[r.value?(x(),$("li",h2,[...c[2]||(c[2]=[n("span",{class:"flex-grow border-b border-current"},null,-1),n("span",{class:"font-mono text-sm"},"Start of log file (logs are kept for 1 month)",-1),n("span",{class:"flex-grow border-b border-current"},null,-1)])])):N("",!0),(x(!0),$(ee,null,ge(a.value,(w,h)=>(x(),$(ee,{key:w._id},[a.value[h-1]&&!u(w,a.value[h-1])?(x(),$("li",x2,[c[3]||(c[3]=n("span",{class:"flex-grow border-b border-current"},null,-1)),n("span",w2,q(m(w)),1),c[4]||(c[4]=n("span",{class:"flex-grow border-b border-current"},null,-1))])):N("",!0),n("li",null,[v(v2,{log:w},null,8,["log"])])],64))),128))]),n("div",y2,[n("button",{class:"btn-ctrl h-8",onClick:c[0]||(c[0]=w=>s("update:open",!1))}
12," Close ")])]),_:1},8,["open","icon"]))}},$2={class:"flex gap-4 px-6"},S2={class:"pt-1 space-y-2"},C2=["value"],M2={class:"max-w-full overflow-x-auto !mt-3"},T2={class:"block mb-1 whitespace-nowrap",for:"select-start-time"},z2=["value"],I2={class:"block mb-1 whitespace-nowrap",for:"select-duration"},O2=["value"],D2=["value"],E2={class:"block mb-1 whitespace-nowrap",for:"select-speaker"},U2=["value"],L2=["value"],R2={class:"block mb-1 whitespace-nowrap",for:"select-labels"},A2=["value"],_2={class:"text-center"},F2=["onUpdate:modelValue"],B2={key:1},P2={class:"text-right whitespace-nowrap"},N2={class:"text-right whitespace-nowrap"},H2={class:"min-w-[260px]"},V2={class:"min-w-[260px]"},j2={class:"min-w-[260px]"},q2={class:"min-w-[260px] flex flex-wrap gap-2"},W2={class:"text-left px-6 !my-3"},G2={class:"text-red-300 mb-2"},X2={__name:"ContentRowsValidator",props:{csv:{type:Object,required:!0},headerRow:{type:Number,required:!0},headerCols:{type:Object,required:!0},contentRows:{type:Array,required:!0},existingTimerCount:{type:Number,default:0}},emits:["update:header-row","update:header-cols","update:content-rows"],setup(e,{emit:l}){const s=oo(),t=e,a=l,o=O({get:()=>t.headerRow,set:h=>a("update:header-row",h)}),i=O({get:()=>{var h;return((h=t.headerCols)==null?void 0:h.startTime)||0},set:h=>a("update:header-cols",re(Q({},t.headerCols),{startTime:h}))}),r=O({get:()=>{var h;return((h=t.headerCols)==null?void 0:h.duration)||0},set:h=>a("update:header-cols",re(Q({},t.headerCols),{duration:h}))}),p=O({get:()=>{var h;return((h=t.headerCols)==null?void 0:h.title)||0},set:h=>a("update:header-cols",re(Q({},t.headerCols),{title:h}))}),d=O({get:()=>{var h;return((h=t.headerCols)==null?void 0:h.speaker)||0},set:h=>a("update:header-cols",re(Q({},t.headerCols),{speaker:h}))}),f=O({get:()=>{var h;return((h=t.headerCols)==null?void 0:h.notes)||0},set:h=>a("update:header-cols",re(Q({},t.headerCols),{notes:h}))}),u=O({get:()=>{var h;return((h=t.headerCols)==null?void 0:h.labels)||0},set:h=>a("update:header-cols",re(Q({},t.headerCols),{labels:h}))}),m=O(()=>[...Array(t.csv.length).keys()].filter(y=>t.csv[y].filter(Boolean).length)),b=O(()=>t.csv[t.headerRow]),c=O(()=>[...Array(b.value.length).keys()].filter(y=>!!b.value[y])),w=O(()=>t.contentRows.some(h=>h.valid&&h.selected));return(h,y)=>{const S=pe("FaIcon"),D=Ct("tooltip");return x(),$(ee,null,[n("div",$2,[y[8]||(y[8]=n("span",{class:"flex-none border border-neutral-600 rounded-full text-center font-semibold h-8 w-8 leading-[calc(2rem-2px)]"}," 2 ",-1)),n("div",S2,[y[7]||(y[7]=n("label",{class:"font-semibold",for:"select-header-row"}," Select the correct header row ",-1)),me(n("select",{id:"select-header-row","onUpdate:modelValue":y[0]||(y[0]=k=>o.value=k),class:"input-ctrl h-8 w-full"},[(x(!0),$(ee,null,ge(m.value,k=>(x(),$("option",{key:`header-row-${k}`,value:k},q(e.csv[k].filter(Boolean).join(", ")),9,C2))),128))],512),[[Mt,o.value]])])]),y[24]||(y[24]=n("div",{class:"flex gap-4 px-6"},[n("span",{class:"flex-none border border-neutral-600 rounded-full text-center font-semibold h-8 w-8 leading-[calc(2rem-2px)]"}," 3 "),n("div",{class:"pt-1 space-y-2"},[n("label",{class:"font-semibold"}," Assign the correct columns ")])],-1)),n("div",M2,[n("table",Rt({class:"table w-full !mt-2"},h.$attrs),[n("thead",null,[n("tr",null,[y[21]||(y[21]=n("th",null,null,-1)),n("th",null,[n("label",T2,[v(Y,{tooltip:"The importer understands values like <code>8:30 PM</code>, <code>20:30</code>, <code>20:30:00</code> or <code>2022-01-01 20:30</code>"},{default:L(()=>[...y[9]||(y[9]=[U(" Start Time ",-1)])]),_:1})]),me(n("select",{id:"select-start-time","onUpdate:modelValue":y[1]||(y[1]=k=>i.value=k),class:"input-ctrl w-full"},[y[10]||(y[10]=n("option",{value:-1},"- Select -",-1)),(x(!0),$(ee,null,ge(c.value,k=>(x(),$("option",{key:`start-time-${k}`,value:k},q(b.value[k]),9,z2))),128))],512),[[Mt,i.value]])]),n("th",null,[n("label",I2,[v(Y,{tooltip:"The importer understands values like <code>10:00</code>, <code>00:10:00</code> or <code>10'</code>. If left empty, duration is calculated from start times."},{default:L(()=>[...y[11]||(y[11]=[U(" Duration ",-1)])]),_:1})]),me(n("select",{id:"select-duration","onUpdate:modelValue":y[2]||(y[2]=k=>r.value=k),class:"input-ctrl w-full"},[y[12]||(y[12]=n("option",{value:-1},"- Select -",-1)),(x(!0),$(ee,null,ge(c.value,k=>(x(),$("option",{key:`duration-${k}`,value:k},q(b.value[k]),9,O2))),128))],512),[[Mt,r.value]])]),n("th",null,[y[14]||(y[14]=n("label",{class:"block mb-1 whitespace-nowrap",for:"select-title"}," Title ",-1)),me(n("select",{id:"select-title","onUpdate:modelValue":y[3]||(y[3]=k=>p.value=k),class:"input-ctrl w-full"},[y[13]||(y[13]=n("option",{value:-1},"- Select -",-1)),(x(!0),$(ee,null,ge(c.value,k=>(x(),$("option",{key:`title-${k}`,value:k},q(b.value[k]),9,D2))),128))],512),[[Mt,p.value]])]),n("th",null,[n("label",E2,[v(Y,{tooltip:"For speakers or other additional information"},{default:L(()=>[...y[15]||(y[15]=[U(" Speaker ",-1)])]),_:1})]),me(n("select",{id:"select-speaker","onUpdate:modelValue":y[4]||(y[4]=k=>d.value=k),class:"input-ctrl w-full"},[y[16]||(y[16]=n("option",{value:-1},"- Select -",-1)),(x(!0),$(ee,null,ge(c.value,k=>(x(),$("option",{key:`speaker-${k}`,value:k},q(b.value[k]),9,U2))),128))],512),[[Mt,d.value]])]),n("th",null,[y[18]||(y[18]=n("label",{class:"block mb-1 whitespace-nowrap",for:"select-notes"}," Notes ",-1)),me(n("select",{id:"select-notes","onUpdate:modelValue":y[5]||(y[5]=k=>f.value=k),class:"input-ctrl w-full"},[y[17]||(y[17]=n("option",{value:-1},"- Select -",-1)),(x(!0),$(ee,null,ge(c.value,k=>(x(),$("option",{key:`notes-${k}`,value:k},q(b.value[k]),9,L2))),128))],512),[[Mt,f.value]])]),n("th",null,[n("label",R2,[v(Y,{tooltip:"Labels are imported as a comma-separated list, e.g. <code>Break, Live</code>"},{default:L(()=>[...y[19]||(y[19]=[U(" Labels ",-1)])]),_:1})]),me(n("select",{id:"select-labels","onUpdate:modelValue":y[6]||(y[6]=k=>u.value=k),class:"input-ctrl w-full"},[y[20]||(y[20]=n("option",{value:-1},"- Select -",-1)),(x(!0),$(ee,null,ge(c.value,k=>(x(),$("option",{key:`labels-${k}`,value:k},q(b.value[k]),9,A2))),128))],512),[[Mt,u.value]])])])]),n("tbody",null,[(x(!0),$(ee,null,ge(e.contentRows,(k,M)=>(x(),$("tr",{key:`content-row-${M}`,class:j({"opacity-50":!k.valid})},[n("td",_2,[k.valid?me((x(),$("input",{key:0,"onUpdate:modelValue":I=>k.selected=I,type:"checkbox",class:"rounded"},null,8,F2)),[[Fl,k.selected]]):me((x(),$("span",B2,[v(S,{icon:g(Pl)}
12,null,8,["icon"])])),[[D,"Not valid for import"]])]),n("td",P2,[v(g(Rs),null,{popper:L(()=>[U(q(k.startTime.parsed?k.startTime.source:"Not a valid time format"),1)]),default:L(()=>[n("code",null,q(k.startTime.parsed?g(nt)(new Date(k.startTime.parsed),{timezone:g(s)}):" â "),1)]),_:2},1024)]),n("td",N2,[v(g(Rs),null,{popper:L(()=>[U(q(k.duration.parsed!==null?k.duration.source:"Not a valid time format"),1)]),default:L(()=>[n("code",null,q(k.duration.parsed!==null?g(vn)(k.duration.parsed):" â "),1)]),_:2},1024)]),n("td",H2,q(k.title.parsed),1),n("td",V2,q(k.speaker.parsed),1),n("td",j2,q(k.notes.parsed),1),n("td",q2,[(x(!0),$(ee,null,ge(k.labels.parsed,I=>(x(),Z(jl,{key:`row-${M}-l-${I.name}`,label:I},null,8,["label"]))),128))])],2))),128))])],16)]),n("div",W2,[w.value?e.existingTimerCount>0?(x(),$(ee,{key:1},[v(S,{icon:g(Ot),class:"text-neutral-400 mr-2"},null,8,["icon"]),U(" This room has "+q(e.existingTimerCount)+" existing "+q(e.existingTimerCount===1?"item":"items")+". ",1)],64)):N("",!0):(x(),$(ee,{key:0},[n("p",G2,[v(S,{icon:g(Hl),class:"text-red-500 mr-2"},null,8,["icon"]),y[22]||(y[22]=U(" None of the rows are valid or selected for importing ",-1))]),y[23]||(y[23]=n("p",null,[U("Double check if you are using valid time formats like "),n("code",null,"10:00"),U(", "),n("code",null,"00:10:00"),U(" or "),n("code",null,"10'")],-1))],64))])],64)}}},Y2=Oe(X2,[["__scopeId","data-v-4f257ce6"]]);var ks,ni;function K2(){if(ni)return ks;ni=1;var e=Xu(),l=Yu(),s=wi(),t=Math.max,a=Math.min;function o(i,r,p){var d=i==null?0:i.length;if(!d)return-1;var f=d-1;return p!==void 0&&(f=s(p),f=p<0?t(d+f,0):a(f,d-1)),e(i,l(r,3),f,!0)}return ks=o,ks}var Z2=K2();const Q2=ln(Z2);function J2(e){const l=e.findIndex(p=>p[0]==="Start"&&p[1]==="Duration"&&p[2]==="Title");if(l!==-1)return l;const s=tx(e);if(s!==-1)return s;const t=e.map(p=>p.filter(d=>ro(d)!==null).length),a=e.map(p=>p.filter(Boolean).length),o=ax(t.slice(),{zero:!1}),i=(p,d)=>t[d]===o&&a[d]>2;return Math.max(e.findIndex(i)-1,0)}const ex=new Set(["start","time","cue","zeit","hora","inicio","début","heure","begin","beginning","clock","duration","length","trt","dauer","runtime","dur","duración","durée","laufzeit","end","finish","ende","fin","segment","title","name","topic","speaker","presenter","who","what","description","item","act","subject","activity","agenda","programm","program","programme","wer","was","bemerkungen","referent","referentin","thema","präsentation","moderation","notes","remarks","comment","comments","content","labels","tags","category"]);function tx(e){let l=-1,s=0;for(let t=0;t<e.length;t++){const a=e[t];if(a.filter(Boolean).length<2)continue;const i=a.reduce((r,p)=>{const d=p.trim().toLowerCase();return r+(ex.has(d)?1:0)},0);i>s&&(s=i,l=t)}return s>=2?l:-1}const nx=[["startTime",new Set(["start","time","zeit","hora","begin","beginning","clock","début","heure","inicio"])],["duration",new Set(["duration","dur","dur.","dauer","length","trt","runtime","laufzeit","durée","duración"])],["labels",new Set(["labels","tags","category","categories"])],["speaker",new Set(["speaker","presenter","host","who","wer","referent","referentin","moderator","moderation"])],["notes",new Set(["notes","remarks","comment","comments","bemerkungen"])],["title",new Set(["title","segment","activity","topic","program","programm","programme","agenda","item","act","subject","was","thema","description","content"])]];function lx(e,l){if(isNaN(l)||l<0)throw new Error(`headerIndex=${l} is invalid`);const s=e[l];if(!s)throw new Error(`No header row found at index ${l}`);const t={startTime:-1,duration:-1,title:-1,speaker:-1,notes:-1,labels:-1},a=new Set;for(const[u,m]of nx){const b=s.findIndex((c,w)=>{if(a.has(w))return!1;const h=c.trim().toLowerCase();return m.has(h)});b!==-1&&(t[u]=b,a.add(b))}if(Object.values(t).every(u=>u!==-1))return t;const i=e.map(u=>u.filter(Boolean).length),r=i.reduce((u,m)=>m>u?m:u,0),p=i.findIndex((u,m)=>m>l&&u===r),d=e[p]||e[l+1]||[],f=u=>u<0||!d[u]||!s[u]?-1:u;if(t.startTime===-1){const u=d.findIndex((m,b)=>!a.has(b)&&Fn(m)!==null);u!==-1&&(t.startTime=f(u),t.startTime!==-1&&a.add(u))}if(t.duration===-1){const u=Q2(d,(m,b)=>!a.has(b)&&ro(m)!==null);u!==-1&&(t.duration=f(u),t.duration!==-1&&a.add(u))}if(t.title===-1){const u=Math.max(t.startTime,t.duration,0);let m=d.findIndex((b,c)=>c>u&&!a.has(c)&&/[a-zA-Z]/.test(b));m!==-1&&(t.title=f(m),t.title!==-1&&a.add(m))}if(t.speaker===-1&&t.title!==-1){const u=d.findIndex((m,b)=>b>t.title&&!a.has(b)&&/[a-zA-Z]/.test(m));if(u!==-1){const m=w=>w.reduce((h,y)=>h+y,0)/w.length,b=m(e.slice(l+1).map(w=>{var h;return((h=w[t.title])==null?void 0:h.length)||0}));m(e.slice(l+1).map(w=>{var h;return((h=w[u])==null?void 0:h.length)||0}))>b?(a.delete(t.title),t.speaker=f(t.title),t.title=f(u),t.title!==-1&&a.add(u),t.speaker!==-1&&a.add(t.speaker)):(t.speaker=f(u),t.speaker!==-1&&a.add(u))}}if(t.notes===-1&&t.title!==-1){const u=Math.max(t.title,t.speaker),m=d.findIndex((b,c)=>c>u&&!a.has(c)&&/[a-zA-Z]/.test(b));m!==-1&&(t.notes=f(m),t.notes!==-1&&a.add(m))}return t}function sx(e,l=0,s={}){return e.slice(l+1,e.length).map((t,a)=>{var i,r,p,d,f;const o={index:l+a+1,valid:!1,selected:!1,startTime:{source:null,parsed:null},duration:{source:null,parsed:null},title:{source:null,parsed:null},speaker:{source:null,parsed:null},notes:{source:null,parsed:null},labels:{source:null,parsed:null}};if(s.startTime>=0&&(o.startTime.source=t[s.startTime],o.startTime.parsed=Fn(t[s.startTime])),s.duration>=0)o.duration.source=t[s.duration],o.duration.parsed=ro(t[s.duration]);else if(o.startTime.parsed){const u=o.startTime.parsed,m=ix(e,o.index,s.startTime);if(m){const b=(i=e[m])==null?void 0:i[s.startTime],c=Fn(b);o.duration.source=`${o.startTime.source} to ${b}`,o.duration.parsed=Iu(c,u)}}if(s.title>=0&&(o.title.source=t[s.title],o.title.parsed=(r=t[s.title])==null?void 0:r.trim()),s.speaker>=0&&(o.speaker.source=t[s.speaker],o.speaker.parsed=(p=t[s.speaker])==null?void 0:p.trim()),s.notes>=0&&(o.notes.source=t[s.notes],o.notes.parsed=(d=t[s.notes])==null?void 0:d.trim()),s.labels>=0){o.labels.source=t[s.labels];const u=(f=t[s.labels])==null?void 0:f.trim();o.labels.parsed=u?u.split(",").map(m=>({name:m.trim(),color:ox(m.trim())})):[]}return o.valid=o.duration.parsed!==null&&(!!o.title.parsed||!!o.speaker.parsed),o.selected=o.valid,o})}const bl=new Map,li=new Set;function ox(e){if(bl.has(e))return bl.get(e);const l=["#4CAF50","#F44336","#2196F3","#FFC107","#9C27B0","#4338CA","#E91E63","#009688","#f97316","#795548","#8B4513","#607D8B"];let s;for(const t of l)if(!li.has(t)){s=t;break}return s||(s=l[bl.size%l.length]),bl.set(e,s),li.add(s),s}function ax(e,{zero:l=!0}={}){return e.sort((s,t)=>e.filter(a=>a===s).length-e.filter(a=>a===t).length).filter(s=>l?!0:s!==0).pop()}function ix(e,l,s){for(let t=l+1;t<e.length;t++)if(Fn(e[t][s])!==null)return t}function rx(e){let l=null;return e.map((s,t)=>{const a=Q({},s);if(t===0)a.startTime=re(Q({},s.startTime),{shouldSave:!!s.startTime.parsed}),s.startTime.parsed&&s.duration.parsed&&(l=new Date(s.startTime.parsed).getTime()+s.duration.parsed);else if(s.startTime.parsed&&l){const o=new Date(s.startTime.parsed).getTime();Math.abs(o-l)<6e4?a.startTime=re(Q({},s.startTime),{shouldSave:!1}):a.startTime=re(Q({},s.startTime),{shouldSave:!0}),s.duration.parsed&&(l=o+s.duration.parsed)}else a.startTime=re(Q({},s.startTime),{shouldSave:!!s.startTime.parsed}),s.duration.parsed&&l&&(l=l+s.duration.parsed);return a})}function ux(e){return e.replace(/\r\n/g,` 13`)}const dx={class:"space-x-3"},cx=["disabled"],mx={class:"link",href:"https://docs.google.com/spreadsheets/d/18Xy_YjEY1SZahrBXi6t1bdwxC4xqdj3YebV_wS-yv-0/template/preview",target:"blank",rel:"noopener"},px={class:"flex gap-4 px-6"},fx={class:"flex items-center font-light space-x-3"}
13,bx={key:0,class:"overflow-hidden h-2 rounded bg-neutral-600"},vx={class:"pb-6 px-6"},gx={class:"flex gap-2 max-w-3xl mx-auto"},hx=["disabled"],xx=["disabled"],wx=["disabled"],yx=["disabled"],kx={__name:"ImportCSVModal",props:{open:Boolean,permission:Boolean,resource:{type:String,default:"timers",validator:e=>["timers"].includes(e)},isOwner:Boolean},emits:["update:open"],setup(e,{emit:l}){const s=Fe(),t=wt(),a=l,o=e,i=F(!1),r=F(null),p=F(0),d=F(null),f=F(null),u=F(!1),m=F(null),b=F(null),c=F({startTime:-1,duration:-1,title:-1,speaker:-1,notes:-1,labels:-1}),w=F([]);Te(b,I),Te(c,I);const h=O(()=>!!f.value),y=O(()=>!o.permission||!o.isOwner),S=O(()=>w.value.some(T=>T.valid&&T.selected)),D=O(()=>t.orderedIds.length);function k(T){return le(this,null,function*(){const C=T.target.files[0];yield M(C),d.value=C,m.value=null,i.value=!0})}function M(T){return le(this,null,function*(){const C=yield Ku(()=>import("./papaparse.min-CLfTknQe.js").then(P=>P.p),__vite__mapDeps([0,1])),E=yield T.text(),{data:_}=C.parse(ux(E),{skipEmptyLines:"greedy"});f.value=_,b.value=J2(_)||0,c.value=lx(_,b.value),I()})}function I(){w.value=sx(f.value,b.value,c.value)}function R(T){return le(this,null,function*(){r.value=T;const C=w.value.filter(P=>P.selected),_=rx(C).map(P=>({startTime:P.startTime.shouldSave?P.startTime.parsed:null,duration:P.duration.parsed,title:P.title.parsed,speaker:P.speaker.parsed,notes:P.notes.parsed,labels:P.labels.parsed}));yield de(se.post(`/rooms/${s.pid}/${o.resource}/import`,_,{params:{importFormat:"CSV",mode:T}}),(P,A)=>{s.set(P,A),a("update:open",!1),i.value=!1},()=>u.value=!0,()=>u.value=!1,P=>m.value=P)})}return(T,C)=>{const E=pe("FaIcon");return x(),$(ee,null,[v(Le,{open:e.open,icon:g(ll),title:"CSV Import",closable:"","hide-footer":"","body-class":"font-light space-y-6","onUpdate:open":C[1]||(C[1]=_=>a("update:open",_))},{default:L(()=>[e.permission?e.isOwner?N("",!0):(x(),Z(zl,{key:1},{default:L(()=>[...C[12]||(C[12]=[U(" Only the room owner can use the import. ",-1)])]),_:1})):(x(),Z(It,{key:0,plan:"Pro"},{default:L(()=>[...C[11]||(C[11]=[U(" Import requires a license. ",-1)])]),_:1})),n("div",dx,[n("button",{class:j(["btn-ctrl text-sm h-8",{"!bg-teal-800 border-teal-600 hover:!border-teal-300 !text-white":!y.value}]),disabled:y.value,onClick:C[0]||(C[0]=()=>T.$refs.fileImport.click())},[v(E,{icon:g(ll),size:"sm",class:"mr-1"},null,8,["icon"]),C[13]||(C[13]=U(" Select File ",-1))],10,cx),n("a",mx,[C[14]||(C[14]=n("span",{class:"underline"},"Example Rundown Sheet",-1)),v(E,{icon:g(kt),size:"sm",class:"ml-1"},null,8,["icon"])])]),n("input",{ref:"fileImport",class:"hidden",type:"file",accept:".csv",onChange:k},null,544),n("div",{class:j(["text-neutral-400 space-y-3",{"opacity-50":y.value}])},[...C[15]||(C[15]=[n("p",null,"The CSV importer tries to scan the structure of your CSV file. You can fine tune the details before commiting to the import.",-1),n("p",null,[U("Here's a guide how to export a CSV file from "),n("a",{href:"https://support.microsoft.com/en-us/office/import-or-export-text-txt-or-csv-files-5250ac4c-663c-47ce-937b-339e391393ba#ID0EBBN-supTabControlContent-1",target:"_blank",rel:"noopener",class:"link"},"Microsoft Excel"),U(" or "),n("a",{href:"https://www.solveyourtech.com/save-csv-google-sheets/",target:"_blank",rel:"noopener",class:"link"},"Google Sheets"),U(".")],-1)])],2),v(_t,{error:m.value,class:"!mb-3"},null,8,["error"])]),_:1},8,["open","icon"]),v(Le,{open:i.value,"onUpdate:open":C[9]||(C[9]=_=>i.value=_),icon:g(ll),title:"CSV Import",closable:"","body-class":"space-y-6 !px-0","width-class":"max-w-full","ignore-outside-click":"",busy:u.value,onHide:C[10]||(C[10]=_=>a("update:open",!1))},{footer:L(()=>[n("footer",vx,[n("div",gx,[n("button",{class:j(["flex-1 btn-ctrl h-8",{"pointer-events-none":u.value}]),disabled:u.value,onClick:C[5]||(C[5]=_=>i.value=!1)}," Cancel ",10,hx),D.value>0?(x(),$(ee,{key:0},[n("button",{class:j(["flex-1 btn-ctrl h-8 hover:bg-red-900 hover:!border-red-600",[!S.value||u.value?"pointer-events-none":"text-red-400"]]),disabled:!S.value||u.value,onClick:C[6]||(C[6]=_=>R("replace"))},[u.value&&r.value==="replace"?(x(),Z(zt,{key:0,size:"sm",color:"translucent",class:"inline-block align-middle mr-2"})):N("",!0),C[18]||(C[18]=U(" Replace all ",-1))],10,xx),n("button",{class:j(["flex-1 btn-ctrl h-8 hover:bg-green-900 hover:!border-green-600",[!S.value||u.value?"pointer-events-none":"!text-green-500"]]),disabled:!S.value||u.value,onClick:C[7]||(C[7]=_=>R("append"))},[u.value&&r.value==="append"?(x(),Z(zt,{key:0,size:"sm",color:"translucent",class:"inline-block align-middle mr-2"})):N("",!0),C[19]||(C[19]=U(" Append ",-1))],10,wx)],64)):(x(),$("button",{key:1,class:j(["flex-1 btn-ctrl h-8 font-semibold",[!S.value||u.value?"pointer-events-none":"!text-green-500"]]),disabled:!S.value||u.value,onClick:C[8]||(C[8]=_=>R("replace"))},[u.value?(x(),Z(zt,{key:0,size:"sm",color:"translucent",class:"inline-block align-middle mr-2"})):N("",!0),C[20]||(C[20]=U(" Import ",-1))],10,yx))])])]),default:L(()=>[n("div",px,[C[17]||(C[17]=n("span",{class:"flex-none border border-neutral-600 rounded-full text-center font-semibold h-8 w-8 leading-[calc(2rem-2px)]"}," 1 ",-1)),n("div",Rt({class:"pt-1 space-y-2"},T.$attrs),[C[16]||(C[16]=n("label",{class:"font-semibold",for:"select-header-row"}," Uploaded File ",-1)),n("div",fx,[v(E,{icon:h.value?g(At):g(ll),class:j({"text-green-400":h.value})},null,8,["icon","class"]),n("span",null,q(d.value?d.value.name:"..."),1)]),h.value?N("",!0):(x(),$("div",bx,[n("div",{class:"h-2 bg-sky-500",style:$e({width:p.value+"%"})},null,4)]))],16)]),f.value?(x(),Z(Y2,{key:0,"header-row":b.value,"onUpdate:headerRow":C[2]||(C[2]=_=>b.value=_),"header-cols":c.value,"onUpdate:headerCols":C[3]||(C[3]=_=>c.value=_),"content-rows":w.value,"onUpdate:contentRows":C[4]||(C[4]=_=>w.value=_),csv:f.value,"existing-timer-count":D.value,class:j({"pointer-events-none opacity-50":u.value})},null,8,["header-row","header-cols","content-rows","csv","existing-timer-count","class"])):N("",!0),v(_t,{error:m.value,class:"mx-5"},null,8,["error"])]),_:1},8,["open","icon","busy"])],64)}}},$x=Oe(kx,[["__scopeId","data-v-18686685"]]),Sx={__name:"ExportModal",props:{open:Boolean,permission:Boolean,resource:{type:String,default:"timers",validator:e=>["room","timers","messages"].includes(e)},exportFormat:{type:String,default:"CSV",validator:e=>["CSV","JSON"].includes(e)}},emits:["update:open"],setup(e,{emit:l}){const s=Ai(),t=Fe(),a=l,o=e,i=F(!1);function r(){return le(this,null,function*(){if(!o.permission)return;i.value=!0;let p;try{const b={hour12:t.hour12,exportFormat:o.exportFormat},c=o.resource==="room"?`/rooms/${t.pid}/export`:`/rooms/${t.pid}/${o.resource}/export`;p=yield se.get(c,{params:b})}catch(b){return s.httpError(b),a("update:open",!1)}finally{i.value=!1}const d=o.exportFormat==="JSON"?"application/json":"text/csv",f=o.exportFormat.toLowerCase(),u=o.resource==="room"?`${jt(new Date,"yyyy-MM-dd")}-${Bs(t.name||"unnamed")}.${f}`:`${jt(new Date,"yyyy-MM-dd")}-${Bs(t.name||"unnamed")}-${o.resource}.${f}`,m=document.createElement("a");m.href=`data:${d};charset=utf-8,`+encodeURIComponent(p.data),m.target="_blank",m.download=u,m.click(),a("update:open",!1)})}return(p,d)=>(x(),Z(Le,{open:e.open,icon:g(Zu),title:"Export",closable:"","hide-footer":"","body-class":"font-light space-y-4","onUpdate:open":d[0]||(d[0]=f=>p.$emit("update:open",f)),onShow:r},{default:L(()=>[e.permission?(x(),Z(zt,{key:1,class:"mx-auto"})):(x(),Z(It,{key:0,plan:"Pro"},{default:L(()=>[...d[1]||(d[1]=[U(" Exports require a license. ",-1)])]),_:1}))]),_:1},8,["open","icon"]))}},Cx={class:"w-8 flex justify-center"},Mx=["src"],Tx={class:"flex-1 truncate"},zx={__name:"RoomDropdown",props:{room:{type:Object,required:!0},plan:{type:Object,default:null},team:{type:Object,default:null}},emits:["patch:room"],setup(e,{emit:l}){const s=l,t=e,a=!1,o=Yn(),i=F(!1),r=F(!1),p=F(!1),d=ht({open:!1,resource:"timers"}),f=F(!1),u=ht({open:!1,resource:"timers",format:"CSV"}),m=O(()=>!!o.teamsMap[t.room.teamId]);function b(){r.value=!0}function c(){p.value=!0}function w(M){d.open=!0,d.resource=M}function h(){f.value=!0}
13function y(M){u.open=!0,u.resource=M,u.format={timers:"CSV",messages:"CSV",room:"JSON"}[M]}function S(){window.open("https://stagetimer.io/docs/controller/","_blank").focus()}const D=O(()=>{if(!o.uid||!m.value&&t.room.teamId||m.value&&o.teams.length===1)return;const M=t.team?`Owned by ${t.team.name}`:"Claim ownerless room";return{class:"text-sm",icon:Qu,label:M,items:o.teams.map(I=>({icon:I.id===t.room.teamId?At:void 0,label:I.name,click:()=>k(I.id),preventHide:!0}))}});function k(M){return le(this,null,function*(){return de(se.post(`/rooms/by-id/${t.room._id}/team`,{teamId:M,uid:t.uid}),I=>s("patch:room",I),()=>i.value=!0,()=>i.value=!1)})}return(M,I)=>(x(),$(ee,null,[v($t,Rt({items:[{icon:g(Vl),label:"Settings",click:()=>g(ze).$emit("open-modal:settings")},{icon:g(Ui),label:"API",click:b},{icon:g(Cl),label:"Output Links",click:()=>g(ze).$emit("open-modal:output")},{icon:g(Ei),label:"Live Connections",click:()=>g(ze).$emit("open-modal:devices")},{separator:!0},{icon:g(lo),label:"Import",items:[{label:"CSV (Timers)",click:()=>w("timers")},{label:"JSON",click:()=>h()}]},{icon:g(_i),label:"Export",items:[{label:"CSV (Timers)",click:()=>y("timers")},{label:"CSV (Messages)",click:()=>y("messages")},{label:"JSON",click:()=>y("room")}]},{separator:!0},{icon:g(Li),label:"Logs",click:c},{icon:g(Fi),label:"Shortcuts",click:()=>g(ze).$emit("open-modal:shortcuts")},{icon:g(kt),label:"Documentation",click:S},{separator:!0},D.value],dark:"",align:"right","button-class":"btn-ctrl bg-neutral-800 hover:border-neutral-400 h-8 py-0","button-label":"btn-controller-room","dropdown-class":"w-52"},M.$attrs),{default:L(()=>[...I[5]||(I[5]=[U(" Room ",-1)])]),"after-content":L(()=>{var R,T;return[t.plan?(x(),Z(gi((R=t.team)!=null&&R.id&&!a?"router-link":"a"),Rt({key:0,"data-label":"btn-dropdown-plan",class:"flex items-center btn pl-0 text-left text-sm hover:bg-neutral-700 focus:bg-neutral-700 w-full py-1"},(T=t.team)!=null&&T.id&&!a?{to:{name:"billing",params:{teamId:t.team.id}}}:{href:"https://stagetimer.io/pricing/"},{target:"_blank"}),{default:L(()=>[n("div",Cx,[t.plan.imageUrl?(x(),$("img",{key:0,style:{width:"1.5em"},src:t.plan.imageUrl},null,8,Mx)):N("",!0)]),n("span",Tx,q(t.plan.name||"Free")+" "+q(g(st)(t.plan,g(ot).LICENSED)?"License":""),1)]),_:1},16)):N("",!0)]}),_:1},16,["items"]),v(k2,{open:p.value,"onUpdate:open":I[0]||(I[0]=R=>p.value=R),"room-pid":t.room.pid},null,8,["open","room-pid"]),v($x,{open:d.open,"onUpdate:open":I[1]||(I[1]=R=>d.open=R),permission:g(st)(t.plan,g(ot).LICENSED),"is-owner":m.value,resource:d.resource},null,8,["open","permission","is-owner","resource"]),v(Pd,{open:f.value,"onUpdate:open":I[2]||(I[2]=R=>f.value=R),"team-id":t.room.teamId,permission:g(st)(t.plan,g(ot).LICENSED),"is-owner":m.value},null,8,["open","team-id","permission","is-owner"]),v(Sx,{open:u.open,"onUpdate:open":I[3]||(I[3]=R=>u.open=R),permission:g(st)(t.plan,g(ot).LICENSED),resource:u.resource,"export-format":u.format},null,8,["open","permission","resource","export-format"]),v(d2,{open:r.value,"onUpdate:open":I[4]||(I[4]=R=>r.value=R),"room-pid":t.room.pid,permission:g(st)(t.plan,g(ot).API_ACCESS),"is-owner":m.value},null,8,["open","room-pid","permission","is-owner"])],64))}},Ix=["disabled"],Ox={__name:"ControllerTitle",props:{title:{type:String,default:""},disabled:Boolean},emits:["update:title"],setup(e,{emit:l}){const s=l,t=e,a=F(),o=F(),i=F(!1),r=F("");function p(){t.disabled||(r.value=t.title,i.value=!0,dt(()=>{o.value.focus(),document.addEventListener("mousedown",u)}))}function d(){s("update:title",r.value),i.value=!1,document.removeEventListener("mousedown",u)}function f(){i.value=!1}function u(m){var b;(b=a.value)!=null&&b.contains(m.target)||d()}return(m,b)=>{const c=pe("faIcon");return i.value?(x(),$("div",{key:0,ref_key:"editingWrapperRef",ref:a,class:"flex space-x-2 pr-4"},[me(n("input",{ref_key:"inputRef",ref:o,"onUpdate:modelValue":b[0]||(b[0]=w=>r.value=w),class:"input-ctrl border border-neutral-600 h-8 py-0 flex-grow","data-label":"input-room-name",onKeyup:[Re(d,["enter"]),Re(f,["escape"])]},null,544),[[ft,r.value]]),n("button",{class:"btn-ctrl !bg-teal-800 border-teal-600 hover:!border-teal-300 !text-white text-sm h-8","data-label":"btn-save-room-name",onClick:d}," Save "),n("button",{class:"text-neutral-400 hover:text-sky-600 h-8 py-0","data-label":"btn-cancel-room-name",onClick:f},[v(c,{icon:g(Ju)},null,8,["icon"])])],512)):(x(),$("button",{key:1,class:"flex items-center gap-2 group underline decoration-dashed decoration-transparent hover:
13decoration-current transition-colors w-full","data-label":"btn-edit-room-name",disabled:e.disabled,onClick:p},[n("h1",{class:j(["text-2xl font-semibold truncate text-left",{"text-neutral-500":!e.title}])},q(e.title||"Unnamed"),3)],8,Ix))}}},Dx={class:"flex flex-col space-y-4"},Ex={__name:"SaveRoomModal",props:{roomPid:{type:String,required:!0},open:Boolean},emits:["update:open"],setup(e,{emit:l}){const s=l,t=e;return(a,o)=>{const i=pe("router-link");return x(),Z(Le,{open:t.open,icon:g(Bi),title:"Save Room",closable:"","hide-footer":"","body-class":"font-light space-y-4","data-label":"modal-save-room","onUpdate:open":o[0]||(o[0]=r=>s("update:open",r))},{default:L(()=>[o[3]||(o[3]=n("p",null," Save this room to your dashboard for easy access in the future. ",-1)),n("div",Dx,[v(i,{to:{name:"signup",query:{"save-room":t.roomPid}},class:"btn-ctrl py-2 text-center w-full !bg-teal-800 border-teal-600 hover:!border-teal-300 !text-white"},{default:L(()=>[...o[1]||(o[1]=[U(" Sign Up ",-1)])]),_:1},8,["to"]),v(i,{to:{name:"login",query:{"save-room":t.roomPid}},class:"btn-ctrl py-2 text-center w-full"},{default:L(()=>[...o[2]||(o[2]=[U(" Log In ",-1)])]),_:1},8,["to"])]),o[4]||(o[4]=n("p",{class:"text-sm text-neutral-400"}," Creating an account or logging in with this link will save this room and allow you to access it easily from your dashboard. ",-1))]),_:1},8,["open","icon"])}}},Ux={key:1,class:"flex-none flex text-right"},Lx=["to"],Rx={__name:"ControllerHeader",setup(e){const l=Yn(),s=Fe(),t=wt(),a=F(!1),o=O({get:()=>s.name,set:i=>le(null,null,function*(){s.setName(i),de(se.post(`/rooms/${s.pid}/name`,{name:i}))})});return(i,r)=>{const p=pe("FaIcon");return x(),$(ee,null,[n("div",Rt({class:"flex items-center gap-2"},i.$attrs),[v(Ox,{title:o.value,"onUpdate:title":r[0]||(r[0]=d=>o.value=d),class:"flex-auto min-w-0 lg:pr-4",disabled:!!(g(s).uid&&g(s).uid!==g(l).uid)},null,8,["title","disabled"]),g(t).hasChimes?(x(),Z(Vd,{key:0,class:"flex-none"})):N("",!0),v(zx,{class:"flex-none",room:g(s).get,plan:g(s).plan,team:g(s).team},null,8,["room","plan","team"]),(x(),$("div",Ux,[v(ed,{"team-id":g(s).teamId,"btn-class":"btn-ctrl bg-neutral-800 hover:border-neutral-400 h-8 py-0",label:!1,dark:""},{default:L(()=>[n("button",{class:"btn-ctrl bg-neutral-800 hover:border-neutral-400 leading-8 h-8 py-0","data-label":"controller-save-button",to:{name:"signup",query:{"save-room":g(s).pid}},onClick:r[1]||(r[1]=d=>a.value=!0)},[v(p,{size:"sm",icon:g(Bi),class:"mr-1"},null,8,["icon"]),r[3]||(r[3]=U(" Save ",-1))],8,Lx)]),_:1},8,["team-id"])]))],16),v(Ex,{open:a.value,"onUpdate:open":r[2]||(r[2]=d=>a.value=d),"room-pid":g(s).pid},null,8,["open","room-pid"])],64)}}},Ax={class:"text-neutral-500 text-xs"},_x={class:"link",href:"/changelog/",target:"_blank"},Fx={class:"space-x-1"},Bx={class:"inline-flex items-baseline gap-px"},Px={key:0},Nx={__name:"ControllerFineprint",setup(e){const l=Fe(),s="PROD",t=F(void 0),a=F(void 0),o=F(void 0);let i=null;De(()=>{setTimeout(r,1e3),i=setInterval(r,1e4)}),Qe(()=>clearInterval(i));function r(){return le(this,null,function*(){try{const p=performance.now(),{data:d}=yield td.get("https://api.stagetimer.io/ping");t.value=Math.round(performance.now()-p),a.value=d.server,o.value=d.location}catch(p){}})}return(p,d)=>{const f=pe("FaIcon"),u=Ct("tooltip");return x(),$("div",Ax,[d[4]||(d[4]=n("a",{class:"link",href:"/"},"stagetimer.io",-1)),d[5]||(d[5]=U(" · ",-1)),n("a",_x,"v"+q(g(nd)),1),d[6]||(d[6]=U(" · ",-1)),d[7]||(d[7]=n("a",{class:"link",href:"/docs/",target:"_blank"},"Docs",-1)),g(l).licensed?(x(),$(ee,{key:0},[d[0]||(d[0]=U(" · ",-1)),v(f,{icon:g(ld),size:"sm"},null,8,["icon"]),d[1]||(d[1]=U()),d[2]||(d[2]=n("a",{class:"link",href:"mailto:[email protected]?subject=Idea%20or%20question%20about%20the%20controller%20page"},"Support",-1))],64)):N("",!0),d[8]||(d[8]=U(" · ",-1)),me((x(),$("span",Fx,[n("div",Bx,[n("div",{class:j(["w-1 bg-current",{"opacity-25":!t.value||t.value>800}]),style:{height:".3em"}},null,2),n("div",{class:j(["w-1 bg-current",{"opacity-25":!t.value||t.value>350}]),style:{height:".6em"}},null,2),n("div",{class:j(["w-1 bg-current",{"opacity-25":!t.value||t.value>150}]),style:{height:".9em"}},null,2)]),t.value?(x(),$("span",Px,q(t.value.toFixed(0))+" ms",1)):N("",!0)])),[[u,{content:t.value?`Your ping is <strong>${t.value} ms</strong>.<br>You are connected to <strong>${o.value}</strong>, server <strong>${a.value}</strong>.`:"Calculating ping...",html:!0}]]),g(s)==="DEV"?(x(),$(ee,{key:1},[d[3]||(d[3]=mu(' · <span class="inline sm:hidden" data-v-8b9504f9>xs</span><span class="hidden sm:inline md:hidden" data-v-8b9504f9>sm</span><span class="hidden md:inline lg:hidden" data-v-8b9504f9>md</span><span class="hidden lg:inline xl:hidden" data-v-8b9504f9>lg</span><span class="hidden xl:inline 2xl:hidden" data-v-8b9504f9>xl</span><span class="hidden 2xl:inline 3xl:hidden" data-v-8b9504f9>2xl</span><span class="hidden 3xl:inline" data-v-8b9504f9>3xl</span>',8))],64)):N("",!0)])}}},Hx=Oe(Nx,[["__scopeId","data-v-8b9504f9"]]),Vx={props:{panel:{type:String,default:"timers"},timers:{type:Number,default:void 0},messages:{type:Number,default:void 0}},emits:["update:panel"],data:()=>({faStopwatch:Pi,faComment:sd})},jx={class:"h-full"},qx={key:0,class:"text-xs text-neutral-500"}
13,Wx={key:0,class:"text-xs text-neutral-500"};function Gx(e,l,s,t,a,o){const i=pe("FaIcon");return x(),$("div",jx,[l[2]||(l[2]=n("div",{class:"controller-subheader"},null,-1)),n("button",{class:j(["btn-vert w-16 h-16",{active:s.panel==="timers"}]),title:"Show timer panel",onClick:l[0]||(l[0]=r=>e.$emit("update:panel","timers"))},[v(i,{icon:e.faStopwatch,"fixed-width":""},null,8,["icon"]),s.timers!==void 0?(x(),$("div",qx,q(s.timers),1)):N("",!0)],2),n("button",{class:j(["btn-vert w-16 h-16",{active:s.panel==="messages"}]),title:"Show message panel",onClick:l[1]||(l[1]=r=>e.$emit("update:panel","messages"))},[v(i,{icon:e.faComment,"fixed-width":""},null,8,["icon"]),s.messages!==void 0?(x(),$("div",Wx,q(s.messages),1)):N("",!0)],2)])}const Xx=Oe(Vx,[["render",Gx],["__scopeId","data-v-8b5c9339"]]),Yx=["data-label"],Kx=["data-label","disabled","onClick"],Zx={key:0,class:"inline-block w-4 mr-2"},Qx={key:1,class:"border-neutral-700 m-1"},Jx={__name:"FloatMenu",props:{items:{type:Array,default:()=>[]},buttonClass:{type:[String,Array,Object],default:""},buttonLabel:{type:[String],default:""},placement:{type:String,default:"left"},dark:Boolean},setup(e){function l(t,a){var o;(o=t.click)==null||o.call(t),a==null||a()}function s(t){return t.disabled===!0}return(t,a)=>{const o=pe("FaIcon");return x(),Z(g(eo),{placement:e.placement,"popper-class":"popper-timer-item ring-0",dark:e.dark},{default:L(()=>[n("button",{class:j(e.buttonClass),type:"button","data-label":e.buttonLabel},[Ke(t.$slots,"default")],10,Yx)]),popper:L(({hide:i})=>[(x(!0),$(ee,null,ge(e.items,(r,p)=>(x(),$(ee,{key:r.label||p},[r.label?(x(),$("button",{key:0,class:j(["btn text-left text-sm block w-full px-3 py-1",{"hover:bg-neutral-700":e.dark&&!s(r),"hover:bg-neutral-200":!e.dark&&!s(r),"opacity-50":s(r)}]),"data-label":"btn-float-menu-"+r.label.toLowerCase(),disabled:s(r),onClick:d=>l(r,i)},[r.icon?(x(),$("span",Zx,[r.icon?(x(),Z(o,{key:0,icon:r.icon,size:"sm",class:"text-neutral-500"},null,8,["icon"])):N("",!0)])):N("",!0),n("span",null,q(r.label),1)],10,Kx)):r.divider?(x(),$("hr",Qx)):N("",!0)],64))),128))]),_:3},8,["placement","dark"])}}},ew={props:{modelValue:{type:String,default:""},options:{type:Array,default:()=>[]},selectClass:{type:[String,Object,Array],default:""}},emits:["update:modelValue"],data:()=>({faCaretDown:_s}),computed:{selected:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}}}},tw={class:"relative inline-block"},nw=["value","disabled"],lw={class:"absolute z-0 right-1 top-1/2 -translate-y-1/2"};function sw(e,l,s,t,a,o){const i=pe("FaIcon");return x(),$("div",tw,[me(n("select",{"onUpdate:modelValue":l[0]||(l[0]=r=>o.selected=r),class:j(["relative z-10 m-0 py-0 pl-1 pr-3 h-full w-full focus:ring-2",s.selectClass])}
13,[(x(!0),$(ee,null,ge(s.options,({value:r,label:p,disabled:d})=>(x(),$("option",{key:r,value:r,disabled:d},q(p),9,nw))),128))],2),[[Mt,o.selected]]),n("span",lw,[v(i,{icon:e.faCaretDown,size:"sm"},null,8,["icon"])])])}const ow=Oe(ew,[["render",sw],["__scopeId","data-v-a1c0731c"]]),aw={class:"relative"},iw={class:"space-y-3"},rw={class:"text-right space-x-2"},uw=["disabled"],dw=["disabled"],cw="[data-float-portal], .mx-datepicker-main",mw={__name:"ControllerFloat",props:{open:Boolean,autoHide:Boolean,busy:Boolean,widthClass:{type:String,default:"max-w-2xl"}},emits:["update:open","save","open","close"],setup(e,{emit:l}){const s=F(null),t=F(null),a=F(null),o=od(),i=pu().uid.toString(),r=Ni(),p=F(!1),d=l,f=e,{floatingStyles:u,middlewareData:m,placement:b}=Wd(s,t,{placement:"bottom",middleware:[Xd(10),Yd(),Kd({padding:10}),Zd({element:a,padding:12})],whileElementsMounted:(I,R,T)=>Gd(I,R,T,{animationFrame:!0})}),c=O(()=>{var I;return(I=b.value)==null?void 0:I.startsWith("top")}),w=O(()=>{const{x:I}=m.value.arrow||{};return{left:I!=null?`${I}px`:"",[c.value?"bottom":"top"]:"-4px"}}),h=O(()=>o.getZIndex(i));Te(()=>f.open,I=>{I!==p.value&&(p.value=I)}),Te(p,I=>{d("update:open",I),d(I?"open":"close"),I?(o.register(i),f.autoHide&&document.addEventListener("click",y)):(o.unregister(i),document.removeEventListener("click",y)),setTimeout(()=>r.emit(I?"open":"close"),300)}),Qe(()=>{document.removeEventListener("click",y),o.unregister(i)});function y(I){var T,C,E;if(f.busy)return;const R=I.target;(T=s.value)!=null&&T.contains(R)||(C=t.value)!=null&&C.contains(R)||(E=R.closest)!=null&&E.call(R,cw)||D()}function S(){p.value=!0}function D(){p.value=!1}function k(I){let R=!1;const T=()=>R=!0;r.emit("cancel",{preventDefault:T}),R||I()}function M(I){let R=!1;const T=()=>R=!0;r.emit("save",{preventDefault:T}),R||d("save",I)}return(I,R)=>(x(),$("div",aw,[n("div",{ref_key:"anchorEl",ref:s},[Ke(I.$slots,"default",{show:S,hide:D},void 0,!0)],512),(x(),Z(fu,{to:"body"},[v(to,{name:"fade"},{default:L(()=>[p.value?(x(),$("div",{key:0,ref_key:"floatingEl",ref:t,"data-float-portal":"",class:"absolute",style:$e(re(Q({},g(u)),{zIndex:h.value}))},[n("div",{class:j(["relative rounded border bg-neutral-800 border-neutral-700 text-white text-sm p-3 shadow-lg",e.widthClass])},[n("div",iw,[Ke(I.$slots,"popper",{hide:D,save:()=>M(D),events:g(r)},void 0,!0),n("div",rw,[n("button",{"data-label":"btn-float-cancel",class:j(["btn-ctrl h-7",{"pointer-events-none":e.busy}]),disabled:e.busy,onClick:R[0]||(R[0]=Be(T=>k(D),["stop"]))},"Cancel",10,uw),n("button",{"data-label":"btn-float-save",class:j(["btn-ctrl text-green-500 h-7",{"pointer-events-none":e.busy}]),disabled:e.busy,onClick:R[1]||(R[1]=Be(T=>M(D),["stop"]))},[e.busy?(x(),Z(zt,{key:0,size:"sm",color:"translucent",class:"inline-block align-middle mr-1"})):N("",!0),R[2]||(R[2]=n("span",null,"Save",-1))],10,dw)])])],2),n("div",{ref_key:"arrowEl",ref:a,class:j(["absolute w-2 h-2 bg-neutral-800 rotate-45 border-neutral-700",c.value?"border-r border-b":"border-l border-t"]),style:$e(w.value)},null,6)],4)):N("",!0)]),_:3})]))]))}},Sl=Oe(mw,[["__scopeId","data-v-361d1228"]]),pw={class:"space-y-4"},fw=["disabled"],bw={class:"grid grid-cols-12 gap-2"},vw=["disabled","onClick"],gw={class:"flex flex-wrap justify-between gap-x-3 gap-y-1 text-sm text-neutral-400"},hw=["disabled"],xw=["disabled"],ww={__name:"LabelEditForm",props:{label:{type:Object,required:!0},usageCount:{type:Number,default:0},busy:Boolean,events:{type:Object,default:null}},emits:["save","delete"],setup(e,{emit:l}){const s=l,t=e,a=F(null),o=F(""),i=F(""),r=F(!1),p=F(!1);Te(()=>t.label,b=>{b&&(o.value=b.name,i.value=b.color)},{immediate:!0}),De(()=>{var b,c;(b=t.events)==null||b.on("save",f),(c=t.events)==null||c.on("open",d)}),Bl(()=>{var b,c;(b=t.events)==null||b.off("save",f),(c=t.events)==null||c.off("open",d)});function d(){o.value=t.label.name,i.value=t.label.color,r.value=!1,p.value=!1,setTimeout(()=>{var b;return(b=a.value)==null?void 0:b.focus()},100)}function f(b){b.preventDefault();const c={name:o.value.trim(),color:i.value};if(!c.name)return p.value=!0;if(xl(c,t.label))return s("save",null);s("save",{oldLabel:{name:t.label.name,color:t.label.color},newLabel:c})}function u(){var b;(b=t.events)==null||b.emit("save",{preventDefault:()=>{}})}function m(){s("delete",{label:{name:t.label.name,color:t.label.color}})}return(b,c)=>{const w=pe("FaIcon");return x(),$("div",pw,[n("div",null,[c[3]||(c[3]=n("label",{class:"block text-sm font-medium text-neutral-300 mb-2"}
13,"Name",-1)),me(n("input",{ref_key:"nameInputRef",ref:a,"onUpdate:modelValue":c[0]||(c[0]=h=>o.value=h),type:"text",class:j(["bg-neutral-900 rounded border-0 !w-full px-2 py-1 h-8 text-white placeholder-neutral-500 focus:ring-2 focus:ring-blue-500 focus:border-transparent focus:outline-none",{"ring-1 ring-red-500":p.value}]),placeholder:"Enter label name",disabled:t.busy,onInput:c[1]||(c[1]=h=>p.value=!1),onKeydown:Re(u,["enter"])},null,42,fw),[[ft,o.value]])]),n("div",null,[c[4]||(c[4]=n("label",{class:"block text-sm font-medium text-neutral-300 mb-2"},"Color",-1)),n("div",bw,[(x(!0),$(ee,null,ge(g(Hi),h=>(x(),$("button",{key:h,class:j(["w-5 h-5 rounded-full border border-transparent",i.value===h?"ring-2 ring-white":"hover:border-white"]),style:$e({backgroundColor:h}),disabled:t.busy,onClick:y=>i.value=h},null,14,vw))),128))])]),n("div",gw,[r.value?(x(),$(ee,{key:1},[n("span",null,' Delete "'+q(t.label.name)+'" from '+q(t.usageCount)+" timer"+q(t.usageCount===1?"":"s")+"? ",1),n("button",{class:"text-red-400",disabled:t.busy,onClick:m}," Yes, delete ",8,xw)],64)):(x(),$(ee,{key:0},[n("span",null," Used on "+q(t.usageCount)+" timer"+q(t.usageCount===1?"":"s"),1),n("button",{class:"hover:text-red-400 transition-colors",disabled:t.busy,onClick:c[2]||(c[2]=Be(h=>r.value=!0,["stop"]))},[v(w,{icon:g(ad),size:"xs"},null,8,["icon"]),c[5]||(c[5]=U(" Delete from all ",-1))],8,hw)],64))])])}}},yw={__name:"TimerLabelEditable",props:{label:{type:Object,required:!0},usageCount:{type:Number,default:0}},emits:["update:label","delete:label","remove"],setup(e,{emit:l}){const s=Fe(),t=wt(),a=F(!1),o=l,i=e;function r(d,f){return le(this,null,function*(){if(!d)return f==null?void 0:f();const{oldLabel:u,newLabel:m}=d;yield de(se.patch(`/rooms/${s.pid}/labels`,{oldLabel:u,newLabel:m}),(b,c)=>{t.setAll(b,c),o("update:label",{oldLabel:u,newLabel:m}),f==null||f()},()=>a.value=!0,()=>a.value=!1)})}function p(d,f){return le(this,null,function*(){const{label:u}=d;yield de(se.delete(`/rooms/${s.pid}/labels`,{data:{label:u}}),(m,b)=>{t.setAll(m,b),o("delete:label",{label:u}),f==null||f()},()=>a.value=!0,()=>a.value=!1)})}return(d,f)=>(x(),Z(Sl,{"width-class":"max-w-sm","auto-hide":"",busy:a.value},{default:L(({show:u})=>[v(jl,{label:i.label,removable:"",editable:"",onEdit:u,onRemove:f[0]||(f[0]=m=>o("remove"))},null,8,["label","onEdit"])]),popper:L(({hide:u,events:m})=>[v(ww,{label:i.label,"usage-count":i.usageCount,busy:a.value,events:m,onSave:b=>r(b,u),onDelete:b=>p(b,u)},null,8,["label","usage-count","busy","events","onSave","onDelete"])]),_:1},8,["busy"]))}},kw={key:0,class:"border-b border-neutral-600 pb-7"},$w={class:"flex flex-wrap gap-2"},Sw={class:"pt-2"},Cw={class:"grid grid-cols-12 gap-2"},Mw=["onClick"],Tw={key:1,class:"w-full rounded bg-neutral-700 text-sm px-2 py-1 text-center block"},zw={key:2,class:"w-full rounded bg-neutral-700 text-sm px-2 py-1 text-center block"},Iw={__name:"AddLabelModal",props:{open:Boolean,busy:Boolean,labels:{type:Array,default:()=>[]},aggregateLabels:{type:Array,default:()=>[]},forced:{type:Boolean,default:!1}},emits:["update:open","confirm","show","hide"],setup(e,{emit:l}){const s=F([]),t=F(""),a=F(""),o=l,i=e;function r(){t.value="",a.value="",s.value=i.labels,o("show")}const p=O(()=>s.value.map(Mn)),d=O(()=>{const b=[];return t.value.trim()!==""&&a.value===""&&b.push("color"),i.aggregateLabels.some(h=>h.name.toLowerCase()===t.value.toLowerCase())&&b.push("duplicate"),b});function f(b){if(u(b)){const c=Mn(b);s.value=s.value.filter(w=>Mn(w)!==c)}else s.value.push(b)}function u(b){const c=Mn(b);return p.value.includes(c)}function m(b){b.preventDefault();let c=s.value.slice();t.value&&a.value&&c.push({name:t.value,color:a.value}),o("confirm",c)}return(b,c)=>(x(),Z(Le,{open:i.open,busy:i.busy,title:"Add Label","body-class":"font-light space-y-4","width-class":"max-w-sm","disable-confirm":d.value.length>0,"hide-cancel":"",closable:"","onUpdate:open":c[1]||(c[1]=w=>o("update:open",w)),onShow:r,onHide:c[2]||(c[2]=w=>o("hide")),onConfirm:m},{default:L(()=>[e.aggregateLabels.length?(x(),$("div",kw,[c[3]||(c[3]=n("label",{class:"block text-sm font-medium text-neutral-300 mb-2"},"Existing Labels",-1)),n("div",$w,[(x(!0),$(ee,null,ge(e.aggregateLabels,w=>(x(),Z(jl,{key:g(Mn)(w),label:w,selected:u(w),selectable:"",onSelect:h=>f(w)},null,8,["label","selected","onSelect"]))),128))])])):N("",!0),n("div",Sw,[c[4]||(c[4]=n("label",{class:"block text-sm font-medium text-neutral-300 mb-2"},"New label name",-1)),me(n("input",{"onUpdate:modelValue":c[0]||(c[0]=w=>t.value=w),type:"text",class:"bg-neutral-900 rounded border-0 !w-full px-2 py-1 h-8 text-white placeholder-neutral-500 focus:ring-2 focus:ring-blue-500 focus:border-transparent focus:outline-none",placeholder:"Enter label name"},null,512),[[ft,t.value]])]),n("div",null,[c[5]||(c[5]=n("label",{class:"block text-sm font-medium text-neutral-300 mb-2"},"Color",-1)),n("div",Cw,[(x(!0),$(ee,null,ge(g(Hi),w=>(x(),$("button",{key:w,class:j(["w-5 h-5 rounded-full border border-transparent",a.value===w?"ring-2 ring-white":"hover:border-white"]),style:$e({backgroundColor:w}),onClick:h=>a.value=w},null,14,Mw))),128))])]),d.value.includes("color")?(x(),$("caption",Tw," â ï¸ Please select a color ")):N("",!0),d.value.includes("duplicate")?(x(),$("caption",zw," â ï¸ Label name already exists ")):N("",!0)]),_:1},8,["open","busy","disable-confirm"]))}},Ow={class:"w-full font-light"},Dw={class:"pl-3 pb-1"},Ew=["value"],Uw={class:"pl-3 pb-1"},Lw=["value"],Rw={class:"pl-3 pb-1",colspan:"2"},Aw=["value"],_w={class:"pl-3 pb-1",colspan:"2"},Fw={class:"flex flex-wrap gap-2"},Bw={key:0,class:"rounded bg-neutral-700 text-sm px-2 py-1",style:{"caption-side":"bottom"}},eu={__name:"TimerNameForm",props:{name:{type:String,default:""},extra:{type:String,default:""},notes:{type:String,default:""},labels:{type:Array,default:()=>[]},events:{type:Object,default:null},aggregateLabels:{type:Array,default:()=>[]}},emits:["update:name","update:extra","update:notes","update:labels","enter"],setup(e,{emit:l}){const s=wt(),t=l,a=e,o=["name"],i=F([]),r=F(!1),p=F(null),d=F(null),f=O(()=>id([...a.aggregateLabels,...a.labels||[]])),{resize:u}=_d(d);De(()=>{var M,I;(M=a.events)==null||M.on("save",h),(I=a.events)==null||I.on("open",y),u()}),Bl(()=>{var M,I;(M=a.events)==null||M.off("save",h),(I=a.events)==null||I.off("open",y)});const m=()=>(i.value=o.filter(M=>!a[M]),!i.value.length);function b(M){r.value=M}function c(M){t("update:labels",M),r.value=!1}function w(M){const I=a.labels.filter((R,T)=>T!==M);t("update:labels",I)}function h(M){m()||M.preventDefault()}function y(M){M&&p.value.focus()}function S(M){return s.items.filter(I=>{var R;return(R=I.labels)==null?void 0:R.some(T=>xl(T,M))}).length}function D({oldLabel:M,newLabel:I}){const R=a.labels.map(T=>xl(T,M)?I:T);t("update:labels",R)}function k({label:M}){const I=a.labels.filter(R=>!xl(R,M));t("update:labels",I)}return(M,I)=>{const R=pe("FaIcon");return x(),$("table",Ow,[n("tbody",null,[n("tr",null,[I[6]||(I[6]=n("th",{class:"text-left font-light text-neutral-400 w-20 pb-1"}," Title ",-1)),n("td",Dw,[n("input",{ref_key:"titleInputRef",ref:p,type:"text",class:j(["input-ctrl w-full px-2 py-0 h-
137",{"ring-1 ring-red-500":i.value.includes("name")}]),placeholder:"Title (required)",value:e.name,"data-label":"input-timer-title",onInput:I[0]||(I[0]=T=>M.$emit("update:name",T.target.value)),onKeydown:I[1]||(I[1]=Re(T=>M.$emit("enter"),["enter"]))},null,42,Ew)])]),n("tr",null,[I[7]||(I[7]=n("th",{class:"text-left font-light text-neutral-400 w-20 pb-1"}," Speaker ",-1)),n("td",Uw,[n("input",{type:"text",class:"input-ctrl w-full px-2 py-0 h-7",placeholder:"Speaker (optional)",value:e.extra,"data-label":"input-timer-speaker",onInput:I[2]||(I[2]=T=>M.$emit("update:extra",T.target.value)),onKeydown:I[3]||(I[3]=Re(T=>M.$emit("enter"),["enter"]))},null,40,Lw)])]),n("tr",null,[I[8]||(I[8]=n("th",{class:"text-left font-light text-neutral-400 w-20 pb-1"}," Notes ",-1)),n("td",Rw,[n("textarea",{ref_key:"notesTextareaRef",ref:d,rows:"3",class:"input-ctrl w-full px-2 py-1 resize-none",placeholder:"Notes (optional)",value:e.notes,"data-label":"input-timer-notes",onInput:I[4]||(I[4]=T=>{M.$emit("update:notes",T.target.value),g(u)()})},null,40,Aw)])]),n("tr",null,[I[10]||(I[10]=n("th",{class:"text-left font-light text-neutral-400 w-20 pb-1"}," Labels ",-1)),n("td",_w,[n("div",Fw,[(x(!0),$(ee,null,ge(a.labels,(T,C)=>(x(),Z(yw,{key:"label-"+C,label:T,"usage-count":S(T),"onUpdate:label":D,"onDelete:label":k,onRemove:E=>w(C)},null,8,["label","usage-count","onRemove"]))),128)),n("button",{class:"btn-ctrl h-5 px-2 text-xs",onClick:I[5]||(I[5]=T=>b(!0))},[v(R,{icon:g(sn),"fixed-width":"",size:"xs"},null,8,["icon"]),I[9]||(I[9]=U(" Add label ",-1))])]),v(Iw,{open:r.value,labels:a.labels,"aggregate-labels":f.value,"onUpdate:open":b,onConfirm:c},null,8,["open","labels","aggregate-labels"])])])]),i.value.length?(x(),$("caption",Bw," â ï¸ Fill required fields ")):N("",!0)])}}},tu={__name:"TimeOfDayInput",props:{value:{type:Date,default:null},defaultValue:{type:Date,default:null},todFormat:{type:String,default:rd(),validator:e=>Object.values(ce).includes(e)},timezone:{type:String,default:null},placeholder:{type:String,default:void 0},disabled:Boolean,open:Boolean,required:Boolean,invalid:Boolean,preserveDate:{type:Boolean,default:!1}},emits:["update:value","update:open","open","close","clear"],setup(e,{emit:l}){const s=F(),t=l,a=e,o=O({get:()=>{if(!a.value)return null;if(!a.timezone)return a.value;const b=a.value.getTimezoneOffset()*6e4,c=Kt(a.timezone,a.value),w=b+c;return Lt(a.value,w)},set:b=>{if(!b)return t("update:value",null);if(!a.timezone)return b.setMilliseconds(0),t("update:value",b);if(!a.preserveDate){const M=Ou(a.timezone);b.setFullYear(M.getFullYear(),M.getMonth(),M.getDate())}const c=b.getTimezoneOffset()*6e4,w=Kt(a.timezone,b),h=c+w,y=Lt(b,-h),S=Kt(a.timezone,y),D=c+S,k=Lt(b,-D);k.setMilliseconds(0),t("update:value",k)}}),i=O(()=>{if(!a.defaultValue)return new Date;if(!a.timezone)return a.defaultValue;const b=a.defaultValue.getTimezoneOffset()*6e4,c=Kt(a.timezone,a.defaultValue),w=b+c;return Lt(a.defaultValue,w)}),r=O({get:()=>a.open,set:b=>{t("update:open",b),b&&dt(()=>{var c;return(c=s.value)==null?void 0:c.querySelector("input").select()})}}),p=Intl.DateTimeFormat().resolvedOptions().timeZone,d=O(()=>({stringify:b=>nt(b,{todFormat:a.todFormat,seconds:"nonzero",timezone:p}),parse:b=>Fn(b,{ref:o.value})})),f=O(()=>!a.invalid&&(a.required?!!o.value:!0)),u=O(()=>(a.todFormat===ce.AUTO?io():ce.isH12(a.todFormat))?"hh:mm:ss A":"HH:mm:ss"),m=O(()=>a.required?"Select time (required)":a.placeholder||"Select time (optional)");return(b,c)=>(x(),Z(g(er),{ref_key:"datepickerRef",ref:s,value:o.value,"onUpdate:value":c[0]||(c[0]=w=>o.value=w),open:r.value,"onUpdate:open":c[1]||(c[1]=w=>r.value=w),defaultValue:i.value,formatter:d.value,format:u.value,type:"time",valueType:"date",placeholder:m.value,disabled:e.disabled,clearable:"",class:j({"rounded ring-1 ring-red-500":!f.value}),inputClass:"mx-input !py-0 !h-8",onOpen:c[2]||(c[2]=w=>t("open")),onClose:c[3]||(c[3]=w=>t("close")),onClear:c[4]||(c[4]=()=>{t("clear"),t("update:value",null)}),onKeydown:c[5]||(c[5]=Re(w=>r.value=!1,["escape"]))},null,8,["value","open","defaultValue","formatter","format","placeholder","disabled","class"]))}},si="yyyy-MM-dd",nu={__name:"DateInput",props:{value:{type:Date,default:null},defaultValue:{type:Date,default:null},timezone:{type:String,default:null},placeholder:{type:String,default:void 0},disabled:Boolean,open:Boolean,required:Boolean,invalid:Boolean},emits:["update:value","update:open","open","close","clear"],setup(e,{emit:l}){const s=F(),t=l,a=e,o=O({get:()=>{if(!a.value)return null;if(!a.timezone)return a.value;const u=Kt(a.timezone,a.value);return Lt(a.value,u)},set:u=>{if(!u)return t("update:value",null);if(!a.timezone)return t("update:value",u);const m=Kt(a.timezone,u);t("update:value",Lt(u,-m))}}),i=O({get:()=>
13o.value?jt(o.value,si,{in:yi("UTC")}):null,set:u=>{u||(o.value=null);const m=o.value||r.value,b=gn(u,"UTC");o.value=Du(m,b,"UTC")}}),r=O(()=>{if(!a.defaultValue)return new Date;if(!a.timezone)return a.defaultValue;const u=Kt(a.timezone,a.defaultValue);return Lt(a.defaultValue,u)}),p=O({get:()=>a.open,set:u=>{t("update:open",u),u&&dt(()=>{var m;return(m=s.value)==null?void 0:m.querySelector("input").select()})}}),d=O(()=>!a.invalid&&(a.required?!!a.value:!0)),f=O(()=>a.required?"Select date (required)":a.placeholder||"Select date (optional)");return(u,m)=>(x(),Z(g(er),{ref_key:"datepickerRef",ref:s,value:i.value,"onUpdate:value":m[0]||(m[0]=b=>i.value=b),open:p.value,"onUpdate:open":m[1]||(m[1]=b=>p.value=b),defaultValue:r.value,format:si.toUpperCase(),type:"date",valueType:"format",placeholder:f.value,disabled:e.disabled,clearable:"",class:j({"rounded ring-1 ring-red-500":!d.value}),inputClass:"mx-input !py-0 !h-8",onOpen:m[2]||(m[2]=b=>t("open")),onClose:m[3]||(m[3]=b=>t("close")),onClear:m[4]||(m[4]=()=>{t("clear"),t("update:value",null)})},null,8,["value","open","defaultValue","format","placeholder","disabled","class"]))}},Pw={class:"w-full"},Nw={class:"text-left font-light text-neutral-400 w-20 pb-2"},Hw={class:"pl-3 pb-2","data-label":"input-timer-start-time"},Vw={class:"text-left font-light text-neutral-400 w-20 pb-2"},jw={class:"pl-3 pb-2","data-label":"input-timer-start-date"},qw={key:0,class:"flex items-center gap-1.5 rounded-b bg-yellow-500 text-neutral-900 text-xs font-normal pl-2"},Ww={class:"flex-1"},Gw={class:"text-neutral-400 text-xs"},Xw={key:0,class:"rounded bg-neutral-700 text-xs px-2 py-1",style:{"caption-side":"bottom"}},Yw={key:0},Kw={key:1},lu={__name:"TimerStartForm",props:{trigger:{type:String,default:_e.MANUAL,validator:e=>Object.values(_e).includes(e)},startTime:{type:String,default:null,validator:e=>e===null||ki(e,"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")},startDate:{type:Boolean,default:!1},todFormat:{type:String,default:ce.AUTO,validator:e=>Object.values(ce).includes(e)},timezone:{type:String,default:null},fallbackDate:{type:Date,default:void 0},events:{type:Object,default:null},disabled:Boolean,hideDisabledAlert:Boolean},emits:["update:trigger","update:startTime","update:startDate","enter","reset"],setup(e,{emit:l}){const s=[{value:_e.MANUAL,label:"Manual",detail:'Start when clicking "play" button.'},{value:_e.LINKED,label:"Linked",detail:"Auto-start when previous timer reaches 0:00 or with button."},{value:_e.SCHEDULED,label:"Scheduled",detail:"Auto-start at a specific time or with button."}],t=l,a=e,o=F([]),i=ht({trigger:!1,time:!1,date:!1}),r=O({get:()=>a.startTime?a.startDate?gn(a.startTime):Vt(a.startTime,{timezone:a.timezone,after:a.fallbackDate||void 0}):null,set:D=>t("update:startTime",D?D.toISOString():null)}),p=O({get:()=>a.startDate?gn(a.startTime):null,set:D=>{D&&t("update:startTime",D.toISOString()),a.startDate!==!!D&&t("update:startDate",!!D)}}),d=O(()=>a.trigger===_e.SCHEDULED?["startTime"]:[]),f=O(()=>{if(a.startTime&&a.startDate)return new Date(a.startTime);if(a.startTime)return Vt(a.startTime,{timezone:a.timezone,after:a.fallbackDate||void 0});if(a.fallbackDate)return a.fallbackDate;const D=new Date;return D.setSeconds(0,0),D});De(()=>{var D;(D=a.events)==null||D.on("save",b)}),Qe(()=>{var D;(D=a.events)==null||D.off("save",b)});function u(){i.trigger=!1,i.time=!1,i.date=!1,t("enter")}function m(){return o.value=[],o.value=d.value.filter(D=>!a[D]),a.trigger===_e.SCHEDULED&&r.value<new Date&&o.value.push("timeIsPast"),!o.value.length}function b(D){m()||D.preventDefault()}Te(()=>a.trigger,()=>o.value=[]);const c=O(()=>Vi({trigger:a.trigger,startTime:a.startTime,startDate:a.startDate,fallbackDate:a.fallbackDate,timezone:a.timezone,todFormat:a.todFormat}));function w(D){i[D]=!0}function h(D){i[D]=!1}const y=F(!1),S=O(()=>a.startDate&&a.trigger===_e.SCHEDULED&&!y.value);return Te(()=>[a.startDate,a.trigger],()=>y.value=!1),(D,k)=>{var M,I,R;return x(),$("div",Rt({class:"space-y-2 font-light"},D.$attrs,{onKeydown:Re(u,["enter"])}),[v(Zi,{class:"w-full bg-neutral-900 h-8",disabled:e.disabled,options:s,"model-value":e.trigger,"data-label":"select-timer-trigger",dark:"","onUpdate:modelValue":k[0]||(k[0]=T=>t("update:trigger",T)),onOpen:k[1]||(k[1]=T=>w("trigger")),onClose:k[2]||(k[2]=T=>h("trigger"))},null,8,["disabled","model-value"]),n("table",Pw,[n("tbody",null,[n("tr",null,[n("th",Nw,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:d.value.includes("startTime")?"Required to enable the auto-start feature.":"Set an optional fixed start time, or leave it to be automatically calculated from preceding timers' durations."},{default:L(()=>[...k[13]||(k[13]=[U(" Time ",-1)])]),_:1},8,["tooltip"])]),n("td",Hw,[v(tu,{value:r.value,"onUpdate:value":k[3]||(k[3]=T=>r.value=T),open:i.time,"onUpdate:open":k[4]||(k[4]=T=>i.time=T),"default-value":f.value,"tod-format":e.todFormat,required:d.value.includes("startTime"),timezone:a.timezone,disabled:e.disabled,"preserve-date":a.startDate,class:"!w-full text-sm",placeholder:(M=c.value)==null?void 0:M.time,invali
13d:o.value.includes("startTime")||o.value.includes("timeIsPast"),onOpen:k[5]||(k[5]=T=>w("time")),onClose:k[6]||(k[6]=T=>h("time"))},null,8,["value","open","default-value","tod-format","required","timezone","disabled","preserve-date","placeholder","invalid"])])]),n("tr",null,[n("th",Vw,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:"Select an optional fixed date for this timer, or leave blank to default to today's date."},{default:L(()=>[...k[14]||(k[14]=[U(" Date ",-1)])]),_:1})]),n("td",jw,[v(nu,{value:p.value,"onUpdate:value":k[7]||(k[7]=T=>p.value=T),open:i.date,"onUpdate:open":k[8]||(k[8]=T=>i.date=T),"default-value":f.value,required:d.value.includes("startDate"),timezone:a.timezone,disabled:e.disabled,class:j(["!w-full text-sm",{"border border-b-0 border-yellow-500 rounded-t":S.value}]),placeholder:(I=c.value)==null?void 0:I.date,invalid:o.value.includes("startDate")||o.value.includes("timeIsPast"),onOpen:k[9]||(k[9]=T=>w("date")),onClose:k[10]||(k[10]=T=>h("date"))},null,8,["value","open","default-value","required","timezone","disabled","class","placeholder","invalid"]),S.value?(x(),$("div",qw,[n("div",Ww,[k[15]||(k[15]=U(" Did you mean to ",-1)),n("button",{class:"underline font-medium",onClick:k[11]||(k[11]=Be(T=>t("update:trigger",g(_e).SCHEDULED),["stop"]))},"schedule"),k[16]||(k[16]=U("? ",-1))]),n("button",{class:"hover:text-neutral-600 h-6 w-6 flex items-center justify-center",onClick:k[12]||(k[12]=Be(T=>y.value=!0,["stop"]))}," à ")])):N("",!0)])])])]),n("div",Gw,q((R=c.value)==null?void 0:R.text),1),o.value.length?(x(),$("div",Xw,[o.value.includes("startTime")?(x(),$("p",Yw," â ï¸âStart time is required. ")):N("",!0),o.value.includes("timeIsPast")?(x(),$("p",Kw," â ï¸âCannot schedule a time in the past. ")):N("",!0)])):N("",!0)],16)}}};var $s,oi;function Zw(){if(oi)return $s;oi=1;var e=9007199254740991,l=Math.floor;function s(t,a){var o="";if(!t||a<1||a>e)return o;do a%2&&(o+=t),a=l(a/2),a&&(t+=t);while(a);return o}return $s=s,$s}var Ss,ai;function Qw(){if(ai)return Ss;ai=1;var e=ud(),l=e("length");return Ss=l,Ss}var Cs,ii;function Jw(){if(ii)return Cs;ii=1;var e="\\ud800-\\udfff",l="\\u0300-\\u036f",s="\\ufe20-\\ufe2f",t="\\u20d0-\\u20ff",a=l+s+t,o="\\ufe0e\\ufe0f",i="["+e+"]",r="["+a+"]",p="\\ud83c[\\udffb-\\udfff]",d="(?:"+r+"|"+p+")",f="[^"+e+"]",u="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",b="\\u200d",c=d+"?",w="["+o+"]?",h="(?:"+b+"(?:"+[f,u,m].join("|")+")"+w+c+")*",y=w+c+h,S="(?:"+[f+r+"?",r,u,m,i].join("|")+")",D=RegExp(p+"(?="+p+")|"+S+y,"g");function k(M){for(var I=D.lastIndex=0;D.test(M);)++I;return I}return Cs=k,Cs}var Ms,ri;function su(){if(ri)return Ms;ri=1;var e=Qw(),l=tr(),s=Jw();function t(a){return l(a)?s(a):e(a)}return Ms=t,Ms}var Ts,ui;function ey(){if(ui)return Ts;ui=1;var e=Zw(),l=Eu(),s=Qd(),t=tr(),a=su(),o=Jd(),i=Math.ceil;function r(p,d){d=d===void 0?" ":l(d);var f=d.length;if(f<2)return f?e(d,p):d;var u=e(d,i(p/a(d)));return t(d)?s(o(u),0,p).join(""):u.slice(0,p)}return Ts=r,Ts}var zs,di;function ty(){if(di)return zs;di=1;var e=ey(),l=su(),s=wi(),t=$i();function a(o,i,r){o=t(o),i=s(i);var p=i?l(o):0;return i&&p<i?e(i-p,r)+o:o}return zs=a,zs}var ny=ty();const ly=ln(ny),sy=["value"],Rn={__name:"InputNumber",props:{value:{type:Number,default:0},min:{type:Number,default:void 0},max:{type:Number,default:void 0},digits:{type:Number,default:1}},emits:["update:value","focus","blur","enter"],setup(e,{emit:l}){const s=l,t=e,a=F(),o=F(0),i=F(d(t.value));Te(()=>t.value,u=>{const m=d(t.value);u!==m&&(i.value=m)});let r=!1;function p(u){r||s("focus",u)}function d(u){const m=Number(t.min),b=Number(t.max);let c=u;return isNaN(m)||(c=Math.max(c,m)),isNaN(b)||(c=Math.min(c,b)),isNaN(c)&&(c=0),ly(c,t.digits,"0")}function f(u){const m=d(u);i.value=m,o.value++,r=!0,a.value.focus(),dt(()=>{a.value.focus(),r=!1}),s("update:value",parseInt(m))}return(u,m)=>(x(),$("input",{ref_key:"inputElement",ref:a,key:o.value,value:i.value,type:"text",class:"disabled:text-neutral-500 disabled:cursor-not-allowed",onInput:m[0]||(m[0]=b=>f(b.target.value)),onKeyup:[m[1]||(m[1]=Re(Be(()=>{},["prevent"]),["up"])),m[2]||(m[2]=Re(Be(()=>{},["prevent"]),["down"]))],onKeydown:[m[3]||(m[3]=Re(Be(()=>f(+i.value+1),["prevent"]),["up"])),m[4]||(m[4]=Re(Be(()=>f(+i.value-1),["prevent"]),["down"])),m[6]||(m[6]=Re(Be(b=>s("enter",b),["exact"]),["enter"])),m[7]||(m[7]=Be(()=>{},["stop"]))],onFocus:p,onBlur:m[5]||(m[5]=b=>s("blur",b))},null,40,sy))}},oy={class:"flex items-center input-ctrl"},ay={__name:"TimeInput",props:{hours:{type:Number,default:void 0},minutes:{type:Number,default:void 0},seconds:{type:Number,default:void 0},inputClass:{type:[String,Array,Object],default:"px-2 h-8"},disabled:Boolean},emits:["update:hours","update:minutes","update:seconds","enter"],setup(e,{emit:l}){const s=l,t=e;return(a,o)=>(x(),$("div",oy,[e.hours!==void 0?(x(),$(ee,{key:0},[v(Rn,{value:t.hours,class:j(["input-ctrl appearance-none [-moz-appearance:textfield] disabled:text-neutral-500 disabled:cursor-not-allowed",[e.inputClass]]),min:0,max:999,digits:2,size:"3",disabled:e.disabled,"data-label":"input-hours","onUpdate:value":o[0]||(o[0]=i=>s("update:hours",i)),onFocus:o[1]||(o[1]=i=>i.target.select()),onEnter:o[2]||(o[2]=()=>s("enter"))},null,8,["value","class","disabled"]),o[9]||(o[9]=n("span",{class:"px-1"},":",-1))],64)):N("",!0),v(Rn,{value:t.minutes,class:j(["input-ctrl appearance-none [-moz-appearance:textfield] disabled:text-neutral-500 disabled:cursor-not-allowed",[e.inputClass]]),min:0,max:59,digits:2,size:"3",disabled:e.disabled,"data-label":"input-minutes","onUpdate:value":o[3]||(o[3]=i=>
13s("update:minutes",i)),onFocus:o[4]||(o[4]=i=>i.target.select()),onEnter:o[5]||(o[5]=()=>s("enter"))},null,8,["value","class","disabled"]),o[10]||(o[10]=n("span",{class:"px-1"},":",-1)),v(Rn,{value:t.seconds,class:j(["input-ctrl appearance-none [-moz-appearance:textfield] disabled:text-neutral-500 disabled:cursor-not-allowed",[e.inputClass]]),min:0,max:59,digits:2,size:"3",disabled:e.disabled,"data-label":"input-seconds","onUpdate:value":o[6]||(o[6]=i=>s("update:seconds",i)),onFocus:o[7]||(o[7]=i=>i.target.select()),onEnter:o[8]||(o[8]=()=>s("enter"))},null,8,["value","class","disabled"])]))}},Qs=Oe(ay,[["__scopeId","data-v-123df288"]]),iy={class:"space-y-1"},ry={class:"input-ctrl flex items-baseline gap-1 pxl-3 pr-0"},uy=["value","disabled","onKeydown"],dy={key:0,class:"text-red-500 text-xs px-3"},vl=.5,gl=3,cy=1,ci=.05,Dt=2,my={__name:"TimewarpFactorInput",props:{duration:{type:Number,required:!0,validator:e=>e>=0},timewarpDuration:{type:Number,default:null,validator:e=>e===null||e>=0},disabled:{type:Boolean,default:!1}},emits:["update:duration"],setup(e,{emit:l}){const s=l,t=e,a=F(!1),o=F(cy.toFixed(2));function i(m,b){if(b&&(b.target.value=m),o.value=m,m){const c=Math.round(t.timewarpDuration/m);s("update:duration",c)}}function r(m){const b=p(m.target.value);i(b,m)}function p(m){let b=m.replace(/[^\d]/g,"");if(b==="")return"";if(b.length>=1&&(b=b.slice(0,1)+"."+b.slice(1,Dt+1)),b.length>=Dt+2){const c=parseFloat(b),w=tt(c,vl,gl);w!==c&&(b=w.toFixed(Dt))}return b}function d(m){let b=parseFloat(m.target.value||0);b=_o(b,ci,"up",{min:vl,max:gl,precision:Dt}),i(b.toFixed(Dt),m)}function f(m){let b=parseFloat(m.target.value||1/0);b=_o(b,ci,"down",{min:vl,max:gl,precision:Dt}),i(b.toFixed(Dt),m)}function u(m){if(m.target.value.includes(".")){m.preventDefault();const b=m.target.value.replace(".","");let c=p(b.slice(0,-1));i(c,m)}}return Te(()=>[t.duration,t.timewarpDuration],([m,b])=>{const c=parseFloat(o.value),w=Dn(b/m,Dt);Dn(Math.abs(c-w),Dt)>.01&&(o.value=w.toFixed(2))},{immediate:!0}),(m,b)=>(x(),$("div",iy,[n("div",ry,[b[4]||(b[4]=n("span",{class:"flex-none text-neutral-400"},"Sped up Ã",-1)),n("input",{value:o.value,class:j(["flex-auto input-ctrl appearance-none [-moz-appearance:textfield] disabled:text-neutral-500 disabled:cursor-not-allowed px-1 h-8 w-12",{"border-red-500":a.value}]),type:"text",disabled:e.disabled,onInput:r,onKeyup:[b[0]||(b[0]=Re(Be(()=>{},["prevent"]),["up"])),b[1]||(b[1]=Re(Be(()=>{},["prevent"]),["down"]))],onKeydown:[Re(Be(d,["prevent"]),["up"]),Re(Be(f,["prevent"]),["down"]),Re(u,["backspace"])],onFocus:b[2]||(b[2]=c=>c.target.select()),onBlur:b[3]||(b[3]=(...c)=>m.onBlur&&m.onBlur(...c))},null,42,uy)]),a.value?(x(),$("div",dy," Factor must be between Ã"+q(vl)+" and Ã"+q(gl))):N("",!0)]))}},py={class:"w-full"},fy={key:0},by={class:"text-left font-light text-neutral-400 w-20 pb-2"},vy={class:"pl-3 pb-2"},gy={key:1},hy={class:"pl-3 pb-2","data-label":"input-timer-finish-time"},xy={key:2},wy={class:"pl-3 pb-2","data-label":"input-timer-finish-date"},yy={key:3},ky={class:"text-left font-light text-neutral-400 w-20 pb-2"},$y={class:"pl-3 pb-2"},Sy={key:4},Cy={class:"text-left font-light text-neutral-400 w-20 pb-2"},My={class:"pl-3 pb-2"},Ty={class:"pl-3"},zy=["innerHTML"],Iy={key:0,class:"rounded bg-neutral-700 text-xs px-2 py-1"},ou={__name:"TimerDurationForm",props:{hours:{type:Number,default:void 0},minutes:{type:Number,default:void 0},seconds:{type:Number,default:void 0},finishTime:{type:String,default:null,validateor:e=>e===null||ki(e,"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")},finishDate:{type:Boolean,default:!1},timewarpDuration:{type:Number,default:null},appearance:{type:String,default:Ie.COUNTDOWN},type:{type:String,default:et.DURATION},todFormat:{type:String,default:ce.AUTO,validator:e=>Object.values(ce).includes(e)},timezone:{type:String,default:null},fallbackDate:{type:Date,default:void 0},events:{type:Object,default:null},datePickerOpen:Boolean,disabled:Boolean,hideDisabledAlert:Boolean},emits:["update:hours","update:minutes","update:seconds","update:finishTime","update:finishDate","update:finishDate","update:timewarpDuration","update:appearance","apply-to-all","update:type","enter","reset"],setup(e,{emit:l}){const s=l,t=e,a=F([]),o=F(!1),i=F(!1),r=ht({type:!1,time:!1,date:!1}),p=O(()=>
13[{value:et.DURATION,label:"Duration",detail:"Count down for a specific duration."},{value:et.FINISH_TIME,label:"Target Time",detail:"Count down to a specific time of day."},{value:et.TIME_WARP,label:"Time Warp",detail:"Show a faster/slower timer to the presenter."}]),d=O({get:()=>gn(t.finishTime),set:E=>s("update:finishTime",E?E.toISOString():null)}),f=O({get:()=>t.finishDate?gn(t.finishTime):null,set:E=>{E&&s("update:finishTime",E.toISOString()),t.finishDate!==!!E&&s("update:finishDate",!!E)}}),u=O(()=>t.type===et.FINISH_TIME?["finishTime"]:[]),m=O(()=>{if(t.finishTime&&t.finishDate)return new Date(t.finishTime);if(t.finishTime)return Vt(t.finishTime,{timezone:t.timezone,after:t.fallbackDate||void 0});if(t.fallbackDate)return t.fallbackDate;const E=new Date;return E.setSeconds(0,0),E}),b=[{value:Ie.COUNTDOWN,label:"Countdown"},{value:Ie.COUNTUP,label:"Count Up"},{value:Ie.TOD,label:"Time of Day"},{value:Ie.COUNTDOWN_TOD,label:"Countdown + Time of Day"},{value:Ie.COUNTUP_TOD,label:"Count Up + Time of Day"},{value:Ie.HIDDEN,label:"Hidden"}];De(()=>{var E;(E=t.events)==null||E.on("save",h)}),Qe(()=>{var E;(E=t.events)==null||E.off("save",h)});function c(){return a.value=u.value.filter(E=>!t[E]),!a.value.length}function w(){o.value=!1,i.value=!1,s("enter")}function h(E){c()||E.preventDefault()}function y(E){s("update:type",E),E===et.TIME_WARP&&t.timewarpDuration===null&&s("update:timewarpDuration",Pt(Fo(t,["hours","minutes","seconds"])))}function S(E){const _=fn(E);s("update:hours",_.hours),s("update:minutes",_.minutes),s("update:seconds",_.seconds)}const D=O(()=>fn(t.timewarpDuration||0)),k=O({get:()=>D.value.hours,set:E=>s("update:timewarpDuration",Pt(re(Q({},D.value),{hours:E})))}),M=O({get:()=>D.value.minutes,set:E=>s("update:timewarpDuration",Pt(re(Q({},D.value),{minutes:E})))}),I=O({get:()=>D.value.seconds,set:E=>s("update:timewarpDuration",Pt(re(Q({},D.value),{seconds:E})))}),R=O(()=>ji({type:t.type,hours:t.hours,minutes:t.minutes,seconds:t.seconds,finishTime:t.finishTime,finishDate:t.finishDate,fallbackDate:t.fallbackDate,timewarpDuration:t.timewarpDuration,timezone:t.timezone,todFormat:t.todFormat,space:" "}));function T(E){r[E]=!0}function C(E){r[E]=!1}return(E,_)=>{var P,A;return x(),$("div",Rt({class:"space-y-2 font-light"},E.$attrs,{onKeydown:Re(w,["enter"])}),[v(Zi,{class:"w-full bg-neutral-900 h-8",disabled:e.disabled,options:p.value,"model-value":e.type,"data-label":"select-timer-type",dark:"","onUpdate:modelValue":y,onOpen:_[0]||(_[0]=z=>T("type")),onClose:_[1]||(_[1]=z=>C("type"))},null,8,["disabled","options","model-value"]),n("table",py,[n("tbody",null,[[g(et).DURATION,g(et).TIME_WARP].includes(e.type)?(x(),$("tr",fy,[n("th",by,[v(Y,{"text-class":"whitespace-nowrap",tooltip:"The real length of the countdown, max 999 hours"},{default:L(()=>[..._[19]||(_[19]=[U(" Duration ",-1)])]),_:1})]),n("td",vy,[v(Qs,{"input-class":"h-8",hours:e.hours,minutes:e.minutes,seconds:e.seconds,disabled:e.disabled,"data-label":"input-timer-duration","onUpdate:hours":_[2]||(_[2]=z=>s("update:hours",z)),"onUpdate:minutes":_[3]||(_[3]=z=>s("update:minutes",z)),"onUpdate:seconds":_[4]||(_[4]=z=>s("update:seconds",z)),onEnter:w},null,8,["hours","minutes","seconds","disabled"])])])):N("",!0),e.type===g(et).FINISH_TIME?(x(),$("tr",gy,[_[20]||(_[20]=n("th",{class:"text-left font-light text-neutral-400 w-20 pb-2"}," Finish Time ",-1)),n("td",hy,[v(tu,{value:d.value,"onUpdate:value":_[5]||(_[5]=z=>d.value=z),open:o.value,"onUpdate:open":_[6]||(_[6]=z=>o.value=z),"default-value":m.value,"tod-format":t.todFormat,required:u.value.includes("finishTime"),timezone:t.timezone,disabled:e.disabled,"preserve-date":t.finishDate,class:"!w-full text-sm",onOpen:_[7]||(_[7]=z=>T("time")),onClose:_[8]||(_[8]=z=>C("time"))},null,8,["value","open","default-value","tod-format","required","timezone","disabled","preserve-date"])])])):N("",!0),e.type===g(et).FINISH_TIME?(x(),$("tr",xy,[_[21]||(_[21]=n("th",{class:"text-left font-light text-neutral-400 w-20 pb-2"}," Finish Date ",-1)),n("td",wy,[v(nu,{value:f.value,"onUpdate:value":_[9]||(_[9]=z=>f.value=z),open:i.value,"onUpdate:open":_[10]||(_[10]=z=>i.value=z),"default-value":m.value,required:u.value.includes("finishDate"),timezone:t.timezone,disabled:e.disabled,class:"!w-full text-sm",placeholder:(P=R.value)==null?void 0:P.date,onOpen:_[11]||(_[11]=z=>T("date")),onClose:_[12]||(_[12]=z=>C("date"))}
13,null,8,["value","open","default-value","required","timezone","disabled","placeholder"])])])):N("",!0),e.type===g(et).TIME_WARP?(x(),$("tr",yy,[n("th",ky,[v(Y,{"text-class":"whitespace-nowrap",tooltip:"The duration that will be shown to the presenter"},{default:L(()=>[..._[22]||(_[22]=[U(" Presenter Sees ",-1)])]),_:1})]),n("td",$y,[v(Qs,{hours:k.value,"onUpdate:hours":_[13]||(_[13]=z=>k.value=z),minutes:M.value,"onUpdate:minutes":_[14]||(_[14]=z=>M.value=z),seconds:I.value,"onUpdate:seconds":_[15]||(_[15]=z=>I.value=z),"input-class":"h-8",disabled:e.disabled,"data-label":"input-timer-timewarp-duration",onEnter:w},null,8,["hours","minutes","seconds","disabled"])])])):N("",!0),e.type===g(et).TIME_WARP?(x(),$("tr",Sy,[n("th",Cy,[v(Y,{"text-class":"whitespace-nowrap",tooltip:"Make the timer run slower (Ã0.5) or faster (Ã2) for the presenter"},{default:L(()=>[..._[23]||(_[23]=[U(" Speed Factor ",-1)])]),_:1})]),n("td",My,[v(my,{disabled:e.disabled,duration:g(Pt)(g(Fo)(t,["hours","minutes","seconds"])),"timewarp-duration":t.timewarpDuration,"onUpdate:duration":S,"onUpdate:timewarpDuration":_[16]||(_[16]=z=>s("update:timewarpDuration",z))},null,8,["disabled","duration","timewarp-duration"])])])):N("",!0),n("tr",null,[_[24]||(_[24]=n("th",{class:"text-left font-light text-neutral-400 pb-4"}," Appearance ",-1)),n("td",Ty,[v(he,{"select-class":"pl-3 h-8 w-full",size:"sm",width:"100%",disabled:e.disabled,options:b,"model-value":e.appearance,"data-label":"select-timer-appearance","onUpdate:modelValue":_[17]||(_[17]=z=>s("update:appearance",z))},null,8,["disabled","model-value"]),n("button",{class:"block h-4 ml-auto text-xs rounded text-neutral-500 hover:text-neutral-400",onClick:_[18]||(_[18]=z=>s("apply-to-all",{appearance:e.appearance}))}," Apply to all ")])])])]),n("div",{class:"text-neutral-400 text-xs",innerHTML:(A=R.value)==null?void 0:A.text},null,8,zy),a.value.length?(x(),$("div",Iy," â ï¸âFill required fields ")):N("",!0)],16)}}},Oy=[{value:Me.NONE,label:"None"},{value:Me.BUZZER,label:"Buzzer ð´"},{value:Me.GONG,label:"Gong ðï¸"},{value:Me.SHIPBELL,label:"Ship Bell â´ï¸"},{value:Me.SHIPHORN1X,label:"Ship Horn Ã1 ð¢"},{value:Me.SHIPHORN2X,label:"Ship Horn Ã2 ð¢"},{value:Me.WINDCHIME,label:"Windchime ð"},{value:Me.BELL1X,label:"Bell Ã1 ðï¸"},{value:Me.BELL2X,label:"Bell Ã2 ðï¸ðï¸"},{value:Me.BELL3X,label:"Bell Ã3 ðï¸ðï¸ðï¸"},{value:Me.DING1X,label:"Ding Ã1 ð"},{value:Me.DING2X,label:"Ding Ã2 ðð"},{value:Me.DING3X,label:"Ding Ã3 ððð"},{value:Me.BEEP1X,label:"Beep Ã1 ð"},{value:Me.BEEP2X,label:"Beep Ã2 ðð"},{value:Me.BEEP3X,label:"Beep Ã3 ððð"},{value:Me.SHORT440HZ1X,label:"440Hz Short Ã1"},{value:Me.SHORT440HZ2X,label:"440Hz Short Ã2"},{value:Me.SHORT440HZ3X,label:"440Hz Short Ã3"},{value:Me.LONG440HZ1X,label:"440Hz Long Ã1"},{value:Me.LONG440HZ2X,label:"440Hz Long Ã2"},{value:Me.LONG440HZ3X,label:"440Hz Long Ã3"},{value:Me.SHORT880HZ1X,label:"880Hz Short Ã1"},{value:Me.SHORT880HZ2X,label:"880Hz Short Ã2"},{value:Me.SHORT880HZ3X,label:"880Hz Short Ã3"},{value:Me.LONG880HZ1X,label:"880Hz Long Ã1"},{value:Me.LONG880HZ2X,label:"880Hz Long Ã2"},{value:Me.LONG880HZ3X,label:"880Hz Long Ã3"},{value:Me.ITSTIME,label:"It's time ð¬"}],Dy=[{value:0,label:"Ã0"},{value:1,label:"Ã1"},{value:2,label:"Ã2"},{value:3,label:"Ã3"},{value:-1,label:"â"}],Ey={components:{TimeInput:Qs,InputSelect:he,ButtonHalo:Nn,LicenseAlert:It},props:{red:{type:Number,default:0},yellow:{type:Number,default:0},chime:{type:Object,default:()=>({})},flash:{type:Object,default:()=>({})},licensed:Boolean},emits:["update:red","update:yellow","update:chime","update:flash","enter"],data:()=>({chimeOptions:Oy,flashOptions:Dy,faVolumeUp:uo}),computed:{yellowMinutes:{get(){return fn(this.yellow).minutes},set(e){this.$emit("update:yellow",Po(this.yellow,e))}},yellowSeconds:{get(){return fn(this.yellow).seconds},set(e){this.$emit("update:yellow",Bo(this.yellow,e))}},redMinutes:{get(){return fn(this.red).minutes},set(e){this.$emit("update:red",Po(this.red,e))}},redSeconds:{get(){return fn(this.red).seconds},set(e){this.$emit("update:red",Bo(this.red,e))}}},methods:{playChime(e){Ho.stop(),Ho.play(e,{force:!0})},updateChime(e,l){this.$emit("update:chime",re(Q({},this.chime),{[e]:l}))},updateFlash(e,l){this.$emit("update:flash",re(Q({},this.flash),{[e]:l}))}}},Uy={class:"flex flex-wrap gap-2"},Ly={class:"flex-none whitespace-nowrap w-60 pr-4"},Ry={class:"flex-none w-32"},Ay={class:"flex flex-wrap gap-2"},_y={class:"flex-none w-32 pr-4"},Fy={class:"flex-none whitespace-nowrap w-60 pr-4"},By={class:"flex-none w-32"},Py={class:"flex flex-wrap gap-2"},Ny={class:"flex-none w-32 pr-4"},Hy={class:"flex-none whitespace-nowrap w-60 pr-4"},Vy={class:"flex-none w-32"},jy={class:"flex flex-wrap gap-2"},qy={class:"flex-none whitespace-nowrap w-60 pr-4"},Wy={class:"flex-none w-32"};function Gy(e,l,s,t,a,o){const i=pe("LicenseAlert"),r=pe("InputSelect"),p=pe("FaIcon"),d=pe("ButtonHalo"),f=pe("TimeInput");return x(),$("div",{class:"w-full space-y-2",onKeydown:l[18]||(l[18]=Re(u=>e.$emit("enter"),["enter"]))},[s.licensed?N("",!0):(x(),Z(i,{key:0,plan:"Pro"},{default:L(()=>[...l[19]||(l[19]=[U(" Wrap-up actions require a license. ",-1)])]),_:1})),n("div",Uy,[l[20]||(l[20]=n("div",{class:"flex-none w-20 font-light text-neutral-400"},[n("span",{class:"inline-block w-3 h-3 rounded-full bg-green-500"}),U(" Start ")],-1)),l[21]||(l[21]=n("div",{class:"flex-none w-32 pr-4"},null,-1)),n("div",Ly,[v(r,{label:"Chime",class:"inline-block text-neutral-400 font-light","select-class":"!pl-1 h-7",size:"sm",disabled:!s.licensed,options:e.chimeOptions,"model-value":s.chime.start||e.chimeOptions[0].value,"onUpdate:modelValue":l[0]||(l[0]=u=>o.updateChime("start",u))},null,8,["disabled","options","model-value"]),v(d,{class:"btn-ctrl bg-neutral-900 border-0 w-7 h-7 p-0 ml-1",disabled:s.chime.start===e.chimeOptions[0].value||!s.licensed,onClick:l[1]||(l[1]=u=>o.playChime(s.chime.start))},{default:L(()=>[v(p,{icon:e.faVolumeUp,size:"sm","fixed-width":""},null,8,["icon"])]),_:1},8,["disabled"])]),n("div",Ry,[v(r,{label:"Flash",class:"text-neutral-400 font-light","select-class":"!pl-1 h-7",size:"sm",disabled:!s.licensed,options:e.flashOptions,"model-value":s.flash.start||e.flashOptions[0].value,"onUpdate:modelValue":l[2]||(l[2]=u=>o.updateFlash("start",u))},null,8,["disabled","options","model-value"])])]),n("div",Ay,[l[22]||(l[22]=n("div",{class:"flex-none w-20 font-light text-neutral-400"},[n("span",{class:"inline-block w-3 h-3 rounded-full bg-amber-500"}),U(" Yellow ")],-1)),n("div",_y,[v(f,{minutes:o.yellowMinutes,"onUpdate:minutes":l[3]||(l[3]=u=>o.yellowMinutes=u),seconds:o.yellowSeconds,"onUpdate:seconds":l[4]||(l[4]=u=>o.yellowSeconds=u),"input-class":"h-7",onEnter:l[5]||(l[5]=u=>e.$emit("enter"))},null,8,["minutes","seconds"])]),n("div",Fy,[v(r,{label:"Chime",class:"inline-block text-neutral-400 font-light","select-class":"!pl-1 h-7",size:"sm",disabled:!s.licensed,options:e.chimeOptions,"model-value":s.chime.yellow||e.chimeOptions[0].value,"onUpdate:modelValue":l[6]||(l[6]=u=>o.updateChime("yellow",u))},null,8,["disabled","options","model-value"]),v(d,{class:"btn-ctrl bg-neutral-900 border-0 w-7 h-7 p-0 ml-1",disabled:s.chime.yellow===e.chimeOptions[0].value||!s.licensed,onClick:l[7]||(l[7]=u=>o.playChime(s.chime.yellow))},{default:L(()=>[v(p,{icon:e.faVolumeUp,size:"sm","fixed-width":""},null,8,["icon"])]),_:1},8,["disabled"])]),n("div",By,[v(r,{label:"Flash",class:"text-neutral-400 font-light","select-class":"!pl-1 h-7",size:"sm",disabled:!s.licensed,options:e.flashOptions,"model-value":s.flash.yellow||e.flashOptions[0].value,"onUpdate:modelValue":l[8]||(l[8]=u=>o.updateFlash("yellow",u))},null,8,["disabled","options","model-value"])])]),n("div",Py,[l[23]||(l[23]=n("div",{class:"flex-none w-20 font-light text-neutral-400"},[n("span",{class:"inline-block w-3 h-3 rounded-full bg-red-500"}),U(" Red ")],-1)),n("div",Ny,[v(f,{minutes:o.redMinutes,"onUpdate:minutes":l[9]||(l[9]=u=>o.redMinutes=u),seconds:o.redSeconds,"onUpdate:seconds":l[10]||(l[10]=u=>o.redSeconds=u),"input-class":"h-7",onEnter:l[11]||(l[11]=u=>e.$emit("enter"))},null,8,["minutes","seconds"])]),n("div",Hy,[v(r,{label:"Chime",class:"inline-block text-neutral-400 font-light","select-class":"!pl-1 h-7",size:"sm",disabled:!s.licensed,options:e.chimeOptions,"model-value":s.chime.red||e.chimeOptions[0].value,"onUpdate:modelValue":l[12]||(l[12]=u=>o.updateChime("red",u))},null,8,["disabled","options","model-value"]),v(d,{class:"btn-ctrl bg-neutral-900 border-0 w-7 h-7 p-0 ml-1",disabled:s.chime.red===e.chimeOptions[0].value||!s.licensed,onClick:l[13]||(l[13]=u=>o.playChime(s.chime.red))},{default:L(()=>[v(p,{icon:e.faVolumeUp,size:"sm","fixed-width":""},null,8,["icon"])]),_:1},8,["disabled"])]),n("div",Vy,[v(r,{label:"Flash",class:"text-neutral-400 font-light","select-class":"!pl-1 h-7",size:"sm",disabled:!s.licensed,options:e.flashOptions,"model-value":s.flash.red||e.flashOptions[0].value,"onUpdate:modelValue":l[14]||(l[14]=u=>o.updateFlash("red",u))},null,8,["disabled","options","model-value"])])]),n("div",jy,[l[24]||(l[24]=n("div",{class:"flex-none w-20 font-light text-neutral-400"},[n("span",{class:"inline-block w-3 h-3 rounded-full bg-neutral-500"}),U(" 0:00 ")],-1)),l[25]||(l[25]=n("div",{class:"flex-none w-32 pr-4"},null,-1)),n("div",qy,[v(r,{label:"Chime",class:"inline-block text-neutral-400 font-light","select-class":"!pl-1 h-7",size:"sm",disabled:!s.licensed,options:e.chimeOptions,"model-value":s.chime.zero||e.chimeOptions[0].value,"onUpdate:modelValue":l[15]||(l[15]=u=>o.updateChime("zero",u))},null,8,["disabled","options","model-value"]),v(d,{class:"btn-ctrl bg-neutral-900 border-0 w-7 h-7 p-0 ml-1",disabled:s.chime.zero===e.chimeOptions[0].value||!s.licensed,onClick:l[16]||(l[16]=u=>o.playChime(s.chime.zero))},{default:L(()=>[v(p,{icon:e.faVolumeUp,size:"sm","fixed-width":""},null,8,["icon"])]),_:1},8,["disabled"])]),n("div",Wy,[v(r,{label:"Flash",class:"text-neutral-400 font-light","select-class":"!pl-1 h-7",size:"sm",disabled:!s.licensed,options:e.flashOptions,"model-value":s.flash.zero||e.flashOptions[0].value,"onUpdate:modelValue":l[17]||(l[17]=u=>o.updateFlash("zero",u))},null,8,["disabled","options","model-value"])])])],32)}const Xy=Oe(Ey,[["render",Gy]]),Yy={class:"flex flex-wrap gap-8"},Ky={class:"flex-1 basis-52"},Zy={class:"flex-1 basis-52"},Qy={class:"font-light"},Jy={class:"flex flex-wrap items-baseline gap-2 mb-2"},e5={class:"text-xs text-neutral-500 hover:text-neutral-400 cursor-pointer"},t5={__name:"TimerItemModal",props:{timer:{type:Object,required:!0},index:{type:Number,default:void 0},timestamp:{type:Object,default:null},todFormat:{type:String,default:ce.AUTO,validator:e=>Object.values(ce).includes(e)},timezone:{type:String,default:null},open:Boolean,changable:Boolean,licensed:Boolean},emits:["update:open","update:timer","apply-to-all","reset"],setup(e,{emit:l}){const s=l,t=e,a=wt(),o=ht({}),i=Ni(),r=O(()=>Pt(o)),p=Nl(),d=O(()=>o.finishTime?p.getAdjustedTimestamp(Q({},o)):t.timestamp);function f(){Object.assign(o,t.timer)}function u(b){b.preventDefault();let c=!0;const w=()=>c=!1;i.emit("save",{preventDefault:w}),c&&(s("update:timer",o),b.confirm())}function m(){o.yellow=0,o.red=0}return(b,c)=>{const w=pe("FaIcon"),h=Ct("tooltip");return x(),Z(Le,{ref:"modal",open:e.open,title:`Settings for Timer ${e.index} »${e.timer.name}«`,icon:g(Vl),"width-class":"max-w-3xl","body-class":"font-light text-sm space-y-6",closable:"","onUpdate:open":c[22]||(c[22]=y=>s("update:open",y)),onConfirm:u,onShow:f},{default:L(({confirm:y})=>[v(eu,{name:o.name,"onUpdate:name":c[0]||(c[0]=S=>o.name=S),extra:o.extra,"onUpdate:extra":c[1]||(c[1]=S=>o.extra=S),notes:o.notes,"onUpdate:notes":c[2]||(c[2]=S=>o.notes=S),labels:o.labels,"onUpdate:labels":c[3]||(c[3]=S=>o.labels=S),"aggregate-labels":g(a).aggregateLabels,onEnter:y},null,8,["name","extra","notes","labels","aggregate-labels","onEnter"]),c[29]||(c[29]=n("hr",{class:"border-neutral-700"},null,-1)),n("div",Yy,[n("div",Ky,[c[23]||(c[23]=n("h3",{class:"font-semibold mb-2"}," Start ",-1)),v(lu,{trigger:o.trigger,"onUpdate:trigger":c[4]||(c[4]=S=>o.trigger=S),"start-time":o.startTime,"onUpdate:startTime":c[5]||(c[5]=S=>o.startTime=S),"start-date":o.startDate,"onUpdate:startDate":c[6]||(c[6]=S=>o.startDate=S),"tod-format":t.todFormat,timezone:t.timezone,"fallback-date":d.value.prevFinish,disabled:!e.changable,"hide-disabled-alert":"",class:"w-full",events:g(i),onEnter:y,onReset:c[7]||(c[7]=S=>s("reset"))}
13,null,8,["trigger","start-time","start-date","tod-format","timezone","fallback-date","disabled","events","onEnter"])]),n("div",Zy,[c[24]||(c[24]=n("h3",{class:"font-semibold mb-2"}," Duration ",-1)),v(ou,{hours:o.hours,"onUpdate:hours":c[8]||(c[8]=S=>o.hours=S),minutes:o.minutes,"onUpdate:minutes":c[9]||(c[9]=S=>o.minutes=S),seconds:o.seconds,"onUpdate:seconds":c[10]||(c[10]=S=>o.seconds=S),"finish-time":o.finishTime,"onUpdate:finishTime":c[11]||(c[11]=S=>o.finishTime=S),"finish-date":o.finishDate,"onUpdate:finishDate":c[12]||(c[12]=S=>o.finishDate=S),"timewarp-duration":o.timewarpDuration,"onUpdate:timewarpDuration":c[13]||(c[13]=S=>o.timewarpDuration=S),appearance:o.appearance,"onUpdate:appearance":c[14]||(c[14]=S=>o.appearance=S),type:o.type,"onUpdate:type":c[15]||(c[15]=S=>o.type=S),"tod-format":t.todFormat,timezone:t.timezone,"fallback-date":d.value.finish,disabled:!e.changable,"hide-disabled-alert":"",events:g(i),onEnter:y,onReset:c[16]||(c[16]=S=>s("reset")),onApplyToAll:c[17]||(c[17]=S=>s("apply-to-all",S))},null,8,["hours","minutes","seconds","finish-time","finish-date","timewarp-duration","appearance","type","tod-format","timezone","fallback-date","disabled","events","onEnter"])])]),c[30]||(c[30]=n("hr",{class:"border-neutral-700"},null,-1)),n("div",Qy,[n("div",Jy,[c[27]||(c[27]=n("h3",{class:"font-semibold"}," Wrap-up times & actions ",-1)),me((x(),$("span",e5,[v(w,{icon:g(Ot),size:"sm"},null,8,["icon"]),c[25]||(c[25]=U(" Chimes caveats ",-1))])),[[h,{triggers:["hover","click"],content:"Some browsers require the user to manually unmute the audio."}]]),c[28]||(c[28]=n("span",{class:"flex-grow"},null,-1)),v($t,{items:[{icon:g(Ti),label:"Set wrap-up times to 0:00",click:m},{icon:g(co),label:"Apply wrap-up times to all timers",click:()=>s("apply-to-all",{yellow:o.yellow,red:o.red})},{icon:g(uo),label:"Apply chime settings to all timers",click:()=>s("apply-to-all",{chime:o.chime})},{icon:g(mo),label:"Apply flash settings to all timers",click:()=>s("apply-to-all",{flash:o.flash})}],"button-class":"btn-ctrl text-sm text-neutral-500 h-6 px-2",align:"right",dark:""},{default:L(()=>[...c[26]||(c[26]=[U(" Actions ",-1)])]),_:1},8,["items"])]),v(ec,{class:"!h-4 rounded mb-2 overflow-hidden",total:r.value,left:r.value,yellow:o.yellow,red:o.red},null,8,["total","left","yellow","red"]),v(Xy,{yellow:o.yellow,"onUpdate:yellow":c[18]||(c[18]=S=>o.yellow=S),red:o.red,"onUpdate:red":c[19]||(c[19]=S=>o.red=S),chime:o.chime,"onUpdate:chime":c[20]||(c[20]=S=>o.chime=S),flash:o.flash,"onUpdate:flash":c[21]||(c[21]=S=>o.flash=S),duration:r.value,licensed:e.licensed,onEnter:y},null,8,["yellow","red","chime","flash","duration","licensed","onEnter"])])]),_:1},8,["open","title","icon"])}}},n5={class:"flex h-full"},l5={class:"flex-none w-24 h-full py-2 hidden sm:flex flex-col justify-center text-center truncate"},s5=["onClick"],o5=["title"],a5=["title"],i5={class:"bg-neutral-800 rounded px-1"},r5={key:2,class:"text-xs"},u5={class:"flex-none w-20 sm:w-24 h-full py-2 flex flex-col justify-center text-center truncate"},d5=["onClick"],c5=["title"],m5={key:0,class:"font-semibold text-xs"},p5={class:"bg-neutral-800 text-red-400 rounded px-1"},f5={class:"flex-auto h-full py-2 flex items-center pl-1 sm:pl-3"},b5={class:"flex-1 leading-5 py-px pr-6 sm:pr-9 min-w-[80px]"},v5=["onClick"],g5={class:"font-semibold break-words"},h5={key:2},x5={class:"relative inline-block"},w5={key:0,class:"flex flex-wrap gap-2 my-2"},y5={class:"flex-none flex items-center space-x-1 translate-x-0"},k5=["title"],$5={key:0,class:"absolute top-0 left-0 right-0 z-50 bg-black opacity-60 text-[10px] px-2"},Is=!0,S5={__name:"TimerItem",props:{index:{type:Number,required:!0},timer:{type:Object,required:!0},moment:{type:Object,required:!0},timestamp:{type:Object,default:null},timezone:{type:String,default:null},todFormat:{type:String,default:ce.AUTO},disabled:Boolean,limitReached:Boolean,loading:Boolean,licensed:Boolean,dragging:Boolean,selected:Boolean},emits:["update:timer","reset","start","stop","remove","clone","add-above","add-below","apply-to-all","toggle-select","shift-select","cmd-select"],setup(e,{emit:l}
13){const s=[{value:Ie.COUNTDOWN,label:"Countdown"},{value:Ie.COUNTUP,label:"Count Up"},{value:Ie.TOD,label:"Time of Day"},{value:Ie.COUNTDOWN_TOD,label:"C/D + ToD"},{value:Ie.COUNTUP_TOD,label:"C/U + ToD"},{value:Ie.HIDDEN,label:"Hidden"}],t=l,a=e,o=wt(),i=ht({}),r=F(!1),p=F(!1),d=F(!1),f=F(!1),u=qi(3),m=O(()=>a.timer._id===a.moment.timerId),b=O(()=>!!(m.value&&a.moment.running)),c=O(()=>Math.max((1-a.moment.left/a.moment.total)*100,0)),w=Nl(),h=O(()=>i.finishTime?w.getAdjustedTimestamp(Q({},i)):a.timestamp),y=O(()=>{var B;const W=a.timer.startTime||((B=a.timestamp)==null?void 0:B.start);return W?gn(W):null}),S=O(()=>y.value?nt(y.value,{todFormat:a.todFormat,seconds:"nonzero",timezone:a.timezone}):""),D=O(()=>{var W;return y.value?((W=y.value)==null?void 0:W.getSeconds())!==0:!1}),k=O(()=>Vi({trigger:a.timer.trigger,startTime:a.timer.startTime,startDate:a.timer.startDate,fallbackDate:h.value.prevFinish,timezone:a.timezone,todFormat:a.todFormat})),M=O(()=>ji({type:a.timer.type,hours:a.timer.hours,minutes:a.timer.minutes,seconds:a.timer.seconds,finishTime:a.timer.finishTime,finishDate:a.timer.finishDate,fallbackDate:h.value.finish,timewarpDuration:a.timer.timewarpDuration,timezone:a.timezone,todFormat:a.todFormat})),I=O(()=>{const W=a.timestamp.delay,B=W>0?"+":"";return Math.abs(W)>=36e5?B+Math.round(W/36e5)+"h":Math.abs(W)>=6e4?B+Math.round(W/6e4)+"m":Math.abs(W)>=1e3?B+Math.round(W/1e3)+"s":0}),R=O(()=>{const W=b.value?"was":"will be",B=Si(a.timestamp.delay),ie=a.timestamp.delay>0?"late":"early";return`Actual start ${W} ${B} ${ie}.`}),T=O(()=>a.timer.type!==et.FINISH_TIME||!a.timestamp.start?!1:a.timestamp.finish-a.timestamp.start<0),C=O(()=>Object.values(a.timer.chime).some(W=>W&&W!==Me.NONE)),E=O(()=>Object.values(a.timer.flash).some(W=>W&&parseInt(W)!==0));function _(){r.value=!r.value}function P(W,B){Object.assign(i,a.timer),i.labels=i.labels||[],B==null||B()}function A(W,B){t("update:timer",Js(i)),B==null||B()}function z(W){t(W)}function K(W){const B=new Date(W);return Uu(B)?jt(B,"yyyy-MM-dd",{in:yi(a.timezone)}):""}function H(W){W.shiftKey?t("shift-select"):t("toggle-select")}function G(W){(W.metaKey||W.ctrlKey)&&(W.preventDefault(),W.stopPropagation(),t("cmd-select"))}const ne=O(()=>b.value?"text-red-300":m.value?"text-blue-300":"text-neutral-400"),V=O(()=>b.value?"text-red-400":m.value?"text-blue-400":"text-neutral-500"),X=O(()=>b.value?"border-red-500":m.value?"border-blue-500":"border-neutral-600"),ae=O(()=>b.value?"ring-red-500":m.value?"ring-blue-500":"ring-neutral-600"),Se=O(()=>b.value?"hover:bg-red-600":m.value?"hover:bg-blue-600":"hover:bg-neutral-700");return(W,B)=>{const ie=pe("FaIcon"),xe=Ct("tooltip");return x(),Z(go,{class:j(["min-h-[5rem]",{"opacity-50 ring-2 ring-offset-4 ring-neutral-600 ring-offset-neutral-900":e.dragging,"ring-1 ring-teal-500/60":a.selected&&!m.value,"ring-1 ring-sky-300/60":a.selected&&m.value}]),"content-class":"py-0",index:g(o).isSelectMode?null:e.index,highlighted:m.value,active:b.value,progress:Math.min(c.value,100),loading:e.loading,disabled:e.disabled,"data-label":"timer-item","data-id":e.timer._id,draggable:!g(o).isSelectMode,onClick:G},bu({default:L(()=>{var we,Ae,fe;return[n("div",n5,[n("div",l5,[n("div",{class:j(["card-hover text-xs",V.value])}," Start ",2),v(Sl,{open:p.value,"onUpdate:open":B[4]||(B[4]=te=>p.value=te),"width-class":"w-[calc(100vw-2rem)] max-w-sm","auto-hide":"",onSave:B[5]||(B[5]=te=>A("startFormOpen",te))},{default:L(({show:te})=>[n("button",{class:j(["border-b border-dashed font-semibold leading-5 hover:border-white transition-colors ring-0 focus:border-white pt-px my-1",X.value]),"data-label":"btn-timer-start-form",onClick:We=>P("startFormOpen",te)},[n("span",{title:k.value.text,class:j([e.timer.startTime?"":V.value,{"text-sm":D.value||e.timer.trigger!==g(_e).MANUAL},{"!text-xs":D.value&&e.timer.trigger!==g(_e).MANUAL}])},[e.timer.trigger===g(_e).SCHEDULED?(x(),Z(ie,{key:0,icon:g(co),size:"sm","data-label":"icon-timer-scheduled"},null,8,["icon"])):N("",!0),e.timer.trigger===g(_e).LINKED?(x(),Z(ie,{key:1,icon:g(Xn),size:"sm","data-label":"icon-timer-linked"},null,8,["icon"])):N("",!0),U(" "+q(S.value||"Add time"),1)],10,o5)],10,s5)]),popper:L(({save:te,events:We})=>[v(lu,{trigger:i.trigger,"onUpdate:trigger":B[0]||(B[0]=ye=>i.trigger=ye),"start-time":i.startTime,"onUpdate:startTime":B[1]||(B[
131]=ye=>i.startTime=ye),"start-date":i.startDate,"onUpdate:startDate":B[2]||(B[2]=ye=>i.startDate=ye),"tod-format":a.todFormat,timezone:a.timezone,"fallback-date":h.value.prevFinish,disabled:!Is,events:We,onEnter:te,onReset:B[3]||(B[3]=ye=>t("reset"))},null,8,["trigger","start-time","start-date","tod-format","timezone","fallback-date","disabled","events","onEnter"])]),_:1},8,["open"]),e.timestamp.delay>2e3?(x(),$("div",{key:0,title:R.value,class:j(["font-semibold text-xs",{"text-red-400":e.timestamp.delay>0,"text-green-400":e.timestamp.delay<0}])},[n("span",i5,q(I.value),1)],10,a5)):e.timer.startTime&&e.timer.startDate?(x(),$("div",{key:1,class:j(["card-hover text-xs",V.value])},q(K(e.timer.startTime)),3)):(x(),$("div",r5," Â "))]),n("div",u5,[n("div",{class:j(["card-hover text-xs",V.value])}," Duration ",2),v(Sl,{open:d.value,"onUpdate:open":B[16]||(B[16]=te=>d.value=te),"width-class":"w-[calc(100vw-2rem)] max-w-sm","auto-hide":"",onSave:B[17]||(B[17]=te=>A("durationFormOpen",te))},{default:L(({show:te})=>[n("button",{class:j(["border-b border-dashed font-semibold leading-5 hover:border-white transition-colors ring-0 focus:border-white pt-px my-1",X.value]),"data-label":"btn-timer-duration-form",onClick:We=>P("durationFormOpen",te)},[n("span",{title:M.value.text},[v(qd,{timer:a.timer,timezone:a.timezone,"tod-format":a.todFormat,"soft-color-class":V.value},null,8,["timer","timezone","tod-format","soft-color-class"])],8,c5)],10,d5)]),popper:L(({save:te,events:We})=>[v(ou,{hours:i.hours,"onUpdate:hours":B[6]||(B[6]=ye=>i.hours=ye),minutes:i.minutes,"onUpdate:minutes":B[7]||(B[7]=ye=>i.minutes=ye),seconds:i.seconds,"onUpdate:seconds":B[8]||(B[8]=ye=>i.seconds=ye),"finish-time":i.finishTime,"onUpdate:finishTime":B[9]||(B[9]=ye=>i.finishTime=ye),"finish-date":i.finishDate,"onUpdate:finishDate":B[10]||(B[10]=ye=>i.finishDate=ye),"timewarp-duration":i.timewarpDuration,"onUpdate:timewarpDuration":B[11]||(B[11]=ye=>i.timewarpDuration=ye),appearance:i.appearance,"onUpdate:appearance":B[12]||(B[12]=ye=>i.appearance=ye),type:i.type,"onUpdate:type":B[13]||(B[13]=ye=>i.type=ye),"tod-format":a.todFormat,timezone:a.timezone,"fallback-date":h.value.finish,disabled:!Is,events:We,onEnter:te,onReset:B[14]||(B[14]=ye=>t("reset")),onApplyToAll:B[15]||(B[15]=ye=>t("apply-to-all",ye))},null,8,["hours","minutes","seconds","finish-time","finish-date","timewarp-duration","appearance","type","tod-format","timezone","fallback-date","disabled","events","onEnter"])]),_:1},8,["open"]),T.value?me((x(),$("div",m5,[n("span",p5,[v(ie,{icon:g(Hl),size:"sm"},null,8,["icon"]),B[32]||(B[32]=U(" Conflict ",-1))])])),[[xe,{delay:300,content:`Start time (${k.value.time} ${k.value.date} ${k.value.timezone}) is after finish time (${M.value.time} ${M.value.date} ${M.value.timezone})`}]]):e.timer.type===g(et).FINISH_TIME&&e.timer.finishDate?(x(),$("div",{key:1,class:j(["card-hover text-xs",V.value])},q(K(e.timer.finishTime)),3)):(x(),$("div",{key:2,class:j(["card-hover text-xs",V.value])},[v(ow,{options:s,"model-value":e.timer.appearance,"onUpdate:modelValue":B[18]||(B[18]=te=>t("update:timer",re(Q({},e.timer),{appearance:te})))},null,8,["model-value"])],2))]),n("div",f5,[n("div",b5,[v(Sl,{open:f.value,"onUpdate:open":B[23]||(B[23]=te=>f.value=te),"auto-hide":"","width-class":"w-[calc(100vw-2rem)] max-w-2xl",onSave:B[24]||(B[24]=te=>A("nameFormOpen",te))},{default:L(({show:te})=>[n("button",{class:j(["text-left cursor-pointer hover:text-white transition-colors flex-1 rounded focus:ring-2 focus:outline-none -ml-1 px-1",ae.value]),"data-label":"btn-timer-name-form",onClick:We=>P("nameFormOpen",te)},[C.value?me((x(),$("span",{key:0,class:j([V.value,"mr-1 text-xs align-middle align-[2px]"])},[v(ie,{icon:g(uo),size:"sm"},null,8,["icon"])],2)),[[xe,{delay:300,content:"Chime wrap-up actions"}]]):N("",!0),E.value?me((x(),$("span",{key:1,class:j([V.value,"mr-1 text-xs align-[2px]"])},[v(ie,{icon:g(mo),size:"sm"},null,8,["icon"])],2)),[[xe,{delay:300,content:"Flash wrap-up actions"}]]):N("",!0),n("span",g5,q(e.timer.name),1),e.timer.extra?(x(),$("span",h5,"Â ")):N("",!0),e.timer.extra?(x(),$("span",{key:3,class:j(["font-light break-words",ne.value])},q(e.timer.extra),3)):N("",!0),n("span",x5,[B[33]||(B[33]=U(" â ",-1)),n("span",{class:j(["card-hover absolute left-1 top-1/2 -translate-y-1/2 flex items-center justify-center hover:text-white transition-colors h-7 w-7",V.value])},[v(ie,{icon:g(dd),size:"xs"},null,8,["icon"])],2)])],10,v5)]),popper:L(({save:te,events:We})=>[v(eu,{name:i.name,"onUpdate:name":B[19]||(B[19]=ye=>i.name=ye),extra:i.extra,"onUpdate:extra":B[20]||(B[20]=ye=>i.extra=ye),notes:i.notes,"onUpdate:notes":B[21]||(B[21]=ye=>i.notes=ye),labels:i.labels,"onUpdate:labels":B[22]||(B[22]=ye=>i.labels=ye),"aggregate-labels":g(o).aggregateLabels,events:We,onEnter:te},null,8,["name","extra","notes","labels","aggregate-labels","events","onEnter"])]),_:1},8,["open"]),(we=e.timer.labels)!=null&&we.length?(x(),$("div",w5,[(x(!0),$(ee,null,ge(e.timer.labels,(te,We)=>(x(),Z(jl,{key:e.timer.id+"-"+We,label:te},null,8,["label"]))),128))])):N("",!0),e.timer.notes?(x(),$("div",{key:1,class:j(["text-sm font-light italic mt-2",ne.value]),style:{"word-break":"break-word"}},[(x(!0),$(ee,null,ge(e.timer.notes.split(` 14`),(te,We)=>(x(),$("p",{key:`note-line-${We}`},q(te),1))),128))],2)):N("",!0)]),n("div",y5,[n("button",{class:j(["btn-ctrl w-9 h-9 p-0 text-xs",[X.value,{"hover:!border-white":b.value||m.value}]]),"data-label":"btn-timer-item-reset",title:m.value?"Reset Timer":"Select Timer",onClick:B[25]||
14(B[25]=te=>t("reset"))},[v(ie,{icon:m.value?g(Oi):g(Pi),"fixed-width":""},null,8,["icon"])],10,k5),n("button",{class:j(["btn-ctrl w-9 h-9 p-0 text-xs",[X.value,{"hover:!border-white":b.value||m.value}]]),"data-label":"btn-timer-item-settings",title:"Open settings for this timer",onClick:_},[v(ie,{icon:g(Vl),"fixed-width":""},null,8,["icon"])],2),v(Qi,{class:j(["h-9 w-9 md:w-12",X.value]),running:b.value,"data-label":"btn-timer-item-start-stop",onStart:B[26]||(B[26]=te=>t("start")),onStop:B[27]||(B[27]=te=>t("stop"))},null,8,["class","running"]),v(Jx,{items:[{icon:g(Ml),label:"Add above",disabled:e.limitReached,click:()=>z("add-above")},{icon:g(Tl),label:"Add below",disabled:e.limitReached,click:()=>z("add-below")},{divider:!0},{icon:g(Bn),label:"Clone",disabled:e.limitReached,click:()=>z("clone")},{icon:g(en),label:"Delete",disabled:b.value,click:()=>z("remove")}],dark:"","button-class":[V.value,"btn-ctrl bg-transparent !border-transparent w-7 h-9 p-0"],"button-label":"btn-timer-item-context"},{default:L(()=>[v(ie,{icon:g(Kn),size:"sm","fixed-width":""},null,8,["icon"])]),_:1},8,["items","button-class"])])])]),v(t5,{open:r.value,"onUpdate:open":B[28]||(B[28]=te=>r.value=te),index:e.index,timer:a.timer,timestamp:a.timestamp,changable:Is,"tod-format":a.todFormat,timezone:a.timezone,licensed:e.licensed,"onUpdate:timer":B[29]||(B[29]=te=>t("update:timer",te)),onReset:B[30]||(B[30]=te=>t("reset")),onApplyToAll:B[31]||(B[31]=te=>t("apply-to-all",te))},null,8,["open","index","timer","timestamp","tod-format","timezone","licensed"]),g(u)?(x(),$("div",$5,q((Ae=h.value.start)==null?void 0:Ae.toISOString())+" â "+q((fe=h.value.finish)==null?void 0:fe.toISOString()),1)):N("",!0)]}),_:2},[g(o).isSelectMode?{name:"index",fn:L(()=>[n("button",{class:j(["w-6 h-6 flex items-center justify-center rounded transition-colors",[Se.value,{"text-teal-400 bg-black/30":a.selected,"text-neutral-200":!a.selected}]]),"data-label":"btn-timer-select",title:"Select timer (Shift+click for range)",onClick:Be(H,["stop"])},[v(ie,{icon:a.selected?g(po):g(fo),size:"sm"},null,8,["icon"])],2)]),key:"0"}:void 0]),1032,["class","index","highlighted","active","progress","loading","disabled","data-id","draggable"])}}},C5={components:{Card:go,InfoTooltip:Y,DropdownMenu:$t},props:{gap:{type:Number,default:0},compensation:{type:Number,default:0},linked:Boolean,disabled:Boolean,loading:Boolean,prevTimerRunning:Boolean,nextTimerRunning:Boolean,isFirstTimer:Boolean,isLastTimer:Boolean},emits:["link","createBreakTimer","adjustPrevDuration","adjustPrevStart","adjustNextDuration","adjustNextStart"],computed:{conflict(){return this.gap<0},formattedGab(){return Math.abs(this.gap)>=24*36e5?"longâ¦":vn(this.gap)||""},formattedInWords(){return Si(this.gap)},formattedCompensation(){return vn(Math.abs(this.compensation))||""},menuItems(){return this.conflict?[{label:"Shrink Previous Duration",icon:Ml,disabled:this.prevTimerRunning,click:()=>this.$emit("adjustPrevDuration",this.gap)},{label:"Shift Previous Start",icon:"spacer",disabled:this.prevTimerRunning,click:()=>this.$emit("adjustPrevStart",this.gap)},{separator:!0},{label:"Shrink Next Duration",icon:Tl,disabled:this.nextTimerRunning,click:()=>this.$emit("adjustNextDuration",this.gap)},{label:"Shift Next Start",icon:"spacer",disabled:this.nextTimerRunning,click:()=>this.$emit("adjustNextStart",this.gap)}]:[{label:"Convert into a Timer",icon:sn,disabled:this.disabled,click:()=>this.$emit("createBreakTimer")},{separator:!0},{label:"Extend Previous Duration",icon:Ml,disabled:this.prevTimerRunning,click:()=>this.$emit("adjustPrevDuration",this.gap)},{label:"Shift Previous Start",icon:"spacer",disabled:this.prevTimerRunning,click:()=>this.$emit("adjustPrevStart",this.gap)},{separator:!0},{label:"Extend Next Duration",icon:Tl,disabled:this.nextTimerRunning,click:()=>this.$emit("adjustNextDuration",this.gap)},{label:"Shift Next Start",icon:"spacer",disabled:this.nextTimerRunning,click:()=>this.$emit("adjustNextStart",this.gap)}]}},methods:{link(){var e;this.$emit("link",!this.linked),(e=this.$refs.link)==null||e.blur()}}},M5={class:"relative -mt-4"},T5={class:"flex items-center"},z5={class:"flex-none w-24 text-center"}
14,I5={class:"flex-auto pl-3 font-light text-xs"},O5={key:0,class:"text-neutral-500"},D5={key:1,class:"text-neutral-500"},E5={key:2,class:"text-red-400"},U5={key:3,class:"text-red-400"},L5={key:4,class:"text-neutral-500"},R5={key:1,class:"h-4"},A5=["disabled"];function _5(e,l,s,t,a,o){const i=pe("InfoTooltip"),r=pe("DropdownMenu"),p=pe("Card");return x(),$("div",M5,[l[5]||(l[5]=n("div",{class:"h-4"},null,-1)),s.gap?(x(),Z(p,{key:0,loading:s.loading},{default:L(()=>[n("div",T5,[l[2]||(l[2]=n("div",{class:"flex-none w-8 -ml-2"},null,-1)),l[3]||(l[3]=n("div",{class:"flex-none w-24"},null,-1)),n("div",z5,[n("span",{class:j(["font-semibold text-sm",{"text-neutral-500":s.gap>=0,"text-red-400":s.gap<0}])},q(o.formattedGab),3)]),n("div",I5,[o.conflict?(x(),$("p",O5,[U(" Conflict of "+q(o.formattedInWords)+" ",1),v(i,{class:"inline","text-class":"text-neutral-600 hover:text-current",tooltip:`The next timer is planned to start ${o.formattedInWords} before the previous timer finishes.`},null,8,["tooltip"])])):(x(),$("p",D5," Break of "+q(o.formattedInWords)+". ",1)),s.compensation>0?(x(),$("p",E5,q(o.formattedCompensation)+" of break used to compensate for delay. ",1)):s.compensation<0?(x(),$("p",U5," Conflict adds "+q(o.formattedCompensation)+" to delay. ",1)):s.linked?(x(),$("p",L5," ("+q(o.conflict?"Conflict":"Break")+" ignored because timers are linked.) ",1)):N("",!0)]),n("div",null,[v(r,{items:o.menuItems,align:"right","button-class":"btn-ctrl text-sm h-7",dark:"",teleport:""},{default:L(()=>[...l[1]||(l[1]=[U(" Resolve ",-1)])]),_:1},8,["items"])])])]),_:1},8,["loading"])):N("",!0),s.gap?(x(),$("div",R5)):N("",!0),n("button",{ref:"link",title:"Link: Auto-start when previous timer reaches 0:00","data-label":"btn-link-timers",class:j(["absolute z-10 left-8 -top-2 -bottom-2 w-24 rounded transition-opacity",{"text-neutral-600 hover:text-neutral-500":s.linked,"text-neutral-800":!s.linked,"opacity-0 hover:opacity-100 focus:opacity-100":!s.linked,invisible:s.disabled}]),disabled:s.disabled,onClick:l[0]||(l[0]=(...d)=>o.link&&o.link(...d))},[...l[4]||(l[4]=[n("div",{class:"absolute top-0 bottom-0 left-1/2 w-3 -ml-1 rounded-full bg-current border-4 border-neutral-900"},null,-1)])],10,A5)])}const F5=Oe(C5,[["render",_5]]),B5={key:0,class:"flex gap-2 items-center rounded bg-neutral-800 py-2 px-3 font-light text-xs mb-4"},P5=["id"],N5={class:"text-center mt-4"},H5=["disabled"],V5={__name:"TimerList",emits:["activeItemEl","bulk-delete","bulk-clone","bulk-link","bulk-unlink","fix-times","unset-start-times"],setup(e,{emit:l}){const s=Fe(),t=kn(),a=Nl(),o=wt(),i=Wi(),r=F(!1),p=F(),d=F(null),f=l,u=O(()=>{var V,X;return((V=s.limits)==null?void 0:V.timers)!==-1&&o.count>=((X=s.limits)==null?void 0:X.timers)}),m=V=>o.loading.includes(V),b=V=>le(null,null,function*(){return de(se.post(`/rooms/${s.pid}/timers/${V}/reset`),(X,ae)=>t.set(X,ae),()=>o.loadingStart(V),()=>o.loadingResolve(V))}),c=V=>le(null,null,function*(){return de(se.post(`/rooms/${s.pid}/timers/${V}/start`),(X,ae)=>t.set(X,ae),()=>o.loadingStart(V),()=>o.loadingResolve(V))}),w=V=>le(null,null,function*(){return de(se.post(`/rooms/${s.pid}/timers/${V}/stop`),(X,ae)=>t.set(X,ae),()=>o.loadingStart(V),()=>o.loadingResolve(V))}),h=()=>le(null,null,function*(){return de(se.post(`/rooms/${s.pid}/timers`),(V,X)=>o.setAll(V,X),()=>o.loadingStart("new"),()=>o.loadingResolve("new"))}),y=V=>le(null,null,function*(){return de(se.post(`/rooms/${s.pid}/timers`,{insertBefore:V}),(X,ae)=>o.setAll(X,ae))}),S=V=>le(null,null,function*(){return de(se.post(`/rooms/${s.pid}/timers`,{insertAfter:V}),(X,ae)=>o.setAll(X,ae))}),D=V=>le(null,null,function*(){return de(se.patch(`/rooms/${s.pid}/timers/${V._id}`,V),(X,ae)=>o.setOne(X,ae),()=>o.loadingStart(V._id),()=>o.loadingResolve(V._id))}),k=V=>le(null,null,function*(){return de(se.delete(`/rooms/${s.pid}/timers/${V}`),()=>o.removeOne(V),()=>o.loadingStart(V),()=>o.loadingResolve(V))}),M=V=>le(null,null,function*(){return de(se.post(`/rooms/${s.pid}/timers/${V}/clone`),(X,ae)=>o.setAll(X,ae),()=>o.loadingStart(V),()=>o.loadingResolve(V))}),I=V=>le(null,null,function*(){return de(se.patch(`/rooms/${s.pid}/timers`,V),(X,ae)=>o.setAll(X,ae),()=>o.loadingStart("all"),()=>o.loadingResolve("all"))});function R(V){return le(this,null,function*(){const X=V.map(ae=>ae._id);o.reorder(X),yield de(se.patch(`/rooms/${s.pid}/timers/reorder`,X))})}function T(V,X){const ae=X?_e.LINKED:_e.MANUAL;D(re(Q({},V),{trigger:ae}))}function C(V){return t.running&&String(t.timerId)===String(V)}function E(V,X){return le(this,null,function*(){const ae=Math.abs(X.gap),Se=Math.floor(ae/1e3),W=Math.floor(Se/3600),B=Math.floor(Se%3600/60),ie=Se%60,xe=X.prevFinish,we=o.items[V-1],Ae=o.items[V],fe=(Ae==null?void 0:Ae.trigger)===_e.LINKED?_e.LINKED:_e.MANUAL;yield de(se.post(`/rooms/${s.pid}/timers`,{name:"Break",hours:W,minutes:B,seconds:ie,startTime:xe,trigger:fe,insertAfter:we==null?void 0:we._id}),(te,We)=>o.setAll(te,We),()=>o.loadingStart(`gap-${V}`),()=>o.loadingResolve(`gap-${V}`))})}function _(V,X){if(!V)return;
14if(V.type==="FINISH_TIME"){const we=Lt(new Date(V.finishTime),X).toISOString();D(re(Q({},V),{finishTime:we}));return}const ae=((V.hours||0)*3600+(V.minutes||0)*60+(V.seconds||0))*1e3,Se=Math.max(0,ae+X),W=Math.floor(Se/1e3),B=Math.floor(W/3600),ie=Math.floor(W%3600/60),xe=W%60;D(re(Q({},V),{hours:B,minutes:ie,seconds:xe}))}function P(V,X){A(V,-X,!1)}function A(V,X,ae=!0){if(!V)return;const Se=o.items.findIndex(We=>We._id===V._id),W=a.all[Se];if(!W)return;const B=Lt(new Date(W.start),-X).toISOString();if(V.type==="FINISH_TIME"||!ae){D(re(Q({},V),{startTime:B}));return}const ie=((V.hours||0)*3600+(V.minutes||0)*60+(V.seconds||0))*1e3,xe=Math.max(0,ie+X),we=Math.floor(xe/1e3),Ae=Math.floor(we/3600),fe=Math.floor(we%3600/60),te=we%60;D(re(Q({},V),{startTime:B,hours:Ae,minutes:fe,seconds:te}))}function z(V){o.toggleSelection(V),d.value=V}function K(V){d.value?o.selectRange(d.value,V):o.toggleSelection(V),d.value=V}function H(V){o.isSelectMode||o.enterSelectMode(),o.toggleSelection(V),d.value=V}function G(V){if(!so(V)){if((V.metaKey||V.ctrlKey)&&V.key==="a"&&!i.isSelectMode&&(V.preventDefault(),o.isSelectMode?o.selectedCount===o.count?o.clearSelection():o.selectAll():(o.enterSelectMode(),o.selectAll())),V.key==="Escape"&&o.isSelectMode&&(document.querySelector('[role="dialog"], .modal-mask, [data-floating-ui-portal]')||o.exitSelectMode()),(V.key==="Backspace"||V.key==="Delete")&&o.isSelectMode&&o.selectedCount>0){const X=document.activeElement;(X==null?void 0:X.tagName)!=="INPUT"&&(X==null?void 0:X.tagName)!=="TEXTAREA"&&(V.preventDefault(),f("bulk-delete",[...o.selectedIds]))}(V.metaKey||V.ctrlKey)&&V.key==="d"&&o.isSelectMode&&o.selectedCount>0&&(V.preventDefault(),f("bulk-clone",[...o.selectedIds])),(V.metaKey||V.ctrlKey)&&V.key==="l"&&o.isSelectMode&&o.selectedCount>0&&(V.preventDefault(),f("bulk-link",[...o.selectedIds])),(V.metaKey||V.ctrlKey)&&V.key==="u"&&o.isSelectMode&&o.selectedCount>0&&(V.preventDefault(),f("bulk-unlink",[...o.selectedIds]))}}De(()=>{dt(()=>ne(t.timerId,!0)),document.addEventListener("keydown",G)}),Qe(()=>{document.removeEventListener("keydown",G)}),Te(()=>t.timerId,V=>ne(V,!1));function ne(V,X=!1){if(!p.value)return;const ae=p.value.$el.querySelector(`[data-id="${V}"]`);ae&&f("activeItemEl",{activeEl:ae,force:X})}return(V,X)=>{var Se;const ae=pe("FaIcon");return x(),$("div",null,[g(a).isMultiDay&&!((Se=g(o).first)!=null&&Se.startDate)?(x(),$("div",B5,[v(ae,{icon:g(Hl),size:"sm",class:"text-yellow-400"},null,8,["icon"]),X[3]||(X[3]=n("span",{class:"text-neutral-400"}," To accurately track time for events spanning multiple days, please specify a start date for the initial timer. ",-1))])):N("",!0),v(g(vo),{ref_key:"timerListDragable",ref:p,class:"space-y-4","model-value":g(o).items,"item-key":"_id","component-data":{name:"list-fade"},handle:".drag-handle",disabled:g(o).isSelectMode,onStart:X[1]||(X[1]=W=>r.value=W.oldIndex),onEnd:X[2]||(X[2]=W=>r.value=null),"onUpdate:modelValue":R},{item:L(({element:W,index:B})=>{var ie,xe,we,Ae,fe;return[(x(),$("div",{id:W._id,key:W._id,class:"relative rounded"},[B!==0?(x(),Z(F5,{key:0,gap:g(a).all[B].gap,compensation:g(a).all[B].compensation,linked:W.trigger===g(_e).LINKED,disabled:((ie=g(s).limits)==null?void 0:ie.timers)!==-1&&B>=((xe=g(s).limits)==null?void 0:xe.timers),loading:m(`gap-${B}`),"prev-timer-running":C((we=g(o).items[B-1])==null?void 0:we._id),"next-timer-running":C(W._id),"is-first-timer":B===1,"is-last-timer":B===g(o).items.length-1,onLink:te=>T(W,te),onCreateBreakTimer:te=>E(B,g(a).all[B]),onAdjustPrevDuration:te=>_(g(o).items[B-1],te),onAdjustPrevStart:te=>P(g(o).items[B-1],te),onAdjustNextDuration:te=>A(W,te),onAdjustNextStart:te=>P(W,-te)},null,8,["gap","compensation","linked","disabled","loading","prev-timer-running","next-timer-running","is-first-timer","is-last-timer","onLink","onCreateBreakTimer","onAdjustPrevDuration","onAdjustPrevStart","onAdjustNextDuration","onAdjustNextStart"])):N("",!0),v(S5,{index:B+1,timer:W,moment:g(t).moment,loading:m(W._id)||m("all"),timestamp:g(a).all[B],disabled:((Ae=g(s).limits)==null?void 0:Ae.timers)!==-1&&B>=((fe=g(s).limits)==null?void 0:fe.timers),"limit-reached":u.value,licensed:g(s).licensed,timezone:g
14(s).settings.timezone,"tod-format":g(s).settings.todFormat,dragging:r.value===B,selected:g(o).isSelected(W._id),"onUpdate:timer":D,onReset:te=>b(W._id),onStart:te=>c(W._id),onStop:te=>w(W._id),onRemove:te=>k(W._id),onClone:te=>M(W._id),onAddAbove:te=>y(W._id),onAddBelow:te=>S(W._id),onApplyToAll:X[0]||(X[0]=te=>I(te)),onToggleSelect:te=>z(W._id),onShiftSelect:te=>K(W._id),onCmdSelect:te=>H(W._id)},null,8,["index","timer","moment","loading","timestamp","disabled","limit-reached","licensed","timezone","tod-format","dragging","selected","onReset","onStart","onStop","onRemove","onClone","onAddAbove","onAddBelow","onToggleSelect","onShiftSelect","onCmdSelect"])],8,P5))]}),_:1},8,["model-value","disabled"]),m("new")?(x(),Z(go,{key:1,class:"mt-4"},{default:L(()=>[v(zt,{class:"mx-auto"})]),_:1})):N("",!0),n("div",N5,[n("button",{class:"btn-ctrl h-8 px-6 space-x-2",disabled:u.value,"data-label":"add-timer-button",onClick:h},[v(ae,{icon:g(sn),size:"xs"},null,8,["icon"]),X[4]||(X[4]=n("span",null,"Add Timer",-1)),u.value?(x(),Z(Su,{key:0,tooltip:"Timer limit reached"})):N("",!0)],8,H5),u.value?(x(),Z(It,{key:0,class:"mt-3","data-label":"timer-limit-warning",center:""},{default:L(()=>{var W;return[U(" Adding or controlling more than "+q((W=g(s).limits)==null?void 0:W.timers)+" timers requires a license upgrade. ",1)]}),_:1})):N("",!0)])])}}},j5={class:"flex items-center gap-2 text-sm overflow-hidden min-w-0"},q5=["title"],W5={key:0,class:"ml-1 inline-block text-left w-[5rem]"},G5={key:1,class:"ml-1 text-neutral-500 px-1"},X5={class:"text-neutral-400 whitespace-nowrap"},Y5=["disabled"],K5={key:0,class:"ml-1"},Z5={key:1,class:"ml-1 text-red-400/60 px-1"},Q5=["disabled","title"],J5={key:0,class:"ml-1"},e3={key:1,class:"ml-1 text-neutral-500 px-1"},t3={key:0,class:"ml-1"},n3={key:0,class:"ml-1"},l3={__name:"TimerSelectBar",props:{width:{type:Number,default:void 0}},emits:["bulk-update","bulk-delete","bulk-clone","bulk-move","fix-times","unset-start-times"],setup(e,{emit:l}){const s=l,t=e,a=wt(),o={labels:700,selectAll:750,kbd:850},i=O(()=>a.selectedCount>0?[...a.selectedIds]:null),r=O(()=>a.items.filter(u=>!a.selectedIds.includes(u._id)).map(u=>({label:`${a.idIndexMap[u._id]+1}. ${u.name||u.extra||"Untitled"}`,click:()=>s("bulk-move",{timerIds:i.value,position:{after:u._id}})}))),p=O(()=>[{icon:Ml,label:"Move to top",disabled:a.selectedCount===0,click:()=>s("bulk-move",{timerIds:i.value,position:"top"})},{icon:Gi,label:"Move after...",disabled:a.selectedCount===0||r.value.length===0,items:r.value},{icon:Tl,label:"Move to bottom",disabled:a.selectedCount===0,click:()=>s("bulk-move",{timerIds:i.value,position:"bottom"})}]),d=O(()=>[{icon:Xn,label:"Link selected",hint:`${Tt}+L`,disabled:a.selectedCount===0,click:()=>s("bulk-update",{trigger:_e.LINKED,timerIds:i.value})},{icon:md,label:"Unlink selected",hint:`${Tt}+U`,disabled:a.selectedCount===0,click:()=>s("bulk-update",{trigger:_e.MANUAL,timerIds:i.value})},{separator:!0},{icon:pd,label:"Fix times",disabled:a.selectedCount===0,click:()=>s("fix-times",i.value)},{icon:co,label:"Clear start times",disabled:a.selectedCount===0,click:()=>s("unset-start-times",i.value)},{separator:!0},{icon:fd,label:"Timer Appearance",disabled:a.selectedCount===0,items:[{label:"Countdown",click:()=>s("bulk-update",{appearance:Ie.COUNTDOWN,timerIds:i.value})},{label:"Count Up",click:()=>s("bulk-update",{appearance:Ie.COUNTUP,timerIds:i.value})},{label:"Time of Day",click:()=>s("bulk-update",{appearance:Ie.TOD,timerIds:i.value})},{label:"C/D + ToD",click:()=>s("bulk-update",{appearance:Ie.COUNTDOWN_TOD,timerIds:i.value})},{label:"C/U + ToD",click:()=>s("bulk-update",{appearance:Ie.COUNTUP_TOD,timerIds:i.value})},{label:"Hidden",click:()=>s("bulk-update",{appearance:Ie.HIDDEN,timerIds:i.value})}]}]);function f(){a.selectedCount===a.count?a.clearSelection():a.selectAll()}return(u,m)=>{const b=pe("FaIcon");return x(),$("div",j5,[n("button",{class:"btn-ctrl h-7 px-2",title:"Exit select mode","data-label":"btn-exit-select-mode",onClick:m[0]||(m[0]=c=>g(a).exitSelectMode())},[v(b,{icon:g(Pl),size:"sm"},null,8,["icon"])]),n("button",{class:"btn-ctrl h-7 px-2",title:(g(a).selectedCount===g(a).count?"Clear selection":"Select all")+` (${g(Tt)}+A)`,"data-label":"btn-select-all",onClick:f},[v(b,{icon:g(a).selectedCount===g(a).count?g(fo):g(po),size:"sm"},null,8,["icon"]),t.width>=o.selectAll?(x(),$("span",W5,q(g(a).selectedCount===g(a).count?"Deselect All":"Select All"),1)):N("",!0),t.width>=o.kbd?(x(),$("kbd",G5,q(g(Tt))+"+A ",1)):N("",!0)],8,q5),n("span",X5,q(g(a).selectedCount)+" of "+q(g(a).count)+" selected ",1),m[3]||(m[3]=n("div",{class:"flex-grow"},null,-1)),n("button",{class:"btn-ctrl h-7 px-2 text-red-400 enabled:hover:text-red-300",disabled:g(a).selectedCount===0,title:"Delete selected timers (Backspace)","data-label":"btn-bulk-delete",onClick:m[1]||(m[1]=c=>s("bulk-delete",i.value))},[v(b,{icon:g(en),size:"sm"},null,8,["icon"]),t.width>=o.labels?(x(),$("span",K5,"Delete")):N("",!0),t.width>=o.kbd?(x(),$("kbd",Z5,"â«")):N("",!0)],8,Y5),n("button",{class:"btn-ctrl h-7 px-2",disabled:g(a).selectedCount===0,title:`Duplicate selected timers (${g(Tt)}+D)`,"data-label":"btn-bulk-duplicate",onClick:m[2]||(m[2]=c=>s("bulk-clone",i.value))},[v(b,{icon:g(Pn),size:"sm"},null,8,["icon"]),t.width>=o.labels?(x(),$("span",J5,"Duplicate")):N("",!0),t.width>=o.kbd?(x(),$("kbd",e3,q(g(Tt))+"+D",1)):N("",!0)],8,Q5),v($t,{items:p.value,"button-class":"btn-ctrl h-7 px-2","button-label":"btn-bulk-move",dark:"",align:"right",teleport:""},{default:L(()=>[v(b,{icon:g(cd),size:"sm"},null,8,["icon"]),t.width>=o.labels?(x(),$("span",t3,"Move")):N("",!0)]),_:1},8,["items"]),v($t,{items:d.value,"button-class":"btn-ctrl h-7 px-2","button-label":"btn-bulk-more",dark:"",align:"right",teleport:""},{default:L(()=>[v(b,{icon:g(Kn),size:"sm"},null,8,["icon"]),t.width>=o.labels?(x(),$("span",n3,"More")):N("",!0)]),_:1},8,["items"])])}}},s3={class:"controller-subheader px-3"},o3={key:1,class:"flex items-center space-x-2 overflow-x-hidden"},a3={key:0,class:"ml-1"},i3={class:"relative"},r3={class:"text-neutral-300"},u3={class:"text-white"},d3={__name:"TimerSection",props:{width:{type:Number,default:void 0}},setup(e){const l=Fe(),s=wt(),t=e,a={compact:350,labels:500},o=F(),i=F(!1),r=F(null),p=F(!1),d=O(()=>[{icon:p.value?po:fo,label:"Follow active timer",click:()=>{p.value=!p.value},preventHide:!0}]),f=F(!1),u=F(null),m=E=>le(null,null,function*(){const _=E.timerIds;yield de(se.patch(`/rooms/${l.pid}/timers`,E),(P,A)=>le(null,null,function*(){s.setAll(P,A),yield dt(),s.exitSelectMode()}),()=>_==null?void 0:_.forEach(P=>s.loadingStart(P)),()=>_==null?void 0:_.forEach(P=>s.loadingResolve(P)))}),b=E=>m({trigger:_e.LINKED,timerIds:E}),c=E=>m({trigger:_e.MANUAL,timerIds:E}),w=E=>le(null,null,function*(){yield de(se.post(`/rooms/${l.pid}/timers/bulk-fix-times`,{timerIds:E}),(_,P)=>le(null,null,function*(){s.setAll(_,P),yield dt(),s.exitSelectMode()}),()=>E.forEach(_=>s.loadingStart(_)),()=>E.forEach(_=>s.loadingResolve(_)))}),h=E=>le(null,null,function*(){yield de(se.post(`/rooms/${l.pid}/timers/bulk-unset-start-times`,{timerIds:E}),(_,P)=>le(null,null,function*(){s.setAll(_,P),yield dt(),s.exitSelectMode()}),()=>E.forEach(_=>s.loadingStart(_)),()=>E.forEach(_=>s.loadingResolve(_)))}),y=E=>{u.value=E,f.value=!0},S=()=>le(null,null,function*(){const E=u.value;E&&(f.value=!1,yield de(se.delete(`/rooms/${l.pid}/timers/bulk`,{data:{timerIds:E}}),(_,P)=>le(null,null,function*(){s.setAll(_,P),yield dt(),s.exitSelectMode()}),()=>E.forEach(_=>s.loadingStart(_)),()=>E.forEach(_=>s.loadingResolve(_))),u.value=null)}),D=E=>le(null,null,function*(){yield de(se.post(`/rooms/${l.pid}/timers/bulk-clone`,{timerIds:E}),(_,P)=>le(null,null,function*(){s.setAll(_,P),yield dt(),s.exitSelectMode()}),()=>E.forEach(_=>s.loadingStart(_)),()=>E.forEach(_=>s.loadingResolve(_)))}),k=P=>le(null,[P],function*({timerIds:E,position:_}){yield de(se.patch(`/rooms/${l.pid}/timers/bulk-move`,{timerIds:E,position:_}),(A,z)=>le(null,null,function*(){s.setAll(A,z),yield dt(),s.exitSelectMode()}),()=>E.forEach(A=>s.loadingStart(A)),()=>E.forEach(A=>s.loadingResolve(A)))}),M=()=>le(null,null,function*(){return de(se.post(`/rooms/${l.pid}/timers/flash`),()=>{let E=0,_=setInterval(()=>{E++%2===0?i.value=!1:i.value=!0,E>6&&clearInterval(_)},300)},()=>r.value="flash",()=>r.value=null)}),I=()=>le(null,null,function*(){return de(se.patch(`/rooms/${l.pid}/settings`,{blackout:!l.blackout}),(E,_)=>l.updateSettings(E,_),()=>r.value="blackout",()=>r.value=null)}),R=()=>le(null,null,function*(){return de(se.patch(`/rooms/${l.pid}/settings`,{onAir:!l.onAir}),(E,_)=>l.updateSettings(E,_),()=>r.value="onAir",()=>r.value=null)});function T({activeEl:E,force:_}){var z;if(!p.value&&!_)return;const P=(z=o.value)==null?void 0:z.getBoundingClientRect(),A=E==null?void 0:E.getBoundingClientRect();P&&A&&(o.value.scrollTop+=(A==null?void 0:A.top)-(P==null?void 0:P.top)-40)}function C(E){switch(E){case Yr:return I();case Kr:return R();case Zr:return M()}}return De(()=>{ze.$on("shortcut",C)}),Qe(()=>{ze.$off("shortcut",C)}),(E,_)=>{const P=pe("FaIcon");return x(),$("section",null,[n("header",s3,[g(s).isSelectMode?(x(),Z(l3,{key:0,width:t.width,onBulkUpdate:m,onBulkDelete:y,onBulkClone
14:D,onBulkMove:k,onFixTimes:w,onUnsetStartTimes:h},null,8,["width"])):(x(),$("div",o3,[_[3]||(_[3]=n("h2",{class:"self-baseline"}," Timers ",-1)),n("button",{class:"self-baseline btn-ctrl bg-transparent border-transparent text-sm h-7 px-2 text-neutral-500",title:"Enter select mode","data-label":"btn-enter-select-mode",onClick:_[0]||(_[0]=A=>g(s).enterSelectMode())}," Select "),_[4]||(_[4]=n("div",{class:"flex-grow"},null,-1)),v(Fd,{class:j(["text-sm h-7",{"bg-animated from-neutral-800 to-neutral-700":r.value==="blackout"}]),title:"Toggle blackout",active:g(l).settings.blackout,disabled:r.value==="blackout",onClick:I},{default:L(()=>[t.width<a.compact?(x(),Z(P,{key:0,icon:g(bd),size:"xs"},null,8,["icon"])):(x(),$(ee,{key:1},[U(" Blackout ")],64))]),_:1},8,["class","active","disabled"]),v(Nn,{class:j(["btn-ctrl text-sm h-7 px-2",{"text-amber-400 ring-amber-400":i.value,"bg-animated from-neutral-800 to-neutral-700":r.value==="flash"}]),title:`Call the attention of the talent \r 15by flashing the time 3 times.`,disabled:r.value==="flash",onClick:M},{default:L(()=>[v(P,{icon:g(mo),class:j({glow:i.value}),"fixed-width":"",size:"xs"},null,8,["icon","class"]),t.width>=a.labels?(x(),$("span",a3,"Flash")):N("",!0)]),_:1},8,["class","disabled"]),v($t,{items:d.value,"button-class":"btn-ctrl text-sm h-7 px-2","button-label":"btn-timer-options",dark:"",align:"right","hide-caret":"",teleport:""},{default:L(()=>[v(P,{icon:g(Kn),size:"sm"},null,8,["icon"])]),_:1},8,["items"])]))]),n("div",{ref_key:"scrollContainerEl",ref:o,class:"controller-scroll styled-scrollbar px-3 pb-6 pt-1.5 -mt-1.5"},[n("div",i3,[v(V5,{onActiveItemEl:T,onBulkDelete:y,onBulkClone:D,onBulkLink:b,onBulkUnlink:c,onFixTimes:w,onUnsetStartTimes:h})])],512),v(Le,{open:f.value,"onUpdate:open":_[1]||(_[1]=A=>f.value=A),title:"Delete Timers",closable:"","width-class":"max-w-md","confirm-label":"Delete","confirm-class":"text-red-500 hover:bg-red-900 hover:!border-red-600",onConfirm:S,onHide:_[2]||(_[2]=A=>f.value=!1)},{default:L(()=>{var A,z;return[n("p",r3,[_[5]||(_[5]=U(" Are you sure you want to delete ",-1)),n("strong",u3,q((A=u.value)==null?void 0:A.length),1),U(" "+q(((z=u.value)==null?void 0:z.length)===1?"timer":"timers")+"? ",1)]),_[6]||(_[6]=n("p",{class:"text-neutral-500 text-sm mt-2"}," This action cannot be undone. ",-1))]}),_:1},8,["open"])])}}},c3={class:"table-ctrl w-full"},m3={class:"whitespace-nowrap"},p3={class:"text-xs text-neutral-500 mt-1"},f3={class:"link text-current",href:"/docs/timers/#timezones",target:"_blank"},b3={class:"text-neutral-500 font-mono"},v3={class:"font-mono"},g3={class:"table-ctrl w-full"},h3={class:"whitespace-nowrap"},x3={class:"whitespace-nowrap"},w3={class:"font-mono"},y3={class:"font-mono"},k3={class:"table-ctrl w-full"},$3={class:"font-mono text-red-400"},S3={__name:"SettingsModal",props:{open:Boolean,disabled:Boolean},emits:["update:open"],setup(e,{emit:l}){const s=Fe(),t=kn(),a=F(!1),o=F(null),i=F(null),r=F({timezone:null,todFormat:ce.AUTO,countdownFormat:J.MMMSS,behavior:Ge.CONTINUE,overtimePrefix:Xt.PLUS}),p=l,d=e;De(()=>{i.value=oo()||"UTC",r.value=Q({},s.settings)});const f=Pt({hours:1,minutes:5,seconds:30})+600,u=O(()=>{const k={timezone:r.value.timezone,todFormat:r.value.todFormat};return nt(new Date(t.now),k)}),m=O(()=>Ao(f,r.value.countdownFormat,r.value.overtimePrefix)),b=O(()=>{const k=r.value.behavior===Ge.CONTINUE?(Pt({hours:0,minutes:5,seconds:30})+600)*-1:0;return Ao(k,r.value.countdownFormat,r.value.overtimePrefix)});function c(){r.value=Q({},s.settings)}function w(k){return le(this,null,function*(){k.preventDefault(),o.value=null,yield de(se.patch(`/rooms/${s.pid}/settings`,r.value),(M,I)=>{s.updateSettings(M,I),p("update:open",!1)},()=>a.value=!0,()=>a.value=!1,M=>o.value=M)})}const h=[ce.AUTO,ce.AUTO_HHMM,ce.HHMMSS,ce.HHMM,ce.HHMMSS_AM,ce.HHMM_AM,ce.HHMMSS_12H,ce.HHMM_12H].map(k=>({value:k,label:nn[k]})),y=[...[J.DHHMMSS,J.DHHMMSSF,J.HHHMMSS,J.HHHMMSSF,J.MMMSS,J.MMMSSF,J.SSS,J.SSSF].map(k=>({value:k,label:yt[k]})),{value:"divider",label:"---",disabled:!0},...[J.L_D,J.L_DH,J.L_DHM,J.L_DHMS,J.L_HMS,J.L_MS,J.L_S].map(k=>({value:k,label:yt[k]}))],S=[{value:Ge.CONTINUE,label:Zt[Ge.CONTINUE]},{value:Ge.STOP,label:Zt[Ge.STOP]},{value:Ge.HIDE,label:Zt[Ge.HIDE]}],D=[{value:Xt.PLUS,label:Ga[Xt.PLUS]},{value:Xt.MINUS,label:Ga[Xt.MINUS]}];return(k,M)=>{const I=pe("FaIcon");return x(),Z(Le,{open:d.open,busy:a.value,icon:g(Vl),title:"Room Settings","body-class":"space-y-4 font-light pb-7","width-class":"max-w-xl",closable:"","onUpdate:open":M[6]||(M[6]=R=>p("update:open",R)),onShow:c,onConfirm:w},{default:L(()=>[M[19]||(M[19]=n("div",{class:"flex items-center gap-4 text-neutral-600"},[n("div",{class:"flex-none w-24 border-b-2 border-current"}),n("h3",{class:"flex-none text-sm font-semibold"}," Timezone Settings "),n("div",{class:"flex-1 border-b-2 border-current"})],-1)),n("table",c3,[n("tbody",null,[n("tr",null,[n("th",m3,[v(Y,{tooltip:"Set the timezone for all time displays in this room. This affects how times are shown to viewers and when scheduled timers start."},{default:L(()=>[...M[7]||(M[7]=[U(" Timezone ",-1)])]),_:1})]),n("td",null,[v(Zn,{modelValue:r.value.timezone,"onUpdate:modelValue":M[0]||(M[0]=R=>r.value.timezone=R),"data-label":"setting-timezone",class:"h-9 w-full",disabled:d.disabled,dark:""},null,8,["modelValue","disabled"]),n("p",p3,[M[9]||(M[9]=U(" Read more about ",-1)),n("a",f3,[M[8]||(M[8]=U(" timezones in Stagetimer ",-1)),v(I,{icon:g(kt),size:"xs"}
15,null,8,["icon"])])])])]),n("tr",null,[M[10]||(M[10]=n("th",null," Browser ",-1)),n("td",b3,[n("strong",null,q(g(nt)(new Date(g(t).now),{timezone:i.value,todFormat:r.value.todFormat})),1),U(" ("+q(g(rt)(i.value,"abbr"))+" "+q(g(rt)(i.value,"offset"))+") ",1)])]),n("tr",null,[M[11]||(M[11]=n("th",null," Preview ",-1)),n("td",v3,[n("strong",null,q(u.value),1),U(" ("+q(g(rt)(r.value.timezone,"abbr"))+" "+q(g(rt)(r.value.timezone,"offset"))+") ",1)])])])]),M[20]||(M[20]=n("div",{class:"flex items-center gap-4 text-neutral-600"},[n("div",{class:"flex-none w-24 border-b-2 border-current"}),n("h3",{class:"flex-none text-sm font-semibold"}," Time Formatting "),n("div",{class:"flex-1 border-b-2 border-current"})],-1)),n("table",g3,[n("tbody",null,[n("tr",null,[n("th",h3,[v(Y,{tooltip:"Choose how the time of day is displayed (12-hour vs 24-hour format, with or without seconds)."},{default:L(()=>[...M[12]||(M[12]=[U(" Time of Day ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:r.value.todFormat,"onUpdate:modelValue":M[1]||(M[1]=R=>r.value.todFormat=R),"data-label":"setting-tod-format","select-class":"h-9 w-full",size:"sm",width:"100%",disabled:d.disabled,options:g(h)},null,8,["modelValue","disabled","options"])])]),n("tr",null,[n("th",x3,[v(Y,{tooltip:"Choose how the countdown/count-up time is displayed (with days, hours, minutes, seconds, and decimal precision)."},{default:L(()=>[...M[13]||(M[13]=[U(" Countdown ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:r.value.countdownFormat,"onUpdate:modelValue":M[2]||(M[2]=R=>r.value.countdownFormat=R),"data-label":"setting-countdown-format","select-class":"h-9 w-full",size:"sm",width:"100%",disabled:d.disabled,options:y},null,8,["modelValue","disabled"])])]),n("tr",null,[M[15]||(M[15]=n("th",null," Preview ",-1)),n("td",null,[n("strong",w3,q(u.value),1),M[14]||(M[14]=U(" â ",-1)),n("strong",y3,q(m.value),1)])])])]),M[21]||(M[21]=n("div",{class:"flex items-center gap-4 text-neutral-600"},[n("div",{class:"flex-none w-24 border-b-2 border-current"}),n("h3",{class:"flex-none text-sm font-semibold"}," Overtime Settings "),n("div",{class:"flex-1 border-b-2 border-current"})],-1)),n("table",k3,[n("tbody",null,[n("tr",null,[n("th",null,[v(Y,{tooltip:"Choose what happens when a timer reaches 0:00. Continue counting shows overtime, while Stop freezes the timer at 0:00."},{default:L(()=>[...M[16]||(M[16]=[U(" Behavior ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:r.value.behavior,"onUpdate:modelValue":M[3]||(M[3]=R=>r.value.behavior=R),"data-label":"setting-timer-behavior","select-class":"h-9 w-full",size:"sm",width:"100%",disabled:d.disabled,options:S},null,8,["modelValue","disabled"])])]),n("tr",null,[n("th",null,[v(Y,{tooltip:"Choose whether overtime is displayed with a plus (+) or minus (-) sign. This only applies when behavior is set to continue counting."},{default:L(()=>[...M[17]||(M[17]=[U(" Prefix ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:r.value.overtimePrefix,"onUpdate:modelValue":M[4]||(M[4]=R=>r.value.overtimePrefix=R),"data-label":"setting-timer-prefix","select-class":"h-9 w-full",size:"sm",width:"100%",disabled:d.disabled,options:D},null,8,["modelValue","disabled"])])]),n("tr",null,[M[18]||(M[18]=n("th",null," Preview ",-1)),n("td",null,[n("strong",$3,q(b.value),1)])])])]),o.value?(x(),Z(_t,{key:0,error:o.value,onClear:M[5]||(M[5]=R=>o.value=null)},null,8,["error"])):N("",!0)]),_:1},8,["open","busy","icon"])}}},C3=Oe(S3,[["__scopeId","data-v-1f689339"]]),M3={key:0,class:"drag-handle absolute top-1 mt-0.5 left-1 opacity-0 group-hover:opacity-100 transition-opacity z-20"},T3=["data-label"],z3={class:"text-xs py-1 truncate whitespace-nowrap font-semibold"},I3={key:1,class:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity z-20"},O3=["onKeydown"],Os={__name:"OutputModalTab",props:{name:{type:String,required:!0},output:{type:Object,default:null},thumbnail:{type:String,default:null},disabledOptions:{type:Array,default:()=>[]},selected:Boolean,loading:Boolean,hideMenu:Boolean,hideDragHandle:Boolean,isDragging:Boolean},emits:["click","update:name","delete","duplicate","dropdown-open","dropdown-close"],setup(e,{emit:l}){const s=l,t=e,a=F(!1),o=F(""),i=F(!1),r=F(null);function p(){r.value&&r.value.open()}function d(){s("dropdown-open",r.value)}function f(){s("dropdown-close",r.value)}return(u,m)=>{const b=pe("FaIcon");return x(),$(ee,null,[n("div",{class:"relative z-30 group w-32",onContextmenu:Be(p,["prevent"])},[t.hideDragHandle?N("",!0):(x(),$("div",M3,[n("div",{class:j(["btn-ctrl p-0 w-6 h-6 text-xs cursor-grab active:cursor-grabbing flex items-center justify-center leading-none",{"cursor-grabbing":t.isDragging}])},[n("span",null,[v(b,{icon:g(vd),size:"sm"},null,8,["icon"])])],2)])),n("button",Rt(u.$attrs,{"data-label":`btn-tab-${g(Hs)(t.name)}`,class:["relative block w-full rounded-t-lg border !border-b-0 px-2 pt-2 transition-colors",{"border-b-0 bg-neutral-800 border-neutral-700 z-10":t.selected,"group-hover:bg-neutral-800 border-transparent group-hover:border-neutral-700":!t.selected}],onClick:m[0]||(m[0]=c=>s("click"))}),[v(ho,{output:e.output,thumbnail:e.thumbnail,loading:e.loading},null,8,["output","thumbnail","loading"]),n("p",z3,q(t.name),1),m[7]||(m[7]=n("div",{class:"absolute z-10 top-full -left-1 -right-1 -bottom-1 bg-neutral-800"},null,-1))],16,T3),t.hideMenu?N("",!0):(x(),$("div",I3,[v($t,{ref_key:"dropdownMenuRef",ref:r,items:[{icon:g(No),label:"Rename",click:()=>a.value=!0,disabled:t.disabledOptions.includes("rename")},{icon:g(Bn),label:"Duplicate",click:()=>s("duplicate"),disabled:t.disabledOptions.includes("duplicate")},{icon:g(en),label:"Delete",click:()=>i.value=!0,disabled:t.disabledOptions.includes("delete")}],"button-label":"output-context-menu","button-class":"btn-ctrl p-0 w-6 h-6 text-xs",teleport:"",dark:"","hide-caret":"","not-focusable":"",onOpen:d,onClose:f},{default:L(()=>[v(b,{icon:g(Kn)},null,8,["icon"])]),_:1},8,["items"])]))],32),t.hideMenu?N("",!0):(x(),Z(Le,{key:0,open:a.value,"onUpdate:open":m[2]||(m[2]=c=>a.value=c),title:"Rename Output","data-label":"modal-rename-output",icon:g(No),closable:"",onShow:m[3]||(m[3]=c=>o.value=t.name),onConfirm:m[4]||(m[4]=c=>s("update:name",o.value))},{default:L(({confirm:c,cancel:w})=>[me(n("input",{"onUpdate:modelValue":m[1]||(m[1]=h=>o.value=h),type:"text",class:"input-ctrl h-9 w-full",placeholder:"Enter output name",onKeydown:[Re(c,["enter"]),Re(w,["escape"])]},null,40,O3),[[ft,o.value]])]),_:1},8,["open","icon"])),t.hideMenu?N("",!0):(x(),Z(Le,{key:1,open:i.value,"onUpdate:open":m[5]||(m[5]=c=>i.value=c),title:"Delete Output","data-label":"modal-delete-output",icon:g(en),"confirm-label":"Delete Output","confirm-class":"text-red-500 hover:bg-red-900 hover:!border-red-600",closable:"",onConfirm:m[6]||(m[6]=c=>s("delete"))},{default:L(()=>[m[8]||(m[8]=U(" Delete ",-1)),n("strong",null,'"'+q(t.name)+'"',1),m[9]||(m[9]=U("? All links created from this output will no longer work. This action cannot be undone. ",-1))]),_:1},8,["open","icon"]))],64)}}},D3={class:"table-ctrl"},E3={key:0},U3={class:"whitespace-nowrap"},L3={class:"relative"},R3=["disabled","onClick"],A3={key:0,class:"absolute right-2 top-1/2 -translate-y-1/2 text-green-500","aria-live":"polite"},_3={key:1},F3={key:2},B3={class:"whitespace-nowrap"},P3=["disabled"],N3={key:0,class:"absolute rounded bg-neutral-900/80 px-1.5 top-1/2 right-1 -translate-y-1/2 text-green-500","aria-live":"polite"},H3={__name:"OutputModalOutputOptions",props:{enabledOptions:{type:Array,default:()=>[]},password:{type:String,default:""},logo:{type:Object,default:()=>({mode:"stagetimer",url:""})},outputId:{type:String,default:""},loading:{type:[Boolean,String],default:!1}},emits:["update:password","update:logo"],setup(e,{emit:l}){const s=Fe(),t=F(""),a=F("stagetimer"),o=F(""),i=F(!1),r=ht(new Set),p=O(()=>st(s.plan,ot.CUSTOM_LOGO)),d=O(()=>st(s.plan,ot.LICENSED)),f=[{value:"stagetimer",label:"Stagetimer"},{value:"hidden",label:"Hidden"},{value:"custom",label:"Custom"}],u=l,m=e;Te(()=>m.password,y=>t.value=y,{immediate:!0}),Te(()=>m.logo,y=>{a.value=(y==null?void 0:y.mode)||"stagetimer",o.value=(y==null?void 0:y.url)||""},{immediate:!0,deep:!0}),Te(()=>m.loading,(y,S)=>{y||(r.add(S),setTimeout(()=>r.delete(S),3e3))});const b=Xi((y,S)=>{u(`update:${y}`,S)},1200),c=()=>b.flush();function w(y){a.value=y,u("update:logo",{mode:y,url:o.value})}function h(y){o.value=y||"",u("update:logo",{mode:a.value,url:y||""})}return(y,S)=>{const D=pe("FaIcon");return x(),$("table",D3,[n("tbody",null,[m.enabledOptions.includes("logo")?(x(),$("tr",E3,[n("th",U3,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:"
15Choose which logo appears on this output. Show the Stagetimer logo, hide it completely, or upload your own custom logo."},{default:L(()=>[...S[4]||(S[4]=[U(" Logo ",-1)])]),_:1})]),n("td",L3,[n("div",{class:j(["flex input-ctrl p-0 h-7 text-xs",{"bg-animated from-neutral-900 to-white/5":e.loading==="logo","opacity-50":!p.value}])},[(x(),$(ee,null,ge(f,k=>n("button",{key:k.value,type:"button",class:j(["flex-1 border first:rounded-l last:rounded-r transition-colors",{"border-neutral-400":a.value===k.value,"border-transparent hover:bg-neutral-700":a.value!==k.value,"pointer-events-none":!p.value||e.loading==="logo"}]),disabled:!p.value||e.loading==="logo",onClick:M=>w(k.value)},q(k.label),11,R3)),64))],2),r.has("logo")&&e.loading!=="logo"?(x(),$("div",A3,[v(D,{icon:g(At),size:"xs"},null,8,["icon"]),S[5]||(S[5]=n("span",{class:"sr-only"},"Logo saved",-1))])):N("",!0)])])):N("",!0),m.enabledOptions.includes("logo")&&a.value==="custom"?(x(),$("tr",_3,[S[6]||(S[6]=n("th",null,null,-1)),n("td",null,[v(on,{img:o.value,"file-formats":["PNG","SVG","JPG"],"post-url":`/files/for-output/${m.outputId}`,"base-path":"logo",smallprint:"180Ã80px recommended",disabled:!p.value||e.loading==="logo","onUpdate:img":h},null,8,["img","post-url","disabled"])])])):N("",!0),m.enabledOptions.includes("password")?(x(),$("tr",F3,[n("th",B3,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:"Password protect this output. All visitors will need to enter this password to access the page. Leave empty for public access."},{default:L(()=>[...S[7]||(S[7]=[U(" Password ",-1)])]),_:1})]),n("td",null,[n("div",{class:j(["relative input-ctrl h-7 w-full p-0",{"bg-animated from-neutral-900 to-white/5":e.loading==="password","opacity-50":!d.value}])},[me(n("input",{"onUpdate:modelValue":S[0]||(S[0]=k=>t.value=k),type:"text",class:j(["text-xs h-7 w-full placeholder-neutral-600 rounded bg-transparent border-0 px-4 py-0",[{"pointer-events-none":e.loading==="password"||!d.value},{"password-mask":!i.value}]]),placeholder:"Enter password...",disabled:e.loading==="password"||!d.value,name:"output-password",autocomplete:"off","data-1p-ignore":"","data-lpignore":"true","data-bwignore":"true",onInput:S[1]||(S[1]=k=>g(b)("password",k.target.value)),onFocus:S[2]||(S[2]=k=>i.value=!0),onBlur:S[3]||(S[3]=k=>{i.value=!1,c()}),onKeyup:Re(c,["enter"])},null,42,P3),[[ft,t.value]]),r.has("password")&&e.loading!=="password"?(x(),$("div",N3,[v(D,{icon:g(At),size:"xs"},null,8,["icon"]),S[8]||(S[8]=n("span",{class:"sr-only"},"Password saved",-1))])):N("",!0)],2)])])):N("",!0)])])}}},V3=Oe(H3,[["__scopeId","data-v-77c66757"]]);var Ds,mi;function j3(){if(mi)return Ds;mi=1;var e=gd(),l=hd(),s=yd(),t=Ci(),a=xd(),o=wd(),i=Math.min;function r(p,d,f){for(var u=f?s:l,m=p[0].length,b=p.length,c=b,w=Array(b),h=1/0,y=[];c--;){var S=p[c];c&&d&&(S=t(S,a(d))),h=i(S.length,h),w[c]=!f&&(d||m>=120&&S.length>=120)?new e(c&&S):void 0}S=p[0];var D=-1,k=w[0];e:for(;++D<m&&y.length<h;){var M=S[D],I=d?d(M):M;if(M=f||M!==0?M:0,!(k?o(k,I):u(y,I,f))){for(c=b;--c;){var R=w[c];if(!(R?o(R,I):u(p[c],I,f)))continue e}k&&k.push(I),y.push(M)}}return y}return Ds=r,Ds}var Es,pi;function q3(){if(pi)return Es;pi=1;var e=kd();function l(s){return e(s)?s:[]}return Es=l,Es}var Us,fi;function W3(){if(fi)return Us;fi=1;var e=Ci(),l=j3(),s=$d(),t=q3(),a=s(function(o){var i=e(o,t);return i.length&&i[0]===o[0]?l(i):[]});return Us=a,Us}var G3=W3();const X3=ln(G3),Y3={class:"table-ctrl"},K3={key:0},Z3={class:"whitespace-nowrap"},Q3=["value"],J3={key:1},e8={class:"whitespace-nowrap"},t8={key:2},n8={class:"whitespace-nowrap"},l8={class:"flex gap-0.5"},s8={key:3},o8={class:"whitespace-nowrap"},a8={key:4},i8={class:"whitespace-nowrap"},r8={__name:"OutputModalLinkOptions",props:{outputId:{type:String,required:!0},output:{type:Object,default:null},enabledOptions:{type:Array,default:()=>[]},defaultTimezone:{type:String,default:null}},emits:["update"],setup(e,{emit:l}){const s=[be.TRANSPORT_CONTROL],t={v:"2",identifier:"",mirror:void 0,hideControls:!1,isolate:void 0,layout:"",notes:!1,delay:0,background:"",tz:null},a=l,o=e,i=ht(Q({},t)),r=O(()=>{var u;if(!((u=o.output)!=null&&u.elements))return!1;const f=o.output.elements.map(m=>m.type);return X3(f,s).length>0});Te(r,f=>{f&&i.delay>0&&(i.delay=0)}),Te(i,f=>a("update",f),{immediate:!0}),Te(()=>o.outputId,()=>Object.assign(i,t));const p=Xi((f,u)=>{i[f]=u},600),d=()=>p.flush();return(f,u)=>(x(),$("table",Y3,[n("tbody",null,[o.enabledOptions.includes("identifier")?(x(),$("tr",K3,[n("th",Z3,[v(Y,{tooltip:"Set a custom device name (in addition to the output name) that will appear in your Live Connections list when this link is used."},{default:L(()=>[...u[6]||(u[6]=[U(" Identifier ",-1)])]),_:1})]),n("td",null,[n("input",{value:i.identifier,type:"text",class:"input-ctrl text-xs h-7 w-full",placeholder:"Enter device name (optional)",onInput:u[0]||(u[0]=m=>g(p)("identifier",m.target.value)),onBlur:d,onKeyup:u[1]||(u[1]=Re(m=>m.target.blur(),["enter"]))},null,40,Q3)])])):N("",!0),o.enabledOptions.includes("mirror")?(x(),$("tr",J3,[n("th",e8,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:"Flip the display orientation. Useful for teleprompter mirrors or unique staging setups"},{default:L(()=>[...u[7]||(u[7]=[U(" Mirror ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:i.mirror,"onUpdate:modelValue":u[2]||(u[2]=m=>i.mirror=m),"select-class":"h-7 w-full",size:"xs",width:"100%",options:[{value:void 0,label:"Not mirrored"},{value:"vertical",label:"Vertical"},{value:"horizontal",label:"Horizontal"},{value:"vertical,horizontal",label:"Vertical + Horizontal"}]},null,8,["modelValue"])])])):N("",!0),o.enabledOptions.includes("delay")?(x(),$("tr",t8,[n("th",n8,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:r.value?"Delay is not available with interactive elements":"Add a time delay (in seconds) for this specific view. Useful for broadcast delays."},{default:L(()=>[...u[8]||(u[8]=[U(" Delay ",-1)])]),_:1},8,["tooltip"])]),n("td",null,[n("div",l8,[v(Rn,{value:i.delay,"onUpdate:value":u[3]||(u[3]=m=>
15i.delay=m),min:0,class:"grow input-ctrl rounded-r-none text-xs h-7",disabled:r.value},null,8,["value","disabled"]),u[9]||(u[9]=n("div",{class:"bg-neutral-900 rounded-r text-xs text-neutral-600 h-7 leading-7 px-2"}," Seconds ",-1))])])])):N("",!0),o.enabledOptions.includes("hideControls")?(x(),$("tr",s8,[n("th",o8,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:"Override the room's timezone for this specific output link."},{default:L(()=>[...u[10]||(u[10]=[U(" Timezone ",-1)])]),_:1})]),n("td",null,[v(Zn,{modelValue:i.tz,"onUpdate:modelValue":u[4]||(u[4]=m=>i.tz=m),class:"h-7 w-full text-xs border-0 rounded",disabled:o.disabled,"room-default":o.defaultTimezone,dark:""},null,8,["modelValue","disabled","room-default"])])])):N("",!0),o.enabledOptions.includes("hideControls")?(x(),$("tr",a8,[n("th",i8,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:"Remove the interactive controls overlay that appears when moving the mouse. Perfect for audience-facing displays."},{default:L(()=>[...u[11]||(u[11]=[U(" Hide ",-1)])]),_:1})]),n("td",null,[v(Ne,{modelValue:i.hideControls,"onUpdate:modelValue":u[5]||(u[5]=m=>i.hideControls=m),class:"text-xs",disabled:!!i.isolate},{default:L(()=>[...u[12]||(u[12]=[U(" Hide controls overlay ",-1)])]),_:1},8,["modelValue","disabled"])])])):N("",!0)])]))}},u8=Oe(r8,[["__scopeId","data-v-f38c3673"]]),d8={key:0,class:"flex items-center pl-2 text-xs text-neutral-500 flex-shrink-0"},c8=["value","size","disabled"],m8=["disabled"],bi={__name:"InputCopy",props:{modelValue:{type:String,default:""},loading:Boolean},setup(e){const l=e,s=O(()=>l.loading?"Loading ...":l.modelValue),t=F(!1);function a(){Il(l.modelValue),t.value=!0,setTimeout(()=>t.value=!1,2e3)}return(o,i)=>{const r=pe("FaIcon");return x(),$("div",{class:j(["flex input-ctrl p-0 overflow-hidden has-[:focus]:ring-2",{"bg-animated from-neutral-900 to-white/5":e.loading}])},[o.$slots.badge?(x(),$("div",d8,[Ke(o.$slots,"badge")])):N("",!0),n("input",{class:j(["block flex-1 min-w-0 text-xs font-mono rounded bg-transparent border-0 h-full pl-2 pr-0 text-blue-300 focus:ring-0",{"pointer-events-none":e.loading}]),value:s.value,size:s.value.length||1,readonly:"",disabled:e.loading,onClick:i[0]||(i[0]=p=>p.target.select())},null,10,c8),n("button",{class:j(["shrink-0 px-2 text-right text-xs font-semibold transition-colors focus:ring-0 focus:text-white",t.value?"text-green-500":"text-neutral-500 hover:text-white"]),disabled:e.loading||!e.modelValue,onClick:a},[v(r,{size:"sm",icon:t.value?g(At):g(Pn),"fixed-width":""},null,8,["icon"]),U(" "+q(t.value?"Copied":"Copy"),1)],10,m8)],2)}}},p8={class:"space-y-2"},f8={class:"text-xs text-neutral-400"},b8={key:0,class:"text-neutral-500"},v8={class:"flex space-x-2"},g8={key:0,class:"flex-grow input-ctrl !border-0 h-8 py-0 px-2 text-xs font-mono text-neutral-500 w-full flex items-center"},h8={key:1,class:"flex-grow input-ctrl !border-0 h-8 py-0 px-2 text-xs font-mono text-red-400 w-full flex items-center"},x8=["value","placeholder"],w8={class:"space-y-2"},y8={key:0,class:"text-xs text-neutral-400"},k8={class:"flex space-x-2"},$8=["value"],S8={class:"text-center"},au={__name:"QrModal",props:{url:{type:String,required:!0},label:{type:String,default:"Viewer"},roomName:{type:String,default:"unnamed"},open:Boolean,shortlink:{type:Object,default:null},shortlinkLoading:{type:Boolean,default:!1},shortlinkError:{type:Boolean,default:!1}},emits:["update:open"],setup(e,{emit:l}){const s=F(),t=l,a=e,o=O(()=>{var p;return((p=a.shortlink)==null?void 0:p.shortUrl)||a.url}),i=O(()=>{var p;return(p=a.shortlink)!=null&&p.expiresAt?jt(new Date(a.shortlink.expiresAt),"PPP"):null});function r(){const p=s.value.firstElementChild,d=document.createElement("a");d.download=`${Hs(a.roomName)}-${Hs(a.label)}.png`,d.href=p.toDataURL("image/png"),d.click()}return(p,d)=>{const f=pe("FaIcon");return x(),Z(Le,{"body-class":"space-y-4",open:a.open,title:`${a.label} Link`,icon:g(bo),closable:"","hide-footer":"","onUpdate:open":d[4]||(d[4]=u=>t("update:open",u))},{default:L(()=>{var u,m;return[Ke(p.$slots,"default"),n("div",p8,[n("div",f8,[d[5]||(d[5]=U(" Short Link ",-1)),i.value?(x(),$("span",b8," (expires "+q(i.value)+")",1)):N("",!0)]),n("div",v8,[a.shortlinkLoading?(x(),$("div",g8,[v(f,{icon:g(Sd),spin:"",size:"sm",class:"mr-2"},null,8,["icon"]),d[6]||(d[6]=U(" Generating... ",-1))])):a.shortlinkError?(x(),$("div",h8,[v(f,{icon:g(Hl),size:"sm",class:"mr-2"},null,8,["icon"]),d[7]||(d[7]=U(" Failed to generate short link ",-1))])):(x(),$("input",{key:2,class:"flex-grow input-ctrl !border-0 h-8 py-0 px-2 text-xs font-mono text-blue-300 w-full",value:(m=(u=a.shortlink)==null?void 0:u.shortUrl)!=null?m:"",placeholder:a.shortlink?"":"Generating...","data-label":"qr-shortlink-input",readonly:"",onClick:d[0]||(d[0]=b=>b.target.select())},null,8,x8)),v(Nn,{class:"flex-none btn-ctrl hover:border-neutral-400 h-8 w-8 p-0",title:"Click to copy short link",disabled:a.shortlinkLoading||a.shortlinkError,onClick:d[1]||(d[1]=b=>{var c;return g(Il)((c=a.shortlink)==null?void 0:c.shortUrl)})},{default:L(()=>[v(f,{size:"sm",icon:g(Pn),"fixed-width":""},null,8,["icon"])]),_:1},8,["disabled"])])]),n("div",w8,[a.shortlink||a.shortlinkLoading||a.shortlinkError?(x(),$("div",y8," Full Link ")):N("",!0),n("div",k8,[n("input",{class:"flex-grow input-ctrl !border-0 h-8 py-0 px-2 text-xs font-mono text-blue-300 w-full",value:a.url,"data-label":"qr-url-input",readonly:"",onClick:d[2]||(d[2]=b=>b.target.select())},null,8,$8),v(Nn,{class:"flex-none btn-ctrl hover:border-neutral-400 h-8 w-8 p-0",title:"Click to copy full link",onClick:d[3]||(d[3]=b=>g(Il)(a.url))},{default:L(()=>[v(f,{size:"sm",icon:g(Pn),"fixed-width":""},null,8,["icon"])]),_:1})])]),n("div",{ref_key:"qrCanvasParent",ref:s,class:"max-w-[260px] mx-auto overflow-hidden"},[v(g(lc),{ref:"qrcanvas",class:"rounded qrcanvas",value:o.value,size:600,margin:3,level:"L"},null,8,["value"])],512),n("div",S8,[n("button",{class:"btn-ctrl",onClick:r},[v(f,{icon:g(_i),size:"xs"},null,8,["icon"]),d[8]||(d[8]=U(" Download ",-1))])])]}),_:3},8,["open","title","icon"])}}},C8={class:"space-y-1"},M8={class:"flex items-center gap-4"},T8={key:1,class:"text-xs text-neutral-500"},z8=["disabled"],I8=["href"],O8={__name:"OutputModalLink",props:{outputId:{type:String,required:!0},roomPid:{type:String,required:!0},params:{type:Object,default:()=>({})},output:{type:String,default:"Viewer"},roomName:{type:String,default:"Unnamed"}},setup(e){const l=F(!1),s=F(""),t=F(!1),a=F(null),o=F(!1),i=F(!1),r=e,p=F(""),d=F(!1);let f=null;Te(()=>r.outputId,()=>{s.value="",p.value="",b(),w()}),Te(()=>r.params,b,{deep:!0}),De(()=>{var y,S,D;b(),w(),d.value=!!((y=window.api)!=null&&y.ndi),(D=(S=window.api)==null?void 0:S.ndi)!=null&&D.onStatus&&(f=window.api.ndi.onStatus(()=>w()))}),Qe(()=>{f==null||f()});function u(y,S){const D=Bs(y);return typeof S=="boolean"?[D,S?"1":"0"]:[D,S]}let m=null;function b(){return le(this,null,function*(){var D;(D=m==null?void 0:m.cancel)==null||D.call(m);const y=c(r.outputId);for(const k in r.params)r.params[k]&&y.searchParams.set(...u(k,r.params[k]));let S=[`/outputs/${r.outputId}/signature`];r.outputId==="CONTROLLER"&&(S=[`/rooms/${r.roomPid}/signature`,As.CONTROLLER]),r.outputId==="OPERATOR"&&(S=[`/rooms/${r.roomPid}/signature`,As.OPERATOR]),m=de(se.get(S[0],{params:{view:S[1],str:y.pathname+y.search}}),k=>{k?y.searchParams.set("signature",k):y.searchParams.delete("v"),s.value=y.toString()},()=>t.value=!0,()=>t.value=!1),yield m})}function c(y){return y==="CONTROLLER"?new URL(window.location.pathname,window.location.origin):y==="OPERATOR"?new URL(window.location.pathname.replace("controller","operator"),window.location.origin):new URL(`output/${y}/`,window.location.origin)}function w(){return le(this,null,function*(){var y;if((y=window.api)!=null&&y.ndi)try{const D=(yield window.api.ndi.getStatus()).senders.find(k=>k.outputId===r.outputId);D&&(p.value=D.sourceName)}catch(S){}})}function h(){return le(this,null,function*(){a.value=null,o.value=!0,i.value=!1,l.value=!0;const S=r.outputId==="CONTROLLER"||r.outputId==="OPERATOR"?`/rooms/${r.roomPid}/shortlink/${r.outputId}`:`/outputs/${r.outputId}/shortlink`;try{const D=yield se.post(S,{fullUrl:s.value});a.value=D.data}catch(D){console.error("Failed to generate short link:",D),a.value=null,i.value=!0}finally{o.value=!1}})}return(y,S)=>{const D=pe("FaIcon");return x(),$("div",C8,[v(bi,{class:"h-7","model-value":s.value,loading:t.value,"data-label":"input-page-url"},{badge:L(()=>[v(D,{icon:g(Xn),size:"xs"},null,8,["icon"])]),_:1},8,["model-value","loading"]),n("div",M8,[p.value?(x(),Z(bi,{key:0,class:"h-7","model-value":p.value},{badge:L(()=>[...S[1]||(S[1]=[n("span",{class:"font-semibold"},"NDI",-1)])]),_:1},8,["model-value"])):d.value?(x(),$("span",T8," NDI is not available for this view ")):N("",!0),S[5]||(S[5]=n("span",{class:"grow"},null,-1)),n("button",{class:"shrink-0 text-xs font-semibold text-neutral-500 hover:text-white transition-colors rounded h-7 px-1",title:"Display Short Link & QR Code","data-label":"btn-show-qr-code",disabled:t.value,onClick:h},[v(D,{size:"sm",icon:g(bo),"fixed-width":""},null,8,["icon"]),S[2]||(S[2]=n("span",{class:"sm:hidden"},"Â QR Code",-1)),S[3]||(S[3]=n("span",{class:"hidden sm:inline"},"Â Short Link & QR",-1))],8,z8),n("a",Rt({href:s.value,target:"_blank",title:"Open link in a new tab",class:["shrink-0 text-xs font-semibold text-neutral-500 hover:text-white transition-colors rounded h-7 leading-7 px-1",{"pointer-events-none":t.value}],"data-label":"btn-open-in-new-tab"},t.value?{disabled:!0}:{}),[v(D,{size:"sm",icon:g(kt),"fixed-width":""},null,8,["icon"]),S[4]||(S[4]=U(" Open Link ",-1))],16,I8)]),v(au,{open:l.value,"onUpdate:open":S[0]||(S[0]=k=>
15l.value=k),url:s.value,label:r.output,"room-name":r.roomName,shortlink:a.value,"shortlink-loading":o.value,"shortlink-error":i.value},null,8,["open","url","label","room-name","shortlink","shortlink-loading","shortlink-error"])])}}},D8={key:0,class:"text-center space-y-6 py-4"},E8={class:"flex justify-center"},U8={class:"space-y-2"},L8={class:"text-neutral-400"},R8={key:1,class:"space-y-6"},A8=["disabled"],_8={value:null},F8=["value"],B8={key:0},P8={key:0,class:"flex justify-center py-8"},N8={key:1,class:"text-center py-8 text-neutral-500"},H8={key:2,class:"max-h-[28rem] overflow-y-auto styled-scrollbar pr-2"},V8={class:"grid grid-cols-3 gap-3"},j8=["onClick"],q8={class:"text-xs py-1 truncate whitespace-nowrap font-semibold mt-1"},W8={key:1,class:"flex justify-end pt-2"},G8=["disabled"],X8={__name:"CopyOutputModal",props:{open:Boolean,plan:{type:Object,default:null},currentRoomId:{type:String,required:!0},teamId:{type:String,required:!0}},emits:["update:open","copy-success"],setup(e,{emit:l}){const s=l,t=e,a=F([]),o=F([]),i=F(null),r=F(null),p=F(!1),d=F(!1),f=F(!1),u=F(null),m=F(!1),b=F(null),c=O(()=>[...a.value].sort((k,M)=>{const I=new Date(k.updatedAt||0);return new Date(M.updatedAt||0)-I}));function w(k){return k?Ri(k):""}function h(){return le(this,null,function*(){d.value=!0,u.value=null,yield de(se.get(`/teams/${t.teamId}/room-previews`),k=>{a.value=k.filter(M=>M._id!==t.currentRoomId)},()=>{},()=>d.value=!1,k=>u.value=k)})}function y(){return le(this,null,function*(){if(!i.value){o.value=[],r.value=null;return}f.value=!0,r.value=null,u.value=null,yield de(se.get(`/outputs/room/${i.value}/preview`),k=>{o.value=k},()=>{},()=>f.value=!1,k=>u.value=k)})}function S(){return le(this,null,function*(){p.value=!0,u.value=null,yield de(se.post(`/teams/${t.teamId}/outputs/copy`,{outputId:r.value,targetRoomId:t.currentRoomId}),k=>{b.value=k,m.value=!0,s("copy-success",k),setTimeout(()=>{s("update:open",!1)},1500)},()=>{},()=>p.value=!1,k=>u.value=k)})}function D(){i.value=null,r.value=null,o.value=[],m.value=!1,b.value=null,u.value=null,h()}return(k,M)=>{const I=pe("FaIcon");return x(),Z(Le,{open:t.open,icon:g(Bn),title:"Copy Output from Another Room",closable:"","hide-footer":"","body-class":"space-y-6",busy:p.value,"onUpdate:open":M[1]||(M[1]=R=>s("update:open",R)),onShow:D},{default:L(()=>{var R;return[m.value?(x(),$("div",D8,[n("div",E8,[v(I,{icon:g(At),size:"3x",class:"text-teal-500"},null,8,["icon"])]),n("div",U8,[M[2]||(M[2]=n("h3",{class:"text-2xl font-semibold text-white"}," Output Copied! ",-1)),n("p",L8,' The output "'+q((R=b.value)==null?void 0:R.name)+'" has been copied to this room ',1)])])):(x(),$("div",R8,[n("div",null,[M[3]||(M[3]=n("label",{class:"block text-sm font-semibold text-neutral-400 mb-2"}," Select Room ",-1)),me(n("select",{"onUpdate:modelValue":M[0]||(M[0]=T=>i.value=T),class:"input-ctrl h-9 w-full",disabled:d.value,onChange:y},[n("option",_8,q(d.value?"Loading rooms...":"Select a room"),1),(x(!0),$(ee,null,ge(c.value,T=>(x(),$("option",{key:T._id,value:T._id},q(T.name||"Unnamed")+" (last updated: "+q(w(T.updatedAt))+") ",9,F8))),128))],40,A8),[[Mt,i.value]])]),i.value?(x(),$("div",B8,[M[4]||(M[4]=n("label",{class:"block text-sm font-semibold text-neutral-400 mb-2"}," Select Output to Copy ",-1)),f.value?(x(),$("div",P8,[v(zt)])):o.value.length===0?(x(),$("div",N8," No outputs found in this room ")):(x(),$("div",H8,[n("div",V8,[(x(!0),$(ee,null,ge(o.value,T=>(x(),$("button",{key:T._id,class:j(["relative group p-2 rounded-lg border transition-colors",{"border-teal-500 bg-teal-900/30":r.value===T._id,"border-neutral-700 hover:border-neutral-600 bg-neutral-800 hover:bg-neutral-750":r.value!==T._id}]),onClick:C=>r.value=T._id},[v(ho,{output:T,width:160,height:90},null,8,["output"]),n("p",q8,q(T.name),1)],10,j8))),128))])]))])):N("",!0),r.value?(x(),$("div",W8,[n("button",{class:"btn-ctrl text-sm h-9 !bg-teal-600 border-teal-500 hover:!bg-teal-700 hover:!border-teal-400 !text-white font-semibold",disabled:p.value||!r.value,onClick:S},[v(I,{icon:g(Bn),size:"sm",class:"mr-1"},null,8,["icon"]),M[5]||(M[5]=U(" Copy Output ",-1))],8,G8)])):N("",!0)])),v(_t,{error:u.value,class:"!mb-3"},null,8,["error"])]}),_:1},8,["open","icon","busy"])}}},Y8={class:"flex items-center gap-4 flex-grow"},K8={class:"relative flex items-center justify-center border border-neutral-700 rounded h-8 w-8 text-white"},Z8={class:"flex gap-0"},Q8=["disabled"],J8={class:"relative z-10 border-b border-neutral-700"},e4={class:"flex gap-3 -mb-px overflow-x-auto overflow-y-hidden styled-scrollbar px-3"},t4={class:"flex-1 flex gap-3 pt-3"},n4={class:"grid grid-cols-1 lg:grid-cols-2 gap-x-12 gap-y-6 w-full lg:min-h-[500px] p-6 mx-auto bg-neutral-800"},l4={class:"flex-none w-full max-w-[560px] space-y-2 justify-self-center"},s4={class:"flex justify-between items-center"},o4={class:"text-sm font-semibold text-neutral-500"},a4={key:0,class:"text-xs text-neutral-500 !mt-1"},i4={class:"max-w-[560px] w-full",style:{"aspect-ratio":"16 / 9"}},r4={key:1,class:"text-center"},u4={class:"inline-block"},d4=["disabled"],c4={class:"flex-1 w-full min-w-[300px] max-w-[560px] space-y-3 justify-self-center"},m4={class:"flex gap-2 items-baseline text-neutral-500"},p4={href:"/docs/",target:"_blank",class:"text-xs hover:text-neutral-300"},f4={class:"flex gap-2 items-baseline text-neutral-500 !mt-6"},b4={class:"lg:col-span-2 w-full max-w-[560px] lg:max-w-full justify-self-center"},gt="CONTROLLER",Et="OPERATOR",v4={__name:"OutputModal",props:{open:Boolean},emits:["update:open"],setup(e,{emit:l}){const s=ao(),t=Fe(),a=Yn(),o=F(null),i=F(!1),r=F(gt),p=F(!1),d=F(!1),f=F(!1),u=F(null),m=l,b=e,c=["password","logo","identifier","mirror","hideControls","delay"],w={[gt]:["password","identifier"],[Et]:["password","identifier"]},h={[gt]:"Complete access to add and run timers, create messages, and manage all live connections. Designed for production staff and collaborators who need full control over the event timing.",[Et]:"A streamlined interface with large buttons for timing controls. Designed specifically for tablets and optimized for show callers and technical directors during live productions."};function y(W){r.value=W}const S=O(()=>s.getById(r.value)),D={[gt]:"Controller",[Et]:"Operator"},k=O(()=>{var W;return(W=t==null?void 0:t.settings)!=null&&W.timezone?t.settings.timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}),M=O({get:()=>{var W;return r.value===gt?t.secrets.controllerPassword:r.value===Et?t.secrets.operatorPassword:(W=S.value)==null?void 0:W.password},set:W=>r.value===gt?P("password","controllerPassword",W):r.value===Et?P("password","operatorPassword",W):T("password",W)}),I=O({get:()=>{var W,B;return((B=(W=S.value)==null?void 0:W.settings)==null?void 0:B.logo)||{mode:"stagetimer",url:""}},set:W=>T("settings.logo",W)});function R(W,B=()=>{}){return le(this,null,function*(){yield de(se.put(`/outputs/${W._id}`,W),(ie,xe)=>s.setOne(ie,xe),()=>i.value=W._id,()=>i.value=!1),B()})}function T(W,B){return le(this,null,function*(){const ie=Q({},S.value);if(W.includes(".")){const[xe,we]=W.split(".");ie[xe]=re(Q({},ie[xe]),{[we]:B}),i.value=we}else ie[W]=B,i.value=W;yield de(se.put(`/outputs/${r.value}`,ie),(xe,we)=>s.setOne(xe,we),()=>{},()=>i.value=!1)})}function C(){return le(this,null,function*(){yield de(se.post(`/outputs/room/${t.pid}`,{roomId:t._id,roomPid:t.pid}),(W,B)=>{s.setOne(W,B),r.value=W._id},()=>i.value="new",()=>i.value=!1)})}function E(W){return le(this,null,function*(){yield de(se.post(`/outputs/${W}/duplicate`),(B,ie)=>{s.setOne(B,ie),r.value=B._id},()=>i.value=W,()=>i.value=!1)})}function _(W){return le(this,null,function*(){yield de(se.delete(`/outputs/${W}`),()=>{s.removeOne(W),r.value===W&&(r.value=gt)},()=>i.value=W,()=>i.value=!1)})}function P(W,B,ie){return le(this,null,function*(){yield de(se.patch(`/rooms/${t.pid}/secrets`,{[B]:ie}),(xe,we)=>t.setSecrets(xe,we),()=>i.value=W,()=>i.value=!1)})}function A(W){o.value=W}function z(W){return le(this,null,function*(){f.value=!1;const B=s.list,ie=W.map(we=>we._id),xe=W.map((we,Ae)=>re(Q({},we),{sort_position:Ae}));s.setAll(xe,Date.now()),yield de(se.patch(`/outputs/room/${t.pid}/reorder`,{outputIds:ie}),()=>{},()=>{},()=>{},we=>{we&&(s.setAll(B,Date.now()),console.error("Failed to reorder outputs:",we))})})}function K(W){u.value&&u.value!==W&&u.value.close(),u.value=W}function H(W){u.value===W&&(u.value=null)}function G(W){s.setOne(W,W.updatedAt?new Date(W.updatedAt).getTime():Date.now()),r.value=W._id,d.value=!1}no(O(W=>t.get),S,{editMode:!1});const ne=F(!1),V=O(()=>S.value&&!ne.value),X=O(()=>
15S.value?ne.value?"Customization is only available on desktop devices":null:"This output cannot be customized");function ae(){ne.value=window.innerWidth<1024}function Se(){const W=s.previewId;r.value=W&&s.getById(W)?W:gt}return De(()=>{ae(),window.addEventListener("resize",ae)}),Qe(()=>{window.removeEventListener("resize",ae)}),(W,B)=>{const ie=pe("FaIcon"),xe=Ct("tooltip");return x(),Z(Le,{open:b.open,"data-label":"modal-output-links",closable:"","body-flush":"","hide-footer":"","header-class":"bg-neutral-900","body-class":"!p-0","width-class":"max-w-screen-lg bg-neutral-900","onUpdate:open":B[10]||(B[10]=we=>m("update:open",we)),onShow:Se},{header:L(()=>[n("div",Y8,[n("div",K8,[v(ie,{icon:g(Cl),"fixed-with":""},null,8,["icon"]),B[11]||(B[11]=n("div",{class:"absolute h-16 w-16 rounded-full border border-white",style:{opacity:".04"}},null,-1)),B[12]||(B[12]=n("div",{class:"absolute h-28 w-28 rounded-full border border-white",style:{opacity:".03"}},null,-1)),B[13]||(B[13]=n("div",{class:"absolute h-40 w-40 rounded-full border border-white",style:{opacity:".02"}},null,-1))]),B[15]||(B[15]=n("h2",{class:"flex-grow text-white truncate font-semibold"}," Output Links ",-1)),n("div",Z8,[me((x(),$("div",null,[n("button",{class:j(["btn-ctrl px-3 py-0 h-8 space-x-2 rounded-r-none text-xs font-semibold",{"bg-animated from-neutral-800 to-neutral-700":i.value==="new"}]),disabled:i.value==="new"||!g(st)(g(t).plan,g(ot).CUSTOM_THEMING),"data-label":"btn-add-output",onClick:C},[v(ie,{icon:g(sn),size:"sm"},null,8,["icon"]),B[14]||(B[14]=n("span",{class:"hidden sm:inline"},"Add Output",-1)),g(st)(g(t).plan,g(ot).CUSTOM_THEMING)?N("",!0):(x(),Z(ie,{key:0,icon:g(Yi),size:"xs",class:"text-amber-400"},null,8,["icon"]))],10,Q8)])),[[xe,g(st)(g(t).plan,g(ot).CUSTOM_THEMING)?void 0:"Adding outputs requires a Premium license"]]),v($t,{items:[{icon:g(Bn),label:"Import from another room",click:()=>
15d.value=!0,disabled:!g(a).authenticated||!g(st)(g(t).plan,g(ot).CUSTOM_THEMING)}],"button-class":"btn-ctrl p-0 w-8 h-8 text-xs rounded-l-none border-l-0","dropdown-class":"text-xs w-56",align:"right","hide-caret":"",teleport:"",dark:""},{default:L(()=>[v(ie,{icon:g(Kn),size:"xs"},null,8,["icon"])]),_:1},8,["items"])])])]),default:L(()=>{var we,Ae;return[n("div",J8,[n("div",e4,[n("div",t4,[v(Os,{name:"Controller",thumbnail:"/spa-assets/outputs/controller-thumbnail.svg",selected:r.value===gt,"disabled-options":["rename","duplicate","delete"],loading:i.value===gt,"hide-menu":"","hide-drag-handle":"",onClick:B[0]||(B[0]=fe=>y(gt))},null,8,["selected","loading"]),v(Os,{name:"Operator",thumbnail:"/spa-assets/outputs/operator-thumbnail.svg",selected:r.value===Et,"disabled-options":["rename","duplicate","delete"],loading:i.value===Et,"hide-menu":"","hide-drag-handle":"",onClick:B[1]||(B[1]=fe=>y(Et))},null,8,["selected","loading"]),v(g(vo),{"model-value":g(s).list,"item-key":"_id",tag:"div",handle:".drag-handle",class:"flex gap-3",animation:200,"ghost-class":"opacity-50",onStart:B[2]||(B[2]=fe=>f.value=!0),onEnd:B[3]||(B[3]=fe=>f.value=!1),"onUpdate:modelValue":z},{item:L(({element:fe})=>[(x(),$("div",{key:fe._id},[(x(),Z(Os,{id:fe._id,key:fe._id,name:fe.name,output:fe,"disabled-options":fe.type==="output_viewer"?["rename","delete"]:[],selected:r.value===fe._id,loading:i.value===fe._id,"is-dragging":f.value,onClick:te=>y(fe._id),"onUpdate:name":te=>R(re(Q({},fe),{name:te})),onDuplicate:te=>E(fe._id),onDelete:te=>_(fe._id),onDropdownOpen:K,onDropdownClose:H},null,8,["id","name","output","disabled-options","selected","loading","is-dragging","onClick","onUpdate:name","onDuplicate","onDelete"]))]))]),_:1},8,["model-value"])])]),B[16]||(B[16]=n("div",{class:"absolute left-0 right-0 bottom-0 h-1 bg-gradient-to-t from-black/50 to-black/0"},null,-1))]),n("div",n4,[n("div",l4,[n("div",s4,[n("h3",o4,q(((we=S.value)==null?void 0:we.name)||D[r.value])+" Preview ",1)]),h[r.value]?(x(),$("p",a4,q(h[r.value]),1)):N("",!0),n("div",i4,[r.value?(x(),Z(ho,{key:0,output:S.value,thumbnail:{[Et]:"/spa-assets/outputs/operator-thumbnail.svg",[gt]:"/spa-assets/outputs/controller-thumbnail.svg"}[r.value],width:560,height:315},null,8,["output","thumbnail"])):N("",!0)]),S.value?(x(),$("div",r4,[me((x(),$("div",u4,[n("button",{class:"btn-ctrl text-sm h-7",disabled:!V.value,"data-label":"btn-customize-output",onClick:B[4]||(B[4]=fe=>p.value=!p.value)},[v(ie,{icon:g(_n),class:"!align-baseline",size:"xs","fixed-width":""},null,8,["icon"]),B[17]||(B[17]=U(" Customize ",-1))],8,d4)])),[[xe,X.value]])])):N("",!0)]),n("div",c4,[n("div",m4,[B[19]||(B[19]=n("h3",{class:"text-sm font-semibold"}," Ouput Options ",-1)),v(Y,{tooltip:"Permanent settings saved with this output. They apply to all links created from it."}),B[20]||(B[20]=n("span",{class:"grow"},null,-1)),!g(st)(g(t).plan,g(ot).LICENSED)&&(w[r.value]||c).some(fe=>["password","logo"].includes(fe))?(x(),Z(It,{key:0,class:"!py-1",plan:"Pro","as-tooltip":"Output options require a Pro license. Upgrade to unlock password protection and branding controls."})):N("",!0),n("a",p4,[B[18]||(B[18]=U(" Docs ",-1)),v(ie,{size:"sm",icon:g(kt)},null,8,["icon"])])]),v(V3,{password:M.value,"onUpdate:password":B[5]||(B[5]=fe=>M.value=fe),logo:I.value,"onUpdate:logo":B[6]||(B[6]=fe=>I.value=fe),"output-id":(Ae=S.value)==null?void 0:Ae._id,"enabled-options":w[r.value]||c,loading:["password","logo"].includes(i.value)?i.value:!1},null,8,["password","logo","output-id","enabled-options","loading"]),n("div",f4,[B[21]||(B[21]=n("h3",{class:"text-sm font-semibold"}," Link Options ",-1)),v(Y,{tooltip:"One-time settings that only apply to the specific link you're about to copy."})]),v(u8,{"output-id":r.value,output:S.value,"enabled-options":w[r.value]||c,"default-timezone":k.value,onUpdate:A},null,8,["output-id","output","enabled-options","default-timezone"])]),n("div",b4,[v(O8,{"output-id":r.value,"room-pid":g(t).pid,params:o.value,"room-name":g(t).name},null,8,["output-id","room-pid","params","room-name"])])]),v(qr,{open:p.value,"onUpdate:open":B[7
15]||(B[7]=fe=>p.value=fe),output:S.value,loading:r.value&&r.value===i.value,"onUpdate:output":B[8]||(B[8]=({output:fe,resolve:te})=>R(fe,te))},null,8,["open","output","loading"]),v(X8,{open:d.value,"onUpdate:open":B[9]||(B[9]=fe=>d.value=fe),plan:g(t).plan,"current-room-id":g(t)._id,"team-id":g(t).teamId,onCopySuccess:G},null,8,["open","plan","current-room-id","team-id"])]}),_:1},8,["open"])}}},g4={class:"grid grid-cols-[auto_auto] items-center gap-3 text-sm"},h4={class:"key"},x4={class:"key"},w4={class:"key"},y4={class:"key"},k4={class:"key"},$4={class:"key"},S4={__name:"ShortcutsModal",props:{open:Boolean},emits:["update:open"],setup(e,{emit:l}){const s=l,t=e;return(a,o)=>(x(),Z(Le,{open:t.open,icon:g(Fi),title:"Keyboard Shortcuts","body-class":"font-light space-y-6 pb-7","width-class":"max-w-xl",closable:"","hide-footer":"","onUpdate:open":o[0]||(o[0]=i=>s("update:open",i))},{default:L(()=>[n("div",g4,[o[5]||(o[5]=n("div",{class:"col-span-2 text-neutral-400 text-xs uppercase tracking-wide pt-1"}," Timer Control ",-1)),n("div",null,[n("div",h4,[v(g(pt),{icon:g(Cd),size:"sm","fixed-width":""},null,8,["icon"])])]),o[6]||(o[6]=n("div",null," Reset the current timer if running, or select the previous timer. ",-1)),n("div",null,[n("div",x4,[v(g(pt),{icon:g(Gi),size:"sm","fixed-width":""},null,8,["icon"])])]),o[7]||(o[7]=n("div",null," Select the next timer in sequence. ",-1)),o[8]||(o[8]=n("div",null,[n("div",{class:"key"},"Space")],-1)),o[9]||(o[9]=n("div",null," Toggle start/stop of the current timer. ",-1)),o[10]||(o[10]=n("div",null,[n("div",{class:"key"},"B")],-1)),o[11]||(o[11]=n("div",null," Toggle blackout mode on all live connections. ",-1)),o[12]||(o[12]=n("div",null,[n("div",{class:"key"},"O")],-1)),o[13]||(o[13]=n("div",null," Toggle the on-air indicator. ",-1)),o[14]||(o[14]=n("div",null,[n("div",{class:"key"},"F")],-1)),o[15]||(o[15]=n("div",null," Flash the screen three times (to grab attention). ",-1)),o[16]||(o[16]=n("div",{class:"col-span-2 text-neutral-400 text-xs uppercase tracking-wide pt-4"}," Select Mode ",-1)),n("div",null,[n("span",w4,q(g(Tt)),1),o[1]||(o[1]=n("span",{class:"key"},"A",-1))]),o[17]||(o[17]=n("div",null," Select all / deselect all items. ",-1)),o[18]||(o[18]=n("div",null,[n("span",{class:"key"},"Esc")],-1)),o[19]||(o[19]=n("div",null," Exit select mode. ",-1)),o[20]||(o[20]=n("div",null,[n("span",{class:"key"},"Backspace")],-1)),o[21]||(o[21]=n("div",null," Delete selected items. ",-1)),n("div",null,[n("span",y4,q(g(Tt)),1),o[2]||(o[2]=n("span",{class:"key"},"D",-1))]),o[22]||(o[22]=n("div",null," Duplicate selected items. ",-1)),n("div",null,[n("span",k4,q(g(Tt)),1),o[3]||(o[3]=n("span",{class:"key"},"L",-1))]),o[23]||(o[23]=n("div",null," Link selected timers. ",-1)),n("div",null,[n("span",$4,q(g(Tt)),1),o[4]||(o[4]=n("span",{class:"key"},"U",-1))]),o[24]||(o[24]=n("div",null," Unlink selected timers. ",-1))]),o[25]||(o[25]=n("p",{class:"text-sm text-neutral-400 mt-6 mb-2"},[U(" Suggestions? Email us at "),n("a",{href:"mailto:[email protected]",class:"link !text-current"},"[email protected]")],-1))]),_:1},8,["open","icon"]))}},C4=Oe(S4,[["__scopeId","data-v-f07ab68e"]]),M4="/spa-assets/outputs/new-customizer-location.png",T4="/spa-assets/outputs/legacy-customizer-location.png",z4={__name:"LegacyMigrationModal",props:{open:Boolean},emits:["update:open"],setup(e,{emit:l}){const s=l;return(t,a)=>(x(),Z(Le,{open:e.open,title:"Where did the link customizer go?",closable:"","hide-footer":"","width-class":"max-w-3xl","data-label":"legacy-migration-modal","onUpdate:open":a[0]||(a[0]=o=>s("update:open",o))},{default:L(()=>[...a[1]||(a[1]=[n("div",{class:"space-y-6 font-light"},[n("p",null," We've redesigned how output links work. The customizer is now built directly into each output. "),n("div",{class:"space-y-2"},[n("h3",{class:"font-semibold"}," New Customizer Location "),n("p",null,' Click on any output, then use the "Customize" button to access the new customizer. '),n("img",{src:M4,alt:"New customizer location",class:"rounded border border-neutral-600"})]),n("div",{class:"space-y-2"},[n("h3",{class:"font-semibold"}," Legacy System "),n("p",null,' You can still access the old customizer and sharable links from the dropdown menu next to "Output Links". '),n("img",{src:T4,alt:"Legacy customizer location",class:"rounded border border-neutral-600"})]),n("div",{class:"bg-amber-900/30 border border-amber-700/50 rounded p-4"},[n("p",{class:"text-amber-200 text-sm"},[n("strong",null,"Note:"),U(" The legacy system will remain available until the end of 2026, giving you time to transition to the new output system. ")])])],-1)])]),_:1},8,["open"]))}},I4=["src","alt"],Tn={__name:"ShareModalSelectItem.LEGACY",props:{name:{type:String,required:!0},isSelected:Boolean,isPublic:Boolean},emits:["click"],setup(e,{emit:l}){const s=l;return(t,a)=>{const o=pe("FaIcon");return x(),$("button",{class:j(["group block w-32 rounded-t-lg border-t border-x px-2 pt-2 transition-colors",{"bg-neutral-800 border-current":e.isSelected,"hover:bg-neutral-800 border-transparent hover:border-sky-400":!e.isSelected}]),onClick:a[0]||(a[0]=i=>s("click"))},[n("img",{src:`/spa-assets/thumbnail-${e.name.toLowerCase()}.png`,alt:`${e.name} thumbnail`,class:"block rounded border border-neutral-800"},null,8,I4),n("p",{class:j(["text-xs transition-colors py-1",{"text-neutral-300":e.isSelected,"group-hover:text-neutral-300":!e.isSelected}])},[n("strong",null,q(e.name),1),v(o,{class:j(["ml-2",{"opacity-40":e.isPublic}]),size:"sm",icon:e.isPublic?g(Ps):g(Ns)},null,8,["class","icon"])],2)],2)}}};function O4(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}const D4={class:"bg-neutral-900 border-b border-current text-neutral-700 !mt-0"},E4={class:"flex gap-4 overflow-auto px-6 pt-6 -mb-px"},U4={class:"grid grid-cols-1 md:grid-cols-2 gap-6 px-6 min-h-[310px]"},L4={class:"mb-4"},R4={class:"text-xs text-neutral-500 mb-4"},A4={class:"text-sm font-semibold text-neutral-500 mb-2"},_4={class:"text-sm rounded border border-neutral-700 px-4 py-2"},F4={class:"flex justify-between items-baseline text-neutral-500 mb-2"},B4=["href"],P4={class:"text-sm rounded border border-neutral-700 px-4 py-2"},N4={class:"w-full"},H4={key:0},V4={key:1},j4={key:2},q4={key:3},W4={key:4},G4={key:5},X4={key:6},Y4={key:7},K4={key:8},Z4={key:9},Q4={key:10},J4={class:"px-6"},ek={class:"flex space-x-2"},tk=["value"],nk=["href"],lk={class:"mt-2"},sk={class:"flex gap-3 flex-wrap items-center mt-2"},ok=["title","disabled"],ak={__name:"ShareModal.LEGACY",props:{open:Boolean},emits:["update:open","customize-modal"],setup(e,{emit:l}){const{VIEWER:s,CONTROLLER:t,AGENDA:a,MODERATOR:o,OPERATOR:i}=As,r={[s]:["name","mirror","hideControls","isolate","background","delay","customize","notes"],[t]:["name"],[a]:["name","notes","labels","hideRoomProgress","delay"],[o]:["name","notes","labels","layout","hideRoomProgress"],[i]:["name"]},p={name:"",mirror:void 0,hideControls:!1,isolate:void 0,layout:"",n
15otes:!1,delay:0,background:""},d=Yn(),f=Fe(),u=l,m=e,b=F(s),c=F(!1),w=F(!1),h=ht(Q({},p)),y=F(""),S=O(()=>f.uid===d.uid),D=O(()=>Ee.planCan(f.plan,Ee.permissions.LICENSED)),k=O(()=>Hd(b.value.toLowerCase())),M=O(()=>f.secrets[b.value.toLowerCase()+"Key"]),I=O(()=>[{label:"View active timer",can:[s,t,a,o,i]},{label:"View active message",can:[s,t,o]},{label:"View all timers",can:[t,a,o]},{label:"View all messages",can:[t,o]},{label:"Edit timers",can:[t,i]},{label:"Edit messages",can:[t,o]}]),R={[s]:"",[t]:"controller/",[a]:"agenda/",[o]:"moderator/",[i]:"operator/"};Te([h,b,M],()=>le(null,null,function*(){var z;let A=new URL((z=window==null?void 0:window.location)==null?void 0:z.href.replace(/controller\/.*$/,R[b.value]));h.name&&A.searchParams.set("name",h.name),h.mirror&&A.searchParams.set("mirror",h.mirror),h.hideControls&&A.searchParams.set("hide","controls"),h.isolate&&A.searchParams.set("only",h.isolate),h.layout&&A.searchParams.set("layout",h.layout),h.notes&&A.searchParams.set("notes",1),h.labels&&A.searchParams.set("labels",1),h.hideRoomProgress&&A.searchParams.set("hideProgress",1),h.background&&A.searchParams.set("background",h.background),h.delay&&A.searchParams.set("delay",h.delay),M.value&&(A=yield tc(A,M.value)),y.value=A.toString()}),{immediate:!0,deep:!0});const T=O(()=>{const A=M.value?"public":"private";return D.value?S.value?`Make links ${A}`:`Only the room owner can make links ${A}`:`Making links ${A} requires a license`}),C=A=>de(se.patch(`/rooms/${f.pid}/secrets`,{[A]:f.secrets[A]?null:O4()}),(z,K)=>f.setSecrets(z,K),()=>w.value=A,()=>w.value=null);function E(A){b.value=A,_()}function _(){for(const A in p)h[A]=p[A]}const P={[s]:"A fullscreen display of timers, messages, and other selected elements for presenters. Intended to be used as a confidence monitor for talents on stage who need visual timing cues without access to controls.",[t]:"Complete access to add and run timers, create messages, and manage all connected devices. Designed for production staff and collaborators who need full control over the event timing.",[a]:"A dynamic program schedule with start times, durations, titles, and speakers for each segment. Useful for keeping both staff and audience informed about the event timeline.",[o]:"Shows the event agenda while allowing users to create and display messages to presenters. Ideal for staff members who need to communicate with speakers without requiring access to timer controls.",[i]:"A streamlined interface with large buttons for timing controls. Designed specifically for tablets and optimized for show callers and technical directors during live productions."};return(A,z)=>{const K=pe("FaIcon");return x(),Z(Le,{open:m.open,title:"Sharable Links",icon:g(Xn),closable:"","hide-footer":"","body-flush":"","body-class":"space-y-6 pb-6 pt-3","width-class":"max-w-3xl","data-label":"modal-share-links","onUpdate:open":z[21]||(z[21]=H=>u("update:open",H)),onShow:_},{default:L(()=>[z[46]||(z[46]=n("div",{class:"bg-blue-900 px-6 h-8 leading-8 text-stone-200 text-sm"},[n("strong",null,"Legacy Feature:"),U(' This function will be removed at the end of 2026. Please use "Output Links" instead. ')],-1)),n("div",D4,[n("div",E4,[v(Tn,{"data-label":"btn-tab-viewer",class:"flex-none",name:g(s),"is-selected":b.value===g(s),"is-public":!g(f).secrets.viewerKey,onClick:z[0]||(z[0]=H=>E(g(s)))},null,8,["name","is-selected","is-public"]),v(Tn,{"data-label":"btn-tab-controller",class:"flex-none",name:g(t),"is-selected":b.value===g(t),"is-public":!g(f).secrets.controllerKey,onClick:z[1]||(z[1]=H=>E(g(t)))},null,8,["name","is-selected","is-public"]),v(Tn,{"data-label":"btn-tab-agenda",class:"flex-none",name:g(a),"is-selected":b.value===g(a),"is-public":!g(f).secrets.agendaKey,onClick:z[2]||(z[2]=H=>E(g(a)))},null,8,["name","is-selected","is-public"]),v(Tn,{"data-label":"btn-tab-moderator",class:"flex-none",name:g(o),"is-selected":b.value===g(o),"is-public":!g(f).secrets.moderatorKey,onClick:z[3]||(z[3]=H=>E(g(o)))},null,8,["name","is-selected","is-public"]),v(Tn,{"data-label":"btn-tab-operator",class:"flex-none",name:g(i),"is-selected":b.value===g(i),"is-public":!g(f).secrets.operatorKey,onClick:z[4]||(z[4]=H=>E(g(i)))},null,8,["name","is-selected","is-public"])])]),n("div",U4,[n("div",null,[z[22]||(z[22]=n("h3",{class:"text-sm font-semibold text-neutral-500 mb-2"}," Description ",-1)),n("div",L4,[n("p",R4,q(P[b.value]),1)]),n("h3",A4," People with the "+q(k.value)+" link can ⦠",1),n("div",_4,[(x(!0),$(ee,null,ge(I.value,H=>(x(),$("p",{key:H.label,class:j({"text-neutral-700":!H.can.includes(b.value)})},[v(K,{class:j(["mr-2",{"text-green-500":H.can.includes(b.value)}]),size:"sm",icon:H.can.includes(b.value)?g(At):g(Pl),"fixed-width":""},null,8,["class","icon"]),U(" "+q(H.label),1)],2))),128))])]),n("div",null,[n("div",F4,[z[24]||(z[24]=n("h3",{class:"text-sm font-semibold"}," Options ",-1)),n("a",{href:`/docs/${b.value.toLowerCase()}/`,target:"_blank",class:"text-xs hover:text-neutral-300"},[z[23]||(z[23]=U(" Docs ",-1)),v(K,{size:"sm",icon:g(kt)},null,8,["icon"])],8,B4)]),n("div",P4,[n("table",N4,[r[b.value].includes("name")?(x(),$("tr",H4,[n("th",null,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:'Pre-define a name that shows up under "Connected Devices"'},{default:L(()=>[...z[25]||(z[25]=[U(" Name ",-1)])]),_:1}
15)]),n("td",null,[me(n("input",{"onUpdate:modelValue":z[5]||(z[5]=H=>h.name=H),type:"text",class:"input-ctrl text-xs h-7 w-full",placeholder:"Enter device name (optional)"},null,512),[[ft,h.name]])])])):N("",!0),r[b.value].includes("mirror")?(x(),$("tr",V4,[n("th",null,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:"Mirror the display of the viewer page"},{default:L(()=>[...z[26]||(z[26]=[U(" Mirror ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:h.mirror,"onUpdate:modelValue":z[6]||(z[6]=H=>h.mirror=H),"select-class":"h-7 w-full",size:"xs",width:"100%",options:[{value:void 0,label:"Not mirrored"},{value:"vertical",label:"Vertical"},{value:"horizontal",label:"Horizontal"},{value:"vertical,horizontal",label:"Vertical + Horizontal"}]},null,8,["modelValue"])])])):N("",!0),r[b.value].includes("isolate")?(x(),$("tr",j4,[n("th",null,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:"Only show this elements of the viewer page"},{default:L(()=>[...z[27]||(z[27]=[U(" Isolate ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:h.isolate,"onUpdate:modelValue":z[7]||(z[7]=H=>h.isolate=H),"select-class":"h-7 w-full",size:"xs",width:"100%",options:[{value:void 0,label:"None"},{value:"header",label:"Header"},{value:"footer",label:"Footer"},{value:"timer",label:"Timer"},{value:"message",label:"Message"},{value:"progress",label:"Progress"}]},null,8,["modelValue"])])])):N("",!0),r[b.value].includes("hideControls")?(x(),$("tr",q4,[n("th",null,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:"Hide the controls in the upper-right corner that appear when moving the mouse"},{default:L(()=>[...z[28]||(z[28]=[U(" Hide ",-1)])]),_:1})]),n("td",null,[v(Ne,{modelValue:h.hideControls,"onUpdate:modelValue":z[8]||(z[8]=H=>h.hideControls=H),class:"text-xs",disabled:!!h.isolate},{default:L(()=>[...z[29]||(z[29]=[U(" Hide controls overlay ",-1)])]),_:1},8,["modelValue","disabled"])])])):N("",!0),r[b.value].includes("notes")?(x(),$("tr",W4,[z[31]||(z[31]=n("th",null,"Notes",-1)),n("td",null,[v(Ne,{modelValue:h.notes,"onUpdate:modelValue":z[9]||(z[9]=H=>h.notes=H),class:"text-xs"},{default:L(()=>[...z[30]||(z[30]=[U(" Show timer notes ",-1)])]),_:1},8,["modelValue"])])])):N("",!0),r[b.value].includes("labels")?(x(),$("tr",G4,[z[33]||(z[33]=n("th",null,"Labels",-1)),n("td",null,[v(Ne,{modelValue:h.labels,"onUpdate:modelValue":z[10]||(z[10]=H=>h.labels=H),class:"text-xs"},{default:L(()=>[...z[32]||(z[32]=[U(" Show timer labels ",-1)])]),_:1},8,["modelValue"])])])):N("",!0),r[b.value].includes("hideRoomProgress")?(x(),$("tr",X4,[z[35]||(z[35]=n("th",null,"Footer",-1)),n("td",null,[v(Ne,{modelValue:h.hideRoomProgress,"onUpdate:modelValue":z[11]||(z[11]=H=>h.hideRoomProgress=H),class:"text-xs"},{default:L(()=>[...z[34]||(z[34]=[U(" Hide room progress bar ",-1)])]),_:1},8,["modelValue"])])])):N("",!0),r[b.value].includes("delay")?(x(),$("tr",Y4,[n("th",null,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:"Put the device on a delay (in seconds)"},{default:L(()=>[...z[36]||(z[36]=[U(" Delay ",-1)])]),_:1})]),n("td",null,[v(Rn,{value:h.delay,"onUpdate:value":z[12]||(z[12]=H=>h.delay=H),min:0,class:"input-ctrl text-xs h-7 w-full"},null,8,["value"])])])):N("",!0),r[b.value].includes("background")?(x(),$("tr",K4,[n("th",null,[v(Y,{"text-class":"text-inherit hover:text-neutral-400 whitespace-nowrap",tooltip:"Override the background to use with hardware or software mixers (vMix, OBS)."},{default:L(()=>[...z[37]||(z[37]=[U(" Background ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:h.background,"onUpdate:modelValue":z[13]||(z[13]=H=>h.background=H),"select-class":"h-7 w-full",size:"xs",width:"100%",options:[{value:"",label:"Default"},{value:"transparent",label:"Transparent"},{value:"green",label:"Chroma Key Green"},{value:"purple",label:"Chroma Key Purple"},{value:"magenta",label:"Chroma Key Magenta"}]},null,8,["modelValue"])])])):N("",!0),r[b.value].includes("layout")?(x(),$("tr",Z4,[n("th",null,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:"Choose the arragnement of content on the page"},{default:L(()=>[...z[38]||(z[38]=[U(" Layout ",-1)])]),_:1})]),n("td",null,[v(he,{modelValue:h.layout,"onUpdate:modelValue":z[14]||(z[14]=H=>h.layout=H),"select-class":"h-7 w-full",size:"xs",width:"100%",options:[{value:"",label:"Agenda | Messages"},{value:"inverse",label:"Messages | Agenda"}]},null,8,["modelValue"])])])):N("",!0),r[b.value].includes("customize")?(x(),$("tr",Q4,[n("th",null,[v(Y,{"text-class":"text-inherit hover:text-neutral-400",tooltip:"
15Change the look and feel of the viewer page"},{default:L(()=>[...z[39]||(z[39]=[U(" Customize ",-1)])]),_:1})]),n("td",null,[n("button",{class:"btn-ctrl text-xs h-6",onClick:z[15]||(z[15]=H=>u("customize-modal"))}," Open Customizer ")])])):N("",!0)])]),b.value===g(i)?(x(),Z(Eo,{key:0,class:"mt-2"},{default:L(()=>[...z[40]||(z[40]=[U(" The new Operator page. ",-1)])]),_:1})):N("",!0)])]),n("div",J4,[z[45]||(z[45]=n("h3",{class:"text-sm font-semibold text-neutral-500 mb-2"}," Copy Link ",-1)),n("div",ek,[n("input",{class:"flex-grow input-ctrl !border-0 h-8 py-0 px-2 text-sm w-full",value:y.value,"data-label":"input-page-url",readonly:"",onClick:z[16]||(z[16]=H=>H.target.select())},null,8,tk),n("a",{href:y.value,target:"_blank",class:"flex-none btn-ctrl hover:border-neutral-400 text-sm leading-8 h-8 w-8 p-0",title:"Open link in a new tab","data-label":"btn-open-in-new-tab"},[v(K,{size:"sm",icon:g(kt),"fixed-width":""},null,8,["icon"])],8,nk)]),n("div",lk,[M.value?N("",!0):(x(),Z(zl,{key:0,label:"Link Public",icon:g(Ps),"icon-class":"text-red-400"},{default:L(()=>[U(" Everyone with the room ID can access it. "+q(g(Ee.planCan)(g(f).plan,g(Ee.permissions).LICENSED)?"":"Upgrade your license to limit access."),1)]),_:1},8,["icon"])),M.value?(x(),Z(zl,{key:1,icon:g(Ns),"icon-class":"text-green-400"},{default:L(()=>[...z[41]||(z[41]=[U(" Only people with this private link can access it. ",-1)])]),_:1},8,["icon"])):N("",!0)]),n("div",sk,[n("div",{class:j({"text-green-400":M.value,"text-red-400":!M.value})},[v(K,{size:"sm",icon:M.value?g(Ns):g(Ps),"fixed-width":""},null,8,["icon"]),U(" "+q(M.value?"Private":"Public"),1)],2),n("div",null,[n("button",{class:"btn-ctrl text-sm space-x-2 h-7",title:T.value,disabled:!(D.value&&S.value),onClick:z[17]||(z[17]=H=>C(b.value.toLowerCase()+"Key"))},[w.value?(x(),Z(zt,{key:0,size:"sm",inline:""})):N("",!0),D.value?N("",!0):(x(),Z(K,{key:1,icon:g(Yi),size:"xs",class:"text-amber-500"},null,8,["icon"])),n("span",null,q(M.value?"Make public":"Make private"),1)],8,ok)]),z[44]||(z[44]=n("span",{class:"flex-grow"},null,-1)),n("button",{class:"btn-ctrl hover:border-neutral-400 text-sm h-8",title:"Display QR Code","data-label":"btn-show-qr-code",onClick:z[18]||(z[18]=H=>c.value=!c.value)},[v(K,{size:"sm",icon:g(bo),"fixed-width":""},null,8,["icon"]),z[42]||(z[42]=n("span",{class:"hidden sm:inline"}," QR Code",-1))]),v(Nn,{class:"btn-ctrl !bg-teal-800 border-teal-600 hover:!border-teal-300 !text-white text-sm h-8",title:"Click to copy","data-label":"btn-copy-url",onClick:z[19]||(z[19]=H=>g(Il)(y.value))},{default:L(()=>[v(K,{size:"sm",icon:g(Pn),"fixed-width":""},null,8,["icon"]),z[43]||(z[43]=n("span",{class:"hidden sm:inline"}," Copy",-1))]),_:1})])]),v(au,{open:c.value,"onUpdate:open":z[20]||(z[20]=H=>c.value=H),url:y.value,label:k.value,"room-name":g(f).name},null,8,["open","url","label","room-name"])]),_:1},8,["open","icon"])}}},ik=Oe(ak,[["__scopeId","data-v-4e7e144d"]]),rk="/spa-assets/customize/explainer-message.jpg",uk="/spa-assets/customize/explainer-appearance.jpg",dk={class:"aspect-w-16 aspect-h-9"},ck={class:"w-full h-full"},mk={class:"flex justify-center text-neutral-500 mt-2"},pk={class:"flex justify-center items-center text-center border border-neutral-700 rounded px-3 py-1"},fk={class:"mr-8"},bk={class:"text-xs text-neutral-600 hover:text-neutral-500"},vk={__name:"CustomizePreview",props:{now:{type:Number,required:!0},settings:{type:Object,required:!0},plan:{type:Object,default:null}},setup(e){const l=e,s=F(!1),t=F(Ie.COUNTDOWN),a=O(()=>({_id:1,name:"Welcome to the Show",extra:"John Doe",showName:!0,showExtra:!0,appearance:t.value,type:et.DURATION,hours:0,minutes:10,seconds:0,yellow:18e4,red:6e4})),o={$NEXT_TITLE:"Keynote 1",$NEXT_START:"6:30 PM"},i=O(()=>s.value?{index:1,text:"I love cheese, especially macaroni cheese fondue.",color:Lu.WHITE,bold:!1,uppercase:!1}:null),r={timerId:1,running:!1,deadline:Date.now()+75e4,kickoff:Date.now()-25e4,lastStop:Date.now()},p=Md(r,a.value,l.now,l.settings.behavior),d=[{value:Ie.COUNTDOWN,label:"Countdown"},{value:Ie.COUNTUP,label:"Count Up"},{value:Ie.TOD,label:"Time of Day"}
15,{value:Ie.COUNTDOWN_TOD,label:"Countdown + Time of Day"},{value:Ie.COUNTUP_TOD,label:"Count Up + Time of Day"},{value:Ie.HIDDEN,label:"Hidden"}];return(f,u)=>{const m=pe("FaIcon");return x(),$("div",null,[n("div",dk,[n("div",ck,[v(nc,{class:"rounded border-2 border-neutral-700 overflow-hidden bg-placeholder-dark",now:l.now,moment:g(p),timer:a.value,message:i.value,settings:l.settings,replacements:o,"hide-header":""},null,8,["now","moment","timer","message","settings"])])]),n("div",mk,[n("div",pk,[n("label",fk,[u[2]||(u[2]=n("span",{class:"text-neutral-500 mr-2"},"Show Message",-1)),me(n("input",{"onUpdate:modelValue":u[0]||(u[0]=b=>s.value=b),type:"checkbox",class:"rounded w-5 h-5"},null,512),[[Fl,s.value]])]),u[5]||(u[5]=n("span",{class:"text-neutral-500 mr-2"},"Appearance",-1)),v(he,{modelValue:t.value,"onUpdate:modelValue":u[1]||(u[1]=b=>t.value=b),options:d,size:"sm","select-class":"h-7"},null,8,["modelValue"]),v(g(Rs),{class:"ml-5",triggers:["hover","click"]},{popper:L(()=>[...u[4]||(u[4]=[n("div",{class:"space-y-2"},[n("p",null,"These settings are for preview purposes."),n("h3",{class:"font-semibold !mt-8"},"Show Messages"),n("img",{class:"rounded w-80",src:rk,alt:""}),n("p",null,'Use the "Show" button to display messages individually.'),n("h3",{class:"font-semibold !mt-8"},"Change Timer Appearance"),n("img",{class:"rounded w-80",src:uk,alt:""}),n("p",null,"Hover over timers to change their appearance individually.")],-1)])]),default:L(()=>[n("div",bk,[u[3]||(u[3]=n("span",{class:"border-b border-dotted border-current mr-1"},"Preview only",-1)),v(m,{icon:g(Ot),class:"cursor-pointer"},null,8,["icon"])])]),_:1})])])])}}};var Ls,vi;function gk(){if(vi)return Ls;vi=1;var e=$i(),l=0;function s(t){var a=++l;return e(t)+a}return Ls=s,Ls}var hk=gk();const xk=ln(hk),wk=["for"],yk=["id","value","true-value","false-value","checked","disabled"],kk={__name:"ToggleButton",props:{modelValue:{type:[Boolean,String],required:!0},trueValue:{type:[Boolean,String],default:!0},falseValue:{type:[Boolean,String],default:!1},slotClass:{type:[String,Object,Array],default:""},activeClass:{type:String,default:"bg-green-500"},size:{type:String,default:"md",validate:e=>["sm","md","lg"].includes(e)},disabled:Boolean},emits:["update:model-value"],setup(e,{emit:l}){const s=xk("input_"),t=l,a=e;function o(i){const r=i.target.checked?a.trueValue:a.falseValue;t("update:model-value",r)}return(i,r)=>(x(),$("label",{for:g(s),class:j(["inline-flex items-center space-x-[0.5em]",{"cursor-pointer":!e.disabled}])},[i.$slots.before?(x(),$("div",{key:0,class:j([e.slotClass,{"opacity-50":e.disabled}])},[Ke(i.$slots,"before",{active:e.modelValue===e.falseValue})],2)):N("",!0),n("div",{class:j(["relative",{"opacity-50":e.disabled}])},[n("input",{id:g(s),type:"checkbox",class:"sr-only",value:e.modelValue,"true-value":e.trueValue,"false-value":e.falseValue,checked:e.modelValue===e.trueValue,disabled:e.disabled,onInput:o},null,40,yk),n("div",{class:j(["block rounded-full",{"w-14 h-8":e.size==="lxl","w-12 h-7":e.size==="lg","w-10 h-6":e.size==="md","w-7 h-4":e.size==="sm","w-5 h-3":e.size==="xs","bg-neutral-600":e.modelValue===e.falseValue,"bg-green-600":e.modelValue===e.trueValue}])},null,2),n("div",{class:j(["absolute bg-white rounded-full transition",{[e.activeClass]:e.modelValue===e.trueValue,"left-1 top-1 w-6 h-6":e.size==="xl","left-1 top-1 w-5 h-5":e.size==="lg","left-1 top-1 w-4 h-4":e.size==="md","left-0.5 top-0.5 w-3 h-3":e.size==="sm","left-0.5 top-0.5 w-2 h-2":e.size==="xs","translate-x-full":e.modelValue===e.trueValue}])},null,2)],2),i.$slots.after||i.$slots.default?(x(),$("div",{key:1,class:j([e.slotClass,{"opacity-50":e.disabled}])},[Ke(i.$slots,"after",{active:e.modelValue===e.trueValue}),Ke(i.$slots,"default",{active:e.modelValue===e.trueValue})],2)):N("",!0)],10,wk))}},$k={class:"max-w-full"},Sk={class:"flex items-center space-x-2"},Ck=["disabled","value"],Mk={__name:"CustomizeLogo",props:{settings:{type:Object,required:!0},roomPid:{type:String,required:!0},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=l,t=e;function a(i,r){const p=re(Q({},t.settings),{[i]:r});i==="image"&&r&&(p.hideAppLogo=!0),s("update:settings",p)}const o=[{value:ue.logoPosition.TOP_LEFT,label:"Top Left"},{value:ue.logoPosition.TOP_RIGHT,label:"Top Right"},{value:ue.logoPosition.BOTTOM_LEFT,label:"Bottom Left"},{value:ue.logoPosition.BOTTOM_RIGHT,label:"Bottom Right"}];return(i,r)=>(x(),$("table",$k,[n("tbody",null,[n("tr",null,[r[5]||(r[5]=n("th",null,"Show",-1)),n("td",null,[v(kk,{"data-label":"toggle-hide-stagetimer-logo",class:"text-sm",size:"sm",disabled:e.disabled,"model-value":!t.settings.hideAppLogo,"onUpdate:modelValue":r[0]||(r[0]=p=>a("hideAppLogo",!p))},{default:L(()=>[...r[4]||(r[4]=[U(" Show Stagetimer logo ",-1)])]),_:1},8,["disabled","model-value"])])]),n("tr",null,[r[6]||(r[6]=n("th",null,"Image",-1)),n("td",null,[v(on,{"data-label":"customize-logo-upload","file-formats":["JPG","PNG","SVG"],"base-path":"images/","post-url":`/files/for-room/${e.roomPid}`,"image-size":"contain",disabled:e.disabled,img:t.settings.image,"onUpdate:img":r[1]||(r[1]=p=>a("image",p))}
15,null,8,["post-url","disabled","img"])])]),n("tr",null,[r[7]||(r[7]=n("th",null,"Size",-1)),n("td",Sk,[n("input",{"data-label":"customize-logo-size",class:"focus:ring-0",type:"range",min:"0",max:"100",disabled:e.disabled,value:t.settings.size,onInput:r[2]||(r[2]=p=>a("size",p.target.value))},null,40,Ck),n("span",{class:j(["text-xs text-neutral-500",{"opacity-50":e.disabled}])},q(t.settings.size)+"% ",3)])]),n("tr",null,[r[8]||(r[8]=n("th",null,"Position",-1)),n("td",null,[v(he,{"data-label":"customize-logo-position","select-class":"h-7 w-full",size:"xs",width:"100%",disabled:e.disabled,options:o,"model-value":t.settings.position,"onUpdate:modelValue":r[3]||(r[3]=p=>a("position",p))},null,8,["disabled","model-value"])])])])]))}},Tk=Oe(Mk,[["__scopeId","data-v-b54b8d90"]]),zk={class:"space-y-4"},Ik={class:"w-full"},Ok={class:"flex grow"},Dk={class:"text-sm"},Ek={class:"ml-auto"},Uk=["onClick"],Lk=["onClick"],Rk={class:"text-sm text-neutral-500"},Ak=["disabled"],_k=["disabled"],Fk={key:0,class:"text-sm"},Bk=3*1024*1024,Pk={__name:"CustomizeFonts",props:{settings:{type:Object,required:!0},uid:{type:String,default:""},disabled:Boolean},emits:["update:settings","setFonts"],setup(e,{emit:l}){const s=l,t=e,a=F(null),o=F(0),i=O({get(){return t.settings.typefaces||[]},set(f){s("update:settings",re(Q({},t.settings),{typefaces:f}))}});function r(f){return le(this,null,function*(){const[u]=f.target.files;if(!u)return;if(f.target.value="",u.size>Bk){a.value=new Error(`Font file size exceeds 3MB limit (${(u.size/1024/1024).toFixed(2)}MB)`);return}a.value=null;const m=new FormData;m.append("path","fonts/"),m.append("file",u);try{const{data:b}=yield se({method:"post",url:"/files/",data:m,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:({loaded:w,total:h})=>{o.value=Math.round(w/h*100)}}),c=u.name.split(".")[0];i.value=[...i.value,{id:Math.floor(Math.random()*1e6),name:c,url:b}]}catch(b){a.value=b}finally{o.value=0}})}function p(f){i.value=i.value.filter(u=>u.id!==f)}function d(f){s("setFonts",f)}return(f,u)=>{var c;const m=pe("FaIcon"),b=Ct("tooltip");return x(),$("div",zk,[n("table",Ik,[n("tbody",null,[(x(!0),$(ee,null,ge(i.value,(w,h)=>(x(),$("tr",{key:w.id,class:"flex items-center"},[n("th",null,"Font #"+q(h+1),1),n("td",Ok,[n("p",Dk,q(w.name||"Unknown font"),1),n("div",Ek,[me((x(),$("button",{class:"btn-ctrl text-xs h-full mr-1",onClick:y=>d(w)},[...u[1]||(u[1]=[U(" Set ",-1)])],8,Uk)),[[b,"Activate for all elements"]]),me((x(),$("button",{class:"btn-ctrl text-xs text-neutral-500 h-full",onClick:y=>p(w.id)},[v(m,{icon:g(en),size:"xs"},null,8,["icon"])],8,Lk)),[[b,"Remove"]])])])]))),128))])]),me(n("p",Rk," No custom fonts yet. ",512),[[An,!((c=i.value)!=null&&c.length)]]),n("div",null,[n("input",{ref:"fileInput",type:"file",class:"sr-only",accept:"font/otf,font/ttf,font/woff,font/woff2",disabled:e.disabled,onChange:r},null,40,Ak),n("button",{type:"button",class:"btn-ctrl h-7",disabled:e.disabled,onClick:u[0]||(u[0]=()=>f.$refs.fileInput.click())},[v(m,{icon:g(lo),size:"xs"},null,8,["icon"]),u[2]||(u[2]=n("span",{class:"ml-2"},"Upload Font",-1))],8,_k)]),a.value?(x(),$("div",Fk,[v(_t,{error:a.value},null,8,["error"])])):N("",!0),u[4]||(u[4]=n("p",{class:"text-xs text-neutral-400 bg-neutral-900 rounded p-3 mb-2"},"Upload custom fonts to use in your output. Supported formats: TTF, OTF, WOFF, WOFF2. Maximum file size: 3MB.",-1)),v(Eo,null,{default:L(()=>[...u[3]||(u[3]=[n("p",{class:"mb-2"},"Some fonts may cause problems when used for countdowns.",-1)])]),_:1})])}}},Nk=Oe(Pk,[["__scopeId","data-v-98308440"]]),Hk=["for"],Vk=["src"],jk={ke
15y:2,class:"w-[100px] aspect-w-16 aspect-h-9"},qk=["id","value","disabled"],Wk={class:"mt-1 text-xs text-center text-neutral-500"},Gk={__name:"ImageRadioItem",props:{selected:{type:String,default:null},value:{type:String,default:null},label:{type:String,default:""},image:{type:String,default:""},disabled:Boolean},emits:["update:selected"],setup(e,{emit:l}){const s=l,t=e,a=O({get(){return t.selected},set(o){t.disabled||s("update:selected",o)}});return(o,i)=>(x(),$("label",{class:j(["relative block text-neutral-700",{"hover:text-sky-500 focus-within:text-sky-500 cursor-pointer":!e.disabled,"!text-sky-500":e.selected===e.value&&!e.disabled,"opacity-50":e.disabled}]),for:e.value},[n("div",{class:j(["rounded border border-current overflow-hidden",{"ring ring-current":e.selected===e.value&&!e.disabled,"bg-placeholder":!e.image||String(e.image).endsWith("png")}])},[String(e.image).startsWith("#")?(x(),$("div",{key:0,class:"w-[100px] aspect-w-16 aspect-h-9",style:$e({"background-color":e.image})},null,4)):e.image?(x(),$("img",{key:1,src:e.image,class:"block w-[100px]",alt:""},null,8,Vk)):(x(),$("div",jk))],2),me(n("input",{id:e.value,"onUpdate:modelValue":i[0]||(i[0]=r=>a.value=r),value:e.value,disabled:e.disabled,type:"radio",class:"sr-only"},null,8,qk),[[vu,a.value]]),n("p",Wk,q(e.label),1)],10,Hk))}},Xk={class:"flex flex-wrap gap-4"},_l={__name:"ImageRadio",props:{selected:{type:String,default:null},options:{type:Array,default:()=>[]},disabled:Boolean},emits:["update:selected"],setup(e,{emit:l}){const s=l,t=e;return(a,o)=>(x(),$("ul",Xk,[(x(!0),$(ee,null,ge(t.options,i=>(x(),$("li",{key:i.value},[v(Gk,{selected:t.selected,value:i.value,label:i.label,image:i.image,disabled:t.disabled,"onUpdate:selected":o[0]||(o[0]=r=>s("update:selected",r))},null,8,["selected","value","label","image","disabled"])]))),128))]))}},Yk=["disabled"],Kk={__name:"ColorDot",props:{color:{type:String,default:"#FFFFFF"},disabled:Boolean},emits:["update:color"],setup(e,{emit:l}){const s=l,t=e;return(a,o)=>(x(),Z(g(eo),{distance:6,placement:"left"},{popper:L(()=>[v(g(Kl),{color:e.color,"visible-formats":["hex"],"default-format":"hex","alpha-channel":"hide",onColorChange:o[0]||(o[0]=({cssColor:i})=>s("update:color",i))},null,8,["color"])]),default:L(()=>[n("button",{class:j(["block w-7 h-7 rounded-full text-neutral-700 ring-current shadow-inner",{"hover:text-sky-500 hover:ring":!t.disabled,"opacity-50":t.disabled}]),style:$e({"background-color":t.color,"box-shadow":"0 0 .3em rgba(0,0,0,.3) inset"}),disabled:t.disabled},null,14,Yk)]),_:1}))}},Ut=Oe(Kk,[["__scopeId","data-v-f464fcdc"]]);var Zk=Td();const Qk=ln(Zk),Jk={class:"flex"},e$={__name:"CustomizeTheme",props:{theme:{type:Object,required:!0},disabled:Boolean},emits:["update:theme"],setup(e,{emit:l}){const s=F(ue.themeNames.CUSTOM),t=l,a=e;De(()=>{s.value=f(a.theme)});function o(u){s.value=u,t("update:theme",Q(Q({},a.theme),ue.themeObjects[u]))}function i(u,m){if(m===Qk(a.theme,u))return;s.value!==ue.themeNames.CUSTOM&&(s.value=ue.themeNames.CUSTOM);const b=Q({},a.theme);zd(b,u,m),t("update:theme",b)}function r(u){s.value=ue.themeNames.CUSTOM,t("update:theme",re(Q({},a.theme),{textStyle:u}))}const p=[{value:ue.themeNames.CUSTOM,label:"Custom",image:"/spa-assets/customize/theme-custom.svg"},{value:ue.themeNames.DEFAULT,label:"Default",image:"/spa-assets/customize/theme-default.svg"},{value:ue.themeNames.LIGHT,label:"Light",image:"/spa-assets/customize/theme-light.svg"},{value:ue.themeNames.CONTRAST_DARK,label:"Contrast Dark",image:"/spa-assets/customize/theme-contrast-dark.svg"},{value:ue.themeNames.CONTRAST_LIGHT,label:"Contrast Light",image:"/spa-assets/customize/theme-contrast-light.svg"},{value:ue.themeNames.CANDY,label:"Candy",image:"/spa-assets/customize/theme-candy.svg"},{value:ue.themeNames.MATRIX,label:"Matrix",image:"/spa-assets/customize/theme-matrix.svg"},{value:ue.themeNames.MONOKAI,label:"Monokai",image:"/spa-assets/customize/theme-monokai.svg"},{value:ue.themeNames.GRUVBOX,label:"Gruvbox",image:"/spa-assets/customize/theme-gruvbox.svg"}],d=[{value:ue.textStyles.DEFAULT,label:"Default",image:"/spa-assets/customize/text-default.svg"},{value:ue.textStyles.OUTLINE,label:"Outline",image:"/spa-assets/customize/text-outline.svg"},{value:ue.textStyles.SHADOW,label:"Shadow",image:"/spa-assets/customize/text-shadow.svg"}];function f(u){for(const m in ue.themeObjects)if(m!==ue.themeNames.CUSTOM&&zi(ue.themeObjects[m],Js(u)))return m;return ue.themeNames.CUSTOM}return(u,m)=>{var b,c,w,h,y,S,D,k,M,I,R,T;return x(),$(ee,null,[v(_l,{"data-label":"customize-theme-radio",class:"!mt-4",disabled:a.disabled,selected:s.value,options:p,"onUpdate:selected":o},null,8,["disabled","selected"]),m[16]||(m[16]=n("hr",{class:"border-neutral-700"},null,-1)),m[17]||(m[17]=n("h4",{class:"font-semibold"}," Customize Colors ",-1)),n("table",null,[n("tbody",null,[n("tr",null,[m[9]||(m[9]=n("th",null,"Header",-1)),n("td",null,[v(Ut,{disabled:a.disabled,color:(b=a.theme)==null?void 0:b.header,"onUpdate:color":m[0]||(m[0]=C=>i("header",C))},null,8,["disabled","color"])]),m[10]||(m[10]=n("th",null,"Footer",-1)),n("td",null,[v(Ut,{disabled:a.disabled,color:(c=a.theme)==null?void 0:c.footer,"onUpdate:color":m[1]||(m[1]=C=>i("footer",C))},null,8,["disabled","color"])])]),n("tr",null,[m[11]||(m[11]=n("th",null,"Countdown",-1)),n("td",null,[v(Ut,{disabled:a.disabled,color:(w=a.theme)==null?void 0:w.countdown,"onUpdate:color":m[2]||(m[2]=C=>i("countdown",C))},null,8,["disabled","color"])]),m[12]||(m[12]=n("th",null,"Time of Day",-1)),n("td",null,[v(Ut,{disabled:a.disabled,color:(h=a.theme)==null?void 0:h.tod,"onUpdate:color":m[3]||(m[3]=C=>i("tod",C))},null,8,["disabled","color"])])]),n("tr",null,[m[13]||(m[13]=n("th",null,"Message",-1)),n("td",null,[v(Ut,{disabled:a.disabled,color:(y=a.theme)==null?void 0:y.message,"onUpdate:color":m[4]||(m[4]=C=>i("message",C))},null,8,["disabled","color"])])]),n("tr",null,[m[14]||(m[14]=n("th",null,"Progress",-1)),n("td",Jk,[v(Ut,{disabled:a.disabled,color:(D=(S=a.theme)==null?void 0:S.progress)==null?void 0:D[0],"onUpdate:color":m[5]||(m[5]=C=>i("progress[0]",C))},null,8,["disabled","color"]),v(Ut,{disabled:a.disabled,color:(M=(k=a.theme)==null?void 0:k.progress)==null?void 0:M[1],"onUpdate:color":m[6]||(m[6]=C=>i("progress[1]",C))},null,8,["disabled","color"]),v(Ut,{disabled:a.disabled,color:(R=(I=a.theme)==null?void 0:I.progress)==null?void 0:R[2],"onUpdate:color":m[7]||(m[7]=C=>i("progress[2]",C))},null,8,["disabled","color"])]),m[15]||(m[15]=n("th",null,"Backgroun
15d",-1)),n("td",null,[v(Ut,{disabled:a.disabled,color:(T=a.theme)==null?void 0:T.bg,"onUpdate:color":m[8]||(m[8]=C=>i("bg",C))},null,8,["disabled","color"])])])])]),m[18]||(m[18]=n("hr",{class:"border-neutral-700"},null,-1)),m[19]||(m[19]=n("h4",{class:"font-semibold"}," Text Style ",-1)),v(_l,{"data-label":"customize-text-style-radio",disabled:a.disabled,selected:a.theme.textStyle,options:d,"onUpdate:selected":r},null,8,["disabled","selected"])],64)}}},t$=Oe(e$,[["__scopeId","data-v-3380c945"]]),n$={key:0},l$={__name:"CustomizeBackground",props:{settings:{type:Object,required:!0},backgroundColor:{type:String,default:"#1C1918"},roomPid:{type:String,required:!0},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=l,t=e,a=O({get:()=>Object.values(ue.backgrounds).includes(t.settings.image)?t.settings.image:ue.backgrounds.CUSTOM,set:p=>i(p)}),o=O({get:()=>t.settings.image===ue.backgrounds.CUSTOM?"":t.settings.image,set:p=>i(p)});function i(p){s("update:settings",{image:p})}const r=O(()=>[{value:ue.backgrounds.CUSTOM,label:"Upload Image",image:"/spa-assets/customize/background-upload.png"},{value:ue.backgrounds.DEFAULT,label:"Default",image:t.backgroundColor},{value:ue.backgrounds.TRANSPARENT,label:"Transparent",image:""},{value:ue.backgrounds.BLUE,label:"Corporate",image:"/spa-assets/customize/background-blue-480.jpg"},{value:ue.backgrounds.PARCHMENT,label:"Parchment",image:"/spa-assets/customize/background-parchment-480.jpg"},{value:ue.backgrounds.CROWD,label:"Crowd",image:"/spa-assets/customize/background-crowd-480.jpg"},{value:ue.backgrounds.PENCILS,label:"Pencils",image:"/spa-assets/customize/background-pencils-480.jpg"},{value:ue.backgrounds.STARS,label:"Stars",image:"/spa-assets/customize/background-stars-480.jpg"},{value:ue.backgrounds.STREET,label:"Street",image:"/spa-assets/customize/background-street-480.jpg"}]);return(p,d)=>(x(),$(ee,null,[a.value===g(ue).backgrounds.CUSTOM?(x(),$("div",n$,[v(on,{"file-formats":["JPG","PNG"],"base-path":"images/","post-url":`/files/for-room/${e.roomPid}`,"image-size":"cover",disabled:t.disabled,img:o.value,"onUpdate:img":i},null,8,["post-url","disabled","img"]),d[1]||(d[1]=n("hr",{class:"border-neutral-700 my-4"},null,-1))])):N("",!0),v(_l,{selected:a.value,"onUpdate:selected":d[0]||(d[0]=f=>a.value=f),options:r.value,disabled:t.disabled,class:"!mt-4","data-label":"customize-background-radio"},null,8,["selected","options","disabled"])],64))}},s$={class:"flex text-xs"},o$=["disabled"],a$=["disabled"],i$=["disabled"],r$=["disabled"],Wn={__name:"CustomizeFontInput",props:{modelValue:{type:Array,default:()=>[]},disabled:Boolean,hideFontWeight:Boolean,customFonts:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:l}){const s=l,t=e;function a(d,f){var m;const u=[...t.modelValue];if(u[d]=f,d===0){const b=(m=t.customFonts)==null?void 0:m.find(c=>c.name===f);b!=null&&b.url?u[3]=b.url:u[3]=null}s("update:modelValue",u)}const o=ue.fontWeights,i=ue.fontSizes,r=Object.values(ue.fonts).map(d=>({value:d,label:d})),p=O(()=>{var f;const d=[...r];return(f=t.customFonts)==null||f.forEach(u=>{d.push({value:u.name,label:u.name})}),d});return(d,f)=>(x(),$("div",s$,[v(he,{"data-label":"select-font",class:"flex-1 mr-2","select-class":"h-7",width:"100%",size:"xs",disabled:t.disabled,options:p.value,"model-value":t.modelValue[0],"onUpdate:modelValue":f[0]||(f[0]=u=>a(0,u))},null,8,["disabled","options","model-value"]),e.hideFontWeight?N("",!0):(x(),$("button",{key:0,class:j(["flex-none btn-ctrl bg-neutral-900 border-0 h-7 w-7 p-0 mr-2",{"!bg-white !text-black":t.modelValue[1]===g(o).SEMIBOLD,"opacity-50":t.disabled}]),disabled:t.disabled,onClick:f[1]||(f[1]=u=>a(1,t.modelValue[1]===g(o).REGULAR?g(o).SEMIBOLD:g(o).REGULAR))}," B ",10,o$)),n("button",{class:j(["flex-none btn-ctrl bg-neutral-900 border-0 rounded-r-none h-7 w-7 p-0",{"!bg-white !text-black":t.modelValue[2]===g(i).SM,"opacity-50":t.disabled}]),style:{"font-size":"10px"},disabled:t.disabled,onClick:f[2]||(f[2]=u=>a(2,g(i).SM))}," A ",10,a$),n("button",{class:j(["flex-none btn-ctrl bg-neutral-900 border-0 rounded-none h-7 w-7 p-0 mx-px",{"!bg-white !text-black":t.modelValue[2]===g(i).MD,"opacity-50":t.disabled}]),style:{"font-size":"14px"},disabled:t.disabled,onClick:f[3]||(f[3]=u=>a(2,g(i).MD))}," A ",10,i$),n("button",{class:j(["flex-none btn-ctrl bg-neutral-900 border-0 rounded-l-none h-7 w-7 p-0",{"!bg-white !text-black":t.modelValue[2]===g(i).LG,"opacity-50":t.disabled}]),style:{"font-size":"18px"},disabled:t.disabled,onClick:f[4]||(f[4]=u=>a(2,g(i).LG))}," A ",10,r$)]))}},u$={class:"max-w-full"},d$={__name:"CustomizeHeaderFooter",props:{settings:{type:Object,required:!0},fonts:{type:Array,default:()=>[]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=l,t=e;function a(i,r){s("update:settings",re(Q({},t.settings),{[i]:r}))}const o=[{value:ue.headerFooterPositions.HEADER,label:"Show in header"},{value:ue.headerFooterPositions.FOOTER,label:"Show in footer"},{value:ue.headerFooterPositions.NONE,label:"Don't show"}];return(i,r)=>(x(),$("table",u$,[n("tbody",null,[n("tr",null,[r[5]||(r[5]=n("th",null,"Title",-1)),n("td",null,[v(he,{"data-label":"customize-title-position","select-class":"h-7 w-full",size:"xs",width:"100%",disabled:e.disabled,options:o,"model-value":t.settings.titlePos,"onUpdate:modelValue":r[0]||(r[0]=p=>a("titlePos",p))},null,8,["disabled","model-value"])])]),n("tr",null,[r[6]||(r[6]=n("th",null,"Speaker",-1)),n("td",null,[v(he,{"data-label":"customize-speaker-position","select-class":"h-7 w-full",size:"xs",width:"100%",disabled:e.disabled,options:o,"model-value":t.settings.speakerPos,"onUpdate:modelValue":r[1]||(r[1]=p=>a("speakerPos",p))}
15,null,8,["disabled","model-value"])])]),n("tr",null,[r[7]||(r[7]=n("th",null,"Next Cue",-1)),n("td",null,[v(he,{"data-label":"customize-next-cue-position","select-class":"h-7 w-full",size:"xs",width:"100%",disabled:e.disabled,options:o,"model-value":t.settings.nextCuePos,"onUpdate:modelValue":r[2]||(r[2]=p=>a("nextCuePos",p))},null,8,["disabled","model-value"])])]),n("tr",null,[r[8]||(r[8]=n("th",null,"Header",-1)),n("td",null,[v(Wn,{"data-label":"customize-header-styling",disabled:e.disabled,"custom-fonts":t.fonts,"model-value":t.settings.headerStyling,"onUpdate:modelValue":r[3]||(r[3]=p=>a("headerStyling",p))},null,8,["disabled","custom-fonts","model-value"])])]),n("tr",null,[r[9]||(r[9]=n("th",null,"Footer",-1)),n("td",null,[v(Wn,{"data-label":"customize-footer-styling",disabled:e.disabled,"custom-fonts":t.fonts,"model-value":t.settings.footerStyling,"onUpdate:modelValue":r[4]||(r[4]=p=>a("footerStyling",p))},null,8,["disabled","custom-fonts","model-value"])])])])]))}},c$=Oe(d$,[["__scopeId","data-v-9be338e5"]]),m$={class:"w-full"},p$={class:"w-full"},f$={__name:"CustomizeTimer",props:{settings:{type:Object,required:!0},fonts:{type:Array,default:()=>[]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=je("countdownFormat",J.HHHMMSS),t=je("todFormat",ce.AUTO),a=l,o=e;function i(d,f){a("update:settings",re(Q({},o.settings),{[d]:f}))}const r=[{value:null,label:"Room Default: "+yt[s.value]},{value:"divider",label:"---",disabled:!0},...[J.DHHMMSS,J.DHHMMSSF,J.HHHMMSS,J.HHHMMSSF,J.MMMSS,J.MMMSSF,J.SSS,J.SSSF].map(d=>({value:d,label:yt[d]})),{value:"divider",label:"---",disabled:!0},...[J.L_D,J.L_DH,J.L_DHM,J.L_DHMS,J.L_HMS,J.L_MS,J.L_S].map(d=>({value:d,label:yt[d]}))],p=[{value:null,label:"Room Default: "+nn[t.value]},{value:"divider",label:"---",disabled:!0},...[ce.AUTO,ce.AUTO_HHMM,ce.HHMMSS,ce.HHMM,ce.HHMMSS_AM,ce.HHMM_AM,ce.HHMMSS_12H,ce.HHMM_12H].map(d=>({value:d,label:nn[d]}))];return(d,f)=>(x(),$(ee,null,[f[8]||(f[8]=n("h4",{class:"font-semibold"}," Countdown / Count up ",-1)),n("table",m$,[n("tbody",null,[n("tr",null,[f[4]||(f[4]=n("th",null,"Format",-1)),n("td",null,[v(he,{"data-label":"customize-timer-format","select-class":"h-7 w-full",size:"xs",width:"100%",disabled:o.disabled,options:r,"model-value":o.settings.countdownFormat,"onUpdate:modelValue":f[0]||(f[0]=u=>i("countdownFormat",u))},null,8,["disabled","model-value"])])]),n("tr",null,[f[5]||(f[5]=n("th",null,"Styling",-1)),n("td",null,[v(Wn,{"data-label":"customize-timer-styling",disabled:o.disabled,"model-value":o.settings.countdownStyling,"custom-fonts":o.fonts,"onUpdate:modelValue":f[1]||(f[1]=u=>i("countdownStyling",u))},null,8,["disabled","model-value","custom-fonts"])])])])]),f[9]||(f[9]=n("hr",{class:"border-neutral-700"},null,-1)),f[10]||(f[10]=n("h4",{class:"font-semibold"}," Time of Day (Clock) ",-1)),n("table",p$,[n("tbody",null,[n("tr",null,[f[6]||(f[6]=n("th",null,"Format",-1)),n("td",null,[v(he,{"data-label":"customize-tod-format","select-class":"h-7 w-full",size:"xs",width:"100%",disabled:o.disabled,options:p,"model-value":o.settings.todFormat,"onUpdate:modelValue":f[2]||(f[2]=u=>i("todFormat",u))},null,8,["disabled","model-value"])])]),n("tr",null,[f[7]||(f[7]=n("th",null,"Styling",-1)),n("td",null,[v(Wn,{"data-label":"customize-tod-styling",disabled:o.disabled,"custom-fonts":o.fonts,"model-value":o.settings.todStyling,"onUpdate:modelValue":f[3]||(f[3]=u=>i("todStyling",u))},null,8,["disabled","custom-fonts","model-value"])])])])])],64))}},b$=Oe(f$,[["__scopeId","data-v-740f1a59"]]),v$={class:"max-w-full"},g$={__name:"CustomizeMessage",props:{settings:{type:Object,required:!0},fonts:{type:Array,default:()=>[]},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=l,t=e;function a(o,i){s("update:settings",re(Q({},t.settings),{[o]:i}))}return(o,i)=>(x(),$("table",v$,[n("tbody",null,[n("tr",null,[i[1]||(i[1]=n("th",null,"Styling",-1)),n("td",null,[v(Wn,{"data-label":"customize-message-styling",disabled:e.disabled,"hide-font-weight":"","custom-fonts":t.fonts,"model-value":t.settings.styling,"onUpdate:modelValue":i[0]||(i[0]=r=>a("styling",r))},null,8,["disabled","custom-fonts","model-value"])])])])]))}},h$=Oe(g$,[["__scopeId","data-v-71aecf3c"]]),x$={__name:"CustomizeProgress",props:{settings:{type:Object,required:!0},disabled:Boolean},emits:["update:settings"],setup(e,{emit:l}){const s=l,t=e;function a(i,r){s("update:settings",re(Q({},t.settings),{[i]:r}))}const o=[{value:ue.progressTypes.BAR_BOTTOM,label:"Bottom Bar",image:"/spa-assets/customize/progress-bar-bottom.svg"},{value:ue.progressTypes.BAR_TOP,label:"Top Bar",image:"/spa-assets/customize/progress-bar-top.svg"},{value:ue.progressTypes.RING,label:"Ring",image:"/spa-assets/customize/progress-ring.svg"},{value:ue.progressTypes.NONE,label:"Hidden",image:"/spa-assets/customize/progress-none.svg"}];return(i,r)=>(x(),Z(_l,{"data-label":"customize-progress-radio",class:"!mt-4",disabled:t.disabled,selected:t.settings.type,options:o,"onUpdate:selected":r[0]||(r[0]=p=>a("type",p))},null,8,["disabled","selected"]))}},w$={class:"flex customize-modal-inner-height border-t border-blue-800"},y$={class:"flex-1 p-4 overflow-auto"},k$={class:"flex justify-center items-center"},$$={class:"flex-none w-[400px] border-l border-neutral-700 overflow-auto"},S$={key:0,class:"border-b border-neutral-700 p-4 space-y-2"},C$={class:"border-b border-neutral-700 p-4 pb-8 space-y-2"},M$={class:"border-b border-neutral-700 p-4 pb-8 space-y-2"},T$={class:"border-b border-neutral-700 p-4 pb-8 space-y-2"},z$={key:1,class:"border-b border-neutral-700 p-4 space-y-2"},I$={class:"border-b border-neutral-700 p-4 pb-8 space-y-2"},O$={class:"border-b border-neutral-700 p-4 pb-8 space-y-2"},D$={class:"border-b border-neutral-700 p-4 pb-8 space-y-2"},E$={class:"border-b border-neutral-700 p-4 pb-8 space-y-2"},U$={class:"border-b border-neutral-700 p-4 pb-8 space-y-2"},L$={key:2,class:"pt-4 px-4"},R$={class:"p-4 text-right space-x-4"},A$=["disabled"],_$={__name:"CustomizeModal.LEGACY",props:{open:Boolean},emits:["update:open"],setup(e,{emit:l}){const s=Fe(),t=kn(),a=Yn(),o=l,i=e,r=F(null),p=F(!1),d=ht({logo:{},fonts:{},theme:{},background:{},headerFooter:{},timer:{},message:{},progress:{},blackout:!1});De(f);function f(){Object.assign(d,Ii(s.settings,["blackout"]))}ls("todFormat",O(()=>s.settings.todFormat)),ls("countdownFormat",O(()=>s.settings.countdownFormat)),ls("behavior",O(()=>s.settings.behavior));function u(c){const{name:w,url:h}=c;d.headerFooter.footerStyling[0]=w,d.headerFooter.footerStyling[3]=h,d.headerFooter.headerStyling[0]=w,d.headerFooter.headerStyling[3]=h,d.message.styling[0]=w,d.message.styling[3]=h,d.timer.countdownStyling[0]=w,d.timer.countdownStyling[3]=h,d.timer.todStyling[0]=w,d.timer.todStyling[3]=h}function m(){return le(this,null,function*(){yield de(se.patch(`/rooms/${s.pid}/settings`,d),(c,w)=>{s.updateSettings(c,w),o("update:open",!1)},()=>p.value=!0,()=>p.value=!1,c=>r.value=c)})}function b(){o("update:open",!1)}return(c,w)=>(x(),Z(Le,{open:i.open,title:"Customize Logo and Theme",icon:g(Id),"width-class":"customize-modal-outer-height","body-class":"pt-3 pb-0","data-label":"modal-controller-customize","body-flush":"",closable:"","ignore-outside-click":"","hide-footer":"","onUpdate:open":w[8]||(w[8]=h=>o("update:open",h)),onShow:f},{default:L(()=>{var h,y,S;return[w[28]||(w[28]=n("div",{class:"bg-blue-900 border-t border-blue-800 px-6 h-8 leading-8 text-stone-200 text-sm"},[n("strong",null,"Legacy Feature:"),U(' This customizer will be removed at the end of 2026. Please use "Output Links" instead. ')],-1)),n("div",w$,[n("div",y$,[n("div",k$,[v(vk,{class:"w-full max-w-4xl",now:g(t).now,settings:d,plan:g(s).plan},null,8,["now","settings","plan"])])]),n("aside",$$,[g(Ee.planCan)(g(s).plan,g(Ee.permissions).LICENSED)?N("",!0):(x(),$("div",S$,[v(It,{plan:"Pro"},{default:L(()=>[...w[9]||(w[9]=[U(" Basic customizations require a licensed. Upgrade now to unlock this and many other powerful features. ",-1)])]),_:1})])),n("div",C$,[w[10]||(w[10]=n("h3",{class:"text-xl font-semibold"},"Logo",-1)),w[11]||(w[11]=n("hr",{class:"border-neutral-700"},null,-1)),v(Tk,{settings:d.logo,"onUpdate:settings":w[0]||(w[0]=D=>d.logo=D),"room-pid":g(s).pid,disabled:!g(Ee.planCan)(g(s).plan,g(Ee.permissions).CUSTOM_LOGO)},null,8,["settings","room-pid","disabled"])]),n("div",M$,[w[12]||(w[12]=n("h3",{class:"text-xl font-semibold"},"Timer",-1)),w[13]||(w[13]=n("hr",{class:"border-neutral-700"},null,-1)),v(b$,{settings:d.timer,"onUpdate:settings":w[1]||(w[1]=D=>d.timer=D),fonts:((h=d.fonts)==null?void 0:h.typefaces)||[],disabled:!g(Ee.planCan)(g(s).plan,g(Ee.permissions).LICENSED)},null,8,["settings","fonts","disabled"])]),n("div",T$,[w[14]||(w[14]=n("h3",{class:"text-xl font-semibold"},"Message",-1)),w[15]||(w[15]=n("hr",{class:"border-neutral-700"},null,-1)),v(h$,{settings:d.message,"onUpdate:settings":w[2]||(w[2]=D=>d.message=D),fonts:((y=d.fonts)==null?void 0:y.typefaces)||[],disabled:!g(Ee.planCan)(g(s).plan,g(Ee.permissions).LICENSED)},null,8,["settings","fonts","disabled"])]),g(Ee.planCan)(g(s).plan,g(Ee.permissions).LICENSED)&&!g(Ee.planCan)(g(s).plan,g(Ee.permissions).CUSTOM_THEMING)?(x(),$("div",z$,[v(It,{plan:"Premium"},{default:L(()=>[...w[16]||(w[16]=[U(" Full customization require an upgrade. ",-1)])]),_:1})])):N("",!0),n("div",I$,[w[17]||(w[17]=n("h3",{class:"text-xl font-semibold"},"Fonts",-1)),w[18]||(w[18]=n("hr",{class:"border-neutral-700"},null,-1)),v(Nk,{settings:d.fonts,"onUpdate:settings":w[3]||(w[3]=D=>d.fonts=D),uid:g(a).uid,disabled:!g(Ee.planCan)(g(s).plan,g(Ee.permissions).CUSTOM_THEMING),onSetFonts:u},null,8,["settings","uid","disabled"])]),n("div",O$,[w[19]||(w[19]=n("h3",{class:"text-xl font-semibold"},"Theme",-1)),w[20]||(w[20]=n("hr",{class:"border-neutral-700"},null,-1)),v(t$,{theme:d.theme,"onUpdate:theme":w[4]||(w[4]=D=>d.theme=D),disabled:!g(Ee.planCan)(g(s).plan,g(Ee.permissions).CUSTOM_THEMING)},null,8,["theme","disabled"])]),n("div",D$,[w[21]||(w[21]=n("h3",{class:"text-xl font-semibold"}
15,"Background",-1)),w[22]||(w[22]=n("hr",{class:"border-neutral-700"},null,-1)),v(l$,{settings:d.background,"onUpdate:settings":w[5]||(w[5]=D=>d.background=D),"background-color":d.theme.bg,"room-pid":g(s).pid,disabled:!g(Ee.planCan)(g(s).plan,g(Ee.permissions).CUSTOM_THEMING)},null,8,["settings","background-color","room-pid","disabled"])]),n("div",E$,[w[23]||(w[23]=n("h3",{class:"text-xl font-semibold"},"Header / Footer",-1)),w[24]||(w[24]=n("hr",{class:"border-neutral-700"},null,-1)),v(c$,{settings:d.headerFooter,"onUpdate:settings":w[6]||(w[6]=D=>d.headerFooter=D),fonts:((S=d.fonts)==null?void 0:S.typefaces)||[],disabled:!g(Ee.planCan)(g(s).plan,g(Ee.permissions).CUSTOM_THEMING)},null,8,["settings","fonts","disabled"])]),n("div",U$,[w[25]||(w[25]=n("h3",{class:"text-xl font-semibold"},"Progress",-1)),w[26]||(w[26]=n("hr",{class:"border-neutral-700"},null,-1)),v(x$,{settings:d.progress,"onUpdate:settings":w[7]||(w[7]=D=>d.progress=D),disabled:!g(Ee.planCan)(g(s).plan,g(Ee.permissions).CUSTOM_THEMING)},null,8,["settings","disabled"])]),r.value?(x(),$("div",L$,[v(_t,{error:r.value},null,8,["error"])])):N("",!0),n("div",R$,[n("button",{"data-label":"customize-btn-discard",class:"btn-ctrl h-10 px-6",onClick:b}," Discard "),n("button",{"data-label":"customize-btn-save",class:j(["btn-ctrl !bg-teal-800 border-teal-600 hover:!border-teal-300 !text-white h-10 px-6",{"bg-animated from-teal-900 to-teal-800":p.value}]),disabled:p.value,onClick:m},[...w[27]||(w[27]=[n("span",null,"Save",-1)])],10,A$)])])])]}),_:1},8,["open","icon"]))}},F$={__name:"ShortcutHandler",setup(e){function l(t){if(!so(t))switch(t.key){case"ArrowLeft":return s(Wr);case"ArrowRight":return s(Gr);case" ":return t.preventDefault(),s(Xr);case"b":return s(Yr);case"o":return s(Kr);case"f":return s(Zr)}}function s(t){ze.$emit("shortcut",t)}return De(()=>{window.addEventListener("keydown",l)}),Bl(()=>{window.removeEventListener("keydown",l)}),(t,a)=>null}},B$={info:Ki,error:Ud,success:Ed},hl=new Map;function P$(){const e=Ai(),l=Fe();function s(o,i){return le(this,null,function*(){qi(1)&&console.debug("[useAdminNotifications] respond",o,i);try{yield se.post("/aux/notification-respond",{notificationId:o,button:i,roomPid:l.pid,roomName:l.name})}catch(r){console.error("[useAdminNotifications] Failed to send response:",r)}t(o)})}function t(o){const i=hl.get(o);i&&(i.notificationStoreId&&e.remove(i.notificationStoreId),i.dismissTimeout&&clearTimeout(i.dismissTimeout),hl.delete(o))}function a(o){const{notificationId:i,title:r,text:p,type:d,duration:f,buttons:u,expiresAt:m}=o;t(i);const b=m?m-Date.now():null;if(b!==null&&b<=0)return;const c=u!=null&&u.length?Od:f||Dd,w={type:B$[d]||Ki,title:r||"Admin Notification",text:p||"",duration:c};u!=null&&u.length&&(w.buttons=u.map(S=>({label:S.label,action:()=>s(i,S.label)})));const y={notificationStoreId:e.trigger(w),dismissTimeout:null};b&&(u!=null&&u.length)&&(y.dismissTimeout=setTimeout(()=>{t(i)},b)),hl.set(i,y)}De(()=>{Fs.$on("admin-notification",a)}),Qe(()=>{Fs.$off("admin-notification",a);for(const o of hl.keys())t(o)})}function N$(){var t,a;if(!((a=(t=window.api)==null?void 0:t.ndi)!=null&&a.registerRoom))return;const e=Fe(),l=ao(),s=F(!1);window.api.ndi.getStatus().then(o=>{s.value=o.enabled}),window.api.ndi.onStatus(o=>{s.value=o.enabled}),Te(()=>[e.pid,e.name,s.value,l.list],()=>{s.value&&(!e.pid||l.list.length===0||window.api.ndi.registerRoom({roomPid:e.pid,roomName:e.name||"Unnamed",outputs:l.list.map(o=>({id:o._id,name:o.name}))}))},{immediate:!0})}const H$={class:"controller-header p-3"},V$={class:"controller-body relative lg:flex"},j$={class:"controller-aside flex-none lg:h-full lg:overflow-y-auto",style:{"flex-basis":"var(--width-aside)"}},q$={class:"lg:hidden px-3 py-4 space-y-4"},W$={class:"controller-footer lg:flex items-center py-4 space-y-4 lg:py-0 lg:space-y-0"},G$={class:"flex-initial min-w-0 text-center lg:text-left !h-auto px-3 lg:px-4",style:{"flex-basis":"var(--width-aside)"}},X$={class:"hidden lg:block flex-auto px-3 lg:px-4"},Y$={__name:"Controller",setup(e){const l=Ld(),s=wt(),t=Wi();P$(),N$();
15const a=ht({settings:!1,output:!1,shortcuts:!1,legacyMigration:!1,legacyLinks:!1,legacyCustomize:!1});De(()=>{var I;if(ze.$on("open-modal:settings",o),ze.$on("open-modal:output",i),ze.$on("open-modal:shortcuts",r),ze.$on("open-modal:legacy-migration",p),ze.$on("open-modal:legacy-links",d),ze.$on("open-modal:legacy-customize",f),(I=window.api)!=null&&I.receive){const R=l.params.roomPid;window.api.receive("request-close-if-room",({roomPid:T})=>{R===T&&(console.info("[CONTROLLER] Room deleted, closing window"),window.close())})}}),Qe(()=>{ze.$off("open-modal:settings",o),ze.$off("open-modal:output",i),ze.$off("open-modal:shortcuts",r),ze.$off("open-modal:legacy-migration",p),ze.$off("open-modal:legacy-links",d),ze.$off("open-modal:legacy-customize",f)});function o(){a.settings=!0}function i(){a.output=!0}function r(){a.shortcuts=!0}function p(){a.legacyMigration=!0}function d(){a.legacyLinks=!0}function f(){a.legacyCustomize=!0}const u=F("timers"),m=F(null),b=F({aside:330,timers:580,messages:240,switcher:0}),c=O(()=>({aside:330,timers:620,messages:240,switcher:64})),w={aside:.25,timers:.5,messages:.25};function h(I,R){I.preventDefault(),m.value=R,document.addEventListener("mousemove",y),document.addEventListener("mouseup",S)}function y(I){I.preventDefault(),k(m.value,I.clientX)}function S(I){I.preventDefault(),m.value=null,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",S)}De(()=>{window.addEventListener("resize",D),document.addEventListener("visibilitychange",D)}),Qe(()=>{window.removeEventListener("resize",D),document.removeEventListener("visibilitychange",D)});function D(){document.hidden||k(3,window.innerWidth)}function k(I,R){const T=Q({},b.value),C=window.innerWidth,E=c.value.aside,_=Math.max(E,C-c.value.timers-c.value.switcher),P=c.value.timers,A=Math.max(P,C-T.aside-c.value.switcher);I===1&&(T.aside=tt(R,E,_)),I===2&&(T.timers=tt(R-T.aside,P,A),T.timers===P&&C-R>c.value.messages&&(T.aside=tt(R-T.timers,E,_))),I===3&&(T.messages=tt(R-T.aside-T.timers,0,99999),T.messages===0&&(T.timers=tt(R-T.aside-c.value.switcher,P,A))),T.messages=C-(T.aside+T.timers),T.messages<c.value.messages?(T.messages=0,T.switcher=c.value.switcher,T.timers=tt(C-T.aside-T.switcher,P,A)):T.switcher=0,b.value=T}De(()=>M());function M(){const I=Q({},b.value);I.aside=tt(Math.floor(window.innerWidth*w.aside),c.value.aside,450),I.timers=tt(Math.floor(window.innerWidth*w.timers),c.value.timers,9999);const R=window.innerWidth-I.aside-I.timers;I.messages=tt(Math.floor(window.innerWidth*w.messages),0,R),I.messages<c.value.messages&&(I.messages=0,I.switcher=c.value.switcher,I.timers=window.innerWidth-I.aside-I.switcher),b.value=I}return Te(()=>[s.isSelectMode,t.isSelectMode],([I,R],[T,C]=[])=>{I&&!T&&R&&t.exitSelectMode(),R&&!C&&I&&s.exitSelectMode()}),(I,R)=>(x(),$("main",{class:"controller-page overflow-x-hidden","data-label":"controller-page",style:$e({"--width-aside":`${b.value.aside}px`,"--width-timers":`${u.value==="messages"&&b.value.messages===0?0:b.value.timers}px`,"--width-messages":`${u.value==="messages"&&b.value.messages===0?b.value.timers:b.value.messages}px`,"--width-switcher":`${b.value.switcher}px`})},[n("header",H$,[v(Rx,{class:"w-full"})]),n("div",V$,[n("aside",j$,[v(Jh,{onOutputModal:R[0]||(R[0]=T=>a.output=!a.output)})]),n("div",{class:j(["controller-timers flex-none lg:h-full",{"flex-none":b.value.messages!==0,"flex-auto":b.value.messages===0,"lg:hidden":u.value!=="timers"&&b.value.messages===0}]),style:{"flex-basis":"var(--width-timers)"}},[v(d3,{width:b.value.timers},null,8,["width"])],2),n("div",{class:j(["controller-messages flex-auto lg:h-full",{"lg:hidden":u.value!=="messages"&&b.value.messages===0}]),style:{"flex-basis":"var(--width-messages)"}},[v(Rd,{width:b.value.messages},null,8,["width"])],2),n("div",q$,[v(Qr),v(Jr,{"listen-events":""})]),n("div",{class:j(["controller-switcher flex-none hidden lg:block",{"lg:!hidden":b.value.switcher===0}]),style:{"flex-basis":"var(--width-switcher)"}}
15,[v(Xx,{panel:u.value,"onUpdate:panel":R[1]||(R[1]=T=>u.value=T),timers:g(s).count,messages:g(t).count},null,8,["panel","timers","messages"])],2),n("div",{class:j(["absolute group hidden lg:block h-full cursor-col-resize",{"pointer-events-none":m.value===1}]),style:$e({width:"16px","margin-left":"-9px",left:`${b.value.aside}px`}),onMousedown:R[2]||(R[2]=T=>h(T,1))},[n("div",{class:j(["relative left-1/2 -ml-px h-full border-l-2 border-transparent group-hover:border-neutral-700 transition-colors",{"!border-sky-500":m.value===1}])},null,2)],38),n("div",{class:j(["absolute group hidden lg:block h-full cursor-col-resize",{"pointer-events-none":m.value===2}]),style:$e({width:"16px","margin-left":"-9px",left:`${b.value.aside+b.value.timers}px`}),onMousedown:R[3]||(R[3]=T=>h(T,2))},[n("div",{class:j(["relative left-1/2 -ml-px h-full border-l-2 border-transparent group-hover:border-neutral-700 transition-colors",{"!border-sky-500":m.value===2}])},null,2)],38)]),n("footer",W$,[n("aside",G$,[v(Hx,{class:"truncate"})]),n("div",X$,[v(jd,{size:"sm",class:"font-light"})])]),v(C3,{open:a.settings,"onUpdate:open":R[4]||(R[4]=T=>a.settings=T)},null,8,["open"]),v(v4,{open:a.output,"onUpdate:open":R[5]||(R[5]=T=>a.output=T)},null,8,["open"]),v(C4,{open:a.shortcuts,"onUpdate:open":R[6]||(R[6]=T=>a.shortcuts=T)},null,8,["open"]),v(z4,{open:a.legacyMigration,"onUpdate:open":R[7]||(R[7]=T=>a.legacyMigration=T)},null,8,["open"]),v(ik,{open:a.legacyLinks,"onUpdate:open":R[8]||(R[8]=T=>a.legacyLinks=T),onCustomizeModal:f},null,8,["open"]),v(_$,{open:a.legacyCustomize,"onUpdate:open":R[9]||(R[9]=T=>a.legacyCustomize=T)},null,8,["open"]),v(F$)],4))}},E6=Oe(Y$,[["__scopeId","data-v-4ba038dd"]]);export{E6 as default};
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.