1import{f as E}from"./faTrashAlt.e4dbf726.js";import{_ as B,dJ as S,aU as F,a3 as z}from"./index.474d7b13.js";import{f as D}from"./faPlus.700d6e29.js";import{F as R}from"./index.e6b28c48.js";import{e as V}from"./editorMixin.3e98a765.js";import{N as a,D as n,W as d,U as i,f as r,S as c,E as x,Q as u,a3 as N}from"./vue.00f7c436.js";import{g as U}from"./getYoutubeVideoId.48a6d734.js";import"./faTrashCan.b4d805e3.js";import"./sentry.09480738.js";import"./faSlidersH.3deb0409.js";import"./faCopy.1452ad5a.js";import"./faFloppyDisk.7ea9c02b.js";import"./isEqual.4f114006.js";import"./formConfig.11506f9f.js";import"./faCircle.17f627a7.js";import"./faAlignCenter.3762bffe.js";import"./faArrowRight.6d6d4730.js";const h=(e,t="standard",f=!1)=>{const m=f?U(e):e;if(m){let s="";switch(t){case"medium":s="mq";break;case"high":s="hq";break;default:s=""}return`https://img.youtube.com/vi/${m}/${s}default.jpg`}return null},j={name:"TextImageTemplateEditor",components:{TmlEditableOverlay:S,FormBuilder:R},mixins:[V],inject:["theme"],data(){return{selectedItem:null,items:[],faTimes:F.faTimes,faTrashAlt:E.faTrashAlt,faPlus:D.faPlus,getYoutubeVideoThumbnail:h}},computed:{editor(){var e,t;return(t=(e=this.selectedItem)==null?void 0:e.data)==null?void 0:t.editor},gridColumns(){switch(this.getProperty("limit",1,"number")){case 2:return{xs:2};case 3:return{xs:3};default:case 4:return{xs:2,sm:4}}}},methods:{getItemProperty(e,t){return this.getTemplateProperty(this.selectedItem,e,t)},setItemProperty(e,t){return this.setTemplateProperty(this.selectedItem,e,t)},getPreviewImage(e){return this.getTemplateProperty(e,"media")==="video"?h(this.getTemplateProperty(e,"video")):z(this.getTemplateProperty(e,"image"),240,240)},getItemImageSrc(e){var t;return(t=this.getTemplateProperty(e,"image"))==null?void 0:t.src},onAdd(){this.template.addItems(1)},onEdit(e){this.selectedItem=e.setTheme(this.template.theme),this.$refs.popup.open()},onDelete(e){this.template.removeItems(e)},onReorder(e){e.forEach(t=>{t.data.data.order=t.order})}}},q={class:"flex justify-between mb-4"},O=c("h5",{class:"inline"}," Action ",-1),M={key:0};function W(e,t,f,m,s,l){const p=a("form-builder"),y=a("tml-new-pod"),b=a("tml-editable-overlay"),v=a("tml-placeholder"),P=a("tml-sortable-list"),I=a("tml-input"),_=a("tml-link-selector"),k=a("tml-form"),g=a("tml-button"),T=a("tml-item-tray"),C=a("tml-new-popup"),w=a("template-editor-layout");return n(),d(w,null,{advanced:i(()=>[r(p,{value:e.template.data.properties,fields:{titleSize:{type:"selector",label:"Overlay Title Size",when:e.template.items.some(o=>e.getTemplateProperty(o,"title")),options:[{text:"Small",value:"0"},{text:"Big",value:"1"},{text:"Mega",value:"2"}]},buttonAlign:{...e.config.horizontalAlign,label:"Button Alignment"},borderRadius:{...e.config.borderRadius,label:"Button Corners"},ratio:e.config.ratio.pickOptions("wide","short","4:3","square"),spacing:{...e.config.spacing,when:e.template.data.items.length>1&&e.template.data.items.length!==5},textColor:{type:"color",label:"Text Colour"},backgroundColor:e.config.boxColor,...e.globalFields},groups:{[void 0]:["textColor"],Image:["ratio","spacing","titleSize"],Button:["buttonAlign","borderRadius"],Block:["backgroundColor","fullWidth","fullBackgroundColor"]},"pre-process-field":e.onProcessField,onSet:t[4]||(t[4]=o=>e.setProperty(o.name,o.value))},null,8,["value","fields","pre-process-field"])]),default:i(()=>[r(p,{class:"mb-4",value:e.template.data.properties,fields:{icon:"icon",title:"text"},"pre-process-field":e.onProcessField,onSet:t[0]||(t[0]=o=>e.setProperty(o.name,o.value))},null,8,["value","pre-process-field"]),r(P,{items:e.template.data.items,class:"mb-4 mx-4","item-class-list":"col-6 col-sm-3 px-1 pb-2",onUpdatedItems:l.onReorder,onClick:l.onEdit},{cell:i(({item:o})=>[r(b,{color:l.theme().get("primary.color"),"border-radius":l.theme().get("image.border.radius")},{default:i(()=>[r(y,{title:e.getTemplateProperty(o,"title"),image:l.getItemImageSrc(o),alt:"Item","horizontal-alignment":"center"},null,8,["title","image"])]),_:2},1032,["color","border-radius"])]),appendable:i(()=>[r(v,{"aspect-ratio":1,icon:s.faPlus,text:"Add Image",additive:!1,onClick:l.onAdd},null,8,["icon","onClick"])]),_:1},8,["items","onUpdatedItems","onClick"]),r(p,{value:e.template.data.properties,fields:{copy:"html",action:"custom"},"pre-process-field":e.onProcessField,onSet:t[3]||(t[3]=o=>e.setProperty(o.name,o.value))},{action:i(()=>[c("div",q,[c("div",null,[O,e.getProperty("text")?u("",!0):(n(),x("span",M,"(none)"))])]),r(I,{"field-name":"button-text",placeholder:"Text",value:e.getProperty("text"),onInput:t[1]||(t[1]=o=>e.setProperty("text",o))},null,8,["value"]),r(_,{"field-name":"button-href",value:e.getProperty("href"),"preview-host":e.linkPreviewHost,"show-clear":"","value-after-cleared":"#",onInput:t[2]||(t[2]=o=>e.setProperty("href",o))},null,8,["value","preview-host"])]),_:1},8,["value","pre-process-field"]),r(C,{ref:"popup",name:"edit-template-item-popup",layout:"standard",size:"normal",height:"70vh",title:"Edit Item"},{content:i(()=>
1[l.editor?(n(),d(k,{key:0,"form-name":"page-builder-template-grid-item-editor"},{default:i(()=>[l.editor?(n(),d(N(l.editor),{key:0,template:s.selectedItem,"get-property":l.getItemProperty,"set-property":l.setItemProperty},null,8,["template","get-property","set-property"])):u("",!0)]),_:1})):u("",!0)]),footer:i(({close:o})=>[r(T,{"wide-left-item":""},{primary:i(()=>[r(g,{href:"#",text:"Done",fill:"",onClick:A=>o()},null,8,["onClick"])]),secondary:i(()=>[r(g,{href:"#",icon:s.faTrashAlt,onClick:A=>{l.onDelete(s.selectedItem),o()}},null,8,["icon","onClick"])]),_:2},1024)]),_:1},512)]),_:1})}const se=B(j,[["render",W]]);export{se as default}; 2//# sourceMappingURL=FeatureEditor.2227447a.js.map
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.