| 1 |
var I=Object.defineProperty;var j=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var f=(i,l,a)=>l in i?I(i,l,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[l]=a,r=(i,l)=>{for(var a in l||(l={}))L.call(l,a)&&f(i,a,l[a]);if(j)for(var a of j(l))M.call(l,a)&&f(i,a,l[a]);return i};import{k as R,r as S,a as z,e as F,_ as o,j as e,N as T,U as H,E as O,y as P,n as V,f as B,b as G,c7 as U,w as E,ak as Y,p as q,c as J,l as _,d as K,u as Q,R as W,m as u,aG as w,aH as C,aM as X}from"./main-162.js";import{L as Z}from"./bf-523-194.js";import{S as ee}from"./bf-790-195.js";import{B as y}from"./bf-586-126.js";import{t as N}from"./bf-307-196.js";import{F as k}from"./bf-926-85.js";import"./bf-644-69.js";import"./bf-917-73.js";import"./bf-8-79.js";import"./bf-304-143.js";import"./bf-819-116.js";import"./bf-608-71.js";function te({formID:i}){const[l,a]=R(Y),[t,m]=S.useState({show:!1}),{css:x}=z(),{pathname:p}=F(),D=s=>{const c=q(l,n=>{n.splice(s+1,0,{title:n[s].title,sub:n[s].sub,body:n[s].body}),n.push({updateTem:1})});a(c)},$=(s,c)=>{if(c.original.id){const n=J({formID:i,id:c.original.id},"bitforms_delete_mailtemplate").then(h=>{if(h!==void 0&&h.success){const b=_(l);b.splice(s,1),a(b)}});K.promise(n,{loading:"Deleting",success:"Successfully Deleted",error:"Error Occurred"})}else{const n=_(l);n.splice(s,1),a(n)}},d=()=>{t.show=!1,m(r({},t))},g=(s,c)=>{t.btnTxt=o("Delete"),t.body=o("Are you sure to delete this template"),t.btnClass="",t.action=()=>{$(s,c),d()},t.show=!0,m(r({},t))},v=s=>{t.btnTxt=o("Duplicate"),t.body=o("Are you sure to duplicate this template?"),t.btnClass="blue",t.action=()=>{D(s),d()},t.show=!0,m(r({},t))},A=[{Header:o("Template Name"),accessor:"title",Cell:s=>e.jsx(T,{to:`${p}/${s.row.index}`,children:e.jsx("b",{children:s.cell.value})})},{Header:o("Action"),accessor:"action",Cell:s=>e.jsxs(e.Fragment,{children:[e.jsx(y,{onClick:()=>v(s.row.index),className:"icn-btn mr-2 tooltip pos-rel",style:{"--tooltip-txt":`'${o("Duplicate")}'`},children:e.jsx(H,{size:"22"})}),e.jsx(T,{to:`${p}/${s.row.index}`,className:"icn-btn mr-2 flx flx-center tooltip pos-rel",style:{"--tooltip-txt":`'${o("Edit")}'`},children:e.jsx(O,{size:"22"})}),e.jsx(y,{onClick:()=>g(s.row.index,s.row),className:"icn-btn tooltip pos-rel",style:{"--tooltip-txt":`'${o("Delete")}'`},children:e.jsx(P,{size:"21"})})]})}];return e.jsxs("div",{className:"w-7",children:[e.jsx(V,{show:t.show,close:d,btnTxt:t.btnTxt,btnClass:t.btnClass,body:t.body,action:t.action}),e.jsx("h2",{children:o("Email Templates")}),e.jsxs("h5",{children:["How to setup Email Templates & Send Email Notification: ",e.jsx("a",{href:N.emailTemplates.link,target:"_blank",rel:"noreferrer",className:"yt-txt ml-1 mr-1",children:"YouTube"}),e.jsx("a",{href:N.emailTemplatesDoc.link,target:"_blank",rel:"noreferrer",className:"doc-txt",children:"Documentation"})]}),e.jsxs("div",{className:"",children:[e.jsxs(B,{to:`${p}/new`,className:`${x(G.btn)} blue`,children:[e.jsx(Z,{size:"20"})," ",o("Add New Template")]}),l.length>0?e.jsx(U,{height:"60vh",className:"btcd-neu-table mr-1",columns:A,data:l}):e.jsxs("div",{className:x(E.btcdEmpty,E.txCenter),children:[e.jsx(ee,{size:"50"}),o("Empty")]})]})]})}const se=w(()=>C(()=>import("./bf-945-192.js"),["./bf-945-192.js","./main-162.js","./main-162.css","./bf-644-69.js","./bf-917-73.js","./bf-667-413.css","./bf-238-412.css","./bf-361-122.js","./bf-399-118.js","./bf-889-417.css"],import.meta.url),{fallback:e.jsx(k,{})}),le=w(()=>C(()=>import("./bf-737-193.js"),["./bf-737-193.js","./main-162.js","./main-162.css","./bf-644-69.js","./bf-917-73.js","./bf-667-413.css","./bf-238-412.css","./bf-361-122.js","./bf-399-118.js","./bf-889-417.css"],import.meta.url),{fallback:e.jsx(k,{})});function je(){const i=Q(X);return e.jsxs(W,{children:[e.jsx(u,{index:!0,element:e.jsx(te,{formID:i})}),e.jsx(u,{path:"/new",element:e.jsx(se,{})}),e.jsx(u,{path:"/:id",element:e.jsx(le,{})})]})}export{je as default}; |