1import{a4 as C,u as K,d as S,aA as D,e as A,a8 as M,t as V,s as f,o as m,c as d,m as a,ab as B,ac as y,af as I,ag as x,b1 as _,ad as h,a as T,dw as j}from"./BAs5FZpY.js";import{_ as q}from"./DlAUqK2U.js";const z={class:"gap-block grid grid-cols-1"},F=C({__name:"RenderBlocks",props:{itfKey:{type:String,default:""},blocks:{type:Array,require:!0}},async setup(r){let l,p;const o=r,s=K(),i=S(),c=D("forceView",A(!1));[l,p]=M(()=>s.ensureListItems((o.blocks??[]).map(e=>e.itmId).filter(e=>e)??[],!0,0)),await l,p();const v=T(()=>j(o.blocks?.filter(e=>!e.virtual).map((e,n)=>({itmId:e.itmId,idx:n}))??[],e=>e.itmId,e=>e.idx)),g=T(()=>o.blocks?.map(e=>({...e,idx:v.value?.[e.itmId]})));function $(e,n){window.parent.postMessage({type:"selectBlock",data:{itfKey:o.itfKey,idx:e,itmId:n}},"*")}function w(e,n){window.parent.postMessage({type:"editBlock",data:{itfKey:o.itfKey,idx:e,itmId:n}},"*")}return V(c)&&(f(()=>i.selectedBlock,()=>{if(i.selectedBlock&&document){const e=document.querySelector(`#${i.selectedBlock.itfKey}_${i.selectedBlock?.itmId}_${i.selectedBlock.idx}`);e&&window.scrollTo({top:e?.offsetTop-parseFloat(getComputedStyle(e).scrollMarginTop)})}},{deep:!0}),f(()=>o.blocks?.length,(e,n)=>{(e??0)>(n??0)&&document&&setTimeout(()=>window.scrollTo(0,document.body.scrollHeight),500)})),(e,n)=>(m(),d("div",z,[a(c)?(m(!0),d(B,{key:0},y(a(g),t=>(m(),I(x(e.$getComponent(t,"tpl-debug")),{id:`${r.itfKey}_${t.itmId}_${t.idx}`,item:a(s).itemDic[t.itmId],key:t.itmId,idx:t.idx,"tpl-name":void 0,"data-theme":t?.theme?.length?t.theme:void 0,class:h([{"blk-selected after:border-primary":t.idx==a(i).selectedBlock.idx&&a(i).selectedBlock.itfKey==r.itfKey||a(i).selectedBlock.itmId&&a(i).selectedBlock.itmId==t.itmId||a(i).selectedBlock.id&&a(i).selectedBlock.id==t.itmId,disabled:!1,"!no-gap":t.marginTop===0&&t.marginBottom===0,"!no-gapt":t.marginTop===0&&t.marginBottom!==0,"!no-gapb":t.marginTop!==0&&t.marginBottom===0},"blockfront"]),style:_({marginTop:t.marginTop!=null&&t.marginTop!==0?`${t.marginTop}px!important`:void 0,marginBottom:t.marginBottom!=null&&t.marginBottom!==0?`${t.marginBottom}px!important`:void 0}),onDblclick:u=>t.virtual?()=>{}:w(t.idx,t.itmId),onClick:u=>t.virtual?()=>{}:$(t.idx,t.itmId)},null,40,["id","item","idx","tpl-name","data-theme","class","style","onDblclick","onClick"]))),128)):(m(!0),d(B,{key:1},y(a(g),(t,u)=>(m(),I(x(e.$getComponent(t,"tpl-empty")),{"tpl-name":void 0,id:t?.anchor?.length?t.anchor:`${r.itfKey}_${t.itmId}`,item:a(s).itemDic[t.itmId],"data-theme":t?.theme?.length?t.theme:void 0,class:h([{"!no-gap":t.marginTop===0&&t.marginBottom===0,"!no-gapt":t.marginTop===0&&t.marginBottom!==0,"!no-gapb":t.marginTop!==0&&t.marginBottom===0},"blockfront"]),style:_({marginTop:t.marginTop!=null&&t.marginTop!==0?`${t.marginTop}px!important`:void 0,marginBottom:t.marginBottom!=null&&t.marginBottom!==0?`${t.marginBottom}px!important`:void 0}),key:t.itmId},null,8,["tpl-name","id","item","data-theme","class","style"]))),128))]))}}),E=Object.assign(q(F,[["__scopeId","data-v-ec47d4ce"]]),{__name:"CwRenderBlocks"});export{E as _};
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.