PageSourceSearch

https://app.capsaintelligence.com/_next/static/chunks/app/layout-1…?dpl=dpl_2KXWgn2nTM7iTrcnt1U9WeeNEvXc

js capsaintelligence.com collected 2026-10-07 20:31:13 UTC 68,514 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{11167:(e,t,n)=>{"use strict";n.d(t,{AppRoot:()=>eF});var s=n(95155),r=n(12115),a=n(20063),i=n(73680),l=n(47894),o=n(37371);function c(){let e=(0,a.usePathname)(),{userId:t,orgId:n}=(0,i.As)(),s="".concat(t,":").concat(n),c=(0,r.useRef)(s),d=(0,r.useRef)(void 0),u=(0,r.useRef)(null);return c.current!==s&&((0,o.tE)(()=>o.U3.resetIdentity(!1)),c.current=s),(0,r.useLayoutEffect)(()=>{if((0,o.Vz)(e),t&&"/"!==e)for(let[t,n]of Object.entries(l.q))n===e&&(0,o.CE)(t)},[s,e,t]),(0,r.useEffect)(()=>{let e=e=>{if(!t||e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let n=e.target instanceof Element?e.target.closest("a[href]"):null;if(!(n instanceof HTMLAnchorElement)||n.download||n.target&&"_self"!==n.target)return;let s=new URL(n.href);s.origin===window.location.origin&&s.pathname!==window.location.pathname&&(0,o.os)(n.href)},n=()=>{let e=u.current===window.location.pathname;u.current=null,t&&!e&&(0,o.os)(window.location.pathname)},s=()=>(0,o.tE)(()=>o.U3.visibility("hidden"===document.visibilityState)),r=()=>{d.current=(0,o.tE)(()=>o.U3.suspend())},a=e=>{if(!e.persisted||!d.current||!t)return;u.current=window.location.pathname;let n=d.current;d.current=void 0,(0,o.tE)(()=>o.U3.restore(n,window.location.pathname))};return document.addEventListener("click",e,!0),window.addEventListener("popstate",n),document.addEventListener("visibilitychange",s),window.addEventListener("pagehide",r),window.addEventListener("pageshow",a),()=>{document.removeEventListener("click",e,!0),window.removeEventListener("popstate",n),document.removeEventListener("visibilitychange",s),window.removeEventListener("pagehide",r),window.removeEventListener("pageshow",a)}},[t]),null}var d=n(27759),u=n(62160),m=n(97839),h=n(51420),p=n(68955),f=n(65229),x=n(60080);let b="/api/proxy/core-api",g=[{value:1,label:"Poor"},{value:2,label:"Fair"},{value:3,label:"Good"},{value:4,label:"Great"}];function y(e){let{suppressed:t=!1}=e,{isLoaded:n,isSignedIn:a,user:l}=(0,i.Jd)(),[o,c]=(0,r.useState)("hidden"),[d,u]=(0,r.useState)(null),[m,h]=(0,r.useState)(""),[p,y]=(0,r.useState)(!1),v=(0,r.useCallback)(()=>(null==l?void 0:l.id)?"".concat("csat_cooldown_until_").concat(l.id):null,[null==l?void 0:l.id]),w=(0,r.useCallback)(e=>{let t=v();t&&localStorage.setItem(t,e)},[v]),j=(0,r.useCallback)(()=>{let e=v();if(!e)return!1;let t=localStorage.getItem(e);return!!t&&new Date(t)>new Date},[v]),k=(0,r.useCallback)(async()=>{if(!j())try{let e=await fetch("".concat(b,"/csat-survey/eligibility"),{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)return;let t=await e.json();t.eligible?(c("rating"),(0,x.sx)({eventName:"csat_survey_shown"})):t.cooldownEndsAt&&w(t.cooldownEndsAt)}catch(e){}},[j,w]),N=(0,r.useCallback)(async(e,t,n)=>{try{let s=await fetch("".concat(b,"/csat-survey/interaction"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({interactionType:e,rating:t,feedback:n})});if(s.ok){let e=await s.json();e.cooldownEndsAt&&w(e.cooldownEndsAt)}}catch(e){}},[w]),_=(0,r.useCallback)(async()=>{(0,x.sx)({eventName:"csat_survey_dismissed"}),await N("dismiss",null,null),c("hidden")},[N]),S=(0,r.useCallback)(async e=>{u(e),(0,x.sx)({eventName:"csat_survey_rated",properties:{rating:e}}),await N("rating",e,null),c("feedback")},[N]),A=(0,r.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!d||p)return;let t=!e&&m.trim().length>0;y(!0),(0,x.sx)({eventName:"csat_survey_submitted",properties:{rating:d,hasFeedback:t}}),t&&await N("rating",d,m.trim()),c("thanks"),y(!1),setTimeout(()=>{c("hidden")},2e3)},[d,m,p,N]);return((0,r.useEffect)(()=>{n&&a&&k()},[n,a,k]),!t&&n&&a&&"hidden"!==o)?"rating"===o?(0,s.jsxs)("div",{className:"fixed bottom-20 right-6 z-50 w-72 rounded-xl border border-neutral-200 bg-white p-4 shadow-lg",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("span",{className:"text-sm font-semibold text-neutral-900",children:"How are we doing?"}),(0,s.jsx)("button",{onClick:_,className:"text-neutral-400 hover:text-neutral-600 transition-colors","aria-label":"Dismiss survey",children:(0,s.jsx)(f.A,{className:"h-4 w-4"})})]}),(0,s.jsx)("div",{className:"grid grid-cols-4 gap-2",children:g.map(e=>(0,s.jsxs)("button",{onClick:()=>S(e.value),className:"flex flex-col items-center gap-1 rounded-lg border border-neutral-200 bg-neutral-50 px-2 py-2 text-center hover:border-emerald-500 hover:bg-emerald-50 transition-colors",children:[(0,s.jsx)("span",{className:"text-lg font-semibold text-neutral-900",children:e.value}),(0,s.jsx)("span",{className:"text-xs text-neutral-600",children:e.label})]},e.value))})]}):"feedback"===o?(0,s.jsxs)("div",{className:"fixed bottom-20 right-6 z-50 w-72 rounded-xl border border-neutral-200 bg-white p-4 shadow-lg",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("span",{className:"text-sm font-semibold text-neutral-900",children:"Thanks! Any additional feedback?"}),(0,s.jsx)("button",{onClick:_,className:"text-neutral-400 hover:text-neutral-600 transition-colors","aria-label":"Dismiss survey",children:(0,s.jsx)(f.A,{className:"h-4 w-4"})})]}),(0,s.jsx)("textarea",{value:m,onChange:e=>h(e.target.value),placeholder:"Optional feedback...",maxLength:1e3,className:"w-full h-20 rounded-lg border border-neutral-200 px-3 py-2 text-sm text-neutral-900 placeholder:text-neutral-400 focus:border-emerald-500 focus:outline-none focus:ring-1 focus:ring-emerald-500 resize-none"}),(0,s.jsxs)("div",{className:"mt-3 flex items-center gap-3",children:[(0,s.jsx)("button",{onClick:()=>A(!1),disabled:p,className:"flex-1 rounded-lg bg-emerald-600 px-4 py-2 text-sm font-medium text-white hover:bg-emerald-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:p?"Submitting...":"Submit"}),(0,s.jsx)("button",{onClick:()=>A(!0),disabled:p,className:"text-sm font-medium text-neutral-500 hover:text-neutral-700 transition-colors",children:"Skip"})]})]}):"thanks"===o?(0,s.jsx)("div",{className:"fixed bottom-20 right-6 z-50 w-72 rounded-xl border border-neutral-200 bg-white p-4 shadow-lg",children:(0,s.jsx)("div",{className:"text-center",children:(0,s.jsx)("span",{className:"text-sm font-semibold text-neutral-900",children:"Thank y
1ou for your feedback!"})})}):null:null}function v(){return(0,r.useEffect)(()=>{let e=setTimeout(async()=>{if(sessionStorage.getItem("endpoints_warmed_up"))return void console.log("Endpoints already warmed up this session");console.log("Warming up backend endpoints...");try{let e=await fetch("/api/warmup",{method:"GET",headers:{Accept:"application/json"}});if(e.ok){let t=await e.json();console.log("Warmed up ".concat(t.warmed,"/").concat(t.total," services in ").concat(t.totalMs,"ms")),sessionStorage.setItem("endpoints_warmed_up","true")}else console.debug("Warmup request failed with status:",e.status)}catch(e){console.debug("Warmup request failed:",e instanceof Error?e.message:e)}},1e3);return()=>clearTimeout(e)},[]),null}function w(){let[e,t]=(0,r.useState)(""),[n,a]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=window.location.hostname;if("localhost"===e||"127.0.0.1"===e)t("development"),i();else{if(!e.includes(".vercel.app"))return;t("preview")}},[]);let i=async()=>{try{let e=await fetch("/api/proxy/analytics/health");if(e.ok){let t=await e.json();t.debug_info&&a({tenant:t.debug_info.tenant_key||"unknown",method:t.debug_info.resolution_method||"fallback",org:t.debug_info.org_slug})}}catch(e){a({tenant:"gardenview",method:"fallback (no DB)",org:"local-dev"})}};return e?(0,s.jsx)("div",{className:"".concat("preview"===e?"bg-yellow-500":"bg-blue-500"," text-white text-sm py-2 px-4 text-center font-mono"),children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto flex items-center justify-center gap-4",children:[(0,s.jsx)("span",{className:"font-bold",children:"development"===e?"LOCAL DEV":"PREVIEW"}),(0,s.jsx)("span",{className:"opacity-75",children:"|"}),(0,s.jsxs)("span",{className:"opacity-90",children:["Cloud SQL: ","preview"===e?"staging":"dev"," schema"]}),"development"===e&&n&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"opacity-75",children:"|"}),(0,s.jsxs)("span",{className:"opacity-90",children:["Tenant: ",n.tenant?n.tenant[0]+"*".repeat(11):"unknown",(0,s.jsxs)("span",{className:"opacity-75 text-xs ml-1",children:["(",n.method,")"]})]})]})]})}):null}var j=n(76394),k=n(90009),N=n(50543);function _(){}function S(){var e,t;let n=(0,N.IN)(),r=(0,k.rU)(),i=(0,a.usePathname)();if(null===n||null===n.active||null===r)return null;let{definition:l,items:o,presentation:c}=n.active,d=o.filter(e=>"complete"===e.state).length,u=o.length,m="page_setup"===l.kind,h=m?"".concat(d," of ").concat(u," complete"):1===u?"1 step":"".concat(u.toLocaleString("en-US")," steps"),p=[{id:"steps",label:"Steps",summary:null,ariaLabel:"".concat(l.copy.title," steps"),collapsible:!1,expandedByDefault:!0,progress:m?{completedCount:d,totalCount:u,summary:h,ariaLabel:"".concat(d," of ").concat(u," steps complete")}:null,items:o}];return(0,s.jsx)(j.w,{visible:!0,presentation:c,positionClass:(e=r.isPanelOpen,t="goals"===r.activeSection,e?t?"left-[25rem]":"left-[21rem]":"left-20"),instanceKey:l.key,content:function(e,t,n){let{eyebrow:s,title:r,description:a}=e.copy;return{ariaLabel:r,titleId:"guide-dock-".concat(e.key,"-title"),eyebrow:s,title:r,description:a,collapsedTitle:r,collapsedDetail:null!==n?n:t,collapsedAriaLabel:null!==n?"Expand ".concat(r,", ").concat(n):"Expand ".concat(r,", ").concat(t),loadingLabel:"Loading…",errorTitle:"This guide is unavailable",errorDescription:"Try again in a moment.",retryLabel:"Try again",dismissLabel:"Dismiss ".concat(r),collapseLabel:"Collapse ".concat(r)}}(l,h,n.saveError),sections:p,loading:!1,error:null,destinationError:n.saveError,onRetry:_,onExpand:()=>n.recordAction(l.key,"expanded"),onCollapse:()=>n.recordAction(l.key,"collapsed"),onDismiss:()=>{(0,x.sx)({eventName:"feature_notification_dismissed",properties:{notification_id:l.key}}),n.recordAction(l.key,"dismissed")},onOpenItem:e=>n.openItem(l.key,e),onAction:_},"".concat(l.key,":").concat(i))}function A(e){let{children:t}=e;return(0,s.jsx)(s.Fragment,{children:t})}n(53842);var C=n(46927),E=n(17666),I=n(78425),R=n(51932);function T(){var e;let{pageAssistant:t,helpRequestId:n,feedbackRequest:a}=(0,R.on)(),i=(0,r.useRef)(null),[l,o]=(0,r.useState)(!1),[c,d]=(0,r.useState)("bug"),[u,m]=(0,r.useState)(""),[h,p]=(0,r.useState)(!1),[x,b]=(0,r.useState)(null),[g,y]=(0,r.useState)(!1),v=(0,r.useCallback)(()=>{h||(o(!1),b(null),y(!1))},[h]),w=(0,r.useRef)(null),j=(0,I.LF)({open:l,busy:h,initialFocusRef:w,onClose:v}),k=(0,r.useRef)(n);(0,r.useEffect)(()=>
1{if(n!==k.current)if(k.current=n,t)t.open(i.current);else{var e;null==(e=i.current)||e.focus(),b(null),y(!1),o(!0)}},[n,t]);let N=(0,r.useRef)(null!=(e=null==a?void 0:a.id)?e:0);(0,r.useEffect)(()=>{var e,t;a&&a.id!==N.current&&(N.current=a.id,d(a.type),m(null!=(t=null==(e=a.details)?void 0:e.slice(0,3e3))?t:""),b(null),y(!1),o(!0))},[a]);let _=async()=>{let e=u.trim();if(e&&!h){p(!0),b(null);try{let t=await fetch("".concat("/api/proxy/core-api","/product-feedback"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feedbackType:c,details:e,pagePath:window.location.pathname})});if(429===t.status)return void b("Please wait at least five seconds between reports. After five reports, wait five minutes before sending more.");if(!t.ok)throw Error("Feedback could not be sent");y(!0),m("")}catch(e){b("We couldn't send your feedback. Please try again.")}finally{p(!1)}}};return(0,s.jsxs)(s.Fragment,{children:[t?(0,s.jsxs)("button",{ref:i,type:"button",onClick:e=>t.open(e.currentTarget),"aria-label":t.label,title:t.label,className:"group fixed bottom-6 right-6 z-40 inline-flex h-12 w-12 items-center justify-center rounded-full border border-violet-300 bg-violet-600 text-white shadow-[0_10px_30px_rgba(15,23,42,0.12)] transition-transform duration-200 hover:-translate-y-1 hover:bg-violet-700 hover:shadow-[0_18px_36px_rgba(124,58,237,0.35)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-violet-400 focus-visible:ring-offset-2",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"text-xl font-semibold leading-none",children:"?"}),(0,s.jsx)("span",{className:"sr-only",children:t.label})]}):(0,s.jsxs)("button",{ref:i,type:"button",onClick:()=>{b(null),y(!1),o(!0)},"aria-label":"Share product feedback",className:"group fixed bottom-6 right-6 z-40 inline-flex h-12 w-12 items-center justify-center rounded-full border border-emerald-200 bg-[#f2fdf5] text-xl font-semibold text-gray-900 shadow-[0_10px_30px_rgba(15,23,42,0.08)] transition-transform duration-200 hover:-translate-y-1 hover:shadow-[0_18px_36px_rgba(52,211,153,0.35)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 focus-visible:ring-offset-2 focus-visible:ring-offset-[#f2fdf5]",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"leading-none",children:"?"}),(0,s.jsx)("span",{className:"sr-only",children:"Share product feedback"})]}),l&&(0,s.jsx)("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-neutral-950/40 px-4",onMouseDown:e=>{e.target===e.currentTarget&&v()},children:(0,s.jsxs)("div",{ref:j,role:"dialog","aria-modal":"true","aria-labelledby":"product-feedback-title",tabIndex:-1,className:"w-full max-w-md rounded-2xl border border-neutral-200 bg-white p-5 shadow-2xl",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{id:"product-feedback-title",className:"text-lg font-semibold text-neutral-900",children:"Share feedback"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-neutral-600",children:"Tell us what went wrong or what would make Capsa better."})]}),(0,s.jsx)("button",{type:"button",onClick:v,disabled:h,"aria-label":"Close feedback form",className:"rounded-md p-1 text-neutral-400 transition-colors hover:bg-neutral-100 hover:text-neutral-700 disabled:cursor-not-allowed disabled:opacity-50",children:(0,s.jsx)(f.A,{className:"h-5 w-5"})})]}),g?(0,s.jsxs)("div",{className:"py-8 text-center",children:[(0,s.jsx)("p",{className:"font-semibold text-neutral-900",children:"Thanks—we got it."}),(0,s.jsx)("p",{className:"mt-1 text-sm text-neutral-600",children:"Your feedback was sent to the Capsa team."}),(0,s.jsx)("button",{type:"button",onClick:v,className:"mt-5 rounded-lg bg-emerald-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-emerald-700",children:"Done"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mt-5 grid grid-cols-2 gap-2","aria-label":"Feedback type",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>d("bug"),"aria-pressed":"bug"===c,className:"flex items-center justify-center gap-2 rounded-lg border px-3 py-2.5 text-sm font-medium transition-colors ".concat("bug"===c?"border-emerald-500 bg-emerald-50 text-emerald-800":"border-neutral-200 bg-white text-neutral-700 hover:bg-neutral-50"),children:[(0,s.jsx)(C.A,{className:"h-4 w-4"}),"Report a bug"]}),(0,s.jsxs)("button",{type:"button",onClick:()=>d("request"),"aria-pressed":"request"===c,className:"flex items-center justify-center gap-2 rounded-lg border px-3 py-2.5 text-sm font-medium transition-colors ".concat("request"===c?"border-emerald-500 bg-emerald-50 text-emerald-800":"border-neutral-200 bg-white text-neutral-700 hover:bg-neutral-50"),children:[(0,s.jsx)(E.A,{className:"h-4 w-4"}),"Request a feature"]})]}
1),(0,s.jsx)("label",{htmlFor:"product-feedback-details",className:"mt-5 block text-sm font-medium text-neutral-800",children:"bug"===c?"What happened?":"What would you like Capsa to do?"}),(0,s.jsx)("textarea",{id:"product-feedback-details",ref:w,value:u,onChange:e=>m(e.target.value),maxLength:3e3,rows:6,placeholder:"bug"===c?"What were you trying to do, and what happened instead?":"Tell us what would help and why it matters.",className:"mt-2 w-full resize-none rounded-lg border border-neutral-300 px-3 py-2 text-sm text-neutral-900 placeholder:text-neutral-400 focus:border-emerald-500 focus:outline-none focus:ring-1 focus:ring-emerald-500"}),(0,s.jsxs)("div",{className:"mt-1 flex items-center justify-between text-xs text-neutral-500",children:[(0,s.jsx)("span",{children:"The page you’re viewing will be included."}),(0,s.jsxs)("span",{children:[u.length.toLocaleString("en-US"),"/",3e3.toLocaleString("en-US")]})]}),x&&(0,s.jsx)("p",{className:"mt-3 text-sm text-red-600",role:"alert",children:x}),(0,s.jsxs)("div",{className:"mt-5 flex justify-end gap-3",children:[(0,s.jsx)("button",{type:"button",onClick:v,disabled:h,className:"rounded-lg border border-neutral-300 px-4 py-2 text-sm font-medium text-neutral-700 transition-colors hover:bg-neutral-50 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),(0,s.jsx)("button",{type:"button",onClick:_,disabled:h||!u.trim(),className:"rounded-lg bg-emerald-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-emerald-700 disabled:cursor-not-allowed disabled:opacity-50",children:h?"Sending…":"Send feedback"})]})]})]})})]})}n(83447),n(36907),n(77876);var P=n(52619),L=n.n(P),O=n(76907),F=n(35299),D=n(77801),z=n(89559),q=n(1068),W=n(74022),M=n(85767),K=n(89464),U=n(78355);let J=n(95704).env.NEXT_PUBLIC_CAPSA_SUPPORT_EMAIL||"[email protected]";function G(e){let{children:t}=e;return(0,K.dF)()?(0,s.jsx)(s.Fragment,{children:t}):(0,s.jsx)(V,{children:t})}function V(e){let{children:t}=e,n=(0,a.usePathname)(),{orgId:l,userId:c}=(0,i.As)(),{isLoaded:d,isSignedIn:u,user:m}=(0,i.Jd)(),{displayName:h,email:p,error:f,hydrated:b,initiallyMissing:g,loading:y,permissionRole:v,permissions:w,stillMissing:j,tenant:k,tenantKey:N,tenantSuperAdminEmail:_,tenantSuperAdminEmails:S,userId:A}=(0,q.W)(),C=(0,r.useRef)(new Set),E=(0,U.vd)(),I=(0,r.useMemo)(()=>(0,U.Sk)(n),[n]),R=(0,U.vL)(n),T="/"===I&&d&&!u,P=(0,r.useMemo)(()=>null!=w?w:E?(0,U.E6)({email:p,permissionRole:v,tenantSuperAdminEmail:_,tenantSuperAdminEmails:S}):void 0,[p,E,v,w,_,S]),F=(0,r.useMemo)(()=>!!P&&(0,U.f8)(n,P),[P,n]),D=(0,r.useMemo)(()=>P&&!(0,U.LS)(n)?(0,U.Rj)(n,P.routes):null,[P,n]),z=(0,r.useMemo)(()=>(0,U.Hg)(n,P),[P,n]),K=d&&u&&!R&&!!P&&!F&&(0,M.Vr)(null!=n?n:"");return((0,r.useEffect)(()=>{K&&(0,M.bK)()},[K]),(0,r.useEffect)(()=>{if(R||T||!d||u)return;let e="route_access_signed_out_redirect:".concat(I);C.current.has(e)||(C.current.add(e),(0,W.l)({eventName:"route_access_signed_out_redirect",properties:{reason:"route_access_gate_signed_out",normalized_path:I}}))},[d,R,u,T,I]),(0,r.useEffect)(()=>{var e,t,s,r;if(R||T||!d||!u||y||P)return;(0,o.R2)(I);let a="route_access_verification_failed:".concat(I);if(C.current.has(a))return;C.current.add(a);let i={reason:f?"hydration_error":"missing_permissions",normalized_path:I,hydrated:b,hydration_error_present:!!f,hydration_error_message:f?f.slice(0,300):null,initially_missing_fields:g,still_missing_fields:j,legacy_fallback_enabled:E,tenant_key_present:!!N,tenant_status_present:!!k,tenant_has_aspire_data:null!=(t=null==k?void 0:k.hasAspireData)?t:null,tenant_has_aspire_keys:null!=(s=null==k?void 0:k.hasAspireKeys)?s:null,tenant_is_admin:null!=(r=null==k?void 0:k.isAdmin)?r:null,permission_role_present:!!v,raw_permissions_present:!!w};(0,x.sx)({eventName:"route_access_verification_failed",properties:i}),(0,W.l)({eventName:"route_access_verification_failed",alertContext:{app_user_id:A,browser_url:window.location.href,clerk_org_id:l,clerk_user_id:c,hydrated_display_name:h,hydrated_email:p,hydration_error:f,pathname:n,primary_email:null==m||null==(e=m.primaryEmailAddress)?void 0:e.emailAddress,user_full_name:null==m?void 0:m.fullName,tenant_key:N||(null==k?void 0:k.tenantKey),tenant_name:null==k?void 0:k.tenantName,tenant_super_admin_email:_},properties:i})},[l,c,h,P,p,b,A,f,g,d,R,u,T,E,y,I,n,v,w,j,k,N,_,m]),(0,r.useEffect)(()=>{var e,t,n,s,r;if(R||T||!d||!u||!P||F)return;(0,o.R2)(I);
1let a="route_access_denied:".concat(I);if(C.current.has(a))return;C.current.add(a);let i={normalized_path:I,matched_route_path:null!=(e=null==D?void 0:D.routePath)?e:null,matched_route_type:null!=(t=null==D?void 0:D.routeType)?t:null,matched_route_section:null!=(n=null==D?void 0:D.section)?n:null,matched_route_requires_admin:null!=(s=null==D?void 0:D.requiresAdmin)?s:null,matched_route_requires_super_admin:null!=(r=null==D?void 0:D.requiresSuperAdmin)?r:null,permissions_route_count:P.routes.length,permissions_viewable_route_count:P.routes.filter(e=>e.canView).length,is_admin:P.isAdmin,is_super_admin:P.isSuperAdmin,restrict_new_reports:P.restrictNewReports,permissions_fallback:!0===P.isFallback,tenant_key_present:!!N,tenant_status_present:!!k};(0,x.sx)({eventName:"route_access_denied",properties:i}),(0,W.l)({eventName:"route_access_denied",properties:i})},[F,P,d,R,u,T,D,I,k,N]),R||(0,U.Al)(n)||T)?(0,s.jsx)(s.Fragment,{children:t}):d&&!u?(0,s.jsx)(i.W5,{}):d&&(!y||w)?P?F?(0,s.jsx)(s.Fragment,{children:t}):"/"===I&&u?(0,s.jsx)(B,{}):(0,s.jsx)("main",{className:"max-w-screen-2xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,s.jsx)("div",{className:"flex min-h-[60vh] items-center justify-center",children:(0,s.jsx)("div",{className:"w-full max-w-xl rounded-lg border border-neutral-200 bg-white p-8 shadow-sm",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(O.A,{className:"mt-0.5 h-5 w-5 text-neutral-500"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold text-neutral-900",children:"You do not have access to this page"}),(0,s.jsxs)("p",{className:"mt-3 text-sm leading-6 text-neutral-600",children:["Ask your Capsa super admin to turn on access",D?" for ".concat(D.label):"","."]}),z?(0,s.jsxs)(L(),{href:z.routePath,className:"mt-5 inline-flex items-center justify-center rounded-lg border border-neutral-300 bg-white px-4 py-2 text-sm font-medium text-neutral-700 transition hover:bg-neutral-50",children:["Go to ",z.label]}):(0,s.jsx)("p",{className:"mt-5 text-sm text-neutral-500",children:"No Capsa pages are turned on for your account yet."})]})]})})})}):(0,s.jsx)(H,{}):(0,s.jsx)(Y,{})}function B(){let e=(0,a.useRouter)();return(0,r.useEffect)(()=>{e.replace("/start")},[e]),(0,s.jsx)(Y,{})}function Y(){return(0,s.jsx)("main",{className:"max-w-screen-2xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,s.jsx)("div",{className:"flex min-h-[60vh] items-center justify-center",children:(0,s.jsxs)("div",{className:"inline-flex items-center gap-2 text-sm text-neutral-600",children:[(0,s.jsx)(F.A,{className:"h-4 w-4 animate-spin text-primary-600"}),(0,s.jsx)("span",{children:"Loading page access..."})]})})})}function H(){return(0,s.jsx)("main",{className:"max-w-screen-2xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,s.jsx)("div",{className:"flex min-h-[60vh] items-center justify-center",children:(0,s.jsx)("div",{className:"w-full max-w-xl rounded-lg border border-neutral-200 bg-white p-8 shadow-sm",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(D.A,{className:"mt-0.5 h-5 w-5 text-neutral-500"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold text-neutral-900",children:"Access could not be verified"}),(0,s.jsxs)("p",{className:"mt-3 text-sm leading-6 text-neutral-600",children:["Refresh the page. If this keeps happening, email"," ",(0,s.jsx)("a",{href:"mailto:".concat(J),className:"font-medium text-primary-600 underline-offset-2 hover:underline",children:J}),"."]}),(0,s.jsxs)("button",{type:"button",onClick:()=>window.location.reload(),className:"mt-5 inline-flex items-center justify-center gap-2 rounded-lg border border-neutral-300 bg-white px-4 py-2 text-sm font-medium text-neutral-700 transition hover:bg-neutral-50",children:[(0,s.jsx)(z.A,{className:"h-4 w-4"}),"Refresh page"]})]})]})})})})}var Q=n(10075),X=n(25022),$=n(15486),Z=n(99776),ee=n(86891);function et(e){e instanceof ee.v3&&(0,ee.Mi)()}function en(e){let{children:t}=e,[n]=(0,r.useState)(()=>new Q.E({queryCache:new X.$({onError:e=>et(e)}),mutationCache:new $.q({onError:e=>et(e)}),defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!1,retry:(e,t)=>!(t instanceof ee.v3)&&e<3},mutations:{retry:(e,t)=>!(t instanceof ee.v3)&&e<3}}}));return(0,s.jsx)(Z.Ht,{client:n,children:t})}let es=new Set(["analytics_session_id","demoMode","endpoints_warmed_up","property-efficiency-metric-mode"]),er=["capsa","csat_cooldown_until_"],ea=["-dashboard-section-order","-sidebar-collapsed"];var ei=n(60140);function el(){return(0,s.jsx)("div",{className:"min-h-screen bg-neutral-50",children:(0,s.jsx)("div",{className:"flex min-h-screen items-center justify-center px-6",children:(0,s.jsxs)("div",{"aria-live":"polite",role:"status",className:"w-full max-w-md rounded-2xl border border-neutral-200 bg-white px-6 py-5 shadow-sm",children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-neutral-900",children:"Switching organization"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-neutral-600",children:"Refreshing Capsa for the selected organization."})]})})})}function eo(e){let{onSignOut:t}=e;return(0,s.jsx)("main",{className:"min-h-screen bg-neutral-50 px-6 py-16",children:(0,s.jsx)("div",{className:"mx-auto flex min-h-[70vh] max-w-xl items-center justify-center",children:(0,s.jsxs)("div",{className:"w-full rounded-2xl border border-neutral-200 bg-white p-8 shadow-sm",children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold text-neutral-950",children:"We couldn't finish signing you in"}),(0,s.jsx)("p",{className:"mt-3 text-sm leading-6 text-neutral-600",children:"Your account is ready, but this browser did not finish connecting to Capsa. Try again now. If that does not work, sign out and start a fresh session."}),(0,s.jsxs)("div",{className:"mt-6 flex flex-wrap gap-3",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>window.location.reload(),className:"inline-flex items-center justify-center gap-2 rounded-lg bg-emerald-600 px-4 py-2 text-sm font-medium text-white transition hover:bg-emerald-700",children:[(0,s.jsx)(z.A,{className:"h-4 w-4"}),"Try again"]}),(0,s.jsx)("button",{type:"button",onClick:()=>void t(),className:"inline-flex items-center justify-center rounded-lg border border-neutral-300 bg-white px-4 py-2 text-sm font-medium text-neutral-700 transition hover:bg-neutral-50",children:"Sign out"})]})]})})})}function ec(e){let{children:t}=e;return(0,K.dF)()?(0,s.jsx)("div",{className:"contents",children:t},"local-dev"):(0,s.jsx)(ed,{children:t})}function ed(e){var t;let{children:n}=e,{isLoaded:a,orgId:l,userId:o}=(0,i.As)(),{signOut:c}=(0,i.ho)(),[d,u]=(0,r.useState)(!1),[m,h]=(0,r.useState)(null),[p,f]=(0,r.useState)(!1),[x,b]=(0,r.useState)(!1),g=!!o,y=null!=l?l:null,v=(t={
1isLoaded:a,hasTimedOut:x,hasUserSession:g,hasInitialized:d,previousOrgId:m,currentOrgId:y,isSwitching:p}).isLoaded?t.hasUserSession?t.isSwitching?{shouldInitialize:!1,shouldReset:!1,shouldRenderChildren:!1,shouldShowRecovery:!1}:t.hasInitialized?t.previousOrgId!==t.currentOrgId?{shouldInitialize:!1,shouldReset:!0,shouldRenderChildren:!1,shouldShowRecovery:!1}:{shouldInitialize:!1,shouldReset:!1,shouldRenderChildren:!0,shouldShowRecovery:!1}:{shouldInitialize:!0,shouldReset:!1,shouldRenderChildren:!0,shouldShowRecovery:!1}:{shouldInitialize:!1,shouldReset:!1,shouldRenderChildren:!t.isSwitching,shouldShowRecovery:!1}:{shouldInitialize:!1,shouldReset:!1,shouldRenderChildren:!t.hasInitialized&&!t.hasTimedOut,shouldShowRecovery:t.hasTimedOut};if((0,r.useEffect)(()=>{if(a)return void b(!1);let e=window.setTimeout(()=>{b(!0)},ei.FN);return()=>window.clearTimeout(e)},[a]),(0,r.useEffect)(()=>{a&&!g&&(u(!1),h(null),f(!1))},[g,a]),(0,r.useEffect)(()=>{v.shouldInitialize&&(h(y),u(!0))},[y,v.shouldInitialize]),(0,r.useEffect)(()=>{v.shouldReset&&(f(!0),function(){let e=[];try{e.push(window.localStorage)}catch(e){}try{e.push(window.sessionStorage)}catch(e){}let t=[];e.forEach(e=>{let n=[];for(let t=0;t<e.length;t+=1){let s=e.key(t);s&&function(e){return!!(es.has(e)||er.some(t=>e.startsWith(t)))||ea.some(t=>e.endsWith(t))}(s)&&n.push(s)}n.forEach(n=>{e.removeItem(n),t.push(n)})})}(),window.location.reload())},[v.shouldReset]),v.shouldShowRecovery)return(0,s.jsx)(eo,{onSignOut:()=>c({redirectUrl:"/"})});if(!v.shouldRenderChildren)return(0,s.jsx)(el,{});let w=g?"".concat(o,":").concat(null!=y?y:"no-organization"):"signed-out";return(0,s.jsx)("div",{className:"contents",children:n},w)}var eu=n(3005);function em(e){let t,{tenantName:n,userEmail:r,hasAspireKeys:a}=e;return t=a?(0,s.jsx)(ep,{tenantName:n,userEmail:r}):(0,s.jsx)(ef,{tenantName:n}),(0,s.jsx)("div",{className:"flex min-h-[calc(100vh-6rem)] items-center justify-center px-4 py-12",children:t})}function eh(e){let{title:t,children:n,tint:r="emerald"}=e;return(0,s.jsxs)("div",{className:"w-full max-w-xl rounded-2xl bg-white p-8 shadow-xl",children:[(0,s.jsx)("div",{className:"mx-auto mb-6 inline-flex h-14 w-14 items-center justify-center rounded-full ".concat("amber"===r?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"),"aria-hidden":"true",children:(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",className:"h-7 w-7",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,s.jsx)("path",{d:"M12 7v5l3 2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),(0,s.jsx)("h1",{className:"text-center text-2xl font-semibold text-gray-900",children:t}),n]})}function ep(e){let{tenantName:t,userEmail:n}=e;return(0,s.jsxs)(eh,{title:"We're setting up your data",children:[(0,s.jsxs)("p",{className:"mt-4 text-center text-sm leading-relaxed text-gray-600",children:[t?"".concat(t,"'s "):"Your ","Aspire sync is being scheduled. This usually takes up to one business day."," ",n?(0,s.jsxs)(s.Fragment,{children:["We’ll email you at"," ",(0,s.jsx)("span",{className:"font-medium text-gray-800",children:n})," ","as soon as your dashboards are ready."]}):(0,s.jsx)(s.Fragment,{children:"We’ll email you as soon as your dashboards are ready."})]}),(0,s.jsxs)("p",{className:"mt-6 text-center text-xs text-gray-500",children:["Questions? Email"," ",(0,s.jsx)("a",{href:"mailto:[email protected]",className:"underline hover:text-gray-700",children:"[email protected]"}),"."]})]})}function ef(e){let{tenantName:t}=e;return(0,s.jsxs)(eh,{title:t?"".concat(t," hasn't connected Aspire yet"):"Aspire hasn’t been connected yet",tint:"amber",children:[(0,s.jsx)("p",{className:"mt-4 text-center text-sm leading-relaxed text-gray-600",children:"An admin on your team needs to connect your Aspire account before we can build your dashboards. Please ask them to sign in to Capsa to complete this step."}),(0,s.jsxs)("p",{className:"mt-6 text-center text-xs text-gray-500",children:["Not sure who that is? Email"," ",(0,s.jsx)("a",{href:"mailto:[email protected]",className:"underline hover:text-gray-700",children:"[email protected]"})," ","and we’ll help."]})]})}let ex=["/integrations/api-keys"];function eb(e){let{children:t}=e,{loading:n,hydrated:i,tenant:l,email:o,refresh:c}=(0,q.W)(),d=(0,a.usePathname)(),u=(0,a.useRouter)(),m=!!d&&ex.some(e=>d===e||d.startsWith("".concat(e,"/"))),h=!n&&i&&null!=l&&!l.hasAspireData&&!l.hasAspireKeys&&l.isAdmin&&!m;return((0,r.useEffect)(()=>{h&&u.replace("/integrations/api-keys")},[u,h]),n||!i)?(0,s.jsx)(s.Fragment,{children:t}
1):l?l.hasAspireData||m?(0,s.jsx)(s.Fragment,{children:t}):h?(0,s.jsx)(eg,{}):(0,s.jsx)(em,{tenantName:l.tenantName,userEmail:o,hasAspireKeys:l.hasAspireKeys}):(0,s.jsx)(ey,{userEmail:o,onRetry:()=>{c({force:!0})}})}function eg(){return(0,s.jsx)("div",{className:"flex min-h-[calc(100vh-6rem)] items-center justify-center px-4 py-12",children:(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-neutral-200 bg-white px-4 py-3 text-sm text-neutral-600 shadow-sm",children:[(0,s.jsx)(eu.y,{size:"sm"}),"Opening API key setup..."]})})}function ey(e){let{userEmail:t,onRetry:n}=e,a=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{a.current||(a.current=!0,Promise.resolve(n()).catch(()=>{}))},[n]),(0,s.jsx)(em,{tenantName:void 0,userEmail:t,hasAspireKeys:!0})}var ev=n(49078),ew=n(37420),ej=n(13811),ek=n(51081),eN=n(84652),e_=n(28991),eS=n(71023),eA=n(84555),eC=n(44678),eE=n(84439),eI=n(90603),eR=n(95740),eT=n(51984),eP=n(96811);function eL(e){let{onVisibilityChange:t}=e,n=(0,a.usePathname)(),{userProfileId:r,tenantKey:i,schema:l,permissions:o,hydrated:c}=(0,q.W)(),{maskPII:d}=(0,ev._)(),u=(null==o?void 0:o.routes.some(e=>"/command-center"===e.routePath&&e.canView))===!0,m=c&&r&&i&&l?"".concat(l,":").concat(i,":").concat(r):null;return m&&u?(0,s.jsx)(eO,{identity:m,pathname:n,maskPII:d,onVisibilityChange:t},m):null}function eO(e){let{identity:t,pathname:n,maskPII:a,onVisibilityChange:i}=e,l="note-task-ready:v1:".concat(t),[o,c]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=()=>{try{let e=localStorage.getItem(l),t=e?JSON.parse(e):[];c(new Set(Array.isArray(t)?t.filter(e=>"string"==typeof e):[]))}catch(e){c(new Set)}};e();let t=t=>{t.key===l&&e()};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[l]);let{data:d,isError:u}=(0,eI.I)({queryKey:["note-task-readiness",t],queryFn:eT.cl,staleTime:0,retry:!1,refetchOnWindowFocus:!0,refetchIntervalInBackground:!1,refetchInterval:e=>{var t;return(null==(t=e.state.data)?void 0:t.batches.some(e=>"pending"===e.status))?5e3:3e4}}),m=o&&!u&&d?(0,eP.MW)(d.batches,o):null,h=m?(0,eP.Ni)(m.id,n):null,p=!!(m&&h&&!n.endsWith("/note-task-review/".concat(m.id)));if((0,r.useEffect)(()=>(null==i||i(p),()=>null==i?void 0:i(!1)),[p,i]),!p||!m||!h)return null;let x=()=>{let e=new Set(o);e.add(m.id);let t=Array.from(e).slice(-200);c(new Set(t));try{localStorage.setItem(l,JSON.stringify(t))}catch(e){}};return(0,s.jsx)("aside",{role:"status","aria-live":"polite",className:"fixed bottom-20 right-4 z-50 w-[calc(100%-2rem)] max-w-sm rounded-xl border border-purple-200 bg-white p-4 shadow-lg sm:right-6",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(eR.A,{"aria-hidden":"true",className:"mt-0.5 h-5 w-5 shrink-0 text-purple-600"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-neutral-900",children:"Your note review is ready"}),m.property_name&&(0,s.jsx)("p",{className:"mt-1 truncate text-sm text-neutral-600",children:a(m.property_name,"property")}),(0,s.jsx)(L(),{href:h,onClick:x,className:"mt-3 inline-flex rounded-md bg-purple-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-purple-700",children:"Review now"})]}),(0,s.jsx)("button",{type:"button",onClick:x,"aria-label":"Dismiss ready alert",className:"rounded p-1 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600",children:(0,s.jsx)(f.A,{"aria-hidden":"true",className:"h-4 w-4"})})]})})}function eF(e){let{children:t}=e,n=(0,a.usePathname)(),[i,l]=(0,r.useState)(!1),o=(0,s.jsx)(eb,{children:(0,s.jsx)(G,{children:t})}),f=(0,d.oE)(n);return(0,eE.gq)(n)?(0,s.jsx)(s.Fragment,{children:t}):(0,s.jsxs)(A,{children:[(0,s.jsx)(c,{}),(0,s.jsxs)(ec,{children:[(0,s.jsx)(w,{}),(0,s.jsx)(en,{children:(0,s.jsx)(eC.WE,{children:(0,s.jsx)(ew.y,{children:(0,s.jsx)(ev.Y,{children:(0,s.jsx)(eS.O,{children:(0,s.jsx)(q.M,{children:(0,s.jsx)(ek.$8,{children:(0,s.jsx)(ej.d,{children:(0,s.jsx)(eN.si,{children:(0,s.jsxs)(R.K5,{children:[(0,s.jsx)(e_.d,{children:(0,s.jsxs)(eA.pA,{children:[(0,s.jsx)(v,{}),(0,s.jsx)(k.GV,{children:(0,s.jsxs)(N.Fc,{children:[f?(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)(m._v,{context:"metrics",action:"fetching"}),children:(0,s.jsx)(u.i,{children:o})}):o,(0,s.jsx)(h.wv,{when:"signed-in",children:(0,s.jsx)(S,{})})]})}),(0,s.jsx)(y,{suppressed:i}),(0,s.jsx)(eL,{onVisibilityChange:l})]})}),(0,s.jsx)(h.wv,{when:"signed-out",children:(0,s.jsx)("a",{href:"https://capsaintelligence.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"fixed bottom-6 left-6 z-40 text-xs text-gray-400 transition-colors hover:text-gray-600",children:"Privacy Policy"})}),(0,s.jsx)(h.wv,{when:"signed-in",children:(0,s.jsx)(T,{})})]})})})})})})})})})})]}),(0,s.jsx)(p.j,{})]})}},13673:()=>{},13811:(e,t,n)=>{"use strict";n.d(t,{d:()=>m,l:()=>h});var s=n(95155),r=n(12115),a=n(73680),i=n(98572),l=n(51493),o=n(51081),c=n(57395);let d={"command-center":"command-center"},u=(0,r.createContext)(null);function m(e){let{children:t}=e,{userId:n,orgId:m}=(0,a.As)(),h="".concat(n,":").concat(m),{preferences:p,preferencesReady:f,error:x,refreshPreferences:b}=(0,i.vT)(),[g,y]=(0,r.useState)({}),v=(0,o.Ly)(),w=(0,r.useCallback)(e=>{var t;let n=d[e];return!!n&&g[n]!==h&&(!v||"none"===(0,c.fc)(v.forPage(n)).kind)&&(!f||(0,l.rZ)(null==(t=p[n])?void 0:t.portfolioSetup))},[v,h,p,f,g]),j=(0,r.useCallback)(e=>{let t=d[e];t&&y(e=>({...e,[t]:h}))},[h]);return(0,s.jsx)(u.Provider,{value:{ready:f,error:x,needsSetup:w,resolveSetup:j,retry:b},children:t})}function h(){let e=(0,r.useContext)(u);if(!e)throw Error("useReportSetup requires ReportSetupProvider");return e}},21142:(e,t,n)=>{Promise.resolve().then(n.bind(n,33465)),Promise.resolve().then(n.bind(n,78543)),Promise.resolve().then(n.bind(n,22004)),Promise.resolve().then(n.bind(n,40877)),Promise.resolve().then(n.bind(n,11526)),Promise.resolve().then(n.t.bind(n,28963,23)),Promise.resolve().then(n.t.bind(n,7098,23)),Promise.resolve().then(n.t.bind(n,13673,23)),Promise.resolve().then(n.bind(n,11167))},27759:(e,t,n)=>{"use strict";function s(e){return"command-center"===e||"command-center-updates"===e||"wip-command-center"===e||"property-profitability"===e}function r(e){return"command-center-updates"===e?"/command-center/updates":"/".concat(e)}function a(e){return"/command-center/updates"===e||"/command-center-updates"!==e&&s(e.slice(1))}function i(e,t,n,a){if(!s(t)||!n||!a)throw Error("Select a saved view and organization before copying a link.");let i=new URL(r(t),new URL(e).origin);return i.searchParams.set("saved_view",n),i.searchParams.set("organization",a),i.toString()}n.d(t,{Pq:()=>i,oE:()=>a,qb:()=>s,wn:()=>r})}
1,50543:(e,t,n)=>{"use strict";n.d(t,{Fc:()=>M,kG:()=>U,IN:()=>K,xy:()=>J});var s=n(95155),r=n(12115),a=n(99776),i=n(90603),l=n(73680),o=n(20063),c=n(90009),d=n(80687),u=n(51932),m=n(1068),h=n(60080),p=n(85767),f=n(85704),x=n(14729);let b="/api/proxy/core-api/guides",g=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function y(e){return null===e||"string"==typeof e}function v(e){return!(!e||"object"!=typeof e||Array.isArray(e))&&"string"==typeof e.guideKey&&y(e.firstShownAt)&&y(e.lastShownAt)&&(null===e.presentation||"expanded"===e.presentation||"collapsed"===e.presentation)&&y(e.dismissedAt)&&y(e.completedAt)}function w(e){let t={"Content-Type":"application/json"};return e&&(t[x.z2]=e),t}async function j(e,t){(0,f.oO)(e);let n=await e.json().catch(()=>({}));throw Error("string"==typeof n.error&&n.error.length>0?n.error:t)}async function k(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=await (0,f.XE)(()=>fetch("".concat(b,"/state"),{method:"GET",headers:w(e.expectedOrganizationId),credentials:"include",signal:AbortSignal.timeout(f.bT)}));t.ok||await j(t,"Failed to load guides: ".concat(t.status));let n=await t.json();if(!n||"object"!=typeof n||!Array.isArray(n.guides)||!n.guides.every(v))throw Error("Unexpected response while loading guides");return{guides:n.guides}}async function N(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(e.length<=80&&g.test(e)))throw Error("Invalid guide key: ".concat(e));let s=await fetch("".concat(b,"/").concat(encodeURIComponent(e),"/state"),{method:"POST",headers:w(n.expectedOrganizationId),credentials:"include",signal:AbortSignal.timeout(f.bT),body:JSON.stringify({action:t})});s.ok||await j(s,"Failed to save guide: ".concat(s.status));let r=await s.json(),a=r&&"object"==typeof r?r.guide:void 0;if(!v(a)||a.guideKey!==e)throw Error("Unexpected response while saving guide");return a}function _(){try{return window.localStorage}catch(e){return null}}function S(e,t){try{e.removeItem(t)}catch(e){console.error("Failed to clear retired guide dismissal",e)}}function A(e,t){return t?e.flatMap(e=>void 0!==e.legacyDismissedStorageKey&&function(e,t){try{return"true"===e.getItem(t)}catch(e){return!1}}(t,e.legacyDismissedStorageKey)?[e.key]:[]):[]}async function C(e){let{definitions:t,states:n,storage:s,recordDismissed:r}=e,a=[],i=[];if(!s)return{recorded:a,failedKeys:i};for(let e of A(t,s)){let l=t.find(t=>t.key===e);if(!l||void 0===l.legacyDismissedStorageKey)continue;let o=n[e];if(void 0!==o&&null!==o.dismissedAt){S(s,l.legacyDismissedStorageKey);continue}try{a.push(await r(e)),S(s,l.legacyDismissedStorageKey)}catch(t){console.error("Failed to save retired dismissal for guide ".concat(e),t),i.push(e)}}return{recorded:a,failedKeys:i}}let E=/^\d{4}-\d{2}-\d{2}$/;function I(e,t){if(!E.test(e.publishedAt))return!1;let n=Date.parse("".concat(e.publishedAt,"T00:00:00Z"));if(Number.isNaN(n))return!1;let s=void 0===e.showForDays?d.IE:e.showForDays,r=t.getTime();return r>=n&&r<n+864e5*s}function R(e,t){return!(void 0!==e.hiddenOnPages&&e.hiddenOnPages.includes(t))&&("any"===e.pages||e.pages.includes(t))}function T(e,t){return"everyone"===e.audience||t}function P(e){return void 0===e||null===e.firstShownAt}function L(e,t){return e.priority!==t.priority?e.priority-t.priority:e.key<t.key?-1:+(e.key>t.key)}function O(e){return e.length>0&&e.every(e=>"complete"===e.state)}let F=new Set(["shown","completed"]);function D(e,t){return void 0===e?e:{...e,...Object.fromEntries(t.map(e=>[e.guideKey,e]))}}let z=(0,r.createContext)(null),q=(0,r.createContext)(null),W=(0,r.createContext)(!1);function M(e){let{children:t}=e,n=(0,o.usePathname)(),f=(0,o.useRouter)(),x=(0,a.jE)(),b=(0,c.rU)(),{loading:g,permissions:y}=(0,m.W)(),v=(0,u.AX)(),w=null!==v&&null!==v.pageAssistant,j=null!==v&&v.assistantOpenCount>0,S=null===v?null:v.requestHelp,{isLoaded:E,isSignedIn:M,userId:K,orgId:U}=(0,l.As)(),J=U||void 0,G=(0,r.useMemo)(()=>E&&M&&K?["guide-states",K,U||null]:null,[E,M,U,K]),V=function(e){let t=(0,r.useCallback)(t=>{let n=window.matchMedia(e);return n.addEventListener("change",t),()=>n.removeEventListener("change",t)},[e]);return(0,r.useSyncExternalStore)(t,()=>window.matchMedia(e).matches,()=>!1)}(null!==b&&b.isPanelOpen?"(min-width: 1024px)":"(min-width: 640px)")&&!(0,p.Vr)(n)&&(null===b||!b.isTvMode),B=(0,i.I)({queryKey:null===G?["guide-states","signed-out"]:G,queryFn:async()=>Object.fromEntries((await k({expectedOrganizationId:J})).guides.map(e=>[e.guideKey,e])),enabled:null!==G&&V,staleTime:1/0,gcTime:1/0}),Y=null===G?void 0:B.data,H=B.error,Q=B.refetch,[X]=(0,r.useState)(()=>new Set(A(d.Ee,_()))),[$,Z]=(0,r.useState)([]),[ee,et]=(0,r.useState)(null),[en,es]=(0,r.useState)(null),er=(0,r.useRef)(new Map),ea=(0,r.useRef)(0),ei=(0,r.useRef)(new Map),el=(0,r.useRef)(new Set),eo=(0,r.useRef)(new Set),ec=(0,r.useRef)(!1),ed=(0,r.useRef)(n);(0,r.useEffect)(()=>{H&&console.error("Failed to load guides",H)},[H]),(0,r.useEffect)(()=>{ed.current!==n&&(ed.current=n,et(e=>null!==e&&e.pathname!==n?null:e),es(null),H&&Q())}
1,[n,Q,H]);let eu=(0,r.useCallback)(e=>{null!==G&&x.setQueryData(G,e)},[x,G]);(0,r.useEffect)(()=>{void 0===Y||0===X.size||ec.current||(ec.current=!0,C({definitions:d.Ee,states:Y,storage:_(),recordDismissed:e=>N(e,"dismissed",{expectedOrganizationId:J})}).then(e=>{let{recorded:t}=e;t.length>0&&eu(e=>D(e,t))}))},[J,X,Y,eu]);let em=(0,r.useCallback)((e,t)=>{if(null===G)return;let n=x.getQueryData(G);if(void 0===n)return;("collapsed"===t||"dismissed"===t)&&et(t=>null!==t&&t.key===e?null:t);let s=n[e];ea.current+=1;let r=ea.current;er.current.set(e,r);let a=()=>er.current.get(e)===r;eu(n=>D(n,[function(e,t,n,s){let r=void 0!==e?e:{guideKey:t,firstShownAt:null,lastShownAt:null,presentation:null,dismissedAt:null,completedAt:null};switch(n){case"shown":return{...r,firstShownAt:null===r.firstShownAt?s:r.firstShownAt,lastShownAt:s};case"expanded":case"collapsed":return{...r,presentation:n};case"dismissed":return{...r,dismissedAt:s};case"completed":return{...r,completedAt:null===r.completedAt?s:r.completedAt}}}(s,e,t,new Date().toISOString())]));let i=ei.current,l=()=>N(e,t,{expectedOrganizationId:J}),o=i.get(e),c=void 0===o?l():o.then(l),d=c.then(()=>void 0,()=>void 0);i.set(e,d),d.then(()=>{i.get(e)===d&&i.delete(e)}),c.then(n=>{a()&&(eu(e=>D(e,[n])),F.has(t)||es(t=>null!==t&&t.guideKey===e?null:t))},n=>{console.error("Failed to save guide ".concat(e," (").concat(t,")"),n),!F.has(t)&&a()&&(eu(t=>{if(void 0===t)return t;let n={...t};return void 0===s?delete n[e]:n[e]=s,n}),es({guideKey:e,message:"We couldn't save that change. Try again."}))})},[J,x,G,eu]);(0,r.useEffect)(()=>{if(void 0!==Y)for(let e of $){if(!e.allComplete||e.pathname!==n)continue;let t=Y[e.key];(void 0===t||null===t.completedAt&&null===t.dismissedAt)&&(eo.current.has(e.key)||(eo.current.add(e.key),em(e.key,"completed")))}},[$,n,em,Y]);let eh=g||void 0===y?null:y,ep=(0,r.useMemo)(()=>{let e=new Map;if(null===eh)return e;let t={permissions:eh,pageAssistantAvailable:w,assistantOpenedThisSession:j};for(let n of d.Ee){if("announcement"!==n.kind)continue;let s=function(e,t){if("page-assistant"===e.requires&&!t.pageAssistantAvailable)return null;let n=e.buildSteps(t);return null!==n&&n.length>0?n:null}(n,t);null!==s&&e.set(n.key,s)}return e},[j,w,eh]);(0,r.useEffect)(()=>{if(void 0===Y||null===eh)return;let e=new Date;for(let t of d.Ee){if("announcement"!==t.kind||!function(e,t){let{now:n,pathname:s,isSuperAdmin:r}=t;return I(e,n)&&T(e,r)&&R(e,s)}(t,{now:e,pathname:n,isSuperAdmin:eh.isSuperAdmin}))continue;let s=t.key,r=ep.get(s);if(void 0===r||!O(r))continue;let a=Y[s];(void 0===a||null===a.completedAt&&null===a.dismissedAt)&&(eo.current.has(s)||(eo.current.add(s),em(s,"completed")))}},[ep,n,eh,em,Y]);let ef=(0,r.useMemo)(()=>{if(!V||void 0===Y||null===eh)return null;let e=new Set(X);for(let t of d.Ee){if("announcement"!==t.kind)continue;let n=ep.get(t.key);(void 0===n||O(n))&&e.add(t.key)}let t=function(e){let{definitions:t,pageGuides:n,states:s,now:r,isSuperAdmin:a,pathname:i,unavailableKeys:l,impressionInProgress:o,externalPermanentGuide:c}=e,d=e=>T(e,a)&&R(e,i),u=e=>{var t;return(void 0===(t=s[e.key])||null===t.dismissedAt&&null===t.completedAt)&&!l.has(e.key)},m=t.filter(e=>"announcement"===e.kind),h=m.filter(e=>d(e)&&u(e)&&I(e,r)).sort(L);if(null!==o&&o.pathname===i){let e=h.find(e=>e.key===o.key);if(void 0!==e)return{definition:e,firstImpression:!0,presentation:"expanded"}}let p=h.find(e=>{let t;return P(s[e.key])&&(t=e.key,!m.some(e=>{if(e.key===t)return!1;let n=s[e.key];if(void 0===n||null===n.firstShownAt)return!1;let a=Date.parse(n.firstShownAt);return!Number.isNaN(a)&&r.getTime()-a<864e5}))});if(void 0!==p)return{definition:p,firstImpression:!0,presentation:"expanded"};if(c)return null;let f=t.filter(e=>"page_setup"===e.kind&&d(e)&&n.some(t=>t.key===e.key&&t.pathname===i)).sort(L)[0];if(void 0!==f&&u(f)){let e=n.find(e=>e.key===f.key&&e.pathname===i);if(void 0!==e&&!e.allComplete){let e=s[f.key];return{definition:f,firstImpression:!1,presentation:void 0!==e&&"collapsed"===e.presentation?"collapsed":"expanded"}}}let x=h.find(e=>!P(s[e.key]));if(void 0===x)return null;let b=s[x.key];return{definition:x,firstImpression:!1,presentation:void 0!==b&&"expanded"===b.presentation?"expanded":"collapsed"}}({definitions:d.Ee,pageGuides:$,states:Y,now:new Date,isSuperAdmin:eh.isSuperAdmin,pathname:n,unavailableKeys:e,impressionInProgress:ee,externalPermanentGuide:"/command-center"===n});if(null===t)return null;let{definition:s}=t;if("page_setup"===s.kind){let e=$.find(e=>e.key===s.key&&e.pathname===n);return void 0===e?null:{...t,items:e.items,registration:e,steps:null}}let r=ep.get(s.key);return void 0===r?null:{...t,items:r,registration:null,steps:r}}
1,[ep,V,ee,X,$,n,eh,Y]),ex=null===ef?null:ef.definition.key,eb=null!==ef&&ef.firstImpression;(0,r.useEffect)(()=>{null!==ex&&(eb&&et(e=>null!==e&&e.key===ex&&e.pathname===n?e:{key:ex,pathname:n}),el.current.has(ex)||(el.current.add(ex),em(ex,"shown"),(0,h.sx)({eventName:"feature_notification_shown",properties:{notification_id:ex}})))},[eb,ex,n,em]);let eg=(0,r.useCallback)((e,t)=>{if(null===ef||ef.definition.key!==e)return;if((0,h.sx)({eventName:"feature_notification_clicked",properties:{notification_id:e,item_id:t}}),null!==ef.registration)return void ef.registration.onOpenItem(t);let n=ef.steps.find(e=>e.id===t);if(void 0!==n){if("link"===n.action.kind)return void f.push(n.action.href);w&&null!==S&&S()}},[w,S,ef,f]),ey=(0,r.useCallback)(e=>(Z(t=>[...t.filter(t=>t.key!==e.key),e]),()=>{Z(t=>t.filter(t=>t!==e))}),[]),ev=(0,r.useMemo)(()=>({registerPageGuide:ey}),[ey]),ew=(0,r.useMemo)(()=>null===ef?null:{definition:ef.definition,firstImpression:ef.firstImpression,presentation:ef.presentation,items:ef.items},[ef]),ej=null!==en&&null!==ew&&en.guideKey===ew.definition.key?en.message:null,ek=(0,r.useMemo)(()=>({active:ew,saveError:ej,recordAction:em,openItem:eg}),[ew,ej,eg,em]),eN=null!==ew&&"announcement"===ew.definition.kind&&ew.firstImpression;return(0,s.jsx)(z.Provider,{value:ev,children:(0,s.jsx)(W.Provider,{value:eN,children:(0,s.jsx)(q.Provider,{value:ek,children:t})})})}function K(){return(0,r.useContext)(q)}function U(){return(0,r.useContext)(W)}function J(e,t){let{items:n,onOpenItem:s,allComplete:a,ready:i}=t,l=(0,r.useContext)(z),c=(0,o.usePathname)(),d=(0,r.useRef)(s);(0,r.useEffect)(()=>{d.current=s},[s]);let u=JSON.stringify(n);(0,r.useEffect)(()=>
1{if(l&&i)return l.registerPageGuide({key:e,pathname:c,allComplete:a,items:JSON.parse(u),onOpenItem:e=>d.current(e)})},[a,e,u,c,i,l])}},51984:(e,t,n)=>{"use strict";n.d(t,{EV:()=>m,Jh:()=>d,O:()=>l,aT:()=>o,cl:()=>c,hD:()=>a,hU:()=>u,s0:()=>h,sw:()=>p});var s=n(85704);let r="/api/proxy/command-center";class a extends Error{constructor(e,t,n){super(e),this.errorCode=t,this.details=n}}async function i(e){var t;(0,s.oO)(e);let n=await e.text(),r=n?JSON.parse(n):{};if(!e.ok)throw new a((null==r?void 0:r.error)||e.statusText||"Request failed",null==r?void 0:r.error_code,r&&"object"==typeof r?r:void 0);return null!=(t=null==r?void 0:r.data)?t:r}async function l(e){return i(await fetch("".concat(r,"/properties/notes/task-suggestions"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:"include",signal:AbortSignal.timeout(3e4)}))}async function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e4;return i(await fetch("".concat(r,"/note-task-review/").concat(e),{credentials:"include",signal:AbortSignal.timeout(Math.min(3e4,t))}))}async function c(){return i(await fetch("".concat(r,"/note-task-review"),{credentials:"include",signal:AbortSignal.timeout(3e4)}))}async function d(e,t,n){return i(await fetch("".concat(r,"/note-task-review/").concat(e,"/items/").concat(t,"/accept"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),credentials:"include",signal:AbortSignal.timeout(3e4)}))}async function u(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i(await fetch("".concat(r,"/note-task-review/").concat(e,"/items/").concat(t,"/dismiss"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),credentials:"include",signal:AbortSignal.timeout(3e4)}))}async function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(await fetch("".concat(r,"/note-task-review/").concat(e,"/note-summary/accept"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"include",signal:AbortSignal.timeout(3e4)}))}async function h(e){return i(await fetch("".concat(r,"/note-task-review/").concat(e,"/note-summary/dismiss"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({}),credentials:"include",signal:AbortSignal.timeout(3e4)}))}async function p(e){let t=new URLSearchParams({property_id:String(e)});return i(await fetch("".concat(r,"/properties/note-task-batches?").concat(t),{method:"GET",credentials:"include",signal:AbortSignal.timeout(3e4)}))}},62160:(e,t,n)=>{"use strict";n.d(t,{h:()=>u,i:()=>d});var s=n(95155),r=n(73680),a=n(20063),i=n(84439),l=n(27759),o=n(97839),c=n(69656);function d(e){let{children:t}=e,n=(0,a.useSearchParams)(),l=(0,a.usePathname)(),{isLoaded:d,userId:m,orgId:h}=(0,r.As)(),p=n.get("saved_view"),f=n.get("organization");if(""===p||null!==f&&(!f||!p))return(0,s.jsx)(u,{pageKey:l.slice(1),message:"This link is incomplete. Ask the sender to use Copy link on the saved view and send it again."});if(null!==p&&null!==f){if(!d)return(0,s.jsx)(o._v,{context:"metrics",action:"fetching"});if(!m){let e=(0,i.Wg)(l,"?".concat(n.toString()));return(0,s.jsxs)("main",{className:"mx-auto max-w-xl px-6 py-12",children:[(0,s.jsx)("p",{children:"Sign in to open this saved view."}),(0,s.jsx)("a",{className:"font-semibold underline",href:"".concat(i._h,"?").concat(new URLSearchParams({redirect_url:e})),children:"Sign in"})]})}if(!f||h!==f)return(0,s.jsx)("main",{className:"mx-auto max-w-xl px-6 py-12",children:(0,s.jsxs)("div",{role:"alert",className:"rounded-xl border border-amber-200 bg-amber-50 p-6 text-amber-950",children:[(0,s.jsx)("h1",{className:"font-semibold",children:"Choose the organization for this saved view"}),(0,s.jsx)("p",{className:"mt-2 text-sm",children:"Switch to the organization this link was shared from. If it is not available, ask the sender to confirm your access and the organization name."}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(c.F,{})})]})})}return(0,s.jsx)("div",{className:"contents",children:t},"".concat(p,":").concat(f))}function u(e){let{message:t,onRetry:n,pageKey:r}=e;return(0,s.jsx)("main",{className:"mx-auto max-w-xl px-6 py-12",children:(0,s.jsxs)("div",{role:"alert",className:"rounded-xl border border-amber-200 bg-amber-50 p-6 text-amber-950",children:[(0,s.jsx)("h1",{className:"font-semibold",children:"This saved view could not be opened"}),(0,s.jsx)("p",{className:"mt-2 text-sm",children:t}),(0,s.jsxs)("div",{className:"mt-4 flex gap-4",children:[n&&(0,s.jsx)("button",{type:"button",onClick:n,className:"font-semibold underline",children:"Try again"}),(0,s.jsx)("a",{href:(0,l.wn)(r),className:"font-semibold underline",children:"Choose another view"})]})]})})}},76394:(e,t,n)=>{"use strict";n.d(t,{w:()=>x});var s=n(95155),r=n(12115),a=n(5917),i=n(52056),l=n(99051),o=n(35299),c=n(12108),d=n(65229),u=n(24033),m=n(93141),h=n(52987),p=n(64269);function f(e){let{state:t}=e;return"complete"===t?(0,s.jsx)("span",{className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-emerald-100 text-emerald-700",children:(0,s.jsx)(a.A,{className:"h-3.5 w-3.5","aria-hidden":"true"})}):"attention"===t?(0,s.jsx)(i.A,{className:"mt-0.5 h-5 w-5 shrink-0 text-amber-600","aria-hidden":"true"}):(0,s.jsx)(l.A,{className:"mt-0.5 h-5 w-5 shrink-0 text-neutral-300","aria-hidden":"true"})}function x(e){var t;let{visible:n,presentation:a,positionClass:x,instanceKey:b,content:g,sections:y,loading:v,error:w,destinationError:j,onRetry:k,onExpand:N,onCollapse:_,onDismiss:S,onOpenItem:A,onAction:C,onCollapsedTriggerChange:E}=e,[I,R]=(0,r.useState)(()=>new Set(y.filter(e=>e.expandedByDefault).map(e=>e.id))),T=(0,r.useRef)(a),P=(0,r.useRef)("restore-guide"),L=(0,r.useRef)(null),O=(0,r.useRef)(null),F=JSON.stringify(y.filter(e=>e.expandedByDefault).map(e=>e.id)),D=(0,r.useCallback)(e=>{L.current=e,null==E||E(e)},[E]),z=(0,r.useRef)(b);if((0,r.useEffect)(()=>{let e=z.current!==b;z.current=b;let t=JSON.parse(F);R(n=>{let s=e?new Set:new Set(n);
1return t.forEach(e=>s.add(e)),s})},[F,b]),(0,r.useEffect)(()=>{if(T.current===a)return;let e=T.current,t=P.current;T.current=a,P.current="restore-guide";let n=window.requestAnimationFrame(()=>{!function(e){let{previousPresentation:t,presentation:n,collapseFocusIntent:s,collapsedTrigger:r,collapseButton:a}=e;if(t!==n){if("collapsed"===n){"restore-guide"===s&&(null==r||r.focus());return}null==a||a.focus()}}({previousPresentation:e,presentation:a,collapseFocusIntent:t,collapsedTrigger:L.current,collapseButton:O.current})});return()=>window.cancelAnimationFrame(n)},[a]),!n)return null;let q=null==(t=y.find(e=>null!==e.progress))?void 0:t.progress,W=()=>{C("dismissed"),S()};return"collapsed"===a?(0,s.jsxs)("section",{"aria-label":g.ariaLabel,className:(0,p.cn)("fixed bottom-4 left-4 z-30 flex w-[min(20rem,calc(100vw-2rem))] items-center gap-3 rounded-xl border border-neutral-200 bg-white p-3 shadow-xl md:bottom-6",x),children:[(0,s.jsxs)("button",{ref:D,type:"button",onClick:()=>{C("expanded"),N()},className:"flex min-w-0 flex-1 items-center gap-3 rounded-md text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2","aria-label":g.collapsedAriaLabel,children:[(0,s.jsx)("span",{className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-blue-50 text-sm font-semibold text-blue-700",children:null!==j||null!==w?(0,s.jsx)(i.A,{className:"h-4 w-4 text-amber-600","aria-hidden":"true"}):q?"".concat(q.completedCount,"/").concat(q.totalCount):v?(0,s.jsx)(o.A,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}):(0,s.jsx)(l.A,{className:"h-4 w-4 text-neutral-400","aria-hidden":"true"})}),(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"block truncate text-sm font-semibold text-neutral-900",children:g.collapsedTitle}),(0,s.jsx)("span",{className:"block text-xs text-neutral-500",children:g.collapsedDetail})]}),(0,s.jsx)(c.A,{className:"h-4 w-4 shrink-0 text-neutral-500","aria-hidden":"true"})]}),(0,s.jsx)("button",{type:"button",onClick:W,className:"rounded-md p-1.5 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500","aria-label":g.dismissLabel,children:(0,s.jsx)(d.A,{className:"h-4 w-4","aria-hidden":"true"})})]}):(0,s.jsxs)("section",{"aria-labelledby":g.titleId,className:(0,p.cn)("fixed bottom-4 left-4 z-30 max-h-[min(42rem,calc(100vh-6rem))] w-[min(22rem,calc(100vw-2rem))] overflow-y-auto rounded-xl border border-neutral-200 bg-white shadow-xl md:bottom-6",x),children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 border-b border-neutral-100 px-4 py-3.5",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-blue-700",children:g.eyebrow}),(0,s.jsx)("h2",{id:g.titleId,className:"mt-0.5 text-base font-semibold text-neutral-900",children:g.title}),(0,s.jsx)("p",{className:"mt-1 text-xs leading-5 text-neutral-600",children:g.description})]}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,s.jsx)("button",{ref:O,type:"button",onClick:()=>{C("collapsed"),P.current="restore-guide",_()},className:"rounded-md p-1.5 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500","aria-label":g.collapseLabel,children:(0,s.jsx)(u.A,{className:"h-4 w-4","aria-hidden":"true"})}),(0,s.jsx)("button",{type:"button",onClick:W,className:"rounded-md p-1.5 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500","aria-label":g.dismissLabel,children:(0,s.jsx)(d.A,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),(0,s.jsxs)("div",{className:"px-4 py-3.5",children:[j?(0,s.jsx)("div",{role:"alert",className:"mb-3 rounded-lg border border-amber-200 bg-amber-50 p-3 text-xs leading-5 text-amber-900",children:j}):null,v&&void 0===q?(0,s.jsxs)("div",{role:"status",className:"flex items-center gap-2 rounded-lg bg-neutral-50 px-3 py-4 text-sm text-neutral-600",children:[(0,s.jsx)(o.A,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),g.loadingLabel]}):w&&void 0===q?(0,s.jsxs)("div",{role:"alert",className:"rounded-lg border border-amber-200 bg-amber-50 p-3",children:[(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(i.A,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-700","aria-hidden":"true"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-amber-900",children:g.errorTitle}),(0,s.jsx)("p",{className:"mt-1 text-xs leading-5 text-amber-800",children:g.errorDescription})]})]}),(0,s.jsxs)("button",{type:"button",onClick:k,className:"mt-3 inline-flex items-center gap-1.5 rounded-md border border-amber-300 bg-white px-2.5 py-1.5 text-xs font-medium text-amber-900 hover:bg-amber-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-600",children:[(0,s.jsx)(m.A,{className:"h-3.5 w-3.5","aria-hidden":"true"}),g.retryLabel]})]}):y.length>0?(0,s.jsx)("div",{className:"space-y-3",children:y.map(e=>{let t=!e.collapsible||I.has(e.id);return(0,s.jsxs)("div",{className:e.collapsible?"border-t border-neutral-100 pt-3":void 0,children:[e.progress?(0,s.jsxs)("div",{className:"mb-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,s.jsx)("span",{className:"font-medium text-neutral-700",children:e.label}),(0,s.jsx)("span",{"aria-live":"polite",className:"font-semibold text-neutral-900",children:e.progress.summary})]}),(0,s.jsx)("progress",{className:"mt-2 h-1.5 w-full overflow-hidden rounded-full accent-emerald-600",max:e.progress.totalCount,value:e.progress.completedCount,"aria-label":e.progress.ariaLabel})]}):e.collapsible?(0,s.jsxs)("button",{type:"button",onClick:()=>R(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),className:"flex w-full items-center justify-between rounded-md px-2 py-1.5 text-left hover:bg-neutral-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500","aria-expanded":t,"aria-controls":"".concat(g.titleId,"-").concat(e.id),children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wide text-neutral-600",children:e.label}),e.summary?(0,s.jsx)("span",{className:"ml-2 text-xs text-neutral-400",children:e.summary}):null]}),t?(0,s.jsx)(c.A,{className:"h-4 w-4 text-neutral-500","aria-hidden":"true"}):(0,s.jsx)(u.A,{className:"h-4 w-4 text-neutral-500","aria-hidden":"true"})]}):(0,s.jsx)("p",{className:"mb-2 px-2 text-xs font-semibold uppercase tracking-wide text-neutral-600",children:e.label}),t?(0,s.jsx)("ol",{id:"".concat(g.titleId,"-").concat(e.id),className:"mt-1 space-y-1","aria-label":e.ariaLabel,children:e.items.map(e=>(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",onClick:()=>{var t;return t=e.id,void(C("collapsed"),P.current="preserve-destination",_
1(),A(t))},className:"group flex w-full items-start gap-2.5 rounded-lg px-2 py-2 text-left hover:bg-neutral-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500","aria-label":"".concat(e.title,": ").concat(e.statusLabel,". Open workflow"),children:[(0,s.jsx)(f,{state:e.state}),(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-neutral-900",children:e.title}),(0,s.jsx)("span",{className:(0,p.cn)("shrink-0 text-[11px] font-medium","complete"===e.state?"text-emerald-700":"attention"===e.state?"text-amber-700":"text-neutral-500"),children:e.statusLabel})]}),(0,s.jsx)("span",{className:"mt-0.5 block text-xs leading-4 text-neutral-500",children:e.description})]}),(0,s.jsx)(h.A,{className:"mt-1 h-3.5 w-3.5 shrink-0 text-neutral-300 transition-colors group-hover:text-blue-600","aria-hidden":"true"})]})},e.id))}):null]},e.id)})}):null]})]})}},78425:(e,t,n)=>{"use strict";n.d(t,{LF:()=>a});var s=n(12115);let r='button:not([disabled]),[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';function a(e){let{open:t,busy:n,suspended:a=!1,initialFocusRef:i,onClose:l}=e,o=(0,s.useRef)(null),c=(0,s.useRef)(n),d=(0,s.useRef)(a),u=(0,s.useRef)(l);return c.current=n,d.current=a,u.current=l,(0,s.useEffect)(()=>{if(!t||"undefined"==typeof document)return;let e=document.activeElement instanceof HTMLElement?document.activeElement:null,n=window.requestAnimationFrame(()=>{var e;let t=o.current,n=null==t?void 0:t.querySelector(r),s=null==i?void 0:i.current,a=s&&(null==t?void 0:t.contains(s))?s:n;null==(e=null!=a?a:t)||e.focus()}),s=e=>{var t,n,s,a;if(d.current)return;if("Escape"===e.key){c.current||(e.preventDefault(),u.current());return}if("Tab"!==e.key)return;let i=o.current;if(!i)return;let l=Array.from(i.querySelectorAll(r));if(0===l.length){e.preventDefault(),i.focus();return}let m=(n=l.indexOf(document.activeElement),s=l.length,a=e.shiftKey,s<=0?null:n<0?a?s-1:0:a&&0===n?s-1:a||n!==s-1?null:0);null!==m&&(e.preventDefault(),(null!=(t=l[m])?t:i).focus())};return document.addEventListener("keydown",s),()=>{window.cancelAnimationFrame(n),document.removeEventListener("keydown",s),(null==e?void 0:e.isConnected)&&e.focus()}},[i,t]),o}},80687:(e,t,n)=>{"use strict";n.d(t,{IE:()=>i,Ee:()=>o,_d:()=>l});let s="/admin/ai-connectors",r="Open guide",a={id:"connect-ai-workspace",title:"Connect Claude or ChatGPT",description:"Follow the setup steps to add Capsa to your AI workspace.",state:"not_started",statusLabel:r,action:{kind:"link",href:s}},i=30,l="property-profitability-more-columns",o=[{key:l,kind:"page_setup",audience:"everyone",pages:["/property-profitability"],priority:10,copy:{eyebrow:"Property Profitability",title:"Add more columns",description:"Add hours, labor cost, and variance columns to your table."},legacyDismissedStorageKey:"capsa:feature_dismissed:profitability-extended-metrics-2026"},{key:"ai-connector-setup",kind:"announcement",audience:"everyone",pages:"any",hiddenOnPages:["/admin/ai-connectors"],priority:20,publishedAt:"2026-09-29",showForDays:90,copy:{eyebrow:"Capsa AI",title:"Use Capsa in Claude or ChatGPT",description:"Ask about your properties, follow-ups, and visits right from your AI workspace."},buildSteps:e=>{let{permissions:t}=e;return void 0===t.connectorAccess?null:function(e){let{isSuperAdmin:t,connectorEnabled:n}=e;return t?[{id:"turn-on-for-yourself",title:"Turn on the AI Connector for yourself",description:"Give yourself access in Users & Permissions.",state:n?"complete":"not_started",statusLabel:n?"Complete":"Not started",action:{kind:"link",href:"/permissions?connector=self#ai-connector-access"}},a,{id:"give-teammates-access",title:"Give teammates access",description:"Choose who can use the AI Connector and what it can do.",state:"not_started",statusLabel:"Open settings",action:{kind:"link",href:"/permissions#ai-connector-access"}}]:n?[a,{id:"try-starter-question",title:"Try a starter question",description:"Ask Capsa about follow-ups, upcoming visits, or a property.",state:"not_started",statusLabel:r,action:{kind:"link",href:s}}]:[{id:"request-access",title:"Ask your Capsa super admin to turn on your access",description:"A super admin can turn on the AI Connector for you in Users & Permissions.",state:"not_started",statusLabel:r,action:{kind:"link",href:s}}]}({isSuperAdmin:t.isSuperAdmin,connectorEnabled:t.connectorAccess.enabled})}},{key:"page-assistant-intro",kind:"announcement",audience:"everyone",pages:"any",requires:"page-assistant",priority:15,publishedAt:"2026-10-01",showForDays:90,copy:{eyebrow:"Capsa AI",title:"Ask about this view",description:"Ask questions about this report and get suggested filter or column changes you can apply. It is always one click away: the purple ? button at the bottom right."},buildSteps:e=>{let{assistantOpenedThisSession:t}=e;return[{id:"open-assistant",title:"Ask about this view",description:"Open the assistant beside this report.",state:t?"complete":"not_started",statusLabel:t?"Complete":"Open",action:{kind:"open-assistant"}}]}}]},96811:(e,t,n)=>{"use strict";n.d(t,{IZ:()=>s,MW:()=>i,Ni:()=>l,Xf:()=>a,kj:()=>r});let s=5e3,r=6e5,a="This usually takes under a minute. You can leave this page — we'll email you when your review is ready.";function i(e,t){var n;return null!=(n=e.find(e=>"ready"===e.status&&!t.has(e.id)))?n:null}function l(e,t){let n="/m"===t||t.startsWith("/m/")?"/m":"/command-center";return"".concat(n,"/note-task-review/").concat(encodeURIComponent(e))}}},e=>{e.O(0,[6030,2978,2545,3680,9779,2619,6976,740,5376,466,6693,9108,7236,4678,5890,86,2713,3720,360,1068,5914,8572,9252,5773,4011,4955,5137,1673,4652,9970,8441,1255,7358],()=>e(e.s=21142)),_N_E=e.O()}]);

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.