1import{An as d,Dt as D,Ft as c,Kt as y,Nn as F,Qn as _,Wn as e,_n as a,ar as M,ir as G,jn as t,jt as s,nr as O,wt as r}from"./schemas-BWAwCoAd.js";import{n as v}from"./iso-bAQt4Unr.js";import{t as X}from"./media-asset-selection-BgHbf2Uj.js";var Q=1024;function Y(i){return i.length>0&&new TextEncoder().encode(i).byteLength<=Q&&!i.startsWith("/")&&!i.includes("\\")&&Array.from(i).every(o=>{const n=o.charCodeAt(0);return n>31&&n!==127})&&i.split("/").every(o=>o.length>0&&o!=="."&&o!==".."&&o.toLowerCase()!==".git")}var T=e().refine(Y,"File path must be a safe relative POSIX path."),w=t({path:T,mediaType:e().min(1),sizeBytes:d().int().nonnegative(),blobSha:e().regex(/^[a-f0-9]{40}$/i)}),Z=y("kind",[w.extend({kind:a("text"),content:e()}).strict(),w.extend({kind:a("binary")}).strict()]),J=t({entryPath:a("index.html"),files:s(Z)}).strict(),ee=t({path:T,content:e()}).strict(),te=r(["low","medium","high"]),ie=r(["workers-ai-glm","workers-ai-kimi","openai-gpt-5.5","anthropic-claude-sonnet-4.6","anthropic-claude-opus-4.8","google-gemini-3.5-flash"]),Oe=e().min(1).max(200),E=r(["landing-pages","postcards","ads"]),Te=r(["landing-pages","postcards"]),K=e().regex(/^\+[1-9]\d{6,14}$/,"Phone number must use E.164 format."),L=r(["landing_page","postcard","ad_composition"]),Ee=r(["generated_ad","google_ads_ad","google_pmax_asset_group","meta_ad"]),N=r(["landing_page","postcard","ad_composition"]),h=r(["landing_page_responsive","postcard_4x6_landscape","postcard_4x6_portrait","postcard_6x11_landscape","postcard_6x11_portrait","ad_google_pmax_landscape","ad_google_pmax_square","ad_meta_feed_square","ad_meta_feed_portrait","ad_meta_feed_video_square_animated","ad_meta_feed_video_portrait_animated"]),ae=r(["single_document","postcard_pair"]),p=r(["document","front","back"]),B=r(["responsive_document","postcard_4x6_landscape_canvas","postcard_4x6_portrait_canvas","postcard_6x11_landscape_canvas","postcard_6x11_portrait_canvas","ad_google_pmax_landscape_canvas","ad_google_pmax_square_canvas","ad_meta_feed_square_canvas","ad_meta_feed_portrait_canvas","ad_meta_feed_video_square_canvas","ad_meta_feed_video_portrait_canvas"]),b=r(["title","landing_page_method","landing_page_template","landing_page_direction","landing_page_appointment_booking","destination_url","tracking_phone_number","postcard_size","postcard_orientation","postcard_source","postcard_existing_artifact","postcard_existing_usage","postcard_upload_path","postcard_upload_usage","postcard_upload_instructions","postcard_style","ad_creative_kind","ad_target_placements","selected_source_assets"]),$=r(["landing_pages","postcards","ads"]),P=r(["views","leads","conversion_rate","qr_scans","print_readiness","platform","placement","publication_status"]),k=r(["edit_text","set_style","set_link","insert_html","replace_image","delete_element","reorder","move","resize","rotate","crop","edit_source","undo","redo","ai_revision","view_history"]),I=r(["html_download","postcard_front_png","postcard_back_png","postcard_paired_pdf","ad_png"]),x=r(["landing_page_preview","landing_page_publication","google_ads_publication","meta_ads_publication"]),A=r(["settings_domain_id","subdomain","connection_id","customer_id","campaign_uuid","ad_group_uuid","ad_account_id","ad_set_uuid","page_id","image_hash","rendered_output_id"]),re=r(["artifact_catalog","generation","delivery"]),g=t({workspaceId:e().min(1),collection:E,artifactKind:L,artifactKey:e().min(1),profileId:h}).strict().superRefine((i,o)=>{const n={"landing-pages":"landing_page",postcards:"postcard",ads:"ad_composition"},l={"landing-pages":"landing_page_",postcards:"postcard_",ads:"ad_"};i.artifactKind!==n[i.collection]&&o.addIssue({code:"custom",path:["artifactKind"],message:"Artifact kind does not belong to the selected HTML Media collection."}),i.profileId.startsWith(l[i.collection])||o.addIssue({code:"custom",path:["profileId"],message:"Artifact profile does not belong to the selected HTML Media collection."})}),H=t({id:p,label:e().min(1),path:r(["index.html","front.html","back.html"])}).strict(),oe=y("kind",[t({id:a("single_document"),kind:a("single_document"),surfaces:_([H.extend({id:a("document"),path:a("index.html")}
1).strict()])}).strict(),t({id:a("postcard_pair"),kind:a("paired_surfaces"),surfaces:_([H.extend({id:a("front"),path:a("front.html")}).strict(),H.extend({id:a("back"),path:a("back.html")}).strict()])}).strict()]),q=t({minimum:d().positive(),maximum:d().positive(),initial:d().positive()}).strict().superRefine((i,o)=>{(i.minimum>i.initial||i.initial>i.maximum)&&o.addIssue({code:"custom",path:["initial"],message:"Initial zoom must be bounded."})}),se=y("kind",[t({id:a("responsive_document"),kind:a("responsive_document"),viewportPresets:_([a("desktop"),a("tablet"),a("mobile")]),viewportWidths:t({desktop:D(),tablet:a(768),mobile:a(375)}).strict(),zoom:q}).strict(),t({id:B.exclude(["responsive_document"]),kind:a("fixed_artboard"),width:d().int().positive(),height:d().int().positive(),unit:a("px"),contentScale:d().positive(),zoom:q}).strict()]),de=t({value:e().min(1),label:e().min(1),description:e().min(1).optional(),preview:t({summary:e().min(1),sections:s(e().min(1)).min(1)}).strict().optional()}).strict(),ne=t({id:b,kind:r(["text","url","single_select","multi_select","phone_number","file_upload","source_media"]),label:e().min(1),description:e().min(1).optional(),required:c(),options:s(de).min(1).optional(),maximumSelections:d().int().positive().optional(),acceptedMimeTypes:s(e().min(1)).min(1).optional(),maximumFileSizeBytes:d().int().positive().optional(),visibleWhen:s(t({fieldId:b,value:e().min(1)}).strict()).min(1).optional()}).strict().superRefine((i,o)=>{(i.kind==="single_select"||i.kind==="multi_select")!=!!i.options&&o.addIssue({code:"custom",path:["options"],message:"Select fields require options and non-select fields prohibit them."}),i.maximumSelections&&i.kind!=="multi_select"&&o.addIssue({code:"custom",path:["maximumSelections"],message:"Only multi-select fields may declare a maximum selection count."}),i.kind==="file_upload"!=!!(i.acceptedMimeTypes&&i.maximumFileSizeBytes)&&o.addIssue({code:"custom",path:["acceptedMimeTypes"],message:"File upload fields require accepted MIME types and a maximum file size."})}),le=t({trackingPhoneNumberUuid:M(),phoneNumber:K,friendlyName:e().trim().min(1)}).strict(),Ke=t({options:s(le)}).strict(),z=t({trackingPhoneNumberUuid:M().nullable(),phoneNumber:K.nullable(),friendlyName:e().trim().min(1).nullable(),eligible:c()}).strict(),me=t({id:$,minimumSelections:d().int().nonnegative(),maximumSelections:d().int().positive(),purposes:s(r(["ad_creative","postcard_main","postcard_secondary","landing_hero","landing_gallery"])).min(1),requireReview:a(!0)}).strict().superRefine((i,o)=>{i.minimumSelections>i.maximumSelections&&o.addIssue({code:"custom",path:["minimumSelections"],message:"Minimum selections cannot exceed maximum selections."})}),ce=t({id:P,label:e().min(1),format:r(["integer","percentage","text","status"])}).strict(),pe=t({id:k,group:r(["text","style","structure","image","order","geometry","source","history","ai"]),label:e().min(1),requiresSelection:c(),mutatesSnapshot:c()}).strict(),ue=t({id:I,label:e().min(1),format:r(["html","png","pdf"]),surfaceIds:s(p).min(1),asynchronous:c()}).strict(),fe=t({id:x,label:e().min(1),destination:r(["hosted_landing_page","google_ads","meta_ads"]),requiresConfirmation:a(!0),fields:s(t({id:A,control:r(["text","campaign_select","domain_select"]),label:e().min(1),placeholder:e().min(1),inputMode:r(["text","numeric"]),required:c()}).strict())}).strict(),ve=t({id:h,definitionId:N,topologyProfileId:ae,canvasProfileId:B,commandIds:s(k),outputIds:s(I),deliveryIds:s(x)}).strict(),ge=t({id:N,collection:E,artifactKind:L,label:e().min(1),pluralLabel:e().min(1),profileIds:s(h).min(1),defaultProfileId:h,creationFieldIds:s(b),sourcePolicyId:$,metricIds:s(P)}).strict().superRefine((i,o)=>{i.profileIds.includes(i.defaultProfileId)||o.addIssue({code:"custom",path:["defaultProfileId"],message:"Default profile must be one of the definition profiles."})}),R=t({id:re,label:e().min(1),responsibility:e().min(1)}).strict(),S=t({surfaceId:p,path:r(["index.html","front.html","back.html"]),html:e().min(1)}).strict(),V=y("topology",[t({artifact:g,topology:a("single_document"),files:_([S.extend({surfaceId:a("document"),path:a("index.html")}
1).strict()])}).strict(),t({artifact:g,topology:a("postcard_pair"),files:_([S.extend({surfaceId:a("front"),path:a("front.html")}).strict(),S.extend({surfaceId:a("back"),path:a("back.html")}).strict()])}).strict()]),f=t({artifact:g,commitSha:e().regex(/^[a-f0-9]{40}$/i)}).strict(),j=r(["save_revision","ai_edit","template_deploy","publish_snapshot"]),_e=t({locationId:e().min(1),bodyUiFamilyId:e().min(1).nullable(),displayHeadingFamilyId:e().min(1).nullable()}).strict(),Le=t({version:a("html-media-authoring-context-v1"),locationOrder:s(e().min(1)).min(1),projectionRevisions:s(t({locationId:e().min(1),revision:e().min(1)}).strict()).min(1),fontSelections:s(_e),mediaEligibilityRevision:e().min(1)}).strict().superRefine((i,o)=>{const n=i.projectionRevisions.map(({locationId:l})=>l);(new Set(i.locationOrder).size!==i.locationOrder.length||i.locationOrder.length!==n.length||i.locationOrder.some((l,u)=>l!==n[u]))&&o.addIssue({code:"custom",path:["projectionRevisions"],message:"Projection revisions must exactly match the ordered location set."}),(i.fontSelections.length!==i.locationOrder.length||i.fontSelections.some(({locationId:l},u)=>l!==i.locationOrder[u]))&&o.addIssue({code:"custom",path:["fontSelections"],message:"Font selections must exactly match the ordered location set."})}),Ne=t({url:e().min(1).max(8192),expectedEligibilityRevision:e().min(1).optional()}).strict(),Be=t({url:e().min(1),status:r(["included","excluded","stale","unresolved","external"]),stableMediaId:e().min(1).optional(),eligibilityRevision:e().min(1).optional()}).strict().superRefine((i,o)=>{const n=i.stableMediaId!==void 0,l=i.eligibilityRevision!==void 0;n!==l&&o.addIssue({code:"custom",path:n?["eligibilityRevision"]:["stableMediaId"],message:"stable media ID and eligibility revision must be supplied together"}),["included","excluded","stale"].includes(i.status)&&(!n||!l)&&o.addIssue({code:"custom",path:["status"],message:"resolved managed references require stable identity and eligibility revision"}),(i.status==="external"||i.status==="unresolved")&&(n||l)&&o.addIssue({code:"custom",path:["status"],message:"external and unresolved references cannot carry managed media identity"})}),C=t({identity:f,name:e().nullable(),type:j,basedOnCommitSha:e().regex(/^[a-f0-9]{40}$/i).nullable(),createdBy:e().min(1),createdAt:v(),trackingPhoneNumberUuid:M().nullable()}).strict(),$e=t({revisions:s(C),nextCursor:d().int().positive().nullable(),atSoftCap:c()}).strict(),ze=t({snapshot:V,fileEdits:s(ee).optional(),restoreCommitSha:e().regex(/^[a-f0-9]{40}$/i).optional(),basedOnCommitSha:e().regex(/^[a-f0-9]{40}$/i).optional(),name:e().trim().min(1).max(120).optional(),revisionType:j.default("save_revision")}).strict(),je=t({revision:C,snapshot:V,repository:J.optional()}).strict(),We=t({trackingPhoneNumberUuid:M().nullable(),basedOnCommitSha:e().regex(/^[a-f0-9]{40}$/i),snapshot:V}).strict(),Ue=t({changed:c(),binding:z,revision:C,snapshot:V}).strict(),Ge=t({selectionVersion:d().int().nonnegative(),targetId:e().min(1),objectTargetId:e().min(1).optional(),surfaceId:p,hasEditableCopy:c(),commandIds:s(k)}).strict().superRefine((i,o)=>{!i.hasEditableCopy&&i.commandIds.includes("edit_text")&&o.addIssue({code:"custom",path:["commandIds"],message:"Text editing requires non-empty editable copy."})}),m=t({surfaceId:p,targetId:e().min(1),selectionVersion:d().int().nonnegative()}).strict(),he=t({id:e().regex(/^[a-f0-9]{64}$/),family:e().trim().min(1).max(64),url:e().url(),contentType:r(["font/woff2","font/woff","font/ttf","font/otf"])}).strict(),ye=r(["all","desktop","mobile"]),Xe=y("command",[m.extend({command:a("edit_text"),text:e()}).strict(),m.extend({command:a("set_style"),property:e().min(1),value:e(),fontFace:he.optional(),scope:ye.optional()}).strict(),m.extend({command:a("set_link"),href:e().min(1).max(2048)}).strict(),t({command:a("insert_html"),surfaceId:p,html:e().min(1),placement:r(["before","after","inside","body","canvas"]),targetId:e().min(1).optional(),x:d().nonnegative().optional(),y:d().nonnegative().optional()}).strict(),m.extend({command:a("replace_image"),src:e().min(1),alt:e().optional()}).strict(),m.extend({command:a("delete_element")}
1).strict(),m.extend({command:a("reorder"),direction:r(["forward","backward","front","back"])}).strict(),m.extend({command:a("move"),geometry:t({x:d().finite(),y:d().finite()}).strict()}).strict(),m.extend({command:a("resize"),geometry:t({width:d().finite().positive(),height:d().finite().positive(),x:d().finite().optional(),y:d().finite().optional()}).strict()}).strict(),m.extend({command:a("rotate"),geometry:t({degrees:d().finite()}).strict()}).strict(),m.extend({command:a("crop"),geometry:t({x:d().finite().min(0).max(100),y:d().finite().min(0).max(100)}).strict()}).strict(),t({command:a("edit_source"),surfaceId:p,html:e().min(1)}).strict()]),xe=r(["queued","rendering","ready","stale","failed"]),be=r(["queued","rendering","ready","failed"]),Me=t({outputId:e().min(1),artifact:g,descriptorId:I,sourceRevision:f,state:xe,attemptState:be,downloadPath:e().min(1).nullable(),failureMessage:e().min(1).nullable(),createdAt:v(),updatedAt:v()}).strict(),Qe=t({descriptorId:I,idempotencyKey:e().min(1).max(200)}).strict(),Ye=t({idempotencyKey:e().min(1).max(200)}).strict(),Ze=t({outputs:s(Me)}).strict(),Ie=t({format:r(["png","pdf"]),mimeType:r(["image/png","application/pdf"]),width:d().int().positive(),height:d().int().positive(),contentScale:d().positive().default(1),surfaces:s(t({surfaceId:p,path:r(["index.html","front.html","back.html"])}).strict()).min(1),storagePath:e().startsWith("html-media/rendered/"),filename:e().regex(/^[^/"\r\n]+$/)}).strict().superRefine((i,o)=>{i.format==="png"&&i.surfaces.length!==1&&o.addIssue({code:"custom",path:["surfaces"],message:"PNG render plans require exactly one surface."}),(i.format==="png"&&i.mimeType!=="image/png"||i.format==="pdf"&&i.mimeType!=="application/pdf")&&o.addIssue({code:"custom",path:["mimeType"],message:"Render MIME type must match its format."});const n=i.surfaces.map(u=>u.path);new Set(n).size!==n.length&&o.addIssue({code:"custom",path:["surfaces"],message:"Render plan surfaces must be unique."});const l={document:"index.html",front:"front.html",back:"back.html"};i.surfaces.some(u=>u.path!==l[u.surfaceId])&&o.addIssue({code:"custom",path:["surfaces"],message:"Render surfaces must use their canonical revision path."})}),Je=t({workspaceId:e().min(1),outputId:e().min(1),workflowId:e().min(1),repoName:e().min(1),sourceCommitSha:e().regex(/^[a-f0-9]{40}$/i),claimLeaseMs:d().int().positive().max(6e5),plan:Ie}).strict().superRefine((i,o)=>{i.plan.storagePath.startsWith(`html-media/rendered/${i.workspaceId}/`)||o.addIssue({code:"custom",path:["plan","storagePath"],message:"Render storage path must remain inside its workspace prefix."})}),Ve=r(["draft","ready","publishing","published","failed","stale"]),He=t({fieldId:A.nullable(),message:e().min(1)}).strict(),Re=F(A,e().trim().max(500)).default({}),et=t({artifact:g,descriptorId:x,sourceRevision:f,state:r(["draft","ready"]),destinationLabel:e().min(1),issues:s(He)}).strict(),Se=t({deliveryId:e().min(1),artifact:g,descriptorId:x,sourceRevision:f,publishedRevision:f.nullable(),state:Ve,publicUrl:G().optional(),destinationLabel:e().min(1),failureMessage:e().min(1).nullable(),createdAt:v(),updatedAt:v()}).strict(),tt=t({deliveries:s(Se)}).strict(),Pe=t({descriptorId:x,sourceRevision:f,fields:Re}).strict(),it=Pe.extend({confirmed:a(!0),idempotencyKey:e().min(1).max(200)}).strict(),at=t({deliveryId:e().min(1),sourceRevision:f,confirmed:a(!0),idempotencyKey:e().min(1).max(200)}).strict(),ke=r(["creating","draft","ready","failed","migration_eligible"]),Ae=t({descriptorId:P,value:O([d(),e(),D()])}).strict(),W=t({artifact:g,routeSlug:e().min(1),title:e().min(1),state:ke,metrics:s(Ae),headCommitSha:e().regex(/^[a-f0-9]{40}$/i).nullable(),createdAt:v(),updatedAt:v()}).strict(),U=t({definition:ge,profiles:s(ve).min(1),topologyProfiles:s(oe).min(1),canvasProfiles:s(se).min(1),creationFields:s(ne),sourcePolicy:me,metrics:s(ce),commands:s(pe),outputs:s(ue),deliveries:s(fe),ports:_([R.extend({id:a("artifact_catalog")}).strict(),R.extend({id:a("generation")}).strict(),R.extend({id:a("delivery")}).strict()])}).strict(),Ce=t({summary:W,configuration:U,phoneBinding:z.optional()}).strict(),rt=t({configuration:U,artifacts:s(W)}).strict(),ot=t({artifact:Ce}).strict(),st=t({title:e().trim().min(1).max(120)}).strict(),we=O([e().max(2e6),s(e().max(2e3)).max(24)]),dt=t({idempotencyKey:e().min(1).max(200),requestFingerprint:e().min(1).max(500),modelFamilyId:ie.optional(),modelId:e().min(1).max(200).optional(),reasoningEffort:te.optional(),targetProfileIds:s(h).min(1).max(6),fields:F(b,we).default({}),sourceReview:t({reviewed:a(!0),selectedSourceAssets:X}).strict()}).strict().superRefine((i,o)=>{new Set(i.targetProfileIds).size!==i.targetProfileIds.length&&o.addIssue({code:"custom",path:["targetProfileIds"],message:"Target profiles must be unique."})}),nt=t({idempotencyKey:e().min(1).max(200),instructions:e().trim().min(1).max(2e3),surfaceId:p,sourceRevision:f}).strict();export{ee as C,ie as S,Me as _,E as a,ae as b,Se as c,dt as d,Ue as f,Ze as g,st as h,ot as i,K as l,rt as m,g as n,tt as o,Ke as p,h as r,et as s,nt as t,he as u,je as v,T as w,Oe as x,We as y};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.