UNPKG

decocms

Version:

Deco CMS โ€” Self-hostable MCP Gateway for managing AI connections and tools

2 lines (1 loc) โ€ข 46.8 kB
import{c as _,b as S,J as Te,j as l,m as T,B as de,ap as $e,r as ue,n as q,e3 as xe,E as fe,t as Ae,u as qe}from"./index-ztdGKvBm.js";import{ChatLayout as Qe}from"./index-Co7YBLf6.js";import{a as Pe,T as he,B as ge,Q as be,r as Fe,o as Oe,C as Le,P as Be}from"./plan-page-CqrnghH1.js";import{a7 as Me,f as ye,u as je,ad as Ie,ae as ve,b as Ee}from"./chat-context-DFEln8mI.js";import{e as De}from"./input-B2QsYffT.js";import{B as ce}from"./badge-DcUertOZ.js";import{i as we}from"./ArrowRight-mzMrxxYI.js";import{t as Ke}from"./ChevronDown-XsLJSrfl.js";import{aR as ze,a as Ge,E as Re,by as Ve,a7 as Ue,bw as Ye}from"./agent-icon-BYWtutu9.js";import{s as We}from"./File02-DaYek2y9.js";import{a as He}from"./UserCheck01-k-4bTA2h.js";import{i as Je}from"./ArrowLeft-B0PZnf1E.js";import{d as Xe}from"./delay-CnY5UFtP.js";import{u as Ze}from"./use-organization-settings-C2vcrj4S.js";import"./use-mobile-C_hdQY5I.js";import"./tooltip-Bm0P1gm_.js";import"./index-CDQbtG2e.js";import"./MessageCircle01-BG1RhOiZ.js";import"./XClose-CmTuu4UN.js";import"./thread-button-CP83i3PG.js";import"./use-sidebar-collapsed-Cy-mIzeN.js";import"./sheet-C-umRrOH.js";import"./use-chat-layout-state-Im_c7sw4.js";import"./use-panel-navigate-0z93k6Ut.js";import"./thread-route-CfpvvkkL.js";import"./use-project-scope-BwqdbGG4.js";import"./repository-binding-D_Xc1yRH.js";import"./use-mcp-client-2MG3LveS.js";import"./auth-C82OPjUx.js";import"./toolbar-icon-button-Cz-oOJ1w.js";import"./use-in-settings-CFQ9B3W2.js";import"./resizable-DNBx7bMi.js";import"./route-page-header-CApA0aIo.js";import"./LayoutLeft-DDtN-od-.js";import"./use-current-view-DBmQQ8uy.js";import"./UserSquare-CafFh5_d.js";import"./textarea-viSdm6BE.js";import"./shell-layout-UF80oiAz.js";import"./Globe04-CeAQ1YNm.js";import"./use-deployment-admin-Cr4LWHG9.js";import"./admin-fetch-BhTJlAsX.js";import"./use-org-notice-Bg0zOPPj.js";import"./thread-intent-DyZ5A9F9.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DdfLfQcH.js";import"./task-board-i6qU2BVR.js";import"./schema-Bb-DbvPZ.js";import"./session-runtime-DBl1Hlcw.js";import"./CheckCircle-DZ8MNpCP.js";import"./Monitor01-DMFbvudn.js";import"./Zap-CBJ7My90.js";import"./Plus-DWySsEmB.js";import"./Tool01-BCJ5kyrz.js";import"./command-C3tlrKUq.js";import"./index-DMpANy5-.js";import"./SearchMd-BD2qldmS.js";import"./integration-icon-Bo-3z9o3.js";import"./LinkBroken01-DfUhihLM.js";import"./project-icon-fQqckccl.js";import"./use-navigate-to-agent-Cw8_3uU5.js";import"./use-debounced-value-DO5dvp6c.js";import"./new-project-dialog-BW6Lh52P.js";import"./label-8UxgpYiA.js";import"./repository-picker-CSaozawA.js";import"./github-icon-Bq9Ot22_.js";import"./useInfiniteQuery-Ypmdjx1e.js";import"./infiniteQueryObserver-C3KEOANj.js";import"./collection-search-DkVgkcUC.js";import"./BookOpen01-DU-B3R7s.js";import"./ShoppingBag01-BbjW7cod.js";import"./new-project-store-DID5OVrt.js";import"./legacy-admin-welcome-dialog-plmLACwz.js";import"./drawer-CROtV2u4.js";import"./required-auth-layout-Cwtu4iIe.js";import"./use-view-draft-kind-BopwZu5H.js";import"./use-blog-view-DMfZjkz0.js";import"./use-org-sso-_fzcS8V-.js";import"./index-5erPNBmj.js";import"./ArrowUp-D5DDc3Cp.js";import"./pair-DmyTA2cC.js";import"./collapsible-CadTVXY4.js";import"./use-copy-DT4_uVrH.js";import"./usage-stats-B0_Yl-r0.js";import"./utils-CVEq3hMx.js";import"./markdown-CJR_ooUO.js";import"./gateway-client-B4qzR3sF.js";import"./form-DlZ0KMAb.js";import"./use-entitlements-Gn1rhCN5.js";import"./task-key-Bt60Ndov.js";import"./use-task-board-items-D2aUd0HA.js";import"./use-decopilot-events-43RPCkUH.js";import"./config-LEYSFIMn.js";import"./AlertCircle-BlMH0XE7.js";import"./Eye-kjjhS0vP.js";import"./task-route-C3cK6F8S.js";import"./project-index-C2IrSomv.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DU6s3Olv.js";import"./types-5-cDe_8u.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./Image01-BcIZ5mtf.js";import"./use-connection-CcG4QE1K.js";import"./use-mcp-prompts-qJSiAdA5.js";import"./use-thread-outputs-BK5BfLdO.js";import"./file-type-icon-CdjLDWdN.js";import"./content-changes-BFwm7dNe.js";import"./agent-capabilities-CyWfHGWp.js";import"./index-CJKec1wg.js";import"./use-ai-providers-Ct2xvYDX.js";import"./checkbox-QUuOza1H.js";import"./Minus-hZzPDO0w.js";import"./select-CxXZwsSr.js";import"./index-BdQq_4o_.js";import"./ChevronUp-BQktpZWC.js";import"./ChevronSelectorVertical-CB0fn1Nq.js";import"./Key01-CaJGjh13.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./use-deco-credits-yGgE3j79.js";import"./feature-paywall-DL1BXqDM.js";import"./plan-ladder-C3ogU-RT.js";import"./use-date-fns-locale-CloMwBOl.js";import"./use-org-fs-D9dHgOYs.js";import"./icon-button-BH8Qviy5.js";import"./chat-draft-DNEqrl5p.js";import"./use-voice-input-BMrsODyI.js";import"./popover-C4oz5B-L.js";import"./Upload01-q-rKSvZf.js";import"./tabs-nQ7_UOyl.js";import"./active-indicator-CCMhAsc_.js";import"./toggle-group-yQeAFu4u.js";import"./input-aLblPHPG.js";import"./suggestion-aR93AXr2.js";import"./question-004-sINsf4GQ.js";import"./add-connection-dialog-CS6ZsWUV.js";import"./extract-connection-data-DjYTV7t7.js";import"./metadata-D72DunRR.js";import"./connection-C8I8wKeO.js";import"./url-slug-CII_0B7H.js";import"./connection-card-CTJwLo8p.js";import"./connection-slug-BNBBglpK.js";import"./schema-D_OZwHJO.js";import"./connection-form-helpers-BjSA2uCL.js";import"./Trash01-BxBhF2b8.js";import"./authenticate-and-persist-oauth-87e1Ix6y.js";import"./mcp-oauth-BBSVAQ62.js";import"./mcp-oauth-Alln4VX8.js";import"./collection-tabs-Cju2BOrS.js";import"./use-infinite-scroll-DdrDrAAo.js";import"./useSuspenseInfiniteQuery-Pk4rU2Ft.js";import"./CreditCard01-MY4ouqtl.js";import"./SwitchHorizontal01-CMdpIiQk.js";import"./Fingerprint04-B2fDIuT8.js";import"./Sun-O9TdKcV_.js";import"./Play-BCFOaioW.js";import"./Users01-DM58_gUL.js";function ie(){const r=_.c(26),e=S(),[t]=Te(),{language:s}=t;let i;r[0]!==s?(i=new Intl.NumberFormat(s,{style:"currency",currency:"BRL",notation:"compact",maximumFractionDigits:1}),r[0]=s,r[1]=i):i=r[1];const o=i;let a;r[2]!==s?(a=new Intl.NumberFormat(s,{maximumFractionDigits:2}),r[2]=s,r[3]=a):a=r[3];const n=a;let d;r[4]!==s?(d=new Intl.NumberFormat(s,{notation:"compact",maximumFractionDigits:1}),r[4]=s,r[5]=d):d=r[5];const m=d;let c;r[6]!==n||r[7]!==e?(c=y=>e(y===1?"plan.case.days.one":"plan.case.days.other",{count:n.format(y)}),r[6]=n,r[7]=e,r[8]=c):c=r[8];const p=c;let u;r[9]!==m||r[10]!==p||r[11]!==o||r[12]!==n?(u=y=>{const{value:g,unit:b}=y;switch(b){case"percent":return`${n.format(g)}%`;case"seconds":return`${n.format(g)} s`;case"days":return p(g);case"brl":return o.format(g);case"count":return m.format(g)}},r[9]=m,r[10]=p,r[11]=o,r[12]=n,r[13]=u):u=r[13];const f=u;let x;r[14]!==o?(x=y=>o.format(y),r[14]=o,r[15]=x):x=r[15];let h;r[16]!==n?(h=y=>n.format(y),r[16]=n,r[17]=h):h=r[17];let j;r[18]!==m?(j=y=>m.format(y),r[18]=m,r[19]=j):j=r[19];let w;return r[20]!==p||r[21]!==f||r[22]!==x||r[23]!==h||r[24]!==j?(w={money:x,number:h,compact:j,days:p,metric:f},r[20]=p,r[21]=f,r[22]=x,r[23]=h,r[24]=j,r[25]=w):w=r[25],w}const et={framing:"plan.case.status.framing",building:"plan.case.status.building",ready:"plan.case.status.ready"},tt={pdp:"plan.case.area.pdp",search:"plan.case.area.search",category:"plan.case.area.category",home:"plan.case.area.home",cart:"plan.case.area.cart",checkout:"plan.case.area.checkout",shipping:"plan.case.area.shipping",performance:"plan.case.area.performance","paid-media":"plan.case.area.paidMedia",other:"plan.case.area.other"},st={money:"plan.case.card.money",effort:"plan.case.tile.effort",abTest:"plan.case.tile.abTest"};function lt(r){const e=_.c(21),{value:t,story:s}=r,i=S(),o=ie();if(s.money){let d;e[0]!==i||e[1]!==t.title?(d=i("plan.case.thesis.lead",{title:t.title}),e[0]=i,e[1]=t.title,e[2]=d):d=e[2];let m;e[3]!==o||e[4]!==s.money.monthlyValue||e[5]!==i?(m=i("plan.case.thesis.money",{money:o.money(s.money.monthlyValue)}),e[3]=o,e[4]=s.money.monthlyValue,e[5]=i,e[6]=m):m=e[6];let c;e[7]!==m?(c=l.jsx("span",{className:"font-semibold whitespace-nowrap shadow-[inset_0_-0.4em_0_0_color-mix(in_oklab,var(--success)_18%,transparent)]",children:m}),e[7]=m,e[8]=c):c=e[8];let p;e[9]!==i?(p=i("plan.case.thesis.tail"),e[9]=i,e[10]=p):p=e[10];let u;return e[11]!==d||e[12]!==c||e[13]!==p?(u=l.jsxs("p",{className:"text-2xl leading-snug font-medium tracking-tight text-balance text-foreground @2xl:text-[1.75rem]",children:[d," ",c,p]}),e[11]=d,e[12]=c,e[13]=p,e[14]=u):u=e[14],u}let a;e[15]!==i||e[16]!==t.status?(a=t.status!=="ready"&&l.jsxs("span",{className:"text-muted-foreground/70",children:[" ",i("plan.case.thesis.pending")]}),e[15]=i,e[16]=t.status,e[17]=a):a=e[17];let n;return e[18]!==a||e[19]!==t.title?(n=l.jsxs("p",{className:"text-2xl leading-snug font-medium tracking-tight text-balance text-foreground @2xl:text-[1.75rem]",children:[t.title,a]}),e[18]=a,e[19]=t.title,e[20]=n):n=e[20],n}function Ne(r){return r.state==="asking"||r.state==="later"}function nt(r){const e=_.c(56),{tile:t}=r,s=S(),i=ie();if(Ne(t)){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx("div",{className:"mt-1 text-3xl font-semibold text-muted-foreground/40",children:"โ€”"}),e[0]=c):c=e[0];let p;e[1]!==t.state?(p=t.state==="asking"&&l.jsx("span",{className:"size-1.5 rounded-full bg-special motion-safe:animate-pulse"}),e[1]=t.state,e[2]=p):p=e[2];const u=t.state==="asking"?"plan.case.tile.calculating":"plan.case.tile.later";let f;e[3]!==s||e[4]!==u?(f=s(u),e[3]=s,e[4]=u,e[5]=f):f=e[5];let x;return e[6]!==p||e[7]!==f?(x=l.jsxs(l.Fragment,{children:[c,l.jsxs("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[p,f]})]}),e[6]=p,e[7]=f,e[8]=x):x=e[8],x}if(t.key==="money"){let c;e[9]!==i||e[10]!==t.monthly?(c=i.money(t.monthly),e[9]=i,e[10]=t.monthly,e[11]=c):c=e[11];let p;e[12]!==s?(p=s("plan.case.tile.perMonth"),e[12]=s,e[13]=p):p=e[13];let u;e[14]!==p?(u=l.jsx("span",{className:"text-base font-medium text-muted-foreground",children:p}),e[14]=p,e[15]=u):u=e[15];let f;e[16]!==c||e[17]!==u?(f=l.jsxs("div",{className:"mt-1 text-3xl font-semibold tracking-tight text-success tabular-nums",children:["+",c,u]}),e[16]=c,e[17]=u,e[18]=f):f=e[18];let x;e[19]!==i||e[20]!==s||e[21]!==t.ceiling||e[22]!==t.monthly?(x=t.ceiling!==null&&t.ceiling>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:s("plan.case.tile.ceiling",{ceiling:i.money(t.ceiling)})}),l.jsx("div",{className:"mt-2.5 h-1.5 overflow-hidden rounded-full bg-foreground/5",children:l.jsx("div",{className:"h-full rounded-full bg-success transition-[width] duration-700",style:{width:`${Math.max(3,Math.min(100,t.monthly/t.ceiling*100))}%`}})})]}),e[19]=i,e[20]=s,e[21]=t.ceiling,e[22]=t.monthly,e[23]=x):x=e[23];let h;return e[24]!==f||e[25]!==x?(h=l.jsxs(l.Fragment,{children:[f,x]}),e[24]=f,e[25]=x,e[26]=h):h=e[26],h}if(t.key==="effort"){let c;e[27]!==i||e[28]!==t.days?(c=i.days(t.days),e[27]=i,e[28]=t.days,e[29]=c):c=e[29];let p;return e[30]!==c?(p=l.jsx("div",{className:"mt-1 text-3xl font-semibold tracking-tight text-foreground tabular-nums",children:c}),e[30]=c,e[31]=p):p=e[31],p}if(t.state==="unmeasurable"){let c;e[32]!==s?(c=s("plan.case.tile.unmeasurable"),e[32]=s,e[33]=c):c=e[33];let p;e[34]!==c?(p=l.jsx("div",{className:"mt-1 text-2xl font-semibold tracking-tight text-warning",children:c}),e[34]=c,e[35]=p):p=e[35];let u;e[36]!==s?(u=s("plan.case.tile.unmeasurableCaption"),e[36]=s,e[37]=u):u=e[37];let f;e[38]!==u?(f=l.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:u}),e[38]=u,e[39]=f):f=e[39];let x;return e[40]!==p||e[41]!==f?(x=l.jsxs(l.Fragment,{children:[p,f]}),e[40]=p,e[41]=f,e[42]=x):x=e[42],x}const o=t.weeks===1?"plan.case.weeks.one":"plan.case.weeks.other";let a;e[43]!==s||e[44]!==o||e[45]!==t.weeks?(a=s(o,{count:t.weeks}),e[43]=s,e[44]=o,e[45]=t.weeks,e[46]=a):a=e[46];let n;e[47]!==a?(n=l.jsx("div",{className:"mt-1 text-3xl font-semibold tracking-tight text-foreground tabular-nums",children:a}),e[47]=a,e[48]=n):n=e[48];let d;e[49]!==i||e[50]!==s||e[51]!==t.nPerGroup?(d=t.nPerGroup!==null&&l.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:s("plan.case.tile.perGroup",{count:i.compact(t.nPerGroup)})}),e[49]=i,e[50]=s,e[51]=t.nPerGroup,e[52]=d):d=e[52];let m;return e[53]!==n||e[54]!==d?(m=l.jsxs(l.Fragment,{children:[n,d]}),e[53]=n,e[54]=d,e[55]=m):m=e[55],m}function at(r){const e=_.c(13),{tile:t}=r,s=S(),o=Ne(t)?"border border-dashed":"bg-muted";let a;e[0]!==o?(a=T("rounded-xl p-4 transition-colors duration-500",o),e[0]=o,e[1]=a):a=e[1];const n=st[t.key];let d;e[2]!==s||e[3]!==n?(d=s(n),e[2]=s,e[3]=n,e[4]=d):d=e[4];let m;e[5]!==d?(m=l.jsx("div",{className:"text-xs text-muted-foreground",children:d}),e[5]=d,e[6]=m):m=e[6];let c;e[7]!==t?(c=l.jsx(nt,{tile:t}),e[7]=t,e[8]=c):c=e[8];let p;return e[9]!==a||e[10]!==m||e[11]!==c?(p=l.jsxs("div",{className:a,children:[m,c]}),e[9]=a,e[10]=m,e[11]=c,e[12]=p):p=e[12],p}function rt(r){const e=_.c(42),{value:t,story:s,invalid:i,onAnswerOpen:o}=r,a=S(),n=s.openQuestions.length,d=n===1?"plan.case.openQuestions.one":"plan.case.openQuestions.other";let m;e[0]!==n||e[1]!==a||e[2]!==d?(m=a(d,{count:n}),e[0]=n,e[1]=a,e[2]=d,e[3]=m):m=e[3];const c=m;let p;e[4]!==a?(p=a("page.businessCase"),e[4]=a,e[5]=p):p=e[5];let u;e[6]!==p?(u=l.jsx("span",{children:p}),e[6]=p,e[7]=u):u=e[7];const f=t.status==="ready"?"success":"agent",x=et[t.status];let h;e[8]!==a||e[9]!==x?(h=a(x),e[8]=a,e[9]=x,e[10]=h):h=e[10];let j;e[11]!==f||e[12]!==h?(j=l.jsx(ce,{variant:f,children:h}),e[11]=f,e[12]=h,e[13]=j):j=e[13];let w;e[14]!==o||e[15]!==n||e[16]!==c||e[17]!==a?(w=n>0&&(o?l.jsx(ce,{asChild:!0,variant:"warning",className:"cursor-pointer hover:bg-warning/20",children:l.jsxs("button",{type:"button",title:a("plan.case.answerOpen"),onClick:o,className:"group",children:[c,l.jsx(we,{className:"transition-transform duration-200 group-hover:translate-x-0.5"})]})}):l.jsx(ce,{variant:"warning",children:c})),e[14]=o,e[15]=n,e[16]=c,e[17]=a,e[18]=w):w=e[18];let y;e[19]!==a||e[20]!==t.request.area?(y=t.request.area!=="other"&&l.jsx(ce,{variant:"muted",children:a(tt[t.request.area])}),e[19]=a,e[20]=t.request.area,e[21]=y):y=e[21];let g;e[22]!==y?(g=l.jsx("span",{className:"ml-auto flex items-center gap-2",children:y}),e[22]=y,e[23]=g):g=e[23];let b;e[24]!==g||e[25]!==u||e[26]!==j||e[27]!==w?(b=l.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] font-medium tracking-wide text-muted-foreground uppercase",children:[u,j,w,g]}),e[24]=g,e[25]=u,e[26]=j,e[27]=w,e[28]=b):b=e[28];let v;e[29]!==s||e[30]!==t?(v=l.jsx(lt,{value:t,story:s}),e[29]=s,e[30]=t,e[31]=v):v=e[31];let N;e[32]!==s.tiles?(N=s.tiles.length>0&&l.jsx("div",{className:"grid gap-3 @xl:grid-cols-3",children:s.tiles.map(it)}),e[32]=s.tiles,e[33]=N):N=e[33];let k;e[34]!==i||e[35]!==a?(k=i&&l.jsx("p",{className:"text-xs text-muted-foreground",children:a("plan.case.invalid")}),e[34]=i,e[35]=a,e[36]=k):k=e[36];let C;return e[37]!==b||e[38]!==v||e[39]!==N||e[40]!==k?(C=l.jsxs("section",{className:"flex flex-col gap-4 rounded-2xl border bg-card p-6 @2xl:p-8",children:[b,v,N,k]}),e[37]=b,e[38]=v,e[39]=N,e[40]=k,e[41]=C):C=e[41],C}function it(r){return l.jsx(at,{tile:r},r.key)}const pe={problem:{title:"plan.case.card.problem",question:"plan.case.card.problemQuestion"},scope:{title:"plan.case.card.scope",question:"plan.case.card.scopeQuestion"},money:{title:"plan.case.card.money",question:"plan.case.card.moneyQuestion"},competitors:{title:"plan.case.card.competitors",question:"plan.case.card.competitorsQuestion"},approach:{title:"plan.case.card.approach",question:"plan.case.card.approachQuestion"},measurement:{title:"plan.case.card.measurement",question:"plan.case.card.measurementQuestion"},abTest:{title:"plan.case.card.abTest",question:"plan.case.card.abTestQuestion"},effort:{title:"plan.case.card.effort",question:"plan.case.card.effortQuestion"},risks:{title:"plan.case.card.risks",question:"plan.case.card.risksQuestion"},unknowns:{title:"plan.case.card.unknowns",question:"plan.case.card.unknownsQuestion"}},ae={why:"plan.case.act.why",what:"plan.case.act.what",how:"plan.case.act.how",worth:"plan.case.act.worth",prove:"plan.case.act.prove",open:"plan.case.act.open"};function ot(r){const e=_.c(11),{state:t}=r;let s;e[0]!==t?(s=t==="asking"&&l.jsx("span",{className:"absolute inset-0 rounded-full bg-special/40 motion-safe:animate-ping"}),e[0]=t,e[1]=s):s=e[1];const i=t==="done"&&"bg-foreground ring-1 ring-foreground",o=t==="asking"&&"bg-special ring-1 ring-special",a=t==="open"&&"bg-card ring-1 ring-muted-foreground/40";let n;e[2]!==i||e[3]!==o||e[4]!==a?(n=T("relative size-3.5 rounded-full border-[3px] border-card transition-colors duration-500",i,o,a),e[2]=i,e[3]=o,e[4]=a,e[5]=n):n=e[5];let d;e[6]!==n?(d=l.jsx("span",{className:n}),e[6]=n,e[7]=d):d=e[7];let m;return e[8]!==s||e[9]!==d?(m=l.jsxs("span",{className:"relative mt-1 flex size-3.5 items-center justify-center",children:[s,d]}),e[8]=s,e[9]=d,e[10]=m):m=e[10],m}function re(r){const e=_.c(32),{label:t,number:s,dot:i,first:o,last:a,children:n}=r,d=i==="open";let m;e[0]!==s?(m=l.jsx("div",{className:"text-[11px] font-medium text-muted-foreground/70 tabular-nums",children:s}),e[0]=s,e[1]=m):m=e[1];const c=d?"text-muted-foreground":"text-foreground";let p;e[2]!==c?(p=T("text-sm font-semibold",c),e[2]=c,e[3]=p):p=e[3];let u;e[4]!==t||e[5]!==p?(u=l.jsx("div",{className:p,children:t}),e[4]=t,e[5]=p,e[6]=u):u=e[6];let f;e[7]!==m||e[8]!==u?(f=l.jsxs(l.Fragment,{children:[m,u]}),e[7]=m,e[8]=u,e[9]=f):f=e[9];const x=f;let h;e[10]!==x?(h=l.jsx("div",{className:"hidden pt-0.5 text-right @2xl:block",children:x}),e[10]=x,e[11]=h):h=e[11];const j=o?"before:top-3":"before:top-0",w=a?"before:h-3":"before:bottom-0";let y;e[12]!==j||e[13]!==w?(y=T("relative flex justify-center","before:absolute before:w-0.5 before:bg-border",j,w),e[12]=j,e[13]=w,e[14]=y):y=e[14];let g;e[15]!==i?(g=l.jsx(ot,{state:i}),e[15]=i,e[16]=g):g=e[16];let b;e[17]!==g||e[18]!==y?(b=l.jsx("div",{className:y,children:g}),e[17]=g,e[18]=y,e[19]=b):b=e[19];const v=!a&&"pb-10";let N;e[20]!==v?(N=T("flex min-w-0 flex-col",v),e[20]=v,e[21]=N):N=e[21];let k;e[22]!==x?(k=l.jsx("div",{className:"mb-2 flex items-baseline gap-2 @2xl:hidden",children:x}),e[22]=x,e[23]=k):k=e[23];let C;e[24]!==n||e[25]!==N||e[26]!==k?(C=l.jsxs("div",{className:N,children:[k,n]}),e[24]=n,e[25]=N,e[26]=k,e[27]=C):C=e[27];let $;return e[28]!==b||e[29]!==C||e[30]!==h?($=l.jsxs("div",{className:"grid grid-cols-[1.75rem_1fr] gap-x-3 @2xl:grid-cols-[7rem_1.75rem_1fr] @2xl:gap-x-4",children:[h,b,C]}),e[28]=b,e[29]=C,e[30]=h,e[31]=$):$=e[31],$}function ke(r){const e=_.c(21),{card:t}=r,s=S(),[i,o]=ue.useState(!1);if(!t.bullets.length&&!t.sources.length&&!t.assumption)return null;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>o(pt),e[0]=a):a=e[0];const n=i?"plan.case.hideDetails":"plan.case.showDetails";let d;e[1]!==s||e[2]!==n?(d=s(n),e[1]=s,e[2]=n,e[3]=d):d=e[3];const m=i&&"rotate-180";let c;e[4]!==m?(c=T("transition-transform",m),e[4]=m,e[5]=c):c=e[5];let p;e[6]!==c?(p=l.jsx(Ke,{size:12,className:c}),e[6]=c,e[7]=p):p=e[7];let u;e[8]!==i||e[9]!==d||e[10]!==p?(u=l.jsxs("button",{type:"button",onClick:a,"aria-expanded":i,className:"flex items-center gap-1 rounded text-xs text-muted-foreground hover:text-foreground focus-ring",children:[d,p]}),e[8]=i,e[9]=d,e[10]=p,e[11]=u):u=e[11];let f;e[12]!==t.assumption||e[13]!==t.bullets||e[14]!==t.sources||e[15]!==i||e[16]!==s?(f=i&&l.jsxs("div",{className:"mt-2 flex flex-col gap-2 rounded-lg bg-muted/60 px-3.5 py-3 text-[13px] text-muted-foreground",children:[t.bullets.length>0&&l.jsx("ul",{className:"flex list-disc flex-col gap-1 pl-4",children:t.bullets.map(mt)}),t.assumption&&l.jsxs("p",{children:[l.jsx("span",{className:"font-medium text-foreground",children:s("plan.case.assumption")})," ",t.assumption]}),t.sources.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.sources.map(ct)})]}),e[12]=t.assumption,e[13]=t.bullets,e[14]=t.sources,e[15]=i,e[16]=s,e[17]=f):f=e[17];let x;return e[18]!==u||e[19]!==f?(x=l.jsxs("div",{className:"mt-2",children:[u,f]}),e[18]=u,e[19]=f,e[20]=x):x=e[20],x}function ct(r,e){return r.url?l.jsx("a",{href:r.url,target:"_blank",rel:"noreferrer",className:"max-w-full truncate rounded-full border bg-card px-2 py-0.5 text-[11px] hover:text-foreground",children:r.label},e):l.jsx("span",{className:"max-w-full truncate rounded-full border bg-card px-2 py-0.5 text-[11px]",children:r.label},e)}function mt(r,e){return l.jsx("li",{children:r},e)}function pt(r){return!r}function A(r){const e=_.c(47),{cardKey:t,card:s,label:i,children:o,divider:a}=r,n=S();let d;e[0]!==t||e[1]!==i||e[2]!==n?(d=i??n(pe[t].title),e[0]=t,e[1]=i,e[2]=n,e[3]=d):d=e[3];const m=d,c=a&&"mt-4 border-t border-dashed pt-4";let p;e[4]!==c?(p=T(c),e[4]=c,e[5]=p):p=e[5];const u=p;if(s.state==="asking"){let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx("span",{className:"size-1.5 rounded-full bg-special motion-safe:animate-pulse"}),e[6]=w):w=e[6];let y;e[7]!==n?(y=n("plan.case.asking"),e[7]=n,e[8]=y):y=e[8];let g;e[9]!==y||e[10]!==m?(g=l.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-special",children:[w,y," ยท ",m]}),e[9]=y,e[10]=m,e[11]=g):g=e[11];let b;e[12]!==s.question||e[13]!==t||e[14]!==n?(b=s.question??n(pe[t].question),e[12]=s.question,e[13]=t,e[14]=n,e[15]=b):b=e[15];let v;e[16]!==b?(v=l.jsx("p",{className:"mt-1 text-[15px] text-pretty text-foreground",children:b}),e[16]=b,e[17]=v):v=e[17];let N;e[18]!==g||e[19]!==v?(N=l.jsxs("div",{"aria-busy":!0,className:"rounded-xl border border-special/30 bg-special/5 px-4 py-3",children:[g,v]}),e[18]=g,e[19]=v,e[20]=N):N=e[20];let k;return e[21]!==u||e[22]!==N?(k=l.jsx("div",{className:u,children:N}),e[21]=u,e[22]=N,e[23]=k):k=e[23],k}if(s.state==="empty"){let w;e[24]!==m?(w=l.jsx("div",{className:"text-xs text-muted-foreground/70",children:m}),e[24]=m,e[25]=w):w=e[25];const y=pe[t];let g;e[26]!==n||e[27]!==y.question?(g=n(y.question),e[26]=n,e[27]=y.question,e[28]=g):g=e[28];let b;e[29]!==g?(b=l.jsx("p",{className:"mt-0.5 text-[15px] text-pretty text-muted-foreground/70",children:g}),e[29]=g,e[30]=b):b=e[30];let v;return e[31]!==u||e[32]!==w||e[33]!==b?(v=l.jsxs("div",{className:u,children:[w,b]}),e[31]=u,e[32]=w,e[33]=b,e[34]=v):v=e[34],v}let f;e[35]!==m?(f=l.jsx("div",{className:"text-xs text-muted-foreground",children:m}),e[35]=m,e[36]=f):f=e[36];let x;e[37]!==s.summary?(x=s.summary&&l.jsx("p",{className:"mt-0.5 text-[17px] leading-snug text-pretty text-foreground",children:s.summary}),e[37]=s.summary,e[38]=x):x=e[38];let h;e[39]!==s?(h=l.jsx(ke,{card:s}),e[39]=s,e[40]=h):h=e[40];let j;return e[41]!==o||e[42]!==u||e[43]!==f||e[44]!==x||e[45]!==h?(j=l.jsxs("div",{className:u,children:[f,x,o,h]}),e[41]=o,e[42]=u,e[43]=f,e[44]=x,e[45]=h,e[46]=j):j=e[46],j}function dt(r){const e=_.c(14),{card:t}=r,s=ie();let i,o,a,n;if(e[0]!==t.metrics||e[1]!==s){n=Symbol.for("react.early_return_sentinel");e:{const[p,...u]=t.metrics??[];if(!p){n=null;break e}const f=[p,...u.filter(h=>h.unit===p.unit)];i=u.filter(h=>h.unit!==p.unit);const x=p.unit==="percent"?100:Math.max(...f.map(ut));o="mt-3 flex max-w-md flex-col gap-2",a=f.map((h,j)=>l.jsxs("div",{className:"grid grid-cols-[minmax(0,7rem)_1fr_auto] items-center gap-3 text-xs text-muted-foreground",children:[l.jsx("span",{className:"truncate",children:h.label}),l.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-muted",children:l.jsx("div",{className:T("h-full rounded-full transition-[width] duration-700",j===0?"bg-foreground":"bg-muted-foreground/40"),style:{width:`${x>0?Math.max(2,Math.min(100,h.value/x*100)):0}%`}})}),l.jsx("span",{className:"font-semibold text-foreground tabular-nums",children:s.metric(h)})]},j))}e[0]=t.metrics,e[1]=s,e[2]=i,e[3]=o,e[4]=a,e[5]=n}else i=e[2],o=e[3],a=e[4],n=e[5];if(n!==Symbol.for("react.early_return_sentinel"))return n;let d;e[6]!==o||e[7]!==a?(d=l.jsx("div",{className:o,children:a}),e[6]=o,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==i?(m=l.jsx(_e,{metrics:i}),e[9]=i,e[10]=m):m=e[10];let c;return e[11]!==d||e[12]!==m?(c=l.jsxs(l.Fragment,{children:[d,m]}),e[11]=d,e[12]=m,e[13]=c):c=e[13],c}function ut(r){return r.value}function ft(r){const e=_.c(4),{card:t}=r;if(!t.sources.length)return null;let s;e[0]!==t.sources?(s=t.sources.map(xt),e[0]=t.sources,e[1]=s):s=e[1];let i;return e[2]!==s?(i=l.jsx("div",{className:"mt-2.5 flex flex-wrap gap-2",children:s}),e[2]=s,e[3]=i):i=e[3],i}function xt(r,e){const t=l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-foreground",children:r.label.trim().charAt(0).toUpperCase()}),l.jsx("span",{className:"truncate",children:r.label})]});return r.url?l.jsx("a",{href:r.url,target:"_blank",rel:"noreferrer",className:T("flex max-w-full items-center gap-1.5 rounded-full border bg-card py-0.5 pr-2.5 pl-1 text-xs text-muted-foreground","hover:text-foreground"),children:t},e):l.jsx("span",{className:"flex max-w-full items-center gap-1.5 rounded-full border bg-card py-0.5 pr-2.5 pl-1 text-xs text-muted-foreground",children:t},e)}const ht={code:{label:"plan.case.layer.code",icon:Ue},component:{label:"plan.case.layer.component",icon:Ve},catalog:{label:"plan.case.layer.catalog",icon:Re},content:{label:"plan.case.layer.content",icon:Ge},platform:{label:"plan.case.layer.platform",icon:He},data:{label:"plan.case.layer.data",icon:We},integration:{label:"plan.case.layer.integration",icon:ze},other:{label:"plan.case.layer.other",icon:$e}};function gt(r){const e=_.c(7),{card:t}=r,s=S();if(!t.layers?.length)return null;let i;if(e[0]!==t.layers||e[1]!==s){let a;e[3]!==s?(a=n=>{const{label:d,icon:m}=ht[n];return l.jsxs("span",{className:"flex items-center gap-1.5 rounded-full border bg-card py-0.5 pr-2.5 pl-1 text-xs text-muted-foreground",children:[l.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-muted text-foreground",children:l.jsx(m,{size:12})}),s(d)]},n)},e[3]=s,e[4]=a):a=e[4],i=t.layers.map(a),e[0]=t.layers,e[1]=s,e[2]=i}else i=e[2];let o;return e[5]!==i?(o=l.jsx("div",{className:"mt-2.5 flex flex-wrap gap-2",children:i}),e[5]=i,e[6]=o):o=e[6],o}function bt(r){const e=_.c(22),{card:t}=r,s=S(),i=ie();if(t.calc?.kind!=="money")return null;const o=t.calc;let a,n,d;if(e[0]!==o.base||e[1]!==o.baseLabel||e[2]!==o.deltaPp||e[3]!==o.monthlyValue||e[4]!==o.value||e[5]!==o.valueLabel||e[6]!==i||e[7]!==s){const u=[{value:i.compact(o.base),label:o.baseLabel??s("plan.case.chain.base")},{value:`+${i.number(o.deltaPp)} p.p.`,label:s("plan.case.chain.delta")},{value:i.money(o.value),label:o.valueLabel??s("plan.case.chain.value")},{value:i.money(o.monthlyValue),label:s("plan.case.chain.result"),result:!0}];d="mt-3 flex flex-col gap-2",a="flex flex-wrap items-stretch gap-1.5",n=u.map((f,x)=>l.jsxs("div",{className:"flex items-stretch gap-1.5",children:[x>0&&l.jsx("span",{className:"self-center text-sm text-muted-foreground/60",children:x===u.length-1?"=":"ร—"}),l.jsxs("div",{className:T("min-w-24 rounded-xl border px-3 py-2",f.result&&"border-success/25 bg-success/5"),children:[l.jsx("div",{className:T("text-[17px] font-semibold tracking-tight tabular-nums",f.result?"text-success":"text-foreground"),children:f.value}),l.jsx("div",{className:"text-[11.5px] text-muted-foreground",children:f.label})]})]},x)),e[0]=o.base,e[1]=o.baseLabel,e[2]=o.deltaPp,e[3]=o.monthlyValue,e[4]=o.value,e[5]=o.valueLabel,e[6]=i,e[7]=s,e[8]=a,e[9]=n,e[10]=d}else a=e[8],n=e[9],d=e[10];let m;e[11]!==a||e[12]!==n?(m=l.jsx("div",{className:a,children:n}),e[11]=a,e[12]=n,e[13]=m):m=e[13];let c;e[14]!==o.ceilingMonthly||e[15]!==i||e[16]!==s?(c=o.ceilingMonthly!==null&&l.jsx("p",{className:"text-xs text-muted-foreground",children:s("plan.case.chain.ceiling",{ceiling:i.money(o.ceilingMonthly)})}),e[14]=o.ceilingMonthly,e[15]=i,e[16]=s,e[17]=c):c=e[17];let p;return e[18]!==d||e[19]!==m||e[20]!==c?(p=l.jsxs("div",{className:d,children:[m,c]}),e[18]=d,e[19]=m,e[20]=c,e[21]=p):p=e[21],p}function _e(r){const e=_.c(7),{metrics:t}=r,s=ie();if(!t.length)return null;let i;if(e[0]!==s||e[1]!==t){let a;e[3]!==s?(a=(n,d)=>l.jsxs("span",{className:"rounded-md bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:[n.label," ",l.jsx("span",{className:"font-medium text-foreground tabular-nums",children:s.metric(n)})]},d),e[3]=s,e[4]=a):a=e[4],i=t.map(a),e[0]=s,e[1]=t,e[2]=i}else i=e[2];let o;return e[5]!==i?(o=l.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:i}),e[5]=i,e[6]=o):o=e[6],o}function yt(r){const e=_.c(25),{card:t}=r,s=S(),i=ie();if(t.calc?.kind!=="abTest")return null;const{weeks:o,nPerGroup:a,measurable:n}=t.calc;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsx("b",{className:"font-semibold",children:"A"}),e[0]=d):d=e[0];let m;e[1]!==s?(m=s("plan.case.ab.control"),e[1]=s,e[2]=m):m=e[2];let c;e[3]!==m?(c=l.jsxs("span",{className:"rounded-lg bg-muted px-3 py-2",children:[d," ยท ",m]}),e[3]=m,e[4]=c):c=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=l.jsx("b",{className:"font-semibold",children:"B"}),e[5]=p):p=e[5];let u;e[6]!==s?(u=s("plan.case.ab.variant"),e[6]=s,e[7]=u):u=e[7];let f;e[8]!==u?(f=l.jsxs("span",{className:"rounded-lg bg-success/10 px-3 py-2",children:[p," ยท ",u]}),e[8]=u,e[9]=f):f=e[9];const x=n?"bg-muted":"bg-warning/10 text-warning";let h;e[10]!==x?(h=T("rounded-lg px-3 py-2",x),e[10]=x,e[11]=h):h=e[11];let j;e[12]!==i||e[13]!==n||e[14]!==a||e[15]!==s||e[16]!==o?(j=n&&o!==null?[s(o===1?"plan.case.weeks.one":"plan.case.weeks.other",{count:o}),a!==null&&s("plan.case.tile.perGroup",{count:i.compact(a)})].filter(Boolean).join(" ยท "):s("plan.case.tile.unmeasurable"),e[12]=i,e[13]=n,e[14]=a,e[15]=s,e[16]=o,e[17]=j):j=e[17];let w;e[18]!==h||e[19]!==j?(w=l.jsx("span",{className:h,children:j}),e[18]=h,e[19]=j,e[20]=w):w=e[20];let y;return e[21]!==w||e[22]!==c||e[23]!==f?(y=l.jsxs("div",{className:"mt-3 grid gap-1.5 text-xs @xl:grid-cols-[1fr_1fr_auto]",children:[c,f,w]}),e[21]=w,e[22]=c,e[23]=f,e[24]=y):y=e[24],y}function jt(r){const e=_.c(16),{card:t}=r,s=S();if(t.state!=="filled"){let c;return e[0]!==t?(c=l.jsx(A,{cardKey:"risks",card:t,divider:!0}),e[0]=t,e[1]=c):c=e[1],c}let i;e[2]!==s?(i=s("plan.case.card.risks"),e[2]=s,e[3]=i):i=e[3];let o;e[4]!==i?(o=l.jsx("span",{className:"font-semibold text-warning",children:i}),e[4]=i,e[5]=o):o=e[5];let a;e[6]!==t.summary?(a=t.summary&&l.jsxs(l.Fragment,{children:[" ยท ",t.summary]}),e[6]=t.summary,e[7]=a):a=e[7];let n;e[8]!==o||e[9]!==a?(n=l.jsxs("div",{className:"rounded-r-lg border-l-[3px] border-warning bg-warning/5 px-3.5 py-2.5 text-[13px] text-muted-foreground",children:[o,a]}),e[8]=o,e[9]=a,e[10]=n):n=e[10];let d;e[11]!==t?(d=l.jsx(ke,{card:t}),e[11]=t,e[12]=d):d=e[12];let m;return e[13]!==n||e[14]!==d?(m=l.jsxs("div",{className:"mt-4",children:[n,d]}),e[13]=n,e[14]=d,e[15]=m):m=e[15],m}function vt(r){const e=_.c(15),{questions:t,onAsk:s,onAnswerOpen:i}=r,o=S();let a;e[0]!==i||e[1]!==o?(a=i&&l.jsxs(de,{size:"sm",className:"group w-fit",onClick:i,children:[o("plan.case.answerOpen"),l.jsx(we,{className:"transition-transform duration-200 group-hover:translate-x-0.5"})]}),e[0]=i,e[1]=o,e[2]=a):a=e[2];let n;if(e[3]!==s||e[4]!==t||e[5]!==o){let c;e[7]!==s||e[8]!==o?(c=(p,u)=>l.jsxs("li",{className:T("flex items-start gap-3 py-2 text-sm text-foreground",u>0&&"border-t border-dashed"),children:[l.jsx("span",{className:"min-w-0 flex-1 text-pretty",children:p}),s&&l.jsxs(de,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>s(p),children:[l.jsx(Ye,{}),o("plan.case.askInChat")]})]},u),e[7]=s,e[8]=o,e[9]=c):c=e[9],n=t.map(c),e[3]=s,e[4]=t,e[5]=o,e[6]=n}else n=e[6];let d;e[10]!==n?(d=l.jsx("ul",{className:"flex flex-col",children:n}),e[10]=n,e[11]=d):d=e[11];let m;return e[12]!==a||e[13]!==d?(m=l.jsxs("div",{className:"flex flex-col gap-3",children:[a,d]}),e[12]=a,e[13]=d,e[14]=m):m=e[14],m}function wt(r){const e=_.c(122),{value:t,story:s,onAsk:i,onAnswerOpen:o}=r,a=S(),{cards:n}=t;let d;e[0]!==s.acts?(d=Ce=>s.acts.find(Se=>Se.key===Ce)?.dot??"open",e[0]=s.acts,e[1]=d):d=e[1];const m=d,c=n.unknowns.state!=="empty"||t.status!=="ready";let p;e[2]!==n.scope||e[3]!==t.request?(p=n.scope.state==="empty"?{...n.scope,state:"filled",summary:t.request.text}:n.scope,e[2]=n.scope,e[3]=t.request,e[4]=p):p=e[4];const u=p;let f;e[5]!==a?(f=a(ae.why),e[5]=a,e[6]=f):f=e[6];let x;e[7]!==m?(x=m("why"),e[7]=m,e[8]=x):x=e[8];let h;e[9]!==a?(h=a("plan.case.objective"),e[9]=a,e[10]=h):h=e[10];let j;e[11]!==h?(j=l.jsx("div",{className:"text-xs text-muted-foreground",children:h}),e[11]=h,e[12]=j):j=e[12];const w=t.objective?"text-foreground":"text-muted-foreground";let y;e[13]!==w?(y=T("mt-0.5 text-[17px] leading-snug text-pretty",w),e[13]=w,e[14]=y):y=e[14];let g;e[15]!==a||e[16]!==t.objective?(g=t.objective??a("plan.case.noObjective"),e[15]=a,e[16]=t.objective,e[17]=g):g=e[17];let b;e[18]!==y||e[19]!==g?(b=l.jsx("p",{className:y,children:g}),e[18]=y,e[19]=g,e[20]=b):b=e[20];let v;e[21]!==b||e[22]!==j?(v=l.jsxs("div",{children:[j,b]}),e[21]=b,e[22]=j,e[23]=v):v=e[23];let N;e[24]!==n.problem?(N=l.jsx(dt,{card:n.problem}),e[24]=n.problem,e[25]=N):N=e[25];let k;e[26]!==n.problem||e[27]!==N?(k=l.jsx(A,{cardKey:"problem",card:n.problem,divider:!0,children:N}),e[26]=n.problem,e[27]=N,e[28]=k):k=e[28];let C;e[29]!==v||e[30]!==k||e[31]!==f||e[32]!==x?(C=l.jsxs(re,{label:f,number:"01",dot:x,first:!0,children:[v,k]}),e[29]=v,e[30]=k,e[31]=f,e[32]=x,e[33]=C):C=e[33];let $;e[34]!==a?($=a(ae.what),e[34]=a,e[35]=$):$=e[35];let Q;e[36]!==m?(Q=m("what"),e[36]=m,e[37]=Q):Q=e[37];let P;e[38]!==n.scope.state||e[39]!==a?(P=n.scope.state==="empty"?a("plan.case.request"):void 0,e[38]=n.scope.state,e[39]=a,e[40]=P):P=e[40];let F;e[41]!==u||e[42]!==P?(F=l.jsx(A,{cardKey:"scope",card:u,label:P}),e[41]=u,e[42]=P,e[43]=F):F=e[43];let O;e[44]!==n.competitors?(O=l.jsx(ft,{card:n.competitors}),e[44]=n.competitors,e[45]=O):O=e[45];let L;e[46]!==n.competitors||e[47]!==O?(L=l.jsx(A,{cardKey:"competitors",card:n.competitors,divider:!0,children:O}),e[46]=n.competitors,e[47]=O,e[48]=L):L=e[48];let B;e[49]!==$||e[50]!==Q||e[51]!==F||e[52]!==L?(B=l.jsxs(re,{label:$,number:"02",dot:Q,children:[F,L]}),e[49]=$,e[50]=Q,e[51]=F,e[52]=L,e[53]=B):B=e[53];let M;e[54]!==a?(M=a(ae.how),e[54]=a,e[55]=M):M=e[55];let I;e[56]!==m?(I=m("how"),e[56]=m,e[57]=I):I=e[57];let E;e[58]!==n.approach?(E=l.jsx(gt,{card:n.approach}),e[58]=n.approach,e[59]=E):E=e[59];let D;e[60]!==n.approach||e[61]!==E?(D=l.jsx(A,{cardKey:"approach",card:n.approach,children:E}),e[60]=n.approach,e[61]=E,e[62]=D):D=e[62];let K;e[63]!==M||e[64]!==I||e[65]!==D?(K=l.jsx(re,{label:M,number:"03",dot:I,children:D}),e[63]=M,e[64]=I,e[65]=D,e[66]=K):K=e[66];let z;e[67]!==a?(z=a(ae.worth),e[67]=a,e[68]=z):z=e[68];let G;e[69]!==m?(G=m("worth"),e[69]=m,e[70]=G):G=e[70];let R;e[71]!==n.money?(R=l.jsx(bt,{card:n.money}),e[71]=n.money,e[72]=R):R=e[72];let V;e[73]!==n.money||e[74]!==R?(V=l.jsx(A,{cardKey:"money",card:n.money,children:R}),e[73]=n.money,e[74]=R,e[75]=V):V=e[75];let U;e[76]!==n.effort.metrics?(U=n.effort.metrics??[],e[76]=n.effort.metrics,e[77]=U):U=e[77];let Y;e[78]!==U?(Y=l.jsx(_e,{metrics:U}),e[78]=U,e[79]=Y):Y=e[79];let W;e[80]!==n.effort||e[81]!==Y?(W=l.jsx(A,{cardKey:"effort",card:n.effort,divider:!0,children:Y}),e[80]=n.effort,e[81]=Y,e[82]=W):W=e[82];let H;e[83]!==n.risks?(H=l.jsx(jt,{card:n.risks}),e[83]=n.risks,e[84]=H):H=e[84];let J;e[85]!==z||e[86]!==G||e[87]!==V||e[88]!==W||e[89]!==H?(J=l.jsxs(re,{label:z,number:"04",dot:G,children:[V,W,H]}),e[85]=z,e[86]=G,e[87]=V,e[88]=W,e[89]=H,e[90]=J):J=e[90];let X;e[91]!==a?(X=a(ae.prove),e[91]=a,e[92]=X):X=e[92];let Z;e[93]!==m?(Z=m("prove"),e[93]=m,e[94]=Z):Z=e[94];const me=!c;let ee;e[95]!==n.measurement?(ee=l.jsx(A,{cardKey:"measurement",card:n.measurement}),e[95]=n.measurement,e[96]=ee):ee=e[96];let te;e[97]!==n.abTest?(te=l.jsx(yt,{card:n.abTest}),e[97]=n.abTest,e[98]=te):te=e[98];let se;e[99]!==n.abTest||e[100]!==te?(se=l.jsx(A,{cardKey:"abTest",card:n.abTest,divider:!0,children:te}),e[99]=n.abTest,e[100]=te,e[101]=se):se=e[101];let le;e[102]!==X||e[103]!==Z||e[104]!==me||e[105]!==ee||e[106]!==se?(le=l.jsxs(re,{label:X,number:"05",dot:Z,last:me,children:[ee,se]}),e[102]=X,e[103]=Z,e[104]=me,e[105]=ee,e[106]=se,e[107]=le):le=e[107];let ne;e[108]!==n.unknowns||e[109]!==o||e[110]!==i||e[111]!==c||e[112]!==s.openQuestions||e[113]!==a?(ne=c&&l.jsx(re,{label:a(ae.open),number:"?",dot:n.unknowns.state==="asking"?"asking":"open",last:!0,children:s.openQuestions.length>0?l.jsx(vt,{questions:s.openQuestions,onAsk:i,onAnswerOpen:o}):l.jsx(A,{cardKey:"unknowns",card:n.unknowns})}),e[108]=n.unknowns,e[109]=o,e[110]=i,e[111]=c,e[112]=s.openQuestions,e[113]=a,e[114]=ne):ne=e[114];let oe;return e[115]!==C||e[116]!==B||e[117]!==K||e[118]!==J||e[119]!==le||e[120]!==ne?(oe=l.jsxs("div",{className:"flex flex-col",children:[C,B,K,J,le,ne]}),e[115]=C,e[116]=B,e[117]=K,e[118]=J,e[119]=le,e[120]=ne,e[121]=oe):oe=e[121],oe}const Nt=8,kt=[{key:"why",cards:["problem"]},{key:"what",cards:["scope","competitors"]},{key:"how",cards:["approach"]},{key:"worth",cards:["money","effort","risks"]},{key:"prove",cards:["measurement","abTest"]}];function _t(r){return r.some(e=>e.state==="asking")?"asking":r.every(e=>e.state==="filled")?"done":"open"}function Ct(r){return r.calc?.kind==="money"?{key:"money",state:"value",monthly:r.calc.monthlyValue,ceiling:r.calc.ceilingMonthly}:null}function St(r){const e=(r.metrics??[]).filter(t=>t.unit==="days");return e.length>0?{key:"effort",state:"value",days:e.reduce((t,s)=>t+s.value,0)}:null}function Tt(r){const e=r.calc;return e?.kind!=="abTest"?null:e.measurable&&e.weeks!==null&&e.weeks<=Nt?{key:"abTest",state:"value",weeks:e.weeks,nPerGroup:e.nPerGroup}:{key:"abTest",state:"unmeasurable"}}function $t(r){const{cards:e}=r,t=[];for(const[s,i]of[["money",Ct(e.money)],["effort",St(e.effort)],["abTest",Tt(e.abTest)]])i?t.push(i):e[s].state==="asking"?t.push({key:s,state:"asking"}):r.status!=="ready"&&t.push({key:s,state:"later"});return{money:e.money.calc?.kind==="money"?e.money.calc:null,tiles:t,acts:kt.map(s=>({...s,dot:_t(s.cards.map(i=>e[i]))})),openQuestions:e.unknowns.state==="filled"?e.unknowns.bullets:[]}}function At(r){const e=_.c(18),{value:t,invalid:s,onAsk:i,onAnswerOpen:o}=r;let a;e[0]!==t?(a=$t(t),e[0]=t,e[1]=a):a=e[1];const n=a;let d;e[2]!==o||e[3]!==n?(d=o&&n.openQuestions.length>0?()=>o(n.openQuestions):void 0,e[2]=o,e[3]=n,e[4]=d):d=e[4];const m=d;let c;e[5]!==m||e[6]!==s||e[7]!==n||e[8]!==t?(c=l.jsx(rt,{value:t,story:n,invalid:s,onAnswerOpen:m}),e[5]=m,e[6]=s,e[7]=n,e[8]=t,e[9]=c):c=e[9];let p;e[10]!==m||e[11]!==i||e[12]!==n||e[13]!==t?(p=l.jsx(wt,{value:t,story:n,onAsk:i,onAnswerOpen:m}),e[10]=m,e[11]=i,e[12]=n,e[13]=t,e[14]=p):p=e[14];let u;return e[15]!==c||e[16]!==p?(u=l.jsxs("div",{className:"@container mx-auto flex w-full max-w-[880px] flex-col gap-10",children:[c,p]}),e[15]=c,e[16]=p,e[17]=u):u=e[17],u}function qt(r){const{value:e,messages:t}=r;if(e.status==="ready"||!r.isCaseThread)return{kind:"canvas"};const s=Qt(t);return s?{kind:"question",part:s}:!r.running&&t.length>0?{kind:"canvas"}:{kind:"building",filled:Me.filter(o=>e.cards[o].state==="filled").length}}function Qt(r){const e=r.at(-1);if(e?.role!=="assistant")return null;for(const t of e.parts)if(t.type==="tool-user_ask"&&t.state==="input-available")return t;return null}function Pt(r,e){const t=r.input,s=t?.type==="choice"?[...new Set((t.options??[]).flatMap(i=>i?.trim()?[i.trim()]:[]))]:t?.type==="confirm"?[e.yes,e.no]:[];return{text:t?.prompt??"",options:s}}const Ft=2200;function Ot(r){const e=_.c(36),{title:t,questions:s,onDone:i,onClose:o}=r,a=S();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[0]=n):n=e[0];const[d,m]=ue.useState(n),c=d.length,p=c>=s.length;let u;e[1]!==d||e[2]!==p||e[3]!==o||e[4]!==i||e[5]!==s||e[6]!==c?(u=k=>{if(p)return;const C=[...d,{question:s[c],answer:k}];m(C),!(C.length<s.length)&&(i(C),Xe(Ft).then(o))},e[1]=d,e[2]=p,e[3]=o,e[4]=i,e[5]=s,e[6]=c,e[7]=u):u=e[7];const f=u;let x;e[8]!==p||e[9]!==o||e[10]!==a?(x=!p&&l.jsxs(de,{variant:"ghost",size:"sm",onClick:o,children:[l.jsx(Je,{}),a("plan.case.openFlow.back")]}),e[8]=p,e[9]=o,e[10]=a,e[11]=x):x=e[11];let h;e[12]!==a?(h=a("page.businessCase"),e[12]=a,e[13]=h):h=e[13];let j;e[14]!==h?(j=l.jsx("span",{className:"text-meta mr-2",children:h}),e[14]=h,e[15]=j):j=e[15];let w;e[16]!==j||e[17]!==t?(w=l.jsxs("p",{className:"min-w-0 truncate py-1.5 text-sm text-muted-foreground",children:[j,t]}),e[16]=j,e[17]=t,e[18]=w):w=e[18];const y=!p;let g;e[19]!==s.length||e[20]!==c||e[21]!==y?(g=l.jsx(Pe,{done:c,current:y,total:s.length}),e[19]=s.length,e[20]=c,e[21]=y,e[22]=g):g=e[22];let b;e[23]!==x||e[24]!==w||e[25]!==g?(b=l.jsxs("div",{className:"flex items-center gap-3 px-4 pt-4 md:px-8 animate-in fade-in-0 slide-in-from-top-1 duration-500 motion-reduce:animate-none",children:[x,w,g]}),e[23]=x,e[24]=w,e[25]=g,e[26]=b):b=e[26];let v;e[27]!==f||e[28]!==p||e[29]!==s||e[30]!==c||e[31]!==a?(v=l.jsx("div",{className:"flex min-h-0 flex-1 overflow-auto",children:l.jsx("div",{className:"m-auto flex w-full max-w-2xl justify-center px-4 py-10 md:px-8",children:p?l.jsx(he,{phrases:ge,offset:0,building:!0}):l.jsx(be,{view:{question:{text:s[c],options:[]},reaction:a("plan.case.openFlow.counter",{n:c+1,total:s.length})},skipLabel:a("plan.case.openFlow.skip"),onAnswer:f},c)})}),e[27]=f,e[28]=p,e[29]=s,e[30]=c,e[31]=a,e[32]=v):v=e[32];let N;return e[33]!==v||e[34]!==b?(N=l.jsxs("div",{className:"flex h-full min-h-0 flex-col animate-in fade-in-0 duration-300 motion-reduce:animate-none",children:[b,v]}),e[33]=v,e[34]=b,e[35]=N):N=e[35],N}function Lt(r){const e=_.c(6),{label:t}=r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(xe,{className:"h-56 rounded-2xl"}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx("div",{className:"flex flex-col gap-8 pl-10",children:Array.from({length:4},Bt)}),e[1]=i):i=e[1];let o;e[2]!==t?(o=t&&l.jsx("p",{className:"text-xs text-muted-foreground",children:t}),e[2]=t,e[3]=o):o=e[3];let a;return e[4]!==o?(a=l.jsxs("div",{className:"mx-auto flex w-full max-w-[880px] flex-col gap-10",children:[s,i,o]}),e[4]=o,e[5]=a):a=e[5],a}function Bt(r,e){return l.jsx(xe,{className:"h-20"},e)}function Mt(r){const e=_.c(2),t=ye(),s=je(),i=ve(r);if(!t||!i||s?.taskId!==i||t.isStreaming)return;let o;return e[0]!==t?(o=a=>{t.sendMessage({parts:[{type:"text",text:a}]})},e[0]=t,e[1]=o):o=e[1],o}function It(r){const e=_.c(13),{part:t}=r,s=S(),{submit:i}=Ee(),o=De();let a,n,d;if(e[0]!==t||e[1]!==o||e[2]!==i||e[3]!==s){const p={yes:s("chat.userAskQuestion.confirmYes"),no:s("chat.userAskQuestion.confirmNo")};n=u=>{const f=t.input?.type==="confirm",x=u.trim()?f&&u===p.yes?"yes":f&&u===p.no?"no":u.trim():s("chat.userAskQuestion.skipMessage");i({kind:"toolOutput",toolCallId:t.toolCallId,output:{response:x}},o())},a=be,d=Pt(t,p),e[0]=t,e[1]=o,e[2]=i,e[3]=s,e[4]=a,e[5]=n,e[6]=d}else a=e[4],n=e[5],d=e[6];let m;e[7]!==d?(m={question:d,reaction:null},e[7]=d,e[8]=m):m=e[8];let c;return e[9]!==a||e[10]!==n||e[11]!==m?(c=l.jsx(a,{view:m,onAnswer:n}),e[9]=a,e[10]=n,e[11]=m,e[12]=c):c=e[12],c}function Et(r){const e=_.c(50),{path:t}=r,s=S(),i=ye(),o=je(),a=Ie(t),n=Mt(t),[d,m]=ue.useState(null);let c,p,u;if(e[0]!==i||e[1]!==t||e[2]!==a.data?.value||e[3]!==a.isPending||e[4]!==s||e[5]!==o){p=Symbol.for("react.early_return_sentinel");e:{if(u=a.data?.value??Fe(sessionStorage,t),!u){let b;e[9]!==a.isPending||e[10]!==s?(b=a.isPending?void 0:s("plan.case.waiting"),e[9]=a.isPending,e[10]=s,e[11]=b):b=e[11];let v;e[12]!==b?(v=l.jsx(q,{children:l.jsx(q.Content,{children:l.jsx(q.Container,{width:"wide",className:"py-8",children:l.jsx(Lt,{label:b})})})}),e[12]=b,e[13]=v):v=e[13],p=v;break e}let g;e[14]!==i||e[15]!==t||e[16]!==o?(g=!!i&&!!o?.taskId&&o.taskId===ve(t),e[14]=i,e[15]=t,e[16]=o,e[17]=g):g=e[17],c=qt({value:u,isCaseThread:g,messages:i?.messages??[],running:!!i?.isStreaming||o?.activeTask?.status==="in_progress"})}e[0]=i,e[1]=t,e[2]=a.data?.value,e[3]=a.isPending,e[4]=s,e[5]=o,e[6]=c,e[7]=p,e[8]=u}else c=e[6],p=e[7],u=e[8];if(p!==Symbol.for("react.early_return_sentinel"))return p;const f=c;if(d){let g;e[18]!==n||e[19]!==s?(g=N=>{fe("plan_case_open_questions_answered",{questions:N.length,skipped:N.filter(Dt).length}),n?n(Oe(s,N)):Ae.error(s("plan.case.openFlow.busy"))},e[18]=n,e[19]=s,e[20]=g):g=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=()=>m(null),e[21]=b):b=e[21];let v;return e[22]!==d||e[23]!==g||e[24]!==u.title?(v=l.jsx(q,{children:l.jsx(Ot,{title:u.title,questions:d,onDone:g,onClose:b})}),e[22]=d,e[23]=g,e[24]=u.title,e[25]=v):v=e[25],v}if(f.kind==="canvas"){const g=a.data?.invalid;let b;e[26]!==n||e[27]!==s?(b=n&&(k=>n(s("plan.case.askPrompt",{question:k}))),e[26]=n,e[27]=s,e[28]=b):b=e[28];let v;e[29]!==n?(v=n&&(k=>{fe("plan_case_open_questions_opened",{questions:k.length}),m(k)}),e[29]=n,e[30]=v):v=e[30];let N;return e[31]!==g||e[32]!==b||e[33]!==v||e[34]!==u?(N=l.jsx(q,{children:l.jsx(q.Content,{children:l.jsx(q.Container,{width:"wide",className:"py-8",children:l.jsx(At,{value:u,invalid:g,onAsk:b,onAnswerOpen:v})})})}),e[31]=g,e[32]=b,e[33]=v,e[34]=u,e[35]=N):N=e[35],N}let x;e[36]!==s?(x=s("page.businessCase"),e[36]=s,e[37]=x):x=e[37];let h;e[38]!==x?(h=l.jsx("span",{className:"text-meta mr-2",children:x}),e[38]=x,e[39]=h):h=e[39];let j;e[40]!==h||e[41]!==u.title?(j=l.jsx("div",{className:"flex items-center gap-3 px-4 pt-4 md:px-8",children:l.jsxs("p",{className:"min-w-0 truncate py-1.5 text-sm text-muted-foreground",children:[h,u.title]})}),e[40]=h,e[41]=u.title,e[42]=j):j=e[42];let w;e[43]!==f.filled||e[44]!==f.kind||e[45]!==f.part?(w=l.jsx("div",{className:"flex min-h-0 flex-1 overflow-auto",children:l.jsx("div",{className:"m-auto flex w-full max-w-2xl justify-center px-4 py-10 md:px-8",children:f.kind==="question"?l.jsx(It,{part:f.part},f.part.toolCallId):l.jsx(he,{phrases:ge,offset:0,building:!0,filled:f.filled})})}),e[43]=f.filled,e[44]=f.kind,e[45]=f.part,e[46]=w):w=e[46];let y;return e[47]!==j||e[48]!==w?(y=l.jsx(q,{children:l.jsxs("div",{className:"flex h-full min-h-0 flex-col animate-in fade-in-0 duration-300 motion-reduce:animate-none",children:[j,w]})}),e[47]=j,e[48]=w,e[49]=y):y=e[49],y}function Dt(r){return!r.answer.trim()}function Kt(){const r=_.c(3);let e;r[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},r[0]=e):e=r[0];const t=qe(e),s="path"in t&&typeof t.path=="string"?t.path:void 0;let i;return r[1]!==s?(i=s?l.jsx(Et,{path:s},s):l.jsx(Be,{}),r[1]=s,r[2]=i):i=r[2],i}function Mn(){const r=_.c(2),e=Ze("plan_page_enabled");let t;return r[0]!==e?(t=l.jsx(Qe.Content,{children:e?l.jsx(Kt,{}):l.jsx(Le,{kind:"plan"})}),r[0]=e,r[1]=t):t=r[1],t}export{Mn as default};