PageSourceSearch

https://smaragd.ai/_nuxt/CbDFRnAy.js

js smaragd.ai collected 2026-10-05 12:38:26 UTC 3,134 bytes, 1 lines download raw bytes

1import{m as _,E as u,P as y,a as T,r as q,i as k,T as E,b as R,u as b}from"./DPGGAfIB.js";import{r as l,d as x,i as M,h as U,j as V,u as j,k as O,s as H,l as L,c as B,m as I,g as i,o as S,a as z,n as X,p as D,q as F}from"./B0CrMWu2.js";const K={name:"EditablePage",props:{content:{type:Object},config:{type:Object,required:!0},templateAnnotations:{type:Object}},setup(t){let a={};return t.templateAnnotations&&(a=l({value:t.templateAnnotations})),{reactiveTemplateAnnotations:a}},data(){return{selectedComponentVariants:"",listeners:{}}},computed:{renderingContent(){const t=E.generateMissingAreas(this.content,this.reactiveTemplateAnnotations.value);return T.getVariant(t,this.reactiveTemplateAnnotations.value)}},methods:{writeAnnotation(){if(this.content&&this.reactiveTemplateAnnotations.value&&this.reactiveTemplateAnnotations.value[this.renderingContent["@path"]]){q(this.$el);const t=this.reactiveTemplateAnnotations.value[this.renderingContent["@path"]];k(this.$el,t,"/cms:page"),u.onFrameReady(),u.refresh()}},updateTemplateAnnotationsProvider(){this.reactiveTemplateAnnotations.value=T.wrap(this.templateAnnotations,this.selectedComponentVariants)}},provide(){return{config:this.config,templateAnnotations:this.reactiveTemplateAnnotations}},mounted(){u.inIframe()&&(y.onMessage(this.listeners,"updateState",t=>{this.selectedComponentVariants=t.selectedComponentVariants,this.updateTemplateAnnotationsProvider()}),y.init(this.listeners),this.writeAnnotation())},beforeUpdate(){u.inIframe()&&(this.updateTemplateAnnotationsProvider(),this.writeAnnotation())},render(){return _(this.renderingContent,this.config.componentMappings,this.config.fallbackComponent)}},N=K,Q=x({__name:"[...slug]",async setup(t){let a,d;const v=l({}),h=M("config",{}),o=U(),P=o.fullPath.split("#")[0],g=l(!0),p=l(!!o.query.mgnlPreview),m=l(null);V("editMode",()=>p);const e=j(),f=Array.isArray(o.query.previewToken)?o.query.previewToken[0]:o.query.previewToken,$=f?`&previewToken=${encodeURIComponent(f)}`:"";if(e&&e.value){const{data:s,error:n}=([a,d]=O(()=>b(P,async()=>{var c,A,w,C;let r=z().host;return $fetch(`${(c=e.value)==null?void 0:c.delivery}${(A=e.value)==null?void 0:A.path}?lang=${(w=e.value)==null?void 0:w.locale}${p.value?"&mgnlPreview="+o.query.mgnlPreview:""}${$}`,{baseURL:"/api/delivery",headers:{...X(F(),D()),"X-requested-site":(C=e.value)==null?void 0:C.site,Host:r}})},"$aROEKgqrzL")),a=await a,d(),a);n&&n.value||s&&s.error?H({statusCode:n.value.statusCode,statusMessage:n.value.message}):(m.value=s.value,g.value=!1)}return L(async()=>{var s,n;if(window.location.search.includes("mgnlPreview")&&o.query.mgnlPreview==="false"){const r=`/${(s=e.value)==null?void 0:s.workspace}${(n=e.value)==null?void 0:n.path}`,c=await $fetch(r,{baseURL:"/api/annotations",headers:{"X-requested-site":e.value.site}});v.value=c}if(window&&e.value){const r=R.getMagnoliaContext(window.location.href,`/${e.value.site}`,[e.value.locale]);p.value=r.isMagnoliaEdit}}),(s,n)=>i(h)&&i(m)&&!i(g)?(S(),B(N,{key:0,content:i(m),config:i(h),templateAnnotations:i(v)},null,8,["content","config","templateAnnotations"])):I("",!0)}});export{Q as default};

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.