@vcp-dev/contracts 0.10.20 → 0.10.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/design-token-block.js +2 -2
- package/dist/index.js +5 -5
- package/dist/site-edit-source.d.ts +8 -1
- package/dist/site-edit-version.d.ts +1 -1
- package/dist/site-localization-fields.d.ts +17 -7
- package/dist/subsite-visible-text-export.d.ts +19 -0
- package/dist/type-weight.d.ts +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{z as t}from"zod";import{z as ae}from"zod";import{z as F}from"zod";import{z as nd}from"zod";var Q=nd.uuidv7(),yT=Q,xT=Q,ET=Q,RT=Q,IT=Q,TT=Q,kT=Q,k=Q,$t=Q,ja=Q,Te=Q,bs=Q,A=Q,La=Q,V=Q,Ma=Q,tt=Q,ai=Q,ct=Q,AT=Q,wT=Q,ri=Q,nt=Q,Ua=Q,PT=Q,vT=Q,CT=Q,En=Q,DT=Q,OT=Q,NT=Q;var Fa=Q,ys=F.enum(["external_site_edit","page_template_create"]),id=200,Lt=F.string().min(1).max(id),sd=4e3,Ga=F.enum(["succeeded","degraded","no_changes","failed"]),Rn=F.enum(["typecheck_unresolved","step_cap_reached","partial_apply_gave_up","patch_protected_dropped","preview_build_failed","preview_runtime_degraded","build_not_verified","external_blocked","cms_reconcile_failed","run_expired","sandbox_unavailable"]),od=["sandbox_unavailable"];function UT(e){return e!=null&&od.includes(e)}var ad=F.enum(["pending","delivered","failed"]),rd=F.enum(["running","succeeded","degraded","no_changes","failed"]),FT=F.object({site_id:k,external_run_id:Lt,external_thread_id:Lt,prompt:F.string().min(1).max(sd),thread_title:F.string().trim().min(1).max(200).optional()}).strict(),xs=F.enum(["added","modified","deleted"]),cd=F.enum(["landing_page","general_page","detail_page"]),md=F.enum(["header","footer","styles","layout"]),qa={block_id:F.string().min(1),type:F.string().min(1),change:xs},Wa={slug:F.string().min(1),title:F.string().min(1),page_type:cd,change:xs},ld=F.object({kind:md,change:xs}).strict(),Ka={site_wide:F.array(ld),unclassified_count:F.number().int().nonnegative()},pd=F.object(qa).strict(),dd=F.object({...Wa,sections:F.array(pd)}).strict(),ud=F.object({pages:F.array(dd),...Ka}).strict(),_d=F.object({...qa,label:F.string().min(1)}).strict(),gd=F.object({page_id:F.number().int().positive().nullable(),...Wa,sections:F.array(_d)}).strict(),Ba=F.object({pages:F.array(gd),...Ka}).strict(),GT={pages:[],site_wide:[],unclassified_count:0},qT=F.object({base_snapshot_id:A,target_snapshot_id:A}).strict(),WT=F.object({data:ud}).strict(),ci=F.object({id:Fa,execution_scene:ys.default("external_site_edit"),site_id:k,external_run_id:F.string().min(1).nullable(),external_thread_id:F.string().min(1).nullable(),status:rd,outcome:Ga.nullable(),degraded_reason:Rn.nullable(),vcp_run_id:V.nullable(),vcp_thread_id:tt.nullable(),base_snapshot_id:A,snapshot_id:A.nullable(),preview_url:F.string().url().nullable(),summary:F.string().nullable(),error_code:F.string().nullable(),build_verified:F.boolean().nullable(),callback_status:ad.nullable(),created_at:F.string().min(1),started_at:F.string().min(1).nullable(),finished_at:F.string().min(1).nullable(),changes:Ba.nullable().default(null)}).strict().superRefine((e,n)=>{e.execution_scene==="page_template_create"?((e.external_run_id===null!=(e.external_thread_id===null)||e.callback_status!==null)&&n.addIssue({code:"custom",message:"Page Template tasks require paired external identities and no callback"}),(!["running","succeeded","failed"].includes(e.status)||e.outcome!==null&&!["succeeded","failed"].includes(e.outcome)||e.degraded_reason!==null)&&n.addIssue({code:"custom",message:"Page Template tasks require strict whole-batch outcomes"}),e.changes!==null&&n.addIssue({code:"custom",message:"Page Template tasks never carry changes"})):(!e.external_run_id||!e.external_thread_id||!e.callback_status)&&n.addIssue({code:"custom",message:"External edit tasks require external identity and callback status"})}),KT=F.object({task:ci}).strict(),BT=F.object({task:ci}).strict(),zT=F.object({task_id:Fa,external_run_id:F.string().min(1),external_thread_id:F.string().min(1),site_id:k,vcp_run_id:V.nullable(),outcome:Ga,degraded_reason:Rn.nullable(),snapshot_id:A.nullable(),preview_url:F.string().url().nullable(),summary:F.string().nullable(),error_code:F.string().nullable(),build_verified:F.boolean().nullable(),retryable:F.boolean(),finished_at:F.string().min(1),changes:Ba.nullable().default(null)}).strict(),HT=F.object({received:F.literal(!0)}).strict();var $e=ae.string().min(1).max(191).refine(e=>{if(/[^\x20-\x7e\xa0-\xff]/.test(e)||e.startsWith(" ")||e.endsWith(" ")||new TextEncoder().encode(e).length>191)return!1;try{return new Headers({"x-template-id":e}).get("x-template-id")===e}catch{return!1}},{message:"template_id must round-trip through HTTP headers and fit a 255-byte base64url filename"}),In=ae.string().min(1).refine(e=>e.startsWith("/")&&!e.startsWith("//")&&!/[?#\\\x00-\x20\x7f]/.test(e)&&!e.startsWith("/.vcp")&&!e.split("/").some(n=>{try{let i=decodeURIComponent(n);return i==="."||i===".."||/[/\\\x00-\x1f\x7f]/.test(i)||i.startsWith(".vcp")}catch{return!0}}),{message:"page_path must start with / and must not contain ? or #"});function za(e){return/^\[\[\.\.\.[^\[\]]+\]\]$|^\[[^\[\]]+\]$/.test(e)}function mi(e){let n=/^(?:src\/)?app\/\.vcp\/page-templates\/(.+)\/page\.tsx$/.exec(e);if(!n)return!1;let i=n[1].split("/"),s=i.some(za),o=s?i[0]:i.pop(),a=s?i.slice(1):i;if(s&&a.length===0||!/^[A-Za-z0-9_-]{1,255}$/.test(o)||!In.safeParse(`/${a.join("/")}`).success||a.some(c=>c?c.includes("[")||c.includes("]")?!za(c):/[\[\]()%]/.test(c)||c.startsWith("_")||c.startsWith("@"):!0))return!1;try{let c=atob(o.replace(/-/g,"+").replace(/_/g,"/")),r=Uint8Array.from(c,S=>S.charCodeAt(0)),m=new TextDecoder("utf-8",{fatal:!0}).decode(r);return $e.safeParse(m).success&&btoa(String.fromCharCode(...new TextEncoder().encode(m))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")===o}catch{return!1}}var Ha=ae.object({page_path:In,template_id:$e,instruction:ae.string().min(1).refine(e=>e.trim().length>0)}).strict(),Va=3;function $a(e){return e.replace(/\/+$/,"")||"/"}var QT=ae.object({external_run_id:Lt,external_thread_id:Lt,items:ae.array(Ha).min(1).max(Va)}).strict().transform(e=>({external_run_id:e.external_run_id,external_thread_id:e.external_thread_id,items:e.items.map(n=>({...n,page_path:$a(n.page_path)}))})).superRefine((e,n)=>{let i=new Set;e.items.forEach((s,o)=>{let a=JSON.stringify([s.page_path,s.template_id]);i.has(a)&&n.addIssue({code:"custom",path:["items",o],message:"Duplicate normalized page_path/template_id identity"}),i.add(a)})}),Ya=ae.object({items:ae.array(Ha).min(1).max(Va)}).strict().refine(e=>e.items.every(n=>n.page_path===$a(n.page_path))&&new Set(e.items.map(n=>JSON.stringify([n.page_path,n.template_id]))).size===e.items.length,{message:"Batch Manifest must contain unique normalized identities"}),Xa=e=>[...new Set(e)],ZT=ae.object({page_path:In,template_id:$e,exit_template_ids:ae.array($e).default([]).transform(Xa)}).strict().refine(e=>!e.exit_template_ids.includes(e.template_id),{path:["exit_template_ids"],message:"exit_template_ids must not contain the promoted template"}),JT=ae.object({page_path:In,template_ids:ae.array($e).min(1).transform(Xa)}).strict(),Qa={ok:ae.literal(!0),site_id:k,page_path:In,route_id:ae.string().min(1),snapshot_id:A},hd=ci.safeExtend({execution_scene:ae.literal("page_template_create"),external_run_id:Lt,external_thread_id:Lt,callback_status:ae.null(),status:ae.enum(["running","succeeded","failed"]),outcome:ae.enum(["succeeded","failed"]).nullable(),degraded_reason:ae.null(),changes:ae.null().default(null)}),ek=ae.object({task:hd}).strict(),tk=ae.object({...Qa,promoted_template_id:$e,deleted_template_ids:ae.array($e),status:ae.literal("promoted")}).strict(),nk=ae.object({...Qa,deleted_template_ids:ae.array($e),status:ae.literal("cleaned")}).strict(),ik=ae.enum(["PAGE_TEMPLATE_REQUEST_INVALID","PAGE_TEMPLATE_PAGE_NOT_FOUND","PAGE_TEMPLATE_NOT_FOUND","PAGE_TEMPLATE_ALREADY_EXISTS","PAGE_TEMPLATE_ID_COLLISION","PAGE_TEMPLATE_MANAGED_SOURCE_INVALID","PAGE_TEMPLATE_SNAPSHOT_CONFLICT","PAGE_TEMPLATE_SOURCE_UNSUPPORTED","PAGE_TEMPLATE_GENERATION_FAILED","PAGE_TEMPLATE_PATCH_FAILED"]);import{z as li}from"zod";var Za=li.object({primary_products:li.string().trim().min(1).max(1e3).optional(),current_markets:li.string().trim().min(1).max(1e3).optional(),qualifications:li.string().trim().min(1).max(1e3).optional()}).strict();function ak(e){return Object.values(e).some(n=>typeof n=="string"&&n.trim().length>0)}import{z as mt}from"zod";var Ja={autoplay:mt.boolean().optional(),intervalMs:mt.number().int().min(5e3).max(15e3).optional(),loop:mt.boolean().optional()},pi=mt.discriminatedUnion("kind",[mt.object({kind:mt.literal("media-carousel"),presentation:mt.enum(["flat","angled"]).optional(),...Ja}).strict(),mt.object({kind:mt.literal("category-carousel"),...Ja}).strict()]);import{z as Tn}from"zod";var Sd=40,Mt=Tn.object({protocol:Tn.enum(["phone","form","download","route","external"]),ctaLabel:Tn.string().min(1).max(Sd),ctaTarget:Tn.string().min(1).max(200).optional(),requiresOwnerDetail:Tn.boolean().optional()});var Yt=["queued","preparing_source","building","artifact_ready","deploying","released","lock_failed","source_prepare_failed","build_failed","artifact_fetch_failed","artifact_validation_failed","deploy_failed","cleanup_failed"];function dk(e){let n=e.VCP_REDIS_URL??e.REDIS_URL;if(n){let i=new URL(n);return{url:n,host:i.hostname,port:i.port?Number(i.port):6379,password:i.password?decodeURIComponent(i.password):void 0}}return{host:e.VCP_REDIS_HOST??"127.0.0.1",port:fd(e.VCP_REDIS_PORT,56379)}}function fd(e,n){if(!e)return n;let i=Number(e);return Number.isInteger(i)&&i>0?i:n}import{z as se}from"zod";var bd=se.enum(["component","page","shared"]),yd=se.enum(["generation_failed","repair_exhausted","page_unusable","check_incomplete","design_missing","chrome_fallback","style_fallback","resume_exhausted","user_stopped","conflict"]),er=se.object({kind:bd,target_id:se.string().min(1),page_id:se.string().min(1).nullable(),reason:yd,repair_attempts:se.number().int().nonnegative(),message:se.string().min(1),filled:se.boolean().optional()}).strict(),xd=se.enum(["complete","partial","omitted","check_incomplete","pending"]),Ed=se.object({page_id:se.string().min(1),slug:se.string().min(1),title:se.string().min(1),parent_page_id:se.string().min(1).nullable(),result:xd,attempts:se.number().int().nonnegative(),omissions:se.array(er)}).strict(),kn=se.object({schema_version:se.literal(1),sitemap_id:se.string().min(1),confirmed_page_ids:se.array(se.string().min(1)).min(1),pages:se.array(Ed),shared:se.array(er),stopped_by_user:se.boolean(),resume_count:se.number().int().nonnegative(),home_replaced_by:se.string().min(1).nullable(),updated_at:se.string().min(1)}).strict(),tr=se.object({type:se.literal("workspace.generation_ledger"),ledger:kn,at:se.string().min(1)}).strict();function gk(e){return e.pages.filter(n=>n.result==="complete"||n.result==="partial").length}function hk(e){return e.pages.filter(n=>n.result==="complete"||n.result==="partial"||n.omissions.some(i=>i.kind==="page")).length}import{z as U}from"zod";var Es=U.enum(["text","url","document","image"]),Rs=U.enum(["pending","ready","failed"]),Rd=U.enum(["pending","ready","failed"]),Id=U.enum(["product","price","contact","copy","audience","other"]),di=U.object({fact:U.string().min(1).max(300),kind:Id,source_id:En,quote:U.string().min(1).max(500),trust:U.enum(["verbatim","ocr"]).default("verbatim")}),Td=U.object({page_type:U.string().min(1).max(40),sections:U.array(U.string().min(1).max(40)).max(12)}),ui=U.object({source_id:En,nav_structure:U.array(U.string().min(1).max(30)).max(12),page_patterns:U.array(Td).max(10),tone:U.array(U.string().min(1).max(20)).max(8),screenshot_ref:U.string().optional()}),kd=U.object({source_id:En,type:Es,status:Rs,title:U.string().max(120).optional(),original_ref:U.string().min(1),source_metadata:U.record(U.string(),U.unknown()),error_code:U.string().optional(),submitted:U.boolean().optional()}),_i=U.object({topic:U.string().min(1).max(80),variants:U.array(U.object({value:U.string().min(1).max(300),source_id:En})).min(2)}),Ad=U.object({type:U.literal("text"),content:U.string().min(20).max(1e4),title:U.string().min(1).max(120).optional()}).strict(),wd=U.object({type:U.literal("url"),url:U.string().url().max(2048),rights_ack:U.boolean().optional(),title:U.string().min(1).max(120).optional()}).strict(),yk=U.discriminatedUnion("type",[Ad,wd]),xk=[".docx",".html",".md",".txt"],Ek=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/html","text/markdown","text/x-markdown","text/plain","application/octet-stream"],Rk=10*1024*1024,Ik=2,Tk=U.object({consent_cross_border:U.union([U.literal(!0),U.literal("true")]),consent_text_version:U.string().min(1).max(120),title:U.string().min(1).max(120).optional()}).strict();function kk(e){return e===!0||e==="true"}var Ak=[".png",".jpg",".jpeg",".webp"],wk=["image/png","image/jpeg","image/webp","application/octet-stream"],Pk=8*1024*1024,vk=10,Pd=U.enum(["asset","reference"]),Ck=U.object({image_role:Pd,title:U.string().min(1).max(120).optional()}).strict(),Dk=U.object({version:U.literal(1),site_id:k,tenant_id:U.string().min(1),user_prompt:U.string(),status:Rd,sources:U.array(kd).max(16),facts:U.array(di).max(120),reference:ui.optional(),conflicts:U.array(_i).max(20)}).superRefine((e,n)=>{let i=new Map(e.sources.map(s=>[s.source_id,s]));for(let[s,o]of e.facts.entries()){let a=i.get(o.source_id);(!a||a.type==="url")&&n.addIssue({code:"custom",path:["facts",s,"source_id"],message:"facts must reference a text/document/image source (never url)"})}if(e.reference){let s=i.get(e.reference.source_id),o=s?.type==="image"&&s.source_metadata.image_role==="reference";(!s||s.type!=="url"&&!o)&&n.addIssue({code:"custom",path:["reference","source_id"],message:"reference must point at a url source or reference image source"})}});function Ok(e){for(let n of e.sources)if(n.type==="image"&&n.status==="ready"&&n.source_metadata?.image_role==="reference")return{source_id:n.source_id};return e.reference?.screenshot_ref?{source_id:e.reference.source_id}:null}import{z as j}from"zod";import{z as gi}from"zod";var ue=gi.object({routeId:gi.string().min(1),templateId:$e.optional()}).strict(),B=gi.object({routeId:gi.string().min(1),effectiveTemplateId:$e.optional()}).strict();function Is(e){return JSON.stringify([e.routeId,e.effectiveTemplateId??null])}function Mk(e){let n;try{n=JSON.parse(e)}catch{return null}if(!Array.isArray(n)||n.length!==2)return null;let[i,s]=n,o=B.safeParse(s===null?{routeId:i}:{routeId:i,effectiveTemplateId:s});return o.success?o.data:null}var vd=["design.md","DESIGN.md"],nr=["components/site","src/components/site","lib/generated","src/lib/generated","public"],Cd=["app/globals.css","src/app/globals.css"],Dd=[".cjs",".css",".cts",".html",".js",".json",".jsx",".md",".mdx",".mjs",".mts",".ts",".tsx",".txt",".yaml",".yml"],Od=new Set(Dd),Ts="source-delete",ir=j.literal(Ts),xe=j.string().min(1).refine(or,"Invalid site edit source path"),Nd=j.string().min(1).refine(Wd,"Invalid site edit source directory path"),Wk=j.enum(["text","binary"]),hi=j.object({composition:B,path:xe,language:j.string().min(1).nullable(),sizeBytes:j.number().int().nonnegative(),contentHash:j.string().min(1).optional()}).strict(),jd=j.discriminatedUnion("kind",[hi.extend({kind:j.literal("text"),language:j.string().min(1),readonly:j.boolean().default(!1)}),hi.extend({kind:j.literal("binary"),language:j.null(),mimeType:j.string().min(1).optional(),readonly:j.literal(!0)})]),sr=j.lazy(()=>j.discriminatedUnion("kind",[j.object({kind:j.literal("directory"),name:j.string().min(1),path:Nd,children:j.array(sr)}),j.object({kind:j.literal("file"),name:j.string().min(1),path:xe,file:jd}).superRefine((e,n)=>{e.path!==e.file.path&&n.addIssue({code:"custom",path:["file","path"],message:"file.path must match node path"})})])),Ld=j.enum(["max-files","max-depth","max-total-bytes"]),Md=j.object({reasons:j.array(Ld).min(1),maxFiles:j.number().int().positive(),maxDepth:j.number().int().positive(),maxTotalBytes:j.number().int().positive()}),Kk=j.object({composition:B,nodes:j.array(sr),defaultPath:xe.optional(),totalFiles:j.number().int().nonnegative(),truncated:Md.optional()}).strict(),Bk=j.object({composition:ue}).strict(),zk=j.object({path:xe,composition:ue}).strict(),Ud=hi.extend({kind:j.literal("text"),language:j.string().min(1),readonly:j.boolean().default(!1),content:j.string()}),Fd=j.enum(["too-large","unsupported-mime","bytes-unavailable"]),Gd=hi.extend({kind:j.literal("binary"),language:j.null(),readonly:j.literal(!0),mimeType:j.string().min(1),contentBase64:j.string().min(1).optional(),previewUnavailableReason:Fd.optional()}),Hk=j.discriminatedUnion("kind",[Ud,Gd]),Vk=j.object({key:j.string().min(1),composition:ue}).strict(),qd=j.object({startLine:j.number().int().positive(),startColumn:j.number().int().nonnegative(),endLine:j.number().int().positive(),endColumn:j.number().int().nonnegative()}),$k=j.object({key:j.string().min(1),composition:B,sourceFile:xe,componentName:j.string().min(1),openingElementRange:qd,structuralPath:j.string().min(1),textPreview:j.string().min(1).optional()}).strict();function or(e){return!Si(e)&&!Bd(e)||cr(e)?!1:ws(e)||rr(e)||ar(e)||nr.some(n=>e===n||e.startsWith(`${n}/`))}function ks(e){return ws(e)||Od.has(Hd(e))}function Wd(e){return!Si(e)&&!zd(e)||cr(e)?!1:e==="app"||e.startsWith("app/")||e==="src"||e==="src/app"||e.startsWith("src/app/")||nr.some(n=>e===n||e.startsWith(`${n}/`)||n.startsWith(`${e}/`))}function Kd(e){return ws(e)}function As(e){return or(e)?Kd(e)?"design-document":ar(e)?"route-entry":rr(e)?"app-global-style":e.toLowerCase()==="lib/generated/media-assets.ts"||e.toLowerCase()==="src/lib/generated/media-assets.ts"?"generated-media-manifest":null:null}function Yk(e){return As(e)!==null}function ar(e){return/^(?:src\/)?app\/(?:.*\/)?page\.[cm]?[jt]sx?$/.test(e.toLowerCase())}function Bd(e){return mi(e)&&Si(e.replace("/.vcp/","/_vcp/"))}function zd(e){return/^(?:src\/)?app\/\.vcp(?:\/page-templates(?:\/.+)?)?$/i.test(e)?Si(e.replace("/.vcp","/_vcp")):!1}function rr(e){return Cd.some(n=>n.toLowerCase()===e.toLowerCase())}function Hd(e){let n=e.split("/").at(-1)??e,i=n.lastIndexOf(".");return i>0?n.slice(i).toLowerCase():""}function ws(e){return!e.includes("/")&&vd.some(n=>n.toLowerCase()===e.toLowerCase())}function cr(e){let n=e.toLowerCase(),i=n.split("/"),o=(i.at(-1)??n).replace(/\.[^.]+$/,"");return/^(?:src\/)?app\/api(?:\/|$)/.test(n)||/^(?:src\/)?app\/(?:.*\/)?route\.[cm]?[jt]sx?$/.test(n)||/^(?:src\/)?app\/(?:.*\/)?(?:action|actions)\.[cm]?[jt]sx?$/.test(n)||/(^|\/)[^/]+\.server\.[cm]?[jt]sx?$/.test(n)||n==="lib/server"||n.startsWith("lib/server")||n==="src/lib/server"||n.startsWith("src/lib/server")||n==="lib/db"||n.startsWith("lib/db")||n==="src/lib/db"||n.startsWith("src/lib/db")||n==="lib/cms"||n.startsWith("lib/cms/")||n==="src/lib/cms"||n.startsWith("src/lib/cms/")?!0:o==="server"||o==="db"||o==="database"||o==="auth"||o==="secret"||o==="secrets"||o==="token"||o==="tokens"||o==="credential"||o==="credentials"||i.includes("server")||i.includes("secrets")}function Si(e){return!e||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>!(n.length===0||n==="."||n===".."||n.startsWith(".")||n==="package.json"||n==="node_modules"||n==="recipes"||n.startsWith(".env")))}import{z as Vd}from"zod";var An=["zh-CN","zh-HK","zh-TW","en-US","en-GB","ja-JP","ko-KR","es-ES","fr-FR","de-DE","pt-PT","ru-RU","ar-SA","id-ID","vi-VN","th-TH","it-IT","nl-NL","tr-TR","pl-PL","uk-UA","cs-CZ","sk-SK","hu-HU","ro-RO","el-GR","sv-SE","da-DK","fi-FI","hr-HR","lt-LT","lv-LV","et-EE","ga-IE","mt-MT","ka-GE","fa-IR","bn-BD","ta-IN","si-LK","ms-MY","fil-PH","my-MM","km-KH","lo-LA","mn-MN","kk-KZ"],$d=["en","ja","es","fr","de","ko","pt","pt-BR","it","ru","ar","hi","id","vi","th","tr","nl","pl","uk","sv","da","fi","no","cs","el","hu","ro","he","ms","fil","bn","ta","ca","sk","hr","bg","lt","lv","et","fa","sw","sr","is"],Yd=[...An,...$d],Xd=new Set(["ar","fa","he"]),Zk=[{code:"zh-CN",label:"\u7B80\u4F53\u4E2D\u6587",englishName:"Chinese (Simplified)"},{code:"zh-HK",label:"\u7E41\u9AD4\u4E2D\u6587\uFF08\u9999\u6E2F\uFF09",englishName:"Chinese (Traditional, Hong Kong)"},{code:"zh-TW",label:"\u7E41\u9AD4\u4E2D\u6587\uFF08\u53F0\u7063\uFF09",englishName:"Chinese (Traditional, Taiwan)"},{code:"en-US",label:"English (US)",englishName:"English (United States)",common:!0},{code:"en-GB",label:"English (UK)",englishName:"English (United Kingdom)",common:!0},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",englishName:"Japanese"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",englishName:"Korean"},{code:"es-ES",label:"Espa\xF1ol",englishName:"Spanish"},{code:"fr-FR",label:"Fran\xE7ais",englishName:"French"},{code:"de-DE",label:"Deutsch",englishName:"German"},{code:"pt-PT",label:"Portugu\xEAs",englishName:"Portuguese"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",englishName:"Russian"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",englishName:"Arabic"},{code:"id-ID",label:"Bahasa Indonesia",englishName:"Indonesian"},{code:"vi-VN",label:"Ti\u1EBFng Vi\u1EC7t",englishName:"Vietnamese"},{code:"th-TH",label:"\u0E44\u0E17\u0E22",englishName:"Thai"},{code:"it-IT",label:"Italiano",englishName:"Italian"},{code:"nl-NL",label:"Nederlands",englishName:"Dutch"},{code:"tr-TR",label:"T\xFCrk\xE7e",englishName:"Turkish"},{code:"pl-PL",label:"Polski",englishName:"Polish"},{code:"uk-UA",label:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",englishName:"Ukrainian"},{code:"cs-CZ",label:"\u010Ce\u0161tina",englishName:"Czech"},{code:"sk-SK",label:"Sloven\u010Dina",englishName:"Slovak"},{code:"hu-HU",label:"Magyar",englishName:"Hungarian"},{code:"ro-RO",label:"Rom\xE2n\u0103",englishName:"Romanian"},{code:"el-GR",label:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",englishName:"Greek"},{code:"sv-SE",label:"Svenska",englishName:"Swedish"},{code:"da-DK",label:"Dansk",englishName:"Danish"},{code:"fi-FI",label:"Suomi",englishName:"Finnish"},{code:"hr-HR",label:"Hrvatski",englishName:"Croatian"},{code:"lt-LT",label:"Lietuvi\u0173",englishName:"Lithuanian"},{code:"lv-LV",label:"Latvie\u0161u",englishName:"Latvian"},{code:"et-EE",label:"Eesti",englishName:"Estonian"},{code:"ga-IE",label:"Gaeilge",englishName:"Irish"},{code:"mt-MT",label:"Malti",englishName:"Maltese"},{code:"ka-GE",label:"\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8",englishName:"Georgian"},{code:"fa-IR",label:"\u0641\u0627\u0631\u0633\u06CC",englishName:"Persian"},{code:"bn-BD",label:"\u09AC\u09BE\u0982\u09B2\u09BE",englishName:"Bengali"},{code:"ta-IN",label:"\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD",englishName:"Tamil"},{code:"si-LK",label:"\u0DC3\u0DD2\u0D82\u0DC4\u0DBD",englishName:"Sinhala"},{code:"ms-MY",label:"Bahasa Melayu",englishName:"Malay"},{code:"fil-PH",label:"Filipino",englishName:"Filipino"},{code:"my-MM",label:"\u1019\u103C\u1014\u103A\u1019\u102C",englishName:"Burmese"},{code:"km-KH",label:"\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A",englishName:"Khmer"},{code:"lo-LA",label:"\u0EA5\u0EB2\u0EA7",englishName:"Lao"},{code:"mn-MN",label:"\u041C\u043E\u043D\u0433\u043E\u043B",englishName:"Mongolian"},{code:"kk-KZ",label:"\u049A\u0430\u0437\u0430\u049B",englishName:"Kazakh"}],Qd={en:"en-US",ja:"ja-JP",es:"es-ES",fr:"fr-FR",de:"de-DE",ko:"ko-KR",pt:"pt-PT",it:"it-IT",ru:"ru-RU",ar:"ar-SA",id:"id-ID",vi:"vi-VN",th:"th-TH",tr:"tr-TR",nl:"nl-NL",pl:"pl-PL",uk:"uk-UA",sv:"sv-SE",da:"da-DK",fi:"fi-FI",cs:"cs-CZ",el:"el-GR",hu:"hu-HU",ro:"ro-RO",ms:"ms-MY",fil:"fil-PH",bn:"bn-BD",ta:"ta-IN",sk:"sk-SK",hr:"hr-HR",lt:"lt-LT",lv:"lv-LV",et:"et-EE",fa:"fa-IR"},Zd=new Set(An);function mr(e){return Zd.has(e)?e:Qd[e]}var Jd="en";function Jk(e){let n=e.toLowerCase().split("-",1)[0]??"";return Xd.has(n)?"rtl":"ltr"}var eu={cmn:"zh-CN",eng:"en",jpn:"ja",spa:"es",fra:"fr",deu:"de",kor:"ko",por:"pt",ita:"it",rus:"ru",arb:"ar",ara:"ar",hin:"hi",ind:"id",vie:"vi",tha:"th",tur:"tr",nld:"nl",pol:"pl",ukr:"uk",swe:"sv",dan:"da",fin:"fi",nob:"no",nor:"no",ces:"cs",ell:"el",hun:"hu",ron:"ro",heb:"he",msa:"ms",zsm:"ms",tgl:"fil",ben:"bn",tam:"ta",cat:"ca",slk:"sk",hrv:"hr",bul:"bg",lit:"lt",lav:"lv",est:"et",pes:"fa",fas:"fa",swh:"sw",swa:"sw",srp:"sr",isl:"is"};function e0(e){return eu[e]??Jd}var tu=["zh-CN","zh-HK","zh-TW","ja-JP","ja","ko-KR","ko","ru-RU","ru","uk-UA","uk","bg","sr","mn-MN","kk-KZ","ar-SA","ar","fa-IR","fa","he","hi","th-TH","th","el-GR","el","ka-GE","bn-BD","bn","ta-IN","ta","si-LK","my-MM","km-KH","lo-LA"],nu=new Set(tu);function t0(e){return nu.has(e)}var Ee=Vd.enum(Yd);import{z as iu}from"zod";var lr=iu.string().uuid();import{z as f}from"zod";import{z as J}from"zod";var Et=J.string().trim().min(1).max(128),Xt=J.string().trim().min(1).max(500),su=["\u4EA7\u54C1","\u90E8\u4EF6/\u8017\u6750","\u5E94\u7528\u65B9\u6848","\u5B9A\u5236/OEM","\u670D\u52A1","\u8D44\u8D28/\u80FD\u529B"],ou=J.enum(su),wn=J.object({id:Et,keyword:J.string().trim().min(1).max(255),business_id:Et,business_name:J.string().trim().min(1).max(255),category:ou,selling_points:J.string().trim().max(2e3),section_id:Et,content_usage:J.enum(["product","category","solution","service","capability","article","faq"]),intent:Xt,semantic_group:Et,primary_business:J.boolean(),monthly_volume:J.number().int().min(1),keyword_difficulty:J.number().min(0).max(100).nullable(),variants:J.array(J.string().trim().min(1).max(255)),source:J.literal("semrush"),source_evidence:J.array(Xt).min(1)}).strict(),Ps=J.object({schema_version:J.literal(1),snapshot_id:Et,dependency_hash:J.string().regex(/^[a-f0-9]{64}$/),language:J.string().trim().min(2).max(35),database:J.string().regex(/^[a-z]{2}$/),generated_at:J.string().datetime({offset:!0}),entries:J.array(wn),candidates:J.array(wn),search_result_ids:J.array(Et).optional()}).strict().superRefine((e,n)=>{for(let i of["entries","candidates"]){let s=e[i];(new Set(s.map(o=>o.id)).size!==s.length||new Set(s.map(o=>o.keyword.normalize("NFKC").trim().toLowerCase())).size!==s.length)&&n.addIssue({code:"custom",path:[i],message:"\u5173\u952E\u8BCD\u4E0D\u80FD\u91CD\u590D"})}}),fi=J.object({snapshot_id:Et,entry_ids:J.array(Et).min(1)}).strict().superRefine((e,n)=>{new Set(e.entry_ids).size!==e.entry_ids.length&&n.addIssue({code:"custom",path:["entry_ids"],message:"\u5173\u952E\u8BCD\u4E0D\u80FD\u91CD\u590D"})}),a0=J.object({expected_revision:J.number().int().nonnegative(),business_subject:J.string().trim().min(1).max(255)}).strict(),pr=J.object({points:J.array(Xt).length(3),comparison:J.array(J.object({dimension:Xt,recommended:Xt,alternative:Xt}).strict()).min(1).max(4)}).strict();var lt=f.string().trim().min(1).max(128),Ut=f.string().trim().min(1).max(200),Ye=f.string().trim().min(1).max(2e3),vs=f.string().trim().max(200),bi=f.string().regex(/^[a-f0-9]{64}$/),Cs=f.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),Qt=["market","persona","product","brand","competition","structure","language","keywords","risk"],De=Qt.length,au=["keywords"],Pn=Qt.filter(e=>!au.includes(e)),yi=Pn.length,xi=f.enum(Qt);function p0(e){return Pn.some(n=>n===e)}var Ei=xi,dr=["recommended","conservative","focused"],ur=f.enum(dr),vn=f.union([ur,f.literal("confirmed")]),Ri=f.enum(["single_country","regional_combination","multi_market"]),Ii=f.object({code:f.string().trim().regex(/^[A-Z]{2}$/),name_zh:Ut,name_en:Ut,region:Ut}).strict(),ru=f.object({id:ur,presentation:pr.nullish(),sections:f.array(f.object({id:f.string().trim().min(1).max(128),label:f.string().trim().min(1).max(200)}).strict()).max(30).optional(),label:Ut,note:Ye,impact:f.string().trim().max(500).nullish(),set_value:f.string().trim().max(500).nullish(),site_locale:Ee.nullish(),market_type:Ri.nullish(),markets:f.array(Ii).max(32).optional()}).loose(),cu=f.object({lead:f.string().trim().min(1).max(500),title:Ut,columns:f.array(f.string().trim().min(1).max(80)).min(1).max(8),rows:f.array(f.array(f.string().trim().max(500)).min(1).max(8)).max(100)}).strict().superRefine((e,n)=>{e.rows.forEach((i,s)=>{i.length!==e.columns.length&&n.addIssue({code:"custom",path:["rows",s],message:"Each Step5 plan row must match the column count."})})}),mu=f.object({goal:Ye,issue:Ye,criteria:f.array(Ye).min(1).max(12),resources:f.array(Ye).min(1).max(12),risks:f.array(Ye).min(1).max(12),execution:f.object({standard:f.array(Ye).min(1).max(12),acceptance:f.array(Ye).min(1).max(12),downstream:f.array(Ye).min(1).max(12)}).strict()}).strict(),lu=f.object({source_type:f.enum(["step2","step3"]),source_id:lt,field_path:f.string().trim().max(300).nullish()}).strict(),pu=f.enum(["ok","degraded"]),Ds=f.object({key:Ei,position:f.number().int().min(1).max(De),category:Ut,title:Ut,summary:Ye,rationale:Ye,parameter:f.string().trim().max(500).nullish(),options:f.array(ru).max(3),keyword_library:Ps.nullish(),plan:cu.nullish(),structure_detail:mu.nullish(),note_tips:f.array(f.string().trim().min(1).max(200)).max(6),note_placeholder:f.string().trim().min(1).max(300),evidence_refs:f.array(lu).min(1).max(8),generation_status:pu.optional()}).loose().superRefine((e,n)=>{let i=Qt.indexOf(e.key)+1;i>0&&e.position!==i&&n.addIssue({code:"custom",path:["position"],message:`Step5 strategy ${e.key} uses an invalid position.`}),e.key!=="keywords"&&e.keyword_library&&n.addIssue({code:"custom",path:["keyword_library"],message:"Only the keywords card can carry an enterprise keyword library."}),e.options.length!==(e.key==="keywords"?0:3)&&n.addIssue({code:"custom",path:["options"],message:"Keywords use no options; ordinary cards require three options."}),e.options.forEach((s,o)=>{s.id!==dr[o]&&n.addIssue({code:"custom",path:["options",o,"id"],message:"Step5 strategy options must use the canonical order."})}),e.structure_detail&&e.key!=="structure"&&n.addIssue({code:"custom",path:["structure_detail"],message:"Structure detail is only valid for the structure item."})}),du=f.object({item_key:xi,selected_option_id:vn,note:vs,keyword_selection:fi.optional()}).strict().superRefine((e,n)=>{(e.item_key==="keywords"?e.selected_option_id!=="confirmed"||e.note!==""||!e.keyword_selection:e.selected_option_id==="confirmed"||e.keyword_selection!==void 0)&&n.addIssue({code:"custom",message:"\u666E\u901A\u5361\u4EC5\u63A5\u53D7\u65B9\u6848\u4E0E\u5907\u6CE8\uFF1B\u4F01\u4E1A\u5173\u952E\u8BCD\u5E93\u4EC5\u63A5\u53D7\u5DF2\u751F\u6210\u5FEB\u7167\u4E2D\u7684\u5173\u952E\u8BCD ID"})}),Os=f.object({item_key:xi,selected_option_id:vn,note:vs,keyword_selection:fi.optional(),keyword_library:Ps.optional(),market_type:Ri.nullish(),markets:f.array(Ii).max(32).optional(),selected_value:f.unknown().nullable(),accepted_at:f.string().datetime({offset:!0})}).loose(),uu=f.enum(["running","succeeded","failed"]),_u=f.object({schema_version:f.literal(1),source_job_id:lt,site_id:lt,output_locale:Cs.optional(),items:f.array(Ds).length(De),decisions:f.array(Os).min(yi).max(De)}).loose(),gu=f.object({strategy_version_id:lt,site_id:lt,source_job_id:lt,output_locale:Cs.optional(),version:f.number().int().positive(),checksum:bi,snapshot:_u,committed_at:f.string().datetime({offset:!0})}).loose(),_r=f.object({job_id:lt,site_id:lt,output_locale:Cs.optional(),status:uu,keyword_library_needs_update:f.boolean().optional(),revision:f.number().int().nonnegative(),items:f.array(Ds).max(De),decisions:f.array(Os).max(De),output_checksum:bi.nullish(),error_code:f.string().trim().max(64).nullish(),error_message:f.string().trim().max(500).nullish(),committed_version:gu.nullish()}).loose().superRefine((e,n)=>{let i=e.items.map(o=>o.key);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["items"],message:"Step5 job items must have unique keys."});let s=e.decisions.map(o=>o.item_key);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 job decisions must have unique item keys."})}),d0=f.object({force_refresh:f.boolean().optional().default(!1)}).strict(),u0=_r.extend({cached:f.boolean()}).strict(),_0=f.object({expected_revision:f.number().int().nonnegative()}).strict(),g0=f.object({expected_revision:f.number().int().nonnegative(),selected_option_id:vn,note:vs,keyword_selection:fi.optional()}).strict().superRefine((e,n)=>{(e.selected_option_id==="confirmed"?!e.keyword_selection||e.note!=="":e.keyword_selection)&&n.addIssue({code:"custom",message:"\u4F01\u4E1A\u5173\u952E\u8BCD\u53EA\u63A5\u53D7\u5DF2\u751F\u6210\u6761\u76EE\u7684 ID\uFF1B\u666E\u901A\u7B56\u7565\u53EA\u63A5\u53D7\u65B9\u6848\u548C\u5907\u6CE8"})}),h0=f.object({revision:f.number().int().positive(),decision:Os}).strict(),S0=f.object({idempotency_key:f.string().trim().min(8).max(128),expected_revision:f.number().int().nonnegative(),decisions:f.array(du).min(yi).max(De)}).strict().superRefine((e,n)=>{let i=e.decisions.map(s=>s.item_key);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 commit decisions must use unique strategy keys."}),Pn.forEach(s=>{i.includes(s)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 commit is missing ${s}.`})})}),f0=f.object({strategy_version_id:lt,version:f.number().int().positive(),checksum:bi,next_path:f.string().trim().min(1).max(500)}).strict(),hu=_r.extend({completed:f.number().int().min(0).max(De),total:f.literal(De)}).loose(),Su=["snapshot","strategy_item_start","strategy_item_done","strategy_items_invalidated","strategy_generation_done","failed"];function b0(e){return typeof e=="string"&&Su.includes(e)}var y0=f.discriminatedUnion("event",[f.object({id:f.number().int().nonnegative(),event:f.literal("snapshot"),data:hu}).strict(),f.object({id:f.number().int().positive(),event:f.literal("strategy_item_start"),data:f.object({key:xi,position:f.number().int().min(1).max(De)}).strict()}).strict(),f.object({id:f.number().int().positive(),event:f.literal("strategy_item_done"),data:f.object({item:Ds}).strict()}).strict(),f.object({id:f.number().int().positive(),event:f.literal("strategy_items_invalidated"),data:f.object({after_position:f.number().int().min(0).max(De)}).strict()}).strict(),f.object({id:f.number().int().positive(),event:f.literal("strategy_generation_done"),data:f.object({item_count:f.literal(De),schema_version:f.literal(1),checksum:bi}).strict()}).strict(),f.object({id:f.number().int().positive(),event:f.literal("failed"),data:f.object({code:f.string().trim().min(1).max(64),message:f.string().trim().min(1).max(500),retryable:f.boolean(),item_key:Ei.optional()}).loose()}).loose()]);import{z as fu}from"zod";var Xe=fu.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/);function R0(e,n){let i=Xe.safeParse(e),s=Xe.safeParse(n);if(!i.success||!s.success)return null;let o=gr(i.data),a=gr(s.data);for(let r=0;r<3;r+=1){let m=hr(o.release[r],a.release[r]);if(m!==0)return m}if(!o.prerelease&&!a.prerelease)return 0;if(!o.prerelease)return 1;if(!a.prerelease)return-1;let c=Math.max(o.prerelease.length,a.prerelease.length);for(let r=0;r<c;r+=1){let m=o.prerelease[r],S=a.prerelease[r];if(m===void 0)return-1;if(S===void 0)return 1;if(m===S)continue;let g=/^\d+$/u.test(m),w=/^\d+$/u.test(S);return g&&w?hr(BigInt(m),BigInt(S)):g?-1:w?1:bu(m,S)}return 0}function gr(e){let n=e.indexOf("+"),i=n===-1?e:e.slice(0,n),s=i.indexOf("-"),o=s===-1?i:i.slice(0,s),a=s===-1?void 0:i.slice(s+1),[c,r,m]=o.split(".");return{release:[BigInt(c),BigInt(r),BigInt(m)],...a?{prerelease:a.split(".")}:{}}}function hr(e,n){return e<n?-1:e>n?1:0}function bu(e,n){return e<n?-1:e>n?1:0}import{z as Z}from"zod";import{z as ve}from"zod";var Ns=64,yu=512*1024,js=4*1024*1024,xu=/^(?!\/)(?!.*\\)(?!.*(?:^|\/)\.\.(?:\/|$))(?!.*\/\/).+/;function Eu(e){return xu.test(e)}var Sr=ve.string().min(1).refine(Eu,{message:"Materialization pathTemplate must be a safe relative path."}),Ru=ve.object({pathTemplate:Sr,content:ve.string(),role:ve.string().min(1).optional()}).strict(),Iu=ve.union([ve.object({kind:ve.literal("default")}).strict(),ve.object({kind:ve.literal("named"),name:ve.string().min(1)}).strict()]),Tu=ve.object({pathTemplate:Sr,export:Iu}).strict(),ku=ve.array(ve.never()).optional(),Ft=ve.object({instanceBaseName:ve.string().min(1),files:ve.array(Ru).min(1).max(Ns),entry:Tu,dataRequirements:ku}).strict().superRefine((e,n)=>{let i=new Set,s=e.entry.pathTemplate,o=0;for(let[a,c]of e.files.entries()){i.has(c.pathTemplate)&&n.addIssue({code:"custom",path:["files",a,"pathTemplate"],message:`Duplicate materialization pathTemplate: ${c.pathTemplate}`}),i.add(c.pathTemplate);let r=new TextEncoder().encode(c.content).length;r>yu&&n.addIssue({code:"custom",path:["files",a,"content"],message:"Materialization file content exceeds the per-file byte limit."}),o+=r}i.has(s)||n.addIssue({code:"custom",path:["entry","pathTemplate"],message:"Materialization entry pathTemplate must match a file."}),o>js&&n.addIssue({code:"custom",path:["files"],message:"Materialization exceeds the total content byte limit."})});var fr="insertNewComponent",P0={categoryGroupMissing:"DESIGNER_COMPONENT_CATEGORY_GROUP_MISSING",unavailable:"DESIGNER_COMPONENT_LIBRARY_UNAVAILABLE",timeout:"DESIGNER_COMPONENT_LIBRARY_TIMEOUT",invalidResponse:"DESIGNER_COMPONENT_LIBRARY_INVALID_RESPONSE",incompatibleResource:"DESIGNER_COMPONENT_RESOURCE_INCOMPATIBLE"},Ls=Z.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),br=Z.lazy(()=>Z.object({id:Z.string().uuid(),key:Z.string().min(1),name:Z.string(),children:Z.array(br)}).strict()),yr=Z.object({category_group_key:Z.literal(fr),categories:Z.array(br)}).strict(),Au=Z.object({resource_id:Z.string().min(1),name:Z.string(),description:Z.string().nullable(),thumbnail_url:Z.string().nullable(),resolved_version:Ls,category_id:Z.string().uuid().nullable()}).strict(),xr=Z.object({category_group_key:Z.literal(fr),items:Z.array(Au),next_cursor:Z.string().min(1).nullable()}).strict(),v0=Z.object({resource_id:Z.string().min(1),resolved_version:Ls,anchor_block_id:Z.string().min(1),placement:Z.enum(["before","after"])}).strict(),C0=Z.object({status:Z.literal("mock_acknowledged")}).strict(),D0=Z.object({category_id:Z.string().uuid().optional(),include_descendants:Z.enum(["true","false"]).optional().transform(e=>e==="true"),limit:Z.coerce.number().int().min(1).max(100).optional().default(20),cursor:Z.string().min(1).optional()}).strict().superRefine((e,n)=>{e.include_descendants&&!e.category_id&&n.addIssue({code:"custom",message:"include_descendants requires category_id"})}),Gt=Ls,O0=Z.object({version:Gt}).strict(),Er=Z.object({resource_id:Z.string().min(1),resolved_version:Gt,revision_id:Z.string().uuid().optional(),digest_sha256:Z.string().regex(/^[a-f0-9]{64}$/),materialization:Ft}).strict();import{z as R}from"zod";import{z as h}from"zod";var kr="/",Ar=255,wu=5e3,Pu=64;function vu(e){if(!e.startsWith("/")||e.includes("//")||/[?#\\\s\u0000-\u001f\u007f]/u.test(e))return!1;try{let n=decodeURIComponent(e);return n.includes("//")||/[?#\\\s\u0000-\u001f\u007f]/u.test(n)||n.split("/").length!==e.split("/").length||/%25/iu.test(e)?!1:n.split("/").every(i=>![".",".."].includes(i))}catch{return!1}}var pt=h.string().min(1).max(Ar).refine(vu,"url_path must be a safe site-relative path"),Fs=h.string().max(Ar),Ti=h.preprocess(e=>e===0?!1:e===1?!0:e,h.boolean()),Cn=h.union([h.url(),pt]),Gs=h.enum(["landing_page","general_page","detail_page"]),qs=h.enum([...Gs.options,"list_page","category_page","tag_page","author_page","search_page","date_page"]);function M0(e){return e.vcp_managed&&e.url!==null&&Gs.safeParse(e.page_type).success&&pt.safeParse(e.url_path).success}function Rr(e){return e.includes("{")||e.includes("}")}function U0(e){if(!Rr(e.url_path))return Ir(e.url_path);if(e.url===null)return null;let n=/^[a-z][a-z0-9+.-]*:\/\//iu.test(e.url)?Cu(e.url):e.url;return n===null||Rr(n)?null:Ir(n)}function Ir(e){let n=pt.safeParse(e);return n.success?n.data:null}function Cu(e){try{return new URL(e).pathname}catch{return null}}var wr=h.lazy(()=>h.object({cms_page_id:h.number().int().positive(),title:h.string().trim().min(1).max(255),url_path:Fs,url:Cn.nullable(),page_type:qs,vcp_managed:Ti,children:h.array(wr)}).strict()),Du=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),collection_slug:h.string(),pages:h.array(wr)}).strict(),Tr=h.object({groups:h.array(Du)}).strict(),Pr=h.lazy(()=>h.object({id:h.number().int().positive(),title:h.string().trim().min(1).max(120),url_path:Fs,parent_id:h.number().int().nonnegative(),group_type:h.string().min(1),page_type:qs,plugin_id:h.number().int().nonnegative(),is_default:Ti,is_published:Ti,url:Cn.nullable(),vcp_managed:Ti,children:h.array(Pr)})),Ou=h.object({plugin_id:h.number().int().nonnegative(),slug:h.string(),group_name:h.string().trim().min(1).max(255),pages:h.array(Pr)}).passthrough(),Nu=h.array(Ou);function vr(e){return{cms_page_id:e.id,title:e.title,url_path:e.url_path,url:e.url,page_type:e.page_type,vcp_managed:e.vcp_managed,children:e.children.map(n=>vr(n))}}function F0(e){if(!ju(e))return null;let n=Tr.safeParse(e);if(n.success)return n.data;let i=Nu.safeParse(e);if(!i.success)return null;let s=Tr.safeParse({groups:i.data.map(o=>({group_id:String(o.plugin_id),title:o.group_name,collection_slug:o.slug,pages:o.pages.map(vr)}))});return s.success?s.data:null}function ju(e){let n=Array.isArray(e)?e:Ms(e)&&Array.isArray(e.groups)?e.groups:[],i=[];for(let o of n)if(!(!Ms(o)||!Array.isArray(o.pages)))for(let a of o.pages)i.push({node:a,depth:1});let s=0;for(;i.length>0;){let o=i.pop();if(s+=1,s>wu||o.depth>Pu)return!1;if(!(!Ms(o.node)||!Array.isArray(o.node.children)))for(let a of o.node.children)i.push({node:a,depth:o.depth+1})}return!0}function Ms(e){return typeof e=="object"&&e!==null}var Lu=h.enum(["invalid_url_path","missing_url","not_vcp_managed","unsupported_page_type","page_not_generated"]),Mu=h.enum(["home_page","invalid_url_path","not_selectable","not_vcp_managed","page_has_children","last_selectable_page","cms_unbound","unsupported_page_type"]),Cr=h.lazy(()=>h.object({cms_page_id:h.number().int().positive().nullable(),title:h.string().trim().min(1).max(255),url_path:Fs,preview_url_path:pt.nullable(),url:Cn.nullable(),page_type:qs,vcp_managed:h.boolean(),selectable:h.boolean(),disabled_reason:Lu.nullable(),can_delete:h.boolean(),delete_block_reason:Mu.nullable(),has_cms_children:h.boolean(),children:h.array(Cr)}).strict()),Dr=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),pages:h.array(Cr)}).strict(),G0=h.object({base_snapshot_id:A,expected_url_path:pt}).strict(),Uu=h.enum(["succeeded","failed"]),Fu=h.object({url_path:pt,phase:h.enum(["ensure","binding","delete"]),code:h.string().min(1),message:h.string().min(1)}).strict(),Ws=h.object({status:Uu,checked_count:h.number().int().nonnegative(),ensured_count:h.number().int().nonnegative(),deleted_count:h.number().int().nonnegative(),already_absent_count:h.number().int().nonnegative(),failed_pages:h.array(Fu),warnings:h.array(h.string().min(1))}).strict(),Gu=h.object({result_snapshot_id:A,deleted_files:h.array(h.string().min(1)),updated_files:h.array(h.string().min(1)),preserved_shared_files:h.array(h.string().min(1)),warnings:h.array(h.string().min(1)),next_url:Cn.nullable(),previous_url:Cn.nullable(),cms_reconcile_result:Ws}).strict(),q0=h.object({code:h.literal(0),message:h.string(),data:Gu}).strict(),W0=h.object({snapshot_id:A}).strict(),qu=h.object({snapshot_id:A,warnings:h.array(h.string().min(1)),cms_reconcile_result:Ws}).strict(),K0=h.object({code:h.literal(0),message:h.string(),data:qu}).strict(),B0=h.object({source_committed:h.boolean(),result_snapshot_id:A.optional(),cms_reconcile_result:Ws.optional()}).strict().superRefine((e,n)=>{e.source_committed&&!e.result_snapshot_id&&n.addIssue({code:"custom",path:["result_snapshot_id"],message:"committed source requires result_snapshot_id"})}),Wu=Gs,Ku=h.object({title:h.string().min(1).max(255).optional(),description:h.string().min(1).max(1e3).optional(),keywords:h.string().min(1).max(255).optional(),meta_tags_json:h.record(h.string(),h.unknown()).optional(),schema_json:h.union([h.record(h.string(),h.unknown()),h.array(h.unknown())]).optional(),breadcrumbs_json:h.array(h.unknown()).optional()}).strict(),Or=h.object({url_path:pt,title:h.string().trim().min(1).max(255),kind:Wu,route_file:h.string().min(1),collection_id:h.string().trim().min(1).optional(),seo:Ku.optional()}).strict().superRefine((e,n)=>{e.kind==="detail_page"&&e.seo&&n.addIssue({code:"custom",path:["seo"],message:"detail_page target cannot carry seo (owned by the collection binding flow)"}),e.kind==="detail_page"&&!e.collection_id&&n.addIssue({code:"custom",path:["collection_id"],message:"detail_page target requires collection_id"}),e.kind!=="detail_page"&&e.collection_id&&n.addIssue({code:"custom",path:["collection_id"],message:`${e.kind} target cannot have collection_id`}),e.kind==="landing_page"!=(e.url_path===kr)&&n.addIssue({code:"custom",path:["kind"],message:"The home target must be the only landing_page target."})}),Bu=h.object({complete:h.literal(!0),targets:h.array(Or)}).strict().superRefine((e,n)=>{e.targets.length<1&&n.addIssue({code:"too_small",minimum:1,inclusive:!0,origin:"array",path:["targets"],message:"A complete page target set must contain at least one page."}),e.targets.filter(s=>s.url_path===kr).length!==1&&n.addIssue({code:"custom",path:["targets"],message:"A complete page target set must contain exactly one home page."})}),z0=h.discriminatedUnion("complete",[Bu,h.object({complete:h.literal(!1),targets:h.array(Or),errors:h.array(h.string().min(1)).min(1)}).strict()]),Us=h.string().regex(/^sha256:[0-9a-f]{64}$/),H0=h.object({projection_hash:Us.nullable()}).strict(),V0=h.object({expected_projection_hash:Us.nullable(),projection_hash:Us}).strict(),$0=h.object({clean_snapshot_id:h.string().uuid().nullable()}).strict(),Y0=h.object({clean_snapshot_id:h.string().uuid()}).strict();var Nr="insertNewPage",tA={categoryGroupMissing:"DESIGNER_PAGE_CATEGORY_GROUP_MISSING",unavailable:"DESIGNER_PAGE_LIBRARY_UNAVAILABLE",timeout:"DESIGNER_PAGE_LIBRARY_TIMEOUT",invalidResponse:"DESIGNER_PAGE_LIBRARY_INVALID_RESPONSE",incompatibleResource:"DESIGNER_PAGE_RESOURCE_INCOMPATIBLE"},qt=R.enum(["page","pages"]),zu=R.object({resource_id:R.string().min(1),resource_type:qt,resolved_version:Gt,template_page_id:R.string().min(1)}).strict(),jr=R.lazy(()=>R.object({id:R.string().uuid(),key:R.string().min(1),name:R.string(),children:R.array(jr)}).strict()),Lr=R.object({category_group_key:R.literal(Nr),categories:R.array(jr)}).strict(),Hu=R.object({resource_id:R.string().min(1),resource_type:qt,name:R.string(),description:R.string().nullable(),thumbnail_url:R.string().nullable(),preview_images:R.array(R.object({url:R.string().min(1),page_id:R.string().min(1).nullable(),is_primary:R.boolean()}).strict()).optional(),resolved_version:Gt,category_id:R.string().uuid().nullable()}).strict(),Mr=R.object({category_group_key:R.literal(Nr),items:R.array(Hu),next_cursor:R.string().min(1).nullable()}).strict(),nA=R.object({category_id:R.string().uuid().optional(),include_descendants:R.enum(["true","false"]).optional().transform(e=>e==="true"),limit:R.coerce.number().int().min(1).max(100).optional().default(20),cursor:R.string().min(1).optional()}).strict().superRefine((e,n)=>{e.include_descendants&&!e.category_id&&n.addIssue({code:"custom",message:"include_descendants requires category_id"})}),Dn=Gt,ki=R.string().regex(/^\/[a-z0-9]+(?:-[a-z0-9]+)*$/),iA=R.string().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),Vu=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:ki}).strict(),$u=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),source:zu.optional(),blocks:R.array(R.discriminatedUnion("kind",[R.object({kind:R.literal("package-component"),instance_id:R.string().min(1),component_id:R.string().min(1),label:R.string().trim().min(1).max(120)}).strict(),R.object({kind:R.literal("component-resource"),instance_id:R.string().min(1),resource_id:R.string().min(1),resolved_version:Gt,label:R.string().trim().min(1).max(120)}).strict()])).optional(),route:R.object({input:R.string(),append_random_suffix:R.boolean().optional(),random_suffix_length:R.number().int().min(4).max(16).optional(),final:ki}).strict()}).strict(),Yu=R.object({resource_id:R.string().min(1),resource_type:qt,resolved_version:Dn,pages:R.array($u).min(1)}).strict().superRefine((e,n)=>{Rt(e.pages.map(i=>i.template_page_id),"pages",n),Rt(e.pages.map(i=>i.route.final),"routes",n);for(let[i,s]of e.pages.entries()){if(!s.blocks)continue;let o=new Set;for(let[a,c]of s.blocks.entries())o.has(c.instance_id)&&n.addIssue({code:"custom",path:["pages",i,"blocks",a,"instance_id"],message:`Duplicate block instance identifier within page: ${c.instance_id}`}),o.add(c.instance_id)}});function Ks(e,n){e.resource_type==="page"&&e.pages.length!==1&&n.addIssue({code:"custom",path:["pages"],message:"page resources must contain exactly one page"}),e.resource_type==="pages"&&e.pages.length<2&&n.addIssue({code:"custom",path:["pages"],message:"pages resources must contain at least two pages"})}function Rt(e,n,i){let s=new Set;for(let[o,a]of e.entries())s.has(a)&&i.addIssue({code:"custom",path:[n,o],message:`Duplicate ${n} identifier: ${a}`}),s.add(a)}var sA=R.object({resource_type:qt,version:Dn,pages:R.array(Vu).min(1)}).strict().superRefine((e,n)=>{Ks(e,n),Rt(e.pages.map(i=>i.template_page_id),"pages",n),Rt(e.pages.map(i=>i.final_route),"routes",n)}),Xu=R.object({instance_id:R.string().min(1),component_id:R.string().min(1)}).strict(),Qu=R.object({component_id:R.string().min(1),materialization:Ft}).strict(),Zu=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:ki,materialization:Ft,components:R.array(Xu)}).strict(),Bs=R.object({resource_id:R.string().min(1),resource_type:qt,resolved_version:Dn,revision_id:R.string().uuid().optional(),digest_sha256:R.string().regex(/^[a-f0-9]{64}$/),components:R.array(Qu),pages:R.array(Zu).min(1),project_dependencies:R.record(R.string(),R.never()).optional()}).strict().superRefine((e,n)=>{Ks(e,n);let i=e.components.map(o=>o.component_id),s=new Set(i);Rt(i,"components",n),Rt(e.pages.map(o=>o.template_page_id),"pages",n),Rt(e.pages.map(o=>o.final_route),"routes",n);for(let[o,a]of e.pages.entries()){let c=new Set;for(let[r,m]of a.components.entries())s.has(m.component_id)||n.addIssue({code:"custom",path:["pages",o,"components",r,"component_id"],message:`Unknown component reference: ${m.component_id}`}),c.has(m.instance_id)&&n.addIssue({code:"custom",path:["pages",o,"components",r,"instance_id"],message:`Duplicate component instance identifier within page: ${m.instance_id}`}),c.add(m.instance_id)}}),Ur=Bs,Fr=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:ki,route_file_path:R.string().regex(/^app\/[a-z0-9]+(?:-[a-z0-9]+)*\/page\.tsx$/)}).strict(),Ju=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),composition_supported:R.boolean(),blocks:R.array(R.object({instance_id:R.string().min(1),component_id:R.string().min(1),label:R.string().trim().min(1).max(120)}).strict())}).strict(),Gr=R.object({resource_id:R.string().min(1),resource_type:qt,resolved_version:Dn,pages:R.array(Ju).min(1)}).strict().superRefine((e,n)=>{Ks(e,n),Rt(e.pages.map(i=>i.template_page_id),"pages",n)}),oA=R.object({resource_type:qt,version:Dn}).strict(),aA=R.object({draft:Yu}).strict(),qr=R.object({groups:R.array(Dr)}).strict(),Wr=R.object({candidate:R.record(R.string(),R.unknown())}).strict();var Zt="[a-z0-9]+(?:-[a-z0-9]+)*",On=new RegExp(`^/(?:${Zt}(?:/${Zt})*)?$`),Kr=["/privacy","/cookie-policy","/system/not-found"],e_=Kr.map(e=>`app/${e.slice(1)}/page.tsx`);function t_(e){return e.replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function Br(e){return typeof e=="string"&&On.test(e)}function zr(e){if(typeof e!="string")return null;let n=e.trim();if(/[^\x00-\x7F]/.test(n))return null;let i=n.replace(/^\/+|\/+$/g,"");if(i==="")return"/";let s=i.split("/");if(s.some(r=>r==="."||r===".."))return null;let o=i.toLowerCase();if(o==="index"||o==="home")return"/";let a=s.map(t_).filter(r=>r.length>0);if(a.length===0)return null;let c=`/${a.join("/")}`;return Br(c)?c:null}function Hr(e){let n=zr(e);if(n===null)throw new Error("Page slug must be an ASCII route without traversal segments.");return n}function n_(e){let n=Hr(e);return n==="/"?"app/page.tsx":`app/${n.slice(1)}/page.tsx`}import{z as oe}from"zod";import{z as u}from"zod";import{z as Oe}from"zod";var i_=Oe.object({code:Oe.string().min(1),message:Oe.string().min(1),details:Oe.record(Oe.string(),Oe.unknown()).optional()}),pA=Oe.object({code:Oe.string().min(1),message:Oe.string().min(1)});function zs(e){return Oe.object({ok:Oe.literal(!0),composition:B,data:e}).strict()}function s_(e){let n={ok:Oe.literal(!1),composition:B,error:i_.extend({code:e.codeSchema})};return e.currentSchema&&(n.current=e.currentSchema.optional()),e.diagnosticsSchema&&(n.diagnostics=Oe.array(e.diagnosticsSchema).optional()),e.dataSchema&&(n.data=e.dataSchema.optional()),Oe.object(n).strict()}function Vr(e){return Oe.discriminatedUnion("ok",[zs(e.dataSchema),s_({codeSchema:e.codeSchema,currentSchema:e.currentSchema,diagnosticsSchema:e.diagnosticsSchema,dataSchema:e.failureDataSchema})])}import{z as ee}from"zod";var dt=ee.object({start:ee.number().int().nonnegative(),end:ee.number().int().nonnegative()}).superRefine((e,n)=>{e.end<e.start&&n.addIssue({code:"custom",path:["end"],message:"end must be greater than or equal to start"})}),o_=ee.object({code:ee.enum(["missing-class-name","unsupported-attribute-name","source-locator-warning","invalid-new-attr","version-conflict","write-failed"]),message:ee.string().min(1)}),$r=ee.object({path:ee.string().min(1),content:ee.string(),hash:ee.string().min(1).optional()}),hA=ee.object({composition:B,revision:ee.string().min(1),entryCss:$r,stylesheets:ee.array($r).default([])}).strict(),SA=ee.object({composition:ue}).strict(),fA=ee.object({key:ee.string().min(1),composition:ue}).strict(),Yr=ee.object({key:ee.string().min(1),composition:B,filePath:ee.string().min(1),componentName:ee.string().min(1),sourceKind:ee.enum(["missing","stringLiteral","expression"]),attrRaw:ee.string().min(1).nullable(),valueRaw:ee.string().min(1).nullable(),attrRange:dt.nullable(),openingElementRange:dt,version:ee.object({documentVersion:ee.number().int().nonnegative(),contentHash:ee.string().min(1)}),diagnostics:ee.array(o_),computedStyle:ee.record(ee.string(),ee.string()).optional()}).strict().superRefine((e,n)=>{if(e.sourceKind==="missing"){(e.attrRaw!==null||e.valueRaw!==null||e.attrRange!==null)&&n.addIssue({code:"custom",message:"missing className source must not include attr raw or range"});return}(e.attrRaw===null||e.valueRaw===null||e.attrRange===null)&&n.addIssue({code:"custom",message:"present className source must include attr raw and ranges"})}),bA=Yr,yA=zs(Yr),Hs=ee.object({source:ee.enum(["style-panel","class-source-editor"]),operation:ee.enum(["replace-static-classname","replace-expression","create-attribute","remove-attribute"])});import{z as it}from"zod";var a_=new Set(["children","key","ref","dangerouslysetinnerhtml"]),r_=new Set(["data-designer-hover-outline","data-designer-select-outline"]),c_=/^[A-Za-z_$][A-Za-z0-9_$:-]*$/u;function m_(e){return{code:"protected-attribute",message:`Property is protected from generic site editing: ${e}`}}function l_(){return{code:"invalid-attribute-name",message:"Property name must be a valid single JSX attribute name"}}function p_(e){let n=e.toLowerCase();return a_.has(n)||n.startsWith("data-vcp-")||r_.has(n)||/^on[a-z]/iu.test(e)}function Vs(e){if(!c_.test(e))return{owner:"blocked",name:e,diagnostic:l_()};if(p_(e))return{owner:"blocked",name:e,diagnostic:m_(e)};let n=e.toLowerCase();return n==="classname"||n==="class"?{owner:"class-name-source",name:e}:n==="style"?{owner:"style",name:e}:{owner:"generic",name:e}}import{z as ut}from"zod";var Wt=ut.lazy(()=>ut.union([ut.string(),ut.number().finite(),ut.boolean(),ut.null(),ut.array(Wt),ut.record(ut.string(),Wt)]));var Xr=it.string().min(1),d_=it.discriminatedUnion("operation",[it.object({operation:it.literal("set"),name:Xr,value:Wt}).strict(),it.object({operation:it.literal("remove"),name:Xr}).strict()]).superRefine((e,n)=>{let i=Vs(e.name);i.owner==="blocked"&&n.addIssue({code:"custom",path:["name"],message:i.diagnostic?.message??"Property is not available for site editing"})}),Qr=it.object({kind:it.literal("set-props"),scope:it.enum(["selection","template"]),changes:it.array(d_).min(1)}).strict().superRefine((e,n)=>{let i=new Map;for(let[s,o]of e.changes.entries()){let a=Vs(o.name),c=u_(a),r=i.get(c);r!==void 0?n.addIssue({code:"custom",path:["changes",s,"name"],message:`Duplicate property change; first declared at index ${r}`}):i.set(c,s)}});function u_(e){return e.owner==="class-name-source"||e.owner==="style"?`owner:${e.owner}`:`name:${e.name}`}import{z as __}from"zod";var Zr=__.enum(["src","alt","poster","href","width","height"]);import{z as Jt}from"zod";var Nn=Jt.object({editingSessionId:Jt.string().min(1),lockId:Jt.string().min(1),ownerId:Jt.string().min(1),leaseAssertion:Jt.string().min(1)}).strict(),DA="signed-designer-mutations-v1",OA=Jt.object({mutationContext:Nn}).strict();import{z as d}from"zod";import{z as jn}from"zod";var Ai="::",$s=jn.object({file:jn.string().min(1),component:jn.string().min(1),structuralPath:jn.string().min(1),key:jn.string().min(1)}).superRefine((e,n)=>{let i=g_(e.file,e.component,e.structuralPath);e.key!==i&&n.addIssue({code:"custom",path:["key"],message:"key must match file::component::structuralPath"})});function g_(e,n,i){return`${e}${Ai}${n}${Ai}${i}`}function LA(e){let[n,i,...s]=e.split(Ai);return!n||!i||s.length===0?null:{file:n,component:i,structuralPath:s.join(Ai)}}var wi=d.enum(["VERSION_STALE","RECOVERY_REQUIRED","MULTIPLE_PAGE_RETURNS","INDIRECT_RETURN_ONLY","PAGE_CONTAINER_AMBIGUOUS","NO_SAFE_PAGE_PLACEMENT","MEMBER_NOT_INDEPENDENT","UNSUPPORTED_ROUTE_STRUCTURE","RUNTIME_ANCHOR_UNRESOLVED","ROUTE_RETURN_NOT_FOUND"]),Ln=d.object({code:d.string().min(1),message:d.string().min(1)}).strict(),h_=d.union([d.object({kind:d.literal("virtual-route-root"),key:d.string().min(1)}).strict(),d.object({kind:d.literal("jsx-container"),key:d.string().min(1),sourceMemberKey:d.string().min(1),sourceFile:d.string().min(1),componentName:d.string().min(1).optional()}).strict(),d.object({kind:d.literal("starter-placeholder"),key:d.string().min(1),sourceFile:d.string().min(1).optional()}).strict()]),S_=d.object({key:d.string().min(1),kind:d.enum(["jsx-element","jsx-fragment","jsx-expression","null-return","starter-placeholder"]),containerKey:d.string().min(1),label:d.string().min(1),sourceFile:d.string().min(1).optional(),isAtomic:d.boolean()}).strict(),f_=d.object({key:d.string().min(1),sourceMemberKey:d.string().min(1),containerKey:d.string().min(1),label:d.string().min(1),isIndependent:d.boolean()}).strict(),b_=d.object({key:d.string().min(1),containerKey:d.string().min(1),businessMemberKeys:d.array(d.string().min(1)),isMultiMember:d.boolean()}).strict(),ec=d.object({kind:d.literal("page-composition"),placementKey:d.string().min(1),documentVersion:d.number().int().nonnegative(),composition:ue}).strict(),y_=d.object({kind:d.literal("page-composition"),placementKey:d.string().min(1),documentVersion:d.number().int().nonnegative(),composition:B,placementUnitKey:d.string().min(1),relation:d.enum(["before","after","prepend","append"])}).strict(),tc=d.object({kind:d.literal("page-composition"),placementKey:d.string().min(1),documentVersion:d.number().int().nonnegative(),composition:ue,placementUnitKey:d.string().min(1),relation:d.enum(["before","after","prepend","append"])}).strict(),nc=d.object({kind:d.literal("page-unit"),composition:ue,placementUnitKey:d.string().min(1)}).strict(),ic=d.object({kind:d.literal("page-unit"),composition:B,placementUnitKey:d.string().min(1)}).strict();function _t(e,n,i,s,o){let a=new Set;for(let[c,r]of e.entries()){let m=s(r);a.has(m)&&n.addIssue({code:"custom",path:[i,c,o],message:`Duplicate ${i} key: ${m}`}),a.add(m)}}var x_=d.object({status:d.literal("supported"),version:d.number().int().nonnegative(),composition:B,container:h_,sourceMembers:d.array(S_),businessMembers:d.array(f_),placementUnits:d.array(b_),placements:d.array(y_)}).strict().superRefine((e,n)=>{_t(e.sourceMembers,n,"sourceMembers",r=>r.key,"key"),_t(e.businessMembers,n,"businessMembers",r=>r.key,"key"),_t(e.placementUnits,n,"placementUnits",r=>r.key,"key"),_t(e.placements,n,"placements",r=>r.placementKey,"placementKey");let i=new Set(e.sourceMembers.map(r=>r.key)),s=new Set(e.placementUnits.map(r=>r.key)),o=new Map(e.sourceMembers.map(r=>[r.key,r])),a=new Map(e.businessMembers.map(r=>[r.key,r]));for(let[r,m]of e.sourceMembers.entries()){m.containerKey!==e.container.key&&!i.has(m.containerKey)&&n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member parent must reference the page container or another source member."}),m.containerKey===m.key&&n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member cannot contain itself."});let S=new Set([m.key]),g=m.containerKey;for(;g!==e.container.key;){if(S.has(g)){n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member hierarchy must be acyclic."});break}S.add(g);let w=o.get(g);if(!w)break;g=w.containerKey}}e.container.kind==="jsx-container"&&!i.has(e.container.sourceMemberKey)&&n.addIssue({code:"custom",path:["container","sourceMemberKey"],message:"Container sourceMemberKey must reference a source member."});for(let[r,m]of e.businessMembers.entries())i.has(m.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",r,"sourceMemberKey"],message:"Business member must reference a source member."}),s.has(m.containerKey)||n.addIssue({code:"custom",path:["businessMembers",r,"containerKey"],message:"Business member must reference a placement unit container."});for(let[r,m]of e.placementUnits.entries()){let S=o.get(m.containerKey);S?S.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",r,"containerKey"],message:"Placement unit must reference a direct child of the page container."}):n.addIssue({code:"custom",path:["placementUnits",r,"containerKey"],message:"Placement unit containerKey must reference a source member."});let g=new Set;for(let[w,K]of m.businessMemberKeys.entries()){let H=a.get(K);if(!H){n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Placement unit must reference existing business members."});continue}g.has(K)&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Placement unit cannot reference the same business member twice."}),g.add(K),H.containerKey!==m.key&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Business member containerKey must match its placement unit."});let ie=H.sourceMemberKey,he=new Set;for(;ie&&ie!==m.containerKey&&!he.has(ie);)he.add(ie),ie=o.get(ie)?.containerKey;ie!==m.containerKey&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Placement unit business members must belong to its source subtree."})}}for(let[r,m]of e.businessMembers.entries())e.placementUnits.find(g=>g.key===m.containerKey)?.businessMemberKeys.includes(m.key)||n.addIssue({code:"custom",path:["businessMembers",r,"containerKey"],message:"Business member must be listed by its placement unit container."});let c=new Map;for(let r of e.placementUnits)c.set(r.containerKey,(c.get(r.containerKey)??0)+1);for(let[r,m]of e.sourceMembers.entries())m.containerKey===e.container.key&&c.get(m.key)!==1&&n.addIssue({code:"custom",path:["sourceMembers",r,"key"],message:"Every direct source member must be owned by exactly one placement unit."});for(let[r,m]of e.placements.entries())ac(m.composition,e.composition)||n.addIssue({code:"custom",path:["placements",r,"composition"],message:"Page placement composition must match page composition."}),m.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",r,"documentVersion"],message:"Page placement version must match page composition version."}),s.has(m.placementUnitKey)||n.addIssue({code:"custom",path:["placements",r,"placementUnitKey"],message:"Placement option must reference an existing placement unit."})}),E_=d.object({status:d.literal("unsupported"),version:d.number().int().nonnegative(),composition:B,reason:wi,diagnostics:d.array(Ln)}).strict(),R_=d.discriminatedUnion("status",[x_,E_]),sc=2,qA="page-composition-v2",oc=d.object({start:d.number().int().nonnegative(),end:d.number().int().nonnegative(),startLine:d.number().int().positive().optional(),startColumn:d.number().int().nonnegative().optional(),endLine:d.number().int().positive().optional(),endColumn:d.number().int().nonnegative().optional()}).strict().superRefine((e,n)=>{e.end<e.start&&n.addIssue({code:"custom",path:["end"],message:"Source range end must be greater than or equal to start."});let i=[e.startLine,e.startColumn,e.endLine,e.endColumn],s=i.some(a=>a!==void 0),o=i.every(a=>a!==void 0);s&&!o&&n.addIssue({code:"custom",path:["startLine"],message:"Source line and column locations must be provided together."}),e.startLine!==void 0&&e.endLine!==void 0&&e.endLine<e.startLine&&n.addIssue({code:"custom",path:["endLine"],message:"Source range endLine must not precede startLine."}),e.startLine!==void 0&&e.endLine===e.startLine&&e.startColumn!==void 0&&e.endColumn!==void 0&&e.endColumn<e.startColumn&&n.addIssue({code:"custom",path:["endColumn"],message:"Source range endColumn must not precede startColumn."})}),I_=d.object({key:d.string().min(1),instanceIndex:d.number().int().nonnegative().optional(),instanceCount:d.number().int().positive().optional(),textSegmentIndex:d.number().int().nonnegative().optional()}).strict().superRefine((e,n)=>{e.instanceIndex!==void 0&&e.instanceCount!==void 0&&e.instanceIndex>=e.instanceCount&&n.addIssue({code:"custom",path:["instanceIndex"],message:"instanceIndex must be lower than instanceCount."})}),T_=d.enum(["component-call","native-jsx","dynamic-expression","indirect-expression","text","starter-placeholder"]),k_=d.enum(["none","dynamic-expression","indirect-expression","text","starter-placeholder"]),A_=d.discriminatedUnion("kind",[d.object({kind:d.literal("virtual-route-root"),key:d.null(),routeReturn:d.object({sourceIdentity:$s,sourceRange:oc}).strict()}).strict(),d.object({kind:d.literal("jsx-container"),key:d.string().min(1),sourceMemberKey:d.string().min(1)}).strict(),d.object({kind:d.literal("starter-placeholder"),key:d.string().min(1),sourceMemberKey:d.string().min(1),replacementMode:d.literal("replace")}).strict()]),w_=d.object({key:d.string().min(1),kind:T_,parentKey:d.string().min(1).nullable(),childKeys:d.array(d.string().min(1)),order:d.number().int().nonnegative(),label:d.string().min(1),sourceIdentity:$s,sourceRange:oc.nullable(),atomicKind:k_}).strict().superRefine((e,n)=>{let i=e.kind==="component-call"||e.kind==="native-jsx"?"none":e.kind;e.atomicKind!==i&&n.addIssue({code:"custom",path:["atomicKind"],message:`atomicKind must be ${i} for ${e.kind}.`});let s=new Set;for(let[o,a]of e.childKeys.entries())s.has(a)&&n.addIssue({code:"custom",path:["childKeys",o],message:`Duplicate child source member key: ${a}`}),s.add(a)}),P_=d.object({key:d.string().min(1),sourceMemberKey:d.string().min(1),placementUnitKey:d.string().min(1),label:d.string().min(1),isIndependent:d.boolean()}).strict(),v_=d.enum(["independent","atomic","container"]),C_=d.object({key:d.string().min(1),containerKey:d.string().min(1).nullable(),sourceMemberKeys:d.array(d.string().min(1)).min(1),businessMemberKeys:d.array(d.string().min(1)),order:d.number().int().nonnegative(),boundaryMode:v_,isIndependent:d.boolean(),isMultiMember:d.boolean()}).strict().superRefine((e,n)=>{Jr(e.sourceMemberKeys,n,"sourceMemberKeys","source member"),Jr(e.businessMemberKeys,n,"businessMemberKeys","business member");let i=e.sourceMemberKeys.length>1||e.businessMemberKeys.length>1;e.isMultiMember!==i&&n.addIssue({code:"custom",path:["isMultiMember"],message:"isMultiMember must reflect the source and business member cardinality."});let s=e.boundaryMode==="independent";e.isIndependent!==s&&n.addIssue({code:"custom",path:["isIndependent"],message:"isIndependent must match boundaryMode."})}),D_=d.enum(["before","after","prepend","append","replace"]),O_=d.enum(["insert-sibling","insert-child","replace-placeholder"]),N_=d.object({kind:d.literal("page-composition"),placementKey:d.string().min(1),documentVersion:d.number().int().nonnegative(),composition:B,placementUnitKey:d.string().min(1),containerKey:d.string().min(1).nullable(),relation:D_,writeMode:O_}).strict().superRefine((e,n)=>{let i=e.relation==="before"||e.relation==="after"?"insert-sibling":e.relation==="prepend"||e.relation==="append"?"insert-child":"replace-placeholder";e.writeMode!==i&&n.addIssue({code:"custom",path:["writeMode"],message:`writeMode must be ${i} for ${e.relation}.`})}),j_=d.object({key:d.string().min(1),placementUnitKey:d.string().min(1),runtimeRefs:d.array(I_).min(1)}).strict(),L_=d.object({schemaVersion:d.literal(sc),status:d.literal("supported"),version:d.number().int().nonnegative(),composition:B,container:A_,sourceMembers:d.array(w_),businessMembers:d.array(P_),placementUnits:d.array(C_),placements:d.array(N_),visualAnchors:d.array(j_).optional(),diagnostics:d.array(Ln)}).strict().superRefine((e,n)=>{F_(e,n)}),M_=d.object({schemaVersion:d.literal(sc),status:d.literal("unsupported"),version:d.number().int().nonnegative(),composition:B,reason:wi,diagnostics:d.array(Ln)}).strict(),U_=d.discriminatedUnion("status",[L_,M_]),WA=d.union([U_,R_]);function Jr(e,n,i,s){let o=new Set;for(let[a,c]of e.entries())o.has(c)&&n.addIssue({code:"custom",path:[i,a],message:`Duplicate ${s} key: ${c}`}),o.add(c)}function ac(e,n){return Is(e)===Is(n)}function F_(e,n){_t(e.sourceMembers,n,"sourceMembers",g=>g.key,"key"),_t(e.businessMembers,n,"businessMembers",g=>g.key,"key"),_t(e.placementUnits,n,"placementUnits",g=>g.key,"key"),_t(e.placements,n,"placements",g=>g.placementKey,"placementKey"),_t(e.visualAnchors??[],n,"visualAnchors",g=>g.key,"key"),G_(e,n);let i=new Map(e.sourceMembers.map(g=>[g.key,g])),s=new Map(e.businessMembers.map(g=>[g.key,g])),o=new Map(e.placementUnits.map(g=>[g.key,g]));q_(e,i,n),e.container.kind!=="virtual-route-root"&&(i.has(e.container.sourceMemberKey)||n.addIssue({code:"custom",path:["container","sourceMemberKey"],message:"Container sourceMemberKey must reference a source member."}));let a=new Map,c=new Map,r=new Set;for(let[g,w]of e.placementUnits.entries()){w.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",g,"containerKey"],message:"Placement unit containerKey must match the page container."});let K=`${w.containerKey??"<virtual>"}:${w.order}`;r.has(K)&&n.addIssue({code:"custom",path:["placementUnits",g,"order"],message:"Placement unit order must be unique within its container."}),r.add(K);for(let[H,ie]of w.sourceMemberKeys.entries()){i.has(ie)||n.addIssue({code:"custom",path:["placementUnits",g,"sourceMemberKeys",H],message:"Placement unit must reference existing source members."});let he=a.get(ie);he&&he!==w.key&&n.addIssue({code:"custom",path:["placementUnits",g,"sourceMemberKeys",H],message:`Source member is already assigned to ${he}.`}),a.set(ie,w.key)}for(let[H,ie]of w.businessMemberKeys.entries()){let he=s.get(ie);if(!he){n.addIssue({code:"custom",path:["placementUnits",g,"businessMemberKeys",H],message:"Placement unit must reference existing business members."});continue}he.placementUnitKey!==w.key&&n.addIssue({code:"custom",path:["placementUnits",g,"businessMemberKeys",H],message:"Placement unit and business member must reference each other."}),w.sourceMemberKeys.includes(he.sourceMemberKey)||n.addIssue({code:"custom",path:["placementUnits",g,"businessMemberKeys",H],message:"Business member sourceMemberKey must belong to the placement unit."});let xn=c.get(ie);xn&&xn!==w.key&&n.addIssue({code:"custom",path:["placementUnits",g,"businessMemberKeys",H],message:`Business member is already assigned to ${xn}.`}),c.set(ie,w.key)}}for(let[g,w]of e.businessMembers.entries()){i.has(w.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",g,"sourceMemberKey"],message:"Business member must reference a source member."});let K=o.get(w.placementUnitKey);if(!K){n.addIssue({code:"custom",path:["businessMembers",g,"placementUnitKey"],message:"Business member must reference a placement unit."});continue}K.businessMemberKeys.includes(w.key)||n.addIssue({code:"custom",path:["businessMembers",g,"placementUnitKey"],message:"Business member and placement unit must reference each other."}),K.sourceMemberKeys.includes(w.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",g,"sourceMemberKey"],message:"Business member sourceMemberKey must belong to its placement unit."});let H=K.isIndependent&&K.businessMemberKeys.length===1;w.isIndependent!==H&&n.addIssue({code:"custom",path:["businessMembers",g,"isIndependent"],message:"Business member independence must match its placement unit boundary."})}let m=new Set;for(let[g,w]of e.placements.entries()){w.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",g,"documentVersion"],message:"Page placement version must match page composition version."}),ac(w.composition,e.composition)||n.addIssue({code:"custom",path:["placements",g,"composition"],message:"Page placement composition must match page composition."});let K=o.get(w.placementUnitKey);K?w.containerKey!==K.containerKey&&n.addIssue({code:"custom",path:["placements",g,"containerKey"],message:"Placement containerKey must match its placement unit."}):n.addIssue({code:"custom",path:["placements",g,"placementUnitKey"],message:"Placement option must reference a placement unit."});let H=`${w.placementUnitKey}:${w.relation}`;m.has(H)&&n.addIssue({code:"custom",path:["placements",g,"relation"],message:"A placement unit cannot expose the same relation more than once."}),m.add(H),w.relation==="replace"&&e.container.kind!=="starter-placeholder"&&n.addIssue({code:"custom",path:["placements",g,"relation"],message:"replace is only valid for a starter placeholder container."}),e.container.kind==="starter-placeholder"&&w.relation!=="replace"&&n.addIssue({code:"custom",path:["placements",g,"relation"],message:"Starter placeholder placements must use replace."})}let S=new Set;for(let[g,w]of(e.visualAnchors??[]).entries())o.has(w.placementUnitKey)||n.addIssue({code:"custom",path:["visualAnchors",g,"placementUnitKey"],message:"Visual anchor must reference a placement unit."}),S.has(w.placementUnitKey)&&n.addIssue({code:"custom",path:["visualAnchors",g,"placementUnitKey"],message:"A placement unit may expose only one visual anchor."}),S.add(w.placementUnitKey)}function G_(e,n){let i=[];e.container.key!==null&&i.push({key:e.container.key,path:["container","key"],namespace:"container"});for(let[o,a]of e.sourceMembers.entries())i.push({key:a.key,path:["sourceMembers",o,"key"],namespace:"source member"});for(let[o,a]of e.businessMembers.entries())i.push({key:a.key,path:["businessMembers",o,"key"],namespace:"business member"});for(let[o,a]of e.placementUnits.entries())i.push({key:a.key,path:["placementUnits",o,"key"],namespace:"placement unit"});for(let[o,a]of(e.visualAnchors??[]).entries())i.push({key:a.key,path:["visualAnchors",o,"key"],namespace:"visual anchor"});let s=new Map;for(let o of i){let a=s.get(o.key);a?n.addIssue({code:"custom",path:o.path,message:`${o.namespace} key collides with ${a}: ${o.key}`}):s.set(o.key,o.namespace)}}function q_(e,n,i){let s=new Set;for(let[o,a]of e.sourceMembers.entries()){let c=`${a.parentKey??"<root>"}:${a.order}`;if(s.has(c)&&i.addIssue({code:"custom",path:["sourceMembers",o,"order"],message:"Source member order must be unique among siblings."}),s.add(c),a.parentKey===a.key&&i.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source member cannot be its own parent."}),a.parentKey!==null){let S=n.get(a.parentKey);S?S.childKeys.includes(a.key)||i.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source parent and child references must be bidirectional."}):i.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source member parentKey must reference a source member."})}for(let[S,g]of a.childKeys.entries()){if(g===a.key){i.addIssue({code:"custom",path:["sourceMembers",o,"childKeys",S],message:"Source member cannot be its own child."});continue}let w=n.get(g);w?w.parentKey!==a.key&&i.addIssue({code:"custom",path:["sourceMembers",o,"childKeys",S],message:"Source parent and child references must be bidirectional."}):i.addIssue({code:"custom",path:["sourceMembers",o,"childKeys",S],message:"Source child key must reference a source member."})}let r=new Set,m=a;for(;m;){if(r.has(m.key)){i.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source member graph must be acyclic."});break}r.add(m.key),m=m.parentKey===null?void 0:n.get(m.parentKey)}}}var Mn=u.enum(["update-text","update-array-item","remove-node","insert-child","replace-node","move-node","set-class-name-source","set-props","apply-style-draft","source-edit","insert-page-resource","delete-page-source"]),W_=u.discriminatedUnion("kind",[u.object({kind:u.literal("node"),key:u.string().min(1)}).strict(),nc,u.object({kind:u.literal("route"),composition:ue}).strict(),u.object({kind:u.literal("source-file"),path:xe}).strict(),u.object({kind:u.literal("source-batch"),paths:u.array(xe).min(1)}).superRefine((e,n)=>{let i=new Set;for(let[s,o]of e.paths.entries())i.has(o)&&n.addIssue({code:"custom",path:["paths",s],message:`Duplicate source target path: ${o}`}),i.add(o)}).strict(),u.object({kind:u.literal("project")}).strict()]),K_=u.discriminatedUnion("kind",[u.object({kind:u.literal("node"),key:u.string().min(1)}).strict(),ic,u.object({kind:u.literal("route"),composition:B}).strict(),u.object({kind:u.literal("source-file"),path:xe}).strict(),u.object({kind:u.literal("source-batch"),paths:u.array(xe).min(1)}).strict(),u.object({kind:u.literal("project")}).strict()]),cc=u.enum(["display","position","top","right","bottom","left","zIndex","flexDirection","flexWrap","flexGrow","flexShrink","flexBasis","order","gridTemplateColumns","gridTemplateRows","columns","gridColumn","gridRow","gap","gapX","gapY","spaceX","spaceY","alignItems","justifyContent","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","width","height","minWidth","minHeight","maxWidth","maxHeight","overflow","fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","textAlign","textTransform","textDecoration","textOverflow","textIndent","writingMode","whiteSpace","wordBreak","lineClamp","fontVariantNumeric","screenReaderOnly","color","backgroundColor","backgroundImage","backgroundRepeat","backgroundSize","backgroundPosition","backgroundAttachment","backgroundClip","backgroundOrigin","borderStyle","borderWidth","borderRadius","borderColor","objectFit","objectPosition","aspectRatio","opacity","boxShadow","transform","transformOrigin","transitionProperty","transitionDuration","transitionTimingFunction","animation","pointerEvents","cursor","userSelect","fontStyle","textUnderlineOffset","scrollMarginTop","alignSelf","flex","outlineStyle","resize","ringWidth","ringColor","backdropFilter","overscrollBehavior","divideWidth","divideColor"]),mc=u.enum(["hover","active","focus","disabled"]),lc=u.enum(["sm","md","lg","xl","2xl"]),rc=u.union([u.object({relation:u.enum(["before","after"]),anchorKey:u.string().min(1),parentKey:u.string().min(1)}),u.object({relation:u.enum(["prepend","append"]),parentKey:u.string().min(1)}),tc]),pc=u.object({kind:u.literal("component-call"),component:u.never().optional(),materialization:Ft,props:u.record(u.string(),u.never()).optional()}).strict(),B_=u.union([u.object({kind:u.literal("native-tag"),tag:u.string().min(1),text:u.string().optional()}),u.object({kind:u.literal("component-call"),component:u.object({source:u.string().min(1),exportName:u.string().min(1)}),materialization:u.never().optional(),props:u.record(u.string(),u.unknown()).optional()}).strict(),pc]),z_=u.discriminatedUnion("kind",[u.object({kind:u.literal("update-text"),segmentIndex:u.number().int().min(0),value:u.string()}),u.object({kind:u.literal("update-array-item"),segmentIndex:u.number().int().min(0),index:u.number().int().min(0),value:u.string()}),u.object({kind:u.literal("remove-node")}),u.object({kind:u.literal("insert-child"),node:B_,position:u.union([rc,ec])}),u.object({kind:u.literal("replace-node"),node:pc}),u.object({kind:u.literal("move-node"),target:rc,preserveBindings:u.boolean().optional()}),u.object({kind:u.literal("set-class-name-source"),filePath:u.string().min(1),expectedVersion:u.object({documentVersion:u.number().int().nonnegative(),contentHash:u.string().min(1)}),oldAttrRaw:u.string().min(1).nullable(),oldAttrRange:dt.nullable(),openingElementRange:dt,newAttrRaw:u.string().min(1).nullable(),intent:Hs}),Qr,u.object({kind:u.literal("apply-style-draft"),className:u.object({filePath:u.string().min(1),expectedVersion:u.object({documentVersion:u.number().int().nonnegative(),contentHash:u.string().min(1)}),oldAttrRaw:u.string().min(1).nullable(),oldAttrRange:dt.nullable(),openingElementRange:dt,newAttrRaw:u.string().min(1).nullable(),intent:Hs}).optional(),props:u.partialRecord(Zr,u.string()).optional()}).superRefine((e,n)=>{!e.className&&!e.props&&n.addIssue({code:"custom",message:"apply-style-draft requires className or props"})}),u.object({kind:u.literal("source-edit"),conflictPolicy:u.enum(["compare-and-swap","overwrite"]),edits:u.array(u.discriminatedUnion("operation",[u.object({operation:u.literal("upsert"),path:xe,content:u.string(),baseContentHash:u.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{ks(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit upsert only accepts allowlisted text source files"}),e.content.includes("\0")&&n.addIssue({code:"custom",path:["content"],message:"source-edit content must be valid text"})}),u.object({operation:u.literal("delete"),path:xe,capability:ir,confirmDelete:u.literal(!0),confirmPath:xe,baseContentHash:u.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{e.capability!==Ts&&n.addIssue({code:"custom",path:["capability"],message:"delete requires source-delete capability"}),e.confirmPath!==e.path&&n.addIssue({code:"custom",path:["confirmPath"],message:"delete confirmation path must match edit path"}),ks(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit delete only accepts allowlisted text source files"});let i=As(e.path);i&&n.addIssue({code:"custom",path:["path"],message:`Protected source file cannot be deleted: ${e.path} (${i})`})})])).min(1),reason:u.string().min(1).optional()}).strict().superRefine((e,n)=>{let i=new Set;for(let[s,o]of e.edits.entries())i.has(o.path)&&n.addIssue({code:"custom",path:["edits",s,"path"],message:`Duplicate source edit path: ${o.path}`}),i.add(o.path),e.conflictPolicy==="compare-and-swap"&&o.baseContentHash===void 0&&n.addIssue({code:"custom",path:["edits",s,"baseContentHash"],message:"source-edit compare-and-swap requires baseContentHash for every edit"})}),u.object({kind:u.literal("insert-page-resource"),artifact:Bs}).strict(),u.object({kind:u.literal("delete-page-source"),expectedUrlPath:u.string().startsWith("/")}).strict()]),dc=u.enum(["NODE_NOT_FOUND","HOME_PAGE_LOCKED","ROUTE_NOT_FOUND","CAPABILITY_REJECTED","CONSTRAINT_VIOLATED","INVALID_PARAMS","PLAN_FAILED","TRANSACTION_PREFLIGHT_FAILED","ROUTE_REBUILD_FAILED","HISTORY_COMMIT_FAILED","MATERIALIZATION_CONFLICT","MATERIALIZATION_REJECTED","MUTATION_ASSERTION_REQUIRED","MUTATION_ASSERTION_INVALID","VERSION_STALE","AST_PARSE_ERROR","UNSUPPORTED_OPERATION","LOCATOR_FAILED","INVALID_TARGET","WRITE_IO_ERROR","CONCURRENT_MODIFIED","ROLLBACK_FAILED","RECOVERY_REQUIRED","RECOVERY_PERSIST_FAILED","MUTATION_SESSION_REQUIRED","LEASE_ASSERTION_INVALID","LEASE_ASSERTION_EXPIRED","LEASE_ASSERTION_SCOPE_MISMATCH","CROSS_PAGE_MOVE_UNSUPPORTED","INTERNAL_ERROR"]),uc=u.object({code:dc,message:u.string().min(1),details:u.record(u.string(),u.unknown()).optional()}),en=u.object({key:u.string().min(1),instanceIndex:u.number().int().nonnegative().optional(),instanceCount:u.number().int().positive().optional()}),Ys=u.object({id:u.string().min(1),siteId:k,baseSnapshotId:A,composition:ue,kind:Mn,target:W_,documentVersion:u.number().int().nonnegative(),selectionRef:en.optional(),mutationContext:Nn.optional(),params:z_}).strict().superRefine((e,n)=>{if(e.kind!==e.params.kind&&n.addIssue({code:"custom",path:["params","kind"],message:"params.kind must match operation kind"}),e.kind==="source-edit"){if(e.target.kind!=="source-file"&&e.target.kind!=="source-batch")n.addIssue({code:"custom",path:["target","kind"],message:"source-edit requires a source-file or source-batch target"});else if(e.params.kind==="source-edit"){let i=e.params.edits.map(o=>o.path),s=e.target.kind==="source-file"?[e.target.path]:e.target.paths;Y_(i,s)||n.addIssue({code:"custom",path:["target"],message:"source-edit target paths must match edit paths"})}}else(e.target.kind==="source-file"||e.target.kind==="source-batch")&&n.addIssue({code:"custom",path:["target","kind"],message:"source targets are only valid for source-edit"});e.target.kind==="page-unit"&&(e.kind!=="insert-child"&&e.kind!=="replace-node"&&e.kind!=="move-node"&&e.kind!=="remove-node"&&n.addIssue({code:"custom",path:["target","kind"],message:"page-unit target is only valid for page-level operations"}),e.kind==="move-node"&&e.params.kind==="move-node"&&(!("kind"in e.params.target)||e.params.target.kind!=="page-composition")&&n.addIssue({code:"custom",path:["params","target","kind"],message:"page-unit move-node target requires page-composition placement"})),e.params.kind==="insert-child"&&"kind"in e.params.position&&e.params.position.kind==="page-composition"&&e.target.kind!=="page-unit"&&n.addIssue({code:"custom",path:["params","position","kind"],message:"page-composition position requires page-unit target"}),e.kind==="replace-node"&&e.target.kind!=="page-unit"&&n.addIssue({code:"custom",path:["target","kind"],message:"replace-node requires a page-unit target"}),e.kind==="insert-page-resource"||e.kind==="delete-page-source"?e.target.kind!=="project"&&n.addIssue({code:"custom",path:["target","kind"],message:`${e.kind} requires a project target`}):e.target.kind==="project"&&n.addIssue({code:"custom",path:["target","kind"],message:"project target is only valid for insert-page-resource or delete-page-source"}),e.kind==="insert-child"&&e.target.kind==="page-unit"&&e.params.kind==="insert-child"&&(!("kind"in e.params.position)||e.params.position.kind!=="page-composition")&&n.addIssue({code:"custom",path:["params","position","kind"],message:"page-unit target requires page-composition position"})}),n1=Ys,H_=u.object({kind:u.literal("insert-page-resource"),package_instance_id:u.string().min(1),pages:u.array(Fr).min(1)}).strict().superRefine((e,n)=>{let i=new Set,s=new Set;for(let[o,a]of e.pages.entries())i.has(a.template_page_id)&&n.addIssue({code:"custom",path:["pages",o,"template_page_id"],message:`Duplicate template page route mapping: ${a.template_page_id}`}),s.has(a.final_route)&&n.addIssue({code:"custom",path:["pages",o,"final_route"],message:`Duplicate final route mapping: ${a.final_route}`}),i.add(a.template_page_id),s.add(a.final_route)}),V_=u.object({kind:u.literal("delete-page-source"),deleted_files:u.array(u.string().min(1)),updated_files:u.array(u.string().min(1)),preserved_shared_files:u.array(u.string().min(1)),warnings:u.array(u.string().min(1))}).strict(),$_=u.discriminatedUnion("kind",[H_,V_]),_c=u.object({requestId:u.string().min(1),kind:Mn,composition:B,target:K_,resultVersion:u.number().int().nonnegative(),affectedFiles:u.array(u.string().min(1)).optional(),selectionRef:en.optional(),output:$_.optional()}).strict(),Xs=_c.superRefine((e,n)=>{let i=e.kind==="insert-page-resource"||e.kind==="delete-page-source";i&&e.target.kind!=="project"?n.addIssue({code:"custom",path:["target","kind"],message:`${e.kind} result requires a project target`}):!i&&e.target.kind==="project"&&n.addIssue({code:"custom",path:["target","kind"],message:"project result target requires a project operation"}),i&&!e.output&&n.addIssue({code:"custom",path:["output"],message:`${e.kind} result requires typed output`}),e.output&&e.output.kind!==e.kind&&n.addIssue({code:"custom",path:["output","kind"],message:"output.kind must match operation kind"})}),i1=Vr({dataSchema:Xs,codeSchema:dc,failureDataSchema:_c.partial()});function Y_(e,n){return e.length===n.length&&e.every((i,s)=>i===n[s])}var X_=oe.enum(["component","page","pages"]),Q_=oe.object({resource_kind:X_,resource_name:oe.string().trim().min(1).max(200),file_count:oe.number().int().min(1).max(64),total_bytes:oe.number().int().min(0).max(4*1024*1024),content_digest:oe.string().regex(/^sha256:[a-f0-9]{64}$/),custom_prompt:oe.string().trim().min(1).max(4e3).optional(),final_routes:oe.array(oe.string().min(1)).max(64)}).strict(),Z_=oe.discriminatedUnion("kind",[oe.object({kind:oe.literal("none")}).strict(),oe.object({kind:oe.literal("primary"),items:oe.array(oe.object({label:oe.string().trim().min(1).max(120),href:oe.string().startsWith("/").max(200)}).strict()).min(1).max(64)}).strict().superRefine((e,n)=>{let i=new Set;for(let[s,o]of e.items.entries())i.has(o.href)&&n.addIssue({code:"custom",path:["items",s,"href"],message:`Duplicate navigation href: ${o.href}`}),i.add(o.href)})]),J_=oe.object({base_snapshot_id:oe.string().min(1),operation:Ys,navigation_selection:Z_.optional()}).strict().superRefine((e,n)=>{e.base_snapshot_id!==e.operation.baseSnapshotId&&n.addIssue({code:"custom",path:["operation","baseSnapshotId"],message:"Resource operation baseSnapshotId must match base_snapshot_id."})});function eg(e){return(e.kind==="insert-child"||e.kind==="replace-node")&&(e.params.kind==="insert-child"||e.params.kind==="replace-node")&&e.params.node.kind==="component-call"&&"materialization"in e.params.node&&e.params.node.materialization?[e.params.node.materialization]:e.kind==="insert-page-resource"&&e.params.kind==="insert-page-resource"?[...e.params.artifact.components.map(n=>n.materialization),...e.params.artifact.pages.map(n=>n.materialization)]:[]}var gc=oe.object({id:oe.string().min(1),tenant_id:oe.string().min(1),site_id:oe.string().min(1),run_id:oe.string().min(1).optional(),correlation_id:oe.string().min(1).optional(),sent_at:oe.string().min(1),type:oe.literal("client.resource.operation.create"),payload:oe.object({client_message_id:oe.string().min(1),display:Q_,transient_resource_input:J_}).strict()}).strict().superRefine((e,n)=>{let{display:i,transient_resource_input:s}=e.payload;e.site_id!==s.operation.siteId&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation","siteId"],message:"Resource operation siteId must match envelope site_id."}),(i.resource_kind==="component"?s.operation.kind==="insert-child"||s.operation.kind==="replace-node":s.operation.kind==="insert-page-resource")||n.addIssue({code:"custom",path:["payload","transient_resource_input","operation","kind"],message:i.resource_kind==="component"?"component resources require insert-child or replace-node.":`${i.resource_kind} resources require insert-page-resource.`});let c=eg(s.operation).flatMap(m=>m.files),r=c.reduce((m,S)=>m+new TextEncoder().encode(S.content).byteLength,0);if(c.length>Ns&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate file count limit."}),r>js&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate content byte limit."}),i.file_count!==c.length&&n.addIssue({code:"custom",path:["payload","display","file_count"],message:"Resource summary file_count must match the transient operation."}),i.total_bytes!==r&&n.addIssue({code:"custom",path:["payload","display","total_bytes"],message:"Resource summary total_bytes must match the transient operation."}),s.operation.kind==="insert-page-resource"&&s.operation.params.kind==="insert-page-resource"){let m=s.operation.params.artifact;m.resource_type!==i.resource_kind&&n.addIssue({code:"custom",path:["payload","display","resource_kind"],message:"Resource summary kind must match the page artifact resource_type."});let S=m.pages.map(g=>g.final_route);(S.length!==i.final_routes.length||S.some((g,w)=>g!==i.final_routes[w]))&&n.addIssue({code:"custom",path:["payload","display","final_routes"],message:"Resource summary final_routes must match the page artifact routes."})}if(s.navigation_selection?.kind==="primary"){let m=new Set(i.final_routes);for(let[S,g]of s.navigation_selection.items.entries())m.has(g.href)||n.addIssue({code:"custom",path:["payload","transient_resource_input","navigation_selection","items",S,"href"],message:"Navigation selection href must reference a final resource route."})}});import{z as P}from"zod";import{z as Qs}from"zod";var L=e=>Qs.object({code:Qs.number().int(),data:e,message:Qs.string()});var tg=["with_website","without_website"],tn=P.enum(tg),Zs=P.string().trim().url().refine(e=>{let n=new URL(e).protocol;return n==="http:"||n==="https:"},{message:"Website must use the http or https protocol."}),ng=["welcome","website_scan","customer_materials","analysis","diagnosis","strategy","structure_planning","preview_personalization","publishing"],It=P.enum(ng),ig=["company_info","website_crawl","website_basic_info_extract","website_metrics_evaluate","intelligent_analysis","strategy_recommendation"],Sc=P.enum(ig),sg=["started","running","succeeded","failed","invalidated"],fc=P.enum(sg),og=["draft","structure_saved","generating","workspace_ready"],Js=P.enum(og),ag=["not_deployed","deploying","deployed"],eo=P.enum(ag),rg=["active","completed"],cg=P.enum(rg),mg=["completed","current","locked"],lg=P.enum(mg),bc={draft:10,structure_saved:20,generating:30,workspace_ready:40},yc={not_deployed:10,deploying:20,deployed:30},xc={active:10,completed:20},Ec={started:10,running:20,succeeded:30,failed:40,invalidated:50};function Pi(e){return new Map(Object.entries(e).map(([n,i])=>[i,n]))}var pg=Pi(bc),dg=Pi(yc),ug=Pi(xc),_g=Pi(Ec);function h1(e){let n=pg.get(e);if(!n)throw new Error(`Unknown site build status code: ${e}`);return n}function S1(e){let n=dg.get(e);if(!n)throw new Error(`Unknown site deployment status code: ${e}`);return n}function f1(e){let n=ug.get(e);if(!n)throw new Error(`Unknown site workflow status code: ${e}`);return n}function b1(e){let n=_g.get(e);if(!n)throw new Error(`Unknown task execution status code: ${e}`);return n}function y1(e){return bc[e]}function x1(e){return yc[e]}function E1(e){return xc[e]}function R1(e){return Ec[e]}var to=[{definition_version:1,published:!0,required_client_capability:null,definitions:{with_website:[{id:"01900000-0000-7000-8000-000000000001",node_code:"welcome",label:"\u6B22\u8FCE\u542F\u52A8",sort_order:1,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000002",node_code:"website_scan",label:"\u521D\u59CB\u5316\u9700\u6C42\u4E0E\u5B98\u7F51\u626B\u63CF",sort_order:2,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000003",node_code:"analysis",label:"\u667A\u80FD\u5206\u6790",sort_order:3,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000004",node_code:"diagnosis",label:"\u8BCA\u65AD\u62A5\u544A",sort_order:4,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000005",node_code:"strategy",label:"\u7B56\u7565\u4E0E\u5EFA\u8BAE",sort_order:5,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000014",node_code:"structure_planning",label:"\u7ED3\u6784\u89C4\u5212",sort_order:6,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000015",node_code:"preview_personalization",label:"\u9884\u89C8\u4E0E\u4E2A\u6027\u5316",sort_order:7,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000016",node_code:"publishing",label:"\u7F51\u7AD9\u53D1\u5E03",sort_order:8,is_enabled:!0}],without_website:[{id:"01900000-0000-7000-8000-00000000000b",node_code:"welcome",label:"\u6B22\u8FCE\u542F\u52A8",sort_order:1,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000c",node_code:"customer_materials",label:"\u5BA2\u6237\u8D44\u6599\u63D0\u4F9B",sort_order:2,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000d",node_code:"analysis",label:"\u667A\u80FD\u5206\u6790",sort_order:3,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000e",node_code:"strategy",label:"\u7B56\u7565\u4E0E\u5EFA\u8BAE",sort_order:4,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000017",node_code:"structure_planning",label:"\u7ED3\u6784\u89C4\u5212",sort_order:5,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000018",node_code:"preview_personalization",label:"\u9884\u89C8\u4E0E\u4E2A\u6027\u5316",sort_order:6,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000019",node_code:"publishing",label:"\u7F51\u7AD9\u53D1\u5E03",sort_order:7,is_enabled:!0}]}}],I1=to[0].definitions,Rc=P.number().int().min(1),gg=P.object({id:Q,flow_type:tn,definition_version:Rc,node_code:It,label:P.string().min(1),sort_order:P.number().int().min(1),is_enabled:P.boolean(),state:lg}),Ic=P.object({id:Ua,tenant_id:P.string().min(1),site_id:k,workflow_id:nt,node_code:It,task_type:Sc,external_task_id:P.string().min(1),execution_status:fc,idempotency_key:P.string().min(1),attempt_no:P.number().int().min(1),source_crawl_task_ref_id:P.string().uuid().nullable(),succeeded_at:P.string().min(1).nullable(),superseded_at:P.string().min(1).nullable(),site_url:P.string().url().nullable(),created_at:P.string().min(1),updated_at:P.string().min(1)}),hg=P.object({id:nt,tenant_id:P.string().min(1),site_id:k,flow_type:tn,website:Zs.nullable(),definition_version:Rc,current_node_code:It,status:cg,started_at:P.string().min(1),completed_at:P.string().min(1).nullable(),created_at:P.string().min(1),updated_at:P.string().min(1)}),no=P.object({workflow:hg,menu:P.array(gg),task_refs:P.array(Ic),site:P.object({default_locale:Ee.optional(),status:Js,deployment_status:eo,archived_at:P.string().min(1).nullable(),current_sitemap_id:P.string().nullable().optional(),current_sitemap_version:P.number().int().positive().nullable().optional(),confirmed_sitemap_id:P.string().nullable().optional(),confirmed_sitemap_version:P.number().int().positive().nullable().optional(),structure_confirmed_at:P.string().min(1).nullable().optional(),current_snapshot_id:P.string().nullable(),deployed_url:P.string().url().nullable(),cms_site_id:P.string().min(1).nullish()})}),T1=L(no),k1=L(Ic),hc=P.array(P.string().min(1).max(64)).max(16).optional(),A1=P.discriminatedUnion("flow_type",[P.object({flow_type:P.literal("with_website"),website:Zs,client_capabilities:hc}).strict(),P.object({flow_type:P.literal("without_website"),website:P.null().optional(),client_capabilities:hc}).strict()]),w1=P.object({expected_current_node:P.literal("website_scan"),website:Zs}).strict(),P1=P.object({expected_current_node:It}).strict(),v1=P.object({expected_current_node:P.literal("publishing")}).strict(),C1=P.object({expected_current_node:P.literal("preview_personalization"),publish_workflow_id:ri,expected_publish_revision:P.number().int().min(1)}).strict(),Sg=P.object({node_code:It,task_type:Sc,external_task_id:P.string().min(1).max(255),idempotency_key:P.string().min(1).max(255),site_url:P.string().url().optional()}),D1=Sg.extend({workflow_id:nt}).strict(),O1=P.object({external_task_id:P.string().min(1).max(255),execution_status:fc}),fg=P.object({previous_external_task_id:P.string().min(1).max(255),external_task_id:P.string().min(1).max(255),idempotency_key:P.string().min(1).max(255),site_url:P.string().url().optional()}),N1=fg.extend({workflow_id:nt}).strict(),bg=P.object({previous_external_task_id:P.string().min(1).max(255),external_task_id:P.string().min(1).max(255),idempotency_key:P.string().min(1).max(255),site_url:P.string().url()}),j1=bg.extend({workflow_id:nt}).strict(),L1=P.object({}).strict();function yg(e,n,i){return e.find(s=>s.definition_version===i)?.definitions[n]}function xg(e,n){return yg(to,e,n)}function Eg(e,n=1){let i=xg(e,n);if(!i)throw new Error(`Unknown workflow definition: ${e} v${n}.`);return i}function Rg(e,n,i){let s=new Set(i);return e.filter(o=>o.published&&(o.required_client_capability===null||s.has(o.required_client_capability))).sort((o,a)=>a.definition_version-o.definition_version).map(o=>({definition_version:o.definition_version,items:o.definitions[n]}))[0]}function M1(e,n){return Rg(to,e,n)}function U1(e,n){return Eg(e).findIndex(i=>i.node_code===n)}function F1(e,n){return e==="website_scan"?n==="website_crawl"||n==="website_basic_info_extract"||n==="website_metrics_evaluate":e==="customer_materials"?n==="company_info":e==="analysis"?n==="intelligent_analysis":e==="strategy"?n==="strategy_recommendation":!1}function G1(e,n){if(e===n)return n;if(!{started:["running","succeeded","failed","invalidated"],running:["succeeded","failed","invalidated"],succeeded:["invalidated"],failed:["invalidated"],invalidated:[]}[e].includes(n))throw new Error(`Invalid task execution status transition: ${e} -> ${n}`);return n}function q1(e,n){if(e===n)return n;if(!{draft:["structure_saved"],structure_saved:["generating","draft"],generating:["workspace_ready","structure_saved"],workspace_ready:[]}[e].includes(n))throw new Error(`Invalid site build status transition: ${e} -> ${n}`);return n}import{z as I}from"zod";var io=I.string().min(1).max(120).regex(/^[a-z][a-z0-9_-]*$/),Le=I.string().min(1).max(120).regex(/^[A-Za-z_][A-Za-z0-9_]*$/),Ig=I.enum(["text","select","multi_select","tags","category_list","boolean","number"]),Un=I.string().min(1).max(512).regex(/^\/(?:[^?#]*)$/),Tg=I.object({minimum:I.number().finite(),maximum:I.number().finite(),step:I.number().finite().positive()}).strict().refine(e=>e.minimum<e.maximum,{message:"minimum must be less than maximum"}),kg=I.string().trim().min(1).max(100),kc=I.array(kg).max(5).refine(e=>new Set(e.map(n=>n.toLowerCase())).size===e.length,{message:"popular_terms must be unique ignoring case"}),z1=I.array(I.string()).max(20).transform(e=>{let n=new Set;return e.map(i=>i.trim()).filter(i=>{if(i.length===0||i.length>100)return!1;let s=i.toLowerCase();return n.has(s)?!1:(n.add(s),!0)}).slice(0,5)}),Ac=I.object({filter_enabled:I.boolean(),selected_fields:I.array(Le).max(64),selected_card_fields:I.array(Le).max(64).default([]),popular_terms_enabled:I.boolean().default(!1),popular_terms:kc.optional()}).strict(),Ag=I.object({app_slug:io}).extend(Ac.shape).strict(),so=I.object({kind:I.literal("product_search_confirmation"),baseline_snapshot_id:A,target_route_id:Un,applications:I.array(I.object({app_slug:io,label:I.string().min(1).max(200),popular_terms:kc.default([]),current_config:Ac.nullable().default(null),affected_routes:I.array(Un).max(64).default([]),fields:I.array(I.object({field_name:Le,label:I.string().min(1).max(200),value_shape:Ig,option_count:I.number().int().nonnegative().optional(),filter_meta:Tg.optional()}).strict()).max(64)}).strict()).min(1).max(12),current_config:Ag.nullable().optional(),affected_routes:I.array(Un).min(1).max(64).optional()}).strict(),wg=I.object({kind:I.literal("product_search_confirmation"),action:I.enum(["confirm","modify"]),app_slug:io,filter_enabled:I.boolean(),popular_terms_enabled:I.boolean().default(!1),selected_fields:I.array(Le).max(64),selected_card_fields:I.array(Le).max(64).default([])}).strict().superRefine((e,n)=>{e.filter_enabled&&e.selected_fields.length===0&&n.addIssue({code:"custom",path:["selected_fields"],message:"selected_fields must not be empty while filters are enabled"}),new Set(e.selected_fields).size!==e.selected_fields.length&&n.addIssue({code:"custom",path:["selected_fields"],message:"selected_fields must be unique"}),new Set(e.selected_card_fields).size!==e.selected_card_fields.length&&n.addIssue({code:"custom",path:["selected_card_fields"],message:"selected_card_fields must be unique"})}),vi=I.union([wg,I.object({kind:I.literal("product_search_confirmation"),action:I.literal("cancel")}).strict()]),Fn=I.union([I.string().max(255),I.number().finite(),I.boolean()]),Pg=I.object({values:I.array(Fn).min(1).max(20).refine(e=>new Set(e.map(n=>`${typeof n}:${String(n)}`)).size===e.length,{message:"values must be unique"})}).strict(),vg=I.object({min:I.number().finite().optional(),max:I.number().finite().optional(),include_unlabeled:I.boolean().optional()}).strict().refine(e=>e.min!==void 0||e.max!==void 0||e.include_unlabeled===!0,{message:"a numeric boundary or include_unlabeled is required"}).refine(e=>e.min===void 0||e.max===void 0||e.min<=e.max,{message:"min must not be greater than max"}),Cg=I.object({q:I.string().max(200),page:I.number().int().min(1).max(500),page_size:I.union([I.literal(9),I.literal(20)]),sort:I.enum(["published_at_desc","published_at_asc","product_name_asc","product_name_desc"]),filters:I.record(Le,I.union([Pg,vg])).superRefine((e,n)=>{Object.keys(e).length>12&&n.addIssue({code:"custom",message:"filters must contain at most 12 fields"})}),display_fields:I.array(Le).max(64).default([]),missing_count_fields:I.array(Le).max(12).default([]),relaxation_count_fields:I.array(Le).max(12).default([]),facets:I.array(I.object({field:Le,query:I.string().max(100),page:I.number().int().min(1).max(100),page_size:I.literal(10),include_values:I.array(Fn).max(20)}).strict()).max(8)}).strict(),Tc=I.object({value:Fn,label:I.string().max(200),count:I.number().int().nonnegative()}).strict(),Dg=I.union([Fn,I.array(Fn).max(50)]),Og=I.object({items:I.array(I.object({id:I.number().int().positive(),thumbnail:I.string().max(2048).nullable(),title:I.string().max(300),summary:I.string().max(2e3),category:I.string().max(300).nullable(),field_values:I.record(Le,Dg).default({}),url:I.string().min(1).max(2048)}).strict()).max(20),page:I.object({total:I.number().int().nonnegative(),page:I.number().int().positive(),page_size:I.union([I.literal(9),I.literal(20)])}).strict(),facets:I.array(I.object({field:Le,total:I.number().int().nonnegative(),page:I.number().int().positive(),page_size:I.literal(10),values:I.array(Tc).max(10),selected_values:I.array(Tc).max(20)}).strict()).max(8),missing_counts:I.record(Le,I.number().int().nonnegative()).default({}),relaxation_counts:I.record(Le,I.number().int().nonnegative()).default({})}).strict(),H1=I.object({contract_version:I.literal(1),request:Cg,response:Og}).strict();import{z as Ge}from"zod";var oo=4,Y1=20,X1=1440*60*1e3,Q1=1e6,Ng=["image/png","image/jpeg","image/webp"],ao=Ge.enum(Ng),Z1="WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT",J1="WORKSPACE_ATTACHMENT_TOO_LARGE",ew="WORKSPACE_ATTACHMENT_LIMIT",tw="WORKSPACE_ATTACHMENT_BOUND",nw=10,iw=3600*1e3,sw="WORKSPACE_ATTACHMENT_URL_REJECTED",ow="WORKSPACE_ATTACHMENT_CAPTURE_FAILED",aw="WORKSPACE_ATTACHMENT_CAPTURE_BUSY",rw="WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT",cw="WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_EXCEEDED",mw="WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE",lw=Ge.object({attachment_id:Ge.string().min(1),media_type:ao,width:Ge.number().int().positive(),height:Ge.number().int().positive(),size_bytes:Ge.number().int().nonnegative(),filename:Ge.string().min(1).max(120),image_url:Ge.string().min(1),source_url:Ge.string().min(1).optional(),created_at:Ge.string().min(1)}).strict(),pw=Ge.object({url:Ge.string().url().max(2048),full_page:Ge.boolean().optional()}).strict(),wc="[A-Za-z0-9_-]+",jg=new RegExp(`^/sites/(${wc})/workspace/attachments/(${wc})/image$`);function dw(e,n){return`/sites/${encodeURIComponent(e)}/workspace/attachments/${encodeURIComponent(n)}/image`}function ro(e){let n=jg.exec(e);return n?{site_id:n[1],attachment_id:n[2]}:null}function uw(e){let n=[];for(let i of e){if(i.type!=="file"||typeof i.url!="string")continue;let s=ro(i.url);s&&n.push({attachment_id:s.attachment_id,site_id:s.site_id,media_type:typeof i.mediaType=="string"?i.mediaType:"",filename:typeof i.filename=="string"&&i.filename.trim()!==""?i.filename:"image",url:i.url})}return n}import{z as Gn}from"zod";var Lg=["deployment_queued","prepare_source","build_artifact","publish_site","site_released","cleanup_release"],Mg=Gn.enum(Lg),Ug=Gn.enum(["running","succeeded","failed"]),Fg=Gn.object({code:Mg,status:Ug,message:Gn.string().trim().min(1)}).strict(),Pc=Gn.array(Fg);import{z as qn}from"zod";var Gg={slug:/^page_[0-9]+_slug$/,showInHeader:/^page_[0-9]+_show_in_header$/,showInFooter:/^page_[0-9]+_show_in_footer$/,type:/^block_[0-9]+_type$/};function fw(e){let n={},i=new Set;for(let s of e){if(!Gg[s.field].test(s.key))throw new Error("Invalid Sitemap Resolver answer-sheet hole key.");if(i.has(s.key))throw new Error("Duplicate Sitemap Resolver answer-sheet hole key.");i.add(s.key),n[s.key]=s.field==="slug"?qn.string().min(1):s.field==="type"?qn.string().trim().min(1):qn.boolean()}return qn.object({answers:qn.object(n).strict()}).strict()}import{z as v}from"zod";var qg=v.enum(["pending","running","succeeded","failed"]),Wg=v.enum(["TASK_FAILED","WEBSITE_UNREACHABLE"]),Kg=v.object({task_id:v.string().uuid(),site_url:v.string().url(),crawler_task_id:v.string().min(1).max(255).nullable(),crawler_error_code:Wg.nullable().optional(),crawler_failure_stage:v.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]).nullable().optional(),page_count:v.number().int().min(0).max(20),status:qg,error:v.string().nullable(),created_at:v.string().min(1),updated_at:v.string().min(1)}),Ew=L(Kg),co=v.enum(["existing_site","new_site"]),Cc=v.enum(["google_indexing","ai_recommendation","qualification_verifiability","content_freshness","inquiry_form","inquiry_response","privacy_compliance","prohibited_content"]),vc=v.object({observed_result:v.enum(["pass","fail","unknown"])}).strict(),Dc=v.object({kind:v.literal("ai_crawlability"),checks:v.object({ai_access_guidance:vc,structured_data_presence:vc}).strict()}).strict(),mo=v.object({label:v.string().trim(),value:v.union([v.string(),v.number(),v.boolean(),v.null()]),summary:v.string().trim(),tone:v.enum(["good","warn","bad","unknown"]),status:v.enum(["ok","unknown"]),assessment:Dc.optional()}),Ci=v.object({key:v.string().trim().min(1).max(100),label:v.string().trim().min(1).max(100),value:v.union([v.string().max(1e3),v.number(),v.boolean(),v.null()]),tone:v.enum(["good","warn","bad","unknown"]),status:v.enum(["ok","unknown"]),evidence:v.string().trim().max(2e3).optional(),assessment:Dc.optional()}).strict(),Bg=v.object({url:v.string().url().max(2048),title:v.string().trim().max(300),words:v.number().int().nonnegative().max(1e7)}).strict(),zg=v.object({site_url:v.string().url().max(2048),scanned_at:v.string().datetime({offset:!0}),reach:v.array(Ci).max(64),trust:v.array(Ci).max(64),convert:v.array(Ci).max(64),safe:v.array(Ci).max(64),pages:v.array(Bg).max(100)}).strict(),Di=v.object({company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128),type:co,result:v.object({company_name:v.string(),website:v.string().url().optional(),primary_product:v.string(),current_market:v.string(),qualifications:v.string(),scan_cards:v.record(v.string(),mo),scan_result:zg.optional()})}),Hg=v.object({saved:v.literal(!0),company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128)}),Rw=L(Hg),Vg=v.enum(["snapshot","task"]),$g=Di.shape.result.extend({type:co,structured_facts:v.unknown().optional()}).extend({company_name:v.string(),primary_product:v.string(),current_market:v.string(),qualifications:v.string()}),Yg=v.object({site_id:v.string().min(1).max(128),company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128),type:co,data_source:Vg,result:$g}),Iw=L(Yg.nullable());import{z as Re}from"zod";var Tt=Re.enum(["company","product_service","case_qualification","market","contact_inquiry","privacy_compliance","news_freshness"]),Xg=Re.object({ordinal:Re.number().int().min(1).max(1e4),path:Re.string().min(1).max(2048).refine(e=>!Jg(e),{message:"path must be a site-relative path, not an absolute URL"}),last_modified:Re.string().max(64).nullable()}).strict(),Aw=Re.object({candidates:Re.array(Xg).min(1).max(1e4),selection_limit:Re.number().int().min(1).max(19)}).strict().superRefine((e,n)=>{let i=e.candidates.map(s=>s.ordinal).sort((s,o)=>s-o);for(let[s,o]of i.entries())if(o!==s+1){n.addIssue({code:"custom",path:["candidates"],message:"candidates ordinals must be unique and consecutive from 1"});return}}),Qg=Re.object({ordinal:Re.number().int().positive().max(1e4),roles:Re.array(Tt).min(1).max(7)}).strict(),Zg=Re.object({role:Tt,status:Re.enum(["selected","not_found"]),selected_ordinals:Re.array(Re.number().int().positive().max(1e4)).max(19)}).strict(),ww=Re.object({selections:Re.array(Qg).max(19),coverage:Re.array(Zg).length(7)}).strict().superRefine((e,n)=>{let i=new Set;for(let[o,a]of e.coverage.entries())i.has(a.role)&&n.addIssue({code:"custom",path:["coverage",o,"role"],message:"coverage roles must be unique"}),i.add(a.role);for(let o of Tt.options)i.has(o)||n.addIssue({code:"custom",path:["coverage"],message:`coverage must include every page role (missing ${o})`});let s=new Map;for(let o of e.selections)for(let a of o.roles){let c=s.get(a)??new Set;c.add(o.ordinal),s.set(a,c)}for(let[o,a]of e.coverage.entries()){let c=s.get(a.role);a.selected_ordinals.some(m=>!c?.has(m))&&n.addIssue({code:"custom",path:["coverage",o,"selected_ordinals"],message:"selected_ordinals must reference selections carrying the same role"})}});function Jg(e){let n=e.toLowerCase();return n.startsWith("http://")||n.startsWith("https://")||e.startsWith("//")}import{z as b}from"zod";var Dw=b.object({force_refresh:b.boolean().optional()}),Nc=b.enum(["running","succeeded","failed"]),eh=b.object({agent_id:b.string().min(1),name:b.string().min(1),icon:b.string().min(1),capability:b.string().min(1),data_source:b.string().min(1),output_topics:b.string().min(1)}),th=b.object({site_mode:b.enum(["existing_site","new_site"]),scan_required:b.boolean(),scheduled_agent_ids:b.array(b.string().min(1)),omitted_agent_ids:b.array(b.string().min(1)),next_stage:b.enum(["diagnostic_report","strategy"])}),nh=b.object({t:b.string(),d:b.string(),evidence:b.object({from:b.string(),url:b.string().nullable().optional(),value:b.string().nullable().optional()})}),ih=b.enum(["complete","partial","insufficient_data","failed"]),sh=b.enum(["ok","failed","insufficient_data"]),lo=b.object({agent_id:b.string().min(1),name:b.string().min(1),icon:b.string().min(1),status:sh,topics:b.array(b.object({topic_id:b.string().min(1),status:ih,evidence_refs:b.array(b.string())})).length(3),findings:b.array(nh).max(3),elapsed_ms:b.number().nonnegative(),note:b.string().optional(),error:b.string().optional()}),jc=b.object({total:b.number().int().nonnegative(),ok:b.number().int().nonnegative(),degraded:b.number().int().nonnegative(),total_findings:b.number().int().nonnegative(),elapsed_ms:b.number().nonnegative(),site_mode:b.enum(["existing_site","new_site"]).optional(),scheduled_agent_ids:b.array(b.string()).optional(),omitted_agent_ids:b.array(b.string()).optional(),scheduled:b.number().int().nonnegative().optional(),complete:b.number().int().nonnegative().optional(),partial:b.number().int().nonnegative().optional(),insufficient:b.number().int().nonnegative().optional(),failed:b.number().int().nonnegative().optional(),next_stage:b.enum(["diagnostic_report","strategy"]).optional()}),oh=b.object({agents_done:b.boolean(),analysis:b.record(b.string(),lo),step4_scoring_input:b.unknown().optional(),summary:jc}),Lc=b.object({job_id:b.string().min(1),site_id:b.string().min(1),model_version:b.string().min(1),output_locale:b.string().min(2),cached:b.boolean().optional(),status:Nc,result:oh.nullable().optional(),error:b.string().nullable().optional()}),Ow=L(b.array(eh)),Nw=L(th),jw=L(Lc),Lw=L(Lc.nullable()),gt=b.object({id:b.union([b.number().int().nonnegative(),b.string().regex(/^(0|[1-9]\d*)$/u).transform(Number)]).pipe(b.number().int().nonnegative())}),Oc=b.object({percent:b.number().int().min(0).max(100),phase:b.enum(["preparing","analyzing","finalizing","completed","failed"]),stage:b.enum(["queued","baseline_ready","source_pages_ready","external_evidence_ready","knowledge_evidence_ready","page_evidence_ready","analysis_context_ready","preparation_saved","workflow_ready","agent_started","agent_completed","workflow_completed","scoring_input_ready","red_texts_ready","result_ready","result_persisted","completed","failed"]),agents_done:b.number().int().nonnegative(),agents_total:b.number().int().nonnegative(),agent_id:b.string().min(1).optional()}),Mw=b.discriminatedUnion("event",[gt.extend({event:b.literal("snapshot"),data:b.object({job_id:b.string().min(1),status:Nc,done:b.number().int().nonnegative(),total:b.number().int().nonnegative(),results:b.array(lo),progress:Oc.optional()})}),gt.extend({event:b.literal("progress"),data:Oc}),gt.extend({event:b.literal("preparing_started"),data:b.object({stage:b.literal("baseline")})}),gt.extend({event:b.literal("preparing_progress"),data:b.object({stage:b.enum(["context","external_evidence"])})}),gt.extend({event:b.literal("preparing_done"),data:b.object({evidence_count:b.number().int().nonnegative(),rule_count:b.number().int().nonnegative(),degraded_capabilities:b.array(b.string())})}),gt.extend({event:b.literal("agent_start"),data:b.object({agent_id:b.string().min(1),name:b.string().min(1),icon:b.string().min(1)})}),gt.extend({event:b.literal("agent_done"),data:lo}),gt.extend({event:b.literal("done"),data:b.object({agents_done:b.literal(!0),summary:jc})}),gt.extend({event:b.literal("failed"),data:b.object({message:b.string().min(1)})})]);import{z as M}from"zod";var uo=M.enum(["reach","trust","convert","safe"]),Ce=M.number().finite(),ah=M.number().finite().positive(),po=["reach","trust","convert","safe"],rh=17,ch=M.enum(["passed","partial","failed"]),mh=M.object({landing_page_mode:M.enum(["intent_dynamic","static","none"]),ab_test_enabled:M.boolean()}).strict(),lh=M.union([M.boolean(),M.number().finite(),ch,mh]).nullable(),ph=M.union([M.boolean(),M.number().finite()]).nullable(),dh=M.object({competitor_avg:M.number().finite(),score_items:M.record(M.string(),lh),penalty_items:M.record(M.string(),ph),red_texts:M.array(M.string())}).strict(),uh=M.record(uo,dh),_h=M.object({key:uo,score:Ce,pass_score:Ce,gap:Ce}),gh=M.object({key:M.string(),title:M.string(),is_redline_option:M.boolean().optional(),score:Ce,max_score:ah,pass_score:Ce,passed:M.boolean(),description:M.string()}),hh=M.object({key:uo,title:M.string(),alias:M.string(),slogan:M.string(),score:Ce,max_score:M.literal(100),pass_score:Ce,competitor_average:Ce,status:M.enum(["reached","near","not_reached"]),status_name:M.enum(["\u8FBE\u6807","\u63A5\u8FD1","\u672A\u8FBE\u6807"]),summary:M.string(),sub_dimensions:M.array(gh),red_texts:M.array(M.string()),redline_hit:M.boolean().optional()}),Sh=M.object({id:M.number().int().positive(),task_code:M.string().min(1).max(128),is_sync:M.literal(0),status:M.literal("succeeded"),rules:uh,scores_list:M.object({overview:M.object({pass_scores:M.object({reach:Ce,trust:Ce,convert:Ce,safe:Ce}),total_score:Ce,total_pass_score:Ce,score_gap:Ce,competitor_average_score:Ce,scoring_criteria_text:M.string().min(1),gap_dimensions:M.array(_h).max(4),overall_passed:M.boolean(),all_scores_passed:M.boolean(),diagnosis_passed:M.boolean(),commitment_eligible:M.boolean(),safe_redline_hit:M.boolean()}),dimensions:M.array(hh).length(4)}),created_at:M.string().datetime({offset:!0}),updated_at:M.string().datetime({offset:!0})}).superRefine((e,n)=>{fh(e.scores_list.dimensions)||n.addIssue({code:"custom",path:["scores_list","dimensions"],message:"dimensions must include each canonical score dimension."}),e.scores_list.dimensions.reduce((s,o)=>s+o.sub_dimensions.length,0)!==rh&&n.addIssue({code:"custom",path:["scores_list","dimensions"],message:"dimensions must include 17 subdimensions in total."});for(let[s,o]of e.scores_list.dimensions.entries()){if(o.redline_hit===void 0)continue;let a=o.sub_dimensions.findIndex(c=>c.is_redline_option===void 0);a!==-1&&n.addIssue({code:"custom",path:["scores_list","dimensions",s,"sub_dimensions",a,"is_redline_option"],message:"subdimensions must define is_redline_option when redline_hit is defined."})}}),qw=L(Sh);function fh(e){let n=e.map(i=>i.key);return n.length===po.length&&new Set(n).size===po.length&&po.every(i=>n.includes(i))}var kt={queued:["preparing_source","lock_failed","deploy_failed"],preparing_source:["building","source_prepare_failed","deploy_failed"],building:["artifact_ready","build_failed","artifact_fetch_failed","artifact_validation_failed","deploy_failed"],artifact_ready:["deploying","deploy_failed"],deploying:["released","deploy_failed"],released:[],lock_failed:[],source_prepare_failed:[],build_failed:[],artifact_fetch_failed:[],artifact_validation_failed:[],deploy_failed:[],cleanup_failed:[]};for(let e of Object.values(kt))Object.freeze(e);Object.freeze(kt);var Bw=Object.freeze(Yt.filter(e=>kt[e].length>0)),zw=Object.freeze(Yt.filter(e=>kt[e].length===0)),bh=Object.freeze(["preparing_source","building","artifact_ready","deploying","released"]),yh="DEPLOYMENT_TRANSITION_INVALID",_o=class extends Error{constructor(n,i){super(`Invalid deployment transition: ${n} -> ${i}`),this.currentStatus=n,this.nextStatus=i,this.code=yh,this.name="DeploymentTransitionError"}};function Hw(e){return kt[e]}function Vw(e){return Yt.filter(n=>kt[n].some(i=>i===e))}function xh(e){return kt[e].length>0}function $w(e){return!xh(e)}function Yw(e,n){if(!kt[e].some(i=>i===n))throw new _o(e,n);return n}function Xw(){return bh}import{converter as Eh,formatHex as Rh,parse as Ih,wcagContrast as Jw}from"culori";var eP=Eh("oklch");var T={paper:"oklch(0.92 0.008 250)",cream:"oklch(0.90 0.035 85)",sand:"oklch(0.75 0.05 78)",stone:"oklch(0.60 0.02 75)",ash:"oklch(0.60 0.012 250)",slate:"oklch(0.45 0.025 250)",charcoal:"oklch(0.30 0.015 255)",ink:"oklch(0.25 0.04 260)",sky:"oklch(0.72 0.12 230)",blue:"oklch(0.58 0.17 250)","medical blue":"oklch(0.58 0.12 235)",indigo:"oklch(0.50 0.18 280)",navy:"oklch(0.40 0.10 258)",ocean:"oklch(0.55 0.13 220)","slate blue":"oklch(0.46 0.06 245)",teal:"oklch(0.60 0.12 195)","soft aqua":"oklch(0.78 0.07 190)",mint:"oklch(0.78 0.10 165)",sage:"oklch(0.65 0.05 145)",green:"oklch(0.58 0.15 145)","clinical green":"oklch(0.62 0.12 155)",emerald:"oklch(0.60 0.16 155)",forest:"oklch(0.45 0.10 145)",olive:"oklch(0.58 0.08 115)",lime:"oklch(0.72 0.17 130)",yellow:"oklch(0.82 0.15 100)",gold:"oklch(0.72 0.14 85)",amber:"oklch(0.70 0.16 70)",orange:"oklch(0.66 0.18 55)",coral:"oklch(0.68 0.16 32)",terracotta:"oklch(0.55 0.12 42)",rust:"oklch(0.50 0.13 38)",brown:"oklch(0.45 0.07 55)",rose:"oklch(0.65 0.16 18)",red:"oklch(0.58 0.20 25)",crimson:"oklch(0.52 0.20 22)",wine:"oklch(0.42 0.13 18)",pink:"oklch(0.72 0.14 0)",magenta:"oklch(0.60 0.22 345)",lavender:"oklch(0.72 0.08 295)",violet:"oklch(0.58 0.19 295)",purple:"oklch(0.52 0.19 305)",plum:"oklch(0.45 0.13 325)",electric:"oklch(0.62 0.23 285)","clean white":"oklch(0.97 0.01 245)","cool gray":"oklch(0.62 0.02 245)",zinc:"oklch(0.60 0.012 250)",gray:"oklch(0.60 0.012 250)",grey:"oklch(0.60 0.012 250)",neutral:"oklch(0.60 0.005 250)",gunmetal:"oklch(0.30 0.015 255)"},Th={\u84DD:T.blue,\u84DD\u8272:T.blue,\u5929\u84DD:T.sky,\u5929\u84DD\u8272:T.sky,\u6D45\u84DD:T.sky,\u6E56\u84DD:T.ocean,\u6D77\u84DD:T.ocean,\u6DF1\u84DD:T.navy,\u85CF\u84DD:T.navy,\u85CF\u9752:T.navy,\u6D77\u519B\u84DD:T.navy,\u6DF1\u6D77\u519B\u84DD:T.navy,\u5348\u591C\u84DD:T.navy,\u975B\u84DD:T.indigo,\u975B\u9752:T.indigo,\u94A2\u84DD:T["slate blue"],\u9752:T.teal,\u9752\u8272:T.teal,\u84DD\u7EFF:T.teal,\u7EFF:T.green,\u7EFF\u8272:T.green,\u6D45\u7EFF:T.mint,\u8584\u8377\u7EFF:T.mint,\u8349\u7EFF:T.lime,\u6A44\u6984\u7EFF:T.olive,\u58A8\u7EFF:T.forest,\u6DF1\u7EFF:T.forest,\u68EE\u6797\u7EFF:T.forest,\u7FE0\u7EFF:T.emerald,\u7956\u6BCD\u7EFF:T.emerald,\u9EC4:T.yellow,\u9EC4\u8272:T.yellow,\u91D1:T.gold,\u91D1\u8272:T.gold,\u91D1\u9EC4:T.gold,\u7425\u73C0:T.amber,\u7425\u73C0\u8272:T.amber,\u6A59:T.orange,\u6A59\u8272:T.orange,\u6A58\u8272:T.orange,\u6A58\u9EC4:T.orange,\u6D3B\u529B\u6A59:T.orange,\u6696\u6A59:T.orange,\u73CA\u745A:T.coral,\u73CA\u745A\u6A59:T.coral,\u9676\u571F:T.terracotta,\u8D64\u9676:T.terracotta,\u9508\u7EA2:T.rust,\u68D5:T.brown,\u68D5\u8272:T.brown,\u8910\u8272:T.brown,\u5496\u5561\u8272:T.brown,\u7EA2:T.red,\u7EA2\u8272:T.red,\u6731\u7EA2:T.red,\u7EEF\u7EA2:T.crimson,\u6DF1\u7EA2:T.crimson,\u9152\u7EA2:T.wine,\u73AB\u7470:T.rose,\u73AB\u7EA2:T.rose,\u7C89:T.pink,\u7C89\u8272:T.pink,\u7C89\u7EA2:T.pink,\u6D0B\u7EA2:T.magenta,\u54C1\u7EA2:T.magenta,\u7D2B:T.purple,\u7D2B\u8272:T.purple,\u6DE1\u7D2B:T.lavender,\u85B0\u8863\u8349:T.lavender,\u7D2B\u7F57\u5170:T.violet,\u6885\u7EA2:T.plum,\u7070:T.gray,\u7070\u8272:T.gray,\u6D45\u7070:T.gray,\u6DE1\u7070:T.gray,\u51B7\u7070:T["cool gray"],\u51B7\u7070\u767D:T["cool gray"],\u6696\u7070:T.stone,\u6DF1\u7070:T.slate,\u77F3\u58A8\u7070:T.slate,\u77F3\u677F\u7070:T.slate,\u70AD\u7070:T.charcoal,\u70AD\u9ED1:T.charcoal,\u58A8:T.ink,\u58A8\u8272:T.ink,\u9ED1:T.ink,\u9ED1\u8272:T.ink,\u767D:T["clean white"],\u767D\u8272:T["clean white"],\u7C73\u767D:T.cream,\u7C73\u8272:T.cream,\u8C61\u7259\u767D:T.cream,\u5976\u6CB9\u767D:T.cream,\u6C99\u8272:T.sand},tP={...T,...Th};function go(e){let n=Ih(e.trim());return n?Rh(n)??null:null}var ht={Inter:{import:"Inter"},"Inter Tight":{import:"Inter_Tight"},"DM Sans":{import:"DM_Sans"},"Source Sans 3":{import:"Source_Sans_3"},"Libre Franklin":{import:"Libre_Franklin"},Montserrat:{import:"Montserrat"},Archivo:{import:"Archivo"},"Space Grotesk":{import:"Space_Grotesk"},Manrope:{import:"Manrope"},"IBM Plex Sans":{import:"IBM_Plex_Sans"},Oswald:{import:"Oswald"},"Roboto Condensed":{import:"Roboto_Condensed"},"Bebas Neue":{import:"Bebas_Neue",weights:["400"]},"Playfair Display":{import:"Playfair_Display"},Lora:{import:"Lora"},Fraunces:{import:"Fraunces"},"Cormorant Garamond":{import:"Cormorant_Garamond"},"JetBrains Mono":{import:"JetBrains_Mono"},"IBM Plex Mono":{import:"IBM_Plex_Mono",weights:["400","500","600","700"]},"Noto Sans SC":{import:"Noto_Sans_SC",download:!1},"Noto Serif SC":{import:"Noto_Serif_SC",download:!1}},kh={heading:"Inter",body:"Inter"},Mc=ht.Inter;function Oi(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var qc=(()=>{let e=new Map;for(let[n,i]of Object.entries(ht))e.set(Oi(n),i),e.set(Oi(i.import),i);return e})();function Ah(e){return typeof e!="string"||e.trim().length===0?Mc:qc.get(Oi(e))??Mc}var wh=(()=>{let e=new Map;for(let[n,i]of Object.entries(ht))e.set(i.import,n);return e})();function nn(e){if(typeof e!="string"||e.trim().length===0)return"Inter";let n=qc.get(Oi(e));return n?wh.get(n.import)??"Inter":"Inter"}var Ph=Object.keys(ht),Uc='ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',Fc='Georgia, "Times New Roman", serif',Gc='"SFMono-Regular", Consolas, monospace',vh=new Set(["serif","sans-serif","sans serif","monospace","mono","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace"]),Ch=new Set(["Playfair Display","Lora","Fraunces","Cormorant Garamond","Noto Serif SC"].map(e=>e.toLowerCase())),Dh=new Set(["JetBrains Mono","IBM Plex Mono"].map(e=>e.toLowerCase()));function Oh(e){let n=e.toLowerCase();return Dh.has(n)||n.includes("mono")?"mono":Ch.has(n)||n.includes("serif")?"serif":"sans"}function ho(e,n){let i=m=>(m??"").trim().replace(/^['"]|['"]$/g,"").replace(/[^A-Za-z0-9 _-]+/g,"").trim().slice(0,60),s=i(e),o=i(n),a=m=>vh.has(m.toLowerCase());if(s&&a(s)){let m=s.toLowerCase();return m.includes("mono")?Gc:m.includes("serif")?Fc:Uc}let c=s;c||(c=a(o)?"":o),c||(c="Inter");let r=Oh(c);return r==="mono"?`"${c}", ${Gc}`:r==="serif"?`"${c}", ${Fc}`:`"${c}", ${Uc}`}function Nh(e){return{"--site-font-sans":ho(e?.body,"Inter"),"--site-font-heading":ho(e?.heading,e?.body??"Inter")}}var So=["archivo-inter","playfair-source-sans","space-grotesk-manrope","fraunces-libre-franklin","noto-serif-sc-noto-sans-sc","noto-sans-sc"],Wc=[{id:"archivo-inter",heading:"Archivo",body:"Inter"},{id:"playfair-source-sans",heading:"Playfair Display",body:"Source Sans 3"},{id:"space-grotesk-manrope",heading:"Space Grotesk",body:"Manrope"},{id:"fraunces-libre-franklin",heading:"Fraunces",body:"Libre Franklin"},{id:"noto-serif-sc-noto-sans-sc",heading:"Noto Serif SC",body:"Noto Sans SC"},{id:"noto-sans-sc",heading:"Noto Sans SC",body:"Noto Sans SC"}];function Kc(e){let n=Wc.find(i=>i.id===e);if(!n)throw new Error(`Unknown font pairing: ${e}`);return n}import{z as sn}from"zod";import{z as jh}from"zod";var Lh=["light","standard","bold"],qe=jh.enum(Lh),Ni="standard",Mh=new Set(["display","heading","title"]),Bc={light:{display:300,heading:400,title:400,ui:400,button:400,body:400,strong:600},standard:{display:600,heading:500,title:500,ui:400,button:500,body:400,strong:600},bold:{display:700,heading:700,title:700,ui:400,button:600,body:400,strong:700}},aP=Object.keys(Bc.standard).map(e=>`--site-weight-${e}`),rP="--site-leading-body";function Qe(e,n){let i=[];for(let s=e;s<=n;s+=100)i.push(s);return i}var Uh={"Source Sans 3":Qe(200,900),"Space Grotesk":Qe(300,700),Manrope:Qe(200,800),"IBM Plex Sans":Qe(100,700),Oswald:Qe(200,700),"Bebas Neue":[400],"Playfair Display":Qe(400,900),Lora:Qe(400,700),"Cormorant Garamond":Qe(300,700),"JetBrains Mono":Qe(100,800),"IBM Plex Mono":[400,500,600,700],"DM Sans":Qe(100,1e3)};function fo(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var Fh=new Set(Object.entries(ht).flatMap(([e,n])=>[fo(e),fo(n.import)]));function bo(e){if(!(e in ht)&&!Fh.has(fo(e)))return null;let n=nn(e);return ht[n].download===!1?null:Uh[n]??Qe(100,900)}function zc(e,n){return!n||n.length===0?e:n.reduce((i,s)=>Math.abs(s-e)<Math.abs(i-e)?s:i,n[0])}function cP(e,n){let i=Bc[e??Ni],s=n?.heading?bo(n.heading):null,o=n?.body?bo(n.body):null,a={};for(let c of Object.keys(i)){let r=Mh.has(c)?s:o;a[`--site-weight-${c}`]=String(zc(i[c],r))}return a}function mP(e){return/^(zh|ja|ko)(?:[-_]|$)/i.test(e??"")?"1.75":"1.5"}function lP(e,n){let i=bo(e);return[...new Set(n.map(o=>zc(o,i)))].sort((o,a)=>o-a).map(String)}var on="/* <cms-builder:site-design-notes>",Kt="</cms-builder:site-design-notes> */",yo="palette-inputs: ",xo="type-inputs: ",At=sn.string().min(1).max(40),Eo=sn.object({primarySource:sn.enum(["user","derived"]),neutral:At.optional(),foreground:At.optional(),supporting:sn.array(At).max(4).optional(),imagePalette:sn.object({background:At.optional(),foreground:At.optional(),card:At.optional(),muted:At.optional(),border:At.optional()}).optional()}),Gh=sn.object({weightStyle:qe}),qh=e=>e.replaceAll("*/","* /").replace(/\s+/g," ").trim();function Wh(e){let n=e.lines.map(qh).filter(Boolean).map(i=>` ${i}`);return e.paletteInputs&&n.push(` ${yo}${JSON.stringify(e.paletteInputs).replaceAll("*/","* /")}`),e.typeInputs&&n.push(` ${xo}${JSON.stringify(e.typeInputs).replaceAll("*/","* /")}`),[on,...n,` ${Kt}`].join(`
|
|
2
|
-
`)}function Ro(e){let n=e.indexOf(on),i=e.indexOf(Kt,n+1);return n===-1||i===-1?null:{start:n,end:i+Kt.length}}function
|
|
1
|
+
import{z as t}from"zod";import{z as re}from"zod";import{z as F}from"zod";import{z as sd}from"zod";var Q=sd.uuidv7(),AT=Q,wT=Q,PT=Q,vT=Q,CT=Q,DT=Q,OT=Q,k=Q,$t=Q,ja=Q,Te=Q,bs=Q,A=Q,La=Q,V=Q,Ma=Q,tt=Q,ai=Q,ct=Q,NT=Q,jT=Q,ri=Q,nt=Q,Ua=Q,LT=Q,MT=Q,UT=Q,En=Q,FT=Q,GT=Q,qT=Q;var Fa=Q,ys=F.enum(["external_site_edit","page_template_create"]),od=200,Lt=F.string().min(1).max(od),ad=4e3,Ga=F.enum(["succeeded","degraded","no_changes","failed"]),Rn=F.enum(["typecheck_unresolved","step_cap_reached","partial_apply_gave_up","patch_protected_dropped","preview_build_failed","preview_runtime_degraded","build_not_verified","external_blocked","cms_reconcile_failed","run_expired","sandbox_unavailable"]),rd=["sandbox_unavailable"];function zT(e){return e!=null&&rd.includes(e)}var cd=F.enum(["pending","delivered","failed"]),md=F.enum(["running","succeeded","degraded","no_changes","failed"]),HT=F.object({site_id:k,external_run_id:Lt,external_thread_id:Lt,prompt:F.string().min(1).max(ad),thread_title:F.string().trim().min(1).max(200).optional()}).strict(),xs=F.enum(["added","modified","deleted"]),ld=F.enum(["landing_page","general_page","detail_page"]),pd=F.enum(["header","footer","styles","layout"]),qa={block_id:F.string().min(1),type:F.string().min(1),change:xs},Wa={slug:F.string().min(1),title:F.string().min(1),page_type:ld,change:xs},dd=F.object({kind:pd,change:xs}).strict(),Ka={site_wide:F.array(dd),unclassified_count:F.number().int().nonnegative()},ud=F.object(qa).strict(),_d=F.object({...Wa,sections:F.array(ud)}).strict(),gd=F.object({pages:F.array(_d),...Ka}).strict(),hd=F.object({...qa,label:F.string().min(1)}).strict(),Sd=F.object({page_id:F.number().int().positive().nullable(),...Wa,sections:F.array(hd)}).strict(),Ba=F.object({pages:F.array(Sd),...Ka}).strict(),VT={pages:[],site_wide:[],unclassified_count:0},$T=F.object({base_snapshot_id:A,target_snapshot_id:A}).strict(),YT=F.object({data:gd}).strict(),ci=F.object({id:Fa,execution_scene:ys.default("external_site_edit"),site_id:k,external_run_id:F.string().min(1).nullable(),external_thread_id:F.string().min(1).nullable(),status:md,outcome:Ga.nullable(),degraded_reason:Rn.nullable(),vcp_run_id:V.nullable(),vcp_thread_id:tt.nullable(),base_snapshot_id:A,snapshot_id:A.nullable(),preview_url:F.string().url().nullable(),summary:F.string().nullable(),error_code:F.string().nullable(),build_verified:F.boolean().nullable(),callback_status:cd.nullable(),created_at:F.string().min(1),started_at:F.string().min(1).nullable(),finished_at:F.string().min(1).nullable(),changes:Ba.nullable().default(null)}).strict().superRefine((e,n)=>{e.execution_scene==="page_template_create"?((e.external_run_id===null!=(e.external_thread_id===null)||e.callback_status!==null)&&n.addIssue({code:"custom",message:"Page Template tasks require paired external identities and no callback"}),(!["running","succeeded","failed"].includes(e.status)||e.outcome!==null&&!["succeeded","failed"].includes(e.outcome)||e.degraded_reason!==null)&&n.addIssue({code:"custom",message:"Page Template tasks require strict whole-batch outcomes"}),e.changes!==null&&n.addIssue({code:"custom",message:"Page Template tasks never carry changes"})):(!e.external_run_id||!e.external_thread_id||!e.callback_status)&&n.addIssue({code:"custom",message:"External edit tasks require external identity and callback status"})}),XT=F.object({task:ci}).strict(),QT=F.object({task:ci}).strict(),ZT=F.object({task_id:Fa,external_run_id:F.string().min(1),external_thread_id:F.string().min(1),site_id:k,vcp_run_id:V.nullable(),outcome:Ga,degraded_reason:Rn.nullable(),snapshot_id:A.nullable(),preview_url:F.string().url().nullable(),summary:F.string().nullable(),error_code:F.string().nullable(),build_verified:F.boolean().nullable(),retryable:F.boolean(),finished_at:F.string().min(1),changes:Ba.nullable().default(null)}).strict(),JT=F.object({received:F.literal(!0)}).strict();var $e=re.string().min(1).max(191).refine(e=>{if(/[^\x20-\x7e\xa0-\xff]/.test(e)||e.startsWith(" ")||e.endsWith(" ")||new TextEncoder().encode(e).length>191)return!1;try{return new Headers({"x-template-id":e}).get("x-template-id")===e}catch{return!1}},{message:"template_id must round-trip through HTTP headers and fit a 255-byte base64url filename"}),In=re.string().min(1).refine(e=>e.startsWith("/")&&!e.startsWith("//")&&!/[?#\\\x00-\x20\x7f]/.test(e)&&!e.startsWith("/.vcp")&&!e.split("/").some(n=>{try{let i=decodeURIComponent(n);return i==="."||i===".."||/[/\\\x00-\x1f\x7f]/.test(i)||i.startsWith(".vcp")}catch{return!0}}),{message:"page_path must start with / and must not contain ? or #"});function za(e){return/^\[\[\.\.\.[^\[\]]+\]\]$|^\[[^\[\]]+\]$/.test(e)}function mi(e){let n=/^(?:src\/)?app\/\.vcp\/page-templates\/(.+)\/page\.tsx$/.exec(e);if(!n)return!1;let i=n[1].split("/"),s=i.some(za),o=s?i[0]:i.pop(),a=s?i.slice(1):i;if(s&&a.length===0||!/^[A-Za-z0-9_-]{1,255}$/.test(o)||!In.safeParse(`/${a.join("/")}`).success||a.some(c=>c?c.includes("[")||c.includes("]")?!za(c):/[\[\]()%]/.test(c)||c.startsWith("_")||c.startsWith("@"):!0))return!1;try{let c=atob(o.replace(/-/g,"+").replace(/_/g,"/")),r=Uint8Array.from(c,S=>S.charCodeAt(0)),m=new TextDecoder("utf-8",{fatal:!0}).decode(r);return $e.safeParse(m).success&&btoa(String.fromCharCode(...new TextEncoder().encode(m))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")===o}catch{return!1}}var Ha=re.object({page_path:In,template_id:$e,instruction:re.string().min(1).refine(e=>e.trim().length>0)}).strict(),Va=3;function $a(e){return e.replace(/\/+$/,"")||"/"}var sk=re.object({external_run_id:Lt,external_thread_id:Lt,items:re.array(Ha).min(1).max(Va)}).strict().transform(e=>({external_run_id:e.external_run_id,external_thread_id:e.external_thread_id,items:e.items.map(n=>({...n,page_path:$a(n.page_path)}))})).superRefine((e,n)=>{let i=new Set;e.items.forEach((s,o)=>{let a=JSON.stringify([s.page_path,s.template_id]);i.has(a)&&n.addIssue({code:"custom",path:["items",o],message:"Duplicate normalized page_path/template_id identity"}),i.add(a)})}),Ya=re.object({items:re.array(Ha).min(1).max(Va)}).strict().refine(e=>e.items.every(n=>n.page_path===$a(n.page_path))&&new Set(e.items.map(n=>JSON.stringify([n.page_path,n.template_id]))).size===e.items.length,{message:"Batch Manifest must contain unique normalized identities"}),Xa=e=>[...new Set(e)],ok=re.object({page_path:In,template_id:$e,exit_template_ids:re.array($e).default([]).transform(Xa)}).strict().refine(e=>!e.exit_template_ids.includes(e.template_id),{path:["exit_template_ids"],message:"exit_template_ids must not contain the promoted template"}),ak=re.object({page_path:In,template_ids:re.array($e).min(1).transform(Xa)}).strict(),Qa={ok:re.literal(!0),site_id:k,page_path:In,route_id:re.string().min(1),snapshot_id:A},fd=ci.safeExtend({execution_scene:re.literal("page_template_create"),external_run_id:Lt,external_thread_id:Lt,callback_status:re.null(),status:re.enum(["running","succeeded","failed"]),outcome:re.enum(["succeeded","failed"]).nullable(),degraded_reason:re.null(),changes:re.null().default(null)}),rk=re.object({task:fd}).strict(),ck=re.object({...Qa,promoted_template_id:$e,deleted_template_ids:re.array($e),status:re.literal("promoted")}).strict(),mk=re.object({...Qa,deleted_template_ids:re.array($e),status:re.literal("cleaned")}).strict(),lk=re.enum(["PAGE_TEMPLATE_REQUEST_INVALID","PAGE_TEMPLATE_PAGE_NOT_FOUND","PAGE_TEMPLATE_NOT_FOUND","PAGE_TEMPLATE_ALREADY_EXISTS","PAGE_TEMPLATE_ID_COLLISION","PAGE_TEMPLATE_MANAGED_SOURCE_INVALID","PAGE_TEMPLATE_SNAPSHOT_CONFLICT","PAGE_TEMPLATE_SOURCE_UNSUPPORTED","PAGE_TEMPLATE_GENERATION_FAILED","PAGE_TEMPLATE_PATCH_FAILED"]);import{z as li}from"zod";var Za=li.object({primary_products:li.string().trim().min(1).max(1e3).optional(),current_markets:li.string().trim().min(1).max(1e3).optional(),qualifications:li.string().trim().min(1).max(1e3).optional()}).strict();function uk(e){return Object.values(e).some(n=>typeof n=="string"&&n.trim().length>0)}import{z as mt}from"zod";var Ja={autoplay:mt.boolean().optional(),intervalMs:mt.number().int().min(5e3).max(15e3).optional(),loop:mt.boolean().optional()},pi=mt.discriminatedUnion("kind",[mt.object({kind:mt.literal("media-carousel"),presentation:mt.enum(["flat","angled"]).optional(),...Ja}).strict(),mt.object({kind:mt.literal("category-carousel"),...Ja}).strict()]);import{z as Tn}from"zod";var bd=40,Mt=Tn.object({protocol:Tn.enum(["phone","form","download","route","external"]),ctaLabel:Tn.string().min(1).max(bd),ctaTarget:Tn.string().min(1).max(200).optional(),requiresOwnerDetail:Tn.boolean().optional()});var Yt=["queued","preparing_source","building","artifact_ready","deploying","released","lock_failed","source_prepare_failed","build_failed","artifact_fetch_failed","artifact_validation_failed","deploy_failed","cleanup_failed"];function bk(e){let n=e.VCP_REDIS_URL??e.REDIS_URL;if(n){let i=new URL(n);return{url:n,host:i.hostname,port:i.port?Number(i.port):6379,password:i.password?decodeURIComponent(i.password):void 0}}return{host:e.VCP_REDIS_HOST??"127.0.0.1",port:yd(e.VCP_REDIS_PORT,56379)}}function yd(e,n){if(!e)return n;let i=Number(e);return Number.isInteger(i)&&i>0?i:n}import{z as oe}from"zod";var xd=oe.enum(["component","page","shared"]),Ed=oe.enum(["generation_failed","repair_exhausted","page_unusable","check_incomplete","design_missing","chrome_fallback","style_fallback","resume_exhausted","user_stopped","conflict"]),er=oe.object({kind:xd,target_id:oe.string().min(1),page_id:oe.string().min(1).nullable(),reason:Ed,repair_attempts:oe.number().int().nonnegative(),message:oe.string().min(1),filled:oe.boolean().optional()}).strict(),Rd=oe.enum(["complete","partial","omitted","check_incomplete","pending"]),Id=oe.object({page_id:oe.string().min(1),slug:oe.string().min(1),title:oe.string().min(1),parent_page_id:oe.string().min(1).nullable(),result:Rd,attempts:oe.number().int().nonnegative(),omissions:oe.array(er)}).strict(),kn=oe.object({schema_version:oe.literal(1),sitemap_id:oe.string().min(1),confirmed_page_ids:oe.array(oe.string().min(1)).min(1),pages:oe.array(Id),shared:oe.array(er),stopped_by_user:oe.boolean(),resume_count:oe.number().int().nonnegative(),home_replaced_by:oe.string().min(1).nullable(),updated_at:oe.string().min(1)}).strict(),tr=oe.object({type:oe.literal("workspace.generation_ledger"),ledger:kn,at:oe.string().min(1)}).strict();function Ek(e){return e.pages.filter(n=>n.result==="complete"||n.result==="partial").length}function Rk(e){return e.pages.filter(n=>n.result==="complete"||n.result==="partial"||n.omissions.some(i=>i.kind==="page")).length}import{z as U}from"zod";var Es=U.enum(["text","url","document","image"]),Rs=U.enum(["pending","ready","failed"]),Td=U.enum(["pending","ready","failed"]),kd=U.enum(["product","price","contact","copy","audience","other"]),di=U.object({fact:U.string().min(1).max(300),kind:kd,source_id:En,quote:U.string().min(1).max(500),trust:U.enum(["verbatim","ocr"]).default("verbatim")}),Ad=U.object({page_type:U.string().min(1).max(40),sections:U.array(U.string().min(1).max(40)).max(12)}),ui=U.object({source_id:En,nav_structure:U.array(U.string().min(1).max(30)).max(12),page_patterns:U.array(Ad).max(10),tone:U.array(U.string().min(1).max(20)).max(8),screenshot_ref:U.string().optional()}),wd=U.object({source_id:En,type:Es,status:Rs,title:U.string().max(120).optional(),original_ref:U.string().min(1),source_metadata:U.record(U.string(),U.unknown()),error_code:U.string().optional(),submitted:U.boolean().optional()}),_i=U.object({topic:U.string().min(1).max(80),variants:U.array(U.object({value:U.string().min(1).max(300),source_id:En})).min(2)}),Pd=U.object({type:U.literal("text"),content:U.string().min(20).max(1e4),title:U.string().min(1).max(120).optional()}).strict(),vd=U.object({type:U.literal("url"),url:U.string().url().max(2048),rights_ack:U.boolean().optional(),title:U.string().min(1).max(120).optional()}).strict(),Ak=U.discriminatedUnion("type",[Pd,vd]),wk=[".docx",".html",".md",".txt"],Pk=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/html","text/markdown","text/x-markdown","text/plain","application/octet-stream"],vk=10*1024*1024,Ck=2,Dk=U.object({consent_cross_border:U.union([U.literal(!0),U.literal("true")]),consent_text_version:U.string().min(1).max(120),title:U.string().min(1).max(120).optional()}).strict();function Ok(e){return e===!0||e==="true"}var Nk=[".png",".jpg",".jpeg",".webp"],jk=["image/png","image/jpeg","image/webp","application/octet-stream"],Lk=8*1024*1024,Mk=10,Cd=U.enum(["asset","reference"]),Uk=U.object({image_role:Cd,title:U.string().min(1).max(120).optional()}).strict(),Fk=U.object({version:U.literal(1),site_id:k,tenant_id:U.string().min(1),user_prompt:U.string(),status:Td,sources:U.array(wd).max(16),facts:U.array(di).max(120),reference:ui.optional(),conflicts:U.array(_i).max(20)}).superRefine((e,n)=>{let i=new Map(e.sources.map(s=>[s.source_id,s]));for(let[s,o]of e.facts.entries()){let a=i.get(o.source_id);(!a||a.type==="url")&&n.addIssue({code:"custom",path:["facts",s,"source_id"],message:"facts must reference a text/document/image source (never url)"})}if(e.reference){let s=i.get(e.reference.source_id),o=s?.type==="image"&&s.source_metadata.image_role==="reference";(!s||s.type!=="url"&&!o)&&n.addIssue({code:"custom",path:["reference","source_id"],message:"reference must point at a url source or reference image source"})}});function Gk(e){for(let n of e.sources)if(n.type==="image"&&n.status==="ready"&&n.source_metadata?.image_role==="reference")return{source_id:n.source_id};return e.reference?.screenshot_ref?{source_id:e.reference.source_id}:null}import{z as j}from"zod";import{z as gi}from"zod";var _e=gi.object({routeId:gi.string().min(1),templateId:$e.optional()}).strict(),B=gi.object({routeId:gi.string().min(1),effectiveTemplateId:$e.optional()}).strict();function Is(e){return JSON.stringify([e.routeId,e.effectiveTemplateId??null])}function Bk(e){let n;try{n=JSON.parse(e)}catch{return null}if(!Array.isArray(n)||n.length!==2)return null;let[i,s]=n,o=B.safeParse(s===null?{routeId:i}:{routeId:i,effectiveTemplateId:s});return o.success?o.data:null}var Dd=["design.md","DESIGN.md"],nr=["components/site","src/components/site","lib/generated","src/lib/generated","public"],Od=["components/system/not-found-content.tsx","src/components/system/not-found-content.tsx"],Nd=["app/globals.css","src/app/globals.css"],jd=[".cjs",".css",".cts",".html",".js",".json",".jsx",".md",".mdx",".mjs",".mts",".ts",".tsx",".txt",".yaml",".yml"],Ld=new Set(jd),Ts="source-delete",ir=j.literal(Ts),xe=j.string().min(1).refine(or,"Invalid site edit source path"),Md=j.string().min(1).refine(zd,"Invalid site edit source directory path"),Yk=j.enum(["text","binary"]),hi=j.object({composition:B,path:xe,language:j.string().min(1).nullable(),sizeBytes:j.number().int().nonnegative(),contentHash:j.string().min(1).optional()}).strict(),Ud=j.discriminatedUnion("kind",[hi.extend({kind:j.literal("text"),language:j.string().min(1),readonly:j.boolean().default(!1)}),hi.extend({kind:j.literal("binary"),language:j.null(),mimeType:j.string().min(1).optional(),readonly:j.literal(!0)})]),sr=j.lazy(()=>j.discriminatedUnion("kind",[j.object({kind:j.literal("directory"),name:j.string().min(1),path:Md,children:j.array(sr)}),j.object({kind:j.literal("file"),name:j.string().min(1),path:xe,file:Ud}).superRefine((e,n)=>{e.path!==e.file.path&&n.addIssue({code:"custom",path:["file","path"],message:"file.path must match node path"})})])),Fd=j.enum(["max-files","max-depth","max-total-bytes"]),Gd=j.object({reasons:j.array(Fd).min(1),maxFiles:j.number().int().positive(),maxDepth:j.number().int().positive(),maxTotalBytes:j.number().int().positive()}),Xk=j.object({composition:B,nodes:j.array(sr),defaultPath:xe.optional(),totalFiles:j.number().int().nonnegative(),truncated:Gd.optional()}).strict(),Qk=j.object({composition:_e}).strict(),Zk=j.object({path:xe,composition:_e}).strict(),qd=hi.extend({kind:j.literal("text"),language:j.string().min(1),readonly:j.boolean().default(!1),content:j.string()}),Wd=j.enum(["too-large","unsupported-mime","bytes-unavailable"]),Kd=hi.extend({kind:j.literal("binary"),language:j.null(),readonly:j.literal(!0),mimeType:j.string().min(1),contentBase64:j.string().min(1).optional(),previewUnavailableReason:Wd.optional()}),Jk=j.discriminatedUnion("kind",[qd,Kd]),e0=j.object({key:j.string().min(1),composition:_e}).strict(),Bd=j.object({startLine:j.number().int().positive(),startColumn:j.number().int().nonnegative(),endLine:j.number().int().positive(),endColumn:j.number().int().nonnegative()}),t0=j.object({key:j.string().min(1),composition:B,sourceFile:xe,componentName:j.string().min(1),openingElementRange:Bd,structuralPath:j.string().min(1),textPreview:j.string().min(1).optional()}).strict();function or(e){return!Si(e)&&!Vd(e)||mr(e)?!1:ws(e)||cr(e)||rr(e)||ar(e)||nr.some(n=>e===n||e.startsWith(`${n}/`))}function ks(e){return ws(e)||Ld.has(Yd(e))}function zd(e){return!Si(e)&&!$d(e)||mr(e)?!1:e==="app"||e.startsWith("app/")||e==="src"||e==="src/app"||e.startsWith("src/app/")||nr.some(n=>e===n||e.startsWith(`${n}/`)||n.startsWith(`${e}/`))}function Hd(e){return ws(e)}function As(e){return or(e)?Hd(e)?"design-document":rr(e)?"route-entry":cr(e)?"app-global-style":e.toLowerCase()==="lib/generated/media-assets.ts"||e.toLowerCase()==="src/lib/generated/media-assets.ts"?"generated-media-manifest":ar(e)?"system-page":null:null}function ar(e){return Od.includes(e)}function n0(e){return As(e)!==null}function rr(e){return/^(?:src\/)?app\/(?:.*\/)?page\.[cm]?[jt]sx?$/.test(e.toLowerCase())}function Vd(e){return mi(e)&&Si(e.replace("/.vcp/","/_vcp/"))}function $d(e){return/^(?:src\/)?app\/\.vcp(?:\/page-templates(?:\/.+)?)?$/i.test(e)?Si(e.replace("/.vcp","/_vcp")):!1}function cr(e){return Nd.some(n=>n.toLowerCase()===e.toLowerCase())}function Yd(e){let n=e.split("/").at(-1)??e,i=n.lastIndexOf(".");return i>0?n.slice(i).toLowerCase():""}function ws(e){return!e.includes("/")&&Dd.some(n=>n.toLowerCase()===e.toLowerCase())}function mr(e){let n=e.toLowerCase(),i=n.split("/"),o=(i.at(-1)??n).replace(/\.[^.]+$/,"");return/^(?:src\/)?app\/api(?:\/|$)/.test(n)||/^(?:src\/)?app\/(?:.*\/)?route\.[cm]?[jt]sx?$/.test(n)||/^(?:src\/)?app\/(?:.*\/)?(?:action|actions)\.[cm]?[jt]sx?$/.test(n)||/(^|\/)[^/]+\.server\.[cm]?[jt]sx?$/.test(n)||n==="lib/server"||n.startsWith("lib/server")||n==="src/lib/server"||n.startsWith("src/lib/server")||n==="lib/db"||n.startsWith("lib/db")||n==="src/lib/db"||n.startsWith("src/lib/db")||n==="lib/cms"||n.startsWith("lib/cms/")||n==="src/lib/cms"||n.startsWith("src/lib/cms/")?!0:o==="server"||o==="db"||o==="database"||o==="auth"||o==="secret"||o==="secrets"||o==="token"||o==="tokens"||o==="credential"||o==="credentials"||i.includes("server")||i.includes("secrets")}function Si(e){return!e||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>!(n.length===0||n==="."||n===".."||n.startsWith(".")||n==="package.json"||n==="node_modules"||n==="recipes"||n.startsWith(".env")))}import{z as Xd}from"zod";var An=["zh-CN","zh-HK","zh-TW","en-US","en-GB","ja-JP","ko-KR","es-ES","fr-FR","de-DE","pt-PT","ru-RU","ar-SA","id-ID","vi-VN","th-TH","it-IT","nl-NL","tr-TR","pl-PL","uk-UA","cs-CZ","sk-SK","hu-HU","ro-RO","el-GR","sv-SE","da-DK","fi-FI","hr-HR","lt-LT","lv-LV","et-EE","ga-IE","mt-MT","ka-GE","fa-IR","bn-BD","ta-IN","si-LK","ms-MY","fil-PH","my-MM","km-KH","lo-LA","mn-MN","kk-KZ"],Qd=["en","ja","es","fr","de","ko","pt","pt-BR","it","ru","ar","hi","id","vi","th","tr","nl","pl","uk","sv","da","fi","no","cs","el","hu","ro","he","ms","fil","bn","ta","ca","sk","hr","bg","lt","lv","et","fa","sw","sr","is"],Zd=[...An,...Qd],Jd=new Set(["ar","fa","he"]),o0=[{code:"zh-CN",label:"\u7B80\u4F53\u4E2D\u6587",englishName:"Chinese (Simplified)"},{code:"zh-HK",label:"\u7E41\u9AD4\u4E2D\u6587\uFF08\u9999\u6E2F\uFF09",englishName:"Chinese (Traditional, Hong Kong)"},{code:"zh-TW",label:"\u7E41\u9AD4\u4E2D\u6587\uFF08\u53F0\u7063\uFF09",englishName:"Chinese (Traditional, Taiwan)"},{code:"en-US",label:"English (US)",englishName:"English (United States)",common:!0},{code:"en-GB",label:"English (UK)",englishName:"English (United Kingdom)",common:!0},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",englishName:"Japanese"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",englishName:"Korean"},{code:"es-ES",label:"Espa\xF1ol",englishName:"Spanish"},{code:"fr-FR",label:"Fran\xE7ais",englishName:"French"},{code:"de-DE",label:"Deutsch",englishName:"German"},{code:"pt-PT",label:"Portugu\xEAs",englishName:"Portuguese"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",englishName:"Russian"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",englishName:"Arabic"},{code:"id-ID",label:"Bahasa Indonesia",englishName:"Indonesian"},{code:"vi-VN",label:"Ti\u1EBFng Vi\u1EC7t",englishName:"Vietnamese"},{code:"th-TH",label:"\u0E44\u0E17\u0E22",englishName:"Thai"},{code:"it-IT",label:"Italiano",englishName:"Italian"},{code:"nl-NL",label:"Nederlands",englishName:"Dutch"},{code:"tr-TR",label:"T\xFCrk\xE7e",englishName:"Turkish"},{code:"pl-PL",label:"Polski",englishName:"Polish"},{code:"uk-UA",label:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",englishName:"Ukrainian"},{code:"cs-CZ",label:"\u010Ce\u0161tina",englishName:"Czech"},{code:"sk-SK",label:"Sloven\u010Dina",englishName:"Slovak"},{code:"hu-HU",label:"Magyar",englishName:"Hungarian"},{code:"ro-RO",label:"Rom\xE2n\u0103",englishName:"Romanian"},{code:"el-GR",label:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",englishName:"Greek"},{code:"sv-SE",label:"Svenska",englishName:"Swedish"},{code:"da-DK",label:"Dansk",englishName:"Danish"},{code:"fi-FI",label:"Suomi",englishName:"Finnish"},{code:"hr-HR",label:"Hrvatski",englishName:"Croatian"},{code:"lt-LT",label:"Lietuvi\u0173",englishName:"Lithuanian"},{code:"lv-LV",label:"Latvie\u0161u",englishName:"Latvian"},{code:"et-EE",label:"Eesti",englishName:"Estonian"},{code:"ga-IE",label:"Gaeilge",englishName:"Irish"},{code:"mt-MT",label:"Malti",englishName:"Maltese"},{code:"ka-GE",label:"\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8",englishName:"Georgian"},{code:"fa-IR",label:"\u0641\u0627\u0631\u0633\u06CC",englishName:"Persian"},{code:"bn-BD",label:"\u09AC\u09BE\u0982\u09B2\u09BE",englishName:"Bengali"},{code:"ta-IN",label:"\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD",englishName:"Tamil"},{code:"si-LK",label:"\u0DC3\u0DD2\u0D82\u0DC4\u0DBD",englishName:"Sinhala"},{code:"ms-MY",label:"Bahasa Melayu",englishName:"Malay"},{code:"fil-PH",label:"Filipino",englishName:"Filipino"},{code:"my-MM",label:"\u1019\u103C\u1014\u103A\u1019\u102C",englishName:"Burmese"},{code:"km-KH",label:"\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A",englishName:"Khmer"},{code:"lo-LA",label:"\u0EA5\u0EB2\u0EA7",englishName:"Lao"},{code:"mn-MN",label:"\u041C\u043E\u043D\u0433\u043E\u043B",englishName:"Mongolian"},{code:"kk-KZ",label:"\u049A\u0430\u0437\u0430\u049B",englishName:"Kazakh"}],eu={en:"en-US",ja:"ja-JP",es:"es-ES",fr:"fr-FR",de:"de-DE",ko:"ko-KR",pt:"pt-PT",it:"it-IT",ru:"ru-RU",ar:"ar-SA",id:"id-ID",vi:"vi-VN",th:"th-TH",tr:"tr-TR",nl:"nl-NL",pl:"pl-PL",uk:"uk-UA",sv:"sv-SE",da:"da-DK",fi:"fi-FI",cs:"cs-CZ",el:"el-GR",hu:"hu-HU",ro:"ro-RO",ms:"ms-MY",fil:"fil-PH",bn:"bn-BD",ta:"ta-IN",sk:"sk-SK",hr:"hr-HR",lt:"lt-LT",lv:"lv-LV",et:"et-EE",fa:"fa-IR"},tu=new Set(An);function lr(e){return tu.has(e)?e:eu[e]}var nu="en";function a0(e){let n=e.toLowerCase().split("-",1)[0]??"";return Jd.has(n)?"rtl":"ltr"}var iu={cmn:"zh-CN",eng:"en",jpn:"ja",spa:"es",fra:"fr",deu:"de",kor:"ko",por:"pt",ita:"it",rus:"ru",arb:"ar",ara:"ar",hin:"hi",ind:"id",vie:"vi",tha:"th",tur:"tr",nld:"nl",pol:"pl",ukr:"uk",swe:"sv",dan:"da",fin:"fi",nob:"no",nor:"no",ces:"cs",ell:"el",hun:"hu",ron:"ro",heb:"he",msa:"ms",zsm:"ms",tgl:"fil",ben:"bn",tam:"ta",cat:"ca",slk:"sk",hrv:"hr",bul:"bg",lit:"lt",lav:"lv",est:"et",pes:"fa",fas:"fa",swh:"sw",swa:"sw",srp:"sr",isl:"is"};function r0(e){return iu[e]??nu}var su=["zh-CN","zh-HK","zh-TW","ja-JP","ja","ko-KR","ko","ru-RU","ru","uk-UA","uk","bg","sr","mn-MN","kk-KZ","ar-SA","ar","fa-IR","fa","he","hi","th-TH","th","el-GR","el","ka-GE","bn-BD","bn","ta-IN","ta","si-LK","my-MM","km-KH","lo-LA"],ou=new Set(su);function c0(e){return ou.has(e)}var Ee=Xd.enum(Zd);import{z as au}from"zod";var pr=au.string().uuid();import{z as f}from"zod";import{z as ee}from"zod";var Et=ee.string().trim().min(1).max(128),Xt=ee.string().trim().min(1).max(500),ru=["\u4EA7\u54C1","\u90E8\u4EF6/\u8017\u6750","\u5E94\u7528\u65B9\u6848","\u5B9A\u5236/OEM","\u670D\u52A1","\u8D44\u8D28/\u80FD\u529B"],cu=ee.enum(ru),wn=ee.object({id:Et,keyword:ee.string().trim().min(1).max(255),business_id:Et,business_name:ee.string().trim().min(1).max(255),category:cu,selling_points:ee.string().trim().max(2e3),section_id:Et,content_usage:ee.enum(["product","category","solution","service","capability","article","faq"]),intent:Xt,semantic_group:Et,primary_business:ee.boolean(),monthly_volume:ee.number().int().min(1),keyword_difficulty:ee.number().min(0).max(100).nullable(),variants:ee.array(ee.string().trim().min(1).max(255)),source:ee.literal("semrush"),source_evidence:ee.array(Xt).min(1)}).strict(),Ps=ee.object({schema_version:ee.literal(1),snapshot_id:Et,dependency_hash:ee.string().regex(/^[a-f0-9]{64}$/),language:ee.string().trim().min(2).max(35),database:ee.string().regex(/^[a-z]{2}$/),generated_at:ee.string().datetime({offset:!0}),entries:ee.array(wn),candidates:ee.array(wn),search_result_ids:ee.array(Et).optional()}).strict().superRefine((e,n)=>{for(let i of["entries","candidates"]){let s=e[i];(new Set(s.map(o=>o.id)).size!==s.length||new Set(s.map(o=>o.keyword.normalize("NFKC").trim().toLowerCase())).size!==s.length)&&n.addIssue({code:"custom",path:[i],message:"\u5173\u952E\u8BCD\u4E0D\u80FD\u91CD\u590D"})}}),fi=ee.object({snapshot_id:Et,entry_ids:ee.array(Et).min(1)}).strict().superRefine((e,n)=>{new Set(e.entry_ids).size!==e.entry_ids.length&&n.addIssue({code:"custom",path:["entry_ids"],message:"\u5173\u952E\u8BCD\u4E0D\u80FD\u91CD\u590D"})}),u0=ee.object({expected_revision:ee.number().int().nonnegative(),business_subject:ee.string().trim().min(1).max(255)}).strict(),dr=ee.object({points:ee.array(Xt).length(3),comparison:ee.array(ee.object({dimension:Xt,recommended:Xt,alternative:Xt}).strict()).min(1).max(4)}).strict();var lt=f.string().trim().min(1).max(128),Ut=f.string().trim().min(1).max(200),Ye=f.string().trim().min(1).max(2e3),vs=f.string().trim().max(200),bi=f.string().regex(/^[a-f0-9]{64}$/),Cs=f.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),Qt=["market","persona","product","brand","competition","structure","language","keywords","risk"],De=Qt.length,mu=["keywords"],Pn=Qt.filter(e=>!mu.includes(e)),yi=Pn.length,xi=f.enum(Qt);function f0(e){return Pn.some(n=>n===e)}var Ei=xi,ur=["recommended","conservative","focused"],_r=f.enum(ur),vn=f.union([_r,f.literal("confirmed")]),Ri=f.enum(["single_country","regional_combination","multi_market"]),Ii=f.object({code:f.string().trim().regex(/^[A-Z]{2}$/),name_zh:Ut,name_en:Ut,region:Ut}).strict(),lu=f.object({id:_r,presentation:dr.nullish(),sections:f.array(f.object({id:f.string().trim().min(1).max(128),label:f.string().trim().min(1).max(200)}).strict()).max(30).optional(),label:Ut,note:Ye,impact:f.string().trim().max(500).nullish(),set_value:f.string().trim().max(500).nullish(),site_locale:Ee.nullish(),market_type:Ri.nullish(),markets:f.array(Ii).max(32).optional()}).loose(),pu=f.object({lead:f.string().trim().min(1).max(500),title:Ut,columns:f.array(f.string().trim().min(1).max(80)).min(1).max(8),rows:f.array(f.array(f.string().trim().max(500)).min(1).max(8)).max(100)}).strict().superRefine((e,n)=>{e.rows.forEach((i,s)=>{i.length!==e.columns.length&&n.addIssue({code:"custom",path:["rows",s],message:"Each Step5 plan row must match the column count."})})}),du=f.object({goal:Ye,issue:Ye,criteria:f.array(Ye).min(1).max(12),resources:f.array(Ye).min(1).max(12),risks:f.array(Ye).min(1).max(12),execution:f.object({standard:f.array(Ye).min(1).max(12),acceptance:f.array(Ye).min(1).max(12),downstream:f.array(Ye).min(1).max(12)}).strict()}).strict(),uu=f.object({source_type:f.enum(["step2","step3"]),source_id:lt,field_path:f.string().trim().max(300).nullish()}).strict(),_u=f.enum(["ok","degraded"]),Ds=f.object({key:Ei,position:f.number().int().min(1).max(De),category:Ut,title:Ut,summary:Ye,rationale:Ye,parameter:f.string().trim().max(500).nullish(),options:f.array(lu).max(3),keyword_library:Ps.nullish(),plan:pu.nullish(),structure_detail:du.nullish(),note_tips:f.array(f.string().trim().min(1).max(200)).max(6),note_placeholder:f.string().trim().min(1).max(300),evidence_refs:f.array(uu).min(1).max(8),generation_status:_u.optional()}).loose().superRefine((e,n)=>{let i=Qt.indexOf(e.key)+1;i>0&&e.position!==i&&n.addIssue({code:"custom",path:["position"],message:`Step5 strategy ${e.key} uses an invalid position.`}),e.key!=="keywords"&&e.keyword_library&&n.addIssue({code:"custom",path:["keyword_library"],message:"Only the keywords card can carry an enterprise keyword library."}),e.options.length!==(e.key==="keywords"?0:3)&&n.addIssue({code:"custom",path:["options"],message:"Keywords use no options; ordinary cards require three options."}),e.options.forEach((s,o)=>{s.id!==ur[o]&&n.addIssue({code:"custom",path:["options",o,"id"],message:"Step5 strategy options must use the canonical order."})}),e.structure_detail&&e.key!=="structure"&&n.addIssue({code:"custom",path:["structure_detail"],message:"Structure detail is only valid for the structure item."})}),gu=f.object({item_key:xi,selected_option_id:vn,note:vs,keyword_selection:fi.optional()}).strict().superRefine((e,n)=>{(e.item_key==="keywords"?e.selected_option_id!=="confirmed"||e.note!==""||!e.keyword_selection:e.selected_option_id==="confirmed"||e.keyword_selection!==void 0)&&n.addIssue({code:"custom",message:"\u666E\u901A\u5361\u4EC5\u63A5\u53D7\u65B9\u6848\u4E0E\u5907\u6CE8\uFF1B\u4F01\u4E1A\u5173\u952E\u8BCD\u5E93\u4EC5\u63A5\u53D7\u5DF2\u751F\u6210\u5FEB\u7167\u4E2D\u7684\u5173\u952E\u8BCD ID"})}),Os=f.object({item_key:xi,selected_option_id:vn,note:vs,keyword_selection:fi.optional(),keyword_library:Ps.optional(),market_type:Ri.nullish(),markets:f.array(Ii).max(32).optional(),selected_value:f.unknown().nullable(),accepted_at:f.string().datetime({offset:!0})}).loose(),hu=f.enum(["running","succeeded","failed"]),Su=f.object({schema_version:f.literal(1),source_job_id:lt,site_id:lt,output_locale:Cs.optional(),items:f.array(Ds).length(De),decisions:f.array(Os).min(yi).max(De)}).loose(),fu=f.object({strategy_version_id:lt,site_id:lt,source_job_id:lt,output_locale:Cs.optional(),version:f.number().int().positive(),checksum:bi,snapshot:Su,committed_at:f.string().datetime({offset:!0})}).loose(),gr=f.object({job_id:lt,site_id:lt,output_locale:Cs.optional(),status:hu,keyword_library_needs_update:f.boolean().optional(),revision:f.number().int().nonnegative(),items:f.array(Ds).max(De),decisions:f.array(Os).max(De),output_checksum:bi.nullish(),error_code:f.string().trim().max(64).nullish(),error_message:f.string().trim().max(500).nullish(),committed_version:fu.nullish()}).loose().superRefine((e,n)=>{let i=e.items.map(o=>o.key);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["items"],message:"Step5 job items must have unique keys."});let s=e.decisions.map(o=>o.item_key);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 job decisions must have unique item keys."})}),b0=f.object({force_refresh:f.boolean().optional().default(!1)}).strict(),y0=gr.extend({cached:f.boolean()}).strict(),x0=f.object({expected_revision:f.number().int().nonnegative()}).strict(),E0=f.object({expected_revision:f.number().int().nonnegative(),selected_option_id:vn,note:vs,keyword_selection:fi.optional()}).strict().superRefine((e,n)=>{(e.selected_option_id==="confirmed"?!e.keyword_selection||e.note!=="":e.keyword_selection)&&n.addIssue({code:"custom",message:"\u4F01\u4E1A\u5173\u952E\u8BCD\u53EA\u63A5\u53D7\u5DF2\u751F\u6210\u6761\u76EE\u7684 ID\uFF1B\u666E\u901A\u7B56\u7565\u53EA\u63A5\u53D7\u65B9\u6848\u548C\u5907\u6CE8"})}),R0=f.object({revision:f.number().int().positive(),decision:Os}).strict(),I0=f.object({idempotency_key:f.string().trim().min(8).max(128),expected_revision:f.number().int().nonnegative(),decisions:f.array(gu).min(yi).max(De)}).strict().superRefine((e,n)=>{let i=e.decisions.map(s=>s.item_key);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 commit decisions must use unique strategy keys."}),Pn.forEach(s=>{i.includes(s)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 commit is missing ${s}.`})})}),T0=f.object({strategy_version_id:lt,version:f.number().int().positive(),checksum:bi,next_path:f.string().trim().min(1).max(500)}).strict(),bu=gr.extend({completed:f.number().int().min(0).max(De),total:f.literal(De)}).loose(),yu=["snapshot","strategy_item_start","strategy_item_done","strategy_items_invalidated","strategy_generation_done","failed"];function k0(e){return typeof e=="string"&&yu.includes(e)}var A0=f.discriminatedUnion("event",[f.object({id:f.number().int().nonnegative(),event:f.literal("snapshot"),data:bu}).strict(),f.object({id:f.number().int().positive(),event:f.literal("strategy_item_start"),data:f.object({key:xi,position:f.number().int().min(1).max(De)}).strict()}).strict(),f.object({id:f.number().int().positive(),event:f.literal("strategy_item_done"),data:f.object({item:Ds}).strict()}).strict(),f.object({id:f.number().int().positive(),event:f.literal("strategy_items_invalidated"),data:f.object({after_position:f.number().int().min(0).max(De)}).strict()}).strict(),f.object({id:f.number().int().positive(),event:f.literal("strategy_generation_done"),data:f.object({item_count:f.literal(De),schema_version:f.literal(1),checksum:bi}).strict()}).strict(),f.object({id:f.number().int().positive(),event:f.literal("failed"),data:f.object({code:f.string().trim().min(1).max(64),message:f.string().trim().min(1).max(500),retryable:f.boolean(),item_key:Ei.optional()}).loose()}).loose()]);import{z as xu}from"zod";var Xe=xu.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/);function v0(e,n){let i=Xe.safeParse(e),s=Xe.safeParse(n);if(!i.success||!s.success)return null;let o=hr(i.data),a=hr(s.data);for(let r=0;r<3;r+=1){let m=Sr(o.release[r],a.release[r]);if(m!==0)return m}if(!o.prerelease&&!a.prerelease)return 0;if(!o.prerelease)return 1;if(!a.prerelease)return-1;let c=Math.max(o.prerelease.length,a.prerelease.length);for(let r=0;r<c;r+=1){let m=o.prerelease[r],S=a.prerelease[r];if(m===void 0)return-1;if(S===void 0)return 1;if(m===S)continue;let g=/^\d+$/u.test(m),w=/^\d+$/u.test(S);return g&&w?Sr(BigInt(m),BigInt(S)):g?-1:w?1:Eu(m,S)}return 0}function hr(e){let n=e.indexOf("+"),i=n===-1?e:e.slice(0,n),s=i.indexOf("-"),o=s===-1?i:i.slice(0,s),a=s===-1?void 0:i.slice(s+1),[c,r,m]=o.split(".");return{release:[BigInt(c),BigInt(r),BigInt(m)],...a?{prerelease:a.split(".")}:{}}}function Sr(e,n){return e<n?-1:e>n?1:0}function Eu(e,n){return e<n?-1:e>n?1:0}import{z as Z}from"zod";import{z as ve}from"zod";var Ns=64,Ru=512*1024,js=4*1024*1024,Iu=/^(?!\/)(?!.*\\)(?!.*(?:^|\/)\.\.(?:\/|$))(?!.*\/\/).+/;function Tu(e){return Iu.test(e)}var fr=ve.string().min(1).refine(Tu,{message:"Materialization pathTemplate must be a safe relative path."}),ku=ve.object({pathTemplate:fr,content:ve.string(),role:ve.string().min(1).optional()}).strict(),Au=ve.union([ve.object({kind:ve.literal("default")}).strict(),ve.object({kind:ve.literal("named"),name:ve.string().min(1)}).strict()]),wu=ve.object({pathTemplate:fr,export:Au}).strict(),Pu=ve.array(ve.never()).optional(),Ft=ve.object({instanceBaseName:ve.string().min(1),files:ve.array(ku).min(1).max(Ns),entry:wu,dataRequirements:Pu}).strict().superRefine((e,n)=>{let i=new Set,s=e.entry.pathTemplate,o=0;for(let[a,c]of e.files.entries()){i.has(c.pathTemplate)&&n.addIssue({code:"custom",path:["files",a,"pathTemplate"],message:`Duplicate materialization pathTemplate: ${c.pathTemplate}`}),i.add(c.pathTemplate);let r=new TextEncoder().encode(c.content).length;r>Ru&&n.addIssue({code:"custom",path:["files",a,"content"],message:"Materialization file content exceeds the per-file byte limit."}),o+=r}i.has(s)||n.addIssue({code:"custom",path:["entry","pathTemplate"],message:"Materialization entry pathTemplate must match a file."}),o>js&&n.addIssue({code:"custom",path:["files"],message:"Materialization exceeds the total content byte limit."})});var br="insertNewComponent",L0={categoryGroupMissing:"DESIGNER_COMPONENT_CATEGORY_GROUP_MISSING",unavailable:"DESIGNER_COMPONENT_LIBRARY_UNAVAILABLE",timeout:"DESIGNER_COMPONENT_LIBRARY_TIMEOUT",invalidResponse:"DESIGNER_COMPONENT_LIBRARY_INVALID_RESPONSE",incompatibleResource:"DESIGNER_COMPONENT_RESOURCE_INCOMPATIBLE"},Ls=Z.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),yr=Z.lazy(()=>Z.object({id:Z.string().uuid(),key:Z.string().min(1),name:Z.string(),children:Z.array(yr)}).strict()),xr=Z.object({category_group_key:Z.literal(br),categories:Z.array(yr)}).strict(),vu=Z.object({resource_id:Z.string().min(1),name:Z.string(),description:Z.string().nullable(),thumbnail_url:Z.string().nullable(),resolved_version:Ls,category_id:Z.string().uuid().nullable()}).strict(),Er=Z.object({category_group_key:Z.literal(br),items:Z.array(vu),next_cursor:Z.string().min(1).nullable()}).strict(),M0=Z.object({resource_id:Z.string().min(1),resolved_version:Ls,anchor_block_id:Z.string().min(1),placement:Z.enum(["before","after"])}).strict(),U0=Z.object({status:Z.literal("mock_acknowledged")}).strict(),F0=Z.object({category_id:Z.string().uuid().optional(),include_descendants:Z.enum(["true","false"]).optional().transform(e=>e==="true"),limit:Z.coerce.number().int().min(1).max(100).optional().default(20),cursor:Z.string().min(1).optional()}).strict().superRefine((e,n)=>{e.include_descendants&&!e.category_id&&n.addIssue({code:"custom",message:"include_descendants requires category_id"})}),Gt=Ls,G0=Z.object({version:Gt}).strict(),Rr=Z.object({resource_id:Z.string().min(1),resolved_version:Gt,revision_id:Z.string().uuid().optional(),digest_sha256:Z.string().regex(/^[a-f0-9]{64}$/),materialization:Ft}).strict();import{z as R}from"zod";import{z as h}from"zod";var Ar="/",wr=255,Cu=5e3,Du=64;function Ou(e){if(!e.startsWith("/")||e.includes("//")||/[?#\\\s\u0000-\u001f\u007f]/u.test(e))return!1;try{let n=decodeURIComponent(e);return n.includes("//")||/[?#\\\s\u0000-\u001f\u007f]/u.test(n)||n.split("/").length!==e.split("/").length||/%25/iu.test(e)?!1:n.split("/").every(i=>![".",".."].includes(i))}catch{return!1}}var pt=h.string().min(1).max(wr).refine(Ou,"url_path must be a safe site-relative path"),Fs=h.string().max(wr),Ti=h.preprocess(e=>e===0?!1:e===1?!0:e,h.boolean()),Cn=h.union([h.url(),pt]),Gs=h.enum(["landing_page","general_page","detail_page"]),qs=h.enum([...Gs.options,"list_page","category_page","tag_page","author_page","search_page","date_page"]);function B0(e){return e.vcp_managed&&e.url!==null&&Gs.safeParse(e.page_type).success&&pt.safeParse(e.url_path).success}function Ir(e){return e.includes("{")||e.includes("}")}function z0(e){if(!Ir(e.url_path))return Tr(e.url_path);if(e.url===null)return null;let n=/^[a-z][a-z0-9+.-]*:\/\//iu.test(e.url)?Nu(e.url):e.url;return n===null||Ir(n)?null:Tr(n)}function Tr(e){let n=pt.safeParse(e);return n.success?n.data:null}function Nu(e){try{return new URL(e).pathname}catch{return null}}var Pr=h.lazy(()=>h.object({cms_page_id:h.number().int().positive(),title:h.string().trim().min(1).max(255),url_path:Fs,url:Cn.nullable(),page_type:qs,vcp_managed:Ti,children:h.array(Pr)}).strict()),ju=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),collection_slug:h.string(),pages:h.array(Pr)}).strict(),kr=h.object({groups:h.array(ju)}).strict(),vr=h.lazy(()=>h.object({id:h.number().int().positive(),title:h.string().trim().min(1).max(120),url_path:Fs,parent_id:h.number().int().nonnegative(),group_type:h.string().min(1),page_type:qs,plugin_id:h.number().int().nonnegative(),is_default:Ti,is_published:Ti,url:Cn.nullable(),vcp_managed:Ti,children:h.array(vr)})),Lu=h.object({plugin_id:h.number().int().nonnegative(),slug:h.string(),group_name:h.string().trim().min(1).max(255),pages:h.array(vr)}).passthrough(),Mu=h.array(Lu);function Cr(e){return{cms_page_id:e.id,title:e.title,url_path:e.url_path,url:e.url,page_type:e.page_type,vcp_managed:e.vcp_managed,children:e.children.map(n=>Cr(n))}}function H0(e){if(!Uu(e))return null;let n=kr.safeParse(e);if(n.success)return n.data;let i=Mu.safeParse(e);if(!i.success)return null;let s=kr.safeParse({groups:i.data.map(o=>({group_id:String(o.plugin_id),title:o.group_name,collection_slug:o.slug,pages:o.pages.map(Cr)}))});return s.success?s.data:null}function Uu(e){let n=Array.isArray(e)?e:Ms(e)&&Array.isArray(e.groups)?e.groups:[],i=[];for(let o of n)if(!(!Ms(o)||!Array.isArray(o.pages)))for(let a of o.pages)i.push({node:a,depth:1});let s=0;for(;i.length>0;){let o=i.pop();if(s+=1,s>Cu||o.depth>Du)return!1;if(!(!Ms(o.node)||!Array.isArray(o.node.children)))for(let a of o.node.children)i.push({node:a,depth:o.depth+1})}return!0}function Ms(e){return typeof e=="object"&&e!==null}var Fu=h.enum(["invalid_url_path","missing_url","not_vcp_managed","unsupported_page_type","page_not_generated"]),Gu=h.enum(["home_page","invalid_url_path","not_selectable","not_vcp_managed","page_has_children","last_selectable_page","cms_unbound","unsupported_page_type"]),Dr=h.lazy(()=>h.object({cms_page_id:h.number().int().positive().nullable(),title:h.string().trim().min(1).max(255),url_path:Fs,preview_url_path:pt.nullable(),url:Cn.nullable(),page_type:qs,vcp_managed:h.boolean(),selectable:h.boolean(),disabled_reason:Fu.nullable(),can_delete:h.boolean(),delete_block_reason:Gu.nullable(),has_cms_children:h.boolean(),children:h.array(Dr)}).strict()),Or=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),pages:h.array(Dr)}).strict(),V0=h.object({base_snapshot_id:A,expected_url_path:pt}).strict(),qu=h.enum(["succeeded","failed"]),Wu=h.object({url_path:pt,phase:h.enum(["ensure","binding","delete"]),code:h.string().min(1),message:h.string().min(1)}).strict(),Ws=h.object({status:qu,checked_count:h.number().int().nonnegative(),ensured_count:h.number().int().nonnegative(),deleted_count:h.number().int().nonnegative(),already_absent_count:h.number().int().nonnegative(),failed_pages:h.array(Wu),warnings:h.array(h.string().min(1))}).strict(),Ku=h.object({result_snapshot_id:A,deleted_files:h.array(h.string().min(1)),updated_files:h.array(h.string().min(1)),preserved_shared_files:h.array(h.string().min(1)),warnings:h.array(h.string().min(1)),next_url:Cn.nullable(),previous_url:Cn.nullable(),cms_reconcile_result:Ws}).strict(),$0=h.object({code:h.literal(0),message:h.string(),data:Ku}).strict(),Y0=h.object({snapshot_id:A}).strict(),Bu=h.object({snapshot_id:A,warnings:h.array(h.string().min(1)),cms_reconcile_result:Ws}).strict(),X0=h.object({code:h.literal(0),message:h.string(),data:Bu}).strict(),Q0=h.object({source_committed:h.boolean(),result_snapshot_id:A.optional(),cms_reconcile_result:Ws.optional()}).strict().superRefine((e,n)=>{e.source_committed&&!e.result_snapshot_id&&n.addIssue({code:"custom",path:["result_snapshot_id"],message:"committed source requires result_snapshot_id"})}),zu=Gs,Hu=h.object({title:h.string().min(1).max(255).optional(),description:h.string().min(1).max(1e3).optional(),keywords:h.string().min(1).max(255).optional(),meta_tags_json:h.record(h.string(),h.unknown()).optional(),schema_json:h.union([h.record(h.string(),h.unknown()),h.array(h.unknown())]).optional(),breadcrumbs_json:h.array(h.unknown()).optional()}).strict(),Nr=h.object({url_path:pt,title:h.string().trim().min(1).max(255),kind:zu,route_file:h.string().min(1),collection_id:h.string().trim().min(1).optional(),seo:Hu.optional()}).strict().superRefine((e,n)=>{e.kind==="detail_page"&&e.seo&&n.addIssue({code:"custom",path:["seo"],message:"detail_page target cannot carry seo (owned by the collection binding flow)"}),e.kind==="detail_page"&&!e.collection_id&&n.addIssue({code:"custom",path:["collection_id"],message:"detail_page target requires collection_id"}),e.kind!=="detail_page"&&e.collection_id&&n.addIssue({code:"custom",path:["collection_id"],message:`${e.kind} target cannot have collection_id`}),e.kind==="landing_page"!=(e.url_path===Ar)&&n.addIssue({code:"custom",path:["kind"],message:"The home target must be the only landing_page target."})}),Vu=h.object({complete:h.literal(!0),targets:h.array(Nr)}).strict().superRefine((e,n)=>{e.targets.length<1&&n.addIssue({code:"too_small",minimum:1,inclusive:!0,origin:"array",path:["targets"],message:"A complete page target set must contain at least one page."}),e.targets.filter(s=>s.url_path===Ar).length!==1&&n.addIssue({code:"custom",path:["targets"],message:"A complete page target set must contain exactly one home page."})}),Z0=h.discriminatedUnion("complete",[Vu,h.object({complete:h.literal(!1),targets:h.array(Nr),errors:h.array(h.string().min(1)).min(1)}).strict()]),Us=h.string().regex(/^sha256:[0-9a-f]{64}$/),J0=h.object({projection_hash:Us.nullable()}).strict(),eA=h.object({expected_projection_hash:Us.nullable(),projection_hash:Us}).strict(),tA=h.object({clean_snapshot_id:h.string().uuid().nullable()}).strict(),nA=h.object({clean_snapshot_id:h.string().uuid()}).strict();var jr="insertNewPage",cA={categoryGroupMissing:"DESIGNER_PAGE_CATEGORY_GROUP_MISSING",unavailable:"DESIGNER_PAGE_LIBRARY_UNAVAILABLE",timeout:"DESIGNER_PAGE_LIBRARY_TIMEOUT",invalidResponse:"DESIGNER_PAGE_LIBRARY_INVALID_RESPONSE",incompatibleResource:"DESIGNER_PAGE_RESOURCE_INCOMPATIBLE"},qt=R.enum(["page","pages"]),$u=R.object({resource_id:R.string().min(1),resource_type:qt,resolved_version:Gt,template_page_id:R.string().min(1)}).strict(),Lr=R.lazy(()=>R.object({id:R.string().uuid(),key:R.string().min(1),name:R.string(),children:R.array(Lr)}).strict()),Mr=R.object({category_group_key:R.literal(jr),categories:R.array(Lr)}).strict(),Yu=R.object({resource_id:R.string().min(1),resource_type:qt,name:R.string(),description:R.string().nullable(),thumbnail_url:R.string().nullable(),preview_images:R.array(R.object({url:R.string().min(1),page_id:R.string().min(1).nullable(),is_primary:R.boolean()}).strict()).optional(),resolved_version:Gt,category_id:R.string().uuid().nullable()}).strict(),Ur=R.object({category_group_key:R.literal(jr),items:R.array(Yu),next_cursor:R.string().min(1).nullable()}).strict(),mA=R.object({category_id:R.string().uuid().optional(),include_descendants:R.enum(["true","false"]).optional().transform(e=>e==="true"),limit:R.coerce.number().int().min(1).max(100).optional().default(20),cursor:R.string().min(1).optional()}).strict().superRefine((e,n)=>{e.include_descendants&&!e.category_id&&n.addIssue({code:"custom",message:"include_descendants requires category_id"})}),Dn=Gt,ki=R.string().regex(/^\/[a-z0-9]+(?:-[a-z0-9]+)*$/),lA=R.string().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),Xu=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:ki}).strict(),Qu=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),source:$u.optional(),blocks:R.array(R.discriminatedUnion("kind",[R.object({kind:R.literal("package-component"),instance_id:R.string().min(1),component_id:R.string().min(1),label:R.string().trim().min(1).max(120)}).strict(),R.object({kind:R.literal("component-resource"),instance_id:R.string().min(1),resource_id:R.string().min(1),resolved_version:Gt,label:R.string().trim().min(1).max(120)}).strict()])).optional(),route:R.object({input:R.string(),append_random_suffix:R.boolean().optional(),random_suffix_length:R.number().int().min(4).max(16).optional(),final:ki}).strict()}).strict(),Zu=R.object({resource_id:R.string().min(1),resource_type:qt,resolved_version:Dn,pages:R.array(Qu).min(1)}).strict().superRefine((e,n)=>{Rt(e.pages.map(i=>i.template_page_id),"pages",n),Rt(e.pages.map(i=>i.route.final),"routes",n);for(let[i,s]of e.pages.entries()){if(!s.blocks)continue;let o=new Set;for(let[a,c]of s.blocks.entries())o.has(c.instance_id)&&n.addIssue({code:"custom",path:["pages",i,"blocks",a,"instance_id"],message:`Duplicate block instance identifier within page: ${c.instance_id}`}),o.add(c.instance_id)}});function Ks(e,n){e.resource_type==="page"&&e.pages.length!==1&&n.addIssue({code:"custom",path:["pages"],message:"page resources must contain exactly one page"}),e.resource_type==="pages"&&e.pages.length<2&&n.addIssue({code:"custom",path:["pages"],message:"pages resources must contain at least two pages"})}function Rt(e,n,i){let s=new Set;for(let[o,a]of e.entries())s.has(a)&&i.addIssue({code:"custom",path:[n,o],message:`Duplicate ${n} identifier: ${a}`}),s.add(a)}var pA=R.object({resource_type:qt,version:Dn,pages:R.array(Xu).min(1)}).strict().superRefine((e,n)=>{Ks(e,n),Rt(e.pages.map(i=>i.template_page_id),"pages",n),Rt(e.pages.map(i=>i.final_route),"routes",n)}),Ju=R.object({instance_id:R.string().min(1),component_id:R.string().min(1)}).strict(),e_=R.object({component_id:R.string().min(1),materialization:Ft}).strict(),t_=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:ki,materialization:Ft,components:R.array(Ju)}).strict(),Bs=R.object({resource_id:R.string().min(1),resource_type:qt,resolved_version:Dn,revision_id:R.string().uuid().optional(),digest_sha256:R.string().regex(/^[a-f0-9]{64}$/),components:R.array(e_),pages:R.array(t_).min(1),project_dependencies:R.record(R.string(),R.never()).optional()}).strict().superRefine((e,n)=>{Ks(e,n);let i=e.components.map(o=>o.component_id),s=new Set(i);Rt(i,"components",n),Rt(e.pages.map(o=>o.template_page_id),"pages",n),Rt(e.pages.map(o=>o.final_route),"routes",n);for(let[o,a]of e.pages.entries()){let c=new Set;for(let[r,m]of a.components.entries())s.has(m.component_id)||n.addIssue({code:"custom",path:["pages",o,"components",r,"component_id"],message:`Unknown component reference: ${m.component_id}`}),c.has(m.instance_id)&&n.addIssue({code:"custom",path:["pages",o,"components",r,"instance_id"],message:`Duplicate component instance identifier within page: ${m.instance_id}`}),c.add(m.instance_id)}}),Fr=Bs,Gr=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:ki,route_file_path:R.string().regex(/^app\/[a-z0-9]+(?:-[a-z0-9]+)*\/page\.tsx$/)}).strict(),n_=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),composition_supported:R.boolean(),blocks:R.array(R.object({instance_id:R.string().min(1),component_id:R.string().min(1),label:R.string().trim().min(1).max(120)}).strict())}).strict(),qr=R.object({resource_id:R.string().min(1),resource_type:qt,resolved_version:Dn,pages:R.array(n_).min(1)}).strict().superRefine((e,n)=>{Ks(e,n),Rt(e.pages.map(i=>i.template_page_id),"pages",n)}),dA=R.object({resource_type:qt,version:Dn}).strict(),uA=R.object({draft:Zu}).strict(),Wr=R.object({groups:R.array(Or)}).strict(),Kr=R.object({candidate:R.record(R.string(),R.unknown())}).strict();var Zt="[a-z0-9]+(?:-[a-z0-9]+)*",On=new RegExp(`^/(?:${Zt}(?:/${Zt})*)?$`),Br=["/privacy","/cookie-policy","/system/not-found"],i_=Br.map(e=>`app/${e.slice(1)}/page.tsx`);function s_(e){return e.replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function zr(e){return typeof e=="string"&&On.test(e)}function Hr(e){if(typeof e!="string")return null;let n=e.trim();if(/[^\x00-\x7F]/.test(n))return null;let i=n.replace(/^\/+|\/+$/g,"");if(i==="")return"/";let s=i.split("/");if(s.some(r=>r==="."||r===".."))return null;let o=i.toLowerCase();if(o==="index"||o==="home")return"/";let a=s.map(s_).filter(r=>r.length>0);if(a.length===0)return null;let c=`/${a.join("/")}`;return zr(c)?c:null}function Vr(e){let n=Hr(e);if(n===null)throw new Error("Page slug must be an ASCII route without traversal segments.");return n}function o_(e){let n=Vr(e);return n==="/"?"app/page.tsx":`app/${n.slice(1)}/page.tsx`}import{z as ae}from"zod";import{z as u}from"zod";import{z as Oe}from"zod";var a_=Oe.object({code:Oe.string().min(1),message:Oe.string().min(1),details:Oe.record(Oe.string(),Oe.unknown()).optional()}),fA=Oe.object({code:Oe.string().min(1),message:Oe.string().min(1)});function zs(e){return Oe.object({ok:Oe.literal(!0),composition:B,data:e}).strict()}function r_(e){let n={ok:Oe.literal(!1),composition:B,error:a_.extend({code:e.codeSchema})};return e.currentSchema&&(n.current=e.currentSchema.optional()),e.diagnosticsSchema&&(n.diagnostics=Oe.array(e.diagnosticsSchema).optional()),e.dataSchema&&(n.data=e.dataSchema.optional()),Oe.object(n).strict()}function $r(e){return Oe.discriminatedUnion("ok",[zs(e.dataSchema),r_({codeSchema:e.codeSchema,currentSchema:e.currentSchema,diagnosticsSchema:e.diagnosticsSchema,dataSchema:e.failureDataSchema})])}import{z as te}from"zod";var dt=te.object({start:te.number().int().nonnegative(),end:te.number().int().nonnegative()}).superRefine((e,n)=>{e.end<e.start&&n.addIssue({code:"custom",path:["end"],message:"end must be greater than or equal to start"})}),c_=te.object({code:te.enum(["missing-class-name","unsupported-attribute-name","source-locator-warning","invalid-new-attr","version-conflict","write-failed"]),message:te.string().min(1)}),Yr=te.object({path:te.string().min(1),content:te.string(),hash:te.string().min(1).optional()}),RA=te.object({composition:B,revision:te.string().min(1),entryCss:Yr,stylesheets:te.array(Yr).default([])}).strict(),IA=te.object({composition:_e}).strict(),TA=te.object({key:te.string().min(1),composition:_e}).strict(),Xr=te.object({key:te.string().min(1),composition:B,filePath:te.string().min(1),componentName:te.string().min(1),sourceKind:te.enum(["missing","stringLiteral","expression"]),attrRaw:te.string().min(1).nullable(),valueRaw:te.string().min(1).nullable(),attrRange:dt.nullable(),openingElementRange:dt,version:te.object({documentVersion:te.number().int().nonnegative(),contentHash:te.string().min(1)}),diagnostics:te.array(c_),computedStyle:te.record(te.string(),te.string()).optional()}).strict().superRefine((e,n)=>{if(e.sourceKind==="missing"){(e.attrRaw!==null||e.valueRaw!==null||e.attrRange!==null)&&n.addIssue({code:"custom",message:"missing className source must not include attr raw or range"});return}(e.attrRaw===null||e.valueRaw===null||e.attrRange===null)&&n.addIssue({code:"custom",message:"present className source must include attr raw and ranges"})}),kA=Xr,AA=zs(Xr),Hs=te.object({source:te.enum(["style-panel","class-source-editor"]),operation:te.enum(["replace-static-classname","replace-expression","create-attribute","remove-attribute"])});import{z as it}from"zod";var m_=new Set(["children","key","ref","dangerouslysetinnerhtml"]),l_=new Set(["data-designer-hover-outline","data-designer-select-outline"]),p_=/^[A-Za-z_$][A-Za-z0-9_$:-]*$/u;function d_(e){return{code:"protected-attribute",message:`Property is protected from generic site editing: ${e}`}}function u_(){return{code:"invalid-attribute-name",message:"Property name must be a valid single JSX attribute name"}}function __(e){let n=e.toLowerCase();return m_.has(n)||n.startsWith("data-vcp-")||l_.has(n)||/^on[a-z]/iu.test(e)}function Vs(e){if(!p_.test(e))return{owner:"blocked",name:e,diagnostic:u_()};if(__(e))return{owner:"blocked",name:e,diagnostic:d_(e)};let n=e.toLowerCase();return n==="classname"||n==="class"?{owner:"class-name-source",name:e}:n==="style"?{owner:"style",name:e}:{owner:"generic",name:e}}import{z as ut}from"zod";var Wt=ut.lazy(()=>ut.union([ut.string(),ut.number().finite(),ut.boolean(),ut.null(),ut.array(Wt),ut.record(ut.string(),Wt)]));var Qr=it.string().min(1),g_=it.discriminatedUnion("operation",[it.object({operation:it.literal("set"),name:Qr,value:Wt}).strict(),it.object({operation:it.literal("remove"),name:Qr}).strict()]).superRefine((e,n)=>{let i=Vs(e.name);i.owner==="blocked"&&n.addIssue({code:"custom",path:["name"],message:i.diagnostic?.message??"Property is not available for site editing"})}),Zr=it.object({kind:it.literal("set-props"),scope:it.enum(["selection","template"]),changes:it.array(g_).min(1)}).strict().superRefine((e,n)=>{let i=new Map;for(let[s,o]of e.changes.entries()){let a=Vs(o.name),c=h_(a),r=i.get(c);r!==void 0?n.addIssue({code:"custom",path:["changes",s,"name"],message:`Duplicate property change; first declared at index ${r}`}):i.set(c,s)}});function h_(e){return e.owner==="class-name-source"||e.owner==="style"?`owner:${e.owner}`:`name:${e.name}`}import{z as S_}from"zod";var Jr=S_.enum(["src","alt","poster","href","width","height"]);import{z as Jt}from"zod";var Nn=Jt.object({editingSessionId:Jt.string().min(1),lockId:Jt.string().min(1),ownerId:Jt.string().min(1),leaseAssertion:Jt.string().min(1)}).strict(),FA="signed-designer-mutations-v1",GA=Jt.object({mutationContext:Nn}).strict();import{z as d}from"zod";import{z as jn}from"zod";var Ai="::",$s=jn.object({file:jn.string().min(1),component:jn.string().min(1),structuralPath:jn.string().min(1),key:jn.string().min(1)}).superRefine((e,n)=>{let i=f_(e.file,e.component,e.structuralPath);e.key!==i&&n.addIssue({code:"custom",path:["key"],message:"key must match file::component::structuralPath"})});function f_(e,n,i){return`${e}${Ai}${n}${Ai}${i}`}function KA(e){let[n,i,...s]=e.split(Ai);return!n||!i||s.length===0?null:{file:n,component:i,structuralPath:s.join(Ai)}}var wi=d.enum(["VERSION_STALE","RECOVERY_REQUIRED","MULTIPLE_PAGE_RETURNS","INDIRECT_RETURN_ONLY","PAGE_CONTAINER_AMBIGUOUS","NO_SAFE_PAGE_PLACEMENT","MEMBER_NOT_INDEPENDENT","UNSUPPORTED_ROUTE_STRUCTURE","RUNTIME_ANCHOR_UNRESOLVED","ROUTE_RETURN_NOT_FOUND"]),Ln=d.object({code:d.string().min(1),message:d.string().min(1)}).strict(),b_=d.union([d.object({kind:d.literal("virtual-route-root"),key:d.string().min(1)}).strict(),d.object({kind:d.literal("jsx-container"),key:d.string().min(1),sourceMemberKey:d.string().min(1),sourceFile:d.string().min(1),componentName:d.string().min(1).optional()}).strict(),d.object({kind:d.literal("starter-placeholder"),key:d.string().min(1),sourceFile:d.string().min(1).optional()}).strict()]),y_=d.object({key:d.string().min(1),kind:d.enum(["jsx-element","jsx-fragment","jsx-expression","null-return","starter-placeholder"]),containerKey:d.string().min(1),label:d.string().min(1),sourceFile:d.string().min(1).optional(),isAtomic:d.boolean()}).strict(),x_=d.object({key:d.string().min(1),sourceMemberKey:d.string().min(1),containerKey:d.string().min(1),label:d.string().min(1),isIndependent:d.boolean()}).strict(),E_=d.object({key:d.string().min(1),containerKey:d.string().min(1),businessMemberKeys:d.array(d.string().min(1)),isMultiMember:d.boolean()}).strict(),tc=d.object({kind:d.literal("page-composition"),placementKey:d.string().min(1),documentVersion:d.number().int().nonnegative(),composition:_e}).strict(),R_=d.object({kind:d.literal("page-composition"),placementKey:d.string().min(1),documentVersion:d.number().int().nonnegative(),composition:B,placementUnitKey:d.string().min(1),relation:d.enum(["before","after","prepend","append"])}).strict(),nc=d.object({kind:d.literal("page-composition"),placementKey:d.string().min(1),documentVersion:d.number().int().nonnegative(),composition:_e,placementUnitKey:d.string().min(1),relation:d.enum(["before","after","prepend","append"])}).strict(),ic=d.object({kind:d.literal("page-unit"),composition:_e,placementUnitKey:d.string().min(1)}).strict(),sc=d.object({kind:d.literal("page-unit"),composition:B,placementUnitKey:d.string().min(1)}).strict();function _t(e,n,i,s,o){let a=new Set;for(let[c,r]of e.entries()){let m=s(r);a.has(m)&&n.addIssue({code:"custom",path:[i,c,o],message:`Duplicate ${i} key: ${m}`}),a.add(m)}}var I_=d.object({status:d.literal("supported"),version:d.number().int().nonnegative(),composition:B,container:b_,sourceMembers:d.array(y_),businessMembers:d.array(x_),placementUnits:d.array(E_),placements:d.array(R_)}).strict().superRefine((e,n)=>{_t(e.sourceMembers,n,"sourceMembers",r=>r.key,"key"),_t(e.businessMembers,n,"businessMembers",r=>r.key,"key"),_t(e.placementUnits,n,"placementUnits",r=>r.key,"key"),_t(e.placements,n,"placements",r=>r.placementKey,"placementKey");let i=new Set(e.sourceMembers.map(r=>r.key)),s=new Set(e.placementUnits.map(r=>r.key)),o=new Map(e.sourceMembers.map(r=>[r.key,r])),a=new Map(e.businessMembers.map(r=>[r.key,r]));for(let[r,m]of e.sourceMembers.entries()){m.containerKey!==e.container.key&&!i.has(m.containerKey)&&n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member parent must reference the page container or another source member."}),m.containerKey===m.key&&n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member cannot contain itself."});let S=new Set([m.key]),g=m.containerKey;for(;g!==e.container.key;){if(S.has(g)){n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member hierarchy must be acyclic."});break}S.add(g);let w=o.get(g);if(!w)break;g=w.containerKey}}e.container.kind==="jsx-container"&&!i.has(e.container.sourceMemberKey)&&n.addIssue({code:"custom",path:["container","sourceMemberKey"],message:"Container sourceMemberKey must reference a source member."});for(let[r,m]of e.businessMembers.entries())i.has(m.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",r,"sourceMemberKey"],message:"Business member must reference a source member."}),s.has(m.containerKey)||n.addIssue({code:"custom",path:["businessMembers",r,"containerKey"],message:"Business member must reference a placement unit container."});for(let[r,m]of e.placementUnits.entries()){let S=o.get(m.containerKey);S?S.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",r,"containerKey"],message:"Placement unit must reference a direct child of the page container."}):n.addIssue({code:"custom",path:["placementUnits",r,"containerKey"],message:"Placement unit containerKey must reference a source member."});let g=new Set;for(let[w,K]of m.businessMemberKeys.entries()){let H=a.get(K);if(!H){n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Placement unit must reference existing business members."});continue}g.has(K)&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Placement unit cannot reference the same business member twice."}),g.add(K),H.containerKey!==m.key&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Business member containerKey must match its placement unit."});let se=H.sourceMemberKey,Se=new Set;for(;se&&se!==m.containerKey&&!Se.has(se);)Se.add(se),se=o.get(se)?.containerKey;se!==m.containerKey&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Placement unit business members must belong to its source subtree."})}}for(let[r,m]of e.businessMembers.entries())e.placementUnits.find(g=>g.key===m.containerKey)?.businessMemberKeys.includes(m.key)||n.addIssue({code:"custom",path:["businessMembers",r,"containerKey"],message:"Business member must be listed by its placement unit container."});let c=new Map;for(let r of e.placementUnits)c.set(r.containerKey,(c.get(r.containerKey)??0)+1);for(let[r,m]of e.sourceMembers.entries())m.containerKey===e.container.key&&c.get(m.key)!==1&&n.addIssue({code:"custom",path:["sourceMembers",r,"key"],message:"Every direct source member must be owned by exactly one placement unit."});for(let[r,m]of e.placements.entries())rc(m.composition,e.composition)||n.addIssue({code:"custom",path:["placements",r,"composition"],message:"Page placement composition must match page composition."}),m.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",r,"documentVersion"],message:"Page placement version must match page composition version."}),s.has(m.placementUnitKey)||n.addIssue({code:"custom",path:["placements",r,"placementUnitKey"],message:"Placement option must reference an existing placement unit."})}),T_=d.object({status:d.literal("unsupported"),version:d.number().int().nonnegative(),composition:B,reason:wi,diagnostics:d.array(Ln)}).strict(),k_=d.discriminatedUnion("status",[I_,T_]),oc=2,$A="page-composition-v2",ac=d.object({start:d.number().int().nonnegative(),end:d.number().int().nonnegative(),startLine:d.number().int().positive().optional(),startColumn:d.number().int().nonnegative().optional(),endLine:d.number().int().positive().optional(),endColumn:d.number().int().nonnegative().optional()}).strict().superRefine((e,n)=>{e.end<e.start&&n.addIssue({code:"custom",path:["end"],message:"Source range end must be greater than or equal to start."});let i=[e.startLine,e.startColumn,e.endLine,e.endColumn],s=i.some(a=>a!==void 0),o=i.every(a=>a!==void 0);s&&!o&&n.addIssue({code:"custom",path:["startLine"],message:"Source line and column locations must be provided together."}),e.startLine!==void 0&&e.endLine!==void 0&&e.endLine<e.startLine&&n.addIssue({code:"custom",path:["endLine"],message:"Source range endLine must not precede startLine."}),e.startLine!==void 0&&e.endLine===e.startLine&&e.startColumn!==void 0&&e.endColumn!==void 0&&e.endColumn<e.startColumn&&n.addIssue({code:"custom",path:["endColumn"],message:"Source range endColumn must not precede startColumn."})}),A_=d.object({key:d.string().min(1),instanceIndex:d.number().int().nonnegative().optional(),instanceCount:d.number().int().positive().optional(),textSegmentIndex:d.number().int().nonnegative().optional()}).strict().superRefine((e,n)=>{e.instanceIndex!==void 0&&e.instanceCount!==void 0&&e.instanceIndex>=e.instanceCount&&n.addIssue({code:"custom",path:["instanceIndex"],message:"instanceIndex must be lower than instanceCount."})}),w_=d.enum(["component-call","native-jsx","dynamic-expression","indirect-expression","text","starter-placeholder"]),P_=d.enum(["none","dynamic-expression","indirect-expression","text","starter-placeholder"]),v_=d.discriminatedUnion("kind",[d.object({kind:d.literal("virtual-route-root"),key:d.null(),routeReturn:d.object({sourceIdentity:$s,sourceRange:ac}).strict()}).strict(),d.object({kind:d.literal("jsx-container"),key:d.string().min(1),sourceMemberKey:d.string().min(1)}).strict(),d.object({kind:d.literal("starter-placeholder"),key:d.string().min(1),sourceMemberKey:d.string().min(1),replacementMode:d.literal("replace")}).strict()]),C_=d.object({key:d.string().min(1),kind:w_,parentKey:d.string().min(1).nullable(),childKeys:d.array(d.string().min(1)),order:d.number().int().nonnegative(),label:d.string().min(1),sourceIdentity:$s,sourceRange:ac.nullable(),atomicKind:P_}).strict().superRefine((e,n)=>{let i=e.kind==="component-call"||e.kind==="native-jsx"?"none":e.kind;e.atomicKind!==i&&n.addIssue({code:"custom",path:["atomicKind"],message:`atomicKind must be ${i} for ${e.kind}.`});let s=new Set;for(let[o,a]of e.childKeys.entries())s.has(a)&&n.addIssue({code:"custom",path:["childKeys",o],message:`Duplicate child source member key: ${a}`}),s.add(a)}),D_=d.object({key:d.string().min(1),sourceMemberKey:d.string().min(1),placementUnitKey:d.string().min(1),label:d.string().min(1),isIndependent:d.boolean()}).strict(),O_=d.enum(["independent","atomic","container"]),N_=d.object({key:d.string().min(1),containerKey:d.string().min(1).nullable(),sourceMemberKeys:d.array(d.string().min(1)).min(1),businessMemberKeys:d.array(d.string().min(1)),order:d.number().int().nonnegative(),boundaryMode:O_,isIndependent:d.boolean(),isMultiMember:d.boolean()}).strict().superRefine((e,n)=>{ec(e.sourceMemberKeys,n,"sourceMemberKeys","source member"),ec(e.businessMemberKeys,n,"businessMemberKeys","business member");let i=e.sourceMemberKeys.length>1||e.businessMemberKeys.length>1;e.isMultiMember!==i&&n.addIssue({code:"custom",path:["isMultiMember"],message:"isMultiMember must reflect the source and business member cardinality."});let s=e.boundaryMode==="independent";e.isIndependent!==s&&n.addIssue({code:"custom",path:["isIndependent"],message:"isIndependent must match boundaryMode."})}),j_=d.enum(["before","after","prepend","append","replace"]),L_=d.enum(["insert-sibling","insert-child","replace-placeholder"]),M_=d.object({kind:d.literal("page-composition"),placementKey:d.string().min(1),documentVersion:d.number().int().nonnegative(),composition:B,placementUnitKey:d.string().min(1),containerKey:d.string().min(1).nullable(),relation:j_,writeMode:L_}).strict().superRefine((e,n)=>{let i=e.relation==="before"||e.relation==="after"?"insert-sibling":e.relation==="prepend"||e.relation==="append"?"insert-child":"replace-placeholder";e.writeMode!==i&&n.addIssue({code:"custom",path:["writeMode"],message:`writeMode must be ${i} for ${e.relation}.`})}),U_=d.object({key:d.string().min(1),placementUnitKey:d.string().min(1),runtimeRefs:d.array(A_).min(1)}).strict(),F_=d.object({schemaVersion:d.literal(oc),status:d.literal("supported"),version:d.number().int().nonnegative(),composition:B,container:v_,sourceMembers:d.array(C_),businessMembers:d.array(D_),placementUnits:d.array(N_),placements:d.array(M_),visualAnchors:d.array(U_).optional(),diagnostics:d.array(Ln)}).strict().superRefine((e,n)=>{W_(e,n)}),G_=d.object({schemaVersion:d.literal(oc),status:d.literal("unsupported"),version:d.number().int().nonnegative(),composition:B,reason:wi,diagnostics:d.array(Ln)}).strict(),q_=d.discriminatedUnion("status",[F_,G_]),YA=d.union([q_,k_]);function ec(e,n,i,s){let o=new Set;for(let[a,c]of e.entries())o.has(c)&&n.addIssue({code:"custom",path:[i,a],message:`Duplicate ${s} key: ${c}`}),o.add(c)}function rc(e,n){return Is(e)===Is(n)}function W_(e,n){_t(e.sourceMembers,n,"sourceMembers",g=>g.key,"key"),_t(e.businessMembers,n,"businessMembers",g=>g.key,"key"),_t(e.placementUnits,n,"placementUnits",g=>g.key,"key"),_t(e.placements,n,"placements",g=>g.placementKey,"placementKey"),_t(e.visualAnchors??[],n,"visualAnchors",g=>g.key,"key"),K_(e,n);let i=new Map(e.sourceMembers.map(g=>[g.key,g])),s=new Map(e.businessMembers.map(g=>[g.key,g])),o=new Map(e.placementUnits.map(g=>[g.key,g]));B_(e,i,n),e.container.kind!=="virtual-route-root"&&(i.has(e.container.sourceMemberKey)||n.addIssue({code:"custom",path:["container","sourceMemberKey"],message:"Container sourceMemberKey must reference a source member."}));let a=new Map,c=new Map,r=new Set;for(let[g,w]of e.placementUnits.entries()){w.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",g,"containerKey"],message:"Placement unit containerKey must match the page container."});let K=`${w.containerKey??"<virtual>"}:${w.order}`;r.has(K)&&n.addIssue({code:"custom",path:["placementUnits",g,"order"],message:"Placement unit order must be unique within its container."}),r.add(K);for(let[H,se]of w.sourceMemberKeys.entries()){i.has(se)||n.addIssue({code:"custom",path:["placementUnits",g,"sourceMemberKeys",H],message:"Placement unit must reference existing source members."});let Se=a.get(se);Se&&Se!==w.key&&n.addIssue({code:"custom",path:["placementUnits",g,"sourceMemberKeys",H],message:`Source member is already assigned to ${Se}.`}),a.set(se,w.key)}for(let[H,se]of w.businessMemberKeys.entries()){let Se=s.get(se);if(!Se){n.addIssue({code:"custom",path:["placementUnits",g,"businessMemberKeys",H],message:"Placement unit must reference existing business members."});continue}Se.placementUnitKey!==w.key&&n.addIssue({code:"custom",path:["placementUnits",g,"businessMemberKeys",H],message:"Placement unit and business member must reference each other."}),w.sourceMemberKeys.includes(Se.sourceMemberKey)||n.addIssue({code:"custom",path:["placementUnits",g,"businessMemberKeys",H],message:"Business member sourceMemberKey must belong to the placement unit."});let xn=c.get(se);xn&&xn!==w.key&&n.addIssue({code:"custom",path:["placementUnits",g,"businessMemberKeys",H],message:`Business member is already assigned to ${xn}.`}),c.set(se,w.key)}}for(let[g,w]of e.businessMembers.entries()){i.has(w.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",g,"sourceMemberKey"],message:"Business member must reference a source member."});let K=o.get(w.placementUnitKey);if(!K){n.addIssue({code:"custom",path:["businessMembers",g,"placementUnitKey"],message:"Business member must reference a placement unit."});continue}K.businessMemberKeys.includes(w.key)||n.addIssue({code:"custom",path:["businessMembers",g,"placementUnitKey"],message:"Business member and placement unit must reference each other."}),K.sourceMemberKeys.includes(w.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",g,"sourceMemberKey"],message:"Business member sourceMemberKey must belong to its placement unit."});let H=K.isIndependent&&K.businessMemberKeys.length===1;w.isIndependent!==H&&n.addIssue({code:"custom",path:["businessMembers",g,"isIndependent"],message:"Business member independence must match its placement unit boundary."})}let m=new Set;for(let[g,w]of e.placements.entries()){w.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",g,"documentVersion"],message:"Page placement version must match page composition version."}),rc(w.composition,e.composition)||n.addIssue({code:"custom",path:["placements",g,"composition"],message:"Page placement composition must match page composition."});let K=o.get(w.placementUnitKey);K?w.containerKey!==K.containerKey&&n.addIssue({code:"custom",path:["placements",g,"containerKey"],message:"Placement containerKey must match its placement unit."}):n.addIssue({code:"custom",path:["placements",g,"placementUnitKey"],message:"Placement option must reference a placement unit."});let H=`${w.placementUnitKey}:${w.relation}`;m.has(H)&&n.addIssue({code:"custom",path:["placements",g,"relation"],message:"A placement unit cannot expose the same relation more than once."}),m.add(H),w.relation==="replace"&&e.container.kind!=="starter-placeholder"&&n.addIssue({code:"custom",path:["placements",g,"relation"],message:"replace is only valid for a starter placeholder container."}),e.container.kind==="starter-placeholder"&&w.relation!=="replace"&&n.addIssue({code:"custom",path:["placements",g,"relation"],message:"Starter placeholder placements must use replace."})}let S=new Set;for(let[g,w]of(e.visualAnchors??[]).entries())o.has(w.placementUnitKey)||n.addIssue({code:"custom",path:["visualAnchors",g,"placementUnitKey"],message:"Visual anchor must reference a placement unit."}),S.has(w.placementUnitKey)&&n.addIssue({code:"custom",path:["visualAnchors",g,"placementUnitKey"],message:"A placement unit may expose only one visual anchor."}),S.add(w.placementUnitKey)}function K_(e,n){let i=[];e.container.key!==null&&i.push({key:e.container.key,path:["container","key"],namespace:"container"});for(let[o,a]of e.sourceMembers.entries())i.push({key:a.key,path:["sourceMembers",o,"key"],namespace:"source member"});for(let[o,a]of e.businessMembers.entries())i.push({key:a.key,path:["businessMembers",o,"key"],namespace:"business member"});for(let[o,a]of e.placementUnits.entries())i.push({key:a.key,path:["placementUnits",o,"key"],namespace:"placement unit"});for(let[o,a]of(e.visualAnchors??[]).entries())i.push({key:a.key,path:["visualAnchors",o,"key"],namespace:"visual anchor"});let s=new Map;for(let o of i){let a=s.get(o.key);a?n.addIssue({code:"custom",path:o.path,message:`${o.namespace} key collides with ${a}: ${o.key}`}):s.set(o.key,o.namespace)}}function B_(e,n,i){let s=new Set;for(let[o,a]of e.sourceMembers.entries()){let c=`${a.parentKey??"<root>"}:${a.order}`;if(s.has(c)&&i.addIssue({code:"custom",path:["sourceMembers",o,"order"],message:"Source member order must be unique among siblings."}),s.add(c),a.parentKey===a.key&&i.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source member cannot be its own parent."}),a.parentKey!==null){let S=n.get(a.parentKey);S?S.childKeys.includes(a.key)||i.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source parent and child references must be bidirectional."}):i.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source member parentKey must reference a source member."})}for(let[S,g]of a.childKeys.entries()){if(g===a.key){i.addIssue({code:"custom",path:["sourceMembers",o,"childKeys",S],message:"Source member cannot be its own child."});continue}let w=n.get(g);w?w.parentKey!==a.key&&i.addIssue({code:"custom",path:["sourceMembers",o,"childKeys",S],message:"Source parent and child references must be bidirectional."}):i.addIssue({code:"custom",path:["sourceMembers",o,"childKeys",S],message:"Source child key must reference a source member."})}let r=new Set,m=a;for(;m;){if(r.has(m.key)){i.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source member graph must be acyclic."});break}r.add(m.key),m=m.parentKey===null?void 0:n.get(m.parentKey)}}}var Mn=u.enum(["update-text","update-array-item","remove-node","insert-child","replace-node","move-node","set-class-name-source","set-props","apply-style-draft","source-edit","insert-page-resource","delete-page-source"]),z_=u.discriminatedUnion("kind",[u.object({kind:u.literal("node"),key:u.string().min(1)}).strict(),ic,u.object({kind:u.literal("route"),composition:_e}).strict(),u.object({kind:u.literal("source-file"),path:xe}).strict(),u.object({kind:u.literal("source-batch"),paths:u.array(xe).min(1)}).superRefine((e,n)=>{let i=new Set;for(let[s,o]of e.paths.entries())i.has(o)&&n.addIssue({code:"custom",path:["paths",s],message:`Duplicate source target path: ${o}`}),i.add(o)}).strict(),u.object({kind:u.literal("project")}).strict()]),H_=u.discriminatedUnion("kind",[u.object({kind:u.literal("node"),key:u.string().min(1)}).strict(),sc,u.object({kind:u.literal("route"),composition:B}).strict(),u.object({kind:u.literal("source-file"),path:xe}).strict(),u.object({kind:u.literal("source-batch"),paths:u.array(xe).min(1)}).strict(),u.object({kind:u.literal("project")}).strict()]),mc=u.enum(["display","position","top","right","bottom","left","zIndex","flexDirection","flexWrap","flexGrow","flexShrink","flexBasis","order","gridTemplateColumns","gridTemplateRows","columns","gridColumn","gridRow","gap","gapX","gapY","spaceX","spaceY","alignItems","justifyContent","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","width","height","minWidth","minHeight","maxWidth","maxHeight","overflow","fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","textAlign","textTransform","textDecoration","textOverflow","textIndent","writingMode","whiteSpace","wordBreak","lineClamp","fontVariantNumeric","screenReaderOnly","color","backgroundColor","backgroundImage","backgroundRepeat","backgroundSize","backgroundPosition","backgroundAttachment","backgroundClip","backgroundOrigin","borderStyle","borderWidth","borderRadius","borderColor","objectFit","objectPosition","aspectRatio","opacity","boxShadow","transform","transformOrigin","transitionProperty","transitionDuration","transitionTimingFunction","animation","pointerEvents","cursor","userSelect","fontStyle","textUnderlineOffset","scrollMarginTop","alignSelf","flex","outlineStyle","resize","ringWidth","ringColor","backdropFilter","overscrollBehavior","divideWidth","divideColor"]),lc=u.enum(["hover","active","focus","disabled"]),pc=u.enum(["sm","md","lg","xl","2xl"]),cc=u.union([u.object({relation:u.enum(["before","after"]),anchorKey:u.string().min(1),parentKey:u.string().min(1)}),u.object({relation:u.enum(["prepend","append"]),parentKey:u.string().min(1)}),nc]),dc=u.object({kind:u.literal("component-call"),component:u.never().optional(),materialization:Ft,props:u.record(u.string(),u.never()).optional()}).strict(),V_=u.union([u.object({kind:u.literal("native-tag"),tag:u.string().min(1),text:u.string().optional()}),u.object({kind:u.literal("component-call"),component:u.object({source:u.string().min(1),exportName:u.string().min(1)}),materialization:u.never().optional(),props:u.record(u.string(),u.unknown()).optional()}).strict(),dc]),$_=u.discriminatedUnion("kind",[u.object({kind:u.literal("update-text"),segmentIndex:u.number().int().min(0),value:u.string()}),u.object({kind:u.literal("update-array-item"),segmentIndex:u.number().int().min(0),index:u.number().int().min(0),value:u.string()}),u.object({kind:u.literal("remove-node")}),u.object({kind:u.literal("insert-child"),node:V_,position:u.union([cc,tc])}),u.object({kind:u.literal("replace-node"),node:dc}),u.object({kind:u.literal("move-node"),target:cc,preserveBindings:u.boolean().optional()}),u.object({kind:u.literal("set-class-name-source"),filePath:u.string().min(1),expectedVersion:u.object({documentVersion:u.number().int().nonnegative(),contentHash:u.string().min(1)}),oldAttrRaw:u.string().min(1).nullable(),oldAttrRange:dt.nullable(),openingElementRange:dt,newAttrRaw:u.string().min(1).nullable(),intent:Hs}),Zr,u.object({kind:u.literal("apply-style-draft"),className:u.object({filePath:u.string().min(1),expectedVersion:u.object({documentVersion:u.number().int().nonnegative(),contentHash:u.string().min(1)}),oldAttrRaw:u.string().min(1).nullable(),oldAttrRange:dt.nullable(),openingElementRange:dt,newAttrRaw:u.string().min(1).nullable(),intent:Hs}).optional(),props:u.partialRecord(Jr,u.string()).optional()}).superRefine((e,n)=>{!e.className&&!e.props&&n.addIssue({code:"custom",message:"apply-style-draft requires className or props"})}),u.object({kind:u.literal("source-edit"),conflictPolicy:u.enum(["compare-and-swap","overwrite"]),edits:u.array(u.discriminatedUnion("operation",[u.object({operation:u.literal("upsert"),path:xe,content:u.string(),baseContentHash:u.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{ks(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit upsert only accepts allowlisted text source files"}),e.content.includes("\0")&&n.addIssue({code:"custom",path:["content"],message:"source-edit content must be valid text"})}),u.object({operation:u.literal("delete"),path:xe,capability:ir,confirmDelete:u.literal(!0),confirmPath:xe,baseContentHash:u.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{e.capability!==Ts&&n.addIssue({code:"custom",path:["capability"],message:"delete requires source-delete capability"}),e.confirmPath!==e.path&&n.addIssue({code:"custom",path:["confirmPath"],message:"delete confirmation path must match edit path"}),ks(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit delete only accepts allowlisted text source files"});let i=As(e.path);i&&n.addIssue({code:"custom",path:["path"],message:`Protected source file cannot be deleted: ${e.path} (${i})`})})])).min(1),reason:u.string().min(1).optional()}).strict().superRefine((e,n)=>{let i=new Set;for(let[s,o]of e.edits.entries())i.has(o.path)&&n.addIssue({code:"custom",path:["edits",s,"path"],message:`Duplicate source edit path: ${o.path}`}),i.add(o.path),e.conflictPolicy==="compare-and-swap"&&o.baseContentHash===void 0&&n.addIssue({code:"custom",path:["edits",s,"baseContentHash"],message:"source-edit compare-and-swap requires baseContentHash for every edit"})}),u.object({kind:u.literal("insert-page-resource"),artifact:Bs}).strict(),u.object({kind:u.literal("delete-page-source"),expectedUrlPath:u.string().startsWith("/")}).strict()]),uc=u.enum(["NODE_NOT_FOUND","HOME_PAGE_LOCKED","ROUTE_NOT_FOUND","CAPABILITY_REJECTED","CONSTRAINT_VIOLATED","INVALID_PARAMS","PLAN_FAILED","TRANSACTION_PREFLIGHT_FAILED","ROUTE_REBUILD_FAILED","HISTORY_COMMIT_FAILED","MATERIALIZATION_CONFLICT","MATERIALIZATION_REJECTED","MUTATION_ASSERTION_REQUIRED","MUTATION_ASSERTION_INVALID","VERSION_STALE","AST_PARSE_ERROR","UNSUPPORTED_OPERATION","LOCATOR_FAILED","INVALID_TARGET","WRITE_IO_ERROR","CONCURRENT_MODIFIED","ROLLBACK_FAILED","RECOVERY_REQUIRED","RECOVERY_PERSIST_FAILED","MUTATION_SESSION_REQUIRED","LEASE_ASSERTION_INVALID","LEASE_ASSERTION_EXPIRED","LEASE_ASSERTION_SCOPE_MISMATCH","CROSS_PAGE_MOVE_UNSUPPORTED","INTERNAL_ERROR"]),_c=u.object({code:uc,message:u.string().min(1),details:u.record(u.string(),u.unknown()).optional()}),en=u.object({key:u.string().min(1),instanceIndex:u.number().int().nonnegative().optional(),instanceCount:u.number().int().positive().optional()}),Ys=u.object({id:u.string().min(1),siteId:k,baseSnapshotId:A,composition:_e,kind:Mn,target:z_,documentVersion:u.number().int().nonnegative(),selectionRef:en.optional(),mutationContext:Nn.optional(),params:$_}).strict().superRefine((e,n)=>{if(e.kind!==e.params.kind&&n.addIssue({code:"custom",path:["params","kind"],message:"params.kind must match operation kind"}),e.kind==="source-edit"){if(e.target.kind!=="source-file"&&e.target.kind!=="source-batch")n.addIssue({code:"custom",path:["target","kind"],message:"source-edit requires a source-file or source-batch target"});else if(e.params.kind==="source-edit"){let i=e.params.edits.map(o=>o.path),s=e.target.kind==="source-file"?[e.target.path]:e.target.paths;Z_(i,s)||n.addIssue({code:"custom",path:["target"],message:"source-edit target paths must match edit paths"})}}else(e.target.kind==="source-file"||e.target.kind==="source-batch")&&n.addIssue({code:"custom",path:["target","kind"],message:"source targets are only valid for source-edit"});e.target.kind==="page-unit"&&(e.kind!=="insert-child"&&e.kind!=="replace-node"&&e.kind!=="move-node"&&e.kind!=="remove-node"&&n.addIssue({code:"custom",path:["target","kind"],message:"page-unit target is only valid for page-level operations"}),e.kind==="move-node"&&e.params.kind==="move-node"&&(!("kind"in e.params.target)||e.params.target.kind!=="page-composition")&&n.addIssue({code:"custom",path:["params","target","kind"],message:"page-unit move-node target requires page-composition placement"})),e.params.kind==="insert-child"&&"kind"in e.params.position&&e.params.position.kind==="page-composition"&&e.target.kind!=="page-unit"&&n.addIssue({code:"custom",path:["params","position","kind"],message:"page-composition position requires page-unit target"}),e.kind==="replace-node"&&e.target.kind!=="page-unit"&&n.addIssue({code:"custom",path:["target","kind"],message:"replace-node requires a page-unit target"}),e.kind==="insert-page-resource"||e.kind==="delete-page-source"?e.target.kind!=="project"&&n.addIssue({code:"custom",path:["target","kind"],message:`${e.kind} requires a project target`}):e.target.kind==="project"&&n.addIssue({code:"custom",path:["target","kind"],message:"project target is only valid for insert-page-resource or delete-page-source"}),e.kind==="insert-child"&&e.target.kind==="page-unit"&&e.params.kind==="insert-child"&&(!("kind"in e.params.position)||e.params.position.kind!=="page-composition")&&n.addIssue({code:"custom",path:["params","position","kind"],message:"page-unit target requires page-composition position"})}),m1=Ys,Y_=u.object({kind:u.literal("insert-page-resource"),package_instance_id:u.string().min(1),pages:u.array(Gr).min(1)}).strict().superRefine((e,n)=>{let i=new Set,s=new Set;for(let[o,a]of e.pages.entries())i.has(a.template_page_id)&&n.addIssue({code:"custom",path:["pages",o,"template_page_id"],message:`Duplicate template page route mapping: ${a.template_page_id}`}),s.has(a.final_route)&&n.addIssue({code:"custom",path:["pages",o,"final_route"],message:`Duplicate final route mapping: ${a.final_route}`}),i.add(a.template_page_id),s.add(a.final_route)}),X_=u.object({kind:u.literal("delete-page-source"),deleted_files:u.array(u.string().min(1)),updated_files:u.array(u.string().min(1)),preserved_shared_files:u.array(u.string().min(1)),warnings:u.array(u.string().min(1))}).strict(),Q_=u.discriminatedUnion("kind",[Y_,X_]),gc=u.object({requestId:u.string().min(1),kind:Mn,composition:B,target:H_,resultVersion:u.number().int().nonnegative(),affectedFiles:u.array(u.string().min(1)).optional(),selectionRef:en.optional(),output:Q_.optional()}).strict(),Xs=gc.superRefine((e,n)=>{let i=e.kind==="insert-page-resource"||e.kind==="delete-page-source";i&&e.target.kind!=="project"?n.addIssue({code:"custom",path:["target","kind"],message:`${e.kind} result requires a project target`}):!i&&e.target.kind==="project"&&n.addIssue({code:"custom",path:["target","kind"],message:"project result target requires a project operation"}),i&&!e.output&&n.addIssue({code:"custom",path:["output"],message:`${e.kind} result requires typed output`}),e.output&&e.output.kind!==e.kind&&n.addIssue({code:"custom",path:["output","kind"],message:"output.kind must match operation kind"})}),l1=$r({dataSchema:Xs,codeSchema:uc,failureDataSchema:gc.partial()});function Z_(e,n){return e.length===n.length&&e.every((i,s)=>i===n[s])}var J_=ae.enum(["component","page","pages"]),eg=ae.object({resource_kind:J_,resource_name:ae.string().trim().min(1).max(200),file_count:ae.number().int().min(1).max(64),total_bytes:ae.number().int().min(0).max(4*1024*1024),content_digest:ae.string().regex(/^sha256:[a-f0-9]{64}$/),custom_prompt:ae.string().trim().min(1).max(4e3).optional(),final_routes:ae.array(ae.string().min(1)).max(64)}).strict(),tg=ae.discriminatedUnion("kind",[ae.object({kind:ae.literal("none")}).strict(),ae.object({kind:ae.literal("primary"),items:ae.array(ae.object({label:ae.string().trim().min(1).max(120),href:ae.string().startsWith("/").max(200)}).strict()).min(1).max(64)}).strict().superRefine((e,n)=>{let i=new Set;for(let[s,o]of e.items.entries())i.has(o.href)&&n.addIssue({code:"custom",path:["items",s,"href"],message:`Duplicate navigation href: ${o.href}`}),i.add(o.href)})]),ng=ae.object({base_snapshot_id:ae.string().min(1),operation:Ys,navigation_selection:tg.optional()}).strict().superRefine((e,n)=>{e.base_snapshot_id!==e.operation.baseSnapshotId&&n.addIssue({code:"custom",path:["operation","baseSnapshotId"],message:"Resource operation baseSnapshotId must match base_snapshot_id."})});function ig(e){return(e.kind==="insert-child"||e.kind==="replace-node")&&(e.params.kind==="insert-child"||e.params.kind==="replace-node")&&e.params.node.kind==="component-call"&&"materialization"in e.params.node&&e.params.node.materialization?[e.params.node.materialization]:e.kind==="insert-page-resource"&&e.params.kind==="insert-page-resource"?[...e.params.artifact.components.map(n=>n.materialization),...e.params.artifact.pages.map(n=>n.materialization)]:[]}var hc=ae.object({id:ae.string().min(1),tenant_id:ae.string().min(1),site_id:ae.string().min(1),run_id:ae.string().min(1).optional(),correlation_id:ae.string().min(1).optional(),sent_at:ae.string().min(1),type:ae.literal("client.resource.operation.create"),payload:ae.object({client_message_id:ae.string().min(1),display:eg,transient_resource_input:ng}).strict()}).strict().superRefine((e,n)=>{let{display:i,transient_resource_input:s}=e.payload;e.site_id!==s.operation.siteId&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation","siteId"],message:"Resource operation siteId must match envelope site_id."}),(i.resource_kind==="component"?s.operation.kind==="insert-child"||s.operation.kind==="replace-node":s.operation.kind==="insert-page-resource")||n.addIssue({code:"custom",path:["payload","transient_resource_input","operation","kind"],message:i.resource_kind==="component"?"component resources require insert-child or replace-node.":`${i.resource_kind} resources require insert-page-resource.`});let c=ig(s.operation).flatMap(m=>m.files),r=c.reduce((m,S)=>m+new TextEncoder().encode(S.content).byteLength,0);if(c.length>Ns&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate file count limit."}),r>js&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate content byte limit."}),i.file_count!==c.length&&n.addIssue({code:"custom",path:["payload","display","file_count"],message:"Resource summary file_count must match the transient operation."}),i.total_bytes!==r&&n.addIssue({code:"custom",path:["payload","display","total_bytes"],message:"Resource summary total_bytes must match the transient operation."}),s.operation.kind==="insert-page-resource"&&s.operation.params.kind==="insert-page-resource"){let m=s.operation.params.artifact;m.resource_type!==i.resource_kind&&n.addIssue({code:"custom",path:["payload","display","resource_kind"],message:"Resource summary kind must match the page artifact resource_type."});let S=m.pages.map(g=>g.final_route);(S.length!==i.final_routes.length||S.some((g,w)=>g!==i.final_routes[w]))&&n.addIssue({code:"custom",path:["payload","display","final_routes"],message:"Resource summary final_routes must match the page artifact routes."})}if(s.navigation_selection?.kind==="primary"){let m=new Set(i.final_routes);for(let[S,g]of s.navigation_selection.items.entries())m.has(g.href)||n.addIssue({code:"custom",path:["payload","transient_resource_input","navigation_selection","items",S,"href"],message:"Navigation selection href must reference a final resource route."})}});import{z as P}from"zod";import{z as Qs}from"zod";var L=e=>Qs.object({code:Qs.number().int(),data:e,message:Qs.string()});var sg=["with_website","without_website"],tn=P.enum(sg),Zs=P.string().trim().url().refine(e=>{let n=new URL(e).protocol;return n==="http:"||n==="https:"},{message:"Website must use the http or https protocol."}),og=["welcome","website_scan","customer_materials","analysis","diagnosis","strategy","structure_planning","preview_personalization","publishing"],It=P.enum(og),ag=["company_info","website_crawl","website_basic_info_extract","website_metrics_evaluate","intelligent_analysis","strategy_recommendation"],fc=P.enum(ag),rg=["started","running","succeeded","failed","invalidated"],bc=P.enum(rg),cg=["draft","structure_saved","generating","workspace_ready"],Js=P.enum(cg),mg=["not_deployed","deploying","deployed"],eo=P.enum(mg),lg=["active","completed"],pg=P.enum(lg),dg=["completed","current","locked"],ug=P.enum(dg),yc={draft:10,structure_saved:20,generating:30,workspace_ready:40},xc={not_deployed:10,deploying:20,deployed:30},Ec={active:10,completed:20},Rc={started:10,running:20,succeeded:30,failed:40,invalidated:50};function Pi(e){return new Map(Object.entries(e).map(([n,i])=>[i,n]))}var _g=Pi(yc),gg=Pi(xc),hg=Pi(Ec),Sg=Pi(Rc);function R1(e){let n=_g.get(e);if(!n)throw new Error(`Unknown site build status code: ${e}`);return n}function I1(e){let n=gg.get(e);if(!n)throw new Error(`Unknown site deployment status code: ${e}`);return n}function T1(e){let n=hg.get(e);if(!n)throw new Error(`Unknown site workflow status code: ${e}`);return n}function k1(e){let n=Sg.get(e);if(!n)throw new Error(`Unknown task execution status code: ${e}`);return n}function A1(e){return yc[e]}function w1(e){return xc[e]}function P1(e){return Ec[e]}function v1(e){return Rc[e]}var to=[{definition_version:1,published:!0,required_client_capability:null,definitions:{with_website:[{id:"01900000-0000-7000-8000-000000000001",node_code:"welcome",label:"\u6B22\u8FCE\u542F\u52A8",sort_order:1,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000002",node_code:"website_scan",label:"\u521D\u59CB\u5316\u9700\u6C42\u4E0E\u5B98\u7F51\u626B\u63CF",sort_order:2,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000003",node_code:"analysis",label:"\u667A\u80FD\u5206\u6790",sort_order:3,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000004",node_code:"diagnosis",label:"\u8BCA\u65AD\u62A5\u544A",sort_order:4,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000005",node_code:"strategy",label:"\u7B56\u7565\u4E0E\u5EFA\u8BAE",sort_order:5,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000014",node_code:"structure_planning",label:"\u7ED3\u6784\u89C4\u5212",sort_order:6,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000015",node_code:"preview_personalization",label:"\u9884\u89C8\u4E0E\u4E2A\u6027\u5316",sort_order:7,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000016",node_code:"publishing",label:"\u7F51\u7AD9\u53D1\u5E03",sort_order:8,is_enabled:!0}],without_website:[{id:"01900000-0000-7000-8000-00000000000b",node_code:"welcome",label:"\u6B22\u8FCE\u542F\u52A8",sort_order:1,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000c",node_code:"customer_materials",label:"\u5BA2\u6237\u8D44\u6599\u63D0\u4F9B",sort_order:2,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000d",node_code:"analysis",label:"\u667A\u80FD\u5206\u6790",sort_order:3,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000e",node_code:"strategy",label:"\u7B56\u7565\u4E0E\u5EFA\u8BAE",sort_order:4,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000017",node_code:"structure_planning",label:"\u7ED3\u6784\u89C4\u5212",sort_order:5,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000018",node_code:"preview_personalization",label:"\u9884\u89C8\u4E0E\u4E2A\u6027\u5316",sort_order:6,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000019",node_code:"publishing",label:"\u7F51\u7AD9\u53D1\u5E03",sort_order:7,is_enabled:!0}]}}],C1=to[0].definitions,Ic=P.number().int().min(1),fg=P.object({id:Q,flow_type:tn,definition_version:Ic,node_code:It,label:P.string().min(1),sort_order:P.number().int().min(1),is_enabled:P.boolean(),state:ug}),Tc=P.object({id:Ua,tenant_id:P.string().min(1),site_id:k,workflow_id:nt,node_code:It,task_type:fc,external_task_id:P.string().min(1),execution_status:bc,idempotency_key:P.string().min(1),attempt_no:P.number().int().min(1),source_crawl_task_ref_id:P.string().uuid().nullable(),succeeded_at:P.string().min(1).nullable(),superseded_at:P.string().min(1).nullable(),site_url:P.string().url().nullable(),created_at:P.string().min(1),updated_at:P.string().min(1)}),bg=P.object({id:nt,tenant_id:P.string().min(1),site_id:k,flow_type:tn,website:Zs.nullable(),definition_version:Ic,current_node_code:It,status:pg,started_at:P.string().min(1),completed_at:P.string().min(1).nullable(),created_at:P.string().min(1),updated_at:P.string().min(1)}),no=P.object({workflow:bg,menu:P.array(fg),task_refs:P.array(Tc),site:P.object({default_locale:Ee.optional(),status:Js,deployment_status:eo,archived_at:P.string().min(1).nullable(),current_sitemap_id:P.string().nullable().optional(),current_sitemap_version:P.number().int().positive().nullable().optional(),confirmed_sitemap_id:P.string().nullable().optional(),confirmed_sitemap_version:P.number().int().positive().nullable().optional(),structure_confirmed_at:P.string().min(1).nullable().optional(),current_snapshot_id:P.string().nullable(),deployed_url:P.string().url().nullable(),cms_site_id:P.string().min(1).nullish()})}),D1=L(no),O1=L(Tc),Sc=P.array(P.string().min(1).max(64)).max(16).optional(),N1=P.discriminatedUnion("flow_type",[P.object({flow_type:P.literal("with_website"),website:Zs,client_capabilities:Sc}).strict(),P.object({flow_type:P.literal("without_website"),website:P.null().optional(),client_capabilities:Sc}).strict()]),j1=P.object({expected_current_node:P.literal("website_scan"),website:Zs}).strict(),L1=P.object({expected_current_node:It}).strict(),M1=P.object({expected_current_node:P.literal("publishing")}).strict(),U1=P.object({expected_current_node:P.literal("preview_personalization"),publish_workflow_id:ri,expected_publish_revision:P.number().int().min(1)}).strict(),yg=P.object({node_code:It,task_type:fc,external_task_id:P.string().min(1).max(255),idempotency_key:P.string().min(1).max(255),site_url:P.string().url().optional()}),F1=yg.extend({workflow_id:nt}).strict(),G1=P.object({external_task_id:P.string().min(1).max(255),execution_status:bc}),xg=P.object({previous_external_task_id:P.string().min(1).max(255),external_task_id:P.string().min(1).max(255),idempotency_key:P.string().min(1).max(255),site_url:P.string().url().optional()}),q1=xg.extend({workflow_id:nt}).strict(),Eg=P.object({previous_external_task_id:P.string().min(1).max(255),external_task_id:P.string().min(1).max(255),idempotency_key:P.string().min(1).max(255),site_url:P.string().url()}),W1=Eg.extend({workflow_id:nt}).strict(),K1=P.object({}).strict();function Rg(e,n,i){return e.find(s=>s.definition_version===i)?.definitions[n]}function Ig(e,n){return Rg(to,e,n)}function Tg(e,n=1){let i=Ig(e,n);if(!i)throw new Error(`Unknown workflow definition: ${e} v${n}.`);return i}function kg(e,n,i){let s=new Set(i);return e.filter(o=>o.published&&(o.required_client_capability===null||s.has(o.required_client_capability))).sort((o,a)=>a.definition_version-o.definition_version).map(o=>({definition_version:o.definition_version,items:o.definitions[n]}))[0]}function B1(e,n){return kg(to,e,n)}function z1(e,n){return Tg(e).findIndex(i=>i.node_code===n)}function H1(e,n){return e==="website_scan"?n==="website_crawl"||n==="website_basic_info_extract"||n==="website_metrics_evaluate":e==="customer_materials"?n==="company_info":e==="analysis"?n==="intelligent_analysis":e==="strategy"?n==="strategy_recommendation":!1}function V1(e,n){if(e===n)return n;if(!{started:["running","succeeded","failed","invalidated"],running:["succeeded","failed","invalidated"],succeeded:["invalidated"],failed:["invalidated"],invalidated:[]}[e].includes(n))throw new Error(`Invalid task execution status transition: ${e} -> ${n}`);return n}function $1(e,n){if(e===n)return n;if(!{draft:["structure_saved"],structure_saved:["generating","draft"],generating:["workspace_ready","structure_saved"],workspace_ready:[]}[e].includes(n))throw new Error(`Invalid site build status transition: ${e} -> ${n}`);return n}import{z as I}from"zod";var io=I.string().min(1).max(120).regex(/^[a-z][a-z0-9_-]*$/),Le=I.string().min(1).max(120).regex(/^[A-Za-z_][A-Za-z0-9_]*$/),Ag=I.enum(["text","select","multi_select","tags","category_list","boolean","number"]),Un=I.string().min(1).max(512).regex(/^\/(?:[^?#]*)$/),wg=I.object({minimum:I.number().finite(),maximum:I.number().finite(),step:I.number().finite().positive()}).strict().refine(e=>e.minimum<e.maximum,{message:"minimum must be less than maximum"}),Pg=I.string().trim().min(1).max(100),Ac=I.array(Pg).max(5).refine(e=>new Set(e.map(n=>n.toLowerCase())).size===e.length,{message:"popular_terms must be unique ignoring case"}),Z1=I.array(I.string()).max(20).transform(e=>{let n=new Set;return e.map(i=>i.trim()).filter(i=>{if(i.length===0||i.length>100)return!1;let s=i.toLowerCase();return n.has(s)?!1:(n.add(s),!0)}).slice(0,5)}),wc=I.object({filter_enabled:I.boolean(),selected_fields:I.array(Le).max(64),selected_card_fields:I.array(Le).max(64).default([]),popular_terms_enabled:I.boolean().default(!1),popular_terms:Ac.optional()}).strict(),vg=I.object({app_slug:io}).extend(wc.shape).strict(),so=I.object({kind:I.literal("product_search_confirmation"),baseline_snapshot_id:A,target_route_id:Un,applications:I.array(I.object({app_slug:io,label:I.string().min(1).max(200),popular_terms:Ac.default([]),current_config:wc.nullable().default(null),affected_routes:I.array(Un).max(64).default([]),fields:I.array(I.object({field_name:Le,label:I.string().min(1).max(200),value_shape:Ag,option_count:I.number().int().nonnegative().optional(),filter_meta:wg.optional()}).strict()).max(64)}).strict()).min(1).max(12),current_config:vg.nullable().optional(),affected_routes:I.array(Un).min(1).max(64).optional()}).strict(),Cg=I.object({kind:I.literal("product_search_confirmation"),action:I.enum(["confirm","modify"]),app_slug:io,filter_enabled:I.boolean(),popular_terms_enabled:I.boolean().default(!1),selected_fields:I.array(Le).max(64),selected_card_fields:I.array(Le).max(64).default([])}).strict().superRefine((e,n)=>{e.filter_enabled&&e.selected_fields.length===0&&n.addIssue({code:"custom",path:["selected_fields"],message:"selected_fields must not be empty while filters are enabled"}),new Set(e.selected_fields).size!==e.selected_fields.length&&n.addIssue({code:"custom",path:["selected_fields"],message:"selected_fields must be unique"}),new Set(e.selected_card_fields).size!==e.selected_card_fields.length&&n.addIssue({code:"custom",path:["selected_card_fields"],message:"selected_card_fields must be unique"})}),vi=I.union([Cg,I.object({kind:I.literal("product_search_confirmation"),action:I.literal("cancel")}).strict()]),Fn=I.union([I.string().max(255),I.number().finite(),I.boolean()]),Dg=I.object({values:I.array(Fn).min(1).max(20).refine(e=>new Set(e.map(n=>`${typeof n}:${String(n)}`)).size===e.length,{message:"values must be unique"})}).strict(),Og=I.object({min:I.number().finite().optional(),max:I.number().finite().optional(),include_unlabeled:I.boolean().optional()}).strict().refine(e=>e.min!==void 0||e.max!==void 0||e.include_unlabeled===!0,{message:"a numeric boundary or include_unlabeled is required"}).refine(e=>e.min===void 0||e.max===void 0||e.min<=e.max,{message:"min must not be greater than max"}),Ng=I.object({q:I.string().max(200),page:I.number().int().min(1).max(500),page_size:I.union([I.literal(9),I.literal(20)]),sort:I.enum(["published_at_desc","published_at_asc","product_name_asc","product_name_desc"]),filters:I.record(Le,I.union([Dg,Og])).superRefine((e,n)=>{Object.keys(e).length>12&&n.addIssue({code:"custom",message:"filters must contain at most 12 fields"})}),display_fields:I.array(Le).max(64).default([]),missing_count_fields:I.array(Le).max(12).default([]),relaxation_count_fields:I.array(Le).max(12).default([]),facets:I.array(I.object({field:Le,query:I.string().max(100),page:I.number().int().min(1).max(100),page_size:I.literal(10),include_values:I.array(Fn).max(20)}).strict()).max(8)}).strict(),kc=I.object({value:Fn,label:I.string().max(200),count:I.number().int().nonnegative()}).strict(),jg=I.union([Fn,I.array(Fn).max(50)]),Lg=I.object({items:I.array(I.object({id:I.number().int().positive(),thumbnail:I.string().max(2048).nullable(),title:I.string().max(300),summary:I.string().max(2e3),category:I.string().max(300).nullable(),field_values:I.record(Le,jg).default({}),url:I.string().min(1).max(2048)}).strict()).max(20),page:I.object({total:I.number().int().nonnegative(),page:I.number().int().positive(),page_size:I.union([I.literal(9),I.literal(20)])}).strict(),facets:I.array(I.object({field:Le,total:I.number().int().nonnegative(),page:I.number().int().positive(),page_size:I.literal(10),values:I.array(kc).max(10),selected_values:I.array(kc).max(20)}).strict()).max(8),missing_counts:I.record(Le,I.number().int().nonnegative()).default({}),relaxation_counts:I.record(Le,I.number().int().nonnegative()).default({})}).strict(),J1=I.object({contract_version:I.literal(1),request:Ng,response:Lg}).strict();import{z as Ge}from"zod";var oo=4,nw=20,iw=1440*60*1e3,sw=1e6,Mg=["image/png","image/jpeg","image/webp"],ao=Ge.enum(Mg),ow="WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT",aw="WORKSPACE_ATTACHMENT_TOO_LARGE",rw="WORKSPACE_ATTACHMENT_LIMIT",cw="WORKSPACE_ATTACHMENT_BOUND",mw=10,lw=3600*1e3,pw="WORKSPACE_ATTACHMENT_URL_REJECTED",dw="WORKSPACE_ATTACHMENT_CAPTURE_FAILED",uw="WORKSPACE_ATTACHMENT_CAPTURE_BUSY",_w="WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT",gw="WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_EXCEEDED",hw="WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE",Sw=Ge.object({attachment_id:Ge.string().min(1),media_type:ao,width:Ge.number().int().positive(),height:Ge.number().int().positive(),size_bytes:Ge.number().int().nonnegative(),filename:Ge.string().min(1).max(120),image_url:Ge.string().min(1),source_url:Ge.string().min(1).optional(),created_at:Ge.string().min(1)}).strict(),fw=Ge.object({url:Ge.string().url().max(2048),full_page:Ge.boolean().optional()}).strict(),Pc="[A-Za-z0-9_-]+",Ug=new RegExp(`^/sites/(${Pc})/workspace/attachments/(${Pc})/image$`);function bw(e,n){return`/sites/${encodeURIComponent(e)}/workspace/attachments/${encodeURIComponent(n)}/image`}function ro(e){let n=Ug.exec(e);return n?{site_id:n[1],attachment_id:n[2]}:null}function yw(e){let n=[];for(let i of e){if(i.type!=="file"||typeof i.url!="string")continue;let s=ro(i.url);s&&n.push({attachment_id:s.attachment_id,site_id:s.site_id,media_type:typeof i.mediaType=="string"?i.mediaType:"",filename:typeof i.filename=="string"&&i.filename.trim()!==""?i.filename:"image",url:i.url})}return n}import{z as Gn}from"zod";var Fg=["deployment_queued","prepare_source","build_artifact","publish_site","site_released","cleanup_release"],Gg=Gn.enum(Fg),qg=Gn.enum(["running","succeeded","failed"]),Wg=Gn.object({code:Gg,status:qg,message:Gn.string().trim().min(1)}).strict(),vc=Gn.array(Wg);import{z as qn}from"zod";var Kg={slug:/^page_[0-9]+_slug$/,showInHeader:/^page_[0-9]+_show_in_header$/,showInFooter:/^page_[0-9]+_show_in_footer$/,type:/^block_[0-9]+_type$/};function Tw(e){let n={},i=new Set;for(let s of e){if(!Kg[s.field].test(s.key))throw new Error("Invalid Sitemap Resolver answer-sheet hole key.");if(i.has(s.key))throw new Error("Duplicate Sitemap Resolver answer-sheet hole key.");i.add(s.key),n[s.key]=s.field==="slug"?qn.string().min(1):s.field==="type"?qn.string().trim().min(1):qn.boolean()}return qn.object({answers:qn.object(n).strict()}).strict()}import{z as v}from"zod";var Bg=v.enum(["pending","running","succeeded","failed"]),zg=v.enum(["TASK_FAILED","WEBSITE_UNREACHABLE"]),Hg=v.object({task_id:v.string().uuid(),site_url:v.string().url(),crawler_task_id:v.string().min(1).max(255).nullable(),crawler_error_code:zg.nullable().optional(),crawler_failure_stage:v.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]).nullable().optional(),page_count:v.number().int().min(0).max(20),status:Bg,error:v.string().nullable(),created_at:v.string().min(1),updated_at:v.string().min(1)}),Pw=L(Hg),co=v.enum(["existing_site","new_site"]),Dc=v.enum(["google_indexing","ai_recommendation","qualification_verifiability","content_freshness","inquiry_form","inquiry_response","privacy_compliance","prohibited_content"]),Cc=v.object({observed_result:v.enum(["pass","fail","unknown"])}).strict(),Oc=v.object({kind:v.literal("ai_crawlability"),checks:v.object({ai_access_guidance:Cc,structured_data_presence:Cc}).strict()}).strict(),mo=v.object({label:v.string().trim(),value:v.union([v.string(),v.number(),v.boolean(),v.null()]),summary:v.string().trim(),tone:v.enum(["good","warn","bad","unknown"]),status:v.enum(["ok","unknown"]),assessment:Oc.optional()}),Ci=v.object({key:v.string().trim().min(1).max(100),label:v.string().trim().min(1).max(100),value:v.union([v.string().max(1e3),v.number(),v.boolean(),v.null()]),tone:v.enum(["good","warn","bad","unknown"]),status:v.enum(["ok","unknown"]),evidence:v.string().trim().max(2e3).optional(),assessment:Oc.optional()}).strict(),Vg=v.object({url:v.string().url().max(2048),title:v.string().trim().max(300),words:v.number().int().nonnegative().max(1e7)}).strict(),$g=v.object({site_url:v.string().url().max(2048),scanned_at:v.string().datetime({offset:!0}),reach:v.array(Ci).max(64),trust:v.array(Ci).max(64),convert:v.array(Ci).max(64),safe:v.array(Ci).max(64),pages:v.array(Vg).max(100)}).strict(),Di=v.object({company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128),type:co,result:v.object({company_name:v.string(),website:v.string().url().optional(),primary_product:v.string(),current_market:v.string(),qualifications:v.string(),scan_cards:v.record(v.string(),mo),scan_result:$g.optional()})}),Yg=v.object({saved:v.literal(!0),company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128)}),vw=L(Yg),Xg=v.enum(["snapshot","task"]),Qg=Di.shape.result.extend({type:co,structured_facts:v.unknown().optional()}).extend({company_name:v.string(),primary_product:v.string(),current_market:v.string(),qualifications:v.string()}),Zg=v.object({site_id:v.string().min(1).max(128),company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128),type:co,data_source:Xg,result:Qg}),Cw=L(Zg.nullable());import{z as Re}from"zod";var Tt=Re.enum(["company","product_service","case_qualification","market","contact_inquiry","privacy_compliance","news_freshness"]),Jg=Re.object({ordinal:Re.number().int().min(1).max(1e4),path:Re.string().min(1).max(2048).refine(e=>!nh(e),{message:"path must be a site-relative path, not an absolute URL"}),last_modified:Re.string().max(64).nullable()}).strict(),Nw=Re.object({candidates:Re.array(Jg).min(1).max(1e4),selection_limit:Re.number().int().min(1).max(19)}).strict().superRefine((e,n)=>{let i=e.candidates.map(s=>s.ordinal).sort((s,o)=>s-o);for(let[s,o]of i.entries())if(o!==s+1){n.addIssue({code:"custom",path:["candidates"],message:"candidates ordinals must be unique and consecutive from 1"});return}}),eh=Re.object({ordinal:Re.number().int().positive().max(1e4),roles:Re.array(Tt).min(1).max(7)}).strict(),th=Re.object({role:Tt,status:Re.enum(["selected","not_found"]),selected_ordinals:Re.array(Re.number().int().positive().max(1e4)).max(19)}).strict(),jw=Re.object({selections:Re.array(eh).max(19),coverage:Re.array(th).length(7)}).strict().superRefine((e,n)=>{let i=new Set;for(let[o,a]of e.coverage.entries())i.has(a.role)&&n.addIssue({code:"custom",path:["coverage",o,"role"],message:"coverage roles must be unique"}),i.add(a.role);for(let o of Tt.options)i.has(o)||n.addIssue({code:"custom",path:["coverage"],message:`coverage must include every page role (missing ${o})`});let s=new Map;for(let o of e.selections)for(let a of o.roles){let c=s.get(a)??new Set;c.add(o.ordinal),s.set(a,c)}for(let[o,a]of e.coverage.entries()){let c=s.get(a.role);a.selected_ordinals.some(m=>!c?.has(m))&&n.addIssue({code:"custom",path:["coverage",o,"selected_ordinals"],message:"selected_ordinals must reference selections carrying the same role"})}});function nh(e){let n=e.toLowerCase();return n.startsWith("http://")||n.startsWith("https://")||e.startsWith("//")}import{z as b}from"zod";var Fw=b.object({force_refresh:b.boolean().optional()}),jc=b.enum(["running","succeeded","failed"]),ih=b.object({agent_id:b.string().min(1),name:b.string().min(1),icon:b.string().min(1),capability:b.string().min(1),data_source:b.string().min(1),output_topics:b.string().min(1)}),sh=b.object({site_mode:b.enum(["existing_site","new_site"]),scan_required:b.boolean(),scheduled_agent_ids:b.array(b.string().min(1)),omitted_agent_ids:b.array(b.string().min(1)),next_stage:b.enum(["diagnostic_report","strategy"])}),oh=b.object({t:b.string(),d:b.string(),evidence:b.object({from:b.string(),url:b.string().nullable().optional(),value:b.string().nullable().optional()})}),ah=b.enum(["complete","partial","insufficient_data","failed"]),rh=b.enum(["ok","failed","insufficient_data"]),lo=b.object({agent_id:b.string().min(1),name:b.string().min(1),icon:b.string().min(1),status:rh,topics:b.array(b.object({topic_id:b.string().min(1),status:ah,evidence_refs:b.array(b.string())})).length(3),findings:b.array(oh).max(3),elapsed_ms:b.number().nonnegative(),note:b.string().optional(),error:b.string().optional()}),Lc=b.object({total:b.number().int().nonnegative(),ok:b.number().int().nonnegative(),degraded:b.number().int().nonnegative(),total_findings:b.number().int().nonnegative(),elapsed_ms:b.number().nonnegative(),site_mode:b.enum(["existing_site","new_site"]).optional(),scheduled_agent_ids:b.array(b.string()).optional(),omitted_agent_ids:b.array(b.string()).optional(),scheduled:b.number().int().nonnegative().optional(),complete:b.number().int().nonnegative().optional(),partial:b.number().int().nonnegative().optional(),insufficient:b.number().int().nonnegative().optional(),failed:b.number().int().nonnegative().optional(),next_stage:b.enum(["diagnostic_report","strategy"]).optional()}),ch=b.object({agents_done:b.boolean(),analysis:b.record(b.string(),lo),step4_scoring_input:b.unknown().optional(),summary:Lc}),Mc=b.object({job_id:b.string().min(1),site_id:b.string().min(1),model_version:b.string().min(1),output_locale:b.string().min(2),cached:b.boolean().optional(),status:jc,result:ch.nullable().optional(),error:b.string().nullable().optional()}),Gw=L(b.array(ih)),qw=L(sh),Ww=L(Mc),Kw=L(Mc.nullable()),gt=b.object({id:b.union([b.number().int().nonnegative(),b.string().regex(/^(0|[1-9]\d*)$/u).transform(Number)]).pipe(b.number().int().nonnegative())}),Nc=b.object({percent:b.number().int().min(0).max(100),phase:b.enum(["preparing","analyzing","finalizing","completed","failed"]),stage:b.enum(["queued","baseline_ready","source_pages_ready","external_evidence_ready","knowledge_evidence_ready","page_evidence_ready","analysis_context_ready","preparation_saved","workflow_ready","agent_started","agent_completed","workflow_completed","scoring_input_ready","red_texts_ready","result_ready","result_persisted","completed","failed"]),agents_done:b.number().int().nonnegative(),agents_total:b.number().int().nonnegative(),agent_id:b.string().min(1).optional()}),Bw=b.discriminatedUnion("event",[gt.extend({event:b.literal("snapshot"),data:b.object({job_id:b.string().min(1),status:jc,done:b.number().int().nonnegative(),total:b.number().int().nonnegative(),results:b.array(lo),progress:Nc.optional()})}),gt.extend({event:b.literal("progress"),data:Nc}),gt.extend({event:b.literal("preparing_started"),data:b.object({stage:b.literal("baseline")})}),gt.extend({event:b.literal("preparing_progress"),data:b.object({stage:b.enum(["context","external_evidence"])})}),gt.extend({event:b.literal("preparing_done"),data:b.object({evidence_count:b.number().int().nonnegative(),rule_count:b.number().int().nonnegative(),degraded_capabilities:b.array(b.string())})}),gt.extend({event:b.literal("agent_start"),data:b.object({agent_id:b.string().min(1),name:b.string().min(1),icon:b.string().min(1)})}),gt.extend({event:b.literal("agent_done"),data:lo}),gt.extend({event:b.literal("done"),data:b.object({agents_done:b.literal(!0),summary:Lc})}),gt.extend({event:b.literal("failed"),data:b.object({message:b.string().min(1)})})]);import{z as M}from"zod";var uo=M.enum(["reach","trust","convert","safe"]),Ce=M.number().finite(),mh=M.number().finite().positive(),po=["reach","trust","convert","safe"],lh=17,ph=M.enum(["passed","partial","failed"]),dh=M.object({landing_page_mode:M.enum(["intent_dynamic","static","none"]),ab_test_enabled:M.boolean()}).strict(),uh=M.union([M.boolean(),M.number().finite(),ph,dh]).nullable(),_h=M.union([M.boolean(),M.number().finite()]).nullable(),gh=M.object({competitor_avg:M.number().finite(),score_items:M.record(M.string(),uh),penalty_items:M.record(M.string(),_h),red_texts:M.array(M.string())}).strict(),hh=M.record(uo,gh),Sh=M.object({key:uo,score:Ce,pass_score:Ce,gap:Ce}),fh=M.object({key:M.string(),title:M.string(),is_redline_option:M.boolean().optional(),score:Ce,max_score:mh,pass_score:Ce,passed:M.boolean(),description:M.string()}),bh=M.object({key:uo,title:M.string(),alias:M.string(),slogan:M.string(),score:Ce,max_score:M.literal(100),pass_score:Ce,competitor_average:Ce,status:M.enum(["reached","near","not_reached"]),status_name:M.enum(["\u8FBE\u6807","\u63A5\u8FD1","\u672A\u8FBE\u6807"]),summary:M.string(),sub_dimensions:M.array(fh),red_texts:M.array(M.string()),redline_hit:M.boolean().optional()}),yh=M.object({id:M.number().int().positive(),task_code:M.string().min(1).max(128),is_sync:M.literal(0),status:M.literal("succeeded"),rules:hh,scores_list:M.object({overview:M.object({pass_scores:M.object({reach:Ce,trust:Ce,convert:Ce,safe:Ce}),total_score:Ce,total_pass_score:Ce,score_gap:Ce,competitor_average_score:Ce,scoring_criteria_text:M.string().min(1),gap_dimensions:M.array(Sh).max(4),overall_passed:M.boolean(),all_scores_passed:M.boolean(),diagnosis_passed:M.boolean(),commitment_eligible:M.boolean(),safe_redline_hit:M.boolean()}),dimensions:M.array(bh).length(4)}),created_at:M.string().datetime({offset:!0}),updated_at:M.string().datetime({offset:!0})}).superRefine((e,n)=>{xh(e.scores_list.dimensions)||n.addIssue({code:"custom",path:["scores_list","dimensions"],message:"dimensions must include each canonical score dimension."}),e.scores_list.dimensions.reduce((s,o)=>s+o.sub_dimensions.length,0)!==lh&&n.addIssue({code:"custom",path:["scores_list","dimensions"],message:"dimensions must include 17 subdimensions in total."});for(let[s,o]of e.scores_list.dimensions.entries()){if(o.redline_hit===void 0)continue;let a=o.sub_dimensions.findIndex(c=>c.is_redline_option===void 0);a!==-1&&n.addIssue({code:"custom",path:["scores_list","dimensions",s,"sub_dimensions",a,"is_redline_option"],message:"subdimensions must define is_redline_option when redline_hit is defined."})}}),$w=L(yh);function xh(e){let n=e.map(i=>i.key);return n.length===po.length&&new Set(n).size===po.length&&po.every(i=>n.includes(i))}var kt={queued:["preparing_source","lock_failed","deploy_failed"],preparing_source:["building","source_prepare_failed","deploy_failed"],building:["artifact_ready","build_failed","artifact_fetch_failed","artifact_validation_failed","deploy_failed"],artifact_ready:["deploying","deploy_failed"],deploying:["released","deploy_failed"],released:[],lock_failed:[],source_prepare_failed:[],build_failed:[],artifact_fetch_failed:[],artifact_validation_failed:[],deploy_failed:[],cleanup_failed:[]};for(let e of Object.values(kt))Object.freeze(e);Object.freeze(kt);var Qw=Object.freeze(Yt.filter(e=>kt[e].length>0)),Zw=Object.freeze(Yt.filter(e=>kt[e].length===0)),Eh=Object.freeze(["preparing_source","building","artifact_ready","deploying","released"]),Rh="DEPLOYMENT_TRANSITION_INVALID",_o=class extends Error{constructor(n,i){super(`Invalid deployment transition: ${n} -> ${i}`),this.currentStatus=n,this.nextStatus=i,this.code=Rh,this.name="DeploymentTransitionError"}};function Jw(e){return kt[e]}function eP(e){return Yt.filter(n=>kt[n].some(i=>i===e))}function Ih(e){return kt[e].length>0}function tP(e){return!Ih(e)}function nP(e,n){if(!kt[e].some(i=>i===n))throw new _o(e,n);return n}function iP(){return Eh}import{converter as Th,formatHex as kh,parse as Ah,wcagContrast as aP}from"culori";var rP=Th("oklch");var T={paper:"oklch(0.92 0.008 250)",cream:"oklch(0.90 0.035 85)",sand:"oklch(0.75 0.05 78)",stone:"oklch(0.60 0.02 75)",ash:"oklch(0.60 0.012 250)",slate:"oklch(0.45 0.025 250)",charcoal:"oklch(0.30 0.015 255)",ink:"oklch(0.25 0.04 260)",sky:"oklch(0.72 0.12 230)",blue:"oklch(0.58 0.17 250)","medical blue":"oklch(0.58 0.12 235)",indigo:"oklch(0.50 0.18 280)",navy:"oklch(0.40 0.10 258)",ocean:"oklch(0.55 0.13 220)","slate blue":"oklch(0.46 0.06 245)",teal:"oklch(0.60 0.12 195)","soft aqua":"oklch(0.78 0.07 190)",mint:"oklch(0.78 0.10 165)",sage:"oklch(0.65 0.05 145)",green:"oklch(0.58 0.15 145)","clinical green":"oklch(0.62 0.12 155)",emerald:"oklch(0.60 0.16 155)",forest:"oklch(0.45 0.10 145)",olive:"oklch(0.58 0.08 115)",lime:"oklch(0.72 0.17 130)",yellow:"oklch(0.82 0.15 100)",gold:"oklch(0.72 0.14 85)",amber:"oklch(0.70 0.16 70)",orange:"oklch(0.66 0.18 55)",coral:"oklch(0.68 0.16 32)",terracotta:"oklch(0.55 0.12 42)",rust:"oklch(0.50 0.13 38)",brown:"oklch(0.45 0.07 55)",rose:"oklch(0.65 0.16 18)",red:"oklch(0.58 0.20 25)",crimson:"oklch(0.52 0.20 22)",wine:"oklch(0.42 0.13 18)",pink:"oklch(0.72 0.14 0)",magenta:"oklch(0.60 0.22 345)",lavender:"oklch(0.72 0.08 295)",violet:"oklch(0.58 0.19 295)",purple:"oklch(0.52 0.19 305)",plum:"oklch(0.45 0.13 325)",electric:"oklch(0.62 0.23 285)","clean white":"oklch(0.97 0.01 245)","cool gray":"oklch(0.62 0.02 245)",zinc:"oklch(0.60 0.012 250)",gray:"oklch(0.60 0.012 250)",grey:"oklch(0.60 0.012 250)",neutral:"oklch(0.60 0.005 250)",gunmetal:"oklch(0.30 0.015 255)"},wh={\u84DD:T.blue,\u84DD\u8272:T.blue,\u5929\u84DD:T.sky,\u5929\u84DD\u8272:T.sky,\u6D45\u84DD:T.sky,\u6E56\u84DD:T.ocean,\u6D77\u84DD:T.ocean,\u6DF1\u84DD:T.navy,\u85CF\u84DD:T.navy,\u85CF\u9752:T.navy,\u6D77\u519B\u84DD:T.navy,\u6DF1\u6D77\u519B\u84DD:T.navy,\u5348\u591C\u84DD:T.navy,\u975B\u84DD:T.indigo,\u975B\u9752:T.indigo,\u94A2\u84DD:T["slate blue"],\u9752:T.teal,\u9752\u8272:T.teal,\u84DD\u7EFF:T.teal,\u7EFF:T.green,\u7EFF\u8272:T.green,\u6D45\u7EFF:T.mint,\u8584\u8377\u7EFF:T.mint,\u8349\u7EFF:T.lime,\u6A44\u6984\u7EFF:T.olive,\u58A8\u7EFF:T.forest,\u6DF1\u7EFF:T.forest,\u68EE\u6797\u7EFF:T.forest,\u7FE0\u7EFF:T.emerald,\u7956\u6BCD\u7EFF:T.emerald,\u9EC4:T.yellow,\u9EC4\u8272:T.yellow,\u91D1:T.gold,\u91D1\u8272:T.gold,\u91D1\u9EC4:T.gold,\u7425\u73C0:T.amber,\u7425\u73C0\u8272:T.amber,\u6A59:T.orange,\u6A59\u8272:T.orange,\u6A58\u8272:T.orange,\u6A58\u9EC4:T.orange,\u6D3B\u529B\u6A59:T.orange,\u6696\u6A59:T.orange,\u73CA\u745A:T.coral,\u73CA\u745A\u6A59:T.coral,\u9676\u571F:T.terracotta,\u8D64\u9676:T.terracotta,\u9508\u7EA2:T.rust,\u68D5:T.brown,\u68D5\u8272:T.brown,\u8910\u8272:T.brown,\u5496\u5561\u8272:T.brown,\u7EA2:T.red,\u7EA2\u8272:T.red,\u6731\u7EA2:T.red,\u7EEF\u7EA2:T.crimson,\u6DF1\u7EA2:T.crimson,\u9152\u7EA2:T.wine,\u73AB\u7470:T.rose,\u73AB\u7EA2:T.rose,\u7C89:T.pink,\u7C89\u8272:T.pink,\u7C89\u7EA2:T.pink,\u6D0B\u7EA2:T.magenta,\u54C1\u7EA2:T.magenta,\u7D2B:T.purple,\u7D2B\u8272:T.purple,\u6DE1\u7D2B:T.lavender,\u85B0\u8863\u8349:T.lavender,\u7D2B\u7F57\u5170:T.violet,\u6885\u7EA2:T.plum,\u7070:T.gray,\u7070\u8272:T.gray,\u6D45\u7070:T.gray,\u6DE1\u7070:T.gray,\u51B7\u7070:T["cool gray"],\u51B7\u7070\u767D:T["cool gray"],\u6696\u7070:T.stone,\u6DF1\u7070:T.slate,\u77F3\u58A8\u7070:T.slate,\u77F3\u677F\u7070:T.slate,\u70AD\u7070:T.charcoal,\u70AD\u9ED1:T.charcoal,\u58A8:T.ink,\u58A8\u8272:T.ink,\u9ED1:T.ink,\u9ED1\u8272:T.ink,\u767D:T["clean white"],\u767D\u8272:T["clean white"],\u7C73\u767D:T.cream,\u7C73\u8272:T.cream,\u8C61\u7259\u767D:T.cream,\u5976\u6CB9\u767D:T.cream,\u6C99\u8272:T.sand},cP={...T,...wh};function go(e){let n=Ah(e.trim());return n?kh(n)??null:null}var ht={Inter:{import:"Inter"},"Inter Tight":{import:"Inter_Tight"},"DM Sans":{import:"DM_Sans"},"Source Sans 3":{import:"Source_Sans_3"},"Libre Franklin":{import:"Libre_Franklin"},Montserrat:{import:"Montserrat"},Archivo:{import:"Archivo"},"Space Grotesk":{import:"Space_Grotesk"},Manrope:{import:"Manrope"},"IBM Plex Sans":{import:"IBM_Plex_Sans"},Oswald:{import:"Oswald"},"Roboto Condensed":{import:"Roboto_Condensed"},"Bebas Neue":{import:"Bebas_Neue",weights:["400"]},"Playfair Display":{import:"Playfair_Display"},Lora:{import:"Lora"},Fraunces:{import:"Fraunces"},"Cormorant Garamond":{import:"Cormorant_Garamond"},"JetBrains Mono":{import:"JetBrains_Mono"},"IBM Plex Mono":{import:"IBM_Plex_Mono",weights:["400","500","600","700"]},"Noto Sans SC":{import:"Noto_Sans_SC",download:!1},"Noto Serif SC":{import:"Noto_Serif_SC",download:!1}},Ph={heading:"Inter",body:"Inter"},Uc=ht.Inter;function Oi(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var Wc=(()=>{let e=new Map;for(let[n,i]of Object.entries(ht))e.set(Oi(n),i),e.set(Oi(i.import),i);return e})();function vh(e){return typeof e!="string"||e.trim().length===0?Uc:Wc.get(Oi(e))??Uc}var Ch=(()=>{let e=new Map;for(let[n,i]of Object.entries(ht))e.set(i.import,n);return e})();function nn(e){if(typeof e!="string"||e.trim().length===0)return"Inter";let n=Wc.get(Oi(e));return n?Ch.get(n.import)??"Inter":"Inter"}var Dh=Object.keys(ht),Fc='ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',Gc='Georgia, "Times New Roman", serif',qc='"SFMono-Regular", Consolas, monospace',Oh=new Set(["serif","sans-serif","sans serif","monospace","mono","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace"]),Nh=new Set(["Playfair Display","Lora","Fraunces","Cormorant Garamond","Noto Serif SC"].map(e=>e.toLowerCase())),jh=new Set(["JetBrains Mono","IBM Plex Mono"].map(e=>e.toLowerCase()));function Lh(e){let n=e.toLowerCase();return jh.has(n)||n.includes("mono")?"mono":Nh.has(n)||n.includes("serif")?"serif":"sans"}function ho(e,n){let i=m=>(m??"").trim().replace(/^['"]|['"]$/g,"").replace(/[^A-Za-z0-9 _-]+/g,"").trim().slice(0,60),s=i(e),o=i(n),a=m=>Oh.has(m.toLowerCase());if(s&&a(s)){let m=s.toLowerCase();return m.includes("mono")?qc:m.includes("serif")?Gc:Fc}let c=s;c||(c=a(o)?"":o),c||(c="Inter");let r=Lh(c);return r==="mono"?`"${c}", ${qc}`:r==="serif"?`"${c}", ${Gc}`:`"${c}", ${Fc}`}function Mh(e){return{"--site-font-sans":ho(e?.body,"Inter"),"--site-font-heading":ho(e?.heading,e?.body??"Inter")}}var So=["archivo-inter","playfair-source-sans","space-grotesk-manrope","fraunces-libre-franklin","noto-serif-sc-noto-sans-sc","noto-sans-sc"],Kc=[{id:"archivo-inter",heading:"Archivo",body:"Inter"},{id:"playfair-source-sans",heading:"Playfair Display",body:"Source Sans 3"},{id:"space-grotesk-manrope",heading:"Space Grotesk",body:"Manrope"},{id:"fraunces-libre-franklin",heading:"Fraunces",body:"Libre Franklin"},{id:"noto-serif-sc-noto-sans-sc",heading:"Noto Serif SC",body:"Noto Sans SC"},{id:"noto-sans-sc",heading:"Noto Sans SC",body:"Noto Sans SC"}];function Bc(e){let n=Kc.find(i=>i.id===e);if(!n)throw new Error(`Unknown font pairing: ${e}`);return n}import{z as sn}from"zod";import{z as Uh}from"zod";var Fh=["light","standard","bold"],qe=Uh.enum(Fh),Ni="standard",Gh=new Set(["display","heading","title"]),zc={light:{display:300,heading:400,title:400,ui:400,button:400,body:400,strong:600},standard:{display:600,heading:500,title:500,ui:400,button:500,body:400,strong:600},bold:{display:700,heading:700,title:700,ui:400,button:600,body:400,strong:700}},uP=Object.keys(zc.standard).map(e=>`--site-weight-${e}`),_P="--site-leading-body",gP=["--site-leading-display","--site-leading-heading","--site-leading-title"];function Qe(e,n){let i=[];for(let s=e;s<=n;s+=100)i.push(s);return i}var qh={"Source Sans 3":Qe(200,900),"Space Grotesk":Qe(300,700),Manrope:Qe(200,800),"IBM Plex Sans":Qe(100,700),Oswald:Qe(200,700),"Bebas Neue":[400],"Playfair Display":Qe(400,900),Lora:Qe(400,700),"Cormorant Garamond":Qe(300,700),"JetBrains Mono":Qe(100,800),"IBM Plex Mono":[400,500,600,700],"DM Sans":Qe(100,1e3)};function fo(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var Wh=new Set(Object.entries(ht).flatMap(([e,n])=>[fo(e),fo(n.import)]));function bo(e){if(!(e in ht)&&!Wh.has(fo(e)))return null;let n=nn(e);return ht[n].download===!1?null:qh[n]??Qe(100,900)}function Hc(e,n){return!n||n.length===0?e:n.reduce((i,s)=>Math.abs(s-e)<Math.abs(i-e)?s:i,n[0])}function hP(e,n){let i=zc[e??Ni],s=n?.heading?bo(n.heading):null,o=n?.body?bo(n.body):null,a={};for(let c of Object.keys(i)){let r=Gh.has(c)?s:o;a[`--site-weight-${c}`]=String(Hc(i[c],r))}return a}var Kh=/^(zh|ja|ko)(?:[-_]|$)/i,Bh=/^(ar|fa|hi|bn|ta|si|th|lo|km|my|vi)(?:[-_]|$)/i;function Vc(e){return Kh.test(e??"")?"dense":Bh.test(e??"")?"tall":"default"}function zh(e){return Vc(e)==="dense"?"1.75":"1.5"}var Hh={default:["1.1","1.2","1.3"],dense:["1.2","1.3","1.4"]};function SP(e){let n=Vc(e),i=zh(e),[s,o,a]=n==="tall"?[i,i,i]:Hh[n];return{"--site-leading-display":s,"--site-leading-heading":o,"--site-leading-title":a}}function fP(e,n){let i=bo(e);return[...new Set(n.map(o=>Hc(o,i)))].sort((o,a)=>o-a).map(String)}var on="/* <cms-builder:site-design-notes>",Kt="</cms-builder:site-design-notes> */",yo="palette-inputs: ",xo="type-inputs: ",At=sn.string().min(1).max(40),Eo=sn.object({primarySource:sn.enum(["user","derived"]),neutral:At.optional(),foreground:At.optional(),supporting:sn.array(At).max(4).optional(),imagePalette:sn.object({background:At.optional(),foreground:At.optional(),card:At.optional(),muted:At.optional(),border:At.optional()}).optional()}),Vh=sn.object({weightStyle:qe}),$h=e=>e.replaceAll("*/","* /").replace(/\s+/g," ").trim();function Yh(e){let n=e.lines.map($h).filter(Boolean).map(i=>` ${i}`);return e.paletteInputs&&n.push(` ${yo}${JSON.stringify(e.paletteInputs).replaceAll("*/","* /")}`),e.typeInputs&&n.push(` ${xo}${JSON.stringify(e.typeInputs).replaceAll("*/","* /")}`),[on,...n,` ${Kt}`].join(`
|
|
2
|
+
`)}function Ro(e){let n=e.indexOf(on),i=e.indexOf(Kt,n+1);return n===-1||i===-1?null:{start:n,end:i+Kt.length}}function EP(e){let n=Ro(e);if(!n)return e;let i=e.slice(0,n.start),s=e.slice(n.end);return i?(i.endsWith(`
|
|
3
3
|
`)&&(i=i.slice(0,-1)),s.startsWith(`
|
|
4
4
|
`)&&(s=s.slice(1))):s.startsWith(`
|
|
5
5
|
|
|
6
|
-
`)&&(s=s.slice(2)),i+s}function
|
|
7
|
-
`).map(r=>r.trim()).filter(Boolean))c.startsWith(yo)?o=
|
|
6
|
+
`)&&(s=s.slice(2)),i+s}function Xh(e){try{let n=JSON.parse(e),i=Eo.safeParse(n);return i.success?i.data:null}catch{return null}}function Qh(e){try{let n=JSON.parse(e),i=Vh.safeParse(n);return i.success?i.data:void 0}catch{return}}function $c(e){let n=Ro(e);if(!n)return null;let i=e.slice(n.start+on.length,n.end-Kt.length),s=[],o=null,a;for(let c of i.split(`
|
|
7
|
+
`).map(r=>r.trim()).filter(Boolean))c.startsWith(yo)?o=Xh(c.slice(yo.length)):c.startsWith(xo)?a=Qh(c.slice(xo.length)):s.push(c);return{lines:s,paletteInputs:o,...a?{typeInputs:a}:{}}}function RP(e,n){let i=Yh(n),s=Ro(e);if(s)return e.slice(0,s.start)+i+e.slice(s.end);let a=[...e.matchAll(/^@import[^\n]*\n/gm)].at(-1);if(!a||a.index===void 0)return`${i}
|
|
8
8
|
|
|
9
9
|
${e}`;let c=a.index+a[0].length;return`${e.slice(0,c)}
|
|
10
10
|
${i}
|
|
11
|
-
${e.slice(c)}`}var an="/* <cms-builder:global-design-tokens> */",Wn="/* </cms-builder:global-design-tokens> */",Me=class extends Error{constructor(n,i){super(`${n}: ${i}`),this.code=n,this.name="DesignTokenBlockError"}};function zh(e){let n=[],i=0;for(;i<e.length;){let s=e.indexOf(an,i),o=e.indexOf(Wn,i);if(s<0){if(o>=0)throw new Me("DESIGN_TOKEN_BLOCK_MISSING","a closing global-design-tokens marker appears without a matching opening marker.");break}if(o<0||o<s)throw new Me("DESIGN_TOKEN_BLOCK_MISSING","a global-design-tokens region is opened but never closed.");let a=s+an.length,c=e.indexOf(an,a);if(c>=0&&c<o)throw new Me("DESIGN_TOKEN_BLOCK_MISSING","global-design-tokens regions are nested; refusing to guess the intended boundaries.");n.push({bodyStart:a,bodyEnd:o}),i=o+Wn.length}if(n.length===0)throw new Me("DESIGN_TOKEN_BLOCK_MISSING","app/globals.css does not contain a cms-builder:global-design-tokens region.");return n}var Hh=/^--[A-Za-z0-9_-]+/;function Vh(e){return e===void 0||e==="{"||e==="}"||e===";"||/\s/.test(e)}function $c(e,n,i){let s=[],o=n,a=0;for(;o<i;){let c=e[o];if(c==="/"&&e[o+1]==="*"){let r=e.indexOf("*/",o+2);o=r<0||r>=i?i:r+2;continue}if(c==='"'||c==="'"){o=Yc(e,o,i);continue}if(c==="("){a+=1,o+=1;continue}if(c===")"){a=Math.max(0,a-1),o+=1;continue}if(c==="-"&&a===0&&e[o+1]==="-"&&Vh(o===0?void 0:e[o-1])){let r=Hh.exec(e.slice(o,i));if(r){let m=r[0],S=o+m.length;for(;S<i&&(e[S]===" "||e[S]===" ");)S+=1;if(e[S]===":"){for(S+=1;S<i&&(e[S]===" "||e[S]===" ");)S+=1;let g=S,w=$h(e,g,i),H=e.slice(g,w).trimEnd();s.push({name:m,value:H.trim(),valueStart:g,valueEnd:g+H.length}),o=w;continue}}}o+=1}return s}function Yc(e,n,i){let s=e[n],o=n+1;for(;o<i;){let a=e[o];if(a==="\\"){o+=2;continue}if(a===s)return o+1;o+=1}return i}function $h(e,n,i){let s=n,o=0;for(;s<i;){let a=e[s];if(a==="\\"){s+=2;continue}if(a==='"'||a==="'"){s=Yc(e,s,i);continue}if(a==="/"&&e[s+1]==="*"){let c=e.indexOf("*/",s+2);s=c<0||c>=i?i:c+2;continue}if(a==="(")o+=1;else if(a===")")o=Math.max(0,o-1);else if(o===0&&(a===";"||a==="}"))return s;s+=1}return i}function Xc(e){return zh(e).flatMap(n=>$c(e,n.bodyStart,n.bodyEnd))}function Yh(e){return new Set($c(e,0,e.length).map(n=>n.name))}var Xh=/[;{}]|\/\*|\*\/|[\r\n]/;function Qh(e,n){if(n.trim().length===0)throw new Me("DESIGN_TOKEN_UNSAFE_VALUE",`refusing to write an empty declaration value for ${e}.`);if(Xh.test(n))throw new Me("DESIGN_TOKEN_UNSAFE_VALUE",`refusing to write a declaration value for ${e} that contains a declaration or block terminator, a comment marker, or a newline.`)}function ji(e){let n=new Map;for(let i of Xc(e))n.set(i.name,i.value);return n}function yP(e,n,i={}){let s=Xc(e),o=new Set(s.map(g=>g.name)),a=new Set,c=new Set,r=[],m=null;for(let g of n.keys())if(!o.has(g)){if(i.derivedKeys?.has(g)!==!0){r.push(g);continue}m??=Yh(e),m.has(g)?c.add(g):a.add(g)}if(r.length>0)throw new Me("DESIGN_TOKEN_UNKNOWN",`refusing to add token names that the shared derivation never produces: ${r.join(", ")}`);for(let[g,w]of n)o.has(g)&&Qh(g,w);for(let g of a)i.onOutOfScopeToken?.(g);for(let g of c)i.onUnwritableToken?.(g);let S=e;for(let g=s.length-1;g>=0;g-=1){let w=s[g],K=n.get(w.name);K!==void 0&&(S=S.slice(0,w.valueStart)+K+S.slice(w.valueEnd))}return S}function Kn(e){let n=e.indexOf(an),i=e.indexOf(Wn);return n!==-1&&i!==-1&&i>n}var Qc=/(color-scheme:\s*)(light|dark)(\s*;)/;function Zh(e){let n=e.indexOf(an),i=e.indexOf(Wn);return n!==-1&&i>n?e.slice(n,i):null}function Jh(e){let i=Zh(e)?.match(Qc);return i?i[2]:null}function xP(e,n){let i=e.indexOf(an),s=e.indexOf(Wn);if(i===-1||s===-1||s<i)throw new Me("DESIGN_TOKEN_BLOCK_MISSING","globals.css has no design token block");let o=e.slice(i,s);return e.slice(0,i)+o.replace(Qc,`$1${n}$3`)+e.slice(s)}var eS=/["']([^"']+)["']/;function Vc(e){return e?.match(eS)?.[1]??null}function EP(e){if(!Kn(e))return null;let n;try{n=ji(e)}catch(m){if(m instanceof Me)return null;throw m}let i=go(n.get("--primary")??"")?.toLowerCase()??null,s=go(n.get("--accent")??"")?.toLowerCase()??null,o=Vc(n.get("--site-font-heading")),a=Vc(n.get("--site-font-sans")),c=Hc(e),r=c?.paletteInputs??null;return{primary:i,accent:s,...r?.foreground!==void 0?{foreground:r.foreground}:{},...r?.neutral!==void 0?{neutral:r.neutral}:{},...r?.supporting!==void 0?{supporting:r.supporting}:{},...r?.imagePalette!==void 0?{imagePalette:r.imagePalette}:{},surfaceMode:Jh(e),fonts:o&&a?{heading:nn(o),body:nn(a)}:null,paletteInputs:r,paletteInputsPresent:r!=null,notesLines:c?.lines??null,weightStyle:n.has("--site-weight-display")&&c?.typeInputs?c.typeInputs.weightStyle:null}}var Li=(e,n)=>e.split(n).length-1;function tS(e){let n=0,i=0,s=0,o=e.length;for(;s<o;){let a=e[s];if(a==="/"&&e[s+1]==="*"){let c=e.indexOf("*/",s+2);s=c===-1?o:c+2;continue}if(a==='"'||a==="'"){let c=a;for(s+=1;s<o;){if(e[s]==="\\"){s+=2;continue}if(e[s]===c){s+=1;break}s+=1}continue}a==="{"?n+=1:a==="}"&&(i+=1),s+=1}return{open:n,close:i}}var Zc=e=>{let{open:n,close:i}=tS(e);return n===i};function kP(e,n){if(Zc(e)&&!Zc(n))return{ok:!1,code:"GLOBALS_CSS_UNBALANCED",message:"app/globals.css has unbalanced braces."};if(Kn(e)&&!Kn(n))return{ok:!1,code:"GLOBALS_CSS_TOKEN_BLOCK_MISSING",message:"Keep the /* <cms-builder:global-design-tokens> */ and /* </cms-builder:global-design-tokens> */ markers in app/globals.css."};if(Li(e,on)===Li(e,Kt)&&Li(n,on)!==Li(n,Kt))return{ok:!1,code:"GLOBALS_CSS_NOTES_UNPAIRED",message:"The site design notes comment must keep both of its markers."};if(Kn(e)){let s=null;try{s=ji(e)}catch(a){if(!(a instanceof Me))throw a}let o;try{o=ji(n)}catch(a){if(a instanceof Me)return{ok:!1,code:"GLOBALS_CSS_TOKEN_BLOCK_MALFORMED",message:`app/globals.css design token block is malformed: ${a.message}`};throw a}if(s){let a=[...s.keys()].filter(c=>!o.has(c));if(a.length>0)return{ok:!1,code:"GLOBALS_CSS_TOKEN_REMOVED",message:`Do not delete design tokens from app/globals.css; change their values instead. Removed: ${a.slice(0,8).join(", ")}`}}}return{ok:!0}}import{z as q}from"zod";var OP="x-vcp-run-lease-owner",NP=600*1e3,jP=60*1e3,LP=3,MP=2,UP="WORKSPACE_RUN_RESUME_EXHAUSTED",FP="WORKSPACE_CHECK_INCOMPLETE",GP="WORKSPACE_GENERATION_STOPPED",qP="WORKSPACE_FILL_IN_INTERRUPTED",WP="WORKSPACE_RUN_LEASE_SUPERSEDED",KP="WORKSPACE_RUN_NOT_ACTIVE",BP="FILL_IN_NOT_AVAILABLE",zP="FILL_IN_TARGET_NOT_OMITTED",HP="FILL_IN_TARGET_MODIFIED",nS=q.object({authMode:q.enum(["disabled-dev","internal-service","oidc"]),user_id:q.string().min(1),external_user_id:q.string().min(1).optional(),email:q.string().min(1).optional(),display_name:q.string().min(1).optional()}).strict(),VP=q.object({run_id:V,lease_owner:q.string().min(1),lease_ms:q.number().int().positive().max(1800*1e3).optional()}).strict(),$P=q.object({status:q.enum(["renewed","not_active","superseded"]),expires_at:q.string().min(1).nullable(),stop_requested:q.boolean()}).strict(),Jc=q.object({run_id:V,page_id:q.string().min(1),attempt:q.number().int().positive(),snapshot_id:A,object_key:q.string().min(1),manifest_hash:q.string().min(1),file_paths:q.array(q.string().min(1)).min(1),created_at:q.string().min(1)}).strict(),YP=Jc.omit({created_at:!0}).extend({lease_owner:q.string().min(1)}).strict(),XP=q.object({checkpoints:q.array(Jc)}).strict(),em=q.object({kind:q.enum(["page","component","shared"]),target_id:q.string().min(1)}).strict(),QP=q.object({run_id:V,site_id:k,tenant_id:q.string().min(1),run_kind:q.enum(["initial_generation","iteration","landing_page","fill_in"]),status:q.enum(["queued","running","succeeded","failed","cancelled"]),base_snapshot_id:A.nullable(),lease_owner:q.string().min(1).nullable(),resume_count:q.number().int().nonnegative(),stop_requested:q.boolean(),reuse_from_run_id:V.nullable(),source_run_id:V.nullable(),fill_in_targets:q.array(em),execution_scene:ys.nullable().optional(),intent:q.literal("navigation_adaptation").optional(),page_template_manifest:Ya.nullable().optional()}).strict().superRefine((e,n)=>{e.execution_scene==="page_template_create"?(e.run_kind!=="iteration"||!e.page_template_manifest)&&n.addIssue({code:"custom",message:"Page Template execution requires an iteration run with its authoritative manifest"}):e.page_template_manifest&&n.addIssue({code:"custom",message:"Only Page Template execution has a batch manifest"})}),ZP=q.object({runs:q.array(q.object({run_id:V,site_id:k,tenant_id:q.string().min(1),run_kind:q.literal("initial_generation"),base_snapshot_id:A,sitemap_id:Te,resume_count:q.number().int().nonnegative(),lease_owner:q.string().min(1),stop_requested:q.boolean(),resume_principal:nS}).strict())}).strict(),JP=q.object({site_id:k}).strict(),ev=q.object({status:q.enum(["requested","already_requested","stopped","no_active_run"]),run_id:V.nullable()}).strict(),tv=q.object({ledger:kn.nullable(),source_run_id:V.nullable(),updated_at:q.string().min(1).nullable()}).strict(),nv=q.object({targets:q.array(em).min(1).max(50),client_run_key:q.string().min(1).max(400)}).strict();import{z as iS}from"zod";var ov=".i18n.json",Mi="translation",tm=new Set(["__proto__","constructor","prototype"]);function im(e){if(!Ui(e)||Object.keys(e).length===0)return wt("I18N_ROOT_INVALID","Component i18n resources must be a non-empty object.",[]);for(let[n,i]of Object.entries(e)){if(tm.has(n))return nm([n]);if(!sS(n))return wt("I18N_LOCALE_INVALID",`Component i18n locale must be canonical BCP-47: ${n}`,[n]);if(!Ui(i))return wt("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let s=Object.keys(i);if(s.length!==1||s[0]!==Mi)return wt("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let o=i[Mi];if(!Ui(o))return wt("I18N_RESOURCE_TREE_INVALID",`Component i18n translation namespace for ${n} must be an object.`,[n,Mi]);let a=[{value:o,path:[n,Mi]}];for(;a.length>0;){let c=a.pop();for(let[r,m]of Object.entries(c.value)){let S=[...c.path,r];if(tm.has(r))return nm(S);if(typeof m!="string"){if(!Ui(m))return wt("I18N_RESOURCE_TREE_INVALID","Component i18n resource leaves must be strings.",S);a.push({value:m,path:S})}}}}return{success:!0,data:e}}function av(e){let n;try{n=JSON.parse(e)}catch{return wt("I18N_JSON_INVALID","Component i18n resource file must contain valid JSON.",[])}return im(n)}var rv=iS.custom(e=>im(e).success,"Invalid component i18n resources.");function sS(e){try{let n=Intl.getCanonicalLocales(e);return n.length===1&&n[0]===e}catch{return!1}}function Ui(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}function nm(e){return wt("I18N_RESOURCE_KEY_FORBIDDEN",`Component i18n resource key is forbidden: ${e.at(-1)??""}`,e)}function wt(e,n,i){return{success:!1,error:{code:e,message:n,path:i}}}var St="products",oS=`/${St}`,mv=oS,lv=`${St} detail`,pv="cms_collection_view",dv="list",uv="detail",st={zhHans:{pageTitle:"\u4EA7\u54C1\u4E2D\u5FC3",blockLabel:"\u4EA7\u54C1\u6982\u89C8",detailBlockLabel:"\u4EA7\u54C1\u8BE6\u60C5",heroBlockLabel:"\u4EA7\u54C1\u7B80\u4ECB",homeLabel:"\u9996\u9875"},zhHant:{pageTitle:"\u7522\u54C1\u4E2D\u5FC3",blockLabel:"\u7522\u54C1\u6982\u89BD",detailBlockLabel:"\u7522\u54C1\u8A73\u60C5",heroBlockLabel:"\u7522\u54C1\u7C21\u4ECB",homeLabel:"\u9996\u9801"},en:{pageTitle:"Products",blockLabel:"Products overview",detailBlockLabel:"Product details",heroBlockLabel:"Products Introduction",homeLabel:"Home"},de:{pageTitle:"Produkte",blockLabel:"Produkt\xFCbersicht",detailBlockLabel:"Produktdetails",heroBlockLabel:"Produkteinf\xFChrung",homeLabel:"Startseite"},fr:{pageTitle:"Produits",blockLabel:"Aper\xE7u des produits",detailBlockLabel:"D\xE9tails du produit",heroBlockLabel:"Pr\xE9sentation des produits",homeLabel:"Accueil"},es:{pageTitle:"Productos",blockLabel:"Resumen de productos",detailBlockLabel:"Detalles del producto",heroBlockLabel:"Introducci\xF3n de productos",homeLabel:"Inicio"},ja:{pageTitle:"\u88FD\u54C1",blockLabel:"\u88FD\u54C1\u6982\u8981",detailBlockLabel:"\u88FD\u54C1\u8A73\u7D30",heroBlockLabel:"\u88FD\u54C1\u7D39\u4ECB",homeLabel:"\u30DB\u30FC\u30E0"},ko:{pageTitle:"\uC81C\uD488",blockLabel:"\uC81C\uD488 \uAC1C\uC694",detailBlockLabel:"\uC81C\uD488 \uC0C1\uC138",heroBlockLabel:"\uC81C\uD488 \uC18C\uAC1C",homeLabel:"\uD648"}},aS=new Set(Object.values(st).map(e=>e.pageTitle)),rS=new Set(Object.values(st).flatMap(e=>[e.blockLabel,e.detailBlockLabel,e.heroBlockLabel]));function _v(e){let n=e?.trim().toLowerCase()??"";if(n==="zh-tw"||n==="zh-hk"||n==="zh-mo")return st.zhHant;if(n.startsWith("zh"))return st.zhHans;switch(n.split("-")[0]){case"de":return st.de;case"fr":return st.fr;case"es":return st.es;case"ja":return st.ja;case"ko":return st.ko;case"en":default:return st.en}}function gv(e){return aS.has(e.trim())}function hv(e){return rS.has(e.trim())}import{z as rn}from"zod";var yv="SITE_HAS_ACTIVE_SUBSITES",xv="SITE_HAS_SUBSITES",cS=rn.object({site_id:k,name:rn.string().min(1),mount_path:rn.string().min(1),archived_at:rn.string().nullable()}),Ev=rn.object({subsites:rn.array(cS)});import{z as ke}from"zod";var kv=ke.object({key:ke.string().min(1),composition:ue}).strict(),Gi=ke.enum(["component-boundary","repeat-region","conditional-region","fragment-region","opaque-region"]),mS=ke.enum(["direct","proxy","upstream","readonly","unsupported"]),lS=ke.enum(["component-boundary","repeat-region","conditional-region","opaque-region","void-element","read-only","cross-file-required","import-required"]),Fi=ke.object({mode:mS,reasonCode:ke.string().min(1).optional()}),pS=ke.object({kind:lS,message:ke.string().min(1)}),qi=ke.object({composition:B,key:ke.string().min(1),canUpdateText:ke.boolean(),canInsertChild:ke.boolean(),canMove:ke.boolean(),canRemove:ke.boolean(),editModes:ke.object({updateText:Fi.optional(),insertChild:Fi.optional(),move:Fi.optional(),remove:Fi.optional()}).optional(),constraints:ke.array(pS)}).strict();import{z as X}from"zod";var Ov=X.discriminatedUnion("type",[X.object({type:X.literal("site-edit.document.changed"),siteId:k,snapshotId:A,composition:B,version:X.number().int().nonnegative(),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.operation.planned"),siteId:k,operationId:X.string().min(1),baseSnapshotId:A,composition:B,changedFiles:X.array(X.string().min(1)),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.operation.completed"),siteId:k,composition:B,result:Xs,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.operation.failed"),siteId:k,composition:B,requestId:X.string().min(1),error:uc,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.capability.changed"),siteId:k,composition:B,keys:X.array(X.string().min(1)),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.invalidated"),siteId:k,composition:B,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.ready"),siteId:k,composition:B,version:X.number().int().nonnegative(),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.error"),siteId:k,composition:B,message:X.string().min(1),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.snapshot.changed"),siteId:k,composition:B,snapshotId:A,previousSnapshotId:X.string().min(1).nullable(),at:X.string().min(1)}).strict()]);import{z as re}from"zod";var Mv="durable-history-v1",Wi=re.object({initiatingComposition:B.optional(),affectedCompositions:re.array(B)}).strict(),Uv=re.enum(["writable","read-only-recovery","unavailable"]),dS=re.enum(["INDEX_CORRUPT","ENTRY_MISSING","BLOB_MISSING","FILESYSTEM_UNAVAILABLE","ROLLBACK_INCOMPLETE","UNKNOWN"]),uS=re.object({code:dS,message:re.string().min(1),occurredAt:re.iso.datetime().optional()}).strict(),_S=re.enum(["NOT_INITIALIZED","FILESYSTEM_UNAVAILABLE","UNSUPPORTED_RUNTIME"]),sm={revision:re.number().int().nonnegative(),undoDepth:re.number().int().nonnegative(),redoDepth:re.number().int().nonnegative()},gS=re.object({mode:re.literal("writable"),composition:B,...sm,canUndo:re.boolean(),canRedo:re.boolean(),provenance:Wi.optional()}).strict().superRefine((e,n)=>{e.canUndo!==e.undoDepth>0&&n.addIssue({code:"custom",path:["canUndo"],message:"canUndo must reflect undoDepth."}),e.canRedo!==e.redoDepth>0&&n.addIssue({code:"custom",path:["canRedo"],message:"canRedo must reflect redoDepth."})}),hS=re.object({mode:re.literal("read-only-recovery"),composition:B,...sm,canUndo:re.literal(!1),canRedo:re.literal(!1),recoveryDiagnostic:uS,provenance:Wi.optional()}).strict(),SS=re.object({mode:re.literal("unavailable"),composition:B,revision:re.literal(0),undoDepth:re.literal(0),redoDepth:re.literal(0),canUndo:re.literal(!1),canRedo:re.literal(!1),reason:_S,provenance:Wi.optional()}).strict(),fS=re.discriminatedUnion("mode",[gS,hS,SS]),Fv=re.object({composition:B,status:fS,provenance:Wi}).strict();import{z as $}from"zod";var Ki=$.enum(["api-field","cms-field","i18n-message","config-entry"]),Io=$.object({kind:$.enum(["jsx-node","value-path","route-export","external-entry"]),file:$.string().min(1).optional(),isProxy:$.boolean(),displayPath:$.string().min(1).optional(),sourceType:Ki.optional(),sourceId:$.string().min(1).optional()}),bS=$.discriminatedUnion("status",[$.object({status:$.literal("resolved"),value:Wt}).strict(),$.object({status:$.literal("undefined")}).strict(),$.object({status:$.literal("unresolved")}).strict()]),yS=$.object({kind:$.enum(["literal","boolean-shorthand","expression","binding","repeat-template"]),raw:$.string().optional()}).strict(),xS=$.object({name:$.string().min(1),source:yS,resolution:bS,editMode:$.enum(["direct","proxy","upstream","readonly","unsupported"]),sourceScope:$.enum(["node","repeat-item","repeat-template"]),allowedWriteScopes:$.array($.enum(["selection","template"])),effectiveWriteTarget:Io.optional(),diagnostics:$.array($.object({code:$.string().min(1),message:$.string().min(1)}).strict())}).strict(),ES=$.object({raw:$.string().min(1),sourceRange:dt,order:$.number().int().nonnegative(),diagnostics:$.array($.object({code:$.string().min(1),message:$.string().min(1)}).strict())}).strict(),RS=$.object({selection:$.enum(["direct","materialize","unsupported"]),template:$.enum(["direct","unsupported"])}).strict(),To=$.object({documentVersion:$.number().int().nonnegative(),selectionRef:en.optional(),items:$.array(xS),spreads:$.array(ES),creation:RS}).strict().superRefine((e,n)=>{let i=e.selectionRef;i&&i.instanceIndex!==void 0&&i.instanceCount!==void 0&&i.instanceIndex>=i.instanceCount&&n.addIssue({code:"custom",path:["selectionRef","instanceIndex"],message:"instanceIndex must be smaller than instanceCount"})});import{z as Ae}from"zod";var IS=Ae.string().min(1).refine(e=>!e.startsWith("/")&&!e.includes(".."),{message:"Patch paths must be safe relative POSIX paths."}),TS=Ae.string().regex(/^sha256:[a-f0-9]{64}$/),kS=Ae.object({path:IS,operation:Ae.enum(["create","update","delete"]),expectedHash:TS.optional(),fullContent:Ae.string().optional()}).superRefine((e,n)=>{e.operation==="delete"&&e.fullContent!==void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"delete patches must not include fullContent"}),e.operation!=="delete"&&e.fullContent===void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"create/update patches must include fullContent"})}),AS=Ae.object({siteId:k,baseSnapshotId:A,operationId:Ae.string().min(1),reason:Ae.string().min(1),patches:Ae.array(kS).min(1),changedCompositions:Ae.array(B),changedRouteIds:Ae.array(Ae.string().min(1)).optional(),diagnostics:Ae.array(Ae.object({code:Ae.string().min(1),message:Ae.string().min(1),path:Ae.string().min(1).optional()})).default([])}).strict().superRefine((e,n)=>{let i=new Set;for(let[o,a]of e.patches.entries())i.has(a.path)&&n.addIssue({code:"custom",path:["patches",o,"path"],message:`Duplicate patch path: ${a.path}`}),i.add(a.path);let s=[...new Set(e.changedCompositions.map(o=>o.routeId))];e.changedRouteIds!==void 0&&(e.changedRouteIds.length!==s.length||e.changedRouteIds.some((o,a)=>o!==s[a]))&&n.addIssue({code:"custom",path:["changedRouteIds"],message:"changedRouteIds must be the stable deduplicated route projection of changedCompositions."})}),Yv=AS.transform(e=>({...e,changedRouteIds:[...new Set(e.changedCompositions.map(n=>n.routeId))]}));var ko="::repeat-item#";function wS(e,n){return`${e}${ko}${n}`}function Qv(e,n){return n.reduce((i,s)=>wS(i,s),e)}function PS(e){if(typeof e!="string"||e.length===0)return null;let n=[],i=e;for(;;){let s=i.lastIndexOf(ko);if(s<0)break;let o=Number(i.slice(s+ko.length));if(!Number.isInteger(o)||o<0)return null;n.unshift({repeatIndex:o}),i=i.slice(0,s)}return!i||n.length===0?null:{baseKey:i,parts:n}}function Zv(e){return PS(e)?.baseKey??e??null}import{z as l}from"zod";import{z as Ne}from"zod";var vS=Ne.object({placementKey:Ne.string().min(1),placementUnitKey:Ne.string().min(1),relation:Ne.enum(["before","after","prepend","append"])}).strict(),CS=Ne.object({status:Ne.literal("supported"),containerKey:Ne.string().min(1),hasBusinessMembers:Ne.boolean(),placementUnitKeys:Ne.array(Ne.string().min(1)),placements:Ne.array(vS)}).strict().superRefine((e,n)=>{let i=new Set(e.placementUnitKeys);i.size!==e.placementUnitKeys.length&&n.addIssue({code:"custom",path:["placementUnitKeys"],message:"Render page composition placement unit keys must be unique."});let s=new Set;e.placements.forEach((o,a)=>{s.has(o.placementKey)&&n.addIssue({code:"custom",path:["placements",a,"placementKey"],message:"Render page composition placement keys must be unique."}),s.add(o.placementKey),i.has(o.placementUnitKey)||n.addIssue({code:"custom",path:["placements",a,"placementUnitKey"],message:"Render page composition placement must reference a projected unit."})})}),DS=Ne.object({status:Ne.literal("unsupported"),reason:wi,diagnostics:Ne.array(Ln)}).strict(),om=Ne.discriminatedUnion("status",[CS,DS]);var OS=l.object({canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean()}),am=l.enum(["vcp-cms-collection","vcp-cms-form","vcp-cms-settings","vcp-cms-navigation","site-api-route","external-api","unknown-api"]),NS=l.enum(["cms-field","api-field"]),jS=l.enum(["text","attribute","richtext","repeat-region","conditional-region","component-prop"]),LS=l.enum(["exact","safe-derived","partial","unknown"]),MS=l.object({file:l.string().min(1),symbol:l.string().min(1).optional(),reason:l.string().min(1)}),US=l.object({sourceKind:am,sourceType:NS,endpointPattern:l.string().min(1).optional(),operation:l.string().min(1).optional(),collection:l.string().min(1).optional(),fieldPath:l.string().min(1).optional(),valuePath:l.string().min(1).optional(),targetKind:jS,targetName:l.string().min(1),confidence:LS,readonly:l.literal(!0),evidence:l.array(MS)}),rm=l.object({hasDynamicData:l.boolean(),bindings:l.array(US)}),cm=l.object({hasDynamicData:l.boolean(),sourceKinds:l.array(am),collections:l.array(l.string().min(1)).min(1).optional(),primaryEndpoint:l.string().min(1).optional(),primaryCollection:l.string().min(1).optional(),primaryFieldPath:l.string().min(1).optional()}),FS=l.object({key:l.string().min(1),parentKey:l.string().min(1).nullable().optional(),pageCompositionUnitKey:l.string().min(1).optional(),operationSummary:OS,dynamicDataSummary:cm.optional()}).strict(),gC=l.object({composition:ue}).strict(),hC=l.object({key:l.string().min(1),composition:ue,selectionRef:en.optional()}).strict(),SC=l.object({siteId:k,snapshotId:A,composition:B,version:l.number().int().nonnegative(),entries:l.array(FS),pageComposition:om}).strict(),mm=l.object({kind:l.enum(["literal","binding","imported-binding","repeat-template"]),file:l.string().min(1),expression:l.string().min(1),bindingName:l.string().min(1).optional(),path:l.array(l.union([l.string(),l.number()])).optional()}),Ao=l.object({index:l.number().int().min(0),value:l.string(),editable:l.boolean(),source:mm.nullable()}),Bn=l.object({key:l.string().min(1),label:l.string().min(1),tag:l.string().min(1)}),fC=l.object({composition:B,key:l.string().min(1),canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean(),boundaryKind:Gi.nullable(),isOpaque:l.boolean()}).strict(),GS=l.object({kind:l.enum(["jsx-node","component-proxy","value-binding","route-export"]),file:l.string().min(1),componentName:l.string().min(1),isProxy:l.boolean()}),lm=l.object({kind:l.union([l.enum(["jsx-literal","component-prop","binding","imported-binding","object-field","array-item","repeat-template","conditional-branch"]),Ki]),file:l.string().min(1),displayPath:l.string().min(1),externalSource:l.object({sourceType:Ki,sourceId:l.string().min(1),adapterId:l.string().min(1).optional()}).optional()}),qS=l.object({kind:lm.shape.kind,file:l.string().min(1),displayName:l.string().min(1),canEditHere:l.boolean()}),zn=l.object({finalSource:lm.nullable(),chain:l.array(qS),confidence:l.enum(["exact","safe-derived","partial","unknown"]),editMode:l.enum(["direct","proxy","upstream","readonly","unsupported"]),diagnostics:l.array(l.object({code:l.string().min(1),message:l.string().min(1)}))}),WS=l.object({kind:l.literal("css-style-model"),properties:l.array(l.object({property:cc,value:l.union([l.string(),l.number(),l.boolean(),l.null()]),resolvedValue:l.union([l.string(),l.number(),l.boolean(),l.null()]).optional(),breakpoint:lc.optional(),state:mc.optional(),variants:l.array(l.string().min(1)).optional(),options:l.array(l.union([l.string(),l.number()])).optional(),editable:l.boolean(),diagnostics:l.array(l.object({code:l.string().min(1),message:l.string().min(1)})).optional(),operationBoundary:l.array(Mn).optional()}))}),bC=l.union([l.record(l.string(),l.unknown()),WS]),pm=l.object({kind:l.literal("class-name-source"),className:l.string(),sourceKind:l.enum(["missing","static-attribute","static-expression","dynamic-expression"]),editable:l.boolean(),operationBoundary:l.array(Mn),sourcePath:l.string().min(1).optional(),diagnostics:l.array(l.object({code:l.enum(["missing-class-name","dynamic-binding","non-string-binding"]),message:l.string().min(1)})).optional()}),KS=l.object({startLine:l.number().int().positive(),startColumn:l.number().int().nonnegative(),endLine:l.number().int().positive(),endColumn:l.number().int().nonnegative()}),wo=l.object({sourceFile:l.string().min(1),componentName:l.string().min(1),openingElementRange:KS,structuralPath:l.string().min(1),textPreview:l.string().min(1).optional()}),yC=l.object({composition:B,key:l.string().min(1),tag:l.string().min(1),componentName:l.string().min(1),sourceFile:l.string().min(1),sourceLocator:wo.optional(),label:l.string().min(1),capabilities:qi,writeTarget:GS,effectiveWriteTarget:Io.optional(),provenanceChain:zn.optional(),componentSemantic:l.record(l.string(),l.unknown()).optional(),styleSource:pm.optional(),conditional:l.record(l.string(),l.unknown()).optional(),dynamicData:rm.optional(),properties:To.optional(),textSegments:l.array(Ao),boundaryKind:Gi.nullable(),isOpaque:l.boolean(),ancestors:l.array(Bn),children:l.array(Bn),siblings:l.array(Bn)}).strict(),xC=l.object({composition:B,key:l.string().min(1),tag:l.string().min(1),label:l.string().min(1),sourceLocator:wo.optional(),capabilities:l.object({constraints:qi.shape.constraints}),isOpaque:l.boolean(),provenanceChain:l.object({editMode:zn.shape.editMode,diagnostics:zn.shape.diagnostics}).optional(),dynamicDataSummary:cm.optional(),ancestors:l.array(Bn)}).strict(),EC=l.object({composition:B,key:l.string().min(1),tag:l.string().min(1),label:l.string().min(1),sourceLocator:wo.optional(),isOpaque:l.boolean(),ancestors:l.array(Bn),componentName:l.string().min(1),sourceFile:l.string().min(1),capabilities:qi,provenanceChain:l.object({editMode:zn.shape.editMode,diagnostics:zn.shape.diagnostics}).optional(),textSegments:l.array(l.object({index:Ao.shape.index,editable:Ao.shape.editable,sourceKind:mm.shape.kind.nullable()})),dynamicData:rm.optional(),properties:To.optional(),boundaryKind:Gi.nullable()}).strict(),RC=l.object({composition:B,key:l.string().min(1),styleSource:pm.optional()}).strict();var BS=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],zS=["article","aside","div","footer","form","header","li","main","nav","ol","section","select","table","tbody","tfoot","thead","tr","ul"],HS=["a","button","em","h1","h2","h3","h4","h5","h6","label","p","small","span","strong"],VS=new Set(BS),$S=new Set(zS),YS=new Set(HS),XS={canUpdateText:!1,canInsertChild:!1,canMove:!1,canRemove:!1};function TC(e){return VS.has(Po(e))}function QS(e){return $S.has(Po(e))}function ZS(e){return YS.has(Po(e))}function kC(e){let{operationSummary:n}=e;return n?{canUpdateText:n.canUpdateText,canInsertChild:n.canInsertChild,canMove:n.canMove,canRemove:n.canRemove}:e.fallbackMode!=="preview"?{...XS}:{canUpdateText:ZS(e.tagName),canInsertChild:QS(e.tagName),canMove:!1,canRemove:!1}}function Po(e){return e?.trim().toLowerCase()??""}import{z as JS}from"zod";var CC=JS.object({composition:ue,mutationContext:Nn.optional()}).strict();var OC={PATCH_VALIDATION_FAILED:"The code didn't pass validation. Try describing the change more specifically.",PATCH_BATCH_FAILED:"The site code couldn't be generated. Please regenerate the site.",PATCH_BATCH_INVALID:"The change couldn't be applied. Try simpler instructions.",VALIDATION_FAILED:"Your message couldn't be sent as written. Please edit it and try again.",WORKSPACE_MESSAGE_CONTAINS_SECRET:"Your message looks like it contains a secret or token, so it wasn't sent. Remove it and try again.",WORKSPACE_RUN_INPUT_REQUIRED:"Nothing to work on: the request had no instruction, so no edit was started. Describe the change you want and send it.",WORKSPACE_TOOL_RESULT_INVALID:"This change couldn't be completed and was rolled back. Please try again.",WORKSPACE_TOOL_FAILED:"A tool step failed. Please try again.",WORKSPACE_TOOL_RESULT_MISSING:"The tool didn't return a usable result. Please try again.",WORKSPACE_MODEL_STREAM_FAILED:"The model stream ended unexpectedly. Please try again.",WORKSPACE_MODEL_STREAM_ABORTED:"Generation was interrupted before finishing. Please try again.",MODEL_OUTPUT_TRUNCATED:"The response was too long and was cut off before any change was applied. Try again, or split the request into smaller changes.",WORKSPACE_EDIT_NOT_APPLIED:"No change was applied. Try describing the change differently.",PRODUCT_SEARCH_APPLY_NOT_AVAILABLE:"Product search changes aren't available yet. Please try again later.",WORKSPACE_INITIAL_EXECUTION_FAILED:"Initial generation failed. Please retry from the brief.",WORKSPACE_INITIAL_GENERATION_CHECK_FAILED:"Initial generation could not be verified. Please retry.",WORKSPACE_INITIAL_GENERATION_FINALIZE_FAILED:"Initial generation could not finalize. Please retry.",WORKSPACE_INITIAL_GENERATION_QUALITY_GATE_FAILED:"Initial generation failed quality checks. Please regenerate the site.",WORKSPACE_CHECK_INCOMPLETE:"The check couldn't complete, so no page was delivered this round. Please regenerate the site.",WORKSPACE_RUN_RESUME_EXHAUSTED:"Generation was interrupted several times and stopped. Everything already saved is kept; you can regenerate the missing pages.",WORKSPACE_GENERATION_STOPPED:"You stopped this generation before any page was ready. Nothing was lost \u2014 start it again when you want.",WORKSPACE_FILL_IN_INTERRUPTED:"The fill-in run was interrupted and stopped. Your site is unchanged; select the targets again to retry.",WORKSPACE_RUN_LEASE_SUPERSEDED:"Another attempt took over this run, so this one stopped. Reload to see the current progress.",FILL_IN_NOT_AVAILABLE:"Fill-in is available after the site has been generated.",FILL_IN_TARGET_NOT_OMITTED:"One of the selected items is no longer listed as missing. Reload the omissions list and try again.",FILL_IN_TARGET_MODIFIED:"One of the selected items was changed or removed after generation, so it was not filled in. Your edits are kept.",WORKSPACE_ITERATION_QUALITY_GATE_FAILED:"Quality check failed. The change was rolled back; try a smaller or more specific request.",WORKSPACE_SOCKET_DEAD:"The workspace connection was lost. Please retry.",WORKSPACE_RUN_CANCELLED:"The run was cancelled.",WORKSPACE_RUN_ABANDONED:"This run was interrupted and did not finish. Please try again.",WORKSPACE_RUN_REQUEST_FAILED:"Couldn't start the workspace. Please try again.",WORKSPACE_RUN_BAD_RESPONSE:"The server response was malformed. Please try again.",WORKSPACE_SOCKET_UNAVAILABLE:"Workspace connection unavailable. Please try again.",WORKSPACE_SOCKET_ERROR:"The workspace connection had an error. Please try again.",WORKSPACE_SOCKET_CLOSED:"The workspace connection closed. Please try again.",WORKSPACE_SOCKET_OPEN_TIMEOUT:"Couldn't reach the workspace in time. Please try again.",WORKSPACE_CLIENT_MESSAGE_ID_MISSING:"Something went wrong sending your message. Please try again.",SITE_SNAPSHOT_REQUIRED:"This site has no usable snapshot yet. Complete Step 3 first.",AGENT_TIMEOUT:"That took longer than expected. Try breaking the change into smaller pieces.",SANDBOX_NOT_AVAILABLE:"The preview environment isn't ready. Your edits have still been saved.",PREVIEW_BUILD_FAILED:"Preview is available, but the production build failed. Fix the reported build error before deploying.",PREVIEW_BUILD_NOT_CONFIGURED:"Preview is available, but the production build check is not configured.",PREVIEW_BUILD_SANDBOX_NOT_FOUND:"Preview is available, but the build check could not find the active preview sandbox.",WS_CONNECTION_ERROR:"Connection lost. Reconnecting\u2026",USER_MESSAGE_PERSIST_FAILED:"Your message wasn't saved. Please send it again.",CLARIFICATION_REPLY_STALE:"That question has expired. Please tell me what you'd like to do now.",CLARIFY_MODEL_FAILED:"Clarify couldn't finish generating questions. Please try again.",WORKSPACE_RUN_IN_FLIGHT:"Another session is already running. Please try again in a moment.",SITE_OPERATION_LOCKED:"Another change is already running for this site. Wait for it to finish, then try again.",SITE_SITEMAP_DRAFT_STALE:"The draft was updated elsewhere. Reload the latest draft before saving.",SITE_SITEMAP_DRAFT_OPERATION_MISMATCH:"This save identity belongs to a different draft operation.",WORKSPACE_THREAD_NOT_FOUND:"That conversation no longer exists. Switching back to the default conversation.",WORKSPACE_THREAD_ARCHIVED:"This conversation is archived. Start a new one to continue.",WORKSPACE_THREAD_BUSY:"This conversation is still running. Wait for it to finish before archiving.",WORKSPACE_THREAD_READ_ONLY:"Background conversations are read-only here.",WORKSPACE_THREAD_INVALID:"This conversation can't accept new requests right now. Refresh and try again.",EDIT_ENGINE_VERSION_INVALID:"Invalid editor version. Refresh the page and try again.",SANDBOX_DEPENDENCY_SYNC_FAILED:"The preview runtime could not be prepared. Please try again.",SANDBOX_PREVIEW_FAILED:"The site preview failed to start. Please try again.",SANDBOX_DEPENDENCY_VERSION_MISMATCH:"The preview runtime could not be verified. Please try again.",SANDBOX_RUNTIME_NOT_READY:"The preview needs to be refreshed before this change can be applied. Refresh the preview and try again.",GENERIC:"Something went wrong. Please try again."},ef=["WORKSPACE_RUN_CANCELLED","WORKSPACE_GENERATION_STOPPED"],tf=new Set(ef);function NC(e){return typeof e=="string"&&tf.has(e)}var jC={UNDO_OR_ROLLBACK:"I can't roll back from chat. Use the version history at the top right to pick a restore point.",HISTORY_RECALL:"Tell me what you'd like to change now\u2014I'll work from the current page state.",OUT_OF_SCOPE:"That's outside what I can do from chat. Try the corresponding panel on the right."},LC={CARD_HEADER:"Needs your confirmation",FREE_TEXT_PLACEHOLDER:"Or describe what you'd like instead",SUBMIT_LABEL:"Submit"},MC={SEND_FAILED_RETRY:"Send failed \u2014 tap to retry"};var dm="0.10.20",FC="x-vcp-edit-engine-version",GC="x-vcp-edit-engine-version-source",vo=class extends Error{constructor(n="Invalid edit-engine version."){super(n),this.code="EDIT_ENGINE_VERSION_INVALID",this.name="EditEngineVersionParseError"}},nf=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?$/;function sf(e){return nf.test(e)}function of(e){if(typeof e!="string"||!sf(e))throw new vo;return e}function qC(e){return e==null?{version:dm,source:"fallback_current"}:{version:of(e),source:"explicit"}}function WC(){return{version:dm,source:"system_current"}}import{z as Ze}from"zod";var af=200,rf=200;function cf(e){let n=e.indexOf(":");if(n<=0)return null;let i=e.slice(0,n).trim(),s=e.slice(n+1).trim();return i.length===0||s.length===0?null:{source:i,target:s}}var mf=Ze.string().min(3).max(af).refine(e=>cf(e)!==null,{message:'glossary entries must be "source:target" pairs split on a half-width colon, e.g. "\u7C73:Rice"'}),zC=Ze.array(mf).max(rf),HC=Ze.object({website_name:Ze.string().min(1).max(200),website_industry:Ze.string().min(1).max(200).optional(),website_description:Ze.string().min(1).max(1e3).optional()}),lf=Ze.enum(["regional","fonts_only"]),Bi=Ze.string().regex(/^#[0-9a-fA-F]{6}$/,'color must be a "#rrggbb" value'),pf=Ze.object({primary:Bi.optional(),accent:Bi.optional(),foreground:Bi.optional(),neutral:Bi.optional()}),df=600,VC=Ze.object({mode:lf.default("regional"),seeds:pf.optional(),note:Ze.string().min(1).max(df).optional()}),$C={mode:"regional"};function YC(e){return e===void 0?!1:Object.values(e).some(n=>typeof n=="string"&&n.length>0)}import{z as Bt}from"zod";var uf=12,JC=Bt.object({tenant_id:Bt.string().min(1),site_id:k,snapshot_id:A,manifest_hash:Bt.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:Bt.string().min(1).max(2048)}),zi=Bt.number().int().nonnegative().safe(),eD=Bt.object({page_count:zi,translation_character_count:zi,image_estimate:Bt.object({media_key_count:zi,max_replacement_count:zi})}).superRefine((e,n)=>{let{media_key_count:i,max_replacement_count:s}=e.image_estimate;s!==Math.min(i,uf)&&n.addIssue({code:"custom",path:["image_estimate","max_replacement_count"],message:"max replacement count does not match the deterministic ceiling"})});import{z as Ue}from"zod";var _f=Ue.string().trim().min(1),cn=Ue.string().uuid(),gf=Ue.string().min(1).max(2048).refine(e=>e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>n.length>0&&n!=="."&&n!==".."),"object_key must be a relative snapshot store path without empty, '.' or '..' segments"),um=Ue.object({snapshot_id:cn,object_key:gf}),iD=Ue.object({tenant_id:_f,parent_site_id:cn,subsite_site_id:cn,base:um,target:um}),sD=Ue.object({subsite_site_id:cn,pending_pages:Ue.array(Ue.string().min(1)),hash_diverged_count:Ue.number().int().nonnegative(),child_only_count:Ue.number().int().nonnegative(),base_snapshot_id:cn,target_snapshot_id:cn}),hf=Ue.enum(["SUBSITE_DIFF_REQUEST_INVALID","SUBSITE_DIFF_STORE_NOT_CONFIGURED","SUBSITE_DIFF_MANIFEST_MISSING","SUBSITE_DIFF_MANIFEST_INVALID"]),oD=Ue.object({error_code:hf,message:Ue.string().min(1),side:Ue.enum(["base","target"]).optional()});import{z as fe}from"zod";var mD=fe.object({tenant_id:fe.string().min(1),site_id:k,snapshot_id:A,manifest_hash:fe.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:fe.string().min(1).max(2048),page_slug:fe.string().max(512).optional()}),lD=fe.object({site_id:k,snapshot_id:A,unit_count:fe.number().int().nonnegative(),file_count:fe.number().int().nonnegative(),markdown:fe.string().min(1),page_slug:fe.string().optional(),page_file:fe.string().optional(),entries:fe.array(fe.object({id:fe.string().min(1),file_path:fe.string().min(1),line:fe.number().int().nullable(),kind:fe.string().min(1),text:fe.string(),media_key:fe.string().optional()})).optional()});import{z as Sf}from"zod";var ff=/^\/[a-z0-9][a-z0-9-]{0,30}$/,bf=Object.freeze(["api","_next","assets","static","robots.txt","sitemap.xml",".well-known"]),yf=new Set(bf);function xf(e){return yf.has(e)}var uD=Sf.string().regex(ff).refine(e=>!xf(e.slice(1)),{message:"mount_path must not use a reserved segment (api, _next, assets, static, robots.txt, sitemap.xml, .well-known)"});import{z as _e}from"zod";var Ef=_e.enum(["active","paused","blocked"]),_m=_e.enum(["typecheck_failed","health_failed","validation_failed"]),Rf={status:Ef,attempts:_e.number().int().nonnegative(),attempted_template_version:Xe.nullable(),last_error_code:_m.nullable()},mn=_e.object(Rf).strict(),Hi=_e.object({template_id:_e.string().trim().min(1),target_template_version:Xe}).strict(),SD=Hi,If=_e.discriminatedUnion("action",[_e.object({action:_e.literal("proceed"),state:mn.extend({status:_e.literal("active")})}).strict(),_e.object({action:_e.literal("skip_not_newer"),state:mn.extend({status:_e.literal("active")})}).strict(),_e.object({action:_e.literal("skip_paused"),state:mn.extend({status:_e.literal("paused")})}).strict(),_e.object({action:_e.literal("skip_blocked"),state:mn.extend({status:_e.literal("blocked")})}).strict()]),fD=Hi,bD=If,yD=Hi.extend({error_code:_m}),xD=_e.object({state:mn}).strict(),ED=Hi,RD=_e.object({state:mn}).strict();import{z as Y}from"zod";var Tf=744*60*60*1e3,kf=Y.enum(["eligible","fast_path","upgraded","skipped","lock_skipped","cas_aborted","validation_failed","blocked","paused"]),Af=Y.enum(["typecheck","build","health","validation"]),wf=Y.enum(["not_attempted","promoted","aborted"]),wD=Y.object({template_id:Y.string().trim().min(1).max(128),from_version:Xe.nullable(),to_version:Xe,outcome:kf,attempt:Y.number().int().nonnegative().max(2147483647),duration_ms:Y.number().int().nonnegative().max(2147483647),replaced_group_count:Y.number().int().nonnegative().max(2147483647),skipped_group_count:Y.number().int().nonnegative().max(2147483647),validation_stage:Af.nullable(),cas_outcome:wf.nullable()}).strict(),PD=Y.object({recorded:Y.literal(!0)}).strict(),gm=Y.object({from:Y.iso.datetime(),to:Y.iso.datetime()}).strict().refine(({from:e,to:n})=>Date.parse(e)<Date.parse(n),{message:"from must be earlier than to",path:["to"]}).refine(({from:e,to:n})=>Date.parse(n)-Date.parse(e)<=Tf,{message:"report window must not exceed 31 days",path:["to"]}),vD=gm,Pf=Y.object({eligible:Y.number().int().nonnegative(),fast_path:Y.number().int().nonnegative(),upgraded:Y.number().int().nonnegative(),skipped:Y.number().int().nonnegative(),lock_skipped:Y.number().int().nonnegative(),cas_aborted:Y.number().int().nonnegative(),validation_failed:Y.number().int().nonnegative(),blocked:Y.number().int().nonnegative(),paused:Y.number().int().nonnegative()}).strict(),CD=Y.object({window:gm,outcome_counts:Pf,current_state_counts:Y.object({blocked:Y.number().int().nonnegative(),paused:Y.number().int().nonnegative()}).strict(),duration_ms:Y.object({p50:Y.number().int().nonnegative().nullable(),p95:Y.number().int().nonnegative().nullable(),sample_count:Y.number().int().nonnegative()}).strict()}).strict(),DD=Y.object({older_than:Y.iso.datetime(),limit:Y.coerce.number().int().min(1).max(200).default(50),include_candidates:Y.enum(["true","false"]).default("false").transform(e=>e==="true")}).strict(),vf=Y.object({site_id:k,snapshot_id:A,status:Y.enum(["candidate","deleting"]),created_at:Y.iso.datetime()}).strict(),OD=Y.object({snapshots:Y.array(vf)}).strict();import{z as ft}from"zod";var Cf=ft.enum(["PREVIEW_SESSION_NOT_FOUND","PREVIEW_SESSION_INVALID","PREVIEW_SESSION_STALE","PREVIEW_SESSION_LOOKUP_FAILED","PREVIEW_SANDBOX_NOT_FOUND","PREVIEW_SANDBOX_CONNECT_FAILED","PREVIEW_SANDBOX_OWNERSHIP_MISMATCH","PREVIEW_ACTIVATION_TIMEOUT","PREVIEW_PREFLIGHT_FAILED","PREVIEW_ENV_LOOKUP_FAILED","PREVIEW_SERVER_START_FAILED","PREVIEW_HEALTH_CHECK_FAILED","SANDBOX_NOT_CONFIGURED"]),Df=ft.object({status:ft.literal("ready"),preview_url:ft.string().url()}).strict(),Of=ft.object({status:ft.literal("failed"),code:Cf,message:ft.string().min(1),retryable:ft.boolean()}).strict(),LD=ft.discriminatedUnion("status",[Df,Of]);import{z as Pt}from"zod";var Nf=["not_started","active","completed"],jf=Pt.enum(Nf),Lf=["not_started","in_progress","completed"],Mf=Pt.enum(Lf),Uf=Pt.object({sequence:Pt.number().int().positive(),code:It,status:Mf}).strict(),Ff=Pt.object({site_id:k,workflow_status:jf,flow_type:tn.nullable(),current_step_code:It.nullable(),completed_count:Pt.number().int().nonnegative(),total_count:Pt.number().int().nonnegative(),steps:Pt.array(Uf)}).strict().superRefine((e,n)=>{let i=e.steps.filter(s=>s.status==="completed").length;e.total_count!==e.steps.length&&n.addIssue({code:"custom",path:["total_count"],message:"total_count must equal steps.length."}),e.completed_count!==i&&n.addIssue({code:"custom",path:["completed_count"],message:"completed_count must equal completed steps."}),e.steps.forEach((s,o)=>{s.sequence!==o+1&&n.addIssue({code:"custom",path:["steps",o,"sequence"],message:"Step sequence must be continuous and start at 1."})}),e.workflow_status==="not_started"&&(e.flow_type!==null&&n.addIssue({code:"custom",path:["flow_type"],message:"not_started progress cannot have a flow_type."}),e.current_step_code!==null&&n.addIssue({code:"custom",path:["current_step_code"],message:"not_started progress cannot have a current step."}),(e.completed_count!==0||e.total_count!==0)&&n.addIssue({code:"custom",path:["steps"],message:"not_started progress must have zero counts and no steps."})),e.workflow_status==="active"&&(e.flow_type===null&&n.addIssue({code:"custom",path:["flow_type"],message:"active progress requires a flow_type."}),e.current_step_code===null&&n.addIssue({code:"custom",path:["current_step_code"],message:"active progress requires a current step."})),e.workflow_status==="completed"&&(e.flow_type===null&&n.addIssue({code:"custom",path:["flow_type"],message:"completed progress requires a flow_type."}),e.current_step_code!==null&&n.addIssue({code:"custom",path:["current_step_code"],message:"completed progress cannot have a current step."}),e.steps.some(s=>s.status!=="completed")&&n.addIssue({code:"custom",path:["steps"],message:"completed progress must have only completed steps."}),e.completed_count!==e.total_count&&n.addIssue({code:"custom",path:["completed_count"],message:"completed progress counts must be equal."}))}),WD=L(Ff);import{z as Co}from"zod";var Gf=Co.enum(["none","build","build_publish"]),qf=Co.object({site_id:k,launcher_scope:Gf}),HD=Co.object({permission:qf});function VD(e){return e!=="none"}function $D(e){return e==="build_publish"}import{z as Se}from"zod";var eO="build-context.json",tO=2e5,hm=Se.string().regex(/^sha256:[a-f0-9]{64}$/u),Sm=1e3;function Wf(e){return Array.from(e).length<=Sm}var Kf=Se.object({kind:Se.enum(["customer_materials","website_scan_diagnosis","committed_strategy"]),digest:hm}).strict(),Bf=Se.object({schema_version:Se.literal(1),flow_type:tn,sources:Se.array(Kf).min(2).max(2)}).strict().superRefine((e,n)=>{let i=new Set(e.sources.map(o=>o.kind)),s=e.flow_type==="with_website"?["website_scan_diagnosis","committed_strategy"]:["customer_materials","committed_strategy"];(i.size!==s.length||s.some(o=>!i.has(o)))&&n.addIssue({code:"custom",path:["sources"],message:"Site-build provenance sources must match the persisted workflow flow."})}),zf=Se.object({schema_version:Se.literal(1),seed:hm.optional(),cms_settings:Se.object({main_products:Se.string().trim().min(1).refine(Wf,{message:`main_products must contain at most ${Sm} characters`}).optional()}).strict().optional(),provenance:Bf.optional()}).strict(),Hf=Se.object({schema_version:Se.literal(1),site_id:k,workflow_id:nt,brief:Se.string().min(1),source:Se.enum(["business_provider","mock"]),payload:zf}).strict().superRefine((e,n)=>{e.source==="business_provider"&&!e.payload.provenance&&n.addIssue({code:"custom",path:["payload","provenance"],message:"Business site-build context requires persisted provenance."})}),nO=Se.object({source_snapshot_id:A,source_run_id:V,build_context:Hf,page_slugs:Se.array(Se.string().min(1)).optional()}).strict(),iO=Se.object({disposition:Se.enum(["reused","rebased"]),snapshot_id:A}).strict(),Vf=Se.object({snapshot:no,workspace_run_id:V.nullable()}).strict(),sO=L(Vf);import{z as ot}from"zod";import{z as Be}from"zod";import{z as ge}from"zod";import{z as $f}from"zod";var Yf=["company_profile","product_manual","product_list","customer_case","product_help","qualification","industry_material"],fm=$f.enum(Yf);var bm=ge.enum(["pending","running","ready","failed","missing"]),Xf=ge.object({task_id:ge.string().min(1).max(500),status:bm}).strict(),lO=ge.object({items:ge.array(Xf).max(100)}).strict(),Hn=ge.string().trim().min(1).max(255),pO=ge.object({knowledge_site_id:Hn,source_ids:ge.array(Hn).min(1).max(200)}).strict().superRefine((e,n)=>{new Set(e.source_ids).size!==e.source_ids.length&&n.addIssue({code:"custom",message:"Knowledge source IDs must be unique.",path:["source_ids"]})}),Qf=ge.object({source_file_id:Hn,category_code:fm.nullable(),category_confirmed:ge.boolean(),status:bm}).strict(),dO=ge.object({ready:ge.boolean(),files:ge.array(Qf),counts:ge.object({total:ge.number().int().nonnegative(),pending:ge.number().int().nonnegative(),running:ge.number().int().nonnegative(),ready:ge.number().int().nonnegative(),failed:ge.number().int().nonnegative(),missing:ge.number().int().nonnegative(),unclassified:ge.number().int().nonnegative()}).strict()}).strict();var be=e=>Be.string().trim().max(e),ym=Be.array(Be.string().trim().min(1).max(120)).max(20),Do=Be.object({company_name:Be.string().trim().min(1).max(200),brand_name:be(200),primary_products:Be.string().trim().min(1).max(1e3),industry:be(200),applications:be(1e3),business_summary:be(2e3),registered_capital:be(200).default(""),legal_representative:be(200).default(""),target_markets:ym,customer_industries:be(1e3),customer_roles:be(1e3),buying_scenarios:be(2e3),differentiators:be(2e3),competitors:be(1e3),trust_proof:be(2e3),customer_cases:be(3e3),channels:ym,expected_domain:be(255),brand_tone:be(500),contact_name:be(200),contact_info:be(500),timezone:be(100),launch_timing:be(200),input_source_ids:Be.array(Hn).max(50)}).strict(),Zf=Be.enum(["draft","submitted"]),Oo=Do.extend({id:Q,tenant_id:Be.string().min(1),site_id:k,workflow_id:nt,status:Zf,submitted_at:Be.string().min(1).nullable(),created_at:Be.string().min(1),updated_at:Be.string().min(1)}).strict(),fO=L(Oo),bO=L(Oo),yO=L(Oo.nullable());var TO=Di.extend({expected_current_node:ot.literal("website_scan"),type:ot.literal("existing_site"),result:Di.shape.result.extend({website:ot.string().url(),scan_cards:ot.partialRecord(Cc,mo).refine(e=>Object.keys(e).length>0,{message:"At least one recognized scan card is required."})}).strict()}).strict(),kO=ot.object({expected_current_node:ot.literal("customer_materials"),materials:Do}).strict(),AO=ot.object({expected_current_node:ot.literal("diagnosis")}).strict(),wO=ot.object({expected_current_node:ot.literal("strategy")}).strict();import{z as O}from"zod";var No=["compact","comfortable","airy"],xm=["none","sm","md","lg","xl"],Em="lg",jo=["subtle","moderate","expressive"],Jf=[{id:"subtle",motionLevel:"subtle"},{id:"moderate",motionLevel:"moderate"},{id:"expressive",motionLevel:"expressive"}];function Rm(e){let n=Jf.find(i=>i.id===e);if(!n)throw new Error(`Unknown motion preset: ${e}`);return n}var Im=["ocean","forest","clay","violet","graphite","crimson"],Tm=["ai-forest","ai-navy","ai-steel"],km=/^gen-[0-9a-f]{8}$/,Lo=[{id:"ai-forest",name:"\u5DE5\u4E1A\u58A8\u7EFF \xB7 Industrial Teal",description:"\u6C89\u7A33\u4E13\u4E1A\uFF0C\u7A81\u51FA\u7CBE\u5BC6\u4E0E\u53EF\u4FE1\u3002",fallbackReason:"\u7A33\u5B9A\u4E13\u4E1A\u7684\u9ED8\u8BA4\u9009\u62E9\u3002",colorSeeds:{primary:"#0E7C6F",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"sm"},{id:"ai-navy",name:"\u79D1\u6280\u6DF1\u84DD \xB7 Deep Tech Blue",description:"\u7406\u6027\u79D1\u6280\u611F\uFF0C\u5F3A\u8C03\u6280\u672F\u5B9E\u529B\u4E0E\u6570\u636E\u53EF\u4FE1\u3002",fallbackReason:"\u6280\u672F\u8868\u8FBE\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#1E3A8A",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"md"},{id:"ai-steel",name:"\u7CBE\u5BC6\u94F6\u7070 \xB7 Precision Steel",description:"\u514B\u5236\u6E05\u6670\uFF0C\u9002\u5408\u53C2\u6570\u4E0E\u5DE5\u7A0B\u7EC6\u8282\u8868\u8FBE\u3002",fallbackReason:"\u53C2\u6570\u4FE1\u606F\u8F83\u591A\u65F6\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#475569",accent:"#94A3B8",foreground:"#111827"},surfaceMode:"light",radius:"none"}],Mo=[{id:"ocean",colorSeeds:{primary:"#1e3a5f",accent:"#2563eb",foreground:"#0f172a"},surfaceMode:"light",radius:"md"},{id:"forest",colorSeeds:{primary:"#14532d",accent:"#16a34a",foreground:"#0f172a"},surfaceMode:"light",radius:"lg"},{id:"clay",colorSeeds:{primary:"#7c2d12",accent:"#ea580c",foreground:"#1c1917"},surfaceMode:"light",radius:"xl"},{id:"violet",colorSeeds:{primary:"#3b0764",accent:"#7c3aed",foreground:"#18181b"},surfaceMode:"light",radius:"lg"},{id:"graphite",colorSeeds:{primary:"#1f2937",accent:"#0d9488",foreground:"#111827"},surfaceMode:"light",radius:"none"},{id:"crimson",colorSeeds:{primary:"#7f1d1d",accent:"#dc2626",foreground:"#1f1012"},surfaceMode:"light",radius:"sm"}];function CO(e){let n=Mo.find(i=>i.id===e);if(!n)throw new Error(`Unknown theme preset: ${e}`);return n}function Am(e){return Mo.find(n=>n.id===e)?.radius??Lo.find(n=>n.id===e)?.radius}var Uo=O.string().regex(/^#[0-9A-F]{6}$/i),Vn=O.string().trim().min(1).max(500),wm=O.string().datetime({offset:!0}),eb=O.enum(Im),tb=O.enum(Tm),nb=O.string().regex(km),$n=O.union([eb,tb,nb]),Yn=O.enum(So),Xn=O.enum(jo),Qn=O.enum(No),Vi=O.enum(xm),Pm=300,ib=O.string().trim().min(1).max(Pm),$i=O.object({primary:Uo,accent:Uo,foreground:Uo}).strict(),sb=O.object({id:$n,rank:O.number().int().min(1).max(3),name:O.string().trim().min(1).max(120),description:O.string().trim().min(1).max(240),color_seeds:$i,surface_mode:O.enum(["light","dark"]),radius:Vi,font_pairing_id:Yn,motion_preset_id:Xn,density:Qn,weight_style:qe.optional(),reason:Vn}).strict(),vm=O.object({name:O.string().trim().min(1).max(120),description:O.string().trim().min(1).max(240),reason:Vn,color_seeds:$i,surface_mode:O.enum(["light","dark"]),radius:Vi,font_pairing_id:Yn,motion_preset_id:Xn,density:Qn,weight_style:qe}).strict(),Cm=O.object({version:O.number().int().min(1),recommendation_id:O.string().uuid(),theme_preset_id:$n,color_seeds:$i,surface_mode:O.enum(["light","dark"]),font_pairing_id:Yn,motion_preset_id:Xn,density:Qn,radius:Vi.optional(),weight_style:qe.optional(),aesthetic_note:ib.optional(),updated_at:wm}).strict(),ob=O.object({id:O.string().uuid(),version:O.number().int().min(1),catalog_version:O.string().trim().min(1).max(80),source:O.object({mode:O.enum(["ai","fallback"]),fallback_reason:O.string().trim().min(1).max(80).nullable()}).strict(),inputs:O.object({industry:O.string().trim().min(1).max(160).optional(),site_language:O.string().trim().min(2).max(35),owner_locale:Ee.optional(),strategy_version:O.number().int().min(1),input_digest:O.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict(),theme:O.object({recommended_id:$n,candidate_ids:O.array($n).length(3),candidates:O.array(sb).length(3)}).strict().superRefine((e,n)=>{e.recommended_id!==e.candidate_ids[0]&&n.addIssue({code:"custom",path:["recommended_id"],message:"recommended_id must be the first candidate"}),e.candidates.some((i,s)=>i.id!==e.candidate_ids[s]||i.rank!==s+1)&&n.addIssue({code:"custom",path:["candidates"],message:"Candidates must follow candidate_ids order."})}),font:O.object({recommended_id:Yn,reason:Vn}).strict(),motion:O.object({recommended_id:Xn,reason:Vn}).strict(),density:O.object({recommended_id:Qn,reason:Vn}).strict(),conversion:Mt.optional(),generated_at:wm}).strict(),WO=O.object({force_refresh:O.boolean().optional()}).strict(),KO=O.object({request_id:O.string().trim().min(1).max(160),site_id:k,cached:O.boolean(),recommendation:ob,selection:Cm}).strict(),BO=O.object({recommendation_id:O.string().uuid(),expected_version:O.number().int().min(1),theme_preset_id:$n,color_seeds:$i,surface_mode:O.enum(["light","dark"]),font_pairing_id:Yn,motion_preset_id:Xn,density:Qn,radius:Vi.optional(),weight_style:qe.optional(),aesthetic_note:O.string().trim().max(Pm).optional()}).strict(),zO=O.object({selection:Cm}).strict(),ab=4e3,HO=O.object({tenant_id:O.string().trim().min(1).max(160),site_id:k,site_language:O.string().trim().min(2).max(35),owner_locale:Ee,industry:O.string().trim().min(1).max(160).optional(),strategy_version_id:O.string().uuid(),strategy_version:O.number().int().min(1),strategy_checksum:O.string().regex(/^[a-f0-9]{64}$/),strategy_summary:O.array(O.string().trim().min(1).max(ab)).min(1).max(De)}).strict(),Fo=O.object({theme_candidates:O.array(vm).length(3),conversion:Mt.optional()}).strict().superRefine((e,n)=>{let i=new Set;e.theme_candidates.forEach((s,o)=>{let a=JSON.stringify(s.color_seeds).toUpperCase();i.has(a)&&n.addIssue({code:"custom",path:["theme_candidates",o,"color_seeds"],message:"Theme candidates must have pairwise distinct color_seeds"}),i.add(a)})});function VO(){return Lo.map(e=>vm.parse({name:e.name,description:e.description,reason:e.fallbackReason,color_seeds:e.colorSeeds,surface_mode:e.surfaceMode,radius:e.radius,font_pairing_id:So[0],motion_preset_id:jo[0],density:No[1],weight_style:Ni}))}function rb(e){return e.radius??Am(e.theme_preset_id)??"lg"}function cb(e,n){return e.weight_style??n?.theme?.candidates?.find(i=>i.id===e.theme_preset_id)?.weight_style??n?.theme?.candidates?.[0]?.weight_style??Ni}function $O(e,n){let i=Kc(e.font_pairing_id),s=Rm(e.motion_preset_id);return{colorSeeds:e.color_seeds,surfaceMode:e.surface_mode,fonts:{heading:i.heading,body:i.body},density:e.density,motionLevel:s.motionLevel,motionPreset:s.id,radius:rb(e),weightStyle:cb(e,n)}}function YO(e,n){let i=e.theme.candidates[0];return{version:1,recommendation_id:e.id,theme_preset_id:i.id,color_seeds:i.color_seeds,surface_mode:i.surface_mode,font_pairing_id:e.font.recommended_id,motion_preset_id:e.motion.recommended_id,density:e.density.recommended_id,radius:i.radius,weight_style:i.weight_style,updated_at:n.toISOString()}}import{z as Go}from"zod";function mb(e){return JSON.stringify([e.color_seeds.primary.toUpperCase(),e.color_seeds.accent.toUpperCase(),e.color_seeds.foreground.toUpperCase(),e.surface_mode,e.font_pairing_id,e.radius,e.motion_preset_id,e.density,e.weight_style])}var lb=Go.object(Fo.shape).strict().superRefine((e,n)=>{let i=new Set;e.theme_candidates.forEach((s,o)=>{let a=mb(s);i.has(a)&&n.addIssue({code:"custom",path:["theme_candidates",o],message:"Theme candidates must have pairwise distinct visual identities"}),i.add(a)})}),JO=Go.union([Fo,lb.safeExtend({model_profile:Go.literal("azure-gpt")})]);import{z as vt}from"zod";var iN=vt.object({site_id:k,site_language:vt.string().trim().min(2).max(35),business_facts:vt.array(vt.string().trim().min(1).max(1e3)).min(1).max(8)}).strict(),pb=vt.enum(["high","medium","low"]),sN=vt.object({skill_name:vt.string().trim().min(1).max(80).nullable(),confidence:pb,reason:vt.string().trim().min(1).max(240)}).strict();import{z as Zn}from"zod";var Dm=1e4,db=Zn.object({note:Zn.string().trim().max(Dm),updated_at:Zn.string().min(1)}).strict(),cN=Zn.object({note:Zn.string().trim().max(Dm)}).strict(),mN=L(db.nullable());import{z as te}from"zod";var qo=["title","text","richtext","number","boolean","date","datetime","url","email","color","select","multiselect","tag"],Yi=te.object({name:te.string().min(1).max(100),type:te.enum(qo),label:te.string().min(1).max(255),required:te.boolean().optional(),options:te.array(te.string()).optional()}),dN=te.object({name:te.string(),cms_type:te.string(),label:te.string().optional(),required:te.boolean().optional(),value_shape:te.string().optional(),front_display:te.enum(["visible","internal","forbidden"]).optional(),choices:te.array(te.object({value:te.union([te.string(),te.number()]),label:te.string()})).optional()}),uN=te.object({route_file_path:te.string().min(1),target_component_path:te.string().min(1),content_type_hint:te.string().min(1),collection_purpose:te.enum(["generic","product"]).optional(),required_fields:te.array(Yi).optional(),mode:te.enum(["bind_existing","provision"]),list_mode:te.enum(["page","embedded"]).optional(),fields:te.array(Yi).optional(),seed_records:te.array(te.record(te.string(),te.unknown())).optional()});import{z as G}from"zod";var Jn=G.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),Xi=G.string().regex(/^[a-f0-9]{64}$/),Qi=G.string().regex(/^[a-z][a-z0-9-]{0,99}$/),Zi=G.string().regex(/^[a-z0-9]{1,30}$/),He=e=>G.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),Om=G.object({id:G.string().uuid(),key:He(100),name:He(255)}).strict(),jm=new Set(["title","summary","description","category","thumbnail","url","admin_id"]),ub=new Set(["title","summary","description","image_query"]),_b=new Set(["category","thumbnail","url","admin_id","page","pages","route","path","component","components","snapshot","run","site_id","cms_site_id","tenant_id","token","secret","password","authorization","headers","__proto__","prototype","constructor"]),Nm=new Set(["select","multiselect"]),gb=new Set(["title","text","richtext","date","datetime","url","email","color"]),hb=G.object({name:He(100),label:He(255),type:G.enum(qo),required:G.boolean().optional(),options:G.array(He(100)).max(100).optional()}).strict().superRefine((e,n)=>{let i=e.options??[];Nm.has(e.type)&&i.length===0&&n.addIssue({code:"custom",path:["options"],message:"Choice fields require at least one option"}),!Nm.has(e.type)&&i.length>0&&n.addIssue({code:"custom",path:["options"],message:"Only choice fields may declare options"}),new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["options"],message:"Field options must be unique"}),jm.has(e.name)&&n.addIssue({code:"custom",path:["name"],message:"Reserved CMS field names cannot be declared"})}),Sb=G.array(hb).min(1).max(200),fb=G.array(G.record(G.string(),G.unknown())).max(1e3);function ze(e,n,i){e.addIssue({code:"custom",path:n,message:i})}var bb=G.object({name:He(30),slug:Zi,collection_purpose:G.enum(["generic","product"]).optional(),fields:Sb,seed_records:fb}).strict().superRefine((e,n)=>{let i=e.fields.map(o=>o.name);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["fields"],message:"Field names must be unique"}),i.some(o=>!jm.has(o))||n.addIssue({code:"custom",path:["fields"],message:"At least one custom field is required"});let s=new Map(e.fields.map(o=>[o.name,o]));e.seed_records.forEach((o,a)=>{for(let[c,r]of Object.entries(o)){let m=["seed_records",a,c];if(_b.has(c)){ze(n,m,"Seed cannot write reserved or runtime-owned fields");continue}if(c==="image_query"){(typeof r!="string"||r.trim()==="")&&ze(n,m,"image_query must be a non-empty string");continue}if(ub.has(c)){typeof r!="string"&&ze(n,m,"Seed skeleton text fields must be strings");continue}let S=s.get(c);if(!S){ze(n,m,"Seed contains an undeclared field");continue}if(r==null){ze(n,m,"Seed field values must not be null");continue}if(S.type==="select")(typeof r!="string"||!(S.options??[]).includes(r))&&ze(n,m,"Seed select value must be one of the declared options");else if(S.type==="multiselect")(!Array.isArray(r)||r.length===0||r.some(g=>typeof g!="string"||!(S.options??[]).includes(g)))&&ze(n,m,"Seed multiselect value must contain only declared options");else if(S.type==="number")(typeof r!="number"||!Number.isFinite(r))&&ze(n,m,"Seed number values must be finite numbers");else if(S.type==="boolean")typeof r!="boolean"&&ze(n,m,"Seed boolean values must be booleans");else if(S.type==="tag"){let g=Array.isArray(r)?r:[r];(g.length===0||g.some(w=>typeof w!="string"||w.trim()===""))&&ze(n,m,"Seed tag values must be non-empty strings")}else gb.has(S.type)&&typeof r!="string"&&ze(n,m,"Seed text-like values must be strings")}for(let c of e.fields)c.required&&!(c.name in o)&&ze(n,["seed_records",a,c.name],"Required fields must be present in every seed record")}),new TextEncoder().encode(JSON.stringify(e)).byteLength>1024*1024&&n.addIssue({code:"custom",path:[],message:"Application template must not exceed 1048576 UTF-8 bytes"})}),Wo=G.object({schema_version:G.literal(1),application:bb}).strict(),yb=G.object({templateId:G.string().uuid(),stableKey:Qi,resolvedVersion:Jn,digest:Xi,template:Wo}).strict(),xb=yb,Eb={alreadyCreated:"APPLICATION_ALREADY_CREATED",slugConflict:"APPLICATION_SLUG_CONFLICT",createInProgress:"APPLICATION_CREATE_IN_PROGRESS",cmsUnbound:"APPLICATION_CMS_UNBOUND",templateVersionUnavailable:"APPLICATION_TEMPLATE_VERSION_UNAVAILABLE",createFailed:"APPLICATION_CREATE_FAILED",createResultUnknown:"APPLICATION_CREATE_RESULT_UNKNOWN"},Lm=G.enum(Object.values(Eb)),Mm=G.object({category_status:G.enum(["succeeded","failed","not_attempted"]),seed_status:G.enum(["skipped","succeeded","partial","failed"]),requested_count:G.number().int().nonnegative(),written_count:G.number().int().nonnegative().nullable(),published_count:G.number().int().nonnegative().nullable(),errors:G.array(G.object({stage:G.enum(["category","seed","receipt"]),code:He(100)}).strict()).max(20)}).strict(),Rb=G.object({templateId:G.string().uuid(),stableKey:Qi,title:He(200),description:G.string().max(1e3),thumbnailUrl:G.string().url().nullable(),resolvedVersion:Jn,digest:Xi,application:G.object({name:He(30),slug:Zi}).strict(),categories:G.array(Om),tags:G.array(Om),status:G.enum(["available","creating","created","conflict","failed"]),errorCode:Lm.nullable().optional(),template:Wo.optional()}).strict(),Um=G.object({items:G.array(Rb)}).strict(),SN=G.object({version:Jn}).strict(),Ib=G.object({app_slug:Zi,name:He(30),template:G.object({stable_key:Qi,version:Jn,digest:Xi}).strict()}).strict(),Tb=G.object({status:G.literal("created"),application:Ib,initialization:Mm}).strict(),fN=Tb,kb=G.object({stable_key:Qi,version:Jn,digest:Xi,created_at:G.string().datetime().nullable(),initialization:Mm.nullable()}).strict(),Ab=G.object({app_slug:Zi,name:He(30),collection_slug:G.string().min(1),detail_prefix:G.string().min(1).optional(),source:kb.nullable()}).strict(),bN=G.object({applications:G.array(Ab)}).strict(),yN=Um,xN=G.object({code:Lm,message:He(500)}).strict(),EN=Wo,RN=xb,IN=Um;import{z as de}from"zod";var Fm=e=>de.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),wb=Yi.strict(),qm=de.array(wb).min(1).max(200),Pb=de.array(de.record(de.string(),de.unknown())).max(1e3),vb=de.string().regex(/^[a-z0-9]{1,30}$/),Ko=de.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),wN=de.object({name:Fm(30),slug:Fm(50),collection_purpose:de.enum(["generic","product"]).optional(),fields:qm}).strict(),Gm=de.object({collection_slug:vb,detail_prefix:de.string().min(1).max(255),plugin_id:Ko.optional()}).strict(),PN=de.discriminatedUnion("kind",[Gm.extend({kind:de.literal("created")}),Gm.extend({kind:de.literal("exists")})]),vN=de.object({fields:qm,seed_records:Pb,category_id:Ko}).strict(),Cb=de.record(de.string().min(1),de.string().min(1).nullable()),CN=de.object({ids:de.array(Ko).max(1e3),urls:Cb,failed:de.array(de.unknown()).max(1e3)}).strict();function DN(e){return e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().slice(0,30)}import{z as ye}from"zod";import{z as Bo}from"zod";var Wm=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],Km="-",Db="embedded",zo=Bo.enum([...Wm,Km]),Ob=Bo.literal(Db),Ho=Bo.object({scene:zo,shape:Ob}).strict();function jN(e){return Wm.find(n=>n===e)??Km}var Ji=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number","file"],Nb=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number"],jb=ye.object({name:ye.string().min(1).max(100),type:ye.enum(Nb),label:ye.string().min(1).max(255),required:ye.boolean().optional(),options:ye.array(ye.string()).optional()}),Lb=ye.string().regex(/^[a-z][a-z0-9-]{0,48}$/).optional(),FN=ye.object({mode:ye.enum(["bind_existing","provision"],{error:'mode is required. Use "bind_existing" or "provision". Never call connect_form with {}.'}),form_hint:ye.string().min(1).optional(),name:ye.string().min(1).max(255).optional(),scene:zo.optional(),component_slug:Lb,description:ye.string().min(1).max(1e3).optional(),fields:ye.array(jb).optional()}).superRefine((e,n)=>{e.mode==="provision"&&e.scene===void 0&&n.addIssue({code:"custom",path:["scene"],message:"scene is required for provision"}),e.mode==="bind_existing"&&e.scene!==void 0&&n.addIssue({code:"custom",path:["scene"],message:"scene is prohibited for bind_existing"}),e.mode==="bind_existing"&&!e.form_hint?.trim()&&n.addIssue({code:"custom",path:["form_hint"],message:"form_hint is required for bind_existing"}),e.mode==="provision"&&!e.name?.trim()&&n.addIssue({code:"custom",path:["name"],message:"name is required for provision"})}),GN=ye.object({name:ye.string(),label:ye.string(),cms_type:ye.string(),required:ye.boolean()});import{z as p}from"zod";var ei=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,pn=/^[A-Za-z][A-Za-z0-9_-]{0,127}$/,es=/^[A-Za-z][A-Za-z0-9_]{0,99}$/,Vm=/^[A-Za-z0-9][A-Za-z0-9_-]{0,99}$/,$o=/^[a-z][a-z0-9-]{0,99}$/,$m=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/,Bm=2,zm=3,ts=p.string().regex(ei),Mb=p.string().regex(ei),Yo=p.string().regex(ei),ti=p.string().regex(es),Xo=p.string().regex(Vm),Ub=p.discriminatedUnion("status",[p.object({status:p.literal("unbound"),form_code:p.null()}).strict(),p.object({status:p.literal("bound"),form_code:p.string().regex(pn)}).strict(),p.object({status:p.literal("missing"),form_code:p.string().regex(pn)}).strict()]),Fb=p.object({value:Xo,label:p.string().trim().min(1).max(255)}).strict(),Gb=p.object({kind:p.literal("field"),field_name:ti,type:p.enum(Ji),label:p.string().trim().min(1).max(255),required:p.boolean(),span:p.enum(["full","half"]),options:p.array(Fb).max(100),max_files:p.number().int().min(1).max(5).optional()}).strict(),qb=p.object({kind:p.literal("step-break"),step_id:p.string().regex(ei)}).strict(),Wb=p.discriminatedUnion("kind",[Gb,qb]),Kb=p.object({field_name:ti,type:p.enum(Ji),last_label:p.string().max(255)}).strict(),Bb=p.object({field_name:ti,value:Xo,last_label:p.string().max(255)}).strict(),zb=p.discriminatedUnion("kind",[p.object({kind:p.literal("custom")}).strict(),p.object({kind:p.literal("template"),slug:p.string().regex($o),version:p.string().regex($m)}).strict()]),Hb={select:2,radio:2,multiselect:1,DropdownSelection:2,RadioButton:2,Checkbox:1};function at(e){return e.toLowerCase()}function Ym(e,n){return e.trim().toLocaleLowerCase(n)}function ln(e,n){return`${at(e)}\0${n}`}function we(e,n,i,s){let o=new Set;for(let a of e){if(o.has(a)){s.addIssue({code:"custom",path:n,message:i});return}o.add(a)}}function Qo(e,n,i,s){let o=Hb[e]??0;o>0&&n<o?s.addIssue({code:"custom",path:i,message:`choice field requires at least ${o} option${o===1?"":"s"}`}):o===0&&n>0&&s.addIssue({code:"custom",path:i,message:"non-choice fields must use an empty options array"})}var Zo=p.object({schema_version:p.literal(1),min_runtime_version:p.number().int().positive(),form_definition_id:ts,binding:Ub,content_locale:Ee,features:p.object({multistep:p.boolean()}).strict(),copy:p.object({title:p.string().max(255),description:p.string().max(1e3),submit_button:p.string().trim().min(1).max(100),success_message:p.string().trim().min(1).max(500),error_message:p.string().max(500)}).strict(),layout:p.object({columns:p.enum(["one","two"])}).strict(),nodes:p.array(Wb).min(1).max(200),source:zb,retired:p.object({fields:p.array(Kb).max(1e3),options:p.array(Bb).max(5e3)}).strict(),compatibility:p.object({standardization_version:p.number().int().positive(),diagnostics:p.array(p.string().trim().min(1).max(500)).max(100)}).strict()}).strict().superRefine((e,n)=>{let i=e.nodes.flatMap((r,m)=>r.kind==="field"?[[m,r]]:[]),s=i.map(([,r])=>r);s.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"at least one field node is required"});let o=e.nodes.filter(r=>r.kind==="step-break");!e.features.multistep&&o.length>0&&n.addIssue({code:"custom",path:["nodes"],message:"step-break requires the multistep feature"}),e.features.multistep&&(e.min_runtime_version<Bm&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`multistep requires runtime version ${Bm}`}),o.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"multistep requires at least one step-break"}));for(let[r,m]of e.nodes.entries())m.kind==="step-break"&&(r===0||r===e.nodes.length-1||e.nodes[r-1]?.kind==="step-break"||e.nodes[r+1]?.kind==="step-break")&&n.addIssue({code:"custom",path:["nodes",r],message:"step-break must separate two non-empty steps"});we(o.map(r=>r.step_id),["nodes"],"step_id must be unique",n),we(s.map(r=>at(r.field_name)),["nodes"],"field_name must be unique",n),we(e.retired.fields.map(r=>at(r.field_name)),["retired","fields"],"retired field_name must be unique",n);let a=new Set(e.retired.fields.map(r=>at(r.field_name)));for(let[r,m]of i)a.has(at(m.field_name))&&n.addIssue({code:"custom",path:["nodes",r,"field_name"],message:"retired field_name cannot be reused"}),Qo(m.type,m.options.length,["nodes",r,"options"],n),m.type==="file"?e.min_runtime_version<zm&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`file fields require runtime version ${zm}`}):m.max_files!==void 0&&n.addIssue({code:"custom",path:["nodes",r,"max_files"],message:"max_files is only valid for file fields"}),we(m.options.map(S=>S.value),["nodes",r,"options"],"option value must be unique within a field",n),we(m.options.map(S=>Ym(S.label,e.content_locale)),["nodes",r,"options"],"option label must be unique within a field",n);we(e.retired.options.map(r=>ln(r.field_name,r.value)),["retired","options"],"retired option identity must be unique",n);let c=new Set(e.retired.options.map(r=>ln(r.field_name,r.value)));for(let[r,m]of i)for(let[S,g]of m.options.entries())c.has(ln(m.field_name,g.value))&&n.addIssue({code:"custom",path:["nodes",r,"options",S,"value"],message:"retired option value cannot be reused"})}),Vb=["copy.title","copy.description","copy.submit_button","copy.success_message","copy.error_message","nodes.*.label","nodes.*.options.*.label"],$b=new Set(Vb);function $N(e){let n=e.map(i=>typeof i=="number"||/^\d+$/.test(i)?"*":i).join(".");return $b.has(n)}function YN(e,n){let i=[],s=e.nodes.filter(r=>r.kind==="field"),o=new Map(n.nodes.filter(r=>r.kind==="field").map(r=>[at(r.field_name),r])),a=new Map(n.retired.fields.map(r=>[at(r.field_name),r])),c=new Map(n.retired.options.map(r=>[ln(r.field_name,r.value),r]));for(let r of s){let m=at(r.field_name),S=o.get(m),g=a.get(m);S&&S.field_name!==r.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),S&&S.type!==r.type&&i.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),!S&&g&&g.field_name!==r.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!S&&g&&g.type!==r.type&&i.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),!S&&!a.has(m)&&i.push({code:"FIELD_RETIREMENT_MISSING",field_name:r.field_name});let w=new Set(S?.options.map(K=>K.value)??[]);for(let K of r.options){let H=c.get(ln(r.field_name,K.value));!w.has(K.value)&&H&&H.field_name!==r.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!w.has(K.value)&&!H&&i.push({code:"OPTION_RETIREMENT_MISSING",field_name:r.field_name,value:K.value})}}for(let r of e.retired.fields){let m=a.get(at(r.field_name));m&&m.field_name!==r.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),m&&m.type!==r.type&&i.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),m||i.push({code:"FIELD_RETIREMENT_MISSING",field_name:r.field_name})}for(let r of e.retired.options){let m=c.get(ln(r.field_name,r.value));m&&m.field_name!==r.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),m||i.push({code:"OPTION_RETIREMENT_MISSING",field_name:r.field_name,value:r.value})}return i}var Yb=p.enum(An),Ct=p.object({english:p.string().max(1e3),translations:p.partialRecord(Yb,p.string().max(1e3)).optional()}).strict(),Xb=p.object({template_option_key:p.string().regex(Vm),label:Ct}).strict(),Qb=p.object({template_field_key:p.string().regex(es),type:p.enum(Ji),label:Ct,required:p.boolean(),span:p.enum(["full","half"]),options:p.array(Xb).max(100)}).strict(),Zb=p.object({template_step_key:p.string().regex(es),after_field_key:p.string().regex(es)}).strict(),XN=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],QN=[1,1,1,1,1,1],Xm=p.string().regex($o),Jb=p.object({schema_version:p.literal(1),slug:Xm,name:Ct,template_count:p.number().int().min(0).max(500)}).strict().superRefine((e,n)=>{e.name.english.trim()===""&&n.addIssue({code:"custom",path:["name","english"],message:"English category name is required"})}),ey=p.object({schema_version:p.literal(1),slug:p.string().regex($o),version:p.string().regex($m),category:Xm,copy:p.object({title:Ct,description:Ct,submit_button:Ct,success_message:Ct,error_message:Ct}).strict(),layout:p.object({columns:p.enum(["one","two"])}).strict(),fields:p.array(Qb).min(1).max(200),step_breaks:p.array(Zb).max(20).optional()}).strict().superRefine((e,n)=>{for(let a of["title","description","submit_button","success_message","error_message"])e.copy[a].english.trim()===""&&n.addIssue({code:"custom",path:["copy",a,"english"],message:"English baseline text is required"});we(e.fields.map(a=>a.template_field_key),["fields"],"template_field_key must be unique",n);let i=new Map(e.fields.map((a,c)=>[a.template_field_key,c])),s=e.step_breaks??[];we(s.map(a=>a.template_step_key),["step_breaks"],"template_step_key must be unique",n),we(s.map(a=>a.after_field_key),["step_breaks"],"step breaks must not share an anchor field",n);let o=-1;for(let[a,c]of s.entries()){let r=i.get(c.after_field_key);r===void 0||r>=e.fields.length-1?n.addIssue({code:"custom",path:["step_breaks",a,"after_field_key"],message:"step break must follow an existing non-final field"}):r<=o&&n.addIssue({code:"custom",path:["step_breaks",a,"after_field_key"],message:"step breaks must follow field order"}),o=r??o}e.fields.length+s.length>200&&n.addIssue({code:"custom",path:["step_breaks"],message:"template fields and step breaks must not exceed 200 nodes"});for(let[a,c]of e.fields.entries()){c.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",a,"label","english"],message:"English field label is required"}),Qo(c.type,c.options.length,["fields",a,"options"],n),we(c.options.map(r=>r.template_option_key),["fields",a,"options"],"template_option_key must be unique within a field",n),we(c.options.map(r=>r.label.english.trim().toLowerCase()),["fields",a,"options"],"English option labels must be unique within a field",n);for(let[r,m]of c.options.entries())m.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",a,"options",r,"label","english"],message:"English option label is required"})}}),ZN=p.object({schema_version:p.literal(1),visibility:p.enum(["internal","public"]),categories:p.array(Jb).max(500),templates:p.array(ey).max(500)}).strict().superRefine((e,n)=>{let i=(o,a)=>{let c=An.filter(r=>!o.translations?.[r]?.trim());c.length>0&&n.addIssue({code:"custom",path:[...a,"translations"],message:`public template copy is missing locales: ${c.join(", ")}`})};we(e.categories.map(o=>o.slug),["categories"],"template category slug must be unique",n);let s=new Set(e.categories.map(o=>o.slug));for(let[o,a]of e.categories.entries()){let c=e.templates.filter(r=>r.category===a.slug).length;a.template_count!==c&&n.addIssue({code:"custom",path:["categories",o,"template_count"],message:"template_count must match catalog templates"})}we(e.templates.map(o=>o.slug),["templates"],"template slug must be unique",n);for(let[o,a]of e.templates.entries())s.has(a.category)||n.addIssue({code:"custom",path:["templates",o,"category"],message:"template category must exist in catalog categories"});if(e.visibility==="public"){for(let[o,a]of e.categories.entries())i(a.name,["categories",o,"name"]);for(let[o,a]of e.templates.entries()){for(let[c,r]of Object.entries(a.copy))i(r,["templates",o,"copy",c]);for(let[c,r]of a.fields.entries()){i(r.label,["templates",o,"fields",c,"label"]);for(let[m,S]of r.options.entries())i(S.label,["templates",o,"fields",c,"options",m,"label"])}}}});function JN(e,n){let i=mr(n),s=i?e.translations?.[i]:void 0;return s!==void 0&&s.trim()!==""?s:e.english}var ty=["Text","Summary","Email","Phone","DropdownSelection","RadioButton","Checkbox","Boolean","Date","Num","MultipleFile","SpecificFile"],ny={text:"Text",textarea:"Summary",email:"Email",phone:"Phone",select:"DropdownSelection",radio:"RadioButton",multiselect:"Checkbox",boolean:"Boolean",date:"Date",number:"Num",file:"MultipleFile"},iy=p.object({value:Xo,label:p.string().trim().min(1).max(255)}).strict(),sy=p.object({field_name:ti,field_type:p.enum(ty),field_label:p.string().trim().min(1).max(255),is_required:p.boolean(),sort_order:p.number().int().nonnegative(),options:p.array(iy).max(100)}).strict(),Qm=p.object({version:p.literal(1),locale:Ee,fields:p.array(sy).min(1).max(200)}).strict().superRefine((e,n)=>{we(e.fields.map(i=>at(i.field_name)),["fields"],"field_name must be unique",n);for(let[i,s]of e.fields.entries())Qo(s.field_type,s.options.length,["fields",i,"options"],n),we(s.options.map(o=>o.value),["fields",i,"options"],"option value must be unique within a field",n),we(s.options.map(o=>Ym(o.label,e.locale)),["fields",i,"options"],"option label must be unique within a field",n)});function ej(e){let n=e.nodes.filter(i=>i.kind==="field").map((i,s)=>({field_name:i.field_name,field_type:i.type==="file"&&i.max_files===1?"SpecificFile":ny[i.type],field_label:i.label,is_required:i.required,sort_order:s,options:i.options.map(o=>({...o}))}));return Qm.parse({version:1,locale:e.content_locale,fields:n})}var pe=p.string().regex(/^sha256:[0-9a-f]{64}$/),oy=p.union([xe,p.enum(["app/api/forms/[code]/route.ts","hooks/use-cms-form-submit.ts","lib/cms/forms.ts","lib/cms/client.ts"])]),ay=p.object({path:oy,content_hash:pe.nullable()}).strict(),ry=p.array(ay).min(1).max(500).superRefine((e,n)=>{we(e.map(i=>i.path),[],"affected file paths must be unique",n)}),Jo=p.object({grade:p.enum(["standard","A","B","C"]),required:p.boolean(),pending_confirmations:p.array(p.object({item_id:p.string().regex(ei),field_name:ti.optional(),kind:p.enum(["form_copy","layout","field_label","field_type","field_required","field_options"]),message:p.string().trim().min(1).max(500)}).strict().superRefine((e,n)=>{e.kind.startsWith("field_")&&!e.field_name&&n.addIssue({code:"custom",path:["field_name"],message:"field confirmation items require field_name"})})).max(200)}).strict().superRefine((e,n)=>{let i=e.grade==="standard";i===e.required&&n.addIssue({code:"custom",path:["required"],message:i?"standard forms do not require standardization confirmation":"legacy forms require standardization confirmation"}),e.grade==="C"&&e.pending_confirmations.length===0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"grade C requires at least one pending confirmation"}),e.grade!=="C"&&e.pending_confirmations.length>0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"only grade C can contain pending confirmations"})}),cy=p.object({site_id:k,form_definition_id:ts,base_snapshot_id:A,expected_form_spec_hash:pe,expected_cms_schema_hash:pe.nullable(),form_metadata:Ho.nullable(),draft_form_spec_hash:pe,desired_cms_schema_hash:pe,affected_files_hash:pe,shared_reference_hash:pe,shared_reference_count:p.number().int().positive(),confirm_shared_update:p.boolean(),recreate_missing_binding:p.boolean(),standardization:Jo,confirm_standardization:p.boolean()}).strict(),Zm=p.object({reference_hash:pe,page_count:p.number().int().positive(),block_count:p.number().int().positive()}).strict().refine(e=>e.page_count<=e.block_count,{message:"page_count cannot exceed block_count"}),tj=p.object({site_id:k,form_block_id:Mb,base_snapshot_id:A,form_spec:Zo,runtime_upgrade_required:p.boolean(),expected_form_spec_hash:pe,expected_cms_schema_hash:pe.nullable(),affected_files_hash:pe,shared_impact:Zm,standardization:Jo}).strict(),my=p.object({operation_id:Yo,operation_fingerprint:pe,site_id:k,form_definition_id:ts,base_snapshot_id:A,expected_form_spec_hash:pe,expected_cms_schema_hash:pe.nullable(),form_metadata:Ho.nullable(),draft_form_spec:Zo,draft_form_spec_hash:pe,desired_cms_schema_hash:pe,affected_files_hash:pe,shared_impact:Zm,confirm_shared_update:p.boolean(),recreate_missing_binding:p.boolean(),standardization:Jo,confirm_standardization:p.boolean()}).strict().superRefine((e,n)=>{e.form_definition_id!==e.draft_form_spec.form_definition_id&&n.addIssue({code:"custom",path:["form_definition_id"],message:"form_definition_id must match draft_form_spec"}),e.shared_impact.block_count>1&&!e.confirm_shared_update&&n.addIssue({code:"custom",path:["confirm_shared_update"],message:"shared definition updates require explicit confirmation"});let i=e.draft_form_spec.binding.status==="missing";i!==e.recreate_missing_binding&&n.addIssue({code:"custom",path:["recreate_missing_binding"],message:i?"missing bindings require explicit recreation confirmation":"only missing bindings can be recreated"});let s=e.draft_form_spec.binding.status==="bound",o=s&&e.standardization.required&&(e.standardization.grade==="B"||e.standardization.grade==="C");(s&&!o&&e.expected_cms_schema_hash===null||!s&&e.expected_cms_schema_hash!==null)&&n.addIssue({code:"custom",path:["expected_cms_schema_hash"],message:s?"bound standard forms require the current CMS schema hash":"unbound or missing forms cannot claim a current CMS schema hash"}),e.confirm_standardization!==e.standardization.required&&n.addIssue({code:"custom",path:["confirm_standardization"],message:e.standardization.required?"legacy standardization requires explicit confirmation":"standard forms cannot claim legacy standardization confirmation"})}),ly=["created","validated","binding_reserved","candidate_ready","cms_applied","snapshot_promoted","committed","compensating","recovery_required","failed"],ea=p.enum(ly),py=["pending","running","succeeded","failed","recovery_required"],Jm=p.enum(py),dy=["candidate_abandon","snapshot_reconcile","cms_restore"],el=p.enum(dy),uy=["FORM_DESIGN_INVALID","FORM_DESIGN_UNSUPPORTED","FORM_DESIGN_STANDARDIZATION_AGENT_REQUIRED","FORM_DESIGN_STANDARDIZATION_UNSUPPORTED","FORM_DESIGN_FEATURE_NOT_ENABLED","FORM_DESIGN_PERMISSION_DENIED","FORM_DESIGN_LOCKED","FORM_DESIGN_CODE_CONFLICT","FORM_DESIGN_CMS_CONFLICT","FORM_DESIGN_CMS_SCHEMA_MISMATCH","FORM_DESIGN_CMS_NOT_FOUND","FORM_DESIGN_BINDING_MISSING","FORM_DESIGN_OPERATION_CONFLICT","FORM_DESIGN_CMS_UNAVAILABLE","FORM_DESIGN_PATCH_FAILED","FORM_DESIGN_COMPENSATION_FAILED","FORM_DESIGN_RECOVERY_REQUIRED"],ta=p.enum(uy),tl=p.enum(["wait","resume","retry_new_operation","manual_recovery","none"]),nl=p.enum(["not_started","pending","succeeded","failed"]),il=p.object({operation_id:Yo,operation_fingerprint:pe,site_id:k,form_definition_id:ts,stage:ea,status:Jm,base_snapshot_id:A,candidate_snapshot_id:A.nullable(),before_form_code:p.string().regex(pn).nullable(),materialized_form_code:p.string().regex(pn).nullable(),expected_form_spec_hash:pe,draft_form_spec_hash:pe,materialized_form_spec_hash:pe.nullable(),expected_cms_schema_hash:pe.nullable(),desired_cms_schema_hash:pe,retry_count:p.number().int().nonnegative(),failure_stage:el.nullable(),last_error_code:ta.nullable(),retryable:p.boolean(),next_action:tl,preview_refresh_status:nl,created_at:p.string().datetime({offset:!0}),updated_at:p.string().datetime({offset:!0})}).strict().superRefine((e,n)=>{if(!(e.stage!=="committed"&&e.status!=="succeeded")){(e.stage!=="committed"||e.status!=="succeeded")&&n.addIssue({code:"custom",path:["status"],message:"committed stage and succeeded status must be reported together"});for(let i of["candidate_snapshot_id","materialized_form_code","materialized_form_spec_hash"])e[i]===null&&n.addIssue({code:"custom",path:[i],message:`${i} is required for a committed success`});(e.failure_stage!==null||e.last_error_code!==null||e.retryable||e.next_action!=="none")&&n.addIssue({code:"custom",path:["next_action"],message:"a committed success cannot retain an error or retry action"})}}),na=p.object({operation:il}).strict(),nj=na,ij=na,sj=p.object({operation_fingerprint:pe}).strict(),oj=na,_y=p.preprocess(e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;let n="form_metadata"in e?e:{...e,form_metadata:null};return"standardization"in e||"confirm_standardization"in e?n:{...n,standardization:{grade:"standard",required:!1,pending_confirmations:[]},confirm_standardization:!1}},my),aj=p.object({operation:il,request:_y,cms_replace_result:p.unknown().nullable()}).strict(),gy=p.object({stage:ea.optional(),status:Jm.optional(),candidate_snapshot_id:A.nullable().optional(),before_form_code:p.string().regex(pn).nullable().optional(),materialized_form_code:p.string().regex(pn).nullable().optional(),materialized_form_spec_hash:pe.nullable().optional(),retry_count:p.number().int().nonnegative().optional(),failure_stage:el.nullable().optional(),last_error_code:ta.nullable().optional(),retryable:p.boolean().optional(),next_action:tl.optional(),preview_refresh_status:nl.optional()}).strict(),rj=p.object({expected_updated_at:p.string().datetime({offset:!0}),operation:gy,cms_replace_result:p.unknown().nullable().optional()}).strict().refine(e=>Object.keys(e.operation).length>0||Object.hasOwn(e,"cms_replace_result"),{message:"transition must change operation state or CMS result"}),cj=p.object({code:ta,message:p.string().trim().min(1).max(500),retryable:p.boolean(),operation_id:Yo.optional(),stage:ea.optional()}).strict();function hy(e){return cy.parse({site_id:e.site_id,form_definition_id:e.form_definition_id,base_snapshot_id:e.base_snapshot_id,expected_form_spec_hash:e.expected_form_spec_hash,expected_cms_schema_hash:e.expected_cms_schema_hash,draft_form_spec_hash:e.draft_form_spec_hash,desired_cms_schema_hash:e.desired_cms_schema_hash,affected_files_hash:e.affected_files_hash,form_metadata:e.form_metadata,shared_reference_hash:e.shared_impact.reference_hash,shared_reference_count:e.shared_impact.block_count,confirm_shared_update:e.confirm_shared_update,recreate_missing_binding:e.recreate_missing_binding,standardization:e.standardization,confirm_standardization:e.confirm_standardization})}function Hm(e){for(let n=0;n<e.length;n+=1){let i=e.charCodeAt(n);if(i>=55296&&i<=56319){let s=e.charCodeAt(n+1);if(n+1>=e.length||s<56320||s>57343)throw new TypeError("canonical JSON cannot contain a lone surrogate");n+=1}else if(i>=56320&&i<=57343)throw new TypeError("canonical JSON cannot contain a lone surrogate")}}function Vo(e,n){if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError("canonical JSON numbers must be finite");return JSON.stringify(e)}if(typeof e=="string")return Hm(e),JSON.stringify(e);if(typeof e!="object")throw new TypeError("value is not valid JSON");if(n.has(e))throw new TypeError("canonical JSON cannot contain cycles");n.add(e);try{if(Array.isArray(e)){let a=[];for(let c=0;c<e.length;c+=1){if(!(c in e))throw new TypeError("canonical JSON cannot contain sparse arrays");a.push(Vo(e[c],n))}return`[${a.join(",")}]`}let i=Object.getPrototypeOf(e);if(i!==Object.prototype&&i!==null)throw new TypeError("canonical JSON objects must be plain records");let s=e;return`{${Object.keys(s).sort().map(a=>(Hm(a),`${JSON.stringify(a)}:${Vo(s[a],n)}`)).join(",")}}`}finally{n.delete(e)}}function ia(e){return Vo(e,new Set)}async function ns(e){let n=ia(e),i=new TextEncoder().encode(n),s=globalThis.crypto?.subtle?new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256",i)):(await import("@noble/hashes/sha256")).sha256(i);return`sha256:${Array.from(s,a=>a.toString(16).padStart(2,"0")).join("")}`}async function mj(e){return ns(Zo.parse(e))}async function lj(e){return ns(Qm.parse(e))}async function pj(e){let n=ry.parse(e).map(i=>({...i})).sort((i,s)=>i.path<s.path?-1:i.path>s.path?1:0);return ns({version:1,files:n})}async function dj(e){return ns(hy(e))}import{z as N}from"zod";var gj=["page-seo","root-layout-metadata","nav-items"],hj=N.object({path:N.string(),title:N.string(),description:N.string().optional(),keywords:N.string().optional(),meta_tags_json:N.record(N.string(),N.record(N.string(),N.string())).nullish(),schema_json:N.union([N.record(N.string(),N.unknown()),N.array(N.record(N.string(),N.unknown())),N.string()]).nullish(),breadcrumbs_json:N.array(N.object({name:N.string().optional(),text:N.string().optional(),url:N.string().nullish()})).nullish()}),Sj=N.object({metadataBase:N.string().optional(),title:N.union([N.string(),N.object({default:N.string().optional(),template:N.string().optional(),absolute:N.string().optional()})]).optional(),description:N.string().optional(),keywords:N.string().optional(),openGraph:N.object({title:N.string().optional(),description:N.string().optional(),type:N.string().optional(),siteName:N.string().optional(),url:N.string().optional(),locale:N.string().optional(),images:N.array(N.union([N.string(),N.object({url:N.string(),alt:N.string().optional()})])).optional()}).optional(),twitter:N.object({card:N.string().optional(),title:N.string().optional(),description:N.string().optional(),images:N.array(N.string()).optional()}).optional(),alternates:N.object({canonical:N.string().optional()}).optional()}),sl=()=>N.object({label:N.string(),href:N.string().optional(),targetType:N.enum(["page","anchor","external","email","phone","file","group"]).optional(),role:N.enum(["link","cta"]).optional(),openInNewTab:N.boolean().optional(),nofollow:N.boolean().optional(),description:N.string().optional(),badge:N.string().optional(),iconKey:N.string().optional()}),fj=sl().extend({children:N.array(sl()).optional()}),Sy=["title","description","keywords","breadcrumbs_json.*.name","breadcrumbs_json.*.text"],fy=["path","meta_tags_json.**","schema_json.**","breadcrumbs_json.*.url"],by=["title","title.default","title.template","title.absolute","description","keywords","openGraph.title","openGraph.description","openGraph.siteName","openGraph.images.*.alt","twitter.title","twitter.description"],yy=["metadataBase","openGraph.type","openGraph.url","openGraph.locale","openGraph.images.*","openGraph.images.*.url","twitter.card","twitter.images.*","alternates.canonical"],xy=["label","description","badge"],Ey=["href","targetType","role","iconKey"],ol={"page-seo":{localizable:Sy,machine:fy},"root-layout-metadata":{localizable:by,machine:yy},"nav-items":{localizable:xy,machine:Ey}},al="*",rl="**",Ry="children";function Iy(e){return typeof e=="number"||/^\d+$/.test(e)?al:e}function cl(e,n){let i=n.map(Iy);return e!=="nav-items"?i:i.filter(s=>s!==al&&s!==Ry)}function ml(e,n){let i=e.split(".");for(let s=0;s<i.length;s+=1){if(i[s]===rl)return!0;if(s>=n.length||i[s]!==n[s])return!1}return i.length===n.length}function Ty(e,n){let i=e.split(".");if(n.length>=i.length)return!1;for(let s=0;s<n.length;s+=1){if(i[s]===rl)return!0;if(i[s]!==n[s])return!1}return!0}function bj(e,n){let i=cl(e,n);return i.length===0?!1:ol[e].localizable.some(s=>ml(s,i))}function yj(e,n){let i=cl(e,n);if(i.length===0)return!0;let{localizable:s,machine:o}=ol[e];return[...s,...o].some(a=>ml(a,i)||Ty(a,i))}var Rj=["product-search","migration-products","standard-form","form-submission-infrastructure"],ky=[{path:"app/search/page.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/entry.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/results.tsx",materializer:"product-search"},{path:"app/api/product-search/facets/route.ts",materializer:"product-search"},{path:"lib/cms/product-search.ts",materializer:"product-search"},{path:"lib/generated/product-search-value-codec.ts",materializer:"product-search"},{path:"lib/generated/product-search-config.json",materializer:"product-search"},{path:`lib/cms/generated/${St}.ts`,materializer:"migration-products"},{path:`components/site/generated/${St}-list.tsx`,materializer:"migration-products"},{path:`components/site/generated/${St}-list-view.tsx`,materializer:"migration-products"},{path:`components/site/generated/${St}-detail-view.tsx`,materializer:"migration-products"},{path:`app/${St}/[slug]/page.tsx`,materializer:"migration-products"},{path:`components/site/generated/${St}-breadcrumb.tsx`,materializer:"migration-products"},{path:"components/site/generated/forms/vcp-form-runtime.tsx",materializer:"standard-form"},{path:"app/api/forms/[code]/route.ts",materializer:"form-submission-infrastructure"},{path:"hooks/use-cms-form-submit.ts",materializer:"form-submission-infrastructure"},{path:"lib/cms/forms.ts",materializer:"form-submission-infrastructure"}],Ay=[{prefix:"components/site/generated/forms/form-",suffix:".tsx",materializer:"standard-form"}],Ij=[{path:"lib/cms/client.ts",reason:"\u4E0D\u662F\u7269\u5316\u4EA7\u7269\uFF1A\u6A21\u677F\u81EA\u5E26\u7684 CMS \u4F20\u8F93\u5C42\uFF0C\u7269\u5316\u5668\u53EA\u5BF9\u5B83\u505A\u5B9A\u70B9\u5B57\u7B26\u4E32\u5347\u7EA7\uFF08\u591A\u90E8\u5206\u8868\u5355\u63D0\u4EA4\u3001no-store \u8BFB\uFF09\uFF0C\u6574\u4EFD\u8986\u5199\u53CD\u800C\u4F1A\u62B9\u6389\u7AD9\u70B9\u4FA7\u7684\u5176\u4ED6\u5347\u7EA7\u3002"},{path:"components/site/generated/forms/form-<id>.spec.ts",reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u8868\u5355\u8BBE\u8BA1\u5668\u5199\u7684\u5B57\u6BB5\u6587\u6848\uFF0C\u5F52 FORM_SPEC_LOCALIZABLE_FIELD_PATHS \u7684\u5B57\u6BB5\u7EA7\u6E05\u5355\u7BA1\u8F96\u3002"}];function wy(e){return e.length>0&&!e.includes("/")&&!e.includes(".")}function Tj(e){return ky.some(n=>n.path===e)?!0:Ay.some(n=>!e.startsWith(n.prefix)||!e.endsWith(n.suffix)?!1:wy(e.slice(n.prefix.length,e.length-n.suffix.length)))}import{z as bt}from"zod";var Py=["provisioning","cms_app_created","seeded","ready","failed"],Pj=bt.object({tenant_id:bt.string().min(1),site_id:k,collection_slug:bt.string().min(1),cms_collection_id:bt.string().min(1).nullable(),status:bt.enum(Py),owned_by_vcp:bt.boolean(),run_id:V.nullable(),last_error:bt.string().nullable(),created_at:bt.string().datetime(),updated_at:bt.string().datetime()});var ll="/vibe/v1";function vy(e){let n=e?.trim().replace(/\/+$/,"");if(!n)return null;try{let i=new URL(n),s=i.pathname.replace(/\/+$/,"");return i.search="",i.hash="",i.pathname=s.endsWith(ll)?s:ll,i.href.replace(/\/+$/,"")}catch{return n}}function Cj(e){let n=vy(e.publicProxyUrl),i=e.cmsSiteId?.trim(),s=e.tenantId?.trim();return n&&i&&s?{cmsProxyUrl:n,cmsProjectId:i,cmsTenantId:s}:null}function Oj(e){let n=e.tenant_id?.trim(),i=e.cms_site_id?.trim();if(!n||!i)throw new Error("CMS_REQUEST_CONTEXT_MISSING");return{Accept:"application/json","X-Tenant-Id":n,"X-Site-Id":i}}import{z as _}from"zod";var is=_.string().url().refine(Xy,{message:"URL must use http or https"}),pl=_.string().trim().pipe(is),Cy=_.object({task_type:_.literal("home_url"),task_url:pl,planned_num:_.number().int().min(1).max(20).optional()}).strict(),Dy=_.object({task_type:_.literal("url_list"),urls:_.array(is).min(1).max(1e4)}).strict(),Mj=_.discriminatedUnion("task_type",[Cy,Dy]),Uj=_.object({page:_.coerce.number().int().positive().default(1),page_size:_.coerce.number().int().min(1).max(20).default(20)}).strict(),Fj=_.object({home_url:pl}).strict(),zt=_.string().uuid(),dn=_.string().uuid(),Gj=_.object({task_uuid:zt}).strict(),dl=_.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]),Oy=_.object({task_uuid:zt,status:_.literal("NOT_STARTED"),total:_.literal(0)}).strict(),Ny=_.object({task_uuid:zt,status:_.literal("PROCESSING"),total:_.literal(0)}).strict(),qj=_.enum(["no_suitable_page_candidate","page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"]),jy=_.discriminatedUnion("status",[_.object({role:Tt,status:_.literal("selected"),reason_code:_.null()}).strict(),_.object({role:Tt,status:_.literal("not_found"),reason_code:_.literal("no_suitable_page_candidate")}).strict(),_.object({role:Tt,status:_.literal("unknown"),reason_code:_.enum(["page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"])}).strict()]),ul=_.array(jy).length(7).superRefine((e,n)=>{let i=new Set(e.map(s=>s.role));i.size!==e.length&&n.addIssue({code:"custom",message:"discovery coverage roles must be unique"});for(let s of Tt.options)i.has(s)||n.addIssue({code:"custom",message:`discovery coverage is missing role ${s}`})}),Ly=_.object({task_uuid:zt,status:_.literal("SUCCEEDED"),total:_.number().int().positive(),discovery_coverage:ul.optional()}).strict(),My=_.enum(["TASK_FAILED","PROVIDER_CAPABILITY_LIMIT","WEBSITE_UNREACHABLE"]),Uy=_.object({task_uuid:zt,status:_.literal("FAILED"),total:_.literal(0),error_code:My,error_message:_.string().min(1),failure_stage:dl}).strict(),Wj=_.discriminatedUnion("status",[Oy,Ny,Ly,Uy]),Fy=_.object({url:is,raw_html:_.string().min(1)}).strict(),Kj=_.object({task_uuid:zt,status:_.literal("SUCCEEDED"),page:_.number().int().positive(),page_size:_.number().int().min(1).max(20),total:_.number().int().positive(),total_pages:_.number().int().positive(),pages:_.array(Fy).max(20),discovery_coverage:ul.optional()}).strict().superRefine((e,n)=>{e.total_pages!==Math.ceil(e.total/e.page_size)&&n.addIssue({code:"custom",path:["total_pages"],message:"total_pages must equal ceil(total / page_size)"}),e.pages.length>e.page_size&&n.addIssue({code:"custom",path:["pages"],message:"pages must not exceed page_size"})}),Bj=_.object({task_code:dn}).strict(),Gy=_.object({task_code:dn,status:_.literal("NOT_STARTED")}).strict(),qy=_.object({task_code:dn,status:_.literal("PROCESSING")}).strict(),Wy=_.object({task_code:dn,status:_.literal("SUCCEEDED"),urls:_.array(is)}).strict(),Ky=_.literal("SITEMAP_DISCOVERY_FAILED"),By=_.object({task_code:dn,status:_.literal("FAILED"),error_code:Ky,error_message:_.string().min(1)}).strict(),zj=_.discriminatedUnion("status",[Gy,qy,Wy,By]),Hj=_.object({company_name:_.string().regex(/\S/u)}).strict(),zy=_.object({company_name:_.string(),brand_name:_.string(),main_products:_.array(_.string()),industry:_.array(_.string()),subfields:_.array(_.string()),business_intro:_.string(),registered_capital:_.string(),legal_representative:_.string(),target_markets:_.array(_.string()),target_customer_industries:_.array(_.string()),target_customer_roles:_.array(_.string()),purchase_scenarios:_.string(),differentiators:_.array(_.string()),competitors:_.array(_.object({name:_.string(),official_url:_.string()}).strict()).max(3),qualifications:_.array(_.string()),representative_cases:_.array(_.string()),acquisition_channels:_.array(_.string()),desired_domain:_.string(),brand_tone:_.string(),timezone:_.string()}).strict(),ss=_.object({company_uuid:_.string().uuid(),company_info:zy,created_at:_.string().datetime(),updated_at:_.string().datetime()}),Hy=ss.extend({status:_.literal("NOT_STARTED"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.null(),completed_at:_.null()}).strict(),Vy=ss.extend({status:_.literal("PROCESSING"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.string().datetime(),completed_at:_.null()}).strict(),_l=ss.extend({status:_.literal("SUCCEEDED"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.string().datetime(),completed_at:_.string().datetime()}).strict(),gl=ss.extend({status:_.literal("FAILED"),last_error_code:_.string().min(1),last_error_message:_.string().min(1),started_at:_.string().datetime(),completed_at:_.string().datetime()}).strict(),Vj=_.discriminatedUnion("status",[_l,gl]),$j=_.discriminatedUnion("status",[Hy,Vy,_l,gl]),$y=["BAD_REQUEST","NOT_FOUND","PAYLOAD_TOO_LARGE","INTERNAL_SERVER_ERROR","UNAUTHORIZED","FORBIDDEN","INVALID_TASK_TYPE","TASK_URL_REQUIRED","INVALID_PLANNED_NUM","URL_LIST_REQUIRED","URL_LIST_LIMIT_EXCEEDED","INVALID_URL_LIST","INVALID_PAGINATION","INVALID_TASK_CODE","INVALID_HOME_URL","TASK_CODE_HOME_URL_CONFLICT","SITEMAP_TASK_NOT_FOUND","SITEMAP_DISCOVERY_FAILED","TASK_NOT_FOUND","PROVIDER_CAPABILITY_LIMIT","TASK_FAILED","WEBSITE_UNREACHABLE"],Yy=_.enum($y),Yj=_.object({error_code:Yy,error_message:_.string().min(1),failure_stage:dl.optional(),task_uuid:zt.optional(),task_code:dn.optional()}).strict();function Xy(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}import{z as W}from"zod";var Ve=W.string().url().refine(Jy,{message:"URL must use http or https"}),hl=W.string().min(1).max(512),os=W.string().datetime({offset:!0}),Sl=W.enum(["scraping","completed","failed","expired"]),Zj=W.object({url:Ve,ignore_cache:W.boolean(),sitemap:W.enum(["include","skip"]),include_subdomains:W.boolean(),ignore_query_parameters:W.boolean(),limit:W.number().int().min(1).max(1e5)}).strict(),Jj=W.object({links:W.array(Ve).max(1e5)}).strict(),eL=W.object({url:Ve,limit:W.number().int().min(1).max(1e5),max_discovery_depth:W.literal(1),crawl_entire_domain:W.literal(!1),allow_subdomains:W.literal(!0),sitemap:W.literal("skip")}).strict(),tL=W.object({crawl_id:hl,expires_at:os.optional()}).strict(),nL=W.object({status:Sl,urls:W.array(Ve).max(1e5),next:Ve.optional(),expires_at:os}).strict(),iL=W.object({url:Ve,formats:W.tuple([W.literal("rawHtml")]),only_main_content:W.literal(!1),max_age:W.number().int().nonnegative()}).strict(),sL=W.object({url:Ve,raw_html:W.string().min(1),status_code:W.number().int().min(100).max(599).nullable()}).strict(),oL=W.object({urls:W.array(Ve).min(1).max(1e4),formats:W.tuple([W.literal("rawHtml")]),ignore_invalid_urls:W.literal(!1),max_age:W.number().int().nonnegative(),max_concurrency:W.number().int().positive().optional()}).strict(),aL=W.object({batch_id:hl,expires_at:os.optional()}).strict(),Qy=W.object({url:Ve,raw_html:W.string().min(1)}).strict(),rL=W.object({status:Sl,total:W.number().int().nonnegative(),completed:W.number().int().nonnegative(),pages:W.array(Qy).max(1e4),next:Ve.optional(),expires_at:os}).strict().superRefine((e,n)=>{e.completed>e.total&&n.addIssue({code:"custom",path:["completed"],message:"completed must not exceed total"})}),Zy=W.object({url:Ve,error_message:W.string().min(1)}).strict(),cL=W.object({errors:W.array(Zy).max(1e4),robots_blocked:W.array(Ve).max(1e4)}).strict(),mL=W.object({active:W.number().int().nonnegative(),waiting:W.number().int().nonnegative(),max_concurrency:W.number().int().positive()}).strict();function Jy(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}var fl=["write_file","edit_file","delete_file"],ex="apply_patch_batch",tx=[...fl,ex];function pL(e){return fl.includes(e)}function dL(e){return tx.includes(e)}import{z as y}from"zod";var bl=y.lazy(()=>un),nx=y.enum(["page","block"]),rs=y.enum(["component","page","pages"]),ix=y.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),Ht=ix,yl=y.object({requested_locale:Ht,resolved_locale:Ht,fallback_used:y.boolean()}).strict(),ni=y.object({id:y.string().uuid(),key:y.string().min(1),name:y.string().min(1)}).strict(),as=ni.extend({color:y.string().nullable()}).strict(),SL=y.object({kind:nx,category_id:y.string().uuid().optional(),tag_id:y.string().uuid().optional(),search:y.string().trim().min(1).max(200).optional(),limit:y.coerce.number().int().min(1).max(50).default(20),cursor:y.string().min(1).optional()}).strict(),sx=y.object({stable_key:y.string().min(1),type:rs,title:y.string().min(1).max(200),description:y.string().max(1e3),thumbnail_url:y.string().url().nullable(),resolved_version:y.number().int().positive(),content_schema_version:y.literal(3),category:ni.nullable(),tags:y.array(as),page_count:y.number().int().nonnegative(),component_count:y.number().int().nonnegative(),locale:yl}).strict(),fL=y.object({items:y.array(sx),facets:y.object({categories:y.array(ni),tags:y.array(as)}).strict(),next_cursor:y.string().nullable()}).strict(),bL=y.object({operation_id:y.string().uuidv7(),resolved_version:y.number().int().positive(),base_sitemap_id:y.string().uuid(),base_sitemap_version:y.number().int().positive(),sitemap:bl,target_page_id:y.string().min(1).optional()}).strict(),yL=y.object({next_sitemap:bl,applied:y.object({stable_key:y.string().min(1),resolved_version:y.number().int().positive(),template_type:rs,page_ids:y.array(y.string().min(1)),block_ids:y.array(y.string().min(1))}).strict(),locale:yl,warnings:y.array(y.string())}).strict(),xl=y.object({nodeId:y.string().uuid(),type:y.string().trim().min(1).max(100),label:y.string().trim().min(1).max(200),variant:y.string().trim().min(1).max(100).optional(),order:y.number().int().nonnegative(),props:y.record(y.string(),y.unknown()),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict(),El=y.object({nodeId:y.string().uuid().optional(),slug:y.string().regex(/^\/$|^\/[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/u),navigation:y.object({showInHeader:y.boolean(),showInFooter:y.boolean(),order:y.number().int().nonnegative()}).strict(),components:y.array(xl).min(1).max(100),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict(),ox=El.extend({nodeId:y.uuidv7(),parentNodeId:y.uuidv7().optional()}).strict(),ax=y.object({pages:y.array(ox).min(1).max(50),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict().superRefine(({pages:e},n)=>{let i=new Map(e.map(o=>[o.nodeId,o])),s=e.flatMap(o=>[o.nodeId,...o.components.map(a=>a.nodeId)]);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["pages"],message:"Node ids must be unique within the shared structure."}),new Set(e.map(o=>o.slug)).size!==e.length&&n.addIssue({code:"custom",path:["pages"],message:"Page slugs must be unique."});for(let[o,a]of e.entries()){if(a.parentNodeId===void 0)continue;let c=g=>n.addIssue({code:"custom",path:["pages",o,"parentNodeId"],message:g}),r=i.get(a.parentNodeId);r||c("Parent must reference a page in this template."),a.parentNodeId===a.nodeId&&c("A page cannot be its own parent."),(a.slug==="/"||r?.slug==="/")&&c("The home page cannot be a parent or child."),r?.parentNodeId!==void 0&&c("Pages allow at most two levels; the parent must be a root page.");let m=new Set([a.nodeId]),S=a.parentNodeId;for(;S!==void 0;){if(m.has(S)){c("Page parent references must not contain a cycle.");break}m.add(S),S=i.get(S)?.parentNodeId}}}),rx=y.union([xl,El,ax]),cx=y.object({title:y.string().min(1).max(200),description:y.string().min(1).max(1e3),prompt:y.string().min(1).max(8192)}).strict(),mx=y.object({locale:Ht,title:y.string().min(1).max(200),content:y.object({description:y.string().min(1).max(1e3),prompt:y.string().min(1).max(8192),nodes:y.record(y.string().uuid(),cx)}).strict()}).strict(),xL=y.object({templateId:y.string().uuid(),stableKey:y.string().min(1),type:rs,resolvedVersion:y.number().int().positive(),contentSchemaVersion:y.literal(3),structure:rx,requestedLocale:Ht,resolvedLocale:Ht,fallbackUsed:y.boolean(),contents:y.array(mx).length(1)}).strict().superRefine((e,n)=>{(e.type==="component"&&!("type"in e.structure)||e.type==="page"&&!("components"in e.structure)||e.type==="pages"&&!("pages"in e.structure))&&n.addIssue({code:"custom",path:["structure"],message:"Template type and structure must match."});let i=lx(e.structure),s=new Set(Object.keys(e.contents[0]?.content.nodes??{}));(i.size!==s.size||[...i].some(o=>!s.has(o)))&&n.addIssue({code:"custom",path:["contents",0,"content","nodes"],message:"Localized nodes must exactly match the structure nodes."}),e.contents[0]?.locale!==e.resolvedLocale&&n.addIssue({code:"custom",path:["contents"],message:"Resolved locale must match returned content."}),e.fallbackUsed!==(e.requestedLocale!==e.resolvedLocale)&&n.addIssue({code:"custom",path:["fallbackUsed"],message:"fallbackUsed must match locale resolution."})}),EL=y.object({items:y.array(y.object({stableKey:y.string().min(1),type:rs,title:y.string().min(1).max(200),description:y.string().max(1e3),thumbnailUrl:y.string().url().nullable(),resolvedVersion:y.number().int().positive(),contentSchemaVersion:y.literal(3),category:ni.nullable(),tags:y.array(as),pageCount:y.number().int().nonnegative(),componentCount:y.number().int().nonnegative(),requestedLocale:Ht,resolvedLocale:Ht,fallbackUsed:y.boolean()}).strict()),facets:y.object({categories:y.array(ni),tags:y.array(as)}).strict(),nextCursor:y.string().nullable()}).strict().superRefine((e,n)=>{e.items.forEach((i,s)=>{i.fallbackUsed!==(i.requestedLocale!==i.resolvedLocale)&&n.addIssue({code:"custom",path:["items",s,"fallbackUsed"],message:"fallbackUsed must match locale resolution."})})});function lx(e){if("type"in e)return new Set([e.nodeId]);let n="pages"in e?e.pages:[e];return new Set(n.flatMap(i=>[...i.nodeId?[i.nodeId]:[],...i.components.map(s=>s.nodeId)]))}function RL(e){return ia({tenant_id:e.tenant_id,site_id:e.site_id,stable_key:e.stable_key,resolved_version:e.request.resolved_version,base_sitemap_id:e.request.base_sitemap_id,base_sitemap_version:e.request.base_sitemap_version,sitemap:e.request.sitemap,target_page_id:e.request.target_page_id??null})}import{z}from"zod";var px=["pending_dns","active","failed","removing"],dx=z.enum(px),ux=["serve_site","redirect_301"],_x=z.enum(ux),gx=["traffic","ownership","certificate_delegation"],sa=z.enum(gx),hx=["pending","verified"],Sx=z.enum(hx),fx=["not_applicable","unavailable","not_needed","auto_applied","confirmation_required","blocked"],bx=z.enum(fx),oa=z.enum(["prepare_configuration","apply_configuration","verify_dns","remediate_dns","confirm_dns_remediation"]),yx=z.enum(["accepted","running","succeeded","failed"]),xx=z.object({code:z.string().min(1),message:z.string().min(1)}).strict(),Ex=z.object({purpose:sa,verified:z.boolean(),observedValues:z.array(z.string())}).strict(),Rl=z.object({ready:z.boolean(),providerReady:z.boolean(),dnsVerified:z.boolean(),records:z.array(Ex)}).strict(),Il=z.object({type:z.string().min(1),name:z.string().min(1),value:z.string().min(1),ttl:z.number().nullable()}).strict(),Rx=z.object({purpose:sa,action:z.enum(["none","create","update","blocked"]),before:Il.nullable(),after:Il.nullable()}).strict(),Tl=z.object({domainId:z.string().min(1),status:bx,changes:z.array(Rx)}).strict(),Ix=z.object({purpose:sa,type:z.string().min(1),name:z.string().min(1),value:z.string().min(1),verificationStatus:Sx}).strict(),kl=z.object({id:z.string().min(1),hostname:z.string().min(1),isPrimary:z.boolean(),routingMode:_x,observedStatus:dx,lastVerifiedAt:z.string().datetime().nullable(),dnsRecords:z.array(Ix)}).strict().superRefine((e,n)=>{Tx(e.hostname)||n.addIssue({code:"custom",path:["hostname"],message:"hostname must be a canonical ASCII hostname"}),e.isPrimary&&e.routingMode!=="serve_site"&&n.addIssue({code:"custom",path:["routingMode"],message:"a primary domain must serve the site"}),!e.isPrimary&&e.routingMode!=="redirect_301"&&n.addIssue({code:"custom",path:["routingMode"],message:"a non-primary domain must redirect with 301"})}),Al=z.object({primaryDomain:kl.nullable(),redirectDomains:z.array(kl)}).strict().superRefine((e,n)=>{e.primaryDomain!==null&&(!e.primaryDomain.isPrimary||e.primaryDomain.routingMode!=="serve_site")&&n.addIssue({code:"custom",path:["primaryDomain"],message:"primaryDomain must be primary and serve the site"});for(let[s,o]of e.redirectDomains.entries())(o.isPrimary||o.routingMode!=="redirect_301")&&n.addIssue({code:"custom",path:["redirectDomains",s],message:"redirectDomains must be non-primary 301 redirects"});e.primaryDomain!==null&&e.redirectDomains.some(o=>o.hostname===e.primaryDomain?.hostname)&&n.addIssue({code:"custom",path:["redirectDomains"],message:"primaryDomain must not also be a redirect"});let i=[...e.primaryDomain===null?[]:[e.primaryDomain.hostname],...e.redirectDomains.map(s=>s.hostname)];new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["redirectDomains"],message:"domain hostnames must be unique"})}),cs=z.object({id:z.string().min(1),type:oa,status:yx,error:xx.nullable(),result:z.union([Rl,Tl]).nullable().optional()}).strict().superRefine((e,n)=>{if(e.status==="failed"&&e.error===null&&n.addIssue({code:"custom",path:["error"],message:"failed operations must include a stable error"}),e.status!=="failed"&&e.error!==null&&n.addIssue({code:"custom",path:["error"],message:"non-failed operations must not include an error"}),!(e.result===void 0||e.result===null)){if(e.status!=="succeeded"){n.addIssue({code:"custom",path:["result"],message:"operation results only belong to succeeded operations"});return}if(e.type==="verify_dns"){Rl.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"verify_dns operations require a DNS verification result"});return}if(e.type==="remediate_dns"){Tl.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"remediate_dns operations require a DNS remediation result"});return}n.addIssue({code:"custom",path:["result"],message:"only verify_dns and remediate_dns operations may carry a result"})}});function Tx(e){if(e!==e.trim()||e!==e.toLowerCase()||e.length>253||e.endsWith("."))return!1;let n=e.split(".");return n.length>=2&&n[n.length-1].length>=2&&n.every(i=>i.length>=1&&i.length<=63&&/^[a-z0-9-]+$/.test(i)&&!i.startsWith("-")&&!i.endsWith("-"))}import{z as je}from"zod";import{z as x}from"zod";var kx=x.enum(["active","completed","canceled"]),Ax=x.enum(["quality","domain","gsc","publish"]),ms=x.enum(["pending","running","succeeded","failed"]),Pl=ms,vl=x.enum(["pending","running","completed"]),wx=x.object({group_code:x.string().min(1),name:x.string().min(1),score:x.number().nonnegative(),total_score:x.number().nonnegative(),pass_score:x.number().nonnegative(),running_status:vl,result_text:x.string()}).strict(),Px=x.object({id:x.number().int().positive().optional(),quality_task_id:x.number().int().positive(),item_code:x.string().min(1),status:ms,is_repaired:x.boolean(),total_score:x.number().nonnegative(),score:x.number().nonnegative(),check_result:x.unknown().nullable(),remediation_items:x.unknown().nullable(),result_text:x.string(),created_at:x.string().min(1),updated_at:x.string().min(1),item_name:x.string().min(1),dimension_code:x.enum(["reach","trust","convert","safe"]),group_code:x.string().min(1),auto_fix:x.boolean()}).strict(),vx=x.object({dimension_code:x.enum(["reach","trust","convert","safe"]),name:x.string().min(1),alias_en:x.string().min(1),description:x.string(),tips:x.string(),score:x.number().nonnegative(),repaired_score:x.number().nonnegative(),total_score:x.number().nonnegative(),pass_score:x.number().nonnegative(),running_status:vl,problem_group_count:x.number().int().nonnegative(),remediation_items:x.array(Px),groups:x.array(wx)}).strict(),Cx=x.object({id:x.number().int().positive(),task_code:x.string().uuid(),scene_code:x.enum(["site_publish","vcp_published_pages","content_publish"]),tenant_id:x.string().min(1),vcp_site_id:k,cms_site_id:x.string().min(1),checked_url:x.string().url(),quality_params:x.record(x.string(),x.unknown()).nullable(),status:ms,error_info:x.record(x.string(),x.unknown()).nullable(),created_at:x.string().min(1),updated_at:x.string().min(1)}).strict(),Dx=x.union([x.object({}).strict(),x.object({summary:x.object({final_score:x.number().nonnegative(),pass_score:x.number().nonnegative(),group_count:x.number().int().nonnegative(),problem_group_count:x.number().int().nonnegative()}).strict(),dimensions:x.array(vx)}).strict()]),wl=x.object({quality_info:Cx,quality_detail:Dx}).strict().superRefine((e,n)=>{let i="summary"in e.quality_detail;e.quality_info.status!=="failed"&&!i&&n.addIssue({code:"custom",message:"nonfailed quality tasks require complete detail",path:["quality_detail"]}),e.quality_info.status==="failed"&&i&&n.addIssue({code:"custom",message:"failed quality tasks require empty detail",path:["quality_detail"]})}),DL=x.object({item_code:x.string().min(1),remediation_items:x.unknown().nullable()}).strict(),Ox=x.object({item_code:x.string().min(1),repair_status:x.enum(["succeeded","failed"]),message:x.string().min(1).optional(),error_code:x.string().min(1).optional(),metadata:x.record(x.string(),x.unknown()).optional()}).strict(),Cl=x.object({items:x.array(Ox)}).strict(),OL=x.object({task_code:x.string().min(1),status:Pl,result:Cl.optional()}).strict().superRefine((e,n)=>{e.status==="succeeded"&&e.result===void 0&&n.addIssue({code:"custom",path:["result"],message:"succeeded repair tasks require a complete result"}),(e.status==="pending"||e.status==="running")&&e.result!==void 0&&n.addIssue({code:"custom",path:["result"],message:"nonterminal repair tasks cannot expose a result"})}),Dt=x.object({id:ri,tenant_id:x.string().min(1),site_id:k,status:kx,current_step:Ax,quality_task_code:x.string().uuid().nullable(),quality_task_status:ms,repair_task_code:x.string().min(1).nullable(),repair_task_status:Pl,publish_deployment_id:ct.nullable(),domain_hostname:x.string().min(1).nullable(),domain_operation_type:oa.nullable(),domain_operation_payload:x.record(x.string(),x.unknown()).nullable(),domain_preparation_operation_id:x.string().min(1).nullable(),domain_operation_id:x.string().min(1).nullable(),revision:x.number().int().positive(),created_at:x.string().min(1),updated_at:x.string().min(1),completed_at:x.string().min(1).nullable(),canceled_at:x.string().min(1).nullable()}).strict().superRefine((e,n)=>{if(e.domain_operation_type===null){e.domain_operation_payload!==null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"domain_operation_payload must be null without an active domain operation"}),e.domain_operation_id!==null&&n.addIssue({code:"custom",path:["domain_operation_id"],message:"domain_operation_id must be null without an active domain operation"});return}e.domain_hostname===null&&n.addIssue({code:"custom",path:["domain_hostname"],message:"an active domain operation requires a hostname"}),e.domain_operation_payload===null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"an active domain operation requires a payload"})}),NL=x.object({}).strict(),jL=x.object({expected_revision:x.number().int().nonnegative(),current_step:x.enum(["domain","gsc","publish"]),skip_domain_binding:x.boolean().optional()}).strict(),LL=x.object({expected_revision:x.number().int().nonnegative()}).strict(),Nx=x.object({workflow:Dt.nullable(),can_cancel:x.boolean()}).strict(),ML=L(Nx).strict(),jx=x.object({workflow:Dt,can_cancel:x.boolean()}).strict(),UL=L(jx).strict(),Lx=x.object({workflow:Dt,deployment:x.lazy(()=>Ot)}).strict(),FL=L(Lx).strict(),Mx=x.object({workflow:Dt,can_cancel:x.boolean(),quality_result:wl.optional(),repair_result:Cl.optional(),final_quality_result:wl.optional(),message:x.string().min(1).optional()}).strict(),GL=L(Mx).strict();function Ux(e){return"summary"in e.quality_detail?e.quality_detail.dimensions.flatMap(n=>n.remediation_items.filter(i=>i.status==="succeeded"&&i.score<i.total_score&&i.auto_fix).map(i=>({item_code:i.item_code,remediation_items:i.remediation_items}))):[]}function Fx(e,n){let i=e.map(a=>a.item_code),s=n.items.map(a=>a.item_code);if(new Set(i).size!==i.length||new Set(s).size!==s.length||i.length!==s.length)return!1;let o=new Set(i);return n.items.every(a=>o.has(a.item_code)&&a.repair_status==="succeeded")}function qL(e,n){if(!("summary"in e.quality_detail))return null;let i=Ux(e);if(i.length===0)return e;if(n===void 0||!Fx(i,n))return null;let s=new Set(n.items.map(a=>a.item_code)),o=e.quality_detail.dimensions.map(a=>{let c=a.remediation_items.map(S=>s.has(S.item_code)?{...S,score:S.total_score,is_repaired:!0,result_text:""}:{...S}),r=a.groups.map(S=>{let g=c.filter(w=>w.group_code===S.group_code);return g.length===0?{...S}:{...S,score:g.reduce((w,K)=>w+K.score,0),result_text:g.map(w=>w.result_text).filter(Boolean).join("\u3001")}}),m=r.reduce((S,g)=>S+g.score,0);return{...a,score:m,repaired_score:m,problem_group_count:r.filter(S=>S.score!==S.total_score).length,remediation_items:c,groups:r}});return{quality_info:{...e.quality_info},quality_detail:{...e.quality_detail,summary:{...e.quality_detail.summary,final_score:Math.round(o.reduce((a,c)=>a+c.score,0)/o.length),problem_group_count:o.reduce((a,c)=>a+c.problem_group_count,0)},dimensions:o}}}var Gx=je.object({hostname:je.string().min(1),expected_revision:je.number().int().nonnegative()}).strict(),Dl=je.object({workflow:Dt,operation:cs}).strict(),qx=L(Dl).strict(),Wx=je.object({expected_revision:je.number().int().nonnegative()}).strict(),Kx=je.object({workflow:Dt,operation:cs}).strict(),Bx=L(Kx).strict(),aa=je.object({workflow:Dt,operation:cs.nullable()}).strict(),zx=L(aa).strict(),Hx=aa,Vx=L(Hx).strict(),VL=L(Al).strict(),$x=je.object({published:je.boolean(),hostname:je.string(),url:je.string(),sandbox_url:je.union([je.string().url(),je.literal("")])}).strict().superRefine((e,n)=>{e.published||(e.hostname!==""&&n.addIssue({code:"custom",path:["hostname"],message:"unpublished sites must not include a hostname"}),e.url!==""&&n.addIssue({code:"custom",path:["url"],message:"unpublished sites must not include a URL"}))}),$L=L($x).strict(),YL=Gx,XL=Dl,QL=qx,ZL=aa,JL=zx,eM=Vx,tM=Wx,nM=Bx;import{z as We}from"zod";var Yx=["started","success","failed","canceled"],ra=We.enum(Yx),Xx=["inactive","pending_binding","active"],ca=We.enum(Xx),Qx=["domain","url_prefix"],ma=We.enum(Qx),Zx=["not_connected","authorizing","matching_property","ready","failed","canceled","domain_mismatch"],la=We.enum(Zx),rt=We.string().nullable(),Ol=We.object({}).strict(),pa=We.object({authorize_url:We.string().url(),custom_domain:rt}).strict(),Nl=L(pa),Jx=We.object({auth_status:ra,binding_status:ca,credential_connected:We.boolean(),custom_domain:rt,gsc_site_url:rt,property_type:ma.nullable(),auth_error_code:rt,auth_error_message:rt}).strict(),jl=We.object({auth_status:ra,binding_status:ca,credential_connected:We.boolean(),custom_domain:rt,gsc_site_url:rt,property_type:ma.nullable(),auth_error_code:rt,auth_error_message:rt,current_domain:rt,state:la,ready:We.boolean()}).strict().superRefine((e,n)=>{let i=tE(e,e.current_domain),s=i==="ready";e.state!==i&&n.addIssue({code:"custom",path:["state"],message:`state must equal ${i} for the supplied GSC facts`}),e.ready!==s&&n.addIssue({code:"custom",path:["ready"],message:`ready must equal ${String(s)} for the supplied GSC facts`})}),eE=L(jl);function ii(e){let n=e?.trim()??"";if(!n)return"";let i=/^[a-z][a-z0-9+.-]*:\/\//i.test(n)?n:`https://${n}`;try{return new URL(i).hostname.replace(/\.+$/,"").toLowerCase()}catch{return n.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0].replace(/\.+$/,"").toLowerCase()}}function tE(e,n){let i=e.gsc_site_url?.trim()??"",s=ii(e.custom_domain),o=ii(n??("current_domain"in e?e.current_domain:void 0)),a=s.length>0&&o.length>0&&s===o,c=nE(i,e.property_type,o);return e.auth_status==="canceled"?"canceled":e.auth_status==="failed"?"failed":e.auth_status==="started"?"authorizing":!e.credential_connected||e.binding_status==="inactive"?"not_connected":i.length===0||e.property_type===null?"matching_property":!a||!c?"domain_mismatch":e.binding_status==="pending_binding"?"matching_property":e.auth_status==="success"&&e.binding_status==="active"&&e.credential_connected&&i.length>0&&a&&c?"ready":"failed"}function nE(e,n,i){let s=e?.trim()??"",o=ii(i);if(!s||!o||!n)return!1;if(n==="domain"){let a=/^sc-domain:(.+)$/i.exec(s);if(!a)return!1;let c=a[1].trim();if(!c||/[/:?#]/.test(c))return!1;let r=ii(c);return r?o===r||o.endsWith(`.${r}`):!1}try{let a=new URL(s);return a.protocol!=="https:"||a.username||a.password||a.port||a.pathname!=="/"||a.search||a.hash?!1:ii(a.hostname)===o}catch{return!1}}var aM=Ol,rM=pa,cM=Nl,mM=la,lM=ra,pM=ca,dM=ma,uM=la,_M=Ol,gM=pa,hM=Nl,SM=Jx,fM=jl,bM=eE;import{z as D}from"zod";var Ke=D.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),Je=D.string().min(1).max(4096),_n=D.string().regex(/^[A-Za-z0-9_-]{43}$/),gn=D.string().max(300),da=D.string().datetime({offset:!0}).nullable(),Ll=D.string().regex(/^[A-Z][A-Z0-9_]*$/).max(100).nullable(),iE=["authorized","pending","failed","revoked","expired","not_authorized"],sE=D.enum(iE),oE=["pending","succeeded","failed","canceled","expired","superseded"],aE=D.enum(oE),rE=["unconfigured","configured","needs_reconfiguration","unverified"],cE=D.enum(rE),mE=["not_checked","valid","invalid","unavailable"],lE=D.enum(mE),pE=["authorization_pending","authorization_required","authorization_changed","resource_unavailable","resource_changed","verification_required","verification_unavailable"],dE=D.enum(pE),Ml=D.object({revision:Ke,status:aE,started_at:D.string().datetime({offset:!0}),expires_at:D.string().datetime({offset:!0}),finished_at:da,error_code:Ll}).strict(),RM=D.object({expected_authorization_revision:Ke,expected_attempt_revision:Ke,select_account:D.boolean().default(!1),replace_pending:D.boolean().default(!1)}).strict(),uE=D.object({authorize_url:D.string().url(),authorization_revision:Ke,attempt:Ml}).strict(),IM=L(uE),_E=D.object({status:sE,authorization_revision:Ke,account_email:D.string().max(320).nullable(),latest_attempt:Ml.nullable()}).strict(),gE=D.object({account_ref:Je,account_key:_n,account_display_name:gn,property_ref:Je,property_key:_n,property_display_name:gn,data_stream_ref:Je,data_stream_key:_n,data_stream_display_name:gn,measurement_id_display:D.string().min(1).max(40),default_uri:D.string().url().nullable(),selected_authorization_revision:Ke,configured_at:D.string().datetime({offset:!0}),updated_at:D.string().datetime({offset:!0})}).strict(),hE=D.object({status:lE,checked_at:da,expires_at:da,error_code:Ll}).strict(),SE=D.enum(["oauth","verification"]),fE=D.object({measurement_id_display:D.string().min(1).max(40),stream_display_name:D.string().max(100).nullable()}).strict(),bE=D.object({status:D.enum(["pending","applied"]),applied_revision:Ke}).strict(),Ul=D.object({capability_enabled:D.boolean(),revision:Ke,authorization:_E,binding_status:cE,reason:dE.nullable(),ready:D.boolean(),mode:SE.nullable(),binding:gE.nullable(),verification:hE,tracking:fE.nullable(),deployment:bE}).strict().superRefine((e,n)=>{if(!e.capability_enabled){(e.ready||e.revision!==0||e.authorization.status!=="not_authorized"||e.authorization.authorization_revision!==0||e.authorization.account_email!==null||e.authorization.latest_attempt!==null||e.binding_status!=="unconfigured"||e.reason!==null||e.mode!==null||e.binding!==null||e.tracking!==null||e.deployment.status!=="applied"||e.deployment.applied_revision!==0||e.verification.status!=="not_checked"||e.verification.checked_at!==null||e.verification.expires_at!==null||e.verification.error_code!==null)&&n.addIssue({code:D.ZodIssueCode.custom,message:"disabled GA4 capability must expose an empty state"});return}e.ready&&(e.authorization.status!=="authorized"||e.binding_status!=="configured"||e.mode!=="oauth"||e.binding===null||e.tracking===null||e.verification.status!=="valid"||e.reason!==null)&&n.addIssue({code:D.ZodIssueCode.custom,message:"ready GA4 status must be authorized, configured, and valid"})}),TM=L(Ul),kM=D.object({refresh:D.union([D.boolean(),D.enum(["true","false"]).transform(e=>e==="true")]).default(!1)}).strict(),yE=D.object({property_ref:Je,property_key:_n,display_name:gn}).strict(),xE=D.object({account_ref:Je,account_key:_n,display_name:gn,properties:D.array(yE)}).strict(),EE=D.object({accounts:D.array(xE),returned_count:D.number().int().nonnegative(),completeness:D.literal("unknown"),authorization_revision:Ke}).strict(),AM=L(EE),wM=D.object({authorization_revision:D.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),RE=D.object({data_stream_ref:Je,data_stream_key:_n,display_name:gn,measurement_id_display:D.string().min(1).max(40),default_uri:D.string().url().nullable(),selectable:D.boolean(),unavailable_reason:D.string().max(100).nullable()}).strict(),IE=D.object({property_ref:Je,streams:D.array(RE),returned_count:D.number().int().nonnegative(),completeness:D.literal("unknown"),authorization_revision:Ke}).strict(),PM=L(IE),vM=D.object({property_ref:Je,authorization_revision:D.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),CM=D.object({expected_revision:Ke,authorization_revision:Ke,account_ref:Je,property_ref:Je,data_stream_ref:Je,confirm_url_mismatch:D.boolean()}).strict(),TE=D.object({applied_revision:Ke,idempotency_replayed:D.boolean()}).strict(),kE=Ul.and(D.object({mutation:TE}).strict()),DM=L(kE);var Fl=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,Gl="VCP_E2B_PREVIEW_PROXY_DOMAIN must be a valid hostname.";function AE(e){let n=e?.trim().toLowerCase()??"";if(!n)return null;if(n.length>253||!n.includes(".")||!n.split(".").every(i=>Fl.test(i)))throw new Error(Gl);return n}function NM(e){let n=AE(e.proxyDomain);if(!n)return null;let i=e.sandboxId.trim();if(!Fl.test(i))throw new Error("sandboxId must be a valid DNS label.");if(`${i}.${n}`.length>253)throw new Error(Gl);return`https://${i}.${n}/`}function LM(e){for(let n of e.targets)if(!(n.kind==="shared"?e.ledger.shared.some(s=>s.kind==="shared"&&s.target_id===n.target_id&&s.filled!==!0):e.ledger.pages.some(s=>s.omissions.some(o=>o.kind===n.kind&&o.target_id===n.target_id&&o.filled!==!0))))return{ok:!1,target_id:n.target_id};return{ok:!0}}function wE(e,n,i=e){let s=new Map(e.map(r=>[r.slug,r])),o=new Map(i.map(r=>[r.id,r])),a=new Map(e.map(r=>{let m=o.get(r.id);return m&&m.slug!==null&&m.slug!==r.slug?[m.slug,r]:null}).filter(r=>r!==null)),c=new Set(i.map(r=>r.slug).filter(r=>r!==null&&!s.has(r)));return{primaryLinks:ql(n.primaryLinks,e,s,a,c,o,"showInHeader"),footerLinks:ql(n.footerLinks,e,s,a,c,o,"showInFooter")}}function ql(e,n,i,s,o,a,c){let r=new Set,m=[];for(let[K,H]of e.entries()){let ie=PE(H.href),he=ie===null?void 0:i.get(ie)??s.get(ie);if(ie!==null&&o.has(ie)&&!i.has(ie)&&!s.has(ie))continue;if(he?.slug==="/"){m.push({kind:"independent",link:{...H,label:Wl(H,he,a)}});continue}if(!he){m.push({kind:"independent",link:H});continue}if(!he.navigation[c])continue;r.add(he.slug);let xn=ie===he.slug?H.href:vE(H.href,he.slug);m.push({kind:"page",page:he,link:{...H,label:Wl(H,he,a),href:xn},index:K})}let S=m.filter(K=>K.kind==="page").sort((K,H)=>K.page.navigation.order-H.page.navigation.order||K.index-H.index),g=0,w=m.map(K=>K.kind==="page"?S[g++].link:K.link);for(let K of[...n].filter(H=>H.slug!=="/"&&H.navigation[c]).sort((H,ie)=>H.navigation.order-ie.navigation.order))r.has(K.slug)||w.push({label:K.title,href:K.slug});return w}function Wl(e,n,i){let s=i.get(n.id);return e.label===(s?.title??n.title)?n.title:e.label}function PE(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/u);return n===-1?e:e.slice(0,n)}function vE(e,n){let i=e.search(/[?#]/u);return i===-1?n:`${n}${e.slice(i)}`}function ls(e){return e.trim().normalize("NFKC").toLowerCase()}function CE(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u9996\u9875":n?.startsWith("ja")?"\u30DB\u30FC\u30E0":n?.startsWith("ko")?"\uD648":"Home"}function DE(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u66F4\u591A":n?.startsWith("ja")?"\u305D\u306E\u4ED6":n?.startsWith("ko")?"\uB354\uBCF4\uAE30":n?.startsWith("fr")?"Plus":n?.startsWith("de")?"Mehr":n?.startsWith("es")?"M\xE1s":"More"}function OE(e){return e.map(n=>n.navigation.showInHeader===!0?n:{...n,navigation:{...n.navigation,showInHeader:!0}})}function si(e){return e.parent_page_id??null}function ps(e,n){let i=si(e);return i===null?!0:!n.some(s=>s.id===i)}function Kl(e,n){return e.filter(i=>si(i)===n&&i.id!==n)}function Bl(e){let n=e.filter(c=>ps(c,e)),i=n.filter(c=>c.slug==="/"),s=n.filter(c=>c.slug!=="/"),o=[],a=new Set;for(let c of[...i,...s])if(!a.has(c.id)){o.push(c),a.add(c.id);for(let r of Kl(e,c.id))a.has(r.id)||(o.push(r),a.add(r.id))}for(let c of e)a.has(c.id)||(o.push(c),a.add(c.id));return o}function NE(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/);return n===-1?e:e.slice(0,n)}function jE(e,n){let i=Bl(n),s=new Map;i.forEach((c,r)=>{c.slug!==null&&!s.has(c.slug)&&s.set(c.slug,r)});let o=[],a=[];for(let c of e){let r=NE(c.href),m=r===null?void 0:s.get(r);m===void 0?a.push(c):o.push({link:c,rank:m})}return o.sort((c,r)=>c.rank-r.rank),[...o.map(c=>c.link),...a]}function LE(e){let n=e.filter(i=>ps(i,e)).length;return{top_level_pages:n,sub_pages:e.length-n,total_pages:e.length,content_items:e.reduce((i,s)=>i+s.blocks.length,0)}}function ME(e,n={}){let i=[],s=new Map(e.map(c=>[c.id,c])),o=e.filter(c=>c.slug==="/");o.length!==1?i.push({code:"missing_home",page_id:null,message:"The structure must contain exactly one home page."}):n.expectedHomeTitle&&ls(o[0].title)!==ls(n.expectedHomeTitle)&&i.push({code:"home_renamed",page_id:o[0].id,message:`The home page must keep its fixed name '${n.expectedHomeTitle}'.`});for(let c of e){c.title.trim().length===0&&i.push({code:"empty_title",page_id:c.id,message:"Page name is empty."}),c.slug&&n.reservedSlugs?.includes(c.slug)&&i.push({code:"reserved_slug",page_id:c.id,message:`Slug '${c.slug}' is reserved by the site's applications.`});let r=si(c);if(r===null)continue;if(c.slug==="/"){i.push({code:"home_has_parent",page_id:c.id,message:"The home page cannot have a parent."});continue}if(r===c.id){i.push({code:"self_parent",page_id:c.id,message:"A page cannot be its own parent."});continue}let m=s.get(r);if(!m){i.push({code:"parent_not_found",page_id:c.id,message:`Parent page '${r}' does not exist.`});continue}if(m.slug==="/"){i.push({code:"home_has_children",page_id:c.id,message:"The home page cannot have sub pages."});continue}si(m)!==null&&i.push({code:"depth_exceeded",page_id:c.id,message:"At most two levels are allowed."})}let a=new Map;for(let c of e){let r=ps(c,e)?"__top__":si(c),m=ls(c.title);if(m.length===0)continue;let S=a.get(r)??new Map,g=S.get(m);g!==void 0&&g!==c.id?i.push({code:"duplicate_sibling_title",page_id:c.id,message:`Page name '${c.title}' is already used at the same level.`}):S.set(m,c.id),a.set(r,S)}return i}var UE=16,FE=/[ᄀ-ᅟ⺀-〾ぁ-㏿㐀-䶿一-鿿ꀀ-가-힣豈-︰--⦆¢-₩]/u;function GE(e){let n=0;for(let i of e)n+=FE.test(i)?2:1;return n}function qE(e){let n=e.normalize("NFKC").trim().replace(/\s+/g," ").toLowerCase();return n.length>3&&n.endsWith("s")?n.slice(0,-1):n}import{z as E}from"zod";var zl=20*1024*1024,WE=zl,Hl=["jpg","jpeg","png","gif","webp","bmp"],Vl=["mp4","avi","mov","webm","mkv"],$l=["mp3","wav","aac","flac","ogg","wma","m4a"],Yl=["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","md","csv"],Xl=[...Yl,"zip","rar","json","xmind","psd","ai","fig","sketch"],KE=[...Hl,...Vl,...$l,...Xl],Ql=["image/jpeg","image/png","image/gif","image/webp","image/bmp"],Zl=["video/mp4","video/x-msvideo","video/quicktime","video/webm","video/x-matroska"],Jl=["audio/mpeg","audio/wav","audio/x-wav","audio/vnd.wave","audio/aac","audio/flac","audio/x-flac","audio/ogg","audio/x-ms-wma","audio/mp4","audio/x-m4a"],BE=[...Ql,...Zl,...Jl],ep=E.enum(["image","video","audio","file"]),tp=E.enum(["external","ai_generated","unsplash"]),ua=E.object({resource_id:E.string().min(1),name:E.string().min(1).max(255),url:E.string().url(),thumbnail_url:E.union([E.string().url(),E.literal("")]),mime_type:E.string().trim().min(3).max(127),size:E.number().int().nonnegative(),width:E.number().int().positive().nullable(),height:E.number().int().positive().nullable(),source:tp,created_at:E.string().min(1).nullable()}),zE=E.object({page:E.coerce.number().int().min(1).default(1),page_size:E.coerce.number().int().min(1).max(100).default(24),keyword:E.string().trim().max(100).optional(),file_type:ep.default("image")}),HE=E.object({code:E.literal(0),message:E.string(),data:E.object({items:E.array(ua),page:E.number().int().min(1),page_size:E.number().int().min(1),total:E.number().int().nonnegative()})}),VE=E.object({code:E.literal(0),message:E.string(),data:ua}),hn=4,$E="site.image_generation.max",YE=E.object({quantity:E.number().int().min(1).max(hn)}),_a=E.object({available:E.boolean(),remaining:E.number().nonnegative().nullable(),unlimited:E.boolean(),max_quantity:E.number().int().min(0).max(hn)}),XE=E.object({code:E.literal(0),message:E.string(),data:_a}),QE=E.object({pageName:E.string().trim().min(1).max(255),pageType:E.string().trim().min(1).max(40),sectionTitle:E.string().trim().max(500),nearbyTitle:E.string().trim().max(500),nearbyBody:E.string().trim().max(2e3),prompt:E.string().trim().min(1).max(2e3),aspectRatio:E.string().regex(/^\d{1,2}:\d{1,2}$/)}),np=E.discriminatedUnion("ok",[E.object({index:E.number().int().min(0).max(hn-1),ok:E.literal(!0),url:E.httpUrl(),request_id:E.string().uuid()}),E.object({index:E.number().int().min(0).max(hn-1),ok:E.literal(!1),error:E.enum(["quota","generate","network"]),message:E.string().trim().min(1).max(500),request_id:E.string().uuid().nullable()})]),ZE=E.object({code:E.literal(0),message:E.string(),data:E.object({quota:_a,items:E.array(np).max(hn)})}),ip=E.object({provider_id:E.string().min(1),url:E.string().url(),thumbnail_url:E.string().url(),width:E.number().int().positive(),height:E.number().int().positive(),alt:E.string(),photographer_name:E.string().min(1),photographer_url:E.string().url(),photo_url:E.string().url(),download_location:E.string().url(),dominant_color:E.string().nullable()}),JE=E.object({query:E.string().trim().min(1).max(100),page:E.coerce.number().int().min(1).default(1),page_size:E.coerce.number().int().min(1).max(30).default(18),orientation:E.enum(["landscape","portrait","squarish"]).optional()}),eR=E.object({code:E.literal(0),message:E.string(),data:E.object({items:E.array(ip),page:E.number().int().min(1),page_size:E.number().int().min(1),total:E.number().int().nonnegative(),total_pages:E.number().int().nonnegative()})}),sp=E.string().url().refine(oR,{message:"download_location must be an official Unsplash download URL"}),tR=E.object({download_location:sp}),nR=E.object({code:E.literal(0),message:E.string(),data:E.object({reported:E.boolean()})}),iR=E.object({source_id:E.number().int().positive(),source_title:E.string().min(1).max(255),source_url:pt,resource_id:E.number().int().positive()}),sR=E.object({code:E.literal(0),message:E.string(),data:E.object({reported:E.boolean()})});function oR(e){if(!URL.canParse(e))return!1;let n=new URL(e);return n.protocol==="https:"&&n.hostname==="api.unsplash.com"&&n.username===""&&n.password===""&&n.port===""&&n.hash===""&&/^\/photos\/[^/]+\/download$/.test(n.pathname)}import{z as ce}from"zod";var aR=ce.object({colorSeeds:ce.object({primary:ce.string().min(1).max(40),accent:ce.string().min(1).max(40),foreground:ce.string().min(1).max(40).optional()}).strict().optional(),surfaceMode:ce.enum(["light","dark"]).optional(),fonts:ce.object({heading:ce.string().min(1).max(60),body:ce.string().min(1).max(60)}).strict().optional(),weightStyle:qe.optional()}).strict().refine(e=>e.colorSeeds!==void 0||e.surfaceMode!==void 0||e.fonts!==void 0||e.weightStyle!==void 0,{message:"colorSeeds, surfaceMode, fonts, or weightStyle is required"}),rR=ce.object({ok:ce.literal(!0),design_plan_version:ce.number().int().positive().optional(),snapshot_id:A,site_design_context:ce.lazy(()=>ds).optional(),changed_files:ce.array(ce.string().min(1)).optional()}),cR=ce.object({snapshot_id:A,color_seeds:ce.object({primary:ce.string(),accent:ce.string(),foreground:ce.string().optional()}).nullable(),surface_mode:ce.enum(["light","dark"]).nullable(),fonts:ce.object({heading:ce.string(),body:ce.string()}).nullable(),palette_inputs_present:ce.boolean(),palette_inputs:Eo.nullable(),notes:ce.array(ce.string()).nullable(),weight_style:qe.nullable().default(null),source:ce.enum(["globals_css","design_plan_archive"])});import{z as C}from"zod";var Ie=C.string().min(1).max(100),op=C.enum(["page","anchor","external","email","phone","file","group"]);function mR(e){if(!e||e.trim()!==e||/[\u0000-\u001f\u007f\\]/u.test(e))return!1;if(e.startsWith("/")&&!e.startsWith("//")||/^#[^\s]*$/u.test(e)||/^(mailto:|tel:)[^\s]+$/iu.test(e))return!0;try{let n=new URL(e);return(n.protocol==="http:"||n.protocol==="https:")&&!n.username&&!n.password}catch{return!1}}var lR=C.string().max(2048).refine(mR,"Invalid navigation destination"),ap=C.string().trim().min(1).max(255),rp=C.enum(["link","cta"]).nullable(),cp=C.lazy(()=>C.object({id:Ie,group_id:Ie,parent_id:Ie.nullable(),sort_order:C.number().int().nonnegative(),label:C.string(),href:C.string().nullable(),target_type:op,enabled:C.boolean(),effective_visible:C.boolean(),open_in_new:C.boolean(),nofollow:C.boolean(),role:rp,link_binding:C.object({kind:C.enum(["custom","cms_page","file"]),page_id:Ie.nullable()}),children:C.array(cp)})),pR=C.object({id:Ie,name:C.string(),description:C.string(),is_default:C.boolean(),can_delete:C.boolean(),delete_block_reason:C.string().nullable(),items:C.array(cp)}),dR=C.object({site_id:C.string().min(1),default_group_id:Ie.nullable(),groups:C.array(pR),limits:C.object({max_depth:C.number().int().positive(),max_items:C.number().int().positive()})}),QM=C.object({data:dR}),mp=C.object({name:ap,description:C.string().max(2e3).optional()}).strict(),uR=mp.partial().refine(e=>Object.keys(e).length>0,"At least one field is required"),ZM=C.object({group_id:Ie}).strict(),lp={label:ap,target_type:op,href:lR.nullable().optional(),enabled:C.boolean().optional(),open_in_new:C.boolean().optional(),nofollow:C.boolean().optional(),role:rp.optional()},_R=C.object({group_id:Ie,parent_id:Ie.nullable().optional(),...lp}).strict().superRefine((e,n)=>{e.target_type!=="group"&&!e.href&&n.addIssue({code:"custom",path:["href"],message:"Link destination is required"}),e.target_type==="group"&&e.href&&n.addIssue({code:"custom",path:["href"],message:"Groups have no destination"})}),gR=C.object({...lp,link_mode:C.literal("custom").optional()}).partial().strict().refine(e=>Object.keys(e).length>0,"At least one field is required"),hR=C.object({group_id:Ie,parent_id:Ie.nullable(),before_id:Ie.nullable().optional()}).strict(),SR=C.object({cms_bound:C.boolean(),cms_driven:C.boolean(),supports_groups:C.boolean(),supports_nested_groups:C.boolean(),supports_link_attributes:C.boolean(),requires_agent:C.boolean(),reasons:C.array(C.string())}),JM=C.object({data:SR}),eU=C.discriminatedUnion("action",[C.object({action:C.literal("create_group"),values:mp}).strict(),C.object({action:C.literal("update_group"),id:Ie,values:uR}).strict(),C.object({action:C.literal("delete_group"),id:Ie}).strict(),C.object({action:C.literal("set_default_group"),group_id:Ie}).strict(),C.object({action:C.literal("create_item"),values:_R}).strict(),C.object({action:C.literal("update_item"),id:Ie,values:gR}).strict(),C.object({action:C.literal("delete_item"),id:Ie,cascade:C.boolean().optional()}).strict(),C.object({action:C.literal("move_item"),id:Ie,values:hR}).strict()]);import{z as me}from"zod";var ga=me.enum(["products","cases","guides","documents","company"]),fR=me.enum(["source_unreachable","content_mojibake","min_fields_unmet","document_no_file_reference","document_file_unavailable","media_ingest_failed","app_unavailable","write_failed","kind_input_unavailable","kind_uncertain","kind_service_unavailable","kind_budget_exhausted"]),yt=me.number().int().nonnegative(),bR=me.discriminatedUnion("status",[me.object({collection:ga,status:me.literal("processing")}).strict(),me.object({collection:ga,status:me.enum(["imported","partial","failed"]),imported:yt,exception:yt}).strict()]),pp=me.enum(["legacy_domain_not_routed","site_context_missing","site_rules_limit_exceeded","site_rules_not_served"]),yR=me.enum(["target_page_unpublished","redirect_target_missing","redirect_write_failed",...pp.options]),xR=me.discriminatedUnion("status",[me.object({status:me.literal("processing")}).strict(),me.object({status:me.literal("unavailable")}).strict(),me.object({status:me.literal("ready"),site_reason:pp.nullable(),same_path:yt,active:yt,exception:yt,exceptions:me.array(me.object({path:me.string().regex(/^\/[^?#]*$/),reason_code:yR}))})]),iU=me.object({overall_status:me.enum(["moving","completed","disabled","failed"]),by_collection:me.array(bR),media:me.object({image:yt,video:yt,audio:yt,file:yt}),exceptions:me.array(me.object({collection:ga.nullable(),path:me.string().regex(/^\/[^?#]*$/),reason_code:fR})),redirects:xR.nullable().optional()});var fa=t.object({heading:t.string().min(1).max(160).optional(),body:t.string().min(1).max(160).optional(),paletteIntent:t.string().min(1).max(400).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),density:t.enum(["compact","comfortable","airy","editorial"]).optional(),motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),themeId:t.string().min(1).max(60).optional(),themeDescription:t.string().min(1).max(400).optional(),aestheticNote:t.string().min(1).max(300).optional(),weightStyle:qe.optional()}),ha=t.enum(["material","reference","brief","industry"]),ER=t.object({market:t.object({value:t.string().min(1).max(200),source:ha}),customer:t.object({value:t.string().min(1).max(200),source:ha}),purpose:t.object({options:t.array(t.string().min(1).max(60)).min(2).max(4),selected:t.string().min(1).max(60),source:ha})}),RR=t.enum(["text-options","motion-slider","positioning"]),ba=t.enum(["none","subtle","moderate","expressive"]),IR=t.enum(["compact","comfortable","airy","editorial"]),TR=ba,Sp=t.object({skill_name:t.string().min(1),rationale:t.string().min(4).max(200),confidence:t.enum(["high","medium","low"]).optional(),displayName:t.object({zh:t.string().min(1),en:t.string().min(1)}).partial().optional()}),kR=t.object({value:t.string(),label:t.string(),desc:t.string().optional(),impact:t.string().optional(),isRecommended:t.boolean().optional(),preselect:t.boolean().optional(),visualHints:fa.optional(),conversionHints:Mt.optional()}),AR=t.object({id:t.string(),type:RR,question:t.string(),tag:t.string(),aiThinking:t.string(),options:t.array(kR),source:t.enum(["ai-detected","always-ask"]),sourceDetail:t.string(),positioning:ER.optional()}),ya=t.object({questions:t.array(AR).min(1).max(6)}),CU=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:$t,brief:t.string().min(20).max(1e3),site_default_locale:Ee.optional(),owner_locale:Ee.optional(),input_context:t.object({facts:t.array(di).max(120),conflicts:t.array(_i).max(20),reference:ui.optional(),sources:t.array(t.object({type:Es,title:t.string().max(120).optional(),status:Rs})).max(16).optional()}).optional()}),fp=t.enum(["model_schema_invalid","provider_rate_limited","provider_unavailable","aborted","unknown"]),DU=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:V,at:t.string().min(1)}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Sp).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:fp.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),at:t.string().min(1)})]),OU="SITE_PLANNING_INPUT_FROZEN",NU="SITE_PLANNING_LOCKED",jU="SITE_STRUCTURE_CONFIRMATION_REQUIRED",LU="SITE_STRUCTURE_CONFIRMATION_STALE",MU="SITE_SITEMAP_DRAFT_STALE",UU="SITE_SITEMAP_DRAFT_OPERATION_MISMATCH",dp="SITE_STRUCTURE_INVALID",FU=t.object({tenant_id:t.string().min(1),name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),GU=t.object({name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),qU=t.object({name:t.string().min(1).max(120)}),WU=t.object({name:t.string().min(1).max(120),default_locale:Ee.optional()}),KU=t.object({body:t.string().min(20).max(1e3)}),BU=t.object({body:t.string().min(20).max(1e3)}),xa=t.string().url().refine(e=>{try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}},{message:"URL must use http or https protocol"}),zU=t.object({tenant_id:t.string().min(1),site_id:k.optional(),site_url:xa.optional(),site_name:t.string().trim().min(1).max(255).optional()}),HU=L(yr),VU=L(xr),$U=L(Er),YU=L(Lr),XU=L(Mr),QU=L(Ur),ZU=L(Gr),JU=L(qr),eF=L(Wr),tF=L(t.object({site_id:k,site_url:xa.nullable()})),jt=t.object({id:k,tenant_id:t.string().min(1),name:t.string().min(1),slug:t.string().min(1),status:Js,deployment_status:eo,archived_at:t.string().min(1).nullable(),current_sitemap_id:Te.nullable(),confirmed_sitemap_id:Te.nullable().optional(),confirmed_sitemap_version:t.number().int().positive().nullable().optional(),structure_confirmed_at:t.string().min(1).nullable().optional(),migration_content_requested:t.boolean().optional(),current_snapshot_id:A.nullable(),published_deployment_id:ct.nullable().optional(),deployed_url:t.string().url().nullable(),default_locale:Ee,owner_locale:Ee.optional(),cms_site_id:lr.nullable().optional(),cms_site_url:xa.nullable().optional(),parent_site_id:k.nullable().optional(),mount_path:t.string().min(1).nullable().optional(),schema_version:t.literal(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),Ea=t.object({id:$t,tenant_id:t.string().min(1),site_id:k,body:t.string().min(1),source:t.enum(["user","import","system"]),created_at:t.string().min(1),updated_at:t.string().min(1)}),nF=t.object({site:jt,brief:Ea,next_step:t.literal("clarify")}),iF=t.object({site:jt,brief:Ea}),sF=t.object({brief:Ea}),wR=t.enum(["queued","running","succeeded","failed","cancelled"]),bp=t.enum(["clarify","sitemap","workspace"]),yp=t.enum(["clarify","sitemap","initial_generation","iteration","landing_page","fill_in"]),xp=t.enum(["clarify","sitemap","workspace","summarize"]),et=t.object({id:V,tenant_id:t.string().min(1),site_id:k,agent_type:bp,run_kind:yp,status:wR,model_route:xp,started_at:t.string().min(1).nullable(),finished_at:t.string().min(1).nullable(),error_code:t.string().min(1).nullable(),created_at:t.string().min(1),thread_id:tt.nullable().optional()}),oF=t.object({agent_run:et}).strict(),PR=t.enum(["workspace","landing_page","external"]),vR=t.enum(["user","background"]),Ep=t.enum(["active","archived"]),hs=t.object({id:tt,tenant_id:t.string().min(1),site_id:k,kind:PR,origin:vR,subject_key:t.string().min(1).max(200),title:t.string().min(1).max(200),status:Ep,external_thread_id:t.string().min(1).max(200).nullable(),last_run_id:V.nullable(),last_activity_at:t.string().min(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),aF=t.object({agent_run:et,thread:hs.nullable()}),rF=t.object({run_id:V.optional(),site_id:k,agent_type:bp,run_kind:yp.optional(),model_route:xp,input:t.record(t.string(),t.unknown()).optional()}).superRefine((e,n)=>{oi(e.input)&&n.addIssue({code:"custom",path:["input"],message:"Agent run input must not contain secrets"})}),cF=t.object({agent_run:et,next_step:t.literal("stream_events")}),Rp=t.enum(["draft","candidate","deleting","current","failed"]),xt=t.object({id:A,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:Xe.nullable().optional(),reason:t.enum(["initial_generation","workspace_edit","pre_deploy","manual_save","rollback","template_upgrade","subsite_clone"]),status:Rp,created_at:t.string().min(1)}),mF=t.object({snapshot_id:A,creation_key:t.string().min(1),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:Xe.optional(),reason:xt.shape.reason,status:t.enum(["draft","candidate","current","failed"]).default("candidate"),source_run_id:V.optional()}),lF=t.object({site:jt,snapshot:xt,next_step:t.literal("workspace")}),pF=t.object({expected_manifest_hash:xt.shape.manifest_hash,manifest_hash:xt.shape.manifest_hash,object_key:xt.shape.object_key}).strict(),dF=t.union([t.object({base_snapshot_id:A.nullable(),source_run_id:V.optional()}).strict(),t.object({skip_base_check:t.literal(!0)}).strict()]),CR=t.object({site:jt,snapshot:xt,next_step:t.literal("workspace")}),uF=t.object({snapshot:xt}),_F=t.object({status:t.literal("deleting"),snapshot_id:A,object_key:t.string().min(1)}),gF=t.object({status:t.literal("deleted"),snapshot_id:A}),Ss=t.object({id:La,tenant_id:t.string().min(1),site_id:k,snapshot_id:A,version:t.number().int().positive(),accepted_commit:t.string().min(1),source_run_id:V.nullable(),created_at:t.string().min(1)}),DR=Ss.extend({reason:xt.shape.reason,status:Rp}),hF=t.object({accepted_commit:t.string().min(1),source_run_id:V.optional()}),SF=t.object({site_version:Ss,next_step:t.literal("workspace")}),fF=t.object({owner_id:t.string().min(1)}).strict(),bF=t.discriminatedUnion("acquired",[t.object({acquired:t.literal(!0)}).strict(),t.object({acquired:t.literal(!1)}).strict()]),yF=t.object({owner_id:t.string().min(1)}).strict(),xF=t.object({released:t.literal(!0)}).strict(),EF="TEMPLATE_UPGRADE_LOCK_LOST",RF=t.object({base_snapshot_id:A,accepted_commit:Ss.shape.accepted_commit,owner_id:t.string().min(1)}).strict(),IF=CR.strict(),TF=t.object({site_versions:t.array(DR)}),kF=t.object({site:jt,snapshot:xt,site_version:Ss,next_step:t.literal("workspace")}),AF=t.object({snapshot_id:A,force_rehydrate:t.boolean().optional(),recovery_required:t.boolean().optional()}),OR=t.discriminatedUnion("status",[t.object({status:t.literal("ready"),snapshot_id:A,preview_url:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({status:t.literal("failed"),code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})]),wF=t.object({tenant_id:t.string().min(1),site_id:k,snapshot_id:A}).strict(),PF=OR,Ra=t.enum(Yt),Ip=t.enum(["quality_check","publish"]),Ot=t.object({id:ct,tenant_id:t.string().min(1),site_id:k,snapshot_id:A,type:Ip.default("publish"),version:t.number().int().positive(),status:Ra,provider:t.enum(["cloudflare"]),url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),vF=t.object({tenant_id:t.string().min(1),site_id:k,expected_snapshot_id:A}).strict(),CF=t.object({deployment:Ot}),DF=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:ct}).strict(),OF=t.object({deployment:Ot}),NF=t.object({}).strict(),jF=t.object({snapshot_id:A.optional()}).strict(),NR=t.object({deployment:Ot}),LF=L(NR),MF=t.object({deployment:Ot.nullable()}),UF=t.object({deployment:Ot}),up=t.object({id:ct,type:Ip.default("publish"),status:Ra,url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable()}),jR=t.object({current:up.nullable(),latest_released:up.nullable()}),FF=L(jR),LR=t.enum(["deployment.snapshot","deployment.status.changed","deployment.finished","deployment.failed","deployment.realtime.recovered","server.error"]),Sn=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:k,deployment_id:ct,seq:t.number().int().positive(),sent_at:t.string().min(1)}),us=t.object({deployment:Ot,steps:Pc.default([])}),GF=t.discriminatedUnion("type",[Sn.extend({type:t.literal("deployment.snapshot"),payload:us}),Sn.extend({type:t.literal("deployment.status.changed"),payload:us}),Sn.extend({type:t.literal("deployment.finished"),payload:us}),Sn.extend({type:t.literal("deployment.failed"),payload:us}),Sn.extend({type:t.literal("deployment.realtime.recovered"),payload:t.object({action:t.literal("refresh")})}),Sn.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})})]),qF=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:ct,status:Ra,updated_at:t.string().min(1)}),MR="vcp:deployments",WF={path:"/v1/sites/:site_id/deployments/:deployment_id/socket",redis_channel:MR,outbound_message_schema:"DeploymentWsServerMessageSchema",message_types:[...LR.options]},UR=t.object({error:t.object({code:t.string().min(1),message:t.string().min(1),details:t.unknown().optional(),request_id:t.string().min(1).optional(),retryable:t.boolean().default(!1)})}),KF=t.object({error:UR.shape.error.extend({code:t.literal("AGENT_RUN_IN_FLIGHT"),details:t.object({code:t.literal("AGENT_RUN_IN_FLIGHT"),message:t.string().min(1),agent_run:et})})}),BF=t.object({colors:t.record(t.string(),t.string()).default({}),typography:t.record(t.string(),t.string()).default({}),spacing:t.record(t.string(),t.string()).default({}),motion:t.record(t.string(),t.string()).default({})}),FR=t.object({theme_id:t.string().min(1),paletteIntent:t.string().min(1),tone:t.string().min(1),mediaMood:t.string().min(1),motionLevel:ba.optional(),userVisualHints:fa.optional()}),GR=t.object({key:t.string().min(1).max(64).optional(),question:t.string().min(1),answer:t.string().min(1)}),zF=t.object({query:t.string().min(1),keywords:t.array(t.string()).default([]),orientation:t.enum(["landscape","portrait","square"]).optional(),role:t.enum(["hero","section","card","gallery","testimonial","decorative"]),altHint:t.string().min(1)}),HF=t.object({id:t.string().min(1),role:t.enum(["site_background","nav_background","footer_background"]),query:t.string().min(1),keywords:t.array(t.string()).default([]),treatment:t.enum(["cover","fixed-cover","subtle-texture"]),altHint:t.string().optional()}),qR=t.object({provider:t.enum(["unsplash","pexels"]),providerLabel:t.enum(["Unsplash","Pexels"]),providerHref:t.string().url(),photoHref:t.string().url().optional(),photographerName:t.string().optional(),photographerHref:t.string().url().optional(),requiresAttribution:t.boolean()}),VF=t.object({src:t.string().min(1),alt:t.string().min(1),width:t.number().int().positive().optional(),height:t.number().int().positive().optional(),provider:t.enum(["unsplash","pexels","placeholder"]).optional(),providerId:t.string().optional(),photoUrl:t.string().url().optional(),photographer:t.string().optional(),photographerUrl:t.string().url().optional(),credit:t.string().optional(),dominantColor:t.string().optional(),attribution:qR.optional()}),WR=t.enum(["system_recommended","user_picked","user_picked_extended","deterministic_fallback"]),fn=t.object({id:t.string().min(1),name:t.string().min(1),category:t.literal("page-generation"),version:t.string().min(1).optional(),reason:t.string().min(1).max(200),source:WR.default("system_recommended")}),ne=t.string().min(1).max(2e3),_p=t.string().min(1).max(120),ds=t.object({visualDirection:ne,brandFeeling:ne,paletteIntent:ne,typographyIntent:ne,density:IR,motionLevel:TR,motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),mediaStrategy:ne,compositionRules:t.array(ne).max(20),avoidPatterns:t.array(ne).max(20),fonts:t.object({heading:t.string().min(1),body:t.string().min(1)}).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),weightStyle:qe.optional()}),Ia=160,Tp=t.object({routeGoal:ne,narrativeArc:ne,firstViewportIntent:ne,visualContinuity:ne,sectionRhythm:ne,avoidPatterns:t.array(ne).max(20),displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(Ia).optional(),metaTitle:t.string().min(1).max(120).optional(),metaDescription:t.string().min(1).max(320).optional(),primaryKeyword:t.string().min(1).max(160).optional(),longTailKeywords:t.array(t.string().min(1).max(160)).max(3).optional()}),kp=t.enum(["model_call","validation","repair","preview","worker_group"]),Nt=t.enum(["generating","generating_design_plan","checking_quality","updating_design_memory"]),Ap=t.object({sectionRole:ne,contentIntent:ne,layoutIntent:ne,visualIntent:ne,mediaIntent:ne,motionIntent:ne,interaction:pi.optional(),copyTone:ne,displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(Ia).optional(),ctaIntent:ne.optional(),continuityWithPrevious:ne.optional(),avoidRepeating:t.array(ne).max(20).optional(),industryRecipeRefs:t.array(_p).max(12).optional(),templateRecipeRefs:t.array(_p).max(12).optional()}),wp=t.object({siteName:t.string().min(1).max(120),tagline:t.string().min(1).max(200).optional(),primaryCta:t.object({label:t.string().min(1).max(60),target:t.string().min(1).max(200)}).optional(),trustSignals:t.array(t.string().min(1).max(60)).max(6).optional(),industry:t.string().min(1).max(40).optional()}),KR=t.enum(["solid","floating"]),BR=t.enum(["background","card","primary","frosted"]),zR=t.enum(["sticky","hide-on-scroll","static"]),HR=t.enum(["bar","island"]),VR=t.object({variant:KR,surface:BR.optional(),behavior:zR.optional(),shape:HR.optional()}),$R=t.object({form:ne,layoutIntent:ne,scrollBehavior:ne,shell:VR.optional(),avoidPatterns:t.array(ne).max(10).optional()}),YR=t.enum(["background","card","primary","inverse"]),XR=t.object({surface:YR}),QR=t.object({form:ne,composition:ne,shell:XR.optional(),avoidPatterns:t.array(ne).max(10).optional()}),ZR=t.object({pattern:ne,intent:ne}),Pp=t.object({header:$R,footer:QR,mobileNav:ZR}),vp=t.object({schemaVersion:t.literal(1).default(1),siteDesignContext:ds,routeCards:t.record(t.string().min(1),Tp),blockContexts:t.record(t.string().min(1),Ap),selectedSkillPacks:t.array(fn).max(3).optional(),branding:wp.optional(),chromeDesign:Pp.optional()}),$F=t.object({siteDesignContext:ds.omit({imagePalette:!0}).optional(),routeCards:t.record(t.string().min(1),Tp).optional(),blockContexts:t.record(t.string().min(1),Ap.extend({interaction:pi.nullable().optional()})).optional(),branding:wp.optional(),chromeDesign:Pp.optional()}),Fe=t.string().trim().min(1),Ta=t.object({id:Fe,label:t.string().trim().min(1),type:t.string(),variant:t.string().optional(),order:t.number(),props:t.record(t.string(),t.unknown()),meta:t.object({aiGenerated:t.boolean(),userEdited:t.boolean(),lastEditedAt:t.string(),lastEditedBy:t.enum(["ai","user"]),userInstruction:t.string().optional()}).optional()}).strict(),ka=t.string().regex(On,"Page slug must be '/' or a lowercase ASCII kebab-case absolute path."),JR=new RegExp(`^/(?:${Zt}(?:/${Zt})*)?(?:\\?[^#\\s]*)?(?:#[^\\s]*)?$`),eI=/^(?:#[^\s]*|[a-z][a-z0-9+.-]*:[^\s]+|\/\/[^\s]+)$/i,tI=t.union([t.string().regex(JR),t.string().regex(eI)]),gp=t.object({label:t.string(),href:tI}).passthrough(),nI=t.object({primaryLinks:t.array(gp),footerLinks:t.array(gp)}),Cp=t.object({showInHeader:t.boolean(),showInFooter:t.boolean(),order:t.number()}).strict(),Aa=t.object({id:Fe,slug:ka,title:t.string().trim().min(1),blocks:t.array(Ta).min(1),navigation:Cp,parent_page_id:Fe.nullable().optional()}).strict(),iI=Ta.extend({type:t.string().nullable()}).strict(),sI=Aa.extend({slug:ka.nullable(),navigation:Cp.extend({showInHeader:t.boolean().nullable(),showInFooter:t.boolean().nullable()}).strict(),blocks:t.array(iI).min(1)}).strict(),oI=Ta.extend({id:t.string()}),aI=Aa.omit({parent_page_id:!0}).extend({id:t.string(),slug:t.string().min(1),blocks:t.array(oI).min(1),parent_page_id:t.string().nullable().optional()}),hp=t.object({label:t.string(),href:t.string().min(1)}),rI=t.object({primaryLinks:t.array(hp),footerLinks:t.array(hp)}),cI=t.discriminatedUnion("kind",[t.object({kind:t.literal("brief_clarify"),brief_id:$t,answer_ids:t.array(t.string().min(1)).max(10)}).strict(),t.object({kind:t.literal("step5_strategy"),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/)}).strict()]),_s=t.object({site_name:t.string().min(1).max(80).optional(),version:t.number().int().positive(),pages:t.array(Aa).min(1),navigation:nI,integrations:t.object({cms:t.unknown().optional(),analytics:t.unknown().optional()}).optional(),meta:t.object({generatedAt:t.string(),generatedBy:t.literal("sitemap-agent"),source_brief_id:t.string().optional(),source_answer_ids:t.array(t.string()).optional(),source:cI.optional()}),skillSelection:fn,visualTheme:FR.optional(),userChoices:t.array(GR).optional(),confirmedChoices:t.object({conversion:Mt.optional()}).optional(),seoKeywords:t.array(wn).min(1).optional()}).strict(),bn=_s.superRefine((e,n)=>{Dp(e.pages,n)}),un=_s.extend({pages:t.array(sI).min(1)}).strict().superRefine((e,n)=>{Dp(e.pages,n)}),mI=t.enum(["slug","showInHeader","showInFooter"]),lI=t.object({page_id:Fe,fields:t.array(mI).min(1).max(3)}).strict(),pI=t.object({page_id:Fe,block_id:Fe,fields:t.tuple([t.literal("type")])}).strict(),dI=100,uI=500,_I=t.object({pages:t.array(lI).max(dI),blocks:t.array(pI).max(uI)}).strict().superRefine((e,n)=>{let i=new Set;e.pages.forEach((o,a)=>{i.has(o.page_id)&&n.addIssue({code:"custom",path:["pages",a,"page_id"],message:`Duplicate page target '${o.page_id}'.`}),i.add(o.page_id),new Set(o.fields).size!==o.fields.length&&n.addIssue({code:"custom",path:["pages",a,"fields"],message:"Page target fields must be unique."})});let s=new Set;e.blocks.forEach((o,a)=>{let c=`${o.page_id}\0${o.block_id}`;s.has(c)&&n.addIssue({code:"custom",path:["blocks",a],message:`Duplicate block target '${o.page_id}/${o.block_id}'.`}),s.add(c)})}),YF=t.object({sitemap:un,targets:_I,reserved_slugs:t.array(ka).optional()}).strict(),XF=t.object({sitemap:bn}).strict();function Dp(e,n){let i=new Map,s=new Map,o=new Map,a=0;e.forEach((m,S)=>{let g=i.get(m.id);if(g!==void 0?n.addIssue({code:"custom",path:["pages",S,"id"],message:`Duplicate page id '${m.id}' (first used at pages.${g}.id).`}):i.set(m.id,S),m.blocks.forEach((K,H)=>{let ie=s.get(K.id);ie!==void 0?n.addIssue({code:"custom",path:["pages",S,"blocks",H,"id"],message:`Duplicate block id '${K.id}' (first used at pages.${ie.pageIndex}.blocks.${ie.blockIndex}.id).`}):s.set(K.id,{pageIndex:S,blockIndex:H})}),m.slug===null)return;m.slug==="/"&&(a+=1);let w=o.get(m.slug);w!==void 0?n.addIssue({code:"custom",path:["pages",S,"slug"],message:`Duplicate page slug '${m.slug}' (first used at pages.${w}.slug).`}):o.set(m.slug,S)}),(a!==1||e[0]?.slug!=="/")&&n.addIssue({code:"custom",path:["pages"],message:"Sitemap must contain exactly one home page at pages[0] with slug '/'.",params:{errorCode:dp}});let c=new Map(e.map((m,S)=>[m.id,{page:m,index:S}])),r=(m,S)=>n.addIssue({code:"custom",path:m,message:S,params:{errorCode:dp}});e.forEach((m,S)=>{let g=m.parent_page_id??null;if(g===null)return;let w=["pages",S,"parent_page_id"];if(m.slug==="/"){r(w,"The home page cannot have a parent.");return}if(g===m.id){r(w,`Page '${m.id}' cannot be its own parent.`);return}let K=c.get(g);if(!K){r(w,`Parent page '${g}' does not exist.`);return}if(K.page.slug==="/"){r(w,"The home page cannot have sub pages.");return}(K.page.parent_page_id??null)!==null&&r(w,`Sitemap allows at most two levels; parent '${g}' must be a top-level page.`)})}var QF=_s.omit({skillSelection:!0,visualTheme:!0,userChoices:!0,confirmedChoices:!0,seoKeywords:!0}).extend({meta:_s.shape.meta.omit({source:!0}),site_name:t.string().min(1).max(80),pages:t.array(aI).min(1),navigation:rI}),gI=t.enum(["ai","user"]),yn=t.object({site_id:k,page_id:Fe,edited_by:gI.default("ai"),source_agent_run_id:V.optional()}),ZF=yn.extend({block_id:Fe,target_index:t.number().int().min(0)}),hI=yn.extend({block_id:Fe}),SI=yn.extend({block_id:Fe,instruction:t.string()}),JF=yn.extend({block_id:Fe,variant:t.string().min(1).nullable()}),eG=yn.extend({block_id:Fe,props:t.record(t.string(),t.unknown()),mode:t.enum(["replace","merge"]).default("replace")}),tG=yn.extend({block:t.object({id:Fe,label:t.string().trim().min(1),type:t.string().min(1),variant:t.string().min(1).optional(),props:t.record(t.string(),t.unknown()).default({}),insert_index:t.number().int().min(0).optional()})}),fI=t.enum(["move_block","delete_block","update_block_instruction","change_block_variant","update_block_props","add_block"]),nG=t.discriminatedUnion("operation",[t.object({operation:t.literal("delete_block"),input:hI}).strict(),t.object({operation:t.literal("update_block_instruction"),input:SI}).strict()]),bI=t.enum(["SITEMAP_EDIT_INVALID","SITEMAP_API_NOT_CONFIGURED","SITEMAP_NOT_FOUND","SITEMAP_PAGE_NOT_FOUND","SITEMAP_BLOCK_NOT_FOUND","SITEMAP_BLOCK_ALREADY_EXISTS","SITEMAP_LAST_BLOCK_DELETE_FORBIDDEN","SITEMAP_EDIT_FAILED"]),yI=t.object({status:t.literal("updated"),operation:fI,site_id:k,sitemap_id:Te,version:t.number().int().positive(),changed_pages:t.array(Fe).min(1),requires_code_patch:t.literal(!0)}),xI=t.object({status:t.literal("failed"),code:bI,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),iG=t.discriminatedUnion("status",[yI,xI]),wa=t.object({question_id:t.string().min(1),value:t.string().min(1),label:t.string().min(1).optional(),question:t.string().min(1).optional(),option_label:t.string().min(1).optional(),motion_level:ba.optional(),visual_tonality:fa.optional(),conversion:Mt.optional(),positioning:t.object({market:t.string().min(1).max(200),customer:t.string().min(1).max(200),purpose:t.string().min(1).max(60)}).optional()}),EI=t.object({id:t.string().trim().min(1).max(128),type:t.literal(1),search_intent:t.string().trim().min(1).max(255),path:t.string().trim().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),channel:t.string().trim().min(1).max(80),content_format:t.string().trim().min(1).max(80),priority:t.enum(["P0","P1","P2","P3"])}).strict(),sG=t.object({source:t.object({kind:t.literal("step5_strategy")}).strict()}).strict(),RI=t.object({item_key:Ei,title:t.string().trim().min(1).max(200),selected_option_id:vn,selected_label:t.string().trim().min(1).max(200),selected_value:t.string().trim().min(1).max(500),selected_description:t.string().trim().min(1).max(2e3),impact:t.string().trim().min(1).max(500).optional(),customer_note:t.string().trim().min(1).max(200).optional(),market_type:Ri.optional(),markets:t.array(Ii).max(32).optional(),sections:t.array(t.object({id:t.string().min(1),label:t.string().min(1)}).strict()).optional()}).strict(),II=t.object({kind:t.literal("step5_strategy"),site_name:t.string().trim().min(1).max(80).optional(),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/),decisions:t.array(RI).min(yi).max(De),enterprise_keywords:t.array(wn).min(1).optional()}).strict().superRefine((e,n)=>{let i=e.decisions.map(o=>o.item_key);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 sitemap decisions must use unique strategy keys."}),Pn.forEach(o=>{i.includes(o)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 sitemap decisions are missing ${o}.`})});let s=Qt.filter(o=>i.includes(o));e.decisions.forEach((o,a)=>{o.item_key!==s[a]&&n.addIssue({code:"custom",path:["decisions",a,"item_key"],message:"Step5 sitemap decisions must use the canonical order."})})}),Op=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:$t,brief:t.string().min(20).max(1e3),answers:t.array(wa).min(1).max(10),skillSelection:fn,site_default_locale:Ee.optional(),owner_locale:Ee.optional(),cms_site_id:t.string().min(1).nullish(),intent_pages:t.array(EI).max(9).optional(),reference:ui.optional(),input_context:t.object({facts:t.array(di).max(120),conflicts:t.array(_i).max(20)}).optional(),business_facts:Za.optional(),migration_products_enabled:t.boolean().optional()}),TI=Op.pick({tenant_id:!0,site_id:!0,skillSelection:!0,site_default_locale:!0,owner_locale:!0,cms_site_id:!0,reference:!0,input_context:!0,business_facts:!0,migration_products_enabled:!0}).partial({skillSelection:!0}).extend({source:II}).strict(),oG=t.union([Op,TI]),Np=t.enum(["planning","generating","validating","ready"]),kI=t.enum(["salvaged","deterministic_fallback"]),AI=t.enum(["model_exception_settled_prefix","model_exception_safe_root"]),jp={outcome:kI.optional(),reason:AI.optional(),attempts:t.number().int().positive().optional()};function Lp(e,n){if(e.type!=="sitemap.generated")return;let i=e.outcome!==void 0,s=e.reason!==void 0;i!==s&&n.addIssue({code:"custom",path:[i?"reason":"outcome"],message:"sitemap.generated outcome and reason must be provided together"})}var wI=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:V,at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:Np,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:Te,sitemap:bn,...jp,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:A,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:A.optional(),at:t.string().min(1)})]),aG=wI.superRefine(Lp),Mp=t.object({id:Te,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),source_agent_run_id:V.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}).strict();function Up(e,n){e.version!==e.sitemap.version&&n.addIssue({code:"custom",path:["sitemap","version"],message:`Sitemap JSON version ${e.sitemap.version} must equal record version ${e.version}.`})}var Fp=Mp.extend({sitemap:bn}).superRefine(Up),Gp=Mp.extend({sitemap:un}).superRefine(Up),rG=t.object({sitemap_id:Te,creation_key:t.string().min(1),sitemap:un,expected_current_sitemap_id:Te,expected_current_sitemap_version:t.number().int().positive()}).strict().superRefine((e,n)=>{e.sitemap.version!==e.expected_current_sitemap_version&&n.addIssue({code:"custom",path:["sitemap","version"],message:"Draft version must match the expected base version."})}),cG=t.object({sitemap:Gp}).strict();function mG(e){return`sitemap-user-draft:${e.site_id}:${e.expected_current_sitemap_id}:${e.expected_current_sitemap_version}:${e.sitemap_id}`}var lG=t.object({sitemap_id:Te,creation_key:t.string().min(1),sitemap:bn,source_agent_run_id:V.optional()}),pG=t.object({sitemap_id:Te,creation_key:t.string().min(1),sitemap:un,expected_current_sitemap_id:Te,expected_current_sitemap_version:t.number().int().positive(),migration_content_requested:t.boolean().optional()}),dG=t.object({sitemap_id:Te,creation_key:t.string().min(1),sitemap:bn,source_agent_run_id:V}),uG=t.object({site:jt,sitemap:Fp,next_step:t.literal("workspace")}).strict(),_G=t.object({site:jt,sitemap:Gp,next_step:t.literal("workspace")}).strict(),gG=t.object({site:jt,sitemap:Fp,next_step:t.literal("sitemap_review")}).strict(),PI=t.object({id:ja,tenant_id:t.string().min(1),site_id:k,brief_id:$t,questions:ya,answers:t.array(wa),selected_archetype:fn.optional(),completed_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),hG=t.object({answers:t.array(wa).min(1),questions:ya,selected_archetype:fn.optional()}),SG=t.object({clarify_session:PI}),fG=t.object({questions:ya,selected_archetype:fn}),vI=t.object({id:bs,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),design_plan:vp,source_agent_run_id:V.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),bG=t.object({design_plan_id:bs.optional(),design_plan:vp,source_agent_run_id:V.optional()}),yG=t.object({design_plan:vI}),fs=t.enum(["initial_generation","iteration","landing_page","fill_in"]),CI=t.object({label:t.string().min(1).max(48),prompt:t.string().min(1).max(160)}).strict(),DI=t.enum(["model","derived","mixed","advisor"]),qp=t.object({suggestions:t.array(CI).min(1).max(4),source:DI}).strict(),OI=t.enum(["clean","salvaged","deterministic_fallback","baseline_retained"]),NI=t.enum(["generation_succeeded","entry_slots_omitted","quality_gate_exhausted","schema_gate_exhausted","generation_timeout","stream_schema_mismatch","stream_generation_error","generation_error","fallback_compiler_error","legacy_result_missing_metadata"]),jI=t.enum(["progress","assistant_final"]),Wp=t.enum(["run.started","message.delta","user.message","plan.updated","clarify.partial","clarify.archetype_proposals","clarify.finished","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","sitemap.updated","sitemap.resync.failed","sitemap.resync.warning","block.changed","tool.started","tool.finished","workspace.plan.created","workspace.worker.updated","workspace.task.updated","workspace.degraded","workspace.design_plan.outcome","workspace.suggestions","workspace.generation_ledger","file.changed","snapshot.created","snapshot.finalized","preview.preparing","preview.ready","preview.build.started","preview.build.succeeded","preview.build.failed","run.failed","run.finished","media_resolution.started","media_resolution.finished","skill.selecting","skill.selected","activity.started","activity.updated","activity.finished","activity.failed"]),LI=t.object({id:t.string().min(1),title:t.string().min(1),status:t.enum(["pending","running","completed","failed"])}),Vt=t.enum(["pending","running","completed","completed_with_skips","failed","skipped"]),Pa=t.enum(["style_media","chrome","sections","layout","pages","detect_typecheck","repair","finalize","sitemap_resync","preview"]),va=t.object({code:t.string().min(1),message:t.string().min(1),path:t.string().min(1).optional(),task_id:t.string().min(1).optional(),details:t.record(t.string(),t.unknown()).optional()}),Pe=t.string().min(1).refine(e=>ed(e),{message:"Snapshot file paths must be safe relative POSIX paths without traversal."}),Ca=t.object({deduped_paths:t.array(Pe),skipped_tasks:t.array(t.string().min(1)),failed_tasks:t.array(t.string().min(1)),fallback_files:t.array(t.string().min(1)),applied_paths:t.array(Pe)}),Da=t.object({group_id:t.string().min(1),phase:Pa,title:t.string().min(1),status:Vt,task_ids:t.array(t.string().min(1)),depends_on_groups:t.array(t.string().min(1)),target_paths:t.array(Pe)}),MI=t.enum(["style","media","chrome","section","layout","page"]),Oa=t.object({task_id:t.string().min(1),group_id:t.string().min(1),kind:MI,target_path:Pe,block_id:t.string().min(1).optional(),block_type:t.string().min(1).optional(),block_variant:t.string().min(1).optional(),block_order:t.number().int().nonnegative().optional(),user_instruction:t.string().min(1).optional(),page_id:t.string().min(1).optional(),page_slug:t.string().min(1).optional(),page_title:t.string().min(1).optional(),title:t.string().min(1).max(60).optional(),description:t.string().min(1).max(Ia).optional(),status:Vt,required_reads:t.array(Pe).optional(),search_params_sections:t.array(Pe).optional(),standard_form_view:Pe.optional(),breadcrumb:t.object({trail:t.array(t.object({name:t.string().min(1),href:t.string().min(1).nullable(),omitted_href:t.string().min(1).optional()}).strict()).min(1),current:t.string().min(1)}).strict().optional()}),Na=t.object({from_group_id:t.string().min(1),to_group_id:t.string().min(1),reason:t.enum(["style_media","chrome","sections","layout","page_composition","quality_gate"])}),xG=t.object({plan_id:t.string().min(1),run_kind:fs,model_route:t.object({planner:t.literal("workspace_planner"),worker:t.literal("workspace")}),groups:t.array(Da),tasks:t.array(Oa),dependencies:t.array(Na),expected_outputs:t.array(Pe),diagnostics:Ca}),EG=t.object({task_id:t.string().min(1),patch:t.unknown().optional(),snapshot_id:A.optional(),read_files:t.array(Pe),diagnostics:t.array(va),status:Vt}),Kp=t.object({worker_count:t.number().int().nonnegative(),task_count:t.number().int().nonnegative(),group_count:t.number().int().nonnegative()}),Bp=t.object({pending:t.number().int().nonnegative(),running:t.number().int().nonnegative(),completed:t.number().int().nonnegative(),completed_with_skips:t.number().int().nonnegative(),failed:t.number().int().nonnegative(),skipped:t.number().int().nonnegative()}),UI=t.object({type:t.literal("text"),text:t.string(),state:t.enum(["streaming","done"]).optional()}),FI=t.object({type:t.literal("reasoning"),text:t.string(),state:t.enum(["streaming","done"]).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),GI=t.object({type:t.literal("file"),mediaType:t.string().min(1),filename:t.string().min(1).optional(),url:t.string().min(1)}),qI=t.object({type:t.literal("source-url"),sourceId:t.string().min(1),url:t.string().min(1),title:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),WI=t.object({type:t.literal("source-document"),sourceId:t.string().min(1),mediaType:t.string().min(1),title:t.string().min(1),filename:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),KI=t.object({type:t.string().regex(/^data-[a-zA-Z0-9_-]+$/),id:t.string().min(1).optional(),data:t.unknown()}),BI=t.object({type:t.string().regex(/^tool-[a-zA-Z0-9_-]+$/),toolCallId:t.string().min(1),state:t.enum(["input-streaming","input-available","output-available","output-error"]),input:t.unknown().optional(),output:t.unknown().optional(),errorText:t.string().min(1).optional()}),zI=t.object({type:t.literal("error"),errorText:t.string().min(1)}),HI=t.object({type:t.literal("step-start")}),gs=t.union([UI,FI,GI,qI,WI,KI,BI,zI,HI]),VI=t.string().min(1).max(512).refine(e=>ed(e)&&!/^[A-Za-z]:\//.test(e),{message:"Generated-code rescue paths must be safe relative POSIX paths without traversal."}),$I=t.array(VI).min(1).max(64),YI=t.array(t.string().min(1).max(120)).min(1).max(64),XI=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:V,at:t.string().min(1)}),t.object({type:t.literal("message.delta"),text:t.string().min(1),history_purpose:jI.optional(),at:t.string().min(1)}),t.object({type:t.literal("user.message"),client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(gs).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:vi.optional(),at:t.string().min(1)}),t.object({type:t.literal("plan.updated"),steps:t.array(LI),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Sp).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:Np,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:Te,sitemap:bn,...jp,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("sitemap.updated"),sitemap_id:Te,version:t.number().int().positive(),reason:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.failed"),error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.warning"),code:t.string().min(1),message:t.string().min(1),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("block.changed"),block_id:t.string().min(1),change_type:t.enum(["add","update","delete","move"]),at:t.string().min(1)}),t.object({type:t.literal("tool.started"),tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("tool.finished"),tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:so.optional(),at:t.string().min(1)}),t.object({type:t.literal("workspace.plan.created"),plan_id:t.string().min(1),run_kind:fs,groups:t.array(Da),tasks:t.array(Oa),dependencies:t.array(Na),expected_outputs:t.array(Pe),diagnostics:Ca,summary:Kp,at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.worker.updated"),group_id:t.string().min(1),phase:Pa,status:Vt,task_counts:Bp,target_paths:t.array(Pe),diagnostics:t.array(t.string().min(1)),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.task.updated"),task_id:t.string().min(1),group_id:t.string().min(1),status:Vt,target_path:Pe,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(va).optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.degraded"),reason:t.enum(["block_placeholder","form_placeholder","patch_protected_dropped","preview_health_degraded","preview_build_failed","design_plan_fallback","generated_code_rescue","cms_page_directory_degraded","form_prebuild_skipped","form_section_fallback","first_settings_sync_failed","component_omitted","page_omitted","shared_fallback"]),degraded_block_ids:t.array(t.string().min(1)).min(1).optional(),dropped_files:t.array(t.string().min(1)).min(1).optional(),degraded_file_paths:$I.optional(),degraded_page_ids:YI.optional(),snapshot_id:A.optional(),code:t.string().min(1).optional(),message:t.string().min(1).optional(),diagnostics:t.string().min(1).optional(),retryable:t.boolean().optional(),at:t.string().min(1)}).strict().superRefine((e,n)=>{let i=e.reason==="generated_code_rescue",s=e.reason==="page_omitted",o=e.reason==="shared_fallback";if(!i){if(e.degraded_file_paths!==void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"degraded_file_paths is only allowed for generated_code_rescue"}),e.degraded_page_ids!==void 0&&!s&&n.addIssue({code:"custom",path:["degraded_page_ids"],message:"degraded_page_ids is only allowed for generated_code_rescue or page_omitted"}),o)for(let a of["degraded_block_ids","dropped_files","snapshot_id","code","diagnostics","retryable"])e[a]!==void 0&&n.addIssue({code:"custom",path:[a],message:`${a} is not allowed for shared_fallback`});return}e.degraded_file_paths===void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"generated_code_rescue requires degraded_file_paths"});for(let a of["degraded_block_ids","dropped_files","snapshot_id","code","message","diagnostics","retryable"])e[a]!==void 0&&n.addIssue({code:"custom",path:[a],message:`${a} is not allowed for generated_code_rescue`})}),t.object({type:t.literal("workspace.design_plan.outcome"),design_plan_outcome:OI,reason:NI,gate_diagnostics:t.object({gate:t.enum(["quality","schema"]),issue_codes:t.array(t.string().min(1)).max(20),issue_paths:t.array(t.string()).max(20),finish_reason:t.string().min(1).optional()}).strict().optional(),media_floor:t.object({total_blocks:t.number().int().min(0),media_bearing_blocks:t.number().int().min(0),hero_total:t.number().int().min(0),hero_media_bearing:t.number().int().min(0),pages_without_media:t.array(t.string().min(1)).max(50),met:t.boolean()}).strict().optional(),at:t.string().min(1)}).strict(),qp.extend({type:t.literal("workspace.suggestions"),at:t.string().min(1)}).strict(),tr,t.object({type:t.literal("file.changed"),path:t.string().min(1),change_type:t.enum(["create","update","delete"]),diff:t.string().optional(),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:A,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("snapshot.finalized"),snapshot_id:A,at:t.string().min(1)}),t.object({type:t.literal("preview.preparing"),at:t.string().min(1)}),t.object({type:t.literal("preview.ready"),url:t.string().url(),at:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({type:t.literal("preview.build.started"),snapshot_id:A,at:t.string().min(1)}),t.object({type:t.literal("preview.build.succeeded"),snapshot_id:A,at:t.string().min(1)}),t.object({type:t.literal("preview.build.failed"),snapshot_id:A,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:fp.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:A.optional(),degraded_reason:Rn.optional(),build_verified:t.boolean().optional(),generation_ledger:kn.optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().datetime()}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().datetime()}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("activity.started"),activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:kp,title:t.string().min(1).max(200),detail:t.string().max(360).optional(),title_code:Nt.optional(),detail_code:Nt.optional(),locks_input:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("activity.updated"),activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),detail:t.string().max(360).optional(),title_code:Nt.optional(),detail_code:Nt.optional(),at:t.string().min(1)}),t.object({type:t.literal("activity.finished"),activity_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("activity.failed"),activity_id:t.string().min(1),detail:t.string().max(360).optional(),at:t.string().min(1)})]),zp=XI.superRefine(Lp).superRefine((e,n)=>{if(e.type==="user.message"&&e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type!=="tool.finished")return;let i=e.name==="prepare_product_search_entry";i!==!!e.interaction_request&&n.addIssue({code:"custom",path:["interaction_request"],message:i?"prepare_product_search_entry requires interaction_request":"interaction_request is only valid for prepare_product_search_entry"})}),Sa=t.object({id:Ma,tenant_id:t.string().min(1),site_id:k,agent_run_id:V,sequence:t.number().int().positive(),event_type:Wp,payload:zp,created_at:t.string().min(1),thread_id:tt.nullable().optional()}),RG=t.object({event_type:Wp,payload:zp}).superRefine((e,n)=>{e.event_type!==e.payload.type&&n.addIssue({code:"custom",path:["payload","type"],message:"payload.type must match event_type"}),oi(e.payload)&&n.addIssue({code:"custom",path:["payload"],message:"AgentEvent payload must not contain secrets"})}),IG=t.discriminatedUnion("status",[t.object({status:t.literal("appended"),agent_run:et,event:Sa,next_cursor:t.number().int().nonnegative()}),t.object({status:t.literal("duplicate_ignored"),agent_run:et,event:Sa,next_cursor:t.number().int().nonnegative()})]),TG=t.object({events:t.array(Sa),next_cursor:t.number().int().nonnegative().optional()}),kG=t.object({after_sequence:t.coerce.number().int().nonnegative().default(0)}),AG=t.object({run_id:V.optional(),thread_id:tt.optional()}).superRefine((e,n)=>{e.run_id&&e.thread_id&&n.addIssue({code:"custom",path:["thread_id"],message:"run_id and thread_id are mutually exclusive"})}),wG=t.enum(["implemented","skeleton","planned"]),PG=t.enum(["GET","POST","PUT","PATCH","DELETE"]),vG=[{method:"PATCH",path:"/internal/sites/:site_id/snapshots/:snapshot_id/manifest",tag:"snapshots",summary:"Compare-and-set the manifest hash for the active current snapshot after an in-place object replacement.",status:"implemented",request_body_schema:"UpdateCurrentSnapshotManifestRequestSchema",response_schema:"SnapshotRecordSchema",notes:["Internal Agent authentication is required. The update succeeds only when site current_snapshot_id, snapshot status, object key, and expected manifest hash still match."]},{method:"GET",path:"/health",tag:"system",summary:"API health check.",status:"implemented",response_schema:"ApiHealth"},{method:"POST",path:"/sites",tag:"sites",summary:"Create a site and Step 1 brief in the current dev context.",status:"implemented",request_body_schema:"CreateSiteBriefRequestSchema",response_schema:"CreateSiteBriefResponseSchema"},{method:"POST",path:"/sites/drafts",tag:"sites",summary:"Create a draft site without a brief in the current tenant so /s/:site_id can collect Step 1 later.",status:"implemented",request_body_schema:"CreateSiteDraftRequestSchema",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites",tag:"sites",summary:"List current tenant sites.",status:"implemented",response_schema:"SiteRecordSchema[]"},{method:"GET",path:"/sites/by-cms/:cms_site_id",tag:"sites",summary:"Resolve an external CMS site id to one tenant-scoped VCP site.",status:"implemented",response_schema:"SiteRecordSchema",notes:["Used by the browser /d/:cms_site_id handoff route; lookup is scoped by current request tenant and returns 404 when the CMS site has not been synchronized."]},{method:"GET",path:"/sites/:site_id",tag:"sites",summary:"Get one tenant-scoped site.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"POST",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Create one version-bound site workflow from a published flow definition.",status:"implemented",request_body_schema:"CreateSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Read the current site workflow snapshot and derived menu state.",status:"implemented",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/workflow/progress",tag:"site-workflows",summary:"Read the minimal internal site workflow progress projection.",status:"implemented",response_schema:"SiteWorkflowProgressResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/website",tag:"site-workflows",summary:"Update the source website while website_scan is current.",status:"implemented",request_body_schema:"UpdateSiteWorkflowWebsiteRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/advance",tag:"site-workflows",summary:"Advance one non-terminal workflow node with an expected-current-node guard.",status:"implemented",request_body_schema:"AdvanceSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/complete",tag:"site-workflows",summary:"Complete the workflow from its final publishing node after server-side release checks pass.",status:"implemented",request_body_schema:"CompleteSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The browser supplies only the expected current node; the server verifies persisted release facts before completing the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/complete-quality-only",tag:"site-workflows",summary:"Complete the designer workflow after the linked quality-only publish workflow succeeds.",status:"implemented",request_body_schema:"CompleteQualityOnlyWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The server resolves the designer role and atomically completes both workflows without creating a publish deployment or updating the site deployment projection."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/register",tag:"site-workflows",summary:"Register a business-owned external task id and its idempotency key.",status:"implemented",request_body_schema:"RegisterWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/step2-site-initialization/tasks",tag:"site-workflows/step2-site-initialization",summary:"Create or reuse the current workflow's Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The server derives tenantId, sessionId, and siteUrl from trusted request/workflow state; the browser cannot submit upstream scope fields."]},{method:"GET",path:"/sites/:site_id/workflow/step2-site-initialization/tasks/:task_id",tag:"site-workflows/step2-site-initialization",summary:"Poll the workflow-owned Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The task id must match the current non-superseded website_crawl task reference for the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/:task_type/replace",tag:"site-workflows",summary:"Replace one task reference while retaining its superseded history.",status:"implemented",request_body_schema:"ReplaceWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/tasks/website_crawl/replace-and-invalidate-dependents",tag:"site-workflows",summary:"Replace website crawl and invalidate basic-info and metrics dependents atomically.",status:"implemented",request_body_schema:"ReplaceCrawlWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/build",tag:"site-workflows",summary:"Start the server-owned site build and workspace snapshot lifecycle.",status:"implemented",request_body_schema:"StartSiteBuildRequestSchema",response_schema:"StartSiteBuildResponseSchema",notes:["The browser may start or query the build, but cannot write site build or deployment summary status directly."]},{method:"GET",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Read the persisted no-website customer materials draft.",status:"implemented",response_schema:"CustomerMaterialsNullableResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Save the no-website customer materials before submission.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["A submitted record is immutable and rejects later writes."]},{method:"POST",path:"/sites/:site_id/workflow/customer-materials/submit",tag:"site-workflows",summary:"Submit and freeze customer materials before analysis.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["Repeated submissions return 409; clients may retry only the separate workflow advance."]},{method:"GET",path:"/sites/:site_id/designer/component-library/categories",tag:"designer-component-library",summary:"List the fixed insert-new-component category tree for a site.",status:"implemented",response_schema:"ListDesignerComponentCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewComponent."]},{method:"GET",path:"/sites/:site_id/designer/component-library/resources",tag:"designer-component-library",summary:"List component resources from the fixed designer catalog group.",status:"implemented",query_schema:"ListDesignerComponentsQuerySchema",response_schema:"ListDesignerComponentsResponseSchema",notes:["The server fixes resource type to component and does not expose resource-platform secrets, internal hosts, or product-line selection."]},{method:"POST",path:"/sites/:site_id/designer/component-library/resources/:resource_id/install",tag:"designer-component-library",summary:"Install one exact component version and return a strict SiteEditEngine materialization.",status:"implemented",request_body_schema:"InstallDesignerComponentBodySchema",response_schema:"InstallDesignerComponentResponseSchema",notes:["The server downloads the resource ZIP with the configured secret, validates main.json identity and compatibility, and returns only the strict materialization plus immutable revision metadata."]},{method:"GET",path:"/sites/:site_id/designer/page-library/categories",tag:"designer-page-library",summary:"List the fixed insert-new-page category tree for a site.",status:"implemented",response_schema:"ListDesignerPageCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewPage."]},{method:"GET",path:"/sites/:site_id/designer/page-library/resources",tag:"designer-page-library",summary:"List page and pages resources from the fixed designer catalog.",status:"implemented",query_schema:"ListDesignerPagesQuerySchema",response_schema:"ListDesignerPagesResponseSchema",notes:["The server fixes resource types to page and pages and does not expose resource-platform credentials or internal routing."]},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/prepare",tag:"designer-page-library",summary:"Resolve one exact page resource version for designer-side draft configuration.",status:"implemented",request_body_schema:"PrepareDesignerPageBodySchema",response_schema:"PrepareDesignerPageResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/install",tag:"designer-page-library",summary:"Install one exact page resource version and return a strict PageResourceArtifact.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server validates the explicit resource type, immutable package identity, page selections, materializations, and package-local references."]},{method:"GET",path:"/sites/:site_id/designer/pages",tag:"designer-page-library",summary:"List designer pages from the stable first-phase fixture source.",status:"implemented",response_schema:"ListDesignerSitePagesResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/enhance",tag:"designer-page-library",summary:"Echo a designer page-resource candidate without model execution or normalization.",status:"implemented",request_body_schema:"EnhanceDesignerPageResourceBodySchema",response_schema:"EnhanceDesignerPageResourceResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/compose",tag:"designer-page-library",summary:"Compose exact page and component resources into one strict page artifact.",status:"implemented",request_body_schema:"ComposeDesignerPageResourceBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server installs every immutable source, validates ordered page blocks, scopes component materializations, and returns one artifact without exposing resource-platform credentials."]},{method:"POST",path:"/sites/:site_id/designer/page-resources/blank",tag:"designer-page-library",summary:"Create the deterministic built-in blank page artifact for one configured route.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema"},{method:"PATCH",path:"/sites/:site_id",tag:"sites",summary:"Update site display name and optional generated-site locale for the current tenant.",status:"implemented",request_body_schema:"UpdateSiteRequestSchema",response_schema:"SiteRecordSchema"},{method:"DELETE",path:"/sites/:site_id",tag:"sites",summary:"Archive a site so it no longer appears in the tenant site list.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites/:site_id/workspace/source-files",tag:"sites",summary:"List source files available in the ready preview sandbox.",status:"implemented",response_schema:"WorkspaceSourceFileListItemSchema[]"},{method:"GET",path:"/sites/:site_id/workspace/source-file",tag:"sites",summary:"Read a source file from the ready preview sandbox.",status:"implemented",query_schema:"WorkspaceSourceFilePathQuerySchema",response_schema:"WorkspaceSourceFileResponseSchema"},{method:"GET",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"List or search enterprise image assets through the CMS adapter.",status:"implemented",query_schema:"ListMediaLibraryAssetsQuerySchema",response_schema:"ListMediaLibraryAssetsResponseSchema"},{method:"POST",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"Upload one validated image and create its enterprise asset.",status:"implemented",response_schema:"UploadMediaLibraryAssetResponseSchema",notes:["Accepts one multipart field named file; only the image MIME allowlist is accepted and the maximum size is 20 MiB."]},{method:"GET",path:"/sites/:site_id/media-assets/unsplash/search",tag:"media-assets",summary:"Search Unsplash through the VCP server-side client.",status:"implemented",query_schema:"SearchUnsplashMediaQuerySchema",response_schema:"SearchUnsplashMediaResponseSchema",notes:["The browser never receives the Unsplash access key; CMS is not involved in search."]},{method:"POST",path:"/sites/:site_id/media-assets/unsplash/:provider_id/use",tag:"media-assets",summary:"Best-effort report that an Unsplash image was selected.",status:"implemented",request_body_schema:"UseUnsplashMediaRequestSchema",response_schema:"UseUnsplashMediaResponseSchema",notes:["CMS report failure returns reported=false and does not roll back the image replacement."]},{method:"POST",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Confirm the currently reviewed Sitemap Draft and advance the site to structure_saved.",status:"implemented",request_body_schema:"ConfirmSiteStructureRequestSchema",response_schema:"PersistSiteSitemapDraftResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/sitemap-draft",tag:"sitemaps",summary:"Persist an agent-generated sitemap draft without confirming the structure.",status:"implemented",request_body_schema:"PersistGeneratedSitemapDraftRequestSchema",response_schema:"PersistGeneratedSitemapDraftResponseSchema"},{method:"PUT",path:"/sites/:site_id/sitemap/draft",tag:"sitemaps",summary:"Save an immutable user draft without confirming or advancing the workflow.",status:"implemented",request_body_schema:"SaveSiteSitemapDraftRequestSchema",response_schema:"SaveSiteSitemapDraftResponseSchema"},{method:"GET",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Read the current Sitemap Draft for a site.",status:"implemented",response_schema:"SitemapDraftRecordSchema"},{method:"POST",path:"/sites/:site_id/clarify/answers",tag:"clarify",summary:"Persist the Step 2 clarify answers (and the answered questions) into the site's clarify session.",status:"implemented",request_body_schema:"PersistClarifyAnswersRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema"},{method:"PATCH",path:"/sites/:site_id/clarify/archetype",tag:"clarify",summary:"Switch the Step 2 industry archetype (user_picked) into the site's clarify session via an idempotent upsert.",status:"implemented",request_body_schema:"UpdateClarifyArchetypeRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema",notes:["Independent of generate: materializes a clarify_sessions row when none exists (using the supplied questions) or updates only selected_archetype; never writes answers/completed_at. Forces source=user_picked."]},{method:"POST",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Persist a generated design plan version for a site (internal agent-only write).",status:"implemented",request_body_schema:"PersistSiteDesignPlanRequestSchema",response_schema:"PersistSiteDesignPlanResponseSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent writes design plans."]},{method:"GET",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site (internal agent-only read).",status:"implemented",response_schema:"DesignPlanRecordSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent reads design plans."]},{method:"GET",path:"/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site so Workspace UI can inspect the generated design contract.",status:"implemented",response_schema:"DesignPlanRecordSchema"},{method:"GET",path:"/sites/:site_id/brief",tag:"briefs",summary:"Read the persisted Step 1 brief for a site so the Workspace Agent can seed first full-site generation without a new write surface.",status:"implemented",response_schema:"BriefRecordSchema"},{method:"PUT",path:"/sites/:site_id/brief/draft",tag:"briefs",summary:"Save a draft site's Step 1 brief without advancing the workflow.",status:"implemented",request_body_schema:"SaveBriefDraftRequestSchema",response_schema:"SaveBriefDraftResponseSchema",notes:["Only sites in the editable build phase are writable; the brief row is upserted idempotently while site status, locale, and workflow stage remain unchanged."]},{method:"PATCH",path:"/sites/:site_id/brief",tag:"briefs",summary:"Create or update a draft site's Step 1 brief and advance it to Clarify without allowing later workflow states to roll back.",status:"implemented",request_body_schema:"UpdateBriefRequestSchema",response_schema:"UpdateBriefResponseSchema",notes:["Only sites in the editable build phase are writable; missing brief rows are created on first save; identical retries are idempotent."]},{method:"POST",path:"/internal/sites/:cms_site_id/external-sync",tag:"sites",summary:"Synchronize trusted CMS identity by tenant_id + cms_site_id; legacy site_url is optional and ignored. The response URL is the configured public API base or null.",status:"implemented",request_body_schema:"ExternalSyncSiteRequestSchema",response_schema:"ExternalSyncSiteResponseSchema",notes:["This trusted external entry does not require browser login or internal bearer auth; tenant_id is written directly to tenants.id and the response uses the internal { code, data, message } success envelope."]},{method:"POST",path:"/internal/sites/:site_id/page-templates",tag:"page-templates",summary:"Accept 1\u20133 Page Template items as one asynchronous Workspace task (HTTP 202).",status:"implemented",request_body_schema:"PageTemplateCreateRequestSchema",response_schema:"PageTemplateCreateResponseSchema",notes:["Internal bearer plus tenant context; API starts one new background thread/run with its fixed system identity. Poll GET /internal/external-site-edits/:task_id; no external IDs or callbacks. Manifest-gated whole-batch success commits exactly one snapshot."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/promote",tag:"page-templates",summary:"Promote a private page template through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplatePromoteRequestSchema",response_schema:"PageTemplatePromoteResponseSchema",notes:["Internal service endpoint; uses the same bearer + tenant/user context as create and delegates to Agent with API-owned credentials."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/cleanup",tag:"page-templates",summary:"Clean up private page templates through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplateCleanupRequestSchema",response_schema:"PageTemplateCleanupResponseSchema",notes:["Internal service endpoint; cleanup remains explicit and default-template protection is enforced by the Agent lifecycle service."]},{method:"POST",path:"/sites/:site_id/snapshots",tag:"snapshots",summary:"Persist snapshot metadata without changing the current site snapshot.",status:"implemented",request_body_schema:"PersistSiteSnapshotRequestSchema",response_schema:"PersistSiteSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"Promote a site snapshot as the current workspace version.",status:"implemented",request_body_schema:"PromoteSiteSnapshotRequestSchema",response_schema:"PromoteSiteSnapshotResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/try-acquire",tag:"snapshots",summary:"Try to acquire the short-lived template-upgrade site lock.",status:"implemented",request_body_schema:"TryAcquireTemplateUpgradeLockRequestSchema",response_schema:"TryAcquireTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; lock contention returns acquired=false instead of a user-facing conflict."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/release",tag:"snapshots",summary:"Release the calling template-upgrade attempt's site lock.",status:"implemented",request_body_schema:"ReleaseTemplateUpgradeLockRequestSchema",response_schema:"ReleaseTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; release is scoped by tenant, site, operation type, and owner."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"CAS-promote a validated template-upgrade candidate and bind its accepted commit atomically.",status:"implemented",request_body_schema:"PromoteTemplateUpgradeSnapshotRequestSchema",response_schema:"PromoteTemplateUpgradeSnapshotResponseSchema",notes:["Internal agent-only endpoint; accepted_commit is never part of the public promote request or response."]},{method:"GET",path:"/internal/sites/:site_id/template-upgrade/state",tag:"snapshots",summary:"Inspect the projected tenant-scoped template-upgrade state without mutation.",status:"implemented",query_schema:"InspectTemplateUpgradeStateRequestSchema",response_schema:"InspectTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the repository path is read-only."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/prepare",tag:"snapshots",summary:"Prepare the tenant-scoped template-upgrade retry state for a target version.",status:"implemented",request_body_schema:"PrepareTemplateUpgradeStateRequestSchema",response_schema:"PrepareTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/failure",tag:"snapshots",summary:"Record a finite validation failure for the prepared template-upgrade target.",status:"implemented",request_body_schema:"RecordTemplateUpgradeFailureRequestSchema",response_schema:"RecordTemplateUpgradeFailureResponseSchema",notes:["Internal agent-only endpoint; accepts a finite error code and never raw validation output."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/success",tag:"snapshots",summary:"Reset retry state after the prepared template-upgrade target succeeds.",status:"implemented",request_body_schema:"RecordTemplateUpgradeSuccessRequestSchema",response_schema:"RecordTemplateUpgradeSuccessResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/events",tag:"snapshots",summary:"Record one bounded template-upgrade observability event.",status:"implemented",request_body_schema:"RecordTemplateUpgradeEventRequestSchema",response_schema:"RecordTemplateUpgradeEventResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the strict request excludes raw errors, source content, and file paths."]},{method:"GET",path:"/internal/template-upgrades/report",tag:"snapshots",summary:"Read tenant-scoped template-upgrade outcome, state, and duration aggregates.",status:"implemented",query_schema:"GetTemplateUpgradeReportQuerySchema",response_schema:"GetTemplateUpgradeReportResponseSchema",notes:["Internal endpoint; tenant identity is derived from trusted request context and all aggregates are tenant-scoped."]},{method:"GET",path:"/internal/template-upgrades/snapshot-deletions/pending",tag:"snapshots",summary:"List tenant-scoped stale template-upgrade snapshot deletions for dry-run or reconciliation.",status:"implemented",query_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema",response_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema",notes:["Defaults to retrying deleting tombstones. Including candidate snapshots is an explicit maintenance action and should use a conservative age threshold."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/abandon",tag:"snapshots",summary:"Mark an unpromoted candidate snapshot as failed.",status:"implemented",response_schema:"AbandonSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Read one tenant-scoped snapshot metadata record for a site.",status:"implemented",response_schema:"SnapshotRecordSchema"},{method:"DELETE",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Prepare two-phase deletion of a candidate snapshot and return its object key; refuses non-candidate/current/referenced snapshots.",status:"implemented",response_schema:"DeleteSiteSnapshotResponseSchema",notes:["Internal Agent authentication is required. This endpoint only creates a deleting tombstone; object removal and completion are separate steps."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/deletion/complete",tag:"snapshots",summary:"Complete deletion after the snapshot object has been removed; only accepts deleting snapshots.",status:"implemented",response_schema:"CompleteSiteSnapshotDeletionResponseSchema",notes:["Internal Agent authentication is required; callers must remove the object before completing the DB deletion."]},{method:"POST",path:"/agent-runs",tag:"agent-runs",summary:"Create an agent run for event persistence and replay.",status:"implemented",request_body_schema:"CreateAgentRunRequestSchema",response_schema:"CreateAgentRunResponseSchema"},{method:"POST",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Append one normalized AgentEvent to a run.",status:"implemented",request_body_schema:"AppendAgentEventRequestSchema",response_schema:"AppendAgentEventResponseSchema",notes:["Internal-only write surface: only internal-service callers may append, except browser (oidc) contexts may append run.failed (the WS connect-stage unlock path, equivalent to POST /agent-runs/workspace/cancel). All other oidc appends \u2014 run.finished, run.started, tool/system/progress, file/snapshot \u2014 are rejected with 403 FORBIDDEN. The browser sends user messages over the Workspace WebSocket (recorded server-side as user.message) and otherwise only reads the GET replay."]},{method:"GET",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Replay AgentEvents after a run-local sequence cursor.",status:"implemented",response_schema:"ListAgentEventsResponseSchema"},{method:"POST",path:"/agent-runs/workspace/stop",tag:"agent-runs",summary:"Request a soft stop of the active first-generation or fill-in run for a site.",status:"implemented",request_body_schema:"StopWorkspaceGenerationRequestSchema",response_schema:"StopWorkspaceGenerationResponseSchema",notes:["Browser surface with the same tenant scoping as POST /agent-runs/workspace/cancel: only the active initial_generation / fill_in run of a site in the caller's tenant is touched.","A run holding a live lease gets stop_requested_at instead of a terminal event, so it keeps the pages it already saved and closes itself: status=requested, or already_requested on a repeat (the first stop timestamp is never moved).","A run whose lease has lapsed has no process left to honour the flag, so it is closed immediately (run.failed, site lock released) and the answer is status=stopped. Nothing in flight returns no_active_run with run_id null."]},{method:"POST",path:"/internal/agent-runs/fail-stale-in-flight",tag:"agent-runs",summary:"Fail stale in-flight workspace runs (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"FailStaleInFlightWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard (Bearer VCP_AGENT_INTERNAL_TOKEN, production fail-closed); the /internal/** prefix is exempt from browser auth middleware so the guard is the sole trust boundary. Not exposed to the browser via agent-proxy; called by an external admin cron / controlled ops script."]},{method:"POST",path:"/internal/agent-runs/claim-stale-workspace-runs",tag:"agent-runs",summary:"Claim stale workspace runs for resumption (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"ClaimStaleWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard; same trust boundary as fail-stale-in-flight and not exposed to the browser.","Re-issues a fresh lease_owner (fencing token) and increments resume_count in one UPDATE for each resumable initial run; a lease expiring only means the work was interrupted, not that the run failed. Initial runs that used up WORKSPACE_MAX_RESUME_COUNT and interrupted fill-in runs are failed instead and are absent from the response."]},{method:"GET",path:"/internal/agent-runs/:run_id/context",tag:"agent-runs",summary:"Resolve run thread context (internal, Agent Runtime).",status:"implemented",response_schema:"AgentRunContextResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","Returns the run together with its thread (null = the site main thread); a run outside the tenant is 404."]},{method:"POST",path:"/internal/agent-runs/:run_id/heartbeat",tag:"agent-runs",summary:"Renew a workspace run lease (internal, Agent Runtime).",status:"implemented",request_body_schema:"WorkspaceRunHeartbeatRequestSchema",response_schema:"WorkspaceRunHeartbeatResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","One CAS UPDATE checks that the run is still in flight and that lease_owner has not been re-issued: superseded means another attempt took over and this process must stop dispatching; not_active means the run already reached a terminal state."]},{method:"POST",path:"/internal/agent-runs/:run_id/page-checkpoints",tag:"agent-runs",summary:"Register a workspace page checkpoint (internal, Agent Runtime).",status:"implemented",request_body_schema:"RegisterWorkspacePageCheckpointRequestSchema",response_schema:"WorkspacePageCheckpointSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","Idempotent on (tenant_id, run_id, page_id, attempt): a conflict returns the existing row unchanged. The object must already be written to storage \u2014 a failed registration means the page was not saved. A lease_owner that no longer matches the run is 409, and a run in a terminal state is 409."]},{method:"GET",path:"/internal/agent-runs/:run_id/page-checkpoints",tag:"agent-runs",summary:"List workspace page checkpoints (internal, Agent Runtime).",status:"implemented",response_schema:"ListWorkspacePageCheckpointsResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; returns one row per page_id (the highest attempt). A run outside the tenant returns no checkpoints."]},{method:"GET",path:"/internal/agent-runs/:run_id/run-control",tag:"agent-runs",summary:"Read workspace run control input (internal, Agent Runtime).",status:"implemented",response_schema:"WorkspaceRunControlInputResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; AgentRunRecord carries no input, so the lease owner, stop flag, resume count and fill-in inputs stored on the run row are read here. A run outside the tenant, or one that is not a workspace run, is 404."]},{method:"GET",path:"/deployments",tag:"deployments",summary:"Deployment resource summary endpoint until publish APIs land.",status:"skeleton"},{method:"GET",path:"/sites/:site_id/generation-ledger",tag:"sites",summary:"Read the stored generation ledger of a site (omitted deliverables and fill-in progress).",status:"implemented",response_schema:"SiteGenerationLedgerResponseSchema",notes:["One ledger per (tenant_id, site_id), written when an initial_generation / fill_in run.finished carries generation_ledger. A site that has never finished such a run returns ledger null with source_run_id and updated_at null."]},{method:"POST",path:"/sites/:site_id/generation/fill-in",tag:"sites",summary:"Start a fill-in run for deliverables the generation ledger still lists as omitted.",status:"implemented",request_body_schema:"StartFillInRequestSchema",response_schema:"StartFillInResponseSchema",notes:["Every target must still be listed as an unfilled omission in the site ledger; otherwise 400 FILL_IN_TARGET_NOT_OMITTED with details.target_id. A site with no ledger at all is rejected with the same code.","The site must be workspace_ready; otherwise 409 FILL_IN_NOT_AVAILABLE.","A fill-in run does not take the per-site workspace_run operation lock: while it runs the user keeps browsing. client_run_key makes the POST idempotent \u2014 repeating it returns the existing in-flight run and does not dispatch it again; another in-flight workspace run on the same site is rejected with 409 WORKSPACE_RUN_IN_FLIGHT."]},{method:"POST",path:"/sites/:site_id/workspace/runs",tag:"workspace",summary:"Start an asynchronous Workspace Agent run from the current snapshot.",status:"implemented",request_body_schema:"StartWorkspaceRunRequestSchema",response_schema:"StartWorkspaceRunResponseSchema",notes:["Long-running work must be event-driven and must not block API transactions."]},{method:"POST",path:"/sites/:site_id/workspace/attachments",tag:"workspace",summary:"Upload a chat image attachment for the Workspace conversation.",status:"implemented",response_schema:"WorkspaceAttachmentSchema",notes:["multipart/form-data with a single `file`; the response `image_url` is referenced by a `file` part of the next client message."]},{method:"POST",path:"/sites/:site_id/workspace/attachments/from-url",tag:"workspace",summary:"Capture a screenshot of a web page and store it as a chat image attachment.",status:"implemented",request_body_schema:"WorkspaceAttachmentFromUrlRequestSchema",response_schema:"WorkspaceAttachmentSchema",notes:["The screenshot becomes an ordinary attachment: same quotas, same `file` part reference, never placed on the site.","Capture runs through the ingestion service (SSRF guard, concurrency gate, Firecrawl credits)."]},{method:"GET",path:"/sites/:site_id/workspace/attachments/:attachment_id/image",tag:"workspace",summary:"Read the bytes of a chat image attachment (owner thumbnails and replay).",status:"implemented"},{method:"DELETE",path:"/sites/:site_id/workspace/attachments/:attachment_id",tag:"workspace",summary:"Delete an unsent chat image attachment.",status:"implemented",notes:["Attachments already sent with a message return 409 WORKSPACE_ATTACHMENT_BOUND."]},{method:"GET",path:"/internal/workspace-attachments/:site_id/:attachment_id",tag:"workspace",summary:"Internal side-channel for the Workspace Agent to read a chat image attachment.",status:"implemented"},{method:"GET",path:"/sites/:site_id/threads",tag:"workspace",summary:"List a site's named Agent threads (workspace conversations).",status:"implemented",response_schema:"SiteThreadListResponseSchema",notes:["The browser can only list threads that belong to the current site."]},{method:"POST",path:"/sites/:site_id/threads",tag:"workspace",summary:"Create a new named Agent thread for a site.",status:"implemented",request_body_schema:"CreateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The created thread is scoped to the current site; the browser cannot create a thread for another site."]},{method:"PATCH",path:"/sites/:site_id/threads/:thread_id",tag:"workspace",summary:"Rename or archive an Agent thread.",status:"implemented",request_body_schema:"UpdateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The server verifies the thread belongs to the current site and tenant before applying the update."]},{method:"GET",path:"/sites/:site_id/workspace/runs/active",tag:"workspace",summary:"Look up the site's current in-flight Workspace Agent run across all threads.",status:"implemented",response_schema:"ActiveWorkspaceRunResponseSchema",notes:["Scoped to the current site regardless of thread; the browser cannot query another site's active run."]},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations",tag:"agent/workspace",summary:"Create or replay a deterministic FORM_SPEC save operation.",status:"implemented",request_body_schema:"FormDesignSaveRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id",tag:"agent/workspace",summary:"Read a persisted FORM_SPEC save operation.",status:"implemented",response_schema:"FormDesignOperationResponseSchema"},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id/resume",tag:"agent/workspace",summary:"Resume a recoverable FORM_SPEC save with its original fingerprint.",status:"implemented",request_body_schema:"FormDesignResumeRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/sites/:site_id/workspace/runs/latest",tag:"workspace",summary:"Look up the latest workspace Agent run for a site so Step 4 re-entry can replay persisted events without re-triggering the model.",status:"implemented",response_schema:"LatestWorkspaceRunResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/preview-sessions",tag:"sandbox-sessions",summary:"Persist or update an Agent-owned on-demand preview session; optional current/ready-session guards support current-snapshot CAS and guarded in-place snapshot advance.",status:"implemented",request_body_schema:"PersistPreviewSessionRequestSchema",response_schema:"PersistPreviewSessionResponseSchema"},{method:"GET",path:"/sites/:site_id/preview-sessions/current",tag:"sandbox-sessions",summary:"Read the latest tenant-scoped preview session for a site.",status:"implemented",response_schema:"SandboxSessionSchema"},{method:"POST",path:"/sites/:site_id/preview/activate",tag:"site-preview",summary:"Activate the existing preview sandbox for a site.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/v1/agent/site-preview/:site_id/activate",tag:"agent/site-preview",summary:"Activate the existing preview sandbox for a site through Agent.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/sites/:site_id/deployments",tag:"deployments",summary:"Queue an explicit user-confirmed publish from the latest current snapshot.",status:"implemented",request_body_schema:"CreateDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema",notes:["The server resolves the latest current snapshot and validates site and snapshot existence, in-flight deployment state, and site operation lock before creating the deployment record and queue job.","The API returns after creating the deployment record and queue job; worker-service claims deployment_jobs for build and Cloudflare publish."]},{method:"POST",path:"/sites/:site_id/deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment from a snapshot.",status:"implemented",request_body_schema:"CreateQualityCheckDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/quality-check/status",tag:"deployments",summary:"Read the latest quality-check deployment status.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"POST",path:"/internal/site-deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/quality-check/status",tag:"deployments",summary:"Read the latest internal quality-check deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"POST",path:"/internal/site-deployments/publish",tag:"deployments",summary:"Queue a publish deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the latest current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/publish/status",tag:"deployments",summary:"Read the latest internal publish deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"GET",path:"/sites/:site_id/deployments/current",tag:"deployments",summary:"Read the latest deployment for workspace refresh recovery.",status:"implemented",response_schema:"CurrentDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/status",tag:"deployments",summary:"Read current in-flight deployment and latest released deployment.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/:deployment_id",tag:"deployments",summary:"Read one tenant-scoped deployment for status polling.",status:"implemented",response_schema:"GetDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"List CMS collections for a site.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"Create a CMS collection bound to generated content.",status:"planned"},{method:"GET",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"List CMS entries for a collection.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"Create a CMS entry.",status:"planned"},{method:"PATCH",path:"/sites/:site_id/cms/collections/:collection_id/entries/:entry_id",tag:"cms",summary:"Update a CMS entry.",status:"planned"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/version-record",tag:"versions",summary:"Record the sandbox accepted git commit for a promoted snapshot version.",status:"implemented",request_body_schema:"RecordSnapshotVersionRequestSchema",response_schema:"RecordSnapshotVersionResponseSchema"},{method:"GET",path:"/sites/:site_id/versions",tag:"versions",summary:"List snapshot-backed site versions.",status:"implemented",response_schema:"ListSiteVersionsResponseSchema"},{method:"POST",path:"/sites/:site_id/versions/:snapshot_id/restore",tag:"versions",summary:"Restore a site to an earlier snapshot version.",status:"implemented",response_schema:"RestoreSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/domains/configuration",tag:"custom-domains",summary:"Read the authoritative site domain configuration.",status:"implemented",response_schema:"GetSiteDomainConfigurationResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/active-domain",tag:"internal/active-domain",summary:"Read whether an internal site has an active primary domain.",status:"implemented",response_schema:"GetActiveSiteDomainResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/check",tag:"publish-workflow",summary:"Check a publish workflow domain and start its operation.",status:"implemented",request_body_schema:"CheckSitePublishDomainRequestSchema",response_schema:"CheckSitePublishDomainResponseSchema"},{method:"GET",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation",tag:"publish-workflow",summary:"Read the current publish workflow domain operation.",status:"implemented",response_schema:"GetSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation/reconcile",tag:"publish-workflow",summary:"Recover or reconcile the current publish workflow domain operation.",status:"implemented",response_schema:"ReconcileSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/remediation/confirm",tag:"publish-workflow",summary:"Confirm the current DNS remediation plan.",status:"implemented",request_body_schema:"ConfirmSitePublishDomainRemediationRequestSchema",response_schema:"ConfirmSitePublishDomainRemediationResponseSchema"},{method:"POST",path:"/sites/:site_id/integrations/gsc/auth/start",tag:"gsc",summary:"Start Google Search Console authorization for a site.",status:"implemented",request_body_schema:"StartGscAuthRequestSchema",response_schema:"StartGscAuthResponseSchema"},{method:"GET",path:"/sites/:site_id/integrations/gsc/status",tag:"gsc",summary:"Read Google Search Console authorization and property status.",status:"implemented",response_schema:"GscStatusResponseSchema"},{method:"GET",path:"/admin/tenants",tag:"admin",summary:"Admin tenant listing.",status:"planned"},{method:"GET",path:"/usage/summary",tag:"usage",summary:"Summarize tenant usage and cost controls.",status:"planned"},{method:"GET",path:"/sites/:site_id/publish-workflow/active",tag:"publish-workflow",summary:"Read the active site publish workflow.",status:"implemented",response_schema:"SitePublishWorkflowActiveResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/start",tag:"publish-workflow",summary:"Start or recover the site publish workflow.",status:"implemented",request_body_schema:"StartSitePublishWorkflowRequestSchema",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/repair-task",tag:"publish-workflow",summary:"Idempotently create the publish repair task.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"GET",path:"/sites/:site_id/publish-workflow/:workflow_id",tag:"publish-workflow",summary:"Read and reconcile a site publish workflow quality task.",status:"implemented",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"PATCH",path:"/sites/:site_id/publish-workflow/:workflow_id/step",tag:"publish-workflow",summary:"Move the site publish workflow to an allowed step.",status:"implemented",request_body_schema:"UpdateSitePublishWorkflowStepRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/cancel",tag:"publish-workflow",summary:"Cancel a stable site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/publish",tag:"publish-workflow",summary:"Start formal publishing for a site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowPublishResponseSchema"}],CG=[{method:"POST",path:"/v1/agent/clarify/:site_id",tag:"clarify",summary:"Stream Step 2 clarify questions as SSE; event_order includes optional skill.selecting, skill.selected, clarify.archetype_proposals, and run.failed on errors.",status:"implemented",request_body_schema:"ClarifyRunInputSchema without tenant_id/site_id",event_schema:"ClarifyStreamEventSchema",event_order:["run.started","skill.selecting","skill.selected","clarify.partial","clarify.archetype_proposals","clarify.finished","run.failed"]},{method:"POST",path:"/v1/agent/sitemap/:site_id",tag:"sitemap",summary:"Stream Step 3 sitemap generation as SSE; event_order includes sitemap.partial and run.failed on errors.",status:"implemented",request_body_schema:"Step5SitemapStartRequestSchema (browser marker only; API injects committed Step5 strategy)",event_schema:"SitemapStreamEventSchema",event_order:["run.started","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","run.failed"]}],QI=t.object({id:t.string().min(1),role:t.enum(["system","user","assistant"]),metadata:t.unknown().optional(),parts:t.array(gs).min(1)}),Hp=QI.extend({role:t.literal("user")}).superRefine((e,n)=>{let i=0;for(let[s,o]of e.parts.entries()){if(o.type!=="file")continue;i+=1;let a=o;ao.safeParse(a.mediaType).success||n.addIssue({code:"custom",path:["parts",s,"mediaType"],message:"Attachment mediaType must be image/png, image/jpeg or image/webp"}),(typeof a.url!="string"||ro(a.url)===null)&&n.addIssue({code:"custom",path:["parts",s,"url"],message:"Attachment url must be a workspace attachment image path"})}i>oo&&n.addIssue({code:"custom",path:["parts"],message:`A message may carry at most ${oo} attachments`})}),DG=t.object({base_snapshot_id:A.optional(),intent:t.literal("navigation_adaptation").optional(),message:Hp.optional(),thread_id:tt.optional(),client_run_key:t.string().min(1).max(200).optional()}).superRefine((e,n)=>{oi(e.message)&&n.addIssue({code:"custom",path:["message"],message:"Workspace startup message must not contain secrets",params:{errorCode:"WORKSPACE_MESSAGE_CONTAINS_SECRET"}})}),ZI=t.object({path:t.string().regex(/^\/v1\/workspace\/sites\/[^/]+\/socket$/),run_id:V,base_snapshot_id:A,run_kind:fs}),OG=t.object({agent_run:et,websocket:ZI,next_step:t.literal("workspace_socket")}),NG=t.object({agent_run:et}),jG=t.object({thread_id:tt.optional()}),LG=t.object({agent_run:et.nullable(),thread:hs.nullable()}),MG=t.object({status:Ep.default("active")}),UG=t.object({threads:t.array(hs)}),FG=t.object({title:t.string().trim().min(1).max(200)}).strict(),GG=t.object({title:t.string().trim().min(1).max(200).optional(),status:t.literal("archived").optional()}).strict().refine(e=>e.title!==void 0||e.status!==void 0,{message:"title or status is required"}),qG=t.object({thread:hs}),WG=t.object({agent_type:t.enum(["clarify","sitemap","workspace"]),thread_id:tt.optional()}),KG=t.object({agent_run:et}),BG=t.enum(["client.message.create","client.resource.operation.create","client.run.cancel","client.tool.approve","server.run.started","server.user.message","server.assistant.delta","server.tool.started","server.tool.completed","server.workspace.suggestions","workspace.plan.created","workspace.worker.updated","workspace.task.updated","server.patch.applied","server.sitemap.updated","server.snapshot.created","server.snapshot.finalized","server.preview.invalidated","preview.build.started","preview.build.succeeded","preview.build.failed","server.run.finished","server.run.failed","server.error","server.activity.started","server.activity.updated","server.activity.finished","server.activity.failed"]),le=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:k,run_id:V.optional(),correlation_id:t.string().min(1).optional(),seq:t.number().int().positive().optional(),sent_at:t.string().min(1)}),JI=t.object({key:t.string().min(1),label:t.string().min(1),source_file:t.string().min(1).optional(),component_name:t.string().min(1).optional(),opening_element_range:t.object({start_line:t.number().int().positive(),start_column:t.number().int().nonnegative(),end_line:t.number().int().positive(),end_column:t.number().int().nonnegative()}).optional(),structural_path:t.string().min(1).optional(),text_preview:t.string().min(1).optional()}),eT=t.discriminatedUnion("type",[le.extend({type:t.literal("client.message.create"),payload:t.object({client_message_id:t.string().min(1),in_reply_to_tool_call_id:t.string().min(1).optional(),current_route_id:Un.optional(),interaction_response:vi.optional(),selected_component:JI.optional(),intent:t.literal("navigation_adaptation").optional(),display_text:t.string().min(1).max(4e3).optional(),message:Hp,base_snapshot_id:A.optional()}).superRefine((e,n)=>{e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"})})}),le.extend({type:t.literal("client.run.cancel"),payload:t.object({run_id:V,reason:t.string().min(1).optional()})}),le.extend({type:t.literal("client.tool.approve"),payload:t.object({tool_call_id:t.string().min(1),decision:t.enum(["approve","reject"]),reason:t.string().min(1).optional()})}),gc]),tT=t.discriminatedUnion("type",[le.extend({type:t.literal("server.run.started"),payload:t.object({run_id:V,agent_type:t.literal("workspace")})}),le.extend({type:t.literal("server.user.message"),payload:t.object({client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(gs).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:vi.optional()})}),le.extend({type:t.literal("server.assistant.delta"),payload:t.object({message_id:t.string().min(1),parts:t.array(gs).min(1),status:t.enum(["streaming","ready"])})}),le.extend({type:t.literal("server.tool.started"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1)})}),le.extend({type:t.literal("server.tool.completed"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:so.optional()})}),le.extend({type:t.literal("server.workspace.suggestions"),payload:qp.extend({run_id:V}).strict()}),le.extend({type:t.literal("workspace.plan.created"),payload:t.object({plan_id:t.string().min(1),run_kind:fs,groups:t.array(Da),tasks:t.array(Oa),dependencies:t.array(Na),expected_outputs:t.array(Pe),diagnostics:Ca,summary:Kp})}),le.extend({type:t.literal("workspace.worker.updated"),payload:t.object({group_id:t.string().min(1),phase:Pa,status:Vt,task_counts:Bp,target_paths:t.array(Pe),diagnostics:t.array(t.string().min(1))})}),le.extend({type:t.literal("workspace.task.updated"),payload:t.object({task_id:t.string().min(1),group_id:t.string().min(1),status:Vt,target_path:Pe,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(va).optional()})}),le.extend({type:t.literal("server.patch.applied"),payload:t.object({patch_batch_id:t.string().min(1),changed_files:t.array(t.string().min(1)),sitemap_resync_queued:t.boolean()})}),le.extend({type:t.literal("server.sitemap.updated"),payload:t.object({sitemap_id:Te,version:t.number().int().positive(),reason:t.string().min(1)})}),le.extend({type:t.literal("server.snapshot.created"),payload:t.object({snapshot_id:A,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/)})}),le.extend({type:t.literal("server.snapshot.finalized"),payload:t.object({snapshot_id:A})}),le.extend({type:t.literal("server.preview.invalidated"),payload:t.object({reason:t.string().min(1),next_preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()})}),le.extend({type:t.literal("preview.build.started"),payload:t.object({snapshot_id:A})}),le.extend({type:t.literal("preview.build.succeeded"),payload:t.object({snapshot_id:A})}),le.extend({type:t.literal("preview.build.failed"),payload:t.object({snapshot_id:A,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean()})}),le.extend({type:t.literal("server.run.finished"),payload:t.object({run_id:V,snapshot_id:A,degraded_reason:Rn.optional(),build_verified:t.boolean().optional()})}),le.extend({type:t.literal("server.run.failed"),payload:t.object({run_id:V,error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional()})}),le.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})}),le.extend({type:t.literal("server.activity.started"),payload:t.object({activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:kp,title:t.string().min(1).max(200),title_code:Nt.optional(),detail:t.string().max(360).optional(),detail_code:Nt.optional(),locks_input:t.boolean()})}),le.extend({type:t.literal("server.activity.updated"),payload:t.object({activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),title_code:Nt.optional(),detail:t.string().max(360).optional(),detail_code:Nt.optional()})}),le.extend({type:t.literal("server.activity.finished"),payload:t.object({activity_id:t.string().min(1)})}),le.extend({type:t.literal("server.activity.failed"),payload:t.object({activity_id:t.string().min(1),detail:t.string().max(360).optional()})})]),nT=tT.superRefine((e,n)=>{if(e.type==="server.user.message"&&e.payload.interaction_response&&!e.payload.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["payload","in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type!=="server.tool.completed")return;let i=e.payload.name==="prepare_product_search_entry";i!==!!e.payload.interaction_request&&n.addIssue({code:"custom",path:["payload","interaction_request"],message:i?"prepare_product_search_entry requires interaction_request":"interaction_request is only valid for prepare_product_search_entry"})}),zG=t.union([eT,nT]),HG={path:"/v1/workspace/sites/:site_id/socket",protocol:"ws",status:"implemented",inbound_message_schema:"WorkspaceClientMessageSchema",outbound_message_schema:"WorkspaceServerMessageSchema",query_parameters:[{name:"run_id",required:!1,schema:"string",summary:"Workspace run id returned by the API run-start response."},{name:"run_kind",required:!1,schema:"WorkspaceRunKindSchema",summary:"Workspace run mode; initial_generation can auto-start when base_snapshot_id is present."},{name:"base_snapshot_id",required:!1,schema:"string",summary:"Authoritative base snapshot id for this workspace run."},{name:"unattended",required:!1,schema:'"1"',summary:"Unattended mode for machine-driven runs: interactive tools are withheld so the run cannot stall waiting for a human answer. Server-to-server only; the browser proxy strips it."}],ai_sdk_ui_compatible:!0,notes:["Assistant UI output is carried as AI SDK UIMessage parts, including text, data-*, and tool-* parts.","Operational AgentEvents remain persisted separately for replay and audit."]},Vp=t.string().regex(/^sha256:[a-f0-9]{64}$/),iT=t.enum(["create","update","delete","str_replace"]),$p=t.enum(["sitemap_resync","smoke_test","prepare_preview"]),sT=t.object({old_string:t.string().min(1).describe("Exact text to find in the current file. Must match the file uniquely; include enough surrounding context (usually 2-4 adjacent lines)."),new_string:t.string().describe("Replacement text. May be empty to delete the matched text."),replace_all:t.boolean().optional()}).strict(),oT=t.object({path:Pe,operation:iT,expected_hash:Vp.optional(),full_content:t.string().describe("Complete file content for create/update patches. Only this single field is a string value: every double quote inside the source code must be escaped so the field stays valid JSON. Avoid ASCII double quotes inside JSX attribute values and use corner quotes like \u300C\u751F\u65E5\u5FEB\u4E50\u300D for visitor-facing quoted examples. The surrounding patch object and the patches array are ordinary JSON structures, not strings.").optional(),edits:t.array(sT).min(1).max(20).optional()}).strict().superRefine((e,n)=>{let i=e.full_content!==void 0;if(e.operation==="delete"){i&&n.addIssue({code:"custom",path:["full_content"],message:"delete patches must not include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"});return}if(ST(e.path)||n.addIssue({code:"custom",path:["path"],message:"Static App Router page paths must use lowercase ASCII kebab-case public segments."}),e.operation==="str_replace"){e.full_content!==void 0&&n.addIssue({code:"custom",path:["full_content"],message:"str_replace patches must not include full_content"}),(!e.edits||e.edits.length===0)&&n.addIssue({code:"custom",path:["edits"],message:"str_replace patches must include a non-empty edits array"});return}i||n.addIssue({code:"custom",path:["full_content"],message:"create/update patches must include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"})}),aT=t.object({kind:t.enum(["block","page","site","chrome"]),id:t.string().min(1).max(120)}),rT=t.object({base_key:t.string().min(1).max(120).regex(/^[A-Za-z0-9._:-]+$/).refine(e=>!e.includes(".."),{message:"base_key must not contain '..'"}),owner:aT,count:t.number().int().min(1).max(12),query:t.string().min(1).max(400),role:t.enum(["hero","section","card","gallery","testimonial","decorative","site_background","nav_background","footer_background"]),orientation:t.enum(["landscape","portrait","square"]).optional(),altHint:t.string().min(1).max(300)}),Yp=t.object({site_id:k,base_snapshot_id:A,reason:t.string().min(1),patches:t.array(oT).min(1).describe("A real JSON array of patch objects. Never JSON.stringify this array, and never put an encoded JSON array inside a string \u2014 emit the array itself. Only full_content within a patch object is a string field."),media_requests:t.array(rT).max(24).optional(),post_actions:t.array($p).optional()});function Xp(e,n){let i=new Set;for(let[s,o]of e.patches.entries())i.has(o.path)&&n.addIssue({code:"custom",path:["patches",s,"path"],message:`Duplicate patch path: ${o.path}`}),i.add(o.path)}var VG=Yp.superRefine(Xp),$G=Yp.omit({base_snapshot_id:!0}).extend({site_id:k.optional()}).superRefine(Xp),cT=xe,mT=t.object({path:cT,operation:t.enum(["upsert","delete"]).optional()}),Qp=t.enum(["sync_cms_pages","sync_cms_navigation"]),YG=t.object({files:t.array(mT).min(1),post_actions:t.array(Qp).optional()}).strict().overwrite(e=>e.post_actions?{...e,post_actions:[...new Set(e.post_actions)]}:e),lT=t.enum(["BASE_SNAPSHOT_NOT_FOUND","PATCH_TARGET_NOT_FOUND","PATCH_TARGET_ALREADY_EXISTS","PATCH_EXPECTED_HASH_MISMATCH","PATCH_DIFF_UNSUPPORTED","PATCH_PROTECTED_FILE","PATCH_VALIDATION_FAILED","PATCH_MEDIA_REFERENCE_NOT_DECLARED","PATCH_BATCH_INVALID","PATCH_BATCH_FAILED","PATCH_BATCH_TOO_LARGE","STR_REPLACE_NOT_FOUND","STR_REPLACE_NOT_UNIQUE","STR_REPLACE_BINARY_FILE","STR_REPLACE_REQUIRES_READ","GLOBALS_CSS_EDIT_REJECTED"]),pT=t.object({status:t.literal("applied"),patch_batch_id:t.string().min(1),site_id:k,base_snapshot_id:A,snapshot_id:A,manifest_hash:Vp,object_key:t.string().min(1),changed_files:t.array(Pe).min(1),post_actions_queued:t.array($p),dropped_protected_files:t.array(t.string().min(1)).min(1).optional()}),dT=t.object({status:t.literal("failed"),code:lT,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),XG=t.discriminatedUnion("status",[pT,dT]),QG=t.object({ok:t.literal(!0),post_actions:t.array(t.object({action:Qp,status:t.enum(["succeeded","failed"])}).strict()).default([])}),Zp=xe,uT=t.enum(["text","binary"]),Jp=t.object({path:Zp,kind:uT,language:t.string().min(1).nullable(),size_bytes:t.number().int().nonnegative()}),ZG=t.object({path:Zp}),_T=Jp.extend({kind:t.literal("text"),language:t.string().min(1),content:t.string()}),gT=Jp.extend({kind:t.literal("binary"),language:t.null(),mime_type:t.string().min(1),content_base64:t.string().min(1)}),JG=t.union([_T,gT]);function oi(e){return typeof e=="string"?/authorization\s*:|bearer\s+|token\s*=|secret\s*=|api[_-]?key\s*=|access[_\s-]?key\s*=|\bsk-[a-z0-9_-]{20,}|eyJ[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}/i.test(e):!e||typeof e!="object"?!1:Array.isArray(e)?e.some(n=>oi(n)):Object.entries(e).some(([n,i])=>hT(n)||oi(i))}function hT(e){let n=e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/\s+/g,"_").toLowerCase();return/(^|[_-])(authorization|token|secret|api[_-]?key|apikey|access[_-]?key|accesskey)([_-]|$)/.test(n)}function ed(e){let n=e.split("/");return e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&n.every(i=>i!==""&&i!=="."&&i!=="..")}function ST(e){if(/^(?:src\/)?app\/\.vcp\//.test(e))return mi(e);let n=/^app\/(?:(.*)\/)?page\.(?:tsx|jsx)$/.exec(e);if(!n)return!0;let s=(n[1]??"").split("/").filter(a=>a.length>0);return s.some(a=>a.startsWith("_"))?!0:s.filter(a=>!a.startsWith("@")&&!/^\(.+\)$/.test(a)).map(a=>a.replace(/^\((?:\.|\.\.|\.\.\.)\)/,"")).filter(a=>a.length>0).every(a=>/^\[.*\]$/.test(a)||On.test(`/${a}`))}var td=t.enum(["idle","creating","restoring_snapshot","installing_dependencies","starting_preview","ready","active","stopping","stopped","failed"]),fT=t.object({id:ai,tenant_id:t.string().min(1),site_id:k,sandbox_id:t.string().min(1).nullable(),status:td,source_snapshot_id:A.nullable(),last_snapshot_id:A.nullable(),preview_url:t.string().url().nullable(),browser_preview_url:t.string().url().nullable().optional(),launch_id:t.string().min(1).nullable().optional(),last_activity_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),eq=t.object({session_id:ai.optional(),sandbox_id:t.string().min(1).optional(),source_snapshot_id:A.optional(),last_snapshot_id:A,expected_current_snapshot_id:A.optional(),expected_ready_session_id:ai.optional(),expected_ready_session_last_snapshot_id:A.optional(),status:td,preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()}),tq=t.object({preview_session:fT,next_step:t.literal("preview")}),nq=t.object({failed_count:t.number().int().nonnegative()}),iq=t.object({site_id:k}),sq=t.object({status:t.enum(["cancelled","stop_requested","no_active_run"]),agent_run:et.nullable()});export{Pm as AESTHETIC_NOTE_MAX_LENGTH,$E as AI_IMAGE_GENERATION_ENTITLEMENT,hn as AI_IMAGE_GENERATION_MAX_QUANTITY,Eb as APPLICATION_LIBRARY_ERROR_CODES,uF as AbandonSiteSnapshotResponseSchema,$x as ActiveSiteDomainDataSchema,LG as ActiveWorkspaceRunResponseSchema,kp as ActivityKindSchema,Nt as ActivityTitleCodeSchema,P1 as AdvanceSiteWorkflowRequestSchema,fp as AgentErrorCategorySchema,Ma as AgentEventIdSchema,Sa as AgentEventRecordSchema,zp as AgentEventSchema,Wp as AgentEventTypeSchema,jI as AgentMessageHistoryPurposeSchema,xp as AgentModelRouteSchema,LI as AgentPlanStepSchema,aF as AgentRunContextResponseSchema,V as AgentRunIdSchema,yp as AgentRunKindSchema,et as AgentRunRecordSchema,wR as AgentRunStatusSchema,bp as AgentRunTypeSchema,tt as AgentThreadIdSchema,PR as AgentThreadKindSchema,vR as AgentThreadOriginSchema,hs as AgentThreadRecordSchema,Ep as AgentThreadStatusSchema,YE as AiImageGenerationPrecheckRequestSchema,XE as AiImageGenerationPrecheckResponseSchema,_a as AiImageGenerationQuotaSchema,KI as AiSdkUiDataPartSchema,zI as AiSdkUiErrorPartSchema,GI as AiSdkUiFilePartSchema,gs as AiSdkUiMessagePartSchema,QI as AiSdkUiMessageSchema,FI as AiSdkUiReasoningPartSchema,WI as AiSdkUiSourceDocumentPartSchema,qI as AiSdkUiSourceUrlPartSchema,HI as AiSdkUiStepStartPartSchema,UI as AiSdkUiTextPartSchema,BI as AiSdkUiToolPartSchema,wG as ApiContractStatusSchema,UR as ApiErrorEnvelopeSchema,L as ApiResponseSchema,RG as AppendAgentEventRequestSchema,IG as AppendAgentEventResponseSchema,fN as ApplicationCreateResponseSchema,Ab as ApplicationLibraryApplicationSchema,bN as ApplicationLibraryApplicationsDataSchema,Lm as ApplicationLibraryErrorCodeSchema,xN as ApplicationLibraryErrorResponseSchema,yN as ApplicationLibraryTemplatesDataSchema,Um as ApplicationTemplateCatalogDataSchema,Rb as ApplicationTemplateCatalogItemSchema,xb as ApplicationTemplateConsumeDataSchema,SN as ApplicationTemplateCreateRequestSchema,Tb as ApplicationTemplateCreateResponseSchema,Ib as ApplicationTemplateCreatedApplicationSchema,Xi as ApplicationTemplateDigestSchema,hb as ApplicationTemplateFieldSchema,yb as ApplicationTemplateReferenceSchema,kb as ApplicationTemplateSourceSchema,Qi as ApplicationTemplateStableKeySchema,Wo as ApplicationTemplateV1Schema,lT as ApplyPatchBatchErrorCodeSchema,dT as ApplyPatchBatchFailureSchema,VG as ApplyPatchBatchInputSchema,oT as ApplyPatchBatchPatchSchema,$p as ApplyPatchBatchPostActionSchema,XG as ApplyPatchBatchResultSchema,pT as ApplyPatchBatchSuccessSchema,$G as ApplyPatchBatchToolInputSchema,sT as ApplyPatchEditSchema,iT as ApplyPatchOperationSchema,Sp as ArchetypeProposalSchema,OT as AuditLogIdSchema,xT as AuthIdentityIdSchema,TT as AuthLoginCodeIdSchema,IT as AuthOidcStateIdSchema,ET as AuthSessionIdSchema,RT as AuthTokenIdSchema,kT as AuthWsTicketIdSchema,Py as BINDING_STATUSES,Ap as BlockGenerationContextSchema,pi as BlockInteractionSchema,zF as BlockMediaIntentSchema,Ta as BlockSchema,cS as BlockingSubsiteSchema,wp as BrandingSchema,$t as BriefIdSchema,Ea as BriefRecordSchema,Za as BusinessFactsSchema,MC as CHAT_COPY,LC as CLARIFICATION_COPY,ty as CMS_FORM_FIELD_TYPES,Sm as CMS_MAIN_PRODUCTS_MAX_LENGTH,Pu as CMS_PAGE_DIRECTORY_MAX_DEPTH,wu as CMS_PAGE_DIRECTORY_MAX_NODES,Ar as CMS_PAGE_URL_PATH_MAX_LENGTH,ov as COMPONENT_I18N_FILE_SUFFIX,Mi as COMPONENT_I18N_NAMESPACE,Sd as CONVERSION_CTA_LABEL_MAX_LENGTH,$y as CRAWLER_INTERNAL_ERROR_CODES,dm as CURRENT_EDIT_ENGINE_VERSION,iq as CancelActiveWorkspaceRunRequestSchema,sq as CancelActiveWorkspaceRunResponseSchema,Dl as CheckSitePublishDomainDataSchema,Gx as CheckSitePublishDomainRequestSchema,qx as CheckSitePublishDomainResponseSchema,Pp as ChromeDesignSchema,QR as ChromeFooterDesignSchema,XR as ChromeFooterShellSchema,$R as ChromeHeaderDesignSchema,VR as ChromeHeaderShellSchema,ZR as ChromeMobileNavDesignSchema,ZP as ClaimStaleWorkspaceRunsResponseSchema,kR as ClarifyQuestionOptionSchema,AR as ClarifyQuestionSchema,RR as ClarifyQuestionTypeSchema,ya as ClarifyQuestionsSchema,CU as ClarifyRunInputSchema,ja as ClarifySessionIdSchema,PI as ClarifySessionRecordSchema,DU as ClarifyStreamEventSchema,wN as CmsApplicationCoreInputSchema,PN as CmsApplicationCoreResultSchema,vN as CmsApplicationSeedInputSchema,CN as CmsApplicationSeedResultSchema,NT as CmsCollectionBindingIdSchema,Pj as CmsCollectionBindingSchema,Qm as CmsFormSchemaProjectionSchema,Gs as CmsManagedPageTypeSchema,eU as CmsNavigationActionSchema,JM as CmsNavigationCapabilitiesResponseSchema,SR as CmsNavigationCapabilitiesSchema,mp as CmsNavigationCreateGroupBodySchema,_R as CmsNavigationCreateItemBodySchema,ZM as CmsNavigationDefaultGroupBodySchema,dR as CmsNavigationEditorContextSchema,QM as CmsNavigationEditorResponseSchema,pR as CmsNavigationGroupSchema,cp as CmsNavigationItemSchema,hR as CmsNavigationMoveItemBodySchema,uR as CmsNavigationPatchGroupBodySchema,gR as CmsNavigationPatchItemBodySchema,op as CmsNavigationTargetTypeSchema,Du as CmsPageDirectoryGroupSchema,wr as CmsPageDirectoryNodeSchema,Tr as CmsPageDirectorySchema,qs as CmsPageTypeSchema,pt as CmsPageUrlPathSchema,$0 as CmsSeoSyncStateSchema,lr as CmsSiteIdSchema,zy as CompanyInfoSchema,Hj as CompanyInfoTaskCreateRequestSchema,Vj as CompanyInfoTaskCreateResponseSchema,$j as CompanyInfoTaskResponseSchema,kO as CompleteCustomerMaterialsRequestSchema,AO as CompleteDiagnosisRequestSchema,C1 as CompleteQualityOnlyWorkflowRequestSchema,gF as CompleteSiteSnapshotDeletionResponseSchema,v1 as CompleteSiteWorkflowRequestSchema,wO as CompleteStrategyRequestSchema,TO as CompleteWebsiteScanRequestSchema,rv as ComponentI18nResourcesSchema,aA as ComposeDesignerPageResourceBodySchema,qT as ComputeSnapshotEditChangesRequestSchema,WT as ComputeSnapshotEditChangesResponseSchema,Kx as ConfirmSitePublishDomainRemediationDataSchema,Wx as ConfirmSitePublishDomainRemediationRequestSchema,Bx as ConfirmSitePublishDomainRemediationResponseSchema,pG as ConfirmSiteStructureRequestSchema,uN as ConnectDynamicCollectionInputSchema,FN as ConnectFormInputSchema,Mt as ConversionHintsSchema,Yy as CrawlerInternalErrorCodeSchema,Yj as CrawlerInternalErrorSchema,dn as CrawlerTaskCodeSchema,Mj as CrawlerTaskCreateRequestSchema,Gj as CrawlerTaskCreateResponseSchema,My as CrawlerTaskFailureErrorCodeSchema,dl as CrawlerTaskFailureStageSchema,Fy as CrawlerTaskPageSchema,Uj as CrawlerTaskPagesQuerySchema,Kj as CrawlerTaskPagesResponseSchema,Wj as CrawlerTaskStatusResponseSchema,zt as CrawlerTaskUuidSchema,KF as CreateAgentRunConflictResponseSchema,rF as CreateAgentRunRequestSchema,cF as CreateAgentRunResponseSchema,NF as CreateDeploymentRequestSchema,NR as CreateDeploymentResponseSchema,Tk as CreateDocumentUploadRequestSchema,FT as CreateExternalSiteEditRequestSchema,KT as CreateExternalSiteEditResponseSchema,Ck as CreateImageUploadRequestSchema,yk as CreateInputSourceRequestSchema,jF as CreateQualityCheckDeploymentRequestSchema,GU as CreateSiteBriefRequestSchema,nF as CreateSiteBriefResponseSchema,qU as CreateSiteDraftRequestSchema,FU as CreateSiteInputSchema,FG as CreateSiteThreadRequestSchema,A1 as CreateSiteWorkflowRequestSchema,Ad as CreateTextInputSourceRequestSchema,wd as CreateUrlInputSourceRequestSchema,MF as CurrentDeploymentResponseSchema,bO as CustomerMaterialsDraftResponseSchema,Do as CustomerMaterialsDraftSchema,yO as CustomerMaterialsNullableResponseSchema,Oo as CustomerMaterialsRecordSchema,fO as CustomerMaterialsResponseSchema,Zf as CustomerMaterialsStatusSchema,kh as DEFAULT_FONTS,Em as DEFAULT_SITE_DESIGN_RADIUS_ID,Jd as DEFAULT_SITE_LOCALE,$C as DEFAULT_SUBSITE_PALETTE,Ni as DEFAULT_WEIGHT_STYLE_ID,Bw as DEPLOYMENT_ACTIVE_STATUSES,kt as DEPLOYMENT_LIFECYCLE_TRANSITIONS,Lg as DEPLOYMENT_PROGRESS_STEP_CODES,MR as DEPLOYMENT_REALTIME_CHANNEL,Yt as DEPLOYMENT_STATUSES,zw as DEPLOYMENT_TERMINAL_STATUSES,yh as DEPLOYMENT_TRANSITION_ERROR_CODE,WF as DEPLOYMENT_WEBSOCKET_CONTRACT,P0 as DESIGNER_COMPONENT_LIBRARY_ERROR_CODES,tA as DESIGNER_PAGE_LIBRARY_ERROR_CODES,xk as DOCUMENT_EXTENSION_WHITELIST,Ek as DOCUMENT_MIME_WHITELIST,gx as DOMAIN_DNS_PURPOSES,fx as DOMAIN_DNS_REMEDIATION_STATUSES,hx as DOMAIN_DNS_VERIFICATION_STATUSES,px as DOMAIN_OBSERVED_STATUSES,ux as DOMAIN_ROUTING_MODES,B0 as DeleteDesignerPageErrorDetailsSchema,G0 as DeleteDesignerPageRequestSchema,q0 as DeleteDesignerPageResponseSchema,Gu as DeleteDesignerPageResultSchema,_F as DeleteSiteSnapshotResponseSchema,ct as DeploymentIdSchema,AT as DeploymentJobIdSchema,Mg as DeploymentProgressStepCodeSchema,Fg as DeploymentProgressStepSchema,Ug as DeploymentProgressStepStatusSchema,Pc as DeploymentProgressStepsSchema,Ot as DeploymentRecordSchema,qF as DeploymentRedisPubSubEventSchema,Ra as DeploymentStatusSchema,up as DeploymentStatusSummarySchema,_o as DeploymentTransitionError,Ip as DeploymentTypeSchema,us as DeploymentWsDeploymentPayloadSchema,GF as DeploymentWsServerMessageSchema,LR as DeploymentWsServerMessageTypeSchema,OI as DesignPlanGenerationOutcomeSchema,NI as DesignPlanGenerationReasonSchema,bs as DesignPlanIdSchema,$F as DesignPlanPatchSchema,vI as DesignPlanRecordSchema,vp as DesignPlanSchema,Me as DesignTokenBlockError,BF as DesignTokensSchema,Au as DesignerComponentCatalogItemSchema,yr as DesignerComponentCategoriesDataSchema,br as DesignerComponentCategoryNodeSchema,Gt as DesignerComponentExactVersionSchema,Er as DesignerComponentInstallDataSchema,xr as DesignerComponentsDataSchema,Hu as DesignerPageCatalogItemSchema,Lr as DesignerPageCategoriesDataSchema,jr as DesignerPageCategoryNodeSchema,Mu as DesignerPageDeleteBlockReasonSchema,Lu as DesignerPageDisabledReasonSchema,Dn as DesignerPageExactVersionSchema,Dr as DesignerPageGroupSchema,Ur as DesignerPageInstallDataSchema,Cr as DesignerPageNodeSchema,Gr as DesignerPageResourcePreparationDataSchema,zu as DesignerPageResourceSourceSchema,Ju as DesignerPageResourceTemplateSchema,qt as DesignerPageResourceTypeSchema,Mr as DesignerPagesDataSchema,Ls as DesignerResourceVersionSchema,qr as DesignerSitePagesDataSchema,iA as DesignerSiteRouteIdSchema,Al as DomainConfigurationSchema,sa as DomainDnsPurposeSchema,Ix as DomainDnsRecordSchema,Rx as DomainDnsRemediationChangeSchema,Il as DomainDnsRemediationRecordSchema,Tl as DomainDnsRemediationResultSchema,bx as DomainDnsRemediationStatusSchema,Ex as DomainDnsVerificationObservationSchema,Rl as DomainDnsVerificationResultSchema,Sx as DomainDnsVerificationStatusSchema,dx as DomainObservedStatusSchema,xx as DomainOperationErrorSchema,cs as DomainOperationSchema,yx as DomainOperationStatusSchema,oa as DomainOperationTypeSchema,kl as DomainRecordSchema,_x as DomainRoutingModeSchema,FC as EDIT_ENGINE_VERSION_HEADER,GC as EDIT_ENGINE_VERSION_SOURCE_HEADER,GT as EMPTY_EXTERNAL_SITE_EDIT_CHANGES,OC as ERROR_COPY,od as EXTERNAL_SITE_EDIT_INFRASTRUCTURE_REASONS,sd as EXTERNAL_SITE_EDIT_PROMPT_MAX_LENGTH,vo as EditEngineVersionParseError,Wr as EnhanceDesignerPageResourceBodySchema,eF as EnhanceDesignerPageResourceResponseSchema,HT as ExternalSiteEditCallbackAckSchema,zT as ExternalSiteEditCallbackPayloadSchema,ad as ExternalSiteEditCallbackStatusSchema,xs as ExternalSiteEditChangeKindSchema,Ba as ExternalSiteEditChangesSchema,Rn as ExternalSiteEditDegradedReasonSchema,Lt as ExternalSiteEditExternalIdSchema,Ga as ExternalSiteEditOutcomeSchema,gd as ExternalSiteEditPageChangeSchema,cd as ExternalSiteEditPageTypeSchema,_d as ExternalSiteEditSectionChangeSchema,ld as ExternalSiteEditSiteWideChangeSchema,md as ExternalSiteEditSiteWideKindSchema,Fa as ExternalSiteEditTaskIdSchema,ci as ExternalSiteEditTaskSchema,rd as ExternalSiteEditTaskStatusSchema,zU as ExternalSyncSiteRequestSchema,tF as ExternalSyncSiteResponseSchema,Id as ExtractedFactKindSchema,di as ExtractedFactSchema,qo as FIELD_TYPES,BP as FILL_IN_NOT_AVAILABLE_ERROR_CODE,HP as FILL_IN_TARGET_MODIFIED_ERROR_CODE,zP as FILL_IN_TARGET_NOT_OMITTED_ERROR_CODE,Wc as FONT_PAIRINGS,So as FONT_PAIRING_IDS,uy as FORM_DESIGN_ERROR_CODES,dy as FORM_DESIGN_FAILURE_STAGES,ly as FORM_DESIGN_OPERATION_STAGES,py as FORM_DESIGN_OPERATION_STATUSES,Ji as FORM_FIELD_TYPES,Wm as FORM_SCENE_CODES,Km as FORM_SCENE_UNKNOWN,Db as FORM_SHAPE_EMBEDDED,ny as FORM_SPEC_FIELD_TYPE_TO_CMS,zm as FORM_SPEC_FILE_MIN_RUNTIME_VERSION,Vb as FORM_SPEC_LOCALIZABLE_FIELD_PATHS,Bm as FORM_SPEC_MULTISTEP_MIN_RUNTIME_VERSION,QN as FORM_TEMPLATE_CATEGORY_COUNTS,XN as FORM_TEMPLATE_CATEGORY_SLUGS,nq as FailStaleInFlightWorkspaceRunsResponseSchema,Yi as FieldDeclSchema,em as FillInTargetSchema,oL as FirecrawlBatchCreateRequestSchema,aL as FirecrawlBatchCreatedResponseSchema,Zy as FirecrawlBatchErrorSchema,cL as FirecrawlBatchErrorsResponseSchema,Qy as FirecrawlBatchPageSchema,rL as FirecrawlBatchStatusResponseSchema,eL as FirecrawlCrawlCreateRequestSchema,tL as FirecrawlCrawlCreatedResponseSchema,nL as FirecrawlCrawlStatusResponseSchema,Sl as FirecrawlJobStatusSchema,Zj as FirecrawlMapRequestSchema,Jj as FirecrawlMapResponseSchema,mL as FirecrawlQueueStatusResponseSchema,iL as FirecrawlScrapeRequestSchema,sL as FirecrawlScrapeResponseSchema,YR as FooterShellSurfaceSchema,Mb as FormBlockIdSchema,ts as FormDefinitionIdSchema,ry as FormDesignAffectedFilesSchema,ta as FormDesignErrorCodeSchema,cj as FormDesignErrorSchema,el as FormDesignFailureStageSchema,pe as FormDesignHashSchema,tj as FormDesignOpenResponseSchema,cy as FormDesignOperationFingerprintInputSchema,Yo as FormDesignOperationIdSchema,tl as FormDesignOperationNextActionSchema,PT as FormDesignOperationRecordIdSchema,aj as FormDesignOperationRecordSchema,na as FormDesignOperationResponseSchema,il as FormDesignOperationSchema,ea as FormDesignOperationStageSchema,Jm as FormDesignOperationStatusSchema,rj as FormDesignOperationTransitionRequestSchema,nl as FormDesignPreviewRefreshStatusSchema,ij as FormDesignQueryResponseSchema,sj as FormDesignResumeRequestSchema,oj as FormDesignResumeResponseSchema,my as FormDesignSaveRequestSchema,nj as FormDesignSaveResponseSchema,Zm as FormDesignSharedImpactSchema,Jo as FormDesignStandardizationSchema,jb as FormFieldDeclSchema,ti as FormFieldNameSchema,Ho as FormMetadataSchema,Xo as FormOptionValueSchema,zo as FormSceneSchema,Ob as FormShapeSchema,Ub as FormSpecBindingSchema,Gb as FormSpecFieldNodeSchema,Wb as FormSpecNodeSchema,Fb as FormSpecOptionSchema,qb as FormSpecStepBreakNodeSchema,Zo as FormSpecV1Schema,ZN as FormTemplateCatalogResponseSchema,Xm as FormTemplateCategorySlugSchema,Jb as FormTemplateCategoryV1Schema,Ct as FormTemplateTextSchema,ey as FormTemplateV1Schema,iE as GA4_AUTHORIZATION_STATUSES,oE as GA4_AUTH_ATTEMPT_STATUSES,pE as GA4_BINDING_REASONS,rE as GA4_BINDING_STATUSES,mE as GA4_VERIFICATION_STATUSES,Wn as GLOBAL_DESIGN_TOKENS_END,an as GLOBAL_DESIGN_TOKENS_START,Yx as GSC_AUTH_STATUSES,Xx as GSC_BINDING_STATUSES,Qx as GSC_PROPERTY_TYPES,xE as Ga4AccountOptionSchema,Ml as Ga4AuthAttemptSchema,aE as Ga4AuthAttemptStatusSchema,_E as Ga4AuthorizationSchema,sE as Ga4AuthorizationStatusSchema,dE as Ga4BindingReasonSchema,gE as Ga4BindingSchema,cE as Ga4BindingStatusSchema,RE as Ga4DataStreamOptionSchema,IE as Ga4DataStreamsDataSchema,vM as Ga4DataStreamsQuerySchema,PM as Ga4DataStreamsResponseSchema,bE as Ga4DeploymentSchema,SE as Ga4ModeSchema,TE as Ga4MutationSchema,yE as Ga4PropertyOptionSchema,EE as Ga4SetupResourcesDataSchema,wM as Ga4SetupResourcesQuerySchema,AM as Ga4SetupResourcesResponseSchema,Ul as Ga4StatusDataSchema,kM as Ga4StatusQuerySchema,TM as Ga4StatusResponseSchema,fE as Ga4TrackingSchema,hE as Ga4VerificationSchema,lE as Ga4VerificationStatusSchema,QE as GenerateAiImagesRequestSchema,ZE as GenerateAiImagesResponseSchema,np as GeneratedAiImageResultSchema,$L as GetActiveSiteDomainResponseSchema,UF as GetDeploymentResponseSchema,jR as GetDeploymentsStatusResponseSchema,BT as GetExternalSiteEditResponseSchema,VL as GetSiteDomainConfigurationResponseSchema,HD as GetSiteLauncherPermissionResponseSchema,aa as GetSitePublishDomainOperationDataSchema,zx as GetSitePublishDomainOperationResponseSchema,vD as GetTemplateUpgradeReportQuerySchema,CD as GetTemplateUpgradeReportResponseSchema,gM as GoogleSearchConsoleAuthStartDataSchema,_M as GoogleSearchConsoleAuthStartRequestSchema,hM as GoogleSearchConsoleAuthStartResponseSchema,lM as GoogleSearchConsoleAuthStatusSchema,pM as GoogleSearchConsoleBindingStatusSchema,dM as GoogleSearchConsolePropertyTypeSchema,uM as GoogleSearchConsoleStateSchema,fM as GoogleSearchConsoleStatusDataSchema,SM as GoogleSearchConsoleStatusInputSchema,bM as GoogleSearchConsoleStatusResponseSchema,rM as GscAuthStartDataSchema,aM as GscAuthStartRequestSchema,cM as GscAuthStartResponseSchema,ra as GscAuthStatusSchema,ca as GscBindingStatusSchema,ma as GscPropertyTypeSchema,Jx as GscStateInputSchema,mM as GscStateSchema,jl as GscStatusDataSchema,eE as GscStatusResponseSchema,kr as HOME_PAGE_URL_PATH,zR as HeaderShellBehaviorSchema,HR as HeaderShellShapeSchema,BR as HeaderShellSurfaceSchema,KR as HeaderShellVariantSchema,Cy as HomeUrlCrawlerTaskCreateRequestSchema,Zs as HttpUrlSchema,Ak as IMAGE_EXTENSION_WHITELIST,wk as IMAGE_MIME_WHITELIST,fr as INSERT_NEW_COMPONENT_CATEGORY_GROUP_KEY,Nr as INSERT_NEW_PAGE_CATEGORY_GROUP_KEY,OP as INTERNAL_RUN_LEASE_OWNER_HEADER,eu as ISO_639_3_TO_SITE_LOCALE,Pd as ImageRoleSchema,Hp as InboundUserMessageSchema,iN as IndustryClassificationRequestSchema,sN as IndustryClassificationResultSchema,pb as IndustryConfidenceSchema,Mm as InitializationResultSchema,Rd as InputBundleStatusSchema,_i as InputConflictSchema,Dk as InputContextBundleSchema,En as InputContextSourceIdSchema,kd as InputSourceSchema,Rs as InputSourceStatusSchema,Es as InputSourceTypeSchema,fD as InspectTemplateUpgradeStateRequestSchema,bD as InspectTemplateUpgradeStateResponseSchema,O0 as InstallDesignerComponentBodySchema,$U as InstallDesignerComponentResponseSchema,sA as InstallDesignerPageBodySchema,QU as InstallDesignerPageResponseSchema,LF as InternalCreateDeploymentResponseSchema,vF as InternalEnsureSubsitePublishRequestSchema,CF as InternalEnsureSubsitePublishResponseSchema,Q as InternalEntityIdSchema,FF as InternalGetDeploymentsStatusResponseSchema,DF as InternalGetSubsitePublishStatusRequestSchema,OF as InternalGetSubsitePublishStatusResponseSchema,wF as InternalPrepareSubsitePreviewRequestSchema,PF as InternalPrepareSubsitePreviewResponseSchema,Yf as KNOWLEDGE_CATEGORY_CODES,fm as KnowledgeCategoryCodeSchema,dO as KnowledgeContextReadinessSchema,Qf as KnowledgeSourceReadinessSchema,bm as KnowledgeSourceReadinessStatusSchema,lO as KnowledgeTaskStatusBatchSchema,Xf as KnowledgeTaskStatusSchema,ex as LEGACY_FILE_MUTATION_TOOL_NAME,$d as LEGACY_SITE_LOCALE_CODES,WG as LatestAgentRunQuerySchema,KG as LatestAgentRunResponseSchema,jG as LatestWorkspaceRunQuerySchema,NG as LatestWorkspaceRunResponseSchema,bL as LauncherPromptTemplateApplyRequestSchema,yL as LauncherPromptTemplateApplyResponseSchema,sx as LauncherPromptTemplateCatalogItemSchema,SL as LauncherPromptTemplateCatalogQuerySchema,fL as LauncherPromptTemplateCatalogSchema,nx as LauncherPromptTemplateKindSchema,ix as LauncherPromptTemplateLocaleSchema,rs as LauncherPromptTemplateTypeSchema,Gf as LauncherScopeSchema,kG as ListAgentEventsQuerySchema,TG as ListAgentEventsResponseSchema,HU as ListDesignerComponentCategoriesResponseSchema,D0 as ListDesignerComponentsQuerySchema,VU as ListDesignerComponentsResponseSchema,YU as ListDesignerPageCategoriesResponseSchema,nA as ListDesignerPagesQuerySchema,XU as ListDesignerPagesResponseSchema,JU as ListDesignerSitePagesResponseSchema,zE as ListMediaLibraryAssetsQuerySchema,HE as ListMediaLibraryAssetsResponseSchema,AG as ListSiteAgentEventsQuerySchema,TF as ListSiteVersionsResponseSchema,DD as ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema,OD as ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema,XP as ListWorkspacePageCheckpointsResponseSchema,Ik as MAX_DOCUMENT_SOURCES_PER_SITE,Rk as MAX_DOCUMENT_UPLOAD_BYTES,vk as MAX_IMAGE_SOURCES_PER_SITE,Pk as MAX_IMAGE_UPLOAD_BYTES,UE as MAX_NAV_LABEL_WIDTH,uf as MAX_SUBSITE_MEDIA_REPLACEMENTS,Y1 as MAX_UNBOUND_WORKSPACE_ATTACHMENTS_PER_SITE,oo as MAX_WORKSPACE_ATTACHMENTS_PER_MESSAGE,nw as MAX_WORKSPACE_URL_CAPTURES_PER_SITE_HOUR,$l as MEDIA_LIBRARY_AUDIO_EXTENSIONS,Jl as MEDIA_LIBRARY_AUDIO_MIME_TYPES,Yl as MEDIA_LIBRARY_DOCUMENT_EXTENSIONS,KE as MEDIA_LIBRARY_EXTENSIONS,Xl as MEDIA_LIBRARY_FILE_EXTENSIONS,Hl as MEDIA_LIBRARY_IMAGE_EXTENSIONS,WE as MEDIA_LIBRARY_IMAGE_MAX_BYTES,Ql as MEDIA_LIBRARY_IMAGE_MIME_TYPES,zl as MEDIA_LIBRARY_MAX_BYTES,BE as MEDIA_LIBRARY_MIME_TYPES,Vl as MEDIA_LIBRARY_VIDEO_EXTENSIONS,Zl as MEDIA_LIBRARY_VIDEO_MIME_TYPES,lv as MIGRATION_PRODUCTS_CMS_DETAIL_PAGE_TITLE,mv as MIGRATION_PRODUCTS_DETAIL_PREFIX,uv as MIGRATION_PRODUCTS_DETAIL_VIEW_VARIANT,dv as MIGRATION_PRODUCTS_LIST_VIEW_VARIANT,oS as MIGRATION_PRODUCTS_ROUTE,St as MIGRATION_PRODUCTS_SLUG,pv as MIGRATION_PRODUCTS_VIEW_BLOCK_TYPE,Nb as MODEL_DECLARABLE_FORM_FIELD_TYPES,fl as MODEL_FILE_MUTATION_TOOL_NAMES,Jf as MOTION_PRESETS,jo as MOTION_PRESET_IDS,VF as MediaAssetSchema,qR as MediaAttributionSchema,ua as MediaLibraryAssetSchema,ep as MediaLibraryFileTypeSchema,tp as MediaLibrarySourceSchema,aT as MediaRequestOwnerSchema,DT as MediaResolutionCacheIdSchema,bR as MigrationCollectionProgressSchema,ga as MigrationCollectionSchema,iU as MigrationContentProgressSchema,fR as MigrationReasonCodeSchema,xR as MigrationRedirectProgressSchema,yR as MigrationRedirectReasonCodeSchema,pp as MigrationRedirectSiteReasonSchema,C0 as MockDesignerComponentInsertDataSchema,v0 as MockDesignerComponentInsertRequestSchema,ba as MotionLevelSchema,xy as NAV_ITEMS_LOCALIZABLE_FIELD_PATHS,Ey as NAV_ITEMS_MACHINE_FIELD_PATHS,Ph as NEXT_FONT_DISPLAY_NAMES,ht as NEXT_FONT_REGISTRY,tu as NON_LATIN_SITE_LOCALE_CODES,fj as NavItemSchema,Sy as PAGE_SEO_LOCALIZABLE_FIELD_PATHS,fy as PAGE_SEO_MACHINE_FIELD_PATHS,On as PAGE_SLUG_PATTERN,Zt as PAGE_SLUG_SEGMENT_PATTERN_SOURCE,Va as PAGE_TEMPLATE_BATCH_MAX_ITEMS,Ij as PLATFORM_MATERIALIZED_EXEMPTIONS,ky as PLATFORM_MATERIALIZED_FILES,Ay as PLATFORM_MATERIALIZED_FILE_PATTERNS,Rj as PLATFORM_MATERIALIZERS,Kr as PLATFORM_OWNED_PAGE_SLUGS,e_ as PLATFORM_OWNED_ROUTE_FILE_PATHS,Fu as PageDirectoryReconcileFailedPageSchema,Ws as PageDirectoryReconcileResultSchema,H0 as PageDirectoryReconcileStateSchema,Uu as PageDirectoryReconcileStatusSchema,jy as PageDiscoveryCoverageEntrySchema,qj as PageDiscoveryCoverageReasonSchema,ul as PageDiscoveryCoverageSchema,Cp as PageNavigationSchema,Bs as PageResourceArtifactSchema,Xu as PageResourceComponentReferenceSchema,Qu as PageResourceComponentSchema,$u as PageResourceDraftPageSchema,Yu as PageResourceDraftSchema,ki as PageResourceFinalRouteSchema,Zu as PageResourcePageSchema,Vu as PageResourcePageSelectionSchema,Fr as PageResourceRouteMappingSchema,Aa as PageSchema,hj as PageSeoDeclSchema,ka as PageSlugSchema,Wu as PageTargetKindSchema,Us as PageTargetProjectionHashSchema,Or as PageTargetSchema,Ku as PageTargetSeoSchema,z0 as PageTargetSetSchema,Ya as PageTemplateBatchManifestSchema,JT as PageTemplateCleanupRequestSchema,nk as PageTemplateCleanupResponseSchema,Ha as PageTemplateCreateItemSchema,QT as PageTemplateCreateRequestSchema,ek as PageTemplateCreateResponseSchema,ik as PageTemplateErrorCodeSchema,$e as PageTemplateIdSchema,In as PageTemplatePagePathSchema,ZT as PageTemplatePromoteRequestSchema,tk as PageTemplatePromoteResponseSchema,hd as PageTemplateTaskSchema,Eo as PaletteInputsSchema,hG as PersistClarifyAnswersRequestSchema,SG as PersistClarifyAnswersResponseSchema,dG as PersistGeneratedSitemapDraftRequestSchema,gG as PersistGeneratedSitemapDraftResponseSchema,eq as PersistPreviewSessionRequestSchema,tq as PersistPreviewSessionResponseSchema,bG as PersistSiteDesignPlanRequestSchema,yG as PersistSiteDesignPlanResponseSchema,_G as PersistSiteSitemapDraftResponseSchema,lG as PersistSiteSitemapRequestSchema,uG as PersistSiteSitemapResponseSchema,mF as PersistSiteSnapshotRequestSchema,lF as PersistSiteSnapshotResponseSchema,ER as PositioningPrefillSchema,ha as PositioningSourceSchema,oA as PrepareDesignerPageBodySchema,ZU as PrepareDesignerPageResponseSchema,nO as PrepareSiteBuildInitialGenerationBaseRequestSchema,iO as PrepareSiteBuildInitialGenerationBaseResultSchema,SD as PrepareTemplateUpgradeStateRequestSchema,If as PrepareTemplateUpgradeStateResponseSchema,AF as PrepareVersionPreviewRequestSchema,OR as PrepareVersionPreviewResponseSchema,Ac as ProductSearchAppConfigDraftSchema,io as ProductSearchAppSlugSchema,H1 as ProductSearchContractFixtureSchema,Ag as ProductSearchDraftConfigSchema,Le as ProductSearchFieldNameSchema,Tg as ProductSearchFilterMetaSchema,so as ProductSearchInteractionRequestSchema,vi as ProductSearchInteractionResponseSchema,z1 as ProductSearchPopularTermsReadSchema,kc as ProductSearchPopularTermsSchema,Cg as ProductSearchRequestSchema,Og as ProductSearchResponseSchema,Un as ProductSearchRouteIdSchema,Ig as ProductSearchValueShapeSchema,dF as PromoteSiteSnapshotRequestSchema,CR as PromoteSiteSnapshotResponseSchema,RF as PromoteTemplateUpgradeSnapshotRequestSchema,IF as PromoteTemplateUpgradeSnapshotResponseSchema,vl as QualityRunningStatusSchema,jC as REFUSAL_COPY,vG as REST_API_ENDPOINTS,by as ROOT_LAYOUT_METADATA_LOCALIZABLE_FIELD_PATHS,yy as ROOT_LAYOUT_METADATA_MACHINE_FIELD_PATHS,Hx as ReconcileSitePublishDomainOperationDataSchema,Vx as ReconcileSitePublishDomainOperationResponseSchema,hF as RecordSnapshotVersionRequestSchema,SF as RecordSnapshotVersionResponseSchema,wD as RecordTemplateUpgradeEventRequestSchema,PD as RecordTemplateUpgradeEventResponseSchema,yD as RecordTemplateUpgradeFailureRequestSchema,xD as RecordTemplateUpgradeFailureResponseSchema,ED as RecordTemplateUpgradeSuccessRequestSchema,RD as RecordTemplateUpgradeSuccessResponseSchema,W0 as RecoverDesignerPageProjectionRequestSchema,K0 as RecoverDesignerPageProjectionResponseSchema,qu as RecoverDesignerPageProjectionResultSchema,Td as ReferencePagePatternSchema,ui as ReferenceSignalsSchema,iR as RegisterMediaResourceReferenceRequestSchema,sR as RegisterMediaResourceReferenceResponseSchema,D1 as RegisterWorkflowTaskCommandRequestSchema,Sg as RegisterWorkflowTaskRequestSchema,YP as RegisterWorkspacePageCheckpointRequestSchema,yF as ReleaseTemplateUpgradeLockRequestSchema,xF as ReleaseTemplateUpgradeLockResponseSchema,j1 as ReplaceCrawlWorkflowTaskCommandRequestSchema,bg as ReplaceCrawlWorkflowTaskRequestSchema,N1 as ReplaceWorkflowTaskCommandRequestSchema,fg as ReplaceWorkflowTaskRequestSchema,dN as ResolvedFieldSchema,GN as ResolvedFormFieldSchema,PG as RestApiMethodSchema,kF as RestoreSiteSnapshotResponseSchema,Sj as RootLayoutMetadataSchema,Tp as RouteGenerationCardSchema,uh as RuleEngineInputSchema,Sh as RuleEngineScoreRecordSchema,uo as RuleScoreDimensionKeySchema,hh as RuleScoreDimensionSchema,An as SELECTABLE_SITE_LOCALE_CODES,uI as SITEMAP_RESOLVER_MAX_BLOCK_TARGETS,dI as SITEMAP_RESOLVER_MAX_PAGE_TARGETS,eO as SITE_BUILD_CONTEXT_FILE_PATH,tO as SITE_BUILD_CONTEXT_MAX_BYTES,og as SITE_BUILD_STATUSES,bc as SITE_BUILD_STATUS_CODES,ag as SITE_DEPLOYMENT_STATUSES,yc as SITE_DEPLOYMENT_STATUS_CODES,No as SITE_DESIGN_DENSITY_IDS,Kt as SITE_DESIGN_NOTES_END,on as SITE_DESIGN_NOTES_START,xm as SITE_DESIGN_RADIUS_IDS,Mv as SITE_EDIT_DURABLE_HISTORY_CAPABILITY,yu as SITE_EDIT_MATERIALIZATION_MAX_FILE_CONTENT_BYTES,Ns as SITE_EDIT_MATERIALIZATION_MAX_FILE_COUNT,js as SITE_EDIT_MATERIALIZATION_MAX_TOTAL_CONTENT_BYTES,sc as SITE_EDIT_PAGE_COMPOSITION_SCHEMA_VERSION,qA as SITE_EDIT_PAGE_COMPOSITION_V2_CAPABILITY,zS as SITE_EDIT_RUNTIME_CONTAINER_TAGS,HS as SITE_EDIT_RUNTIME_TEXT_TAGS,BS as SITE_EDIT_RUNTIME_VOID_ELEMENT_TAGS,DA as SITE_EDIT_SIGNED_MUTATION_CAPABILITY,Cd as SITE_EDIT_SOURCE_ALLOWED_APP_FILES,nr as SITE_EDIT_SOURCE_ALLOWED_DIRS,vd as SITE_EDIT_SOURCE_ALLOWED_ROOT_FILES,Ts as SITE_EDIT_SOURCE_DELETE_CAPABILITY,Dd as SITE_EDIT_TEXT_SOURCE_EXTENSIONS,Dm as SITE_EXTRA_REQUIREMENT_MAX_LENGTH,yv as SITE_HAS_ACTIVE_SUBSITES_ERROR_CODE,xv as SITE_HAS_SUBSITES_ERROR_CODE,rP as SITE_LEADING_BODY_TOKEN,Yd as SITE_LOCALE_CODES,gj as SITE_LOCALIZATION_STRUCTURES,OU as SITE_PLANNING_FROZEN_ERROR_CODE,NU as SITE_PLANNING_LOCKED_ERROR_CODE,UU as SITE_SITEMAP_DRAFT_OPERATION_MISMATCH_ERROR_CODE,MU as SITE_SITEMAP_DRAFT_STALE_ERROR_CODE,jU as SITE_STRUCTURE_CONFIRMATION_REQUIRED_ERROR_CODE,LU as SITE_STRUCTURE_CONFIRMATION_STALE_ERROR_CODE,dp as SITE_STRUCTURE_INVALID_ERROR_CODE,aP as SITE_WEIGHT_TOKEN_NAMES,Nf as SITE_WORKFLOW_PROGRESS_STATUSES,Lf as SITE_WORKFLOW_PROGRESS_STEP_STATUSES,rg as SITE_WORKFLOW_STATUSES,xc as SITE_WORKFLOW_STATUS_CODES,CG as SSE_STREAMS,su as STEP5_KEYWORD_CATEGORIES,au as STEP5_OPTIONAL_STRATEGY_KEYS,yi as STEP5_REQUIRED_STRATEGY_COUNT,Pn as STEP5_REQUIRED_STRATEGY_KEYS,Su as STEP5_SSE_EVENT_NAMES,De as STEP5_STRATEGY_COUNT,Qt as STEP5_STRATEGY_KEYS,dr as STEP5_STRATEGY_OPTION_IDS,Tm as STEP6_AI_THEME_IDS,Lo as STEP6_AI_THEME_PRESETS,km as STEP6_GENERATED_THEME_ID_PATTERN,af as SUBSITE_GLOSSARY_ENTRY_MAX_CHARS,rf as SUBSITE_GLOSSARY_MAX_ENTRIES,ff as SUBSITE_MOUNT_PATH_PATTERN,df as SUBSITE_PALETTE_NOTE_MAX_CHARS,bf as SUBSITE_RESERVED_MOUNT_SEGMENTS,Zk as SUPPORTED_SITE_LOCALES,ai as SandboxSessionIdSchema,fT as SandboxSessionSchema,td as SandboxSessionStatusSchema,BU as SaveBriefDraftRequestSchema,sF as SaveBriefDraftResponseSchema,kE as SaveGa4BindingDataSchema,CM as SaveGa4BindingRequestSchema,DM as SaveGa4BindingResponseSchema,cN as SaveSiteExtraRequirementRequestSchema,rG as SaveSiteSitemapDraftRequestSchema,cG as SaveSiteSitemapDraftResponseSchema,JE as SearchUnsplashMediaQuerySchema,eR as SearchUnsplashMediaResponseSchema,Hf as SiteBuildContextFileSchema,zf as SiteBuildContextPayloadSchema,Bf as SiteBuildContextProvenanceSchema,Kf as SiteBuildContextProvenanceSourceSchema,Js as SiteBuildStatusSchema,Ev as SiteDeletionBlockedDetailsSchema,eo as SiteDeploymentStatusSchema,ds as SiteDesignContextSchema,IR as SiteDesignDensitySchema,TR as SiteDesignMotionLevelSchema,Gi as SiteEditBoundaryKindSchema,pS as SiteEditCapabilityConstraintSchema,mS as SiteEditCapabilityModeSchema,Fi as SiteEditCapabilityModeViewSchema,kv as SiteEditCapabilityReadRequestSchema,o_ as SiteEditClassNameSourceDiagnosticSchema,dt as SiteEditClassNameSourceRangeSchema,Yr as SiteEditClassNameSourceSchema,hA as SiteEditClassNameSourceStyleContextSchema,$r as SiteEditClassNameSourceStylesheetSchema,Hs as SiteEditClassNameSourceWriteIntentSchema,pA as SiteEditCommandDiagnosticSchema,i_ as SiteEditCommandErrorSchema,B as SiteEditCompositionContextSchema,ue as SiteEditCompositionSelectorSchema,lS as SiteEditConstraintKindSchema,V_ as SiteEditDeletePageSourceOutputSchema,LS as SiteEditDynamicConfidenceSchema,US as SiteEditDynamicDataBindingSchema,rm as SiteEditDynamicDataDetailSchema,cm as SiteEditDynamicDataSummarySchema,MS as SiteEditDynamicEvidenceSchema,am as SiteEditDynamicSourceKindSchema,NS as SiteEditDynamicSourceTypeSchema,jS as SiteEditDynamicTargetKindSchema,Io as SiteEditEffectiveWriteTargetSchema,Ov as SiteEditEventSchema,ys as SiteEditExecutionSceneSchema,Ki as SiteEditExternalSourceKindSchema,yA as SiteEditGetClassNameSourceCommandResultSchema,fA as SiteEditGetClassNameSourceInputSchema,bA as SiteEditGetClassNameSourceResultSchema,gC as SiteEditGetDocumentInputSchema,hC as SiteEditGetObjectEditContextInputSchema,zk as SiteEditGetSourceFileInputSchema,Bk as SiteEditGetSourceTreeInputSchema,SA as SiteEditGetStyleContextInputSchema,Wi as SiteEditHistoryProvenanceSchema,hS as SiteEditHistoryReadOnlyRecoveryStatusSchema,dS as SiteEditHistoryRecoveryCodeSchema,uS as SiteEditHistoryRecoveryDiagnosticSchema,Fv as SiteEditHistoryResultSchema,Uv as SiteEditHistoryStatusModeSchema,fS as SiteEditHistoryStatusSchema,_S as SiteEditHistoryUnavailableReasonSchema,SS as SiteEditHistoryUnavailableStatusSchema,gS as SiteEditHistoryWritableStatusSchema,CC as SiteEditInitializeSessionInputSchema,B_ as SiteEditInsertNodeSpecSchema,H_ as SiteEditInsertPageResourceOutputSchema,ku as SiteEditMaterializationDataRequirementsSchema,Tu as SiteEditMaterializationEntrySchema,Iu as SiteEditMaterializationExportSchema,Ru as SiteEditMaterializationFileSchema,Sr as SiteEditMaterializationPathTemplateSchema,Ft as SiteEditMaterializationSchema,pc as SiteEditMaterializedComponentNodeSpecSchema,rc as SiteEditMoveTargetSchema,Nn as SiteEditMutationContextSchema,qi as SiteEditNodeCapabilitySnapshotSchema,fC as SiteEditObjectCapabilitiesSchema,yC as SiteEditObjectDetailSchema,EC as SiteEditObjectEditContextSchema,RC as SiteEditObjectStyleDetailSchema,xC as SiteEditObjectSummarySchema,i1 as SiteEditOperationCommandResultSchema,dc as SiteEditOperationErrorCodeSchema,uc as SiteEditOperationErrorSchema,$_ as SiteEditOperationOutputSchema,z_ as SiteEditOperationParamsSchema,Xs as SiteEditOperationPayloadSchema,Ys as SiteEditOperationRequestSchema,K_ as SiteEditOperationResultTargetSchema,en as SiteEditOperationSelectionRefSchema,OS as SiteEditOperationSummarySchema,W_ as SiteEditOperationTargetSchema,Mn as SiteEditOperationTypeSchema,Wt as SiteEditOperationValueSchema,WA as SiteEditPageCompositionAnyVersionSchema,k_ as SiteEditPageCompositionAtomicKindSchema,v_ as SiteEditPageCompositionBoundaryModeSchema,f_ as SiteEditPageCompositionBusinessMemberSchema,h_ as SiteEditPageCompositionContainerSchema,Ln as SiteEditPageCompositionDiagnosticSchema,wi as SiteEditPageCompositionErrorCodeSchema,tc as SiteEditPageCompositionPlacementTargetSchema,b_ as SiteEditPageCompositionPlacementUnitSchema,I_ as SiteEditPageCompositionRuntimeRefSchema,R_ as SiteEditPageCompositionSchema,T_ as SiteEditPageCompositionSourceMemberKindSchema,S_ as SiteEditPageCompositionSourceMemberSchema,oc as SiteEditPageCompositionSourceRangeSchema,x_ as SiteEditPageCompositionSupportedSchema,E_ as SiteEditPageCompositionUnsupportedSchema,P_ as SiteEditPageCompositionV2BusinessMemberSchema,A_ as SiteEditPageCompositionV2ContainerSchema,D_ as SiteEditPageCompositionV2PlacementRelationSchema,N_ as SiteEditPageCompositionV2PlacementSchema,C_ as SiteEditPageCompositionV2PlacementUnitSchema,U_ as SiteEditPageCompositionV2Schema,w_ as SiteEditPageCompositionV2SourceMemberSchema,L_ as SiteEditPageCompositionV2SupportedSchema,M_ as SiteEditPageCompositionV2UnsupportedSchema,O_ as SiteEditPageCompositionV2WriteModeSchema,j_ as SiteEditPageCompositionVisualAnchorSchema,y_ as SiteEditPagePlacementOptionSchema,ec as SiteEditPagePlacementSchema,ic as SiteEditPageUnitResultTargetSchema,nc as SiteEditPageUnitTargetSchema,kS as SiteEditPatchPlanPatchSchema,Yv as SiteEditPatchPlanSchema,To as SiteEditPropertiesSchema,d_ as SiteEditPropertyChangeSchema,RS as SiteEditPropertyCreationSchema,xS as SiteEditPropertyItemSchema,bS as SiteEditPropertyResolutionSchema,yS as SiteEditPropertySourceSchema,ES as SiteEditPropertySpreadSchema,zn as SiteEditProvenanceChainSchema,qS as SiteEditProvenanceHopSchema,SC as SiteEditRenderDocumentSchema,Bn as SiteEditRenderEntryRefSchema,FS as SiteEditRenderEntrySchema,om as SiteEditRenderPageCompositionSchema,CS as SiteEditRenderPageCompositionSupportedSchema,DS as SiteEditRenderPageCompositionUnsupportedSchema,vS as SiteEditRenderPagePlacementSchema,OA as SiteEditRequiredMutationContextEnvelopeSchema,Vk as SiteEditResolveSourceLocationInputSchema,lm as SiteEditSemanticSourceSchema,Qr as SiteEditSetPropsParamsSchema,n1 as SiteEditSignedOperationRequestSchema,ir as SiteEditSourceDeleteCapabilitySchema,Nd as SiteEditSourceDirectoryPathSchema,Fd as SiteEditSourceFileBinaryPreviewUnavailableReasonSchema,Gd as SiteEditSourceFileBinaryResponseSchema,Wk as SiteEditSourceFileKindSchema,jd as SiteEditSourceFileListItemSchema,Hk as SiteEditSourceFileResponseSchema,Ud as SiteEditSourceFileTextResponseSchema,$s as SiteEditSourceIdentitySchema,qd as SiteEditSourceLocationRangeSchema,$k as SiteEditSourceLocationSchema,KS as SiteEditSourceLocatorRangeSchema,wo as SiteEditSourceLocatorSchema,xe as SiteEditSourcePathSchema,sr as SiteEditSourceTreeNodeSchema,Kk as SiteEditSourceTreeResponseSchema,Ld as SiteEditSourceTreeTruncationReasonSchema,Md as SiteEditSourceTreeTruncationSchema,lc as SiteEditStyleBreakpointSchema,Zr as SiteEditStyleDraftPropertySchema,bC as SiteEditStyleModelSchema,cc as SiteEditStylePropertySchema,pm as SiteEditStyleSourceSchema,mc as SiteEditStyleStateModeSchema,Ao as SiteEditTextSegmentSchema,mm as SiteEditTextSourceSchema,GS as SiteEditWriteTargetSchema,mN as SiteExtraRequirementResponseSchema,db as SiteExtraRequirementSchema,tv as SiteGenerationLedgerResponseSchema,k as SiteIdSchema,qf as SiteLauncherPermissionSchema,Ee as SiteLocaleSchema,HF as SiteMediaIntentSchema,wT as SiteOperationLockIdSchema,Cf as SitePreviewActivateErrorCodeSchema,Of as SitePreviewActivateFailedSchema,Df as SitePreviewActivateReadySchema,LD as SitePreviewActivateResponseSchema,XL as SitePublishDomainCheckDataSchema,YL as SitePublishDomainCheckRequestSchema,QL as SitePublishDomainCheckResponseSchema,ZL as SitePublishDomainOperationDataSchema,JL as SitePublishDomainOperationResponseSchema,eM as SitePublishDomainReconcileOperationResponseSchema,tM as SitePublishDomainRemediationConfirmRequestSchema,nM as SitePublishDomainRemediationConfirmResponseSchema,ms as SitePublishQualityTaskStatusSchema,DL as SitePublishRepairInputItemSchema,Ox as SitePublishRepairResultItemSchema,Cl as SitePublishRepairResultSchema,OL as SitePublishRepairTaskSnapshotSchema,Pl as SitePublishRepairTaskStatusSchema,ML as SitePublishWorkflowActiveResponseSchema,ri as SitePublishWorkflowIdSchema,jx as SitePublishWorkflowMutationDataSchema,UL as SitePublishWorkflowMutationResponseSchema,Lx as SitePublishWorkflowPublishDataSchema,FL as SitePublishWorkflowPublishResponseSchema,Mx as SitePublishWorkflowQualityDataSchema,GL as SitePublishWorkflowQualityResponseSchema,Dt as SitePublishWorkflowRecordSchema,LL as SitePublishWorkflowRevisionRequestSchema,kx as SitePublishWorkflowStatusSchema,Ax as SitePublishWorkflowStepSchema,jt as SiteRecordSchema,vT as SiteTemplateUpgradeStateIdSchema,MG as SiteThreadListQuerySchema,UG as SiteThreadListResponseSchema,qG as SiteThreadResponseSchema,La as SiteVersionIdSchema,DR as SiteVersionListItemSchema,Ss as SiteVersionRecordSchema,nt as SiteWorkflowIdSchema,Ff as SiteWorkflowProgressDataSchema,WD as SiteWorkflowProgressResponseSchema,jf as SiteWorkflowProgressStatusSchema,Uf as SiteWorkflowProgressStepSchema,Mf as SiteWorkflowProgressStepStatusSchema,hg as SiteWorkflowRecordSchema,T1 as SiteWorkflowSnapshotResponseSchema,no as SiteWorkflowSnapshotSchema,cg as SiteWorkflowStatusSchema,Ua as SiteWorkflowTaskRefIdSchema,k1 as SiteWorkflowTaskRefResponseSchema,Ic as SiteWorkflowTaskRefSchema,tG as SitemapAddBlockInputSchema,wa as SitemapAnswerSchema,JF as SitemapChangeBlockVariantInputSchema,hI as SitemapDeleteBlockInputSchema,iI as SitemapDraftBlockSchema,sI as SitemapDraftPageSchema,Gp as SitemapDraftRecordSchema,un as SitemapDraftSchema,gI as SitemapEditActorSchema,bI as SitemapEditErrorCodeSchema,xI as SitemapEditFailureSchema,fI as SitemapEditOperationSchema,iG as SitemapEditResultSchema,yI as SitemapEditSuccessSchema,oG as SitemapGenerationInputSchema,kI as SitemapGenerationOutcomeSchema,AI as SitemapGenerationReasonSchema,Np as SitemapGenerationStageSchema,Te as SitemapIdSchema,EI as SitemapIntentPageSchema,QF as SitemapModelOutputSchema,aI as SitemapModelPageSchema,ZF as SitemapMoveBlockInputSchema,tI as SitemapNavigationHrefSchema,Fe as SitemapNodeIdSchema,Fp as SitemapRecordSchema,YF as SitemapResolverRequestSchema,XF as SitemapResolverResponseSchema,_I as SitemapResolverTargetsSchema,Op as SitemapRunInputSchema,bn as SitemapSchema,cI as SitemapSourceProvenanceSchema,aG as SitemapStreamEventSchema,Fj as SitemapTaskCreateRequestSchema,Bj as SitemapTaskCreateResponseSchema,Ky as SitemapTaskFailureErrorCodeSchema,zj as SitemapTaskResponseSchema,SI as SitemapUpdateBlockInstructionInputSchema,eG as SitemapUpdateBlockPropsInputSchema,GR as SitemapUserChoiceSchema,fn as SkillSelectionSchema,WR as SkillSelectionSourceSchema,Vp as SnapshotContentHashSchema,ud as SnapshotEditChangesSchema,dd as SnapshotEditPageChangeSchema,pd as SnapshotEditSectionChangeSchema,Pe as SnapshotFilePathSchema,A as SnapshotIdSchema,xt as SnapshotRecordSchema,Rp as SnapshotStatusSchema,nv as StartFillInRequestSchema,oF as StartFillInResponseSchema,uE as StartGa4AuthDataSchema,RM as StartGa4AuthRequestSchema,IM as StartGa4AuthResponseSchema,pa as StartGscAuthDataSchema,Ol as StartGscAuthRequestSchema,Nl as StartGscAuthResponseSchema,L1 as StartSiteBuildRequestSchema,sO as StartSiteBuildResponseSchema,Vf as StartSiteBuildResultSchema,NL as StartSitePublishWorkflowRequestSchema,DG as StartWorkspaceRunRequestSchema,OG as StartWorkspaceRunResponseSchema,Dc as Step2AiCrawlabilityAssessmentSchema,Vg as Step2FinalResultDataSourceSchema,Di as Step2FinalResultRequestSchema,Iw as Step2FinalResultResponseSchema,Rw as Step2FinalResultSaveResponseSchema,Hg as Step2FinalResultSaveResultSchema,co as Step2FinalResultTypeSchema,Yg as Step2FinalResultViewSchema,Cc as Step2FinalScanCardKeySchema,mo as Step2FinalScanCardSchema,zg as Step2FinalScanResultSchema,Hn as Step2KnowledgeOpaqueIdSchema,pO as Step2KnowledgeScopeSchema,Tt as Step2PageRoleSchema,Aw as Step2PageSelectionRequestSchema,ww as Step2PageSelectionResponseSchema,Wg as Step2SiteInitializationCrawlerErrorCodeSchema,qg as Step2SiteInitializationStatusSchema,Ew as Step2SiteInitializationTaskResponseSchema,Kg as Step2SiteInitializationTaskSchema,lo as Step3AgentAnalysisSchema,nh as Step3AnalysisFindingSchema,jw as Step3AnalysisJobResponseSchema,Lc as Step3AnalysisJobSchema,Nc as Step3AnalysisJobStatusSchema,Lw as Step3AnalysisLatestResponseSchema,Oc as Step3AnalysisProgressSchema,oh as Step3AnalysisResultSchema,Nw as Step3AnalysisScheduleResponseSchema,th as Step3AnalysisScheduleSchema,Mw as Step3AnalysisSseFrameSchema,Dw as Step3AnalysisStartRequestSchema,jc as Step3AnalysisSummarySchema,eh as Step3AnalystSchema,Ow as Step3AnalystsResponseSchema,qw as Step4DiagnosisResponseSchema,xi as Step5ActiveStrategyKeySchema,S0 as Step5CommitStrategyRequestSchema,f0 as Step5CommitStrategyResponseSchema,gu as Step5CommittedVersionSchema,vn as Step5DecisionSelectionIdSchema,lu as Step5EvidenceReferenceSchema,pu as Step5GenerationStatusSchema,uu as Step5JobStatusSchema,ou as Step5KeywordCategorySchema,wn as Step5KeywordEntrySchema,Ps as Step5KeywordLibrarySchema,a0 as Step5KeywordSearchBodySchema,fi as Step5KeywordSelectionSchema,Ii as Step5MarketCountrySchema,Ri as Step5MarketTypeSchema,pr as Step5OptionPresentationSchema,Cs as Step5OutputLocaleSchema,_0 as Step5RegenerateItemRequestSchema,g0 as Step5SaveDecisionRequestSchema,h0 as Step5SaveDecisionResponseSchema,RI as Step5SitemapDecisionSchema,TI as Step5SitemapRunInputSchema,II as Step5SitemapSourceSchema,sG as Step5SitemapStartRequestSchema,d0 as Step5StartStrategyRequestSchema,u0 as Step5StartStrategyResponseSchema,du as Step5StrategyDecisionInputSchema,Os as Step5StrategyDecisionSchema,Ds as Step5StrategyItemSchema,_r as Step5StrategyJobSchema,Ei as Step5StrategyKeySchema,ur as Step5StrategyOptionIdSchema,ru as Step5StrategyOptionSchema,cu as Step5StrategyPlanSchema,hu as Step5StrategySnapshotDataSchema,y0 as Step5StrategySseFrameSchema,_u as Step5StrategyVersionSnapshotSchema,mu as Step5StructureDetailSchema,sb as Step6AiThemeCandidateSchema,$i as Step6ColorSeedsSchema,JO as Step6DesignAgentRecommendationsResponseSchema,HO as Step6DesignRecommendationGenerationInputSchema,Fo as Step6DesignRecommendationModelOutputSchema,ob as Step6DesignRecommendationSchema,WO as Step6DesignRecommendationsRequestSchema,KO as Step6DesignRecommendationsResponseSchema,Cm as Step6DesignSelectionSchema,vm as Step6GeneratedThemeCardSchema,lb as Step6GptDesignRecommendationModelOutputSchema,JP as StopWorkspaceGenerationRequestSchema,ev as StopWorkspaceGenerationResponseSchema,JC as SubsiteCopyEstimateRequestSchema,eD as SubsiteCopyEstimateResponseSchema,zC as SubsiteGlossariesSchema,mf as SubsiteGlossaryEntrySchema,Bi as SubsiteHexColorSchema,uD as SubsiteMountPathSchema,VC as SubsitePaletteLocalizationSchema,lf as SubsitePaletteModeSchema,pf as SubsitePaletteSeedsSchema,HC as SubsiteSiteInfoSchema,iD as SubsiteSyncDiffComputeRequestSchema,sD as SubsiteSyncDiffComputeResponseSchema,hf as SubsiteSyncDiffErrorCodeSchema,oD as SubsiteSyncDiffErrorResponseSchema,mD as SubsiteVisibleTextExportRequestSchema,lD as SubsiteVisibleTextExportResponseSchema,sg as TASK_EXECUTION_STATUSES,Ec as TASK_EXECUTION_STATUS_CODES,EF as TEMPLATE_UPGRADE_LOCK_LOST_ERROR_CODE,Mo as THEME_PRESETS,Im as THEME_PRESET_IDS,fc as TaskExecutionStatusSchema,wf as TemplateUpgradeCasOutcomeSchema,_m as TemplateUpgradeErrorCodeSchema,Pf as TemplateUpgradeOutcomeCountsSchema,kf as TemplateUpgradeOutcomeSchema,vf as TemplateUpgradeSnapshotDeletionCandidateSchema,mn as TemplateUpgradeStateSchema,Ef as TemplateUpgradeStatusSchema,Af as TemplateUpgradeValidationStageSchema,Xe as TemplateVersionSchema,fF as TryAcquireTemplateUpgradeLockRequestSchema,bF as TryAcquireTemplateUpgradeLockResponseSchema,Gh as TypeInputsSchema,ef as USER_STOPPED_RUN_ERROR_CODES,sp as UnsplashDownloadLocationSchema,ip as UnsplashMediaAssetSchema,KU as UpdateBriefRequestSchema,iF as UpdateBriefResponseSchema,fG as UpdateClarifyArchetypeRequestSchema,Y0 as UpdateCmsSeoSyncStateRequestSchema,pF as UpdateCurrentSnapshotManifestRequestSchema,V0 as UpdatePageDirectoryReconcileStateRequestSchema,jL as UpdateSitePublishWorkflowStepRequestSchema,WU as UpdateSiteRequestSchema,GG as UpdateSiteThreadRequestSchema,w1 as UpdateSiteWorkflowWebsiteRequestSchema,BO as UpdateStep6DesignSelectionRequestSchema,zO as UpdateStep6DesignSelectionResponseSchema,O1 as UpdateWorkflowTaskStatusRequestSchema,VE as UploadMediaLibraryAssetResponseSchema,EL as UpstreamPromptTemplateCatalogDataSchema,xL as UpstreamPromptTemplateConsumeDataSchema,Dy as UrlListCrawlerTaskCreateRequestSchema,CT as UsageRecordIdSchema,tR as UseUnsplashMediaRequestSchema,nR as UseUnsplashMediaResponseSchema,yT as UserIdSchema,Zx as VCP_GSC_STATES,la as VcpGscStateSchema,Px as VcpQualityRemediationItemSchema,wl as VcpQualityResultSchema,fa as VisualHintsSchema,FR as VisualThemeSchema,Lh as WEIGHT_STYLE_IDS,Bc as WEIGHT_STYLE_PRESETS,I1 as WORKFLOW_DEFINITIONS_V1,to as WORKFLOW_DEFINITION_REGISTRY,tg as WORKFLOW_FLOW_TYPES,mg as WORKFLOW_MENU_STATES,ng as WORKFLOW_NODE_CODES,ig as WORKFLOW_TASK_TYPES,tw as WORKSPACE_ATTACHMENT_BOUND_ERROR_CODE,cw as WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_ERROR_CODE,aw as WORKSPACE_ATTACHMENT_CAPTURE_BUSY_ERROR_CODE,ow as WORKSPACE_ATTACHMENT_CAPTURE_FAILED_ERROR_CODE,rw as WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT_ERROR_CODE,mw as WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE_ERROR_CODE,ew as WORKSPACE_ATTACHMENT_LIMIT_ERROR_CODE,Ng as WORKSPACE_ATTACHMENT_MEDIA_TYPES,Q1 as WORKSPACE_ATTACHMENT_TARGET_BASE64_BYTES,J1 as WORKSPACE_ATTACHMENT_TOO_LARGE_ERROR_CODE,X1 as WORKSPACE_ATTACHMENT_UNBOUND_TTL_MS,Z1 as WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT_ERROR_CODE,sw as WORKSPACE_ATTACHMENT_URL_REJECTED_ERROR_CODE,FP as WORKSPACE_CHECK_INCOMPLETE_ERROR_CODE,tx as WORKSPACE_FILE_MUTATION_TOOL_NAMES,qP as WORKSPACE_FILL_IN_INTERRUPTED_ERROR_CODE,GP as WORKSPACE_GENERATION_STOPPED_ERROR_CODE,MP as WORKSPACE_MAX_PAGE_ATTEMPTS,LP as WORKSPACE_MAX_RESUME_COUNT,jP as WORKSPACE_RUN_HEARTBEAT_INTERVAL_MS,NP as WORKSPACE_RUN_LEASE_MS,WP as WORKSPACE_RUN_LEASE_SUPERSEDED_ERROR_CODE,KP as WORKSPACE_RUN_NOT_ACTIVE_ERROR_CODE,UP as WORKSPACE_RUN_RESUME_EXHAUSTED_ERROR_CODE,iw as WORKSPACE_URL_CAPTURE_WINDOW_MS,HG as WORKSPACE_WEBSOCKET_CONTRACT,qe as WeightStyleIdSchema,hc as WorkflowClientCapabilitiesSchema,Rc as WorkflowDefinitionVersionSchema,tn as WorkflowFlowTypeSchema,gg as WorkflowMenuItemSchema,lg as WorkflowMenuStateSchema,It as WorkflowNodeCodeSchema,Sc as WorkflowTaskTypeSchema,pw as WorkspaceAttachmentFromUrlRequestSchema,ao as WorkspaceAttachmentMediaTypeSchema,lw as WorkspaceAttachmentSchema,eT as WorkspaceClientMessageSchema,aR as WorkspaceDesignApplyRequestSchema,rR as WorkspaceDesignApplyResponseSchema,cR as WorkspaceDesignCurrentResponseSchema,va as WorkspaceDiagnosticSchema,mT as WorkspaceDirectEditFileSchema,cT as WorkspaceDirectEditPathSchema,Qp as WorkspaceDirectEditPostActionSchema,YG as WorkspaceDirectEditRequestSchema,QG as WorkspaceDirectEditResponseSchema,Ca as WorkspaceExecutionDiagnosticsSchema,xG as WorkspaceExecutionPlanSchema,tr as WorkspaceGenerationLedgerEventSchema,kn as WorkspaceGenerationLedgerSchema,rT as WorkspaceMediaRequestSchema,bd as WorkspaceOmissionKindSchema,yd as WorkspaceOmissionReasonSchema,er as WorkspaceOmissionSchema,Jc as WorkspacePageCheckpointSchema,Ed as WorkspacePageOutcomeSchema,xd as WorkspacePageResultSchema,Na as WorkspacePlanDependencySchema,Kp as WorkspacePlanSummarySchema,MI as WorkspacePlanTaskKindSchema,Oa as WorkspacePlanTaskSchema,X_ as WorkspaceResourceKindSchema,Z_ as WorkspaceResourceNavigationSelectionSchema,gc as WorkspaceResourceOperationClientMessageSchema,Q_ as WorkspaceResourceOperationSummarySchema,J_ as WorkspaceResourceOperationTransientInputSchema,QP as WorkspaceRunControlInputResponseSchema,VP as WorkspaceRunHeartbeatRequestSchema,$P as WorkspaceRunHeartbeatResponseSchema,fs as WorkspaceRunKindSchema,nS as WorkspaceRunResumePrincipalSchema,JI as WorkspaceSelectedComponentSchema,nT as WorkspaceServerMessageSchema,nG as WorkspaceSitemapEditRequestSchema,ZI as WorkspaceSocketDescriptorSchema,gT as WorkspaceSourceFileBinaryResponseSchema,uT as WorkspaceSourceFileKindSchema,Jp as WorkspaceSourceFileListItemSchema,ZG as WorkspaceSourceFilePathQuerySchema,JG as WorkspaceSourceFileResponseSchema,_T as WorkspaceSourceFileTextResponseSchema,Zp as WorkspaceSourcePathSchema,CI as WorkspaceSuggestionSchema,qp as WorkspaceSuggestionsSchema,DI as WorkspaceSuggestionsSourceSchema,Bp as WorkspaceTaskCountsSchema,zG as WorkspaceWebSocketMessageSchema,BG as WorkspaceWebSocketMessageTypeSchema,Da as WorkspaceWorkerGroupSchema,Pa as WorkspaceWorkerPhaseSchema,EG as WorkspaceWorkerResultSchema,Vt as WorkspaceWorkerStatusSchema,IN as applicationTemplateCatalogDataSchema,RN as applicationTemplateConsumeDataSchema,EN as applicationTemplateV1Schema,Yw as assertDeploymentTransition,LM as assertFillInTargetsOmitted,q1 as assertSiteBuildStatusTransition,G1 as assertTaskExecutionStatusTransition,bo as availableFontWeights,Oj as buildCmsIdentityHeaders,NM as buildE2bBrowserPreviewUrl,qL as buildFinalSitePublishQualityResult,VO as buildStep6FallbackThemeCards,VD as canEnterLauncher,$D as canPublishSite,ia as canonicalizeFormDesignJson,RL as canonicalizeLauncherPromptTemplateOperation,Hr as canonicalizePageSlug,kP as checkGlobalsCssEdit,Vs as classifySiteEditPropertyName,U0 as cmsPagePreviewUrlPath,R0 as compareTemplateVersions,Qv as composeSiteEditRepeatInstanceKey,dj as computeFormDesignOperationFingerprint,Is as computeSiteEditCompositionKey,g_ as computeSiteEditSourceIdentityKey,oi as containsSensitiveData,gk as countLedgerAccessiblePages,hk as countLedgerProcessedPages,LE as countSitemapStructure,s_ as createSiteEditCommandFailureSchema,Vr as createSiteEditCommandResultSchema,zs as createSiteEditCommandSuccessSchema,mG as createSiteSitemapDraftCreationKey,fw as createSitemapResolverAnswerSheetSchema,YO as defaultStep6Selection,tE as deriveVcpGscState,nE as doesGscPropertyMatchDomain,GE as estimateNavLabelWidth,xg as findWorkflowDefinition,yg as findWorkflowDefinitionInRegistry,ho as fontStack,hy as formDesignOperationFingerprintInput,Wh as formatSiteDesignNotes,Xw as getDeploymentHappyPathTransitions,Vw as getDeploymentTransitionPredecessors,Hw as getDeploymentTransitionTargets,Kc as getFontPairing,Rm as getMotionPreset,Am as getSiteDesignThemeRadius,As as getSiteEditSourceDeleteProtectionReason,Ux as getSitePublishRepairItems,CO as getThemePreset,Eg as getWorkflowDefinition,U1 as getWorkflowNodeIndex,ak as hasAnyBusinessFact,Kn as hasDesignTokenBlock,YC as hasLockedSeeds,pj as hashAffectedFormDesignFiles,lj as hashCmsFormSchemaProjection,ns as hashFormDesignJson,mj as hashFormSpec,CE as homeLabelForLocale,Br as isCanonicalPageSlug,Wf as isCmsMainProductsWithinLimit,mR as isCmsNavigationHref,M0 as isCmsPageSelectable,Rr as isCmsTemplateUrlPath,kk as isConsentGranted,xh as isDeploymentActiveStatus,$w as isDeploymentTerminalStatus,sf as isExactEditEngineVersion,UT as isExternalSiteEditInfrastructureReason,$N as isFormSpecLocalizableFieldPath,b0 as isKnownStep5SseEventName,hv as isMigrationProductsPresetBlockLabel,gv as isMigrationProductsPresetPageTitle,pL as isModelFileMutationToolName,t0 as isNonLatinSiteLocale,mi as isPageTemplateCandidateEntryPath,Tj as isPlatformMaterializedFile,xf as isReservedSubsiteMountSegment,Kd as isSiteEditDesignDocumentPath,Eu as isSiteEditMaterializationPathTemplate,QS as isSiteEditRuntimeContainerTag,ZS as isSiteEditRuntimeTextTag,TC as isSiteEditRuntimeVoidElementTag,Yk as isSiteEditSourceDeleteProtectedPath,Wd as isSiteEditSourceDirectoryPath,or as isSiteEditSourcePath,ks as isSiteEditTextSourcePath,Fx as isSitePublishRepairResultSuccessful,yj as isSiteStructureKnownFieldPath,bj as isSiteStructureLocalizableFieldPath,p0 as isStep5RequiredStrategyKey,ps as isTopLevelPage,NC as isUserStoppedRunErrorCode,F1 as isWorkflowTaskTypeForNode,dL as isWorkspaceFileMutationToolName,Kl as listChildPages,wS as makeSiteEditRepeatInstanceKey,OE as markAllPagesInHeader,_v as migrationProductsCopyForLocale,DE as moreLabelForLocale,qE as navLabelCollisionKey,DN as normalizeCmsApplicationSlug,vy as normalizeCmsPublicApiBase,Ym as normalizeFormOptionLabelIdentity,ii as normalizeGscDomain,$a as normalizePageTemplatePagePath,ls as normalizeStructureTitle,jE as orderNavigationLinksByStructure,Bl as orderSitemapPagesForDisplay,n_ as pageSlugToRouteFilePath,F0 as parseCmsPageDirectory,av as parseComponentI18nResourcesJson,AE as parseE2bPreviewProxyDomain,of as parseExactEditEngineVersion,Mk as parseSiteEditCompositionKey,PS as parseSiteEditRepeatInstanceKey,LA as parseSiteEditSourceIdentityKey,ro as parseWorkspaceAttachmentImagePath,ej as projectFormSpecToCmsSchema,Jh as readColorScheme,ji as readDesignTokens,EP as readGlobalsDesignValues,Hc as readSiteDesignNotes,uw as readWorkspaceAttachmentReferences,wE as reconcileSitemapNavigation,Cj as resolveCmsPublicRuntimeBinding,Ah as resolveFont,nn as resolveFontDisplayName,JN as resolveFormTemplateText,M1 as resolvePublishedWorkflowDefinition,dk as resolveRedisConnectionConfig,qC as resolveRequestedEditEngineVersion,mr as resolveSelectableSiteLocale,kC as resolveSiteEditRuntimeOperationSummary,e0 as resolveSiteLocaleFromIso6393,Jk as resolveSiteTextDirection,rb as resolveStep6RadiusId,cb as resolveStep6WeightStyle,WC as resolveSystemCurrentEditEngineVersion,jN as resolveTemplateFormScene,lP as resolveTryOnFontWeights,Rg as selectPublishedWorkflowDefinition,Ok as selectReferenceVisualImage,h1 as siteBuildStatusFromCode,y1 as siteBuildStatusToCode,S1 as siteDeploymentStatusFromCode,x1 as siteDeploymentStatusToCode,Nh as siteFontVariables,mP as siteLeadingBody,cP as siteWeightVariables,f1 as siteWorkflowStatusFromCode,E1 as siteWorkflowStatusToCode,cf as splitSubsiteGlossaryEntry,mb as step6GptVisualIdentity,_P as stripSiteDesignNotes,Zv as stripSiteEditRepeatInstanceKeys,b1 as taskExecutionStatusFromCode,R1 as taskExecutionStatusToCode,$O as toStep6GenerationVisualHints,zr as tryCanonicalizeAsciiPageSlug,gP as upsertSiteDesignNotes,im as validateComponentI18nResources,YN as validateFormSpecIdentityTransition,ME as validateSitemapStructure,dw as workspaceAttachmentImagePath,xP as writeColorScheme,yP as writeDesignTokens};
|
|
11
|
+
${e.slice(c)}`}var an="/* <cms-builder:global-design-tokens> */",Wn="/* </cms-builder:global-design-tokens> */",Me=class extends Error{constructor(n,i){super(`${n}: ${i}`),this.code=n,this.name="DesignTokenBlockError"}};function Zh(e){let n=[],i=0;for(;i<e.length;){let s=e.indexOf(an,i),o=e.indexOf(Wn,i);if(s<0){if(o>=0)throw new Me("DESIGN_TOKEN_BLOCK_MISSING","a closing global-design-tokens marker appears without a matching opening marker.");break}if(o<0||o<s)throw new Me("DESIGN_TOKEN_BLOCK_MISSING","a global-design-tokens region is opened but never closed.");let a=s+an.length,c=e.indexOf(an,a);if(c>=0&&c<o)throw new Me("DESIGN_TOKEN_BLOCK_MISSING","global-design-tokens regions are nested; refusing to guess the intended boundaries.");n.push({bodyStart:a,bodyEnd:o}),i=o+Wn.length}if(n.length===0)throw new Me("DESIGN_TOKEN_BLOCK_MISSING","app/globals.css does not contain a cms-builder:global-design-tokens region.");return n}var Jh=/^--[A-Za-z0-9_-]+/;function eS(e){return e===void 0||e==="{"||e==="}"||e===";"||/\s/.test(e)}function Xc(e,n,i){let s=[],o=n,a=0;for(;o<i;){let c=e[o];if(c==="/"&&e[o+1]==="*"){let r=e.indexOf("*/",o+2);o=r<0||r>=i?i:r+2;continue}if(c==='"'||c==="'"){o=Qc(e,o,i);continue}if(c==="("){a+=1,o+=1;continue}if(c===")"){a=Math.max(0,a-1),o+=1;continue}if(c==="-"&&a===0&&e[o+1]==="-"&&eS(o===0?void 0:e[o-1])){let r=Jh.exec(e.slice(o,i));if(r){let m=r[0],S=o+m.length;for(;S<i&&(e[S]===" "||e[S]===" ");)S+=1;if(e[S]===":"){for(S+=1;S<i&&(e[S]===" "||e[S]===" ");)S+=1;let g=S,w=tS(e,g,i),H=e.slice(g,w).trimEnd();s.push({name:m,value:H.trim(),valueStart:g,valueEnd:g+H.length}),o=w;continue}}}o+=1}return s}function Qc(e,n,i){let s=e[n],o=n+1;for(;o<i;){let a=e[o];if(a==="\\"){o+=2;continue}if(a===s)return o+1;o+=1}return i}function tS(e,n,i){let s=n,o=0;for(;s<i;){let a=e[s];if(a==="\\"){s+=2;continue}if(a==='"'||a==="'"){s=Qc(e,s,i);continue}if(a==="/"&&e[s+1]==="*"){let c=e.indexOf("*/",s+2);s=c<0||c>=i?i:c+2;continue}if(a==="(")o+=1;else if(a===")")o=Math.max(0,o-1);else if(o===0&&(a===";"||a==="}"))return s;s+=1}return i}function Zc(e){return Zh(e).flatMap(n=>Xc(e,n.bodyStart,n.bodyEnd))}function nS(e){return new Set(Xc(e,0,e.length).map(n=>n.name))}var iS=/[;{}]|\/\*|\*\/|[\r\n]/;function sS(e,n){if(n.trim().length===0)throw new Me("DESIGN_TOKEN_UNSAFE_VALUE",`refusing to write an empty declaration value for ${e}.`);if(iS.test(n))throw new Me("DESIGN_TOKEN_UNSAFE_VALUE",`refusing to write a declaration value for ${e} that contains a declaration or block terminator, a comment marker, or a newline.`)}function ji(e){let n=new Map;for(let i of Zc(e))n.set(i.name,i.value);return n}function wP(e,n,i={}){let s=Zc(e),o=new Set(s.map(g=>g.name)),a=new Set,c=new Set,r=[],m=null;for(let g of n.keys())if(!o.has(g)){if(i.derivedKeys?.has(g)!==!0){r.push(g);continue}m??=nS(e),m.has(g)?c.add(g):a.add(g)}if(r.length>0)throw new Me("DESIGN_TOKEN_UNKNOWN",`refusing to add token names that the shared derivation never produces: ${r.join(", ")}`);for(let[g,w]of n)o.has(g)&&sS(g,w);for(let g of a)i.onOutOfScopeToken?.(g);for(let g of c)i.onUnwritableToken?.(g);let S=e;for(let g=s.length-1;g>=0;g-=1){let w=s[g],K=n.get(w.name);K!==void 0&&(S=S.slice(0,w.valueStart)+K+S.slice(w.valueEnd))}return S}function Kn(e){let n=e.indexOf(an),i=e.indexOf(Wn);return n!==-1&&i!==-1&&i>n}var Jc=/(color-scheme:\s*)(light|dark)(\s*;)/;function oS(e){let n=e.indexOf(an),i=e.indexOf(Wn);return n!==-1&&i>n?e.slice(n,i):null}function aS(e){let i=oS(e)?.match(Jc);return i?i[2]:null}function PP(e,n){let i=e.indexOf(an),s=e.indexOf(Wn);if(i===-1||s===-1||s<i)throw new Me("DESIGN_TOKEN_BLOCK_MISSING","globals.css has no design token block");let o=e.slice(i,s);return e.slice(0,i)+o.replace(Jc,`$1${n}$3`)+e.slice(s)}var rS=/["']([^"']+)["']/;function Yc(e){return e?.match(rS)?.[1]??null}function vP(e){if(!Kn(e))return null;let n;try{n=ji(e)}catch(m){if(m instanceof Me)return null;throw m}let i=go(n.get("--primary")??"")?.toLowerCase()??null,s=go(n.get("--accent")??"")?.toLowerCase()??null,o=Yc(n.get("--site-font-heading")),a=Yc(n.get("--site-font-sans")),c=$c(e),r=c?.paletteInputs??null;return{primary:i,accent:s,...r?.foreground!==void 0?{foreground:r.foreground}:{},...r?.neutral!==void 0?{neutral:r.neutral}:{},...r?.supporting!==void 0?{supporting:r.supporting}:{},...r?.imagePalette!==void 0?{imagePalette:r.imagePalette}:{},surfaceMode:aS(e),fonts:o&&a?{heading:nn(o),body:nn(a)}:null,paletteInputs:r,paletteInputsPresent:r!=null,notesLines:c?.lines??null,weightStyle:n.has("--site-weight-display")&&c?.typeInputs?c.typeInputs.weightStyle:null}}var Li=(e,n)=>e.split(n).length-1;function cS(e){let n=0,i=0,s=0,o=e.length;for(;s<o;){let a=e[s];if(a==="/"&&e[s+1]==="*"){let c=e.indexOf("*/",s+2);s=c===-1?o:c+2;continue}if(a==='"'||a==="'"){let c=a;for(s+=1;s<o;){if(e[s]==="\\"){s+=2;continue}if(e[s]===c){s+=1;break}s+=1}continue}a==="{"?n+=1:a==="}"&&(i+=1),s+=1}return{open:n,close:i}}var em=e=>{let{open:n,close:i}=cS(e);return n===i};function NP(e,n){if(em(e)&&!em(n))return{ok:!1,code:"GLOBALS_CSS_UNBALANCED",message:"app/globals.css has unbalanced braces."};if(Kn(e)&&!Kn(n))return{ok:!1,code:"GLOBALS_CSS_TOKEN_BLOCK_MISSING",message:"Keep the /* <cms-builder:global-design-tokens> */ and /* </cms-builder:global-design-tokens> */ markers in app/globals.css."};if(Li(e,on)===Li(e,Kt)&&Li(n,on)!==Li(n,Kt))return{ok:!1,code:"GLOBALS_CSS_NOTES_UNPAIRED",message:"The site design notes comment must keep both of its markers."};if(Kn(e)){let s=null;try{s=ji(e)}catch(a){if(!(a instanceof Me))throw a}let o;try{o=ji(n)}catch(a){if(a instanceof Me)return{ok:!1,code:"GLOBALS_CSS_TOKEN_BLOCK_MALFORMED",message:`app/globals.css design token block is malformed: ${a.message}`};throw a}if(s){let a=[...s.keys()].filter(c=>!o.has(c));if(a.length>0)return{ok:!1,code:"GLOBALS_CSS_TOKEN_REMOVED",message:`Do not delete design tokens from app/globals.css; change their values instead. Removed: ${a.slice(0,8).join(", ")}`}}}return{ok:!0}}import{z as q}from"zod";var qP="x-vcp-run-lease-owner",WP=600*1e3,KP=60*1e3,BP=3,zP=2,HP="WORKSPACE_RUN_RESUME_EXHAUSTED",VP="WORKSPACE_CHECK_INCOMPLETE",$P="WORKSPACE_GENERATION_STOPPED",YP="WORKSPACE_FILL_IN_INTERRUPTED",XP="WORKSPACE_RUN_LEASE_SUPERSEDED",QP="WORKSPACE_RUN_NOT_ACTIVE",ZP="FILL_IN_NOT_AVAILABLE",JP="FILL_IN_TARGET_NOT_OMITTED",ev="FILL_IN_TARGET_MODIFIED",mS=q.object({authMode:q.enum(["disabled-dev","internal-service","oidc"]),user_id:q.string().min(1),external_user_id:q.string().min(1).optional(),email:q.string().min(1).optional(),display_name:q.string().min(1).optional()}).strict(),tv=q.object({run_id:V,lease_owner:q.string().min(1),lease_ms:q.number().int().positive().max(1800*1e3).optional()}).strict(),nv=q.object({status:q.enum(["renewed","not_active","superseded"]),expires_at:q.string().min(1).nullable(),stop_requested:q.boolean()}).strict(),tm=q.object({run_id:V,page_id:q.string().min(1),attempt:q.number().int().positive(),snapshot_id:A,object_key:q.string().min(1),manifest_hash:q.string().min(1),file_paths:q.array(q.string().min(1)).min(1),created_at:q.string().min(1)}).strict(),iv=tm.omit({created_at:!0}).extend({lease_owner:q.string().min(1)}).strict(),sv=q.object({checkpoints:q.array(tm)}).strict(),nm=q.object({kind:q.enum(["page","component","shared"]),target_id:q.string().min(1)}).strict(),ov=q.object({run_id:V,site_id:k,tenant_id:q.string().min(1),run_kind:q.enum(["initial_generation","iteration","landing_page","fill_in"]),status:q.enum(["queued","running","succeeded","failed","cancelled"]),base_snapshot_id:A.nullable(),lease_owner:q.string().min(1).nullable(),resume_count:q.number().int().nonnegative(),stop_requested:q.boolean(),reuse_from_run_id:V.nullable(),source_run_id:V.nullable(),fill_in_targets:q.array(nm),execution_scene:ys.nullable().optional(),intent:q.literal("navigation_adaptation").optional(),page_template_manifest:Ya.nullable().optional()}).strict().superRefine((e,n)=>{e.execution_scene==="page_template_create"?(e.run_kind!=="iteration"||!e.page_template_manifest)&&n.addIssue({code:"custom",message:"Page Template execution requires an iteration run with its authoritative manifest"}):e.page_template_manifest&&n.addIssue({code:"custom",message:"Only Page Template execution has a batch manifest"})}),av=q.object({runs:q.array(q.object({run_id:V,site_id:k,tenant_id:q.string().min(1),run_kind:q.literal("initial_generation"),base_snapshot_id:A,sitemap_id:Te,resume_count:q.number().int().nonnegative(),lease_owner:q.string().min(1),stop_requested:q.boolean(),resume_principal:mS}).strict())}).strict(),rv=q.object({site_id:k}).strict(),cv=q.object({status:q.enum(["requested","already_requested","stopped","no_active_run"]),run_id:V.nullable()}).strict(),mv=q.object({ledger:kn.nullable(),source_run_id:V.nullable(),updated_at:q.string().min(1).nullable()}).strict(),lv=q.object({targets:q.array(nm).min(1).max(50),client_run_key:q.string().min(1).max(400)}).strict();import{z as lS}from"zod";var uv=".i18n.json",Mi="translation",im=new Set(["__proto__","constructor","prototype"]);function om(e){if(!Ui(e)||Object.keys(e).length===0)return wt("I18N_ROOT_INVALID","Component i18n resources must be a non-empty object.",[]);for(let[n,i]of Object.entries(e)){if(im.has(n))return sm([n]);if(!pS(n))return wt("I18N_LOCALE_INVALID",`Component i18n locale must be canonical BCP-47: ${n}`,[n]);if(!Ui(i))return wt("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let s=Object.keys(i);if(s.length!==1||s[0]!==Mi)return wt("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let o=i[Mi];if(!Ui(o))return wt("I18N_RESOURCE_TREE_INVALID",`Component i18n translation namespace for ${n} must be an object.`,[n,Mi]);let a=[{value:o,path:[n,Mi]}];for(;a.length>0;){let c=a.pop();for(let[r,m]of Object.entries(c.value)){let S=[...c.path,r];if(im.has(r))return sm(S);if(typeof m!="string"){if(!Ui(m))return wt("I18N_RESOURCE_TREE_INVALID","Component i18n resource leaves must be strings.",S);a.push({value:m,path:S})}}}}return{success:!0,data:e}}function _v(e){let n;try{n=JSON.parse(e)}catch{return wt("I18N_JSON_INVALID","Component i18n resource file must contain valid JSON.",[])}return om(n)}var gv=lS.custom(e=>om(e).success,"Invalid component i18n resources.");function pS(e){try{let n=Intl.getCanonicalLocales(e);return n.length===1&&n[0]===e}catch{return!1}}function Ui(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}function sm(e){return wt("I18N_RESOURCE_KEY_FORBIDDEN",`Component i18n resource key is forbidden: ${e.at(-1)??""}`,e)}function wt(e,n,i){return{success:!1,error:{code:e,message:n,path:i}}}var St="products",dS=`/${St}`,Sv=dS,fv=`${St} detail`,bv="cms_collection_view",yv="list",xv="detail",st={zhHans:{pageTitle:"\u4EA7\u54C1\u4E2D\u5FC3",blockLabel:"\u4EA7\u54C1\u6982\u89C8",detailBlockLabel:"\u4EA7\u54C1\u8BE6\u60C5",heroBlockLabel:"\u4EA7\u54C1\u7B80\u4ECB",homeLabel:"\u9996\u9875"},zhHant:{pageTitle:"\u7522\u54C1\u4E2D\u5FC3",blockLabel:"\u7522\u54C1\u6982\u89BD",detailBlockLabel:"\u7522\u54C1\u8A73\u60C5",heroBlockLabel:"\u7522\u54C1\u7C21\u4ECB",homeLabel:"\u9996\u9801"},en:{pageTitle:"Products",blockLabel:"Products overview",detailBlockLabel:"Product details",heroBlockLabel:"Products Introduction",homeLabel:"Home"},de:{pageTitle:"Produkte",blockLabel:"Produkt\xFCbersicht",detailBlockLabel:"Produktdetails",heroBlockLabel:"Produkteinf\xFChrung",homeLabel:"Startseite"},fr:{pageTitle:"Produits",blockLabel:"Aper\xE7u des produits",detailBlockLabel:"D\xE9tails du produit",heroBlockLabel:"Pr\xE9sentation des produits",homeLabel:"Accueil"},es:{pageTitle:"Productos",blockLabel:"Resumen de productos",detailBlockLabel:"Detalles del producto",heroBlockLabel:"Introducci\xF3n de productos",homeLabel:"Inicio"},ja:{pageTitle:"\u88FD\u54C1",blockLabel:"\u88FD\u54C1\u6982\u8981",detailBlockLabel:"\u88FD\u54C1\u8A73\u7D30",heroBlockLabel:"\u88FD\u54C1\u7D39\u4ECB",homeLabel:"\u30DB\u30FC\u30E0"},ko:{pageTitle:"\uC81C\uD488",blockLabel:"\uC81C\uD488 \uAC1C\uC694",detailBlockLabel:"\uC81C\uD488 \uC0C1\uC138",heroBlockLabel:"\uC81C\uD488 \uC18C\uAC1C",homeLabel:"\uD648"}},uS=new Set(Object.values(st).map(e=>e.pageTitle)),_S=new Set(Object.values(st).flatMap(e=>[e.blockLabel,e.detailBlockLabel,e.heroBlockLabel]));function Ev(e){let n=e?.trim().toLowerCase()??"";if(n==="zh-tw"||n==="zh-hk"||n==="zh-mo")return st.zhHant;if(n.startsWith("zh"))return st.zhHans;switch(n.split("-")[0]){case"de":return st.de;case"fr":return st.fr;case"es":return st.es;case"ja":return st.ja;case"ko":return st.ko;case"en":default:return st.en}}function Rv(e){return uS.has(e.trim())}function Iv(e){return _S.has(e.trim())}import{z as rn}from"zod";var wv="SITE_HAS_ACTIVE_SUBSITES",Pv="SITE_HAS_SUBSITES",gS=rn.object({site_id:k,name:rn.string().min(1),mount_path:rn.string().min(1),archived_at:rn.string().nullable()}),vv=rn.object({subsites:rn.array(gS)});import{z as ke}from"zod";var Nv=ke.object({key:ke.string().min(1),composition:_e}).strict(),Gi=ke.enum(["component-boundary","repeat-region","conditional-region","fragment-region","opaque-region"]),hS=ke.enum(["direct","proxy","upstream","readonly","unsupported"]),SS=ke.enum(["component-boundary","repeat-region","conditional-region","opaque-region","void-element","read-only","cross-file-required","import-required"]),Fi=ke.object({mode:hS,reasonCode:ke.string().min(1).optional()}),fS=ke.object({kind:SS,message:ke.string().min(1)}),qi=ke.object({composition:B,key:ke.string().min(1),canUpdateText:ke.boolean(),canInsertChild:ke.boolean(),canMove:ke.boolean(),canRemove:ke.boolean(),editModes:ke.object({updateText:Fi.optional(),insertChild:Fi.optional(),move:Fi.optional(),remove:Fi.optional()}).optional(),constraints:ke.array(fS)}).strict();import{z as X}from"zod";var qv=X.discriminatedUnion("type",[X.object({type:X.literal("site-edit.document.changed"),siteId:k,snapshotId:A,composition:B,version:X.number().int().nonnegative(),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.operation.planned"),siteId:k,operationId:X.string().min(1),baseSnapshotId:A,composition:B,changedFiles:X.array(X.string().min(1)),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.operation.completed"),siteId:k,composition:B,result:Xs,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.operation.failed"),siteId:k,composition:B,requestId:X.string().min(1),error:_c,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.capability.changed"),siteId:k,composition:B,keys:X.array(X.string().min(1)),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.invalidated"),siteId:k,composition:B,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.ready"),siteId:k,composition:B,version:X.number().int().nonnegative(),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.error"),siteId:k,composition:B,message:X.string().min(1),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.snapshot.changed"),siteId:k,composition:B,snapshotId:A,previousSnapshotId:X.string().min(1).nullable(),at:X.string().min(1)}).strict()]);import{z as ce}from"zod";var zv="durable-history-v1",Wi=ce.object({initiatingComposition:B.optional(),affectedCompositions:ce.array(B)}).strict(),Hv=ce.enum(["writable","read-only-recovery","unavailable"]),bS=ce.enum(["INDEX_CORRUPT","ENTRY_MISSING","BLOB_MISSING","FILESYSTEM_UNAVAILABLE","ROLLBACK_INCOMPLETE","UNKNOWN"]),yS=ce.object({code:bS,message:ce.string().min(1),occurredAt:ce.iso.datetime().optional()}).strict(),xS=ce.enum(["NOT_INITIALIZED","FILESYSTEM_UNAVAILABLE","UNSUPPORTED_RUNTIME"]),am={revision:ce.number().int().nonnegative(),undoDepth:ce.number().int().nonnegative(),redoDepth:ce.number().int().nonnegative()},ES=ce.object({mode:ce.literal("writable"),composition:B,...am,canUndo:ce.boolean(),canRedo:ce.boolean(),provenance:Wi.optional()}).strict().superRefine((e,n)=>{e.canUndo!==e.undoDepth>0&&n.addIssue({code:"custom",path:["canUndo"],message:"canUndo must reflect undoDepth."}),e.canRedo!==e.redoDepth>0&&n.addIssue({code:"custom",path:["canRedo"],message:"canRedo must reflect redoDepth."})}),RS=ce.object({mode:ce.literal("read-only-recovery"),composition:B,...am,canUndo:ce.literal(!1),canRedo:ce.literal(!1),recoveryDiagnostic:yS,provenance:Wi.optional()}).strict(),IS=ce.object({mode:ce.literal("unavailable"),composition:B,revision:ce.literal(0),undoDepth:ce.literal(0),redoDepth:ce.literal(0),canUndo:ce.literal(!1),canRedo:ce.literal(!1),reason:xS,provenance:Wi.optional()}).strict(),TS=ce.discriminatedUnion("mode",[ES,RS,IS]),Vv=ce.object({composition:B,status:TS,provenance:Wi}).strict();import{z as $}from"zod";var Ki=$.enum(["api-field","cms-field","i18n-message","config-entry"]),Io=$.object({kind:$.enum(["jsx-node","value-path","route-export","external-entry"]),file:$.string().min(1).optional(),isProxy:$.boolean(),displayPath:$.string().min(1).optional(),sourceType:Ki.optional(),sourceId:$.string().min(1).optional()}),kS=$.discriminatedUnion("status",[$.object({status:$.literal("resolved"),value:Wt}).strict(),$.object({status:$.literal("undefined")}).strict(),$.object({status:$.literal("unresolved")}).strict()]),AS=$.object({kind:$.enum(["literal","boolean-shorthand","expression","binding","repeat-template"]),raw:$.string().optional()}).strict(),wS=$.object({name:$.string().min(1),source:AS,resolution:kS,editMode:$.enum(["direct","proxy","upstream","readonly","unsupported"]),sourceScope:$.enum(["node","repeat-item","repeat-template"]),allowedWriteScopes:$.array($.enum(["selection","template"])),effectiveWriteTarget:Io.optional(),diagnostics:$.array($.object({code:$.string().min(1),message:$.string().min(1)}).strict())}).strict(),PS=$.object({raw:$.string().min(1),sourceRange:dt,order:$.number().int().nonnegative(),diagnostics:$.array($.object({code:$.string().min(1),message:$.string().min(1)}).strict())}).strict(),vS=$.object({selection:$.enum(["direct","materialize","unsupported"]),template:$.enum(["direct","unsupported"])}).strict(),To=$.object({documentVersion:$.number().int().nonnegative(),selectionRef:en.optional(),items:$.array(wS),spreads:$.array(PS),creation:vS}).strict().superRefine((e,n)=>{let i=e.selectionRef;i&&i.instanceIndex!==void 0&&i.instanceCount!==void 0&&i.instanceIndex>=i.instanceCount&&n.addIssue({code:"custom",path:["selectionRef","instanceIndex"],message:"instanceIndex must be smaller than instanceCount"})});import{z as Ae}from"zod";var CS=Ae.string().min(1).refine(e=>!e.startsWith("/")&&!e.includes(".."),{message:"Patch paths must be safe relative POSIX paths."}),DS=Ae.string().regex(/^sha256:[a-f0-9]{64}$/),OS=Ae.object({path:CS,operation:Ae.enum(["create","update","delete"]),expectedHash:DS.optional(),fullContent:Ae.string().optional()}).superRefine((e,n)=>{e.operation==="delete"&&e.fullContent!==void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"delete patches must not include fullContent"}),e.operation!=="delete"&&e.fullContent===void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"create/update patches must include fullContent"})}),NS=Ae.object({siteId:k,baseSnapshotId:A,operationId:Ae.string().min(1),reason:Ae.string().min(1),patches:Ae.array(OS).min(1),changedCompositions:Ae.array(B),changedRouteIds:Ae.array(Ae.string().min(1)).optional(),diagnostics:Ae.array(Ae.object({code:Ae.string().min(1),message:Ae.string().min(1),path:Ae.string().min(1).optional()})).default([])}).strict().superRefine((e,n)=>{let i=new Set;for(let[o,a]of e.patches.entries())i.has(a.path)&&n.addIssue({code:"custom",path:["patches",o,"path"],message:`Duplicate patch path: ${a.path}`}),i.add(a.path);let s=[...new Set(e.changedCompositions.map(o=>o.routeId))];e.changedRouteIds!==void 0&&(e.changedRouteIds.length!==s.length||e.changedRouteIds.some((o,a)=>o!==s[a]))&&n.addIssue({code:"custom",path:["changedRouteIds"],message:"changedRouteIds must be the stable deduplicated route projection of changedCompositions."})}),iC=NS.transform(e=>({...e,changedRouteIds:[...new Set(e.changedCompositions.map(n=>n.routeId))]}));var ko="::repeat-item#";function jS(e,n){return`${e}${ko}${n}`}function oC(e,n){return n.reduce((i,s)=>jS(i,s),e)}function LS(e){if(typeof e!="string"||e.length===0)return null;let n=[],i=e;for(;;){let s=i.lastIndexOf(ko);if(s<0)break;let o=Number(i.slice(s+ko.length));if(!Number.isInteger(o)||o<0)return null;n.unshift({repeatIndex:o}),i=i.slice(0,s)}return!i||n.length===0?null:{baseKey:i,parts:n}}function aC(e){return LS(e)?.baseKey??e??null}import{z as l}from"zod";import{z as Ne}from"zod";var MS=Ne.object({placementKey:Ne.string().min(1),placementUnitKey:Ne.string().min(1),relation:Ne.enum(["before","after","prepend","append"])}).strict(),US=Ne.object({status:Ne.literal("supported"),containerKey:Ne.string().min(1),hasBusinessMembers:Ne.boolean(),placementUnitKeys:Ne.array(Ne.string().min(1)),placements:Ne.array(MS)}).strict().superRefine((e,n)=>{let i=new Set(e.placementUnitKeys);i.size!==e.placementUnitKeys.length&&n.addIssue({code:"custom",path:["placementUnitKeys"],message:"Render page composition placement unit keys must be unique."});let s=new Set;e.placements.forEach((o,a)=>{s.has(o.placementKey)&&n.addIssue({code:"custom",path:["placements",a,"placementKey"],message:"Render page composition placement keys must be unique."}),s.add(o.placementKey),i.has(o.placementUnitKey)||n.addIssue({code:"custom",path:["placements",a,"placementUnitKey"],message:"Render page composition placement must reference a projected unit."})})}),FS=Ne.object({status:Ne.literal("unsupported"),reason:wi,diagnostics:Ne.array(Ln)}).strict(),rm=Ne.discriminatedUnion("status",[US,FS]);var GS=l.object({canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean()}),cm=l.enum(["vcp-cms-collection","vcp-cms-form","vcp-cms-settings","vcp-cms-navigation","site-api-route","external-api","unknown-api"]),qS=l.enum(["cms-field","api-field"]),WS=l.enum(["text","attribute","richtext","repeat-region","conditional-region","component-prop"]),KS=l.enum(["exact","safe-derived","partial","unknown"]),BS=l.object({file:l.string().min(1),symbol:l.string().min(1).optional(),reason:l.string().min(1)}),zS=l.object({sourceKind:cm,sourceType:qS,endpointPattern:l.string().min(1).optional(),operation:l.string().min(1).optional(),collection:l.string().min(1).optional(),fieldPath:l.string().min(1).optional(),valuePath:l.string().min(1).optional(),targetKind:WS,targetName:l.string().min(1),confidence:KS,readonly:l.literal(!0),evidence:l.array(BS)}),mm=l.object({hasDynamicData:l.boolean(),bindings:l.array(zS)}),lm=l.object({hasDynamicData:l.boolean(),sourceKinds:l.array(cm),collections:l.array(l.string().min(1)).min(1).optional(),primaryEndpoint:l.string().min(1).optional(),primaryCollection:l.string().min(1).optional(),primaryFieldPath:l.string().min(1).optional()}),HS=l.object({key:l.string().min(1),parentKey:l.string().min(1).nullable().optional(),pageCompositionUnitKey:l.string().min(1).optional(),operationSummary:GS,dynamicDataSummary:lm.optional()}).strict(),RC=l.object({composition:_e}).strict(),IC=l.object({key:l.string().min(1),composition:_e,selectionRef:en.optional()}).strict(),TC=l.object({siteId:k,snapshotId:A,composition:B,version:l.number().int().nonnegative(),entries:l.array(HS),pageComposition:rm}).strict(),pm=l.object({kind:l.enum(["literal","binding","imported-binding","repeat-template"]),file:l.string().min(1),expression:l.string().min(1),bindingName:l.string().min(1).optional(),path:l.array(l.union([l.string(),l.number()])).optional()}),Ao=l.object({index:l.number().int().min(0),value:l.string(),editable:l.boolean(),source:pm.nullable()}),Bn=l.object({key:l.string().min(1),label:l.string().min(1),tag:l.string().min(1)}),kC=l.object({composition:B,key:l.string().min(1),canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean(),boundaryKind:Gi.nullable(),isOpaque:l.boolean()}).strict(),VS=l.object({kind:l.enum(["jsx-node","component-proxy","value-binding","route-export"]),file:l.string().min(1),componentName:l.string().min(1),isProxy:l.boolean()}),dm=l.object({kind:l.union([l.enum(["jsx-literal","component-prop","binding","imported-binding","object-field","array-item","repeat-template","conditional-branch"]),Ki]),file:l.string().min(1),displayPath:l.string().min(1),externalSource:l.object({sourceType:Ki,sourceId:l.string().min(1),adapterId:l.string().min(1).optional()}).optional()}),$S=l.object({kind:dm.shape.kind,file:l.string().min(1),displayName:l.string().min(1),canEditHere:l.boolean()}),zn=l.object({finalSource:dm.nullable(),chain:l.array($S),confidence:l.enum(["exact","safe-derived","partial","unknown"]),editMode:l.enum(["direct","proxy","upstream","readonly","unsupported"]),diagnostics:l.array(l.object({code:l.string().min(1),message:l.string().min(1)}))}),YS=l.object({kind:l.literal("css-style-model"),properties:l.array(l.object({property:mc,value:l.union([l.string(),l.number(),l.boolean(),l.null()]),resolvedValue:l.union([l.string(),l.number(),l.boolean(),l.null()]).optional(),breakpoint:pc.optional(),state:lc.optional(),variants:l.array(l.string().min(1)).optional(),options:l.array(l.union([l.string(),l.number()])).optional(),editable:l.boolean(),diagnostics:l.array(l.object({code:l.string().min(1),message:l.string().min(1)})).optional(),operationBoundary:l.array(Mn).optional()}))}),AC=l.union([l.record(l.string(),l.unknown()),YS]),um=l.object({kind:l.literal("class-name-source"),className:l.string(),sourceKind:l.enum(["missing","static-attribute","static-expression","dynamic-expression"]),editable:l.boolean(),operationBoundary:l.array(Mn),sourcePath:l.string().min(1).optional(),diagnostics:l.array(l.object({code:l.enum(["missing-class-name","dynamic-binding","non-string-binding"]),message:l.string().min(1)})).optional()}),XS=l.object({startLine:l.number().int().positive(),startColumn:l.number().int().nonnegative(),endLine:l.number().int().positive(),endColumn:l.number().int().nonnegative()}),wo=l.object({sourceFile:l.string().min(1),componentName:l.string().min(1),openingElementRange:XS,structuralPath:l.string().min(1),textPreview:l.string().min(1).optional()}),wC=l.object({composition:B,key:l.string().min(1),tag:l.string().min(1),componentName:l.string().min(1),sourceFile:l.string().min(1),sourceLocator:wo.optional(),label:l.string().min(1),capabilities:qi,writeTarget:VS,effectiveWriteTarget:Io.optional(),provenanceChain:zn.optional(),componentSemantic:l.record(l.string(),l.unknown()).optional(),styleSource:um.optional(),conditional:l.record(l.string(),l.unknown()).optional(),dynamicData:mm.optional(),properties:To.optional(),textSegments:l.array(Ao),boundaryKind:Gi.nullable(),isOpaque:l.boolean(),ancestors:l.array(Bn),children:l.array(Bn),siblings:l.array(Bn)}).strict(),PC=l.object({composition:B,key:l.string().min(1),tag:l.string().min(1),label:l.string().min(1),sourceLocator:wo.optional(),capabilities:l.object({constraints:qi.shape.constraints}),isOpaque:l.boolean(),provenanceChain:l.object({editMode:zn.shape.editMode,diagnostics:zn.shape.diagnostics}).optional(),dynamicDataSummary:lm.optional(),ancestors:l.array(Bn)}).strict(),vC=l.object({composition:B,key:l.string().min(1),tag:l.string().min(1),label:l.string().min(1),sourceLocator:wo.optional(),isOpaque:l.boolean(),ancestors:l.array(Bn),componentName:l.string().min(1),sourceFile:l.string().min(1),capabilities:qi,provenanceChain:l.object({editMode:zn.shape.editMode,diagnostics:zn.shape.diagnostics}).optional(),textSegments:l.array(l.object({index:Ao.shape.index,editable:Ao.shape.editable,sourceKind:pm.shape.kind.nullable()})),dynamicData:mm.optional(),properties:To.optional(),boundaryKind:Gi.nullable()}).strict(),CC=l.object({composition:B,key:l.string().min(1),styleSource:um.optional()}).strict();var QS=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],ZS=["article","aside","div","footer","form","header","li","main","nav","ol","section","select","table","tbody","tfoot","thead","tr","ul"],JS=["a","button","em","h1","h2","h3","h4","h5","h6","label","p","small","span","strong"],ef=new Set(QS),tf=new Set(ZS),nf=new Set(JS),sf={canUpdateText:!1,canInsertChild:!1,canMove:!1,canRemove:!1};function OC(e){return ef.has(Po(e))}function of(e){return tf.has(Po(e))}function af(e){return nf.has(Po(e))}function NC(e){let{operationSummary:n}=e;return n?{canUpdateText:n.canUpdateText,canInsertChild:n.canInsertChild,canMove:n.canMove,canRemove:n.canRemove}:e.fallbackMode!=="preview"?{...sf}:{canUpdateText:af(e.tagName),canInsertChild:of(e.tagName),canMove:!1,canRemove:!1}}function Po(e){return e?.trim().toLowerCase()??""}import{z as rf}from"zod";var FC=rf.object({composition:_e,mutationContext:Nn.optional()}).strict();var qC={PATCH_VALIDATION_FAILED:"The code didn't pass validation. Try describing the change more specifically.",PATCH_BATCH_FAILED:"The site code couldn't be generated. Please regenerate the site.",PATCH_BATCH_INVALID:"The change couldn't be applied. Try simpler instructions.",VALIDATION_FAILED:"Your message couldn't be sent as written. Please edit it and try again.",WORKSPACE_MESSAGE_CONTAINS_SECRET:"Your message looks like it contains a secret or token, so it wasn't sent. Remove it and try again.",WORKSPACE_RUN_INPUT_REQUIRED:"Nothing to work on: the request had no instruction, so no edit was started. Describe the change you want and send it.",WORKSPACE_TOOL_RESULT_INVALID:"This change couldn't be completed and was rolled back. Please try again.",WORKSPACE_TOOL_FAILED:"A tool step failed. Please try again.",WORKSPACE_TOOL_RESULT_MISSING:"The tool didn't return a usable result. Please try again.",WORKSPACE_MODEL_STREAM_FAILED:"The model stream ended unexpectedly. Please try again.",WORKSPACE_MODEL_STREAM_ABORTED:"Generation was interrupted before finishing. Please try again.",MODEL_OUTPUT_TRUNCATED:"The response was too long and was cut off before any change was applied. Try again, or split the request into smaller changes.",WORKSPACE_EDIT_NOT_APPLIED:"No change was applied. Try describing the change differently.",PRODUCT_SEARCH_APPLY_NOT_AVAILABLE:"Product search changes aren't available yet. Please try again later.",WORKSPACE_INITIAL_EXECUTION_FAILED:"Initial generation failed. Please retry from the brief.",WORKSPACE_INITIAL_GENERATION_CHECK_FAILED:"Initial generation could not be verified. Please retry.",WORKSPACE_INITIAL_GENERATION_FINALIZE_FAILED:"Initial generation could not finalize. Please retry.",WORKSPACE_INITIAL_GENERATION_QUALITY_GATE_FAILED:"Initial generation failed quality checks. Please regenerate the site.",WORKSPACE_CHECK_INCOMPLETE:"The check couldn't complete, so no page was delivered this round. Please regenerate the site.",WORKSPACE_RUN_RESUME_EXHAUSTED:"Generation was interrupted several times and stopped. Everything already saved is kept; you can regenerate the missing pages.",WORKSPACE_GENERATION_STOPPED:"You stopped this generation before any page was ready. Nothing was lost \u2014 start it again when you want.",WORKSPACE_FILL_IN_INTERRUPTED:"The fill-in run was interrupted and stopped. Your site is unchanged; select the targets again to retry.",WORKSPACE_RUN_LEASE_SUPERSEDED:"Another attempt took over this run, so this one stopped. Reload to see the current progress.",FILL_IN_NOT_AVAILABLE:"Fill-in is available after the site has been generated.",FILL_IN_TARGET_NOT_OMITTED:"One of the selected items is no longer listed as missing. Reload the omissions list and try again.",FILL_IN_TARGET_MODIFIED:"One of the selected items was changed or removed after generation, so it was not filled in. Your edits are kept.",WORKSPACE_ITERATION_QUALITY_GATE_FAILED:"Quality check failed. The change was rolled back; try a smaller or more specific request.",WORKSPACE_SOCKET_DEAD:"The workspace connection was lost. Please retry.",WORKSPACE_RUN_CANCELLED:"The run was cancelled.",WORKSPACE_RUN_ABANDONED:"This run was interrupted and did not finish. Please try again.",WORKSPACE_RUN_REQUEST_FAILED:"Couldn't start the workspace. Please try again.",WORKSPACE_RUN_BAD_RESPONSE:"The server response was malformed. Please try again.",WORKSPACE_SOCKET_UNAVAILABLE:"Workspace connection unavailable. Please try again.",WORKSPACE_SOCKET_ERROR:"The workspace connection had an error. Please try again.",WORKSPACE_SOCKET_CLOSED:"The workspace connection closed. Please try again.",WORKSPACE_SOCKET_OPEN_TIMEOUT:"Couldn't reach the workspace in time. Please try again.",WORKSPACE_CLIENT_MESSAGE_ID_MISSING:"Something went wrong sending your message. Please try again.",SITE_SNAPSHOT_REQUIRED:"This site has no usable snapshot yet. Complete Step 3 first.",AGENT_TIMEOUT:"That took longer than expected. Try breaking the change into smaller pieces.",SANDBOX_NOT_AVAILABLE:"The preview environment isn't ready. Your edits have still been saved.",PREVIEW_BUILD_FAILED:"Preview is available, but the production build failed. Fix the reported build error before deploying.",PREVIEW_BUILD_NOT_CONFIGURED:"Preview is available, but the production build check is not configured.",PREVIEW_BUILD_SANDBOX_NOT_FOUND:"Preview is available, but the build check could not find the active preview sandbox.",WS_CONNECTION_ERROR:"Connection lost. Reconnecting\u2026",USER_MESSAGE_PERSIST_FAILED:"Your message wasn't saved. Please send it again.",CLARIFICATION_REPLY_STALE:"That question has expired. Please tell me what you'd like to do now.",CLARIFY_MODEL_FAILED:"Clarify couldn't finish generating questions. Please try again.",WORKSPACE_RUN_IN_FLIGHT:"Another session is already running. Please try again in a moment.",SITE_OPERATION_LOCKED:"Another change is already running for this site. Wait for it to finish, then try again.",SITE_SITEMAP_DRAFT_STALE:"The draft was updated elsewhere. Reload the latest draft before saving.",SITE_SITEMAP_DRAFT_OPERATION_MISMATCH:"This save identity belongs to a different draft operation.",WORKSPACE_THREAD_NOT_FOUND:"That conversation no longer exists. Switching back to the default conversation.",WORKSPACE_THREAD_ARCHIVED:"This conversation is archived. Start a new one to continue.",WORKSPACE_THREAD_BUSY:"This conversation is still running. Wait for it to finish before archiving.",WORKSPACE_THREAD_READ_ONLY:"Background conversations are read-only here.",WORKSPACE_THREAD_INVALID:"This conversation can't accept new requests right now. Refresh and try again.",EDIT_ENGINE_VERSION_INVALID:"Invalid editor version. Refresh the page and try again.",SANDBOX_DEPENDENCY_SYNC_FAILED:"The preview runtime could not be prepared. Please try again.",SANDBOX_PREVIEW_FAILED:"The site preview failed to start. Please try again.",SANDBOX_DEPENDENCY_VERSION_MISMATCH:"The preview runtime could not be verified. Please try again.",SANDBOX_RUNTIME_NOT_READY:"The preview needs to be refreshed before this change can be applied. Refresh the preview and try again.",GENERIC:"Something went wrong. Please try again."},cf=["WORKSPACE_RUN_CANCELLED","WORKSPACE_GENERATION_STOPPED"],mf=new Set(cf);function WC(e){return typeof e=="string"&&mf.has(e)}var KC={UNDO_OR_ROLLBACK:"I can't roll back from chat. Use the version history at the top right to pick a restore point.",HISTORY_RECALL:"Tell me what you'd like to change now\u2014I'll work from the current page state.",OUT_OF_SCOPE:"That's outside what I can do from chat. Try the corresponding panel on the right."},BC={CARD_HEADER:"Needs your confirmation",FREE_TEXT_PLACEHOLDER:"Or describe what you'd like instead",SUBMIT_LABEL:"Submit"},zC={SEND_FAILED_RETRY:"Send failed \u2014 tap to retry"};var _m="0.10.21",VC="x-vcp-edit-engine-version",$C="x-vcp-edit-engine-version-source",vo=class extends Error{constructor(n="Invalid edit-engine version."){super(n),this.code="EDIT_ENGINE_VERSION_INVALID",this.name="EditEngineVersionParseError"}},lf=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?$/;function pf(e){return lf.test(e)}function df(e){if(typeof e!="string"||!pf(e))throw new vo;return e}function YC(e){return e==null?{version:_m,source:"fallback_current"}:{version:df(e),source:"explicit"}}function XC(){return{version:_m,source:"system_current"}}import{z as Ze}from"zod";var uf=200,_f=200;function gf(e){let n=e.indexOf(":");if(n<=0)return null;let i=e.slice(0,n).trim(),s=e.slice(n+1).trim();return i.length===0||s.length===0?null:{source:i,target:s}}var hf=Ze.string().min(3).max(uf).refine(e=>gf(e)!==null,{message:'glossary entries must be "source:target" pairs split on a half-width colon, e.g. "\u7C73:Rice"'}),JC=Ze.array(hf).max(_f),eD=Ze.object({website_name:Ze.string().min(1).max(200),website_industry:Ze.string().min(1).max(200).optional(),website_description:Ze.string().min(1).max(1e3).optional()}),Sf=Ze.enum(["regional","fonts_only"]),Bi=Ze.string().regex(/^#[0-9a-fA-F]{6}$/,'color must be a "#rrggbb" value'),ff=Ze.object({primary:Bi.optional(),accent:Bi.optional(),foreground:Bi.optional(),neutral:Bi.optional()}),bf=600,tD=Ze.object({mode:Sf.default("regional"),seeds:ff.optional(),note:Ze.string().min(1).max(bf).optional()}),nD={mode:"regional"};function iD(e){return e===void 0?!1:Object.values(e).some(n=>typeof n=="string"&&n.length>0)}import{z as Bt}from"zod";var yf=12,rD=Bt.object({tenant_id:Bt.string().min(1),site_id:k,snapshot_id:A,manifest_hash:Bt.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:Bt.string().min(1).max(2048)}),zi=Bt.number().int().nonnegative().safe(),cD=Bt.object({page_count:zi,translation_character_count:zi,image_estimate:Bt.object({media_key_count:zi,max_replacement_count:zi})}).superRefine((e,n)=>{let{media_key_count:i,max_replacement_count:s}=e.image_estimate;s!==Math.min(i,yf)&&n.addIssue({code:"custom",path:["image_estimate","max_replacement_count"],message:"max replacement count does not match the deterministic ceiling"})});import{z as Ue}from"zod";var xf=Ue.string().trim().min(1),cn=Ue.string().uuid(),Ef=Ue.string().min(1).max(2048).refine(e=>e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>n.length>0&&n!=="."&&n!==".."),"object_key must be a relative snapshot store path without empty, '.' or '..' segments"),gm=Ue.object({snapshot_id:cn,object_key:Ef}),pD=Ue.object({tenant_id:xf,parent_site_id:cn,subsite_site_id:cn,base:gm,target:gm}),dD=Ue.object({subsite_site_id:cn,pending_pages:Ue.array(Ue.string().min(1)),hash_diverged_count:Ue.number().int().nonnegative(),child_only_count:Ue.number().int().nonnegative(),base_snapshot_id:cn,target_snapshot_id:cn}),Rf=Ue.enum(["SUBSITE_DIFF_REQUEST_INVALID","SUBSITE_DIFF_STORE_NOT_CONFIGURED","SUBSITE_DIFF_MANIFEST_MISSING","SUBSITE_DIFF_MANIFEST_INVALID"]),uD=Ue.object({error_code:Rf,message:Ue.string().min(1),side:Ue.enum(["base","target"]).optional()});import{z as J}from"zod";var SD=J.object({tenant_id:J.string().min(1),site_id:k,snapshot_id:A,manifest_hash:J.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:J.string().min(1).max(2048),page_slug:J.string().max(512).optional()}),fD=J.object({site_id:k,snapshot_id:A,unit_count:J.number().int().nonnegative(),file_count:J.number().int().nonnegative(),markdown:J.string().min(1),page_slug:J.string().optional(),page_file:J.string().optional(),entries:J.array(J.object({id:J.string().min(1),file_path:J.string().min(1),line:J.number().int().nullable(),kind:J.string().min(1),text:J.string(),media_key:J.string().optional()})).optional(),images:J.array(J.object({id:J.string().min(1),source:J.enum(["media-registry","source-literal"]),src:J.string().min(1),alt:J.string().nullable(),media_key:J.string().optional(),width:J.number().optional(),height:J.number().optional(),provider:J.string().optional(),is_placeholder:J.boolean(),occurrences:J.array(J.object({file_path:J.string().min(1),line:J.number().int()}))})).optional()});import{z as If}from"zod";var Tf=/^\/[a-z0-9][a-z0-9-]{0,30}$/,kf=Object.freeze(["api","_next","assets","static","robots.txt","sitemap.xml",".well-known"]),Af=new Set(kf);function wf(e){return Af.has(e)}var xD=If.string().regex(Tf).refine(e=>!wf(e.slice(1)),{message:"mount_path must not use a reserved segment (api, _next, assets, static, robots.txt, sitemap.xml, .well-known)"});import{z as ge}from"zod";var Pf=ge.enum(["active","paused","blocked"]),hm=ge.enum(["typecheck_failed","health_failed","validation_failed"]),vf={status:Pf,attempts:ge.number().int().nonnegative(),attempted_template_version:Xe.nullable(),last_error_code:hm.nullable()},mn=ge.object(vf).strict(),Hi=ge.object({template_id:ge.string().trim().min(1),target_template_version:Xe}).strict(),TD=Hi,Cf=ge.discriminatedUnion("action",[ge.object({action:ge.literal("proceed"),state:mn.extend({status:ge.literal("active")})}).strict(),ge.object({action:ge.literal("skip_not_newer"),state:mn.extend({status:ge.literal("active")})}).strict(),ge.object({action:ge.literal("skip_paused"),state:mn.extend({status:ge.literal("paused")})}).strict(),ge.object({action:ge.literal("skip_blocked"),state:mn.extend({status:ge.literal("blocked")})}).strict()]),kD=Hi,AD=Cf,wD=Hi.extend({error_code:hm}),PD=ge.object({state:mn}).strict(),vD=Hi,CD=ge.object({state:mn}).strict();import{z as Y}from"zod";var Df=744*60*60*1e3,Of=Y.enum(["eligible","fast_path","upgraded","skipped","lock_skipped","cas_aborted","validation_failed","blocked","paused"]),Nf=Y.enum(["typecheck","build","health","validation"]),jf=Y.enum(["not_attempted","promoted","aborted"]),LD=Y.object({template_id:Y.string().trim().min(1).max(128),from_version:Xe.nullable(),to_version:Xe,outcome:Of,attempt:Y.number().int().nonnegative().max(2147483647),duration_ms:Y.number().int().nonnegative().max(2147483647),replaced_group_count:Y.number().int().nonnegative().max(2147483647),skipped_group_count:Y.number().int().nonnegative().max(2147483647),validation_stage:Nf.nullable(),cas_outcome:jf.nullable()}).strict(),MD=Y.object({recorded:Y.literal(!0)}).strict(),Sm=Y.object({from:Y.iso.datetime(),to:Y.iso.datetime()}).strict().refine(({from:e,to:n})=>Date.parse(e)<Date.parse(n),{message:"from must be earlier than to",path:["to"]}).refine(({from:e,to:n})=>Date.parse(n)-Date.parse(e)<=Df,{message:"report window must not exceed 31 days",path:["to"]}),UD=Sm,Lf=Y.object({eligible:Y.number().int().nonnegative(),fast_path:Y.number().int().nonnegative(),upgraded:Y.number().int().nonnegative(),skipped:Y.number().int().nonnegative(),lock_skipped:Y.number().int().nonnegative(),cas_aborted:Y.number().int().nonnegative(),validation_failed:Y.number().int().nonnegative(),blocked:Y.number().int().nonnegative(),paused:Y.number().int().nonnegative()}).strict(),FD=Y.object({window:Sm,outcome_counts:Lf,current_state_counts:Y.object({blocked:Y.number().int().nonnegative(),paused:Y.number().int().nonnegative()}).strict(),duration_ms:Y.object({p50:Y.number().int().nonnegative().nullable(),p95:Y.number().int().nonnegative().nullable(),sample_count:Y.number().int().nonnegative()}).strict()}).strict(),GD=Y.object({older_than:Y.iso.datetime(),limit:Y.coerce.number().int().min(1).max(200).default(50),include_candidates:Y.enum(["true","false"]).default("false").transform(e=>e==="true")}).strict(),Mf=Y.object({site_id:k,snapshot_id:A,status:Y.enum(["candidate","deleting"]),created_at:Y.iso.datetime()}).strict(),qD=Y.object({snapshots:Y.array(Mf)}).strict();import{z as ft}from"zod";var Uf=ft.enum(["PREVIEW_SESSION_NOT_FOUND","PREVIEW_SESSION_INVALID","PREVIEW_SESSION_STALE","PREVIEW_SESSION_LOOKUP_FAILED","PREVIEW_SANDBOX_NOT_FOUND","PREVIEW_SANDBOX_CONNECT_FAILED","PREVIEW_SANDBOX_OWNERSHIP_MISMATCH","PREVIEW_ACTIVATION_TIMEOUT","PREVIEW_PREFLIGHT_FAILED","PREVIEW_ENV_LOOKUP_FAILED","PREVIEW_SERVER_START_FAILED","PREVIEW_HEALTH_CHECK_FAILED","SANDBOX_NOT_CONFIGURED"]),Ff=ft.object({status:ft.literal("ready"),preview_url:ft.string().url()}).strict(),Gf=ft.object({status:ft.literal("failed"),code:Uf,message:ft.string().min(1),retryable:ft.boolean()}).strict(),BD=ft.discriminatedUnion("status",[Ff,Gf]);import{z as Pt}from"zod";var qf=["not_started","active","completed"],Wf=Pt.enum(qf),Kf=["not_started","in_progress","completed"],Bf=Pt.enum(Kf),zf=Pt.object({sequence:Pt.number().int().positive(),code:It,status:Bf}).strict(),Hf=Pt.object({site_id:k,workflow_status:Wf,flow_type:tn.nullable(),current_step_code:It.nullable(),completed_count:Pt.number().int().nonnegative(),total_count:Pt.number().int().nonnegative(),steps:Pt.array(zf)}).strict().superRefine((e,n)=>{let i=e.steps.filter(s=>s.status==="completed").length;e.total_count!==e.steps.length&&n.addIssue({code:"custom",path:["total_count"],message:"total_count must equal steps.length."}),e.completed_count!==i&&n.addIssue({code:"custom",path:["completed_count"],message:"completed_count must equal completed steps."}),e.steps.forEach((s,o)=>{s.sequence!==o+1&&n.addIssue({code:"custom",path:["steps",o,"sequence"],message:"Step sequence must be continuous and start at 1."})}),e.workflow_status==="not_started"&&(e.flow_type!==null&&n.addIssue({code:"custom",path:["flow_type"],message:"not_started progress cannot have a flow_type."}),e.current_step_code!==null&&n.addIssue({code:"custom",path:["current_step_code"],message:"not_started progress cannot have a current step."}),(e.completed_count!==0||e.total_count!==0)&&n.addIssue({code:"custom",path:["steps"],message:"not_started progress must have zero counts and no steps."})),e.workflow_status==="active"&&(e.flow_type===null&&n.addIssue({code:"custom",path:["flow_type"],message:"active progress requires a flow_type."}),e.current_step_code===null&&n.addIssue({code:"custom",path:["current_step_code"],message:"active progress requires a current step."})),e.workflow_status==="completed"&&(e.flow_type===null&&n.addIssue({code:"custom",path:["flow_type"],message:"completed progress requires a flow_type."}),e.current_step_code!==null&&n.addIssue({code:"custom",path:["current_step_code"],message:"completed progress cannot have a current step."}),e.steps.some(s=>s.status!=="completed")&&n.addIssue({code:"custom",path:["steps"],message:"completed progress must have only completed steps."}),e.completed_count!==e.total_count&&n.addIssue({code:"custom",path:["completed_count"],message:"completed progress counts must be equal."}))}),XD=L(Hf);import{z as Co}from"zod";var Vf=Co.enum(["none","build","build_publish"]),$f=Co.object({site_id:k,launcher_scope:Vf}),eO=Co.object({permission:$f});function tO(e){return e!=="none"}function nO(e){return e==="build_publish"}import{z as fe}from"zod";var cO="build-context.json",mO=2e5,fm=fe.string().regex(/^sha256:[a-f0-9]{64}$/u),bm=1e3;function Yf(e){return Array.from(e).length<=bm}var Xf=fe.object({kind:fe.enum(["customer_materials","website_scan_diagnosis","committed_strategy"]),digest:fm}).strict(),Qf=fe.object({schema_version:fe.literal(1),flow_type:tn,sources:fe.array(Xf).min(2).max(2)}).strict().superRefine((e,n)=>{let i=new Set(e.sources.map(o=>o.kind)),s=e.flow_type==="with_website"?["website_scan_diagnosis","committed_strategy"]:["customer_materials","committed_strategy"];(i.size!==s.length||s.some(o=>!i.has(o)))&&n.addIssue({code:"custom",path:["sources"],message:"Site-build provenance sources must match the persisted workflow flow."})}),Zf=fe.object({schema_version:fe.literal(1),seed:fm.optional(),cms_settings:fe.object({main_products:fe.string().trim().min(1).refine(Yf,{message:`main_products must contain at most ${bm} characters`}).optional()}).strict().optional(),provenance:Qf.optional()}).strict(),Jf=fe.object({schema_version:fe.literal(1),site_id:k,workflow_id:nt,brief:fe.string().min(1),source:fe.enum(["business_provider","mock"]),payload:Zf}).strict().superRefine((e,n)=>{e.source==="business_provider"&&!e.payload.provenance&&n.addIssue({code:"custom",path:["payload","provenance"],message:"Business site-build context requires persisted provenance."})}),lO=fe.object({source_snapshot_id:A,source_run_id:V,build_context:Jf,page_slugs:fe.array(fe.string().min(1)).optional()}).strict(),pO=fe.object({disposition:fe.enum(["reused","rebased"]),snapshot_id:A}).strict(),eb=fe.object({snapshot:no,workspace_run_id:V.nullable()}).strict(),dO=L(eb);import{z as ot}from"zod";import{z as Be}from"zod";import{z as he}from"zod";import{z as tb}from"zod";var nb=["company_profile","product_manual","product_list","customer_case","product_help","qualification","industry_material"],ym=tb.enum(nb);var xm=he.enum(["pending","running","ready","failed","missing"]),ib=he.object({task_id:he.string().min(1).max(500),status:xm}).strict(),fO=he.object({items:he.array(ib).max(100)}).strict(),Hn=he.string().trim().min(1).max(255),bO=he.object({knowledge_site_id:Hn,source_ids:he.array(Hn).min(1).max(200)}).strict().superRefine((e,n)=>{new Set(e.source_ids).size!==e.source_ids.length&&n.addIssue({code:"custom",message:"Knowledge source IDs must be unique.",path:["source_ids"]})}),sb=he.object({source_file_id:Hn,category_code:ym.nullable(),category_confirmed:he.boolean(),status:xm}).strict(),yO=he.object({ready:he.boolean(),files:he.array(sb),counts:he.object({total:he.number().int().nonnegative(),pending:he.number().int().nonnegative(),running:he.number().int().nonnegative(),ready:he.number().int().nonnegative(),failed:he.number().int().nonnegative(),missing:he.number().int().nonnegative(),unclassified:he.number().int().nonnegative()}).strict()}).strict();var be=e=>Be.string().trim().max(e),Em=Be.array(Be.string().trim().min(1).max(120)).max(20),Do=Be.object({company_name:Be.string().trim().min(1).max(200),brand_name:be(200),primary_products:Be.string().trim().min(1).max(1e3),industry:be(200),applications:be(1e3),business_summary:be(2e3),registered_capital:be(200).default(""),legal_representative:be(200).default(""),target_markets:Em,customer_industries:be(1e3),customer_roles:be(1e3),buying_scenarios:be(2e3),differentiators:be(2e3),competitors:be(1e3),trust_proof:be(2e3),customer_cases:be(3e3),channels:Em,expected_domain:be(255),brand_tone:be(500),contact_name:be(200),contact_info:be(500),timezone:be(100),launch_timing:be(200),input_source_ids:Be.array(Hn).max(50)}).strict(),ob=Be.enum(["draft","submitted"]),Oo=Do.extend({id:Q,tenant_id:Be.string().min(1),site_id:k,workflow_id:nt,status:ob,submitted_at:Be.string().min(1).nullable(),created_at:Be.string().min(1),updated_at:Be.string().min(1)}).strict(),kO=L(Oo),AO=L(Oo),wO=L(Oo.nullable());var OO=Di.extend({expected_current_node:ot.literal("website_scan"),type:ot.literal("existing_site"),result:Di.shape.result.extend({website:ot.string().url(),scan_cards:ot.partialRecord(Dc,mo).refine(e=>Object.keys(e).length>0,{message:"At least one recognized scan card is required."})}).strict()}).strict(),NO=ot.object({expected_current_node:ot.literal("customer_materials"),materials:Do}).strict(),jO=ot.object({expected_current_node:ot.literal("diagnosis")}).strict(),LO=ot.object({expected_current_node:ot.literal("strategy")}).strict();import{z as N}from"zod";var No=["compact","comfortable","airy"],Rm=["none","sm","md","lg","xl"],Im="lg",jo=["subtle","moderate","expressive"],ab=[{id:"subtle",motionLevel:"subtle"},{id:"moderate",motionLevel:"moderate"},{id:"expressive",motionLevel:"expressive"}];function Tm(e){let n=ab.find(i=>i.id===e);if(!n)throw new Error(`Unknown motion preset: ${e}`);return n}var km=["ocean","forest","clay","violet","graphite","crimson"],Am=["ai-forest","ai-navy","ai-steel"],wm=/^gen-[0-9a-f]{8}$/,Lo=[{id:"ai-forest",name:"\u5DE5\u4E1A\u58A8\u7EFF \xB7 Industrial Teal",description:"\u6C89\u7A33\u4E13\u4E1A\uFF0C\u7A81\u51FA\u7CBE\u5BC6\u4E0E\u53EF\u4FE1\u3002",fallbackReason:"\u7A33\u5B9A\u4E13\u4E1A\u7684\u9ED8\u8BA4\u9009\u62E9\u3002",colorSeeds:{primary:"#0E7C6F",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"sm"},{id:"ai-navy",name:"\u79D1\u6280\u6DF1\u84DD \xB7 Deep Tech Blue",description:"\u7406\u6027\u79D1\u6280\u611F\uFF0C\u5F3A\u8C03\u6280\u672F\u5B9E\u529B\u4E0E\u6570\u636E\u53EF\u4FE1\u3002",fallbackReason:"\u6280\u672F\u8868\u8FBE\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#1E3A8A",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"md"},{id:"ai-steel",name:"\u7CBE\u5BC6\u94F6\u7070 \xB7 Precision Steel",description:"\u514B\u5236\u6E05\u6670\uFF0C\u9002\u5408\u53C2\u6570\u4E0E\u5DE5\u7A0B\u7EC6\u8282\u8868\u8FBE\u3002",fallbackReason:"\u53C2\u6570\u4FE1\u606F\u8F83\u591A\u65F6\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#475569",accent:"#94A3B8",foreground:"#111827"},surfaceMode:"light",radius:"none"}],Mo=[{id:"ocean",colorSeeds:{primary:"#1e3a5f",accent:"#2563eb",foreground:"#0f172a"},surfaceMode:"light",radius:"md"},{id:"forest",colorSeeds:{primary:"#14532d",accent:"#16a34a",foreground:"#0f172a"},surfaceMode:"light",radius:"lg"},{id:"clay",colorSeeds:{primary:"#7c2d12",accent:"#ea580c",foreground:"#1c1917"},surfaceMode:"light",radius:"xl"},{id:"violet",colorSeeds:{primary:"#3b0764",accent:"#7c3aed",foreground:"#18181b"},surfaceMode:"light",radius:"lg"},{id:"graphite",colorSeeds:{primary:"#1f2937",accent:"#0d9488",foreground:"#111827"},surfaceMode:"light",radius:"none"},{id:"crimson",colorSeeds:{primary:"#7f1d1d",accent:"#dc2626",foreground:"#1f1012"},surfaceMode:"light",radius:"sm"}];function FO(e){let n=Mo.find(i=>i.id===e);if(!n)throw new Error(`Unknown theme preset: ${e}`);return n}function Pm(e){return Mo.find(n=>n.id===e)?.radius??Lo.find(n=>n.id===e)?.radius}var Uo=N.string().regex(/^#[0-9A-F]{6}$/i),Vn=N.string().trim().min(1).max(500),vm=N.string().datetime({offset:!0}),rb=N.enum(km),cb=N.enum(Am),mb=N.string().regex(wm),$n=N.union([rb,cb,mb]),Yn=N.enum(So),Xn=N.enum(jo),Qn=N.enum(No),Vi=N.enum(Rm),Cm=300,lb=N.string().trim().min(1).max(Cm),$i=N.object({primary:Uo,accent:Uo,foreground:Uo}).strict(),pb=N.object({id:$n,rank:N.number().int().min(1).max(3),name:N.string().trim().min(1).max(120),description:N.string().trim().min(1).max(240),color_seeds:$i,surface_mode:N.enum(["light","dark"]),radius:Vi,font_pairing_id:Yn,motion_preset_id:Xn,density:Qn,weight_style:qe.optional(),reason:Vn}).strict(),Dm=N.object({name:N.string().trim().min(1).max(120),description:N.string().trim().min(1).max(240),reason:Vn,color_seeds:$i,surface_mode:N.enum(["light","dark"]),radius:Vi,font_pairing_id:Yn,motion_preset_id:Xn,density:Qn,weight_style:qe}).strict(),Om=N.object({version:N.number().int().min(1),recommendation_id:N.string().uuid(),theme_preset_id:$n,color_seeds:$i,surface_mode:N.enum(["light","dark"]),font_pairing_id:Yn,motion_preset_id:Xn,density:Qn,radius:Vi.optional(),weight_style:qe.optional(),aesthetic_note:lb.optional(),updated_at:vm}).strict(),db=N.object({id:N.string().uuid(),version:N.number().int().min(1),catalog_version:N.string().trim().min(1).max(80),source:N.object({mode:N.enum(["ai","fallback"]),fallback_reason:N.string().trim().min(1).max(80).nullable()}).strict(),inputs:N.object({industry:N.string().trim().min(1).max(160).optional(),site_language:N.string().trim().min(2).max(35),owner_locale:Ee.optional(),strategy_version:N.number().int().min(1),input_digest:N.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict(),theme:N.object({recommended_id:$n,candidate_ids:N.array($n).length(3),candidates:N.array(pb).length(3)}).strict().superRefine((e,n)=>{e.recommended_id!==e.candidate_ids[0]&&n.addIssue({code:"custom",path:["recommended_id"],message:"recommended_id must be the first candidate"}),e.candidates.some((i,s)=>i.id!==e.candidate_ids[s]||i.rank!==s+1)&&n.addIssue({code:"custom",path:["candidates"],message:"Candidates must follow candidate_ids order."})}),font:N.object({recommended_id:Yn,reason:Vn}).strict(),motion:N.object({recommended_id:Xn,reason:Vn}).strict(),density:N.object({recommended_id:Qn,reason:Vn}).strict(),conversion:Mt.optional(),generated_at:vm}).strict(),XO=N.object({force_refresh:N.boolean().optional()}).strict(),QO=N.object({request_id:N.string().trim().min(1).max(160),site_id:k,cached:N.boolean(),recommendation:db,selection:Om}).strict(),ZO=N.object({recommendation_id:N.string().uuid(),expected_version:N.number().int().min(1),theme_preset_id:$n,color_seeds:$i,surface_mode:N.enum(["light","dark"]),font_pairing_id:Yn,motion_preset_id:Xn,density:Qn,radius:Vi.optional(),weight_style:qe.optional(),aesthetic_note:N.string().trim().max(Cm).optional()}).strict(),JO=N.object({selection:Om}).strict(),ub=4e3,eN=N.object({tenant_id:N.string().trim().min(1).max(160),site_id:k,site_language:N.string().trim().min(2).max(35),owner_locale:Ee,industry:N.string().trim().min(1).max(160).optional(),strategy_version_id:N.string().uuid(),strategy_version:N.number().int().min(1),strategy_checksum:N.string().regex(/^[a-f0-9]{64}$/),strategy_summary:N.array(N.string().trim().min(1).max(ub)).min(1).max(De)}).strict(),Fo=N.object({theme_candidates:N.array(Dm).length(3),conversion:Mt.optional()}).strict().superRefine((e,n)=>{let i=new Set;e.theme_candidates.forEach((s,o)=>{let a=JSON.stringify(s.color_seeds).toUpperCase();i.has(a)&&n.addIssue({code:"custom",path:["theme_candidates",o,"color_seeds"],message:"Theme candidates must have pairwise distinct color_seeds"}),i.add(a)})});function tN(){return Lo.map(e=>Dm.parse({name:e.name,description:e.description,reason:e.fallbackReason,color_seeds:e.colorSeeds,surface_mode:e.surfaceMode,radius:e.radius,font_pairing_id:So[0],motion_preset_id:jo[0],density:No[1],weight_style:Ni}))}function _b(e){return e.radius??Pm(e.theme_preset_id)??"lg"}function gb(e,n){return e.weight_style??n?.theme?.candidates?.find(i=>i.id===e.theme_preset_id)?.weight_style??n?.theme?.candidates?.[0]?.weight_style??Ni}function nN(e,n){let i=Bc(e.font_pairing_id),s=Tm(e.motion_preset_id);return{colorSeeds:e.color_seeds,surfaceMode:e.surface_mode,fonts:{heading:i.heading,body:i.body},density:e.density,motionLevel:s.motionLevel,motionPreset:s.id,radius:_b(e),weightStyle:gb(e,n)}}function iN(e,n){let i=e.theme.candidates[0];return{version:1,recommendation_id:e.id,theme_preset_id:i.id,color_seeds:i.color_seeds,surface_mode:i.surface_mode,font_pairing_id:e.font.recommended_id,motion_preset_id:e.motion.recommended_id,density:e.density.recommended_id,radius:i.radius,weight_style:i.weight_style,updated_at:n.toISOString()}}import{z as Go}from"zod";function hb(e){return JSON.stringify([e.color_seeds.primary.toUpperCase(),e.color_seeds.accent.toUpperCase(),e.color_seeds.foreground.toUpperCase(),e.surface_mode,e.font_pairing_id,e.radius,e.motion_preset_id,e.density,e.weight_style])}var Sb=Go.object(Fo.shape).strict().superRefine((e,n)=>{let i=new Set;e.theme_candidates.forEach((s,o)=>{let a=hb(s);i.has(a)&&n.addIssue({code:"custom",path:["theme_candidates",o],message:"Theme candidates must have pairwise distinct visual identities"}),i.add(a)})}),rN=Go.union([Fo,Sb.safeExtend({model_profile:Go.literal("azure-gpt")})]);import{z as vt}from"zod";var pN=vt.object({site_id:k,site_language:vt.string().trim().min(2).max(35),business_facts:vt.array(vt.string().trim().min(1).max(1e3)).min(1).max(8)}).strict(),fb=vt.enum(["high","medium","low"]),dN=vt.object({skill_name:vt.string().trim().min(1).max(80).nullable(),confidence:fb,reason:vt.string().trim().min(1).max(240)}).strict();import{z as Zn}from"zod";var Nm=1e4,bb=Zn.object({note:Zn.string().trim().max(Nm),updated_at:Zn.string().min(1)}).strict(),hN=Zn.object({note:Zn.string().trim().max(Nm)}).strict(),SN=L(bb.nullable());import{z as ne}from"zod";var qo=["title","text","richtext","number","boolean","date","datetime","url","email","color","select","multiselect","tag"],Yi=ne.object({name:ne.string().min(1).max(100),type:ne.enum(qo),label:ne.string().min(1).max(255),required:ne.boolean().optional(),options:ne.array(ne.string()).optional()}),yN=ne.object({name:ne.string(),cms_type:ne.string(),label:ne.string().optional(),required:ne.boolean().optional(),value_shape:ne.string().optional(),front_display:ne.enum(["visible","internal","forbidden"]).optional(),choices:ne.array(ne.object({value:ne.union([ne.string(),ne.number()]),label:ne.string()})).optional()}),xN=ne.object({route_file_path:ne.string().min(1),target_component_path:ne.string().min(1),content_type_hint:ne.string().min(1),collection_purpose:ne.enum(["generic","product"]).optional(),required_fields:ne.array(Yi).optional(),mode:ne.enum(["bind_existing","provision"]),list_mode:ne.enum(["page","embedded"]).optional(),fields:ne.array(Yi).optional(),seed_records:ne.array(ne.record(ne.string(),ne.unknown())).optional()});import{z as G}from"zod";var Jn=G.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),Xi=G.string().regex(/^[a-f0-9]{64}$/),Qi=G.string().regex(/^[a-z][a-z0-9-]{0,99}$/),Zi=G.string().regex(/^[a-z0-9]{1,30}$/),He=e=>G.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),jm=G.object({id:G.string().uuid(),key:He(100),name:He(255)}).strict(),Mm=new Set(["title","summary","description","category","thumbnail","url","admin_id"]),yb=new Set(["title","summary","description","image_query"]),xb=new Set(["category","thumbnail","url","admin_id","page","pages","route","path","component","components","snapshot","run","site_id","cms_site_id","tenant_id","token","secret","password","authorization","headers","__proto__","prototype","constructor"]),Lm=new Set(["select","multiselect"]),Eb=new Set(["title","text","richtext","date","datetime","url","email","color"]),Rb=G.object({name:He(100),label:He(255),type:G.enum(qo),required:G.boolean().optional(),options:G.array(He(100)).max(100).optional()}).strict().superRefine((e,n)=>{let i=e.options??[];Lm.has(e.type)&&i.length===0&&n.addIssue({code:"custom",path:["options"],message:"Choice fields require at least one option"}),!Lm.has(e.type)&&i.length>0&&n.addIssue({code:"custom",path:["options"],message:"Only choice fields may declare options"}),new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["options"],message:"Field options must be unique"}),Mm.has(e.name)&&n.addIssue({code:"custom",path:["name"],message:"Reserved CMS field names cannot be declared"})}),Ib=G.array(Rb).min(1).max(200),Tb=G.array(G.record(G.string(),G.unknown())).max(1e3);function ze(e,n,i){e.addIssue({code:"custom",path:n,message:i})}var kb=G.object({name:He(30),slug:Zi,collection_purpose:G.enum(["generic","product"]).optional(),fields:Ib,seed_records:Tb}).strict().superRefine((e,n)=>{let i=e.fields.map(o=>o.name);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["fields"],message:"Field names must be unique"}),i.some(o=>!Mm.has(o))||n.addIssue({code:"custom",path:["fields"],message:"At least one custom field is required"});let s=new Map(e.fields.map(o=>[o.name,o]));e.seed_records.forEach((o,a)=>{for(let[c,r]of Object.entries(o)){let m=["seed_records",a,c];if(xb.has(c)){ze(n,m,"Seed cannot write reserved or runtime-owned fields");continue}if(c==="image_query"){(typeof r!="string"||r.trim()==="")&&ze(n,m,"image_query must be a non-empty string");continue}if(yb.has(c)){typeof r!="string"&&ze(n,m,"Seed skeleton text fields must be strings");continue}let S=s.get(c);if(!S){ze(n,m,"Seed contains an undeclared field");continue}if(r==null){ze(n,m,"Seed field values must not be null");continue}if(S.type==="select")(typeof r!="string"||!(S.options??[]).includes(r))&&ze(n,m,"Seed select value must be one of the declared options");else if(S.type==="multiselect")(!Array.isArray(r)||r.length===0||r.some(g=>typeof g!="string"||!(S.options??[]).includes(g)))&&ze(n,m,"Seed multiselect value must contain only declared options");else if(S.type==="number")(typeof r!="number"||!Number.isFinite(r))&&ze(n,m,"Seed number values must be finite numbers");else if(S.type==="boolean")typeof r!="boolean"&&ze(n,m,"Seed boolean values must be booleans");else if(S.type==="tag"){let g=Array.isArray(r)?r:[r];(g.length===0||g.some(w=>typeof w!="string"||w.trim()===""))&&ze(n,m,"Seed tag values must be non-empty strings")}else Eb.has(S.type)&&typeof r!="string"&&ze(n,m,"Seed text-like values must be strings")}for(let c of e.fields)c.required&&!(c.name in o)&&ze(n,["seed_records",a,c.name],"Required fields must be present in every seed record")}),new TextEncoder().encode(JSON.stringify(e)).byteLength>1024*1024&&n.addIssue({code:"custom",path:[],message:"Application template must not exceed 1048576 UTF-8 bytes"})}),Wo=G.object({schema_version:G.literal(1),application:kb}).strict(),Ab=G.object({templateId:G.string().uuid(),stableKey:Qi,resolvedVersion:Jn,digest:Xi,template:Wo}).strict(),wb=Ab,Pb={alreadyCreated:"APPLICATION_ALREADY_CREATED",slugConflict:"APPLICATION_SLUG_CONFLICT",createInProgress:"APPLICATION_CREATE_IN_PROGRESS",cmsUnbound:"APPLICATION_CMS_UNBOUND",templateVersionUnavailable:"APPLICATION_TEMPLATE_VERSION_UNAVAILABLE",createFailed:"APPLICATION_CREATE_FAILED",createResultUnknown:"APPLICATION_CREATE_RESULT_UNKNOWN"},Um=G.enum(Object.values(Pb)),Fm=G.object({category_status:G.enum(["succeeded","failed","not_attempted"]),seed_status:G.enum(["skipped","succeeded","partial","failed"]),requested_count:G.number().int().nonnegative(),written_count:G.number().int().nonnegative().nullable(),published_count:G.number().int().nonnegative().nullable(),errors:G.array(G.object({stage:G.enum(["category","seed","receipt"]),code:He(100)}).strict()).max(20)}).strict(),vb=G.object({templateId:G.string().uuid(),stableKey:Qi,title:He(200),description:G.string().max(1e3),thumbnailUrl:G.string().url().nullable(),resolvedVersion:Jn,digest:Xi,application:G.object({name:He(30),slug:Zi}).strict(),categories:G.array(jm),tags:G.array(jm),status:G.enum(["available","creating","created","conflict","failed"]),errorCode:Um.nullable().optional(),template:Wo.optional()}).strict(),Gm=G.object({items:G.array(vb)}).strict(),TN=G.object({version:Jn}).strict(),Cb=G.object({app_slug:Zi,name:He(30),template:G.object({stable_key:Qi,version:Jn,digest:Xi}).strict()}).strict(),Db=G.object({status:G.literal("created"),application:Cb,initialization:Fm}).strict(),kN=Db,Ob=G.object({stable_key:Qi,version:Jn,digest:Xi,created_at:G.string().datetime().nullable(),initialization:Fm.nullable()}).strict(),Nb=G.object({app_slug:Zi,name:He(30),collection_slug:G.string().min(1),detail_prefix:G.string().min(1).optional(),source:Ob.nullable()}).strict(),AN=G.object({applications:G.array(Nb)}).strict(),wN=Gm,PN=G.object({code:Um,message:He(500)}).strict(),vN=Wo,CN=wb,DN=Gm;import{z as ue}from"zod";var qm=e=>ue.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),jb=Yi.strict(),Km=ue.array(jb).min(1).max(200),Lb=ue.array(ue.record(ue.string(),ue.unknown())).max(1e3),Mb=ue.string().regex(/^[a-z0-9]{1,30}$/),Ko=ue.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),LN=ue.object({name:qm(30),slug:qm(50),collection_purpose:ue.enum(["generic","product"]).optional(),fields:Km}).strict(),Wm=ue.object({collection_slug:Mb,detail_prefix:ue.string().min(1).max(255),plugin_id:Ko.optional()}).strict(),MN=ue.discriminatedUnion("kind",[Wm.extend({kind:ue.literal("created")}),Wm.extend({kind:ue.literal("exists")})]),UN=ue.object({fields:Km,seed_records:Lb,category_id:Ko}).strict(),Ub=ue.record(ue.string().min(1),ue.string().min(1).nullable()),FN=ue.object({ids:ue.array(Ko).max(1e3),urls:Ub,failed:ue.array(ue.unknown()).max(1e3)}).strict();function GN(e){return e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().slice(0,30)}import{z as ye}from"zod";import{z as Bo}from"zod";var Bm=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],zm="-",Fb="embedded",zo=Bo.enum([...Bm,zm]),Gb=Bo.literal(Fb),Ho=Bo.object({scene:zo,shape:Gb}).strict();function KN(e){return Bm.find(n=>n===e)??zm}var Ji=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number","file"],qb=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number"],Wb=ye.object({name:ye.string().min(1).max(100),type:ye.enum(qb),label:ye.string().min(1).max(255),required:ye.boolean().optional(),options:ye.array(ye.string()).optional()}),Kb=ye.string().regex(/^[a-z][a-z0-9-]{0,48}$/).optional(),VN=ye.object({mode:ye.enum(["bind_existing","provision"],{error:'mode is required. Use "bind_existing" or "provision". Never call connect_form with {}.'}),form_hint:ye.string().min(1).optional(),name:ye.string().min(1).max(255).optional(),scene:zo.optional(),component_slug:Kb,description:ye.string().min(1).max(1e3).optional(),fields:ye.array(Wb).optional()}).superRefine((e,n)=>{e.mode==="provision"&&e.scene===void 0&&n.addIssue({code:"custom",path:["scene"],message:"scene is required for provision"}),e.mode==="bind_existing"&&e.scene!==void 0&&n.addIssue({code:"custom",path:["scene"],message:"scene is prohibited for bind_existing"}),e.mode==="bind_existing"&&!e.form_hint?.trim()&&n.addIssue({code:"custom",path:["form_hint"],message:"form_hint is required for bind_existing"}),e.mode==="provision"&&!e.name?.trim()&&n.addIssue({code:"custom",path:["name"],message:"name is required for provision"})}),$N=ye.object({name:ye.string(),label:ye.string(),cms_type:ye.string(),required:ye.boolean()});import{z as p}from"zod";var ei=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,pn=/^[A-Za-z][A-Za-z0-9_-]{0,127}$/,es=/^[A-Za-z][A-Za-z0-9_]{0,99}$/,Ym=/^[A-Za-z0-9][A-Za-z0-9_-]{0,99}$/,$o=/^[a-z][a-z0-9-]{0,99}$/,Xm=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/,Hm=2,Vm=3,ts=p.string().regex(ei),Bb=p.string().regex(ei),Yo=p.string().regex(ei),ti=p.string().regex(es),Xo=p.string().regex(Ym),zb=p.discriminatedUnion("status",[p.object({status:p.literal("unbound"),form_code:p.null()}).strict(),p.object({status:p.literal("bound"),form_code:p.string().regex(pn)}).strict(),p.object({status:p.literal("missing"),form_code:p.string().regex(pn)}).strict()]),Hb=p.object({value:Xo,label:p.string().trim().min(1).max(255)}).strict(),Vb=p.object({kind:p.literal("field"),field_name:ti,type:p.enum(Ji),label:p.string().trim().min(1).max(255),required:p.boolean(),span:p.enum(["full","half"]),options:p.array(Hb).max(100),max_files:p.number().int().min(1).max(5).optional()}).strict(),$b=p.object({kind:p.literal("step-break"),step_id:p.string().regex(ei)}).strict(),Yb=p.discriminatedUnion("kind",[Vb,$b]),Xb=p.object({field_name:ti,type:p.enum(Ji),last_label:p.string().max(255)}).strict(),Qb=p.object({field_name:ti,value:Xo,last_label:p.string().max(255)}).strict(),Zb=p.discriminatedUnion("kind",[p.object({kind:p.literal("custom")}).strict(),p.object({kind:p.literal("template"),slug:p.string().regex($o),version:p.string().regex(Xm)}).strict()]),Jb={select:2,radio:2,multiselect:1,DropdownSelection:2,RadioButton:2,Checkbox:1};function at(e){return e.toLowerCase()}function Qm(e,n){return e.trim().toLocaleLowerCase(n)}function ln(e,n){return`${at(e)}\0${n}`}function we(e,n,i,s){let o=new Set;for(let a of e){if(o.has(a)){s.addIssue({code:"custom",path:n,message:i});return}o.add(a)}}function Qo(e,n,i,s){let o=Jb[e]??0;o>0&&n<o?s.addIssue({code:"custom",path:i,message:`choice field requires at least ${o} option${o===1?"":"s"}`}):o===0&&n>0&&s.addIssue({code:"custom",path:i,message:"non-choice fields must use an empty options array"})}var Zo=p.object({schema_version:p.literal(1),min_runtime_version:p.number().int().positive(),form_definition_id:ts,binding:zb,content_locale:Ee,features:p.object({multistep:p.boolean()}).strict(),copy:p.object({title:p.string().max(255),description:p.string().max(1e3),submit_button:p.string().trim().min(1).max(100),success_message:p.string().trim().min(1).max(500),error_message:p.string().max(500)}).strict(),layout:p.object({columns:p.enum(["one","two"])}).strict(),nodes:p.array(Yb).min(1).max(200),source:Zb,retired:p.object({fields:p.array(Xb).max(1e3),options:p.array(Qb).max(5e3)}).strict(),compatibility:p.object({standardization_version:p.number().int().positive(),diagnostics:p.array(p.string().trim().min(1).max(500)).max(100)}).strict()}).strict().superRefine((e,n)=>{let i=e.nodes.flatMap((r,m)=>r.kind==="field"?[[m,r]]:[]),s=i.map(([,r])=>r);s.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"at least one field node is required"});let o=e.nodes.filter(r=>r.kind==="step-break");!e.features.multistep&&o.length>0&&n.addIssue({code:"custom",path:["nodes"],message:"step-break requires the multistep feature"}),e.features.multistep&&(e.min_runtime_version<Hm&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`multistep requires runtime version ${Hm}`}),o.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"multistep requires at least one step-break"}));for(let[r,m]of e.nodes.entries())m.kind==="step-break"&&(r===0||r===e.nodes.length-1||e.nodes[r-1]?.kind==="step-break"||e.nodes[r+1]?.kind==="step-break")&&n.addIssue({code:"custom",path:["nodes",r],message:"step-break must separate two non-empty steps"});we(o.map(r=>r.step_id),["nodes"],"step_id must be unique",n),we(s.map(r=>at(r.field_name)),["nodes"],"field_name must be unique",n),we(e.retired.fields.map(r=>at(r.field_name)),["retired","fields"],"retired field_name must be unique",n);let a=new Set(e.retired.fields.map(r=>at(r.field_name)));for(let[r,m]of i)a.has(at(m.field_name))&&n.addIssue({code:"custom",path:["nodes",r,"field_name"],message:"retired field_name cannot be reused"}),Qo(m.type,m.options.length,["nodes",r,"options"],n),m.type==="file"?e.min_runtime_version<Vm&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`file fields require runtime version ${Vm}`}):m.max_files!==void 0&&n.addIssue({code:"custom",path:["nodes",r,"max_files"],message:"max_files is only valid for file fields"}),we(m.options.map(S=>S.value),["nodes",r,"options"],"option value must be unique within a field",n),we(m.options.map(S=>Qm(S.label,e.content_locale)),["nodes",r,"options"],"option label must be unique within a field",n);we(e.retired.options.map(r=>ln(r.field_name,r.value)),["retired","options"],"retired option identity must be unique",n);let c=new Set(e.retired.options.map(r=>ln(r.field_name,r.value)));for(let[r,m]of i)for(let[S,g]of m.options.entries())c.has(ln(m.field_name,g.value))&&n.addIssue({code:"custom",path:["nodes",r,"options",S,"value"],message:"retired option value cannot be reused"})}),ey=["copy.title","copy.description","copy.submit_button","copy.success_message","copy.error_message","nodes.*.label","nodes.*.options.*.label"],ty=new Set(ey);function nj(e){let n=e.map(i=>typeof i=="number"||/^\d+$/.test(i)?"*":i).join(".");return ty.has(n)}function ij(e,n){let i=[],s=e.nodes.filter(r=>r.kind==="field"),o=new Map(n.nodes.filter(r=>r.kind==="field").map(r=>[at(r.field_name),r])),a=new Map(n.retired.fields.map(r=>[at(r.field_name),r])),c=new Map(n.retired.options.map(r=>[ln(r.field_name,r.value),r]));for(let r of s){let m=at(r.field_name),S=o.get(m),g=a.get(m);S&&S.field_name!==r.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),S&&S.type!==r.type&&i.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),!S&&g&&g.field_name!==r.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!S&&g&&g.type!==r.type&&i.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),!S&&!a.has(m)&&i.push({code:"FIELD_RETIREMENT_MISSING",field_name:r.field_name});let w=new Set(S?.options.map(K=>K.value)??[]);for(let K of r.options){let H=c.get(ln(r.field_name,K.value));!w.has(K.value)&&H&&H.field_name!==r.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!w.has(K.value)&&!H&&i.push({code:"OPTION_RETIREMENT_MISSING",field_name:r.field_name,value:K.value})}}for(let r of e.retired.fields){let m=a.get(at(r.field_name));m&&m.field_name!==r.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),m&&m.type!==r.type&&i.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),m||i.push({code:"FIELD_RETIREMENT_MISSING",field_name:r.field_name})}for(let r of e.retired.options){let m=c.get(ln(r.field_name,r.value));m&&m.field_name!==r.field_name&&i.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),m||i.push({code:"OPTION_RETIREMENT_MISSING",field_name:r.field_name,value:r.value})}return i}var ny=p.enum(An),Ct=p.object({english:p.string().max(1e3),translations:p.partialRecord(ny,p.string().max(1e3)).optional()}).strict(),iy=p.object({template_option_key:p.string().regex(Ym),label:Ct}).strict(),sy=p.object({template_field_key:p.string().regex(es),type:p.enum(Ji),label:Ct,required:p.boolean(),span:p.enum(["full","half"]),options:p.array(iy).max(100)}).strict(),oy=p.object({template_step_key:p.string().regex(es),after_field_key:p.string().regex(es)}).strict(),sj=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],oj=[1,1,1,1,1,1],Zm=p.string().regex($o),ay=p.object({schema_version:p.literal(1),slug:Zm,name:Ct,template_count:p.number().int().min(0).max(500)}).strict().superRefine((e,n)=>{e.name.english.trim()===""&&n.addIssue({code:"custom",path:["name","english"],message:"English category name is required"})}),ry=p.object({schema_version:p.literal(1),slug:p.string().regex($o),version:p.string().regex(Xm),category:Zm,copy:p.object({title:Ct,description:Ct,submit_button:Ct,success_message:Ct,error_message:Ct}).strict(),layout:p.object({columns:p.enum(["one","two"])}).strict(),fields:p.array(sy).min(1).max(200),step_breaks:p.array(oy).max(20).optional()}).strict().superRefine((e,n)=>{for(let a of["title","description","submit_button","success_message","error_message"])e.copy[a].english.trim()===""&&n.addIssue({code:"custom",path:["copy",a,"english"],message:"English baseline text is required"});we(e.fields.map(a=>a.template_field_key),["fields"],"template_field_key must be unique",n);let i=new Map(e.fields.map((a,c)=>[a.template_field_key,c])),s=e.step_breaks??[];we(s.map(a=>a.template_step_key),["step_breaks"],"template_step_key must be unique",n),we(s.map(a=>a.after_field_key),["step_breaks"],"step breaks must not share an anchor field",n);let o=-1;for(let[a,c]of s.entries()){let r=i.get(c.after_field_key);r===void 0||r>=e.fields.length-1?n.addIssue({code:"custom",path:["step_breaks",a,"after_field_key"],message:"step break must follow an existing non-final field"}):r<=o&&n.addIssue({code:"custom",path:["step_breaks",a,"after_field_key"],message:"step breaks must follow field order"}),o=r??o}e.fields.length+s.length>200&&n.addIssue({code:"custom",path:["step_breaks"],message:"template fields and step breaks must not exceed 200 nodes"});for(let[a,c]of e.fields.entries()){c.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",a,"label","english"],message:"English field label is required"}),Qo(c.type,c.options.length,["fields",a,"options"],n),we(c.options.map(r=>r.template_option_key),["fields",a,"options"],"template_option_key must be unique within a field",n),we(c.options.map(r=>r.label.english.trim().toLowerCase()),["fields",a,"options"],"English option labels must be unique within a field",n);for(let[r,m]of c.options.entries())m.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",a,"options",r,"label","english"],message:"English option label is required"})}}),aj=p.object({schema_version:p.literal(1),visibility:p.enum(["internal","public"]),categories:p.array(ay).max(500),templates:p.array(ry).max(500)}).strict().superRefine((e,n)=>{let i=(o,a)=>{let c=An.filter(r=>!o.translations?.[r]?.trim());c.length>0&&n.addIssue({code:"custom",path:[...a,"translations"],message:`public template copy is missing locales: ${c.join(", ")}`})};we(e.categories.map(o=>o.slug),["categories"],"template category slug must be unique",n);let s=new Set(e.categories.map(o=>o.slug));for(let[o,a]of e.categories.entries()){let c=e.templates.filter(r=>r.category===a.slug).length;a.template_count!==c&&n.addIssue({code:"custom",path:["categories",o,"template_count"],message:"template_count must match catalog templates"})}we(e.templates.map(o=>o.slug),["templates"],"template slug must be unique",n);for(let[o,a]of e.templates.entries())s.has(a.category)||n.addIssue({code:"custom",path:["templates",o,"category"],message:"template category must exist in catalog categories"});if(e.visibility==="public"){for(let[o,a]of e.categories.entries())i(a.name,["categories",o,"name"]);for(let[o,a]of e.templates.entries()){for(let[c,r]of Object.entries(a.copy))i(r,["templates",o,"copy",c]);for(let[c,r]of a.fields.entries()){i(r.label,["templates",o,"fields",c,"label"]);for(let[m,S]of r.options.entries())i(S.label,["templates",o,"fields",c,"options",m,"label"])}}}});function rj(e,n){let i=lr(n),s=i?e.translations?.[i]:void 0;return s!==void 0&&s.trim()!==""?s:e.english}var cy=["Text","Summary","Email","Phone","DropdownSelection","RadioButton","Checkbox","Boolean","Date","Num","MultipleFile","SpecificFile"],my={text:"Text",textarea:"Summary",email:"Email",phone:"Phone",select:"DropdownSelection",radio:"RadioButton",multiselect:"Checkbox",boolean:"Boolean",date:"Date",number:"Num",file:"MultipleFile"},ly=p.object({value:Xo,label:p.string().trim().min(1).max(255)}).strict(),py=p.object({field_name:ti,field_type:p.enum(cy),field_label:p.string().trim().min(1).max(255),is_required:p.boolean(),sort_order:p.number().int().nonnegative(),options:p.array(ly).max(100)}).strict(),Jm=p.object({version:p.literal(1),locale:Ee,fields:p.array(py).min(1).max(200)}).strict().superRefine((e,n)=>{we(e.fields.map(i=>at(i.field_name)),["fields"],"field_name must be unique",n);for(let[i,s]of e.fields.entries())Qo(s.field_type,s.options.length,["fields",i,"options"],n),we(s.options.map(o=>o.value),["fields",i,"options"],"option value must be unique within a field",n),we(s.options.map(o=>Qm(o.label,e.locale)),["fields",i,"options"],"option label must be unique within a field",n)});function cj(e){let n=e.nodes.filter(i=>i.kind==="field").map((i,s)=>({field_name:i.field_name,field_type:i.type==="file"&&i.max_files===1?"SpecificFile":my[i.type],field_label:i.label,is_required:i.required,sort_order:s,options:i.options.map(o=>({...o}))}));return Jm.parse({version:1,locale:e.content_locale,fields:n})}var de=p.string().regex(/^sha256:[0-9a-f]{64}$/),dy=p.union([xe,p.enum(["app/api/forms/[code]/route.ts","hooks/use-cms-form-submit.ts","lib/cms/forms.ts","lib/cms/client.ts"])]),uy=p.object({path:dy,content_hash:de.nullable()}).strict(),_y=p.array(uy).min(1).max(500).superRefine((e,n)=>{we(e.map(i=>i.path),[],"affected file paths must be unique",n)}),Jo=p.object({grade:p.enum(["standard","A","B","C"]),required:p.boolean(),pending_confirmations:p.array(p.object({item_id:p.string().regex(ei),field_name:ti.optional(),kind:p.enum(["form_copy","layout","field_label","field_type","field_required","field_options"]),message:p.string().trim().min(1).max(500)}).strict().superRefine((e,n)=>{e.kind.startsWith("field_")&&!e.field_name&&n.addIssue({code:"custom",path:["field_name"],message:"field confirmation items require field_name"})})).max(200)}).strict().superRefine((e,n)=>{let i=e.grade==="standard";i===e.required&&n.addIssue({code:"custom",path:["required"],message:i?"standard forms do not require standardization confirmation":"legacy forms require standardization confirmation"}),e.grade==="C"&&e.pending_confirmations.length===0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"grade C requires at least one pending confirmation"}),e.grade!=="C"&&e.pending_confirmations.length>0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"only grade C can contain pending confirmations"})}),gy=p.object({site_id:k,form_definition_id:ts,base_snapshot_id:A,expected_form_spec_hash:de,expected_cms_schema_hash:de.nullable(),form_metadata:Ho.nullable(),draft_form_spec_hash:de,desired_cms_schema_hash:de,affected_files_hash:de,shared_reference_hash:de,shared_reference_count:p.number().int().positive(),confirm_shared_update:p.boolean(),recreate_missing_binding:p.boolean(),standardization:Jo,confirm_standardization:p.boolean()}).strict(),el=p.object({reference_hash:de,page_count:p.number().int().positive(),block_count:p.number().int().positive()}).strict().refine(e=>e.page_count<=e.block_count,{message:"page_count cannot exceed block_count"}),mj=p.object({site_id:k,form_block_id:Bb,base_snapshot_id:A,form_spec:Zo,runtime_upgrade_required:p.boolean(),expected_form_spec_hash:de,expected_cms_schema_hash:de.nullable(),affected_files_hash:de,shared_impact:el,standardization:Jo}).strict(),hy=p.object({operation_id:Yo,operation_fingerprint:de,site_id:k,form_definition_id:ts,base_snapshot_id:A,expected_form_spec_hash:de,expected_cms_schema_hash:de.nullable(),form_metadata:Ho.nullable(),draft_form_spec:Zo,draft_form_spec_hash:de,desired_cms_schema_hash:de,affected_files_hash:de,shared_impact:el,confirm_shared_update:p.boolean(),recreate_missing_binding:p.boolean(),standardization:Jo,confirm_standardization:p.boolean()}).strict().superRefine((e,n)=>{e.form_definition_id!==e.draft_form_spec.form_definition_id&&n.addIssue({code:"custom",path:["form_definition_id"],message:"form_definition_id must match draft_form_spec"}),e.shared_impact.block_count>1&&!e.confirm_shared_update&&n.addIssue({code:"custom",path:["confirm_shared_update"],message:"shared definition updates require explicit confirmation"});let i=e.draft_form_spec.binding.status==="missing";i!==e.recreate_missing_binding&&n.addIssue({code:"custom",path:["recreate_missing_binding"],message:i?"missing bindings require explicit recreation confirmation":"only missing bindings can be recreated"});let s=e.draft_form_spec.binding.status==="bound",o=s&&e.standardization.required&&(e.standardization.grade==="B"||e.standardization.grade==="C");(s&&!o&&e.expected_cms_schema_hash===null||!s&&e.expected_cms_schema_hash!==null)&&n.addIssue({code:"custom",path:["expected_cms_schema_hash"],message:s?"bound standard forms require the current CMS schema hash":"unbound or missing forms cannot claim a current CMS schema hash"}),e.confirm_standardization!==e.standardization.required&&n.addIssue({code:"custom",path:["confirm_standardization"],message:e.standardization.required?"legacy standardization requires explicit confirmation":"standard forms cannot claim legacy standardization confirmation"})}),Sy=["created","validated","binding_reserved","candidate_ready","cms_applied","snapshot_promoted","committed","compensating","recovery_required","failed"],ea=p.enum(Sy),fy=["pending","running","succeeded","failed","recovery_required"],tl=p.enum(fy),by=["candidate_abandon","snapshot_reconcile","cms_restore"],nl=p.enum(by),yy=["FORM_DESIGN_INVALID","FORM_DESIGN_UNSUPPORTED","FORM_DESIGN_STANDARDIZATION_AGENT_REQUIRED","FORM_DESIGN_STANDARDIZATION_UNSUPPORTED","FORM_DESIGN_FEATURE_NOT_ENABLED","FORM_DESIGN_PERMISSION_DENIED","FORM_DESIGN_LOCKED","FORM_DESIGN_CODE_CONFLICT","FORM_DESIGN_CMS_CONFLICT","FORM_DESIGN_CMS_SCHEMA_MISMATCH","FORM_DESIGN_CMS_NOT_FOUND","FORM_DESIGN_BINDING_MISSING","FORM_DESIGN_OPERATION_CONFLICT","FORM_DESIGN_CMS_UNAVAILABLE","FORM_DESIGN_PATCH_FAILED","FORM_DESIGN_COMPENSATION_FAILED","FORM_DESIGN_RECOVERY_REQUIRED"],ta=p.enum(yy),il=p.enum(["wait","resume","retry_new_operation","manual_recovery","none"]),sl=p.enum(["not_started","pending","succeeded","failed"]),ol=p.object({operation_id:Yo,operation_fingerprint:de,site_id:k,form_definition_id:ts,stage:ea,status:tl,base_snapshot_id:A,candidate_snapshot_id:A.nullable(),before_form_code:p.string().regex(pn).nullable(),materialized_form_code:p.string().regex(pn).nullable(),expected_form_spec_hash:de,draft_form_spec_hash:de,materialized_form_spec_hash:de.nullable(),expected_cms_schema_hash:de.nullable(),desired_cms_schema_hash:de,retry_count:p.number().int().nonnegative(),failure_stage:nl.nullable(),last_error_code:ta.nullable(),retryable:p.boolean(),next_action:il,preview_refresh_status:sl,created_at:p.string().datetime({offset:!0}),updated_at:p.string().datetime({offset:!0})}).strict().superRefine((e,n)=>{if(!(e.stage!=="committed"&&e.status!=="succeeded")){(e.stage!=="committed"||e.status!=="succeeded")&&n.addIssue({code:"custom",path:["status"],message:"committed stage and succeeded status must be reported together"});for(let i of["candidate_snapshot_id","materialized_form_code","materialized_form_spec_hash"])e[i]===null&&n.addIssue({code:"custom",path:[i],message:`${i} is required for a committed success`});(e.failure_stage!==null||e.last_error_code!==null||e.retryable||e.next_action!=="none")&&n.addIssue({code:"custom",path:["next_action"],message:"a committed success cannot retain an error or retry action"})}}),na=p.object({operation:ol}).strict(),lj=na,pj=na,dj=p.object({operation_fingerprint:de}).strict(),uj=na,xy=p.preprocess(e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;let n="form_metadata"in e?e:{...e,form_metadata:null};return"standardization"in e||"confirm_standardization"in e?n:{...n,standardization:{grade:"standard",required:!1,pending_confirmations:[]},confirm_standardization:!1}},hy),_j=p.object({operation:ol,request:xy,cms_replace_result:p.unknown().nullable()}).strict(),Ey=p.object({stage:ea.optional(),status:tl.optional(),candidate_snapshot_id:A.nullable().optional(),before_form_code:p.string().regex(pn).nullable().optional(),materialized_form_code:p.string().regex(pn).nullable().optional(),materialized_form_spec_hash:de.nullable().optional(),retry_count:p.number().int().nonnegative().optional(),failure_stage:nl.nullable().optional(),last_error_code:ta.nullable().optional(),retryable:p.boolean().optional(),next_action:il.optional(),preview_refresh_status:sl.optional()}).strict(),gj=p.object({expected_updated_at:p.string().datetime({offset:!0}),operation:Ey,cms_replace_result:p.unknown().nullable().optional()}).strict().refine(e=>Object.keys(e.operation).length>0||Object.hasOwn(e,"cms_replace_result"),{message:"transition must change operation state or CMS result"}),hj=p.object({code:ta,message:p.string().trim().min(1).max(500),retryable:p.boolean(),operation_id:Yo.optional(),stage:ea.optional()}).strict();function Ry(e){return gy.parse({site_id:e.site_id,form_definition_id:e.form_definition_id,base_snapshot_id:e.base_snapshot_id,expected_form_spec_hash:e.expected_form_spec_hash,expected_cms_schema_hash:e.expected_cms_schema_hash,draft_form_spec_hash:e.draft_form_spec_hash,desired_cms_schema_hash:e.desired_cms_schema_hash,affected_files_hash:e.affected_files_hash,form_metadata:e.form_metadata,shared_reference_hash:e.shared_impact.reference_hash,shared_reference_count:e.shared_impact.block_count,confirm_shared_update:e.confirm_shared_update,recreate_missing_binding:e.recreate_missing_binding,standardization:e.standardization,confirm_standardization:e.confirm_standardization})}function $m(e){for(let n=0;n<e.length;n+=1){let i=e.charCodeAt(n);if(i>=55296&&i<=56319){let s=e.charCodeAt(n+1);if(n+1>=e.length||s<56320||s>57343)throw new TypeError("canonical JSON cannot contain a lone surrogate");n+=1}else if(i>=56320&&i<=57343)throw new TypeError("canonical JSON cannot contain a lone surrogate")}}function Vo(e,n){if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError("canonical JSON numbers must be finite");return JSON.stringify(e)}if(typeof e=="string")return $m(e),JSON.stringify(e);if(typeof e!="object")throw new TypeError("value is not valid JSON");if(n.has(e))throw new TypeError("canonical JSON cannot contain cycles");n.add(e);try{if(Array.isArray(e)){let a=[];for(let c=0;c<e.length;c+=1){if(!(c in e))throw new TypeError("canonical JSON cannot contain sparse arrays");a.push(Vo(e[c],n))}return`[${a.join(",")}]`}let i=Object.getPrototypeOf(e);if(i!==Object.prototype&&i!==null)throw new TypeError("canonical JSON objects must be plain records");let s=e;return`{${Object.keys(s).sort().map(a=>($m(a),`${JSON.stringify(a)}:${Vo(s[a],n)}`)).join(",")}}`}finally{n.delete(e)}}function ia(e){return Vo(e,new Set)}async function ns(e){let n=ia(e),i=new TextEncoder().encode(n),s=globalThis.crypto?.subtle?new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256",i)):(await import("@noble/hashes/sha256")).sha256(i);return`sha256:${Array.from(s,a=>a.toString(16).padStart(2,"0")).join("")}`}async function Sj(e){return ns(Zo.parse(e))}async function fj(e){return ns(Jm.parse(e))}async function bj(e){let n=_y.parse(e).map(i=>({...i})).sort((i,s)=>i.path<s.path?-1:i.path>s.path?1:0);return ns({version:1,files:n})}async function yj(e){return ns(Ry(e))}import{z as C}from"zod";var Rj=["page-seo","root-layout-metadata","nav-items"],Ij=C.object({path:C.string(),title:C.string(),description:C.string().optional(),keywords:C.string().optional(),meta_tags_json:C.record(C.string(),C.record(C.string(),C.string())).nullish(),schema_json:C.union([C.record(C.string(),C.unknown()),C.array(C.record(C.string(),C.unknown())),C.string()]).nullish(),breadcrumbs_json:C.array(C.object({name:C.string().optional(),text:C.string().optional(),url:C.string().nullish()})).nullish()}),Tj=C.object({metadataBase:C.string().optional(),title:C.union([C.string(),C.object({default:C.string().optional(),template:C.string().optional(),absolute:C.string().optional()})]).optional(),description:C.string().optional(),keywords:C.string().optional(),openGraph:C.object({title:C.string().optional(),description:C.string().optional(),type:C.string().optional(),siteName:C.string().optional(),url:C.string().optional(),locale:C.string().optional(),images:C.array(C.union([C.string(),C.object({url:C.string(),alt:C.string().optional()})])).optional()}).optional(),twitter:C.object({card:C.string().optional(),title:C.string().optional(),description:C.string().optional(),images:C.array(C.string()).optional()}).optional(),alternates:C.object({canonical:C.string().optional()}).optional(),robots:C.union([C.string(),C.record(C.string(),C.unknown())]).optional()}),al=()=>C.object({label:C.string(),href:C.string().optional(),targetType:C.enum(["page","anchor","external","email","phone","file","group"]).optional(),role:C.enum(["link","cta"]).optional(),openInNewTab:C.boolean().optional(),nofollow:C.boolean().optional(),description:C.string().optional(),badge:C.string().optional(),iconKey:C.string().optional()}),kj=al().extend({children:C.array(al()).optional()}),Iy=["title","description","keywords","breadcrumbs_json.*.name","breadcrumbs_json.*.text"],Ty=["path","meta_tags_json.**","schema_json.**","breadcrumbs_json.*.url"],ky=["title","title.default","title.template","title.absolute","description","keywords","openGraph.title","openGraph.description","openGraph.siteName","openGraph.images.*.alt","twitter.title","twitter.description"],Ay=["metadataBase","openGraph.type","openGraph.url","openGraph.locale","openGraph.images.*","openGraph.images.*.url","twitter.card","twitter.images.*","alternates.canonical","robots.**"],wy=["label","description","badge"],Py=["href","targetType","role","iconKey"],rl={"page-seo":{localizable:Iy,machine:Ty},"root-layout-metadata":{localizable:ky,machine:Ay},"nav-items":{localizable:wy,machine:Py}},cl="*",ml="**",vy="children";function Cy(e){return typeof e=="number"||/^\d+$/.test(e)?cl:e}function ll(e,n){let i=n.map(Cy);return e!=="nav-items"?i:i.filter(s=>s!==cl&&s!==vy)}function pl(e,n){let i=e.split(".");for(let s=0;s<i.length;s+=1){if(i[s]===ml)return!0;if(s>=n.length||i[s]!==n[s])return!1}return i.length===n.length}function Dy(e,n){let i=e.split(".");if(n.length>=i.length)return!1;for(let s=0;s<n.length;s+=1){if(i[s]===ml)return!0;if(i[s]!==n[s])return!1}return!0}function Aj(e,n){let i=ll(e,n);return i.length===0?!1:rl[e].localizable.some(s=>pl(s,i))}function wj(e,n){let i=ll(e,n);if(i.length===0)return!0;let{localizable:s,machine:o}=rl[e];return[...s,...o].some(a=>pl(a,i)||Dy(a,i))}var Cj=["product-search","migration-products","standard-form","form-submission-infrastructure"],Oy=[{path:"app/search/page.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/entry.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/results.tsx",materializer:"product-search"},{path:"app/api/product-search/facets/route.ts",materializer:"product-search"},{path:"lib/cms/product-search.ts",materializer:"product-search"},{path:"lib/generated/product-search-value-codec.ts",materializer:"product-search"},{path:"lib/generated/product-search-config.json",materializer:"product-search"},{path:`lib/cms/generated/${St}.ts`,materializer:"migration-products"},{path:`components/site/generated/${St}-list.tsx`,materializer:"migration-products"},{path:`components/site/generated/${St}-list-view.tsx`,materializer:"migration-products"},{path:`components/site/generated/${St}-detail-view.tsx`,materializer:"migration-products"},{path:`app/${St}/[slug]/page.tsx`,materializer:"migration-products"},{path:`components/site/generated/${St}-breadcrumb.tsx`,materializer:"migration-products"},{path:"components/site/generated/forms/vcp-form-runtime.tsx",materializer:"standard-form"},{path:"app/api/forms/[code]/route.ts",materializer:"form-submission-infrastructure"},{path:"hooks/use-cms-form-submit.ts",materializer:"form-submission-infrastructure"},{path:"lib/cms/forms.ts",materializer:"form-submission-infrastructure"}],Ny=[{prefix:"components/site/generated/forms/form-",suffix:".tsx",materializer:"standard-form"}],Dj=[{path:"lib/cms/client.ts",reason:"\u4E0D\u662F\u7269\u5316\u4EA7\u7269\uFF1A\u6A21\u677F\u81EA\u5E26\u7684 CMS \u4F20\u8F93\u5C42\uFF0C\u7269\u5316\u5668\u53EA\u5BF9\u5B83\u505A\u5B9A\u70B9\u5B57\u7B26\u4E32\u5347\u7EA7\uFF08\u591A\u90E8\u5206\u8868\u5355\u63D0\u4EA4\u3001no-store \u8BFB\uFF09\uFF0C\u6574\u4EFD\u8986\u5199\u53CD\u800C\u4F1A\u62B9\u6389\u7AD9\u70B9\u4FA7\u7684\u5176\u4ED6\u5347\u7EA7\u3002"},{path:"components/site/generated/forms/form-<id>.spec.ts",reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u8868\u5355\u8BBE\u8BA1\u5668\u5199\u7684\u5B57\u6BB5\u6587\u6848\uFF0C\u5F52 FORM_SPEC_LOCALIZABLE_FIELD_PATHS \u7684\u5B57\u6BB5\u7EA7\u6E05\u5355\u7BA1\u8F96\u3002"},{path:"components/system/not-found-content.tsx",reason:"\u4E00\u6B21\u6027\u5199\u5165\u3001\u4E4B\u540E\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u5EFA\u7AD9\u65F6\u4EC5\u5728\u6A21\u677F\u539F\u7248\u4E0A\u6309\u7AD9\u70B9\u8BED\u79CD\u5199\u4E00\u6B21 404 \u6587\u6848\uFF0C\u4E4B\u540E\u7531\u7528\u6237\u3001\u8BBE\u8BA1\u5668\u6216 Agent \u7EF4\u62A4\uFF0C\u91CD\u8DD1\u4E5F\u4E0D\u4F1A\u8986\u5199\u6539\u8FC7\u7684\u5185\u5BB9\uFF1B\u5B50\u7AD9\u987B\u968F\u6574\u7AD9\u7FFB\u8BD1\u5B83\u3002"}];function jy(e){return e.length>0&&!e.includes("/")&&!e.includes(".")}function Oj(e){return Oy.some(n=>n.path===e)?!0:Ny.some(n=>!e.startsWith(n.prefix)||!e.endsWith(n.suffix)?!1:jy(e.slice(n.prefix.length,e.length-n.suffix.length)))}import{z as bt}from"zod";var Ly=["provisioning","cms_app_created","seeded","ready","failed"],Mj=bt.object({tenant_id:bt.string().min(1),site_id:k,collection_slug:bt.string().min(1),cms_collection_id:bt.string().min(1).nullable(),status:bt.enum(Ly),owned_by_vcp:bt.boolean(),run_id:V.nullable(),last_error:bt.string().nullable(),created_at:bt.string().datetime(),updated_at:bt.string().datetime()});var dl="/vibe/v1";function My(e){let n=e?.trim().replace(/\/+$/,"");if(!n)return null;try{let i=new URL(n),s=i.pathname.replace(/\/+$/,"");return i.search="",i.hash="",i.pathname=s.endsWith(dl)?s:dl,i.href.replace(/\/+$/,"")}catch{return n}}function Fj(e){let n=My(e.publicProxyUrl),i=e.cmsSiteId?.trim(),s=e.tenantId?.trim();return n&&i&&s?{cmsProxyUrl:n,cmsProjectId:i,cmsTenantId:s}:null}function qj(e){let n=e.tenant_id?.trim(),i=e.cms_site_id?.trim();if(!n||!i)throw new Error("CMS_REQUEST_CONTEXT_MISSING");return{Accept:"application/json","X-Tenant-Id":n,"X-Site-Id":i}}import{z as _}from"zod";var is=_.string().url().refine(ix,{message:"URL must use http or https"}),ul=_.string().trim().pipe(is),Uy=_.object({task_type:_.literal("home_url"),task_url:ul,planned_num:_.number().int().min(1).max(20).optional()}).strict(),Fy=_.object({task_type:_.literal("url_list"),urls:_.array(is).min(1).max(1e4)}).strict(),zj=_.discriminatedUnion("task_type",[Uy,Fy]),Hj=_.object({page:_.coerce.number().int().positive().default(1),page_size:_.coerce.number().int().min(1).max(20).default(20)}).strict(),Vj=_.object({home_url:ul}).strict(),zt=_.string().uuid(),dn=_.string().uuid(),$j=_.object({task_uuid:zt}).strict(),_l=_.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]),Gy=_.object({task_uuid:zt,status:_.literal("NOT_STARTED"),total:_.literal(0)}).strict(),qy=_.object({task_uuid:zt,status:_.literal("PROCESSING"),total:_.literal(0)}).strict(),Yj=_.enum(["no_suitable_page_candidate","page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"]),Wy=_.discriminatedUnion("status",[_.object({role:Tt,status:_.literal("selected"),reason_code:_.null()}).strict(),_.object({role:Tt,status:_.literal("not_found"),reason_code:_.literal("no_suitable_page_candidate")}).strict(),_.object({role:Tt,status:_.literal("unknown"),reason_code:_.enum(["page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"])}).strict()]),gl=_.array(Wy).length(7).superRefine((e,n)=>{let i=new Set(e.map(s=>s.role));i.size!==e.length&&n.addIssue({code:"custom",message:"discovery coverage roles must be unique"});for(let s of Tt.options)i.has(s)||n.addIssue({code:"custom",message:`discovery coverage is missing role ${s}`})}),Ky=_.object({task_uuid:zt,status:_.literal("SUCCEEDED"),total:_.number().int().positive(),discovery_coverage:gl.optional()}).strict(),By=_.enum(["TASK_FAILED","PROVIDER_CAPABILITY_LIMIT","WEBSITE_UNREACHABLE"]),zy=_.object({task_uuid:zt,status:_.literal("FAILED"),total:_.literal(0),error_code:By,error_message:_.string().min(1),failure_stage:_l}).strict(),Xj=_.discriminatedUnion("status",[Gy,qy,Ky,zy]),Hy=_.object({url:is,raw_html:_.string().min(1)}).strict(),Qj=_.object({task_uuid:zt,status:_.literal("SUCCEEDED"),page:_.number().int().positive(),page_size:_.number().int().min(1).max(20),total:_.number().int().positive(),total_pages:_.number().int().positive(),pages:_.array(Hy).max(20),discovery_coverage:gl.optional()}).strict().superRefine((e,n)=>{e.total_pages!==Math.ceil(e.total/e.page_size)&&n.addIssue({code:"custom",path:["total_pages"],message:"total_pages must equal ceil(total / page_size)"}),e.pages.length>e.page_size&&n.addIssue({code:"custom",path:["pages"],message:"pages must not exceed page_size"})}),Zj=_.object({task_code:dn}).strict(),Vy=_.object({task_code:dn,status:_.literal("NOT_STARTED")}).strict(),$y=_.object({task_code:dn,status:_.literal("PROCESSING")}).strict(),Yy=_.object({task_code:dn,status:_.literal("SUCCEEDED"),urls:_.array(is)}).strict(),Xy=_.literal("SITEMAP_DISCOVERY_FAILED"),Qy=_.object({task_code:dn,status:_.literal("FAILED"),error_code:Xy,error_message:_.string().min(1)}).strict(),Jj=_.discriminatedUnion("status",[Vy,$y,Yy,Qy]),eL=_.object({company_name:_.string().regex(/\S/u)}).strict(),Zy=_.object({company_name:_.string(),brand_name:_.string(),main_products:_.array(_.string()),industry:_.array(_.string()),subfields:_.array(_.string()),business_intro:_.string(),registered_capital:_.string(),legal_representative:_.string(),target_markets:_.array(_.string()),target_customer_industries:_.array(_.string()),target_customer_roles:_.array(_.string()),purchase_scenarios:_.string(),differentiators:_.array(_.string()),competitors:_.array(_.object({name:_.string(),official_url:_.string()}).strict()).max(3),qualifications:_.array(_.string()),representative_cases:_.array(_.string()),acquisition_channels:_.array(_.string()),desired_domain:_.string(),brand_tone:_.string(),timezone:_.string()}).strict(),ss=_.object({company_uuid:_.string().uuid(),company_info:Zy,created_at:_.string().datetime(),updated_at:_.string().datetime()}),Jy=ss.extend({status:_.literal("NOT_STARTED"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.null(),completed_at:_.null()}).strict(),ex=ss.extend({status:_.literal("PROCESSING"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.string().datetime(),completed_at:_.null()}).strict(),hl=ss.extend({status:_.literal("SUCCEEDED"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.string().datetime(),completed_at:_.string().datetime()}).strict(),Sl=ss.extend({status:_.literal("FAILED"),last_error_code:_.string().min(1),last_error_message:_.string().min(1),started_at:_.string().datetime(),completed_at:_.string().datetime()}).strict(),tL=_.discriminatedUnion("status",[hl,Sl]),nL=_.discriminatedUnion("status",[Jy,ex,hl,Sl]),tx=["BAD_REQUEST","NOT_FOUND","PAYLOAD_TOO_LARGE","INTERNAL_SERVER_ERROR","UNAUTHORIZED","FORBIDDEN","INVALID_TASK_TYPE","TASK_URL_REQUIRED","INVALID_PLANNED_NUM","URL_LIST_REQUIRED","URL_LIST_LIMIT_EXCEEDED","INVALID_URL_LIST","INVALID_PAGINATION","INVALID_TASK_CODE","INVALID_HOME_URL","TASK_CODE_HOME_URL_CONFLICT","SITEMAP_TASK_NOT_FOUND","SITEMAP_DISCOVERY_FAILED","TASK_NOT_FOUND","PROVIDER_CAPABILITY_LIMIT","TASK_FAILED","WEBSITE_UNREACHABLE"],nx=_.enum(tx),iL=_.object({error_code:nx,error_message:_.string().min(1),failure_stage:_l.optional(),task_uuid:zt.optional(),task_code:dn.optional()}).strict();function ix(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}import{z as W}from"zod";var Ve=W.string().url().refine(ax,{message:"URL must use http or https"}),fl=W.string().min(1).max(512),os=W.string().datetime({offset:!0}),bl=W.enum(["scraping","completed","failed","expired"]),aL=W.object({url:Ve,ignore_cache:W.boolean(),sitemap:W.enum(["include","skip"]),include_subdomains:W.boolean(),ignore_query_parameters:W.boolean(),limit:W.number().int().min(1).max(1e5)}).strict(),rL=W.object({links:W.array(Ve).max(1e5)}).strict(),cL=W.object({url:Ve,limit:W.number().int().min(1).max(1e5),max_discovery_depth:W.literal(1),crawl_entire_domain:W.literal(!1),allow_subdomains:W.literal(!0),sitemap:W.literal("skip")}).strict(),mL=W.object({crawl_id:fl,expires_at:os.optional()}).strict(),lL=W.object({status:bl,urls:W.array(Ve).max(1e5),next:Ve.optional(),expires_at:os}).strict(),pL=W.object({url:Ve,formats:W.tuple([W.literal("rawHtml")]),only_main_content:W.literal(!1),max_age:W.number().int().nonnegative()}).strict(),dL=W.object({url:Ve,raw_html:W.string().min(1),status_code:W.number().int().min(100).max(599).nullable()}).strict(),uL=W.object({urls:W.array(Ve).min(1).max(1e4),formats:W.tuple([W.literal("rawHtml")]),ignore_invalid_urls:W.literal(!1),max_age:W.number().int().nonnegative(),max_concurrency:W.number().int().positive().optional()}).strict(),_L=W.object({batch_id:fl,expires_at:os.optional()}).strict(),sx=W.object({url:Ve,raw_html:W.string().min(1)}).strict(),gL=W.object({status:bl,total:W.number().int().nonnegative(),completed:W.number().int().nonnegative(),pages:W.array(sx).max(1e4),next:Ve.optional(),expires_at:os}).strict().superRefine((e,n)=>{e.completed>e.total&&n.addIssue({code:"custom",path:["completed"],message:"completed must not exceed total"})}),ox=W.object({url:Ve,error_message:W.string().min(1)}).strict(),hL=W.object({errors:W.array(ox).max(1e4),robots_blocked:W.array(Ve).max(1e4)}).strict(),SL=W.object({active:W.number().int().nonnegative(),waiting:W.number().int().nonnegative(),max_concurrency:W.number().int().positive()}).strict();function ax(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}var yl=["write_file","edit_file","delete_file"],rx="apply_patch_batch",cx=[...yl,rx];function bL(e){return yl.includes(e)}function yL(e){return cx.includes(e)}import{z as y}from"zod";var xl=y.lazy(()=>un),mx=y.enum(["page","block"]),rs=y.enum(["component","page","pages"]),lx=y.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),Ht=lx,El=y.object({requested_locale:Ht,resolved_locale:Ht,fallback_used:y.boolean()}).strict(),ni=y.object({id:y.string().uuid(),key:y.string().min(1),name:y.string().min(1)}).strict(),as=ni.extend({color:y.string().nullable()}).strict(),TL=y.object({kind:mx,category_id:y.string().uuid().optional(),tag_id:y.string().uuid().optional(),search:y.string().trim().min(1).max(200).optional(),limit:y.coerce.number().int().min(1).max(50).default(20),cursor:y.string().min(1).optional()}).strict(),px=y.object({stable_key:y.string().min(1),type:rs,title:y.string().min(1).max(200),description:y.string().max(1e3),thumbnail_url:y.string().url().nullable(),resolved_version:y.number().int().positive(),content_schema_version:y.literal(3),category:ni.nullable(),tags:y.array(as),page_count:y.number().int().nonnegative(),component_count:y.number().int().nonnegative(),locale:El}).strict(),kL=y.object({items:y.array(px),facets:y.object({categories:y.array(ni),tags:y.array(as)}).strict(),next_cursor:y.string().nullable()}).strict(),AL=y.object({operation_id:y.string().uuidv7(),resolved_version:y.number().int().positive(),base_sitemap_id:y.string().uuid(),base_sitemap_version:y.number().int().positive(),sitemap:xl,target_page_id:y.string().min(1).optional()}).strict(),wL=y.object({next_sitemap:xl,applied:y.object({stable_key:y.string().min(1),resolved_version:y.number().int().positive(),template_type:rs,page_ids:y.array(y.string().min(1)),block_ids:y.array(y.string().min(1))}).strict(),locale:El,warnings:y.array(y.string())}).strict(),Rl=y.object({nodeId:y.string().uuid(),type:y.string().trim().min(1).max(100),label:y.string().trim().min(1).max(200),variant:y.string().trim().min(1).max(100).optional(),order:y.number().int().nonnegative(),props:y.record(y.string(),y.unknown()),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict(),Il=y.object({nodeId:y.string().uuid().optional(),slug:y.string().regex(/^\/$|^\/[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/u),navigation:y.object({showInHeader:y.boolean(),showInFooter:y.boolean(),order:y.number().int().nonnegative()}).strict(),components:y.array(Rl).min(1).max(100),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict(),dx=Il.extend({nodeId:y.uuidv7(),parentNodeId:y.uuidv7().optional()}).strict(),ux=y.object({pages:y.array(dx).min(1).max(50),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict().superRefine(({pages:e},n)=>{let i=new Map(e.map(o=>[o.nodeId,o])),s=e.flatMap(o=>[o.nodeId,...o.components.map(a=>a.nodeId)]);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["pages"],message:"Node ids must be unique within the shared structure."}),new Set(e.map(o=>o.slug)).size!==e.length&&n.addIssue({code:"custom",path:["pages"],message:"Page slugs must be unique."});for(let[o,a]of e.entries()){if(a.parentNodeId===void 0)continue;let c=g=>n.addIssue({code:"custom",path:["pages",o,"parentNodeId"],message:g}),r=i.get(a.parentNodeId);r||c("Parent must reference a page in this template."),a.parentNodeId===a.nodeId&&c("A page cannot be its own parent."),(a.slug==="/"||r?.slug==="/")&&c("The home page cannot be a parent or child."),r?.parentNodeId!==void 0&&c("Pages allow at most two levels; the parent must be a root page.");let m=new Set([a.nodeId]),S=a.parentNodeId;for(;S!==void 0;){if(m.has(S)){c("Page parent references must not contain a cycle.");break}m.add(S),S=i.get(S)?.parentNodeId}}}),_x=y.union([Rl,Il,ux]),gx=y.object({title:y.string().min(1).max(200),description:y.string().min(1).max(1e3),prompt:y.string().min(1).max(8192)}).strict(),hx=y.object({locale:Ht,title:y.string().min(1).max(200),content:y.object({description:y.string().min(1).max(1e3),prompt:y.string().min(1).max(8192),nodes:y.record(y.string().uuid(),gx)}).strict()}).strict(),PL=y.object({templateId:y.string().uuid(),stableKey:y.string().min(1),type:rs,resolvedVersion:y.number().int().positive(),contentSchemaVersion:y.literal(3),structure:_x,requestedLocale:Ht,resolvedLocale:Ht,fallbackUsed:y.boolean(),contents:y.array(hx).length(1)}).strict().superRefine((e,n)=>{(e.type==="component"&&!("type"in e.structure)||e.type==="page"&&!("components"in e.structure)||e.type==="pages"&&!("pages"in e.structure))&&n.addIssue({code:"custom",path:["structure"],message:"Template type and structure must match."});let i=Sx(e.structure),s=new Set(Object.keys(e.contents[0]?.content.nodes??{}));(i.size!==s.size||[...i].some(o=>!s.has(o)))&&n.addIssue({code:"custom",path:["contents",0,"content","nodes"],message:"Localized nodes must exactly match the structure nodes."}),e.contents[0]?.locale!==e.resolvedLocale&&n.addIssue({code:"custom",path:["contents"],message:"Resolved locale must match returned content."}),e.fallbackUsed!==(e.requestedLocale!==e.resolvedLocale)&&n.addIssue({code:"custom",path:["fallbackUsed"],message:"fallbackUsed must match locale resolution."})}),vL=y.object({items:y.array(y.object({stableKey:y.string().min(1),type:rs,title:y.string().min(1).max(200),description:y.string().max(1e3),thumbnailUrl:y.string().url().nullable(),resolvedVersion:y.number().int().positive(),contentSchemaVersion:y.literal(3),category:ni.nullable(),tags:y.array(as),pageCount:y.number().int().nonnegative(),componentCount:y.number().int().nonnegative(),requestedLocale:Ht,resolvedLocale:Ht,fallbackUsed:y.boolean()}).strict()),facets:y.object({categories:y.array(ni),tags:y.array(as)}).strict(),nextCursor:y.string().nullable()}).strict().superRefine((e,n)=>{e.items.forEach((i,s)=>{i.fallbackUsed!==(i.requestedLocale!==i.resolvedLocale)&&n.addIssue({code:"custom",path:["items",s,"fallbackUsed"],message:"fallbackUsed must match locale resolution."})})});function Sx(e){if("type"in e)return new Set([e.nodeId]);let n="pages"in e?e.pages:[e];return new Set(n.flatMap(i=>[...i.nodeId?[i.nodeId]:[],...i.components.map(s=>s.nodeId)]))}function CL(e){return ia({tenant_id:e.tenant_id,site_id:e.site_id,stable_key:e.stable_key,resolved_version:e.request.resolved_version,base_sitemap_id:e.request.base_sitemap_id,base_sitemap_version:e.request.base_sitemap_version,sitemap:e.request.sitemap,target_page_id:e.request.target_page_id??null})}import{z}from"zod";var fx=["pending_dns","active","failed","removing"],bx=z.enum(fx),yx=["serve_site","redirect_301"],xx=z.enum(yx),Ex=["traffic","ownership","certificate_delegation"],sa=z.enum(Ex),Rx=["pending","verified"],Ix=z.enum(Rx),Tx=["not_applicable","unavailable","not_needed","auto_applied","confirmation_required","blocked"],kx=z.enum(Tx),oa=z.enum(["prepare_configuration","apply_configuration","verify_dns","remediate_dns","confirm_dns_remediation"]),Ax=z.enum(["accepted","running","succeeded","failed"]),wx=z.object({code:z.string().min(1),message:z.string().min(1)}).strict(),Px=z.object({purpose:sa,verified:z.boolean(),observedValues:z.array(z.string())}).strict(),Tl=z.object({ready:z.boolean(),providerReady:z.boolean(),dnsVerified:z.boolean(),records:z.array(Px)}).strict(),kl=z.object({type:z.string().min(1),name:z.string().min(1),value:z.string().min(1),ttl:z.number().nullable()}).strict(),vx=z.object({purpose:sa,action:z.enum(["none","create","update","blocked"]),before:kl.nullable(),after:kl.nullable()}).strict(),Al=z.object({domainId:z.string().min(1),status:kx,changes:z.array(vx)}).strict(),Cx=z.object({purpose:sa,type:z.string().min(1),name:z.string().min(1),value:z.string().min(1),verificationStatus:Ix}).strict(),wl=z.object({id:z.string().min(1),hostname:z.string().min(1),isPrimary:z.boolean(),routingMode:xx,observedStatus:bx,lastVerifiedAt:z.string().datetime().nullable(),dnsRecords:z.array(Cx)}).strict().superRefine((e,n)=>{Dx(e.hostname)||n.addIssue({code:"custom",path:["hostname"],message:"hostname must be a canonical ASCII hostname"}),e.isPrimary&&e.routingMode!=="serve_site"&&n.addIssue({code:"custom",path:["routingMode"],message:"a primary domain must serve the site"}),!e.isPrimary&&e.routingMode!=="redirect_301"&&n.addIssue({code:"custom",path:["routingMode"],message:"a non-primary domain must redirect with 301"})}),Pl=z.object({primaryDomain:wl.nullable(),redirectDomains:z.array(wl)}).strict().superRefine((e,n)=>{e.primaryDomain!==null&&(!e.primaryDomain.isPrimary||e.primaryDomain.routingMode!=="serve_site")&&n.addIssue({code:"custom",path:["primaryDomain"],message:"primaryDomain must be primary and serve the site"});for(let[s,o]of e.redirectDomains.entries())(o.isPrimary||o.routingMode!=="redirect_301")&&n.addIssue({code:"custom",path:["redirectDomains",s],message:"redirectDomains must be non-primary 301 redirects"});e.primaryDomain!==null&&e.redirectDomains.some(o=>o.hostname===e.primaryDomain?.hostname)&&n.addIssue({code:"custom",path:["redirectDomains"],message:"primaryDomain must not also be a redirect"});let i=[...e.primaryDomain===null?[]:[e.primaryDomain.hostname],...e.redirectDomains.map(s=>s.hostname)];new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["redirectDomains"],message:"domain hostnames must be unique"})}),cs=z.object({id:z.string().min(1),type:oa,status:Ax,error:wx.nullable(),result:z.union([Tl,Al]).nullable().optional()}).strict().superRefine((e,n)=>{if(e.status==="failed"&&e.error===null&&n.addIssue({code:"custom",path:["error"],message:"failed operations must include a stable error"}),e.status!=="failed"&&e.error!==null&&n.addIssue({code:"custom",path:["error"],message:"non-failed operations must not include an error"}),!(e.result===void 0||e.result===null)){if(e.status!=="succeeded"){n.addIssue({code:"custom",path:["result"],message:"operation results only belong to succeeded operations"});return}if(e.type==="verify_dns"){Tl.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"verify_dns operations require a DNS verification result"});return}if(e.type==="remediate_dns"){Al.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"remediate_dns operations require a DNS remediation result"});return}n.addIssue({code:"custom",path:["result"],message:"only verify_dns and remediate_dns operations may carry a result"})}});function Dx(e){if(e!==e.trim()||e!==e.toLowerCase()||e.length>253||e.endsWith("."))return!1;let n=e.split(".");return n.length>=2&&n[n.length-1].length>=2&&n.every(i=>i.length>=1&&i.length<=63&&/^[a-z0-9-]+$/.test(i)&&!i.startsWith("-")&&!i.endsWith("-"))}import{z as je}from"zod";import{z as x}from"zod";var Ox=x.enum(["active","completed","canceled"]),Nx=x.enum(["quality","domain","gsc","publish"]),ms=x.enum(["pending","running","succeeded","failed"]),Cl=ms,Dl=x.enum(["pending","running","completed"]),jx=x.object({group_code:x.string().min(1),name:x.string().min(1),score:x.number().nonnegative(),total_score:x.number().nonnegative(),pass_score:x.number().nonnegative(),running_status:Dl,result_text:x.string()}).strict(),Lx=x.object({id:x.number().int().positive().optional(),quality_task_id:x.number().int().positive(),item_code:x.string().min(1),status:ms,is_repaired:x.boolean(),total_score:x.number().nonnegative(),score:x.number().nonnegative(),check_result:x.unknown().nullable(),remediation_items:x.unknown().nullable(),result_text:x.string(),created_at:x.string().min(1),updated_at:x.string().min(1),item_name:x.string().min(1),dimension_code:x.enum(["reach","trust","convert","safe"]),group_code:x.string().min(1),auto_fix:x.boolean()}).strict(),Mx=x.object({dimension_code:x.enum(["reach","trust","convert","safe"]),name:x.string().min(1),alias_en:x.string().min(1),description:x.string(),tips:x.string(),score:x.number().nonnegative(),repaired_score:x.number().nonnegative(),total_score:x.number().nonnegative(),pass_score:x.number().nonnegative(),running_status:Dl,problem_group_count:x.number().int().nonnegative(),remediation_items:x.array(Lx),groups:x.array(jx)}).strict(),Ux=x.object({id:x.number().int().positive(),task_code:x.string().uuid(),scene_code:x.enum(["site_publish","vcp_published_pages","content_publish"]),tenant_id:x.string().min(1),vcp_site_id:k,cms_site_id:x.string().min(1),checked_url:x.string().url(),quality_params:x.record(x.string(),x.unknown()).nullable(),status:ms,error_info:x.record(x.string(),x.unknown()).nullable(),created_at:x.string().min(1),updated_at:x.string().min(1)}).strict(),Fx=x.union([x.object({}).strict(),x.object({summary:x.object({final_score:x.number().nonnegative(),pass_score:x.number().nonnegative(),group_count:x.number().int().nonnegative(),problem_group_count:x.number().int().nonnegative()}).strict(),dimensions:x.array(Mx)}).strict()]),vl=x.object({quality_info:Ux,quality_detail:Fx}).strict().superRefine((e,n)=>{let i="summary"in e.quality_detail;e.quality_info.status!=="failed"&&!i&&n.addIssue({code:"custom",message:"nonfailed quality tasks require complete detail",path:["quality_detail"]}),e.quality_info.status==="failed"&&i&&n.addIssue({code:"custom",message:"failed quality tasks require empty detail",path:["quality_detail"]})}),GL=x.object({item_code:x.string().min(1),remediation_items:x.unknown().nullable()}).strict(),Gx=x.object({item_code:x.string().min(1),repair_status:x.enum(["succeeded","failed"]),message:x.string().min(1).optional(),error_code:x.string().min(1).optional(),metadata:x.record(x.string(),x.unknown()).optional()}).strict(),Ol=x.object({items:x.array(Gx)}).strict(),qL=x.object({task_code:x.string().min(1),status:Cl,result:Ol.optional()}).strict().superRefine((e,n)=>{e.status==="succeeded"&&e.result===void 0&&n.addIssue({code:"custom",path:["result"],message:"succeeded repair tasks require a complete result"}),(e.status==="pending"||e.status==="running")&&e.result!==void 0&&n.addIssue({code:"custom",path:["result"],message:"nonterminal repair tasks cannot expose a result"})}),Dt=x.object({id:ri,tenant_id:x.string().min(1),site_id:k,status:Ox,current_step:Nx,quality_task_code:x.string().uuid().nullable(),quality_task_status:ms,repair_task_code:x.string().min(1).nullable(),repair_task_status:Cl,publish_deployment_id:ct.nullable(),domain_hostname:x.string().min(1).nullable(),domain_operation_type:oa.nullable(),domain_operation_payload:x.record(x.string(),x.unknown()).nullable(),domain_preparation_operation_id:x.string().min(1).nullable(),domain_operation_id:x.string().min(1).nullable(),revision:x.number().int().positive(),created_at:x.string().min(1),updated_at:x.string().min(1),completed_at:x.string().min(1).nullable(),canceled_at:x.string().min(1).nullable()}).strict().superRefine((e,n)=>{if(e.domain_operation_type===null){e.domain_operation_payload!==null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"domain_operation_payload must be null without an active domain operation"}),e.domain_operation_id!==null&&n.addIssue({code:"custom",path:["domain_operation_id"],message:"domain_operation_id must be null without an active domain operation"});return}e.domain_hostname===null&&n.addIssue({code:"custom",path:["domain_hostname"],message:"an active domain operation requires a hostname"}),e.domain_operation_payload===null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"an active domain operation requires a payload"})}),WL=x.object({}).strict(),KL=x.object({expected_revision:x.number().int().nonnegative(),current_step:x.enum(["domain","gsc","publish"]),skip_domain_binding:x.boolean().optional()}).strict(),BL=x.object({expected_revision:x.number().int().nonnegative()}).strict(),qx=x.object({workflow:Dt.nullable(),can_cancel:x.boolean()}).strict(),zL=L(qx).strict(),Wx=x.object({workflow:Dt,can_cancel:x.boolean()}).strict(),HL=L(Wx).strict(),Kx=x.object({workflow:Dt,deployment:x.lazy(()=>Ot)}).strict(),VL=L(Kx).strict(),Bx=x.object({workflow:Dt,can_cancel:x.boolean(),quality_result:vl.optional(),repair_result:Ol.optional(),final_quality_result:vl.optional(),message:x.string().min(1).optional()}).strict(),$L=L(Bx).strict();function zx(e){return"summary"in e.quality_detail?e.quality_detail.dimensions.flatMap(n=>n.remediation_items.filter(i=>i.status==="succeeded"&&i.score<i.total_score&&i.auto_fix).map(i=>({item_code:i.item_code,remediation_items:i.remediation_items}))):[]}function Hx(e,n){let i=e.map(a=>a.item_code),s=n.items.map(a=>a.item_code);if(new Set(i).size!==i.length||new Set(s).size!==s.length||i.length!==s.length)return!1;let o=new Set(i);return n.items.every(a=>o.has(a.item_code)&&a.repair_status==="succeeded")}function YL(e,n){if(!("summary"in e.quality_detail))return null;let i=zx(e);if(i.length===0)return e;if(n===void 0||!Hx(i,n))return null;let s=new Set(n.items.map(a=>a.item_code)),o=e.quality_detail.dimensions.map(a=>{let c=a.remediation_items.map(S=>s.has(S.item_code)?{...S,score:S.total_score,is_repaired:!0,result_text:""}:{...S}),r=a.groups.map(S=>{let g=c.filter(w=>w.group_code===S.group_code);return g.length===0?{...S}:{...S,score:g.reduce((w,K)=>w+K.score,0),result_text:g.map(w=>w.result_text).filter(Boolean).join("\u3001")}}),m=r.reduce((S,g)=>S+g.score,0);return{...a,score:m,repaired_score:m,problem_group_count:r.filter(S=>S.score!==S.total_score).length,remediation_items:c,groups:r}});return{quality_info:{...e.quality_info},quality_detail:{...e.quality_detail,summary:{...e.quality_detail.summary,final_score:Math.round(o.reduce((a,c)=>a+c.score,0)/o.length),problem_group_count:o.reduce((a,c)=>a+c.problem_group_count,0)},dimensions:o}}}var Vx=je.object({hostname:je.string().min(1),expected_revision:je.number().int().nonnegative()}).strict(),Nl=je.object({workflow:Dt,operation:cs}).strict(),$x=L(Nl).strict(),Yx=je.object({expected_revision:je.number().int().nonnegative()}).strict(),Xx=je.object({workflow:Dt,operation:cs}).strict(),Qx=L(Xx).strict(),aa=je.object({workflow:Dt,operation:cs.nullable()}).strict(),Zx=L(aa).strict(),Jx=aa,eE=L(Jx).strict(),tM=L(Pl).strict(),tE=je.object({published:je.boolean(),hostname:je.string(),url:je.string(),sandbox_url:je.union([je.string().url(),je.literal("")])}).strict().superRefine((e,n)=>{e.published||(e.hostname!==""&&n.addIssue({code:"custom",path:["hostname"],message:"unpublished sites must not include a hostname"}),e.url!==""&&n.addIssue({code:"custom",path:["url"],message:"unpublished sites must not include a URL"}))}),nM=L(tE).strict(),iM=Vx,sM=Nl,oM=$x,aM=aa,rM=Zx,cM=eE,mM=Yx,lM=Qx;import{z as We}from"zod";var nE=["started","success","failed","canceled"],ra=We.enum(nE),iE=["inactive","pending_binding","active"],ca=We.enum(iE),sE=["domain","url_prefix"],ma=We.enum(sE),oE=["not_connected","authorizing","matching_property","ready","failed","canceled","domain_mismatch"],la=We.enum(oE),rt=We.string().nullable(),jl=We.object({}).strict(),pa=We.object({authorize_url:We.string().url(),custom_domain:rt}).strict(),Ll=L(pa),aE=We.object({auth_status:ra,binding_status:ca,credential_connected:We.boolean(),custom_domain:rt,gsc_site_url:rt,property_type:ma.nullable(),auth_error_code:rt,auth_error_message:rt}).strict(),Ml=We.object({auth_status:ra,binding_status:ca,credential_connected:We.boolean(),custom_domain:rt,gsc_site_url:rt,property_type:ma.nullable(),auth_error_code:rt,auth_error_message:rt,current_domain:rt,state:la,ready:We.boolean()}).strict().superRefine((e,n)=>{let i=cE(e,e.current_domain),s=i==="ready";e.state!==i&&n.addIssue({code:"custom",path:["state"],message:`state must equal ${i} for the supplied GSC facts`}),e.ready!==s&&n.addIssue({code:"custom",path:["ready"],message:`ready must equal ${String(s)} for the supplied GSC facts`})}),rE=L(Ml);function ii(e){let n=e?.trim()??"";if(!n)return"";let i=/^[a-z][a-z0-9+.-]*:\/\//i.test(n)?n:`https://${n}`;try{return new URL(i).hostname.replace(/\.+$/,"").toLowerCase()}catch{return n.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0].replace(/\.+$/,"").toLowerCase()}}function cE(e,n){let i=e.gsc_site_url?.trim()??"",s=ii(e.custom_domain),o=ii(n??("current_domain"in e?e.current_domain:void 0)),a=s.length>0&&o.length>0&&s===o,c=mE(i,e.property_type,o);return e.auth_status==="canceled"?"canceled":e.auth_status==="failed"?"failed":e.auth_status==="started"?"authorizing":!e.credential_connected||e.binding_status==="inactive"?"not_connected":i.length===0||e.property_type===null?"matching_property":!a||!c?"domain_mismatch":e.binding_status==="pending_binding"?"matching_property":e.auth_status==="success"&&e.binding_status==="active"&&e.credential_connected&&i.length>0&&a&&c?"ready":"failed"}function mE(e,n,i){let s=e?.trim()??"",o=ii(i);if(!s||!o||!n)return!1;if(n==="domain"){let a=/^sc-domain:(.+)$/i.exec(s);if(!a)return!1;let c=a[1].trim();if(!c||/[/:?#]/.test(c))return!1;let r=ii(c);return r?o===r||o.endsWith(`.${r}`):!1}try{let a=new URL(s);return a.protocol!=="https:"||a.username||a.password||a.port||a.pathname!=="/"||a.search||a.hash?!1:ii(a.hostname)===o}catch{return!1}}var _M=jl,gM=pa,hM=Ll,SM=la,fM=ra,bM=ca,yM=ma,xM=la,EM=jl,RM=pa,IM=Ll,TM=aE,kM=Ml,AM=rE;import{z as O}from"zod";var Ke=O.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),Je=O.string().min(1).max(4096),_n=O.string().regex(/^[A-Za-z0-9_-]{43}$/),gn=O.string().max(300),da=O.string().datetime({offset:!0}).nullable(),Ul=O.string().regex(/^[A-Z][A-Z0-9_]*$/).max(100).nullable(),lE=["authorized","pending","failed","revoked","expired","not_authorized"],pE=O.enum(lE),dE=["pending","succeeded","failed","canceled","expired","superseded"],uE=O.enum(dE),_E=["unconfigured","configured","needs_reconfiguration","unverified"],gE=O.enum(_E),hE=["not_checked","valid","invalid","unavailable"],SE=O.enum(hE),fE=["authorization_pending","authorization_required","authorization_changed","resource_unavailable","resource_changed","verification_required","verification_unavailable"],bE=O.enum(fE),Fl=O.object({revision:Ke,status:uE,started_at:O.string().datetime({offset:!0}),expires_at:O.string().datetime({offset:!0}),finished_at:da,error_code:Ul}).strict(),CM=O.object({expected_authorization_revision:Ke,expected_attempt_revision:Ke,select_account:O.boolean().default(!1),replace_pending:O.boolean().default(!1)}).strict(),yE=O.object({authorize_url:O.string().url(),authorization_revision:Ke,attempt:Fl}).strict(),DM=L(yE),xE=O.object({status:pE,authorization_revision:Ke,account_email:O.string().max(320).nullable(),latest_attempt:Fl.nullable()}).strict(),EE=O.object({account_ref:Je,account_key:_n,account_display_name:gn,property_ref:Je,property_key:_n,property_display_name:gn,data_stream_ref:Je,data_stream_key:_n,data_stream_display_name:gn,measurement_id_display:O.string().min(1).max(40),default_uri:O.string().url().nullable(),selected_authorization_revision:Ke,configured_at:O.string().datetime({offset:!0}),updated_at:O.string().datetime({offset:!0})}).strict(),RE=O.object({status:SE,checked_at:da,expires_at:da,error_code:Ul}).strict(),IE=O.enum(["oauth","verification"]),TE=O.object({measurement_id_display:O.string().min(1).max(40),stream_display_name:O.string().max(100).nullable()}).strict(),kE=O.object({status:O.enum(["pending","applied"]),applied_revision:Ke}).strict(),Gl=O.object({capability_enabled:O.boolean(),revision:Ke,authorization:xE,binding_status:gE,reason:bE.nullable(),ready:O.boolean(),mode:IE.nullable(),binding:EE.nullable(),verification:RE,tracking:TE.nullable(),deployment:kE}).strict().superRefine((e,n)=>{if(!e.capability_enabled){(e.ready||e.revision!==0||e.authorization.status!=="not_authorized"||e.authorization.authorization_revision!==0||e.authorization.account_email!==null||e.authorization.latest_attempt!==null||e.binding_status!=="unconfigured"||e.reason!==null||e.mode!==null||e.binding!==null||e.tracking!==null||e.deployment.status!=="applied"||e.deployment.applied_revision!==0||e.verification.status!=="not_checked"||e.verification.checked_at!==null||e.verification.expires_at!==null||e.verification.error_code!==null)&&n.addIssue({code:O.ZodIssueCode.custom,message:"disabled GA4 capability must expose an empty state"});return}e.ready&&(e.authorization.status!=="authorized"||e.binding_status!=="configured"||e.mode!=="oauth"||e.binding===null||e.tracking===null||e.verification.status!=="valid"||e.reason!==null)&&n.addIssue({code:O.ZodIssueCode.custom,message:"ready GA4 status must be authorized, configured, and valid"})}),OM=L(Gl),NM=O.object({refresh:O.union([O.boolean(),O.enum(["true","false"]).transform(e=>e==="true")]).default(!1)}).strict(),AE=O.object({property_ref:Je,property_key:_n,display_name:gn}).strict(),wE=O.object({account_ref:Je,account_key:_n,display_name:gn,properties:O.array(AE)}).strict(),PE=O.object({accounts:O.array(wE),returned_count:O.number().int().nonnegative(),completeness:O.literal("unknown"),authorization_revision:Ke}).strict(),jM=L(PE),LM=O.object({authorization_revision:O.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),vE=O.object({data_stream_ref:Je,data_stream_key:_n,display_name:gn,measurement_id_display:O.string().min(1).max(40),default_uri:O.string().url().nullable(),selectable:O.boolean(),unavailable_reason:O.string().max(100).nullable()}).strict(),CE=O.object({property_ref:Je,streams:O.array(vE),returned_count:O.number().int().nonnegative(),completeness:O.literal("unknown"),authorization_revision:Ke}).strict(),MM=L(CE),UM=O.object({property_ref:Je,authorization_revision:O.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),FM=O.object({expected_revision:Ke,authorization_revision:Ke,account_ref:Je,property_ref:Je,data_stream_ref:Je,confirm_url_mismatch:O.boolean()}).strict(),DE=O.object({applied_revision:Ke,idempotency_replayed:O.boolean()}).strict(),OE=Gl.and(O.object({mutation:DE}).strict()),GM=L(OE);var ql=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,Wl="VCP_E2B_PREVIEW_PROXY_DOMAIN must be a valid hostname.";function NE(e){let n=e?.trim().toLowerCase()??"";if(!n)return null;if(n.length>253||!n.includes(".")||!n.split(".").every(i=>ql.test(i)))throw new Error(Wl);return n}function WM(e){let n=NE(e.proxyDomain);if(!n)return null;let i=e.sandboxId.trim();if(!ql.test(i))throw new Error("sandboxId must be a valid DNS label.");if(`${i}.${n}`.length>253)throw new Error(Wl);return`https://${i}.${n}/`}function BM(e){for(let n of e.targets)if(!(n.kind==="shared"?e.ledger.shared.some(s=>s.kind==="shared"&&s.target_id===n.target_id&&s.filled!==!0):e.ledger.pages.some(s=>s.omissions.some(o=>o.kind===n.kind&&o.target_id===n.target_id&&o.filled!==!0))))return{ok:!1,target_id:n.target_id};return{ok:!0}}function jE(e,n,i=e){let s=new Map(e.map(r=>[r.slug,r])),o=new Map(i.map(r=>[r.id,r])),a=new Map(e.map(r=>{let m=o.get(r.id);return m&&m.slug!==null&&m.slug!==r.slug?[m.slug,r]:null}).filter(r=>r!==null)),c=new Set(i.map(r=>r.slug).filter(r=>r!==null&&!s.has(r)));return{primaryLinks:Kl(n.primaryLinks,e,s,a,c,o,"showInHeader"),footerLinks:Kl(n.footerLinks,e,s,a,c,o,"showInFooter")}}function Kl(e,n,i,s,o,a,c){let r=new Set,m=[];for(let[K,H]of e.entries()){let se=LE(H.href),Se=se===null?void 0:i.get(se)??s.get(se);if(se!==null&&o.has(se)&&!i.has(se)&&!s.has(se))continue;if(Se?.slug==="/"){m.push({kind:"independent",link:{...H,label:Bl(H,Se,a)}});continue}if(!Se){m.push({kind:"independent",link:H});continue}if(!Se.navigation[c])continue;r.add(Se.slug);let xn=se===Se.slug?H.href:ME(H.href,Se.slug);m.push({kind:"page",page:Se,link:{...H,label:Bl(H,Se,a),href:xn},index:K})}let S=m.filter(K=>K.kind==="page").sort((K,H)=>K.page.navigation.order-H.page.navigation.order||K.index-H.index),g=0,w=m.map(K=>K.kind==="page"?S[g++].link:K.link);for(let K of[...n].filter(H=>H.slug!=="/"&&H.navigation[c]).sort((H,se)=>H.navigation.order-se.navigation.order))r.has(K.slug)||w.push({label:K.title,href:K.slug});return w}function Bl(e,n,i){let s=i.get(n.id);return e.label===(s?.title??n.title)?n.title:e.label}function LE(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/u);return n===-1?e:e.slice(0,n)}function ME(e,n){let i=e.search(/[?#]/u);return i===-1?n:`${n}${e.slice(i)}`}function ls(e){return e.trim().normalize("NFKC").toLowerCase()}function UE(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u9996\u9875":n?.startsWith("ja")?"\u30DB\u30FC\u30E0":n?.startsWith("ko")?"\uD648":"Home"}function FE(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u66F4\u591A":n?.startsWith("ja")?"\u305D\u306E\u4ED6":n?.startsWith("ko")?"\uB354\uBCF4\uAE30":n?.startsWith("fr")?"Plus":n?.startsWith("de")?"Mehr":n?.startsWith("es")?"M\xE1s":"More"}function GE(e){return e.map(n=>n.navigation.showInHeader===!0?n:{...n,navigation:{...n.navigation,showInHeader:!0}})}function si(e){return e.parent_page_id??null}function ps(e,n){let i=si(e);return i===null?!0:!n.some(s=>s.id===i)}function zl(e,n){return e.filter(i=>si(i)===n&&i.id!==n)}function Hl(e){let n=e.filter(c=>ps(c,e)),i=n.filter(c=>c.slug==="/"),s=n.filter(c=>c.slug!=="/"),o=[],a=new Set;for(let c of[...i,...s])if(!a.has(c.id)){o.push(c),a.add(c.id);for(let r of zl(e,c.id))a.has(r.id)||(o.push(r),a.add(r.id))}for(let c of e)a.has(c.id)||(o.push(c),a.add(c.id));return o}function qE(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/);return n===-1?e:e.slice(0,n)}function WE(e,n){let i=Hl(n),s=new Map;i.forEach((c,r)=>{c.slug!==null&&!s.has(c.slug)&&s.set(c.slug,r)});let o=[],a=[];for(let c of e){let r=qE(c.href),m=r===null?void 0:s.get(r);m===void 0?a.push(c):o.push({link:c,rank:m})}return o.sort((c,r)=>c.rank-r.rank),[...o.map(c=>c.link),...a]}function KE(e){let n=e.filter(i=>ps(i,e)).length;return{top_level_pages:n,sub_pages:e.length-n,total_pages:e.length,content_items:e.reduce((i,s)=>i+s.blocks.length,0)}}function BE(e,n={}){let i=[],s=new Map(e.map(c=>[c.id,c])),o=e.filter(c=>c.slug==="/");o.length!==1?i.push({code:"missing_home",page_id:null,message:"The structure must contain exactly one home page."}):n.expectedHomeTitle&&ls(o[0].title)!==ls(n.expectedHomeTitle)&&i.push({code:"home_renamed",page_id:o[0].id,message:`The home page must keep its fixed name '${n.expectedHomeTitle}'.`});for(let c of e){c.title.trim().length===0&&i.push({code:"empty_title",page_id:c.id,message:"Page name is empty."}),c.slug&&n.reservedSlugs?.includes(c.slug)&&i.push({code:"reserved_slug",page_id:c.id,message:`Slug '${c.slug}' is reserved by the site's applications.`});let r=si(c);if(r===null)continue;if(c.slug==="/"){i.push({code:"home_has_parent",page_id:c.id,message:"The home page cannot have a parent."});continue}if(r===c.id){i.push({code:"self_parent",page_id:c.id,message:"A page cannot be its own parent."});continue}let m=s.get(r);if(!m){i.push({code:"parent_not_found",page_id:c.id,message:`Parent page '${r}' does not exist.`});continue}if(m.slug==="/"){i.push({code:"home_has_children",page_id:c.id,message:"The home page cannot have sub pages."});continue}si(m)!==null&&i.push({code:"depth_exceeded",page_id:c.id,message:"At most two levels are allowed."})}let a=new Map;for(let c of e){let r=ps(c,e)?"__top__":si(c),m=ls(c.title);if(m.length===0)continue;let S=a.get(r)??new Map,g=S.get(m);g!==void 0&&g!==c.id?i.push({code:"duplicate_sibling_title",page_id:c.id,message:`Page name '${c.title}' is already used at the same level.`}):S.set(m,c.id),a.set(r,S)}return i}var zE=16,HE=/[ᄀ-ᅟ⺀-〾ぁ-㏿㐀-䶿一-鿿ꀀ-가-힣豈-︰--⦆¢-₩]/u;function VE(e){let n=0;for(let i of e)n+=HE.test(i)?2:1;return n}function $E(e){let n=e.normalize("NFKC").trim().replace(/\s+/g," ").toLowerCase();return n.length>3&&n.endsWith("s")?n.slice(0,-1):n}import{z as E}from"zod";var Vl=20*1024*1024,YE=Vl,$l=["jpg","jpeg","png","gif","webp","bmp"],Yl=["mp4","avi","mov","webm","mkv"],Xl=["mp3","wav","aac","flac","ogg","wma","m4a"],Ql=["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","md","csv"],Zl=[...Ql,"zip","rar","json","xmind","psd","ai","fig","sketch"],XE=[...$l,...Yl,...Xl,...Zl],Jl=["image/jpeg","image/png","image/gif","image/webp","image/bmp"],ep=["video/mp4","video/x-msvideo","video/quicktime","video/webm","video/x-matroska"],tp=["audio/mpeg","audio/wav","audio/x-wav","audio/vnd.wave","audio/aac","audio/flac","audio/x-flac","audio/ogg","audio/x-ms-wma","audio/mp4","audio/x-m4a"],QE=[...Jl,...ep,...tp],np=E.enum(["image","video","audio","file"]),ip=E.enum(["external","ai_generated","unsplash"]),ua=E.object({resource_id:E.string().min(1),name:E.string().min(1).max(255),url:E.string().url(),thumbnail_url:E.union([E.string().url(),E.literal("")]),mime_type:E.string().trim().min(3).max(127),size:E.number().int().nonnegative(),width:E.number().int().positive().nullable(),height:E.number().int().positive().nullable(),source:ip,created_at:E.string().min(1).nullable()}),ZE=E.object({page:E.coerce.number().int().min(1).default(1),page_size:E.coerce.number().int().min(1).max(100).default(24),keyword:E.string().trim().max(100).optional(),file_type:np.default("image")}),JE=E.object({code:E.literal(0),message:E.string(),data:E.object({items:E.array(ua),page:E.number().int().min(1),page_size:E.number().int().min(1),total:E.number().int().nonnegative()})}),eR=E.object({code:E.literal(0),message:E.string(),data:ua}),hn=4,tR="site.image_generation.max",nR=E.object({quantity:E.number().int().min(1).max(hn)}),_a=E.object({available:E.boolean(),remaining:E.number().nonnegative().nullable(),unlimited:E.boolean(),max_quantity:E.number().int().min(0).max(hn)}),iR=E.object({code:E.literal(0),message:E.string(),data:_a}),sR=E.object({pageName:E.string().trim().min(1).max(255),pageType:E.string().trim().min(1).max(40),sectionTitle:E.string().trim().max(500),nearbyTitle:E.string().trim().max(500),nearbyBody:E.string().trim().max(2e3),prompt:E.string().trim().min(1).max(2e3),aspectRatio:E.string().regex(/^\d{1,2}:\d{1,2}$/)}),sp=E.discriminatedUnion("ok",[E.object({index:E.number().int().min(0).max(hn-1),ok:E.literal(!0),url:E.httpUrl(),request_id:E.string().uuid()}),E.object({index:E.number().int().min(0).max(hn-1),ok:E.literal(!1),error:E.enum(["quota","generate","network"]),message:E.string().trim().min(1).max(500),request_id:E.string().uuid().nullable()})]),oR=E.object({code:E.literal(0),message:E.string(),data:E.object({quota:_a,items:E.array(sp).max(hn)})}),op=E.object({provider_id:E.string().min(1),url:E.string().url(),thumbnail_url:E.string().url(),width:E.number().int().positive(),height:E.number().int().positive(),alt:E.string(),photographer_name:E.string().min(1),photographer_url:E.string().url(),photo_url:E.string().url(),download_location:E.string().url(),dominant_color:E.string().nullable()}),aR=E.object({query:E.string().trim().min(1).max(100),page:E.coerce.number().int().min(1).default(1),page_size:E.coerce.number().int().min(1).max(30).default(18),orientation:E.enum(["landscape","portrait","squarish"]).optional()}),rR=E.object({code:E.literal(0),message:E.string(),data:E.object({items:E.array(op),page:E.number().int().min(1),page_size:E.number().int().min(1),total:E.number().int().nonnegative(),total_pages:E.number().int().nonnegative()})}),ap=E.string().url().refine(dR,{message:"download_location must be an official Unsplash download URL"}),cR=E.object({download_location:ap}),mR=E.object({code:E.literal(0),message:E.string(),data:E.object({reported:E.boolean()})}),lR=E.object({source_id:E.number().int().positive(),source_title:E.string().min(1).max(255),source_url:pt,resource_id:E.number().int().positive()}),pR=E.object({code:E.literal(0),message:E.string(),data:E.object({reported:E.boolean()})});function dR(e){if(!URL.canParse(e))return!1;let n=new URL(e);return n.protocol==="https:"&&n.hostname==="api.unsplash.com"&&n.username===""&&n.password===""&&n.port===""&&n.hash===""&&/^\/photos\/[^/]+\/download$/.test(n.pathname)}import{z as me}from"zod";var uR=me.object({colorSeeds:me.object({primary:me.string().min(1).max(40),accent:me.string().min(1).max(40),foreground:me.string().min(1).max(40).optional()}).strict().optional(),surfaceMode:me.enum(["light","dark"]).optional(),fonts:me.object({heading:me.string().min(1).max(60),body:me.string().min(1).max(60)}).strict().optional(),weightStyle:qe.optional()}).strict().refine(e=>e.colorSeeds!==void 0||e.surfaceMode!==void 0||e.fonts!==void 0||e.weightStyle!==void 0,{message:"colorSeeds, surfaceMode, fonts, or weightStyle is required"}),_R=me.object({ok:me.literal(!0),design_plan_version:me.number().int().positive().optional(),snapshot_id:A,site_design_context:me.lazy(()=>ds).optional(),changed_files:me.array(me.string().min(1)).optional()}),gR=me.object({snapshot_id:A,color_seeds:me.object({primary:me.string(),accent:me.string(),foreground:me.string().optional()}).nullable(),surface_mode:me.enum(["light","dark"]).nullable(),fonts:me.object({heading:me.string(),body:me.string()}).nullable(),palette_inputs_present:me.boolean(),palette_inputs:Eo.nullable(),notes:me.array(me.string()).nullable(),weight_style:qe.nullable().default(null),source:me.enum(["globals_css","design_plan_archive"])});import{z as D}from"zod";var Ie=D.string().min(1).max(100),rp=D.enum(["page","anchor","external","email","phone","file","group"]);function hR(e){if(!e||e.trim()!==e||/[\u0000-\u001f\u007f\\]/u.test(e))return!1;if(e.startsWith("/")&&!e.startsWith("//")||/^#[^\s]*$/u.test(e)||/^(mailto:|tel:)[^\s]+$/iu.test(e))return!0;try{let n=new URL(e);return(n.protocol==="http:"||n.protocol==="https:")&&!n.username&&!n.password}catch{return!1}}var SR=D.string().max(2048).refine(hR,"Invalid navigation destination"),cp=D.string().trim().min(1).max(255),mp=D.enum(["link","cta"]).nullable(),lp=D.lazy(()=>D.object({id:Ie,group_id:Ie,parent_id:Ie.nullable(),sort_order:D.number().int().nonnegative(),label:D.string(),href:D.string().nullable(),target_type:rp,enabled:D.boolean(),effective_visible:D.boolean(),open_in_new:D.boolean(),nofollow:D.boolean(),role:mp,link_binding:D.object({kind:D.enum(["custom","cms_page","file"]),page_id:Ie.nullable()}),children:D.array(lp)})),fR=D.object({id:Ie,name:D.string(),description:D.string(),is_default:D.boolean(),can_delete:D.boolean(),delete_block_reason:D.string().nullable(),items:D.array(lp)}),bR=D.object({site_id:D.string().min(1),default_group_id:Ie.nullable(),groups:D.array(fR),limits:D.object({max_depth:D.number().int().positive(),max_items:D.number().int().positive()})}),oU=D.object({data:bR}),pp=D.object({name:cp,description:D.string().max(2e3).optional()}).strict(),yR=pp.partial().refine(e=>Object.keys(e).length>0,"At least one field is required"),aU=D.object({group_id:Ie}).strict(),dp={label:cp,target_type:rp,href:SR.nullable().optional(),enabled:D.boolean().optional(),open_in_new:D.boolean().optional(),nofollow:D.boolean().optional(),role:mp.optional()},xR=D.object({group_id:Ie,parent_id:Ie.nullable().optional(),...dp}).strict().superRefine((e,n)=>{e.target_type!=="group"&&!e.href&&n.addIssue({code:"custom",path:["href"],message:"Link destination is required"}),e.target_type==="group"&&e.href&&n.addIssue({code:"custom",path:["href"],message:"Groups have no destination"})}),ER=D.object({...dp,link_mode:D.literal("custom").optional()}).partial().strict().refine(e=>Object.keys(e).length>0,"At least one field is required"),RR=D.object({group_id:Ie,parent_id:Ie.nullable(),before_id:Ie.nullable().optional()}).strict(),IR=D.object({cms_bound:D.boolean(),cms_driven:D.boolean(),supports_groups:D.boolean(),supports_nested_groups:D.boolean(),supports_link_attributes:D.boolean(),requires_agent:D.boolean(),reasons:D.array(D.string())}),rU=D.object({data:IR}),cU=D.discriminatedUnion("action",[D.object({action:D.literal("create_group"),values:pp}).strict(),D.object({action:D.literal("update_group"),id:Ie,values:yR}).strict(),D.object({action:D.literal("delete_group"),id:Ie}).strict(),D.object({action:D.literal("set_default_group"),group_id:Ie}).strict(),D.object({action:D.literal("create_item"),values:xR}).strict(),D.object({action:D.literal("update_item"),id:Ie,values:ER}).strict(),D.object({action:D.literal("delete_item"),id:Ie,cascade:D.boolean().optional()}).strict(),D.object({action:D.literal("move_item"),id:Ie,values:RR}).strict()]);import{z as le}from"zod";var ga=le.enum(["products","cases","guides","documents","company"]),TR=le.enum(["source_unreachable","content_mojibake","min_fields_unmet","document_no_file_reference","document_file_unavailable","media_ingest_failed","app_unavailable","write_failed","kind_input_unavailable","kind_uncertain","kind_service_unavailable","kind_budget_exhausted"]),yt=le.number().int().nonnegative(),kR=le.discriminatedUnion("status",[le.object({collection:ga,status:le.literal("processing")}).strict(),le.object({collection:ga,status:le.enum(["imported","partial","failed"]),imported:yt,exception:yt}).strict()]),up=le.enum(["legacy_domain_not_routed","site_context_missing","site_rules_limit_exceeded","site_rules_not_served"]),AR=le.enum(["target_page_unpublished","redirect_target_missing","redirect_write_failed",...up.options]),wR=le.discriminatedUnion("status",[le.object({status:le.literal("processing")}).strict(),le.object({status:le.literal("unavailable")}).strict(),le.object({status:le.literal("ready"),site_reason:up.nullable(),same_path:yt,active:yt,exception:yt,exceptions:le.array(le.object({path:le.string().regex(/^\/[^?#]*$/),reason_code:AR}))})]),pU=le.object({overall_status:le.enum(["moving","completed","disabled","failed"]),by_collection:le.array(kR),media:le.object({image:yt,video:yt,audio:yt,file:yt}),exceptions:le.array(le.object({collection:ga.nullable(),path:le.string().regex(/^\/[^?#]*$/),reason_code:TR})),redirects:wR.nullable().optional()});var fa=t.object({heading:t.string().min(1).max(160).optional(),body:t.string().min(1).max(160).optional(),paletteIntent:t.string().min(1).max(400).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),density:t.enum(["compact","comfortable","airy","editorial"]).optional(),motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),themeId:t.string().min(1).max(60).optional(),themeDescription:t.string().min(1).max(400).optional(),aestheticNote:t.string().min(1).max(300).optional(),weightStyle:qe.optional()}),ha=t.enum(["material","reference","brief","industry"]),PR=t.object({market:t.object({value:t.string().min(1).max(200),source:ha}),customer:t.object({value:t.string().min(1).max(200),source:ha}),purpose:t.object({options:t.array(t.string().min(1).max(60)).min(2).max(4),selected:t.string().min(1).max(60),source:ha})}),vR=t.enum(["text-options","motion-slider","positioning"]),ba=t.enum(["none","subtle","moderate","expressive"]),CR=t.enum(["compact","comfortable","airy","editorial"]),DR=ba,bp=t.object({skill_name:t.string().min(1),rationale:t.string().min(4).max(200),confidence:t.enum(["high","medium","low"]).optional(),displayName:t.object({zh:t.string().min(1),en:t.string().min(1)}).partial().optional()}),OR=t.object({value:t.string(),label:t.string(),desc:t.string().optional(),impact:t.string().optional(),isRecommended:t.boolean().optional(),preselect:t.boolean().optional(),visualHints:fa.optional(),conversionHints:Mt.optional()}),NR=t.object({id:t.string(),type:vR,question:t.string(),tag:t.string(),aiThinking:t.string(),options:t.array(OR),source:t.enum(["ai-detected","always-ask"]),sourceDetail:t.string(),positioning:PR.optional()}),ya=t.object({questions:t.array(NR).min(1).max(6)}),FU=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:$t,brief:t.string().min(20).max(1e3),site_default_locale:Ee.optional(),owner_locale:Ee.optional(),input_context:t.object({facts:t.array(di).max(120),conflicts:t.array(_i).max(20),reference:ui.optional(),sources:t.array(t.object({type:Es,title:t.string().max(120).optional(),status:Rs})).max(16).optional()}).optional()}),yp=t.enum(["model_schema_invalid","provider_rate_limited","provider_unavailable","aborted","unknown"]),GU=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:V,at:t.string().min(1)}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(bp).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:yp.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),at:t.string().min(1)})]),qU="SITE_PLANNING_INPUT_FROZEN",WU="SITE_PLANNING_LOCKED",KU="SITE_STRUCTURE_CONFIRMATION_REQUIRED",BU="SITE_STRUCTURE_CONFIRMATION_STALE",zU="SITE_SITEMAP_DRAFT_STALE",HU="SITE_SITEMAP_DRAFT_OPERATION_MISMATCH",_p="SITE_STRUCTURE_INVALID",VU=t.object({tenant_id:t.string().min(1),name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),$U=t.object({name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),YU=t.object({name:t.string().min(1).max(120)}),XU=t.object({name:t.string().min(1).max(120),default_locale:Ee.optional()}),QU=t.object({body:t.string().min(20).max(1e3)}),ZU=t.object({body:t.string().min(20).max(1e3)}),xa=t.string().url().refine(e=>{try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}},{message:"URL must use http or https protocol"}),JU=t.object({tenant_id:t.string().min(1),site_id:k.optional(),site_url:xa.optional(),site_name:t.string().trim().min(1).max(255).optional()}),eF=L(xr),tF=L(Er),nF=L(Rr),iF=L(Mr),sF=L(Ur),oF=L(Fr),aF=L(qr),rF=L(Wr),cF=L(Kr),mF=L(t.object({site_id:k,site_url:xa.nullable()})),jt=t.object({id:k,tenant_id:t.string().min(1),name:t.string().min(1),slug:t.string().min(1),status:Js,deployment_status:eo,archived_at:t.string().min(1).nullable(),current_sitemap_id:Te.nullable(),confirmed_sitemap_id:Te.nullable().optional(),confirmed_sitemap_version:t.number().int().positive().nullable().optional(),structure_confirmed_at:t.string().min(1).nullable().optional(),migration_content_requested:t.boolean().optional(),current_snapshot_id:A.nullable(),published_deployment_id:ct.nullable().optional(),deployed_url:t.string().url().nullable(),default_locale:Ee,owner_locale:Ee.optional(),cms_site_id:pr.nullable().optional(),cms_site_url:xa.nullable().optional(),parent_site_id:k.nullable().optional(),mount_path:t.string().min(1).nullable().optional(),schema_version:t.literal(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),Ea=t.object({id:$t,tenant_id:t.string().min(1),site_id:k,body:t.string().min(1),source:t.enum(["user","import","system"]),created_at:t.string().min(1),updated_at:t.string().min(1)}),lF=t.object({site:jt,brief:Ea,next_step:t.literal("clarify")}),pF=t.object({site:jt,brief:Ea}),dF=t.object({brief:Ea}),jR=t.enum(["queued","running","succeeded","failed","cancelled"]),xp=t.enum(["clarify","sitemap","workspace"]),Ep=t.enum(["clarify","sitemap","initial_generation","iteration","landing_page","fill_in"]),Rp=t.enum(["clarify","sitemap","workspace","summarize"]),et=t.object({id:V,tenant_id:t.string().min(1),site_id:k,agent_type:xp,run_kind:Ep,status:jR,model_route:Rp,started_at:t.string().min(1).nullable(),finished_at:t.string().min(1).nullable(),error_code:t.string().min(1).nullable(),created_at:t.string().min(1),thread_id:tt.nullable().optional()}),uF=t.object({agent_run:et}).strict(),LR=t.enum(["workspace","landing_page","external"]),MR=t.enum(["user","background"]),Ip=t.enum(["active","archived"]),hs=t.object({id:tt,tenant_id:t.string().min(1),site_id:k,kind:LR,origin:MR,subject_key:t.string().min(1).max(200),title:t.string().min(1).max(200),status:Ip,external_thread_id:t.string().min(1).max(200).nullable(),last_run_id:V.nullable(),last_activity_at:t.string().min(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),_F=t.object({agent_run:et,thread:hs.nullable()}),gF=t.object({run_id:V.optional(),site_id:k,agent_type:xp,run_kind:Ep.optional(),model_route:Rp,input:t.record(t.string(),t.unknown()).optional()}).superRefine((e,n)=>{oi(e.input)&&n.addIssue({code:"custom",path:["input"],message:"Agent run input must not contain secrets"})}),hF=t.object({agent_run:et,next_step:t.literal("stream_events")}),Tp=t.enum(["draft","candidate","deleting","current","failed"]),xt=t.object({id:A,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:Xe.nullable().optional(),reason:t.enum(["initial_generation","workspace_edit","pre_deploy","manual_save","rollback","template_upgrade","subsite_clone"]),status:Tp,created_at:t.string().min(1)}),SF=t.object({snapshot_id:A,creation_key:t.string().min(1),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:Xe.optional(),reason:xt.shape.reason,status:t.enum(["draft","candidate","current","failed"]).default("candidate"),source_run_id:V.optional()}),fF=t.object({site:jt,snapshot:xt,next_step:t.literal("workspace")}),bF=t.object({expected_manifest_hash:xt.shape.manifest_hash,manifest_hash:xt.shape.manifest_hash,object_key:xt.shape.object_key}).strict(),yF=t.union([t.object({base_snapshot_id:A.nullable(),source_run_id:V.optional()}).strict(),t.object({skip_base_check:t.literal(!0)}).strict()]),UR=t.object({site:jt,snapshot:xt,next_step:t.literal("workspace")}),xF=t.object({snapshot:xt}),EF=t.object({status:t.literal("deleting"),snapshot_id:A,object_key:t.string().min(1)}),RF=t.object({status:t.literal("deleted"),snapshot_id:A}),Ss=t.object({id:La,tenant_id:t.string().min(1),site_id:k,snapshot_id:A,version:t.number().int().positive(),accepted_commit:t.string().min(1),source_run_id:V.nullable(),created_at:t.string().min(1)}),FR=Ss.extend({reason:xt.shape.reason,status:Tp}),IF=t.object({accepted_commit:t.string().min(1),source_run_id:V.optional()}),TF=t.object({site_version:Ss,next_step:t.literal("workspace")}),kF=t.object({owner_id:t.string().min(1)}).strict(),AF=t.discriminatedUnion("acquired",[t.object({acquired:t.literal(!0)}).strict(),t.object({acquired:t.literal(!1)}).strict()]),wF=t.object({owner_id:t.string().min(1)}).strict(),PF=t.object({released:t.literal(!0)}).strict(),vF="TEMPLATE_UPGRADE_LOCK_LOST",CF=t.object({base_snapshot_id:A,accepted_commit:Ss.shape.accepted_commit,owner_id:t.string().min(1)}).strict(),DF=UR.strict(),OF=t.object({site_versions:t.array(FR)}),NF=t.object({site:jt,snapshot:xt,site_version:Ss,next_step:t.literal("workspace")}),jF=t.object({snapshot_id:A,force_rehydrate:t.boolean().optional(),recovery_required:t.boolean().optional()}),GR=t.discriminatedUnion("status",[t.object({status:t.literal("ready"),snapshot_id:A,preview_url:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({status:t.literal("failed"),code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})]),LF=t.object({tenant_id:t.string().min(1),site_id:k,snapshot_id:A}).strict(),MF=GR,Ra=t.enum(Yt),kp=t.enum(["quality_check","publish"]),Ot=t.object({id:ct,tenant_id:t.string().min(1),site_id:k,snapshot_id:A,type:kp.default("publish"),version:t.number().int().positive(),status:Ra,provider:t.enum(["cloudflare"]),url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),UF=t.object({tenant_id:t.string().min(1),site_id:k,expected_snapshot_id:A}).strict(),FF=t.object({deployment:Ot}),GF=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:ct}).strict(),qF=t.object({deployment:Ot}),WF=t.object({}).strict(),KF=t.object({snapshot_id:A.optional()}).strict(),qR=t.object({deployment:Ot}),BF=L(qR),zF=t.object({deployment:Ot.nullable()}),HF=t.object({deployment:Ot}),gp=t.object({id:ct,type:kp.default("publish"),status:Ra,url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable()}),WR=t.object({current:gp.nullable(),latest_released:gp.nullable()}),VF=L(WR),KR=t.enum(["deployment.snapshot","deployment.status.changed","deployment.finished","deployment.failed","deployment.realtime.recovered","server.error"]),Sn=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:k,deployment_id:ct,seq:t.number().int().positive(),sent_at:t.string().min(1)}),us=t.object({deployment:Ot,steps:vc.default([])}),$F=t.discriminatedUnion("type",[Sn.extend({type:t.literal("deployment.snapshot"),payload:us}),Sn.extend({type:t.literal("deployment.status.changed"),payload:us}),Sn.extend({type:t.literal("deployment.finished"),payload:us}),Sn.extend({type:t.literal("deployment.failed"),payload:us}),Sn.extend({type:t.literal("deployment.realtime.recovered"),payload:t.object({action:t.literal("refresh")})}),Sn.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})})]),YF=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:ct,status:Ra,updated_at:t.string().min(1)}),BR="vcp:deployments",XF={path:"/v1/sites/:site_id/deployments/:deployment_id/socket",redis_channel:BR,outbound_message_schema:"DeploymentWsServerMessageSchema",message_types:[...KR.options]},zR=t.object({error:t.object({code:t.string().min(1),message:t.string().min(1),details:t.unknown().optional(),request_id:t.string().min(1).optional(),retryable:t.boolean().default(!1)})}),QF=t.object({error:zR.shape.error.extend({code:t.literal("AGENT_RUN_IN_FLIGHT"),details:t.object({code:t.literal("AGENT_RUN_IN_FLIGHT"),message:t.string().min(1),agent_run:et})})}),ZF=t.object({colors:t.record(t.string(),t.string()).default({}),typography:t.record(t.string(),t.string()).default({}),spacing:t.record(t.string(),t.string()).default({}),motion:t.record(t.string(),t.string()).default({})}),HR=t.object({theme_id:t.string().min(1),paletteIntent:t.string().min(1),tone:t.string().min(1),mediaMood:t.string().min(1),motionLevel:ba.optional(),userVisualHints:fa.optional()}),VR=t.object({key:t.string().min(1).max(64).optional(),question:t.string().min(1),answer:t.string().min(1)}),JF=t.object({query:t.string().min(1),keywords:t.array(t.string()).default([]),orientation:t.enum(["landscape","portrait","square"]).optional(),role:t.enum(["hero","section","card","gallery","testimonial","decorative"]),altHint:t.string().min(1)}),eG=t.object({id:t.string().min(1),role:t.enum(["site_background","nav_background","footer_background"]),query:t.string().min(1),keywords:t.array(t.string()).default([]),treatment:t.enum(["cover","fixed-cover","subtle-texture"]),altHint:t.string().optional()}),$R=t.object({provider:t.enum(["unsplash","pexels"]),providerLabel:t.enum(["Unsplash","Pexels"]),providerHref:t.string().url(),photoHref:t.string().url().optional(),photographerName:t.string().optional(),photographerHref:t.string().url().optional(),requiresAttribution:t.boolean()}),tG=t.object({src:t.string().min(1),alt:t.string().min(1),width:t.number().int().positive().optional(),height:t.number().int().positive().optional(),provider:t.enum(["unsplash","pexels","placeholder"]).optional(),providerId:t.string().optional(),photoUrl:t.string().url().optional(),photographer:t.string().optional(),photographerUrl:t.string().url().optional(),credit:t.string().optional(),dominantColor:t.string().optional(),attribution:$R.optional()}),YR=t.enum(["system_recommended","user_picked","user_picked_extended","deterministic_fallback"]),fn=t.object({id:t.string().min(1),name:t.string().min(1),category:t.literal("page-generation"),version:t.string().min(1).optional(),reason:t.string().min(1).max(200),source:YR.default("system_recommended")}),ie=t.string().min(1).max(2e3),hp=t.string().min(1).max(120),ds=t.object({visualDirection:ie,brandFeeling:ie,paletteIntent:ie,typographyIntent:ie,density:CR,motionLevel:DR,motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),mediaStrategy:ie,compositionRules:t.array(ie).max(20),avoidPatterns:t.array(ie).max(20),fonts:t.object({heading:t.string().min(1),body:t.string().min(1)}).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),weightStyle:qe.optional()}),Ia=160,Ap=t.object({routeGoal:ie,narrativeArc:ie,firstViewportIntent:ie,visualContinuity:ie,sectionRhythm:ie,avoidPatterns:t.array(ie).max(20),displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(Ia).optional(),metaTitle:t.string().min(1).max(120).optional(),metaDescription:t.string().min(1).max(320).optional(),primaryKeyword:t.string().min(1).max(160).optional(),longTailKeywords:t.array(t.string().min(1).max(160)).max(3).optional()}),wp=t.enum(["model_call","validation","repair","preview","worker_group"]),Nt=t.enum(["generating","generating_design_plan","checking_quality","updating_design_memory"]),Pp=t.object({sectionRole:ie,contentIntent:ie,layoutIntent:ie,visualIntent:ie,mediaIntent:ie,motionIntent:ie,interaction:pi.optional(),copyTone:ie,displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(Ia).optional(),ctaIntent:ie.optional(),continuityWithPrevious:ie.optional(),avoidRepeating:t.array(ie).max(20).optional(),industryRecipeRefs:t.array(hp).max(12).optional(),templateRecipeRefs:t.array(hp).max(12).optional()}),vp=t.object({siteName:t.string().min(1).max(120),tagline:t.string().min(1).max(200).optional(),primaryCta:t.object({label:t.string().min(1).max(60),target:t.string().min(1).max(200)}).optional(),trustSignals:t.array(t.string().min(1).max(60)).max(6).optional(),industry:t.string().min(1).max(40).optional()}),XR=t.enum(["solid","floating"]),QR=t.enum(["background","card","primary","frosted"]),ZR=t.enum(["sticky","hide-on-scroll","static"]),JR=t.enum(["bar","island"]),eI=t.object({variant:XR,surface:QR.optional(),behavior:ZR.optional(),shape:JR.optional()}),tI=t.object({form:ie,layoutIntent:ie,scrollBehavior:ie,shell:eI.optional(),avoidPatterns:t.array(ie).max(10).optional()}),nI=t.enum(["background","card","primary","inverse"]),iI=t.object({surface:nI}),sI=t.object({form:ie,composition:ie,shell:iI.optional(),avoidPatterns:t.array(ie).max(10).optional()}),oI=t.object({pattern:ie,intent:ie}),Cp=t.object({header:tI,footer:sI,mobileNav:oI}),Dp=t.object({schemaVersion:t.literal(1).default(1),siteDesignContext:ds,routeCards:t.record(t.string().min(1),Ap),blockContexts:t.record(t.string().min(1),Pp),selectedSkillPacks:t.array(fn).max(3).optional(),branding:vp.optional(),chromeDesign:Cp.optional()}),nG=t.object({siteDesignContext:ds.omit({imagePalette:!0}).optional(),routeCards:t.record(t.string().min(1),Ap).optional(),blockContexts:t.record(t.string().min(1),Pp.extend({interaction:pi.nullable().optional()})).optional(),branding:vp.optional(),chromeDesign:Cp.optional()}),Fe=t.string().trim().min(1),Ta=t.object({id:Fe,label:t.string().trim().min(1),type:t.string(),variant:t.string().optional(),order:t.number(),props:t.record(t.string(),t.unknown()),meta:t.object({aiGenerated:t.boolean(),userEdited:t.boolean(),lastEditedAt:t.string(),lastEditedBy:t.enum(["ai","user"]),userInstruction:t.string().optional()}).optional()}).strict(),ka=t.string().regex(On,"Page slug must be '/' or a lowercase ASCII kebab-case absolute path."),aI=new RegExp(`^/(?:${Zt}(?:/${Zt})*)?(?:\\?[^#\\s]*)?(?:#[^\\s]*)?$`),rI=/^(?:#[^\s]*|[a-z][a-z0-9+.-]*:[^\s]+|\/\/[^\s]+)$/i,cI=t.union([t.string().regex(aI),t.string().regex(rI)]),Sp=t.object({label:t.string(),href:cI}).passthrough(),mI=t.object({primaryLinks:t.array(Sp),footerLinks:t.array(Sp)}),Op=t.object({showInHeader:t.boolean(),showInFooter:t.boolean(),order:t.number()}).strict(),Aa=t.object({id:Fe,slug:ka,title:t.string().trim().min(1),blocks:t.array(Ta).min(1),navigation:Op,parent_page_id:Fe.nullable().optional()}).strict(),lI=Ta.extend({type:t.string().nullable()}).strict(),pI=Aa.extend({slug:ka.nullable(),navigation:Op.extend({showInHeader:t.boolean().nullable(),showInFooter:t.boolean().nullable()}).strict(),blocks:t.array(lI).min(1)}).strict(),dI=Ta.extend({id:t.string()}),uI=Aa.omit({parent_page_id:!0}).extend({id:t.string(),slug:t.string().min(1),blocks:t.array(dI).min(1),parent_page_id:t.string().nullable().optional()}),fp=t.object({label:t.string(),href:t.string().min(1)}),_I=t.object({primaryLinks:t.array(fp),footerLinks:t.array(fp)}),gI=t.discriminatedUnion("kind",[t.object({kind:t.literal("brief_clarify"),brief_id:$t,answer_ids:t.array(t.string().min(1)).max(10)}).strict(),t.object({kind:t.literal("step5_strategy"),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/)}).strict()]),_s=t.object({site_name:t.string().min(1).max(80).optional(),version:t.number().int().positive(),pages:t.array(Aa).min(1),navigation:mI,integrations:t.object({cms:t.unknown().optional(),analytics:t.unknown().optional()}).optional(),meta:t.object({generatedAt:t.string(),generatedBy:t.literal("sitemap-agent"),source_brief_id:t.string().optional(),source_answer_ids:t.array(t.string()).optional(),source:gI.optional()}),skillSelection:fn,visualTheme:HR.optional(),userChoices:t.array(VR).optional(),confirmedChoices:t.object({conversion:Mt.optional()}).optional(),seoKeywords:t.array(wn).min(1).optional()}).strict(),bn=_s.superRefine((e,n)=>{Np(e.pages,n)}),un=_s.extend({pages:t.array(pI).min(1)}).strict().superRefine((e,n)=>{Np(e.pages,n)}),hI=t.enum(["slug","showInHeader","showInFooter"]),SI=t.object({page_id:Fe,fields:t.array(hI).min(1).max(3)}).strict(),fI=t.object({page_id:Fe,block_id:Fe,fields:t.tuple([t.literal("type")])}).strict(),bI=100,yI=500,xI=t.object({pages:t.array(SI).max(bI),blocks:t.array(fI).max(yI)}).strict().superRefine((e,n)=>{let i=new Set;e.pages.forEach((o,a)=>{i.has(o.page_id)&&n.addIssue({code:"custom",path:["pages",a,"page_id"],message:`Duplicate page target '${o.page_id}'.`}),i.add(o.page_id),new Set(o.fields).size!==o.fields.length&&n.addIssue({code:"custom",path:["pages",a,"fields"],message:"Page target fields must be unique."})});let s=new Set;e.blocks.forEach((o,a)=>{let c=`${o.page_id}\0${o.block_id}`;s.has(c)&&n.addIssue({code:"custom",path:["blocks",a],message:`Duplicate block target '${o.page_id}/${o.block_id}'.`}),s.add(c)})}),iG=t.object({sitemap:un,targets:xI,reserved_slugs:t.array(ka).optional()}).strict(),sG=t.object({sitemap:bn}).strict();function Np(e,n){let i=new Map,s=new Map,o=new Map,a=0;e.forEach((m,S)=>{let g=i.get(m.id);if(g!==void 0?n.addIssue({code:"custom",path:["pages",S,"id"],message:`Duplicate page id '${m.id}' (first used at pages.${g}.id).`}):i.set(m.id,S),m.blocks.forEach((K,H)=>{let se=s.get(K.id);se!==void 0?n.addIssue({code:"custom",path:["pages",S,"blocks",H,"id"],message:`Duplicate block id '${K.id}' (first used at pages.${se.pageIndex}.blocks.${se.blockIndex}.id).`}):s.set(K.id,{pageIndex:S,blockIndex:H})}),m.slug===null)return;m.slug==="/"&&(a+=1);let w=o.get(m.slug);w!==void 0?n.addIssue({code:"custom",path:["pages",S,"slug"],message:`Duplicate page slug '${m.slug}' (first used at pages.${w}.slug).`}):o.set(m.slug,S)}),(a!==1||e[0]?.slug!=="/")&&n.addIssue({code:"custom",path:["pages"],message:"Sitemap must contain exactly one home page at pages[0] with slug '/'.",params:{errorCode:_p}});let c=new Map(e.map((m,S)=>[m.id,{page:m,index:S}])),r=(m,S)=>n.addIssue({code:"custom",path:m,message:S,params:{errorCode:_p}});e.forEach((m,S)=>{let g=m.parent_page_id??null;if(g===null)return;let w=["pages",S,"parent_page_id"];if(m.slug==="/"){r(w,"The home page cannot have a parent.");return}if(g===m.id){r(w,`Page '${m.id}' cannot be its own parent.`);return}let K=c.get(g);if(!K){r(w,`Parent page '${g}' does not exist.`);return}if(K.page.slug==="/"){r(w,"The home page cannot have sub pages.");return}(K.page.parent_page_id??null)!==null&&r(w,`Sitemap allows at most two levels; parent '${g}' must be a top-level page.`)})}var oG=_s.omit({skillSelection:!0,visualTheme:!0,userChoices:!0,confirmedChoices:!0,seoKeywords:!0}).extend({meta:_s.shape.meta.omit({source:!0}),site_name:t.string().min(1).max(80),pages:t.array(uI).min(1),navigation:_I}),EI=t.enum(["ai","user"]),yn=t.object({site_id:k,page_id:Fe,edited_by:EI.default("ai"),source_agent_run_id:V.optional()}),aG=yn.extend({block_id:Fe,target_index:t.number().int().min(0)}),RI=yn.extend({block_id:Fe}),II=yn.extend({block_id:Fe,instruction:t.string()}),rG=yn.extend({block_id:Fe,variant:t.string().min(1).nullable()}),cG=yn.extend({block_id:Fe,props:t.record(t.string(),t.unknown()),mode:t.enum(["replace","merge"]).default("replace")}),mG=yn.extend({block:t.object({id:Fe,label:t.string().trim().min(1),type:t.string().min(1),variant:t.string().min(1).optional(),props:t.record(t.string(),t.unknown()).default({}),insert_index:t.number().int().min(0).optional()})}),TI=t.enum(["move_block","delete_block","update_block_instruction","change_block_variant","update_block_props","add_block"]),lG=t.discriminatedUnion("operation",[t.object({operation:t.literal("delete_block"),input:RI}).strict(),t.object({operation:t.literal("update_block_instruction"),input:II}).strict()]),kI=t.enum(["SITEMAP_EDIT_INVALID","SITEMAP_API_NOT_CONFIGURED","SITEMAP_NOT_FOUND","SITEMAP_PAGE_NOT_FOUND","SITEMAP_BLOCK_NOT_FOUND","SITEMAP_BLOCK_ALREADY_EXISTS","SITEMAP_LAST_BLOCK_DELETE_FORBIDDEN","SITEMAP_EDIT_FAILED"]),AI=t.object({status:t.literal("updated"),operation:TI,site_id:k,sitemap_id:Te,version:t.number().int().positive(),changed_pages:t.array(Fe).min(1),requires_code_patch:t.literal(!0)}),wI=t.object({status:t.literal("failed"),code:kI,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),pG=t.discriminatedUnion("status",[AI,wI]),wa=t.object({question_id:t.string().min(1),value:t.string().min(1),label:t.string().min(1).optional(),question:t.string().min(1).optional(),option_label:t.string().min(1).optional(),motion_level:ba.optional(),visual_tonality:fa.optional(),conversion:Mt.optional(),positioning:t.object({market:t.string().min(1).max(200),customer:t.string().min(1).max(200),purpose:t.string().min(1).max(60)}).optional()}),PI=t.object({id:t.string().trim().min(1).max(128),type:t.literal(1),search_intent:t.string().trim().min(1).max(255),path:t.string().trim().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),channel:t.string().trim().min(1).max(80),content_format:t.string().trim().min(1).max(80),priority:t.enum(["P0","P1","P2","P3"])}).strict(),dG=t.object({source:t.object({kind:t.literal("step5_strategy")}).strict()}).strict(),vI=t.object({item_key:Ei,title:t.string().trim().min(1).max(200),selected_option_id:vn,selected_label:t.string().trim().min(1).max(200),selected_value:t.string().trim().min(1).max(500),selected_description:t.string().trim().min(1).max(2e3),impact:t.string().trim().min(1).max(500).optional(),customer_note:t.string().trim().min(1).max(200).optional(),market_type:Ri.optional(),markets:t.array(Ii).max(32).optional(),sections:t.array(t.object({id:t.string().min(1),label:t.string().min(1)}).strict()).optional()}).strict(),CI=t.object({kind:t.literal("step5_strategy"),site_name:t.string().trim().min(1).max(80).optional(),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/),decisions:t.array(vI).min(yi).max(De),enterprise_keywords:t.array(wn).min(1).optional()}).strict().superRefine((e,n)=>{let i=e.decisions.map(o=>o.item_key);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 sitemap decisions must use unique strategy keys."}),Pn.forEach(o=>{i.includes(o)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 sitemap decisions are missing ${o}.`})});let s=Qt.filter(o=>i.includes(o));e.decisions.forEach((o,a)=>{o.item_key!==s[a]&&n.addIssue({code:"custom",path:["decisions",a,"item_key"],message:"Step5 sitemap decisions must use the canonical order."})})}),jp=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:$t,brief:t.string().min(20).max(1e3),answers:t.array(wa).min(1).max(10),skillSelection:fn,site_default_locale:Ee.optional(),owner_locale:Ee.optional(),cms_site_id:t.string().min(1).nullish(),intent_pages:t.array(PI).max(9).optional(),reference:ui.optional(),input_context:t.object({facts:t.array(di).max(120),conflicts:t.array(_i).max(20)}).optional(),business_facts:Za.optional(),migration_products_enabled:t.boolean().optional()}),DI=jp.pick({tenant_id:!0,site_id:!0,skillSelection:!0,site_default_locale:!0,owner_locale:!0,cms_site_id:!0,reference:!0,input_context:!0,business_facts:!0,migration_products_enabled:!0}).partial({skillSelection:!0}).extend({source:CI}).strict(),uG=t.union([jp,DI]),Lp=t.enum(["planning","generating","validating","ready"]),OI=t.enum(["salvaged","deterministic_fallback"]),NI=t.enum(["model_exception_settled_prefix","model_exception_safe_root"]),Mp={outcome:OI.optional(),reason:NI.optional(),attempts:t.number().int().positive().optional()};function Up(e,n){if(e.type!=="sitemap.generated")return;let i=e.outcome!==void 0,s=e.reason!==void 0;i!==s&&n.addIssue({code:"custom",path:[i?"reason":"outcome"],message:"sitemap.generated outcome and reason must be provided together"})}var jI=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:V,at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:Lp,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:Te,sitemap:bn,...Mp,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:A,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:A.optional(),at:t.string().min(1)})]),_G=jI.superRefine(Up),Fp=t.object({id:Te,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),source_agent_run_id:V.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}).strict();function Gp(e,n){e.version!==e.sitemap.version&&n.addIssue({code:"custom",path:["sitemap","version"],message:`Sitemap JSON version ${e.sitemap.version} must equal record version ${e.version}.`})}var qp=Fp.extend({sitemap:bn}).superRefine(Gp),Wp=Fp.extend({sitemap:un}).superRefine(Gp),gG=t.object({sitemap_id:Te,creation_key:t.string().min(1),sitemap:un,expected_current_sitemap_id:Te,expected_current_sitemap_version:t.number().int().positive()}).strict().superRefine((e,n)=>{e.sitemap.version!==e.expected_current_sitemap_version&&n.addIssue({code:"custom",path:["sitemap","version"],message:"Draft version must match the expected base version."})}),hG=t.object({sitemap:Wp}).strict();function SG(e){return`sitemap-user-draft:${e.site_id}:${e.expected_current_sitemap_id}:${e.expected_current_sitemap_version}:${e.sitemap_id}`}var fG=t.object({sitemap_id:Te,creation_key:t.string().min(1),sitemap:bn,source_agent_run_id:V.optional()}),bG=t.object({sitemap_id:Te,creation_key:t.string().min(1),sitemap:un,expected_current_sitemap_id:Te,expected_current_sitemap_version:t.number().int().positive(),migration_content_requested:t.boolean().optional()}),yG=t.object({sitemap_id:Te,creation_key:t.string().min(1),sitemap:bn,source_agent_run_id:V}),xG=t.object({site:jt,sitemap:qp,next_step:t.literal("workspace")}).strict(),EG=t.object({site:jt,sitemap:Wp,next_step:t.literal("workspace")}).strict(),RG=t.object({site:jt,sitemap:qp,next_step:t.literal("sitemap_review")}).strict(),LI=t.object({id:ja,tenant_id:t.string().min(1),site_id:k,brief_id:$t,questions:ya,answers:t.array(wa),selected_archetype:fn.optional(),completed_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),IG=t.object({answers:t.array(wa).min(1),questions:ya,selected_archetype:fn.optional()}),TG=t.object({clarify_session:LI}),kG=t.object({questions:ya,selected_archetype:fn}),MI=t.object({id:bs,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),design_plan:Dp,source_agent_run_id:V.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),AG=t.object({design_plan_id:bs.optional(),design_plan:Dp,source_agent_run_id:V.optional()}),wG=t.object({design_plan:MI}),fs=t.enum(["initial_generation","iteration","landing_page","fill_in"]),UI=t.object({label:t.string().min(1).max(48),prompt:t.string().min(1).max(160)}).strict(),FI=t.enum(["model","derived","mixed","advisor"]),Kp=t.object({suggestions:t.array(UI).min(1).max(4),source:FI}).strict(),GI=t.enum(["clean","salvaged","deterministic_fallback","baseline_retained"]),qI=t.enum(["generation_succeeded","entry_slots_omitted","quality_gate_exhausted","schema_gate_exhausted","generation_timeout","stream_schema_mismatch","stream_generation_error","generation_error","fallback_compiler_error","legacy_result_missing_metadata"]),WI=t.enum(["progress","assistant_final"]),Bp=t.enum(["run.started","message.delta","user.message","plan.updated","clarify.partial","clarify.archetype_proposals","clarify.finished","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","sitemap.updated","sitemap.resync.failed","sitemap.resync.warning","block.changed","tool.started","tool.finished","workspace.plan.created","workspace.worker.updated","workspace.task.updated","workspace.degraded","workspace.design_plan.outcome","workspace.suggestions","workspace.generation_ledger","file.changed","snapshot.created","snapshot.finalized","preview.preparing","preview.ready","preview.build.started","preview.build.succeeded","preview.build.failed","run.failed","run.finished","media_resolution.started","media_resolution.finished","skill.selecting","skill.selected","activity.started","activity.updated","activity.finished","activity.failed"]),KI=t.object({id:t.string().min(1),title:t.string().min(1),status:t.enum(["pending","running","completed","failed"])}),Vt=t.enum(["pending","running","completed","completed_with_skips","failed","skipped"]),Pa=t.enum(["style_media","chrome","sections","layout","pages","detect_typecheck","repair","finalize","sitemap_resync","preview"]),va=t.object({code:t.string().min(1),message:t.string().min(1),path:t.string().min(1).optional(),task_id:t.string().min(1).optional(),details:t.record(t.string(),t.unknown()).optional()}),Pe=t.string().min(1).refine(e=>nd(e),{message:"Snapshot file paths must be safe relative POSIX paths without traversal."}),Ca=t.object({deduped_paths:t.array(Pe),skipped_tasks:t.array(t.string().min(1)),failed_tasks:t.array(t.string().min(1)),fallback_files:t.array(t.string().min(1)),applied_paths:t.array(Pe)}),Da=t.object({group_id:t.string().min(1),phase:Pa,title:t.string().min(1),status:Vt,task_ids:t.array(t.string().min(1)),depends_on_groups:t.array(t.string().min(1)),target_paths:t.array(Pe)}),BI=t.enum(["style","media","chrome","section","layout","page"]),Oa=t.object({task_id:t.string().min(1),group_id:t.string().min(1),kind:BI,target_path:Pe,block_id:t.string().min(1).optional(),block_type:t.string().min(1).optional(),block_variant:t.string().min(1).optional(),block_order:t.number().int().nonnegative().optional(),user_instruction:t.string().min(1).optional(),page_id:t.string().min(1).optional(),page_slug:t.string().min(1).optional(),page_title:t.string().min(1).optional(),title:t.string().min(1).max(60).optional(),description:t.string().min(1).max(Ia).optional(),status:Vt,required_reads:t.array(Pe).optional(),search_params_sections:t.array(Pe).optional(),standard_form_view:Pe.optional(),breadcrumb:t.object({trail:t.array(t.object({name:t.string().min(1),href:t.string().min(1).nullable(),omitted_href:t.string().min(1).optional()}).strict()).min(1),current:t.string().min(1)}).strict().optional()}),Na=t.object({from_group_id:t.string().min(1),to_group_id:t.string().min(1),reason:t.enum(["style_media","chrome","sections","layout","page_composition","quality_gate"])}),PG=t.object({plan_id:t.string().min(1),run_kind:fs,model_route:t.object({planner:t.literal("workspace_planner"),worker:t.literal("workspace")}),groups:t.array(Da),tasks:t.array(Oa),dependencies:t.array(Na),expected_outputs:t.array(Pe),diagnostics:Ca}),vG=t.object({task_id:t.string().min(1),patch:t.unknown().optional(),snapshot_id:A.optional(),read_files:t.array(Pe),diagnostics:t.array(va),status:Vt}),zp=t.object({worker_count:t.number().int().nonnegative(),task_count:t.number().int().nonnegative(),group_count:t.number().int().nonnegative()}),Hp=t.object({pending:t.number().int().nonnegative(),running:t.number().int().nonnegative(),completed:t.number().int().nonnegative(),completed_with_skips:t.number().int().nonnegative(),failed:t.number().int().nonnegative(),skipped:t.number().int().nonnegative()}),zI=t.object({type:t.literal("text"),text:t.string(),state:t.enum(["streaming","done"]).optional()}),HI=t.object({type:t.literal("reasoning"),text:t.string(),state:t.enum(["streaming","done"]).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),VI=t.object({type:t.literal("file"),mediaType:t.string().min(1),filename:t.string().min(1).optional(),url:t.string().min(1)}),$I=t.object({type:t.literal("source-url"),sourceId:t.string().min(1),url:t.string().min(1),title:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),YI=t.object({type:t.literal("source-document"),sourceId:t.string().min(1),mediaType:t.string().min(1),title:t.string().min(1),filename:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),XI=t.object({type:t.string().regex(/^data-[a-zA-Z0-9_-]+$/),id:t.string().min(1).optional(),data:t.unknown()}),QI=t.object({type:t.string().regex(/^tool-[a-zA-Z0-9_-]+$/),toolCallId:t.string().min(1),state:t.enum(["input-streaming","input-available","output-available","output-error"]),input:t.unknown().optional(),output:t.unknown().optional(),errorText:t.string().min(1).optional()}),ZI=t.object({type:t.literal("error"),errorText:t.string().min(1)}),JI=t.object({type:t.literal("step-start")}),gs=t.union([zI,HI,VI,$I,YI,XI,QI,ZI,JI]),eT=t.string().min(1).max(512).refine(e=>nd(e)&&!/^[A-Za-z]:\//.test(e),{message:"Generated-code rescue paths must be safe relative POSIX paths without traversal."}),tT=t.array(eT).min(1).max(64),nT=t.array(t.string().min(1).max(120)).min(1).max(64),iT=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:V,at:t.string().min(1)}),t.object({type:t.literal("message.delta"),text:t.string().min(1),history_purpose:WI.optional(),at:t.string().min(1)}),t.object({type:t.literal("user.message"),client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(gs).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:vi.optional(),at:t.string().min(1)}),t.object({type:t.literal("plan.updated"),steps:t.array(KI),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(bp).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:Lp,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:Te,sitemap:bn,...Mp,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("sitemap.updated"),sitemap_id:Te,version:t.number().int().positive(),reason:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.failed"),error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.warning"),code:t.string().min(1),message:t.string().min(1),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("block.changed"),block_id:t.string().min(1),change_type:t.enum(["add","update","delete","move"]),at:t.string().min(1)}),t.object({type:t.literal("tool.started"),tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("tool.finished"),tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:so.optional(),at:t.string().min(1)}),t.object({type:t.literal("workspace.plan.created"),plan_id:t.string().min(1),run_kind:fs,groups:t.array(Da),tasks:t.array(Oa),dependencies:t.array(Na),expected_outputs:t.array(Pe),diagnostics:Ca,summary:zp,at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.worker.updated"),group_id:t.string().min(1),phase:Pa,status:Vt,task_counts:Hp,target_paths:t.array(Pe),diagnostics:t.array(t.string().min(1)),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.task.updated"),task_id:t.string().min(1),group_id:t.string().min(1),status:Vt,target_path:Pe,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(va).optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.degraded"),reason:t.enum(["block_placeholder","form_placeholder","patch_protected_dropped","preview_health_degraded","preview_build_failed","design_plan_fallback","generated_code_rescue","cms_page_directory_degraded","form_prebuild_skipped","form_section_fallback","first_settings_sync_failed","component_omitted","page_omitted","shared_fallback"]),degraded_block_ids:t.array(t.string().min(1)).min(1).optional(),dropped_files:t.array(t.string().min(1)).min(1).optional(),degraded_file_paths:tT.optional(),degraded_page_ids:nT.optional(),snapshot_id:A.optional(),code:t.string().min(1).optional(),message:t.string().min(1).optional(),diagnostics:t.string().min(1).optional(),retryable:t.boolean().optional(),at:t.string().min(1)}).strict().superRefine((e,n)=>{let i=e.reason==="generated_code_rescue",s=e.reason==="page_omitted",o=e.reason==="shared_fallback";if(!i){if(e.degraded_file_paths!==void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"degraded_file_paths is only allowed for generated_code_rescue"}),e.degraded_page_ids!==void 0&&!s&&n.addIssue({code:"custom",path:["degraded_page_ids"],message:"degraded_page_ids is only allowed for generated_code_rescue or page_omitted"}),o)for(let a of["degraded_block_ids","dropped_files","snapshot_id","code","diagnostics","retryable"])e[a]!==void 0&&n.addIssue({code:"custom",path:[a],message:`${a} is not allowed for shared_fallback`});return}e.degraded_file_paths===void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"generated_code_rescue requires degraded_file_paths"});for(let a of["degraded_block_ids","dropped_files","snapshot_id","code","message","diagnostics","retryable"])e[a]!==void 0&&n.addIssue({code:"custom",path:[a],message:`${a} is not allowed for generated_code_rescue`})}),t.object({type:t.literal("workspace.design_plan.outcome"),design_plan_outcome:GI,reason:qI,gate_diagnostics:t.object({gate:t.enum(["quality","schema"]),issue_codes:t.array(t.string().min(1)).max(20),issue_paths:t.array(t.string()).max(20),finish_reason:t.string().min(1).optional()}).strict().optional(),media_floor:t.object({total_blocks:t.number().int().min(0),media_bearing_blocks:t.number().int().min(0),hero_total:t.number().int().min(0),hero_media_bearing:t.number().int().min(0),pages_without_media:t.array(t.string().min(1)).max(50),met:t.boolean()}).strict().optional(),at:t.string().min(1)}).strict(),Kp.extend({type:t.literal("workspace.suggestions"),at:t.string().min(1)}).strict(),tr,t.object({type:t.literal("file.changed"),path:t.string().min(1),change_type:t.enum(["create","update","delete"]),diff:t.string().optional(),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:A,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("snapshot.finalized"),snapshot_id:A,at:t.string().min(1)}),t.object({type:t.literal("preview.preparing"),at:t.string().min(1)}),t.object({type:t.literal("preview.ready"),url:t.string().url(),at:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({type:t.literal("preview.build.started"),snapshot_id:A,at:t.string().min(1)}),t.object({type:t.literal("preview.build.succeeded"),snapshot_id:A,at:t.string().min(1)}),t.object({type:t.literal("preview.build.failed"),snapshot_id:A,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:yp.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:A.optional(),degraded_reason:Rn.optional(),build_verified:t.boolean().optional(),generation_ledger:kn.optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().datetime()}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().datetime()}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("activity.started"),activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:wp,title:t.string().min(1).max(200),detail:t.string().max(360).optional(),title_code:Nt.optional(),detail_code:Nt.optional(),locks_input:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("activity.updated"),activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),detail:t.string().max(360).optional(),title_code:Nt.optional(),detail_code:Nt.optional(),at:t.string().min(1)}),t.object({type:t.literal("activity.finished"),activity_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("activity.failed"),activity_id:t.string().min(1),detail:t.string().max(360).optional(),at:t.string().min(1)})]),Vp=iT.superRefine(Up).superRefine((e,n)=>{if(e.type==="user.message"&&e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type!=="tool.finished")return;let i=e.name==="prepare_product_search_entry";i!==!!e.interaction_request&&n.addIssue({code:"custom",path:["interaction_request"],message:i?"prepare_product_search_entry requires interaction_request":"interaction_request is only valid for prepare_product_search_entry"})}),Sa=t.object({id:Ma,tenant_id:t.string().min(1),site_id:k,agent_run_id:V,sequence:t.number().int().positive(),event_type:Bp,payload:Vp,created_at:t.string().min(1),thread_id:tt.nullable().optional()}),CG=t.object({event_type:Bp,payload:Vp}).superRefine((e,n)=>{e.event_type!==e.payload.type&&n.addIssue({code:"custom",path:["payload","type"],message:"payload.type must match event_type"}),oi(e.payload)&&n.addIssue({code:"custom",path:["payload"],message:"AgentEvent payload must not contain secrets"})}),DG=t.discriminatedUnion("status",[t.object({status:t.literal("appended"),agent_run:et,event:Sa,next_cursor:t.number().int().nonnegative()}),t.object({status:t.literal("duplicate_ignored"),agent_run:et,event:Sa,next_cursor:t.number().int().nonnegative()})]),OG=t.object({events:t.array(Sa),next_cursor:t.number().int().nonnegative().optional()}),NG=t.object({after_sequence:t.coerce.number().int().nonnegative().default(0)}),jG=t.object({run_id:V.optional(),thread_id:tt.optional()}).superRefine((e,n)=>{e.run_id&&e.thread_id&&n.addIssue({code:"custom",path:["thread_id"],message:"run_id and thread_id are mutually exclusive"})}),LG=t.enum(["implemented","skeleton","planned"]),MG=t.enum(["GET","POST","PUT","PATCH","DELETE"]),UG=[{method:"PATCH",path:"/internal/sites/:site_id/snapshots/:snapshot_id/manifest",tag:"snapshots",summary:"Compare-and-set the manifest hash for the active current snapshot after an in-place object replacement.",status:"implemented",request_body_schema:"UpdateCurrentSnapshotManifestRequestSchema",response_schema:"SnapshotRecordSchema",notes:["Internal Agent authentication is required. The update succeeds only when site current_snapshot_id, snapshot status, object key, and expected manifest hash still match."]},{method:"GET",path:"/health",tag:"system",summary:"API health check.",status:"implemented",response_schema:"ApiHealth"},{method:"POST",path:"/sites",tag:"sites",summary:"Create a site and Step 1 brief in the current dev context.",status:"implemented",request_body_schema:"CreateSiteBriefRequestSchema",response_schema:"CreateSiteBriefResponseSchema"},{method:"POST",path:"/sites/drafts",tag:"sites",summary:"Create a draft site without a brief in the current tenant so /s/:site_id can collect Step 1 later.",status:"implemented",request_body_schema:"CreateSiteDraftRequestSchema",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites",tag:"sites",summary:"List current tenant sites.",status:"implemented",response_schema:"SiteRecordSchema[]"},{method:"GET",path:"/sites/by-cms/:cms_site_id",tag:"sites",summary:"Resolve an external CMS site id to one tenant-scoped VCP site.",status:"implemented",response_schema:"SiteRecordSchema",notes:["Used by the browser /d/:cms_site_id handoff route; lookup is scoped by current request tenant and returns 404 when the CMS site has not been synchronized."]},{method:"GET",path:"/sites/:site_id",tag:"sites",summary:"Get one tenant-scoped site.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"POST",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Create one version-bound site workflow from a published flow definition.",status:"implemented",request_body_schema:"CreateSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Read the current site workflow snapshot and derived menu state.",status:"implemented",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/workflow/progress",tag:"site-workflows",summary:"Read the minimal internal site workflow progress projection.",status:"implemented",response_schema:"SiteWorkflowProgressResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/website",tag:"site-workflows",summary:"Update the source website while website_scan is current.",status:"implemented",request_body_schema:"UpdateSiteWorkflowWebsiteRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/advance",tag:"site-workflows",summary:"Advance one non-terminal workflow node with an expected-current-node guard.",status:"implemented",request_body_schema:"AdvanceSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/complete",tag:"site-workflows",summary:"Complete the workflow from its final publishing node after server-side release checks pass.",status:"implemented",request_body_schema:"CompleteSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The browser supplies only the expected current node; the server verifies persisted release facts before completing the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/complete-quality-only",tag:"site-workflows",summary:"Complete the designer workflow after the linked quality-only publish workflow succeeds.",status:"implemented",request_body_schema:"CompleteQualityOnlyWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The server resolves the designer role and atomically completes both workflows without creating a publish deployment or updating the site deployment projection."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/register",tag:"site-workflows",summary:"Register a business-owned external task id and its idempotency key.",status:"implemented",request_body_schema:"RegisterWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/step2-site-initialization/tasks",tag:"site-workflows/step2-site-initialization",summary:"Create or reuse the current workflow's Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The server derives tenantId, sessionId, and siteUrl from trusted request/workflow state; the browser cannot submit upstream scope fields."]},{method:"GET",path:"/sites/:site_id/workflow/step2-site-initialization/tasks/:task_id",tag:"site-workflows/step2-site-initialization",summary:"Poll the workflow-owned Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The task id must match the current non-superseded website_crawl task reference for the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/:task_type/replace",tag:"site-workflows",summary:"Replace one task reference while retaining its superseded history.",status:"implemented",request_body_schema:"ReplaceWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/tasks/website_crawl/replace-and-invalidate-dependents",tag:"site-workflows",summary:"Replace website crawl and invalidate basic-info and metrics dependents atomically.",status:"implemented",request_body_schema:"ReplaceCrawlWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/build",tag:"site-workflows",summary:"Start the server-owned site build and workspace snapshot lifecycle.",status:"implemented",request_body_schema:"StartSiteBuildRequestSchema",response_schema:"StartSiteBuildResponseSchema",notes:["The browser may start or query the build, but cannot write site build or deployment summary status directly."]},{method:"GET",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Read the persisted no-website customer materials draft.",status:"implemented",response_schema:"CustomerMaterialsNullableResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Save the no-website customer materials before submission.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["A submitted record is immutable and rejects later writes."]},{method:"POST",path:"/sites/:site_id/workflow/customer-materials/submit",tag:"site-workflows",summary:"Submit and freeze customer materials before analysis.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["Repeated submissions return 409; clients may retry only the separate workflow advance."]},{method:"GET",path:"/sites/:site_id/designer/component-library/categories",tag:"designer-component-library",summary:"List the fixed insert-new-component category tree for a site.",status:"implemented",response_schema:"ListDesignerComponentCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewComponent."]},{method:"GET",path:"/sites/:site_id/designer/component-library/resources",tag:"designer-component-library",summary:"List component resources from the fixed designer catalog group.",status:"implemented",query_schema:"ListDesignerComponentsQuerySchema",response_schema:"ListDesignerComponentsResponseSchema",notes:["The server fixes resource type to component and does not expose resource-platform secrets, internal hosts, or product-line selection."]},{method:"POST",path:"/sites/:site_id/designer/component-library/resources/:resource_id/install",tag:"designer-component-library",summary:"Install one exact component version and return a strict SiteEditEngine materialization.",status:"implemented",request_body_schema:"InstallDesignerComponentBodySchema",response_schema:"InstallDesignerComponentResponseSchema",notes:["The server downloads the resource ZIP with the configured secret, validates main.json identity and compatibility, and returns only the strict materialization plus immutable revision metadata."]},{method:"GET",path:"/sites/:site_id/designer/page-library/categories",tag:"designer-page-library",summary:"List the fixed insert-new-page category tree for a site.",status:"implemented",response_schema:"ListDesignerPageCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewPage."]},{method:"GET",path:"/sites/:site_id/designer/page-library/resources",tag:"designer-page-library",summary:"List page and pages resources from the fixed designer catalog.",status:"implemented",query_schema:"ListDesignerPagesQuerySchema",response_schema:"ListDesignerPagesResponseSchema",notes:["The server fixes resource types to page and pages and does not expose resource-platform credentials or internal routing."]},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/prepare",tag:"designer-page-library",summary:"Resolve one exact page resource version for designer-side draft configuration.",status:"implemented",request_body_schema:"PrepareDesignerPageBodySchema",response_schema:"PrepareDesignerPageResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/install",tag:"designer-page-library",summary:"Install one exact page resource version and return a strict PageResourceArtifact.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server validates the explicit resource type, immutable package identity, page selections, materializations, and package-local references."]},{method:"GET",path:"/sites/:site_id/designer/pages",tag:"designer-page-library",summary:"List designer pages from the stable first-phase fixture source.",status:"implemented",response_schema:"ListDesignerSitePagesResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/enhance",tag:"designer-page-library",summary:"Echo a designer page-resource candidate without model execution or normalization.",status:"implemented",request_body_schema:"EnhanceDesignerPageResourceBodySchema",response_schema:"EnhanceDesignerPageResourceResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/compose",tag:"designer-page-library",summary:"Compose exact page and component resources into one strict page artifact.",status:"implemented",request_body_schema:"ComposeDesignerPageResourceBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server installs every immutable source, validates ordered page blocks, scopes component materializations, and returns one artifact without exposing resource-platform credentials."]},{method:"POST",path:"/sites/:site_id/designer/page-resources/blank",tag:"designer-page-library",summary:"Create the deterministic built-in blank page artifact for one configured route.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema"},{method:"PATCH",path:"/sites/:site_id",tag:"sites",summary:"Update site display name and optional generated-site locale for the current tenant.",status:"implemented",request_body_schema:"UpdateSiteRequestSchema",response_schema:"SiteRecordSchema"},{method:"DELETE",path:"/sites/:site_id",tag:"sites",summary:"Archive a site so it no longer appears in the tenant site list.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites/:site_id/workspace/source-files",tag:"sites",summary:"List source files available in the ready preview sandbox.",status:"implemented",response_schema:"WorkspaceSourceFileListItemSchema[]"},{method:"GET",path:"/sites/:site_id/workspace/source-file",tag:"sites",summary:"Read a source file from the ready preview sandbox.",status:"implemented",query_schema:"WorkspaceSourceFilePathQuerySchema",response_schema:"WorkspaceSourceFileResponseSchema"},{method:"GET",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"List or search enterprise image assets through the CMS adapter.",status:"implemented",query_schema:"ListMediaLibraryAssetsQuerySchema",response_schema:"ListMediaLibraryAssetsResponseSchema"},{method:"POST",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"Upload one validated image and create its enterprise asset.",status:"implemented",response_schema:"UploadMediaLibraryAssetResponseSchema",notes:["Accepts one multipart field named file; only the image MIME allowlist is accepted and the maximum size is 20 MiB."]},{method:"GET",path:"/sites/:site_id/media-assets/unsplash/search",tag:"media-assets",summary:"Search Unsplash through the VCP server-side client.",status:"implemented",query_schema:"SearchUnsplashMediaQuerySchema",response_schema:"SearchUnsplashMediaResponseSchema",notes:["The browser never receives the Unsplash access key; CMS is not involved in search."]},{method:"POST",path:"/sites/:site_id/media-assets/unsplash/:provider_id/use",tag:"media-assets",summary:"Best-effort report that an Unsplash image was selected.",status:"implemented",request_body_schema:"UseUnsplashMediaRequestSchema",response_schema:"UseUnsplashMediaResponseSchema",notes:["CMS report failure returns reported=false and does not roll back the image replacement."]},{method:"POST",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Confirm the currently reviewed Sitemap Draft and advance the site to structure_saved.",status:"implemented",request_body_schema:"ConfirmSiteStructureRequestSchema",response_schema:"PersistSiteSitemapDraftResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/sitemap-draft",tag:"sitemaps",summary:"Persist an agent-generated sitemap draft without confirming the structure.",status:"implemented",request_body_schema:"PersistGeneratedSitemapDraftRequestSchema",response_schema:"PersistGeneratedSitemapDraftResponseSchema"},{method:"PUT",path:"/sites/:site_id/sitemap/draft",tag:"sitemaps",summary:"Save an immutable user draft without confirming or advancing the workflow.",status:"implemented",request_body_schema:"SaveSiteSitemapDraftRequestSchema",response_schema:"SaveSiteSitemapDraftResponseSchema"},{method:"GET",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Read the current Sitemap Draft for a site.",status:"implemented",response_schema:"SitemapDraftRecordSchema"},{method:"POST",path:"/sites/:site_id/clarify/answers",tag:"clarify",summary:"Persist the Step 2 clarify answers (and the answered questions) into the site's clarify session.",status:"implemented",request_body_schema:"PersistClarifyAnswersRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema"},{method:"PATCH",path:"/sites/:site_id/clarify/archetype",tag:"clarify",summary:"Switch the Step 2 industry archetype (user_picked) into the site's clarify session via an idempotent upsert.",status:"implemented",request_body_schema:"UpdateClarifyArchetypeRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema",notes:["Independent of generate: materializes a clarify_sessions row when none exists (using the supplied questions) or updates only selected_archetype; never writes answers/completed_at. Forces source=user_picked."]},{method:"POST",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Persist a generated design plan version for a site (internal agent-only write).",status:"implemented",request_body_schema:"PersistSiteDesignPlanRequestSchema",response_schema:"PersistSiteDesignPlanResponseSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent writes design plans."]},{method:"GET",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site (internal agent-only read).",status:"implemented",response_schema:"DesignPlanRecordSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent reads design plans."]},{method:"GET",path:"/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site so Workspace UI can inspect the generated design contract.",status:"implemented",response_schema:"DesignPlanRecordSchema"},{method:"GET",path:"/sites/:site_id/brief",tag:"briefs",summary:"Read the persisted Step 1 brief for a site so the Workspace Agent can seed first full-site generation without a new write surface.",status:"implemented",response_schema:"BriefRecordSchema"},{method:"PUT",path:"/sites/:site_id/brief/draft",tag:"briefs",summary:"Save a draft site's Step 1 brief without advancing the workflow.",status:"implemented",request_body_schema:"SaveBriefDraftRequestSchema",response_schema:"SaveBriefDraftResponseSchema",notes:["Only sites in the editable build phase are writable; the brief row is upserted idempotently while site status, locale, and workflow stage remain unchanged."]},{method:"PATCH",path:"/sites/:site_id/brief",tag:"briefs",summary:"Create or update a draft site's Step 1 brief and advance it to Clarify without allowing later workflow states to roll back.",status:"implemented",request_body_schema:"UpdateBriefRequestSchema",response_schema:"UpdateBriefResponseSchema",notes:["Only sites in the editable build phase are writable; missing brief rows are created on first save; identical retries are idempotent."]},{method:"POST",path:"/internal/sites/:cms_site_id/external-sync",tag:"sites",summary:"Synchronize trusted CMS identity by tenant_id + cms_site_id; legacy site_url is optional and ignored. The response URL is the configured public API base or null.",status:"implemented",request_body_schema:"ExternalSyncSiteRequestSchema",response_schema:"ExternalSyncSiteResponseSchema",notes:["This trusted external entry does not require browser login or internal bearer auth; tenant_id is written directly to tenants.id and the response uses the internal { code, data, message } success envelope."]},{method:"POST",path:"/internal/sites/:site_id/page-templates",tag:"page-templates",summary:"Accept 1\u20133 Page Template items as one asynchronous Workspace task (HTTP 202).",status:"implemented",request_body_schema:"PageTemplateCreateRequestSchema",response_schema:"PageTemplateCreateResponseSchema",notes:["Internal bearer plus tenant context; API starts one new background thread/run with its fixed system identity. Poll GET /internal/external-site-edits/:task_id; no external IDs or callbacks. Manifest-gated whole-batch success commits exactly one snapshot."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/promote",tag:"page-templates",summary:"Promote a private page template through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplatePromoteRequestSchema",response_schema:"PageTemplatePromoteResponseSchema",notes:["Internal service endpoint; uses the same bearer + tenant/user context as create and delegates to Agent with API-owned credentials."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/cleanup",tag:"page-templates",summary:"Clean up private page templates through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplateCleanupRequestSchema",response_schema:"PageTemplateCleanupResponseSchema",notes:["Internal service endpoint; cleanup remains explicit and default-template protection is enforced by the Agent lifecycle service."]},{method:"POST",path:"/sites/:site_id/snapshots",tag:"snapshots",summary:"Persist snapshot metadata without changing the current site snapshot.",status:"implemented",request_body_schema:"PersistSiteSnapshotRequestSchema",response_schema:"PersistSiteSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"Promote a site snapshot as the current workspace version.",status:"implemented",request_body_schema:"PromoteSiteSnapshotRequestSchema",response_schema:"PromoteSiteSnapshotResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/try-acquire",tag:"snapshots",summary:"Try to acquire the short-lived template-upgrade site lock.",status:"implemented",request_body_schema:"TryAcquireTemplateUpgradeLockRequestSchema",response_schema:"TryAcquireTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; lock contention returns acquired=false instead of a user-facing conflict."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/release",tag:"snapshots",summary:"Release the calling template-upgrade attempt's site lock.",status:"implemented",request_body_schema:"ReleaseTemplateUpgradeLockRequestSchema",response_schema:"ReleaseTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; release is scoped by tenant, site, operation type, and owner."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"CAS-promote a validated template-upgrade candidate and bind its accepted commit atomically.",status:"implemented",request_body_schema:"PromoteTemplateUpgradeSnapshotRequestSchema",response_schema:"PromoteTemplateUpgradeSnapshotResponseSchema",notes:["Internal agent-only endpoint; accepted_commit is never part of the public promote request or response."]},{method:"GET",path:"/internal/sites/:site_id/template-upgrade/state",tag:"snapshots",summary:"Inspect the projected tenant-scoped template-upgrade state without mutation.",status:"implemented",query_schema:"InspectTemplateUpgradeStateRequestSchema",response_schema:"InspectTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the repository path is read-only."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/prepare",tag:"snapshots",summary:"Prepare the tenant-scoped template-upgrade retry state for a target version.",status:"implemented",request_body_schema:"PrepareTemplateUpgradeStateRequestSchema",response_schema:"PrepareTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/failure",tag:"snapshots",summary:"Record a finite validation failure for the prepared template-upgrade target.",status:"implemented",request_body_schema:"RecordTemplateUpgradeFailureRequestSchema",response_schema:"RecordTemplateUpgradeFailureResponseSchema",notes:["Internal agent-only endpoint; accepts a finite error code and never raw validation output."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/success",tag:"snapshots",summary:"Reset retry state after the prepared template-upgrade target succeeds.",status:"implemented",request_body_schema:"RecordTemplateUpgradeSuccessRequestSchema",response_schema:"RecordTemplateUpgradeSuccessResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/events",tag:"snapshots",summary:"Record one bounded template-upgrade observability event.",status:"implemented",request_body_schema:"RecordTemplateUpgradeEventRequestSchema",response_schema:"RecordTemplateUpgradeEventResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the strict request excludes raw errors, source content, and file paths."]},{method:"GET",path:"/internal/template-upgrades/report",tag:"snapshots",summary:"Read tenant-scoped template-upgrade outcome, state, and duration aggregates.",status:"implemented",query_schema:"GetTemplateUpgradeReportQuerySchema",response_schema:"GetTemplateUpgradeReportResponseSchema",notes:["Internal endpoint; tenant identity is derived from trusted request context and all aggregates are tenant-scoped."]},{method:"GET",path:"/internal/template-upgrades/snapshot-deletions/pending",tag:"snapshots",summary:"List tenant-scoped stale template-upgrade snapshot deletions for dry-run or reconciliation.",status:"implemented",query_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema",response_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema",notes:["Defaults to retrying deleting tombstones. Including candidate snapshots is an explicit maintenance action and should use a conservative age threshold."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/abandon",tag:"snapshots",summary:"Mark an unpromoted candidate snapshot as failed.",status:"implemented",response_schema:"AbandonSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Read one tenant-scoped snapshot metadata record for a site.",status:"implemented",response_schema:"SnapshotRecordSchema"},{method:"DELETE",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Prepare two-phase deletion of a candidate snapshot and return its object key; refuses non-candidate/current/referenced snapshots.",status:"implemented",response_schema:"DeleteSiteSnapshotResponseSchema",notes:["Internal Agent authentication is required. This endpoint only creates a deleting tombstone; object removal and completion are separate steps."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/deletion/complete",tag:"snapshots",summary:"Complete deletion after the snapshot object has been removed; only accepts deleting snapshots.",status:"implemented",response_schema:"CompleteSiteSnapshotDeletionResponseSchema",notes:["Internal Agent authentication is required; callers must remove the object before completing the DB deletion."]},{method:"POST",path:"/agent-runs",tag:"agent-runs",summary:"Create an agent run for event persistence and replay.",status:"implemented",request_body_schema:"CreateAgentRunRequestSchema",response_schema:"CreateAgentRunResponseSchema"},{method:"POST",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Append one normalized AgentEvent to a run.",status:"implemented",request_body_schema:"AppendAgentEventRequestSchema",response_schema:"AppendAgentEventResponseSchema",notes:["Internal-only write surface: only internal-service callers may append, except browser (oidc) contexts may append run.failed (the WS connect-stage unlock path, equivalent to POST /agent-runs/workspace/cancel). All other oidc appends \u2014 run.finished, run.started, tool/system/progress, file/snapshot \u2014 are rejected with 403 FORBIDDEN. The browser sends user messages over the Workspace WebSocket (recorded server-side as user.message) and otherwise only reads the GET replay."]},{method:"GET",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Replay AgentEvents after a run-local sequence cursor.",status:"implemented",response_schema:"ListAgentEventsResponseSchema"},{method:"POST",path:"/agent-runs/workspace/stop",tag:"agent-runs",summary:"Request a soft stop of the active first-generation or fill-in run for a site.",status:"implemented",request_body_schema:"StopWorkspaceGenerationRequestSchema",response_schema:"StopWorkspaceGenerationResponseSchema",notes:["Browser surface with the same tenant scoping as POST /agent-runs/workspace/cancel: only the active initial_generation / fill_in run of a site in the caller's tenant is touched.","A run holding a live lease gets stop_requested_at instead of a terminal event, so it keeps the pages it already saved and closes itself: status=requested, or already_requested on a repeat (the first stop timestamp is never moved).","A run whose lease has lapsed has no process left to honour the flag, so it is closed immediately (run.failed, site lock released) and the answer is status=stopped. Nothing in flight returns no_active_run with run_id null."]},{method:"POST",path:"/internal/agent-runs/fail-stale-in-flight",tag:"agent-runs",summary:"Fail stale in-flight workspace runs (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"FailStaleInFlightWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard (Bearer VCP_AGENT_INTERNAL_TOKEN, production fail-closed); the /internal/** prefix is exempt from browser auth middleware so the guard is the sole trust boundary. Not exposed to the browser via agent-proxy; called by an external admin cron / controlled ops script."]},{method:"POST",path:"/internal/agent-runs/claim-stale-workspace-runs",tag:"agent-runs",summary:"Claim stale workspace runs for resumption (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"ClaimStaleWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard; same trust boundary as fail-stale-in-flight and not exposed to the browser.","Re-issues a fresh lease_owner (fencing token) and increments resume_count in one UPDATE for each resumable initial run; a lease expiring only means the work was interrupted, not that the run failed. Initial runs that used up WORKSPACE_MAX_RESUME_COUNT and interrupted fill-in runs are failed instead and are absent from the response."]},{method:"GET",path:"/internal/agent-runs/:run_id/context",tag:"agent-runs",summary:"Resolve run thread context (internal, Agent Runtime).",status:"implemented",response_schema:"AgentRunContextResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","Returns the run together with its thread (null = the site main thread); a run outside the tenant is 404."]},{method:"POST",path:"/internal/agent-runs/:run_id/heartbeat",tag:"agent-runs",summary:"Renew a workspace run lease (internal, Agent Runtime).",status:"implemented",request_body_schema:"WorkspaceRunHeartbeatRequestSchema",response_schema:"WorkspaceRunHeartbeatResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","One CAS UPDATE checks that the run is still in flight and that lease_owner has not been re-issued: superseded means another attempt took over and this process must stop dispatching; not_active means the run already reached a terminal state."]},{method:"POST",path:"/internal/agent-runs/:run_id/page-checkpoints",tag:"agent-runs",summary:"Register a workspace page checkpoint (internal, Agent Runtime).",status:"implemented",request_body_schema:"RegisterWorkspacePageCheckpointRequestSchema",response_schema:"WorkspacePageCheckpointSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","Idempotent on (tenant_id, run_id, page_id, attempt): a conflict returns the existing row unchanged. The object must already be written to storage \u2014 a failed registration means the page was not saved. A lease_owner that no longer matches the run is 409, and a run in a terminal state is 409."]},{method:"GET",path:"/internal/agent-runs/:run_id/page-checkpoints",tag:"agent-runs",summary:"List workspace page checkpoints (internal, Agent Runtime).",status:"implemented",response_schema:"ListWorkspacePageCheckpointsResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; returns one row per page_id (the highest attempt). A run outside the tenant returns no checkpoints."]},{method:"GET",path:"/internal/agent-runs/:run_id/run-control",tag:"agent-runs",summary:"Read workspace run control input (internal, Agent Runtime).",status:"implemented",response_schema:"WorkspaceRunControlInputResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; AgentRunRecord carries no input, so the lease owner, stop flag, resume count and fill-in inputs stored on the run row are read here. A run outside the tenant, or one that is not a workspace run, is 404."]},{method:"GET",path:"/deployments",tag:"deployments",summary:"Deployment resource summary endpoint until publish APIs land.",status:"skeleton"},{method:"GET",path:"/sites/:site_id/generation-ledger",tag:"sites",summary:"Read the stored generation ledger of a site (omitted deliverables and fill-in progress).",status:"implemented",response_schema:"SiteGenerationLedgerResponseSchema",notes:["One ledger per (tenant_id, site_id), written when an initial_generation / fill_in run.finished carries generation_ledger. A site that has never finished such a run returns ledger null with source_run_id and updated_at null."]},{method:"POST",path:"/sites/:site_id/generation/fill-in",tag:"sites",summary:"Start a fill-in run for deliverables the generation ledger still lists as omitted.",status:"implemented",request_body_schema:"StartFillInRequestSchema",response_schema:"StartFillInResponseSchema",notes:["Every target must still be listed as an unfilled omission in the site ledger; otherwise 400 FILL_IN_TARGET_NOT_OMITTED with details.target_id. A site with no ledger at all is rejected with the same code.","The site must be workspace_ready; otherwise 409 FILL_IN_NOT_AVAILABLE.","A fill-in run does not take the per-site workspace_run operation lock: while it runs the user keeps browsing. client_run_key makes the POST idempotent \u2014 repeating it returns the existing in-flight run and does not dispatch it again; another in-flight workspace run on the same site is rejected with 409 WORKSPACE_RUN_IN_FLIGHT."]},{method:"POST",path:"/sites/:site_id/workspace/runs",tag:"workspace",summary:"Start an asynchronous Workspace Agent run from the current snapshot.",status:"implemented",request_body_schema:"StartWorkspaceRunRequestSchema",response_schema:"StartWorkspaceRunResponseSchema",notes:["Long-running work must be event-driven and must not block API transactions."]},{method:"POST",path:"/sites/:site_id/workspace/attachments",tag:"workspace",summary:"Upload a chat image attachment for the Workspace conversation.",status:"implemented",response_schema:"WorkspaceAttachmentSchema",notes:["multipart/form-data with a single `file`; the response `image_url` is referenced by a `file` part of the next client message."]},{method:"POST",path:"/sites/:site_id/workspace/attachments/from-url",tag:"workspace",summary:"Capture a screenshot of a web page and store it as a chat image attachment.",status:"implemented",request_body_schema:"WorkspaceAttachmentFromUrlRequestSchema",response_schema:"WorkspaceAttachmentSchema",notes:["The screenshot becomes an ordinary attachment: same quotas, same `file` part reference, never placed on the site.","Capture runs through the ingestion service (SSRF guard, concurrency gate, Firecrawl credits)."]},{method:"GET",path:"/sites/:site_id/workspace/attachments/:attachment_id/image",tag:"workspace",summary:"Read the bytes of a chat image attachment (owner thumbnails and replay).",status:"implemented"},{method:"DELETE",path:"/sites/:site_id/workspace/attachments/:attachment_id",tag:"workspace",summary:"Delete an unsent chat image attachment.",status:"implemented",notes:["Attachments already sent with a message return 409 WORKSPACE_ATTACHMENT_BOUND."]},{method:"GET",path:"/internal/workspace-attachments/:site_id/:attachment_id",tag:"workspace",summary:"Internal side-channel for the Workspace Agent to read a chat image attachment.",status:"implemented"},{method:"GET",path:"/sites/:site_id/threads",tag:"workspace",summary:"List a site's named Agent threads (workspace conversations).",status:"implemented",response_schema:"SiteThreadListResponseSchema",notes:["The browser can only list threads that belong to the current site."]},{method:"POST",path:"/sites/:site_id/threads",tag:"workspace",summary:"Create a new named Agent thread for a site.",status:"implemented",request_body_schema:"CreateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The created thread is scoped to the current site; the browser cannot create a thread for another site."]},{method:"PATCH",path:"/sites/:site_id/threads/:thread_id",tag:"workspace",summary:"Rename or archive an Agent thread.",status:"implemented",request_body_schema:"UpdateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The server verifies the thread belongs to the current site and tenant before applying the update."]},{method:"GET",path:"/sites/:site_id/workspace/runs/active",tag:"workspace",summary:"Look up the site's current in-flight Workspace Agent run across all threads.",status:"implemented",response_schema:"ActiveWorkspaceRunResponseSchema",notes:["Scoped to the current site regardless of thread; the browser cannot query another site's active run."]},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations",tag:"agent/workspace",summary:"Create or replay a deterministic FORM_SPEC save operation.",status:"implemented",request_body_schema:"FormDesignSaveRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id",tag:"agent/workspace",summary:"Read a persisted FORM_SPEC save operation.",status:"implemented",response_schema:"FormDesignOperationResponseSchema"},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id/resume",tag:"agent/workspace",summary:"Resume a recoverable FORM_SPEC save with its original fingerprint.",status:"implemented",request_body_schema:"FormDesignResumeRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/sites/:site_id/workspace/runs/latest",tag:"workspace",summary:"Look up the latest workspace Agent run for a site so Step 4 re-entry can replay persisted events without re-triggering the model.",status:"implemented",response_schema:"LatestWorkspaceRunResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/preview-sessions",tag:"sandbox-sessions",summary:"Persist or update an Agent-owned on-demand preview session; optional current/ready-session guards support current-snapshot CAS and guarded in-place snapshot advance.",status:"implemented",request_body_schema:"PersistPreviewSessionRequestSchema",response_schema:"PersistPreviewSessionResponseSchema"},{method:"GET",path:"/sites/:site_id/preview-sessions/current",tag:"sandbox-sessions",summary:"Read the latest tenant-scoped preview session for a site.",status:"implemented",response_schema:"SandboxSessionSchema"},{method:"POST",path:"/sites/:site_id/preview/activate",tag:"site-preview",summary:"Activate the existing preview sandbox for a site.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/v1/agent/site-preview/:site_id/activate",tag:"agent/site-preview",summary:"Activate the existing preview sandbox for a site through Agent.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/sites/:site_id/deployments",tag:"deployments",summary:"Queue an explicit user-confirmed publish from the latest current snapshot.",status:"implemented",request_body_schema:"CreateDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema",notes:["The server resolves the latest current snapshot and validates site and snapshot existence, in-flight deployment state, and site operation lock before creating the deployment record and queue job.","The API returns after creating the deployment record and queue job; worker-service claims deployment_jobs for build and Cloudflare publish."]},{method:"POST",path:"/sites/:site_id/deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment from a snapshot.",status:"implemented",request_body_schema:"CreateQualityCheckDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/quality-check/status",tag:"deployments",summary:"Read the latest quality-check deployment status.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"POST",path:"/internal/site-deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/quality-check/status",tag:"deployments",summary:"Read the latest internal quality-check deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"POST",path:"/internal/site-deployments/publish",tag:"deployments",summary:"Queue a publish deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the latest current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/publish/status",tag:"deployments",summary:"Read the latest internal publish deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"GET",path:"/sites/:site_id/deployments/current",tag:"deployments",summary:"Read the latest deployment for workspace refresh recovery.",status:"implemented",response_schema:"CurrentDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/status",tag:"deployments",summary:"Read current in-flight deployment and latest released deployment.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/:deployment_id",tag:"deployments",summary:"Read one tenant-scoped deployment for status polling.",status:"implemented",response_schema:"GetDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"List CMS collections for a site.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"Create a CMS collection bound to generated content.",status:"planned"},{method:"GET",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"List CMS entries for a collection.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"Create a CMS entry.",status:"planned"},{method:"PATCH",path:"/sites/:site_id/cms/collections/:collection_id/entries/:entry_id",tag:"cms",summary:"Update a CMS entry.",status:"planned"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/version-record",tag:"versions",summary:"Record the sandbox accepted git commit for a promoted snapshot version.",status:"implemented",request_body_schema:"RecordSnapshotVersionRequestSchema",response_schema:"RecordSnapshotVersionResponseSchema"},{method:"GET",path:"/sites/:site_id/versions",tag:"versions",summary:"List snapshot-backed site versions.",status:"implemented",response_schema:"ListSiteVersionsResponseSchema"},{method:"POST",path:"/sites/:site_id/versions/:snapshot_id/restore",tag:"versions",summary:"Restore a site to an earlier snapshot version.",status:"implemented",response_schema:"RestoreSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/domains/configuration",tag:"custom-domains",summary:"Read the authoritative site domain configuration.",status:"implemented",response_schema:"GetSiteDomainConfigurationResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/active-domain",tag:"internal/active-domain",summary:"Read whether an internal site has an active primary domain.",status:"implemented",response_schema:"GetActiveSiteDomainResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/check",tag:"publish-workflow",summary:"Check a publish workflow domain and start its operation.",status:"implemented",request_body_schema:"CheckSitePublishDomainRequestSchema",response_schema:"CheckSitePublishDomainResponseSchema"},{method:"GET",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation",tag:"publish-workflow",summary:"Read the current publish workflow domain operation.",status:"implemented",response_schema:"GetSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation/reconcile",tag:"publish-workflow",summary:"Recover or reconcile the current publish workflow domain operation.",status:"implemented",response_schema:"ReconcileSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/remediation/confirm",tag:"publish-workflow",summary:"Confirm the current DNS remediation plan.",status:"implemented",request_body_schema:"ConfirmSitePublishDomainRemediationRequestSchema",response_schema:"ConfirmSitePublishDomainRemediationResponseSchema"},{method:"POST",path:"/sites/:site_id/integrations/gsc/auth/start",tag:"gsc",summary:"Start Google Search Console authorization for a site.",status:"implemented",request_body_schema:"StartGscAuthRequestSchema",response_schema:"StartGscAuthResponseSchema"},{method:"GET",path:"/sites/:site_id/integrations/gsc/status",tag:"gsc",summary:"Read Google Search Console authorization and property status.",status:"implemented",response_schema:"GscStatusResponseSchema"},{method:"GET",path:"/admin/tenants",tag:"admin",summary:"Admin tenant listing.",status:"planned"},{method:"GET",path:"/usage/summary",tag:"usage",summary:"Summarize tenant usage and cost controls.",status:"planned"},{method:"GET",path:"/sites/:site_id/publish-workflow/active",tag:"publish-workflow",summary:"Read the active site publish workflow.",status:"implemented",response_schema:"SitePublishWorkflowActiveResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/start",tag:"publish-workflow",summary:"Start or recover the site publish workflow.",status:"implemented",request_body_schema:"StartSitePublishWorkflowRequestSchema",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/repair-task",tag:"publish-workflow",summary:"Idempotently create the publish repair task.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"GET",path:"/sites/:site_id/publish-workflow/:workflow_id",tag:"publish-workflow",summary:"Read and reconcile a site publish workflow quality task.",status:"implemented",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"PATCH",path:"/sites/:site_id/publish-workflow/:workflow_id/step",tag:"publish-workflow",summary:"Move the site publish workflow to an allowed step.",status:"implemented",request_body_schema:"UpdateSitePublishWorkflowStepRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/cancel",tag:"publish-workflow",summary:"Cancel a stable site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/publish",tag:"publish-workflow",summary:"Start formal publishing for a site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowPublishResponseSchema"}],FG=[{method:"POST",path:"/v1/agent/clarify/:site_id",tag:"clarify",summary:"Stream Step 2 clarify questions as SSE; event_order includes optional skill.selecting, skill.selected, clarify.archetype_proposals, and run.failed on errors.",status:"implemented",request_body_schema:"ClarifyRunInputSchema without tenant_id/site_id",event_schema:"ClarifyStreamEventSchema",event_order:["run.started","skill.selecting","skill.selected","clarify.partial","clarify.archetype_proposals","clarify.finished","run.failed"]},{method:"POST",path:"/v1/agent/sitemap/:site_id",tag:"sitemap",summary:"Stream Step 3 sitemap generation as SSE; event_order includes sitemap.partial and run.failed on errors.",status:"implemented",request_body_schema:"Step5SitemapStartRequestSchema (browser marker only; API injects committed Step5 strategy)",event_schema:"SitemapStreamEventSchema",event_order:["run.started","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","run.failed"]}],sT=t.object({id:t.string().min(1),role:t.enum(["system","user","assistant"]),metadata:t.unknown().optional(),parts:t.array(gs).min(1)}),$p=sT.extend({role:t.literal("user")}).superRefine((e,n)=>{let i=0;for(let[s,o]of e.parts.entries()){if(o.type!=="file")continue;i+=1;let a=o;ao.safeParse(a.mediaType).success||n.addIssue({code:"custom",path:["parts",s,"mediaType"],message:"Attachment mediaType must be image/png, image/jpeg or image/webp"}),(typeof a.url!="string"||ro(a.url)===null)&&n.addIssue({code:"custom",path:["parts",s,"url"],message:"Attachment url must be a workspace attachment image path"})}i>oo&&n.addIssue({code:"custom",path:["parts"],message:`A message may carry at most ${oo} attachments`})}),GG=t.object({base_snapshot_id:A.optional(),intent:t.literal("navigation_adaptation").optional(),message:$p.optional(),thread_id:tt.optional(),client_run_key:t.string().min(1).max(200).optional()}).superRefine((e,n)=>{oi(e.message)&&n.addIssue({code:"custom",path:["message"],message:"Workspace startup message must not contain secrets",params:{errorCode:"WORKSPACE_MESSAGE_CONTAINS_SECRET"}})}),oT=t.object({path:t.string().regex(/^\/v1\/workspace\/sites\/[^/]+\/socket$/),run_id:V,base_snapshot_id:A,run_kind:fs}),qG=t.object({agent_run:et,websocket:oT,next_step:t.literal("workspace_socket")}),WG=t.object({agent_run:et}),KG=t.object({thread_id:tt.optional()}),BG=t.object({agent_run:et.nullable(),thread:hs.nullable()}),zG=t.object({status:Ip.default("active")}),HG=t.object({threads:t.array(hs)}),VG=t.object({title:t.string().trim().min(1).max(200)}).strict(),$G=t.object({title:t.string().trim().min(1).max(200).optional(),status:t.literal("archived").optional()}).strict().refine(e=>e.title!==void 0||e.status!==void 0,{message:"title or status is required"}),YG=t.object({thread:hs}),XG=t.object({agent_type:t.enum(["clarify","sitemap","workspace"]),thread_id:tt.optional()}),QG=t.object({agent_run:et}),ZG=t.enum(["client.message.create","client.resource.operation.create","client.run.cancel","client.tool.approve","server.run.started","server.user.message","server.assistant.delta","server.tool.started","server.tool.completed","server.workspace.suggestions","workspace.plan.created","workspace.worker.updated","workspace.task.updated","server.patch.applied","server.sitemap.updated","server.snapshot.created","server.snapshot.finalized","server.preview.invalidated","preview.build.started","preview.build.succeeded","preview.build.failed","server.run.finished","server.run.failed","server.error","server.activity.started","server.activity.updated","server.activity.finished","server.activity.failed"]),pe=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:k,run_id:V.optional(),correlation_id:t.string().min(1).optional(),seq:t.number().int().positive().optional(),sent_at:t.string().min(1)}),aT=t.object({key:t.string().min(1),label:t.string().min(1),source_file:t.string().min(1).optional(),component_name:t.string().min(1).optional(),opening_element_range:t.object({start_line:t.number().int().positive(),start_column:t.number().int().nonnegative(),end_line:t.number().int().positive(),end_column:t.number().int().nonnegative()}).optional(),structural_path:t.string().min(1).optional(),text_preview:t.string().min(1).optional()}),rT=t.discriminatedUnion("type",[pe.extend({type:t.literal("client.message.create"),payload:t.object({client_message_id:t.string().min(1),in_reply_to_tool_call_id:t.string().min(1).optional(),current_route_id:Un.optional(),interaction_response:vi.optional(),selected_component:aT.optional(),intent:t.literal("navigation_adaptation").optional(),display_text:t.string().min(1).max(4e3).optional(),message:$p,base_snapshot_id:A.optional()}).superRefine((e,n)=>{e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"})})}),pe.extend({type:t.literal("client.run.cancel"),payload:t.object({run_id:V,reason:t.string().min(1).optional()})}),pe.extend({type:t.literal("client.tool.approve"),payload:t.object({tool_call_id:t.string().min(1),decision:t.enum(["approve","reject"]),reason:t.string().min(1).optional()})}),hc]),cT=t.discriminatedUnion("type",[pe.extend({type:t.literal("server.run.started"),payload:t.object({run_id:V,agent_type:t.literal("workspace")})}),pe.extend({type:t.literal("server.user.message"),payload:t.object({client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(gs).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:vi.optional()})}),pe.extend({type:t.literal("server.assistant.delta"),payload:t.object({message_id:t.string().min(1),parts:t.array(gs).min(1),status:t.enum(["streaming","ready"])})}),pe.extend({type:t.literal("server.tool.started"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1)})}),pe.extend({type:t.literal("server.tool.completed"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:so.optional()})}),pe.extend({type:t.literal("server.workspace.suggestions"),payload:Kp.extend({run_id:V}).strict()}),pe.extend({type:t.literal("workspace.plan.created"),payload:t.object({plan_id:t.string().min(1),run_kind:fs,groups:t.array(Da),tasks:t.array(Oa),dependencies:t.array(Na),expected_outputs:t.array(Pe),diagnostics:Ca,summary:zp})}),pe.extend({type:t.literal("workspace.worker.updated"),payload:t.object({group_id:t.string().min(1),phase:Pa,status:Vt,task_counts:Hp,target_paths:t.array(Pe),diagnostics:t.array(t.string().min(1))})}),pe.extend({type:t.literal("workspace.task.updated"),payload:t.object({task_id:t.string().min(1),group_id:t.string().min(1),status:Vt,target_path:Pe,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(va).optional()})}),pe.extend({type:t.literal("server.patch.applied"),payload:t.object({patch_batch_id:t.string().min(1),changed_files:t.array(t.string().min(1)),sitemap_resync_queued:t.boolean()})}),pe.extend({type:t.literal("server.sitemap.updated"),payload:t.object({sitemap_id:Te,version:t.number().int().positive(),reason:t.string().min(1)})}),pe.extend({type:t.literal("server.snapshot.created"),payload:t.object({snapshot_id:A,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/)})}),pe.extend({type:t.literal("server.snapshot.finalized"),payload:t.object({snapshot_id:A})}),pe.extend({type:t.literal("server.preview.invalidated"),payload:t.object({reason:t.string().min(1),next_preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()})}),pe.extend({type:t.literal("preview.build.started"),payload:t.object({snapshot_id:A})}),pe.extend({type:t.literal("preview.build.succeeded"),payload:t.object({snapshot_id:A})}),pe.extend({type:t.literal("preview.build.failed"),payload:t.object({snapshot_id:A,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean()})}),pe.extend({type:t.literal("server.run.finished"),payload:t.object({run_id:V,snapshot_id:A,degraded_reason:Rn.optional(),build_verified:t.boolean().optional()})}),pe.extend({type:t.literal("server.run.failed"),payload:t.object({run_id:V,error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional()})}),pe.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})}),pe.extend({type:t.literal("server.activity.started"),payload:t.object({activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:wp,title:t.string().min(1).max(200),title_code:Nt.optional(),detail:t.string().max(360).optional(),detail_code:Nt.optional(),locks_input:t.boolean()})}),pe.extend({type:t.literal("server.activity.updated"),payload:t.object({activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),title_code:Nt.optional(),detail:t.string().max(360).optional(),detail_code:Nt.optional()})}),pe.extend({type:t.literal("server.activity.finished"),payload:t.object({activity_id:t.string().min(1)})}),pe.extend({type:t.literal("server.activity.failed"),payload:t.object({activity_id:t.string().min(1),detail:t.string().max(360).optional()})})]),mT=cT.superRefine((e,n)=>{if(e.type==="server.user.message"&&e.payload.interaction_response&&!e.payload.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["payload","in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type!=="server.tool.completed")return;let i=e.payload.name==="prepare_product_search_entry";i!==!!e.payload.interaction_request&&n.addIssue({code:"custom",path:["payload","interaction_request"],message:i?"prepare_product_search_entry requires interaction_request":"interaction_request is only valid for prepare_product_search_entry"})}),JG=t.union([rT,mT]),eq={path:"/v1/workspace/sites/:site_id/socket",protocol:"ws",status:"implemented",inbound_message_schema:"WorkspaceClientMessageSchema",outbound_message_schema:"WorkspaceServerMessageSchema",query_parameters:[{name:"run_id",required:!1,schema:"string",summary:"Workspace run id returned by the API run-start response."},{name:"run_kind",required:!1,schema:"WorkspaceRunKindSchema",summary:"Workspace run mode; initial_generation can auto-start when base_snapshot_id is present."},{name:"base_snapshot_id",required:!1,schema:"string",summary:"Authoritative base snapshot id for this workspace run."},{name:"unattended",required:!1,schema:'"1"',summary:"Unattended mode for machine-driven runs: interactive tools are withheld so the run cannot stall waiting for a human answer. Server-to-server only; the browser proxy strips it."}],ai_sdk_ui_compatible:!0,notes:["Assistant UI output is carried as AI SDK UIMessage parts, including text, data-*, and tool-* parts.","Operational AgentEvents remain persisted separately for replay and audit."]},Yp=t.string().regex(/^sha256:[a-f0-9]{64}$/),lT=t.enum(["create","update","delete","str_replace"]),Xp=t.enum(["sitemap_resync","smoke_test","prepare_preview"]),pT=t.object({old_string:t.string().min(1).describe("Exact text to find in the current file. Must match the file uniquely; include enough surrounding context (usually 2-4 adjacent lines)."),new_string:t.string().describe("Replacement text. May be empty to delete the matched text."),replace_all:t.boolean().optional()}).strict(),dT=t.object({path:Pe,operation:lT,expected_hash:Yp.optional(),full_content:t.string().describe("Complete file content for create/update patches. Only this single field is a string value: every double quote inside the source code must be escaped so the field stays valid JSON. Avoid ASCII double quotes inside JSX attribute values and use corner quotes like \u300C\u751F\u65E5\u5FEB\u4E50\u300D for visitor-facing quoted examples. The surrounding patch object and the patches array are ordinary JSON structures, not strings.").optional(),edits:t.array(pT).min(1).max(20).optional()}).strict().superRefine((e,n)=>{let i=e.full_content!==void 0;if(e.operation==="delete"){i&&n.addIssue({code:"custom",path:["full_content"],message:"delete patches must not include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"});return}if(IT(e.path)||n.addIssue({code:"custom",path:["path"],message:"Static App Router page paths must use lowercase ASCII kebab-case public segments."}),e.operation==="str_replace"){e.full_content!==void 0&&n.addIssue({code:"custom",path:["full_content"],message:"str_replace patches must not include full_content"}),(!e.edits||e.edits.length===0)&&n.addIssue({code:"custom",path:["edits"],message:"str_replace patches must include a non-empty edits array"});return}i||n.addIssue({code:"custom",path:["full_content"],message:"create/update patches must include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"})}),uT=t.object({kind:t.enum(["block","page","site","chrome"]),id:t.string().min(1).max(120)}),_T=t.object({base_key:t.string().min(1).max(120).regex(/^[A-Za-z0-9._:-]+$/).refine(e=>!e.includes(".."),{message:"base_key must not contain '..'"}),owner:uT,count:t.number().int().min(1).max(12),query:t.string().min(1).max(400),role:t.enum(["hero","section","card","gallery","testimonial","decorative","site_background","nav_background","footer_background"]),orientation:t.enum(["landscape","portrait","square"]).optional(),altHint:t.string().min(1).max(300)}),Qp=t.object({site_id:k,base_snapshot_id:A,reason:t.string().min(1),patches:t.array(dT).min(1).describe("A real JSON array of patch objects. Never JSON.stringify this array, and never put an encoded JSON array inside a string \u2014 emit the array itself. Only full_content within a patch object is a string field."),media_requests:t.array(_T).max(24).optional(),post_actions:t.array(Xp).optional()});function Zp(e,n){let i=new Set;for(let[s,o]of e.patches.entries())i.has(o.path)&&n.addIssue({code:"custom",path:["patches",s,"path"],message:`Duplicate patch path: ${o.path}`}),i.add(o.path)}var tq=Qp.superRefine(Zp),nq=Qp.omit({base_snapshot_id:!0}).extend({site_id:k.optional()}).superRefine(Zp),gT=xe,hT=t.object({path:gT,operation:t.enum(["upsert","delete"]).optional()}),Jp=t.enum(["sync_cms_pages","sync_cms_navigation"]),iq=t.object({files:t.array(hT).min(1),post_actions:t.array(Jp).optional()}).strict().overwrite(e=>e.post_actions?{...e,post_actions:[...new Set(e.post_actions)]}:e),ST=t.enum(["BASE_SNAPSHOT_NOT_FOUND","PATCH_TARGET_NOT_FOUND","PATCH_TARGET_ALREADY_EXISTS","PATCH_EXPECTED_HASH_MISMATCH","PATCH_DIFF_UNSUPPORTED","PATCH_PROTECTED_FILE","PATCH_VALIDATION_FAILED","PATCH_MEDIA_REFERENCE_NOT_DECLARED","PATCH_BATCH_INVALID","PATCH_BATCH_FAILED","PATCH_BATCH_TOO_LARGE","STR_REPLACE_NOT_FOUND","STR_REPLACE_NOT_UNIQUE","STR_REPLACE_BINARY_FILE","STR_REPLACE_REQUIRES_READ","GLOBALS_CSS_EDIT_REJECTED"]),fT=t.object({status:t.literal("applied"),patch_batch_id:t.string().min(1),site_id:k,base_snapshot_id:A,snapshot_id:A,manifest_hash:Yp,object_key:t.string().min(1),changed_files:t.array(Pe).min(1),post_actions_queued:t.array(Xp),dropped_protected_files:t.array(t.string().min(1)).min(1).optional()}),bT=t.object({status:t.literal("failed"),code:ST,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),sq=t.discriminatedUnion("status",[fT,bT]),oq=t.object({ok:t.literal(!0),post_actions:t.array(t.object({action:Jp,status:t.enum(["succeeded","failed"])}).strict()).default([])}),ed=xe,yT=t.enum(["text","binary"]),td=t.object({path:ed,kind:yT,language:t.string().min(1).nullable(),size_bytes:t.number().int().nonnegative()}),aq=t.object({path:ed}),xT=td.extend({kind:t.literal("text"),language:t.string().min(1),content:t.string()}),ET=td.extend({kind:t.literal("binary"),language:t.null(),mime_type:t.string().min(1),content_base64:t.string().min(1)}),rq=t.union([xT,ET]);function oi(e){return typeof e=="string"?/authorization\s*:|bearer\s+|token\s*=|secret\s*=|api[_-]?key\s*=|access[_\s-]?key\s*=|\bsk-[a-z0-9_-]{20,}|eyJ[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}/i.test(e):!e||typeof e!="object"?!1:Array.isArray(e)?e.some(n=>oi(n)):Object.entries(e).some(([n,i])=>RT(n)||oi(i))}function RT(e){let n=e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/\s+/g,"_").toLowerCase();return/(^|[_-])(authorization|token|secret|api[_-]?key|apikey|access[_-]?key|accesskey)([_-]|$)/.test(n)}function nd(e){let n=e.split("/");return e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&n.every(i=>i!==""&&i!=="."&&i!=="..")}function IT(e){if(/^(?:src\/)?app\/\.vcp\//.test(e))return mi(e);let n=/^app\/(?:(.*)\/)?page\.(?:tsx|jsx)$/.exec(e);if(!n)return!0;let s=(n[1]??"").split("/").filter(a=>a.length>0);return s.some(a=>a.startsWith("_"))?!0:s.filter(a=>!a.startsWith("@")&&!/^\(.+\)$/.test(a)).map(a=>a.replace(/^\((?:\.|\.\.|\.\.\.)\)/,"")).filter(a=>a.length>0).every(a=>/^\[.*\]$/.test(a)||On.test(`/${a}`))}var id=t.enum(["idle","creating","restoring_snapshot","installing_dependencies","starting_preview","ready","active","stopping","stopped","failed"]),TT=t.object({id:ai,tenant_id:t.string().min(1),site_id:k,sandbox_id:t.string().min(1).nullable(),status:id,source_snapshot_id:A.nullable(),last_snapshot_id:A.nullable(),preview_url:t.string().url().nullable(),browser_preview_url:t.string().url().nullable().optional(),launch_id:t.string().min(1).nullable().optional(),last_activity_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),cq=t.object({session_id:ai.optional(),sandbox_id:t.string().min(1).optional(),source_snapshot_id:A.optional(),last_snapshot_id:A,expected_current_snapshot_id:A.optional(),expected_ready_session_id:ai.optional(),expected_ready_session_last_snapshot_id:A.optional(),status:id,preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()}),mq=t.object({preview_session:TT,next_step:t.literal("preview")}),lq=t.object({failed_count:t.number().int().nonnegative()}),pq=t.object({site_id:k}),dq=t.object({status:t.enum(["cancelled","stop_requested","no_active_run"]),agent_run:et.nullable()});export{Cm as AESTHETIC_NOTE_MAX_LENGTH,tR as AI_IMAGE_GENERATION_ENTITLEMENT,hn as AI_IMAGE_GENERATION_MAX_QUANTITY,Pb as APPLICATION_LIBRARY_ERROR_CODES,xF as AbandonSiteSnapshotResponseSchema,tE as ActiveSiteDomainDataSchema,BG as ActiveWorkspaceRunResponseSchema,wp as ActivityKindSchema,Nt as ActivityTitleCodeSchema,L1 as AdvanceSiteWorkflowRequestSchema,yp as AgentErrorCategorySchema,Ma as AgentEventIdSchema,Sa as AgentEventRecordSchema,Vp as AgentEventSchema,Bp as AgentEventTypeSchema,WI as AgentMessageHistoryPurposeSchema,Rp as AgentModelRouteSchema,KI as AgentPlanStepSchema,_F as AgentRunContextResponseSchema,V as AgentRunIdSchema,Ep as AgentRunKindSchema,et as AgentRunRecordSchema,jR as AgentRunStatusSchema,xp as AgentRunTypeSchema,tt as AgentThreadIdSchema,LR as AgentThreadKindSchema,MR as AgentThreadOriginSchema,hs as AgentThreadRecordSchema,Ip as AgentThreadStatusSchema,nR as AiImageGenerationPrecheckRequestSchema,iR as AiImageGenerationPrecheckResponseSchema,_a as AiImageGenerationQuotaSchema,XI as AiSdkUiDataPartSchema,ZI as AiSdkUiErrorPartSchema,VI as AiSdkUiFilePartSchema,gs as AiSdkUiMessagePartSchema,sT as AiSdkUiMessageSchema,HI as AiSdkUiReasoningPartSchema,YI as AiSdkUiSourceDocumentPartSchema,$I as AiSdkUiSourceUrlPartSchema,JI as AiSdkUiStepStartPartSchema,zI as AiSdkUiTextPartSchema,QI as AiSdkUiToolPartSchema,LG as ApiContractStatusSchema,zR as ApiErrorEnvelopeSchema,L as ApiResponseSchema,CG as AppendAgentEventRequestSchema,DG as AppendAgentEventResponseSchema,kN as ApplicationCreateResponseSchema,Nb as ApplicationLibraryApplicationSchema,AN as ApplicationLibraryApplicationsDataSchema,Um as ApplicationLibraryErrorCodeSchema,PN as ApplicationLibraryErrorResponseSchema,wN as ApplicationLibraryTemplatesDataSchema,Gm as ApplicationTemplateCatalogDataSchema,vb as ApplicationTemplateCatalogItemSchema,wb as ApplicationTemplateConsumeDataSchema,TN as ApplicationTemplateCreateRequestSchema,Db as ApplicationTemplateCreateResponseSchema,Cb as ApplicationTemplateCreatedApplicationSchema,Xi as ApplicationTemplateDigestSchema,Rb as ApplicationTemplateFieldSchema,Ab as ApplicationTemplateReferenceSchema,Ob as ApplicationTemplateSourceSchema,Qi as ApplicationTemplateStableKeySchema,Wo as ApplicationTemplateV1Schema,ST as ApplyPatchBatchErrorCodeSchema,bT as ApplyPatchBatchFailureSchema,tq as ApplyPatchBatchInputSchema,dT as ApplyPatchBatchPatchSchema,Xp as ApplyPatchBatchPostActionSchema,sq as ApplyPatchBatchResultSchema,fT as ApplyPatchBatchSuccessSchema,nq as ApplyPatchBatchToolInputSchema,pT as ApplyPatchEditSchema,lT as ApplyPatchOperationSchema,bp as ArchetypeProposalSchema,GT as AuditLogIdSchema,wT as AuthIdentityIdSchema,DT as AuthLoginCodeIdSchema,CT as AuthOidcStateIdSchema,PT as AuthSessionIdSchema,vT as AuthTokenIdSchema,OT as AuthWsTicketIdSchema,Ly as BINDING_STATUSES,Pp as BlockGenerationContextSchema,pi as BlockInteractionSchema,JF as BlockMediaIntentSchema,Ta as BlockSchema,gS as BlockingSubsiteSchema,vp as BrandingSchema,$t as BriefIdSchema,Ea as BriefRecordSchema,Za as BusinessFactsSchema,zC as CHAT_COPY,BC as CLARIFICATION_COPY,cy as CMS_FORM_FIELD_TYPES,bm as CMS_MAIN_PRODUCTS_MAX_LENGTH,Du as CMS_PAGE_DIRECTORY_MAX_DEPTH,Cu as CMS_PAGE_DIRECTORY_MAX_NODES,wr as CMS_PAGE_URL_PATH_MAX_LENGTH,uv as COMPONENT_I18N_FILE_SUFFIX,Mi as COMPONENT_I18N_NAMESPACE,bd as CONVERSION_CTA_LABEL_MAX_LENGTH,tx as CRAWLER_INTERNAL_ERROR_CODES,_m as CURRENT_EDIT_ENGINE_VERSION,pq as CancelActiveWorkspaceRunRequestSchema,dq as CancelActiveWorkspaceRunResponseSchema,Nl as CheckSitePublishDomainDataSchema,Vx as CheckSitePublishDomainRequestSchema,$x as CheckSitePublishDomainResponseSchema,Cp as ChromeDesignSchema,sI as ChromeFooterDesignSchema,iI as ChromeFooterShellSchema,tI as ChromeHeaderDesignSchema,eI as ChromeHeaderShellSchema,oI as ChromeMobileNavDesignSchema,av as ClaimStaleWorkspaceRunsResponseSchema,OR as ClarifyQuestionOptionSchema,NR as ClarifyQuestionSchema,vR as ClarifyQuestionTypeSchema,ya as ClarifyQuestionsSchema,FU as ClarifyRunInputSchema,ja as ClarifySessionIdSchema,LI as ClarifySessionRecordSchema,GU as ClarifyStreamEventSchema,LN as CmsApplicationCoreInputSchema,MN as CmsApplicationCoreResultSchema,UN as CmsApplicationSeedInputSchema,FN as CmsApplicationSeedResultSchema,qT as CmsCollectionBindingIdSchema,Mj as CmsCollectionBindingSchema,Jm as CmsFormSchemaProjectionSchema,Gs as CmsManagedPageTypeSchema,cU as CmsNavigationActionSchema,rU as CmsNavigationCapabilitiesResponseSchema,IR as CmsNavigationCapabilitiesSchema,pp as CmsNavigationCreateGroupBodySchema,xR as CmsNavigationCreateItemBodySchema,aU as CmsNavigationDefaultGroupBodySchema,bR as CmsNavigationEditorContextSchema,oU as CmsNavigationEditorResponseSchema,fR as CmsNavigationGroupSchema,lp as CmsNavigationItemSchema,RR as CmsNavigationMoveItemBodySchema,yR as CmsNavigationPatchGroupBodySchema,ER as CmsNavigationPatchItemBodySchema,rp as CmsNavigationTargetTypeSchema,ju as CmsPageDirectoryGroupSchema,Pr as CmsPageDirectoryNodeSchema,kr as CmsPageDirectorySchema,qs as CmsPageTypeSchema,pt as CmsPageUrlPathSchema,tA as CmsSeoSyncStateSchema,pr as CmsSiteIdSchema,Zy as CompanyInfoSchema,eL as CompanyInfoTaskCreateRequestSchema,tL as CompanyInfoTaskCreateResponseSchema,nL as CompanyInfoTaskResponseSchema,NO as CompleteCustomerMaterialsRequestSchema,jO as CompleteDiagnosisRequestSchema,U1 as CompleteQualityOnlyWorkflowRequestSchema,RF as CompleteSiteSnapshotDeletionResponseSchema,M1 as CompleteSiteWorkflowRequestSchema,LO as CompleteStrategyRequestSchema,OO as CompleteWebsiteScanRequestSchema,gv as ComponentI18nResourcesSchema,uA as ComposeDesignerPageResourceBodySchema,$T as ComputeSnapshotEditChangesRequestSchema,YT as ComputeSnapshotEditChangesResponseSchema,Xx as ConfirmSitePublishDomainRemediationDataSchema,Yx as ConfirmSitePublishDomainRemediationRequestSchema,Qx as ConfirmSitePublishDomainRemediationResponseSchema,bG as ConfirmSiteStructureRequestSchema,xN as ConnectDynamicCollectionInputSchema,VN as ConnectFormInputSchema,Mt as ConversionHintsSchema,nx as CrawlerInternalErrorCodeSchema,iL as CrawlerInternalErrorSchema,dn as CrawlerTaskCodeSchema,zj as CrawlerTaskCreateRequestSchema,$j as CrawlerTaskCreateResponseSchema,By as CrawlerTaskFailureErrorCodeSchema,_l as CrawlerTaskFailureStageSchema,Hy as CrawlerTaskPageSchema,Hj as CrawlerTaskPagesQuerySchema,Qj as CrawlerTaskPagesResponseSchema,Xj as CrawlerTaskStatusResponseSchema,zt as CrawlerTaskUuidSchema,QF as CreateAgentRunConflictResponseSchema,gF as CreateAgentRunRequestSchema,hF as CreateAgentRunResponseSchema,WF as CreateDeploymentRequestSchema,qR as CreateDeploymentResponseSchema,Dk as CreateDocumentUploadRequestSchema,HT as CreateExternalSiteEditRequestSchema,XT as CreateExternalSiteEditResponseSchema,Uk as CreateImageUploadRequestSchema,Ak as CreateInputSourceRequestSchema,KF as CreateQualityCheckDeploymentRequestSchema,$U as CreateSiteBriefRequestSchema,lF as CreateSiteBriefResponseSchema,YU as CreateSiteDraftRequestSchema,VU as CreateSiteInputSchema,VG as CreateSiteThreadRequestSchema,N1 as CreateSiteWorkflowRequestSchema,Pd as CreateTextInputSourceRequestSchema,vd as CreateUrlInputSourceRequestSchema,zF as CurrentDeploymentResponseSchema,AO as CustomerMaterialsDraftResponseSchema,Do as CustomerMaterialsDraftSchema,wO as CustomerMaterialsNullableResponseSchema,Oo as CustomerMaterialsRecordSchema,kO as CustomerMaterialsResponseSchema,ob as CustomerMaterialsStatusSchema,Ph as DEFAULT_FONTS,Im as DEFAULT_SITE_DESIGN_RADIUS_ID,nu as DEFAULT_SITE_LOCALE,nD as DEFAULT_SUBSITE_PALETTE,Ni as DEFAULT_WEIGHT_STYLE_ID,Qw as DEPLOYMENT_ACTIVE_STATUSES,kt as DEPLOYMENT_LIFECYCLE_TRANSITIONS,Fg as DEPLOYMENT_PROGRESS_STEP_CODES,BR as DEPLOYMENT_REALTIME_CHANNEL,Yt as DEPLOYMENT_STATUSES,Zw as DEPLOYMENT_TERMINAL_STATUSES,Rh as DEPLOYMENT_TRANSITION_ERROR_CODE,XF as DEPLOYMENT_WEBSOCKET_CONTRACT,L0 as DESIGNER_COMPONENT_LIBRARY_ERROR_CODES,cA as DESIGNER_PAGE_LIBRARY_ERROR_CODES,wk as DOCUMENT_EXTENSION_WHITELIST,Pk as DOCUMENT_MIME_WHITELIST,Ex as DOMAIN_DNS_PURPOSES,Tx as DOMAIN_DNS_REMEDIATION_STATUSES,Rx as DOMAIN_DNS_VERIFICATION_STATUSES,fx as DOMAIN_OBSERVED_STATUSES,yx as DOMAIN_ROUTING_MODES,Q0 as DeleteDesignerPageErrorDetailsSchema,V0 as DeleteDesignerPageRequestSchema,$0 as DeleteDesignerPageResponseSchema,Ku as DeleteDesignerPageResultSchema,EF as DeleteSiteSnapshotResponseSchema,ct as DeploymentIdSchema,NT as DeploymentJobIdSchema,Gg as DeploymentProgressStepCodeSchema,Wg as DeploymentProgressStepSchema,qg as DeploymentProgressStepStatusSchema,vc as DeploymentProgressStepsSchema,Ot as DeploymentRecordSchema,YF as DeploymentRedisPubSubEventSchema,Ra as DeploymentStatusSchema,gp as DeploymentStatusSummarySchema,_o as DeploymentTransitionError,kp as DeploymentTypeSchema,us as DeploymentWsDeploymentPayloadSchema,$F as DeploymentWsServerMessageSchema,KR as DeploymentWsServerMessageTypeSchema,GI as DesignPlanGenerationOutcomeSchema,qI as DesignPlanGenerationReasonSchema,bs as DesignPlanIdSchema,nG as DesignPlanPatchSchema,MI as DesignPlanRecordSchema,Dp as DesignPlanSchema,Me as DesignTokenBlockError,ZF as DesignTokensSchema,vu as DesignerComponentCatalogItemSchema,xr as DesignerComponentCategoriesDataSchema,yr as DesignerComponentCategoryNodeSchema,Gt as DesignerComponentExactVersionSchema,Rr as DesignerComponentInstallDataSchema,Er as DesignerComponentsDataSchema,Yu as DesignerPageCatalogItemSchema,Mr as DesignerPageCategoriesDataSchema,Lr as DesignerPageCategoryNodeSchema,Gu as DesignerPageDeleteBlockReasonSchema,Fu as DesignerPageDisabledReasonSchema,Dn as DesignerPageExactVersionSchema,Or as DesignerPageGroupSchema,Fr as DesignerPageInstallDataSchema,Dr as DesignerPageNodeSchema,qr as DesignerPageResourcePreparationDataSchema,$u as DesignerPageResourceSourceSchema,n_ as DesignerPageResourceTemplateSchema,qt as DesignerPageResourceTypeSchema,Ur as DesignerPagesDataSchema,Ls as DesignerResourceVersionSchema,Wr as DesignerSitePagesDataSchema,lA as DesignerSiteRouteIdSchema,Pl as DomainConfigurationSchema,sa as DomainDnsPurposeSchema,Cx as DomainDnsRecordSchema,vx as DomainDnsRemediationChangeSchema,kl as DomainDnsRemediationRecordSchema,Al as DomainDnsRemediationResultSchema,kx as DomainDnsRemediationStatusSchema,Px as DomainDnsVerificationObservationSchema,Tl as DomainDnsVerificationResultSchema,Ix as DomainDnsVerificationStatusSchema,bx as DomainObservedStatusSchema,wx as DomainOperationErrorSchema,cs as DomainOperationSchema,Ax as DomainOperationStatusSchema,oa as DomainOperationTypeSchema,wl as DomainRecordSchema,xx as DomainRoutingModeSchema,VC as EDIT_ENGINE_VERSION_HEADER,$C as EDIT_ENGINE_VERSION_SOURCE_HEADER,VT as EMPTY_EXTERNAL_SITE_EDIT_CHANGES,qC as ERROR_COPY,rd as EXTERNAL_SITE_EDIT_INFRASTRUCTURE_REASONS,ad as EXTERNAL_SITE_EDIT_PROMPT_MAX_LENGTH,vo as EditEngineVersionParseError,Kr as EnhanceDesignerPageResourceBodySchema,cF as EnhanceDesignerPageResourceResponseSchema,JT as ExternalSiteEditCallbackAckSchema,ZT as ExternalSiteEditCallbackPayloadSchema,cd as ExternalSiteEditCallbackStatusSchema,xs as ExternalSiteEditChangeKindSchema,Ba as ExternalSiteEditChangesSchema,Rn as ExternalSiteEditDegradedReasonSchema,Lt as ExternalSiteEditExternalIdSchema,Ga as ExternalSiteEditOutcomeSchema,Sd as ExternalSiteEditPageChangeSchema,ld as ExternalSiteEditPageTypeSchema,hd as ExternalSiteEditSectionChangeSchema,dd as ExternalSiteEditSiteWideChangeSchema,pd as ExternalSiteEditSiteWideKindSchema,Fa as ExternalSiteEditTaskIdSchema,ci as ExternalSiteEditTaskSchema,md as ExternalSiteEditTaskStatusSchema,JU as ExternalSyncSiteRequestSchema,mF as ExternalSyncSiteResponseSchema,kd as ExtractedFactKindSchema,di as ExtractedFactSchema,qo as FIELD_TYPES,ZP as FILL_IN_NOT_AVAILABLE_ERROR_CODE,ev as FILL_IN_TARGET_MODIFIED_ERROR_CODE,JP as FILL_IN_TARGET_NOT_OMITTED_ERROR_CODE,Kc as FONT_PAIRINGS,So as FONT_PAIRING_IDS,yy as FORM_DESIGN_ERROR_CODES,by as FORM_DESIGN_FAILURE_STAGES,Sy as FORM_DESIGN_OPERATION_STAGES,fy as FORM_DESIGN_OPERATION_STATUSES,Ji as FORM_FIELD_TYPES,Bm as FORM_SCENE_CODES,zm as FORM_SCENE_UNKNOWN,Fb as FORM_SHAPE_EMBEDDED,my as FORM_SPEC_FIELD_TYPE_TO_CMS,Vm as FORM_SPEC_FILE_MIN_RUNTIME_VERSION,ey as FORM_SPEC_LOCALIZABLE_FIELD_PATHS,Hm as FORM_SPEC_MULTISTEP_MIN_RUNTIME_VERSION,oj as FORM_TEMPLATE_CATEGORY_COUNTS,sj as FORM_TEMPLATE_CATEGORY_SLUGS,lq as FailStaleInFlightWorkspaceRunsResponseSchema,Yi as FieldDeclSchema,nm as FillInTargetSchema,uL as FirecrawlBatchCreateRequestSchema,_L as FirecrawlBatchCreatedResponseSchema,ox as FirecrawlBatchErrorSchema,hL as FirecrawlBatchErrorsResponseSchema,sx as FirecrawlBatchPageSchema,gL as FirecrawlBatchStatusResponseSchema,cL as FirecrawlCrawlCreateRequestSchema,mL as FirecrawlCrawlCreatedResponseSchema,lL as FirecrawlCrawlStatusResponseSchema,bl as FirecrawlJobStatusSchema,aL as FirecrawlMapRequestSchema,rL as FirecrawlMapResponseSchema,SL as FirecrawlQueueStatusResponseSchema,pL as FirecrawlScrapeRequestSchema,dL as FirecrawlScrapeResponseSchema,nI as FooterShellSurfaceSchema,Bb as FormBlockIdSchema,ts as FormDefinitionIdSchema,_y as FormDesignAffectedFilesSchema,ta as FormDesignErrorCodeSchema,hj as FormDesignErrorSchema,nl as FormDesignFailureStageSchema,de as FormDesignHashSchema,mj as FormDesignOpenResponseSchema,gy as FormDesignOperationFingerprintInputSchema,Yo as FormDesignOperationIdSchema,il as FormDesignOperationNextActionSchema,LT as FormDesignOperationRecordIdSchema,_j as FormDesignOperationRecordSchema,na as FormDesignOperationResponseSchema,ol as FormDesignOperationSchema,ea as FormDesignOperationStageSchema,tl as FormDesignOperationStatusSchema,gj as FormDesignOperationTransitionRequestSchema,sl as FormDesignPreviewRefreshStatusSchema,pj as FormDesignQueryResponseSchema,dj as FormDesignResumeRequestSchema,uj as FormDesignResumeResponseSchema,hy as FormDesignSaveRequestSchema,lj as FormDesignSaveResponseSchema,el as FormDesignSharedImpactSchema,Jo as FormDesignStandardizationSchema,Wb as FormFieldDeclSchema,ti as FormFieldNameSchema,Ho as FormMetadataSchema,Xo as FormOptionValueSchema,zo as FormSceneSchema,Gb as FormShapeSchema,zb as FormSpecBindingSchema,Vb as FormSpecFieldNodeSchema,Yb as FormSpecNodeSchema,Hb as FormSpecOptionSchema,$b as FormSpecStepBreakNodeSchema,Zo as FormSpecV1Schema,aj as FormTemplateCatalogResponseSchema,Zm as FormTemplateCategorySlugSchema,ay as FormTemplateCategoryV1Schema,Ct as FormTemplateTextSchema,ry as FormTemplateV1Schema,lE as GA4_AUTHORIZATION_STATUSES,dE as GA4_AUTH_ATTEMPT_STATUSES,fE as GA4_BINDING_REASONS,_E as GA4_BINDING_STATUSES,hE as GA4_VERIFICATION_STATUSES,Wn as GLOBAL_DESIGN_TOKENS_END,an as GLOBAL_DESIGN_TOKENS_START,nE as GSC_AUTH_STATUSES,iE as GSC_BINDING_STATUSES,sE as GSC_PROPERTY_TYPES,wE as Ga4AccountOptionSchema,Fl as Ga4AuthAttemptSchema,uE as Ga4AuthAttemptStatusSchema,xE as Ga4AuthorizationSchema,pE as Ga4AuthorizationStatusSchema,bE as Ga4BindingReasonSchema,EE as Ga4BindingSchema,gE as Ga4BindingStatusSchema,vE as Ga4DataStreamOptionSchema,CE as Ga4DataStreamsDataSchema,UM as Ga4DataStreamsQuerySchema,MM as Ga4DataStreamsResponseSchema,kE as Ga4DeploymentSchema,IE as Ga4ModeSchema,DE as Ga4MutationSchema,AE as Ga4PropertyOptionSchema,PE as Ga4SetupResourcesDataSchema,LM as Ga4SetupResourcesQuerySchema,jM as Ga4SetupResourcesResponseSchema,Gl as Ga4StatusDataSchema,NM as Ga4StatusQuerySchema,OM as Ga4StatusResponseSchema,TE as Ga4TrackingSchema,RE as Ga4VerificationSchema,SE as Ga4VerificationStatusSchema,sR as GenerateAiImagesRequestSchema,oR as GenerateAiImagesResponseSchema,sp as GeneratedAiImageResultSchema,nM as GetActiveSiteDomainResponseSchema,HF as GetDeploymentResponseSchema,WR as GetDeploymentsStatusResponseSchema,QT as GetExternalSiteEditResponseSchema,tM as GetSiteDomainConfigurationResponseSchema,eO as GetSiteLauncherPermissionResponseSchema,aa as GetSitePublishDomainOperationDataSchema,Zx as GetSitePublishDomainOperationResponseSchema,UD as GetTemplateUpgradeReportQuerySchema,FD as GetTemplateUpgradeReportResponseSchema,RM as GoogleSearchConsoleAuthStartDataSchema,EM as GoogleSearchConsoleAuthStartRequestSchema,IM as GoogleSearchConsoleAuthStartResponseSchema,fM as GoogleSearchConsoleAuthStatusSchema,bM as GoogleSearchConsoleBindingStatusSchema,yM as GoogleSearchConsolePropertyTypeSchema,xM as GoogleSearchConsoleStateSchema,kM as GoogleSearchConsoleStatusDataSchema,TM as GoogleSearchConsoleStatusInputSchema,AM as GoogleSearchConsoleStatusResponseSchema,gM as GscAuthStartDataSchema,_M as GscAuthStartRequestSchema,hM as GscAuthStartResponseSchema,ra as GscAuthStatusSchema,ca as GscBindingStatusSchema,ma as GscPropertyTypeSchema,aE as GscStateInputSchema,SM as GscStateSchema,Ml as GscStatusDataSchema,rE as GscStatusResponseSchema,Ar as HOME_PAGE_URL_PATH,ZR as HeaderShellBehaviorSchema,JR as HeaderShellShapeSchema,QR as HeaderShellSurfaceSchema,XR as HeaderShellVariantSchema,Uy as HomeUrlCrawlerTaskCreateRequestSchema,Zs as HttpUrlSchema,Nk as IMAGE_EXTENSION_WHITELIST,jk as IMAGE_MIME_WHITELIST,br as INSERT_NEW_COMPONENT_CATEGORY_GROUP_KEY,jr as INSERT_NEW_PAGE_CATEGORY_GROUP_KEY,qP as INTERNAL_RUN_LEASE_OWNER_HEADER,iu as ISO_639_3_TO_SITE_LOCALE,Cd as ImageRoleSchema,$p as InboundUserMessageSchema,pN as IndustryClassificationRequestSchema,dN as IndustryClassificationResultSchema,fb as IndustryConfidenceSchema,Fm as InitializationResultSchema,Td as InputBundleStatusSchema,_i as InputConflictSchema,Fk as InputContextBundleSchema,En as InputContextSourceIdSchema,wd as InputSourceSchema,Rs as InputSourceStatusSchema,Es as InputSourceTypeSchema,kD as InspectTemplateUpgradeStateRequestSchema,AD as InspectTemplateUpgradeStateResponseSchema,G0 as InstallDesignerComponentBodySchema,nF as InstallDesignerComponentResponseSchema,pA as InstallDesignerPageBodySchema,oF as InstallDesignerPageResponseSchema,BF as InternalCreateDeploymentResponseSchema,UF as InternalEnsureSubsitePublishRequestSchema,FF as InternalEnsureSubsitePublishResponseSchema,Q as InternalEntityIdSchema,VF as InternalGetDeploymentsStatusResponseSchema,GF as InternalGetSubsitePublishStatusRequestSchema,qF as InternalGetSubsitePublishStatusResponseSchema,LF as InternalPrepareSubsitePreviewRequestSchema,MF as InternalPrepareSubsitePreviewResponseSchema,nb as KNOWLEDGE_CATEGORY_CODES,ym as KnowledgeCategoryCodeSchema,yO as KnowledgeContextReadinessSchema,sb as KnowledgeSourceReadinessSchema,xm as KnowledgeSourceReadinessStatusSchema,fO as KnowledgeTaskStatusBatchSchema,ib as KnowledgeTaskStatusSchema,rx as LEGACY_FILE_MUTATION_TOOL_NAME,Qd as LEGACY_SITE_LOCALE_CODES,XG as LatestAgentRunQuerySchema,QG as LatestAgentRunResponseSchema,KG as LatestWorkspaceRunQuerySchema,WG as LatestWorkspaceRunResponseSchema,AL as LauncherPromptTemplateApplyRequestSchema,wL as LauncherPromptTemplateApplyResponseSchema,px as LauncherPromptTemplateCatalogItemSchema,TL as LauncherPromptTemplateCatalogQuerySchema,kL as LauncherPromptTemplateCatalogSchema,mx as LauncherPromptTemplateKindSchema,lx as LauncherPromptTemplateLocaleSchema,rs as LauncherPromptTemplateTypeSchema,Vf as LauncherScopeSchema,NG as ListAgentEventsQuerySchema,OG as ListAgentEventsResponseSchema,eF as ListDesignerComponentCategoriesResponseSchema,F0 as ListDesignerComponentsQuerySchema,tF as ListDesignerComponentsResponseSchema,iF as ListDesignerPageCategoriesResponseSchema,mA as ListDesignerPagesQuerySchema,sF as ListDesignerPagesResponseSchema,rF as ListDesignerSitePagesResponseSchema,ZE as ListMediaLibraryAssetsQuerySchema,JE as ListMediaLibraryAssetsResponseSchema,jG as ListSiteAgentEventsQuerySchema,OF as ListSiteVersionsResponseSchema,GD as ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema,qD as ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema,sv as ListWorkspacePageCheckpointsResponseSchema,Ck as MAX_DOCUMENT_SOURCES_PER_SITE,vk as MAX_DOCUMENT_UPLOAD_BYTES,Mk as MAX_IMAGE_SOURCES_PER_SITE,Lk as MAX_IMAGE_UPLOAD_BYTES,zE as MAX_NAV_LABEL_WIDTH,yf as MAX_SUBSITE_MEDIA_REPLACEMENTS,nw as MAX_UNBOUND_WORKSPACE_ATTACHMENTS_PER_SITE,oo as MAX_WORKSPACE_ATTACHMENTS_PER_MESSAGE,mw as MAX_WORKSPACE_URL_CAPTURES_PER_SITE_HOUR,Xl as MEDIA_LIBRARY_AUDIO_EXTENSIONS,tp as MEDIA_LIBRARY_AUDIO_MIME_TYPES,Ql as MEDIA_LIBRARY_DOCUMENT_EXTENSIONS,XE as MEDIA_LIBRARY_EXTENSIONS,Zl as MEDIA_LIBRARY_FILE_EXTENSIONS,$l as MEDIA_LIBRARY_IMAGE_EXTENSIONS,YE as MEDIA_LIBRARY_IMAGE_MAX_BYTES,Jl as MEDIA_LIBRARY_IMAGE_MIME_TYPES,Vl as MEDIA_LIBRARY_MAX_BYTES,QE as MEDIA_LIBRARY_MIME_TYPES,Yl as MEDIA_LIBRARY_VIDEO_EXTENSIONS,ep as MEDIA_LIBRARY_VIDEO_MIME_TYPES,fv as MIGRATION_PRODUCTS_CMS_DETAIL_PAGE_TITLE,Sv as MIGRATION_PRODUCTS_DETAIL_PREFIX,xv as MIGRATION_PRODUCTS_DETAIL_VIEW_VARIANT,yv as MIGRATION_PRODUCTS_LIST_VIEW_VARIANT,dS as MIGRATION_PRODUCTS_ROUTE,St as MIGRATION_PRODUCTS_SLUG,bv as MIGRATION_PRODUCTS_VIEW_BLOCK_TYPE,qb as MODEL_DECLARABLE_FORM_FIELD_TYPES,yl as MODEL_FILE_MUTATION_TOOL_NAMES,ab as MOTION_PRESETS,jo as MOTION_PRESET_IDS,tG as MediaAssetSchema,$R as MediaAttributionSchema,ua as MediaLibraryAssetSchema,np as MediaLibraryFileTypeSchema,ip as MediaLibrarySourceSchema,uT as MediaRequestOwnerSchema,FT as MediaResolutionCacheIdSchema,kR as MigrationCollectionProgressSchema,ga as MigrationCollectionSchema,pU as MigrationContentProgressSchema,TR as MigrationReasonCodeSchema,wR as MigrationRedirectProgressSchema,AR as MigrationRedirectReasonCodeSchema,up as MigrationRedirectSiteReasonSchema,U0 as MockDesignerComponentInsertDataSchema,M0 as MockDesignerComponentInsertRequestSchema,ba as MotionLevelSchema,wy as NAV_ITEMS_LOCALIZABLE_FIELD_PATHS,Py as NAV_ITEMS_MACHINE_FIELD_PATHS,Dh as NEXT_FONT_DISPLAY_NAMES,ht as NEXT_FONT_REGISTRY,su as NON_LATIN_SITE_LOCALE_CODES,kj as NavItemSchema,Iy as PAGE_SEO_LOCALIZABLE_FIELD_PATHS,Ty as PAGE_SEO_MACHINE_FIELD_PATHS,On as PAGE_SLUG_PATTERN,Zt as PAGE_SLUG_SEGMENT_PATTERN_SOURCE,Va as PAGE_TEMPLATE_BATCH_MAX_ITEMS,Dj as PLATFORM_MATERIALIZED_EXEMPTIONS,Oy as PLATFORM_MATERIALIZED_FILES,Ny as PLATFORM_MATERIALIZED_FILE_PATTERNS,Cj as PLATFORM_MATERIALIZERS,Br as PLATFORM_OWNED_PAGE_SLUGS,i_ as PLATFORM_OWNED_ROUTE_FILE_PATHS,Wu as PageDirectoryReconcileFailedPageSchema,Ws as PageDirectoryReconcileResultSchema,J0 as PageDirectoryReconcileStateSchema,qu as PageDirectoryReconcileStatusSchema,Wy as PageDiscoveryCoverageEntrySchema,Yj as PageDiscoveryCoverageReasonSchema,gl as PageDiscoveryCoverageSchema,Op as PageNavigationSchema,Bs as PageResourceArtifactSchema,Ju as PageResourceComponentReferenceSchema,e_ as PageResourceComponentSchema,Qu as PageResourceDraftPageSchema,Zu as PageResourceDraftSchema,ki as PageResourceFinalRouteSchema,t_ as PageResourcePageSchema,Xu as PageResourcePageSelectionSchema,Gr as PageResourceRouteMappingSchema,Aa as PageSchema,Ij as PageSeoDeclSchema,ka as PageSlugSchema,zu as PageTargetKindSchema,Us as PageTargetProjectionHashSchema,Nr as PageTargetSchema,Hu as PageTargetSeoSchema,Z0 as PageTargetSetSchema,Ya as PageTemplateBatchManifestSchema,ak as PageTemplateCleanupRequestSchema,mk as PageTemplateCleanupResponseSchema,Ha as PageTemplateCreateItemSchema,sk as PageTemplateCreateRequestSchema,rk as PageTemplateCreateResponseSchema,lk as PageTemplateErrorCodeSchema,$e as PageTemplateIdSchema,In as PageTemplatePagePathSchema,ok as PageTemplatePromoteRequestSchema,ck as PageTemplatePromoteResponseSchema,fd as PageTemplateTaskSchema,Eo as PaletteInputsSchema,IG as PersistClarifyAnswersRequestSchema,TG as PersistClarifyAnswersResponseSchema,yG as PersistGeneratedSitemapDraftRequestSchema,RG as PersistGeneratedSitemapDraftResponseSchema,cq as PersistPreviewSessionRequestSchema,mq as PersistPreviewSessionResponseSchema,AG as PersistSiteDesignPlanRequestSchema,wG as PersistSiteDesignPlanResponseSchema,EG as PersistSiteSitemapDraftResponseSchema,fG as PersistSiteSitemapRequestSchema,xG as PersistSiteSitemapResponseSchema,SF as PersistSiteSnapshotRequestSchema,fF as PersistSiteSnapshotResponseSchema,PR as PositioningPrefillSchema,ha as PositioningSourceSchema,dA as PrepareDesignerPageBodySchema,aF as PrepareDesignerPageResponseSchema,lO as PrepareSiteBuildInitialGenerationBaseRequestSchema,pO as PrepareSiteBuildInitialGenerationBaseResultSchema,TD as PrepareTemplateUpgradeStateRequestSchema,Cf as PrepareTemplateUpgradeStateResponseSchema,jF as PrepareVersionPreviewRequestSchema,GR as PrepareVersionPreviewResponseSchema,wc as ProductSearchAppConfigDraftSchema,io as ProductSearchAppSlugSchema,J1 as ProductSearchContractFixtureSchema,vg as ProductSearchDraftConfigSchema,Le as ProductSearchFieldNameSchema,wg as ProductSearchFilterMetaSchema,so as ProductSearchInteractionRequestSchema,vi as ProductSearchInteractionResponseSchema,Z1 as ProductSearchPopularTermsReadSchema,Ac as ProductSearchPopularTermsSchema,Ng as ProductSearchRequestSchema,Lg as ProductSearchResponseSchema,Un as ProductSearchRouteIdSchema,Ag as ProductSearchValueShapeSchema,yF as PromoteSiteSnapshotRequestSchema,UR as PromoteSiteSnapshotResponseSchema,CF as PromoteTemplateUpgradeSnapshotRequestSchema,DF as PromoteTemplateUpgradeSnapshotResponseSchema,Dl as QualityRunningStatusSchema,KC as REFUSAL_COPY,UG as REST_API_ENDPOINTS,ky as ROOT_LAYOUT_METADATA_LOCALIZABLE_FIELD_PATHS,Ay as ROOT_LAYOUT_METADATA_MACHINE_FIELD_PATHS,Jx as ReconcileSitePublishDomainOperationDataSchema,eE as ReconcileSitePublishDomainOperationResponseSchema,IF as RecordSnapshotVersionRequestSchema,TF as RecordSnapshotVersionResponseSchema,LD as RecordTemplateUpgradeEventRequestSchema,MD as RecordTemplateUpgradeEventResponseSchema,wD as RecordTemplateUpgradeFailureRequestSchema,PD as RecordTemplateUpgradeFailureResponseSchema,vD as RecordTemplateUpgradeSuccessRequestSchema,CD as RecordTemplateUpgradeSuccessResponseSchema,Y0 as RecoverDesignerPageProjectionRequestSchema,X0 as RecoverDesignerPageProjectionResponseSchema,Bu as RecoverDesignerPageProjectionResultSchema,Ad as ReferencePagePatternSchema,ui as ReferenceSignalsSchema,lR as RegisterMediaResourceReferenceRequestSchema,pR as RegisterMediaResourceReferenceResponseSchema,F1 as RegisterWorkflowTaskCommandRequestSchema,yg as RegisterWorkflowTaskRequestSchema,iv as RegisterWorkspacePageCheckpointRequestSchema,wF as ReleaseTemplateUpgradeLockRequestSchema,PF as ReleaseTemplateUpgradeLockResponseSchema,W1 as ReplaceCrawlWorkflowTaskCommandRequestSchema,Eg as ReplaceCrawlWorkflowTaskRequestSchema,q1 as ReplaceWorkflowTaskCommandRequestSchema,xg as ReplaceWorkflowTaskRequestSchema,yN as ResolvedFieldSchema,$N as ResolvedFormFieldSchema,MG as RestApiMethodSchema,NF as RestoreSiteSnapshotResponseSchema,Tj as RootLayoutMetadataSchema,Ap as RouteGenerationCardSchema,hh as RuleEngineInputSchema,yh as RuleEngineScoreRecordSchema,uo as RuleScoreDimensionKeySchema,bh as RuleScoreDimensionSchema,An as SELECTABLE_SITE_LOCALE_CODES,yI as SITEMAP_RESOLVER_MAX_BLOCK_TARGETS,bI as SITEMAP_RESOLVER_MAX_PAGE_TARGETS,cO as SITE_BUILD_CONTEXT_FILE_PATH,mO as SITE_BUILD_CONTEXT_MAX_BYTES,cg as SITE_BUILD_STATUSES,yc as SITE_BUILD_STATUS_CODES,mg as SITE_DEPLOYMENT_STATUSES,xc as SITE_DEPLOYMENT_STATUS_CODES,No as SITE_DESIGN_DENSITY_IDS,Kt as SITE_DESIGN_NOTES_END,on as SITE_DESIGN_NOTES_START,Rm as SITE_DESIGN_RADIUS_IDS,zv as SITE_EDIT_DURABLE_HISTORY_CAPABILITY,Ru as SITE_EDIT_MATERIALIZATION_MAX_FILE_CONTENT_BYTES,Ns as SITE_EDIT_MATERIALIZATION_MAX_FILE_COUNT,js as SITE_EDIT_MATERIALIZATION_MAX_TOTAL_CONTENT_BYTES,oc as SITE_EDIT_PAGE_COMPOSITION_SCHEMA_VERSION,$A as SITE_EDIT_PAGE_COMPOSITION_V2_CAPABILITY,ZS as SITE_EDIT_RUNTIME_CONTAINER_TAGS,JS as SITE_EDIT_RUNTIME_TEXT_TAGS,QS as SITE_EDIT_RUNTIME_VOID_ELEMENT_TAGS,FA as SITE_EDIT_SIGNED_MUTATION_CAPABILITY,Nd as SITE_EDIT_SOURCE_ALLOWED_APP_FILES,nr as SITE_EDIT_SOURCE_ALLOWED_DIRS,Dd as SITE_EDIT_SOURCE_ALLOWED_ROOT_FILES,Od as SITE_EDIT_SOURCE_ALLOWED_SYSTEM_FILES,Ts as SITE_EDIT_SOURCE_DELETE_CAPABILITY,jd as SITE_EDIT_TEXT_SOURCE_EXTENSIONS,Nm as SITE_EXTRA_REQUIREMENT_MAX_LENGTH,wv as SITE_HAS_ACTIVE_SUBSITES_ERROR_CODE,Pv as SITE_HAS_SUBSITES_ERROR_CODE,_P as SITE_LEADING_BODY_TOKEN,gP as SITE_LEADING_HEADING_TOKEN_NAMES,Zd as SITE_LOCALE_CODES,Rj as SITE_LOCALIZATION_STRUCTURES,qU as SITE_PLANNING_FROZEN_ERROR_CODE,WU as SITE_PLANNING_LOCKED_ERROR_CODE,HU as SITE_SITEMAP_DRAFT_OPERATION_MISMATCH_ERROR_CODE,zU as SITE_SITEMAP_DRAFT_STALE_ERROR_CODE,KU as SITE_STRUCTURE_CONFIRMATION_REQUIRED_ERROR_CODE,BU as SITE_STRUCTURE_CONFIRMATION_STALE_ERROR_CODE,_p as SITE_STRUCTURE_INVALID_ERROR_CODE,uP as SITE_WEIGHT_TOKEN_NAMES,qf as SITE_WORKFLOW_PROGRESS_STATUSES,Kf as SITE_WORKFLOW_PROGRESS_STEP_STATUSES,lg as SITE_WORKFLOW_STATUSES,Ec as SITE_WORKFLOW_STATUS_CODES,FG as SSE_STREAMS,ru as STEP5_KEYWORD_CATEGORIES,mu as STEP5_OPTIONAL_STRATEGY_KEYS,yi as STEP5_REQUIRED_STRATEGY_COUNT,Pn as STEP5_REQUIRED_STRATEGY_KEYS,yu as STEP5_SSE_EVENT_NAMES,De as STEP5_STRATEGY_COUNT,Qt as STEP5_STRATEGY_KEYS,ur as STEP5_STRATEGY_OPTION_IDS,Am as STEP6_AI_THEME_IDS,Lo as STEP6_AI_THEME_PRESETS,wm as STEP6_GENERATED_THEME_ID_PATTERN,uf as SUBSITE_GLOSSARY_ENTRY_MAX_CHARS,_f as SUBSITE_GLOSSARY_MAX_ENTRIES,Tf as SUBSITE_MOUNT_PATH_PATTERN,bf as SUBSITE_PALETTE_NOTE_MAX_CHARS,kf as SUBSITE_RESERVED_MOUNT_SEGMENTS,o0 as SUPPORTED_SITE_LOCALES,ai as SandboxSessionIdSchema,TT as SandboxSessionSchema,id as SandboxSessionStatusSchema,ZU as SaveBriefDraftRequestSchema,dF as SaveBriefDraftResponseSchema,OE as SaveGa4BindingDataSchema,FM as SaveGa4BindingRequestSchema,GM as SaveGa4BindingResponseSchema,hN as SaveSiteExtraRequirementRequestSchema,gG as SaveSiteSitemapDraftRequestSchema,hG as SaveSiteSitemapDraftResponseSchema,aR as SearchUnsplashMediaQuerySchema,rR as SearchUnsplashMediaResponseSchema,Jf as SiteBuildContextFileSchema,Zf as SiteBuildContextPayloadSchema,Qf as SiteBuildContextProvenanceSchema,Xf as SiteBuildContextProvenanceSourceSchema,Js as SiteBuildStatusSchema,vv as SiteDeletionBlockedDetailsSchema,eo as SiteDeploymentStatusSchema,ds as SiteDesignContextSchema,CR as SiteDesignDensitySchema,DR as SiteDesignMotionLevelSchema,Gi as SiteEditBoundaryKindSchema,fS as SiteEditCapabilityConstraintSchema,hS as SiteEditCapabilityModeSchema,Fi as SiteEditCapabilityModeViewSchema,Nv as SiteEditCapabilityReadRequestSchema,c_ as SiteEditClassNameSourceDiagnosticSchema,dt as SiteEditClassNameSourceRangeSchema,Xr as SiteEditClassNameSourceSchema,RA as SiteEditClassNameSourceStyleContextSchema,Yr as SiteEditClassNameSourceStylesheetSchema,Hs as SiteEditClassNameSourceWriteIntentSchema,fA as SiteEditCommandDiagnosticSchema,a_ as SiteEditCommandErrorSchema,B as SiteEditCompositionContextSchema,_e as SiteEditCompositionSelectorSchema,SS as SiteEditConstraintKindSchema,X_ as SiteEditDeletePageSourceOutputSchema,KS as SiteEditDynamicConfidenceSchema,zS as SiteEditDynamicDataBindingSchema,mm as SiteEditDynamicDataDetailSchema,lm as SiteEditDynamicDataSummarySchema,BS as SiteEditDynamicEvidenceSchema,cm as SiteEditDynamicSourceKindSchema,qS as SiteEditDynamicSourceTypeSchema,WS as SiteEditDynamicTargetKindSchema,Io as SiteEditEffectiveWriteTargetSchema,qv as SiteEditEventSchema,ys as SiteEditExecutionSceneSchema,Ki as SiteEditExternalSourceKindSchema,AA as SiteEditGetClassNameSourceCommandResultSchema,TA as SiteEditGetClassNameSourceInputSchema,kA as SiteEditGetClassNameSourceResultSchema,RC as SiteEditGetDocumentInputSchema,IC as SiteEditGetObjectEditContextInputSchema,Zk as SiteEditGetSourceFileInputSchema,Qk as SiteEditGetSourceTreeInputSchema,IA as SiteEditGetStyleContextInputSchema,Wi as SiteEditHistoryProvenanceSchema,RS as SiteEditHistoryReadOnlyRecoveryStatusSchema,bS as SiteEditHistoryRecoveryCodeSchema,yS as SiteEditHistoryRecoveryDiagnosticSchema,Vv as SiteEditHistoryResultSchema,Hv as SiteEditHistoryStatusModeSchema,TS as SiteEditHistoryStatusSchema,xS as SiteEditHistoryUnavailableReasonSchema,IS as SiteEditHistoryUnavailableStatusSchema,ES as SiteEditHistoryWritableStatusSchema,FC as SiteEditInitializeSessionInputSchema,V_ as SiteEditInsertNodeSpecSchema,Y_ as SiteEditInsertPageResourceOutputSchema,Pu as SiteEditMaterializationDataRequirementsSchema,wu as SiteEditMaterializationEntrySchema,Au as SiteEditMaterializationExportSchema,ku as SiteEditMaterializationFileSchema,fr as SiteEditMaterializationPathTemplateSchema,Ft as SiteEditMaterializationSchema,dc as SiteEditMaterializedComponentNodeSpecSchema,cc as SiteEditMoveTargetSchema,Nn as SiteEditMutationContextSchema,qi as SiteEditNodeCapabilitySnapshotSchema,kC as SiteEditObjectCapabilitiesSchema,wC as SiteEditObjectDetailSchema,vC as SiteEditObjectEditContextSchema,CC as SiteEditObjectStyleDetailSchema,PC as SiteEditObjectSummarySchema,l1 as SiteEditOperationCommandResultSchema,uc as SiteEditOperationErrorCodeSchema,_c as SiteEditOperationErrorSchema,Q_ as SiteEditOperationOutputSchema,$_ as SiteEditOperationParamsSchema,Xs as SiteEditOperationPayloadSchema,Ys as SiteEditOperationRequestSchema,H_ as SiteEditOperationResultTargetSchema,en as SiteEditOperationSelectionRefSchema,GS as SiteEditOperationSummarySchema,z_ as SiteEditOperationTargetSchema,Mn as SiteEditOperationTypeSchema,Wt as SiteEditOperationValueSchema,YA as SiteEditPageCompositionAnyVersionSchema,P_ as SiteEditPageCompositionAtomicKindSchema,O_ as SiteEditPageCompositionBoundaryModeSchema,x_ as SiteEditPageCompositionBusinessMemberSchema,b_ as SiteEditPageCompositionContainerSchema,Ln as SiteEditPageCompositionDiagnosticSchema,wi as SiteEditPageCompositionErrorCodeSchema,nc as SiteEditPageCompositionPlacementTargetSchema,E_ as SiteEditPageCompositionPlacementUnitSchema,A_ as SiteEditPageCompositionRuntimeRefSchema,k_ as SiteEditPageCompositionSchema,w_ as SiteEditPageCompositionSourceMemberKindSchema,y_ as SiteEditPageCompositionSourceMemberSchema,ac as SiteEditPageCompositionSourceRangeSchema,I_ as SiteEditPageCompositionSupportedSchema,T_ as SiteEditPageCompositionUnsupportedSchema,D_ as SiteEditPageCompositionV2BusinessMemberSchema,v_ as SiteEditPageCompositionV2ContainerSchema,j_ as SiteEditPageCompositionV2PlacementRelationSchema,M_ as SiteEditPageCompositionV2PlacementSchema,N_ as SiteEditPageCompositionV2PlacementUnitSchema,q_ as SiteEditPageCompositionV2Schema,C_ as SiteEditPageCompositionV2SourceMemberSchema,F_ as SiteEditPageCompositionV2SupportedSchema,G_ as SiteEditPageCompositionV2UnsupportedSchema,L_ as SiteEditPageCompositionV2WriteModeSchema,U_ as SiteEditPageCompositionVisualAnchorSchema,R_ as SiteEditPagePlacementOptionSchema,tc as SiteEditPagePlacementSchema,sc as SiteEditPageUnitResultTargetSchema,ic as SiteEditPageUnitTargetSchema,OS as SiteEditPatchPlanPatchSchema,iC as SiteEditPatchPlanSchema,To as SiteEditPropertiesSchema,g_ as SiteEditPropertyChangeSchema,vS as SiteEditPropertyCreationSchema,wS as SiteEditPropertyItemSchema,kS as SiteEditPropertyResolutionSchema,AS as SiteEditPropertySourceSchema,PS as SiteEditPropertySpreadSchema,zn as SiteEditProvenanceChainSchema,$S as SiteEditProvenanceHopSchema,TC as SiteEditRenderDocumentSchema,Bn as SiteEditRenderEntryRefSchema,HS as SiteEditRenderEntrySchema,rm as SiteEditRenderPageCompositionSchema,US as SiteEditRenderPageCompositionSupportedSchema,FS as SiteEditRenderPageCompositionUnsupportedSchema,MS as SiteEditRenderPagePlacementSchema,GA as SiteEditRequiredMutationContextEnvelopeSchema,e0 as SiteEditResolveSourceLocationInputSchema,dm as SiteEditSemanticSourceSchema,Zr as SiteEditSetPropsParamsSchema,m1 as SiteEditSignedOperationRequestSchema,ir as SiteEditSourceDeleteCapabilitySchema,Md as SiteEditSourceDirectoryPathSchema,Wd as SiteEditSourceFileBinaryPreviewUnavailableReasonSchema,Kd as SiteEditSourceFileBinaryResponseSchema,Yk as SiteEditSourceFileKindSchema,Ud as SiteEditSourceFileListItemSchema,Jk as SiteEditSourceFileResponseSchema,qd as SiteEditSourceFileTextResponseSchema,$s as SiteEditSourceIdentitySchema,Bd as SiteEditSourceLocationRangeSchema,t0 as SiteEditSourceLocationSchema,XS as SiteEditSourceLocatorRangeSchema,wo as SiteEditSourceLocatorSchema,xe as SiteEditSourcePathSchema,sr as SiteEditSourceTreeNodeSchema,Xk as SiteEditSourceTreeResponseSchema,Fd as SiteEditSourceTreeTruncationReasonSchema,Gd as SiteEditSourceTreeTruncationSchema,pc as SiteEditStyleBreakpointSchema,Jr as SiteEditStyleDraftPropertySchema,AC as SiteEditStyleModelSchema,mc as SiteEditStylePropertySchema,um as SiteEditStyleSourceSchema,lc as SiteEditStyleStateModeSchema,Ao as SiteEditTextSegmentSchema,pm as SiteEditTextSourceSchema,VS as SiteEditWriteTargetSchema,SN as SiteExtraRequirementResponseSchema,bb as SiteExtraRequirementSchema,mv as SiteGenerationLedgerResponseSchema,k as SiteIdSchema,$f as SiteLauncherPermissionSchema,Ee as SiteLocaleSchema,eG as SiteMediaIntentSchema,jT as SiteOperationLockIdSchema,Uf as SitePreviewActivateErrorCodeSchema,Gf as SitePreviewActivateFailedSchema,Ff as SitePreviewActivateReadySchema,BD as SitePreviewActivateResponseSchema,sM as SitePublishDomainCheckDataSchema,iM as SitePublishDomainCheckRequestSchema,oM as SitePublishDomainCheckResponseSchema,aM as SitePublishDomainOperationDataSchema,rM as SitePublishDomainOperationResponseSchema,cM as SitePublishDomainReconcileOperationResponseSchema,mM as SitePublishDomainRemediationConfirmRequestSchema,lM as SitePublishDomainRemediationConfirmResponseSchema,ms as SitePublishQualityTaskStatusSchema,GL as SitePublishRepairInputItemSchema,Gx as SitePublishRepairResultItemSchema,Ol as SitePublishRepairResultSchema,qL as SitePublishRepairTaskSnapshotSchema,Cl as SitePublishRepairTaskStatusSchema,zL as SitePublishWorkflowActiveResponseSchema,ri as SitePublishWorkflowIdSchema,Wx as SitePublishWorkflowMutationDataSchema,HL as SitePublishWorkflowMutationResponseSchema,Kx as SitePublishWorkflowPublishDataSchema,VL as SitePublishWorkflowPublishResponseSchema,Bx as SitePublishWorkflowQualityDataSchema,$L as SitePublishWorkflowQualityResponseSchema,Dt as SitePublishWorkflowRecordSchema,BL as SitePublishWorkflowRevisionRequestSchema,Ox as SitePublishWorkflowStatusSchema,Nx as SitePublishWorkflowStepSchema,jt as SiteRecordSchema,MT as SiteTemplateUpgradeStateIdSchema,zG as SiteThreadListQuerySchema,HG as SiteThreadListResponseSchema,YG as SiteThreadResponseSchema,La as SiteVersionIdSchema,FR as SiteVersionListItemSchema,Ss as SiteVersionRecordSchema,nt as SiteWorkflowIdSchema,Hf as SiteWorkflowProgressDataSchema,XD as SiteWorkflowProgressResponseSchema,Wf as SiteWorkflowProgressStatusSchema,zf as SiteWorkflowProgressStepSchema,Bf as SiteWorkflowProgressStepStatusSchema,bg as SiteWorkflowRecordSchema,D1 as SiteWorkflowSnapshotResponseSchema,no as SiteWorkflowSnapshotSchema,pg as SiteWorkflowStatusSchema,Ua as SiteWorkflowTaskRefIdSchema,O1 as SiteWorkflowTaskRefResponseSchema,Tc as SiteWorkflowTaskRefSchema,mG as SitemapAddBlockInputSchema,wa as SitemapAnswerSchema,rG as SitemapChangeBlockVariantInputSchema,RI as SitemapDeleteBlockInputSchema,lI as SitemapDraftBlockSchema,pI as SitemapDraftPageSchema,Wp as SitemapDraftRecordSchema,un as SitemapDraftSchema,EI as SitemapEditActorSchema,kI as SitemapEditErrorCodeSchema,wI as SitemapEditFailureSchema,TI as SitemapEditOperationSchema,pG as SitemapEditResultSchema,AI as SitemapEditSuccessSchema,uG as SitemapGenerationInputSchema,OI as SitemapGenerationOutcomeSchema,NI as SitemapGenerationReasonSchema,Lp as SitemapGenerationStageSchema,Te as SitemapIdSchema,PI as SitemapIntentPageSchema,oG as SitemapModelOutputSchema,uI as SitemapModelPageSchema,aG as SitemapMoveBlockInputSchema,cI as SitemapNavigationHrefSchema,Fe as SitemapNodeIdSchema,qp as SitemapRecordSchema,iG as SitemapResolverRequestSchema,sG as SitemapResolverResponseSchema,xI as SitemapResolverTargetsSchema,jp as SitemapRunInputSchema,bn as SitemapSchema,gI as SitemapSourceProvenanceSchema,_G as SitemapStreamEventSchema,Vj as SitemapTaskCreateRequestSchema,Zj as SitemapTaskCreateResponseSchema,Xy as SitemapTaskFailureErrorCodeSchema,Jj as SitemapTaskResponseSchema,II as SitemapUpdateBlockInstructionInputSchema,cG as SitemapUpdateBlockPropsInputSchema,VR as SitemapUserChoiceSchema,fn as SkillSelectionSchema,YR as SkillSelectionSourceSchema,Yp as SnapshotContentHashSchema,gd as SnapshotEditChangesSchema,_d as SnapshotEditPageChangeSchema,ud as SnapshotEditSectionChangeSchema,Pe as SnapshotFilePathSchema,A as SnapshotIdSchema,xt as SnapshotRecordSchema,Tp as SnapshotStatusSchema,lv as StartFillInRequestSchema,uF as StartFillInResponseSchema,yE as StartGa4AuthDataSchema,CM as StartGa4AuthRequestSchema,DM as StartGa4AuthResponseSchema,pa as StartGscAuthDataSchema,jl as StartGscAuthRequestSchema,Ll as StartGscAuthResponseSchema,K1 as StartSiteBuildRequestSchema,dO as StartSiteBuildResponseSchema,eb as StartSiteBuildResultSchema,WL as StartSitePublishWorkflowRequestSchema,GG as StartWorkspaceRunRequestSchema,qG as StartWorkspaceRunResponseSchema,Oc as Step2AiCrawlabilityAssessmentSchema,Xg as Step2FinalResultDataSourceSchema,Di as Step2FinalResultRequestSchema,Cw as Step2FinalResultResponseSchema,vw as Step2FinalResultSaveResponseSchema,Yg as Step2FinalResultSaveResultSchema,co as Step2FinalResultTypeSchema,Zg as Step2FinalResultViewSchema,Dc as Step2FinalScanCardKeySchema,mo as Step2FinalScanCardSchema,$g as Step2FinalScanResultSchema,Hn as Step2KnowledgeOpaqueIdSchema,bO as Step2KnowledgeScopeSchema,Tt as Step2PageRoleSchema,Nw as Step2PageSelectionRequestSchema,jw as Step2PageSelectionResponseSchema,zg as Step2SiteInitializationCrawlerErrorCodeSchema,Bg as Step2SiteInitializationStatusSchema,Pw as Step2SiteInitializationTaskResponseSchema,Hg as Step2SiteInitializationTaskSchema,lo as Step3AgentAnalysisSchema,oh as Step3AnalysisFindingSchema,Ww as Step3AnalysisJobResponseSchema,Mc as Step3AnalysisJobSchema,jc as Step3AnalysisJobStatusSchema,Kw as Step3AnalysisLatestResponseSchema,Nc as Step3AnalysisProgressSchema,ch as Step3AnalysisResultSchema,qw as Step3AnalysisScheduleResponseSchema,sh as Step3AnalysisScheduleSchema,Bw as Step3AnalysisSseFrameSchema,Fw as Step3AnalysisStartRequestSchema,Lc as Step3AnalysisSummarySchema,ih as Step3AnalystSchema,Gw as Step3AnalystsResponseSchema,$w as Step4DiagnosisResponseSchema,xi as Step5ActiveStrategyKeySchema,I0 as Step5CommitStrategyRequestSchema,T0 as Step5CommitStrategyResponseSchema,fu as Step5CommittedVersionSchema,vn as Step5DecisionSelectionIdSchema,uu as Step5EvidenceReferenceSchema,_u as Step5GenerationStatusSchema,hu as Step5JobStatusSchema,cu as Step5KeywordCategorySchema,wn as Step5KeywordEntrySchema,Ps as Step5KeywordLibrarySchema,u0 as Step5KeywordSearchBodySchema,fi as Step5KeywordSelectionSchema,Ii as Step5MarketCountrySchema,Ri as Step5MarketTypeSchema,dr as Step5OptionPresentationSchema,Cs as Step5OutputLocaleSchema,x0 as Step5RegenerateItemRequestSchema,E0 as Step5SaveDecisionRequestSchema,R0 as Step5SaveDecisionResponseSchema,vI as Step5SitemapDecisionSchema,DI as Step5SitemapRunInputSchema,CI as Step5SitemapSourceSchema,dG as Step5SitemapStartRequestSchema,b0 as Step5StartStrategyRequestSchema,y0 as Step5StartStrategyResponseSchema,gu as Step5StrategyDecisionInputSchema,Os as Step5StrategyDecisionSchema,Ds as Step5StrategyItemSchema,gr as Step5StrategyJobSchema,Ei as Step5StrategyKeySchema,_r as Step5StrategyOptionIdSchema,lu as Step5StrategyOptionSchema,pu as Step5StrategyPlanSchema,bu as Step5StrategySnapshotDataSchema,A0 as Step5StrategySseFrameSchema,Su as Step5StrategyVersionSnapshotSchema,du as Step5StructureDetailSchema,pb as Step6AiThemeCandidateSchema,$i as Step6ColorSeedsSchema,rN as Step6DesignAgentRecommendationsResponseSchema,eN as Step6DesignRecommendationGenerationInputSchema,Fo as Step6DesignRecommendationModelOutputSchema,db as Step6DesignRecommendationSchema,XO as Step6DesignRecommendationsRequestSchema,QO as Step6DesignRecommendationsResponseSchema,Om as Step6DesignSelectionSchema,Dm as Step6GeneratedThemeCardSchema,Sb as Step6GptDesignRecommendationModelOutputSchema,rv as StopWorkspaceGenerationRequestSchema,cv as StopWorkspaceGenerationResponseSchema,rD as SubsiteCopyEstimateRequestSchema,cD as SubsiteCopyEstimateResponseSchema,JC as SubsiteGlossariesSchema,hf as SubsiteGlossaryEntrySchema,Bi as SubsiteHexColorSchema,xD as SubsiteMountPathSchema,tD as SubsitePaletteLocalizationSchema,Sf as SubsitePaletteModeSchema,ff as SubsitePaletteSeedsSchema,eD as SubsiteSiteInfoSchema,pD as SubsiteSyncDiffComputeRequestSchema,dD as SubsiteSyncDiffComputeResponseSchema,Rf as SubsiteSyncDiffErrorCodeSchema,uD as SubsiteSyncDiffErrorResponseSchema,SD as SubsiteVisibleTextExportRequestSchema,fD as SubsiteVisibleTextExportResponseSchema,rg as TASK_EXECUTION_STATUSES,Rc as TASK_EXECUTION_STATUS_CODES,vF as TEMPLATE_UPGRADE_LOCK_LOST_ERROR_CODE,Mo as THEME_PRESETS,km as THEME_PRESET_IDS,bc as TaskExecutionStatusSchema,jf as TemplateUpgradeCasOutcomeSchema,hm as TemplateUpgradeErrorCodeSchema,Lf as TemplateUpgradeOutcomeCountsSchema,Of as TemplateUpgradeOutcomeSchema,Mf as TemplateUpgradeSnapshotDeletionCandidateSchema,mn as TemplateUpgradeStateSchema,Pf as TemplateUpgradeStatusSchema,Nf as TemplateUpgradeValidationStageSchema,Xe as TemplateVersionSchema,kF as TryAcquireTemplateUpgradeLockRequestSchema,AF as TryAcquireTemplateUpgradeLockResponseSchema,Vh as TypeInputsSchema,cf as USER_STOPPED_RUN_ERROR_CODES,ap as UnsplashDownloadLocationSchema,op as UnsplashMediaAssetSchema,QU as UpdateBriefRequestSchema,pF as UpdateBriefResponseSchema,kG as UpdateClarifyArchetypeRequestSchema,nA as UpdateCmsSeoSyncStateRequestSchema,bF as UpdateCurrentSnapshotManifestRequestSchema,eA as UpdatePageDirectoryReconcileStateRequestSchema,KL as UpdateSitePublishWorkflowStepRequestSchema,XU as UpdateSiteRequestSchema,$G as UpdateSiteThreadRequestSchema,j1 as UpdateSiteWorkflowWebsiteRequestSchema,ZO as UpdateStep6DesignSelectionRequestSchema,JO as UpdateStep6DesignSelectionResponseSchema,G1 as UpdateWorkflowTaskStatusRequestSchema,eR as UploadMediaLibraryAssetResponseSchema,vL as UpstreamPromptTemplateCatalogDataSchema,PL as UpstreamPromptTemplateConsumeDataSchema,Fy as UrlListCrawlerTaskCreateRequestSchema,UT as UsageRecordIdSchema,cR as UseUnsplashMediaRequestSchema,mR as UseUnsplashMediaResponseSchema,AT as UserIdSchema,oE as VCP_GSC_STATES,la as VcpGscStateSchema,Lx as VcpQualityRemediationItemSchema,vl as VcpQualityResultSchema,fa as VisualHintsSchema,HR as VisualThemeSchema,Fh as WEIGHT_STYLE_IDS,zc as WEIGHT_STYLE_PRESETS,C1 as WORKFLOW_DEFINITIONS_V1,to as WORKFLOW_DEFINITION_REGISTRY,sg as WORKFLOW_FLOW_TYPES,dg as WORKFLOW_MENU_STATES,og as WORKFLOW_NODE_CODES,ag as WORKFLOW_TASK_TYPES,cw as WORKSPACE_ATTACHMENT_BOUND_ERROR_CODE,gw as WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_ERROR_CODE,uw as WORKSPACE_ATTACHMENT_CAPTURE_BUSY_ERROR_CODE,dw as WORKSPACE_ATTACHMENT_CAPTURE_FAILED_ERROR_CODE,_w as WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT_ERROR_CODE,hw as WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE_ERROR_CODE,rw as WORKSPACE_ATTACHMENT_LIMIT_ERROR_CODE,Mg as WORKSPACE_ATTACHMENT_MEDIA_TYPES,sw as WORKSPACE_ATTACHMENT_TARGET_BASE64_BYTES,aw as WORKSPACE_ATTACHMENT_TOO_LARGE_ERROR_CODE,iw as WORKSPACE_ATTACHMENT_UNBOUND_TTL_MS,ow as WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT_ERROR_CODE,pw as WORKSPACE_ATTACHMENT_URL_REJECTED_ERROR_CODE,VP as WORKSPACE_CHECK_INCOMPLETE_ERROR_CODE,cx as WORKSPACE_FILE_MUTATION_TOOL_NAMES,YP as WORKSPACE_FILL_IN_INTERRUPTED_ERROR_CODE,$P as WORKSPACE_GENERATION_STOPPED_ERROR_CODE,zP as WORKSPACE_MAX_PAGE_ATTEMPTS,BP as WORKSPACE_MAX_RESUME_COUNT,KP as WORKSPACE_RUN_HEARTBEAT_INTERVAL_MS,WP as WORKSPACE_RUN_LEASE_MS,XP as WORKSPACE_RUN_LEASE_SUPERSEDED_ERROR_CODE,QP as WORKSPACE_RUN_NOT_ACTIVE_ERROR_CODE,HP as WORKSPACE_RUN_RESUME_EXHAUSTED_ERROR_CODE,lw as WORKSPACE_URL_CAPTURE_WINDOW_MS,eq as WORKSPACE_WEBSOCKET_CONTRACT,qe as WeightStyleIdSchema,Sc as WorkflowClientCapabilitiesSchema,Ic as WorkflowDefinitionVersionSchema,tn as WorkflowFlowTypeSchema,fg as WorkflowMenuItemSchema,ug as WorkflowMenuStateSchema,It as WorkflowNodeCodeSchema,fc as WorkflowTaskTypeSchema,fw as WorkspaceAttachmentFromUrlRequestSchema,ao as WorkspaceAttachmentMediaTypeSchema,Sw as WorkspaceAttachmentSchema,rT as WorkspaceClientMessageSchema,uR as WorkspaceDesignApplyRequestSchema,_R as WorkspaceDesignApplyResponseSchema,gR as WorkspaceDesignCurrentResponseSchema,va as WorkspaceDiagnosticSchema,hT as WorkspaceDirectEditFileSchema,gT as WorkspaceDirectEditPathSchema,Jp as WorkspaceDirectEditPostActionSchema,iq as WorkspaceDirectEditRequestSchema,oq as WorkspaceDirectEditResponseSchema,Ca as WorkspaceExecutionDiagnosticsSchema,PG as WorkspaceExecutionPlanSchema,tr as WorkspaceGenerationLedgerEventSchema,kn as WorkspaceGenerationLedgerSchema,_T as WorkspaceMediaRequestSchema,xd as WorkspaceOmissionKindSchema,Ed as WorkspaceOmissionReasonSchema,er as WorkspaceOmissionSchema,tm as WorkspacePageCheckpointSchema,Id as WorkspacePageOutcomeSchema,Rd as WorkspacePageResultSchema,Na as WorkspacePlanDependencySchema,zp as WorkspacePlanSummarySchema,BI as WorkspacePlanTaskKindSchema,Oa as WorkspacePlanTaskSchema,J_ as WorkspaceResourceKindSchema,tg as WorkspaceResourceNavigationSelectionSchema,hc as WorkspaceResourceOperationClientMessageSchema,eg as WorkspaceResourceOperationSummarySchema,ng as WorkspaceResourceOperationTransientInputSchema,ov as WorkspaceRunControlInputResponseSchema,tv as WorkspaceRunHeartbeatRequestSchema,nv as WorkspaceRunHeartbeatResponseSchema,fs as WorkspaceRunKindSchema,mS as WorkspaceRunResumePrincipalSchema,aT as WorkspaceSelectedComponentSchema,mT as WorkspaceServerMessageSchema,lG as WorkspaceSitemapEditRequestSchema,oT as WorkspaceSocketDescriptorSchema,ET as WorkspaceSourceFileBinaryResponseSchema,yT as WorkspaceSourceFileKindSchema,td as WorkspaceSourceFileListItemSchema,aq as WorkspaceSourceFilePathQuerySchema,rq as WorkspaceSourceFileResponseSchema,xT as WorkspaceSourceFileTextResponseSchema,ed as WorkspaceSourcePathSchema,UI as WorkspaceSuggestionSchema,Kp as WorkspaceSuggestionsSchema,FI as WorkspaceSuggestionsSourceSchema,Hp as WorkspaceTaskCountsSchema,JG as WorkspaceWebSocketMessageSchema,ZG as WorkspaceWebSocketMessageTypeSchema,Da as WorkspaceWorkerGroupSchema,Pa as WorkspaceWorkerPhaseSchema,vG as WorkspaceWorkerResultSchema,Vt as WorkspaceWorkerStatusSchema,DN as applicationTemplateCatalogDataSchema,CN as applicationTemplateConsumeDataSchema,vN as applicationTemplateV1Schema,nP as assertDeploymentTransition,BM as assertFillInTargetsOmitted,$1 as assertSiteBuildStatusTransition,V1 as assertTaskExecutionStatusTransition,bo as availableFontWeights,qj as buildCmsIdentityHeaders,WM as buildE2bBrowserPreviewUrl,YL as buildFinalSitePublishQualityResult,tN as buildStep6FallbackThemeCards,tO as canEnterLauncher,nO as canPublishSite,ia as canonicalizeFormDesignJson,CL as canonicalizeLauncherPromptTemplateOperation,Vr as canonicalizePageSlug,NP as checkGlobalsCssEdit,Vs as classifySiteEditPropertyName,z0 as cmsPagePreviewUrlPath,v0 as compareTemplateVersions,oC as composeSiteEditRepeatInstanceKey,yj as computeFormDesignOperationFingerprint,Is as computeSiteEditCompositionKey,f_ as computeSiteEditSourceIdentityKey,oi as containsSensitiveData,Ek as countLedgerAccessiblePages,Rk as countLedgerProcessedPages,KE as countSitemapStructure,r_ as createSiteEditCommandFailureSchema,$r as createSiteEditCommandResultSchema,zs as createSiteEditCommandSuccessSchema,SG as createSiteSitemapDraftCreationKey,Tw as createSitemapResolverAnswerSheetSchema,iN as defaultStep6Selection,cE as deriveVcpGscState,mE as doesGscPropertyMatchDomain,VE as estimateNavLabelWidth,Ig as findWorkflowDefinition,Rg as findWorkflowDefinitionInRegistry,ho as fontStack,Ry as formDesignOperationFingerprintInput,Yh as formatSiteDesignNotes,iP as getDeploymentHappyPathTransitions,eP as getDeploymentTransitionPredecessors,Jw as getDeploymentTransitionTargets,Bc as getFontPairing,Tm as getMotionPreset,Pm as getSiteDesignThemeRadius,As as getSiteEditSourceDeleteProtectionReason,zx as getSitePublishRepairItems,FO as getThemePreset,Tg as getWorkflowDefinition,z1 as getWorkflowNodeIndex,uk as hasAnyBusinessFact,Kn as hasDesignTokenBlock,iD as hasLockedSeeds,bj as hashAffectedFormDesignFiles,fj as hashCmsFormSchemaProjection,ns as hashFormDesignJson,Sj as hashFormSpec,UE as homeLabelForLocale,zr as isCanonicalPageSlug,Yf as isCmsMainProductsWithinLimit,hR as isCmsNavigationHref,B0 as isCmsPageSelectable,Ir as isCmsTemplateUrlPath,Ok as isConsentGranted,Ih as isDeploymentActiveStatus,tP as isDeploymentTerminalStatus,pf as isExactEditEngineVersion,zT as isExternalSiteEditInfrastructureReason,nj as isFormSpecLocalizableFieldPath,k0 as isKnownStep5SseEventName,Iv as isMigrationProductsPresetBlockLabel,Rv as isMigrationProductsPresetPageTitle,bL as isModelFileMutationToolName,c0 as isNonLatinSiteLocale,mi as isPageTemplateCandidateEntryPath,Oj as isPlatformMaterializedFile,wf as isReservedSubsiteMountSegment,Hd as isSiteEditDesignDocumentPath,Tu as isSiteEditMaterializationPathTemplate,of as isSiteEditRuntimeContainerTag,af as isSiteEditRuntimeTextTag,OC as isSiteEditRuntimeVoidElementTag,n0 as isSiteEditSourceDeleteProtectedPath,zd as isSiteEditSourceDirectoryPath,or as isSiteEditSourcePath,ks as isSiteEditTextSourcePath,Hx as isSitePublishRepairResultSuccessful,wj as isSiteStructureKnownFieldPath,Aj as isSiteStructureLocalizableFieldPath,f0 as isStep5RequiredStrategyKey,ps as isTopLevelPage,WC as isUserStoppedRunErrorCode,H1 as isWorkflowTaskTypeForNode,yL as isWorkspaceFileMutationToolName,zl as listChildPages,jS as makeSiteEditRepeatInstanceKey,GE as markAllPagesInHeader,Ev as migrationProductsCopyForLocale,FE as moreLabelForLocale,$E as navLabelCollisionKey,GN as normalizeCmsApplicationSlug,My as normalizeCmsPublicApiBase,Qm as normalizeFormOptionLabelIdentity,ii as normalizeGscDomain,$a as normalizePageTemplatePagePath,ls as normalizeStructureTitle,WE as orderNavigationLinksByStructure,Hl as orderSitemapPagesForDisplay,o_ as pageSlugToRouteFilePath,H0 as parseCmsPageDirectory,_v as parseComponentI18nResourcesJson,NE as parseE2bPreviewProxyDomain,df as parseExactEditEngineVersion,Bk as parseSiteEditCompositionKey,LS as parseSiteEditRepeatInstanceKey,KA as parseSiteEditSourceIdentityKey,ro as parseWorkspaceAttachmentImagePath,cj as projectFormSpecToCmsSchema,aS as readColorScheme,ji as readDesignTokens,vP as readGlobalsDesignValues,$c as readSiteDesignNotes,yw as readWorkspaceAttachmentReferences,jE as reconcileSitemapNavigation,Fj as resolveCmsPublicRuntimeBinding,vh as resolveFont,nn as resolveFontDisplayName,rj as resolveFormTemplateText,B1 as resolvePublishedWorkflowDefinition,bk as resolveRedisConnectionConfig,YC as resolveRequestedEditEngineVersion,lr as resolveSelectableSiteLocale,NC as resolveSiteEditRuntimeOperationSummary,r0 as resolveSiteLocaleFromIso6393,a0 as resolveSiteTextDirection,_b as resolveStep6RadiusId,gb as resolveStep6WeightStyle,XC as resolveSystemCurrentEditEngineVersion,KN as resolveTemplateFormScene,fP as resolveTryOnFontWeights,kg as selectPublishedWorkflowDefinition,Gk as selectReferenceVisualImage,R1 as siteBuildStatusFromCode,A1 as siteBuildStatusToCode,I1 as siteDeploymentStatusFromCode,w1 as siteDeploymentStatusToCode,Mh as siteFontVariables,zh as siteLeadingBody,SP as siteLeadingHeadingVariables,hP as siteWeightVariables,T1 as siteWorkflowStatusFromCode,P1 as siteWorkflowStatusToCode,gf as splitSubsiteGlossaryEntry,hb as step6GptVisualIdentity,EP as stripSiteDesignNotes,aC as stripSiteEditRepeatInstanceKeys,k1 as taskExecutionStatusFromCode,v1 as taskExecutionStatusToCode,nN as toStep6GenerationVisualHints,Hr as tryCanonicalizeAsciiPageSlug,RP as upsertSiteDesignNotes,om as validateComponentI18nResources,ij as validateFormSpecIdentityTransition,BE as validateSitemapStructure,bw as workspaceAttachmentImagePath,PP as writeColorScheme,wP as writeDesignTokens};
|