1import{c as ae,d as Be,r as n,j as e,u as qe,i as Q,e as He,O as Ze}from"./index-BKQEIAyS.js";import{g as Xe,I as M,B as Ye,e as Je,U as E,a as Qe,h as et,c as I,$ as ie,_ as S,b as tt}from"./Button-DJAgW3tr.js";import{u as st,_ as nt,L,M as xe,a as he,S as be}from"./components-CxE_f3Wl.js";import{u as V,a as we,P as rt}from"./react-redux-CQmMms4Z.js";import{s as ot,t as se,u as at,a as it,l as de,b as ct}from"./axiosInstance-DFO1rq69.js";import{q as ee,_ as ue}from"./transition-DnyiUHdH.js";import{u as lt,r as ve}from"./index-CeyiEzVp.js";import{$ as ne,a as dt,b as ut,c as ft,d as D,e as ge,f as mt,g as H,h as A,i as pt,j as xt,k as ht}from"./index-COhDOtf6.js";import{r as bt}from"./authService-CbtNjs_H.js";/** 2 * @remix-run/react v2.8.1 3 * 4 * Copyright (c) Remix Software Inc. 5 * 6 * This source code is licensed under the MIT license found in the 7 * LICENSE.md file in the root directory of this source tree. 8 * 9 * @license MIT 10 */let fe="positions";function wt({getKey:t,...s}){let{isSpaMode:o}=st(),r=ae(),a=Be();lt({getKey:t,storageKey:fe});let c=n.useMemo(()=>{if(!t)return null;let d=t(r,a);return d!==r.key?d:null},[]);if(o)return null;let f=((d,l)=>{if(!window.history.state||!window.history.state.key){let i=Math.random().toString(32).slice(2);window.history.replaceState({key:i},"")}try{let x=JSON.parse(sessionStorage.getItem(d)||"{}")[l||window.history.state.key];typeof x=="number"&&window.scrollTo(0,x)}catch(i){console.error(i),sessionStorage.removeItem(d)}}).toString();return n.createElement("script",nt({},s,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${f})(${JSON.stringify(fe)}, ${JSON.stringify(c)})`}}))}const vt="/assets/tailwind-BuFigk5M.css",gt=()=>[{rel:"stylesheet",href:vt},{rel:"icon",type:"image/png",sizes:"16x16",href:"/favicons/favicon-16x16.png"},{rel:"icon",type:"image/png",sizes:"32x32",href:"/favicons/favicon-32x32.png"},{rel:"apple-touch-icon",type:"image/png",sizes:"180x180",href:"/favicons/apple-touch-icon.png"},{rel:"shortcut icon",href:"/favicons/favicon.ico"},{rel:"manifest",href:"/site.webmanifest"}];function yt(){return e.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center space-y-6 text-center",children:[e.jsx("h1",{className:"text-primary-100 text-6xl lg:pb-5 lg:text-9xl",children:"404"}),e.jsx("h2",{className:"lg:text-6xl",children:"Page not found."}),e.jsxs("p",{className:"max-w-xl",children:["The page you are looking for does not exist or has been moved. ",e.jsx("br",{}),"Please go back to the homepage."]}),e.jsx("button",{className:"flex items-center justify-center rounded-md border border-solid border-other-dark-100 px-3 py-2 text-sm shadow-md",children:e.jsx(L,{to:"/",children:"Go back home"})})]})}function ye(){if(typeof window>"u")return{shouldRedirect:!1,redirectUrl:null};const t=window.location.hostname,s=window.location.port,o=window.location.pathname,r=window.location.search,a=window.location.hash;if(t.startsWith("ql.")){const c=t.substring(3);if(!c||c.length===0)return console.warn("Invalid main domain extracted from hostname:",t),{shouldRedirect:!1,redirectUrl:null};const f=window.location.protocol,d=s?`${c}:${s}`:c;return{shouldRedirect:!0,redirectUrl:`${f}//${d}/ql${o}${r}${a}`,originalUrl:window.location.href,mainDomain:d}}return{shouldRedirect:!1,redirectUrl:null}}function $e(t=!0){const s=ye();if(s.shouldRedirect&&s.redirectUrl)try{return t?window.location.replace(s.redirectUrl):window.location.href=s.redirectUrl,!0}catch(o){return console.error("Failed to perform redirect:",o),!1}return!1}function $t(){typeof window<"u"&&$e()}function Et(){const t=qe(),[s,o]=n.useState(!1),[r,a]=n.useState(!1);return n.useEffect(()=>{if(o(!0),Q(t)&&t.status===404){const c=ye();a(c.shouldRedirect),c.shouldRedirect&&$e()}},[t]),t instanceof Error?e.jsx("div",{className:"h-full w-full",children:e.jsxs("div",{className:"mx-auto flex h-full max-w-6xl flex-col items-center justify-center space-y-2 rounded-xl ",children:[e.jsxs("h1",{className:"text-danger-500 text-3xl font-bold",children:["Whoops! ",t.message,"!"]}),e.jsxs("h2",{className:"text-base",children:[" The stack trace is:",t.stack]})]})}):Q(t)?Q(t)&&t.status===404&&(!s||r)?e.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center space-y-6 text-center",children:[e.jsx("div",{className:"border-primary-300 border-t-primary-600 h-12 w-12 animate-spin rounded-full border-4"}),e.jsx("p",{className:"text-light-200 text-sm",children:"Redirecting..."})]}):e.jsx(yt,{}):e.jsx("div",{className:"h-full w-full",children:e.jsx("div",{className:"mx-auto flex h-full max-w-6xl flex-col items-center justify-center space-y-2 rounded-xl ",children:e.jsx("h1",{className:"text-danger-500 text-4xl font-bold",children:"An unexpected error occurred"})})})}function Nt({title:t,titleId:s,...o},r){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":s},o),t?n.createElement("title",{id:s},t):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"}))}const Tt=n.forwardRef(Nt),jt=Tt;function Rt({title:t,titleId:s,...o},r){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":s},o),t?n.createElement("title",{id:s},t):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const At=n.forwardRef(Rt),St=At,kt=({open:t,setOpen:s})=>{const o=V(l=>l.auth),[r,a]=n.useState(null),c=we(),f=async l=>{if(r===null||typeof r.managedDepartments>"u")return;const i=r.managedDepartments.find(x=>x._id===l);typeof i>"u"||(await Je({...r,department:i,password:void 0},r._id),c(ot({organizationId:l})),se({title:"Switched Organization",description:"Successfully switched organization.",variant:"default"}),window.location.reload())};n.useEffect(()=>{(async()=>{try{const i=await Xe();if(!i.success||i.user===null)return;typeof i.user.managedDepartments<"u"&&a(i.user)}catch{console.error("Could not fetch organization")}})()},[t]);const d=()=>e.jsx("form",{className:"h-full",children:e.jsxs("div",{className:"flex h-full flex-col space-y-4",children:[e.jsxs("div",{className:"inline-flex w-full items-center justify-between",children:[e.jsxs("div",{className:"inline-flex items-center gap-3",children:[e.jsx("span",{className:"inline-flex h-7 w-7 items-center justify-center",children:e.jsx(M,{name:"organizations",size:28,className:"text-white"})}),e.jsx("span",{className:"h5 text-text-100",children:"Switch Organization"})]}),e.jsx("div",{className:"inline-flex h-7 w-5 items-center justify-center",children:e.jsx("span",{className:"flex h-5 w-5 items-center justify-center",onClick:()=>s(!1),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&s(!1)},role:"button",tabIndex:0,"aria-label":"Close",children:e.jsx(M,{name:"exit",size:28,className:"text-white"})})})]}),e.jsx("div",{className:"flex flex-1 flex-col gap-2 rounded-[8px]",children:r&&typeof r.managedDepartments<"u"&&r.managedDepartments.map(l
10=>e.jsxs("button",{className:" flex flex-row justify-between gap-4 rounded-[8px] bg-other-light-100 p-3",onClick:()=>f(l._id),type:"button",children:[e.jsxs("div",{className:"flex min-w-0 grow basis-0 flex-col gap-1",children:[e.jsx("span",{className:"b2 truncate text-left text-text-100",children:l.name}),e.jsx("span",{className:"c1 truncate text-left text-text-200",children:l.description})]}),l._id===o.organizationId?e.jsx("div",{className:"c1 my-auto flex-shrink-0 self-stretch rounded-full bg-green-200 px-3 py-2 text-text-dark-100",children:"Signed In"}):e.jsx("div",{className:"c1 my-auto flex-shrink-0 self-stretch rounded-full border border-other-dark-100 px-3 py-2 text-text-200",children:"Select"})]},l._id))}),e.jsx("div",{className:"mb-5 mt-auto flex w-full items-center justify-start",children:e.jsx("div",{children:e.jsx(Ye,{variant:"outline",onClick:()=>s(!1),children:"Cancel"})})})]})});return e.jsx(ee.Root,{show:t,as:n.Fragment,children:e.jsxs(ue,{as:"div",className:"relative z-10",onClose:()=>s(!1),children:[e.jsx(ee.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e.jsx("div",{className:"fixed inset-0 bg-bg-dark-50 bg-opacity-85 transition-opacity"})}),e.jsx("div",{className:"fixed inset-0 z-10 w-screen overflow-y-auto",children:e.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:e.jsx(ee.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:e.jsx(ue.Panel,{className:"relative h-[626px] w-[522px] transform space-x-4 space-y-4 overflow-hidden rounded-lg bg-bg-dark-200 px-4 pb-4 pt-4 text-left shadow-xl transition-all",children:d()})})})})]})})},Ct=kt,It=[{name:"Playlists",href:"/playlists",icon:"playlist",current:!0,access:E.REGULAR_USER},{name:"Projects",href:"/projects",icon:"projects",current:!1,access:E.REGULAR_USER},{name:"Assets",href:"/assets",icon:"assets",current:!1,access:E.ORGANIZATION_MANAGER},{name:"Quicklinks",href:"/quicklinks",icon:"quicklink",current:!1,access:E.ORGANIZATION_MANAGER},{name:"Email Campaigns",href:"/campaigns",icon:"emailCampaigns",current:!1,access:E.ORGANIZATION_MANAGER},{name:"Users",href:"/users",icon:"users",current:!1,access:E.ORGANIZATION_MANAGER},{name:"Groups",href:"/groups",icon:"groups",current:!1,access:E.ORGANIZATION_MANAGER},{name:"Titles",href:"/titles",icon:"titles",current:!1,access:E.ORGANIZATION_MANAGER},{name:"Terms of Service",href:"/tos",icon:"termsofservice",current:!1,access:E.ORGANIZATION_MANAGER},{name:"Organizations",href:"/organizations",icon:"organizations",current:!1,access:E.ADMINISTRATOR},{name:"Reports",href:"/reports",icon:"list",current:!1,access:E.ORGANIZATION_MANAGER},{name:"Audit Log",href:"/audits",icon:"auditlog",current:!1,access:E.ADMINISTRATOR},{name:"Blacklist",href:"/blacklist",icon:"blacklist",current:!1,access:E.ORGANIZATION_MANAGER}];function Pt({children:t}){const[s,o]=n.useState(!0),r=V(u=>u.auth),{pathname:a}=ae(),[c,f]=n.useState(!1),d=r.firstName.length>0?r.firstName.charAt(0):"",l=r.lastName.length>0?r.lastName.charAt(0):"",i=`${d}${l}`,x=Qe(r.firstName+" "+r.lastName),b=V(u=>u.brand.src);return a==="/login"||a==="/register"||a==="/"||a==="/forgot_password"||a==="/change_password"||a==="/reset_password"||a===""?e.jsx(e.Fragment,{children:t}):e.jsxs(e.Fragment,{children:[c&&e.jsx(Ct,{open:c,setOpen:f}),e.jsxs("div",{className:"h-full",children:[!a.startsWith("/ql")&&e.jsx(e.Fragment,{children:e.jsx("div",{className:`hidden transition-all duration-200 sm:fixed sm:inset-y-0 sm:flex sm:flex-col ${s?"sm:w-48":"sm:w-14"}`,children:e.jsxs("div",{className:`flex grow flex-col ${s?"":"items-center"} gap-y-4 bg-bg-dark-100 px-5`,children:[e.jsxs("div",{className:`${s?"-ml-5 -mr-5 border-b border-other-dark-200 pl-5 pr-5":""} flex h-16 shrink-0 items-center justify-between`,children:[e.jsx(L,{to:"/playlists",children:e.jsx("img",{className:`h-8 ${s?"":"hidden"}`,src:b||"/images/StreamDLogoSidebarLight.png",alt:"StreamD Logo"})}),e.jsx("div",{children:s?e.jsx("button",{type:"button",className:"mt-1",onClick:()=>o(!1),children:e.jsx(jt,{className:"h-4 w-4 text-white","aria-hidden":"true"})}):e.jsx("button",{type:"button",className:"mt-1",onClick:()=>o(!0),children:e.jsx(St,{className:"h-4 w-4 text-white","aria-hidden":"true"})})})]}),e.jsxs("div",{className:"text-center text-white",children:[e.jsx("div",{className:`b3 mx-auto mb-3 flex h-9 w-9 items-center justify-center rounded-full ${x} hidden lg:flex`,children:i}),e.jsx("div",{className:`b3 ${s?" visible":" hidden"}`,children:r.username}),e.jsx("div",{className:`c2 text-text-200 ${s?" visible":" hidden"}`,children:r.role}),r.role===E.ORGANIZATION_MANAGER&&e.jsx("button",{className:"c2 italic text-text-200 underline hover:text-text-100",onClick:()=>f(!0),children:s?"Switch Organization":"Switch Org"})]}),e.jsx("nav",{className:`${s?"-ml-5 -mr-5 border-t border-other-dark-200 pl-5 pr-5":""} flex flex-1 flex-col pt-1`,children:e.jsxs("ul",{className:"flex flex-1 flex-col gap-y-7 ",children:[e.jsx("li",{className:"flex flex-col gap-1",children:It.map(u=>et(r.role,u.access)?e.jsx("ul",{className:"-mx-3 space-y-1",children:e.jsx("li",{className:"b3",children:e.jsxs(L,{to:u.href,className:`${a.startsWith(u.href)?"bg-other
10-dark-100 text-white":" text-text-200 hover:bg-other-dark-400 hover:text-white"} 11 flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6`,children:[e.jsx(M,{name:u.icon,size:24,className:"text-text-200"}),s?u.name:""]})})},u.name):null)}),e.jsxs("li",{className:"absolute inset-x-0 bottom-8 flex flex-col text-center",children:[e.jsxs("div",{className:`mt-2 flex items-center justify-center align-middle ${s?"":"hidden"}`,children:[e.jsx("div",{className:"c4 inline-block text-text-300",children:"Powered by:"}),e.jsx("img",{className:"ml-3 inline-block w-16 ",src:"/images/StreamDLogoSidebarLight.png",alt:"StreamD Logo"})]}),e.jsx("div",{className:`c4 mt-2 text-text-300 ${s?"":"hidden"}`,children:"Copyright StreamD©"}),e.jsxs("div",{className:`c4 mb-2 text-text-300 ${s?"":"hidden"}`,children:["2018 - ",new Date().getFullYear()," Version 1.1"]}),e.jsxs("div",{children:[e.jsx(L,{to:"logout",className:` c1 text-red-300 ${s?"":"hidden"}`,children:"Logout"}),e.jsx(L,{to:"logout",className:`text-red-400 ${s?"hidden":""}`,children:e.jsx(M,{name:"logout",size:16,className:"mx-auto mt-6 inline-flex text-center"})})]})]})]})})]})})}),e.jsx("div",{className:"sticky top-0 z-50 bg-bg-dark-100 px-3 py-2 sm:hidden",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex-1 text-sm font-semibold leading-6 text-white",children:e.jsx("img",{className:"h-10",src:b||"/images/StreamDLogoSidebarLight.png",alt:"StreamD Logo"})}),!a.startsWith("/ql")&&e.jsxs(L,{to:"logout",className:"c1 flex items-center gap-2 text-red-300",children:[e.jsx(M,{name:"logout",size:16,className:""}),"Logout"]})]})}),e.jsx("div",{className:"h-full",children:e.jsx("main",{className:I("h-full sm:pl-14",s&&"sm:pl-48",(a==="/login"||a.startsWith("/ql"))&&"pl-0 sm:pl-0"),children:t})})]})]})}function _t(t,s){return n.useReducer((o,r)=>{const a=s[o][r];return a??o},t)}const Ee=t=>{const{present:s,children:o}=t,r=Ot(s),a=typeof o=="function"?o({present:r.isPresent}):n.Children.only(o),c=ie(r.ref,a.ref);return typeof o=="function"||r.isPresent?n.cloneElement(a,{ref:c}):null};Ee.displayName="Presence";function Ot(t){const[s,o]=n.useState(),r=n.useRef({}),a=n.useRef(t),c=n.useRef("none"),f=t?"mounted":"unmounted",[d,l]=_t(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect(()=>{const i=B(r.current);c.current=d==="mounted"?i:"none"},[d]),ne(()=>{const i=r.current,x=a.current;if(x!==t){const u=c.current,v=B(i);t?l("MOUNT"):v==="none"||(i==null?void 0:i.display)==="none"?l("UNMOUNT"):l(x&&u!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=t}},[t,l]),ne(()=>{if(s){const i=b=>{const v=B(r.current).includes(b.animationName);b.target===s&&v&&ve.flushSync(()=>l("ANIMATION_END"))},x=b=>{b.target===s&&(c.current=B(r.current))};return s.addEventListener("animationstart",x),s.addEventListener("animationcancel",i),s.addEventListener("animationend",i),()=>{s.removeEventListener("animationstart",x),s.removeEventListener("animationcancel",i),s.removeEventListener("animationend",i)}}else l("ANIMATION_END")},[s,l]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:n.useCallback(i=>{i&&(r.current=getComputedStyle(i)),o(i)},[])}}function B(t){return(t==null?void 0:t.animationName)||"none"}const Ne="ToastProvider",[ce,Lt,Mt]=dt("Toast"),[Te,js]=ut("Toast",[Mt]),[Dt,Z]=Te(Ne),je=t=>{const{__scopeToast:s,label:o="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:c=50,children:f}=t,[d,l]=n.useState(null),[i,x]=n.useState(0),b=n.useRef(!1),u=n.useRef(!1);return n.createElement(ce.Provider,{scope:s},n.createElement(Dt,{scope:s,label:o,duration:r,swipeDirection:a,swipeThreshold:c,toastCount:i,viewport:d,onViewportChange:l,onToastAdd:n.useCallback(()=>x(v=>v+1),[]),onToastRemove:n.useCallback(()=>x(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:b,isClosePausedRef:u},f))};je.propTypes={label(t){if(t.label&&typeof t.label=="string"&&!t.label.trim()){const s=`Invalid prop \`label\` supplied to \`${Ne}\`. Expected non-empty \`string\`.`;return new Error(s)}return null}};const Ft="ToastViewport",Ut=["F8"],re="toast.viewportPause",oe="toast.viewportResume",zt=n.forwardRef((t,s)=>{const{__scopeToast:o,hotkey:r=Ut,label:a="Notifications ({hotkey})",...c}=t,f=Z(Ft,o),d=Lt(o),l=n.useRef(null),i=n.useRef(null),x=n.useRef(null),b=n.useRef(null),u=ie(s,b,f.onViewportChange),v=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=f.toastCount>0;n.useEffect(()=>{const p=j=>{var w;r.every(y=>j[y]||j.code===y)&&((w=b.current)===null||w===void 0||w.focus())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[r]),n.useEffect(()=>{const p=l.current,j=b.current;if(T&&p&&j){const w=()=>
11{if(!f.isClosePausedRef.current){const N=new CustomEvent(re);j.dispatchEvent(N),f.isClosePausedRef.current=!0}},g=()=>{if(f.isClosePausedRef.current){const N=new CustomEvent(oe);j.dispatchEvent(N),f.isClosePausedRef.current=!1}},y=N=>{!p.contains(N.relatedTarget)&&g()},$=()=>{p.contains(document.activeElement)||g()};return p.addEventListener("focusin",w),p.addEventListener("focusout",y),p.addEventListener("pointermove",w),p.addEventListener("pointerleave",$),window.addEventListener("blur",w),window.addEventListener("focus",g),()=>{p.removeEventListener("focusin",w),p.removeEventListener("focusout",y),p.removeEventListener("pointermove",w),p.removeEventListener("pointerleave",$),window.removeEventListener("blur",w),window.removeEventListener("focus",g)}}},[T,f.isClosePausedRef]);const h=n.useCallback(({tabbingDirection:p})=>{const w=d().map(g=>{const y=g.ref.current,$=[y,...ns(y)];return p==="forwards"?$:$.reverse()});return(p==="forwards"?w.reverse():w).flat()},[d]);return n.useEffect(()=>{const p=b.current;if(p){const j=w=>{const g=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!g){const F=document.activeElement,_=w.shiftKey;if(w.target===p&&_){var $;($=i.current)===null||$===void 0||$.focus();return}const P=h({tabbingDirection:_?"backwards":"forwards"}),K=P.findIndex(m=>m===F);if(te(P.slice(K+1)))w.preventDefault();else{var N,k;_?(N=i.current)===null||N===void 0||N.focus():(k=x.current)===null||k===void 0||k.focus()}}};return p.addEventListener("keydown",j),()=>p.removeEventListener("keydown",j)}},[d,h]),n.createElement(ft,{ref:l,role:"region","aria-label":a.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:T?void 0:"none"}},T&&n.createElement(me,{ref:i,onFocusFromOutsideViewport:()=>{const p=h({tabbingDirection:"forwards"});te(p)}}),n.createElement(ce.Slot,{scope:o},n.createElement(D.ol,S({tabIndex:-1},c,{ref:u}))),T&&n.createElement(me,{ref:x,onFocusFromOutsideViewport:()=>{const p=h({tabbingDirection:"backwards"});te(p)}}))}),Vt="ToastFocusProxy",me=n.forwardRef((t,s)=>{const{__scopeToast:o,onFocusFromOutsideViewport:r,...a}=t,c=Z(Vt,o);return n.createElement(ge,S({"aria-hidden":!0,tabIndex:0},a,{ref:s,style:{position:"fixed"},onFocus:f=>{var d;const l=f.relatedTarget;!((d=c.viewport)!==null&&d!==void 0&&d.contains(l))&&r()}}))}),X="Toast",Kt="toast.swipeStart",Wt="toast.swipeMove",Gt="toast.swipeCancel",Bt="toast.swipeEnd",qt=n.forwardRef((t,s)=>{const{forceMount:o,open:r,defaultOpen:a,onOpenChange:c,...f}=t,[d=!0,l]=mt({prop:r,defaultProp:a,onChange:c});return n.createElement(Ee,{present:o||d},n.createElement(Re,S({open:d},f,{ref:s,onClose:()=>l(!1),onPause:H(t.onPause),onResume:H(t.onResume),onSwipeStart:A(t.onSwipeStart,i=>{i.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:A(t.onSwipeMove,i=>{const{x,y:b}=i.detail.delta;i.currentTarget.setAttribute("data-swipe","move"),i.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${x}px`),i.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${b}px`)}),onSwipeCancel:A(t.onSwipeCancel,i=>{i.currentTarget.setAttribute("data-swipe","cancel"),i.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),i.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),i.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),i.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:A(t.onSwipeEnd,i=>{const{x,y:b}=i.detail.delta;i.currentTarget.setAttribute("data-swipe","end"),i.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),i.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),i.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${x}px`),i.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${b}px`),l(!1)})})))}),[Ht,Zt]=Te(X,{onClose(){}}),Re=n.forwardRef((t,s)=>{const{__scopeToast:o,type:r="foreground",duration:a,open:c,onClose:f,onEscapeKeyDown:d,onPause:l,onResume:i,onSwipeStart:x,onSwipeMove:b,onSwipeCancel:u,onSwipeEnd:v,...T}=t,h=Z(X,o),[p,j]=n.useState(null),w=ie(s,m=>j(m)),g=n.useRef(null),y=n.useRef(null),$=a||h.duration,N=n.useRef(0),k=n.useRef($),F=n.useRef(0),{onToastAdd:_,onToastRemove:Y}=h,O=H(()=>{var m;(p==null?void 0:p.contains(document.activeElement))&&((m=h.viewport)===null||m===void 0||m.focus()),f()}),P=n.useCallback(m=>
11{!m||m===1/0||(window.clearTimeout(F.current),N.current=new Date().getTime(),F.current=window.setTimeout(O,m))},[O]);n.useEffect(()=>{const m=h.viewport;if(m){const R=()=>{P(k.current),i==null||i()},C=()=>{const U=new Date().getTime()-N.current;k.current=k.current-U,window.clearTimeout(F.current),l==null||l()};return m.addEventListener(re,C),m.addEventListener(oe,R),()=>{m.removeEventListener(re,C),m.removeEventListener(oe,R)}}},[h.viewport,$,l,i,P]),n.useEffect(()=>{c&&!h.isClosePausedRef.current&&P($)},[c,$,h.isClosePausedRef,P]),n.useEffect(()=>(_(),()=>Y()),[_,Y]);const K=n.useMemo(()=>p?Ce(p):null,[p]);return h.viewport?n.createElement(n.Fragment,null,K&&n.createElement(Xt,{__scopeToast:o,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0},K),n.createElement(Ht,{scope:o,onClose:O},ve.createPortal(n.createElement(ce.ItemSlot,{scope:o},n.createElement(pt,{asChild:!0,onEscapeKeyDown:A(d,()=>{h.isFocusedToastEscapeKeyDownRef.current||O(),h.isFocusedToastEscapeKeyDownRef.current=!1})},n.createElement(D.li,S({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":c?"open":"closed","data-swipe-direction":h.swipeDirection},T,{ref:w,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:A(t.onKeyDown,m=>{m.key==="Escape"&&(d==null||d(m.nativeEvent),m.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:A(t.onPointerDown,m=>{m.button===0&&(g.current={x:m.clientX,y:m.clientY})}),onPointerMove:A(t.onPointerMove,m=>{if(!g.current)return;const R=m.clientX-g.current.x,C=m.clientY-g.current.y,U=!!y.current,z=["left","right"].includes(h.swipeDirection),W=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,We=z?W(0,R):0,Ge=z?0:W(0,C),J=m.pointerType==="touch"?10:2,G={x:We,y:Ge},le={originalEvent:m,delta:G};U?(y.current=G,q(Wt,b,le,{discrete:!1})):pe(G,h.swipeDirection,J)?(y.current=G,q(Kt,x,le,{discrete:!1}),m.target.setPointerCapture(m.pointerId)):(Math.abs(R)>J||Math.abs(C)>J)&&(g.current=null)}),onPointerUp:A(t.onPointerUp,m=>{const R=y.current,C=m.target;if(C.hasPointerCapture(m.pointerId)&&C.releasePointerCapture(m.pointerId),y.current=null,g.current=null,R){const U=m.currentTarget,z={originalEvent:m,delta:R};pe(R,h.swipeDirection,h.swipeThreshold)?q(Bt,v,z,{discrete:!0}):q(Gt,u,z,{discrete:!0}),U.addEventListener("click",W=>W.preventDefault(),{once:!0})}})})))),h.viewport))):null});Re.propTypes={type(t){if(t.type&&!["foreground","background"].includes(t.type)){const s=`Invalid prop \`type\` supplied to \`${X}\`. Expected \`foreground | background\`.`;return new Error(s)}return null}};const Xt=t=>{const{__scopeToast:s,children:o,...r}=t,a=Z(X,s),[c,f]=n.useState(!1),[d,l]=n.useState(!1);return ts(()=>f(!0)),n.useEffect(()=>{const i=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(i)},[]),d?null:n.createElement(xt,{asChild:!0},n.createElement(ge,r,c&&n.createElement(n.Fragment,null,a.label," ",o)))},Yt=n.forwardRef((t,s)=>{const{__scopeToast:o,...r}=t;return n.createElement(D.div,S({},r,{ref:s}))}),Jt=n.forwardRef((t,s)=>{const{__scopeToast:o,...r}=t;return n.createElement(D.div,S({},r,{ref:s}))}),Qt="ToastAction",Ae=n.forwardRef((t,s)=>{const{altText:o,...r}=t;return o?n.createElement(ke,{altText:o,asChild:!0},n.createElement(Se,S({},r,{ref:s}))):null});Ae.propTypes={altText(t){return t.altText?null:new Error(`Missing prop \`altText\` expected on \`${Qt}\``)}};const es="ToastClose",Se=n.forwardRef((t,s)=>{const{__scopeToast:o,...r}=t,a=Zt(es,o);return n.createElement(ke,{asChild:!0},n.createElement(D.button,S({type:"button"},r,{ref:s,onClick:A(t.onClick,a.onClose)})))}),ke=n.forwardRef((t,s)=>{const{__scopeToast:o,altText:r,...a}=t;return n.createElement(D.div,S({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0},a,{ref:s}))});function Ce(t){const s=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&s.push(r.textContent),ss(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",c=r.dataset.radixToastAnnounceExclude==="";if(!a)if(c){const f=r.dataset.radixToastAnnounceAlt;f&&s.push(f)}else s.push(...Ce(r))}}),s}function q(t,s,o,{discrete:r}){const a=o.originalEvent.currentTarget,c=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});s&&a.addEventListener(t,s,{once:!0}),r?ht(a,c):a.dispatchEvent(c)}const pe=(t,s,o=0)=>{const r=Math.abs(t.x),a=Math.abs(t.y),c=r>a;return s==="left"||s==="right"?c&&r>o:!c&&a>o};function ts(t=()=>{}){const s=H(t);ne(()=>{let o=0,r=0;return o=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(s)),()=>{window.cancelAnimationFrame(o),window.cancelAnimationFrame(r)}},[s])}function ss(t){return t.nodeType===t.ELEMENT_NODE}function ns(t){const s=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)s.push(o.currentNode);return s}function te(t){const s=document.activeElement;return t.some(o=>o===s?!0:(o.focus(),document.activeElement!==s))}const rs=je,Ie=zt,Pe=qt,_e=Yt,Oe=Jt,Le=Ae,Me=Se;/** 12 * @license lucide-react v0.378.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const os=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),De=(...t)=>t.filter((s,o,r)=>!!s&&r.indexOf(s)===o).join(" ");/** 17 * @license lucide-react v0.378.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */var as={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 22 * @license lucide-react v0.378.0 - ISC 23 * 24 * This source code is licensed under the ISC license. 25 * See the LICENSE file in the root directory of this source tree. 26 */const is=n.forwardRef(({color:t="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:a="",children:c,iconNode:f,...d},l)=>n.createElement("svg",{ref:l,...as,width:s,height:s,stroke:t,strokeWidth:r?Number(o)*24/Number(s):o,className:De("lucide",a),...d},[...f.map(([i,x])=>
26n.createElement(i,x)),...Array.isArray(c)?c:[c]]));/** 27 * @license lucide-react v0.378.0 - ISC 28 * 29 * This source code is licensed under the ISC license. 30 * See the LICENSE file in the root directory of this source tree. 31 */const cs=(t,s)=>{const o=n.forwardRef(({className:r,...a},c)=>n.createElement(is,{ref:c,iconNode:s,className:De(`lucide-${os(t)}`,r),...a}));return o.displayName=`${t}`,o};/** 32 * @license lucide-react v0.378.0 - ISC 33 * 34 * This source code is licensed under the ISC license. 35 * See the LICENSE file in the root directory of this source tree. 36 */const ls=cs("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ds=rs,Fe=n.forwardRef(({className:t,...s},o)=>e.jsx(Ie,{ref:o,className:I("pointer-events-none fixed top-0 z-[100] flex min-h-screen w-full flex-col-reverse gap-2 p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[360px]",t),...s}));Fe.displayName=Ie.displayName;const us=tt("group pointer-events-auto relative flex w-full items-center justify-start space-x-4 overflow-hidden rounded-md shadow p-4 pr-8 transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full bg-bg-dark-200",{variants:{variant:{default:"",warning:"",error:"border border-red-400"}},defaultVariants:{variant:"default"}}),Ue=n.forwardRef(({className:t,variant:s,...o},r)=>{const a=s==="default"?"successToast":s==="warning"?"warningToast":"errorToast";return e.jsxs(Pe,{ref:r,className:I(us({variant:s}),t),...o,children:[e.jsx(M,{name:a,size:40}),o.children]})});Ue.displayName=Pe.displayName;const fs=n.forwardRef(({className:t,...s},o)=>e.jsx(Le,{ref:o,className:I("ring-offset-background hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t),...s}));fs.displayName=Le.displayName;const ze=n.forwardRef(({className:t,...s},o)=>e.jsx(Me,{ref:o,className:I("text-foreground/50 hover:text-foreground absolute right-2 top-2 rounded-md p-1 opacity-0 transition-opacity focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...s,children:e.jsx(ls,{className:"h-4 w-4"})}));ze.displayName=Me.displayName;const Ve=n.forwardRef(({className:t,...s},o)=>e.jsx(_e,{ref:o,className:I("b3 text-text-100",t),...s}));Ve.displayName=_e.displayName;const Ke=n.forwardRef(({className:t,...s},o)=>e.jsx(Oe,{ref:o,className:I("c2 text-text-200",t),...s}));Ke.displayName=Oe.displayName;function ms(){const{toasts:t}=at();return e.jsxs(ds,{children:[t.map(function({id:s,title:o,description:r,action:a,...c}){return e.jsxs(Ue,{...c,children:[e.jsxs("div",{className:"grid gap-1",children:[o&&e.jsx(Ve,{children:o}),r&&e.jsx(Ke,{children:r})]}),a,e.jsx(ze,{})]},s)}),e.jsx(Fe,{})]})}const ps=n.createContext(void 0),xs=({children:t})=>{const s=V(u=>u.auth),o=V(u=>u.assetUploadReducer),r=we(),a=ae(),c=He(),f=n.useRef(),[d,l]=n.useState(!1),i=()=>a.pathname!=="/"&&a.pathname!=="/login"&&!a.pathname.startsWith("/ql"),x=n.useCallback(async()=>{if(!i()||s.token===null)return;const u=await bt(s.token);u.success?r(it({token:u.token})):(r(de()),c("/login"),se({title:"Session Timeout",description:"User token expired.",variant:"error"}))},[r,s.token,c,a.pathname]);n.useEffect(()=>{if(!i())return;const u=1e3*60*5,v=setInterval(()=>{x()},u);return()=>clearInterval(v)},[x,a.pathname]),n.useEffect(()=>{const u=()=>{const v=document.querySelectorAll("video"),T=Array.from(v).some(h=>!h.paused&&!h.ended&&h.readyState>2);l(T)};if(a.pathname.startsWith("/assets")||a.pathname.startsWith("/playlists")||a.pathname.startsWith("/quicklinks")){const v=setInterval(u,1e4);return()=>clearInterval(v)}else l(!1)},[a.pathname]),n.useEffect(()=>{if(!i()){clearTimeout(f.current);return}const u=()=>{if(d){clearTimeout(f.current);return}const v=1e3*60*30,T=1e3*60*60*6;clearTimeout(f.current),f.current=setTimeout(()=>{r(de()),c("/login"),se({title:"Session Timeout",description:"Session timed out due to inactivity.",variant:"error"})},o.uploading.length>0?T:v)};return window.addEventListener("mousemove",u),window.addEventListener("keydown",u),window.addEventListener("click",u),window.addEventListener("scroll",u),u(),()=>{window.removeEventListener("mousemove",u),window.removeEventListener("keydown",u),window.removeEventListener("click",u),window.removeEventListener("scroll",u)}},[a.pathname,c,o.uploading.length,r,d]);const b={refreshUserToken:x,isVideoPlaying:d};return e.jsx(ps.Provider,{value:b,children:t})};function hs(){return n.useEffect(()=>{$t()},[]),null}const Rs=gt,As=()=>[{title:"StreamD | Web Application",description:"An application which facilitates the management of secure, streamable content (Assets). Users may upload, view and share Assets such as video, audio and pictures."}];function Ss({children:t}){return e.jsxs("html",{lang:"en",className:I("h-full"),children:[e.jsxs("head",{children:[e.jsx("meta",{charSet:"utf-8"}),e.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),e.jsx("meta",{name:"theme-color",content:"#0C0E14"}),e.jsx(xe,{}),e.jsx(he,{}
36),e.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),e.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),e.jsx("link",{href:"https://fonts.googleapis.com/css2?family=Open+Sans:[email protected]&display=swap",rel:"stylesheet"})]}),e.jsxs("body",{className:"h-full bg-bg-dark-50",children:[e.jsx(rt,{store:ct,children:e.jsxs(xs,{children:[e.jsx(hs,{}),e.jsx(Pt,{children:t}),e.jsx(ms,{})]})}),e.jsx(wt,{}),e.jsx(be,{}),e.jsx("script",{async:!0,src:"https://v2.zopim.com/?3AMtiBI74QpEbz7jlcKJNbs2IQZRuQk0",type:"text/javascript"})]})]})}function ks(){return e.jsx(Ze,{})}function Cs(){return e.jsxs("html",{lang:"en",children:[e.jsxs("head",{children:[e.jsx("title",{children:"Error Boundary"}),e.jsx(xe,{}),e.jsx(he,{})]}),e.jsxs("body",{className:"h-screen w-full",children:[e.jsx(Et,{}),e.jsx(be,{})]})]})}export{Cs as ErrorBoundary,Ss as Layout,ks as default,Rs as links,As as meta};
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.