PageSourceSearch

https://insertfuel.com/_next/static/chunks/0bz5ex7xuoytk.js?dpl=dpl_BiwEz7MmtMWBp3YN6wUnG6QCf7Hz

js insertfuel.com collected 2026-10-04 14:31:11 UTC 243,279 bytes, 7 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,645782,e=>{"use strict";var t=e.i(843476),n=e.i(271645),a=e.i(920755),s=e.i(886902);let i=(0,n.createContext)(null);e.s(["ChatOverlayProvider",0,function({userId:e,children:r}){let l=`chat-overlay-v2-${e}`,[o,c]=(0,n.useState)([]),[d,u]=(0,n.useState)(!1),[m,h]=(0,n.useState)({}),[p,f]=(0,n.useState)(!1);(0,n.useEffect)(()=>{try{let e=localStorage.getItem(l);if(e){let t=JSON.parse(e);t.conversations&&c(t.conversations),t.windowPositions&&h(t.windowPositions)}}catch{}f(!0)},[]);let x=(0,n.useRef)(new Set),g=(0,n.useRef)(new Set);(0,n.useEffect)(()=>{if(!p||!e)return;let t=o.map(e=>e.channelId).filter(e=>!x.current.has(e));if(0===t.length)return;let n=(0,a.createClient)();(async()=>{let{data:a,error:i}=await n.from("channel_members").select("channel_id").eq("profile_id",e).in("channel_id",t);if(i||!Array.isArray(a))return;let r=new Set(a.map(e=>e.channel_id));for(let e of t)x.current.add(e),r.has(e)&&g.current.add(e);c(e=>{let t=e.filter(e=>g.current.has(e.channelId)||e.poppedOut||!x.current.has(e.channelId)),n=[...t].sort((e,t)=>(t.lastOpenedAt??0)-(e.lastOpenedAt??0)),a=new Set,i=new Set;for(let e of n)(0,s.isOneToOne)(e)&&e.otherUserId&&(a.has(e.otherUserId)?i.add(e.channelId):a.add(e.otherUserId));return t.filter(e=>!i.has(e.channelId))})})()},[p,o,e]);
1let[b,w]=(0,n.useState)(!1),[y,v]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(p)try{localStorage.setItem(l,JSON.stringify({conversations:o,windowPositions:m}))}catch{}},[o,m,p]),(0,n.useEffect)(()=>{let t=o.filter(e=>"Chat"===e.name||!e.otherAvatar);if(0===t.length)return;let n=(0,a.createClient)(),s=t.filter(e=>e.otherUserId),i=t.filter(e=>!e.otherUserId),r=[];s.length>0&&r.push(Promise.resolve(n.from("profiles").select("id, full_name, avatar_url").in("id",s.map(e=>e.otherUserId))).then(({data:e})=>{if(!e?.length)return;let t=Object.fromEntries(e.map(e=>[e.id,e]));c(e=>e.map(e=>{if(!e.otherUserId)return e;let n=t[e.otherUserId];return n?{...e,name:"Chat"!==e.name&&e.name?e.name:n.full_name??e.name,otherAvatar:e.otherAvatar??n.avatar_url??null}:e}))})),i.length>0&&r.push(Promise.resolve(n.from("channel_members").select("channel_id, profiles:profile_id(id, full_name, avatar_url)").in("channel_id",i.map(e=>e.channelId)).neq("profile_id",e)).then(({data:e})=>{if(!e?.length)return;let t={};for(let n of e){let e=Array.isArray(n.profiles)?n.profiles[0]:n.profiles;e&&!t[n.channel_id]&&(t[n.channel_id]=e)}c(e=>e.map(e=>{let n=t[e.channelId];return n?{...e,otherUserId:e.otherUserId??n.id,name:"Chat"!==e.name&&e.name?e.name:n.full_name??e.name,otherAvatar:e.otherAvatar??n.avatar_url??null}:e}))})),Promise.all(r).catch(()=>{})},[o.map(e=>e.channelId+(e.otherAvatar??"")+(e.otherUserId??"")).join("|")]);let j=(0,n.useMemo)(()=>o.filter(e=>"open"===e.state),[o]),k=(0,n.useMemo)(()=>o.filter(e=>"minimized"===e.state),[o]),N=(0,n.useCallback)((e,t)=>{h(n=>({...n,[e]:t}))},[]),C=(0,n.useCallback)(e=>{let t=Date.now();c(n=>n.map(n=>n.channelId===e?"open"===n.state?{...n,state:"minimized"}:{...n,state:"open",lastOpenedAt:t}:n))},[]),S=(0,n.useCallback)(e=>{c(t=>t.some(t=>t.channelId===e.channelId)?t:[...t,{...e,state:"minimized"}])},[]),_=(0,n.useCallback)(e=>{v(!1),w(!1);let t=Date.now();c(n=>{if(n.find(t=>t.channelId===e.channelId))return n.map(n=>n.channelId===e.channelId?{...n,...e,fuelaRoom:!0===e.fuelaRoom,state:"open",lastOpenedAt:t}:n);let a=n.filter(e=>"open"===e.state);if(a.length>=10){let s=a[0];return[...n.map(e=>e.channelId===s.channelId?{...e,state:"minimized"}:e),{...e,state:"open",lastOpenedAt:t}]}return[...n,{...e,state:"open",lastOpenedAt:t}]})},[]),E=(0,n.useCallback)(e=>{c(t=>t.map(t=>t.channelId===e?{...t,state:"minimized"}:t))},[]),z=(0,n.useCallback)(e=>{c(t=>t.filter(t=>t.channelId!==e)),h(t=>{let n={...t};return delete n[e],n})},[]),T=(0,n.useCallback)(e=>{c(t=>e?.keepMinimized?t.filter(e=>"minimized"===e.state):[]),h({})},[]),$=(0,n.useCallback)(e=>{0!==e.length&&c(e)},[]),L=(0,n.useCallback)((e,t)=>{c(n=>n.map(n=>n.channelId===e?{...n,...t}:n))},[]),D=(0,n.useCallback)((e,t)=>{let n=Date.now();c(a=>a.map(a=>a.channelId===e?{...a,state:"open",lastOpenedAt:n,...t?.poppedOut?{poppedOut:!0}:{}}:a))},[]);return(0,t.jsx)(i.Provider,{value:{userId:e,conversations:o,openConversations:j,minimizedConversations:k,windowPositions:m,setWindowPosition:N,toggleBubble:C,openConversation:_,seedHead:S,minimizeConversation:E,closeConversation:z,closeAllConversations:T,restoreConversations:$,restoreConversation:D,patchConversation:L,chatListOpen:d,setChatListOpen:u,chatDropdownOpen:b,setChatDropdownOpen:w,newChatPanelOpen:y,setNewChatPanelOpen:v},children:r})},"useChatOverlay",0,function(){let e=(0,n.useContext)(i);if(!e)throw Error("useChatOverlay must be inside ChatOverlayProvider");return e},"useChatOverlayOptional",0,function(){return(0,n.useContext)(i)}])},494616,e=>{"use strict";var t=e.i(843476),n=e.i(885439),a=e.i(915120);e.s(["default",0,function({onMinimise:e,onMaximise:s,maximised:i=!1,onPopout:r,onClose:l,titles:o,className:c=""}){let d={minimise:"Minimise",maximise:"Maximise",restore:"Restore",popout:"Open full page",close:"Close",...o},u=(0,a.controlIcon)("interface","sm","border-transparent bg-transparent");return(0,t.jsxs)("div",{className:`flex items-center gap-0.5 shrink-0 ${c}`,onMouseDown:e=>e.stopPropagation(),children:[e&&(0,t.jsx)("button",{type:"button",onClick:e,className:u,title:d.minimise,"aria-label":d.minimise,children:(0,t.jsx)(n.default,{name:"window.minimize",size:14})}),s&&(0,t.jsx)("button",{type:"button",onClick:s,className:u,title:i?d.restore:d.maximise,"aria-label":i?d.restore:d.maximise,children:(0,t.jsx)(n.default,{name:i?"window.restore":"window.maximize",size:14})}),r&&(0,t.jsx)("button",{type:"button",onClick:r,className:u,title:d.popout,"aria-label":d.popout,children:(0,t.jsx)(n.default,{name:"window.popout",size:14})}),(0,t.jsx)("button",{type:"button",onClick:l,className:`${u} hover:text-red-400`,title:d.close,"aria-label":d.close,children:(0,t.jsx)(n.default,{name:"window.close",size:14})})]})}])},453561,333155,e=>{"use strict";var t=e.i(843476),n=e.i(880492),a=e.i(271645),s=e.i(618566),i=e.i(885439);function r({label:e}){let{theme:l,toggle:o,finishLocked:c}=(0,n.useTheme)(),d=(0,s.useRouter)(),[u,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{m(!0)},[]);let h=c?"Theme settings":e;return(0,t.jsx)("button",{type:"button",onClick:c?()=>d.push("/settings?tab=theme"):o,"aria-label":h,title:h,className:"flex h-9 w-9 items-center justify-center r-control text-content-muted transition-colors hover:bg-surface-hover hover:text-content-primary",children:c?(0,t.jsx)(i.default,{name:"ui.palette",size:18,weight:"regular"}):u&&"dark"===l?(0,t.jsx)(i.default,{name:"ui.sun",size:18,weight:"regular"}):(0,t.jsx)(i.default,{name:"ui.moon",size:18,weight:"regular"})})}e.s(["default",0,r],333155),e.s(["ThemeToggle",0,function({className:e="",workspaceLayout:a=!1}){let{theme:s}=(0,n.useTheme)();return(0,t.jsx)("div",{className:e,children:(0,t.jsx)(r,{label:"dark"===s?"Switch to light mode":"Switch to dark mode",workspaceLayout:a})})}],453561)},733607,292296,177262,e=>{"use strict";var t=e.i(843476),n=e.i(885439),a=e.i(71487),s=e.i(271645),i=e.i(174080),r=e.i(770703),l=e.i(618566),o=e.i(645782),c=e.i(385376),d=e.i(494616),u=e.i(842396);let m=()=>e.A(635504),h=(0,r.default)(m,{ssr:!1}),p=!1;function f(){p||(p=!0,m().catch(()=>{p=!1}))}function x(e){let t=e.getBoundingClientRect(),n=window.innerWidth,a=window.innerHeight,s=Math.min(380,n-24),i=Math.max(12,Math.min(t.right-s,n-12-s)),r=Math.round(t.bottom+6),l=a;for(let e of[".if-bottom-bar",".music-bar-container"]){let t=document.querySelector(e);
1if(!t||0===t.getClientRects().length)continue;let n=t.getBoundingClientRect().top;n>r&&n<l&&(l=n)}let o=Math.max(240,Math.round(l-12-r));return{top:r,left:Math.round(i),width:s,height:o}}e.s(["default",0,function(e){let r=(0,l.usePathname)(),m=(0,l.useRouter)(),p=(0,o.useChatOverlayOptional)(),g=p?.chatDropdownOpen??!1,b=p?.setChatDropdownOpen,{count:w,label:y}=(0,c.useChatUnread)(),v=(0,s.useRef)(null),j=(0,s.useRef)(null),[k,N]=(0,s.useState)(null),[C,S]=(0,s.useState)(!1),_=(0,s.useCallback)(()=>b?.(!1),[b]),[E,z]=(0,s.useState)(!1),[T,$]=(0,s.useState)(0),[L,D]=(0,s.useState)(null);(0,s.useEffect)(()=>{function e(e){let t=e.detail?.channelId;"string"==typeof t&&D(t)}return window.addEventListener("if:channel-opened",e),()=>window.removeEventListener("if:channel-opened",e)},[]);let I=(0,s.useCallback)(()=>{_(),z(!1),D(null),$(e=>e+1)},[_]);return(0,s.useEffect)(()=>{_()},[r,_]),(0,s.useEffect)(()=>{if(!p)return;let e=window;if(e.requestIdleCallback){let t=e.requestIdleCallback(f,{timeout:5e3});return()=>e.cancelIdleCallback?.(t)}let t=setTimeout(f,2500);return()=>clearTimeout(t)},[p]),(0,s.useLayoutEffect)(()=>{if(!g)return;let e=()=>{j.current&&N(x(j.current))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[g]),(0,s.useEffect)(()=>{g&&S(!0)},[g]),(0,s.useEffect)(()=>{if(!g)return;function e(e){v.current?.contains(e.target)||j.current?.contains(e.target)||_()}let t=setTimeout(()=>document.addEventListener("mousedown",e),100);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[g,_]),(0,t.jsxs)("div",{className:"relative hidden md:block",children:[(0,t.jsxs)("button",{ref:j,onPointerEnter:f,onFocus:f,onClick:()=>{p&&b?(!g&&j.current&&N(x(j.current)),!g&&w>0&&(0,u.requestUnreadList)(),b(!g)):m.push("/chat")},className:`relative ${a.HEADER_CONTROL} ${g?"bg-surface-hover text-content-primary":""}`,title:"Chat","aria-expanded":g,children:[(0,t.jsx)(n.default,{name:"comm.chat",size:a.HEADER_ICON_SIZE}),w>0&&(0,t.jsx)("span",{className:"absolute -top-0.5 -right-0.5 min-w-[16px] h-4 rounded-full bg-[var(--if-purple)] text-[var(--on-accent)] text-[10px] font-bold flex items-center justify-center px-0.5",children:y})]}),(C||g)&&k&&"u">typeof document&&(0,i.createPortal)((0,t.jsxs)(t.Fragment,{children:[g&&(0,t.jsx)("div",{className:"fixed inset-0 z-[99998]",onClick:_}),(0,t.jsxs)("div",{ref:v,"data-chat-mini-panel":g?"open":"hidden","aria-hidden":!g,className:`fixed flex flex-col overflow-hidden r-container layer-raised ${g?"":"hidden"}`,style:E?{top:k.top,left:Math.max(12,k.left+k.width-Math.min(760,window.innerWidth-24)),width:Math.min(760,window.innerWidth-24),height:k.height,zIndex:99999}:{top:k.top,left:k.left,width:k.width,height:k.height,zIndex:99999},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-line-base px-3 py-1.5 shrink-0",children:[(0,t.jsx)("span",{className:"if-window-title min-w-0 flex-1 truncate font-semibold text-content-primary",children:"Chat"}),(0,t.jsx)(d.default,{onMinimise:_,onMaximise:()=>z(e=>!e),maximised:E,onPopout:()=>{I(),m.push(L?`/chat?channel=${L}&focus=1`:"/chat")},onClose:I})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1",children:(0,t.jsx)(h,{mode:"mini"},T)})]})]}),document.body)]})}],733607),e.i(247167);var g=e.i(920755);let b=[{value:"visitor",label:"Logged Out Visitor (Public)",group:"public",icon:"ui.globe"},{value:"lead",label:"Logged Out Lead (Cookies)",group:"public",icon:"entity.person"},{value:"member",label:"Dreamer (Free)",group:"role",icon:"plan.dream"},{value:"client",label:"Client (Paid)",group:"role",icon:"nav.deals"},{value:"staff",label:"Staff (Internal)",group:"role",icon:"entity.staff"},{value:"admin",label:"Admin",group:"role",icon:"ui.shield"},{value:"superadmin",label:"Super Admin",group:"role",icon:"ui.shield-star"}];var w=e.i(525885),y=e.i(463415),v=e.i(63270),j=e.i(453561),k=e.i(823229),N=e.i(818175),C=e.i(408263),S=e.i(702475),_=e.i(290425),E=e.i(425757),z=e.i(971527);e.i(644075);var T=e.i(225784),$=e.i(175307),L=e.i(116069);function D(e){return e.split(" ").slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("")}let I=e=>{document.cookie=e},M=[{key:"test",label:"Test Accounts",match:e=>e.full_name.startsWith("Test ")},{key:"staff",label:"Staff",match:e=>!e.full_name.startsWith("Test ")&&["superadmin","admin","staff"].includes(e.role)},{key:"client",label:"Clients",match:e=>!e.full_name.startsWith("Test ")&&"client"===e.role},{key:"community",label:"Dreamers",match:e=>!e.full_name.startsWith("Test ")&&["member","lead","visitor"].includes(e.role)}],A=[.75,.85,.9,1,1.1,1.2,1.3,1.5,1.75,2,2.5,3];function P({currentUserId:e,hideStates:a}
1){let[i,r]=(0,s.useState)(""),[l,o]=(0,s.useState)(null),[c,d]=(0,s.useState)(null),[u,m]=(0,s.useState)(null),[h,p]=(0,s.useState)(0),f=i.trim();(0,s.useEffect)(()=>{let e=new AbortController,t=setTimeout(async()=>{try{let t=await fetch("/api/simulate/people",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({q:f}),signal:e.signal}),n=await t.json().catch(()=>({}));if(!t.ok||!Array.isArray(n.people))throw Error(n.error||`the server answered ${t.status}`);o(n.people),d(f),m(null)}catch(t){if(e.signal.aborted)return;m(t instanceof Error?t.message:String(t))}},200*!!f);return()=>{clearTimeout(t),e.abort()}},[f,h]);let x=null!==l&&c===f?l:null,g=(x??[]).filter(e=>(0,L.isOnlineNow)(e.last_seen)),w=(x??[]).filter(e=>!(0,L.isOnlineNow)(e.last_seen)),y=[{key:"here",label:"Signed in now",members:g},...M.map(e=>({key:e.key,label:e.label,members:w.filter(e.match)})),{key:"other",label:"Everyone else",members:w.filter(e=>!M.some(t=>t.match(e)))}].filter(e=>e.members.length>0);return(0,t.jsxs)("div",{className:"px-2 pb-2 space-y-3",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("button",{onClick:e=>{for(let t of(e.stopPropagation(),["if_sim_role","if_sim_user","if_sim_name","if_sim_setter"]))I(`${t}=; path=/; max-age=0`);window.location.reload()},className:"flex w-full items-center gap-2 rounded-md px-1.5 py-1.5 text-left if-t-body text-content-secondary transition-colors hover:bg-surface-hover hover:text-content-primary",children:[(0,t.jsx)(n.default,{name:"ui.reset",size:14,className:"shrink-0"}),(0,t.jsx)("span",{children:"Reset to My Account"})]}),a?null:[["public","Public states"],["role","Role states"]].map(([a,s])=>(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"px-1 pb-0.5 pt-1 if-t-micro font-bold uppercase tracking-widest text-content-muted",children:s}),b.filter(e=>e.group===a).map(a=>(0,t.jsxs)("button",{onClick:t=>{var n;return n=a.value,void(t.stopPropagation(),document.cookie=`if_sim_role=${n}; path=/; max-age=86400`,document.cookie="if_sim_user=; path=/; max-age=0",document.cookie=`if_sim_setter=${e}; path=/; max-age=86400`,window.location.reload())},className:"flex w-full items-center gap-2 rounded-md px-1.5 py-1.5 text-left if-t-body text-content-secondary transition-colors hover:bg-surface-hover hover:text-content-primary",children:[(0,t.jsx)(n.default,{name:a.icon,size:14,className:"shrink-0 text-content-muted"}),(0,t.jsx)("span",{className:"truncate",children:a.label})]},a.value))]},a)),(0,t.jsx)("p",{className:"px-1 pb-0.5 pt-1 if-t-micro text-content-muted",children:"People"}),(0,t.jsx)("input",{value:i,onChange:e=>{r(e.target.value),m(null)},placeholder:"Search by name, email, role, or city",autoFocus:!0,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),className:"w-full bg-surface-input border border-line-strong rounded-lg px-2.5 py-1.5 if-t-meta text-content-primary placeholder-zinc-500 focus:outline-none focus:border-line-strong"}),(0,t.jsx)("div",{className:"space-y-2 max-h-56 overflow-y-auto",children:u?(0,t.jsxs)("div",{className:"py-3 text-center",children:[(0,t.jsxs)("p",{className:"if-t-meta text-amber-500",children:["The list did not load: ",u]}),(0,t.jsx)("button",{type:"button",onClick:()=>{m(null),p(e=>e+1)},className:"mt-1 r-control px-2 py-1.5 if-t-meta font-semibold text-content-secondary transition-colors hover:bg-surface-hover hover:text-content-primary",children:"Try again"})]}):null===x?(0,t.jsx)("p",{className:"if-t-meta text-content-muted text-center py-3",children:f?"Searching…":"Looking for people…"}):0===x.length?(0,t.jsx)("p",{className:"if-t-meta text-content-muted text-center py-3",children:f?`Nobody matches “${f}”`:"Nobody else has an account yet"}):(0,t.jsxs)(t.Fragment,{children:[!f&&0===g.length&&(0,t.jsx)("p",{className:"px-1 if-t-meta text-content-muted",children:"Nobody else is signed in right now"}),y.map(n=>(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"px-1 pb-1 if-t-micro text-content-muted",children:n.label}),n.members.map(n=>(0,t.jsxs)("button",{type:"button",onClick:t=>{t.stopPropagation(),I(`if_sim_user=${n.id}; path=/; max-age=86400`),I(`if_sim_name=${encodeURIComponent(n.full_name||"someone")}; path=/; max-age=86400`),I("if_sim_role=; path=/; max-age=0"),I(`if_sim_setter=${e}; path=/; max-age=86400`),window.location.reload()}
1,title:[n.role,n.city,n.email].filter(Boolean).join(" · "),className:"w-full flex items-center gap-2 px-1.5 py-1.5 rounded-lg hover:bg-surface-input transition-colors text-left",children:[n.avatar_url?(0,t.jsx)("img",{src:n.avatar_url,alt:n.full_name,className:"w-6 h-6 rounded-full object-cover shrink-0"}):(0,t.jsx)("div",{className:"w-6 h-6 rounded-full bg-surface-hover flex items-center justify-center if-t-micro font-bold text-content-secondary shrink-0",children:D(n.full_name)}),(0,t.jsx)("span",{className:"if-t-meta text-content-primary truncate flex-1",children:n.full_name})]},n.id))]},n.key))]})})]})}function U({lang:e,setLang:a,LANGUAGES:i}){let[r,l]=s.default.useState(!1),o=i.find(t=>t.code===e)??i[0],c=e=>(0,t.jsx)("img",{src:`https://flagcdn.com/w20/${e}.png`,srcSet:`https://flagcdn.com/w40/${e}.png 2x`,width:16,height:12,alt:"","aria-hidden":"true",className:"inline-block shrink-0 rounded-[2px] object-cover",style:{width:16,height:12}});return(0,t.jsxs)("div",{onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("button",{onClick:()=>l(e=>!e),className:`flex w-full items-center ${O}`,children:[(0,t.jsx)(n.default,{name:"ui.globe",size:16,className:"shrink-0"}),(0,t.jsx)("span",{children:"Language"}),(0,t.jsxs)("span",{className:"ml-auto flex items-center gap-1.5 text-content-muted",children:[c(o.cc),(0,t.jsx)("span",{className:"if-t-meta",children:o.label}),(0,t.jsx)(n.default,{name:"ui.chevron-down",size:12,className:`transition-transform ${r?"rotate-180":""}`})]})]}),r&&(0,t.jsx)("div",{className:"pl-2 pb-1",children:i.map(({code:n,label:s,cc:i})=>(0,t.jsxs)("button",{onClick:()=>{a(n),l(!1)},className:`w-full flex items-center gap-2.5 px-2 py-1.5 if-t-body rounded-lg transition-colors ${e===n?"text-brand-ink font-semibold bg-violet-500/10":"text-content-secondary hover:bg-surface-hover hover:text-content-primary"}`,children:[c(i),(0,t.jsx)("span",{children:s}),e===n&&(0,t.jsx)("span",{className:"ml-auto if-t-micro text-content-muted",children:"✓"})]},n))})]})}let F="min-h-9 gap-2.5 cursor-pointer rounded-lg px-2.5 py-1.5 if-t-body font-medium leading-snug [&>svg]:w-4 [&>svg]:h-4 [&>svg]:shrink-0 [&_svg]:text-current transition-colors",O=F+" text-content-secondary hover:bg-surface-hover hover:text-content-primary focus:bg-surface-hover focus:text-content-primary";e.s(["LoginAsPanel",0,P,"default",0,function({profile:e,realProfile:a,simLabel:i=null,simpleMenu:r=!1,onExitSim:o,onOpenSleep:c}){let d,u,m,h,p=(0,l.useRouter)(),{t:f,lang:x,setLang:g}=(0,E.useLanguage)(),[b,L]=(0,s.useState)(!1),{zoomLevel:I,zoomIn:M,zoomOut:P,zoomReset:R}=function(){let[e,t]=(0,s.useState)(1);return(0,s.useEffect)(()=>{try{let e=Number(localStorage.getItem("if:zoom")??"1");e&&1!==e&&t(Math.min(Math.max(e,A[0]),A[A.length-1]))}catch{}},[]),(0,s.useEffect)(()=>{let t;(t=document.body).style.zoom=1===e?"":String(e),t.style.width="",document.documentElement.style.setProperty("--if-zoom",String(e));try{localStorage.setItem("if:zoom",String(e))}catch{}},[e]),{zoomLevel:e,zoomIn:function(){t(e=>A.find(t=>t>e+1e-6)??e)},zoomOut:function(){t(e=>[...A].reverse().find(t=>t<e-1e-6)??e)},zoomReset:function(){t(1)}}}
1(),[W,B]=(0,s.useState)(null),[q,H]=(0,s.useState)(!1);(0,s.useEffect)(()=>{B((0,S.loadWorkBreak)())},[b]);let{supported:G,subscribe:K}=(0,_.usePushNotifications)(),J=a??e,Y=J?.role==="superadmin",V=e?.country??null,Z=e?.origin_country??null,Q=$.LANGUAGES.map(e=>({...e,flag:(0,T.resolveLanguageFlag)(e.code,V,Z),cc:(0,T.resolveLanguageCountryCode)(e.code,V,Z)}));return(0,t.jsxs)(y.DropdownMenu,{open:b,onOpenChange:L,children:[(0,t.jsxs)(y.DropdownMenuTrigger,{"data-tour":"avatar-menu",className:"if-topbar-avatar flex items-center gap-2 px-1.5 py-1 rounded-lg hover:bg-surface-hover transition-colors bg-transparent border-0 cursor-pointer",children:[(0,t.jsxs)("span",{className:"if-topbar-identity hidden shrink-0 flex-col items-end whitespace-nowrap leading-tight lg:flex",children:[(0,t.jsx)("span",{className:"text-[13px] font-semibold text-content-primary",children:(e.full_name??"").split(" ")[0]}),(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-content-muted",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),f("status_active")||"Active"]})]}),(0,t.jsxs)(v.Avatar,{className:"h-[30px] w-[30px] shrink-0 rounded-full",children:[(0,t.jsx)(v.AvatarImage,{"data-hover-ok":!0,px:30,src:e.avatar_url??void 0}),(0,t.jsx)(v.AvatarFallback,{className:"text-white if-t-meta font-semibold",style:{backgroundColor:"var(--accent-muted)",color:"var(--accent)"},children:D(e.full_name)})]})]}),(0,t.jsxs)(y.DropdownMenuContent,{align:"end",sideOffset:8,alignOffset:0,className:"max-h-[85dvh] w-[calc(100vw-30px)] overflow-y-auto rounded-xl border border-line-base p-1.5 shadow-2xl md:w-auto md:min-w-[224px]",children:[(0,t.jsxs)("div",{className:"mb-1 border-b border-line-base px-1 pb-1.5 pt-1",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("button",{type:"button",title:"Your builder page",onClick:()=>{L(!1),p.push(`/builders/${e.id}`)},className:"flex w-full min-w-0 items-center gap-2.5 rounded-lg px-2 py-1.5 text-left transition-colors hover:bg-surface-hover",children:[(0,t.jsxs)(v.Avatar,{className:"h-8 w-8 shrink-0 rounded-full",children:[(0,t.jsx)(v.AvatarImage,{px:32,src:e.avatar_url??void 0}),(0,t.jsx)(v.AvatarFallback,{className:"if-t-meta font-semibold",style:{backgroundColor:"var(--accent-muted)",color:"var(--accent)"},children:D(e.full_name)})]}),(0,t.jsx)("span",{className:"min-w-0 truncate if-t-body font-semibold text-content-primary",children:e.full_name||"You"}),(d=(0,C.deriveBadgeKey)({role:e.role,badge_key:e.badge_key??null,is_ai:e.is_ai??null}))?(0,t.jsx)(N.default,{badgeKey:d,size:"xs",className:"shrink-0"}):null]}),!r&&(0,t.jsx)("button",{type:"button","aria-expanded":q,onClick:()=>H(e=>!e),className:"mt-0.5 flex w-full min-w-0 items-center gap-1.5 rounded-lg px-2 py-1 text-left if-t-meta transition-colors hover:bg-surface-hover",children:W?(m=(u=(W.label??"Break").toLowerCase()).startsWith("meal")?{icon:"ui.meal",color:"#F97316"}:u.startsWith("water")?{icon:"ui.water",color:"#38BDF8"}:u.startsWith("sleep")?{icon:"ui.sleep",color:"#818CF8"}:{icon:"ui.walk",color:"#F59E0B"},h=W.endsAt?new Date(W.endsAt).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):null,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"inline-flex shrink-0",style:{color:m.color},children:(0,t.jsx)(n.default,{name:m.icon,size:14})}),(0,t.jsxs)("span",{className:"min-w-0 truncate text-content-secondary",children:["On a ",u.replace(/ break$/,"")," break",h?` \xb7 back ${h}`:""]})]})):(0,t.jsx)("span",{className:"text-content-muted",children:"Update status"})})]}),!r&&q&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"py-1",onClick:e=>e.stopPropagation(),children:(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[W&&(0,t.jsxs)(y.DropdownMenuItem,{className:O,onClick:()=>{(0,S.clearWorkBreak)(),L(!1)},children:[(0,t.jsx)("span",{className:"inline-flex shrink-0",style:{color:"#22C55E"},children:(0,t.jsx)(n.default,{name:"status.done",size:16})}),(0,t.jsx)("span",{className:"flex-1",children:"I'm back"})]}),[{icon:"ui.meal",key:"meal",tKey:"break_meal",fallback:"Meal",duration:"30 min",mins:30,type:"lunch",iconCls:"#F97316",hoverCls:"",show:!0},{icon:"ui.walk",key:"walk",tKey:"break_short",fallback:"Break",duration:"15 min",mins:15,type:"coffee",iconCls:"#F
159E0B",hoverCls:"",show:!0},{icon:"ui.water",key:"water",tKey:"break_water",fallback:"Water",duration:"5 min",mins:5,type:"coffee",iconCls:"#38BDF8",hoverCls:"",show:!0},{icon:"ui.exercise",key:"exercise",tKey:"break_exercise",fallback:"Exercise",duration:"1 hr",mins:60,type:"custom",iconCls:"text-violet-400",hoverCls:"",show:!1},{icon:"ui.sleep",key:"sleep",tKey:"break_sleep",fallback:"Sleep",duration:"8 hr",mins:480,type:"custom",iconCls:"#818CF8",hoverCls:"",show:!0},{icon:"ui.away",key:"away",tKey:"break_away",fallback:"Away",duration:"12 hr",mins:720,type:"custom",iconCls:"text-amber-400",hoverCls:"",show:!1}].filter(e=>e.show).map(({icon:e,key:a,tKey:s,fallback:i,duration:r,mins:l,type:o,iconCls:d,hoverCls:u})=>{let m=f(s)||i,h=!!W&&(W.label??"").toLowerCase().startsWith(m.toLowerCase());return(0,t.jsxs)("button",{onClick:()=>{if("sleep"===a)L(!1),c?.();else{let e,t=Date.now()+6e4*l,n=(e=f("break_word"))&&"break_word"!==e?e:"Break";if((0,S.saveWorkBreak)({type:o,label:/break$/i.test(m)?m:`${m} ${n}`,endsAt:t}),L(!1),window.dispatchEvent(new CustomEvent("if:break-start")),"away"===a)try{fetch("/api/agent/away-trigger",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({active:!0,ends_at:new Date(t).toISOString()})}).catch(()=>{})}catch{}}},className:`w-full min-h-9 flex items-center justify-between px-2.5 py-1.5 rounded-lg text-content-secondary transition-colors cursor-pointer hover:bg-surface-hover hover:text-content-primary ${u}`,style:h?{background:`color-mix(in srgb, ${d} 14%, transparent)`}:void 0,children:[(0,t.jsxs)("span",{className:"flex items-center gap-2.5 if-t-body font-medium leading-snug",children:[(0,t.jsx)("span",{className:"inline-flex shrink-0",style:{color:d},children:(0,t.jsx)(n.default,{name:e,size:16})}),m]}),h?(0,t.jsx)("span",{className:"h-2 w-2 rounded-full",style:{background:d},"aria-label":"Current status"}):(0,t.jsx)("span",{className:"if-t-meta text-content-muted ml-4",children:r})]},a)})]})}),(0,t.jsx)(y.DropdownMenuSeparator,{})]}),(0,t.jsxs)(y.DropdownMenuItem,{className:O,onClick:()=>{L(!1),p.push(`/builders/${e.id}`)},children:[(0,t.jsx)(n.default,{name:"entity.builder",size:16,className:"text-content-secondary"})," View profile"]}),!r&&(0,t.jsxs)(y.DropdownMenuItem,{className:O,onClick:()=>{L(!1),p.push("/settings")},children:[(0,t.jsx)(n.default,{name:"nav.settings",size:16,className:"text-content-secondary"})," ",f("settings")]}),(0,t.jsxs)(y.DropdownMenuItem,{className:O,onClick:()=>{L(!1),p.push("/portal/help")},children:[(0,t.jsx)(n.default,{name:"ui.help",size:16,className:"text-content-secondary"})," ",f("help")||"Help"]}),(0,t.jsxs)(y.DropdownMenuItem,{className:O,onClick:()=>{L(!1),(0,k.startAppTour)()},children:[(0,t.jsx)(n.default,{name:"nav.tour",size:16,className:"text-content-secondary"})," Take the tour"]}),!r&&(0,t.jsxs)(y.DropdownMenuItem,{className:O,onClick:()=>{L(!1),(0,w.openSiteInspector)("report")},children:[(0,t.jsx)(n.default,{name:"ui.bug",size:16,weight:"regular",style:{color:"var(--if-debug-accent)"}})," Report a Bug"]}),!1,!r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.DropdownMenuSeparator,{className:"hidden md:block"}),(0,t.jsxs)("div",{className:"hidden md:flex min-h-9 items-center justify-between px-2.5 py-1.5",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("span",{className:"if-t-body font-medium leading-snug text-content-secondary flex items-center gap-2.5",children:[(0,t.jsx)(n.default,{name:"ui.zoom-in",size:16})," Text size"]}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)("button",{onClick:P,disabled:I<=A[0],className:"flex items-center justify-center w-7 h-7 rounded-lg text-content-secondary hover:text-content-primary hover:bg-surface-hover disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:"Make text smaller",children:(0,t.jsx)(n.default,{name:"ui.zoom-out",size:16})}),(0,t.jsx)("button",{onClick:R,disabled:1===I,className:"flex items-center justify-center gap-1 h-7 px-2 rounded-lg if-t-meta font-mono text-content-muted hover:text-content-primary hover:bg-surface-hover disabled:opacity-50 disabled:cursor-default min-w-[32px] transition-colors",title:1===I?"Text at 100%":"Reset text to 100%",children:1===I?(0,t.jsx)(n.default,{name:"ui.reset",size:16}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{children:[Math.round(100*I),"%"]}),(0,t.jsx)("span",{className:"text-content-muted/60",children:"·"}),(0,t.jsx)("span",{children:"Reset"})]})}),(0,t.jsx)("button",{onClick:M,disabled:I>=A[A.length-1],className:"flex items-center justify-center w-7 h-7 rounded-lg text-content-secondary hover:text-content-primary hover:bg-surface-hover disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:"Make text larger",children:(0,t.jsx)(n.default,{name:"ui.zoom-in",size:16})})]})]})]}),(0,t.jsx)(U,{lang:x,setLang:g,LANGUAGES:Q}),!r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.DropdownMenuSeparator,{className:"md:hidden"}),(0,t.jsxs)("div",{className:"md:hidden flex items-center justify-between px-2 py-1.5",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("span",{className:"flex items-center gap-2.5 if-t-body font-medium leading-snug text-content-secondary",children:[(0,t.jsx)(n.default,{name:"ui.sun",size:16,className:"shrink-0"}),"Appearance"]}),(0,t.jsx)(j.ThemeToggle,{})]}),(0,t.jsxs)(y.DropdownMenuItem,{className:`${O} md:hidden`,onClick:()=>{L(!1),p.push("/portal/shop")},children:[(0,t.jsx)(n.default,{name:"action.cart",size:16,className:"text-content-secondary"})," Shop"]})]}),Y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.DropdownMenuSeparator,{}),i?(0,t.jsxs)(y.DropdownMenuItem,{className:`${F} text-amber-400 hover:bg-surface-input hover:text-amber-300 focus:bg-surface-input focus:text-amber-300`,onClick:o??(()=>{}),children:[(0,t.jsx)(n.default,{name:"ui.warning",size:14})," ",f("exit_simulation")]}):null]}),(0,t.jsx)(y.DropdownMenuSeparator,{}),(0,t.jsxs)(y.DropdownMenuItem,{className:O,onClick:()=>{localStorage.getItem("if-task-timer")?window.dispatchEvent(new CustomEvent("if:timer-before-logout")):(0,z.logoutWithPushCleanup)()},children:[(0,t.jsx)(n.default,{name:"action.logout",size:16,className:"text-content-secondary"})," ",f("sign_out")]})]})]})}
1],292296);var R=e.i(160448);let W=[{n:1,label:"Public Visitor",role:"public",note:"No session and no cookies - nothing here knows you",icon:"ui.globe"},{n:2,label:"Lead Cookies",role:"visitor",note:"No session, but the cookie still remembers you",icon:"entity.person"},{n:3,label:"Registered Lead",role:"member",note:"Has an account, pays nothing yet",icon:"plan.dream"},{n:4,label:"Paid Client",role:"client",note:"Fuel Plan or a purchase",icon:"nav.deals"},{n:5,label:"Staff Member",role:"staff",note:"One of ours",icon:"entity.staff"},{n:6,label:"Staff Admin",role:"admin",note:"Runs the place",icon:"ui.shield"},{n:7,label:"Super Admin",role:"superadmin",note:"You, normally",icon:"ui.shield-star"}],B="if:audience-dock",q=e=>{let t=document.cookie.split("; ").find(t=>t.startsWith(`${e}=`));return t?decodeURIComponent(t.slice(e.length+1)):null},H=e=>{document.cookie=e},G=()=>()=>{},K=()=>{try{return"1"===window.localStorage.getItem(B)}catch{return!1}},J=()=>!1,Y=()=>()=>{},V=()=>"u"<typeof document?null:q("if_sim_role"),Z=()=>null,Q=()=>()=>{},X=()=>"u">typeof document&&q("if_sim_user")?q("if_sim_name")||"someone":null,ee=()=>null,et=async(e,t)=>{let n=await fetch(`/api/simulate/pick?role=${encodeURIComponent(e)}`);
1if(!n.ok)return(await n.json().catch(()=>({}))).error??"Could not find anyone with that role";let{id:a,name:s}=await n.json();return H(`if_sim_user=${a}; path=/`),H(`if_sim_name=${encodeURIComponent(s??"someone")}; path=/`),H(`if_sim_role=${e}; path=/`),H(`if_sim_setter=${t}; path=/`),window.location.reload(),null};function en({inline:e=!1}={}){let[a,i]=(0,s.useState)(null),r=(0,s.useSyncExternalStore)(G,K,J),[l,o]=(0,s.useState)(!1),[c,d]=(0,s.useState)(null),[u,m]=(0,s.useState)(null),[h,p]=(0,s.useState)(!1),f=(0,s.useSyncExternalStore)(Y,V,Z),x=(0,s.useSyncExternalStore)(Q,X,ee),b=(0,s.useRef)(null);if((0,s.useEffect)(()=>{let e=!0;return(async()=>{try{let t=(0,g.createClient)(),{data:{user:n}}=await t.auth.getUser();if(!n||!e)return;let{data:a}=await t.from("profiles").select("role").eq("id",n.id).maybeSingle();if(e&&a?.role==="superadmin"){o(!0),i(n.id);try{window.localStorage.setItem(B,"1")}catch{}}}catch{}})(),()=>{e=!1}},[]),(0,s.useEffect)(()=>{let e=e=>{let t=e.detail;t&&!t.claimed&&b.current?.getClientRects().length&&(t.claimed=!0,p(!0))};return window.addEventListener("if:audience-open",e),()=>window.removeEventListener("if:audience-open",e)},[]),(0,s.useEffect)(()=>{if(!h)return;let e=e=>{b.current?.contains(e.target)||p(!1)},t=e=>{"Escape"===e.key&&p(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[h]),!(r||l))return null;let w=f?W.find(e=>e.role===f):null,y=!!f||!!x,v=!w&&x?`Being ${x}`:null;return(0,t.jsxs)("div",{ref:b,className:e?"relative flex items-center gap-1.5":"fixed bottom-4 left-1/2 z-[80] flex -translate-x-1/2 flex-col items-center gap-1.5",children:[h&&(0,t.jsxs)("div",{className:`if-dock-panel r-container w-64 max-h-[70vh] overflow-y-auto border border-line-base layer-raised shadow-lg ${e?"absolute right-0 top-full z-[80] mt-1.5":""}`,children:[(0,t.jsxs)("p",{className:"border-b border-line-base px-3 py-2 if-t-body font-semibold text-content-primary",children:["Who is looking",v&&(0,t.jsx)("span",{className:"block if-t-meta font-medium text-amber-500",children:v})]}),(0,t.jsx)("ul",{className:"py-1",children:W.map(e=>{let s=!!f&&e.role===f||7===e.n&&!y&&!!a;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",onClick:()=>(e=>{if(m(null),"public"===e||"visitor"===e)return void(H(`if_sim_role=${e}; path=/`),H("if_sim_user=; path=/; max-age=0"),H("if_sim_name=; path=/; max-age=0"),a&&H(`if_sim_setter=${a}; path=/`),"public"===e&&(0,R.forgetVisitor)(),window.location.reload());a?(d(e),et(e,a).then(e=>{e&&(m(e),d(null))})):m("Sign in first - a person can only be simulated from a real session")})(e.role),title:e.note,className:`flex w-full items-center gap-2.5 px-3 py-1.5 text-left transition-colors hover:bg-surface-hover ${s?"bg-brand-soft":""}`,children:[(0,t.jsx)(n.default,{name:e.icon,size:14,className:"shrink-0 text-content-muted"}),(0,t.jsx)("span",{className:`min-w-0 flex-1 if-t-meta ${s?"font-semibold text-brand-ink":"font-medium text-content-secondary"}`,children:e.label}),c===e.role?(0,t.jsx)("span",{className:"shrink-0 if-t-micro text-content-muted",children:"…"}):s&&(0,t.jsx)(n.default,{name:"check.checked",size:14,className:"shrink-0 text-brand-ink"})]})},e.n)})}),u&&(0,t.jsx)("p",{className:"border-t border-line-base px-3 py-2 if-t-meta text-amber-500",children:u}),a&&(0,t.jsxs)("div",{className:"border-t border-line-base pt-1",children:[(0,t.jsx)("p",{className:"px-3 pb-1 if-t-label text-content-muted",children:"Or be someone"}),(0,t.jsx)(P,{currentUserId:a,hideStates:!0})]}),y&&(0,t.jsxs)("button",{type:"button",onClick:()=>void(H("if_sim_role=; path=/; max-age=0"),H("if_sim_user=; path=/; max-age=0"),H("if_sim_name=; path=/; max-age=0"),H("if_sim_setter=; path=/; max-age=0"),window.location.reload()),className:"flex w-full items-center gap-2 border-t border-line-base px-3 py-2 if-t-meta font-semibold text-content-primary transition-colors hover:bg-surface-hover",children:[(0,t.jsx)(n.default,{name:"ui.warning",size:14})," Back to yourself"]})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>p(e=>!e),"aria-expanded":h,title:w?`Looking as ${w.n}. ${w.label}`:v??"Switch who is looking","aria-label":"Switch who is looking",className:e?"flex h-9 w-9 items-center justify-center r-control text-content-muted transition-colors hover:bg-surface-hover hover:text-content-primary":`r-cta flex items-center gap-2 border px-3 py-2 text-sm font-semibold shadow-lg transition-colors ${y?"border-amber-500/50 bg-amber-500/15 text-amber-500 hover:bg-amber-500/25":"border-line-base layer-raised text-content-secondary hover:text-content-primary"}`,children:[(0,t.jsx)(n.default,{name:"ui.user-switch",size:e?18:16}),!e&&(0,t.jsx)("span",{children:w?`${w.n}. ${w.label}`:v??"Super Admin"})]})]})}e.s(["default",0,function(){return(0,t.jsx)(en,{inline:!0})}],177262)},991585,e=>{"use strict";var t=e.i(843476),n=e.i(89772);e.s(["default",0,function({onClose:e,initialQuery:a=""}){return(0,t.jsx)(n.UniversalSearchModal,{onClose:e,initialQuery:a})}])},928233,e=>{"use strict";var t=e.i(843476),n=e.i(885439),a=e.i(271645),s=e.i(618566);e.s(["default",0,function({onOpen:e,signedIn:i=!1}){let r=(0,s.useRouter)(),[l,o]=(0,a.useState)(0),[c,d]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=()=>{try{let e=localStorage.getItem("if-cart"),t=e?JSON.parse(e):[];o(Array.isArray(t)?t.reduce((e,t)=>
1e+(Number(t?.qty)||1),0):0)}catch{o(0)}d(!0)};return e(),window.addEventListener("if-cart-update",e),window.addEventListener("storage",e),()=>{window.removeEventListener("if-cart-update",e),window.removeEventListener("storage",e)}},[]);let u=c&&l>0;return(0,t.jsxs)("button",{onClick:()=>{u?e():r.push(i?"/catalogue":"/products")},"aria-label":l>0?`Cart, ${l} ${1===l?"item":"items"}`:"Cart, empty. Opens the Fuel Shop",title:u?"Cart":"Fuel Shop",className:"relative inline-flex h-9 w-9 items-center justify-center r-control text-content-muted transition-colors hover:bg-surface-hover hover:text-content-primary",children:[(0,t.jsx)(n.default,{name:"action.cart",size:18,weight:"regular"}),c&&l>0&&(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute -right-0.5 -top-0.5 flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-[var(--if-purple)] px-1 text-[10px] font-bold leading-none text-white",children:l>9?"9+":l})]})}])},89699,e=>{"use strict";var t=e.i(263276);let n=e=>!e.closest(".if-topbar-search")&&!e.closest(".if-top-bar-website-menu");function a(){return Array.from(document.querySelectorAll("[data-page-find]")).filter(e=>null!==e.offsetParent&&e.getClientRects().length>0&&!e.disabled&&!e.readOnly&&n(e))}let s=e=>{e.focus(),e.select()};e.s(["findOnPage",0,function(e){let i=a();if(i.length)return void s(i[0]);let r={handled:!1};window.dispatchEvent(new CustomEvent(t.PAGE_SEARCH_EVENT,{detail:r})),r.handled||(window.dispatchEvent(new CustomEvent("if:page-search")),window.setTimeout(()=>{let t=a();if(t.length)return void s(t[0]);let i=Array.from(document.querySelectorAll("input[type='text'], input[type='search'], input:not([type])")).filter(e=>null!==e.offsetParent&&!e.disabled&&!e.readOnly&&n(e)&&/search|filter/i.test(`${e.placeholder??""} ${e.getAttribute("aria-label")??""}`));i.length?s(i[0]):e()},60))}])},362505,e=>{"use strict";var t=e.i(843476),n=e.i(271645),a=e.i(885439),s=e.i(425757),i=e.i(310119);let r=(0,e.i(915120).control)("readout","sm","select-none gap-1.5");function l({code:e,cls:n}){return 0===e?(0,t.jsx)(a.default,{name:"ui.weather-sun",className:n}):e<=3?(0,t.jsx)(a.default,{name:"ui.weather-cloud",className:n}):e<=67?(0,t.jsx)(a.default,{name:"ui.weather-rain",className:n}):e<=77?(0,t.jsx)(a.default,{name:"ui.weather-snow",className:n}):e<=82?(0,t.jsx)(a.default,{name:"ui.weather-rain",className:n}):(0,t.jsx)(a.default,{name:"ui.weather-storm",className:n})}function o({level:e,charging:n,cls:s}){return n?(0,t.jsx)(a.default,{name:"ui.battery-charging",className:s}):e<=15?(0,t.jsx)(a.default,{name:"ui.battery-low",className:s}):e<=55?(0,t.jsx)(a.default,{name:"ui.battery-medium",className:s}):(0,t.jsx)(a.default,{name:"ui.battery-full",className:s})}let c={low:!1,critical:!1,snoozed:!1};function d(){let[e,t]=(0,n.useState)(null),[a,s]=(0,n.useState)(null),[i,r]=(0,n.useState)(null),[l,o]=(0,n.useState)(null);return(0,n.useEffect)(()=>{t(new Date);let e=setInterval(()=>t(new Date),1e3);return()=>clearInterval(e)},[]),(0,n.useEffect)(()=>{let e=async(e,t)=>{try{let n=await fetch(`https://api.open-meteo.com/v1/forecast?latitude=${e.toFixed(4)}&longitude=${t.toFixed(4)}&current_weather=true&temperature_unit=fahrenheit`),a=await n.json();s({temp:Math.round(a.current_weather.temperature),code:a.current_weather.weathercode??0})}catch{}},t=async()=>{try{let t=await fetch("https://ipapi.co/json/"),n=await t.json();n.latitude&&n.longitude&&await e(n.latitude,n.longitude)}catch{}};"u"<typeof navigator||!navigator.geolocation?t():navigator.permissions?.query?navigator.permissions.query({name:"geolocation"}).then(n=>{"granted"===n.state?navigator.geolocation.getCurrentPosition(t=>e(t.coords.latitude,t.coords.longitude),()=>t(),{timeout:6e3,maximumAge:6e5}):t()}).catch(()=>t()):t()},[]),(0,n.useEffect)(()=>{!("u"<typeof navigator)&&"getBattery"in navigator?(o(!0),navigator.getBattery().then(e=>{let t=()=>{let t=Math.round(100*e.level);r({level:t,charging:e.charging}),function(e,t){if(c.snoozed&&e>5){c.low=!0;return}if(t){c.low=!1,c.critical=!1;return}e>12&&(c.low=!1),e<=5&&(c.low=!0),e>7&&(c.critical=!1),e<=5&&!c.critical?(c.critical=!0,window.dispatchEvent(new CustomEvent("if:toast",{detail:{iconName:"status.urgent",tone:"error",ttl:12e3,label:"Battery critical",description:`${e} percent left. Plug in now.`}}))):e<=10&&!c.low&&(c.low=!0,window.dispatchEvent(new CustomEvent("if:toast",{detail:{iconName:"ui.battery",tone:"warning",ttl:12e3,label:"Battery low",de
1scription:`${e} percent left. Time to plug in.`,actionLabel:"Snooze till 5%",actionEvent:"if:battery-snooze"}})))}(t,e.charging)};t(),e.addEventListener("levelchange",t),e.addEventListener("chargingchange",t)}).catch(()=>o(!1))):o(!1)},[]),{now:e,weather:a,battery:i,batterySupported:l}}window.addEventListener("if:battery-snooze",()=>{c.snoozed=!0}),e.s(["BatteryWidget",0,function(){let{battery:e,batterySupported:n}=d();return(0,i.useChrome)().battery&&n&&e?(0,t.jsxs)("div",{className:r,children:[(0,t.jsx)(o,{level:e.level,charging:e.charging,cls:`w-3 h-3 shrink-0 ${e.level<=15&&!e.charging?"text-red-400":""}`}),(0,t.jsx)("span",{children:"Battery"}),(0,t.jsxs)("span",{className:`font-medium ${e.level<=15&&!e.charging?"text-red-400":""}`,children:[e.level,"%"]})]}):null},"HeaderStatusWidget",0,function({only:e}={}){let{now:n,weather:a}=d(),o=(0,i.useChrome)(),{lang:c}=(0,s.useLanguage)(),u={en:"en-US","es-co":"es-CO","ar-sy":"ar-SY","uk-ua":"uk-UA",tl:"fil-PH",ur:"ur-PK",fr:"fr-FR",de:"de-DE",pt:"pt-BR",zh:"zh-CN",ja:"ja-JP",hi:"hi-IN"}[c]??"en-US";if(!n)return null;let m=n.toLocaleTimeString(u,{hour:"numeric",minute:"2-digit",hour12:!0}).replace(/ /g," ").replace(/ /g," ").replace(/\s*p\.\s*m\./i," p.m.").replace(/\s*a\.\s*m\./i," a.m.").replace(/\s+/g," ").trim(),h=e=>e.replace(/\p{L}[\p{L}\p{M}.]*/gu,e=>"de"===e.toLocaleLowerCase(u)?e.toLocaleLowerCase(u):e?e.charAt(0).toLocaleUpperCase(u)+e.slice(1):e),p=h(n.toLocaleDateString(u,{weekday:"short"})),f=h(n.toLocaleDateString(u,{month:"short",day:"numeric"})),x=`${p} ${f}`,g="w-3 h-3 shrink-0",b=(0,t.jsx)("span",{className:"text-content-disabled mx-0.5 select-none",children:"·"});return"weather"===e?o.weather&&a?(0,t.jsxs)("span",{className:r,children:[(0,t.jsx)(l,{code:a.code,cls:g}),(0,t.jsxs)("span",{children:[a.temp,"°F"]})]}):null:"date"===e?o.date?(0,t.jsx)("span",{className:r,children:(0,t.jsx)("span",{children:x})}):null:"clock"===e?o.clock?(0,t.jsx)("span",{className:r,children:(0,t.jsx)("span",{children:m})}):null:o.weather||o.date||o.clock?(0,t.jsxs)("div",{className:"flex select-none items-center gap-1 if-t-meta font-normal text-content-muted",children:[o.weather&&a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l,{code:a.code,cls:g}),(0,t.jsxs)("span",{children:[a.temp,"°F"]})]}),o.weather&&a&&(o.date||o.clock)&&b,o.date&&(0,t.jsx)("span",{children:x}),o.date&&o.clock&&b,o.clock&&(0,t.jsx)("span",{children:m})]}):null},"PerfChips",0,function({isStaff:e,only:s}){var l;let o=(0,i.useChrome)(),[c,d]=(0,n.useState)(!1);(0,n.useEffect)(()=>{try{d("1"===localStorage.getItem("if:admin-debug"))}catch{}function e(e){"if:admin-debug"===e.key&&d("1"===e.newValue)}return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[]);let u=e&&(c||o.perfCpu)&&(!s||"cpu"===s),m=e&&(c||o.perfRam)&&(!s||"ram"===s),h=e&&(c||o.perfNet)&&(!s||"net"===s),p=function(e){let[t,a]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(!e)return;let t=0,n=0,s=performance.now(),i=[];try{let e=new PerformanceObserver(e=>{for(let n of e.getEntries())t+=n.duration});e.observe({type:"longtask",buffered:!1}),i.push(e)}catch{}try{let e=new PerformanceObserver(e=>{for(let t of e.getEntries()){let e=t.transferSize;"number"==typeof e&&(n+=e)}});e.observe({type:"resource",buffered:!1}),i.push(e)}catch{}let r=window.setInterval(()=>{let e=performance.now(),i=Math.max(1,e-s),r=performance.memory;a({cpu:Math.min(1,t/i),ramMb:"number"==typeof r?.usedJSHeapSize?Math.round(r.usedJSHeapSize/1048576):null,ramLimitMb:"number"==typeof r?.jsHeapSizeLimit?Math.round(r.jsHeapSizeLimit/1048576):null,netBps:Math.round(n/i*1e3)}),t=0,n=0,s=e},2e3);return()=>{for(let e of(window.clearInterval(r),i))try{e.disconnect()}catch{}}},[e]),t}(u||m||h);if(!p)return null;let f=Math.round(100*p.cpu),x=f>=66?"text-red-400":f>=33?"text-amber-400":"",g="w-3 h-3 shrink-0";return(0,t.jsxs)(t.Fragment,{children:[u&&(0,t.jsxs)("div",{className:`${r} ${x}`,title:`Main thread blocked ${f}% of the last 2 seconds. Above 33% typing lags; above 66% the browser may offer to stop the page.`,children:[(0,t.jsx)(a.default,{name:"ui.activity",className:g}),(0,t.jsx)("span",{children:"CPU"}),(0,t.jsxs)("span",{className:"font-medium",children:[f,"%"]})]}),m&&null!==p.ramMb&&(0,t.jsxs)("div",{className:r,title:`JavaScript heap in use${p.ramLimitMb?`, of about ${p.ramLimitMb} MB this tab is allowed`:""}.`,children:[(0,t.jsx)(a.default,{name:"ui.stack",className:g}),(0,t.jsx)("span",{children:"Memory"}),(0,t.jsxs)("span",{className:"font-medium",children:[p.ramMb," MB"]})]}),h&&(0,t.jsxs)("div",{className:r,title:"Bytes transferred over the last 2 seconds. A number that never settles means something is polling.",children:[(0,t.jsx)(a.default,{name:"ui.globe",className:g}),(0,t.jsx)("span",{children:"Network"}),(0,t.jsx)("span",{className:"font-medium",children:(l=p.netBps)>=1048576?`${(l/1048576).toFixed(1)} MB/s`:l>=1024?`${Math.round(l/1024)} KB/s`:`${l} B/s`})]})]})}],362505)},451096,e=>{"use strict";var t=e.i(843476),n=e.i(271645),a=e.i(618566),s=e.i(920755),i=e.i(617355),r=e.i(885439),l=e.i(425757),o=e.i(196005),c=e.i(746040),d=e.i(499651),u=e.i(170431),m=e.i(594060);let h="f0e1a000-f0e1-f0e1-f0e1-000000000005";e.s(["default",0,function({onClose:e,initialTitle:p="",initialSummary:f=""}){let x,g,{t:b}=(0,l.useLanguage)(),w=[{value:"low",label:b("low"),color:(0,o.sgPriority)("low").color},{value:"medium",label:b("medium"),color:(0,o.sgPriority)("medium").color},{value:"high",label:b("high"),color:(0,o.sgPriority)("high").color},{value:"urgent",label:b("urgent"),color:(0,o.sgPriority)("urgent").color}
1],[y,v]=(0,n.useState)(p),[j,k]=(0,n.useState)(f),[N,C]=(0,n.useState)("tomorrow"),[S,_]=(0,n.useState)(""),[E,z]=(0,n.useState)(""),[T,$]=(0,n.useState)("medium"),[L,D]=(0,n.useState)([]),[I,M]=(0,n.useState)([]),[A,P]=(0,n.useState)(""),[U,F]=(0,n.useState)(null),[O,R]=(0,n.useState)([]),[W,B]=(0,n.useState)(null),[q,H]=(0,n.useState)(!1),[G,K]=(0,n.useState)(!1),[J,Y]=(0,n.useState)(!1),[V,Z]=(0,n.useTransition)(),Q=(0,n.useRef)(null),X=(0,a.useRouter)(),ee=(0,u.useAutoTranslate)("What needs to happen + why? (required, 20+ chars)");(0,n.useEffect)(()=>{if(y.trim().length<4)return void R([]);let e=setTimeout(async()=>{let e=(0,s.createClient)(),t=y.trim().split(/\s+/).filter(e=>e.length>3);if(!t.length)return;let{data:n}=await e.from("tasks").select("id, task_number, title, status").ilike("title",`%${t[0]}%`).not("status","in",'("done","closed")').limit(3);R(n??[])},400);return()=>clearTimeout(e)},[y]),(0,n.useEffect)(()=>{if(y.trim().length<8)return void B(null);let e=setTimeout(async()=>{H(!0);try{let e=await fetch("/api/tasks/estimate",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({title:y.trim()})});if(e.ok){let t=await e.json();B(t)}}catch{}finally{H(!1)}},900);return()=>clearTimeout(e)},[y]),(0,n.useEffect)(()=>{let e=(0,s.createClient)();e.auth.getUser().then(async({data:{user:t}})=>{if(!t)return;let{data:n}=await e.from("profiles").select("role").eq("id",t.id).single(),a=["superadmin","admin","staff"].includes(n?.role??""),s=e.from("brands").select("id, name").eq("status","active").order("name");if(!a){let{data:n}=await e.from("brand_members").select("brand_id").eq("profile_id",t.id),a=(n??[]).map(e=>e.brand_id);if(!a.length)return;s=s.in("id",a)}let{data:i}=await s,r=i??[];D(r),1===r.length&&z(r[0].id);let{data:l}=await (0,m.peopleList)(e.from("profiles").select("id, full_name, avatar_url, role, is_ai")).eq("is_active",!0).not("full_name","is",null).order("full_name").limit(200),o=l??[],c=o.find(e=>e.id===t.id),d=o.find(e=>e.id===h),u=o.filter(e=>e.id!==t.id&&e.id!==h&&e.full_name),p=[];for(let e of(c?.full_name&&p.push({id:c.id,full_name:c.full_name,avatar_url:c.avatar_url,is_ai:!!c.is_ai,is_my_clone:!1}),d?.full_name&&p.push({id:d.id,full_name:d.full_name,avatar_url:d.avatar_url,is_ai:!0,is_my_clone:!0}),u))e.full_name&&p.push({id:e.id,full_name:e.full_name,avatar_url:e.avatar_url,is_ai:!!e.is_ai,is_my_clone:!1});M(p),c&&P(c.id)}),setTimeout(()=>Q.current?.focus(),30)},[]),(0,n.useEffect)(()=>{let e=j.trim();if(J||y.trim().length>0||e.length<20)return;let t=!1,n=setTimeout(async()=>{K(!0);try{let n=await fetch("/api/tasks/generate-title",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({description:e})});if(t)return;if(n.ok){let e=await n.json();!e?.title||J||y.trim()||v(e.title)}}catch{}finally{t||K(!1)}},1200);return()=>{t=!0,clearTimeout(n)}},[j,J]);let et=(y.trim().length<24||/^(do|fix|update|check|look|help|review|handle|deal|sort)\b/i.test(y.trim()))&&!j.trim()&&y.trim().length>0;async function en(t){t.preventDefault();let n=y.trim(),a=j.trim();n?a.length<20?F("Add a short description (what plus why), at least 20 characters."):(F(null),Z(async()=>{let t=await (0,i.quickCreateTask)({title:n,summary:a,brandId:E||void 0,assignedTo:A||void 0,priority:T,dueDate:function(){let e=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,t=new Date;if("today"===N)return e(t);if("tomorrow"===N){let n=new Date(t);return n.setDate(n.getDate()+1),e(n)}if("week"===N){let n=new Date(t);return n.setDate(n.getDate()+7),e(n)}return"custom"===N&&/^\d{4}-\d{2}-\d{2}$/.test(S)?S:null}()});"error"in t?F(t.error):(X.push(`/tasks/${t.id}`),e())})):F(b("title_required"))}return(0,t.jsx)(c.default,{open:!0,onClose:e,title:b("quick_create_ticket"),size:"md",footer:(x=20-j.trim().length,g=y.trim()?x>0?`${x} more character${1===x?"":"s"} of description. What needs to happen, and why.`:null:"Give it a title first.",(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 px-5 py-3 border-t border-zinc-800 bg-zinc-900",children:[g?(0,t.jsx)("p",{className:"text-[11px] text-amber-500/90 truncate",children:g}):(0,t.jsx)("p",{className:"hidden sm:block text-[10px] text-content-muted truncate",children:b("fill_details_after_creating")}),(0,t.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[(0,t.jsx)("button",{type:"button",onClick:e,disabled:V,className:"px-3 py-2 text-sm text-zinc-400 hover:text-zinc-200 transition-colors",children:b("cancel")}),(0,t.jsxs)("button",{type:"submit",form:"quick-create-task-form",disabled:V||!!g,title:g??void 0,className:"flex items-center gap-1.5 px-4 py-2 r-container text-sm font-medium text-content-primary btn-accent disabled:opacity-50 disabled:cursor-not-allowed transition-opacity",children:[V?(0,t.jsx)(r.default,{name:"check.loader",className:"w-3.5 h-3.5 animate-spin"}):(0,t.jsx)(r.default,{name:"action.add",className:"w-3.5 h-3.5"}),b("create")]})]})]})),children:(0,t.jsxs)("form",{id:"quick-create-task-form",onSubmit:en,className:"p-4 sm:p-5 space-y-4 overflow-y-auto",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{ref:Q,value:y,onChange:e=>{v(e.target.value),Y(!0)},placeholder:b("ticket_title_placeholder"),className:"w-full bg-zinc-800 border border-zinc-700 r-container px-4 py-3 text-sm text-zinc-100 placeholder:text-content-muted focus:outline-none focus:border-zinc-500 transition-colors",disabled:V}),G&&(0,t.jsxs)("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1 text-[10px] text-violet-400",children:[(0,t.jsx)(r.default,{name:"ui.sparkle",className:"w-3.5 h-3.5 animate-pulse"})," ",(0,t.jsx)(u.default,{children:"auto-titling…"})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("textarea",{value:j,onChange:e=>k(e.target.value),placeholder:ee,rows:3,className:"w-full bg-zinc-800 border border-zinc-700 r-container px-4 py-3 text-sm text-zinc-100 placeholder:text-content-muted focus:outline-none focus:border-zinc-500 transition-colors resize-none leading-relaxed",disabled:V}),(0,t.jsxs)("p",{className:`text-[10px] ${j.trim().length>=20?"text-zinc-600":"text-amber-500/80"}`,children:[j.trim().length,(0,t.jsx)(u.default,{children:"/20+ chars"})]})]}),et&&(0,t.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded-lg bg-violet-500/5 border border-violet-500/20",children:[(0,t.jsx)(r.default,{name:"ui.sparkle",className:"w-3.5 h-3.5 text-violet-400 shrink-0 mt-0.5"}),(0,t.jsxs)("p",{className:"text-xs text-violet-200/90 leading-snug",children:[(0,t.jsx)("span",{className:"font-semibold",children:(0,t.jsx)(u.default,{children:"Sharpen the ask."})})," ",(0,t.jsx)(u.default,{children:'Add the desired outcome and the "why it matters". Tasks like "fix it" or "update" without context land at the bottom of an inbox. One sentence is usually enough.'})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-content-muted mr-1",children:(0,t.jsx)(u.default,{children:"Due"})}),[{k:"today",label:"Today"},{k:"tomorrow",label:"Tomorrow"},{k:"week",label:"Next week"},{k:"",label:"No date"}].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>C(e.k),disabled:V,className:`text-[11px] px-2.5 py-1 rounded-full border transition-colors ${N===e.k?"bg-[var(--if-purple)] text-[var(--on-accent)] border-transparent":"bg-zinc-800/60 text-zinc-400 border-zinc-700 hover:text-zinc-200 hover:border-zinc-600"}`,children:(0,t.jsx)(u.default,{children:e.label})},e.k||"none")),(0,t.jsx)("input",{type:"date","aria-label":"Pick a due date",title:"Pick a date",value:S,min:new Date().toISOString().slice(0,10),disabled:V,onChange:e=>
1{_(e.target.value),C(e.target.value?"custom":"tomorrow")},className:`r-control border px-2 py-0.5 text-xs transition-colors ${"custom"===N?"border-transparent bg-brand text-[var(--on-accent)]":"border-line-base bg-surface-input text-content-secondary"}`})]}),(q||W)&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-zinc-800/60 border border-zinc-700/60",children:[(0,t.jsx)(r.default,{name:"ui.sparkle",className:"w-3.5 h-3.5 text-violet-400 shrink-0"}),q?(0,t.jsx)("span",{className:"text-xs text-content-muted animate-pulse",children:b("estimating_time")}):W?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.default,{name:"ui.clock",className:"w-3.5 h-3.5 text-content-muted shrink-0"}),(0,t.jsxs)("span",{className:"text-xs text-zinc-300",children:[b("estimated_label")," ",(0,t.jsx)("span",{className:"font-semibold text-content-primary",children:W.label})]}),"low"===W.confidence&&(0,t.jsx)("span",{className:"ml-auto text-[10px] text-content-muted",children:b("low_confidence")})]}):null]}),O.length>0&&(0,t.jsxs)("div",{className:"bg-amber-500/5 border border-amber-500/20 r-container px-3 py-2.5 space-y-1.5",children:[(0,t.jsxs)("p",{className:"text-[10px] font-semibold text-amber-400 uppercase tracking-wide flex items-center gap-1",children:[(0,t.jsx)(r.default,{name:"ui.warning",className:"w-3.5 h-3.5"}),b("similar_tickets_warning")]}),O.map(n=>(0,t.jsxs)("button",{type:"button",onClick:()=>{X.push(`/tasks/${n.id}`),e()},className:"w-full text-left flex items-center gap-2 hover:bg-amber-500/10 rounded-lg px-2 py-1 transition-colors group",children:[(0,t.jsxs)("span",{className:"text-[10px] text-content-muted",children:["#",n.task_number]}),(0,t.jsx)("span",{className:"text-xs text-zinc-400 group-hover:text-zinc-200 truncate flex-1 transition-colors",children:n.title}),(0,t.jsx)("span",{className:"text-[10px] text-content-muted shrink-0",children:n.status.replace("_"," ")})]},n.id))]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-[10px] uppercase tracking-wider text-content-muted mb-1.5",children:b("assignee")||"Assignee"}),(0,t.jsx)(d.default,{label:b("assignee")||"Assignee",value:A,onChange:e=>P(e??""),searchable:!0,tone:"presentation",options:I.map(e=>({value:e.id,label:e.is_my_clone?`${e.full_name} (your clone, autonomous)`:e.full_name,avatarUrl:e.avatar_url??void 0,group:e.is_my_clone?"Your assistant":e.is_ai?"Bots":"Team"}))}),A===h&&(0,t.jsxs)("p",{className:"mt-1.5 text-[10px] text-violet-300 flex items-center gap-1",children:[(0,t.jsx)(r.default,{name:"action.bot-work",className:"w-3.5 h-3.5"}),(0,t.jsx)(u.default,{children:"Your assistant will pick this up automatically and start working on it."})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-[10px] uppercase tracking-wider text-content-muted mb-1.5",children:b("brand")}),(0,t.jsxs)("select",{value:E,onChange:e=>z(e.target.value),disabled:V||0===L.length,className:"w-full appearance-none bg-zinc-800 border border-zinc-700 r-container px-3 py-2.5 text-sm text-zinc-200 focus:outline-none focus:border-zinc-500 transition-colors disabled:opacity-50",children:[(0,t.jsx)("option",{value:"",children:b("no_brand")}),L.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-[10px] uppercase tracking-wider text-content-muted mb-1.5",children:(0,t.jsx)(u.default,{children:"Priority"})}),(0,t.jsx)("select",{value:T,onChange:e=>$(e.target.value),disabled:V,className:"w-full appearance-none bg-zinc-800 border border-zinc-700 r-container px-3 py-2.5 text-sm text-zinc-200 focus:outline-none focus:border-zinc-500 transition-colors",children:w.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]})]}),U&&(0,t.jsx)("p",{className:"text-xs text-red-400 bg-red-400/10 border border-red-400/20 rounded-lg px-3 py-2",children:U})]})})}])},164240,13562,e=>{"use strict";var t=e.i(843476),n=e.i(618566),a=e.i(885439);let s=[{match:e=>"/home"===e||e.startsWith("/home/")||"/"===e,label:"Home",description:"Your personal command center.",tips:[{icon:"entity.task",title:"See your work",description:"Tasks, notes, and recent activity are surfaced here so nothing falls through the cracks."},{icon:"action.add",title:"Quick-create anything",description:"Tap the + button in the header to create a task, note, or event without leaving home."},{icon:"ui.calendar",title:"Today's schedule",description:"Your upcoming events and deadlines appear on the calendar strip at the top."},{icon:"nav.search",title:"Search everything",description:"Press Cmd+K, or Cmd+/ for the search box in the bottom bar. It finds people, chats, brands, tasks, notes, replays and pages you can see. Arrows move, Enter opens, and @ # $ ^ & * narrow to one kind."},{icon:"ai.fuela",title:"Ask Fuela",description:"Type a question in search and press Tab, or start with /. Fuela answers from what your account can see, and the mic lets you ask out loud."},{icon:"action.bookmark",title:"Saved Items",description:"Bookmark anything to read later, or pin it to keep it in place. Both live in Saved Items, bottom left."},{icon:"nav.people",title:"Who is online",description:"The Online chip, bottom left, lists who is here now and who was on today, with their badge and brand. The stack icon groups the list by Role or Location. A brand opens its team chat if you are staff or on that brand, or its public page if it has one. The hand sends that person a wave in a direct message, once a minute."}]},{match:e=>e.startsWith("/chat"),label:"Chat",description:"Real-time messaging with your team and brands.",tips:[{icon:"action.add",title:"New conversation",description:"Tap the + button to open a direct message, group chat, or brand channel."},{icon:"entity.person",title:"Mention someone",description:"Type @ and a name to mention a person. They get notified and a photo chip appears."},{icon:"entity.task",title:"Reference a task",description:"Type $ to embed a task link directly into your message."},{icon:"entity.brand",title:"Reference a brand",description:"Type # to link a brand inside your message."},{icon:"action.edit",title:"Bold and bullets",description:"Click into the box and a bar opens above it: Bold, Bullets, and a button for every mention key (@ Builder, # Brand, $ Task and the rest). What you format is what you see. Cmd+B, Cmd+I, **words**, and - or 1. at the start of a line work too, and Shift+Enter starts the next bullet."},{icon:"ai.fuela",title:"Compose, then pick a tone",description:"Compose, Clean Up and the email writer read the latest messages. O
1nce a draft is in the box, the bar above it offers Professional, Friendly or Funny, and Undo to step back."},{icon:"action.more",title:"The + menu",description:"The buttons under the box stay on one line. The ones that do not fit on a narrow window move into the + menu, Song first. The + menu also has Fuel and Request Fuel, named for the person in a direct message, and for the brand in a brand chat when you are staff."},{icon:"comm.mic",title:"Voice messages",description:"Hold the mic button to record, release to send."},{icon:"comm.video",title:"Start a call",description:"Tap the video or phone icon in any conversation to start a call."},{icon:"action.bookmark",title:"Save a message",description:"Bookmark a message to come back to it, or pin it to keep it at the top of the conversation."}]},{match:e=>e.startsWith("/tasks"),label:"Tasks",description:"Plan, track, and ship everything your team is working on.",tips:[{icon:"action.add",title:"Create a task",description:"Tap the + button in the top right to create a new task."},{icon:"filter.status",title:"Filter",description:"Use the filter bar to narrow by status, priority, brand, or assignee."},{icon:"view.gallery",title:"Switch views",description:"Choose between Gallery, List, Board, Timeline, and Calendar layouts."},{icon:"view.board",title:"Board drag-and-drop",description:"In Board view, drag tasks between columns to update their status instantly."},{icon:"entity.task",title:"Open task detail",description:"Click any task to open its full detail panel with comments, files, and history."},{icon:"action.send",title:"Share to chat",description:"Use the Send button on a task to share it directly into a conversation."},{icon:"ui.clock",title:"Track time",description:"Start the timer on a task to log how long you spend on it."}]},{match:e=>e.startsWith("/notes"),label:"Docs",description:"Capture ideas, meeting notes, and docs in one place.",tips:[{icon:"action.add",title:"Create a note",description:"Tap the + button to start writing a new note."},{icon:"entity.person",title:"Mention people",description:"Type @ to mention someone and notify them."},{icon:"entity.brand",title:"Mention brands",description:"Type # to reference a brand inside the note."},{icon:"entity.task",title:"Link tasks",description:"Type $ to embed a task link directly in the note body."},{icon:"action.send",title:"Share to chat",description:"Post the note to a chat channel using the Send button."},{icon:"comm.mic",title:"Voice memos",description:"Attach a voice recording to any note from the attachment bar."},{icon:"action.pin",title:"Pin important notes",description:"Pin a note to keep it at the top of your list."}]},{match:e=>e.startsWith("/projects"),label:"Projects",description:"Plans with tasks, dates and people, each tied to the goal it moves.",tips:[{icon:"nav.projects",title:"Open a project",description:"Click a project to open it: its tasks as Today, Next and Done, the team, the brand and its fuel plan, the dates, the lead, and the goal it belongs to."},{icon:"entity.task",title:"Add a task",description:"Type a task under the list in the project and press Add. Give it a date or leave it without one. Click any task to open it in the task window."},{icon:"nav.goals",title:"Go to its goal",description:"The goal on the right opens that goal. The arrow at the top comes back to the project."},{icon:"ui.link",title:"Share it",description:"Copy link gives an address that opens this project for anyone who can see it."},{icon:"action.edit",title:"Change it",description:"Status, Archive, Edit and Delete are there for whoever made the project and for the team."}]},{match:e=>e.startsWith("/goals"),label:"Goals",description:"What you are working towards, with a date, and the projects that get you there.",tips:[{icon:"nav.goals",title:"Open a goal",description:"Click a goal's title to open it: its dream, its projects, its progress and dates, whose goal it is, and every task across its projects."},{icon:"ui.link",title:"Link a project",description:"Link a project puts one of your projects under the goal. Create a project opens the project form with the goal already chosen."},{icon:"nav.dreams",title:"Its dream",description:"The dream on the right opens that dream. A goal is put under a dream from the dream itself."},{icon:"ui.lock",title:"Who sees a goal",description:"You see your own goals, the ones set up for you, your brand's, and the goals under your dreams. Other people's goals stay theirs. A private goal is yours alone."}]},{match:e=>e.startsWith("/dreams"),label:"Dreams",description:"The dream board. Every dream can hold the goals that make it real.",tips:[{icon:"nav.dreams",title:"Open a dream",description:"Click a dream to open it, with its goals and their projects underneath."},{icon:"action.add",title:"Create a goal",description:"On your own dream, Create a goal opens the goal form with the dream filled 
1in. The new goal opens straight after, ready for its first project."},{icon:"ui.link",title:"Link a goal",description:"Link a goal puts a goal you already have under the dream. A goal sits under one dream at a time."},{icon:"nav.goals",title:"Open a goal",description:"Click a goal or a project under a dream to open it. The goal's Dream link brings you back."}]},{match:e=>e.startsWith("/happy"),label:"Happy",description:"Collect what makes you happy. One picture, one or two words.",tips:[{icon:"action.add",title:"Put something up",description:"A picture and one or two trigger words. Things, feelings, people, experiences. There is nothing else to fill in, and that is on purpose: a board you have to write an essay for is a board you stop using."},{icon:"action.pin",title:"Pin this week",description:"Pin what you are working on now, today or this week. Pinned cards sit at the top under Working on now, so the board opens on what you are actually pointed at."},{icon:"ui.lock",title:"Private is the default",description:"A new card goes on your private board and nobody else can see it. Move it to Community, a brand or a chat when you want people in on it."},{icon:"action.heart",title:"Heart and comment",description:"On a shared board you can heart someone's card and leave a comment. Both stay on the card."},{icon:"action.fuel",title:"Fuel each other",description:"Fuel offers someone real support in the language they said they need, the same way it works on the feed. Praise, a fix, an hour, a gift, or turning up."},{icon:"view.gallery",title:"Make it a mood board",description:"A board fills up and starts reading as one thing: the mood for a design, a project or a lifestyle. Use the column slider to see more or fewer at once."}]},{match:e=>e.startsWith("/admin/time-logs"),label:"Timesheets",description:"Hours reported, and the worked time the system can see, side by side.",tips:[{icon:"nav.time-logs",title:"How worked time is counted",description:"From what the system already records: time in the app while you use it (mouse, keys, scrolling, switching between Insert Fuel tabs), the prompts you type into Claude on an Insert Fuel Claude account, the messages, comments and task changes you make, and the calls you are in. Activity less than ten minutes apart counts as one stretch of work."},{icon:"ui.clock",title:"What is never recorded",description:"Only when something happened, never what you typed or said. Nothing records keystrokes, screens or other apps."},{icon:"entity.person",title:"Who sees it",description:"Everybody sees their own row. Admins see the team, with reported hours beside the evidence and the gaps inside work hours, so a question can be asked before anything is assumed."},{icon:"ui.clock",title:"The Worked chip",description:"The Worked chip in the reminder bar uses the same count for today; hover it to see how much came from each source."}]},{match:e=>"/sitemap"===e,label:"Sitemap",description:"Every page in the app, read from the code on each deploy. Only the team can open it.",tips:[{icon:"ui.eye-off",title:"Find the hidden pages",description:"Press In no menu to see only the pages nothing links to: not the website menu, not the sidebar, not the footer."},{icon:"nav.search",title:"Search anything",description:"Type part of a name, an address or a menu label. Every word you type has to match, so admin people finds Admin people."},{icon:"ui.lock",title:"Who can open it",description:"Public, Signed in, Team, Admin or Superadmin, read from each page's own sign-in and role checks. Hover the label to see which check."},{icon:"ui.link",title:"Open an example",description:"An address like /brands/[id] needs a real brand. Where one exists, Open an example takes you to it."},{icon:"entity.page",title:"Always current",description:"The list is rebuilt from the code on every deploy, so a new page shows up the day it ships. The Sitemap link is in the website footer, for the team only."}]},{match:e=>e.startsWith("/portal/events"),label:"Calendar",description:"Schedule, host, and manage events for your team and brands.",tips:[{icon:"action.add",title:"Create an event",description:"Tap the + button to schedule a new event with date, time, and details."},{icon:"entity.person",title:"Invite people",description:"Name someone when you type the event and they are invited: Meet Uzair for coffee Friday 2pm invites Uzair, if you have a direct chat with him. The box says who it will invite before you press Enter. Add or remove people later in Edit Event."},{icon:"entity.person",title:"See who is coming",description:"An event lists its organizer and everyone invited, Google invites included. Hover a face for their status and local time, or click it to open their profile."},{icon:"comm.video",title:"The call is the place",description:"Every event gets its own Insert Fuel call. It shows as the location, in the event and in Edit Event, and Join call opens it. Type an address to meet in person; the call link stays."},{icon:"ui.recurring",title:"Weekly brand calls",description:"A brand's weekly call, like Stratahub Weekly, is a real weekly event with its own call. Its chip at the top of the page opens the next one."},{icon:"comm.video",title:"Go Live",description:"Start a Go Live video session directly from an event."},{icon:"entity.replay",title:"Attach a replay",description:"Link a recorded call to an event so attendees can watch it afterwards."}
1,{icon:"entity.replay",title:"Watch the last coaching call",description:"Hover the Weekly Coaching chip at the top of any page, or open the Weekly Coaching event. If you are in the LET GO BOSS chat or were on the call, the last call's replay is there with who was on it and three takeaways. Click a takeaway to watch from that moment."},{icon:"ui.calendar",title:"Calendar view",description:"Events appear on your calendar and can sync to external calendars."}]},{match:e=>e.startsWith("/spaces"),label:"Communities",description:"Connect, collaborate, and grow with your community members.",tips:[{icon:"action.add",title:"Create a post",description:"Tap the + button to write a new post in your active community."},{icon:"comm.message",title:"Community chat",description:"Switch to the Chat tab to message community members in real time."},{icon:"comm.video",title:"Go Live sessions",description:"Join or host a live video session from the community."},{icon:"entity.person",title:"See members",description:"Check the Members tab to see who's in the community and connect."},{icon:"action.pin",title:"Pin posts",description:"As an owner or moderator, pin posts so members always see them first."}]},{match:e=>e.startsWith("/replays")||e.startsWith("/meetings")||e.startsWith("/recordings"),label:"Replays",description:"Watch, review, and share recorded calls and sessions.",tips:[{icon:"entity.replay",title:"Watch a replay",description:"Click any replay to watch the full recording. Summary, Topics, Actions and Transcript sit in tabs beside the player."},{icon:"entity.replay",title:"Jump to a moment",description:"Every point in the summary and every transcript line carries its time. Click it and the video plays from there. The chapter names above the player jump to each part."},{icon:"comm.video",title:"Video messages too",description:"A video sent in chat gets its own replay with the same tabs: a summary, topics, actions and a timed transcript, written on its own a minute or two after it is sent."},{icon:"action.edit",title:"Trim the start",description:"Builders: press Edit on a replay, play to where it should begin, choose Use the current playhead (or type a time like 6:53), then Save. Everything before it is hidden from everyone; Remove trim undoes it."},{icon:"comm.chat",title:"Add comments",description:"Leave a timestamped comment at any point in the video."},{icon:"action.send",title:"Send a moment to chat",description:"Play to the moment, press Send to chat, pick a group chat or DM and add a caption. It arrives as a video that starts right there."},{icon:"entity.brand",title:"Filter by brand",description:"Filter replays to show only calls linked to a specific brand."}]}];function i(e){return s.find(t=>t.match(e))??null}e.s(["getPageHelp",0,i],13562),e.s(["default",0,function({open:e,onClose:s}){let r=i((0,n.usePathname)());if(!e)return null;let l=r?.label??"This Page",o=r?.description??"Tips for using this page.",c=r?.tips??[];return(0,t.jsxs)("div",{className:"fixed inset-0 z-[300]",onMouseDown:s,children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-[2px]"}),(0,t.jsxs)("div",{className:"absolute top-[60px] right-3 w-[340px] max-h-[calc(100vh-72px)] flex flex-col bg-surface-card border border-line-base rounded-2xl shadow-2xl overflow-hidden animate-in slide-in-from-top-1 fade-in duration-150",onMouseDown:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2 px-4 pt-4 pb-3 border-b border-line-subtle shrink-0",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,t.jsx)(a.default,{name:"ui.tutorial",size:13,className:"text-brand-ink shrink-0"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold text-brand-ink uppercase tracking-wider",children:"What you can do"})]}),(0,t.jsx)("h2",{className:"text-sm font-bold text-content-primary",children:l}),(0,t.jsx)("p",{className:"text-xs text-content-muted mt-0.5 leading-relaxed",children:o})]}),(0,t.jsx)("button",{onClick:s,className:"w-7 h-7 flex items-center justify-center rounded-lg hover:bg-surface-hover transition-colors text-content-muted shrink-0 mt-0.5",children:(0,t.jsx)(a.default,{name:"window.close",size:14})})]}),(0,t.jsx)("div",{className:"if-fade-overflow overflow-y-auto flex-1 p-2",children:0===c.length?(0,t.jsx)("p",{className:"text-sm text-content-muted text-center py-8 px-4",children:"No tips available for this page yet."}):(0,t.jsx)("div",{className:"flex flex-col gap-0.5",children:c.map((e,n)=>(0,t.jsxs)("div",{className:"flex items-start gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-hover transition-colors",children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded-lg bg-brand-soft flex items-center justify-center shrink-0 mt-0.5",children:(0,t.jsx)(a.default,{name:e.icon,size:13,className:"text-brand-ink"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-content-primary leading-snug",children:e.title}),(0,t.jsx)("p",{className:"text-xs text-content-muted mt-0.5 leading-relaxed",children:e.description})]})]},n))})})]})]})}],164240)},826581,727633,401176,607999,218071,e=>{"use strict";e.s(["localDateStr",0,function(e,t=new Date){let n=new Intl.DateTimeFormat("en-CA",{timeZone:e||"America/Chicago",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(t),a=n.find(e=>"year"===e.type)?.value??"",s=n.find(e=>"month"===e.type)?.value??"",i=n.find(e=>"day"===e.type)?.value??"";return`${a}-${s}-${i}`}],826581);var t=e.i(843476),n=e.i(271645),a=e.i(618566),s=e.i(885439),i=e.i(920755),r
1=e.i(531478),l=e.i(307400);function o(e){let t=/^(\d{1,2}):(\d{2})/.exec((e??"").trim());if(!t)return null;let n=Number(t[1]),a=Number(t[2]);return n>23||a>59?null:60*n+a}function c(e,t){let n=o(t);if(null==n)return null;let a=n-(60*e.getHours()+e.getMinutes());return a<=0||a>60?null:{minutesLeft:a,urgent:a<=15}}e.s(["default",0,function({userId:e}){let o=(0,a.useRouter)(),[d,u]=(0,n.useState)(null),m=(0,r.useNow)(3e4);if((0,n.useEffect)(()=>{let t=!0;return(async()=>{try{let n=(0,i.createClient)(),{data:a}=await n.from("profiles").select("work_hours_end").eq("id",e).maybeSingle();t&&u(a?.work_hours_end??null)}catch{}})(),()=>{t=!1}},[e]),null==m)return null;let h=c(new Date(m),d);return h?(0,t.jsxs)("button",{type:"button",onClick:()=>o.push("/tasks"),title:`Your shift ends in ${h.minutesLeft} minutes. Finish up and close the day.`,className:(0,l.statusChip)("amber","if-breathe cursor-pointer",{attention:h.urgent}),children:[(0,t.jsx)("span",{className:(0,l.statusChipAccent)("amber"),children:(0,t.jsx)(s.default,{name:"ui.clock",size:14})}),(0,t.jsx)("span",{children:"Wrap up"}),(0,t.jsx)("span",{className:(0,l.statusChipValue)(`tabular-nums ${(0,l.statusChipAccent)("amber")}`),children:`${h.minutesLeft} min left`})]}):null}],727633);var d=e.i(310119),u=e.i(717359);function m(e){let t=e.quiet_hours_enabled?o(e.quiet_hours_start):null;if(null!=t)return{stop:t,resume:o(e.quiet_hours_end)??0};let n=o(e.work_hours_end);return null!=n?{stop:n,resume:0}:null}function h(e){let t=Math.floor(e/60),n=e%60;return t&&n?`${t}h ${n}m`:t?`${t}h`:`${Math.max(0,n)}m`}e.s(["default",0,function({userId:e}){let a=(0,d.useChrome)(),[p,f]=(0,n.useState)(null),x=(0,r.useNow)(3e4);if((0,n.useEffect)(()=>{let t=!0;return(async()=>{try{let{data:n}=await (0,i.createClient)().from("profiles").select("work_hours_end, quiet_hours_enabled, quiet_hours_start, quiet_hours_end").eq("id",e).maybeSingle();t&&f(n??{})}catch{}})(),()=>{t=!1}},[e]),null==x||!p)return null;let g=new Date(x),b=function(e,t){let n=m(t);if(!n)return null;let a=60*e.getHours()+e.getMinutes(),{stop:s,resume:i}=n;return(i<=s?a>=s||a<i:a>=s&&a<i)?{kind:"past",minutesPast:a>=s?a-s:a+1440-s,stopAt:s}:{kind:"before",minutesLeft:s>a?s-a:s+1440-a,stopAt:s}}(g,p);if(!b)return null;let w=m(p);if("before"===b.kind&&a.wrapUp&&c(g,p.work_hours_end)&&w&&o(p.work_hours_end)===w.stop)return null;let y=new Date(2e3,0,1,Math.floor(b.stopAt/60),b.stopAt%60).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),v="past"===b.kind;return(0,t.jsxs)("span",{className:(0,l.statusChip)(v?"amber":"neutral"),title:v?`You planned to stop at ${y}. Settings > Work hours changes it.`:`You stop at ${y}. Settings > Work hours changes it.`,children:[(0,t.jsx)("span",{className:v?(0,l.statusChipAccent)("amber"):void 0,children:(0,t.jsx)(s.default,{name:"ui.moon",...(0,u.icon)("status")})}),(0,t.jsx)("span",{className:(0,l.statusChipValue)(`tabular-nums ${v?(0,l.statusChipAccent)("amber"):""}`),children:"before"===b.kind?`Stop in ${h(b.minutesLeft)}`:`Past stop \xb7 ${h(b.minutesPast)}`})]})}],401176);var p=e.i(391646),f=e.i(958515);e.s(["default",0,function(){let e=(0,p.useWeatherVibes)(null);if(!e)return null;let{data:n,nowUnix:a,isDay:i,resolvedTz:r}=e,o=i?n.sunset:a<n.sunrise?n.sunrise:n.sunrise+86400,c=new Date(1e3*o).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,...r?{timeZone:r}:{}}),d=i?"Sunset":"Sunrise",m=(0,f.spellDuration)((o-a)*1e3);return(0,t.jsxs)("span",{className:(0,l.statusChip)(),title:`${d} at ${c}, in ${m}.`,children:[(0,t.jsx)(s.default,{name:"ui.sun-horizon",...(0,u.icon)("status")}),(0,t.jsx)("span",{children:d}),(0,t.jsxs)("span",{className:(0,l.statusChipValue)("tabular-nums"),children:["in ",m]})]})}],607999),e.s(["default",0,function(){let e=(0,r.useNow)(3e4),[a,i]=(0,n.useState)(null);if((0,n.useEffect)(()=>{let e=!0,t=async()=>{try{let t=await fetch("/api/daily-brief?mode=status",{cache:"no-store"}),n=await t.json();e&&i(n?.ok?n:null)}catch{}};t();let n=setInterval(t,3e5),a=()=>void t();return window.addEventListener("if:standup-posted",a),()=>{e=!1,clearInterval(n),window.removeEventListener("if:standup-posted",a)}},[]),!a||a.posted||null==e)return null;let o=a.dueAt-e;return o<=0||o>36e5?null:(0,t.jsxs)("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("if:daily-brief-open")),title:"Three quick answers about your day, for tomorrow's Daily Call. Due when your shift ends.",className:(0,l.statusChip)("brand","cursor-pointer"),children:[(0,t.jsx)("span",{className:(0,l.statusChipAccent)("brand"),children:(0,t.jsx)(s.default,{name:"action.edit",size:14})}),(0,t.jsx)("span",{children:"Wrap-up notes"})]})}],218071)},979551,e=>{"use strict";var t=e.i(271645),n=e.i(920755),a=e.i(667554),s=e.i(953792);let i="if:water-day",r="if:water-climate";async function l(){let e=(0,a.deviceDay)(new Date);try{let t=JSON.parse(localStorage.getItem(r)??"null");if(t?.day===e&&t.c)return t.c}catch{}try{let t=await fetch("/api/water/climate");if(!t.ok)return null;let n=await t.json();try{localStorage.setItem(r,JSON.stringify({day:e,c:n}
1))}catch{}return n}catch{return null}}e.s(["useWaterToday",0,function(){let[e,r]=(0,t.useState)(null),[o,c]=(0,t.useState)(null),[d,u]=(0,t.useState)(a.DEFAULT_FASTING),[m,h]=(0,t.useState)({start:null,end:null}),[p,f]=(0,t.useState)(null),[x,g]=(0,t.useState)(!1),[b,w]=(0,t.useState)(null),[y,v]=(0,t.useState)([]),[j,k]=(0,t.useState)(null),[N,C]=(0,t.useState)(!1),[S,_]=(0,t.useState)(0),[E,z]=(0,t.useState)(null),[T,$]=(0,t.useState)(null),[L,D]=(0,t.useState)(!1);(0,t.useEffect)(()=>{let e=!1;return(async()=>{let t=(0,n.createClient)(),{data:{user:i}}=await t.auth.getUser();if(!i||e)return;let[{data:l},{data:o}]=await Promise.all([t.from("profiles").select("water_prefs, fasting, role, gender, work_hours_start, work_hours_end, quiet_hours_enabled, quiet_hours_start, quiet_hours_end, timezone, meals, lunch_time, dinner_time, notification_prefs").eq("id",i.id).single(),t.rpc("fn_my_work_hours_7d")]);if(e)return;let d={start:l?.work_hours_start??null,end:l?.work_hours_end??null};r(i.id),c((0,s.cleanWater)(l?.water_prefs)),u((0,a.cleanFasting)(l?.fasting)),h(d),f(l?{quiet_hours_enabled:l.quiet_hours_enabled,quiet_hours_start:l.quiet_hours_start,quiet_hours_end:l.quiet_hours_end,timezone:l.timezone}:null),g(s.BUILDER_ROLES.has(String(l?.role??""))),w((0,s.waterSex)(l?.gender)),v((0,a.mealsFromProfile)(l)),_(Number(o)||0),z(function(e,t=Date.now()){let n=(0,s.shiftWindow)(t,e.start,e.end);return(0,a.deviceDay)(new Date(n?n.startMs:t))}(d))})(),()=>{e=!0}},[]),(0,t.useEffect)(()=>{if(!o?.auto_goal||N)return;let e=!1;return l().then(t=>{e||(k(t),C(!0))}),()=>{e=!0}},[o,N]);let I=o?.auto_goal?(0,s.dailyWaterGoal)(b,j,(0,s.shiftMinutes)(m.start,m.end)):null;(0,t.useEffect)(()=>{if(!e||!E)return;let t=!1;return(async()=>{let{data:a}=await (0,n.createClient)().from("water_days").select("gulps, goal_gulps, bottle_ml, gulps_per_bottle, confirmed_at, last_gulp_at").eq("profile_id",e).eq("logged_date",E).maybeSingle();t||($(a??null),D(!0))})(),()=>{t=!0}},[e,E]),(0,t.useEffect)(()=>{function e(e){let t=e.detail;t?.row&&t.dayKey===E&&$(t.row)}return window.addEventListener(i,e),()=>window.removeEventListener(i,e)},[E]);let M=(0,t.useCallback)(e=>{z(t=>t===e?t:(D(!1),$(null),e))},[]),A=(0,t.useCallback)(async t=>{if(!e||!E)return!1;$(t),window.dispatchEvent(new CustomEvent(i,{detail:{dayKey:E,row:t}}));let{error:a}=await (0,n.createClient)().from("water_days").upsert({profile_id:e,logged_date:E,...t,updated_at:new Date().toISOString()},{onConflict:"profile_id,logged_date"});return!a},[e,E]);return{uid:e,prefs:o,fasting:d,shift:m,quiet:p,builder:x,meals:y,climateLoaded:N,hours7d:S,goal:I,goalFists:I?.shiftFists,dayKey:E,day:T,dayLoaded:L,syncDayKey:M,save:A}}])},504941,e=>{"use strict";var t=e.i(843476),n=e.i(271645),a=e.i(522016),s=e.i(307400),i=e.i(915120),r=e.i(958515),l=e.i(920755),o=e.i(826581),c=e.i(425757),d=e.i(310119),u=e.i(539324),m=e.i(727633),h=e.i(401176),p=e.i(607999),f=e.i(218071),x=e.i(362505),g=e.i(137701),b=e.i(885439),w=e.i(702475),y=e.i(174080),v=e.i(198481),j=e.i(574629),k=e.i(979551),N=e.i(644651),C=e.i(296582),S=e.i(667554),_=e.i(953792),E=e.i(843074),z=e.i(892286);let T=[{name:"Tea",fists:1},{name:"Coffee",fists:1}];function $(){let e=(0,z.useUnitsSystem)(),{uid:a,prefs:r,meals:l,goalFists:o,dayKey:c,day:d,dayLoaded:u,save:m}=(0,k.useWaterToday)(),[h,p]=(0,n.useState)(!1),[f,x]=(0,n.useState)(!1),[g,w]=(0,n.useState)(null),[$,L]=(0,n.useState)([]),D=(0,n.useRef)(null),I=(0,n.useRef)(null),M=(0,n.useRef)(null),A=r?(0,_.gulpRow)(d,r,o):null,P=!!a&&!!r&&!!c&&u&&!!A,U=(0,n.useCallback)(async(e,t)=>{if(!P||!A)return;let n={...A,gulps:A.gulps+e,last_gulp_at:new Date().toISOString()};L(n=>[...n.slice(-9),{gulps:e,label:t}]),p(!0),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>p(!1),700),(0,N.playCue)("water"),await m(n)},[P,A,m]);async function F(){let e=$[$.length-1];e&&A&&(L(e=>e.slice(0,-1)),await m({...A,gulps:Math.max(0,A.gulps-e.gulps)}))}let O=(0,n.useRef)(U);(0,n.useEffect)(()=>{O.current=U}),(0,n.useEffect)(()=>{function e(e){!e.shiftKey||e.metaKey||e.ctrlKey||e.altKey||"W"!==e.key||e.repeat||(0,C.isTypingTarget)(e,{allowOpenDialog:!0})||e.ifWater||(e.ifWater=!0,e.preventDefault(),O.current(_.GULPS_PER_FIST,"1 fist"))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let R=(0,n.useCallback)(()=>{let e=D.current?.getBoundingClientRect();e&&w({left:Math.max(8,Math.min(e.left,window.innerWidth-288-8)),top:e.bottom+6})},[]);if((0,n.useEffect)(()=>
1{if(f)return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),window.addEventListener("resize",R),window.addEventListener("scroll",R,!0),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t),window.removeEventListener("resize",R),window.removeEventListener("scroll",R,!0)};function e(e){let t=e.target;D.current?.contains(t)||I.current?.contains(t)||x(!1)}function t(e){"Escape"===e.key&&x(!1)}},[f,R]),(0,n.useEffect)(()=>()=>{M.current&&clearTimeout(M.current)},[]),!P||!A||!r||!("u"<typeof document)&&document.cookie.split("; ").some(e=>e.startsWith("if_sim_user=")&&e.length>12))return null;let W=(0,E.mlToFists)((0,_.mlSoFar)(A)),B=A.goal_gulps/_.GULPS_PER_FIST,q=Math.min(1,A.gulps/Math.max(1,A.goal_gulps)),H=A.gulps>=A.goal_gulps?"sky":"neutral",G=(0,S.nearestMeal)(l)?.name??"Meal",K=$[$.length-1];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{ref:D,className:(0,s.statusChip)(H,"!pr-1 gap-1"),children:[(0,t.jsxs)("button",{type:"button",onClick:()=>void U(_.GULPS_PER_FIST,"1 fist"),title:`Log a fist of water (Shift+W). Today ${(0,E.fistsLabel)(W)} of ${(0,E.fistsLabel)(B)}, ${(0,E.mlLabel)(A.gulps*E.FIST_ML/_.GULPS_PER_FIST,e)} of ${(0,E.mlLabel)(B*E.FIST_ML,e)}.`,"aria-label":`Log a fist of water. ${W} of ${(0,E.fistsLabel)(B)} today.`,className:"inline-flex items-center gap-1.5 cursor-pointer",children:[(0,t.jsx)("span",{className:"inline-flex","aria-hidden":"true",children:(0,t.jsx)(v.default,{model:r.model,fill:q,rising:h,size:.45})}),(0,t.jsx)("span",{children:"Water"}),(0,t.jsxs)("span",{className:(0,s.statusChipValue)(`tabular-nums ${(0,s.statusChipAccent)(H)}`),children:[W," of ",(0,E.fistsLabel)(B)]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{f||R(),x(e=>!e)},title:"Containers, drinks and food","aria-label":"Containers, drinks and food","aria-haspopup":"dialog","aria-expanded":f,className:"grid h-4 w-4 place-items-center rounded text-content-muted hover:bg-surface-hover hover:text-content-primary",children:(0,t.jsx)(b.default,{name:"ui.chevron-down",size:11})})]}),f&&g&&"u">typeof document&&(0,y.createPortal)((0,t.jsxs)("div",{ref:I,role:"dialog","aria-label":"Log water, drinks and food",style:{position:"fixed",left:g.left,top:g.top,width:288},className:"if-z-popover if-float bg-surface-elevated border border-line-base r-container p-2 flex flex-col gap-2",children:[(0,t.jsxs)("p",{className:"if-t-meta px-1 text-content-secondary",children:["Today ",(0,E.fistsLabel)(W)," of ",(0,E.fistsLabel)(B)]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"px-1 text-xs font-semibold uppercase tracking-wider text-content-muted",children:"Water"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("button",{type:"button",onClick:()=>void U(_.GULPS_PER_FIST,"1 fist"),className:(0,i.control)("primary","sm"),children:"1 fist"}),(0,t.jsx)("button",{type:"button",onClick:()=>void U(3,"3 gulps"),className:(0,i.control)("interface","sm"),children:"3 gulps"}),r.containers.map((n,a)=>(0,t.jsx)("button",{type:"button",onClick:()=>void U((0,_.containerGulps)(n),n.name),title:`${(0,E.fistsLabel)(n.fists)}, ${(0,E.mlLabel)(n.fists*E.FIST_ML,e)}`,className:(0,i.control)("interface","sm"),children:n.name},a))]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"px-1 text-xs font-semibold uppercase tracking-wider text-content-muted",children:"Other drinks"}),(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:T.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>void U(Math.round(e.fists*_.GULPS_PER_FIST),e.name),title:`Counts as ${(0,E.fistsLabel)(e.fists)} of water`,className:(0,i.control)("interface","sm"),children:e.name},e.name))})]}),(0,t.jsx)("div",{className:"border-t border-line-base pt-2",children:(0,t.jsx)(j.default,{meal:G})}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-1.5",children:[(0,t.jsx)("button",{type:"button",onClick:()=>void F(),disabled:!K,title:K?`Take back ${K.label}`:"Nothing to undo",className:(0,i.control)("interface","sm"),children:K?`Undo ${K.label}`:"Undo"}),(0,t.jsx)("button",{type:"button",onClick:()=>x(!1),className:(0,i.control)("interface","sm"),children:"Done"})]})]}),document.body)]})}e.i(212332),e.i(149257);var L=e.i(311875),D=e.i(846939),I=e.i(531478),M=e.i(743316),A=e.i(354835),P=e.i(504936),U=e.i(618566),F=e.i(770703),O=e.i(447533);let R=(0,F.default)(()=>e.A(382911),{loadableGenerated:{modules:[759648]},ssr:!1}),W="flat"===s.CHIP_STYLE?(0,s.statusChip)("neutral","cursor-pointer items-center !py-0"):"inline-flex items-center gap-1 px-2.5 h-7 rounded-full border border-violet-400 dark:border-violet-500/30 bg-violet-100 dar
1k:bg-violet-500/10 hover:border-violet-500 dark:hover:border-violet-400/50 hover:bg-violet-200 dark:hover:bg-violet-500/15 transition-colors cursor-pointer text-xs",B="flat"===s.CHIP_STYLE?(0,s.statusChip)("neutral","cursor-pointer items-center !py-0"):"inline-flex items-center gap-1 px-2.5 h-7 rounded-full border border-zinc-700 bg-zinc-800/50 hover:border-zinc-600 hover:bg-surface-hover/80 transition-colors cursor-pointer text-xs",q="flat"===s.CHIP_STYLE,H=q?"text-content-secondary":"text-violet-700 dark:text-violet-200",G=q?(0,s.statusChipAccent)("neutral"):"text-violet-600 dark:text-violet-300/90";function K(e,t){window.location.pathname.startsWith("/chat")?window.dispatchEvent(new CustomEvent("if:standup-call",{detail:{channelId:e,callType:"audio"}})):t.push(`/chat?channel=${encodeURIComponent(e)}`)}let J=(0,F.default)(()=>e.A(136205),{loadableGenerated:{modules:[800314]},ssr:!1});function Y(e){return!e||Z(e.title)?null:(0,L.meetingPath)(e.meeting_url)}let V=/weekly\s*coaching|pit\s*stop/i,Z=e=>V.test(e??""),Q={id:"os:daily-standup",title:"Daily Standup",description:"The team's daily check-in. Weekdays 9 AM Central.",day_of_week:null,time_utc:"14:00:00",timezone:"America/Chicago",meeting_url:null},X={id:"os:weekly-coaching-call",title:"Pit Stop Thursdays",description:"Pit Stop Thursdays: the weekly coaching call for the Let Go Boss community. Thursdays 1pm CST. You show up, align on your dream first, ask questions, support each other, see where you're blocked, get training and unblocked, check in on your goals / projects / tasks (your homework), and showcase what you've been working on.",day_of_week:4,time_utc:"18:00:00",timezone:"America/Chicago",meeting_url:null};function ee(e,t){let n=e=>String(e).padStart(2,"0"),a=e=>`${e.getUTCFullYear()}${n(e.getUTCMonth()+1)}${n(e.getUTCDate())}T${n(e.getUTCHours())}${n(e.getUTCMinutes())}00Z`,s=new Date(t.getTime()+36e5),i=Z(e.title),r=window.location.origin,l=i?"Pit Stop Thursdays - Let Go Boss":e.title,o=e.meeting_url?e.meeting_url.startsWith("http")?e.meeting_url:`https://${e.meeting_url}`:i?`${r}/meeting/weekly-coaching-letgoboss`:"",c=new URLSearchParams({action:"TEMPLATE",text:l,dates:`${a(t)}/${a(s)}`,...e.description?{details:e.description}:{},...o?{location:o}:{},ctz:e.timezone||"UTC"});return i&&c.set("recur","RRULE:FREQ=WEEKLY;BYDAY=TH"),`https://calendar.google.com/calendar/render?${c.toString()}`}let et=/stand-?up|daily (call|meeting)|weekly meeting|team meeting/i;function en({isStaff:e=!1,prefer:a}){let l,o=(0,d.useChrome)(),{t:u}=(0,c.useLanguage)(),m=(0,U.useRouter)(),[h,p]=(0,n.useState)([]),f=(0,I.useNow)(1e3),x=f??0,[w,v]=(0,n.use
1State)(!1),j=(0,n.useRef)(null),[k,N]=(0,n.useState)(null),C=(0,n.useRef)(null),[S,_]=(0,n.useState)(null);(0,n.useLayoutEffect)(()=>{if(!k)return void _(null);let e=C.current?.offsetWidth??0;_((0,M.centerUnder)(k.chipLeft,k.chipWidth,e,window.innerWidth))}),(0,n.useEffect)(()=>{if(!w)return void N(null);let e=()=>{let e=j.current?.getBoundingClientRect();e&&N({top:e.bottom+8,chipLeft:e.left,chipWidth:e.width})};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[w]);let E=(0,n.useRef)(new Set),[z,T]=(0,n.useState)(""),[$,L]=(0,n.useState)("question"),[F,q]=(0,n.useState)(!1),[V,ea]=(0,n.useState)(!1),es=(0,A.useCallState)();es.standupChannelId;let ei=es.standupActiveSessions,er=es.coachingActiveSessions,el=es.livePeople,[eo,ec]=(0,n.useState)(0);(0,n.useEffect)(()=>{(0,O.sharedJson)("/api/recurring-events",6e4).then(e=>p(e.events??[])).catch(()=>{}),fetch("/api/community/docket?limit=1").then(e=>e.json()).then(e=>ec(Number(e?.builderCount??0))).catch(()=>{})},[]);let ed=e?h:h.filter(e=>!et.test(e.title)),eu=ed.some(e=>Z(e.title)),em=ed.some(e=>et.test(e.title)),eh=[...ed,...eu?[]:[X],...e&&!em?[Q]:[]];(0,n.useEffect)(()=>{let e=setInterval(()=>{},1e3);return()=>clearInterval(e)},[]),(0,n.useEffect)(()=>{function e(e){j.current&&!j.current.contains(e.target)&&v(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let ep=(0,n.useRef)(Math.random().toString(36).slice(2));(0,n.useEffect)(()=>{function e(e){e.detail!==ep.current&&(ef.current=!1,v(!1))}return window.addEventListener("if:countdown-card",e),()=>window.removeEventListener("if:countdown-card",e)},[]);let ef=(0,n.useRef)(!1),ex=(0,n.useRef)(null),eg=()=>{ex.current&&(clearTimeout(ex.current),ex.current=null),w||(window.dispatchEvent(new CustomEvent("if:countdown-card",{detail:ep.current})),ef.current=!0,v(!0))},eb=()=>{ef.current&&(ex.current&&clearTimeout(ex.current),ex.current=setTimeout(()=>{ef.current&&(ef.current=!1,v(!1))},160))};if((0,n.useEffect)(()=>()=>{ex.current&&clearTimeout(ex.current)},[]),(0,n.useEffect)(()=>{if("coaching"!==a)return window.addEventListener("if:daily-brief-open",e),()=>window.removeEventListener("if:daily-brief-open",e);function e(){window.dispatchEvent(new CustomEvent("if:countdown-card",{detail:ep.current})),ef.current=!1,v(!0)}},[a]),"daily"===a&&!o.dailyCall||"coaching"===a&&!o.weeklyCall||!a&&!o.dailyCall&&!o.weeklyCall||!eh.length)return null;let ew=eh.map(e=>({ev:e,next:function(e){let t=new Date,[n,a]=e.time_utc.split(":").map(Number);if(null===e.day_of_week){let e=new Date(t);for(e.setUTCHours(n,a,0,0),e<=t&&e.setUTCDate(e.getUTCDate()+1);0===e.getUTCDay()||6===e.getUTCDay();)e.setUTCDate(e.getUTCDate()+1);return e}{let s=new Date(t);s.setUTCHours(n,a,0,0);let i=(e.day_of_week-t.getUTCDay()+7)%7;return s.setUTCDate(s.getUTCDate()+i),s<=t&&s.setUTCDate(s.getUTCDate()+7),s}}(e)})).sort((e,t)=>e.next.getTime()-t.next.getTime()),ey=ew.filter(({ev:e})=>!Z(e.title)),ev=ew.find(({ev:e})=>Z(e.title));if("coaching"===a){if(!ev)return null;l=ev}else if("daily"===a){if(!ey.length)return null;l=ey[0]}else l=ew[0];let ej=l.next.getTime()-x,ek=!a&&ej>144e5&&ev?ev:l,eN=a&&ek?[ek]:ew,eC=null===f?NaN:ek.next.getTime()-f,eS=eC<=0&&eC>-3e5,e_=eC<9e5&&eC>-3e5;if(null===f)return null;let eE=Z(ek.ev.title),ez=et.test(ek.ev.title),eT=ez?ei>0:er>0,e$=eE?60:30,eL=function(e){let t=new Date,[n,a]=e.time_utc.split(":").map(Number);if(null===e.day_of_week){let e=new Date(t);for(e.setUTCHours(n,a,0,0),e>t&&e.setUTCDate(e.getUTCDate()-1);0===e.getUTCDay()||6===e.getUTCDay();)e.setUTCDate(e.getUTCDate()-1);return e}let s=new Date(t);s.setUTCHours(n,a,0,0);let i=(t.getUTCDay()-e.day_of_week+7)%7;return s.setUTCDate(s.getUTCDate()-i),s>t&&s.setUTCDate(s.getUTCDate()-7),s}(ek.ev),eD=eL?new Date(eL.getTime()+6e4*e$):null,eI=eD?x-eD.getTime():1/0,eM=!eT&&!e_&&!eS&&eI>0&&eI<=9e5,eA=eM?Math.max(1,Math.round(eI/6e4)):0;if(eC>144e5&&!eE&&!eM&&!a)return null;let eP=ek.ev.title,eU=!!a,eF=ez?u("header_daily_call")||"Daily Call":Z(eP)?"Weekly Call":/weekly\s*meeting/i.test(eP)?eU?"Weekly":"Weekly Meeting":eP.replace(/\bcall\b/i,"").trim()||eP,eO=["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"];(()=>{try{let e=eO[ek.next.getDay()]??"",t=ek.next.toLocaleDateString([],{month:"short",day:"numeric"});return e?`${e}, ${t}`:t}catch{return""}})();let eR=(()=>{try{return eO[ek.next.getDay()]??""}catch{return""}})(),eW=(()=>{try{return ek.next.toLocaleDateString([],{month:"short",day:"numeric"})}catch{return""}})(),eB=(()=>{try{let e=0!==ek.next.getMinutes();return ek.next.toLocaleTimeString([],{hour:"numeric",...e?{minute:"2-digit"}:{}})}catch{return""}})(),eq=(()=>
1{if(eC<=0)return"";let e=Math.floor(Math.floor(eC/6e4)/1440);return e>=1?`${e}d`:""})();ek.ev.meeting_url&&(ek.ev.meeting_url.startsWith("http"),ek.ev.meeting_url);let eH=`${ek.ev.id}-${ek.next.toISOString().slice(0,16)}`;!eS||E.current.has(eH)||eE||(E.current.add(eH),setTimeout(()=>v(!0),0));let eG=async()=>{let e=z.trim();if(e&&!F){q(!0);try{let t=await (0,P.askDocketQuestion)({title:"win"===$?`Win: ${e}`:e});"error"in t||(T(""),ea(!0),setTimeout(()=>ea(!1),2600))}catch{}finally{q(!1)}}},eK=eT||Number.isFinite(eC)&&eC<=6e5&&eC>-18e5,eJ=()=>{v(!1),fetch("/api/standup-call").then(e=>e.json()).then(e=>{e.channelId&&K(e.channelId,m)}).catch(()=>{})},eY=ez?(0,t.jsx)(R,{joinable:eK,onJoin:eJ}):null,eV=eE?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(b.default,{name:"ui.video-camera",size:"1em",className:"h-3.5 w-3.5 text-violet-400"}),(0,t.jsx)("span",{className:"text-[11px] font-semibold text-zinc-200",children:ek.ev.title})]}),(0,t.jsxs)("p",{className:"text-[11.5px] text-zinc-300",children:[ek.next.toLocaleDateString(void 0,{weekday:"long",month:"short",day:"numeric"})," at ",ek.next.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})]}),(0,t.jsxs)("p",{className:"mt-0.5 text-[10.5px] text-zinc-500",children:[eC>0?`Starts in ${ez?(0,r.inHours)(eC):(0,r.inDays)(eC)}. `:"","Free and open to everyone, every week."]}),ek.ev.description&&(0,t.jsx)("p",{className:"mt-1.5 border-t border-zinc-800 pt-1.5 text-[10.5px] leading-snug text-zinc-400",children:ek.ev.description}),eo>0&&(0,t.jsxs)("p",{className:"mt-1 text-[10.5px] text-zinc-400",children:[(0,t.jsx)("span",{className:"font-semibold text-zinc-200",children:eo})," builders in the room"]}),ez?(0,t.jsx)("div",{className:"mt-2 border-t border-zinc-800 pt-2",children:(0,t.jsx)(R,{joinable:eK,onJoin:eJ})}):(0,t.jsxs)("div",{className:"mt-2 border-t border-zinc-800 pt-2",children:[(0,t.jsx)("div",{className:"mb-1.5 flex gap-1",children:["question","win"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>L(e),className:`rounded-md px-1.5 py-0.5 text-[10px] font-semibold transition-colors ${$===e?"bg-violet-500/20 text-violet-200":"text-zinc-500 hover:text-zinc-300"}`,children:"question"===e?"Ask a question":"Share a win"},e))}),(0,t.jsxs)("div",{className:"flex gap-1.5",children:[(0,t.jsx)("input",{value:z,onChange:e=>T(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),eG())},placeholder:"win"===$?"What went well this week?":"What do you want covered?",className:"min-w-0 flex-1 rounded-lg border border-zinc-700 bg-zinc-950/60 px-2 py-1 text-[11px] text-zinc-200 placeholder:text-zinc-600 outline-none focus:border-violet-500/60"}),(0,t.jsx)("button",{type:"button",onClick:()=>void eG(),disabled:!z.trim()||F,className:"shrink-0 rounded-lg bg-violet-500/20 px-2 py-1 text-[10.5px] font-semibold text-violet-200 transition-colors hover:bg-violet-500/30 disabled:opacity-40",children:F?"…":"Add"})]}),(0,t.jsx)("p",{className:"mt-1 text-[10px] text-zinc-500",children:V?"win"===$?"Added. Basim will read it out.":"Added to the docket. Others can upvote it.":"Goes on the docket for Thursday. Click the chip for the full agenda."}),(0,t.jsx)("div",{className:"-mx-3 mt-2",children:(0,t.jsx)(J,{columns:!0})})]})]}):null,eZ="daily"===a?eY:"coaching"===a?eV:eV??eY,eQ=!!eZ,eX=(0,t.jsxs)("div",{ref:j,className:"relative",onMouseLeave:eb,children:[(0,t.jsxs)("div",{className:eT?(0,s.statusChip)("emerald","cursor-pointer items-center !py-0"):e_?(0,s.statusChip)("emerald","animate-pulse cursor-pointer items-center !py-0"):eM?B:eE?W:(0,s.statusChip)("neutral","cursor-pointer items-center !py-0"),children:[(0,t.jsxs)("button",{type:"button",onClick:e=>{if(e.stopPropagation(),eE){v(!1),window.dispatchEvent(new CustomEvent("if:open-event",{detail:{id:"os:weekly-coaching-call"}}));return}eQ||(ef.current=!1,v(e=>!e))},onMouseEnter:()=>{eE||eg()},onMouseLeave:eb,onFocus:()=>{eE||eg()},onBlur:eb,className:"flex items-center gap-1.5 min-w-0 outline-none","aria-label":ez?"Daily Call agenda and join":void 0,children:[ez?(0,t.jsx)(b.default,{name:"ui.phone",size:"1em",className:`w-3.5 h-3.5 shrink-0 ${(0,s.statusChipAccent)(e_||eT?"emerald":"neutral")}`}):(0,t.jsx)(b.default,{name:"ui.video-camera",size:"1em",className:`w-3.5 h-3.5 shrink-0 ${e_?(0,s.statusChipAccent)("emerald"):eE?(0,s.statusChipAccent)("flat"===s.CHIP_STYLE?"neutral":"brand"):(0,s.statusChipAccent)("neutral")}`}),(0,t.jsx)("span",{className:`inline truncate ${eE?"max-w-[150px]":"max-w-[110px]"} ${e_||eT?"text-content-primary":eE?H:"text-content-secondary"}`,children:eF}),!eE&&!e_&&!eT&&eq&&eR&&(0,t.jsxs)("span",{className:`hidden xl:inline truncate max-w-[180px] ${eE?"text-violet-600 dar
1k:text-violet-200/70":"text-content-secondary"}`,children:[(0,t.jsx)("span",{className:eE?"font-semibold text-violet-700 dark:text-violet-100":"font-semibold text-content-primary",children:eR}),eW?`, ${eW}`:"",eB?(0,t.jsxs)(t.Fragment,{children:[" · ",(0,t.jsx)("span",{className:eE?"font-semibold text-violet-700 dark:text-violet-100":"font-semibold text-content-primary",children:eB})]}):""]}),!1,eT?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-emerald-300 font-semibold",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),u("header_live")||"Live",eE&&er>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-normal text-emerald-200/80",children:[el.length>0&&(0,t.jsx)("span",{className:"flex -space-x-1",children:el.slice(0,3).map(e=>e.avatar?(0,t.jsx)("img",{src:e.avatar,alt:"",title:e.name,className:"h-4 w-4 rounded-full object-cover ring-1 ring-emerald-900/60"},e.id):(0,t.jsx)("span",{title:e.name,className:"grid h-4 w-4 place-items-center rounded-full bg-emerald-900/60 text-[7px] font-bold text-emerald-100 ring-1 ring-emerald-900/60",children:e.name.slice(0,1).toUpperCase()},e.id))}),"· ",er," in"]})]}):eM?(0,t.jsxs)("span",{className:"inline text-zinc-400",children:[u("header_ended")||"ended"," · ",(0,t.jsxs)("span",{className:"font-semibold text-zinc-300",children:[eA,"m ",u("header_ago")||"ago"]}),eC>0&&(0,t.jsxs)("span",{className:"hidden lg:inline text-zinc-500",children:[" · next ",(0,t.jsx)("span",{className:"font-semibold tabular-nums text-zinc-300",children:eC<864e5?(0,r.inHours)(eC):(0,r.inDays)(eC)})]}),eE&&(0,t.jsxs)("span",{className:"hidden xl:inline text-zinc-500",children:[" · ",u("header_replay_available")||"replay available"]})]}):eC>0?(0,t.jsx)("span",{className:`${e_?"inline":"hidden lg:inline"} ${(0,s.statusChipValue)()} ${e_?(0,s.statusChipAccent)("emerald"):eE?G:(0,s.statusChipAccent)("neutral")}`,children:(0,t.jsxs)(t.Fragment,{children:["in ",(0,t.jsx)("span",{className:(0,s.statusChipValue)(),children:ez?(0,r.inHours)(eC):(0,r.inDays)(eC)})]})}):(0,t.jsx)("span",{className:"text-emerald-400 font-semibold inline animate-pulse",children:u("starting_now")})]}),(e_||eT)&&(0,t.jsx)("button",{type:"button",onClick:e=>{if(e.stopPropagation(),ez)fetch("/api/standup-call").then(e=>e.json()).then(e=>{e.channelId?K(e.channelId,m):window.dispatchEvent(new CustomEvent("if:toast",{detail:{message:"Could not find the call channel. Open Chat and start it there."}}))}).catch(()=>{});else{let e=Y(ek?.ev);e?m.push(e):window.dispatchEvent(new CustomEvent("if:coaching-call"))}},className:(0,i.control)("primary","sm","ml-1"),title:ez?ei>0?"Join the live Daily Call":"Start the Daily Call now":er>0?"Join the live Weekly Coaching":"Start the Weekly Coaching now",children:ez?ei>0?u("join_call")||"Join Call":u("start_call")||"Start Call":er>0?u("join_call")||"Join Call":u("start_call")||"Start Call"})]}),w&&k&&"u">typeof document&&(0,y.createPortal)((0,t.jsxs)("div",{ref:C,style:{position:"fixed",top:k.top,left:S??16,visibility:null==S?"hidden":void 0,zIndex:1e4,"--if-popover-top":`${k.top}px`},onMouseEnter:eg,onMouseLeave:eb,className:`if-popover ${eZ===eV&&eV?"w-[min(46rem,calc(100vw-2rem))] !max-w-[calc(100vw-2rem)]":ez?"w-[min(28rem,calc(100vw-2rem))] !max-w-[calc(100vw-2rem)]":"w-80"} r-container border border-line-base layer-raised`,children:[(0,t.jsx)(D.default,{title:ez?"Daily Call":eE?"Weekly Coaching":ek.ev.title||"Upcoming calls",icon:"comm.phone",onClose:()=>v(!1)}),(0,t.jsx)("div",{className:"if-popover-body z-50",children:ez?(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsx)(R,{joinable:eK,onJoin:eJ})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"px-4 py-3 border-b border-zinc-800 flex flex-col gap-2",children:[(0,t.jsx)("p",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:eT?u("header_live")||"Live":e_?u("starting_now")||"Starting now":eM?u("header_just_ended")||"Just ended":u("upcoming_calls")||"Upcoming calls"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>
1{if(v(!1),eT||e_||eS)if(ez)fetch("/api/standup-call").then(e=>e.json()).then(e=>{e.channelId&&K(e.channelId,m)}).catch(()=>{});else{let e=Y(ek?.ev);e?m.push(e):window.dispatchEvent(new CustomEvent("if:coaching-call"))}else if(eM)m.push(`/replays?q=${encodeURIComponent(eF)}`);else{let e=ee(ek.ev,ek.next);window.open(e,"_blank","noopener,noreferrer")}},className:`flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors ${eT||e_||eS?"bg-emerald-500 hover:bg-emerald-400 text-white":eM?"bg-zinc-800 hover:bg-surface-hover border border-zinc-700 text-zinc-200":"bg-violet-500/15 hover:bg-violet-500/25 border border-violet-500/40 text-violet-200"}`,children:eT||e_||eS?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.default,{name:"ui.phone",size:"1em",className:"w-3.5 h-3.5"})," ",u("join_now")||"Join now"]}):eM?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.default,{name:"ui.video-camera",size:"1em",className:"w-3.5 h-3.5"})," ",u("watch_replay")||"Watch replay"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.default,{name:"ui.calendar",size:"1em",className:"w-3.5 h-3.5"})," ",u("set_reminder")||"Set reminder"]})}),(0,t.jsx)("button",{type:"button",onClick:()=>{v(!1),ez?fetch("/api/standup-call").then(e=>e.json()).then(e=>{e.channelId&&m.push(`/chat?channel=${e.channelId}`)}).catch(()=>{}):window.dispatchEvent(new CustomEvent("if:open-event",{detail:{id:"os:weekly-coaching-call"}}))},className:"flex items-center justify-center px-3 py-1.5 rounded-lg text-xs font-medium bg-zinc-800 hover:bg-surface-hover border border-zinc-700 text-zinc-300 hover:text-zinc-100 transition-colors",title:u("open_chat")||"Open chat",children:u("open_chat")||"Open chat"})]})]}),eN.map(({ev:e,next:n})=>{let a=n.getTime()-x,s=a<=0,i=a<9e5,r=e.title.toLowerCase().includes("standup");e.meeting_url&&(e.meeting_url.startsWith("http"),e.meeting_url);let l=r?"ui.phone":"ui.video-camera",o=r?ei>0?"Join Call":"Start Call":er>0?"Join Call":"Start Call";return(0,t.jsxs)("div",{className:`px-4 py-3.5 border-b border-zinc-800/60 ${i?"bg-green-500/5":""}`,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)("p",{className:`text-sm font-semibold truncate ${i?"text-green-300":"text-content-primary"}`,children:r?"Daily Call":e.title})}),(0,t.jsx)("span",{className:`text-xs font-bold tabular-nums shrink-0 ${s?"text-green-400 animate-pulse":i?"text-green-400":"text-zinc-400"}`,children:function(e,t="Starting now!"){if(e<=0)return t;let n=Math.floor(e/1e3),a=Math.floor(n/60),s=Math.floor(a/60),i=Math.floor(s/24);return i>=1?`${i}d`:s>=4?`~${s}h`:s>0?`${s}h ${a%60}m`:`${a}m ${n%60}s`}(a,u("starting_now"))})]}),(0,t.jsx)("div",{className:"flex items-center gap-3 mt-1.5",children:(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-content-muted",children:[(0,t.jsx)(b.default,{name:"ui.calendar",size:"1em",className:"w-3.5 h-3.5"}),function(e,t){try{return e.toLocaleString("en-US",{timeZone:t||"UTC",weekday:"short",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}catch{return e.toLocaleString("en-US",{weekday:"short",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}}(n,e.timezone)]})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-3",children:[(0,t.jsxs)("a",{href:ee(e,n),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-zinc-800 hover:bg-surface-hover border border-zinc-700 text-zinc-400 hover:text-zinc-200 transition-colors",children:[(0,t.jsx)(b.default,{name:"ui.calendar",size:"1em",className:"w-3.5 h-3.5"}),u("add_to_calendar")]}),i&&(r?(0,t.jsxs)("button",{type:"button",onClick:()=>{fetch("/api/standup-call").then(e=>e.json()).then(e=>{e.channelId&&K(e.channelId,m)}
1).catch(()=>{}),v(!1)},className:`flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-bold transition-all ${s?"bg-green-400 hover:bg-green-300 text-white animate-pulse shadow-md shadow-green-500/40":"bg-green-500 hover:bg-green-400 text-white"}`,children:[(0,t.jsx)(b.default,{name:l,size:"1em",className:"w-3.5 h-3.5"}),s?o+" Now!":o]}):(0,t.jsxs)("button",{type:"button",onClick:()=>{let t=Y(e);t?m.push(t):window.dispatchEvent(new CustomEvent("if:coaching-call")),v(!1)},className:`flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-bold transition-all ${s?"bg-green-400 hover:bg-green-300 text-white animate-pulse shadow-md shadow-green-500/40":"bg-green-500 hover:bg-green-400 text-white"}`,children:[(0,t.jsx)(b.default,{name:l,size:"1em",className:"w-3.5 h-3.5"}),s?o+" Now!":o]}))]})]},e.id)}),(0,t.jsx)("div",{className:"px-4 py-2.5",children:(0,t.jsxs)("p",{className:"text-[10px] text-content-muted",children:[u("all_times_in")," ",ew[0]?.ev.timezone??"UTC"]})})]})})]}),document.body)]}),e0=eQ&&!w?eZ:null;return e0?(0,t.jsx)(g.default,{kind:"call_card",card:e0,width:e0===eV&&eV?760:e0===eY&&eY?440:330,children:eX}):eX}var ea=e.i(700354);function es(e,t){return/weekly\s*coaching|pit\s*stop/i.test(e)?"Weekly Call":/daily/i.test(e)?t("header_daily_short")||"Daily":e.replace(/\bcall\b/i,"").trim()||e}function ei(e,t,n,a){let s=e.getTime()-t.getTime(),i="ends in"===n?a("header_event_ends_in")||"ends in":a("header_event_in")||"in";if(s<=0)return"ends in"===n?a("header_event_ending")||"ending":a("header_event_now_word")||"now";let r=Math.round(s/6e4);if(r<60)return`${i} ${r}m`;let l=Math.floor(r/60),o=r%60;if(l<24)return 0===o?`${i} ${l}h`:`${i} ${l}h${o}m`;let c=Math.floor(l/24);return`${i} ${c}d`}function er(e,t,n,a){let s=n.getBoundingClientRect(),i={id:e,title:t,anchor:{left:s.left,top:s.top,right:s.right,bottom:s.bottom}};a&&(i.startUtcIso=a.start.toISOString(),i.durationMinutes=Math.round((a.end.getTime()-a.start.getTime())/6e4)),window.dispatchEvent(new CustomEvent("if:open-event",{detail:i}))}function el({isStaff:e=!1}){let a=(0,d.useChrome)(),{t:s}=(0,c.useLanguage)(),[i,r]=(0,n.useState)([]),l=(0,I.useNow)(3e4);(0,n.useEffect)(()=>{let e=!1;function t(){(0,O.sharedJson)("/api/recurring-events",6e4).then(t=>{e||r(t.events??[])}).catch(()=>{})}t();let n=(0,ea.visiblePoll)(t,3e5);return()=>{e=!0,n()}},[]);let{current:o,next:u}=(0,n.useMemo)(()=>{let t=/standup|daily meeting|weekly meeting|team meeting/i,n=/daily|coaching|standup|weekly meeting|team meeting/i;if(null===l)return{current:null,next:null};let a=e?i:i.filter(e=>!t.test(e.title)),s=new Date(l),r=null,o=null;for(let e of a){if(n.test(e.title))continue;let t=function(e,t){let[n,a]=e.time_utc.split(":").map(Number),s=new Date(t);if(s.setUTCHours(n,a,0,0),null===e.day_of_week)for(s>t&&s.setUTCDate(s.getUTCDate()-1);0===s.getUTCDay()||6===s.getUTCDay();)s.setUTCDate(s.getUTCDate()-1);else{let n=(t.getUTCDay()-e.day_of_week+7)%7;s.setUTCDate(s.getUTCDate()-n),s>t&&s.setUTCDate(s.getUTCDate()-7)}let i=(e.duration_minutes??60)*6e4,r=new Date(s.getTime()+i);return r<t?null:{ev:e,start:s,end:r}}(e,s);if(t&&t.start<=s&&t.end>s){(!r||t.start>r.start)&&(r=t);continue}let a=function(e,t){let[n,a]=e.time_utc.split(":").map(Number),s=new Date(t);if(s.setUTCHours(n,a,0,0),null===e.day_of_week)for(s<=t&&s.setUTCDate(s.getUTCDate()+1);0===s.getUTCDay()||6===s.getUTCDay();)s.setUTCDate(s.getUTCDate()+1);else{let n=(e.day_of_week-t.getUTCDay()+7)%7;s.setUTCDate(s.getUTCDate()+n),s<=t&&s.setUTCDate(s.getUTCDate()+7)}let i=(e.duration_minutes??60)*6e4;return{ev:e,start:s,end:new Date(s.getTime()+i)}}(e,s);(!o||a.start<o.start)&&(o=a)}return{current:r,next:o&&o.start.getTime()-l<=144e5?o:null}},[i,e,l]);return a.nextEvent&&(o||u)&&null!==l?(0,t.jsxs)("div",{className:"hidden md:flex items-center gap-1 shrink-0",children:[o&&(0,t.jsxs)("button",{type:"button",onClick:e=>er(o.ev.id,o.ev.title,e.currentTarget,o),onMouseEnter:e=>er(o.ev.id,o.ev.title,e.currentTarget,o),className:"flex items-center gap-1.5 h-6 px-2 rounded-md bg-emerald-500/10 border border-emerald-500/30 text-emerald-700 dark:text-emerald-300 hover:bg-emerald-500/20 transition-colors text-[11px] font-medium",title:`${o.ev.title} \xb7 ${s("header_event_now_word")||"now"}`,children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),(0,t.jsx)("span",{children:s("header_now")||"Now"}),(0,t.jsx)("span",{className:"text-emerald-700/80 dark:text-emerald-200/80 truncate max-w-[80px]",children:es(o.ev.title,s)}),(0,t.jsx)("span",{className:"text-emerald-700/60 dark:text-emerald-200/60 tabular-nums",children:ei(o.end,new Date(l),"ends in",s)})]}),u&&(0,t.jsxs)("button",{type:"button",onClick:e=>er(u.ev.id,u.ev.title,e.currentTarget,u),onMouseEnter:e=>er(u.ev.id,u.ev.title,e.currentTarget,u),className:"flex items-center gap-1.5 h-6 px-2 rounded-md bg-zinc-800/60 border border-zinc-700 text-zinc-700 dark:text-zinc-300 hover:border-zinc-500 hover:text-black dark:hover:text-content-primary transition-colors text-[11px] font-medium",title:`${u.ev.title} ${ei(u.start,new Date(l),"in",s)}`,children:[(0,t.jsx)(b.default,{name:"ui.arrow-right",className:"w-3.5 h-3.5 text-zinc-500"}),(0,t.jsx)("span",{children:s("header_next")||"Next"}),(0,t.jsx)("span",{className:"text-zinc-700/90 dark:text-zinc-200/90 truncate max-w-[80px]",children:es(u.ev.title,s)}),(0,t.jsx)("span",{className:"text-zinc-600 dark:text-zinc-400 tabular-nums",children:ei(u.start,new Date(l),"in",s)})]}),!o&&!u&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-zinc-500",children:[(0,t.jsx)(b.default,{name:"view.calendar",className:"w-3.5 h-3.5"}),s("header_clear_day")||"Clear day"]})]}):null}
1function eo(){let[e,i]=(0,n.useState)([]),r=(0,I.useNow)(3e4);(0,n.useEffect)(()=>{let e=!1;function t(){fetch("/api/events/upcoming",{cache:"no-store"}).then(e=>e.ok?e.json():{events:[]}).then(t=>{e||i(t.events??[])}).catch(()=>{})}t();let n=(0,ea.visiblePoll)(t,12e4);return()=>{e=!0,n()}},[]);let l=(0,n.useMemo)(()=>null===r?null:e.map(e=>({e,startsIn:new Date(e.starts_at).getTime()-r,endsAt:e.ends_at?new Date(e.ends_at).getTime():new Date(e.starts_at).getTime()+36e5})).filter(e=>e.endsAt>r&&e.startsIn<216e5).sort((e,t)=>e.startsIn-t.startsIn)[0]??null,[e,r]);if(!l)return null;let{e:o,startsIn:c}=l,d=c<=0,u=c>0&&c<=6e5,m=o.meeting_url||"/events",h=/^https?:/i.test(m)&&!m.includes("insertfuel"),p=h?"a":a.default;return(0,t.jsxs)(p,{href:m,...h?{target:"_blank",rel:"noopener"}:{},title:`${o.title}${o.brand?.name?` \xb7 ${o.brand.name}`:""}${o.location?` \xb7 ${o.location}`:""}`,className:(0,s.statusChip)("neutral","max-w-full",{attention:d||u}),children:[o.brand?.logo_url?(0,t.jsx)("img",{src:o.brand.logo_url,alt:"",className:"h-3.5 w-3.5 shrink-0 rounded-full object-cover"}):o.meeting_url?(0,t.jsx)(b.default,{name:"comm.video",className:"h-3.5 w-3.5 shrink-0",weight:"regular"}):(0,t.jsx)(b.default,{name:"nav.calendar",className:"h-3.5 w-3.5 shrink-0",weight:"regular"}),(0,t.jsxs)("span",{className:"max-w-[160px] truncate",children:[o.emoji?`${o.emoji} `:"",o.title]}),(0,t.jsx)("span",{className:d||u?"":(0,s.statusChipAccent)("neutral"),children:d?"now":function(e){let t=Math.max(0,Math.round(e/6e4));if(t<1)return"now";if(t<60)return`in ${t}m`;let n=Math.floor(t/60),a=t%60;return 0===a?`in ${n}h`:`in ${n}h${a}m`}(c)})]})}function ec(){var i,r;let l,o,[c,d]=(0,n.useState)([]),[u,m]=(0,n.useState)({}),h=(0,I.useNow)(6e4);(0,n.useEffect)(()=>{let t=!1;function n(){(0,O.sharedJson)("/api/recurring-events",6e4).then(async n=>{if(t)return;let a=(n.events??[]).filter(e=>e.brand_id);d(a);let s=[...new Set(a.map(e=>e.brand_id))].filter(Boolean);if(!s.length)return;let{createClient:i}=await e.A(90015),r=i(),{data:l}=await r.from("brands").select("id, name, logo_url").in("id",s);if(t)return;let o={};for(let e of l??[])o[e.id]=e;m(o)}).catch(()=>{})}n();let a=(0,ea.visiblePoll)(n,3e5);return()=>{t=!0,a()}},[]);let p=(0,n.useMemo)(()=>c.map(e=>({e,at:(function(e){let t=new Date,[n,a]=e.time_utc.split(":").map(Number),s=new Date(t);if(s.setUTCHours(n,a,0,0),null===e.day_of_week){for(s<=t&&s.setUTCDate(s.getUTCDate()+1);0===s.getUTCDay()||6===s.getUTCDay();)s.setUTCDate(s.getUTCDate()+1);return s}let i=(e.day_of_week-t.getUTCDay()+7)%7;return s.setUTCDate(s.getUTCDate()+i),s<=t&&s.setUTCDate(s.getUTCDate()+7),s})(e).getTime()})).sort((e,t)=>e.at-t.at)[0]??null,[c,h]);if(!p||null===h)return null;let{e:f,at:x}=p,g=f.brand_id?u[f.brand_id]:null,w=x-h,y=f.event_id?`/portal/events?event=${f.event_id}`:f.meeting_url||(f.channel_id?`/chat?channel=${f.channel_id}`:"/events"),v=/^https?:/i.test(y)&&!y.includes("insertfuel"),j=v?"a":a.default,k=w<=0&&w>-36e5;return(0,t.jsxs)(j,{href:y,...v?{target:"_blank",rel:"noopener"}:{},title:`${f.title}${g?.name?` \xb7 ${g.name}`:""}
2${(i=new Date(x),l=(r=f.timezone)?{timeZone:r}:{},o=new Intl.DateTimeFormat("en-US",{...l,weekday:"long",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"}).format(i),r?`${o} (${r.split("/").pop()?.replace("_"," ")})`:o)}`,className:(0,s.statusChip)("neutral","max-w-full",{attention:k}),children:[g?.logo_url?(0,t.jsx)("img",{src:g.logo_url,alt:"",className:"h-4 w-4 shrink-0 rounded-full object-cover"}):(0,t.jsx)(b.default,{name:"comm.video",className:"h-3.5 w-3.5 shrink-0",weight:"regular"}),(0,t.jsx)("span",{className:"max-w-[150px] truncate",children:f.title}),(0,t.jsx)("span",{className:k?"":(0,s.statusChipAccent)("neutral"),children:k?"now":function(e,t){let n=new Date,a=Math.max(0,Math.round((e.getTime()-n.getTime())/6e4));if(a<60)return`in ${a}m`;let s=Math.floor(a/60);if(s<5)return a%60==0?`in ${s}h`:`in ${s}h${a%60}m`;let i=t?{timeZone:t}:{},r=e=>new Intl.DateTimeFormat("en-CA",{...i,year:"numeric",month:"2-digit",day:"2-digit"}).format(e),l=e=>new Date(`${e}T00:00:00Z`).getTime(),o=Math.round((l(r(e))-l(r(n)))/864e5),c=new Intl.DateTimeFormat("en-US",{...i,hour:"numeric",minute:"2-digit"}).format(e);if(o<=0)return`today ${c}`;if(1===o)return`tomorrow ${c}`;let d=new Intl.DateTimeFormat("en-US",{...i,weekday:"short"}).format(e);if(o<7)return`${d} ${c}`;let u=new Intl.DateTimeFormat("en-US",{...i,month:"short",day:"numeric"}).format(e);return`${u} ${c}`}(new Date(x),f.timezone)})]})}var ed=e.i(535844);
2function eu(){let[e,i]=(0,n.useState)(()=>(0,u.currentShareState)().sharing);return(0,n.useEffect)(()=>{let e=e=>i(!!e.detail?.sharing);return window.addEventListener(u.SHARE_STATE_EVENT,e),()=>window.removeEventListener(u.SHARE_STATE_EVENT,e)},[]),(0,t.jsxs)(a.default,{href:"/admin",className:(0,s.statusChip)("brand"),title:e?"Admin":"You are in super admin mode",children:[(0,t.jsx)(b.default,{name:"ui.shield-star",size:14}),(0,t.jsx)("span",{className:(0,s.statusChipValue)(),children:e?"Admin":"Super Admin"})]})}function em(){let e=(0,d.useChrome)(),[l,o]=(0,n.useState)(null);if((0,n.useEffect)(()=>{let e=!0,t=async()=>{try{let t=await fetch("/api/sales/overdue-summary"),n=await t.json();e&&n.ok&&n.clients>0?o(n):e&&o(null)}catch{}};t();let n=setInterval(t,6e5);return()=>{e=!1,clearInterval(n)}},[]),!l||!e.money)return null;let c=e=>(e/100).toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}),u=e=>e<45?`${e}d`:`${Math.round(e/30)}mo`,m=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(b.default,{name:"nav.deals",className:"h-3.5 w-3.5 text-red-400"}),(0,t.jsxs)("span",{className:"if-t-meta font-semibold text-zinc-200",children:[l.owedCents>0?`${c(l.owedCents)} past due`:"Past due",l.oldestDays>0&&`, oldest ${u(l.oldestDays)}`]})]}),(0,t.jsx)("ul",{className:"space-y-0.5",children:l.rows.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(g.CardRow,{href:`/brands/${e.brandId}`,children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[e.logoUrl?(0,t.jsx)("img",{src:e.logoUrl,alt:"",className:"h-5 w-5 shrink-0 rounded-full object-cover ring-1 ring-white/10"}):(0,t.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-zinc-800 if-t-micro font-bold text-zinc-400 ring-1 ring-white/10",children:e.name.slice(0,1).toUpperCase()}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate if-t-meta text-zinc-200",children:e.name}),(0,t.jsxs)("span",{className:"block truncate if-t-caption text-zinc-500",children:["never_billed"===e.kind?"no payment ever recorded":e.onHold?"on hold, they gave a date":e.hadFailure?"card refused, service paused":"nothing attempted since",e.lastPaidAt?`, last paid ${(0,g.ago)(e.lastPaidAt)}`:"",e.overdueDays>0&&`, ${u(e.overdueDays)} overdue`]})]}),(0,t.jsx)("span",{className:`shrink-0 tabular-nums if-t-meta font-semibold ${e.needsChecking?"text-zinc-500":"text-red-400"}`,children:e.needsChecking?"to check":c(e.owedCents)})]})})},e.brandId))}),l.toCheck>0&&(0,t.jsxs)("p",{className:"mt-2 border-t border-zinc-800 pt-1.5 if-t-caption leading-snug text-zinc-500",children:[l.toCheck," of these were invoiced by hand, so no amount is confirmed and they are not in the total."]}),(0,t.jsx)("p",{className:"mt-1.5 if-t-caption text-zinc-500",children:"Click a client to open them, or the chip for all of them on Sales."})]});return(0,t.jsx)(g.default,{card:m,width:340,children:(0,t.jsxs)(a.default,{href:"/sales#money-at-risk",className:(0,s.statusChip)("red"),title:`${c(l.owedCents)} past due from ${l.clients} ${1===l.clients?"client":"clients"}`,children:[(0,t.jsx)("span",{className:(0,i.alertDot)(!0),"aria-hidden":!0}),(0,t.jsx)("span",{className:(0,s.statusChipValue)(),children:l.owedCents>0?(0,r.usdPlain)(l.owedCents):l.clients}),(0,t.jsx)("span",{children:"is Past Due"})]})})}function eh({userId:e,timezone:r}){let u=(0,d.useChrome)(),{t:m}=(0,c.useLanguage)(),[h,p]=(0,n.useState)(0),[f,x]=(0,n.useState)({overdue:0,today:0,urgent:0}),[w,y]=(0,n.useState)(null),[v,j]=(0,n.useState)([]);if((0,n.useEffect)(()=>{let t=!1;async function n(){let n=(0,l.createClient)(),a=(0,o.localDateStr)(r??null),{data:s}=await n.from("tasks").select("id, title, status, priority, due_date, brand_id, brands:brand_id(name, logo_url), assignee:assigned_to(full_name, avatar_url)").eq("assigned_to",e).not("status","in","(done,canceled,closed,completed,cancelled,on_hold,paused,blocked,archived)");if(t||!s)return;let i=0,c=0,d=0,u=[],m=e=>(Array.isArray(e)?e[0]:e)??null;for(let e of s){let t="urgent"===(e.priority??"").toLowerCase();t&&d++;let n=null;if(e.due_date&&(e.due_date<a?(i++,n="overdue"):e.due_date===a&&(c++,n="today")),t&&!n&&(n="urgent"),n){let t=m(e.brands),a=m(e.assignee);u.push({id:e.id,title:e.title,priority:e.priority,due_date:e.due_date,bucket:n,brandId:e.brand_id??null,brandName:t?.name??null,brandLogo:t?.logo_url??null,assigneeName:a?.full_name??null,assigneeAvatar:a?.avatar_url??null})}}let h={overdue:0,today:1,urgent:2},f=e=>{let t=(e??"").toLowerCase();return"urgent"===t?0:"high"===t?1:"medium"===t?2:"low"===t?3:4};u.sort((e,t)=>
2h[e.bucket]-h[t.bucket]||f(e.priority)-f(t.priority)||(e.due_date??"").localeCompare(t.due_date??"")),p(i+c+d),x({overdue:i,today:c,urgent:d}),j(u.slice(0,6))}n();let a=setInterval(n,3e5),s=()=>n(),i=()=>{"visible"===document.visibilityState&&n()};return window.addEventListener("focus",s),document.addEventListener("visibilitychange",i),window.addEventListener("if:task-updated",s),window.addEventListener("if:tasks-changed",s),()=>{t=!0,clearInterval(a),window.removeEventListener("focus",s),document.removeEventListener("visibilitychange",i),window.removeEventListener("if:task-updated",s),window.removeEventListener("if:tasks-changed",s)}},[e,r]),0===h||!u.overdue)return null;let k=f.overdue?f.overdue:f.today?f.today:f.urgent,N=f.overdue?m("header_critical_overdue")||"Overdue Tasks":f.today?m("header_critical_today")||"Due Today":m("header_critical_urgent")||"Urgent",C=f.overdue?"/tasks?mine=1&due=overdue":f.today?"/tasks?mine=1&due=today":"/tasks?mine=1&priority=urgent",S=async e=>{y(e);try{let t=(0,l.createClient)(),n=new Date,a=`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}`,{error:s}=await t.from("tasks").update({due_date:a}).eq("id",e);if(s)throw s;j(t=>t.filter(t=>t.id!==e)),p(e=>Math.max(0,e-1)),x(e=>({...e,overdue:Math.max(0,e.overdue-1),today:e.today+1}))}catch{}finally{y(null)}},_=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,t.jsx)(b.default,{name:"ui.warning",className:"w-3.5 h-3.5 text-red-400"}),(0,t.jsx)("span",{className:"if-t-meta font-semibold text-zinc-200",children:[f.overdue?`${f.overdue} ${m("header_critical_overdue")||"overdue"}`:null,f.today?`${f.today} ${m("header_critical_due_today")||"due today"}`:null,f.urgent?`${f.urgent} ${m("header_critical_urgent")||"urgent"}`:null].filter(Boolean).join(" · ")})]}),(0,t.jsx)("ul",{className:"space-y-0.5",children:v.map(e=>{let n=(e.priority??"").toLowerCase(),a="urgent"===n?"Urgent":"high"===n?"High":"medium"===n?"Medium":"low"===n?"Low":"today"===e.bucket?"Today":"No priority";return(0,t.jsx)("li",{children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1",children:(0,t.jsx)(g.CardRow,{href:`/tasks/${e.id}`,children:(0,t.jsxs)("span",{className:"block if-t-meta leading-snug",children:[(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsxs)("span",{className:`inline-flex shrink-0 items-center gap-0.5 if-t-micro font-semibold uppercase tracking-wide ${"urgent"===n?"text-red-300":"high"===n?"text-orange-300":"medium"===n?"text-amber-300":"low"===n?"text-zinc-400":"text-zinc-500"}`,children:[(0,t.jsx)("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 shrink-0 rounded-full ${"urgent"===n?"bg-red-400":"high"===n?"bg-orange-400":"medium"===n?"bg-amber-400":"low"===n?"bg-zinc-400":"bg-zinc-600"}`}),a]}),e.due_date&&(0,t.jsx)("span",{className:"shrink-0 if-t-caption text-zinc-500",children:(0,g.ago)(e.due_date)}),e.brandName&&(0,t.jsxs)("span",{className:"inline-flex min-w-0 shrink items-center gap-1 rounded-full bg-white/[0.06] py-px pl-px pr-1.5",children:[e.brandLogo?(0,t.jsx)("img",{src:e.brandLogo,alt:"",className:"h-3.5 w-3.5 shrink-0 rounded-full object-cover"}):(0,t.jsx)("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full bg-zinc-700 text-[7px] font-bold text-zinc-300",children:e.brandName.slice(0,1).toUpperCase()}),(0,t.jsx)("span",{className:"truncate if-t-caption text-zinc-400",children:e.brandName})]}),e.assigneeName&&(e.assigneeAvatar?(0,t.jsx)("img",{src:e.assigneeAvatar,alt:e.assigneeName,title:e.assigneeName,className:"h-4 w-4 shrink-0 rounded-full object-cover ring-1 ring-white/10"}):(0,t.jsx)("span",{title:e.assigneeName,className:"flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-zinc-700 text-[8px] font-bold text-zinc-300",children:e.assigneeName.slice(0,1).toUpperCase()}))]}),(0,t.jsx)("span",{className:"mt-0.5 block break-words text-zinc-300",children:e.title})]})})}),"overdue"===e.bucket&&(0,t.jsx)("button",{type:"button",onClick:t=>{t.preventDefault(),t.stopPropagation(),S(e.id)},disabled:w===e.id,title:"Commit to finishing this today",className:"shrink-0 rounded-md border border-zinc-600/70 px-1.5 py-0.5 if-t-meta font-semibold text-zinc-300 transition-colors hover:border-emerald-500/60 hover:bg-emerald-500/10 hover:text-emerald-300 disabled:opacity-40",children:w===e.id?"…":"Today"})]})},e.id)})}),h>v.length&&(0,t.jsxs)("div",{className:"mt-1.5 pt-1.5 border-t border-zinc-800 if-t-caption text-zinc-500",children:["+ ",h-v.length," ",m("header_critical_more_click")||"more · click to open"]})]});return(0,t.jsx)(g.default,{card:_,width:340,children:(0,t.jsxs)(a.default,{href:C,className:(0,s.statusChip)("red"),title:`${k} ${N}`,children:[(0,t.jsx)("span",{className:(0,i.alertDot)(!0),"aria-hidden":!0}),(0,t.jsx)("span",{className:(0,s.statusChipValue)(),children:k}),(0,t.jsx)("span",{children:N})]})})}let ep=new Set(["perfCpu","perfRam","perfNet"]);function ef(e,n){let a=(0,d.useChromeOrder)(),s=(0,d.useChrome)();
2if(!e?.id)return[];let i={workedToday:(0,t.jsx)(w.TodayStatsWidget,{}),breakTimer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ed.default,{}),(0,t.jsx)(w.WorkBreakBanner,{})]}),meals:(0,t.jsx)(w.default,{userId:e.id}),water:(0,t.jsx)($,{}),dailyCall:n?(0,t.jsx)(en,{isStaff:!0,prefer:"daily"}):(0,t.jsx)(en,{isStaff:n}),weeklyCall:n?(0,t.jsx)(en,{isStaff:!0,prefer:"coaching"}):null,nextEvent:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(el,{isStaff:n}),(0,t.jsx)(eo,{}),(0,t.jsx)(ec,{})]}),overdue:(0,t.jsx)(eh,{userId:e.id,timezone:e.timezone}),wrapUp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.default,{userId:e.id}),n&&(0,t.jsx)(f.default,{})]}),stop:(0,t.jsx)(h.default,{userId:e.id}),sun:(0,t.jsx)(p.default,{}),superAdmin:(0,t.jsx)(eu,{}),money:n?(0,t.jsx)(em,{}):null,perfCpu:(0,t.jsx)(x.PerfChips,{isStaff:n,only:"cpu"}),perfRam:(0,t.jsx)(x.PerfChips,{isStaff:n,only:"ram"}),perfNet:(0,t.jsx)(x.PerfChips,{isStaff:n,only:"net"}),battery:(0,t.jsx)(x.BatteryWidget,{}),weather:(0,t.jsx)(x.HeaderStatusWidget,{only:"weather"}),date:(0,t.jsx)(x.HeaderStatusWidget,{only:"date"}),clock:(0,t.jsx)(x.HeaderStatusWidget,{only:"clock"})};return a.filter(e=>"reminder"===d.CHROME_BAR[e]&&i[e]&&(s[e]||ep.has(e))).filter(t=>!d.CHROME_ROLES[t]||d.CHROME_ROLES[t].includes(e.role??"")).map(e=>({key:e,node:i[e]}))}e.s(["default",0,function({profile:e,isStaff:a}){let s=ef(e,a);return(0,t.jsx)(t.Fragment,{children:s.map(e=>(0,t.jsx)(n.default.Fragment,{children:e.node},e.key))})},"useReminderChips",0,ef],504941)},502106,e=>{"use strict";var t=e.i(843476),n=e.i(885439),a=e.i(271645),s=e.i(522016);let i="if-cart";function r(e){return`$${(e/100).toLocaleString("en-US",{minimumFractionDigits:0})}`}e.s(["default",0,function({open:e,onClose:l}){let[o,c]=(0,a.useState)([]);function d(e,t){let n=o.map(n=>n.id===e?{...n,qty:Math.max(1,n.qty+t)}:n);localStorage.setItem(i,JSON.stringify(n)),window.dispatchEvent(new Event("if-cart-update")),c(n)}(0,a.useEffect)(()=>{function e(){try{let e=localStorage.getItem(i);c(Array.isArray(JSON.parse(e??"[]"))?JSON.parse(e??"[]"):[])}catch{c([])}}return e(),window.addEventListener("if-cart-update",e),()=>window.removeEventListener("if-cart-update",e)},[e]);let u=o.reduce((e,t)=>e+t.price_cents*t.qty,0);return(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsx)("div",{className:"fixed inset-0 z-30 bg-black/50",onClick:l}),(0,t.jsxs)("div",{className:`fixed top-[var(--header-height,65px)] right-0 bottom-0 w-full max-w-sm z-30 bg-zinc-950 border-l border-zinc-800 flex flex-col shadow-2xl transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-zinc-800",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.default,{name:"action.cart",className:"w-4 h-4 text-zinc-400"}),(0,t.jsx)("h2",{className:"text-base font-semibold text-content-primary",children:"Cart"}),o.length>0&&(0,t.jsx)("span",{className:"text-xs bg-zinc-800 text-zinc-400 px-1.5 py-0.5 rounded-full font-medium",children:o.reduce((e,t)=>e+t.qty,0)})]}),(0,t.jsx)("button",{onClick:l,className:"text-content-muted hover:text-content-primary transition-colors p-1 rounded-lg hover:bg-surface-hover",children:(0,t.jsx)(n.default,{name:"ui.close",className:"w-4 h-4"})})]}),(0,t.jsx)("div",{className:"flex-1 if-fade-overflow overflow-y-auto",children:0===o.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-4 text-content-muted",children:[(0,t.jsx)(n.default,{name:"action.cart",className:"w-10 h-10"}),(0,t.jsx)("p",{className:"text-sm",children:"Your cart is empty"}),(0,t.jsx)(s.default,{href:"/portal/shop",onClick:l,className:"px-5 py-2.5 r-container bg-violet-600 hover:bg-violet-500 text-white text-sm font-semibold transition-colors",children:"Browse the Fuel Shop"})]}):(0,t.jsx)("div",{className:"divide-y divide-zinc-800/60",children:o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-3 px-5 py-4",children:[e.image_url?(0,t.jsx)("img",{src:e.image_url,alt:e.name,className:"w-12 h-12 rounded-lg object-cover shrink-0 border border-zinc-800"}):(0,t.jsx)("div",{className:"w-12 h-12 rounded-lg bg-zinc-800 border border-zinc-700 flex items-center justify-center text-content-muted shrink-0",children:(0,t.jsx)(n.default,{name:"action.cart",className:"w-5 h-5"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-zinc-200 truncate",children:e.name}),(0,t.jsx)("p",{className:"text-sm font-semibold text-content-primary mt-0.5",children:r(e.price_cents)})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 bg-zinc-800 border border-zinc-700 rounded-lg",children:[(0,t.jsx)("button",{onClick:()=>d(e.id,-1),className:"w-6 h-6 flex items-center justify-center text-zinc-400 hover:text-content-primary transition-colors",children:(0,t.jsx)(n.default,{name:"ui.minus",className:"w-3.5 h-3.5"})}),(0,t.jsx)("span",{className:"text-sm font-medium text-content-primary w-5 text-center tabular-nums",children:e.qty}),(0,t.jsx)("button",{onClick:()=>d(e.id,1),className:"w-6 h-6 flex items-center justify-center text-zinc-400 hover:text-content-primary transition-colors",children:(0,t.jsx)(n.default,{name:"action.add",className:"w-3.5 h-3.5"})})]}),(0,t.jsx)("button",{onClick:()=>{var t;let n;return t=e.id,n=o.filter(e=>e.id!==t),void(localStorage.setItem(i,JSON.stringify(n)),window.dispatchEvent(new Event("if-cart-update")),c(n))},className:"text-content-muted hover:text-red-400 transition-colors p-1",children:(0,t.jsx)(n.default,{name:"action.delete",className:"w-3.5 h-3.5"})})]})]},e.id))})}),o.length>0&&(0,t.jsxs)("div",{className:"px-5 py-5 border-t border-zinc-800 space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-sm text-zinc-400",children:"Subtotal"}),(0,t.jsx)("span",{className:"text-base font-bold text-content-primary",children:r(u)})]}),(0,t.jsxs)(s.default,{href:"/portal/shop/cart",className:"flex items-center justify-center gap-2 w-full px-4 py-3 r-container text-white text-sm font-semibold transition-all",style:{backgroundColor:"var(--accent-brand)"},children:["Checkout",(0,t.jsx)(n.default,{name:"ui.arrow-right",className:"w-4 h-4"})]})]})]})]})}])},103043,e=>{"use strict";var t=e.i(843476),n=e.i(885439),a=e.i(271645),s=e.i(174080),i=e.i(702475),r=e.i(170431),l=e.i(411904),o=e.i(531478);let c=[{id:"beach",label:"Beach",embedId:"WHPEKLQID4U"},{id:"forest",label:"Forest",embedId:"xNN7iTA57jM"},{id:"rain",label:"Rain",embedId:"mPZkdNFkNps"}],d=[{title:"Tibetan Singing Bowls · 3 Hours",channel:"Tibetan Music",embedId:"2OEL4P1Rz04",thumb:"https://i.ytimg.com/vi/2OEL4P1Rz04/mqdefault.jpg"},{title:"Sleep Music · Delta Waves",channel:"Yellow Brick Cinema",embedId:"8Z7LCMToMkQ",thumb:"https://i.ytimg.com/vi/8Z7LCMToMkQ/mqdefault.jpg"},{title:"Peaceful Piano · Relaxing Sleep Music",channel:"Soothing Relaxation",embedId:"1ZYbU82GVz4",thumb:"https://i.ytimg.com/vi/1ZYbU82GVz4/mqdefault.jpg"}];function u(e,t=!1){return t?e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}):e.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}function m(e){let t=Math.round(e/6e4),n=Math.floor(t/60),a=t%60;return 0===a?`${n}h`:`${n}h ${a}m`}function h({onConfirm:e,onCancel:s}){let i,o=(0,l.usePlayYouTube)(),p=new Date(Date.now()+288e5),[f,x]=(0,a.useState)(p.getHours()),[g,b]=(0,a.useState)(15*Math.round(p.getMinutes()/15)%60),[w,y]=(0,a.useState)(null),v=((i=new Date).setHours(f,g,0,0),i.getTime()<=Date.now()&&i.setDate(i.getDate()+1),i),j=v.getTime()-Date.now(),k=(0,a.useRef)(null),N=(0,a.useRef)(!1),C=(0,a.useCallback)(e=>{if(!k.current)return;let t=k.current.getBoundingClientRect(),n=Math.round(23*Math.max(0,Math.min(1,(e-t.left)/t.width))),a=new Date(Date.now()+60*n*6e4);x(a.getHours()),b(15*Math.round(a.getMinutes()/15)%60)},[]);(0,a.useEffect)(()=>{function e(e){N.current&&C("touches"in e?e.touches[0].clientX:e.clientX)}function t(){N.current=!1}return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),window.addEventListener("touchmove",e),window.addEventListener("touchend",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t),window.removeEventListener("touchmove",e),window.removeEventListener("touchend",t)}},[C]);let S=Math.max(0,(v.getTime()-Date.now())/36e5),_=Math.min(1,S/23);return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto p-6 space-y-8",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("div",{className:"w-9 h-9 r-container bg-indigo-500/15 flex items-center justify-center",children:(0,t.jsx)(n.default,{name:"ui.moon",className:"w-5 h-5 text-indigo-300"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-base font-bold text-content-primary",children:(0,t.jsx)(r.default,{children:"Go to Sleep"})}),(0,t.jsx)("p",{className:"text-xs text-content-muted",children:(0,t.jsx)(r.default,{children:"Set your wake-up alarm"})})]})]}),(0,t.jsx)("button",{onClick:s,className:"p-2 r-cta text-content-muted hover:text-zinc-300 hover:bg-surface-hover transition-colors",children:(0,t.jsx)(n.default,{name:"ui.close",className:"w-4 h-4"})})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-zinc-300",children:(0,t.jsx)(r.default,{children:"Wake-up alarm"})}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("p",{className:"text-2xl font-bold text-white tabular-nums",children:u(v)}),(0,t.jsxs)("p",{className:"text-xs text-indigo-400",children:[m(j)," ",(0,t.jsx)(r.default,{children:"from now"})]})]})]}),(0,t.jsx)("div",{ref:k,className:"relative h-12 flex items-center cursor-pointer select-none",onMouseDown:e=>{N.current=!0,C(e.clientX)},onTouchStart:e=>{N.current=!0,C(e.touches[0].clientX)},children:(0,t.jsxs)("div",{className:"w-full h-2 rounded-full bg-zinc-800 relative",children:[(0,t.jsx)("div",{className:"absolute left-0 top-0 h-full rounded-full bg-gradient-to-r from-indigo-600 to-violet-500 transition-none",style:{width:`${100*_}%`}}),[...Array(12)].map((e,n)=>(0,t.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 w-px h-3 bg-zinc-700",style:{left:`${(n+1)/12*100}%`}},n)),(0,t.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-5 h-5 rounded-full bg-white shadow-lg shadow-indigo-500/30 border-2 border-indigo-400 transition-none",style:{left:`${100*_}%`}})]})}),(0,t.jsx)("div",{className:"flex gap-2",children:[6,7,8,9].map(e=>(0,t.jsxs)("button",{onClick:()=>{x(new Date(Date.now()+36e5*e).getHours()),b(0)},className:`flex-1 py-2 text-xs font-semibold r-container border transition-colors ${.25>Math.abs(S-e)?"bg-indigo-500/20 border-indigo-500/40 text-indigo-300":"bg-zinc-800 border-zinc-700 text-zinc-400 hover:text-zinc-200 hover:border-zinc-600"}`,children:[e,"h"]},e))})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-zinc-300",children:(0,t.jsx)(r.default,{children:"Ambient noise"})}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-2",children:c.map(e=>(0,t.jsx)("button",{onClick:()=>y(w===e.id?null:e.id),className:`py-3 text-xs font-semibold r-container border transition-all ${w===e.id?"bg-indigo-500/20 border-indigo-500/40 text-indigo-200":"bg-zinc-800/60 border-zinc-700 text-zinc-400 hover:text-zinc-200 hover:border-zinc-600"}`,children:(0,t.jsx)(r.default,{children:e.label})},e.id))})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-zinc-300",children:(0,t.jsx)(r.default,{children:"Meditation tracks"})}),(0,t.jsx)("div",{className:"space-y-2",children:d.map((e,a)=>(0,t.jsxs)("button",{onClick:()=>o(e.embedId,e.title),className:"w-full flex items-center gap-3 p-2.5 r-container bg-zinc-800/60 border border-zinc-700/60 hover:border-zinc-600 hover:bg-surface-hover transition-colors group text-left",children:[(0,t.jsx)("img",{src:e.thumb,alt:e.title,className:"w-14 h-10 rounded-lg object-cover shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-zinc-200 group-hover:text-white truncate transition-colors",children:e.title}),(0,t.jsx)("p",{className:"text-[10px] text-content-muted",children:e.channel})]}),(0,t.jsx)(n.default,{name:"media.play",className:"w-3.5 h-3.5 text-content-muted group-hover:text-zinc-300 shrink-0 transition-colors"})]},a))})]})]}),(0,t.jsxs)("div",{className:"px-6 pb-6 pt-4 border-t border-zinc-800 space-y-2",children:[(0,t.jsxs)("button",{onClick:()=>e(v,w),className:"w-full py-3.5 r-container text-white font-bold text-sm tracking-wide active:scale-[0.98] transition-transform",style:{background:"linear-gradient(135deg, #4f46e5, #7c3aed)"},children:[(0,t.jsx)(n.default,{name:"ui.moon",className:"w-4 h-4 inline mr-2 -mt-0.5"}),(0,t.jsx)(r.default,{children:"Go to Sleep"})]}),(0,t.jsxs)("p",{className:"text-center text-xs text-content-muted font-normal",children:[(0,t.jsx)(r.default,{children:"Wake at"})," ",u(v)," · ",m(j)," ",(0,t.jsx)(r.default,{children:"from now"})]})]})]})}function p({wakeAt:e,ambientId:s,sleepStartedAt:i,onWake:l}){let d=(0,o.useNow)(1e3),[m,h]=(0,a.useState)(100),[f,x]=(0,a.useState)(null!==s),[g,b]=(0,a.useState)(!0),w=(0,a.useRef)(null),y=(0,a.useRef)(!1);(0,a.useEffect)(()=>
2{if(null!==d){if(!y.current){y.current=!0;return}d>=e.getTime()&&l()}},[d,e,l]),(0,a.useEffect)(()=>(g&&(w.current&&clearTimeout(w.current),w.current=setTimeout(()=>b(!1),4e3)),()=>{w.current&&clearTimeout(w.current)}),[g]);let v=c.find(e=>e.id===s),j=null===d?null:new Date(d),[k,N]=(j?j.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):"").split(" ");return(0,t.jsxs)("div",{className:"fixed inset-0 z-[500] bg-black overflow-hidden select-none",onClick:()=>b(e=>!e),children:[(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center transition-opacity duration-300",style:{opacity:m/100},children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-3",children:[(0,t.jsx)("span",{className:"font-thin text-white leading-none tabular-nums",style:{fontSize:"clamp(80px, 20vw, 220px)",letterSpacing:"-0.02em"},children:k}),N&&(0,t.jsx)("span",{className:"font-light text-white/70 text-4xl tracking-wide mb-2",children:N})]}),(0,t.jsx)("p",{className:"text-white/40 text-lg font-light tracking-widest mt-2",children:j?.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric"})})]}),(0,t.jsxs)("div",{className:`absolute inset-x-0 bottom-0 pb-12 px-8 flex flex-col items-center gap-6 transition-all duration-500 ${g?"opacity-100 translate-y-0":"opacity-0 translate-y-4 pointer-events-none"}`,onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"w-full max-w-xs flex items-center gap-3",children:[(0,t.jsx)(n.default,{name:"ui.moon",className:"w-4 h-4 text-white/30 shrink-0"}),(0,t.jsx)("input",{type:"range",min:5,max:100,value:m,onChange:e=>h(Number(e.target.value)),className:"flex-1 h-1 appearance-none rounded-full cursor-pointer",style:{background:`linear-gradient(to right, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.8) ${m}%, rgba(255,255,255,0.15) ${m}%, rgba(255,255,255,0.15) 100%)`,WebkitAppearance:"none"}}),(0,t.jsx)(n.default,{name:"ui.sun",className:"w-4 h-4 text-white/50 shrink-0"})]}),(0,t.jsxs)("p",{className:"text-white/30 text-xs tracking-widest",children:[(0,t.jsx)(r.default,{children:"Alarm at"})," ",u(e)]}),v&&(0,t.jsxs)("button",{onClick:()=>x(e=>!e),className:"flex items-center gap-2 px-4 py-2 rounded-full bg-white/10 text-white/60 text-xs hover:bg-white/15 transition-colors",children:[f?(0,t.jsx)(n.default,{name:"ui.pause",className:"w-3.5 h-3.5"}):(0,t.jsx)(n.default,{name:"media.play",className:"w-3.5 h-3.5"}),(0,t.jsx)(r.default,{children:v.label})]}),(0,t.jsx)("button",{onClick:l,className:"text-white/25 hover:text-white/50 text-xs tracking-widest transition-colors",children:(0,t.jsx)(r.default,{children:"Wake up early"})})]}),v&&f&&(0,t.jsx)("iframe",{src:`https://www.youtube.com/embed/${v.embedId}?autoplay=1&loop=1&playlist=${v.embedId}&controls=0&modestbranding=1`,allow:"autoplay",className:"w-0 h-0 opacity-0 absolute pointer-events-none"})]})}function f({sleepStartedAt:e,onDone:s}){let i,[l,o]=(0,a.useState)(!1),[c,d]=(0,a.useState)(null),u=new Date,m=Date.now()-e,h=Math.floor(m/36e5),p=Math.floor(m%36e5/6e4),x=h>0?`${h}h ${p>0?p+"m":""}`.trim():`${p}m`,g=(i=u.getHours())<12?"Good morning":i<17?"Good afternoon":"Good evening";return(0,a.useEffect)(()=>{let e=setTimeout(()=>o(!0),50);return()=>clearTimeout(e)},[]),(0,a.useEffect)(()=>{let e=setTimeout(s,5e3);return()=>clearTimeout(e)},[s]),(0,a.useEffect)(()=>{fetch("https://wttr.in/?format=j1").then(e=>e.json()).then(e=>{let a,s,i=e.current_condition?.[0];i&&d({temp:`${i.temp_F}\xb0F`,desc:i.weatherDesc?.[0]?.value??"",iconEl:(a=parseInt(i.weatherCode,10),s="w-6 h-6",113===a?(0,t.jsx)(n.default,{name:"ui.sun",className:s}):116===a||119===a||122===a?(0,t.jsx)(n.default,{name:"ui.weather-cloud",className:s}):a>=176&&a<=263||a>=296&&a<=321?(0,t.jsx)(n.default,{name:"ui.weather-rain",className:s}):a>=338&&a<=395?(0,t.jsx)(n.default,{name:"ui.weather-snow",className:s}):a>=392?(0,t.jsx)(n.default,{name:"ui.weather-storm",className:s}):(0,t.jsx)(n.default,{name:"ui.thermometer",className:s}))})}).catch(()=>{})},[]),(0,t.jsxs)("div",{className:"fixed inset-0 z-[500] flex flex-col items-center justify-center transition-opacity duration-[1200ms] cursor-pointer",style:{opacity:+!!l,background:"linear-gradient(160deg, #0f0c29, #302b63, #24243e)"},onClick:s,children:[(0,t.jsxs)("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[(0,t.jsx)("div",{className:"absolute top-1/4 left-1/2 -translate-x-1/2 w-[600px] h-[300px] rounded-full opacity-20",style:{background:"radial-gradient(ellipse, var(--if-purple) 0%, transparent 70%)",filter:"blur(60px)"}}),(0,t.jsx)("div",{className:"absolute top-1/3 left-1/3 w-[400px] h-[200px] rounded-full opacity-15",style:{background:"radial-gradient(ellipse, #48ACF0 0%, transparent 70%)",filter:"blur(80px)"}})]}),(0,t.jsxs)("div",{className:"relative z-10 flex flex-col items-center gap-5 text-center px-6",children:[(0,t.jsx)("p",{className:"text-white/40 text-lg font-light tracking-[0.3em] uppercase",children:u.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric"})}),(0,t.jsx)("p",{className:"font-thin text-white leading-none tabular-nums",style:{fontSize:"clamp(60px, 14vw, 120px)"},children:u.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-2xl font-semibold text-white",children:(0,t.jsx)(r.default,{children:g})}),(0,t.jsxs)("p",{className:"text-zinc-400 text-sm",children:[(0,t.jsx)(r.default,{children:"You slept"})," ",x]})]}),c&&(0,t.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-2.5 r-container bg-white/10 border border-white/10",children:[(0,t.jsx)("span",{className:"text-2xl text-white/80",children:c.iconEl}),(0,t.jsxs)("div",{className:"text-left",children:[(0,t.jsx)("p",{className:"text-white font-semibold text-sm",children:c.temp}),(0,t.jsx)("p",{className:"text-white/50 text-xs",children:c.desc})]})]}),(0,t.jsx)("p",{className:"text-white/25 text-xs mt-4",children:(0,t.jsx)(r.default,{children:"Tap anywhere to continue"})})]})]})}e.s(["default",0,function({onClose:e}){let[n,r]=(0,a.useState)("setup"),[l,o]=(0,a.useState)(null),[c,d]=(0,a.useState)(null),[u,m]=(0,a.useState)(null),[x,g]=(0,a.useState)(!1);(0,a.useEffect)(()=>{g(!0)},[]);let b=(0,a.useCallback)(()=>{let e=(0,i.loadWorkBreak)();(0,i.clearWorkBreak)(e??void 0),r("waking")},[]);return x?"sleeping"===n&&l&&null!==u?(0,s.createPortal)((0,t.jsx)(p,{wakeAt:l,ambientId:c,sleepStartedAt:u,onWake:b}),document.body):"waking"===n&&null!==u?(0,s.createPortal)((0,t.jsx)(f,{sleepStartedAt:u,onDone:function(){r("setup"),e()}}),document.body):(0,s.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[300] flex items-end sm:items-center justify-center",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:e}),(0,t.jsxs)("div",{className:"relative z-10 w-full sm:max-w-md bg-zinc-950 border border-zinc-800 rounded-t-3xl sm:r-container shadow-2xl overflow-hidden max-h-[90dvh] flex flex-col",children:[(0,t.jsx)("div",{className:"flex justify-center pt-3 pb-1 sm:hidden shrink-0",children:(0,t.jsx)("div",{className:"w-10 h-1 rounded-full bg-zinc-700"})}),(0,t.jsx)(h,{onConfirm:function(e,t){let n=Date.now();m(n),o(e),d(t),(0,i.saveWorkBreak)({type:"custom",label:"Sleep",endsAt:e.getTime(),startedAt:n}),window.dispatchEvent(new CustomEvent("if:music-fade-out")),r("sleeping")},onCancel:e})]})]}),document.body):null}])},974767,e=>{"use strict";var t=e.i(13562);function n(e){let n=(0,t.getPageHelp)(String(e??""));if(n)return n.label;
2let a=String(e??"/").split("?")[0].split("/").filter(Boolean)[0]??"";return a?a.replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase()):"Home"}e.s(["pageLabel",0,n,"walkthroughHref",0,function(e){let t=String(e??"/").split("?")[0]||"/";return`/fuela?ask=${encodeURIComponent(`Show me around ${n(t)}: what can I do here, and where should I start?`)}&page=${encodeURIComponent(t)}`}])},407604,e=>{"use strict";var t=e.i(271645);async function n(){let e=new AbortController,t=setTimeout(()=>e.abort(),4e3);try{return await fetch(`/favicon.ico?_probe=${Date.now()}`,{method:"HEAD",cache:"no-store",signal:e.signal}),!0}catch{return!1}finally{clearTimeout(t)}}let a=!0,s=!1,i=null,r=null,l=new Set;function o(){return r||(r=(async()=>{let e=await n();e!==a&&(a=e,l.forEach(e=>e())),e&&i&&(clearInterval(i),i=null),e||i||(i=setInterval(()=>{o()},5e3))})().finally(()=>{r=null}))}function c(e){return l.add(e),!function(){if(s)return;s=!0;let e=()=>{o()};window.addEventListener("online",e),window.addEventListener("offline",e);let t=()=>{"visible"!==document.visibilityState||a||o()};window.addEventListener("focus",t),document.addEventListener("visibilitychange",t),"u">typeof navigator&&!navigator.onLine&&o()}(),()=>{l.delete(e)}}e.s(["recheckOnline",0,o,"useOnline",0,function(){return(0,t.useSyncExternalStore)(c,()=>a,()=>!0)}])},35525,910504,422879,e=>{"use strict";var t=e.i(843476),n=e.i(38044),a=e.i(271645),s=e.i(885439),i=e.i(644075),r=e.i(457377);function l({me:e,onClose:o}){let[c,d]=(0,a.useState)(null),[u,m]=(0,a.useState)(!0),[h,p]=(0,a.useState)(null),[f,x]=(0,a.useState)(""),[g,b]=(0,a.useState)(!1),[w,y]=(0,a.useState)(null),v=Intl.DateTimeFormat().resolvedOptions().timeZone;(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await fetch(`/api/booking/slots?days=14&timezone=${encodeURIComponent(v)}`),n=await t.json();if(!e)return;m(!1!==n.configured),d(n.days??[])}catch{e&&(m(!1),d([]))}})(),()=>{e=!1}},[v]);let j=(0,a.useCallback)(async()=>{if(h){b(!0);try{let t=await fetch("/api/booking/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({full_name:e.full_name,email:e.email??"",phone:e.phone??"",slot:h,timezone:v,service:"Internal, staff time with Basim",notes:f.trim()||"No agenda given",source:r.INTERNAL_BOOKING_SOURCE})}),n=await t.json();if(!t.ok)throw Error(n.error??"Could not book it");y(h),i.toast.success("Booked. It is on both calendars.")}catch(e){i.toast.error(e instanceof Error?e.message:"Could not book it")}finally{b(!1)}}},[h,f,e,v]),k=e=>new Date(e+"T12:00:00").toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),N=e=>new Date(e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}),C=(c??[]).filter(e=>e.slots.length>0);return(0,t.jsx)("div",{className:"fixed inset-0 z-[90] flex items-end justify-center bg-black/50 p-3 sm:items-center",onClick:o,children:(0,t.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"max-h-[85vh] w-full max-w-md overflow-y-auto rounded-2xl border border-line-base bg-surface-card p-4 shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(s.default,{name:"nav.calendar",size:16,className:"mt-0.5 shrink-0 text-accent-brand"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-[14px] font-bold text-content-primary",children:"Book time with Basim"}),(0,t.jsx)("p",{className:"text-[11px] text-content-secondary",children:"Real openings from his calendar, in your timezone."})]}),(0,t.jsx)(n.default,{onClose:o,className:"-mr-1 -mt-1"})]}),w?(0,t.jsxs)("div",{className:"mt-4 rounded-xl border border-emerald-500/30 bg-emerald-500/[0.07] p-3",children:[(0,t.jsxs)("p",{className:"text-[13px] font-semibold text-content-primary",children:[k(w.slice(0,10))," at ",N(w)]}),(0,t.jsx)("p",{className:"mt-1 text-[11.5px] text-content-secondary",children:"It is on his calendar and yours. He will see the note you left."})]}):c?u&&0!==C.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mt-3 space-y-2",children:C.slice(0,7).map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wide text-content-secondary",children:k(e.date)}),(0,t.jsx)("div",{className:"mt-1 flex flex-wrap gap-1",children:e.slots.slice(0,10).map(e=>(0,t.jsx)("button",{onClick:()=>p(e.start),className:`rounded-md px-2 py-1 text-[11.5px] font-medium transition-colors ${h===e.start?"bg-accent-brand text-white":"border border-line-base text-content-secondary hover:bg-surface-hover"}`,children:N(e.start)},e.start))})]},e.date))}),(0,t.jsx)("textarea",{value:f,onChange:e=>x(e.target.value),rows:2,placeholder:"What is it about? One line is plenty",className:"mt-3 w-full rounded-lg border border-line-base bg-surface-input px-2.5 py-2 text-[12px] text-content-primary outline-none focus:border-accent-brand"}),(0,t.jsx)("button",{onClick:()=>void j(),disabled:!h||g,className:"mt-2 w-full rounded-lg bg-accent-brand px-3 py-2 text-[12.5px] font-semibold text-white disabled:opacity-40",children:g?"Booking":h?`Book ${N(h)}`:"Pick a time"})]}):(0,t.jsx)("p",{className:"mt-4 text-[12px] text-content-secondary",children:"No open slots in the next two weeks. Message him with a time that suits you instead."}):(0,t.jsx)("p",{className:"mt-4 text-[12px] text-content-secondary",children:"Reading his calendar."})]})})}e.s(["default",0,l],35525);var o=e.i(915120),c=e.i(618566);let d=[["/chat","Chat"],["/tasks","Tasks"],["/notes","Docs"],["/replays","Replays"],["/projects","Projects"],["/brands","Brands"],["/spaces","Community"],["/gallery-community","Gallery"],["/portal/events","Calendar"],["/playbooks","Playbooks"],["/prompts","Prompts"],["/assets","Assets"],["/dashboard","Home"],["/leads","Leads"],["/finance","Finance"],["/admin","Admin"],["/settings","Settings"]];function u(){let e,n=(0,c.useRouter)(),i=(0,c.usePathname)(),[r,l]=(0,a.useState)(null),[o,u]=(0,a.useState)(!1);(0,a.useEffect)(()=>{try{let e=sessionStorage.getItem("if:nav-trail"),t=e?JSON.parse(e):[],n=t[t.length-1];n&&n!==i&&l(n),n!==i&&sessionStorage.setItem("if:nav-trail",JSON.stringify([...t,i].slice(-20)))}catch{}},[i]),(0,a.useEffect)(()=>{let e=()=>u(!0);return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[]);let m=r?(e=d.filter(([e])=>r.startsWith(e)).sort((e,t)=>
2t[0].length-e[0].length)[0])?e[1]:null:null;return(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsxs)("button",{onClick:()=>n.back(),title:m?`Back to ${m}`:"Back",className:"flex h-8 items-center gap-1 rounded-lg px-2 text-content-muted transition-colors hover:bg-surface-hover hover:text-content-primary",children:[(0,t.jsx)(s.default,{name:"ui.chevron-left",size:15}),m&&(0,t.jsxs)("span",{className:"hidden text-[12.5px] font-medium lg:inline",children:["Back to ",m]})]}),(0,t.jsx)("button",{onClick:()=>n.forward(),disabled:!o,"aria-label":"Forward",title:"Forward",className:"flex h-8 w-8 items-center justify-center rounded-lg text-content-muted transition-colors enabled:hover:bg-surface-hover enabled:hover:text-content-primary disabled:opacity-30",children:(0,t.jsx)(s.default,{name:"ui.chevron-right",size:15})})]})}var m=e.i(966344),h=e.i(601298),p=e.i(174080),f=e.i(302220),x=e.i(170373),g=e.i(30593),b=e.i(733607),w=e.i(920755),y=e.i(247167);y.default.env.GHL_LOCATION_ID;var v=e.i(815653);function j({role:e}){let n=(0,v.isStaffRole)(e),[i,r]=(0,a.useState)(n);return((0,a.useEffect)(()=>{if(n)return void r(!0);let e=!0;return(async()=>{try{let t=(0,w.createClient)(),{data:{session:n}}=await t.auth.getSession();if(!n?.user)return;let{data:a}=await t.from("brand_members").select("brand_id").eq("profile_id",n.user.id),s=(a??[]).map(e=>e.brand_id).filter(Boolean);if(!s.length)return;let{count:i}=await t.from("brands").select("id",{count:"exact",head:!0}).in("id",s).not("ghl_location_id","is",null).neq("ghl_location_id","2bLPE7pNJtez9JbQrsya");e&&r((i??0)>0)}catch{}})(),()=>{e=!1}},[n]),i)?(0,t.jsxs)("a",{href:"/crm",target:"_blank",rel:"noopener",title:"Your CRM","aria-label":"Engine, your CRM",onClick:e=>{let t;e.currentTarget.href=(t=new URLSearchParams(window.location.search).get("brand")??window.location.pathname.match(/^\/brands\/([0-9a-f-]{36})/)?.[1])?`/crm?brand=${t}`:"/crm"},className:`group ${(0,o.navTop)()}`,children:[(0,t.jsx)(s.default,{name:"action.dashboard",size:16,"aria-hidden":!0,className:"shrink-0"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Engine"})]}):null}var k=e.i(177262);let N=e=>{let t=document.cookie.split("; ").find(t=>t.startsWith(`${e}=`));return t?decodeURIComponent(t.slice(e.length+1)):null};function C({label:e,onExit:n}={}){let[i,r]=(0,a.useState)(null);(0,a.useEffect)(()=>{r({role:N("if_sim_role"),name:N("if_sim_name")})},[]);let l=i?.role??null,o=e??i?.name??null;if(!l&&!o)return null;let c=n??(()=>{document.cookie="if_sim_role=; path=/; max-age=0",document.cookie="if_sim_user=; path=/; max-age=0",document.cookie="if_sim_name=; path=/; max-age=0",document.cookie="if_sim_setter=; path=/; max-age=0",window.location.reload()}),d=l?({public:{who:"a stranger",sees:"signed out, no cookie - the page for someone nothing here remembers"},visitor:{who:"a returning lead",sees:"signed out, but the cookie still knows the name and greets you by it"},lead:{who:"a returning lead",sees:"signed out, but the cookie still knows the name and greets you by it"}})[l]:void 0,u=d?d.who:o||l,m=d?d.sees:"their menu, their brands, their plan - read with your access, not theirs";return(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-amber-500/20 bg-amber-500/10 px-4 py-1.5",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5 if-t-meta text-amber-400",children:[(0,t.jsx)(s.default,{name:"ui.warning",size:12,className:"shrink-0"}),(0,t.jsxs)("span",{className:"truncate",children:["Viewing as ",(0,t.jsx)("strong",{children:u}),(0,t.jsx)("span",{className:"ml-1.5 hidden font-normal opacity-80 sm:inline",children:m})]})]}),(0,t.jsx)("button",{type:"button",onClick:c,className:"shrink-0 if-t-meta font-medium text-amber-400 transition-colors hover:text-amber-200",children:"Exit"})]})}e.s(["default",0,C],910504);var S=e.i(453561),_=e.i(296582),E=e.i(585281),z=e.i(991585),T=e.i(292296),$=e.i(928233),L=e.i(89772),D=e.i(263276),I=e.i(89699),M=e.i(307400),A=e.i(310119),P=e.i(362505),U=e.i(451096),F=e.i(164240),O=e.i(504941),R=e.i(522016),W=e.i(874553);e.i(700354),e.i(429507);var B=e.i(425757);function q(){return null}var H=e.i(509084),G=e.i(502106),K=e.i(702475);function J(e){return e*Math.PI/180}function Y(e){return 180*e/Math.PI}function V(e){return e-360*Math.floor(e/360)}function Z(e){return e-24*Math.floor(e/24)}function Q(e,t,n,a,s){let i=(-Math.sin(J(a))-Math.sin(J(e))*Math.sin(J(t)))/(Math.cos(J(e))*n);if(i>1||i<-1)return NaN;let r=Y(Math.acos(i))/15;return s?-r:r}var X=e.i(750061);let ee=["Fajr","Dhuhr","Asr","Maghrib","Isha"],et=[{arabic:"إِنَّ الصَّلَاةَ كَانَتْ عَلَى الْمُؤْمِنِينَ كِتَابًا مَوْقُوتًا",text:"Indeed, prayer has been decreed upon the believers a decree of specified times.",source:"Quran 4:103"},{arabic:"إِنَّ الصَّلَاةَ تَنْهَى عَنِ الْفَحْشَاءِ وَالْمُنكَرِ",text:"Establish prayer. Indeed, prayer prohibits immorality and wrongdoing.",source:"Quran 29:45"},{arabic:"وَاسْتَعِينُوا بِالصَّبْرِ وَالصَّلَاةِ ۚ إِنَّ اللَّهَ مَعَ الصَّابِرِينَ",text:"Seek help through patience and prayer. Indeed, Allah is with the patient.",source:"Quran 2:153"},{arabic:"صَلُّوا كَمَا رَأَيْتُمُونِي أُصَلِّي",text:"Pray as you have seen me praying.",source:"Sahih al-Bukhari"},{arabic:"الصَّلَاةُ عِمَادُ الدِّينِ",text:"The prayer is the pillar of religion. Whoever establishes it has established the religion.",source:"Al-Bayhaqi"},{arabic:"أَلَا بِذِكْرِ اللَّهِ تَطْمَئِنُّ الْقُلُوبُ",text:"Verily, in the remembrance of Allah do hearts find rest.",source:"Quran 13:28"},{text:"The closest a servant is to his Lord is when he is in prostration, so make much supplication therein.",source:"Sahih Muslim"},{text:"The first matter a slave will be brought to account for on the Day of Judgment is the prayer. If it is sound, all his deeds will be sound.",source:"Al-Tabarani"}
2,{text:"The five daily prayers and Friday to Friday are expiation for what comes between them, as long as major sins are avoided.",source:"Sahih Muslim"},{arabic:"رَبَّنَا آتِنَا فِي الدُّنْيَا حَسَنَةً وَفِي الْآخِرَةِ حَسَنَةً وَقِنَا عَذَابَ النَّارِ",text:"Our Lord, give us good in this world and good in the next, and protect us from the punishment of the Fire.",source:"Quran 2:201"},{arabic:"سُبْحَانَكَ اللَّهُمَّ وَبِحَمْدِكَ",text:"Glory be to You, O Allah, and praise be to You. (Opening supplication for prayer)",source:"Sunnah"},{arabic:"اللَّهُ أَكْبَرُ",text:"Allahu Akbar · Allah is the Greatest. Begin each rakah with His remembrance.",source:"Takbir"},{text:"Whoever prays the two cool prayers (Fajr and Asr) will enter Paradise.",source:"Sahih al-Bukhari"},{arabic:"وَأَقِمِ الصَّلَاةَ إِنَّ الصَّلَاةَ تَنْهَى عَنِ الْفَحْشَاءِ وَالْمُنكَرِ",text:"Establish prayer. Indeed prayer prohibits immorality and wrongdoing.",source:"Quran 29:45"},{text:"Make your rows straight, for straightening the rows is part of the perfection of prayer.",source:"Sahih al-Bukhari"},{arabic:"إِنَّنِي أَنَا اللَّهُ لَا إِلَٰهَ إِلَّا أَنَا فَاعْبُدْنِي وَأَقِمِ الصَّلَاةَ لِذِكْرِي",text:"Indeed, I am Allah. There is no deity except Me, so worship Me and establish prayer for My remembrance.",source:"Quran 20:14"}],en="if:prayer-log-v1";function ea(){let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function es(e,t=ea()){return`${t}/${e}`}async function ei(e){try{let t=await fetch(`https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(e)}&count=1&format=json`),n=await t.json(),a=n.results?.[0];if(!a)return null;let s=(()=>{try{let e=new Intl.DateTimeFormat("en",{timeZone:a.timezone,timeZoneName:"shortOffset"}),t=(e.formatToParts(new Date).find(e=>"timeZoneName"===e.type)?.value??"").match(/GMT([+-]\d+)(?::(\d+))?/);if(!t)return 0;return("+"===t[1][0]?1:-1)*(Math.abs(parseInt(t[1]))+parseInt(t[2]??"0")/60)}catch{return 0}})();return{lat:a.latitude,lng:a.longitude,utcOffset:s}}catch{return null}}async function er(e,t){try{let n=(0,w.createClient)(),a=ea(),s=`prayer-${t}`,{data:i}=await n.from("wellness_logs").select("id").eq("profile_id",e).eq("logged_date",a).eq("source",s).maybeSingle();i||await n.from("wellness_logs").insert({profile_id:e,logged_date:a,source:s,notes:`Prayer: ${t}`});let{data:r}=await n.from("profiles").select("points").eq("id",e).single(),l=r?.points??0;await n.from("profiles").update({points:l+10}).eq("id",e)}catch{}}async function el(e=30){try{let t=(0,w.createClient)(),n=new Date;n.setDate(n.getDate()-e);let a=n.toISOString().slice(0,10),{data:s}=await t.from("wellness_logs").select("profile_id, profiles!profile_id(full_name, avatar_url, points, notification_prefs)").ilike("source","prayer-%").gte("logged_date",a);if(!s)return[];let i=new Map;for(let e of s){let t=Array.isArray(e.profiles)?e.profiles[0]:e.profiles;if(!t||!(t.notification_prefs??{}).muslim_mode)continue;let n=i.get(e.profile_id);n?n.count++:i.set(e.profile_id,{full_name:t.full_name,avatar_url:t.avatar_url,points:t.points??0,count:1})}return Array.from(i.entries()).map(([e,t])=>({profile_id:e,full_name:t.full_name,avatar_url:t.avatar_url,prayerCount:t.count,points:t.points})).sort((e,t)=>t.prayerCount-e.prayerCount||t.points-e.points).slice(0,15)}catch{return[]}}function eo({playbook:e}){let[n,i]=(0,a.useState)(new Set);return e.steps.length?(0,t.jsxs)("div",{className:"w-full max-w-xs",children:[(0,t.jsx)("ol",{className:"flex flex-col gap-1.5",children:e.steps.map((e,a)=>{let r=n.has(e.id);return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",onClick:()=>{let t;return t=e.id,i(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},className:`flex w-full items-center gap-3 rounded-lg border px-3 py-2 text-left transition-colors ${r?"border-emerald-500/40 bg-emerald-500/10":"border-line-base bg-surface-card hover:bg-surface-hover"}`,children:[(0,t.jsx)(s.default,{name:r?"check.checked":"check.unchecked",size:18,className:r?"text-emerald-400":"text-content-muted"}),(0,t.jsxs)("span",{className:`if-t-body font-medium ${r?"text-content-primary":"text-content-secondary"}`,children:[a+1,". ",e.title]})]})},e.id)})}),(0,t.jsxs)(R.default,{href:`/playbooks?playbook=${e.id}`,className:"mt-2 inline-flex items-center gap-1 if-t-caption text-brand-ink hover:opacity-75 transition-opacity",children:["Open the playbook",(0,t.jsx)(s.default,{name:"ui.chevron-right",size:14})]})]}):null}function ec({prayerName:e,userId:n,onCancel:i,onLogged:r}){let l,[o,c]=(0,a.useState)(300),[d,u]=(0,a.useState)(!1),[m,h]=(0,a.useState)(!1),[f,x]=(0,a.useState)(!1),[g,b]=(0,a.useState)(0),[y,v]=(0,a.useState)(!1),j=(0,a.useRef)(Date.now()),k=function(){let[e,t]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!0;return(0,w.createClient)().from("playbooks").select("id, title, playbook_steps(id, title, sort_order)").ilike("title","Ready for prayer%").eq("is_active",!0).limit(1).maybeSingle().then(({data:n})=>{if(!e||!n)return;let a=[...n.playbook_steps??[]].sort((e,t)=>
2(e.sort_order??0)-(t.sort_order??0)).map(e=>({id:e.id,title:e.title}));t({id:n.id,title:n.title,steps:a})}).catch(()=>{}),()=>{e=!1}},[]),e}();(0,a.useEffect)(()=>{b(Math.floor(Math.random()*et.length))},[]),(0,a.useEffect)(()=>{let e=setInterval(()=>{let t=Math.max(0,300-Math.floor((Date.now()-j.current)/1e3));if(c(t),0===t){clearInterval(e),u(!0);try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.currentTime;function n(a,s,i,r=.12,l="sine"){let o=e.createOscillator(),c=e.createGain(),d=e.createBiquadFilter();d.type="lowpass",d.frequency.value=3e3,o.type=l,o.frequency.value=a,c.gain.setValueAtTime(0,t+s),c.gain.linearRampToValueAtTime(r,t+s+.03),c.gain.exponentialRampToValueAtTime(1e-4,t+s+i),o.connect(d),d.connect(c),c.connect(e.destination),o.start(t+s),o.stop(t+s+i+.05);let u=e.createOscillator(),m=e.createGain();u.type="sine",u.frequency.value=2*a,m.gain.setValueAtTime(0,t+s),m.gain.linearRampToValueAtTime(.18*r,t+s+.02),m.gain.exponentialRampToValueAtTime(1e-4,t+s+.5*i),u.connect(m),m.connect(e.destination),u.start(t+s),u.stop(t+s+i)}n(523.25,0,1.8,.14),n(659.25,.2,1.8,.14),n(783.99,.4,2,.14),n(1046.5,.6,2.6,.12),n(523.25,.8,2.8,.08),n(659.25,.8,2.8,.08),n(783.99,.8,2.8,.08),setTimeout(()=>e.close().catch(()=>{}),5e3)}catch{}}},1e3);return()=>clearInterval(e)},[]),(0,a.useEffect)(()=>{let e=setInterval(()=>{v(!0),setTimeout(()=>{b(e=>(e+1)%et.length),v(!1)},500)},3e4);return()=>clearInterval(e)},[]);let N=et[g%et.length],C=o<=30&&!d;async function S(){h(!0),n&&await er(n,e),h(!1),x(!0),setTimeout(()=>r(10),900)}return(0,p.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[99999] flex flex-col items-center justify-center bg-zinc-950/98 backdrop-blur-xl",style:{animation:"prayerFadeIn 0.45s ease-out"},children:[(0,t.jsx)("style",{children:`
3        @keyframes prayerFadeIn  { from { opacity:0; transform:scale(0.97); } to { opacity:1; transform:scale(1); } }
4        @keyframes prayerGlow    { 0%,100% { opacity:.25; transform:scale(1);    } 50% { opacity:.55; transform:scale(1.18); } }
5        @keyframes prayerPulse   { 0%,100% { transform:scale(1);    } 50% { transform:scale(1.06); } }
6        @keyframes prayerSuccess { 0% { opacity:0; transform:translateY(12px) scale(0.9); } 60% { opacity:1; transform:translateY(0) scale(1.04); } 100% { opacity:1; transform:scale(1); } }
7      `}),(0,t.jsx)("div",{className:"absolute top-5 right-5",children:(0,t.jsxs)("button",{onClick:i,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-zinc-800/80 hover:bg-surface-hover text-zinc-400 hover:text-zinc-200 text-xs font-medium transition-colors border border-zinc-700/50",children:[(0,t.jsx)(s.default,{name:"window.close",className:"w-3.5 h-3.5"})," Cancel"]})}),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-7 select-none max-w-md w-full px-8",children:[(0,t.jsxs)("div",{className:"relative flex items-center justify-center w-20 h-20",children:[(0,t.jsx)("div",{className:"absolute inset-0 rounded-full bg-emerald-500/25 blur-3xl",style:{animation:"prayerGlow 3.5s ease-in-out infinite"}}),(0,t.jsx)("span",{className:"relative text-5xl",style:{animation:d?void 0:"prayerPulse 4s ease-in-out infinite"},children:"☪"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-[11px] font-bold uppercase tracking-widest text-emerald-400/60 mb-1",children:"Time for"}),(0,t.jsx)("h1",{className:"text-[42px] font-bold text-content-primary leading-none",children:e})]}),k&&!f&&(0,t.jsx)(eo,{playbook:k}),f?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",style:{animation:"prayerSuccess 0.6s cubic-bezier(0.34,1.56,0.64,1)"},children:[(0,t.jsx)("div",{className:"w-16 h-16 rounded-full bg-emerald-500/20 border border-emerald-500/40 flex items-center justify-center",children:(0,t.jsx)(s.default,{name:"action.star",className:"w-8 h-8 text-emerald-400 fill-emerald-400"})}),(0,t.jsx)("p",{className:"text-emerald-300 text-lg font-semibold",children:"Prayer logged!"}),(0,t.jsxs)("p",{className:"text-zinc-500 text-sm",children:["+",10," points earned"]})]}):d?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4",style:{animation:"prayerSuccess 0.5s ease-out"},children:[(0,t.jsx)("p",{className:"text-emerald-300 text-base font-medium",children:"Prayer time complete"}),(0,t.jsxs)("button",{onClick:S,disabled:m,className:"group flex items-center gap-3 px-10 py-4 r-container bg-emerald-500 hover:bg-emerald-400 disabled:opacity-50 text-white text-xl font-bold shadow-2xl shadow-emerald-500/25 transition-all active:scale-95 border border-emerald-400/30",children:[(0,t.jsx)(s.default,{name:"action.star",className:"w-5 h-5 fill-white group-hover:scale-110 transition-transform"}),m?"Logging…":"Log Prayer"]}),(0,t.jsxs)("p",{className:"text-zinc-600 text-xs",children:["+",10," points • alhamdulillah"]})]}):(0,t.jsx)("div",{className:`font-mono font-bold tabular-nums leading-none transition-colors ${C?"text-emerald-400 text-[88px] animate-pulse":"text-content-primary text-[100px]"}`,children:(l=Math.floor(o/60),`${l}:${String(o%60).padStart(2,"0")}`)}),!d&&!f&&(0,t.jsx)("div",{className:"w-60 h-1.5 bg-zinc-800 rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full ${C?"bg-emerald-400":"bg-emerald-600"}`,style:{width:`${o/300*100}%`,transition:"width 1s linear"}})}),!f&&(0,t.jsxs)("div",{className:"text-center max-w-sm transition-opacity duration-500",style:{opacity:+!y},children:[N?.arabic&&(0,t.jsx)("p",{className:"text-lg text-emerald-200/75 mb-3 leading-relaxed",dir:"rtl",style:{fontFamily:"Georgia, 'Times New Roman', serif",fontStyle:"italic"},children:N.arabic}),(0,t.jsxs)("p",{className:"text-sm text-zinc-300 leading-relaxed mb-1.5",children:["“",N?.text,"”"]}),(0,t.jsx)("p",{className:"text-[11px] text-zinc-600 tracking-wide font-medium",children:N?.source})]})]})]}),document.body)}function ed({currentUserId:e}){let[n,s]=(0,a.useState)([]),[i,r]=(0,a.useState)(!0);if((0,a.useEffect)(()=>{el().then(e=>{s(e),r(!1)})},[]),i)return(0,t.jsx)("p",{className:"text-xs text-zinc-500 text-center py-6",children:"Loading…"});if(!n.length)return(0,t.jsxs)("div",{className:"py-6 px-4 text-center",children:[(0,t.jsx)("p",{className:"text-xs text-zinc-500",children:"No prayer data yet."}),(0,t.jsx)("p",{className:"text-[11px] text-zinc-600 mt-1",children:"Start a prayer break to appear here."})]});let l=["🥇","🥈","🥉"];return(0,t.jsx)("div",{className:"py-1",children:n.map((n,a)=>{let s=n.profile_id===e;return(0,t.jsxs)("div",{className:`flex items-center gap-3 px-4 py-2.5 ${s?"bg-emerald-500/8":"hover:bg-surface-hover/40"} transition-colors`,children:[(0,t.jsx)("span",{className:"w-5 text-center shrink-0 text-sm",children:l[a]??(0,t.jsx)("span",{className:"text-[11px] text-zinc-600",children:a+1})}),n.avatar_url?(0,t.jsx)("img",{src:n.avatar_url,alt:n.full_name,className:"w-7 h-7 rounded-full object-cover shrink-0"}):(0,t.jsx)("div",{className:"w-7 h-7 rounded-full bg-zinc-700 flex items-center justify-center text-[10px] font-bold text-zinc-300 shrink-0",children:n.full_name.split(" ").slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("")}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("p",{className:`text-xs font-semibold truncate ${s?"text-emerald-300":"text-zinc-200"}`,children:[(0,X.firstName)(n.full_name),s&&(0,t.jsx)("span",{className:"ml-1 text-[10px] text-emerald-500 font-normal",children:"you"})]}),(0,t.jsxs)("p",{className:"text-[10px] text-zinc-500",children:[n.prayerCount," prayers (30d)"]}
7)]}),(0,t.jsxs)("div",{className:"text-right shrink-0",children:[(0,t.jsx)("p",{className:"text-xs font-bold text-zinc-300",children:n.points}),(0,t.jsx)("p",{className:"text-[10px] text-zinc-600",children:"pts"})]})]},n.profile_id)})})}function eu({userId:e}){let[n,i]=(0,a.useState)(!1),[r,l]=(0,a.useState)(null),[o,c]=(0,a.useState)(null),[d,u]=(0,a.useState)([]),[m,h]=(0,a.useState)(null),[p,f]=(0,a.useState)(""),[x,g]=(0,a.useState)({}),[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)("tracker"),[k,N]=(0,a.useState)(null),[C,S]=(0,a.useState)(null),[_,E]=(0,a.useState)(!1),[z,T]=(0,a.useState)(e),$=(0,a.useRef)(null);(0,a.useEffect)(()=>{E(!0)},[]),(0,a.useEffect)(()=>{g(function(){try{return JSON.parse(localStorage.getItem(en)??"{}")}catch{return{}}}())},[]),(0,a.useEffect)(()=>{let t=(0,w.createClient)(),n=async e=>{T(e);let{data:n}=await t.from("profiles").select("notification_prefs, city").eq("id",e).single();(n?.notification_prefs??{}).prayer_reminders_enabled&&(i(!0),l(n?.city??null))};e?n(e):t.auth.getUser().then(({data:{user:e}})=>{e&&n(e.id)})},[e]),(0,a.useEffect)(()=>{if(!n||!r)return;let e=!1;return ei(r).then(t=>{!e&&t&&c(t)}),()=>{e=!0}},[n,r]);let L=(0,a.useCallback)(()=>{o&&u(function(e,t,n,a){var s,i,r,l;let o,c,d,u,m,h,p,f,{eqt:x,dec:g,cosDec:b}=(c=V(357.529+.98560028*(l=(s=n.getFullYear(),i=n.getMonth()+1,r=n.getDate(),i<=2&&(s--,i+=12),o=Math.floor(s/100),Math.floor(365.25*(s+4716))+Math.floor(30.6001*(i+1))+r+(2-o+Math.floor(o/4))-1524.5-2451545))),d=V(280.459+.98564736*l),u=V(d+1.9151835*Math.sin(J(c))+.02*Math.sin(J(2*c))),p=Math.sqrt(1-(h=Math.sin(J(m=23.439-36e-8*l))*Math.sin(J(u)))*h),{eqt:d/15-Z(Y(Math.atan2(Math.cos(J(m))*Math.sin(J(u)),Math.cos(J(u))))/15),dec:Y(Math.asin(h)),cosDec:p}),w=12+a-t/15-x;function y(e){let t=Math.round(60*Z(w+e)),a=new Date(n);return a.setHours(0,t,0,0),a}let v=Q(e,g,b,15,!0),j=Q(e,g,b,.833,!0),k=(f=Y(Math.atan(1/(1+Math.tan(J(Math.abs(e-g)))))),Q(e,g,b,-f,!1)),N=Q(e,g,b,.833,!1),C=Q(e,g,b,15,!1);return[{name:"Fajr",time:y(v)},{name:"Sunrise",time:y(j)},{name:"Dhuhr",time:y(0)},{name:"Asr",time:y(k)},{name:"Maghrib",time:y(N)},{name:"Isha",time:y(C)}].map(e=>{var t;return{name:e.name,time:e.time,minutesSinceMidnight:60*(t=e.time).getHours()+t.getMinutes()}})}(o.lat,o.lng,new Date,o.utcOffset))},[o]);function D(e,t){let n={...x,[es(e)]:t};g(n);try{localStorage.setItem(en,JSON.stringify(n))}catch{}}if((0,a.useEffect)(()=>{L();let e=new Date,t=setTimeout(L,new Date(e.getFullYear(),e.getMonth(),e.getDate()+1).getTime()-e.getTime());return()=>clearTimeout(t)},[L]),(0,a.useEffect)(()=>{if(!d.length)return;let e=()=>{let e=Date.now(),t=d.filter(t=>"Sunrise"!==t.name&&t.time.getTime()>e)[0]??null;h(t),t&&f(function(e){if(e<=0)return"Now";let t=Math.ceil(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60),a=t%60;return a>0?`${n}h ${a}m`:`${n}h`}(t.time.getTime()-e))};e();let t=setInterval(e,3e4);return()=>clearInterval(t)},[d]),(0,a.useEffect)(()=>{if(b)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){$.current&&!$.current.contains(e.target)&&y(!1)}},[b]),!n||!m||!_)return null;let I=m.time.getTime()-Date.now()<=9e5,A=function(e,t=30){let n=0,a=0,s=new Date;for(let i=0;i<t;i++){let t=new Date(s);t.setDate(s.getDate()-i);let r=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;for(let t of ee){let s=e[`${r}/${t}`];"prayed"===s?(n++,a++):"missed"===s&&a++}}return{prayed:n,total:a}}(x),P=A.total>0?Math.round(A.prayed/A.total*100):0,U=d.filter(e=>ee.includes(e.name)&&e.time.getTime()<=Date.now()).at(-1)??null;return(0,t.jsxs)(t.Fragment,{children:[k&&(0,t.jsx)(ec,{prayerName:k,userId:z,onCancel:()=>N(null),onLogged:function(e){k&&(D(k,"prayed"),S({name:k,points:e}),N(null),setTimeout(()=>S(null),4500))}}),C&&(0,t.jsxs)("div",{className:"fixed bottom-8 left-1/2 -translate-x-1/2 z-[99998] flex items-center gap-2.5 px-5 py-3 r-container bg-emerald-950/90 border border-emerald-500/40 shadow-2xl backdrop-blur-xl",style:{animation:"prayerSuccess 0.5s cubic-bezier(0.34,1.56,0.64,1)"},children:[(0,t.jsx)(s.default,{name:"action.star",className:"w-4 h-4 text-emerald-300 fill-emerald-300 shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-semibold text-emerald-200",children:[C.name," logged — +",C.points," points!"]})]}),(0,t.jsxs)("div",{className:`relative inline-flex items-stretch shrink-0 h-8 sm:h-7 rounded-lg border transition-colors ${I?"border-emerald-500/35 bg-surface-card animate-pulse":"border-line-base bg-surface-card hover:border-line-strong hover:bg-surface-hover"}`,ref:$,children:[(0,t.jsxs)("button",{onClick:()=>N(U?.name??m.name),title:`${m.name} in ${p} \xb7 click to start prayer`,className:"flex items-center gap-1.5 pl-2.5 pr-1.5 text-xs font-medium cursor-pointer",children:[(0,t.jsx)("span",{className:(0,M.statusChipAccent)(I?"emerald":"neutral"),children:"☪"}),(0,t.jsx)("span",{className:`inline ${I?"text-content-primary":"text-content-secondary"}`,children:m.name}),(0,t.jsx)("span",{className:`tabular-nums font-mono ${(0,M.statusChipAccent)(I?"emerald":"neutral")} ${I?"font-semibold":""}`,children:p})]}),(0,t.jsx)("button",{onClick:()=>y(e=>!e),title:"Prayer tracker & leaderboard",className:`flex items-center justify-center w-5 pr-0.5 border-l ${I?"border-emerald-500/30 text-emerald-400":"border-line-base text-content-muted hover:text-content-secondary"}`,children:(0,t.jsx)(s.default,{name:"view.list",className:"w-3.5 h-3.5"})}),b&&(0,t.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-80 r-container border border-zinc-700 bg-zinc-900 shadow-2xl z-[300] overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm",children:"☪"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-content-primary",children:"Prayer Tracker"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[A.total>0&&(0,t.jsxs)("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${P>=80?"bg-emerald-500/15 text-emerald-400":P>=50?"bg-yellow-500/15 text-yellow-400":"bg-zinc-800 text-zinc-400"}`,children:[P,"% (30d)"]}
7),(0,t.jsx)("button",{onClick:()=>y(!1),className:"text-zinc-600 hover:text-zinc-400 transition-colors",children:(0,t.jsx)(s.default,{name:"window.close",className:"w-3.5 h-3.5"})})]})]}),(0,t.jsx)("div",{className:"flex border-b border-zinc-800",children:["tracker","leaderboard"].map(e=>(0,t.jsxs)("button",{onClick:()=>j(e),className:`flex-1 py-2.5 text-xs font-semibold transition-colors flex items-center justify-center gap-1.5 ${v===e?"text-emerald-400 border-b-2 border-emerald-500 -mb-px":"text-zinc-500 hover:text-zinc-300"}`,children:["leaderboard"===e&&(0,t.jsx)(s.default,{name:"calendar.win",className:"w-3.5 h-3.5"}),"tracker"===e?"My Prayers":"Leaderboard"]},e))}),"tracker"===v?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"py-1",children:d.map(e=>{if("Sunrise"===e.name)return null;let n=x[es(e.name)]??"pending",a=e.time.getTime()<Date.now(),i=e.name===m?.name,r=e.time.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return(0,t.jsxs)("div",{className:`flex items-center gap-3 px-4 py-2.5 ${i?"bg-white/5":""}`,children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:`text-sm font-medium ${i?"text-content-primary":a?"text-zinc-300":"text-zinc-400"}`,children:e.name}),i&&(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-emerald-500/20 text-emerald-400 font-medium",children:"Next"})]}),(0,t.jsx)("span",{className:"text-xs text-zinc-500",children:r})]}),i&&(0,t.jsxs)("button",{onClick:()=>{y(!1),N(e.name)},className:"flex items-center gap-1 px-2 py-1 rounded-lg text-[11px] font-semibold bg-emerald-500/20 text-emerald-400 border border-emerald-500/30 hover:bg-emerald-500/30 transition-colors",children:["Start ",(0,t.jsx)(s.default,{name:"ui.chevron-right",className:"w-3.5 h-3.5"})]}),a&&!i&&(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("button",{onClick:()=>D(e.name,"prayed"===n?"pending":"prayed"),className:`px-2 py-1 rounded-lg text-[11px] font-semibold transition-colors ${"prayed"===n?"bg-emerald-500/20 text-emerald-400 border border-emerald-500/30":"bg-zinc-800 text-zinc-500 hover:text-emerald-400 hover:bg-emerald-500/10"}`,children:"Prayed"}),(0,t.jsx)("button",{onClick:()=>D(e.name,"missed"===n?"pending":"missed"),className:`px-2 py-1 rounded-lg text-[11px] font-semibold transition-colors ${"missed"===n?"bg-red-500/20 text-red-400 border border-red-500/30":"bg-zinc-800 text-zinc-500 hover:text-red-400 hover:bg-red-500/10"}`,children:"Missed"})]}),!a&&!i&&(0,t.jsx)("span",{className:"text-xs text-zinc-600",children:"Upcoming"})]},e.name)})}),A.total>0&&(0,t.jsxs)("div",{className:"px-4 py-3 border-t border-zinc-800",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,t.jsx)("span",{className:"text-xs text-zinc-400",children:"30-day prayer score"}),(0,t.jsxs)("span",{className:"text-xs font-bold text-content-primary",children:[A.prayed,"/",A.total]})]}),(0,t.jsx)("div",{className:"h-1.5 bg-zinc-800 rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"h-full rounded-full transition-all",style:{width:`${P}%`,backgroundColor:P>=80?"#22c55e":P>=50?"#FFDD4A":"#D62828"}})})]})]}):(0,t.jsx)(ed,{currentUserId:z})]})]})]})}var em=e.i(103043),eh=e.i(974767),ep=e.i(194018),ef=e.i(407604),ex=e.i(313824),eg=e.i(225784),eb=e.i(329198),ew=e.i(290425),ey=e.i(644651);function ev({people:e}){let[,n]=(0,a.useState)(0);return(0,a.useEffect)(()=>{let e=setInterval(()=>n(e=>e+1),1e3);return()=>clearInterval(e)},[]),(0,t.jsx)("div",{className:"py-1",children:e.map(e=>(0,t.jsxs)("a",{href:`/builders/${e.id}`,className:"flex items-center gap-2.5 px-3 py-2 hover:bg-surface-input transition-colors",children:[(0,t.jsxs)("div",{className:"relative shrink-0",children:[e.avatar_url?(0,t.jsx)("img",{src:e.avatar_url,alt:e.full_name,className:"w-7 h-7 rounded-full object-cover"}):(0,t.jsx)("div",{className:"w-7 h-7 rounded-full bg-surface-hover flex items-center justify-center if-t-micro font-bold text-content-secondary",children:e.full_name.split(" ").slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("")}),(0,t.jsx)("span",{className:`absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full border-2 border-line-subtle ${e.is_active?"bg-green-400":"bg-surface-hover"}`})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"if-t-meta font-medium text-content-primary truncate",children:(0,X.firstName)(e.full_name)}),e.city&&(0,t.jsx)("p",{className:"if-t-caption text-content-muted truncate",children:e.city})]}),(0,t.jsx)("div",{className:"text-right shrink-0",children:(0,t.jsx)("p",{className:"if-t-meta font-semibold text-content-primary tabular-nums",children:function(e){try{return new Date().toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0,timeZone:e||void 0})}catch{return new Date().toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})}}(e.timezone)})})]},e.id))})}function ej({me:e}){let[n,i]=(0,a.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>i(!0),className:(0,M.statusChip)("neutral"),title:"Book time with Basim from his real calendar",children:[(0,t.jsx)(s.default,{name:"view.calendar",size:"1em",className:"w-3.5 h-3.5 text-zinc-400"}),(0,t.jsx)("span",{className:"text-zinc-300",children:"Book Basim"})]}),n&&(0,t.jsx)(l,{me:e,onClose:()=>i(!1)})]})}ex.OWNER_PRIMARY_ID,e.s(["default",0,function({profile:n,realProfile:i,starredPeople:r=[],simLabel:l,brandName:d="Insert Fuel",brandLogoUrl:y,brandKey:v="insertfuel",simpleMenu:N=!1}){let J,Y,V,Z,Q,X,ee,et,{t:en,lang:ea,setLang:es}=(0,B.useLanguage)(),ei=(0,A.useBars)(),er=ei.status,el=ei.reminder,eo=(0,A.useLayout)().websiteMenu;(0,A.useChromeOrder)(),(0,A.useChrome)();let[ec,ed]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=()=>{try{ed("true"===localStorage.getItem("if:sidebar-collapsed"))}catch{}};e();let t=t=>{let n=t.detail?.collapsed;"boolean"==typeof n?ed(n):e()};return window.addEventListener("if:sidebar-toggle",t),window.addEventListener("storage",e),()=>{window.removeEventListener("if:sidebar-toggle",t),window.removeEventListener("storage",e)}},[]);let{liveGroupCalls:ek,activeCall:eN,isPip:eC,setIsPip:eS}=(0,f.useCallContext)(),[e_,eE]=(0,a.useState)([]);(0,a.useEffect)(()=>{let e=eN?.roomName;if(!e)return void eE([]);let t=!1,n=async()=>
7{if(!document.hidden)try{let n=await (0,h.fetchRoster)(e);t||eE(n.people)}catch{}};n();let a=setInterval(n,8e3);return()=>{t=!0,clearInterval(a)}},[eN?.roomName]);let{supported:ez,subscribed:eT,requesting:e$,subscribe:eL}=(0,ew.usePushNotifications)(),[eD,eI]=(0,a.useState)(n.notification_prefs?.push!==!1),eM=(0,c.useRouter)(),eA=(0,c.usePathname)(),eP=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=eP.current;if(!e||!eA.startsWith(e.path))return;eP.current=null;let t=requestAnimationFrame(()=>window.dispatchEvent(new CustomEvent(e.event)));return()=>cancelAnimationFrame(t)},[eA]);let[eU,eF]=(0,a.useState)(!1),[eO,eR]=(0,a.useState)(!1),[eW,eB]=(0,a.useState)(!1),[eq,eH]=(0,a.useState)(!1),[eG,eK]=(0,a.useState)(!1),[eJ,eY]=(0,a.useState)(""),[eV,eZ]=(0,a.useState)(!1),eQ=(0,g.useIsMobile)(),[eX,e0]=(0,a.useState)(!1),[e1,e5]=(0,a.useState)(!1),[e2,e4]=(0,a.useState)([]);(0,a.useEffect)(()=>{if(!el)return;let e=(0,w.createClient)(),t=!0;async function n(){let{data:n}=await e.from("community_live_sessions").select("id,room_name,community_id,host_id,started_at,communities:community_id(name),host:profiles!host_id(full_name)").is("ended_at",null).gte("started_at",new Date(Date.now()-216e5).toISOString());t&&n&&e4(n.map(e=>({id:e.id,communityId:e.community_id,communityName:e.communities?.name??"Community",hostName:e.host?.full_name??"Someone",roomName:e.room_name})))}n();let a=e.channel((0,W.pgTopic)("portal-live-sessions")).on("postgres_changes",{event:"*",schema:"public",table:"community_live_sessions"},()=>{n()}).subscribe();return()=>{t=!1,e.removeChannel(a)}},[el]);let[e3,e6]=(0,a.useState)(!1),[e8,e7]=(0,a.useState)(!1);(0,a.useEffect)(()=>{function e(e){e7(e.detail.hidden)}return window.addEventListener("if:countdown-rail-hide",e),()=>window.removeEventListener("if:countdown-rail-hide",e)},[]);let[e9,te]=(0,a.useState)(!1),[tt,tn]=(0,a.useState)(!1),[ta,ts]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=()=>{try{ts((0,K.loadWorkBreak)())}catch{ts(null)}};return e(),window.addEventListener("if:work-break-changed",e),()=>window.removeEventListener("if:work-break-changed",e)},[tt]);let[ti,tr]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(!ti)return;let e=e=>{let t=e.target;t?.closest(".if-website-nav")||tr(!1)},t=e=>{"Escape"===e.key&&tr(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[ti]);let[tl,to]=(0,a.useState)(null),[tc,td]=(0,a.useState)(null),tu=(0,a.useRef)(Math.random().toString(36).slice(2)),[tm,th]=(0,a.useState)(!1);(0,a.useEffect)(()=>{th((0,ey.soundEnabled)())},[]);let[tp,tf]=(0,a.useState)(!1),[tx,tg]=(0,a.useState)(!1),[tb,tw]=(0,a.useState)(!1);(0,a.useEffect)(()=>{function e(){try{tw(!!localStorage.getItem("if-task-timer"))}catch{tw(!1)}}return e(),window.addEventListener("if-task-timer-update",e),()=>window.removeEventListener("if-task-timer-update",e)},[]);let ty=(0,a.useRef)(null),tv="/spaces/d5a1046c-87d7-4ffb-bb6a-d505bb78b127/posts",[tj,tk]=(0,a.useState)(()=>{try{return Number(localStorage.getItem("if:zoom")??"1")||1}catch{return 1}});(0,a.useEffect)(()=>{let e=document.body;e.style.zoom=String(tj),e.style.width=tj>1?`${100/tj}%`:"";try{localStorage.setItem("if:zoom",String(tj))}catch{}},[tj]),(0,a.useEffect)(()=>{let t=!1,n=null;async function a(){try{let n=await e.A(214159),a=await n.matchMyProfileToGHL();if(t)return;"linked_existing"!==a.outcome&&"created_new"!==a.outcome&&"refreshed"!==a.outcome&&console.warn("[ghl-auto-match]",a)}catch(e){t||console.warn("[ghl-auto-match] failed:",e)}}try{let e=sessionStorage.getItem("if:ghl-match-last"),t=e?parseInt(e,10):0;(!t||Date.now()-t>216e5)&&(sessionStorage.setItem("if:ghl-match-last",String(Date.now())),setTimeout(()=>{a()},4e3)),n=setInterval(()=>{sessionStorage.setItem("if:ghl-match-last",String(Date.now())),a()},216e5)}catch{}return()=>{t=!0,n&&clearInterval(n)}},[]);let tN=n.country??null,tC=n.origin_country??null;[{code:"en",label:"English",short:"EN"},{code:"es-co",label:"Español",short:"ES"},{code:"ar-sy",label:"العربية",short:"AR"},{code:"uk-ua",label:"Українська",short:"UK"},{code:"tl",label:"Filipino",short:"TL"},{code:"ur",label:"اردو",short:"UR"}].map(e=>({...e,flag:(0,eg.resolveLanguageFlag)(e.code,tN,tC),cc:(0,eg.resolveLanguageCountryCode)(e.code,tN,tC)}));let[tS,t_]=(0,a.useState)(!0),[tE,tz]=(0,a.useState)("online"),tT=(0,a.useRef)(null),t$=(0,ef.useOnline)(),tL=(0,a.useRef)(!0);function tD(){document.cookie="if_sim_role=; path=/; max-age=0",document.cookie="if_sim_user=; path=/; max-age=0",document.cookie="if_sim_setter=; path=/; max-age=0",window.location.reload()}(0,a.useEffect)(()=>(t_(t$),window.dispatchEvent(new CustomEvent("if:net-status",{detail:{online:t$}})),t$?tL.current?tz("online"):(tz("reconnected"),tT.current=setTimeout(()=>tz("online"),3500)):(tT.current&&clearTimeout(tT.current),tz("offline")),tL.current=t$,()=>{tT.current&&clearTimeout(tT.current)}),[t$]),(0,a.useEffect)(()=>
7{if(tS)return;let e=setInterval(()=>{fetch("/favicon.ico",{cache:"no-store",signal:AbortSignal.timeout(4e3)}).then(()=>{t_(!0),tz("reconnected"),tT.current=setTimeout(()=>tz("online"),3500),window.dispatchEvent(new CustomEvent("if:net-status",{detail:{online:!0}}))}).catch(()=>{})},5e3);return()=>clearInterval(e)},[tS]),(0,a.useEffect)(()=>{try{"true"===localStorage.getItem("if:sidebar-collapsed")&&eK(!0)}catch{}},[]),(0,a.useEffect)(()=>{let e=document.getElementById("portal-sidebar");e&&(eG?(e.style.width="68px",e.style.minWidth="68px"):(e.style.width="",e.style.minWidth=""))},[eG]),(0,a.useEffect)(()=>{eZ(!0)},[]),(0,a.useEffect)(()=>{function e(e){let t=(0,_.isTypingTarget)(e);if(!t&&"?"===e.key){e.preventDefault(),eF(!0);return}if("Escape"===e.key){e0(!1),eF(!1),te(!1),eR(!1),eB(!1),e6(!1),tg(!1),window.dispatchEvent(new CustomEvent("if:escape"));return}if((e.metaKey||e.ctrlKey)&&e.shiftKey&&!e.altKey&&"k"===e.key.toLowerCase()){e.preventDefault(),eB(!0);return}if((e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey)switch(e.key.toLowerCase()){case"k":e.preventDefault(),eY(""),eR(!0);return;case"/":{e.preventDefault();let t={handled:!1};window.dispatchEvent(new CustomEvent(D.BAR_SEARCH_EVENT,{detail:t})),t.handled||(eY(""),eR(!0));return}case"n":if(!t){if(e.preventDefault(),eA.startsWith("/notes"))return void eM.push("/notes?new=true");if(eA.startsWith("/tasks"))return void window.dispatchEvent(new CustomEvent("if:new-task"));if(eA.startsWith("/portal/events"))return void eM.push("/portal/events?new=true");if(eA.startsWith("/chat"))return void window.dispatchEvent(new CustomEvent("if:new-chat"));if(eA.startsWith("/brands"))return void window.dispatchEvent(new CustomEvent("if:new-brand"));if(eA.startsWith("/builders"))return void window.dispatchEvent(new CustomEvent("if:new-person"));if(eA.startsWith("/portal/community"))return void window.dispatchEvent(new CustomEvent("if:new-community-post"));if(eA.startsWith("/playbooks"))return void window.dispatchEvent(new CustomEvent("if:new-playbook"));if(eA.startsWith("/meetings")||eA.startsWith("/recordings"))return void window.dispatchEvent(new CustomEvent("if:new-recording"));if(eA.startsWith("/goals"))return void window.dispatchEvent(new CustomEvent("if:new-goal"));if(eA.startsWith("/portal/plans"))return void window.dispatchEvent(new CustomEvent("if:new-plan"));if(eA.startsWith("/leads"))return void window.dispatchEvent(new CustomEvent("if:new-lead"));if(eA.startsWith("/prompts"))return void window.dispatchEvent(new CustomEvent("if:new-prompt"));window.dispatchEvent(new CustomEvent("if:open-new-menu"));return}}if(!t&&"/"===e.key){e.preventDefault(),(0,I.findOnPage)(()=>{let e={handled:!1};window.dispatchEvent(new CustomEvent(D.BAR_SEARCH_EVENT,{detail:e})),e.handled||(eY(""),eR(!0))});return}if(!t&&("@"===e.key||"#"===e.key||"$"===e.key||"!"===e.key)){e.preventDefault(),eY(e.key),eR(!0);return}if(!t&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey){let t={N:{event:"if:new-note"},T:{run:()=>eB(!0)},C:{path:"/chat",event:"if:new-chat"},E:{path:"/portal/events",event:"if:new-event"},P:{path:tv,event:"if:new-community-post"},D:{run:()=>window.dispatchEvent(new CustomEvent("if:new-drawing"))},M:{run:()=>eM.push(`/meeting/meeting-${Math.random().toString(36).slice(2,8)}`)},B:{run:()=>eM.push("/brands/new")},G:{path:"/goals",event:"if:new-goal"},H:{run:()=>eM.push("/happy?new=1")},L:{run:()=>eM.push("/projects?new=1")}}[e.key];if(t)return(e.preventDefault(),t.run)?void t.run():void(t.event&&(!t.path||eA.startsWith(t.path)?window.dispatchEvent(new CustomEvent(t.event)):(eP.current={path:t.path,event:t.event},eM.push(t.path))))}if(!t&&!e.metaKey&&!e.ctrlKey&&!e.altKey)switch(e.key){case"b":e.preventDefault(),eM.push("/grid");return;case"p":e.preventDefault(),eM.push("/prompts");return;case"t":e.preventDefault(),eM.push("/tasks");return;case"n":e.preventDefault(),eM.push("/notes");return;case"a":e.preventDefault(),eM.push("/assets");return;case"c":e.preventDefault(),eM.push("/chat");return;case"f":e.preventDefault(),eM.push(tv);return;case"e":e.preventDefault(),eM.push("/portal/events");return;case"r":e.preventDefault(),eM.push("/replays");return;case"s":e.preventDefault(),window.dispatchEvent(new CustomEvent("if:star-focused"));return;case"d":e.preventDefault(),eM.push("/dreams");return;case"j":e.preventDefault(),eM.push("/journey");return;case"h":e.preventDefault(),eM.push("/dashboard");return}}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[eM,eA]),(0,a.useEffect)(()=>{function e(){eY(""),eR(!0)}return window.addEventListener("if:open-search",e),()=>window.removeEventListener("if:open-search",e)},[]),(0,a.useEffect)(()=>{function e(e){ty.current&&!ty.current.contains(e.target)&&e6(!1)}return e3&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[e3]);let tI=["superadmin","admin","staff"].includes(n.role);(i??n).role,(0,a.useEffect)(()=>
7{if(!eV)return;let e=!1,t=()=>{if(e)return!0;let t=document.getElementById("if-bottom-me"),n=document.getElementById("if-main-row-slot"),a=n&&(!n.dataset.claimedBy||n.dataset.claimedBy===tu.current)?(n.dataset.claimedBy=tu.current,n):null;return to(e=>e===t?e:t),td(e=>e===a?e:a),!!t&&!!a};if(t())return;let n=new MutationObserver(()=>{t()&&(e=!0,n.disconnect())});return n.observe(document.body,{childList:!0,subtree:!0}),()=>{e=!0,n.disconnect()}},[eV]),t.Fragment;let tM=(J=(eA??"/").split("/").filter(Boolean)[0]??"",(Y={"":"Home",dashboard:"Home",chat:"Chat",tasks:"Tasks",playbooks:"Playbooks",contentfuel:"Content","content-fuel":"Content",admin:"Admin",crm:"CRM",communities:"Community"})[J]?Y[J]:J.replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase())),tA=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(R.default,{href:(0,eh.walkthroughHref)(eA),className:`hidden w-full md:flex transition-colors rounded ${ec?"flex-col items-center gap-1 px-0.5 py-1.5":"items-center gap-2 rounded-lg px-2 py-1.5 text-xs font-medium"} ${e1?"text-brand-ink bg-brand-soft":"text-content-muted hover:text-content-primary hover:bg-surface-hover"}`,title:`Show me around ${tM}`,children:[(0,t.jsx)(s.default,{name:"ai.fuela",size:ec?18:14,className:"shrink-0"}),ec?(0,t.jsx)("span",{className:"w-full truncate text-center leading-none tracking-tight if-t-label",children:"Tour"}):(0,t.jsx)("span",{className:"truncate",children:"Show me around"})]}),!1]}),tP=(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:`if-top-bar-main-row h-[52px] md:h-10 flex items-center px-3 lg:px-4 gap-1 relative${el?"":" md:hidden"}`,children:[eU&&eV&&(0,p.createPortal)((0,t.jsx)(E.default,{onClose:()=>eF(!1)}),document.body),e1&&eV&&(0,p.createPortal)((0,t.jsx)(F.default,{open:e1,onClose:()=>e5(!1)}),document.body),(0,t.jsxs)("div",{className:"if-top-bar-left flex shrink-0 items-center gap-2",children:[(0,t.jsx)("button",{onClick:function(){let e=document.getElementById("portal-sidebar");if(e){if(window.innerWidth<768)return void window.dispatchEvent(new CustomEvent("if:sidebar-toggle",{detail:{collapsed:!1}}));eK(t=>{let n=!t;n?(e.style.width="56px",e.style.minWidth="56px"):(e.style.width="",e.style.minWidth="");try{localStorage.setItem("if:sidebar-collapsed",String(n))}catch{}return window.dispatchEvent(new CustomEvent("if:sidebar-toggle",{detail:{collapsed:n}})),n})}},className:`if-chrome-sidebar-toggle hidden items-center justify-center w-8 h-8 rounded-lg transition-colors ${eG?"text-content-primary bg-surface-input":"text-content-secondary hover:text-content-primary hover:bg-surface-input"}`,title:en("menu"),children:(0,t.jsx)(s.default,{name:"ui.sidebar",size:16})}),(0,t.jsx)("div",{className:"hidden",children:(0,t.jsx)(u,{})}),el&&(0,t.jsx)("div",{className:"hidden md:block",children:(0,t.jsx)(K.TodayStatsWidget,{})})]}),(0,t.jsx)("div",{className:"flex-1 md:hidden","aria-hidden":"true"}),el&&(0,t.jsxs)("div",{className:"if-top-bar-rail if-media-row hidden md:flex flex-1 items-center justify-start gap-1.5 overflow-x-auto overflow-y-hidden min-w-0 py-1.5",children:[eN&&(0,t.jsxs)("button",{onClick:()=>eS(!1),className:(0,M.statusChip)("emerald","cursor-pointer",{attention:!0}),children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse shrink-0"}),eN.channelIcon?(0,t.jsx)("img",{src:eN.channelIcon,alt:"",className:"h-4 w-4 shrink-0 rounded-full object-cover"}):(0,t.jsx)(s.default,{name:eN.videoEnabled?"comm.video":"comm.phone",size:12,className:"text-emerald-400 shrink-0"}),(0,t.jsx)("span",{className:"font-medium truncate max-w-[140px] text-content-primary",children:eN.channelName}),!!e_.length&&(0,t.jsx)("span",{className:"flex -space-x-1.5 shrink-0",children:e_.slice(0,3).map(e=>e.avatar?(0,t.jsx)("img",{src:e.avatar,alt:e.name,title:e.name,className:"h-4 w-4 rounded-full border border-emerald-500/50 object-cover"},e.id):(0,t.jsx)("span",{title:e.name,className:"flex h-4 w-4 items-center justify-center rounded-full border border-emerald-500/50 bg-emerald-500/25 text-[7px] font-bold text-emerald-200",children:(e.name??"?").slice(0,1).toUpperCase()},e.id))}),(0,t.jsx)("span",{className:"if-t-micro font-semibold text-emerald-300 bg-emerald-500/15 px-1.5 h-5 inline-flex items-center rounded-md shrink-0",children:"In call"})]}),ek.length>0&&!eN&&(V=ek[0],(0,t.jsxs)("button",{onClick:()=>eM.push(`/chat?join=${V.channelId}&room=${encodeURIComponent(V.roomName??"")}&type=${V.callType}`),className:(0,M.statusChip)("emerald","cursor-pointer",{attention:!0}
7),children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse shrink-0"}),(0,t.jsx)(s.default,{name:"comm.phone",size:12,className:"text-emerald-400 shrink-0"}),(0,t.jsx)("span",{className:"font-medium truncate max-w-[140px] text-content-primary",children:V.channelName}),(0,t.jsx)("span",{className:"if-t-micro font-semibold text-emerald-300 bg-emerald-500/15 px-1.5 h-5 inline-flex items-center rounded-md shrink-0",children:en("header_join")||"Join"})]})),e2.length>0&&!eN&&(Z=e2[0],(0,t.jsxs)("button",{onClick:()=>eM.push(`/portal/communities/${Z.communityId}/posts`),className:(0,M.statusChip)("red","cursor-pointer"),children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400 animate-pulse shrink-0"}),(0,t.jsx)(s.default,{name:"comm.video",size:12,className:"text-red-400 shrink-0"}),(0,t.jsx)("span",{className:"font-medium truncate max-w-[140px] text-content-primary",children:Z.communityName}),(0,t.jsx)("span",{className:"text-[10px] font-semibold text-red-300 bg-red-500/15 px-1.5 h-5 inline-flex items-center rounded-md shrink-0",children:"Live"})]})),(0,t.jsx)(H.default,{}),tI&&(0,t.jsx)(q,{}),(0,t.jsx)(O.default,{profile:n,isStaff:tI}),tI&&!(0,ex.isOwner)({id:n.id,email:n.email})&&(0,t.jsx)(ej,{me:{full_name:n.full_name??"",email:n.email??null,phone:n.phone??null}}),!1,(0,t.jsx)(eu,{userId:n.id}),r.length>0&&(0,t.jsxs)("div",{ref:ty,className:"relative shrink-0",children:[(0,t.jsx)("button",{onClick:()=>e6(e=>!e),className:"flex items-center justify-center w-6 h-6 rounded-md text-content-muted hover:text-content-primary hover:bg-surface-hover transition-colors",title:en("world_clock"),children:(0,t.jsx)(s.default,{name:"ui.globe",size:14})}),e3&&(0,t.jsxs)("div",{className:"absolute left-1/2 -translate-x-1/2 top-8 w-64 bg-surface-card border border-line-strong rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,t.jsx)("div",{className:"px-3 py-2 border-b border-line-base",children:(0,t.jsx)("p",{className:"if-t-micro font-bold uppercase tracking-widest text-content-muted",children:en("world_clock")})}),(0,t.jsx)(ev,{people:r})]})]})]}),(0,t.jsxs)("div",{className:"if-top-bar-right flex items-center gap-1.5 shrink-0 whitespace-nowrap",children:[(0,t.jsx)("button",{onClick:()=>{eY(""),eR(!0)},className:"md:hidden flex items-center justify-center w-8 h-8 rounded-lg text-content-muted hover:text-content-primary hover:bg-surface-hover transition-colors",title:en("search_title"),children:(0,t.jsx)(s.default,{name:"nav.search",size:15})}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(S.ThemeToggle,{})}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(k.default,{})}),eQ&&(0,t.jsx)(x.default,{userId:n.id}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(T.default,{profile:n,realProfile:i,simLabel:l,simpleMenu:N,onExitSim:tD,onOpenSleep:()=>tf(!0)})}),eV&&tl?(0,p.createPortal)((0,t.jsx)(t.Fragment,{children:tA}),tl):tA]})]})});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("header",{className:"if-top-bar if-glass-on layer-bar border-b border-line-base/70 fixed md:relative top-0 w-full md:w-auto z-40 pt-safe md:pt-0",children:[(0,t.jsx)(C,{label:l,onExit:tD}),er&&(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2.5 border-b border-line-base/70 px-3 py-1",children:[(0,t.jsx)(P.PerfChips,{isStaff:tI}),(0,t.jsx)(P.BatteryWidget,{}),(0,t.jsx)(P.HeaderStatusWidget,{})]}),(0,t.jsx)("div",{className:`overflow-hidden transition-all duration-500 ease-in-out ${"offline"===tE||"reconnected"===tE?"max-h-6 opacity-100":"max-h-0 opacity-0"}`,children:(0,t.jsxs)("div",{className:`flex items-center justify-center gap-1.5 py-0.5 if-t-meta font-medium ${"offline"===tE?"bg-amber-100 text-amber-800 border-b border-amber-800/30 dark:bg-amber-950/50 dark:text-amber-400":"bg-emerald-100 text-emerald-800 border-b border-emerald-800/30 dark:bg-emerald-950/50 dark:text-emerald-400"}`,children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${"offline"===tE?"bg-amber-400 animate-pulse":"bg-emerald-400"}`}),"offline"===tE?"You're offline. Notes is available. Other features will be re-enabled when you reconnect.":"Back online. All features restored."]})}),"insertfuel"===v&&(Q=(e,t)=>{let n=`nav_marketing_${e}`,a=en(n);return a&&a!==n?a:t},(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{"data-menu-audience":(X=["superadmin","admin","staff","coach"].includes(String(n.role??"").toLowerCase()),ee=["hosted","partner","starter","regular","premium","premium_owner","premium_helper","builder","certified_builder","master_builder"].includes(String(n.badge_key??"")),X||ee?"customer":"prospect"),className:"if-top-bar-website-menu hidden md:flex items-center pl-3 pr-4 lg:pl-4 lg:pr-6 h-11 border-b border-line-base/40 ga
7p-3 lg:gap-6 xl:gap-7",children:[(0,t.jsxs)("div",{className:"if-topbar-nav flex shrink-0 items-center gap-0.5",children:[(0,t.jsx)("div",{className:"shrink-0 pl-[10px] md:pl-0",children:(0,t.jsx)(eb.default,{still:!0,src:y??void 0,alt:d,href:"/dashboard",size:36,lockup:"wide",maxHeight:40})}),(0,t.jsx)("div",{className:`if-website-nav-panel min-w-0 shrink ${eo?"hidden md:flex":"if-website-nav-panel--off"}`,children:(0,t.jsxs)("div",{className:"flex items-center gap-1 whitespace-nowrap",children:[(0,t.jsx)("div",{className:"if-website-nav flex items-center","data-open":ti?"true":"false",children:(0,t.jsxs)(R.default,{href:tI?"/":"https://letgoboss.com",prefetch:!1,title:tI?"Insert Fuel public website":"LET GO BOSS community site",onClick:()=>tr(!1),className:`group ${(0,o.navTop)()}`,children:[tI?Q("website","Website"):Q("community_site","Community site"),(0,t.jsx)(s.default,{name:"ui.globe-simple",size:14,"aria-hidden":!0,className:"shrink-0 opacity-0 transition-opacity duration-150 group-hover:opacity-70 group-focus-visible:opacity-70 motion-reduce:transition-none"})]})}),tI&&(0,t.jsx)(ep.default,{signedIn:!0,isStaff:!0})]})})]}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-3 shrink-0",children:[(0,t.jsx)("span",{className:"if-topbar-chip hidden",children:(0,t.jsxs)("button",{onClick:()=>{(0,m.setDebug)(!0),window.dispatchEvent(new CustomEvent("if:debug-open-tab",{detail:{tab:"report"}}))},title:"Report a bug",className:"flex h-8 items-center gap-1.5 rounded-lg border border-line-base px-2.5 text-xs font-medium text-content-secondary transition-colors hover:bg-surface-hover hover:text-content-primary",children:[(0,t.jsx)(s.default,{name:"ui.bug",size:14,weight:"regular",style:{color:"var(--if-debug-accent)"}}),(0,t.jsx)("span",{className:"hidden lg:inline",children:"Report a Bug"})]})}),(0,t.jsx)(L.UniversalSearchBar,{scope:"app",placement:"header",tools:!0}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,t.jsx)("div",{className:"hidden md:contents",children:(0,t.jsx)(S.ThemeToggle,{workspaceLayout:!0})}),(0,t.jsx)(j,{role:n.role}),(0,t.jsx)("div",{className:"contents",children:(0,t.jsx)(k.default,{})}),(0,t.jsx)("div",{className:"hidden md:contents",children:(0,t.jsx)($.default,{onOpen:()=>e0(e=>!e)})}),(0,t.jsx)("div",{className:"hidden md:contents",children:(0,t.jsx)(b.default,{userId:n.id})}),!eQ&&(0,t.jsx)(x.default,{userId:n.id})]}),(0,t.jsx)(T.default,{profile:n,realProfile:i,simLabel:l,simpleMenu:N,onExitSim:tD,onOpenSleep:()=>tf(!0)})]})]})})),eV&&tc?(0,p.createPortal)((0,t.jsx)(t.Fragment,{children:tP}),tc):tP]}),tx&&eV&&(0,p.createPortal)((0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[9998]",onClick:()=>tg(!1)}),(0,t.jsxs)("div",{className:"fixed inset-x-3 top-[72px] z-[9999] bg-zinc-900 border border-zinc-800 rounded-[6px] shadow-2xl overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.default,{name:"ui.clock",size:14,className:tb?"text-brand-ink":"text-content-secondary"}),(0,t.jsx)("span",{className:"if-t-body font-semibold text-content-primary",children:"Productivity"}),tb&&(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--if-purple)] animate-pulse"})]}),(0,t.jsx)("button",{onClick:()=>tg(!1),className:"flex items-center justify-center w-7 h-7 rounded-lg text-content-muted hover:text-content-primary hover:bg-surface-hover transition-colors",children:(0,t.jsx)(s.default,{name:"window.close",size:14})})]}),(0,t.jsxs)("div",{className:"p-3 flex flex-col gap-1.5",children:[eN&&(0,t.jsxs)("button",{onClick:()=>{tg(!1),eS(!1)},className:(0,M.statusChip)("emerald","cursor-pointer w-full justify-start gap-2"),children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse shrink-0"}),(0,t.jsx)(s.default,{name:eN.videoEnabled?"comm.video":"comm.phone",size:12,className:"text-emerald-400 shrink-0"}),(0,t.jsx)("span",{className:"font-medium truncate text-content-primary",children:eN.channelName}),(0,t.jsx)("span",{className:"ml-auto if-t-micro font-semibold text-emerald-300 bg-emerald-500/15 px-1.5 h-5 inline-flex items-center rounded-md shrink-0",children:"In call"})]}),ek.length>0&&!eN&&(et=ek[0],(0,t.jsxs)("button",{onClick:()=>{tg(!1),eM.push(`/chat?join=${et.channelId}&room=${encodeURIComponent(et.roomName??"")}&type=${et.callType}`)},className:(0,M.statusChip)("emerald","cursor-pointer w-full justify-start gap-2"),children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse shrink-0"}),(0,t.jsx)(s.default,{name:"comm.phone",size:12,className:"text-emerald-400 shrink-0"}),(0,t.jsx)("span",{className:"font-medium truncate text-content-primary",children:et.channelName}),(0,t.jsx)("span",{className:"ml-auto if-t-micro font-semibold text-emerald-300 bg-emerald-500/15 px-1.5 h-5 inline-flex items-center rounded-md shrink-0",children:en("header_join")||"Join"})]})),el&&(0,t.jsx)(O.default,{profile:n,isStaff:tI}),(0,t.jsx)("div",{className:"inline-flex items-center",children:(0,t.jsx)(H.default,{})}),(0,t.jsx)("div",{className:"inline-flex items-center",children:(0,t.jsx)(eu,{userId:n.id})})]})]})]}),document.body),eO&&(0,t.jsx)(z.default,{onClose:()=>eR(!1),initialQuery:eJ}),eW&&(0,t.jsx)(U.default,{onClose:()=>eB(!1)}),(0,t.jsx)(G.default,{open:eX,onClose:()=>e0(!1)}),tp&&(0,t.jsx)(em.default,{onClose:()=>tf(!1)}),(0,t.jsx)(K.PostBreakPrompt,{})]})}],422879)},97410,e=>{"use strict";e.s(["Boundary",()=>i,"Slot",()=>r,"default",()=>l]);var t=e.i(843476),n=e.i(271645),a=e.i(305756),s=e.i(310119);class i extends n.Component{state={err:null};static getDerivedStateFromError(e){return{err:e?.message??"failed to render"}}componentDidCatch(e,t){console.error("[HeaderCompare] website header failed:",e.message,t.componentStack)}render(){return this.state.err?(0,t.jsxs)("p",{className:"px-3 py-2 text-xs text-content-muted",children:["Website header did not render here: ",this.state.err]}):this.props.children}}function r({label:e,hideBadge:n,children:a}){return(0,t.jsxs)("section",{"aria-label":e,className:"relative border-b border-dashed border-brand/40",children:[n?null:(0,t.jsx)("span",{className:"absolute left-0 top-0 z-[120] select-none rounded-br-md bg-brand px-1.5 py-px if-t-micro font-bold uppercase tracking-wider text-on-accent",children:e}),(0,t.jsx)("div",{className:"[&>header]:!static [&>header]:!inset-auto [&>div>header]:!static [&>div>header]:!inset-auto",children:a})]})}function l({app:e,umc:o,enabled:c}){let d=(0,s.useLayout)(),u=c&&d.headerCompare;return((0,n.useEffect)(()=>{let e=document.getElementById("if-main-row-slot"),t=document.querySelector("header.if-top-bar"),n=()=>{e?.removeAttribute("data-compare-label"),t?.removeAttribute("data-compare-label")};if(!u)return void n();let a=e&&e.childElementCount>0?e:t;return a?.setAttribute("data-compare-label","App Header"),n},[u]),u)?(0,t.jsxs)("div",{"data-header-compare":!0,className:"relative",children:[e,o?(0,t.jsx)(r,{label:"UMC Header",children:(0,t.jsx)(i,{children:o})}):null,(0,t.jsx)(r,{label:"Website Header",hideBadge:!0,children:(0,t.jsx)(i,{children:(0,t.jsx)(a.default,{})})})]}):(0,t.jsx)(t.Fragment,{children:e})}},678761,e=>{"use strict";var t=e.i(843476),n=e.i(271645),a=e.i(525885),s=e.i(329198),i=e.i(194018),r=e.i(310119),l=e.i(89772);function o({scope:e="public",tools:n=!1}={}){return(0,t.jsx)(l.UniversalSearchBar,{scope:e,placement:"header",tools:n})}var c=e.i(928233),d=e.i(733607),u=e.i(170373),m=e.i(292296),h=e.i(177262),p=e.i(961825),f=e.i(168424),x=e.i(885439),g=e.i(522016);let b=["brands","builders","chat","tasks","dashboard","notes","library","people","replays","projects","assets","playbooks","prompts","settings","admin","finance","payroll","calendar","starred","dreams","goals","skills","meetings","notifications","profile","home","inbox","search","signup","login","logout","grid","happy","agreements","ai-usage","coaching","collaborate","communities","connections","console","contacts","contentfuel","contracts","deals","dream-builder","fuela","gallery-community","hello-mars","join","analytics","how-we-work","journey","leads","marketing","meeting","onboarding","opportunities","pending-approval","pipeline","playlist","portal","reports","requests","sales","studio","style-guide","test","training","wellness","versions","catalogue","whiteboard","face-control","style","forgot-password","reset-password","rss","rss-xml","sitemap-xml"];[...b];var w=e.i(618566),y=e.i(185946);e.s(["default",0,function({mode:e,profile:v=null,realProfile:j,simLabel:k=null,simpleMenu:N=!1,onExitSim:C,onOpenSleep:S,userId:_=null,brandName:E="Insert Fuel",brandLogoUrl:z=null,logoHref:T,logoSize:$=40,homeLink:L=null,isCurrent:D,isStaff:I=!1,signedIn:M=!1,onCartOpen:A,themeControl:P,extras:U,leading:F,statusRow:O,signedOutActions:R}){let W,B=T??("app"===e?"/dashboard":"/"),q=(0,r.useLayout)(),H=(0,f.useBarShown)("search"),G=(0,n.useRef)(null),K=(0,n.useRef)(null);(0,n.useLayoutEffect)(()=>{let e=G.current,t=K.current;if(!e||!t)return;let n=new Map,a=()=>{let a=Array.from(e.querySelectorAll("[data-mega-item]"));for(let e of a)!e.hidden&&e.offsetWidth&&n.set(e.dataset.megaItem??"",e.offsetWidth);let s=t.getBoundingClientRect().right-t.scrollWidth-e.getBoundingClientRect().left-12,i=0,r=!1;a.forEach((e,t)=>{(i+=(n.get(e.dataset.megaItem??"")??e.offsetWidth)+2*!!t)>s&&(r=!0),e.hidden!==r&&(e.hidden=r)});let l=t.querySelector("[data-crossing-word]"),o=t.parentElement?.firstElementChild;l&&o&&(l.style.display="",t.getBoundingClientRect().right-t.scrollWidth<o.getBoundingClientRect().right+8&&(l.style.display="none"))};a();let s=new ResizeObserver(a);return s.observe(e),s.observe(t),s.observe(document.documentElement),()=>s.disconnect()},[e,q.websiteMenu]);
7let J=(W=((0,w.usePathname)()??"/").split("/").filter(Boolean)[0]??"",!b.includes(W)),Y=(0,a.useVariant)("Top left",["Logo row","Fuel mark"]),V=(0,a.useVariant)(p.SITE_MENU_GROUP,p.SITE_MENU_OPTIONS),[Z,Q]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if("app"!==e)return;let t=()=>{try{Q(window.innerWidth>=768&&"true"===localStorage.getItem("if:sidebar-collapsed"))}catch{Q(!1)}};t();let n=e=>{if(window.innerWidth<768)return;let t=e.detail?.collapsed;"boolean"==typeof t&&Q(t)};return window.addEventListener("if:sidebar-toggle",n),window.addEventListener("resize",t),()=>{window.removeEventListener("if:sidebar-toggle",n),window.removeEventListener("resize",t)}},[e]);let X="app"===e&&"Fuel mark"===Y&&Z,ee=J?{label:"Open app",href:"/dashboard"}:{label:"Website",href:"/"};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"app"===e?"contents md:hidden":"contents",children:[X?(0,t.jsxs)("button",{type:"button",onClick:()=>{if(window.innerWidth<768)return void window.dispatchEvent(new CustomEvent("if:sidebar-open"));try{localStorage.setItem("if:sidebar-collapsed","false")}catch{}window.dispatchEvent(new CustomEvent("if:sidebar-toggle",{detail:{collapsed:!1}}))},"aria-label":"Open the menu",title:"Open the menu",className:"group/mark relative flex h-10 w-10 shrink-0 items-center justify-center r-control transition-colors hover:bg-surface-hover",children:[(0,t.jsx)("img",{src:"/icon-512.png",alt:"",draggable:!1,className:"h-8 w-8 select-none object-contain transition-transform duration-300 group-hover/mark:-rotate-12"}),(0,t.jsxs)("span",{"aria-hidden":!0,className:"absolute -bottom-0.5 -right-1 flex h-4 w-4 flex-col items-center justify-center gap-[2.5px] rounded-full bg-surface-card ring-1 ring-line-base",children:[(0,t.jsx)("span",{className:"block h-[1.5px] w-2 rounded-full bg-content-secondary transition-all duration-300 group-hover/mark:w-2.5"}),(0,t.jsx)("span",{className:"block h-[1.5px] w-2 rounded-full bg-content-secondary transition-all duration-300 group-hover/mark:w-1.5"}),(0,t.jsx)("span",{className:"block h-[1.5px] w-2 rounded-full bg-content-secondary transition-all duration-300 group-hover/mark:w-2.5"})]})]}):(0,t.jsx)(s.default,{src:z??void 0,alt:E,href:B,size:$,lockup:"wide",maxHeight:40,className:"shrink-0"}),z&&E&&"Insert Fuel"!==E&&(0,t.jsx)(g.default,{href:B,className:"hidden sm:inline-block shrink-0 if-t-body font-black uppercase tracking-wide text-content-primary no-underline","aria-hidden":"true",tabIndex:-1,children:E})]}),F,"website"===e&&(0,t.jsx)("nav",{ref:G,"aria-label":"Main",className:"hidden min-w-0 items-center gap-0.5 overflow-hidden md:flex",children:(0,t.jsx)(i.default,{isCurrent:D,isStaff:I,signedIn:M,homeLink:L})}),"app"===e&&H&&(0,t.jsx)("div",{className:"group/bar hidden min-w-[9rem] max-w-[40rem] flex-1 items-center gap-1 md:flex",children:(0,t.jsx)("span",{"data-tour":"search",className:"contents",children:(0,t.jsx)(l.UniversalSearchBar,{scope:"app",placement:"field"})})}),(0,t.jsx)("div",{ref:K,className:"ml-auto flex min-w-0 items-center justify-end",children:(0,t.jsxs)("div",{className:"if-headctl flex shrink-0 items-center gap-0",children:[L&&"app"===e&&!J&&!I&&(0,t.jsxs)(g.default,{href:L.href,title:L.label,"aria-label":L.label,className:"flex h-8 items-center gap-1.5 whitespace-nowrap rounded-lg border border-line-base px-2.5 if-t-meta font-semibold text-content-secondary transition-colors hover:bg-surface-hover hover:text-content-primary",children:[(0,t.jsx)(x.default,{name:"ui.globe",size:14}),(0,t.jsx)("span",{"data-crossing-word":!0,className:"hidden lg:inline",children:L.label})]}),L&&"app"===e&&!J&&I&&"Header button"===V&&(0,t.jsx)(p.NavSiteMenu,{label:L.label,labelClassName:"hidden lg:inline",triggerClassName:"flex h-8 items-center gap-1.5 whitespace-nowrap rounded-lg border border-line-base px-2.5 if-t-meta font-semibold text-content-secondary transition-colors hover:bg-surface-hover hover:text-content-primary aria-expanded:bg-surface-hover aria-expanded:text-content-primary",iconSize:14}),L&&!("app"===e&&!J)&&(0,t.jsxs)(g.default,{href:ee.href,title:ee.label,"aria-label":ee.label,className:"flex h-8 items-center gap-1.5 rounded-lg border border-line-base px-2.5 if-t-meta font-semibold text-content-secondary transition-colors hover:bg-surface-hover hover:text-content-primary",children:["/"===ee.href?(0,t.jsx)(x.default,{name:"ui.globe",size:14}):(0,t.jsx)(y.default,{size:18}),(0,t.jsx)("span",{"data-crossing-word":!0,className:"hidden md:inline",children:ee.label})]}),(0,t.jsx)("span",{"data-tour":"search",className:"app"===e?"if-nav-search contents md:hidden":"if-nav-search contents",children:(0,t.jsx)(o,{scope:v||M?"app":"public",tools:"app"===e})}),(0,t.jsx)("span",{className:"hidden md:contents",children:P}),A&&(0,t.jsx)("span",{className:"if-nav-cart hidden md:contents",children:(0,t.jsx)(c.default,{onOpen:A,signedIn:!!v||M})}),(0,t.jsx)("span",{className:"hidden md:contents",children:!v&&(0,t.jsx)(p.NavLanguageMenu,{})}),"app"===e&&_&&(0,t.jsx)("span",{"data-tour":"header-chat",className:"contents",children:(0,t.jsx)(d.default,{userId:_})}),_&&(0,t.jsx)(u.default,{userId:_}),(0,t.jsx)("span",{className:"hidden md:contents",children:(0,t.jsx)(h.default,{})}),U,v?(0,t.jsx)(m.default,{profile:v,realProfile:j,simLabel:k,simpleMenu:N,onExitSim:C,onOpenSleep:S}):(0,t.jsx)("span",{className:"hidden md:contents",children:R})]})})]})}],678761)},180099,e=>{"use strict";var t=e.i(843476),n=e.i(271645),a=e.i(775426);e.s(["default",0,function({className:e="",children:s,service:i,onClick:r,style:l,id:o}){let{open:c}
7=(0,a.useBooking)(),[d,u]=(0,n.useState)(!1),{color:m,...h}=l??{},p=String(h.background??h.backgroundColor??""),f=/var\(--(if-purple|accent-brand|color-brand|skin-accent|accent)\)/.test(p)||/(^|\s)bg-(brand|\[var\(--(if-purple|accent-brand|color-brand|accent)\)\])(\s|$)/.test(e),x=f?h:{...h,...m?{color:m}:{}},g=(0,n.useRef)(null);(0,n.useEffect)(()=>()=>{g.current&&clearTimeout(g.current)},[]);let b=(0,n.useCallback)(()=>{u(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>u(!1),480),r?.(),c(i)},[r,c,i]);return(0,t.jsx)("button",{type:"button",id:o,onClick:b,"data-filling":d?"true":void 0,className:`cta-fill ${f?"cta-fill--on-accent ":""}${e}`,style:x,children:s})}])},305756,e=>{"use strict";e.s(["default",()=>L],305756);var t=e.i(843476),n=e.i(915120),a=e.i(885439),s=e.i(447199),i=e.i(333155),r=e.i(271645),l=e.i(35525);e.i(247167),e.i(422879),e.i(97410);var o=e.i(310119);let c=()=>()=>{};function d({profile:e}){(0,o.useLayout)();let t=(0,r.useRef)(null),[n,a]=(0,r.useState)(0),[s,i]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{i(!!document.querySelector("[data-header-compare]"))},[]),(0,r.useSyncExternalStore)(c,()=>{try{return"1"===localStorage.getItem("if:audience-dock")}catch{return!1}},()=>!1),(e??null)?.role,(0,r.useLayoutEffect)(()=>{t.current,document.documentElement.style.setProperty("--if-compare-offset","0px"),document.body.style.paddingTop="",a(0)},[!1]),null}var u=e.i(618566),m=e.i(522016),h=e.i(177262),p=e.i(880492),f=e.i(961825),x=e.i(132222),g=e.i(678761),b=e.i(910504),w=e.i(160448),y=e.i(170594),v=e.i(312134),j=e.i(447402),k=e.i(329198),N=e.i(672215),C=e.i(185946);function S({size:e=40,accent:n=!0}){let a=e*N.LOCKUP.capOverMark,s=a*N.LOCKUP.secondOverFirst,i=e*N.LOCKUP.gapOverMark;return(0,t.jsxs)("span",{"data-lockup":!0,className:"inline-flex items-center",style:{gap:`${i}px`},children:[(0,t.jsx)(C.default,{size:e,showWordmark:!1,handOnly:!0}),(0,t.jsxs)("span",{className:"flex flex-col items-start",children:[(0,t.jsx)("span",{className:"whitespace-nowrap",style:{fontFamily:"Archivo, var(--dp), sans-serif",fontWeight:N.LOCKUP.weightFirst,fontSize:`${a/.72}px`,lineHeight:N.LOCKUP.lineHeight,letterSpacing:N.LOCKUP.tracking,color:"var(--text-primary, #F6F8FC)"},children:"INSERT"}),(0,t.jsx)("span",{className:"whitespace-nowrap",style:{fontFamily:"Archivo, var(--dp), sans-serif",fontWeight:N.LOCKUP.weight,fontSize:`${s/.72}px`,lineHeight:N.LOCKUP.lineHeight,letterSpacing:N.LOCKUP.tracking,color:n?"var(--accent, #F7B538)":"var(--text-primary, #F6F8FC)"},children:"FUEL"})]})]})}var _=e.i(502106),E=e.i(770703),z=e.i(180099);let T=(0,E.default)(()=>e.A(851196),{loadableGenerated:{modules:[52069]},ssr:!1}),$=[{step:1,hides:".if-nav-book-long",what:"Book a Strategy Call becomes Book a call"},{step:2,hides:".if-nav-search",what:"Search"},{step:3,hides:".if-nav-cart",what:"the cart"},{step:4,hides:".if-nav-login",what:"Log in, or the first name"},{step:5,hides:".if-nav-book",what:"the booking button"}];function L(){let[e,c]=(0,r.useState)(!1),[N,C]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=document.getElementById("hero-primary-cta");if(!e)return void C(!0);let t=new IntersectionObserver(([e])=>C(!e.isIntersecting),{rootMargin:"-8px 0px 0px 0px"});return t.observe(e),()=>t.disconnect()},[]);let E=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=E.current,t=e?.parentElement;if(!e||!t||"u"<typeof ResizeObserver)return;let n=t.firstElementChild;for(;n&&"contents"===getComputedStyle(n).display;)n=n.firstElementChild;let a=()=>{let a=t.getBoundingClientRect();if(e.getBoundingClientRect().right>a.right+1)return!0;let s=t.querySelector(".if-headctl");return!!n&&!!s&&!!s.offsetWidth&&s.getBoundingClientRect().left<n.getBoundingClientRect().right+8},s=()=>{let e=t.querySelector(".if-headctl");e&&!e.offsetWidth&&t.setAttribute("data-ctl-empty","")},i=!1,r=()=>{if(!i){if(i=!0,t.removeAttribute("data-gives"),t.removeAttribute("data-ctl-empty"),"none"!==getComputedStyle(e).display)for(let{step:e,hides:n}of $){if(!a())break;t.querySelector(n)&&(t.setAttribute("data-gives",String(e)),s())}i=!1}};r();let l=new ResizeObserver(r);l.observe(t),n&&l.observe(n);let o=new MutationObserver(()=>requestAnimationFrame(r));return o.observe(t,{childList:!0,subtree:!0,characterData:!0}
7),()=>{l.disconnect(),o.disconnect()}},[]);let[L,D]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=document.documentElement;return L?e.setAttribute("data-overlay-open","menu"):e.removeAttribute("data-overlay-open"),()=>e.removeAttribute("data-overlay-open")},[L]);let[I,M]=(0,r.useState)(!1),A=(0,u.usePathname)(),[P,U]=(0,r.useState)(null),F=(0,r.useMemo)(()=>(0,x.menuFor)(x.PRIMARY),[]),O=(0,r.useMemo)(()=>(0,x.menuFor)(x.SECONDARY),[]);(0,r.useEffect)(()=>{let e=[...F,...O].map(e=>e.href).filter(e=>e.includes("#")).map(e=>e.split("#")[1]);if(!e.length)return;let t=()=>{if("/"!==A)return void U(null);let t=null,n=1/0;for(let a of e){let e=document.getElementById(a);if(!e)continue;let s=e.getBoundingClientRect().top;s<=140&&Math.abs(s)<n&&(n=Math.abs(s),t=a)}U(t)};return t(),window.addEventListener("scroll",t,{passive:!0}),()=>window.removeEventListener("scroll",t)},[A]);let R=e=>{let[t,n]=e.split("#");return n?A===t&&P===n:"/"===t?"/"===A&&!P:A===t||A.startsWith(t+"/")},{theme:W}=(0,p.useTheme)(),B=(0,y.useVisitorSeed)(),[q,H]=(0,r.useState)(B?.firstName?{firstName:B.firstName,id:B.userId??null,profile:B.profile??null}:null),[G,K]=(0,r.useState)(B?.firstName?B.firstName.trim().split(/\s+/)[0]:null);(G??"").toLowerCase(),(0,r.useEffect)(()=>{let e=(0,w.rememberedFirstName)();K(e?e.trim().split(/\s+/)[0]:null)},[]);let J=(0,w.useVisitor)();(0,o.useBars)().status&&q?.profile;let Y=!J.resolved,V=J.isOwner?{label:"Dashboard",href:"/dashboard"}:"staff"===J.kind?{label:"Book time with Basim",action:"book"}:"client"===J.kind||"member"===J.kind?J.onFuelPlan?{label:"Book a call",action:"book"}:{label:"Sign up",href:"/plans"}:{label:"Join free",href:"/community"},[Z,Q]=(0,r.useState)(!1),[X,ee]=(0,r.useState)(!!B);(0,r.useEffect)(()=>{let e=(0,w.rememberedFirstName)();e&&(H({firstName:e}),ee(!0));let t=!1;return(async()=>{try{let e=await (await fetch("/api/visitor")).json();if(t)return;H(e?.firstName?{firstName:e.firstName,id:e.userId??null,profile:e.profile??null}:null)}catch{}finally{t||ee(!0)}})(),()=>{t=!0}},[]);let et=(0,r.useMemo)(()=>(0,x.megaNavFor)().map(e=>({title:e.label,links:e.columns.flatMap(e=>"services"===e.source?v.SERVICES.filter(e=>"unsure"!==e.slug).map(e=>({label:e.label,href:`/services/${e.slug}`})):"plans"===e.source?j.PLANS.filter(e=>"dream"!==e.slug).map(e=>({label:e.name,href:`/plans/${e.slug}`})):e.links.map(e=>({label:e.label,href:e.href})))})),[]),[en,ea]=(0,r.useState)(null),es=(0,r.useRef)(null);(0,r.useEffect)(()=>{es.current?.scrollTo({top:0,behavior:"auto"})},[en]);let[ei,er]=(0,r.useState)(!1);(0,r.useEffect)(()=>er(!0),[]);let el=ei&&"dark"===W,eo=ei?el?"Switch to light mode":"Switch to dark mode":"Toggle theme";(0,r.useEffect)(()=>{let e=()=>c(window.scrollY>12);return e(),window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},[]);let{open:ec}=(0,s.useHelpRequest)(),[ed,eu]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{document.documentElement.style.setProperty("--if-nav-h",`${Math.round(64)}px`)},[36]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d,{profile:q?.profile??null}),(0,t.jsxs)("header",{style:{top:"var(--if-compare-offset, 0px)",paddingTop:"env(safe-area-inset-top, 0px)"},className:`fixed left-0 right-0 z-50 transition-all duration-300 ${e?"layer-bar border-b border-slate-200/70 dark:border-white/10":"if-nav-clear bg-transparent border-b border-transparent"}`,children:[!1,(0,t.jsx)(b.default,{}),(0,t.jsx)("div",{className:"px-3 lg:px-4",children:(0,t.jsxs)("div",{className:"if-navrow flex items-center gap-4 transition-all duration-300 lg:gap-7",children:[(0,t.jsx)(g.default,{mode:"website",profile:q?.profile??null,userId:q?.id??null,logoHref:"visitor"===J.kind?"/":"/dashboard",logoSize:36,isCurrent:R,isStaff:"staff"===J.kind,signedIn:!!q||!!J.resolved&&"visitor"!==J.kind,homeLink:q||"visitor"!==J.kind?{label:"Dashboard",href:"/dashboard"}:null,onCartOpen:()=>eu(e=>!e),themeControl:ei?(0,t.jsx)(i.default,{label:eo}):null,signedOutActions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.default,{href:"/login",title:G?`Log in as ${G}`:"Log in",className:(0,n.control)("secondary","md","font-semibold"),children:"Log in"}),"book"===V.action?(0,t.jsx)("button",{type:"button",onClick:()=>Q(!0),className:(0,n.control)("primary","md",`gap-1.5 font-semibold shadow-lg shadow-brand/25 hover:-translate-y-0.5${Y?" if-cta-guess":""}`),children:V.label}):(0,t.jsxs)(m.default,{href:V.href??"/signup",className:(0,n.control)("primary","md",`group/cta gap-1.5 font-semibold shadow-lg shadow-brand/25 hover:-translate-y-0.5${Y?" if-cta-guess":""}`),children:["Dashboard"===V.label&&(0,t.jsx)("span",{className:"grid w-0 place-items-center overflow-hidden opacity-0 transition-all duration-150 group-hover/cta:w-4 group-hover/cta:opacity-100 motion-reduce:transition-none",children:(0,t.jsx)(a.default,{name:"nav.home",size:15,className:"shrink-0"})}),V.label]}),Z&&(0,t.jsx)(l.default,{me:{full_name:J.me?.fullName??"",email:J.me?.email??null,phone:J.me?.phone??null},onClose:()=>Q(!1)})]})}),(0,t.jsxs)("div",{ref:E,className:"if-nav-phone ml-auto md:hidden flex items-center gap-2",children:[q?.id&&(0,t.jsx)(T,{userId:q.id}),(0,t.jsx)(m.default,{href:"/login",className:"if-nav-login inline-flex min-h-[44px] items-center whitespace-nowrap r-control px-2.5 if-t-meta font-semibold text-content-secondary hover:text-content-primary transition-colors",children:G??"Log in"}),N&&(0,t.jsxs)(z.default,{className:"if-nav-book inline-flex min-h-[44px] items-center whitespace-nowrap r-control bg-[var(--if-purple)] px-4 if-t-meta font-bold text-[var(--on-accent)] transition-opacity",children:[(0,t.jsx)("span",{className:"if-nav-book-long",children:"Book a Strategy Call"}),(0,t.jsx)("span",{className:"if-nav-book-short",children:"Book a call"})]}),(0,t.jsx)("button",{onClick:()=>D(e=>!e),"aria-label":"Menu",className:"inline-flex min-h-[44px] min-w-[44px] -mr-2 items-center justify-center r-control text-content-primary hover:bg-surface-hover transition-colors",children:L?(0,t.jsx)(a.default,{name:"ui.close",size:22,weight:"regular"}):(0,t.jsx)(a.default,{name:"ui.menu",size:22,weight:"regular"})})]})]})})]}),(0,t.jsx)(_.default,{open:ed,onClose:()=>eu(!1)}),L&&(0,t.jsxs)("div",{className:"fixed inset-0 z-[60] flex flex-col layer-page md:hidden",children:[(0,t.jsxs)("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-line-base px-6",children:[new URLSearchParams(window.location.search).has("logocompare")&&(0,t.jsxs)("span",{className:"mr-6 flex items-center gap-3 rounded-lg border border-dashed border-amber-500/40 px-3 py-1.5",children:[(0,t.jsx)(S,{size:40}),(0,t.jsx)("span",{className:"if-t-caption font-mono uppercase tracking-[.14em] text-amber-500",children:"spec"})]}),(0,t.jsx)(k.default,{still:!0,href:q?"/dashboard":"/",size:36,lockup:"wide",maxHeight:40,className:"shrink-0"}),(0,t.jsx)("button",{type:"button",onClick:()=>{D(!1),ea(null)},"aria-label":"Close menu",className:"inline-flex min-h-[44px] min-w-[44px] -mr-2 items-center justify-center r-control text-content-primary hover:bg-surface-hover transition-colors",children:(0,t.jsx)(a.default,{name:"ui.close",size:22,weight:"regular"})})]}),(0,t.jsxs)("nav",{ref:es,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 pt-5 pb-8",children:[null===en?(0,t.jsx)("div",{className:"flex flex-col",children:et.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>ea(e.title),className:"flex items-center justify-between r-container px-3 py-4 text-left text-[18px] font-semibold text-slate-800 transition-colors hover:bg-surface-hover dark:text-slate-100 dar
7k:hover:bg-white/5",children:[e.title,(0,t.jsx)(a.default,{name:"ui.chevron-right",size:16,weight:"regular",className:"text-slate-300 dark:text-slate-600"})]},e.title))}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",onClick:()=>ea(null),className:"mb-3 flex items-center gap-1.5 if-t-meta font-bold text-slate-500 dark:text-slate-400",children:[(0,t.jsx)(a.default,{name:"ui.chevron-right",size:13,weight:"regular",className:"rotate-180"})," All sections"]}),et.filter(e=>e.title===en).map(e=>(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("p",{className:"mb-2 if-t-caption font-bold uppercase tracking-[0.16em] text-slate-400",children:e.title}),(0,t.jsx)("div",{className:"flex flex-col",children:e.links.map(e=>{let n;return(0,t.jsx)("a",{href:(n=e.href,"/"===A&&n.startsWith("/new#")?n.slice(4):n),onClick:()=>D(!1),..."external"in e&&e.external?{target:"_blank",rel:"noreferrer"}:{},"aria-current":R(e.href)?"page":void 0,className:`flex items-center justify-between r-container px-3 py-3 if-t-body transition-colors ${R(e.href)?"bg-[var(--if-purple)]/10 font-bold text-slate-900 dark:text-[var(--on-accent)]":"font-medium text-slate-700 hover:bg-surface-hover dark:text-slate-200 dark:hover:bg-white/5"}`,children:e.label},e.href)})})]},e.title)),(0,t.jsxs)("div",{className:"mt-4 border-t border-line-base pt-4",children:[(0,t.jsx)("p",{className:"if-t-micro mb-2 text-content-muted",children:"Everything else"}),(0,t.jsx)("div",{className:"flex flex-col",children:et.filter(e=>e.title!==en).map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>ea(e.title),className:"flex min-h-[48px] items-center justify-between r-container px-3 py-3 if-t-body font-medium text-content-secondary transition-colors hover:bg-surface-hover hover:text-content-primary",children:[e.title,(0,t.jsx)(a.default,{name:"ui.chevron-right",size:14,weight:"regular",className:"text-content-muted"})]},e.title))})]})]}),(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("p",{className:"mb-2 if-t-caption font-bold uppercase tracking-[0.16em] text-slate-400",children:"Your account"}),q?(0,t.jsxs)(m.default,{href:"/dashboard",onClick:()=>D(!1),className:"flex items-center gap-2.5 r-container px-3 py-3 if-t-body font-bold text-slate-900 dark:text-white",children:[(0,t.jsx)(a.default,{name:"ui.squares-four",size:17,weight:"regular",style:{color:"var(--brand-ink)"}}),q.firstName,"'s Dashboard"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(m.default,{href:"/login",onClick:()=>D(!1),className:"flex items-center gap-2.5 r-container px-3 py-3 if-t-body font-medium text-content-secondary transition-colors hover:bg-surface-hover hover:text-content-primary",children:[(0,t.jsx)(a.default,{name:"ui.sign-in",size:17,weight:"regular","aria-hidden":!0})," Log in"]}),(0,t.jsxs)(m.default,{href:"/community",onClick:()=>D(!1),className:"flex items-center gap-2.5 r-container px-3 py-3 if-t-body font-medium text-content-secondary transition-colors hover:bg-surface-hover hover:text-content-primary",children:[(0,t.jsx)(a.default,{name:"ui.users-three",size:17,weight:"regular","aria-hidden":!0})," Join the community"]})]}),ei&&(0,t.jsxs)("div",{className:"if-sheet-row flex items-center gap-2.5 r-container px-3 py-3 if-t-body font-medium text-content-secondary",children:[(0,t.jsx)(i.default,{label:eo}),(0,t.jsx)("span",{children:"Appearance"})]}),(0,t.jsxs)("div",{className:"if-sheet-row flex items-center gap-2.5 r-container px-3 py-3 if-t-body font-medium text-content-secondary",children:[!q?.profile&&(0,t.jsx)(f.NavLanguageMenu,{}),(0,t.jsx)("span",{children:"Language"})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>{D(!1),window.dispatchEvent(new CustomEvent("if:open-search"))},className:"flex w-full items-center gap-2.5 r-container px-3 py-3 if-t-body font-medium text-content-secondary transition-colors hover:bg-surface-hover hover:text-content-primary",children:[(0,t.jsx)(a.default,{name:"ui.magnifying-glass",size:17,weight:"regular","aria-hidden":!0})," Search"]}),(0,t.jsxs)("div",{className:"if-sheet-row flex items-center gap-2.5 r-container px-3 py-3 if-t-body font-medium text-content-secondary",children:[(0,t.jsx)(h.default,{}),(0,t.jsx)("span",{children:"Change role"})]})]})]}),(0,t.jsxs)("div",{className:"shrink-0 border-t border-slate-200 layer-page px-6 py-4 dark:border-white/10",children:[(0,t.jsxs)(z.default,{onClick:()=>D(!1),className:"flex w-full items-center justify-center gap-2 r-container bg-[var(--if-purple)] px-4 py-4 if-t-body font-bold text-[var(--on-accent)] shadow-lg",children:[(0,t.jsx)(a.default,{name:"ui.phone-call",size:17,weight:"regular","aria-hidden":!0})," Book a Strategy Call"]}),(0,t.jsx)(m.default,{href:"/contact",onClick:()=>D(!1),className:"mt-2 flex min-h-[48px] w-full items-center justify-center gap-1.5 r-control if-t-body font-medium text-content-secondary hover:text-content-primary transition-colors",children:"Talk to someone now"})]})]})]})}}]);

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.