PageSourceSearch

https://thetool.company/_next/static/chunks/3bvgsc0cpe-f8.js

js thetool.company collected 2026-10-02 01:53:01 UTC 53,802 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,795534,e=>{"use strict";var t=e.i(843476),a=e.i(271645);let n="cubic-bezier(0.25, 0.25, 0.72, 1)";e.s(["FilmIcon",0,function(e){let r=(0,a.useRef)(null),s=(0,a.useId)();return(0,a.useEffect)(()=>{let e=r.current,t=e?.closest(".sq-tile"),a=e?.querySelector(".film-feed");if(!e||!t||!a||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let s=null,l=()=>{t.closest(".app-card-anchor")?.hasAttribute("data-suppress-hover")||(a.getAnimations().forEach(e=>e.cancel()),(s=a.animate([{transform:"translateY(0)"},{transform:"translateY(-18px)"}],{duration:900,easing:n})).onfinish=()=>{s=null})},i=()=>{if(!s)return;s.pause();let e=-new DOMMatrix(getComputedStyle(a).transform).f,t=9*Math.ceil(e/9-.001);s.cancel(),s=null,t-e<.01||a.animate([{transform:`translateY(${-e}px)`},{transform:`translateY(${-t}px)`}],{duration:Math.round((t-e)/9*450)+60,easing:n})};return t.addEventListener("mouseenter",l),t.addEventListener("mouseleave",i),()=>{t.removeEventListener("mouseenter",l),t.removeEventListener("mouseleave",i),a.getAnimations().forEach(e=>e.cancel())}},[r]),(0,t.jsxs)("svg",{ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:s,children:(0,t.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"})})}),(0,t.jsx)("rect",{x:"7",y:"3",width:"10",height:"18",fill:"var(--sq-stone, none)",stroke:"none"}),(0,t.jsx)("g",{clipPath:`url(#${s})`,children:(0,t.jsxs)("g",{className:"film-feed",children:[(0,t.jsx)("path",{d:"M3 7.5h4"}),(0,t.jsx)("path",{d:"M3 12h18"}),(0,t.jsx)("path",{d:"M3 16.5h4"}),(0,t.jsx)("path",{d:"M17 7.5h4"}),(0,t.jsx)("path",{d:"M17 16.5h4"}),(0,t.jsx)("path",{d:"M3 21h18"}),(0,t.jsx)("path",{d:"M3 25.5h4"}),(0,t.jsx)("path",{d:"M17 25.5h4"}),(0,t.jsx)("path",{d:"M3 30h18"}),(0,t.jsx)("path",{d:"M3 34.5h4"}),(0,t.jsx)("path",{d:"M17 34.5h4"})]})}),(0,t.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),(0,t.jsx)("path",{d:"M7 3v18"}),(0,t.jsx)("path",{d:"M17 3v18"})]})}])},666108,e=>{"use strict";var t=e.i(843476),a=e.i(271645);let n="M6 2a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2z",r=[{d:"M6.5 6.5h7",width:1,cap:"round",paint:"var(--sq-ink, none)"},{d:"M6 10.5h8",width:3,cap:"butt",paint:"var(--sq-sky, none)"},{d:"M6.5 14.5h4",width:1,cap:"round",paint:"var(--sq-ink, none)"}],s="cubic-bezier(0.25, 0.25, 0.72, 1)";e.s(["FormsIcon",0,function(e){let l=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=l.current,t=e?.closest(".sq-tile");if(!e||!t||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let a=Array.from(e.querySelectorAll(".form-row")),n=[],r=()=>{t.closest(".app-card-anchor")?.hasAttribute("data-suppress-hover")||(n.forEach(e=>e?.cancel()),n=a.map((e,t)=>e.animate([{strokeDashoffset:1.05},{strokeDashoffset:0}],{duration:150,delay:150*t,easing:s,fill:"backwards"})))},i=()=>{n.forEach((e,t)=>{let n=a[t];if(!e||!n)return;e.pause();let r=Math.abs(parseFloat(getComputedStyle(n).strokeDashoffset))||0;e.cancel(),r<.01||n.animate([{strokeDashoffset:r},{strokeDashoffset:0}],{duration:Math.round(80+140*r),easing:s})}),n=[]};return t.addEventListener("mouseenter",r),t.addEventListener("mouseleave",i),()=>{t.removeEventListener("mouseenter",r),t.removeEventListener("mouseleave",i),n.forEach(e=>e?.cancel())}},[l]),(0,t.jsxs)("svg",{ref:l,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...e,children:[(0,t.jsx)("path",{d:n,fill:"var(--sq-page, none)"}),(0,t.jsx)("path",{fillRule:"evenodd",d:"M6 2a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm.5 4a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1zm-.5 3.5A.5.5 0 0 1 6.5 9h7a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5zm.5 4.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1z",clipRule:"evenodd",fill:"var(--sq-page, currentColor)"}),(0,t.jsx)("path",{d:n,fill:"none",stroke:"var(--sq-ink, none)",strokeWidth:1.5,strokeLinejoin:"round"}),r.map(e=>(0,t.jsx)("path",{className:"form-row",d:e.d,fill:"none",stroke:e.paint,strokeWidth:e.width,strokeLinecap:e.cap,pathLength:1,strokeDasharray:"1 2"},e.d))]})}])},571559,e=>{"use strict";var t=e.i(843476),a=e.i(271645);let n=[{opacity:0,offset:0},{opacity:0,offset:.86},{opacity:1,offset:1}];e.s(["SignatureIcon",0,function({style:e,...r}){let s=(0,a.useRef)(null),l=(0,a.useId)(),i=`sig-mask-${l}`,o=`sig-path-${l}`;return(0,a.useEffect)(()=>{let e=s.current,t=e?.closest(".sq-tile"),a=e?.querySelector(".signature-pen"),r=e?.querySelector(".signature-ink");if(!e||!t||!a||!r||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let l=null,i=(e,t,s)=>{(l=a.animate([{strokeDashoffset:1.05*(1-e)},{strokeDashoffset:0}],{duration:t,easing:s})).onfinish=()=>{l=null},r.animate(n,{duration:t+140,easing:"linear"})},o=()=>{t.closest(".app-card-anchor")?.hasAttribute("data-suppress-hover")||(l?.cancel(),r.getAnimations().forEac
1h(e=>e.cancel()),i(0,700,"linear"))},c=()=>{if(!l)return;l.pause();let e=Math.min(1,Math.max(0,function(e){if("number"==typeof e)return e;let t=e?.value;return"number"==typeof t?t:0}(l.currentTime)/700));l.cancel(),l=null,r.getAnimations().forEach(e=>e.cancel()),e>.99||i(e,Math.round(120+580*(1-e)),"cubic-bezier(0.25, 0.25, 0.72, 1)")};return t.addEventListener("mouseenter",o),t.addEventListener("mouseleave",c),()=>{t.removeEventListener("mouseenter",o),t.removeEventListener("mouseleave",c),l?.cancel(),r.getAnimations().forEach(e=>e.cancel())}},[s]),(0,t.jsx)("svg",{ref:s,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",style:{overflow:"visible",...e},...r,children:(0,t.jsxs)("g",{transform:"translate(-0.5 -1.491) scale(0.375)",children:[(0,t.jsxs)("defs",{children:[(0,t.jsx)("path",{id:o,d:"M 1.1883 43.4869 L 13.6935 43.4869 C 13.4483 44.4300 13.3162 45.3542 13.3162 46.2030 C 13.3162 49.2397 15.0138 51.4088 18.5786 51.4088 C 22.9168 51.4088 26.4250 48.3532 28.6884 43.4869 L 54.8118 43.4869 C 55.4719 43.4869 56 42.9777 56 42.3175 C 56 41.6574 55.4719 41.1670 54.8118 41.1670 L 29.6315 41.1670 C 30.6877 38.0737 31.3290 34.4523 31.4611 30.5290 C 32.6494 30.2650 33.8941 30.1329 35.1769 30.1329 C 35.8371 30.1329 36.2141 30.4159 36.2141 30.9063 C 36.2141 32.5472 35.3276 33.8298 35.3276 35.4708 C 35.3276 36.9043 36.3841 37.7719 37.7608 37.7719 C 41.5896 37.7719 46.2108 31.2269 47.7385 31.2269 C 49.1342 31.2269 47.3990 37.1117 52.1522 37.1117 C 52.9256 37.1117 53.9253 36.9043 54.6986 36.4139 C 55.1513 36.0932 55.4719 35.6405 55.4719 35.0558 C 55.4719 34.3391 55.0192 33.7544 54.2648 33.7544 C 53.6046 33.7544 53.0577 34.3013 52.4164 34.3013 C 50.3792 34.3013 52.3218 28.0393 48.5687 28.0393 C 45.2868 28.0393 40.1561 34.4145 38.8548 34.4145 C 38.6852 34.4145 38.5531 34.3202 38.5531 34.0939 C 38.5531 33.4149 39.4017 31.8871 39.4017 30.3593 C 39.4017 28.4732 37.8361 27.2660 35.3844 27.2660 C 34.0451 27.2660 32.7248 27.3980 31.4611 27.6432 C 31.0461 17.7032 26.3307 9.8756 19.1256 9.8756 C 14.2782 9.8756 10.5436 14.0063 10.5436 19.2687 C 10.5436 25.4176 14.5423 30.6799 19.5217 34.1693 C 17.3149 36.3384 15.5985 38.8093 14.5423 41.1670 L 1.1883 41.1670 C .5281 41.1670 0 41.6574 0 42.3175 C 0 42.9777 .5281 43.4869 1.1883 43.4869 Z M 13.4106 19.2687 C 13.4106 15.5907 15.9003 12.7426 19.1256 12.7426 C 24.7841 12.7426 28.4432 19.7780 28.6130 28.4166 C 26.0101 29.3219 23.6335 30.6988 21.5776 32.3397 C 17.6544 29.6237 13.4106 25.1347 13.4106 19.2687 Z M .6413 37.1495 C 1.1317 37.6399 1.8673 37.6210 2.3765 37.1495 L 4.7342 34.7918 L 7.0919 37.1495 C 7.5823 37.6399 8.3368 37.6399 8.8272 37.1495 C 9.3176 36.6591 9.3176 35.9046 8.8272 35.4142 L 6.4695 33.0754 L 8.8272 30.7177 C 9.3176 30.2273 9.3176 29.4917 8.8272 29.0012 C 8.3368 28.4920 7.5823 28.5109 7.0919 29.0012 L 4.7342 31.3401 L 2.3765 29.0012 C 1.8673 28.4920 1.1317 28.4920 .6413 29.0012 C .1509 29.4917 .1509 30.2461 .6413 30.7177 L 2.9990 33.0754 L .6413 35.4142 C .1509 35.9235 .1509 36.6591 .6413 37.1495 Z M 23.6335 36.5459 C 23.8787 36.6591 24.1051 36.7156 24.3314 36.7156 C 25.1047 36.7156 25.6517 36.1121 25.6517 35.4708 C 25.6517 34.9992 25.4254 34.5466 24.8784 34.2825 C 24.6143 34.1505 24.3503 34.0184 24.0674 33.8675 C 25.4254 32.9056 26.9343 32.0568 28.5564 31.4155 C 28.3300 35.0558 27.6322 38.4132 26.5571 41.1670 L 17.5790 41.1670 C 18.5597 39.3185 20.0309 37.3758 21.8982 35.6594 C 22.4641 35.9800 23.0488 36.2630 23.6335 36.5459 Z M 16.2586 45.6560 C 16.2586 44.9959 16.3718 44.2603 16.6170 43.4869 L 25.4820 43.4869 C 23.7844 46.6180 21.5022 48.5418 18.8993 48.5418 C 17.0886 48.5418 16.2586 47.3536 16.2586 45.6560 Z"}),(0,t.jsx)("mask",{id:i,children:(0,t.jsx)("path",{className:"signature-pen",d:"M25.3 35.6C24.95 35.47 23.98 35.18 23.2 34.8C22.42 34.42 21.60 33.93 20.6 33.3C19.60 32.67 18.25 31.95 17.2 31C16.15 30.05 15.10 28.83 14.3 27.6C13.50 26.37 12.79 24.99 12.4 23.6C12.01 22.21 11.95 20.65 11.98 19.27C12.01 17.89 12.06 16.48 12.6 15.3C13.14 14.12 14.11 12.86 15.2 12.2C16.29 11.54 17.76 11.34 19.13 11.31C20.50 11.28 22.05 11.29 23.4 12C24.74 12.71 26.17 14.10 27.2 15.6C28.23 17.10 29.12 19.10 29.6 21C30.08 22.90 30.13 25.57 30.1 27C30.07 28.43 30.00 28.93 29.4 29.6C28.80 30.27 27.48 30.50 26.5 31C25.52 31.50 24.48 32.07 23.5 32.6C22.52 33.13 21.53 33.33 20.6 34.2C19.67 35.07 18.66 36.64 17.9 37.8C17.14 38.96 16.56 40.04 16.06 41.17C15.56 42.30 15.11 43.56 14.9 44.6C14.69 45.64 14.52 46.52 14.8 47.4C15.08 48.28 15.90 49.45 16.6 49.9C17.30 50.35 18.07 50.35 19 50.1C19.93 49.85 21.20 49.15 22.2 48.4C23.20 47.65 24.23 46.43 25 45.6C25.77 44.77 26.30 44.20 26.8 43.4C27.30 42.60 27.65 41.87 28 40.8C28.35 39.73 28.62 38.38 28.9 37C29.18 35.62 29.45 33.63 29.7 32.5C29.95 31.37 30.02 30.75 30.4 30.2C30.78 29.65 31.47 29.43 32 29.2C32.53 28.97 33.00 28.82 33.6 28.8C34.20 28.78 35.10 28.63 35.6 29.1C36.10 29.57 36.37 30.75 36.6 31.6C36.83 32.45 36.82 33.48 37 34.2C37.18 34.92 37.33 35.72 37.7 35.9C38.07 36.08 38.62 35.53 39.2 35.3C39.78 35.07 40.53 34.85 41.2 34.5C41.87 34.15 42.50 33.82 43.2 33.2C43.90 32.58 44.77 31.40 45.4 30.8
1C46.03 30.20 46.53 29.75 47 29.6C47.47 29.45 47.82 29.50 48.2 29.9C48.58 30.30 48.93 31.27 49.3 32C49.67 32.73 50.03 33.67 50.4 34.3C50.77 34.93 51.10 35.52 51.5 35.8C51.90 36.08 52.38 36.03 52.8 36C53.22 35.97 53.68 35.78 54 35.6C54.32 35.42 54.58 35.02 54.7 34.9",fill:"none",stroke:"#fff",strokeWidth:5,strokeLinecap:"round",strokeLinejoin:"round",pathLength:1,strokeDasharray:"1 2"})})]}),(0,t.jsx)("path",{d:"M .6413 37.1495 C 1.1317 37.6399 1.8673 37.6210 2.3765 37.1495 L 4.7342 34.7918 L 7.0919 37.1495 C 7.5823 37.6399 8.3368 37.6399 8.8272 37.1495 C 9.3176 36.6591 9.3176 35.9046 8.8272 35.4142 L 6.4695 33.0754 L 8.8272 30.7177 C 9.3176 30.2273 9.3176 29.4917 8.8272 29.0012 C 8.3368 28.4920 7.5823 28.5109 7.0919 29.0012 L 4.7342 31.3401 L 2.3765 29.0012 C 1.8673 28.4920 1.1317 28.4920 .6413 29.0012 C .1509 29.4917 .1509 30.2461 .6413 30.7177 L 2.9990 33.0754 L .6413 35.4142 C .1509 35.9235 .1509 36.6591 .6413 37.1495 Z"}),(0,t.jsx)("path",{d:"M1.1883 42.327H54.8118",fill:"none",stroke:"currentColor",strokeWidth:2.32,strokeLinecap:"round"}),(0,t.jsx)("g",{mask:`url(#${i})`,children:(0,t.jsx)("use",{href:`#${o}`})}),(0,t.jsx)("use",{className:"signature-ink",href:`#${o}`})]})})}])},249803,534385,e=>{"use strict";var t=e.i(843476),a=e.i(271645),n=e.i(476819),r=e.i(522016),s=e.i(618566),l=e.i(59377),i=e.i(420499),o=e.i(4320),c=e.i(182439);function d(e){return Math.max(0,Math.round(Math.abs(e)/6e4))}function u(e,t=25,n=20){let[r,s]=(0,a.useState)(()=>Date.now());return(0,a.useEffect)(()=>{let e=setInterval(()=>s(Date.now()),15e3);return()=>clearInterval(e)},[]),(0,a.useMemo)(()=>{let a,s,l=null,i=null;for(let a of e){if(a.start?.date&&!a.start?.dateTime)continue;let e=function(e){let t=e.start?.date,a=e.start?.dateTime;return t?new Date(t+"T12:00:00"):a?new Date(a):null}(a);if(!e)continue;let s=e.getTime(),o=function(e){let t=e.end?.date,a=e.end?.dateTime;return t?new Date(t+"T12:00:00"):a?new Date(a):null}(a);if(!((o&&o>e?o.getTime():s+36e5)<=r))if(s>r){if(s-r>60*t*1e3)continue;(!l||s<l.at)&&(l={ev:a,at:s})}else{if(r-s>60*n*1e3)continue;(!i||s>i.at)&&(i={ev:a,at:s})}}let o=l?{...l,phase:"upcoming"}:i?{...i,phase:"live"}:null;if(!o)return null;let{ev:c,at:u,phase:m}=o;return{event:c,joinUrl:function(e){if(e.hangoutLink)return e.hangoutLink;let t=e.conferenceData?.entryPoints?.find(e=>"video"===e.entryPointType||"meet"===e.entryPointType);return t?.uri??null}(c),phase:m,relative:(a=d(u-r))<1?"now":"live"===m?`${a}m ago`:`in ${a}m`,relativeCompact:(s=d(u-r))<1?"now":"live"===m?`${s}m`:`in ${s}m`,key:c.id??`${c.start?.dateTime??c.start?.date??""}-${c.summary??""}`}},[e,r,t,n])}e.s(["useMeetingPill",0,u],534385);var m=e.i(428605),h=e.i(407909),p=e.i(852861),x=e.i(597576),f=e.i(210578),g=e.i(213788),v=e.i(572377),j=e.i(941388),b=e.i(278716),y=e.i(87316),w=e.i(332102),C=e.i(174886),N=e.i(537847),k=e.i(643531),_=e.i(846696),S=e.i(324973),T=e.i(776036),L=e.i(773993);let M={email:v.MailProviderSquircle,linkedin:v.LinkedInSquircle,linkedin_comments:v.LinkedInCommentsSquircle,x:v.XSquircle,reddit:v.RedditSquircle,whatsapp:v.WhatsAppSquircle,sms:v.SmsSquircle,imessage:v.IMessageSquircle,messages:v.IMessageSquircle,slack:v.SlackSquircle,chat:v.ChatSquircle},P="flex-1 min-h-0";function $({children:e}){let n=(0,a.useRef)(null),[r,s]=(0,a.useState)(!1);return(0,a.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let t=null,a=new ResizeObserver(()=>r()),r=()=>{let n=e.lastElementChild;if(n!==t&&(t&&a.unobserve(t),t=n,n&&a.observe(n)),!n)return void s(!1);let r=e.getBoundingClientRect();s(8>=Math.abs(n.getBoundingClientRect().bottom-r.bottom))};r(),e.addEventListener("scroll",r,{passive:!0}),a.observe(e);let l=new MutationObserver(r);return l.observe(e,{childList:!0}),()=>{e.removeEventListener("scroll",r),a.disconnect(),l.disconnect()}},[]),(0,t.jsx)("ul",{ref:n,"data-flush-bottom":r?"":void 0,className:"flex-1 min-h-0 overflow-y-auto scrollbar-none flex flex-col [&>li]:border-b [&>li]:border-border [&>li:last-child]:border-b-0",children:e})}let D={"/inbox":"/inbox?compose=1","/people":"/people?create=1","/companies":"/companies?create=1","/contracts":"/contracts/new","/templates":"/templates/new","/products":"/products","/deals":"/deals?create=1","/customers":"/customers","/sequences":"/sequences","/tasks":"/tasks","/vi
1deos":"/videos?record=1","/calendar":"/calendar?create=1","/docs":"/docs","/plans":"/plans","/skills":"/skills"},E={"/people":"people","/companies":"companies","/contracts":"contracts","/templates":"templates","/products":"products","/deals":"deals","/customers":"customers","/sequences":"sequences","/tasks":"tasks","/videos":"videos","/docs":"docs","/plans":"plans","/skills":"skills"},q={"/inbox":"Compose","/people":"New person","/companies":"New company","/contracts":"New contract","/templates":"New template","/products":"New product","/deals":"New deal","/customers":"New customer","/sequences":"New sequence","/tasks":"New task","/videos":"Record video","/calendar":"Schedule meeting","/docs":"New doc","/plans":"New plan","/skills":"New skill"};function I({href:e,title:a}){return(0,t.jsx)(r.default,{href:e,className:"absolute bottom-2 right-2 flex h-9 w-9 items-center justify-center rounded-full bg-white dark:bg-popover border border-black/25 dark:border-white/20 text-foreground shadow-[0_1px_3px_rgba(0,0,0,0.2)] transition-transform hover:scale-110",title:a,children:(0,t.jsx)(j.Plus,{className:"h-4 w-4",strokeWidth:2.25})})}let A=40/60;function R({createUrl:e,createTitle:s}){let l,i,o,d,{todayEvents:m,todayEventsReady:h}=(0,c.useSidebarPreload)(),{displayHours:p,positionedEvents:x,currentTimePx:f,hasAnyEvents:g}=(0,a.useMemo)(()=>{let e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),0,0),a=23-e.getHours(),n=new Date(t.getTime()+(a+1)*36e5),r=[];for(let t=0;t<=a;t++)r.push(e.getHours()+t);let s=[];for(let e of m){if(e.start?.date&&!e.start?.dateTime)continue;let a=function(e){let t=e.start?.date,a=e.start?.dateTime;return t?new Date(t+"T12:00:00"):a?new Date(a):null}(e),r=function(e){let t=e.end?.date,a=e.end?.dateTime;return t?new Date(t+"T12:00:00"):a?new Date(a):null}(e);if(!a)continue;let l=r&&r>a?r:new Date(a.getTime()+36e5);if(l<=t||a>=n)continue;let i=a>=t,o=a<t?t:a,c=(o.getTime()-t.getTime())/6e4*A,d=Math.max(24,((l>n?n:l).getTime()-o.getTime())/6e4*A);s.push({ev:e,topPx:c,heightPx:d,startedInView:i})}s.sort((e,t)=>e.topPx-t.topPx);let l=(0,T.computeOverlapColumns)(s),i=s.map((e,t)=>({...e,colIndex:l[t].colIndex,totalCols:l[t].totalCols}));return{displayHours:r,positionedEvents:i,currentTimePx:(e.getTime()-t.getTime())/6e4*A,hasAnyEvents:s.length>0}},[m]),v=u(m);if(!h)return(0,t.jsxs)("div",{className:`relative flex flex-col items-center justify-center ${P} text-xs text-muted-foreground`,children:["Loading…",(0,t.jsx)(I,{href:e,title:s})]});let j=40*p.length;return(0,t.jsxs)("div",{className:`relative flex flex-col ${P}`,children:[v&&(i=(l=v.event.summary||"meeting").length>24?l.slice(0,24)+"…":l,o="flex w-full items-center justify-center gap-1.5 rounded-[20px] [corner-shape:squircle] border border-black/25 dark:border-white/20 bg-white dark:bg-popover px-4 py-2 text-foreground shadow-[0_1px_2px_rgba(0,0,0,0.07)] transition-[transform,box-shadow] duration-200 hover:scale-[1.01] hover:shadow-[0_2px_5px_rgba(0,0,0,0.12)] text-[13px] font-medium",d=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"min-w-0 truncate",children:v.joinUrl?`Join ${i}`:i}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:v.relative})]}),(0,t.jsx)("div",{className:"shrink-0 px-2 pt-2 pb-3",children:v.joinUrl?(0,t.jsx)("a",{href:v.joinUrl,target:"_blank",rel:"noopener noreferrer",className:o,children:d}):(0,t.jsx)(r.default,{href:"/calendar",className:o,children:d})})),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-none",children:(0,t.jsxs)("div",{className:"relative pl-2",style:{minHeight:(0,n.designPx)(j)},children:[f>=0&&f<=j&&(0,t.jsxs)("div",{className:"absolute left-12 right-0 z-10 flex items-center pointer-events-none",style:{top:(0,n.designPx)(f)},children:[(0,t.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full bg-foreground
1/70"}),(0,t.jsx)("span",{className:"h-0.5 flex-1 min-w-0 bg-foreground/50 -ml-px"})]}),p.map((e,a)=>(0,t.jsx)("div",{className:"absolute left-0 right-0 h-px bg-border pointer-events-none",style:{top:(0,n.designPx)(40*a)}},`line-${e}`)),(0,t.jsx)("div",{className:"relative flex flex-col",children:p.map(e=>{let a=new Date;a.setHours(e,0,0,0);let r=a.toLocaleTimeString("en-US",{hour:"numeric"});return(0,t.jsx)("div",{className:"flex items-start shrink-0",style:{height:(0,n.designPx)(40)},children:(0,t.jsx)("span",{className:"w-12 shrink-0 pt-1 text-[10px] text-foreground/80 tabular-nums pr-2 relative z-[1]",children:r})},e)})}),(0,t.jsx)("div",{className:"absolute left-14 top-0 right-2 bottom-0",children:x.map(({ev:e,topPx:a,heightPx:s,startedInView:l,colIndex:i,totalCols:o})=>{let c=function(e){if(e.hangoutLink)return e.hangoutLink;let t=e.conferenceData?.entryPoints?.find(e=>"video"===e.entryPointType||"meet"===e.entryPointType);return t?.uri??null}(e),d=+(o>1),u=o>1?(100-d*(o-1))/o:100;return(0,t.jsxs)(r.default,{href:"/calendar",className:`absolute flex items-center gap-1.5 px-2 overflow-hidden transition-colors group box-border bg-stone-200 hover:bg-stone-300 dark:bg-stone-700 dark:hover:bg-stone-600 ${l?"rounded-sm":"rounded-b-sm"}`,style:{top:(0,n.designPx)(a),height:(0,n.designPx)(Math.max(20,s)),left:`${o>1?i*(u+d):0}%`,width:`${u}%`},children:[(0,t.jsx)("span",{className:"text-[11px] truncate flex-1 min-w-0 text-foreground/90 group-hover:text-foreground",children:e.summary||"(No title)"}),!!c&&(0,t.jsx)(b.Video,{className:"h-3 w-3 shrink-0 text-foreground/60 group-hover:text-foreground/80",strokeWidth:2})]},e.id??Math.random())})})]})}),(0,t.jsx)(I,{href:e,title:s})]})}function U(e){if(!e)return"";let t=new Date(e),a=new Date().getTime()-t.getTime();if(a<0){let e=-a,n=Math.floor(e/6e4),r=Math.floor(e/36e5),s=Math.floor(e/864e5);return n<1?"now":n<60?`in ${n}m`:r<24?`in ${r}h`:s<7?`in ${s}d`:t.toLocaleDateString("en-GB",{day:"numeric",month:"short"})}let n=Math.floor(a/6e4),r=Math.floor(a/36e5),s=Math.floor(a/864e5);return n<1?"now":n<60?`${n}m`:r<24?`${r}h`:s<7?`${s}d`:t.toLocaleDateString("en-GB",{day:"numeric",month:"short"})}function O({href:e,label:a,icon:n}){let r="/home"===e,s="/inbox"===e,l="/calendar"===e,o=(0,i.getRecentPathsForSection)(e),d=D[e]??e,u=q[e]??`New ${a}`,m=E[e],{recentBySection:h,entityPreviews:p}=(0,c.useSidebarPreload)();if("/secrets"===e)return(0,t.jsx)(V,{});if(r)return(0,t.jsx)(Y,{});if(s)return(0,t.jsx)(z,{createUrl:d,createTitle:u});if(l)return(0,t.jsx)(R,{createUrl:d,createTitle:u});let x="/tasks"===e,f=o.length>0&&o.every(e=>e.path in p&&p[e.path]?.label!=null);if(o.length>0&&f&&!x)return(0,t.jsx)(H,{paths:o,sectionLabel:a,Icon:n,createUrl:d,createTitle:u,preloadedPreviews:p});if(m){let e=h[m];return(0,t.jsx)(K,{section:m,sectionLabel:a,Icon:n,createUrl:d,createTitle:u,preloadedItems:e})}return o.length>0&&!x?(0,t.jsx)(H,{paths:o,sectionLabel:a,Icon:n,createUrl:d,createTitle:u,preloadedPreviews:p}):(0,t.jsx)(X,{label:a,Icon:n,createUrl:d,createTitle:u})}function z({createUrl:e,createTitle:a}){let{recentInboxMessages:n,recentInboxReady:s,entityPreviews:l,inboxPreviewsPending:i}=(0,c.useSidebarPreload)();return s||0!==n.length?0===n.length?(0,t.jsxs)("div",{className:`relative flex flex-col items-center justify-center ${P} text-xs text-muted-foreground`,children:["No recent messages",(0,t.jsx)(I,{href:e,title:a})]}):(0,t.jsxs)("div",{className:`relative flex flex-col ${P}`,children:[(0,t.jsx)($,{children:n.map(e=>{let a=e.contact_name||e.company_name||"Unknown",n=(e.snippet??"").trim(),s=(0,x.feedSenderPrefix)(e),o=!e.is_read||(e.unread_count??0)>0,c=!!e.contact_image_url,d=!!(e.company_logo_url||e.company_domain),u=M[e.channel],m=e.contact_id?l[`/people/${e.contact_id}`]?.job_title:void 0,p=!m&&!!e.contact_id&&i;return(0,t.jsx)("li",{children:(0,t.jsxs)(r.default,{href:`/inbox?openConvo=${encodeURIComponent(e.id)}`,onClick:()=>{try{sessionStorage.setItem("inbox:openConvo",JSON.stringify(e))}catch{}},"data-slot":"list-row",className:"group flex items-center gap-2 px-2 py-1.5 rounded-[4px] hover:bg-accent/80 m-1",children:[(0,t.jsxs)("div",{className:"shrink-0 relative",children:[c?(0,t.jsx)(f.ContactAvatar,{imageUrl:e.contact_image_url,name:a,size:"xs",className:"!h-9 !w-9 !text-[11px] squircle"}):d?(0,t.jsx)(g.CompanyLogo,{logoUrl:e.company_logo_url,domain:e.company_domain,companyName:e.company_name??void 0,size:"xs",className:"!h-9 !w-9 squircle"}):(0,t.jsx)("div",{className:"h-9 w-9 squircle avatar-border bg-muted group-hover:bg-white dark:group-hover:bg-muted flex items-center justify-center text-[10px] font-medium text-muted-foreground",children:a.charAt(0).toUpperCase()}),(0,t.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5",children:(0,t.jsx)(u,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-1",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 min-w-0 truncate",children:[(0,t.jsx)("span",{className:`text-[11px] truncate ${o?"font-semibold":"font-medium"}`,children:a}),d&&e.contact_name&&(0,t.jsx)(g.CompanyLogo,{logoUrl:e.company_logo_url,domain:e.company_domain,companyName:e.company_name??void 0,size:"xs",className:"!h-3.5 !w-3.5 !text-[7px] squircle shrink-0"})]}),(0,t.jsxs)("span",{className:"flex items-center gap-1 shrink-0",children:[o&&(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[#A6BFD0] dark:bg-[#7AC8F0]"}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:U(e.last_message_at)})]})]}),(m||p)&&(0,t.jsx)("div",{className:"text-[10px] truncate leading-snug text-muted-foreground min-h-[14px]",children:m}),n&&(0,t.jsxs)("div",{className:`text-[10px] truncate mt-0.5 leading-snug ${o?"text-foreground
1/70":"text-muted-foreground"}`,children:[s&&(0,t.jsxs)("span",{className:"text-muted-foreground/80",children:[s,": "]}),(0,t.jsx)(h.FormattedText,{text:n,preview:!0})]})]})]})},`${e.channel}-${e.id}`)})}),(0,t.jsx)(I,{href:e,title:a})]}):(0,t.jsxs)("div",{className:`relative flex flex-col items-center justify-center ${P} text-xs text-muted-foreground`,children:["Loading…",(0,t.jsx)(I,{href:e,title:a})]})}function W({item:e,fallbackIcon:a}){let n=e.path.startsWith("/videos/");if(n&&e.thumbnail_url)return(0,t.jsx)("div",{className:"h-8 w-12 shrink-0 rounded-[4px] overflow-hidden bg-muted",children:(0,t.jsx)("img",{src:e.thumbnail_url,alt:e.label,className:"h-full w-full object-cover"})});if(n)return(0,t.jsx)("div",{className:"h-8 w-12 shrink-0 rounded-[4px] bg-muted flex items-center justify-center",children:(0,t.jsx)(a,{className:"h-3.5 w-3.5 text-muted-foreground",strokeWidth:1.8})});let r=e.image_url,s=e.logo_url||e.domain,l=e.path.startsWith("/people/");return r?(0,t.jsx)(f.ContactAvatar,{imageUrl:e.image_url,name:e.label,size:"xs",className:"!h-9 !w-9 !text-[11px] squircle"}):l&&e.label?(0,t.jsx)("div",{className:"h-9 w-9 shrink-0 squircle avatar-border bg-muted group-hover:bg-white dark:group-hover:bg-muted flex items-center justify-center text-[11px] font-medium text-muted-foreground",children:e.label.split(" ").map(e=>e.charAt(0)).join("").slice(0,2).toUpperCase()}):s?(0,t.jsx)(g.CompanyLogo,{logoUrl:e.logo_url,domain:e.domain,companyName:e.label,size:"xs",className:"!h-9 !w-9 squircle"}):(0,t.jsx)("div",{className:"h-8 w-8 shrink-0 squircle avatar-border bg-muted group-hover:bg-white dark:group-hover:bg-muted flex items-center justify-center",children:(0,t.jsx)(a,{className:"h-3.5 w-3.5 text-muted-foreground",strokeWidth:1.8})})}function F(e,t){return e.map(e=>{let a=t[e.path];return{...e,label:a?.label??"-",image_url:a?.image_url??null,logo_url:a?.logo_url??null,domain:a?.domain??null,job_title:a?.job_title,company_name:a?.company_name,company_logo_url:a?.company_logo_url??null,location:a?.location??null,industry:a?.industry??null,website_url:a?.website_url??null,employee_range:a?.employee_range??null,thumbnail_url:a?.thumbnail_url??null,creator_name:a?.creator_name,creator_avatar:a?.creator_avatar??null,is_meeting:a?.is_meeting,finance_kind:a?.finance_kind,finance_amount:a?.finance_amount,finance_currency:a?.finance_currency??null}})}function B({count:e}){return(0,t.jsx)("ul",{className:"flex-1 min-h-0 flex flex-col [&>li]:border-b [&>li]:border-border [&>li:last-child]:border-b-0",children:Array.from({length:Math.min(e,5)}).map((e,a)=>(0,t.jsxs)("li",{className:"flex gap-2 px-2 py-1.5 m-1",children:[(0,t.jsx)("div",{className:"h-7 w-7 shrink-0 rounded-md bg-muted/60 animate-pulse"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-1.5",children:[(0,t.jsx)("div",{className:"h-3 w-[75%] rounded bg-muted/60 animate-pulse"}),(0,t.jsx)("div",{className:"h-2.5 w-1/3 rounded bg-muted/40 animate-pulse"})]})]},a))})}function H({paths:e,sectionLabel:n,Icon:r,createUrl:s,createTitle:l,preloadedPreviews:i={}}){let o=e.map(e=>e.path).join(","),c=o&&e.every(e=>e.path in i&&i[e.path]?.label!=null),[d,u]=(0,a.useState)(()=>c?F(e,i):null);return((0,a.useEffect)(()=>{if(0!==e.length){if(c)return void u(F(e,i));fetch("/api/sidebar/entity-previews",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:e.map(e=>e.path)})}).then(e=>e.ok?e.json():{}).then(t=>{u(F(e,t??{}))}).catch(()=>u([]))}},[o]),null===d)?(0,t.jsxs)("div",{className:`relative flex flex-col ${P}`,children:[(0,t.jsx)(B,{count:e.length}),(0,t.jsx)(I,{href:s,title:l})]}):0===d.length?(0,t.jsxs)("div",{className:`relative flex flex-col items-center justify-center ${P} text-xs text-muted-foreground`,children:["Could not load",(0,t.jsx)(I,{href:s,title:l})]}):(0,t.jsx)(J,{paths:d,sectionLabel:n,Icon:r,createUrl:s,createTitle:l})}function J({paths:e,sectionLabel:a,Icon:n,createUrl:s,createTitle:l}){let i=(0,o.useWorkspaceCurrency)();return(0,t.jsxs)("div",{className:`relative flex flex-col ${P}`,children:[(0,t.jsx)($,{children:e.map((e,a)=>(0,t.jsx)("li",{children:(0,t.jsxs)(r.default,{href:e.path,"data-slot":"list-row",className:"group flex items-center gap-2 px-2 py-1.5 rounded-[4px] hover:bg-accent/80 m-1",children:[(0,t.jsx)("div",{className:"shrink-0",children:(0,t.jsx)(W,{item:e,fallbackIcon:n})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-1",children:[(0,t.jsx)("span",{className:"font-medium text-[11px] truncate",children:e.label}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground shrink-0",children:U(new Date(e.ts).toISOString())})]}),e.path.startsWith("/people/")&&(0,t.jsxs)(t.Fragment,{children:[e.job_title&&(0,t.jsx)("div",{className:"text-[10px] text-muted-foreground truncate mt-0.5 leading-snug",children:e.job_title}),(e.company_name||e.location)&&(0,t.jsxs)("div",{className:"flex items-center gap-1 mt-0.5",children:[(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground truncate leading-snug",children:[e.company_name,e.location].filter(
1Boolean).join(" · ")}),e.company_name&&(0,t.jsx)(g.CompanyLogo,{logoUrl:e.company_logo_url,domain:e.domain,companyName:e.company_name??void 0,size:"xs",className:"!h-3.5 !w-3.5 !text-[7px] squircle shrink-0"})]})]}),(e.path.startsWith("/companies/")||e.path.startsWith("/customers/"))&&(0,t.jsxs)(t.Fragment,{children:[e.industry&&(0,t.jsx)("div",{className:"text-[10px] text-muted-foreground truncate mt-0.5 leading-snug",children:e.industry}),e.employee_range&&(0,t.jsxs)("div",{className:"text-[10px] text-muted-foreground truncate mt-0.5 leading-snug",children:[e.employee_range," employees"]})]}),e.path.startsWith("/contracts/")&&e.company_name&&(0,t.jsxs)("div",{className:"flex items-center gap-1 mt-0.5",children:[(0,t.jsx)(g.CompanyLogo,{logoUrl:e.logo_url,domain:e.domain,companyName:e.company_name??void 0,size:"xs",className:"!h-3.5 !w-3.5 !text-[7px] squircle shrink-0"}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground truncate leading-snug",children:e.company_name})]}),e.path.startsWith("/videos/")&&(e.creator_name||e.is_meeting)&&(0,t.jsxs)("div",{className:"flex items-center gap-1 mt-0.5",children:[e.creator_name&&(e.creator_avatar?(0,t.jsx)("img",{src:e.creator_avatar,alt:"",className:"h-3.5 w-3.5 rounded-[4px] object-cover shrink-0"}):(0,t.jsx)("div",{className:"h-3.5 w-3.5 rounded-[4px] bg-muted flex items-center justify-center shrink-0",children:(0,t.jsx)("span",{className:"text-[7px] font-medium text-muted-foreground",children:e.creator_name.charAt(0).toUpperCase()})})),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground truncate leading-snug",children:[e.creator_name,e.is_meeting?"Meeting":null].filter(Boolean).join(" · ")})]}),e.path.startsWith("/finance/")&&e.finance_kind&&(0,t.jsxs)("div",{className:"text-[10px] truncate mt-0.5 leading-snug",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"income"===e.finance_kind?"Income":"Expense"}),null!=e.finance_amount&&(0,t.jsxs)("span",{className:`font-medium ${"income"===e.finance_kind?"text-emerald-600 dark:text-emerald-400":"text-foreground/70"}`,children:[" · ",function(e,t){let a=t||"USD";try{return new Intl.NumberFormat("en-US",{style:"currency",currency:a,maximumFractionDigits:0}).format(e)}catch{return`${a} ${Math.round(e)}`}}(e.finance_amount,e.finance_currency??i)]})]})]})]})},`${e.path}-${a}`))}),(0,t.jsx)(I,{href:s,title:l})]})}function K({section:e,sectionLabel:n,Icon:r,createUrl:s,createTitle:l,preloadedItems:i}){let o=void 0!==i,[c,d]=(0,a.useState)(()=>(i??[]).map(e=>({...e,ts:e.ts??Date.now()}))),[u,m]=(0,a.useState)(!o);return((0,a.useEffect)(()=>{if(o){d((i??[]).map(e=>({...e,ts:e.ts??Date.now()}))),m(!1);return}fetch(`/api/sidebar/recent?section=${encodeURIComponent(e)}&limit=5`).then(e=>e.ok?e.json():[]).then(e=>{d((Array.isArray(e)?e:[]).map(e=>({path:e.path,label:e.label,ts:e.ts??Date.now(),image_url:e.image_url??null,logo_url:e.logo_url??null,domain:e.domain??null,job_title:e.job_title,company_name:e.company_name,company_logo_url:e.company_logo_url??null,location:e.location??null,industry:e.industry??null,website_url:e.website_url??null,employee_range:e.employee_range??null,thumbnail_url:e.thumbnail_url??null,creator_name:e.creator_name,creator_avatar:e.creator_avatar??null,is_meeting:e.is_meeting})))}).catch(()=>d([])).finally(()=>m(!1))},[e,i]),u)?(0,t.jsxs)("div",{className:`relative flex flex-col items-center justify-center ${P} text-xs text-muted-foreground`,children:["Loading…",(0,t.jsx)(I,{href:s,title:l})]}):0===c.length?(0,t.jsx)(X,{label:n,Icon:r,createUrl:s,createTitle:l}):(0,t.jsx)(J,{paths:c,sectionLabel:n,Icon:r,createUrl:s,createTitle:l})}function Y(){let{recentThreads:e,todayEvents:n,todayEventsReady:s,recentThreadsReady:l}=(0,c.useSidebarPreload)(),[i,o]=(0,a.useState)(null),[d,u]=(0,a.useState)(!1);(0,a.useEffect)(()=>{fetch("/api/tasks?status=not_started").then(e=>e.ok?e.json():[]).then(e=>{o((Array.isArray(e)?e:[])[0]??null)}).catch(()=>o(null)).finally(()=>u(!0))},[]);let p=Date.now(),x=n.filter(e=>{let t=e.start?.dateTime;return!!t&&new Date(t).getTime()>p}).sort((e,t)=>
1new Date(e.start.dateTime).getTime()-new Date(t.start.dateTime).getTime())[0]??null,v=x?null:n.filter(e=>{let t=e.start?.dateTime,a=e.end?.dateTime;if(!t||!a)return!1;let n=new Date(t).getTime(),r=new Date(a).getTime();return n<=p&&r>p}).sort((e,t)=>new Date(e.start.dateTime).getTime()-new Date(t.start.dateTime).getTime())[0]??null,j=x??v,b=e[0]??null;return s||l||d?j||b||i?(0,t.jsx)("div",{className:`relative flex flex-col ${P}`,children:(0,t.jsxs)($,{children:[j&&(0,t.jsx)("li",{children:(0,t.jsxs)(r.default,{href:"/calendar","data-slot":"list-row",className:"group flex items-center gap-2 px-2 py-1.5 rounded-[4px] hover:bg-accent/80 m-1",children:[(0,t.jsx)("div",{className:"shrink-0",children:(0,t.jsx)("div",{className:"h-9 w-9 squircle avatar-border bg-muted group-hover:bg-white dark:group-hover:bg-muted flex items-center justify-center",children:(0,t.jsx)(y.Calendar,{className:"h-4 w-4 text-muted-foreground",strokeWidth:1.75})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-1",children:[(0,t.jsx)("span",{className:"font-medium text-[11px] truncate",children:j.summary??"(No title)"}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground shrink-0",children:j.start?.dateTime?new Date(j.start.dateTime).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}):"All day"})]}),(0,t.jsx)("div",{className:"text-[10px] text-muted-foreground truncate mt-0.5 leading-snug",children:x?"Next meeting":"Happening now"})]})]})}),b&&(0,t.jsx)("li",{children:(0,t.jsxs)(r.default,{href:`/inbox?threadId=${encodeURIComponent(b.id)}`,"data-slot":"list-row",className:"group flex items-center gap-2 px-2 py-1.5 rounded-[4px] hover:bg-accent/80 m-1",children:[(0,t.jsx)("div",{className:"shrink-0",children:b.contact?.image_url||b.contact?.name?(0,t.jsx)(f.ContactAvatar,{imageUrl:b.contact?.image_url,name:(0,m.decodeHtmlEntities)(b.contact?.name??""),size:"xs",className:"!h-9 !w-9 !text-[11px] squircle"}):b.company?.logo_url||b.company?.domain?(0,t.jsx)(g.CompanyLogo,{logoUrl:b.company?.logo_url,domain:b.company?.domain,companyName:b.company?.name,size:"xs",className:"!h-9 !w-9 squircle"}):(0,t.jsx)("div",{className:"h-9 w-9 squircle avatar-border bg-muted group-hover:bg-white dark:group-hover:bg-muted flex items-center justify-center",children:(0,t.jsx)(w.Inbox,{className:"h-4 w-4 text-muted-foreground",strokeWidth:1.75})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"flex items-center justify-between gap-1",children:(0,t.jsx)("span",{className:"font-medium text-[11px] truncate",children:(0,m.decodeHtmlEntities)(b.subject??"")||"(No subject)"})}),(0,t.jsx)("div",{className:"text-[10px] text-muted-foreground truncate mt-0.5 leading-snug",children:(0,t.jsx)(h.FormattedText,{text:b.snippet??"",preview:!0})})]})]})}),i&&(0,t.jsx)("li",{children:(0,t.jsxs)(r.default,{href:`/tasks/${i.id}`,"data-slot":"list-row",className:"group flex items-center gap-2 px-2 py-1.5 rounded-[4px] hover:bg-accent/80 m-1",children:[(0,t.jsx)("div",{className:"shrink-0",children:(0,t.jsx)("div",{className:"h-9 w-9 squircle avatar-border bg-muted group-hover:bg-white dark:group-hover:bg-muted flex items-center justify-center",children:(0,t.jsx)(S.TasksIcon,{className:"h-4 w-4 text-muted-foreground",strokeWidth:1.75})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-1",children:[(0,t.jsx)("span",{className:"font-medium text-[11px] truncate",children:i.title||"Untitled task"}),i.due_at&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground shrink-0",children:U(i.due_at)})]}),(0,t.jsx)("div",{className:"text-[10px] text-muted-foreground truncate mt-0.5 leading-snug",children:"Next task"})]})]})})]})}):(0,t.jsx)("div",{className:`relative flex flex-col items-center justify-center ${P} px-3 text-center`,children:(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"All clear for today"})}):(0,t.jsx)("div",{className:`relative flex flex-col items-center justify-center ${P} text-xs text-muted-foreground`,children:"Loading…"})}function Z({title:e,idleIcon:n,onCopy:r}){let[s,l]=(0,a.useState)(!1);return(0,t.jsx)("button",{type:"button",title:e,"aria-label":e,onClick:async e=>{e.preventDefault(),e.stopPropagation(),await r()&&(l(!0),setTimeout(()=>l(!1),1200))},className:"group/btn flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-white hover:text-foreground hover:shadow-sm hover:ring-1 hover:ring-black/10 dark:hover:bg-popover dark:hover:ring-white/15",children:s?(0,t.jsx)(k.Check,{className:"size-3.5 text-success"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"group-hover/btn:hidden",children:n}),(0,t.jsx)(C.Copy,{className:"hidden size-3.5 group-hover/btn:block"})]})})}function V(){let[e,n]=(0,a.useState)(null);async function s(e,t){try{return await navigator.clipboard.writeText(e),_.toast.success(t),!0}catch{return _.toast.error("Could not copy"),!1}}async function l(e){try{let t=await fetch(`/api/vault/${e}/reveal`);if(!t.ok)return _.toast.error("Could not copy the password"),!1;let{password:a}=await t.json();return s(a,"Password copied")}catch{return _.toast.error("Could not copy the password"),!1}}return((0,a.useEffect)(()=>{let e=!0;return fetch("/api/vault").then(e=>e.ok?e.json():{items:[]}).then(t=>e&&n(t.items??[])).catch(()=>e&&n([])),()=>{e=!1}},[]),null===e)?(0,t.jsxs)("div",{className:`relative flex items-center justify-center ${P} text-xs text-muted-foreground`,children:["Loading…",(0,t.jsx)(I,{href:"/secrets",title:"Add a password"})]}):0===e.length?(0,t.jsxs)("div",{className:`relative flex flex-col items-center justify-center ${P} px-3 text-center`,children:[(0,t.jsx)("div",{className:"mx-auto mb-2 flex h-10 w-10 items-center justify-center squircle avatar-border bg-muted",children:(0,t.jsx)(N.KeyRound,{className:"h-5 w-5 text-muted-foreground",strokeWidth:1.5})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"No passwords yet"}),(0,t.jsx)(I,{href:"/secrets",title:"Add a password"})]}):(0,t.jsxs)("div",{className:`relative flex flex-col ${P}`,children:[(0,t.jsx)($,{children:e.map(e=>{let a=function(e){if(!e)return null;try{let t=new URL(e.startsWith("http")?e:`https://${e}`).hostname;return(0,p.getBaseDomain)(t)}catch{return null}}(e.url);return(0,t.jsx)("li",{children:(0,t.jsxs)(r.default,{href:`/secrets?open=${encodeURIComponent(e.id)}`,"data-slot":"list-row",className:"group/row m-1 flex items-center gap-2 rounded-[4px] px-2 py-1.5 hover:bg-accent/80",children:[a?(0,t.jsx)(g.CompanyLogo,{logoUrl:null,domain:a,companyName:e.label,size:"xs",className:"!h-6 !w-6 squircle shrink-0"}):(0,t.jsx)("span",{className:"flex size-6 shrink-0 items-center justify-center squircle bg-muted text-muted-foreground group-hover/row:bg-white dark:group-hover/row:bg-popover",children:(0,t.jsx)(N.KeyRound,{className:"size-3"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-[11px] font-medium",children:e.label}),e.username&&(0,t.jsx)("p",{className:"truncate text-[10px] leading-snug text-muted-foreground",children:e.username})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.username&&(0,t.jsx)(Z,{title:"Copy username",idleIcon:(0,t.jsx)(L.PeopleIcon,{className:"size-3.5"}),onCopy:()=>s(e.username,"Username copied")}),(0,t.jsx)(Z,{title:"Copy password",idleIcon:(0,t.jsx)(N.KeyRound,{className:"size-3.5"}),onCopy:()=>l(e.id)})]})]})},e.id)})}),(0,t.jsx)(I,{href:"/secrets",title:"Add a password"})]})}function X({label:e,Icon:a,createUrl:n,createTitle:r}){return(0,t.jsxs)("div",{className:`relative flex flex-col items-center justify-center ${P} px-3 text-center`,children:[(0,t.jsx)("div",{className:"h-10 w-10 mx-auto mb-2 squircle avatar-border bg-muted flex items-center justify-center",children:(0,t.jsx)(a,{className:"h-5 w-5 text-muted-foreground",strokeWidth:1.5})}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["No recent ",e.toLowerCase()," viewed"]}),(0,t.jsx)(I,{href:n,title:r})]})}e.s(["AppCardHoverPopover",0,function({href:e,label:n,icon:r,active:i=!1,children:o,body:c}){let d=(0,s.useRouter)(),[u,m]=(0,a.useState)(!1),[h,p]=(0,a.useState)(!1),x=(0,a.useRef)(null),f=(0,a.useRef)(null),g=(0,a.useRef)(!1),v=(0,a.useCallback)(()=>{x.current&&(clearTimeout(x.current),x.current=null),f.current&&(clearTimeout(f.current),f.current=null)},[]),j=(0,a.useCallback)(()=>{v(),x.current=setTimeout(()=>m(!0),300)},[v]),b=(0,a.useCallback)(()=>{v(),f.current=setTimeout(()=>m(!1),100)},[v]),y=(0,a.useCallback)(()=>
1{if(!h){if(!g.current&&e){g.current=!0;try{d.prefetch(e)}catch{}}f.current&&(clearTimeout(f.current),f.current=null),j()}},[j,h,d,e]),w=(0,a.useCallback)(()=>{p(!1),x.current&&(clearTimeout(x.current),x.current=null),b()},[b]),C=(0,a.useCallback)(e=>{"mouse"===e.pointerType&&(p(!0),v(),m(!1))},[v]);return(0,a.useEffect)(()=>()=>v(),[v]),(0,t.jsxs)(l.Popover,{open:u,onOpenChange:m,children:[(0,t.jsx)(l.PopoverAnchor,{asChild:!0,children:(0,t.jsx)("div",{className:`relative app-card-anchor${i?" active":""}`,"data-suppress-hover":h?"":void 0,onMouseEnter:y,onMouseLeave:w,onPointerDownCapture:C,children:o})}),(0,t.jsxs)(l.PopoverContent,{side:"right",sideOffset:4,align:"start",alignOffset:48,onMouseEnter:y,onMouseLeave:w,shellClassName:"min-w-0 origin-top-left [backface-visibility:hidden] data-[side=right]:!slide-in-from-left-0 data-[state=open]:!zoom-in-0 data-[state=open]:!fade-in-0 animation-duration-100 [--tw-ease:cubic-bezier(0.16,1,0.3,1)] font-sans shadow-[0_2px_8px_rgba(0,0,0,0.08),0_12px_32px_rgba(0,0,0,0.12)] dark:shadow-[0_2px_8px_rgba(0,0,0,0.2),0_12px_32px_rgba(0,0,0,0.3)]",className:`flex w-[230px] min-w-0 flex-col ${c?"max-h-[248px]":"h-[248px]"} overflow-hidden p-0 bg-white dark:bg-popover border-black/15 dark:border-white/15`,onOpenAutoFocus:e=>e.preventDefault(),children:["/calendar"!==e&&(0,t.jsx)("div",{className:"shrink-0 px-3 py-1.5 border-b border-border",children:(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground truncate",children:n})}),c??(0,t.jsx)(O,{href:e,label:n,icon:r})]})]})}],249803)},776036,e=>{"use strict";e.s(["computeOverlapColumns",0,function(e){let t=e.map(()=>({colIndex:0,totalCols:1})),a=0,n=0,r=(a,n)=>{let r=[];for(let s=a;s<n;s++){let a=e[s],n=a.topPx+a.heightPx,l=0;for(;l<r.length&&r[l]>a.topPx;)l++;l===r.length?r.push(n):r[l]=n,t[s].colIndex=l}let s=Math.max(1,r.length);for(let e=a;e<n;e++)t[e].totalCols=s};for(let t=0;t<e.length;t++){let s=e[t];if(t===a){n=s.topPx+s.heightPx;continue}s.topPx<n?n=Math.max(n,s.topPx+s.heightPx):(r(a,t),a=t,n=s.topPx+s.heightPx)}return e.length>0&&r(a,e.length),t}])},182439,420499,e=>{"use strict";var t=e.i(843476),a=e.i(271645),n=e.i(618566),r=e.i(561362);let s="app-sidebar-recent-paths";function l(){try{let e=localStorage.getItem(s);if(!e)return{};let t=JSON.parse(e);return"object"==typeof t&&null!==t?t:{}}catch{return{}}}let i={"/people":"Person","/companies":"Company","/customers":"Customer","/deals":"Deal","/contracts":"Contract","/templates":"Template","/frameworks":"Framework","/tasks":"Task","/sequences":"Sequence","/products":"Product","/docs":"Doc","/plans":"Plan","/skills":"Skill"};e.s(["getRecentPathsForSection",0,function(e){return(l()[e]??[]).slice(0,8)},"getStoredRecentPaths",0,l,"useRecordRecentPath",0,function(){let e=(0,n.usePathname)();(0,a.useEffect)(()=>{let t,a=(t=(0,r.findNavItem)(e),t?.href??null);if(!a||a===e)return;let n="u">typeof document?document.title?.trim():"",o=n&&"everything"!==n?n:a&&i[a]||e.split("/").filter(Boolean).pop()||e,c=l(),d=c[a]??[];(d=d.filter(t=>t.path!==e)).unshift({path:e,label:o,ts:Date.now()}),d=d.slice(0,8),c[a]=d;try{localStorage.setItem(s,JSON.stringify(c))}catch{}},[e])}],420499);var o=e.i(414318),c=e.i(920755),d=e.i(891008);let u=["people","companies","contracts","templates","products","deals","customers","sequences","tasks","videos","docs","plans","skills"],m=(0,a.createContext)({recentThreads:[],recentThreadsReady:!1,recentInboxMessages:[],recentInboxReady:!1,recentBySection:{},entityPreviews:{},inboxPreviewsPending:!1,todayEvents:[],todayEventsReady:!1,unreadCount:0,communityUnread:0,unreadReady:!1,allReady:!1});e.s(["SidebarPreloadProvider",0,function({children:e}){let r=(0,n.usePathname)(),[s,i]=(0,a.useState)([]),[h,p]=(0,a.useState)(!1),[x,f]=(0,a.useState)([]),[g,v]=(0,a.useState)(!1),[j,b]=(0,a.useState)({}),[y,w]=(0,a.useState)(!1),[C,N]=(0,a.useState)({}),[k,_]=(0,a.useState)(!1),[S,T]=(0,a.useState)(!1),[L,M]=(0,a.useState)([]),[P,$]=(0,a.useState)(!1),[D,E]=(0,a.useState)(0),[q,I]=(0,a.useState)(0),[A,R]=(0,a.useState)(!1),U=(0,a.useRef)(new Set),O=h&&g&&y&&k&&P&&A,z=(0,a.useCallback)(()=>{let e=new URLSearchParams;e.set("label","INBOX"),e.set("limit",String(6)),e.set("page","0"),fetch(`/api/gmail/threads?${e}`).then(e=>e.ok?e.json():{threads:[]}).then(e=>i((e.threads??[]).slice(0,6))).catch(()=>i([])).finally(()=>p(!0))},[]),W=(0,a.useCallback)(()=>{fetch("/api/inbox/feed?page=0&limit=10&skip_count=1").then(e=>e.ok?e.json():{conversations:[]}).then(e=>{let t=(e.conversations??[]).sort((e,t)=>
1{let a=!e.is_read||(e.unread_count??0)>0;return a!==(!t.is_read||(t.unread_count??0)>0)?a?-1:1:new Date(t.last_message_at??0).getTime()-new Date(e.last_message_at??0).getTime()}).slice(0,5);f(t);let a=t.map(e=>e.contact_id).filter(e=>!!e).map(e=>`/people/${e}`);a.length>0&&(T(!0),fetch("/api/sidebar/entity-previews",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:a})}).then(e=>e.ok?e.json():{}).then(e=>{e&&Object.keys(e).length>0&&N(t=>({...t,...e}))}).catch(()=>{}).finally(()=>T(!1)))}).catch(()=>f([])).finally(()=>v(!0))},[]);(0,a.useEffect)(()=>{z()},[z]),(0,a.useEffect)(()=>{W()},[W]);let F=(0,a.useCallback)(()=>{fetch("/api/inbox/unread-count").then(e=>e.ok?e.json():{count:0}).then(e=>E("number"==typeof e.count?e.count:0)).catch(()=>E(0)).finally(()=>R(!0))},[]),B=(0,a.useCallback)(()=>{(async()=>{try{let e=(0,c.createClient)(),{data:t}=await e.auth.getUser(),a=t.user?.id;if(!a)return I(0);let{data:n}=await e.from("community_channel_members").select("channel_id, last_read_at, muted").eq("user_id",a).eq("muted",!1);if(!n||0===n.length)return I(0);let r=n.map(e=>e.last_read_at).sort()[0],{data:s}=await e.from("community_messages").select("channel_id, user_id, created_at").in("channel_id",n.map(e=>e.channel_id)).eq("is_deleted",!1).gt("created_at",r).limit(500),l=new Map(n.map(e=>[e.channel_id,e.last_read_at])),i=0;for(let e of s??[]){if(e.user_id===a)continue;let t=l.get(e.channel_id);t&&e.created_at>t&&(i+=1)}I(i)}catch{I(0)}})()},[]),H=(0,a.useCallback)(()=>{let e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0),a=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59);fetch(`/api/calendar/events?timeMin=${t.toISOString()}&timeMax=${a.toISOString()}&maxResults=50`).then(e=>e.ok?e.json():[]).then(e=>M(Array.isArray(e)?e:[])).catch(()=>M([])).finally(()=>$(!0))},[]),J=(0,a.useCallback)(()=>{w(!1);let e=u.join(",");fetch(`/api/sidebar/recent?sections=${e}&limit=5`).then(e=>e.ok?e.json():{}).then(e=>{let t={};for(let a of u){let n=e[a];t[a]=Array.isArray(n)?n.map(e=>({...e,ts:e.ts??Date.now()})):[]}b(t)}).catch(()=>{}).finally(()=>w(!0))},[]),K=(0,a.useCallback)(()=>{let e=[...new Set(Object.values(l()).flat().map(e=>e.path))].slice(0,60);0===e.length?_(!0):(_(!1),fetch("/api/sidebar/entity-previews",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:e})}).then(e=>e.ok?e.json():{}).then(e=>N(t=>({...t,...e??{}}))).catch(()=>{}).finally(()=>_(!0)))},[]);return(0,o.useOnAppRefresh)(z),(0,o.useOnEmailRefresh)(z),(0,o.useOnAppRefresh)(W),(0,o.useOnEmailRefresh)(W),(0,o.useOnInboxRefresh)(W),(0,o.useOnAppRefresh)(F),(0,o.useOnEmailRefresh)(F),(0,o.useOnInboxRefresh)(F),(0,o.useOnAppRefresh)(H),(0,o.useOnAppRefresh)(J),(0,o.useOnAppRefresh)(K),(0,a.useEffect)(()=>{F()},[F]),(0,a.useEffect)(()=>{B();let e=(0,c.createClient)(),t=e.channel(`community-unread:${Math.random().toString(36).slice(2,8)}`).on("postgres_changes",{event:"*",schema:"public",table:"community_messages"},()=>B()).on("postgres_changes",{event:"UPDATE",schema:"public",table:"community_channel_members"},()=>B()).subscribe(),a=()=>B();return window.addEventListener("community:read",a),()=>{window.removeEventListener("community:read",a),e.removeChannel(t)}},[B]),(0,a.useEffect)(()=>{function e(){"visible"===document.visibilityState&&(F(),W())}return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[F,W]),(0,a.useEffect)(()=>{H();let e=setInterval(H,6e4);return()=>clearInterval(e)},[H]),(0,a.useEffect)(()=>{let e=new AbortController,t=u.join(",");return fetch(`/api/sidebar/recent?sections=${t}&limit=5`,{signal:e.signal}).then(e=>e.ok?e.json():{}).then(e=>{let t={};for(let a of u){let n=e[a];t[a]=Array.isArray(n)?n.map(e=>({...e,ts:e.ts??Date.now()})):[]}b(t)}).catch(()=>{}).finally(()=>w(!0)),()=>e.abort()},[]),(0,a.useEffect)(()=>{let e=[...new Set(Object.values(l()).flat().map(e=>e.path))].slice(0,60);0===e.length?_(!0):(e.forEach(e=>U.current.add(e)),fetch("/api/sidebar/entity-previews",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:e})}).then(e=>e.ok?e.json():{}).then(e=>N(t=>({...t,...e??{}}
1))).catch(()=>{}).finally(()=>_(!0)))},[]),(0,a.useEffect)(()=>{r&&r.split("/").filter(Boolean).length>=2&&(U.current.has(r)||(U.current.add(r),fetch("/api/sidebar/entity-previews",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:[r]})}).then(e=>e.ok?e.json():{}).then(e=>{e&&r in e&&N(t=>({...t,[r]:e[r]}))}).catch(()=>{})))},[r]),(0,t.jsx)(m.Provider,{value:{recentThreads:s,recentThreadsReady:h,recentInboxMessages:x,recentInboxReady:g,recentBySection:j,entityPreviews:C,inboxPreviewsPending:S,todayEvents:L,todayEventsReady:P,unreadCount:D,communityUnread:q,unreadReady:A,allReady:O},children:(0,t.jsx)(d.InboxUnreadProvider,{value:D,children:e})})},"useSidebarPreload",0,function(){return(0,a.useContext)(m)}],182439)},854992,e=>{"use strict";var t=e.i(271645);e.i(362623);var a=e.i(476819);e.s(["useSidebarResize",0,function(e){let n=e?.storageKey??"sidebar-width",r=e?.minWidth??128,s=e?.maxWidth??232,l=e?.defaultWidth??232,i=e?.invert??!1,[o,c]=(0,t.useState)(l),[d,u]=(0,t.useState)(!1),m=(0,t.useRef)(!1);(0,t.useEffect)(()=>{let e=localStorage.getItem(n);if(e){let t=Number(e);!isNaN(t)&&t>=r&&t<=s&&c(t)}},[n,r,s]);let h=(0,t.useCallback)(e=>{e.preventDefault(),m.current=!0,u(!0);let t=e.clientX,l=(0,a.currentUiScale)(),d=e=>{if(!m.current)return;let a=(e.clientX-t)/l;c(Math.min(s,Math.max(r,o+(i?-a:a))))},h=()=>{m.current=!1,u(!1),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",h),document.body.style.cursor="",document.body.style.userSelect="",c(e=>(localStorage.setItem(n,String(e)),e))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",d),document.addEventListener("mouseup",h)},[o,n,r,s,i]);return{width:(0,a.designPx)(o),startResize:h,isResizing:d,minWidth:r,maxWidth:s}}])},17603,e=>{"use strict";let t=(0,e.i(475254).default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);e.s(["default",0,t])},968553,e=>{"use strict";var t=e.i(17603);e.s(["Camera",()=>t.default])},367118,e=>{"use strict";let t=(0,e.i(475254).default)("chart-line",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);e.s(["default",0,t])},335349,e=>{"use strict";let t=(0,e.i(475254).default)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);e.s(["default",0,t])},537847,e=>{"use strict";var t=e.i(335349);e.s(["KeyRound",()=>t.default])}]);

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