PageSourceSearch

https://app.mailercloud.com/js/TemplateCreate.4647ab90.js

js mailercloud.com collected 2026-10-02 17:11:23 UTC 22,839 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"8b2370aa6a02f06cc0bfdb17a93efc5967d7fb4d"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e7fd07cc-7f19-49c8-8252-071c3c3e2cf3",e._sentryDebugIdIdentifier="sentry-dbid-e7fd07cc-7f19-49c8-8252-071c3c3e2cf3")}catch(e){}}(),(self["webpackChunk_Mailercloud_vue3"]=self["webpackChunk_Mailercloud_vue3"]||[]).push([[993],{60059:function(e,t,a){a.d(t,{I:function(){return d}});a(18111),a(22489),a(61701);var l=a(30657),o=a(52134),s=a(93784),n=a(72850),i=a(29668);const c=()=>({page:1,per_page:i.ku,name:"",type:"all"}),d=(0,l.nY)("galleryList",{state:()=>({items:[],loaded:!1,filter:c(),totalItems:0,totalCount:1,editItem:{},total:0,savedTotal:0,mcTotal:0,listLoader:!1,busyLoaderStatus:!0,searchData:"",refreshPage:0,imageDomain:""}),getters:{getItems(e){return e.items.length||e.loaded?e.items.map(e=>({id:e.id,name:e.name,image:e.image,html:e.html,type:e.type,cid:e.cid,creativeImg:e.creativeImg,tempImage:(0,n.hY)()+"/uploads/template_images/"+e.creativeImg})):(0,s.eL)()}},actions:{fetchItems(e){return Object.keys(e).length?(this.filter={...e},this.totalCount=1,(0,o.LN)(e).then(({items:e,total:t,mcTotal:a})=>(this.items=e,this.totalItems=t,this.totalCount=t,this.mcTotal=a,this.loaded=!0,this.listLoader=!0,this.busyLoaderStatus=!0,t))):Promise.resolve(this.total)},deleteTemplate({id:e}){return o.Ay.delete(e).then(()=>{this.refreshItems()})},checkNameExists(e){return o.Ay.checkNameExists(e)},rename(e){return o.Ay.rename(e).then(()=>{this.refreshItems()})},duplicate(e){return o.Ay.duplicate(e).then(()=>{this.refreshItems()})},refreshItems(){this.loaded=!1,this.fetchItems(this.filter)},resetItems(){this.items=[],this.loaded=!1},resetState(){this.items=[],this.loaded=!1,this.filter=c(),this.totalItems=0,this.totalCount=1,this.editItem={},this.total=0,this.savedTotal=0,this.mcTotal=0,this.listLoader=!1,this.busyLoaderStatus=!0,this.searchData="",this.refreshPage=0}}})},8195:function(e,t,a){a.r(t),a.d(t,{default:function(){return N}});var l=a(80223),o=a(43970),s=a(27608),n=a(21167),i=a(79493),c=(a(44114),a(56768)),d=a(24232),r=a(45130),u=a(90144),m=a(81387),p=a(50003),v=a(52747),g=a(22193),h=a(17209),f=a(34511);const y={class:"create-list create-list-template-layout mt-4 position-relative"},k={class:"custom-tab"},b={class:"p-0 choose-nav card-header"},L={class:"mobile-nav-container d-block d-md-none"},I={class:"nav-right"},w={class:"mobile-nav-dropdown"},C={class:"choose-content"},T={class:"card-body code-own"},_={class:"code-own-card-body"},S=["src","width"],F={class:"code-own-title"},E=["innerHTML"];var x=Object.assign({name:"TemplateCodeYourOwnView"},{__name:"TemplateCodeYourOwnView",setup(e){const t=(0,m.rd)(),a=(0,p.i)(),x=(0,c.EW)(()=>a.editItem),D={value:0,steps:["Choose type","Create","Confirm"]},J=(0,u.KR)(!1),N=(0,u.KR)(!1),R=[{type:2,title:"Import HTML",content:"Upload an HTML file containing the<br />template code",image:"pc",width:42,action:"Start an import"},{type:1,title:"Paste your code",content:"Copy/Paste your HTML code to create a custom template design",image:"copy",width:34,action:"Copy and paste"},{type:4,title:"Import ZIP",content:"Upload a ZIP file containing the HTML code and image",image:"zip",width:44,action:"Start an import"}],K={pc:g,copy:h,zip:f};function V(e){return K[e]||g}function W(e,l=!1){a.setEditItemData({...x.value,type:e}
1),l&&(1===e?t.push({name:"PasteCode"}):2===e?t.push({name:"ImportHtml"}):4===e&&t.push({name:"ImportZip"}))}function O(){t.push({name:"Gallery"})}function A(e){J.value=!1,t.push({name:e})}function X(e){0===e&&O()}return(0,c.sV)(()=>{x.value.name?(0,c.dY)(()=>{N.value=!0}):O()}),(e,t)=>{const a=i.r,u=i.a,m=n.t,p=s.t,g=o.t,h=l.t;return(0,c.uX)(),(0,c.Wv)(v.A,{icon:"gallery",title:"Create template",progress:D,disabled:!1,"full-width":!0,"show-back":"",class:"template-layout-page",onBack:O,onClose:O,onChangeProgress:X},{default:(0,c.k6)(()=>[(0,c.Lk)("div",y,[(0,c.bF)(g,{"no-gutters":""},{default:(0,c.k6)(()=>[(0,c.bF)(p,null,{default:(0,c.k6)(()=>[(0,c.bF)(g,{class:"mb-4 mb-md-5"},{default:(0,c.k6)(()=>[(0,c.bF)(p,{class:"template-layout"},{default:(0,c.k6)(()=>[(0,c.Lk)("div",k,[(0,c.Lk)("div",b,[(0,c.Lk)("div",L,[(0,c.Lk)("div",{class:(0,d.C4)(["mobile-nav-button mt-2",{active:J.value}]),onClick:t[0]||(t[0]=e=>J.value=!J.value)},[t[6]||(t[6]=(0,c.Lk)("div",{class:"nav-left"},[(0,c.Lk)("span",null,"Code your own")],-1)),(0,c.Lk)("div",I,[t[5]||(t[5]=(0,c.Lk)("span",null,"Navigate",-1)),(0,c.Lk)("i",{class:(0,d.C4)(["fas fa-chevron-down nav-arrow",{rotated:J.value}])},null,2)])],2),(0,c.bo)((0,c.Lk)("div",w,[(0,c.Lk)("div",{class:"mobile-nav-item",onClick:t[1]||(t[1]=e=>A("TemplateLayout"))}," Layout "),(0,c.Lk)("div",{class:"mobile-nav-item",onClick:t[2]||(t[2]=e=>A("TemplateThemes"))}," Theme "),t[7]||(t[7]=(0,c.Lk)("div",{class:"mobile-nav-item active"},"Code your own",-1))],512),[[r.aG,J.value]])]),(0,c.bF)(u,{pills:"",class:"card-header-pills d-none d-md-flex"},{default:(0,c.k6)(()=>[(0,c.bF)(a,{onClick:t[3]||(t[3]=e=>A("TemplateLayout"))},{default:(0,c.k6)(()=>[...t[8]||(t[8]=[(0,c.eW)(" Layout ",-1)])]),_:1}),(0,c.bF)(a,{onClick:t[4]||(t[4]=e=>A("TemplateThemes"))},{default:(0,c.k6)(()=>[...t[9]||(t[9]=[(0,c.eW)(" Theme ",-1)])]),_:1}),(0,c.bF)(a,{active:""},{default:(0,c.k6)(()=>[...t[10]||(t[10]=[(0,c.eW)("Code your own",-1)])]),_:1})]),_:1})]),(0,c.Lk)("div",C,[(0,c.Lk)("div",T,[N.value?((0,c.uX)(),(0,c.Wv)(g,{key:1,class:"code-own-cards-row"},{default:(0,c.k6)(()=>[((0,c.uX)(),(0,c.CE)(c.FK,null,(0,c.pI)(R,(e,a)=>(0,c.bF)(p,{key:"temp-type-"+a,sm:"12",md:"4",class:"code-own-col mb-4 mb-md-0 px-lg-3 px-xl-4"},{default:(0,c.k6)(()=>[(0,c.bF)(m,{class:(0,d.C4)(["code-own-card h-100 text-center card-cyo",e.image+(x.value.type==e.type?" active":"")]),"no-body":"",onClick:t=>W(e.type),onDblclick:t=>W(e.type,!0)},{default:(0,c.k6)(()=>[t[12]||(t[12]=(0,c.Lk)("span",{class:"active-radio"},null,-1)),(0,c.Lk)("div",_,[(0,c.Lk)("span",{class:(0,d.C4)(["upload-icons",e.image])},[(0,c.Lk)("img",{src:V(e.image),width:e.width,class:"img-fluid",alt:""},null,8,S)],2),(0,c.Lk)("h3",F,(0,d.v_)(e.title),1),(0,c.Lk)("p",{class:"code-own-desc",innerHTML:e.content},null,8,E),(0,c.bF)(h,{variant:"outline-primary",class:"code-own-btn",onClick:(0,r.D$)(t=>W(e.type,!0),["stop"])},{default:(0,c.k6)(()=>[(0,c.eW)((0,d.v_)(e.action),1)]),_:2},1032,["onClick"])])]),_:2},1032,["class","onClick","onDblclick"])]),_:2},1024)),64))]),_:1})):((0,c.uX)(),(0,c.Wv)(g,{key:0,class:"code-own-cards-row"},{default:(0,c.k6)(()=>[((0,c.uX)(),(0,c.CE)(c.FK,null,(0,c.pI)(3,e=>(0,c.bF)(p,{key:"ph-"+e,sm:"12",md:"4",class:"code-own-col mb-4 mb-md-0 px-lg-3 px-xl-4"},{default:(0,c.k6)(()=>[(0,c.bF)(m,{class:"code-own-card h-100 text-center","no-body":""},{default:(0,c.k6)(()=>[...t[11]||(t[11]=[(0,c.Lk)("div",{class:"code-own-card-body placeholder-glow"},[(0,c.Lk)("span",{class:"placeholder rounded-circle",style:{width:"60px",height:"60px"}}),(0,c.Lk)("span",{class:"placeholder placeholder-lg col-8 mt-3",style:{height:"1.25rem"}}),(0,c.Lk)("span",{class:"placeholder col-10 mt-3",style:{height:"0.9rem"}}),(0,c.Lk)("span",{class:"placeholder col-8 mt-1",style:{height:"0.9rem"}}),(0,c.Lk)("span",{class:"placeholder col-5 mt-4",style:{height:"2.25rem","border-radius":"8px"}})],-1)])]),_:1})]),_:1})),64))]),_:1}))])])])]),_:1})]),_:1})]),_:1})]),_:1})])]),_:1})}}}),D=a(71241);const J=(0,D.A)(x,[["__scopeId","data-v-653c0837"]]);var N=J},80145:function(e,t,a){a.r(t),a.d(t,{default:function(){return G}});var l=a(43970),o=a(27608),s=a(79493),n=(a(44114),a(56768)),i=a(24232),c=a(45130),d=a(90144),r=a(81387),u=a(50003),m=a(60059),p=a(65663),v=a(52134),g=a(52747),h=a(92099),f=a(26e3),y=a(40801),k=a(80894),b=a(43471),L=a(64444),I=a(92989),w=a(24714),C=a(66683);const T={key:0,class:"template-list-ul template-layout-list list-inline"},_={key:1,class:"template-list-ul template-layout-list list-inline"},S=["onClick","onDblclick"],F={class:"template-container cursor-pointer no-scroll"},E=["src","alt"],x={class:"template-name"};var D={__name:"McDragLayout",props:{selected:{type:Number,default:0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["select","dblselect"],setup(e,{emit:t}){const a=e,l=t,o={1:h,2:f,3:y,4:k,5:b,6:L,7:I,8:w,9:C},s=[{id:1,name:"Blank layout"},{id:2,name:"Blank layout - Full width"},{id:3,name:"Simple text "},{id:4,name:"Simple text - Full width "},{id:5,name:"1 Column"},{id:6,name:"1:2 Column"},{id:7,name:"1:3 Column"},{id:8,name:"1:2:1 Column"},{id:9,name:"1:3:1 Column"}];function c(e,t){a.disabled||l(t?"dblselect":"select",e)}return(t,a)=>((0,n.uX)(),(0,n.CE)("div",null,[e.loading?((0,n.uX)(),(0,n.CE)("ul",T,[((0,n.uX)(),(0,n.CE)(n.FK,null,(0,n.pI)(9,e=>(0,n.Lk)("li",{key:"ph-"+e,class:"template-list-item position-relative"},[...a[0]||(a[0]=[(0,n.Lk)("div",{class:"template-container no-scroll"},[(0,n.Lk)("div",{class:"template-in-bg template-in-bg-placeholder placeholder-glow"}
1),(0,n.Lk)("p",{class:"template-name placeholder-glow mb-0"},[(0,n.Lk)("span",{class:"placeholder placeholder-sm col-10"})])],-1)])])),64))])):((0,n.uX)(),(0,n.CE)("ul",_,[((0,n.uX)(),(0,n.CE)(n.FK,null,(0,n.pI)(s,(t,a)=>(0,n.Lk)("li",{key:a,class:(0,i.C4)(["template-list-item position-relative",{active:e.selected===t.id}]),onClick:e=>c(t.id),onDblclick:e=>c(t.id,!0)},[(0,n.Lk)("div",F,[(0,n.Lk)("img",{src:o[t.id],alt:t.name,class:"template-in-bg template-in-bg-img"},null,8,E),(0,n.Lk)("p",x,(0,i.v_)(t.name),1)])],42,S)),64))]))]))}},J=a(71241);const N=(0,J.A)(D,[["__scopeId","data-v-464ca2f0"]]);var R=N,K=a(99037),V=a(12339);const W={class:"create-list create-list-template-layout mt-4 position-relative"},O={class:"custom-tab"},A={class:"p-0 choose-nav card-header"},X={class:"mobile-nav-container d-block d-md-none"},P={class:"nav-right"},M={class:"mobile-nav-dropdown"},B={class:"choose-content"},j={class:"card-body"};var Y=Object.assign({name:"TemplateLayoutView"},{__name:"TemplateLayoutView",setup(e){const{publishBrandKit:t,seedBrandKitContent:a}=(0,V.R)(),h=(0,r.rd)(),f=(0,r.lq)(),y=(0,u.i)(),k=(0,m.I)(),b={value:0,steps:["Choose type","Create","Confirm"]},L=(0,d.KR)(!1),I=(0,d.KR)(!0),w=(0,d.KR)(0),C=(0,d.KR)(!1),T=(0,d.KR)(!1),_=(0,d.KR)(!1),S=(0,d.KR)(localStorage.getItem("changeLayoutTemplateId")||null),F=(0,n.EW)(()=>!!S.value);function E(e){I.value=!1,w.value=e}function x(e){w.value=0,I.value=!0,L.value=!0,S.value?D(e):J(e)}function D(e){const t=S.value,a=localStorage.getItem("imageDomain");console.log("[TemplateLayoutView] changeLayout called with layoutId:",e,"existingId:",t),v.Ay.getDragTemplate({id:e}).then(e=>{if(console.log("[TemplateLayoutView] getDragTemplate raw response:",JSON.stringify(e).substring(0,500)),e.data&&e.data.data){let l=e.data.data.json||"{}";console.log("[TemplateLayoutView] jsonStr length:",l.length,"preview:",l.substring(0,300)),a&&(l=l.replace(/"\/img\//g,'"'+a+"/img/"));const o=JSON.parse(l);console.log("[TemplateLayoutView] parsed tempJson keys:",Object.keys(o),"hasContents:",!!o.contents,"hasProperties:",!!o.properties),N(t,{tempJson:o})}else console.error("[TemplateLayoutView] changeLayout: invalid response structure. response keys:",Object.keys(e),"response.data:",e.data?JSON.stringify(e.data).substring(0,200):"NULL"),(0,p.showError)("Failed to load layout data.")}).catch(e=>{(0,p.showError)(e.message)}).finally(()=>{I.value=!1,L.value=!1})}function J(e){const t=y.editItem.name;console.log("[TemplateLayoutView] createFromLayout called with layoutId:",e,"templateName:",t),v.Ay.duplicateLayout({id:e,name:t}).then(e=>{console.log("[TemplateLayoutView] duplicateLayout raw response:",JSON.stringify(e).substring(0,500));const t=e.data||e,a=t.id||e.id;if(console.log("[TemplateLayoutView] templateData keys:",Object.keys(t),"templateId:",a),console.log("[TemplateLayoutView] tempJson type:",typeof t.tempJson,"tempJson keys:",t.tempJson?Object.keys(t.tempJson):"NULL"),t&&a){const e=localStorage.getItem("imageDomain"),l=localStorage.getItem("defaultDomain");if(e&&l){t.html=(t.html||"").replace(new RegExp(l,"g"),e);let a=JSON.stringify(t.tempJson);a=a.replace(new RegExp(l,"g"),e),t.tempJson=JSON.parse(a)}y.setEditItemData({...t,id:a}),y.itemLoaded=!0,k.loaded=!1,N(a,t)}else(0,p.showError)("Failed to create template: missing template ID from API response.")}).catch(e=>{(0,p.showError)(e.message)}).finally(()=>{I.value=!1,L.value=!1})}function N(e,l){_.value=!0;let o=l.tempJson||{};if("string"===typeof o)try{o=JSON.parse(o)}catch(n){console.error("[TemplateLayoutView] Failed to parse tempJson string:",n)}const s=JSON.stringify(o);console.log("[TemplateLayoutView] redirectToDdBuilder - templateId:",e),console.log("[TemplateLayoutView] tempJson type:",typeof o,"hasContents:",!!o.contents,"hasProperties:",!!o.properties,"hasTree:",!!o.tree),console.log("[TemplateLayoutView] dragJson length:",s.length,"preview:",s.substring(0,300)),localStorage.setItem("dragJson",s),t(),a("template",e),localStorage.setItem("templateMode","true"),localStorage.setItem("templateId",e),localStorage.setItem("templateName",l.name||y.editItem.name||""),localStorage.setItem("templateReturnUrl","/gallery"),localStorage.removeItem("isMcTemplate"),localStorage.removeItem("changeLayoutTemplateId"),setTimeout(()=>{window.location.href="/dd-builder/"+e},300)}function Y(){S.value?(localStorage.removeItem("changeLayoutTemplateId"),window.location.href="/dd-builder/"+S.value):h.push({name:"Gallery"})}function H(e){C.value=!1,h.push({name:e})}function G(e){0===e&&Y()}return(0,n.sV)(()=>
1{if(!S.value&&f.params.id&&(S.value=f.params.id),S.value){const e=localStorage.getItem("templateName")||"";return y.clearEditItem(),y.setEditItemData({name:e}),y.fetchImageDomain(),void(0,n.dY)(()=>{T.value=!0})}y.editItem.name&&!y.editItem.id?(y.fetchImageDomain(),(0,n.dY)(()=>{T.value=!0})):Y()}),(e,t)=>{const a=s.r,d=s.a,r=o.t,u=l.t;return(0,n.uX)(),(0,n.CE)(n.FK,null,[(0,n.bF)(g.A,{icon:"gallery",title:F.value?"Change layout":"Create template",progress:F.value?null:b,loading:L.value,disabled:I.value,backbutton:L.value,"full-width":!0,"show-back":!F.value,"hide-back":F.value,class:"template-layout-page",onBack:Y,onConfirm:t[5]||(t[5]=e=>x(w.value)),onClose:Y,onChangeProgress:G},{default:(0,n.k6)(()=>[(0,n.Lk)("div",W,[(0,n.bF)(u,{"no-gutters":""},{default:(0,n.k6)(()=>[(0,n.bF)(r,null,{default:(0,n.k6)(()=>[(0,n.bF)(u,{class:"mb-4 mb-md-5"},{default:(0,n.k6)(()=>[(0,n.bF)(r,{class:"template-layout"},{default:(0,n.k6)(()=>[(0,n.Lk)("div",O,[(0,n.Lk)("div",A,[(0,n.Lk)("div",X,[(0,n.Lk)("div",{class:(0,i.C4)(["mobile-nav-button mt-2",{active:C.value}]),onClick:t[0]||(t[0]=e=>C.value=!C.value)},[t[7]||(t[7]=(0,n.Lk)("div",{class:"nav-left"},[(0,n.Lk)("span",null,"Layout")],-1)),(0,n.Lk)("div",P,[t[6]||(t[6]=(0,n.Lk)("span",null,"Navigate",-1)),(0,n.Lk)("i",{class:(0,i.C4)(["fas fa-chevron-down nav-arrow",{rotated:C.value}])},null,2)])],2),(0,n.bo)((0,n.Lk)("div",M,[t[8]||(t[8]=(0,n.Lk)("div",{class:"mobile-nav-item active"},"Layout",-1)),(0,n.Lk)("div",{class:"mobile-nav-item",onClick:t[1]||(t[1]=e=>H("TemplateThemes"))}," Theme "),F.value?(0,n.Q3)("",!0):((0,n.uX)(),(0,n.CE)("div",{key:0,class:"mobile-nav-item",onClick:t[2]||(t[2]=e=>H("TemplateCode"))}," Code your own "))],512),[[c.aG,C.value]])]),(0,n.bF)(d,{pills:"",class:"card-header-pills d-none d-md-flex"},{default:(0,n.k6)(()=>[(0,n.bF)(a,{active:""},{default:(0,n.k6)(()=>[...t[9]||(t[9]=[(0,n.eW)("Layout",-1)])]),_:1}),(0,n.bF)(a,{onClick:t[3]||(t[3]=e=>H("TemplateThemes"))},{default:(0,n.k6)(()=>[...t[10]||(t[10]=[(0,n.eW)(" Theme ",-1)])]),_:1}),F.value?(0,n.Q3)("",!0):((0,n.uX)(),(0,n.Wv)(a,{key:0,onClick:t[4]||(t[4]=e=>H("TemplateCode"))},{default:(0,n.k6)(()=>[...t[11]||(t[11]=[(0,n.eW)(" Code your own ",-1)])]),_:1}))]),_:1})]),(0,n.Lk)("div",B,[(0,n.Lk)("div",j,[(0,n.bF)(R,{disabled:L.value,loading:!T.value,selected:w.value,onSelect:E,onDblselect:x},null,8,["disabled","loading","selected"])])])])]),_:1})]),_:1})]),_:1})]),_:1})])]),_:1},8,["title","progress","loading","disabled","backbutton","show-back","hide-back"]),_.value?((0,n.uX)(),(0,n.Wv)(K.A,{key:0})):(0,n.Q3)("",!0)],64)}}});const H=(0,J.A)(Y,[["__scopeId","data-v-633ecb9e"]]);var G=H},59479:function(e,t,a){a.r(t),a.d(t,{default:function(){return D}});var l=a(43970),o=a(27608),s=a(79493),n=(a(44114),a(56768)),i=a(24232),c=a(45130),d=a(90144),r=a(81387),u=a(50003),m=a(60059),p=a(65663),v=a(29668),g=a(52134),h=a(52747),f=a(83151),y=a(99037),k=a(12339);const b={class:"create-list create-list-template-layout mt-4 position-relative"},L={class:"custom-tab"},I={class:"p-0 choose-nav card-header"},w={class:"mobile-nav-container d-block d-md-none"},C={class:"nav-right"},T={class:"mobile-nav-dropdown"},_={class:"choose-content"},S={class:"card-body"};var F=Object.assign({name:"TemplateThemesView"},{__name:"TemplateThemesView",setup(e){const{publishBrandKit:t,seedBrandKitContent:a}=(0,k.R)(),F=(0,r.rd)(),E=(0,u.i)(),x=(0,m.I)(),D={value:0,steps:["Choose type","Create","Confirm"]},J=(0,d.KR)({page:1,per_page:v.ku,name:"",type:"mc"}),N=(0,d.KR)(!1),R=(0,d.KR)(!1),K=(0,d.KR)(""),V=(0,d.KR)(!1),W=(0,d.KR)(!1),O=!!localStorage.getItem("changeLayoutTemplateId"),A=(0,n.EW)(()=>E.totalItems),X=(0,n.EW)(()=>E.totalItems),P=(0,n.EW)(()=>E.getItems);function M(){return E.fetchItems(J.value)}function B({page:e,perPage:t}){J.value.page=e,J.value.per_page=t,E.loaded=!1,R.value=!0,M().finally(()=>{R.value=!1})}function j(e){J.value.name=e,J.value.page=1,E.loaded=!1,R.value=!0,M().finally(()=>{R.value=!1})}function Y(){N.value=!0,O?H():G()}function H(){const e=localStorage.getItem("changeLayoutTemplateId"),t=localStorage.getItem("imageDomain"),a=localStorage.getItem("defaultDomain");g.Ay.getDetails({id:K.value}).then(l=>{if(l.data){let o=l.data.tempJson||{};if(t&&a&&"object"===typeof o){let e=JSON.stringify(o);e=e.replace(new RegExp(a,"g"),t),o=JSON.parse(e)}z(e,{tempJson:o})}else(0,p.showError)("Failed to load theme data.")}).catch(e=>{(0,p.showError)(e.message)}).finally(()=>{N.value=!1})}
1function G(){g.Ay.duplicate({id:K.value,name:E.editItem.name}).then(e=>{const t=e.data||e,a=t.id||e.id;t&&a&&(E.setEditItemData({...t,id:a}),E.itemLoaded=!0,x.loaded=!1,z(a,t))}).catch(e=>{(0,p.showError)(e.message)}).finally(()=>{N.value=!1})}function Q(e){N.value||(K.value=e,Y())}function U(e){K.value=e}function z(e,l){W.value=!0,localStorage.setItem("dragJson",JSON.stringify(l.tempJson||{})),t(),a("template",e),localStorage.setItem("templateMode","true"),localStorage.setItem("templateId",e),localStorage.setItem("templateName",l.name||E.editItem.name||""),localStorage.setItem("templateReturnUrl","/gallery"),localStorage.removeItem("isMcTemplate"),localStorage.removeItem("changeLayoutTemplateId"),setTimeout(()=>{window.location.href="/dd-builder/"+e},300)}function Z(){O?(localStorage.removeItem("changeLayoutTemplateId"),window.location.href="/dd-builder/"+localStorage.getItem("templateId")):F.push({name:"Gallery"})}function q(e){V.value=!1,F.push({name:e})}function $(e){0===e&&Z()}return(0,n.sV)(()=>{if(O){const e=localStorage.getItem("templateName")||"";E.clearEditItem(),E.setEditItemData({name:e})}else if(!E.editItem.name||E.editItem.id)return void Z();E.loaded=!1,M().catch(()=>{E.loaded=!0,E.items=[]})}),(e,t)=>{const a=s.r,r=s.a,u=o.t,m=l.t;return(0,n.uX)(),(0,n.CE)(n.FK,null,[(0,n.bF)(h.A,{icon:"gallery",title:O?"Change layout":"Create template",progress:O?null:D,loading:N.value,disabled:!K.value,backbutton:N.value,"full-width":!0,"show-back":!O,"hide-back":O,class:"template-layout-page",onBack:Z,onConfirm:Y,onClose:Z,onChangeProgress:$},{default:(0,n.k6)(()=>[(0,n.Lk)("div",b,[(0,n.bF)(m,{"no-gutters":""},{default:(0,n.k6)(()=>[(0,n.bF)(u,null,{default:(0,n.k6)(()=>[(0,n.bF)(m,{class:"mb-4 mb-md-5"},{default:(0,n.k6)(()=>[(0,n.bF)(u,{class:"template-layout"},{default:(0,n.k6)(()=>[(0,n.Lk)("div",L,[(0,n.Lk)("div",I,[(0,n.Lk)("div",w,[(0,n.Lk)("div",{class:(0,i.C4)(["mobile-nav-button mt-2",{active:V.value}]),onClick:t[0]||(t[0]=e=>V.value=!V.value)},[t[6]||(t[6]=(0,n.Lk)("div",{class:"nav-left"},[(0,n.Lk)("span",null,"Theme")],-1)),(0,n.Lk)("div",C,[t[5]||(t[5]=(0,n.Lk)("span",null,"Navigate",-1)),(0,n.Lk)("i",{class:(0,i.C4)(["fas fa-chevron-down nav-arrow",{rotated:V.value}])},null,2)])],2),(0,n.bo)((0,n.Lk)("div",T,[(0,n.Lk)("div",{class:"mobile-nav-item",onClick:t[1]||(t[1]=e=>q("TemplateLayout"))}," Layout "),t[7]||(t[7]=(0,n.Lk)("div",{class:"mobile-nav-item active"},"Theme",-1)),O?(0,n.Q3)("",!0):((0,n.uX)(),(0,n.CE)("div",{key:0,class:"mobile-nav-item",onClick:t[2]||(t[2]=e=>q("TemplateCode"))}," Code your own "))],512),[[c.aG,V.value]])]),(0,n.bF)(r,{pills:"",class:"card-header-pills d-none d-md-flex"},{default:(0,n.k6)(()=>[(0,n.bF)(a,{onClick:t[3]||(t[3]=e=>q("TemplateLayout"))},{default:(0,n.k6)(()=>[...t[8]||(t[8]=[(0,n.eW)(" Layout ",-1)])]),_:1}),(0,n.bF)(a,{active:""},{default:(0,n.k6)(()=>[...t[9]||(t[9]=[(0,n.eW)("Theme",-1)])]),_:1}),O?(0,n.Q3)("",!0):((0,n.uX)(),(0,n.Wv)(a,{key:0,onClick:t[4]||(t[4]=e=>q("TemplateCode"))},{default:(0,n.k6)(()=>[...t[10]||(t[10]=[(0,n.eW)(" Code your own ",-1)])]),_:1}))]),_:1})]),(0,n.Lk)("div",_,[(0,n.Lk)("div",S,[(0,n.bF)(f.A,{items:P.value,"total-rows":X.value,"search-name":J.value.name,count:A.value,"total-count":(0,d.R1)(E).totalCount,selected:K.value,loaded:(0,d.R1)(E).loaded,"busy-loader-status":!0,"current-page":J.value.page,"per-page-count":J.value.per_page,"search-loading":R.value,selectable:"",onPerPageChange:B,onFilterChange:j,onEdit:Q,onSelect:U},null,8,["items","total-rows","search-name","count","total-count","selected","loaded","current-page","per-page-count","search-loading"])])])])]),_:1})]),_:1})]),_:1})]),_:1})])]),_:1},8,["title","progress","loading","disabled","backbutton","show-back"]),W.value?((0,n.uX)(),(0,n.Wv)(y.A,{key:0})):(0,n.Q3)("",!0)],64)}}}),E=a(71241);const x=(0,E.A)(F,[["__scopeId","data-v-6962b582"]]);var D=x},92099:function(e,t,a){e.exports=a.p+"img/column1.aa4d17c8.svg"},26e3:function(e,t,a){e.exports=a.p+"img/column2.a6fe83f2.svg"},40801:function(e,t,a){e.exports=a.p+"img/column3.05167b92.svg"},80894:function(e,t,a){e.exports=a.p+"img/column4.8e32d7e1.svg"},43471:function(e,t,a){e.exports=a.p+"img/column5.2437521f.svg"},64444:function(e,t,a){e.exports=a.p+"img/column6.9aa388cb.svg"},92989:function(e,t,a){e.exports=a.p+"img/column7.6e16620e.svg"},24714:function(e,t,a){e.exports=a.p+"img/column8.c4d17894.svg"},66683:function(e,t,a){e.exports=a.p+"img/column9.83ddcdc8.svg"},17209:function(e,t,a){e.exports=a.p+"img/upload-copy.4cb99acd.svg"},22193:function(e,t,a){e.exports=a.p+"img/upload-pc.40812fd2.svg"},34511:function(e,t,a){e.exports=a.p+"img/upload-zip.c596807c.svg"}}]);
2//# sourceMappingURL=TemplateCreate.4647ab90.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.