UNPKG

decocms

Version:

Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools

19 lines (18 loc) • 49.8 kB
import{r as Oe,c as R,b as Re,j as l,m as _,B as le,a7 as vt,b9 as xt,br as De,bE as Se,bD as St,bf as At,bi as kt,bj as Ct,bg as Be,bF as Et,aK as Nt}from"./index-DoEtSiIe.js";import{$ as Tt}from"./agent-icon-DoabtHNW.js";import{i as jt}from"./Play-C_9Fb_Ik.js";import{S as Ae}from"./sandbox-start-errors-BK_aDCyt.js";import{G as wt}from"./pair-C9Fumckp.js";import{C as Pt}from"./section-array-field-yz7QHNSD.js";import{s as Ot}from"./session-runtime-CZKHty5X.js";import{$ as Rt,q as Dt,a0 as te,X as Bt,z as ye,a1 as Lt,e as It,a2 as Mt,x as $t}from"./blocks-tab-states-CTy1iAF5.js";import"./site-editor-toast-B-FDGvtN.js";const Le=Oe.createContext(!1),Bs=Le.Provider;function Ls(){return Oe.useContext(Le)}const Kt={provision:0,cloning:1,install:2,dev:3};function Ft(t){return Kt[t.step]}const ke=48,Ie=28,Me=3,Ut=(()=>{const t=[];let e=0;for(let n=0;n<ke;n++)n===Ie?t.push(null):(t.push(e/(ke-1)*Me),e++);return t})();function Gt(t){return{provision:t("sandbox.bootingVisual.phaseProvision"),cloning:t("sandbox.bootingVisual.phaseCloning"),install:t("sandbox.bootingVisual.phaseInstall"),dev:t("sandbox.bootingVisual.phaseDev")}}function Vt(t,e,n){return t.step==="provision"&&e!=null&&e.kind!=="ready"&&e.kind!=="failed"?Pt[e.kind].long:n[t.step]}const j="bg-foreground/[0.05]",k="bg-foreground/[0.09]",zt=Array.from({length:35},()=>Math.random()*1.8),Ht=Array.from({length:35},()=>Math.random()<.4);function Yt(t){const e=R.c(31),{progress:n,claimPhase:s}=t,o=Re();let r;e[0]!==n?(r=Ft(n),e[0]=n,e[1]=r):r=e[1];const i=r;let a;e[2]!==s||e[3]!==n||e[4]!==o?(a=Vt(n,s,Gt(o)),e[2]=s,e[3]=n,e[4]=o,e[5]=a):a=e[5];const c=a;let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(wt,{}),e[6]=f):f=e[6];const p=`${n.step}-${c}`;let g;e[7]!==c||e[8]!==p?(g=l.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-foreground/10 bg-background px-3.5 py-1.5 shadow-[0_4px_20px_-4px_rgb(0_0_0_/_0.12)]",children:[f,l.jsxs("span",{className:"animate-in fade-in text-sm font-medium text-foreground/85 duration-500",children:[c,"…"]},p)]}),e[7]=c,e[8]=p,e[9]=g):g=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsx(Xt,{}),e[10]=d):d=e[10];let m;e[11]!==i?(m=l.jsx(q,{phase:0,current:i,children:d}),e[11]=i,e[12]=m):m=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(Wt,{}),e[13]=y):y=e[13];let b;e[14]!==i?(b=l.jsx(q,{phase:1,current:i,children:y}),e[14]=i,e[15]=b):b=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx(Qt,{}),e[16]=v):v=e[16];let x;e[17]!==i?(x=l.jsx(q,{phase:2,current:i,children:v}),e[17]=i,e[18]=x):x=e[18];let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx(Zt,{}),e[19]=N):N=e[19];let S;e[20]!==i?(S=l.jsx(q,{phase:3,current:i,children:N}),e[20]=i,e[21]=S):S=e[21];let A;e[22]!==x||e[23]!==S||e[24]!==m||e[25]!==b?(A=l.jsxs("div",{className:"relative aspect-[4/3] w-[min(78%,560px)]",children:[m,b,x,S]}),e[22]=x,e[23]=S,e[24]=m,e[25]=b,e[26]=A):A=e[26];let L;e[27]===Symbol.for("react.memo_cache_sentinel")?(L=l.jsx("style",{children:` @keyframes vm-pulse-soft { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } } @keyframes vm-breathe { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } } @keyframes vm-rack-scan { 0%, 100% { opacity: 0; } 8% { opacity: 1; } 22% { opacity: 0; } } `}),e[27]=L):L=e[27];let w;return e[28]!==A||e[29]!==g?(w=l.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center gap-12 select-none [clip-path:inset(-24px_0_-200px_0)]",children:[g,A,L]}),e[28]=A,e[29]=g,e[30]=w):w=e[30],w}function q(t){const e=R.c(10),{phase:n,current:s,children:o}=t,r=n-s,i=r<0,a=r===0,c=i?90:r*-22,f=i?.94:1-Math.max(r,0)*.04,p=i?0:a?1:r===1?.8:.55,g=i?10:30-r,d=!a;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=_("absolute inset-0 overflow-hidden rounded-xl border border-foreground/10 bg-background shadow-[0_20px_60px_-20px_rgb(0_0_0_/_0.35)] transition-all ease-[cubic-bezier(0.22,1,0.36,1)]"),e[0]=m):m=e[0];const y=`translateY(${c}px) scale(${f})`,b=a?"auto":"none";let v;e[1]!==p||e[2]!==y||e[3]!==b||e[4]!==g?(v={transform:y,opacity:p,zIndex:g,transitionDuration:"1000ms",pointerEvents:b},e[1]=p,e[2]=y,e[3]=b,e[4]=g,e[5]=v):v=e[5];let x;return e[6]!==o||e[7]!==d||e[8]!==v?(x=l.jsx("div",{"aria-hidden":d,className:m,style:v,children:o}),e[6]=o,e[7]=d,e[8]=v,e[9]=x):x=e[9],x}function ne(t){const e=R.c(7),{showUrl:n}=t,s=n===void 0?!1:n;let o,r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx("div",{className:_("size-2.5 rounded-full",k)}),r=l.jsx("div",{className:_("size-2.5 rounded-full",k)}),i=l.jsx("div",{className:_("size-2.5 rounded-full",k)}),e[0]=o,e[1]=r,e[2]=i):(o=e[0],r=e[1],i=e[2]);let a;e[3]!==s?(a=s&&l.jsx("div",{className:_("ml-3 h-3.5 max-w-[220px] flex-1 rounded-sm",j)}),e[3]=s,e[4]=a):a=e[4];let c;return e[5]!==a?(c=l.jsxs("div",{className:"flex h-7 shrink-0 items-center gap-1.5 px-3",children:[o,r,i,a]}),e[5]=a,e[6]=c):c=e[6],c}function Xt(){const t=R.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(ne,{}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsxs("div",{className:"flex h-full flex-col",children:[e,l.jsx("div",{className:"flex flex-1 px-8 py-5",children:l.jsx("div",{className:"grid h-full w-full grid-cols-8 grid-rows-6 gap-2",children:Ut.map(qt)})})]}),t[1]=n):n=t[1],n}function qt(t,e){if(e===Ie)return l.jsx("div",{className:"rounded-md bg-chart-1/[0.55]",style:{animation:"vm-breathe 2.4s ease-in-out infinite"}},e);const n=t;return l.jsx("div",{className:_("relative rounded-md",k),children:l.jsx("div",{className:"absolute inset-0 rounded-md bg-chart-1/40 opacity-0",style:{animation:`vm-rack-scan ${Me}s ease-in-out infinite`,animationDelay:`${n}s`}})},e)}function Wt(){const t=R.c(5);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(ne,{}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx("div",{className:_("w-[18%] rounded-md",j),style:{animation:"vm-breathe 3s ease-in-out infinite"}}),t[1]=n):n=t[1];let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx("div",{className:"h-[42%] shrink-0 rounded-md bg-chart-3/[0.12]",style:{animation:"vm-breathe 3s ease-in-out 0.4s infinite"}}),t[2]=s):s=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx("div",{className:"col-span-3 rounded-md bg-chart-3/[0.12]",style:{animation:"vm-breathe 3s ease-in-out 0.8s infinite"}}),t[3]=o):o=t[3];let r;return t[4]===Symbol.for("react.memo_cache_sentinel")?(r=l.jsxs("div",{className:"flex h-full flex-col",children:[e,l.jsxs("div",{className:"flex min-h-0 flex-1 gap-1.5 p-3",children:[n,l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[s,l.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-5 gap-1.5",children:[o,l.jsxs("div",{className:"col-span-2 grid grid-rows-2 gap-1.5",children:[l.jsx("div",{className:_("rounded-md",j),style:{animation:"vm-breathe 3s ease-in-out 1.2s infinite"}}),l.jsx("div",{className:_("rounded-md",j),style:{animation:"vm-breathe 3s ease-in-out 1.6s infinite"}})]})]})]})]})]}),t[4]=r):r=t[4],r}function Qt(){const t=R.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(ne,{}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsxs("div",{className:"flex h-full flex-col",children:[e,l.jsx("div",{className:"relative flex flex-1 items-center justify-center px-8 py-5",children:l.jsx("div",{className:"grid w-full gap-2",style:{gridTemplateColumns:"repeat(7, minmax(0, 1fr))"},children:zt.map(Jt)})})]}),t[1]=n):n=t[1],n}function Jt(t,e){return l.jsx("div",{className:_("aspect-square rounded-md",Ht[e]?"bg-chart-2/70":k),style:{animation:`vm-pulse-soft 2.2s ease-in-out ${t}s infinite`}},e)}function Zt(){const t=R.c(11);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(ne,{showUrl:!0}),t[0]=e):e=t[0];let n,s,o,r,i;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx("div",{className:"mb-2 h-5 rounded-md bg-chart-1/[0.10]"}),s=l.jsx("div",{className:_("h-1.5 w-[70%] rounded-sm",k)}),o=l.jsx("div",{className:_("h-1.5 w-[55%] rounded-sm",k)}),r=l.jsx("div",{className:_("h-1.5 w-[80%] rounded-sm",k)}),i=l.jsx("div",{className:_("h-1.5 w-[50%] rounded-sm",k)}),t[1]=n,t[2]=s,t[3]=o,t[4]=r,t[5]=i):(n=t[1],s=t[2],o=t[3],r=t[4],i=t[5]);let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsxs("div",{className:"flex w-[18%] shrink-0 flex-col gap-1.5 bg-chart-1/[0.05] p-2.5",children:[n,s,o,r,i,l.jsx("div",{className:"mt-auto",children:l.jsx("div",{className:_("h-4 rounded-md",k)})})]}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx("div",{className:"relative h-[42%] shrink-0 overflow-hidden bg-chart-1/[0.10]",children:l.jsxs("div",{className:"absolute right-3 bottom-3 left-3 space-y-1.5",children:[l.jsx("div",{className:"h-3 w-[35%] rounded-sm bg-chart-1/[0.15]"}),l.jsx("div",{className:_("h-1.5 w-[55%] rounded-sm",j)})]})}),t[7]=c):c=t[7];let f;t[8]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsxs("div",{className:"flex shrink-0 gap-1.5",children:[l.jsx("div",{className:"h-4 w-12 rounded-full bg-chart-1/[0.12]"}),l.jsx("div",{className:_("h-4 w-10 rounded-full",j)}),l.jsx("div",{className:_("h-4 w-14 rounded-full",j)})]}),t[8]=f):f=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=l.jsxs("div",{className:_("col-span-3 flex flex-col justify-end gap-1 rounded-md p-2",j),children:[l.jsx("div",{className:_("h-1.5 w-[50%] rounded-sm",k)}),l.jsx("div",{className:_("h-1 w-[75%] rounded-sm",k)})]}),t[9]=p):p=t[9];let g;return t[10]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsxs("div",{className:"flex h-full flex-col",children:[e,l.jsxs("div",{className:"flex min-h-0 flex-1",children:[a,l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[c,l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2.5 p-3",children:[f,l.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-5 gap-2",children:[p,l.jsxs("div",{className:"col-span-2 grid grid-rows-2 gap-2",children:[l.jsx("div",{className:_("rounded-md",j)}),l.jsx("div",{className:_("rounded-md",j)})]})]})]})]})]})]}),t[10]=g):g=t[10],g}function Is(t){const e=R.c(52),n=Re();if(t.kind==="starting"){let m;return e[0]!==t.claimPhase||e[1]!==t.progress?(m=l.jsx("div",{className:"flex h-full w-full items-center justify-center bg-background p-6",children:l.jsx(Yt,{progress:t.progress,claimPhase:t.claimPhase})}),e[0]=t.claimPhase,e[1]=t.progress,e[2]=m):m=e[2],m}if(t.kind==="errored"){const m=t.error.code===Ae.githubNotAuthenticated,y=t.error.code===Ae.githubConnectionMissing;let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsx(vt,{className:"size-12 text-destructive"}),e[3]=b):b=e[3];let v;e[4]!==n?(v=n("sandbox.stateCard.erroredHeadline"),e[4]=n,e[5]=v):v=e[5];let x;e[6]!==v?(x=l.jsx("h3",{className:"text-lg font-medium",children:v}),e[6]=v,e[7]=x):x=e[7];let N;e[8]!==y||e[9]!==m||e[10]!==t.error.message||e[11]!==n?(N=y?n("sandbox.stateCard.githubConnectionMissingMessage"):m?n("sandbox.stateCard.githubNotAuthenticatedMessage"):t.error.message,e[8]=y,e[9]=m,e[10]=t.error.message,e[11]=n,e[12]=N):N=e[12];let S;e[13]!==N?(S=l.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:N}),e[13]=N,e[14]=S):S=e[14];let A;e[15]!==y||e[16]!==m||e[17]!==t.connectionsHref||e[18]!==n?(A=(m||y)&&t.connectionsHref&&l.jsx(le,{asChild:!0,children:l.jsx("a",{href:t.connectionsHref,children:n(y?"sandbox.stateCard.linkRepoAgain":"sandbox.stateCard.reconnectGithub")})}),e[15]=y,e[16]=m,e[17]=t.connectionsHref,e[18]=n,e[19]=A):A=e[19];const L=t.onRetry;let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx(xt,{className:"size-4"}),e[20]=w):w=e[20];let I;e[21]!==n?(I=n("sandbox.stateCard.retry"),e[21]=n,e[22]=I):I=e[22];let M;e[23]!==t.onRetry||e[24]!==I?(M=l.jsxs(le,{variant:"outline",onClick:L,children:[w," ",I]}),e[23]=t.onRetry,e[24]=I,e[25]=M):M=e[25];let $;e[26]!==A||e[27]!==M?($=l.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[A,M]}),e[26]=A,e[27]=M,e[28]=$):$=e[28];let X;return e[29]!==$||e[30]!==x||e[31]!==S?(X=l.jsx("div",{className:"flex h-full w-full items-center justify-center bg-background p-6",children:l.jsxs("div",{className:"flex w-full max-w-md flex-col items-center gap-4 text-center",children:[b,x,S,$]})}),e[29]=$,e[30]=x,e[31]=S,e[32]=X):X=e[32],X}let s;e[33]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(Tt,{className:"size-12 text-muted-foreground"}),e[33]=s):s=e[33];let o;e[34]!==n?(o=n("sandbox.stateCard.suspendedHeadline"),e[34]=n,e[35]=o):o=e[35];let r;e[36]!==o?(r=l.jsx("h3",{className:"text-lg font-medium",children:o}),e[36]=o,e[37]=r):r=e[37];let i;e[38]!==n?(i=n("sandbox.stateCard.resumeToContinue"),e[38]=n,e[39]=i):i=e[39];let a;e[40]!==i?(a=l.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:i}),e[40]=i,e[41]=a):a=e[41];const c=t.onResume;let f;e[42]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(jt,{className:"size-4"}),e[42]=f):f=e[42];let p;e[43]!==n?(p=n("sandbox.stateCard.resume"),e[43]=n,e[44]=p):p=e[44];let g;e[45]!==t.onResume||e[46]!==p?(g=l.jsxs(le,{onClick:c,className:"mt-2",children:[f," ",p]}),e[45]=t.onResume,e[46]=p,e[47]=g):g=e[47];let d;return e[48]!==r||e[49]!==a||e[50]!==g?(d=l.jsx("div",{className:"flex h-full w-full items-center justify-center bg-background p-6",children:l.jsxs("div",{className:"flex w-full max-w-md flex-col items-center gap-4 text-center",children:[s,r,a,g]})}),e[48]=r,e[49]=a,e[50]=g,e[51]=d):d=e[51],d}function Ms(t){switch(t.lifecycle.phase){case"cloning":case"checking-out":return{step:"cloning",status:"doing"};case"clone-failed":return{step:"cloning",status:"failed"};case"installing":return{step:"install",status:"doing"};case"install-failed":return{step:"install",status:"failed"};case"starting":return{step:"dev",status:"doing"};case"running":return{step:"dev",status:"done"};case"start-failed":return{step:"dev",status:"failed"};case"crashed":return{step:"dev",status:"failed"};case"idle":return t.claimPhase&&t.claimPhase.kind!=="ready"&&t.claimPhase.kind!=="failed"?{step:"provision",status:"doing"}:{step:"cloning",status:"doing"}}}const en="website/sections/Rendering/Lazy.tsx";function J(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function be(t){if(!J(t))return!1;const e=t.__resolveType;return typeof e=="string"&&De(e)}function $e(t){return t!=null}function G(t){if(t==null)return t;if(be(t)){const e=t.section;return e==null?null:J(e)?e:{}}return J(t)?t:void 0}function tn(t,e){return t===null?null:be(e)?{...e,section:t}:t}function $s(t){return{__resolveType:t}}function Ks(t,e){if(!$e(e))return null;if(t){const n=G(e)??{};return{__resolveType:en,section:n}}return be(e)?G(e)??null:J(e)?e:null}const B="website/sections/Seo/SeoV2.tsx",nn=["title","titleTemplate","description","descriptionTemplate","image","favicon","type","noIndexing"];function K(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function sn(t,e){return typeof t.__resolveType=="string"&&V(t.__resolveType,e)?!0:nn.some(n=>n in t)}function Fs(t,e){return Object.entries(t).filter(([n,s])=>{if(!K(s))return!1;const o=s.__resolveType;return Dt(n,s)||typeof o=="string"&&V(o,e)}).map(([n])=>n)}function Ke(t,e){for(const[n,s]of Object.entries(t)){if(!K(s)||Se(s))continue;const o=s,r=o.__resolveType;if(typeof r=="string"&&Rt(r,e))continue;const i=o.seo;if(K(i)){const a=i;if(sn(a,e))return{blockKey:n,kind:"nested",seoData:a,blockData:o,seoResolveType:e?un(e,o,a):typeof a.__resolveType=="string"&&V(a.__resolveType)?a.__resolveType:B}}}for(const[n,s]of Object.entries(t)){if(!K(s)||Se(s))continue;const o=s;if(typeof o.__resolveType=="string"&&V(o.__resolveType,e))return{blockKey:n,kind:"block",seoData:o,blockData:o,seoResolveType:o.__resolveType}}return null}function on(t,e){return t.kind==="block"?e:{...t.blockData,seo:e}}function Us(t,e,n){if(e.kind==="site"){const c=Ke(t,n);return c?{blockKey:c.blockKey,seoData:c.seoData,seoResolveType:c.seoResolveType,siteKind:c.kind,seoTypeOptions:n?Ve(n,c.blockData):void 0,build:f=>on(c,f)}:null}const s=t[e.pageKey];if(!K(s))return null;const o=s,r=o.seo,i=G(r),a=i&&K(i)?i:void 0;return{blockKey:e.pageKey,seoData:a,rawSeoData:r,seoResolveType:n?ln(n,a):typeof a?.__resolveType=="string"?a.__resolveType:B,seoTypeOptions:n?se(n):void 0,build:c=>({...o,seo:c===null?null:tn(c,r)})}}const rn="General";function _e(t){return/\/Seo(V\d+)?\.tsx$/i.test(t)||t.includes("/sections/Seo")}function V(t,e){return _e(t)?!0:!e||!te(e)?!1:se(e).some(n=>n.resolveType===t)}function Gs(t,e,n){const s=new Set;let o=t;for(let r=0;r<32;r++){if(s.has(o))return null;if(s.add(o),!Object.hasOwn(e,o))return ye(o,n)?o:null;const i=e[o];if(!i||typeof i!="object"||Array.isArray(i))return null;const a=i.__resolveType;if(typeof a!="string"||!a)return null;o=a}return null}function Fe(t,e){return t===B?rn:e}function Ue(t,e){const n=Lt(t),s=te(e),o=new Set,r=[];for(const i of n){if(s){if(De(i.resolveType))continue}else if(!_e(i.resolveType))continue;St(i.resolveType,e)||o.has(i.resolveType)||(o.add(i.resolveType),r.push({resolveType:i.resolveType,title:Fe(i.resolveType,i.title),description:i.description}))}return r}function se(t){const e=Bt(t),n=ye(e,t),s=Ue(n?.properties?.seo,t);return s.length>0?s:te(t)?[]:an(t)}function an(t){const e=t.manifest?.blocks??{},n=[];for(const[s,o]of Object.entries(e))if(s.includes("sections"))for(const r of Object.keys(o)){if(!_e(r))continue;const i=r.split("/").pop()?.replace(/\.tsx?$/,"")??r;n.push({resolveType:r,title:Fe(r,i)})}return n}function Ge(t){const e=se(t),n=e.find(o=>o.resolveType===B);if(n)return n.resolveType;const s=te(t)?"":B;return e[0]?.resolveType??s}function Ve(t,e){const n=e.__resolveType;if(typeof n=="string"){const s=ye(n,t),o=Ue(s?.properties?.seo,t);if(o.length>0)return o}return se(t)}function cn(t,e){const n=Ve(t,e),s=n.find(o=>o.resolveType===B);return s?s.resolveType:n[0]?.resolveType??Ge(t)}function ln(t,e){const n=e?.__resolveType;return typeof n=="string"&&n.length>0?n:Ge(t)}function un(t,e,n){const s=n.__resolveType;return typeof s=="string"&&V(s,t)?s:cn(t,e)}const fn=["draft","active","paused","finished"],dn=["launch","seasonal","trend","seo_gap","inventory","partnership","reputation"],pn=["awareness","education","conversion","retention","repositioning"],mn=["category","collection"],gn=3,Vs=12,hn=60,yn=25,bn=8e3,_n=2e3,vn="vtex/loaders/intelligentSearch/productList.ts";function P(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function ue(t){return typeof t=="string"||typeof t=="number"?String(t):""}function fe(t){const e=P(t);return!!e&&typeof e.__resolveType=="string"&&"productId"in e}function zs(t){if(typeof t=="string")return t?[t]:[];if(Array.isArray(t))return t.every(s=>typeof s=="string")?t:t.map(s=>ue(P(s)?.productId));const e=P(t),n=P(e?.props);return n&&Array.isArray(n.ids)?n.ids.map(ue):e&&"productId"in e?[ue(e.productId)]:[]}function xn(t){const e=P(t)??{};return typeof e.__resolveType=="string"?e.__resolveType:vn}function Sn(t,e){if(typeof t=="string")return e[0]??"";if(Array.isArray(t)){if(t.length>0&&t.every(i=>typeof i=="string"))return e;const r=t.find(fe);if(r)return e.map((i,a)=>{const c=P(t[a]);return{...fe(c)?c:{__resolveType:r.__resolveType},productId:i}})}const n=P(t);if(fe(n)&&!P(n.props)?.ids)return{...n,productId:e[0]??""};const s=P(n?.props)??{},o=xn(t);return{...n??{},__resolveType:o,props:{...s,ids:e,simulationBehavior:s.simulationBehavior??"default"}}}const ve=["type","title","description","canonical","noIndexing","favicon","image","themeColor"],ze=["jsonLD","omitVariants","title","description","noIndexing","ignoreStructuredData"],He=["jsonLD","title","description","noIndexing","configJsonLD"];function An(t){return t===B||/\/Seo\/SeoV2\.tsx$/i.test(t)?"general":/\/Seo\/SeoPDP/i.test(t)?"pdp":/\/Seo\/SeoPLP/i.test(t)?"plp":null}function kn(t){const e=t.toLowerCase();return/pdp|product/.test(e)?"pdp":/plp|listing|categor|search/.test(e)?"plp":null}function de(t,e){const n=Object.keys(t.properties??{}).filter(s=>s!=="__resolveType");return n.length>0&&n.every(s=>e.includes(s))}function Ye(t,e,n=!1){const s=An(t);if(s)return s;if(!n||t.includes("/"))return"full";const o=kn(t);return e?o==="pdp"&&de(e,ze)?"pdp":o==="plp"&&de(e,He)?"plp":de(e,ve)?"general":"full":o??"full"}function Cn(t){switch(t){case"general":return ve;case"pdp":return ze;case"plp":return He;default:return null}}function Hs(t,e,n=!1){const s=Cn(Ye(e,t,n));if(!s||!t.properties)return t;const o={};for(const r of s){const i=t.properties[r];i&&(o[r]=i)}return{...t,properties:o}}function Ys(){return ve.filter(t=>t!=="type")}const En=["title","titleTemplate","description","descriptionTemplate"];function Xe(t){return typeof t=="string"?t.trim():""}function Ce(t){if(!$e(t))return"";const e=G(t);if(!e)return"";const n=[];for(const s of En){const o=Xe(e[s]);o&&n.push(`${s}: ${o}`)}return n.join(` `).slice(0,_n)}function qe(t,e){const n=t[e.key],s=n&&typeof n=="object"?G(n.seo):null,o=Xe(s?.__resolveType);if(o){const r=Ye(o);if(r==="pdp"||r==="plp")return"commerce"}return It(e.path).length>0?"commerce":e.path==="/"?"home":"institutional"}function Nn(t,e){const n=[],s=new Set;let o=bn;const r=(f,p)=>{!p||s.has(p)||n.length>=yn||p.length>o||(s.add(p),n.push({key:f,content:p}),o-=p.length)},i=Ke(t);i&&r("site",Ce(i.seoData));const a={home:[],institutional:[],commerce:[]};for(const f of e)a[qe(t,f)].push(f);const c=[...a.home,...a.institutional,...a.commerce.slice(0,2)];for(const f of c){const p=t[f.key];!p||typeof p!="object"||r(f.path,Ce(p.seo))}return n}const pe={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},We=["posts","authors","categories"],Xs={posts:"post",authors:"author",categories:"category"};function qs(t){return We.includes(t)}const oe={posts:"post",authors:"author",categories:"category"},Qe={posts:pe.post,authors:pe.author,categories:pe.category},Tn=Object.fromEntries(Object.entries(Qe).map(([t,e])=>[e,t]));function Je(t){return typeof t=="string"?Tn[t]??null:null}function Ws(t){return Je(t)!==null}function h(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function u(t){return typeof t=="string"?t:""}function jn(t,e){switch(t){case"posts":return{label:u(e.title)||"Untitled post",subtitle:u(e.slug),missing:re(e)};case"authors":return{label:u(e.name)||"Unnamed author",subtitle:u(e.email),missing:[]};case"categories":return{label:u(e.name)||"Unnamed category",subtitle:u(e.slug),slug:u(e.slug),parentSlug:u(e.parentSlug),missing:Mn(e)};default:{const n=t;throw new Error(`Unhandled blog kind: ${String(n)}`)}}}function wn(t){const e={posts:[],authors:[],categories:[]},n=[];for(const[s,o]of Object.entries(t)){const r=h(o);if(!r)continue;const i=Je(r.__resolveType);if(!i)continue;const a=h(r[oe[i]])??{},c={key:s,kind:i,...jn(i,a)};e[i].push(c),n.push({entry:c,key:ee(u(a[i==="posts"?"title":"name"]))})}Pn(n);for(const s of We)e[s].sort((o,r)=>o.label.localeCompare(r.label));return e}function Pn(t){const e=new Map;for(const{entry:n,key:s}of t){if(!s)continue;const o=`${n.kind}:${s}`;e.set(o,(e.get(o)??0)+1)}for(const{entry:n,key:s}of t)s&&(e.get(`${n.kind}:${s}`)??0)>1&&(n.duplicateName=!0)}function On(t,e){return wn(t)[e]}function D(t,e){return On(t,e).map(n=>({key:n.key,payload:Ze(h(t[n.key])??void 0,e)}))}const me=Object.freeze({});function Ze(t,e){return t?h(t[oe[e]])??me:me}function et(t,e,n){return{name:t,__resolveType:Qe[e],[oe[e]]:n}}function Qs({records:t,selected:e,valueField:n,toRef:s}){const o=Array.isArray(e)?e:[],r=d=>typeof d=="string"?d:u(h(d)?.[n]),i=d=>typeof d=="string"?d:u(h(d)?.name),a=d=>{const m=r(d),y=m?t.find(({payload:v})=>u(v[n])===m):void 0;if(y)return y;const b=i(d);return b?t.find(({payload:v})=>u(v.name)===b):void 0},c=t.map(({key:d,payload:m})=>({value:d,label:u(m.name)||u(m[n])||d})),f=new Map,p=[];return o.forEach((d,m)=>{const y=a(d);if(y){p.includes(y.key)||p.push(y.key);return}const b=`unresolved:${m}`;f.set(b,d),p.push(b),c.push({value:b,label:i(d)||r(d)||"Unknown"})}),{options:c,selectedValues:p,refsForValues:d=>d.map(m=>{const y=t.find(b=>b.key===m);return y?s(y.payload):f.get(m)}).filter(m=>m!==void 0)}}function Js(t){return D(t,"authors").map(({payload:e})=>({...e,name:u(e.name),email:u(e.email)})).filter(e=>e.email)}function E(t){return Array.isArray(t)?t:[]}function O(t){if(typeof t=="string")return t;const e=h(t);return e?u(e.slug):""}function tt(t){if(typeof t=="string")return t;const e=h(t);return e?u(e.email):""}const Rn={title:"sandbox.blogField.title",slug:"sandbox.blogField.slug",category:"sandbox.blogField.category",excerpt:"sandbox.blogField.excerpt",image:"sandbox.blogField.image",name:"sandbox.blogField.name"};function Zs(t,e){return t.map(n=>e(Rn[n])).join(", ")}function re(t){const e=[];return u(t.title).trim()||e.push("title"),u(t.slug).trim()||e.push("slug"),E(t.categories).map(O).filter(Boolean).length===0&&e.push("category"),u(t.excerpt).trim()||e.push("excerpt"),u(t.image).trim()||e.push("image"),e}const eo=["draft","generating","awaiting_review","scheduled","published","archived"],Dn=8;function Y(t){switch(u(t.status)){case"draft":case"idea":return"draft";case"generating":return"generating";case"awaiting_review":case"in_review":return"awaiting_review";case"scheduled":return"scheduled";case"published":return"published";case"archived":return"archived";case"":return"published";default:return"awaiting_review"}}function to(t){return Y(t)==="archived"}function no(t,e){return e!=="published"&&e!=="scheduled"||Y(t)===e?!1:re(t).length>0}function Bn(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,Dn).toISOString()}function nt(t,e,n){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const s=u(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(s).getTime())?Bn(n):s}}function Ln(t,e=gt(t)){return D(t,"posts").map(({key:n,payload:s})=>({key:n,duplicateTitle:e.has(n),title:u(s.title)||"Untitled post",slug:u(s.slug),date:u(s.date),scheduledDatetime:u(s.scheduledDatetime),categorySlugs:E(s.categories).map(O).filter(Boolean),authorEmails:E(s.authors).map(tt).filter(Boolean),missing:re(s),status:Y(s),form:"live"}))}function so(){return F(12)}function oo(t){const e=h(t.planning)??{},n=h(e.format);return{campaignKey:u(e.campaignKey)||void 0,format:n?{name:u(n.name),value:u(n.value)}:void 0,brief:u(e.brief)||void 0}}function st(t=!1){return t?{content:""}:{sections:[]}}function ro(t){return{title:t.title,slug:"",excerpt:"",date:t.now.toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],...st(t.legacyContent),status:"draft",planning:t.planning??{}}}function ot(t,e){return{name:t,[oe.posts]:e}}function io(t,e){return Be(t)?ot(t,e):et(t,"posts",e)}function rt(t){const e=[];for(const[n,s]of Object.entries(t)){if(!Be(n))continue;const o=h(s);o&&e.push({key:n,payload:Ze(o,"posts")})}return e}function In(t){return[...rt(t),...D(t,"posts")]}function ao(t){const e=gt(t);return[...rt(t).map(({key:s,payload:o})=>({key:s,duplicateTitle:e.has(s),title:u(o.title)||"Untitled post",slug:u(o.slug),date:u(o.date),scheduledDatetime:u(o.scheduledDatetime),categorySlugs:E(o.categories).map(O).filter(Boolean),authorEmails:E(o.authors).map(tt).filter(Boolean),missing:re(o),status:Y(o),form:"planning"})),...Ln(t,e)]}function co(t,e,n){const s=nt(t.payload,e,n),o=At(t.key),r=e==="scheduled"||e==="published"?"live":"planning",i=r==="live"?kt(o):Ct(o),a=r==="live"?et(i,"posts",s):ot(i,s);return{writes:{[i]:a},deletes:i===t.key?[]:[t.key]}}function lo(t,e,n){const s=E(t.categories);if(!s.some(c=>O(c)===e))return t;let o=!1;const r=s.map(c=>{const f=O(c);if(f!==e&&f!==n.slug)return c;const p=h(c);return p&&u(p.slug)===n.slug&&u(p.name)===n.name?c:(o=!0,{name:n.name,slug:n.slug})});if(!o){const c=s.map(O).filter(Boolean);if(new Set(c).size===c.length)return t}const i=new Set,a=r.filter(c=>{const f=O(c);return f?i.has(f)?!1:(i.add(f),!0):!0});return{...t,categories:a}}function Mn(t){const e=[];return u(t.name).trim()||e.push("name"),u(t.slug).trim()||e.push("slug"),e}function uo(t,e){const n=E(t.categories);return n.some(s=>O(s)===e)?{...t,categories:n.filter(s=>O(s)!==e)}:t}function fo(t,e,n){return u(t.parentSlug)!==e?t:{...t,parentSlug:n}}function po(t){const e=u(t.status),n=e==="idea"||e==="in_review"?{status:Y(t)}:{};return{...t,...n,dateModified:new Date().toISOString()}}function F(t){const e=new Uint8Array(Math.ceil(t/2));return crypto.getRandomValues(e),Array.from(e,n=>n.toString(16).padStart(2,"0")).join("").slice(0,t)}function mo(t,e){const n=`collections/blog/${e}/${F(12)}`;if(!Object.hasOwn(t,n))return n;throw new Error("Could not generate a unique blog block key")}function go(t,{legacyContent:e=!1}={}){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${F(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],...st(e)};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",url:"",avatar:""};case"categories":return{name:"New category",slug:`category-${F(8)}`,description:"",sections:[]};default:{const n=t;throw new Error(`Unhandled blog kind: ${String(n)}`)}}}const $n={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},Ee="Box";function it(t){return t.startsWith("blog/")?"app":"site"}function Kn(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function U(...t){for(const e of t)if(e!==void 0)return e}function Ne(t){if(t&&!(t.includes("/")||/\.(tsx?|jsx?)$/.test(t)))return t}function Fn(t){const e=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():t}function Un(t,e){const n=$t(t,e),s=ie(t),o=$n[s],r=it(t),i=Ne(n.title),a=Ne(n.description),c=(r==="site"?U(i,o?.title):U(o?.title,i))??Fn(s),f=r==="site"?U(a,o?.description):U(o?.description,a),p=r==="site"?n.icon:void 0,g=p&&Kn(p)?p:void 0,d=g!==void 0?o?.iconName??Ee:U(p,o?.iconName)??Ee;return{resolveType:t,title:c,description:f,iconName:d,iconUrl:g,source:r}}function at(t,{hideDefaults:e=!1,customPaths:n=[]}={}){const s=new Set,o=[],r=t.manifest?.blocks??{};for(const[i,a]of Object.entries(r))for(const c of Object.keys(a))s.has(c)||!(i==="sections"&&ct(c,n)&&!Mt(c,t))&&!Vn(c)||e&&it(c)==="app"||(s.add(c),o.push(Un(c,t)));return o.sort((i,a)=>i.title.localeCompare(a.title))}function ie(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const Gn=["blog/sections/blocks/","site/sections/Blog/Post/"];function Vn(t,e=[]){return Gn.some(n=>t.startsWith(n))||ct(t,e)}function ct(t,e){if(e.length===0)return!1;const n=t.toLowerCase();return e.some(s=>n===s||n.startsWith(`${s}/`))}const zn=/\/blog\.tsx?$/;function Hn(t){const e=[];for(const[n,s]of Object.entries(t)){if(n.includes("/")||!s||typeof s!="object"||Array.isArray(s))continue;const o=s;typeof o.__resolveType=="string"&&zn.test(o.__resolveType)&&e.push(o)}return e}const Yn=Et(Nt());function ho(t){const e=new Set;for(const n of Hn(t)){const s=Yn.safeParse(n.customSectionPaths);if(s.success)for(const o of s.data){const r=o.trim().replace(/^\/+|\/+$/g,"").toLowerCase();r&&e.add(r)}}return[...e]}const Xn="blog-manager-brand",qn="blog-manager-context",lt=["companyName","description","language","storeUrl","targetAudience","values","competitors","keywords","commercialPolicies","specialDates"],ut=["tone","dos","avoid","categories","vocabulary","voiceExamples"];function yo(t){return h(t)??me}function Z(t,e){const n={};for(const s of e)s in t&&(n[s]=t[s]);return n}function bo(t,e,n){const s=Z(t,lt);if(h(n))return s;const o=h(e)??{};return{...Z(o,ut),...s}}function Wn(t,e){const n=h(t)??{},s=h(e),o=Z(n,lt),r=s??Z(n,ut);return{brand:o,context:r,merged:{...o,...r}}}function _o(t){return Wn(t[Xn],t[qn])}function vo(t){return{companyName:u(t.companyName),description:u(t.description),language:u(t.language),storeUrl:Ot(u(t.storeUrl))??"",tone:u(t.tone),targetAudience:u(t.targetAudience),values:T(C(t.values)),competitors:T(C(t.competitors)),specialDates:T(C(t.specialDates)),dos:T(C(t.dos)),avoid:T(C(t.avoid)),keywords:H(z(t.keywords)),commercialPolicies:T(C(t.commercialPolicies)),vocabulary:T(C(t.vocabulary)),voiceExamples:he(ge(t.voiceExamples))}}function ge(t){if(!Array.isArray(t))return[];const e=[];for(const n of t){if(typeof n=="string"){n.trim()&&e.push({text:n,sounds:!0});continue}const s=h(n);if(!s)continue;const o=u(s.text)||u(s.value);e.push({text:o,sounds:s.sounds!==!1})}return e}function he(t){return t.filter(e=>e.text.trim())}function xo(t,e,n){const s=[];for(const o of n.textFields){const r=u(e[o]).trim();r&&(n.mode==="empty"&&u(t[o]).trim()||(t[o]=r,s.push(o)))}for(const o of n.ruleFields){const r=T(C(e[o]));r.length!==0&&(n.mode==="empty"&&T(C(t[o])).length>0||(t[o]=r,s.push(o)))}for(const o of n.termFields??[]){const r=H(z(e[o]));r.length!==0&&(n.mode==="empty"&&H(z(t[o])).length>0||(t[o]=r,s.push(o)))}for(const o of n.exampleFields??[]){const r=he(ge(e[o]));r.length!==0&&(n.mode==="empty"&&he(ge(t[o])).length>0||(t[o]=r,s.push(o)))}return s}function z(t){if(!Array.isArray(t))return[];const e=[];for(const n of t){if(typeof n=="string"){e.push(n);continue}const s=h(n);s&&e.push(u(s.name)||u(s.value))}return e}function H(t){return t.filter(e=>e.trim())}function C(t){if(!Array.isArray(t))return[];const e=[];for(const n of t){if(typeof n=="string"){n.trim()&&e.push({name:n,value:""});continue}const s=h(n);s&&e.push({name:u(s.name),value:u(s.value)})}return e}function T(t){return t.filter(e=>e.name.trim()||e.value.trim())}const Qn=6e4,Jn=4e3;function Zn(t){const e=[],n=new Set,s=(o,r)=>{if(typeof o=="string"){if(!o.includes(" ")||o.length<4||/^(https?:)?\/\//.test(o)||/^data:/.test(o))return;const i=`${r}: ${o.trim()}`;if(n.has(i))return;n.add(i),e.push(i);return}if(Array.isArray(o)){for(const i of o)s(i,r);return}if(o&&typeof o=="object")for(const[i,a]of Object.entries(o))i!=="__resolveType"&&s(a,i)};return s(t,"block"),e.join(` `)}function So(t,e){const n=new Map,s=d=>{const m=n.get(d);if(m!==void 0)return m;const y=Zn(t[d]).slice(0,Jn);return n.set(d,y),y},o=(d,m)=>s(m).length-s(d).length,r=Nn(t,e),i=r.reduce((d,m)=>d+m.content.length,0),a={home:[],institutional:[],commerce:[]};for(const d of e)a[qe(t,d)].push(d.key);const c=[...D(t,"posts").map(d=>d.key).sort(o),...D(t,"categories").map(d=>d.key),...a.home,...a.institutional.sort(o),...a.commerce.sort(o)],f=[],p=new Set;let g=Math.max(0,Qn-i);for(const d of c){if(f.length>=hn)break;if(p.has(d)||!t[d])continue;p.add(d);const m=s(d);if(m.length>g)break;f.push({key:d,content:m}),g-=m.length}return{blocks:f,seo:r}}const ft="blog-manager/campaigns/";function Ao(){return`${ft}${crypto.randomUUID()}`}function W(t,e,n){return t.find(s=>s===e)??n}function Te(t){return u(t)||null}function es(t){const e=[];for(const n of E(t)){const s=h(n);s&&e.push({kind:W(mn,s.kind,"category"),id:u(s.id),name:u(s.name),url:u(s.url),description:u(s.description)})}return e}function ts(t){const e=E(t.images).map(s=>u(s));return(e.length>0?e:[u(t.image)].filter(Boolean)).slice(0,gn)}function ns(t){const e=[];for(const n of E(t)){const s=h(n);s&&e.push({id:u(s.id),name:u(s.name),url:u(s.url),images:ts(s),category:u(s.category),description:u(s.description)})}return e}function ko(t,e){return{name:t,campaignName:e.name,seedKey:e.seedKey,status:e.status,period:{start:e.period.start??"",end:e.period.end??""},trigger:{type:e.trigger.type,note:e.trigger.note},intent:{objective:e.intent.objective,targets:e.intent.targets,products:e.intent.products,keywords:e.intent.keywords},guardrails:{avoidComplements:e.guardrails.avoidComplements,toneOverrides:e.guardrails.toneOverrides},createdAt:e.createdAt,updatedAt:e.updatedAt}}function Co(t){const e=[];for(const[n,s]of Object.entries(t)){if(!n.startsWith(ft))continue;const o=h(s);if(!o)continue;const r=h(o.period)??{},i=h(o.trigger)??{},a=h(o.intent)??{},c=h(o.guardrails)??{};e.push({key:n,name:u(o.campaignName),seedKey:u(o.seedKey),status:W(fn,o.status,"draft"),period:{start:Te(r.start),end:Te(r.end)},trigger:{type:W(dn,i.type,"seasonal"),note:u(i.note)},intent:{objective:W(pn,a.objective,"awareness"),targets:es(a.targets),products:ns(a.products),keywords:H(z(a.keywords))},guardrails:{avoidComplements:C(c.avoidComplements),toneOverrides:u(c.toneOverrides)},createdAt:u(o.createdAt),updatedAt:u(o.updatedAt)})}return e.sort((n,s)=>s.createdAt.localeCompare(n.createdAt)||n.name.localeCompare(s.name))}function Eo(t){const e=t.toISOString();return{name:"",seedKey:"",status:"draft",period:{start:null,end:null},trigger:{type:"seasonal",note:""},intent:{objective:"awareness",targets:[],products:[],keywords:[]},guardrails:{avoidComplements:[],toneOverrides:""},createdAt:e,updatedAt:e}}const dt="blog-manager/campaign-seeds/";function No(){return`${dt}${crypto.randomUUID()}`}function To(t,e){return{name:t,seedName:e.name,keywords:e.keywords,prompt:e.prompt,createdAt:e.createdAt,updatedAt:e.updatedAt}}function jo(t){const e=[];for(const[n,s]of Object.entries(t)){if(!n.startsWith(dt))continue;const o=h(s);o&&e.push({key:n,name:u(o.seedName),keywords:H(z(o.keywords)),prompt:u(o.prompt),createdAt:u(o.createdAt),updatedAt:u(o.updatedAt)})}return e.sort((n,s)=>s.createdAt.localeCompare(n.createdAt)||n.name.localeCompare(s.name))}function wo(t){const e=t.toISOString();return{name:"",keywords:[],prompt:"",createdAt:e,updatedAt:e}}const Po="blog-manager-formats",ss=40;function Oo(t){return D(t,"posts").slice(0,ss).map(({key:e,payload:n})=>({key:e,title:u(n.title),sections:E(n.sections).map(s=>u(h(s)?.__resolveType)).filter(Boolean).map(ie)}))}function os(t,e){return at(t,e).map(n=>({name:ie(n.resolveType),resolveType:n.resolveType,title:n.title,description:n.description}))}function pt(t,e={}){const n=new Set,s=/\[@[^\]]+\]\(([^)\s]+)\)/g;for(const r of t.matchAll(s))r[1]&&n.add(r[1]);const o=/(?:^|[\s([{>])@([A-Za-z][\w-]*)/g;for(const r of t.replace(s," ").matchAll(o)){const i=r[1];i&&n.add(e[i]??i)}return[...n]}function Ro(t,e,n={}){const s=new Set(e);return pt(t,n).filter(o=>!s.has(o))}function Do(t,e){const n=/\[@[^\]]+\]\([^)\s]+\)/g,s=[];let o=0;for(const r of t.matchAll(n)){const i=r.index??0;s.push(je(t.slice(o,i),e),r[0]),o=i+r[0].length}return s.push(je(t.slice(o),e)),s.join("")}function je(t,e){return t.replace(/(^|[\s([{>])@([A-Za-z][\w-]*)/g,(n,s,o)=>{const r=e[o];return r?`${s}[@${o}](${r})`:n})}const rs=["Heading","Paragraph","BlockImage","List","Cta"];function Bo(t){return rs.filter(e=>e in t)}function ee(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/\s+/g," ").trim()}function Lo(t,e,n,s){const o=ee(s);return o?mt(t,e).some(r=>r.key!==n&&ee(r.name)===o):!1}function mt(t,e){return e!=="posts"?D(t,e).map(({key:n,payload:s})=>({key:n,name:u(s.name)})):In(t).map(({key:n,payload:s})=>({key:n,name:u(s.title)}))}function gt(t){const e=new Map;for(const{key:s,name:o}of mt(t,"posts")){const r=ee(o);if(!r)continue;const i=e.get(r);i?i.push(s):e.set(r,[s])}const n=new Set;for(const s of e.values())if(s.length>1)for(const o of s)n.add(o);return n}const is=["companyName","language","description","tone","targetAudience"];function Io(t){const e=h(t)??{},n=[];for(const s of is)u(e[s]).trim()||n.push(s);return T(C(e.dos)).length===0&&n.push("dos"),T(C(e.avoid)).length===0&&n.push("avoid"),n}function as(t,e){const n=t.required;if(!Array.isArray(n))return;const s=new Set(e&&typeof e=="object"?Object.keys(e):[]),o=n.filter(r=>typeof r=="string"&&s.has(r));return o.length>0?o:void 0}const cs=6,ls=6e3;function us(t){const e=t.schema??{},n=e.$defs??e.definitions;return n&&typeof n=="object"?n:{}}function fs(t,e){for(const n of Object.values(e.manifest?.blocks??{})){const s=n[t];if(s)return s}}function Q(t,e,n){if(Array.isArray(t))return t.map(r=>Q(r,e,n));if(!t||typeof t!="object")return t;const s=t;if(typeof s.$ref=="string"){if(n>=cs)return{};const r=s.$ref.split("/").pop()??"",i=e[r];return i===void 0?{}:Q(i,e,n+1)}const o={};for(const[r,i]of Object.entries(s))o[r]=Q(i,e,n);return o}function ds(t,e){const n=us(e),s=Q(fs(t,e),n,0);if(!s||typeof s!="object")return{};const o=s,r=o.allOf,i=Array.isArray(r)&&r.length===1?r[0]:o;if(!i||typeof i!="object")return{};const{$schema:a,...c}=i,f=we(c);return JSON.stringify(f).length>ls?we(c,!0):f}function we(t,e=!1){const n={...t},s=n.properties;if(s&&typeof s=="object"){const o=Object.fromEntries(Object.entries(s).filter(([r])=>!r.startsWith("__")).map(([r,i])=>[r,e?ht(i):i]));n.properties=o,n.required=as(n,o),n.required||delete n.required}return n}function ht(t){if(!t||typeof t!="object")return t;const e=t,n={};for(const s of["type","description","format","options","enum"])s in e&&(n[s]=e[s]);return Array.isArray(e.anyOf)&&(n.anyOf=e.anyOf.map(ht)),n}function ps(t){if(t==null)return null;if(Array.isArray(t))return"array";const e=typeof t;return e==="number"||e==="boolean"||e==="string"||e==="object"?e:null}function ms(t,e){const n=t.properties;if(!e||!n||typeof n!="object")return t;const s=n;let o=!1;const r={};for(const[i,a]of Object.entries(s)){const c=a&&typeof a=="object"?{...a}:a,f=c?.type,p=ps(e[i]);c&&typeof c=="object"&&p&&typeof f=="string"&&f!==p&&(delete c.type,delete c.enum,o=!0),r[i]=c}return o?{...t,properties:r}:t}const gs={Paragraph:{html:"<p>A dúvida entre 9000 ou 12000 BTUs é a mais comum na hora de escolher.</p>"},Heading:{text:"Antes de escolher: o resumo",level:"h2"},Quote:{quote:"Levei só a mala de bordo e não senti falta de nada.",attribution:"Ana, leitora"},List:{items:`<strong>Tecnologia Inverter:</strong> temperatura mais estável; <strong>Gaveta HortiNatura:</strong> frescor por duas vezes mais tempo;`,style:"unordered"},BlockImage:{url:"https://cdn.exemplo.com/2026/10/mochila.webp",alt:"Mochila escolar azul apoiada em uma cadeira de sala de aula",size:"full"},Video:{url:"https://www.youtube.com/watch?v=dQw4w9WgXcQ",caption:"Como medir a capacidade da mala"},Divider:{},Cta:{text:"Ver toda a linha Escolar",href:"/escolar"},Callout:{title:"VOCÊ SABIA?",body:"Pediatras recomendam que a mochila carregada não passe de 10% do peso da criança.",variant:"tip"},Code:{code:"const total = itens.length;",language:"ts"},Stat:{value:"30%",label:"menos desperdício",description:"Comparado ao modelo anterior da mesma linha."},StatGroup:{stats:'[{"value":"30%","label":"menos desperdício"},{"value":"2x","label":"mais frescor"}]'},CardGroup:{cards:'[{"title":"Pré-escola","body":"Pouco material, mochila pequena."},{"title":"Fundamental","body":"Cadernos e livros pesam; considere rodinhas."}]'},Checklist:{title:"Antes de comprar, confira",items:'["Capacidade em litros","Alças acolchoadas","Compartimento para notebook"]'},Steps:{title:"Como medir",steps:'[{"title":"Meça a altura","description":"Da base ao topo, sem as alças."},{"title":"Some a profundidade"}]'},Comparison:{left:'{"title":"Com rodinhas","items":["Poupa a coluna","Mais pesada vazia"]}',right:'{"title":"De costas","items":["Mais leve","Exige ajuste das alças"]}'},Table:{headers:'["Modelo","Capacidade","Preço"]',rows:'[["Bordo","38L","R$ 399"],["Média","68L","R$ 599"]]'}},hs=600;function ys(t,e){for(const{payload:n}of D(e,"posts"))for(const s of E(n.sections)){const o=h(s);if(!o||o.__resolveType!==t)continue;const{__resolveType:r,...i}=o;if(Object.keys(i).length!==0&&!(JSON.stringify(i).length>hs))return i}}function Mo(t,e,n,s){const o=os(e,s),r=bs(e,s),i=new Set(pt(t.value,r)),a=o.filter(g=>i.has(g.resolveType)),c=a.length>0?a:o,f=new Set,p=[];for(const g of c){if(f.has(g.name)||r[g.name]!==g.resolveType)continue;f.add(g.name);const d=ys(g.resolveType,n)??gs[g.name];p.push({name:g.name,title:g.title,description:g.description??"",schema:ms(ds(g.resolveType,e),d),example:d})}return p}function bs(t,e){const n={};for(const s of at(t,e)){const o=ie(s.resolveType);o in n||(n[o]=s.resolveType)}return n}function _s(t,e,n={}){const s=[];for(const o of t){const r=e[o.type];if(!r)continue;const i=Ss(o.props,o.productIds??[],n[o.type]);s.push({__resolveType:r,...i})}return s}const vs=["product","products"];function xs(t){const e=h(t);return e?vs.find(n=>n in e)??null:null}function Ss(t,e,n){const s=e.filter(Boolean),o=xs(n);if(s.length===0||!o)return t;const r=n[o];return{...t,[o]:Sn(r,s)}}const xe=80;function As(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,xe)}function $o(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+/,"").slice(0,xe)}function Pe(t,e){const n=xe-e.length-1;return`${t.slice(0,n).replace(/-+$/,"")}-${e}`}function yt(t,e,n){const s=As(t)||`${n}-${F(6)}`,o=new Set(e);if(!o.has(s))return s;for(let r=2;r<100;r++){const i=Pe(s,String(r));if(!o.has(i))return i}return Pe(s,F(4))}function ks(t,e){return yt(t,e,"post")}function Ko(t,e){return yt(t,e,"category")}function Fo({draft:t,resolveTypes:e,productShapes:n,categories:s,authors:o,planning:r,takenSlugs:i,now:a}){const c=new Set(t.categorySlugs),f=new Set(t.authorEmails),p={title:t.title,slug:ks(t.title,i),date:a.toISOString().slice(0,10),excerpt:t.excerpt,image:t.cover.url,alt:t.cover.alt,authors:o.filter(g=>f.has(g.email)),categories:s.filter(g=>c.has(g.slug)),seo:{title:t.seo.title,description:t.seo.description,image:t.cover.url},sections:_s(t.sections,e,n),planning:r??{}};return nt(p,"awaiting_review",a)}function Uo(t){const e=R.c(10),{icon:n,title:s,description:o}=t;let r;e[0]!==n?(r=n&&l.jsx(n,{size:24,className:"text-muted-foreground/60"}),e[0]=n,e[1]=r):r=e[1];let i;e[2]!==s?(i=l.jsx("div",{children:s}),e[2]=s,e[3]=i):i=e[3];let a;e[4]!==o?(a=o&&l.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:o}),e[4]=o,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==i||e[8]!==a?(c=l.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[r,i,a]}),e[6]=r,e[7]=i,e[8]=a,e[9]=c):c=e[9],c}const bt=4;function ae(t){const e=new Map;for(const n of t)n.slug&&!e.has(n.slug)&&e.set(n.slug,n);return e}function ce(t,e){const n=t.parentSlug;if(!t.slug||!n||n===t.slug)return;const s=e.get(n);return s===t?void 0:s}function Cs(t,e){const n=ae(e),s=[],o=new Set;let r=n.get(t);for(;r&&!o.has(r.slug??"")&&(o.add(r.slug??""),s.push(r),!(s.length>=bt));)r=ce(r,n);return s.reverse()}function _t(t,e){const n=new Map;for(const s of t){const o=ce(s,e);if(!o?.slug)continue;const r=n.get(o);r?r.push(s):n.set(o,[s])}for(const s of n.values())s.sort((o,r)=>o.label.localeCompare(r.label));return n}function Go(t,e){const n=ae(e),s=_t(e,n),o=new Set([t]),r=n.get(t);let i=r?[r]:[];for(;i.length;){const a=[];for(const c of i)for(const f of s.get(c)??[])f.slug&&!o.has(f.slug)&&(o.add(f.slug),a.push(f));i=a}return o.delete(t),o}function Vo(t,e){if(!t)return[];const n=ae(e),s=Cs(t,e),o=s[0];return!o||ce(o,n)?[t]:s.map(r=>r.slug??"")}function zo(t){const e=ae(t),n=_t(t,e),s=new Set,o=[],r=(a,c)=>{if(!s.has(a)&&(s.add(a),o.push({entry:a,depth:c}),!(c+1>=bt)))for(const f of n.get(a)??[])r(f,c+1)},i=t.filter(a=>!ce(a,e)).sort((a,c)=>a.label.localeCompare(c.label));for(const a of i)r(a,0);for(const a of t)r(a,0);return o}export{Ys as $,ro as A,Xs as B,qn as C,Dn as D,Uo as E,Po as F,so as G,vo as H,D as I,Js as J,Mo as K,ot as L,bs as M,Ln as N,Fo as O,Vs as P,eo as Q,ao as R,Is as S,oo as T,no as U,co as V,oe as W,Ge as X,Ls as Y,Hs as Z,B as _,Ze as a,ve as a0,Ye as a1,ks as a2,As as a3,Vo as a4,Hn as a5,ie as a6,Lo as a7,to as a8,re as a9,lt as aA,ut as aB,Ro as aC,bo as aD,Z as aE,xo as aF,Oo as aG,z as aH,ge as aI,ee as aJ,Do as aK,Bo as aL,Go as aM,bt as aN,Mn as aO,lo as aP,fo as aQ,Us as aR,G as aS,$e as aT,Ke as aU,be as aV,Ks as aW,$s as aX,tn as aY,Fs as aZ,Gs as a_,Qs as aa,$o as ab,zs as ac,Sn as ad,Un as ae,Vn as af,ho as ag,at as ah,Qe as ai,jo as aj,wo as ak,No as al,es as am,ns as an,fn as ao,dn as ap,pn as aq,mn as ar,gn as as,ko as at,Ao as au,Eo as av,To as aw,yo as ax,os as ay,So as az,et as b,Cs as c,io as d,go as e,po as f,mo as g,Xn as h,Ws as i,We as j,Bs as k,In as l,Zs as m,Ms as n,zo as o,Y as p,qs as q,uo as r,wn as s,_o as t,Ko as u,Io as v,Co as w,T as x,C as y,nt as z};